@k3-universe/react-kit 0.0.41 → 0.0.42
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 -12
- package/.storybook/main.ts +22 -22
- package/.storybook/preview.ts +198 -198
- package/Dockerfile.storybook +43 -43
- package/README.md +9 -9
- package/biome.json +10 -10
- package/components.json +20 -20
- package/dist/index.js +32 -14
- package/dist/kit/builder/auth/hooks/core-hooks.d.ts.map +1 -1
- package/dist/kit/builder/form/components/fields/AutocompleteField.d.ts.map +1 -1
- package/dist/kit/builder/form/components/fields/DatePickerField.d.ts.map +1 -1
- package/dist/kit/builder/form/components/fields/DateRangePickerField.d.ts.map +1 -1
- package/dist/kit/builder/form/types.d.ts +2 -0
- package/dist/kit/builder/form/types.d.ts.map +1 -1
- package/dist/kit/components/autocomplete/Autocomplete.d.ts +2 -1
- package/dist/kit/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/kit/layouts/admin/hooks/menu.d.ts.map +1 -1
- package/dist/kit/themes/clean-slate.css +4 -8
- package/dist/kit/themes/default.css +5 -9
- package/dist/kit/themes/minimal-modern.css +4 -8
- package/dist/kit/themes/spotify.css +4 -8
- package/package.json +1 -1
- package/src/index.ts +99 -99
- package/src/kit/builder/auth/components/Can.tsx +27 -27
- package/src/kit/builder/auth/components/RequireAuth.tsx +78 -78
- package/src/kit/builder/auth/components/ShowWhenAuthenticated.tsx +10 -10
- package/src/kit/builder/auth/components/ShowWhenError.tsx +10 -10
- package/src/kit/builder/auth/components/ShowWhenLoading.tsx +10 -10
- package/src/kit/builder/auth/components/ShowWhenUnauthenticated.tsx +10 -10
- package/src/kit/builder/auth/components/withPermission.tsx +23 -23
- package/src/kit/builder/auth/hooks/action-hooks.ts +34 -34
- package/src/kit/builder/auth/hooks/core-hooks.ts +65 -65
- package/src/kit/builder/auth/hooks/index.ts +4 -4
- package/src/kit/builder/auth/hooks/permission-hooks.ts +43 -43
- package/src/kit/builder/auth/hooks/token-hooks.ts +25 -25
- package/src/kit/builder/auth/index.ts +132 -132
- package/src/kit/builder/auth/providers/AuthProvider.tsx +131 -131
- package/src/kit/builder/auth/types/adapter-config.ts +44 -44
- package/src/kit/builder/auth/types/adapter.ts +132 -132
- package/src/kit/builder/auth/types/core.ts +27 -27
- package/src/kit/builder/auth/types/index.ts +9 -9
- package/src/kit/builder/auth/types/middleware.ts +20 -20
- package/src/kit/builder/auth/types/permissions.ts +23 -23
- package/src/kit/builder/auth/types/state.ts +16 -16
- package/src/kit/builder/auth/types/storage.ts +21 -21
- package/src/kit/builder/auth/types/token-manager.ts +9 -9
- package/src/kit/builder/auth/types/utils.ts +55 -55
- package/src/kit/builder/auth/utils/auth-adapter.ts +437 -437
- package/src/kit/builder/auth/utils/client-adapters/apollo-link.ts +30 -30
- package/src/kit/builder/auth/utils/client-adapters/axios.ts +61 -61
- package/src/kit/builder/auth/utils/client-adapters/fetch.ts +48 -48
- package/src/kit/builder/auth/utils/client-adapters/graphql.ts +60 -60
- package/src/kit/builder/auth/utils/client-adapters/index.ts +6 -6
- package/src/kit/builder/auth/utils/client-adapters/rest.ts +60 -60
- package/src/kit/builder/auth/utils/client-adapters/urql-exchange.ts +76 -76
- package/src/kit/builder/auth/utils/permission-checker.ts +150 -150
- package/src/kit/builder/auth/utils/storage/browser.ts +99 -99
- package/src/kit/builder/auth/utils/storage/cookie.ts +116 -116
- package/src/kit/builder/auth/utils/storage/encryption.ts +80 -80
- package/src/kit/builder/auth/utils/storage/env.ts +2 -2
- package/src/kit/builder/auth/utils/storage/factory.ts +37 -37
- package/src/kit/builder/auth/utils/storage/index.ts +6 -6
- package/src/kit/builder/auth/utils/storage/memory.ts +15 -15
- package/src/kit/builder/auth/utils/token-manager.ts +55 -55
- package/src/kit/builder/data-table/components/DataTable.tsx +547 -547
- package/src/kit/builder/data-table/components/DataTableColumnHeader.tsx +67 -67
- package/src/kit/builder/data-table/components/DataTablePagination.tsx +112 -112
- package/src/kit/builder/data-table/components/DataTableViewOptions.tsx +51 -51
- package/src/kit/builder/data-table/index.ts +6 -6
- package/src/kit/builder/data-table/types.ts +44 -44
- package/src/kit/builder/data-table/utils/dotAccessor.ts +6 -6
- package/src/kit/builder/dialog/index.ts +6 -6
- package/src/kit/builder/dialog/provider.tsx +170 -170
- package/src/kit/builder/form/components/FormBuilder.tsx +295 -295
- package/src/kit/builder/form/components/FormBuilderActions.tsx +78 -78
- package/src/kit/builder/form/components/FormBuilderContext.tsx +52 -52
- package/src/kit/builder/form/components/FormBuilderField.tsx +456 -456
- package/src/kit/builder/form/components/fields/ArrayField.tsx +311 -311
- package/src/kit/builder/form/components/fields/AutocompleteField.tsx +89 -88
- package/src/kit/builder/form/components/fields/CheckboxField.tsx +65 -65
- package/src/kit/builder/form/components/fields/DateField.tsx +26 -26
- package/src/kit/builder/form/components/fields/DatePickerField.tsx +31 -29
- package/src/kit/builder/form/components/fields/DateRangePickerField.tsx +55 -46
- package/src/kit/builder/form/components/fields/DateTimePickerField.tsx +38 -38
- package/src/kit/builder/form/components/fields/DateTimeRangePickerField.tsx +48 -48
- package/src/kit/builder/form/components/fields/FileField.tsx +31 -31
- package/src/kit/builder/form/components/fields/MonthPickerField.tsx +33 -33
- package/src/kit/builder/form/components/fields/MonthRangePickerField.tsx +41 -41
- package/src/kit/builder/form/components/fields/NumberField.tsx +20 -20
- package/src/kit/builder/form/components/fields/ObjectField.tsx +35 -35
- package/src/kit/builder/form/components/fields/RadioField.tsx +47 -47
- package/src/kit/builder/form/components/fields/SelectField.tsx +46 -46
- package/src/kit/builder/form/components/fields/SwitchField.tsx +65 -65
- package/src/kit/builder/form/components/fields/TextField.tsx +25 -25
- package/src/kit/builder/form/components/fields/TextareaField.tsx +20 -20
- package/src/kit/builder/form/components/fields/TimePickerField.tsx +35 -35
- package/src/kit/builder/form/components/fields/TimeRangePickerField.tsx +43 -43
- package/src/kit/builder/form/components/fields/index.ts +21 -21
- package/src/kit/builder/form/components/fields/types.ts +18 -18
- package/src/kit/builder/form/components/index.ts +3 -3
- package/src/kit/builder/form/components/sectionNodes.tsx +147 -147
- package/src/kit/builder/form/hooks/useFormBuilder.ts +451 -451
- package/src/kit/builder/form/index.ts +4 -4
- package/src/kit/builder/form/types.ts +245 -243
- package/src/kit/builder/form/utils/common-forms.ts +68 -68
- package/src/kit/builder/form/utils/dependencies.ts +56 -56
- package/src/kit/builder/form/utils/field-factories.ts +177 -177
- package/src/kit/builder/form/utils/index.ts +17 -17
- package/src/kit/builder/form/utils/section-factories.ts +38 -38
- package/src/kit/builder/form/utils/transformers.ts +100 -100
- package/src/kit/builder/form/utils/validations.ts +22 -22
- package/src/kit/builder/form/utils/validators.ts +20 -20
- package/src/kit/builder/page/Page.tsx +202 -202
- package/src/kit/builder/page/index.ts +1 -1
- package/src/kit/builder/section/SectionBuilder.tsx +435 -435
- package/src/kit/builder/section/SectionContainer.tsx +85 -85
- package/src/kit/builder/section/index.ts +2 -2
- package/src/kit/builder/section/types.ts +80 -80
- package/src/kit/builder/stack-dialog/context.ts +15 -15
- package/src/kit/builder/stack-dialog/hooks.ts +13 -13
- package/src/kit/builder/stack-dialog/index.ts +12 -12
- package/src/kit/builder/stack-dialog/provider.tsx +51 -51
- package/src/kit/builder/stack-dialog/renderer.tsx +36 -36
- package/src/kit/builder/stack-dialog/types.ts +34 -34
- package/src/kit/components/autocomplete/Autocomplete.tsx +671 -664
- package/src/kit/components/autocomplete/index.ts +3 -3
- package/src/kit/components/autocomplete/types.ts +27 -27
- package/src/kit/components/datepicker/DatePicker.tsx +173 -173
- package/src/kit/components/datepicker/DateRangePicker.tsx +526 -526
- package/src/kit/components/datepicker/index.ts +2 -2
- package/src/kit/components/datetimepicker/DateTimePicker.tsx +420 -420
- package/src/kit/components/datetimepicker/DateTimeRangePicker.tsx +676 -676
- package/src/kit/components/datetimepicker/index.ts +2 -2
- package/src/kit/components/fileuploader/FileUploader.tsx +626 -626
- package/src/kit/components/fileuploader/index.ts +3 -3
- package/src/kit/components/fileuploader/types.ts +76 -76
- package/src/kit/components/forminfo/FormInfoError.tsx +135 -135
- package/src/kit/components/forminfo/index.ts +1 -1
- package/src/kit/components/keyboard/Keyboard.tsx +916 -916
- package/src/kit/components/keyboard/index.ts +4 -4
- package/src/kit/components/login/Login.tsx +141 -141
- package/src/kit/components/login/index.ts +1 -1
- package/src/kit/components/monthpicker/MonthInput.tsx +131 -131
- package/src/kit/components/monthpicker/MonthPicker.tsx +224 -224
- package/src/kit/components/monthpicker/MonthRangeInput.tsx +153 -153
- package/src/kit/components/monthpicker/MonthRangePicker.tsx +409 -409
- package/src/kit/components/numpad/Numpad.tsx +377 -377
- package/src/kit/components/numpad/index.ts +4 -4
- package/src/kit/components/timepicker/TimePicker.tsx +319 -319
- package/src/kit/components/timepicker/TimeRangePicker.tsx +368 -368
- package/src/kit/components/timepicker/index.ts +2 -2
- package/src/kit/layouts/admin/components/AdminLayout.tsx +286 -286
- package/src/kit/layouts/admin/components/ThemeToggle.tsx +54 -54
- package/src/kit/layouts/admin/hooks/menu.ts +32 -32
- package/src/kit/layouts/admin/providers/AdminMenuProvider.tsx +78 -78
- package/src/kit/layouts/admin/types/index.ts +26 -26
- package/src/kit/providers/ThemeProvider.tsx +90 -90
- package/src/kit/themes/base.css +11 -11
- package/src/kit/themes/clean-slate.css +155 -155
- package/src/kit/themes/default.css +192 -192
- package/src/kit/themes/minimal-modern.css +155 -155
- package/src/kit/themes/spotify.css +164 -164
- package/src/shadcn/hooks/use-mobile.ts +21 -21
- package/src/shadcn/lib/utils.ts +6 -6
- package/src/shadcn/ui/accordion.tsx +66 -66
- package/src/shadcn/ui/alert-dialog.tsx +157 -157
- package/src/shadcn/ui/alert.tsx +66 -66
- package/src/shadcn/ui/aspect-ratio.tsx +11 -11
- package/src/shadcn/ui/avatar.tsx +53 -53
- package/src/shadcn/ui/badge.tsx +46 -46
- package/src/shadcn/ui/breadcrumb.tsx +108 -108
- package/src/shadcn/ui/button.tsx +59 -59
- package/src/shadcn/ui/calendar.tsx +217 -217
- package/src/shadcn/ui/card.tsx +92 -92
- package/src/shadcn/ui/carousel.tsx +240 -240
- package/src/shadcn/ui/chart.tsx +353 -353
- package/src/shadcn/ui/checkbox.tsx +32 -32
- package/src/shadcn/ui/collapsible.tsx +33 -33
- package/src/shadcn/ui/command.tsx +184 -184
- package/src/shadcn/ui/context-menu.tsx +252 -252
- package/src/shadcn/ui/dialog.tsx +143 -143
- package/src/shadcn/ui/drawer.tsx +135 -135
- package/src/shadcn/ui/dropdown-menu.tsx +257 -257
- package/src/shadcn/ui/form.tsx +168 -168
- package/src/shadcn/ui/hover-card.tsx +44 -44
- package/src/shadcn/ui/input-otp.tsx +77 -77
- package/src/shadcn/ui/input.tsx +21 -21
- package/src/shadcn/ui/label.tsx +24 -24
- package/src/shadcn/ui/menubar.tsx +276 -276
- package/src/shadcn/ui/navigation-menu.tsx +168 -168
- package/src/shadcn/ui/pagination.tsx +127 -127
- package/src/shadcn/ui/popover.tsx +48 -48
- package/src/shadcn/ui/progress.tsx +31 -31
- package/src/shadcn/ui/radio-group.tsx +45 -45
- package/src/shadcn/ui/resizable.tsx +56 -56
- package/src/shadcn/ui/scroll-area.tsx +58 -58
- package/src/shadcn/ui/select.tsx +185 -185
- package/src/shadcn/ui/separator.tsx +28 -28
- package/src/shadcn/ui/sheet.tsx +139 -139
- package/src/shadcn/ui/sidebar.tsx +726 -726
- package/src/shadcn/ui/skeleton.tsx +13 -13
- package/src/shadcn/ui/slider.tsx +63 -63
- package/src/shadcn/ui/sonner.tsx +25 -25
- package/src/shadcn/ui/switch.tsx +31 -31
- package/src/shadcn/ui/table.tsx +116 -116
- package/src/shadcn/ui/tabs.tsx +66 -66
- package/src/shadcn/ui/textarea.tsx +18 -18
- package/src/shadcn/ui/toggle-group.tsx +73 -73
- package/src/shadcn/ui/toggle.tsx +47 -47
- package/src/shadcn/ui/tooltip.tsx +61 -61
- package/src/stories/FileUploader.stories.tsx +185 -185
- package/src/stories/kit/builder/DataTable.Basic.stories.tsx +71 -71
- package/src/stories/kit/builder/DataTable.Filters.stories.tsx +98 -98
- package/src/stories/kit/builder/DataTable.Pagination.stories.tsx +73 -73
- package/src/stories/kit/builder/DataTable.SelectionAndActions.stories.tsx +77 -77
- package/src/stories/kit/builder/DataTable.Sorting.stories.tsx +67 -67
- package/src/stories/kit/builder/Dialog.stories.tsx +90 -90
- package/src/stories/kit/builder/Form.ArrayLayouts.stories.tsx +177 -177
- package/src/stories/kit/builder/Form.Autocomplete.stories.tsx +220 -220
- package/src/stories/kit/builder/Form.Basic.stories.tsx +79 -79
- package/src/stories/kit/builder/Form.Complex.stories.tsx +569 -569
- package/src/stories/kit/builder/Form.DateTime.stories.tsx +70 -70
- package/src/stories/kit/builder/Form.Dynamic.stories.tsx +926 -926
- package/src/stories/kit/builder/Form.Files.stories.tsx +136 -136
- package/src/stories/kit/builder/Form.MultipleFormBuilder.stories.tsx +377 -377
- package/src/stories/kit/builder/Form.Pickers.stories.tsx +75 -75
- package/src/stories/kit/builder/Form.Simple.stories.tsx +91 -91
- package/src/stories/kit/builder/Form.Time.stories.tsx +68 -68
- package/src/stories/kit/builder/Page.stories.tsx +115 -115
- package/src/stories/kit/builder/Section.stories.tsx +282 -282
- package/src/stories/kit/components/Autocomplete.stories.tsx +313 -313
- package/src/stories/kit/components/DatePicker.stories.tsx +195 -195
- package/src/stories/kit/components/DateRangePicker.stories.tsx +195 -195
- package/src/stories/kit/components/Keyboard.stories.tsx +263 -263
- package/src/stories/kit/components/Login.stories.tsx +167 -167
- package/src/stories/kit/components/MonthPicker.stories.tsx +100 -100
- package/src/stories/kit/components/MonthRangePicker.stories.tsx +117 -117
- package/src/stories/kit/components/Numpad.stories.tsx +195 -195
- package/src/stories/kit/components/TimePicker.stories.tsx +71 -71
- package/src/stories/kit/components/TimeRangePicker.stories.tsx +43 -43
- package/src/stories/kit/layouts/admin/AdminLayout.Basic.stories.tsx +118 -118
- package/src/stories/kit/layouts/admin/AdminLayout.Collapsible.stories.tsx +81 -81
- package/src/stories/kit/layouts/admin/AdminLayout.Complex.stories.tsx +251 -251
- package/src/stories/kit/layouts/admin/AdminLayout.CustomSidebarHeaderComponent.stories.tsx +80 -80
- package/src/stories/kit/layouts/admin/AdminLayout.CustomSidebarTitleAndIcon.stories.tsx +70 -70
- package/src/stories/kit/layouts/admin/AdminLayout.HeaderSlots.stories.tsx +87 -87
- package/src/stories/shadcn/ui/Accordion.stories.tsx +117 -117
- package/src/stories/shadcn/ui/Alert.stories.tsx +36 -36
- package/src/stories/shadcn/ui/AlertDialog.stories.tsx +73 -73
- package/src/stories/shadcn/ui/AspectRatio.stories.tsx +58 -58
- package/src/stories/shadcn/ui/Avatar.stories.tsx +26 -26
- package/src/stories/shadcn/ui/Badge.stories.tsx +28 -28
- package/src/stories/shadcn/ui/Breadcrumb.stories.tsx +47 -47
- package/src/stories/shadcn/ui/Button.stories.tsx +51 -51
- package/src/stories/shadcn/ui/Calendar.stories.tsx +33 -33
- package/src/stories/shadcn/ui/Card.stories.tsx +39 -39
- package/src/stories/shadcn/ui/Carousel.stories.tsx +37 -37
- package/src/stories/shadcn/ui/Chart.stories.tsx +72 -72
- package/src/stories/shadcn/ui/Checkbox.stories.tsx +64 -64
- package/src/stories/shadcn/ui/Collapsible.stories.tsx +40 -40
- package/src/stories/shadcn/ui/Command.stories.tsx +53 -53
- package/src/stories/shadcn/ui/ContextMenu.stories.tsx +67 -67
- package/src/stories/shadcn/ui/Dialog.stories.tsx +45 -45
- package/src/stories/shadcn/ui/Drawer.stories.tsx +49 -49
- package/src/stories/shadcn/ui/DropdownMenu.stories.tsx +75 -75
- package/src/stories/shadcn/ui/Form.stories.tsx +93 -93
- package/src/stories/shadcn/ui/HoverCard.stories.tsx +43 -43
- package/src/stories/shadcn/ui/Input.stories.tsx +41 -41
- package/src/stories/shadcn/ui/InputOtp.stories.tsx +39 -39
- package/src/stories/shadcn/ui/Label.stories.tsx +29 -29
- package/src/stories/shadcn/ui/Menubar.stories.tsx +87 -87
- package/src/stories/shadcn/ui/NavigationMenu.stories.tsx +78 -78
- package/src/stories/shadcn/ui/Pagination.stories.tsx +51 -51
- package/src/stories/shadcn/ui/Popover.stories.tsx +53 -53
- package/src/stories/shadcn/ui/Progress.stories.tsx +30 -30
- package/src/stories/shadcn/ui/RadioGroup.stories.tsx +31 -31
- package/src/stories/shadcn/ui/Resizable.stories.tsx +55 -55
- package/src/stories/shadcn/ui/ScrollArea.stories.tsx +84 -84
- package/src/stories/shadcn/ui/Select.stories.tsx +61 -61
- package/src/stories/shadcn/ui/Separator.stories.tsx +35 -35
- package/src/stories/shadcn/ui/Sheet.stories.tsx +48 -48
- package/src/stories/shadcn/ui/Sidebar.stories.tsx +131 -131
- package/src/stories/shadcn/ui/Skeleton.stories.tsx +23 -23
- package/src/stories/shadcn/ui/Slider.stories.tsx +21 -21
- package/src/stories/shadcn/ui/Sonner.stories.tsx +49 -49
- package/src/stories/shadcn/ui/Switch.stories.tsx +28 -28
- package/src/stories/shadcn/ui/Table.stories.tsx +374 -374
- package/src/stories/shadcn/ui/Tabs.stories.tsx +31 -31
- package/src/stories/shadcn/ui/Textarea.stories.tsx +42 -42
- package/src/stories/shadcn/ui/Toggle.stories.tsx +44 -44
- package/src/stories/shadcn/ui/ToggleGroup.stories.tsx +28 -28
- package/src/stories/shadcn/ui/Tooltip.stories.tsx +30 -30
- package/tsconfig.json +20 -20
- package/tsconfig.lib.json +52 -52
- package/tsconfig.spec.json +38 -38
- package/vite.config.ts +93 -93
- package/storybook-static/assets/Accordion.stories-KU4JBR8U.js +0 -52
- package/storybook-static/assets/AdminLayout-CPvVCwfY.js +0 -53
- package/storybook-static/assets/AdminLayout.Basic.stories-DkP2UVXe.js +0 -4
- package/storybook-static/assets/AdminLayout.Collapsible.stories-BuuVjtpW.js +0 -4
- package/storybook-static/assets/AdminLayout.Complex.stories-D-k4H0hJ.js +0 -29
- package/storybook-static/assets/AdminLayout.CustomSidebarHeaderComponent.stories-B_0IEDd4.js +0 -9
- package/storybook-static/assets/AdminLayout.CustomSidebarTitleAndIcon.stories-CvAeXUyA.js +0 -4
- package/storybook-static/assets/AdminLayout.HeaderSlots.stories-RBFHoSZK.js +0 -7
- package/storybook-static/assets/Alert.stories-DKxKtIc0.js +0 -27
- package/storybook-static/assets/AlertDialog.stories-BqTpZ_nG.js +0 -43
- package/storybook-static/assets/AspectRatio.stories-DPO9QQ5F.js +0 -22
- package/storybook-static/assets/Autocomplete-Cpg4CaJe.js +0 -56
- package/storybook-static/assets/Autocomplete.stories-CWj4G5fh.js +0 -56
- package/storybook-static/assets/Avatar.stories-DPhov_2g.js +0 -12
- package/storybook-static/assets/Badge.stories-DFKrRdXq.js +0 -12
- package/storybook-static/assets/Breadcrumb.stories-CTE6CZUC.js +0 -25
- package/storybook-static/assets/Button.stories-cbt2InL-.js +0 -26
- package/storybook-static/assets/Calendar.stories-DRhTw_43.js +0 -3
- package/storybook-static/assets/Card.stories-Isf6n_K3.js +0 -15
- package/storybook-static/assets/Carousel.stories-Cmg0I3fR.js +0 -15
- package/storybook-static/assets/Chart.stories-aQ-fNijT.js +0 -126
- package/storybook-static/assets/Checkbox.stories-B7YMXPDc.js +0 -12
- package/storybook-static/assets/Collapsible.stories-BUzl17ZZ.js +0 -18
- package/storybook-static/assets/Combination-BdQWAuko.js +0 -41
- package/storybook-static/assets/Command.stories-DzBlWQs0.js +0 -30
- package/storybook-static/assets/ContextMenu.stories-CJlBQyXc.js +0 -31
- package/storybook-static/assets/DataTable.Basic.stories-BWYKFDmK.js +0 -6
- package/storybook-static/assets/DataTable.Filters.stories-uZdtJk8t.js +0 -21
- package/storybook-static/assets/DataTable.Pagination.stories-C5N1khkp.js +0 -24
- package/storybook-static/assets/DataTable.SelectionAndActions.stories-FhCqZKvO.js +0 -26
- package/storybook-static/assets/DataTable.Sorting.stories-D-k7EtRj.js +0 -6
- package/storybook-static/assets/Dialog.stories-C62AF-Gx.js +0 -54
- package/storybook-static/assets/Dialog.stories-lrjRwOus.js +0 -18
- package/storybook-static/assets/Drawer.stories-CGjkdJeV.js +0 -24
- package/storybook-static/assets/DropdownMenu.stories-DkGClRAA.js +0 -35
- package/storybook-static/assets/Form.ArrayLayouts.stories-C5d_062d.js +0 -130
- package/storybook-static/assets/Form.Autocomplete.stories-CPZPkk4o.js +0 -142
- package/storybook-static/assets/Form.Basic.stories-Bhcu3-3n.js +0 -58
- package/storybook-static/assets/Form.Complex.stories-QnXh5a7Q.js +0 -361
- package/storybook-static/assets/Form.Dynamic.stories-DFW6wIuT.js +0 -502
- package/storybook-static/assets/Form.Simple.stories-BhJcyhbE.js +0 -53
- package/storybook-static/assets/Form.stories-PFNsMYxO.js +0 -3
- package/storybook-static/assets/FormBuilder-BQBBxo_k.js +0 -5
- package/storybook-static/assets/HoverCard.stories-CAlQEVn8.js +0 -21
- package/storybook-static/assets/Input.stories-CEhODt0V.js +0 -16
- package/storybook-static/assets/InputOtp.stories-DSvNP4dS.js +0 -42
- package/storybook-static/assets/Label.stories-B3pa8ZLY.js +0 -14
- package/storybook-static/assets/Login.stories-C7KQkmR_.js +0 -37
- package/storybook-static/assets/Menubar.stories-CHXhSHxc.js +0 -44
- package/storybook-static/assets/MonthPicker.stories-BnrOc4fm.js +0 -99
- package/storybook-static/assets/MonthRangePicker.stories-55Gk1t-7.js +0 -134
- package/storybook-static/assets/NavigationMenu.stories-CXoS080P.js +0 -30
- package/storybook-static/assets/Page.stories-GdSJgZ6-.js +0 -91
- package/storybook-static/assets/Pagination.stories-BEBwqH4N.js +0 -29
- package/storybook-static/assets/Popover.stories-BICy98Cw.js +0 -15
- package/storybook-static/assets/Progress.stories-DECHNOME.js +0 -8
- package/storybook-static/assets/RadioGroup.stories-DA7-uKfV.js +0 -16
- package/storybook-static/assets/Resizable.stories-B99kWkH7.js +0 -25
- package/storybook-static/assets/ScrollArea.stories-BqvUAXqU.js +0 -12
- package/storybook-static/assets/Section.stories-lFMlFBQn.js +0 -277
- package/storybook-static/assets/SectionBuilder-BQW705x0.js +0 -1
- package/storybook-static/assets/Select.stories-BsKyZ6Io.js +0 -17
- package/storybook-static/assets/Separator.stories-BTDOaOM2.js +0 -17
- package/storybook-static/assets/Sheet.stories-Cam1gR6G.js +0 -24
- package/storybook-static/assets/Sidebar.stories-DnOa6G7y.js +0 -106
- package/storybook-static/assets/Skeleton.stories-BQNIuIe5.js +0 -9
- package/storybook-static/assets/Slider.stories-Bslq7hjq.js +0 -6
- package/storybook-static/assets/Sonner.stories-D34pBBtI.js +0 -18
- package/storybook-static/assets/Switch.stories-Puyb1-Bx.js +0 -3
- package/storybook-static/assets/Table.stories-ClZxAhut.js +0 -35
- package/storybook-static/assets/Tabs.stories-CURNTETB.js +0 -10
- package/storybook-static/assets/Textarea.stories-Cf1ZBrWw.js +0 -17
- package/storybook-static/assets/Toggle.stories-CdMHY_bi.js +0 -3
- package/storybook-static/assets/ToggleGroup.stories-BM68m1dX.js +0 -13
- package/storybook-static/assets/Tooltip.stories-DiQv64dM.js +0 -10
- package/storybook-static/assets/accordion-DVgwQcnw.js +0 -1
- package/storybook-static/assets/alert-dialog-DCUEwpqm.js +0 -7
- package/storybook-static/assets/avatar-BzwOE-mi.js +0 -1
- package/storybook-static/assets/axe-HmUsR1st.js +0 -30
- package/storybook-static/assets/badge-BnQWua6u.js +0 -1
- package/storybook-static/assets/button-0oMkiryo.js +0 -1
- package/storybook-static/assets/card-BJpPOzP8.js +0 -1
- package/storybook-static/assets/chart-column-DZGb4ZZS.js +0 -6
- package/storybook-static/assets/check-B9hBGj6o.js +0 -6
- package/storybook-static/assets/checkbox-CyIeaWHX.js +0 -1
- package/storybook-static/assets/chevron-down-D_37S6il.js +0 -6
- package/storybook-static/assets/chevron-left-BBoN0vbI.js +0 -6
- package/storybook-static/assets/chevron-right-B5vIMLxK.js +0 -6
- package/storybook-static/assets/circle-C5Lzx6Nx.js +0 -6
- package/storybook-static/assets/clean-slate-D1HmMFJM.css +0 -1
- package/storybook-static/assets/command-Csa9p8_a.js +0 -6
- package/storybook-static/assets/createLucideIcon-BrHXro7t.js +0 -21
- package/storybook-static/assets/default-CN_Fo1GY.css +0 -1
- package/storybook-static/assets/dependencies-ctrV69dx.js +0 -1
- package/storybook-static/assets/dialog-CsnqITTn.js +0 -1
- package/storybook-static/assets/dropdown-menu-BWxxwPHL.js +0 -1
- package/storybook-static/assets/ellipsis-BRS038RR.js +0 -6
- package/storybook-static/assets/grip-vertical-BxXG8KNA.js +0 -6
- package/storybook-static/assets/iframe-C9bogcIc.css +0 -1
- package/storybook-static/assets/iframe-v7iAhKit.js +0 -1555
- package/storybook-static/assets/index-0-qMRXou.js +0 -1
- package/storybook-static/assets/index-AvwFFKJc.js +0 -1
- package/storybook-static/assets/index-BVDb4dFc.js +0 -1
- package/storybook-static/assets/index-B_qx7A5T.js +0 -1
- package/storybook-static/assets/index-BdQq_4o_.js +0 -1
- package/storybook-static/assets/index-BfiCOk42.js +0 -1
- package/storybook-static/assets/index-Bv9yk470.js +0 -1
- package/storybook-static/assets/index-Bw1A27Kp.js +0 -1
- package/storybook-static/assets/index-ByqivBWx.js +0 -1
- package/storybook-static/assets/index-C9Ta0ZTH.js +0 -1
- package/storybook-static/assets/index-CDY5kTx5.js +0 -1
- package/storybook-static/assets/index-CGnyVRgB.js +0 -1
- package/storybook-static/assets/index-CGrAONsN.js +0 -1
- package/storybook-static/assets/index-CWjrGFAQ.js +0 -1
- package/storybook-static/assets/index-CwBdPBFz.js +0 -9
- package/storybook-static/assets/index-D8RXF03I.js +0 -1
- package/storybook-static/assets/index-DLIxT4Z7.js +0 -1
- package/storybook-static/assets/index-DW48STyt.js +0 -1
- package/storybook-static/assets/index-DbaA6-o1.js +0 -1
- package/storybook-static/assets/index-Dph_5COR.js +0 -1
- package/storybook-static/assets/index-DrN5n71E.js +0 -1
- package/storybook-static/assets/index-Tp9IdbR8.js +0 -1
- package/storybook-static/assets/index-WyF3-wTE.js +0 -9
- package/storybook-static/assets/index-XSmPROEP.js +0 -1
- package/storybook-static/assets/index-Z6wF44KX.js +0 -5
- package/storybook-static/assets/index-_RPqOjlQ.js +0 -1
- package/storybook-static/assets/index-jrimW4QO.js +0 -1
- package/storybook-static/assets/index-nqc17SX4.js +0 -1
- package/storybook-static/assets/input-11YRd9gD.js +0 -1
- package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +0 -9
- package/storybook-static/assets/label-Do8ODIVk.js +0 -1
- package/storybook-static/assets/lodash-DDwpuhPG.js +0 -73
- package/storybook-static/assets/matchers-7Z3WT2CE-T3xScrR7.js +0 -14
- package/storybook-static/assets/minimal-modern-BlYVzfQU.css +0 -1
- package/storybook-static/assets/popover-CcciSWAw.js +0 -1
- package/storybook-static/assets/preload-helper-Dp1pzeXC.js +0 -1
- package/storybook-static/assets/radio-group-DiJ0Y_KQ.js +0 -1
- package/storybook-static/assets/react-18-Cr9fq_Ip.js +0 -25
- package/storybook-static/assets/react-icons.esm-B_ULMmNU.js +0 -1
- package/storybook-static/assets/refresh-cw-BmRDhIV_.js +0 -6
- package/storybook-static/assets/schemas-CGNYCiJ6.js +0 -18
- package/storybook-static/assets/section-factories-DCCY9R35.js +0 -1
- package/storybook-static/assets/select-DDrkxaOg.js +0 -6
- package/storybook-static/assets/separator-o5SAUnaJ.js +0 -1
- package/storybook-static/assets/settings-2-xWGvvbG6.js +0 -6
- package/storybook-static/assets/sheet-C7jhU3XE.js +0 -1
- package/storybook-static/assets/shopping-cart-BFlrufvo.js +0 -11
- package/storybook-static/assets/sidebar-C8hU1Mxy.js +0 -6
- package/storybook-static/assets/skeleton-CjDnQs43.js +0 -1
- package/storybook-static/assets/spotify-CUDj7g8m.css +0 -1
- package/storybook-static/assets/switch-CKGRuk3u.js +0 -1
- package/storybook-static/assets/table-CP3vMqFn.js +0 -1
- package/storybook-static/assets/tabs-CopK2m3j.js +0 -1
- package/storybook-static/assets/textarea-Dw2vruMl.js +0 -1
- package/storybook-static/assets/toggle-DmHbWetf.js +0 -16
- package/storybook-static/assets/tooltip-_LqYEYFw.js +0 -1
- package/storybook-static/assets/trash-2-xdbApPby.js +0 -11
- package/storybook-static/assets/utils-D-KgF5mV.js +0 -1
- package/storybook-static/assets/x-B1a4fyWM.js +0 -6
- package/storybook-static/favicon-wrapper.svg +0 -46
- package/storybook-static/favicon.svg +0 -1
- package/storybook-static/iframe.html +0 -687
- package/storybook-static/index.d.ts +0 -64
- package/storybook-static/index.d.ts.map +0 -1
- package/storybook-static/index.html +0 -166
- package/storybook-static/index.json +0 -1
- package/storybook-static/kit/builder/data-table/components/DataTable.d.ts +0 -37
- package/storybook-static/kit/builder/data-table/components/DataTable.d.ts.map +0 -1
- package/storybook-static/kit/builder/data-table/components/DataTableColumnHeader.d.ts +0 -8
- package/storybook-static/kit/builder/data-table/components/DataTableColumnHeader.d.ts.map +0 -1
- package/storybook-static/kit/builder/data-table/components/DataTablePagination.d.ts +0 -6
- package/storybook-static/kit/builder/data-table/components/DataTablePagination.d.ts.map +0 -1
- package/storybook-static/kit/builder/data-table/components/DataTableViewOptions.d.ts +0 -5
- package/storybook-static/kit/builder/data-table/components/DataTableViewOptions.d.ts.map +0 -1
- package/storybook-static/kit/builder/data-table/index.d.ts +0 -7
- package/storybook-static/kit/builder/data-table/index.d.ts.map +0 -1
- package/storybook-static/kit/builder/data-table/types.d.ts +0 -27
- package/storybook-static/kit/builder/data-table/types.d.ts.map +0 -1
- package/storybook-static/kit/builder/data-table/utils/dotAccessor.d.ts +0 -2
- package/storybook-static/kit/builder/data-table/utils/dotAccessor.d.ts.map +0 -1
- package/storybook-static/kit/builder/dialog/index.d.ts +0 -3
- package/storybook-static/kit/builder/dialog/index.d.ts.map +0 -1
- package/storybook-static/kit/builder/dialog/provider.d.ts +0 -26
- package/storybook-static/kit/builder/dialog/provider.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/FormBuilder.d.ts +0 -137
- package/storybook-static/kit/builder/form/components/FormBuilder.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/FormBuilderActions.d.ts +0 -20
- package/storybook-static/kit/builder/form/components/FormBuilderActions.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/FormBuilderField.d.ts +0 -12
- package/storybook-static/kit/builder/form/components/FormBuilderField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/ArrayField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/ArrayField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/AutocompleteField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/AutocompleteField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/CheckboxField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/CheckboxField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/DateField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/DateField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/FileField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/FileField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/NumberField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/NumberField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/ObjectField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/ObjectField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/RadioField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/RadioField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/SelectField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/SelectField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/SwitchField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/SwitchField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/TextField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/TextField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/TextareaField.d.ts +0 -3
- package/storybook-static/kit/builder/form/components/fields/TextareaField.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/index.d.ts +0 -14
- package/storybook-static/kit/builder/form/components/fields/index.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/fields/types.d.ts +0 -14
- package/storybook-static/kit/builder/form/components/fields/types.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/components/index.d.ts +0 -4
- package/storybook-static/kit/builder/form/components/index.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/index.d.ts +0 -3
- package/storybook-static/kit/builder/form/index.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/utils/common-forms.d.ts +0 -7
- package/storybook-static/kit/builder/form/utils/common-forms.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/utils/dependencies.d.ts +0 -41
- package/storybook-static/kit/builder/form/utils/dependencies.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/utils/field-factories.d.ts +0 -23
- package/storybook-static/kit/builder/form/utils/field-factories.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/utils/index.d.ts +0 -15
- package/storybook-static/kit/builder/form/utils/index.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/utils/section-factories.d.ts +0 -7
- package/storybook-static/kit/builder/form/utils/section-factories.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/utils/transformers.d.ts +0 -6
- package/storybook-static/kit/builder/form/utils/transformers.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/utils/validations.d.ts +0 -13
- package/storybook-static/kit/builder/form/utils/validations.d.ts.map +0 -1
- package/storybook-static/kit/builder/form/utils/validators.d.ts +0 -8
- package/storybook-static/kit/builder/form/utils/validators.d.ts.map +0 -1
- package/storybook-static/kit/builder/page/Page.d.ts +0 -48
- package/storybook-static/kit/builder/page/Page.d.ts.map +0 -1
- package/storybook-static/kit/builder/page/index.d.ts +0 -2
- package/storybook-static/kit/builder/page/index.d.ts.map +0 -1
- package/storybook-static/kit/builder/section/SectionBuilder.d.ts +0 -3
- package/storybook-static/kit/builder/section/SectionBuilder.d.ts.map +0 -1
- package/storybook-static/kit/builder/section/index.d.ts +0 -3
- package/storybook-static/kit/builder/section/index.d.ts.map +0 -1
- package/storybook-static/kit/builder/section/types.d.ts +0 -70
- package/storybook-static/kit/builder/section/types.d.ts.map +0 -1
- package/storybook-static/kit/builder/stack-dialog/context.d.ts +0 -3
- package/storybook-static/kit/builder/stack-dialog/context.d.ts.map +0 -1
- package/storybook-static/kit/builder/stack-dialog/hooks.d.ts +0 -6
- package/storybook-static/kit/builder/stack-dialog/hooks.d.ts.map +0 -1
- package/storybook-static/kit/builder/stack-dialog/index.d.ts +0 -5
- package/storybook-static/kit/builder/stack-dialog/index.d.ts.map +0 -1
- package/storybook-static/kit/builder/stack-dialog/provider.d.ts +0 -3
- package/storybook-static/kit/builder/stack-dialog/provider.d.ts.map +0 -1
- package/storybook-static/kit/builder/stack-dialog/renderer.d.ts +0 -6
- package/storybook-static/kit/builder/stack-dialog/renderer.d.ts.map +0 -1
- package/storybook-static/kit/builder/stack-dialog/types.d.ts +0 -20
- package/storybook-static/kit/builder/stack-dialog/types.d.ts.map +0 -1
- package/storybook-static/kit/components/autocomplete/Autocomplete.d.ts +0 -53
- package/storybook-static/kit/components/autocomplete/Autocomplete.d.ts.map +0 -1
- package/storybook-static/kit/components/autocomplete/index.d.ts +0 -4
- package/storybook-static/kit/components/autocomplete/index.d.ts.map +0 -1
- package/storybook-static/kit/components/autocomplete/types.d.ts +0 -19
- package/storybook-static/kit/components/autocomplete/types.d.ts.map +0 -1
- package/storybook-static/kit/components/login/Login.d.ts +0 -29
- package/storybook-static/kit/components/login/Login.d.ts.map +0 -1
- package/storybook-static/kit/components/login/index.d.ts +0 -2
- package/storybook-static/kit/components/login/index.d.ts.map +0 -1
- package/storybook-static/kit/components/monthpicker/MonthPicker.d.ts +0 -32
- package/storybook-static/kit/components/monthpicker/MonthPicker.d.ts.map +0 -1
- package/storybook-static/kit/components/monthpicker/MonthRangePicker.d.ts +0 -48
- package/storybook-static/kit/components/monthpicker/MonthRangePicker.d.ts.map +0 -1
- package/storybook-static/kit/layouts/admin/components/AdminLayout.d.ts +0 -17
- package/storybook-static/kit/layouts/admin/components/AdminLayout.d.ts.map +0 -1
- package/storybook-static/kit/layouts/admin/components/ThemeToggle.d.ts +0 -5
- package/storybook-static/kit/layouts/admin/components/ThemeToggle.d.ts.map +0 -1
- package/storybook-static/kit/layouts/admin/hooks/menu.d.ts +0 -13
- package/storybook-static/kit/layouts/admin/hooks/menu.d.ts.map +0 -1
- package/storybook-static/kit/layouts/admin/providers/AdminMenuProvider.d.ts +0 -7
- package/storybook-static/kit/layouts/admin/providers/AdminMenuProvider.d.ts.map +0 -1
- package/storybook-static/kit/layouts/admin/types/index.d.ts +0 -27
- package/storybook-static/kit/layouts/admin/types/index.d.ts.map +0 -1
- package/storybook-static/kit/providers/ThemeProvider.d.ts +0 -14
- package/storybook-static/kit/providers/ThemeProvider.d.ts.map +0 -1
- 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 +0 -1
- package/storybook-static/sb-addons/a11y-5/manager-bundle.js +0 -5
- package/storybook-static/sb-addons/essentials-backgrounds-1/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-measure-2/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-outline-3/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/interactions-4/manager-bundle.js +0 -57
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -971
- package/storybook-static/sb-addons/storysource-6/manager-bundle.js +0 -3
- package/storybook-static/sb-common-assets/favicon-wrapper.svg +0 -46
- package/storybook-static/sb-common-assets/favicon.svg +0 -1
- 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 +0 -797
- package/storybook-static/sb-manager/globals-runtime.js +0 -69653
- package/storybook-static/sb-manager/globals.js +0 -34
- package/storybook-static/sb-manager/runtime.js +0 -13181
- package/storybook-static/shadcn/hooks/use-mobile.d.ts +0 -2
- package/storybook-static/shadcn/hooks/use-mobile.d.ts.map +0 -1
- package/storybook-static/shadcn/lib/utils.d.ts +0 -3
- package/storybook-static/shadcn/lib/utils.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/accordion.d.ts +0 -8
- package/storybook-static/shadcn/ui/accordion.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/alert-dialog.d.ts +0 -15
- package/storybook-static/shadcn/ui/alert-dialog.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/alert.d.ts +0 -10
- package/storybook-static/shadcn/ui/alert.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/aspect-ratio.d.ts +0 -4
- package/storybook-static/shadcn/ui/aspect-ratio.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/avatar.d.ts +0 -7
- package/storybook-static/shadcn/ui/avatar.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/badge.d.ts +0 -10
- package/storybook-static/shadcn/ui/badge.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/breadcrumb.d.ts +0 -12
- package/storybook-static/shadcn/ui/breadcrumb.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/button.d.ts +0 -11
- package/storybook-static/shadcn/ui/button.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/calendar.d.ts +0 -9
- package/storybook-static/shadcn/ui/calendar.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/card.d.ts +0 -10
- package/storybook-static/shadcn/ui/card.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/carousel.d.ts +0 -20
- package/storybook-static/shadcn/ui/carousel.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/chart.d.ts +0 -41
- package/storybook-static/shadcn/ui/chart.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/checkbox.d.ts +0 -5
- package/storybook-static/shadcn/ui/checkbox.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/collapsible.d.ts +0 -6
- package/storybook-static/shadcn/ui/collapsible.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/command.d.ts +0 -19
- package/storybook-static/shadcn/ui/command.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/context-menu.d.ts +0 -26
- package/storybook-static/shadcn/ui/context-menu.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/dialog.d.ts +0 -16
- package/storybook-static/shadcn/ui/dialog.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/drawer.d.ts +0 -14
- package/storybook-static/shadcn/ui/drawer.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/dropdown-menu.d.ts +0 -26
- package/storybook-static/shadcn/ui/dropdown-menu.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/form.d.ts +0 -25
- package/storybook-static/shadcn/ui/form.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/hover-card.d.ts +0 -7
- package/storybook-static/shadcn/ui/hover-card.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/input-otp.d.ts +0 -12
- package/storybook-static/shadcn/ui/input-otp.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/input.d.ts +0 -4
- package/storybook-static/shadcn/ui/input.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/label.d.ts +0 -5
- package/storybook-static/shadcn/ui/label.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/menubar.d.ts +0 -27
- package/storybook-static/shadcn/ui/menubar.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/navigation-menu.d.ts +0 -15
- package/storybook-static/shadcn/ui/navigation-menu.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/pagination.d.ts +0 -14
- package/storybook-static/shadcn/ui/pagination.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/popover.d.ts +0 -8
- package/storybook-static/shadcn/ui/popover.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/progress.d.ts +0 -5
- package/storybook-static/shadcn/ui/progress.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/radio-group.d.ts +0 -6
- package/storybook-static/shadcn/ui/radio-group.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/resizable.d.ts +0 -9
- package/storybook-static/shadcn/ui/resizable.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/scroll-area.d.ts +0 -6
- package/storybook-static/shadcn/ui/scroll-area.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/select.d.ts +0 -16
- package/storybook-static/shadcn/ui/select.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/separator.d.ts +0 -5
- package/storybook-static/shadcn/ui/separator.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/sheet.d.ts +0 -14
- package/storybook-static/shadcn/ui/sheet.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/sidebar.d.ts +0 -70
- package/storybook-static/shadcn/ui/sidebar.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/skeleton.d.ts +0 -3
- package/storybook-static/shadcn/ui/skeleton.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/slider.d.ts +0 -5
- package/storybook-static/shadcn/ui/slider.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/sonner.d.ts +0 -4
- package/storybook-static/shadcn/ui/sonner.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/switch.d.ts +0 -5
- package/storybook-static/shadcn/ui/switch.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/table.d.ts +0 -11
- package/storybook-static/shadcn/ui/table.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/tabs.d.ts +0 -8
- package/storybook-static/shadcn/ui/tabs.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/textarea.d.ts +0 -4
- package/storybook-static/shadcn/ui/textarea.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/toggle-group.d.ts +0 -8
- package/storybook-static/shadcn/ui/toggle-group.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/toggle.d.ts +0 -10
- package/storybook-static/shadcn/ui/toggle.d.ts.map +0 -1
- package/storybook-static/shadcn/ui/tooltip.d.ts +0 -8
- package/storybook-static/shadcn/ui/tooltip.d.ts.map +0 -1
- package/storybook-static/vite-inject-mocker-entry.js +0 -18
|
@@ -1,926 +1,926 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { FormBuilder } from '../../../kit/builder/form/components/FormBuilder';
|
|
3
|
-
import type { FormBuilderSectionConfig } from '../../../kit/builder/form/components/FormBuilder';
|
|
4
|
-
import {
|
|
5
|
-
createSection,
|
|
6
|
-
createField,
|
|
7
|
-
createDependency,
|
|
8
|
-
conditions,
|
|
9
|
-
} from '../../../kit/builder/form/utils';
|
|
10
|
-
|
|
11
|
-
const meta: Meta<typeof FormBuilder> = {
|
|
12
|
-
title: 'Kit/Builder/Form',
|
|
13
|
-
component: FormBuilder,
|
|
14
|
-
parameters: {
|
|
15
|
-
controls: { expanded: true },
|
|
16
|
-
backgrounds: { disable: true },
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const DynamicTabsExample: Story = {
|
|
21
|
-
name: 'Dynamic example (Tabs)',
|
|
22
|
-
render: () => {
|
|
23
|
-
const handleSubmit = (data: unknown) => {
|
|
24
|
-
console.log('Dynamic tabs form submitted:', data);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const handleFieldChange = (name: string, value: unknown) => {
|
|
28
|
-
console.log(`[Tabs] Field ${name} changed to:`, value);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const sections: FormBuilderSectionConfig[] = [
|
|
32
|
-
{
|
|
33
|
-
title: 'Product Builder',
|
|
34
|
-
layout: 'tabs',
|
|
35
|
-
variant: 'card',
|
|
36
|
-
defaultTabId: 'product',
|
|
37
|
-
tabsListClassName: 'w-full',
|
|
38
|
-
tabsContentClassName: 'mt-2',
|
|
39
|
-
tabs: [
|
|
40
|
-
{
|
|
41
|
-
id: 'product',
|
|
42
|
-
label: 'Product',
|
|
43
|
-
sections: [
|
|
44
|
-
createSection.card('Product Configuration', [
|
|
45
|
-
createField.select(
|
|
46
|
-
'productType',
|
|
47
|
-
'Product Type',
|
|
48
|
-
[
|
|
49
|
-
{ label: 'One-time Purchase', value: 'onetime' },
|
|
50
|
-
{ label: 'Subscription', value: 'subscription' },
|
|
51
|
-
{ label: 'Bundle', value: 'bundle' },
|
|
52
|
-
{ label: 'Digital Download', value: 'digital' },
|
|
53
|
-
],
|
|
54
|
-
{ required: true, placeholder: 'Select product type' },
|
|
55
|
-
),
|
|
56
|
-
createField.text('productName', 'Product Name', {
|
|
57
|
-
required: true,
|
|
58
|
-
placeholder: 'Enter product name',
|
|
59
|
-
}),
|
|
60
|
-
createField.number('basePrice', 'Base Price ($)', {
|
|
61
|
-
required: true,
|
|
62
|
-
placeholder: '29.99',
|
|
63
|
-
}),
|
|
64
|
-
createField.select(
|
|
65
|
-
'billingCycle',
|
|
66
|
-
'Billing Cycle',
|
|
67
|
-
[
|
|
68
|
-
{ label: 'Monthly', value: 'monthly' },
|
|
69
|
-
{ label: 'Quarterly', value: 'quarterly' },
|
|
70
|
-
{ label: 'Yearly', value: 'yearly' },
|
|
71
|
-
],
|
|
72
|
-
{
|
|
73
|
-
required: true,
|
|
74
|
-
placeholder: 'Select billing cycle',
|
|
75
|
-
dependencies: [
|
|
76
|
-
createDependency.showWhen(
|
|
77
|
-
'productType',
|
|
78
|
-
conditions.equals('subscription'),
|
|
79
|
-
),
|
|
80
|
-
],
|
|
81
|
-
},
|
|
82
|
-
),
|
|
83
|
-
createField.number('trialDays', 'Free Trial Days', {
|
|
84
|
-
placeholder: '14',
|
|
85
|
-
defaultValue: 0,
|
|
86
|
-
dependencies: [
|
|
87
|
-
createDependency.showWhen(
|
|
88
|
-
'productType',
|
|
89
|
-
conditions.equals('subscription'),
|
|
90
|
-
),
|
|
91
|
-
],
|
|
92
|
-
}),
|
|
93
|
-
createField.array(
|
|
94
|
-
'bundleItems',
|
|
95
|
-
'Bundle Items',
|
|
96
|
-
[
|
|
97
|
-
createField.text('itemName', 'Item Name', {
|
|
98
|
-
required: true,
|
|
99
|
-
placeholder: 'Item name',
|
|
100
|
-
}),
|
|
101
|
-
createField.number('itemPrice', 'Item Price ($)', {
|
|
102
|
-
required: true,
|
|
103
|
-
placeholder: '9.99',
|
|
104
|
-
}),
|
|
105
|
-
createField.number('quantity', 'Quantity', {
|
|
106
|
-
required: true,
|
|
107
|
-
defaultValue: 1,
|
|
108
|
-
placeholder: '1',
|
|
109
|
-
}),
|
|
110
|
-
],
|
|
111
|
-
{
|
|
112
|
-
gridCols: 2,
|
|
113
|
-
defaultValue: [{ itemName: '', itemPrice: 0, quantity: 1 }],
|
|
114
|
-
dependencies: [
|
|
115
|
-
createDependency.showWhen(
|
|
116
|
-
'productType',
|
|
117
|
-
conditions.equals('bundle'),
|
|
118
|
-
),
|
|
119
|
-
],
|
|
120
|
-
},
|
|
121
|
-
),
|
|
122
|
-
createField.select(
|
|
123
|
-
'fileFormat',
|
|
124
|
-
'File Format',
|
|
125
|
-
[
|
|
126
|
-
{ label: 'PDF', value: 'pdf' },
|
|
127
|
-
{ label: 'ZIP Archive', value: 'zip' },
|
|
128
|
-
{ label: 'Video (MP4)', value: 'mp4' },
|
|
129
|
-
{ label: 'Audio (MP3)', value: 'mp3' },
|
|
130
|
-
{ label: 'Software Installer', value: 'exe' },
|
|
131
|
-
],
|
|
132
|
-
{
|
|
133
|
-
required: true,
|
|
134
|
-
placeholder: 'Select file format',
|
|
135
|
-
dependencies: [
|
|
136
|
-
createDependency.showWhen(
|
|
137
|
-
'productType',
|
|
138
|
-
conditions.equals('digital'),
|
|
139
|
-
),
|
|
140
|
-
],
|
|
141
|
-
},
|
|
142
|
-
),
|
|
143
|
-
createField.number('fileSizeMB', 'File Size (MB)', {
|
|
144
|
-
placeholder: '50',
|
|
145
|
-
dependencies: [
|
|
146
|
-
createDependency.showWhen(
|
|
147
|
-
'productType',
|
|
148
|
-
conditions.equals('digital'),
|
|
149
|
-
),
|
|
150
|
-
],
|
|
151
|
-
}),
|
|
152
|
-
]),
|
|
153
|
-
],
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
id: 'pricing',
|
|
157
|
-
label: 'Pricing',
|
|
158
|
-
sections: [
|
|
159
|
-
createSection.card('Pricing & Discounts', [
|
|
160
|
-
createField.checkbox('hasDiscount', 'Apply Discount', {
|
|
161
|
-
defaultValue: false,
|
|
162
|
-
gridCols: 2,
|
|
163
|
-
}),
|
|
164
|
-
createField.select(
|
|
165
|
-
'discountType',
|
|
166
|
-
'Discount Type',
|
|
167
|
-
[
|
|
168
|
-
{ label: 'Percentage', value: 'percentage' },
|
|
169
|
-
{ label: 'Fixed Amount', value: 'fixed' },
|
|
170
|
-
{ label: 'Buy One Get One', value: 'bogo' },
|
|
171
|
-
],
|
|
172
|
-
{
|
|
173
|
-
required: true,
|
|
174
|
-
placeholder: 'Select discount type',
|
|
175
|
-
dependencies: [
|
|
176
|
-
createDependency.showWhen(
|
|
177
|
-
'hasDiscount',
|
|
178
|
-
conditions.isTrue(),
|
|
179
|
-
),
|
|
180
|
-
],
|
|
181
|
-
},
|
|
182
|
-
),
|
|
183
|
-
createField.number('discountValue', 'Discount Value', {
|
|
184
|
-
required: true,
|
|
185
|
-
placeholder: '10',
|
|
186
|
-
dependencies: [
|
|
187
|
-
createDependency.showWhen(
|
|
188
|
-
'hasDiscount',
|
|
189
|
-
conditions.isTrue(),
|
|
190
|
-
),
|
|
191
|
-
createDependency.showWhen(
|
|
192
|
-
'discountType',
|
|
193
|
-
(value) => value !== 'bogo',
|
|
194
|
-
),
|
|
195
|
-
],
|
|
196
|
-
}),
|
|
197
|
-
createField.date('discountStartDate', 'Discount Start Date', {
|
|
198
|
-
dependencies: [
|
|
199
|
-
createDependency.showWhen(
|
|
200
|
-
'hasDiscount',
|
|
201
|
-
conditions.isTrue(),
|
|
202
|
-
),
|
|
203
|
-
],
|
|
204
|
-
}),
|
|
205
|
-
createField.date('discountEndDate', 'Discount End Date', {
|
|
206
|
-
dependencies: [
|
|
207
|
-
createDependency.showWhen(
|
|
208
|
-
'hasDiscount',
|
|
209
|
-
conditions.isTrue(),
|
|
210
|
-
),
|
|
211
|
-
],
|
|
212
|
-
}),
|
|
213
|
-
createField.number(
|
|
214
|
-
'minimumQuantity',
|
|
215
|
-
'Minimum Quantity for Discount',
|
|
216
|
-
{
|
|
217
|
-
placeholder: '2',
|
|
218
|
-
defaultValue: 1,
|
|
219
|
-
dependencies: [
|
|
220
|
-
createDependency.showWhen(
|
|
221
|
-
'hasDiscount',
|
|
222
|
-
conditions.isTrue(),
|
|
223
|
-
),
|
|
224
|
-
],
|
|
225
|
-
},
|
|
226
|
-
),
|
|
227
|
-
]),
|
|
228
|
-
],
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
id: 'shipping',
|
|
232
|
-
label: 'Shipping',
|
|
233
|
-
sections: [
|
|
234
|
-
createSection.card('Shipping Configuration', [
|
|
235
|
-
createField.checkbox(
|
|
236
|
-
'requiresShipping',
|
|
237
|
-
'Requires Physical Shipping',
|
|
238
|
-
{
|
|
239
|
-
defaultValue: true,
|
|
240
|
-
gridCols: 2,
|
|
241
|
-
dependencies: [
|
|
242
|
-
createDependency.setValueWhen(
|
|
243
|
-
'productType',
|
|
244
|
-
conditions.equals('digital'),
|
|
245
|
-
false,
|
|
246
|
-
),
|
|
247
|
-
createDependency.disableWhen(
|
|
248
|
-
'productType',
|
|
249
|
-
conditions.equals('digital'),
|
|
250
|
-
),
|
|
251
|
-
],
|
|
252
|
-
},
|
|
253
|
-
),
|
|
254
|
-
createField.number('weight', 'Weight (lbs)', {
|
|
255
|
-
placeholder: '1.5',
|
|
256
|
-
dependencies: [
|
|
257
|
-
createDependency.showWhen(
|
|
258
|
-
'requiresShipping',
|
|
259
|
-
conditions.isTrue(),
|
|
260
|
-
),
|
|
261
|
-
],
|
|
262
|
-
}),
|
|
263
|
-
createField.object(
|
|
264
|
-
'dimensions',
|
|
265
|
-
'Dimensions (inches)',
|
|
266
|
-
[
|
|
267
|
-
createField.number('length', 'Length', {
|
|
268
|
-
required: true,
|
|
269
|
-
placeholder: '10',
|
|
270
|
-
}),
|
|
271
|
-
createField.number('width', 'Width', {
|
|
272
|
-
required: true,
|
|
273
|
-
placeholder: '8',
|
|
274
|
-
}),
|
|
275
|
-
createField.number('height', 'Height', {
|
|
276
|
-
required: true,
|
|
277
|
-
placeholder: '2',
|
|
278
|
-
}),
|
|
279
|
-
],
|
|
280
|
-
{
|
|
281
|
-
dependencies: [
|
|
282
|
-
createDependency.showWhen(
|
|
283
|
-
'requiresShipping',
|
|
284
|
-
conditions.isTrue(),
|
|
285
|
-
),
|
|
286
|
-
],
|
|
287
|
-
},
|
|
288
|
-
),
|
|
289
|
-
createField.select(
|
|
290
|
-
'shippingClass',
|
|
291
|
-
'Shipping Class',
|
|
292
|
-
[
|
|
293
|
-
{ label: 'Standard', value: 'standard' },
|
|
294
|
-
{ label: 'Express', value: 'express' },
|
|
295
|
-
{ label: 'Overnight', value: 'overnight' },
|
|
296
|
-
{ label: 'Fragile', value: 'fragile' },
|
|
297
|
-
{ label: 'Hazardous', value: 'hazardous' },
|
|
298
|
-
],
|
|
299
|
-
{
|
|
300
|
-
required: true,
|
|
301
|
-
defaultValue: 'standard',
|
|
302
|
-
placeholder: 'Select shipping class',
|
|
303
|
-
dependencies: [
|
|
304
|
-
createDependency.showWhen(
|
|
305
|
-
'requiresShipping',
|
|
306
|
-
conditions.isTrue(),
|
|
307
|
-
),
|
|
308
|
-
],
|
|
309
|
-
},
|
|
310
|
-
),
|
|
311
|
-
createField.checkbox('freeShipping', 'Offer Free Shipping', {
|
|
312
|
-
defaultValue: false,
|
|
313
|
-
dependencies: [
|
|
314
|
-
createDependency.showWhen(
|
|
315
|
-
'requiresShipping',
|
|
316
|
-
conditions.isTrue(),
|
|
317
|
-
),
|
|
318
|
-
],
|
|
319
|
-
}),
|
|
320
|
-
createField.number(
|
|
321
|
-
'freeShippingThreshold',
|
|
322
|
-
'Free Shipping Threshold ($)',
|
|
323
|
-
{
|
|
324
|
-
placeholder: '50',
|
|
325
|
-
dependencies: [
|
|
326
|
-
createDependency.showWhen(
|
|
327
|
-
'requiresShipping',
|
|
328
|
-
conditions.isTrue(),
|
|
329
|
-
),
|
|
330
|
-
createDependency.showWhen(
|
|
331
|
-
'freeShipping',
|
|
332
|
-
conditions.isTrue(),
|
|
333
|
-
),
|
|
334
|
-
],
|
|
335
|
-
},
|
|
336
|
-
),
|
|
337
|
-
]),
|
|
338
|
-
],
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
id: 'inventory',
|
|
342
|
-
label: 'Inventory',
|
|
343
|
-
sections: [
|
|
344
|
-
createSection.card('Inventory Management', [
|
|
345
|
-
createField.checkbox('trackInventory', 'Track Inventory', {
|
|
346
|
-
defaultValue: true,
|
|
347
|
-
gridCols: 2,
|
|
348
|
-
dependencies: [
|
|
349
|
-
createDependency.setValueWhen(
|
|
350
|
-
'productType',
|
|
351
|
-
conditions.equals('digital'),
|
|
352
|
-
false,
|
|
353
|
-
),
|
|
354
|
-
],
|
|
355
|
-
}),
|
|
356
|
-
createField.number('stockQuantity', 'Stock Quantity', {
|
|
357
|
-
required: true,
|
|
358
|
-
placeholder: '100',
|
|
359
|
-
dependencies: [
|
|
360
|
-
createDependency.showWhen(
|
|
361
|
-
'trackInventory',
|
|
362
|
-
conditions.isTrue(),
|
|
363
|
-
),
|
|
364
|
-
],
|
|
365
|
-
}),
|
|
366
|
-
createField.number(
|
|
367
|
-
'lowStockThreshold',
|
|
368
|
-
'Low Stock Alert Threshold',
|
|
369
|
-
{
|
|
370
|
-
placeholder: '10',
|
|
371
|
-
dependencies: [
|
|
372
|
-
createDependency.showWhen(
|
|
373
|
-
'trackInventory',
|
|
374
|
-
conditions.isTrue(),
|
|
375
|
-
),
|
|
376
|
-
],
|
|
377
|
-
},
|
|
378
|
-
),
|
|
379
|
-
createField.checkbox('allowBackorders', 'Allow Backorders', {
|
|
380
|
-
defaultValue: false,
|
|
381
|
-
dependencies: [
|
|
382
|
-
createDependency.showWhen(
|
|
383
|
-
'trackInventory',
|
|
384
|
-
conditions.isTrue(),
|
|
385
|
-
),
|
|
386
|
-
],
|
|
387
|
-
}),
|
|
388
|
-
createField.text('sku', 'SKU (Stock Keeping Unit)', {
|
|
389
|
-
placeholder: 'PROD-001',
|
|
390
|
-
dependencies: [
|
|
391
|
-
createDependency.showWhen(
|
|
392
|
-
'trackInventory',
|
|
393
|
-
conditions.isTrue(),
|
|
394
|
-
),
|
|
395
|
-
],
|
|
396
|
-
}),
|
|
397
|
-
createField.text('barcode', 'Barcode', {
|
|
398
|
-
placeholder: '123456789012',
|
|
399
|
-
dependencies: [
|
|
400
|
-
createDependency.showWhen(
|
|
401
|
-
'trackInventory',
|
|
402
|
-
conditions.isTrue(),
|
|
403
|
-
),
|
|
404
|
-
],
|
|
405
|
-
}),
|
|
406
|
-
]),
|
|
407
|
-
],
|
|
408
|
-
},
|
|
409
|
-
{
|
|
410
|
-
id: 'marketing',
|
|
411
|
-
label: 'Marketing',
|
|
412
|
-
sections: [
|
|
413
|
-
createSection.card('Marketing & SEO', [
|
|
414
|
-
createField.text('metaTitle', 'Meta Title', {
|
|
415
|
-
placeholder: 'SEO-friendly title',
|
|
416
|
-
gridCols: 2,
|
|
417
|
-
}),
|
|
418
|
-
createField.textarea('metaDescription', 'Meta Description', {
|
|
419
|
-
placeholder: 'SEO-friendly description (150-160 characters)',
|
|
420
|
-
gridCols: 2,
|
|
421
|
-
}),
|
|
422
|
-
createField.array(
|
|
423
|
-
'tags',
|
|
424
|
-
'Product Tags',
|
|
425
|
-
[
|
|
426
|
-
createField.text('tag', 'Tag', {
|
|
427
|
-
required: true,
|
|
428
|
-
placeholder: 'e.g., electronics, gadgets',
|
|
429
|
-
}),
|
|
430
|
-
],
|
|
431
|
-
{ gridCols: 2, defaultValue: [{ tag: '' }] },
|
|
432
|
-
),
|
|
433
|
-
createField.checkbox('featured', 'Featured Product', {
|
|
434
|
-
defaultValue: false,
|
|
435
|
-
}),
|
|
436
|
-
createField.checkbox('newProduct', 'Mark as New', {
|
|
437
|
-
defaultValue: false,
|
|
438
|
-
}),
|
|
439
|
-
createField.select(
|
|
440
|
-
'visibility',
|
|
441
|
-
'Product Visibility',
|
|
442
|
-
[
|
|
443
|
-
{ label: 'Public', value: 'public' },
|
|
444
|
-
{ label: 'Private', value: 'private' },
|
|
445
|
-
{ label: 'Password Protected', value: 'password' },
|
|
446
|
-
{ label: 'Coming Soon', value: 'coming_soon' },
|
|
447
|
-
],
|
|
448
|
-
{
|
|
449
|
-
required: true,
|
|
450
|
-
defaultValue: 'public',
|
|
451
|
-
placeholder: 'Select visibility',
|
|
452
|
-
},
|
|
453
|
-
),
|
|
454
|
-
createField.text('password', 'Access Password', {
|
|
455
|
-
placeholder: 'Enter password',
|
|
456
|
-
dependencies: [
|
|
457
|
-
createDependency.showWhen(
|
|
458
|
-
'visibility',
|
|
459
|
-
conditions.equals('password'),
|
|
460
|
-
),
|
|
461
|
-
],
|
|
462
|
-
}),
|
|
463
|
-
createField.date('launchDate', 'Launch Date', {
|
|
464
|
-
dependencies: [
|
|
465
|
-
createDependency.showWhen(
|
|
466
|
-
'visibility',
|
|
467
|
-
conditions.equals('coming_soon'),
|
|
468
|
-
),
|
|
469
|
-
],
|
|
470
|
-
}),
|
|
471
|
-
]),
|
|
472
|
-
],
|
|
473
|
-
},
|
|
474
|
-
],
|
|
475
|
-
},
|
|
476
|
-
];
|
|
477
|
-
|
|
478
|
-
return (
|
|
479
|
-
<div className="max-w-6xl mx-auto p-6">
|
|
480
|
-
<div className="mb-8">
|
|
481
|
-
<h1 className="text-3xl font-bold text-gray-900">
|
|
482
|
-
Dynamic Product Configuration (Tabs)
|
|
483
|
-
</h1>
|
|
484
|
-
<p className="text-gray-600 mt-2">
|
|
485
|
-
The same dynamic form organized into tabs for better navigation.
|
|
486
|
-
</p>
|
|
487
|
-
</div>
|
|
488
|
-
<FormBuilder
|
|
489
|
-
sections={sections}
|
|
490
|
-
onSubmit={handleSubmit}
|
|
491
|
-
onFieldChange={handleFieldChange}
|
|
492
|
-
submitLabel="Save Product Configuration"
|
|
493
|
-
resetLabel="Reset All"
|
|
494
|
-
className="space-y-8"
|
|
495
|
-
/>
|
|
496
|
-
</div>
|
|
497
|
-
);
|
|
498
|
-
},
|
|
499
|
-
};
|
|
500
|
-
|
|
501
|
-
export default meta;
|
|
502
|
-
|
|
503
|
-
type Story = StoryObj<typeof FormBuilder>;
|
|
504
|
-
|
|
505
|
-
export const DynamicExample: Story = {
|
|
506
|
-
name: 'Dynamic example',
|
|
507
|
-
render: () => {
|
|
508
|
-
const handleSubmit = (data: unknown) => {
|
|
509
|
-
console.log('Dynamic form submitted:', data);
|
|
510
|
-
};
|
|
511
|
-
|
|
512
|
-
const handleFieldChange = (name: string, value: unknown) => {
|
|
513
|
-
console.log(`Field ${name} changed to:`, value);
|
|
514
|
-
if (name === 'productType' && value === 'subscription') {
|
|
515
|
-
console.log(
|
|
516
|
-
'Subscription product selected - additional fields will appear',
|
|
517
|
-
);
|
|
518
|
-
}
|
|
519
|
-
if (name === 'hasDiscount' && value === true) {
|
|
520
|
-
console.log('Discount enabled - discount fields will appear');
|
|
521
|
-
}
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
const sections = [
|
|
525
|
-
createSection.card('Product Configuration', [
|
|
526
|
-
createField.select(
|
|
527
|
-
'productType',
|
|
528
|
-
'Product Type',
|
|
529
|
-
[
|
|
530
|
-
{ label: 'One-time Purchase', value: 'onetime' },
|
|
531
|
-
{ label: 'Subscription', value: 'subscription' },
|
|
532
|
-
{ label: 'Bundle', value: 'bundle' },
|
|
533
|
-
{ label: 'Digital Download', value: 'digital' },
|
|
534
|
-
],
|
|
535
|
-
{ required: true, placeholder: 'Select product type' },
|
|
536
|
-
),
|
|
537
|
-
createField.text('productName', 'Product Name', {
|
|
538
|
-
required: true,
|
|
539
|
-
placeholder: 'Enter product name',
|
|
540
|
-
}),
|
|
541
|
-
createField.number('basePrice', 'Base Price ($)', {
|
|
542
|
-
required: true,
|
|
543
|
-
placeholder: '29.99',
|
|
544
|
-
}),
|
|
545
|
-
createField.select(
|
|
546
|
-
'billingCycle',
|
|
547
|
-
'Billing Cycle',
|
|
548
|
-
[
|
|
549
|
-
{ label: 'Monthly', value: 'monthly' },
|
|
550
|
-
{ label: 'Quarterly', value: 'quarterly' },
|
|
551
|
-
{ label: 'Yearly', value: 'yearly' },
|
|
552
|
-
],
|
|
553
|
-
{
|
|
554
|
-
required: true,
|
|
555
|
-
placeholder: 'Select billing cycle',
|
|
556
|
-
dependencies: [
|
|
557
|
-
createDependency.showWhen(
|
|
558
|
-
'productType',
|
|
559
|
-
conditions.equals('subscription'),
|
|
560
|
-
),
|
|
561
|
-
],
|
|
562
|
-
},
|
|
563
|
-
),
|
|
564
|
-
createField.number('trialDays', 'Free Trial Days', {
|
|
565
|
-
placeholder: '14',
|
|
566
|
-
defaultValue: 0,
|
|
567
|
-
dependencies: [
|
|
568
|
-
createDependency.showWhen(
|
|
569
|
-
'productType',
|
|
570
|
-
conditions.equals('subscription'),
|
|
571
|
-
),
|
|
572
|
-
],
|
|
573
|
-
}),
|
|
574
|
-
createField.array(
|
|
575
|
-
'bundleItems',
|
|
576
|
-
'Bundle Items',
|
|
577
|
-
[
|
|
578
|
-
createField.text('itemName', 'Item Name', {
|
|
579
|
-
required: true,
|
|
580
|
-
placeholder: 'Item name',
|
|
581
|
-
}),
|
|
582
|
-
createField.number('itemPrice', 'Item Price ($)', {
|
|
583
|
-
required: true,
|
|
584
|
-
placeholder: '9.99',
|
|
585
|
-
}),
|
|
586
|
-
createField.number('quantity', 'Quantity', {
|
|
587
|
-
required: true,
|
|
588
|
-
defaultValue: 1,
|
|
589
|
-
placeholder: '1',
|
|
590
|
-
}),
|
|
591
|
-
],
|
|
592
|
-
{
|
|
593
|
-
gridCols: 2,
|
|
594
|
-
defaultValue: [{ itemName: '', itemPrice: 0, quantity: 1 }],
|
|
595
|
-
dependencies: [
|
|
596
|
-
createDependency.showWhen(
|
|
597
|
-
'productType',
|
|
598
|
-
conditions.equals('bundle'),
|
|
599
|
-
),
|
|
600
|
-
],
|
|
601
|
-
},
|
|
602
|
-
),
|
|
603
|
-
createField.select(
|
|
604
|
-
'fileFormat',
|
|
605
|
-
'File Format',
|
|
606
|
-
[
|
|
607
|
-
{ label: 'PDF', value: 'pdf' },
|
|
608
|
-
{ label: 'ZIP Archive', value: 'zip' },
|
|
609
|
-
{ label: 'Video (MP4)', value: 'mp4' },
|
|
610
|
-
{ label: 'Audio (MP3)', value: 'mp3' },
|
|
611
|
-
{ label: 'Software Installer', value: 'exe' },
|
|
612
|
-
],
|
|
613
|
-
{
|
|
614
|
-
required: true,
|
|
615
|
-
placeholder: 'Select file format',
|
|
616
|
-
dependencies: [
|
|
617
|
-
createDependency.showWhen(
|
|
618
|
-
'productType',
|
|
619
|
-
conditions.equals('digital'),
|
|
620
|
-
),
|
|
621
|
-
],
|
|
622
|
-
},
|
|
623
|
-
),
|
|
624
|
-
createField.number('fileSizeMB', 'File Size (MB)', {
|
|
625
|
-
placeholder: '50',
|
|
626
|
-
dependencies: [
|
|
627
|
-
createDependency.showWhen(
|
|
628
|
-
'productType',
|
|
629
|
-
conditions.equals('digital'),
|
|
630
|
-
),
|
|
631
|
-
],
|
|
632
|
-
}),
|
|
633
|
-
]),
|
|
634
|
-
|
|
635
|
-
createSection.card('Pricing & Discounts', [
|
|
636
|
-
createField.checkbox('hasDiscount', 'Apply Discount', {
|
|
637
|
-
defaultValue: false,
|
|
638
|
-
gridCols: 2,
|
|
639
|
-
}),
|
|
640
|
-
createField.select(
|
|
641
|
-
'discountType',
|
|
642
|
-
'Discount Type',
|
|
643
|
-
[
|
|
644
|
-
{ label: 'Percentage', value: 'percentage' },
|
|
645
|
-
{ label: 'Fixed Amount', value: 'fixed' },
|
|
646
|
-
{ label: 'Buy One Get One', value: 'bogo' },
|
|
647
|
-
],
|
|
648
|
-
{
|
|
649
|
-
required: true,
|
|
650
|
-
placeholder: 'Select discount type',
|
|
651
|
-
dependencies: [
|
|
652
|
-
createDependency.showWhen('hasDiscount', conditions.isTrue()),
|
|
653
|
-
],
|
|
654
|
-
},
|
|
655
|
-
),
|
|
656
|
-
createField.number('discountValue', 'Discount Value', {
|
|
657
|
-
required: true,
|
|
658
|
-
placeholder: '10',
|
|
659
|
-
dependencies: [
|
|
660
|
-
createDependency.showWhen('hasDiscount', conditions.isTrue()),
|
|
661
|
-
createDependency.showWhen(
|
|
662
|
-
'discountType',
|
|
663
|
-
(value) => value !== 'bogo',
|
|
664
|
-
),
|
|
665
|
-
],
|
|
666
|
-
}),
|
|
667
|
-
createField.date('discountStartDate', 'Discount Start Date', {
|
|
668
|
-
dependencies: [
|
|
669
|
-
createDependency.showWhen('hasDiscount', conditions.isTrue()),
|
|
670
|
-
],
|
|
671
|
-
}),
|
|
672
|
-
createField.date('discountEndDate', 'Discount End Date', {
|
|
673
|
-
dependencies: [
|
|
674
|
-
createDependency.showWhen('hasDiscount', conditions.isTrue()),
|
|
675
|
-
],
|
|
676
|
-
}),
|
|
677
|
-
createField.number('minimumQuantity', 'Minimum Quantity for Discount', {
|
|
678
|
-
placeholder: '2',
|
|
679
|
-
defaultValue: 1,
|
|
680
|
-
dependencies: [
|
|
681
|
-
createDependency.showWhen('hasDiscount', conditions.isTrue()),
|
|
682
|
-
],
|
|
683
|
-
}),
|
|
684
|
-
]),
|
|
685
|
-
|
|
686
|
-
createSection.card('Shipping Configuration', [
|
|
687
|
-
createField.checkbox('requiresShipping', 'Requires Physical Shipping', {
|
|
688
|
-
defaultValue: true,
|
|
689
|
-
gridCols: 2,
|
|
690
|
-
dependencies: [
|
|
691
|
-
createDependency.setValueWhen(
|
|
692
|
-
'productType',
|
|
693
|
-
conditions.equals('digital'),
|
|
694
|
-
false,
|
|
695
|
-
),
|
|
696
|
-
createDependency.disableWhen(
|
|
697
|
-
'productType',
|
|
698
|
-
conditions.equals('digital'),
|
|
699
|
-
),
|
|
700
|
-
],
|
|
701
|
-
}),
|
|
702
|
-
createField.number('weight', 'Weight (lbs)', {
|
|
703
|
-
placeholder: '1.5',
|
|
704
|
-
dependencies: [
|
|
705
|
-
createDependency.showWhen('requiresShipping', conditions.isTrue()),
|
|
706
|
-
],
|
|
707
|
-
}),
|
|
708
|
-
createField.object(
|
|
709
|
-
'dimensions',
|
|
710
|
-
'Dimensions (inches)',
|
|
711
|
-
[
|
|
712
|
-
createField.number('length', 'Length', {
|
|
713
|
-
required: true,
|
|
714
|
-
placeholder: '10',
|
|
715
|
-
}),
|
|
716
|
-
createField.number('width', 'Width', {
|
|
717
|
-
required: true,
|
|
718
|
-
placeholder: '8',
|
|
719
|
-
}),
|
|
720
|
-
createField.number('height', 'Height', {
|
|
721
|
-
required: true,
|
|
722
|
-
placeholder: '2',
|
|
723
|
-
}),
|
|
724
|
-
],
|
|
725
|
-
{
|
|
726
|
-
dependencies: [
|
|
727
|
-
createDependency.showWhen(
|
|
728
|
-
'requiresShipping',
|
|
729
|
-
conditions.isTrue(),
|
|
730
|
-
),
|
|
731
|
-
],
|
|
732
|
-
},
|
|
733
|
-
),
|
|
734
|
-
createField.select(
|
|
735
|
-
'shippingClass',
|
|
736
|
-
'Shipping Class',
|
|
737
|
-
[
|
|
738
|
-
{ label: 'Standard', value: 'standard' },
|
|
739
|
-
{ label: 'Express', value: 'express' },
|
|
740
|
-
{ label: 'Overnight', value: 'overnight' },
|
|
741
|
-
{ label: 'Fragile', value: 'fragile' },
|
|
742
|
-
{ label: 'Hazardous', value: 'hazardous' },
|
|
743
|
-
],
|
|
744
|
-
{
|
|
745
|
-
required: true,
|
|
746
|
-
defaultValue: 'standard',
|
|
747
|
-
placeholder: 'Select shipping class',
|
|
748
|
-
dependencies: [
|
|
749
|
-
createDependency.showWhen(
|
|
750
|
-
'requiresShipping',
|
|
751
|
-
conditions.isTrue(),
|
|
752
|
-
),
|
|
753
|
-
],
|
|
754
|
-
},
|
|
755
|
-
),
|
|
756
|
-
createField.checkbox('freeShipping', 'Offer Free Shipping', {
|
|
757
|
-
defaultValue: false,
|
|
758
|
-
dependencies: [
|
|
759
|
-
createDependency.showWhen('requiresShipping', conditions.isTrue()),
|
|
760
|
-
],
|
|
761
|
-
}),
|
|
762
|
-
createField.number(
|
|
763
|
-
'freeShippingThreshold',
|
|
764
|
-
'Free Shipping Threshold ($)',
|
|
765
|
-
{
|
|
766
|
-
placeholder: '50',
|
|
767
|
-
dependencies: [
|
|
768
|
-
createDependency.showWhen(
|
|
769
|
-
'requiresShipping',
|
|
770
|
-
conditions.isTrue(),
|
|
771
|
-
),
|
|
772
|
-
createDependency.showWhen('freeShipping', conditions.isTrue()),
|
|
773
|
-
],
|
|
774
|
-
},
|
|
775
|
-
),
|
|
776
|
-
]),
|
|
777
|
-
|
|
778
|
-
createSection.card('Inventory Management', [
|
|
779
|
-
createField.checkbox('trackInventory', 'Track Inventory', {
|
|
780
|
-
defaultValue: true,
|
|
781
|
-
gridCols: 2,
|
|
782
|
-
dependencies: [
|
|
783
|
-
createDependency.setValueWhen(
|
|
784
|
-
'productType',
|
|
785
|
-
conditions.equals('digital'),
|
|
786
|
-
false,
|
|
787
|
-
),
|
|
788
|
-
],
|
|
789
|
-
}),
|
|
790
|
-
createField.number('stockQuantity', 'Stock Quantity', {
|
|
791
|
-
required: true,
|
|
792
|
-
placeholder: '100',
|
|
793
|
-
dependencies: [
|
|
794
|
-
createDependency.showWhen('trackInventory', conditions.isTrue()),
|
|
795
|
-
],
|
|
796
|
-
}),
|
|
797
|
-
createField.number('lowStockThreshold', 'Low Stock Alert Threshold', {
|
|
798
|
-
placeholder: '10',
|
|
799
|
-
dependencies: [
|
|
800
|
-
createDependency.showWhen('trackInventory', conditions.isTrue()),
|
|
801
|
-
],
|
|
802
|
-
}),
|
|
803
|
-
createField.checkbox('allowBackorders', 'Allow Backorders', {
|
|
804
|
-
defaultValue: false,
|
|
805
|
-
dependencies: [
|
|
806
|
-
createDependency.showWhen('trackInventory', conditions.isTrue()),
|
|
807
|
-
],
|
|
808
|
-
}),
|
|
809
|
-
createField.text('sku', 'SKU (Stock Keeping Unit)', {
|
|
810
|
-
placeholder: 'PROD-001',
|
|
811
|
-
dependencies: [
|
|
812
|
-
createDependency.showWhen('trackInventory', conditions.isTrue()),
|
|
813
|
-
],
|
|
814
|
-
}),
|
|
815
|
-
createField.text('barcode', 'Barcode', {
|
|
816
|
-
placeholder: '123456789012',
|
|
817
|
-
dependencies: [
|
|
818
|
-
createDependency.showWhen('trackInventory', conditions.isTrue()),
|
|
819
|
-
],
|
|
820
|
-
}),
|
|
821
|
-
]),
|
|
822
|
-
|
|
823
|
-
createSection.card('Marketing & SEO', [
|
|
824
|
-
createField.text('metaTitle', 'Meta Title', {
|
|
825
|
-
placeholder: 'SEO-friendly title',
|
|
826
|
-
gridCols: 2,
|
|
827
|
-
}),
|
|
828
|
-
createField.textarea('metaDescription', 'Meta Description', {
|
|
829
|
-
placeholder: 'SEO-friendly description (150-160 characters)',
|
|
830
|
-
gridCols: 2,
|
|
831
|
-
}),
|
|
832
|
-
createField.array(
|
|
833
|
-
'tags',
|
|
834
|
-
'Product Tags',
|
|
835
|
-
[
|
|
836
|
-
createField.text('tag', 'Tag', {
|
|
837
|
-
required: true,
|
|
838
|
-
placeholder: 'e.g., electronics, gadgets',
|
|
839
|
-
}),
|
|
840
|
-
],
|
|
841
|
-
{ gridCols: 2, defaultValue: [{ tag: '' }] },
|
|
842
|
-
),
|
|
843
|
-
createField.checkbox('featured', 'Featured Product', {
|
|
844
|
-
defaultValue: false,
|
|
845
|
-
}),
|
|
846
|
-
createField.checkbox('newProduct', 'Mark as New', {
|
|
847
|
-
defaultValue: false,
|
|
848
|
-
}),
|
|
849
|
-
createField.select(
|
|
850
|
-
'visibility',
|
|
851
|
-
'Product Visibility',
|
|
852
|
-
[
|
|
853
|
-
{ label: 'Public', value: 'public' },
|
|
854
|
-
{ label: 'Private', value: 'private' },
|
|
855
|
-
{ label: 'Password Protected', value: 'password' },
|
|
856
|
-
{ label: 'Coming Soon', value: 'coming_soon' },
|
|
857
|
-
],
|
|
858
|
-
{
|
|
859
|
-
required: true,
|
|
860
|
-
defaultValue: 'public',
|
|
861
|
-
placeholder: 'Select visibility',
|
|
862
|
-
},
|
|
863
|
-
),
|
|
864
|
-
createField.text('password', 'Access Password', {
|
|
865
|
-
placeholder: 'Enter password',
|
|
866
|
-
dependencies: [
|
|
867
|
-
createDependency.showWhen(
|
|
868
|
-
'visibility',
|
|
869
|
-
conditions.equals('password'),
|
|
870
|
-
),
|
|
871
|
-
],
|
|
872
|
-
}),
|
|
873
|
-
createField.date('launchDate', 'Launch Date', {
|
|
874
|
-
dependencies: [
|
|
875
|
-
createDependency.showWhen(
|
|
876
|
-
'visibility',
|
|
877
|
-
conditions.equals('coming_soon'),
|
|
878
|
-
),
|
|
879
|
-
],
|
|
880
|
-
}),
|
|
881
|
-
]),
|
|
882
|
-
];
|
|
883
|
-
|
|
884
|
-
return (
|
|
885
|
-
<div className="max-w-6xl mx-auto p-6">
|
|
886
|
-
<div className="mb-8">
|
|
887
|
-
<h1 className="text-3xl font-bold text-gray-900">
|
|
888
|
-
Dynamic Product Configuration
|
|
889
|
-
</h1>
|
|
890
|
-
<p className="text-gray-600 mt-2">
|
|
891
|
-
This form demonstrates advanced field dependencies and real-time
|
|
892
|
-
interactions. Watch how fields appear, disappear, and change based
|
|
893
|
-
on your selections.
|
|
894
|
-
</p>
|
|
895
|
-
<div className="mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg">
|
|
896
|
-
<h3 className="font-semibold text-blue-900">
|
|
897
|
-
Try these interactions:
|
|
898
|
-
</h3>
|
|
899
|
-
<ul className="mt-2 text-sm text-blue-800 space-y-1">
|
|
900
|
-
<li>• Change Product Type to see different field sets</li>
|
|
901
|
-
<li>
|
|
902
|
-
• Enable "Apply Discount" to reveal discount configuration
|
|
903
|
-
</li>
|
|
904
|
-
<li>
|
|
905
|
-
• Toggle "Requires Physical Shipping" for shipping options
|
|
906
|
-
</li>
|
|
907
|
-
<li>• Select "Digital Download" to auto-disable shipping</li>
|
|
908
|
-
<li>
|
|
909
|
-
• Choose "Password Protected" visibility for password field
|
|
910
|
-
</li>
|
|
911
|
-
</ul>
|
|
912
|
-
</div>
|
|
913
|
-
</div>
|
|
914
|
-
|
|
915
|
-
<FormBuilder
|
|
916
|
-
sections={sections}
|
|
917
|
-
onSubmit={handleSubmit}
|
|
918
|
-
onFieldChange={handleFieldChange}
|
|
919
|
-
submitLabel="Save Product Configuration"
|
|
920
|
-
resetLabel="Reset All"
|
|
921
|
-
className="space-y-8"
|
|
922
|
-
/>
|
|
923
|
-
</div>
|
|
924
|
-
);
|
|
925
|
-
},
|
|
926
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { FormBuilder } from '../../../kit/builder/form/components/FormBuilder';
|
|
3
|
+
import type { FormBuilderSectionConfig } from '../../../kit/builder/form/components/FormBuilder';
|
|
4
|
+
import {
|
|
5
|
+
createSection,
|
|
6
|
+
createField,
|
|
7
|
+
createDependency,
|
|
8
|
+
conditions,
|
|
9
|
+
} from '../../../kit/builder/form/utils';
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof FormBuilder> = {
|
|
12
|
+
title: 'Kit/Builder/Form',
|
|
13
|
+
component: FormBuilder,
|
|
14
|
+
parameters: {
|
|
15
|
+
controls: { expanded: true },
|
|
16
|
+
backgrounds: { disable: true },
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const DynamicTabsExample: Story = {
|
|
21
|
+
name: 'Dynamic example (Tabs)',
|
|
22
|
+
render: () => {
|
|
23
|
+
const handleSubmit = (data: unknown) => {
|
|
24
|
+
console.log('Dynamic tabs form submitted:', data);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const handleFieldChange = (name: string, value: unknown) => {
|
|
28
|
+
console.log(`[Tabs] Field ${name} changed to:`, value);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const sections: FormBuilderSectionConfig[] = [
|
|
32
|
+
{
|
|
33
|
+
title: 'Product Builder',
|
|
34
|
+
layout: 'tabs',
|
|
35
|
+
variant: 'card',
|
|
36
|
+
defaultTabId: 'product',
|
|
37
|
+
tabsListClassName: 'w-full',
|
|
38
|
+
tabsContentClassName: 'mt-2',
|
|
39
|
+
tabs: [
|
|
40
|
+
{
|
|
41
|
+
id: 'product',
|
|
42
|
+
label: 'Product',
|
|
43
|
+
sections: [
|
|
44
|
+
createSection.card('Product Configuration', [
|
|
45
|
+
createField.select(
|
|
46
|
+
'productType',
|
|
47
|
+
'Product Type',
|
|
48
|
+
[
|
|
49
|
+
{ label: 'One-time Purchase', value: 'onetime' },
|
|
50
|
+
{ label: 'Subscription', value: 'subscription' },
|
|
51
|
+
{ label: 'Bundle', value: 'bundle' },
|
|
52
|
+
{ label: 'Digital Download', value: 'digital' },
|
|
53
|
+
],
|
|
54
|
+
{ required: true, placeholder: 'Select product type' },
|
|
55
|
+
),
|
|
56
|
+
createField.text('productName', 'Product Name', {
|
|
57
|
+
required: true,
|
|
58
|
+
placeholder: 'Enter product name',
|
|
59
|
+
}),
|
|
60
|
+
createField.number('basePrice', 'Base Price ($)', {
|
|
61
|
+
required: true,
|
|
62
|
+
placeholder: '29.99',
|
|
63
|
+
}),
|
|
64
|
+
createField.select(
|
|
65
|
+
'billingCycle',
|
|
66
|
+
'Billing Cycle',
|
|
67
|
+
[
|
|
68
|
+
{ label: 'Monthly', value: 'monthly' },
|
|
69
|
+
{ label: 'Quarterly', value: 'quarterly' },
|
|
70
|
+
{ label: 'Yearly', value: 'yearly' },
|
|
71
|
+
],
|
|
72
|
+
{
|
|
73
|
+
required: true,
|
|
74
|
+
placeholder: 'Select billing cycle',
|
|
75
|
+
dependencies: [
|
|
76
|
+
createDependency.showWhen(
|
|
77
|
+
'productType',
|
|
78
|
+
conditions.equals('subscription'),
|
|
79
|
+
),
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
),
|
|
83
|
+
createField.number('trialDays', 'Free Trial Days', {
|
|
84
|
+
placeholder: '14',
|
|
85
|
+
defaultValue: 0,
|
|
86
|
+
dependencies: [
|
|
87
|
+
createDependency.showWhen(
|
|
88
|
+
'productType',
|
|
89
|
+
conditions.equals('subscription'),
|
|
90
|
+
),
|
|
91
|
+
],
|
|
92
|
+
}),
|
|
93
|
+
createField.array(
|
|
94
|
+
'bundleItems',
|
|
95
|
+
'Bundle Items',
|
|
96
|
+
[
|
|
97
|
+
createField.text('itemName', 'Item Name', {
|
|
98
|
+
required: true,
|
|
99
|
+
placeholder: 'Item name',
|
|
100
|
+
}),
|
|
101
|
+
createField.number('itemPrice', 'Item Price ($)', {
|
|
102
|
+
required: true,
|
|
103
|
+
placeholder: '9.99',
|
|
104
|
+
}),
|
|
105
|
+
createField.number('quantity', 'Quantity', {
|
|
106
|
+
required: true,
|
|
107
|
+
defaultValue: 1,
|
|
108
|
+
placeholder: '1',
|
|
109
|
+
}),
|
|
110
|
+
],
|
|
111
|
+
{
|
|
112
|
+
gridCols: 2,
|
|
113
|
+
defaultValue: [{ itemName: '', itemPrice: 0, quantity: 1 }],
|
|
114
|
+
dependencies: [
|
|
115
|
+
createDependency.showWhen(
|
|
116
|
+
'productType',
|
|
117
|
+
conditions.equals('bundle'),
|
|
118
|
+
),
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
),
|
|
122
|
+
createField.select(
|
|
123
|
+
'fileFormat',
|
|
124
|
+
'File Format',
|
|
125
|
+
[
|
|
126
|
+
{ label: 'PDF', value: 'pdf' },
|
|
127
|
+
{ label: 'ZIP Archive', value: 'zip' },
|
|
128
|
+
{ label: 'Video (MP4)', value: 'mp4' },
|
|
129
|
+
{ label: 'Audio (MP3)', value: 'mp3' },
|
|
130
|
+
{ label: 'Software Installer', value: 'exe' },
|
|
131
|
+
],
|
|
132
|
+
{
|
|
133
|
+
required: true,
|
|
134
|
+
placeholder: 'Select file format',
|
|
135
|
+
dependencies: [
|
|
136
|
+
createDependency.showWhen(
|
|
137
|
+
'productType',
|
|
138
|
+
conditions.equals('digital'),
|
|
139
|
+
),
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
),
|
|
143
|
+
createField.number('fileSizeMB', 'File Size (MB)', {
|
|
144
|
+
placeholder: '50',
|
|
145
|
+
dependencies: [
|
|
146
|
+
createDependency.showWhen(
|
|
147
|
+
'productType',
|
|
148
|
+
conditions.equals('digital'),
|
|
149
|
+
),
|
|
150
|
+
],
|
|
151
|
+
}),
|
|
152
|
+
]),
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 'pricing',
|
|
157
|
+
label: 'Pricing',
|
|
158
|
+
sections: [
|
|
159
|
+
createSection.card('Pricing & Discounts', [
|
|
160
|
+
createField.checkbox('hasDiscount', 'Apply Discount', {
|
|
161
|
+
defaultValue: false,
|
|
162
|
+
gridCols: 2,
|
|
163
|
+
}),
|
|
164
|
+
createField.select(
|
|
165
|
+
'discountType',
|
|
166
|
+
'Discount Type',
|
|
167
|
+
[
|
|
168
|
+
{ label: 'Percentage', value: 'percentage' },
|
|
169
|
+
{ label: 'Fixed Amount', value: 'fixed' },
|
|
170
|
+
{ label: 'Buy One Get One', value: 'bogo' },
|
|
171
|
+
],
|
|
172
|
+
{
|
|
173
|
+
required: true,
|
|
174
|
+
placeholder: 'Select discount type',
|
|
175
|
+
dependencies: [
|
|
176
|
+
createDependency.showWhen(
|
|
177
|
+
'hasDiscount',
|
|
178
|
+
conditions.isTrue(),
|
|
179
|
+
),
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
),
|
|
183
|
+
createField.number('discountValue', 'Discount Value', {
|
|
184
|
+
required: true,
|
|
185
|
+
placeholder: '10',
|
|
186
|
+
dependencies: [
|
|
187
|
+
createDependency.showWhen(
|
|
188
|
+
'hasDiscount',
|
|
189
|
+
conditions.isTrue(),
|
|
190
|
+
),
|
|
191
|
+
createDependency.showWhen(
|
|
192
|
+
'discountType',
|
|
193
|
+
(value) => value !== 'bogo',
|
|
194
|
+
),
|
|
195
|
+
],
|
|
196
|
+
}),
|
|
197
|
+
createField.date('discountStartDate', 'Discount Start Date', {
|
|
198
|
+
dependencies: [
|
|
199
|
+
createDependency.showWhen(
|
|
200
|
+
'hasDiscount',
|
|
201
|
+
conditions.isTrue(),
|
|
202
|
+
),
|
|
203
|
+
],
|
|
204
|
+
}),
|
|
205
|
+
createField.date('discountEndDate', 'Discount End Date', {
|
|
206
|
+
dependencies: [
|
|
207
|
+
createDependency.showWhen(
|
|
208
|
+
'hasDiscount',
|
|
209
|
+
conditions.isTrue(),
|
|
210
|
+
),
|
|
211
|
+
],
|
|
212
|
+
}),
|
|
213
|
+
createField.number(
|
|
214
|
+
'minimumQuantity',
|
|
215
|
+
'Minimum Quantity for Discount',
|
|
216
|
+
{
|
|
217
|
+
placeholder: '2',
|
|
218
|
+
defaultValue: 1,
|
|
219
|
+
dependencies: [
|
|
220
|
+
createDependency.showWhen(
|
|
221
|
+
'hasDiscount',
|
|
222
|
+
conditions.isTrue(),
|
|
223
|
+
),
|
|
224
|
+
],
|
|
225
|
+
},
|
|
226
|
+
),
|
|
227
|
+
]),
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: 'shipping',
|
|
232
|
+
label: 'Shipping',
|
|
233
|
+
sections: [
|
|
234
|
+
createSection.card('Shipping Configuration', [
|
|
235
|
+
createField.checkbox(
|
|
236
|
+
'requiresShipping',
|
|
237
|
+
'Requires Physical Shipping',
|
|
238
|
+
{
|
|
239
|
+
defaultValue: true,
|
|
240
|
+
gridCols: 2,
|
|
241
|
+
dependencies: [
|
|
242
|
+
createDependency.setValueWhen(
|
|
243
|
+
'productType',
|
|
244
|
+
conditions.equals('digital'),
|
|
245
|
+
false,
|
|
246
|
+
),
|
|
247
|
+
createDependency.disableWhen(
|
|
248
|
+
'productType',
|
|
249
|
+
conditions.equals('digital'),
|
|
250
|
+
),
|
|
251
|
+
],
|
|
252
|
+
},
|
|
253
|
+
),
|
|
254
|
+
createField.number('weight', 'Weight (lbs)', {
|
|
255
|
+
placeholder: '1.5',
|
|
256
|
+
dependencies: [
|
|
257
|
+
createDependency.showWhen(
|
|
258
|
+
'requiresShipping',
|
|
259
|
+
conditions.isTrue(),
|
|
260
|
+
),
|
|
261
|
+
],
|
|
262
|
+
}),
|
|
263
|
+
createField.object(
|
|
264
|
+
'dimensions',
|
|
265
|
+
'Dimensions (inches)',
|
|
266
|
+
[
|
|
267
|
+
createField.number('length', 'Length', {
|
|
268
|
+
required: true,
|
|
269
|
+
placeholder: '10',
|
|
270
|
+
}),
|
|
271
|
+
createField.number('width', 'Width', {
|
|
272
|
+
required: true,
|
|
273
|
+
placeholder: '8',
|
|
274
|
+
}),
|
|
275
|
+
createField.number('height', 'Height', {
|
|
276
|
+
required: true,
|
|
277
|
+
placeholder: '2',
|
|
278
|
+
}),
|
|
279
|
+
],
|
|
280
|
+
{
|
|
281
|
+
dependencies: [
|
|
282
|
+
createDependency.showWhen(
|
|
283
|
+
'requiresShipping',
|
|
284
|
+
conditions.isTrue(),
|
|
285
|
+
),
|
|
286
|
+
],
|
|
287
|
+
},
|
|
288
|
+
),
|
|
289
|
+
createField.select(
|
|
290
|
+
'shippingClass',
|
|
291
|
+
'Shipping Class',
|
|
292
|
+
[
|
|
293
|
+
{ label: 'Standard', value: 'standard' },
|
|
294
|
+
{ label: 'Express', value: 'express' },
|
|
295
|
+
{ label: 'Overnight', value: 'overnight' },
|
|
296
|
+
{ label: 'Fragile', value: 'fragile' },
|
|
297
|
+
{ label: 'Hazardous', value: 'hazardous' },
|
|
298
|
+
],
|
|
299
|
+
{
|
|
300
|
+
required: true,
|
|
301
|
+
defaultValue: 'standard',
|
|
302
|
+
placeholder: 'Select shipping class',
|
|
303
|
+
dependencies: [
|
|
304
|
+
createDependency.showWhen(
|
|
305
|
+
'requiresShipping',
|
|
306
|
+
conditions.isTrue(),
|
|
307
|
+
),
|
|
308
|
+
],
|
|
309
|
+
},
|
|
310
|
+
),
|
|
311
|
+
createField.checkbox('freeShipping', 'Offer Free Shipping', {
|
|
312
|
+
defaultValue: false,
|
|
313
|
+
dependencies: [
|
|
314
|
+
createDependency.showWhen(
|
|
315
|
+
'requiresShipping',
|
|
316
|
+
conditions.isTrue(),
|
|
317
|
+
),
|
|
318
|
+
],
|
|
319
|
+
}),
|
|
320
|
+
createField.number(
|
|
321
|
+
'freeShippingThreshold',
|
|
322
|
+
'Free Shipping Threshold ($)',
|
|
323
|
+
{
|
|
324
|
+
placeholder: '50',
|
|
325
|
+
dependencies: [
|
|
326
|
+
createDependency.showWhen(
|
|
327
|
+
'requiresShipping',
|
|
328
|
+
conditions.isTrue(),
|
|
329
|
+
),
|
|
330
|
+
createDependency.showWhen(
|
|
331
|
+
'freeShipping',
|
|
332
|
+
conditions.isTrue(),
|
|
333
|
+
),
|
|
334
|
+
],
|
|
335
|
+
},
|
|
336
|
+
),
|
|
337
|
+
]),
|
|
338
|
+
],
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: 'inventory',
|
|
342
|
+
label: 'Inventory',
|
|
343
|
+
sections: [
|
|
344
|
+
createSection.card('Inventory Management', [
|
|
345
|
+
createField.checkbox('trackInventory', 'Track Inventory', {
|
|
346
|
+
defaultValue: true,
|
|
347
|
+
gridCols: 2,
|
|
348
|
+
dependencies: [
|
|
349
|
+
createDependency.setValueWhen(
|
|
350
|
+
'productType',
|
|
351
|
+
conditions.equals('digital'),
|
|
352
|
+
false,
|
|
353
|
+
),
|
|
354
|
+
],
|
|
355
|
+
}),
|
|
356
|
+
createField.number('stockQuantity', 'Stock Quantity', {
|
|
357
|
+
required: true,
|
|
358
|
+
placeholder: '100',
|
|
359
|
+
dependencies: [
|
|
360
|
+
createDependency.showWhen(
|
|
361
|
+
'trackInventory',
|
|
362
|
+
conditions.isTrue(),
|
|
363
|
+
),
|
|
364
|
+
],
|
|
365
|
+
}),
|
|
366
|
+
createField.number(
|
|
367
|
+
'lowStockThreshold',
|
|
368
|
+
'Low Stock Alert Threshold',
|
|
369
|
+
{
|
|
370
|
+
placeholder: '10',
|
|
371
|
+
dependencies: [
|
|
372
|
+
createDependency.showWhen(
|
|
373
|
+
'trackInventory',
|
|
374
|
+
conditions.isTrue(),
|
|
375
|
+
),
|
|
376
|
+
],
|
|
377
|
+
},
|
|
378
|
+
),
|
|
379
|
+
createField.checkbox('allowBackorders', 'Allow Backorders', {
|
|
380
|
+
defaultValue: false,
|
|
381
|
+
dependencies: [
|
|
382
|
+
createDependency.showWhen(
|
|
383
|
+
'trackInventory',
|
|
384
|
+
conditions.isTrue(),
|
|
385
|
+
),
|
|
386
|
+
],
|
|
387
|
+
}),
|
|
388
|
+
createField.text('sku', 'SKU (Stock Keeping Unit)', {
|
|
389
|
+
placeholder: 'PROD-001',
|
|
390
|
+
dependencies: [
|
|
391
|
+
createDependency.showWhen(
|
|
392
|
+
'trackInventory',
|
|
393
|
+
conditions.isTrue(),
|
|
394
|
+
),
|
|
395
|
+
],
|
|
396
|
+
}),
|
|
397
|
+
createField.text('barcode', 'Barcode', {
|
|
398
|
+
placeholder: '123456789012',
|
|
399
|
+
dependencies: [
|
|
400
|
+
createDependency.showWhen(
|
|
401
|
+
'trackInventory',
|
|
402
|
+
conditions.isTrue(),
|
|
403
|
+
),
|
|
404
|
+
],
|
|
405
|
+
}),
|
|
406
|
+
]),
|
|
407
|
+
],
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
id: 'marketing',
|
|
411
|
+
label: 'Marketing',
|
|
412
|
+
sections: [
|
|
413
|
+
createSection.card('Marketing & SEO', [
|
|
414
|
+
createField.text('metaTitle', 'Meta Title', {
|
|
415
|
+
placeholder: 'SEO-friendly title',
|
|
416
|
+
gridCols: 2,
|
|
417
|
+
}),
|
|
418
|
+
createField.textarea('metaDescription', 'Meta Description', {
|
|
419
|
+
placeholder: 'SEO-friendly description (150-160 characters)',
|
|
420
|
+
gridCols: 2,
|
|
421
|
+
}),
|
|
422
|
+
createField.array(
|
|
423
|
+
'tags',
|
|
424
|
+
'Product Tags',
|
|
425
|
+
[
|
|
426
|
+
createField.text('tag', 'Tag', {
|
|
427
|
+
required: true,
|
|
428
|
+
placeholder: 'e.g., electronics, gadgets',
|
|
429
|
+
}),
|
|
430
|
+
],
|
|
431
|
+
{ gridCols: 2, defaultValue: [{ tag: '' }] },
|
|
432
|
+
),
|
|
433
|
+
createField.checkbox('featured', 'Featured Product', {
|
|
434
|
+
defaultValue: false,
|
|
435
|
+
}),
|
|
436
|
+
createField.checkbox('newProduct', 'Mark as New', {
|
|
437
|
+
defaultValue: false,
|
|
438
|
+
}),
|
|
439
|
+
createField.select(
|
|
440
|
+
'visibility',
|
|
441
|
+
'Product Visibility',
|
|
442
|
+
[
|
|
443
|
+
{ label: 'Public', value: 'public' },
|
|
444
|
+
{ label: 'Private', value: 'private' },
|
|
445
|
+
{ label: 'Password Protected', value: 'password' },
|
|
446
|
+
{ label: 'Coming Soon', value: 'coming_soon' },
|
|
447
|
+
],
|
|
448
|
+
{
|
|
449
|
+
required: true,
|
|
450
|
+
defaultValue: 'public',
|
|
451
|
+
placeholder: 'Select visibility',
|
|
452
|
+
},
|
|
453
|
+
),
|
|
454
|
+
createField.text('password', 'Access Password', {
|
|
455
|
+
placeholder: 'Enter password',
|
|
456
|
+
dependencies: [
|
|
457
|
+
createDependency.showWhen(
|
|
458
|
+
'visibility',
|
|
459
|
+
conditions.equals('password'),
|
|
460
|
+
),
|
|
461
|
+
],
|
|
462
|
+
}),
|
|
463
|
+
createField.date('launchDate', 'Launch Date', {
|
|
464
|
+
dependencies: [
|
|
465
|
+
createDependency.showWhen(
|
|
466
|
+
'visibility',
|
|
467
|
+
conditions.equals('coming_soon'),
|
|
468
|
+
),
|
|
469
|
+
],
|
|
470
|
+
}),
|
|
471
|
+
]),
|
|
472
|
+
],
|
|
473
|
+
},
|
|
474
|
+
],
|
|
475
|
+
},
|
|
476
|
+
];
|
|
477
|
+
|
|
478
|
+
return (
|
|
479
|
+
<div className="max-w-6xl mx-auto p-6">
|
|
480
|
+
<div className="mb-8">
|
|
481
|
+
<h1 className="text-3xl font-bold text-gray-900">
|
|
482
|
+
Dynamic Product Configuration (Tabs)
|
|
483
|
+
</h1>
|
|
484
|
+
<p className="text-gray-600 mt-2">
|
|
485
|
+
The same dynamic form organized into tabs for better navigation.
|
|
486
|
+
</p>
|
|
487
|
+
</div>
|
|
488
|
+
<FormBuilder
|
|
489
|
+
sections={sections}
|
|
490
|
+
onSubmit={handleSubmit}
|
|
491
|
+
onFieldChange={handleFieldChange}
|
|
492
|
+
submitLabel="Save Product Configuration"
|
|
493
|
+
resetLabel="Reset All"
|
|
494
|
+
className="space-y-8"
|
|
495
|
+
/>
|
|
496
|
+
</div>
|
|
497
|
+
);
|
|
498
|
+
},
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
export default meta;
|
|
502
|
+
|
|
503
|
+
type Story = StoryObj<typeof FormBuilder>;
|
|
504
|
+
|
|
505
|
+
export const DynamicExample: Story = {
|
|
506
|
+
name: 'Dynamic example',
|
|
507
|
+
render: () => {
|
|
508
|
+
const handleSubmit = (data: unknown) => {
|
|
509
|
+
console.log('Dynamic form submitted:', data);
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
const handleFieldChange = (name: string, value: unknown) => {
|
|
513
|
+
console.log(`Field ${name} changed to:`, value);
|
|
514
|
+
if (name === 'productType' && value === 'subscription') {
|
|
515
|
+
console.log(
|
|
516
|
+
'Subscription product selected - additional fields will appear',
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
if (name === 'hasDiscount' && value === true) {
|
|
520
|
+
console.log('Discount enabled - discount fields will appear');
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
const sections = [
|
|
525
|
+
createSection.card('Product Configuration', [
|
|
526
|
+
createField.select(
|
|
527
|
+
'productType',
|
|
528
|
+
'Product Type',
|
|
529
|
+
[
|
|
530
|
+
{ label: 'One-time Purchase', value: 'onetime' },
|
|
531
|
+
{ label: 'Subscription', value: 'subscription' },
|
|
532
|
+
{ label: 'Bundle', value: 'bundle' },
|
|
533
|
+
{ label: 'Digital Download', value: 'digital' },
|
|
534
|
+
],
|
|
535
|
+
{ required: true, placeholder: 'Select product type' },
|
|
536
|
+
),
|
|
537
|
+
createField.text('productName', 'Product Name', {
|
|
538
|
+
required: true,
|
|
539
|
+
placeholder: 'Enter product name',
|
|
540
|
+
}),
|
|
541
|
+
createField.number('basePrice', 'Base Price ($)', {
|
|
542
|
+
required: true,
|
|
543
|
+
placeholder: '29.99',
|
|
544
|
+
}),
|
|
545
|
+
createField.select(
|
|
546
|
+
'billingCycle',
|
|
547
|
+
'Billing Cycle',
|
|
548
|
+
[
|
|
549
|
+
{ label: 'Monthly', value: 'monthly' },
|
|
550
|
+
{ label: 'Quarterly', value: 'quarterly' },
|
|
551
|
+
{ label: 'Yearly', value: 'yearly' },
|
|
552
|
+
],
|
|
553
|
+
{
|
|
554
|
+
required: true,
|
|
555
|
+
placeholder: 'Select billing cycle',
|
|
556
|
+
dependencies: [
|
|
557
|
+
createDependency.showWhen(
|
|
558
|
+
'productType',
|
|
559
|
+
conditions.equals('subscription'),
|
|
560
|
+
),
|
|
561
|
+
],
|
|
562
|
+
},
|
|
563
|
+
),
|
|
564
|
+
createField.number('trialDays', 'Free Trial Days', {
|
|
565
|
+
placeholder: '14',
|
|
566
|
+
defaultValue: 0,
|
|
567
|
+
dependencies: [
|
|
568
|
+
createDependency.showWhen(
|
|
569
|
+
'productType',
|
|
570
|
+
conditions.equals('subscription'),
|
|
571
|
+
),
|
|
572
|
+
],
|
|
573
|
+
}),
|
|
574
|
+
createField.array(
|
|
575
|
+
'bundleItems',
|
|
576
|
+
'Bundle Items',
|
|
577
|
+
[
|
|
578
|
+
createField.text('itemName', 'Item Name', {
|
|
579
|
+
required: true,
|
|
580
|
+
placeholder: 'Item name',
|
|
581
|
+
}),
|
|
582
|
+
createField.number('itemPrice', 'Item Price ($)', {
|
|
583
|
+
required: true,
|
|
584
|
+
placeholder: '9.99',
|
|
585
|
+
}),
|
|
586
|
+
createField.number('quantity', 'Quantity', {
|
|
587
|
+
required: true,
|
|
588
|
+
defaultValue: 1,
|
|
589
|
+
placeholder: '1',
|
|
590
|
+
}),
|
|
591
|
+
],
|
|
592
|
+
{
|
|
593
|
+
gridCols: 2,
|
|
594
|
+
defaultValue: [{ itemName: '', itemPrice: 0, quantity: 1 }],
|
|
595
|
+
dependencies: [
|
|
596
|
+
createDependency.showWhen(
|
|
597
|
+
'productType',
|
|
598
|
+
conditions.equals('bundle'),
|
|
599
|
+
),
|
|
600
|
+
],
|
|
601
|
+
},
|
|
602
|
+
),
|
|
603
|
+
createField.select(
|
|
604
|
+
'fileFormat',
|
|
605
|
+
'File Format',
|
|
606
|
+
[
|
|
607
|
+
{ label: 'PDF', value: 'pdf' },
|
|
608
|
+
{ label: 'ZIP Archive', value: 'zip' },
|
|
609
|
+
{ label: 'Video (MP4)', value: 'mp4' },
|
|
610
|
+
{ label: 'Audio (MP3)', value: 'mp3' },
|
|
611
|
+
{ label: 'Software Installer', value: 'exe' },
|
|
612
|
+
],
|
|
613
|
+
{
|
|
614
|
+
required: true,
|
|
615
|
+
placeholder: 'Select file format',
|
|
616
|
+
dependencies: [
|
|
617
|
+
createDependency.showWhen(
|
|
618
|
+
'productType',
|
|
619
|
+
conditions.equals('digital'),
|
|
620
|
+
),
|
|
621
|
+
],
|
|
622
|
+
},
|
|
623
|
+
),
|
|
624
|
+
createField.number('fileSizeMB', 'File Size (MB)', {
|
|
625
|
+
placeholder: '50',
|
|
626
|
+
dependencies: [
|
|
627
|
+
createDependency.showWhen(
|
|
628
|
+
'productType',
|
|
629
|
+
conditions.equals('digital'),
|
|
630
|
+
),
|
|
631
|
+
],
|
|
632
|
+
}),
|
|
633
|
+
]),
|
|
634
|
+
|
|
635
|
+
createSection.card('Pricing & Discounts', [
|
|
636
|
+
createField.checkbox('hasDiscount', 'Apply Discount', {
|
|
637
|
+
defaultValue: false,
|
|
638
|
+
gridCols: 2,
|
|
639
|
+
}),
|
|
640
|
+
createField.select(
|
|
641
|
+
'discountType',
|
|
642
|
+
'Discount Type',
|
|
643
|
+
[
|
|
644
|
+
{ label: 'Percentage', value: 'percentage' },
|
|
645
|
+
{ label: 'Fixed Amount', value: 'fixed' },
|
|
646
|
+
{ label: 'Buy One Get One', value: 'bogo' },
|
|
647
|
+
],
|
|
648
|
+
{
|
|
649
|
+
required: true,
|
|
650
|
+
placeholder: 'Select discount type',
|
|
651
|
+
dependencies: [
|
|
652
|
+
createDependency.showWhen('hasDiscount', conditions.isTrue()),
|
|
653
|
+
],
|
|
654
|
+
},
|
|
655
|
+
),
|
|
656
|
+
createField.number('discountValue', 'Discount Value', {
|
|
657
|
+
required: true,
|
|
658
|
+
placeholder: '10',
|
|
659
|
+
dependencies: [
|
|
660
|
+
createDependency.showWhen('hasDiscount', conditions.isTrue()),
|
|
661
|
+
createDependency.showWhen(
|
|
662
|
+
'discountType',
|
|
663
|
+
(value) => value !== 'bogo',
|
|
664
|
+
),
|
|
665
|
+
],
|
|
666
|
+
}),
|
|
667
|
+
createField.date('discountStartDate', 'Discount Start Date', {
|
|
668
|
+
dependencies: [
|
|
669
|
+
createDependency.showWhen('hasDiscount', conditions.isTrue()),
|
|
670
|
+
],
|
|
671
|
+
}),
|
|
672
|
+
createField.date('discountEndDate', 'Discount End Date', {
|
|
673
|
+
dependencies: [
|
|
674
|
+
createDependency.showWhen('hasDiscount', conditions.isTrue()),
|
|
675
|
+
],
|
|
676
|
+
}),
|
|
677
|
+
createField.number('minimumQuantity', 'Minimum Quantity for Discount', {
|
|
678
|
+
placeholder: '2',
|
|
679
|
+
defaultValue: 1,
|
|
680
|
+
dependencies: [
|
|
681
|
+
createDependency.showWhen('hasDiscount', conditions.isTrue()),
|
|
682
|
+
],
|
|
683
|
+
}),
|
|
684
|
+
]),
|
|
685
|
+
|
|
686
|
+
createSection.card('Shipping Configuration', [
|
|
687
|
+
createField.checkbox('requiresShipping', 'Requires Physical Shipping', {
|
|
688
|
+
defaultValue: true,
|
|
689
|
+
gridCols: 2,
|
|
690
|
+
dependencies: [
|
|
691
|
+
createDependency.setValueWhen(
|
|
692
|
+
'productType',
|
|
693
|
+
conditions.equals('digital'),
|
|
694
|
+
false,
|
|
695
|
+
),
|
|
696
|
+
createDependency.disableWhen(
|
|
697
|
+
'productType',
|
|
698
|
+
conditions.equals('digital'),
|
|
699
|
+
),
|
|
700
|
+
],
|
|
701
|
+
}),
|
|
702
|
+
createField.number('weight', 'Weight (lbs)', {
|
|
703
|
+
placeholder: '1.5',
|
|
704
|
+
dependencies: [
|
|
705
|
+
createDependency.showWhen('requiresShipping', conditions.isTrue()),
|
|
706
|
+
],
|
|
707
|
+
}),
|
|
708
|
+
createField.object(
|
|
709
|
+
'dimensions',
|
|
710
|
+
'Dimensions (inches)',
|
|
711
|
+
[
|
|
712
|
+
createField.number('length', 'Length', {
|
|
713
|
+
required: true,
|
|
714
|
+
placeholder: '10',
|
|
715
|
+
}),
|
|
716
|
+
createField.number('width', 'Width', {
|
|
717
|
+
required: true,
|
|
718
|
+
placeholder: '8',
|
|
719
|
+
}),
|
|
720
|
+
createField.number('height', 'Height', {
|
|
721
|
+
required: true,
|
|
722
|
+
placeholder: '2',
|
|
723
|
+
}),
|
|
724
|
+
],
|
|
725
|
+
{
|
|
726
|
+
dependencies: [
|
|
727
|
+
createDependency.showWhen(
|
|
728
|
+
'requiresShipping',
|
|
729
|
+
conditions.isTrue(),
|
|
730
|
+
),
|
|
731
|
+
],
|
|
732
|
+
},
|
|
733
|
+
),
|
|
734
|
+
createField.select(
|
|
735
|
+
'shippingClass',
|
|
736
|
+
'Shipping Class',
|
|
737
|
+
[
|
|
738
|
+
{ label: 'Standard', value: 'standard' },
|
|
739
|
+
{ label: 'Express', value: 'express' },
|
|
740
|
+
{ label: 'Overnight', value: 'overnight' },
|
|
741
|
+
{ label: 'Fragile', value: 'fragile' },
|
|
742
|
+
{ label: 'Hazardous', value: 'hazardous' },
|
|
743
|
+
],
|
|
744
|
+
{
|
|
745
|
+
required: true,
|
|
746
|
+
defaultValue: 'standard',
|
|
747
|
+
placeholder: 'Select shipping class',
|
|
748
|
+
dependencies: [
|
|
749
|
+
createDependency.showWhen(
|
|
750
|
+
'requiresShipping',
|
|
751
|
+
conditions.isTrue(),
|
|
752
|
+
),
|
|
753
|
+
],
|
|
754
|
+
},
|
|
755
|
+
),
|
|
756
|
+
createField.checkbox('freeShipping', 'Offer Free Shipping', {
|
|
757
|
+
defaultValue: false,
|
|
758
|
+
dependencies: [
|
|
759
|
+
createDependency.showWhen('requiresShipping', conditions.isTrue()),
|
|
760
|
+
],
|
|
761
|
+
}),
|
|
762
|
+
createField.number(
|
|
763
|
+
'freeShippingThreshold',
|
|
764
|
+
'Free Shipping Threshold ($)',
|
|
765
|
+
{
|
|
766
|
+
placeholder: '50',
|
|
767
|
+
dependencies: [
|
|
768
|
+
createDependency.showWhen(
|
|
769
|
+
'requiresShipping',
|
|
770
|
+
conditions.isTrue(),
|
|
771
|
+
),
|
|
772
|
+
createDependency.showWhen('freeShipping', conditions.isTrue()),
|
|
773
|
+
],
|
|
774
|
+
},
|
|
775
|
+
),
|
|
776
|
+
]),
|
|
777
|
+
|
|
778
|
+
createSection.card('Inventory Management', [
|
|
779
|
+
createField.checkbox('trackInventory', 'Track Inventory', {
|
|
780
|
+
defaultValue: true,
|
|
781
|
+
gridCols: 2,
|
|
782
|
+
dependencies: [
|
|
783
|
+
createDependency.setValueWhen(
|
|
784
|
+
'productType',
|
|
785
|
+
conditions.equals('digital'),
|
|
786
|
+
false,
|
|
787
|
+
),
|
|
788
|
+
],
|
|
789
|
+
}),
|
|
790
|
+
createField.number('stockQuantity', 'Stock Quantity', {
|
|
791
|
+
required: true,
|
|
792
|
+
placeholder: '100',
|
|
793
|
+
dependencies: [
|
|
794
|
+
createDependency.showWhen('trackInventory', conditions.isTrue()),
|
|
795
|
+
],
|
|
796
|
+
}),
|
|
797
|
+
createField.number('lowStockThreshold', 'Low Stock Alert Threshold', {
|
|
798
|
+
placeholder: '10',
|
|
799
|
+
dependencies: [
|
|
800
|
+
createDependency.showWhen('trackInventory', conditions.isTrue()),
|
|
801
|
+
],
|
|
802
|
+
}),
|
|
803
|
+
createField.checkbox('allowBackorders', 'Allow Backorders', {
|
|
804
|
+
defaultValue: false,
|
|
805
|
+
dependencies: [
|
|
806
|
+
createDependency.showWhen('trackInventory', conditions.isTrue()),
|
|
807
|
+
],
|
|
808
|
+
}),
|
|
809
|
+
createField.text('sku', 'SKU (Stock Keeping Unit)', {
|
|
810
|
+
placeholder: 'PROD-001',
|
|
811
|
+
dependencies: [
|
|
812
|
+
createDependency.showWhen('trackInventory', conditions.isTrue()),
|
|
813
|
+
],
|
|
814
|
+
}),
|
|
815
|
+
createField.text('barcode', 'Barcode', {
|
|
816
|
+
placeholder: '123456789012',
|
|
817
|
+
dependencies: [
|
|
818
|
+
createDependency.showWhen('trackInventory', conditions.isTrue()),
|
|
819
|
+
],
|
|
820
|
+
}),
|
|
821
|
+
]),
|
|
822
|
+
|
|
823
|
+
createSection.card('Marketing & SEO', [
|
|
824
|
+
createField.text('metaTitle', 'Meta Title', {
|
|
825
|
+
placeholder: 'SEO-friendly title',
|
|
826
|
+
gridCols: 2,
|
|
827
|
+
}),
|
|
828
|
+
createField.textarea('metaDescription', 'Meta Description', {
|
|
829
|
+
placeholder: 'SEO-friendly description (150-160 characters)',
|
|
830
|
+
gridCols: 2,
|
|
831
|
+
}),
|
|
832
|
+
createField.array(
|
|
833
|
+
'tags',
|
|
834
|
+
'Product Tags',
|
|
835
|
+
[
|
|
836
|
+
createField.text('tag', 'Tag', {
|
|
837
|
+
required: true,
|
|
838
|
+
placeholder: 'e.g., electronics, gadgets',
|
|
839
|
+
}),
|
|
840
|
+
],
|
|
841
|
+
{ gridCols: 2, defaultValue: [{ tag: '' }] },
|
|
842
|
+
),
|
|
843
|
+
createField.checkbox('featured', 'Featured Product', {
|
|
844
|
+
defaultValue: false,
|
|
845
|
+
}),
|
|
846
|
+
createField.checkbox('newProduct', 'Mark as New', {
|
|
847
|
+
defaultValue: false,
|
|
848
|
+
}),
|
|
849
|
+
createField.select(
|
|
850
|
+
'visibility',
|
|
851
|
+
'Product Visibility',
|
|
852
|
+
[
|
|
853
|
+
{ label: 'Public', value: 'public' },
|
|
854
|
+
{ label: 'Private', value: 'private' },
|
|
855
|
+
{ label: 'Password Protected', value: 'password' },
|
|
856
|
+
{ label: 'Coming Soon', value: 'coming_soon' },
|
|
857
|
+
],
|
|
858
|
+
{
|
|
859
|
+
required: true,
|
|
860
|
+
defaultValue: 'public',
|
|
861
|
+
placeholder: 'Select visibility',
|
|
862
|
+
},
|
|
863
|
+
),
|
|
864
|
+
createField.text('password', 'Access Password', {
|
|
865
|
+
placeholder: 'Enter password',
|
|
866
|
+
dependencies: [
|
|
867
|
+
createDependency.showWhen(
|
|
868
|
+
'visibility',
|
|
869
|
+
conditions.equals('password'),
|
|
870
|
+
),
|
|
871
|
+
],
|
|
872
|
+
}),
|
|
873
|
+
createField.date('launchDate', 'Launch Date', {
|
|
874
|
+
dependencies: [
|
|
875
|
+
createDependency.showWhen(
|
|
876
|
+
'visibility',
|
|
877
|
+
conditions.equals('coming_soon'),
|
|
878
|
+
),
|
|
879
|
+
],
|
|
880
|
+
}),
|
|
881
|
+
]),
|
|
882
|
+
];
|
|
883
|
+
|
|
884
|
+
return (
|
|
885
|
+
<div className="max-w-6xl mx-auto p-6">
|
|
886
|
+
<div className="mb-8">
|
|
887
|
+
<h1 className="text-3xl font-bold text-gray-900">
|
|
888
|
+
Dynamic Product Configuration
|
|
889
|
+
</h1>
|
|
890
|
+
<p className="text-gray-600 mt-2">
|
|
891
|
+
This form demonstrates advanced field dependencies and real-time
|
|
892
|
+
interactions. Watch how fields appear, disappear, and change based
|
|
893
|
+
on your selections.
|
|
894
|
+
</p>
|
|
895
|
+
<div className="mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg">
|
|
896
|
+
<h3 className="font-semibold text-blue-900">
|
|
897
|
+
Try these interactions:
|
|
898
|
+
</h3>
|
|
899
|
+
<ul className="mt-2 text-sm text-blue-800 space-y-1">
|
|
900
|
+
<li>• Change Product Type to see different field sets</li>
|
|
901
|
+
<li>
|
|
902
|
+
• Enable "Apply Discount" to reveal discount configuration
|
|
903
|
+
</li>
|
|
904
|
+
<li>
|
|
905
|
+
• Toggle "Requires Physical Shipping" for shipping options
|
|
906
|
+
</li>
|
|
907
|
+
<li>• Select "Digital Download" to auto-disable shipping</li>
|
|
908
|
+
<li>
|
|
909
|
+
• Choose "Password Protected" visibility for password field
|
|
910
|
+
</li>
|
|
911
|
+
</ul>
|
|
912
|
+
</div>
|
|
913
|
+
</div>
|
|
914
|
+
|
|
915
|
+
<FormBuilder
|
|
916
|
+
sections={sections}
|
|
917
|
+
onSubmit={handleSubmit}
|
|
918
|
+
onFieldChange={handleFieldChange}
|
|
919
|
+
submitLabel="Save Product Configuration"
|
|
920
|
+
resetLabel="Reset All"
|
|
921
|
+
className="space-y-8"
|
|
922
|
+
/>
|
|
923
|
+
</div>
|
|
924
|
+
);
|
|
925
|
+
},
|
|
926
|
+
};
|