@k3-universe/react-kit 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +12 -0
- package/.storybook/main.ts +22 -0
- package/.storybook/preview.ts +190 -0
- package/Dockerfile.storybook +43 -0
- package/README.md +7 -0
- package/components.json +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/kit/builder/data-table/components/DataTable.d.ts +34 -0
- package/dist/kit/builder/data-table/components/DataTable.d.ts.map +1 -0
- package/dist/kit/builder/data-table/components/DataTableColumnHeader.d.ts +8 -0
- package/dist/kit/builder/data-table/components/DataTableColumnHeader.d.ts.map +1 -0
- package/dist/kit/builder/data-table/components/DataTablePagination.d.ts +6 -0
- package/dist/kit/builder/data-table/components/DataTablePagination.d.ts.map +1 -0
- package/dist/kit/builder/data-table/components/DataTableViewOptions.d.ts +5 -0
- package/dist/kit/builder/data-table/components/DataTableViewOptions.d.ts.map +1 -0
- package/dist/kit/builder/data-table/index.d.ts +6 -0
- package/dist/kit/builder/data-table/index.d.ts.map +1 -0
- package/dist/kit/builder/data-table/types.d.ts +27 -0
- package/dist/kit/builder/data-table/types.d.ts.map +1 -0
- package/dist/kit/builder/data-table/utils/dotAccessor.d.ts +2 -0
- package/dist/kit/builder/data-table/utils/dotAccessor.d.ts.map +1 -0
- package/dist/kit/builder/dialog/index.d.ts +3 -0
- package/dist/kit/builder/dialog/index.d.ts.map +1 -0
- package/dist/kit/builder/dialog/provider.d.ts +26 -0
- package/dist/kit/builder/dialog/provider.d.ts.map +1 -0
- package/dist/kit/builder/form/components/FormActions.d.ts +20 -0
- package/dist/kit/builder/form/components/FormActions.d.ts.map +1 -0
- package/dist/kit/builder/form/components/FormBuilder.d.ts +97 -0
- package/dist/kit/builder/form/components/FormBuilder.d.ts.map +1 -0
- package/dist/kit/builder/form/components/FormField.d.ts +12 -0
- package/dist/kit/builder/form/components/FormField.d.ts.map +1 -0
- package/dist/kit/builder/form/components/FormSection.d.ts +15 -0
- package/dist/kit/builder/form/components/FormSection.d.ts.map +1 -0
- package/dist/kit/builder/form/components/index.d.ts +5 -0
- package/dist/kit/builder/form/components/index.d.ts.map +1 -0
- package/dist/kit/builder/form/index.d.ts +3 -0
- package/dist/kit/builder/form/index.d.ts.map +1 -0
- package/dist/kit/builder/form/utils/common-forms.d.ts +7 -0
- package/dist/kit/builder/form/utils/common-forms.d.ts.map +1 -0
- package/dist/kit/builder/form/utils/dependencies.d.ts +41 -0
- package/dist/kit/builder/form/utils/dependencies.d.ts.map +1 -0
- package/dist/kit/builder/form/utils/field-factories.d.ts +22 -0
- package/dist/kit/builder/form/utils/field-factories.d.ts.map +1 -0
- package/dist/kit/builder/form/utils/index.d.ts +15 -0
- package/dist/kit/builder/form/utils/index.d.ts.map +1 -0
- package/dist/kit/builder/form/utils/section-factories.d.ts +7 -0
- package/dist/kit/builder/form/utils/section-factories.d.ts.map +1 -0
- package/dist/kit/builder/form/utils/transformers.d.ts +6 -0
- package/dist/kit/builder/form/utils/transformers.d.ts.map +1 -0
- package/dist/kit/builder/form/utils/validations.d.ts +13 -0
- package/dist/kit/builder/form/utils/validations.d.ts.map +1 -0
- package/dist/kit/builder/form/utils/validators.d.ts +8 -0
- package/dist/kit/builder/form/utils/validators.d.ts.map +1 -0
- package/dist/kit/builder/page/Page.d.ts +48 -0
- package/dist/kit/builder/page/Page.d.ts.map +1 -0
- package/dist/kit/builder/page/index.d.ts +2 -0
- package/dist/kit/builder/page/index.d.ts.map +1 -0
- package/dist/kit/builder/section/SectionBuilder.d.ts +3 -0
- package/dist/kit/builder/section/SectionBuilder.d.ts.map +1 -0
- package/dist/kit/builder/section/index.d.ts +3 -0
- package/dist/kit/builder/section/index.d.ts.map +1 -0
- package/dist/kit/builder/section/types.d.ts +59 -0
- package/dist/kit/builder/section/types.d.ts.map +1 -0
- package/dist/kit/components/autocomplete/Autocomplete.d.ts +21 -0
- package/dist/kit/components/autocomplete/Autocomplete.d.ts.map +1 -0
- package/dist/kit/components/autocomplete/index.d.ts +3 -0
- package/dist/kit/components/autocomplete/index.d.ts.map +1 -0
- package/dist/kit/components/autocomplete/types.d.ts +19 -0
- package/dist/kit/components/autocomplete/types.d.ts.map +1 -0
- package/dist/kit/components/login/Login.d.ts +29 -0
- package/dist/kit/components/login/Login.d.ts.map +1 -0
- package/dist/kit/components/login/index.d.ts +2 -0
- package/dist/kit/components/login/index.d.ts.map +1 -0
- package/dist/kit/layouts/admin/components/AdminLayout.d.ts +17 -0
- package/dist/kit/layouts/admin/components/AdminLayout.d.ts.map +1 -0
- package/dist/kit/layouts/admin/components/ThemeToggle.d.ts +5 -0
- package/dist/kit/layouts/admin/components/ThemeToggle.d.ts.map +1 -0
- package/dist/kit/layouts/admin/hooks/menu.d.ts +12 -0
- package/dist/kit/layouts/admin/hooks/menu.d.ts.map +1 -0
- package/dist/kit/layouts/admin/providers/AdminMenuProvider.d.ts +7 -0
- package/dist/kit/layouts/admin/providers/AdminMenuProvider.d.ts.map +1 -0
- package/dist/kit/layouts/admin/types/index.d.ts +27 -0
- package/dist/kit/layouts/admin/types/index.d.ts.map +1 -0
- package/dist/kit/providers/ThemeProvider.d.ts +14 -0
- package/dist/kit/providers/ThemeProvider.d.ts.map +1 -0
- package/dist/shadcn/hooks/use-mobile.d.ts +2 -0
- package/dist/shadcn/hooks/use-mobile.d.ts.map +1 -0
- package/dist/shadcn/lib/utils.d.ts +3 -0
- package/dist/shadcn/lib/utils.d.ts.map +1 -0
- package/dist/shadcn/ui/accordion.d.ts +8 -0
- package/dist/shadcn/ui/accordion.d.ts.map +1 -0
- package/dist/shadcn/ui/alert-dialog.d.ts +15 -0
- package/dist/shadcn/ui/alert-dialog.d.ts.map +1 -0
- package/dist/shadcn/ui/alert.d.ts +10 -0
- package/dist/shadcn/ui/alert.d.ts.map +1 -0
- package/dist/shadcn/ui/aspect-ratio.d.ts +4 -0
- package/dist/shadcn/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/shadcn/ui/avatar.d.ts +7 -0
- package/dist/shadcn/ui/avatar.d.ts.map +1 -0
- package/dist/shadcn/ui/badge.d.ts +10 -0
- package/dist/shadcn/ui/badge.d.ts.map +1 -0
- package/dist/shadcn/ui/breadcrumb.d.ts +12 -0
- package/dist/shadcn/ui/breadcrumb.d.ts.map +1 -0
- package/dist/shadcn/ui/button.d.ts +11 -0
- package/dist/shadcn/ui/button.d.ts.map +1 -0
- package/dist/shadcn/ui/calendar.d.ts +9 -0
- package/dist/shadcn/ui/calendar.d.ts.map +1 -0
- package/dist/shadcn/ui/card.d.ts +10 -0
- package/dist/shadcn/ui/card.d.ts.map +1 -0
- package/dist/shadcn/ui/carousel.d.ts +20 -0
- package/dist/shadcn/ui/carousel.d.ts.map +1 -0
- package/dist/shadcn/ui/chart.d.ts +41 -0
- package/dist/shadcn/ui/chart.d.ts.map +1 -0
- package/dist/shadcn/ui/checkbox.d.ts +5 -0
- package/dist/shadcn/ui/checkbox.d.ts.map +1 -0
- package/dist/shadcn/ui/collapsible.d.ts +6 -0
- package/dist/shadcn/ui/collapsible.d.ts.map +1 -0
- package/dist/shadcn/ui/command.d.ts +19 -0
- package/dist/shadcn/ui/command.d.ts.map +1 -0
- package/dist/shadcn/ui/context-menu.d.ts +26 -0
- package/dist/shadcn/ui/context-menu.d.ts.map +1 -0
- package/dist/shadcn/ui/dialog.d.ts +16 -0
- package/dist/shadcn/ui/dialog.d.ts.map +1 -0
- package/dist/shadcn/ui/drawer.d.ts +14 -0
- package/dist/shadcn/ui/drawer.d.ts.map +1 -0
- package/dist/shadcn/ui/dropdown-menu.d.ts +26 -0
- package/dist/shadcn/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/shadcn/ui/form.d.ts +25 -0
- package/dist/shadcn/ui/form.d.ts.map +1 -0
- package/dist/shadcn/ui/hover-card.d.ts +7 -0
- package/dist/shadcn/ui/hover-card.d.ts.map +1 -0
- package/dist/shadcn/ui/input-otp.d.ts +12 -0
- package/dist/shadcn/ui/input-otp.d.ts.map +1 -0
- package/dist/shadcn/ui/input.d.ts +4 -0
- package/dist/shadcn/ui/input.d.ts.map +1 -0
- package/dist/shadcn/ui/label.d.ts +5 -0
- package/dist/shadcn/ui/label.d.ts.map +1 -0
- package/dist/shadcn/ui/menubar.d.ts +27 -0
- package/dist/shadcn/ui/menubar.d.ts.map +1 -0
- package/dist/shadcn/ui/navigation-menu.d.ts +15 -0
- package/dist/shadcn/ui/navigation-menu.d.ts.map +1 -0
- package/dist/shadcn/ui/pagination.d.ts +14 -0
- package/dist/shadcn/ui/pagination.d.ts.map +1 -0
- package/dist/shadcn/ui/popover.d.ts +8 -0
- package/dist/shadcn/ui/popover.d.ts.map +1 -0
- package/dist/shadcn/ui/progress.d.ts +5 -0
- package/dist/shadcn/ui/progress.d.ts.map +1 -0
- package/dist/shadcn/ui/radio-group.d.ts +6 -0
- package/dist/shadcn/ui/radio-group.d.ts.map +1 -0
- package/dist/shadcn/ui/resizable.d.ts +9 -0
- package/dist/shadcn/ui/resizable.d.ts.map +1 -0
- package/dist/shadcn/ui/scroll-area.d.ts +6 -0
- package/dist/shadcn/ui/scroll-area.d.ts.map +1 -0
- package/dist/shadcn/ui/select.d.ts +16 -0
- package/dist/shadcn/ui/select.d.ts.map +1 -0
- package/dist/shadcn/ui/separator.d.ts +5 -0
- package/dist/shadcn/ui/separator.d.ts.map +1 -0
- package/dist/shadcn/ui/sheet.d.ts +14 -0
- package/dist/shadcn/ui/sheet.d.ts.map +1 -0
- package/dist/shadcn/ui/sidebar.d.ts +70 -0
- package/dist/shadcn/ui/sidebar.d.ts.map +1 -0
- package/dist/shadcn/ui/skeleton.d.ts +3 -0
- package/dist/shadcn/ui/skeleton.d.ts.map +1 -0
- package/dist/shadcn/ui/slider.d.ts +5 -0
- package/dist/shadcn/ui/slider.d.ts.map +1 -0
- package/dist/shadcn/ui/sonner.d.ts +4 -0
- package/dist/shadcn/ui/sonner.d.ts.map +1 -0
- package/dist/shadcn/ui/switch.d.ts +5 -0
- package/dist/shadcn/ui/switch.d.ts.map +1 -0
- package/dist/shadcn/ui/table.d.ts +11 -0
- package/dist/shadcn/ui/table.d.ts.map +1 -0
- package/dist/shadcn/ui/tabs.d.ts +8 -0
- package/dist/shadcn/ui/tabs.d.ts.map +1 -0
- package/dist/shadcn/ui/textarea.d.ts +4 -0
- package/dist/shadcn/ui/textarea.d.ts.map +1 -0
- package/dist/shadcn/ui/toggle-group.d.ts +8 -0
- package/dist/shadcn/ui/toggle-group.d.ts.map +1 -0
- package/dist/shadcn/ui/toggle.d.ts +10 -0
- package/dist/shadcn/ui/toggle.d.ts.map +1 -0
- package/dist/shadcn/ui/tooltip.d.ts +8 -0
- package/dist/shadcn/ui/tooltip.d.ts.map +1 -0
- package/eslint.config.mjs +19 -0
- package/package.json +82 -0
- package/src/index.css +11 -0
- package/src/index.ts +0 -0
- package/src/kit/builder/data-table/components/DataTable.tsx +375 -0
- package/src/kit/builder/data-table/components/DataTableColumnHeader.tsx +63 -0
- package/src/kit/builder/data-table/components/DataTablePagination.tsx +86 -0
- package/src/kit/builder/data-table/components/DataTableViewOptions.tsx +42 -0
- package/src/kit/builder/data-table/index.ts +5 -0
- package/src/kit/builder/data-table/types.ts +29 -0
- package/src/kit/builder/data-table/utils/dotAccessor.ts +6 -0
- package/src/kit/builder/dialog/index.ts +2 -0
- package/src/kit/builder/dialog/provider.tsx +141 -0
- package/src/kit/builder/form/components/FormActions.tsx +78 -0
- package/src/kit/builder/form/components/FormBuilder.tsx +456 -0
- package/src/kit/builder/form/components/FormField.tsx +395 -0
- package/src/kit/builder/form/components/FormSection.tsx +88 -0
- package/src/kit/builder/form/components/index.ts +4 -0
- package/src/kit/builder/form/index.ts +2 -0
- package/src/kit/builder/form/utils/common-forms.ts +68 -0
- package/src/kit/builder/form/utils/dependencies.ts +56 -0
- package/src/kit/builder/form/utils/field-factories.ts +164 -0
- package/src/kit/builder/form/utils/index.ts +17 -0
- package/src/kit/builder/form/utils/section-factories.ts +35 -0
- package/src/kit/builder/form/utils/transformers.ts +100 -0
- package/src/kit/builder/form/utils/validations.ts +22 -0
- package/src/kit/builder/form/utils/validators.ts +20 -0
- package/src/kit/builder/page/Page.tsx +182 -0
- package/src/kit/builder/page/index.ts +1 -0
- package/src/kit/builder/section/SectionBuilder.tsx +213 -0
- package/src/kit/builder/section/index.ts +2 -0
- package/src/kit/builder/section/types.ts +66 -0
- package/src/kit/components/autocomplete/Autocomplete.tsx +247 -0
- package/src/kit/components/autocomplete/index.ts +2 -0
- package/src/kit/components/autocomplete/types.ts +24 -0
- package/src/kit/components/login/Login.tsx +119 -0
- package/src/kit/components/login/index.ts +1 -0
- package/src/kit/layouts/admin/components/AdminLayout.tsx +251 -0
- package/src/kit/layouts/admin/components/ThemeToggle.tsx +60 -0
- package/src/kit/layouts/admin/hooks/menu.ts +26 -0
- package/src/kit/layouts/admin/providers/AdminMenuProvider.tsx +58 -0
- package/src/kit/layouts/admin/types/index.ts +26 -0
- package/src/kit/providers/ThemeProvider.tsx +90 -0
- package/src/kit/themes/clean-slate.css +147 -0
- package/src/kit/themes/default.css +182 -0
- package/src/kit/themes/minimal-modern.css +147 -0
- package/src/kit/themes/spotify.css +147 -0
- package/src/shadcn/hooks/use-mobile.ts +19 -0
- package/src/shadcn/lib/utils.ts +6 -0
- package/src/shadcn/ui/accordion.tsx +66 -0
- package/src/shadcn/ui/alert-dialog.tsx +157 -0
- package/src/shadcn/ui/alert.tsx +66 -0
- package/src/shadcn/ui/aspect-ratio.tsx +11 -0
- package/src/shadcn/ui/avatar.tsx +53 -0
- package/src/shadcn/ui/badge.tsx +46 -0
- package/src/shadcn/ui/breadcrumb.tsx +108 -0
- package/src/shadcn/ui/button.tsx +59 -0
- package/src/shadcn/ui/calendar.tsx +213 -0
- package/src/shadcn/ui/card.tsx +92 -0
- package/src/shadcn/ui/carousel.tsx +240 -0
- package/src/shadcn/ui/chart.tsx +353 -0
- package/src/shadcn/ui/checkbox.tsx +32 -0
- package/src/shadcn/ui/collapsible.tsx +33 -0
- package/src/shadcn/ui/command.tsx +184 -0
- package/src/shadcn/ui/context-menu.tsx +252 -0
- package/src/shadcn/ui/dialog.tsx +143 -0
- package/src/shadcn/ui/drawer.tsx +135 -0
- package/src/shadcn/ui/dropdown-menu.tsx +257 -0
- package/src/shadcn/ui/form.tsx +167 -0
- package/src/shadcn/ui/hover-card.tsx +44 -0
- package/src/shadcn/ui/input-otp.tsx +77 -0
- package/src/shadcn/ui/input.tsx +21 -0
- package/src/shadcn/ui/label.tsx +24 -0
- package/src/shadcn/ui/menubar.tsx +276 -0
- package/src/shadcn/ui/navigation-menu.tsx +168 -0
- package/src/shadcn/ui/pagination.tsx +127 -0
- package/src/shadcn/ui/popover.tsx +48 -0
- package/src/shadcn/ui/progress.tsx +31 -0
- package/src/shadcn/ui/radio-group.tsx +45 -0
- package/src/shadcn/ui/resizable.tsx +56 -0
- package/src/shadcn/ui/scroll-area.tsx +58 -0
- package/src/shadcn/ui/select.tsx +185 -0
- package/src/shadcn/ui/separator.tsx +28 -0
- package/src/shadcn/ui/sheet.tsx +139 -0
- package/src/shadcn/ui/sidebar.tsx +726 -0
- package/src/shadcn/ui/skeleton.tsx +13 -0
- package/src/shadcn/ui/slider.tsx +63 -0
- package/src/shadcn/ui/sonner.tsx +25 -0
- package/src/shadcn/ui/switch.tsx +31 -0
- package/src/shadcn/ui/table.tsx +116 -0
- package/src/shadcn/ui/tabs.tsx +66 -0
- package/src/shadcn/ui/textarea.tsx +18 -0
- package/src/shadcn/ui/toggle-group.tsx +73 -0
- package/src/shadcn/ui/toggle.tsx +47 -0
- package/src/shadcn/ui/tooltip.tsx +61 -0
- package/src/stories/kit/builder/DataTable.Basic.stories.tsx +61 -0
- package/src/stories/kit/builder/DataTable.Filters.stories.tsx +76 -0
- package/src/stories/kit/builder/DataTable.Pagination.stories.tsx +72 -0
- package/src/stories/kit/builder/DataTable.SelectionAndActions.stories.tsx +63 -0
- package/src/stories/kit/builder/DataTable.Sorting.stories.tsx +56 -0
- package/src/stories/kit/builder/Dialog.stories.tsx +84 -0
- package/src/stories/kit/builder/Form.Basic.stories.tsx +45 -0
- package/src/stories/kit/builder/Form.Complex.stories.tsx +223 -0
- package/src/stories/kit/builder/Form.Dynamic.stories.tsx +214 -0
- package/src/stories/kit/builder/Form.Simple.stories.tsx +78 -0
- package/src/stories/kit/builder/Page.stories.tsx +89 -0
- package/src/stories/kit/builder/Section.stories.tsx +179 -0
- package/src/stories/kit/components/Autocomplete.stories.tsx +98 -0
- package/src/stories/kit/components/Login.stories.tsx +161 -0
- package/src/stories/kit/layouts/admin/AdminLayout.Basic.stories.tsx +93 -0
- package/src/stories/kit/layouts/admin/AdminLayout.Collapsible.stories.tsx +58 -0
- package/src/stories/kit/layouts/admin/AdminLayout.Complex.stories.tsx +166 -0
- package/src/stories/kit/layouts/admin/AdminLayout.CustomSidebarHeaderComponent.stories.tsx +64 -0
- package/src/stories/kit/layouts/admin/AdminLayout.CustomSidebarTitleAndIcon.stories.tsx +55 -0
- package/src/stories/kit/layouts/admin/AdminLayout.HeaderSlots.stories.tsx +63 -0
- package/src/stories/shadcn/ui/Accordion.stories.tsx +94 -0
- package/src/stories/shadcn/ui/Alert.stories.tsx +36 -0
- package/src/stories/shadcn/ui/AlertDialog.stories.tsx +71 -0
- package/src/stories/shadcn/ui/AspectRatio.stories.tsx +58 -0
- package/src/stories/shadcn/ui/Avatar.stories.tsx +26 -0
- package/src/stories/shadcn/ui/Badge.stories.tsx +28 -0
- package/src/stories/shadcn/ui/Breadcrumb.stories.tsx +47 -0
- package/src/stories/shadcn/ui/Button.stories.tsx +49 -0
- package/src/stories/shadcn/ui/Calendar.stories.tsx +28 -0
- package/src/stories/shadcn/ui/Card.stories.tsx +30 -0
- package/src/stories/shadcn/ui/Carousel.stories.tsx +37 -0
- package/src/stories/shadcn/ui/Chart.stories.tsx +72 -0
- package/src/stories/shadcn/ui/Checkbox.stories.tsx +56 -0
- package/src/stories/shadcn/ui/Collapsible.stories.tsx +33 -0
- package/src/stories/shadcn/ui/Command.stories.tsx +53 -0
- package/src/stories/shadcn/ui/ContextMenu.stories.tsx +59 -0
- package/src/stories/shadcn/ui/Dialog.stories.tsx +33 -0
- package/src/stories/shadcn/ui/Drawer.stories.tsx +46 -0
- package/src/stories/shadcn/ui/DropdownMenu.stories.tsx +65 -0
- package/src/stories/shadcn/ui/Form.stories.tsx +90 -0
- package/src/stories/shadcn/ui/HoverCard.stories.tsx +37 -0
- package/src/stories/shadcn/ui/Input.stories.tsx +39 -0
- package/src/stories/shadcn/ui/InputOtp.stories.tsx +32 -0
- package/src/stories/shadcn/ui/Label.stories.tsx +29 -0
- package/src/stories/shadcn/ui/Menubar.stories.tsx +73 -0
- package/src/stories/shadcn/ui/NavigationMenu.stories.tsx +53 -0
- package/src/stories/shadcn/ui/Pagination.stories.tsx +51 -0
- package/src/stories/shadcn/ui/Popover.stories.tsx +47 -0
- package/src/stories/shadcn/ui/Progress.stories.tsx +30 -0
- package/src/stories/shadcn/ui/RadioGroup.stories.tsx +31 -0
- package/src/stories/shadcn/ui/Resizable.stories.tsx +43 -0
- package/src/stories/shadcn/ui/ScrollArea.stories.tsx +32 -0
- package/src/stories/shadcn/ui/Select.stories.tsx +55 -0
- package/src/stories/shadcn/ui/Separator.stories.tsx +35 -0
- package/src/stories/shadcn/ui/Sheet.stories.tsx +47 -0
- package/src/stories/shadcn/ui/Sidebar.stories.tsx +120 -0
- package/src/stories/shadcn/ui/Skeleton.stories.tsx +23 -0
- package/src/stories/shadcn/ui/Slider.stories.tsx +21 -0
- package/src/stories/shadcn/ui/Sonner.stories.tsx +39 -0
- package/src/stories/shadcn/ui/Switch.stories.tsx +28 -0
- package/src/stories/shadcn/ui/Table.stories.tsx +315 -0
- package/src/stories/shadcn/ui/Tabs.stories.tsx +24 -0
- package/src/stories/shadcn/ui/Textarea.stories.tsx +40 -0
- package/src/stories/shadcn/ui/Toggle.stories.tsx +36 -0
- package/src/stories/shadcn/ui/ToggleGroup.stories.tsx +28 -0
- package/src/stories/shadcn/ui/Tooltip.stories.tsx +25 -0
- package/storybook-static/assets/Accordion.stories-N1auke5L.js +52 -0
- package/storybook-static/assets/AdminLayout-Cxd0-A_L.js +53 -0
- package/storybook-static/assets/AdminLayout.Basic.stories-C_I6rWuq.js +4 -0
- package/storybook-static/assets/AdminLayout.Collapsible.stories-CsU3DwTo.js +4 -0
- package/storybook-static/assets/AdminLayout.Complex.stories-BbY1Ue6d.js +29 -0
- package/storybook-static/assets/AdminLayout.CustomSidebarHeaderComponent.stories-LFVi-aIv.js +9 -0
- package/storybook-static/assets/AdminLayout.CustomSidebarTitleAndIcon.stories-BqP6UVc7.js +4 -0
- package/storybook-static/assets/AdminLayout.HeaderSlots.stories-BactzgkF.js +7 -0
- package/storybook-static/assets/Alert.stories-_FtuixdR.js +27 -0
- package/storybook-static/assets/AlertDialog.stories-6NY3BjwR.js +43 -0
- package/storybook-static/assets/AspectRatio.stories-DAT11y02.js +22 -0
- package/storybook-static/assets/Autocomplete-DngjqsCM.js +35 -0
- package/storybook-static/assets/Autocomplete.stories-BCaOrgTR.js +33 -0
- package/storybook-static/assets/Avatar.stories-DlzxSLJ-.js +12 -0
- package/storybook-static/assets/Badge.stories-DKHXsoV5.js +12 -0
- package/storybook-static/assets/Breadcrumb.stories-D8eUHpf7.js +25 -0
- package/storybook-static/assets/Button.stories-kvPdKxdw.js +26 -0
- package/storybook-static/assets/Calendar.stories-D-hUtQQI.js +3 -0
- package/storybook-static/assets/Card.stories-y8Z7NgrQ.js +15 -0
- package/storybook-static/assets/Carousel.stories-CFcHYKgp.js +15 -0
- package/storybook-static/assets/Chart.stories-BJwLNKfE.js +126 -0
- package/storybook-static/assets/Checkbox.stories-B22Fbwx1.js +12 -0
- package/storybook-static/assets/Collapsible.stories-BgcRp8Rk.js +18 -0
- package/storybook-static/assets/Combination-BT_gXe1L.js +41 -0
- package/storybook-static/assets/Command.stories-Dp4CtSQR.js +30 -0
- package/storybook-static/assets/ContextMenu.stories-DnVnIi-T.js +31 -0
- package/storybook-static/assets/DataTable.Basic.stories-DBF5VYq9.js +6 -0
- package/storybook-static/assets/DataTable.Filters.stories-CO0ipuGm.js +21 -0
- package/storybook-static/assets/DataTable.Pagination.stories-DNwCw64e.js +24 -0
- package/storybook-static/assets/DataTable.SelectionAndActions.stories-DGgdEbsf.js +26 -0
- package/storybook-static/assets/DataTable.Sorting.stories-CWpqloAB.js +6 -0
- package/storybook-static/assets/Dialog.stories-DQkYN8ht.js +18 -0
- package/storybook-static/assets/Dialog.stories-DXZINEgo.js +54 -0
- package/storybook-static/assets/Drawer.stories-DMH_vZgi.js +24 -0
- package/storybook-static/assets/DropdownMenu.stories-Dl8y-N7T.js +35 -0
- package/storybook-static/assets/Form.Basic.stories-CJugIYsx.js +45 -0
- package/storybook-static/assets/Form.Complex.stories-BPogRp6F.js +230 -0
- package/storybook-static/assets/Form.Dynamic.stories-Boway5AK.js +247 -0
- package/storybook-static/assets/Form.Simple.stories-_OXGXXpE.js +50 -0
- package/storybook-static/assets/Form.stories-BoHyR8ho.js +3 -0
- package/storybook-static/assets/FormBuilder-BGgeY8ik.js +5 -0
- package/storybook-static/assets/HoverCard.stories-1HM92M79.js +21 -0
- package/storybook-static/assets/Input.stories-sQ4EUlWt.js +16 -0
- package/storybook-static/assets/InputOtp.stories-Cpk_EmLx.js +42 -0
- package/storybook-static/assets/Label.stories-MjABHKSw.js +14 -0
- package/storybook-static/assets/Login.stories-BY4OYGk3.js +37 -0
- package/storybook-static/assets/Menubar.stories-B_60TWNE.js +44 -0
- package/storybook-static/assets/NavigationMenu.stories-DyuaBvvq.js +30 -0
- package/storybook-static/assets/Page.stories-DQKMxrPZ.js +91 -0
- package/storybook-static/assets/Pagination.stories-CBo7UrNd.js +29 -0
- package/storybook-static/assets/Popover.stories-D98_JrxN.js +15 -0
- package/storybook-static/assets/Progress.stories-Dejt5v3z.js +8 -0
- package/storybook-static/assets/RadioGroup.stories-Tz2LW6O6.js +16 -0
- package/storybook-static/assets/Resizable.stories-DhP2GKN7.js +25 -0
- package/storybook-static/assets/ScrollArea.stories-CF7-8wbM.js +12 -0
- package/storybook-static/assets/Section.stories-BpurjHIQ.js +196 -0
- package/storybook-static/assets/SectionBuilder-Bav4WrnT.js +1 -0
- package/storybook-static/assets/Select.stories-DJrU-mi0.js +17 -0
- package/storybook-static/assets/Separator.stories-BYH_o8QM.js +17 -0
- package/storybook-static/assets/Sheet.stories-BNJ7BIb-.js +24 -0
- package/storybook-static/assets/Sidebar.stories-BbjcJuOg.js +106 -0
- package/storybook-static/assets/Skeleton.stories-BQNIuIe5.js +9 -0
- package/storybook-static/assets/Slider.stories-CWOjKHKD.js +6 -0
- package/storybook-static/assets/Sonner.stories-CXSZs5yN.js +18 -0
- package/storybook-static/assets/Switch.stories-BUQjobWe.js +3 -0
- package/storybook-static/assets/Table.stories-DJcV7M9R.js +35 -0
- package/storybook-static/assets/Tabs.stories-ByeVrP18.js +10 -0
- package/storybook-static/assets/Textarea.stories-CKsDPHYc.js +17 -0
- package/storybook-static/assets/Toggle.stories-DutEzZ8k.js +3 -0
- package/storybook-static/assets/ToggleGroup.stories-C9fzJTh-.js +13 -0
- package/storybook-static/assets/Tooltip.stories-CngnJbP7.js +10 -0
- package/storybook-static/assets/accordion-bQe9Rep4.js +1 -0
- package/storybook-static/assets/alert-dialog-CypF_yaW.js +7 -0
- package/storybook-static/assets/avatar-CukM9hXu.js +1 -0
- package/storybook-static/assets/axe-W8QMjM0E.js +30 -0
- package/storybook-static/assets/button-BTWmFXop.js +1 -0
- package/storybook-static/assets/card-BJpPOzP8.js +1 -0
- package/storybook-static/assets/chart-column-Bzh5arua.js +6 -0
- package/storybook-static/assets/check-BgWXKGqi.js +6 -0
- package/storybook-static/assets/checkbox-QlugAqJY.js +1 -0
- package/storybook-static/assets/chevron-down-BqLjUn1_.js +6 -0
- package/storybook-static/assets/chevron-left-BR_0lKnE.js +6 -0
- package/storybook-static/assets/chevron-right-DpCIoMaJ.js +6 -0
- package/storybook-static/assets/circle-DVJTkDI7.js +6 -0
- package/storybook-static/assets/clean-slate-BR-XvZPt.css +1 -0
- package/storybook-static/assets/command-BERL33lL.js +6 -0
- package/storybook-static/assets/createLucideIcon-1ZwIAs_l.js +21 -0
- package/storybook-static/assets/default-M24vcGB8.css +1 -0
- package/storybook-static/assets/dependencies-ctrV69dx.js +1 -0
- package/storybook-static/assets/dialog-DM9YJ1JD.js +1 -0
- package/storybook-static/assets/dropdown-menu-TfFll7G9.js +1 -0
- package/storybook-static/assets/ellipsis-BSY8VuLI.js +6 -0
- package/storybook-static/assets/grip-vertical-Buja1rv9.js +6 -0
- package/storybook-static/assets/iframe-C9bogcIc.css +1 -0
- package/storybook-static/assets/iframe-G-6sM9Mt.js +1555 -0
- package/storybook-static/assets/index-1v1lhNFD.js +1 -0
- package/storybook-static/assets/index-7yNAGow7.js +1 -0
- package/storybook-static/assets/index-B-fXBfyD.js +1 -0
- package/storybook-static/assets/index-BDwnENHR.js +1 -0
- package/storybook-static/assets/index-BdQq_4o_.js +1 -0
- package/storybook-static/assets/index-Bq6UNRVc.js +1 -0
- package/storybook-static/assets/index-CAwQR9Pv.js +1 -0
- package/storybook-static/assets/index-CGrAONsN.js +1 -0
- package/storybook-static/assets/index-CLmN5G1a.js +1 -0
- package/storybook-static/assets/index-CMmbDm5O.js +1 -0
- package/storybook-static/assets/index-CZaD3imo.js +9 -0
- package/storybook-static/assets/index-CayhpKmv.js +1 -0
- package/storybook-static/assets/index-ClNNG_ys.js +1 -0
- package/storybook-static/assets/index-CzJf-yyP.js +5 -0
- package/storybook-static/assets/index-DNAxNqEO.js +1 -0
- package/storybook-static/assets/index-DW48STyt.js +1 -0
- package/storybook-static/assets/index-DhoByIgc.js +1 -0
- package/storybook-static/assets/index-DqWzLCH-.js +1 -0
- package/storybook-static/assets/index-DvM9azdj.js +1 -0
- package/storybook-static/assets/index-DySHPxMy.js +1 -0
- package/storybook-static/assets/index-HghBIZeg.js +1 -0
- package/storybook-static/assets/index-I343IfOC.js +1 -0
- package/storybook-static/assets/index-SxI7_jxe.js +9 -0
- package/storybook-static/assets/index-_crRFOM5.js +1 -0
- package/storybook-static/assets/index-d_S6mtzU.js +1 -0
- package/storybook-static/assets/index-ev1RjzGv.js +1 -0
- package/storybook-static/assets/index-lH-AZpAn.js +1 -0
- package/storybook-static/assets/input-11YRd9gD.js +1 -0
- package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/storybook-static/assets/label-C5vJTTwH.js +1 -0
- package/storybook-static/assets/lodash-Q9aGJGMb.js +73 -0
- package/storybook-static/assets/matchers-7Z3WT2CE-T3xScrR7.js +14 -0
- package/storybook-static/assets/minimal-modern-BmvR5wyr.css +1 -0
- package/storybook-static/assets/popover-DW1K4QCO.js +1 -0
- package/storybook-static/assets/preload-helper-Dp1pzeXC.js +1 -0
- package/storybook-static/assets/radio-group-iPL-8jvw.js +1 -0
- package/storybook-static/assets/react-18-CK1-M7n3.js +25 -0
- package/storybook-static/assets/react-icons.esm-n2MUhK0n.js +1 -0
- package/storybook-static/assets/refresh-cw-FYEbhX1i.js +6 -0
- package/storybook-static/assets/schemas-S_Tg7JYp.js +18 -0
- package/storybook-static/assets/section-factories-CC6eFfbk.js +1 -0
- package/storybook-static/assets/select-DbLzULCJ.js +6 -0
- package/storybook-static/assets/separator-DoUX1TNx.js +1 -0
- package/storybook-static/assets/settings-2-CpOcGlDm.js +6 -0
- package/storybook-static/assets/sheet-n5VQ25jh.js +1 -0
- package/storybook-static/assets/shopping-cart-9kOJ1UDd.js +11 -0
- package/storybook-static/assets/sidebar-CvUiZOJe.js +6 -0
- package/storybook-static/assets/skeleton-CjDnQs43.js +1 -0
- package/storybook-static/assets/spotify-DpbeJq1r.css +1 -0
- package/storybook-static/assets/table-CP3vMqFn.js +1 -0
- package/storybook-static/assets/textarea-Dw2vruMl.js +1 -0
- package/storybook-static/assets/toggle-B-YKWMF8.js +16 -0
- package/storybook-static/assets/tooltip-CNONbPiI.js +1 -0
- package/storybook-static/assets/trash-2-Bt5LMclM.js +11 -0
- package/storybook-static/assets/utils-D-KgF5mV.js +1 -0
- package/storybook-static/assets/x-DG9mLFAg.js +6 -0
- package/storybook-static/favicon-wrapper.svg +46 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +687 -0
- package/storybook-static/index.d.ts +1 -0
- package/storybook-static/index.d.ts.map +1 -0
- package/storybook-static/index.html +166 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/kit/builder/data-table/components/DataTable.d.ts +34 -0
- package/storybook-static/kit/builder/data-table/components/DataTable.d.ts.map +1 -0
- package/storybook-static/kit/builder/data-table/components/DataTableColumnHeader.d.ts +8 -0
- package/storybook-static/kit/builder/data-table/components/DataTableColumnHeader.d.ts.map +1 -0
- package/storybook-static/kit/builder/data-table/components/DataTablePagination.d.ts +6 -0
- package/storybook-static/kit/builder/data-table/components/DataTablePagination.d.ts.map +1 -0
- package/storybook-static/kit/builder/data-table/components/DataTableViewOptions.d.ts +5 -0
- package/storybook-static/kit/builder/data-table/components/DataTableViewOptions.d.ts.map +1 -0
- package/storybook-static/kit/builder/data-table/index.d.ts +6 -0
- package/storybook-static/kit/builder/data-table/index.d.ts.map +1 -0
- package/storybook-static/kit/builder/data-table/types.d.ts +27 -0
- package/storybook-static/kit/builder/data-table/types.d.ts.map +1 -0
- package/storybook-static/kit/builder/data-table/utils/dotAccessor.d.ts +2 -0
- package/storybook-static/kit/builder/data-table/utils/dotAccessor.d.ts.map +1 -0
- package/storybook-static/kit/builder/dialog/index.d.ts +3 -0
- package/storybook-static/kit/builder/dialog/index.d.ts.map +1 -0
- package/storybook-static/kit/builder/dialog/provider.d.ts +26 -0
- package/storybook-static/kit/builder/dialog/provider.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/components/FormActions.d.ts +20 -0
- package/storybook-static/kit/builder/form/components/FormActions.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/components/FormBuilder.d.ts +97 -0
- package/storybook-static/kit/builder/form/components/FormBuilder.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/components/FormField.d.ts +12 -0
- package/storybook-static/kit/builder/form/components/FormField.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/components/FormSection.d.ts +15 -0
- package/storybook-static/kit/builder/form/components/FormSection.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/components/index.d.ts +5 -0
- package/storybook-static/kit/builder/form/components/index.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/index.d.ts +3 -0
- package/storybook-static/kit/builder/form/index.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/utils/common-forms.d.ts +7 -0
- package/storybook-static/kit/builder/form/utils/common-forms.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/utils/dependencies.d.ts +41 -0
- package/storybook-static/kit/builder/form/utils/dependencies.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/utils/field-factories.d.ts +22 -0
- package/storybook-static/kit/builder/form/utils/field-factories.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/utils/index.d.ts +15 -0
- package/storybook-static/kit/builder/form/utils/index.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/utils/section-factories.d.ts +7 -0
- package/storybook-static/kit/builder/form/utils/section-factories.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/utils/transformers.d.ts +6 -0
- package/storybook-static/kit/builder/form/utils/transformers.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/utils/validations.d.ts +13 -0
- package/storybook-static/kit/builder/form/utils/validations.d.ts.map +1 -0
- package/storybook-static/kit/builder/form/utils/validators.d.ts +8 -0
- package/storybook-static/kit/builder/form/utils/validators.d.ts.map +1 -0
- package/storybook-static/kit/builder/page/Page.d.ts +48 -0
- package/storybook-static/kit/builder/page/Page.d.ts.map +1 -0
- package/storybook-static/kit/builder/page/index.d.ts +2 -0
- package/storybook-static/kit/builder/page/index.d.ts.map +1 -0
- package/storybook-static/kit/builder/section/SectionBuilder.d.ts +3 -0
- package/storybook-static/kit/builder/section/SectionBuilder.d.ts.map +1 -0
- package/storybook-static/kit/builder/section/index.d.ts +3 -0
- package/storybook-static/kit/builder/section/index.d.ts.map +1 -0
- package/storybook-static/kit/builder/section/types.d.ts +59 -0
- package/storybook-static/kit/builder/section/types.d.ts.map +1 -0
- package/storybook-static/kit/components/autocomplete/Autocomplete.d.ts +21 -0
- package/storybook-static/kit/components/autocomplete/Autocomplete.d.ts.map +1 -0
- package/storybook-static/kit/components/autocomplete/index.d.ts +3 -0
- package/storybook-static/kit/components/autocomplete/index.d.ts.map +1 -0
- package/storybook-static/kit/components/autocomplete/types.d.ts +19 -0
- package/storybook-static/kit/components/autocomplete/types.d.ts.map +1 -0
- package/storybook-static/kit/components/login/Login.d.ts +29 -0
- package/storybook-static/kit/components/login/Login.d.ts.map +1 -0
- package/storybook-static/kit/components/login/index.d.ts +2 -0
- package/storybook-static/kit/components/login/index.d.ts.map +1 -0
- package/storybook-static/kit/layouts/admin/components/AdminLayout.d.ts +17 -0
- package/storybook-static/kit/layouts/admin/components/AdminLayout.d.ts.map +1 -0
- package/storybook-static/kit/layouts/admin/components/ThemeToggle.d.ts +5 -0
- package/storybook-static/kit/layouts/admin/components/ThemeToggle.d.ts.map +1 -0
- package/storybook-static/kit/layouts/admin/hooks/menu.d.ts +12 -0
- package/storybook-static/kit/layouts/admin/hooks/menu.d.ts.map +1 -0
- package/storybook-static/kit/layouts/admin/providers/AdminMenuProvider.d.ts +7 -0
- package/storybook-static/kit/layouts/admin/providers/AdminMenuProvider.d.ts.map +1 -0
- package/storybook-static/kit/layouts/admin/types/index.d.ts +27 -0
- package/storybook-static/kit/layouts/admin/types/index.d.ts.map +1 -0
- package/storybook-static/kit/providers/ThemeProvider.d.ts +14 -0
- package/storybook-static/kit/providers/ThemeProvider.d.ts.map +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/a11y-5/manager-bundle.js +5 -0
- package/storybook-static/sb-addons/essentials-backgrounds-1/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-measure-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-outline-3/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/interactions-4/manager-bundle.js +57 -0
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +971 -0
- package/storybook-static/sb-addons/storysource-6/manager-bundle.js +3 -0
- package/storybook-static/sb-common-assets/favicon-wrapper.svg +46 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +797 -0
- package/storybook-static/sb-manager/globals-runtime.js +69653 -0
- package/storybook-static/sb-manager/globals.js +34 -0
- package/storybook-static/sb-manager/runtime.js +13181 -0
- package/storybook-static/shadcn/hooks/use-mobile.d.ts +2 -0
- package/storybook-static/shadcn/hooks/use-mobile.d.ts.map +1 -0
- package/storybook-static/shadcn/lib/utils.d.ts +3 -0
- package/storybook-static/shadcn/lib/utils.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/accordion.d.ts +8 -0
- package/storybook-static/shadcn/ui/accordion.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/alert-dialog.d.ts +15 -0
- package/storybook-static/shadcn/ui/alert-dialog.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/alert.d.ts +10 -0
- package/storybook-static/shadcn/ui/alert.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/aspect-ratio.d.ts +4 -0
- package/storybook-static/shadcn/ui/aspect-ratio.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/avatar.d.ts +7 -0
- package/storybook-static/shadcn/ui/avatar.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/badge.d.ts +10 -0
- package/storybook-static/shadcn/ui/badge.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/breadcrumb.d.ts +12 -0
- package/storybook-static/shadcn/ui/breadcrumb.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/button.d.ts +11 -0
- package/storybook-static/shadcn/ui/button.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/calendar.d.ts +9 -0
- package/storybook-static/shadcn/ui/calendar.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/card.d.ts +10 -0
- package/storybook-static/shadcn/ui/card.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/carousel.d.ts +20 -0
- package/storybook-static/shadcn/ui/carousel.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/chart.d.ts +41 -0
- package/storybook-static/shadcn/ui/chart.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/checkbox.d.ts +5 -0
- package/storybook-static/shadcn/ui/checkbox.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/collapsible.d.ts +6 -0
- package/storybook-static/shadcn/ui/collapsible.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/command.d.ts +19 -0
- package/storybook-static/shadcn/ui/command.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/context-menu.d.ts +26 -0
- package/storybook-static/shadcn/ui/context-menu.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/dialog.d.ts +16 -0
- package/storybook-static/shadcn/ui/dialog.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/drawer.d.ts +14 -0
- package/storybook-static/shadcn/ui/drawer.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/dropdown-menu.d.ts +26 -0
- package/storybook-static/shadcn/ui/dropdown-menu.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/form.d.ts +25 -0
- package/storybook-static/shadcn/ui/form.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/hover-card.d.ts +7 -0
- package/storybook-static/shadcn/ui/hover-card.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/input-otp.d.ts +12 -0
- package/storybook-static/shadcn/ui/input-otp.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/input.d.ts +4 -0
- package/storybook-static/shadcn/ui/input.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/label.d.ts +5 -0
- package/storybook-static/shadcn/ui/label.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/menubar.d.ts +27 -0
- package/storybook-static/shadcn/ui/menubar.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/navigation-menu.d.ts +15 -0
- package/storybook-static/shadcn/ui/navigation-menu.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/pagination.d.ts +14 -0
- package/storybook-static/shadcn/ui/pagination.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/popover.d.ts +8 -0
- package/storybook-static/shadcn/ui/popover.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/progress.d.ts +5 -0
- package/storybook-static/shadcn/ui/progress.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/radio-group.d.ts +6 -0
- package/storybook-static/shadcn/ui/radio-group.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/resizable.d.ts +9 -0
- package/storybook-static/shadcn/ui/resizable.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/scroll-area.d.ts +6 -0
- package/storybook-static/shadcn/ui/scroll-area.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/select.d.ts +16 -0
- package/storybook-static/shadcn/ui/select.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/separator.d.ts +5 -0
- package/storybook-static/shadcn/ui/separator.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/sheet.d.ts +14 -0
- package/storybook-static/shadcn/ui/sheet.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/sidebar.d.ts +70 -0
- package/storybook-static/shadcn/ui/sidebar.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/skeleton.d.ts +3 -0
- package/storybook-static/shadcn/ui/skeleton.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/slider.d.ts +5 -0
- package/storybook-static/shadcn/ui/slider.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/sonner.d.ts +4 -0
- package/storybook-static/shadcn/ui/sonner.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/switch.d.ts +5 -0
- package/storybook-static/shadcn/ui/switch.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/table.d.ts +11 -0
- package/storybook-static/shadcn/ui/table.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/tabs.d.ts +8 -0
- package/storybook-static/shadcn/ui/tabs.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/textarea.d.ts +4 -0
- package/storybook-static/shadcn/ui/textarea.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/toggle-group.d.ts +8 -0
- package/storybook-static/shadcn/ui/toggle-group.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/toggle.d.ts +10 -0
- package/storybook-static/shadcn/ui/toggle.d.ts.map +1 -0
- package/storybook-static/shadcn/ui/tooltip.d.ts +8 -0
- package/storybook-static/shadcn/ui/tooltip.d.ts.map +1 -0
- package/storybook-static/vite-inject-mocker-entry.js +18 -0
- package/tsconfig.json +24 -0
- package/tsconfig.lib.json +52 -0
- package/tsconfig.spec.json +38 -0
- package/vite.config.ts +63 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
import { cn } from '../../../shadcn/lib/utils';
|
|
3
|
+
import { FormSection } from '../form/components/FormSection';
|
|
4
|
+
import type { SectionBuilderProps, SectionLeaf, SectionNode } from './types';
|
|
5
|
+
|
|
6
|
+
// Tailwind-safe literal class maps (1-12)
|
|
7
|
+
const GRID_COLS = {
|
|
8
|
+
base: {
|
|
9
|
+
1: 'grid-cols-1', 2: 'grid-cols-2', 3: 'grid-cols-3', 4: 'grid-cols-4', 5: 'grid-cols-5', 6: 'grid-cols-6',
|
|
10
|
+
7: 'grid-cols-7', 8: 'grid-cols-8', 9: 'grid-cols-9', 10: 'grid-cols-10', 11: 'grid-cols-11', 12: 'grid-cols-12',
|
|
11
|
+
} as Record<number, string>,
|
|
12
|
+
sm: {
|
|
13
|
+
1: 'sm:grid-cols-1', 2: 'sm:grid-cols-2', 3: 'sm:grid-cols-3', 4: 'sm:grid-cols-4', 5: 'sm:grid-cols-5', 6: 'sm:grid-cols-6',
|
|
14
|
+
7: 'sm:grid-cols-7', 8: 'sm:grid-cols-8', 9: 'sm:grid-cols-9', 10: 'sm:grid-cols-10', 11: 'sm:grid-cols-11', 12: 'sm:grid-cols-12',
|
|
15
|
+
} as Record<number, string>,
|
|
16
|
+
md: {
|
|
17
|
+
1: 'md:grid-cols-1', 2: 'md:grid-cols-2', 3: 'md:grid-cols-3', 4: 'md:grid-cols-4', 5: 'md:grid-cols-5', 6: 'md:grid-cols-6',
|
|
18
|
+
7: 'md:grid-cols-7', 8: 'md:grid-cols-8', 9: 'md:grid-cols-9', 10: 'md:grid-cols-10', 11: 'md:grid-cols-11', 12: 'md:grid-cols-12',
|
|
19
|
+
} as Record<number, string>,
|
|
20
|
+
lg: {
|
|
21
|
+
1: 'lg:grid-cols-1', 2: 'lg:grid-cols-2', 3: 'lg:grid-cols-3', 4: 'lg:grid-cols-4', 5: 'lg:grid-cols-5', 6: 'lg:grid-cols-6',
|
|
22
|
+
7: 'lg:grid-cols-7', 8: 'lg:grid-cols-8', 9: 'lg:grid-cols-9', 10: 'lg:grid-cols-10', 11: 'lg:grid-cols-11', 12: 'lg:grid-cols-12',
|
|
23
|
+
} as Record<number, string>,
|
|
24
|
+
xl: {
|
|
25
|
+
1: 'xl:grid-cols-1', 2: 'xl:grid-cols-2', 3: 'xl:grid-cols-3', 4: 'xl:grid-cols-4', 5: 'xl:grid-cols-5', 6: 'xl:grid-cols-6',
|
|
26
|
+
7: 'xl:grid-cols-7', 8: 'xl:grid-cols-8', 9: 'xl:grid-cols-9', 10: 'xl:grid-cols-10', 11: 'xl:grid-cols-11', 12: 'xl:grid-cols-12',
|
|
27
|
+
} as Record<number, string>,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const COL_SPAN = {
|
|
31
|
+
base: {
|
|
32
|
+
1: 'col-span-1', 2: 'col-span-2', 3: 'col-span-3', 4: 'col-span-4', 5: 'col-span-5', 6: 'col-span-6',
|
|
33
|
+
7: 'col-span-7', 8: 'col-span-8', 9: 'col-span-9', 10: 'col-span-10', 11: 'col-span-11', 12: 'col-span-12',
|
|
34
|
+
} as Record<number, string>,
|
|
35
|
+
sm: {
|
|
36
|
+
1: 'sm:col-span-1', 2: 'sm:col-span-2', 3: 'sm:col-span-3', 4: 'sm:col-span-4', 5: 'sm:col-span-5', 6: 'sm:col-span-6',
|
|
37
|
+
7: 'sm:col-span-7', 8: 'sm:col-span-8', 9: 'sm:col-span-9', 10: 'sm:col-span-10', 11: 'sm:col-span-11', 12: 'sm:col-span-12',
|
|
38
|
+
} as Record<number, string>,
|
|
39
|
+
md: {
|
|
40
|
+
1: 'md:col-span-1', 2: 'md:col-span-2', 3: 'md:col-span-3', 4: 'md:col-span-4', 5: 'md:col-span-5', 6: 'md:col-span-6',
|
|
41
|
+
7: 'md:col-span-7', 8: 'md:col-span-8', 9: 'md:col-span-9', 10: 'md:col-span-10', 11: 'md:col-span-11', 12: 'md:col-span-12',
|
|
42
|
+
} as Record<number, string>,
|
|
43
|
+
lg: {
|
|
44
|
+
1: 'lg:col-span-1', 2: 'lg:col-span-2', 3: 'lg:col-span-3', 4: 'lg:col-span-4', 5: 'lg:col-span-5', 6: 'lg:col-span-6',
|
|
45
|
+
7: 'lg:col-span-7', 8: 'lg:col-span-8', 9: 'lg:col-span-9', 10: 'lg:col-span-10', 11: 'lg:col-span-11', 12: 'lg:col-span-12',
|
|
46
|
+
} as Record<number, string>,
|
|
47
|
+
xl: {
|
|
48
|
+
1: 'xl:col-span-1', 2: 'xl:col-span-2', 3: 'xl:col-span-3', 4: 'xl:col-span-4', 5: 'xl:col-span-5', 6: 'xl:col-span-6',
|
|
49
|
+
7: 'xl:col-span-7', 8: 'xl:col-span-8', 9: 'xl:col-span-9', 10: 'xl:col-span-10', 11: 'xl:col-span-11', 12: 'xl:col-span-12',
|
|
50
|
+
} as Record<number, string>,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
function gridClasses(options: SectionNode['grid']): string {
|
|
54
|
+
const cols = options?.cols ?? 1;
|
|
55
|
+
const sm = options?.smCols;
|
|
56
|
+
const md = options?.mdCols;
|
|
57
|
+
const lg = options?.lgCols;
|
|
58
|
+
const xl = options?.xlCols;
|
|
59
|
+
const gap = options?.gap ?? 'gap-4';
|
|
60
|
+
return cn(
|
|
61
|
+
'grid',
|
|
62
|
+
GRID_COLS.base[cols],
|
|
63
|
+
sm ? GRID_COLS.sm[sm] : undefined,
|
|
64
|
+
md ? GRID_COLS.md[md] : undefined,
|
|
65
|
+
lg ? GRID_COLS.lg[lg] : undefined,
|
|
66
|
+
xl ? GRID_COLS.xl[xl] : undefined,
|
|
67
|
+
gap,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function flexClasses(options: SectionNode['flex']): string {
|
|
72
|
+
const direction = options?.direction ?? 'col';
|
|
73
|
+
const wrap = options?.wrap ? 'flex-wrap' : 'flex-nowrap';
|
|
74
|
+
const gap = options?.gap ?? 'gap-4';
|
|
75
|
+
const align = options?.align ?? 'stretch';
|
|
76
|
+
const justify = options?.justify ?? 'start';
|
|
77
|
+
const alignClass
|
|
78
|
+
= align === 'start' ? 'items-start' : align === 'center' ? 'items-center' : align === 'end' ? 'items-end' : 'items-stretch';
|
|
79
|
+
const justifyClass
|
|
80
|
+
= justify === 'start' ? 'justify-start' : justify === 'center' ? 'justify-center' : justify === 'between' ? 'justify-between' : 'justify-end';
|
|
81
|
+
return cn('flex', `flex-${direction}`, wrap, gap, alignClass, justifyClass);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function leafSpanClasses(leaf: SectionLeaf): string | undefined {
|
|
85
|
+
if (!leaf.span) return undefined;
|
|
86
|
+
const parts: string[] = [];
|
|
87
|
+
if (leaf.span.base) parts.push(COL_SPAN.base[leaf.span.base]);
|
|
88
|
+
if (leaf.span.sm) parts.push(COL_SPAN.sm[leaf.span.sm]);
|
|
89
|
+
if (leaf.span.md) parts.push(COL_SPAN.md[leaf.span.md]);
|
|
90
|
+
if (leaf.span.lg) parts.push(COL_SPAN.lg[leaf.span.lg]);
|
|
91
|
+
if (leaf.span.xl) parts.push(COL_SPAN.xl[leaf.span.xl]);
|
|
92
|
+
return parts.join(' ');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function isLeaf(child: SectionNode | SectionLeaf): child is SectionLeaf {
|
|
96
|
+
return (child as SectionLeaf).content !== undefined;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function shallowEqualSpan(a?: SectionLeaf['span'], b?: SectionLeaf['span']) {
|
|
100
|
+
if (a === b) return true;
|
|
101
|
+
if (!a || !b) return !a && !b;
|
|
102
|
+
return a.base === b.base && a.sm === b.sm && a.md === b.md && a.lg === b.lg && a.xl === b.xl;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function shallowEqualLeaf(a: SectionLeaf, b: SectionLeaf) {
|
|
106
|
+
// Use renderKey when provided to force updates; otherwise ignore content ref equality
|
|
107
|
+
const renderKeyEqual = (a.renderKey ?? null) === (b.renderKey ?? null);
|
|
108
|
+
return (
|
|
109
|
+
a.key === b.key
|
|
110
|
+
&& a.hidden === b.hidden
|
|
111
|
+
&& a.className === b.className
|
|
112
|
+
&& a.labelLayout === b.labelLayout
|
|
113
|
+
&& a.labelClassName === b.labelClassName
|
|
114
|
+
&& a.valueClassName === b.valueClassName
|
|
115
|
+
&& a.inlineLabelWidthClass === b.inlineLabelWidthClass
|
|
116
|
+
&& shallowEqualSpan(a.span, b.span)
|
|
117
|
+
&& renderKeyEqual
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const SectionLeafRenderer = memo(
|
|
122
|
+
function SectionLeafRenderer({ leaf, renderLeaf }: { leaf: SectionLeaf; renderLeaf?: (leaf: SectionLeaf) => React.ReactNode }) {
|
|
123
|
+
if (leaf.hidden) return null;
|
|
124
|
+
const span = leafSpanClasses(leaf);
|
|
125
|
+
|
|
126
|
+
// If a custom renderLeaf is provided, let it fully control rendering
|
|
127
|
+
if (renderLeaf) {
|
|
128
|
+
return <div className={cn(span, leaf.className)}>{renderLeaf(leaf)}</div>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Default rendering with optional label support
|
|
132
|
+
const hasLabel = leaf.label !== undefined && leaf.label !== null && leaf.label !== '';
|
|
133
|
+
const layout = leaf.labelLayout ?? 'stacked';
|
|
134
|
+
const labelBaseCls = 'text-xs text-muted-foreground';
|
|
135
|
+
const valueBaseCls = 'text-sm leading-6';
|
|
136
|
+
|
|
137
|
+
if (!hasLabel) {
|
|
138
|
+
return <div className={cn(span, leaf.className, leaf.valueClassName)}>{leaf.content}</div>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (layout === 'inline') {
|
|
142
|
+
const labelWidth = leaf.inlineLabelWidthClass ?? 'w-32';
|
|
143
|
+
return (
|
|
144
|
+
<div className={cn(span, leaf.className, 'flex items-start gap-4')}>
|
|
145
|
+
<div className={cn(labelWidth, labelBaseCls, leaf.labelClassName)}>{leaf.label}</div>
|
|
146
|
+
<div className={cn('flex-1', valueBaseCls, leaf.valueClassName)}>
|
|
147
|
+
{leaf.content}
|
|
148
|
+
{leaf.description
|
|
149
|
+
? (
|
|
150
|
+
<div className={cn('mt-1', labelBaseCls)}>{leaf.description}</div>
|
|
151
|
+
)
|
|
152
|
+
: null}
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Stacked layout
|
|
159
|
+
return (
|
|
160
|
+
<div className={cn(span, leaf.className, 'flex flex-col')}>
|
|
161
|
+
<div className={cn(labelBaseCls, leaf.labelClassName)}>{leaf.label}</div>
|
|
162
|
+
<div className={cn(valueBaseCls, leaf.valueClassName)}>{leaf.content}</div>
|
|
163
|
+
{leaf.description
|
|
164
|
+
? (
|
|
165
|
+
<div className={cn('mt-1', labelBaseCls)}>{leaf.description}</div>
|
|
166
|
+
)
|
|
167
|
+
: null}
|
|
168
|
+
</div>
|
|
169
|
+
);
|
|
170
|
+
},
|
|
171
|
+
(prev, next) => shallowEqualLeaf(prev.leaf, next.leaf) && prev.renderLeaf === next.renderLeaf,
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
function SectionNodeRenderer({ node, renderLeaf }: { node: SectionNode; renderLeaf?: (leaf: SectionLeaf) => React.ReactNode }) {
|
|
175
|
+
if (node.hidden) return null;
|
|
176
|
+
const layout = node.layout ?? 'grid';
|
|
177
|
+
const containerClass = layout === 'grid' ? gridClasses(node.grid) : flexClasses(node.flex);
|
|
178
|
+
|
|
179
|
+
return (
|
|
180
|
+
<FormSection
|
|
181
|
+
title={node.title}
|
|
182
|
+
description={node.subtitle}
|
|
183
|
+
variant={node.variant ?? 'card'}
|
|
184
|
+
className={node.className}
|
|
185
|
+
headerClassName={node.headerClassName}
|
|
186
|
+
contentClassName={node.contentClassName}
|
|
187
|
+
>
|
|
188
|
+
<div className={containerClass}>
|
|
189
|
+
{(node.children ?? []).map((child) => {
|
|
190
|
+
if (isLeaf(child)) {
|
|
191
|
+
return <SectionLeafRenderer key={child.key} leaf={child} renderLeaf={renderLeaf} />;
|
|
192
|
+
}
|
|
193
|
+
if ((child as SectionNode).hidden) return null;
|
|
194
|
+
return (
|
|
195
|
+
<div key={(child as SectionNode).id} className="col-span-full">
|
|
196
|
+
<SectionNodeRenderer node={child as SectionNode} renderLeaf={renderLeaf} />
|
|
197
|
+
</div>
|
|
198
|
+
);
|
|
199
|
+
})}
|
|
200
|
+
</div>
|
|
201
|
+
</FormSection>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export default function SectionBuilder({ sections, className, renderLeaf }: SectionBuilderProps) {
|
|
206
|
+
return (
|
|
207
|
+
<div className={cn('space-y-6', className)}>
|
|
208
|
+
{sections.map(section => (
|
|
209
|
+
<SectionNodeRenderer key={section.id} node={section} renderLeaf={renderLeaf} />
|
|
210
|
+
))}
|
|
211
|
+
</div>
|
|
212
|
+
);
|
|
213
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
3
|
+
export type SectionLayout = 'grid' | 'flex';
|
|
4
|
+
|
|
5
|
+
export interface SectionGridOptions {
|
|
6
|
+
cols?: number;
|
|
7
|
+
smCols?: number;
|
|
8
|
+
mdCols?: number;
|
|
9
|
+
lgCols?: number;
|
|
10
|
+
xlCols?: number;
|
|
11
|
+
gap?: string; // Tailwind gap classes like 'gap-4' (optional)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface SectionFlexOptions {
|
|
15
|
+
direction?: 'row' | 'col';
|
|
16
|
+
wrap?: boolean;
|
|
17
|
+
gap?: string; // Tailwind gap classes like 'gap-4'
|
|
18
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
19
|
+
justify?: 'start' | 'center' | 'between' | 'end';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface SectionBase {
|
|
23
|
+
id: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
subtitle?: string;
|
|
26
|
+
variant?: 'card' | 'separator' | 'plain';
|
|
27
|
+
className?: string;
|
|
28
|
+
headerClassName?: string;
|
|
29
|
+
contentClassName?: string;
|
|
30
|
+
hidden?: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface SectionLeaf {
|
|
34
|
+
key: string;
|
|
35
|
+
content: React.ReactNode;
|
|
36
|
+
className?: string;
|
|
37
|
+
// Optional label & layout
|
|
38
|
+
label?: React.ReactNode;
|
|
39
|
+
labelLayout?: 'inline' | 'stacked';
|
|
40
|
+
labelClassName?: string;
|
|
41
|
+
valueClassName?: string;
|
|
42
|
+
inlineLabelWidthClass?: string; // e.g. 'w-32' when labelLayout is 'inline'
|
|
43
|
+
description?: React.ReactNode;
|
|
44
|
+
span?: {
|
|
45
|
+
base?: number;
|
|
46
|
+
sm?: number;
|
|
47
|
+
md?: number;
|
|
48
|
+
lg?: number;
|
|
49
|
+
xl?: number;
|
|
50
|
+
};
|
|
51
|
+
hidden?: boolean;
|
|
52
|
+
renderKey?: string | number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface SectionNode extends SectionBase {
|
|
56
|
+
layout?: SectionLayout;
|
|
57
|
+
grid?: SectionGridOptions;
|
|
58
|
+
flex?: SectionFlexOptions;
|
|
59
|
+
children?: Array<SectionNode | SectionLeaf>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface SectionBuilderProps {
|
|
63
|
+
sections: SectionNode[];
|
|
64
|
+
renderLeaf?: (leaf: SectionLeaf) => React.ReactNode;
|
|
65
|
+
className?: string;
|
|
66
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { cn } from '../../../shadcn/lib/utils';
|
|
3
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../../../shadcn/ui/popover';
|
|
4
|
+
import {
|
|
5
|
+
Command,
|
|
6
|
+
CommandEmpty,
|
|
7
|
+
CommandGroup,
|
|
8
|
+
CommandInput,
|
|
9
|
+
CommandItem,
|
|
10
|
+
CommandList,
|
|
11
|
+
CommandSeparator,
|
|
12
|
+
} from '../../../shadcn/ui/command';
|
|
13
|
+
import { ChevronsUpDown, Check, Loader2 } from 'lucide-react';
|
|
14
|
+
import { Button } from '../../../shadcn/ui/button';
|
|
15
|
+
import type {
|
|
16
|
+
AutocompleteFetcher,
|
|
17
|
+
AutocompleteMode,
|
|
18
|
+
AutocompleteOption,
|
|
19
|
+
AutocompleteFetchResult,
|
|
20
|
+
} from './types';
|
|
21
|
+
import { useDebounce } from 'use-debounce';
|
|
22
|
+
|
|
23
|
+
export type AutocompleteProps = {
|
|
24
|
+
mode: AutocompleteMode
|
|
25
|
+
options?: AutocompleteOption[]
|
|
26
|
+
fetcher?: AutocompleteFetcher
|
|
27
|
+
pageSize?: number
|
|
28
|
+
value?: string | number | null
|
|
29
|
+
onChange?: (value: string | number | null, option: AutocompleteOption | null) => void
|
|
30
|
+
placeholder?: string
|
|
31
|
+
disabled?: boolean
|
|
32
|
+
className?: string
|
|
33
|
+
emptyText?: string
|
|
34
|
+
renderOption?: (option: AutocompleteOption, selected: boolean) => React.ReactNode
|
|
35
|
+
searchPlaceholder?: string
|
|
36
|
+
/** Controls initial open state; component is uncontrolled otherwise */
|
|
37
|
+
defaultOpen?: boolean
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const DEFAULT_PAGE_SIZE = 20;
|
|
41
|
+
|
|
42
|
+
const EMPTY_OPTIONS: AutocompleteOption[] = [];
|
|
43
|
+
|
|
44
|
+
export function Autocomplete({
|
|
45
|
+
mode,
|
|
46
|
+
options = EMPTY_OPTIONS,
|
|
47
|
+
fetcher,
|
|
48
|
+
pageSize = DEFAULT_PAGE_SIZE,
|
|
49
|
+
value: controlledValue,
|
|
50
|
+
onChange,
|
|
51
|
+
placeholder = 'Select...',
|
|
52
|
+
disabled,
|
|
53
|
+
className,
|
|
54
|
+
emptyText = 'No results found',
|
|
55
|
+
renderOption,
|
|
56
|
+
searchPlaceholder = 'Search...',
|
|
57
|
+
defaultOpen,
|
|
58
|
+
}: AutocompleteProps) {
|
|
59
|
+
const [open, setOpen] = useState<boolean>(!!defaultOpen);
|
|
60
|
+
const [search, setSearch] = useState('');
|
|
61
|
+
const [debouncedSearch] = useDebounce(search, 250);
|
|
62
|
+
|
|
63
|
+
// Selection
|
|
64
|
+
const [value, setValue] = useState<string | number | null>(controlledValue ?? null);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (controlledValue !== undefined) setValue(controlledValue);
|
|
67
|
+
}, [controlledValue]);
|
|
68
|
+
|
|
69
|
+
const handleSelect = useCallback(
|
|
70
|
+
(next: AutocompleteOption) => {
|
|
71
|
+
const newValue = next.value;
|
|
72
|
+
if (controlledValue === undefined) setValue(newValue);
|
|
73
|
+
onChange?.(newValue, next);
|
|
74
|
+
setOpen(false);
|
|
75
|
+
},
|
|
76
|
+
[controlledValue, onChange],
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
// Data state (shared for both modes)
|
|
80
|
+
const [items, setItems] = useState<AutocompleteOption[]>([]);
|
|
81
|
+
const [loading, setLoading] = useState(false);
|
|
82
|
+
const [hasMore, setHasMore] = useState(false);
|
|
83
|
+
const [nextCursor, setNextCursor] = useState<string | number | null | undefined>(undefined);
|
|
84
|
+
const [page, setPage] = useState(1);
|
|
85
|
+
|
|
86
|
+
const resetData = useCallback(() => {
|
|
87
|
+
setItems([]);
|
|
88
|
+
setHasMore(false);
|
|
89
|
+
setNextCursor(undefined);
|
|
90
|
+
setPage(1);
|
|
91
|
+
}, []);
|
|
92
|
+
|
|
93
|
+
// Load data
|
|
94
|
+
const load = useCallback(async () => {
|
|
95
|
+
if (mode === 'server') {
|
|
96
|
+
if (!fetcher) return;
|
|
97
|
+
setLoading(true);
|
|
98
|
+
try {
|
|
99
|
+
const res: AutocompleteFetchResult = await fetcher({
|
|
100
|
+
search: debouncedSearch,
|
|
101
|
+
cursor: nextCursor ?? null,
|
|
102
|
+
page,
|
|
103
|
+
pageSize,
|
|
104
|
+
});
|
|
105
|
+
setItems(prev => (page === 1 ? res.items : [...prev, ...res.items]));
|
|
106
|
+
setHasMore(!!res.hasMore);
|
|
107
|
+
setNextCursor(res.nextCursor);
|
|
108
|
+
} finally {
|
|
109
|
+
setLoading(false);
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
// client mode: filter and paginate locally
|
|
113
|
+
setLoading(true);
|
|
114
|
+
try {
|
|
115
|
+
const filtered = debouncedSearch
|
|
116
|
+
? options.filter(o =>
|
|
117
|
+
o.label.toLowerCase().includes(debouncedSearch.toLowerCase()),
|
|
118
|
+
)
|
|
119
|
+
: options;
|
|
120
|
+
const start = (page - 1) * pageSize;
|
|
121
|
+
const slice = filtered.slice(start, start + pageSize);
|
|
122
|
+
setItems(prev => (page === 1 ? slice : [...prev, ...slice]));
|
|
123
|
+
setHasMore(start + pageSize < filtered.length);
|
|
124
|
+
setNextCursor(undefined);
|
|
125
|
+
} finally {
|
|
126
|
+
setLoading(false);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}, [mode, fetcher, debouncedSearch, nextCursor, page, pageSize, options]);
|
|
130
|
+
|
|
131
|
+
// Reset and load on open/search change
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
if (!open) return;
|
|
134
|
+
resetData();
|
|
135
|
+
// Load first page
|
|
136
|
+
const t = window.setTimeout(() => {
|
|
137
|
+
void load();
|
|
138
|
+
}, 0);
|
|
139
|
+
return () => window.clearTimeout(t);
|
|
140
|
+
}, [open, debouncedSearch, mode]);
|
|
141
|
+
|
|
142
|
+
// Infinite scroll
|
|
143
|
+
const listRef = useRef<HTMLDivElement | null>(null);
|
|
144
|
+
const onListScroll = useCallback(() => {
|
|
145
|
+
const el = listRef.current;
|
|
146
|
+
if (!el || loading) return;
|
|
147
|
+
const nearBottom = el.scrollTop + el.clientHeight >= el.scrollHeight - 24;
|
|
148
|
+
if (nearBottom && hasMore) {
|
|
149
|
+
setPage(p => p + 1);
|
|
150
|
+
}
|
|
151
|
+
}, [loading, hasMore]);
|
|
152
|
+
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
if (!open) return;
|
|
155
|
+
|
|
156
|
+
load();
|
|
157
|
+
}, [page]);
|
|
158
|
+
|
|
159
|
+
// Selected label
|
|
160
|
+
const selectedOption = useMemo(() => items.find(i => i.value === value), [items, value]);
|
|
161
|
+
|
|
162
|
+
// Ensure selected label when item not in current page (server mode)
|
|
163
|
+
const displayedLabel = useMemo(() => {
|
|
164
|
+
if (selectedOption) return selectedOption.label;
|
|
165
|
+
if (mode === 'client') {
|
|
166
|
+
const found = options.find(i => i.value === value);
|
|
167
|
+
return found?.label ?? placeholder;
|
|
168
|
+
}
|
|
169
|
+
return placeholder;
|
|
170
|
+
}, [mode, options, selectedOption, value, placeholder]);
|
|
171
|
+
|
|
172
|
+
return (
|
|
173
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
174
|
+
<PopoverTrigger asChild>
|
|
175
|
+
<Button
|
|
176
|
+
type="button"
|
|
177
|
+
variant="outline"
|
|
178
|
+
role="combobox"
|
|
179
|
+
aria-expanded={open}
|
|
180
|
+
className={cn('w-full justify-between', className)}
|
|
181
|
+
disabled={disabled}
|
|
182
|
+
>
|
|
183
|
+
<span className={cn('truncate', !value && 'text-muted-foreground')}>{displayedLabel}</span>
|
|
184
|
+
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
|
|
185
|
+
</Button>
|
|
186
|
+
</PopoverTrigger>
|
|
187
|
+
<PopoverContent className="w-[--radix-popover-trigger-width] p-0" align="start">
|
|
188
|
+
<Command shouldFilter={false} className="w-full">
|
|
189
|
+
<div className="p-2">
|
|
190
|
+
<CommandInput
|
|
191
|
+
value={search}
|
|
192
|
+
onValueChange={setSearch}
|
|
193
|
+
placeholder={searchPlaceholder}
|
|
194
|
+
autoFocus
|
|
195
|
+
/>
|
|
196
|
+
</div>
|
|
197
|
+
<CommandList className="max-h-56 overflow-auto" ref={listRef} onScroll={onListScroll}>
|
|
198
|
+
{loading && items.length === 0 ? (
|
|
199
|
+
<div className="flex items-center justify-center py-6 text-sm text-muted-foreground">
|
|
200
|
+
<Loader2 className="mr-2 h-4 w-4 animate-spin" /> Loading
|
|
201
|
+
</div>
|
|
202
|
+
) : null}
|
|
203
|
+
<CommandEmpty>{emptyText}</CommandEmpty>
|
|
204
|
+
{items.length > 0 ? (
|
|
205
|
+
<CommandGroup>
|
|
206
|
+
{items.map((item) => {
|
|
207
|
+
const selected = item.value === value;
|
|
208
|
+
return (
|
|
209
|
+
<CommandItem
|
|
210
|
+
key={`${item.value}`}
|
|
211
|
+
value={`${item.label}`}
|
|
212
|
+
onSelect={() => handleSelect(item)}
|
|
213
|
+
className="flex items-center justify-between"
|
|
214
|
+
>
|
|
215
|
+
<div className="min-w-0 truncate">
|
|
216
|
+
{renderOption ? renderOption(item, selected) : item.label}
|
|
217
|
+
</div>
|
|
218
|
+
{selected ? (
|
|
219
|
+
<Check className="h-4 w-4" />
|
|
220
|
+
) : null}
|
|
221
|
+
</CommandItem>
|
|
222
|
+
);
|
|
223
|
+
})}
|
|
224
|
+
</CommandGroup>
|
|
225
|
+
) : null}
|
|
226
|
+
{hasMore ? (
|
|
227
|
+
<>
|
|
228
|
+
<CommandSeparator />
|
|
229
|
+
<div className="flex items-center justify-center py-2 text-xs text-muted-foreground">
|
|
230
|
+
{loading ? (
|
|
231
|
+
<>
|
|
232
|
+
<Loader2 className="mr-1 h-3 w-3 animate-spin" /> Loading more
|
|
233
|
+
</>
|
|
234
|
+
) : (
|
|
235
|
+
'Scroll to load more'
|
|
236
|
+
)}
|
|
237
|
+
</div>
|
|
238
|
+
</>
|
|
239
|
+
) : null}
|
|
240
|
+
</CommandList>
|
|
241
|
+
</Command>
|
|
242
|
+
</PopoverContent>
|
|
243
|
+
</Popover>
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export default Autocomplete;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type AutocompleteOption = {
|
|
2
|
+
value: string | number
|
|
3
|
+
label: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type AutocompleteFetchParams = {
|
|
7
|
+
search: string
|
|
8
|
+
cursor?: string | number | null
|
|
9
|
+
page?: number
|
|
10
|
+
pageSize: number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type AutocompleteFetchResult = {
|
|
14
|
+
items: AutocompleteOption[]
|
|
15
|
+
nextCursor?: string | number | null
|
|
16
|
+
hasMore: boolean
|
|
17
|
+
total?: number
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type AutocompleteFetcher = (
|
|
21
|
+
params: AutocompleteFetchParams,
|
|
22
|
+
) => Promise<AutocompleteFetchResult>
|
|
23
|
+
|
|
24
|
+
export type AutocompleteMode = 'client' | 'server'
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
export type LoginProps = {
|
|
4
|
+
// Application title shown above the form (e.g., "Acme Inc")
|
|
5
|
+
appTitle?: string;
|
|
6
|
+
// Optional subtitle under the app title
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
// Customizable signup label and link
|
|
9
|
+
signupLabel?: string; // e.g., "Don't have an account?"
|
|
10
|
+
signupLinkLabel?: string; // e.g., "Sign up"
|
|
11
|
+
signupHref?: string;
|
|
12
|
+
// Optional: render a "Forgot password" link under the form
|
|
13
|
+
forgotPasswordLabel?: string; // e.g., "Forgot your password?"
|
|
14
|
+
forgotPasswordLinkLabel?: string; // e.g., "Forgot your password?"
|
|
15
|
+
forgotPasswordHref?: string; // when provided, the link will render
|
|
16
|
+
// Right-side image URL and alt
|
|
17
|
+
rightImageSrc?: string;
|
|
18
|
+
rightImageAlt?: string;
|
|
19
|
+
// Optional className for the outer container
|
|
20
|
+
className?: string;
|
|
21
|
+
// Optional continue-with slot (renders below the submit action area)
|
|
22
|
+
continueWith?: React.ReactNode;
|
|
23
|
+
// Children used as the form area
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Login layout container.
|
|
29
|
+
*
|
|
30
|
+
* Responsibilities:
|
|
31
|
+
* - Provides a two-column layout (form + optional right-side image)
|
|
32
|
+
* - Renders an app title and optional subtitle above the form
|
|
33
|
+
* - Renders optional separator and custom `continueWith` content (e.g., social buttons)
|
|
34
|
+
* - Renders a footer with configurable signup CTA
|
|
35
|
+
* - Leaves the actual form implementation to children, so you can use FormBuilder or any custom form
|
|
36
|
+
*/
|
|
37
|
+
export function Login({
|
|
38
|
+
appTitle = 'Acme Inc',
|
|
39
|
+
subtitle,
|
|
40
|
+
signupLabel = "Don't have an account?",
|
|
41
|
+
signupLinkLabel = 'Sign up',
|
|
42
|
+
signupHref = '#',
|
|
43
|
+
forgotPasswordLabel = 'Forgot your password?',
|
|
44
|
+
forgotPasswordLinkLabel = 'Reset Here',
|
|
45
|
+
forgotPasswordHref,
|
|
46
|
+
rightImageSrc,
|
|
47
|
+
rightImageAlt = 'Login image',
|
|
48
|
+
className,
|
|
49
|
+
continueWith,
|
|
50
|
+
children,
|
|
51
|
+
}: LoginProps) {
|
|
52
|
+
return (
|
|
53
|
+
<div className={['grid min-h-dvh grid-cols-1 md:grid-cols-2', className].filter(Boolean).join(' ')}>
|
|
54
|
+
{/* Left column: form section */}
|
|
55
|
+
<div className="flex items-center justify-center p-6 md:p-10">
|
|
56
|
+
<div className="w-full max-w-md">
|
|
57
|
+
{/* Title */}
|
|
58
|
+
<div className="mb-6 text-center">
|
|
59
|
+
<h1 className="text-2xl font-bold leading-tight tracking-tight">{appTitle}</h1>
|
|
60
|
+
{subtitle ? (
|
|
61
|
+
<p className="text-muted-foreground mt-1 text-sm">{subtitle}</p>
|
|
62
|
+
) : null}
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
{/* Form area (children) */}
|
|
66
|
+
<div className="grid gap-6">
|
|
67
|
+
{children}
|
|
68
|
+
|
|
69
|
+
{/* Optional: Forgot password link */}
|
|
70
|
+
{forgotPasswordHref ? (
|
|
71
|
+
<div className="text-center text-sm">
|
|
72
|
+
{forgotPasswordLabel}{' '}
|
|
73
|
+
<a href={forgotPasswordHref} className="underline underline-offset-4">
|
|
74
|
+
{forgotPasswordLinkLabel}
|
|
75
|
+
</a>
|
|
76
|
+
</div>
|
|
77
|
+
) : null}
|
|
78
|
+
|
|
79
|
+
{/* Optional separator + continueWith slot */}
|
|
80
|
+
{continueWith ? (
|
|
81
|
+
<>
|
|
82
|
+
<div className="after:border-border relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t">
|
|
83
|
+
<span className="bg-background text-muted-foreground relative z-10 px-2">
|
|
84
|
+
Or continue with
|
|
85
|
+
</span>
|
|
86
|
+
</div>
|
|
87
|
+
<div className="grid gap-3">{continueWith}</div>
|
|
88
|
+
</>
|
|
89
|
+
) : null}
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
{/* Signup footer */}
|
|
93
|
+
<div className="mt-6 text-center text-sm">
|
|
94
|
+
{signupLabel}{' '}
|
|
95
|
+
<a href={signupHref} className="underline underline-offset-4">
|
|
96
|
+
{signupLinkLabel}
|
|
97
|
+
</a>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
{/* Right column: image */}
|
|
103
|
+
<div className="hidden md:block">
|
|
104
|
+
{rightImageSrc ? (
|
|
105
|
+
<img
|
|
106
|
+
src={rightImageSrc}
|
|
107
|
+
alt={rightImageAlt}
|
|
108
|
+
className="h-full w-full object-cover"
|
|
109
|
+
loading="lazy"
|
|
110
|
+
/>
|
|
111
|
+
) : (
|
|
112
|
+
<div className="h-full w-full bg-muted" />
|
|
113
|
+
)}
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export default Login;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Login';
|