@k3-tech/react-kit 0.0.72 → 0.0.73
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/dist/index.js +1 -1
- package/package.json +5 -1
- package/.babelrc +0 -12
- package/.storybook/main.ts +0 -22
- package/.storybook/preview.ts +0 -198
- package/Dockerfile.storybook +0 -43
- package/biome.json +0 -10
- package/components.json +0 -20
- package/dist/chunks/index.js +0 -5168
- package/dist/chunks/ort.bundle.min.js +0 -4
- package/dist/chunks/ort.webgpu.bundle.min.js +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/kit/builder/auth/components/Can.d.ts.map +0 -1
- package/dist/kit/builder/auth/components/RequireAuth.d.ts.map +0 -1
- package/dist/kit/builder/auth/components/ShowWhenAuthenticated.d.ts.map +0 -1
- package/dist/kit/builder/auth/components/ShowWhenError.d.ts.map +0 -1
- package/dist/kit/builder/auth/components/ShowWhenLoading.d.ts.map +0 -1
- package/dist/kit/builder/auth/components/ShowWhenUnauthenticated.d.ts.map +0 -1
- package/dist/kit/builder/auth/components/withPermission.d.ts.map +0 -1
- package/dist/kit/builder/auth/hooks/action-hooks.d.ts.map +0 -1
- package/dist/kit/builder/auth/hooks/core-hooks.d.ts.map +0 -1
- package/dist/kit/builder/auth/hooks/index.d.ts.map +0 -1
- package/dist/kit/builder/auth/hooks/permission-hooks.d.ts.map +0 -1
- package/dist/kit/builder/auth/hooks/token-hooks.d.ts.map +0 -1
- package/dist/kit/builder/auth/index.d.ts.map +0 -1
- package/dist/kit/builder/auth/providers/AuthProvider.d.ts.map +0 -1
- package/dist/kit/builder/auth/types/adapter-config.d.ts.map +0 -1
- package/dist/kit/builder/auth/types/adapter.d.ts.map +0 -1
- package/dist/kit/builder/auth/types/core.d.ts.map +0 -1
- package/dist/kit/builder/auth/types/index.d.ts.map +0 -1
- package/dist/kit/builder/auth/types/middleware.d.ts.map +0 -1
- package/dist/kit/builder/auth/types/permissions.d.ts.map +0 -1
- package/dist/kit/builder/auth/types/state.d.ts.map +0 -1
- package/dist/kit/builder/auth/types/storage.d.ts.map +0 -1
- package/dist/kit/builder/auth/types/token-manager.d.ts.map +0 -1
- package/dist/kit/builder/auth/types/utils.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/auth-adapter.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/client-adapters/apollo-link.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/client-adapters/axios.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/client-adapters/fetch.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/client-adapters/graphql.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/client-adapters/index.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/client-adapters/rest.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/client-adapters/urql-exchange.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/permission-checker.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/storage/browser.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/storage/cookie.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/storage/encryption.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/storage/env.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/storage/factory.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/storage/index.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/storage/memory.d.ts.map +0 -1
- package/dist/kit/builder/auth/utils/token-manager.d.ts.map +0 -1
- package/dist/kit/builder/data-table/components/DataTable.d.ts.map +0 -1
- package/dist/kit/builder/data-table/components/DataTableColumnHeader.d.ts.map +0 -1
- package/dist/kit/builder/data-table/components/DataTableFilterPanel.d.ts.map +0 -1
- package/dist/kit/builder/data-table/components/DataTablePagination.d.ts.map +0 -1
- package/dist/kit/builder/data-table/components/DataTableViewOptions.d.ts.map +0 -1
- package/dist/kit/builder/data-table/index.d.ts.map +0 -1
- package/dist/kit/builder/data-table/types.d.ts.map +0 -1
- package/dist/kit/builder/data-table/utils/dotAccessor.d.ts.map +0 -1
- package/dist/kit/builder/dialog/index.d.ts.map +0 -1
- package/dist/kit/builder/dialog/provider.d.ts.map +0 -1
- package/dist/kit/builder/form/components/FormBuilder.d.ts.map +0 -1
- package/dist/kit/builder/form/components/FormBuilderActions.d.ts.map +0 -1
- package/dist/kit/builder/form/components/FormBuilderContext.d.ts.map +0 -1
- package/dist/kit/builder/form/components/FormBuilderField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/ArrayField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/AutocompleteField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/CheckboxField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/DateField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/DatePickerField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/DateRangePickerField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/DateTimePickerField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/DateTimeRangePickerField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/FileField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/MonthPickerField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/MonthRangePickerField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/NumberField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/ObjectField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/RadioField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/SelectField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/SwitchField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/TextField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/TextareaField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/TimePickerField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/TimeRangePickerField.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/index.d.ts.map +0 -1
- package/dist/kit/builder/form/components/fields/types.d.ts.map +0 -1
- package/dist/kit/builder/form/components/index.d.ts.map +0 -1
- package/dist/kit/builder/form/components/sectionNodes.d.ts.map +0 -1
- package/dist/kit/builder/form/hooks/useFormBuilder.d.ts.map +0 -1
- package/dist/kit/builder/form/index.d.ts.map +0 -1
- package/dist/kit/builder/form/types.d.ts.map +0 -1
- package/dist/kit/builder/form/utils/common-forms.d.ts.map +0 -1
- package/dist/kit/builder/form/utils/dependencies.d.ts.map +0 -1
- package/dist/kit/builder/form/utils/field-factories.d.ts.map +0 -1
- package/dist/kit/builder/form/utils/index.d.ts.map +0 -1
- package/dist/kit/builder/form/utils/section-factories.d.ts.map +0 -1
- package/dist/kit/builder/form/utils/transformers.d.ts.map +0 -1
- package/dist/kit/builder/form/utils/validations.d.ts.map +0 -1
- package/dist/kit/builder/form/utils/validators.d.ts.map +0 -1
- package/dist/kit/builder/page/Page.d.ts.map +0 -1
- package/dist/kit/builder/page/PageBackButton.d.ts.map +0 -1
- package/dist/kit/builder/page/index.d.ts.map +0 -1
- package/dist/kit/builder/section/SectionBuilder.d.ts.map +0 -1
- package/dist/kit/builder/section/SectionContainer.d.ts.map +0 -1
- package/dist/kit/builder/section/index.d.ts.map +0 -1
- package/dist/kit/builder/section/types.d.ts.map +0 -1
- package/dist/kit/builder/stack-dialog/context.d.ts.map +0 -1
- package/dist/kit/builder/stack-dialog/hooks.d.ts.map +0 -1
- package/dist/kit/builder/stack-dialog/index.d.ts.map +0 -1
- package/dist/kit/builder/stack-dialog/provider.d.ts.map +0 -1
- package/dist/kit/builder/stack-dialog/renderer.d.ts.map +0 -1
- package/dist/kit/builder/stack-dialog/types.d.ts.map +0 -1
- package/dist/kit/components/autocomplete/Autocomplete.d.ts.map +0 -1
- package/dist/kit/components/autocomplete/index.d.ts.map +0 -1
- package/dist/kit/components/autocomplete/types.d.ts.map +0 -1
- package/dist/kit/components/data-table-headers/DataTableHeader.d.ts.map +0 -1
- package/dist/kit/components/data-table-headers/DebouncedFilterField.d.ts.map +0 -1
- package/dist/kit/components/data-table-headers/FilterFieldRenderer.d.ts.map +0 -1
- package/dist/kit/components/data-table-headers/index.d.ts.map +0 -1
- package/dist/kit/components/data-table-headers/types.d.ts.map +0 -1
- package/dist/kit/components/data-table-headers/urlSerialization.d.ts.map +0 -1
- package/dist/kit/components/data-table-headers/useDataTableHeaderUrl.d.ts.map +0 -1
- package/dist/kit/components/datepicker/DatePicker.d.ts.map +0 -1
- package/dist/kit/components/datepicker/DateRangePicker.d.ts.map +0 -1
- package/dist/kit/components/datepicker/index.d.ts.map +0 -1
- package/dist/kit/components/datetimepicker/DateTimePicker.d.ts.map +0 -1
- package/dist/kit/components/datetimepicker/DateTimeRangePicker.d.ts.map +0 -1
- package/dist/kit/components/datetimepicker/index.d.ts.map +0 -1
- package/dist/kit/components/fileuploader/FileUploader.d.ts.map +0 -1
- package/dist/kit/components/fileuploader/image-preprocess.d.ts.map +0 -1
- package/dist/kit/components/fileuploader/index.d.ts.map +0 -1
- package/dist/kit/components/fileuploader/types.d.ts.map +0 -1
- package/dist/kit/components/forminfo/FormInfoError.d.ts.map +0 -1
- package/dist/kit/components/forminfo/index.d.ts.map +0 -1
- package/dist/kit/components/info-tooltip/InfoTooltip.d.ts.map +0 -1
- package/dist/kit/components/keyboard/Keyboard.d.ts.map +0 -1
- package/dist/kit/components/keyboard/index.d.ts.map +0 -1
- package/dist/kit/components/login/Login.d.ts.map +0 -1
- package/dist/kit/components/login/index.d.ts.map +0 -1
- package/dist/kit/components/monthpicker/MonthInput.d.ts.map +0 -1
- package/dist/kit/components/monthpicker/MonthPicker.d.ts.map +0 -1
- package/dist/kit/components/monthpicker/MonthRangeInput.d.ts.map +0 -1
- package/dist/kit/components/monthpicker/MonthRangePicker.d.ts.map +0 -1
- package/dist/kit/components/numpad/Numpad.d.ts.map +0 -1
- package/dist/kit/components/numpad/index.d.ts.map +0 -1
- package/dist/kit/components/timepicker/TimePicker.d.ts.map +0 -1
- package/dist/kit/components/timepicker/TimeRangePicker.d.ts.map +0 -1
- package/dist/kit/components/timepicker/index.d.ts.map +0 -1
- package/dist/kit/layouts/admin/components/AdminLayout.d.ts.map +0 -1
- package/dist/kit/layouts/admin/components/ThemeToggle.d.ts.map +0 -1
- package/dist/kit/layouts/admin/hooks/menu.d.ts.map +0 -1
- package/dist/kit/layouts/admin/providers/AdminMenuProvider.d.ts.map +0 -1
- package/dist/kit/layouts/admin/types/index.d.ts.map +0 -1
- package/dist/kit/providers/ThemeProvider.d.ts.map +0 -1
- package/dist/shadcn/hooks/use-mobile.d.ts.map +0 -1
- package/dist/shadcn/lib/utils.d.ts.map +0 -1
- package/dist/shadcn/ui/accordion.d.ts.map +0 -1
- package/dist/shadcn/ui/alert-dialog.d.ts.map +0 -1
- package/dist/shadcn/ui/alert.d.ts.map +0 -1
- package/dist/shadcn/ui/aspect-ratio.d.ts.map +0 -1
- package/dist/shadcn/ui/avatar.d.ts.map +0 -1
- package/dist/shadcn/ui/badge.d.ts.map +0 -1
- package/dist/shadcn/ui/breadcrumb.d.ts.map +0 -1
- package/dist/shadcn/ui/button.d.ts.map +0 -1
- package/dist/shadcn/ui/calendar.d.ts.map +0 -1
- package/dist/shadcn/ui/card.d.ts.map +0 -1
- package/dist/shadcn/ui/carousel.d.ts.map +0 -1
- package/dist/shadcn/ui/chart.d.ts.map +0 -1
- package/dist/shadcn/ui/checkbox.d.ts.map +0 -1
- package/dist/shadcn/ui/collapsible.d.ts.map +0 -1
- package/dist/shadcn/ui/command.d.ts.map +0 -1
- package/dist/shadcn/ui/context-menu.d.ts.map +0 -1
- package/dist/shadcn/ui/dialog.d.ts.map +0 -1
- package/dist/shadcn/ui/drawer.d.ts.map +0 -1
- package/dist/shadcn/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/shadcn/ui/form.d.ts.map +0 -1
- package/dist/shadcn/ui/hover-card.d.ts.map +0 -1
- package/dist/shadcn/ui/input-otp.d.ts.map +0 -1
- package/dist/shadcn/ui/input.d.ts.map +0 -1
- package/dist/shadcn/ui/label.d.ts.map +0 -1
- package/dist/shadcn/ui/menubar.d.ts.map +0 -1
- package/dist/shadcn/ui/navigation-menu.d.ts.map +0 -1
- package/dist/shadcn/ui/pagination.d.ts.map +0 -1
- package/dist/shadcn/ui/popover.d.ts.map +0 -1
- package/dist/shadcn/ui/progress.d.ts.map +0 -1
- package/dist/shadcn/ui/radio-group.d.ts.map +0 -1
- package/dist/shadcn/ui/resizable.d.ts.map +0 -1
- package/dist/shadcn/ui/scroll-area.d.ts.map +0 -1
- package/dist/shadcn/ui/select.d.ts.map +0 -1
- package/dist/shadcn/ui/separator.d.ts.map +0 -1
- package/dist/shadcn/ui/sheet.d.ts.map +0 -1
- package/dist/shadcn/ui/sidebar.d.ts.map +0 -1
- package/dist/shadcn/ui/skeleton.d.ts.map +0 -1
- package/dist/shadcn/ui/slider.d.ts.map +0 -1
- package/dist/shadcn/ui/sonner.d.ts.map +0 -1
- package/dist/shadcn/ui/switch.d.ts.map +0 -1
- package/dist/shadcn/ui/table.d.ts.map +0 -1
- package/dist/shadcn/ui/tabs.d.ts.map +0 -1
- package/dist/shadcn/ui/textarea.d.ts.map +0 -1
- package/dist/shadcn/ui/toggle-group.d.ts.map +0 -1
- package/dist/shadcn/ui/toggle.d.ts.map +0 -1
- package/dist/shadcn/ui/tooltip.d.ts.map +0 -1
- package/src/index.ts +0 -100
- package/src/kit/builder/auth/components/Can.tsx +0 -27
- package/src/kit/builder/auth/components/RequireAuth.tsx +0 -78
- package/src/kit/builder/auth/components/ShowWhenAuthenticated.tsx +0 -10
- package/src/kit/builder/auth/components/ShowWhenError.tsx +0 -10
- package/src/kit/builder/auth/components/ShowWhenLoading.tsx +0 -10
- package/src/kit/builder/auth/components/ShowWhenUnauthenticated.tsx +0 -10
- package/src/kit/builder/auth/components/withPermission.tsx +0 -23
- package/src/kit/builder/auth/hooks/action-hooks.ts +0 -34
- package/src/kit/builder/auth/hooks/core-hooks.ts +0 -65
- package/src/kit/builder/auth/hooks/index.ts +0 -4
- package/src/kit/builder/auth/hooks/permission-hooks.ts +0 -43
- package/src/kit/builder/auth/hooks/token-hooks.ts +0 -25
- package/src/kit/builder/auth/index.ts +0 -132
- package/src/kit/builder/auth/providers/AuthProvider.tsx +0 -131
- package/src/kit/builder/auth/types/adapter-config.ts +0 -44
- package/src/kit/builder/auth/types/adapter.ts +0 -132
- package/src/kit/builder/auth/types/core.ts +0 -27
- package/src/kit/builder/auth/types/index.ts +0 -9
- package/src/kit/builder/auth/types/middleware.ts +0 -20
- package/src/kit/builder/auth/types/permissions.ts +0 -23
- package/src/kit/builder/auth/types/state.ts +0 -16
- package/src/kit/builder/auth/types/storage.ts +0 -21
- package/src/kit/builder/auth/types/token-manager.ts +0 -9
- package/src/kit/builder/auth/types/utils.ts +0 -55
- package/src/kit/builder/auth/utils/auth-adapter.ts +0 -437
- package/src/kit/builder/auth/utils/client-adapters/apollo-link.ts +0 -30
- package/src/kit/builder/auth/utils/client-adapters/axios.ts +0 -61
- package/src/kit/builder/auth/utils/client-adapters/fetch.ts +0 -48
- package/src/kit/builder/auth/utils/client-adapters/graphql.ts +0 -60
- package/src/kit/builder/auth/utils/client-adapters/index.ts +0 -6
- package/src/kit/builder/auth/utils/client-adapters/rest.ts +0 -60
- package/src/kit/builder/auth/utils/client-adapters/urql-exchange.ts +0 -76
- package/src/kit/builder/auth/utils/permission-checker.ts +0 -150
- package/src/kit/builder/auth/utils/storage/browser.ts +0 -99
- package/src/kit/builder/auth/utils/storage/cookie.ts +0 -116
- package/src/kit/builder/auth/utils/storage/encryption.ts +0 -80
- package/src/kit/builder/auth/utils/storage/env.ts +0 -2
- package/src/kit/builder/auth/utils/storage/factory.ts +0 -37
- package/src/kit/builder/auth/utils/storage/index.ts +0 -6
- package/src/kit/builder/auth/utils/storage/memory.ts +0 -15
- package/src/kit/builder/auth/utils/token-manager.ts +0 -55
- package/src/kit/builder/data-table/components/DataTable.tsx +0 -662
- package/src/kit/builder/data-table/components/DataTableColumnHeader.tsx +0 -67
- package/src/kit/builder/data-table/components/DataTableFilterPanel.tsx +0 -160
- package/src/kit/builder/data-table/components/DataTablePagination.tsx +0 -135
- package/src/kit/builder/data-table/components/DataTableViewOptions.tsx +0 -51
- package/src/kit/builder/data-table/index.ts +0 -6
- package/src/kit/builder/data-table/types.ts +0 -44
- package/src/kit/builder/data-table/utils/dotAccessor.ts +0 -6
- package/src/kit/builder/dialog/index.ts +0 -6
- package/src/kit/builder/dialog/provider.tsx +0 -170
- package/src/kit/builder/form/components/FormBuilder.tsx +0 -333
- package/src/kit/builder/form/components/FormBuilderActions.tsx +0 -78
- package/src/kit/builder/form/components/FormBuilderContext.tsx +0 -52
- package/src/kit/builder/form/components/FormBuilderField.tsx +0 -476
- package/src/kit/builder/form/components/fields/ArrayField.tsx +0 -312
- package/src/kit/builder/form/components/fields/AutocompleteField.tsx +0 -99
- package/src/kit/builder/form/components/fields/CheckboxField.tsx +0 -78
- package/src/kit/builder/form/components/fields/DateField.tsx +0 -55
- package/src/kit/builder/form/components/fields/DatePickerField.tsx +0 -48
- package/src/kit/builder/form/components/fields/DateRangePickerField.tsx +0 -72
- package/src/kit/builder/form/components/fields/DateTimePickerField.tsx +0 -55
- package/src/kit/builder/form/components/fields/DateTimeRangePickerField.tsx +0 -65
- package/src/kit/builder/form/components/fields/FileField.tsx +0 -38
- package/src/kit/builder/form/components/fields/MonthPickerField.tsx +0 -34
- package/src/kit/builder/form/components/fields/MonthRangePickerField.tsx +0 -42
- package/src/kit/builder/form/components/fields/NumberField.tsx +0 -88
- package/src/kit/builder/form/components/fields/ObjectField.tsx +0 -35
- package/src/kit/builder/form/components/fields/RadioField.tsx +0 -48
- package/src/kit/builder/form/components/fields/SelectField.tsx +0 -47
- package/src/kit/builder/form/components/fields/SwitchField.tsx +0 -76
- package/src/kit/builder/form/components/fields/TextField.tsx +0 -26
- package/src/kit/builder/form/components/fields/TextareaField.tsx +0 -21
- package/src/kit/builder/form/components/fields/TimePickerField.tsx +0 -36
- package/src/kit/builder/form/components/fields/TimeRangePickerField.tsx +0 -44
- package/src/kit/builder/form/components/fields/index.ts +0 -21
- package/src/kit/builder/form/components/fields/types.ts +0 -18
- package/src/kit/builder/form/components/index.ts +0 -3
- package/src/kit/builder/form/components/sectionNodes.tsx +0 -148
- package/src/kit/builder/form/hooks/useFormBuilder.ts +0 -457
- package/src/kit/builder/form/index.ts +0 -4
- package/src/kit/builder/form/types.ts +0 -294
- package/src/kit/builder/form/utils/common-forms.ts +0 -68
- package/src/kit/builder/form/utils/dependencies.ts +0 -56
- package/src/kit/builder/form/utils/field-factories.ts +0 -177
- package/src/kit/builder/form/utils/index.ts +0 -17
- package/src/kit/builder/form/utils/section-factories.ts +0 -38
- package/src/kit/builder/form/utils/transformers.ts +0 -100
- package/src/kit/builder/form/utils/validations.ts +0 -22
- package/src/kit/builder/form/utils/validators.ts +0 -20
- package/src/kit/builder/page/Page.tsx +0 -205
- package/src/kit/builder/page/PageBackButton.tsx +0 -52
- package/src/kit/builder/page/index.ts +0 -1
- package/src/kit/builder/section/SectionBuilder.tsx +0 -443
- package/src/kit/builder/section/SectionContainer.tsx +0 -85
- package/src/kit/builder/section/index.ts +0 -2
- package/src/kit/builder/section/types.ts +0 -83
- package/src/kit/builder/stack-dialog/context.ts +0 -15
- package/src/kit/builder/stack-dialog/hooks.ts +0 -13
- package/src/kit/builder/stack-dialog/index.ts +0 -12
- package/src/kit/builder/stack-dialog/provider.tsx +0 -51
- package/src/kit/builder/stack-dialog/renderer.tsx +0 -36
- package/src/kit/builder/stack-dialog/types.ts +0 -34
- package/src/kit/components/autocomplete/Autocomplete.tsx +0 -732
- package/src/kit/components/autocomplete/index.ts +0 -3
- package/src/kit/components/autocomplete/types.ts +0 -27
- package/src/kit/components/data-table-headers/DataTableHeader.tsx +0 -158
- package/src/kit/components/data-table-headers/DebouncedFilterField.tsx +0 -83
- package/src/kit/components/data-table-headers/FilterFieldRenderer.tsx +0 -194
- package/src/kit/components/data-table-headers/index.ts +0 -6
- package/src/kit/components/data-table-headers/types.ts +0 -89
- package/src/kit/components/data-table-headers/urlSerialization.ts +0 -173
- package/src/kit/components/data-table-headers/useDataTableHeaderUrl.ts +0 -107
- package/src/kit/components/datepicker/DatePicker.tsx +0 -173
- package/src/kit/components/datepicker/DateRangePicker.tsx +0 -526
- package/src/kit/components/datepicker/index.ts +0 -2
- package/src/kit/components/datetimepicker/DateTimePicker.tsx +0 -420
- package/src/kit/components/datetimepicker/DateTimeRangePicker.tsx +0 -676
- package/src/kit/components/datetimepicker/index.ts +0 -2
- package/src/kit/components/fileuploader/FileUploader.tsx +0 -880
- package/src/kit/components/fileuploader/image-preprocess.ts +0 -253
- package/src/kit/components/fileuploader/index.ts +0 -4
- package/src/kit/components/fileuploader/types.ts +0 -94
- package/src/kit/components/forminfo/FormInfoError.tsx +0 -135
- package/src/kit/components/forminfo/index.ts +0 -1
- package/src/kit/components/info-tooltip/InfoTooltip.tsx +0 -18
- package/src/kit/components/keyboard/Keyboard.tsx +0 -916
- package/src/kit/components/keyboard/index.ts +0 -4
- package/src/kit/components/login/Login.tsx +0 -141
- package/src/kit/components/login/index.ts +0 -1
- package/src/kit/components/monthpicker/MonthInput.tsx +0 -131
- package/src/kit/components/monthpicker/MonthPicker.tsx +0 -224
- package/src/kit/components/monthpicker/MonthRangeInput.tsx +0 -153
- package/src/kit/components/monthpicker/MonthRangePicker.tsx +0 -409
- package/src/kit/components/numpad/Numpad.tsx +0 -377
- package/src/kit/components/numpad/index.ts +0 -4
- package/src/kit/components/timepicker/TimePicker.tsx +0 -319
- package/src/kit/components/timepicker/TimeRangePicker.tsx +0 -368
- package/src/kit/components/timepicker/index.ts +0 -2
- package/src/kit/layouts/admin/components/AdminLayout.tsx +0 -419
- package/src/kit/layouts/admin/components/ThemeToggle.tsx +0 -54
- package/src/kit/layouts/admin/hooks/menu.ts +0 -32
- package/src/kit/layouts/admin/providers/AdminMenuProvider.tsx +0 -78
- package/src/kit/layouts/admin/types/index.ts +0 -26
- package/src/kit/providers/ThemeProvider.tsx +0 -90
- package/src/kit/themes/base.css +0 -11
- package/src/kit/themes/clean-slate.css +0 -155
- package/src/kit/themes/default.css +0 -197
- package/src/kit/themes/minimal-modern.css +0 -155
- package/src/kit/themes/spotify.css +0 -164
- package/src/shadcn/hooks/use-mobile.ts +0 -21
- package/src/shadcn/lib/utils.ts +0 -6
- package/src/shadcn/ui/accordion.tsx +0 -66
- package/src/shadcn/ui/alert-dialog.tsx +0 -157
- package/src/shadcn/ui/alert.tsx +0 -66
- package/src/shadcn/ui/aspect-ratio.tsx +0 -11
- package/src/shadcn/ui/avatar.tsx +0 -53
- package/src/shadcn/ui/badge.tsx +0 -46
- package/src/shadcn/ui/breadcrumb.tsx +0 -111
- package/src/shadcn/ui/button.tsx +0 -59
- package/src/shadcn/ui/calendar.tsx +0 -217
- package/src/shadcn/ui/card.tsx +0 -92
- package/src/shadcn/ui/carousel.tsx +0 -240
- package/src/shadcn/ui/chart.tsx +0 -353
- package/src/shadcn/ui/checkbox.tsx +0 -32
- package/src/shadcn/ui/collapsible.tsx +0 -33
- package/src/shadcn/ui/command.tsx +0 -184
- package/src/shadcn/ui/context-menu.tsx +0 -252
- package/src/shadcn/ui/dialog.tsx +0 -146
- package/src/shadcn/ui/drawer.tsx +0 -135
- package/src/shadcn/ui/dropdown-menu.tsx +0 -257
- package/src/shadcn/ui/form.tsx +0 -168
- package/src/shadcn/ui/hover-card.tsx +0 -44
- package/src/shadcn/ui/input-otp.tsx +0 -77
- package/src/shadcn/ui/input.tsx +0 -21
- package/src/shadcn/ui/label.tsx +0 -24
- package/src/shadcn/ui/menubar.tsx +0 -276
- package/src/shadcn/ui/navigation-menu.tsx +0 -168
- package/src/shadcn/ui/pagination.tsx +0 -128
- package/src/shadcn/ui/popover.tsx +0 -48
- package/src/shadcn/ui/progress.tsx +0 -31
- package/src/shadcn/ui/radio-group.tsx +0 -45
- package/src/shadcn/ui/resizable.tsx +0 -56
- package/src/shadcn/ui/scroll-area.tsx +0 -58
- package/src/shadcn/ui/select.tsx +0 -185
- package/src/shadcn/ui/separator.tsx +0 -28
- package/src/shadcn/ui/sheet.tsx +0 -139
- package/src/shadcn/ui/sidebar.tsx +0 -726
- package/src/shadcn/ui/skeleton.tsx +0 -13
- package/src/shadcn/ui/slider.tsx +0 -63
- package/src/shadcn/ui/sonner.tsx +0 -37
- package/src/shadcn/ui/switch.tsx +0 -31
- package/src/shadcn/ui/table.tsx +0 -134
- package/src/shadcn/ui/tabs.tsx +0 -66
- package/src/shadcn/ui/textarea.tsx +0 -18
- package/src/shadcn/ui/toggle-group.tsx +0 -73
- package/src/shadcn/ui/toggle.tsx +0 -47
- package/src/shadcn/ui/tooltip.tsx +0 -61
- package/src/stories/FileUploader.stories.tsx +0 -185
- package/src/stories/kit/builder/DataTable.Basic.stories.tsx +0 -71
- package/src/stories/kit/builder/DataTable.Filters.stories.tsx +0 -98
- package/src/stories/kit/builder/DataTable.Pagination.stories.tsx +0 -73
- package/src/stories/kit/builder/DataTable.SelectionAndActions.stories.tsx +0 -77
- package/src/stories/kit/builder/DataTable.Sorting.stories.tsx +0 -67
- package/src/stories/kit/builder/Dialog.stories.tsx +0 -90
- package/src/stories/kit/builder/Form.ArrayLayouts.stories.tsx +0 -177
- package/src/stories/kit/builder/Form.Autocomplete.stories.tsx +0 -220
- package/src/stories/kit/builder/Form.Basic.stories.tsx +0 -79
- package/src/stories/kit/builder/Form.Complex.stories.tsx +0 -569
- package/src/stories/kit/builder/Form.DateTime.stories.tsx +0 -70
- package/src/stories/kit/builder/Form.Dynamic.stories.tsx +0 -926
- package/src/stories/kit/builder/Form.Files.stories.tsx +0 -136
- package/src/stories/kit/builder/Form.MultipleFormBuilder.stories.tsx +0 -377
- package/src/stories/kit/builder/Form.Pickers.stories.tsx +0 -75
- package/src/stories/kit/builder/Form.Simple.stories.tsx +0 -91
- package/src/stories/kit/builder/Form.Time.stories.tsx +0 -68
- package/src/stories/kit/builder/Page.stories.tsx +0 -115
- package/src/stories/kit/builder/Section.stories.tsx +0 -282
- package/src/stories/kit/components/Autocomplete.stories.tsx +0 -313
- package/src/stories/kit/components/DatePicker.stories.tsx +0 -195
- package/src/stories/kit/components/DateRangePicker.stories.tsx +0 -195
- package/src/stories/kit/components/Keyboard.stories.tsx +0 -263
- package/src/stories/kit/components/Login.stories.tsx +0 -167
- package/src/stories/kit/components/MonthPicker.stories.tsx +0 -100
- package/src/stories/kit/components/MonthRangePicker.stories.tsx +0 -117
- package/src/stories/kit/components/Numpad.stories.tsx +0 -195
- package/src/stories/kit/components/TimePicker.stories.tsx +0 -71
- package/src/stories/kit/components/TimeRangePicker.stories.tsx +0 -43
- package/src/stories/kit/layouts/admin/AdminLayout.Basic.stories.tsx +0 -118
- package/src/stories/kit/layouts/admin/AdminLayout.Collapsible.stories.tsx +0 -81
- package/src/stories/kit/layouts/admin/AdminLayout.Complex.stories.tsx +0 -251
- package/src/stories/kit/layouts/admin/AdminLayout.CustomSidebarHeaderComponent.stories.tsx +0 -80
- package/src/stories/kit/layouts/admin/AdminLayout.CustomSidebarTitleAndIcon.stories.tsx +0 -70
- package/src/stories/kit/layouts/admin/AdminLayout.HeaderSlots.stories.tsx +0 -87
- package/src/stories/shadcn/ui/Accordion.stories.tsx +0 -117
- package/src/stories/shadcn/ui/Alert.stories.tsx +0 -36
- package/src/stories/shadcn/ui/AlertDialog.stories.tsx +0 -73
- package/src/stories/shadcn/ui/AspectRatio.stories.tsx +0 -58
- package/src/stories/shadcn/ui/Avatar.stories.tsx +0 -26
- package/src/stories/shadcn/ui/Badge.stories.tsx +0 -28
- package/src/stories/shadcn/ui/Breadcrumb.stories.tsx +0 -47
- package/src/stories/shadcn/ui/Button.stories.tsx +0 -51
- package/src/stories/shadcn/ui/Calendar.stories.tsx +0 -33
- package/src/stories/shadcn/ui/Card.stories.tsx +0 -39
- package/src/stories/shadcn/ui/Carousel.stories.tsx +0 -37
- package/src/stories/shadcn/ui/Chart.stories.tsx +0 -72
- package/src/stories/shadcn/ui/Checkbox.stories.tsx +0 -64
- package/src/stories/shadcn/ui/Collapsible.stories.tsx +0 -40
- package/src/stories/shadcn/ui/Command.stories.tsx +0 -53
- package/src/stories/shadcn/ui/ContextMenu.stories.tsx +0 -67
- package/src/stories/shadcn/ui/Dialog.stories.tsx +0 -45
- package/src/stories/shadcn/ui/Drawer.stories.tsx +0 -49
- package/src/stories/shadcn/ui/DropdownMenu.stories.tsx +0 -75
- package/src/stories/shadcn/ui/Form.stories.tsx +0 -93
- package/src/stories/shadcn/ui/HoverCard.stories.tsx +0 -43
- package/src/stories/shadcn/ui/Input.stories.tsx +0 -41
- package/src/stories/shadcn/ui/InputOtp.stories.tsx +0 -39
- package/src/stories/shadcn/ui/Label.stories.tsx +0 -29
- package/src/stories/shadcn/ui/Menubar.stories.tsx +0 -87
- package/src/stories/shadcn/ui/NavigationMenu.stories.tsx +0 -78
- package/src/stories/shadcn/ui/Pagination.stories.tsx +0 -51
- package/src/stories/shadcn/ui/Popover.stories.tsx +0 -53
- package/src/stories/shadcn/ui/Progress.stories.tsx +0 -30
- package/src/stories/shadcn/ui/RadioGroup.stories.tsx +0 -31
- package/src/stories/shadcn/ui/Resizable.stories.tsx +0 -55
- package/src/stories/shadcn/ui/ScrollArea.stories.tsx +0 -84
- package/src/stories/shadcn/ui/Select.stories.tsx +0 -61
- package/src/stories/shadcn/ui/Separator.stories.tsx +0 -35
- package/src/stories/shadcn/ui/Sheet.stories.tsx +0 -48
- package/src/stories/shadcn/ui/Sidebar.stories.tsx +0 -131
- package/src/stories/shadcn/ui/Skeleton.stories.tsx +0 -23
- package/src/stories/shadcn/ui/Slider.stories.tsx +0 -21
- package/src/stories/shadcn/ui/Sonner.stories.tsx +0 -49
- package/src/stories/shadcn/ui/Switch.stories.tsx +0 -28
- package/src/stories/shadcn/ui/Table.stories.tsx +0 -374
- package/src/stories/shadcn/ui/Tabs.stories.tsx +0 -31
- package/src/stories/shadcn/ui/Textarea.stories.tsx +0 -42
- package/src/stories/shadcn/ui/Toggle.stories.tsx +0 -44
- package/src/stories/shadcn/ui/ToggleGroup.stories.tsx +0 -28
- package/src/stories/shadcn/ui/Tooltip.stories.tsx +0 -30
- package/tsconfig.json +0 -20
- package/tsconfig.lib.json +0 -52
- package/tsconfig.spec.json +0 -38
- package/tsconfig.tsbuildinfo +0 -1
- package/vite.config.ts +0 -93
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
3
|
-
FormBuilder,
|
|
4
|
-
type FormBuilderProps,
|
|
5
|
-
} from '../../../kit/builder/form/components/FormBuilder';
|
|
6
|
-
import type { FileRecord } from '../../../kit/components/fileuploader/types';
|
|
7
|
-
|
|
8
|
-
// Simple mocked uploader with progress + optional failure
|
|
9
|
-
function mockUploader(options?: {
|
|
10
|
-
minMs?: number;
|
|
11
|
-
maxMs?: number;
|
|
12
|
-
failRate?: number;
|
|
13
|
-
}) {
|
|
14
|
-
const minMs = options?.minMs ?? 700;
|
|
15
|
-
const maxMs = options?.maxMs ?? 1600;
|
|
16
|
-
const failRate = options?.failRate ?? 0.15;
|
|
17
|
-
return async (
|
|
18
|
-
file: File,
|
|
19
|
-
onProgress: (pct: number) => void,
|
|
20
|
-
): Promise<Partial<FileRecord>> => {
|
|
21
|
-
const willFail = Math.random() < failRate;
|
|
22
|
-
const total = Math.floor(Math.random() * (maxMs - minMs + 1)) + minMs;
|
|
23
|
-
const start = Date.now();
|
|
24
|
-
return new Promise((resolve, reject) => {
|
|
25
|
-
const iv = setInterval(() => {
|
|
26
|
-
const elapsed = Date.now() - start;
|
|
27
|
-
const pct = Math.min(100, Math.round((elapsed / total) * 100));
|
|
28
|
-
onProgress(pct);
|
|
29
|
-
if (pct >= 100) {
|
|
30
|
-
clearInterval(iv);
|
|
31
|
-
if (willFail) {
|
|
32
|
-
reject(new Error('Simulated upload error'));
|
|
33
|
-
} else {
|
|
34
|
-
resolve({ id: `${file.name}-${Date.now()}` });
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}, 150);
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const meta: Meta<typeof FormBuilder> = {
|
|
43
|
-
title: 'Kit/Builder/Form',
|
|
44
|
-
component: FormBuilder,
|
|
45
|
-
parameters: {
|
|
46
|
-
controls: { expanded: true },
|
|
47
|
-
backgrounds: { disable: true },
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export default meta;
|
|
52
|
-
|
|
53
|
-
type Story = StoryObj<typeof FormBuilder>;
|
|
54
|
-
|
|
55
|
-
export const FileUploaderForm: Story = {
|
|
56
|
-
name: 'File Uploader',
|
|
57
|
-
args: {
|
|
58
|
-
sections: [
|
|
59
|
-
{
|
|
60
|
-
title: 'Attachments',
|
|
61
|
-
description:
|
|
62
|
-
'Demonstrates the FileUploader field integrated with FormBuilder',
|
|
63
|
-
variant: 'card',
|
|
64
|
-
layout: 'grid',
|
|
65
|
-
grid: { cols: 1, mdCols: 2, gap: 'gap-4' },
|
|
66
|
-
fields: [
|
|
67
|
-
{
|
|
68
|
-
name: 'images',
|
|
69
|
-
label: 'Product Images',
|
|
70
|
-
type: 'file',
|
|
71
|
-
gridCols: 2,
|
|
72
|
-
required: true,
|
|
73
|
-
// FileUploader pass-through
|
|
74
|
-
fileMultiple: true,
|
|
75
|
-
fileMaxFiles: 6,
|
|
76
|
-
fileAccept: { 'image/*': [] },
|
|
77
|
-
fileLayout: 'grid',
|
|
78
|
-
fileWithDownload: true,
|
|
79
|
-
fileUploader: mockUploader({ failRate: 0.1 }),
|
|
80
|
-
validation: {
|
|
81
|
-
minItems: { value: 1, message: 'Please upload at least 1 image' },
|
|
82
|
-
maxItems: { value: 6, message: 'Maximum 6 images allowed' },
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: 'docs',
|
|
87
|
-
label: 'Documents',
|
|
88
|
-
type: 'file',
|
|
89
|
-
gridCols: 2,
|
|
90
|
-
fileMultiple: true,
|
|
91
|
-
fileMaxFiles: 4,
|
|
92
|
-
fileAccept: { 'application/pdf': ['.pdf'], 'text/plain': ['.txt'] },
|
|
93
|
-
fileLayout: 'list',
|
|
94
|
-
fileWithDownload: false,
|
|
95
|
-
fileUploader: mockUploader({ failRate: 0.25 }),
|
|
96
|
-
validation: {
|
|
97
|
-
maxItems: { value: 4, message: 'Up to 4 documents' },
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
defaultValues: {
|
|
104
|
-
images: [
|
|
105
|
-
{
|
|
106
|
-
id: 'img-1',
|
|
107
|
-
name: 'existing-1.jpg',
|
|
108
|
-
url: 'https://picsum.photos/seed/fb-uploader-1/600/400',
|
|
109
|
-
type: 'image/jpeg',
|
|
110
|
-
size: 200000,
|
|
111
|
-
status: 'success',
|
|
112
|
-
progress: 100,
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
id: 'img-2',
|
|
116
|
-
name: 'existing-2.jpg',
|
|
117
|
-
url: 'https://picsum.photos/seed/fb-uploader-2/600/400',
|
|
118
|
-
type: 'image/jpeg',
|
|
119
|
-
size: 180000,
|
|
120
|
-
status: 'success',
|
|
121
|
-
progress: 100,
|
|
122
|
-
},
|
|
123
|
-
] satisfies FileRecord[],
|
|
124
|
-
docs: [] as FileRecord[],
|
|
125
|
-
},
|
|
126
|
-
onSubmit: (data: unknown) => {
|
|
127
|
-
console.log('Submit (FileUploader form):', data);
|
|
128
|
-
},
|
|
129
|
-
showActions: true,
|
|
130
|
-
} satisfies Partial<FormBuilderProps>,
|
|
131
|
-
render: (args) => (
|
|
132
|
-
<div className="max-w-5xl mx-auto p-6">
|
|
133
|
-
<FormBuilder {...(args as FormBuilderProps)} />
|
|
134
|
-
</div>
|
|
135
|
-
),
|
|
136
|
-
};
|
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { useForm } from 'react-hook-form';
|
|
4
|
-
import { FormBuilder } from '../../../index';
|
|
5
|
-
import type { FormBuilderSectionConfig } from '../../../kit/builder/form/types';
|
|
6
|
-
|
|
7
|
-
interface SplitFormValues {
|
|
8
|
-
userId: string;
|
|
9
|
-
firstName: string;
|
|
10
|
-
lastName: string;
|
|
11
|
-
email: string;
|
|
12
|
-
accountType: 'individual' | 'business';
|
|
13
|
-
companyName?: string;
|
|
14
|
-
address: {
|
|
15
|
-
street: string;
|
|
16
|
-
city: string;
|
|
17
|
-
zip: string;
|
|
18
|
-
};
|
|
19
|
-
marketingOptIn: boolean;
|
|
20
|
-
preferredContactMethod: 'email' | 'phone';
|
|
21
|
-
phoneNumber?: string;
|
|
22
|
-
newsletterTopics: string[];
|
|
23
|
-
complianceContactEmail?: string;
|
|
24
|
-
eventsWebhookUrl?: string;
|
|
25
|
-
smsOptIn: boolean;
|
|
26
|
-
smsFrequency?: 'daily' | 'weekly' | 'monthly';
|
|
27
|
-
timezone: string;
|
|
28
|
-
authorizedContacts: Array<{ contactId: string; contactName: string }>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const generalInfoSections: FormBuilderSectionConfig<SplitFormValues>[] = [
|
|
32
|
-
{
|
|
33
|
-
title: 'Profile',
|
|
34
|
-
layout: 'grid',
|
|
35
|
-
grid: { cols: 2, gap: 'gap-4' },
|
|
36
|
-
fields: [
|
|
37
|
-
{
|
|
38
|
-
name: 'userId',
|
|
39
|
-
label: 'User ID',
|
|
40
|
-
type: 'hidden',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'firstName',
|
|
44
|
-
label: 'First name',
|
|
45
|
-
type: 'text',
|
|
46
|
-
required: true,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: 'lastName',
|
|
50
|
-
label: 'Last name',
|
|
51
|
-
type: 'text',
|
|
52
|
-
required: true,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'email',
|
|
56
|
-
label: 'Email',
|
|
57
|
-
type: 'email',
|
|
58
|
-
required: true,
|
|
59
|
-
gridCols: 2,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'accountType',
|
|
63
|
-
label: 'Account type',
|
|
64
|
-
type: 'radio',
|
|
65
|
-
options: [
|
|
66
|
-
{ label: 'Individual', value: 'individual' },
|
|
67
|
-
{ label: 'Business', value: 'business' },
|
|
68
|
-
],
|
|
69
|
-
defaultValue: 'individual',
|
|
70
|
-
gridCols: 2,
|
|
71
|
-
description: 'Switch to Business to reveal additional company details.',
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: 'companyName',
|
|
75
|
-
label: 'Company name',
|
|
76
|
-
type: 'text',
|
|
77
|
-
placeholder: 'Acme Inc.',
|
|
78
|
-
dependencies: [
|
|
79
|
-
{
|
|
80
|
-
field: 'accountType',
|
|
81
|
-
condition: (value) => value === 'business',
|
|
82
|
-
action: 'show',
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
gridCols: 2,
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
title: 'Address',
|
|
91
|
-
layout: 'grid',
|
|
92
|
-
grid: { cols: 3, gap: 'gap-4' },
|
|
93
|
-
fields: [
|
|
94
|
-
{
|
|
95
|
-
name: 'address.street',
|
|
96
|
-
label: 'Street',
|
|
97
|
-
type: 'text',
|
|
98
|
-
required: true,
|
|
99
|
-
gridCols: 3,
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: 'address.city',
|
|
103
|
-
label: 'City',
|
|
104
|
-
type: 'text',
|
|
105
|
-
required: true,
|
|
106
|
-
gridCols: 2,
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
name: 'address.zip',
|
|
110
|
-
label: 'ZIP code',
|
|
111
|
-
type: 'text',
|
|
112
|
-
required: true,
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
|
-
];
|
|
117
|
-
|
|
118
|
-
const preferencesSections: FormBuilderSectionConfig<SplitFormValues>[] = [
|
|
119
|
-
{
|
|
120
|
-
title: 'Preferences',
|
|
121
|
-
layout: 'grid',
|
|
122
|
-
grid: { cols: 2, gap: 'gap-4' },
|
|
123
|
-
fields: [
|
|
124
|
-
{
|
|
125
|
-
name: 'marketingOptIn',
|
|
126
|
-
label: 'Marketing emails',
|
|
127
|
-
type: 'switch',
|
|
128
|
-
defaultValue: true,
|
|
129
|
-
description: 'Receive occasional product updates and tips.',
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
name: 'newsletterTopics',
|
|
133
|
-
label: 'Topics of interest',
|
|
134
|
-
type: 'select',
|
|
135
|
-
options: [
|
|
136
|
-
{ label: 'Product releases', value: 'product' },
|
|
137
|
-
{ label: 'Best practices', value: 'best-practices' },
|
|
138
|
-
{ label: 'Events', value: 'events' },
|
|
139
|
-
{ label: 'Integrations', value: 'integrations' },
|
|
140
|
-
],
|
|
141
|
-
multiple: true,
|
|
142
|
-
placeholder: 'Choose one or more topics',
|
|
143
|
-
dependencies: [
|
|
144
|
-
{
|
|
145
|
-
field: 'marketingOptIn',
|
|
146
|
-
condition: (value) => Boolean(value),
|
|
147
|
-
action: 'show',
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
field: 'marketingOptIn',
|
|
151
|
-
condition: (value) => !value,
|
|
152
|
-
action: 'setValue',
|
|
153
|
-
value: [],
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: 'eventsWebhookUrl',
|
|
159
|
-
label: 'Events webhook URL',
|
|
160
|
-
type: 'text',
|
|
161
|
-
placeholder: 'https://example.com/webhooks/events',
|
|
162
|
-
description:
|
|
163
|
-
'Provide a webhook to receive notifications about upcoming events.',
|
|
164
|
-
dependencies: [
|
|
165
|
-
{
|
|
166
|
-
field: 'newsletterTopics',
|
|
167
|
-
condition: (value) =>
|
|
168
|
-
Array.isArray(value) && value.includes('events'),
|
|
169
|
-
action: 'show',
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
name: 'preferredContactMethod',
|
|
175
|
-
label: 'Preferred contact method',
|
|
176
|
-
type: 'radio',
|
|
177
|
-
options: [
|
|
178
|
-
{ label: 'Email', value: 'email' },
|
|
179
|
-
{ label: 'Phone', value: 'phone' },
|
|
180
|
-
],
|
|
181
|
-
defaultValue: 'email',
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
name: 'phoneNumber',
|
|
185
|
-
label: 'Phone number',
|
|
186
|
-
type: 'text',
|
|
187
|
-
placeholder: '(555) 123-4567',
|
|
188
|
-
dependencies: [
|
|
189
|
-
{
|
|
190
|
-
field: 'preferredContactMethod',
|
|
191
|
-
condition: (value) => value === 'phone',
|
|
192
|
-
action: 'show',
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
name: 'smsOptIn',
|
|
198
|
-
label: 'SMS updates',
|
|
199
|
-
type: 'switch',
|
|
200
|
-
defaultValue: false,
|
|
201
|
-
description: 'Get real-time notifications via SMS.',
|
|
202
|
-
dependencies: [
|
|
203
|
-
{
|
|
204
|
-
field: 'preferredContactMethod',
|
|
205
|
-
condition: (value) => value === 'phone',
|
|
206
|
-
action: 'show',
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
name: 'smsFrequency',
|
|
212
|
-
label: 'SMS frequency',
|
|
213
|
-
type: 'select',
|
|
214
|
-
options: [
|
|
215
|
-
{ label: 'Daily recap', value: 'daily' },
|
|
216
|
-
{ label: 'Weekly summary', value: 'weekly' },
|
|
217
|
-
{ label: 'Monthly digest', value: 'monthly' },
|
|
218
|
-
],
|
|
219
|
-
placeholder: 'Choose how often we should text you',
|
|
220
|
-
dependencies: [
|
|
221
|
-
{
|
|
222
|
-
field: 'smsOptIn',
|
|
223
|
-
condition: (value) => Boolean(value),
|
|
224
|
-
action: 'show',
|
|
225
|
-
},
|
|
226
|
-
],
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
name: 'complianceContactEmail',
|
|
230
|
-
label: 'Compliance contact email',
|
|
231
|
-
type: 'email',
|
|
232
|
-
placeholder: 'compliance@company.com',
|
|
233
|
-
description:
|
|
234
|
-
'Required for business accounts to receive compliance updates.',
|
|
235
|
-
dependencies: [
|
|
236
|
-
{
|
|
237
|
-
field: 'accountType',
|
|
238
|
-
condition: (value) => value === 'business',
|
|
239
|
-
action: 'show',
|
|
240
|
-
},
|
|
241
|
-
],
|
|
242
|
-
gridCols: 2,
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
name: 'timezone',
|
|
246
|
-
label: 'Timezone',
|
|
247
|
-
type: 'select',
|
|
248
|
-
options: [
|
|
249
|
-
{ label: 'UTC−08:00 Pacific', value: 'America/Los_Angeles' },
|
|
250
|
-
{ label: 'UTC−05:00 Eastern', value: 'America/New_York' },
|
|
251
|
-
{ label: 'UTC+00:00 London', value: 'Europe/London' },
|
|
252
|
-
{ label: 'UTC+07:00 Jakarta', value: 'Asia/Jakarta' },
|
|
253
|
-
],
|
|
254
|
-
required: true,
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
name: 'authorizedContacts',
|
|
258
|
-
label: 'Authorized contacts',
|
|
259
|
-
description:
|
|
260
|
-
'Names remain editable while hidden IDs stay intact for submission.',
|
|
261
|
-
type: 'array',
|
|
262
|
-
arrayLayout: 'table',
|
|
263
|
-
defaultValue: [
|
|
264
|
-
{ contactId: 'contact-001', contactName: 'Jane Smith' },
|
|
265
|
-
{ contactId: 'contact-002', contactName: 'John Appleseed' },
|
|
266
|
-
],
|
|
267
|
-
fields: [
|
|
268
|
-
{
|
|
269
|
-
name: 'contactId',
|
|
270
|
-
label: 'Contact ID',
|
|
271
|
-
type: 'hidden',
|
|
272
|
-
defaultValue: '',
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
name: 'contactName',
|
|
276
|
-
label: 'Name',
|
|
277
|
-
type: 'text',
|
|
278
|
-
placeholder: 'Alex Johnson',
|
|
279
|
-
required: true,
|
|
280
|
-
},
|
|
281
|
-
],
|
|
282
|
-
},
|
|
283
|
-
],
|
|
284
|
-
},
|
|
285
|
-
];
|
|
286
|
-
|
|
287
|
-
const SplitFormExample = () => {
|
|
288
|
-
const form = useForm<SplitFormValues>({
|
|
289
|
-
defaultValues: {
|
|
290
|
-
userId: 'user-001',
|
|
291
|
-
firstName: 'Jane',
|
|
292
|
-
lastName: 'Doe',
|
|
293
|
-
email: 'jane.doe@example.com',
|
|
294
|
-
accountType: 'individual',
|
|
295
|
-
companyName: '',
|
|
296
|
-
address: {
|
|
297
|
-
street: '123 Storybook Way',
|
|
298
|
-
city: 'Componentville',
|
|
299
|
-
zip: '90210',
|
|
300
|
-
},
|
|
301
|
-
marketingOptIn: true,
|
|
302
|
-
newsletterTopics: ['product'],
|
|
303
|
-
eventsWebhookUrl: '',
|
|
304
|
-
preferredContactMethod: 'email',
|
|
305
|
-
phoneNumber: '',
|
|
306
|
-
smsOptIn: false,
|
|
307
|
-
smsFrequency: undefined,
|
|
308
|
-
complianceContactEmail: '',
|
|
309
|
-
timezone: 'Asia/Jakarta',
|
|
310
|
-
authorizedContacts: [
|
|
311
|
-
{ contactId: 'contact-001', contactName: 'Jane Smith' },
|
|
312
|
-
{ contactId: 'contact-002', contactName: 'John Appleseed' },
|
|
313
|
-
],
|
|
314
|
-
},
|
|
315
|
-
mode: 'onSubmit',
|
|
316
|
-
});
|
|
317
|
-
|
|
318
|
-
const logSubmit = useMemo(
|
|
319
|
-
() =>
|
|
320
|
-
form.handleSubmit((values) => {
|
|
321
|
-
console.log('Story submit', values);
|
|
322
|
-
}),
|
|
323
|
-
[form],
|
|
324
|
-
);
|
|
325
|
-
|
|
326
|
-
return (
|
|
327
|
-
<div className="space-y-6">
|
|
328
|
-
<FormBuilder
|
|
329
|
-
form={form}
|
|
330
|
-
sections={generalInfoSections}
|
|
331
|
-
onSubmit={async () => {
|
|
332
|
-
/* handled by explicit button */
|
|
333
|
-
}}
|
|
334
|
-
showActions={false}
|
|
335
|
-
/>
|
|
336
|
-
|
|
337
|
-
<FormBuilder
|
|
338
|
-
form={form}
|
|
339
|
-
sections={preferencesSections}
|
|
340
|
-
onSubmit={async () => {
|
|
341
|
-
/* handled by explicit button */
|
|
342
|
-
}}
|
|
343
|
-
customActions={
|
|
344
|
-
<button
|
|
345
|
-
type="button"
|
|
346
|
-
className="px-4 py-2 text-sm font-medium text-white bg-primary rounded-md"
|
|
347
|
-
onClick={logSubmit}
|
|
348
|
-
>
|
|
349
|
-
Save all sections
|
|
350
|
-
</button>
|
|
351
|
-
}
|
|
352
|
-
/>
|
|
353
|
-
</div>
|
|
354
|
-
);
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
const meta: Meta<typeof SplitFormExample> = {
|
|
358
|
-
title: 'Kit/Builder/Form',
|
|
359
|
-
component: SplitFormExample,
|
|
360
|
-
parameters: {
|
|
361
|
-
docs: {
|
|
362
|
-
description: {
|
|
363
|
-
component:
|
|
364
|
-
'Demonstrates sharing a single `react-hook-form` instance across multiple `FormBuilder` blocks using the new `form` prop.',
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
},
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
export default meta;
|
|
371
|
-
|
|
372
|
-
type Story = StoryObj<typeof SplitFormExample>;
|
|
373
|
-
|
|
374
|
-
export const SharedFormInstance: Story = {
|
|
375
|
-
name: 'Shared form instance across sections',
|
|
376
|
-
render: () => <SplitFormExample />,
|
|
377
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
3
|
-
FormBuilder,
|
|
4
|
-
type FormBuilderProps,
|
|
5
|
-
} from '../../../kit/builder/form/components/FormBuilder';
|
|
6
|
-
|
|
7
|
-
const meta: Meta<typeof FormBuilder> = {
|
|
8
|
-
title: 'Kit/Builder/Form',
|
|
9
|
-
component: FormBuilder,
|
|
10
|
-
parameters: {
|
|
11
|
-
controls: { expanded: true },
|
|
12
|
-
backgrounds: { disable: true },
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
|
|
18
|
-
type Story = StoryObj<typeof FormBuilder>;
|
|
19
|
-
|
|
20
|
-
export const Pickers: Story = {
|
|
21
|
-
name: 'Pickers (Date, Date Range, Month, Month Range)',
|
|
22
|
-
args: {
|
|
23
|
-
sections: [
|
|
24
|
-
{
|
|
25
|
-
title: 'Pickers',
|
|
26
|
-
description:
|
|
27
|
-
'Showcase of DatePicker, DateRangePicker, MonthPicker, and MonthRangePicker via FormBuilder fields',
|
|
28
|
-
variant: 'card',
|
|
29
|
-
layout: 'grid',
|
|
30
|
-
grid: { cols: 1, mdCols: 2, gap: 'gap-4' },
|
|
31
|
-
fields: [
|
|
32
|
-
{
|
|
33
|
-
name: 'dateSingle',
|
|
34
|
-
label: 'Date (DatePicker)',
|
|
35
|
-
type: 'date_picker',
|
|
36
|
-
placeholder: 'Select a date',
|
|
37
|
-
minDate: new Date(new Date().getFullYear(), 0, 1),
|
|
38
|
-
maxDate: new Date(new Date().getFullYear(), 11, 31),
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: 'dateRange',
|
|
42
|
-
label: 'Date Range (DateRangePicker)',
|
|
43
|
-
type: 'date_range',
|
|
44
|
-
placeholder: 'Select a date range',
|
|
45
|
-
numberOfMonths: 2,
|
|
46
|
-
popoverSide: 'bottom',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: 'monthSingle',
|
|
50
|
-
label: 'Month (MonthPicker)',
|
|
51
|
-
type: 'month',
|
|
52
|
-
placeholder: 'Select a month',
|
|
53
|
-
minDate: new Date(new Date().getFullYear() - 1, 0, 1),
|
|
54
|
-
maxDate: new Date(new Date().getFullYear() + 1, 11, 31),
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: 'monthRange',
|
|
58
|
-
label: 'Month Range (MonthRangePicker)',
|
|
59
|
-
type: 'month_range',
|
|
60
|
-
placeholder: 'Select a start and end month',
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
onSubmit: (data: unknown) => {
|
|
66
|
-
console.log('Submit (pickers):', data);
|
|
67
|
-
},
|
|
68
|
-
showActions: true,
|
|
69
|
-
} satisfies Partial<FormBuilderProps>,
|
|
70
|
-
render: (args) => (
|
|
71
|
-
<div className="max-w-4xl mx-auto p-6">
|
|
72
|
-
<FormBuilder {...(args as FormBuilderProps)} />
|
|
73
|
-
</div>
|
|
74
|
-
),
|
|
75
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { FormBuilder } from '../../../kit/builder/form/components/FormBuilder';
|
|
3
|
-
import {
|
|
4
|
-
createSection,
|
|
5
|
-
createField,
|
|
6
|
-
commonValidations,
|
|
7
|
-
} from '../../../kit/builder/form/utils';
|
|
8
|
-
|
|
9
|
-
const meta: Meta<typeof FormBuilder> = {
|
|
10
|
-
title: 'Kit/Builder/Form',
|
|
11
|
-
component: FormBuilder,
|
|
12
|
-
parameters: {
|
|
13
|
-
controls: { expanded: true },
|
|
14
|
-
backgrounds: { disable: true },
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
|
|
20
|
-
type Story = StoryObj<typeof FormBuilder>;
|
|
21
|
-
|
|
22
|
-
export const SimpleExample: Story = {
|
|
23
|
-
name: 'Simple example',
|
|
24
|
-
render: () => {
|
|
25
|
-
const handleSubmit = (data: unknown) => {
|
|
26
|
-
console.log('Form submitted:', data);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const sections = [
|
|
30
|
-
createSection.card('Contact Information', [
|
|
31
|
-
createField.text('name', 'Full Name', {
|
|
32
|
-
required: true,
|
|
33
|
-
placeholder: 'Enter your full name',
|
|
34
|
-
}),
|
|
35
|
-
createField.email('email', 'Email Address', {
|
|
36
|
-
required: true,
|
|
37
|
-
placeholder: 'Enter your email address',
|
|
38
|
-
}),
|
|
39
|
-
createField.text('phone', 'Phone Number', {
|
|
40
|
-
validation: commonValidations.phone,
|
|
41
|
-
placeholder: '+1 (555) 123-4567',
|
|
42
|
-
}),
|
|
43
|
-
createField.select(
|
|
44
|
-
'subject',
|
|
45
|
-
'Subject',
|
|
46
|
-
[
|
|
47
|
-
{ label: 'General Inquiry', value: 'general' },
|
|
48
|
-
{ label: 'Technical Support', value: 'support' },
|
|
49
|
-
{ label: 'Sales Question', value: 'sales' },
|
|
50
|
-
{ label: 'Partnership', value: 'partnership' },
|
|
51
|
-
],
|
|
52
|
-
{
|
|
53
|
-
required: true,
|
|
54
|
-
placeholder: 'Select a subject',
|
|
55
|
-
},
|
|
56
|
-
),
|
|
57
|
-
createField.textarea('message', 'Message', {
|
|
58
|
-
required: true,
|
|
59
|
-
placeholder: 'Enter your message here...',
|
|
60
|
-
gridCols: 2,
|
|
61
|
-
}),
|
|
62
|
-
createField.checkbox('subscribe', 'Subscribe to newsletter', {
|
|
63
|
-
defaultValue: false,
|
|
64
|
-
gridCols: 2,
|
|
65
|
-
}),
|
|
66
|
-
createField.switch('contactPermission', 'Allow contact by phone', {
|
|
67
|
-
defaultValue: false,
|
|
68
|
-
gridCols: 2,
|
|
69
|
-
}),
|
|
70
|
-
]),
|
|
71
|
-
];
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
<div className="max-w-2xl mx-auto p-6">
|
|
75
|
-
<div className="mb-6">
|
|
76
|
-
<h1 className="text-2xl font-bold text-gray-900">Contact Us</h1>
|
|
77
|
-
<p className="text-gray-600 mt-2">
|
|
78
|
-
Fill out the form below and we'll get back to you as soon as
|
|
79
|
-
possible.
|
|
80
|
-
</p>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<FormBuilder
|
|
84
|
-
sections={sections}
|
|
85
|
-
onSubmit={handleSubmit}
|
|
86
|
-
className="space-y-6"
|
|
87
|
-
/>
|
|
88
|
-
</div>
|
|
89
|
-
);
|
|
90
|
-
},
|
|
91
|
-
};
|