@ariakit/react-core 0.3.12 → 0.3.13
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/CHANGELOG.md +16 -0
- package/cjs/__chunks/{LICANQTI.cjs → 25ZFPUHH.cjs} +2 -2
- package/cjs/__chunks/{LFHNPG2L.cjs → 2FTVUUOK.cjs} +2 -2
- package/cjs/__chunks/{7ZVTEFD7.cjs → 2IMEEJHG.cjs} +2 -2
- package/cjs/__chunks/{BBS4RP44.cjs → 2UEWAQWG.cjs} +2 -2
- package/cjs/__chunks/{TGTVGYEZ.cjs → 4KFTI2WW.cjs} +2 -2
- package/cjs/__chunks/{KDG57VZV.cjs → CIZTEPFO.cjs} +3 -3
- package/cjs/__chunks/{UXFBTIBY.cjs → ER5DEJFH.cjs} +2 -2
- package/cjs/__chunks/{EKB76T2U.cjs → FGHQW2WS.cjs} +7 -7
- package/cjs/__chunks/{XA62Y24Z.cjs → GGMSVQ4G.cjs} +2 -2
- package/cjs/__chunks/{23HLSVKM.cjs → GMQZGKGV.cjs} +2 -2
- package/cjs/__chunks/{IO6J4PAN.cjs → GSETTLOU.cjs} +2 -2
- package/cjs/__chunks/{RNGIWUQW.cjs → HQEKHRPP.cjs} +2 -2
- package/cjs/__chunks/{7HJPL3H2.cjs → ITQETTAV.cjs} +4 -4
- package/cjs/__chunks/{NY3D6JQT.cjs → JFNPRZX3.cjs} +2 -2
- package/cjs/__chunks/{G2ZXRZ2R.cjs → MMRX6FNS.cjs} +2 -2
- package/cjs/__chunks/{VCDQISP7.cjs → N3XK7EAH.cjs} +7 -7
- package/cjs/__chunks/{QCG6J6X5.cjs → NLVGDNPE.cjs} +2 -2
- package/cjs/__chunks/{DAJUUBUI.cjs → OSTQZD2E.cjs} +2 -2
- package/cjs/__chunks/{ZWICHV7O.cjs → PJ646MI7.cjs} +2 -2
- package/cjs/__chunks/{NNINKJTT.cjs → QSU3WKMW.cjs} +2 -2
- package/cjs/__chunks/{H6OLBVHA.cjs → R7ERL264.cjs} +2 -2
- package/cjs/__chunks/{5UTRYT6E.cjs → REJALU3P.cjs} +2 -2
- package/cjs/__chunks/{D4TG5DM4.cjs → UPU6KE6C.cjs} +2 -2
- package/cjs/__chunks/{Z3GCTNW4.cjs → VUEWHLYH.cjs} +1 -1
- package/cjs/button/button.cjs +4 -4
- package/cjs/button/button.d.cts +1 -1
- package/cjs/button/button.d.ts +1 -1
- package/cjs/checkbox/checkbox-check.d.cts +17 -9
- package/cjs/checkbox/checkbox-check.d.ts +17 -9
- package/cjs/checkbox/checkbox-provider.cjs +2 -2
- package/cjs/checkbox/checkbox-provider.d.cts +4 -2
- package/cjs/checkbox/checkbox-provider.d.ts +4 -2
- package/cjs/checkbox/checkbox-store.d.cts +5 -3
- package/cjs/checkbox/checkbox-store.d.ts +5 -3
- package/cjs/checkbox/checkbox.cjs +4 -4
- package/cjs/checkbox/checkbox.d.cts +14 -9
- package/cjs/checkbox/checkbox.d.ts +14 -9
- package/cjs/collection/collection-item.d.cts +23 -9
- package/cjs/collection/collection-item.d.ts +23 -9
- package/cjs/collection/collection-provider.d.cts +2 -1
- package/cjs/collection/collection-provider.d.ts +2 -1
- package/cjs/collection/collection-renderer.d.cts +1 -1
- package/cjs/collection/collection-renderer.d.ts +1 -1
- package/cjs/collection/collection-store.d.cts +6 -3
- package/cjs/collection/collection-store.d.ts +6 -3
- package/cjs/collection/collection.d.cts +4 -3
- package/cjs/collection/collection.d.ts +4 -3
- package/cjs/combobox/combobox-cancel.cjs +4 -4
- package/cjs/combobox/combobox-cancel.d.cts +3 -2
- package/cjs/combobox/combobox-cancel.d.ts +3 -2
- package/cjs/combobox/combobox-disclosure.cjs +6 -6
- package/cjs/combobox/combobox-disclosure.d.cts +7 -2
- package/cjs/combobox/combobox-disclosure.d.ts +7 -2
- package/cjs/combobox/combobox-group-label.d.cts +4 -4
- package/cjs/combobox/combobox-group-label.d.ts +4 -4
- package/cjs/combobox/combobox-group.d.cts +7 -3
- package/cjs/combobox/combobox-group.d.ts +7 -3
- package/cjs/combobox/combobox-item-check.d.cts +9 -16
- package/cjs/combobox/combobox-item-check.d.ts +9 -16
- package/cjs/combobox/combobox-item-value.d.cts +13 -8
- package/cjs/combobox/combobox-item-value.d.ts +13 -8
- package/cjs/combobox/combobox-item.cjs +4 -4
- package/cjs/combobox/combobox-item.d.cts +11 -9
- package/cjs/combobox/combobox-item.d.ts +11 -9
- package/cjs/combobox/combobox-list.cjs +3 -3
- package/cjs/combobox/combobox-list.d.cts +1 -4
- package/cjs/combobox/combobox-list.d.ts +1 -4
- package/cjs/combobox/combobox-popover.cjs +10 -10
- package/cjs/combobox/combobox-popover.d.cts +2 -3
- package/cjs/combobox/combobox-popover.d.ts +2 -3
- package/cjs/combobox/combobox-provider.d.cts +2 -1
- package/cjs/combobox/combobox-provider.d.ts +2 -1
- package/cjs/combobox/combobox-row.d.cts +6 -3
- package/cjs/combobox/combobox-row.d.ts +6 -3
- package/cjs/combobox/combobox-separator.d.cts +4 -3
- package/cjs/combobox/combobox-separator.d.ts +4 -3
- package/cjs/combobox/combobox-store.d.cts +11 -7
- package/cjs/combobox/combobox-store.d.ts +11 -7
- package/cjs/combobox/combobox.cjs +3 -3
- package/cjs/combobox/combobox.d.cts +45 -33
- package/cjs/combobox/combobox.d.ts +45 -33
- package/cjs/command/command.cjs +3 -3
- package/cjs/command/command.d.cts +1 -1
- package/cjs/command/command.d.ts +1 -1
- package/cjs/composite/composite-container.d.cts +18 -11
- package/cjs/composite/composite-container.d.ts +18 -11
- package/cjs/composite/composite-group-label.d.cts +18 -13
- package/cjs/composite/composite-group-label.d.ts +18 -13
- package/cjs/composite/composite-group.d.cts +20 -12
- package/cjs/composite/composite-group.d.ts +20 -12
- package/cjs/composite/composite-hover.d.cts +17 -8
- package/cjs/composite/composite-hover.d.ts +17 -8
- package/cjs/composite/composite-input.d.cts +15 -9
- package/cjs/composite/composite-input.d.ts +15 -9
- package/cjs/composite/composite-item.cjs +4 -4
- package/cjs/composite/composite-item.d.cts +49 -9
- package/cjs/composite/composite-item.d.ts +49 -9
- package/cjs/composite/composite-overflow-disclosure.cjs +9 -9
- package/cjs/composite/composite-overflow.cjs +7 -7
- package/cjs/composite/composite-provider.d.cts +2 -1
- package/cjs/composite/composite-provider.d.ts +2 -1
- package/cjs/composite/composite-renderer.d.cts +1 -1
- package/cjs/composite/composite-renderer.d.ts +1 -1
- package/cjs/composite/composite-row.d.cts +26 -19
- package/cjs/composite/composite-row.d.ts +26 -19
- package/cjs/composite/composite-separator.d.cts +23 -10
- package/cjs/composite/composite-separator.d.ts +23 -10
- package/cjs/composite/composite-store.d.cts +3 -1
- package/cjs/composite/composite-store.d.ts +3 -1
- package/cjs/composite/composite-typeahead.d.cts +20 -8
- package/cjs/composite/composite-typeahead.d.ts +20 -8
- package/cjs/composite/composite.cjs +3 -3
- package/cjs/composite/composite.d.cts +65 -10
- package/cjs/composite/composite.d.ts +65 -10
- package/cjs/dialog/dialog-disclosure.cjs +6 -6
- package/cjs/dialog/dialog-disclosure.d.cts +2 -1
- package/cjs/dialog/dialog-disclosure.d.ts +2 -1
- package/cjs/dialog/dialog-dismiss.cjs +5 -5
- package/cjs/dialog/dialog-dismiss.d.cts +2 -1
- package/cjs/dialog/dialog-dismiss.d.ts +2 -1
- package/cjs/dialog/dialog-provider.d.cts +2 -1
- package/cjs/dialog/dialog-provider.d.ts +2 -1
- package/cjs/dialog/dialog-store.d.cts +3 -1
- package/cjs/dialog/dialog-store.d.ts +3 -1
- package/cjs/dialog/dialog.cjs +6 -6
- package/cjs/dialog/dialog.d.cts +51 -20
- package/cjs/dialog/dialog.d.ts +51 -20
- package/cjs/dialog/utils/disable-tree.cjs +3 -3
- package/cjs/dialog/utils/use-hide-on-interact-outside.cjs +1 -1
- package/cjs/disclosure/disclosure-content.d.cts +6 -5
- package/cjs/disclosure/disclosure-content.d.ts +6 -5
- package/cjs/disclosure/disclosure-provider.d.cts +2 -1
- package/cjs/disclosure/disclosure-provider.d.ts +2 -1
- package/cjs/disclosure/disclosure-store.d.cts +6 -4
- package/cjs/disclosure/disclosure-store.d.ts +6 -4
- package/cjs/disclosure/disclosure.cjs +5 -5
- package/cjs/disclosure/disclosure.d.cts +3 -2
- package/cjs/disclosure/disclosure.d.ts +3 -2
- package/cjs/focus-trap/focus-trap-region.d.cts +4 -2
- package/cjs/focus-trap/focus-trap-region.d.ts +4 -2
- package/cjs/focusable/focusable-container.d.cts +7 -5
- package/cjs/focusable/focusable-container.d.ts +7 -5
- package/cjs/focusable/focusable.cjs +2 -2
- package/cjs/focusable/focusable.d.cts +5 -2
- package/cjs/focusable/focusable.d.ts +5 -2
- package/cjs/form/form-checkbox.cjs +8 -8
- package/cjs/form/form-checkbox.d.cts +6 -4
- package/cjs/form/form-checkbox.d.ts +6 -4
- package/cjs/form/form-control.cjs +16 -0
- package/cjs/form/form-control.d.cts +93 -0
- package/cjs/form/form-control.d.ts +93 -0
- package/cjs/form/form-description.d.cts +14 -3
- package/cjs/form/form-description.d.ts +14 -3
- package/cjs/form/form-error.d.cts +11 -4
- package/cjs/form/form-error.d.ts +11 -4
- package/cjs/form/form-field.cjs +19 -4
- package/cjs/form/form-field.d.cts +16 -30
- package/cjs/form/form-field.d.ts +16 -30
- package/cjs/form/form-group-label.d.cts +6 -4
- package/cjs/form/form-group-label.d.ts +6 -4
- package/cjs/form/form-group.d.cts +6 -2
- package/cjs/form/form-group.d.ts +6 -2
- package/cjs/form/form-input.cjs +4 -4
- package/cjs/form/form-input.d.cts +7 -6
- package/cjs/form/form-input.d.ts +7 -6
- package/cjs/form/form-label.d.cts +18 -7
- package/cjs/form/form-label.d.ts +18 -7
- package/cjs/form/form-provider.d.cts +2 -1
- package/cjs/form/form-provider.d.ts +2 -1
- package/cjs/form/form-push.cjs +4 -4
- package/cjs/form/form-push.d.cts +17 -3
- package/cjs/form/form-push.d.ts +17 -3
- package/cjs/form/form-radio-group.d.cts +7 -2
- package/cjs/form/form-radio-group.d.ts +7 -2
- package/cjs/form/form-radio.cjs +7 -7
- package/cjs/form/form-radio.d.cts +8 -4
- package/cjs/form/form-radio.d.ts +8 -4
- package/cjs/form/form-remove.cjs +4 -4
- package/cjs/form/form-remove.d.cts +17 -2
- package/cjs/form/form-remove.d.ts +17 -2
- package/cjs/form/form-reset.cjs +4 -4
- package/cjs/form/form-reset.d.cts +5 -2
- package/cjs/form/form-reset.d.ts +5 -2
- package/cjs/form/form-store.d.cts +31 -14
- package/cjs/form/form-store.d.ts +31 -14
- package/cjs/form/form-submit.cjs +4 -4
- package/cjs/form/form-submit.d.cts +8 -2
- package/cjs/form/form-submit.d.ts +8 -2
- package/cjs/form/form.d.cts +37 -11
- package/cjs/form/form.d.ts +37 -11
- package/cjs/group/group-label.d.cts +3 -2
- package/cjs/group/group-label.d.ts +3 -2
- package/cjs/group/group.d.cts +3 -1
- package/cjs/group/group.d.ts +3 -1
- package/cjs/heading/heading-level.d.cts +4 -2
- package/cjs/heading/heading-level.d.ts +4 -2
- package/cjs/heading/heading.d.cts +4 -3
- package/cjs/heading/heading.d.ts +4 -3
- package/cjs/hovercard/hovercard-anchor.cjs +3 -3
- package/cjs/hovercard/hovercard-anchor.d.cts +5 -2
- package/cjs/hovercard/hovercard-anchor.d.ts +5 -2
- package/cjs/hovercard/hovercard-arrow.d.cts +4 -2
- package/cjs/hovercard/hovercard-arrow.d.ts +4 -2
- package/cjs/hovercard/hovercard-description.d.cts +2 -2
- package/cjs/hovercard/hovercard-description.d.ts +2 -2
- package/cjs/hovercard/hovercard-disclosure.cjs +6 -6
- package/cjs/hovercard/hovercard-disclosure.d.cts +1 -1
- package/cjs/hovercard/hovercard-disclosure.d.ts +1 -1
- package/cjs/hovercard/hovercard-dismiss.cjs +7 -7
- package/cjs/hovercard/hovercard-dismiss.d.cts +3 -2
- package/cjs/hovercard/hovercard-dismiss.d.ts +3 -2
- package/cjs/hovercard/hovercard-heading.d.cts +2 -2
- package/cjs/hovercard/hovercard-heading.d.ts +2 -2
- package/cjs/hovercard/hovercard-provider.d.cts +2 -1
- package/cjs/hovercard/hovercard-provider.d.ts +2 -1
- package/cjs/hovercard/hovercard-store.d.cts +2 -1
- package/cjs/hovercard/hovercard-store.d.ts +2 -1
- package/cjs/hovercard/hovercard.cjs +8 -8
- package/cjs/hovercard/hovercard.d.cts +20 -8
- package/cjs/hovercard/hovercard.d.ts +20 -8
- package/cjs/menu/menu-arrow.d.cts +4 -2
- package/cjs/menu/menu-arrow.d.ts +4 -2
- package/cjs/menu/menu-bar.cjs +4 -4
- package/cjs/menu/menu-bar.d.cts +1 -2
- package/cjs/menu/menu-bar.d.ts +1 -2
- package/cjs/menu/menu-button-arrow.d.cts +9 -4
- package/cjs/menu/menu-button-arrow.d.ts +9 -4
- package/cjs/menu/menu-button.cjs +9 -9
- package/cjs/menu/menu-button.d.cts +8 -7
- package/cjs/menu/menu-button.d.ts +8 -7
- package/cjs/menu/menu-description.d.cts +2 -2
- package/cjs/menu/menu-description.d.ts +2 -2
- package/cjs/menu/menu-dismiss.cjs +7 -7
- package/cjs/menu/menu-dismiss.d.cts +3 -2
- package/cjs/menu/menu-dismiss.d.ts +3 -2
- package/cjs/menu/menu-group-label.d.cts +4 -4
- package/cjs/menu/menu-group-label.d.ts +4 -4
- package/cjs/menu/menu-group.d.cts +5 -2
- package/cjs/menu/menu-group.d.ts +5 -2
- package/cjs/menu/menu-heading.d.cts +3 -2
- package/cjs/menu/menu-heading.d.ts +3 -2
- package/cjs/menu/menu-item-check.d.cts +10 -18
- package/cjs/menu/menu-item-check.d.ts +10 -18
- package/cjs/menu/menu-item-checkbox.cjs +9 -9
- package/cjs/menu/menu-item-checkbox.d.cts +38 -6
- package/cjs/menu/menu-item-checkbox.d.ts +38 -6
- package/cjs/menu/menu-item-radio.cjs +7 -7
- package/cjs/menu/menu-item-radio.d.cts +21 -9
- package/cjs/menu/menu-item-radio.d.ts +21 -9
- package/cjs/menu/menu-item.cjs +5 -5
- package/cjs/menu/menu-item.d.cts +10 -11
- package/cjs/menu/menu-item.d.ts +10 -11
- package/cjs/menu/menu-list.cjs +4 -4
- package/cjs/menu/menu-list.d.cts +7 -2
- package/cjs/menu/menu-list.d.ts +7 -2
- package/cjs/menu/menu-provider.d.cts +2 -1
- package/cjs/menu/menu-provider.d.ts +2 -1
- package/cjs/menu/menu-separator.d.cts +5 -2
- package/cjs/menu/menu-separator.d.ts +5 -2
- package/cjs/menu/menu-store.d.cts +18 -7
- package/cjs/menu/menu-store.d.ts +18 -7
- package/cjs/menu/menu.cjs +12 -12
- package/cjs/menu/menu.d.cts +8 -2
- package/cjs/menu/menu.d.ts +8 -2
- package/cjs/menubar/menubar-provider.d.cts +2 -1
- package/cjs/menubar/menubar-provider.d.ts +2 -1
- package/cjs/menubar/menubar-store.d.cts +3 -1
- package/cjs/menubar/menubar-store.d.ts +3 -1
- package/cjs/menubar/menubar.cjs +4 -4
- package/cjs/menubar/menubar.d.cts +3 -2
- package/cjs/menubar/menubar.d.ts +3 -2
- package/cjs/popover/popover-anchor.d.cts +4 -3
- package/cjs/popover/popover-anchor.d.ts +4 -3
- package/cjs/popover/popover-arrow.d.cts +6 -2
- package/cjs/popover/popover-arrow.d.ts +6 -2
- package/cjs/popover/popover-description.d.cts +1 -1
- package/cjs/popover/popover-description.d.ts +1 -1
- package/cjs/popover/popover-disclosure-arrow.d.cts +6 -4
- package/cjs/popover/popover-disclosure-arrow.d.ts +6 -4
- package/cjs/popover/popover-disclosure.cjs +7 -7
- package/cjs/popover/popover-disclosure.d.cts +3 -2
- package/cjs/popover/popover-disclosure.d.ts +3 -2
- package/cjs/popover/popover-dismiss.cjs +6 -6
- package/cjs/popover/popover-dismiss.d.cts +1 -1
- package/cjs/popover/popover-dismiss.d.ts +1 -1
- package/cjs/popover/popover-heading.d.cts +1 -1
- package/cjs/popover/popover-heading.d.ts +1 -1
- package/cjs/popover/popover-provider.d.cts +2 -1
- package/cjs/popover/popover-provider.d.ts +2 -1
- package/cjs/popover/popover-store.d.cts +2 -1
- package/cjs/popover/popover-store.d.ts +2 -1
- package/cjs/popover/popover.cjs +7 -7
- package/cjs/popover/popover.d.cts +8 -3
- package/cjs/popover/popover.d.ts +8 -3
- package/cjs/portal/portal.d.cts +18 -1
- package/cjs/portal/portal.d.ts +18 -1
- package/cjs/radio/radio-group.cjs +3 -3
- package/cjs/radio/radio-group.d.cts +8 -6
- package/cjs/radio/radio-group.d.ts +8 -6
- package/cjs/radio/radio-provider.d.cts +2 -1
- package/cjs/radio/radio-provider.d.ts +2 -1
- package/cjs/radio/radio-store.d.cts +6 -2
- package/cjs/radio/radio-store.d.ts +6 -2
- package/cjs/radio/radio.cjs +5 -5
- package/cjs/radio/radio.d.cts +21 -13
- package/cjs/radio/radio.d.ts +21 -13
- package/cjs/role/role.d.cts +3 -3
- package/cjs/role/role.d.ts +3 -3
- package/cjs/select/select-group-label.d.cts +2 -2
- package/cjs/select/select-group-label.d.ts +2 -2
- package/cjs/select/select-group.d.cts +4 -1
- package/cjs/select/select-group.d.ts +4 -1
- package/cjs/select/select-item-check.d.cts +9 -15
- package/cjs/select/select-item-check.d.ts +9 -15
- package/cjs/select/select-item.cjs +4 -4
- package/cjs/select/select-item.d.cts +1 -5
- package/cjs/select/select-item.d.ts +1 -5
- package/cjs/select/select-list.cjs +4 -4
- package/cjs/select/select-list.d.cts +7 -4
- package/cjs/select/select-list.d.ts +7 -4
- package/cjs/select/select-popover.cjs +11 -11
- package/cjs/select/select-provider.d.cts +2 -1
- package/cjs/select/select-provider.d.ts +2 -1
- package/cjs/select/select-renderer.d.cts +1 -1
- package/cjs/select/select-renderer.d.ts +1 -1
- package/cjs/select/select-row.d.cts +4 -1
- package/cjs/select/select-row.d.ts +4 -1
- package/cjs/select/select-separator.d.cts +2 -1
- package/cjs/select/select-separator.d.ts +2 -1
- package/cjs/select/select-store.d.cts +17 -10
- package/cjs/select/select-store.d.ts +17 -10
- package/cjs/select/select.cjs +15 -13
- package/cjs/select/select.d.cts +25 -15
- package/cjs/select/select.d.ts +25 -15
- package/cjs/tab/tab-list.cjs +3 -3
- package/cjs/tab/tab-list.d.cts +2 -1
- package/cjs/tab/tab-list.d.ts +2 -1
- package/cjs/tab/tab-panel.cjs +2 -2
- package/cjs/tab/tab-panel.d.cts +19 -3
- package/cjs/tab/tab-panel.d.ts +19 -3
- package/cjs/tab/tab-provider.d.cts +1 -1
- package/cjs/tab/tab-provider.d.ts +1 -1
- package/cjs/tab/tab-store.d.cts +3 -1
- package/cjs/tab/tab-store.d.ts +3 -1
- package/cjs/tab/tab.cjs +4 -4
- package/cjs/tab/tab.d.cts +2 -2
- package/cjs/tab/tab.d.ts +2 -2
- package/cjs/toolbar/toolbar-container.cjs +5 -5
- package/cjs/toolbar/toolbar-container.d.cts +1 -1
- package/cjs/toolbar/toolbar-container.d.ts +1 -1
- package/cjs/toolbar/toolbar-input.cjs +5 -5
- package/cjs/toolbar/toolbar-input.d.cts +2 -1
- package/cjs/toolbar/toolbar-input.d.ts +2 -1
- package/cjs/toolbar/toolbar-item.cjs +5 -5
- package/cjs/toolbar/toolbar-item.d.cts +2 -1
- package/cjs/toolbar/toolbar-item.d.ts +2 -1
- package/cjs/toolbar/toolbar-provider.d.cts +2 -1
- package/cjs/toolbar/toolbar-provider.d.ts +2 -1
- package/cjs/toolbar/toolbar-separator.d.cts +2 -1
- package/cjs/toolbar/toolbar-separator.d.ts +2 -1
- package/cjs/toolbar/toolbar-store.d.cts +3 -1
- package/cjs/toolbar/toolbar-store.d.ts +3 -1
- package/cjs/toolbar/toolbar.cjs +3 -3
- package/cjs/tooltip/tooltip-anchor.cjs +3 -3
- package/cjs/tooltip/tooltip-anchor.d.cts +3 -3
- package/cjs/tooltip/tooltip-anchor.d.ts +3 -3
- package/cjs/tooltip/tooltip-arrow.d.cts +1 -1
- package/cjs/tooltip/tooltip-arrow.d.ts +1 -1
- package/cjs/tooltip/tooltip-provider.d.cts +2 -1
- package/cjs/tooltip/tooltip-provider.d.ts +2 -1
- package/cjs/tooltip/tooltip-store.d.cts +3 -1
- package/cjs/tooltip/tooltip-store.d.ts +3 -1
- package/cjs/tooltip/tooltip.cjs +9 -9
- package/cjs/tooltip/tooltip.d.cts +3 -1
- package/cjs/tooltip/tooltip.d.ts +3 -1
- package/esm/__chunks/{7QTPYGNZ.js → 2P5JZHCE.js} +1 -1
- package/esm/__chunks/{FS2EVEJO.js → 4GO43MST.js} +8 -8
- package/esm/__chunks/{Y6467XPW.js → 53AZXSRJ.js} +1 -1
- package/esm/__chunks/{KK7H3W2B.js → 54DTKZT5.js} +1 -1
- package/esm/__chunks/{A6XC27R5.js → A2OYJMGS.js} +1 -1
- package/esm/__chunks/{NWCBQ4CV.js → BVNGIDQK.js} +1 -1
- package/esm/__chunks/{BHEJ6NUH.js → CM2MGWJJ.js} +1 -1
- package/esm/__chunks/{7NHUGSTF.js → E7J4UKND.js} +1 -1
- package/esm/__chunks/{EPBRINPG.js → EWG7ZSIX.js} +2 -2
- package/esm/__chunks/{3AHQ6JCP.js → H5L25YOA.js} +1 -1
- package/esm/__chunks/{NKXUN25E.js → H67RUTIW.js} +1 -1
- package/esm/__chunks/{7X4DYKYU.js → HKLZHXNQ.js} +1 -1
- package/esm/__chunks/{VDNZBO4W.js → JH4A3V7P.js} +1 -1
- package/esm/__chunks/{F6PRXTDU.js → O4GQD6D6.js} +1 -1
- package/esm/__chunks/{SU2GU5JB.js → OYQPK2TA.js} +1 -1
- package/esm/__chunks/{4ZEZYKUR.js → PHR7QED4.js} +1 -1
- package/esm/__chunks/{H3TG2CZP.js → PUBUTPR6.js} +1 -1
- package/esm/__chunks/{PGAEII2Q.js → SNX6RSV7.js} +5 -5
- package/esm/__chunks/{FGMA3QUS.js → ST3UVMBD.js} +1 -1
- package/esm/__chunks/{ZEXNX5JH.js → U5OL5Z27.js} +1 -1
- package/esm/__chunks/{UK7JL7PY.js → VR7H4JAI.js} +1 -1
- package/esm/__chunks/{QZLXIDNP.js → W7TET3D7.js} +1 -1
- package/esm/__chunks/{HHNFDKU2.js → WVGRWYXJ.js} +1 -1
- package/esm/__chunks/{JL6IRDFK.js → ZICNKKFD.js} +1 -1
- package/esm/button/button.d.ts +1 -1
- package/esm/button/button.js +3 -3
- package/esm/checkbox/checkbox-check.d.ts +17 -9
- package/esm/checkbox/checkbox-provider.d.ts +4 -2
- package/esm/checkbox/checkbox-provider.js +3 -3
- package/esm/checkbox/checkbox-store.d.ts +5 -3
- package/esm/checkbox/checkbox.d.ts +14 -9
- package/esm/checkbox/checkbox.js +3 -3
- package/esm/collection/collection-item.d.ts +23 -9
- package/esm/collection/collection-provider.d.ts +2 -1
- package/esm/collection/collection-renderer.d.ts +1 -1
- package/esm/collection/collection-store.d.ts +6 -3
- package/esm/collection/collection.d.ts +4 -3
- package/esm/combobox/combobox-cancel.d.ts +3 -2
- package/esm/combobox/combobox-cancel.js +3 -3
- package/esm/combobox/combobox-disclosure.d.ts +7 -2
- package/esm/combobox/combobox-disclosure.js +5 -5
- package/esm/combobox/combobox-group-label.d.ts +4 -4
- package/esm/combobox/combobox-group.d.ts +7 -3
- package/esm/combobox/combobox-item-check.d.ts +9 -16
- package/esm/combobox/combobox-item-value.d.ts +13 -8
- package/esm/combobox/combobox-item.d.ts +11 -9
- package/esm/combobox/combobox-item.js +3 -3
- package/esm/combobox/combobox-list.d.ts +1 -4
- package/esm/combobox/combobox-list.js +2 -2
- package/esm/combobox/combobox-popover.d.ts +2 -3
- package/esm/combobox/combobox-popover.js +7 -7
- package/esm/combobox/combobox-provider.d.ts +2 -1
- package/esm/combobox/combobox-row.d.ts +6 -3
- package/esm/combobox/combobox-separator.d.ts +4 -3
- package/esm/combobox/combobox-store.d.ts +11 -7
- package/esm/combobox/combobox.d.ts +45 -33
- package/esm/combobox/combobox.js +2 -2
- package/esm/command/command.d.ts +1 -1
- package/esm/command/command.js +2 -2
- package/esm/composite/composite-container.d.ts +18 -11
- package/esm/composite/composite-group-label.d.ts +18 -13
- package/esm/composite/composite-group.d.ts +20 -12
- package/esm/composite/composite-hover.d.ts +17 -8
- package/esm/composite/composite-input.d.ts +15 -9
- package/esm/composite/composite-item.d.ts +49 -9
- package/esm/composite/composite-item.js +3 -3
- package/esm/composite/composite-overflow-disclosure.js +7 -7
- package/esm/composite/composite-overflow.js +6 -6
- package/esm/composite/composite-provider.d.ts +2 -1
- package/esm/composite/composite-renderer.d.ts +1 -1
- package/esm/composite/composite-row.d.ts +26 -19
- package/esm/composite/composite-separator.d.ts +23 -10
- package/esm/composite/composite-store.d.ts +3 -1
- package/esm/composite/composite-typeahead.d.ts +20 -8
- package/esm/composite/composite.d.ts +65 -10
- package/esm/composite/composite.js +2 -2
- package/esm/dialog/dialog-disclosure.d.ts +2 -1
- package/esm/dialog/dialog-disclosure.js +5 -5
- package/esm/dialog/dialog-dismiss.d.ts +2 -1
- package/esm/dialog/dialog-dismiss.js +4 -4
- package/esm/dialog/dialog-provider.d.ts +2 -1
- package/esm/dialog/dialog-store.d.ts +3 -1
- package/esm/dialog/dialog.d.ts +51 -20
- package/esm/dialog/dialog.js +5 -5
- package/esm/dialog/utils/disable-tree.js +2 -2
- package/esm/dialog/utils/use-hide-on-interact-outside.js +1 -1
- package/esm/disclosure/disclosure-content.d.ts +6 -5
- package/esm/disclosure/disclosure-provider.d.ts +2 -1
- package/esm/disclosure/disclosure-store.d.ts +6 -4
- package/esm/disclosure/disclosure.d.ts +3 -2
- package/esm/disclosure/disclosure.js +4 -4
- package/esm/focus-trap/focus-trap-region.d.ts +4 -2
- package/esm/focusable/focusable-container.d.ts +7 -5
- package/esm/focusable/focusable.d.ts +5 -2
- package/esm/focusable/focusable.js +1 -1
- package/esm/form/form-checkbox.d.ts +6 -4
- package/esm/form/form-checkbox.js +9 -9
- package/esm/form/form-control.d.ts +93 -0
- package/esm/form/form-control.js +16 -0
- package/esm/form/form-description.d.ts +14 -3
- package/esm/form/form-error.d.ts +11 -4
- package/esm/form/form-field.d.ts +16 -30
- package/esm/form/form-field.js +19 -4
- package/esm/form/form-group-label.d.ts +6 -4
- package/esm/form/form-group.d.ts +6 -2
- package/esm/form/form-input.d.ts +7 -6
- package/esm/form/form-input.js +4 -4
- package/esm/form/form-label.d.ts +18 -7
- package/esm/form/form-provider.d.ts +2 -1
- package/esm/form/form-push.d.ts +17 -3
- package/esm/form/form-push.js +3 -3
- package/esm/form/form-radio-group.d.ts +7 -2
- package/esm/form/form-radio.d.ts +8 -4
- package/esm/form/form-radio.js +7 -7
- package/esm/form/form-remove.d.ts +17 -2
- package/esm/form/form-remove.js +3 -3
- package/esm/form/form-reset.d.ts +5 -2
- package/esm/form/form-reset.js +3 -3
- package/esm/form/form-store.d.ts +31 -14
- package/esm/form/form-submit.d.ts +8 -2
- package/esm/form/form-submit.js +3 -3
- package/esm/form/form.d.ts +37 -11
- package/esm/group/group-label.d.ts +3 -2
- package/esm/group/group.d.ts +3 -1
- package/esm/heading/heading-level.d.ts +4 -2
- package/esm/heading/heading.d.ts +4 -3
- package/esm/hovercard/hovercard-anchor.d.ts +5 -2
- package/esm/hovercard/hovercard-anchor.js +2 -2
- package/esm/hovercard/hovercard-arrow.d.ts +4 -2
- package/esm/hovercard/hovercard-description.d.ts +2 -2
- package/esm/hovercard/hovercard-disclosure.d.ts +1 -1
- package/esm/hovercard/hovercard-disclosure.js +5 -5
- package/esm/hovercard/hovercard-dismiss.d.ts +3 -2
- package/esm/hovercard/hovercard-dismiss.js +6 -6
- package/esm/hovercard/hovercard-heading.d.ts +2 -2
- package/esm/hovercard/hovercard-provider.d.ts +2 -1
- package/esm/hovercard/hovercard-store.d.ts +2 -1
- package/esm/hovercard/hovercard.d.ts +20 -8
- package/esm/hovercard/hovercard.js +7 -7
- package/esm/menu/menu-arrow.d.ts +4 -2
- package/esm/menu/menu-bar.d.ts +1 -2
- package/esm/menu/menu-bar.js +3 -3
- package/esm/menu/menu-button-arrow.d.ts +9 -4
- package/esm/menu/menu-button.d.ts +8 -7
- package/esm/menu/menu-button.js +7 -7
- package/esm/menu/menu-description.d.ts +2 -2
- package/esm/menu/menu-dismiss.d.ts +3 -2
- package/esm/menu/menu-dismiss.js +6 -6
- package/esm/menu/menu-group-label.d.ts +4 -4
- package/esm/menu/menu-group.d.ts +5 -2
- package/esm/menu/menu-heading.d.ts +3 -2
- package/esm/menu/menu-item-check.d.ts +10 -18
- package/esm/menu/menu-item-checkbox.d.ts +38 -6
- package/esm/menu/menu-item-checkbox.js +8 -8
- package/esm/menu/menu-item-radio.d.ts +21 -9
- package/esm/menu/menu-item-radio.js +5 -5
- package/esm/menu/menu-item.d.ts +10 -11
- package/esm/menu/menu-item.js +4 -4
- package/esm/menu/menu-list.d.ts +7 -2
- package/esm/menu/menu-list.js +3 -3
- package/esm/menu/menu-provider.d.ts +2 -1
- package/esm/menu/menu-separator.d.ts +5 -2
- package/esm/menu/menu-store.d.ts +18 -7
- package/esm/menu/menu.d.ts +8 -2
- package/esm/menu/menu.js +9 -9
- package/esm/menubar/menubar-provider.d.ts +2 -1
- package/esm/menubar/menubar-store.d.ts +3 -1
- package/esm/menubar/menubar.d.ts +3 -2
- package/esm/menubar/menubar.js +3 -3
- package/esm/popover/popover-anchor.d.ts +4 -3
- package/esm/popover/popover-arrow.d.ts +6 -2
- package/esm/popover/popover-description.d.ts +1 -1
- package/esm/popover/popover-disclosure-arrow.d.ts +6 -4
- package/esm/popover/popover-disclosure.d.ts +3 -2
- package/esm/popover/popover-disclosure.js +6 -6
- package/esm/popover/popover-dismiss.d.ts +1 -1
- package/esm/popover/popover-dismiss.js +5 -5
- package/esm/popover/popover-heading.d.ts +1 -1
- package/esm/popover/popover-provider.d.ts +2 -1
- package/esm/popover/popover-store.d.ts +2 -1
- package/esm/popover/popover.d.ts +8 -3
- package/esm/popover/popover.js +6 -6
- package/esm/portal/portal.d.ts +18 -1
- package/esm/radio/radio-group.d.ts +8 -6
- package/esm/radio/radio-group.js +2 -2
- package/esm/radio/radio-provider.d.ts +2 -1
- package/esm/radio/radio-store.d.ts +6 -2
- package/esm/radio/radio.d.ts +21 -13
- package/esm/radio/radio.js +4 -4
- package/esm/role/role.d.ts +3 -3
- package/esm/select/select-group-label.d.ts +2 -2
- package/esm/select/select-group.d.ts +4 -1
- package/esm/select/select-item-check.d.ts +9 -15
- package/esm/select/select-item.d.ts +1 -5
- package/esm/select/select-item.js +3 -3
- package/esm/select/select-list.d.ts +7 -4
- package/esm/select/select-list.js +3 -3
- package/esm/select/select-popover.js +8 -8
- package/esm/select/select-provider.d.ts +2 -1
- package/esm/select/select-renderer.d.ts +1 -1
- package/esm/select/select-row.d.ts +4 -1
- package/esm/select/select-separator.d.ts +2 -1
- package/esm/select/select-store.d.ts +17 -10
- package/esm/select/select.d.ts +25 -15
- package/esm/select/select.js +14 -12
- package/esm/tab/tab-list.d.ts +2 -1
- package/esm/tab/tab-list.js +2 -2
- package/esm/tab/tab-panel.d.ts +19 -3
- package/esm/tab/tab-panel.js +1 -1
- package/esm/tab/tab-provider.d.ts +1 -1
- package/esm/tab/tab-store.d.ts +3 -1
- package/esm/tab/tab.d.ts +2 -2
- package/esm/tab/tab.js +3 -3
- package/esm/toolbar/toolbar-container.d.ts +1 -1
- package/esm/toolbar/toolbar-container.js +4 -4
- package/esm/toolbar/toolbar-input.d.ts +2 -1
- package/esm/toolbar/toolbar-input.js +4 -4
- package/esm/toolbar/toolbar-item.d.ts +2 -1
- package/esm/toolbar/toolbar-item.js +4 -4
- package/esm/toolbar/toolbar-provider.d.ts +2 -1
- package/esm/toolbar/toolbar-separator.d.ts +2 -1
- package/esm/toolbar/toolbar-store.d.ts +3 -1
- package/esm/toolbar/toolbar.js +2 -2
- package/esm/tooltip/tooltip-anchor.d.ts +3 -3
- package/esm/tooltip/tooltip-anchor.js +2 -2
- package/esm/tooltip/tooltip-arrow.d.ts +1 -1
- package/esm/tooltip/tooltip-provider.d.ts +2 -1
- package/esm/tooltip/tooltip-store.d.ts +3 -1
- package/esm/tooltip/tooltip.d.ts +3 -1
- package/esm/tooltip/tooltip.js +7 -7
- package/form/form-control/package.json +8 -0
- package/package.json +9 -2
- package/cjs/__chunks/{NKR65BKC.cjs → KSPMHEYZ.cjs} +3 -3
- package/esm/__chunks/{CLF4PQ7T.js → TQYOGOE2.js} +3 -3
package/esm/form/form-field.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import type { FocusEvent } from "react";
|
|
2
|
-
import type { StringLike } from "@ariakit/core/form/types";
|
|
3
|
-
import type { BooleanOrCallback } from "@ariakit/core/utils/types";
|
|
4
|
-
import type { CollectionItemOptions } from "../collection/collection-item.js";
|
|
5
1
|
import type { As, Props } from "../utils/types.js";
|
|
6
|
-
import type {
|
|
2
|
+
import type { FormControlOptions } from "./form-control.js";
|
|
7
3
|
/**
|
|
8
4
|
* Returns props to create a `FormField` component. Unlike `useFormInput`, this
|
|
9
5
|
* hook doesn't automatically returns the `value` and `onChange` props. This is
|
|
10
6
|
* so we can use it not only for native form elements but also for custom
|
|
11
7
|
* components whose value is not controlled by the native `value` and `onChange`
|
|
12
8
|
* props.
|
|
13
|
-
* @
|
|
9
|
+
* @deprecated Use `useFormControl` instead.
|
|
14
10
|
* @example
|
|
15
11
|
* ```jsx
|
|
16
12
|
* const store = useFormStore({ defaultValues: { content: "" } });
|
|
@@ -30,15 +26,18 @@ import type { FormStore } from "./form-store.js";
|
|
|
30
26
|
*/
|
|
31
27
|
export declare const useFormField: import("../utils/types.js").Hook<FormFieldOptions<"input">>;
|
|
32
28
|
/**
|
|
33
|
-
*
|
|
29
|
+
* Abstract component that renders a form field. Unlike
|
|
34
30
|
* [`FormInput`](https://ariakit.org/reference/form-input), this component
|
|
35
31
|
* doesn't automatically pass the `value` and `onChange` props down to the
|
|
36
32
|
* underlying element. This is so we can use it not only for native form
|
|
37
33
|
* elements but also for custom components whose value is not controlled by the
|
|
38
34
|
* native `value` and `onChange` props.
|
|
39
|
-
* @
|
|
35
|
+
* @deprecated
|
|
36
|
+
* This component has been renamed to
|
|
37
|
+
* [`FormControl`](https://ariakit.org/reference/form-control). The API remains
|
|
38
|
+
* the same.
|
|
40
39
|
* @example
|
|
41
|
-
* ```jsx
|
|
40
|
+
* ```jsx {11-19}
|
|
42
41
|
* const form = useFormStore({
|
|
43
42
|
* defaultValues: {
|
|
44
43
|
* content: "",
|
|
@@ -50,31 +49,18 @@ export declare const useFormField: import("../utils/types.js").Hook<FormFieldOpt
|
|
|
50
49
|
* <Form store={form}>
|
|
51
50
|
* <FormLabel name={form.names.content}>Content</FormLabel>
|
|
52
51
|
* <FormField
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
52
|
+
* name={form.names.content}
|
|
53
|
+
* render={
|
|
54
|
+
* <Editor
|
|
55
|
+
* value={value}
|
|
56
|
+
* onChange={(value) => form.setValue(form.names.content, value)}
|
|
57
|
+
* />
|
|
58
|
+
* }
|
|
56
59
|
* />
|
|
57
60
|
* </Form>
|
|
58
61
|
* ```
|
|
59
62
|
*/
|
|
60
63
|
export declare const FormField: import("../utils/types.js").Component<FormFieldOptions<"input">>;
|
|
61
|
-
export interface FormFieldOptions<T extends As = "input"> extends
|
|
62
|
-
/**
|
|
63
|
-
* Object returned by the
|
|
64
|
-
* [`useFormStore`](https://ariakit.org/reference/use-form-store) hook. If not
|
|
65
|
-
* provided, the closest [`Form`](https://ariakit.org/reference/form) or
|
|
66
|
-
* [`FormProvider`](https://ariakit.org/reference/form-provider) components'
|
|
67
|
-
* context will be used.
|
|
68
|
-
*/
|
|
69
|
-
store?: FormStore;
|
|
70
|
-
/**
|
|
71
|
-
* Name of the field.
|
|
72
|
-
*/
|
|
73
|
-
name: StringLike;
|
|
74
|
-
/**
|
|
75
|
-
* Whether the field should be marked touched on blur.
|
|
76
|
-
* @default true
|
|
77
|
-
*/
|
|
78
|
-
touchOnBlur?: BooleanOrCallback<FocusEvent>;
|
|
64
|
+
export interface FormFieldOptions<T extends As = "input"> extends FormControlOptions<T> {
|
|
79
65
|
}
|
|
80
66
|
export type FormFieldProps<T extends As = "input"> = Props<FormFieldOptions<T>>;
|
package/esm/form/form-field.js
CHANGED
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "../__chunks/FS2EVEJO.js";
|
|
3
|
+
useFormControl
|
|
4
|
+
} from "../__chunks/4GO43MST.js";
|
|
6
5
|
import "../__chunks/V4ZFXDFK.js";
|
|
7
6
|
import "../__chunks/UH3I23HL.js";
|
|
8
7
|
import "../__chunks/4UUKJZ4V.js";
|
|
9
|
-
import
|
|
8
|
+
import {
|
|
9
|
+
createElement,
|
|
10
|
+
createHook,
|
|
11
|
+
createMemoComponent
|
|
12
|
+
} from "../__chunks/3ORBWXWF.js";
|
|
10
13
|
import "../__chunks/6O5OEQGF.js";
|
|
11
14
|
import "../__chunks/XM66DUTO.js";
|
|
12
15
|
import "../__chunks/4R3V3JGP.js";
|
|
16
|
+
|
|
17
|
+
// src/form/form-field.ts
|
|
18
|
+
var useFormField = createHook((props) => {
|
|
19
|
+
return useFormControl(props);
|
|
20
|
+
});
|
|
21
|
+
var FormField = createMemoComponent((props) => {
|
|
22
|
+
const htmlProps = useFormField(props);
|
|
23
|
+
return createElement("input", htmlProps);
|
|
24
|
+
});
|
|
25
|
+
if (process.env.NODE_ENV !== "production") {
|
|
26
|
+
FormField.displayName = "FormField";
|
|
27
|
+
}
|
|
13
28
|
export {
|
|
14
29
|
FormField,
|
|
15
30
|
useFormField
|
|
@@ -15,18 +15,20 @@ import type { FormStore } from "./form-store.js";
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const useFormGroupLabel: import("../utils/types.js").Hook<FormGroupLabelOptions<"div">>;
|
|
17
17
|
/**
|
|
18
|
-
* Renders a label in a form group. This component must be wrapped with
|
|
19
|
-
* [`FormGroup`](https://ariakit.org/reference/form-group)
|
|
20
|
-
* `
|
|
18
|
+
* Renders a label in a form group. This component must be wrapped with the
|
|
19
|
+
* [`FormGroup`](https://ariakit.org/reference/form-group) or
|
|
20
|
+
* [`FormRadioGroup`](https://ariakit.org/reference/form-radio-group) components
|
|
21
|
+
* so the `aria-labelledby` prop is properly set on the form group element.
|
|
21
22
|
* @see https://ariakit.org/components/form
|
|
22
23
|
* @example
|
|
23
|
-
* ```jsx
|
|
24
|
+
* ```jsx {10}
|
|
24
25
|
* const form = useFormStore({
|
|
25
26
|
* defaultValues: {
|
|
26
27
|
* username: "",
|
|
27
28
|
* email: "",
|
|
28
29
|
* },
|
|
29
30
|
* });
|
|
31
|
+
*
|
|
30
32
|
* <Form store={form}>
|
|
31
33
|
* <FormGroup>
|
|
32
34
|
* <FormGroupLabel>Account</FormGroupLabel>
|
package/esm/form/form-group.d.ts
CHANGED
|
@@ -17,16 +17,20 @@ import type { FormStore } from "./form-store.js";
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const useFormGroup: import("../utils/types.js").Hook<FormGroupOptions<"div">>;
|
|
19
19
|
/**
|
|
20
|
-
* Renders a form
|
|
20
|
+
* Renders a group element for form controls. The
|
|
21
|
+
* [`FormGroupLabel`](https://ariakit.org/reference/form-group-label) component
|
|
22
|
+
* can be used inside this component so the `aria-labelledby` prop is properly
|
|
23
|
+
* set on the group element.
|
|
21
24
|
* @see https://ariakit.org/components/form
|
|
22
25
|
* @example
|
|
23
|
-
* ```jsx
|
|
26
|
+
* ```jsx {9-15}
|
|
24
27
|
* const form = useFormStore({
|
|
25
28
|
* defaultValues: {
|
|
26
29
|
* username: "",
|
|
27
30
|
* email: "",
|
|
28
31
|
* },
|
|
29
32
|
* });
|
|
33
|
+
*
|
|
30
34
|
* <Form store={form}>
|
|
31
35
|
* <FormGroup>
|
|
32
36
|
* <FormGroupLabel>Account</FormGroupLabel>
|
package/esm/form/form-input.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { FocusableOptions } from "../focusable/focusable.js";
|
|
2
2
|
import type { As, Props } from "../utils/types.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { FormControlOptions } from "./form-control.js";
|
|
4
4
|
/**
|
|
5
|
-
* Returns props to create a `FormInput` component. Unlike `
|
|
5
|
+
* Returns props to create a `FormInput` component. Unlike `useFormControl`, this
|
|
6
6
|
* hook returns the `value` and `onChange` props that can be passed to a native
|
|
7
7
|
* input, select or textarea elements.
|
|
8
8
|
* @see https://ariakit.org/components/form
|
|
@@ -19,17 +19,18 @@ import type { FormFieldOptions } from "./form-field.js";
|
|
|
19
19
|
export declare const useFormInput: import("../utils/types.js").Hook<FormInputOptions<"input">>;
|
|
20
20
|
/**
|
|
21
21
|
* Renders a form input. Unlike
|
|
22
|
-
* [`
|
|
22
|
+
* [`FormControl`](https://ariakit.org/reference/form-control), this component
|
|
23
23
|
* passes the `value` and `onChange` props down to the underlying element that
|
|
24
|
-
* can be
|
|
24
|
+
* can be native input, select or textarea elements.
|
|
25
25
|
* @see https://ariakit.org/components/form
|
|
26
26
|
* @example
|
|
27
|
-
* ```jsx
|
|
27
|
+
* ```jsx {9}
|
|
28
28
|
* const form = useFormStore({
|
|
29
29
|
* defaultValues: {
|
|
30
30
|
* email: "",
|
|
31
31
|
* },
|
|
32
32
|
* });
|
|
33
|
+
*
|
|
33
34
|
* <Form store={form}>
|
|
34
35
|
* <FormLabel name={form.names.email}>Email</FormLabel>
|
|
35
36
|
* <FormInput name={form.names.email} />
|
|
@@ -37,6 +38,6 @@ export declare const useFormInput: import("../utils/types.js").Hook<FormInputOpt
|
|
|
37
38
|
* ```
|
|
38
39
|
*/
|
|
39
40
|
export declare const FormInput: import("../utils/types.js").Component<FormInputOptions<"input">>;
|
|
40
|
-
export interface FormInputOptions<T extends As = "input"> extends
|
|
41
|
+
export interface FormInputOptions<T extends As = "input"> extends FormControlOptions<T>, FocusableOptions<T> {
|
|
41
42
|
}
|
|
42
43
|
export type FormInputProps<T extends As = "input"> = Props<FormInputOptions<T>>;
|
package/esm/form/form-input.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "../__chunks/
|
|
3
|
+
useFormControl
|
|
4
|
+
} from "../__chunks/4GO43MST.js";
|
|
5
5
|
import {
|
|
6
6
|
useFormContext
|
|
7
7
|
} from "../__chunks/V4ZFXDFK.js";
|
|
@@ -9,7 +9,7 @@ import "../__chunks/UH3I23HL.js";
|
|
|
9
9
|
import "../__chunks/4UUKJZ4V.js";
|
|
10
10
|
import {
|
|
11
11
|
useFocusable
|
|
12
|
-
} from "../__chunks/
|
|
12
|
+
} from "../__chunks/54DTKZT5.js";
|
|
13
13
|
import "../__chunks/SHA3WOPI.js";
|
|
14
14
|
import {
|
|
15
15
|
createElement,
|
|
@@ -52,7 +52,7 @@ var useFormInput = createHook(
|
|
|
52
52
|
onChange
|
|
53
53
|
});
|
|
54
54
|
props = useFocusable(props);
|
|
55
|
-
props =
|
|
55
|
+
props = useFormControl(__spreadValues({ store, name }, props));
|
|
56
56
|
return props;
|
|
57
57
|
}
|
|
58
58
|
);
|
package/esm/form/form-label.d.ts
CHANGED
|
@@ -21,19 +21,23 @@ import type { FormStore } from "./form-store.js";
|
|
|
21
21
|
*/
|
|
22
22
|
export declare const useFormLabel: import("../utils/types.js").Hook<FormLabelOptions<"label">>;
|
|
23
23
|
/**
|
|
24
|
-
* Renders a label
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
24
|
+
* Renders a label associated with a form field, even if the field is not a
|
|
25
|
+
* native input.
|
|
26
|
+
*
|
|
27
|
+
* If the field is a native input, select or textarea element, this component
|
|
28
|
+
* will render a native `label` element and rely on its `htmlFor` prop.
|
|
29
|
+
* Otherwise, it'll render a `span` element and rely on the `aria-labelledby`
|
|
30
|
+
* attribute on the form field instead. Clicking on the label will move focus to
|
|
31
|
+
* the field even if it's not a native input.
|
|
29
32
|
* @see https://ariakit.org/components/form
|
|
30
33
|
* @example
|
|
31
|
-
* ```jsx
|
|
34
|
+
* ```jsx {8}
|
|
32
35
|
* const form = useFormStore({
|
|
33
36
|
* defaultValues: {
|
|
34
37
|
* email: "",
|
|
35
38
|
* },
|
|
36
39
|
* });
|
|
40
|
+
*
|
|
37
41
|
* <Form store={form}>
|
|
38
42
|
* <FormLabel name={form.names.email}>Email</Role>
|
|
39
43
|
* <FormInput name={form.names.email} />
|
|
@@ -51,7 +55,14 @@ export interface FormLabelOptions<T extends As = "label"> extends CollectionItem
|
|
|
51
55
|
*/
|
|
52
56
|
store?: FormStore;
|
|
53
57
|
/**
|
|
54
|
-
* Name of the field.
|
|
58
|
+
* Name of the field labeled by this element. This can either be a string or a
|
|
59
|
+
* reference to a field name from the
|
|
60
|
+
* [`names`](https://ariakit.org/reference/use-form-store#names) object in the
|
|
61
|
+
* store, for type safety.
|
|
62
|
+
* @example
|
|
63
|
+
* ```jsx
|
|
64
|
+
* <FormLabel name="email">Email</FormLabel>
|
|
65
|
+
* ```
|
|
55
66
|
*/
|
|
56
67
|
name: StringLike;
|
|
57
68
|
}
|
|
@@ -4,7 +4,8 @@ import type { PickRequired } from "@ariakit/core/utils/types";
|
|
|
4
4
|
import type { FormStoreProps } from "./form-store.js";
|
|
5
5
|
type Values = FormStoreValues;
|
|
6
6
|
/**
|
|
7
|
-
* Provides a form store to Form
|
|
7
|
+
* Provides a form store to [Form](https://ariakit.org/components/form)
|
|
8
|
+
* components.
|
|
8
9
|
* @see https://ariakit.org/components/form
|
|
9
10
|
* @example
|
|
10
11
|
* ```jsx
|
package/esm/form/form-push.d.ts
CHANGED
|
@@ -32,14 +32,25 @@ export declare const useFormPush: import("../utils/types.js").Hook<FormPushOptio
|
|
|
32
32
|
/**
|
|
33
33
|
* Renders a button that will push items to an array value in the form store
|
|
34
34
|
* when clicked.
|
|
35
|
+
*
|
|
36
|
+
* The [`name`](https://ariakit.org/reference/form-push#name) prop needs to be
|
|
37
|
+
* provided to identify the array field. The
|
|
38
|
+
* [`value`](https://ariakit.org/reference/form-push#value) prop is required to
|
|
39
|
+
* define the value that will be added to the array.
|
|
40
|
+
*
|
|
41
|
+
* By default, the newly added input will be automatically focused when the
|
|
42
|
+
* button is clicked unless the
|
|
43
|
+
* [`autoFocusOnClick`](https://ariakit.org/reference/form-push#autofocusonclick)
|
|
44
|
+
* prop is set to `false`.
|
|
35
45
|
* @see https://ariakit.org/components/form
|
|
36
46
|
* @example
|
|
37
|
-
* ```jsx
|
|
47
|
+
* ```jsx {13-15}
|
|
38
48
|
* const form = useFormStore({
|
|
39
49
|
* defaultValues: {
|
|
40
50
|
* languages: ["JavaScript", "PHP"],
|
|
41
51
|
* },
|
|
42
52
|
* });
|
|
53
|
+
*
|
|
43
54
|
* const values = form.useState("values");
|
|
44
55
|
*
|
|
45
56
|
* <Form store={form}>
|
|
@@ -63,11 +74,14 @@ export interface FormPushOptions<T extends As = "button"> extends ButtonOptions<
|
|
|
63
74
|
*/
|
|
64
75
|
store?: FormStore;
|
|
65
76
|
/**
|
|
66
|
-
* Name of the array field.
|
|
77
|
+
* Name of the array field. This can either be a string or a reference to a
|
|
78
|
+
* field name from the
|
|
79
|
+
* [`names`](https://ariakit.org/reference/use-form-store#names) object in the
|
|
80
|
+
* store, for type safety.
|
|
67
81
|
*/
|
|
68
82
|
name: StringLike;
|
|
69
83
|
/**
|
|
70
|
-
* Value that will be
|
|
84
|
+
* Value that will initially be assigned to the array item when it's pushed.
|
|
71
85
|
*/
|
|
72
86
|
value: unknown;
|
|
73
87
|
/**
|
package/esm/form/form-push.js
CHANGED
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "../__chunks/V4ZFXDFK.js";
|
|
5
5
|
import {
|
|
6
6
|
useButton
|
|
7
|
-
} from "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
7
|
+
} from "../__chunks/JH4A3V7P.js";
|
|
8
|
+
import "../__chunks/BVNGIDQK.js";
|
|
9
9
|
import {
|
|
10
10
|
useCollectionItem
|
|
11
11
|
} from "../__chunks/UH3I23HL.js";
|
|
12
12
|
import "../__chunks/4UUKJZ4V.js";
|
|
13
|
-
import "../__chunks/
|
|
13
|
+
import "../__chunks/54DTKZT5.js";
|
|
14
14
|
import "../__chunks/SHA3WOPI.js";
|
|
15
15
|
import {
|
|
16
16
|
createComponent,
|
|
@@ -19,15 +19,20 @@ import type { FormGroupOptions } from "./form-group.js";
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const useFormRadioGroup: import("../utils/types.js").Hook<FormRadioGroupOptions<"div">>;
|
|
21
21
|
/**
|
|
22
|
-
* Renders a
|
|
22
|
+
* Renders a group element for
|
|
23
|
+
* [`FormRadio`](https://ariakit.org/reference/form-radio) elements. The
|
|
24
|
+
* [`FormGroupLabel`](https://ariakit.org/reference/form-group-label) component
|
|
25
|
+
* can be used inside this component so the `aria-labelledby` prop is properly
|
|
26
|
+
* set on the group element.
|
|
23
27
|
* @see https://ariakit.org/components/form
|
|
24
28
|
* @example
|
|
25
|
-
* ```jsx
|
|
29
|
+
* ```jsx {8-13}
|
|
26
30
|
* const form = useFormStore({
|
|
27
31
|
* defaultValues: {
|
|
28
32
|
* color: "red",
|
|
29
33
|
* },
|
|
30
34
|
* });
|
|
35
|
+
*
|
|
31
36
|
* <Form store={form}>
|
|
32
37
|
* <FormRadioGroup>
|
|
33
38
|
* <FormGroupLabel>Favorite color</FormGroupLabel>
|
package/esm/form/form-radio.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RadioOptions } from "../radio/radio.js";
|
|
2
2
|
import type { As, Props } from "../utils/types.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { FormControlOptions } from "./form-control.js";
|
|
4
4
|
/**
|
|
5
5
|
* Returns props to create a `FormRadio` component.
|
|
6
6
|
* @see https://ariakit.org/components/form
|
|
@@ -22,15 +22,19 @@ import type { FormFieldOptions } from "./form-field.js";
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const useFormRadio: import("../utils/types.js").Hook<FormRadioOptions<"input">>;
|
|
24
24
|
/**
|
|
25
|
-
* Renders a radio button
|
|
25
|
+
* Renders a radio button as a form control. This component must be wrapped in a
|
|
26
|
+
* [`FormRadioGroup`](https://ariakit.org/reference/form-radio-group) along with
|
|
27
|
+
* other radio buttons sharing the same
|
|
28
|
+
* [`name`](https://ariakit.org/reference/form-radio#name).
|
|
26
29
|
* @see https://ariakit.org/components/form
|
|
27
30
|
* @example
|
|
28
|
-
* ```jsx
|
|
31
|
+
* ```jsx {10-12}
|
|
29
32
|
* const form = useFormStore({
|
|
30
33
|
* defaultValues: {
|
|
31
34
|
* char: "a",
|
|
32
35
|
* },
|
|
33
36
|
* });
|
|
37
|
+
*
|
|
34
38
|
* <Form store={form}>
|
|
35
39
|
* <FormRadioGroup>
|
|
36
40
|
* <FormGroupLabel>Favorite character</FormGroupLabel>
|
|
@@ -42,6 +46,6 @@ export declare const useFormRadio: import("../utils/types.js").Hook<FormRadioOpt
|
|
|
42
46
|
* ```
|
|
43
47
|
*/
|
|
44
48
|
export declare const FormRadio: import("../utils/types.js").Component<FormRadioOptions<"input">>;
|
|
45
|
-
export interface FormRadioOptions<T extends As = "input"> extends
|
|
49
|
+
export interface FormRadioOptions<T extends As = "input"> extends FormControlOptions<T>, Omit<RadioOptions<T>, "store" | "name"> {
|
|
46
50
|
}
|
|
47
51
|
export type FormRadioProps<T extends As = "input"> = Props<FormRadioOptions<T>>;
|
package/esm/form/form-radio.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "../__chunks/
|
|
3
|
+
useFormControl
|
|
4
|
+
} from "../__chunks/4GO43MST.js";
|
|
5
5
|
import {
|
|
6
6
|
useFormContext
|
|
7
7
|
} from "../__chunks/V4ZFXDFK.js";
|
|
8
8
|
import {
|
|
9
9
|
useRadio
|
|
10
|
-
} from "../__chunks/
|
|
10
|
+
} from "../__chunks/ZICNKKFD.js";
|
|
11
11
|
import "../__chunks/XEV62JUQ.js";
|
|
12
|
-
import "../__chunks/
|
|
13
|
-
import "../__chunks/
|
|
12
|
+
import "../__chunks/W7TET3D7.js";
|
|
13
|
+
import "../__chunks/BVNGIDQK.js";
|
|
14
14
|
import "../__chunks/UH3I23HL.js";
|
|
15
15
|
import "../__chunks/3IEDWLST.js";
|
|
16
16
|
import "../__chunks/IB7YUKH5.js";
|
|
17
17
|
import "../__chunks/4UUKJZ4V.js";
|
|
18
|
-
import "../__chunks/
|
|
18
|
+
import "../__chunks/54DTKZT5.js";
|
|
19
19
|
import "../__chunks/SHA3WOPI.js";
|
|
20
20
|
import {
|
|
21
21
|
createElement,
|
|
@@ -61,7 +61,7 @@ var useFormRadio = createHook(
|
|
|
61
61
|
onChange
|
|
62
62
|
});
|
|
63
63
|
props = useRadio(__spreadValues({ value }, props));
|
|
64
|
-
props =
|
|
64
|
+
props = useFormControl(__spreadValues({
|
|
65
65
|
store,
|
|
66
66
|
name,
|
|
67
67
|
"aria-labelledby": void 0
|
|
@@ -31,14 +31,26 @@ export declare const useFormRemove: import("../utils/types.js").Hook<FormRemoveO
|
|
|
31
31
|
/**
|
|
32
32
|
* Renders a button that will remove an item from an array field in the form
|
|
33
33
|
* when clicked.
|
|
34
|
+
*
|
|
35
|
+
* The [`name`](https://ariakit.org/reference/form-remove#name) prop must be
|
|
36
|
+
* provided to identify the array field. Similarly, the
|
|
37
|
+
* [`index`](https://ariakit.org/reference/form-remove#index) prop is required
|
|
38
|
+
* to pinpoint the item to remove.
|
|
39
|
+
*
|
|
40
|
+
* By default, the button will automatically move focus to the next field in the
|
|
41
|
+
* form when clicked, or to the previous field if there isn't a next field. This
|
|
42
|
+
* behavior can be disabled by setting the
|
|
43
|
+
* [`autoFocusOnClick`](https://ariakit.org/reference/form-remove#autofocusonclick)
|
|
44
|
+
* prop to `false`.
|
|
34
45
|
* @see https://ariakit.org/components/form
|
|
35
46
|
* @example
|
|
36
|
-
* ```jsx
|
|
47
|
+
* ```jsx {13}
|
|
37
48
|
* const form = useFormStore({
|
|
38
49
|
* defaultValues: {
|
|
39
50
|
* languages: ["JavaScript", "PHP"],
|
|
40
51
|
* },
|
|
41
52
|
* });
|
|
53
|
+
*
|
|
42
54
|
* const values = form.useState("values");
|
|
43
55
|
*
|
|
44
56
|
* <Form store={form}>
|
|
@@ -62,7 +74,10 @@ export interface FormRemoveOptions<T extends As = "button"> extends ButtonOption
|
|
|
62
74
|
*/
|
|
63
75
|
store?: FormStore;
|
|
64
76
|
/**
|
|
65
|
-
* Name of the array field.
|
|
77
|
+
* Name of the array field. This can either be a string or a reference to a
|
|
78
|
+
* field name from the
|
|
79
|
+
* [`names`](https://ariakit.org/reference/use-form-store#names) object in the
|
|
80
|
+
* store, for type safety.
|
|
66
81
|
*/
|
|
67
82
|
name: StringLike;
|
|
68
83
|
/**
|
package/esm/form/form-remove.js
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "../__chunks/V4ZFXDFK.js";
|
|
5
5
|
import {
|
|
6
6
|
useButton
|
|
7
|
-
} from "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
7
|
+
} from "../__chunks/JH4A3V7P.js";
|
|
8
|
+
import "../__chunks/BVNGIDQK.js";
|
|
9
9
|
import "../__chunks/4UUKJZ4V.js";
|
|
10
|
-
import "../__chunks/
|
|
10
|
+
import "../__chunks/54DTKZT5.js";
|
|
11
11
|
import "../__chunks/SHA3WOPI.js";
|
|
12
12
|
import {
|
|
13
13
|
createComponent,
|
package/esm/form/form-reset.d.ts
CHANGED
|
@@ -15,10 +15,13 @@ import type { FormStore } from "./form-store.js";
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const useFormReset: import("../utils/types.js").Hook<FormResetOptions<"button">>;
|
|
17
17
|
/**
|
|
18
|
-
* Renders a
|
|
18
|
+
* Renders a button that resets the form to its initial values, as defined by
|
|
19
|
+
* the
|
|
20
|
+
* [`defaultValues`](https://ariakit.org/reference/use-form-store#defaultvalues)
|
|
21
|
+
* prop given to the form store.
|
|
19
22
|
* @see https://ariakit.org/components/form
|
|
20
23
|
* @example
|
|
21
|
-
* ```jsx
|
|
24
|
+
* ```jsx {4}
|
|
22
25
|
* const form = useFormStore();
|
|
23
26
|
*
|
|
24
27
|
* <Form store={form}>
|
package/esm/form/form-reset.js
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "../__chunks/V4ZFXDFK.js";
|
|
5
5
|
import {
|
|
6
6
|
useButton
|
|
7
|
-
} from "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
7
|
+
} from "../__chunks/JH4A3V7P.js";
|
|
8
|
+
import "../__chunks/BVNGIDQK.js";
|
|
9
9
|
import "../__chunks/4UUKJZ4V.js";
|
|
10
|
-
import "../__chunks/
|
|
10
|
+
import "../__chunks/54DTKZT5.js";
|
|
11
11
|
import "../__chunks/SHA3WOPI.js";
|
|
12
12
|
import {
|
|
13
13
|
createComponent,
|
package/esm/form/form-store.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ export declare function useFormStoreProps<T extends Omit<FormStore, "useValue" |
|
|
|
9
9
|
useSubmit: (callback: Core.FormStoreCallback<FormStoreState<FormStoreValues>>) => void;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* Creates a form store
|
|
12
|
+
* Creates a form store to control the state of
|
|
13
|
+
* [Form](https://ariakit.org/components/form) components.
|
|
13
14
|
* @example
|
|
14
15
|
* ```jsx
|
|
15
16
|
* const form = useFormStore({
|
|
@@ -17,6 +18,7 @@ export declare function useFormStoreProps<T extends Omit<FormStore, "useValue" |
|
|
|
17
18
|
* email: "",
|
|
18
19
|
* },
|
|
19
20
|
* });
|
|
21
|
+
*
|
|
20
22
|
* <Form store={form}>
|
|
21
23
|
* <FormLabel name={form.names.email}>Email</FormLabel>
|
|
22
24
|
* <FormInput name={form.names.email} />
|
|
@@ -36,18 +38,26 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
|
|
|
36
38
|
export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues> extends Core.FormStoreFunctions<T>, CollectionStoreFunctions<FormStoreItem> {
|
|
37
39
|
/**
|
|
38
40
|
* A custom hook that rerenders the component when the value of the given
|
|
39
|
-
* field changes. It
|
|
40
|
-
*
|
|
41
|
+
* field changes. It accepts a string or a reference to a field name from the
|
|
42
|
+
* [`names`](https://ariakit.org/reference/use-form-store#names) object in the
|
|
43
|
+
* store, for type safety. It returns the value of the field.
|
|
44
|
+
*
|
|
45
|
+
* Live examples:
|
|
46
|
+
* - [Form with Select](https://ariakit.org/examples/form-select)
|
|
41
47
|
* @example
|
|
42
48
|
* const nameValue = store.useValue("name");
|
|
43
|
-
* // Can also use store.names for type
|
|
49
|
+
* // Can also use store.names for type safety.
|
|
44
50
|
* const emailValue = store.useValue(store.names.email);
|
|
45
51
|
*/
|
|
46
52
|
useValue: <T = any>(name: StringLike) => T;
|
|
47
53
|
/**
|
|
48
54
|
* Custom hook that accepts a callback that will be used to validate the form
|
|
49
|
-
* when `form
|
|
50
|
-
*
|
|
55
|
+
* when [`validate`](https://ariakit.org/reference/use-form-store#validate) is
|
|
56
|
+
* called, typically when a form field is touched or when the form is
|
|
57
|
+
* submitted.
|
|
58
|
+
*
|
|
59
|
+
* Live examples:
|
|
60
|
+
* - [FormRadio](https://ariakit.org/examples/form-radio)
|
|
51
61
|
* @example
|
|
52
62
|
* store.useValidate(async (state) => {
|
|
53
63
|
* const errors = await api.validate(state.values);
|
|
@@ -59,8 +69,12 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
|
|
|
59
69
|
useValidate: (callback: Core.FormStoreCallback<FormStoreState<T>>) => void;
|
|
60
70
|
/**
|
|
61
71
|
* Custom hook that accepts a callback that will be used to submit the form
|
|
62
|
-
* when `form
|
|
63
|
-
*
|
|
72
|
+
* when [`submit`](https://ariakit.org/reference/use-form-store#submit) is
|
|
73
|
+
* called.
|
|
74
|
+
*
|
|
75
|
+
* Live examples:
|
|
76
|
+
* - [FormRadio](https://ariakit.org/examples/form-radio)
|
|
77
|
+
* - [Form with Select](https://ariakit.org/examples/form-select)
|
|
64
78
|
* @example
|
|
65
79
|
* store.useSubmit(async (state) => {
|
|
66
80
|
* try {
|
|
@@ -74,8 +88,9 @@ export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
|
|
|
74
88
|
}
|
|
75
89
|
export interface FormStoreOptions<T extends FormStoreValues = FormStoreValues> extends Core.FormStoreOptions<T>, CollectionStoreOptions<FormStoreItem> {
|
|
76
90
|
/**
|
|
77
|
-
* Function that will be called when
|
|
78
|
-
*
|
|
91
|
+
* Function that will be called when
|
|
92
|
+
* [`values`](https://ariakit.org/reference/use-form-store#values) state
|
|
93
|
+
* changes.
|
|
79
94
|
* @example
|
|
80
95
|
* function MyForm({ values, onChange }) {
|
|
81
96
|
* const form = useFormStore({ values, setValues: onChange });
|
|
@@ -83,15 +98,17 @@ export interface FormStoreOptions<T extends FormStoreValues = FormStoreValues> e
|
|
|
83
98
|
*/
|
|
84
99
|
setValues?: (values: FormStoreState<T>["values"]) => void;
|
|
85
100
|
/**
|
|
86
|
-
* Function that will be called when the
|
|
87
|
-
*
|
|
101
|
+
* Function that will be called when the
|
|
102
|
+
* [`errors`](https://ariakit.org/reference/use-form-store#errors) state
|
|
103
|
+
* changes.
|
|
88
104
|
* @example
|
|
89
105
|
* useFormStore({ setErrors: (errors) => console.log(errors) });
|
|
90
106
|
*/
|
|
91
107
|
setErrors?: (errors: FormStoreState<T>["errors"]) => void;
|
|
92
108
|
/**
|
|
93
|
-
* Function that will be called when the
|
|
94
|
-
*
|
|
109
|
+
* Function that will be called when the
|
|
110
|
+
* [`touched`](https://ariakit.org/reference/use-form-store#touched) state
|
|
111
|
+
* changes.
|
|
95
112
|
* @example
|
|
96
113
|
* useFormStore({ setTouched: (touched) => console.log(touched) });
|
|
97
114
|
*/
|