@funstack/ui 0.1.0-alpha.21 → 0.1.0-alpha.23
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/dist/accordion/accordion-context.mjs +1 -2
- package/dist/accordion/accordion-item.d.mts +1 -3
- package/dist/accordion/accordion-item.d.mts.map +1 -1
- package/dist/accordion/accordion-item.mjs +14 -8
- package/dist/accordion/accordion-item.mjs.map +1 -1
- package/dist/accordion/accordion-panel.d.mts +1 -3
- package/dist/accordion/accordion-panel.d.mts.map +1 -1
- package/dist/accordion/accordion-panel.mjs +3 -4
- package/dist/accordion/accordion-root.d.mts +1 -3
- package/dist/accordion/accordion-root.d.mts.map +1 -1
- package/dist/accordion/accordion-root.mjs +12 -15
- package/dist/accordion/accordion-root.mjs.map +1 -1
- package/dist/accordion/accordion-trigger.d.mts +1 -3
- package/dist/accordion/accordion-trigger.d.mts.map +1 -1
- package/dist/accordion/accordion-trigger.mjs +4 -5
- package/dist/accordion/index.d.mts +0 -2
- package/dist/accordion/index.d.mts.map +1 -1
- package/dist/accordion/index.mjs +1 -2
- package/dist/alert-dialog/alert-dialog-action.d.mts +5 -5
- package/dist/alert-dialog/alert-dialog-action.d.mts.map +1 -1
- package/dist/alert-dialog/alert-dialog-action.mjs +1 -2
- package/dist/alert-dialog/alert-dialog-action.mjs.map +1 -1
- package/dist/alert-dialog/alert-dialog-cancel.d.mts +0 -2
- package/dist/alert-dialog/alert-dialog-cancel.d.mts.map +1 -1
- package/dist/alert-dialog/alert-dialog-cancel.mjs +4 -5
- package/dist/alert-dialog/alert-dialog-context.mjs +2 -3
- package/dist/alert-dialog/alert-dialog-description.d.mts +0 -2
- package/dist/alert-dialog/alert-dialog-description.d.mts.map +1 -1
- package/dist/alert-dialog/alert-dialog-description.mjs +1 -2
- package/dist/alert-dialog/alert-dialog-form.d.mts +0 -2
- package/dist/alert-dialog/alert-dialog-form.d.mts.map +1 -1
- package/dist/alert-dialog/alert-dialog-form.mjs +1 -2
- package/dist/alert-dialog/alert-dialog-popup.d.mts +1 -3
- package/dist/alert-dialog/alert-dialog-popup.d.mts.map +1 -1
- package/dist/alert-dialog/alert-dialog-popup.mjs +3 -4
- package/dist/alert-dialog/alert-dialog-root.d.mts +0 -2
- package/dist/alert-dialog/alert-dialog-root.d.mts.map +1 -1
- package/dist/alert-dialog/alert-dialog-root.mjs +1 -2
- package/dist/alert-dialog/alert-dialog-title.d.mts +0 -2
- package/dist/alert-dialog/alert-dialog-title.d.mts.map +1 -1
- package/dist/alert-dialog/alert-dialog-title.mjs +1 -2
- package/dist/alert-dialog/alert-dialog-trigger.d.mts +0 -2
- package/dist/alert-dialog/alert-dialog-trigger.d.mts.map +1 -1
- package/dist/alert-dialog/alert-dialog-trigger.mjs +1 -2
- package/dist/alert-dialog/index.d.mts +0 -2
- package/dist/alert-dialog/index.d.mts.map +1 -1
- package/dist/alert-dialog/index.mjs +1 -2
- package/dist/avatar/avatar-context.mjs +1 -2
- package/dist/avatar/avatar-fallback.d.mts +1 -3
- package/dist/avatar/avatar-fallback.d.mts.map +1 -1
- package/dist/avatar/avatar-fallback.mjs +1 -2
- package/dist/avatar/avatar-image.d.mts +1 -3
- package/dist/avatar/avatar-image.d.mts.map +1 -1
- package/dist/avatar/avatar-image.mjs +2 -3
- package/dist/avatar/avatar-root.d.mts +1 -3
- package/dist/avatar/avatar-root.d.mts.map +1 -1
- package/dist/avatar/avatar-root.mjs +2 -3
- package/dist/avatar/index.d.mts +1 -3
- package/dist/avatar/index.d.mts.map +1 -1
- package/dist/avatar/index.mjs +1 -2
- package/dist/bin/skill-installer.mjs +1 -2
- package/dist/button/button.d.mts +1 -3
- package/dist/button/button.d.mts.map +1 -1
- package/dist/button/button.mjs +4 -5
- package/dist/checkbox/checkbox.d.mts +1 -3
- package/dist/checkbox/checkbox.d.mts.map +1 -1
- package/dist/checkbox/checkbox.mjs +2 -3
- package/dist/checkbox-group/checkbox-group-context.mjs +1 -2
- package/dist/checkbox-group/checkbox-group-item.d.mts +1 -3
- package/dist/checkbox-group/checkbox-group-item.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-item.mjs +5 -6
- package/dist/checkbox-group/checkbox-group-label.d.mts +1 -3
- package/dist/checkbox-group/checkbox-group-label.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-label.mjs +1 -2
- package/dist/checkbox-group/checkbox-group-parent.d.mts +1 -3
- package/dist/checkbox-group/checkbox-group-parent.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-parent.mjs +7 -8
- package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-root.d.mts +1 -3
- package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-root.mjs +7 -8
- package/dist/checkbox-group/index.d.mts +1 -3
- package/dist/checkbox-group/index.d.mts.map +1 -1
- package/dist/checkbox-group/index.mjs +1 -2
- package/dist/collapsible/collapsible-context.mjs +1 -2
- package/dist/collapsible/collapsible-panel.d.mts +1 -3
- package/dist/collapsible/collapsible-panel.d.mts.map +1 -1
- package/dist/collapsible/collapsible-panel.mjs +3 -4
- package/dist/collapsible/collapsible-root.d.mts +1 -3
- package/dist/collapsible/collapsible-root.d.mts.map +1 -1
- package/dist/collapsible/collapsible-root.mjs +18 -18
- package/dist/collapsible/collapsible-root.mjs.map +1 -1
- package/dist/collapsible/collapsible-trigger.d.mts +1 -3
- package/dist/collapsible/collapsible-trigger.d.mts.map +1 -1
- package/dist/collapsible/collapsible-trigger.mjs +4 -5
- package/dist/collapsible/index.d.mts +0 -2
- package/dist/collapsible/index.d.mts.map +1 -1
- package/dist/collapsible/index.mjs +1 -2
- package/dist/combobox/chip-text.mjs +1 -2
- package/dist/combobox/combobox-chips.d.mts +1 -3
- package/dist/combobox/combobox-chips.d.mts.map +1 -1
- package/dist/combobox/combobox-chips.mjs +3 -4
- package/dist/combobox/combobox-clear.d.mts +1 -3
- package/dist/combobox/combobox-clear.d.mts.map +1 -1
- package/dist/combobox/combobox-clear.mjs +2 -3
- package/dist/combobox/combobox-context.mjs +1 -2
- package/dist/combobox/combobox-group.d.mts +1 -3
- package/dist/combobox/combobox-group.d.mts.map +1 -1
- package/dist/combobox/combobox-group.mjs +2 -3
- package/dist/combobox/combobox-input.d.mts +1 -3
- package/dist/combobox/combobox-input.d.mts.map +1 -1
- package/dist/combobox/combobox-input.mjs +5 -6
- package/dist/combobox/combobox-keyboard.mjs +2 -3
- package/dist/combobox/combobox-label.d.mts +1 -3
- package/dist/combobox/combobox-label.d.mts.map +1 -1
- package/dist/combobox/combobox-label.mjs +2 -3
- package/dist/combobox/combobox-list.d.mts +1 -3
- package/dist/combobox/combobox-list.d.mts.map +1 -1
- package/dist/combobox/combobox-list.mjs +3 -4
- package/dist/combobox/combobox-option.d.mts +1 -3
- package/dist/combobox/combobox-option.d.mts.map +1 -1
- package/dist/combobox/combobox-option.mjs +2 -3
- package/dist/combobox/combobox-popup.d.mts +1 -3
- package/dist/combobox/combobox-popup.d.mts.map +1 -1
- package/dist/combobox/combobox-popup.mjs +4 -5
- package/dist/combobox/combobox-root.d.mts +1 -3
- package/dist/combobox/combobox-root.d.mts.map +1 -1
- package/dist/combobox/combobox-root.mjs +14 -15
- package/dist/combobox/combobox-trigger.d.mts +1 -3
- package/dist/combobox/combobox-trigger.d.mts.map +1 -1
- package/dist/combobox/combobox-trigger.mjs +5 -6
- package/dist/combobox/index.d.mts +1 -3
- package/dist/combobox/index.d.mts.map +1 -1
- package/dist/combobox/index.mjs +1 -2
- package/dist/combobox/use-combobox-form.mjs +3 -5
- package/dist/combobox/use-combobox-form.mjs.map +1 -1
- package/dist/combobox/use-combobox-text.mjs +3 -4
- package/dist/csp/csp-provider.d.mts +0 -2
- package/dist/csp/csp-provider.d.mts.map +1 -1
- package/dist/csp/csp-provider.mjs +2 -3
- package/dist/csp/style-hashes.d.mts +0 -2
- package/dist/csp/style-hashes.d.mts.map +1 -1
- package/dist/csp/style-hashes.mjs +1 -2
- package/dist/dialog/dialog-close.d.mts +10 -6
- package/dist/dialog/dialog-close.d.mts.map +1 -1
- package/dist/dialog/dialog-close.mjs +5 -5
- package/dist/dialog/dialog-close.mjs.map +1 -1
- package/dist/dialog/dialog-context.mjs +1 -2
- package/dist/dialog/dialog-description.d.mts +1 -3
- package/dist/dialog/dialog-description.d.mts.map +1 -1
- package/dist/dialog/dialog-description.mjs +1 -2
- package/dist/dialog/dialog-dismiss.mjs +51 -21
- package/dist/dialog/dialog-dismiss.mjs.map +1 -1
- package/dist/dialog/dialog-form.d.mts +1 -3
- package/dist/dialog/dialog-form.d.mts.map +1 -1
- package/dist/dialog/dialog-form.mjs +6 -7
- package/dist/dialog/dialog-popup.d.mts +2 -4
- package/dist/dialog/dialog-popup.d.mts.map +1 -1
- package/dist/dialog/dialog-popup.mjs +10 -11
- package/dist/dialog/dialog-root.d.mts +1 -3
- package/dist/dialog/dialog-root.d.mts.map +1 -1
- package/dist/dialog/dialog-root.mjs +3 -4
- package/dist/dialog/dialog-title.d.mts +1 -3
- package/dist/dialog/dialog-title.d.mts.map +1 -1
- package/dist/dialog/dialog-title.mjs +1 -2
- package/dist/dialog/dialog-trigger.d.mts +1 -3
- package/dist/dialog/dialog-trigger.d.mts.map +1 -1
- package/dist/dialog/dialog-trigger.mjs +4 -5
- package/dist/dialog/index.d.mts +1 -3
- package/dist/dialog/index.d.mts.map +1 -1
- package/dist/dialog/index.mjs +1 -2
- package/dist/docs/components/accordion.md +1 -1
- package/dist/docs/components/alert-dialog.md +15 -7
- package/dist/docs/components/collapsible.md +1 -1
- package/dist/docs/components/dialog.md +14 -6
- package/dist/docs/components/drawer.md +3 -3
- package/dist/docs/components/menu.md +4 -4
- package/dist/docs/components/menubar.md +309 -0
- package/dist/docs/components/meter.md +1 -1
- package/dist/docs/components/navigation-menu.md +501 -0
- package/dist/docs/components/number-field.md +2 -2
- package/dist/docs/components/otp-field.md +8 -1
- package/dist/docs/components/popover.md +6 -6
- package/dist/docs/components/progress.md +1 -1
- package/dist/docs/components/radio-group.md +1 -1
- package/dist/docs/components/slider.md +1 -1
- package/dist/docs/concepts/direction-and-locales.md +106 -0
- package/dist/docs/concepts/pending-and-optimistic.md +1 -0
- package/dist/docs/index.md +4 -1
- package/dist/docs/roadmap.md +11 -0
- package/dist/drawer/drawer-close.d.mts +0 -2
- package/dist/drawer/drawer-close.d.mts.map +1 -1
- package/dist/drawer/drawer-close.mjs +1 -2
- package/dist/drawer/drawer-description.d.mts +0 -2
- package/dist/drawer/drawer-description.d.mts.map +1 -1
- package/dist/drawer/drawer-description.mjs +1 -2
- package/dist/drawer/drawer-form.d.mts +0 -2
- package/dist/drawer/drawer-form.d.mts.map +1 -1
- package/dist/drawer/drawer-form.mjs +1 -2
- package/dist/drawer/drawer-popup.d.mts +2 -4
- package/dist/drawer/drawer-popup.d.mts.map +1 -1
- package/dist/drawer/drawer-popup.mjs +3 -4
- package/dist/drawer/drawer-root.d.mts +0 -2
- package/dist/drawer/drawer-root.d.mts.map +1 -1
- package/dist/drawer/drawer-root.mjs +1 -2
- package/dist/drawer/drawer-swipe.d.mts +0 -2
- package/dist/drawer/drawer-swipe.d.mts.map +1 -1
- package/dist/drawer/drawer-swipe.mjs +1 -2
- package/dist/drawer/drawer-swipe.mjs.map +1 -1
- package/dist/drawer/drawer-title.d.mts +0 -2
- package/dist/drawer/drawer-title.d.mts.map +1 -1
- package/dist/drawer/drawer-title.mjs +1 -2
- package/dist/drawer/drawer-trigger.d.mts +0 -2
- package/dist/drawer/drawer-trigger.d.mts.map +1 -1
- package/dist/drawer/drawer-trigger.mjs +1 -2
- package/dist/drawer/index.d.mts +0 -2
- package/dist/drawer/index.d.mts.map +1 -1
- package/dist/drawer/index.mjs +1 -2
- package/dist/field/field-control.d.mts +2 -4
- package/dist/field/field-control.d.mts.map +1 -1
- package/dist/field/field-control.mjs +6 -7
- package/dist/field/field-description.d.mts +2 -4
- package/dist/field/field-description.d.mts.map +1 -1
- package/dist/field/field-description.mjs +2 -3
- package/dist/field/field-error.d.mts +2 -4
- package/dist/field/field-error.d.mts.map +1 -1
- package/dist/field/field-error.mjs +3 -4
- package/dist/field/field-label.d.mts +2 -4
- package/dist/field/field-label.d.mts.map +1 -1
- package/dist/field/field-label.mjs +3 -4
- package/dist/field/field-root.d.mts +2 -4
- package/dist/field/field-root.d.mts.map +1 -1
- package/dist/field/field-root.mjs +11 -16
- package/dist/field/field-root.mjs.map +1 -1
- package/dist/field/index.d.mts +0 -2
- package/dist/field/index.d.mts.map +1 -1
- package/dist/field/index.mjs +1 -2
- package/dist/field/use-server-error-visibility.mjs +1 -2
- package/dist/form/form-root.d.mts +1 -3
- package/dist/form/form-root.d.mts.map +1 -1
- package/dist/form/form-root.mjs +8 -9
- package/dist/form/form-submit.d.mts +1 -3
- package/dist/form/form-submit.d.mts.map +1 -1
- package/dist/form/form-submit.mjs +3 -4
- package/dist/form/index.d.mts +0 -2
- package/dist/form/index.d.mts.map +1 -1
- package/dist/form/index.mjs +1 -2
- package/dist/hover-card/hover-card-context.mjs +1 -2
- package/dist/hover-card/hover-card-popup.d.mts +2 -4
- package/dist/hover-card/hover-card-popup.d.mts.map +1 -1
- package/dist/hover-card/hover-card-popup.mjs +6 -7
- package/dist/hover-card/hover-card-root.d.mts +1 -3
- package/dist/hover-card/hover-card-root.d.mts.map +1 -1
- package/dist/hover-card/hover-card-root.mjs +3 -4
- package/dist/hover-card/hover-card-trigger.d.mts +1 -3
- package/dist/hover-card/hover-card-trigger.d.mts.map +1 -1
- package/dist/hover-card/hover-card-trigger.mjs +5 -6
- package/dist/hover-card/index.d.mts +0 -2
- package/dist/hover-card/index.d.mts.map +1 -1
- package/dist/hover-card/index.mjs +1 -2
- package/dist/hover-card/use-hover-card-interest.mjs +14 -8
- package/dist/hover-card/use-hover-card-interest.mjs.map +1 -1
- package/dist/index.d.mts +50 -35
- package/dist/index.mjs +3 -1
- package/dist/internal/action/action-details.mjs +1 -2
- package/dist/internal/action/call-urgent-handler.mjs +1 -2
- package/dist/internal/action/report-dropped.mjs +1 -2
- package/dist/internal/action/use-action-trigger.mjs +2 -3
- package/dist/internal/action/use-connected.mjs +1 -2
- package/dist/internal/action/use-controllable-action.mjs +4 -5
- package/dist/internal/action/use-multiple-selection.mjs +4 -5
- package/dist/internal/action/use-pure-trigger.mjs +1 -2
- package/dist/internal/action/use-pure-trigger.mjs.map +1 -1
- package/dist/internal/action/use-step-commit.mjs +3 -4
- package/dist/internal/after-dispatch.mjs +23 -0
- package/dist/internal/after-dispatch.mjs.map +1 -0
- package/dist/internal/announce.mjs +1 -2
- package/dist/internal/arrow-keys.mjs +1 -2
- package/dist/internal/csp-context.mjs +1 -2
- package/dist/internal/data-attr.mjs +1 -2
- package/dist/internal/decimal.mjs +1 -2
- package/dist/internal/details-summary.mjs +51 -3
- package/dist/internal/details-summary.mjs.map +1 -1
- package/dist/internal/dev-warn.mjs +1 -2
- package/dist/internal/dom-order.mjs +1 -2
- package/dist/internal/form/field-context.d.mts +0 -2
- package/dist/internal/form/field-context.d.mts.map +1 -1
- package/dist/internal/form/field-context.mjs +2 -3
- package/dist/internal/form/focus-first-invalid.mjs +2 -3
- package/dist/internal/form/form-status-watcher.mjs +1 -2
- package/dist/internal/form/group-member.mjs +1 -2
- package/dist/internal/form/hidden-values.mjs +1 -2
- package/dist/internal/form/sync-presence.mjs +1 -2
- package/dist/internal/form/use-checkable-input.mjs +2 -3
- package/dist/internal/form/use-field-control.mjs +3 -4
- package/dist/internal/form/use-fieldset-group.mjs +3 -4
- package/dist/internal/form/use-form-owner-event.mjs +1 -2
- package/dist/internal/form/use-form-reset.mjs +10 -8
- package/dist/internal/form/use-form-reset.mjs.map +1 -1
- package/dist/internal/form/use-native-checked.mjs +2 -3
- package/dist/internal/form/use-native-group-reconciliation.mjs +3 -4
- package/dist/internal/form/use-native-select-value.mjs +2 -3
- package/dist/internal/form/validity.d.mts +0 -2
- package/dist/internal/form/validity.d.mts.map +1 -1
- package/dist/internal/form/validity.mjs +1 -2
- package/dist/internal/menubar-context.mjs +11 -0
- package/dist/internal/menubar-context.mjs.map +1 -0
- package/dist/internal/merge-props.mjs +1 -2
- package/dist/internal/overlay/anchor-position.d.mts +0 -2
- package/dist/internal/overlay/anchor-position.d.mts.map +1 -1
- package/dist/internal/overlay/anchor-position.mjs +1 -2
- package/dist/internal/overlay/content-focus-probe.mjs +1 -2
- package/dist/internal/overlay/css-transition-cut.mjs +1 -2
- package/dist/internal/overlay/css-transition-cut.mjs.map +1 -1
- package/dist/internal/overlay/focus-visible.mjs +1 -2
- package/dist/internal/overlay/invokers.mjs +1 -2
- package/dist/internal/overlay/modal-registry.mjs +1 -2
- package/dist/internal/overlay/overlay-popup.mjs +2 -3
- package/dist/internal/overlay/overlay-show.mjs +1 -2
- package/dist/internal/overlay/popover-open.mjs +1 -2
- package/dist/internal/overlay/trigger-ref.mjs +2 -3
- package/dist/internal/overlay/trigger-ref.mjs.map +1 -1
- package/dist/internal/overlay/use-apply-open-state.mjs +1 -2
- package/dist/internal/overlay/use-exit-animation.mjs +1 -2
- package/dist/internal/overlay/use-exit-animation.mjs.map +1 -1
- package/dist/internal/overlay/use-interest-dismiss.mjs +3 -4
- package/dist/internal/overlay/use-modal-registration.mjs +2 -3
- package/dist/internal/overlay/use-overlay-close.mjs +11 -9
- package/dist/internal/overlay/use-overlay-close.mjs.map +1 -1
- package/dist/internal/overlay/use-overlay-root.d.mts +2 -2
- package/dist/internal/overlay/use-overlay-root.mjs +9 -9
- package/dist/internal/overlay/use-overlay-root.mjs.map +1 -1
- package/dist/internal/overlay/use-popover-popup.mjs +6 -7
- package/dist/internal/overlay/use-popover-trigger.d.mts +2 -4
- package/dist/internal/overlay/use-popover-trigger.d.mts.map +1 -1
- package/dist/internal/overlay/use-popover-trigger.mjs +6 -7
- package/dist/internal/overlay/use-popover-trigger.mjs.map +1 -1
- package/dist/internal/overlay/use-resolved-placement.mjs +4 -5
- package/dist/internal/platform-attributes.d.mts +0 -2
- package/dist/internal/platform-attributes.d.mts.map +1 -1
- package/dist/internal/pointer-capture.mjs +1 -2
- package/dist/internal/range-value.mjs +6 -5
- package/dist/internal/range-value.mjs.map +1 -1
- package/dist/internal/render-element.d.mts +2 -2
- package/dist/internal/render-element.mjs +2 -3
- package/dist/internal/shipped-styles.mjs +1 -2
- package/dist/internal/swipe-arithmetic.mjs +0 -1
- package/dist/internal/swipe.mjs +2 -3
- package/dist/internal/toolbar-context.mjs +1 -2
- package/dist/internal/transition-boundary.mjs +2 -3
- package/dist/internal/transition-types.mjs +1 -2
- package/dist/internal/typeahead.mjs +0 -1
- package/dist/internal/types.d.mts +0 -2
- package/dist/internal/types.d.mts.map +1 -1
- package/dist/internal/use-active-option.mjs +1 -2
- package/dist/internal/use-deferred-leave.mjs +2 -3
- package/dist/internal/use-delayed-pair.mjs +1 -2
- package/dist/internal/use-dev-warning.mjs +0 -1
- package/dist/internal/use-element-check.mjs +1 -2
- package/dist/internal/use-hydrated-mount.mjs +1 -2
- package/dist/internal/use-item-order.mjs +2 -3
- package/dist/internal/use-latest.mjs +1 -2
- package/dist/internal/use-merged-refs.mjs +2 -3
- package/dist/internal/use-mount-fixed.mjs +2 -3
- package/dist/internal/use-name-warning.mjs +1 -2
- package/dist/internal/use-native-focusgroup.mjs +1 -2
- package/dist/internal/use-option-registry.mjs +3 -4
- package/dist/internal/use-register-count.mjs +1 -2
- package/dist/internal/use-render.d.mts +2 -2
- package/dist/internal/use-render.mjs +2 -3
- package/dist/internal/use-roving-focus.mjs +2 -3
- package/dist/internal/use-value-set.mjs +2 -3
- package/dist/internal/value-set.mjs +1 -2
- package/dist/menu/index.d.mts +2 -4
- package/dist/menu/index.d.mts.map +1 -1
- package/dist/menu/index.mjs +2 -3
- package/dist/menu/menu-checkbox-item.d.mts +1 -3
- package/dist/menu/menu-checkbox-item.d.mts.map +1 -1
- package/dist/menu/menu-checkbox-item.mjs +3 -4
- package/dist/menu/menu-context-trigger.d.mts +1 -3
- package/dist/menu/menu-context-trigger.d.mts.map +1 -1
- package/dist/menu/menu-context-trigger.mjs +4 -5
- package/dist/menu/menu-context.mjs +1 -2
- package/dist/menu/menu-dom.mjs +1 -2
- package/dist/menu/menu-gestures.mjs +1 -2
- package/dist/menu/menu-group.d.mts +1 -3
- package/dist/menu/menu-group.d.mts.map +1 -1
- package/dist/menu/menu-group.mjs +2 -3
- package/dist/menu/menu-hover.mjs +1 -2
- package/dist/menu/menu-item.d.mts +3 -4
- package/dist/menu/menu-item.d.mts.map +1 -1
- package/dist/menu/menu-item.mjs +6 -3
- package/dist/menu/menu-item.mjs.map +1 -1
- package/dist/menu/menu-outside.mjs +1 -2
- package/dist/menu/menu-point.mjs +1 -2
- package/dist/menu/menu-popup.d.mts +2 -4
- package/dist/menu/menu-popup.d.mts.map +1 -1
- package/dist/menu/menu-popup.mjs +45 -19
- package/dist/menu/menu-popup.mjs.map +1 -1
- package/dist/menu/menu-radio-group.d.mts +1 -3
- package/dist/menu/menu-radio-group.d.mts.map +1 -1
- package/dist/menu/menu-radio-group.mjs +3 -4
- package/dist/menu/menu-radio-item.d.mts +1 -3
- package/dist/menu/menu-radio-item.d.mts.map +1 -1
- package/dist/menu/menu-radio-item.mjs +2 -3
- package/dist/menu/menu-root.d.mts +1 -3
- package/dist/menu/menu-root.d.mts.map +1 -1
- package/dist/menu/menu-root.mjs +4 -5
- package/dist/menu/menu-submenu-trigger.d.mts +1 -3
- package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
- package/dist/menu/menu-submenu-trigger.mjs +5 -6
- package/dist/menu/menu-trigger.d.mts +11 -6
- package/dist/menu/menu-trigger.d.mts.map +1 -1
- package/dist/menu/menu-trigger.mjs +56 -9
- package/dist/menu/menu-trigger.mjs.map +1 -1
- package/dist/menu/use-menu-item.mjs +2 -3
- package/dist/menu/use-menu-keyboard.mjs +2 -3
- package/dist/menubar/index.d.mts +3 -0
- package/dist/menubar/index.mjs +1 -0
- package/dist/menubar/menubar.d.mts +47 -0
- package/dist/menubar/menubar.d.mts.map +1 -0
- package/dist/menubar/menubar.mjs +146 -0
- package/dist/menubar/menubar.mjs.map +1 -0
- package/dist/meter/index.d.mts +1 -3
- package/dist/meter/index.d.mts.map +1 -1
- package/dist/meter/index.mjs +1 -2
- package/dist/meter/meter-context.mjs +1 -2
- package/dist/meter/meter-indicator.d.mts +1 -3
- package/dist/meter/meter-indicator.d.mts.map +1 -1
- package/dist/meter/meter-indicator.mjs +1 -2
- package/dist/meter/meter-label.d.mts +1 -3
- package/dist/meter/meter-label.d.mts.map +1 -1
- package/dist/meter/meter-label.mjs +1 -2
- package/dist/meter/meter-region.d.mts +0 -2
- package/dist/meter/meter-region.d.mts.map +1 -1
- package/dist/meter/meter-region.mjs +1 -2
- package/dist/meter/meter-root.d.mts +4 -5
- package/dist/meter/meter-root.d.mts.map +1 -1
- package/dist/meter/meter-root.mjs +4 -5
- package/dist/meter/meter-root.mjs.map +1 -1
- package/dist/meter/meter-track.d.mts +1 -3
- package/dist/meter/meter-track.d.mts.map +1 -1
- package/dist/meter/meter-track.mjs +1 -2
- package/dist/meter/meter-value.d.mts +1 -3
- package/dist/meter/meter-value.d.mts.map +1 -1
- package/dist/meter/meter-value.mjs +1 -2
- package/dist/multi-select/index.d.mts +1 -3
- package/dist/multi-select/index.d.mts.map +1 -1
- package/dist/multi-select/index.mjs +1 -2
- package/dist/multi-select/multi-select-context.mjs +1 -2
- package/dist/multi-select/multi-select-group.d.mts +1 -3
- package/dist/multi-select/multi-select-group.d.mts.map +1 -1
- package/dist/multi-select/multi-select-group.mjs +2 -3
- package/dist/multi-select/multi-select-keyboard.mjs +1 -2
- package/dist/multi-select/multi-select-label.d.mts +1 -3
- package/dist/multi-select/multi-select-label.d.mts.map +1 -1
- package/dist/multi-select/multi-select-label.mjs +2 -3
- package/dist/multi-select/multi-select-list.d.mts +1 -3
- package/dist/multi-select/multi-select-list.d.mts.map +1 -1
- package/dist/multi-select/multi-select-list.mjs +3 -4
- package/dist/multi-select/multi-select-option.d.mts +1 -3
- package/dist/multi-select/multi-select-option.d.mts.map +1 -1
- package/dist/multi-select/multi-select-option.mjs +3 -4
- package/dist/multi-select/multi-select-popup.d.mts +1 -3
- package/dist/multi-select/multi-select-popup.d.mts.map +1 -1
- package/dist/multi-select/multi-select-popup.mjs +5 -6
- package/dist/multi-select/multi-select-root.d.mts +1 -3
- package/dist/multi-select/multi-select-root.d.mts.map +1 -1
- package/dist/multi-select/multi-select-root.mjs +11 -12
- package/dist/multi-select/multi-select-trigger.d.mts +1 -3
- package/dist/multi-select/multi-select-trigger.d.mts.map +1 -1
- package/dist/multi-select/multi-select-trigger.mjs +7 -8
- package/dist/multi-select/multi-select-value.d.mts +1 -3
- package/dist/multi-select/multi-select-value.d.mts.map +1 -1
- package/dist/multi-select/multi-select-value.mjs +1 -2
- package/dist/navigation-menu/index.d.mts +30 -0
- package/dist/navigation-menu/index.d.mts.map +1 -0
- package/dist/navigation-menu/index.mjs +31 -0
- package/dist/navigation-menu/index.mjs.map +1 -0
- package/dist/navigation-menu/navigation-menu-context.mjs +18 -0
- package/dist/navigation-menu/navigation-menu-context.mjs.map +1 -0
- package/dist/navigation-menu/navigation-menu-item.d.mts +77 -0
- package/dist/navigation-menu/navigation-menu-item.d.mts.map +1 -0
- package/dist/navigation-menu/navigation-menu-item.mjs +79 -0
- package/dist/navigation-menu/navigation-menu-item.mjs.map +1 -0
- package/dist/navigation-menu/navigation-menu-link.d.mts +46 -0
- package/dist/navigation-menu/navigation-menu-link.d.mts.map +1 -0
- package/dist/navigation-menu/navigation-menu-link.mjs +65 -0
- package/dist/navigation-menu/navigation-menu-link.mjs.map +1 -0
- package/dist/navigation-menu/navigation-menu-list.d.mts +31 -0
- package/dist/navigation-menu/navigation-menu-list.d.mts.map +1 -0
- package/dist/navigation-menu/navigation-menu-list.mjs +29 -0
- package/dist/navigation-menu/navigation-menu-list.mjs.map +1 -0
- package/dist/navigation-menu/navigation-menu-popup.d.mts +100 -0
- package/dist/navigation-menu/navigation-menu-popup.d.mts.map +1 -0
- package/dist/navigation-menu/navigation-menu-popup.mjs +92 -0
- package/dist/navigation-menu/navigation-menu-popup.mjs.map +1 -0
- package/dist/navigation-menu/navigation-menu-root.d.mts +31 -0
- package/dist/navigation-menu/navigation-menu-root.d.mts.map +1 -0
- package/dist/navigation-menu/navigation-menu-root.mjs +26 -0
- package/dist/navigation-menu/navigation-menu-root.mjs.map +1 -0
- package/dist/navigation-menu/navigation-menu-trigger.d.mts +30 -0
- package/dist/navigation-menu/navigation-menu-trigger.d.mts.map +1 -0
- package/dist/navigation-menu/navigation-menu-trigger.mjs +41 -0
- package/dist/navigation-menu/navigation-menu-trigger.mjs.map +1 -0
- package/dist/number-field/index.d.mts +2 -4
- package/dist/number-field/index.d.mts.map +1 -1
- package/dist/number-field/index.mjs +1 -2
- package/dist/number-field/number-field-arithmetic.mjs +1 -2
- package/dist/number-field/number-field-context.d.mts +1 -3
- package/dist/number-field/number-field-context.d.mts.map +1 -1
- package/dist/number-field/number-field-context.mjs +1 -2
- package/dist/number-field/number-field-decrement.d.mts +0 -2
- package/dist/number-field/number-field-decrement.d.mts.map +1 -1
- package/dist/number-field/number-field-decrement.mjs +1 -2
- package/dist/number-field/number-field-format.mjs +1 -2
- package/dist/number-field/number-field-increment.d.mts +0 -2
- package/dist/number-field/number-field-increment.d.mts.map +1 -1
- package/dist/number-field/number-field-increment.mjs +1 -2
- package/dist/number-field/number-field-input.d.mts +1 -3
- package/dist/number-field/number-field-input.d.mts.map +1 -1
- package/dist/number-field/number-field-input.mjs +4 -5
- package/dist/number-field/number-field-label.d.mts +1 -3
- package/dist/number-field/number-field-label.d.mts.map +1 -1
- package/dist/number-field/number-field-label.mjs +3 -4
- package/dist/number-field/number-field-root.d.mts +1 -3
- package/dist/number-field/number-field-root.d.mts.map +1 -1
- package/dist/number-field/number-field-root.mjs +7 -8
- package/dist/number-field/number-field-root.mjs.map +1 -1
- package/dist/number-field/use-number-field-dev-warnings.mjs +2 -3
- package/dist/number-field/use-step-button.d.mts +1 -3
- package/dist/number-field/use-step-button.d.mts.map +1 -1
- package/dist/number-field/use-step-button.mjs +2 -3
- package/dist/otp-field/index.d.mts +2 -4
- package/dist/otp-field/index.d.mts.map +1 -1
- package/dist/otp-field/index.mjs +1 -2
- package/dist/otp-field/otp-field-context.mjs +1 -2
- package/dist/otp-field/otp-field-filter.d.mts +0 -2
- package/dist/otp-field/otp-field-filter.d.mts.map +1 -1
- package/dist/otp-field/otp-field-filter.mjs +1 -2
- package/dist/otp-field/otp-field-input.d.mts +1 -3
- package/dist/otp-field/otp-field-input.d.mts.map +1 -1
- package/dist/otp-field/otp-field-input.mjs +6 -7
- package/dist/otp-field/otp-field-root.d.mts +10 -3
- package/dist/otp-field/otp-field-root.d.mts.map +1 -1
- package/dist/otp-field/otp-field-root.mjs +15 -13
- package/dist/otp-field/otp-field-root.mjs.map +1 -1
- package/dist/otp-field/otp-field-slot.d.mts +1 -3
- package/dist/otp-field/otp-field-slot.d.mts.map +1 -1
- package/dist/otp-field/otp-field-slot.mjs +2 -3
- package/dist/popover/index.d.mts +1 -3
- package/dist/popover/index.d.mts.map +1 -1
- package/dist/popover/index.mjs +1 -2
- package/dist/popover/popover-close.d.mts +10 -6
- package/dist/popover/popover-close.d.mts.map +1 -1
- package/dist/popover/popover-close.mjs +3 -3
- package/dist/popover/popover-close.mjs.map +1 -1
- package/dist/popover/popover-context.mjs +1 -2
- package/dist/popover/popover-description.d.mts +1 -3
- package/dist/popover/popover-description.d.mts.map +1 -1
- package/dist/popover/popover-description.mjs +1 -2
- package/dist/popover/popover-popup.d.mts +2 -4
- package/dist/popover/popover-popup.d.mts.map +1 -1
- package/dist/popover/popover-popup.mjs +4 -5
- package/dist/popover/popover-root.d.mts +1 -3
- package/dist/popover/popover-root.d.mts.map +1 -1
- package/dist/popover/popover-root.mjs +2 -3
- package/dist/popover/popover-title.d.mts +1 -3
- package/dist/popover/popover-title.d.mts.map +1 -1
- package/dist/popover/popover-title.mjs +1 -2
- package/dist/popover/popover-trigger.d.mts +1 -3
- package/dist/popover/popover-trigger.d.mts.map +1 -1
- package/dist/popover/popover-trigger.mjs +2 -3
- package/dist/progress/index.d.mts +1 -3
- package/dist/progress/index.d.mts.map +1 -1
- package/dist/progress/index.mjs +1 -2
- package/dist/progress/progress-context.mjs +1 -2
- package/dist/progress/progress-indicator.d.mts +1 -3
- package/dist/progress/progress-indicator.d.mts.map +1 -1
- package/dist/progress/progress-indicator.mjs +1 -2
- package/dist/progress/progress-label.d.mts +1 -3
- package/dist/progress/progress-label.d.mts.map +1 -1
- package/dist/progress/progress-label.mjs +1 -2
- package/dist/progress/progress-root.d.mts +4 -5
- package/dist/progress/progress-root.d.mts.map +1 -1
- package/dist/progress/progress-root.mjs +4 -5
- package/dist/progress/progress-root.mjs.map +1 -1
- package/dist/progress/progress-track.d.mts +1 -3
- package/dist/progress/progress-track.d.mts.map +1 -1
- package/dist/progress/progress-track.mjs +1 -2
- package/dist/progress/progress-value.d.mts +1 -3
- package/dist/progress/progress-value.d.mts.map +1 -1
- package/dist/progress/progress-value.mjs +1 -2
- package/dist/radio-group/index.d.mts +1 -3
- package/dist/radio-group/index.d.mts.map +1 -1
- package/dist/radio-group/index.mjs +1 -2
- package/dist/radio-group/radio-group-context.mjs +1 -2
- package/dist/radio-group/radio-group-item.d.mts +1 -3
- package/dist/radio-group/radio-group-item.d.mts.map +1 -1
- package/dist/radio-group/radio-group-item.mjs +3 -4
- package/dist/radio-group/radio-group-label.d.mts +1 -3
- package/dist/radio-group/radio-group-label.d.mts.map +1 -1
- package/dist/radio-group/radio-group-label.mjs +1 -2
- package/dist/radio-group/radio-group-root.d.mts +1 -3
- package/dist/radio-group/radio-group-root.d.mts.map +1 -1
- package/dist/radio-group/radio-group-root.mjs +4 -5
- package/dist/select/index.d.mts +1 -3
- package/dist/select/index.d.mts.map +1 -1
- package/dist/select/index.mjs +1 -2
- package/dist/select/select-context.mjs +1 -2
- package/dist/select/select-dom.mjs +2 -3
- package/dist/select/select-group-label.d.mts +1 -3
- package/dist/select/select-group-label.d.mts.map +1 -1
- package/dist/select/select-group-label.mjs +1 -2
- package/dist/select/select-group.d.mts +1 -3
- package/dist/select/select-group.d.mts.map +1 -1
- package/dist/select/select-group.mjs +2 -3
- package/dist/select/select-option.d.mts +1 -3
- package/dist/select/select-option.d.mts.map +1 -1
- package/dist/select/select-option.mjs +3 -4
- package/dist/select/select-root.d.mts +1 -3
- package/dist/select/select-root.d.mts.map +1 -1
- package/dist/select/select-root.mjs +6 -7
- package/dist/select/select-separator.d.mts +1 -3
- package/dist/select/select-separator.d.mts.map +1 -1
- package/dist/select/select-separator.mjs +1 -2
- package/dist/select/select-trigger.d.mts +1 -3
- package/dist/select/select-trigger.d.mts.map +1 -1
- package/dist/select/select-trigger.mjs +1 -2
- package/dist/select/select-value.d.mts +1 -3
- package/dist/select/select-value.d.mts.map +1 -1
- package/dist/select/select-value.mjs +3 -4
- package/dist/select/select-value.mjs.map +1 -1
- package/dist/separator/separator.d.mts +1 -3
- package/dist/separator/separator.d.mts.map +1 -1
- package/dist/separator/separator.mjs +1 -2
- package/dist/slider/index.d.mts +2 -4
- package/dist/slider/index.d.mts.map +1 -1
- package/dist/slider/index.mjs +1 -2
- package/dist/slider/slider-arithmetic.mjs +1 -2
- package/dist/slider/slider-context.mjs +1 -2
- package/dist/slider/slider-indicator.d.mts +1 -3
- package/dist/slider/slider-indicator.d.mts.map +1 -1
- package/dist/slider/slider-indicator.mjs +1 -2
- package/dist/slider/slider-label.d.mts +1 -3
- package/dist/slider/slider-label.d.mts.map +1 -1
- package/dist/slider/slider-label.mjs +3 -4
- package/dist/slider/slider-root.d.mts +1 -3
- package/dist/slider/slider-root.d.mts.map +1 -1
- package/dist/slider/slider-root.mjs +8 -9
- package/dist/slider/slider-thumb.d.mts +1 -3
- package/dist/slider/slider-thumb.d.mts.map +1 -1
- package/dist/slider/slider-thumb.mjs +5 -6
- package/dist/slider/slider-track.d.mts +1 -3
- package/dist/slider/slider-track.d.mts.map +1 -1
- package/dist/slider/slider-track.mjs +2 -3
- package/dist/slider/slider-value.d.mts +1 -3
- package/dist/slider/slider-value.d.mts.map +1 -1
- package/dist/slider/slider-value.mjs +1 -2
- package/dist/slider/use-slider-dev-warnings.mjs +2 -3
- package/dist/slider/use-thumb-registry.mjs +1 -2
- package/dist/switch/switch.d.mts +1 -3
- package/dist/switch/switch.d.mts.map +1 -1
- package/dist/switch/switch.mjs +2 -3
- package/dist/tabs/index.d.mts +0 -2
- package/dist/tabs/index.d.mts.map +1 -1
- package/dist/tabs/index.mjs +1 -2
- package/dist/tabs/tabs-context.d.mts +0 -2
- package/dist/tabs/tabs-context.d.mts.map +1 -1
- package/dist/tabs/tabs-context.mjs +1 -2
- package/dist/tabs/tabs-ids.mjs +1 -2
- package/dist/tabs/tabs-indicator.d.mts +1 -3
- package/dist/tabs/tabs-indicator.d.mts.map +1 -1
- package/dist/tabs/tabs-indicator.mjs +1 -2
- package/dist/tabs/tabs-list.d.mts +1 -3
- package/dist/tabs/tabs-list.d.mts.map +1 -1
- package/dist/tabs/tabs-list.mjs +4 -5
- package/dist/tabs/tabs-panel.d.mts +1 -3
- package/dist/tabs/tabs-panel.d.mts.map +1 -1
- package/dist/tabs/tabs-panel.mjs +4 -5
- package/dist/tabs/tabs-root.d.mts +1 -3
- package/dist/tabs/tabs-root.d.mts.map +1 -1
- package/dist/tabs/tabs-root.mjs +5 -6
- package/dist/tabs/tabs-tab.d.mts +1 -3
- package/dist/tabs/tabs-tab.d.mts.map +1 -1
- package/dist/tabs/tabs-tab.mjs +3 -4
- package/dist/tabs/use-until-found.mjs +1 -2
- package/dist/toast/index.d.mts +2 -4
- package/dist/toast/index.d.mts.map +1 -1
- package/dist/toast/index.mjs +2 -3
- package/dist/toast/toast-action.d.mts +1 -3
- package/dist/toast/toast-action.d.mts.map +1 -1
- package/dist/toast/toast-action.mjs +2 -3
- package/dist/toast/toast-close.d.mts +1 -3
- package/dist/toast/toast-close.d.mts.map +1 -1
- package/dist/toast/toast-close.mjs +2 -3
- package/dist/toast/toast-context.mjs +1 -2
- package/dist/toast/toast-description.d.mts +1 -3
- package/dist/toast/toast-description.d.mts.map +1 -1
- package/dist/toast/toast-description.mjs +2 -3
- package/dist/toast/toast-hotkey.mjs +1 -2
- package/dist/toast/toast-queue.mjs +1 -2
- package/dist/toast/toast-root.d.mts +1 -3
- package/dist/toast/toast-root.d.mts.map +1 -1
- package/dist/toast/toast-root.mjs +4 -5
- package/dist/toast/toast-root.mjs.map +1 -1
- package/dist/toast/toast-timers.mjs +1 -2
- package/dist/toast/toast-title.d.mts +1 -3
- package/dist/toast/toast-title.d.mts.map +1 -1
- package/dist/toast/toast-title.mjs +2 -3
- package/dist/toast/toast-viewport.d.mts +1 -3
- package/dist/toast/toast-viewport.d.mts.map +1 -1
- package/dist/toast/toast-viewport.mjs +9 -10
- package/dist/toast/toast.d.mts +1 -3
- package/dist/toast/toast.d.mts.map +1 -1
- package/dist/toast/toast.mjs +1 -2
- package/dist/toast/use-modal-portal-host.mjs +2 -3
- package/dist/toast/use-toast-announcements.mjs +2 -3
- package/dist/toast/use-toast-announcements.mjs.map +1 -1
- package/dist/toast/use-toast-focus.mjs +2 -3
- package/dist/toast/use-toast-pauses.mjs +2 -3
- package/dist/toggle/toggle.d.mts +1 -3
- package/dist/toggle/toggle.d.mts.map +1 -1
- package/dist/toggle/toggle.mjs +3 -4
- package/dist/toggle-group/index.d.mts +0 -2
- package/dist/toggle-group/index.d.mts.map +1 -1
- package/dist/toggle-group/index.mjs +1 -2
- package/dist/toggle-group/toggle-group-context.d.mts +0 -2
- package/dist/toggle-group/toggle-group-context.d.mts.map +1 -1
- package/dist/toggle-group/toggle-group-context.mjs +1 -2
- package/dist/toggle-group/toggle-group-item.d.mts +1 -3
- package/dist/toggle-group/toggle-group-item.d.mts.map +1 -1
- package/dist/toggle-group/toggle-group-item.mjs +2 -3
- package/dist/toggle-group/toggle-group-root.d.mts +1 -3
- package/dist/toggle-group/toggle-group-root.d.mts.map +1 -1
- package/dist/toggle-group/toggle-group-root.mjs +8 -9
- package/dist/toolbar/index.d.mts +0 -2
- package/dist/toolbar/index.d.mts.map +1 -1
- package/dist/toolbar/index.mjs +1 -2
- package/dist/toolbar/toolbar-root.d.mts +1 -3
- package/dist/toolbar/toolbar-root.d.mts.map +1 -1
- package/dist/toolbar/toolbar-root.mjs +3 -4
- package/dist/toolbar/toolbar-separator.d.mts +1 -3
- package/dist/toolbar/toolbar-separator.d.mts.map +1 -1
- package/dist/toolbar/toolbar-separator.mjs +1 -2
- package/dist/tooltip/index.d.mts +0 -2
- package/dist/tooltip/index.d.mts.map +1 -1
- package/dist/tooltip/index.mjs +1 -2
- package/dist/tooltip/tooltip-arrow.d.mts +1 -3
- package/dist/tooltip/tooltip-arrow.d.mts.map +1 -1
- package/dist/tooltip/tooltip-arrow.mjs +2 -3
- package/dist/tooltip/tooltip-context.d.mts +0 -2
- package/dist/tooltip/tooltip-context.d.mts.map +1 -1
- package/dist/tooltip/tooltip-context.mjs +1 -2
- package/dist/tooltip/tooltip-popup.d.mts +1 -3
- package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
- package/dist/tooltip/tooltip-popup.mjs +4 -5
- package/dist/tooltip/tooltip-root.d.mts +1 -3
- package/dist/tooltip/tooltip-root.d.mts.map +1 -1
- package/dist/tooltip/tooltip-root.mjs +2 -3
- package/dist/tooltip/tooltip-trigger.d.mts +1 -3
- package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
- package/dist/tooltip/tooltip-trigger.mjs +6 -7
- package/dist/tooltip/tooltip-warm.mjs +1 -2
- package/dist/tooltip/use-tooltip-interaction.mjs +2 -3
- package/package.json +11 -8
- package/skills/funstack-ui-knowledge/SKILL.md +5 -2
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useLatest } from "../use-latest.mjs";
|
|
3
|
-
import { useFormOwnerEvent } from "./use-form-owner-event.mjs";
|
|
4
2
|
import { useState } from "react";
|
|
5
|
-
|
|
3
|
+
import { useFormOwnerEvent } from "./use-form-owner-event.mjs";
|
|
4
|
+
import { afterDispatch } from "../after-dispatch.mjs";
|
|
5
|
+
import { useLatest } from "../use-latest.mjs";
|
|
6
|
+
// src/internal/form/use-form-reset.ts
|
|
6
7
|
/**
|
|
7
8
|
* Stable `reset` subscription on the form owner of `ref.current` (conventions 3.8).
|
|
8
9
|
*
|
|
9
10
|
* - Built on `useFormOwnerEvent`, with its owner-following rules (rule 4).
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* - `onReset` runs after every `reset` listener and after the reset algorithm, in both orders
|
|
12
|
+
* (rule 5): through `afterDispatch`, a microtask after a script `form.reset()` (React's own
|
|
13
|
+
* reset included), a task after a click on a `<button type="reset">`, whose microtask
|
|
14
|
+
* checkpoints run mid-dispatch. So it may read the DOM's reset state (validity, `FormData`,
|
|
15
|
+
* the selected option), and it is skipped when any listener cancelled the reset (rule 7).
|
|
13
16
|
* - `onReset` always sees the latest committed render's values.
|
|
14
17
|
*/
|
|
15
18
|
function useFormReset(ref, onReset, onResetEvent) {
|
|
16
19
|
const latestOnReset = useLatest(onReset);
|
|
17
20
|
useFormOwnerEvent(ref, "reset", (event) => {
|
|
18
21
|
onResetEvent?.(event);
|
|
19
|
-
|
|
22
|
+
afterDispatch(event, () => {
|
|
20
23
|
if (event.defaultPrevented) return;
|
|
21
24
|
latestOnReset.current(event);
|
|
22
25
|
});
|
|
@@ -33,7 +36,6 @@ function useResetTarget(value, defaultValue) {
|
|
|
33
36
|
const [mountValue] = useState(value);
|
|
34
37
|
return value !== void 0 ? mountValue : defaultValue;
|
|
35
38
|
}
|
|
36
|
-
//#endregion
|
|
37
39
|
export { useFormReset, useResetTarget };
|
|
38
40
|
|
|
39
41
|
//# sourceMappingURL=use-form-reset.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-form-reset.mjs","names":[],"sources":["../../../src/internal/form/use-form-reset.ts"],"sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport type { RefObject } from \"react\";\nimport { useFormOwnerEvent } from \"./use-form-owner-event.js\";\nimport
|
|
1
|
+
{"version":3,"file":"use-form-reset.mjs","names":[],"sources":["../../../src/internal/form/use-form-reset.ts"],"sourcesContent":["\"use client\";\nimport { useState } from \"react\";\nimport type { RefObject } from \"react\";\nimport { useFormOwnerEvent } from \"./use-form-owner-event.js\";\nimport { afterDispatch } from \"../after-dispatch.js\";\nimport { useLatest } from \"../use-latest.js\";\n\n/**\n * Stable `reset` subscription on the form owner of `ref.current` (conventions 3.8).\n *\n * - Built on `useFormOwnerEvent`, with its owner-following rules (rule 4).\n * - `onReset` runs after every `reset` listener and after the reset algorithm, in both orders\n * (rule 5): through `afterDispatch`, a microtask after a script `form.reset()` (React's own\n * reset included), a task after a click on a `<button type=\"reset\">`, whose microtask\n * checkpoints run mid-dispatch. So it may read the DOM's reset state (validity, `FormData`,\n * the selected option), and it is skipped when any listener cancelled the reset (rule 7).\n * - `onReset` always sees the latest committed render's values.\n */\nexport function useFormReset(\n /** A form-associated element (or one whose `form` the owner hook reads, as Field's control). */\n ref: RefObject<Element | null>,\n onReset: (event: Event) => void,\n /**\n * Called synchronously from the `reset` event, before the reset algorithm runs: the last\n * moment to write a reset target the browser will restore (Combobox re-applies its mirrored\n * `defaultValue`, which react-dom's attribute syncing overwrites after every keystroke).\n */\n onResetEvent?: (event: Event) => void,\n): void {\n // Read when the callback is due, after the commit that may have run the reset (React's own\n // reset runs in a commit's mutation phase): the latest committed `onReset`.\n const latestOnReset = useLatest(onReset);\n useFormOwnerEvent(ref, \"reset\", (event) => {\n onResetEvent?.(event);\n afterDispatch(event, () => {\n if (event.defaultPrevented) return;\n latestOnReset.current(event);\n });\n });\n}\n\n/**\n * The form-reset target of a value prop by mode (conventions 3.8 rule 6): controlled\n * (`value !== undefined`), the value it had at mount; uncontrolled, the latest `defaultValue`.\n * `undefined` when that is absent: an uncontrolled Root with no `defaultValue`, or a Root that\n * became controlled after it mounted uncontrolled. The caller supplies its own fallback\n * (`?? null`, `?? value`, a platform default).\n */\nexport function useResetTarget<T>(\n value: T | undefined,\n defaultValue: T | undefined,\n): T | undefined {\n const [mountValue] = useState(value);\n return value !== undefined ? mountValue : defaultValue;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,aAEd,KACA,SAMA,cACM;CAGN,MAAM,gBAAgB,UAAU,OAAO;CACvC,kBAAkB,KAAK,UAAU,UAAU;EACzC,eAAe,KAAK;EACpB,cAAc,aAAa;GACzB,IAAI,MAAM,kBAAkB;GAC5B,cAAc,QAAQ,KAAK;EAC7B,CAAC;CACH,CAAC;AACH;;;;;;;;AASA,SAAgB,eACd,OACA,cACe;CACf,MAAM,CAAC,cAAc,SAAS,KAAK;CACnC,OAAO,UAAU,KAAA,IAAY,aAAa;AAC5C"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useCallback, useEffectEvent, useLayoutEffect, useRef } from "react";
|
|
2
3
|
import { intendedValue } from "../action/use-controllable-action.mjs";
|
|
3
4
|
import { useElementCheck } from "../use-element-check.mjs";
|
|
4
5
|
import { useFormReset } from "./use-form-reset.mjs";
|
|
5
|
-
|
|
6
|
-
//#region src/internal/form/use-native-checked.ts
|
|
6
|
+
// src/internal/form/use-native-checked.ts
|
|
7
7
|
const isDev = process.env.NODE_ENV !== "production";
|
|
8
8
|
/**
|
|
9
9
|
* Per-element machinery for a controlled native `<input type="checkbox" | "radio">`
|
|
@@ -106,7 +106,6 @@ function guardCheckableChange(event, dispatch, component = "A checkable input")
|
|
|
106
106
|
}
|
|
107
107
|
console.error(`${component}: \`preventDefault()\` on the change event is not supported; it desyncs the input while the action is pending. Use controlled mode to veto a change.`);
|
|
108
108
|
}
|
|
109
|
-
//#endregion
|
|
110
109
|
export { guardCheckableChange, useNativeChecked };
|
|
111
110
|
|
|
112
111
|
//# sourceMappingURL=use-native-checked.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useLatest } from "../use-latest.mjs";
|
|
3
|
-
import { useFormReset } from "./use-form-reset.mjs";
|
|
4
2
|
import { useCallback, useEffectEvent, useLayoutEffect, useRef } from "react";
|
|
5
|
-
|
|
3
|
+
import { useFormReset } from "./use-form-reset.mjs";
|
|
4
|
+
import { useLatest } from "../use-latest.mjs";
|
|
5
|
+
// src/internal/form/use-native-group-reconciliation.ts
|
|
6
6
|
/**
|
|
7
7
|
* Group adapter of the native-input machinery (conventions 3.8): one dispatch per group for the
|
|
8
8
|
* residual browser paths, from the Root rather than once per member.
|
|
@@ -61,7 +61,6 @@ function useNativeGroupReconciliation(options) {
|
|
|
61
61
|
function reconcile(options, next, path, event) {
|
|
62
62
|
if (!(options.equals ?? Object.is)(next, options.base())) options.onPlatformChange(next, event, path);
|
|
63
63
|
}
|
|
64
|
-
//#endregion
|
|
65
64
|
export { useNativeGroupReconciliation };
|
|
66
65
|
|
|
67
66
|
//# sourceMappingURL=use-native-group-reconciliation.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useCallback, useEffectEvent, useLayoutEffect, useMemo, useRef } from "react";
|
|
2
3
|
import { useLatest } from "../use-latest.mjs";
|
|
3
4
|
import { useNativeGroupReconciliation } from "./use-native-group-reconciliation.mjs";
|
|
4
|
-
|
|
5
|
-
//#region src/internal/form/use-native-select-value.ts
|
|
5
|
+
// src/internal/form/use-native-select-value.ts
|
|
6
6
|
/** The first option whose value is `value` (react-dom's `updateOptions` selects the first). */
|
|
7
7
|
function findOption(select, value) {
|
|
8
8
|
for (const option of select.options) if (option.value === value) return option;
|
|
@@ -178,7 +178,6 @@ function useNativeSelectValue(options) {
|
|
|
178
178
|
onItemMounted
|
|
179
179
|
]) };
|
|
180
180
|
}
|
|
181
|
-
//#endregion
|
|
182
181
|
export { applySelection, findOption, implicitDefault, readResetValue, useNativeSelectValue };
|
|
183
182
|
|
|
184
183
|
//# sourceMappingURL=use-native-select-value.mjs.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/internal/form/validity.d.ts
|
|
2
1
|
/** A field error: a message, several messages, or nothing (`""`, `[]`, `null`, `undefined`). */
|
|
3
2
|
export type FieldErrorValue = string | readonly string[] | null | undefined;
|
|
4
3
|
/** Field errors keyed by field `name` (usually `state.errors` from `useActionState`). */
|
|
@@ -31,5 +30,4 @@ export interface FieldValidity {
|
|
|
31
30
|
/** No constraint is violated. */
|
|
32
31
|
readonly valid: boolean;
|
|
33
32
|
}
|
|
34
|
-
//#endregion
|
|
35
33
|
//# sourceMappingURL=validity.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validity.d.mts","names":[],"sources":["../../../src/internal/form/validity.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"validity.d.mts","names":[],"sources":["../../../src/internal/form/validity.ts"],"mappings":";YAIY;;YAGA,aAAa,SAAS,eAAe;;;;;iBAMhC;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/form/validity.ts
|
|
2
2
|
const VALIDITY_KEYS = [
|
|
3
3
|
"valueMissing",
|
|
4
4
|
"typeMismatch",
|
|
@@ -92,7 +92,6 @@ function focusTargetOf(el) {
|
|
|
92
92
|
const members = (el instanceof HTMLFieldSetElement ? [...el.elements] : [...el.querySelectorAll("input, select, textarea, button")]).filter((m) => m instanceof HTMLElement && !m.disabled && m.type !== "hidden");
|
|
93
93
|
return members.find((m) => m instanceof HTMLInputElement && m.type === "radio" && m.checked) ?? members.find((m) => isValidatable(m) && m.name !== "") ?? members.find(isValidatable) ?? members[0] ?? null;
|
|
94
94
|
}
|
|
95
|
-
//#endregion
|
|
96
95
|
export { VALID, focusTargetOf, hasAnyError, normaliseErrorValue, snapshotValidity, supportsUserInvalid, validityElementOf, validityEquals };
|
|
97
96
|
|
|
98
97
|
//# sourceMappingURL=validity.mjs.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, use } from "react";
|
|
3
|
+
// src/internal/menubar-context.ts
|
|
4
|
+
const MenubarContext = createContext(null);
|
|
5
|
+
/** The enclosing Menubar, or `null` outside one (and inside a `Menu.Popup`). */
|
|
6
|
+
function useMenubarContext() {
|
|
7
|
+
return use(MenubarContext);
|
|
8
|
+
}
|
|
9
|
+
export { MenubarContext, useMenubarContext };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=menubar-context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menubar-context.mjs","names":[],"sources":["../../src/internal/menubar-context.ts"],"sourcesContent":["\"use client\";\nimport { createContext, use } from \"react\";\n\n/**\n * Where focus goes when a switch opens a menu of the bar (design/components/menubar.md 2.2): the\n * first item (`\"first\"`, a switch from inside a menu), or nowhere (`\"none\"`: the arrow keys on a\n * Trigger and the pointer leave focus on the Trigger).\n */\nexport type MenubarOpenFocus = \"first\" | \"none\";\n\n/**\n * What a menu of the bar registers with it (menubar.md 2.1): read and called by the bar's\n * handlers only. Registered by `Menu.Trigger` from its ref callback, keyed by its element.\n */\nexport interface MenubarMenu {\n /** The `disabled` prop of the Trigger: focused by a switch, never opened. */\n readonly disabled: () => boolean;\n /** The menu's `intended()` (an open requested or shown). */\n readonly intended: () => boolean;\n /**\n * The browser hid the popup and its `toggle` has not arrived yet: the menu's own rule (Tab,\n * focus leaving the popup) already dismissed it, so there is nothing to supersede.\n */\n readonly hiddenBeforeToggle: () => boolean;\n /** The popup element (`:popover-open` tells whether it is shown). */\n readonly popup: () => HTMLElement | null;\n /** Request the open (`openChangeAction(true, \"activate\")`) with this focus target. */\n readonly open: (event: Event, focus: MenubarOpenFocus) => void;\n /** Supersede a pending open: `requestClose(event, \"dismiss\")`. */\n readonly supersede: (event: Event) => void;\n}\n\n/**\n * Provided by `Menubar`; read across folders by `Menu.Trigger` (an item of the bar, its\n * registration and the hover switch) and the top-level `Menu.Popup` (the arrow keys that switch\n * from inside a menu). A `Menu.Popup` provides `null` to its content: the bar's context ends\n * there, so a submenu is not a menu of the bar (menubar.md 1). Conventions 7.1.\n */\nexport interface MenubarContextValue {\n /** Register the menu whose Trigger is `trigger`; returns the unregistration. */\n readonly register: (trigger: HTMLElement, menu: MenubarMenu) => () => void;\n /**\n * The switch of menubar.md 2.2: focus `target` (quietly for the pointer), close the other\n * menus of the bar at once, request `target`'s open (unless it is disabled).\n */\n readonly switchTo: (\n target: HTMLElement,\n focus: MenubarOpenFocus,\n event: Event,\n pointer: boolean,\n ) => void;\n /**\n * From inside the menu whose Trigger is `from`: switch to the next (`1`) or previous (`-1`)\n * menu of the bar, first item focused. Wraps with the bar's `loop`. Returns whether it\n * switched (`false` at an end without `loop`, in a one-menu bar, or from a menu that is not\n * one of the bar's), so the caller consumes the key only then.\n */\n readonly step: (from: HTMLElement, delta: 1 | -1, event: Event) => boolean;\n /** Some menu of the bar other than `trigger`'s is intended open (menu mode, 2.1). */\n readonly otherIntended: (trigger: HTMLElement) => boolean;\n /** The bar's computed `direction` is `rtl`, read at the event (conventions 14.1). */\n readonly rtl: () => boolean;\n}\n\nexport const MenubarContext = createContext<MenubarContextValue | null>(null);\n\n/** The enclosing Menubar, or `null` outside one (and inside a `Menu.Popup`). */\nexport function useMenubarContext(): MenubarContextValue | null {\n return use(MenubarContext);\n}\n"],"mappings":";;;AAgEA,MAAa,iBAAiB,cAA0C,IAAI;;AAG5E,SAAgB,oBAAgD;CAC9D,OAAO,IAAI,cAAc;AAC3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/merge-props.ts
|
|
2
2
|
/**
|
|
3
3
|
* ARIA id-reference lists are merged as token lists rather than overridden (conventions 1.2), so
|
|
4
4
|
* a trigger can be described by more than the element the library wires it to.
|
|
@@ -113,7 +113,6 @@ function layer(under, over, overFirst, owned) {
|
|
|
113
113
|
function mergeProps(partProps, elementProps, libraryProps = {}) {
|
|
114
114
|
return layer(layer(partProps, elementProps, true, false), libraryProps, false, true);
|
|
115
115
|
}
|
|
116
|
-
//#endregion
|
|
117
116
|
export { mergeProps, mergeRefs, mergeTokenLists };
|
|
118
117
|
|
|
119
118
|
//# sourceMappingURL=merge-props.mjs.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/internal/overlay/anchor-position.d.ts
|
|
2
1
|
/** A physical side of the anchor. */
|
|
3
2
|
export type PhysicalSide = "top" | "bottom" | "left" | "right";
|
|
4
3
|
/**
|
|
@@ -11,5 +10,4 @@ export type AnchorSide = PhysicalSide | "inline-start" | "inline-end";
|
|
|
11
10
|
* inline-start edge meets the anchor's), the top / bottom edges on the others.
|
|
12
11
|
*/
|
|
13
12
|
export type AnchorAlign = "start" | "center" | "end";
|
|
14
|
-
//#endregion
|
|
15
13
|
//# sourceMappingURL=anchor-position.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-position.d.mts","names":[],"sources":["../../../src/internal/overlay/anchor-position.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"anchor-position.d.mts","names":[],"sources":["../../../src/internal/overlay/anchor-position.ts"],"mappings":";YAcY;;;;;YAKA,aAAa;;;;;YAKb"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/overlay/anchor-position.ts
|
|
2
2
|
/** Flip to the opposite side, then the other axis, then both, when the popup does not fit. */
|
|
3
3
|
const POSITION_TRY_FALLBACKS = "flip-block, flip-inline, flip-block flip-inline";
|
|
4
4
|
const SIDE_KEYWORD = {
|
|
@@ -126,7 +126,6 @@ function physicalOf(name, index, count, selfDirection, rootDirection) {
|
|
|
126
126
|
function inlineEdge(edge, direction) {
|
|
127
127
|
return edge === "start" === (direction === "ltr") ? "left" : "right";
|
|
128
128
|
}
|
|
129
|
-
//#endregion
|
|
130
129
|
export { POSITION_TRY_FALLBACKS, parsePositionArea, positionArea };
|
|
131
130
|
|
|
132
131
|
//# sourceMappingURL=anchor-position.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback, useLayoutEffect, useRef } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/internal/overlay/content-focus-probe.tsx
|
|
5
5
|
/**
|
|
6
6
|
* Records, from its layout-effect cleanup, whether focus is inside the popup when the content
|
|
7
7
|
* goes away: React runs a deleted component's layout cleanups before it detaches the host nodes,
|
|
@@ -36,7 +36,6 @@ function useContentFocusProbe(popupRef) {
|
|
|
36
36
|
}, [])
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
export { useContentFocusProbe };
|
|
41
40
|
|
|
42
41
|
//# sourceMappingURL=content-focus-probe.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/overlay/css-transition-cut.ts
|
|
2
2
|
/** What `transition: none` sets, each restored on its own. */
|
|
3
3
|
const LONGHANDS = [
|
|
4
4
|
"transition-property",
|
|
@@ -60,7 +60,6 @@ function withCssTransitionCut(element, hasTransition, run) {
|
|
|
60
60
|
cutting.delete(element);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
//#endregion
|
|
64
63
|
export { withCssTransitionCut };
|
|
65
64
|
|
|
66
65
|
//# sourceMappingURL=css-transition-cut.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-transition-cut.mjs","names":[],"sources":["../../../src/internal/overlay/css-transition-cut.ts"],"sourcesContent":["// No directive: a DOM helper (conventions 7.1).\n\n/** What `transition: none` sets, each restored on its own. */\nconst LONGHANDS = [\n \"transition-property\",\n \"transition-duration\",\n \"transition-timing-function\",\n \"transition-delay\",\n \"transition-behavior\",\n] as const;\n\n/** Elements inside a cut right now: a nested call (Menu's `reshow`) runs inside the outer one. */\nconst cutting = new WeakSet<HTMLElement>();\n\n/** Whether a document view transition is running (`html:active-view-transition`). */\nfunction viewTransitionActive(element: HTMLElement): boolean {\n try {\n return element.ownerDocument.documentElement.matches(\":active-view-transition\");\n } catch {\n // An engine (or jsdom) that does not know the pseudo-class has no view transition to avoid.\n return false;\n }\n}\n\n/**\n * Runs the library's own show or hide of a popup (`showPopover()`, `hidePopover()`,\n * `showModal()`, `show()`, `close()`) with the popup's CSS transitions cut, when the Popup has a\n * `transition` prop and a view transition is running (conventions 5.1, issue #147). The view\n * transition animates that show or hide; a CSS `transition` on the popup would run next to it\n * (the open's `@starting-style` enter under the view transition's enter; in Chromium the close's\n * `display` / `overlay` fade keeps the hidden box in the new snapshot, a double image).\n *\n * One synchronous step: an inline `transition: none !important`, the call, a forced style\n * recalculation (without it Chromium sees the restored value and the fade runs), and the inline\n * `transition` longhands restored as they were, so nothing is left for React's `style` diffing.\n * Everything goes through CSSOM, never the `style` attribute: a CSP without `'unsafe-inline'`\n * for styles blocks an attribute write (React's `style` prop is CSSOM too). Only CSS\n * transitions are cut, not a `@keyframes` animation. Dismissals (Escape, light dismiss) never\n * come here: their CSS exit plays.\n */\nexport function withCssTransitionCut<T>(\n element: HTMLElement,\n hasTransition: boolean,\n run: () => T,\n): T {\n if (!hasTransition || cutting.has(element) || !viewTransitionActive(element)) return run();\n const { style } = element;\n const hadAttribute = element.hasAttribute(\"style\");\n // The shorthand, and the longhands for a consumer who set only some of them (the shorthand\n // then reads as \"\").\n const shorthand = style.getPropertyValue(\"transition\");\n const shorthandPriority = style.getPropertyPriority(\"transition\");\n const longhands = LONGHANDS.map(\n (name) => [name, style.getPropertyValue(name), style.getPropertyPriority(name)] as const,\n );\n cutting.add(element);\n style.setProperty(\"transition\", \"none\", \"important\");\n try {\n return run();\n } finally {\n // The show or hide's style change is processed while the cut is in place.\n void getComputedStyle(element).opacity;\n // Only while the cut is still ours: a listener inside the call that wrote its own\n // `transition` keeps it.\n const ours = (name: string) =>\n style.getPropertyValue(name) === \"none\" && style.getPropertyPriority(name) === \"important\";\n if (ours(\"transition-property\") || ours(\"transition\")) {\n style.removeProperty(\"transition\");\n if (shorthand !== \"\") {\n style.setProperty(\"transition\", shorthand, shorthandPriority);\n } else {\n for (const [name, value, priority] of longhands) {\n if (value !== \"\") style.setProperty(name, value, priority);\n }\n }\n }\n // `removeAttribute` parses nothing, so CSP does not block it.\n if (!hadAttribute && style.length === 0) element.removeAttribute(\"style\");\n cutting.delete(element);\n }\n}\n"],"mappings":";;AAGA,MAAM,YAAY;CAChB;CACA;CACA;CACA;CACA;AACF;;AAGA,MAAM,0BAAU,IAAI,QAAqB;;AAGzC,SAAS,qBAAqB,SAA+B;CAC3D,IAAI;EACF,OAAO,QAAQ,cAAc,gBAAgB,QAAQ,yBAAyB;CAChF,QAAQ;EAEN,OAAO;CACT;AACF;;;;;;;;;;;;;;;;;AAkBA,SAAgB,qBACd,SACA,eACA,KACG;CACH,IAAI,CAAC,iBAAiB,QAAQ,IAAI,OAAO,KAAK,CAAC,qBAAqB,OAAO,GAAG,OAAO,IAAI;CACzF,MAAM,EAAE,UAAU;CAClB,MAAM,eAAe,QAAQ,aAAa,OAAO;CAGjD,MAAM,YAAY,MAAM,iBAAiB,YAAY;CACrD,MAAM,oBAAoB,MAAM,oBAAoB,YAAY;CAChE,MAAM,YAAY,UAAU,KACzB,SAAS;EAAC;EAAM,MAAM,iBAAiB,IAAI;EAAG,MAAM,oBAAoB,IAAI;CAAC,CAChF;CACA,QAAQ,IAAI,OAAO;CACnB,MAAM,YAAY,cAAc,QAAQ,WAAW;CACnD,IAAI;EACF,OAAO,IAAI;CACb,UAAU;
|
|
1
|
+
{"version":3,"file":"css-transition-cut.mjs","names":[],"sources":["../../../src/internal/overlay/css-transition-cut.ts"],"sourcesContent":["// No directive: a DOM helper (conventions 7.1).\n\n/** What `transition: none` sets, each restored on its own. */\nconst LONGHANDS = [\n \"transition-property\",\n \"transition-duration\",\n \"transition-timing-function\",\n \"transition-delay\",\n \"transition-behavior\",\n] as const;\n\n/** Elements inside a cut right now: a nested call (Menu's `reshow`) runs inside the outer one. */\nconst cutting = new WeakSet<HTMLElement>();\n\n/** Whether a document view transition is running (`html:active-view-transition`). */\nfunction viewTransitionActive(element: HTMLElement): boolean {\n try {\n return element.ownerDocument.documentElement.matches(\":active-view-transition\");\n } catch {\n // An engine (or jsdom) that does not know the pseudo-class has no view transition to avoid.\n return false;\n }\n}\n\n/**\n * Runs the library's own show or hide of a popup (`showPopover()`, `hidePopover()`,\n * `showModal()`, `show()`, `close()`) with the popup's CSS transitions cut, when the Popup has a\n * `transition` prop and a view transition is running (conventions 5.1, issue #147). The view\n * transition animates that show or hide; a CSS `transition` on the popup would run next to it\n * (the open's `@starting-style` enter under the view transition's enter; in Chromium the close's\n * `display` / `overlay` fade keeps the hidden box in the new snapshot, a double image).\n *\n * One synchronous step: an inline `transition: none !important`, the call, a forced style\n * recalculation (without it Chromium sees the restored value and the fade runs), and the inline\n * `transition` longhands restored as they were, so nothing is left for React's `style` diffing.\n * Everything goes through CSSOM, never the `style` attribute: a CSP without `'unsafe-inline'`\n * for styles blocks an attribute write (React's `style` prop is CSSOM too). Only CSS\n * transitions are cut, not a `@keyframes` animation. Dismissals (Escape, light dismiss) never\n * come here: their CSS exit plays.\n */\nexport function withCssTransitionCut<T>(\n element: HTMLElement,\n hasTransition: boolean,\n run: () => T,\n): T {\n if (!hasTransition || cutting.has(element) || !viewTransitionActive(element)) return run();\n const { style } = element;\n const hadAttribute = element.hasAttribute(\"style\");\n // The shorthand, and the longhands for a consumer who set only some of them (the shorthand\n // then reads as \"\").\n const shorthand = style.getPropertyValue(\"transition\");\n const shorthandPriority = style.getPropertyPriority(\"transition\");\n const longhands = LONGHANDS.map(\n (name) => [name, style.getPropertyValue(name), style.getPropertyPriority(name)] as const,\n );\n cutting.add(element);\n style.setProperty(\"transition\", \"none\", \"important\");\n try {\n return run();\n } finally {\n // The show or hide's style change is processed while the cut is in place.\n void getComputedStyle(element).opacity;\n // Only while the cut is still ours: a listener inside the call that wrote its own\n // `transition` keeps it.\n const ours = (name: string) =>\n style.getPropertyValue(name) === \"none\" && style.getPropertyPriority(name) === \"important\";\n if (ours(\"transition-property\") || ours(\"transition\")) {\n style.removeProperty(\"transition\");\n if (shorthand !== \"\") {\n style.setProperty(\"transition\", shorthand, shorthandPriority);\n } else {\n for (const [name, value, priority] of longhands) {\n if (value !== \"\") style.setProperty(name, value, priority);\n }\n }\n }\n // `removeAttribute` parses nothing, so CSP does not block it.\n if (!hadAttribute && style.length === 0) element.removeAttribute(\"style\");\n cutting.delete(element);\n }\n}\n"],"mappings":";;AAGA,MAAM,YAAY;CAChB;CACA;CACA;CACA;CACA;AACF;;AAGA,MAAM,0BAAU,IAAI,QAAqB;;AAGzC,SAAS,qBAAqB,SAA+B;CAC3D,IAAI;EACF,OAAO,QAAQ,cAAc,gBAAgB,QAAQ,yBAAyB;CAChF,QAAQ;EAEN,OAAO;CACT;AACF;;;;;;;;;;;;;;;;;AAkBA,SAAgB,qBACd,SACA,eACA,KACG;CACH,IAAI,CAAC,iBAAiB,QAAQ,IAAI,OAAO,KAAK,CAAC,qBAAqB,OAAO,GAAG,OAAO,IAAI;CACzF,MAAM,EAAE,UAAU;CAClB,MAAM,eAAe,QAAQ,aAAa,OAAO;CAGjD,MAAM,YAAY,MAAM,iBAAiB,YAAY;CACrD,MAAM,oBAAoB,MAAM,oBAAoB,YAAY;CAChE,MAAM,YAAY,UAAU,KACzB,SAAS;EAAC;EAAM,MAAM,iBAAiB,IAAI;EAAG,MAAM,oBAAoB,IAAI;CAAC,CAChF;CACA,QAAQ,IAAI,OAAO;CACnB,MAAM,YAAY,cAAc,QAAQ,WAAW;CACnD,IAAI;EACF,OAAO,IAAI;CACb,UAAU;EAEH,iBAAiB,OAAO,CAAC,CAAC;EAG/B,MAAM,QAAQ,SACZ,MAAM,iBAAiB,IAAI,MAAM,UAAU,MAAM,oBAAoB,IAAI,MAAM;EACjF,IAAI,KAAK,qBAAqB,KAAK,KAAK,YAAY,GAAG;GACrD,MAAM,eAAe,YAAY;GACjC,IAAI,cAAc,IAChB,MAAM,YAAY,cAAc,WAAW,iBAAiB;QAE5D,KAAK,MAAM,CAAC,MAAM,OAAO,aAAa,WACpC,IAAI,UAAU,IAAI,MAAM,YAAY,MAAM,OAAO,QAAQ;EAG/D;EAEA,IAAI,CAAC,gBAAgB,MAAM,WAAW,GAAG,QAAQ,gBAAgB,OAAO;EACxE,QAAQ,OAAO,OAAO;CACxB;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/overlay/focus-visible.ts
|
|
2
2
|
let focusVisibleOption;
|
|
3
3
|
/**
|
|
4
4
|
* The engine reads the `focusVisible` member of `focus()`'s options (Chromium 145, Firefox 104,
|
|
@@ -20,7 +20,6 @@ function supportsFocusVisibleOption(doc) {
|
|
|
20
20
|
}
|
|
21
21
|
return focusVisibleOption;
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { supportsFocusVisibleOption };
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=focus-visible.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/overlay/invokers.ts
|
|
2
2
|
/**
|
|
3
3
|
* The `source` of a `ToggleEvent` (Chromium 140, Firefox 145, Safari 26.5), a `CommandEvent` or
|
|
4
4
|
* an `InterestEvent`: the invoker that caused it, `null` without one. Not in TypeScript's DOM lib
|
|
@@ -57,7 +57,6 @@ function listenInvokerPresses(popup) {
|
|
|
57
57
|
doc.addEventListener("mousedown", onMouseDown, true);
|
|
58
58
|
return () => doc.removeEventListener("mousedown", onMouseDown, true);
|
|
59
59
|
}
|
|
60
|
-
//#endregion
|
|
61
60
|
export { closedByPopoverTarget, eventSource, isPopoverInvoker, listenInvokerPresses };
|
|
62
61
|
|
|
63
62
|
//# sourceMappingURL=invokers.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/overlay/modal-registry.ts
|
|
2
2
|
const stack = [];
|
|
3
3
|
const listeners = /* @__PURE__ */ new Set();
|
|
4
4
|
function notify() {
|
|
@@ -33,7 +33,6 @@ function getTopmostModal() {
|
|
|
33
33
|
function getServerTopmostModal() {
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
|
-
//#endregion
|
|
37
36
|
export { getServerTopmostModal, getTopmostModal, pushModal, removeModal, subscribeModals };
|
|
38
37
|
|
|
39
38
|
//# sourceMappingURL=modal-registry.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { Activity, useRef, useState } from "react";
|
|
2
3
|
import { ToolbarContext } from "../toolbar-context.mjs";
|
|
3
4
|
import { useDevWarning } from "../use-dev-warning.mjs";
|
|
4
5
|
import { useExitAnimation } from "./use-exit-animation.mjs";
|
|
5
|
-
import { Activity, useRef, useState } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/internal/overlay/overlay-popup.tsx
|
|
8
8
|
const isDev = process.env.NODE_ENV !== "production";
|
|
9
9
|
/**
|
|
10
10
|
* The children of a popup (Popover, Dialog, Menu, Combobox). JS-free mode: always rendered.
|
|
@@ -97,7 +97,6 @@ function useJsFreePropWarnings(part, noun, isLibrary, transition, keepMounted) {
|
|
|
97
97
|
useDevWarning(!isLibrary && transition !== void 0, isDev && `${part}: \`transition\` has no effect in JS-free mode; the browser opens and closes the ${noun} outside any React transition. Animate it with CSS (\`@starting-style\`).`);
|
|
98
98
|
useDevWarning(!isLibrary && keepMounted === false, isDev && `${part}: \`keepMounted={false}\` cannot be honoured in JS-free mode; the content is always mounted so that the server HTML is complete.`);
|
|
99
99
|
}
|
|
100
|
-
//#endregion
|
|
101
100
|
export { commandOf, renderOverlayContent, resolveInitialFocus, returnFocusToTrigger, useCloseHold, useInitialFocusTarget, useJsFreePropWarnings };
|
|
102
101
|
|
|
103
102
|
//# sourceMappingURL=overlay-popup.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/overlay/overlay-show.ts
|
|
2
2
|
/** A fresh set of flags, all clear. Keep one per Popup instance (`useState(createPopupFlags)`). */
|
|
3
3
|
function createPopupFlags() {
|
|
4
4
|
let awaitingClose = false;
|
|
@@ -67,7 +67,6 @@ function showWithFocus(element, { refused, autofocus, show }) {
|
|
|
67
67
|
if (inerted) element.removeAttribute("inert");
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
//#endregion
|
|
71
70
|
export { createPopupFlags, showWithFocus };
|
|
72
71
|
|
|
73
72
|
//# sourceMappingURL=overlay-show.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/overlay/popover-open.ts
|
|
2
2
|
/**
|
|
3
3
|
* Whether `element` is a showing popover (`:popover-open`). `false` for `null` and where the
|
|
4
4
|
* selector is unsupported (it throws there, for example on a `render` element in an engine
|
|
@@ -12,7 +12,6 @@ function isPopoverOpen(element) {
|
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { isPopoverOpen };
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=popover-open.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/overlay/trigger-ref.ts
|
|
2
2
|
const isDev = process.env.NODE_ENV !== "production";
|
|
3
3
|
/** The Roots that already warned about a second Trigger, keyed by their `triggerRef`. */
|
|
4
4
|
const warned = /* @__PURE__ */ new WeakSet();
|
|
@@ -12,7 +12,7 @@ function registerTrigger(triggerRef, element, part) {
|
|
|
12
12
|
if (isDev && triggerRef.current !== null) {
|
|
13
13
|
if (!warned.has(triggerRef)) {
|
|
14
14
|
warned.add(triggerRef);
|
|
15
|
-
console.error(`${part}: a second ${part} mounted
|
|
15
|
+
console.error(`${part}: a second ${part} mounted for the same popup. A popup supports one ${part}: it only follows the last one mounted (its anchor, focus return and, without an action, data-open). Render one ${part} per popup.`);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
triggerRef.current = element;
|
|
@@ -20,7 +20,6 @@ function registerTrigger(triggerRef, element, part) {
|
|
|
20
20
|
if (triggerRef.current === element) triggerRef.current = null;
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { registerTrigger };
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=trigger-ref.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-ref.mjs","names":[],"sources":["../../../src/internal/overlay/trigger-ref.ts"],"sourcesContent":["import type { RefObject } from \"react\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/** The Roots that already warned about a second Trigger, keyed by their `triggerRef`. */\nconst warned = new WeakSet<RefObject<HTMLElement | null>>();\n\n/**\n * Registers `element` as the Root's one Trigger (`triggerRef`, last mounted wins) and returns\n * the ref cleanup. In development, a second Trigger mounting while another is registered\n * warns once per Root (popover.md 14.2): only the registered one is the popup's `source` (anchor,\n * focus return) and, in JS-free mode, the one whose `data-open` is kept current.\n */\nexport function registerTrigger(\n triggerRef: RefObject<HTMLElement | null>,\n element: HTMLElement,\n part: string,\n): () => void {\n // A Trigger's own cleanup clears the ref first (a remount, StrictMode, a ref change), so a\n // registered element here is another, still mounted Trigger.\n if (isDev && triggerRef.current !== null) {\n if (!warned.has(triggerRef)) {\n warned.add(triggerRef);\n console.error(\n `${part}: a second ${part} mounted
|
|
1
|
+
{"version":3,"file":"trigger-ref.mjs","names":[],"sources":["../../../src/internal/overlay/trigger-ref.ts"],"sourcesContent":["import type { RefObject } from \"react\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/** The Roots that already warned about a second Trigger, keyed by their `triggerRef`. */\nconst warned = new WeakSet<RefObject<HTMLElement | null>>();\n\n/**\n * Registers `element` as the Root's one Trigger (`triggerRef`, last mounted wins) and returns\n * the ref cleanup. In development, a second Trigger mounting while another is registered\n * warns once per Root (popover.md 14.2): only the registered one is the popup's `source` (anchor,\n * focus return) and, in JS-free mode, the one whose `data-open` is kept current.\n */\nexport function registerTrigger(\n triggerRef: RefObject<HTMLElement | null>,\n element: HTMLElement,\n part: string,\n): () => void {\n // A Trigger's own cleanup clears the ref first (a remount, StrictMode, a ref change), so a\n // registered element here is another, still mounted Trigger.\n if (isDev && triggerRef.current !== null) {\n if (!warned.has(triggerRef)) {\n warned.add(triggerRef);\n console.error(\n `${part}: a second ${part} mounted for the same popup. A popup supports one ${part}: ` +\n \"it only follows the last one mounted (its anchor, focus return and, \" +\n `without an action, data-open). Render one ${part} per popup.`,\n );\n }\n }\n triggerRef.current = element;\n return () => {\n if (triggerRef.current === element) triggerRef.current = null;\n };\n}\n"],"mappings":";AAEA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;AAGvC,MAAM,yBAAS,IAAI,QAAuC;;;;;;;AAQ1D,SAAgB,gBACd,YACA,SACA,MACY;CAGZ,IAAI,SAAS,WAAW,YAAY,MAC9B;MAAA,CAAC,OAAO,IAAI,UAAU,GAAG;GAC3B,OAAO,IAAI,UAAU;GACrB,QAAQ,MACN,GAAG,KAAK,aAAa,KAAK,oDAAoD,KAAK,kHAEpC,KAAK,YACtD;EACF;;CAEF,WAAW,UAAU;CACrB,aAAa;EACX,IAAI,WAAW,YAAY,SAAS,WAAW,UAAU;CAC3D;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useLayoutEffect } from "react";
|
|
3
|
-
|
|
3
|
+
// src/internal/overlay/use-apply-open-state.ts
|
|
4
4
|
/**
|
|
5
5
|
* The apply effect (design 2.5): a dependency-free layout effect that, after every commit that
|
|
6
6
|
* re-renders the Popup, once nothing is in flight, makes the DOM follow committed state. One
|
|
@@ -38,7 +38,6 @@ function useApplyOpenState(ctx, { flags, exit, probe, isShown, show, hide }) {
|
|
|
38
38
|
exit.releaseIfIdle(ctx.committed, flags.awaitingClose(), isShown(element));
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
//#endregion
|
|
42
41
|
export { useApplyOpenState };
|
|
43
42
|
|
|
44
43
|
//# sourceMappingURL=use-apply-open-state.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRef, useState } from "react";
|
|
3
|
-
|
|
3
|
+
// src/internal/overlay/use-exit-animation.ts
|
|
4
4
|
/** An animation that ends: infinite ones (a spinner) would hold the content forever. */
|
|
5
5
|
function ends(animation) {
|
|
6
6
|
const end = animation.effect?.getComputedTiming().endTime;
|
|
@@ -69,7 +69,6 @@ function useExitAnimation() {
|
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
//#endregion
|
|
73
72
|
export { animationBaseline, exitAnimations, useExitAnimation };
|
|
74
73
|
|
|
75
74
|
//# sourceMappingURL=use-exit-animation.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-exit-animation.mjs","names":[],"sources":["../../../src/internal/overlay/use-exit-animation.ts"],"sourcesContent":["\"use client\";\nimport { useRef, useState } from \"react\";\n\n/** An animation that ends: infinite ones (a spinner) would hold the content forever. */\nfunction ends(animation: Animation): boolean {\n const end = animation.effect?.getComputedTiming().endTime;\n return typeof end === \"number\" && Number.isFinite(end);\n}\n\n/**\n * The animations running in an element's subtree right before it closes (the synchronous\n * `beforetoggle` of the hide, Toast's `data-ending` write): the baseline that `exitAnimations`\n * excludes, so a finite animation already running inside (a progress bar) does not hold the exit\n * (Toast 10.2). Empty where `getAnimations` is absent (jsdom).\n */\nexport function animationBaseline(element: Element): ReadonlySet<Animation> {\n if (!element.isConnected || typeof element.getAnimations !== \"function\") return new Set();\n return new Set(element.getAnimations({ subtree: true }));\n}\n\n/**\n * The running exit animations of a top-layer element that has just been hidden, read after a\n * style flush so that `transition-behavior: allow-discrete` exits exist, minus the `baseline`\n * of animations that were already running before the close. Empty where the engine does not\n * animate the exit (Firefox) or there is no CSS exit.\n */\nexport function exitAnimations(element: Element, baseline?: ReadonlySet<Animation>): Animation[] {\n if (!element.isConnected || typeof element.getAnimations !== \"function\") return [];\n void getComputedStyle(element).opacity;\n return element\n .getAnimations({ subtree: true })\n .filter((animation) => ends(animation) && !(baseline?.has(animation) ?? false));\n}\n\nexport interface ExitAnimation {\n /** Keep the content mounted (design/components/popover.md 4.4). */\n readonly held: boolean;\n /** Set `held` now (urgent, library-internal) and clear it when `animations` settle. */\n readonly holdUntil: (animations: readonly Animation[]) => void;\n /** Clear `held` now (a normal update, never a transition), cancelling any wait in progress. */\n readonly release: () => void;\n /** Set `held` during render (the \"previous value in state\" pattern). */\n readonly holdDuringRender: () => void;\n /** Whether a `holdUntil` wait is still running. Handlers and effects only. */\n readonly waiting: () => boolean;\n /**\n * Record the animations already running in `element`'s subtree. Call from the synchronous\n * `beforetoggle` of a close, before the hide starts the exit.\n */\n readonly recordBaseline: (element: Element) => void;\n /** `exitAnimations(element)` minus the recorded baseline, which it consumes. */\n readonly exitAnimations: (element: Element) => Animation[];\n}\n\n/**\n * The deferred unmount of a top-layer popup's content while its hide animates. `held` is cleared\n * with a normal (urgent) update, never in a transition: the popup is already hidden, nothing\n * visible changes, and only transition commits start a document view transition, so a dismissal\n * (a fact, an urgent commit) runs none (design 4.4, conventions 3.9.8).\n */\nexport function useExitAnimation(): ExitAnimation {\n const [held, setHeld] = useState(false);\n // The generation of the wait in progress, or null; a newer wait supersedes an older one.\n const wait = useRef<number | null>(null);\n const generation = useRef(0);\n // The animations running right before the latest close, consumed by `exitAnimations`.\n const baseline = useRef<ReadonlySet<Animation> | null>(null);\n\n const holdUntil = (animations: readonly Animation[]): void => {\n const current = ++generation.current;\n wait.current = current;\n setHeld(true);\n void Promise.allSettled(animations.map((animation) => animation.finished)).then(() => {\n if (generation.current !== current) return;\n wait.current = null;\n setHeld(false);\n });\n };\n\n const release = (): void => {\n generation.current++;\n wait.current = null;\n setHeld(false);\n };\n\n return {\n held,\n holdUntil,\n release,\n holdDuringRender: () => setHeld(true),\n waiting: () => wait.current !== null,\n recordBaseline: (element) => {\n baseline.current = animationBaseline(element);\n },\n exitAnimations: (element) => {\n const recorded = baseline.current ?? undefined;\n baseline.current = null;\n return exitAnimations(element, recorded);\n },\n };\n}\n"],"mappings":";;;;AAIA,SAAS,KAAK,WAA+B;CAC3C,MAAM,MAAM,UAAU,QAAQ,kBAAkB,CAAC,CAAC;CAClD,OAAO,OAAO,QAAQ,YAAY,OAAO,SAAS,GAAG;AACvD;;;;;;;AAQA,SAAgB,kBAAkB,SAA0C;CAC1E,IAAI,CAAC,QAAQ,eAAe,OAAO,QAAQ,kBAAkB,YAAY,uBAAO,IAAI,IAAI;CACxF,OAAO,IAAI,IAAI,QAAQ,cAAc,EAAE,SAAS,KAAK,CAAC,CAAC;AACzD;;;;;;;AAQA,SAAgB,eAAe,SAAkB,UAAgD;CAC/F,IAAI,CAAC,QAAQ,eAAe,OAAO,QAAQ,kBAAkB,YAAY,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-exit-animation.mjs","names":[],"sources":["../../../src/internal/overlay/use-exit-animation.ts"],"sourcesContent":["\"use client\";\nimport { useRef, useState } from \"react\";\n\n/** An animation that ends: infinite ones (a spinner) would hold the content forever. */\nfunction ends(animation: Animation): boolean {\n const end = animation.effect?.getComputedTiming().endTime;\n return typeof end === \"number\" && Number.isFinite(end);\n}\n\n/**\n * The animations running in an element's subtree right before it closes (the synchronous\n * `beforetoggle` of the hide, Toast's `data-ending` write): the baseline that `exitAnimations`\n * excludes, so a finite animation already running inside (a progress bar) does not hold the exit\n * (Toast 10.2). Empty where `getAnimations` is absent (jsdom).\n */\nexport function animationBaseline(element: Element): ReadonlySet<Animation> {\n if (!element.isConnected || typeof element.getAnimations !== \"function\") return new Set();\n return new Set(element.getAnimations({ subtree: true }));\n}\n\n/**\n * The running exit animations of a top-layer element that has just been hidden, read after a\n * style flush so that `transition-behavior: allow-discrete` exits exist, minus the `baseline`\n * of animations that were already running before the close. Empty where the engine does not\n * animate the exit (Firefox) or there is no CSS exit.\n */\nexport function exitAnimations(element: Element, baseline?: ReadonlySet<Animation>): Animation[] {\n if (!element.isConnected || typeof element.getAnimations !== \"function\") return [];\n void getComputedStyle(element).opacity;\n return element\n .getAnimations({ subtree: true })\n .filter((animation) => ends(animation) && !(baseline?.has(animation) ?? false));\n}\n\nexport interface ExitAnimation {\n /** Keep the content mounted (design/components/popover.md 4.4). */\n readonly held: boolean;\n /** Set `held` now (urgent, library-internal) and clear it when `animations` settle. */\n readonly holdUntil: (animations: readonly Animation[]) => void;\n /** Clear `held` now (a normal update, never a transition), cancelling any wait in progress. */\n readonly release: () => void;\n /** Set `held` during render (the \"previous value in state\" pattern). */\n readonly holdDuringRender: () => void;\n /** Whether a `holdUntil` wait is still running. Handlers and effects only. */\n readonly waiting: () => boolean;\n /**\n * Record the animations already running in `element`'s subtree. Call from the synchronous\n * `beforetoggle` of a close, before the hide starts the exit.\n */\n readonly recordBaseline: (element: Element) => void;\n /** `exitAnimations(element)` minus the recorded baseline, which it consumes. */\n readonly exitAnimations: (element: Element) => Animation[];\n}\n\n/**\n * The deferred unmount of a top-layer popup's content while its hide animates. `held` is cleared\n * with a normal (urgent) update, never in a transition: the popup is already hidden, nothing\n * visible changes, and only transition commits start a document view transition, so a dismissal\n * (a fact, an urgent commit) runs none (design 4.4, conventions 3.9.8).\n */\nexport function useExitAnimation(): ExitAnimation {\n const [held, setHeld] = useState(false);\n // The generation of the wait in progress, or null; a newer wait supersedes an older one.\n const wait = useRef<number | null>(null);\n const generation = useRef(0);\n // The animations running right before the latest close, consumed by `exitAnimations`.\n const baseline = useRef<ReadonlySet<Animation> | null>(null);\n\n const holdUntil = (animations: readonly Animation[]): void => {\n const current = ++generation.current;\n wait.current = current;\n setHeld(true);\n void Promise.allSettled(animations.map((animation) => animation.finished)).then(() => {\n if (generation.current !== current) return;\n wait.current = null;\n setHeld(false);\n });\n };\n\n const release = (): void => {\n generation.current++;\n wait.current = null;\n setHeld(false);\n };\n\n return {\n held,\n holdUntil,\n release,\n holdDuringRender: () => setHeld(true),\n waiting: () => wait.current !== null,\n recordBaseline: (element) => {\n baseline.current = animationBaseline(element);\n },\n exitAnimations: (element) => {\n const recorded = baseline.current ?? undefined;\n baseline.current = null;\n return exitAnimations(element, recorded);\n },\n };\n}\n"],"mappings":";;;;AAIA,SAAS,KAAK,WAA+B;CAC3C,MAAM,MAAM,UAAU,QAAQ,kBAAkB,CAAC,CAAC;CAClD,OAAO,OAAO,QAAQ,YAAY,OAAO,SAAS,GAAG;AACvD;;;;;;;AAQA,SAAgB,kBAAkB,SAA0C;CAC1E,IAAI,CAAC,QAAQ,eAAe,OAAO,QAAQ,kBAAkB,YAAY,uBAAO,IAAI,IAAI;CACxF,OAAO,IAAI,IAAI,QAAQ,cAAc,EAAE,SAAS,KAAK,CAAC,CAAC;AACzD;;;;;;;AAQA,SAAgB,eAAe,SAAkB,UAAgD;CAC/F,IAAI,CAAC,QAAQ,eAAe,OAAO,QAAQ,kBAAkB,YAAY,OAAO,CAAC;CAC5E,iBAAiB,OAAO,CAAC,CAAC;CAC/B,OAAO,QACJ,cAAc,EAAE,SAAS,KAAK,CAAC,CAAC,CAChC,QAAQ,cAAc,KAAK,SAAS,KAAK,EAAE,UAAU,IAAI,SAAS,KAAK,MAAM;AAClF;;;;;;;AA4BA,SAAgB,mBAAkC;CAChD,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CAEtC,MAAM,OAAO,OAAsB,IAAI;CACvC,MAAM,aAAa,OAAO,CAAC;CAE3B,MAAM,WAAW,OAAsC,IAAI;CAE3D,MAAM,aAAa,eAA2C;EAC5D,MAAM,UAAU,EAAE,WAAW;EAC7B,KAAK,UAAU;EACf,QAAQ,IAAI;EACP,QAAQ,WAAW,WAAW,KAAK,cAAc,UAAU,QAAQ,CAAC,CAAC,CAAC,WAAW;GACpF,IAAI,WAAW,YAAY,SAAS;GACpC,KAAK,UAAU;GACf,QAAQ,KAAK;EACf,CAAC;CACH;CAEA,MAAM,gBAAsB;EAC1B,WAAW;EACX,KAAK,UAAU;EACf,QAAQ,KAAK;CACf;CAEA,OAAO;EACL;EACA;EACA;EACA,wBAAwB,QAAQ,IAAI;EACpC,eAAe,KAAK,YAAY;EAChC,iBAAiB,YAAY;GAC3B,SAAS,UAAU,kBAAkB,OAAO;EAC9C;EACA,iBAAiB,YAAY;GAC3B,MAAM,WAAW,SAAS,WAAW,KAAA;GACrC,SAAS,UAAU;GACnB,OAAO,eAAe,SAAS,QAAQ;EACzC;CACF;AACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { isPopoverOpen } from "./popover-open.mjs";
|
|
3
|
-
import { eventSource } from "./invokers.mjs";
|
|
4
2
|
import { useCallback, useRef } from "react";
|
|
5
|
-
|
|
3
|
+
import { eventSource } from "./invokers.mjs";
|
|
4
|
+
import { isPopoverOpen } from "./popover-open.mjs";
|
|
5
|
+
// src/internal/overlay/use-interest-dismiss.ts
|
|
6
6
|
/**
|
|
7
7
|
* Lost interest of an `interestfor` button naming the popup (library mode; Chromium; popover.md
|
|
8
8
|
* lost-interest amendment), for `usePopoverPopup`. The platform hides only a popover its own
|
|
@@ -79,7 +79,6 @@ function useInterestDismiss(ctx, options = {}) {
|
|
|
79
79
|
}, [])
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
//#endregion
|
|
83
82
|
export { useInterestDismiss };
|
|
84
83
|
|
|
85
84
|
//# sourceMappingURL=use-interest-dismiss.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { pushModal, removeModal } from "./modal-registry.mjs";
|
|
3
2
|
import { useLayoutEffect } from "react";
|
|
4
|
-
|
|
3
|
+
import { pushModal, removeModal } from "./modal-registry.mjs";
|
|
4
|
+
// src/internal/overlay/use-modal-registration.ts
|
|
5
5
|
function isModal(dialog) {
|
|
6
6
|
if (!dialog.isConnected || !dialog.open) return false;
|
|
7
7
|
try {
|
|
@@ -41,7 +41,6 @@ function useModalRegistration(dialog) {
|
|
|
41
41
|
};
|
|
42
42
|
}, [dialog]);
|
|
43
43
|
}
|
|
44
|
-
//#endregion
|
|
45
44
|
export { useModalRegistration };
|
|
46
45
|
|
|
47
46
|
//# sourceMappingURL=use-modal-registration.mjs.map
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { dataAttr } from "../data-attr.mjs";
|
|
3
3
|
import { cancelClick, disabledButton, rendersButton } from "../render-element.mjs";
|
|
4
|
+
import { useElementCheck } from "../use-element-check.mjs";
|
|
4
5
|
import { usePureTrigger } from "../action/use-pure-trigger.mjs";
|
|
5
6
|
import { useRender } from "../use-render.mjs";
|
|
6
|
-
|
|
7
|
-
//#region src/internal/overlay/use-overlay-close.ts
|
|
7
|
+
// src/internal/overlay/use-overlay-close.ts
|
|
8
8
|
const isDev = process.env.NODE_ENV !== "production";
|
|
9
9
|
/**
|
|
10
10
|
* The Close part of a popover-like or dialog overlay (design/components/popover.md 3.4,
|
|
11
11
|
* dialog.md 3.4): `<button type="button" commandfor command>` without `action`, a plain
|
|
12
12
|
* `<button type="button">` with one (#182). In JS-free mode without `action`
|
|
13
13
|
* the browser runs the command. Otherwise the click is cancelled, refused while disabled, and
|
|
14
|
-
* `close` runs, after the `action` when there is one, inside this part's own transition
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* `close` runs, after the `action` when there is one, inside this part's own transition, so the
|
|
15
|
+
* part is pending until that close has committed (conventions 4.3). Without `action` the close
|
|
16
|
+
* is requested synchronously in the click and a second click requests it again (`whilePending`
|
|
17
|
+
* resolves to `"run"`: no pending `aria-disabled`). With one, a second click meanwhile starts
|
|
18
|
+
* nothing (`whilePending`, default `"ignore"`) or runs the action again (`"run"`; the close
|
|
19
|
+
* happens once, after the last run and only if the latest one resolved), and a close whose open
|
|
20
|
+
* was superseded by a
|
|
18
21
|
* newer one (dismissed and re-opened meanwhile) is dropped (the open-generation guard).
|
|
19
22
|
*/
|
|
20
23
|
function useOverlayClose(options) {
|
|
21
24
|
const { part, noun, isLibrary, popupId, command, action, disabled, render } = options;
|
|
22
25
|
const nativeCommand = action === void 0;
|
|
23
26
|
const trigger = usePureTrigger({
|
|
24
|
-
whilePending: options.whilePending,
|
|
27
|
+
whilePending: action === void 0 ? "run" : options.whilePending,
|
|
25
28
|
defaultWhilePending: "ignore",
|
|
26
29
|
openGeneration: options.openGeneration
|
|
27
30
|
});
|
|
@@ -34,7 +37,7 @@ function useOverlayClose(options) {
|
|
|
34
37
|
if (disabled) return;
|
|
35
38
|
const native = event.nativeEvent;
|
|
36
39
|
if (action === void 0) {
|
|
37
|
-
options.close(native);
|
|
40
|
+
trigger.run(() => options.close(native));
|
|
38
41
|
return;
|
|
39
42
|
}
|
|
40
43
|
const details = options.details(native);
|
|
@@ -66,7 +69,6 @@ function useOverlayClose(options) {
|
|
|
66
69
|
ref
|
|
67
70
|
});
|
|
68
71
|
}
|
|
69
|
-
//#endregion
|
|
70
72
|
export { useOverlayClose };
|
|
71
73
|
|
|
72
74
|
//# sourceMappingURL=use-overlay-close.mjs.map
|