jaci-ui 0.1.0
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/LICENSE +21 -0
- package/dist/components/accordion/accordion.cjs +83 -0
- package/dist/components/accordion/accordion.cjs.map +1 -0
- package/dist/components/accordion/accordion.d.cts +32 -0
- package/dist/components/accordion/accordion.d.ts +32 -0
- package/dist/components/accordion/accordion.js +77 -0
- package/dist/components/accordion/accordion.js.map +1 -0
- package/dist/components/accordion/index.d.cts +2 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/alert/alert.cjs +76 -0
- package/dist/components/alert/alert.cjs.map +1 -0
- package/dist/components/alert/alert.d.cts +26 -0
- package/dist/components/alert/alert.d.ts +26 -0
- package/dist/components/alert/alert.js +72 -0
- package/dist/components/alert/alert.js.map +1 -0
- package/dist/components/alert/index.d.cts +2 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert-dialog/alert-dialog.cjs +147 -0
- package/dist/components/alert-dialog/alert-dialog.cjs.map +1 -0
- package/dist/components/alert-dialog/alert-dialog.d.cts +73 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +73 -0
- package/dist/components/alert-dialog/alert-dialog.js +133 -0
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -0
- package/dist/components/alert-dialog/index.d.cts +2 -0
- package/dist/components/alert-dialog/index.d.ts +2 -0
- package/dist/components/avatar/avatar.cjs +89 -0
- package/dist/components/avatar/avatar.cjs.map +1 -0
- package/dist/components/avatar/avatar.d.cts +33 -0
- package/dist/components/avatar/avatar.d.ts +33 -0
- package/dist/components/avatar/avatar.js +86 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/index.d.cts +2 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/base-ui.cjs +14 -0
- package/dist/components/base-ui.cjs.map +1 -0
- package/dist/components/base-ui.js +14 -0
- package/dist/components/base-ui.js.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.cjs +84 -0
- package/dist/components/breadcrumbs/breadcrumbs.cjs.map +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.cts +31 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +31 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +78 -0
- package/dist/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/components/breadcrumbs/index.d.cts +2 -0
- package/dist/components/breadcrumbs/index.d.ts +2 -0
- package/dist/components/button/button.cjs +54 -0
- package/dist/components/button/button.cjs.map +1 -0
- package/dist/components/button/button.d.cts +21 -0
- package/dist/components/button/button.d.ts +21 -0
- package/dist/components/button/button.js +54 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/index.d.cts +2 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/card/card.cjs +55 -0
- package/dist/components/card/card.cjs.map +1 -0
- package/dist/components/card/card.d.cts +13 -0
- package/dist/components/card/card.d.ts +13 -0
- package/dist/components/card/card.js +51 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/index.d.cts +2 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/checkbox-group/checkbox-group.cjs +85 -0
- package/dist/components/checkbox-group/checkbox-group.cjs.map +1 -0
- package/dist/components/checkbox-group/checkbox-group.d.cts +37 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +37 -0
- package/dist/components/checkbox-group/checkbox-group.js +79 -0
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -0
- package/dist/components/checkbox-group/index.d.cts +2 -0
- package/dist/components/checkbox-group/index.d.ts +2 -0
- package/dist/components/collapsible/collapsible.cjs +59 -0
- package/dist/components/collapsible/collapsible.cjs.map +1 -0
- package/dist/components/collapsible/collapsible.d.cts +22 -0
- package/dist/components/collapsible/collapsible.d.ts +22 -0
- package/dist/components/collapsible/collapsible.js +55 -0
- package/dist/components/collapsible/collapsible.js.map +1 -0
- package/dist/components/collapsible/index.d.cts +2 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/color-picker/color-picker.cjs +360 -0
- package/dist/components/color-picker/color-picker.cjs.map +1 -0
- package/dist/components/color-picker/color-picker.d.cts +94 -0
- package/dist/components/color-picker/color-picker.d.ts +94 -0
- package/dist/components/color-picker/color-picker.js +344 -0
- package/dist/components/color-picker/color-picker.js.map +1 -0
- package/dist/components/color-picker/color-utils.cjs +162 -0
- package/dist/components/color-picker/color-utils.cjs.map +1 -0
- package/dist/components/color-picker/color-utils.d.cts +14 -0
- package/dist/components/color-picker/color-utils.d.ts +14 -0
- package/dist/components/color-picker/color-utils.js +160 -0
- package/dist/components/color-picker/color-utils.js.map +1 -0
- package/dist/components/color-picker/index.d.cts +3 -0
- package/dist/components/color-picker/index.d.ts +3 -0
- package/dist/components/combobox/combobox.cjs +218 -0
- package/dist/components/combobox/combobox.cjs.map +1 -0
- package/dist/components/combobox/combobox.d.cts +81 -0
- package/dist/components/combobox/combobox.d.ts +81 -0
- package/dist/components/combobox/combobox.js +199 -0
- package/dist/components/combobox/combobox.js.map +1 -0
- package/dist/components/combobox/index.d.cts +2 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/command/command.cjs +303 -0
- package/dist/components/command/command.cjs.map +1 -0
- package/dist/components/command/command.d.cts +50 -0
- package/dist/components/command/command.d.ts +50 -0
- package/dist/components/command/command.js +294 -0
- package/dist/components/command/command.js.map +1 -0
- package/dist/components/command/index.d.cts +2 -0
- package/dist/components/command/index.d.ts +2 -0
- package/dist/components/context-menu/context-menu.cjs +175 -0
- package/dist/components/context-menu/context-menu.cjs.map +1 -0
- package/dist/components/context-menu/context-menu.d.cts +69 -0
- package/dist/components/context-menu/context-menu.d.ts +69 -0
- package/dist/components/context-menu/context-menu.js +156 -0
- package/dist/components/context-menu/context-menu.js.map +1 -0
- package/dist/components/context-menu/index.d.cts +2 -0
- package/dist/components/context-menu/index.d.ts +2 -0
- package/dist/components/controls/checkbox.cjs +33 -0
- package/dist/components/controls/checkbox.cjs.map +1 -0
- package/dist/components/controls/checkbox.d.cts +12 -0
- package/dist/components/controls/checkbox.d.ts +12 -0
- package/dist/components/controls/checkbox.js +33 -0
- package/dist/components/controls/checkbox.js.map +1 -0
- package/dist/components/controls/index.d.cts +6 -0
- package/dist/components/controls/index.d.ts +6 -0
- package/dist/components/controls/input.cjs +29 -0
- package/dist/components/controls/input.cjs.map +1 -0
- package/dist/components/controls/input.d.cts +9 -0
- package/dist/components/controls/input.d.ts +9 -0
- package/dist/components/controls/input.js +29 -0
- package/dist/components/controls/input.js.map +1 -0
- package/dist/components/controls/radio.cjs +20 -0
- package/dist/components/controls/radio.cjs.map +1 -0
- package/dist/components/controls/radio.d.cts +7 -0
- package/dist/components/controls/radio.d.ts +7 -0
- package/dist/components/controls/radio.js +20 -0
- package/dist/components/controls/radio.js.map +1 -0
- package/dist/components/controls/switch.cjs +30 -0
- package/dist/components/controls/switch.cjs.map +1 -0
- package/dist/components/controls/switch.d.cts +10 -0
- package/dist/components/controls/switch.d.ts +10 -0
- package/dist/components/controls/switch.js +30 -0
- package/dist/components/controls/switch.js.map +1 -0
- package/dist/components/controls/textarea.cjs +30 -0
- package/dist/components/controls/textarea.cjs.map +1 -0
- package/dist/components/controls/textarea.d.cts +9 -0
- package/dist/components/controls/textarea.d.ts +9 -0
- package/dist/components/controls/textarea.js +30 -0
- package/dist/components/controls/textarea.js.map +1 -0
- package/dist/components/copyable/copyable.cjs +124 -0
- package/dist/components/copyable/copyable.cjs.map +1 -0
- package/dist/components/copyable/copyable.d.cts +27 -0
- package/dist/components/copyable/copyable.d.ts +27 -0
- package/dist/components/copyable/copyable.js +121 -0
- package/dist/components/copyable/copyable.js.map +1 -0
- package/dist/components/copyable/index.d.cts +2 -0
- package/dist/components/copyable/index.d.ts +2 -0
- package/dist/components/data-view/data-view.cjs +85 -0
- package/dist/components/data-view/data-view.cjs.map +1 -0
- package/dist/components/data-view/data-view.d.cts +31 -0
- package/dist/components/data-view/data-view.d.ts +31 -0
- package/dist/components/data-view/data-view.js +79 -0
- package/dist/components/data-view/data-view.js.map +1 -0
- package/dist/components/data-view/index.d.cts +2 -0
- package/dist/components/data-view/index.d.ts +2 -0
- package/dist/components/date-picker/date-picker.cjs +448 -0
- package/dist/components/date-picker/date-picker.cjs.map +1 -0
- package/dist/components/date-picker/date-picker.d.cts +118 -0
- package/dist/components/date-picker/date-picker.d.ts +118 -0
- package/dist/components/date-picker/date-picker.js +432 -0
- package/dist/components/date-picker/date-picker.js.map +1 -0
- package/dist/components/date-picker/date-utils.cjs +80 -0
- package/dist/components/date-picker/date-utils.cjs.map +1 -0
- package/dist/components/date-picker/date-utils.js +66 -0
- package/dist/components/date-picker/date-utils.js.map +1 -0
- package/dist/components/date-picker/index.d.cts +2 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/dialog/dialog.cjs +130 -0
- package/dist/components/dialog/dialog.cjs.map +1 -0
- package/dist/components/dialog/dialog.d.cts +55 -0
- package/dist/components/dialog/dialog.d.ts +55 -0
- package/dist/components/dialog/dialog.js +118 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/dialog/index.d.cts +2 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/drawer/drawer.cjs +165 -0
- package/dist/components/drawer/drawer.cjs.map +1 -0
- package/dist/components/drawer/drawer.d.cts +58 -0
- package/dist/components/drawer/drawer.d.ts +58 -0
- package/dist/components/drawer/drawer.js +153 -0
- package/dist/components/drawer/drawer.js.map +1 -0
- package/dist/components/drawer/index.d.cts +2 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/feedback/badge.cjs +18 -0
- package/dist/components/feedback/badge.cjs.map +1 -0
- package/dist/components/feedback/badge.d.cts +9 -0
- package/dist/components/feedback/badge.d.ts +9 -0
- package/dist/components/feedback/badge.js +18 -0
- package/dist/components/feedback/badge.js.map +1 -0
- package/dist/components/feedback/index.d.cts +2 -0
- package/dist/components/feedback/index.d.ts +2 -0
- package/dist/components/field/field.cjs +127 -0
- package/dist/components/field/field.cjs.map +1 -0
- package/dist/components/field/field.d.cts +47 -0
- package/dist/components/field/field.d.ts +47 -0
- package/dist/components/field/field.js +123 -0
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/field/index.d.cts +2 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/fieldset/fieldset.cjs +48 -0
- package/dist/components/fieldset/fieldset.cjs.map +1 -0
- package/dist/components/fieldset/fieldset.d.cts +17 -0
- package/dist/components/fieldset/fieldset.d.ts +17 -0
- package/dist/components/fieldset/fieldset.js +45 -0
- package/dist/components/fieldset/fieldset.js.map +1 -0
- package/dist/components/fieldset/index.d.cts +2 -0
- package/dist/components/fieldset/index.d.ts +2 -0
- package/dist/components/form/form.cjs +27 -0
- package/dist/components/form/form.cjs.map +1 -0
- package/dist/components/form/form.d.cts +18 -0
- package/dist/components/form/form.d.ts +18 -0
- package/dist/components/form/form.js +26 -0
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/form/index.d.cts +2 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/layout/index.cjs +73 -0
- package/dist/components/layout/index.cjs.map +1 -0
- package/dist/components/layout/index.d.cts +35 -0
- package/dist/components/layout/index.d.ts +35 -0
- package/dist/components/layout/index.js +69 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/list/index.d.cts +2 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/list/list.cjs +86 -0
- package/dist/components/list/list.cjs.map +1 -0
- package/dist/components/list/list.d.cts +37 -0
- package/dist/components/list/list.d.ts +37 -0
- package/dist/components/list/list.js +80 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/menu/index.d.cts +2 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/menu.cjs +108 -0
- package/dist/components/menu/menu.cjs.map +1 -0
- package/dist/components/menu/menu.d.cts +47 -0
- package/dist/components/menu/menu.d.ts +47 -0
- package/dist/components/menu/menu.js +98 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/menubar/index.d.cts +2 -0
- package/dist/components/menubar/index.d.ts +2 -0
- package/dist/components/menubar/menubar.cjs +206 -0
- package/dist/components/menubar/menubar.cjs.map +1 -0
- package/dist/components/menubar/menubar.d.cts +74 -0
- package/dist/components/menubar/menubar.d.ts +74 -0
- package/dist/components/menubar/menubar.js +187 -0
- package/dist/components/menubar/menubar.js.map +1 -0
- package/dist/components/meter/index.d.cts +2 -0
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/meter.cjs +91 -0
- package/dist/components/meter/meter.cjs.map +1 -0
- package/dist/components/meter/meter.d.cts +30 -0
- package/dist/components/meter/meter.d.ts +30 -0
- package/dist/components/meter/meter.js +86 -0
- package/dist/components/meter/meter.js.map +1 -0
- package/dist/components/navigation/index.d.cts +2 -0
- package/dist/components/navigation/index.d.ts +2 -0
- package/dist/components/navigation/navigation.cjs +163 -0
- package/dist/components/navigation/navigation.cjs.map +1 -0
- package/dist/components/navigation/navigation.d.cts +75 -0
- package/dist/components/navigation/navigation.d.ts +75 -0
- package/dist/components/navigation/navigation.js +151 -0
- package/dist/components/navigation/navigation.js.map +1 -0
- package/dist/components/navigation-menu/index.d.cts +2 -0
- package/dist/components/navigation-menu/index.d.ts +2 -0
- package/dist/components/navigation-menu/navigation-menu.cjs +214 -0
- package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -0
- package/dist/components/navigation-menu/navigation-menu.d.cts +54 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +54 -0
- package/dist/components/navigation-menu/navigation-menu.js +201 -0
- package/dist/components/navigation-menu/navigation-menu.js.map +1 -0
- package/dist/components/number-field/index.d.cts +2 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/number-field.cjs +124 -0
- package/dist/components/number-field/number-field.cjs.map +1 -0
- package/dist/components/number-field/number-field.d.cts +48 -0
- package/dist/components/number-field/number-field.d.ts +48 -0
- package/dist/components/number-field/number-field.js +116 -0
- package/dist/components/number-field/number-field.js.map +1 -0
- package/dist/components/option-selector/index.d.cts +2 -0
- package/dist/components/option-selector/index.d.ts +2 -0
- package/dist/components/option-selector/option-selector.cjs +105 -0
- package/dist/components/option-selector/option-selector.cjs.map +1 -0
- package/dist/components/option-selector/option-selector.d.cts +46 -0
- package/dist/components/option-selector/option-selector.d.ts +46 -0
- package/dist/components/option-selector/option-selector.js +105 -0
- package/dist/components/option-selector/option-selector.js.map +1 -0
- package/dist/components/pagination/index.d.cts +2 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/pagination.cjs +132 -0
- package/dist/components/pagination/pagination.cjs.map +1 -0
- package/dist/components/pagination/pagination.d.cts +44 -0
- package/dist/components/pagination/pagination.d.ts +44 -0
- package/dist/components/pagination/pagination.js +125 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/components/popover/index.d.cts +2 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/popover.cjs +98 -0
- package/dist/components/popover/popover.cjs.map +1 -0
- package/dist/components/popover/popover.d.cts +61 -0
- package/dist/components/popover/popover.d.ts +61 -0
- package/dist/components/popover/popover.js +89 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/progress/index.d.cts +2 -0
- package/dist/components/progress/index.d.ts +2 -0
- package/dist/components/progress/progress.cjs +59 -0
- package/dist/components/progress/progress.cjs.map +1 -0
- package/dist/components/progress/progress.d.cts +20 -0
- package/dist/components/progress/progress.d.ts +20 -0
- package/dist/components/progress/progress.js +59 -0
- package/dist/components/progress/progress.js.map +1 -0
- package/dist/components/radio-group/index.d.cts +2 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/radio-group.cjs +90 -0
- package/dist/components/radio-group/radio-group.cjs.map +1 -0
- package/dist/components/radio-group/radio-group.d.cts +40 -0
- package/dist/components/radio-group/radio-group.d.ts +40 -0
- package/dist/components/radio-group/radio-group.js +84 -0
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/range-slider/index.d.cts +2 -0
- package/dist/components/range-slider/index.d.ts +2 -0
- package/dist/components/range-slider/range-slider.cjs +103 -0
- package/dist/components/range-slider/range-slider.cjs.map +1 -0
- package/dist/components/range-slider/range-slider.d.cts +40 -0
- package/dist/components/range-slider/range-slider.d.ts +40 -0
- package/dist/components/range-slider/range-slider.js +96 -0
- package/dist/components/range-slider/range-slider.js.map +1 -0
- package/dist/components/scroll-area/index.d.cts +2 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/scroll-area.cjs +76 -0
- package/dist/components/scroll-area/scroll-area.cjs.map +1 -0
- package/dist/components/scroll-area/scroll-area.d.cts +26 -0
- package/dist/components/scroll-area/scroll-area.d.ts +26 -0
- package/dist/components/scroll-area/scroll-area.js +70 -0
- package/dist/components/scroll-area/scroll-area.js.map +1 -0
- package/dist/components/select/index.d.cts +2 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select.cjs +171 -0
- package/dist/components/select/select.cjs.map +1 -0
- package/dist/components/select/select.d.cts +74 -0
- package/dist/components/select/select.d.ts +74 -0
- package/dist/components/select/select.js +156 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/sidebar/index.d.cts +2 -0
- package/dist/components/sidebar/index.d.ts +2 -0
- package/dist/components/sidebar/sidebar.cjs +162 -0
- package/dist/components/sidebar/sidebar.cjs.map +1 -0
- package/dist/components/sidebar/sidebar.d.cts +64 -0
- package/dist/components/sidebar/sidebar.d.ts +64 -0
- package/dist/components/sidebar/sidebar.js +154 -0
- package/dist/components/sidebar/sidebar.js.map +1 -0
- package/dist/components/skeleton/index.d.cts +2 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/skeleton.cjs +25 -0
- package/dist/components/skeleton/skeleton.cjs.map +1 -0
- package/dist/components/skeleton/skeleton.d.cts +13 -0
- package/dist/components/skeleton/skeleton.d.ts +13 -0
- package/dist/components/skeleton/skeleton.js +25 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/slider/index.d.cts +2 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/slider.cjs +96 -0
- package/dist/components/slider/slider.cjs.map +1 -0
- package/dist/components/slider/slider.d.cts +39 -0
- package/dist/components/slider/slider.d.ts +39 -0
- package/dist/components/slider/slider.js +89 -0
- package/dist/components/slider/slider.js.map +1 -0
- package/dist/components/table/index.d.cts +2 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/table.cjs +196 -0
- package/dist/components/table/table.cjs.map +1 -0
- package/dist/components/table/table.d.cts +66 -0
- package/dist/components/table/table.d.ts +66 -0
- package/dist/components/table/table.js +184 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/tabs/index.d.cts +2 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/tabs.cjs +65 -0
- package/dist/components/tabs/tabs.cjs.map +1 -0
- package/dist/components/tabs/tabs.d.cts +23 -0
- package/dist/components/tabs/tabs.d.ts +23 -0
- package/dist/components/tabs/tabs.js +61 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/tags-input/index.d.cts +2 -0
- package/dist/components/tags-input/index.d.ts +2 -0
- package/dist/components/tags-input/tags-input.cjs +172 -0
- package/dist/components/tags-input/tags-input.cjs.map +1 -0
- package/dist/components/tags-input/tags-input.d.cts +26 -0
- package/dist/components/tags-input/tags-input.d.ts +26 -0
- package/dist/components/tags-input/tags-input.js +172 -0
- package/dist/components/tags-input/tags-input.js.map +1 -0
- package/dist/components/toast/index.d.cts +2 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/toast.cjs +135 -0
- package/dist/components/toast/toast.cjs.map +1 -0
- package/dist/components/toast/toast.d.cts +61 -0
- package/dist/components/toast/toast.d.ts +61 -0
- package/dist/components/toast/toast.js +125 -0
- package/dist/components/toast/toast.js.map +1 -0
- package/dist/components/toggle/index.d.cts +2 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/toggle.cjs +25 -0
- package/dist/components/toggle/toggle.cjs.map +1 -0
- package/dist/components/toggle/toggle.d.cts +16 -0
- package/dist/components/toggle/toggle.d.ts +16 -0
- package/dist/components/toggle/toggle.js +25 -0
- package/dist/components/toggle/toggle.js.map +1 -0
- package/dist/components/toggle-group/index.d.cts +2 -0
- package/dist/components/toggle-group/index.d.ts +2 -0
- package/dist/components/toggle-group/toggle-group.cjs +52 -0
- package/dist/components/toggle-group/toggle-group.cjs.map +1 -0
- package/dist/components/toggle-group/toggle-group.d.cts +25 -0
- package/dist/components/toggle-group/toggle-group.d.ts +25 -0
- package/dist/components/toggle-group/toggle-group.js +50 -0
- package/dist/components/toggle-group/toggle-group.js.map +1 -0
- package/dist/components/toolbar/index.d.cts +2 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/toolbar.cjs +85 -0
- package/dist/components/toolbar/toolbar.cjs.map +1 -0
- package/dist/components/toolbar/toolbar.d.cts +34 -0
- package/dist/components/toolbar/toolbar.d.ts +34 -0
- package/dist/components/toolbar/toolbar.js +79 -0
- package/dist/components/toolbar/toolbar.js.map +1 -0
- package/dist/components/tooltip/index.d.cts +2 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/tooltip.cjs +65 -0
- package/dist/components/tooltip/tooltip.cjs.map +1 -0
- package/dist/components/tooltip/tooltip.d.cts +28 -0
- package/dist/components/tooltip/tooltip.d.ts +28 -0
- package/dist/components/tooltip/tooltip.js +59 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/components/tree-view/index.d.cts +2 -0
- package/dist/components/tree-view/index.d.ts +2 -0
- package/dist/components/tree-view/tree-view.cjs +345 -0
- package/dist/components/tree-view/tree-view.cjs.map +1 -0
- package/dist/components/tree-view/tree-view.d.cts +39 -0
- package/dist/components/tree-view/tree-view.d.ts +39 -0
- package/dist/components/tree-view/tree-view.js +340 -0
- package/dist/components/tree-view/tree-view.js.map +1 -0
- package/dist/components/typography/heading.cjs +28 -0
- package/dist/components/typography/heading.cjs.map +1 -0
- package/dist/components/typography/heading.d.cts +12 -0
- package/dist/components/typography/heading.d.ts +12 -0
- package/dist/components/typography/heading.js +28 -0
- package/dist/components/typography/heading.js.map +1 -0
- package/dist/components/typography/index.d.cts +5 -0
- package/dist/components/typography/index.d.ts +5 -0
- package/dist/components/typography/link.cjs +18 -0
- package/dist/components/typography/link.cjs.map +1 -0
- package/dist/components/typography/link.d.cts +9 -0
- package/dist/components/typography/link.d.ts +9 -0
- package/dist/components/typography/link.js +18 -0
- package/dist/components/typography/link.js.map +1 -0
- package/dist/components/typography/paragraph.cjs +18 -0
- package/dist/components/typography/paragraph.cjs.map +1 -0
- package/dist/components/typography/paragraph.d.cts +7 -0
- package/dist/components/typography/paragraph.d.ts +7 -0
- package/dist/components/typography/paragraph.js +18 -0
- package/dist/components/typography/paragraph.js.map +1 -0
- package/dist/components/typography/text.cjs +21 -0
- package/dist/components/typography/text.cjs.map +1 -0
- package/dist/components/typography/text.d.cts +14 -0
- package/dist/components/typography/text.d.ts +14 -0
- package/dist/components/typography/text.js +21 -0
- package/dist/components/typography/text.js.map +1 -0
- package/dist/components/upload/index.d.cts +2 -0
- package/dist/components/upload/index.d.ts +2 -0
- package/dist/components/upload/upload.cjs +411 -0
- package/dist/components/upload/upload.cjs.map +1 -0
- package/dist/components/upload/upload.d.cts +91 -0
- package/dist/components/upload/upload.d.ts +91 -0
- package/dist/components/upload/upload.js +398 -0
- package/dist/components/upload/upload.js.map +1 -0
- package/dist/components/visually-hidden/index.d.cts +2 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/visually-hidden.cjs +18 -0
- package/dist/components/visually-hidden/visually-hidden.cjs.map +1 -0
- package/dist/components/visually-hidden/visually-hidden.d.cts +7 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts +7 -0
- package/dist/components/visually-hidden/visually-hidden.js +18 -0
- package/dist/components/visually-hidden/visually-hidden.js.map +1 -0
- package/dist/index.cjs +494 -0
- package/dist/index.d.cts +116 -0
- package/dist/index.d.ts +116 -0
- package/dist/index.js +63 -0
- package/dist/panda-preset.cjs +11 -0
- package/dist/panda-preset.cjs.map +1 -0
- package/dist/panda-preset.d.cts +4 -0
- package/dist/panda-preset.d.ts +5 -0
- package/dist/panda-preset.js +12 -0
- package/dist/panda-preset.js.map +1 -0
- package/dist/styled-system/css/conditions.cjs +31 -0
- package/dist/styled-system/css/conditions.cjs.map +1 -0
- package/dist/styled-system/css/conditions.js +29 -0
- package/dist/styled-system/css/conditions.js.map +1 -0
- package/dist/styled-system/css/css.cjs +48 -0
- package/dist/styled-system/css/css.cjs.map +1 -0
- package/dist/styled-system/css/css.js +47 -0
- package/dist/styled-system/css/css.js.map +1 -0
- package/dist/styled-system/css/cva.cjs +20 -0
- package/dist/styled-system/css/cva.cjs.map +1 -0
- package/dist/styled-system/css/cva.js +19 -0
- package/dist/styled-system/css/cva.js.map +1 -0
- package/dist/styled-system/css/cx.cjs +13 -0
- package/dist/styled-system/css/cx.cjs.map +1 -0
- package/dist/styled-system/css/cx.js +13 -0
- package/dist/styled-system/css/cx.js.map +1 -0
- package/dist/styled-system/helpers.cjs +231 -0
- package/dist/styled-system/helpers.cjs.map +1 -0
- package/dist/styled-system/helpers.js +216 -0
- package/dist/styled-system/helpers.js.map +1 -0
- package/dist/styled-system/recipes/accordion.cjs +37 -0
- package/dist/styled-system/recipes/accordion.cjs.map +1 -0
- package/dist/styled-system/recipes/accordion.js +37 -0
- package/dist/styled-system/recipes/accordion.js.map +1 -0
- package/dist/styled-system/recipes/alert.cjs +40 -0
- package/dist/styled-system/recipes/alert.cjs.map +1 -0
- package/dist/styled-system/recipes/alert.js +40 -0
- package/dist/styled-system/recipes/alert.js.map +1 -0
- package/dist/styled-system/recipes/avatar.cjs +46 -0
- package/dist/styled-system/recipes/avatar.cjs.map +1 -0
- package/dist/styled-system/recipes/avatar.js +46 -0
- package/dist/styled-system/recipes/avatar.js.map +1 -0
- package/dist/styled-system/recipes/badge.cjs +31 -0
- package/dist/styled-system/recipes/badge.cjs.map +1 -0
- package/dist/styled-system/recipes/badge.js +31 -0
- package/dist/styled-system/recipes/badge.js.map +1 -0
- package/dist/styled-system/recipes/bottom-navigation.cjs +30 -0
- package/dist/styled-system/recipes/bottom-navigation.cjs.map +1 -0
- package/dist/styled-system/recipes/bottom-navigation.js +30 -0
- package/dist/styled-system/recipes/bottom-navigation.js.map +1 -0
- package/dist/styled-system/recipes/breadcrumbs.cjs +37 -0
- package/dist/styled-system/recipes/breadcrumbs.cjs.map +1 -0
- package/dist/styled-system/recipes/breadcrumbs.js +37 -0
- package/dist/styled-system/recipes/breadcrumbs.js.map +1 -0
- package/dist/styled-system/recipes/button.cjs +42 -0
- package/dist/styled-system/recipes/button.cjs.map +1 -0
- package/dist/styled-system/recipes/button.js +42 -0
- package/dist/styled-system/recipes/button.js.map +1 -0
- package/dist/styled-system/recipes/card.cjs +40 -0
- package/dist/styled-system/recipes/card.cjs.map +1 -0
- package/dist/styled-system/recipes/card.js +40 -0
- package/dist/styled-system/recipes/card.js.map +1 -0
- package/dist/styled-system/recipes/checkbox-group.cjs +37 -0
- package/dist/styled-system/recipes/checkbox-group.cjs.map +1 -0
- package/dist/styled-system/recipes/checkbox-group.js +37 -0
- package/dist/styled-system/recipes/checkbox-group.js.map +1 -0
- package/dist/styled-system/recipes/checkbox.cjs +30 -0
- package/dist/styled-system/recipes/checkbox.cjs.map +1 -0
- package/dist/styled-system/recipes/checkbox.js +30 -0
- package/dist/styled-system/recipes/checkbox.js.map +1 -0
- package/dist/styled-system/recipes/collapsible.cjs +35 -0
- package/dist/styled-system/recipes/collapsible.cjs.map +1 -0
- package/dist/styled-system/recipes/collapsible.js +35 -0
- package/dist/styled-system/recipes/collapsible.js.map +1 -0
- package/dist/styled-system/recipes/color-picker.cjs +46 -0
- package/dist/styled-system/recipes/color-picker.cjs.map +1 -0
- package/dist/styled-system/recipes/color-picker.js +46 -0
- package/dist/styled-system/recipes/color-picker.js.map +1 -0
- package/dist/styled-system/recipes/combobox.cjs +53 -0
- package/dist/styled-system/recipes/combobox.cjs.map +1 -0
- package/dist/styled-system/recipes/combobox.js +53 -0
- package/dist/styled-system/recipes/combobox.js.map +1 -0
- package/dist/styled-system/recipes/command.cjs +41 -0
- package/dist/styled-system/recipes/command.cjs.map +1 -0
- package/dist/styled-system/recipes/command.js +41 -0
- package/dist/styled-system/recipes/command.js.map +1 -0
- package/dist/styled-system/recipes/copyable.cjs +35 -0
- package/dist/styled-system/recipes/copyable.cjs.map +1 -0
- package/dist/styled-system/recipes/copyable.js +35 -0
- package/dist/styled-system/recipes/copyable.js.map +1 -0
- package/dist/styled-system/recipes/create-recipe.cjs +80 -0
- package/dist/styled-system/recipes/create-recipe.cjs.map +1 -0
- package/dist/styled-system/recipes/create-recipe.js +79 -0
- package/dist/styled-system/recipes/create-recipe.js.map +1 -0
- package/dist/styled-system/recipes/data-view.cjs +52 -0
- package/dist/styled-system/recipes/data-view.cjs.map +1 -0
- package/dist/styled-system/recipes/data-view.js +52 -0
- package/dist/styled-system/recipes/data-view.js.map +1 -0
- package/dist/styled-system/recipes/date-picker.cjs +51 -0
- package/dist/styled-system/recipes/date-picker.cjs.map +1 -0
- package/dist/styled-system/recipes/date-picker.js +51 -0
- package/dist/styled-system/recipes/date-picker.js.map +1 -0
- package/dist/styled-system/recipes/dialog.cjs +46 -0
- package/dist/styled-system/recipes/dialog.cjs.map +1 -0
- package/dist/styled-system/recipes/dialog.js +46 -0
- package/dist/styled-system/recipes/dialog.js.map +1 -0
- package/dist/styled-system/recipes/drawer.cjs +46 -0
- package/dist/styled-system/recipes/drawer.cjs.map +1 -0
- package/dist/styled-system/recipes/drawer.js +46 -0
- package/dist/styled-system/recipes/drawer.js.map +1 -0
- package/dist/styled-system/recipes/field.cjs +36 -0
- package/dist/styled-system/recipes/field.cjs.map +1 -0
- package/dist/styled-system/recipes/field.js +36 -0
- package/dist/styled-system/recipes/field.js.map +1 -0
- package/dist/styled-system/recipes/fieldset.cjs +34 -0
- package/dist/styled-system/recipes/fieldset.cjs.map +1 -0
- package/dist/styled-system/recipes/fieldset.js +34 -0
- package/dist/styled-system/recipes/fieldset.js.map +1 -0
- package/dist/styled-system/recipes/form.cjs +25 -0
- package/dist/styled-system/recipes/form.cjs.map +1 -0
- package/dist/styled-system/recipes/form.js +25 -0
- package/dist/styled-system/recipes/form.js.map +1 -0
- package/dist/styled-system/recipes/heading.cjs +32 -0
- package/dist/styled-system/recipes/heading.cjs.map +1 -0
- package/dist/styled-system/recipes/heading.js +32 -0
- package/dist/styled-system/recipes/heading.js.map +1 -0
- package/dist/styled-system/recipes/input.cjs +29 -0
- package/dist/styled-system/recipes/input.cjs.map +1 -0
- package/dist/styled-system/recipes/input.js +29 -0
- package/dist/styled-system/recipes/input.js.map +1 -0
- package/dist/styled-system/recipes/layout-grid.cjs +42 -0
- package/dist/styled-system/recipes/layout-grid.cjs.map +1 -0
- package/dist/styled-system/recipes/layout-grid.js +42 -0
- package/dist/styled-system/recipes/layout-grid.js.map +1 -0
- package/dist/styled-system/recipes/layout-stack.cjs +53 -0
- package/dist/styled-system/recipes/layout-stack.cjs.map +1 -0
- package/dist/styled-system/recipes/layout-stack.js +53 -0
- package/dist/styled-system/recipes/layout-stack.js.map +1 -0
- package/dist/styled-system/recipes/link.cjs +25 -0
- package/dist/styled-system/recipes/link.cjs.map +1 -0
- package/dist/styled-system/recipes/link.js +25 -0
- package/dist/styled-system/recipes/link.js.map +1 -0
- package/dist/styled-system/recipes/list.cjs +52 -0
- package/dist/styled-system/recipes/list.cjs.map +1 -0
- package/dist/styled-system/recipes/list.js +52 -0
- package/dist/styled-system/recipes/list.js.map +1 -0
- package/dist/styled-system/recipes/menu.cjs +38 -0
- package/dist/styled-system/recipes/menu.cjs.map +1 -0
- package/dist/styled-system/recipes/menu.js +38 -0
- package/dist/styled-system/recipes/menu.js.map +1 -0
- package/dist/styled-system/recipes/menubar.cjs +30 -0
- package/dist/styled-system/recipes/menubar.cjs.map +1 -0
- package/dist/styled-system/recipes/menubar.js +30 -0
- package/dist/styled-system/recipes/menubar.js.map +1 -0
- package/dist/styled-system/recipes/meter.cjs +52 -0
- package/dist/styled-system/recipes/meter.cjs.map +1 -0
- package/dist/styled-system/recipes/meter.js +52 -0
- package/dist/styled-system/recipes/meter.js.map +1 -0
- package/dist/styled-system/recipes/navbar.cjs +41 -0
- package/dist/styled-system/recipes/navbar.cjs.map +1 -0
- package/dist/styled-system/recipes/navbar.js +41 -0
- package/dist/styled-system/recipes/navbar.js.map +1 -0
- package/dist/styled-system/recipes/navigation-menu.cjs +43 -0
- package/dist/styled-system/recipes/navigation-menu.cjs.map +1 -0
- package/dist/styled-system/recipes/navigation-menu.js +43 -0
- package/dist/styled-system/recipes/navigation-menu.js.map +1 -0
- package/dist/styled-system/recipes/number-field.cjs +43 -0
- package/dist/styled-system/recipes/number-field.cjs.map +1 -0
- package/dist/styled-system/recipes/number-field.js +43 -0
- package/dist/styled-system/recipes/number-field.js.map +1 -0
- package/dist/styled-system/recipes/option-selector.cjs +52 -0
- package/dist/styled-system/recipes/option-selector.cjs.map +1 -0
- package/dist/styled-system/recipes/option-selector.js +52 -0
- package/dist/styled-system/recipes/option-selector.js.map +1 -0
- package/dist/styled-system/recipes/pagination.cjs +44 -0
- package/dist/styled-system/recipes/pagination.cjs.map +1 -0
- package/dist/styled-system/recipes/pagination.js +44 -0
- package/dist/styled-system/recipes/pagination.js.map +1 -0
- package/dist/styled-system/recipes/paragraph.cjs +25 -0
- package/dist/styled-system/recipes/paragraph.cjs.map +1 -0
- package/dist/styled-system/recipes/paragraph.js +25 -0
- package/dist/styled-system/recipes/paragraph.js.map +1 -0
- package/dist/styled-system/recipes/popover.cjs +38 -0
- package/dist/styled-system/recipes/popover.cjs.map +1 -0
- package/dist/styled-system/recipes/popover.js +38 -0
- package/dist/styled-system/recipes/popover.js.map +1 -0
- package/dist/styled-system/recipes/progress.cjs +35 -0
- package/dist/styled-system/recipes/progress.cjs.map +1 -0
- package/dist/styled-system/recipes/progress.js +35 -0
- package/dist/styled-system/recipes/progress.js.map +1 -0
- package/dist/styled-system/recipes/radio-group.cjs +37 -0
- package/dist/styled-system/recipes/radio-group.cjs.map +1 -0
- package/dist/styled-system/recipes/radio-group.js +37 -0
- package/dist/styled-system/recipes/radio-group.js.map +1 -0
- package/dist/styled-system/recipes/range-slider.cjs +42 -0
- package/dist/styled-system/recipes/range-slider.cjs.map +1 -0
- package/dist/styled-system/recipes/range-slider.js +42 -0
- package/dist/styled-system/recipes/range-slider.js.map +1 -0
- package/dist/styled-system/recipes/screen-reader-only.cjs +25 -0
- package/dist/styled-system/recipes/screen-reader-only.cjs.map +1 -0
- package/dist/styled-system/recipes/screen-reader-only.js +25 -0
- package/dist/styled-system/recipes/screen-reader-only.js.map +1 -0
- package/dist/styled-system/recipes/scroll-area.cjs +37 -0
- package/dist/styled-system/recipes/scroll-area.cjs.map +1 -0
- package/dist/styled-system/recipes/scroll-area.js +37 -0
- package/dist/styled-system/recipes/scroll-area.js.map +1 -0
- package/dist/styled-system/recipes/select.cjs +48 -0
- package/dist/styled-system/recipes/select.cjs.map +1 -0
- package/dist/styled-system/recipes/select.js +48 -0
- package/dist/styled-system/recipes/select.js.map +1 -0
- package/dist/styled-system/recipes/separator.cjs +25 -0
- package/dist/styled-system/recipes/separator.cjs.map +1 -0
- package/dist/styled-system/recipes/separator.js +25 -0
- package/dist/styled-system/recipes/separator.js.map +1 -0
- package/dist/styled-system/recipes/sidebar.cjs +44 -0
- package/dist/styled-system/recipes/sidebar.cjs.map +1 -0
- package/dist/styled-system/recipes/sidebar.js +44 -0
- package/dist/styled-system/recipes/sidebar.js.map +1 -0
- package/dist/styled-system/recipes/skeleton.cjs +35 -0
- package/dist/styled-system/recipes/skeleton.cjs.map +1 -0
- package/dist/styled-system/recipes/skeleton.js +35 -0
- package/dist/styled-system/recipes/skeleton.js.map +1 -0
- package/dist/styled-system/recipes/slider.cjs +42 -0
- package/dist/styled-system/recipes/slider.cjs.map +1 -0
- package/dist/styled-system/recipes/slider.js +42 -0
- package/dist/styled-system/recipes/slider.js.map +1 -0
- package/dist/styled-system/recipes/spinner.cjs +29 -0
- package/dist/styled-system/recipes/spinner.cjs.map +1 -0
- package/dist/styled-system/recipes/spinner.js +29 -0
- package/dist/styled-system/recipes/spinner.js.map +1 -0
- package/dist/styled-system/recipes/table.cjs +58 -0
- package/dist/styled-system/recipes/table.cjs.map +1 -0
- package/dist/styled-system/recipes/table.js +58 -0
- package/dist/styled-system/recipes/table.js.map +1 -0
- package/dist/styled-system/recipes/tabs.cjs +35 -0
- package/dist/styled-system/recipes/tabs.cjs.map +1 -0
- package/dist/styled-system/recipes/tabs.js +35 -0
- package/dist/styled-system/recipes/tabs.js.map +1 -0
- package/dist/styled-system/recipes/tags-input.cjs +43 -0
- package/dist/styled-system/recipes/tags-input.cjs.map +1 -0
- package/dist/styled-system/recipes/tags-input.js +43 -0
- package/dist/styled-system/recipes/tags-input.js.map +1 -0
- package/dist/styled-system/recipes/text.cjs +35 -0
- package/dist/styled-system/recipes/text.cjs.map +1 -0
- package/dist/styled-system/recipes/text.js +35 -0
- package/dist/styled-system/recipes/text.js.map +1 -0
- package/dist/styled-system/recipes/textarea.cjs +29 -0
- package/dist/styled-system/recipes/textarea.cjs.map +1 -0
- package/dist/styled-system/recipes/textarea.js +29 -0
- package/dist/styled-system/recipes/textarea.js.map +1 -0
- package/dist/styled-system/recipes/toast.cjs +45 -0
- package/dist/styled-system/recipes/toast.cjs.map +1 -0
- package/dist/styled-system/recipes/toast.js +45 -0
- package/dist/styled-system/recipes/toast.js.map +1 -0
- package/dist/styled-system/recipes/toggle-group.cjs +44 -0
- package/dist/styled-system/recipes/toggle-group.cjs.map +1 -0
- package/dist/styled-system/recipes/toggle-group.js +44 -0
- package/dist/styled-system/recipes/toggle-group.js.map +1 -0
- package/dist/styled-system/recipes/toggle-switch.cjs +30 -0
- package/dist/styled-system/recipes/toggle-switch.cjs.map +1 -0
- package/dist/styled-system/recipes/toggle-switch.js +30 -0
- package/dist/styled-system/recipes/toggle-switch.js.map +1 -0
- package/dist/styled-system/recipes/toggle.cjs +39 -0
- package/dist/styled-system/recipes/toggle.cjs.map +1 -0
- package/dist/styled-system/recipes/toggle.js +39 -0
- package/dist/styled-system/recipes/toggle.js.map +1 -0
- package/dist/styled-system/recipes/toolbar.cjs +51 -0
- package/dist/styled-system/recipes/toolbar.cjs.map +1 -0
- package/dist/styled-system/recipes/toolbar.js +51 -0
- package/dist/styled-system/recipes/toolbar.js.map +1 -0
- package/dist/styled-system/recipes/tooltip.cjs +35 -0
- package/dist/styled-system/recipes/tooltip.cjs.map +1 -0
- package/dist/styled-system/recipes/tooltip.js +35 -0
- package/dist/styled-system/recipes/tooltip.js.map +1 -0
- package/dist/styled-system/recipes/tree-view.cjs +37 -0
- package/dist/styled-system/recipes/tree-view.cjs.map +1 -0
- package/dist/styled-system/recipes/tree-view.js +37 -0
- package/dist/styled-system/recipes/tree-view.js.map +1 -0
- package/dist/styled-system/recipes/upload.cjs +55 -0
- package/dist/styled-system/recipes/upload.cjs.map +1 -0
- package/dist/styled-system/recipes/upload.js +55 -0
- package/dist/styled-system/recipes/upload.js.map +1 -0
- package/dist/styles/theme.cjs +137 -0
- package/dist/styles/theme.cjs.map +1 -0
- package/dist/styles/theme.js +136 -0
- package/dist/styles/theme.js.map +1 -0
- package/dist/styles.css +7706 -0
- package/package.json +107 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_cx = require("../../styled-system/css/cx.cjs");
|
|
3
|
+
const require_field = require("../../styled-system/recipes/field.cjs");
|
|
4
|
+
const require_form = require("../form/form.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let _base_ui_react_field = require("@base-ui/react/field");
|
|
8
|
+
//#region src/components/field/field.tsx
|
|
9
|
+
const FieldContext = (0, react.createContext)({
|
|
10
|
+
errors: [],
|
|
11
|
+
insideField: false,
|
|
12
|
+
invalid: false,
|
|
13
|
+
name: void 0
|
|
14
|
+
});
|
|
15
|
+
function normalizeErrors(errors) {
|
|
16
|
+
if (errors === void 0 || errors === null || errors === false) return [];
|
|
17
|
+
return Array.isArray(errors) ? errors : [errors];
|
|
18
|
+
}
|
|
19
|
+
function renderErrors(errors) {
|
|
20
|
+
if (errors.length <= 1) return errors[0];
|
|
21
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { children: errors.map((error, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: error }, typeof error === "string" ? error : index)) });
|
|
22
|
+
}
|
|
23
|
+
const Field = (0, react.forwardRef)(function Field({ actionsRef, children, className, dirty, disabled = false, errors: directErrors, invalid: invalidProp = false, name, touched, validate, validationDebounceTime, validationMode, ...props }, ref) {
|
|
24
|
+
const { errors: formErrors } = (0, react.useContext)(require_form.JaciFormContext);
|
|
25
|
+
const formError = name ? formErrors[name] : void 0;
|
|
26
|
+
const errors = directErrors === void 0 ? normalizeErrors(formError) : normalizeErrors(directErrors);
|
|
27
|
+
const invalid = invalidProp || errors.length > 0;
|
|
28
|
+
const styles = require_field.field({ invalid });
|
|
29
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldContext.Provider, {
|
|
30
|
+
value: {
|
|
31
|
+
errors,
|
|
32
|
+
insideField: true,
|
|
33
|
+
invalid,
|
|
34
|
+
name
|
|
35
|
+
},
|
|
36
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Root, {
|
|
37
|
+
...props,
|
|
38
|
+
ref,
|
|
39
|
+
actionsRef,
|
|
40
|
+
className: require_cx.cx(styles.root, className),
|
|
41
|
+
"data-invalid": invalid || void 0,
|
|
42
|
+
"data-jaci-component": "field",
|
|
43
|
+
"data-slot": "field",
|
|
44
|
+
disabled,
|
|
45
|
+
dirty,
|
|
46
|
+
invalid,
|
|
47
|
+
name,
|
|
48
|
+
touched,
|
|
49
|
+
validate,
|
|
50
|
+
validationDebounceTime,
|
|
51
|
+
validationMode,
|
|
52
|
+
children
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
const FieldLabel = (0, react.forwardRef)(function FieldLabel({ children, className, htmlFor, ...props }, ref) {
|
|
57
|
+
const { insideField, invalid } = (0, react.useContext)(FieldContext);
|
|
58
|
+
const labelProps = {
|
|
59
|
+
...props,
|
|
60
|
+
className: require_cx.cx(require_field.field({ invalid }).label, className),
|
|
61
|
+
"data-slot": "field-label",
|
|
62
|
+
htmlFor
|
|
63
|
+
};
|
|
64
|
+
if (!insideField) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
65
|
+
...labelProps,
|
|
66
|
+
ref,
|
|
67
|
+
htmlFor,
|
|
68
|
+
children
|
|
69
|
+
});
|
|
70
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Label, {
|
|
71
|
+
...labelProps,
|
|
72
|
+
ref,
|
|
73
|
+
children
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
const FieldDescription = (0, react.forwardRef)(function FieldDescription({ className, ...props }, ref) {
|
|
77
|
+
const { insideField, invalid } = (0, react.useContext)(FieldContext);
|
|
78
|
+
const descriptionProps = {
|
|
79
|
+
...props,
|
|
80
|
+
className: require_cx.cx(require_field.field({ invalid }).description, className),
|
|
81
|
+
"data-slot": "field-description"
|
|
82
|
+
};
|
|
83
|
+
if (!insideField) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
84
|
+
...descriptionProps,
|
|
85
|
+
ref
|
|
86
|
+
});
|
|
87
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Description, {
|
|
88
|
+
...descriptionProps,
|
|
89
|
+
ref
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
const FieldError = (0, react.forwardRef)(function FieldError({ children, className, match, ...props }, ref) {
|
|
93
|
+
const { errors, insideField, invalid } = (0, react.useContext)(FieldContext);
|
|
94
|
+
const content = children ?? renderErrors(errors);
|
|
95
|
+
if (!insideField) {
|
|
96
|
+
if (content === void 0 || content === null || content === false) return null;
|
|
97
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
98
|
+
...props,
|
|
99
|
+
ref,
|
|
100
|
+
className: require_cx.cx(require_field.field({ invalid }).error, className),
|
|
101
|
+
"data-slot": "field-error",
|
|
102
|
+
role: "alert",
|
|
103
|
+
children: content
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Error, {
|
|
107
|
+
...props,
|
|
108
|
+
ref,
|
|
109
|
+
className: require_cx.cx(require_field.field({ invalid }).error, className),
|
|
110
|
+
"data-slot": "field-error",
|
|
111
|
+
match: match ?? (invalid ? true : void 0),
|
|
112
|
+
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {}),
|
|
113
|
+
role: "alert",
|
|
114
|
+
children: content
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
function useFieldState() {
|
|
118
|
+
return (0, react.useContext)(FieldContext);
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
exports.Field = Field;
|
|
122
|
+
exports.FieldDescription = FieldDescription;
|
|
123
|
+
exports.FieldError = FieldError;
|
|
124
|
+
exports.FieldLabel = FieldLabel;
|
|
125
|
+
exports.useFieldState = useFieldState;
|
|
126
|
+
|
|
127
|
+
//# sourceMappingURL=field.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.cjs","names":["JaciFormContext","field","BaseField","cx"],"sources":["../../../src/components/field/field.tsx"],"sourcesContent":["\"use client\";\n\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\nimport type { FieldRoot as BaseFieldRoot } from \"@base-ui/react/field\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { field } from \"../../styled-system/recipes\";\nimport { JaciFormContext } from \"../form\";\n\nexport type FieldValidationMode = \"onSubmit\" | \"onBlur\" | \"onChange\";\n\ninterface FieldContextValue {\n errors: ReactNode[];\n insideField: boolean;\n invalid: boolean;\n name: string | undefined;\n}\n\nconst FieldContext = createContext<FieldContextValue>({\n errors: [],\n insideField: false,\n invalid: false,\n name: undefined,\n});\n\nfunction normalizeErrors(errors: ReactNode | ReactNode[] | undefined): ReactNode[] {\n if (errors === undefined || errors === null || errors === false) {\n return [];\n }\n\n return Array.isArray(errors) ? errors : [errors];\n}\n\nfunction renderErrors(errors: ReactNode[]) {\n if (errors.length <= 1) {\n return errors[0];\n }\n\n return (\n <ul>\n {errors.map((error, index) => (\n <li key={typeof error === \"string\" ? error : index}>{error}</li>\n ))}\n </ul>\n );\n}\n\nexport interface FieldProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** Marks the field invalid when an external validator owns its state. */\n invalid?: boolean;\n /** Field name used to resolve errors supplied to the parent Form. */\n name?: string;\n /** Direct error content, useful outside a Form or with custom validation. */\n errors?: ReactNode | ReactNode[];\n /** Disables the field and its Base UI validation state. */\n disabled?: boolean;\n /** Native/Base UI validation callback. */\n validate?: BaseFieldRoot.Props[\"validate\"];\n /** Validation timing used by the parent Form. */\n validationMode?: FieldValidationMode;\n /** Debounce duration for `validationMode=\"onChange\"`. */\n validationDebounceTime?: number;\n /** Controlled dirty/touched state for integrations with external form state. */\n dirty?: boolean;\n touched?: boolean;\n /** Imperative field validation actions. */\n actionsRef?: BaseFieldRoot.Props[\"actionsRef\"];\n children?: ReactNode;\n}\n\nexport interface FieldLabelProps extends ComponentPropsWithoutRef<\"label\"> {\n htmlFor: string;\n}\n\nexport const Field = forwardRef<HTMLDivElement, FieldProps>(function Field(\n {\n actionsRef,\n children,\n className,\n dirty,\n disabled = false,\n errors: directErrors,\n invalid: invalidProp = false,\n name,\n touched,\n validate,\n validationDebounceTime,\n validationMode,\n ...props\n },\n ref,\n) {\n const { errors: formErrors } = useContext(JaciFormContext);\n const formError = name ? formErrors[name] : undefined;\n const errors =\n directErrors === undefined ? normalizeErrors(formError) : normalizeErrors(directErrors);\n const invalid = invalidProp || errors.length > 0;\n const styles = field({ invalid });\n\n return (\n <FieldContext.Provider value={{ errors, insideField: true, invalid, name }}>\n <BaseField.Root\n {...props}\n ref={ref}\n actionsRef={actionsRef}\n className={cx(styles.root, className)}\n data-invalid={invalid || undefined}\n data-jaci-component=\"field\"\n data-slot=\"field\"\n disabled={disabled}\n dirty={dirty}\n invalid={invalid}\n name={name}\n touched={touched}\n validate={validate}\n validationDebounceTime={validationDebounceTime}\n validationMode={validationMode}\n >\n {children}\n </BaseField.Root>\n </FieldContext.Provider>\n );\n});\n\nexport const FieldLabel = forwardRef<HTMLLabelElement, FieldLabelProps>(function FieldLabel(\n { children, className, htmlFor, ...props },\n ref,\n) {\n const { insideField, invalid } = useContext(FieldContext);\n\n const labelProps = {\n ...props,\n className: cx(field({ invalid }).label, className),\n \"data-slot\": \"field-label\",\n htmlFor,\n };\n\n if (!insideField) {\n return (\n <label {...labelProps} ref={ref} htmlFor={htmlFor}>\n {children}\n </label>\n );\n }\n\n return (\n <BaseField.Label {...labelProps} ref={ref as Ref<HTMLElement>}>\n {children}\n </BaseField.Label>\n );\n});\n\nexport const FieldDescription = forwardRef<HTMLParagraphElement, ComponentPropsWithoutRef<\"p\">>(\n function FieldDescription({ className, ...props }, ref) {\n const { insideField, invalid } = useContext(FieldContext);\n const descriptionProps = {\n ...props,\n className: cx(field({ invalid }).description, className),\n \"data-slot\": \"field-description\",\n };\n\n if (!insideField) {\n return <p {...descriptionProps} ref={ref} />;\n }\n\n return <BaseField.Description {...descriptionProps} ref={ref} />;\n },\n);\n\nexport interface FieldErrorProps extends Omit<ComponentPropsWithoutRef<\"p\">, \"children\"> {\n children?: ReactNode;\n match?: boolean | keyof ValidityState;\n}\n\nexport const FieldError = forwardRef<HTMLParagraphElement, FieldErrorProps>(function FieldError(\n { children, className, match, ...props },\n ref,\n) {\n const { errors, insideField, invalid } = useContext(FieldContext);\n const content = children ?? renderErrors(errors);\n\n if (!insideField) {\n if (content === undefined || content === null || content === false) {\n return null;\n }\n\n return (\n <p\n {...props}\n ref={ref}\n className={cx(field({ invalid }).error, className)}\n data-slot=\"field-error\"\n role=\"alert\"\n >\n {content}\n </p>\n );\n }\n\n return (\n <BaseField.Error\n {...props}\n ref={ref as Ref<HTMLDivElement>}\n className={cx(field({ invalid }).error, className)}\n data-slot=\"field-error\"\n match={match ?? (invalid ? true : undefined)}\n render={<p />}\n role=\"alert\"\n >\n {content}\n </BaseField.Error>\n );\n});\n\nexport function useFieldState() {\n return useContext(FieldContext);\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { FieldRoot } from "@base-ui/react/field";
|
|
3
|
+
//#region src/components/field/field.d.ts
|
|
4
|
+
type FieldValidationMode = "onSubmit" | "onBlur" | "onChange";
|
|
5
|
+
interface FieldContextValue {
|
|
6
|
+
errors: ReactNode[];
|
|
7
|
+
insideField: boolean;
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
name: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
interface FieldProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
12
|
+
/** Marks the field invalid when an external validator owns its state. */
|
|
13
|
+
invalid?: boolean;
|
|
14
|
+
/** Field name used to resolve errors supplied to the parent Form. */
|
|
15
|
+
name?: string;
|
|
16
|
+
/** Direct error content, useful outside a Form or with custom validation. */
|
|
17
|
+
errors?: ReactNode | ReactNode[];
|
|
18
|
+
/** Disables the field and its Base UI validation state. */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Native/Base UI validation callback. */
|
|
21
|
+
validate?: FieldRoot.Props["validate"];
|
|
22
|
+
/** Validation timing used by the parent Form. */
|
|
23
|
+
validationMode?: FieldValidationMode;
|
|
24
|
+
/** Debounce duration for `validationMode="onChange"`. */
|
|
25
|
+
validationDebounceTime?: number;
|
|
26
|
+
/** Controlled dirty/touched state for integrations with external form state. */
|
|
27
|
+
dirty?: boolean;
|
|
28
|
+
touched?: boolean;
|
|
29
|
+
/** Imperative field validation actions. */
|
|
30
|
+
actionsRef?: FieldRoot.Props["actionsRef"];
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
interface FieldLabelProps extends ComponentPropsWithoutRef<"label"> {
|
|
34
|
+
htmlFor: string;
|
|
35
|
+
}
|
|
36
|
+
declare const Field$1: import("react").ForwardRefExoticComponent<FieldProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
37
|
+
declare const FieldLabel: import("react").ForwardRefExoticComponent<FieldLabelProps & import("react").RefAttributes<HTMLLabelElement>>;
|
|
38
|
+
declare const FieldDescription: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
39
|
+
interface FieldErrorProps extends Omit<ComponentPropsWithoutRef<"p">, "children"> {
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
match?: boolean | keyof ValidityState;
|
|
42
|
+
}
|
|
43
|
+
declare const FieldError: import("react").ForwardRefExoticComponent<FieldErrorProps & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
44
|
+
declare function useFieldState(): FieldContextValue;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Field$1 as Field, FieldDescription, FieldError, FieldErrorProps, FieldLabel, FieldLabelProps, FieldProps, FieldValidationMode, useFieldState };
|
|
47
|
+
//# sourceMappingURL=field.d.cts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { FieldRoot } from "@base-ui/react/field";
|
|
3
|
+
//#region src/components/field/field.d.ts
|
|
4
|
+
type FieldValidationMode = "onSubmit" | "onBlur" | "onChange";
|
|
5
|
+
interface FieldContextValue {
|
|
6
|
+
errors: ReactNode[];
|
|
7
|
+
insideField: boolean;
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
name: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
interface FieldProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
12
|
+
/** Marks the field invalid when an external validator owns its state. */
|
|
13
|
+
invalid?: boolean;
|
|
14
|
+
/** Field name used to resolve errors supplied to the parent Form. */
|
|
15
|
+
name?: string;
|
|
16
|
+
/** Direct error content, useful outside a Form or with custom validation. */
|
|
17
|
+
errors?: ReactNode | ReactNode[];
|
|
18
|
+
/** Disables the field and its Base UI validation state. */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Native/Base UI validation callback. */
|
|
21
|
+
validate?: FieldRoot.Props["validate"];
|
|
22
|
+
/** Validation timing used by the parent Form. */
|
|
23
|
+
validationMode?: FieldValidationMode;
|
|
24
|
+
/** Debounce duration for `validationMode="onChange"`. */
|
|
25
|
+
validationDebounceTime?: number;
|
|
26
|
+
/** Controlled dirty/touched state for integrations with external form state. */
|
|
27
|
+
dirty?: boolean;
|
|
28
|
+
touched?: boolean;
|
|
29
|
+
/** Imperative field validation actions. */
|
|
30
|
+
actionsRef?: FieldRoot.Props["actionsRef"];
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
interface FieldLabelProps extends ComponentPropsWithoutRef<"label"> {
|
|
34
|
+
htmlFor: string;
|
|
35
|
+
}
|
|
36
|
+
declare const Field$1: import("react").ForwardRefExoticComponent<FieldProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
37
|
+
declare const FieldLabel: import("react").ForwardRefExoticComponent<FieldLabelProps & import("react").RefAttributes<HTMLLabelElement>>;
|
|
38
|
+
declare const FieldDescription: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
39
|
+
interface FieldErrorProps extends Omit<ComponentPropsWithoutRef<"p">, "children"> {
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
match?: boolean | keyof ValidityState;
|
|
42
|
+
}
|
|
43
|
+
declare const FieldError: import("react").ForwardRefExoticComponent<FieldErrorProps & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
44
|
+
declare function useFieldState(): FieldContextValue;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Field$1 as Field, FieldDescription, FieldError, FieldErrorProps, FieldLabel, FieldLabelProps, FieldProps, FieldValidationMode, useFieldState };
|
|
47
|
+
//# sourceMappingURL=field.d.ts.map
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx } from "../../styled-system/css/cx.js";
|
|
3
|
+
import { field } from "../../styled-system/recipes/field.js";
|
|
4
|
+
import { JaciFormContext } from "../form/form.js";
|
|
5
|
+
import { createContext, forwardRef, useContext } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { Field } from "@base-ui/react/field";
|
|
8
|
+
//#region src/components/field/field.tsx
|
|
9
|
+
const FieldContext = createContext({
|
|
10
|
+
errors: [],
|
|
11
|
+
insideField: false,
|
|
12
|
+
invalid: false,
|
|
13
|
+
name: void 0
|
|
14
|
+
});
|
|
15
|
+
function normalizeErrors(errors) {
|
|
16
|
+
if (errors === void 0 || errors === null || errors === false) return [];
|
|
17
|
+
return Array.isArray(errors) ? errors : [errors];
|
|
18
|
+
}
|
|
19
|
+
function renderErrors(errors) {
|
|
20
|
+
if (errors.length <= 1) return errors[0];
|
|
21
|
+
return /* @__PURE__ */ jsx("ul", { children: errors.map((error, index) => /* @__PURE__ */ jsx("li", { children: error }, typeof error === "string" ? error : index)) });
|
|
22
|
+
}
|
|
23
|
+
const Field$1 = forwardRef(function Field$2({ actionsRef, children, className, dirty, disabled = false, errors: directErrors, invalid: invalidProp = false, name, touched, validate, validationDebounceTime, validationMode, ...props }, ref) {
|
|
24
|
+
const { errors: formErrors } = useContext(JaciFormContext);
|
|
25
|
+
const formError = name ? formErrors[name] : void 0;
|
|
26
|
+
const errors = directErrors === void 0 ? normalizeErrors(formError) : normalizeErrors(directErrors);
|
|
27
|
+
const invalid = invalidProp || errors.length > 0;
|
|
28
|
+
const styles = field({ invalid });
|
|
29
|
+
return /* @__PURE__ */ jsx(FieldContext.Provider, {
|
|
30
|
+
value: {
|
|
31
|
+
errors,
|
|
32
|
+
insideField: true,
|
|
33
|
+
invalid,
|
|
34
|
+
name
|
|
35
|
+
},
|
|
36
|
+
children: /* @__PURE__ */ jsx(Field.Root, {
|
|
37
|
+
...props,
|
|
38
|
+
ref,
|
|
39
|
+
actionsRef,
|
|
40
|
+
className: cx(styles.root, className),
|
|
41
|
+
"data-invalid": invalid || void 0,
|
|
42
|
+
"data-jaci-component": "field",
|
|
43
|
+
"data-slot": "field",
|
|
44
|
+
disabled,
|
|
45
|
+
dirty,
|
|
46
|
+
invalid,
|
|
47
|
+
name,
|
|
48
|
+
touched,
|
|
49
|
+
validate,
|
|
50
|
+
validationDebounceTime,
|
|
51
|
+
validationMode,
|
|
52
|
+
children
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
const FieldLabel = forwardRef(function FieldLabel({ children, className, htmlFor, ...props }, ref) {
|
|
57
|
+
const { insideField, invalid } = useContext(FieldContext);
|
|
58
|
+
const labelProps = {
|
|
59
|
+
...props,
|
|
60
|
+
className: cx(field({ invalid }).label, className),
|
|
61
|
+
"data-slot": "field-label",
|
|
62
|
+
htmlFor
|
|
63
|
+
};
|
|
64
|
+
if (!insideField) return /* @__PURE__ */ jsx("label", {
|
|
65
|
+
...labelProps,
|
|
66
|
+
ref,
|
|
67
|
+
htmlFor,
|
|
68
|
+
children
|
|
69
|
+
});
|
|
70
|
+
return /* @__PURE__ */ jsx(Field.Label, {
|
|
71
|
+
...labelProps,
|
|
72
|
+
ref,
|
|
73
|
+
children
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
const FieldDescription = forwardRef(function FieldDescription({ className, ...props }, ref) {
|
|
77
|
+
const { insideField, invalid } = useContext(FieldContext);
|
|
78
|
+
const descriptionProps = {
|
|
79
|
+
...props,
|
|
80
|
+
className: cx(field({ invalid }).description, className),
|
|
81
|
+
"data-slot": "field-description"
|
|
82
|
+
};
|
|
83
|
+
if (!insideField) return /* @__PURE__ */ jsx("p", {
|
|
84
|
+
...descriptionProps,
|
|
85
|
+
ref
|
|
86
|
+
});
|
|
87
|
+
return /* @__PURE__ */ jsx(Field.Description, {
|
|
88
|
+
...descriptionProps,
|
|
89
|
+
ref
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
const FieldError = forwardRef(function FieldError({ children, className, match, ...props }, ref) {
|
|
93
|
+
const { errors, insideField, invalid } = useContext(FieldContext);
|
|
94
|
+
const content = children ?? renderErrors(errors);
|
|
95
|
+
if (!insideField) {
|
|
96
|
+
if (content === void 0 || content === null || content === false) return null;
|
|
97
|
+
return /* @__PURE__ */ jsx("p", {
|
|
98
|
+
...props,
|
|
99
|
+
ref,
|
|
100
|
+
className: cx(field({ invalid }).error, className),
|
|
101
|
+
"data-slot": "field-error",
|
|
102
|
+
role: "alert",
|
|
103
|
+
children: content
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return /* @__PURE__ */ jsx(Field.Error, {
|
|
107
|
+
...props,
|
|
108
|
+
ref,
|
|
109
|
+
className: cx(field({ invalid }).error, className),
|
|
110
|
+
"data-slot": "field-error",
|
|
111
|
+
match: match ?? (invalid ? true : void 0),
|
|
112
|
+
render: /* @__PURE__ */ jsx("p", {}),
|
|
113
|
+
role: "alert",
|
|
114
|
+
children: content
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
function useFieldState() {
|
|
118
|
+
return useContext(FieldContext);
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { Field$1 as Field, FieldDescription, FieldError, FieldLabel, useFieldState };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","names":["Field","BaseField"],"sources":["../../../src/components/field/field.tsx"],"sourcesContent":["\"use client\";\n\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\nimport type { FieldRoot as BaseFieldRoot } from \"@base-ui/react/field\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { field } from \"../../styled-system/recipes\";\nimport { JaciFormContext } from \"../form\";\n\nexport type FieldValidationMode = \"onSubmit\" | \"onBlur\" | \"onChange\";\n\ninterface FieldContextValue {\n errors: ReactNode[];\n insideField: boolean;\n invalid: boolean;\n name: string | undefined;\n}\n\nconst FieldContext = createContext<FieldContextValue>({\n errors: [],\n insideField: false,\n invalid: false,\n name: undefined,\n});\n\nfunction normalizeErrors(errors: ReactNode | ReactNode[] | undefined): ReactNode[] {\n if (errors === undefined || errors === null || errors === false) {\n return [];\n }\n\n return Array.isArray(errors) ? errors : [errors];\n}\n\nfunction renderErrors(errors: ReactNode[]) {\n if (errors.length <= 1) {\n return errors[0];\n }\n\n return (\n <ul>\n {errors.map((error, index) => (\n <li key={typeof error === \"string\" ? error : index}>{error}</li>\n ))}\n </ul>\n );\n}\n\nexport interface FieldProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** Marks the field invalid when an external validator owns its state. */\n invalid?: boolean;\n /** Field name used to resolve errors supplied to the parent Form. */\n name?: string;\n /** Direct error content, useful outside a Form or with custom validation. */\n errors?: ReactNode | ReactNode[];\n /** Disables the field and its Base UI validation state. */\n disabled?: boolean;\n /** Native/Base UI validation callback. */\n validate?: BaseFieldRoot.Props[\"validate\"];\n /** Validation timing used by the parent Form. */\n validationMode?: FieldValidationMode;\n /** Debounce duration for `validationMode=\"onChange\"`. */\n validationDebounceTime?: number;\n /** Controlled dirty/touched state for integrations with external form state. */\n dirty?: boolean;\n touched?: boolean;\n /** Imperative field validation actions. */\n actionsRef?: BaseFieldRoot.Props[\"actionsRef\"];\n children?: ReactNode;\n}\n\nexport interface FieldLabelProps extends ComponentPropsWithoutRef<\"label\"> {\n htmlFor: string;\n}\n\nexport const Field = forwardRef<HTMLDivElement, FieldProps>(function Field(\n {\n actionsRef,\n children,\n className,\n dirty,\n disabled = false,\n errors: directErrors,\n invalid: invalidProp = false,\n name,\n touched,\n validate,\n validationDebounceTime,\n validationMode,\n ...props\n },\n ref,\n) {\n const { errors: formErrors } = useContext(JaciFormContext);\n const formError = name ? formErrors[name] : undefined;\n const errors =\n directErrors === undefined ? normalizeErrors(formError) : normalizeErrors(directErrors);\n const invalid = invalidProp || errors.length > 0;\n const styles = field({ invalid });\n\n return (\n <FieldContext.Provider value={{ errors, insideField: true, invalid, name }}>\n <BaseField.Root\n {...props}\n ref={ref}\n actionsRef={actionsRef}\n className={cx(styles.root, className)}\n data-invalid={invalid || undefined}\n data-jaci-component=\"field\"\n data-slot=\"field\"\n disabled={disabled}\n dirty={dirty}\n invalid={invalid}\n name={name}\n touched={touched}\n validate={validate}\n validationDebounceTime={validationDebounceTime}\n validationMode={validationMode}\n >\n {children}\n </BaseField.Root>\n </FieldContext.Provider>\n );\n});\n\nexport const FieldLabel = forwardRef<HTMLLabelElement, FieldLabelProps>(function FieldLabel(\n { children, className, htmlFor, ...props },\n ref,\n) {\n const { insideField, invalid } = useContext(FieldContext);\n\n const labelProps = {\n ...props,\n className: cx(field({ invalid }).label, className),\n \"data-slot\": \"field-label\",\n htmlFor,\n };\n\n if (!insideField) {\n return (\n <label {...labelProps} ref={ref} htmlFor={htmlFor}>\n {children}\n </label>\n );\n }\n\n return (\n <BaseField.Label {...labelProps} ref={ref as Ref<HTMLElement>}>\n {children}\n </BaseField.Label>\n );\n});\n\nexport const FieldDescription = forwardRef<HTMLParagraphElement, ComponentPropsWithoutRef<\"p\">>(\n function FieldDescription({ className, ...props }, ref) {\n const { insideField, invalid } = useContext(FieldContext);\n const descriptionProps = {\n ...props,\n className: cx(field({ invalid }).description, className),\n \"data-slot\": \"field-description\",\n };\n\n if (!insideField) {\n return <p {...descriptionProps} ref={ref} />;\n }\n\n return <BaseField.Description {...descriptionProps} ref={ref} />;\n },\n);\n\nexport interface FieldErrorProps extends Omit<ComponentPropsWithoutRef<\"p\">, \"children\"> {\n children?: ReactNode;\n match?: boolean | keyof ValidityState;\n}\n\nexport const FieldError = forwardRef<HTMLParagraphElement, FieldErrorProps>(function FieldError(\n { children, className, match, ...props },\n ref,\n) {\n const { errors, insideField, invalid } = useContext(FieldContext);\n const content = children ?? renderErrors(errors);\n\n if (!insideField) {\n if (content === undefined || content === null || content === false) {\n return null;\n }\n\n return (\n <p\n {...props}\n ref={ref}\n className={cx(field({ invalid }).error, className)}\n data-slot=\"field-error\"\n role=\"alert\"\n >\n {content}\n </p>\n );\n }\n\n return (\n <BaseField.Error\n {...props}\n ref={ref as Ref<HTMLDivElement>}\n className={cx(field({ invalid }).error, className)}\n data-slot=\"field-error\"\n match={match ?? (invalid ? true : undefined)}\n render={<p />}\n role=\"alert\"\n >\n {content}\n </BaseField.Error>\n );\n});\n\nexport function useFieldState() {\n return useContext(FieldContext);\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Field, FieldDescription, FieldError, FieldErrorProps, FieldLabel, FieldLabelProps, FieldProps, FieldValidationMode, useFieldState } from "./field.cjs";
|
|
2
|
+
export { Field, FieldDescription, FieldError, type FieldErrorProps, FieldLabel, type FieldLabelProps, type FieldProps, type FieldValidationMode, useFieldState };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Field, FieldDescription, FieldError, FieldErrorProps, FieldLabel, FieldLabelProps, FieldProps, FieldValidationMode, useFieldState } from "./field.js";
|
|
2
|
+
export { Field, FieldDescription, FieldError, type FieldErrorProps, FieldLabel, type FieldLabelProps, type FieldProps, type FieldValidationMode, useFieldState };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_cx = require("../../styled-system/css/cx.cjs");
|
|
3
|
+
const require_fieldset = require("../../styled-system/recipes/fieldset.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let _base_ui_react_fieldset = require("@base-ui/react/fieldset");
|
|
7
|
+
//#region src/components/fieldset/fieldset.tsx
|
|
8
|
+
const FieldsetRoot = (0, react.forwardRef)(function FieldsetRoot({ children, className, disabled = false, ...props }, ref) {
|
|
9
|
+
const styles = require_fieldset.fieldset({ disabled });
|
|
10
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_fieldset.Fieldset.Root, {
|
|
11
|
+
...props,
|
|
12
|
+
ref,
|
|
13
|
+
className: require_cx.cx(styles.root, className),
|
|
14
|
+
"data-disabled": disabled || void 0,
|
|
15
|
+
"data-jaci-component": "fieldset",
|
|
16
|
+
"data-slot": "fieldset",
|
|
17
|
+
disabled,
|
|
18
|
+
children
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
const FieldsetLegend = (0, react.forwardRef)(function FieldsetLegend({ className, ...props }, ref) {
|
|
22
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_fieldset.Fieldset.Legend, {
|
|
23
|
+
...props,
|
|
24
|
+
ref,
|
|
25
|
+
className: require_cx.cx(require_fieldset.fieldset().legend, className),
|
|
26
|
+
"data-slot": "fieldset-legend"
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
const FieldsetDescription = (0, react.forwardRef)(function FieldsetDescription({ className, ...props }, ref) {
|
|
30
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
31
|
+
...props,
|
|
32
|
+
ref,
|
|
33
|
+
className: require_cx.cx(require_fieldset.fieldset().description, className),
|
|
34
|
+
"data-slot": "fieldset-description"
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
const Fieldset = {
|
|
38
|
+
Root: FieldsetRoot,
|
|
39
|
+
Legend: FieldsetLegend,
|
|
40
|
+
Description: FieldsetDescription
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
exports.Fieldset = Fieldset;
|
|
44
|
+
exports.FieldsetDescription = FieldsetDescription;
|
|
45
|
+
exports.FieldsetLegend = FieldsetLegend;
|
|
46
|
+
exports.FieldsetRoot = FieldsetRoot;
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=fieldset.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldset.cjs","names":["fieldset","BaseFieldset","cx"],"sources":["../../../src/components/fieldset/fieldset.tsx"],"sourcesContent":["\"use client\";\n\nimport { Fieldset as BaseFieldset } from \"@base-ui/react/fieldset\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { fieldset } from \"../../styled-system/recipes\";\n\nexport interface FieldsetRootProps extends ComponentPropsWithoutRef<\"fieldset\"> {\n children?: ReactNode;\n}\n\nexport const FieldsetRoot = forwardRef<HTMLFieldSetElement, FieldsetRootProps>(\n function FieldsetRoot({ children, className, disabled = false, ...props }, ref) {\n const styles = fieldset({ disabled });\n\n return (\n <BaseFieldset.Root\n {...props}\n ref={ref as Ref<HTMLElement>}\n className={cx(styles.root, className)}\n data-disabled={disabled || undefined}\n data-jaci-component=\"fieldset\"\n data-slot=\"fieldset\"\n disabled={disabled}\n >\n {children}\n </BaseFieldset.Root>\n );\n },\n);\n\nexport type FieldsetLegendProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const FieldsetLegend = forwardRef<HTMLDivElement, FieldsetLegendProps>(\n function FieldsetLegend({ className, ...props }, ref) {\n return (\n <BaseFieldset.Legend\n {...props}\n ref={ref}\n className={cx(fieldset().legend, className)}\n data-slot=\"fieldset-legend\"\n />\n );\n },\n);\n\nexport const FieldsetDescription = forwardRef<HTMLParagraphElement, ComponentPropsWithoutRef<\"p\">>(\n function FieldsetDescription({ className, ...props }, ref) {\n return (\n <p\n {...props}\n ref={ref}\n className={cx(fieldset().description, className)}\n data-slot=\"fieldset-description\"\n />\n );\n },\n);\n\nexport const Fieldset = {\n Root: FieldsetRoot,\n Legend: FieldsetLegend,\n Description: FieldsetDescription,\n};\n"],"mappings":";;;;;;;AAaA,MAAa,gBAAA,GAAA,MAAA,WAAA,CACX,SAAS,aAAa,EAAE,UAAU,WAAW,WAAW,OAAO,GAAG,SAAS,KAAK;CAC9E,MAAM,SAASA,iBAAAA,SAAS,EAAE,SAAS,CAAC;CAEpC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,SAAa,MAAd;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAG,OAAO,MAAM,SAAS;EACpC,iBAAe,YAAY,KAAA;EAC3B,uBAAoB;EACpB,aAAU;EACA;EAET;CACgB,CAAA;AAEvB,CACF;AAIA,MAAa,kBAAA,GAAA,MAAA,WAAA,CACX,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACD,wBAAAA,SAAa,QAAd;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAGF,iBAAAA,SAAS,CAAC,CAAC,QAAQ,SAAS;EAC1C,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,uBAAA,GAAA,MAAA,WAAA,CACX,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACE,GAAI;EACC;EACL,WAAWE,WAAAA,GAAGF,iBAAAA,SAAS,CAAC,CAAC,aAAa,SAAS;EAC/C,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,WAAW;CACtB,MAAM;CACN,QAAQ;CACR,aAAa;AACf"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
//#region src/components/fieldset/fieldset.d.ts
|
|
3
|
+
interface FieldsetRootProps extends ComponentPropsWithoutRef<"fieldset"> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare const FieldsetRoot: import("react").ForwardRefExoticComponent<FieldsetRootProps & import("react").RefAttributes<HTMLFieldSetElement>>;
|
|
7
|
+
type FieldsetLegendProps = ComponentPropsWithoutRef<"div">;
|
|
8
|
+
declare const FieldsetLegend: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const FieldsetDescription: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
10
|
+
declare const Fieldset: {
|
|
11
|
+
Root: import("react").ForwardRefExoticComponent<FieldsetRootProps & import("react").RefAttributes<HTMLFieldSetElement>>;
|
|
12
|
+
Legend: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Fieldset, FieldsetDescription, FieldsetLegend, FieldsetLegendProps, FieldsetRoot, FieldsetRootProps };
|
|
17
|
+
//# sourceMappingURL=fieldset.d.cts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
//#region src/components/fieldset/fieldset.d.ts
|
|
3
|
+
interface FieldsetRootProps extends ComponentPropsWithoutRef<"fieldset"> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare const FieldsetRoot: import("react").ForwardRefExoticComponent<FieldsetRootProps & import("react").RefAttributes<HTMLFieldSetElement>>;
|
|
7
|
+
type FieldsetLegendProps = ComponentPropsWithoutRef<"div">;
|
|
8
|
+
declare const FieldsetLegend: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const FieldsetDescription: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
10
|
+
declare const Fieldset: {
|
|
11
|
+
Root: import("react").ForwardRefExoticComponent<FieldsetRootProps & import("react").RefAttributes<HTMLFieldSetElement>>;
|
|
12
|
+
Legend: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Fieldset, FieldsetDescription, FieldsetLegend, FieldsetLegendProps, FieldsetRoot, FieldsetRootProps };
|
|
17
|
+
//# sourceMappingURL=fieldset.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cx } from "../../styled-system/css/cx.js";
|
|
3
|
+
import { fieldset } from "../../styled-system/recipes/fieldset.js";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Fieldset } from "@base-ui/react/fieldset";
|
|
7
|
+
//#region src/components/fieldset/fieldset.tsx
|
|
8
|
+
const FieldsetRoot = forwardRef(function FieldsetRoot({ children, className, disabled = false, ...props }, ref) {
|
|
9
|
+
const styles = fieldset({ disabled });
|
|
10
|
+
return /* @__PURE__ */ jsx(Fieldset.Root, {
|
|
11
|
+
...props,
|
|
12
|
+
ref,
|
|
13
|
+
className: cx(styles.root, className),
|
|
14
|
+
"data-disabled": disabled || void 0,
|
|
15
|
+
"data-jaci-component": "fieldset",
|
|
16
|
+
"data-slot": "fieldset",
|
|
17
|
+
disabled,
|
|
18
|
+
children
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
const FieldsetLegend = forwardRef(function FieldsetLegend({ className, ...props }, ref) {
|
|
22
|
+
return /* @__PURE__ */ jsx(Fieldset.Legend, {
|
|
23
|
+
...props,
|
|
24
|
+
ref,
|
|
25
|
+
className: cx(fieldset().legend, className),
|
|
26
|
+
"data-slot": "fieldset-legend"
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
const FieldsetDescription = forwardRef(function FieldsetDescription({ className, ...props }, ref) {
|
|
30
|
+
return /* @__PURE__ */ jsx("p", {
|
|
31
|
+
...props,
|
|
32
|
+
ref,
|
|
33
|
+
className: cx(fieldset().description, className),
|
|
34
|
+
"data-slot": "fieldset-description"
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
const Fieldset$1 = {
|
|
38
|
+
Root: FieldsetRoot,
|
|
39
|
+
Legend: FieldsetLegend,
|
|
40
|
+
Description: FieldsetDescription
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Fieldset$1 as Fieldset, FieldsetDescription, FieldsetLegend, FieldsetRoot };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=fieldset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldset.js","names":["BaseFieldset","Fieldset"],"sources":["../../../src/components/fieldset/fieldset.tsx"],"sourcesContent":["\"use client\";\n\nimport { Fieldset as BaseFieldset } from \"@base-ui/react/fieldset\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { fieldset } from \"../../styled-system/recipes\";\n\nexport interface FieldsetRootProps extends ComponentPropsWithoutRef<\"fieldset\"> {\n children?: ReactNode;\n}\n\nexport const FieldsetRoot = forwardRef<HTMLFieldSetElement, FieldsetRootProps>(\n function FieldsetRoot({ children, className, disabled = false, ...props }, ref) {\n const styles = fieldset({ disabled });\n\n return (\n <BaseFieldset.Root\n {...props}\n ref={ref as Ref<HTMLElement>}\n className={cx(styles.root, className)}\n data-disabled={disabled || undefined}\n data-jaci-component=\"fieldset\"\n data-slot=\"fieldset\"\n disabled={disabled}\n >\n {children}\n </BaseFieldset.Root>\n );\n },\n);\n\nexport type FieldsetLegendProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const FieldsetLegend = forwardRef<HTMLDivElement, FieldsetLegendProps>(\n function FieldsetLegend({ className, ...props }, ref) {\n return (\n <BaseFieldset.Legend\n {...props}\n ref={ref}\n className={cx(fieldset().legend, className)}\n data-slot=\"fieldset-legend\"\n />\n );\n },\n);\n\nexport const FieldsetDescription = forwardRef<HTMLParagraphElement, ComponentPropsWithoutRef<\"p\">>(\n function FieldsetDescription({ className, ...props }, ref) {\n return (\n <p\n {...props}\n ref={ref}\n className={cx(fieldset().description, className)}\n data-slot=\"fieldset-description\"\n />\n );\n },\n);\n\nexport const Fieldset = {\n Root: FieldsetRoot,\n Legend: FieldsetLegend,\n Description: FieldsetDescription,\n};\n"],"mappings":";;;;;;;AAaA,MAAa,eAAe,WAC1B,SAAS,aAAa,EAAE,UAAU,WAAW,WAAW,OAAO,GAAG,SAAS,KAAK;CAC9E,MAAM,SAAS,SAAS,EAAE,SAAS,CAAC;CAEpC,OACE,oBAACA,SAAa,MAAd;EACE,GAAI;EACC;EACL,WAAW,GAAG,OAAO,MAAM,SAAS;EACpC,iBAAe,YAAY,KAAA;EAC3B,uBAAoB;EACpB,aAAU;EACA;EAET;CACgB,CAAA;AAEvB,CACF;AAIA,MAAa,iBAAiB,WAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,oBAACA,SAAa,QAAd;EACE,GAAI;EACC;EACL,WAAW,GAAG,SAAS,CAAC,CAAC,QAAQ,SAAS;EAC1C,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,OACE,oBAAC,KAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,SAAS,CAAC,CAAC,aAAa,SAAS;EAC/C,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAaC,aAAW;CACtB,MAAM;CACN,QAAQ;CACR,aAAa;AACf"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_cx = require("../../styled-system/css/cx.cjs");
|
|
3
|
+
const require_form = require("../../styled-system/recipes/form.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let _base_ui_react_form = require("@base-ui/react/form");
|
|
7
|
+
//#region src/components/form/form.tsx
|
|
8
|
+
const JaciFormContext = (0, react.createContext)({ errors: {} });
|
|
9
|
+
const Form = (0, react.forwardRef)(function Form({ children, className, errors, ...props }, ref) {
|
|
10
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(JaciFormContext.Provider, {
|
|
11
|
+
value: { errors: errors ?? {} },
|
|
12
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_form.Form, {
|
|
13
|
+
...props,
|
|
14
|
+
ref,
|
|
15
|
+
className: require_cx.cx(require_form.form(), className),
|
|
16
|
+
"data-jaci-component": "form",
|
|
17
|
+
"data-slot": "form",
|
|
18
|
+
errors,
|
|
19
|
+
children
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.Form = Form;
|
|
25
|
+
exports.JaciFormContext = JaciFormContext;
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=form.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.cjs","names":["BaseForm","cx","form"],"sources":["../../../src/components/form/form.tsx"],"sourcesContent":["\"use client\";\n\nimport { Form as BaseForm } from \"@base-ui/react/form\";\nimport { createContext, forwardRef } from \"react\";\nimport type { ReactElement, ReactNode, RefAttributes } from \"react\";\nimport type { FormProps as BaseFormProps } from \"@base-ui/react/form\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { form } from \"../../styled-system/recipes\";\n\nexport type FormErrors = Record<string, string | string[]>;\n\ninterface JaciFormContextValue {\n errors: FormErrors;\n}\n\nexport const JaciFormContext = createContext<JaciFormContextValue>({ errors: {} });\n\nexport interface FormProps<FormValues extends Record<string, unknown> = Record<string, unknown>>\n extends Omit<BaseFormProps<FormValues>, \"children\" | \"errors\" | \"className\"> {\n className?: string;\n /** External errors keyed by each field's `name`. */\n errors?: FormErrors;\n children?: ReactNode;\n}\n\nconst FormRoot = forwardRef<HTMLFormElement, FormProps>(function Form(\n { children, className, errors, ...props },\n ref,\n) {\n return (\n <JaciFormContext.Provider value={{ errors: errors ?? {} }}>\n <BaseForm\n {...props}\n ref={ref}\n className={cx(form(), className)}\n data-jaci-component=\"form\"\n data-slot=\"form\"\n errors={errors}\n >\n {children}\n </BaseForm>\n </JaciFormContext.Provider>\n );\n});\n\nexport const Form = FormRoot as <\n FormValues extends Record<string, unknown> = Record<string, unknown>,\n>(\n props: FormProps<FormValues> & RefAttributes<HTMLFormElement>,\n) => ReactElement | null;\n"],"mappings":";;;;;;;AAgBA,MAAa,mBAAA,GAAA,MAAA,cAAA,CAAsD,EAAE,QAAQ,CAAC,EAAE,CAAC;AA8BjF,MAAa,QApBP,GAAA,MAAA,WAAA,CAAkD,SAAS,KAC/D,EAAE,UAAU,WAAW,QAAQ,GAAG,SAClC,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,gBAAgB,UAAjB;EAA0B,OAAO,EAAE,QAAQ,UAAU,CAAC,EAAE;YACtD,iBAAA,GAAA,kBAAA,IAAA,CAACA,oBAAAA,MAAD;GACE,GAAI;GACC;GACL,WAAWC,WAAAA,GAAGC,aAAAA,KAAK,GAAG,SAAS;GAC/B,uBAAoB;GACpB,aAAU;GACF;GAEP;EACO,CAAA;CACc,CAAA;AAE9B,CAEoB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactElement, ReactNode, RefAttributes } from "react";
|
|
2
|
+
import { FormProps } from "@base-ui/react/form";
|
|
3
|
+
//#region src/components/form/form.d.ts
|
|
4
|
+
type FormErrors = Record<string, string | string[]>;
|
|
5
|
+
interface JaciFormContextValue {
|
|
6
|
+
errors: FormErrors;
|
|
7
|
+
}
|
|
8
|
+
declare const JaciFormContext: import("react").Context<JaciFormContextValue>;
|
|
9
|
+
interface FormProps$1<FormValues extends Record<string, unknown> = Record<string, unknown>> extends Omit<FormProps<FormValues>, "children" | "errors" | "className"> {
|
|
10
|
+
className?: string;
|
|
11
|
+
/** External errors keyed by each field's `name`. */
|
|
12
|
+
errors?: FormErrors;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare const Form: <FormValues extends Record<string, unknown> = Record<string, unknown>>(props: FormProps$1<FormValues> & RefAttributes<HTMLFormElement>) => ReactElement | null;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Form, FormErrors, FormProps$1 as FormProps, JaciFormContext };
|
|
18
|
+
//# sourceMappingURL=form.d.cts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactElement, ReactNode, RefAttributes } from "react";
|
|
2
|
+
import { FormProps } from "@base-ui/react/form";
|
|
3
|
+
//#region src/components/form/form.d.ts
|
|
4
|
+
type FormErrors = Record<string, string | string[]>;
|
|
5
|
+
interface JaciFormContextValue {
|
|
6
|
+
errors: FormErrors;
|
|
7
|
+
}
|
|
8
|
+
declare const JaciFormContext: import("react").Context<JaciFormContextValue>;
|
|
9
|
+
interface FormProps$1<FormValues extends Record<string, unknown> = Record<string, unknown>> extends Omit<FormProps<FormValues>, "children" | "errors" | "className"> {
|
|
10
|
+
className?: string;
|
|
11
|
+
/** External errors keyed by each field's `name`. */
|
|
12
|
+
errors?: FormErrors;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare const Form$1: <FormValues extends Record<string, unknown> = Record<string, unknown>>(props: FormProps$1<FormValues> & RefAttributes<HTMLFormElement>) => ReactElement | null;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Form$1 as Form, FormErrors, FormProps$1 as FormProps, JaciFormContext };
|
|
18
|
+
//# sourceMappingURL=form.d.ts.map
|