@funstack/ui 0.1.0-alpha.2 → 0.1.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -1
- package/dist/accordion/accordion-context.mjs.map +1 -1
- package/dist/accordion/accordion-item.d.mts +22 -4
- package/dist/accordion/accordion-item.d.mts.map +1 -1
- package/dist/accordion/accordion-item.mjs +32 -10
- package/dist/accordion/accordion-item.mjs.map +1 -1
- package/dist/accordion/accordion-panel.d.mts +19 -4
- package/dist/accordion/accordion-panel.d.mts.map +1 -1
- package/dist/accordion/accordion-panel.mjs +8 -6
- package/dist/accordion/accordion-panel.mjs.map +1 -1
- package/dist/accordion/accordion-root.d.mts +39 -5
- package/dist/accordion/accordion-root.d.mts.map +1 -1
- package/dist/accordion/accordion-root.mjs +75 -67
- package/dist/accordion/accordion-root.mjs.map +1 -1
- package/dist/accordion/accordion-trigger.d.mts +12 -4
- package/dist/accordion/accordion-trigger.d.mts.map +1 -1
- package/dist/accordion/accordion-trigger.mjs +14 -28
- package/dist/accordion/accordion-trigger.mjs.map +1 -1
- package/dist/accordion/index.d.mts +2 -0
- package/dist/accordion/index.d.mts.map +1 -1
- package/dist/accordion/index.mjs +2 -0
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/alert-dialog/alert-dialog-action.d.mts +73 -0
- package/dist/alert-dialog/alert-dialog-action.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-action.mjs +23 -0
- package/dist/alert-dialog/alert-dialog-action.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-cancel.d.mts +31 -0
- package/dist/alert-dialog/alert-dialog-cancel.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-cancel.mjs +50 -0
- package/dist/alert-dialog/alert-dialog-cancel.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-context.mjs +24 -0
- package/dist/alert-dialog/alert-dialog-context.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-description.d.mts +25 -0
- package/dist/alert-dialog/alert-dialog-description.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-description.mjs +20 -0
- package/dist/alert-dialog/alert-dialog-description.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-form.d.mts +27 -0
- package/dist/alert-dialog/alert-dialog-form.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-form.mjs +22 -0
- package/dist/alert-dialog/alert-dialog-form.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-popup.d.mts +42 -0
- package/dist/alert-dialog/alert-dialog-popup.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-popup.mjs +53 -0
- package/dist/alert-dialog/alert-dialog-popup.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-root.d.mts +31 -0
- package/dist/alert-dialog/alert-dialog-root.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-root.mjs +23 -0
- package/dist/alert-dialog/alert-dialog-root.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-title.d.mts +23 -0
- package/dist/alert-dialog/alert-dialog-title.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-title.mjs +18 -0
- package/dist/alert-dialog/alert-dialog-title.mjs.map +1 -0
- package/dist/alert-dialog/alert-dialog-trigger.d.mts +23 -0
- package/dist/alert-dialog/alert-dialog-trigger.d.mts.map +1 -0
- package/dist/alert-dialog/alert-dialog-trigger.mjs +18 -0
- package/dist/alert-dialog/alert-dialog-trigger.mjs.map +1 -0
- package/dist/alert-dialog/index.d.mts +33 -0
- package/dist/alert-dialog/index.d.mts.map +1 -0
- package/dist/alert-dialog/index.mjs +33 -0
- package/dist/alert-dialog/index.mjs.map +1 -0
- package/dist/avatar/avatar-context.mjs +24 -0
- package/dist/avatar/avatar-context.mjs.map +1 -0
- package/dist/avatar/avatar-fallback.d.mts +32 -0
- package/dist/avatar/avatar-fallback.d.mts.map +1 -0
- package/dist/avatar/avatar-fallback.mjs +31 -0
- package/dist/avatar/avatar-fallback.mjs.map +1 -0
- package/dist/avatar/avatar-image.d.mts +37 -0
- package/dist/avatar/avatar-image.d.mts.map +1 -0
- package/dist/avatar/avatar-image.mjs +91 -0
- package/dist/avatar/avatar-image.mjs.map +1 -0
- package/dist/avatar/avatar-root.d.mts +48 -0
- package/dist/avatar/avatar-root.d.mts.map +1 -0
- package/dist/avatar/avatar-root.mjs +81 -0
- package/dist/avatar/avatar-root.mjs.map +1 -0
- package/dist/avatar/index.d.mts +24 -0
- package/dist/avatar/index.d.mts.map +1 -0
- package/dist/avatar/index.mjs +24 -0
- package/dist/avatar/index.mjs.map +1 -0
- package/dist/bin/skill-installer.d.mts +1 -0
- package/dist/bin/skill-installer.mjs +12 -0
- package/dist/bin/skill-installer.mjs.map +1 -0
- package/dist/button/button.d.mts +118 -0
- package/dist/button/button.d.mts.map +1 -0
- package/dist/button/button.mjs +98 -0
- package/dist/button/button.mjs.map +1 -0
- package/dist/button/index.d.mts +3 -0
- package/dist/button/index.mjs +1 -0
- package/dist/checkbox/checkbox.d.mts +32 -9
- package/dist/checkbox/checkbox.d.mts.map +1 -1
- package/dist/checkbox/checkbox.mjs +25 -50
- package/dist/checkbox/checkbox.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-context.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-item.d.mts +20 -5
- package/dist/checkbox-group/checkbox-group-item.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-item.mjs +25 -27
- package/dist/checkbox-group/checkbox-group-item.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-label.d.mts +10 -0
- package/dist/checkbox-group/checkbox-group-label.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-label.mjs +3 -6
- package/dist/checkbox-group/checkbox-group-label.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-parent.d.mts +22 -5
- package/dist/checkbox-group/checkbox-group-parent.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-parent.mjs +17 -13
- package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-root.d.mts +37 -7
- package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-root.mjs +102 -102
- package/dist/checkbox-group/checkbox-group-root.mjs.map +1 -1
- package/dist/checkbox-group/index.d.mts +2 -0
- package/dist/checkbox-group/index.d.mts.map +1 -1
- package/dist/checkbox-group/index.mjs +2 -0
- package/dist/checkbox-group/index.mjs.map +1 -1
- package/dist/collapsible/collapsible-context.mjs +8 -0
- package/dist/collapsible/collapsible-context.mjs.map +1 -0
- package/dist/collapsible/collapsible-panel.d.mts +53 -0
- package/dist/collapsible/collapsible-panel.d.mts.map +1 -0
- package/dist/collapsible/collapsible-panel.mjs +41 -0
- package/dist/collapsible/collapsible-panel.mjs.map +1 -0
- package/dist/collapsible/collapsible-root.d.mts +108 -0
- package/dist/collapsible/collapsible-root.d.mts.map +1 -0
- package/dist/collapsible/collapsible-root.mjs +147 -0
- package/dist/collapsible/collapsible-root.mjs.map +1 -0
- package/dist/collapsible/collapsible-trigger.d.mts +45 -0
- package/dist/collapsible/collapsible-trigger.d.mts.map +1 -0
- package/dist/collapsible/collapsible-trigger.mjs +62 -0
- package/dist/collapsible/collapsible-trigger.mjs.map +1 -0
- package/dist/collapsible/index.d.mts +21 -0
- package/dist/collapsible/index.d.mts.map +1 -0
- package/dist/collapsible/index.mjs +21 -0
- package/dist/collapsible/index.mjs.map +1 -0
- package/dist/combobox/chip-text.mjs +24 -0
- package/dist/combobox/chip-text.mjs.map +1 -0
- package/dist/combobox/combobox-chips.d.mts +159 -0
- package/dist/combobox/combobox-chips.d.mts.map +1 -0
- package/dist/combobox/combobox-chips.mjs +198 -0
- package/dist/combobox/combobox-chips.mjs.map +1 -0
- package/dist/combobox/combobox-clear.d.mts +29 -5
- package/dist/combobox/combobox-clear.d.mts.map +1 -1
- package/dist/combobox/combobox-clear.mjs +17 -8
- package/dist/combobox/combobox-clear.mjs.map +1 -1
- package/dist/combobox/combobox-context.mjs +4 -5
- package/dist/combobox/combobox-context.mjs.map +1 -1
- package/dist/combobox/combobox-group.d.mts +49 -1
- package/dist/combobox/combobox-group.d.mts.map +1 -1
- package/dist/combobox/combobox-group.mjs +14 -3
- package/dist/combobox/combobox-group.mjs.map +1 -1
- package/dist/combobox/combobox-input.d.mts +27 -5
- package/dist/combobox/combobox-input.d.mts.map +1 -1
- package/dist/combobox/combobox-input.mjs +53 -13
- package/dist/combobox/combobox-input.mjs.map +1 -1
- package/dist/combobox/combobox-keyboard.mjs +127 -0
- package/dist/combobox/combobox-keyboard.mjs.map +1 -0
- package/dist/combobox/combobox-label.d.mts +18 -1
- package/dist/combobox/combobox-label.d.mts.map +1 -1
- package/dist/combobox/combobox-label.mjs +4 -1
- package/dist/combobox/combobox-label.mjs.map +1 -1
- package/dist/combobox/combobox-list.d.mts +15 -1
- package/dist/combobox/combobox-list.d.mts.map +1 -1
- package/dist/combobox/combobox-list.mjs +13 -13
- package/dist/combobox/combobox-list.mjs.map +1 -1
- package/dist/combobox/combobox-option.d.mts +30 -5
- package/dist/combobox/combobox-option.d.mts.map +1 -1
- package/dist/combobox/combobox-option.mjs +9 -5
- package/dist/combobox/combobox-option.mjs.map +1 -1
- package/dist/combobox/combobox-popup.d.mts +24 -3
- package/dist/combobox/combobox-popup.d.mts.map +1 -1
- package/dist/combobox/combobox-popup.mjs +24 -29
- package/dist/combobox/combobox-popup.mjs.map +1 -1
- package/dist/combobox/combobox-root.d.mts +183 -43
- package/dist/combobox/combobox-root.d.mts.map +1 -1
- package/dist/combobox/combobox-root.mjs +476 -270
- package/dist/combobox/combobox-root.mjs.map +1 -1
- package/dist/combobox/combobox-trigger.d.mts +36 -8
- package/dist/combobox/combobox-trigger.d.mts.map +1 -1
- package/dist/combobox/combobox-trigger.mjs +50 -41
- package/dist/combobox/combobox-trigger.mjs.map +1 -1
- package/dist/combobox/index.d.mts +13 -5
- package/dist/combobox/index.d.mts.map +1 -1
- package/dist/combobox/index.mjs +13 -5
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/combobox/use-combobox-form.mjs +53 -0
- package/dist/combobox/use-combobox-form.mjs.map +1 -0
- package/dist/combobox/use-combobox-text.mjs +43 -0
- package/dist/combobox/use-combobox-text.mjs.map +1 -0
- package/dist/csp/csp-provider.d.mts +33 -0
- package/dist/csp/csp-provider.d.mts.map +1 -0
- package/dist/csp/csp-provider.mjs +26 -0
- package/dist/csp/csp-provider.mjs.map +1 -0
- package/dist/csp/index.d.mts +3 -0
- package/dist/csp/index.mjs +3 -0
- package/dist/csp/style-hashes.d.mts +21 -0
- package/dist/csp/style-hashes.d.mts.map +1 -0
- package/dist/csp/style-hashes.mjs +23 -0
- package/dist/csp/style-hashes.mjs.map +1 -0
- package/dist/dialog/dialog-close.d.mts +56 -12
- package/dist/dialog/dialog-close.d.mts.map +1 -1
- package/dist/dialog/dialog-close.mjs +63 -55
- package/dist/dialog/dialog-close.mjs.map +1 -1
- package/dist/dialog/dialog-context.d.mts +2 -0
- package/dist/dialog/dialog-context.mjs +20 -2
- package/dist/dialog/dialog-context.mjs.map +1 -1
- package/dist/dialog/dialog-description.d.mts +14 -1
- package/dist/dialog/dialog-description.d.mts.map +1 -1
- package/dist/dialog/dialog-description.mjs +10 -4
- package/dist/dialog/dialog-description.mjs.map +1 -1
- package/dist/dialog/dialog-dismiss.mjs +108 -0
- package/dist/dialog/dialog-dismiss.mjs.map +1 -0
- package/dist/dialog/dialog-form.d.mts +43 -11
- package/dist/dialog/dialog-form.d.mts.map +1 -1
- package/dist/dialog/dialog-form.mjs +64 -37
- package/dist/dialog/dialog-form.mjs.map +1 -1
- package/dist/dialog/dialog-popup.d.mts +48 -14
- package/dist/dialog/dialog-popup.d.mts.map +1 -1
- package/dist/dialog/dialog-popup.mjs +184 -241
- package/dist/dialog/dialog-popup.mjs.map +1 -1
- package/dist/dialog/dialog-root.d.mts +54 -19
- package/dist/dialog/dialog-root.d.mts.map +1 -1
- package/dist/dialog/dialog-root.mjs +76 -92
- package/dist/dialog/dialog-root.mjs.map +1 -1
- package/dist/dialog/dialog-title.d.mts +13 -1
- package/dist/dialog/dialog-title.d.mts.map +1 -1
- package/dist/dialog/dialog-title.mjs +10 -4
- package/dist/dialog/dialog-title.mjs.map +1 -1
- package/dist/dialog/dialog-trigger.d.mts +30 -6
- package/dist/dialog/dialog-trigger.d.mts.map +1 -1
- package/dist/dialog/dialog-trigger.mjs +50 -28
- package/dist/dialog/dialog-trigger.mjs.map +1 -1
- package/dist/dialog/index.d.mts +7 -3
- package/dist/dialog/index.d.mts.map +1 -1
- package/dist/dialog/index.mjs +7 -3
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/docs/components/accordion.md +428 -0
- package/dist/docs/components/alert-dialog.md +546 -0
- package/dist/docs/components/avatar.md +354 -0
- package/dist/docs/components/button.md +511 -0
- package/dist/docs/components/checkbox-group.md +483 -0
- package/dist/docs/components/checkbox.md +373 -0
- package/dist/docs/components/collapsible.md +408 -0
- package/dist/docs/components/combobox.md +960 -0
- package/dist/docs/components/context-menu.md +524 -0
- package/dist/docs/components/dialog.md +694 -0
- package/dist/docs/components/drawer.md +622 -0
- package/dist/docs/components/field.md +765 -0
- package/dist/docs/components/hover-card.md +494 -0
- package/dist/docs/components/menu.md +670 -0
- package/dist/docs/components/meter.md +313 -0
- package/dist/docs/components/multi-select.md +622 -0
- package/dist/docs/components/number-field.md +528 -0
- package/dist/docs/components/otp-field.md +501 -0
- package/dist/docs/components/popover.md +656 -0
- package/dist/docs/components/progress.md +450 -0
- package/dist/docs/components/radio-group.md +457 -0
- package/dist/docs/components/scroll-area.md +294 -0
- package/dist/docs/components/select.md +670 -0
- package/dist/docs/components/separator.md +182 -0
- package/dist/docs/components/slider.md +558 -0
- package/dist/docs/components/switch.md +311 -0
- package/dist/docs/components/tabs.md +473 -0
- package/dist/docs/components/toast.md +602 -0
- package/dist/docs/components/toggle-group.md +341 -0
- package/dist/docs/components/toggle.md +245 -0
- package/dist/docs/components/toolbar.md +390 -0
- package/dist/docs/components/tooltip.md +494 -0
- package/dist/docs/concepts/action-props.md +281 -0
- package/dist/docs/concepts/ai-agents.md +56 -0
- package/dist/docs/concepts/browser-owned-state.md +133 -0
- package/dist/docs/concepts/content-security-policy.md +69 -0
- package/dist/docs/concepts/experimental.md +36 -0
- package/dist/docs/concepts/pending-and-optimistic.md +263 -0
- package/dist/docs/concepts/render.md +23 -0
- package/dist/docs/concepts/server-components.md +132 -0
- package/dist/docs/concepts/suspense.md +129 -0
- package/dist/docs/concepts/transitions.md +112 -0
- package/dist/docs/getting-started.md +102 -0
- package/dist/docs/index.md +191 -0
- package/dist/docs/roadmap.md +150 -0
- package/dist/docs/why.md +104 -0
- package/dist/drawer/drawer-close.d.mts +26 -0
- package/dist/drawer/drawer-close.d.mts.map +1 -0
- package/dist/drawer/drawer-close.mjs +19 -0
- package/dist/drawer/drawer-close.mjs.map +1 -0
- package/dist/drawer/drawer-description.d.mts +23 -0
- package/dist/drawer/drawer-description.d.mts.map +1 -0
- package/dist/drawer/drawer-description.mjs +18 -0
- package/dist/drawer/drawer-description.mjs.map +1 -0
- package/dist/drawer/drawer-form.d.mts +24 -0
- package/dist/drawer/drawer-form.d.mts.map +1 -0
- package/dist/drawer/drawer-form.mjs +19 -0
- package/dist/drawer/drawer-form.mjs.map +1 -0
- package/dist/drawer/drawer-popup.d.mts +77 -0
- package/dist/drawer/drawer-popup.d.mts.map +1 -0
- package/dist/drawer/drawer-popup.mjs +124 -0
- package/dist/drawer/drawer-popup.mjs.map +1 -0
- package/dist/drawer/drawer-root.d.mts +31 -0
- package/dist/drawer/drawer-root.d.mts.map +1 -0
- package/dist/drawer/drawer-root.mjs +23 -0
- package/dist/drawer/drawer-root.mjs.map +1 -0
- package/dist/drawer/drawer-swipe.d.mts +5 -0
- package/dist/drawer/drawer-swipe.d.mts.map +1 -0
- package/dist/drawer/drawer-swipe.mjs +193 -0
- package/dist/drawer/drawer-swipe.mjs.map +1 -0
- package/dist/drawer/drawer-title.d.mts +23 -0
- package/dist/drawer/drawer-title.d.mts.map +1 -0
- package/dist/drawer/drawer-title.mjs +18 -0
- package/dist/drawer/drawer-title.mjs.map +1 -0
- package/dist/drawer/drawer-trigger.d.mts +23 -0
- package/dist/drawer/drawer-trigger.d.mts.map +1 -0
- package/dist/drawer/drawer-trigger.mjs +18 -0
- package/dist/drawer/drawer-trigger.mjs.map +1 -0
- package/dist/drawer/index.d.mts +34 -0
- package/dist/drawer/index.d.mts.map +1 -0
- package/dist/drawer/index.mjs +33 -0
- package/dist/drawer/index.mjs.map +1 -0
- package/dist/field/field-control.d.mts +65 -0
- package/dist/field/field-control.d.mts.map +1 -0
- package/dist/field/field-control.mjs +92 -0
- package/dist/field/field-control.mjs.map +1 -0
- package/dist/field/field-description.d.mts +35 -0
- package/dist/field/field-description.d.mts.map +1 -0
- package/dist/field/field-description.mjs +35 -0
- package/dist/field/field-description.mjs.map +1 -0
- package/dist/field/field-error.d.mts +42 -0
- package/dist/field/field-error.d.mts.map +1 -0
- package/dist/field/field-error.mjs +43 -0
- package/dist/field/field-error.mjs.map +1 -0
- package/dist/field/field-label.d.mts +39 -0
- package/dist/field/field-label.d.mts.map +1 -0
- package/dist/field/field-label.mjs +50 -0
- package/dist/field/field-label.mjs.map +1 -0
- package/dist/field/field-root.d.mts +72 -0
- package/dist/field/field-root.d.mts.map +1 -0
- package/dist/field/field-root.mjs +309 -0
- package/dist/field/field-root.mjs.map +1 -0
- package/dist/field/index.d.mts +27 -0
- package/dist/field/index.d.mts.map +1 -0
- package/dist/field/index.mjs +26 -0
- package/dist/field/index.mjs.map +1 -0
- package/dist/field/use-server-error-visibility.mjs +44 -0
- package/dist/field/use-server-error-visibility.mjs.map +1 -0
- package/dist/form/form-root.d.mts +74 -0
- package/dist/form/form-root.d.mts.map +1 -0
- package/dist/form/form-root.mjs +158 -0
- package/dist/form/form-root.mjs.map +1 -0
- package/dist/form/form-submit.d.mts +56 -0
- package/dist/form/form-submit.d.mts.map +1 -0
- package/dist/form/form-submit.mjs +53 -0
- package/dist/form/form-submit.mjs.map +1 -0
- package/dist/form/index.d.mts +18 -0
- package/dist/form/index.d.mts.map +1 -0
- package/dist/form/index.mjs +18 -0
- package/dist/form/index.mjs.map +1 -0
- package/dist/hover-card/hover-card-context.mjs +13 -0
- package/dist/hover-card/hover-card-context.mjs.map +1 -0
- package/dist/hover-card/hover-card-popup.d.mts +102 -0
- package/dist/hover-card/hover-card-popup.d.mts.map +1 -0
- package/dist/hover-card/hover-card-popup.mjs +80 -0
- package/dist/hover-card/hover-card-popup.mjs.map +1 -0
- package/dist/hover-card/hover-card-root.d.mts +94 -0
- package/dist/hover-card/hover-card-root.d.mts.map +1 -0
- package/dist/hover-card/hover-card-root.mjs +74 -0
- package/dist/hover-card/hover-card-root.mjs.map +1 -0
- package/dist/hover-card/hover-card-trigger.d.mts +65 -0
- package/dist/hover-card/hover-card-trigger.d.mts.map +1 -0
- package/dist/hover-card/hover-card-trigger.mjs +109 -0
- package/dist/hover-card/hover-card-trigger.mjs.map +1 -0
- package/dist/hover-card/index.d.mts +24 -0
- package/dist/hover-card/index.d.mts.map +1 -0
- package/dist/hover-card/index.mjs +24 -0
- package/dist/hover-card/index.mjs.map +1 -0
- package/dist/hover-card/use-hover-card-interest.mjs +242 -0
- package/dist/hover-card/use-hover-card-interest.mjs.map +1 -0
- package/dist/index.d.mts +118 -13
- package/dist/index.mjs +22 -1
- package/dist/internal/{action-details.mjs → action/action-details.mjs} +1 -1
- package/dist/internal/action/action-details.mjs.map +1 -0
- package/dist/internal/action/call-urgent-handler.mjs +32 -0
- package/dist/internal/action/call-urgent-handler.mjs.map +1 -0
- package/dist/internal/action/report-dropped.mjs +27 -0
- package/dist/internal/action/report-dropped.mjs.map +1 -0
- package/dist/internal/action/use-action-trigger.mjs +67 -0
- package/dist/internal/action/use-action-trigger.mjs.map +1 -0
- package/dist/internal/action/use-connected.mjs +24 -0
- package/dist/internal/action/use-connected.mjs.map +1 -0
- package/dist/internal/action/use-controllable-action.mjs +153 -0
- package/dist/internal/action/use-controllable-action.mjs.map +1 -0
- package/dist/internal/action/use-multiple-selection.mjs +83 -0
- package/dist/internal/action/use-multiple-selection.mjs.map +1 -0
- package/dist/internal/action/use-pure-trigger.mjs +34 -0
- package/dist/internal/action/use-pure-trigger.mjs.map +1 -0
- package/dist/internal/action/use-step-commit.mjs +147 -0
- package/dist/internal/action/use-step-commit.mjs.map +1 -0
- package/dist/internal/announce.mjs +20 -0
- package/dist/internal/announce.mjs.map +1 -0
- package/dist/internal/arrow-keys.mjs +21 -0
- package/dist/internal/arrow-keys.mjs.map +1 -0
- package/dist/internal/csp-context.mjs +8 -0
- package/dist/internal/csp-context.mjs.map +1 -0
- package/dist/internal/decimal.mjs +33 -0
- package/dist/internal/decimal.mjs.map +1 -0
- package/dist/internal/details-summary.mjs +56 -0
- package/dist/internal/details-summary.mjs.map +1 -0
- package/dist/internal/dev-warn.mjs +17 -0
- package/dist/internal/dev-warn.mjs.map +1 -0
- package/dist/internal/dom-order.mjs +17 -0
- package/dist/internal/dom-order.mjs.map +1 -0
- package/dist/internal/form/field-context.d.mts +19 -0
- package/dist/internal/form/field-context.d.mts.map +1 -0
- package/dist/internal/form/field-context.mjs +24 -0
- package/dist/internal/form/field-context.mjs.map +1 -0
- package/dist/internal/form/focus-first-invalid.mjs +67 -0
- package/dist/internal/form/focus-first-invalid.mjs.map +1 -0
- package/dist/internal/form/form-status-watcher.mjs +31 -0
- package/dist/internal/form/form-status-watcher.mjs.map +1 -0
- package/dist/internal/form/group-member.mjs +37 -0
- package/dist/internal/form/group-member.mjs.map +1 -0
- package/dist/internal/form/hidden-values.mjs +29 -0
- package/dist/internal/form/hidden-values.mjs.map +1 -0
- package/dist/internal/{sync-presence.mjs → form/sync-presence.mjs} +6 -2
- package/dist/internal/form/sync-presence.mjs.map +1 -0
- package/dist/internal/form/use-checkable-input.mjs +79 -0
- package/dist/internal/form/use-checkable-input.mjs.map +1 -0
- package/dist/internal/form/use-field-control.mjs +125 -0
- package/dist/internal/form/use-field-control.mjs.map +1 -0
- package/dist/internal/form/use-fieldset-group.mjs +46 -0
- package/dist/internal/form/use-fieldset-group.mjs.map +1 -0
- package/dist/internal/form/use-form-owner-event.mjs +44 -0
- package/dist/internal/form/use-form-owner-event.mjs.map +1 -0
- package/dist/internal/form/use-form-reset.mjs +39 -0
- package/dist/internal/form/use-form-reset.mjs.map +1 -0
- package/dist/internal/{use-native-checked.mjs → form/use-native-checked.mjs} +8 -9
- package/dist/internal/form/use-native-checked.mjs.map +1 -0
- package/dist/internal/{use-native-group-reconciliation.mjs → form/use-native-group-reconciliation.mjs} +15 -12
- package/dist/internal/form/use-native-group-reconciliation.mjs.map +1 -0
- package/dist/internal/{use-native-select-value.mjs → form/use-native-select-value.mjs} +8 -6
- package/dist/internal/form/use-native-select-value.mjs.map +1 -0
- package/dist/internal/form/validity.d.mts +35 -0
- package/dist/internal/form/validity.d.mts.map +1 -0
- package/dist/internal/form/validity.mjs +98 -0
- package/dist/internal/form/validity.mjs.map +1 -0
- package/dist/internal/overlay/anchor-position.d.mts +15 -0
- package/dist/internal/overlay/anchor-position.d.mts.map +1 -0
- package/dist/internal/overlay/anchor-position.mjs +132 -0
- package/dist/internal/overlay/anchor-position.mjs.map +1 -0
- package/dist/internal/overlay/content-focus-probe.mjs +42 -0
- package/dist/internal/overlay/content-focus-probe.mjs.map +1 -0
- package/dist/internal/overlay/css-transition-cut.mjs +66 -0
- package/dist/internal/overlay/css-transition-cut.mjs.map +1 -0
- package/dist/internal/overlay/focus-visible.mjs +26 -0
- package/dist/internal/overlay/focus-visible.mjs.map +1 -0
- package/dist/internal/overlay/invokers.mjs +63 -0
- package/dist/internal/overlay/invokers.mjs.map +1 -0
- package/dist/internal/overlay/modal-registry.mjs +39 -0
- package/dist/internal/overlay/modal-registry.mjs.map +1 -0
- package/dist/internal/overlay/overlay-popup.mjs +103 -0
- package/dist/internal/overlay/overlay-popup.mjs.map +1 -0
- package/dist/internal/overlay/overlay-show.mjs +73 -0
- package/dist/internal/overlay/overlay-show.mjs.map +1 -0
- package/dist/internal/overlay/popover-open.mjs +18 -0
- package/dist/internal/overlay/popover-open.mjs.map +1 -0
- package/dist/internal/overlay/trigger-ref.mjs +26 -0
- package/dist/internal/overlay/trigger-ref.mjs.map +1 -0
- package/dist/internal/overlay/use-apply-open-state.mjs +44 -0
- package/dist/internal/overlay/use-apply-open-state.mjs.map +1 -0
- package/dist/internal/{use-exit-animation.mjs → overlay/use-exit-animation.mjs} +28 -8
- package/dist/internal/overlay/use-exit-animation.mjs.map +1 -0
- package/dist/internal/overlay/use-interest-dismiss.mjs +85 -0
- package/dist/internal/overlay/use-interest-dismiss.mjs.map +1 -0
- package/dist/internal/overlay/use-modal-registration.mjs +47 -0
- package/dist/internal/overlay/use-modal-registration.mjs.map +1 -0
- package/dist/internal/overlay/use-overlay-close.mjs +72 -0
- package/dist/internal/overlay/use-overlay-close.mjs.map +1 -0
- package/dist/internal/overlay/use-overlay-root.d.mts +2 -0
- package/dist/internal/overlay/use-overlay-root.mjs +193 -0
- package/dist/internal/overlay/use-overlay-root.mjs.map +1 -0
- package/dist/internal/overlay/use-popover-popup.mjs +287 -0
- package/dist/internal/overlay/use-popover-popup.mjs.map +1 -0
- package/dist/internal/overlay/use-popover-trigger.d.mts +16 -0
- package/dist/internal/overlay/use-popover-trigger.d.mts.map +1 -0
- package/dist/internal/overlay/use-popover-trigger.mjs +142 -0
- package/dist/internal/overlay/use-popover-trigger.mjs.map +1 -0
- package/dist/internal/overlay/use-resolved-placement.mjs +162 -0
- package/dist/internal/overlay/use-resolved-placement.mjs.map +1 -0
- package/dist/internal/platform-attributes.d.mts +2 -1
- package/dist/internal/platform-attributes.d.mts.map +1 -1
- package/dist/internal/pointer-capture.mjs +20 -0
- package/dist/internal/pointer-capture.mjs.map +1 -0
- package/dist/internal/range-value.mjs +51 -0
- package/dist/internal/range-value.mjs.map +1 -0
- package/dist/internal/render-element.d.mts +2 -0
- package/dist/internal/render-element.mjs +123 -0
- package/dist/internal/render-element.mjs.map +1 -0
- package/dist/internal/shipped-styles.mjs +14 -0
- package/dist/internal/shipped-styles.mjs.map +1 -0
- package/dist/internal/swipe-arithmetic.mjs +75 -0
- package/dist/internal/swipe-arithmetic.mjs.map +1 -0
- package/dist/internal/swipe.mjs +169 -0
- package/dist/internal/swipe.mjs.map +1 -0
- package/dist/internal/toolbar-context.mjs +17 -0
- package/dist/internal/toolbar-context.mjs.map +1 -0
- package/dist/internal/transition-boundary.mjs +5 -9
- package/dist/internal/transition-boundary.mjs.map +1 -1
- package/dist/internal/typeahead.mjs +52 -0
- package/dist/internal/typeahead.mjs.map +1 -0
- package/dist/internal/types.d.mts +42 -9
- package/dist/internal/types.d.mts.map +1 -1
- package/dist/internal/use-active-option.mjs +51 -0
- package/dist/internal/use-active-option.mjs.map +1 -0
- package/dist/internal/use-deferred-leave.mjs +113 -0
- package/dist/internal/use-deferred-leave.mjs.map +1 -0
- package/dist/internal/use-dev-warning.mjs +8 -4
- package/dist/internal/use-dev-warning.mjs.map +1 -1
- package/dist/internal/use-element-check.mjs +39 -0
- package/dist/internal/use-element-check.mjs.map +1 -0
- package/dist/internal/use-item-order.mjs +42 -0
- package/dist/internal/use-item-order.mjs.map +1 -0
- package/dist/internal/use-latest.mjs +28 -0
- package/dist/internal/use-latest.mjs.map +1 -0
- package/dist/internal/use-merged-refs.mjs +19 -0
- package/dist/internal/use-merged-refs.mjs.map +1 -0
- package/dist/internal/use-mount-fixed.mjs +22 -0
- package/dist/internal/use-mount-fixed.mjs.map +1 -0
- package/dist/internal/use-name-warning.mjs +140 -0
- package/dist/internal/use-name-warning.mjs.map +1 -0
- package/dist/internal/use-native-focusgroup.mjs +19 -0
- package/dist/internal/use-native-focusgroup.mjs.map +1 -0
- package/dist/internal/use-option-registry.mjs +70 -0
- package/dist/internal/use-option-registry.mjs.map +1 -0
- package/dist/internal/use-register-count.mjs +27 -0
- package/dist/internal/use-register-count.mjs.map +1 -0
- package/dist/internal/use-render.d.mts +2 -0
- package/dist/internal/use-render.mjs +12 -35
- package/dist/internal/use-render.mjs.map +1 -1
- package/dist/internal/use-roving-focus.mjs +288 -0
- package/dist/internal/use-roving-focus.mjs.map +1 -0
- package/dist/internal/use-value-set.mjs +20 -0
- package/dist/internal/use-value-set.mjs.map +1 -0
- package/dist/internal/value-set.mjs +41 -0
- package/dist/internal/value-set.mjs.map +1 -0
- package/dist/menu/index.d.mts +8 -2
- package/dist/menu/index.d.mts.map +1 -1
- package/dist/menu/index.mjs +7 -1
- package/dist/menu/index.mjs.map +1 -1
- package/dist/menu/menu-checkbox-item.d.mts +27 -3
- package/dist/menu/menu-checkbox-item.d.mts.map +1 -1
- package/dist/menu/menu-checkbox-item.mjs +6 -3
- package/dist/menu/menu-checkbox-item.mjs.map +1 -1
- package/dist/menu/menu-context-trigger.d.mts +63 -0
- package/dist/menu/menu-context-trigger.d.mts.map +1 -0
- package/dist/menu/menu-context-trigger.mjs +231 -0
- package/dist/menu/menu-context-trigger.mjs.map +1 -0
- package/dist/menu/menu-context.d.mts +1 -1
- package/dist/menu/menu-context.mjs +44 -1
- package/dist/menu/menu-context.mjs.map +1 -1
- package/dist/menu/menu-dom.mjs +35 -4
- package/dist/menu/menu-dom.mjs.map +1 -1
- package/dist/menu/menu-gestures.mjs +166 -0
- package/dist/menu/menu-gestures.mjs.map +1 -0
- package/dist/menu/menu-group.d.mts +36 -1
- package/dist/menu/menu-group.d.mts.map +1 -1
- package/dist/menu/menu-group.mjs +15 -5
- package/dist/menu/menu-group.mjs.map +1 -1
- package/dist/menu/menu-hover.mjs +0 -1
- package/dist/menu/menu-hover.mjs.map +1 -1
- package/dist/menu/menu-item.d.mts +42 -5
- package/dist/menu/menu-item.d.mts.map +1 -1
- package/dist/menu/menu-item.mjs +18 -9
- package/dist/menu/menu-item.mjs.map +1 -1
- package/dist/menu/menu-outside.mjs +101 -0
- package/dist/menu/menu-outside.mjs.map +1 -0
- package/dist/menu/menu-point.mjs +85 -0
- package/dist/menu/menu-point.mjs.map +1 -0
- package/dist/menu/menu-popup.d.mts +68 -11
- package/dist/menu/menu-popup.d.mts.map +1 -1
- package/dist/menu/menu-popup.mjs +106 -116
- package/dist/menu/menu-popup.mjs.map +1 -1
- package/dist/menu/menu-radio-group.d.mts +20 -1
- package/dist/menu/menu-radio-group.d.mts.map +1 -1
- package/dist/menu/menu-radio-group.mjs +14 -7
- package/dist/menu/menu-radio-group.mjs.map +1 -1
- package/dist/menu/menu-radio-item.d.mts +18 -0
- package/dist/menu/menu-radio-item.d.mts.map +1 -1
- package/dist/menu/menu-radio-item.mjs +5 -1
- package/dist/menu/menu-radio-item.mjs.map +1 -1
- package/dist/menu/menu-root.d.mts +61 -12
- package/dist/menu/menu-root.d.mts.map +1 -1
- package/dist/menu/menu-root.mjs +72 -17
- package/dist/menu/menu-root.mjs.map +1 -1
- package/dist/menu/menu-submenu-trigger.d.mts +24 -9
- package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
- package/dist/menu/menu-submenu-trigger.mjs +48 -26
- package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
- package/dist/menu/menu-trigger.d.mts +37 -16
- package/dist/menu/menu-trigger.d.mts.map +1 -1
- package/dist/menu/menu-trigger.mjs +39 -23
- package/dist/menu/menu-trigger.mjs.map +1 -1
- package/dist/menu/use-menu-item.mjs +14 -16
- package/dist/menu/use-menu-item.mjs.map +1 -1
- package/dist/menu/use-menu-keyboard.mjs +68 -0
- package/dist/menu/use-menu-keyboard.mjs.map +1 -0
- package/dist/meter/index.d.mts +26 -0
- package/dist/meter/index.d.mts.map +1 -0
- package/dist/meter/index.mjs +25 -0
- package/dist/meter/index.mjs.map +1 -0
- package/dist/meter/meter-context.mjs +13 -0
- package/dist/meter/meter-context.mjs.map +1 -0
- package/dist/meter/meter-indicator.d.mts +30 -0
- package/dist/meter/meter-indicator.d.mts.map +1 -0
- package/dist/meter/meter-indicator.mjs +27 -0
- package/dist/meter/meter-indicator.mjs.map +1 -0
- package/dist/meter/meter-label.d.mts +30 -0
- package/dist/meter/meter-label.d.mts.map +1 -0
- package/dist/meter/meter-label.mjs +30 -0
- package/dist/meter/meter-label.mjs.map +1 -0
- package/dist/meter/meter-region.d.mts +9 -0
- package/dist/meter/meter-region.d.mts.map +1 -0
- package/dist/meter/meter-region.mjs +39 -0
- package/dist/meter/meter-region.mjs.map +1 -0
- package/dist/meter/meter-root.d.mts +113 -0
- package/dist/meter/meter-root.d.mts.map +1 -0
- package/dist/meter/meter-root.mjs +85 -0
- package/dist/meter/meter-root.mjs.map +1 -0
- package/dist/meter/meter-track.d.mts +30 -0
- package/dist/meter/meter-track.d.mts.map +1 -0
- package/dist/meter/meter-track.mjs +27 -0
- package/dist/meter/meter-track.mjs.map +1 -0
- package/dist/meter/meter-value.d.mts +34 -0
- package/dist/meter/meter-value.d.mts.map +1 -0
- package/dist/meter/meter-value.mjs +31 -0
- package/dist/meter/meter-value.mjs.map +1 -0
- package/dist/multi-select/index.d.mts +37 -0
- package/dist/multi-select/index.d.mts.map +1 -0
- package/dist/multi-select/index.mjs +37 -0
- package/dist/multi-select/index.mjs.map +1 -0
- package/dist/multi-select/multi-select-context.mjs +19 -0
- package/dist/multi-select/multi-select-context.mjs.map +1 -0
- package/dist/multi-select/multi-select-group.d.mts +120 -0
- package/dist/multi-select/multi-select-group.d.mts.map +1 -0
- package/dist/multi-select/multi-select-group.mjs +111 -0
- package/dist/multi-select/multi-select-group.mjs.map +1 -0
- package/dist/multi-select/multi-select-keyboard.mjs +145 -0
- package/dist/multi-select/multi-select-keyboard.mjs.map +1 -0
- package/dist/multi-select/multi-select-label.d.mts +42 -0
- package/dist/multi-select/multi-select-label.d.mts.map +1 -0
- package/dist/multi-select/multi-select-label.mjs +41 -0
- package/dist/multi-select/multi-select-label.mjs.map +1 -0
- package/dist/multi-select/multi-select-list.d.mts +47 -0
- package/dist/multi-select/multi-select-list.d.mts.map +1 -0
- package/dist/multi-select/multi-select-list.mjs +65 -0
- package/dist/multi-select/multi-select-list.mjs.map +1 -0
- package/dist/multi-select/multi-select-option.d.mts +68 -0
- package/dist/multi-select/multi-select-option.d.mts.map +1 -0
- package/dist/multi-select/multi-select-option.mjs +93 -0
- package/dist/multi-select/multi-select-option.mjs.map +1 -0
- package/dist/multi-select/multi-select-popup.d.mts +58 -0
- package/dist/multi-select/multi-select-popup.d.mts.map +1 -0
- package/dist/multi-select/multi-select-popup.mjs +71 -0
- package/dist/multi-select/multi-select-popup.mjs.map +1 -0
- package/dist/multi-select/multi-select-root.d.mts +125 -0
- package/dist/multi-select/multi-select-root.d.mts.map +1 -0
- package/dist/multi-select/multi-select-root.mjs +257 -0
- package/dist/multi-select/multi-select-root.mjs.map +1 -0
- package/dist/multi-select/multi-select-trigger.d.mts +66 -0
- package/dist/multi-select/multi-select-trigger.d.mts.map +1 -0
- package/dist/multi-select/multi-select-trigger.mjs +169 -0
- package/dist/multi-select/multi-select-trigger.mjs.map +1 -0
- package/dist/multi-select/multi-select-value.d.mts +57 -0
- package/dist/multi-select/multi-select-value.d.mts.map +1 -0
- package/dist/multi-select/multi-select-value.mjs +41 -0
- package/dist/multi-select/multi-select-value.mjs.map +1 -0
- package/dist/number-field/index.d.mts +29 -0
- package/dist/number-field/index.d.mts.map +1 -0
- package/dist/number-field/index.mjs +28 -0
- package/dist/number-field/index.mjs.map +1 -0
- package/dist/number-field/number-field-arithmetic.mjs +97 -0
- package/dist/number-field/number-field-arithmetic.mjs.map +1 -0
- package/dist/number-field/number-field-context.d.mts +7 -0
- package/dist/number-field/number-field-context.d.mts.map +1 -0
- package/dist/number-field/number-field-context.mjs +13 -0
- package/dist/number-field/number-field-context.mjs.map +1 -0
- package/dist/number-field/number-field-decrement.d.mts +19 -0
- package/dist/number-field/number-field-decrement.d.mts.map +1 -0
- package/dist/number-field/number-field-decrement.mjs +22 -0
- package/dist/number-field/number-field-decrement.mjs.map +1 -0
- package/dist/number-field/number-field-format.mjs +279 -0
- package/dist/number-field/number-field-format.mjs.map +1 -0
- package/dist/number-field/number-field-increment.d.mts +19 -0
- package/dist/number-field/number-field-increment.d.mts.map +1 -0
- package/dist/number-field/number-field-increment.mjs +22 -0
- package/dist/number-field/number-field-increment.mjs.map +1 -0
- package/dist/number-field/number-field-input.d.mts +38 -0
- package/dist/number-field/number-field-input.d.mts.map +1 -0
- package/dist/number-field/number-field-input.mjs +161 -0
- package/dist/number-field/number-field-input.mjs.map +1 -0
- package/dist/number-field/number-field-label.d.mts +33 -0
- package/dist/number-field/number-field-label.d.mts.map +1 -0
- package/dist/number-field/number-field-label.mjs +43 -0
- package/dist/number-field/number-field-label.mjs.map +1 -0
- package/dist/number-field/number-field-root.d.mts +157 -0
- package/dist/number-field/number-field-root.d.mts.map +1 -0
- package/dist/number-field/number-field-root.mjs +445 -0
- package/dist/number-field/number-field-root.mjs.map +1 -0
- package/dist/number-field/use-number-field-dev-warnings.mjs +28 -0
- package/dist/number-field/use-number-field-dev-warnings.mjs.map +1 -0
- package/dist/number-field/use-step-button.d.mts +44 -0
- package/dist/number-field/use-step-button.d.mts.map +1 -0
- package/dist/number-field/use-step-button.mjs +175 -0
- package/dist/number-field/use-step-button.mjs.map +1 -0
- package/dist/otp-field/index.d.mts +23 -0
- package/dist/otp-field/index.d.mts.map +1 -0
- package/dist/otp-field/index.mjs +23 -0
- package/dist/otp-field/index.mjs.map +1 -0
- package/dist/otp-field/otp-field-context.mjs +13 -0
- package/dist/otp-field/otp-field-context.mjs.map +1 -0
- package/dist/otp-field/otp-field-filter.d.mts +5 -0
- package/dist/otp-field/otp-field-filter.d.mts.map +1 -0
- package/dist/otp-field/otp-field-filter.mjs +135 -0
- package/dist/otp-field/otp-field-filter.mjs.map +1 -0
- package/dist/otp-field/otp-field-input.d.mts +41 -0
- package/dist/otp-field/otp-field-input.d.mts.map +1 -0
- package/dist/otp-field/otp-field-input.mjs +177 -0
- package/dist/otp-field/otp-field-input.mjs.map +1 -0
- package/dist/otp-field/otp-field-root.d.mts +143 -0
- package/dist/otp-field/otp-field-root.d.mts.map +1 -0
- package/dist/otp-field/otp-field-root.mjs +397 -0
- package/dist/otp-field/otp-field-root.mjs.map +1 -0
- package/dist/otp-field/otp-field-slot.d.mts +52 -0
- package/dist/otp-field/otp-field-slot.d.mts.map +1 -0
- package/dist/otp-field/otp-field-slot.mjs +67 -0
- package/dist/otp-field/otp-field-slot.mjs.map +1 -0
- package/dist/popover/index.d.mts +6 -4
- package/dist/popover/index.d.mts.map +1 -1
- package/dist/popover/index.mjs +6 -4
- package/dist/popover/index.mjs.map +1 -1
- package/dist/popover/popover-close.d.mts +48 -8
- package/dist/popover/popover-close.d.mts.map +1 -1
- package/dist/popover/popover-close.mjs +41 -67
- package/dist/popover/popover-close.mjs.map +1 -1
- package/dist/popover/popover-context.mjs.map +1 -1
- package/dist/popover/popover-description.d.mts +12 -0
- package/dist/popover/popover-description.d.mts.map +1 -1
- package/dist/popover/popover-description.mjs +2 -0
- package/dist/popover/popover-description.mjs.map +1 -1
- package/dist/popover/popover-popup.d.mts +64 -18
- package/dist/popover/popover-popup.d.mts.map +1 -1
- package/dist/popover/popover-popup.mjs +31 -36
- package/dist/popover/popover-popup.mjs.map +1 -1
- package/dist/popover/popover-root.d.mts +40 -18
- package/dist/popover/popover-root.d.mts.map +1 -1
- package/dist/popover/popover-root.mjs +15 -10
- package/dist/popover/popover-root.mjs.map +1 -1
- package/dist/popover/popover-title.d.mts +11 -0
- package/dist/popover/popover-title.d.mts.map +1 -1
- package/dist/popover/popover-title.mjs +2 -0
- package/dist/popover/popover-title.mjs.map +1 -1
- package/dist/popover/popover-trigger.d.mts +38 -18
- package/dist/popover/popover-trigger.d.mts.map +1 -1
- package/dist/popover/popover-trigger.mjs +14 -9
- package/dist/popover/popover-trigger.mjs.map +1 -1
- package/dist/progress/index.d.mts +26 -0
- package/dist/progress/index.d.mts.map +1 -0
- package/dist/progress/index.mjs +26 -0
- package/dist/progress/index.mjs.map +1 -0
- package/dist/progress/progress-context.mjs +13 -0
- package/dist/progress/progress-context.mjs.map +1 -0
- package/dist/progress/progress-indicator.d.mts +30 -0
- package/dist/progress/progress-indicator.d.mts.map +1 -0
- package/dist/progress/progress-indicator.mjs +31 -0
- package/dist/progress/progress-indicator.mjs.map +1 -0
- package/dist/progress/progress-label.d.mts +30 -0
- package/dist/progress/progress-label.d.mts.map +1 -0
- package/dist/progress/progress-label.mjs +32 -0
- package/dist/progress/progress-label.mjs.map +1 -0
- package/dist/progress/progress-root.d.mts +96 -0
- package/dist/progress/progress-root.d.mts.map +1 -0
- package/dist/progress/progress-root.mjs +82 -0
- package/dist/progress/progress-root.mjs.map +1 -0
- package/dist/progress/progress-track.d.mts +30 -0
- package/dist/progress/progress-track.d.mts.map +1 -0
- package/dist/progress/progress-track.mjs +31 -0
- package/dist/progress/progress-track.mjs.map +1 -0
- package/dist/progress/progress-value.d.mts +34 -0
- package/dist/progress/progress-value.d.mts.map +1 -0
- package/dist/progress/progress-value.mjs +35 -0
- package/dist/progress/progress-value.mjs.map +1 -0
- package/dist/radio-group/index.d.mts +2 -0
- package/dist/radio-group/index.d.mts.map +1 -1
- package/dist/radio-group/index.mjs +2 -0
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/radio-group/radio-group-context.mjs.map +1 -1
- package/dist/radio-group/radio-group-item.d.mts +21 -5
- package/dist/radio-group/radio-group-item.d.mts.map +1 -1
- package/dist/radio-group/radio-group-item.mjs +22 -25
- package/dist/radio-group/radio-group-item.mjs.map +1 -1
- package/dist/radio-group/radio-group-label.d.mts +10 -0
- package/dist/radio-group/radio-group-label.d.mts.map +1 -1
- package/dist/radio-group/radio-group-label.mjs +3 -6
- package/dist/radio-group/radio-group-label.mjs.map +1 -1
- package/dist/radio-group/radio-group-root.d.mts +34 -8
- package/dist/radio-group/radio-group-root.d.mts.map +1 -1
- package/dist/radio-group/radio-group-root.mjs +48 -39
- package/dist/radio-group/radio-group-root.mjs.map +1 -1
- package/dist/select/index.d.mts +2 -0
- package/dist/select/index.d.mts.map +1 -1
- package/dist/select/index.mjs +2 -0
- package/dist/select/index.mjs.map +1 -1
- package/dist/select/select-dom.mjs +9 -18
- package/dist/select/select-dom.mjs.map +1 -1
- package/dist/select/select-group-label.d.mts +10 -0
- package/dist/select/select-group-label.d.mts.map +1 -1
- package/dist/select/select-group-label.mjs +5 -1
- package/dist/select/select-group-label.mjs.map +1 -1
- package/dist/select/select-group.d.mts +15 -1
- package/dist/select/select-group.d.mts.map +1 -1
- package/dist/select/select-group.mjs +8 -4
- package/dist/select/select-group.mjs.map +1 -1
- package/dist/select/select-option.d.mts +19 -1
- package/dist/select/select-option.d.mts.map +1 -1
- package/dist/select/select-option.mjs +4 -2
- package/dist/select/select-option.mjs.map +1 -1
- package/dist/select/select-root.d.mts +28 -3
- package/dist/select/select-root.d.mts.map +1 -1
- package/dist/select/select-root.mjs +39 -12
- package/dist/select/select-root.mjs.map +1 -1
- package/dist/select/select-separator.d.mts +9 -0
- package/dist/select/select-separator.d.mts.map +1 -1
- package/dist/select/select-separator.mjs +2 -0
- package/dist/select/select-separator.mjs.map +1 -1
- package/dist/select/select-trigger.d.mts +9 -0
- package/dist/select/select-trigger.d.mts.map +1 -1
- package/dist/select/select-trigger.mjs +5 -1
- package/dist/select/select-trigger.mjs.map +1 -1
- package/dist/select/select-value.d.mts +9 -0
- package/dist/select/select-value.d.mts.map +1 -1
- package/dist/select/select-value.mjs +5 -6
- package/dist/select/select-value.mjs.map +1 -1
- package/dist/separator/index.d.mts +3 -0
- package/dist/separator/index.mjs +1 -0
- package/dist/separator/separator.d.mts +58 -0
- package/dist/separator/separator.d.mts.map +1 -0
- package/dist/separator/separator.mjs +41 -0
- package/dist/separator/separator.mjs.map +1 -0
- package/dist/slider/index.d.mts +34 -0
- package/dist/slider/index.d.mts.map +1 -0
- package/dist/slider/index.mjs +29 -0
- package/dist/slider/index.mjs.map +1 -0
- package/dist/slider/slider-arithmetic.mjs +165 -0
- package/dist/slider/slider-arithmetic.mjs.map +1 -0
- package/dist/slider/slider-context.mjs +13 -0
- package/dist/slider/slider-context.mjs.map +1 -0
- package/dist/slider/slider-indicator.d.mts +34 -0
- package/dist/slider/slider-indicator.d.mts.map +1 -0
- package/dist/slider/slider-indicator.mjs +38 -0
- package/dist/slider/slider-indicator.mjs.map +1 -0
- package/dist/slider/slider-label.d.mts +33 -0
- package/dist/slider/slider-label.d.mts.map +1 -0
- package/dist/slider/slider-label.mjs +40 -0
- package/dist/slider/slider-label.mjs.map +1 -0
- package/dist/slider/slider-root.d.mts +155 -0
- package/dist/slider/slider-root.d.mts.map +1 -0
- package/dist/slider/slider-root.mjs +434 -0
- package/dist/slider/slider-root.mjs.map +1 -0
- package/dist/slider/slider-thumb.d.mts +87 -0
- package/dist/slider/slider-thumb.d.mts.map +1 -0
- package/dist/slider/slider-thumb.mjs +150 -0
- package/dist/slider/slider-thumb.mjs.map +1 -0
- package/dist/slider/slider-track.d.mts +46 -0
- package/dist/slider/slider-track.d.mts.map +1 -0
- package/dist/slider/slider-track.mjs +57 -0
- package/dist/slider/slider-track.mjs.map +1 -0
- package/dist/slider/slider-value.d.mts +45 -0
- package/dist/slider/slider-value.d.mts.map +1 -0
- package/dist/slider/slider-value.mjs +41 -0
- package/dist/slider/slider-value.mjs.map +1 -0
- package/dist/slider/use-slider-dev-warnings.mjs +29 -0
- package/dist/slider/use-slider-dev-warnings.mjs.map +1 -0
- package/dist/slider/use-thumb-registry.mjs +51 -0
- package/dist/slider/use-thumb-registry.mjs.map +1 -0
- package/dist/switch/switch.d.mts +30 -9
- package/dist/switch/switch.d.mts.map +1 -1
- package/dist/switch/switch.mjs +24 -46
- package/dist/switch/switch.mjs.map +1 -1
- package/dist/tabs/index.d.mts +2 -0
- package/dist/tabs/index.d.mts.map +1 -1
- package/dist/tabs/index.mjs +2 -0
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/tabs/tabs-context.d.mts +7 -3
- package/dist/tabs/tabs-context.d.mts.map +1 -1
- package/dist/tabs/tabs-context.mjs.map +1 -1
- package/dist/tabs/tabs-indicator.d.mts +17 -0
- package/dist/tabs/tabs-indicator.d.mts.map +1 -1
- package/dist/tabs/tabs-indicator.mjs +4 -1
- package/dist/tabs/tabs-indicator.mjs.map +1 -1
- package/dist/tabs/tabs-list.d.mts +19 -1
- package/dist/tabs/tabs-list.d.mts.map +1 -1
- package/dist/tabs/tabs-list.mjs +12 -23
- package/dist/tabs/tabs-list.mjs.map +1 -1
- package/dist/tabs/tabs-panel.d.mts +22 -4
- package/dist/tabs/tabs-panel.d.mts.map +1 -1
- package/dist/tabs/tabs-panel.mjs +4 -2
- package/dist/tabs/tabs-panel.mjs.map +1 -1
- package/dist/tabs/tabs-root.d.mts +43 -8
- package/dist/tabs/tabs-root.d.mts.map +1 -1
- package/dist/tabs/tabs-root.mjs +23 -10
- package/dist/tabs/tabs-root.mjs.map +1 -1
- package/dist/tabs/tabs-tab.d.mts +25 -5
- package/dist/tabs/tabs-tab.d.mts.map +1 -1
- package/dist/tabs/tabs-tab.mjs +5 -2
- package/dist/tabs/tabs-tab.mjs.map +1 -1
- package/dist/{internal → tabs}/use-until-found.mjs +1 -1
- package/dist/tabs/use-until-found.mjs.map +1 -0
- package/dist/toast/index.d.mts +27 -0
- package/dist/toast/index.d.mts.map +1 -0
- package/dist/toast/index.mjs +28 -0
- package/dist/toast/index.mjs.map +1 -0
- package/dist/toast/toast-action.d.mts +86 -0
- package/dist/toast/toast-action.d.mts.map +1 -0
- package/dist/toast/toast-action.mjs +81 -0
- package/dist/toast/toast-action.mjs.map +1 -0
- package/dist/toast/toast-close.d.mts +52 -0
- package/dist/toast/toast-close.d.mts.map +1 -0
- package/dist/toast/toast-close.mjs +53 -0
- package/dist/toast/toast-close.mjs.map +1 -0
- package/dist/toast/toast-context.mjs +19 -0
- package/dist/toast/toast-context.mjs.map +1 -0
- package/dist/toast/toast-description.d.mts +39 -0
- package/dist/toast/toast-description.d.mts.map +1 -0
- package/dist/toast/toast-description.mjs +37 -0
- package/dist/toast/toast-description.mjs.map +1 -0
- package/dist/toast/toast-hotkey.mjs +27 -0
- package/dist/toast/toast-hotkey.mjs.map +1 -0
- package/dist/toast/toast-queue.mjs +137 -0
- package/dist/toast/toast-queue.mjs.map +1 -0
- package/dist/toast/toast-root.d.mts +63 -0
- package/dist/toast/toast-root.d.mts.map +1 -0
- package/dist/toast/toast-root.mjs +209 -0
- package/dist/toast/toast-root.mjs.map +1 -0
- package/dist/toast/toast-timers.mjs +65 -0
- package/dist/toast/toast-timers.mjs.map +1 -0
- package/dist/toast/toast-title.d.mts +38 -0
- package/dist/toast/toast-title.d.mts.map +1 -0
- package/dist/toast/toast-title.mjs +35 -0
- package/dist/toast/toast-title.mjs.map +1 -0
- package/dist/toast/toast-viewport.d.mts +81 -0
- package/dist/toast/toast-viewport.d.mts.map +1 -0
- package/dist/toast/toast-viewport.mjs +345 -0
- package/dist/toast/toast-viewport.mjs.map +1 -0
- package/dist/toast/toast.d.mts +162 -0
- package/dist/toast/toast.d.mts.map +1 -0
- package/dist/toast/toast.mjs +161 -0
- package/dist/toast/toast.mjs.map +1 -0
- package/dist/toast/use-modal-portal-host.mjs +52 -0
- package/dist/toast/use-modal-portal-host.mjs.map +1 -0
- package/dist/toast/use-toast-announcements.mjs +46 -0
- package/dist/toast/use-toast-announcements.mjs.map +1 -0
- package/dist/toast/use-toast-focus.mjs +75 -0
- package/dist/toast/use-toast-focus.mjs.map +1 -0
- package/dist/toast/use-toast-pauses.mjs +58 -0
- package/dist/toast/use-toast-pauses.mjs.map +1 -0
- package/dist/toggle/toggle.d.mts +26 -6
- package/dist/toggle/toggle.d.mts.map +1 -1
- package/dist/toggle/toggle.mjs +12 -6
- package/dist/toggle/toggle.mjs.map +1 -1
- package/dist/toggle-group/index.d.mts +18 -0
- package/dist/toggle-group/index.d.mts.map +1 -0
- package/dist/toggle-group/index.mjs +17 -0
- package/dist/toggle-group/index.mjs.map +1 -0
- package/dist/toggle-group/toggle-group-context.d.mts +6 -0
- package/dist/toggle-group/toggle-group-context.d.mts.map +1 -0
- package/dist/toggle-group/toggle-group-context.mjs +13 -0
- package/dist/toggle-group/toggle-group-context.mjs.map +1 -0
- package/dist/toggle-group/toggle-group-item.d.mts +71 -0
- package/dist/toggle-group/toggle-group-item.d.mts.map +1 -0
- package/dist/toggle-group/toggle-group-item.mjs +69 -0
- package/dist/toggle-group/toggle-group-item.mjs.map +1 -0
- package/dist/toggle-group/toggle-group-root.d.mts +156 -0
- package/dist/toggle-group/toggle-group-root.d.mts.map +1 -0
- package/dist/toggle-group/toggle-group-root.mjs +177 -0
- package/dist/toggle-group/toggle-group-root.mjs.map +1 -0
- package/dist/toolbar/index.d.mts +19 -0
- package/dist/toolbar/index.d.mts.map +1 -0
- package/dist/toolbar/index.mjs +19 -0
- package/dist/toolbar/index.mjs.map +1 -0
- package/dist/toolbar/toolbar-root.d.mts +65 -0
- package/dist/toolbar/toolbar-root.d.mts.map +1 -0
- package/dist/toolbar/toolbar-root.mjs +67 -0
- package/dist/toolbar/toolbar-root.mjs.map +1 -0
- package/dist/toolbar/toolbar-separator.d.mts +38 -0
- package/dist/toolbar/toolbar-separator.d.mts.map +1 -0
- package/dist/toolbar/toolbar-separator.mjs +33 -0
- package/dist/toolbar/toolbar-separator.mjs.map +1 -0
- package/dist/tooltip/index.d.mts +10 -5
- package/dist/tooltip/index.d.mts.map +1 -1
- package/dist/tooltip/index.mjs +8 -3
- package/dist/tooltip/index.mjs.map +1 -1
- package/dist/tooltip/tooltip-arrow.d.mts +46 -0
- package/dist/tooltip/tooltip-arrow.d.mts.map +1 -0
- package/dist/tooltip/tooltip-arrow.mjs +47 -0
- package/dist/tooltip/tooltip-arrow.mjs.map +1 -0
- package/dist/tooltip/tooltip-context.d.mts +11 -0
- package/dist/tooltip/tooltip-context.d.mts.map +1 -1
- package/dist/tooltip/tooltip-context.mjs +2 -1
- package/dist/tooltip/tooltip-context.mjs.map +1 -1
- package/dist/tooltip/tooltip-popup.d.mts +49 -7
- package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
- package/dist/tooltip/tooltip-popup.mjs +37 -15
- package/dist/tooltip/tooltip-popup.mjs.map +1 -1
- package/dist/tooltip/tooltip-root.d.mts +24 -2
- package/dist/tooltip/tooltip-root.d.mts.map +1 -1
- package/dist/tooltip/tooltip-root.mjs +29 -6
- package/dist/tooltip/tooltip-root.mjs.map +1 -1
- package/dist/tooltip/tooltip-trigger.d.mts +28 -3
- package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
- package/dist/tooltip/tooltip-trigger.mjs +26 -6
- package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
- package/dist/tooltip/tooltip-warm.mjs +29 -0
- package/dist/tooltip/tooltip-warm.mjs.map +1 -0
- package/dist/tooltip/use-tooltip-interaction.mjs +128 -77
- package/dist/tooltip/use-tooltip-interaction.mjs.map +1 -1
- package/package.json +30 -2
- package/skills/funstack-ui-knowledge/SKILL.md +84 -0
- package/dist/accordion/accordion-context.d.mts +0 -5
- package/dist/accordion/accordion-context.d.mts.map +0 -1
- package/dist/internal/action-details.mjs.map +0 -1
- package/dist/internal/anchor-position.d.mts +0 -7
- package/dist/internal/anchor-position.d.mts.map +0 -1
- package/dist/internal/anchor-position.mjs +0 -16
- package/dist/internal/anchor-position.mjs.map +0 -1
- package/dist/internal/sync-presence.mjs.map +0 -1
- package/dist/internal/use-action-trigger.mjs +0 -58
- package/dist/internal/use-action-trigger.mjs.map +0 -1
- package/dist/internal/use-controllable-action.mjs +0 -119
- package/dist/internal/use-controllable-action.mjs.map +0 -1
- package/dist/internal/use-exit-animation.mjs.map +0 -1
- package/dist/internal/use-form-reset.mjs +0 -54
- package/dist/internal/use-form-reset.mjs.map +0 -1
- package/dist/internal/use-native-checked.mjs.map +0 -1
- package/dist/internal/use-native-group-reconciliation.mjs.map +0 -1
- package/dist/internal/use-native-select-value.mjs.map +0 -1
- package/dist/internal/use-popover-popup.mjs +0 -274
- package/dist/internal/use-popover-popup.mjs.map +0 -1
- package/dist/internal/use-popover-root.d.mts +0 -2
- package/dist/internal/use-popover-root.mjs +0 -112
- package/dist/internal/use-popover-root.mjs.map +0 -1
- package/dist/internal/use-popover-trigger.mjs +0 -86
- package/dist/internal/use-popover-trigger.mjs.map +0 -1
- package/dist/internal/use-until-found.mjs.map +0 -1
|
@@ -0,0 +1,960 @@
|
|
|
1
|
+
# Combobox
|
|
2
|
+
|
|
3
|
+
A text input with a listbox of suggestions (the WAI-ARIA "editable combobox with list autocomplete"). Focus stays in the input; the active option moves with `aria-activedescendant`. The listbox is a `popover="auto"` anchored to the input with CSS, so the platform provides the top layer, light dismiss, Escape and nesting inside dialogs. The library filters nothing: you render the options for a query, synchronously or with `use()` under your own `<Suspense>`.
|
|
4
|
+
|
|
5
|
+
```tsx title="ComboboxCountry.tsx"
|
|
6
|
+
"use client";
|
|
7
|
+
import { Suspense, startTransition, use, useState } from "react";
|
|
8
|
+
import { Combobox } from "@funstack/ui/combobox";
|
|
9
|
+
import { DemoErrorBoundary } from "./DemoErrorBoundary.js";
|
|
10
|
+
import { fakeSave, sleep } from "./fake-api.js";
|
|
11
|
+
|
|
12
|
+
interface Country {
|
|
13
|
+
readonly code: string;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const COUNTRIES: readonly Country[] = [
|
|
18
|
+
{ code: "ar", name: "Argentina" },
|
|
19
|
+
{ code: "au", name: "Australia" },
|
|
20
|
+
{ code: "br", name: "Brazil" },
|
|
21
|
+
{ code: "ca", name: "Canada" },
|
|
22
|
+
{ code: "fr", name: "France" },
|
|
23
|
+
{ code: "de", name: "Germany" },
|
|
24
|
+
{ code: "in", name: "India" },
|
|
25
|
+
{ code: "jm", name: "Jamaica" },
|
|
26
|
+
{ code: "jp", name: "Japan" },
|
|
27
|
+
{ code: "je", name: "Jersey" },
|
|
28
|
+
{ code: "ke", name: "Kenya" },
|
|
29
|
+
{ code: "mx", name: "Mexico" },
|
|
30
|
+
{ code: "nz", name: "New Zealand" },
|
|
31
|
+
{ code: "no", name: "Norway" },
|
|
32
|
+
{ code: "es", name: "Spain" },
|
|
33
|
+
{ code: "gb", name: "United Kingdom" },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
// A pretend search API with a cache keyed by query: one promise per query, read with `use()`.
|
|
37
|
+
// Results arrive in random order; React only ever renders the latest query's.
|
|
38
|
+
const cache = new Map<string, Promise<readonly Country[]>>();
|
|
39
|
+
function searchCountries(query: string): Promise<readonly Country[]> {
|
|
40
|
+
const key = query.trim().toLowerCase();
|
|
41
|
+
let promise = cache.get(key);
|
|
42
|
+
if (promise === undefined) {
|
|
43
|
+
promise = sleep(300 + Math.random() * 500).then(() =>
|
|
44
|
+
COUNTRIES.filter((c) => c.name.toLowerCase().includes(key)),
|
|
45
|
+
);
|
|
46
|
+
cache.set(key, promise);
|
|
47
|
+
}
|
|
48
|
+
return promise;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function CountryOptions({ query }: { query: string }) {
|
|
52
|
+
const countries = use(searchCountries(query));
|
|
53
|
+
return countries.map((c) => (
|
|
54
|
+
<Combobox.Option key={c.code} value={c.code} label={c.name}>
|
|
55
|
+
{({ pending }) => (
|
|
56
|
+
<>
|
|
57
|
+
{c.name}
|
|
58
|
+
{pending && <span className="demo-spinner" aria-hidden />}
|
|
59
|
+
</>
|
|
60
|
+
)}
|
|
61
|
+
</Combobox.Option>
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function ComboboxCountry() {
|
|
66
|
+
const [country, setCountry] = useState<string | null>(null);
|
|
67
|
+
const [fail, setFail] = useState(false);
|
|
68
|
+
return (
|
|
69
|
+
<div className="demo-stack">
|
|
70
|
+
<DemoErrorBoundary>
|
|
71
|
+
<Combobox.Root
|
|
72
|
+
valueChangeAction={async (next) => {
|
|
73
|
+
await fakeSave(`country ${next}`, { fail });
|
|
74
|
+
startTransition(() => setCountry(next));
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
77
|
+
<Combobox.Label>Country</Combobox.Label>
|
|
78
|
+
<div className="demo-combobox-field">
|
|
79
|
+
<Combobox.Input className="demo-combobox-input" placeholder="Type to search" />
|
|
80
|
+
<Combobox.Clear className="demo-combobox-icon demo-combobox-clear" aria-label="Clear">
|
|
81
|
+
×
|
|
82
|
+
</Combobox.Clear>
|
|
83
|
+
<Combobox.Trigger className="demo-combobox-icon" aria-label="Show countries">
|
|
84
|
+
▾
|
|
85
|
+
</Combobox.Trigger>
|
|
86
|
+
<Combobox.Popup
|
|
87
|
+
className="demo-combobox-popup"
|
|
88
|
+
transition={{
|
|
89
|
+
"fsui-combobox-open": "demo-combobox-pop",
|
|
90
|
+
"fsui-combobox-close": "demo-combobox-pop",
|
|
91
|
+
default: "none",
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
<Combobox.List>
|
|
95
|
+
{({ query }) => (
|
|
96
|
+
<Suspense
|
|
97
|
+
fallback={
|
|
98
|
+
<Combobox.Status className="demo-combobox-status">Searching…</Combobox.Status>
|
|
99
|
+
}
|
|
100
|
+
>
|
|
101
|
+
<CountryOptions query={query} />
|
|
102
|
+
</Suspense>
|
|
103
|
+
)}
|
|
104
|
+
</Combobox.List>
|
|
105
|
+
<Combobox.Empty className="demo-combobox-status">No country matches.</Combobox.Empty>
|
|
106
|
+
</Combobox.Popup>
|
|
107
|
+
</div>
|
|
108
|
+
</Combobox.Root>
|
|
109
|
+
</DemoErrorBoundary>
|
|
110
|
+
<label>
|
|
111
|
+
<input type="checkbox" checked={fail} onChange={(e) => setFail(e.target.checked)} /> Make
|
|
112
|
+
the save fail
|
|
113
|
+
</label>
|
|
114
|
+
<output className="demo-readout">
|
|
115
|
+
saved: <code>{JSON.stringify(country)}</code>
|
|
116
|
+
</output>
|
|
117
|
+
</div>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```css title="combobox.css"
|
|
123
|
+
/* Combobox: the Input is a text field with role="combobox"; the Popup is a <div popover="auto">
|
|
124
|
+
placed below it by the library's inline anchor positioning; the List inside is the listbox.
|
|
125
|
+
The active option (virtual focus) carries `data-active`, the selected one `data-selected`, the
|
|
126
|
+
one being saved `data-pending`; stale results carry `data-stale` on the Popup and the List. */
|
|
127
|
+
|
|
128
|
+
.demo-combobox-field {
|
|
129
|
+
display: inline-flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
gap: 2px;
|
|
132
|
+
padding-inline-end: 2px;
|
|
133
|
+
border: 1px solid var(--color-border);
|
|
134
|
+
border-radius: 6px;
|
|
135
|
+
background: var(--color-bg);
|
|
136
|
+
}
|
|
137
|
+
.demo-combobox-field:focus-within {
|
|
138
|
+
outline: 2px solid var(--color-primary);
|
|
139
|
+
outline-offset: 1px;
|
|
140
|
+
}
|
|
141
|
+
.demo-combobox-input {
|
|
142
|
+
min-inline-size: 14rem;
|
|
143
|
+
padding: 0.4em 0.6em;
|
|
144
|
+
border: 0;
|
|
145
|
+
outline: none;
|
|
146
|
+
background: transparent;
|
|
147
|
+
color: var(--color-text);
|
|
148
|
+
font: inherit;
|
|
149
|
+
}
|
|
150
|
+
.demo-combobox-input[data-pending] {
|
|
151
|
+
cursor: progress;
|
|
152
|
+
}
|
|
153
|
+
.demo-combobox-icon {
|
|
154
|
+
padding: 0.2em 0.45em;
|
|
155
|
+
border: 0;
|
|
156
|
+
background: none;
|
|
157
|
+
color: var(--color-text-secondary);
|
|
158
|
+
font: inherit;
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
}
|
|
161
|
+
/* Nothing to clear: hide Clear (the input shows its placeholder when empty). */
|
|
162
|
+
.demo-combobox-field:has(.demo-combobox-input:placeholder-shown) .demo-combobox-clear {
|
|
163
|
+
visibility: hidden;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.demo-combobox-popup {
|
|
167
|
+
/* The popover UA stylesheet sets `inset: 0; margin: auto`: reset both for anchored placement. */
|
|
168
|
+
margin: 0;
|
|
169
|
+
margin-block-start: 4px;
|
|
170
|
+
inset: auto;
|
|
171
|
+
max-block-size: 16rem;
|
|
172
|
+
overflow: auto;
|
|
173
|
+
padding: 4px;
|
|
174
|
+
border: 1px solid var(--color-border);
|
|
175
|
+
border-radius: 8px;
|
|
176
|
+
background: var(--color-bg);
|
|
177
|
+
color: var(--color-text);
|
|
178
|
+
box-shadow: 0 12px 40px rgb(0 0 0 / 0.25);
|
|
179
|
+
/* CSS enter / exit, used by dismissals (Escape, a click outside). */
|
|
180
|
+
opacity: 0;
|
|
181
|
+
transition:
|
|
182
|
+
opacity 120ms,
|
|
183
|
+
display 120ms allow-discrete,
|
|
184
|
+
overlay 120ms allow-discrete;
|
|
185
|
+
}
|
|
186
|
+
.demo-combobox-popup:popover-open {
|
|
187
|
+
opacity: 1;
|
|
188
|
+
}
|
|
189
|
+
@starting-style {
|
|
190
|
+
.demo-combobox-popup:popover-open {
|
|
191
|
+
opacity: 0;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* Old results while the next ones load. */
|
|
196
|
+
.demo-combobox-popup [role="listbox"][data-stale] {
|
|
197
|
+
opacity: 0.55;
|
|
198
|
+
transition: opacity 150ms 100ms;
|
|
199
|
+
}
|
|
200
|
+
.demo-combobox-popup [role="option"] {
|
|
201
|
+
display: flex;
|
|
202
|
+
align-items: center;
|
|
203
|
+
justify-content: space-between;
|
|
204
|
+
gap: 1rem;
|
|
205
|
+
padding: 6px 10px;
|
|
206
|
+
border-radius: 4px;
|
|
207
|
+
cursor: default;
|
|
208
|
+
}
|
|
209
|
+
/* Virtual focus; hovering makes an option active too, so this is the hover style as well. */
|
|
210
|
+
.demo-combobox-popup [role="option"][data-active] {
|
|
211
|
+
background: var(--color-bg-secondary);
|
|
212
|
+
}
|
|
213
|
+
.demo-combobox-popup [role="option"][data-selected]::after {
|
|
214
|
+
content: "✓";
|
|
215
|
+
color: var(--color-primary);
|
|
216
|
+
}
|
|
217
|
+
.demo-combobox-popup [role="option"][data-pending] {
|
|
218
|
+
cursor: progress;
|
|
219
|
+
}
|
|
220
|
+
.demo-combobox-status {
|
|
221
|
+
padding: 6px 10px;
|
|
222
|
+
color: var(--color-text-secondary);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* The library's view transition types: animate the library-driven open and close, nothing else
|
|
226
|
+
(a results change would cross-fade otherwise). */
|
|
227
|
+
::view-transition-old(.demo-combobox-pop) {
|
|
228
|
+
animation: 120ms ease-in both demo-combobox-out;
|
|
229
|
+
}
|
|
230
|
+
::view-transition-new(.demo-combobox-pop) {
|
|
231
|
+
animation: 120ms ease-out both demo-combobox-in;
|
|
232
|
+
}
|
|
233
|
+
@keyframes demo-combobox-out {
|
|
234
|
+
to {
|
|
235
|
+
opacity: 0;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
@keyframes demo-combobox-in {
|
|
239
|
+
from {
|
|
240
|
+
opacity: 0;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
@media (prefers-reduced-motion: reduce) {
|
|
245
|
+
.demo-combobox-popup {
|
|
246
|
+
transition: none;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/* Combobox `multiple`: the field box holds the chips and the input; Chips is the list of selected
|
|
251
|
+
values, each Chip a focusable list item (the inline-start arrow at the input's start moves into
|
|
252
|
+
them). A chip whose addition is still being saved carries `data-pending`. The box is named as
|
|
253
|
+
an anchor so the listbox can be as wide as it (the Popup's `style` in the example). */
|
|
254
|
+
.demo-combobox-tags {
|
|
255
|
+
display: flex;
|
|
256
|
+
flex-wrap: wrap;
|
|
257
|
+
max-inline-size: 30rem;
|
|
258
|
+
padding: 2px 4px;
|
|
259
|
+
anchor-name: --demo-tags;
|
|
260
|
+
}
|
|
261
|
+
.demo-combobox-tags .demo-combobox-input {
|
|
262
|
+
flex: 1;
|
|
263
|
+
min-inline-size: 8rem;
|
|
264
|
+
}
|
|
265
|
+
.demo-combobox-chips {
|
|
266
|
+
display: flex;
|
|
267
|
+
flex-wrap: wrap;
|
|
268
|
+
}
|
|
269
|
+
.demo-combobox-chip {
|
|
270
|
+
display: inline-flex;
|
|
271
|
+
align-items: center;
|
|
272
|
+
gap: 2px;
|
|
273
|
+
margin: 2px;
|
|
274
|
+
padding: 0.1em 0.2em 0.1em 0.55em;
|
|
275
|
+
border-radius: 999px;
|
|
276
|
+
background: var(--color-bg-secondary);
|
|
277
|
+
font-size: 0.9em;
|
|
278
|
+
}
|
|
279
|
+
.demo-combobox-chip:focus-visible {
|
|
280
|
+
outline: 2px solid var(--color-primary);
|
|
281
|
+
outline-offset: 1px;
|
|
282
|
+
}
|
|
283
|
+
.demo-combobox-chip[data-pending] {
|
|
284
|
+
opacity: 0.6;
|
|
285
|
+
cursor: progress;
|
|
286
|
+
}
|
|
287
|
+
.demo-combobox-chip-remove {
|
|
288
|
+
padding: 0 0.35em;
|
|
289
|
+
border: 0;
|
|
290
|
+
border-radius: 999px;
|
|
291
|
+
background: none;
|
|
292
|
+
color: var(--color-text-secondary);
|
|
293
|
+
font: inherit;
|
|
294
|
+
cursor: pointer;
|
|
295
|
+
}
|
|
296
|
+
.demo-combobox-chip-remove:hover {
|
|
297
|
+
color: var(--color-text);
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
## Anatomy
|
|
302
|
+
|
|
303
|
+
```tsx
|
|
304
|
+
import { Combobox } from "@funstack/ui/combobox";
|
|
305
|
+
|
|
306
|
+
<Combobox.Root name="country" valueChangeAction={saveCountry}> {/* no DOM; a hidden input with name */}
|
|
307
|
+
<Combobox.Label>Country</Combobox.Label> {/* label[for] */}
|
|
308
|
+
<Combobox.Input placeholder="Type to search" required /> {/* input[role=combobox] */}
|
|
309
|
+
<Combobox.Clear aria-label="Clear" /> {/* button, optional */}
|
|
310
|
+
<Combobox.Trigger aria-label="Show all countries" /> {/* button, optional */}
|
|
311
|
+
<Combobox.Popup className="listbox"> {/* div[popover=auto] */}
|
|
312
|
+
<Combobox.List> {/* div[role=listbox] */}
|
|
313
|
+
{({ query }) => (
|
|
314
|
+
<Suspense fallback={<Combobox.Status>Searching…</Combobox.Status>}>
|
|
315
|
+
<CountryOptions query={query} /> {/* Combobox.Option… */}
|
|
316
|
+
</Suspense>
|
|
317
|
+
)}
|
|
318
|
+
</Combobox.List>
|
|
319
|
+
<Combobox.Empty>No country matches.</Combobox.Empty> {/* only when settled and empty */}
|
|
320
|
+
</Combobox.Popup>
|
|
321
|
+
</Combobox.Root>
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
- **Two states.** `value` (`string | null`) is what is chosen; `inputValue` is what is typed. The library writes the text itself only at defined moments: typing, an accepted option (its `label`, else its text), a revert, Clear, a form reset, and text typed before hydration. It never derives the text from `value`, so a preselected value needs its text too: `<Combobox.Root defaultValue={user.country} defaultInputValue={user.countryName}>` (development warns otherwise).
|
|
325
|
+
- **Popup and List are separate** because a listbox may contain only options and groups: `Empty` and a hint `Status` go in the Popup, outside the List. A `Status` inside the List (the Suspense fallback above) marks the results as loading: it renders with `role="none"` (no live region inside the listbox), the List gets `aria-busy="true"`, `Empty` stays hidden and nothing is announced until the results arrive.
|
|
326
|
+
- **No portal, no positioner.** The Popup is shown with `showPopover({ source: input })`: the input is its implicit anchor, and a press on the input keeps the listbox open (the Input captures the pointer to the Popup; in Firefox a drag-to-select in the field does not extend while the listbox is open). Known hole: in Chromium, a touch tap on the field inside a same-origin iframe (a Storybook or sandbox preview) still closes it (#124, upstream). Render the Popup next to the Input.
|
|
327
|
+
- The listbox is always anchored to the input and opened by the library. The server HTML gives the Trigger no `popovertarget`; after hydration a `<button>` Trigger becomes the listbox's [invoker](../concepts/browser-owned-state.md#popup-triggers) (with every click cancelled), so pressing it while the listbox is open is not a light dismiss, and the browser exposes the listbox's state on it. The Input renders `aria-expanded` itself. Before hydration the input is a plain text field; text typed then is kept and adopted at mount, and nothing opens until the next keystroke.
|
|
328
|
+
|
|
329
|
+
## How it works
|
|
330
|
+
|
|
331
|
+
### Typing is urgent; everything it causes is not
|
|
332
|
+
|
|
333
|
+
React requires a controlled text input to update urgently, in the same event as the keystroke: by the time the library hears of it, the text is already in the DOM. So the text is **urgent state**, a [fact](../concepts/action-props.md#fact) rather than a request. It keeps the usual pair, `inputValue` / `defaultInputValue`, but its callback is a handler, not an action: `onInputValueChange` (an [`on*` handler](../concepts/action-props.md#on-handler)) is called synchronously, outside any transition, and never awaited. A controlled parent simply sets its state in the body:
|
|
334
|
+
|
|
335
|
+
```tsx
|
|
336
|
+
const [text, setText] = useState("");
|
|
337
|
+
<Combobox.Root inputValue={text} onInputValueChange={(next) => setText(next)}>
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Everything downstream of the text is a transition again:
|
|
341
|
+
|
|
342
|
+
- **The results** render from `query`, which is `useDeferredValue(inputValue)`. A slow search never blocks a keystroke; the previous results stay on screen (no fallback flash) with `data-stale` and `aria-busy="true"` until the new ones are ready; and only the latest query is ever rendered, so a slow response for "ja" cannot overwrite the results for "jap".
|
|
343
|
+
- **Opening** is a transition (`openChangeAction`). A dismissal (Escape, a click outside, focus leaving) is a fact, reported to `onOpenChange`.
|
|
344
|
+
- **Choosing** an option is a transition (`valueChangeAction`) with an optimistic selection, exactly as every other value in the library.
|
|
345
|
+
|
|
346
|
+
> **Do not fetch in onInputValueChange**
|
|
347
|
+
>
|
|
348
|
+
> `onInputValueChange={async (q) => setResults(await search(q))}` brings back every problem the deferred query solves: responses land in completion order, nothing marks the results stale, and the urgent handler is not awaited anyway. Read a query-keyed cache with `use()` inside the List instead. (Returning a promise is allowed, for work the UI does not wait for such as logging: like every `on*` handler, its rejection goes to `reportError`.)
|
|
349
|
+
|
|
350
|
+
While any async action is pending in the app (this combobox's own slow save included), React holds every transition. Typing is unaffected (urgent), and so are the results: a deferred render is not held by a pending action (verified in Chromium and Firefox). Opening the listbox while a save is pending is a transition, so it waits for the save: the input shows `data-open` and `data-pending` meanwhile, and its `aria-expanded` turns `"true"` when the listbox is shown.
|
|
351
|
+
|
|
352
|
+
### Accepting an option
|
|
353
|
+
|
|
354
|
+
Enter on the active option, or a click: the input text becomes the option's label at once, the option gets `data-selected` and `data-pending`, and `valueChangeAction` runs in the Root's transition while the listbox stays open. When it settles the listbox closes in the same commit. A rejection rolls the text and the selection back, leaves the listbox open and reaches the nearest Error Boundary. Re-choosing the selected option dispatches nothing and closes. If you type a new search while the save runs, the listbox stays open when it settles.
|
|
355
|
+
|
|
356
|
+
A controlled "update on success" parent (`startTransition(() => setValue(next))` after its `await`) works as everywhere. A parent that refuses a value gets the text and the selection reverted; the listbox closes anyway, because the close is part of the action's commit.
|
|
357
|
+
|
|
358
|
+
### Free text
|
|
359
|
+
|
|
360
|
+
```tsx title="ComboboxDrink.tsx"
|
|
361
|
+
"use client";
|
|
362
|
+
import { useState } from "react";
|
|
363
|
+
import { Combobox } from "@funstack/ui/combobox";
|
|
364
|
+
|
|
365
|
+
const SUGGESTIONS = ["Coffee", "Tea", "Matcha", "Hot chocolate", "Lemonade"];
|
|
366
|
+
|
|
367
|
+
// Free text: `allowCustomValue` makes the typed text the value (Enter with no active
|
|
368
|
+
// suggestion, or leaving the field). The text is controlled with a plain setState in the urgent
|
|
369
|
+
// `onInputValueChange`. `name` puts the value in a hidden input for the form.
|
|
370
|
+
export function ComboboxDrink() {
|
|
371
|
+
const [text, setText] = useState("");
|
|
372
|
+
const [submitted, setSubmitted] = useState<string | null>(null);
|
|
373
|
+
return (
|
|
374
|
+
<form
|
|
375
|
+
className="demo-stack"
|
|
376
|
+
onSubmit={(event) => {
|
|
377
|
+
event.preventDefault();
|
|
378
|
+
setSubmitted(String(new FormData(event.currentTarget).get("drink")));
|
|
379
|
+
}}
|
|
380
|
+
>
|
|
381
|
+
<Combobox.Root
|
|
382
|
+
name="drink"
|
|
383
|
+
allowCustomValue
|
|
384
|
+
inputValue={text}
|
|
385
|
+
onInputValueChange={(next) => setText(next)}
|
|
386
|
+
>
|
|
387
|
+
<Combobox.Label>Favourite drink</Combobox.Label>
|
|
388
|
+
<div className="demo-combobox-field">
|
|
389
|
+
<Combobox.Input className="demo-combobox-input" placeholder="Anything" required />
|
|
390
|
+
<Combobox.Popup className="demo-combobox-popup">
|
|
391
|
+
<Combobox.List>
|
|
392
|
+
{({ query }) =>
|
|
393
|
+
SUGGESTIONS.filter((s) => s.toLowerCase().includes(query.toLowerCase())).map(
|
|
394
|
+
(s) => (
|
|
395
|
+
<Combobox.Option key={s} value={s}>
|
|
396
|
+
{s}
|
|
397
|
+
</Combobox.Option>
|
|
398
|
+
),
|
|
399
|
+
)
|
|
400
|
+
}
|
|
401
|
+
</Combobox.List>
|
|
402
|
+
<Combobox.Empty className="demo-combobox-status">
|
|
403
|
+
Press Enter to use your own.
|
|
404
|
+
</Combobox.Empty>
|
|
405
|
+
</Combobox.Popup>
|
|
406
|
+
</div>
|
|
407
|
+
</Combobox.Root>
|
|
408
|
+
<div className="demo-row">
|
|
409
|
+
<button type="submit" className="demo-button demo-primary">
|
|
410
|
+
Submit
|
|
411
|
+
</button>
|
|
412
|
+
<output className="demo-readout">
|
|
413
|
+
text: <code>{JSON.stringify(text)}</code>, submitted:{" "}
|
|
414
|
+
<code>{JSON.stringify(submitted)}</code>
|
|
415
|
+
</output>
|
|
416
|
+
</div>
|
|
417
|
+
</form>
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
`combobox.css`: the same file as above.
|
|
423
|
+
|
|
424
|
+
With `allowCustomValue` the typed text is a value: Enter with no active option, or focus leaving, dispatches it with `details.custom: true` (an emptied text dispatches `null`). Enter on a closed listbox is not prevented, so a form still submits, and the hidden input already holds the new text. Without `allowCustomValue`, text that is not the selection's label reverts when focus leaves (`reason: "dismiss"`), so the field never shows a value it does not have.
|
|
425
|
+
|
|
426
|
+
### <a id="multiple"></a>Multiple selection
|
|
427
|
+
|
|
428
|
+
```tsx title="ComboboxTags.tsx"
|
|
429
|
+
"use client";
|
|
430
|
+
import { startTransition, useState } from "react";
|
|
431
|
+
import { Combobox } from "@funstack/ui/combobox";
|
|
432
|
+
import { DemoErrorBoundary } from "./DemoErrorBoundary.js";
|
|
433
|
+
import { fakeSave } from "./fake-api.js";
|
|
434
|
+
|
|
435
|
+
const LANGUAGES = [
|
|
436
|
+
"C",
|
|
437
|
+
"C++",
|
|
438
|
+
"Elixir",
|
|
439
|
+
"Go",
|
|
440
|
+
"Haskell",
|
|
441
|
+
"Java",
|
|
442
|
+
"JavaScript",
|
|
443
|
+
"Kotlin",
|
|
444
|
+
"OCaml",
|
|
445
|
+
"Python",
|
|
446
|
+
"Ruby",
|
|
447
|
+
"Rust",
|
|
448
|
+
"Swift",
|
|
449
|
+
"TypeScript",
|
|
450
|
+
];
|
|
451
|
+
|
|
452
|
+
export function ComboboxTags() {
|
|
453
|
+
const [saved, setSaved] = useState<string[]>(["TypeScript"]);
|
|
454
|
+
const [fail, setFail] = useState(false);
|
|
455
|
+
return (
|
|
456
|
+
<div className="demo-stack">
|
|
457
|
+
<DemoErrorBoundary>
|
|
458
|
+
<Combobox.Root
|
|
459
|
+
multiple
|
|
460
|
+
name="languages"
|
|
461
|
+
defaultValue={["TypeScript"]}
|
|
462
|
+
allowCustomValue
|
|
463
|
+
valueChangeAction={async (_next, { added, removed }) => {
|
|
464
|
+
// Persist the diff, not `next`: an earlier change may still fail.
|
|
465
|
+
await fakeSave(`+${added.join(",")} -${removed.join(",")}`, { fail });
|
|
466
|
+
startTransition(() =>
|
|
467
|
+
setSaved((prev) => [
|
|
468
|
+
...prev.filter((v) => !removed.includes(v)),
|
|
469
|
+
...added.filter((v) => !prev.includes(v)),
|
|
470
|
+
]),
|
|
471
|
+
);
|
|
472
|
+
}}
|
|
473
|
+
>
|
|
474
|
+
<Combobox.Label>Languages</Combobox.Label>
|
|
475
|
+
<div className="demo-combobox-field demo-combobox-tags">
|
|
476
|
+
<Combobox.Chips className="demo-combobox-chips">
|
|
477
|
+
{({ value }) =>
|
|
478
|
+
value.map((language) => (
|
|
479
|
+
<Combobox.Chip key={language} value={language} className="demo-combobox-chip">
|
|
480
|
+
{({ label }) => (
|
|
481
|
+
<>
|
|
482
|
+
{label ?? language}
|
|
483
|
+
<Combobox.ChipRemove
|
|
484
|
+
className="demo-combobox-chip-remove"
|
|
485
|
+
aria-label={`Remove ${label ?? language}`}
|
|
486
|
+
>
|
|
487
|
+
<span aria-hidden>×</span>
|
|
488
|
+
</Combobox.ChipRemove>
|
|
489
|
+
</>
|
|
490
|
+
)}
|
|
491
|
+
</Combobox.Chip>
|
|
492
|
+
))
|
|
493
|
+
}
|
|
494
|
+
</Combobox.Chips>
|
|
495
|
+
<Combobox.Input className="demo-combobox-input" placeholder="Add a language" />
|
|
496
|
+
{/* As wide as the field box: the box is the anchor (the Root anchors to the Input). */}
|
|
497
|
+
<Combobox.Popup
|
|
498
|
+
className="demo-combobox-popup"
|
|
499
|
+
style={{ positionAnchor: "--demo-tags", minWidth: "anchor-size(--demo-tags width)" }}
|
|
500
|
+
>
|
|
501
|
+
<Combobox.List>
|
|
502
|
+
{({ query }) =>
|
|
503
|
+
LANGUAGES.filter((l) => l.toLowerCase().includes(query.toLowerCase())).map(
|
|
504
|
+
(l) => (
|
|
505
|
+
<Combobox.Option key={l} value={l}>
|
|
506
|
+
{({ pending }) => (
|
|
507
|
+
<>
|
|
508
|
+
{l}
|
|
509
|
+
{pending && <span className="demo-spinner" aria-hidden />}
|
|
510
|
+
</>
|
|
511
|
+
)}
|
|
512
|
+
</Combobox.Option>
|
|
513
|
+
),
|
|
514
|
+
)
|
|
515
|
+
}
|
|
516
|
+
</Combobox.List>
|
|
517
|
+
<Combobox.Empty className="demo-combobox-status">
|
|
518
|
+
Press Enter to add it.
|
|
519
|
+
</Combobox.Empty>
|
|
520
|
+
</Combobox.Popup>
|
|
521
|
+
</div>
|
|
522
|
+
</Combobox.Root>
|
|
523
|
+
</DemoErrorBoundary>
|
|
524
|
+
<label>
|
|
525
|
+
<input type="checkbox" checked={fail} onChange={(e) => setFail(e.target.checked)} /> Make
|
|
526
|
+
the save fail
|
|
527
|
+
</label>
|
|
528
|
+
<output className="demo-readout">
|
|
529
|
+
saved: <code>{JSON.stringify(saved)}</code>
|
|
530
|
+
</output>
|
|
531
|
+
</div>
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
`combobox.css`: the same file as above.
|
|
537
|
+
|
|
538
|
+
`multiple` on the Root turns the selection into a list of values (`string[]`, in pick order) shown as chips. The text is then only a search:
|
|
539
|
+
|
|
540
|
+
- **A pick toggles** the option (a selected option is removed), clears the text and leaves the listbox open for the next pick. The listbox is `aria-multiselectable` and every option keeps its `aria-selected`. A rejection rolls back that one change (the chip and `data-selected`), never the text.
|
|
541
|
+
- **The value follows the set rules** of CheckboxGroup: each dispatch is one change, with `details.added` and `details.removed`; picks made while an earlier save runs stack, and only the changes whose action resolved are kept. Persist the diff, not `next`, which may contain a change that fails later.
|
|
542
|
+
- **`Combobox.Chips`** is a list of the optimistic values (a removed chip disappears at once and comes back if its save fails); you map them to `Combobox.Chip`s. A chip's `label` state is the text of the option the library last saw for its value, so an async search needs no map of its own. It is the list of chips only, not the field box: put the Input next to it in your own element.
|
|
543
|
+
- **Keys:** Backspace in the empty input removes the last chip; the inline-start arrow (Left, Right in RTL) at the caret's start moves focus into the chips, where the arrows, Home and End move, Backspace or Delete remove, Escape goes back and a letter types into the input. The combobox keeps one Tab stop. Chips removed outside the listbox are announced (`"Japan removed"`, `announceRemoved` to localise).
|
|
544
|
+
- **Forms:** one hidden input per value (`formData.getAll(name)`), nothing for an empty selection. `required` on the Input means "at least one": native `required` is rendered only while nothing is selected, and `aria-required` always. Unmatched text is cleared when focus leaves and by Enter in a closed listbox, so it never satisfies `required`. With `allowCustomValue`, Enter (prevented, the form does not submit) and focus leaving add the text as a value instead.
|
|
545
|
+
|
|
546
|
+
```tsx
|
|
547
|
+
<Combobox.Root multiple name="countries" defaultValue={["jp"]} valueChangeAction={saveCountries}>
|
|
548
|
+
<Combobox.Label>Countries</Combobox.Label>
|
|
549
|
+
<div className="field"> {/* your box around chips and input */}
|
|
550
|
+
<Combobox.Chips> {/* div[role=list] */}
|
|
551
|
+
{({ value }) => value.map((code) => (
|
|
552
|
+
<Combobox.Chip key={code} value={code}> {/* div[role=listitem][tabindex=-1] */}
|
|
553
|
+
{({ label }) => (
|
|
554
|
+
<>
|
|
555
|
+
{label ?? code}
|
|
556
|
+
<Combobox.ChipRemove aria-label={`Remove ${label ?? code}`} /> {/* button */}
|
|
557
|
+
</>
|
|
558
|
+
)}
|
|
559
|
+
</Combobox.Chip>
|
|
560
|
+
))}
|
|
561
|
+
</Combobox.Chips>
|
|
562
|
+
<Combobox.Input placeholder="Add a country" required />
|
|
563
|
+
</div>
|
|
564
|
+
<Combobox.Popup>…</Combobox.Popup>
|
|
565
|
+
</Combobox.Root>
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
## Props
|
|
569
|
+
|
|
570
|
+
### `Combobox.Root`
|
|
571
|
+
|
|
572
|
+
| Prop | Type | Default | Description |
|
|
573
|
+
| - | - | - | - |
|
|
574
|
+
| `multiple` | `boolean` | `false` | `true`: the selection is a list of values shown as chips ([Multiple selection](#multiple)); `value`, `defaultValue`, `valueChangeAction`, `announce` and `children` take the multiple types below. Fixed at mount (development warns on a change). |
|
|
575
|
+
| `value` | `string \| null; string[] with multiple` | – | Controlled selection. `null`: nothing selected. `undefined` means uncontrolled. With `multiple`: `string[]`, `[]` for nothing; the order is the chip order, duplicates are ignored. |
|
|
576
|
+
| `defaultValue` | `string \| null; string[] with multiple` | `null` | Initial selection when uncontrolled; what a form reset returns to. With `multiple`: `string[]`, default `[]`. |
|
|
577
|
+
| `valueChangeAction` | `ChangeAction<string \| null, ComboboxValueChangeDetails>; with multiple ChangeAction<string[], ComboboxMultipleValueChangeDetails>` | – | Runs in the Root's transition when the user accepts an option, commits free text, presses Clear, or the form resets. Awaited; the listbox closes in the commit that ends it; a rejection rolls the text and the selection back and leaves the listbox open. May be a Server Function. A `setState` after your own `await` needs `startTransition`. With `multiple`: `ChangeAction<string[], ComboboxMultipleValueChangeDetails>`, called for every change (a pick, a removed chip, Clear, free text, a reset); the listbox does not close; a rejection undoes that change only. |
|
|
578
|
+
| `inputValue` | `string` | – | Controlled text. `undefined` means uncontrolled. |
|
|
579
|
+
| `defaultInputValue` | `string` | `""` | Initial text when uncontrolled, and the visible input's form-reset target. Single selection: pass the selected option's label together with `defaultValue`. With `multiple` the text is only a search (usually left empty). |
|
|
580
|
+
| `onInputValueChange` | `UrgentChangeHandler<string, ComboboxInputValueChangeDetails>` | – | A [handler](../concepts/action-props.md#on-handler), not an action: called synchronously, outside any transition, on every change of the text (typing, and the library's own writes). Not awaited, never pending. Set your state in the body. May return a promise; a rejection or a throw goes to `reportError` ([the rule of every on\* handler](../concepts/action-props.md#handlers)). |
|
|
581
|
+
| `open` | `boolean` | – | Controlled open state. `undefined` means uncontrolled. Pass `onOpenChange` too (development warns). |
|
|
582
|
+
| `defaultOpen` | `boolean` | `false` | Initial open state; opens after hydration. |
|
|
583
|
+
| `openChangeAction` | `ChangeAction<boolean, ComboboxOpenChangeDetails>` | – | Requests only: awaited for opens and for the closes a part asks for (an accepted option, the Trigger, Alt+ArrowUp; with `multiple`, a chip taking focus while an open is still on its way cancels it). Never called for a dismissal (`onOpenChange`). Runs in the Root's transition; may be a Server Function. `details.reason`: `"activate"` (typing, ArrowDown / ArrowUp / Alt+ArrowDown, the Trigger, a click on the input with `openOnClick`, an accepted option, Alt+ArrowUp, the cancel by a focused chip, a foreign `showPopover()`) or `"platform"` (found open on mount, which only script can cause; `event` is `undefined`). |
|
|
584
|
+
| `onOpenChange` | `UrgentChangeHandler<boolean, ComboboxOpenChangeDetails>` | – | Facts only: the listbox was closed without the library closing it on request. Always `false`. `details.reason`: `"dismiss"` (Escape, focus leaving the input, a click outside, a Clear click while open, another popover opening, script) or `"activate"` (a [foreign invoker](../concepts/browser-owned-state.md#foreign-invoker), whose press does not move focus out of the input, so the text is left as typed; a Trigger rendered as another element, pressed while open). Called synchronously in the browser's `toggle` event, outside any transition, and not awaited: nothing is pending and no view transition runs. In controlled mode set state directly here (`onOpenChange={setOpen}`), never in `startTransition` or after an `await`; a parent that keeps `open` gets the listbox shown again at once, with focus left where the dismissal put it. May return a promise (a Server Function); a rejection or a throw goes to `reportError`. |
|
|
585
|
+
| `allowCustomValue` | `boolean` | `false` | Free text is a value (Enter with no active option, focus leaving), dispatched with `details.custom: true`. Otherwise unmatched text reverts when focus leaves. With `multiple`: Enter (prevented, open or closed) and focus leaving add the text as a value (`added: [text]`) and clear it; without it unmatched text is cleared. |
|
|
586
|
+
| `autoHighlight` | `boolean` | `false` | Make the first enabled option active when the results for an open or an edit settle (APG automatic selection): typing then Enter picks the first match. Stale results are never highlighted, so an Enter before they settle commits the typed text (`allowCustomValue`) or does nothing. |
|
|
587
|
+
| `openOnClick` | `boolean` | `false` | Open on a click in the input (never on focus alone). |
|
|
588
|
+
| `loop` | `boolean` | `false` | ArrowDown / ArrowUp wrap from the last option to the first and back. |
|
|
589
|
+
| `announce` | `(count: number, state: ComboboxRootState) => string \| null; ComboboxMultipleRootState with multiple` | `"No results" / "1 result" / "N results"` | The message `ariaNotify()` announces on the List when the results settle. Override for localisation; return `null` to announce nothing. Ignored where `ariaNotify` is missing. |
|
|
590
|
+
| `announceRemoved` | `(labels: readonly string[], state: ComboboxMultipleRootState) => string \| null` | `"Japan removed" (the labels joined with ", ")` | `multiple` only. The message `ariaNotify()` announces on the Input when chips are removed outside the listbox (Backspace, Delete, `ChipRemove`, Clear). A label is the Chip's `label`, else the option text the library saw, else the chip's text. Return `null` to announce nothing. |
|
|
591
|
+
| `name` | `string` | – | Renders `<input type="hidden" name>` holding the optimistic value (`""` for `null`), the Root's only element. With `multiple`: one hidden input per value, in value order; none named while the selection is empty. |
|
|
592
|
+
| `form` | `string` | – | The hidden input's `form` attribute. |
|
|
593
|
+
| `disabled` | `boolean` | `false` | Disables the Input, Trigger and Clear (and every `ChipRemove`); nothing dispatches for user interaction. The hidden input stays enabled, so the selection still posts (wrap in `<fieldset disabled>` to drop it). |
|
|
594
|
+
| `children` | `ReactNode \| ((state: ComboboxRootState) => ReactNode); ComboboxMultipleRootState with multiple` | – | The parts, or a function of the Root's state (`ComboboxMultipleRootState` with `multiple`). |
|
|
595
|
+
|
|
596
|
+
- **State**: `ComboboxRootState` is `{ value, inputValue, query, stale, activeValue, open, pending, disabled }`; `value` and `open` are optimistic; `stale` is `inputValue !== query`; `pending` covers the value and the open transitions. `ComboboxMultipleRootState` is the same with `value: readonly string[]` (pick order).
|
|
597
|
+
- **Owned**: nothing rendered: the Root has no element (no `ref`, `className` or `style`), only the hidden input(s) when `name` is given.
|
|
598
|
+
|
|
599
|
+
The props type is `ComboboxRootProps = ComboboxSingleProps | ComboboxMultipleProps`, discriminated on `multiple`. `Partial<ComboboxRootProps>` is not assignable to either member, so a wrapper that spreads one into `Combobox.Root` types it as `Partial<ComboboxSingleProps>` (or the multiple one) instead.
|
|
600
|
+
|
|
601
|
+
`ComboboxValueChangeDetails`: `{ reason, custom, event }`. `reason` is `"activate"` (an accepted option: the `keydown` or `click`; free text: the `keydown` or `focusout`; Clear: the `click`) or `"platform"` (a form reset: the `reset` event). `ComboboxInputValueChangeDetails`: `{ reason, event }`, with `"activate"` for typing (the `input` event), an accepted label and Clear, `"dismiss"` for a revert, `"platform"` for a reset or text found at mount (no event). `ComboboxOpenChangeDetails`: `{ reason, event }`; the reasons are listed with `openChangeAction` and `onOpenChange` above.
|
|
602
|
+
|
|
603
|
+
`ComboboxMultipleValueChangeDetails` (with `multiple`): `{ reason, added, removed, custom, event }`. `added` lists the values this dispatch added, in the order they join; `removed` the values it removed, in value order; `custom` is `true` for free text. `reason` is `"activate"` (a toggled option: the `keydown` or `click`; a removed chip: the `keydown` of Backspace or Delete, the `click` of `ChipRemove`; Clear; free text: the `keydown` or `focusout`) or `"platform"` (a form reset, dispatched whole with the diff). With `multiple` the library writes the text on typing, a pick (`""`, `"activate"`), Clear, focus leaving (`""`, `"dismiss"`), a reset and at mount.
|
|
604
|
+
|
|
605
|
+
### `Combobox.Label`
|
|
606
|
+
|
|
607
|
+
| Prop | Type | Default | Description |
|
|
608
|
+
| - | - | - | - |
|
|
609
|
+
| `className` | `string \| ((state: ComboboxLabelState) => string \| undefined)` | – | A class name, or a function of the part's state. |
|
|
610
|
+
| `style` | `CSSProperties \| ((state: ComboboxLabelState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
|
|
611
|
+
| `children` | `ReactNode \| ((state: ComboboxLabelState) => ReactNode)` | – | Content, or a function of the part's state. |
|
|
612
|
+
| `render` | `ReactElement \| ((props, state: ComboboxLabelState) => ReactNode)` | – | Replace the default \<label> (element form) or take over rendering (function form). |
|
|
613
|
+
|
|
614
|
+
- **State**: `ComboboxLabelState` is `{ disabled }`.
|
|
615
|
+
- **Owned**: `id`, `htmlFor`.
|
|
616
|
+
|
|
617
|
+
A `<label for>` of the Input; its id also names the List (`aria-labelledby`), only while a Label is mounted. Inside a `Field.Root`, `Field.Label` takes that role instead.
|
|
618
|
+
|
|
619
|
+
### `Combobox.Input`
|
|
620
|
+
|
|
621
|
+
One per Root: the Input is the listbox's anchor, so a second `Combobox.Input` in the same Root is not supported (development warns). Use a Root per input.
|
|
622
|
+
|
|
623
|
+
| Prop | Type | Default | Description |
|
|
624
|
+
| - | - | - | - |
|
|
625
|
+
| `required` | `boolean` | – | Native: an empty text is `valueMissing`, with the browser's message. With `multiple` it means at least one value: native `required` only while nothing is selected (optimistic), `aria-required` always. |
|
|
626
|
+
| `className` | `string \| ((state: ComboboxInputState) => string \| undefined)` | – | A class name, or a function of the part's state. |
|
|
627
|
+
| `style` | `CSSProperties \| ((state: ComboboxInputState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
|
|
628
|
+
| `render` | `ReactElement \| ((props, state: ComboboxInputState) => ReactNode)` | – | Replace the default \<input> (element form) or take over rendering (function form). |
|
|
629
|
+
|
|
630
|
+
- **State**: `ComboboxInputState` is `{ value, values, inputValue, open, pending, stale, disabled }`. `values` is the optimistic selection as a list (`[value]` or `[]` in single mode); with `multiple`, `value` is always `null`.
|
|
631
|
+
- **Owned**: `id`, `type` (`"text"`, or `"search"` when a `render` element says so), `role`, `value`, `autoComplete` (`"off"`), `aria-autocomplete`, `aria-expanded`, `aria-controls`, `aria-activedescendant`, `disabled`, `onChange`, `onKeyDown`, `onFocus`, `onBlur`, `onClick`, `onPointerDown`, `data-open`, `data-pending`, `data-selected`, `data-stale`, `data-disabled`. Inside a `Field.Root` also `required`, `aria-invalid`, `aria-describedby` (token-merged) and `data-invalid`. With `multiple` also `required` and `aria-required`.
|
|
632
|
+
|
|
633
|
+
`placeholder`, `name` (a second field with the raw text), `aria-describedby`, `onFocusCapture` (to react to focus) and other input props pass through. During a primary mouse or pen press while the listbox is open, the Input's `onPointerUp`, `onMouseUp` and `onDoubleClick` go to the Popup instead (the press is captured to it), and the Input gets pointer and mouse leave (then enter) events. A `render` element must stay an `<input>` of type text or search.
|
|
634
|
+
|
|
635
|
+
### `Combobox.Trigger`, `Combobox.Clear`
|
|
636
|
+
|
|
637
|
+
| Prop | Type | Default | Description |
|
|
638
|
+
| - | - | - | - |
|
|
639
|
+
| `disabled` | `boolean` | `false` | Native `disabled`; the Root's `disabled` applies too. With a link or component `render`, `aria-disabled="true"` instead. |
|
|
640
|
+
| `className` | `string \| ((state: ComboboxTriggerState \| ComboboxClearState) => string \| undefined)` | – | A class name, or a function of the part's state. |
|
|
641
|
+
| `style` | `CSSProperties \| ((state: ComboboxTriggerState \| ComboboxClearState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
|
|
642
|
+
| `children` | `ReactNode \| ((state: ComboboxTriggerState \| ComboboxClearState) => ReactNode)` | – | Content, usually an icon; give the button an `aria-label` (development warns without a name). |
|
|
643
|
+
| `render` | `ReactElement \| ((props, state: ComboboxTriggerState \| ComboboxClearState) => ReactNode)` | – | Replace the default \<button> (element form) or take over rendering (function form). |
|
|
644
|
+
|
|
645
|
+
- **State**: `ComboboxTriggerState` is `{ open, pending, disabled }`; `ComboboxClearState` is `{ value, values, inputValue, disabled }` (`values` as on the Input).
|
|
646
|
+
- **Owned**: `type` (on a `<button>`), `tabIndex` (`-1`: the input is the one Tab stop), `disabled`, `aria-disabled` (link or component `render`), `onClick`, `onPointerDown`, `onMouseDown`, `data-disabled`; the Trigger also `aria-expanded` (only when it is no invoker: a non-button `render`, or while `aria-disabled`), `aria-controls`, `popovertarget` (written as an attribute after hydration, only on a `<button>`, while enabled or natively disabled; not while `aria-disabled`), `data-open`, `data-pending`. Owned on the Trigger and never written as props: `popoverTarget`, `popoverTargetAction`, `commandfor`, `command`; these and `aria-expanded` are not in its props type.
|
|
647
|
+
|
|
648
|
+
Both keep focus in the input when pressed and focus it when clicked. The Trigger toggles the listbox; on a `<button>` Trigger a click while it is open keeps it shown until `openChangeAction(false)` settles (a controlled parent that keeps `open` sees no flicker). A Trigger rendered as another element is light-dismissed before its click and warns in development ([Triggers of a popup](../concepts/browser-owned-state.md#popup-triggers)). Clear empties the text and dispatches `null` unless nothing is selected (with `multiple`: one change removing every value, announced); it is always rendered, so hide it with CSS (`:has(input:placeholder-shown)`) or its state. A click on Clear while the listbox is open closes it (light dismiss: the button is outside the popup).
|
|
649
|
+
|
|
650
|
+
### `Combobox.Popup`
|
|
651
|
+
|
|
652
|
+
| Prop | Type | Default | Description |
|
|
653
|
+
| - | - | - | - |
|
|
654
|
+
| `keepMounted` | `boolean` | `false` | `false`: the children render only while open. `true`: they stay mounted in a hidden `<Activity>`; an action inside that rejects while it is hidden goes to `reportError`, not to an Error Boundary. |
|
|
655
|
+
| `transition` | `ViewTransitionClass` | – | The `<ViewTransition default>` around the popover element. Animates library-driven opens and closes in every engine. A deferred results render activates it too, so use a map with `default: "none"` (below). Keep it static. |
|
|
656
|
+
| `className` | `string \| ((state: ComboboxPopupState) => string \| undefined)` | – | A class name, or a function of the part's state. |
|
|
657
|
+
| `style` | `CSSProperties \| ((state: ComboboxPopupState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
|
|
658
|
+
| `children` | `ReactNode \| ((state: ComboboxPopupState) => ReactNode)` | – | Content, or a function of the part's state. |
|
|
659
|
+
| `render` | `ReactElement \| ((props, state: ComboboxPopupState) => ReactNode)` | – | Replace the default \<div> (element form) or take over rendering (function form). |
|
|
660
|
+
|
|
661
|
+
- **State**: `ComboboxPopupState` is `{ open, stale, query }`; `open` is committed.
|
|
662
|
+
- **Owned**: `id`, `popover` (`"auto"`), `onPointerDown` and `onMouseDown` (a press anywhere in it keeps focus in the input), `data-stale`; no role.
|
|
663
|
+
|
|
664
|
+
Inline style `position-area: self-block-end span-self-inline-end; position-try-fallbacks: flip-block; min-width: anchor-size(width)` places it below the input (above when it does not fit), at least as wide; your `style` wins per property. A `render` element must stay a `<div>`.
|
|
665
|
+
|
|
666
|
+
### `Combobox.List`
|
|
667
|
+
|
|
668
|
+
| Prop | Type | Default | Description |
|
|
669
|
+
| - | - | - | - |
|
|
670
|
+
| `className` | `string \| ((state: ComboboxListState) => string \| undefined)` | – | A class name, or a function of the part's state. |
|
|
671
|
+
| `style` | `CSSProperties \| ((state: ComboboxListState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
|
|
672
|
+
| `children` | `ReactNode \| ((state: ComboboxListState) => ReactNode)` | – | Usually a function of `{ query }` returning the Options for it, under your own `<Suspense>` for an async search. |
|
|
673
|
+
| `render` | `ReactElement \| ((props, state: ComboboxListState) => ReactNode)` | – | Replace the default \<div> (element form) or take over rendering (function form). |
|
|
674
|
+
|
|
675
|
+
- **State**: `ComboboxListState` is `{ query, stale, empty }`.
|
|
676
|
+
- **Owned**: `id`, `role` (`"listbox"`), `aria-labelledby` (token-merged with yours; only while a `Combobox.Label` is rendered), `aria-busy`, `data-stale`, `data-empty`; with `multiple`, `aria-multiselectable` (`"true"`).
|
|
677
|
+
|
|
678
|
+
Without a Label give the List an `aria-label` (development warns otherwise). `aria-busy="true"` is set while the results are stale or loading (a `Status` fallback inside it); `data-empty` when settled with no options.
|
|
679
|
+
|
|
680
|
+
### `Combobox.Option`
|
|
681
|
+
|
|
682
|
+
| Prop | Type | Default | Description |
|
|
683
|
+
| - | - | - | - |
|
|
684
|
+
| `value` | `string` | – | Required and unique within the Combobox; the option's id is derived from it, so it keeps its id across result sets. |
|
|
685
|
+
| `label` | `string` | – | The text written into the input when the option is accepted. Default: the option's trimmed text at that moment. Not used for matching. |
|
|
686
|
+
| `disabled` | `boolean` | `false` | `aria-disabled`: shown, skipped by the arrow keys, never accepted. |
|
|
687
|
+
| `className` | `string \| ((state: ComboboxOptionState) => string \| undefined)` | – | A class name, or a function of the part's state. |
|
|
688
|
+
| `style` | `CSSProperties \| ((state: ComboboxOptionState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
|
|
689
|
+
| `children` | `ReactNode \| ((state: ComboboxOptionState) => ReactNode)` | – | Content, or a function of the option's state; must not suspend. |
|
|
690
|
+
| `render` | `ReactElement \| ((props, state: ComboboxOptionState) => ReactNode)` | – | Replace the default \<div> (element form) or take over rendering (function form). |
|
|
691
|
+
|
|
692
|
+
- **State**: `ComboboxOptionState` is `{ value, selected, active, pending, disabled }`; `selected` is optimistic, `active` is virtual focus, `pending` is true on the option being saved (with `multiple`: being added or removed).
|
|
693
|
+
- **Owned**: `id` (derived from `value`), `role`, `aria-selected`, `aria-disabled`, `onClick`, `onPointerDown`, `onMouseDown`, `onPointerMove`, `data-selected`, `data-active`, `data-pending`, `data-disabled`.
|
|
694
|
+
|
|
695
|
+
Never focused, no `tabindex`; hovering makes it active.
|
|
696
|
+
|
|
697
|
+
### `Combobox.Group`, `Combobox.GroupLabel`, `Combobox.Empty`, `Combobox.Status`
|
|
698
|
+
|
|
699
|
+
| Prop | Type | Default | Description |
|
|
700
|
+
| - | - | - | - |
|
|
701
|
+
| `className` | `string \| ((state: {} (Empty: ComboboxListState)) => string \| undefined)` | – | A class name, or a function of the part's state. |
|
|
702
|
+
| `style` | `CSSProperties \| ((state: {} (Empty: ComboboxListState)) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
|
|
703
|
+
| `children` | `ReactNode \| ((state: {} (Empty: ComboboxListState)) => ReactNode)` | – | Content. Empty renders only when the List has no options, the results are not stale and none are loading. |
|
|
704
|
+
| `render` | `ReactElement \| ((props, state) => ReactNode)` | – | Replace the default \<div>. |
|
|
705
|
+
|
|
706
|
+
- **State**: none (Empty: `ComboboxListState`).
|
|
707
|
+
- **Owned**: Group: `role` (`"group"`), `aria-labelledby`; GroupLabel: `id`; Status: `role` (`"none"` inside the List, `"status"` in the Popup).
|
|
708
|
+
|
|
709
|
+
`Group` is named by the `GroupLabel` inside it. `Status` inside the List (as a Suspense fallback) marks the results as loading (the List is `aria-busy`); in the Popup it is a plain hint. `Empty` is a plain `<div>` that renders nothing unless the results are settled and empty, so "No results" never flashes during a search.
|
|
710
|
+
|
|
711
|
+
### `Combobox.Chips` (with `multiple`)
|
|
712
|
+
|
|
713
|
+
| Prop | Type | Default | Description |
|
|
714
|
+
| - | - | - | - |
|
|
715
|
+
| `className` | `string \| ((state: ComboboxChipsState) => string \| undefined)` | – | A class name, or a function of the part's state. |
|
|
716
|
+
| `style` | `CSSProperties \| ((state: ComboboxChipsState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
|
|
717
|
+
| `children` | `ReactNode \| ((state: ComboboxChipsState) => ReactNode)` | – | Usually a function of `{ value }` rendering one `Combobox.Chip` per value, keyed by the value; must not suspend. |
|
|
718
|
+
| `render` | `ReactElement \| ((props, state: ComboboxChipsState) => ReactNode)` | – | Replace the default \<div> (element form) or take over rendering (function form). |
|
|
719
|
+
|
|
720
|
+
- **State**: `ComboboxChipsState` is `{ value, pending, disabled }`; `value` is the optimistic selection in pick order, `pending` the value action in flight.
|
|
721
|
+
- **Owned**: `role` (`"list"`, absent while empty), `aria-labelledby` (the Label, token-merged; absent while empty), `onKeyDown` (the chip keys), `onPointerDown`, `onMouseDown`, `onClick` (a press keeps focus where it is; a click focuses the Input), `onFocus`, `onBlur` (a chip is inside the combobox: focus on it closes the listbox and keeps the text), `data-empty`, `data-pending`, `data-disabled`.
|
|
722
|
+
|
|
723
|
+
The list of chips, not the field box: render the Input next to it, in your own element. Under a Root without `multiple` it warns in development and renders empty.
|
|
724
|
+
|
|
725
|
+
### `Combobox.Chip`
|
|
726
|
+
|
|
727
|
+
| Prop | Type | Default | Description |
|
|
728
|
+
| - | - | - | - |
|
|
729
|
+
| `value` | `string` | – | Required: a value of the selection (development warns otherwise). |
|
|
730
|
+
| `label` | `string` | – | The chip's text for the removal announcement. Default: the state's `label`, else the chip's trimmed text. |
|
|
731
|
+
| `className` | `string \| ((state: ComboboxChipState) => string \| undefined)` | – | A class name, or a function of the part's state. |
|
|
732
|
+
| `style` | `CSSProperties \| ((state: ComboboxChipState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
|
|
733
|
+
| `children` | `ReactNode \| ((state: ComboboxChipState) => ReactNode)` | – | Content, or a function of the chip's state; default `label ?? value`. Must not suspend. |
|
|
734
|
+
| `render` | `ReactElement \| ((props, state: ComboboxChipState) => ReactNode)` | – | Replace the default \<div> (element form) or take over rendering (function form). |
|
|
735
|
+
|
|
736
|
+
- **State**: `ComboboxChipState` is `{ value, label, pending, disabled }`. `label` is the text of the option with this value as the library last saw it (written at the pick), `undefined` if no option for it was ever rendered (a preselected value before the listbox first opens). `pending`: its addition is not committed yet.
|
|
737
|
+
- **Owned**: `role` (`"listitem"`), `tabIndex` (`-1`), `data-pending`, `data-disabled`.
|
|
738
|
+
|
|
739
|
+
Focused by keys only, never a Tab stop. On a focused chip: the previous / next arrow (in the inline direction) moves, the next arrow past the last chip returns to the Input, Home / End go to the first / last chip, Backspace and Delete remove it (focus moves first to the next chip, else the previous, else the Input), Escape returns to the Input, a printable key types into the Input; Enter and Space do nothing. `aria-description` passes through for a hint such as "Press Backspace to remove".
|
|
740
|
+
|
|
741
|
+
### `Combobox.ChipRemove`
|
|
742
|
+
|
|
743
|
+
| Prop | Type | Default | Description |
|
|
744
|
+
| - | - | - | - |
|
|
745
|
+
| `className` | `string \| ((state: ComboboxChipRemoveState) => string \| undefined)` | – | A class name, or a function of the part's state. |
|
|
746
|
+
| `style` | `CSSProperties \| ((state: ComboboxChipRemoveState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
|
|
747
|
+
| `children` | `ReactNode \| ((state: ComboboxChipRemoveState) => ReactNode)` | – | Content, usually an icon in an `aria-hidden` element (never read as part of the chip's text in the removal announcement, nor is any `aria-hidden` content); give the button an `aria-label` (development warns without a name). |
|
|
748
|
+
| `render` | `ReactElement \| ((props, state: ComboboxChipRemoveState) => ReactNode)` | – | Replace the default \<button> (element form) or take over rendering (function form). |
|
|
749
|
+
|
|
750
|
+
- **State**: `ComboboxChipRemoveState` is `{ value, pending, disabled }` (the Chip's value and pending).
|
|
751
|
+
- **Owned**: `type` (on a `<button>`), `tabIndex` (`-1`), `disabled` (the Root's), `aria-disabled` (link or component `render`), `onClick`, `onPointerDown`, `onMouseDown`, `data-pending`, `data-disabled`.
|
|
752
|
+
|
|
753
|
+
Inside a `Combobox.Chip` (outside one it throws). A press keeps focus in the Input; the click removes the chip's value, announces it and focuses the Input. A press while the listbox is open closes it (light dismiss), as Clear's does.
|
|
754
|
+
|
|
755
|
+
## Data attributes
|
|
756
|
+
|
|
757
|
+
| Hook | On | Meaning |
|
|
758
|
+
| - | - | - |
|
|
759
|
+
| `data-open` | Input, Trigger | Optimistic open state. The Input's `aria-expanded` follows the shown listbox instead; a `<button>` Trigger has no `aria-expanded` (the browser exposes its state). |
|
|
760
|
+
| `data-pending` | Input | A selection or an open is in flight (the Root's `pending`). |
|
|
761
|
+
| `data-pending` | Trigger | The open (or close) is in flight. |
|
|
762
|
+
| `data-pending` | Option | The option the in-flight selection is choosing (with `multiple`: being added or removed). |
|
|
763
|
+
| `data-pending` | Chip, ChipRemove | With `multiple`: the chip's addition is not committed yet (a removed chip is gone at once). |
|
|
764
|
+
| `data-pending` | Chips | With `multiple`: a value action is in flight. |
|
|
765
|
+
| `data-selected` | Input | A value is selected (optimistic, not `null`; with `multiple`, at least one). |
|
|
766
|
+
| `data-selected` | Option | This option is the optimistic selection. |
|
|
767
|
+
| `data-active` | Option | `aria-activedescendant` points here (keyboard or hover). |
|
|
768
|
+
| `data-stale` | Input, Popup, List | The results shown are for an older text; the List also has `aria-busy`. |
|
|
769
|
+
| `data-empty` | List | Settled with no options. |
|
|
770
|
+
| `data-empty` | Chips | With `multiple`: nothing is selected. |
|
|
771
|
+
| `data-disabled` | Input, Trigger, Clear, Option, Chips, Chip, ChipRemove | Disabled. |
|
|
772
|
+
| `:popover-open` | Popup | The listbox is shown (browser-owned, no attribute). |
|
|
773
|
+
|
|
774
|
+
## Keyboard and ARIA
|
|
775
|
+
|
|
776
|
+
| Key | Listbox | Behaviour |
|
|
777
|
+
| - | - | - |
|
|
778
|
+
| Typing, Backspace, paste | any | Changes the text (urgent), clears the active option and opens the listbox. |
|
|
779
|
+
| ArrowDown / ArrowUp | closed | Opens with the first / last enabled option active. |
|
|
780
|
+
| ArrowDown / ArrowUp | open | Next / previous enabled option; stops at the ends (wraps with `loop`). |
|
|
781
|
+
| Alt+ArrowDown | closed | Opens with no option active. |
|
|
782
|
+
| Alt+ArrowUp | open | Accepts the active option, or closes. |
|
|
783
|
+
| Enter | open | Accepts the active option; with none, commits free text (`allowCustomValue`) or does nothing. |
|
|
784
|
+
| Enter | closed | Not handled (a form submits); commits changed free text first with `allowCustomValue`. |
|
|
785
|
+
| Escape | open | The platform closes the listbox; focus and text stay. A second Escape reaches an enclosing Dialog or Popover. |
|
|
786
|
+
| Tab / Shift+Tab | any | Focus moves on and the listbox closes; the text reverts or, with `allowCustomValue`, commits. Tab never accepts the active option. |
|
|
787
|
+
| Home / End, Left / Right | any | The input's caret; the active option is cleared (focus is back on the text). |
|
|
788
|
+
|
|
789
|
+
Disabled options are skipped. Keys during an IME composition belong to the composition. Ctrl and Meta combinations are left alone.
|
|
790
|
+
|
|
791
|
+
With `multiple`, in the Input (the chip keys are with [Combobox.Chip](#props)):
|
|
792
|
+
|
|
793
|
+
| Key | When | Behaviour |
|
|
794
|
+
| - | - | - |
|
|
795
|
+
| Enter | open, active option | Toggles it; the listbox stays open. |
|
|
796
|
+
| Enter | open, no active option | Adds the text as a value with `allowCustomValue`; otherwise nothing. |
|
|
797
|
+
| Enter | opening (requested, not shown yet), text typed | Nothing: prevented, the text is kept (you are about to pick). Right after Escape the closed rule below applies. |
|
|
798
|
+
| Enter | closed, text typed | `allowCustomValue`: adds the text (prevented, the form does not submit). Otherwise clears the text, then a form submits. |
|
|
799
|
+
| Alt+ArrowUp | open | Closes; the active option is not toggled. |
|
|
800
|
+
| Backspace | empty text | Removes the last chip and announces it (not on key repeat). |
|
|
801
|
+
| Left (Right in RTL) | caret at the start | Moves focus to the last chip; the listbox closes, the text stays. |
|
|
802
|
+
|
|
803
|
+
Screen readers hear a toggled option through its `aria-selected` under `aria-activedescendant`; a chip removed outside the listbox is announced with `ariaNotify()` on the Input (`"Japan removed"`). The label is the Chip's `label`, else the option text the library saw, else the chip's text without its `ChipRemove` and without `aria-hidden` content. The announcement is optimistic: if the removal's save fails the chip comes back without a second announcement. Localise it with:
|
|
804
|
+
|
|
805
|
+
```tsx
|
|
806
|
+
<Combobox.Root multiple announceRemoved={(labels) => `${labels.join("、")}を削除しました`}>
|
|
807
|
+
```
|
|
808
|
+
|
|
809
|
+
### Accessibility and announcements
|
|
810
|
+
|
|
811
|
+
- The Input is `role="combobox"` with `aria-autocomplete="list"`, `aria-expanded`, `aria-controls` (the List) and `aria-activedescendant` (the active option, never a stale id; removed while you edit the text). Name it with `Combobox.Label`, which names the listbox too.
|
|
812
|
+
- When results settle, the library announces their count with `ariaNotify()` on the List: by default the English `"No results"`, `"1 result"`, `"N results"`. Nothing is announced while results are stale or loading (a `Status` fallback showing in the List), or for an unchanged result set. Localise with one function:
|
|
813
|
+
|
|
814
|
+
```tsx
|
|
815
|
+
<Combobox.Root announce={(n) => (n === 0 ? "該当なし" : `${n}件`)}>
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
## Transition types
|
|
819
|
+
|
|
820
|
+
Concept: [Transitions & ViewTransition](../concepts/transitions.md#transition-types)
|
|
821
|
+
|
|
822
|
+
Every value dispatch: `fsui-combobox` and `fsui-combobox-select` (with `multiple`: `-select` when something is added, `fsui-combobox-deselect` when something is removed). Opens and closes: `fsui-combobox` plus `fsui-combobox-open` or `fsui-combobox-close`. A deferred results render carries no `fsui-*` type, so give the Popup's `transition` a map with `default: "none"`.
|
|
823
|
+
|
|
824
|
+
## Optimistic and pending
|
|
825
|
+
|
|
826
|
+
Concept: [Pending & optimistic state](../concepts/pending-and-optimistic.md)
|
|
827
|
+
|
|
828
|
+
The selected value and the open state are optimistic (`data-selected` on the Input and the Option). `data-pending` is on the Input while a selection or an open is in flight, on the Trigger while an open or close is, and on the Option being chosen. With `multiple` the chips render from the optimistic value: a removed chip disappears at once and returns if its save fails, an added chip has `data-pending` until it is committed. The typed text is urgent, not optimistic (a [fact](../concepts/action-props.md#fact), reported to `onInputValueChange`).
|
|
829
|
+
|
|
830
|
+
### A slow `openChangeAction`
|
|
831
|
+
|
|
832
|
+
Here every `openChangeAction` call takes 2 seconds, like a server call, and `onOpenChange` logs the dismissals. The Input's `aria-expanded`, and the state the browser exposes on the Trigger, follow the shown listbox:
|
|
833
|
+
|
|
834
|
+
```tsx title="ComboboxSlowOpen.tsx"
|
|
835
|
+
"use client";
|
|
836
|
+
import { startTransition, useState } from "react";
|
|
837
|
+
import { Combobox } from "@funstack/ui/combobox";
|
|
838
|
+
import type { ComboboxOpenChangeDetails } from "@funstack/ui/combobox";
|
|
839
|
+
import { sleep } from "./fake-api.js";
|
|
840
|
+
|
|
841
|
+
const FRUITS = ["Apple", "Banana", "Cherry", "Grape", "Lemon", "Mango", "Orange", "Pear"];
|
|
842
|
+
|
|
843
|
+
// A slow `openChangeAction`: a pretend server call of 2 seconds for every request. Opening
|
|
844
|
+
// (typing, ArrowDown or the Trigger): the Input and the Trigger get data-open and data-pending at
|
|
845
|
+
// once, the listbox is shown when the action settles. Accepting an option or pressing the Trigger
|
|
846
|
+
// again closes it when the close's action settles. Escape, a click outside and focus leaving are
|
|
847
|
+
// the browser's, a fact: the listbox hides at once, nothing is pending and the action is not
|
|
848
|
+
// called; `onOpenChange` reports it. The Input's `aria-expanded` and the state the browser
|
|
849
|
+
// exposes on the Trigger follow the shown listbox. The readout is plain text, not a live region.
|
|
850
|
+
export function ComboboxSlowOpen() {
|
|
851
|
+
const [log, setLog] = useState("(none yet)");
|
|
852
|
+
const slow = async (open: boolean, { reason }: ComboboxOpenChangeDetails) => {
|
|
853
|
+
const call = `openChangeAction(${open}, "${reason}")`;
|
|
854
|
+
setLog(`${call}: running…`);
|
|
855
|
+
await sleep(2000);
|
|
856
|
+
// After an await: wrap the update in startTransition (React limitation).
|
|
857
|
+
startTransition(() => setLog(`${call}: settled`));
|
|
858
|
+
};
|
|
859
|
+
// A fact: called in the browser's event, not awaited. A plain setState here is urgent.
|
|
860
|
+
const dismissed = (open: boolean, { reason }: ComboboxOpenChangeDetails) => {
|
|
861
|
+
setLog(`onOpenChange(${open}, "${reason}")`);
|
|
862
|
+
};
|
|
863
|
+
return (
|
|
864
|
+
<div className="demo-stack">
|
|
865
|
+
<Combobox.Root openChangeAction={slow} onOpenChange={dismissed}>
|
|
866
|
+
<Combobox.Label>Fruit</Combobox.Label>
|
|
867
|
+
<div className="demo-combobox-field">
|
|
868
|
+
<Combobox.Input className="demo-combobox-input" placeholder="Type or press ArrowDown" />
|
|
869
|
+
<Combobox.Trigger className="demo-combobox-icon" aria-label="Show fruits">
|
|
870
|
+
{({ pending }) => (pending ? <span className="demo-spinner" aria-hidden /> : "▾")}
|
|
871
|
+
</Combobox.Trigger>
|
|
872
|
+
<Combobox.Popup className="demo-combobox-popup">
|
|
873
|
+
<Combobox.List>
|
|
874
|
+
{({ query }) =>
|
|
875
|
+
FRUITS.filter((f) => f.toLowerCase().includes(query.toLowerCase())).map((f) => (
|
|
876
|
+
<Combobox.Option key={f} value={f}>
|
|
877
|
+
{f}
|
|
878
|
+
</Combobox.Option>
|
|
879
|
+
))
|
|
880
|
+
}
|
|
881
|
+
</Combobox.List>
|
|
882
|
+
<Combobox.Empty className="demo-combobox-status">No fruit matches.</Combobox.Empty>
|
|
883
|
+
</Combobox.Popup>
|
|
884
|
+
</div>
|
|
885
|
+
</Combobox.Root>
|
|
886
|
+
<p className="demo-readout">
|
|
887
|
+
Last: <code>{log}</code>
|
|
888
|
+
</p>
|
|
889
|
+
</div>
|
|
890
|
+
);
|
|
891
|
+
}
|
|
892
|
+
```
|
|
893
|
+
|
|
894
|
+
`combobox.css`: the same file as above.
|
|
895
|
+
|
|
896
|
+
- Open (type, ArrowDown or the Trigger): the Input and the Trigger get `data-open` and `data-pending` at once and stay collapsed; the listbox is shown and both are expanded when the action settles.
|
|
897
|
+
- Accept an option, or press the Trigger again: the listbox stays shown and both stay expanded until the close's action settles.
|
|
898
|
+
- Escape or a click outside: a fact. The listbox hides and both are collapsed at once; nothing is pending and the slow action is not called; `onOpenChange` is.
|
|
899
|
+
|
|
900
|
+
The readout under the example is plain text, not a live region, so it does not interrupt a screen reader.
|
|
901
|
+
|
|
902
|
+
## Suspense
|
|
903
|
+
|
|
904
|
+
Concept: [Suspense](../concepts/suspense.md)
|
|
905
|
+
|
|
906
|
+
Results render from a deferred copy of the text (`useDeferredValue`), so an async search is `use(search(query))` inside a boundary in the List. The first load shows your fallback; after that every keystroke keeps the previous results on screen, marked `data-stale` and `aria-busy`, until the new ones are ready. Only the latest query is ever rendered. Option content must not suspend.
|
|
907
|
+
|
|
908
|
+
## Browser-owned state
|
|
909
|
+
|
|
910
|
+
Concept: [Browser-owned state](../concepts/browser-owned-state.md)
|
|
911
|
+
|
|
912
|
+
The listbox is a popover: a dismissal (Escape, a click outside, another popover opening) is the browser's. Focus leaving the input is closed by the library at once, which it cannot hold either. Either way it is a fact: `onOpenChange(false)` with `reason: "dismiss"`, nothing pending.
|
|
913
|
+
|
|
914
|
+
## Before hydration
|
|
915
|
+
|
|
916
|
+
Concept: [Server Components](../concepts/server-components.md#before-hydration)
|
|
917
|
+
|
|
918
|
+
A plain text field: typing works and the form posts the default selection (and the raw text, if the Input has a `name`). The listbox never opens before hydration. Text typed then is kept and reported once, with `reason: "platform"`.
|
|
919
|
+
|
|
920
|
+
## Forms
|
|
921
|
+
|
|
922
|
+
- `name` on the Root posts the value through a hidden input (`""` for `null`); a `name` on the Input posts the raw text as well. `required` on the Input is native.
|
|
923
|
+
- With `multiple`: one hidden input per value, so the form posts what same-named checkboxes would (`formData.getAll(name)`, nothing for an empty selection). `required` means at least one value (see [Multiple selection](#multiple)). A form reset replaces the whole selection with the reset target, even while saves are still running. Inside a `Field.Root`, `validate` gets the first value; read the others from `formData.getAll(name)`.
|
|
924
|
+
- A form reset (the Reset button, `form.reset()`, or React's automatic reset after a form action) dispatches `valueChangeAction` with `reason: "platform"` and writes the text: uncontrolled, back to the latest `defaultValue` / `defaultInputValue`; controlled, to the mount-time values.
|
|
925
|
+
- Text typed before hydration (and Firefox's form restoration) is kept and reported once through `onInputValueChange` with `reason: "platform"`.
|
|
926
|
+
|
|
927
|
+
## Styling
|
|
928
|
+
|
|
929
|
+
```css
|
|
930
|
+
.listbox { margin: 0; inset: auto; max-block-size: 20rem; overflow: auto; }
|
|
931
|
+
.listbox [role="listbox"][data-stale] { opacity: .6; } /* old results while searching */
|
|
932
|
+
.listbox [role="option"][data-active] { background: var(--accent-weak); }
|
|
933
|
+
.listbox [role="option"][data-selected]::after { content: "✓"; }
|
|
934
|
+
.listbox [role="option"][data-pending] { cursor: progress; }
|
|
935
|
+
.combobox-input:user-invalid { border-color: var(--danger); }
|
|
936
|
+
|
|
937
|
+
/* Enter / exit for dismissals too (Escape, a click outside). */
|
|
938
|
+
.listbox { opacity: 0; transition: opacity 120ms, display 120ms allow-discrete, overlay 120ms allow-discrete; }
|
|
939
|
+
.listbox:popover-open { opacity: 1; }
|
|
940
|
+
@starting-style { .listbox:popover-open { opacity: 0; } }
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
`transition` on the Popup animates the library's own opens and closes with a view transition in every engine (including the close after an accepted option, which shows the pending option until it fades). A results change is a deferred render, and React runs a view transition for it too, during which the page takes no pointer input. Unless every results change should cross-fade, give it a type map:
|
|
944
|
+
|
|
945
|
+
```tsx
|
|
946
|
+
<Combobox.Popup
|
|
947
|
+
transition={{ "fsui-combobox-open": "pop", "fsui-combobox-close": "pop", default: "none" }}
|
|
948
|
+
>
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
Types: every value dispatch adds `fsui-combobox` and `fsui-combobox-select`; opens and closes add `fsui-combobox-open` / `fsui-combobox-close`. With `multiple`, a value dispatch adds `fsui-combobox-select` when it adds a value and `fsui-combobox-deselect` when it removes one. Chips have no `transition` prop: to animate them, wrap each in your own `<ViewTransition>` and key on these types.
|
|
952
|
+
|
|
953
|
+
Keep the CSS exit above next to `transition`: it animates the dismissals (focus leaving, Escape, a click outside). The library turns the popup's CSS transitions off for the moment of its own show and hide while a view transition runs, so you need no extra rule ([A popup with a CSS exit and a view transition](../concepts/transitions.md#css-exit)).
|
|
954
|
+
|
|
955
|
+
## Browser notes
|
|
956
|
+
|
|
957
|
+
- **Right-to-left:** the listbox lines up with the input's inline-start edge (the right edge in RTL) under a `dir="rtl"` page or container. The `self-*` `position-area` keywords follow the popup's own inherited direction, with no JavaScript; plain logical keywords would follow the root's only, because the listbox is in the top layer. Firefox misplaces a popover inside a direction island ([#89](https://github.com/uhyo/funstack-ui/issues/89); see [Tooltip](tooltip.md#browser-notes)). The Popup emits no `data-side`.
|
|
958
|
+
- Inside a Dialog or a Popover the listbox nests in the top layer: the first Escape closes the listbox, the next the outer overlay; an outside click closes the stack. Inside a `Menu.Popup` a combobox is not supported (the menu's typeahead and focus handling compete with the input).
|
|
959
|
+
- Safari: a WebKit bug (302008) can hang a page that opens a popover with position fallbacks inside another popover. If a Combobox inside a Popover or Dialog misbehaves in Safari, turn the flip off: `style={{ positionTryFallbacks: "none" }}` on `Combobox.Popup`.
|
|
960
|
+
- Want the listbox as wide as an input-plus-buttons group? Give the group an `anchor-name` and pass `positionAnchor` and `minWidth: "anchor-size(--group width)"` through `style`.
|