Compare commits

...

5 Commits

Author SHA1 Message Date
github-actions[bot] ea5e0fb096 ci(changesets): version packages (#1338)
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
2023-08-09 21:42:53 -03:00
Junior Garcia 26f64d043d fix(storybook): padding 2023-08-09 21:40:54 -03:00
Jakob Guddas a078c3dcd2 chore: storybook improvements (#1335) 2023-08-09 21:36:54 -03:00
Jakob Guddas 5a50390e3f fix: moved sr only modal close buttons to not show unnecessary scroll bar (#1333)
* fix: moved sr only modal close buttons to not show unnecessary scroll bar

* Create sour-lizards-allow.md
2023-08-09 21:36:14 -03:00
Tianen Pang 894d85d059 docs(table): use case example (#1326) 2023-08-08 14:43:40 -03:00
9 changed files with 65 additions and 36 deletions
+11 -7
View File
@@ -271,8 +271,6 @@ export default function Page() {
const [page, setPage] = useState(1);
const pages = Math.ceil(users.length / rowsPerPage);
const hasSearchFilter = Boolean(filterValue);
const headerColumns = useMemo(() => {
@@ -298,6 +296,8 @@ export default function Page() {
return filteredUsers;
}, [users, filterValue, statusFilter]);
const pages = Math.ceil(filteredItems.length / rowsPerPage);
const items = useMemo(() => {
const start = (page - 1) * rowsPerPage;
const end = start + rowsPerPage;
@@ -390,6 +390,11 @@ export default function Page() {
}
}, []);
const onClear = useCallback(() => {
setFilterValue("");
setPage(1);
}, []);
const topContent = useMemo(() => {
return (
<div className="flex flex-col gap-4">
@@ -400,7 +405,7 @@ export default function Page() {
placeholder="Search by name..."
startContent={<SearchIcon />}
value={filterValue}
onClear={() => setFilterValue("")}
onClear={() => onClear()}
onValueChange={onSearchChange}
/>
<div className="flex gap-3">
@@ -483,23 +488,22 @@ export default function Page() {
<span className="w-[30%] text-small text-default-400">
{selectedKeys === "all"
? "All items selected"
: `${selectedKeys.size} of ${items.length} selected`}
: `${selectedKeys.size} of ${filteredItems.length} selected`}
</span>
<Pagination
isCompact
showControls
showShadow
color="primary"
isDisabled={hasSearchFilter}
page={page}
total={pages}
onChange={setPage}
/>
<div className="hidden sm:flex w-[30%] justify-end gap-2">
<Button isDisabled={hasSearchFilter} size="sm" variant="flat" onPress={onPreviousPage}>
<Button isDisabled={pages === 1} size="sm" variant="flat" onPress={onPreviousPage}>
Previous
</Button>
<Button isDisabled={hasSearchFilter} size="sm" variant="flat" onPress={onNextPage}>
<Button isDisabled={pages === 1} size="sm" variant="flat" onPress={onNextPage}>
Next
</Button>
</div>
+24 -15
View File
@@ -360,8 +360,6 @@ export default function App() {
});
const [page, setPage] = React.useState(1);
const pages = Math.ceil(users.length / rowsPerPage);
const hasSearchFilter = Boolean(filterValue);
const headerColumns = React.useMemo(() => {
@@ -387,6 +385,8 @@ export default function App() {
return filteredUsers;
}, [users, filterValue, statusFilter]);
const pages = Math.ceil(filteredItems.length / rowsPerPage);
const items = React.useMemo(() => {
const start = (page - 1) * rowsPerPage;
const end = start + rowsPerPage;
@@ -452,7 +452,7 @@ export default function App() {
return cellValue;
}
}, []);
const onNextPage = React.useCallback(() => {
if (page < pages) {
setPage(page + 1);
@@ -479,6 +479,11 @@ export default function App() {
}
}, []);
const onClear = useCallback(()=>{
setFilterValue("")
setPage(1)
},[])
const topContent = React.useMemo(() => {
return (
<div className="flex flex-col gap-4">
@@ -489,7 +494,7 @@ export default function App() {
placeholder="Search by name..."
startContent={<SearchIcon />}
value={filterValue}
onClear={() => setFilterValue("")}
onClear={() => onClear()}
onValueChange={onSearchChange}
/>
<div className="flex gap-3">
@@ -572,23 +577,22 @@ export default function App() {
<span className="w-[30%] text-small text-default-400">
{selectedKeys === "all"
? "All items selected"
: \`\${selectedKeys.size} of \${items.length} selected\`}
: \`\${selectedKeys.size} of \${filteredItems.length} selected\`}
</span>
<Pagination
isCompact
showControls
showShadow
color="primary"
isDisabled={hasSearchFilter}
page={page}
total={pages}
onChange={setPage}
/>
<div className="hidden sm:flex w-[30%] justify-end gap-2">
<Button isDisabled={hasSearchFilter} size="sm" variant="flat" onPress={onPreviousPage}>
<Button isDisabled={pages === 1} size="sm" variant="flat" onPress={onPreviousPage}>
Previous
</Button>
<Button isDisabled={hasSearchFilter} size="sm" variant="flat" onPress={onNextPage}>
<Button isDisabled={pages === 1} size="sm" variant="flat" onPress={onNextPage}>
Next
</Button>
</div>
@@ -684,7 +688,6 @@ export default function App() {
});
const [page, setPage] = useState(1);
const pages = Math.ceil(users.length / rowsPerPage);
const hasSearchFilter = Boolean(filterValue);
@@ -711,6 +714,8 @@ export default function App() {
return filteredUsers;
}, [users, filterValue, statusFilter]);
const pages = Math.ceil(filteredItems.length / rowsPerPage);
const items = React.useMemo(() => {
const start = (page - 1) * rowsPerPage;
const end = start + rowsPerPage;
@@ -776,7 +781,7 @@ export default function App() {
return cellValue;
}
}, []);
const onNextPage = React.useCallback(() => {
if (page < pages) {
setPage(page + 1);
@@ -803,6 +808,11 @@ export default function App() {
}
}, []);
const onClear = useCallback(()=>{
setFilterValue("")
setPage(1)
},[])
const topContent = React.useMemo(() => {
return (
<div className="flex flex-col gap-4">
@@ -813,7 +823,7 @@ export default function App() {
placeholder="Search by name..."
startContent={<SearchIcon />}
value={filterValue}
onClear={() => setFilterValue("")}
onClear={() => onClear()}
onValueChange={onSearchChange}
/>
<div className="flex gap-3">
@@ -896,23 +906,22 @@ export default function App() {
<span className="w-[30%] text-small text-default-400">
{selectedKeys === "all"
? "All items selected"
: \`\${selectedKeys.size} of \${items.length} selected\`}
: \`\${selectedKeys.size} of \${filteredItems.length} selected\`}
</span>
<Pagination
isCompact
showControls
showShadow
color="primary"
isDisabled={hasSearchFilter}
page={page}
total={pages}
onChange={setPage}
/>
<div className="hidden sm:flex w-[30%] justify-end gap-2">
<Button isDisabled={hasSearchFilter} size="sm" variant="flat" onPress={onPreviousPage}>
<Button isDisabled={pages === 1} size="sm" variant="flat" onPress={onPreviousPage}>
Previous
</Button>
<Button isDisabled={hasSearchFilter} size="sm" variant="flat" onPress={onNextPage}>
<Button isDisabled={pages === 1} size="sm" variant="flat" onPress={onNextPage}>
Next
</Button>
</div>
+6
View File
@@ -1,5 +1,11 @@
# @nextui-org/modal
## 2.0.6
### Patch Changes
- [#1333](https://github.com/nextui-org/nextui/pull/1333) [`5a50390e`](https://github.com/nextui-org/nextui/commit/5a50390e3f675828bff6ce68ee424fcda52cf829) Thanks [@jguddas](https://github.com/jguddas)! - fix: moved sr only modal close buttons to not show unnecessary scroll bar
## 2.0.5
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/modal",
"version": "2.0.5",
"version": "2.0.6",
"description": "Displays a dialog with a custom content that requires attention or provides additional information.",
"keywords": [
"modal"
@@ -60,14 +60,12 @@ const ModalContent = forwardRef<"div", ModalContentProps, KeysToOmit>((props, _)
);
const content = (
<>
<Component {...getDialogProps(mergeProps(dialogProps, otherProps))}>
<DismissButton onDismiss={onClose} />
<Component {...getDialogProps(mergeProps(dialogProps, otherProps))}>
{!hideCloseButton && closeButtonContent}
{typeof children === "function" ? children(onClose) : children}
</Component>
{!hideCloseButton && closeButtonContent}
{typeof children === "function" ? children(onClose) : children}
<DismissButton onDismiss={onClose} />
</>
</Component>
);
const backdropContent = useMemo(() => {
@@ -66,6 +66,11 @@ export default {
type: "number",
},
},
isOpen: {
control: {
type: "boolean",
},
},
defaultOpen: {
control: {
type: "boolean",
+7
View File
@@ -1,5 +1,12 @@
# @nextui-org/react
## 2.0.9
### Patch Changes
- Updated dependencies [[`5a50390e`](https://github.com/nextui-org/nextui/commit/5a50390e3f675828bff6ce68ee424fcda52cf829)]:
- @nextui-org/modal@2.0.6
## 2.0.8
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/react",
"version": "2.0.8",
"version": "2.0.9",
"description": "🚀 Beautiful and modern React UI library.",
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://nextui.org",
+6 -6
View File
@@ -14,7 +14,8 @@ h3 {
@apply text-xl font-bold !text-neutral-600;
}
.dark .sbdocs-wrapper, .dark .sbdocs-preview {
.dark .sbdocs-wrapper,
.dark .sbdocs-preview {
background-color: #000000;
color: #fff;
}
@@ -28,12 +29,11 @@ h3 {
color: #d4d4d4;
}
.dark div:has(.docblock-code-toggle) {
background: transparent;
.dark div:has(.docblock-code-toggle) {
background: transparent;
}
.dark .os-theme-dark {
.dark .os-theme-dark {
background: #161616;
color: #fff;
}
@@ -70,4 +70,4 @@ h3 {
.dark #docs-root tbody tr:not(:first-child) {
border-top: 1px solid #292929 !important;
}
}