@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp-field-root.mjs","names":[],"sources":["../../src/otp-field/otp-field-root.tsx"],"sourcesContent":["\"use client\";\nimport {\n addTransitionType,\n use,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type {\n ChangeEvent,\n ComponentPropsWithRef,\n CSSProperties,\n ReactNode,\n RefObject,\n} from \"react\";\nimport { createActionDetails } from \"../internal/action/action-details.js\";\nimport { callUrgentHandler } from \"../internal/action/call-urgent-handler.js\";\nimport { useActionTrigger } from \"../internal/action/use-action-trigger.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { FieldContext } from \"../internal/form/field-context.js\";\nimport { resolveFieldDefaults, useFieldValueChange } from \"../internal/form/use-field-control.js\";\nimport { useFormReset, useResetTarget } from \"../internal/form/use-form-reset.js\";\nimport type { FormAssociatedElement } from \"../internal/form/use-form-owner-event.js\";\nimport { resolveStateValue } from \"../internal/render-element.js\";\nimport { transitionTypes } from \"../internal/transition-types.js\";\nimport type {\n Action,\n ActionDetails,\n ChangeReason,\n RenderProp,\n StateValue,\n UrgentChangeHandler,\n} from \"../internal/types.js\";\nimport { useDevWarning } from \"../internal/use-dev-warning.js\";\nimport { useLatest } from \"../internal/use-latest.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { OTPFieldContext } from \"./otp-field-context.js\";\nimport type { OTPFieldContextValue } from \"./otp-field-context.js\";\nimport { activeRange, applyEdit, filterChars, normalizeCode } from \"./otp-field-filter.js\";\nimport type { EditBefore, OTPFieldCharset } from \"./otp-field-filter.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/** Details passed as the second argument of `onValueChange`. */\nexport interface OTPFieldValueChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user edited the text (`details.event` is the `input` event, or the\n * `compositionend` that ended a composition). `\"platform\"`: a form reset (the `reset` event),\n * text adopted at hydration or a WebOTP fill (`undefined`).\n */\n readonly reason: ChangeReason;\n}\n\n/** Details passed as the second argument of `completeAction`. */\nexport interface OTPFieldCompleteDetails extends ActionDetails {\n /**\n * `\"activate\"`: an edit completed the code (typing, paste, keyboard autofill; `details.event`\n * is the `input` event). `\"platform\"`: a WebOTP fill (`details.event` is `undefined`).\n */\n readonly reason: ChangeReason;\n}\n\n/** The state the Root's and the Input's function props receive. */\nexport interface OTPFieldState {\n /** The text shown, already filtered: at most `length` characters of `charset`. */\n readonly value: string;\n /** The number of characters in a complete code. */\n readonly length: number;\n /** `value.length === length`. */\n readonly complete: boolean;\n /** A `completeAction` is in flight. */\n readonly pending: boolean;\n /** The `disabled` prop, or the enclosing Field's. */\n readonly disabled: boolean;\n /** The `readOnly` prop. */\n readonly readOnly: boolean;\n /** Inside a `Field.Root`: an error is shown for the field. `false` outside. */\n readonly invalid: boolean;\n}\n\n/**\n * Props of `OTPField.Root`.\n *\n * @see https://ui.funstack.work/components/otp-field\n */\nexport interface OTPFieldRootProps extends Omit<\n ComponentPropsWithRef<\"div\">,\n \"className\" | \"style\" | \"children\" | \"defaultValue\"\n> {\n /** The number of characters in a complete code. */\n length: number;\n /**\n * Which characters a code may contain; also picks the Input's `inputmode` and `pattern`.\n *\n * @defaultValue `\"numeric\"`\n */\n charset?: OTPFieldCharset;\n /** Controlled text. Follows the input: it cannot hold an edit back (the urgent lane). */\n value?: string;\n /**\n * Initial text in uncontrolled mode (filtered), and the form-reset target.\n *\n * @defaultValue `\"\"`\n */\n defaultValue?: string;\n /**\n * The text changed: an edit (`\"activate\"`), a form reset, text adopted at hydration or a WebOTP\n * fill (`\"platform\"`). A fact: called synchronously, outside any transition, not awaited.\n * Called before `completeAction` for the same edit.\n */\n onValueChange?: UrgentChangeHandler<string, OTPFieldValueChangeDetails>;\n /**\n * An edit left the code complete: runs in the Root's transition and is awaited, with\n * `data-pending` on the Root and the Input. Runs for every such edit, also while an earlier run\n * is pending (a different code), and for the same code pasted again. Not at mount, on a reset,\n * for a controlled change, or while disabled or read-only. A rejection reaches the nearest Error\n * Boundary. May be a Server Function.\n */\n completeAction?: Action<[value: string, details: OTPFieldCompleteDetails]>;\n /**\n * Submit the Input's form (`requestSubmit()`) when an edit leaves the code complete, right\n * after dispatching `completeAction`. A change of context on input (WCAG 3.2.2): say so before\n * the field.\n *\n * @defaultValue `false`\n */\n submitOnComplete?: boolean;\n /**\n * Native `name` on the Input.\n *\n * @defaultValue the Field's `name` inside a `Field.Root`\n */\n name?: string;\n /** Native `form` on the Input. */\n form?: string;\n /**\n * Native `required` on the Input; or the Field's.\n *\n * @defaultValue `false`\n */\n required?: boolean;\n /**\n * Native `disabled` on the Input; or the Field's.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Native `readonly` on the Input: no edits, no completion.\n *\n * @defaultValue `false`\n */\n readOnly?: boolean;\n /**\n * Ask the browser for the code of an origin-bound SMS (WebOTP, `navigator.credentials.get({\n * otp })`) while the Input is mounted. Chromium and Safari; nothing happens where the API is\n * missing (Firefox).\n *\n * @defaultValue `false`\n */\n experimental_webOTP?: boolean;\n /** Class name, or a function of the state that returns one. */\n className?: StateValue<string | undefined, OTPFieldState>;\n /** Inline style, or a function of the state that returns one. `position: relative` unless given. */\n style?: StateValue<CSSProperties | undefined, OTPFieldState>;\n /** The parts. The function form receives the state. */\n children?: StateValue<ReactNode, OTPFieldState>;\n /** Replace the default `<div>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"div\">, OTPFieldState>;\n}\n\nconst COMPLETE_TYPES = transitionTypes(\"otp-field\", \"complete\");\n\ninterface Selection {\n readonly focused: boolean;\n readonly start: number | null;\n readonly end: number | null;\n}\n\nconst BLURRED: Selection = { focused: false, start: null, end: null };\n\nfunction isFocused(input: HTMLInputElement): boolean {\n return input.ownerDocument.activeElement === input || input.matches(\":focus\");\n}\n\n/** Writes `value` into the input when it differs and puts the selection at `[start, end]`. */\nfunction writeInput(\n input: HTMLInputElement,\n value: string,\n start: number | null,\n end: number | null = start,\n): void {\n if (input.value !== value) input.value = value;\n if (start === null || end === null || !isFocused(input)) return;\n if (input.selectionStart !== start || input.selectionEnd !== end) {\n input.setSelectionRange(start, end);\n }\n}\n\n/** The development check of the mounted Slots' indices (design 1). */\nfunction slotIndexProblem(slots: Map<HTMLElement, number>, length: number): string | null {\n if (slots.size === 0) return null;\n const seen = new Set<number>();\n for (const index of slots.values()) {\n if (!Number.isInteger(index) || index < 0 || index >= length) {\n return `OTPField.Slot: index ${index} is outside 0 to ${length - 1} (length ${length}).`;\n }\n if (seen.has(index)) return `OTPField.Slot: index ${index} is used by more than one Slot.`;\n seen.add(index);\n }\n for (let i = 0; i < length; i++) {\n if (!seen.has(i)) {\n return (\n `OTPField.Slot: no Slot has index ${i} (length ${length}). Render one Slot per ` +\n \"position, or the code's characters are not all shown.\"\n );\n }\n }\n return null;\n}\n\n/**\n * Owns the text of a one-time-code field (design/components/otp-field.md): the urgent value\n * (`value` / `defaultValue` / `onValueChange`), the filter that keeps it a code, the selection the\n * Slots draw, the completion transition (`completeAction`, `submitOnComplete`), form reset,\n * hydration adoption and WebOTP. Renders a `div` with `position: relative`: the box the Input\n * covers.\n *\n * Owned keys (conventions 1.2): `data-complete`, `data-pending`, `data-disabled`,\n * `data-invalid` (inside a Field); `position` in `style` unless the consumer's style sets it.\n *\n * @see https://ui.funstack.work/components/otp-field\n */\nexport function OTPFieldRoot(props: OTPFieldRootProps) {\n const {\n length: lengthProp,\n charset: charsetProp = \"numeric\",\n value: valueProp,\n defaultValue,\n onValueChange,\n completeAction,\n submitOnComplete = false,\n name: nameProp,\n form,\n required: requiredProp = false,\n disabled: disabledProp = false,\n readOnly = false,\n experimental_webOTP: experimentalWebOTP = false,\n className,\n style,\n children,\n render,\n ...rest\n } = props;\n\n const lengthValid = Number.isInteger(lengthProp) && lengthProp > 0;\n const length = lengthValid ? lengthProp : Math.max(1, Math.floor(lengthProp) || 1);\n useDevWarning(\n !lengthValid,\n isDev && `OTPField.Root: \\`length\\` must be a positive integer; got ${String(lengthProp)}.`,\n );\n const charset: OTPFieldCharset =\n charsetProp === \"alphanumeric\" || charsetProp === \"alphabetic\" ? charsetProp : \"numeric\";\n\n // --- Field ----------------------------------------------------------------------------------\n\n // OTPField.Input registers the control (design 7); the Root resolves the defaults.\n const fieldContext = use(FieldContext);\n const { disabled, required, name } = resolveFieldDefaults(fieldContext, {\n name: nameProp,\n disabled: disabledProp,\n required: requiredProp,\n });\n const fieldInvalid = fieldContext === null ? undefined : fieldContext.state.invalid;\n\n // --- The text (design 3.2) ------------------------------------------------------------------\n\n const controlled = valueProp !== undefined;\n const controlledValue = controlled ? normalizeCode(valueProp, charset, length) : undefined;\n useDevWarning(\n controlled && controlledValue !== valueProp,\n isDev &&\n `OTPField.Root: the controlled \\`value\\` (\"${valueProp ?? \"\"}\") holds characters outside ` +\n `\\`charset\\` (\"${charset}\") or more than \\`length\\` (${length}); it is rendered as ` +\n `\"${controlledValue ?? \"\"}\".`,\n );\n const [internalValue, setInternalValue] = useState(() =>\n normalizeCode(defaultValue ?? \"\", charset, length),\n );\n const value = controlledValue ?? internalValue;\n const valueRef = useRef(value);\n // The latest value for handlers between two renders (two edits in one task).\n useLayoutEffect(() => {\n valueRef.current = value;\n });\n\n /** The raw text while a composition is open (design 4.1, Composition): rendered as is. */\n const [composingText, setComposingText] = useState<string | null>(null);\n const composingRef = useRef(false);\n const [selection, setSelection] = useState<Selection>(BLURRED);\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n const beforeRef = useRef<EditBefore | null>(null);\n /** The value change the Field is told about next was an edit (design 7: `takeEdit`). */\n const editRef = useRef(false);\n const webOTPAbort = useRef<AbortController | null>(null);\n /** A completion happened: no WebOTP request starts any more, and a late code is ignored. */\n const webOTPDone = useRef(false);\n /** `submitOnComplete` was held back by an open composition. */\n const submitAfterComposition = useRef(false);\n\n const { pending, run } = useActionTrigger();\n\n // The latest committed props and `run`, for the stable callbacks below. Named `*Ref` so that\n // React Compiler's lint treats `.current` as a ref read, not a missing memo dependency.\n // `run` is a new function on every render: reading it through the ref keeps every handler,\n // the context and the Input's listeners and WebOTP request stable across renders.\n const propsRef = useLatest({\n charset,\n length,\n disabled,\n readOnly,\n controlled,\n onValueChange,\n completeAction,\n submitOnComplete,\n run,\n notifyField: fieldContext?.notifyChange,\n });\n\n // --- Writes ---------------------------------------------------------------------------------\n\n /** Writes the value (urgent) and reports it to `onValueChange` (design 3.2). */\n const commitValue = useCallback(\n (next: string, reason: ChangeReason, event: Event | undefined, edit: boolean) => {\n const props = propsRef.current;\n editRef.current = edit;\n // Controlled: the value is the parent's until it renders it (it may not adopt the edit).\n if (!props.controlled) {\n valueRef.current = next;\n setInternalValue(next);\n }\n callUrgentHandler(\n props.onValueChange,\n next,\n createActionDetails(event, { reason }) as OTPFieldValueChangeDetails,\n );\n },\n [propsRef],\n );\n\n /** Submits the Input's form, after the Field re-validated the text just written (design 3.1). */\n const submit = useCallback(() => {\n const form = inputRef.current?.form;\n if (form == null) return;\n // The Field validated the browser's pre-filter text in its `input` listener; the commit\n // that re-validates the written text comes after this event. Refresh it now.\n propsRef.current.notifyField?.(true);\n form.requestSubmit();\n }, [propsRef]);\n\n /** The code is complete after an edit or a WebOTP fill (design 3.1). */\n const complete = useCallback(\n (code: string, reason: ChangeReason, event: Event | undefined, composing = false) => {\n const {\n disabled: off,\n readOnly: ro,\n completeAction: action,\n submitOnComplete: submitting,\n run: runAction,\n } = propsRef.current;\n if (off || ro) return;\n // A code completed by hand makes a waiting WebOTP request moot (design 8), and no new one\n // starts after it.\n webOTPDone.current = true;\n webOTPAbort.current?.abort();\n webOTPAbort.current = null;\n if (action !== undefined) {\n const details = createActionDetails(event, { reason }) as OTPFieldCompleteDetails;\n runAction(() => {\n for (const type of COMPLETE_TYPES) addTransitionType(type);\n return action(code, details);\n });\n }\n if (!submitting) return;\n // The IME has not committed the text yet: submit at `compositionend` (design 4.1).\n if (composing) submitAfterComposition.current = true;\n else submit();\n },\n [propsRef, submit],\n );\n\n const readSelection = useCallback(() => {\n const input = inputRef.current;\n const next: Selection =\n input === null || !isFocused(input)\n ? BLURRED\n : { focused: true, start: input.selectionStart, end: input.selectionEnd };\n setSelection((prev) =>\n prev.focused === next.focused && prev.start === next.start && prev.end === next.end\n ? prev\n : next,\n );\n }, []);\n\n // --- Editing (design 4.1) -------------------------------------------------------------------\n\n const beforeInput = useCallback((event: InputEvent) => {\n const input = event.target as HTMLInputElement;\n beforeRef.current = {\n text: input.value,\n selectionStart: input.selectionStart ?? input.value.length,\n selectionEnd: input.selectionEnd ?? input.value.length,\n };\n }, []);\n\n const change = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const input = event.currentTarget;\n const native = event.nativeEvent as Partial<InputEvent> & Event;\n const before = beforeRef.current;\n beforeRef.current = null;\n const { charset: cs, length: len, disabled: off, readOnly: ro } = propsRef.current;\n if (off || ro) return;\n\n if (composingRef.current || native.isComposing === true) {\n // Derive always, write when allowed: the composition keeps its text in the input.\n const next = normalizeCode(input.value, cs, len);\n setComposingText(input.value);\n readSelection();\n if (next === valueRef.current) return;\n commitValue(next, \"activate\", native, true);\n if (next.length === len) complete(next, \"activate\", native, true);\n return;\n }\n\n const result = applyEdit({\n before,\n dom: input.value,\n caret: input.selectionStart,\n inputType: native.inputType ?? \"\",\n charset: cs,\n length: len,\n });\n setComposingText(null);\n if (result.selection !== null) {\n writeInput(input, result.value, result.selection[0], result.selection[1]);\n } else {\n writeInput(input, result.value, result.caret);\n }\n readSelection();\n const changed = result.value !== valueRef.current;\n if (changed) commitValue(result.value, \"activate\", native, true);\n if (result.value.length === len && (changed || result.kept > 0)) {\n complete(result.value, \"activate\", native);\n }\n },\n [commitValue, complete, propsRef, readSelection],\n );\n\n const compositionStart = useCallback(() => {\n composingRef.current = true;\n }, []);\n\n const compositionEnd = useCallback(\n (event: CompositionEvent) => {\n composingRef.current = false;\n const input = inputRef.current;\n setComposingText(null);\n if (input === null) return;\n const { charset: cs, length: len } = propsRef.current;\n const dom = input.value;\n const next = normalizeCode(dom, cs, len);\n const caret = Math.min(\n filterChars(dom.slice(0, input.selectionStart ?? dom.length), cs).length,\n next.length,\n );\n writeInput(input, next, caret);\n readSelection();\n const held = submitAfterComposition.current;\n submitAfterComposition.current = false;\n if (next !== valueRef.current) {\n commitValue(next, \"activate\", event, true);\n if (next.length === len) complete(next, \"activate\", event);\n return;\n }\n // The code was completed while composing: the submission held back then goes now.\n if (held && next.length === len && propsRef.current.submitOnComplete) submit();\n },\n [commitValue, complete, propsRef, readSelection, submit],\n );\n\n const blurred = useCallback(() => {\n setSelection(BLURRED);\n }, []);\n\n // --- The pointer (design 4.3) ---------------------------------------------------------------\n\n const slots = useRef(new Map<HTMLElement, number>());\n const registerSlot = useCallback((index: number, element: HTMLElement) => {\n slots.current.set(element, index);\n return () => {\n if (slots.current.get(element) === index) slots.current.delete(element);\n };\n }, []);\n\n const click = useCallback((event: MouseEvent) => {\n const input = inputRef.current;\n // A double click selects; a drag made a range: the browser's selection stands.\n if (input === null || event.detail > 1 || input.selectionStart !== input.selectionEnd) return;\n let target: number | null = null;\n let distance = Infinity;\n for (const [element, index] of slots.current) {\n const box = element.getBoundingClientRect();\n if (box.width === 0 && box.height === 0) continue;\n const dx = Math.max(box.left - event.clientX, 0, event.clientX - box.right);\n const dy = Math.max(box.top - event.clientY, 0, event.clientY - box.bottom);\n const d = dx * dx + dy * dy;\n if (d < distance) {\n distance = d;\n target = index;\n }\n }\n if (target === null) return;\n const caret = Math.min(target, input.value.length);\n if (input.selectionStart !== caret || input.selectionEnd !== caret) {\n input.setSelectionRange(caret, caret);\n }\n }, []);\n\n // --- Residual paths: hydration, reset, WebOTP (design 7, 8, 9) -----------------------------\n\n const inputMounted = useCallback(() => {\n const input = inputRef.current;\n if (input === null) return;\n const { charset: cs, length: len } = propsRef.current;\n const dom = input.value;\n const next = normalizeCode(dom, cs, len);\n if (dom !== next) input.value = next;\n // No completion for adopted text (design 9): a restored code is not a fresh one.\n if (next !== valueRef.current) commitValue(next, \"platform\", undefined, false);\n }, [commitValue, propsRef]);\n\n const resetTarget = normalizeCode(useResetTarget(valueProp, defaultValue) ?? \"\", charset, length);\n const [resync, setResync] = useState(0);\n const inputText = composingText ?? value;\n const inputTextRef = useLatest(inputText);\n useLayoutEffect(() => {\n // A controlled parent that did not adopt the reset gets the DOM put back.\n const input = inputRef.current;\n if (resync > 0 && input !== null && input.value !== inputTextRef.current) {\n input.value = inputTextRef.current;\n }\n }, [resync, inputTextRef]);\n useFormReset(\n inputRef as RefObject<FormAssociatedElement | null>,\n (event) => {\n composingRef.current = false;\n setComposingText(null);\n // The target is computed, not read from the input: after a click on a reset button this\n // microtask runs before the browser's reset algorithm (there is a microtask checkpoint\n // after each `reset` listener), so the input may still hold the old text here.\n if (resetTarget !== valueRef.current) commitValue(resetTarget, \"platform\", event, false);\n setResync((n) => n + 1);\n },\n () => {\n // react-dom rewrites a controlled input's `defaultValue` after every update; the reset\n // target is written right before the browser's reset algorithm reads it.\n const input = inputRef.current;\n if (input !== null && input.defaultValue !== resetTarget) input.defaultValue = resetTarget;\n },\n );\n\n const webOTPCode = useCallback(\n (code: string) => {\n const { charset: cs, length: len, disabled: off, readOnly: ro } = propsRef.current;\n if (off || ro || webOTPDone.current) return;\n const next = filterChars(code, cs);\n if (next.length !== len) return;\n // Written now, so that `submitOnComplete` posts it before React renders.\n const input = inputRef.current;\n if (input !== null) input.value = next;\n if (next !== valueRef.current) commitValue(next, \"platform\", undefined, true);\n complete(next, \"platform\", undefined);\n },\n [commitValue, complete, propsRef],\n );\n\n // A write-back or a WebOTP fill changed the value with no event the Field heard after it.\n useFieldValueChange(value, () => {\n const edit = editRef.current;\n editRef.current = false;\n return edit;\n });\n\n // --- Development warnings -------------------------------------------------------------------\n\n const slotWarned = useRef(false);\n useLayoutEffect(() => {\n if (!isDev || slotWarned.current) return;\n const problem = slotIndexProblem(slots.current, length);\n if (problem === null) return;\n slotWarned.current = true;\n console.error(problem);\n });\n\n // --- Render ---------------------------------------------------------------------------------\n\n const state = useMemo<OTPFieldState>(\n () => ({\n value,\n length,\n complete: value.length === length,\n pending,\n disabled,\n readOnly,\n invalid: fieldInvalid === true,\n }),\n [value, length, pending, disabled, readOnly, fieldInvalid],\n );\n\n const [activeFrom, activeTo] = activeRange(\n selection.focused,\n selection.start,\n selection.end,\n length,\n );\n\n const context = useMemo<OTPFieldContextValue>(\n () => ({\n state,\n charset,\n name,\n form,\n required,\n fieldInvalid,\n inputText,\n active: [activeFrom, activeTo],\n experimentalWebOTP,\n inputRef,\n change,\n beforeInput,\n compositionStart,\n compositionEnd,\n selectionChanged: readSelection,\n blurred,\n click,\n inputMounted,\n webOTPCode,\n registerSlot,\n webOTPAbort,\n webOTPDone,\n }),\n [\n state,\n charset,\n name,\n form,\n required,\n fieldInvalid,\n inputText,\n activeFrom,\n activeTo,\n experimentalWebOTP,\n change,\n beforeInput,\n compositionStart,\n compositionEnd,\n readSelection,\n blurred,\n click,\n inputMounted,\n webOTPCode,\n registerSlot,\n ],\n );\n\n const libraryProps: Partial<ComponentPropsWithRef<\"div\">> & DataAttributes = {\n ...(fieldContext !== null ? { \"data-invalid\": dataAttr(fieldInvalid === true) } : {}),\n \"data-complete\": dataAttr(state.complete),\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n };\n\n const element = useRender<ComponentPropsWithRef<\"div\">, OTPFieldState>({\n defaultElement: \"div\",\n render,\n state,\n className,\n // `position: relative` is the Input's containing block (design 6), unless the consumer's\n // style places the Root itself.\n style: (s) => ({ position: \"relative\", ...resolveStateValue(style, s) }),\n children,\n props: rest,\n libraryProps,\n });\n\n return <OTPFieldContext value={context}>{element}</OTPFieldContext>;\n}\n\nOTPFieldRoot.displayName = \"OTPFieldRoot\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4CA,MAAM,QAAQ,QAAQ,IAAI,aAAa;AAkIvC,MAAM,iBAAiB,gBAAgB,aAAa,UAAU;AAQ9D,MAAM,UAAqB;CAAE,SAAS;CAAO,OAAO;CAAM,KAAK;AAAK;AAEpE,SAAS,UAAU,OAAkC;CACnD,OAAO,MAAM,cAAc,kBAAkB,SAAS,MAAM,QAAQ,QAAQ;AAC9E;;AAGA,SAAS,WACP,OACA,OACA,OACA,MAAqB,OACf;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F,CACF;CAEA,MAAM,eAAuE;EAC3E,GAAI,iBAAiB,OAAO,EAAE,gBAAgB,SAAS,iBAAiB,IAAI,EAAE,IAAI,CAAC;EACnF,iBAAiB,SAAS,MAAM,QAAQ;EACxC,gBAAgB,SAAS,OAAO;EAChC,iBAAiB,SAAS,QAAQ;CACpC;CAEA,MAAM,UAAU,UAAuD;EACrE,gBAAgB;EAChB;EACA;EACA;EAGA,QAAQ,OAAO;GAAE,UAAU;GAAY,GAAG,kBAAkB,OAAO,CAAC;EAAE;EACtE;EACA,OAAO;EACP;CACF,CAAC;CAED,OAAO,oBAAC,iBAAD;EAAiB,OAAO;EAAU,UAAA;CAAyB,CAAA;AACpE;AAEA,aAAa,cAAc"}
|
|
1
|
+
{"version":3,"file":"otp-field-root.mjs","names":[],"sources":["../../src/otp-field/otp-field-root.tsx"],"sourcesContent":["\"use client\";\nimport {\n addTransitionType,\n use,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type {\n ChangeEvent,\n ComponentPropsWithRef,\n CSSProperties,\n ReactNode,\n RefObject,\n} from \"react\";\nimport { createActionDetails } from \"../internal/action/action-details.js\";\nimport { callUrgentHandler } from \"../internal/action/call-urgent-handler.js\";\nimport { useActionTrigger } from \"../internal/action/use-action-trigger.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { FieldContext } from \"../internal/form/field-context.js\";\nimport { resolveFieldDefaults, useFieldValueChange } from \"../internal/form/use-field-control.js\";\nimport { useFormReset, useResetTarget } from \"../internal/form/use-form-reset.js\";\nimport type { FormAssociatedElement } from \"../internal/form/use-form-owner-event.js\";\nimport { resolveStateValue } from \"../internal/render-element.js\";\nimport { transitionTypes } from \"../internal/transition-types.js\";\nimport type {\n Action,\n ActionDetails,\n ChangeReason,\n RenderProp,\n StateValue,\n UrgentChangeHandler,\n} from \"../internal/types.js\";\nimport { useDevWarning } from \"../internal/use-dev-warning.js\";\nimport { useLatest } from \"../internal/use-latest.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { OTPFieldContext } from \"./otp-field-context.js\";\nimport type { OTPFieldContextValue } from \"./otp-field-context.js\";\nimport { activeRange, applyEdit, filterChars, normalizeCode } from \"./otp-field-filter.js\";\nimport type { EditBefore, OTPFieldCharset } from \"./otp-field-filter.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/** Details passed as the second argument of `onValueChange`. */\nexport interface OTPFieldValueChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user edited the text (`details.event` is the `input` event, or the\n * `compositionend` that ended a composition). `\"platform\"`: a form reset (the `reset` event),\n * text adopted at hydration or a WebOTP fill (`undefined`).\n */\n readonly reason: ChangeReason;\n}\n\n/** Details passed as the second argument of `completeAction`. */\nexport interface OTPFieldCompleteDetails extends ActionDetails {\n /**\n * `\"activate\"`: an edit completed the code (typing, paste, keyboard autofill; `details.event`\n * is the `input` event). `\"platform\"`: a WebOTP fill (`details.event` is `undefined`).\n */\n readonly reason: ChangeReason;\n}\n\n/** The state the Root's and the Input's function props receive. */\nexport interface OTPFieldState {\n /** The text shown, already filtered: at most `length` characters of `charset`. */\n readonly value: string;\n /** The number of characters in a complete code. */\n readonly length: number;\n /** `value.length === length`. */\n readonly complete: boolean;\n /** A `completeAction` is in flight. */\n readonly pending: boolean;\n /** The `disabled` prop, or the enclosing Field's. */\n readonly disabled: boolean;\n /** The `readOnly` prop. */\n readonly readOnly: boolean;\n /** Inside a `Field.Root`: an error is shown for the field. `false` outside. */\n readonly invalid: boolean;\n}\n\n/**\n * Props of `OTPField.Root`.\n *\n * @see https://ui.funstack.work/components/otp-field\n */\nexport interface OTPFieldRootProps extends Omit<\n ComponentPropsWithRef<\"div\">,\n \"className\" | \"style\" | \"children\" | \"defaultValue\"\n> {\n /** The number of characters in a complete code. */\n length: number;\n /**\n * Which characters a code may contain; also picks the Input's `inputmode` and `pattern`.\n *\n * @defaultValue `\"numeric\"`\n */\n charset?: OTPFieldCharset;\n /** Controlled text. Follows the input: it cannot hold an edit back (the urgent lane). */\n value?: string;\n /**\n * Initial text in uncontrolled mode (filtered), and the form-reset target.\n *\n * @defaultValue `\"\"`\n */\n defaultValue?: string;\n /**\n * The text changed: an edit (`\"activate\"`), a form reset, text adopted at hydration or a WebOTP\n * fill (`\"platform\"`). A fact: called synchronously, outside any transition, not awaited.\n * Called before `completeAction` for the same edit.\n */\n onValueChange?: UrgentChangeHandler<string, OTPFieldValueChangeDetails>;\n /**\n * An edit left the code complete: runs in the Root's transition and is awaited, with\n * `data-pending` on the Root and the Input. Runs for every such edit, also while an earlier run\n * is pending (a different code), and for the same code pasted again. Not at mount, on a reset,\n * for a controlled change, or while disabled or read-only. A rejection reaches the nearest Error\n * Boundary. May be a Server Function.\n */\n completeAction?: Action<[value: string, details: OTPFieldCompleteDetails]>;\n /**\n * Submit the Input's form (`requestSubmit()`) when an edit leaves the code complete, right\n * after dispatching `completeAction`. A change of context on input (WCAG 3.2.2): say so before\n * the field.\n *\n * @defaultValue `false`\n */\n submitOnComplete?: boolean;\n /**\n * Native `name` on the Input.\n *\n * @defaultValue the Field's `name` inside a `Field.Root`\n */\n name?: string;\n /** Native `form` on the Input. */\n form?: string;\n /**\n * Native `required` on the Input; or the Field's.\n *\n * @defaultValue `false`\n */\n required?: boolean;\n /**\n * Native `disabled` on the Input; or the Field's.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Native `readonly` on the Input: no edits, no completion.\n *\n * @defaultValue `false`\n */\n readOnly?: boolean;\n /**\n * The native attribute, with a library default: a code is read left to right in every locale,\n * so the Slots, the Input's text and its caret keys stay left to right inside an RTL page.\n * Pass `\"rtl\"` for a code that is read right to left (the attribute has no value meaning\n * \"inherit\"). A `dir` on a `render` element wins as well.\n *\n * @defaultValue `\"ltr\"`\n */\n dir?: ComponentPropsWithRef<\"div\">[\"dir\"];\n /**\n * Ask the browser for the code of an origin-bound SMS (WebOTP, `navigator.credentials.get({\n * otp })`) while the Input is mounted. Chromium and Safari; nothing happens where the API is\n * missing (Firefox).\n *\n * @defaultValue `false`\n */\n experimental_webOTP?: boolean;\n /** Class name, or a function of the state that returns one. */\n className?: StateValue<string | undefined, OTPFieldState>;\n /** Inline style, or a function of the state that returns one. `position: relative` unless given. */\n style?: StateValue<CSSProperties | undefined, OTPFieldState>;\n /** The parts. The function form receives the state. */\n children?: StateValue<ReactNode, OTPFieldState>;\n /** Replace the default `<div>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"div\">, OTPFieldState>;\n}\n\nconst COMPLETE_TYPES = transitionTypes(\"otp-field\", \"complete\");\n\ninterface Selection {\n readonly focused: boolean;\n readonly start: number | null;\n readonly end: number | null;\n}\n\nconst BLURRED: Selection = { focused: false, start: null, end: null };\n\nfunction isFocused(input: HTMLInputElement): boolean {\n return input.ownerDocument.activeElement === input || input.matches(\":focus\");\n}\n\n/** Writes `value` into the input when it differs and puts the selection at `[start, end]`. */\nfunction writeInput(\n input: HTMLInputElement,\n value: string,\n start: number | null,\n end: number | null = start,\n): void {\n if (input.value !== value) input.value = value;\n if (start === null || end === null || !isFocused(input)) return;\n if (input.selectionStart !== start || input.selectionEnd !== end) {\n input.setSelectionRange(start, end);\n }\n}\n\n/** The development check of the mounted Slots' indices (design 1). */\nfunction slotIndexProblem(slots: Map<HTMLElement, number>, length: number): string | null {\n if (slots.size === 0) return null;\n const seen = new Set<number>();\n for (const index of slots.values()) {\n if (!Number.isInteger(index) || index < 0 || index >= length) {\n return `OTPField.Slot: index ${index} is outside 0 to ${length - 1} (length ${length}).`;\n }\n if (seen.has(index)) return `OTPField.Slot: index ${index} is used by more than one Slot.`;\n seen.add(index);\n }\n for (let i = 0; i < length; i++) {\n if (!seen.has(i)) {\n return (\n `OTPField.Slot: no Slot has index ${i} (length ${length}). Render one Slot per ` +\n \"position, or the code's characters are not all shown.\"\n );\n }\n }\n return null;\n}\n\n/**\n * Owns the text of a one-time-code field (design/components/otp-field.md): the urgent value\n * (`value` / `defaultValue` / `onValueChange`), the filter that keeps it a code, the selection the\n * Slots draw, the completion transition (`completeAction`, `submitOnComplete`), form reset,\n * hydration adoption and WebOTP. Renders a `div` with `position: relative`: the box the Input\n * covers.\n *\n * Owned keys (conventions 1.2): `data-complete`, `data-pending`, `data-disabled`,\n * `data-invalid` (inside a Field); `position` in `style` unless the consumer's style sets it.\n *\n * @see https://ui.funstack.work/components/otp-field\n */\nexport function OTPFieldRoot(props: OTPFieldRootProps) {\n const {\n length: lengthProp,\n charset: charsetProp = \"numeric\",\n value: valueProp,\n defaultValue,\n onValueChange,\n completeAction,\n submitOnComplete = false,\n name: nameProp,\n form,\n required: requiredProp = false,\n disabled: disabledProp = false,\n readOnly = false,\n // design/components/otp-field.md 4.4, conventions 14.1 rule 8: a pass-through prop with a\n // default, so a `render` element's own `dir` wins over it (conventions 1.2).\n dir = \"ltr\",\n experimental_webOTP: experimentalWebOTP = false,\n className,\n style,\n children,\n render,\n ...rest\n } = props;\n\n const lengthValid = Number.isInteger(lengthProp) && lengthProp > 0;\n const length = lengthValid ? lengthProp : Math.max(1, Math.floor(lengthProp) || 1);\n useDevWarning(\n !lengthValid,\n isDev && `OTPField.Root: \\`length\\` must be a positive integer; got ${String(lengthProp)}.`,\n );\n const charset: OTPFieldCharset =\n charsetProp === \"alphanumeric\" || charsetProp === \"alphabetic\" ? charsetProp : \"numeric\";\n\n // --- Field ----------------------------------------------------------------------------------\n\n // OTPField.Input registers the control (design 7); the Root resolves the defaults.\n const fieldContext = use(FieldContext);\n const { disabled, required, name } = resolveFieldDefaults(fieldContext, {\n name: nameProp,\n disabled: disabledProp,\n required: requiredProp,\n });\n const fieldInvalid = fieldContext === null ? undefined : fieldContext.state.invalid;\n\n // --- The text (design 3.2) ------------------------------------------------------------------\n\n const controlled = valueProp !== undefined;\n const controlledValue = controlled ? normalizeCode(valueProp, charset, length) : undefined;\n useDevWarning(\n controlled && controlledValue !== valueProp,\n isDev &&\n `OTPField.Root: the controlled \\`value\\` (\"${valueProp ?? \"\"}\") holds characters outside ` +\n `\\`charset\\` (\"${charset}\") or more than \\`length\\` (${length}); it is rendered as ` +\n `\"${controlledValue ?? \"\"}\".`,\n );\n const [internalValue, setInternalValue] = useState(() =>\n normalizeCode(defaultValue ?? \"\", charset, length),\n );\n const value = controlledValue ?? internalValue;\n const valueRef = useRef(value);\n // The latest value for handlers between two renders (two edits in one task).\n useLayoutEffect(() => {\n valueRef.current = value;\n });\n\n /** The raw text while a composition is open (design 4.1, Composition): rendered as is. */\n const [composingText, setComposingText] = useState<string | null>(null);\n const composingRef = useRef(false);\n const [selection, setSelection] = useState<Selection>(BLURRED);\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n const beforeRef = useRef<EditBefore | null>(null);\n /** The value change the Field is told about next was an edit (design 7: `takeEdit`). */\n const editRef = useRef(false);\n const webOTPAbort = useRef<AbortController | null>(null);\n /** A completion happened: no WebOTP request starts any more, and a late code is ignored. */\n const webOTPDone = useRef(false);\n /** `submitOnComplete` was held back by an open composition. */\n const submitAfterComposition = useRef(false);\n\n const { pending, run } = useActionTrigger();\n\n // The latest committed props and `run`, for the stable callbacks below. Named `*Ref` so that\n // React Compiler's lint treats `.current` as a ref read, not a missing memo dependency.\n // `run` is a new function on every render: reading it through the ref keeps every handler,\n // the context and the Input's listeners and WebOTP request stable across renders.\n const propsRef = useLatest({\n charset,\n length,\n disabled,\n readOnly,\n controlled,\n onValueChange,\n completeAction,\n submitOnComplete,\n run,\n notifyField: fieldContext?.notifyChange,\n });\n\n // --- Writes ---------------------------------------------------------------------------------\n\n /** Writes the value (urgent) and reports it to `onValueChange` (design 3.2). */\n const commitValue = useCallback(\n (next: string, reason: ChangeReason, event: Event | undefined, edit: boolean) => {\n const props = propsRef.current;\n editRef.current = edit;\n // Controlled: the value is the parent's until it renders it (it may not adopt the edit).\n if (!props.controlled) {\n valueRef.current = next;\n setInternalValue(next);\n }\n callUrgentHandler(\n props.onValueChange,\n next,\n createActionDetails(event, { reason }) as OTPFieldValueChangeDetails,\n );\n },\n [propsRef],\n );\n\n /** Submits the Input's form, after the Field re-validated the text just written (design 3.1). */\n const submit = useCallback(() => {\n const form = inputRef.current?.form;\n if (form == null) return;\n // The Field validated the browser's pre-filter text in its `input` listener; the commit\n // that re-validates the written text comes after this event. Refresh it now.\n propsRef.current.notifyField?.(true);\n form.requestSubmit();\n }, [propsRef]);\n\n /** The code is complete after an edit or a WebOTP fill (design 3.1). */\n const complete = useCallback(\n (code: string, reason: ChangeReason, event: Event | undefined, composing = false) => {\n const {\n disabled: off,\n readOnly: ro,\n completeAction: action,\n submitOnComplete: submitting,\n run: runAction,\n } = propsRef.current;\n if (off || ro) return;\n // A code completed by hand makes a waiting WebOTP request moot (design 8), and no new one\n // starts after it.\n webOTPDone.current = true;\n webOTPAbort.current?.abort();\n webOTPAbort.current = null;\n if (action !== undefined) {\n const details = createActionDetails(event, { reason }) as OTPFieldCompleteDetails;\n runAction(() => {\n for (const type of COMPLETE_TYPES) addTransitionType(type);\n return action(code, details);\n });\n }\n if (!submitting) return;\n // The IME has not committed the text yet: submit at `compositionend` (design 4.1).\n if (composing) submitAfterComposition.current = true;\n else submit();\n },\n [propsRef, submit],\n );\n\n const readSelection = useCallback(() => {\n const input = inputRef.current;\n const next: Selection =\n input === null || !isFocused(input)\n ? BLURRED\n : { focused: true, start: input.selectionStart, end: input.selectionEnd };\n setSelection((prev) =>\n prev.focused === next.focused && prev.start === next.start && prev.end === next.end\n ? prev\n : next,\n );\n }, []);\n\n // --- Editing (design 4.1) -------------------------------------------------------------------\n\n const beforeInput = useCallback((event: InputEvent) => {\n const input = event.target as HTMLInputElement;\n beforeRef.current = {\n text: input.value,\n selectionStart: input.selectionStart ?? input.value.length,\n selectionEnd: input.selectionEnd ?? input.value.length,\n };\n }, []);\n\n const change = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const input = event.currentTarget;\n const native = event.nativeEvent as Partial<InputEvent> & Event;\n const before = beforeRef.current;\n beforeRef.current = null;\n const { charset: cs, length: len, disabled: off, readOnly: ro } = propsRef.current;\n if (off || ro) return;\n\n if (composingRef.current || native.isComposing === true) {\n // Derive always, write when allowed: the composition keeps its text in the input.\n const next = normalizeCode(input.value, cs, len);\n setComposingText(input.value);\n readSelection();\n if (next === valueRef.current) return;\n commitValue(next, \"activate\", native, true);\n if (next.length === len) complete(next, \"activate\", native, true);\n return;\n }\n\n const result = applyEdit({\n before,\n dom: input.value,\n caret: input.selectionStart,\n inputType: native.inputType ?? \"\",\n charset: cs,\n length: len,\n });\n setComposingText(null);\n if (result.selection !== null) {\n writeInput(input, result.value, result.selection[0], result.selection[1]);\n } else {\n writeInput(input, result.value, result.caret);\n }\n readSelection();\n const changed = result.value !== valueRef.current;\n if (changed) commitValue(result.value, \"activate\", native, true);\n if (result.value.length === len && (changed || result.kept > 0)) {\n complete(result.value, \"activate\", native);\n }\n },\n [commitValue, complete, propsRef, readSelection],\n );\n\n const compositionStart = useCallback(() => {\n composingRef.current = true;\n }, []);\n\n const compositionEnd = useCallback(\n (event: CompositionEvent) => {\n composingRef.current = false;\n const input = inputRef.current;\n setComposingText(null);\n if (input === null) return;\n const { charset: cs, length: len } = propsRef.current;\n const dom = input.value;\n const next = normalizeCode(dom, cs, len);\n const caret = Math.min(\n filterChars(dom.slice(0, input.selectionStart ?? dom.length), cs).length,\n next.length,\n );\n writeInput(input, next, caret);\n readSelection();\n const held = submitAfterComposition.current;\n submitAfterComposition.current = false;\n if (next !== valueRef.current) {\n commitValue(next, \"activate\", event, true);\n if (next.length === len) complete(next, \"activate\", event);\n return;\n }\n // The code was completed while composing: the submission held back then goes now.\n if (held && next.length === len && propsRef.current.submitOnComplete) submit();\n },\n [commitValue, complete, propsRef, readSelection, submit],\n );\n\n const blurred = useCallback(() => {\n setSelection(BLURRED);\n }, []);\n\n // --- The pointer (design 4.3) ---------------------------------------------------------------\n\n const slots = useRef(new Map<HTMLElement, number>());\n const registerSlot = useCallback((index: number, element: HTMLElement) => {\n slots.current.set(element, index);\n return () => {\n if (slots.current.get(element) === index) slots.current.delete(element);\n };\n }, []);\n\n const click = useCallback((event: MouseEvent) => {\n const input = inputRef.current;\n // A double click selects; a drag made a range: the browser's selection stands.\n if (input === null || event.detail > 1 || input.selectionStart !== input.selectionEnd) return;\n let target: number | null = null;\n let distance = Infinity;\n for (const [element, index] of slots.current) {\n const box = element.getBoundingClientRect();\n if (box.width === 0 && box.height === 0) continue;\n const dx = Math.max(box.left - event.clientX, 0, event.clientX - box.right);\n const dy = Math.max(box.top - event.clientY, 0, event.clientY - box.bottom);\n const d = dx * dx + dy * dy;\n if (d < distance) {\n distance = d;\n target = index;\n }\n }\n if (target === null) return;\n const caret = Math.min(target, input.value.length);\n if (input.selectionStart !== caret || input.selectionEnd !== caret) {\n input.setSelectionRange(caret, caret);\n }\n }, []);\n\n // --- Residual paths: hydration, reset, WebOTP (design 7, 8, 9) -----------------------------\n\n const inputMounted = useCallback(() => {\n const input = inputRef.current;\n if (input === null) return;\n const { charset: cs, length: len } = propsRef.current;\n const dom = input.value;\n const next = normalizeCode(dom, cs, len);\n if (dom !== next) input.value = next;\n // No completion for adopted text (design 9): a restored code is not a fresh one.\n if (next !== valueRef.current) commitValue(next, \"platform\", undefined, false);\n }, [commitValue, propsRef]);\n\n const resetTarget = normalizeCode(useResetTarget(valueProp, defaultValue) ?? \"\", charset, length);\n const [resync, setResync] = useState(0);\n const inputText = composingText ?? value;\n const inputTextRef = useLatest(inputText);\n useLayoutEffect(() => {\n // A controlled parent that did not adopt the reset gets the DOM put back.\n const input = inputRef.current;\n if (resync > 0 && input !== null && input.value !== inputTextRef.current) {\n input.value = inputTextRef.current;\n }\n }, [resync, inputTextRef]);\n useFormReset(\n inputRef as RefObject<FormAssociatedElement | null>,\n (event) => {\n composingRef.current = false;\n setComposingText(null);\n // The target is computed, not read from the input: after a click on a reset button this\n // microtask runs before the browser's reset algorithm (there is a microtask checkpoint\n // after each `reset` listener), so the input may still hold the old text here.\n if (resetTarget !== valueRef.current) commitValue(resetTarget, \"platform\", event, false);\n setResync((n) => n + 1);\n },\n () => {\n // react-dom rewrites a controlled input's `defaultValue` after every update; the reset\n // target is written right before the browser's reset algorithm reads it.\n const input = inputRef.current;\n if (input !== null && input.defaultValue !== resetTarget) input.defaultValue = resetTarget;\n },\n );\n\n const webOTPCode = useCallback(\n (code: string) => {\n const { charset: cs, length: len, disabled: off, readOnly: ro } = propsRef.current;\n if (off || ro || webOTPDone.current) return;\n const next = filterChars(code, cs);\n if (next.length !== len) return;\n // Written now, so that `submitOnComplete` posts it before React renders.\n const input = inputRef.current;\n if (input !== null) input.value = next;\n if (next !== valueRef.current) commitValue(next, \"platform\", undefined, true);\n complete(next, \"platform\", undefined);\n },\n [commitValue, complete, propsRef],\n );\n\n // A write-back or a WebOTP fill changed the value with no event the Field heard after it.\n useFieldValueChange(value, () => {\n const edit = editRef.current;\n editRef.current = false;\n return edit;\n });\n\n // --- Development warnings -------------------------------------------------------------------\n\n const slotWarned = useRef(false);\n useLayoutEffect(() => {\n if (!isDev || slotWarned.current) return;\n const problem = slotIndexProblem(slots.current, length);\n if (problem === null) return;\n slotWarned.current = true;\n console.error(problem);\n });\n\n // --- Render ---------------------------------------------------------------------------------\n\n const state = useMemo<OTPFieldState>(\n () => ({\n value,\n length,\n complete: value.length === length,\n pending,\n disabled,\n readOnly,\n invalid: fieldInvalid === true,\n }),\n [value, length, pending, disabled, readOnly, fieldInvalid],\n );\n\n const [activeFrom, activeTo] = activeRange(\n selection.focused,\n selection.start,\n selection.end,\n length,\n );\n\n const context = useMemo<OTPFieldContextValue>(\n () => ({\n state,\n charset,\n name,\n form,\n required,\n fieldInvalid,\n inputText,\n active: [activeFrom, activeTo],\n experimentalWebOTP,\n inputRef,\n change,\n beforeInput,\n compositionStart,\n compositionEnd,\n selectionChanged: readSelection,\n blurred,\n click,\n inputMounted,\n webOTPCode,\n registerSlot,\n webOTPAbort,\n webOTPDone,\n }),\n [\n state,\n charset,\n name,\n form,\n required,\n fieldInvalid,\n inputText,\n activeFrom,\n activeTo,\n experimentalWebOTP,\n change,\n beforeInput,\n compositionStart,\n compositionEnd,\n readSelection,\n blurred,\n click,\n inputMounted,\n webOTPCode,\n registerSlot,\n ],\n );\n\n const libraryProps: Partial<ComponentPropsWithRef<\"div\">> & DataAttributes = {\n ...(fieldContext !== null ? { \"data-invalid\": dataAttr(fieldInvalid === true) } : {}),\n \"data-complete\": dataAttr(state.complete),\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n };\n\n const element = useRender<ComponentPropsWithRef<\"div\">, OTPFieldState>({\n defaultElement: \"div\",\n render,\n state,\n className,\n // `position: relative` is the Input's containing block (design 6), unless the consumer's\n // style places the Root itself.\n style: (s) => ({ position: \"relative\", ...resolveStateValue(style, s) }),\n children,\n props: { ...rest, dir },\n libraryProps,\n });\n\n return <OTPFieldContext value={context}>{element}</OTPFieldContext>;\n}\n\nOTPFieldRoot.displayName = \"OTPFieldRoot\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4CA,MAAM,QAAQ,QAAQ,IAAI,aAAa;AA2IvC,MAAM,iBAAiB,gBAAgB,aAAa,UAAU;AAQ9D,MAAM,UAAqB;CAAE,SAAS;CAAO,OAAO;CAAM,KAAK;AAAK;AAEpE,SAAS,UAAU,OAAkC;CACnD,OAAO,MAAM,cAAc,kBAAkB,SAAS,MAAM,QAAQ,QAAQ;AAC9E;;AAGA,SAAS,WACP,OACA,OACA,OACA,MAAqB,OACf;CACN,IAAI,MAAM,UAAU,OAAO,MAAM,QAAQ;CACzC,IAAI,UAAU,QAAQ,QAAQ,QAAQ,CAAC,UAAU,KAAK,GAAG;CACzD,IAAI,MAAM,mBAAmB,SAAS,MAAM,iBAAiB,KAC3D,MAAM,kBAAkB,OAAO,GAAG;AAEtC;;AAGA,SAAS,iBAAiB,OAAiC,QAA+B;CACxF,IAAI,MAAM,SAAS,GAAG,OAAO;CAC7B,MAAM,uBAAO,IAAI,IAAY;CAC7B,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GAAG,kBAAkB,OAAO,CAAC;EAAE;EACtE;EACA,OAAO;GAAE,GAAG;GAAM;EAAI;EACtB;CACF,CAAC;CAED,OAAO,oBAAC,iBAAD;EAAiB,OAAO;EAAU,UAAA;CAAyB,CAAA;AACpE;AAEA,aAAa,cAAc"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
1
2
|
import { RenderProp, StateValue } from "../internal/types.mjs";
|
|
2
3
|
import { OTPFieldState } from "./otp-field-root.mjs";
|
|
3
|
-
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
4
|
-
//#region src/otp-field/otp-field-slot.d.ts
|
|
5
4
|
/** The state a Slot's function props receive. */
|
|
6
5
|
export interface OTPFieldSlotState extends OTPFieldState {
|
|
7
6
|
/** The Slot's `index`. */
|
|
@@ -48,5 +47,4 @@ export declare function OTPFieldSlot({ index, className, style, children, render
|
|
|
48
47
|
export declare namespace OTPFieldSlot {
|
|
49
48
|
var displayName: string;
|
|
50
49
|
}
|
|
51
|
-
//#endregion
|
|
52
50
|
//# sourceMappingURL=otp-field-slot.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp-field-slot.d.mts","names":[],"sources":["../../src/otp-field/otp-field-slot.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"otp-field-slot.d.mts","names":[],"sources":["../../src/otp-field/otp-field-slot.tsx"],"mappings":";;;;iBAWiB,0BAA0B;;WAEhC;;WAEA;;WAEA;;WAEA;;;;;;;iBAQM,0BAA0B,KACzC;;EAIA;;EAEA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;;;;EAK9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,+BAA+B;;;;;;;;;;;;;wBAyBrC,eACd,OACA,WACA,OACA,UACA,WACG,QACF,oBAAiB;yBAPJ"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
2
3
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
4
|
import { useRender } from "../internal/use-render.mjs";
|
|
4
5
|
import { useOTPFieldContext } from "./otp-field-context.mjs";
|
|
5
|
-
|
|
6
|
-
//#region src/otp-field/otp-field-slot.tsx
|
|
6
|
+
// src/otp-field/otp-field-slot.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Never the pointer's target (design 1, 6): a Slot that forms a stacking context (`opacity`,
|
|
9
9
|
* `position`, `transform`, an animation of those) would otherwise paint over the Input and take
|
|
@@ -61,7 +61,6 @@ function OTPFieldSlot({ index, className, style, children, render, ...rest }) {
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
OTPFieldSlot.displayName = "OTPFieldSlot";
|
|
64
|
-
//#endregion
|
|
65
64
|
export { OTPFieldSlot };
|
|
66
65
|
|
|
67
66
|
//# sourceMappingURL=otp-field-slot.mjs.map
|
package/dist/popover/index.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import "../internal/platform-attributes.mjs";
|
|
2
2
|
import { PopoverClose, PopoverCloseProps, PopoverCloseState } from "./popover-close.mjs";
|
|
3
|
-
import { PopoverAlign, PopoverPopup, PopoverPopupProps, PopoverPopupState, PopoverSide } from "./popover-popup.mjs";
|
|
4
3
|
import { PopoverDescription, PopoverDescriptionProps, PopoverDescriptionState } from "./popover-description.mjs";
|
|
4
|
+
import { PopoverAlign, PopoverPopup, PopoverPopupProps, PopoverPopupState, PopoverSide } from "./popover-popup.mjs";
|
|
5
5
|
import { PopoverOpenChangeDetails, PopoverRoot, PopoverRootProps, PopoverRootState } from "./popover-root.mjs";
|
|
6
6
|
import { PopoverTitle, PopoverTitleProps, PopoverTitleState } from "./popover-title.mjs";
|
|
7
7
|
import { PopoverTrigger, PopoverTriggerProps, PopoverTriggerState } from "./popover-trigger.mjs";
|
|
8
|
-
//#region src/popover/index.d.ts
|
|
9
8
|
/**
|
|
10
9
|
* Popover built on `popover="auto"` and Invoker Commands: `Root` (no DOM) > `Trigger`
|
|
11
10
|
* (`button[popovertarget]`) + `Popup` (`dialog[popover=auto][aria-modal=false]`) >
|
|
@@ -25,6 +24,5 @@ export declare const Popover: {
|
|
|
25
24
|
readonly Title: typeof PopoverTitle;
|
|
26
25
|
readonly Description: typeof PopoverDescription;
|
|
27
26
|
};
|
|
28
|
-
//#endregion
|
|
29
27
|
export type { PopoverAlign, PopoverCloseProps, PopoverCloseState, PopoverDescriptionProps, PopoverDescriptionState, PopoverOpenChangeDetails, PopoverPopupProps, PopoverPopupState, PopoverRootProps, PopoverRootState, PopoverSide, PopoverTitleProps, PopoverTitleState, PopoverTriggerProps, PopoverTriggerState };
|
|
30
28
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/popover/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/popover/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;qBAqBa;WACX,aAAI;WACJ,gBAAO;WACP,cAAK;WACL,cAAK;WACL,cAAK;WACL,oBAAW"}
|
package/dist/popover/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { PopoverPopup } from "./popover-popup.mjs";
|
|
|
4
4
|
import { PopoverRoot } from "./popover-root.mjs";
|
|
5
5
|
import { PopoverTitle } from "./popover-title.mjs";
|
|
6
6
|
import { PopoverTrigger } from "./popover-trigger.mjs";
|
|
7
|
-
|
|
7
|
+
// src/popover/index.ts
|
|
8
8
|
/**
|
|
9
9
|
* Popover built on `popover="auto"` and Invoker Commands: `Root` (no DOM) > `Trigger`
|
|
10
10
|
* (`button[popovertarget]`) + `Popup` (`dialog[popover=auto][aria-modal=false]`) >
|
|
@@ -24,7 +24,6 @@ const Popover = {
|
|
|
24
24
|
Title: PopoverTitle,
|
|
25
25
|
Description: PopoverDescription
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
export { Popover };
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { Action, ActionDetails, RenderProp, StateValue, WhilePending } from "../internal/types.mjs";
|
|
2
1
|
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
3
|
-
|
|
2
|
+
import { Action, ActionDetails, RenderProp, StateValue, WhilePending } from "../internal/types.mjs";
|
|
4
3
|
/**
|
|
5
4
|
* State of `Popover.Close`, passed to the function forms of `className`, `style`, `children` and
|
|
6
5
|
* `render`.
|
|
7
6
|
*/
|
|
8
7
|
export interface PopoverCloseState {
|
|
9
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* From the click until the close this part asked for has committed: the `action` in flight,
|
|
10
|
+
* then the Root's close (an awaited `openChangeAction(false)`, or another pending action the
|
|
11
|
+
* close is entangled with). Also without `action`, in library mode.
|
|
12
|
+
*/
|
|
10
13
|
readonly pending: boolean;
|
|
11
14
|
/** The `disabled` prop. */
|
|
12
15
|
readonly disabled: boolean;
|
|
@@ -33,7 +36,8 @@ export interface PopoverCloseProps extends Omit<ComponentPropsWithRef<"button">,
|
|
|
33
36
|
* cancelled, `aria-disabled="true"` meanwhile). `"run"`: the action runs again (`data-pending`
|
|
34
37
|
* until every run has settled); the popover closes once, when the last run settles and only
|
|
35
38
|
* if the latest run resolved (a rejection leaves it open, as in `"ignore"` mode). No effect
|
|
36
|
-
* without `action
|
|
39
|
+
* without `action`: the part then shows `data-pending` while the Root's close waits, without
|
|
40
|
+
* `aria-disabled`.
|
|
37
41
|
*
|
|
38
42
|
* @defaultValue `"ignore"`
|
|
39
43
|
*/
|
|
@@ -63,7 +67,8 @@ export interface PopoverCloseProps extends Omit<ComponentPropsWithRef<"button">,
|
|
|
63
67
|
* commit). With `action` the action runs first in this part's own transition (`data-pending` on
|
|
64
68
|
* the button, with `aria-disabled`; a second click meanwhile is ignored unless
|
|
65
69
|
* `whilePending="run"`); a rejection leaves the
|
|
66
|
-
* popover open.
|
|
70
|
+
* popover open. With or without `action`, the button has `data-pending` until the close it
|
|
71
|
+
* asked for has committed. It keeps `commandfor` where the Trigger has `popovertarget`: an invoker
|
|
67
72
|
* inside its own popover exposes no state either way, and the `command` event tells the Popup a
|
|
68
73
|
* foreign hide's reason.
|
|
69
74
|
*
|
|
@@ -77,5 +82,4 @@ export declare function PopoverClose({ action, whilePending, disabled, className
|
|
|
77
82
|
export declare namespace PopoverClose {
|
|
78
83
|
var displayName: string;
|
|
79
84
|
}
|
|
80
|
-
//#endregion
|
|
81
85
|
//# sourceMappingURL=popover-close.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-close.d.mts","names":[],"sources":["../../src/popover/popover-close.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-close.d.mts","names":[],"sources":["../../src/popover/popover-close.tsx"],"mappings":";;;;;;iBAkBiB;;;;;;WAMN;;WAEA;;;;;;;iBAQM,0BAA0B,KACzC;;;;;;;;;;;EAaA,SAAS,QAAQ,SAAS;;;;;;;;;;;EAW1B,eAAe;;;;;;;;EAQf;;EAEA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;;;;;;;;wBAsBvC,eACd,QACA,cACA,UACA,WACA,OACA,UACA,WACG,QACF,oBAAiB;yBATJ"}
|
|
@@ -3,7 +3,7 @@ import { createActionDetails } from "../internal/action/action-details.mjs";
|
|
|
3
3
|
import { isPopoverOpen } from "../internal/overlay/popover-open.mjs";
|
|
4
4
|
import { useOverlayClose } from "../internal/overlay/use-overlay-close.mjs";
|
|
5
5
|
import { usePopoverContext } from "./popover-context.mjs";
|
|
6
|
-
|
|
6
|
+
// src/popover/popover-close.tsx
|
|
7
7
|
/**
|
|
8
8
|
* A close button: `<button type="button" commandfor command="hide-popover">`, or a plain
|
|
9
9
|
* `<button type="button">` with `action` (it does nothing before hydration). In JS-free mode
|
|
@@ -12,7 +12,8 @@ import { usePopoverContext } from "./popover-context.mjs";
|
|
|
12
12
|
* commit). With `action` the action runs first in this part's own transition (`data-pending` on
|
|
13
13
|
* the button, with `aria-disabled`; a second click meanwhile is ignored unless
|
|
14
14
|
* `whilePending="run"`); a rejection leaves the
|
|
15
|
-
* popover open.
|
|
15
|
+
* popover open. With or without `action`, the button has `data-pending` until the close it
|
|
16
|
+
* asked for has committed. It keeps `commandfor` where the Trigger has `popovertarget`: an invoker
|
|
16
17
|
* inside its own popover exposes no state either way, and the `command` event tells the Popup a
|
|
17
18
|
* foreign hide's reason.
|
|
18
19
|
*
|
|
@@ -58,7 +59,6 @@ function PopoverClose({ action, whilePending, disabled = false, className, style
|
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
61
|
PopoverClose.displayName = "PopoverClose";
|
|
61
|
-
//#endregion
|
|
62
62
|
export { PopoverClose };
|
|
63
63
|
|
|
64
64
|
//# sourceMappingURL=popover-close.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-close.mjs","names":[],"sources":["../../src/popover/popover-close.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { createActionDetails } from \"../internal/action/action-details.js\";\nimport { isPopoverOpen } from \"../internal/overlay/popover-open.js\";\nimport type {\n Action,\n ActionDetails,\n RenderProp,\n StateValue,\n WhilePending,\n} from \"../internal/types.js\";\nimport { useOverlayClose } from \"../internal/overlay/use-overlay-close.js\";\nimport { usePopoverContext } from \"./popover-context.js\";\n\n/**\n * State of `Popover.Close`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface PopoverCloseState {\n
|
|
1
|
+
{"version":3,"file":"popover-close.mjs","names":[],"sources":["../../src/popover/popover-close.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { createActionDetails } from \"../internal/action/action-details.js\";\nimport { isPopoverOpen } from \"../internal/overlay/popover-open.js\";\nimport type {\n Action,\n ActionDetails,\n RenderProp,\n StateValue,\n WhilePending,\n} from \"../internal/types.js\";\nimport { useOverlayClose } from \"../internal/overlay/use-overlay-close.js\";\nimport { usePopoverContext } from \"./popover-context.js\";\n\n/**\n * State of `Popover.Close`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface PopoverCloseState {\n /**\n * From the click until the close this part asked for has committed: the `action` in flight,\n * then the Root's close (an awaited `openChangeAction(false)`, or another pending action the\n * close is entangled with). Also without `action`, in library mode.\n */\n readonly pending: boolean;\n /** The `disabled` prop. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `Popover.Close`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverCloseProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n \"onClick\" | \"className\" | \"style\" | \"children\"\n> {\n /**\n * Runs inside this part's own transition (`data-pending` on the button), then closes the\n * popover: in library mode through the Root (`openChangeAction(false)` awaited, view\n * transition if set), in JS-free mode with `hidePopover()`. A rejection reaches the nearest\n * Error Boundary above the Close part and leaves the popover open. If the popover was\n * dismissed and opened again while the action ran, the close is dropped. With `action` the\n * button is no native close invoker (no `commandfor` / `command`), so a click before hydration\n * does nothing instead of hiding the popover without running the action. Without `action` in\n * JS-free mode the button is a native `command=\"hide-popover\"` invoker.\n */\n action?: Action<[details: ActionDetails]>;\n /**\n * What a click does while this part's `action` is pending. `\"ignore\"`: nothing (the click is\n * cancelled, `aria-disabled=\"true\"` meanwhile). `\"run\"`: the action runs again (`data-pending`\n * until every run has settled); the popover closes once, when the last run settles and only\n * if the latest run resolved (a rejection leaves it open, as in `\"ignore\"` mode). No effect\n * without `action`: the part then shows `data-pending` while the Root's close waits, without\n * `aria-disabled`.\n *\n * @defaultValue `\"ignore\"`\n */\n whilePending?: WhilePending;\n /**\n * Never closes. Native `disabled` on a `<button>`; owned, so a `render` element cannot\n * re-enable it. With a link or component `render` whose click this part handles (library mode,\n * or with `action`), `aria-disabled=\"true\"` instead: the element stays focusable.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, PopoverCloseState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, PopoverCloseState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, PopoverCloseState>;\n /** Replace the default `<button>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, PopoverCloseState>;\n}\n\n/**\n * A close button: `<button type=\"button\" commandfor command=\"hide-popover\">`, or a plain\n * `<button type=\"button\">` with `action` (it does nothing before hydration). In JS-free mode\n * without `action` the browser hides the popover. In library mode the click is always cancelled\n * and the close goes through the Root (`openChangeAction(false)` awaited, `hidePopover()` in the\n * commit). With `action` the action runs first in this part's own transition (`data-pending` on\n * the button, with `aria-disabled`; a second click meanwhile is ignored unless\n * `whilePending=\"run\"`); a rejection leaves the\n * popover open. With or without `action`, the button has `data-pending` until the close it\n * asked for has committed. It keeps `commandfor` where the Trigger has `popovertarget`: an invoker\n * inside its own popover exposes no state either way, and the `command` event tells the Popup a\n * foreign hide's reason.\n *\n * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `commandfor`,\n * `command` (neither rendered with `action`), `onClick` (library mode, or with `action`), `aria-disabled`, `data-pending`,\n * `data-disabled`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverClose({\n action,\n whilePending,\n disabled = false,\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverCloseProps) {\n const ctx = usePopoverContext(\"Popover.Close\");\n const { popupRef, recordCloseIntent } = ctx;\n const isLibrary = ctx.mode === \"library\";\n return useOverlayClose({\n part: \"Popover.Close\",\n noun: \"popover\",\n isLibrary,\n popupId: ctx.ids.popup,\n command: \"hide-popover\",\n openGeneration: ctx.openGeneration,\n action,\n whilePending,\n details: (event) => createActionDetails(event, {}),\n close: (event) => {\n if (isLibrary) {\n // A library-owned close (design 2.3): awaited, then hidden in the commit.\n ctx.requestClose(event, \"activate\");\n return;\n }\n // JS-free mode with `action`: a browser-owned close; there is no Root state to notify.\n const popup = popupRef.current;\n if (popup === null || !popup.isConnected || !isPopoverOpen(popup)) return;\n recordCloseIntent({ reason: \"activate\", event });\n popup.hidePopover();\n },\n disabled,\n className,\n style,\n children,\n render,\n rest,\n });\n}\n\nPopoverClose.displayName = \"PopoverClose\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiGA,SAAgB,aAAa,EAC3B,QACA,cACA,WAAW,OACX,WACA,OACA,UACA,QACA,GAAG,QACiB;CACpB,MAAM,MAAM,kBAAkB,eAAe;CAC7C,MAAM,EAAE,UAAU,sBAAsB;CACxC,MAAM,YAAY,IAAI,SAAS;CAC/B,OAAO,gBAAgB;EACrB,MAAM;EACN,MAAM;EACN;EACA,SAAS,IAAI,IAAI;EACjB,SAAS;EACT,gBAAgB,IAAI;EACpB;EACA;EACA,UAAU,UAAU,oBAAoB,OAAO,CAAC,CAAC;EACjD,QAAQ,UAAU;GAChB,IAAI,WAAW;IAEb,IAAI,aAAa,OAAO,UAAU;IAClC;GACF;GAEA,MAAM,QAAQ,SAAS;GACvB,IAAI,UAAU,QAAQ,CAAC,MAAM,eAAe,CAAC,cAAc,KAAK,GAAG;GACnE,kBAAkB;IAAE,QAAQ;IAAY;GAAM,CAAC;GAC/C,MAAM,YAAY;EACpB;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AAEA,aAAa,cAAc"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createContext, use } from "react";
|
|
3
|
-
|
|
3
|
+
// src/popover/popover-context.ts
|
|
4
4
|
const PopoverContext = createContext(null);
|
|
5
5
|
function usePopoverContext(part) {
|
|
6
6
|
const context = use(PopoverContext);
|
|
@@ -20,7 +20,6 @@ function usePopoverPopupState(ctx) {
|
|
|
20
20
|
align: "center"
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { PopoverContext, PopoverPopupContext, usePopoverContext, usePopoverPopupState };
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=popover-context.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
1
2
|
import { RenderProp, StateValue } from "../internal/types.mjs";
|
|
2
3
|
import { PopoverPopupState } from "./popover-popup.mjs";
|
|
3
|
-
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
4
|
-
//#region src/popover/popover-description.d.ts
|
|
5
4
|
/** State of `Popover.Description`: the Popup's state. */
|
|
6
5
|
export type PopoverDescriptionState = PopoverPopupState;
|
|
7
6
|
/**
|
|
@@ -30,5 +29,4 @@ export declare function PopoverDescription({ className, style, children, render,
|
|
|
30
29
|
export declare namespace PopoverDescription {
|
|
31
30
|
var displayName: string;
|
|
32
31
|
}
|
|
33
|
-
//#endregion
|
|
34
32
|
//# sourceMappingURL=popover-description.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-description.d.mts","names":[],"sources":["../../src/popover/popover-description.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-description.d.mts","names":[],"sources":["../../src/popover/popover-description.tsx"],"mappings":";;;;YAQY,0BAA0B;;;;;;iBAOrB,gCAAgC,KAC/C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,4BAA4B;;;;;;;;;wBAUlC,qBACd,WACA,OACA,UACA,WACG,QACF,0BAAuB;yBANV"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRender } from "../internal/use-render.mjs";
|
|
3
3
|
import { usePopoverContext, usePopoverPopupState } from "./popover-context.mjs";
|
|
4
|
-
|
|
4
|
+
// src/popover/popover-description.tsx
|
|
5
5
|
/**
|
|
6
6
|
* The popover's description: a `<p>` whose id the Popup references with `aria-describedby`.
|
|
7
7
|
*
|
|
@@ -24,7 +24,6 @@ function PopoverDescription({ className, style, children, render, ...rest }) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
PopoverDescription.displayName = "PopoverDescription";
|
|
27
|
-
//#endregion
|
|
28
27
|
export { PopoverDescription };
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=popover-description.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { RenderProp, StateValue } from "../internal/types.mjs";
|
|
2
|
-
import { AnchorAlign, AnchorSide } from "../internal/overlay/anchor-position.mjs";
|
|
3
1
|
import { CSSProperties, ComponentPropsWithRef, ReactNode, RefObject, ViewTransitionClass } from "react";
|
|
4
|
-
|
|
2
|
+
import { AnchorAlign, AnchorSide } from "../internal/overlay/anchor-position.mjs";
|
|
3
|
+
import { RenderProp, StateValue } from "../internal/types.mjs";
|
|
5
4
|
/** `inline-start` / `inline-end` follow the popup's `direction` (conventions 13.1). */
|
|
6
5
|
export type PopoverSide = AnchorSide;
|
|
7
6
|
/**
|
|
@@ -124,5 +123,4 @@ export declare function PopoverPopup({ side: sideProp, align: alignProp, keepMou
|
|
|
124
123
|
export declare namespace PopoverPopup {
|
|
125
124
|
var displayName: string;
|
|
126
125
|
}
|
|
127
|
-
//#endregion
|
|
128
126
|
//# sourceMappingURL=popover-popup.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-popup.d.mts","names":[],"sources":["../../src/popover/popover-popup.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-popup.d.mts","names":[],"sources":["../../src/popover/popover-popup.tsx"],"mappings":";;;;YAoBY,cAAc;;;;;YAKd,eAAe;;;;;iBAMV;;;;;WAKN;;;;;WAKA,MAAM;;WAEN,OAAO;;;;;;;iBAQD,0BAA0B,KACzC;;;;;;;;;EAmBA,OAAO;;;;;;;;EAQP,QAAQ;;;;;;;;;;;;;EAaR;;;;;;;;;;;;EAYA,eAAe,UAAU;;;;;;;;;;;;;;;EAezB,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;wBAwBvC,eACd,MAAM,UACN,OAAO,WACP,aACA,cACA,YACA,WACA,OACA,UACA,WACG,QACF,oBAAiB;yBAXJ"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
|
|
3
3
|
import { resolveStateValue } from "../internal/render-element.mjs";
|
|
4
|
-
import { useRender } from "../internal/use-render.mjs";
|
|
5
|
-
import { useMergedRefs } from "../internal/use-merged-refs.mjs";
|
|
6
|
-
import { useAnchoredPlacement } from "../internal/overlay/use-resolved-placement.mjs";
|
|
7
4
|
import { useJsFreePropWarnings } from "../internal/overlay/overlay-popup.mjs";
|
|
5
|
+
import { useMergedRefs } from "../internal/use-merged-refs.mjs";
|
|
8
6
|
import { usePopoverPopup } from "../internal/overlay/use-popover-popup.mjs";
|
|
7
|
+
import { useAnchoredPlacement } from "../internal/overlay/use-resolved-placement.mjs";
|
|
8
|
+
import { useRender } from "../internal/use-render.mjs";
|
|
9
9
|
import { PopoverPopupContext, usePopoverContext } from "./popover-context.mjs";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
|
|
11
|
+
// src/popover/popover-popup.tsx
|
|
12
12
|
/**
|
|
13
13
|
* The popover itself: a `<dialog popover="auto" aria-modal="false" role="dialog">` with the id
|
|
14
14
|
* the Trigger's `popovertarget` names, placed against the Trigger with CSS Anchor Positioning and
|
|
@@ -82,7 +82,6 @@ function PopoverPopup({ side: sideProp = "bottom", align: alignProp = "center",
|
|
|
82
82
|
return useTransitionBoundary("Popover.Popup", isLibrary ? transition : void 0, element);
|
|
83
83
|
}
|
|
84
84
|
PopoverPopup.displayName = "PopoverPopup";
|
|
85
|
-
//#endregion
|
|
86
85
|
export { PopoverPopup };
|
|
87
86
|
|
|
88
87
|
//# sourceMappingURL=popover-popup.mjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ActionDetails, ChangeAction, ChangeReason, StateValue, UrgentChangeHandler } from "../internal/types.mjs";
|
|
2
1
|
import { ReactNode } from "react";
|
|
3
|
-
|
|
2
|
+
import { ActionDetails, ChangeAction, ChangeReason, StateValue, UrgentChangeHandler } from "../internal/types.mjs";
|
|
4
3
|
/** Details passed as the second argument of `openChangeAction` and `onOpenChange`. */
|
|
5
4
|
export interface PopoverOpenChangeDetails extends ActionDetails {
|
|
6
5
|
/**
|
|
@@ -82,5 +81,4 @@ export declare function PopoverRoot({ open, defaultOpen, openChangeAction, onOpe
|
|
|
82
81
|
export declare namespace PopoverRoot {
|
|
83
82
|
var displayName: string;
|
|
84
83
|
}
|
|
85
|
-
//#endregion
|
|
86
84
|
//# sourceMappingURL=popover-root.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-root.d.mts","names":[],"sources":["../../src/popover/popover-root.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-root.d.mts","names":[],"sources":["../../src/popover/popover-root.tsx"],"mappings":";;;iBAciB,iCAAiC;;;;;;;;;WASvC,QAAQ;;;iBAIF;;WAEN;;WAEA;;;;;;;iBAQM;;;;;;EAMf;;;;;EAKA;;;;;;;;;;;EAWA,mBAAmB,sBAAsB;;;;;;;;;;;;;EAazC,eAAe,6BAA6B;;EAE5C,WAAW,WAAW,WAAW;;;;;;;;;;;;;;;;wBAiBnB,cACd,MACA,aACA,kBACA,cACA,YACC,mCAAgB,IAAA;yBANH"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { resolveStateValue } from "../internal/render-element.mjs";
|
|
3
2
|
import { popoverDetails, usePopoverRoot } from "../internal/overlay/use-overlay-root.mjs";
|
|
3
|
+
import { resolveStateValue } from "../internal/render-element.mjs";
|
|
4
4
|
import { PopoverContext } from "./popover-context.mjs";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/popover/popover-root.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Owns the ids, the mode, the open state and the context. Renders no DOM, so it has no `ref`,
|
|
9
9
|
* `className` or `style`; `pending` is exposed through `children(state)` and the Trigger.
|
|
@@ -38,7 +38,6 @@ function PopoverRoot({ open, defaultOpen, openChangeAction, onOpenChange, childr
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
PopoverRoot.displayName = "PopoverRoot";
|
|
41
|
-
//#endregion
|
|
42
41
|
export { PopoverRoot };
|
|
43
42
|
|
|
44
43
|
//# sourceMappingURL=popover-root.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
1
2
|
import { RenderProp, StateValue } from "../internal/types.mjs";
|
|
2
3
|
import { PopoverPopupState } from "./popover-popup.mjs";
|
|
3
|
-
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
4
|
-
//#region src/popover/popover-title.d.ts
|
|
5
4
|
/** State of `Popover.Title`: the Popup's state. */
|
|
6
5
|
export type PopoverTitleState = PopoverPopupState;
|
|
7
6
|
/**
|
|
@@ -30,5 +29,4 @@ export declare function PopoverTitle({ className, style, children, render, ...re
|
|
|
30
29
|
export declare namespace PopoverTitle {
|
|
31
30
|
var displayName: string;
|
|
32
31
|
}
|
|
33
|
-
//#endregion
|
|
34
32
|
//# sourceMappingURL=popover-title.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-title.d.mts","names":[],"sources":["../../src/popover/popover-title.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-title.d.mts","names":[],"sources":["../../src/popover/popover-title.tsx"],"mappings":";;;;YAQY,oBAAoB;;;;;;iBAOf,0BAA0B,KACzC;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,6BAA6B;;;;;;;;;wBAUnC,eAAe,WAAW,OAAO,UAAU,WAAW,QAAQ,oBAAiB;yBAA/E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRender } from "../internal/use-render.mjs";
|
|
3
3
|
import { usePopoverContext, usePopoverPopupState } from "./popover-context.mjs";
|
|
4
|
-
|
|
4
|
+
// src/popover/popover-title.tsx
|
|
5
5
|
/**
|
|
6
6
|
* The popover's name: an `<h2>` whose id the Popup references with `aria-labelledby`.
|
|
7
7
|
*
|
|
@@ -24,7 +24,6 @@ function PopoverTitle({ className, style, children, render, ...rest }) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
PopoverTitle.displayName = "PopoverTitle";
|
|
27
|
-
//#endregion
|
|
28
27
|
export { PopoverTitle };
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=popover-title.mjs.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
1
2
|
import { RenderProp, StateValue } from "../internal/types.mjs";
|
|
2
3
|
import { PopoverTriggerHookState } from "../internal/overlay/use-popover-trigger.mjs";
|
|
3
|
-
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
4
|
-
//#region src/popover/popover-trigger.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* State of `Popover.Trigger`, passed to the function forms of `className`, `style`, `children` and
|
|
7
6
|
* `render`.
|
|
@@ -53,5 +52,4 @@ export declare function PopoverTrigger({ disabled, className, style, children, r
|
|
|
53
52
|
export declare namespace PopoverTrigger {
|
|
54
53
|
var displayName: string;
|
|
55
54
|
}
|
|
56
|
-
//#endregion
|
|
57
55
|
//# sourceMappingURL=popover-trigger.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-trigger.d.mts","names":[],"sources":["../../src/popover/popover-trigger.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-trigger.d.mts","names":[],"sources":["../../src/popover/popover-trigger.tsx"],"mappings":";;;;;;;YAYY,sBAAsB;;;;;;iBAOjB,4BAA4B,KAC3C;;;;;;;;EAkBA;;EAEA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;;;;EAKjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;;;;;wBAmBvC,iBACd,UACA,WACA,OACA,UACA,WACG,QACF,sBAAmB;yBAPN"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { usePopoverTrigger } from "../internal/overlay/use-popover-trigger.mjs";
|
|
2
3
|
import { useRender } from "../internal/use-render.mjs";
|
|
3
4
|
import { usePopoverContext } from "./popover-context.mjs";
|
|
4
|
-
|
|
5
|
-
//#region src/popover/popover-trigger.tsx
|
|
5
|
+
// src/popover/popover-trigger.tsx
|
|
6
6
|
/**
|
|
7
7
|
* The toggle: `<button type="button" popovertarget>`, with no `aria-expanded`: the browser exposes
|
|
8
8
|
* the popover's state on its invoker. In JS-free mode the browser toggles the popover and the
|
|
@@ -39,7 +39,6 @@ function PopoverTrigger({ disabled = false, className, style, children, render,
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
PopoverTrigger.displayName = "PopoverTrigger";
|
|
42
|
-
//#endregion
|
|
43
42
|
export { PopoverTrigger };
|
|
44
43
|
|
|
45
44
|
//# sourceMappingURL=popover-trigger.mjs.map
|