@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,146 @@
|
|
|
1
|
+
import { t as ComboboxStore } from "../combobox-store-DEVQ45mZ.js";
|
|
2
|
+
import { n as CompositeItemOptions } from "../composite-item-B4WTelVz.js";
|
|
3
|
+
import { n as CompositeHoverOptions } from "../composite-hover-C7ul163w.js";
|
|
4
|
+
import { Props } from "@ariakit/react-utils";
|
|
5
|
+
import { ElementType, MouseEvent } from "react";
|
|
6
|
+
import { BooleanOrCallback } from "@ariakit/utils";
|
|
7
|
+
|
|
8
|
+
//#region src/combobox/combobox-item.d.ts
|
|
9
|
+
declare const TagName = "div";
|
|
10
|
+
type TagName = typeof TagName;
|
|
11
|
+
/**
|
|
12
|
+
* Returns props to create a `ComboboxItem` component.
|
|
13
|
+
* @see https://ariakit.com/components/combobox
|
|
14
|
+
* @example
|
|
15
|
+
* ```jsx
|
|
16
|
+
* const store = useComboboxStore();
|
|
17
|
+
* const props = useComboboxItem({ store, value: "value" });
|
|
18
|
+
* <Role {...props} />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const useComboboxItem: import("@ariakit/react-utils").Hook<"div", ComboboxItemOptions<"div">>;
|
|
22
|
+
/**
|
|
23
|
+
* Renders a combobox item inside
|
|
24
|
+
* [`ComboboxList`](https://ariakit.com/reference/combobox-list) or
|
|
25
|
+
* [`ComboboxPopover`](https://ariakit.com/reference/combobox-popover)
|
|
26
|
+
* components.
|
|
27
|
+
*
|
|
28
|
+
* By default, the [`value`](https://ariakit.com/reference/combobox-item#value)
|
|
29
|
+
* prop will be rendered as the children, but this can be overriden.
|
|
30
|
+
* @see https://ariakit.com/components/combobox
|
|
31
|
+
* @example
|
|
32
|
+
* ```jsx {4-6}
|
|
33
|
+
* <ComboboxProvider>
|
|
34
|
+
* <Combobox />
|
|
35
|
+
* <ComboboxPopover>
|
|
36
|
+
* <ComboboxItem value="Apple" />
|
|
37
|
+
* <ComboboxItem value="Banana" />
|
|
38
|
+
* <ComboboxItem value="Orange" />
|
|
39
|
+
* </ComboboxPopover>
|
|
40
|
+
* </ComboboxProvider>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
declare const ComboboxItem: (props: ComboboxItemProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
44
|
+
interface ComboboxItemOptions<T extends ElementType = TagName> extends CompositeItemOptions<T>, CompositeHoverOptions<T> {
|
|
45
|
+
/**
|
|
46
|
+
* Object returned by the
|
|
47
|
+
* [`useComboboxStore`](https://ariakit.com/reference/use-combobox-store)
|
|
48
|
+
* hook. If not provided, the closest
|
|
49
|
+
* [`ComboboxList`](https://ariakit.com/reference/combobox-list) or
|
|
50
|
+
* [`ComboboxPopover`](https://ariakit.com/reference/combobox-popover)
|
|
51
|
+
* components' context will be used.
|
|
52
|
+
*
|
|
53
|
+
* Live examples:
|
|
54
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
55
|
+
*/
|
|
56
|
+
store?: ComboboxStore;
|
|
57
|
+
/**
|
|
58
|
+
* The value of the item. This will be rendered as the children by default.
|
|
59
|
+
* - If
|
|
60
|
+
* [`setValueOnClick`](https://ariakit.com/reference/combobox-item#setvalueonclick)
|
|
61
|
+
* is set to `true`, this will be the value of the combobox input when the
|
|
62
|
+
* user clicks on this item.
|
|
63
|
+
* - If
|
|
64
|
+
* [`selectValueOnClick`](https://ariakit.com/reference/combobox-item#selectvalueonclick)
|
|
65
|
+
* is set to `true`, this will be the value of the
|
|
66
|
+
* [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)
|
|
67
|
+
* state.
|
|
68
|
+
* - If the
|
|
69
|
+
* [`autoComplete`](https://ariakit.com/reference/combobox#autocomplete)
|
|
70
|
+
* prop on the [`Combobox`](https://ariakit.com/reference/combobox)
|
|
71
|
+
* component is set to `both` or `inline`, this will be the value of the
|
|
72
|
+
* combobox input when the combobox loses focus.
|
|
73
|
+
*
|
|
74
|
+
* Live examples:
|
|
75
|
+
* - [Animated Combobox](https://ariakit.com/examples/combobox-animated)
|
|
76
|
+
* - [ComboboxCancel](https://ariakit.com/examples/combobox-cancel)
|
|
77
|
+
* - [ComboboxDisclosure](https://ariakit.com/examples/combobox-disclosure)
|
|
78
|
+
* - [Combobox filtering](https://ariakit.com/examples/combobox-filtering)
|
|
79
|
+
* - [ComboboxGroup](https://ariakit.com/examples/combobox-group)
|
|
80
|
+
* - [Textarea with inline
|
|
81
|
+
* Combobox](https://ariakit.com/examples/combobox-textarea)
|
|
82
|
+
*/
|
|
83
|
+
value?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Whether to hide the combobox when this item is clicked. By default, the
|
|
86
|
+
* combobox will be hidden when the user clicks on an item with a
|
|
87
|
+
* [`value`](https://ariakit.com/reference/combobox-item#value) prop, unless
|
|
88
|
+
* the combobox is
|
|
89
|
+
* [multi-selectable](https://ariakit.com/examples/combobox-multiple).
|
|
90
|
+
*
|
|
91
|
+
* Live examples:
|
|
92
|
+
* - [Combobox with links](https://ariakit.com/examples/combobox-links)
|
|
93
|
+
* - [Submenu with
|
|
94
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
95
|
+
* - [Command Menu](https://ariakit.com/examples/dialog-combobox-command-menu)
|
|
96
|
+
* - [Command Menu with
|
|
97
|
+
* Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
|
|
98
|
+
*/
|
|
99
|
+
hideOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
|
|
100
|
+
/**
|
|
101
|
+
* Whether to set the combobox
|
|
102
|
+
* [`value`](https://ariakit.com/reference/combobox-provider#value) state
|
|
103
|
+
* using this item's
|
|
104
|
+
* [`value`](https://ariakit.com/reference/combobox-item#value) when the item
|
|
105
|
+
* is clicked. The default is `true`, unless the combobox is
|
|
106
|
+
* [multi-selectable](https://ariakit.com/examples/combobox-multiple).
|
|
107
|
+
*
|
|
108
|
+
* Live examples:
|
|
109
|
+
* - [Menu with Combobox](https://ariakit.com/examples/menu-combobox)
|
|
110
|
+
* - [Submenu with
|
|
111
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
112
|
+
*/
|
|
113
|
+
setValueOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
|
|
114
|
+
/**
|
|
115
|
+
* Whether to set the
|
|
116
|
+
* [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)
|
|
117
|
+
* state using this item's
|
|
118
|
+
* [`value`](https://ariakit.com/reference/combobox-item#value) when the item
|
|
119
|
+
* is clicked. If a callback is provided, it will only be invoked if the item
|
|
120
|
+
* has a value.
|
|
121
|
+
*
|
|
122
|
+
* Live examples:
|
|
123
|
+
* - [Submenu with
|
|
124
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
125
|
+
* @default true
|
|
126
|
+
*/
|
|
127
|
+
selectValueOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
|
|
128
|
+
/**
|
|
129
|
+
* Whether to reset the the combobox input value when this item is selected or
|
|
130
|
+
* unselected by click. This prop is set to `true` by default if
|
|
131
|
+
* the combobox supports multiple selections. In other words, if the
|
|
132
|
+
* [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)
|
|
133
|
+
* or
|
|
134
|
+
* [`defaultSelectedValue`](https://ariakit.com/reference/combobox-provider#defaultselectedvalue)
|
|
135
|
+
* props are arrays.
|
|
136
|
+
*/
|
|
137
|
+
resetValueOnSelect?: BooleanOrCallback<MouseEvent<HTMLElement>>;
|
|
138
|
+
/**
|
|
139
|
+
* @default false
|
|
140
|
+
*/
|
|
141
|
+
focusOnHover?: CompositeHoverOptions["focusOnHover"];
|
|
142
|
+
}
|
|
143
|
+
type ComboboxItemProps<T extends ElementType = TagName> = Props<T, ComboboxItemOptions<T>>;
|
|
144
|
+
//#endregion
|
|
145
|
+
export { ComboboxItem, ComboboxItemOptions, ComboboxItemProps, useComboboxItem };
|
|
146
|
+
//# sourceMappingURL=combobox-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-item.d.ts","names":["Props","BooleanOrCallback","ElementType","MouseEvent","CompositeHoverOptions","CompositeItemOptions","ComboboxStore","TagName","useComboboxItem","ComboboxItemOptions","Hook","ComboboxItem","ComboboxItemProps","props","ReactElement","JSXElementConstructor","T","HTMLElement","store","value","hideOnClick","setValueOnClick","selectValueOnClick","resetValueOnSelect","focusOnHover"],"sources":["../../src/combobox/combobox-item.d.ts"],"mappings":";;;;;;;;cAMcO,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAF4B;;;;AACpC;AAAA;;;;AACQ;AAF4B,cAapCC,eAAAA,iCAAgDE,IAAAA,QAAYD,mBAAmB;;;;AAAA;AAsBpG;;;;;;;;;AAAiJ;AACjJ;;;;;;;cADqBE,YAAAA,GAAeE,KAAAA,EAAOD,iBAAiB,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UAC3GN,mBAAAA,WAA8BP,WAAAA,GAAcK,OAAAA,UAAiBF,oBAAAA,CAAqBW,CAAAA,GAAIZ,qBAAAA,CAAsBY,CAAAA;EAuDzFb;;;;;;;;;;;EA3ChCe,KAAAA,GAAQZ,aAAAA;EAZkED;;;;;;;;;;;;;;;;;;;;;;;;;;EAuC1Ec,KAAAA;EAsDqBlB;;;;;;AAIe;AAExC;;;;;;;;EA5CImB,WAAAA,GAAcnB,iBAAAA,CAAkBE,UAAAA,CAAWc,WAAAA;EA4CuB;;;;;;;;;;AAAyB;;;EA9B3FI,eAAAA,GAAkBpB,iBAAAA,CAAkBE,UAAAA,CAAWc,WAAAA;;;;;;;;;;;;;;EAc/CK,kBAAAA,GAAqBrB,iBAAAA,CAAkBE,UAAAA,CAAWc,WAAAA;;;;;;;;;;EAUlDM,kBAAAA,GAAqBtB,iBAAAA,CAAkBE,UAAAA,CAAWc,WAAAA;;;;EAIlDO,YAAAA,GAAepB,qBAAAA;AAAAA;AAAAA,KAEPQ,iBAAAA,WAA4BV,WAAAA,GAAcK,OAAAA,IAAWP,KAAAA,CAAMgB,CAAAA,EAAGP,mBAAAA,CAAoBO,CAAAA"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ComboboxItemCheckedContext, ComboboxItemValueContext, ComboboxListRoleContext, useComboboxScopedContext } from "./combobox-context.js";
|
|
3
|
+
import { useCompositeItem } from "../composite/composite-item.js";
|
|
4
|
+
import { useCompositeHover } from "../composite/composite-hover.js";
|
|
5
|
+
import { createElement, createHook, forwardRef, memo, useBooleanEvent, useEvent, useWrapElement } from "@ariakit/react-utils";
|
|
6
|
+
import { hasFocus, invariant, isDownloading, isOpeningInNewTab, isTextField } from "@ariakit/utils";
|
|
7
|
+
import { useCallback, useContext } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { useStoreStateObject } from "@ariakit/react-store";
|
|
10
|
+
//#region src/combobox/combobox-item.tsx
|
|
11
|
+
const TagName = "div";
|
|
12
|
+
function isSelected(storeValue, itemValue) {
|
|
13
|
+
if (itemValue == null) return;
|
|
14
|
+
if (storeValue == null) return false;
|
|
15
|
+
if (Array.isArray(storeValue)) return storeValue.includes(itemValue);
|
|
16
|
+
return storeValue === itemValue;
|
|
17
|
+
}
|
|
18
|
+
function getItemRole(popupRole) {
|
|
19
|
+
return {
|
|
20
|
+
menu: "menuitem",
|
|
21
|
+
listbox: "option",
|
|
22
|
+
tree: "treeitem"
|
|
23
|
+
}[popupRole] ?? "option";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns props to create a `ComboboxItem` component.
|
|
27
|
+
* @see https://ariakit.com/components/combobox
|
|
28
|
+
* @example
|
|
29
|
+
* ```jsx
|
|
30
|
+
* const store = useComboboxStore();
|
|
31
|
+
* const props = useComboboxItem({ store, value: "value" });
|
|
32
|
+
* <Role {...props} />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
const useComboboxItem = createHook(function useComboboxItem({ store, value, hideOnClick, setValueOnClick, selectValueOnClick = true, resetValueOnSelect, focusOnHover = false, moveOnKeyPress = true, getItem: getItemProp, ...props }) {
|
|
36
|
+
const context = useComboboxScopedContext();
|
|
37
|
+
store = store || context;
|
|
38
|
+
invariant(store, "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component.");
|
|
39
|
+
const { resetValueOnSelectState, multiSelectable, selected } = useStoreStateObject(store, {
|
|
40
|
+
resetValueOnSelectState: "resetValueOnSelect",
|
|
41
|
+
multiSelectable(state) {
|
|
42
|
+
return Array.isArray(state.selectedValue);
|
|
43
|
+
},
|
|
44
|
+
selected(state) {
|
|
45
|
+
return isSelected(state.selectedValue, value);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const getItem = useCallback((item) => {
|
|
49
|
+
const nextItem = {
|
|
50
|
+
...item,
|
|
51
|
+
value
|
|
52
|
+
};
|
|
53
|
+
if (getItemProp) return getItemProp(nextItem);
|
|
54
|
+
return nextItem;
|
|
55
|
+
}, [value, getItemProp]);
|
|
56
|
+
setValueOnClick = setValueOnClick ?? !multiSelectable;
|
|
57
|
+
hideOnClick = hideOnClick ?? (value != null && !multiSelectable);
|
|
58
|
+
const onClickProp = props.onClick;
|
|
59
|
+
const setValueOnClickProp = useBooleanEvent(setValueOnClick);
|
|
60
|
+
const selectValueOnClickProp = useBooleanEvent(selectValueOnClick);
|
|
61
|
+
const resetValueOnSelectProp = useBooleanEvent(resetValueOnSelect ?? resetValueOnSelectState ?? multiSelectable);
|
|
62
|
+
const hideOnClickProp = useBooleanEvent(hideOnClick);
|
|
63
|
+
const onClick = useEvent((event) => {
|
|
64
|
+
onClickProp?.(event);
|
|
65
|
+
if (event.defaultPrevented) return;
|
|
66
|
+
if (isDownloading(event)) return;
|
|
67
|
+
if (isOpeningInNewTab(event)) return;
|
|
68
|
+
if (value != null) {
|
|
69
|
+
if (selectValueOnClickProp(event)) {
|
|
70
|
+
if (resetValueOnSelectProp(event)) store?.resetValue();
|
|
71
|
+
store?.setSelectedValue((prevValue) => {
|
|
72
|
+
if (!Array.isArray(prevValue)) return value;
|
|
73
|
+
if (prevValue.includes(value)) return prevValue.filter((v) => v !== value);
|
|
74
|
+
return [...prevValue, value];
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (setValueOnClickProp(event)) store?.setValue(value);
|
|
78
|
+
}
|
|
79
|
+
if (hideOnClickProp(event)) store?.hide();
|
|
80
|
+
});
|
|
81
|
+
const onKeyDownProp = props.onKeyDown;
|
|
82
|
+
const onKeyDown = useEvent((event) => {
|
|
83
|
+
onKeyDownProp?.(event);
|
|
84
|
+
if (event.defaultPrevented) return;
|
|
85
|
+
const baseElement = store?.getState().baseElement;
|
|
86
|
+
if (!baseElement) return;
|
|
87
|
+
if (hasFocus(baseElement)) return;
|
|
88
|
+
if (event.key.length === 1 || event.key === "Backspace" || event.key === "Delete") {
|
|
89
|
+
queueMicrotask(() => baseElement.focus());
|
|
90
|
+
if (isTextField(baseElement)) store?.setValue(baseElement.value);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
if (multiSelectable && selected != null) props = {
|
|
94
|
+
"aria-selected": selected,
|
|
95
|
+
...props
|
|
96
|
+
};
|
|
97
|
+
props = useWrapElement(props, (element) => /* @__PURE__ */ jsx(ComboboxItemValueContext.Provider, {
|
|
98
|
+
value,
|
|
99
|
+
children: /* @__PURE__ */ jsx(ComboboxItemCheckedContext.Provider, {
|
|
100
|
+
value: selected ?? false,
|
|
101
|
+
children: element
|
|
102
|
+
})
|
|
103
|
+
}), [value, selected]);
|
|
104
|
+
props = {
|
|
105
|
+
role: getItemRole(useContext(ComboboxListRoleContext)),
|
|
106
|
+
children: value,
|
|
107
|
+
...props,
|
|
108
|
+
onClick,
|
|
109
|
+
onKeyDown
|
|
110
|
+
};
|
|
111
|
+
const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
|
|
112
|
+
props = useCompositeItem({
|
|
113
|
+
store,
|
|
114
|
+
...props,
|
|
115
|
+
getItem,
|
|
116
|
+
moveOnKeyPress: (event) => {
|
|
117
|
+
if (!moveOnKeyPressProp(event)) return false;
|
|
118
|
+
const moveEvent = new Event("combobox-item-move");
|
|
119
|
+
(store?.getState().baseElement)?.dispatchEvent(moveEvent);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
props = useCompositeHover({
|
|
124
|
+
store,
|
|
125
|
+
focusOnHover,
|
|
126
|
+
...props
|
|
127
|
+
});
|
|
128
|
+
return props;
|
|
129
|
+
});
|
|
130
|
+
/**
|
|
131
|
+
* Renders a combobox item inside
|
|
132
|
+
* [`ComboboxList`](https://ariakit.com/reference/combobox-list) or
|
|
133
|
+
* [`ComboboxPopover`](https://ariakit.com/reference/combobox-popover)
|
|
134
|
+
* components.
|
|
135
|
+
*
|
|
136
|
+
* By default, the [`value`](https://ariakit.com/reference/combobox-item#value)
|
|
137
|
+
* prop will be rendered as the children, but this can be overriden.
|
|
138
|
+
* @see https://ariakit.com/components/combobox
|
|
139
|
+
* @example
|
|
140
|
+
* ```jsx {4-6}
|
|
141
|
+
* <ComboboxProvider>
|
|
142
|
+
* <Combobox />
|
|
143
|
+
* <ComboboxPopover>
|
|
144
|
+
* <ComboboxItem value="Apple" />
|
|
145
|
+
* <ComboboxItem value="Banana" />
|
|
146
|
+
* <ComboboxItem value="Orange" />
|
|
147
|
+
* </ComboboxPopover>
|
|
148
|
+
* </ComboboxProvider>
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
const ComboboxItem = memo(forwardRef(function ComboboxItem(props) {
|
|
152
|
+
return createElement(TagName, useComboboxItem(props));
|
|
153
|
+
}));
|
|
154
|
+
//#endregion
|
|
155
|
+
export { ComboboxItem, useComboboxItem };
|
|
156
|
+
|
|
157
|
+
//# sourceMappingURL=combobox-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-item.js","names":["key"],"sources":["../../src/combobox/combobox-item.tsx"],"sourcesContent":["import { useStoreStateObject } from \"@ariakit/react-store\";\nimport {\n useBooleanEvent,\n useEvent,\n useWrapElement,\n createElement,\n createHook,\n forwardRef,\n memo,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport {\n isTextField,\n isDownloading,\n isOpeningInNewTab,\n hasFocus,\n invariant,\n} from \"@ariakit/utils\";\nimport type { BooleanOrCallback } from \"@ariakit/utils\";\nimport type { ElementType, KeyboardEvent, MouseEvent } from \"react\";\nimport { useCallback, useContext } from \"react\";\nimport type { CompositeHoverOptions } from \"../composite/composite-hover.tsx\";\nimport { useCompositeHover } from \"../composite/composite-hover.tsx\";\nimport type { CompositeItemOptions } from \"../composite/composite-item.tsx\";\nimport { useCompositeItem } from \"../composite/composite-item.tsx\";\nimport {\n ComboboxItemCheckedContext,\n ComboboxItemValueContext,\n ComboboxListRoleContext,\n useComboboxScopedContext,\n} from \"./combobox-context.tsx\";\nimport type { ComboboxStore } from \"./combobox-store.ts\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\ntype HTMLType = HTMLElementTagNameMap[TagName];\n\nfunction isSelected(\n storeValue?: string | readonly string[],\n itemValue?: string,\n) {\n if (itemValue == null) return;\n if (storeValue == null) return false;\n if (Array.isArray(storeValue)) {\n return storeValue.includes(itemValue);\n }\n return storeValue === itemValue;\n}\n\nfunction getItemRole(popupRole?: string) {\n const itemRoleByPopupRole = {\n menu: \"menuitem\",\n listbox: \"option\",\n tree: \"treeitem\",\n };\n const key = popupRole as keyof typeof itemRoleByPopupRole;\n return itemRoleByPopupRole[key] ?? \"option\";\n}\n\n/**\n * Returns props to create a `ComboboxItem` component.\n * @see https://ariakit.com/components/combobox\n * @example\n * ```jsx\n * const store = useComboboxStore();\n * const props = useComboboxItem({ store, value: \"value\" });\n * <Role {...props} />\n * ```\n */\nexport const useComboboxItem = createHook<TagName, ComboboxItemOptions>(\n function useComboboxItem({\n store,\n value,\n hideOnClick,\n setValueOnClick,\n selectValueOnClick = true,\n resetValueOnSelect,\n focusOnHover = false,\n moveOnKeyPress = true,\n getItem: getItemProp,\n ...props\n }) {\n const context = useComboboxScopedContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component.\",\n );\n\n const { resetValueOnSelectState, multiSelectable, selected } =\n useStoreStateObject(store, {\n resetValueOnSelectState: \"resetValueOnSelect\",\n multiSelectable(state) {\n return Array.isArray(state.selectedValue);\n },\n selected(state) {\n return isSelected(state.selectedValue, value);\n },\n });\n\n const getItem = useCallback<NonNullable<CompositeItemOptions[\"getItem\"]>>(\n (item) => {\n const nextItem = { ...item, value };\n if (getItemProp) {\n return getItemProp(nextItem);\n }\n return nextItem;\n },\n [value, getItemProp],\n );\n\n setValueOnClick = setValueOnClick ?? !multiSelectable;\n hideOnClick = hideOnClick ?? (value != null && !multiSelectable);\n\n const onClickProp = props.onClick;\n const setValueOnClickProp = useBooleanEvent(setValueOnClick);\n const selectValueOnClickProp = useBooleanEvent(selectValueOnClick);\n const resetValueOnSelectProp = useBooleanEvent(\n resetValueOnSelect ?? resetValueOnSelectState ?? multiSelectable,\n );\n const hideOnClickProp = useBooleanEvent(hideOnClick);\n\n const onClick = useEvent((event: MouseEvent<HTMLType>) => {\n onClickProp?.(event);\n if (event.defaultPrevented) return;\n if (isDownloading(event)) return;\n if (isOpeningInNewTab(event)) return;\n if (value != null) {\n if (selectValueOnClickProp(event)) {\n if (resetValueOnSelectProp(event)) {\n store?.resetValue();\n }\n store?.setSelectedValue((prevValue) => {\n if (!Array.isArray(prevValue)) return value;\n if (prevValue.includes(value)) {\n return prevValue.filter((v) => v !== value);\n }\n return [...prevValue, value];\n });\n }\n if (setValueOnClickProp(event)) {\n store?.setValue(value);\n }\n }\n if (hideOnClickProp(event)) {\n store?.hide();\n }\n });\n\n const onKeyDownProp = props.onKeyDown;\n\n const onKeyDown = useEvent((event: KeyboardEvent<HTMLType>) => {\n onKeyDownProp?.(event);\n if (event.defaultPrevented) return;\n const baseElement = store?.getState().baseElement;\n if (!baseElement) return;\n if (hasFocus(baseElement)) return;\n // When the combobox is not working with virtual focus, the items will\n // receive DOM focus. Therefore, pressing printable keys will not fill\n // the text field. So we need to programmatically focus on the text\n // field when the user presses printable keys.\n const printable = event.key.length === 1;\n if (printable || event.key === \"Backspace\" || event.key === \"Delete\") {\n queueMicrotask(() => baseElement.focus());\n if (isTextField(baseElement)) {\n // If the combobox element is a text field, we should update the\n // store value with the current's element value. This is necessary\n // because the value may temporarily change based on the currently\n // selected item, but it'll be reset to the original value when the\n // combobox input is focused.\n store?.setValue(baseElement.value);\n }\n }\n });\n\n if (multiSelectable && selected != null) {\n props = {\n \"aria-selected\": selected,\n ...props,\n };\n }\n\n props = useWrapElement(\n props,\n (element) => (\n <ComboboxItemValueContext.Provider value={value}>\n <ComboboxItemCheckedContext.Provider value={selected ?? false}>\n {element}\n </ComboboxItemCheckedContext.Provider>\n </ComboboxItemValueContext.Provider>\n ),\n [value, selected],\n );\n\n const popupRole = useContext(ComboboxListRoleContext);\n\n props = {\n role: getItemRole(popupRole),\n children: value,\n ...props,\n onClick,\n onKeyDown,\n };\n\n const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);\n\n props = useCompositeItem<TagName>({\n store,\n ...props,\n getItem,\n // Dispatch a custom event on the combobox input when moving to an item\n // with the keyboard so the Combobox component can enable inline\n // autocompletion.\n moveOnKeyPress: (event) => {\n if (!moveOnKeyPressProp(event)) return false;\n const moveEvent = new Event(\"combobox-item-move\");\n const baseElement = store?.getState().baseElement;\n baseElement?.dispatchEvent(moveEvent);\n return true;\n },\n });\n\n props = useCompositeHover({ store, focusOnHover, ...props });\n\n return props;\n },\n);\n\n/**\n * Renders a combobox item inside\n * [`ComboboxList`](https://ariakit.com/reference/combobox-list) or\n * [`ComboboxPopover`](https://ariakit.com/reference/combobox-popover)\n * components.\n *\n * By default, the [`value`](https://ariakit.com/reference/combobox-item#value)\n * prop will be rendered as the children, but this can be overriden.\n * @see https://ariakit.com/components/combobox\n * @example\n * ```jsx {4-6}\n * <ComboboxProvider>\n * <Combobox />\n * <ComboboxPopover>\n * <ComboboxItem value=\"Apple\" />\n * <ComboboxItem value=\"Banana\" />\n * <ComboboxItem value=\"Orange\" />\n * </ComboboxPopover>\n * </ComboboxProvider>\n * ```\n */\nexport const ComboboxItem = memo(\n forwardRef(function ComboboxItem(props: ComboboxItemProps) {\n const htmlProps = useComboboxItem(props);\n return createElement(TagName, htmlProps);\n }),\n);\n\nexport interface ComboboxItemOptions<T extends ElementType = TagName>\n extends CompositeItemOptions<T>, CompositeHoverOptions<T> {\n /**\n * Object returned by the\n * [`useComboboxStore`](https://ariakit.com/reference/use-combobox-store)\n * hook. If not provided, the closest\n * [`ComboboxList`](https://ariakit.com/reference/combobox-list) or\n * [`ComboboxPopover`](https://ariakit.com/reference/combobox-popover)\n * components' context will be used.\n *\n * Live examples:\n * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)\n */\n store?: ComboboxStore;\n /**\n * The value of the item. This will be rendered as the children by default.\n * - If\n * [`setValueOnClick`](https://ariakit.com/reference/combobox-item#setvalueonclick)\n * is set to `true`, this will be the value of the combobox input when the\n * user clicks on this item.\n * - If\n * [`selectValueOnClick`](https://ariakit.com/reference/combobox-item#selectvalueonclick)\n * is set to `true`, this will be the value of the\n * [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)\n * state.\n * - If the\n * [`autoComplete`](https://ariakit.com/reference/combobox#autocomplete)\n * prop on the [`Combobox`](https://ariakit.com/reference/combobox)\n * component is set to `both` or `inline`, this will be the value of the\n * combobox input when the combobox loses focus.\n *\n * Live examples:\n * - [Animated Combobox](https://ariakit.com/examples/combobox-animated)\n * - [ComboboxCancel](https://ariakit.com/examples/combobox-cancel)\n * - [ComboboxDisclosure](https://ariakit.com/examples/combobox-disclosure)\n * - [Combobox filtering](https://ariakit.com/examples/combobox-filtering)\n * - [ComboboxGroup](https://ariakit.com/examples/combobox-group)\n * - [Textarea with inline\n * Combobox](https://ariakit.com/examples/combobox-textarea)\n */\n value?: string;\n /**\n * Whether to hide the combobox when this item is clicked. By default, the\n * combobox will be hidden when the user clicks on an item with a\n * [`value`](https://ariakit.com/reference/combobox-item#value) prop, unless\n * the combobox is\n * [multi-selectable](https://ariakit.com/examples/combobox-multiple).\n *\n * Live examples:\n * - [Combobox with links](https://ariakit.com/examples/combobox-links)\n * - [Submenu with\n * Combobox](https://ariakit.com/examples/menu-nested-combobox)\n * - [Command Menu](https://ariakit.com/examples/dialog-combobox-command-menu)\n * - [Command Menu with\n * Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)\n */\n hideOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;\n /**\n * Whether to set the combobox\n * [`value`](https://ariakit.com/reference/combobox-provider#value) state\n * using this item's\n * [`value`](https://ariakit.com/reference/combobox-item#value) when the item\n * is clicked. The default is `true`, unless the combobox is\n * [multi-selectable](https://ariakit.com/examples/combobox-multiple).\n *\n * Live examples:\n * - [Menu with Combobox](https://ariakit.com/examples/menu-combobox)\n * - [Submenu with\n * Combobox](https://ariakit.com/examples/menu-nested-combobox)\n */\n setValueOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;\n /**\n * Whether to set the\n * [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)\n * state using this item's\n * [`value`](https://ariakit.com/reference/combobox-item#value) when the item\n * is clicked. If a callback is provided, it will only be invoked if the item\n * has a value.\n *\n * Live examples:\n * - [Submenu with\n * Combobox](https://ariakit.com/examples/menu-nested-combobox)\n * @default true\n */\n selectValueOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;\n /**\n * Whether to reset the the combobox input value when this item is selected or\n * unselected by click. This prop is set to `true` by default if\n * the combobox supports multiple selections. In other words, if the\n * [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)\n * or\n * [`defaultSelectedValue`](https://ariakit.com/reference/combobox-provider#defaultselectedvalue)\n * props are arrays.\n */\n resetValueOnSelect?: BooleanOrCallback<MouseEvent<HTMLElement>>;\n /**\n * @default false\n */\n focusOnHover?: CompositeHoverOptions[\"focusOnHover\"];\n}\n\nexport type ComboboxItemProps<T extends ElementType = TagName> = Props<\n T,\n ComboboxItemOptions<T>\n>;\n"],"mappings":";;;;;;;;;;AAqCA,MAAA,UAAS;SAIH,WAAa,YAAM,WAAA;CACvB,IAAI,aAAA,MAAc;CAClB,IAAI,cAAc,MAAA,OAChB;CAEF,IAAA,MAAO,QAAA,UAAe,GAAA,OAAA,WAAA,SAAA,SAAA;CACxB,OAAA,eAAA;AAEA;SAOS,YAAA,WAAA;QALC;EACN,MAAA;EACA,SAAM;EAGiB,MAAEA;CAC7B,EAAA,cAAA;;;;;;;;;;;;MAyBI,kBAAgB,WAAA,SAAyB,gBAAA,EAAA,OAAA,OAAA,aAAA,iBAAA,qBAAA,MAAA,oBAAA,eAAA,OAAA,iBAAA,MAAA,SAAA,aAAA,GAAA,SAAA;CACzC,MAAA,UAAQ,yBAAS;CAEjB,QAAA,SAGI;CAGJ,UAAQ,OAAA,8EACqB;OACzB,EAAA,yBAAyB,iBAAA,aAAA,oBAAA,OAAA;EACzB,yBAAuB;kBACR,OAAQ;GACvB,OAAA,MAAA,QAAA,MAAA,aAAA;EACA;WACS,OAAA;GACT,OAAA,WAAA,MAAA,eAAA,KAAA;EACD;CAEH,CAAA;OAEI,UAAM,aAAW,SAAA;QAAK,WAAA;GAAM,GAAA;GAAM;EAClC;EAGA,IAAA,aAAO,OAAA,YAAA,QAAA;EACT,OACC;CAGH,GAAA,CAAA,OAAA,WAAkB,CAAA;CAClB,kBAAc,mBAAgB,CAAA;CAE9B,cAAM,gBAAoB,SAAA,QAAA,CAAA;CAC1B,MAAM,cAAA,MAAA;CACN,MAAM,sBAAA,gBAAyB,eAAgB;CAC/C,MAAM,yBAAyB,gBAC7B,kBAAA;CAEF,MAAM,yBAAkB,gBAAgB,sBAAW,2BAAA,eAAA;CAEnD,MAAM,kBAAU,gBAA0C,WAAA;OACxD,UAAc,UAAK,UAAA;EACnB,cAAU,KAAA;EACV,IAAI,MAAA,kBAAsB;EAC1B,IAAI,cAAA,KAAkB,GAAA;EACtB,IAAI,kBAAe,KAAA,GAAA;MACjB,SAAI,MAAA;OACF,uBAAI,KAAuB,GAAK;IAGhC,IAAA,uBAAyB,KAAA,GAAA,OAAc,WAAA;WAChC,kBAAc,cAAmB;KACtC,IAAI,CAAA,MAAA,QAAU,SAAc,GAC1B,OAAO;KAET,IAAA,UAAW,SAAW,KAAK,GAAA,OAAA,UAAA,QAAA,MAAA,MAAA,KAAA;KAC5B,OAAA,CAAA,GAAA,WAAA,KAAA;IACH,CAAA;GACA;GAGF,IAAA,oBAAA,KAAA,GAAA,OAAA,SAAA,KAAA;EACA;EAGD,IAAA,gBAAA,KAAA,GAAA,OAAA,KAAA;CAED,CAAA;CAEA,MAAM,gBAAY,MAAU;OAC1B,YAAgB,UAAK,UAAA;EACrB,gBAAU,KAAA;EACV,IAAA,MAAM,kBAAqB;EAC3B,MAAK,cAAa,OAAA,SAAA,EAAA;EAClB,IAAI,CAAA,aAAS;EAMb,IADkB,SAAM,WAAI,GAAW;MAErC,MAAA,IAAA,WAAqB,KAAA,MAAY,QAAO,eAAA,MAAA,QAAA,UAAA;GACxC,qBAAgB,YAMd,MAAO,CAAA;GAEX,IAAA,YAAA,WAAA,GAAA,OAAA,SAAA,YAAA,KAAA;EACD;CAED,CAAA;KAEI,mBAAiB,YAAA,MAAA,QAAA;EACjB,iBAAG;EACL,GAAA;CAGF;SAG8C,eAAA,QAAA,YAAA,oBAAA,yBAAA,UAAA;;YACgB,oBAAA,2BAAA,UAAA;sBACrD;GACkC,UAAA;EACJ,CAAA;CAOvC,CAAA,GAAA,CAAA,OAAQ,QAAA,CAAA;SACA;EACN,MAAA,YAAU,WAAA,uBAAA,CAAA;EACV,UAAG;EACH,GAAA;EACA;EACF;CAEA;CAEA,MAAA,qBAAkC,gBAAA,cAAA;SAChC,iBAAA;EACA;EACA,GAAA;EAIA;mBACO,UAAmB;GACxB,IAAA,CAAA,mBAAsB,KAAM,GAAA,OAAA;GAE5B,MADoB,YAAgB,IAAE,MAAA,oBACX;GAC3B,CAAA,OAAO,SAAA,EAAA,cAAA,cAAA,SAAA;GACT,OAAA;EACD;CAED,CAAA;SAA4B,kBAAA;EAAO;EAAc;EAAU,GAAA;CAE3D,CAAA;CAEJ,OAAA;;;;;;;;;;;;;;;;;;;;;;;MA0BI,eAAO,KAAc,WADH,SAAA,aACqB,OAAA;CACxC,OACH,cAAA,SAAA,gBAAA,KAAA,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { t as ComboboxStore } from "../combobox-store-DEVQ45mZ.js";
|
|
2
|
+
import { Options, Props } from "@ariakit/react-utils";
|
|
3
|
+
import { ElementType } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/combobox/combobox-label.d.ts
|
|
6
|
+
declare const TagName = "label";
|
|
7
|
+
type TagName = typeof TagName;
|
|
8
|
+
/**
|
|
9
|
+
* Returns props to create a `ComboboxLabel` component.
|
|
10
|
+
* @see https://ariakit.com/components/combobox
|
|
11
|
+
* @example
|
|
12
|
+
* ```jsx
|
|
13
|
+
* const store = useComboboxStore();
|
|
14
|
+
* const props = useComboboxLabel({ store });
|
|
15
|
+
* <Role {...props}>Favorite fruit</Role>
|
|
16
|
+
* <Combobox store={store} />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare const useComboboxLabel: import("@ariakit/react-utils").Hook<"label", ComboboxLabelOptions<"label">>;
|
|
20
|
+
/**
|
|
21
|
+
* Renders a label for the [`Combobox`](https://ariakit.com/reference/combobox)
|
|
22
|
+
* component.
|
|
23
|
+
* @see https://ariakit.com/components/combobox
|
|
24
|
+
* @example
|
|
25
|
+
* ```jsx {2}
|
|
26
|
+
* <ComboboxProvider>
|
|
27
|
+
* <ComboboxLabel>Favorite fruit</ComboboxLabel>
|
|
28
|
+
* <Combobox />
|
|
29
|
+
* <ComboboxPopover>
|
|
30
|
+
* <ComboboxItem value="Apple" />
|
|
31
|
+
* <ComboboxItem value="Orange" />
|
|
32
|
+
* </ComboboxPopover>
|
|
33
|
+
* </ComboboxProvider>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const ComboboxLabel: (props: ComboboxLabelProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
37
|
+
interface ComboboxLabelOptions<_T extends ElementType = TagName> extends Options {
|
|
38
|
+
/**
|
|
39
|
+
* Object returned by the
|
|
40
|
+
* [`useComboboxStore`](https://ariakit.com/reference/use-combobox-store)
|
|
41
|
+
* hook. If not provided, the closest
|
|
42
|
+
* [`ComboboxProvider`](https://ariakit.com/reference/combobox-provider)
|
|
43
|
+
* component's context will be used.
|
|
44
|
+
*/
|
|
45
|
+
store?: ComboboxStore;
|
|
46
|
+
}
|
|
47
|
+
type ComboboxLabelProps<T extends ElementType = TagName> = Props<T, ComboboxLabelOptions<T>>;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { ComboboxLabel, ComboboxLabelOptions, ComboboxLabelProps, useComboboxLabel };
|
|
50
|
+
//# sourceMappingURL=combobox-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-label.d.ts","names":["Options","Props","ElementType","ComboboxStore","TagName","useComboboxLabel","ComboboxLabelOptions","Hook","ComboboxLabel","ComboboxLabelProps","props","ReactElement","JSXElementConstructor","_T","store","T"],"sources":["../../src/combobox/combobox-label.d.ts"],"mappings":";;;;;cAGcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAF4B;;;;AACpC;AAAA;;;;AACQ;AAY7B;AAdyD,cAcpCC,gBAAAA,iCAAiDE,IAAAA,UAAcD,oBAAoB;;;AAAA;AAiBxG;;;;;;;;;AAAmJ;AACnJ;;;cADqBE,aAAAA,GAAgBE,KAAAA,EAAOD,kBAAkB,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UAC7GN,oBAAAA,YAAgCJ,WAAAA,GAAcE,OAAAA,UAAiBJ,OAAAA;EAQpEG;;;;;;;EAARW,KAAAA,GAAQX,aAAAA;AAAAA;AAAAA,KAEAM,kBAAAA,WAA6BP,WAAAA,GAAcE,OAAAA,IAAWH,KAAAA,CAAMc,CAAAA,EAAGT,oBAAAA,CAAqBS,CAAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useComboboxProviderContext } from "./combobox-context.js";
|
|
3
|
+
import { createElement, createHook, forwardRef, memo } from "@ariakit/react-utils";
|
|
4
|
+
import { invariant, removeUndefinedValues } from "@ariakit/utils";
|
|
5
|
+
import { useStoreState } from "@ariakit/react-store";
|
|
6
|
+
//#region src/combobox/combobox-label.tsx
|
|
7
|
+
const TagName = "label";
|
|
8
|
+
/**
|
|
9
|
+
* Returns props to create a `ComboboxLabel` component.
|
|
10
|
+
* @see https://ariakit.com/components/combobox
|
|
11
|
+
* @example
|
|
12
|
+
* ```jsx
|
|
13
|
+
* const store = useComboboxStore();
|
|
14
|
+
* const props = useComboboxLabel({ store });
|
|
15
|
+
* <Role {...props}>Favorite fruit</Role>
|
|
16
|
+
* <Combobox store={store} />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
const useComboboxLabel = createHook(function useComboboxLabel({ store, ...props }) {
|
|
20
|
+
const context = useComboboxProviderContext();
|
|
21
|
+
store = store || context;
|
|
22
|
+
invariant(store, "ComboboxLabel must receive a `store` prop or be wrapped in a ComboboxProvider component.");
|
|
23
|
+
props = {
|
|
24
|
+
htmlFor: useStoreState(store, (state) => state.baseElement?.id),
|
|
25
|
+
...props
|
|
26
|
+
};
|
|
27
|
+
return removeUndefinedValues(props);
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Renders a label for the [`Combobox`](https://ariakit.com/reference/combobox)
|
|
31
|
+
* component.
|
|
32
|
+
* @see https://ariakit.com/components/combobox
|
|
33
|
+
* @example
|
|
34
|
+
* ```jsx {2}
|
|
35
|
+
* <ComboboxProvider>
|
|
36
|
+
* <ComboboxLabel>Favorite fruit</ComboboxLabel>
|
|
37
|
+
* <Combobox />
|
|
38
|
+
* <ComboboxPopover>
|
|
39
|
+
* <ComboboxItem value="Apple" />
|
|
40
|
+
* <ComboboxItem value="Orange" />
|
|
41
|
+
* </ComboboxPopover>
|
|
42
|
+
* </ComboboxProvider>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
const ComboboxLabel = memo(forwardRef(function ComboboxLabel(props) {
|
|
46
|
+
return createElement(TagName, useComboboxLabel(props));
|
|
47
|
+
}));
|
|
48
|
+
//#endregion
|
|
49
|
+
export { ComboboxLabel, useComboboxLabel };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=combobox-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-label.js","names":[],"sources":["../../src/combobox/combobox-label.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n createElement,\n createHook,\n forwardRef,\n memo,\n} from \"@ariakit/react-utils\";\nimport type { Options, Props } from \"@ariakit/react-utils\";\nimport { invariant, removeUndefinedValues } from \"@ariakit/utils\";\nimport type { ElementType } from \"react\";\nimport { useComboboxProviderContext } from \"./combobox-context.tsx\";\nimport type { ComboboxStore } from \"./combobox-store.ts\";\n\nconst TagName = \"label\" satisfies ElementType;\ntype TagName = typeof TagName;\n\n/**\n * Returns props to create a `ComboboxLabel` component.\n * @see https://ariakit.com/components/combobox\n * @example\n * ```jsx\n * const store = useComboboxStore();\n * const props = useComboboxLabel({ store });\n * <Role {...props}>Favorite fruit</Role>\n * <Combobox store={store} />\n * ```\n */\nexport const useComboboxLabel = createHook<TagName, ComboboxLabelOptions>(\n function useComboboxLabel({ store, ...props }) {\n const context = useComboboxProviderContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"ComboboxLabel must receive a `store` prop or be wrapped in a ComboboxProvider component.\",\n );\n\n const comboboxId = useStoreState(store, (state) => state.baseElement?.id);\n\n props = {\n htmlFor: comboboxId,\n ...props,\n };\n\n return removeUndefinedValues(props);\n },\n);\n\n/**\n * Renders a label for the [`Combobox`](https://ariakit.com/reference/combobox)\n * component.\n * @see https://ariakit.com/components/combobox\n * @example\n * ```jsx {2}\n * <ComboboxProvider>\n * <ComboboxLabel>Favorite fruit</ComboboxLabel>\n * <Combobox />\n * <ComboboxPopover>\n * <ComboboxItem value=\"Apple\" />\n * <ComboboxItem value=\"Orange\" />\n * </ComboboxPopover>\n * </ComboboxProvider>\n * ```\n */\nexport const ComboboxLabel = memo(\n forwardRef(function ComboboxLabel(props: ComboboxLabelProps) {\n const htmlProps = useComboboxLabel(props);\n return createElement(TagName, htmlProps);\n }),\n);\n\nexport interface ComboboxLabelOptions<\n _T extends ElementType = TagName,\n> extends Options {\n /**\n * Object returned by the\n * [`useComboboxStore`](https://ariakit.com/reference/use-combobox-store)\n * hook. If not provided, the closest\n * [`ComboboxProvider`](https://ariakit.com/reference/combobox-provider)\n * component's context will be used.\n */\n store?: ComboboxStore;\n}\n\nexport type ComboboxLabelProps<T extends ElementType = TagName> = Props<\n T,\n ComboboxLabelOptions<T>\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;MA6BI,mBAAgB,WAAA,SAA2B,iBAAA,EAAA,OAAA,GAAA,SAAA;CAC3C,MAAA,UAAQ,2BAAS;CAEjB,QAAA,SAGI;CAKJ,UAAQ,OAAA,0FAAA;SACN;EACA,SAAG,cAAA,QAAA,UAAA,MAAA,aAAA,EAAA;EACL,GAAA;CAEA;CAEJ,OAAA,sBAAA,KAAA;;;;;;;;;;;;;;;;;;MAqBI,gBAAqB,KAAA,WADH,SAAA,cACqB,OAAA;CACxC,OACH,cAAA,SAAA,iBAAA,KAAA,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { t as ComboboxStore } from "../combobox-store-DEVQ45mZ.js";
|
|
2
|
+
import { n as DisclosureContentOptions } from "../disclosure-content-BbPkZgAc.js";
|
|
3
|
+
import { Options, Props } from "@ariakit/react-utils";
|
|
4
|
+
import { ElementType } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/combobox/combobox-list.d.ts
|
|
7
|
+
declare const TagName = "div";
|
|
8
|
+
type TagName = typeof TagName;
|
|
9
|
+
/**
|
|
10
|
+
* Returns props to create a `ComboboxList` component.
|
|
11
|
+
* @see https://ariakit.com/components/combobox
|
|
12
|
+
* @example
|
|
13
|
+
* ```jsx
|
|
14
|
+
* const store = useComboboxStore();
|
|
15
|
+
* const props = useComboboxList({ store });
|
|
16
|
+
* <Role {...props}>
|
|
17
|
+
* <ComboboxItem value="Item 1" />
|
|
18
|
+
* <ComboboxItem value="Item 2" />
|
|
19
|
+
* <ComboboxItem value="Item 3" />
|
|
20
|
+
* </Role>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const useComboboxList: import("@ariakit/react-utils").Hook<"div", ComboboxListOptions<"div">>;
|
|
24
|
+
/**
|
|
25
|
+
* Renders a combobox list. The `role` prop is set to `listbox` by default, but
|
|
26
|
+
* can be overriden by any other valid combobox popup role (`listbox`, `menu`,
|
|
27
|
+
* `tree`, `grid` or `dialog`).
|
|
28
|
+
* @see https://ariakit.com/components/combobox
|
|
29
|
+
* @example
|
|
30
|
+
* ```jsx {3-7}
|
|
31
|
+
* <ComboboxProvider>
|
|
32
|
+
* <Combobox />
|
|
33
|
+
* <ComboboxList>
|
|
34
|
+
* <ComboboxItem value="Apple" />
|
|
35
|
+
* <ComboboxItem value="Banana" />
|
|
36
|
+
* <ComboboxItem value="Orange" />
|
|
37
|
+
* </ComboboxList>
|
|
38
|
+
* </ComboboxProvider>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
declare const ComboboxList: (props: ComboboxListProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
42
|
+
interface ComboboxListOptions<T extends ElementType = TagName> extends Options, Pick<DisclosureContentOptions<T>, "alwaysVisible"> {
|
|
43
|
+
/**
|
|
44
|
+
* Object returned by the
|
|
45
|
+
* [`useComboboxStore`](https://ariakit.com/reference/use-combobox-store)
|
|
46
|
+
* hook. If not provided, the closest
|
|
47
|
+
* [`ComboboxProvider`](https://ariakit.com/reference/combobox-provider)
|
|
48
|
+
* component's context will be used.
|
|
49
|
+
*/
|
|
50
|
+
store?: ComboboxStore;
|
|
51
|
+
}
|
|
52
|
+
type ComboboxListProps<T extends ElementType = TagName> = Props<T, ComboboxListOptions<T>>;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { ComboboxList, ComboboxListOptions, ComboboxListProps, useComboboxList };
|
|
55
|
+
//# sourceMappingURL=combobox-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-list.d.ts","names":["Options","Props","ElementType","DisclosureContentOptions","ComboboxStore","TagName","useComboboxList","ComboboxListOptions","Hook","ComboboxList","ComboboxListProps","props","ReactElement","JSXElementConstructor","T","Pick","store"],"sources":["../../src/combobox/combobox-list.d.ts"],"mappings":";;;;;;cAIcK,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAF4B;;;;AACpC;AAAA;;;;AACQ;AAe7B;;;;AAjByD,cAiBpCC,eAAAA,iCAAgDE,IAAAA,QAAYD,mBAAmB;AAkBpG;;;;;;;;;AAAiJ;AACjJ;;;;;;;AADA,cAAqBE,YAAAA,GAAeE,KAAAA,EAAOD,iBAAiB,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UAC3GN,mBAAAA,WAA8BL,WAAAA,GAAcG,OAAAA,UAAiBL,OAAAA,EAASe,IAAAA,CAAKZ,wBAAAA,CAAyBW,CAAAA;EAA9BC;;;;;;;EAQnFC,KAAAA,GAAQZ,aAAAA;AAAAA;AAAAA,KAEAM,iBAAAA,WAA4BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,mBAAAA,CAAoBO,CAAAA"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ComboboxListRoleContext, ComboboxScopedContextProvider, useComboboxContext, useComboboxScopedContext } from "./combobox-context.js";
|
|
3
|
+
import { isHidden } from "../disclosure/disclosure-content.js";
|
|
4
|
+
import { createElement, createHook, forwardRef, useAttribute, useId, useMergeRefs, useSafeLayoutEffect, useWrapElement } from "@ariakit/react-utils";
|
|
5
|
+
import { invariant, removeUndefinedValues } from "@ariakit/utils";
|
|
6
|
+
import { useRef, useState } from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { useStoreState } from "@ariakit/react-store";
|
|
9
|
+
//#region src/combobox/combobox-list.tsx
|
|
10
|
+
const TagName = "div";
|
|
11
|
+
/**
|
|
12
|
+
* Returns props to create a `ComboboxList` component.
|
|
13
|
+
* @see https://ariakit.com/components/combobox
|
|
14
|
+
* @example
|
|
15
|
+
* ```jsx
|
|
16
|
+
* const store = useComboboxStore();
|
|
17
|
+
* const props = useComboboxList({ store });
|
|
18
|
+
* <Role {...props}>
|
|
19
|
+
* <ComboboxItem value="Item 1" />
|
|
20
|
+
* <ComboboxItem value="Item 2" />
|
|
21
|
+
* <ComboboxItem value="Item 3" />
|
|
22
|
+
* </Role>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
const useComboboxList = createHook(function useComboboxList({ store, alwaysVisible, ...props }) {
|
|
26
|
+
const scopedContext = useComboboxScopedContext(true);
|
|
27
|
+
const context = useComboboxContext();
|
|
28
|
+
store = store || context;
|
|
29
|
+
const scopedContextSameStore = !!store && store === scopedContext;
|
|
30
|
+
invariant(store, "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component.");
|
|
31
|
+
const ref = useRef(null);
|
|
32
|
+
const id = useId(props.id);
|
|
33
|
+
const mounted = useStoreState(store, "mounted");
|
|
34
|
+
const hidden = isHidden(mounted, props.hidden, alwaysVisible);
|
|
35
|
+
const style = hidden ? {
|
|
36
|
+
...props.style,
|
|
37
|
+
display: "none"
|
|
38
|
+
} : props.style;
|
|
39
|
+
const multiSelectable = useStoreState(store, (state) => Array.isArray(state.selectedValue));
|
|
40
|
+
const role = useAttribute(ref, "role", props.role);
|
|
41
|
+
const ariaMultiSelectable = role === "listbox" || role === "tree" || role === "grid" ? multiSelectable || void 0 : void 0;
|
|
42
|
+
const [hasListboxInside, setHasListboxInside] = useState(false);
|
|
43
|
+
const contentElement = useStoreState(store, "contentElement");
|
|
44
|
+
useSafeLayoutEffect(() => {
|
|
45
|
+
if (!mounted) return;
|
|
46
|
+
const element = ref.current;
|
|
47
|
+
if (!element) return;
|
|
48
|
+
if (contentElement !== element) return;
|
|
49
|
+
const callback = () => {
|
|
50
|
+
setHasListboxInside(!!element.querySelector("[role='listbox']"));
|
|
51
|
+
};
|
|
52
|
+
const observer = new MutationObserver(callback);
|
|
53
|
+
observer.observe(element, {
|
|
54
|
+
subtree: true,
|
|
55
|
+
childList: true,
|
|
56
|
+
attributeFilter: ["role"]
|
|
57
|
+
});
|
|
58
|
+
callback();
|
|
59
|
+
return () => observer.disconnect();
|
|
60
|
+
}, [mounted, contentElement]);
|
|
61
|
+
if (!hasListboxInside) props = {
|
|
62
|
+
role: "listbox",
|
|
63
|
+
"aria-multiselectable": ariaMultiSelectable,
|
|
64
|
+
...props
|
|
65
|
+
};
|
|
66
|
+
props = useWrapElement(props, (element) => /* @__PURE__ */ jsx(ComboboxScopedContextProvider, {
|
|
67
|
+
value: store,
|
|
68
|
+
children: /* @__PURE__ */ jsx(ComboboxListRoleContext.Provider, {
|
|
69
|
+
value: role,
|
|
70
|
+
children: element
|
|
71
|
+
})
|
|
72
|
+
}), [store, role]);
|
|
73
|
+
const setContentElement = id && (!scopedContext || !scopedContextSameStore) ? store.setContentElement : null;
|
|
74
|
+
props = {
|
|
75
|
+
hidden,
|
|
76
|
+
...props,
|
|
77
|
+
id,
|
|
78
|
+
ref: useMergeRefs(setContentElement, ref, props.ref),
|
|
79
|
+
style
|
|
80
|
+
};
|
|
81
|
+
return removeUndefinedValues(props);
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* Renders a combobox list. The `role` prop is set to `listbox` by default, but
|
|
85
|
+
* can be overriden by any other valid combobox popup role (`listbox`, `menu`,
|
|
86
|
+
* `tree`, `grid` or `dialog`).
|
|
87
|
+
* @see https://ariakit.com/components/combobox
|
|
88
|
+
* @example
|
|
89
|
+
* ```jsx {3-7}
|
|
90
|
+
* <ComboboxProvider>
|
|
91
|
+
* <Combobox />
|
|
92
|
+
* <ComboboxList>
|
|
93
|
+
* <ComboboxItem value="Apple" />
|
|
94
|
+
* <ComboboxItem value="Banana" />
|
|
95
|
+
* <ComboboxItem value="Orange" />
|
|
96
|
+
* </ComboboxList>
|
|
97
|
+
* </ComboboxProvider>
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
const ComboboxList = forwardRef(function ComboboxList(props) {
|
|
101
|
+
return createElement(TagName, useComboboxList(props));
|
|
102
|
+
});
|
|
103
|
+
//#endregion
|
|
104
|
+
export { ComboboxList, useComboboxList };
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=combobox-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-list.js","names":[],"sources":["../../src/combobox/combobox-list.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n useAttribute,\n useId,\n useMergeRefs,\n useSafeLayoutEffect,\n useWrapElement,\n createElement,\n createHook,\n forwardRef,\n} from \"@ariakit/react-utils\";\nimport type { Options, Props } from \"@ariakit/react-utils\";\nimport { invariant, removeUndefinedValues } from \"@ariakit/utils\";\nimport type { ElementType } from \"react\";\nimport { useRef, useState } from \"react\";\nimport type { DisclosureContentOptions } from \"../disclosure/disclosure-content.tsx\";\nimport { isHidden } from \"../disclosure/disclosure-content.tsx\";\nimport {\n ComboboxListRoleContext,\n ComboboxScopedContextProvider,\n useComboboxContext,\n useComboboxScopedContext,\n} from \"./combobox-context.tsx\";\nimport type { ComboboxStore } from \"./combobox-store.ts\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\ntype HTMLType = HTMLElementTagNameMap[TagName];\n\n/**\n * Returns props to create a `ComboboxList` component.\n * @see https://ariakit.com/components/combobox\n * @example\n * ```jsx\n * const store = useComboboxStore();\n * const props = useComboboxList({ store });\n * <Role {...props}>\n * <ComboboxItem value=\"Item 1\" />\n * <ComboboxItem value=\"Item 2\" />\n * <ComboboxItem value=\"Item 3\" />\n * </Role>\n * ```\n */\nexport const useComboboxList = createHook<TagName, ComboboxListOptions>(\n function useComboboxList({ store, alwaysVisible, ...props }) {\n const scopedContext = useComboboxScopedContext(true);\n const context = useComboboxContext();\n store = store || context;\n const scopedContextSameStore = !!store && store === scopedContext;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component.\",\n );\n\n const ref = useRef<HTMLType>(null);\n const id = useId(props.id);\n const mounted = useStoreState(store, \"mounted\");\n const hidden = isHidden(mounted, props.hidden, alwaysVisible);\n const style = hidden ? { ...props.style, display: \"none\" } : props.style;\n\n const multiSelectable = useStoreState(store, (state) =>\n Array.isArray(state.selectedValue),\n );\n const role = useAttribute(ref, \"role\", props.role);\n const isCompositeRole =\n role === \"listbox\" || role === \"tree\" || role === \"grid\";\n const ariaMultiSelectable = isCompositeRole\n ? multiSelectable || undefined\n : undefined;\n\n const [hasListboxInside, setHasListboxInside] = useState(false);\n const contentElement = useStoreState(store, \"contentElement\");\n\n // We support nested <ComboboxList> elements (usually in the form of\n // ComboboxPopover>ComboboxList), but we can't have nested listbox roles, so\n // we check here if there's already a listbox element inside the current\n // element.\n useSafeLayoutEffect(() => {\n if (!mounted) return;\n const element = ref.current;\n if (!element) return;\n if (contentElement !== element) return;\n const callback = () => {\n setHasListboxInside(!!element.querySelector(\"[role='listbox']\"));\n };\n const observer = new MutationObserver(callback);\n observer.observe(element, {\n subtree: true,\n childList: true,\n attributeFilter: [\"role\"],\n });\n callback();\n return () => observer.disconnect();\n }, [mounted, contentElement]);\n\n if (!hasListboxInside) {\n props = {\n role: \"listbox\",\n \"aria-multiselectable\": ariaMultiSelectable,\n ...props,\n };\n }\n\n props = useWrapElement(\n props,\n (element) => (\n <ComboboxScopedContextProvider value={store}>\n <ComboboxListRoleContext.Provider value={role}>\n {element}\n </ComboboxListRoleContext.Provider>\n </ComboboxScopedContextProvider>\n ),\n [store, role],\n );\n\n // When nesting ComboboxList elements, the content element should be\n // assigned to the topmost ComboboxList element.\n const setContentElement =\n id && (!scopedContext || !scopedContextSameStore)\n ? store.setContentElement\n : null;\n\n props = {\n hidden,\n ...props,\n id,\n ref: useMergeRefs(setContentElement, ref, props.ref),\n style,\n };\n\n return removeUndefinedValues(props);\n },\n);\n\n/**\n * Renders a combobox list. The `role` prop is set to `listbox` by default, but\n * can be overriden by any other valid combobox popup role (`listbox`, `menu`,\n * `tree`, `grid` or `dialog`).\n * @see https://ariakit.com/components/combobox\n * @example\n * ```jsx {3-7}\n * <ComboboxProvider>\n * <Combobox />\n * <ComboboxList>\n * <ComboboxItem value=\"Apple\" />\n * <ComboboxItem value=\"Banana\" />\n * <ComboboxItem value=\"Orange\" />\n * </ComboboxList>\n * </ComboboxProvider>\n * ```\n */\nexport const ComboboxList = forwardRef(function ComboboxList(\n props: ComboboxListProps,\n) {\n const htmlProps = useComboboxList(props);\n return createElement(TagName, htmlProps);\n});\n\nexport interface ComboboxListOptions<T extends ElementType = TagName>\n extends Options, Pick<DisclosureContentOptions<T>, \"alwaysVisible\"> {\n /**\n * Object returned by the\n * [`useComboboxStore`](https://ariakit.com/reference/use-combobox-store)\n * hook. If not provided, the closest\n * [`ComboboxProvider`](https://ariakit.com/reference/combobox-provider)\n * component's context will be used.\n */\n store?: ComboboxStore;\n}\n\nexport type ComboboxListProps<T extends ElementType = TagName> = Props<\n T,\n ComboboxListOptions<T>\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MA6CI,kBAAsB,WAAA,SAAA,gBAA6B,EAAA,OAAA,eAAA,GAAA,SAAA;CACnD,MAAM,gBAAU,yBAAmB,IAAA;CACnC,MAAA,UAAQ,mBAAS;CACjB,QAAM,SAAA;CAEN,MAAA,yBAGI,CAAA,CAAA,SAAA,UAAA;CAGJ,UAAM,OAAM,yFAAqB;CACjC,MAAM,MAAK,OAAM,IAAM;CACvB,MAAM,KAAA,MAAU,MAAA,EAAA;CAChB,MAAM,UAAS,cAAS,OAAS,SAAM;CACvC,MAAM,SAAQ,SAAS,SAAA,MAAA,QAAA,aAAA;OAAK,QAAM,SAAA;EAAO,GAAA,MAAS;EAAO,SAAU;CAEnE,IAAA,MAAM;CAGN,MAAM,kBAAO,cAAkB,QAAc,UAAI,MAAA,QAAA,MAAA,aAAA,CAAA;CAGjD,MAAM,OAAA,aAAA,KADJ,QAAS,MAAA,IAAA;CAKX,MAAM,sBAAmB,SAAA,aAAuB,SAAS,UAAK,SAAA,SAAA,mBAAA,KAAA,IAAA,KAAA;CAC9D,MAAM,CAAA,kBAAiB,uBAAqB,SAAA,KAAgB;CAM5D,MAAA,iBAAA,cAA0B,OAAA,gBAAA;2BACV;EACd,IAAA,CAAA,SAAM;EACN,MAAK,UAAS,IAAA;EACd,IAAI,CAAA,SAAA;EACJ,IAAA,mBAAuB,SAAA;QACrB,iBAAsB;GACxB,oBAAA,CAAA,CAAA,QAAA,cAAA,kBAAA,CAAA;EACA;EACA,MAAA,WAAiB,IAAA,iBAAS,QAAA;WACxB,QAAS,SAAA;GACT,SAAA;GACA,WAAA;GACD,iBAAA,CAAA,MAAA;EACD,CAAA;EACA,SAAA;EACF,aAAa,SAAA,WAAe;CAE5B,GAAA,CAAI,SAAC,cACH,CAAA;KACE,CAAA,kBAAM,QAAA;EACN,MAAA;EACA,wBAAG;EACL,GAAA;CAGF;SAG0C,eAAA,QAAA,YAAA,oBAAA,+BAAA;;YACK,oBAAA,wBAAA,UAAA;;GAEP,UAAA;EACL,CAAA;CAOnC,CAAA,GAAA,CAAA,OAAM,IAAA,CAAA;CAKN,MAAA,oBAAQ,OAAA,CAAA,iBAAA,CAAA,0BAAA,MAAA,oBAAA;SACN;EACA;EACA,GAAA;EACA;EACA,KAAA,aAAA,mBAAA,KAAA,MAAA,GAAA;EACF;CAEA;CAEJ,OAAA,sBAAA,KAAA;;;;;;;;;;;;;;;;;;;MAuBE,eAAO,WADW,SAAA,aACqB,OAAA;CACxC,OAAA,cAAA,SAAA,gBAAA,KAAA,CAAA"}
|