@ark-ui/react 3.4.0 → 3.6.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/README.md +3 -0
- package/dist/components/accordion/accordion.anatomy.d.cts +1 -0
- package/dist/components/accordion/accordion.anatomy.d.ts +1 -0
- package/dist/components/accordion/index.cjs +7 -2
- package/dist/components/accordion/index.d.cts +7 -6
- package/dist/components/accordion/index.d.ts +7 -6
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/avatar/avatar.anatomy.d.cts +1 -0
- package/dist/components/avatar/avatar.anatomy.d.ts +1 -0
- package/dist/components/avatar/index.cjs +7 -2
- package/dist/components/avatar/index.d.cts +1 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/carousel/carousel-control.cjs +2 -2
- package/dist/components/carousel/carousel-control.js +1 -1
- package/dist/components/carousel/carousel.anatomy.cjs +10 -0
- package/dist/components/carousel/carousel.anatomy.d.cts +2 -0
- package/dist/components/carousel/carousel.anatomy.d.ts +2 -0
- package/dist/components/carousel/carousel.anatomy.js +6 -0
- package/dist/components/carousel/index.cjs +2 -0
- package/dist/components/carousel/index.d.cts +1 -0
- package/dist/components/carousel/index.d.ts +1 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/checkbox/checkbox-group.cjs +4 -3
- package/dist/components/checkbox/checkbox-group.js +3 -2
- package/dist/components/checkbox/checkbox.anatomy.cjs +10 -0
- package/dist/components/checkbox/checkbox.anatomy.d.cts +2 -0
- package/dist/components/checkbox/checkbox.anatomy.d.ts +2 -0
- package/dist/components/checkbox/checkbox.anatomy.js +6 -0
- package/dist/components/checkbox/index.cjs +2 -0
- package/dist/components/checkbox/index.d.cts +1 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/checkbox/use-checkbox-group.cjs +3 -1
- package/dist/components/checkbox/use-checkbox-group.d.cts +7 -0
- package/dist/components/checkbox/use-checkbox-group.d.ts +7 -0
- package/dist/components/checkbox/use-checkbox-group.js +3 -1
- package/dist/components/clipboard/clipboard.anatomy.d.cts +1 -0
- package/dist/components/clipboard/clipboard.anatomy.d.ts +1 -0
- package/dist/components/clipboard/index.cjs +7 -2
- package/dist/components/clipboard/index.d.cts +1 -0
- package/dist/components/clipboard/index.d.ts +1 -0
- package/dist/components/clipboard/index.js +1 -0
- package/dist/components/collapsible/collapsible.anatomy.d.cts +1 -0
- package/dist/components/collapsible/collapsible.anatomy.d.ts +1 -0
- package/dist/components/collapsible/index.cjs +7 -2
- package/dist/components/collapsible/index.d.cts +1 -0
- package/dist/components/collapsible/index.d.ts +1 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/color-picker/color-picker-value-text.cjs +4 -2
- package/dist/components/color-picker/color-picker-value-text.js +4 -2
- package/dist/components/color-picker/color-picker-view.cjs +2 -2
- package/dist/components/color-picker/color-picker-view.js +1 -1
- package/dist/components/color-picker/color-picker.anatomy.cjs +10 -0
- package/dist/components/color-picker/color-picker.anatomy.d.cts +2 -0
- package/dist/components/color-picker/color-picker.anatomy.d.ts +2 -0
- package/dist/components/color-picker/color-picker.anatomy.js +6 -0
- package/dist/components/color-picker/index.cjs +2 -0
- package/dist/components/color-picker/index.d.cts +1 -0
- package/dist/components/color-picker/index.d.ts +1 -0
- package/dist/components/color-picker/index.js +1 -0
- package/dist/components/combobox/combobox.anatomy.d.cts +1 -0
- package/dist/components/combobox/combobox.anatomy.d.ts +1 -0
- package/dist/components/combobox/index.cjs +7 -2
- package/dist/components/combobox/index.d.cts +1 -0
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/date-picker/date-picker-view.cjs +2 -2
- package/dist/components/date-picker/date-picker-view.js +1 -1
- package/dist/components/date-picker/date-picker.anatomy.cjs +10 -0
- package/dist/components/date-picker/date-picker.anatomy.d.cts +2 -0
- package/dist/components/date-picker/date-picker.anatomy.d.ts +2 -0
- package/dist/components/date-picker/date-picker.anatomy.js +6 -0
- package/dist/components/date-picker/index.cjs +2 -0
- package/dist/components/date-picker/index.d.cts +1 -0
- package/dist/components/date-picker/index.d.ts +1 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/dialog/dialog-root.d.cts +1 -1
- package/dist/components/dialog/dialog-root.d.ts +1 -1
- package/dist/components/dialog/dialog.anatomy.d.cts +1 -0
- package/dist/components/dialog/dialog.anatomy.d.ts +1 -0
- package/dist/components/dialog/index.cjs +7 -2
- package/dist/components/dialog/index.d.cts +1 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/editable/editable.anatomy.d.cts +1 -0
- package/dist/components/editable/editable.anatomy.d.ts +1 -0
- package/dist/components/editable/index.cjs +7 -2
- package/dist/components/editable/index.d.cts +1 -0
- package/dist/components/editable/index.d.ts +1 -0
- package/dist/components/editable/index.js +1 -0
- package/dist/components/field/field.anatomy.cjs +20 -0
- package/dist/components/field/field.anatomy.d.cts +3 -0
- package/dist/components/field/field.anatomy.d.ts +3 -0
- package/dist/components/field/field.anatomy.js +15 -0
- package/dist/components/field/index.cjs +2 -0
- package/dist/components/field/index.d.cts +1 -0
- package/dist/components/field/index.d.ts +1 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/field/use-field.cjs +92 -58
- package/dist/components/field/use-field.d.cts +7 -61
- package/dist/components/field/use-field.d.ts +7 -61
- package/dist/components/field/use-field.js +93 -59
- package/dist/components/fieldset/fieldset-context.cjs +10 -0
- package/dist/components/fieldset/fieldset-context.d.cts +7 -0
- package/dist/components/fieldset/fieldset-context.d.ts +7 -0
- package/dist/components/fieldset/fieldset-context.js +6 -0
- package/dist/components/fieldset/fieldset-error-text.cjs +21 -0
- package/dist/components/fieldset/fieldset-error-text.d.cts +8 -0
- package/dist/components/fieldset/fieldset-error-text.d.ts +8 -0
- package/dist/components/fieldset/fieldset-error-text.js +17 -0
- package/dist/components/fieldset/fieldset-helper-text.cjs +21 -0
- package/dist/components/fieldset/fieldset-helper-text.d.cts +8 -0
- package/dist/components/fieldset/fieldset-helper-text.d.ts +8 -0
- package/dist/components/fieldset/fieldset-helper-text.js +17 -0
- package/dist/components/fieldset/fieldset-legend.cjs +19 -0
- package/dist/components/fieldset/fieldset-legend.d.cts +8 -0
- package/dist/components/fieldset/fieldset-legend.d.ts +8 -0
- package/dist/components/fieldset/fieldset-legend.js +15 -0
- package/dist/components/fieldset/fieldset-root-provider.cjs +24 -0
- package/dist/components/fieldset/fieldset-root-provider.d.cts +13 -0
- package/dist/components/fieldset/fieldset-root-provider.d.ts +13 -0
- package/dist/components/fieldset/fieldset-root-provider.js +20 -0
- package/dist/components/fieldset/fieldset-root.cjs +27 -0
- package/dist/components/fieldset/fieldset-root.d.cts +9 -0
- package/dist/components/fieldset/fieldset-root.d.ts +9 -0
- package/dist/components/fieldset/fieldset-root.js +23 -0
- package/dist/components/fieldset/fieldset.anatomy.cjs +17 -0
- package/dist/components/fieldset/fieldset.anatomy.d.cts +3 -0
- package/dist/components/fieldset/fieldset.anatomy.d.ts +3 -0
- package/dist/components/fieldset/fieldset.anatomy.js +12 -0
- package/dist/components/fieldset/fieldset.cjs +19 -0
- package/dist/components/fieldset/fieldset.d.cts +6 -0
- package/dist/components/fieldset/fieldset.d.ts +6 -0
- package/dist/components/fieldset/fieldset.js +6 -0
- package/dist/components/fieldset/index.cjs +25 -0
- package/dist/components/fieldset/index.d.cts +9 -0
- package/dist/components/fieldset/index.d.ts +9 -0
- package/dist/components/fieldset/index.js +10 -0
- package/dist/components/fieldset/use-fieldset-context.cjs +16 -0
- package/dist/components/fieldset/use-fieldset-context.d.cts +6 -0
- package/dist/components/fieldset/use-fieldset-context.d.ts +6 -0
- package/dist/components/fieldset/use-fieldset-context.js +11 -0
- package/dist/components/fieldset/use-fieldset.cjs +85 -0
- package/dist/components/fieldset/use-fieldset.d.cts +29 -0
- package/dist/components/fieldset/use-fieldset.d.ts +29 -0
- package/dist/components/fieldset/use-fieldset.js +81 -0
- package/dist/components/file-upload/file-upload.anatomy.d.cts +1 -0
- package/dist/components/file-upload/file-upload.anatomy.d.ts +1 -0
- package/dist/components/file-upload/index.cjs +7 -2
- package/dist/components/file-upload/index.d.cts +1 -0
- package/dist/components/file-upload/index.d.ts +1 -0
- package/dist/components/file-upload/index.js +1 -0
- package/dist/components/highlight/highlight.cjs +26 -0
- package/dist/components/highlight/highlight.d.cts +8 -0
- package/dist/components/highlight/highlight.d.ts +8 -0
- package/dist/components/highlight/highlight.js +22 -0
- package/dist/components/highlight/index.cjs +11 -0
- package/dist/components/highlight/index.d.cts +2 -0
- package/dist/components/highlight/index.d.ts +2 -0
- package/dist/components/highlight/index.js +2 -0
- package/dist/components/highlight/use-highlight.cjs +49 -0
- package/dist/components/highlight/use-highlight.d.cts +30 -0
- package/dist/components/highlight/use-highlight.d.ts +30 -0
- package/dist/components/highlight/use-highlight.js +45 -0
- package/dist/components/hover-card/hover-card.anatomy.d.cts +1 -0
- package/dist/components/hover-card/hover-card.anatomy.d.ts +1 -0
- package/dist/components/hover-card/index.cjs +7 -2
- package/dist/components/hover-card/index.d.cts +1 -0
- package/dist/components/hover-card/index.d.ts +1 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/index.cjs +263 -50
- package/dist/components/index.d.cts +3 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +65 -0
- package/dist/components/menu/index.cjs +7 -2
- package/dist/components/menu/index.d.cts +1 -0
- package/dist/components/menu/index.d.ts +1 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/menu/menu.anatomy.d.cts +1 -0
- package/dist/components/menu/menu.anatomy.d.ts +1 -0
- package/dist/components/number-input/index.cjs +9 -2
- package/dist/components/number-input/index.d.cts +10 -8
- package/dist/components/number-input/index.d.ts +10 -8
- package/dist/components/number-input/index.js +2 -0
- package/dist/components/number-input/number-input-value-text.cjs +22 -0
- package/dist/components/number-input/number-input-value-text.d.cts +8 -0
- package/dist/components/number-input/number-input-value-text.d.ts +8 -0
- package/dist/components/number-input/number-input-value-text.js +18 -0
- package/dist/components/number-input/number-input.anatomy.d.cts +1 -0
- package/dist/components/number-input/number-input.anatomy.d.ts +1 -0
- package/dist/components/number-input/number-input.cjs +2 -0
- package/dist/components/number-input/number-input.d.cts +9 -8
- package/dist/components/number-input/number-input.d.ts +9 -8
- package/dist/components/number-input/number-input.js +1 -0
- package/dist/components/pagination/index.cjs +7 -2
- package/dist/components/pagination/index.d.cts +1 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pagination/pagination.anatomy.d.cts +1 -0
- package/dist/components/pagination/pagination.anatomy.d.ts +1 -0
- package/dist/components/pin-input/index.cjs +7 -2
- package/dist/components/pin-input/index.d.cts +1 -0
- package/dist/components/pin-input/index.d.ts +1 -0
- package/dist/components/pin-input/index.js +1 -0
- package/dist/components/pin-input/pin-input.anatomy.d.cts +1 -0
- package/dist/components/pin-input/pin-input.anatomy.d.ts +1 -0
- package/dist/components/popover/index.cjs +7 -2
- package/dist/components/popover/index.d.cts +1 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover/popover.anatomy.d.cts +1 -0
- package/dist/components/popover/popover.anatomy.d.ts +1 -0
- package/dist/components/progress/index.cjs +7 -2
- package/dist/components/progress/index.d.cts +1 -0
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/index.js +1 -0
- package/dist/components/progress/progress.anatomy.d.cts +1 -0
- package/dist/components/progress/progress.anatomy.d.ts +1 -0
- package/dist/components/qr-code/index.cjs +5 -0
- package/dist/components/qr-code/index.d.cts +1 -0
- package/dist/components/qr-code/index.d.ts +1 -0
- package/dist/components/qr-code/index.js +1 -0
- package/dist/components/qr-code/qr-code.anatomy.d.cts +1 -0
- package/dist/components/qr-code/qr-code.anatomy.d.ts +1 -0
- package/dist/components/radio-group/index.cjs +5 -0
- package/dist/components/radio-group/index.d.cts +1 -0
- package/dist/components/radio-group/index.d.ts +1 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/radio-group/radio-group.anatomy.d.cts +1 -0
- package/dist/components/radio-group/radio-group.anatomy.d.ts +1 -0
- package/dist/components/rating-group/index.cjs +5 -0
- package/dist/components/rating-group/index.d.cts +1 -0
- package/dist/components/rating-group/index.d.ts +1 -0
- package/dist/components/rating-group/index.js +1 -0
- package/dist/components/rating-group/rating-group.anatomy.d.cts +1 -0
- package/dist/components/rating-group/rating-group.anatomy.d.ts +1 -0
- package/dist/components/segment-group/index.cjs +2 -0
- package/dist/components/segment-group/index.d.cts +1 -0
- package/dist/components/segment-group/index.d.ts +1 -0
- package/dist/components/segment-group/index.js +1 -0
- package/dist/components/segment-group/segment-group-indicator.cjs +2 -2
- package/dist/components/segment-group/segment-group-indicator.js +2 -2
- package/dist/components/segment-group/segment-group-item-control.cjs +2 -2
- package/dist/components/segment-group/segment-group-item-control.js +2 -2
- package/dist/components/segment-group/segment-group-item-text.cjs +2 -2
- package/dist/components/segment-group/segment-group-item-text.js +2 -2
- package/dist/components/segment-group/segment-group-item.cjs +2 -2
- package/dist/components/segment-group/segment-group-item.js +2 -2
- package/dist/components/segment-group/segment-group-label.cjs +2 -2
- package/dist/components/segment-group/segment-group-label.js +2 -2
- package/dist/components/segment-group/segment-group-root-provider.cjs +2 -2
- package/dist/components/segment-group/segment-group-root-provider.js +2 -2
- package/dist/components/segment-group/segment-group-root.cjs +2 -2
- package/dist/components/segment-group/segment-group-root.js +2 -2
- package/dist/components/segment-group/segment-group.anatomy.cjs +12 -0
- package/dist/components/segment-group/segment-group.anatomy.d.cts +3 -0
- package/dist/components/segment-group/segment-group.anatomy.d.ts +3 -0
- package/dist/components/segment-group/segment-group.anatomy.js +7 -0
- package/dist/components/select/index.cjs +7 -2
- package/dist/components/select/index.d.cts +1 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/select/select-hidden-select.cjs +1 -1
- package/dist/components/select/select-hidden-select.js +1 -1
- package/dist/components/select/select-value-text.cjs +4 -3
- package/dist/components/select/select-value-text.js +4 -3
- package/dist/components/select/select.anatomy.d.cts +1 -0
- package/dist/components/select/select.anatomy.d.ts +1 -0
- package/dist/components/signature-pad/index.cjs +7 -2
- package/dist/components/signature-pad/index.d.cts +1 -0
- package/dist/components/signature-pad/index.d.ts +1 -0
- package/dist/components/signature-pad/index.js +1 -0
- package/dist/components/signature-pad/signature-pad.anatomy.d.cts +1 -0
- package/dist/components/signature-pad/signature-pad.anatomy.d.ts +1 -0
- package/dist/components/slider/index.cjs +7 -2
- package/dist/components/slider/index.d.cts +1 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/slider/slider.anatomy.d.cts +1 -0
- package/dist/components/slider/slider.anatomy.d.ts +1 -0
- package/dist/components/splitter/index.cjs +7 -2
- package/dist/components/splitter/index.d.cts +1 -0
- package/dist/components/splitter/index.d.ts +1 -0
- package/dist/components/splitter/index.js +1 -0
- package/dist/components/splitter/splitter.anatomy.d.cts +1 -0
- package/dist/components/splitter/splitter.anatomy.d.ts +1 -0
- package/dist/components/switch/index.cjs +5 -0
- package/dist/components/switch/index.d.cts +1 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/switch/switch.anatomy.d.cts +1 -0
- package/dist/components/switch/switch.anatomy.d.ts +1 -0
- package/dist/components/tabs/index.cjs +7 -2
- package/dist/components/tabs/index.d.cts +1 -0
- package/dist/components/tabs/index.d.ts +1 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/tabs/tabs.anatomy.d.cts +1 -0
- package/dist/components/tabs/tabs.anatomy.d.ts +1 -0
- package/dist/components/tags-input/index.cjs +7 -2
- package/dist/components/tags-input/index.d.cts +1 -0
- package/dist/components/tags-input/index.d.ts +1 -0
- package/dist/components/tags-input/index.js +1 -0
- package/dist/components/tags-input/tags-input.anatomy.d.cts +1 -0
- package/dist/components/tags-input/tags-input.anatomy.d.ts +1 -0
- package/dist/components/time-picker/index.cjs +39 -0
- package/dist/components/time-picker/index.d.cts +17 -0
- package/dist/components/time-picker/index.d.ts +17 -0
- package/dist/components/time-picker/index.js +17 -0
- package/dist/components/time-picker/time-picker-cell.cjs +29 -0
- package/dist/components/time-picker/time-picker-cell.d.cts +14 -0
- package/dist/components/time-picker/time-picker-cell.d.ts +14 -0
- package/dist/components/time-picker/time-picker-cell.js +25 -0
- package/dist/components/time-picker/time-picker-clear-trigger.cjs +21 -0
- package/dist/components/time-picker/time-picker-clear-trigger.d.cts +8 -0
- package/dist/components/time-picker/time-picker-clear-trigger.d.ts +8 -0
- package/dist/components/time-picker/time-picker-clear-trigger.js +17 -0
- package/dist/components/time-picker/time-picker-column.cjs +22 -0
- package/dist/components/time-picker/time-picker-column.d.cts +9 -0
- package/dist/components/time-picker/time-picker-column.d.ts +9 -0
- package/dist/components/time-picker/time-picker-column.js +18 -0
- package/dist/components/time-picker/time-picker-content.cjs +30 -0
- package/dist/components/time-picker/time-picker-content.d.cts +8 -0
- package/dist/components/time-picker/time-picker-content.d.ts +8 -0
- package/dist/components/time-picker/time-picker-content.js +26 -0
- package/dist/components/time-picker/time-picker-context.cjs +10 -0
- package/dist/components/time-picker/time-picker-context.d.cts +7 -0
- package/dist/components/time-picker/time-picker-context.d.ts +7 -0
- package/dist/components/time-picker/time-picker-context.js +6 -0
- package/dist/components/time-picker/time-picker-control.cjs +21 -0
- package/dist/components/time-picker/time-picker-control.d.cts +8 -0
- package/dist/components/time-picker/time-picker-control.d.ts +8 -0
- package/dist/components/time-picker/time-picker-control.js +17 -0
- package/dist/components/time-picker/time-picker-input.cjs +19 -0
- package/dist/components/time-picker/time-picker-input.d.cts +8 -0
- package/dist/components/time-picker/time-picker-input.d.ts +8 -0
- package/dist/components/time-picker/time-picker-input.js +15 -0
- package/dist/components/time-picker/time-picker-label.cjs +19 -0
- package/dist/components/time-picker/time-picker-label.d.cts +8 -0
- package/dist/components/time-picker/time-picker-label.d.ts +8 -0
- package/dist/components/time-picker/time-picker-label.js +15 -0
- package/dist/components/time-picker/time-picker-positioner.cjs +26 -0
- package/dist/components/time-picker/time-picker-positioner.d.cts +8 -0
- package/dist/components/time-picker/time-picker-positioner.d.ts +8 -0
- package/dist/components/time-picker/time-picker-positioner.js +22 -0
- package/dist/components/time-picker/time-picker-root-provider.cjs +30 -0
- package/dist/components/time-picker/time-picker-root-provider.d.cts +14 -0
- package/dist/components/time-picker/time-picker-root-provider.d.ts +14 -0
- package/dist/components/time-picker/time-picker-root-provider.js +26 -0
- package/dist/components/time-picker/time-picker-root.cjs +48 -0
- package/dist/components/time-picker/time-picker-root.d.cts +11 -0
- package/dist/components/time-picker/time-picker-root.d.ts +11 -0
- package/dist/components/time-picker/time-picker-root.js +44 -0
- package/dist/components/time-picker/time-picker-spacer.cjs +19 -0
- package/dist/components/time-picker/time-picker-spacer.d.cts +8 -0
- package/dist/components/time-picker/time-picker-spacer.d.ts +8 -0
- package/dist/components/time-picker/time-picker-spacer.js +15 -0
- package/dist/components/time-picker/time-picker-trigger.cjs +21 -0
- package/dist/components/time-picker/time-picker-trigger.d.cts +8 -0
- package/dist/components/time-picker/time-picker-trigger.d.ts +8 -0
- package/dist/components/time-picker/time-picker-trigger.js +17 -0
- package/dist/components/time-picker/time-picker.cjs +33 -0
- package/dist/components/time-picker/time-picker.d.cts +14 -0
- package/dist/components/time-picker/time-picker.d.ts +14 -0
- package/dist/components/time-picker/time-picker.js +13 -0
- package/dist/components/time-picker/use-time-picker-column-props-context.cjs +15 -0
- package/dist/components/time-picker/use-time-picker-column-props-context.d.cts +7 -0
- package/dist/components/time-picker/use-time-picker-column-props-context.d.ts +7 -0
- package/dist/components/time-picker/use-time-picker-column-props-context.js +10 -0
- package/dist/components/time-picker/use-time-picker-context.cjs +15 -0
- package/dist/components/time-picker/use-time-picker-context.d.cts +6 -0
- package/dist/components/time-picker/use-time-picker-context.d.ts +6 -0
- package/dist/components/time-picker/use-time-picker-context.js +10 -0
- package/dist/components/time-picker/use-time-picker.cjs +60 -0
- package/dist/components/time-picker/use-time-picker.d.cts +31 -0
- package/dist/components/time-picker/use-time-picker.d.ts +31 -0
- package/dist/components/time-picker/use-time-picker.js +37 -0
- package/dist/components/toast/index.cjs +7 -2
- package/dist/components/toast/index.d.cts +2 -1
- package/dist/components/toast/index.d.ts +2 -1
- package/dist/components/toast/index.js +1 -0
- package/dist/components/toast/toast.anatomy.d.cts +1 -0
- package/dist/components/toast/toast.anatomy.d.ts +1 -0
- package/dist/components/toggle-group/index.cjs +7 -2
- package/dist/components/toggle-group/index.d.cts +1 -0
- package/dist/components/toggle-group/index.d.ts +1 -0
- package/dist/components/toggle-group/index.js +1 -0
- package/dist/components/toggle-group/toggle-group.anatomy.d.cts +1 -0
- package/dist/components/toggle-group/toggle-group.anatomy.d.ts +1 -0
- package/dist/components/tooltip/index.cjs +7 -2
- package/dist/components/tooltip/index.d.cts +1 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tooltip/tooltip.anatomy.d.cts +1 -0
- package/dist/components/tooltip/tooltip.anatomy.d.ts +1 -0
- package/dist/components/tree-view/index.cjs +7 -2
- package/dist/components/tree-view/index.d.cts +1 -0
- package/dist/components/tree-view/index.d.ts +1 -0
- package/dist/components/tree-view/index.js +1 -0
- package/dist/components/tree-view/tree-view.anatomy.d.cts +1 -0
- package/dist/components/tree-view/tree-view.anatomy.d.ts +1 -0
- package/dist/index.cjs +263 -50
- package/dist/index.js +65 -0
- package/dist/node_modules/@internationalized/date/dist/CalendarDate.cjs +52 -0
- package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +48 -0
- package/dist/node_modules/@internationalized/date/dist/manipulation.cjs +108 -0
- package/dist/node_modules/@internationalized/date/dist/manipulation.js +99 -0
- package/dist/node_modules/@internationalized/date/dist/queries.cjs +13 -0
- package/dist/node_modules/@internationalized/date/dist/queries.js +9 -0
- package/dist/node_modules/@internationalized/date/dist/string.cjs +38 -0
- package/dist/node_modules/@internationalized/date/dist/string.js +33 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.cjs +13 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +8 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.cjs +14 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +9 -0
- package/package.json +86 -60
|
@@ -3,15 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
5
|
|
|
6
|
-
const anatomy = require('@ark-ui/anatomy');
|
|
7
6
|
const domQuery = require('@zag-js/dom-query');
|
|
8
7
|
const react = require('react');
|
|
8
|
+
const useFieldsetContext = require('../fieldset/use-fieldset-context.cjs');
|
|
9
|
+
const field_anatomy = require('./field.anatomy.cjs');
|
|
9
10
|
|
|
10
|
-
const parts = anatomy.fieldAnatomy.build();
|
|
11
11
|
const useField = (props) => {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
const fieldset = useFieldsetContext.useFieldsetContext();
|
|
13
|
+
const {
|
|
14
|
+
disabled = Boolean(fieldset?.disabled),
|
|
15
|
+
invalid = false,
|
|
16
|
+
readOnly = false,
|
|
17
|
+
required = false
|
|
18
|
+
} = props;
|
|
19
|
+
const hasErrorText = react.useRef(false);
|
|
20
|
+
const hasHelperText = react.useRef(false);
|
|
15
21
|
const id = props.id ?? react.useId();
|
|
16
22
|
const rootRef = react.useRef(null);
|
|
17
23
|
const errorTextId = `field::${id}::error-text`;
|
|
@@ -23,65 +29,93 @@ const useField = (props) => {
|
|
|
23
29
|
const win = domQuery.getWindow(rootNode);
|
|
24
30
|
const doc = win.document;
|
|
25
31
|
const checkTextElements = () => {
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
hasErrorText.current = !!doc.getElementById(errorTextId);
|
|
33
|
+
hasHelperText.current = !!doc.getElementById(helperTextId);
|
|
28
34
|
};
|
|
29
35
|
checkTextElements();
|
|
30
36
|
const observer = new win.MutationObserver(checkTextElements);
|
|
31
37
|
observer.observe(rootNode, { childList: true, subtree: true });
|
|
32
38
|
return () => observer.disconnect();
|
|
33
39
|
}, [errorTextId, helperTextId]);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
readOnly
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
40
|
+
const labelIds = react.useMemo(() => {
|
|
41
|
+
const ids = [];
|
|
42
|
+
if (hasErrorText.current && invalid) ids.push(errorTextId);
|
|
43
|
+
if (hasHelperText.current) ids.push(helperTextId);
|
|
44
|
+
return ids.join(" ") || void 0;
|
|
45
|
+
}, [invalid, errorTextId, helperTextId]);
|
|
46
|
+
const getRootProps = react.useMemo(
|
|
47
|
+
() => () => ({
|
|
48
|
+
...field_anatomy.parts.root.attrs,
|
|
49
|
+
ref: rootRef,
|
|
50
|
+
role: "group",
|
|
51
|
+
"data-disabled": dataAttr(disabled),
|
|
52
|
+
"data-invalid": dataAttr(invalid),
|
|
53
|
+
"data-readonly": dataAttr(readOnly)
|
|
54
|
+
}),
|
|
55
|
+
[disabled, invalid, readOnly]
|
|
56
|
+
);
|
|
57
|
+
const getLabelProps = react.useMemo(
|
|
58
|
+
() => () => ({
|
|
59
|
+
...field_anatomy.parts.label.attrs,
|
|
60
|
+
id: labelId,
|
|
61
|
+
"data-disabled": dataAttr(disabled),
|
|
62
|
+
"data-invalid": dataAttr(invalid),
|
|
63
|
+
"data-readonly": dataAttr(readOnly),
|
|
64
|
+
htmlFor: id
|
|
65
|
+
}),
|
|
66
|
+
[disabled, invalid, readOnly, id, labelId]
|
|
67
|
+
);
|
|
68
|
+
const getControlProps = react.useMemo(
|
|
69
|
+
() => () => ({
|
|
70
|
+
"aria-describedby": labelIds,
|
|
71
|
+
"aria-invalid": ariaAttr(invalid),
|
|
72
|
+
"aria-required": ariaAttr(required),
|
|
73
|
+
"aria-readonly": ariaAttr(readOnly),
|
|
74
|
+
id,
|
|
75
|
+
required,
|
|
76
|
+
disabled,
|
|
77
|
+
readOnly
|
|
78
|
+
}),
|
|
79
|
+
[labelIds, invalid, required, readOnly, id, disabled]
|
|
80
|
+
);
|
|
81
|
+
const getInputProps = react.useMemo(
|
|
82
|
+
() => () => ({
|
|
83
|
+
...getControlProps(),
|
|
84
|
+
...field_anatomy.parts.input.attrs
|
|
85
|
+
}),
|
|
86
|
+
[getControlProps]
|
|
87
|
+
);
|
|
88
|
+
const getTextareaProps = react.useMemo(
|
|
89
|
+
() => () => ({
|
|
90
|
+
...getControlProps(),
|
|
91
|
+
...field_anatomy.parts.textarea.attrs
|
|
92
|
+
}),
|
|
93
|
+
[getControlProps]
|
|
94
|
+
);
|
|
95
|
+
const getSelectProps = react.useMemo(
|
|
96
|
+
() => () => ({
|
|
97
|
+
...getControlProps(),
|
|
98
|
+
...field_anatomy.parts.select.attrs
|
|
99
|
+
}),
|
|
100
|
+
[getControlProps]
|
|
101
|
+
);
|
|
102
|
+
const getHelperTextProps = react.useMemo(
|
|
103
|
+
() => () => ({
|
|
104
|
+
id: helperTextId,
|
|
105
|
+
...field_anatomy.parts.helperText.attrs
|
|
106
|
+
}),
|
|
107
|
+
[helperTextId]
|
|
108
|
+
);
|
|
109
|
+
const getErrorTextProps = react.useMemo(
|
|
110
|
+
() => () => ({
|
|
111
|
+
id: errorTextId,
|
|
112
|
+
...field_anatomy.parts.errorText.attrs,
|
|
113
|
+
"aria-live": "polite"
|
|
114
|
+
}),
|
|
115
|
+
[errorTextId]
|
|
116
|
+
);
|
|
83
117
|
return {
|
|
84
|
-
ariaDescribedby: labelIds
|
|
118
|
+
ariaDescribedby: labelIds,
|
|
85
119
|
ids: {
|
|
86
120
|
control: id,
|
|
87
121
|
label: labelId,
|
|
@@ -104,7 +138,7 @@ const useField = (props) => {
|
|
|
104
138
|
getErrorTextProps
|
|
105
139
|
};
|
|
106
140
|
};
|
|
107
|
-
const dataAttr = (condition) => condition ? "" : void 0;
|
|
141
|
+
const dataAttr = (condition) => condition ? "true" : void 0;
|
|
108
142
|
const ariaAttr = (condition) => condition ? true : void 0;
|
|
109
143
|
|
|
110
144
|
exports.useField = useField;
|
|
@@ -22,7 +22,7 @@ export interface UseFieldProps {
|
|
|
22
22
|
}
|
|
23
23
|
export type UseFieldReturn = ReturnType<typeof useField>;
|
|
24
24
|
export declare const useField: (props: UseFieldProps) => {
|
|
25
|
-
ariaDescribedby: string;
|
|
25
|
+
ariaDescribedby: string | undefined;
|
|
26
26
|
ids: {
|
|
27
27
|
control: string;
|
|
28
28
|
label: string;
|
|
@@ -36,65 +36,11 @@ export declare const useField: (props: UseFieldProps) => {
|
|
|
36
36
|
invalid: boolean;
|
|
37
37
|
readOnly: boolean;
|
|
38
38
|
required: boolean;
|
|
39
|
-
getLabelProps: () =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"data-scope": string;
|
|
46
|
-
"data-part": string;
|
|
47
|
-
};
|
|
48
|
-
getRootProps: () => {
|
|
49
|
-
role: string;
|
|
50
|
-
'data-disabled': Booleanish;
|
|
51
|
-
'data-invalid': Booleanish;
|
|
52
|
-
'data-readonly': Booleanish;
|
|
53
|
-
"data-scope": string;
|
|
54
|
-
"data-part": string;
|
|
55
|
-
};
|
|
56
|
-
getInputProps: () => {
|
|
57
|
-
"data-scope": string;
|
|
58
|
-
"data-part": string;
|
|
59
|
-
'aria-describedby': string | undefined;
|
|
60
|
-
'aria-invalid': boolean | undefined;
|
|
61
|
-
'aria-required': boolean | undefined;
|
|
62
|
-
'aria-readonly': boolean | undefined;
|
|
63
|
-
id: string;
|
|
64
|
-
required: boolean;
|
|
65
|
-
disabled: boolean;
|
|
66
|
-
readOnly: boolean;
|
|
67
|
-
};
|
|
68
|
-
getTextareaProps: () => {
|
|
69
|
-
"data-scope": string;
|
|
70
|
-
"data-part": string;
|
|
71
|
-
'aria-describedby': string | undefined;
|
|
72
|
-
'aria-invalid': boolean | undefined;
|
|
73
|
-
'aria-required': boolean | undefined;
|
|
74
|
-
'aria-readonly': boolean | undefined;
|
|
75
|
-
id: string;
|
|
76
|
-
required: boolean;
|
|
77
|
-
disabled: boolean;
|
|
78
|
-
readOnly: boolean;
|
|
79
|
-
};
|
|
80
|
-
getSelectProps: () => {
|
|
81
|
-
"data-scope": string;
|
|
82
|
-
"data-part": string;
|
|
83
|
-
'aria-describedby': string | undefined;
|
|
84
|
-
'aria-invalid': boolean | undefined;
|
|
85
|
-
'aria-required': boolean | undefined;
|
|
86
|
-
'aria-readonly': boolean | undefined;
|
|
87
|
-
id: string;
|
|
88
|
-
required: boolean;
|
|
89
|
-
disabled: boolean;
|
|
90
|
-
readOnly: boolean;
|
|
91
|
-
};
|
|
92
|
-
getHelperTextProps: () => {
|
|
93
|
-
"data-scope": string;
|
|
94
|
-
"data-part": string;
|
|
95
|
-
id: string;
|
|
96
|
-
};
|
|
39
|
+
getLabelProps: () => HTMLProps<"label">;
|
|
40
|
+
getRootProps: () => HTMLProps<"div">;
|
|
41
|
+
getInputProps: () => HTMLProps<"input">;
|
|
42
|
+
getTextareaProps: () => HTMLProps<"textarea">;
|
|
43
|
+
getSelectProps: () => HTMLProps<"select">;
|
|
44
|
+
getHelperTextProps: () => HTMLProps<"span">;
|
|
97
45
|
getErrorTextProps: () => HTMLProps<"span">;
|
|
98
46
|
};
|
|
99
|
-
type Booleanish = boolean | 'true' | 'false';
|
|
100
|
-
export {};
|
|
@@ -22,7 +22,7 @@ export interface UseFieldProps {
|
|
|
22
22
|
}
|
|
23
23
|
export type UseFieldReturn = ReturnType<typeof useField>;
|
|
24
24
|
export declare const useField: (props: UseFieldProps) => {
|
|
25
|
-
ariaDescribedby: string;
|
|
25
|
+
ariaDescribedby: string | undefined;
|
|
26
26
|
ids: {
|
|
27
27
|
control: string;
|
|
28
28
|
label: string;
|
|
@@ -36,65 +36,11 @@ export declare const useField: (props: UseFieldProps) => {
|
|
|
36
36
|
invalid: boolean;
|
|
37
37
|
readOnly: boolean;
|
|
38
38
|
required: boolean;
|
|
39
|
-
getLabelProps: () =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"data-scope": string;
|
|
46
|
-
"data-part": string;
|
|
47
|
-
};
|
|
48
|
-
getRootProps: () => {
|
|
49
|
-
role: string;
|
|
50
|
-
'data-disabled': Booleanish;
|
|
51
|
-
'data-invalid': Booleanish;
|
|
52
|
-
'data-readonly': Booleanish;
|
|
53
|
-
"data-scope": string;
|
|
54
|
-
"data-part": string;
|
|
55
|
-
};
|
|
56
|
-
getInputProps: () => {
|
|
57
|
-
"data-scope": string;
|
|
58
|
-
"data-part": string;
|
|
59
|
-
'aria-describedby': string | undefined;
|
|
60
|
-
'aria-invalid': boolean | undefined;
|
|
61
|
-
'aria-required': boolean | undefined;
|
|
62
|
-
'aria-readonly': boolean | undefined;
|
|
63
|
-
id: string;
|
|
64
|
-
required: boolean;
|
|
65
|
-
disabled: boolean;
|
|
66
|
-
readOnly: boolean;
|
|
67
|
-
};
|
|
68
|
-
getTextareaProps: () => {
|
|
69
|
-
"data-scope": string;
|
|
70
|
-
"data-part": string;
|
|
71
|
-
'aria-describedby': string | undefined;
|
|
72
|
-
'aria-invalid': boolean | undefined;
|
|
73
|
-
'aria-required': boolean | undefined;
|
|
74
|
-
'aria-readonly': boolean | undefined;
|
|
75
|
-
id: string;
|
|
76
|
-
required: boolean;
|
|
77
|
-
disabled: boolean;
|
|
78
|
-
readOnly: boolean;
|
|
79
|
-
};
|
|
80
|
-
getSelectProps: () => {
|
|
81
|
-
"data-scope": string;
|
|
82
|
-
"data-part": string;
|
|
83
|
-
'aria-describedby': string | undefined;
|
|
84
|
-
'aria-invalid': boolean | undefined;
|
|
85
|
-
'aria-required': boolean | undefined;
|
|
86
|
-
'aria-readonly': boolean | undefined;
|
|
87
|
-
id: string;
|
|
88
|
-
required: boolean;
|
|
89
|
-
disabled: boolean;
|
|
90
|
-
readOnly: boolean;
|
|
91
|
-
};
|
|
92
|
-
getHelperTextProps: () => {
|
|
93
|
-
"data-scope": string;
|
|
94
|
-
"data-part": string;
|
|
95
|
-
id: string;
|
|
96
|
-
};
|
|
39
|
+
getLabelProps: () => HTMLProps<"label">;
|
|
40
|
+
getRootProps: () => HTMLProps<"div">;
|
|
41
|
+
getInputProps: () => HTMLProps<"input">;
|
|
42
|
+
getTextareaProps: () => HTMLProps<"textarea">;
|
|
43
|
+
getSelectProps: () => HTMLProps<"select">;
|
|
44
|
+
getHelperTextProps: () => HTMLProps<"span">;
|
|
97
45
|
getErrorTextProps: () => HTMLProps<"span">;
|
|
98
46
|
};
|
|
99
|
-
type Booleanish = boolean | 'true' | 'false';
|
|
100
|
-
export {};
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { fieldAnatomy } from '@ark-ui/anatomy';
|
|
3
2
|
import { getWindow } from '@zag-js/dom-query';
|
|
4
|
-
import {
|
|
3
|
+
import { useRef, useId, useLayoutEffect, useMemo } from 'react';
|
|
4
|
+
import { useFieldsetContext } from '../fieldset/use-fieldset-context.js';
|
|
5
|
+
import { parts } from './field.anatomy.js';
|
|
5
6
|
|
|
6
|
-
const parts = fieldAnatomy.build();
|
|
7
7
|
const useField = (props) => {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
8
|
+
const fieldset = useFieldsetContext();
|
|
9
|
+
const {
|
|
10
|
+
disabled = Boolean(fieldset?.disabled),
|
|
11
|
+
invalid = false,
|
|
12
|
+
readOnly = false,
|
|
13
|
+
required = false
|
|
14
|
+
} = props;
|
|
15
|
+
const hasErrorText = useRef(false);
|
|
16
|
+
const hasHelperText = useRef(false);
|
|
11
17
|
const id = props.id ?? useId();
|
|
12
18
|
const rootRef = useRef(null);
|
|
13
19
|
const errorTextId = `field::${id}::error-text`;
|
|
@@ -19,65 +25,93 @@ const useField = (props) => {
|
|
|
19
25
|
const win = getWindow(rootNode);
|
|
20
26
|
const doc = win.document;
|
|
21
27
|
const checkTextElements = () => {
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
hasErrorText.current = !!doc.getElementById(errorTextId);
|
|
29
|
+
hasHelperText.current = !!doc.getElementById(helperTextId);
|
|
24
30
|
};
|
|
25
31
|
checkTextElements();
|
|
26
32
|
const observer = new win.MutationObserver(checkTextElements);
|
|
27
33
|
observer.observe(rootNode, { childList: true, subtree: true });
|
|
28
34
|
return () => observer.disconnect();
|
|
29
35
|
}, [errorTextId, helperTextId]);
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
readOnly
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
36
|
+
const labelIds = useMemo(() => {
|
|
37
|
+
const ids = [];
|
|
38
|
+
if (hasErrorText.current && invalid) ids.push(errorTextId);
|
|
39
|
+
if (hasHelperText.current) ids.push(helperTextId);
|
|
40
|
+
return ids.join(" ") || void 0;
|
|
41
|
+
}, [invalid, errorTextId, helperTextId]);
|
|
42
|
+
const getRootProps = useMemo(
|
|
43
|
+
() => () => ({
|
|
44
|
+
...parts.root.attrs,
|
|
45
|
+
ref: rootRef,
|
|
46
|
+
role: "group",
|
|
47
|
+
"data-disabled": dataAttr(disabled),
|
|
48
|
+
"data-invalid": dataAttr(invalid),
|
|
49
|
+
"data-readonly": dataAttr(readOnly)
|
|
50
|
+
}),
|
|
51
|
+
[disabled, invalid, readOnly]
|
|
52
|
+
);
|
|
53
|
+
const getLabelProps = useMemo(
|
|
54
|
+
() => () => ({
|
|
55
|
+
...parts.label.attrs,
|
|
56
|
+
id: labelId,
|
|
57
|
+
"data-disabled": dataAttr(disabled),
|
|
58
|
+
"data-invalid": dataAttr(invalid),
|
|
59
|
+
"data-readonly": dataAttr(readOnly),
|
|
60
|
+
htmlFor: id
|
|
61
|
+
}),
|
|
62
|
+
[disabled, invalid, readOnly, id, labelId]
|
|
63
|
+
);
|
|
64
|
+
const getControlProps = useMemo(
|
|
65
|
+
() => () => ({
|
|
66
|
+
"aria-describedby": labelIds,
|
|
67
|
+
"aria-invalid": ariaAttr(invalid),
|
|
68
|
+
"aria-required": ariaAttr(required),
|
|
69
|
+
"aria-readonly": ariaAttr(readOnly),
|
|
70
|
+
id,
|
|
71
|
+
required,
|
|
72
|
+
disabled,
|
|
73
|
+
readOnly
|
|
74
|
+
}),
|
|
75
|
+
[labelIds, invalid, required, readOnly, id, disabled]
|
|
76
|
+
);
|
|
77
|
+
const getInputProps = useMemo(
|
|
78
|
+
() => () => ({
|
|
79
|
+
...getControlProps(),
|
|
80
|
+
...parts.input.attrs
|
|
81
|
+
}),
|
|
82
|
+
[getControlProps]
|
|
83
|
+
);
|
|
84
|
+
const getTextareaProps = useMemo(
|
|
85
|
+
() => () => ({
|
|
86
|
+
...getControlProps(),
|
|
87
|
+
...parts.textarea.attrs
|
|
88
|
+
}),
|
|
89
|
+
[getControlProps]
|
|
90
|
+
);
|
|
91
|
+
const getSelectProps = useMemo(
|
|
92
|
+
() => () => ({
|
|
93
|
+
...getControlProps(),
|
|
94
|
+
...parts.select.attrs
|
|
95
|
+
}),
|
|
96
|
+
[getControlProps]
|
|
97
|
+
);
|
|
98
|
+
const getHelperTextProps = useMemo(
|
|
99
|
+
() => () => ({
|
|
100
|
+
id: helperTextId,
|
|
101
|
+
...parts.helperText.attrs
|
|
102
|
+
}),
|
|
103
|
+
[helperTextId]
|
|
104
|
+
);
|
|
105
|
+
const getErrorTextProps = useMemo(
|
|
106
|
+
() => () => ({
|
|
107
|
+
id: errorTextId,
|
|
108
|
+
...parts.errorText.attrs,
|
|
109
|
+
"aria-live": "polite"
|
|
110
|
+
}),
|
|
111
|
+
[errorTextId]
|
|
112
|
+
);
|
|
79
113
|
return {
|
|
80
|
-
ariaDescribedby: labelIds
|
|
114
|
+
ariaDescribedby: labelIds,
|
|
81
115
|
ids: {
|
|
82
116
|
control: id,
|
|
83
117
|
label: labelId,
|
|
@@ -100,7 +134,7 @@ const useField = (props) => {
|
|
|
100
134
|
getErrorTextProps
|
|
101
135
|
};
|
|
102
136
|
};
|
|
103
|
-
const dataAttr = (condition) => condition ? "" : void 0;
|
|
137
|
+
const dataAttr = (condition) => condition ? "true" : void 0;
|
|
104
138
|
const ariaAttr = (condition) => condition ? true : void 0;
|
|
105
139
|
|
|
106
140
|
export { useField };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const useFieldsetContext = require('./use-fieldset-context.cjs');
|
|
7
|
+
|
|
8
|
+
const FieldsetContext = (props) => props.children(useFieldsetContext.useFieldsetContext());
|
|
9
|
+
|
|
10
|
+
exports.FieldsetContext = FieldsetContext;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UseFieldsetContext } from './use-fieldset-context';
|
|
3
|
+
|
|
4
|
+
export interface FieldsetContextProps {
|
|
5
|
+
children: (context: UseFieldsetContext) => ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const FieldsetContext: (props: FieldsetContextProps) => ReactNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UseFieldsetContext } from './use-fieldset-context';
|
|
3
|
+
|
|
4
|
+
export interface FieldsetContextProps {
|
|
5
|
+
children: (context: UseFieldsetContext) => ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const FieldsetContext: (props: FieldsetContextProps) => ReactNode;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const react$1 = require('@zag-js/react');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
const factory = require('../factory.cjs');
|
|
10
|
+
const useFieldsetContext = require('./use-fieldset-context.cjs');
|
|
11
|
+
|
|
12
|
+
const FieldsetErrorText = react.forwardRef(
|
|
13
|
+
(props, ref) => {
|
|
14
|
+
const fieldset = useFieldsetContext.useFieldsetContext();
|
|
15
|
+
const mergedProps = react$1.mergeProps(fieldset.getErrorTextProps(), props);
|
|
16
|
+
return fieldset.invalid ? /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref }) : null;
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
FieldsetErrorText.displayName = "FieldsetErrorText";
|
|
20
|
+
|
|
21
|
+
exports.FieldsetErrorText = FieldsetErrorText;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface FieldsetErrorTextBaseProps extends PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface FieldsetErrorTextProps extends HTMLProps<'span'>, FieldsetErrorTextBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const FieldsetErrorText: ForwardRefExoticComponent<FieldsetErrorTextProps & RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface FieldsetErrorTextBaseProps extends PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface FieldsetErrorTextProps extends HTMLProps<'span'>, FieldsetErrorTextBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const FieldsetErrorText: ForwardRefExoticComponent<FieldsetErrorTextProps & RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { mergeProps } from '@zag-js/react';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { ark } from '../factory.js';
|
|
6
|
+
import { useFieldsetContext } from './use-fieldset-context.js';
|
|
7
|
+
|
|
8
|
+
const FieldsetErrorText = forwardRef(
|
|
9
|
+
(props, ref) => {
|
|
10
|
+
const fieldset = useFieldsetContext();
|
|
11
|
+
const mergedProps = mergeProps(fieldset.getErrorTextProps(), props);
|
|
12
|
+
return fieldset.invalid ? /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref }) : null;
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
FieldsetErrorText.displayName = "FieldsetErrorText";
|
|
16
|
+
|
|
17
|
+
export { FieldsetErrorText };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const react$1 = require('@zag-js/react');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
const factory = require('../factory.cjs');
|
|
10
|
+
const useFieldsetContext = require('./use-fieldset-context.cjs');
|
|
11
|
+
|
|
12
|
+
const FieldsetHelperText = react.forwardRef(
|
|
13
|
+
(props, ref) => {
|
|
14
|
+
const fieldset = useFieldsetContext.useFieldsetContext();
|
|
15
|
+
const mergedProps = react$1.mergeProps(fieldset.getHelperTextProps(), props);
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref });
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
FieldsetHelperText.displayName = "FieldsetHelperText";
|
|
20
|
+
|
|
21
|
+
exports.FieldsetHelperText = FieldsetHelperText;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface FieldsetHelperTextBaseProps extends PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface FieldsetHelperTextProps extends HTMLProps<'span'>, FieldsetHelperTextBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const FieldsetHelperText: ForwardRefExoticComponent<FieldsetHelperTextProps & RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface FieldsetHelperTextBaseProps extends PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface FieldsetHelperTextProps extends HTMLProps<'span'>, FieldsetHelperTextBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const FieldsetHelperText: ForwardRefExoticComponent<FieldsetHelperTextProps & RefAttributes<HTMLSpanElement>>;
|