@me1a/ui 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{atoms/accordion.mjs → accordion/index.mjs} +2 -2
- package/dist/accordion/index.mjs.map +1 -0
- package/dist/{atoms/avatar.mjs → avatar/index.mjs} +2 -2
- package/dist/avatar/index.mjs.map +1 -0
- package/dist/{atoms/badge.d.mts → badge/index.d.mts} +9 -8
- package/dist/{atoms/badge.mjs → badge/index.mjs} +2 -2
- package/dist/{atoms/badge.mjs.map → badge/index.mjs.map} +1 -1
- package/dist/{atoms/box.mjs → box/index.mjs} +2 -2
- package/dist/box/index.mjs.map +1 -0
- package/dist/{atoms/breadcrumb.mjs → breadcrumb/index.mjs} +2 -2
- package/dist/breadcrumb/index.mjs.map +1 -0
- package/dist/{atoms/button.d.mts → button/index.d.mts} +2 -2
- package/dist/{atoms/button.mjs → button/index.mjs} +2 -2
- package/dist/button/index.mjs.map +1 -0
- package/dist/card/index.d.mts +127 -0
- package/dist/card/index.mjs +2 -0
- package/dist/card/index.mjs.map +1 -0
- package/dist/{atoms/checkbox.mjs → checkbox/index.mjs} +2 -2
- package/dist/checkbox/index.mjs.map +1 -0
- package/dist/{atoms/collapsible.mjs → collapsible/index.mjs} +2 -2
- package/dist/collapsible/index.mjs.map +1 -0
- package/dist/{atoms/command.mjs → command/index.mjs} +2 -2
- package/dist/command/index.mjs.map +1 -0
- package/dist/container/index.d.mts +33 -0
- package/dist/{atoms/container.mjs → container/index.mjs} +2 -2
- package/dist/container/index.mjs.map +1 -0
- package/dist/{atoms/dialog.mjs → dialog/index.mjs} +2 -2
- package/dist/dialog/index.mjs.map +1 -0
- package/dist/{organisms/drawer.mjs → drawer/index.mjs} +2 -2
- package/dist/drawer/index.mjs.map +1 -0
- package/dist/{organisms/dropdown-menu.d.mts → dropdown-menu/index.d.mts} +2 -2
- package/dist/{organisms/dropdown-menu.mjs → dropdown-menu/index.mjs} +2 -2
- package/dist/dropdown-menu/index.mjs.map +1 -0
- package/dist/{rhf/form.mjs → form/index.mjs} +2 -2
- package/dist/form/index.mjs.map +1 -0
- package/dist/{hooks.d.mts → hooks/index.d.mts} +2 -2
- package/dist/{hooks.mjs → hooks/index.mjs} +2 -2
- package/dist/{hooks.js.map → hooks/index.mjs.map} +1 -1
- package/dist/index.d.mts +159 -39
- package/dist/index.mjs +47 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{atoms/input.mjs → input/index.mjs} +2 -2
- package/dist/{atoms/input.mjs.map → input/index.mjs.map} +1 -1
- package/dist/{atoms/label.d.mts → label/index.d.mts} +2 -2
- package/dist/{atoms/label.mjs → label/index.mjs} +2 -2
- package/dist/{atoms/label.mjs.map → label/index.mjs.map} +1 -1
- package/dist/{molecules/navigation-menu.d.mts → navigation-menu/index.d.mts} +21 -20
- package/dist/{molecules/navigation-menu.mjs → navigation-menu/index.mjs} +2 -2
- package/dist/navigation-menu/index.mjs.map +1 -0
- package/dist/{atoms/page-loader.d.mts → page-loader/index.d.mts} +2 -2
- package/dist/{atoms/page-loader.mjs → page-loader/index.mjs} +2 -2
- package/dist/page-loader/index.mjs.map +1 -0
- package/dist/{atoms/pagination.d.mts → pagination/index.d.mts} +2 -2
- package/dist/{atoms/pagination.mjs → pagination/index.mjs} +2 -2
- package/dist/pagination/index.mjs.map +1 -0
- package/dist/{atoms/popover.mjs → popover/index.mjs} +2 -2
- package/dist/popover/index.mjs.map +1 -0
- package/dist/{atoms/radio-group.d.mts → radio-group/index.d.mts} +2 -2
- package/dist/{atoms/radio-group.mjs → radio-group/index.mjs} +2 -2
- package/dist/radio-group/index.mjs.map +1 -0
- package/dist/{atoms/resizable.mjs → resizable/index.mjs} +2 -2
- package/dist/resizable/index.mjs.map +1 -0
- package/dist/{rhf/rhf-checkbox.mjs → rhf-checkbox/index.mjs} +2 -2
- package/dist/rhf-checkbox/index.mjs.map +1 -0
- package/dist/{rhf/rhf-multi-select.mjs → rhf-multi-select/index.mjs} +2 -2
- package/dist/rhf-multi-select/index.mjs.map +1 -0
- package/dist/{rhf/rhf-radio-button-group.mjs → rhf-radio-button-group/index.mjs} +2 -2
- package/dist/rhf-radio-button-group/index.mjs.map +1 -0
- package/dist/{rhf/rhf-radio-group.mjs → rhf-radio-group/index.mjs} +2 -2
- package/dist/rhf-radio-group/index.mjs.map +1 -0
- package/dist/{rhf/rhf-select.mjs → rhf-select/index.mjs} +2 -2
- package/dist/rhf-select/index.mjs.map +1 -0
- package/dist/{rhf/rhf-switch.mjs → rhf-switch/index.mjs} +2 -2
- package/dist/rhf-switch/index.mjs.map +1 -0
- package/dist/{rhf/rhf-textarea.mjs → rhf-textarea/index.mjs} +2 -2
- package/dist/rhf-textarea/index.mjs.map +1 -0
- package/dist/{atoms/separator.mjs → separator/index.mjs} +2 -2
- package/dist/separator/index.mjs.map +1 -0
- package/dist/{atoms/sheet.d.mts → sheet/index.d.mts} +2 -2
- package/dist/{atoms/sheet.mjs → sheet/index.mjs} +2 -2
- package/dist/{atoms/sheet.mjs.map → sheet/index.mjs.map} +1 -1
- package/dist/{organisms/sidebar.d.mts → sidebar/index.d.mts} +4 -4
- package/dist/{organisms/sidebar.mjs → sidebar/index.mjs} +2 -2
- package/dist/sidebar/index.mjs.map +1 -0
- package/dist/skeleton/index.d.mts +17 -0
- package/dist/skeleton/index.mjs +2 -0
- package/dist/skeleton/index.mjs.map +1 -0
- package/dist/{atoms/stack.mjs → stack/index.mjs} +2 -2
- package/dist/{atoms/stack.mjs.map → stack/index.mjs.map} +1 -1
- package/dist/{atoms/switch.mjs → switch/index.mjs} +2 -2
- package/dist/switch/index.mjs.map +1 -0
- package/dist/{atoms/table.mjs → table/index.mjs} +2 -2
- package/dist/{atoms/table.mjs.map → table/index.mjs.map} +1 -1
- package/dist/tabs/index.d.mts +97 -0
- package/dist/tabs/index.mjs +2 -0
- package/dist/tabs/index.mjs.map +1 -0
- package/dist/{atoms/text-field.d.mts → text-field/index.d.mts} +2 -2
- package/dist/{atoms/text-field.mjs → text-field/index.mjs} +2 -2
- package/dist/text-field/index.mjs.map +1 -0
- package/dist/textarea/index.d.mts +24 -0
- package/dist/{atoms/textarea.mjs → textarea/index.mjs} +2 -2
- package/dist/textarea/index.mjs.map +1 -0
- package/dist/{atoms/toast.d.mts → toast/index.d.mts} +2 -2
- package/dist/{atoms/toast.mjs → toast/index.mjs} +2 -2
- package/dist/{atoms/toast.mjs.map → toast/index.mjs.map} +1 -1
- package/dist/{atoms/toaster.mjs → toaster/index.mjs} +2 -2
- package/dist/toaster/index.mjs.map +1 -0
- package/dist/{atoms/tooltip.mjs → tooltip/index.mjs} +2 -2
- package/dist/tooltip/index.mjs.map +1 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.mjs +2 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/{atoms/typography.d.mts → typography/index.d.mts} +2 -2
- package/dist/{atoms/typography.mjs → typography/index.mjs} +2 -2
- package/dist/typography/index.mjs.map +1 -0
- package/dist/utils/index.d.mts +5 -0
- package/dist/{utils.mjs → utils/index.mjs} +2 -2
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +196 -257
- package/dist/atoms/accordion.d.ts +0 -94
- package/dist/atoms/accordion.js +0 -2
- package/dist/atoms/accordion.js.map +0 -1
- package/dist/atoms/accordion.mjs.map +0 -1
- package/dist/atoms/avatar.d.ts +0 -34
- package/dist/atoms/avatar.js +0 -2
- package/dist/atoms/avatar.js.map +0 -1
- package/dist/atoms/avatar.mjs.map +0 -1
- package/dist/atoms/badge.d.ts +0 -40
- package/dist/atoms/badge.js +0 -2
- package/dist/atoms/badge.js.map +0 -1
- package/dist/atoms/box.d.ts +0 -50
- package/dist/atoms/box.js +0 -2
- package/dist/atoms/box.js.map +0 -1
- package/dist/atoms/box.mjs.map +0 -1
- package/dist/atoms/breadcrumb.d.ts +0 -35
- package/dist/atoms/breadcrumb.js +0 -2
- package/dist/atoms/breadcrumb.js.map +0 -1
- package/dist/atoms/breadcrumb.mjs.map +0 -1
- package/dist/atoms/button.d.ts +0 -82
- package/dist/atoms/button.js +0 -2
- package/dist/atoms/button.js.map +0 -1
- package/dist/atoms/button.mjs.map +0 -1
- package/dist/atoms/checkbox.d.ts +0 -21
- package/dist/atoms/checkbox.js +0 -2
- package/dist/atoms/checkbox.js.map +0 -1
- package/dist/atoms/checkbox.mjs.map +0 -1
- package/dist/atoms/collapsible.d.ts +0 -26
- package/dist/atoms/collapsible.js +0 -2
- package/dist/atoms/collapsible.js.map +0 -1
- package/dist/atoms/collapsible.mjs.map +0 -1
- package/dist/atoms/command.d.ts +0 -122
- package/dist/atoms/command.js +0 -2
- package/dist/atoms/command.js.map +0 -1
- package/dist/atoms/command.mjs.map +0 -1
- package/dist/atoms/container.js +0 -2
- package/dist/atoms/container.js.map +0 -1
- package/dist/atoms/container.mjs.map +0 -1
- package/dist/atoms/dialog.d.ts +0 -35
- package/dist/atoms/dialog.js +0 -2
- package/dist/atoms/dialog.js.map +0 -1
- package/dist/atoms/dialog.mjs.map +0 -1
- package/dist/atoms/input.d.ts +0 -12
- package/dist/atoms/input.js +0 -2
- package/dist/atoms/input.js.map +0 -1
- package/dist/atoms/label.d.ts +0 -18
- package/dist/atoms/label.js +0 -2
- package/dist/atoms/label.js.map +0 -1
- package/dist/atoms/page-loader.d.ts +0 -29
- package/dist/atoms/page-loader.js +0 -2
- package/dist/atoms/page-loader.js.map +0 -1
- package/dist/atoms/page-loader.mjs.map +0 -1
- package/dist/atoms/pagination.d.ts +0 -105
- package/dist/atoms/pagination.js +0 -2
- package/dist/atoms/pagination.js.map +0 -1
- package/dist/atoms/pagination.mjs.map +0 -1
- package/dist/atoms/popover.d.ts +0 -30
- package/dist/atoms/popover.js +0 -2
- package/dist/atoms/popover.js.map +0 -1
- package/dist/atoms/popover.mjs.map +0 -1
- package/dist/atoms/radio-group.d.ts +0 -62
- package/dist/atoms/radio-group.js +0 -2
- package/dist/atoms/radio-group.js.map +0 -1
- package/dist/atoms/radio-group.mjs.map +0 -1
- package/dist/atoms/resizable.d.ts +0 -53
- package/dist/atoms/resizable.js +0 -2
- package/dist/atoms/resizable.js.map +0 -1
- package/dist/atoms/resizable.mjs.map +0 -1
- package/dist/atoms/separator.d.ts +0 -13
- package/dist/atoms/separator.js +0 -2
- package/dist/atoms/separator.js.map +0 -1
- package/dist/atoms/separator.mjs.map +0 -1
- package/dist/atoms/sheet.d.ts +0 -42
- package/dist/atoms/sheet.js +0 -2
- package/dist/atoms/sheet.js.map +0 -1
- package/dist/atoms/skeleton.js +0 -2
- package/dist/atoms/skeleton.js.map +0 -1
- package/dist/atoms/skeleton.mjs +0 -2
- package/dist/atoms/skeleton.mjs.map +0 -1
- package/dist/atoms/stack.d.ts +0 -121
- package/dist/atoms/stack.js +0 -2
- package/dist/atoms/stack.js.map +0 -1
- package/dist/atoms/switch.d.ts +0 -21
- package/dist/atoms/switch.js +0 -2
- package/dist/atoms/switch.js.map +0 -1
- package/dist/atoms/switch.mjs.map +0 -1
- package/dist/atoms/table.d.ts +0 -53
- package/dist/atoms/table.js +0 -2
- package/dist/atoms/table.js.map +0 -1
- package/dist/atoms/text-field.d.ts +0 -65
- package/dist/atoms/text-field.js +0 -2
- package/dist/atoms/text-field.js.map +0 -1
- package/dist/atoms/text-field.mjs.map +0 -1
- package/dist/atoms/textarea.js +0 -2
- package/dist/atoms/textarea.js.map +0 -1
- package/dist/atoms/textarea.mjs.map +0 -1
- package/dist/atoms/toast.d.ts +0 -18
- package/dist/atoms/toast.js +0 -2
- package/dist/atoms/toast.js.map +0 -1
- package/dist/atoms/toaster.d.ts +0 -26
- package/dist/atoms/toaster.js +0 -2
- package/dist/atoms/toaster.js.map +0 -1
- package/dist/atoms/toaster.mjs.map +0 -1
- package/dist/atoms/tooltip.d.ts +0 -25
- package/dist/atoms/tooltip.js +0 -2
- package/dist/atoms/tooltip.js.map +0 -1
- package/dist/atoms/tooltip.mjs.map +0 -1
- package/dist/atoms/typography.d.ts +0 -24
- package/dist/atoms/typography.js +0 -2
- package/dist/atoms/typography.js.map +0 -1
- package/dist/atoms/typography.mjs.map +0 -1
- package/dist/atoms.d.mts +0 -1237
- package/dist/atoms.d.ts +0 -1237
- package/dist/atoms.js +0 -2
- package/dist/atoms.js.map +0 -1
- package/dist/atoms.mjs +0 -2
- package/dist/atoms.mjs.map +0 -1
- package/dist/hooks.d.ts +0 -57
- package/dist/hooks.js +0 -2
- package/dist/hooks.mjs.map +0 -1
- package/dist/index.d.ts +0 -2619
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/molecules/card.d.mts +0 -72
- package/dist/molecules/card.d.ts +0 -72
- package/dist/molecules/card.js +0 -2
- package/dist/molecules/card.js.map +0 -1
- package/dist/molecules/card.mjs +0 -2
- package/dist/molecules/card.mjs.map +0 -1
- package/dist/molecules/navigation-menu.d.ts +0 -103
- package/dist/molecules/navigation-menu.js +0 -2
- package/dist/molecules/navigation-menu.js.map +0 -1
- package/dist/molecules/navigation-menu.mjs.map +0 -1
- package/dist/molecules/tabs.d.mts +0 -32
- package/dist/molecules/tabs.d.ts +0 -32
- package/dist/molecules/tabs.js +0 -2
- package/dist/molecules/tabs.js.map +0 -1
- package/dist/molecules/tabs.mjs +0 -2
- package/dist/molecules/tabs.mjs.map +0 -1
- package/dist/molecules.d.mts +0 -201
- package/dist/molecules.d.ts +0 -201
- package/dist/molecules.js +0 -2
- package/dist/molecules.js.map +0 -1
- package/dist/molecules.mjs +0 -2
- package/dist/molecules.mjs.map +0 -1
- package/dist/organisms/drawer.d.ts +0 -63
- package/dist/organisms/drawer.js +0 -2
- package/dist/organisms/drawer.js.map +0 -1
- package/dist/organisms/drawer.mjs.map +0 -1
- package/dist/organisms/dropdown-menu.d.ts +0 -335
- package/dist/organisms/dropdown-menu.js +0 -2
- package/dist/organisms/dropdown-menu.js.map +0 -1
- package/dist/organisms/dropdown-menu.mjs.map +0 -1
- package/dist/organisms/sidebar.d.ts +0 -328
- package/dist/organisms/sidebar.js +0 -2
- package/dist/organisms/sidebar.js.map +0 -1
- package/dist/organisms/sidebar.mjs.map +0 -1
- package/dist/organisms.d.mts +0 -717
- package/dist/organisms.d.ts +0 -717
- package/dist/organisms.js +0 -2
- package/dist/organisms.js.map +0 -1
- package/dist/organisms.mjs +0 -2
- package/dist/organisms.mjs.map +0 -1
- package/dist/rhf/form.d.ts +0 -96
- package/dist/rhf/form.js +0 -2
- package/dist/rhf/form.js.map +0 -1
- package/dist/rhf/form.mjs.map +0 -1
- package/dist/rhf/rhf-checkbox.d.ts +0 -57
- package/dist/rhf/rhf-checkbox.js +0 -2
- package/dist/rhf/rhf-checkbox.js.map +0 -1
- package/dist/rhf/rhf-checkbox.mjs.map +0 -1
- package/dist/rhf/rhf-multi-select.d.ts +0 -84
- package/dist/rhf/rhf-multi-select.js +0 -2
- package/dist/rhf/rhf-multi-select.js.map +0 -1
- package/dist/rhf/rhf-multi-select.mjs.map +0 -1
- package/dist/rhf/rhf-radio-button-group.d.ts +0 -73
- package/dist/rhf/rhf-radio-button-group.js +0 -2
- package/dist/rhf/rhf-radio-button-group.js.map +0 -1
- package/dist/rhf/rhf-radio-button-group.mjs.map +0 -1
- package/dist/rhf/rhf-radio-group.d.ts +0 -103
- package/dist/rhf/rhf-radio-group.js +0 -2
- package/dist/rhf/rhf-radio-group.js.map +0 -1
- package/dist/rhf/rhf-radio-group.mjs.map +0 -1
- package/dist/rhf/rhf-select.d.ts +0 -80
- package/dist/rhf/rhf-select.js +0 -2
- package/dist/rhf/rhf-select.js.map +0 -1
- package/dist/rhf/rhf-select.mjs.map +0 -1
- package/dist/rhf/rhf-switch.d.ts +0 -57
- package/dist/rhf/rhf-switch.js +0 -2
- package/dist/rhf/rhf-switch.js.map +0 -1
- package/dist/rhf/rhf-switch.mjs.map +0 -1
- package/dist/rhf/rhf-textarea.d.ts +0 -66
- package/dist/rhf/rhf-textarea.js +0 -2
- package/dist/rhf/rhf-textarea.js.map +0 -1
- package/dist/rhf/rhf-textarea.mjs.map +0 -1
- package/dist/rhf.d.mts +0 -614
- package/dist/rhf.d.ts +0 -614
- package/dist/rhf.js +0 -2
- package/dist/rhf.js.map +0 -1
- package/dist/rhf.mjs +0 -2
- package/dist/rhf.mjs.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/types.mjs +0 -2
- package/dist/types.mjs.map +0 -1
- package/dist/utils.js +0 -2
- package/dist/utils.js.map +0 -1
- package/dist/utils.mjs.map +0 -1
- /package/dist/{atoms/accordion.d.mts → accordion/index.d.mts} +0 -0
- /package/dist/{atoms/avatar.d.mts → avatar/index.d.mts} +0 -0
- /package/dist/{atoms/box.d.mts → box/index.d.mts} +0 -0
- /package/dist/{atoms/breadcrumb.d.mts → breadcrumb/index.d.mts} +0 -0
- /package/dist/{atoms/checkbox.d.mts → checkbox/index.d.mts} +0 -0
- /package/dist/{atoms/collapsible.d.mts → collapsible/index.d.mts} +0 -0
- /package/dist/{atoms/command.d.mts → command/index.d.mts} +0 -0
- /package/dist/{atoms/dialog.d.mts → dialog/index.d.mts} +0 -0
- /package/dist/{organisms/drawer.d.mts → drawer/index.d.mts} +0 -0
- /package/dist/{rhf/form.d.mts → form/index.d.mts} +0 -0
- /package/dist/{atoms/input.d.mts → input/index.d.mts} +0 -0
- /package/dist/{atoms/popover.d.mts → popover/index.d.mts} +0 -0
- /package/dist/{atoms/resizable.d.mts → resizable/index.d.mts} +0 -0
- /package/dist/{rhf/rhf-checkbox.d.mts → rhf-checkbox/index.d.mts} +0 -0
- /package/dist/{rhf/rhf-multi-select.d.mts → rhf-multi-select/index.d.mts} +0 -0
- /package/dist/{rhf/rhf-radio-button-group.d.mts → rhf-radio-button-group/index.d.mts} +0 -0
- /package/dist/{rhf/rhf-radio-group.d.mts → rhf-radio-group/index.d.mts} +0 -0
- /package/dist/{rhf/rhf-select.d.mts → rhf-select/index.d.mts} +0 -0
- /package/dist/{rhf/rhf-switch.d.mts → rhf-switch/index.d.mts} +0 -0
- /package/dist/{rhf/rhf-textarea.d.mts → rhf-textarea/index.d.mts} +0 -0
- /package/dist/{atoms/separator.d.mts → separator/index.d.mts} +0 -0
- /package/dist/{atoms/stack.d.mts → stack/index.d.mts} +0 -0
- /package/dist/{atoms/switch.d.mts → switch/index.d.mts} +0 -0
- /package/dist/{atoms/table.d.mts → table/index.d.mts} +0 -0
- /package/dist/{atoms/toaster.d.mts → toaster/index.d.mts} +0 -0
- /package/dist/{atoms/tooltip.d.mts → tooltip/index.d.mts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/textarea/textarea.tsx","../../src/components/atoms/label/label.tsx","../../src/components/rhf/form/form.tsx","../../src/components/rhf/rhf-textarea/rhf-textarea.tsx"],"names":["cn","inputs","twMerge","clsx","Textarea","c","className","autoResize","props","ref","internalRef","textarea","resizeTextarea","jsx","labelVariants","cva","Label","V","FormFieldContext","FormField","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","FormLabel","error","formItemId","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body","RHFTextarea","name","label","description","warningText","required","disabled","readOnly","placeholder","ariaLabel","ariaDescribedby","onBlur","other","control","field","jsxs","e"],"mappings":"iTAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCUA,IAAMG,CAAAA,CAAiBC,CACrB,CAAA,UAAA,CAAA,CAAC,CAAE,SAAAC,CAAAA,CAAAA,CAAW,WAAAC,CAAa,CAAA,KAAA,CAAO,GAAGC,CAAM,CAAA,CAAGC,CAAQ,GAAA,CACpD,IAAMC,CAAoB,CAAAL,CAAA,CAAA,MAAA,CAA4B,IAAI,CAE1D,CAAA,OAAMA,YAAU,IAAM,CACpB,GAAI,CAACE,GAAc,CAACG,CAAAA,CAAY,QAAS,OAEzC,IAAMC,EAAWD,CAAY,CAAA,OAAA,CACvB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AAwB,CAAA,QAAA,CAAA,GAAA,CAAC,GACxD,CAEFA,CAAAA,GAAAA,CAACqB,EAAA,CACC,QAAA,CAAArB,GAACT,CAAAA,CAAAA,CAAA,CACE,GAAGoD,CAAAA,CACJ,MAAOA,CAAM,CAAA,KAAA,CACb,SAAWE,CAAM,EAAA,CACfF,CAAM,CAAA,QAAA,CAASE,EAAE,MAAO,CAAA,KAAK,EAC/B,CACA,CAAA,MAAA,CAASA,GAAM,CAET,OAAOF,CAAM,CAAA,KAAA,EAAU,UACzBA,CAAM,CAAA,QAAA,CAASA,EAAM,KAAM,CAAA,IAAA,EAAM,CAEnCA,CAAAA,CAAAA,CAAM,MAAO,EAAA,CACbH,IAASK,CAAC,EACZ,EACA,SAAW1D,CAAAA,CAAAA,CACTgC,GAAS,mDACT1B,CAAAA,CACF,CACA,CAAA,QAAA,CAAU0C,EACV,QAAUC,CAAAA,CAAAA,CACV,SAAUF,CACV,CAAA,WAAA,CAAaG,EACb,YAAYC,CAAAA,CAAAA,CACZ,kBAAkBC,CAAAA,CAAAA,CAClB,eAAc,CAAC,CAACpB,EAChB,eAAee,CAAAA,CAAAA,CACf,WAAYxC,CACX,CAAA,GAAG+C,CACN,CAAA,CAAA,CACF,EACCT,CAAehC,EAAAA,GAAAA,CAACyB,EAAA,CAAiB,QAAA,CAAAO,EAAY,CAC7Cb,CAAAA,CAAAA,EAASnB,GAAC0B,CAAAA,CAAAA,CAAA,CAAa,QAAAP,CAAAA,CAAAA,CAAM,QAAQ,CACrC,CAAA,CAACA,GAASc,CACTjC,EAAAA,GAAAA,CAAC,GAAE,CAAA,CAAA,SAAA,CAAU,+CAA+C,IAAK,CAAA,OAAA,CAC9D,SAAAiC,CACH,CAAA,CAAA,CAAA,CAEJ,EAEJ,CAEJ","file":"rhf-textarea.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport { cn } from \"@/utils/index\"\nimport { TextareaProps } from \"./textarea.types\"\n\n/**\n * Textarea component for creating accessible text areas.\n * Built on top of shadcn/ui's Textarea component.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-textarea--docs\n *\n * @example\n * ```tsx\n * <Textarea placeholder=\"Enter text\" />\n * ```\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, autoResize = false, ...props }, ref) => {\n const internalRef = React.useRef<HTMLTextAreaElement>(null)\n\n React.useEffect(() => {\n if (!autoResize || !internalRef.current) return\n\n const textarea = internalRef.current\n const resizeTextarea = () => {\n textarea.style.height = \"auto\"\n textarea.style.height = `${textarea.scrollHeight}px`\n }\n\n textarea.addEventListener(\"input\", resizeTextarea)\n resizeTextarea() // Initial resize\n\n return () => textarea.removeEventListener(\"input\", resizeTextarea)\n }, [autoResize])\n\n return (\n <textarea\n className={cn(\n \"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nTextarea.displayName = \"Textarea\"\n\nexport { Textarea }\n","import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/index\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nexport interface LabelProps\n extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,\n VariantProps<typeof labelVariants> {}\n\n/**\n * Label component for creating accessible labels.\n * Built on top of Radix UI's Label primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-label--docs\n *\n */\nconst Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n )\n)\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues\n} from \"react-hook-form\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Label } from \"@/components/atoms/label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n }\n)\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Textarea } from \"@/components/atoms/textarea\"\nimport { cn } from \"@/utils/cn\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFTextareaProps } from \"./rhf-textarea.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A textarea component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFTextarea name=\"description\" label=\"Description\" />\n * </Form>\n * ```\n */\nexport function RHFTextarea<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n warningText,\n required,\n disabled,\n readOnly,\n placeholder,\n autoResize,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n onBlur,\n ...other\n}: RHFTextareaProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem>\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <Textarea\n {...field}\n value={field.value}\n onChange={(e) => {\n field.onChange(e.target.value)\n }}\n onBlur={(e) => {\n // trim if a string\n if (typeof field.value === \"string\") {\n field.onChange(field.value.trim())\n }\n field.onBlur() // pass to react-hook-form\n onBlur?.(e) // pass to wrapper\n }}\n className={cn(\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n autoResize={autoResize}\n {...other}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </FormItem>\n )}\n />\n )\n}\n"]}
|
package/dist/rhf.d.mts
DELETED
|
@@ -1,614 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as react_hook_form from 'react-hook-form';
|
|
3
|
-
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { TextareaHTMLAttributes } from 'react';
|
|
6
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
7
|
-
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
8
|
-
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
9
|
-
import * as _radix_ui_react_slot from '@radix-ui/react-slot';
|
|
10
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
11
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Input component for creating accessible input fields.
|
|
15
|
-
* Built on top of shadcn/ui's Input component.
|
|
16
|
-
*
|
|
17
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-input--docs
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
21
|
-
|
|
22
|
-
interface RHFTextFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Input>, "name"> {
|
|
23
|
-
/** The name of the field in the form */
|
|
24
|
-
name: TName;
|
|
25
|
-
/** Optional label for the field */
|
|
26
|
-
label?: string;
|
|
27
|
-
/** Optional description text below the field */
|
|
28
|
-
description?: string;
|
|
29
|
-
/** Optional warning text to display */
|
|
30
|
-
warningText?: string;
|
|
31
|
-
/** Whether the field is required */
|
|
32
|
-
required?: boolean;
|
|
33
|
-
/** Whether the field is disabled */
|
|
34
|
-
disabled?: boolean;
|
|
35
|
-
/** Whether the field is read-only */
|
|
36
|
-
readOnly?: boolean;
|
|
37
|
-
/** The type of input (text, number, email, etc.) */
|
|
38
|
-
type?: React.HTMLInputTypeAttribute;
|
|
39
|
-
/** Optional placeholder text */
|
|
40
|
-
placeholder?: string;
|
|
41
|
-
/** Optional aria-label for accessibility */
|
|
42
|
-
"aria-label"?: string;
|
|
43
|
-
/** Optional aria-describedby for accessibility */
|
|
44
|
-
"aria-describedby"?: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* A text field component that integrates with React Hook Form.
|
|
49
|
-
* Provides form validation, error handling, and accessibility features.
|
|
50
|
-
*
|
|
51
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextfield--docs
|
|
52
|
-
*
|
|
53
|
-
* * @example
|
|
54
|
-
* ```tsx
|
|
55
|
-
* <Form>
|
|
56
|
-
* <RHFTextField name="name" label="Name" />
|
|
57
|
-
* <RHFTextField name="email" label="Email" />
|
|
58
|
-
* </Form>
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
declare function RHFTextField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, type, warningText, required, disabled, readOnly, placeholder, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextFieldProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
62
|
-
|
|
63
|
-
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
64
|
-
/**
|
|
65
|
-
* Whether the textarea should automatically resize
|
|
66
|
-
*/
|
|
67
|
-
autoResize?: boolean;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Textarea component for creating accessible text areas.
|
|
72
|
-
* Built on top of shadcn/ui's Textarea component.
|
|
73
|
-
*
|
|
74
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-textarea--docs
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```tsx
|
|
78
|
-
* <Textarea placeholder="Enter text" />
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
82
|
-
|
|
83
|
-
interface RHFTextareaProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Textarea>, "name"> {
|
|
84
|
-
/** The name of the field in the form */
|
|
85
|
-
name: TName;
|
|
86
|
-
/** Optional label for the field */
|
|
87
|
-
label?: string;
|
|
88
|
-
/** Optional description text below the field */
|
|
89
|
-
description?: string;
|
|
90
|
-
/** Optional warning text to display */
|
|
91
|
-
warningText?: string;
|
|
92
|
-
/** Whether the field is required */
|
|
93
|
-
required?: boolean;
|
|
94
|
-
/** Whether the field is disabled */
|
|
95
|
-
disabled?: boolean;
|
|
96
|
-
/** Whether the field is read-only */
|
|
97
|
-
readOnly?: boolean;
|
|
98
|
-
/** Optional placeholder text */
|
|
99
|
-
placeholder?: string;
|
|
100
|
-
/** Optional aria-label for accessibility */
|
|
101
|
-
"aria-label"?: string;
|
|
102
|
-
/** Optional aria-describedby for accessibility */
|
|
103
|
-
"aria-describedby"?: string;
|
|
104
|
-
/** Whether the textarea should automatically resize */
|
|
105
|
-
autoResize?: boolean;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* A textarea component that integrates with React Hook Form.
|
|
110
|
-
* Provides form validation, error handling, and accessibility features.
|
|
111
|
-
*
|
|
112
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs
|
|
113
|
-
*
|
|
114
|
-
* @example
|
|
115
|
-
* ```tsx
|
|
116
|
-
* <Form>
|
|
117
|
-
* <RHFTextarea name="description" label="Description" />
|
|
118
|
-
* </Form>
|
|
119
|
-
* ```
|
|
120
|
-
*/
|
|
121
|
-
declare function RHFTextarea<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, placeholder, autoResize, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextareaProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Checkbox component built on top of Radix UI's Checkbox primitive.
|
|
125
|
-
* Provides a customizable checkbox input with proper accessibility and keyboard navigation.
|
|
126
|
-
*
|
|
127
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-checkbox--docs
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* ```tsx
|
|
131
|
-
* <Checkbox id="terms" name="terms" />
|
|
132
|
-
* <label htmlFor="terms">Accept terms and conditions</label>
|
|
133
|
-
* ```
|
|
134
|
-
*/
|
|
135
|
-
|
|
136
|
-
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
137
|
-
|
|
138
|
-
interface RHFCheckboxProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Checkbox>, "name"> {
|
|
139
|
-
/** The name of the field in the form */
|
|
140
|
-
name: TName;
|
|
141
|
-
/** Optional label for the field */
|
|
142
|
-
label?: string;
|
|
143
|
-
/** Optional description text below the field */
|
|
144
|
-
description?: string;
|
|
145
|
-
/** Optional warning text to display */
|
|
146
|
-
warningText?: string;
|
|
147
|
-
/** Whether the field is required */
|
|
148
|
-
required?: boolean;
|
|
149
|
-
/** Whether the field is disabled */
|
|
150
|
-
disabled?: boolean;
|
|
151
|
-
/** Whether the field is read-only */
|
|
152
|
-
readOnly?: boolean;
|
|
153
|
-
/** Optional aria-label for accessibility */
|
|
154
|
-
"aria-label"?: string;
|
|
155
|
-
/** Optional aria-describedby for accessibility */
|
|
156
|
-
"aria-describedby"?: string;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* A checkbox component that integrates with React Hook Form.
|
|
161
|
-
* Provides form validation, error handling, and accessibility features.
|
|
162
|
-
*
|
|
163
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfcheckbox--docs
|
|
164
|
-
*
|
|
165
|
-
* @example
|
|
166
|
-
* ```tsx
|
|
167
|
-
* <Form>
|
|
168
|
-
* <RHFCheckbox name="terms" label="Accept terms and conditions" />
|
|
169
|
-
* </Form>
|
|
170
|
-
* ```
|
|
171
|
-
*/
|
|
172
|
-
declare function RHFCheckbox<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, ...other }: RHFCheckboxProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Switch component that provides a toggle input control.
|
|
176
|
-
* Built on top of Radix UI's Switch primitive.
|
|
177
|
-
*
|
|
178
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-switch--docs
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
* ```tsx
|
|
182
|
-
* <Switch />
|
|
183
|
-
* <Switch defaultChecked />
|
|
184
|
-
* <Switch disabled />
|
|
185
|
-
* ```
|
|
186
|
-
*/
|
|
187
|
-
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
188
|
-
|
|
189
|
-
interface RHFSwitchProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Switch>, "name"> {
|
|
190
|
-
/** The name of the field in the form */
|
|
191
|
-
name: TName;
|
|
192
|
-
/** Optional label for the field */
|
|
193
|
-
label?: string;
|
|
194
|
-
/** Optional description text below the field */
|
|
195
|
-
description?: string;
|
|
196
|
-
/** Optional warning text to display */
|
|
197
|
-
warningText?: string;
|
|
198
|
-
/** Whether the field is required */
|
|
199
|
-
required?: boolean;
|
|
200
|
-
/** Whether the field is disabled */
|
|
201
|
-
disabled?: boolean;
|
|
202
|
-
/** Whether the field is read-only */
|
|
203
|
-
readOnly?: boolean;
|
|
204
|
-
/** Optional aria-label for accessibility */
|
|
205
|
-
"aria-label"?: string;
|
|
206
|
-
/** Optional aria-describedby for accessibility */
|
|
207
|
-
"aria-describedby"?: string;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* A switch component that integrates with React Hook Form.
|
|
212
|
-
* Provides form validation, error handling, and accessibility features.
|
|
213
|
-
*
|
|
214
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfswitch--docs
|
|
215
|
-
*
|
|
216
|
-
* @example
|
|
217
|
-
* ```tsx
|
|
218
|
-
* <Form>
|
|
219
|
-
* <RHFSwitch name="notifications" label="Enable notifications" />
|
|
220
|
-
* </Form>
|
|
221
|
-
* ```
|
|
222
|
-
*/
|
|
223
|
-
declare function RHFSwitch<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, ...other }: RHFSwitchProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* RadioGroup component that allows users to select a single option from a list.
|
|
227
|
-
* Built on top of Radix UI's RadioGroup primitive.
|
|
228
|
-
*
|
|
229
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-radio-group--docs
|
|
230
|
-
*
|
|
231
|
-
* @example
|
|
232
|
-
* ```tsx
|
|
233
|
-
* <RadioGroup defaultValue="option-1">
|
|
234
|
-
* <RadioGroupItem value="option-1">Option 1</RadioGroupItem>
|
|
235
|
-
* <RadioGroupItem value="option-2">Option 2</RadioGroupItem>
|
|
236
|
-
* </RadioGroup>
|
|
237
|
-
* ```
|
|
238
|
-
*/
|
|
239
|
-
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
240
|
-
|
|
241
|
-
interface RHFRadioGroupOption {
|
|
242
|
-
label: string;
|
|
243
|
-
id: string;
|
|
244
|
-
}
|
|
245
|
-
interface RHFRadioGroupWithChildrenProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof RadioGroup>, "name"> {
|
|
246
|
-
/** The name of the field in the form */
|
|
247
|
-
name: TName;
|
|
248
|
-
/** Optional label for the field */
|
|
249
|
-
label?: string;
|
|
250
|
-
/** Optional description text below the field */
|
|
251
|
-
description?: string;
|
|
252
|
-
/** Optional warning text to display */
|
|
253
|
-
warningText?: string;
|
|
254
|
-
/** Whether the field is required */
|
|
255
|
-
required?: boolean;
|
|
256
|
-
/** Whether the field is disabled */
|
|
257
|
-
disabled?: boolean;
|
|
258
|
-
/** Whether the field is read-only */
|
|
259
|
-
readOnly?: boolean;
|
|
260
|
-
/** Optional aria-label for accessibility */
|
|
261
|
-
"aria-label"?: string;
|
|
262
|
-
/** Optional aria-describedby for accessibility */
|
|
263
|
-
"aria-describedby"?: string;
|
|
264
|
-
/** Children must be RadioGroupItem components */
|
|
265
|
-
children: React.ReactNode;
|
|
266
|
-
}
|
|
267
|
-
interface RHFRadioGroupWithOptionsProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof RadioGroup>, "name"> {
|
|
268
|
-
/** The name of the field in the form */
|
|
269
|
-
name: TName;
|
|
270
|
-
/** Optional label for the field */
|
|
271
|
-
label?: string;
|
|
272
|
-
/** radio group options */
|
|
273
|
-
options: RHFRadioGroupOption[];
|
|
274
|
-
/** Optional description text below the field */
|
|
275
|
-
description?: string;
|
|
276
|
-
/** Optional warning text to display */
|
|
277
|
-
warningText?: string;
|
|
278
|
-
/** Whether the field is required */
|
|
279
|
-
required?: boolean;
|
|
280
|
-
/** Whether the field is disabled */
|
|
281
|
-
disabled?: boolean;
|
|
282
|
-
/** Whether the field is read-only */
|
|
283
|
-
readOnly?: boolean;
|
|
284
|
-
/** Optional aria-label for accessibility */
|
|
285
|
-
"aria-label"?: string;
|
|
286
|
-
/** Optional aria-describedby for accessibility */
|
|
287
|
-
"aria-describedby"?: string;
|
|
288
|
-
}
|
|
289
|
-
type RHFRadioGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = RHFRadioGroupWithChildrenProps<TFieldValues, TName> | RHFRadioGroupWithOptionsProps<TFieldValues, TName>;
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* A radio group component that integrates with React Hook Form.
|
|
293
|
-
* Provides form validation, error handling, and accessibility features.
|
|
294
|
-
*
|
|
295
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfradiogroup--docs
|
|
296
|
-
*
|
|
297
|
-
* @example
|
|
298
|
-
* ```tsx
|
|
299
|
-
* // Using children
|
|
300
|
-
* <Form>
|
|
301
|
-
* <RHFRadioGroup name="preference" label="Select your preference">
|
|
302
|
-
* <RadioGroupItem value="option1" label="Option 1" />
|
|
303
|
-
* <RadioGroupItem value="option2" label="Option 2" />
|
|
304
|
-
* </RHFRadioGroup>
|
|
305
|
-
* </Form>
|
|
306
|
-
*
|
|
307
|
-
* // Using options prop
|
|
308
|
-
* <Form>
|
|
309
|
-
* <RHFRadioGroup
|
|
310
|
-
* name="preference"
|
|
311
|
-
* label="Select your preference"
|
|
312
|
-
* options={[
|
|
313
|
-
* { id: "option1", label: "Option 1" },
|
|
314
|
-
* { id: "option2", label: "Option 2" }
|
|
315
|
-
* ]}
|
|
316
|
-
* />
|
|
317
|
-
* </Form>
|
|
318
|
-
* ```
|
|
319
|
-
*/
|
|
320
|
-
declare function RHFRadioGroup<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, children, ...other }: RHFRadioGroupProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
321
|
-
|
|
322
|
-
interface RHFRadioButtonGroupOption {
|
|
323
|
-
label: string;
|
|
324
|
-
id: string;
|
|
325
|
-
size?: "default" | "sm" | "lg";
|
|
326
|
-
}
|
|
327
|
-
interface RHFRadioButtonGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof RadioGroup>, "name"> {
|
|
328
|
-
/** The name of the field in the form */
|
|
329
|
-
name: TName;
|
|
330
|
-
/** Optional label for the field */
|
|
331
|
-
label?: string;
|
|
332
|
-
/** Optional description text below the field */
|
|
333
|
-
description?: string;
|
|
334
|
-
/** Optional warning text to display */
|
|
335
|
-
warningText?: string;
|
|
336
|
-
/** Whether the field is required */
|
|
337
|
-
required?: boolean;
|
|
338
|
-
/** Whether the field is disabled */
|
|
339
|
-
disabled?: boolean;
|
|
340
|
-
/** Whether the field is read-only */
|
|
341
|
-
readOnly?: boolean;
|
|
342
|
-
/** Optional aria-label for accessibility */
|
|
343
|
-
"aria-label"?: string;
|
|
344
|
-
/** Optional aria-describedby for accessibility */
|
|
345
|
-
"aria-describedby"?: string;
|
|
346
|
-
/** Radio button group options */
|
|
347
|
-
options: RHFRadioButtonGroupOption[];
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* A radio button group component that integrates with React Hook Form.
|
|
352
|
-
* Uses buttons instead of traditional radio inputs for a more modern look.
|
|
353
|
-
*
|
|
354
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfradiobuttongroup--docs
|
|
355
|
-
*
|
|
356
|
-
* @example
|
|
357
|
-
* ```tsx
|
|
358
|
-
* <Form>
|
|
359
|
-
* <RHFRadioButtonGroup
|
|
360
|
-
* name="preference"
|
|
361
|
-
* label="Select your preference"
|
|
362
|
-
* options={[
|
|
363
|
-
* { value: "option1", label: "Option 1" },
|
|
364
|
-
* { value: "option2", label: "Option 2" },
|
|
365
|
-
* { value: "option3", label: "Option 3" }
|
|
366
|
-
* ]}
|
|
367
|
-
* />
|
|
368
|
-
* </Form>
|
|
369
|
-
* ```
|
|
370
|
-
*/
|
|
371
|
-
declare function RHFRadioButtonGroup<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, options, ...other }: RHFRadioButtonGroupProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
372
|
-
|
|
373
|
-
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
374
|
-
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
375
|
-
declare const useFormField: () => {
|
|
376
|
-
invalid: boolean;
|
|
377
|
-
isDirty: boolean;
|
|
378
|
-
isTouched: boolean;
|
|
379
|
-
isValidating: boolean;
|
|
380
|
-
error?: react_hook_form.FieldError;
|
|
381
|
-
id: string;
|
|
382
|
-
name: string;
|
|
383
|
-
formItemId: string;
|
|
384
|
-
formDescriptionId: string;
|
|
385
|
-
formMessageId: string;
|
|
386
|
-
};
|
|
387
|
-
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
388
|
-
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
389
|
-
declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
390
|
-
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
391
|
-
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* Props interface for the Form component.
|
|
395
|
-
* Extends react-hook-form's FormProvider props.
|
|
396
|
-
*/
|
|
397
|
-
interface FormProps<TFieldValues extends FieldValues = FieldValues> {
|
|
398
|
-
/**
|
|
399
|
-
* The form context value
|
|
400
|
-
*/
|
|
401
|
-
context: React.Context<TFieldValues>;
|
|
402
|
-
/**
|
|
403
|
-
* The form children
|
|
404
|
-
*/
|
|
405
|
-
children: React.ReactNode;
|
|
406
|
-
}
|
|
407
|
-
/**
|
|
408
|
-
* Props interface for the FormField component.
|
|
409
|
-
* Extends react-hook-form's Controller props.
|
|
410
|
-
*/
|
|
411
|
-
interface FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends ControllerProps<TFieldValues, TName> {
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Props interface for the FormItem component.
|
|
415
|
-
* Extends HTML div attributes.
|
|
416
|
-
*/
|
|
417
|
-
interface FormItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Props interface for the FormLabel component.
|
|
421
|
-
* Extends Radix UI Label props.
|
|
422
|
-
*/
|
|
423
|
-
interface FormLabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Props interface for the FormControl component.
|
|
427
|
-
* Extends Radix UI Slot props.
|
|
428
|
-
*/
|
|
429
|
-
interface FormControlProps extends React.ComponentPropsWithoutRef<typeof Slot> {
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Props interface for the FormDescription component.
|
|
433
|
-
* Extends HTML paragraph attributes.
|
|
434
|
-
*/
|
|
435
|
-
interface FormDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Props interface for the FormMessage component.
|
|
439
|
-
* Extends HTML paragraph attributes.
|
|
440
|
-
*/
|
|
441
|
-
interface FormMessageProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
442
|
-
/**
|
|
443
|
-
* The message content
|
|
444
|
-
*/
|
|
445
|
-
children?: React.ReactNode;
|
|
446
|
-
}
|
|
447
|
-
/**
|
|
448
|
-
* Context value type for form field context
|
|
449
|
-
*/
|
|
450
|
-
type FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
|
451
|
-
name: TName;
|
|
452
|
-
};
|
|
453
|
-
/**
|
|
454
|
-
* Context value type for form item context
|
|
455
|
-
*/
|
|
456
|
-
type FormItemContextValue = {
|
|
457
|
-
id: string;
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
type SelectOption = {
|
|
461
|
-
id: string;
|
|
462
|
-
label: string;
|
|
463
|
-
startIcon?: React.ReactNode;
|
|
464
|
-
endIcon?: React.ReactNode;
|
|
465
|
-
className?: string;
|
|
466
|
-
disabled?: boolean;
|
|
467
|
-
};
|
|
468
|
-
type SelectProps = {
|
|
469
|
-
/** Whether the select is searchable */
|
|
470
|
-
searchable?: boolean;
|
|
471
|
-
/** Whether the select should take up the full width of its container */
|
|
472
|
-
fullWidth?: boolean;
|
|
473
|
-
/** Currently selected value */
|
|
474
|
-
value: string;
|
|
475
|
-
/** Array of options to display in the select */
|
|
476
|
-
options: SelectOption[];
|
|
477
|
-
/** Callback fired when the value changes */
|
|
478
|
-
onChange: (value: string) => void;
|
|
479
|
-
/** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */
|
|
480
|
-
renderCommandList?: (options: SelectOption[]) => React.ReactNode;
|
|
481
|
-
/** Placeholder text to show when no value is selected */
|
|
482
|
-
placeholder?: string;
|
|
483
|
-
/** Whether the select is disabled */
|
|
484
|
-
disabled?: boolean;
|
|
485
|
-
/** Whether the select is required */
|
|
486
|
-
required?: boolean;
|
|
487
|
-
/** Error message to display */
|
|
488
|
-
error?: string;
|
|
489
|
-
/** Additional class name for the select */
|
|
490
|
-
className?: string;
|
|
491
|
-
/** ID for the select element */
|
|
492
|
-
id?: string;
|
|
493
|
-
};
|
|
494
|
-
|
|
495
|
-
type MultiSelectOption = {
|
|
496
|
-
id: string;
|
|
497
|
-
label: string;
|
|
498
|
-
startIcon?: React.ReactNode;
|
|
499
|
-
endIcon?: React.ReactNode;
|
|
500
|
-
className?: string;
|
|
501
|
-
disabled?: boolean;
|
|
502
|
-
};
|
|
503
|
-
type MultiSelectProps = {
|
|
504
|
-
/** Whether the select is searchable */
|
|
505
|
-
searchable?: boolean;
|
|
506
|
-
/** Whether the select should take up the full width of its container */
|
|
507
|
-
fullWidth?: boolean;
|
|
508
|
-
/** Array of options to display in the select */
|
|
509
|
-
options: MultiSelectOption[];
|
|
510
|
-
/** Currently selected values */
|
|
511
|
-
value: string[];
|
|
512
|
-
/** Callback fired when the values change */
|
|
513
|
-
onChange: (value: string[]) => void;
|
|
514
|
-
/** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */
|
|
515
|
-
renderCommandList?: (options: MultiSelectOption[]) => React.ReactNode;
|
|
516
|
-
/** Placeholder text to show when no value is selected */
|
|
517
|
-
placeholder?: string;
|
|
518
|
-
/** Whether the select is disabled */
|
|
519
|
-
disabled?: boolean;
|
|
520
|
-
/** Whether the select is required */
|
|
521
|
-
required?: boolean;
|
|
522
|
-
/** Error message to display */
|
|
523
|
-
error?: string;
|
|
524
|
-
/** Additional class name for the select */
|
|
525
|
-
className?: string;
|
|
526
|
-
/** ID for the select element */
|
|
527
|
-
id?: string;
|
|
528
|
-
/** Maximum number of selections allowed */
|
|
529
|
-
maxSelections?: number;
|
|
530
|
-
/** Whether to show the select all option */
|
|
531
|
-
showSelectAll?: boolean;
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
interface RHFMultiSelectProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<MultiSelectProps, "name" | "value" | "onChange"> {
|
|
535
|
-
/** The name of the field in the form */
|
|
536
|
-
name: TName;
|
|
537
|
-
/** Optional label for the field */
|
|
538
|
-
label?: string;
|
|
539
|
-
/** Optional description text below the field */
|
|
540
|
-
description?: string;
|
|
541
|
-
/** Optional warning text to display */
|
|
542
|
-
warningText?: string;
|
|
543
|
-
/** Whether the field is read-only */
|
|
544
|
-
readOnly?: boolean;
|
|
545
|
-
/** Optional aria-label for accessibility */
|
|
546
|
-
"aria-label"?: string;
|
|
547
|
-
/** Optional aria-describedby for accessibility */
|
|
548
|
-
"aria-describedby"?: string;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
/**
|
|
552
|
-
* A multi-select component that integrates with React Hook Form.
|
|
553
|
-
* Provides form validation, error handling, and accessibility features.
|
|
554
|
-
*
|
|
555
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfmultiselect--docs
|
|
556
|
-
*
|
|
557
|
-
* @example
|
|
558
|
-
* ```tsx
|
|
559
|
-
* <Form>
|
|
560
|
-
* <RHFMultiSelect
|
|
561
|
-
* name="countries"
|
|
562
|
-
* label="Countries"
|
|
563
|
-
* options={[
|
|
564
|
-
* { id: "us", label: "United States" },
|
|
565
|
-
* { id: "ca", label: "Canada" }
|
|
566
|
-
* ]}
|
|
567
|
-
*
|
|
568
|
-
* />
|
|
569
|
-
* </Form>
|
|
570
|
-
* ```
|
|
571
|
-
*/
|
|
572
|
-
declare function RHFMultiSelect<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, placeholder, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, options, ...other }: RHFMultiSelectProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
573
|
-
|
|
574
|
-
type RHFSelectOption = SelectOption;
|
|
575
|
-
interface RHFSelectProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<SelectProps, "name" | "value" | "onChange"> {
|
|
576
|
-
/** The name of the field in the form */
|
|
577
|
-
name: TName;
|
|
578
|
-
/** Optional label for the field */
|
|
579
|
-
label?: string;
|
|
580
|
-
/** Optional description text below the field */
|
|
581
|
-
description?: string;
|
|
582
|
-
/** Optional warning text to display */
|
|
583
|
-
warningText?: string;
|
|
584
|
-
/** Whether the field is read-only */
|
|
585
|
-
readOnly?: boolean;
|
|
586
|
-
/** Optional aria-label for accessibility */
|
|
587
|
-
"aria-label"?: string;
|
|
588
|
-
/** Optional aria-describedby for accessibility */
|
|
589
|
-
"aria-describedby"?: string;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* A select component that integrates with React Hook Form.
|
|
594
|
-
* Provides form validation, error handling, and accessibility features.
|
|
595
|
-
*
|
|
596
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfselect--docs
|
|
597
|
-
*
|
|
598
|
-
* @example
|
|
599
|
-
* ```tsx
|
|
600
|
-
* <Form>
|
|
601
|
-
* <RHFSelect
|
|
602
|
-
* name="country"
|
|
603
|
-
* label="Country"
|
|
604
|
-
* options={[
|
|
605
|
-
* { id: "us", label: "United States" },
|
|
606
|
-
* { id: "ca", label: "Canada" }
|
|
607
|
-
* ]}
|
|
608
|
-
* />
|
|
609
|
-
* </Form>
|
|
610
|
-
* ```
|
|
611
|
-
*/
|
|
612
|
-
declare function RHFSelect<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, placeholder, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, options, ...other }: RHFSelectProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
613
|
-
|
|
614
|
-
export { Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldContextValue, type FormFieldProps, FormItem, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, RHFCheckbox, RHFMultiSelect, RHFRadioButtonGroup, type RHFRadioButtonGroupOption, type RHFRadioButtonGroupProps, RHFRadioGroup, RHFSelect, type RHFSelectOption, type RHFSelectProps, RHFSwitch, RHFTextField, RHFTextarea, useFormField };
|