@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,435 +1,435 @@
|
|
|
1
|
-
import { memo } from 'react';
|
|
2
|
-
import { cn } from '../../../shadcn/lib/utils';
|
|
3
|
-
import type { SectionBuilderProps, SectionLeaf, SectionNode } from './types';
|
|
4
|
-
import {
|
|
5
|
-
Tabs,
|
|
6
|
-
TabsList,
|
|
7
|
-
TabsTrigger,
|
|
8
|
-
TabsContent,
|
|
9
|
-
} from '../../../shadcn/ui/tabs';
|
|
10
|
-
import SectionContainer from './SectionContainer';
|
|
11
|
-
|
|
12
|
-
// Tailwind-safe literal class maps (1-12)
|
|
13
|
-
const GRID_COLS = {
|
|
14
|
-
base: {
|
|
15
|
-
1: 'grid-cols-1',
|
|
16
|
-
2: 'grid-cols-2',
|
|
17
|
-
3: 'grid-cols-3',
|
|
18
|
-
4: 'grid-cols-4',
|
|
19
|
-
5: 'grid-cols-5',
|
|
20
|
-
6: 'grid-cols-6',
|
|
21
|
-
7: 'grid-cols-7',
|
|
22
|
-
8: 'grid-cols-8',
|
|
23
|
-
9: 'grid-cols-9',
|
|
24
|
-
10: 'grid-cols-10',
|
|
25
|
-
11: 'grid-cols-11',
|
|
26
|
-
12: 'grid-cols-12',
|
|
27
|
-
} as Record<number, string>,
|
|
28
|
-
sm: {
|
|
29
|
-
1: 'sm:grid-cols-1',
|
|
30
|
-
2: 'sm:grid-cols-2',
|
|
31
|
-
3: 'sm:grid-cols-3',
|
|
32
|
-
4: 'sm:grid-cols-4',
|
|
33
|
-
5: 'sm:grid-cols-5',
|
|
34
|
-
6: 'sm:grid-cols-6',
|
|
35
|
-
7: 'sm:grid-cols-7',
|
|
36
|
-
8: 'sm:grid-cols-8',
|
|
37
|
-
9: 'sm:grid-cols-9',
|
|
38
|
-
10: 'sm:grid-cols-10',
|
|
39
|
-
11: 'sm:grid-cols-11',
|
|
40
|
-
12: 'sm:grid-cols-12',
|
|
41
|
-
} as Record<number, string>,
|
|
42
|
-
md: {
|
|
43
|
-
1: 'md:grid-cols-1',
|
|
44
|
-
2: 'md:grid-cols-2',
|
|
45
|
-
3: 'md:grid-cols-3',
|
|
46
|
-
4: 'md:grid-cols-4',
|
|
47
|
-
5: 'md:grid-cols-5',
|
|
48
|
-
6: 'md:grid-cols-6',
|
|
49
|
-
7: 'md:grid-cols-7',
|
|
50
|
-
8: 'md:grid-cols-8',
|
|
51
|
-
9: 'md:grid-cols-9',
|
|
52
|
-
10: 'md:grid-cols-10',
|
|
53
|
-
11: 'md:grid-cols-11',
|
|
54
|
-
12: 'md:grid-cols-12',
|
|
55
|
-
} as Record<number, string>,
|
|
56
|
-
lg: {
|
|
57
|
-
1: 'lg:grid-cols-1',
|
|
58
|
-
2: 'lg:grid-cols-2',
|
|
59
|
-
3: 'lg:grid-cols-3',
|
|
60
|
-
4: 'lg:grid-cols-4',
|
|
61
|
-
5: 'lg:grid-cols-5',
|
|
62
|
-
6: 'lg:grid-cols-6',
|
|
63
|
-
7: 'lg:grid-cols-7',
|
|
64
|
-
8: 'lg:grid-cols-8',
|
|
65
|
-
9: 'lg:grid-cols-9',
|
|
66
|
-
10: 'lg:grid-cols-10',
|
|
67
|
-
11: 'lg:grid-cols-11',
|
|
68
|
-
12: 'lg:grid-cols-12',
|
|
69
|
-
} as Record<number, string>,
|
|
70
|
-
xl: {
|
|
71
|
-
1: 'xl:grid-cols-1',
|
|
72
|
-
2: 'xl:grid-cols-2',
|
|
73
|
-
3: 'xl:grid-cols-3',
|
|
74
|
-
4: 'xl:grid-cols-4',
|
|
75
|
-
5: 'xl:grid-cols-5',
|
|
76
|
-
6: 'xl:grid-cols-6',
|
|
77
|
-
7: 'xl:grid-cols-7',
|
|
78
|
-
8: 'xl:grid-cols-8',
|
|
79
|
-
9: 'xl:grid-cols-9',
|
|
80
|
-
10: 'xl:grid-cols-10',
|
|
81
|
-
11: 'xl:grid-cols-11',
|
|
82
|
-
12: 'xl:grid-cols-12',
|
|
83
|
-
} as Record<number, string>,
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const COL_SPAN = {
|
|
87
|
-
base: {
|
|
88
|
-
1: 'col-span-1',
|
|
89
|
-
2: 'col-span-2',
|
|
90
|
-
3: 'col-span-3',
|
|
91
|
-
4: 'col-span-4',
|
|
92
|
-
5: 'col-span-5',
|
|
93
|
-
6: 'col-span-6',
|
|
94
|
-
7: 'col-span-7',
|
|
95
|
-
8: 'col-span-8',
|
|
96
|
-
9: 'col-span-9',
|
|
97
|
-
10: 'col-span-10',
|
|
98
|
-
11: 'col-span-11',
|
|
99
|
-
12: 'col-span-12',
|
|
100
|
-
} as Record<number, string>,
|
|
101
|
-
sm: {
|
|
102
|
-
1: 'sm:col-span-1',
|
|
103
|
-
2: 'sm:col-span-2',
|
|
104
|
-
3: 'sm:col-span-3',
|
|
105
|
-
4: 'sm:col-span-4',
|
|
106
|
-
5: 'sm:col-span-5',
|
|
107
|
-
6: 'sm:col-span-6',
|
|
108
|
-
7: 'sm:col-span-7',
|
|
109
|
-
8: 'sm:col-span-8',
|
|
110
|
-
9: 'sm:col-span-9',
|
|
111
|
-
10: 'sm:col-span-10',
|
|
112
|
-
11: 'sm:col-span-11',
|
|
113
|
-
12: 'sm:col-span-12',
|
|
114
|
-
} as Record<number, string>,
|
|
115
|
-
md: {
|
|
116
|
-
1: 'md:col-span-1',
|
|
117
|
-
2: 'md:col-span-2',
|
|
118
|
-
3: 'md:col-span-3',
|
|
119
|
-
4: 'md:col-span-4',
|
|
120
|
-
5: 'md:col-span-5',
|
|
121
|
-
6: 'md:col-span-6',
|
|
122
|
-
7: 'md:col-span-7',
|
|
123
|
-
8: 'md:col-span-8',
|
|
124
|
-
9: 'md:col-span-9',
|
|
125
|
-
10: 'md:col-span-10',
|
|
126
|
-
11: 'md:col-span-11',
|
|
127
|
-
12: 'md:col-span-12',
|
|
128
|
-
} as Record<number, string>,
|
|
129
|
-
lg: {
|
|
130
|
-
1: 'lg:col-span-1',
|
|
131
|
-
2: 'lg:col-span-2',
|
|
132
|
-
3: 'lg:col-span-3',
|
|
133
|
-
4: 'lg:col-span-4',
|
|
134
|
-
5: 'lg:col-span-5',
|
|
135
|
-
6: 'lg:col-span-6',
|
|
136
|
-
7: 'lg:col-span-7',
|
|
137
|
-
8: 'lg:col-span-8',
|
|
138
|
-
9: 'lg:col-span-9',
|
|
139
|
-
10: 'lg:col-span-10',
|
|
140
|
-
11: 'lg:col-span-11',
|
|
141
|
-
12: 'lg:col-span-12',
|
|
142
|
-
} as Record<number, string>,
|
|
143
|
-
xl: {
|
|
144
|
-
1: 'xl:col-span-1',
|
|
145
|
-
2: 'xl:col-span-2',
|
|
146
|
-
3: 'xl:col-span-3',
|
|
147
|
-
4: 'xl:col-span-4',
|
|
148
|
-
5: 'xl:col-span-5',
|
|
149
|
-
6: 'xl:col-span-6',
|
|
150
|
-
7: 'xl:col-span-7',
|
|
151
|
-
8: 'xl:col-span-8',
|
|
152
|
-
9: 'xl:col-span-9',
|
|
153
|
-
10: 'xl:col-span-10',
|
|
154
|
-
11: 'xl:col-span-11',
|
|
155
|
-
12: 'xl:col-span-12',
|
|
156
|
-
} as Record<number, string>,
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
function gridClasses(options: SectionNode['grid']): string {
|
|
160
|
-
const cols = options?.cols ?? 1;
|
|
161
|
-
const sm = options?.smCols;
|
|
162
|
-
const md = options?.mdCols;
|
|
163
|
-
const lg = options?.lgCols;
|
|
164
|
-
const xl = options?.xlCols;
|
|
165
|
-
const gap = options?.gap ?? 'gap-4';
|
|
166
|
-
return cn(
|
|
167
|
-
'grid',
|
|
168
|
-
GRID_COLS.base[cols],
|
|
169
|
-
sm ? GRID_COLS.sm[sm] : undefined,
|
|
170
|
-
md ? GRID_COLS.md[md] : undefined,
|
|
171
|
-
lg ? GRID_COLS.lg[lg] : undefined,
|
|
172
|
-
xl ? GRID_COLS.xl[xl] : undefined,
|
|
173
|
-
gap,
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function flexClasses(options: SectionNode['flex']): string {
|
|
178
|
-
const direction = options?.direction ?? 'col';
|
|
179
|
-
const wrap = options?.wrap ? 'flex-wrap' : 'flex-nowrap';
|
|
180
|
-
const gap = options?.gap ?? 'gap-4';
|
|
181
|
-
const align = options?.align ?? 'stretch';
|
|
182
|
-
const justify = options?.justify ?? 'start';
|
|
183
|
-
const alignClass =
|
|
184
|
-
align === 'start'
|
|
185
|
-
? 'items-start'
|
|
186
|
-
: align === 'center'
|
|
187
|
-
? 'items-center'
|
|
188
|
-
: align === 'end'
|
|
189
|
-
? 'items-end'
|
|
190
|
-
: 'items-stretch';
|
|
191
|
-
const justifyClass =
|
|
192
|
-
justify === 'start'
|
|
193
|
-
? 'justify-start'
|
|
194
|
-
: justify === 'center'
|
|
195
|
-
? 'justify-center'
|
|
196
|
-
: justify === 'between'
|
|
197
|
-
? 'justify-between'
|
|
198
|
-
: 'justify-end';
|
|
199
|
-
return cn('flex', `flex-${direction}`, wrap, gap, alignClass, justifyClass);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function leafSpanClasses(leaf: SectionLeaf): string | undefined {
|
|
203
|
-
if (!leaf.span) return undefined;
|
|
204
|
-
const parts: string[] = [];
|
|
205
|
-
if (leaf.span.base) parts.push(COL_SPAN.base[leaf.span.base]);
|
|
206
|
-
if (leaf.span.sm) parts.push(COL_SPAN.sm[leaf.span.sm]);
|
|
207
|
-
if (leaf.span.md) parts.push(COL_SPAN.md[leaf.span.md]);
|
|
208
|
-
if (leaf.span.lg) parts.push(COL_SPAN.lg[leaf.span.lg]);
|
|
209
|
-
if (leaf.span.xl) parts.push(COL_SPAN.xl[leaf.span.xl]);
|
|
210
|
-
return parts.join(' ');
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function isLeaf(child: SectionNode | SectionLeaf): child is SectionLeaf {
|
|
214
|
-
return (child as SectionLeaf).content !== undefined;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function shallowEqualSpan(a?: SectionLeaf['span'], b?: SectionLeaf['span']) {
|
|
218
|
-
if (a === b) return true;
|
|
219
|
-
if (!a || !b) return !a && !b;
|
|
220
|
-
return (
|
|
221
|
-
a.base === b.base &&
|
|
222
|
-
a.sm === b.sm &&
|
|
223
|
-
a.md === b.md &&
|
|
224
|
-
a.lg === b.lg &&
|
|
225
|
-
a.xl === b.xl
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
function isReactElement(value: unknown): boolean {
|
|
230
|
-
return (
|
|
231
|
-
value !== null &&
|
|
232
|
-
typeof value === 'object' &&
|
|
233
|
-
'$$typeof' in (value as object)
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function shallowEqualLeaf(a: SectionLeaf, b: SectionLeaf) {
|
|
238
|
-
// If renderKey is provided, use it for comparison
|
|
239
|
-
if (a.renderKey !== undefined || b.renderKey !== undefined) {
|
|
240
|
-
if ((a.renderKey ?? null) !== (b.renderKey ?? null)) return false;
|
|
241
|
-
} else {
|
|
242
|
-
// No renderKey: if content is a ReactElement, always re-render
|
|
243
|
-
// (JSX creates new object refs each render, so we can't reliably compare)
|
|
244
|
-
if (isReactElement(a.content) || isReactElement(b.content)) {
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
// For primitives (string, number, null, undefined), compare directly
|
|
248
|
-
if (a.content !== b.content) return false;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
return (
|
|
252
|
-
a.key === b.key &&
|
|
253
|
-
a.hidden === b.hidden &&
|
|
254
|
-
a.className === b.className &&
|
|
255
|
-
a.labelLayout === b.labelLayout &&
|
|
256
|
-
a.labelClassName === b.labelClassName &&
|
|
257
|
-
a.valueClassName === b.valueClassName &&
|
|
258
|
-
a.inlineLabelWidthClass === b.inlineLabelWidthClass &&
|
|
259
|
-
shallowEqualSpan(a.span, b.span)
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
const SectionLeafRenderer = memo(
|
|
264
|
-
function SectionLeafRenderer({
|
|
265
|
-
leaf,
|
|
266
|
-
renderLeaf,
|
|
267
|
-
}: {
|
|
268
|
-
leaf: SectionLeaf;
|
|
269
|
-
renderLeaf?: (leaf: SectionLeaf) => React.ReactNode;
|
|
270
|
-
}) {
|
|
271
|
-
if (leaf.hidden) return null;
|
|
272
|
-
const span = leafSpanClasses(leaf);
|
|
273
|
-
|
|
274
|
-
// If a custom renderLeaf is provided, let it fully control rendering
|
|
275
|
-
if (renderLeaf) {
|
|
276
|
-
return <div className={cn(span, leaf.className)}>{renderLeaf(leaf)}</div>;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// Default rendering with optional label support
|
|
280
|
-
const hasLabel =
|
|
281
|
-
leaf.label !== undefined && leaf.label !== null && leaf.label !== '';
|
|
282
|
-
const layout = leaf.labelLayout ?? 'stacked';
|
|
283
|
-
const labelBaseCls = 'text-xs text-muted-foreground';
|
|
284
|
-
const valueBaseCls = 'text-sm leading-6';
|
|
285
|
-
|
|
286
|
-
if (!hasLabel) {
|
|
287
|
-
return (
|
|
288
|
-
<div className={cn(span, leaf.className, leaf.valueClassName)}>
|
|
289
|
-
{leaf.content}
|
|
290
|
-
</div>
|
|
291
|
-
);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
if (layout === 'inline') {
|
|
295
|
-
const labelWidth = leaf.inlineLabelWidthClass ?? 'w-32';
|
|
296
|
-
return (
|
|
297
|
-
<div className={cn(span, leaf.className, 'flex items-start gap-4')}>
|
|
298
|
-
<div className={cn(labelWidth, labelBaseCls, leaf.labelClassName)}>
|
|
299
|
-
{leaf.label}
|
|
300
|
-
</div>
|
|
301
|
-
<div className={cn('flex-1', valueBaseCls, leaf.valueClassName)}>
|
|
302
|
-
{leaf.content}
|
|
303
|
-
{leaf.description ? (
|
|
304
|
-
<div className={cn('mt-1', labelBaseCls)}>{leaf.description}</div>
|
|
305
|
-
) : null}
|
|
306
|
-
</div>
|
|
307
|
-
</div>
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
// Stacked layout
|
|
312
|
-
return (
|
|
313
|
-
<div className={cn(span, leaf.className, 'flex flex-col')}>
|
|
314
|
-
<div className={cn(labelBaseCls, leaf.labelClassName)}>
|
|
315
|
-
{leaf.label}
|
|
316
|
-
</div>
|
|
317
|
-
<div className={cn(valueBaseCls, leaf.valueClassName)}>
|
|
318
|
-
{leaf.content}
|
|
319
|
-
</div>
|
|
320
|
-
{leaf.description ? (
|
|
321
|
-
<div className={cn('mt-1', labelBaseCls)}>{leaf.description}</div>
|
|
322
|
-
) : null}
|
|
323
|
-
</div>
|
|
324
|
-
);
|
|
325
|
-
},
|
|
326
|
-
(prev, next) =>
|
|
327
|
-
shallowEqualLeaf(prev.leaf, next.leaf) &&
|
|
328
|
-
prev.renderLeaf === next.renderLeaf,
|
|
329
|
-
);
|
|
330
|
-
|
|
331
|
-
function SectionNodeRenderer({
|
|
332
|
-
node,
|
|
333
|
-
renderLeaf,
|
|
334
|
-
}: {
|
|
335
|
-
node: SectionNode;
|
|
336
|
-
renderLeaf?: (leaf: SectionLeaf) => React.ReactNode;
|
|
337
|
-
}) {
|
|
338
|
-
if (node.hidden) return null;
|
|
339
|
-
const layout = node.layout ?? 'grid';
|
|
340
|
-
const containerClass =
|
|
341
|
-
layout === 'grid'
|
|
342
|
-
? gridClasses(node.grid)
|
|
343
|
-
: layout === 'flex'
|
|
344
|
-
? flexClasses(node.flex)
|
|
345
|
-
: '';
|
|
346
|
-
|
|
347
|
-
if (layout === 'tabs' && node.tabs && node.tabs.length > 0) {
|
|
348
|
-
const defaultTabId = node.defaultTabId ?? node.tabs[0]?.id;
|
|
349
|
-
return (
|
|
350
|
-
<SectionContainer
|
|
351
|
-
title={node.title}
|
|
352
|
-
description={node.subtitle}
|
|
353
|
-
variant={node.variant}
|
|
354
|
-
className={node.className}
|
|
355
|
-
headerClassName={node.headerClassName}
|
|
356
|
-
contentClassName={node.contentClassName}
|
|
357
|
-
>
|
|
358
|
-
<Tabs defaultValue={defaultTabId} className={cn('space-y-2')}>
|
|
359
|
-
<TabsList className={cn(node.tabsListClassName)}>
|
|
360
|
-
{node.tabs.map((tab) => (
|
|
361
|
-
<TabsTrigger
|
|
362
|
-
key={tab.id}
|
|
363
|
-
value={tab.id}
|
|
364
|
-
className={cn(tab.className)}
|
|
365
|
-
>
|
|
366
|
-
{tab.label}
|
|
367
|
-
</TabsTrigger>
|
|
368
|
-
))}
|
|
369
|
-
</TabsList>
|
|
370
|
-
{node.tabs.map((tab) => (
|
|
371
|
-
<TabsContent
|
|
372
|
-
key={tab.id}
|
|
373
|
-
value={tab.id}
|
|
374
|
-
className={cn(node.tabsContentClassName, tab.contentClassName)}
|
|
375
|
-
>
|
|
376
|
-
<SectionNodeRenderer node={tab.node} renderLeaf={renderLeaf} />
|
|
377
|
-
</TabsContent>
|
|
378
|
-
))}
|
|
379
|
-
</Tabs>
|
|
380
|
-
</SectionContainer>
|
|
381
|
-
);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
return (
|
|
385
|
-
<SectionContainer
|
|
386
|
-
title={node.title}
|
|
387
|
-
description={node.subtitle}
|
|
388
|
-
variant={node.variant}
|
|
389
|
-
className={node.className}
|
|
390
|
-
headerClassName={node.headerClassName}
|
|
391
|
-
contentClassName={node.contentClassName}
|
|
392
|
-
>
|
|
393
|
-
<div className={containerClass}>
|
|
394
|
-
{(node.children ?? []).map((child) => {
|
|
395
|
-
if (isLeaf(child)) {
|
|
396
|
-
return (
|
|
397
|
-
<SectionLeafRenderer
|
|
398
|
-
key={child.key}
|
|
399
|
-
leaf={child}
|
|
400
|
-
renderLeaf={renderLeaf}
|
|
401
|
-
/>
|
|
402
|
-
);
|
|
403
|
-
}
|
|
404
|
-
if ((child as SectionNode).hidden) return null;
|
|
405
|
-
return (
|
|
406
|
-
<div key={(child as SectionNode).id} className="col-span-full">
|
|
407
|
-
<SectionNodeRenderer
|
|
408
|
-
node={child as SectionNode}
|
|
409
|
-
renderLeaf={renderLeaf}
|
|
410
|
-
/>
|
|
411
|
-
</div>
|
|
412
|
-
);
|
|
413
|
-
})}
|
|
414
|
-
</div>
|
|
415
|
-
</SectionContainer>
|
|
416
|
-
);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
export default function SectionBuilder({
|
|
420
|
-
sections,
|
|
421
|
-
className,
|
|
422
|
-
renderLeaf,
|
|
423
|
-
}: SectionBuilderProps) {
|
|
424
|
-
return (
|
|
425
|
-
<div className={cn('space-y-6', className)}>
|
|
426
|
-
{sections.map((section) => (
|
|
427
|
-
<SectionNodeRenderer
|
|
428
|
-
key={section.id}
|
|
429
|
-
node={section}
|
|
430
|
-
renderLeaf={renderLeaf}
|
|
431
|
-
/>
|
|
432
|
-
))}
|
|
433
|
-
</div>
|
|
434
|
-
);
|
|
435
|
-
}
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
import { cn } from '../../../shadcn/lib/utils';
|
|
3
|
+
import type { SectionBuilderProps, SectionLeaf, SectionNode } from './types';
|
|
4
|
+
import {
|
|
5
|
+
Tabs,
|
|
6
|
+
TabsList,
|
|
7
|
+
TabsTrigger,
|
|
8
|
+
TabsContent,
|
|
9
|
+
} from '../../../shadcn/ui/tabs';
|
|
10
|
+
import SectionContainer from './SectionContainer';
|
|
11
|
+
|
|
12
|
+
// Tailwind-safe literal class maps (1-12)
|
|
13
|
+
const GRID_COLS = {
|
|
14
|
+
base: {
|
|
15
|
+
1: 'grid-cols-1',
|
|
16
|
+
2: 'grid-cols-2',
|
|
17
|
+
3: 'grid-cols-3',
|
|
18
|
+
4: 'grid-cols-4',
|
|
19
|
+
5: 'grid-cols-5',
|
|
20
|
+
6: 'grid-cols-6',
|
|
21
|
+
7: 'grid-cols-7',
|
|
22
|
+
8: 'grid-cols-8',
|
|
23
|
+
9: 'grid-cols-9',
|
|
24
|
+
10: 'grid-cols-10',
|
|
25
|
+
11: 'grid-cols-11',
|
|
26
|
+
12: 'grid-cols-12',
|
|
27
|
+
} as Record<number, string>,
|
|
28
|
+
sm: {
|
|
29
|
+
1: 'sm:grid-cols-1',
|
|
30
|
+
2: 'sm:grid-cols-2',
|
|
31
|
+
3: 'sm:grid-cols-3',
|
|
32
|
+
4: 'sm:grid-cols-4',
|
|
33
|
+
5: 'sm:grid-cols-5',
|
|
34
|
+
6: 'sm:grid-cols-6',
|
|
35
|
+
7: 'sm:grid-cols-7',
|
|
36
|
+
8: 'sm:grid-cols-8',
|
|
37
|
+
9: 'sm:grid-cols-9',
|
|
38
|
+
10: 'sm:grid-cols-10',
|
|
39
|
+
11: 'sm:grid-cols-11',
|
|
40
|
+
12: 'sm:grid-cols-12',
|
|
41
|
+
} as Record<number, string>,
|
|
42
|
+
md: {
|
|
43
|
+
1: 'md:grid-cols-1',
|
|
44
|
+
2: 'md:grid-cols-2',
|
|
45
|
+
3: 'md:grid-cols-3',
|
|
46
|
+
4: 'md:grid-cols-4',
|
|
47
|
+
5: 'md:grid-cols-5',
|
|
48
|
+
6: 'md:grid-cols-6',
|
|
49
|
+
7: 'md:grid-cols-7',
|
|
50
|
+
8: 'md:grid-cols-8',
|
|
51
|
+
9: 'md:grid-cols-9',
|
|
52
|
+
10: 'md:grid-cols-10',
|
|
53
|
+
11: 'md:grid-cols-11',
|
|
54
|
+
12: 'md:grid-cols-12',
|
|
55
|
+
} as Record<number, string>,
|
|
56
|
+
lg: {
|
|
57
|
+
1: 'lg:grid-cols-1',
|
|
58
|
+
2: 'lg:grid-cols-2',
|
|
59
|
+
3: 'lg:grid-cols-3',
|
|
60
|
+
4: 'lg:grid-cols-4',
|
|
61
|
+
5: 'lg:grid-cols-5',
|
|
62
|
+
6: 'lg:grid-cols-6',
|
|
63
|
+
7: 'lg:grid-cols-7',
|
|
64
|
+
8: 'lg:grid-cols-8',
|
|
65
|
+
9: 'lg:grid-cols-9',
|
|
66
|
+
10: 'lg:grid-cols-10',
|
|
67
|
+
11: 'lg:grid-cols-11',
|
|
68
|
+
12: 'lg:grid-cols-12',
|
|
69
|
+
} as Record<number, string>,
|
|
70
|
+
xl: {
|
|
71
|
+
1: 'xl:grid-cols-1',
|
|
72
|
+
2: 'xl:grid-cols-2',
|
|
73
|
+
3: 'xl:grid-cols-3',
|
|
74
|
+
4: 'xl:grid-cols-4',
|
|
75
|
+
5: 'xl:grid-cols-5',
|
|
76
|
+
6: 'xl:grid-cols-6',
|
|
77
|
+
7: 'xl:grid-cols-7',
|
|
78
|
+
8: 'xl:grid-cols-8',
|
|
79
|
+
9: 'xl:grid-cols-9',
|
|
80
|
+
10: 'xl:grid-cols-10',
|
|
81
|
+
11: 'xl:grid-cols-11',
|
|
82
|
+
12: 'xl:grid-cols-12',
|
|
83
|
+
} as Record<number, string>,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const COL_SPAN = {
|
|
87
|
+
base: {
|
|
88
|
+
1: 'col-span-1',
|
|
89
|
+
2: 'col-span-2',
|
|
90
|
+
3: 'col-span-3',
|
|
91
|
+
4: 'col-span-4',
|
|
92
|
+
5: 'col-span-5',
|
|
93
|
+
6: 'col-span-6',
|
|
94
|
+
7: 'col-span-7',
|
|
95
|
+
8: 'col-span-8',
|
|
96
|
+
9: 'col-span-9',
|
|
97
|
+
10: 'col-span-10',
|
|
98
|
+
11: 'col-span-11',
|
|
99
|
+
12: 'col-span-12',
|
|
100
|
+
} as Record<number, string>,
|
|
101
|
+
sm: {
|
|
102
|
+
1: 'sm:col-span-1',
|
|
103
|
+
2: 'sm:col-span-2',
|
|
104
|
+
3: 'sm:col-span-3',
|
|
105
|
+
4: 'sm:col-span-4',
|
|
106
|
+
5: 'sm:col-span-5',
|
|
107
|
+
6: 'sm:col-span-6',
|
|
108
|
+
7: 'sm:col-span-7',
|
|
109
|
+
8: 'sm:col-span-8',
|
|
110
|
+
9: 'sm:col-span-9',
|
|
111
|
+
10: 'sm:col-span-10',
|
|
112
|
+
11: 'sm:col-span-11',
|
|
113
|
+
12: 'sm:col-span-12',
|
|
114
|
+
} as Record<number, string>,
|
|
115
|
+
md: {
|
|
116
|
+
1: 'md:col-span-1',
|
|
117
|
+
2: 'md:col-span-2',
|
|
118
|
+
3: 'md:col-span-3',
|
|
119
|
+
4: 'md:col-span-4',
|
|
120
|
+
5: 'md:col-span-5',
|
|
121
|
+
6: 'md:col-span-6',
|
|
122
|
+
7: 'md:col-span-7',
|
|
123
|
+
8: 'md:col-span-8',
|
|
124
|
+
9: 'md:col-span-9',
|
|
125
|
+
10: 'md:col-span-10',
|
|
126
|
+
11: 'md:col-span-11',
|
|
127
|
+
12: 'md:col-span-12',
|
|
128
|
+
} as Record<number, string>,
|
|
129
|
+
lg: {
|
|
130
|
+
1: 'lg:col-span-1',
|
|
131
|
+
2: 'lg:col-span-2',
|
|
132
|
+
3: 'lg:col-span-3',
|
|
133
|
+
4: 'lg:col-span-4',
|
|
134
|
+
5: 'lg:col-span-5',
|
|
135
|
+
6: 'lg:col-span-6',
|
|
136
|
+
7: 'lg:col-span-7',
|
|
137
|
+
8: 'lg:col-span-8',
|
|
138
|
+
9: 'lg:col-span-9',
|
|
139
|
+
10: 'lg:col-span-10',
|
|
140
|
+
11: 'lg:col-span-11',
|
|
141
|
+
12: 'lg:col-span-12',
|
|
142
|
+
} as Record<number, string>,
|
|
143
|
+
xl: {
|
|
144
|
+
1: 'xl:col-span-1',
|
|
145
|
+
2: 'xl:col-span-2',
|
|
146
|
+
3: 'xl:col-span-3',
|
|
147
|
+
4: 'xl:col-span-4',
|
|
148
|
+
5: 'xl:col-span-5',
|
|
149
|
+
6: 'xl:col-span-6',
|
|
150
|
+
7: 'xl:col-span-7',
|
|
151
|
+
8: 'xl:col-span-8',
|
|
152
|
+
9: 'xl:col-span-9',
|
|
153
|
+
10: 'xl:col-span-10',
|
|
154
|
+
11: 'xl:col-span-11',
|
|
155
|
+
12: 'xl:col-span-12',
|
|
156
|
+
} as Record<number, string>,
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
function gridClasses(options: SectionNode['grid']): string {
|
|
160
|
+
const cols = options?.cols ?? 1;
|
|
161
|
+
const sm = options?.smCols;
|
|
162
|
+
const md = options?.mdCols;
|
|
163
|
+
const lg = options?.lgCols;
|
|
164
|
+
const xl = options?.xlCols;
|
|
165
|
+
const gap = options?.gap ?? 'gap-4';
|
|
166
|
+
return cn(
|
|
167
|
+
'grid',
|
|
168
|
+
GRID_COLS.base[cols],
|
|
169
|
+
sm ? GRID_COLS.sm[sm] : undefined,
|
|
170
|
+
md ? GRID_COLS.md[md] : undefined,
|
|
171
|
+
lg ? GRID_COLS.lg[lg] : undefined,
|
|
172
|
+
xl ? GRID_COLS.xl[xl] : undefined,
|
|
173
|
+
gap,
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function flexClasses(options: SectionNode['flex']): string {
|
|
178
|
+
const direction = options?.direction ?? 'col';
|
|
179
|
+
const wrap = options?.wrap ? 'flex-wrap' : 'flex-nowrap';
|
|
180
|
+
const gap = options?.gap ?? 'gap-4';
|
|
181
|
+
const align = options?.align ?? 'stretch';
|
|
182
|
+
const justify = options?.justify ?? 'start';
|
|
183
|
+
const alignClass =
|
|
184
|
+
align === 'start'
|
|
185
|
+
? 'items-start'
|
|
186
|
+
: align === 'center'
|
|
187
|
+
? 'items-center'
|
|
188
|
+
: align === 'end'
|
|
189
|
+
? 'items-end'
|
|
190
|
+
: 'items-stretch';
|
|
191
|
+
const justifyClass =
|
|
192
|
+
justify === 'start'
|
|
193
|
+
? 'justify-start'
|
|
194
|
+
: justify === 'center'
|
|
195
|
+
? 'justify-center'
|
|
196
|
+
: justify === 'between'
|
|
197
|
+
? 'justify-between'
|
|
198
|
+
: 'justify-end';
|
|
199
|
+
return cn('flex', `flex-${direction}`, wrap, gap, alignClass, justifyClass);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function leafSpanClasses(leaf: SectionLeaf): string | undefined {
|
|
203
|
+
if (!leaf.span) return undefined;
|
|
204
|
+
const parts: string[] = [];
|
|
205
|
+
if (leaf.span.base) parts.push(COL_SPAN.base[leaf.span.base]);
|
|
206
|
+
if (leaf.span.sm) parts.push(COL_SPAN.sm[leaf.span.sm]);
|
|
207
|
+
if (leaf.span.md) parts.push(COL_SPAN.md[leaf.span.md]);
|
|
208
|
+
if (leaf.span.lg) parts.push(COL_SPAN.lg[leaf.span.lg]);
|
|
209
|
+
if (leaf.span.xl) parts.push(COL_SPAN.xl[leaf.span.xl]);
|
|
210
|
+
return parts.join(' ');
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function isLeaf(child: SectionNode | SectionLeaf): child is SectionLeaf {
|
|
214
|
+
return (child as SectionLeaf).content !== undefined;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function shallowEqualSpan(a?: SectionLeaf['span'], b?: SectionLeaf['span']) {
|
|
218
|
+
if (a === b) return true;
|
|
219
|
+
if (!a || !b) return !a && !b;
|
|
220
|
+
return (
|
|
221
|
+
a.base === b.base &&
|
|
222
|
+
a.sm === b.sm &&
|
|
223
|
+
a.md === b.md &&
|
|
224
|
+
a.lg === b.lg &&
|
|
225
|
+
a.xl === b.xl
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function isReactElement(value: unknown): boolean {
|
|
230
|
+
return (
|
|
231
|
+
value !== null &&
|
|
232
|
+
typeof value === 'object' &&
|
|
233
|
+
'$$typeof' in (value as object)
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function shallowEqualLeaf(a: SectionLeaf, b: SectionLeaf) {
|
|
238
|
+
// If renderKey is provided, use it for comparison
|
|
239
|
+
if (a.renderKey !== undefined || b.renderKey !== undefined) {
|
|
240
|
+
if ((a.renderKey ?? null) !== (b.renderKey ?? null)) return false;
|
|
241
|
+
} else {
|
|
242
|
+
// No renderKey: if content is a ReactElement, always re-render
|
|
243
|
+
// (JSX creates new object refs each render, so we can't reliably compare)
|
|
244
|
+
if (isReactElement(a.content) || isReactElement(b.content)) {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
// For primitives (string, number, null, undefined), compare directly
|
|
248
|
+
if (a.content !== b.content) return false;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return (
|
|
252
|
+
a.key === b.key &&
|
|
253
|
+
a.hidden === b.hidden &&
|
|
254
|
+
a.className === b.className &&
|
|
255
|
+
a.labelLayout === b.labelLayout &&
|
|
256
|
+
a.labelClassName === b.labelClassName &&
|
|
257
|
+
a.valueClassName === b.valueClassName &&
|
|
258
|
+
a.inlineLabelWidthClass === b.inlineLabelWidthClass &&
|
|
259
|
+
shallowEqualSpan(a.span, b.span)
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const SectionLeafRenderer = memo(
|
|
264
|
+
function SectionLeafRenderer({
|
|
265
|
+
leaf,
|
|
266
|
+
renderLeaf,
|
|
267
|
+
}: {
|
|
268
|
+
leaf: SectionLeaf;
|
|
269
|
+
renderLeaf?: (leaf: SectionLeaf) => React.ReactNode;
|
|
270
|
+
}) {
|
|
271
|
+
if (leaf.hidden) return null;
|
|
272
|
+
const span = leafSpanClasses(leaf);
|
|
273
|
+
|
|
274
|
+
// If a custom renderLeaf is provided, let it fully control rendering
|
|
275
|
+
if (renderLeaf) {
|
|
276
|
+
return <div className={cn(span, leaf.className)}>{renderLeaf(leaf)}</div>;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Default rendering with optional label support
|
|
280
|
+
const hasLabel =
|
|
281
|
+
leaf.label !== undefined && leaf.label !== null && leaf.label !== '';
|
|
282
|
+
const layout = leaf.labelLayout ?? 'stacked';
|
|
283
|
+
const labelBaseCls = 'text-xs text-muted-foreground';
|
|
284
|
+
const valueBaseCls = 'text-sm leading-6';
|
|
285
|
+
|
|
286
|
+
if (!hasLabel) {
|
|
287
|
+
return (
|
|
288
|
+
<div className={cn(span, leaf.className, leaf.valueClassName)}>
|
|
289
|
+
{leaf.content}
|
|
290
|
+
</div>
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (layout === 'inline') {
|
|
295
|
+
const labelWidth = leaf.inlineLabelWidthClass ?? 'w-32';
|
|
296
|
+
return (
|
|
297
|
+
<div className={cn(span, leaf.className, 'flex items-start gap-4')}>
|
|
298
|
+
<div className={cn(labelWidth, labelBaseCls, leaf.labelClassName)}>
|
|
299
|
+
{leaf.label}
|
|
300
|
+
</div>
|
|
301
|
+
<div className={cn('flex-1', valueBaseCls, leaf.valueClassName)}>
|
|
302
|
+
{leaf.content}
|
|
303
|
+
{leaf.description ? (
|
|
304
|
+
<div className={cn('mt-1', labelBaseCls)}>{leaf.description}</div>
|
|
305
|
+
) : null}
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Stacked layout
|
|
312
|
+
return (
|
|
313
|
+
<div className={cn(span, leaf.className, 'flex flex-col')}>
|
|
314
|
+
<div className={cn(labelBaseCls, leaf.labelClassName)}>
|
|
315
|
+
{leaf.label}
|
|
316
|
+
</div>
|
|
317
|
+
<div className={cn(valueBaseCls, leaf.valueClassName)}>
|
|
318
|
+
{leaf.content}
|
|
319
|
+
</div>
|
|
320
|
+
{leaf.description ? (
|
|
321
|
+
<div className={cn('mt-1', labelBaseCls)}>{leaf.description}</div>
|
|
322
|
+
) : null}
|
|
323
|
+
</div>
|
|
324
|
+
);
|
|
325
|
+
},
|
|
326
|
+
(prev, next) =>
|
|
327
|
+
shallowEqualLeaf(prev.leaf, next.leaf) &&
|
|
328
|
+
prev.renderLeaf === next.renderLeaf,
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
function SectionNodeRenderer({
|
|
332
|
+
node,
|
|
333
|
+
renderLeaf,
|
|
334
|
+
}: {
|
|
335
|
+
node: SectionNode;
|
|
336
|
+
renderLeaf?: (leaf: SectionLeaf) => React.ReactNode;
|
|
337
|
+
}) {
|
|
338
|
+
if (node.hidden) return null;
|
|
339
|
+
const layout = node.layout ?? 'grid';
|
|
340
|
+
const containerClass =
|
|
341
|
+
layout === 'grid'
|
|
342
|
+
? gridClasses(node.grid)
|
|
343
|
+
: layout === 'flex'
|
|
344
|
+
? flexClasses(node.flex)
|
|
345
|
+
: '';
|
|
346
|
+
|
|
347
|
+
if (layout === 'tabs' && node.tabs && node.tabs.length > 0) {
|
|
348
|
+
const defaultTabId = node.defaultTabId ?? node.tabs[0]?.id;
|
|
349
|
+
return (
|
|
350
|
+
<SectionContainer
|
|
351
|
+
title={node.title}
|
|
352
|
+
description={node.subtitle}
|
|
353
|
+
variant={node.variant}
|
|
354
|
+
className={node.className}
|
|
355
|
+
headerClassName={node.headerClassName}
|
|
356
|
+
contentClassName={node.contentClassName}
|
|
357
|
+
>
|
|
358
|
+
<Tabs defaultValue={defaultTabId} className={cn('space-y-2')}>
|
|
359
|
+
<TabsList className={cn(node.tabsListClassName)}>
|
|
360
|
+
{node.tabs.map((tab) => (
|
|
361
|
+
<TabsTrigger
|
|
362
|
+
key={tab.id}
|
|
363
|
+
value={tab.id}
|
|
364
|
+
className={cn(tab.className)}
|
|
365
|
+
>
|
|
366
|
+
{tab.label}
|
|
367
|
+
</TabsTrigger>
|
|
368
|
+
))}
|
|
369
|
+
</TabsList>
|
|
370
|
+
{node.tabs.map((tab) => (
|
|
371
|
+
<TabsContent
|
|
372
|
+
key={tab.id}
|
|
373
|
+
value={tab.id}
|
|
374
|
+
className={cn(node.tabsContentClassName, tab.contentClassName)}
|
|
375
|
+
>
|
|
376
|
+
<SectionNodeRenderer node={tab.node} renderLeaf={renderLeaf} />
|
|
377
|
+
</TabsContent>
|
|
378
|
+
))}
|
|
379
|
+
</Tabs>
|
|
380
|
+
</SectionContainer>
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
return (
|
|
385
|
+
<SectionContainer
|
|
386
|
+
title={node.title}
|
|
387
|
+
description={node.subtitle}
|
|
388
|
+
variant={node.variant}
|
|
389
|
+
className={node.className}
|
|
390
|
+
headerClassName={node.headerClassName}
|
|
391
|
+
contentClassName={node.contentClassName}
|
|
392
|
+
>
|
|
393
|
+
<div className={containerClass}>
|
|
394
|
+
{(node.children ?? []).map((child) => {
|
|
395
|
+
if (isLeaf(child)) {
|
|
396
|
+
return (
|
|
397
|
+
<SectionLeafRenderer
|
|
398
|
+
key={child.key}
|
|
399
|
+
leaf={child}
|
|
400
|
+
renderLeaf={renderLeaf}
|
|
401
|
+
/>
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
if ((child as SectionNode).hidden) return null;
|
|
405
|
+
return (
|
|
406
|
+
<div key={(child as SectionNode).id} className="col-span-full">
|
|
407
|
+
<SectionNodeRenderer
|
|
408
|
+
node={child as SectionNode}
|
|
409
|
+
renderLeaf={renderLeaf}
|
|
410
|
+
/>
|
|
411
|
+
</div>
|
|
412
|
+
);
|
|
413
|
+
})}
|
|
414
|
+
</div>
|
|
415
|
+
</SectionContainer>
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export default function SectionBuilder({
|
|
420
|
+
sections,
|
|
421
|
+
className,
|
|
422
|
+
renderLeaf,
|
|
423
|
+
}: SectionBuilderProps) {
|
|
424
|
+
return (
|
|
425
|
+
<div className={cn('space-y-6', className)}>
|
|
426
|
+
{sections.map((section) => (
|
|
427
|
+
<SectionNodeRenderer
|
|
428
|
+
key={section.id}
|
|
429
|
+
node={section}
|
|
430
|
+
renderLeaf={renderLeaf}
|
|
431
|
+
/>
|
|
432
|
+
))}
|
|
433
|
+
</div>
|
|
434
|
+
);
|
|
435
|
+
}
|