@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,395 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { Control, useController, useFieldArray } from 'react-hook-form';
|
|
3
|
+
import { cn } from '../../../../shadcn/lib/utils';
|
|
4
|
+
import { Button } from '../../../../shadcn/ui/button';
|
|
5
|
+
import { Input } from '../../../../shadcn/ui/input';
|
|
6
|
+
import { Textarea } from '../../../../shadcn/ui/textarea';
|
|
7
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../../shadcn/ui/select';
|
|
8
|
+
import { Checkbox } from '../../../../shadcn/ui/checkbox';
|
|
9
|
+
import { RadioGroup, RadioGroupItem } from '../../../../shadcn/ui/radio-group';
|
|
10
|
+
import { Label } from '../../../../shadcn/ui/label';
|
|
11
|
+
import { Card, CardContent, CardHeader, CardTitle } from '../../../../shadcn/ui/card';
|
|
12
|
+
import { Plus, Trash2, GripVertical } from 'lucide-react';
|
|
13
|
+
import { FormBuilderFieldConfig } from './FormBuilder';
|
|
14
|
+
import { Autocomplete } from '../../../components/autocomplete/Autocomplete';
|
|
15
|
+
import type { AutocompleteOption } from '../../../components/autocomplete/types';
|
|
16
|
+
|
|
17
|
+
export interface FormFieldProps {
|
|
18
|
+
field: FormBuilderFieldConfig;
|
|
19
|
+
control: Control<any>;
|
|
20
|
+
onChange?: (value: any) => void;
|
|
21
|
+
onFieldChange?: (name: string, value: any, allValues: Record<string, any>) => void;
|
|
22
|
+
parentPath?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function FormField({ field, control, onChange, onFieldChange, parentPath }: FormFieldProps) {
|
|
26
|
+
const fieldPath = parentPath ? `${parentPath}.${field.name}` : field.name;
|
|
27
|
+
const NULL_SENTINEL = '__NULL__';
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
field: controllerField,
|
|
31
|
+
fieldState: { error },
|
|
32
|
+
} = useController({
|
|
33
|
+
name: fieldPath,
|
|
34
|
+
control,
|
|
35
|
+
disabled: field.disabled,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const handleChange = useCallback((value: any) => {
|
|
39
|
+
controllerField.onChange(value);
|
|
40
|
+
onChange?.(value);
|
|
41
|
+
}, [controllerField.onChange, onChange]);
|
|
42
|
+
|
|
43
|
+
const renderBasicField = () => {
|
|
44
|
+
const baseProps = {
|
|
45
|
+
id: fieldPath,
|
|
46
|
+
disabled: field.disabled,
|
|
47
|
+
placeholder: field.placeholder,
|
|
48
|
+
className: cn(
|
|
49
|
+
error && 'border-destructive focus-visible:ring-destructive',
|
|
50
|
+
field.className,
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
switch (field.type) {
|
|
55
|
+
case 'autocomplete': {
|
|
56
|
+
const options: AutocompleteOption[] = (field.options ?? [])
|
|
57
|
+
.filter((o): o is { label: string; value: string | number } => o.value !== null && o.value !== undefined)
|
|
58
|
+
.map(o => ({ label: o.label, value: o.value }));
|
|
59
|
+
return (
|
|
60
|
+
<Autocomplete
|
|
61
|
+
mode={field.autocompleteMode ?? 'client'}
|
|
62
|
+
options={options}
|
|
63
|
+
fetcher={field.fetcher}
|
|
64
|
+
pageSize={field.pageSize}
|
|
65
|
+
value={(controllerField.value as string | number | null) ?? null}
|
|
66
|
+
onChange={(val) => handleChange(val)}
|
|
67
|
+
placeholder={field.placeholder}
|
|
68
|
+
searchPlaceholder={field.searchPlaceholder}
|
|
69
|
+
renderOption={field.renderOption}
|
|
70
|
+
disabled={field.disabled}
|
|
71
|
+
className={baseProps.className}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
case 'text':
|
|
76
|
+
case 'email':
|
|
77
|
+
case 'password':
|
|
78
|
+
return (
|
|
79
|
+
<Input
|
|
80
|
+
{...baseProps}
|
|
81
|
+
type={field.type}
|
|
82
|
+
value={controllerField.value || ''}
|
|
83
|
+
onChange={e => handleChange(e.target.value)}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
case 'number':
|
|
88
|
+
return (
|
|
89
|
+
<Input
|
|
90
|
+
{...baseProps}
|
|
91
|
+
type="number"
|
|
92
|
+
value={controllerField.value || ''}
|
|
93
|
+
onChange={e => handleChange(Number(e.target.value))}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
case 'textarea':
|
|
98
|
+
return (
|
|
99
|
+
<Textarea
|
|
100
|
+
{...baseProps}
|
|
101
|
+
value={controllerField.value || ''}
|
|
102
|
+
onChange={e => handleChange(e.target.value)}
|
|
103
|
+
rows={4}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
case 'select': {
|
|
108
|
+
const toUiValue = (val: unknown) => (val === null || val === undefined ? NULL_SENTINEL : String(val));
|
|
109
|
+
const fromUiValue = (val: string) => {
|
|
110
|
+
const match = field.options?.find(opt => toUiValue(opt.value) === val);
|
|
111
|
+
return match ? match.value : null;
|
|
112
|
+
};
|
|
113
|
+
return (
|
|
114
|
+
<Select
|
|
115
|
+
value={toUiValue(controllerField.value)}
|
|
116
|
+
onValueChange={val => handleChange(fromUiValue(val))}
|
|
117
|
+
disabled={field.disabled}
|
|
118
|
+
>
|
|
119
|
+
<SelectTrigger className={baseProps.className}>
|
|
120
|
+
<SelectValue placeholder={field.placeholder} />
|
|
121
|
+
</SelectTrigger>
|
|
122
|
+
<SelectContent>
|
|
123
|
+
{field.options?.map(option => (
|
|
124
|
+
<SelectItem key={toUiValue(option.value)} value={toUiValue(option.value)}>
|
|
125
|
+
{option.label}
|
|
126
|
+
</SelectItem>
|
|
127
|
+
))}
|
|
128
|
+
</SelectContent>
|
|
129
|
+
</Select>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
case 'checkbox':
|
|
134
|
+
return (
|
|
135
|
+
<div className="flex items-center space-x-2">
|
|
136
|
+
<Checkbox
|
|
137
|
+
id={fieldPath}
|
|
138
|
+
checked={controllerField.value || false}
|
|
139
|
+
onCheckedChange={handleChange}
|
|
140
|
+
disabled={field.disabled}
|
|
141
|
+
className={cn(error && 'border-destructive', field.className)}
|
|
142
|
+
/>
|
|
143
|
+
<Label htmlFor={fieldPath} className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
|
|
144
|
+
{field.label}
|
|
145
|
+
</Label>
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
case 'radio': {
|
|
150
|
+
const toUiValue = (val: unknown) => (val === null || val === undefined ? NULL_SENTINEL : String(val));
|
|
151
|
+
const fromUiValue = (val: string) => {
|
|
152
|
+
const match = field.options?.find(opt => toUiValue(opt.value) === val);
|
|
153
|
+
return match ? match.value : null;
|
|
154
|
+
};
|
|
155
|
+
return (
|
|
156
|
+
<RadioGroup
|
|
157
|
+
value={toUiValue(controllerField.value)}
|
|
158
|
+
onValueChange={val => handleChange(fromUiValue(val))}
|
|
159
|
+
disabled={field.disabled}
|
|
160
|
+
className={field.className}
|
|
161
|
+
>
|
|
162
|
+
{field.options?.map(option => (
|
|
163
|
+
<div key={toUiValue(option.value)} className="flex items-center space-x-2">
|
|
164
|
+
<RadioGroupItem value={toUiValue(option.value)} id={`${fieldPath}-${toUiValue(option.value)}`} />
|
|
165
|
+
<Label htmlFor={`${fieldPath}-${toUiValue(option.value)}`}>{option.label}</Label>
|
|
166
|
+
</div>
|
|
167
|
+
))}
|
|
168
|
+
</RadioGroup>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
case 'date':
|
|
173
|
+
return (
|
|
174
|
+
<Input
|
|
175
|
+
{...baseProps}
|
|
176
|
+
type="date"
|
|
177
|
+
value={controllerField.value ? new Date(controllerField.value).toISOString().split('T')[0] : ''}
|
|
178
|
+
onChange={e => handleChange(e.target.value ? new Date(e.target.value) : null)}
|
|
179
|
+
/>
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
case 'file':
|
|
183
|
+
return (
|
|
184
|
+
<Input
|
|
185
|
+
{...baseProps}
|
|
186
|
+
type="file"
|
|
187
|
+
onChange={e => handleChange(e.target.files?.[0] || null)}
|
|
188
|
+
/>
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
default:
|
|
192
|
+
return (
|
|
193
|
+
<Input
|
|
194
|
+
{...baseProps}
|
|
195
|
+
value={controllerField.value || ''}
|
|
196
|
+
onChange={e => handleChange(e.target.value)}
|
|
197
|
+
/>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
const renderObjectField = () => {
|
|
203
|
+
if (!field.fields) return null;
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<Card className={field.className}>
|
|
207
|
+
<CardHeader className="pb-3">
|
|
208
|
+
<CardTitle className="text-base">{field.label}</CardTitle>
|
|
209
|
+
{field.description && (
|
|
210
|
+
<p className="text-sm text-muted-foreground">{field.description}</p>
|
|
211
|
+
)}
|
|
212
|
+
</CardHeader>
|
|
213
|
+
<CardContent className="space-y-4">
|
|
214
|
+
<div className="grid gap-4 md:grid-cols-2">
|
|
215
|
+
{field.fields.map(subField => (
|
|
216
|
+
<FormField
|
|
217
|
+
key={subField.name}
|
|
218
|
+
field={subField}
|
|
219
|
+
control={control}
|
|
220
|
+
parentPath={fieldPath}
|
|
221
|
+
onChange={onChange}
|
|
222
|
+
onFieldChange={onFieldChange}
|
|
223
|
+
/>
|
|
224
|
+
))}
|
|
225
|
+
</div>
|
|
226
|
+
</CardContent>
|
|
227
|
+
</Card>
|
|
228
|
+
);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
const renderArrayField = () => {
|
|
232
|
+
const { fields, append, remove } = useFieldArray({
|
|
233
|
+
control,
|
|
234
|
+
name: fieldPath,
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
const addItem = () => {
|
|
238
|
+
if (field.fields && field.fields.length === 1) {
|
|
239
|
+
// Single field array (e.g., array of strings)
|
|
240
|
+
const defaultValue = field.fields[0].defaultValue || '';
|
|
241
|
+
append(defaultValue);
|
|
242
|
+
}
|
|
243
|
+
else if (field.fields) {
|
|
244
|
+
// Object array
|
|
245
|
+
const defaultObject: Record<string, any> = {};
|
|
246
|
+
field.fields.forEach((subField) => {
|
|
247
|
+
defaultObject[subField.name] = subField.defaultValue || '';
|
|
248
|
+
});
|
|
249
|
+
append(defaultObject);
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
append('');
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<Card className={field.className}>
|
|
258
|
+
<CardHeader className="pb-3">
|
|
259
|
+
<div className="flex items-center justify-between">
|
|
260
|
+
<div>
|
|
261
|
+
<CardTitle className="text-base">{field.label}</CardTitle>
|
|
262
|
+
{field.description && (
|
|
263
|
+
<p className="text-sm text-muted-foreground">{field.description}</p>
|
|
264
|
+
)}
|
|
265
|
+
</div>
|
|
266
|
+
<Button
|
|
267
|
+
type="button"
|
|
268
|
+
variant="outline"
|
|
269
|
+
size="sm"
|
|
270
|
+
onClick={addItem}
|
|
271
|
+
disabled={field.disabled}
|
|
272
|
+
>
|
|
273
|
+
<Plus className="h-4 w-4 mr-1" />
|
|
274
|
+
Add Item
|
|
275
|
+
</Button>
|
|
276
|
+
</div>
|
|
277
|
+
</CardHeader>
|
|
278
|
+
<CardContent className="space-y-4">
|
|
279
|
+
{fields.length === 0 ? (
|
|
280
|
+
<p className="text-sm text-muted-foreground text-center py-4">
|
|
281
|
+
No items added yet. Click "Add Item" to get started.
|
|
282
|
+
</p>
|
|
283
|
+
) : (
|
|
284
|
+
fields.map((item, index) => (
|
|
285
|
+
<Card key={item.id} className="relative">
|
|
286
|
+
<CardHeader className="pb-3">
|
|
287
|
+
<div className="flex items-center justify-between">
|
|
288
|
+
<div className="flex items-center gap-2">
|
|
289
|
+
<GripVertical className="h-4 w-4 text-muted-foreground" />
|
|
290
|
+
<span className="text-sm font-medium">
|
|
291
|
+
Item
|
|
292
|
+
{index + 1}
|
|
293
|
+
</span>
|
|
294
|
+
</div>
|
|
295
|
+
<Button
|
|
296
|
+
type="button"
|
|
297
|
+
variant="ghost"
|
|
298
|
+
size="sm"
|
|
299
|
+
onClick={() => remove(index)}
|
|
300
|
+
disabled={field.disabled}
|
|
301
|
+
>
|
|
302
|
+
<Trash2 className="h-4 w-4" />
|
|
303
|
+
</Button>
|
|
304
|
+
</div>
|
|
305
|
+
</CardHeader>
|
|
306
|
+
<CardContent>
|
|
307
|
+
{field.fields && field.fields.length === 1 ? (
|
|
308
|
+
// Single field array
|
|
309
|
+
<FormField
|
|
310
|
+
field={{
|
|
311
|
+
...field.fields[0],
|
|
312
|
+
name: field.fields[0].name,
|
|
313
|
+
label: field.fields[0].label || 'Value',
|
|
314
|
+
}}
|
|
315
|
+
control={control}
|
|
316
|
+
parentPath={`${fieldPath}.${index}`}
|
|
317
|
+
onChange={onChange}
|
|
318
|
+
/>
|
|
319
|
+
) : field.fields ? (
|
|
320
|
+
// Object array
|
|
321
|
+
<div className="grid gap-4 md:grid-cols-2">
|
|
322
|
+
{field.fields.map(subField => (
|
|
323
|
+
<FormField
|
|
324
|
+
key={subField.name}
|
|
325
|
+
field={subField}
|
|
326
|
+
control={control}
|
|
327
|
+
parentPath={`${fieldPath}.${index}`}
|
|
328
|
+
onChange={onChange}
|
|
329
|
+
onFieldChange={onFieldChange}
|
|
330
|
+
/>
|
|
331
|
+
))}
|
|
332
|
+
</div>
|
|
333
|
+
) : (
|
|
334
|
+
// Fallback for arrays without field definitions
|
|
335
|
+
<Input
|
|
336
|
+
value={controllerField.value?.[index] || ''}
|
|
337
|
+
onChange={(e) => {
|
|
338
|
+
const newArray = [...(controllerField.value || [])];
|
|
339
|
+
newArray[index] = e.target.value;
|
|
340
|
+
handleChange(newArray);
|
|
341
|
+
}}
|
|
342
|
+
placeholder={`Item ${index + 1}`}
|
|
343
|
+
disabled={field.disabled}
|
|
344
|
+
/>
|
|
345
|
+
)}
|
|
346
|
+
</CardContent>
|
|
347
|
+
</Card>
|
|
348
|
+
))
|
|
349
|
+
)}
|
|
350
|
+
</CardContent>
|
|
351
|
+
</Card>
|
|
352
|
+
);
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
if (field.type === 'object') {
|
|
356
|
+
return renderObjectField();
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (field.type === 'array') {
|
|
360
|
+
return renderArrayField();
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// For checkbox, we don't need the label wrapper since it's handled internally
|
|
364
|
+
if (field.type === 'checkbox') {
|
|
365
|
+
return (
|
|
366
|
+
<div className={cn('space-y-2', field.gridCols && `md:col-span-${field.gridCols}`)}>
|
|
367
|
+
{renderBasicField()}
|
|
368
|
+
{field.description && (
|
|
369
|
+
<p className="text-sm text-muted-foreground">{field.description}</p>
|
|
370
|
+
)}
|
|
371
|
+
{error && (
|
|
372
|
+
<p className="text-sm text-destructive">{error.message}</p>
|
|
373
|
+
)}
|
|
374
|
+
</div>
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return (
|
|
379
|
+
<div className={cn('space-y-2', field.gridCols && `md:col-span-${field.gridCols}`)}>
|
|
380
|
+
<Label htmlFor={fieldPath} className="text-sm font-medium">
|
|
381
|
+
{field.label}
|
|
382
|
+
{field.required && <span className="text-destructive ml-1">*</span>}
|
|
383
|
+
</Label>
|
|
384
|
+
{renderBasicField()}
|
|
385
|
+
{field.description && (
|
|
386
|
+
<p className="text-sm text-muted-foreground">{field.description}</p>
|
|
387
|
+
)}
|
|
388
|
+
{error && (
|
|
389
|
+
<p className="text-sm text-destructive">{error.message}</p>
|
|
390
|
+
)}
|
|
391
|
+
</div>
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export default FormField;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../../../../shadcn/ui/card';
|
|
3
|
+
import { Separator } from '../../../../shadcn/ui/separator';
|
|
4
|
+
import { cn } from '../../../../shadcn/lib/utils';
|
|
5
|
+
|
|
6
|
+
export interface FormSectionProps {
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
variant?: 'card' | 'separator' | 'plain';
|
|
11
|
+
className?: string;
|
|
12
|
+
headerClassName?: string;
|
|
13
|
+
contentClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface FormSectionConfig extends FormSectionProps {
|
|
17
|
+
id: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function FormSection({
|
|
21
|
+
title,
|
|
22
|
+
description,
|
|
23
|
+
children,
|
|
24
|
+
variant = 'card',
|
|
25
|
+
className,
|
|
26
|
+
headerClassName,
|
|
27
|
+
contentClassName,
|
|
28
|
+
}: FormSectionProps) {
|
|
29
|
+
const renderHeader = () => {
|
|
30
|
+
if (!title && !description) return null;
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className={cn('space-y-1', headerClassName)}>
|
|
34
|
+
{title && (
|
|
35
|
+
<h3 className="text-lg font-medium leading-none">{title}</h3>
|
|
36
|
+
)}
|
|
37
|
+
{description && (
|
|
38
|
+
<p className="text-sm text-muted-foreground">{description}</p>
|
|
39
|
+
)}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const renderContent = () => (
|
|
45
|
+
<div className={cn('space-y-4', contentClassName)}>
|
|
46
|
+
{children}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
switch (variant) {
|
|
51
|
+
case 'card':
|
|
52
|
+
return (
|
|
53
|
+
<Card className={className}>
|
|
54
|
+
{(title || description) && (
|
|
55
|
+
<CardHeader>
|
|
56
|
+
{title && <CardTitle>{title}</CardTitle>}
|
|
57
|
+
{description && <CardDescription>{description}</CardDescription>}
|
|
58
|
+
</CardHeader>
|
|
59
|
+
)}
|
|
60
|
+
<CardContent className={cn(!title && !description && 'pt-6')}>
|
|
61
|
+
{renderContent()}
|
|
62
|
+
</CardContent>
|
|
63
|
+
</Card>
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
case 'separator':
|
|
67
|
+
return (
|
|
68
|
+
<div className={cn('space-y-6', className)}>
|
|
69
|
+
{(title || description) && (
|
|
70
|
+
<>
|
|
71
|
+
{renderHeader()}
|
|
72
|
+
<Separator />
|
|
73
|
+
</>
|
|
74
|
+
)}
|
|
75
|
+
{renderContent()}
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
case 'plain':
|
|
80
|
+
default:
|
|
81
|
+
return (
|
|
82
|
+
<div className={cn('space-y-6', className)}>
|
|
83
|
+
{renderHeader()}
|
|
84
|
+
{renderContent()}
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { FormBuilderSectionConfig } from '../components/FormBuilder';
|
|
2
|
+
import { createField } from './field-factories';
|
|
3
|
+
import { createSection } from './section-factories';
|
|
4
|
+
import { commonValidations } from './validations';
|
|
5
|
+
|
|
6
|
+
// Pre-built common form configurations
|
|
7
|
+
export const commonForms = {
|
|
8
|
+
// User registration form
|
|
9
|
+
userRegistration: (): FormBuilderSectionConfig[] => [
|
|
10
|
+
createSection.card('Personal Information', [
|
|
11
|
+
createField.text('firstName', 'First Name', { required: true }),
|
|
12
|
+
createField.text('lastName', 'Last Name', { required: true }),
|
|
13
|
+
createField.email('email', 'Email Address', { required: true }),
|
|
14
|
+
createField.password('password', 'Password', { required: true }),
|
|
15
|
+
createField.password('confirmPassword', 'Confirm Password', {
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
]),
|
|
19
|
+
createSection.card('Additional Information', [
|
|
20
|
+
createField.text('phone', 'Phone Number', {
|
|
21
|
+
validation: commonValidations.phone,
|
|
22
|
+
}),
|
|
23
|
+
createField.date('dateOfBirth', 'Date of Birth'),
|
|
24
|
+
createField.checkbox(
|
|
25
|
+
'agreeToTerms',
|
|
26
|
+
'I agree to the terms and conditions',
|
|
27
|
+
{ required: true },
|
|
28
|
+
),
|
|
29
|
+
]),
|
|
30
|
+
],
|
|
31
|
+
|
|
32
|
+
// Contact form
|
|
33
|
+
contact: (): FormBuilderSectionConfig[] => [
|
|
34
|
+
createSection.plain([
|
|
35
|
+
createField.text('name', 'Full Name', { required: true }),
|
|
36
|
+
createField.email('email', 'Email Address', { required: true }),
|
|
37
|
+
createField.text('subject', 'Subject', { required: true }),
|
|
38
|
+
createField.textarea('message', 'Message', {
|
|
39
|
+
required: true,
|
|
40
|
+
gridCols: 2,
|
|
41
|
+
}),
|
|
42
|
+
]),
|
|
43
|
+
],
|
|
44
|
+
|
|
45
|
+
// Address form
|
|
46
|
+
address: (): FormBuilderSectionConfig[] => [
|
|
47
|
+
createSection.card('Address Information', [
|
|
48
|
+
createField.text('street', 'Street Address', {
|
|
49
|
+
required: true,
|
|
50
|
+
gridCols: 2,
|
|
51
|
+
}),
|
|
52
|
+
createField.text('city', 'City', { required: true }),
|
|
53
|
+
createField.text('state', 'State/Province', { required: true }),
|
|
54
|
+
createField.text('postalCode', 'Postal Code', { required: true }),
|
|
55
|
+
createField.select(
|
|
56
|
+
'country',
|
|
57
|
+
'Country',
|
|
58
|
+
[
|
|
59
|
+
{ label: 'United States', value: 'US' },
|
|
60
|
+
{ label: 'Canada', value: 'CA' },
|
|
61
|
+
{ label: 'United Kingdom', value: 'UK' },
|
|
62
|
+
// Add more countries as needed
|
|
63
|
+
],
|
|
64
|
+
{ required: true },
|
|
65
|
+
),
|
|
66
|
+
]),
|
|
67
|
+
],
|
|
68
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Dependency helpers
|
|
2
|
+
export const createDependency = {
|
|
3
|
+
showWhen: (field: string, condition: (value: any) => boolean) => ({
|
|
4
|
+
field,
|
|
5
|
+
condition,
|
|
6
|
+
action: 'show' as const,
|
|
7
|
+
}),
|
|
8
|
+
|
|
9
|
+
hideWhen: (field: string, condition: (value: any) => boolean) => ({
|
|
10
|
+
field,
|
|
11
|
+
condition,
|
|
12
|
+
action: 'hide' as const,
|
|
13
|
+
}),
|
|
14
|
+
|
|
15
|
+
enableWhen: (field: string, condition: (value: any) => boolean) => ({
|
|
16
|
+
field,
|
|
17
|
+
condition,
|
|
18
|
+
action: 'enable' as const,
|
|
19
|
+
}),
|
|
20
|
+
|
|
21
|
+
disableWhen: (field: string, condition: (value: any) => boolean) => ({
|
|
22
|
+
field,
|
|
23
|
+
condition,
|
|
24
|
+
action: 'disable' as const,
|
|
25
|
+
}),
|
|
26
|
+
|
|
27
|
+
setValueWhen: (
|
|
28
|
+
field: string,
|
|
29
|
+
condition: (value: any) => boolean,
|
|
30
|
+
value: any,
|
|
31
|
+
) => ({
|
|
32
|
+
field,
|
|
33
|
+
condition,
|
|
34
|
+
action: 'setValue' as const,
|
|
35
|
+
value,
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// Common condition helpers
|
|
40
|
+
export const conditions = {
|
|
41
|
+
equals: (value: any) => (fieldValue: any) => fieldValue === value,
|
|
42
|
+
notEquals: (value: any) => (fieldValue: any) => fieldValue !== value,
|
|
43
|
+
includes: (value: any) => (fieldValue: any) =>
|
|
44
|
+
Array.isArray(fieldValue) && fieldValue.includes(value),
|
|
45
|
+
notIncludes: (value: any) => (fieldValue: any) =>
|
|
46
|
+
Array.isArray(fieldValue) && !fieldValue.includes(value),
|
|
47
|
+
isEmpty: () => (fieldValue: any) =>
|
|
48
|
+
!fieldValue || (Array.isArray(fieldValue) && fieldValue.length === 0),
|
|
49
|
+
isNotEmpty: () => (fieldValue: any) =>
|
|
50
|
+
fieldValue && (!Array.isArray(fieldValue) || fieldValue.length > 0),
|
|
51
|
+
greaterThan: (value: number) => (fieldValue: any) =>
|
|
52
|
+
Number(fieldValue) > value,
|
|
53
|
+
lessThan: (value: number) => (fieldValue: any) => Number(fieldValue) < value,
|
|
54
|
+
isTrue: () => (fieldValue: any) => fieldValue === true,
|
|
55
|
+
isFalse: () => (fieldValue: any) => fieldValue === false,
|
|
56
|
+
};
|