@timeax/form-palette 0.0.2 → 0.0.4
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/adapters/axios.d.ts +21 -0
- package/dist/adapters/axios.d.ts.map +1 -0
- package/dist/adapters/axios.js +74 -0
- package/dist/adapters/axios.js.map +1 -0
- package/dist/adapters/index.d.ts +35 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +74 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/inertia.d.ts +24 -0
- package/dist/adapters/inertia.d.ts.map +1 -0
- package/dist/adapters/inertia.js +126 -0
- package/dist/adapters/inertia.js.map +1 -0
- package/dist/core/adapter-registry.d.ts +30 -0
- package/dist/core/adapter-registry.d.ts.map +1 -0
- package/{src/core/adapter-registry.ts → dist/core/adapter-registry.js} +10 -28
- package/dist/core/adapter-registry.js.map +1 -0
- package/{src/core/bound/bind-host.ts → dist/core/bound/bind-host.d.ts} +2 -3
- package/dist/core/bound/bind-host.d.ts.map +1 -0
- package/dist/core/bound/bind-host.js +2 -0
- package/dist/core/bound/bind-host.js.map +1 -0
- package/dist/core/bound/observe-bound-field.d.ts +21 -0
- package/dist/core/bound/observe-bound-field.d.ts.map +1 -0
- package/dist/core/bound/observe-bound-field.js +116 -0
- package/dist/core/bound/observe-bound-field.js.map +1 -0
- package/dist/core/bound/wait-for-bound-field.d.ts +5 -0
- package/dist/core/bound/wait-for-bound-field.d.ts.map +1 -0
- package/dist/core/bound/wait-for-bound-field.js +35 -0
- package/dist/core/bound/wait-for-bound-field.js.map +1 -0
- package/{src/core/context.ts → dist/core/context.d.ts} +2 -6
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/context.js +11 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/core-provider.d.ts +22 -0
- package/dist/core/core-provider.d.ts.map +1 -0
- package/{src/core/core-provider.tsx → dist/core/core-provider.js} +209 -364
- package/dist/core/core-provider.js.map +1 -0
- package/dist/core/core-root.d.ts +26 -0
- package/dist/core/core-root.d.ts.map +1 -0
- package/dist/core/core-root.js +38 -0
- package/dist/core/core-root.js.map +1 -0
- package/dist/core/core-shell.d.ts +22 -0
- package/dist/core/core-shell.d.ts.map +1 -0
- package/dist/core/core-shell.js +8 -0
- package/dist/core/core-shell.js.map +1 -0
- package/{src/core/errors/error-strip.tsx → dist/core/errors/error-strip.d.ts} +2 -39
- package/dist/core/errors/error-strip.d.ts.map +1 -0
- package/dist/core/errors/error-strip.js +18 -0
- package/dist/core/errors/error-strip.js.map +1 -0
- package/dist/core/errors/index.d.ts +4 -0
- package/dist/core/errors/index.d.ts.map +1 -0
- package/dist/core/errors/index.js +4 -0
- package/dist/core/errors/index.js.map +1 -0
- package/dist/core/errors/map-error-bag.d.ts +24 -0
- package/dist/core/errors/map-error-bag.d.ts.map +1 -0
- package/{src/core/errors/map-error-bag.ts → dist/core/errors/map-error-bag.js} +10 -22
- package/dist/core/errors/map-error-bag.js.map +1 -0
- package/dist/core/errors/map-zod.d.ts +18 -0
- package/dist/core/errors/map-zod.d.ts.map +1 -0
- package/{src/core/errors/map-zod.ts → dist/core/errors/map-zod.js} +7 -19
- package/dist/core/errors/map-zod.js.map +1 -0
- package/dist/core/hooks/use-button.d.ts +73 -0
- package/dist/core/hooks/use-button.d.ts.map +1 -0
- package/dist/core/hooks/use-button.js +116 -0
- package/dist/core/hooks/use-button.js.map +1 -0
- package/dist/core/hooks/use-core-context.d.ts +9 -0
- package/dist/core/hooks/use-core-context.d.ts.map +1 -0
- package/{src/core/hooks/use-core-context.ts → dist/core/hooks/use-core-context.js} +3 -6
- package/dist/core/hooks/use-core-context.js.map +1 -0
- package/dist/core/hooks/use-core-utility.d.ts +1 -0
- package/dist/core/hooks/use-core-utility.d.ts.map +1 -0
- package/dist/core/hooks/use-core-utility.js +2 -0
- package/dist/core/hooks/use-core-utility.js.map +1 -0
- package/{src/core/hooks/use-core.ts → dist/core/hooks/use-core.d.ts} +9 -13
- package/dist/core/hooks/use-core.d.ts.map +1 -0
- package/dist/core/hooks/use-core.js +11 -0
- package/dist/core/hooks/use-core.js.map +1 -0
- package/dist/core/hooks/use-field.d.ts +141 -0
- package/dist/core/hooks/use-field.d.ts.map +1 -0
- package/dist/core/hooks/use-field.js +256 -0
- package/dist/core/hooks/use-field.js.map +1 -0
- package/dist/core/hooks/use-optional-field.d.ts +9 -0
- package/dist/core/hooks/use-optional-field.d.ts.map +1 -0
- package/dist/core/hooks/use-optional-field.js +146 -0
- package/dist/core/hooks/use-optional-field.js.map +1 -0
- package/dist/core/index.d.ts +11 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +11 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/registry/binder-registry.d.ts +38 -0
- package/dist/core/registry/binder-registry.d.ts.map +1 -0
- package/dist/core/registry/binder-registry.js +52 -0
- package/dist/core/registry/binder-registry.js.map +1 -0
- package/dist/core/registry/field-registry.d.ts +86 -0
- package/dist/core/registry/field-registry.d.ts.map +1 -0
- package/{src/core/registry/field-registry.ts → dist/core/registry/field-registry.js} +56 -70
- package/dist/core/registry/field-registry.js.map +1 -0
- package/dist/core/test.d.ts +2 -0
- package/dist/core/test.d.ts.map +1 -0
- package/dist/core/test.js +9 -0
- package/dist/core/test.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/{src/index.ts → dist/index.js} +5 -47
- package/dist/index.js.map +1 -0
- package/{src/input/index.ts → dist/input/index.d.ts} +1 -2
- package/dist/input/index.d.ts.map +1 -0
- package/dist/input/index.js +3 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/input-field.d.ts +15 -0
- package/dist/input/input-field.d.ts.map +1 -0
- package/dist/input/input-field.js +413 -0
- package/dist/input/input-field.js.map +1 -0
- package/dist/input/input-layout-graph.d.ts +77 -0
- package/dist/input/input-layout-graph.d.ts.map +1 -0
- package/dist/input/input-layout-graph.js +108 -0
- package/dist/input/input-layout-graph.js.map +1 -0
- package/{src/input/input-props.ts → dist/input/input-props.d.ts} +22 -84
- package/dist/input/input-props.d.ts.map +1 -0
- package/dist/input/input-props.js +4 -0
- package/dist/input/input-props.js.map +1 -0
- package/dist/lib/get-global-countries.d.ts +3 -0
- package/dist/lib/get-global-countries.d.ts.map +1 -0
- package/dist/lib/get-global-countries.js +70 -0
- package/dist/lib/get-global-countries.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/presets/index.d.ts +1 -0
- package/dist/presets/index.d.ts.map +1 -0
- package/dist/presets/index.js +2 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/presets/shadcn-preset.d.ts +1 -0
- package/dist/presets/shadcn-preset.d.ts.map +1 -0
- package/dist/presets/shadcn-preset.js +2 -0
- package/dist/presets/shadcn-preset.js.map +1 -0
- package/dist/presets/shadcn-variants/checkbox.d.ts +212 -0
- package/dist/presets/shadcn-variants/checkbox.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/checkbox.js +315 -0
- package/dist/presets/shadcn-variants/checkbox.js.map +1 -0
- package/dist/presets/shadcn-variants/chips.d.ts +154 -0
- package/dist/presets/shadcn-variants/chips.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/chips.js +266 -0
- package/dist/presets/shadcn-variants/chips.js.map +1 -0
- package/dist/presets/shadcn-variants/color.d.ts +63 -0
- package/dist/presets/shadcn-variants/color.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/color.js +96 -0
- package/dist/presets/shadcn-variants/color.js.map +1 -0
- package/dist/presets/shadcn-variants/custom.d.ts +94 -0
- package/dist/presets/shadcn-variants/custom.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/custom.js +80 -0
- package/dist/presets/shadcn-variants/custom.js.map +1 -0
- package/dist/presets/shadcn-variants/date.d.ts +114 -0
- package/dist/presets/shadcn-variants/date.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/date.js +414 -0
- package/dist/presets/shadcn-variants/date.js.map +1 -0
- package/dist/presets/shadcn-variants/file.d.ts +79 -0
- package/dist/presets/shadcn-variants/file.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/file.js +289 -0
- package/dist/presets/shadcn-variants/file.js.map +1 -0
- package/dist/presets/shadcn-variants/keyvalue.d.ts +35 -0
- package/dist/presets/shadcn-variants/keyvalue.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/keyvalue.js +215 -0
- package/dist/presets/shadcn-variants/keyvalue.js.map +1 -0
- package/dist/presets/shadcn-variants/multiselect.d.ts +210 -0
- package/dist/presets/shadcn-variants/multiselect.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/multiselect.js +352 -0
- package/dist/presets/shadcn-variants/multiselect.js.map +1 -0
- package/dist/presets/shadcn-variants/number.d.ts +31 -0
- package/dist/presets/shadcn-variants/number.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/number.js +64 -0
- package/dist/presets/shadcn-variants/number.js.map +1 -0
- package/dist/presets/shadcn-variants/password.d.ts +195 -0
- package/dist/presets/shadcn-variants/password.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/password.js +296 -0
- package/dist/presets/shadcn-variants/password.js.map +1 -0
- package/dist/presets/shadcn-variants/phone.d.ts +69 -0
- package/dist/presets/shadcn-variants/phone.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/phone.js +308 -0
- package/dist/presets/shadcn-variants/phone.js.map +1 -0
- package/dist/presets/shadcn-variants/radio.d.ts +172 -0
- package/dist/presets/shadcn-variants/radio.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/radio.js +192 -0
- package/dist/presets/shadcn-variants/radio.js.map +1 -0
- package/dist/presets/shadcn-variants/select.d.ts +203 -0
- package/dist/presets/shadcn-variants/select.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/select.js +285 -0
- package/dist/presets/shadcn-variants/select.js.map +1 -0
- package/dist/presets/shadcn-variants/slider.d.ts +131 -0
- package/dist/presets/shadcn-variants/slider.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/slider.js +151 -0
- package/dist/presets/shadcn-variants/slider.js.map +1 -0
- package/dist/presets/shadcn-variants/text.d.ts +155 -0
- package/dist/presets/shadcn-variants/text.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/text.js +98 -0
- package/dist/presets/shadcn-variants/text.js.map +1 -0
- package/dist/presets/shadcn-variants/textarea.d.ts +18 -0
- package/dist/presets/shadcn-variants/textarea.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/textarea.js +24 -0
- package/dist/presets/shadcn-variants/textarea.js.map +1 -0
- package/dist/presets/shadcn-variants/toggle.d.ts +61 -0
- package/dist/presets/shadcn-variants/toggle.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/toggle.js +67 -0
- package/dist/presets/shadcn-variants/toggle.js.map +1 -0
- package/dist/presets/shadcn-variants/treeselect.d.ts +81 -0
- package/dist/presets/shadcn-variants/treeselect.d.ts.map +1 -0
- package/dist/presets/shadcn-variants/treeselect.js +317 -0
- package/dist/presets/shadcn-variants/treeselect.js.map +1 -0
- package/dist/presets/ui/badge.d.ts +10 -0
- package/dist/presets/ui/badge.d.ts.map +1 -0
- package/dist/presets/ui/badge.js +23 -0
- package/dist/presets/ui/badge.js.map +1 -0
- package/dist/presets/ui/button.d.ts +11 -0
- package/dist/presets/ui/button.d.ts.map +1 -0
- package/dist/presets/ui/button.js +34 -0
- package/dist/presets/ui/button.js.map +1 -0
- package/dist/presets/ui/calendar.d.ts +9 -0
- package/dist/presets/ui/calendar.d.ts.map +1 -0
- package/dist/presets/ui/calendar.js +76 -0
- package/dist/presets/ui/calendar.js.map +1 -0
- package/dist/presets/ui/checkbox.d.ts +18 -0
- package/dist/presets/ui/checkbox.d.ts.map +1 -0
- package/dist/presets/ui/checkbox.js +61 -0
- package/dist/presets/ui/checkbox.js.map +1 -0
- package/dist/presets/ui/custom.d.ts +1 -0
- package/dist/presets/ui/custom.d.ts.map +1 -0
- package/dist/presets/ui/custom.js +2 -0
- package/dist/presets/ui/custom.js.map +1 -0
- package/dist/presets/ui/dialog.d.ts +16 -0
- package/dist/presets/ui/dialog.d.ts.map +1 -0
- package/dist/presets/ui/dialog.js +36 -0
- package/dist/presets/ui/dialog.js.map +1 -0
- package/dist/presets/ui/field.d.ts +25 -0
- package/dist/presets/ui/field.d.ts.map +1 -0
- package/dist/presets/ui/field.js +76 -0
- package/dist/presets/ui/field.js.map +1 -0
- package/dist/presets/ui/input-mask.d.ts +34 -0
- package/dist/presets/ui/input-mask.d.ts.map +1 -0
- package/dist/presets/ui/input-mask.js +561 -0
- package/dist/presets/ui/input-mask.js.map +1 -0
- package/dist/presets/ui/input-otp.d.ts +12 -0
- package/dist/presets/ui/input-otp.d.ts.map +1 -0
- package/dist/presets/ui/input-otp.js +22 -0
- package/dist/presets/ui/input-otp.js.map +1 -0
- package/dist/presets/ui/input.d.ts +83 -0
- package/dist/presets/ui/input.d.ts.map +1 -0
- package/dist/presets/ui/input.js +436 -0
- package/dist/presets/ui/input.js.map +1 -0
- package/dist/presets/ui/label.d.ts +5 -0
- package/dist/presets/ui/label.d.ts.map +1 -0
- package/dist/presets/ui/label.js +8 -0
- package/dist/presets/ui/label.js.map +1 -0
- package/dist/presets/ui/number.d.ts +60 -0
- package/dist/presets/ui/number.d.ts.map +1 -0
- package/dist/presets/ui/number.js +1078 -0
- package/dist/presets/ui/number.js.map +1 -0
- package/dist/presets/ui/popover.d.ts +8 -0
- package/dist/presets/ui/popover.d.ts.map +1 -0
- package/dist/presets/ui/popover.js +17 -0
- package/dist/presets/ui/popover.js.map +1 -0
- package/dist/presets/ui/radio-group.d.ts +6 -0
- package/dist/presets/ui/radio-group.d.ts.map +1 -0
- package/dist/presets/ui/radio-group.js +12 -0
- package/dist/presets/ui/radio-group.js.map +1 -0
- package/dist/presets/ui/scroll-area.d.ts +6 -0
- package/dist/presets/ui/scroll-area.d.ts.map +1 -0
- package/dist/presets/ui/scroll-area.js +13 -0
- package/dist/presets/ui/scroll-area.js.map +1 -0
- package/dist/presets/ui/select.d.ts +21 -0
- package/dist/presets/ui/select.d.ts.map +1 -0
- package/dist/presets/ui/select.js +38 -0
- package/dist/presets/ui/select.js.map +1 -0
- package/dist/presets/ui/separator.d.ts +5 -0
- package/dist/presets/ui/separator.d.ts.map +1 -0
- package/dist/presets/ui/separator.js +9 -0
- package/dist/presets/ui/separator.js.map +1 -0
- package/dist/presets/ui/slider.d.ts +5 -0
- package/dist/presets/ui/slider.d.ts.map +1 -0
- package/dist/presets/ui/slider.js +14 -0
- package/dist/presets/ui/slider.js.map +1 -0
- package/dist/presets/ui/switch.d.ts +7 -0
- package/dist/presets/ui/switch.d.ts.map +1 -0
- package/dist/presets/ui/switch.js +9 -0
- package/dist/presets/ui/switch.js.map +1 -0
- package/dist/presets/ui/textarea.d.ts +76 -0
- package/dist/presets/ui/textarea.d.ts.map +1 -0
- package/dist/presets/ui/textarea.js +291 -0
- package/dist/presets/ui/textarea.js.map +1 -0
- package/dist/presets/ui/time-dropdowns.d.ts +58 -0
- package/dist/presets/ui/time-dropdowns.d.ts.map +1 -0
- package/dist/presets/ui/time-dropdowns.js +133 -0
- package/dist/presets/ui/time-dropdowns.js.map +1 -0
- package/{src/schema/adapter.ts → dist/schema/adapter.d.ts} +7 -35
- package/dist/schema/adapter.d.ts.map +1 -0
- package/dist/schema/adapter.js +3 -0
- package/dist/schema/adapter.js.map +1 -0
- package/{src/schema/core.ts → dist/schema/core.d.ts} +17 -117
- package/dist/schema/core.d.ts.map +1 -0
- package/dist/schema/core.js +4 -0
- package/dist/schema/core.js.map +1 -0
- package/dist/schema/field-map.d.ts +1 -0
- package/dist/schema/field-map.d.ts.map +1 -0
- package/dist/schema/field-map.js +2 -0
- package/dist/schema/field-map.js.map +1 -0
- package/{src/schema/field.ts → dist/schema/field.d.ts} +1 -34
- package/dist/schema/field.d.ts.map +1 -0
- package/dist/schema/field.js +4 -0
- package/dist/schema/field.js.map +1 -0
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +2 -0
- package/dist/schema/index.js.map +1 -0
- package/{src/schema/input-field.ts → dist/schema/input-field.d.ts} +6 -43
- package/dist/schema/input-field.d.ts.map +1 -0
- package/dist/schema/input-field.js +3 -0
- package/dist/schema/input-field.js.map +1 -0
- package/dist/schema/presets.d.ts +1 -0
- package/dist/schema/presets.d.ts.map +1 -0
- package/dist/schema/presets.js +2 -0
- package/dist/schema/presets.js.map +1 -0
- package/{src/schema/variant.ts → dist/schema/variant.d.ts} +24 -64
- package/dist/schema/variant.d.ts.map +1 -0
- package/dist/schema/variant.js +3 -0
- package/dist/schema/variant.js.map +1 -0
- package/dist/variants/core/checkbox.d.ts +15 -0
- package/dist/variants/core/checkbox.d.ts.map +1 -0
- package/dist/variants/core/checkbox.js +27 -0
- package/dist/variants/core/checkbox.js.map +1 -0
- package/dist/variants/core/chips.d.ts +3 -0
- package/dist/variants/core/chips.d.ts.map +1 -0
- package/dist/variants/core/chips.js +20 -0
- package/dist/variants/core/chips.js.map +1 -0
- package/dist/variants/core/color.d.ts +3 -0
- package/dist/variants/core/color.d.ts.map +1 -0
- package/dist/variants/core/color.js +14 -0
- package/dist/variants/core/color.js.map +1 -0
- package/dist/variants/core/custom.d.ts +11 -0
- package/dist/variants/core/custom.d.ts.map +1 -0
- package/{src/variants/core/custom.tsx → dist/variants/core/custom.js} +15 -18
- package/dist/variants/core/custom.js.map +1 -0
- package/dist/variants/core/date.d.ts +3 -0
- package/dist/variants/core/date.d.ts.map +1 -0
- package/dist/variants/core/date.js +20 -0
- package/dist/variants/core/date.js.map +1 -0
- package/dist/variants/core/file.d.ts +3 -0
- package/dist/variants/core/file.d.ts.map +1 -0
- package/dist/variants/core/file.js +6 -0
- package/dist/variants/core/file.js.map +1 -0
- package/dist/variants/core/keyvalue.d.ts +3 -0
- package/dist/variants/core/keyvalue.d.ts.map +1 -0
- package/dist/variants/core/keyvalue.js +9 -0
- package/dist/variants/core/keyvalue.js.map +1 -0
- package/dist/variants/core/multiselect.d.ts +11 -0
- package/dist/variants/core/multiselect.d.ts.map +1 -0
- package/dist/variants/core/multiselect.js +15 -0
- package/dist/variants/core/multiselect.js.map +1 -0
- package/dist/variants/core/number.d.ts +38 -0
- package/dist/variants/core/number.d.ts.map +1 -0
- package/dist/variants/core/number.js +62 -0
- package/dist/variants/core/number.js.map +1 -0
- package/dist/variants/core/password.d.ts +11 -0
- package/dist/variants/core/password.d.ts.map +1 -0
- package/dist/variants/core/password.js +29 -0
- package/dist/variants/core/password.js.map +1 -0
- package/dist/variants/core/phone.d.ts +3 -0
- package/dist/variants/core/phone.d.ts.map +1 -0
- package/dist/variants/core/phone.js +14 -0
- package/dist/variants/core/phone.js.map +1 -0
- package/dist/variants/core/radio.d.ts +8 -0
- package/dist/variants/core/radio.d.ts.map +1 -0
- package/dist/variants/core/radio.js +34 -0
- package/dist/variants/core/radio.js.map +1 -0
- package/dist/variants/core/select.d.ts +5 -0
- package/dist/variants/core/select.d.ts.map +1 -0
- package/dist/variants/core/select.js +11 -0
- package/dist/variants/core/select.js.map +1 -0
- package/dist/variants/core/slider.d.ts +19 -0
- package/dist/variants/core/slider.d.ts.map +1 -0
- package/dist/variants/core/slider.js +36 -0
- package/dist/variants/core/slider.js.map +1 -0
- package/dist/variants/core/text.d.ts +38 -0
- package/dist/variants/core/text.d.ts.map +1 -0
- package/{src/variants/core/text.tsx → dist/variants/core/text.js} +4 -56
- package/dist/variants/core/text.js.map +1 -0
- package/dist/variants/core/textarea.d.ts +3 -0
- package/dist/variants/core/textarea.d.ts.map +1 -0
- package/dist/variants/core/textarea.js +20 -0
- package/dist/variants/core/textarea.js.map +1 -0
- package/dist/variants/core/toggle.d.ts +6 -0
- package/dist/variants/core/toggle.d.ts.map +1 -0
- package/dist/variants/core/toggle.js +41 -0
- package/dist/variants/core/toggle.js.map +1 -0
- package/dist/variants/core/treeselect.d.ts +4 -0
- package/dist/variants/core/treeselect.d.ts.map +1 -0
- package/dist/variants/core/treeselect.js +7 -0
- package/dist/variants/core/treeselect.js.map +1 -0
- package/dist/variants/helpers/selection-summary.d.ts +24 -0
- package/dist/variants/helpers/selection-summary.d.ts.map +1 -0
- package/dist/variants/helpers/selection-summary.js +105 -0
- package/dist/variants/helpers/selection-summary.js.map +1 -0
- package/dist/variants/index.d.ts +16 -0
- package/dist/variants/index.d.ts.map +1 -0
- package/{src/variants/index.ts → dist/variants/index.js} +7 -27
- package/dist/variants/index.js.map +1 -0
- package/dist/variants/registry.d.ts +19 -0
- package/dist/variants/registry.d.ts.map +1 -0
- package/dist/variants/registry.js +29 -0
- package/dist/variants/registry.js.map +1 -0
- package/dist/variants/select-shared.d.ts +1 -0
- package/dist/variants/select-shared.d.ts.map +1 -0
- package/dist/variants/select-shared.js +2 -0
- package/dist/variants/select-shared.js.map +1 -0
- package/{src/variants/shared.ts → dist/variants/shared.d.ts} +3 -22
- package/dist/variants/shared.d.ts.map +1 -0
- package/dist/variants/shared.js +3 -0
- package/dist/variants/shared.js.map +1 -0
- package/package.json +5 -5
- package/.scaffold-cache.json +0 -537
- package/src/.scaffold-cache.json +0 -544
- package/src/adapters/axios.ts +0 -117
- package/src/adapters/index.ts +0 -91
- package/src/adapters/inertia.ts +0 -187
- package/src/core/bound/observe-bound-field.ts +0 -172
- package/src/core/bound/wait-for-bound-field.ts +0 -57
- package/src/core/core-root.tsx +0 -72
- package/src/core/core-shell.tsx +0 -44
- package/src/core/errors/index.ts +0 -2
- package/src/core/hooks/use-button.ts +0 -220
- package/src/core/hooks/use-core-utility.ts +0 -0
- package/src/core/hooks/use-field.ts +0 -497
- package/src/core/hooks/use-optional-field.ts +0 -28
- package/src/core/index.ts +0 -0
- package/src/core/registry/binder-registry.ts +0 -82
- package/src/core/test.tsx +0 -17
- package/src/global.d.ts +0 -14
- package/src/input/input-field.tsx +0 -854
- package/src/input/input-layout-graph.ts +0 -230
- package/src/lib/get-global-countries.ts +0 -87
- package/src/lib/utils.ts +0 -6
- package/src/presets/index.ts +0 -0
- package/src/presets/shadcn-preset.ts +0 -0
- package/src/presets/shadcn-variants/checkbox.tsx +0 -849
- package/src/presets/shadcn-variants/chips.tsx +0 -756
- package/src/presets/shadcn-variants/color.tsx +0 -284
- package/src/presets/shadcn-variants/custom.tsx +0 -227
- package/src/presets/shadcn-variants/date.tsx +0 -796
- package/src/presets/shadcn-variants/file.tsx +0 -764
- package/src/presets/shadcn-variants/keyvalue.tsx +0 -556
- package/src/presets/shadcn-variants/multiselect.tsx +0 -1132
- package/src/presets/shadcn-variants/number.tsx +0 -176
- package/src/presets/shadcn-variants/password.tsx +0 -737
- package/src/presets/shadcn-variants/phone.tsx +0 -628
- package/src/presets/shadcn-variants/radio.tsx +0 -578
- package/src/presets/shadcn-variants/select.tsx +0 -956
- package/src/presets/shadcn-variants/slider.tsx +0 -622
- package/src/presets/shadcn-variants/text.tsx +0 -343
- package/src/presets/shadcn-variants/textarea.tsx +0 -66
- package/src/presets/shadcn-variants/toggle.tsx +0 -218
- package/src/presets/shadcn-variants/treeselect.tsx +0 -784
- package/src/presets/ui/badge.tsx +0 -46
- package/src/presets/ui/button.tsx +0 -60
- package/src/presets/ui/calendar.tsx +0 -214
- package/src/presets/ui/checkbox.tsx +0 -115
- package/src/presets/ui/custom.tsx +0 -0
- package/src/presets/ui/dialog.tsx +0 -141
- package/src/presets/ui/field.tsx +0 -246
- package/src/presets/ui/input-mask.tsx +0 -739
- package/src/presets/ui/input-otp.tsx +0 -77
- package/src/presets/ui/input.tsx +0 -1011
- package/src/presets/ui/label.tsx +0 -22
- package/src/presets/ui/number.tsx +0 -1370
- package/src/presets/ui/popover.tsx +0 -46
- package/src/presets/ui/radio-group.tsx +0 -43
- package/src/presets/ui/scroll-area.tsx +0 -56
- package/src/presets/ui/select.tsx +0 -190
- package/src/presets/ui/separator.tsx +0 -28
- package/src/presets/ui/slider.tsx +0 -61
- package/src/presets/ui/switch.tsx +0 -32
- package/src/presets/ui/textarea.tsx +0 -634
- package/src/presets/ui/time-dropdowns.tsx +0 -350
- package/src/schema/field-map.ts +0 -0
- package/src/schema/index.ts +0 -0
- package/src/schema/presets.ts +0 -0
- package/src/variants/core/checkbox.tsx +0 -54
- package/src/variants/core/chips.tsx +0 -22
- package/src/variants/core/color.tsx +0 -16
- package/src/variants/core/date.tsx +0 -25
- package/src/variants/core/file.tsx +0 -9
- package/src/variants/core/keyvalue.tsx +0 -12
- package/src/variants/core/multiselect.tsx +0 -28
- package/src/variants/core/number.tsx +0 -115
- package/src/variants/core/password.tsx +0 -35
- package/src/variants/core/phone.tsx +0 -16
- package/src/variants/core/radio.tsx +0 -38
- package/src/variants/core/select.tsx +0 -15
- package/src/variants/core/slider.tsx +0 -55
- package/src/variants/core/textarea.tsx +0 -22
- package/src/variants/core/toggle.tsx +0 -50
- package/src/variants/core/treeselect.tsx +0 -11
- package/src/variants/helpers/selection-summary.tsx +0 -236
- package/src/variants/registry.ts +0 -38
- package/src/variants/select-shared.ts +0 -0
- package/tsconfig.json +0 -14
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { cn } from "@/lib/utils";
|
|
3
|
-
import {
|
|
4
|
-
Select,
|
|
5
|
-
SelectTrigger,
|
|
6
|
-
SelectValue,
|
|
7
|
-
SelectContent,
|
|
8
|
-
SelectItem,
|
|
9
|
-
} from "@/presets/ui/select";
|
|
10
|
-
|
|
11
|
-
export interface TimeDropdownsProps {
|
|
12
|
-
/**
|
|
13
|
-
* Current date-time value.
|
|
14
|
-
* Only the time portion will be modified; date part is preserved.
|
|
15
|
-
*/
|
|
16
|
-
value: Date | undefined;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Called whenever any of the time parts change.
|
|
20
|
-
*/
|
|
21
|
-
onChange(next: Date | undefined): void;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Whether to show seconds dropdown.
|
|
25
|
-
* Default: false.
|
|
26
|
-
*/
|
|
27
|
-
showSeconds?: boolean;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Step between minutes in the dropdown.
|
|
31
|
-
* Default: 5.
|
|
32
|
-
*/
|
|
33
|
-
minuteStep?: number;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Step between seconds in the dropdown.
|
|
37
|
-
* Default: 5.
|
|
38
|
-
*/
|
|
39
|
-
secondStep?: number;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* If true, show 12-hour clock with AM/PM toggle.
|
|
43
|
-
* If false, show 24-hour clock (00–23).
|
|
44
|
-
* Default: false (24-hour).
|
|
45
|
-
*/
|
|
46
|
-
use12Hour?: boolean;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Optional label to show above or beside the dropdowns.
|
|
50
|
-
*/
|
|
51
|
-
label?: React.ReactNode;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Custom className for the outer wrapper.
|
|
55
|
-
*/
|
|
56
|
-
className?: string;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Custom className for each SelectTrigger (hours/minutes/seconds).
|
|
60
|
-
*/
|
|
61
|
-
triggerClassName?: string;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Compact / normal layout toggle.
|
|
65
|
-
* Just a quick spacing switch for now.
|
|
66
|
-
*/
|
|
67
|
-
density?: "compact" | "normal";
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function pad2(n: number): string {
|
|
71
|
-
return n.toString().padStart(2, "0");
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function buildMinuteOptions(step: number): string[] {
|
|
75
|
-
const items: string[] = [];
|
|
76
|
-
for (let m = 0; m < 60; m += step) {
|
|
77
|
-
items.push(pad2(m));
|
|
78
|
-
}
|
|
79
|
-
return items;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function buildSecondOptions(step: number): string[] {
|
|
83
|
-
const items: string[] = [];
|
|
84
|
-
for (let s = 0; s < 60; s += step) {
|
|
85
|
-
items.push(pad2(s));
|
|
86
|
-
}
|
|
87
|
-
return items;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function buildHourOptions24(): string[] {
|
|
91
|
-
const items: string[] = [];
|
|
92
|
-
for (let h = 0; h < 24; h++) {
|
|
93
|
-
items.push(pad2(h));
|
|
94
|
-
}
|
|
95
|
-
return items;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function buildHourOptions12(): string[] {
|
|
99
|
-
const items: string[] = [];
|
|
100
|
-
for (let h = 1; h <= 12; h++) {
|
|
101
|
-
items.push(h.toString());
|
|
102
|
-
}
|
|
103
|
-
return items;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Safely create a new Date instance with updated time parts,
|
|
108
|
-
* preserving the original date portion when possible.
|
|
109
|
-
*/
|
|
110
|
-
function withTime(
|
|
111
|
-
base: Date | undefined,
|
|
112
|
-
opts: { hours?: number; minutes?: number; seconds?: number },
|
|
113
|
-
): Date {
|
|
114
|
-
const src = base ? new Date(base.getTime()) : new Date();
|
|
115
|
-
const h = opts.hours ?? src.getHours();
|
|
116
|
-
const m = opts.minutes ?? src.getMinutes();
|
|
117
|
-
const s = opts.seconds ?? src.getSeconds();
|
|
118
|
-
src.setHours(h, m, s, 0);
|
|
119
|
-
return src;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Drop-in time dropdown cluster for use in the date popover.
|
|
124
|
-
*
|
|
125
|
-
* Renders hour / minute (and optionally second) Selects plus
|
|
126
|
-
* an AM/PM toggle when `use12Hour` is true.
|
|
127
|
-
*/
|
|
128
|
-
export const TimeDropdowns: React.FC<TimeDropdownsProps> = (props) => {
|
|
129
|
-
const {
|
|
130
|
-
value,
|
|
131
|
-
onChange,
|
|
132
|
-
showSeconds = false,
|
|
133
|
-
minuteStep = 5,
|
|
134
|
-
secondStep = 5,
|
|
135
|
-
use12Hour = false,
|
|
136
|
-
label,
|
|
137
|
-
className,
|
|
138
|
-
triggerClassName,
|
|
139
|
-
density = "normal",
|
|
140
|
-
} = props;
|
|
141
|
-
|
|
142
|
-
const minuteOptions = React.useMemo(
|
|
143
|
-
() => buildMinuteOptions(minuteStep),
|
|
144
|
-
[minuteStep],
|
|
145
|
-
);
|
|
146
|
-
const secondOptions = React.useMemo(
|
|
147
|
-
() => buildSecondOptions(secondStep),
|
|
148
|
-
[secondStep],
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
const hourOptions = React.useMemo(
|
|
152
|
-
() => (use12Hour ? buildHourOptions12() : buildHourOptions24()),
|
|
153
|
-
[use12Hour],
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
// Derive current parts from value.
|
|
157
|
-
let hours24 = value ? value.getHours() : 0;
|
|
158
|
-
let minutes = value ? value.getMinutes() : 0;
|
|
159
|
-
let seconds = value ? value.getSeconds() : 0;
|
|
160
|
-
|
|
161
|
-
let hourDisplay: string;
|
|
162
|
-
let period: "am" | "pm" | null = null;
|
|
163
|
-
|
|
164
|
-
if (use12Hour) {
|
|
165
|
-
period = hours24 >= 12 ? "pm" : "am";
|
|
166
|
-
let h12 = hours24 % 12;
|
|
167
|
-
if (h12 === 0) h12 = 12;
|
|
168
|
-
hourDisplay = h12.toString();
|
|
169
|
-
} else {
|
|
170
|
-
hourDisplay = pad2(hours24);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const minuteDisplay = pad2(minutes);
|
|
174
|
-
const secondDisplay = pad2(seconds);
|
|
175
|
-
|
|
176
|
-
const baseTriggerClasses = cn(
|
|
177
|
-
"h-8 w-[4.2rem] px-2 py-0 text-xs",
|
|
178
|
-
"whitespace-nowrap",
|
|
179
|
-
"border-input bg-background",
|
|
180
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
const triggerClasses = cn(
|
|
184
|
-
baseTriggerClasses,
|
|
185
|
-
triggerClassName,
|
|
186
|
-
density === "compact" && "h-7 text-[0.7rem] px-1.5",
|
|
187
|
-
);
|
|
188
|
-
|
|
189
|
-
const gapClass = density === "compact" ? "gap-1" : "gap-2";
|
|
190
|
-
|
|
191
|
-
const handleHourChange = (hStr: string) => {
|
|
192
|
-
let nextHours24: number;
|
|
193
|
-
|
|
194
|
-
if (use12Hour) {
|
|
195
|
-
const h12 = parseInt(hStr, 10) || 0;
|
|
196
|
-
if (!period) {
|
|
197
|
-
// fallback: assume AM
|
|
198
|
-
nextHours24 = h12 % 12;
|
|
199
|
-
} else {
|
|
200
|
-
if (period === "am") {
|
|
201
|
-
nextHours24 = h12 % 12; // 12am → 0
|
|
202
|
-
} else {
|
|
203
|
-
nextHours24 = h12 % 12 + 12; // 12pm → 12, 1pm → 13
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
} else {
|
|
207
|
-
nextHours24 = parseInt(hStr, 10) || 0;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const nextDate = withTime(value, { hours: nextHours24 });
|
|
211
|
-
onChange(nextDate);
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
const handleMinuteChange = (mStr: string) => {
|
|
215
|
-
const m = parseInt(mStr, 10) || 0;
|
|
216
|
-
const nextDate = withTime(value, { minutes: m });
|
|
217
|
-
onChange(nextDate);
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
const handleSecondChange = (sStr: string) => {
|
|
221
|
-
const s = parseInt(sStr, 10) || 0;
|
|
222
|
-
const nextDate = withTime(value, { seconds: s });
|
|
223
|
-
onChange(nextDate);
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
const handlePeriodChange = (p: string) => {
|
|
227
|
-
if (!use12Hour) return;
|
|
228
|
-
const nextPeriod = p === "pm" ? "pm" : "am";
|
|
229
|
-
|
|
230
|
-
// Convert from current hours24 + new period.
|
|
231
|
-
let h12 = hours24 % 12;
|
|
232
|
-
if (h12 === 0) h12 = 12;
|
|
233
|
-
|
|
234
|
-
let nextHours24: number;
|
|
235
|
-
if (nextPeriod === "am") {
|
|
236
|
-
nextHours24 = h12 % 12; // 12am → 0
|
|
237
|
-
} else {
|
|
238
|
-
nextHours24 = h12 % 12 + 12; // 12pm → 12, etc.
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
const nextDate = withTime(value, { hours: nextHours24 });
|
|
242
|
-
onChange(nextDate);
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
return (
|
|
246
|
-
<div
|
|
247
|
-
className={cn(
|
|
248
|
-
"flex w-full flex-col gap-2",
|
|
249
|
-
density === "compact" && "gap-1",
|
|
250
|
-
className,
|
|
251
|
-
)}
|
|
252
|
-
data-slot="time-dropdowns"
|
|
253
|
-
>
|
|
254
|
-
{label && (
|
|
255
|
-
<div className="text-xs font-medium text-muted-foreground">
|
|
256
|
-
{label}
|
|
257
|
-
</div>
|
|
258
|
-
)}
|
|
259
|
-
|
|
260
|
-
<div
|
|
261
|
-
className={cn(
|
|
262
|
-
"flex w-full items-center",
|
|
263
|
-
gapClass,
|
|
264
|
-
)}
|
|
265
|
-
data-slot="time-dropdowns-row"
|
|
266
|
-
>
|
|
267
|
-
{/* Hour */}
|
|
268
|
-
<Select value={hourDisplay} onValueChange={handleHourChange}>
|
|
269
|
-
<SelectTrigger
|
|
270
|
-
className={triggerClasses}
|
|
271
|
-
data-slot="time-hour"
|
|
272
|
-
>
|
|
273
|
-
<SelectValue placeholder="HH" />
|
|
274
|
-
</SelectTrigger>
|
|
275
|
-
<SelectContent>
|
|
276
|
-
{hourOptions.map((h) => (
|
|
277
|
-
<SelectItem key={h} value={h}>
|
|
278
|
-
{use12Hour ? h.padStart(2, " ") : pad2(Number(h))}
|
|
279
|
-
</SelectItem>
|
|
280
|
-
))}
|
|
281
|
-
</SelectContent>
|
|
282
|
-
</Select>
|
|
283
|
-
|
|
284
|
-
{/* Minute */}
|
|
285
|
-
<Select
|
|
286
|
-
value={minuteDisplay}
|
|
287
|
-
onValueChange={handleMinuteChange}
|
|
288
|
-
>
|
|
289
|
-
<SelectTrigger
|
|
290
|
-
className={triggerClasses}
|
|
291
|
-
data-slot="time-minute"
|
|
292
|
-
>
|
|
293
|
-
<SelectValue placeholder="MM" />
|
|
294
|
-
</SelectTrigger>
|
|
295
|
-
<SelectContent>
|
|
296
|
-
{minuteOptions.map((m) => (
|
|
297
|
-
<SelectItem key={m} value={m}>
|
|
298
|
-
{m}
|
|
299
|
-
</SelectItem>
|
|
300
|
-
))}
|
|
301
|
-
</SelectContent>
|
|
302
|
-
</Select>
|
|
303
|
-
|
|
304
|
-
{/* Second (optional) */}
|
|
305
|
-
{showSeconds && (
|
|
306
|
-
<Select
|
|
307
|
-
value={secondDisplay}
|
|
308
|
-
onValueChange={handleSecondChange}
|
|
309
|
-
>
|
|
310
|
-
<SelectTrigger
|
|
311
|
-
className={triggerClasses}
|
|
312
|
-
data-slot="time-second"
|
|
313
|
-
>
|
|
314
|
-
<SelectValue placeholder="SS" />
|
|
315
|
-
</SelectTrigger>
|
|
316
|
-
<SelectContent>
|
|
317
|
-
{secondOptions.map((s) => (
|
|
318
|
-
<SelectItem key={s} value={s}>
|
|
319
|
-
{s}
|
|
320
|
-
</SelectItem>
|
|
321
|
-
))}
|
|
322
|
-
</SelectContent>
|
|
323
|
-
</Select>
|
|
324
|
-
)}
|
|
325
|
-
|
|
326
|
-
{/* AM/PM (optional) */}
|
|
327
|
-
{use12Hour && (
|
|
328
|
-
<Select
|
|
329
|
-
value={period ?? "am"}
|
|
330
|
-
onValueChange={handlePeriodChange}
|
|
331
|
-
>
|
|
332
|
-
<SelectTrigger
|
|
333
|
-
className={cn(
|
|
334
|
-
triggerClasses,
|
|
335
|
-
"w-[3.8rem]",
|
|
336
|
-
)}
|
|
337
|
-
data-slot="time-period"
|
|
338
|
-
>
|
|
339
|
-
<SelectValue />
|
|
340
|
-
</SelectTrigger>
|
|
341
|
-
<SelectContent>
|
|
342
|
-
<SelectItem value="am">AM</SelectItem>
|
|
343
|
-
<SelectItem value="pm">PM</SelectItem>
|
|
344
|
-
</SelectContent>
|
|
345
|
-
</Select>
|
|
346
|
-
)}
|
|
347
|
-
</div>
|
|
348
|
-
</div>
|
|
349
|
-
);
|
|
350
|
-
};
|
package/src/schema/field-map.ts
DELETED
|
File without changes
|
package/src/schema/index.ts
DELETED
|
File without changes
|
package/src/schema/presets.ts
DELETED
|
File without changes
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// src/variants/core/checkbox.ts
|
|
2
|
-
|
|
3
|
-
import type { VariantModuleFor } from "@/schema/variant";
|
|
4
|
-
import { ShadcnCheckboxVariant } from "@/presets/shadcn-variants/checkbox";
|
|
5
|
-
import type {
|
|
6
|
-
ShadcnCheckboxVariantPublicProps,
|
|
7
|
-
CheckboxVariantPublicValue,
|
|
8
|
-
} from "@/presets/shadcn-variants/checkbox";
|
|
9
|
-
import type { VariantBaseProps } from "@/variants/shared";
|
|
10
|
-
import { toggleLayoutDefaults } from "./toggle";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Public props type you can import elsewhere:
|
|
14
|
-
*
|
|
15
|
-
* import type { CheckboxVariantProps } from "@/variants/core/checkbox";
|
|
16
|
-
*/
|
|
17
|
-
export type CheckboxVariantProps = ShadcnCheckboxVariantPublicProps;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Concrete Variant component type, if you need it:
|
|
21
|
-
*
|
|
22
|
-
* VariantBaseProps<CheckboxVariantPublicValue> & CheckboxVariantProps
|
|
23
|
-
*/
|
|
24
|
-
type CheckboxVariantComponentProps =
|
|
25
|
-
VariantBaseProps<CheckboxVariantPublicValue> & CheckboxVariantProps;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Runtime module for the "checkbox" variant.
|
|
29
|
-
*
|
|
30
|
-
* This wires the Shadcn preset into the core registry with sensible defaults.
|
|
31
|
-
*/
|
|
32
|
-
export const checkboxModule: VariantModuleFor<"checkbox"> = {
|
|
33
|
-
variant: "checkbox",
|
|
34
|
-
|
|
35
|
-
// ShadcnCheckboxVariant is generic; we fix it to the public aliases
|
|
36
|
-
// via this cast. At call sites you'll still get strong typing because
|
|
37
|
-
// the registry types know the concrete value/props.
|
|
38
|
-
Variant: ShadcnCheckboxVariant as unknown as React.ComponentType<CheckboxVariantComponentProps>,
|
|
39
|
-
|
|
40
|
-
resolveLayout({ props }) {
|
|
41
|
-
if (props.single) {
|
|
42
|
-
return toggleLayoutDefaults
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return {};
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
meta: {
|
|
49
|
-
label: "Checkbox",
|
|
50
|
-
description:
|
|
51
|
-
"Single or group checkboxes with optional per-item tri-state support.",
|
|
52
|
-
tags: ["checkbox", "group", "boolean", "tri-state"],
|
|
53
|
-
},
|
|
54
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import ShadcnChipsVariant from "@/presets/shadcn-variants/chips";
|
|
2
|
-
import { VariantModuleFor } from "@/schema/variant";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const chipVariant: VariantModuleFor<"chips"> = {
|
|
6
|
-
variant: "chips",
|
|
7
|
-
Variant: ShadcnChipsVariant as any,
|
|
8
|
-
// Optional layout defaults – tweak as you like
|
|
9
|
-
defaults: {
|
|
10
|
-
layout: {
|
|
11
|
-
fullWidth: true,
|
|
12
|
-
// You can set defaultSize/defaultDensity here if you want:
|
|
13
|
-
// defaultSize: "md",
|
|
14
|
-
// defaultDensity: "normal",
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
meta: {
|
|
18
|
-
label: "Chips",
|
|
19
|
-
description: "Chips input allowing multiple selections.",
|
|
20
|
-
tags: ["chips", "multi-select", "tags"],
|
|
21
|
-
},
|
|
22
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// ———————————————————————————————
|
|
2
|
-
// VariantModule wiring
|
|
3
|
-
|
|
4
|
-
import { ShadcnColorVariant } from "@/presets/shadcn-variants/color";
|
|
5
|
-
import { VariantModule } from "@/schema/variant";
|
|
6
|
-
|
|
7
|
-
// ———————————————————————————————
|
|
8
|
-
export const ColorVariantModule: VariantModule<"color"> = {
|
|
9
|
-
variant: "color",
|
|
10
|
-
Variant: ShadcnColorVariant,
|
|
11
|
-
meta: {
|
|
12
|
-
label: "Phone",
|
|
13
|
-
description: "Phone number input with country code and masking.",
|
|
14
|
-
tags: ["phone", "tel", "contact"],
|
|
15
|
-
},
|
|
16
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import ShadcnDateVariant from "@/presets/shadcn-variants/date";
|
|
2
|
-
import { VariantModuleFor } from "@/schema/variant";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const dateVariant: VariantModuleFor<"date"> = {
|
|
6
|
-
variant: "date",
|
|
7
|
-
Variant: ShadcnDateVariant as any,
|
|
8
|
-
|
|
9
|
-
// Optional layout defaults – tweak as you like
|
|
10
|
-
defaults: {
|
|
11
|
-
layout: {
|
|
12
|
-
fullWidth: true,
|
|
13
|
-
// You can set defaultSize/defaultDensity here if you want:
|
|
14
|
-
// defaultSize: "md",
|
|
15
|
-
// defaultDensity: "normal",
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
meta: {
|
|
20
|
-
label: "Date",
|
|
21
|
-
description:
|
|
22
|
-
"Date input with calendar picker.",
|
|
23
|
-
tags: ["date", "calendar", "picker"],
|
|
24
|
-
},
|
|
25
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import ShadcnKeyValueVariant from "@/presets/shadcn-variants/keyvalue";
|
|
2
|
-
import { VariantModule } from "@/schema/variant";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const keyValueModule: VariantModule<'keyvalue'> = {
|
|
6
|
-
variant: 'keyvalue',
|
|
7
|
-
Variant: ShadcnKeyValueVariant,
|
|
8
|
-
|
|
9
|
-
meta: {
|
|
10
|
-
label: ''
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// src/variants/multi-select.ts
|
|
4
|
-
|
|
5
|
-
import type { VariantModule } from "@/schema/variant";
|
|
6
|
-
import {
|
|
7
|
-
ShadcnMultiSelectVariant,
|
|
8
|
-
type ShadcnMultiSelectVariantProps,
|
|
9
|
-
} from "@/presets/shadcn-variants/multiselect";
|
|
10
|
-
|
|
11
|
-
export type MultiSelectValue = (string | number)[] | undefined;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Variant module for "multi-select".
|
|
16
|
-
*
|
|
17
|
-
* No defaults / layout overrides here — layout is driven by InputField +
|
|
18
|
-
* host overrides, same as your other variants.
|
|
19
|
-
*/
|
|
20
|
-
export const multiSelectVariantModule: VariantModule<"multi-select"> = {
|
|
21
|
-
variant: "multi-select",
|
|
22
|
-
Variant: ShadcnMultiSelectVariant,
|
|
23
|
-
meta: {
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default multiSelectVariantModule;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
// src/variants/core/text.tsx
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import type { Dict } from "@/schema/core";
|
|
6
|
-
import type { VariantModule } from "@/schema/variant";
|
|
7
|
-
import type { ValidateResult } from "@/schema/input-field";
|
|
8
|
-
import { ShadcnTextVariant } from "@/presets/shadcn-variants/text";
|
|
9
|
-
import type { ShadcnTextUiProps } from "@/presets/shadcn-variants/text";
|
|
10
|
-
import { ShadcnNumberVariant, ShadcnNumberVariantProps } from "@/presets/shadcn-variants/number";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Text variant props (core layer).
|
|
14
|
-
*
|
|
15
|
-
* - Extends Dict so it can cleanly participate in the Variants registry.
|
|
16
|
-
* - Extends the Shadcn UI props so the core variant can pass everything
|
|
17
|
-
* straight through to the underlying visual component.
|
|
18
|
-
*
|
|
19
|
-
* This is where we hang *semantic* flags that drive validation.
|
|
20
|
-
*/
|
|
21
|
-
export interface TextVariantProps extends Dict, ShadcnTextUiProps {
|
|
22
|
-
/**
|
|
23
|
-
* If true, the value will be trimmed before validation.
|
|
24
|
-
* (Visual value is still whatever the user types; this is just for
|
|
25
|
-
* validation semantics.)
|
|
26
|
-
*/
|
|
27
|
-
trim?: boolean;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Minimum allowed string length (after optional trimming).
|
|
31
|
-
*/
|
|
32
|
-
minLength?: number;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Maximum allowed string length (after optional trimming).
|
|
36
|
-
*/
|
|
37
|
-
maxLength?: number;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Simple validation helper for the text variant.
|
|
42
|
-
*/
|
|
43
|
-
function validateText(
|
|
44
|
-
value: number | undefined,
|
|
45
|
-
ctx: {
|
|
46
|
-
required?: boolean;
|
|
47
|
-
props: ShadcnNumberVariantProps;
|
|
48
|
-
}
|
|
49
|
-
): ValidateResult {
|
|
50
|
-
const { required, props } = ctx;
|
|
51
|
-
const { minLength, maxLength } = props;
|
|
52
|
-
|
|
53
|
-
const raw = (value ?? "") + "";
|
|
54
|
-
const v = raw.trim();
|
|
55
|
-
|
|
56
|
-
// required
|
|
57
|
-
if (required && v.length === 0) {
|
|
58
|
-
return "This field is required.";
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// minLength
|
|
62
|
-
if (typeof minLength === "number" && v.length > 0 && v.length < minLength) {
|
|
63
|
-
return `Please enter at least ${minLength} characters.`;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// maxLength
|
|
67
|
-
if (typeof maxLength === "number" && v.length > maxLength) {
|
|
68
|
-
return `Please enter no more than ${maxLength} characters.`;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Core text variant module.
|
|
76
|
-
*
|
|
77
|
-
* - Uses ShadcnTextVariant as the visual component.
|
|
78
|
-
* - Adds simple length-based validation.
|
|
79
|
-
* - Provides layout defaults for InputField to use.
|
|
80
|
-
*/
|
|
81
|
-
export const numberVariant: VariantModule<"number"> = {
|
|
82
|
-
variant: "number",
|
|
83
|
-
|
|
84
|
-
// Visual component: Shadcn-based text input
|
|
85
|
-
Variant: ShadcnNumberVariant as any,
|
|
86
|
-
|
|
87
|
-
// Validation logic (runs before/alongside per-field onValidate)
|
|
88
|
-
validate(value, { required, props, field, form }) {
|
|
89
|
-
// field + form are available if you need them later.
|
|
90
|
-
return validateText(value, { required, props });
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
// Layout defaults for this variant
|
|
94
|
-
defaults: {
|
|
95
|
-
layout: {
|
|
96
|
-
labelPlacement: "top",
|
|
97
|
-
sublabelPlacement: "right",
|
|
98
|
-
descriptionPlacement: "below",
|
|
99
|
-
helpTextPlacement: "below",
|
|
100
|
-
errorTextPlacement: "below",
|
|
101
|
-
inline: false,
|
|
102
|
-
fullWidth: true,
|
|
103
|
-
defaultSize: "md",
|
|
104
|
-
defaultDensity: "comfortable",
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
meta: {
|
|
109
|
-
label: "Number",
|
|
110
|
-
description: "Single-line number input",
|
|
111
|
-
tags: ["number", "input", "integer", "float"],
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
export default numberVariant;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// src/variants/core/password.tsx
|
|
2
|
-
|
|
3
|
-
import type { VariantModuleFor } from "@/schema/variant";
|
|
4
|
-
import { ShadcnPasswordVariant } from "@/presets/shadcn-variants/password";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Core module for the "password" variant.
|
|
8
|
-
*
|
|
9
|
-
* - Uses the ShadcnPasswordVariant UI (Input + reveal toggle + strength meter).
|
|
10
|
-
* - Value type is string | undefined (from Variants["password"].value).
|
|
11
|
-
* - Props are ShadcnPasswordVariantProps (from Variants["password"].props).
|
|
12
|
-
*/
|
|
13
|
-
export const passwordVariant: VariantModuleFor<"password"> = {
|
|
14
|
-
variant: "password",
|
|
15
|
-
Variant: ShadcnPasswordVariant,
|
|
16
|
-
|
|
17
|
-
// Optional layout defaults – tweak as you like
|
|
18
|
-
defaults: {
|
|
19
|
-
layout: {
|
|
20
|
-
fullWidth: true,
|
|
21
|
-
// You can set defaultSize/defaultDensity here if you want:
|
|
22
|
-
// defaultSize: "md",
|
|
23
|
-
// defaultDensity: "normal",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
meta: {
|
|
28
|
-
label: "Password",
|
|
29
|
-
description:
|
|
30
|
-
"Password input with reveal toggle and optional strength meter.",
|
|
31
|
-
tags: ["auth", "security", "password"],
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default passwordVariant;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// ———————————————————————————————
|
|
2
|
-
// VariantModule wiring
|
|
3
|
-
|
|
4
|
-
import { ShadcnPhoneVariant } from "@/presets/shadcn-variants/phone";
|
|
5
|
-
import { VariantModule } from "@/schema/variant";
|
|
6
|
-
|
|
7
|
-
// ———————————————————————————————
|
|
8
|
-
export const PhoneVariantModule: VariantModule<"phone"> = {
|
|
9
|
-
variant: "phone",
|
|
10
|
-
Variant: ShadcnPhoneVariant,
|
|
11
|
-
meta: {
|
|
12
|
-
label: "Phone",
|
|
13
|
-
description: "Phone number input with country code and masking.",
|
|
14
|
-
tags: ["phone", "tel", "contact"],
|
|
15
|
-
},
|
|
16
|
-
};
|