@funstack/ui 0.1.0-alpha.10 → 0.1.0-alpha.12
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.map +1 -1
- package/dist/accordion/accordion-item.d.mts +3 -4
- package/dist/accordion/accordion-item.d.mts.map +1 -1
- package/dist/accordion/accordion-item.mjs +10 -4
- package/dist/accordion/accordion-item.mjs.map +1 -1
- package/dist/accordion/accordion-panel.d.mts +3 -4
- package/dist/accordion/accordion-panel.d.mts.map +1 -1
- package/dist/accordion/accordion-panel.mjs +2 -1
- package/dist/accordion/accordion-panel.mjs.map +1 -1
- package/dist/accordion/accordion-root.d.mts +3 -3
- package/dist/accordion/accordion-root.d.mts.map +1 -1
- package/dist/accordion/accordion-root.mjs +8 -19
- package/dist/accordion/accordion-root.mjs.map +1 -1
- package/dist/accordion/accordion-trigger.d.mts +3 -4
- package/dist/accordion/accordion-trigger.d.mts.map +1 -1
- package/dist/accordion/accordion-trigger.mjs +5 -3
- package/dist/accordion/accordion-trigger.mjs.map +1 -1
- package/dist/button/button.d.mts +4 -2
- package/dist/button/button.d.mts.map +1 -1
- package/dist/button/button.mjs +3 -2
- package/dist/button/button.mjs.map +1 -1
- package/dist/checkbox/checkbox.d.mts +4 -5
- package/dist/checkbox/checkbox.d.mts.map +1 -1
- package/dist/checkbox/checkbox.mjs +16 -59
- package/dist/checkbox/checkbox.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-context.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-item.d.mts +3 -4
- package/dist/checkbox-group/checkbox-group-item.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-item.mjs +21 -27
- package/dist/checkbox-group/checkbox-group-item.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-label.mjs +1 -6
- package/dist/checkbox-group/checkbox-group-label.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-parent.d.mts +3 -4
- package/dist/checkbox-group/checkbox-group-parent.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-parent.mjs +12 -10
- package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-root.d.mts +1 -1
- package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-root.mjs +74 -101
- package/dist/checkbox-group/checkbox-group-root.mjs.map +1 -1
- package/dist/combobox/combobox-clear.d.mts.map +1 -1
- package/dist/combobox/combobox-clear.mjs +5 -6
- package/dist/combobox/combobox-clear.mjs.map +1 -1
- package/dist/combobox/combobox-context.mjs.map +1 -1
- package/dist/combobox/combobox-group.d.mts.map +1 -1
- package/dist/combobox/combobox-group.mjs +2 -1
- package/dist/combobox/combobox-group.mjs.map +1 -1
- package/dist/combobox/combobox-input.d.mts.map +1 -1
- package/dist/combobox/combobox-input.mjs +14 -7
- package/dist/combobox/combobox-input.mjs.map +1 -1
- package/dist/combobox/combobox-list.d.mts.map +1 -1
- package/dist/combobox/combobox-list.mjs +6 -10
- package/dist/combobox/combobox-list.mjs.map +1 -1
- package/dist/combobox/combobox-option.d.mts.map +1 -1
- package/dist/combobox/combobox-option.mjs +2 -1
- package/dist/combobox/combobox-option.mjs.map +1 -1
- package/dist/combobox/combobox-popup.d.mts.map +1 -1
- package/dist/combobox/combobox-popup.mjs +9 -25
- package/dist/combobox/combobox-popup.mjs.map +1 -1
- package/dist/combobox/combobox-root.d.mts +11 -10
- package/dist/combobox/combobox-root.d.mts.map +1 -1
- package/dist/combobox/combobox-root.mjs +37 -109
- package/dist/combobox/combobox-root.mjs.map +1 -1
- package/dist/combobox/combobox-trigger.d.mts.map +1 -1
- package/dist/combobox/combobox-trigger.mjs +6 -25
- package/dist/combobox/combobox-trigger.mjs.map +1 -1
- package/dist/combobox/index.d.mts +2 -2
- package/dist/combobox/index.mjs +3 -3
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/combobox/use-combobox-form.mjs +56 -0
- package/dist/combobox/use-combobox-form.mjs.map +1 -0
- package/dist/combobox/use-option-registry.mjs +62 -0
- package/dist/combobox/use-option-registry.mjs.map +1 -0
- package/dist/dialog/dialog-close.d.mts.map +1 -1
- package/dist/dialog/dialog-close.mjs +29 -62
- package/dist/dialog/dialog-close.mjs.map +1 -1
- package/dist/dialog/dialog-context.mjs.map +1 -1
- package/dist/dialog/dialog-form.d.mts.map +1 -1
- package/dist/dialog/dialog-form.mjs +5 -4
- package/dist/dialog/dialog-form.mjs.map +1 -1
- package/dist/dialog/dialog-popup.d.mts +3 -4
- package/dist/dialog/dialog-popup.d.mts.map +1 -1
- package/dist/dialog/dialog-popup.mjs +37 -98
- package/dist/dialog/dialog-popup.mjs.map +1 -1
- package/dist/dialog/dialog-root.d.mts.map +1 -1
- package/dist/dialog/dialog-root.mjs +30 -118
- package/dist/dialog/dialog-root.mjs.map +1 -1
- package/dist/dialog/dialog-trigger.d.mts.map +1 -1
- package/dist/dialog/dialog-trigger.mjs +13 -16
- package/dist/dialog/dialog-trigger.mjs.map +1 -1
- package/dist/field/field-control.mjs +6 -13
- package/dist/field/field-control.mjs.map +1 -1
- package/dist/field/field-description.d.mts.map +1 -1
- package/dist/field/field-description.mjs +1 -2
- package/dist/field/field-description.mjs.map +1 -1
- package/dist/field/field-error.d.mts.map +1 -1
- package/dist/field/field-error.mjs +1 -2
- package/dist/field/field-error.mjs.map +1 -1
- package/dist/field/field-label.d.mts.map +1 -1
- package/dist/field/field-label.mjs +3 -11
- package/dist/field/field-label.mjs.map +1 -1
- package/dist/field/field-root.mjs +21 -41
- package/dist/field/field-root.mjs.map +1 -1
- package/dist/field/index.mjs +1 -1
- package/dist/field/use-server-error-visibility.mjs +44 -0
- package/dist/field/use-server-error-visibility.mjs.map +1 -0
- package/dist/form/form-root.d.mts.map +1 -1
- package/dist/form/form-root.mjs +6 -7
- package/dist/form/form-root.mjs.map +1 -1
- package/dist/form/form-submit.d.mts +1 -1
- package/dist/form/form-submit.mjs +4 -10
- package/dist/form/form-submit.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/internal/anchor-position.mjs +1 -59
- package/dist/internal/anchor-position.mjs.map +1 -1
- package/dist/internal/announce.mjs.map +1 -1
- package/dist/internal/arrow-keys.mjs +21 -0
- package/dist/internal/arrow-keys.mjs.map +1 -0
- package/dist/internal/decimal.mjs +7 -1
- package/dist/internal/decimal.mjs.map +1 -1
- package/dist/internal/dom-order.mjs +17 -0
- package/dist/internal/dom-order.mjs.map +1 -0
- package/dist/internal/field-context.d.mts.map +1 -1
- package/dist/internal/field-context.mjs +11 -1
- package/dist/internal/field-context.mjs.map +1 -1
- package/dist/internal/focus-first-invalid.mjs +1 -1
- package/dist/internal/focus-first-invalid.mjs.map +1 -1
- package/dist/internal/group-member.mjs +37 -0
- package/dist/internal/group-member.mjs.map +1 -0
- package/dist/internal/overlay-popup.mjs +103 -0
- package/dist/internal/overlay-popup.mjs.map +1 -0
- package/dist/internal/popover-open.mjs +18 -0
- package/dist/internal/popover-open.mjs.map +1 -0
- package/dist/internal/render-element.d.mts +2 -0
- package/dist/internal/render-element.mjs +20 -2
- package/dist/internal/render-element.mjs.map +1 -1
- package/dist/internal/shipped-styles.mjs +14 -0
- package/dist/internal/shipped-styles.mjs.map +1 -0
- package/dist/internal/sync-presence.mjs +5 -1
- package/dist/internal/sync-presence.mjs.map +1 -1
- package/dist/internal/toolbar-context.mjs.map +1 -1
- package/dist/internal/tooltip-warm.mjs +1 -1
- package/dist/internal/tooltip-warm.mjs.map +1 -1
- package/dist/internal/transition-boundary.mjs +1 -1
- package/dist/internal/transition-boundary.mjs.map +1 -1
- package/dist/internal/types.d.mts +8 -6
- package/dist/internal/types.d.mts.map +1 -1
- package/dist/internal/use-action-trigger.mjs +5 -23
- package/dist/internal/use-action-trigger.mjs.map +1 -1
- package/dist/internal/use-checkable-input.mjs +79 -0
- package/dist/internal/use-checkable-input.mjs.map +1 -0
- package/dist/internal/use-controllable-action.mjs +16 -24
- package/dist/internal/use-controllable-action.mjs.map +1 -1
- package/dist/internal/use-dev-warning.mjs +8 -4
- package/dist/internal/use-dev-warning.mjs.map +1 -1
- package/dist/internal/use-element-check.mjs +39 -0
- package/dist/internal/use-element-check.mjs.map +1 -0
- package/dist/internal/use-exit-animation.mjs +1 -1
- package/dist/internal/use-exit-animation.mjs.map +1 -1
- package/dist/internal/use-field-control.mjs +28 -12
- package/dist/internal/use-field-control.mjs.map +1 -1
- package/dist/internal/use-fieldset-group.mjs +46 -0
- package/dist/internal/use-fieldset-group.mjs.map +1 -0
- package/dist/internal/use-form-reset.mjs +1 -5
- package/dist/internal/use-form-reset.mjs.map +1 -1
- package/dist/internal/use-item-order.mjs +42 -0
- package/dist/internal/use-item-order.mjs.map +1 -0
- package/dist/internal/use-latest.mjs +4 -8
- package/dist/internal/use-latest.mjs.map +1 -1
- package/dist/internal/use-merged-refs.mjs +19 -0
- package/dist/internal/use-merged-refs.mjs.map +1 -0
- package/dist/internal/use-name-warning.mjs +84 -0
- package/dist/internal/use-name-warning.mjs.map +1 -0
- package/dist/internal/use-native-checked.mjs +4 -6
- package/dist/internal/use-native-checked.mjs.map +1 -1
- package/dist/internal/use-native-focusgroup.mjs +19 -0
- package/dist/internal/use-native-focusgroup.mjs.map +1 -0
- package/dist/internal/use-native-group-reconciliation.mjs.map +1 -1
- package/dist/internal/use-overlay-close.mjs +63 -0
- package/dist/internal/use-overlay-close.mjs.map +1 -0
- package/dist/internal/{use-popover-root.mjs → use-overlay-root.mjs} +28 -39
- package/dist/internal/use-overlay-root.mjs.map +1 -0
- package/dist/internal/use-popover-popup.mjs +32 -78
- package/dist/internal/use-popover-popup.mjs.map +1 -1
- package/dist/internal/use-popover-trigger.d.mts +15 -0
- package/dist/internal/use-popover-trigger.d.mts.map +1 -0
- package/dist/internal/use-popover-trigger.mjs +13 -17
- package/dist/internal/use-popover-trigger.mjs.map +1 -1
- package/dist/internal/use-register-count.mjs +24 -0
- package/dist/internal/use-register-count.mjs.map +1 -0
- package/dist/internal/use-render.d.mts +2 -0
- package/dist/internal/use-render.mjs +2 -2
- package/dist/internal/use-render.mjs.map +1 -1
- package/dist/internal/use-resolved-placement.mjs +38 -22
- package/dist/internal/use-resolved-placement.mjs.map +1 -1
- package/dist/internal/use-roving-focus.mjs +5 -18
- package/dist/internal/use-roving-focus.mjs.map +1 -1
- package/dist/internal/use-superseded-rejection.mjs +47 -0
- package/dist/internal/use-superseded-rejection.mjs.map +1 -0
- package/dist/internal/validity.mjs +1 -13
- package/dist/internal/validity.mjs.map +1 -1
- package/dist/internal/value-set.mjs +41 -0
- package/dist/internal/value-set.mjs.map +1 -0
- package/dist/menu/index.d.mts +1 -1
- package/dist/menu/menu-checkbox-item.mjs.map +1 -1
- package/dist/menu/menu-context-trigger.d.mts +2 -7
- package/dist/menu/menu-context-trigger.d.mts.map +1 -1
- package/dist/menu/menu-context-trigger.mjs +10 -187
- package/dist/menu/menu-context-trigger.mjs.map +1 -1
- package/dist/menu/menu-context.d.mts +1 -1
- package/dist/menu/menu-context.mjs +1 -1
- package/dist/menu/menu-context.mjs.map +1 -1
- package/dist/menu/menu-dom.mjs +1 -2
- package/dist/menu/menu-dom.mjs.map +1 -1
- package/dist/menu/menu-gestures.mjs +167 -0
- package/dist/menu/menu-gestures.mjs.map +1 -0
- package/dist/menu/menu-group.d.mts.map +1 -1
- package/dist/menu/menu-group.mjs +2 -1
- package/dist/menu/menu-group.mjs.map +1 -1
- package/dist/menu/menu-hover.mjs +0 -1
- package/dist/menu/menu-hover.mjs.map +1 -1
- package/dist/menu/menu-item.mjs.map +1 -1
- package/dist/menu/menu-outside.mjs +101 -0
- package/dist/menu/menu-outside.mjs.map +1 -0
- package/dist/menu/menu-point.mjs +85 -0
- package/dist/menu/menu-point.mjs.map +1 -0
- package/dist/menu/menu-popup.d.mts +6 -7
- package/dist/menu/menu-popup.d.mts.map +1 -1
- package/dist/menu/menu-popup.mjs +37 -248
- package/dist/menu/menu-popup.mjs.map +1 -1
- package/dist/menu/menu-radio-group.mjs.map +1 -1
- package/dist/menu/menu-root.d.mts +10 -0
- package/dist/menu/menu-root.d.mts.map +1 -1
- package/dist/menu/menu-root.mjs +10 -8
- package/dist/menu/menu-root.mjs.map +1 -1
- package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
- package/dist/menu/menu-submenu-trigger.mjs +6 -6
- package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
- package/dist/menu/menu-trigger.d.mts +4 -9
- package/dist/menu/menu-trigger.d.mts.map +1 -1
- package/dist/menu/menu-trigger.mjs +8 -6
- package/dist/menu/menu-trigger.mjs.map +1 -1
- package/dist/menu/use-menu-item.mjs +14 -16
- package/dist/menu/use-menu-item.mjs.map +1 -1
- package/dist/menu/use-menu-keyboard.mjs +88 -0
- package/dist/menu/use-menu-keyboard.mjs.map +1 -0
- package/dist/meter/meter-root.mjs +1 -1
- package/dist/number-field/index.d.mts +2 -1
- package/dist/number-field/index.d.mts.map +1 -1
- package/dist/number-field/index.mjs +2 -2
- package/dist/number-field/index.mjs.map +1 -1
- package/dist/number-field/number-field-arithmetic.mjs +30 -11
- package/dist/number-field/number-field-arithmetic.mjs.map +1 -1
- package/dist/number-field/number-field-context.d.mts +6 -1
- package/dist/number-field/number-field-context.d.mts.map +1 -0
- package/dist/number-field/number-field-context.mjs.map +1 -1
- package/dist/number-field/number-field-decrement.d.mts +1 -1
- package/dist/number-field/number-field-decrement.mjs +1 -1
- package/dist/number-field/number-field-decrement.mjs.map +1 -1
- package/dist/number-field/number-field-increment.d.mts +2 -22
- package/dist/number-field/number-field-increment.d.mts.map +1 -1
- package/dist/number-field/number-field-increment.mjs +2 -53
- package/dist/number-field/number-field-increment.mjs.map +1 -1
- package/dist/number-field/number-field-input.d.mts.map +1 -1
- package/dist/number-field/number-field-input.mjs +18 -22
- package/dist/number-field/number-field-input.mjs.map +1 -1
- package/dist/number-field/number-field-label.d.mts.map +1 -1
- package/dist/number-field/number-field-label.mjs +3 -9
- package/dist/number-field/number-field-label.mjs.map +1 -1
- package/dist/number-field/number-field-root.d.mts +2 -1
- package/dist/number-field/number-field-root.d.mts.map +1 -1
- package/dist/number-field/number-field-root.mjs +81 -91
- package/dist/number-field/number-field-root.mjs.map +1 -1
- package/dist/number-field/use-number-field-dev-warnings.mjs +28 -0
- package/dist/number-field/use-number-field-dev-warnings.mjs.map +1 -0
- package/dist/number-field/use-step-button.d.mts +24 -0
- package/dist/number-field/use-step-button.d.mts.map +1 -0
- package/dist/number-field/use-step-button.mjs +57 -3
- package/dist/number-field/use-step-button.mjs.map +1 -1
- package/dist/popover/popover-close.d.mts.map +1 -1
- package/dist/popover/popover-close.mjs +28 -67
- package/dist/popover/popover-close.mjs.map +1 -1
- package/dist/popover/popover-context.mjs.map +1 -1
- package/dist/popover/popover-popup.d.mts +9 -6
- package/dist/popover/popover-popup.d.mts.map +1 -1
- package/dist/popover/popover-popup.mjs +13 -36
- package/dist/popover/popover-popup.mjs.map +1 -1
- package/dist/popover/popover-root.mjs +4 -3
- package/dist/popover/popover-root.mjs.map +1 -1
- package/dist/popover/popover-trigger.d.mts +4 -8
- package/dist/popover/popover-trigger.d.mts.map +1 -1
- package/dist/popover/popover-trigger.mjs +2 -1
- package/dist/popover/popover-trigger.mjs.map +1 -1
- package/dist/progress/progress-root.mjs +1 -1
- package/dist/radio-group/radio-group-context.mjs.map +1 -1
- package/dist/radio-group/radio-group-item.d.mts +3 -4
- package/dist/radio-group/radio-group-item.d.mts.map +1 -1
- package/dist/radio-group/radio-group-item.mjs +20 -25
- package/dist/radio-group/radio-group-item.mjs.map +1 -1
- package/dist/radio-group/radio-group-label.mjs +1 -6
- package/dist/radio-group/radio-group-label.mjs.map +1 -1
- package/dist/radio-group/radio-group-root.d.mts +1 -1
- package/dist/radio-group/radio-group-root.d.mts.map +1 -1
- package/dist/radio-group/radio-group-root.mjs +21 -40
- package/dist/radio-group/radio-group-root.mjs.map +1 -1
- package/dist/select/select-dom.mjs +9 -18
- package/dist/select/select-dom.mjs.map +1 -1
- package/dist/select/select-option.mjs +1 -1
- package/dist/select/select-root.mjs +3 -2
- package/dist/select/select-root.mjs.map +1 -1
- package/dist/slider/slider-arithmetic.mjs +74 -13
- package/dist/slider/slider-arithmetic.mjs.map +1 -1
- package/dist/slider/slider-context.mjs.map +1 -1
- package/dist/slider/slider-label.d.mts.map +1 -1
- package/dist/slider/slider-label.mjs +3 -9
- package/dist/slider/slider-label.mjs.map +1 -1
- package/dist/slider/slider-root.d.mts +2 -2
- package/dist/slider/slider-root.d.mts.map +1 -1
- package/dist/slider/slider-root.mjs +36 -116
- package/dist/slider/slider-root.mjs.map +1 -1
- package/dist/slider/slider-thumb.d.mts.map +1 -1
- package/dist/slider/slider-thumb.mjs +8 -6
- package/dist/slider/slider-thumb.mjs.map +1 -1
- package/dist/slider/slider-value.d.mts.map +1 -1
- package/dist/slider/slider-value.mjs +2 -1
- package/dist/slider/slider-value.mjs.map +1 -1
- package/dist/slider/use-slider-dev-warnings.mjs +29 -0
- package/dist/slider/use-slider-dev-warnings.mjs.map +1 -0
- package/dist/slider/use-thumb-registry.mjs +51 -0
- package/dist/slider/use-thumb-registry.mjs.map +1 -0
- package/dist/switch/switch.d.mts +4 -5
- package/dist/switch/switch.d.mts.map +1 -1
- package/dist/switch/switch.mjs +15 -55
- package/dist/switch/switch.mjs.map +1 -1
- package/dist/tabs/tabs-context.d.mts +2 -3
- package/dist/tabs/tabs-context.d.mts.map +1 -1
- package/dist/tabs/tabs-context.mjs.map +1 -1
- package/dist/tabs/tabs-list.d.mts.map +1 -1
- package/dist/tabs/tabs-list.mjs +9 -22
- package/dist/tabs/tabs-list.mjs.map +1 -1
- package/dist/tabs/tabs-panel.d.mts +3 -4
- package/dist/tabs/tabs-panel.d.mts.map +1 -1
- package/dist/tabs/tabs-panel.mjs.map +1 -1
- package/dist/tabs/tabs-root.d.mts +4 -3
- package/dist/tabs/tabs-root.d.mts.map +1 -1
- package/dist/tabs/tabs-root.mjs +2 -1
- package/dist/tabs/tabs-root.mjs.map +1 -1
- package/dist/tabs/tabs-tab.d.mts +3 -4
- package/dist/tabs/tabs-tab.d.mts.map +1 -1
- package/dist/tabs/tabs-tab.mjs.map +1 -1
- package/dist/toast/toast-action.mjs.map +1 -1
- package/dist/toast/toast-close.d.mts.map +1 -1
- package/dist/toast/toast-close.mjs +2 -8
- package/dist/toast/toast-close.mjs.map +1 -1
- package/dist/toast/toast-context.mjs.map +1 -1
- package/dist/toast/toast-hotkey.mjs +27 -0
- package/dist/toast/toast-hotkey.mjs.map +1 -0
- package/dist/toast/toast-queue.mjs +137 -0
- package/dist/toast/toast-queue.mjs.map +1 -0
- package/dist/toast/toast-timers.mjs +65 -0
- package/dist/toast/toast-timers.mjs.map +1 -0
- package/dist/toast/toast-viewport.d.mts.map +1 -1
- package/dist/toast/toast-viewport.mjs +30 -235
- package/dist/toast/toast-viewport.mjs.map +1 -1
- package/dist/toast/toast.mjs +1 -1
- package/dist/toast/toast.mjs.map +1 -1
- package/dist/toast/use-modal-portal-host.mjs +52 -0
- package/dist/toast/use-modal-portal-host.mjs.map +1 -0
- package/dist/toggle/toggle.d.mts +3 -4
- package/dist/toggle/toggle.d.mts.map +1 -1
- package/dist/toggle/toggle.mjs +7 -10
- package/dist/toggle/toggle.mjs.map +1 -1
- package/dist/toggle-group/toggle-group-context.d.mts +2 -1
- package/dist/toggle-group/toggle-group-context.d.mts.map +1 -1
- package/dist/toggle-group/toggle-group-context.mjs.map +1 -1
- package/dist/toggle-group/toggle-group-item.d.mts +5 -3
- package/dist/toggle-group/toggle-group-item.d.mts.map +1 -1
- package/dist/toggle-group/toggle-group-item.mjs +5 -7
- package/dist/toggle-group/toggle-group-item.mjs.map +1 -1
- package/dist/toggle-group/toggle-group-root.d.mts.map +1 -1
- package/dist/toggle-group/toggle-group-root.mjs +29 -64
- package/dist/toggle-group/toggle-group-root.mjs.map +1 -1
- package/dist/toolbar/toolbar-root.d.mts +2 -2
- package/dist/toolbar/toolbar-root.d.mts.map +1 -1
- package/dist/toolbar/toolbar-root.mjs +3 -4
- package/dist/toolbar/toolbar-root.mjs.map +1 -1
- package/dist/tooltip/tooltip-context.d.mts +1 -1
- package/dist/tooltip/tooltip-context.mjs.map +1 -1
- package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
- package/dist/tooltip/tooltip-popup.mjs +6 -15
- package/dist/tooltip/tooltip-popup.mjs.map +1 -1
- package/dist/tooltip/tooltip-root.mjs +2 -2
- package/dist/tooltip/tooltip-root.mjs.map +1 -1
- package/dist/tooltip/tooltip-trigger.d.mts +2 -1
- package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
- package/dist/tooltip/tooltip-trigger.mjs +3 -2
- package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
- package/dist/tooltip/use-tooltip-interaction.mjs +4 -3
- package/dist/tooltip/use-tooltip-interaction.mjs.map +1 -1
- package/package.json +3 -2
- package/dist/accordion/accordion-context.d.mts +0 -5
- package/dist/accordion/accordion-context.d.mts.map +0 -1
- package/dist/internal/use-popover-root.mjs.map +0 -1
- /package/dist/internal/{use-popover-root.d.mts → use-overlay-root.d.mts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-root.mjs","names":[],"sources":["../../src/dialog/dialog-root.tsx"],"sourcesContent":["\"use client\";\nimport { useCallback, useId, useInsertionEffect, useMemo, useRef, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { createActionDetails } from \"../internal/action-details.js\";\nimport { transitionTypes } from \"../internal/transition-types.js\";\nimport type { ActionDetails, ChangeAction, ChangeReason, StateValue } from \"../internal/types.js\";\nimport { useControllableAction } from \"../internal/use-controllable-action.js\";\nimport { useDevWarning } from \"../internal/use-dev-warning.js\";\nimport { useLatest } from \"../internal/use-latest.js\";\nimport { resolveStateValue } from \"../internal/use-render.js\";\nimport { DialogContext } from \"./dialog-context.js\";\nimport type { DialogCloseIntent, DialogContextValue, DialogMode } from \"./dialog-context.js\";\n\n/** Details passed as the second argument of `openChangeAction`. */\nexport interface DialogOpenChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user acted on a part: Trigger (open), Close or Form submit (close).\n * `\"dismiss\"`: the user closed the dialog without a part: Escape, Android back, an assistive-\n * technology dismiss gesture, or a click outside (`lightDismiss` / `closedby=\"any\"`).\n * `\"platform\"`: the dialog was found open on mount (opened before hydration); `event` is\n * `undefined`.\n */\n readonly reason: ChangeReason;\n /**\n * On close: `dialog.returnValue`: the `value` of the Close button or the form submitter that\n * closed it, `\"\"` for a dismiss. On open: `undefined`.\n */\n readonly returnValue: string | undefined;\n}\n\nexport interface DialogRootState {\n /** Optimistic open state (`false` in JS-free mode). Content rendered from it must not suspend. */\n readonly open: boolean;\n /** An `openChangeAction` dispatched through this Dialog is in flight (library mode only). */\n readonly pending: boolean;\n readonly modal: boolean;\n}\n\nexport interface DialogRootProps {\n /**\n * Controlled open state. `undefined` means uncontrolled (and, with `defaultOpen` and\n * `openChangeAction` also absent, JS-free mode).\n */\n open?: boolean;\n /**\n * Initial open state in uncontrolled library mode. The dialog opens after hydration, never in\n * the server HTML.\n */\n defaultOpen?: boolean;\n /**\n * Awaited for `true` (the dialog opens when it resolves and the content has rendered) and for\n * a `false` the user asked a part for (`Dialog.Close`, a `Dialog.Form` submit or settled\n * action, a foreign close command: the dialog closes with `details.returnValue` when it\n * resolves, with a view transition if the Popup's `transition` is set; a controlled parent\n * that keeps `open` vetoes it). A notification for a dismissal (Escape, Android back, a click\n * outside: the dialog is already closed, `returnValue` is `\"\"`; the action runs inside the\n * Root's transition, and a controlled parent that keeps `open` gets it re-opened, which is\n * not a veto). A dismissal while a part's close is in flight is not notified on its own: if that\n * close is vetoed, the dismissal is notified (`\"dismiss\"`) when the veto settles, and the dialog\n * stays closed. May be a Server Function. Rejections reach the nearest Error Boundary above\n * Root.\n *\n * A `setState` placed after your own `await` is not a Transition update; wrap it in\n * `startTransition` (React limitation).\n */\n openChangeAction?: ChangeAction<boolean, DialogOpenChangeDetails>;\n /** `showModal()` (top layer, backdrop, inert page, Escape) or `show()`. Default `true`. */\n modal?: boolean;\n children?: StateValue<ReactNode, DialogRootState>;\n}\n\n/** How long a recorded close intent survives when the dialog did not close (design 2.3). */\nfunction clearLater(\n intentRef: { current: DialogCloseIntent | undefined },\n intent: DialogCloseIntent,\n dialogRef: { current: HTMLDialogElement | null },\n): void {\n setTimeout(() => {\n // The dialog closed: its `close` event (queued as a task) consumes the intent. Still open:\n // the close was cancelled (a prevented `cancel` or `command`), so the intent is stale.\n if (intentRef.current === intent && dialogRef.current?.open === true) {\n intentRef.current = undefined;\n }\n }, 0);\n}\n\n/**\n * Owns the ids, the mode, the open state and the context. Renders no DOM, so it has no `ref`,\n * `className` or `style`; `pending` is exposed through `children(state)` and the Trigger.\n *\n * Without `open`, `defaultOpen` and `openChangeAction` the Dialog runs in **JS-free mode**: the\n * Trigger is a native `command=\"show-modal\"` invoker and the browser owns everything. With any of\n * them it runs in **library mode**: opening is a transition (the Trigger shows `data-pending`,\n * content renders from committed state, `showModal()` runs when it has committed), and so is a\n * close a part asks for (Close, Form, a foreign close command: `openChangeAction(false)` is\n * awaited, `close(returnValue)` runs when it has committed). Dismissals (Escape, a click\n * outside) are the browser's and `openChangeAction(false)` is a notification.\n */\nexport function DialogRoot({\n open,\n defaultOpen,\n openChangeAction,\n modal = true,\n children,\n}: DialogRootProps) {\n // Mode is decided once, from the first render's props (design 14).\n const isLibraryNow =\n open !== undefined || defaultOpen !== undefined || openChangeAction !== undefined;\n const [mode] = useState<DialogMode>(isLibraryNow ? \"library\" : \"static\");\n const isLibrary = mode === \"library\";\n useDevWarning(\n isLibrary !== isLibraryNow,\n \"Dialog.Root: the mode changed after mount (`open`, `defaultOpen` and `openChangeAction` \" +\n \"were all absent on one render and present on another). Switching between JS-free and \" +\n \"library mode is not supported.\",\n );\n\n // Hooks cannot be conditional: static mode calls the hook too and never dispatches.\n const { committed, optimistic, pending, dispatch, latestInFlight } = useControllableAction<\n boolean,\n DialogOpenChangeDetails\n >({\n controlled: isLibrary ? open : undefined,\n defaultValue: isLibrary ? defaultOpen : undefined,\n initialValue: false,\n action: isLibrary ? openChangeAction : undefined,\n transitionTypes: (next) => transitionTypes(\"dialog\", next ? \"open\" : \"close\"),\n warn: { component: \"Dialog.Root\", prop: \"open\" },\n });\n\n const id = useId();\n const triggerRef = useRef<HTMLElement | null>(null);\n const dialogRef = useRef<HTMLDialogElement | null>(null);\n const closeIntent = useRef<DialogCloseIntent | undefined>(undefined);\n\n const recordCloseIntent = useCallback((intent: DialogCloseIntent | undefined) => {\n closeIntent.current = intent;\n if (intent !== undefined) clearLater(closeIntent, intent, dialogRef);\n }, []);\n const takeCloseIntent = useCallback(() => {\n const intent = closeIntent.current;\n closeIntent.current = undefined;\n return intent;\n }, []);\n // Advanced on every open (the open dispatch and the Popup's native `beforetoggle` to open), so a Close action that\n // settles after the user dismissed and re-opened the dialog does not close the new open (the\n // PO's open-generation rule, design/components/popover.md 3.4; review M2).\n const generation = useRef(0);\n const openGeneration = useCallback(() => generation.current, []);\n const nextOpenGeneration = useCallback(() => {\n generation.current++;\n }, []);\n\n // The optimistic value of the last commit, for callers that run after an `await` (a Close\n // action's continuation) and would otherwise read the value of the render they were created in\n // (Popover 14.1). Through `useLatest`, as `usePopoverRoot`, so `intended` and everything built\n // on it keep their identity (review of #48, finding 5).\n const committedOptimistic = useLatest(optimistic);\n\n // What the user already intends: the latest in-flight dispatch, else the optimistic value\n // (conventions 3.8 rule 1). Judging no-ops against it also deduplicates the StrictMode re-run\n // of the mount reconciliation and recognises the library's own `close()` echoing back.\n const intended = useCallback(\n (): boolean => latestInFlight()?.next ?? committedOptimistic.current,\n [latestInFlight, committedOptimistic],\n );\n\n // The `returnValue` of a pending part-initiated close (design 2.3), handed to the apply\n // effect's `close()`. Stale once `true` is intended again (a vetoed close snapped back, or a\n // re-open), so the commit that shows it clears it.\n const closeReturnValue = useRef<string | undefined>(undefined);\n useInsertionEffect(() => {\n if (latestInFlight()?.next ?? optimistic) closeReturnValue.current = undefined;\n });\n const takeCloseReturnValue = useCallback((): string => {\n const value = closeReturnValue.current;\n closeReturnValue.current = undefined;\n return value ?? \"\";\n }, []);\n\n const requestOpen = useCallback(\n (event: Event | undefined, reason: ChangeReason): void => {\n if (!isLibrary || intended()) return;\n nextOpenGeneration();\n dispatch(true, createActionDetails(event, { reason, returnValue: undefined }));\n },\n [isLibrary, intended, nextOpenGeneration, dispatch],\n );\n\n // A library-owned close (design 2.3): `openChangeAction(false)` is awaited and the Popup's\n // apply effect calls `close(returnValue)` in the commit that ends it.\n const requestClose = useCallback(\n (event: Event | undefined, reason: ChangeReason, returnValue: string): void => {\n if (!isLibrary || !intended()) return;\n closeReturnValue.current = returnValue;\n dispatch(false, createActionDetails(event, { reason, returnValue }));\n },\n [isLibrary, intended, dispatch],\n );\n\n const notifyClosed = useCallback(\n (event: Event, reason: ChangeReason, returnValue: string): void => {\n if (!isLibrary || !intended()) return;\n dispatch(false, createActionDetails(event, { reason, returnValue }));\n },\n [isLibrary, intended, dispatch],\n );\n\n const openState = isLibrary && optimistic;\n const pendingState = isLibrary && pending;\n const committedState = isLibrary && committed;\n\n // Memoised (#48): `dispatch` is stable, so the value changes only with the open state, pending\n // and `modal`, and the parts do not re-render for an unrelated render of the Root.\n const context = useMemo<DialogContextValue>(\n () => ({\n mode,\n ids: { dialog: id, title: `${id}-title`, description: `${id}-description` },\n modal,\n committed: committedState,\n optimistic: openState,\n pending: pendingState,\n intended,\n requestClose,\n takeCloseReturnValue,\n requestOpen,\n notifyClosed,\n latestInFlight,\n triggerRef,\n dialogRef,\n recordCloseIntent,\n takeCloseIntent,\n openGeneration,\n nextOpenGeneration,\n }),\n [\n mode,\n id,\n modal,\n committedState,\n openState,\n pendingState,\n intended,\n requestClose,\n takeCloseReturnValue,\n requestOpen,\n notifyClosed,\n latestInFlight,\n recordCloseIntent,\n takeCloseIntent,\n openGeneration,\n nextOpenGeneration,\n ],\n );\n\n const state: DialogRootState = {\n open: openState,\n pending: pendingState,\n modal,\n };\n\n return <DialogContext value={context}>{resolveStateValue(children, state)}</DialogContext>;\n}\n\nDialogRoot.displayName = \"DialogRoot\";\n"],"mappings":";;;;;;;;;;;;AAwEA,SAAS,WACP,WACA,QACA,WACM;CACN,iBAAiB;EAGf,IAAI,UAAU,YAAY,UAAU,UAAU,SAAS,SAAS,MAC9D,UAAU,UAAU,KAAA;CAExB,GAAG,CAAC;AACN;;;;;;;;;;;;;AAcA,SAAgB,WAAW,EACzB,MACA,aACA,kBACA,QAAQ,MACR,YACkB;CAElB,MAAM,eACJ,SAAS,KAAA,KAAa,gBAAgB,KAAA,KAAa,qBAAqB,KAAA;CAC1E,MAAM,CAAC,QAAQ,SAAqB,eAAe,YAAY,QAAQ;CACvE,MAAM,YAAY,SAAS;CAC3B,cACE,cAAc,cACd,6MAGF;CAGA,MAAM,EAAE,WAAW,YAAY,SAAS,UAAU,mBAAmB,sBAGnE;EACA,YAAY,YAAY,OAAO,KAAA;EAC/B,cAAc,YAAY,cAAc,KAAA;EACxC,cAAc;EACd,QAAQ,YAAY,mBAAmB,KAAA;EACvC,kBAAkB,SAAS,gBAAgB,UAAU,OAAO,SAAS,OAAO;EAC5E,MAAM;GAAE,WAAW;GAAe,MAAM;EAAO;CACjD,CAAC;CAED,MAAM,KAAK,MAAM;CACjB,MAAM,aAAa,OAA2B,IAAI;CAClD,MAAM,YAAY,OAAiC,IAAI;CACvD,MAAM,cAAc,OAAsC,KAAA,CAAS;CAEnE,MAAM,oBAAoB,aAAa,WAA0C;EAC/E,YAAY,UAAU;EACtB,IAAI,WAAW,KAAA,GAAW,WAAW,aAAa,QAAQ,SAAS;CACrE,GAAG,CAAC,CAAC;CACL,MAAM,kBAAkB,kBAAkB;EACxC,MAAM,SAAS,YAAY;EAC3B,YAAY,UAAU,KAAA;EACtB,OAAO;CACT,GAAG,CAAC,CAAC;CAIL,MAAM,aAAa,OAAO,CAAC;CAC3B,MAAM,iBAAiB,kBAAkB,WAAW,SAAS,CAAC,CAAC;CAC/D,MAAM,qBAAqB,kBAAkB;EAC3C,WAAW;CACb,GAAG,CAAC,CAAC;CAML,MAAM,sBAAsB,UAAU,UAAU;CAKhD,MAAM,WAAW,kBACA,eAAe,CAAC,EAAE,QAAQ,oBAAoB,SAC7D,CAAC,gBAAgB,mBAAmB,CACtC;CAKA,MAAM,mBAAmB,OAA2B,KAAA,CAAS;CAC7D,yBAAyB;EACvB,IAAI,eAAe,CAAC,EAAE,QAAQ,YAAY,iBAAiB,UAAU,KAAA;CACvE,CAAC;CACD,MAAM,uBAAuB,kBAA0B;EACrD,MAAM,QAAQ,iBAAiB;EAC/B,iBAAiB,UAAU,KAAA;EAC3B,OAAO,SAAS;CAClB,GAAG,CAAC,CAAC;CAEL,MAAM,cAAc,aACjB,OAA0B,WAA+B;EACxD,IAAI,CAAC,aAAa,SAAS,GAAG;EAC9B,mBAAmB;EACnB,SAAS,MAAM,oBAAoB,OAAO;GAAE;GAAQ,aAAa,KAAA;EAAU,CAAC,CAAC;CAC/E,GACA;EAAC;EAAW;EAAU;EAAoB;CAAQ,CACpD;CAIA,MAAM,eAAe,aAClB,OAA0B,QAAsB,gBAA8B;EAC7E,IAAI,CAAC,aAAa,CAAC,SAAS,GAAG;EAC/B,iBAAiB,UAAU;EAC3B,SAAS,OAAO,oBAAoB,OAAO;GAAE;GAAQ;EAAY,CAAC,CAAC;CACrE,GACA;EAAC;EAAW;EAAU;CAAQ,CAChC;CAEA,MAAM,eAAe,aAClB,OAAc,QAAsB,gBAA8B;EACjE,IAAI,CAAC,aAAa,CAAC,SAAS,GAAG;EAC/B,SAAS,OAAO,oBAAoB,OAAO;GAAE;GAAQ;EAAY,CAAC,CAAC;CACrE,GACA;EAAC;EAAW;EAAU;CAAQ,CAChC;CAEA,MAAM,YAAY,aAAa;CAC/B,MAAM,eAAe,aAAa;CAClC,MAAM,iBAAiB,aAAa;CAIpC,MAAM,UAAU,eACP;EACL;EACA,KAAK;GAAE,QAAQ;GAAI,OAAO,GAAG,GAAG;GAAS,aAAa,GAAG,GAAG;EAAc;EAC1E;EACA,WAAW;EACX,YAAY;EACZ,SAAS;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAQA,OAAO,oBAAC,eAAD;EAAe,OAAO;EAAU,UAAA,kBAAkB,UAAU;GALjE,MAAM;GACN,SAAS;GACT;EAGqE,CAAC;CAAiB,CAAA;AAC3F;AAEA,WAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"dialog-root.mjs","names":[],"sources":["../../src/dialog/dialog-root.tsx"],"sourcesContent":["\"use client\";\nimport { useCallback, useInsertionEffect, useMemo, useRef } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { createActionDetails } from \"../internal/action-details.js\";\nimport type { ActionDetails, ChangeAction, ChangeReason, StateValue } from \"../internal/types.js\";\nimport { useOverlayRoot } from \"../internal/use-overlay-root.js\";\nimport { resolveStateValue } from \"../internal/use-render.js\";\nimport { DialogContext } from \"./dialog-context.js\";\nimport type { DialogContextValue } from \"./dialog-context.js\";\n\n/** Details passed as the second argument of `openChangeAction`. */\nexport interface DialogOpenChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user acted on a part: Trigger (open), Close or Form submit (close).\n * `\"dismiss\"`: the user closed the dialog without a part: Escape, Android back, an assistive-\n * technology dismiss gesture, or a click outside (`lightDismiss` / `closedby=\"any\"`).\n * `\"platform\"`: the dialog was found open on mount (opened before hydration); `event` is\n * `undefined`.\n */\n readonly reason: ChangeReason;\n /**\n * On close: `dialog.returnValue`: the `value` of the Close button or the form submitter that\n * closed it, `\"\"` for a dismiss. On open: `undefined`.\n */\n readonly returnValue: string | undefined;\n}\n\nexport interface DialogRootState {\n /** Optimistic open state (`false` in JS-free mode). Content rendered from it must not suspend. */\n readonly open: boolean;\n /** An `openChangeAction` dispatched through this Dialog is in flight (library mode only). */\n readonly pending: boolean;\n readonly modal: boolean;\n}\n\nexport interface DialogRootProps {\n /**\n * Controlled open state. `undefined` means uncontrolled (and, with `defaultOpen` and\n * `openChangeAction` also absent, JS-free mode).\n */\n open?: boolean;\n /**\n * Initial open state in uncontrolled library mode. The dialog opens after hydration, never in\n * the server HTML.\n */\n defaultOpen?: boolean;\n /**\n * Awaited for `true` (the dialog opens when it resolves and the content has rendered) and for\n * a `false` the user asked a part for (`Dialog.Close`, a `Dialog.Form` submit or settled\n * action, a foreign close command: the dialog closes with `details.returnValue` when it\n * resolves, with a view transition if the Popup's `transition` is set; a controlled parent\n * that keeps `open` vetoes it). A notification for a dismissal (Escape, Android back, a click\n * outside: the dialog is already closed, `returnValue` is `\"\"`; the action runs inside the\n * Root's transition, and a controlled parent that keeps `open` gets it re-opened, which is\n * not a veto). A dismissal while a part's close is in flight is not notified on its own: if that\n * close is vetoed, the dismissal is notified (`\"dismiss\"`) when the veto settles, and the dialog\n * stays closed. May be a Server Function. Rejections reach the nearest Error Boundary above\n * Root.\n *\n * A `setState` placed after your own `await` is not a Transition update; wrap it in\n * `startTransition` (React limitation).\n */\n openChangeAction?: ChangeAction<boolean, DialogOpenChangeDetails>;\n /** `showModal()` (top layer, backdrop, inert page, Escape) or `show()`. Default `true`. */\n modal?: boolean;\n children?: StateValue<ReactNode, DialogRootState>;\n}\n\nconst dialogDetails = (\n event: Event | undefined,\n reason: ChangeReason,\n returnValue?: string,\n): DialogOpenChangeDetails => createActionDetails(event, { reason, returnValue });\n\nconst isDialogOpen = (dialog: HTMLDialogElement): boolean => dialog.open;\n\n/**\n * Owns the ids, the mode, the open state and the context. Renders no DOM, so it has no `ref`,\n * `className` or `style`; `pending` is exposed through `children(state)` and the Trigger.\n *\n * Without `open`, `defaultOpen` and `openChangeAction` the Dialog runs in **JS-free mode**: the\n * Trigger is a native `command=\"show-modal\"` invoker and the browser owns everything. With any of\n * them it runs in **library mode**: opening is a transition (the Trigger shows `data-pending`,\n * content renders from committed state, `showModal()` runs when it has committed), and so is a\n * close a part asks for (Close, Form, a foreign close command: `openChangeAction(false)` is\n * awaited, `close(returnValue)` runs when it has committed). Dismissals (Escape, a click\n * outside) are the browser's and `openChangeAction(false)` is a notification.\n */\nexport function DialogRoot({\n open,\n defaultOpen,\n openChangeAction,\n modal = true,\n children,\n}: DialogRootProps) {\n // The popover machinery (design/components/popover.md 14.1) with the `<dialog>`'s `open` and\n // `returnValue` in the details: an open's `returnValue` is an own `undefined`.\n const root = useOverlayRoot<DialogOpenChangeDetails, HTMLDialogElement, [returnValue: string]>({\n component: \"dialog\",\n part: \"Dialog.Root\",\n open,\n defaultOpen,\n openChangeAction,\n details: dialogDetails,\n isShown: isDialogOpen,\n });\n const { mode, intended, latestInFlight, optimistic, requestClose: closeRoot } = root;\n\n // The `returnValue` of a pending part-initiated close (design 2.3), handed to the apply\n // effect's `close()`. Stale once `true` is intended again (a vetoed close snapped back, or a\n // re-open), so the commit that shows it clears it.\n const closeReturnValue = useRef<string | undefined>(undefined);\n useInsertionEffect(() => {\n if (latestInFlight()?.next ?? optimistic) closeReturnValue.current = undefined;\n });\n const takeCloseReturnValue = useCallback((): string => {\n const value = closeReturnValue.current;\n closeReturnValue.current = undefined;\n return value ?? \"\";\n }, []);\n\n // A library-owned close (design 2.3): `openChangeAction(false)` is awaited and the Popup's\n // apply effect calls `close(returnValue)` in the commit that ends it. A dismissal's\n // `notifyClosed` records no `returnValue`.\n const requestClose = useCallback(\n (event: Event | undefined, reason: ChangeReason, returnValue: string): void => {\n if (mode !== \"library\" || !intended()) return;\n closeReturnValue.current = returnValue;\n closeRoot(event, reason, returnValue);\n },\n [mode, intended, closeRoot],\n );\n\n // Memoised: `root` changes only with the open state and pending, so the value changes only\n // with those and `modal`, and the parts do not re-render for an unrelated render of the Root.\n const context = useMemo<DialogContextValue>(\n () => ({ ...root, modal, requestClose, takeCloseReturnValue }),\n [root, modal, requestClose, takeCloseReturnValue],\n );\n\n const state: DialogRootState = { open: optimistic, pending: root.pending, modal };\n\n return <DialogContext value={context}>{resolveStateValue(children, state)}</DialogContext>;\n}\n\nDialogRoot.displayName = \"DialogRoot\";\n"],"mappings":";;;;;;;;AAoEA,MAAM,iBACJ,OACA,QACA,gBAC4B,oBAAoB,OAAO;CAAE;CAAQ;AAAY,CAAC;AAEhF,MAAM,gBAAgB,WAAuC,OAAO;;;;;;;;;;;;;AAcpE,SAAgB,WAAW,EACzB,MACA,aACA,kBACA,QAAQ,MACR,YACkB;CAGlB,MAAM,OAAO,eAAkF;EAC7F,WAAW;EACX,MAAM;EACN;EACA;EACA;EACA,SAAS;EACT,SAAS;CACX,CAAC;CACD,MAAM,EAAE,MAAM,UAAU,gBAAgB,YAAY,cAAc,cAAc;CAKhF,MAAM,mBAAmB,OAA2B,KAAA,CAAS;CAC7D,yBAAyB;EACvB,IAAI,eAAe,CAAC,EAAE,QAAQ,YAAY,iBAAiB,UAAU,KAAA;CACvE,CAAC;CACD,MAAM,uBAAuB,kBAA0B;EACrD,MAAM,QAAQ,iBAAiB;EAC/B,iBAAiB,UAAU,KAAA;EAC3B,OAAO,SAAS;CAClB,GAAG,CAAC,CAAC;CAKL,MAAM,eAAe,aAClB,OAA0B,QAAsB,gBAA8B;EAC7E,IAAI,SAAS,aAAa,CAAC,SAAS,GAAG;EACvC,iBAAiB,UAAU;EAC3B,UAAU,OAAO,QAAQ,WAAW;CACtC,GACA;EAAC;EAAM;EAAU;CAAS,CAC5B;CAIA,MAAM,UAAU,eACP;EAAE,GAAG;EAAM;EAAO;EAAc;CAAqB,IAC5D;EAAC;EAAM;EAAO;EAAc;CAAoB,CAClD;CAEA,MAAM,QAAyB;EAAE,MAAM;EAAY,SAAS,KAAK;EAAS;CAAM;CAEhF,OAAO,oBAAC,eAAD;EAAe,OAAO;EAAU,UAAA,kBAAkB,UAAU,KAAK;CAAiB,CAAA;AAC3F;AAEA,WAAW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-trigger.d.mts","names":[],"sources":["../../src/dialog/dialog-trigger.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"dialog-trigger.d.mts","names":[],"sources":["../../src/dialog/dialog-trigger.tsx"],"mappings":";;;iBAUiB;;WAEN;;;;;;WAMA;WACA;;iBAGM,2BAA2B,KAC1C;;;;;;EAQA;EACA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;wBAgBvC,gBACd,UACA,WACA,OACA,UACA,WACG,QACF,qBAAkB;yBAPL"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { disabledButton, rendersButton } from "../internal/render-element.mjs";
|
|
4
4
|
import { useRender } from "../internal/use-render.mjs";
|
|
5
|
+
import { useElementCheck } from "../internal/use-element-check.mjs";
|
|
5
6
|
import { useDialogContext } from "./dialog-context.mjs";
|
|
6
7
|
import { useCallback, useEffect } from "react";
|
|
7
8
|
//#region src/dialog/dialog-trigger.tsx
|
|
@@ -20,30 +21,27 @@ const isDev = process.env.NODE_ENV !== "production";
|
|
|
20
21
|
function DialogTrigger({ disabled = false, className, style, children, render, ...rest }) {
|
|
21
22
|
const ctx = useDialogContext("Dialog.Trigger");
|
|
22
23
|
const isLibrary = ctx.mode === "library";
|
|
23
|
-
const { modal, ids, triggerRef,
|
|
24
|
+
const { modal, ids, triggerRef, popupRef } = ctx;
|
|
24
25
|
const state = {
|
|
25
26
|
open: ctx.optimistic,
|
|
26
27
|
pending: ctx.pending,
|
|
27
28
|
disabled
|
|
28
29
|
};
|
|
30
|
+
const checkElement = useElementCheck(isDev && ((element) => !isLibrary && modal && element.tagName !== "BUTTON" ? `Dialog.Trigger: rendered a <${element.tagName.toLowerCase()}> in JS-free mode. Only a <button> runs \`command="show-modal"\`; this trigger will not open the dialog. Render a <button>, or put the Dialog in library mode (\`defaultOpen={false}\`).` : null));
|
|
29
31
|
const libraryRef = useCallback((element) => {
|
|
30
|
-
|
|
32
|
+
checkElement?.(element);
|
|
31
33
|
triggerRef.current = element;
|
|
32
34
|
return () => {
|
|
33
35
|
if (triggerRef.current === element) triggerRef.current = null;
|
|
34
36
|
};
|
|
35
|
-
}, [
|
|
36
|
-
isLibrary,
|
|
37
|
-
modal,
|
|
38
|
-
triggerRef
|
|
39
|
-
]);
|
|
37
|
+
}, [checkElement, triggerRef]);
|
|
40
38
|
useEffect(() => {
|
|
41
39
|
if (!isDev) return;
|
|
42
|
-
if (document.getElementById(ids.
|
|
43
|
-
}, [ids.
|
|
40
|
+
if (document.getElementById(ids.popup) === null) console.error("Dialog.Trigger: no Dialog.Popup is rendered for this Dialog.Root; the trigger opens nothing.");
|
|
41
|
+
}, [ids.popup]);
|
|
44
42
|
const installClick = isLibrary || !modal;
|
|
45
|
-
const
|
|
46
|
-
const invoker = modal &&
|
|
43
|
+
const disabledProps = disabledButton(render, disabled, { handlesClick: installClick });
|
|
44
|
+
const invoker = modal && disabledProps.invoker;
|
|
47
45
|
const onClick = (event) => {
|
|
48
46
|
if (isLibrary) {
|
|
49
47
|
event.preventDefault();
|
|
@@ -55,14 +53,13 @@ function DialogTrigger({ disabled = false, className, style, children, render, .
|
|
|
55
53
|
event.preventDefault();
|
|
56
54
|
return;
|
|
57
55
|
}
|
|
58
|
-
const dialog =
|
|
56
|
+
const dialog = popupRef.current;
|
|
59
57
|
if (dialog !== null && !dialog.open && dialog.isConnected) dialog.show();
|
|
60
58
|
};
|
|
61
59
|
const libraryProps = {
|
|
62
60
|
...rendersButton(render) && { type: "button" },
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
commandfor: invoker ? ids.dialog : void 0,
|
|
61
|
+
...disabledProps.props,
|
|
62
|
+
commandfor: invoker ? ids.popup : void 0,
|
|
66
63
|
command: invoker ? "show-modal" : void 0,
|
|
67
64
|
...installClick && { onClick },
|
|
68
65
|
"data-open": dataAttr(state.open),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-trigger.mjs","names":[],"sources":["../../src/dialog/dialog-trigger.tsx"],"sourcesContent":["\"use client\";\nimport { useCallback, useEffect } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, MouseEvent, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"dialog-trigger.mjs","names":[],"sources":["../../src/dialog/dialog-trigger.tsx"],"sourcesContent":["\"use client\";\nimport { useCallback, useEffect } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, MouseEvent, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useElementCheck } from \"../internal/use-element-check.js\";\nimport { disabledButton, rendersButton, useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { useDialogContext } from \"./dialog-context.js\";\n\nexport interface DialogTriggerState {\n /** Optimistic open state (library mode); `false` in JS-free mode. */\n readonly open: boolean;\n /**\n * The Root's transition is pending: an open in flight, a close a part asked for in flight\n * (`openChangeAction(false)` awaited while the dialog is still open), a close notification in\n * flight, or a re-open requested while a close notification is still settling.\n */\n readonly pending: boolean;\n readonly disabled: boolean;\n}\n\nexport interface DialogTriggerProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n \"onClick\" | \"className\" | \"style\" | \"children\"\n> {\n /**\n * Never dispatches. Native `disabled` on a `<button>` (no longer an invoker); with a link or\n * component `render` where the Trigger handles the click (library mode, or a non-modal\n * dialog), `aria-disabled=\"true\"` instead: the element stays focusable.\n */\n disabled?: boolean;\n className?: StateValue<string | undefined, DialogTriggerState>;\n style?: StateValue<CSSProperties | undefined, DialogTriggerState>;\n /** Rendered from optimistic state; must not suspend. */\n children?: StateValue<ReactNode, DialogTriggerState>;\n /** Should render a `<button>`; another element works only in library mode (click handler). */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, DialogTriggerState>;\n}\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/**\n * The opener: `<button type=\"button\" commandfor command=\"show-modal\">`. In JS-free mode the\n * browser runs the command. In library mode the click is cancelled (so the command does not run)\n * and dispatched through the Root's transition; the button shows optimistic `data-open` and\n * `data-pending` until the dialog has opened. Non-modal dialogs have no command and always use a\n * click handler (`show()`).\n *\n * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `aria-disabled` (a\n * link or component `render` with the click handler installed), `commandfor`, `command`,\n * `onClick`, `data-open`, `data-pending`, `data-disabled`.\n */\nexport function DialogTrigger({\n disabled = false,\n className,\n style,\n children,\n render,\n ...rest\n}: DialogTriggerProps) {\n const ctx = useDialogContext(\"Dialog.Trigger\");\n const isLibrary = ctx.mode === \"library\";\n const { modal, ids, triggerRef, popupRef } = ctx;\n\n const state: DialogTriggerState = {\n open: ctx.optimistic,\n // Every Root dispatch is an open, a part-initiated close or a dismissal notification, and\n // all of them belong to the Trigger (design 4.2). Not `optimistic !== committed`: a re-open\n // while a close notification is still settling has both `true` (the close never committed)\n // and is pending all the same.\n pending: ctx.pending,\n disabled,\n };\n\n const checkElement = useElementCheck(\n isDev &&\n ((element) =>\n !isLibrary && modal && element.tagName !== \"BUTTON\"\n ? `Dialog.Trigger: rendered a <${element.tagName.toLowerCase()}> in JS-free mode. Only a ` +\n '<button> runs `command=\"show-modal\"`; this trigger will not open the dialog. Render ' +\n \"a <button>, or put the Dialog in library mode (`defaultOpen={false}`).\"\n : null),\n );\n const libraryRef = useCallback(\n (element: HTMLElement) => {\n checkElement?.(element);\n triggerRef.current = element;\n return () => {\n if (triggerRef.current === element) triggerRef.current = null;\n };\n },\n [checkElement, triggerRef],\n );\n\n // A Trigger without a Popup opens nothing (design 14, dev warnings).\n useEffect(() => {\n if (!isDev) return;\n if (document.getElementById(ids.popup) === null) {\n console.error(\n \"Dialog.Trigger: no Dialog.Popup is rendered for this Dialog.Root; the trigger opens nothing.\",\n );\n }\n }, [ids.popup]);\n\n // Library mode (both modal and non-modal) and non-modal JS-free mode need a click handler;\n // modal JS-free mode is the browser's command.\n const installClick = isLibrary || !modal;\n // The modal JS-free command needs native `disabled` to stop it.\n const disabledProps = disabledButton(render, disabled, { handlesClick: installClick });\n const invoker = modal && disabledProps.invoker;\n const onClick = (event: MouseEvent<HTMLElement>) => {\n if (isLibrary) {\n // Cancelling the click cancels the command (it runs as the button's activation\n // behaviour, only if the click was not cancelled).\n event.preventDefault();\n if (disabled) return;\n ctx.requestOpen(event.nativeEvent, \"activate\");\n return;\n }\n if (disabled) {\n // A disabled link must not navigate either.\n event.preventDefault();\n return;\n }\n const dialog = popupRef.current;\n if (dialog !== null && !dialog.open && dialog.isConnected) dialog.show();\n };\n\n const libraryProps: ComponentPropsWithRef<\"button\"> & DataAttributes = {\n // `type` only applies to a <button>; on any other element the key is not owned.\n ...(rendersButton(render) && { type: \"button\" as const }),\n // Owned: a render element must not re-enable a disabled Trigger (in JS-free mode the\n // browser would run its command).\n ...disabledProps.props,\n commandfor: invoker ? ids.popup : undefined,\n command: invoker ? \"show-modal\" : undefined,\n // Only owned when installed, so a render element keeps its own `onClick` in modal JS-free\n // mode (Accordion's rule).\n ...(installClick && { onClick }),\n \"data-open\": dataAttr(state.open),\n \"data-pending\": dataAttr(state.pending),\n // Every mode: the styling hook agrees with the rendered `disabled` / `aria-disabled`\n // (conventions 1.2).\n \"data-disabled\": dataAttr(disabled),\n };\n\n return useRender<ComponentPropsWithRef<\"button\">, DialogTriggerState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps,\n ref: libraryRef,\n });\n}\n\nDialogTrigger.displayName = \"DialogTrigger\";\n"],"mappings":";;;;;;;;AAwCA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;;;;;;;;;;;AAavC,SAAgB,cAAc,EAC5B,WAAW,OACX,WACA,OACA,UACA,QACA,GAAG,QACkB;CACrB,MAAM,MAAM,iBAAiB,gBAAgB;CAC7C,MAAM,YAAY,IAAI,SAAS;CAC/B,MAAM,EAAE,OAAO,KAAK,YAAY,aAAa;CAE7C,MAAM,QAA4B;EAChC,MAAM,IAAI;EAKV,SAAS,IAAI;EACb;CACF;CAEA,MAAM,eAAe,gBACnB,WACI,YACA,CAAC,aAAa,SAAS,QAAQ,YAAY,WACvC,+BAA+B,QAAQ,QAAQ,YAAY,EAAE,4LAG7D,KACV;CACA,MAAM,aAAa,aAChB,YAAyB;EACxB,eAAe,OAAO;EACtB,WAAW,UAAU;EACrB,aAAa;GACX,IAAI,WAAW,YAAY,SAAS,WAAW,UAAU;EAC3D;CACF,GACA,CAAC,cAAc,UAAU,CAC3B;CAGA,gBAAgB;EACd,IAAI,CAAC,OAAO;EACZ,IAAI,SAAS,eAAe,IAAI,KAAK,MAAM,MACzC,QAAQ,MACN,8FACF;CAEJ,GAAG,CAAC,IAAI,KAAK,CAAC;CAId,MAAM,eAAe,aAAa,CAAC;CAEnC,MAAM,gBAAgB,eAAe,QAAQ,UAAU,EAAE,cAAc,aAAa,CAAC;CACrF,MAAM,UAAU,SAAS,cAAc;CACvC,MAAM,WAAW,UAAmC;EAClD,IAAI,WAAW;GAGb,MAAM,eAAe;GACrB,IAAI,UAAU;GACd,IAAI,YAAY,MAAM,aAAa,UAAU;GAC7C;EACF;EACA,IAAI,UAAU;GAEZ,MAAM,eAAe;GACrB;EACF;EACA,MAAM,SAAS,SAAS;EACxB,IAAI,WAAW,QAAQ,CAAC,OAAO,QAAQ,OAAO,aAAa,OAAO,KAAK;CACzE;CAEA,MAAM,eAAiE;EAErE,GAAI,cAAc,MAAM,KAAK,EAAE,MAAM,SAAkB;EAGvD,GAAG,cAAc;EACjB,YAAY,UAAU,IAAI,QAAQ,KAAA;EAClC,SAAS,UAAU,eAAe,KAAA;EAGlC,GAAI,gBAAgB,EAAE,QAAQ;EAC9B,aAAa,SAAS,MAAM,IAAI;EAChC,gBAAgB,SAAS,MAAM,OAAO;EAGtC,iBAAiB,SAAS,QAAQ;CACpC;CAEA,OAAO,UAA+D;EACpE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;EACA,KAAK;CACP,CAAC;AACH;AAEA,cAAc,cAAc"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRender } from "../internal/use-render.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { fieldDataAttributes } from "
|
|
6
|
-
import {
|
|
3
|
+
import { useElementCheck } from "../internal/use-element-check.mjs";
|
|
4
|
+
import { useMergedRefs } from "../internal/use-merged-refs.mjs";
|
|
5
|
+
import { fieldDataAttributes, useFieldContext } from "../internal/field-context.mjs";
|
|
6
|
+
import { useFieldControl } from "../internal/use-field-control.mjs";
|
|
7
7
|
//#region src/field/field-control.tsx
|
|
8
8
|
const isDev = process.env.NODE_ENV !== "production";
|
|
9
9
|
const CONTROL_TAGS = /* @__PURE__ */ new Set([
|
|
@@ -33,15 +33,8 @@ function FieldControl({ name, disabled, required, className, style, render, ...r
|
|
|
33
33
|
id: consumerId,
|
|
34
34
|
component: "Field.Control"
|
|
35
35
|
});
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
if (isDev && !warned.current && !CONTROL_TAGS.has(el.tagName)) {
|
|
39
|
-
warned.current = true;
|
|
40
|
-
console.error(`Field.Control: expected to render an <input>, <textarea> or <select> but got <${el.tagName.toLowerCase()}>. Validation, labelling and form participation need a native form control.`);
|
|
41
|
-
}
|
|
42
|
-
return () => {};
|
|
43
|
-
}, []);
|
|
44
|
-
const ref = useMergedRef(checkElement, field.ref);
|
|
36
|
+
const checkElement = useElementCheck(isDev && ((el) => !CONTROL_TAGS.has(el.tagName) ? `Field.Control: expected to render an <input>, <textarea> or <select> but got <${el.tagName.toLowerCase()}>. Validation, labelling and form participation need a native form control.` : null));
|
|
37
|
+
const ref = useMergedRefs(checkElement, field.ref);
|
|
45
38
|
return useRender({
|
|
46
39
|
defaultElement: "input",
|
|
47
40
|
render,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-control.mjs","names":[],"sources":["../../src/field/field-control.tsx"],"sourcesContent":["\"use client\";\nimport
|
|
1
|
+
{"version":3,"file":"field-control.mjs","names":[],"sources":["../../src/field/field-control.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties } from \"react\";\nimport { fieldDataAttributes, useFieldContext } from \"../internal/field-context.js\";\nimport type { FieldState } from \"../internal/field-context.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useElementCheck } from \"../internal/use-element-check.js\";\nimport { useFieldControl } from \"../internal/use-field-control.js\";\nimport { useMergedRefs } from \"../internal/use-merged-refs.js\";\nimport { useRender } from \"../internal/use-render.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\nexport interface FieldControlProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n \"id\" | \"aria-invalid\" | \"className\" | \"style\" | \"children\"\n> {\n /** Native `name`; defaults to the Field's `name`. */\n name?: string;\n /** Native `disabled`; the Field's `disabled` also disables the control. Owned. */\n disabled?: boolean;\n /** Native `required`; the Field's `required` also requires the control. Owned. */\n required?: boolean;\n className?: StateValue<string | undefined, FieldState>;\n style?: StateValue<CSSProperties | undefined, FieldState>;\n /** Must render an `<input>`, `<textarea>` or `<select>`: `render={<textarea rows={3} />}`. */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, FieldState>;\n}\n\nconst CONTROL_TAGS = new Set([\"INPUT\", \"TEXTAREA\", \"SELECT\"]);\n\n/**\n * The field's native control: an `<input>` (or a `<textarea>` / `<select>` through `render`)\n * wired to the Field: `id` for the Label, `aria-describedby` (the consumer's tokens, the\n * description, the error while shown), an explicit `aria-invalid`, and `name` / `disabled` /\n * `required` from the Field unless given. Everything else passes through, including `onChange`\n * / `value` for a controlled input; the Field's listeners are native and run independently.\n *\n * Owned keys (conventions 1.2): `id`, `name`, `disabled`, `required`, `aria-invalid`,\n * `aria-describedby` (token-merged), `data-invalid`, `data-disabled`, `data-required`,\n * `data-pending`.\n */\nexport function FieldControl({\n name,\n disabled,\n required,\n className,\n style,\n render,\n ...rest\n}: FieldControlProps) {\n const ctx = useFieldContext(\"Field.Control\");\n // `id` is not in the props type (the Field owns it); a JS caller's is ignored with a warning.\n const { id: consumerId, ...props } = rest as typeof rest & { id?: string };\n const field = useFieldControl({\n labelable: true,\n name,\n disabled,\n required,\n id: consumerId,\n component: \"Field.Control\",\n });\n const checkElement = useElementCheck(\n isDev &&\n ((el) =>\n !CONTROL_TAGS.has(el.tagName)\n ? \"Field.Control: expected to render an <input>, <textarea> or <select> but got \" +\n `<${el.tagName.toLowerCase()}>. Validation, labelling and form participation need a ` +\n \"native form control.\"\n : null),\n );\n const ref = useMergedRefs<HTMLElement>(checkElement, field.ref);\n\n return useRender<ComponentPropsWithRef<\"input\">, FieldState>({\n defaultElement: \"input\",\n render,\n state: ctx.state,\n className,\n style,\n children: undefined,\n props,\n libraryProps: {\n id: field.id,\n name: field.name,\n disabled: field.disabled,\n required: field.required,\n ...field.attributes,\n ...fieldDataAttributes(ctx.state),\n },\n ref,\n });\n}\n\nFieldControl.displayName = \"FieldControl\";\n"],"mappings":";;;;;;;AAUA,MAAM,QAAQ,QAAQ,IAAI,aAAa;AAkBvC,MAAM,+BAAe,IAAI,IAAI;CAAC;CAAS;CAAY;AAAQ,CAAC;;;;;;;;;;;;AAa5D,SAAgB,aAAa,EAC3B,MACA,UACA,UACA,WACA,OACA,QACA,GAAG,QACiB;CACpB,MAAM,MAAM,gBAAgB,eAAe;CAE3C,MAAM,EAAE,IAAI,YAAY,GAAG,UAAU;CACrC,MAAM,QAAQ,gBAAgB;EAC5B,WAAW;EACX;EACA;EACA;EACA,IAAI;EACJ,WAAW;CACb,CAAC;CACD,MAAM,eAAe,gBACnB,WACI,OACA,CAAC,aAAa,IAAI,GAAG,OAAO,IACxB,iFACI,GAAG,QAAQ,YAAY,EAAE,+EAE7B,KACV;CACA,MAAM,MAAM,cAA2B,cAAc,MAAM,GAAG;CAE9D,OAAO,UAAsD;EAC3D,gBAAgB;EAChB;EACA,OAAO,IAAI;EACX;EACA;EACA,UAAU,KAAA;EACV;EACA,cAAc;GACZ,IAAI,MAAM;GACV,MAAM,MAAM;GACZ,UAAU,MAAM;GAChB,UAAU,MAAM;GAChB,GAAG,MAAM;GACT,GAAG,oBAAoB,IAAI,KAAK;EAClC;EACA;CACF,CAAC;AACH;AAEA,aAAa,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-description.d.mts","names":[],"sources":["../../src/field/field-description.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"field-description.d.mts","names":[],"sources":["../../src/field/field-description.tsx"],"mappings":";;;;iBAOiB,8BAA8B,KAC7C;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,4BAA4B;;;;;;;;;;wBAWlC,mBACd,WACA,OACA,UACA,WACG,QACF,wBAAqB;yBANR"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRender } from "../internal/use-render.mjs";
|
|
3
|
-
import { useFieldContext } from "../internal/field-context.mjs";
|
|
4
|
-
import { fieldDataAttributes } from "./field-root.mjs";
|
|
3
|
+
import { fieldDataAttributes, useFieldContext } from "../internal/field-context.mjs";
|
|
5
4
|
//#region src/field/field-description.tsx
|
|
6
5
|
/**
|
|
7
6
|
* Help text for the field: a `<p>` whose id the control always lists in `aria-describedby`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-description.mjs","names":[],"sources":["../../src/field/field-description.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { useFieldContext } from \"../internal/field-context.js\";\nimport type { FieldState } from \"../internal/field-context.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\
|
|
1
|
+
{"version":3,"file":"field-description.mjs","names":[],"sources":["../../src/field/field-description.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { fieldDataAttributes, useFieldContext } from \"../internal/field-context.js\";\nimport type { FieldState } from \"../internal/field-context.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\n\nexport interface FieldDescriptionProps extends Omit<\n ComponentPropsWithRef<\"p\">,\n \"id\" | \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, FieldState>;\n style?: StateValue<CSSProperties | undefined, FieldState>;\n children?: StateValue<ReactNode, FieldState>;\n render?: RenderProp<ComponentPropsWithRef<\"p\">, FieldState>;\n}\n\n/**\n * Help text for the field: a `<p>` whose id the control always lists in `aria-describedby`\n * (a dangling reference when no Description is rendered is skipped by assistive technology, so\n * nothing registers and the server HTML is exact).\n *\n * Owned keys (conventions 1.2): `id`, `data-invalid`, `data-disabled`, `data-required`,\n * `data-pending`.\n */\nexport function FieldDescription({\n className,\n style,\n children,\n render,\n ...rest\n}: FieldDescriptionProps) {\n const ctx = useFieldContext(\"Field.Description\");\n return useRender<ComponentPropsWithRef<\"p\">, FieldState>({\n defaultElement: \"p\",\n render,\n state: ctx.state,\n className,\n style,\n children,\n props: rest,\n libraryProps: { id: ctx.ids.description, ...fieldDataAttributes(ctx.state) },\n });\n}\n\nFieldDescription.displayName = \"FieldDescription\";\n"],"mappings":";;;;;;;;;;;;AAyBA,SAAgB,iBAAiB,EAC/B,WACA,OACA,UACA,QACA,GAAG,QACqB;CACxB,MAAM,MAAM,gBAAgB,mBAAmB;CAC/C,OAAO,UAAkD;EACvD,gBAAgB;EAChB;EACA,OAAO,IAAI;EACX;EACA;EACA;EACA,OAAO;EACP,cAAc;GAAE,IAAI,IAAI,IAAI;GAAa,GAAG,oBAAoB,IAAI,KAAK;EAAE;CAC7E,CAAC;AACH;AAEA,iBAAiB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-error.d.mts","names":[],"sources":["../../src/field/field-error.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"field-error.d.mts","names":[],"sources":["../../src/field/field-error.tsx"],"mappings":";;;;iBAQiB,wBAAwB,KACvC;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;;;;;EAM9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,8BAA8B;;;;;;;;;;;wBAgBpC,aACd,WACA,OACA,UACA,WACG,QACF,kBAAe;yBANF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRender } from "../internal/use-render.mjs";
|
|
3
|
-
import { useFieldContext } from "../internal/field-context.mjs";
|
|
4
|
-
import { fieldDataAttributes } from "./field-root.mjs";
|
|
3
|
+
import { fieldDataAttributes, useFieldContext } from "../internal/field-context.mjs";
|
|
5
4
|
import { useLayoutEffect } from "react";
|
|
6
5
|
//#region src/field/field-error.tsx
|
|
7
6
|
function defaultChildren(state) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-error.mjs","names":[],"sources":["../../src/field/field-error.tsx"],"sourcesContent":["\"use client\";\nimport { useLayoutEffect } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { useFieldContext } from \"../internal/field-context.js\";\nimport type { FieldState } from \"../internal/field-context.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\
|
|
1
|
+
{"version":3,"file":"field-error.mjs","names":[],"sources":["../../src/field/field-error.tsx"],"sourcesContent":["\"use client\";\nimport { useLayoutEffect } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { fieldDataAttributes, useFieldContext } from \"../internal/field-context.js\";\nimport type { FieldState } from \"../internal/field-context.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\n\nexport interface FieldErrorProps extends Omit<\n ComponentPropsWithRef<\"div\">,\n \"id\" | \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, FieldState>;\n style?: StateValue<CSSProperties | undefined, FieldState>;\n /**\n * Rendered only while `state.invalid`. Default: `state.messages` joined by a space. A function\n * gets the state: `({ validity, messages }) => validity.valueMissing ? \"Enter your email\" : messages.join(\" \")`.\n * Must not suspend (urgent render, design 2.4).\n */\n children?: StateValue<ReactNode, FieldState>;\n render?: RenderProp<ComponentPropsWithRef<\"div\">, FieldState>;\n}\n\nfunction defaultChildren(state: FieldState): ReactNode {\n return state.messages.join(\" \");\n}\n\n/**\n * The field's error message: a `div` rendered only while an error is shown, whose id the control\n * then lists in `aria-describedby`. No role and no live region: the library focuses the first\n * invalid control after a submission attempt, and focus reads the description (design 4.2).\n * Its presence lets the Field cancel the platform's validation bubble.\n *\n * Owned keys (conventions 1.2): `id`, `data-invalid`, `data-disabled`, `data-required`,\n * `data-pending`.\n */\nexport function FieldError({\n className,\n style,\n children = defaultChildren,\n render,\n ...rest\n}: FieldErrorProps) {\n const ctx = useFieldContext(\"Field.Error\");\n const { registerError } = ctx;\n useLayoutEffect(registerError, [registerError]);\n const element = useRender<ComponentPropsWithRef<\"div\">, FieldState>({\n defaultElement: \"div\",\n render,\n state: ctx.state,\n className,\n style,\n children,\n props: rest,\n libraryProps: { id: ctx.ids.error, ...fieldDataAttributes(ctx.state) },\n });\n return ctx.state.invalid ? element : null;\n}\n\nFieldError.displayName = \"FieldError\";\n"],"mappings":";;;;;AAuBA,SAAS,gBAAgB,OAA8B;CACrD,OAAO,MAAM,SAAS,KAAK,GAAG;AAChC;;;;;;;;;;AAWA,SAAgB,WAAW,EACzB,WACA,OACA,WAAW,iBACX,QACA,GAAG,QACe;CAClB,MAAM,MAAM,gBAAgB,aAAa;CACzC,MAAM,EAAE,kBAAkB;CAC1B,gBAAgB,eAAe,CAAC,aAAa,CAAC;CAC9C,MAAM,UAAU,UAAoD;EAClE,gBAAgB;EAChB;EACA,OAAO,IAAI;EACX;EACA;EACA;EACA,OAAO;EACP,cAAc;GAAE,IAAI,IAAI,IAAI;GAAO,GAAG,oBAAoB,IAAI,KAAK;EAAE;CACvE,CAAC;CACD,OAAO,IAAI,MAAM,UAAU,UAAU;AACvC;AAEA,WAAW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-label.d.mts","names":[],"sources":["../../src/field/field-label.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"field-label.d.mts","names":[],"sources":["../../src/field/field-label.tsx"],"mappings":";;;;iBAUiB,wBAAwB,KACvC;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,gCAAgC;;;;;;;;;;wBAWtC,aAAa,WAAW,OAAO,UAAU,WAAW,QAAQ,kBAAe;yBAA3E"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRender } from "../internal/use-render.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { fieldDataAttributes } from "
|
|
5
|
-
import { useCallback, useRef } from "react";
|
|
3
|
+
import { useElementCheck } from "../internal/use-element-check.mjs";
|
|
4
|
+
import { fieldDataAttributes, useFieldContext } from "../internal/field-context.mjs";
|
|
6
5
|
//#region src/field/field-label.tsx
|
|
7
6
|
const isDev = process.env.NODE_ENV !== "production";
|
|
8
7
|
/**
|
|
@@ -15,14 +14,7 @@ const isDev = process.env.NODE_ENV !== "production";
|
|
|
15
14
|
*/
|
|
16
15
|
function FieldLabel({ className, style, children, render, ...rest }) {
|
|
17
16
|
const ctx = useFieldContext("Field.Label");
|
|
18
|
-
const
|
|
19
|
-
const ref = useCallback((el) => {
|
|
20
|
-
if (isDev && !warned.current && el.tagName !== "LABEL") {
|
|
21
|
-
warned.current = true;
|
|
22
|
-
console.error(`Field.Label: expected to render a <label> element but got <${el.tagName.toLowerCase()}>. Label activation and the control's accessible name need a real <label>.`);
|
|
23
|
-
}
|
|
24
|
-
return () => {};
|
|
25
|
-
}, []);
|
|
17
|
+
const ref = useElementCheck(isDev && ((el) => el.tagName !== "LABEL" ? `Field.Label: expected to render a <label> element but got <${el.tagName.toLowerCase()}>. Label activation and the control's accessible name need a real <label>.` : null));
|
|
26
18
|
return useRender({
|
|
27
19
|
defaultElement: "label",
|
|
28
20
|
render,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-label.mjs","names":[],"sources":["../../src/field/field-label.tsx"],"sourcesContent":["\"use client\";\nimport
|
|
1
|
+
{"version":3,"file":"field-label.mjs","names":[],"sources":["../../src/field/field-label.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { fieldDataAttributes, useFieldContext } from \"../internal/field-context.js\";\nimport type { FieldState } from \"../internal/field-context.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useElementCheck } from \"../internal/use-element-check.js\";\nimport { useRender } from \"../internal/use-render.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\nexport interface FieldLabelProps extends Omit<\n ComponentPropsWithRef<\"label\">,\n \"htmlFor\" | \"id\" | \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, FieldState>;\n style?: StateValue<CSSProperties | undefined, FieldState>;\n children?: StateValue<ReactNode, FieldState>;\n /** Must render a `<label>`. */\n render?: RenderProp<ComponentPropsWithRef<\"label\">, FieldState>;\n}\n\n/**\n * The field's visible name: `<label for>` pointing at the control. For a group control (a\n * RadioGroup or CheckboxGroup `<fieldset>`) it renders no `for` once the group registered, and\n * the group names itself with `aria-labelledby` → this id (design 4.2).\n *\n * Owned keys (conventions 1.2): `id`, `htmlFor`, `data-invalid`, `data-disabled`,\n * `data-required`, `data-pending`.\n */\nexport function FieldLabel({ className, style, children, render, ...rest }: FieldLabelProps) {\n const ctx = useFieldContext(\"Field.Label\");\n const ref = useElementCheck(\n isDev &&\n ((el) =>\n el.tagName !== \"LABEL\"\n ? `Field.Label: expected to render a <label> element but got <${el.tagName.toLowerCase()}>. ` +\n \"Label activation and the control's accessible name need a real <label>.\"\n : null),\n );\n return useRender<ComponentPropsWithRef<\"label\">, FieldState>({\n defaultElement: \"label\",\n render,\n state: ctx.state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n id: ctx.ids.label,\n htmlFor: ctx.labelable ? ctx.ids.control : undefined,\n ...fieldDataAttributes(ctx.state),\n },\n ref,\n });\n}\n\nFieldLabel.displayName = \"FieldLabel\";\n"],"mappings":";;;;;AAQA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;;;;;;;;AAqBvC,SAAgB,WAAW,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAAyB;CAC3F,MAAM,MAAM,gBAAgB,aAAa;CACzC,MAAM,MAAM,gBACV,WACI,OACA,GAAG,YAAY,UACX,8DAA8D,GAAG,QAAQ,YAAY,EAAE,8EAEvF,KACV;CACA,OAAO,UAAsD;EAC3D,gBAAgB;EAChB;EACA,OAAO,IAAI;EACX;EACA;EACA;EACA,OAAO;EACP,cAAc;GACZ,IAAI,IAAI,IAAI;GACZ,SAAS,IAAI,YAAY,IAAI,IAAI,UAAU,KAAA;GAC3C,GAAG,oBAAoB,IAAI,KAAK;EAClC;EACA;CACF,CAAC;AACH;AAEA,WAAW,cAAc"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { dataAttr } from "../internal/data-attr.mjs";
|
|
3
2
|
import { useDevWarning } from "../internal/use-dev-warning.mjs";
|
|
4
3
|
import { useRender } from "../internal/use-render.mjs";
|
|
5
4
|
import { useLatest } from "../internal/use-latest.mjs";
|
|
6
|
-
import {
|
|
5
|
+
import { arraysEqual } from "../internal/value-set.mjs";
|
|
6
|
+
import { FieldContext, FormContext, fieldDataAttributes } from "../internal/field-context.mjs";
|
|
7
7
|
import { useFormOwnerEvent } from "../internal/use-form-owner-event.mjs";
|
|
8
|
-
import { VALID,
|
|
8
|
+
import { VALID, focusTargetOf, normaliseErrorValue, snapshotValidity, supportsUserInvalid, validityElementOf, validityEquals } from "../internal/validity.mjs";
|
|
9
9
|
import { collectInvalid } from "../internal/focus-first-invalid.mjs";
|
|
10
|
+
import { useServerErrorVisibility } from "./use-server-error-visibility.mjs";
|
|
10
11
|
import { use, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
11
12
|
import { useFormStatus } from "react-dom";
|
|
12
13
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -37,8 +38,8 @@ function entryStrings(entries) {
|
|
|
37
38
|
function FieldRoot({ name, disabled = false, required = false, validate, className, style, children, render, ...rest }) {
|
|
38
39
|
const parent = use(FieldContext);
|
|
39
40
|
const form = use(FormContext);
|
|
40
|
-
useDevWarning(parent !== null, "Field.Root: nested inside another Field.Root. A control registers with the nearest Field only; give each control its own, sibling Field.");
|
|
41
|
-
useDevWarning(validate !== void 0 && name === void 0, "Field.Root: `validate` without `name`. `validate` receives `formData.get(name)`, which is always \"\" without a name.");
|
|
41
|
+
useDevWarning(parent !== null, isDev && "Field.Root: nested inside another Field.Root. A control registers with the nearest Field only; give each control its own, sibling Field.");
|
|
42
|
+
useDevWarning(validate !== void 0 && name === void 0, isDev && "Field.Root: `validate` without `name`. `validate` receives `formData.get(name)`, which is always \"\" without a name.");
|
|
42
43
|
const id = useId();
|
|
43
44
|
const ids = useMemo(() => ({
|
|
44
45
|
control: `${id}-control`,
|
|
@@ -78,27 +79,7 @@ function FieldRoot({ name, disabled = false, required = false, validate, classNa
|
|
|
78
79
|
const errors = form?.errors;
|
|
79
80
|
const serverMessages = useMemo(() => normaliseErrorValue(name === void 0 ? void 0 : errors?.[name]), [errors, name]);
|
|
80
81
|
const serverKey = serverMessages.join("\n");
|
|
81
|
-
|
|
82
|
-
const [dismissed, setDismissed] = useState(false);
|
|
83
|
-
/**
|
|
84
|
-
* The errors shown now answer a value the user had already changed during their flight
|
|
85
|
-
* (intercepted path). Fixed from one settle to the next, so a hidden stale error stays hidden
|
|
86
|
-
* while the next submission is in flight (the `errors` prop still holds that result).
|
|
87
|
-
*/
|
|
88
|
-
const [suppressed, setSuppressed] = useState(false);
|
|
89
|
-
/** The user changed the value during the flight in progress: becomes `suppressed` at its settle. */
|
|
90
|
-
const [suppressNext, setSuppressNext] = useState(false);
|
|
91
|
-
const [previousFormPending, setPreviousFormPending] = useState(formPending);
|
|
92
|
-
if (previousFormPending !== formPending) {
|
|
93
|
-
setPreviousFormPending(formPending);
|
|
94
|
-
if (formPending) setSuppressNext(false);
|
|
95
|
-
else {
|
|
96
|
-
setDismissed(false);
|
|
97
|
-
setSuppressed(suppressNext);
|
|
98
|
-
setSuppressNext(false);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const serverShown = serverMessages.length > 0 && !dismissed && !suppressed;
|
|
82
|
+
const { serverShown, dismiss, setSuppressNext } = useServerErrorVisibility(formPending, serverMessages);
|
|
102
83
|
const [mirror, setMirror] = useState(INITIAL_MIRROR);
|
|
103
84
|
/** The last mirror written: `refresh` compares against it, so an unchanged read renders nothing. */
|
|
104
85
|
const mirrorRef = useRef(INITIAL_MIRROR);
|
|
@@ -147,7 +128,7 @@ function FieldRoot({ name, disabled = false, required = false, validate, classNa
|
|
|
147
128
|
const submitted = formPending && name !== void 0 ? form?.submittedData() ?? null : null;
|
|
148
129
|
if (submitted !== null && name !== void 0) setSuppressNext(!arraysEqual(entryStrings(formData.getAll(name)), entryStrings(submitted.getAll(name))));
|
|
149
130
|
return showServer ? serverMessages : messages;
|
|
150
|
-
}, [latest]);
|
|
131
|
+
}, [latest, setSuppressNext]);
|
|
151
132
|
useLayoutEffect(() => {
|
|
152
133
|
refresh();
|
|
153
134
|
}, [
|
|
@@ -165,7 +146,7 @@ function FieldRoot({ name, disabled = false, required = false, validate, classNa
|
|
|
165
146
|
useLayoutEffect(() => {
|
|
166
147
|
if (element === null) return;
|
|
167
148
|
const onEdit = () => {
|
|
168
|
-
|
|
149
|
+
dismiss();
|
|
169
150
|
refresh({ dismiss: true });
|
|
170
151
|
};
|
|
171
152
|
const onBlur = () => refresh();
|
|
@@ -191,7 +172,11 @@ function FieldRoot({ name, disabled = false, required = false, validate, classNa
|
|
|
191
172
|
element.removeEventListener("focusout", onBlur, true);
|
|
192
173
|
element.removeEventListener("invalid", onInvalid, true);
|
|
193
174
|
};
|
|
194
|
-
}, [
|
|
175
|
+
}, [
|
|
176
|
+
element,
|
|
177
|
+
refresh,
|
|
178
|
+
dismiss
|
|
179
|
+
]);
|
|
195
180
|
const ownerRef = useMemo(() => ({
|
|
196
181
|
get current() {
|
|
197
182
|
return controlRef.current?.element ?? null;
|
|
@@ -238,10 +223,14 @@ function FieldRoot({ name, disabled = false, required = false, validate, classNa
|
|
|
238
223
|
refresh
|
|
239
224
|
]);
|
|
240
225
|
const notifyChange = useCallback((edit) => {
|
|
241
|
-
if (edit)
|
|
226
|
+
if (edit) dismiss();
|
|
242
227
|
refresh(edit ? { dismiss: true } : {});
|
|
243
228
|
latest.current.form?.refreshFields(formRegistration.current);
|
|
244
|
-
}, [
|
|
229
|
+
}, [
|
|
230
|
+
refresh,
|
|
231
|
+
latest,
|
|
232
|
+
dismiss
|
|
233
|
+
]);
|
|
245
234
|
useEffect(() => {
|
|
246
235
|
if (!isDev || controlRef.current !== null) return;
|
|
247
236
|
console.error("Field.Root: no form control registered. Render a Field.Control or a FUNSTACK form control (Checkbox, Switch, RadioGroup, CheckboxGroup, Select, Combobox, Slider, NumberField) inside it.");
|
|
@@ -304,16 +293,7 @@ function FieldRoot({ name, disabled = false, required = false, validate, classNa
|
|
|
304
293
|
});
|
|
305
294
|
}
|
|
306
295
|
FieldRoot.displayName = "FieldRoot";
|
|
307
|
-
/** The four state attributes every Field part renders (design 6.1). */
|
|
308
|
-
function fieldDataAttributes(state) {
|
|
309
|
-
return {
|
|
310
|
-
"data-invalid": dataAttr(state.invalid),
|
|
311
|
-
"data-disabled": dataAttr(state.disabled),
|
|
312
|
-
"data-required": dataAttr(state.required),
|
|
313
|
-
"data-pending": dataAttr(state.pending)
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
296
|
//#endregion
|
|
317
|
-
export { FieldRoot
|
|
297
|
+
export { FieldRoot };
|
|
318
298
|
|
|
319
299
|
//# sourceMappingURL=field-root.mjs.map
|