@ariakit/react-components 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/button/button.d.ts +2 -0
- package/dist/button/button.js +53 -0
- package/dist/button/button.js.map +1 -0
- package/dist/button-Cp853csH.d.ts +34 -0
- package/dist/button-Cp853csH.d.ts.map +1 -0
- package/dist/checkbox/checkbox-check.d.ts +56 -0
- package/dist/checkbox/checkbox-check.d.ts.map +1 -0
- package/dist/checkbox/checkbox-check.js +77 -0
- package/dist/checkbox/checkbox-check.js.map +1 -0
- package/dist/checkbox/checkbox-checked-context.d.ts +5 -0
- package/dist/checkbox/checkbox-checked-context.d.ts.map +1 -0
- package/dist/checkbox/checkbox-checked-context.js +8 -0
- package/dist/checkbox/checkbox-checked-context.js.map +1 -0
- package/dist/checkbox/checkbox-context.d.ts +24 -0
- package/dist/checkbox/checkbox-context.d.ts.map +1 -0
- package/dist/checkbox/checkbox-context.js +26 -0
- package/dist/checkbox/checkbox-context.js.map +1 -0
- package/dist/checkbox/checkbox-provider.d.ts +35 -0
- package/dist/checkbox/checkbox-provider.d.ts.map +1 -0
- package/dist/checkbox/checkbox-provider.js +15 -0
- package/dist/checkbox/checkbox-provider.js.map +1 -0
- package/dist/checkbox/checkbox-store.d.ts +2 -0
- package/dist/checkbox/checkbox-store.js +18 -0
- package/dist/checkbox/checkbox-store.js.map +1 -0
- package/dist/checkbox/checkbox.d.ts +91 -0
- package/dist/checkbox/checkbox.d.ts.map +1 -0
- package/dist/checkbox/checkbox.js +148 -0
- package/dist/checkbox/checkbox.js.map +1 -0
- package/dist/checkbox-store-CYZPR4N4.d.ts +38 -0
- package/dist/checkbox-store-CYZPR4N4.d.ts.map +1 -0
- package/dist/collection/collection-context.d.ts +24 -0
- package/dist/collection/collection-context.d.ts.map +1 -0
- package/dist/collection/collection-context.js +26 -0
- package/dist/collection/collection-context.js.map +1 -0
- package/dist/collection/collection-item-offscreen.d.ts +2 -0
- package/dist/collection/collection-item-offscreen.js +88 -0
- package/dist/collection/collection-item-offscreen.js.map +1 -0
- package/dist/collection/collection-item.d.ts +2 -0
- package/dist/collection/collection-item.js +69 -0
- package/dist/collection/collection-item.js.map +1 -0
- package/dist/collection/collection-provider.d.ts +26 -0
- package/dist/collection/collection-provider.d.ts.map +1 -0
- package/dist/collection/collection-provider.js +15 -0
- package/dist/collection/collection-provider.js.map +1 -0
- package/dist/collection/collection-renderer.d.ts +2 -0
- package/dist/collection/collection-renderer.js +580 -0
- package/dist/collection/collection-renderer.js.map +1 -0
- package/dist/collection/collection-store.d.ts +2 -0
- package/dist/collection/collection-store.js +18 -0
- package/dist/collection/collection-store.js.map +1 -0
- package/dist/collection/collection.d.ts +55 -0
- package/dist/collection/collection.d.ts.map +1 -0
- package/dist/collection/collection.js +55 -0
- package/dist/collection/collection.js.map +1 -0
- package/dist/collection-item-C-g2BwVF.d.ts +84 -0
- package/dist/collection-item-C-g2BwVF.d.ts.map +1 -0
- package/dist/collection-item-offscreen-DyXa-sqj.d.ts +30 -0
- package/dist/collection-item-offscreen-DyXa-sqj.d.ts.map +1 -0
- package/dist/collection-renderer-DsPD9ksD.d.ts +469 -0
- package/dist/collection-renderer-DsPD9ksD.d.ts.map +1 -0
- package/dist/collection-store-CbwzYsWf.d.ts +42 -0
- package/dist/collection-store-CbwzYsWf.d.ts.map +1 -0
- package/dist/combobox/combobox-cancel.d.ts +62 -0
- package/dist/combobox/combobox-cancel.d.ts.map +1 -0
- package/dist/combobox/combobox-cancel.js +98 -0
- package/dist/combobox/combobox-cancel.js.map +1 -0
- package/dist/combobox/combobox-context.d.ts +27 -0
- package/dist/combobox/combobox-context.d.ts.map +1 -0
- package/dist/combobox/combobox-context.js +32 -0
- package/dist/combobox/combobox-context.js.map +1 -0
- package/dist/combobox/combobox-disclosure.d.ts +63 -0
- package/dist/combobox/combobox-disclosure.d.ts.map +1 -0
- package/dist/combobox/combobox-disclosure.js +108 -0
- package/dist/combobox/combobox-disclosure.js.map +1 -0
- package/dist/combobox/combobox-group-label.d.ts +56 -0
- package/dist/combobox/combobox-group-label.d.ts.map +1 -0
- package/dist/combobox/combobox-group-label.js +47 -0
- package/dist/combobox/combobox-group-label.js.map +1 -0
- package/dist/combobox/combobox-group.d.ts +63 -0
- package/dist/combobox/combobox-group.d.ts.map +1 -0
- package/dist/combobox/combobox-group.js +67 -0
- package/dist/combobox/combobox-group.js.map +1 -0
- package/dist/combobox/combobox-item-check.d.ts +61 -0
- package/dist/combobox/combobox-item-check.d.ts.map +1 -0
- package/dist/combobox/combobox-item-check.js +62 -0
- package/dist/combobox/combobox-item-check.js.map +1 -0
- package/dist/combobox/combobox-item-offscreen.d.ts +34 -0
- package/dist/combobox/combobox-item-offscreen.d.ts.map +1 -0
- package/dist/combobox/combobox-item-offscreen.js +53 -0
- package/dist/combobox/combobox-item-offscreen.js.map +1 -0
- package/dist/combobox/combobox-item-value.d.ts +103 -0
- package/dist/combobox/combobox-item-value.d.ts.map +1 -0
- package/dist/combobox/combobox-item-value.js +143 -0
- package/dist/combobox/combobox-item-value.js.map +1 -0
- package/dist/combobox/combobox-item.d.ts +146 -0
- package/dist/combobox/combobox-item.d.ts.map +1 -0
- package/dist/combobox/combobox-item.js +157 -0
- package/dist/combobox/combobox-item.js.map +1 -0
- package/dist/combobox/combobox-label.d.ts +50 -0
- package/dist/combobox/combobox-label.d.ts.map +1 -0
- package/dist/combobox/combobox-label.js +51 -0
- package/dist/combobox/combobox-label.js.map +1 -0
- package/dist/combobox/combobox-list.d.ts +55 -0
- package/dist/combobox/combobox-list.d.ts.map +1 -0
- package/dist/combobox/combobox-list.js +106 -0
- package/dist/combobox/combobox-list.js.map +1 -0
- package/dist/combobox/combobox-popover.d.ts +46 -0
- package/dist/combobox/combobox-popover.d.ts.map +1 -0
- package/dist/combobox/combobox-popover.js +115 -0
- package/dist/combobox/combobox-popover.js.map +1 -0
- package/dist/combobox/combobox-provider.d.ts +30 -0
- package/dist/combobox/combobox-provider.d.ts.map +1 -0
- package/dist/combobox/combobox-provider.js +15 -0
- package/dist/combobox/combobox-provider.js.map +1 -0
- package/dist/combobox/combobox-row.d.ts +66 -0
- package/dist/combobox/combobox-row.d.ts.map +1 -0
- package/dist/combobox/combobox-row.js +70 -0
- package/dist/combobox/combobox-row.js.map +1 -0
- package/dist/combobox/combobox-separator.d.ts +61 -0
- package/dist/combobox/combobox-separator.d.ts.map +1 -0
- package/dist/combobox/combobox-separator.js +60 -0
- package/dist/combobox/combobox-separator.js.map +1 -0
- package/dist/combobox/combobox-store.d.ts +2 -0
- package/dist/combobox/combobox-store.js +33 -0
- package/dist/combobox/combobox-store.js.map +1 -0
- package/dist/combobox/combobox-value.d.ts +49 -0
- package/dist/combobox/combobox-value.d.ts.map +1 -0
- package/dist/combobox/combobox-value.js +40 -0
- package/dist/combobox/combobox-value.js.map +1 -0
- package/dist/combobox/combobox.d.ts +268 -0
- package/dist/combobox/combobox.d.ts.map +1 -0
- package/dist/combobox/combobox.js +399 -0
- package/dist/combobox/combobox.js.map +1 -0
- package/dist/combobox-store-DEVQ45mZ.d.ts +80 -0
- package/dist/combobox-store-DEVQ45mZ.d.ts.map +1 -0
- package/dist/command/command.d.ts +2 -0
- package/dist/command/command.js +130 -0
- package/dist/command/command.js.map +1 -0
- package/dist/command-DckndCUK.d.ts +59 -0
- package/dist/command-DckndCUK.d.ts.map +1 -0
- package/dist/composite/composite-container.d.ts +59 -0
- package/dist/composite/composite-container.d.ts.map +1 -0
- package/dist/composite/composite-container.js +164 -0
- package/dist/composite/composite-container.js.map +1 -0
- package/dist/composite/composite-context.d.ts +34 -0
- package/dist/composite/composite-context.d.ts.map +1 -0
- package/dist/composite/composite-context.js +30 -0
- package/dist/composite/composite-context.js.map +1 -0
- package/dist/composite/composite-group-label.d.ts +55 -0
- package/dist/composite/composite-group-label.d.ts.map +1 -0
- package/dist/composite/composite-group-label.js +46 -0
- package/dist/composite/composite-group-label.js.map +1 -0
- package/dist/composite/composite-group.d.ts +60 -0
- package/dist/composite/composite-group.d.ts.map +1 -0
- package/dist/composite/composite-group.js +51 -0
- package/dist/composite/composite-group.js.map +1 -0
- package/dist/composite/composite-hover.d.ts +2 -0
- package/dist/composite/composite-hover.js +114 -0
- package/dist/composite/composite-hover.js.map +1 -0
- package/dist/composite/composite-input.d.ts +55 -0
- package/dist/composite/composite-input.d.ts.map +1 -0
- package/dist/composite/composite-input.js +91 -0
- package/dist/composite/composite-input.js.map +1 -0
- package/dist/composite/composite-item-offscreen.d.ts +39 -0
- package/dist/composite/composite-item-offscreen.d.ts.map +1 -0
- package/dist/composite/composite-item-offscreen.js +72 -0
- package/dist/composite/composite-item-offscreen.js.map +1 -0
- package/dist/composite/composite-item.d.ts +2 -0
- package/dist/composite/composite-item.js +290 -0
- package/dist/composite/composite-item.js.map +1 -0
- package/dist/composite/composite-overflow-disclosure.d.ts +53 -0
- package/dist/composite/composite-overflow-disclosure.d.ts.map +1 -0
- package/dist/composite/composite-overflow-disclosure.js +84 -0
- package/dist/composite/composite-overflow-disclosure.js.map +1 -0
- package/dist/composite/composite-overflow-store.d.ts +38 -0
- package/dist/composite/composite-overflow-store.d.ts.map +1 -0
- package/dist/composite/composite-overflow-store.js +36 -0
- package/dist/composite/composite-overflow-store.js.map +1 -0
- package/dist/composite/composite-overflow.d.ts +54 -0
- package/dist/composite/composite-overflow.d.ts.map +1 -0
- package/dist/composite/composite-overflow.js +82 -0
- package/dist/composite/composite-overflow.js.map +1 -0
- package/dist/composite/composite-provider.d.ts +28 -0
- package/dist/composite/composite-provider.d.ts.map +1 -0
- package/dist/composite/composite-provider.js +15 -0
- package/dist/composite/composite-provider.js.map +1 -0
- package/dist/composite/composite-renderer.d.ts +329 -0
- package/dist/composite/composite-renderer.d.ts.map +1 -0
- package/dist/composite/composite-renderer.js +121 -0
- package/dist/composite/composite-renderer.js.map +1 -0
- package/dist/composite/composite-row.d.ts +67 -0
- package/dist/composite/composite-row.d.ts.map +1 -0
- package/dist/composite/composite-row.js +86 -0
- package/dist/composite/composite-row.js.map +1 -0
- package/dist/composite/composite-separator.d.ts +61 -0
- package/dist/composite/composite-separator.d.ts.map +1 -0
- package/dist/composite/composite-separator.js +55 -0
- package/dist/composite/composite-separator.js.map +1 -0
- package/dist/composite/composite-store.d.ts +2 -0
- package/dist/composite/composite-store.js +33 -0
- package/dist/composite/composite-store.js.map +1 -0
- package/dist/composite/composite-typeahead.d.ts +2 -0
- package/dist/composite/composite-typeahead.js +126 -0
- package/dist/composite/composite-typeahead.js.map +1 -0
- package/dist/composite/composite.d.ts +2 -0
- package/dist/composite/composite.js +273 -0
- package/dist/composite/composite.js.map +1 -0
- package/dist/composite/utils.d.ts +52 -0
- package/dist/composite/utils.d.ts.map +1 -0
- package/dist/composite/utils.js +93 -0
- package/dist/composite/utils.js.map +1 -0
- package/dist/composite-DLvyFHMq.d.ts +124 -0
- package/dist/composite-DLvyFHMq.d.ts.map +1 -0
- package/dist/composite-hover-C7ul163w.d.ts +103 -0
- package/dist/composite-hover-C7ul163w.d.ts.map +1 -0
- package/dist/composite-item-B4WTelVz.d.ts +141 -0
- package/dist/composite-item-B4WTelVz.d.ts.map +1 -0
- package/dist/composite-store-DyJc-XRA.d.ts +43 -0
- package/dist/composite-store-DyJc-XRA.d.ts.map +1 -0
- package/dist/composite-typeahead-DDhpyKqm.d.ts +63 -0
- package/dist/composite-typeahead-DDhpyKqm.d.ts.map +1 -0
- package/dist/dialog/dialog-backdrop.d.ts +16 -0
- package/dist/dialog/dialog-backdrop.d.ts.map +1 -0
- package/dist/dialog/dialog-backdrop.js +58 -0
- package/dist/dialog/dialog-backdrop.js.map +1 -0
- package/dist/dialog/dialog-context.d.ts +27 -0
- package/dist/dialog/dialog-context.d.ts.map +1 -0
- package/dist/dialog/dialog-context.js +30 -0
- package/dist/dialog/dialog-context.js.map +1 -0
- package/dist/dialog/dialog-description.d.ts +2 -0
- package/dist/dialog/dialog-description.js +53 -0
- package/dist/dialog/dialog-description.js.map +1 -0
- package/dist/dialog/dialog-disclosure.d.ts +2 -0
- package/dist/dialog/dialog-disclosure.js +52 -0
- package/dist/dialog/dialog-disclosure.js.map +1 -0
- package/dist/dialog/dialog-dismiss.d.ts +2 -0
- package/dist/dialog/dialog-dismiss.js +80 -0
- package/dist/dialog/dialog-dismiss.js.map +1 -0
- package/dist/dialog/dialog-heading.d.ts +2 -0
- package/dist/dialog/dialog-heading.js +54 -0
- package/dist/dialog/dialog-heading.js.map +1 -0
- package/dist/dialog/dialog-provider.d.ts +22 -0
- package/dist/dialog/dialog-provider.d.ts.map +1 -0
- package/dist/dialog/dialog-provider.js +26 -0
- package/dist/dialog/dialog-provider.js.map +1 -0
- package/dist/dialog/dialog-store.d.ts +2 -0
- package/dist/dialog/dialog-store.js +28 -0
- package/dist/dialog/dialog-store.js.map +1 -0
- package/dist/dialog/dialog.d.ts +2 -0
- package/dist/dialog/dialog.js +429 -0
- package/dist/dialog/dialog.js.map +1 -0
- package/dist/dialog/utils/disable-accessibility-tree-outside.d.ts +7 -0
- package/dist/dialog/utils/disable-accessibility-tree-outside.d.ts.map +1 -0
- package/dist/dialog/utils/disable-accessibility-tree-outside.js +24 -0
- package/dist/dialog/utils/disable-accessibility-tree-outside.js.map +1 -0
- package/dist/dialog/utils/disable-tree.d.ts +9 -0
- package/dist/dialog/utils/disable-tree.d.ts.map +1 -0
- package/dist/dialog/utils/disable-tree.js +48 -0
- package/dist/dialog/utils/disable-tree.js.map +1 -0
- package/dist/dialog/utils/is-backdrop.d.ts +5 -0
- package/dist/dialog/utils/is-backdrop.d.ts.map +1 -0
- package/dist/dialog/utils/is-backdrop.js +15 -0
- package/dist/dialog/utils/is-backdrop.js.map +1 -0
- package/dist/dialog/utils/is-focus-trap.d.ts +5 -0
- package/dist/dialog/utils/is-focus-trap.d.ts.map +1 -0
- package/dist/dialog/utils/is-focus-trap.js +14 -0
- package/dist/dialog/utils/is-focus-trap.js.map +1 -0
- package/dist/dialog/utils/mark-tree-outside.d.ts +9 -0
- package/dist/dialog/utils/mark-tree-outside.d.ts.map +1 -0
- package/dist/dialog/utils/mark-tree-outside.js +44 -0
- package/dist/dialog/utils/mark-tree-outside.js.map +1 -0
- package/dist/dialog/utils/orchestrate.d.ts +9 -0
- package/dist/dialog/utils/orchestrate.d.ts.map +1 -0
- package/dist/dialog/utils/orchestrate.js +77 -0
- package/dist/dialog/utils/orchestrate.js.map +1 -0
- package/dist/dialog/utils/prepend-hidden-dismiss.d.ts +5 -0
- package/dist/dialog/utils/prepend-hidden-dismiss.d.ts.map +1 -0
- package/dist/dialog/utils/prepend-hidden-dismiss.js +31 -0
- package/dist/dialog/utils/prepend-hidden-dismiss.js.map +1 -0
- package/dist/dialog/utils/supports-inert.d.ts +5 -0
- package/dist/dialog/utils/supports-inert.d.ts.map +1 -0
- package/dist/dialog/utils/supports-inert.js +9 -0
- package/dist/dialog/utils/supports-inert.js.map +1 -0
- package/dist/dialog/utils/use-hide-on-interact-outside.d.ts +9 -0
- package/dist/dialog/utils/use-hide-on-interact-outside.d.ts.map +1 -0
- package/dist/dialog/utils/use-hide-on-interact-outside.js +123 -0
- package/dist/dialog/utils/use-hide-on-interact-outside.js.map +1 -0
- package/dist/dialog/utils/use-nested-dialogs.d.ts +11 -0
- package/dist/dialog/utils/use-nested-dialogs.d.ts.map +1 -0
- package/dist/dialog/utils/use-nested-dialogs.js +40 -0
- package/dist/dialog/utils/use-nested-dialogs.js.map +1 -0
- package/dist/dialog/utils/use-prevent-body-scroll.d.ts +5 -0
- package/dist/dialog/utils/use-prevent-body-scroll.d.ts.map +1 -0
- package/dist/dialog/utils/use-prevent-body-scroll.js +60 -0
- package/dist/dialog/utils/use-prevent-body-scroll.js.map +1 -0
- package/dist/dialog/utils/use-previous-mouse-down-ref.d.ts +5 -0
- package/dist/dialog/utils/use-previous-mouse-down-ref.d.ts.map +1 -0
- package/dist/dialog/utils/use-previous-mouse-down-ref.js +22 -0
- package/dist/dialog/utils/use-previous-mouse-down-ref.js.map +1 -0
- package/dist/dialog/utils/use-root-dialog.d.ts +16 -0
- package/dist/dialog/utils/use-root-dialog.d.ts.map +1 -0
- package/dist/dialog/utils/use-root-dialog.js +47 -0
- package/dist/dialog/utils/use-root-dialog.js.map +1 -0
- package/dist/dialog/utils/walk-tree-outside.d.ts +8 -0
- package/dist/dialog/utils/walk-tree-outside.d.ts.map +1 -0
- package/dist/dialog/utils/walk-tree-outside.js +58 -0
- package/dist/dialog/utils/walk-tree-outside.js.map +1 -0
- package/dist/dialog-C__C-zX2.d.ts +267 -0
- package/dist/dialog-C__C-zX2.d.ts.map +1 -0
- package/dist/dialog-description-BCZJ1Kyd.d.ts +48 -0
- package/dist/dialog-description-BCZJ1Kyd.d.ts.map +1 -0
- package/dist/dialog-disclosure-DLD10zlb.d.ts +47 -0
- package/dist/dialog-disclosure-DLD10zlb.d.ts.map +1 -0
- package/dist/dialog-dismiss-CnwEbzc6.d.ts +48 -0
- package/dist/dialog-dismiss-CnwEbzc6.d.ts.map +1 -0
- package/dist/dialog-heading-DQvnOfZH.d.ts +49 -0
- package/dist/dialog-heading-DQvnOfZH.d.ts.map +1 -0
- package/dist/dialog-store-Cjt12T_Y.d.ts +29 -0
- package/dist/dialog-store-Cjt12T_Y.d.ts.map +1 -0
- package/dist/disclosure/disclosure-content.d.ts +2 -0
- package/dist/disclosure/disclosure-content.js +171 -0
- package/dist/disclosure/disclosure-content.js.map +1 -0
- package/dist/disclosure/disclosure-context.d.ts +24 -0
- package/dist/disclosure/disclosure-context.d.ts.map +1 -0
- package/dist/disclosure/disclosure-context.js +26 -0
- package/dist/disclosure/disclosure-context.js.map +1 -0
- package/dist/disclosure/disclosure-provider.d.ts +23 -0
- package/dist/disclosure/disclosure-provider.d.ts.map +1 -0
- package/dist/disclosure/disclosure-provider.js +27 -0
- package/dist/disclosure/disclosure-provider.js.map +1 -0
- package/dist/disclosure/disclosure-store.d.ts +2 -0
- package/dist/disclosure/disclosure-store.js +32 -0
- package/dist/disclosure/disclosure-store.js.map +1 -0
- package/dist/disclosure/disclosure.d.ts +2 -0
- package/dist/disclosure/disclosure.js +83 -0
- package/dist/disclosure/disclosure.js.map +1 -0
- package/dist/disclosure-CQ37hPVP.d.ts +60 -0
- package/dist/disclosure-CQ37hPVP.d.ts.map +1 -0
- package/dist/disclosure-content-BbPkZgAc.d.ts +88 -0
- package/dist/disclosure-content-BbPkZgAc.d.ts.map +1 -0
- package/dist/disclosure-store-BsaBaRKv.d.ts +58 -0
- package/dist/disclosure-store-BsaBaRKv.d.ts.map +1 -0
- package/dist/focus-trap/focus-trap-region.d.ts +42 -0
- package/dist/focus-trap/focus-trap-region.d.ts.map +1 -0
- package/dist/focus-trap/focus-trap-region.js +69 -0
- package/dist/focus-trap/focus-trap-region.js.map +1 -0
- package/dist/focus-trap/focus-trap.d.ts +31 -0
- package/dist/focus-trap/focus-trap.d.ts.map +1 -0
- package/dist/focus-trap/focus-trap.js +45 -0
- package/dist/focus-trap/focus-trap.js.map +1 -0
- package/dist/focusable/focusable-container.d.ts +43 -0
- package/dist/focusable/focusable-container.d.ts.map +1 -0
- package/dist/focusable/focusable-container.js +41 -0
- package/dist/focusable/focusable-container.js.map +1 -0
- package/dist/focusable/focusable-context.d.ts +5 -0
- package/dist/focusable/focusable-context.d.ts.map +1 -0
- package/dist/focusable/focusable-context.js +8 -0
- package/dist/focusable/focusable-context.js.map +1 -0
- package/dist/focusable/focusable.d.ts +2 -0
- package/dist/focusable/focusable.js +273 -0
- package/dist/focusable/focusable.js.map +1 -0
- package/dist/focusable-B00tOxtB.d.ts +142 -0
- package/dist/focusable-B00tOxtB.d.ts.map +1 -0
- package/dist/form/form-checkbox.d.ts +50 -0
- package/dist/form/form-checkbox.d.ts.map +1 -0
- package/dist/form/form-checkbox.js +73 -0
- package/dist/form/form-checkbox.js.map +1 -0
- package/dist/form/form-context.d.ts +24 -0
- package/dist/form/form-context.d.ts.map +1 -0
- package/dist/form/form-context.js +27 -0
- package/dist/form/form-context.js.map +1 -0
- package/dist/form/form-control.d.ts +100 -0
- package/dist/form/form-control.d.ts.map +1 -0
- package/dist/form/form-control.js +139 -0
- package/dist/form/form-control.js.map +1 -0
- package/dist/form/form-description.d.ts +73 -0
- package/dist/form/form-description.d.ts.map +1 -0
- package/dist/form/form-description.js +83 -0
- package/dist/form/form-description.js.map +1 -0
- package/dist/form/form-error.d.ts +82 -0
- package/dist/form/form-error.d.ts.map +1 -0
- package/dist/form/form-error.js +102 -0
- package/dist/form/form-error.js.map +1 -0
- package/dist/form/form-field.d.ts +73 -0
- package/dist/form/form-field.d.ts.map +1 -0
- package/dist/form/form-field.js +74 -0
- package/dist/form/form-field.js.map +1 -0
- package/dist/form/form-group-label.d.ts +62 -0
- package/dist/form/form-group-label.d.ts.map +1 -0
- package/dist/form/form-group-label.js +54 -0
- package/dist/form/form-group-label.js.map +1 -0
- package/dist/form/form-group.d.ts +64 -0
- package/dist/form/form-group.d.ts.map +1 -0
- package/dist/form/form-group.js +56 -0
- package/dist/form/form-group.js.map +1 -0
- package/dist/form/form-input.d.ts +50 -0
- package/dist/form/form-input.d.ts.map +1 -0
- package/dist/form/form-input.js +74 -0
- package/dist/form/form-input.js.map +1 -0
- package/dist/form/form-label.d.ts +77 -0
- package/dist/form/form-label.d.ts.map +1 -0
- package/dist/form/form-label.js +120 -0
- package/dist/form/form-label.js.map +1 -0
- package/dist/form/form-provider.d.ts +28 -0
- package/dist/form/form-provider.d.ts.map +1 -0
- package/dist/form/form-provider.js +15 -0
- package/dist/form/form-provider.js.map +1 -0
- package/dist/form/form-push.d.ts +102 -0
- package/dist/form/form-push.d.ts.map +1 -0
- package/dist/form/form-push.js +134 -0
- package/dist/form/form-push.js.map +1 -0
- package/dist/form/form-radio-group.d.ts +56 -0
- package/dist/form/form-radio-group.d.ts.map +1 -0
- package/dist/form/form-radio-group.js +68 -0
- package/dist/form/form-radio-group.js.map +1 -0
- package/dist/form/form-radio.d.ts +58 -0
- package/dist/form/form-radio.d.ts.map +1 -0
- package/dist/form/form-radio.js +90 -0
- package/dist/form/form-radio.js.map +1 -0
- package/dist/form/form-remove.d.ts +102 -0
- package/dist/form/form-remove.d.ts.map +1 -0
- package/dist/form/form-remove.js +116 -0
- package/dist/form/form-remove.js.map +1 -0
- package/dist/form/form-reset.d.ts +51 -0
- package/dist/form/form-reset.d.ts.map +1 -0
- package/dist/form/form-reset.js +54 -0
- package/dist/form/form-reset.js.map +1 -0
- package/dist/form/form-store.d.ts +2 -0
- package/dist/form/form-store.js +41 -0
- package/dist/form/form-store.js.map +1 -0
- package/dist/form/form-submit.d.ts +57 -0
- package/dist/form/form-submit.d.ts.map +1 -0
- package/dist/form/form-submit.js +59 -0
- package/dist/form/form-submit.js.map +1 -0
- package/dist/form/form.d.ts +101 -0
- package/dist/form/form.d.ts.map +1 -0
- package/dist/form/form.js +146 -0
- package/dist/form/form.js.map +1 -0
- package/dist/form-store-C4Kf5QHm.d.ts +120 -0
- package/dist/form-store-C4Kf5QHm.d.ts.map +1 -0
- package/dist/group/group-label-context.d.ts +7 -0
- package/dist/group/group-label-context.d.ts.map +1 -0
- package/dist/group/group-label-context.js +8 -0
- package/dist/group/group-label-context.js.map +1 -0
- package/dist/group/group-label.d.ts +2 -0
- package/dist/group/group-label.js +52 -0
- package/dist/group/group-label.js.map +1 -0
- package/dist/group/group.d.ts +2 -0
- package/dist/group/group.js +47 -0
- package/dist/group/group.js.map +1 -0
- package/dist/group-CamegDJA.d.ts +32 -0
- package/dist/group-CamegDJA.d.ts.map +1 -0
- package/dist/group-label-C16IDs1b.d.ts +37 -0
- package/dist/group-label-C16IDs1b.d.ts.map +1 -0
- package/dist/heading/heading-context.d.ts +7 -0
- package/dist/heading/heading-context.d.ts.map +1 -0
- package/dist/heading/heading-context.js +8 -0
- package/dist/heading/heading-context.js.map +1 -0
- package/dist/heading/heading-level.d.ts +35 -0
- package/dist/heading/heading-level.d.ts.map +1 -0
- package/dist/heading/heading-level.js +33 -0
- package/dist/heading/heading-level.js.map +1 -0
- package/dist/heading/heading.d.ts +2 -0
- package/dist/heading/heading.js +56 -0
- package/dist/heading/heading.js.map +1 -0
- package/dist/heading/utils.d.ts +2 -0
- package/dist/heading/utils.js +1 -0
- package/dist/heading-zY9g_9K-.d.ts +42 -0
- package/dist/heading-zY9g_9K-.d.ts.map +1 -0
- package/dist/hovercard/hovercard-anchor.d.ts +59 -0
- package/dist/hovercard/hovercard-anchor.d.ts.map +1 -0
- package/dist/hovercard/hovercard-anchor.js +106 -0
- package/dist/hovercard/hovercard-anchor.js.map +1 -0
- package/dist/hovercard/hovercard-arrow.d.ts +54 -0
- package/dist/hovercard/hovercard-arrow.d.ts.map +1 -0
- package/dist/hovercard/hovercard-arrow.js +51 -0
- package/dist/hovercard/hovercard-arrow.js.map +1 -0
- package/dist/hovercard/hovercard-context.d.ts +24 -0
- package/dist/hovercard/hovercard-context.d.ts.map +1 -0
- package/dist/hovercard/hovercard-context.js +27 -0
- package/dist/hovercard/hovercard-context.js.map +1 -0
- package/dist/hovercard/hovercard-description.d.ts +51 -0
- package/dist/hovercard/hovercard-description.d.ts.map +1 -0
- package/dist/hovercard/hovercard-description.js +42 -0
- package/dist/hovercard/hovercard-description.js.map +1 -0
- package/dist/hovercard/hovercard-disclosure.d.ts +51 -0
- package/dist/hovercard/hovercard-disclosure.d.ts.map +1 -0
- package/dist/hovercard/hovercard-disclosure.js +122 -0
- package/dist/hovercard/hovercard-disclosure.js.map +1 -0
- package/dist/hovercard/hovercard-dismiss.d.ts +50 -0
- package/dist/hovercard/hovercard-dismiss.d.ts.map +1 -0
- package/dist/hovercard/hovercard-dismiss.js +47 -0
- package/dist/hovercard/hovercard-dismiss.js.map +1 -0
- package/dist/hovercard/hovercard-heading.d.ts +51 -0
- package/dist/hovercard/hovercard-heading.d.ts.map +1 -0
- package/dist/hovercard/hovercard-heading.js +42 -0
- package/dist/hovercard/hovercard-heading.js.map +1 -0
- package/dist/hovercard/hovercard-provider.d.ts +23 -0
- package/dist/hovercard/hovercard-provider.d.ts.map +1 -0
- package/dist/hovercard/hovercard-provider.js +27 -0
- package/dist/hovercard/hovercard-provider.js.map +1 -0
- package/dist/hovercard/hovercard-store.d.ts +2 -0
- package/dist/hovercard/hovercard-store.js +31 -0
- package/dist/hovercard/hovercard-store.js.map +1 -0
- package/dist/hovercard/hovercard.d.ts +80 -0
- package/dist/hovercard/hovercard.d.ts.map +1 -0
- package/dist/hovercard/hovercard.js +240 -0
- package/dist/hovercard/hovercard.js.map +1 -0
- package/dist/hovercard/utils/debug-polygon.d.ts +7 -0
- package/dist/hovercard/utils/debug-polygon.d.ts.map +1 -0
- package/dist/hovercard/utils/debug-polygon.js +33 -0
- package/dist/hovercard/utils/debug-polygon.js.map +1 -0
- package/dist/hovercard/utils/polygon.d.ts +9 -0
- package/dist/hovercard/utils/polygon.d.ts.map +1 -0
- package/dist/hovercard/utils/polygon.js +70 -0
- package/dist/hovercard/utils/polygon.js.map +1 -0
- package/dist/hovercard-store-gIeoQEn_.d.ts +30 -0
- package/dist/hovercard-store-gIeoQEn_.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/menu/menu-arrow.d.ts +52 -0
- package/dist/menu/menu-arrow.d.ts.map +1 -0
- package/dist/menu/menu-arrow.js +49 -0
- package/dist/menu/menu-arrow.js.map +1 -0
- package/dist/menu/menu-bar-provider.d.ts +35 -0
- package/dist/menu/menu-bar-provider.d.ts.map +1 -0
- package/dist/menu/menu-bar-provider.js +42 -0
- package/dist/menu/menu-bar-provider.js.map +1 -0
- package/dist/menu/menu-bar-store.d.ts +25 -0
- package/dist/menu/menu-bar-store.d.ts.map +1 -0
- package/dist/menu/menu-bar-store.js +28 -0
- package/dist/menu/menu-bar-store.js.map +1 -0
- package/dist/menu/menu-bar.d.ts +61 -0
- package/dist/menu/menu-bar.d.ts.map +1 -0
- package/dist/menu/menu-bar.js +66 -0
- package/dist/menu/menu-bar.js.map +1 -0
- package/dist/menu/menu-button-arrow.d.ts +65 -0
- package/dist/menu/menu-button-arrow.d.ts.map +1 -0
- package/dist/menu/menu-button-arrow.js +62 -0
- package/dist/menu/menu-button-arrow.js.map +1 -0
- package/dist/menu/menu-button.d.ts +67 -0
- package/dist/menu/menu-button.d.ts.map +1 -0
- package/dist/menu/menu-button.js +183 -0
- package/dist/menu/menu-button.js.map +1 -0
- package/dist/menu/menu-context.d.ts +47 -0
- package/dist/menu/menu-context.d.ts.map +1 -0
- package/dist/menu/menu-context.js +52 -0
- package/dist/menu/menu-context.js.map +1 -0
- package/dist/menu/menu-description.d.ts +50 -0
- package/dist/menu/menu-description.d.ts.map +1 -0
- package/dist/menu/menu-description.js +42 -0
- package/dist/menu/menu-description.js.map +1 -0
- package/dist/menu/menu-dismiss.d.ts +49 -0
- package/dist/menu/menu-dismiss.d.ts.map +1 -0
- package/dist/menu/menu-dismiss.js +47 -0
- package/dist/menu/menu-dismiss.js.map +1 -0
- package/dist/menu/menu-group-label.d.ts +55 -0
- package/dist/menu/menu-group-label.d.ts.map +1 -0
- package/dist/menu/menu-group-label.js +47 -0
- package/dist/menu/menu-group-label.js.map +1 -0
- package/dist/menu/menu-group.d.ts +61 -0
- package/dist/menu/menu-group.d.ts.map +1 -0
- package/dist/menu/menu-group.js +53 -0
- package/dist/menu/menu-group.js.map +1 -0
- package/dist/menu/menu-heading.d.ts +50 -0
- package/dist/menu/menu-heading.d.ts.map +1 -0
- package/dist/menu/menu-heading.js +42 -0
- package/dist/menu/menu-heading.js.map +1 -0
- package/dist/menu/menu-item-check.d.ts +58 -0
- package/dist/menu/menu-item-check.d.ts.map +1 -0
- package/dist/menu/menu-item-check.js +60 -0
- package/dist/menu/menu-item-check.js.map +1 -0
- package/dist/menu/menu-item-checkbox.d.ts +104 -0
- package/dist/menu/menu-item-checkbox.d.ts.map +1 -0
- package/dist/menu/menu-item-checkbox.js +151 -0
- package/dist/menu/menu-item-checkbox.js.map +1 -0
- package/dist/menu/menu-item-radio.d.ts +91 -0
- package/dist/menu/menu-item-radio.d.ts.map +1 -0
- package/dist/menu/menu-item-radio.js +121 -0
- package/dist/menu/menu-item-radio.js.map +1 -0
- package/dist/menu/menu-item.d.ts +75 -0
- package/dist/menu/menu-item.d.ts.map +1 -0
- package/dist/menu/menu-item.js +122 -0
- package/dist/menu/menu-item.js.map +1 -0
- package/dist/menu/menu-list.d.ts +59 -0
- package/dist/menu/menu-list.d.ts.map +1 -0
- package/dist/menu/menu-list.js +168 -0
- package/dist/menu/menu-list.js.map +1 -0
- package/dist/menu/menu-provider.d.ts +29 -0
- package/dist/menu/menu-provider.d.ts.map +1 -0
- package/dist/menu/menu-provider.js +15 -0
- package/dist/menu/menu-provider.js.map +1 -0
- package/dist/menu/menu-separator.d.ts +59 -0
- package/dist/menu/menu-separator.d.ts.map +1 -0
- package/dist/menu/menu-separator.js +57 -0
- package/dist/menu/menu-separator.js.map +1 -0
- package/dist/menu/menu-store.d.ts +2 -0
- package/dist/menu/menu-store.js +40 -0
- package/dist/menu/menu-store.js.map +1 -0
- package/dist/menu/menu.d.ts +49 -0
- package/dist/menu/menu.d.ts.map +1 -0
- package/dist/menu/menu.js +169 -0
- package/dist/menu/menu.js.map +1 -0
- package/dist/menu-store-0CKKmNek.d.ts +83 -0
- package/dist/menu-store-0CKKmNek.d.ts.map +1 -0
- package/dist/menubar/menubar-context.d.ts +25 -0
- package/dist/menubar/menubar-context.d.ts.map +1 -0
- package/dist/menubar/menubar-context.js +29 -0
- package/dist/menubar/menubar-context.js.map +1 -0
- package/dist/menubar/menubar-provider.d.ts +37 -0
- package/dist/menubar/menubar-provider.d.ts.map +1 -0
- package/dist/menubar/menubar-provider.js +41 -0
- package/dist/menubar/menubar-provider.js.map +1 -0
- package/dist/menubar/menubar-store.d.ts +2 -0
- package/dist/menubar/menubar-store.js +27 -0
- package/dist/menubar/menubar-store.js.map +1 -0
- package/dist/menubar/menubar.d.ts +71 -0
- package/dist/menubar/menubar.d.ts.map +1 -0
- package/dist/menubar/menubar.js +88 -0
- package/dist/menubar/menubar.js.map +1 -0
- package/dist/menubar-store-3h0eNIbS.d.ts +26 -0
- package/dist/menubar-store-3h0eNIbS.d.ts.map +1 -0
- package/dist/popover/popover-anchor.d.ts +2 -0
- package/dist/popover/popover-anchor.js +45 -0
- package/dist/popover/popover-anchor.js.map +1 -0
- package/dist/popover/popover-arrow-path.d.ts +5 -0
- package/dist/popover/popover-arrow-path.d.ts.map +1 -0
- package/dist/popover/popover-arrow-path.js +7 -0
- package/dist/popover/popover-arrow-path.js.map +1 -0
- package/dist/popover/popover-arrow.d.ts +65 -0
- package/dist/popover/popover-arrow.d.ts.map +1 -0
- package/dist/popover/popover-arrow.js +160 -0
- package/dist/popover/popover-arrow.js.map +1 -0
- package/dist/popover/popover-context.d.ts +24 -0
- package/dist/popover/popover-context.d.ts.map +1 -0
- package/dist/popover/popover-context.js +27 -0
- package/dist/popover/popover-context.js.map +1 -0
- package/dist/popover/popover-description.d.ts +2 -0
- package/dist/popover/popover-description.js +42 -0
- package/dist/popover/popover-description.js.map +1 -0
- package/dist/popover/popover-disclosure-arrow.d.ts +62 -0
- package/dist/popover/popover-disclosure-arrow.d.ts.map +1 -0
- package/dist/popover/popover-disclosure-arrow.js +81 -0
- package/dist/popover/popover-disclosure-arrow.js.map +1 -0
- package/dist/popover/popover-disclosure.d.ts +38 -0
- package/dist/popover/popover-disclosure.d.ts.map +1 -0
- package/dist/popover/popover-disclosure.js +66 -0
- package/dist/popover/popover-disclosure.js.map +1 -0
- package/dist/popover/popover-dismiss.d.ts +2 -0
- package/dist/popover/popover-dismiss.js +47 -0
- package/dist/popover/popover-dismiss.js.map +1 -0
- package/dist/popover/popover-heading.d.ts +2 -0
- package/dist/popover/popover-heading.js +42 -0
- package/dist/popover/popover-heading.js.map +1 -0
- package/dist/popover/popover-provider.d.ts +23 -0
- package/dist/popover/popover-provider.d.ts.map +1 -0
- package/dist/popover/popover-provider.js +27 -0
- package/dist/popover/popover-provider.js.map +1 -0
- package/dist/popover/popover-store.d.ts +2 -0
- package/dist/popover/popover-store.js +30 -0
- package/dist/popover/popover-store.js.map +1 -0
- package/dist/popover/popover.d.ts +2 -0
- package/dist/popover/popover.js +312 -0
- package/dist/popover/popover.js.map +1 -0
- package/dist/popover-CCqiRKqg.d.ts +181 -0
- package/dist/popover-CCqiRKqg.d.ts.map +1 -0
- package/dist/popover-anchor-PgfeXyzs.d.ts +47 -0
- package/dist/popover-anchor-PgfeXyzs.d.ts.map +1 -0
- package/dist/popover-description-DU753dah.d.ts +51 -0
- package/dist/popover-description-DU753dah.d.ts.map +1 -0
- package/dist/popover-dismiss-DPeI6Zse.d.ts +50 -0
- package/dist/popover-dismiss-DPeI6Zse.d.ts.map +1 -0
- package/dist/popover-heading-DGsr6D5W.d.ts +51 -0
- package/dist/popover-heading-DGsr6D5W.d.ts.map +1 -0
- package/dist/popover-store-Bc-l5VVO.d.ts +29 -0
- package/dist/popover-store-Bc-l5VVO.d.ts.map +1 -0
- package/dist/portal/portal-context.d.ts +21 -0
- package/dist/portal/portal-context.d.ts.map +1 -0
- package/dist/portal/portal-context.js +24 -0
- package/dist/portal/portal-context.js.map +1 -0
- package/dist/portal/portal.d.ts +2 -0
- package/dist/portal/portal.js +242 -0
- package/dist/portal/portal.js.map +1 -0
- package/dist/portal-CMBWiayp.d.ts +149 -0
- package/dist/portal-CMBWiayp.d.ts.map +1 -0
- package/dist/radio/radio-context.d.ts +24 -0
- package/dist/radio/radio-context.d.ts.map +1 -0
- package/dist/radio/radio-context.js +27 -0
- package/dist/radio/radio-context.js.map +1 -0
- package/dist/radio/radio-group.d.ts +51 -0
- package/dist/radio/radio-group.d.ts.map +1 -0
- package/dist/radio/radio-group.js +60 -0
- package/dist/radio/radio-group.js.map +1 -0
- package/dist/radio/radio-provider.d.ts +25 -0
- package/dist/radio/radio-provider.d.ts.map +1 -0
- package/dist/radio/radio-provider.js +29 -0
- package/dist/radio/radio-provider.js.map +1 -0
- package/dist/radio/radio-store.d.ts +2 -0
- package/dist/radio/radio-store.js +33 -0
- package/dist/radio/radio-store.js.map +1 -0
- package/dist/radio/radio.d.ts +76 -0
- package/dist/radio/radio.d.ts.map +1 -0
- package/dist/radio/radio.js +143 -0
- package/dist/radio/radio.js.map +1 -0
- package/dist/radio-store-DOZ_1RSk.d.ts +36 -0
- package/dist/radio-store-DOZ_1RSk.d.ts.map +1 -0
- package/dist/role/role.d.ts +34 -0
- package/dist/role/role.d.ts.map +1 -0
- package/dist/role/role.js +68 -0
- package/dist/role/role.js.map +1 -0
- package/dist/select/select-arrow.d.ts +60 -0
- package/dist/select/select-arrow.d.ts.map +1 -0
- package/dist/select/select-arrow.js +58 -0
- package/dist/select/select-arrow.js.map +1 -0
- package/dist/select/select-context.d.ts +27 -0
- package/dist/select/select-context.d.ts.map +1 -0
- package/dist/select/select-context.js +31 -0
- package/dist/select/select-context.js.map +1 -0
- package/dist/select/select-dismiss.d.ts +59 -0
- package/dist/select/select-dismiss.d.ts.map +1 -0
- package/dist/select/select-dismiss.js +56 -0
- package/dist/select/select-dismiss.js.map +1 -0
- package/dist/select/select-group-label.d.ts +61 -0
- package/dist/select/select-group-label.d.ts.map +1 -0
- package/dist/select/select-group-label.js +52 -0
- package/dist/select/select-group-label.js.map +1 -0
- package/dist/select/select-group.d.ts +62 -0
- package/dist/select/select-group.d.ts.map +1 -0
- package/dist/select/select-group.js +53 -0
- package/dist/select/select-group.js.map +1 -0
- package/dist/select/select-heading.d.ts +59 -0
- package/dist/select/select-heading.d.ts.map +1 -0
- package/dist/select/select-heading.js +62 -0
- package/dist/select/select-heading.js.map +1 -0
- package/dist/select/select-item-check.d.ts +59 -0
- package/dist/select/select-item-check.d.ts.map +1 -0
- package/dist/select/select-item-check.js +61 -0
- package/dist/select/select-item-check.js.map +1 -0
- package/dist/select/select-item-offscreen.d.ts +37 -0
- package/dist/select/select-item-offscreen.d.ts.map +1 -0
- package/dist/select/select-item-offscreen.js +38 -0
- package/dist/select/select-item-offscreen.js.map +1 -0
- package/dist/select/select-item.d.ts +108 -0
- package/dist/select/select-item.d.ts.map +1 -0
- package/dist/select/select-item.js +143 -0
- package/dist/select/select-item.js.map +1 -0
- package/dist/select/select-label.d.ts +55 -0
- package/dist/select/select-label.d.ts.map +1 -0
- package/dist/select/select-label.js +70 -0
- package/dist/select/select-label.js.map +1 -0
- package/dist/select/select-list.d.ts +80 -0
- package/dist/select/select-list.d.ts.map +1 -0
- package/dist/select/select-list.js +143 -0
- package/dist/select/select-list.js.map +1 -0
- package/dist/select/select-popover.d.ts +44 -0
- package/dist/select/select-popover.d.ts.map +1 -0
- package/dist/select/select-popover.js +59 -0
- package/dist/select/select-popover.js.map +1 -0
- package/dist/select/select-provider.d.ts +30 -0
- package/dist/select/select-provider.d.ts.map +1 -0
- package/dist/select/select-provider.js +15 -0
- package/dist/select/select-provider.js.map +1 -0
- package/dist/select/select-renderer.d.ts +44 -0
- package/dist/select/select-renderer.d.ts.map +1 -0
- package/dist/select/select-renderer.js +61 -0
- package/dist/select/select-renderer.js.map +1 -0
- package/dist/select/select-row.d.ts +63 -0
- package/dist/select/select-row.d.ts.map +1 -0
- package/dist/select/select-row.js +67 -0
- package/dist/select/select-row.js.map +1 -0
- package/dist/select/select-separator.d.ts +60 -0
- package/dist/select/select-separator.d.ts.map +1 -0
- package/dist/select/select-separator.js +57 -0
- package/dist/select/select-separator.js.map +1 -0
- package/dist/select/select-store.d.ts +2 -0
- package/dist/select/select-store.js +31 -0
- package/dist/select/select-store.js.map +1 -0
- package/dist/select/select-value.d.ts +84 -0
- package/dist/select/select-value.d.ts.map +1 -0
- package/dist/select/select-value.js +18 -0
- package/dist/select/select-value.js.map +1 -0
- package/dist/select/select.d.ts +89 -0
- package/dist/select/select.d.ts.map +1 -0
- package/dist/select/select.js +211 -0
- package/dist/select/select.js.map +1 -0
- package/dist/select-store-BsLTAyKh.d.ts +68 -0
- package/dist/select-store-BsLTAyKh.d.ts.map +1 -0
- package/dist/separator/separator.d.ts +2 -0
- package/dist/separator/separator.js +36 -0
- package/dist/separator/separator.js.map +1 -0
- package/dist/separator--ozQfMcK.d.ts +36 -0
- package/dist/separator--ozQfMcK.d.ts.map +1 -0
- package/dist/store.d.ts +1 -0
- package/dist/store.js +2 -0
- package/dist/tab/tab-context.d.ts +24 -0
- package/dist/tab/tab-context.d.ts.map +1 -0
- package/dist/tab/tab-context.js +27 -0
- package/dist/tab/tab-context.js.map +1 -0
- package/dist/tab/tab-list.d.ts +55 -0
- package/dist/tab/tab-list.d.ts.map +1 -0
- package/dist/tab/tab-list.js +71 -0
- package/dist/tab/tab-list.js.map +1 -0
- package/dist/tab/tab-panel.d.ts +122 -0
- package/dist/tab/tab-panel.d.ts.map +1 -0
- package/dist/tab/tab-panel.js +169 -0
- package/dist/tab/tab-panel.js.map +1 -0
- package/dist/tab/tab-provider.d.ts +26 -0
- package/dist/tab/tab-provider.d.ts.map +1 -0
- package/dist/tab/tab-provider.js +30 -0
- package/dist/tab/tab-provider.js.map +1 -0
- package/dist/tab/tab-store.d.ts +77 -0
- package/dist/tab/tab-store.d.ts.map +1 -0
- package/dist/tab/tab-store.js +55 -0
- package/dist/tab/tab-store.js.map +1 -0
- package/dist/tab/tab.d.ts +56 -0
- package/dist/tab/tab.d.ts.map +1 -0
- package/dist/tab/tab.js +115 -0
- package/dist/tab/tab.js.map +1 -0
- package/dist/tag/tag-context.d.ts +26 -0
- package/dist/tag/tag-context.d.ts.map +1 -0
- package/dist/tag/tag-context.js +30 -0
- package/dist/tag/tag-context.js.map +1 -0
- package/dist/tag/tag-input.d.ts +126 -0
- package/dist/tag/tag-input.d.ts.map +1 -0
- package/dist/tag/tag-input.js +162 -0
- package/dist/tag/tag-input.js.map +1 -0
- package/dist/tag/tag-list-label.d.ts +59 -0
- package/dist/tag/tag-list-label.d.ts.map +1 -0
- package/dist/tag/tag-list-label.js +62 -0
- package/dist/tag/tag-list-label.js.map +1 -0
- package/dist/tag/tag-list.d.ts +62 -0
- package/dist/tag/tag-list.d.ts.map +1 -0
- package/dist/tag/tag-list.js +127 -0
- package/dist/tag/tag-list.js.map +1 -0
- package/dist/tag/tag-provider.d.ts +34 -0
- package/dist/tag/tag-provider.d.ts.map +1 -0
- package/dist/tag/tag-provider.js +38 -0
- package/dist/tag/tag-provider.js.map +1 -0
- package/dist/tag/tag-remove.d.ts +71 -0
- package/dist/tag/tag-remove.d.ts.map +1 -0
- package/dist/tag/tag-remove.js +102 -0
- package/dist/tag/tag-remove.js.map +1 -0
- package/dist/tag/tag-store.d.ts +2 -0
- package/dist/tag/tag-store.js +38 -0
- package/dist/tag/tag-store.js.map +1 -0
- package/dist/tag/tag-value.d.ts +49 -0
- package/dist/tag/tag-value.d.ts.map +1 -0
- package/dist/tag/tag-value.js +40 -0
- package/dist/tag/tag-value.js.map +1 -0
- package/dist/tag/tag-values.d.ts +60 -0
- package/dist/tag/tag-values.d.ts.map +1 -0
- package/dist/tag/tag-values.js +50 -0
- package/dist/tag/tag-values.js.map +1 -0
- package/dist/tag/tag.d.ts +78 -0
- package/dist/tag/tag.d.ts.map +1 -0
- package/dist/tag/tag.js +114 -0
- package/dist/tag/tag.js.map +1 -0
- package/dist/tag/utils.d.ts +5 -0
- package/dist/tag/utils.d.ts.map +1 -0
- package/dist/tag/utils.js +15 -0
- package/dist/tag/utils.js.map +1 -0
- package/dist/tag-store-xANOvuGo.d.ts +49 -0
- package/dist/tag-store-xANOvuGo.d.ts.map +1 -0
- package/dist/toolbar/toolbar-container.d.ts +41 -0
- package/dist/toolbar/toolbar-container.d.ts.map +1 -0
- package/dist/toolbar/toolbar-container.js +53 -0
- package/dist/toolbar/toolbar-container.js.map +1 -0
- package/dist/toolbar/toolbar-context.d.ts +24 -0
- package/dist/toolbar/toolbar-context.d.ts.map +1 -0
- package/dist/toolbar/toolbar-context.js +27 -0
- package/dist/toolbar/toolbar-context.js.map +1 -0
- package/dist/toolbar/toolbar-input.d.ts +39 -0
- package/dist/toolbar/toolbar-input.d.ts.map +1 -0
- package/dist/toolbar/toolbar-input.js +47 -0
- package/dist/toolbar/toolbar-input.js.map +1 -0
- package/dist/toolbar/toolbar-item.d.ts +47 -0
- package/dist/toolbar/toolbar-item.d.ts.map +1 -0
- package/dist/toolbar/toolbar-item.js +45 -0
- package/dist/toolbar/toolbar-item.js.map +1 -0
- package/dist/toolbar/toolbar-provider.d.ts +26 -0
- package/dist/toolbar/toolbar-provider.d.ts.map +1 -0
- package/dist/toolbar/toolbar-provider.js +30 -0
- package/dist/toolbar/toolbar-provider.js.map +1 -0
- package/dist/toolbar/toolbar-separator.d.ts +51 -0
- package/dist/toolbar/toolbar-separator.d.ts.map +1 -0
- package/dist/toolbar/toolbar-separator.js +49 -0
- package/dist/toolbar/toolbar-separator.js.map +1 -0
- package/dist/toolbar/toolbar-store.d.ts +2 -0
- package/dist/toolbar/toolbar-store.js +31 -0
- package/dist/toolbar/toolbar-store.js.map +1 -0
- package/dist/toolbar/toolbar.d.ts +50 -0
- package/dist/toolbar/toolbar.d.ts.map +1 -0
- package/dist/toolbar/toolbar.js +66 -0
- package/dist/toolbar/toolbar.js.map +1 -0
- package/dist/toolbar-store-Cs-9cGHx.d.ts +30 -0
- package/dist/toolbar-store-Cs-9cGHx.d.ts.map +1 -0
- package/dist/tooltip/tooltip-anchor.d.ts +53 -0
- package/dist/tooltip/tooltip-anchor.d.ts.map +1 -0
- package/dist/tooltip/tooltip-anchor.js +121 -0
- package/dist/tooltip/tooltip-anchor.js.map +1 -0
- package/dist/tooltip/tooltip-arrow.d.ts +54 -0
- package/dist/tooltip/tooltip-arrow.d.ts.map +1 -0
- package/dist/tooltip/tooltip-arrow.js +54 -0
- package/dist/tooltip/tooltip-arrow.js.map +1 -0
- package/dist/tooltip/tooltip-context.d.ts +24 -0
- package/dist/tooltip/tooltip-context.d.ts.map +1 -0
- package/dist/tooltip/tooltip-context.js +27 -0
- package/dist/tooltip/tooltip-context.js.map +1 -0
- package/dist/tooltip/tooltip-provider.d.ts +23 -0
- package/dist/tooltip/tooltip-provider.d.ts.map +1 -0
- package/dist/tooltip/tooltip-provider.js +27 -0
- package/dist/tooltip/tooltip-provider.js.map +1 -0
- package/dist/tooltip/tooltip-store.d.ts +30 -0
- package/dist/tooltip/tooltip-store.d.ts.map +1 -0
- package/dist/tooltip/tooltip-store.js +30 -0
- package/dist/tooltip/tooltip-store.js.map +1 -0
- package/dist/tooltip/tooltip.d.ts +61 -0
- package/dist/tooltip/tooltip.d.ts.map +1 -0
- package/dist/tooltip/tooltip.js +81 -0
- package/dist/tooltip/tooltip.js.map +1 -0
- package/dist/utils-DUF1aMov.d.ts +5 -0
- package/dist/utils-DUF1aMov.d.ts.map +1 -0
- package/dist/visually-hidden/visually-hidden.d.ts +37 -0
- package/dist/visually-hidden/visually-hidden.d.ts.map +1 -0
- package/dist/visually-hidden/visually-hidden.js +53 -0
- package/dist/visually-hidden/visually-hidden.js.map +1 -0
- package/license +21 -0
- package/package.json +936 -0
- package/readme.md +19 -0
- package/src/button/button.tsx +76 -0
- package/src/checkbox/checkbox-check.tsx +116 -0
- package/src/checkbox/checkbox-checked-context.tsx +3 -0
- package/src/checkbox/checkbox-context.tsx +27 -0
- package/src/checkbox/checkbox-provider.tsx +53 -0
- package/src/checkbox/checkbox-store.ts +76 -0
- package/src/checkbox/checkbox.tsx +271 -0
- package/src/collection/collection-context.tsx +27 -0
- package/src/collection/collection-item-offscreen.tsx +157 -0
- package/src/collection/collection-item.tsx +136 -0
- package/src/collection/collection-provider.tsx +47 -0
- package/src/collection/collection-renderer.tsx +994 -0
- package/src/collection/collection-store.ts +84 -0
- package/src/collection/collection.tsx +93 -0
- package/src/combobox/combobox-cancel.tsx +153 -0
- package/src/combobox/combobox-context.tsx +49 -0
- package/src/combobox/combobox-disclosure.tsx +162 -0
- package/src/combobox/combobox-group-label.tsx +74 -0
- package/src/combobox/combobox-group.tsx +100 -0
- package/src/combobox/combobox-item-check.tsx +83 -0
- package/src/combobox/combobox-item-offscreen.tsx +87 -0
- package/src/combobox/combobox-item-value.tsx +231 -0
- package/src/combobox/combobox-item.tsx +363 -0
- package/src/combobox/combobox-label.tsx +89 -0
- package/src/combobox/combobox-list.tsx +176 -0
- package/src/combobox/combobox-popover.tsx +179 -0
- package/src/combobox/combobox-provider.tsx +50 -0
- package/src/combobox/combobox-row.tsx +102 -0
- package/src/combobox/combobox-separator.tsx +90 -0
- package/src/combobox/combobox-store.ts +168 -0
- package/src/combobox/combobox-value.tsx +63 -0
- package/src/combobox/combobox.tsx +900 -0
- package/src/command/command.tsx +215 -0
- package/src/composite/composite-container.tsx +278 -0
- package/src/composite/composite-context.tsx +53 -0
- package/src/composite/composite-group-label.tsx +73 -0
- package/src/composite/composite-group.tsx +77 -0
- package/src/composite/composite-hover.tsx +230 -0
- package/src/composite/composite-input.tsx +147 -0
- package/src/composite/composite-item-offscreen.tsx +112 -0
- package/src/composite/composite-item.tsx +567 -0
- package/src/composite/composite-overflow-disclosure.ts +117 -0
- package/src/composite/composite-overflow-store.ts +61 -0
- package/src/composite/composite-overflow.tsx +123 -0
- package/src/composite/composite-provider.tsx +47 -0
- package/src/composite/composite-renderer.tsx +231 -0
- package/src/composite/composite-row.tsx +133 -0
- package/src/composite/composite-separator.tsx +96 -0
- package/src/composite/composite-store.ts +101 -0
- package/src/composite/composite-typeahead.tsx +246 -0
- package/src/composite/composite.tsx +592 -0
- package/src/composite/utils.ts +121 -0
- package/src/dialog/dialog-backdrop.tsx +71 -0
- package/src/dialog/dialog-context.tsx +43 -0
- package/src/dialog/dialog-description.tsx +86 -0
- package/src/dialog/dialog-disclosure.tsx +84 -0
- package/src/dialog/dialog-dismiss.tsx +113 -0
- package/src/dialog/dialog-heading.tsx +88 -0
- package/src/dialog/dialog-provider.tsx +28 -0
- package/src/dialog/dialog-store.ts +51 -0
- package/src/dialog/dialog.tsx +866 -0
- package/src/dialog/utils/disable-accessibility-tree-outside.ts +30 -0
- package/src/dialog/utils/disable-tree.ts +81 -0
- package/src/dialog/utils/is-backdrop.ts +12 -0
- package/src/dialog/utils/is-focus-trap.ts +11 -0
- package/src/dialog/utils/mark-tree-outside.ts +67 -0
- package/src/dialog/utils/orchestrate.ts +123 -0
- package/src/dialog/utils/prepend-hidden-dismiss.ts +35 -0
- package/src/dialog/utils/supports-inert.ts +5 -0
- package/src/dialog/utils/use-hide-on-interact-outside.ts +181 -0
- package/src/dialog/utils/use-nested-dialogs.tsx +55 -0
- package/src/dialog/utils/use-prevent-body-scroll.ts +86 -0
- package/src/dialog/utils/use-previous-mouse-down-ref.ts +19 -0
- package/src/dialog/utils/use-root-dialog.ts +49 -0
- package/src/dialog/utils/walk-tree-outside.ts +85 -0
- package/src/disclosure/disclosure-content.tsx +344 -0
- package/src/disclosure/disclosure-context.tsx +27 -0
- package/src/disclosure/disclosure-provider.tsx +29 -0
- package/src/disclosure/disclosure-store.ts +85 -0
- package/src/disclosure/disclosure.tsx +144 -0
- package/src/focus-trap/focus-trap-region.tsx +112 -0
- package/src/focus-trap/focus-trap.tsx +60 -0
- package/src/focusable/focusable-container.tsx +75 -0
- package/src/focusable/focusable-context.tsx +3 -0
- package/src/focusable/focusable.tsx +559 -0
- package/src/form/form-checkbox.tsx +106 -0
- package/src/form/form-context.tsx +34 -0
- package/src/form/form-control.tsx +227 -0
- package/src/form/form-description.tsx +142 -0
- package/src/form/form-error.tsx +156 -0
- package/src/form/form-field.tsx +94 -0
- package/src/form/form-group-label.tsx +79 -0
- package/src/form/form-group.tsx +79 -0
- package/src/form/form-input.tsx +104 -0
- package/src/form/form-label.tsx +192 -0
- package/src/form/form-provider.tsx +49 -0
- package/src/form/form-push.tsx +200 -0
- package/src/form/form-radio-group.tsx +93 -0
- package/src/form/form-radio.tsx +122 -0
- package/src/form/form-remove.tsx +198 -0
- package/src/form/form-reset.tsx +85 -0
- package/src/form/form-store.ts +195 -0
- package/src/form/form-submit.tsx +93 -0
- package/src/form/form.tsx +249 -0
- package/src/group/group-label-context.tsx +6 -0
- package/src/group/group-label.tsx +75 -0
- package/src/group/group.tsx +69 -0
- package/src/heading/heading-context.tsx +4 -0
- package/src/heading/heading-level.tsx +42 -0
- package/src/heading/heading.tsx +81 -0
- package/src/heading/utils.ts +1 -0
- package/src/hovercard/hovercard-anchor.tsx +195 -0
- package/src/hovercard/hovercard-arrow.tsx +74 -0
- package/src/hovercard/hovercard-context.tsx +34 -0
- package/src/hovercard/hovercard-description.tsx +69 -0
- package/src/hovercard/hovercard-disclosure.tsx +196 -0
- package/src/hovercard/hovercard-dismiss.tsx +70 -0
- package/src/hovercard/hovercard-heading.tsx +68 -0
- package/src/hovercard/hovercard-provider.tsx +29 -0
- package/src/hovercard/hovercard-store.ts +58 -0
- package/src/hovercard/hovercard.tsx +445 -0
- package/src/hovercard/utils/__tests__/polygon-test.ts +66 -0
- package/src/hovercard/utils/debug-polygon.ts +37 -0
- package/src/hovercard/utils/polygon.ts +96 -0
- package/src/index.ts +1 -0
- package/src/menu/menu-arrow.tsx +69 -0
- package/src/menu/menu-bar-provider.tsx +44 -0
- package/src/menu/menu-bar-store.ts +54 -0
- package/src/menu/menu-bar.tsx +84 -0
- package/src/menu/menu-button-arrow.tsx +85 -0
- package/src/menu/menu-button.tsx +338 -0
- package/src/menu/menu-context.tsx +76 -0
- package/src/menu/menu-description.tsx +67 -0
- package/src/menu/menu-dismiss.tsx +69 -0
- package/src/menu/menu-group-label.tsx +72 -0
- package/src/menu/menu-group.tsx +76 -0
- package/src/menu/menu-heading.tsx +67 -0
- package/src/menu/menu-item-check.tsx +79 -0
- package/src/menu/menu-item-checkbox.tsx +227 -0
- package/src/menu/menu-item-radio.tsx +198 -0
- package/src/menu/menu-item.tsx +223 -0
- package/src/menu/menu-list.tsx +230 -0
- package/src/menu/menu-provider.tsx +42 -0
- package/src/menu/menu-separator.tsx +79 -0
- package/src/menu/menu-store.ts +155 -0
- package/src/menu/menu.tsx +274 -0
- package/src/menubar/menubar-context.tsx +39 -0
- package/src/menubar/menubar-provider.tsx +43 -0
- package/src/menubar/menubar-store.ts +48 -0
- package/src/menubar/menubar.tsx +145 -0
- package/src/popover/popover-anchor.tsx +74 -0
- package/src/popover/popover-arrow-path.ts +21 -0
- package/src/popover/popover-arrow.tsx +228 -0
- package/src/popover/popover-context.tsx +34 -0
- package/src/popover/popover-description.tsx +69 -0
- package/src/popover/popover-disclosure-arrow.tsx +135 -0
- package/src/popover/popover-disclosure.tsx +101 -0
- package/src/popover/popover-dismiss.tsx +70 -0
- package/src/popover/popover-heading.tsx +68 -0
- package/src/popover/popover-provider.tsx +29 -0
- package/src/popover/popover-store.ts +53 -0
- package/src/popover/popover.tsx +649 -0
- package/src/portal/portal-context.tsx +19 -0
- package/src/portal/portal.tsx +493 -0
- package/src/radio/radio-context.tsx +34 -0
- package/src/radio/radio-group.tsx +103 -0
- package/src/radio/radio-provider.tsx +29 -0
- package/src/radio/radio-store.ts +64 -0
- package/src/radio/radio.tsx +242 -0
- package/src/role/role.tsx +88 -0
- package/src/select/select-arrow.tsx +80 -0
- package/src/select/select-context.tsx +46 -0
- package/src/select/select-dismiss.tsx +79 -0
- package/src/select/select-group-label.tsx +78 -0
- package/src/select/select-group.tsx +79 -0
- package/src/select/select-heading.tsx +98 -0
- package/src/select/select-item-check.tsx +80 -0
- package/src/select/select-item-offscreen.tsx +59 -0
- package/src/select/select-item.tsx +294 -0
- package/src/select/select-label.tsx +117 -0
- package/src/select/select-list.tsx +251 -0
- package/src/select/select-popover.tsx +67 -0
- package/src/select/select-provider.tsx +45 -0
- package/src/select/select-renderer.tsx +160 -0
- package/src/select/select-row.tsx +97 -0
- package/src/select/select-separator.tsx +80 -0
- package/src/select/select-store.ts +139 -0
- package/src/select/select-value.tsx +108 -0
- package/src/select/select.tsx +371 -0
- package/src/separator/separator.tsx +54 -0
- package/src/store.ts +1 -0
- package/src/tab/tab-context.tsx +34 -0
- package/src/tab/tab-list.tsx +120 -0
- package/src/tab/tab-panel.tsx +314 -0
- package/src/tab/tab-provider.tsx +30 -0
- package/src/tab/tab-store.ts +124 -0
- package/src/tab/tab.tsx +208 -0
- package/src/tag/tag-context.tsx +40 -0
- package/src/tag/tag-input.tsx +321 -0
- package/src/tag/tag-list-label.tsx +102 -0
- package/src/tag/tag-list.tsx +210 -0
- package/src/tag/tag-provider.tsx +38 -0
- package/src/tag/tag-remove.tsx +174 -0
- package/src/tag/tag-store.ts +72 -0
- package/src/tag/tag-value.tsx +63 -0
- package/src/tag/tag-values.tsx +74 -0
- package/src/tag/tag.tsx +199 -0
- package/src/tag/utils.ts +12 -0
- package/src/toolbar/toolbar-container.tsx +67 -0
- package/src/toolbar/toolbar-context.tsx +34 -0
- package/src/toolbar/toolbar-input.tsx +64 -0
- package/src/toolbar/toolbar-item.tsx +72 -0
- package/src/toolbar/toolbar-provider.tsx +32 -0
- package/src/toolbar/toolbar-separator.tsx +71 -0
- package/src/toolbar/toolbar-store.ts +52 -0
- package/src/toolbar/toolbar.tsx +119 -0
- package/src/tooltip/tooltip-anchor.tsx +210 -0
- package/src/tooltip/tooltip-arrow.tsx +84 -0
- package/src/tooltip/tooltip-context.tsx +34 -0
- package/src/tooltip/tooltip-provider.tsx +29 -0
- package/src/tooltip/tooltip-store.ts +53 -0
- package/src/tooltip/tooltip.tsx +153 -0
- package/src/visually-hidden/visually-hidden.tsx +67 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useWrapElement,
|
|
3
|
+
createElement,
|
|
4
|
+
createHook,
|
|
5
|
+
forwardRef,
|
|
6
|
+
} from "@ariakit/react-utils";
|
|
7
|
+
import type { Props } from "@ariakit/react-utils";
|
|
8
|
+
import type { ElementType } from "react";
|
|
9
|
+
import { CompositeScopedContextProvider } from "../composite/composite-context.tsx";
|
|
10
|
+
import type { FormGroupOptions } from "./form-group.tsx";
|
|
11
|
+
import { useFormGroup } from "./form-group.tsx";
|
|
12
|
+
|
|
13
|
+
const TagName = "div" satisfies ElementType;
|
|
14
|
+
type TagName = typeof TagName;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns props to create a `FormRadioGroup` component.
|
|
18
|
+
* @see https://ariakit.com/components/form
|
|
19
|
+
* @example
|
|
20
|
+
* ```jsx
|
|
21
|
+
* const store = useFormStore({ defaultValues: { color: "red" } });
|
|
22
|
+
* const props = useFormRadioGroup({ store });
|
|
23
|
+
* <Form store={store}>
|
|
24
|
+
* <Role {...props}>
|
|
25
|
+
* <FormGroupLabel>Favorite color</FormGroupLabel>
|
|
26
|
+
* <FormRadio name={store.names.color} value="red" />
|
|
27
|
+
* <FormRadio name={store.names.color} value="blue" />
|
|
28
|
+
* <FormRadio name={store.names.color} value="green" />
|
|
29
|
+
* </Role>
|
|
30
|
+
* </Form>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export const useFormRadioGroup = createHook<TagName, FormRadioGroupOptions>(
|
|
34
|
+
function useFormRadioGroup({ store, ...props }) {
|
|
35
|
+
// Reset the composite context so FormRadio items inside this group
|
|
36
|
+
// don't register to an unrelated ancestor composite store (e.g.,
|
|
37
|
+
// TabStore). Form controls explicitly pass their store to
|
|
38
|
+
// useCollectionItem, so they're not affected by this reset.
|
|
39
|
+
props = useWrapElement(
|
|
40
|
+
props,
|
|
41
|
+
(element) => (
|
|
42
|
+
<CompositeScopedContextProvider value={undefined}>
|
|
43
|
+
{element}
|
|
44
|
+
</CompositeScopedContextProvider>
|
|
45
|
+
),
|
|
46
|
+
[],
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
props = { role: "radiogroup", ...props };
|
|
50
|
+
props = useFormGroup(props);
|
|
51
|
+
return props;
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Renders a group element for
|
|
57
|
+
* [`FormRadio`](https://ariakit.com/reference/form-radio) elements. The
|
|
58
|
+
* [`FormGroupLabel`](https://ariakit.com/reference/form-group-label) component
|
|
59
|
+
* can be used inside this component so the `aria-labelledby` prop is properly
|
|
60
|
+
* set on the group element.
|
|
61
|
+
* @see https://ariakit.com/components/form
|
|
62
|
+
* @example
|
|
63
|
+
* ```jsx {8-13}
|
|
64
|
+
* const form = useFormStore({
|
|
65
|
+
* defaultValues: {
|
|
66
|
+
* color: "red",
|
|
67
|
+
* },
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* <Form store={form}>
|
|
71
|
+
* <FormRadioGroup>
|
|
72
|
+
* <FormGroupLabel>Favorite color</FormGroupLabel>
|
|
73
|
+
* <FormRadio name={form.names.color} value="red" />
|
|
74
|
+
* <FormRadio name={form.names.color} value="blue" />
|
|
75
|
+
* <FormRadio name={form.names.color} value="green" />
|
|
76
|
+
* </FormRadioGroup>
|
|
77
|
+
* </Form>
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export const FormRadioGroup = forwardRef(function FormRadioGroup(
|
|
81
|
+
props: FormRadioGroupProps,
|
|
82
|
+
) {
|
|
83
|
+
const htmlProps = useFormRadioGroup(props);
|
|
84
|
+
return createElement(TagName, htmlProps);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export type FormRadioGroupOptions<T extends ElementType = TagName> =
|
|
88
|
+
FormGroupOptions<T>;
|
|
89
|
+
|
|
90
|
+
export type FormRadioGroupProps<T extends ElementType = TagName> = Props<
|
|
91
|
+
T,
|
|
92
|
+
FormRadioGroupOptions<T>
|
|
93
|
+
>;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { useStoreState } from "@ariakit/react-store";
|
|
2
|
+
import {
|
|
3
|
+
useEvent,
|
|
4
|
+
createElement,
|
|
5
|
+
createHook,
|
|
6
|
+
forwardRef,
|
|
7
|
+
memo,
|
|
8
|
+
} from "@ariakit/react-utils";
|
|
9
|
+
import type { Props } from "@ariakit/react-utils";
|
|
10
|
+
import { invariant } from "@ariakit/utils";
|
|
11
|
+
import type { ChangeEvent, ElementType } from "react";
|
|
12
|
+
import type { RadioOptions } from "../radio/radio.tsx";
|
|
13
|
+
import { useRadio } from "../radio/radio.tsx";
|
|
14
|
+
import { useFormContext } from "./form-context.tsx";
|
|
15
|
+
import type { FormControlOptions } from "./form-control.tsx";
|
|
16
|
+
import { useFormControl } from "./form-control.tsx";
|
|
17
|
+
|
|
18
|
+
const TagName = "input" satisfies ElementType;
|
|
19
|
+
type TagName = typeof TagName;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Returns props to create a `FormRadio` component.
|
|
23
|
+
* @see https://ariakit.com/components/form
|
|
24
|
+
* @example
|
|
25
|
+
* ```jsx
|
|
26
|
+
* const store = useFormStore({ defaultValues: { char: "a" } });
|
|
27
|
+
* const a = useFormRadio({ store, name: store.names.char, value: "a" });
|
|
28
|
+
* const b = useFormRadio({ store, name: store.names.char, value: "b" });
|
|
29
|
+
* const c = useFormRadio({ store, name: store.names.char, value: "c" });
|
|
30
|
+
* <Form store={store}>
|
|
31
|
+
* <FormRadioGroup>
|
|
32
|
+
* <FormGroupLabel>Favorite character</FormGroupLabel>
|
|
33
|
+
* <Role {...a} />
|
|
34
|
+
* <Role {...b} />
|
|
35
|
+
* <Role {...c} />
|
|
36
|
+
* </FormRadioGroup>
|
|
37
|
+
* </Form>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export const useFormRadio = createHook<TagName, FormRadioOptions>(
|
|
41
|
+
function useFormRadio({ store, name: nameProp, value, ...props }) {
|
|
42
|
+
const context = useFormContext();
|
|
43
|
+
store = store || context;
|
|
44
|
+
|
|
45
|
+
invariant(
|
|
46
|
+
store,
|
|
47
|
+
process.env.NODE_ENV !== "production" &&
|
|
48
|
+
"FormRadio must be wrapped in a Form component.",
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const name = String(nameProp);
|
|
52
|
+
const onChangeProp = props.onChange;
|
|
53
|
+
|
|
54
|
+
const onChange = useEvent((event: ChangeEvent<HTMLInputElement>) => {
|
|
55
|
+
onChangeProp?.(event);
|
|
56
|
+
if (event.defaultPrevented) return;
|
|
57
|
+
store?.setValue(name, value);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const checkedProp = props.checked;
|
|
61
|
+
const checked = useStoreState(
|
|
62
|
+
store,
|
|
63
|
+
() => checkedProp ?? store?.getValue(name) === value,
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
props = {
|
|
67
|
+
...props,
|
|
68
|
+
checked,
|
|
69
|
+
onChange,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
props = useRadio({ name, value, ...props });
|
|
73
|
+
|
|
74
|
+
props = useFormControl({
|
|
75
|
+
store,
|
|
76
|
+
name,
|
|
77
|
+
"aria-labelledby": undefined,
|
|
78
|
+
...props,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return props;
|
|
82
|
+
},
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Renders a radio button as a form control. This component must be wrapped in a
|
|
87
|
+
* [`FormRadioGroup`](https://ariakit.com/reference/form-radio-group) along with
|
|
88
|
+
* other radio buttons sharing the same
|
|
89
|
+
* [`name`](https://ariakit.com/reference/form-radio#name).
|
|
90
|
+
* @see https://ariakit.com/components/form
|
|
91
|
+
* @example
|
|
92
|
+
* ```jsx {10-12}
|
|
93
|
+
* const form = useFormStore({
|
|
94
|
+
* defaultValues: {
|
|
95
|
+
* char: "a",
|
|
96
|
+
* },
|
|
97
|
+
* });
|
|
98
|
+
*
|
|
99
|
+
* <Form store={form}>
|
|
100
|
+
* <FormRadioGroup>
|
|
101
|
+
* <FormGroupLabel>Favorite character</FormGroupLabel>
|
|
102
|
+
* <FormRadio name={form.names.char} value="a" />
|
|
103
|
+
* <FormRadio name={form.names.char} value="b" />
|
|
104
|
+
* <FormRadio name={form.names.char} value="c" />
|
|
105
|
+
* </FormRadioGroup>
|
|
106
|
+
* </Form>
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export const FormRadio = memo(
|
|
110
|
+
forwardRef(function FormRadio(props: FormRadioProps) {
|
|
111
|
+
const htmlProps = useFormRadio(props);
|
|
112
|
+
return createElement(TagName, htmlProps);
|
|
113
|
+
}),
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
export interface FormRadioOptions<T extends ElementType = TagName>
|
|
117
|
+
extends FormControlOptions<T>, Omit<RadioOptions<T>, "store" | "name"> {}
|
|
118
|
+
|
|
119
|
+
export type FormRadioProps<T extends ElementType = TagName> = Props<
|
|
120
|
+
T,
|
|
121
|
+
FormRadioOptions<T>
|
|
122
|
+
>;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import type { StringLike } from "@ariakit/components/form/types";
|
|
2
|
+
import {
|
|
3
|
+
useEvent,
|
|
4
|
+
createElement,
|
|
5
|
+
createHook,
|
|
6
|
+
forwardRef,
|
|
7
|
+
} from "@ariakit/react-utils";
|
|
8
|
+
import type { Props } from "@ariakit/react-utils";
|
|
9
|
+
import { isTextField, invariant } from "@ariakit/utils";
|
|
10
|
+
import type { ElementType, MouseEvent } from "react";
|
|
11
|
+
import type { ButtonOptions } from "../button/button.tsx";
|
|
12
|
+
import { useButton } from "../button/button.tsx";
|
|
13
|
+
import { useFormContext } from "./form-context.tsx";
|
|
14
|
+
import type { FormStore, FormStoreState } from "./form-store.ts";
|
|
15
|
+
|
|
16
|
+
const TagName = "button" satisfies ElementType;
|
|
17
|
+
type TagName = typeof TagName;
|
|
18
|
+
type HTMLType = HTMLElementTagNameMap[TagName];
|
|
19
|
+
|
|
20
|
+
function findNextOrPreviousField(
|
|
21
|
+
items: FormStoreState["items"] | undefined,
|
|
22
|
+
name: string,
|
|
23
|
+
index: number,
|
|
24
|
+
) {
|
|
25
|
+
const fields = items?.filter(
|
|
26
|
+
(item) => item.type === "field" && item.name.startsWith(name),
|
|
27
|
+
);
|
|
28
|
+
const regex = new RegExp(`^${name}\\.(\\d+)`);
|
|
29
|
+
const nextField = fields?.find((field) => {
|
|
30
|
+
const fieldIndex = field.name.replace(regex, "$1");
|
|
31
|
+
return Number.parseInt(fieldIndex, 10) > index;
|
|
32
|
+
});
|
|
33
|
+
if (nextField) return nextField;
|
|
34
|
+
return fields?.reverse().find((field) => {
|
|
35
|
+
const fieldIndex = field.name.replace(regex, "$1");
|
|
36
|
+
return Number.parseInt(fieldIndex, 10) < index;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function findPushButton(
|
|
41
|
+
items: FormStoreState["items"] | undefined,
|
|
42
|
+
name: string,
|
|
43
|
+
) {
|
|
44
|
+
return items?.find((item) => item.type === "button" && item.name === name);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Returns props to create a `FormRemove` component.
|
|
49
|
+
* @see https://ariakit.com/components/form
|
|
50
|
+
* @example
|
|
51
|
+
* ```jsx
|
|
52
|
+
* const store = useFormStore({
|
|
53
|
+
* defaultValues: {
|
|
54
|
+
* languages: ["JavaScript", "PHP"],
|
|
55
|
+
* },
|
|
56
|
+
* });
|
|
57
|
+
* const props = useFormRemove({
|
|
58
|
+
* store,
|
|
59
|
+
* name: store.names.languages,
|
|
60
|
+
* index: 0,
|
|
61
|
+
* });
|
|
62
|
+
* const values = useStoreState(store, "values");
|
|
63
|
+
*
|
|
64
|
+
* <Form store={store}>
|
|
65
|
+
* {values.languages.map((_, i) => (
|
|
66
|
+
* <FormInput key={i} name={store.names.languages[i]} />
|
|
67
|
+
* ))}
|
|
68
|
+
* <Role {...props}>Remove first language</Role>
|
|
69
|
+
* </Form>
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export const useFormRemove = createHook<TagName, FormRemoveOptions>(
|
|
73
|
+
function useFormRemove({
|
|
74
|
+
store,
|
|
75
|
+
name: nameProp,
|
|
76
|
+
index,
|
|
77
|
+
autoFocusOnClick = true,
|
|
78
|
+
...props
|
|
79
|
+
}) {
|
|
80
|
+
const context = useFormContext();
|
|
81
|
+
store = store || context;
|
|
82
|
+
|
|
83
|
+
invariant(
|
|
84
|
+
store,
|
|
85
|
+
process.env.NODE_ENV !== "production" &&
|
|
86
|
+
"FormRemove must be wrapped in a Form component.",
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const name = String(nameProp);
|
|
90
|
+
const onClickProp = props.onClick;
|
|
91
|
+
|
|
92
|
+
const onClick = useEvent((event: MouseEvent<HTMLType>) => {
|
|
93
|
+
onClickProp?.(event);
|
|
94
|
+
if (event.defaultPrevented) return;
|
|
95
|
+
if (!store) return;
|
|
96
|
+
store.removeValue(name, index);
|
|
97
|
+
if (!autoFocusOnClick) return;
|
|
98
|
+
const { items } = store.getState();
|
|
99
|
+
const item = findNextOrPreviousField(items, name, index);
|
|
100
|
+
const element = item?.element;
|
|
101
|
+
if (element) {
|
|
102
|
+
element.focus();
|
|
103
|
+
if (isTextField(element)) {
|
|
104
|
+
element.select();
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
const pushButton = findPushButton(items, name);
|
|
108
|
+
pushButton?.element?.focus();
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
props = {
|
|
113
|
+
...props,
|
|
114
|
+
onClick,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
props = useButton(props);
|
|
118
|
+
|
|
119
|
+
return props;
|
|
120
|
+
},
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Renders a button that will remove an item from an array field in the form
|
|
125
|
+
* when clicked.
|
|
126
|
+
*
|
|
127
|
+
* The [`name`](https://ariakit.com/reference/form-remove#name) prop must be
|
|
128
|
+
* provided to identify the array field. Similarly, the
|
|
129
|
+
* [`index`](https://ariakit.com/reference/form-remove#index) prop is required
|
|
130
|
+
* to pinpoint the item to remove.
|
|
131
|
+
*
|
|
132
|
+
* By default, the button will automatically move focus to the next field in the
|
|
133
|
+
* form when clicked, or to the previous field if there isn't a next field. This
|
|
134
|
+
* behavior can be disabled by setting the
|
|
135
|
+
* [`autoFocusOnClick`](https://ariakit.com/reference/form-remove#autofocusonclick)
|
|
136
|
+
* prop to `false`.
|
|
137
|
+
* @see https://ariakit.com/components/form
|
|
138
|
+
* @example
|
|
139
|
+
* ```jsx {13}
|
|
140
|
+
* const form = useFormStore({
|
|
141
|
+
* defaultValues: {
|
|
142
|
+
* languages: ["JavaScript", "PHP"],
|
|
143
|
+
* },
|
|
144
|
+
* });
|
|
145
|
+
*
|
|
146
|
+
* const values = useStoreState(form, "values");
|
|
147
|
+
*
|
|
148
|
+
* <Form store={form}>
|
|
149
|
+
* {values.languages.map((_, i) => (
|
|
150
|
+
* <div key={i}>
|
|
151
|
+
* <FormInput name={form.names.languages[i]} />
|
|
152
|
+
* <FormRemove name={form.names.languages} index={i} />
|
|
153
|
+
* </div>
|
|
154
|
+
* ))}
|
|
155
|
+
* </Form>
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
export const FormRemove = forwardRef(function FormRemove(
|
|
159
|
+
props: FormRemoveProps,
|
|
160
|
+
) {
|
|
161
|
+
const htmlProps = useFormRemove(props);
|
|
162
|
+
return createElement(TagName, htmlProps);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
export interface FormRemoveOptions<
|
|
166
|
+
T extends ElementType = TagName,
|
|
167
|
+
> extends ButtonOptions<T> {
|
|
168
|
+
/**
|
|
169
|
+
* Object returned by the
|
|
170
|
+
* [`useFormStore`](https://ariakit.com/reference/use-form-store) hook. If not
|
|
171
|
+
* provided, the closest [`Form`](https://ariakit.com/reference/form) or
|
|
172
|
+
* [`FormProvider`](https://ariakit.com/reference/form-provider) components'
|
|
173
|
+
* context will be used.
|
|
174
|
+
*/
|
|
175
|
+
store?: FormStore;
|
|
176
|
+
/**
|
|
177
|
+
* Name of the array field. This can either be a string or a reference to a
|
|
178
|
+
* field name from the
|
|
179
|
+
* [`names`](https://ariakit.com/reference/use-form-store#names) object in the
|
|
180
|
+
* store, for type safety.
|
|
181
|
+
*/
|
|
182
|
+
name: StringLike;
|
|
183
|
+
/**
|
|
184
|
+
* Index of the item to remove.
|
|
185
|
+
*/
|
|
186
|
+
index: number;
|
|
187
|
+
/**
|
|
188
|
+
* Whether the focus should be moved to the next or previous field when the
|
|
189
|
+
* button is clicked.
|
|
190
|
+
* @default true
|
|
191
|
+
*/
|
|
192
|
+
autoFocusOnClick?: boolean;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export type FormRemoveProps<T extends ElementType = TagName> = Props<
|
|
196
|
+
T,
|
|
197
|
+
FormRemoveOptions<T>
|
|
198
|
+
>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { useStoreState } from "@ariakit/react-store";
|
|
2
|
+
import { createElement, createHook, forwardRef } from "@ariakit/react-utils";
|
|
3
|
+
import type { Props } from "@ariakit/react-utils";
|
|
4
|
+
import { invariant } from "@ariakit/utils";
|
|
5
|
+
import type { ElementType } from "react";
|
|
6
|
+
import type { ButtonOptions } from "../button/button.tsx";
|
|
7
|
+
import { useButton } from "../button/button.tsx";
|
|
8
|
+
import { useFormContext } from "./form-context.tsx";
|
|
9
|
+
import type { FormStore } from "./form-store.ts";
|
|
10
|
+
|
|
11
|
+
const TagName = "button" satisfies ElementType;
|
|
12
|
+
type TagName = typeof TagName;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns props to create a `FormReset` component.
|
|
16
|
+
* @see https://ariakit.com/components/form
|
|
17
|
+
* @example
|
|
18
|
+
* ```jsx
|
|
19
|
+
* const store = useFormStore();
|
|
20
|
+
* const props = useFormReset({ store });
|
|
21
|
+
* <Form store={store}>
|
|
22
|
+
* <Role {...props}>Reset</Role>
|
|
23
|
+
* </Form>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export const useFormReset = createHook<TagName, FormResetOptions>(
|
|
27
|
+
function useFormReset({ store, ...props }) {
|
|
28
|
+
const context = useFormContext();
|
|
29
|
+
store = store || context;
|
|
30
|
+
|
|
31
|
+
invariant(
|
|
32
|
+
store,
|
|
33
|
+
process.env.NODE_ENV !== "production" &&
|
|
34
|
+
"FormReset must be wrapped in a Form component.",
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
props = {
|
|
38
|
+
type: "reset",
|
|
39
|
+
disabled: useStoreState(store, "submitting"),
|
|
40
|
+
...props,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
props = useButton(props);
|
|
44
|
+
|
|
45
|
+
return props;
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Renders a button that resets the form to its initial values, as defined by
|
|
51
|
+
* the
|
|
52
|
+
* [`defaultValues`](https://ariakit.com/reference/use-form-store#defaultvalues)
|
|
53
|
+
* prop given to the form store.
|
|
54
|
+
* @see https://ariakit.com/components/form
|
|
55
|
+
* @example
|
|
56
|
+
* ```jsx {4}
|
|
57
|
+
* const form = useFormStore();
|
|
58
|
+
*
|
|
59
|
+
* <Form store={form}>
|
|
60
|
+
* <FormReset>Reset</FormReset>
|
|
61
|
+
* </Form>
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export const FormReset = forwardRef(function FormReset(props: FormResetProps) {
|
|
65
|
+
const htmlProps = useFormReset(props);
|
|
66
|
+
return createElement(TagName, htmlProps);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export interface FormResetOptions<
|
|
70
|
+
T extends ElementType = TagName,
|
|
71
|
+
> extends ButtonOptions<T> {
|
|
72
|
+
/**
|
|
73
|
+
* Object returned by the
|
|
74
|
+
* [`useFormStore`](https://ariakit.com/reference/use-form-store) hook. If not
|
|
75
|
+
* provided, the closest [`Form`](https://ariakit.com/reference/form) or
|
|
76
|
+
* [`FormProvider`](https://ariakit.com/reference/form-provider) components'
|
|
77
|
+
* context will be used.
|
|
78
|
+
*/
|
|
79
|
+
store?: FormStore;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export type FormResetProps<T extends ElementType = TagName> = Props<
|
|
83
|
+
T,
|
|
84
|
+
FormResetOptions<T>
|
|
85
|
+
>;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import * as Core from "@ariakit/components/form/form-store";
|
|
2
|
+
import type { StringLike } from "@ariakit/components/form/types";
|
|
3
|
+
import { useStore, useStoreProps, useStoreState } from "@ariakit/react-store";
|
|
4
|
+
import type { Store } from "@ariakit/react-store";
|
|
5
|
+
import { useEvent } from "@ariakit/react-utils";
|
|
6
|
+
import type { PickRequired } from "@ariakit/utils";
|
|
7
|
+
import { useCallback, useEffect, useMemo } from "react";
|
|
8
|
+
import type {
|
|
9
|
+
CollectionStoreFunctions,
|
|
10
|
+
CollectionStoreOptions,
|
|
11
|
+
CollectionStoreState,
|
|
12
|
+
} from "../collection/collection-store.ts";
|
|
13
|
+
import { useCollectionStoreProps } from "../collection/collection-store.ts";
|
|
14
|
+
|
|
15
|
+
export function useFormStoreProps<
|
|
16
|
+
T extends Omit<FormStore, "useValue" | "useValidate" | "useSubmit">,
|
|
17
|
+
>(store: T, update: () => void, props: FormStoreProps) {
|
|
18
|
+
store = useCollectionStoreProps(store, update, props);
|
|
19
|
+
|
|
20
|
+
useStoreProps(store, props, "values", "setValues");
|
|
21
|
+
useStoreProps(store, props, "errors", "setErrors");
|
|
22
|
+
useStoreProps(store, props, "touched", "setTouched");
|
|
23
|
+
|
|
24
|
+
const useValue = useCallback<FormStore["useValue"]>(
|
|
25
|
+
(name) => useStoreState(store, () => store.getValue(name)),
|
|
26
|
+
[store],
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const useValidate = useCallback<FormStore["useValidate"]>(
|
|
30
|
+
(callback) => {
|
|
31
|
+
callback = useEvent(callback);
|
|
32
|
+
// Whenever the items change (for example, when form fields are lazily
|
|
33
|
+
// rendered), we need to reset the callbacks so they always run in a
|
|
34
|
+
// consistent order.
|
|
35
|
+
const items = useStoreState(store, "items");
|
|
36
|
+
useEffect(() => store.onValidate(callback), [items, callback]);
|
|
37
|
+
},
|
|
38
|
+
[store],
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const useSubmit = useCallback<FormStore["useSubmit"]>(
|
|
42
|
+
(callback) => {
|
|
43
|
+
callback = useEvent(callback);
|
|
44
|
+
// Same logic as useValidate.
|
|
45
|
+
const items = useStoreState(store, "items");
|
|
46
|
+
useEffect(() => store.onSubmit(callback), [items, callback]);
|
|
47
|
+
},
|
|
48
|
+
[store],
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
return useMemo(
|
|
52
|
+
() => ({
|
|
53
|
+
...store,
|
|
54
|
+
useValue,
|
|
55
|
+
useValidate,
|
|
56
|
+
useSubmit,
|
|
57
|
+
}),
|
|
58
|
+
[store, useValue, useValidate, useSubmit],
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Creates a form store to control the state of
|
|
64
|
+
* [Form](https://ariakit.com/components/form) components.
|
|
65
|
+
* @example
|
|
66
|
+
* ```jsx
|
|
67
|
+
* const form = useFormStore({
|
|
68
|
+
* defaultValues: {
|
|
69
|
+
* email: "",
|
|
70
|
+
* },
|
|
71
|
+
* });
|
|
72
|
+
*
|
|
73
|
+
* <Form store={form}>
|
|
74
|
+
* <FormLabel name={form.names.email}>Email</FormLabel>
|
|
75
|
+
* <FormInput name={form.names.email} />
|
|
76
|
+
* <FormError name={form.names.email} />
|
|
77
|
+
* <FormSubmit>Submit</FormSubmit>
|
|
78
|
+
* </Form>
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export function useFormStore<T extends FormStoreValues = FormStoreValues>(
|
|
82
|
+
props: PickRequired<
|
|
83
|
+
FormStoreProps<T>,
|
|
84
|
+
| "values"
|
|
85
|
+
| "defaultValues"
|
|
86
|
+
| "errors"
|
|
87
|
+
| "defaultErrors"
|
|
88
|
+
| "touched"
|
|
89
|
+
| "defaultTouched"
|
|
90
|
+
>,
|
|
91
|
+
): FormStore<T>;
|
|
92
|
+
|
|
93
|
+
export function useFormStore(props: FormStoreProps): FormStore;
|
|
94
|
+
|
|
95
|
+
export function useFormStore(props: FormStoreProps = {}): FormStore {
|
|
96
|
+
const [store, update] = useStore(Core.createFormStore, props);
|
|
97
|
+
return useFormStoreProps(store, update, props);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface FormStoreValues extends Core.FormStoreValues {}
|
|
101
|
+
|
|
102
|
+
export interface FormStoreItem extends Core.FormStoreItem {}
|
|
103
|
+
|
|
104
|
+
export interface FormStoreState<T extends FormStoreValues = FormStoreValues>
|
|
105
|
+
extends Core.FormStoreState<T>, CollectionStoreState<FormStoreItem> {}
|
|
106
|
+
|
|
107
|
+
export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>
|
|
108
|
+
extends Core.FormStoreFunctions<T>, CollectionStoreFunctions<FormStoreItem> {
|
|
109
|
+
/**
|
|
110
|
+
* A custom hook that rerenders the component when the value of the given
|
|
111
|
+
* field changes. It accepts a string or a reference to a field name from the
|
|
112
|
+
* [`names`](https://ariakit.com/reference/use-form-store#names) object in the
|
|
113
|
+
* store, for type safety. It returns the value of the field.
|
|
114
|
+
*
|
|
115
|
+
* Live examples:
|
|
116
|
+
* - [Form with Select](https://ariakit.com/examples/form-select)
|
|
117
|
+
* @example
|
|
118
|
+
* const nameValue = store.useValue("name");
|
|
119
|
+
* // Can also use store.names for type safety.
|
|
120
|
+
* const emailValue = store.useValue(store.names.email);
|
|
121
|
+
*/
|
|
122
|
+
// oxlint-disable-next-line no-unnecessary-type-parameters
|
|
123
|
+
useValue: <T = any>(name: StringLike) => T;
|
|
124
|
+
/**
|
|
125
|
+
* Custom hook that accepts a callback that will be used to validate the form
|
|
126
|
+
* when [`validate`](https://ariakit.com/reference/use-form-store#validate) is
|
|
127
|
+
* called, typically when a form field is touched or when the form is
|
|
128
|
+
* submitted.
|
|
129
|
+
*
|
|
130
|
+
* Live examples:
|
|
131
|
+
* - [FormRadio](https://ariakit.com/examples/form-radio)
|
|
132
|
+
* @example
|
|
133
|
+
* store.useValidate(async (state) => {
|
|
134
|
+
* const errors = await api.validate(state.values);
|
|
135
|
+
* if (errors) {
|
|
136
|
+
* store.setErrors(errors);
|
|
137
|
+
* }
|
|
138
|
+
* });
|
|
139
|
+
*/
|
|
140
|
+
useValidate: (callback: Core.FormStoreCallback<FormStoreState<T>>) => void;
|
|
141
|
+
/**
|
|
142
|
+
* Custom hook that accepts a callback that will be used to submit the form
|
|
143
|
+
* when [`submit`](https://ariakit.com/reference/use-form-store#submit) is
|
|
144
|
+
* called.
|
|
145
|
+
*
|
|
146
|
+
* Live examples:
|
|
147
|
+
* - [FormRadio](https://ariakit.com/examples/form-radio)
|
|
148
|
+
* - [Form with Select](https://ariakit.com/examples/form-select)
|
|
149
|
+
* @example
|
|
150
|
+
* store.useSubmit(async (state) => {
|
|
151
|
+
* try {
|
|
152
|
+
* await api.submit(state.values);
|
|
153
|
+
* } catch (errors) {
|
|
154
|
+
* store.setErrors(errors);
|
|
155
|
+
* }
|
|
156
|
+
* });
|
|
157
|
+
*/
|
|
158
|
+
useSubmit: (callback: Core.FormStoreCallback<FormStoreState<T>>) => void;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface FormStoreOptions<T extends FormStoreValues = FormStoreValues>
|
|
162
|
+
extends Core.FormStoreOptions<T>, CollectionStoreOptions<FormStoreItem> {
|
|
163
|
+
/**
|
|
164
|
+
* Function that will be called when
|
|
165
|
+
* [`values`](https://ariakit.com/reference/use-form-store#values) state
|
|
166
|
+
* changes.
|
|
167
|
+
* @example
|
|
168
|
+
* function MyForm({ values, onChange }) {
|
|
169
|
+
* const form = useFormStore({ values, setValues: onChange });
|
|
170
|
+
* }
|
|
171
|
+
*/
|
|
172
|
+
setValues?: (values: FormStoreState<T>["values"]) => void;
|
|
173
|
+
/**
|
|
174
|
+
* Function that will be called when the
|
|
175
|
+
* [`errors`](https://ariakit.com/reference/use-form-store#errors) state
|
|
176
|
+
* changes.
|
|
177
|
+
* @example
|
|
178
|
+
* useFormStore({ setErrors: (errors) => console.log(errors) });
|
|
179
|
+
*/
|
|
180
|
+
setErrors?: (errors: FormStoreState<T>["errors"]) => void;
|
|
181
|
+
/**
|
|
182
|
+
* Function that will be called when the
|
|
183
|
+
* [`touched`](https://ariakit.com/reference/use-form-store#touched) state
|
|
184
|
+
* changes.
|
|
185
|
+
* @example
|
|
186
|
+
* useFormStore({ setTouched: (touched) => console.log(touched) });
|
|
187
|
+
*/
|
|
188
|
+
setTouched?: (touched: FormStoreState<T>["touched"]) => void;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface FormStoreProps<T extends FormStoreValues = FormStoreValues>
|
|
192
|
+
extends FormStoreOptions<T>, Core.FormStoreProps<T> {}
|
|
193
|
+
|
|
194
|
+
export interface FormStore<T extends FormStoreValues = FormStoreValues>
|
|
195
|
+
extends FormStoreFunctions<T>, Store<Core.FormStore<T>> {}
|