@funstack/ui 0.1.0-alpha.15 → 0.1.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -1
- package/dist/accordion/accordion-item.d.mts +19 -0
- package/dist/accordion/accordion-item.d.mts.map +1 -1
- package/dist/accordion/accordion-item.mjs +2 -0
- package/dist/accordion/accordion-item.mjs.map +1 -1
- package/dist/accordion/accordion-panel.d.mts +16 -0
- package/dist/accordion/accordion-panel.d.mts.map +1 -1
- package/dist/accordion/accordion-panel.mjs +2 -0
- package/dist/accordion/accordion-panel.mjs.map +1 -1
- package/dist/accordion/accordion-root.d.mts +36 -2
- package/dist/accordion/accordion-root.d.mts.map +1 -1
- package/dist/accordion/accordion-root.mjs +2 -0
- package/dist/accordion/accordion-root.mjs.map +1 -1
- package/dist/accordion/accordion-trigger.d.mts +9 -0
- package/dist/accordion/accordion-trigger.d.mts.map +1 -1
- package/dist/accordion/accordion-trigger.mjs +2 -0
- package/dist/accordion/accordion-trigger.mjs.map +1 -1
- package/dist/accordion/index.d.mts +2 -0
- package/dist/accordion/index.d.mts.map +1 -1
- package/dist/accordion/index.mjs +2 -0
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/bin/skill-installer.d.mts +1 -0
- package/dist/bin/skill-installer.mjs +12 -0
- package/dist/bin/skill-installer.mjs.map +1 -0
- package/dist/button/button.d.mts +25 -7
- package/dist/button/button.d.mts.map +1 -1
- package/dist/button/button.mjs +2 -0
- package/dist/button/button.mjs.map +1 -1
- package/dist/checkbox/checkbox.d.mts +25 -3
- package/dist/checkbox/checkbox.d.mts.map +1 -1
- package/dist/checkbox/checkbox.mjs +2 -0
- package/dist/checkbox/checkbox.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-item.d.mts +15 -0
- package/dist/checkbox-group/checkbox-group-item.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-item.mjs +2 -0
- package/dist/checkbox-group/checkbox-group-item.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-label.d.mts +10 -0
- package/dist/checkbox-group/checkbox-group-label.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-label.mjs +2 -0
- package/dist/checkbox-group/checkbox-group-label.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-parent.d.mts +19 -1
- package/dist/checkbox-group/checkbox-group-parent.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-parent.mjs +2 -0
- package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
- package/dist/checkbox-group/checkbox-group-root.d.mts +31 -4
- package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
- package/dist/checkbox-group/checkbox-group-root.mjs +2 -0
- package/dist/checkbox-group/checkbox-group-root.mjs.map +1 -1
- package/dist/checkbox-group/index.d.mts +2 -0
- package/dist/checkbox-group/index.d.mts.map +1 -1
- package/dist/checkbox-group/index.mjs +2 -0
- package/dist/checkbox-group/index.mjs.map +1 -1
- package/dist/combobox/combobox-clear.d.mts +18 -0
- package/dist/combobox/combobox-clear.d.mts.map +1 -1
- package/dist/combobox/combobox-clear.mjs +2 -0
- package/dist/combobox/combobox-clear.mjs.map +1 -1
- package/dist/combobox/combobox-group.d.mts +49 -1
- package/dist/combobox/combobox-group.d.mts.map +1 -1
- package/dist/combobox/combobox-group.mjs +11 -1
- package/dist/combobox/combobox-group.mjs.map +1 -1
- package/dist/combobox/combobox-input.d.mts +11 -0
- package/dist/combobox/combobox-input.d.mts.map +1 -1
- package/dist/combobox/combobox-input.mjs +2 -0
- package/dist/combobox/combobox-input.mjs.map +1 -1
- package/dist/combobox/combobox-label.d.mts +16 -0
- package/dist/combobox/combobox-label.d.mts.map +1 -1
- package/dist/combobox/combobox-label.mjs +2 -0
- package/dist/combobox/combobox-label.mjs.map +1 -1
- package/dist/combobox/combobox-list.d.mts +14 -0
- package/dist/combobox/combobox-list.d.mts.map +1 -1
- package/dist/combobox/combobox-list.mjs +2 -0
- package/dist/combobox/combobox-list.mjs.map +1 -1
- package/dist/combobox/combobox-option.d.mts +25 -3
- package/dist/combobox/combobox-option.d.mts.map +1 -1
- package/dist/combobox/combobox-option.mjs +2 -0
- package/dist/combobox/combobox-option.mjs.map +1 -1
- package/dist/combobox/combobox-popup.d.mts +16 -0
- package/dist/combobox/combobox-popup.d.mts.map +1 -1
- package/dist/combobox/combobox-popup.mjs +2 -0
- package/dist/combobox/combobox-popup.mjs.map +1 -1
- package/dist/combobox/combobox-root.d.mts +49 -12
- package/dist/combobox/combobox-root.d.mts.map +1 -1
- package/dist/combobox/combobox-root.mjs +2 -0
- package/dist/combobox/combobox-root.mjs.map +1 -1
- package/dist/combobox/combobox-trigger.d.mts +16 -0
- package/dist/combobox/combobox-trigger.d.mts.map +1 -1
- package/dist/combobox/combobox-trigger.mjs +2 -0
- package/dist/combobox/combobox-trigger.mjs.map +1 -1
- package/dist/combobox/index.d.mts +2 -0
- package/dist/combobox/index.d.mts.map +1 -1
- package/dist/combobox/index.mjs +2 -0
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/csp/csp-provider.d.mts +8 -0
- package/dist/csp/csp-provider.d.mts.map +1 -1
- package/dist/csp/csp-provider.mjs +2 -0
- package/dist/csp/csp-provider.mjs.map +1 -1
- package/dist/csp/style-hashes.d.mts +2 -0
- package/dist/csp/style-hashes.d.mts.map +1 -1
- package/dist/csp/style-hashes.mjs +2 -0
- package/dist/csp/style-hashes.mjs.map +1 -1
- package/dist/dialog/dialog-close.d.mts +18 -0
- package/dist/dialog/dialog-close.d.mts.map +1 -1
- package/dist/dialog/dialog-close.mjs +2 -0
- package/dist/dialog/dialog-close.mjs.map +1 -1
- package/dist/dialog/dialog-description.d.mts +12 -0
- package/dist/dialog/dialog-description.d.mts.map +1 -1
- package/dist/dialog/dialog-description.mjs +2 -0
- package/dist/dialog/dialog-description.mjs.map +1 -1
- package/dist/dialog/dialog-form.d.mts +18 -1
- package/dist/dialog/dialog-form.d.mts.map +1 -1
- package/dist/dialog/dialog-form.mjs +2 -0
- package/dist/dialog/dialog-form.mjs.map +1 -1
- package/dist/dialog/dialog-popup.d.mts +25 -4
- package/dist/dialog/dialog-popup.d.mts.map +1 -1
- package/dist/dialog/dialog-popup.mjs +2 -0
- package/dist/dialog/dialog-popup.mjs.map +1 -1
- package/dist/dialog/dialog-root.d.mts +15 -1
- package/dist/dialog/dialog-root.d.mts.map +1 -1
- package/dist/dialog/dialog-root.mjs +2 -0
- package/dist/dialog/dialog-root.mjs.map +1 -1
- package/dist/dialog/dialog-title.d.mts +11 -0
- package/dist/dialog/dialog-title.d.mts.map +1 -1
- package/dist/dialog/dialog-title.mjs +2 -0
- package/dist/dialog/dialog-title.mjs.map +1 -1
- package/dist/dialog/dialog-trigger.d.mts +16 -0
- package/dist/dialog/dialog-trigger.d.mts.map +1 -1
- package/dist/dialog/dialog-trigger.mjs +2 -0
- package/dist/dialog/dialog-trigger.mjs.map +1 -1
- package/dist/dialog/index.d.mts +2 -0
- package/dist/dialog/index.d.mts.map +1 -1
- package/dist/dialog/index.mjs +2 -0
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/docs/components/accordion.md +426 -0
- package/dist/docs/components/button.md +464 -0
- package/dist/docs/components/checkbox-group.md +474 -0
- package/dist/docs/components/checkbox.md +373 -0
- package/dist/docs/components/combobox.md +635 -0
- package/dist/docs/components/context-menu.md +524 -0
- package/dist/docs/components/dialog.md +686 -0
- package/dist/docs/components/field.md +587 -0
- package/dist/docs/components/menu.md +589 -0
- package/dist/docs/components/meter.md +313 -0
- package/dist/docs/components/number-field.md +528 -0
- package/dist/docs/components/popover.md +591 -0
- package/dist/docs/components/progress.md +450 -0
- package/dist/docs/components/radio-group.md +457 -0
- package/dist/docs/components/select.md +662 -0
- package/dist/docs/components/slider.md +558 -0
- package/dist/docs/components/switch.md +311 -0
- package/dist/docs/components/tabs.md +473 -0
- package/dist/docs/components/toast.md +576 -0
- package/dist/docs/components/toggle-group.md +341 -0
- package/dist/docs/components/toggle.md +245 -0
- package/dist/docs/components/toolbar.md +389 -0
- package/dist/docs/components/tooltip.md +494 -0
- package/dist/docs/concepts/action-props.md +251 -0
- package/dist/docs/concepts/ai-agents.md +56 -0
- package/dist/docs/concepts/browser-owned-state.md +118 -0
- package/dist/docs/concepts/content-security-policy.md +69 -0
- package/dist/docs/concepts/experimental.md +36 -0
- package/dist/docs/concepts/pending-and-optimistic.md +250 -0
- package/dist/docs/concepts/server-components.md +118 -0
- package/dist/docs/concepts/suspense.md +124 -0
- package/dist/docs/concepts/transitions.md +118 -0
- package/dist/docs/getting-started.md +115 -0
- package/dist/docs/index.md +181 -0
- package/dist/docs/roadmap.md +74 -0
- package/dist/docs/why.md +100 -0
- package/dist/field/field-control.d.mts +26 -3
- package/dist/field/field-control.d.mts.map +1 -1
- package/dist/field/field-control.mjs +2 -0
- package/dist/field/field-control.mjs.map +1 -1
- package/dist/field/field-description.d.mts +11 -0
- package/dist/field/field-description.d.mts.map +1 -1
- package/dist/field/field-description.mjs +2 -0
- package/dist/field/field-description.mjs.map +1 -1
- package/dist/field/field-error.d.mts +14 -2
- package/dist/field/field-error.d.mts.map +1 -1
- package/dist/field/field-error.mjs +2 -0
- package/dist/field/field-error.mjs.map +1 -1
- package/dist/field/field-label.d.mts +10 -0
- package/dist/field/field-label.d.mts.map +1 -1
- package/dist/field/field-label.mjs +2 -0
- package/dist/field/field-label.mjs.map +1 -1
- package/dist/field/field-root.d.mts +21 -2
- package/dist/field/field-root.d.mts.map +1 -1
- package/dist/field/field-root.mjs +2 -0
- package/dist/field/field-root.mjs.map +1 -1
- package/dist/field/index.d.mts +9 -0
- package/dist/field/index.d.mts.map +1 -1
- package/dist/field/index.mjs +9 -0
- package/dist/field/index.mjs.map +1 -1
- package/dist/form/form-root.d.mts +17 -1
- package/dist/form/form-root.d.mts.map +1 -1
- package/dist/form/form-root.mjs +2 -0
- package/dist/form/form-root.mjs.map +1 -1
- package/dist/form/form-submit.d.mts +18 -0
- package/dist/form/form-submit.d.mts.map +1 -1
- package/dist/form/form-submit.mjs +2 -0
- package/dist/form/form-submit.mjs.map +1 -1
- package/dist/form/index.d.mts +7 -0
- package/dist/form/index.d.mts.map +1 -1
- package/dist/form/index.mjs +7 -0
- package/dist/form/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/internal/types.d.mts +3 -0
- package/dist/internal/types.d.mts.map +1 -1
- package/dist/internal/use-popover-trigger.d.mts +1 -0
- package/dist/internal/use-popover-trigger.d.mts.map +1 -1
- package/dist/internal/use-popover-trigger.mjs.map +1 -1
- package/dist/internal/validity.d.mts +11 -0
- package/dist/internal/validity.d.mts.map +1 -1
- package/dist/internal/validity.mjs.map +1 -1
- package/dist/menu/index.d.mts +2 -0
- package/dist/menu/index.d.mts.map +1 -1
- package/dist/menu/index.mjs +2 -0
- package/dist/menu/index.mjs.map +1 -1
- package/dist/menu/menu-checkbox-item.d.mts +26 -2
- package/dist/menu/menu-checkbox-item.d.mts.map +1 -1
- package/dist/menu/menu-checkbox-item.mjs +2 -0
- package/dist/menu/menu-checkbox-item.mjs.map +1 -1
- package/dist/menu/menu-context-trigger.d.mts +24 -2
- package/dist/menu/menu-context-trigger.d.mts.map +1 -1
- package/dist/menu/menu-context-trigger.mjs +2 -0
- package/dist/menu/menu-context-trigger.mjs.map +1 -1
- package/dist/menu/menu-group.d.mts +36 -1
- package/dist/menu/menu-group.d.mts.map +1 -1
- package/dist/menu/menu-group.mjs +9 -1
- package/dist/menu/menu-group.mjs.map +1 -1
- package/dist/menu/menu-item.d.mts +23 -1
- package/dist/menu/menu-item.d.mts.map +1 -1
- package/dist/menu/menu-item.mjs +2 -0
- package/dist/menu/menu-item.mjs.map +1 -1
- package/dist/menu/menu-popup.d.mts +33 -8
- package/dist/menu/menu-popup.d.mts.map +1 -1
- package/dist/menu/menu-popup.mjs +2 -0
- package/dist/menu/menu-popup.mjs.map +1 -1
- package/dist/menu/menu-radio-group.d.mts +20 -1
- package/dist/menu/menu-radio-group.d.mts.map +1 -1
- package/dist/menu/menu-radio-group.mjs +2 -0
- package/dist/menu/menu-radio-group.mjs.map +1 -1
- package/dist/menu/menu-radio-item.d.mts +16 -0
- package/dist/menu/menu-radio-item.d.mts.map +1 -1
- package/dist/menu/menu-radio-item.mjs +2 -0
- package/dist/menu/menu-radio-item.mjs.map +1 -1
- package/dist/menu/menu-root.d.mts +22 -3
- package/dist/menu/menu-root.d.mts.map +1 -1
- package/dist/menu/menu-root.mjs +2 -0
- package/dist/menu/menu-root.mjs.map +1 -1
- package/dist/menu/menu-submenu-trigger.d.mts +13 -0
- package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
- package/dist/menu/menu-submenu-trigger.mjs +2 -0
- package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
- package/dist/menu/menu-trigger.d.mts +15 -0
- package/dist/menu/menu-trigger.d.mts.map +1 -1
- package/dist/menu/menu-trigger.mjs +2 -0
- package/dist/menu/menu-trigger.mjs.map +1 -1
- package/dist/meter/index.d.mts +2 -0
- package/dist/meter/index.d.mts.map +1 -1
- package/dist/meter/index.mjs +2 -0
- package/dist/meter/index.mjs.map +1 -1
- package/dist/meter/meter-indicator.d.mts +11 -0
- package/dist/meter/meter-indicator.d.mts.map +1 -1
- package/dist/meter/meter-indicator.mjs +2 -0
- package/dist/meter/meter-indicator.mjs.map +1 -1
- package/dist/meter/meter-label.d.mts +11 -0
- package/dist/meter/meter-label.d.mts.map +1 -1
- package/dist/meter/meter-label.mjs +2 -0
- package/dist/meter/meter-label.mjs.map +1 -1
- package/dist/meter/meter-region.d.mts +5 -0
- package/dist/meter/meter-region.d.mts.map +1 -1
- package/dist/meter/meter-region.mjs.map +1 -1
- package/dist/meter/meter-root.d.mts +52 -10
- package/dist/meter/meter-root.d.mts.map +1 -1
- package/dist/meter/meter-root.mjs +2 -0
- package/dist/meter/meter-root.mjs.map +1 -1
- package/dist/meter/meter-track.d.mts +11 -0
- package/dist/meter/meter-track.d.mts.map +1 -1
- package/dist/meter/meter-track.mjs +2 -0
- package/dist/meter/meter-track.mjs.map +1 -1
- package/dist/meter/meter-value.d.mts +15 -1
- package/dist/meter/meter-value.d.mts.map +1 -1
- package/dist/meter/meter-value.mjs +2 -0
- package/dist/meter/meter-value.mjs.map +1 -1
- package/dist/number-field/index.d.mts +2 -0
- package/dist/number-field/index.d.mts.map +1 -1
- package/dist/number-field/index.mjs +2 -0
- package/dist/number-field/index.mjs.map +1 -1
- package/dist/number-field/number-field-decrement.d.mts +2 -0
- package/dist/number-field/number-field-decrement.d.mts.map +1 -1
- package/dist/number-field/number-field-decrement.mjs +2 -0
- package/dist/number-field/number-field-decrement.mjs.map +1 -1
- package/dist/number-field/number-field-increment.d.mts +2 -0
- package/dist/number-field/number-field-increment.d.mts.map +1 -1
- package/dist/number-field/number-field-increment.mjs +2 -0
- package/dist/number-field/number-field-increment.mjs.map +1 -1
- package/dist/number-field/number-field-input.d.mts +9 -0
- package/dist/number-field/number-field-input.d.mts.map +1 -1
- package/dist/number-field/number-field-input.mjs +2 -0
- package/dist/number-field/number-field-input.mjs.map +1 -1
- package/dist/number-field/number-field-label.d.mts +10 -0
- package/dist/number-field/number-field-label.d.mts.map +1 -1
- package/dist/number-field/number-field-label.mjs +2 -0
- package/dist/number-field/number-field-label.mjs.map +1 -1
- package/dist/number-field/number-field-root.d.mts +62 -14
- package/dist/number-field/number-field-root.d.mts.map +1 -1
- package/dist/number-field/number-field-root.mjs +2 -0
- package/dist/number-field/number-field-root.mjs.map +1 -1
- package/dist/number-field/use-step-button.d.mts +20 -0
- package/dist/number-field/use-step-button.d.mts.map +1 -1
- package/dist/number-field/use-step-button.mjs.map +1 -1
- package/dist/popover/index.d.mts +2 -0
- package/dist/popover/index.d.mts.map +1 -1
- package/dist/popover/index.mjs +2 -0
- package/dist/popover/index.mjs.map +1 -1
- package/dist/popover/popover-close.d.mts +18 -0
- package/dist/popover/popover-close.d.mts.map +1 -1
- package/dist/popover/popover-close.mjs +2 -0
- package/dist/popover/popover-close.mjs.map +1 -1
- package/dist/popover/popover-description.d.mts +12 -0
- package/dist/popover/popover-description.d.mts.map +1 -1
- package/dist/popover/popover-description.mjs +2 -0
- package/dist/popover/popover-description.mjs.map +1 -1
- package/dist/popover/popover-popup.d.mts +30 -4
- package/dist/popover/popover-popup.d.mts.map +1 -1
- package/dist/popover/popover-popup.mjs +2 -0
- package/dist/popover/popover-popup.mjs.map +1 -1
- package/dist/popover/popover-root.d.mts +9 -0
- package/dist/popover/popover-root.d.mts.map +1 -1
- package/dist/popover/popover-root.mjs +2 -0
- package/dist/popover/popover-root.mjs.map +1 -1
- package/dist/popover/popover-title.d.mts +11 -0
- package/dist/popover/popover-title.d.mts.map +1 -1
- package/dist/popover/popover-title.mjs +2 -0
- package/dist/popover/popover-title.mjs.map +1 -1
- package/dist/popover/popover-trigger.d.mts +15 -0
- package/dist/popover/popover-trigger.d.mts.map +1 -1
- package/dist/popover/popover-trigger.mjs +2 -0
- package/dist/popover/popover-trigger.mjs.map +1 -1
- package/dist/progress/index.d.mts +2 -0
- package/dist/progress/index.d.mts.map +1 -1
- package/dist/progress/index.mjs +2 -0
- package/dist/progress/index.mjs.map +1 -1
- package/dist/progress/progress-indicator.d.mts +11 -0
- package/dist/progress/progress-indicator.d.mts.map +1 -1
- package/dist/progress/progress-indicator.mjs +2 -0
- package/dist/progress/progress-indicator.mjs.map +1 -1
- package/dist/progress/progress-label.d.mts +11 -0
- package/dist/progress/progress-label.d.mts.map +1 -1
- package/dist/progress/progress-label.mjs +2 -0
- package/dist/progress/progress-label.mjs.map +1 -1
- package/dist/progress/progress-root.d.mts +36 -8
- package/dist/progress/progress-root.d.mts.map +1 -1
- package/dist/progress/progress-root.mjs +2 -0
- package/dist/progress/progress-root.mjs.map +1 -1
- package/dist/progress/progress-track.d.mts +11 -0
- package/dist/progress/progress-track.d.mts.map +1 -1
- package/dist/progress/progress-track.mjs +2 -0
- package/dist/progress/progress-track.mjs.map +1 -1
- package/dist/progress/progress-value.d.mts +15 -1
- package/dist/progress/progress-value.d.mts.map +1 -1
- package/dist/progress/progress-value.mjs +2 -0
- package/dist/progress/progress-value.mjs.map +1 -1
- package/dist/radio-group/index.d.mts +2 -0
- package/dist/radio-group/index.d.mts.map +1 -1
- package/dist/radio-group/index.mjs +2 -0
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/radio-group/radio-group-item.d.mts +18 -1
- package/dist/radio-group/radio-group-item.d.mts.map +1 -1
- package/dist/radio-group/radio-group-item.mjs +2 -0
- package/dist/radio-group/radio-group-item.mjs.map +1 -1
- package/dist/radio-group/radio-group-label.d.mts +10 -0
- package/dist/radio-group/radio-group-label.d.mts.map +1 -1
- package/dist/radio-group/radio-group-label.mjs +2 -0
- package/dist/radio-group/radio-group-label.mjs.map +1 -1
- package/dist/radio-group/radio-group-root.d.mts +29 -5
- package/dist/radio-group/radio-group-root.d.mts.map +1 -1
- package/dist/radio-group/radio-group-root.mjs +2 -0
- package/dist/radio-group/radio-group-root.mjs.map +1 -1
- package/dist/select/index.d.mts +2 -0
- package/dist/select/index.d.mts.map +1 -1
- package/dist/select/index.mjs +2 -0
- package/dist/select/index.mjs.map +1 -1
- package/dist/select/select-group-label.d.mts +10 -0
- package/dist/select/select-group-label.d.mts.map +1 -1
- package/dist/select/select-group-label.mjs +2 -0
- package/dist/select/select-group-label.mjs.map +1 -1
- package/dist/select/select-group.d.mts +15 -1
- package/dist/select/select-group.d.mts.map +1 -1
- package/dist/select/select-group.mjs +2 -0
- package/dist/select/select-group.mjs.map +1 -1
- package/dist/select/select-option.d.mts +19 -1
- package/dist/select/select-option.d.mts.map +1 -1
- package/dist/select/select-option.mjs +2 -0
- package/dist/select/select-option.mjs.map +1 -1
- package/dist/select/select-root.d.mts +24 -1
- package/dist/select/select-root.d.mts.map +1 -1
- package/dist/select/select-root.mjs +2 -0
- package/dist/select/select-root.mjs.map +1 -1
- package/dist/select/select-separator.d.mts +9 -0
- package/dist/select/select-separator.d.mts.map +1 -1
- package/dist/select/select-separator.mjs +2 -0
- package/dist/select/select-separator.mjs.map +1 -1
- package/dist/select/select-trigger.d.mts +9 -0
- package/dist/select/select-trigger.d.mts.map +1 -1
- package/dist/select/select-trigger.mjs +2 -0
- package/dist/select/select-trigger.mjs.map +1 -1
- package/dist/select/select-value.d.mts +9 -0
- package/dist/select/select-value.d.mts.map +1 -1
- package/dist/select/select-value.mjs +2 -0
- package/dist/select/select-value.mjs.map +1 -1
- package/dist/slider/index.d.mts +2 -0
- package/dist/slider/index.d.mts.map +1 -1
- package/dist/slider/index.mjs +2 -0
- package/dist/slider/index.mjs.map +1 -1
- package/dist/slider/slider-indicator.d.mts +12 -0
- package/dist/slider/slider-indicator.d.mts.map +1 -1
- package/dist/slider/slider-indicator.mjs +2 -0
- package/dist/slider/slider-indicator.mjs.map +1 -1
- package/dist/slider/slider-label.d.mts +11 -1
- package/dist/slider/slider-label.d.mts.map +1 -1
- package/dist/slider/slider-label.mjs +2 -0
- package/dist/slider/slider-label.mjs.map +1 -1
- package/dist/slider/slider-root.d.mts +53 -9
- package/dist/slider/slider-root.d.mts.map +1 -1
- package/dist/slider/slider-root.mjs +2 -0
- package/dist/slider/slider-root.mjs.map +1 -1
- package/dist/slider/slider-thumb.d.mts +32 -3
- package/dist/slider/slider-thumb.d.mts.map +1 -1
- package/dist/slider/slider-thumb.mjs +2 -0
- package/dist/slider/slider-thumb.mjs.map +1 -1
- package/dist/slider/slider-track.d.mts +17 -0
- package/dist/slider/slider-track.d.mts.map +1 -1
- package/dist/slider/slider-track.mjs +2 -0
- package/dist/slider/slider-track.mjs.map +1 -1
- package/dist/slider/slider-value.d.mts +11 -0
- package/dist/slider/slider-value.d.mts.map +1 -1
- package/dist/slider/slider-value.mjs +2 -0
- package/dist/slider/slider-value.mjs.map +1 -1
- package/dist/switch/switch.d.mts +23 -3
- package/dist/switch/switch.d.mts.map +1 -1
- package/dist/switch/switch.mjs +2 -0
- package/dist/switch/switch.mjs.map +1 -1
- package/dist/tabs/index.d.mts +2 -0
- package/dist/tabs/index.d.mts.map +1 -1
- package/dist/tabs/index.mjs +2 -0
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/tabs/tabs-context.d.mts +5 -0
- package/dist/tabs/tabs-context.d.mts.map +1 -1
- package/dist/tabs/tabs-context.mjs.map +1 -1
- package/dist/tabs/tabs-indicator.d.mts +17 -0
- package/dist/tabs/tabs-indicator.d.mts.map +1 -1
- package/dist/tabs/tabs-indicator.mjs +2 -0
- package/dist/tabs/tabs-indicator.mjs.map +1 -1
- package/dist/tabs/tabs-list.d.mts +19 -1
- package/dist/tabs/tabs-list.d.mts.map +1 -1
- package/dist/tabs/tabs-list.mjs +2 -0
- package/dist/tabs/tabs-list.mjs.map +1 -1
- package/dist/tabs/tabs-panel.d.mts +19 -0
- package/dist/tabs/tabs-panel.d.mts.map +1 -1
- package/dist/tabs/tabs-panel.mjs +2 -0
- package/dist/tabs/tabs-panel.mjs.map +1 -1
- package/dist/tabs/tabs-root.d.mts +39 -5
- package/dist/tabs/tabs-root.d.mts.map +1 -1
- package/dist/tabs/tabs-root.mjs +2 -0
- package/dist/tabs/tabs-root.mjs.map +1 -1
- package/dist/tabs/tabs-tab.d.mts +22 -1
- package/dist/tabs/tabs-tab.d.mts.map +1 -1
- package/dist/tabs/tabs-tab.mjs +2 -0
- package/dist/tabs/tabs-tab.mjs.map +1 -1
- package/dist/toast/index.d.mts +2 -0
- package/dist/toast/index.d.mts.map +1 -1
- package/dist/toast/index.mjs +2 -0
- package/dist/toast/index.mjs.map +1 -1
- package/dist/toast/toast-action.d.mts +28 -3
- package/dist/toast/toast-action.d.mts.map +1 -1
- package/dist/toast/toast-action.mjs +2 -0
- package/dist/toast/toast-action.mjs.map +1 -1
- package/dist/toast/toast-close.d.mts +16 -0
- package/dist/toast/toast-close.d.mts.map +1 -1
- package/dist/toast/toast-close.mjs +2 -0
- package/dist/toast/toast-close.mjs.map +1 -1
- package/dist/toast/toast-description.d.mts +16 -1
- package/dist/toast/toast-description.d.mts.map +1 -1
- package/dist/toast/toast-description.mjs +2 -0
- package/dist/toast/toast-description.mjs.map +1 -1
- package/dist/toast/toast-root.d.mts +20 -0
- package/dist/toast/toast-root.d.mts.map +1 -1
- package/dist/toast/toast-root.mjs +2 -0
- package/dist/toast/toast-root.mjs.map +1 -1
- package/dist/toast/toast-title.d.mts +15 -1
- package/dist/toast/toast-title.d.mts.map +1 -1
- package/dist/toast/toast-title.mjs +2 -0
- package/dist/toast/toast-title.mjs.map +1 -1
- package/dist/toast/toast-viewport.d.mts +34 -5
- package/dist/toast/toast-viewport.d.mts.map +1 -1
- package/dist/toast/toast-viewport.mjs +2 -0
- package/dist/toast/toast-viewport.mjs.map +1 -1
- package/dist/toast/toast.d.mts +46 -6
- package/dist/toast/toast.d.mts.map +1 -1
- package/dist/toast/toast.mjs +4 -0
- package/dist/toast/toast.mjs.map +1 -1
- package/dist/toggle/toggle.d.mts +20 -2
- package/dist/toggle/toggle.d.mts.map +1 -1
- package/dist/toggle/toggle.mjs +2 -0
- package/dist/toggle/toggle.mjs.map +1 -1
- package/dist/toggle-group/index.d.mts +2 -0
- package/dist/toggle-group/index.d.mts.map +1 -1
- package/dist/toggle-group/index.mjs +2 -0
- package/dist/toggle-group/index.mjs.map +1 -1
- package/dist/toggle-group/toggle-group-context.d.mts +1 -0
- 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 +16 -0
- package/dist/toggle-group/toggle-group-item.d.mts.map +1 -1
- package/dist/toggle-group/toggle-group-item.mjs +2 -0
- package/dist/toggle-group/toggle-group-item.mjs.map +1 -1
- package/dist/toggle-group/toggle-group-root.d.mts +73 -12
- package/dist/toggle-group/toggle-group-root.d.mts.map +1 -1
- package/dist/toggle-group/toggle-group-root.mjs +2 -0
- package/dist/toggle-group/toggle-group-root.mjs.map +1 -1
- package/dist/toolbar/index.d.mts +2 -0
- package/dist/toolbar/index.d.mts.map +1 -1
- package/dist/toolbar/index.mjs +2 -0
- package/dist/toolbar/index.mjs.map +1 -1
- package/dist/toolbar/toolbar-root.d.mts +30 -3
- package/dist/toolbar/toolbar-root.d.mts.map +1 -1
- package/dist/toolbar/toolbar-root.mjs +2 -0
- package/dist/toolbar/toolbar-root.mjs.map +1 -1
- package/dist/toolbar/toolbar-separator.d.mts +13 -0
- package/dist/toolbar/toolbar-separator.d.mts.map +1 -1
- package/dist/toolbar/toolbar-separator.mjs +2 -0
- package/dist/toolbar/toolbar-separator.mjs.map +1 -1
- package/dist/tooltip/index.d.mts +2 -0
- package/dist/tooltip/index.d.mts.map +1 -1
- package/dist/tooltip/index.mjs +2 -0
- package/dist/tooltip/index.mjs.map +1 -1
- package/dist/tooltip/tooltip-arrow.d.mts +16 -0
- package/dist/tooltip/tooltip-arrow.d.mts.map +1 -1
- package/dist/tooltip/tooltip-arrow.mjs +2 -0
- package/dist/tooltip/tooltip-arrow.mjs.map +1 -1
- package/dist/tooltip/tooltip-context.d.mts +4 -0
- package/dist/tooltip/tooltip-context.d.mts.map +1 -1
- package/dist/tooltip/tooltip-context.mjs.map +1 -1
- package/dist/tooltip/tooltip-popup.d.mts +24 -3
- package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
- package/dist/tooltip/tooltip-popup.mjs +2 -0
- package/dist/tooltip/tooltip-popup.mjs.map +1 -1
- package/dist/tooltip/tooltip-root.d.mts +24 -2
- package/dist/tooltip/tooltip-root.d.mts.map +1 -1
- package/dist/tooltip/tooltip-root.mjs +2 -0
- package/dist/tooltip/tooltip-root.mjs.map +1 -1
- package/dist/tooltip/tooltip-trigger.d.mts +18 -1
- package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
- package/dist/tooltip/tooltip-trigger.mjs +2 -0
- package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
- package/package.json +9 -1
- package/skills/funstack-ui-knowledge/SKILL.md +75 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/popover/index.ts"],"sourcesContent":["// Ships the platform attribute typings (`command`, `commandfor`) with this subpath\n// (conventions 7.4). Type-only: the built JS has no import of it.\nimport \"../internal/platform-attributes.js\";\nimport { PopoverClose } from \"./popover-close.js\";\nimport { PopoverDescription } from \"./popover-description.js\";\nimport { PopoverPopup } from \"./popover-popup.js\";\nimport { PopoverRoot } from \"./popover-root.js\";\nimport { PopoverTitle } from \"./popover-title.js\";\nimport { PopoverTrigger } from \"./popover-trigger.js\";\n\n/**\n * Popover built on `popover=\"auto\"` and Invoker Commands: `Root` (no DOM) > `Trigger`\n * (`button[popovertarget]`) + `Popup` (`dialog[popover=auto][aria-modal=false]`) >\n * `Title`, `Description`, `Close`. The platform gives the top layer, light dismiss, Escape,\n * nesting, the implicit anchor and focus return. JS-free when the Root has none of `open` /\n * `defaultOpen` / `openChangeAction`; otherwise opening and the closes a part asks for are\n * transitions (pending Trigger, content from committed state), and dismissals are notified\n * through `openChangeAction(false)`.\n */\nexport const Popover = {\n Root: PopoverRoot,\n Trigger: PopoverTrigger,\n Popup: PopoverPopup,\n Close: PopoverClose,\n Title: PopoverTitle,\n Description: PopoverDescription,\n} as const;\n\nexport type {\n PopoverRootProps,\n PopoverRootState,\n PopoverOpenChangeDetails,\n} from \"./popover-root.js\";\nexport type { PopoverTriggerProps, PopoverTriggerState } from \"./popover-trigger.js\";\nexport type {\n PopoverPopupProps,\n PopoverPopupState,\n PopoverSide,\n PopoverAlign,\n} from \"./popover-popup.js\";\nexport type { PopoverCloseProps, PopoverCloseState } from \"./popover-close.js\";\nexport type { PopoverTitleProps, PopoverTitleState } from \"./popover-title.js\";\nexport type { PopoverDescriptionProps, PopoverDescriptionState } from \"./popover-description.js\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/popover/index.ts"],"sourcesContent":["// Ships the platform attribute typings (`command`, `commandfor`) with this subpath\n// (conventions 7.4). Type-only: the built JS has no import of it.\nimport \"../internal/platform-attributes.js\";\nimport { PopoverClose } from \"./popover-close.js\";\nimport { PopoverDescription } from \"./popover-description.js\";\nimport { PopoverPopup } from \"./popover-popup.js\";\nimport { PopoverRoot } from \"./popover-root.js\";\nimport { PopoverTitle } from \"./popover-title.js\";\nimport { PopoverTrigger } from \"./popover-trigger.js\";\n\n/**\n * Popover built on `popover=\"auto\"` and Invoker Commands: `Root` (no DOM) > `Trigger`\n * (`button[popovertarget]`) + `Popup` (`dialog[popover=auto][aria-modal=false]`) >\n * `Title`, `Description`, `Close`. The platform gives the top layer, light dismiss, Escape,\n * nesting, the implicit anchor and focus return. JS-free when the Root has none of `open` /\n * `defaultOpen` / `openChangeAction`; otherwise opening and the closes a part asks for are\n * transitions (pending Trigger, content from committed state), and dismissals are notified\n * through `openChangeAction(false)`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport const Popover = {\n Root: PopoverRoot,\n Trigger: PopoverTrigger,\n Popup: PopoverPopup,\n Close: PopoverClose,\n Title: PopoverTitle,\n Description: PopoverDescription,\n} as const;\n\nexport type {\n PopoverRootProps,\n PopoverRootState,\n PopoverOpenChangeDetails,\n} from \"./popover-root.js\";\nexport type { PopoverTriggerProps, PopoverTriggerState } from \"./popover-trigger.js\";\nexport type {\n PopoverPopupProps,\n PopoverPopupState,\n PopoverSide,\n PopoverAlign,\n} from \"./popover-popup.js\";\nexport type { PopoverCloseProps, PopoverCloseState } from \"./popover-close.js\";\nexport type { PopoverTitleProps, PopoverTitleState } from \"./popover-title.js\";\nexport type { PopoverDescriptionProps, PopoverDescriptionState } from \"./popover-description.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,MAAa,UAAU;CACrB,MAAM;CACN,SAAS;CACT,OAAO;CACP,OAAO;CACP,OAAO;CACP,aAAa;AACf"}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { Action, ActionDetails, RenderProp, StateValue } from "../internal/types.mjs";
|
|
2
2
|
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
3
3
|
//#region src/popover/popover-close.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* State of `Popover.Close`, passed to the function forms of `className`, `style`, `children` and
|
|
6
|
+
* `render`.
|
|
7
|
+
*/
|
|
4
8
|
export interface PopoverCloseState {
|
|
5
9
|
/** The `action` is in flight. */
|
|
6
10
|
readonly pending: boolean;
|
|
11
|
+
/** The `disabled` prop. */
|
|
7
12
|
readonly disabled: boolean;
|
|
8
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Props of `Popover.Close`.
|
|
16
|
+
*
|
|
17
|
+
* @see https://ui.funstack.work/components/popover
|
|
18
|
+
*/
|
|
9
19
|
export interface PopoverCloseProps extends Omit<ComponentPropsWithRef<"button">, "onClick" | "className" | "style" | "children"> {
|
|
10
20
|
/**
|
|
11
21
|
* Runs inside this part's own transition (`data-pending` on the button), then closes the
|
|
@@ -20,11 +30,17 @@ export interface PopoverCloseProps extends Omit<ComponentPropsWithRef<"button">,
|
|
|
20
30
|
* Never closes. Native `disabled` on a `<button>`; owned, so a `render` element cannot
|
|
21
31
|
* re-enable it. With a link or component `render` whose click this part handles (library mode,
|
|
22
32
|
* or with `action`), `aria-disabled="true"` instead: the element stays focusable.
|
|
33
|
+
*
|
|
34
|
+
* @defaultValue `false`
|
|
23
35
|
*/
|
|
24
36
|
disabled?: boolean;
|
|
37
|
+
/** Class name, or a function of the part's state that returns one. */
|
|
25
38
|
className?: StateValue<string | undefined, PopoverCloseState>;
|
|
39
|
+
/** Inline style, or a function of the part's state that returns one. */
|
|
26
40
|
style?: StateValue<CSSProperties | undefined, PopoverCloseState>;
|
|
41
|
+
/** Content, or a function of the part's state. */
|
|
27
42
|
children?: StateValue<ReactNode, PopoverCloseState>;
|
|
43
|
+
/** Replace the default `<button>` (element form) or take over rendering (function form). */
|
|
28
44
|
render?: RenderProp<ComponentPropsWithRef<"button">, PopoverCloseState>;
|
|
29
45
|
}
|
|
30
46
|
/**
|
|
@@ -40,6 +56,8 @@ export interface PopoverCloseProps extends Omit<ComponentPropsWithRef<"button">,
|
|
|
40
56
|
* Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `commandfor`,
|
|
41
57
|
* `command`, `onClick` (library mode, or with `action`), `aria-disabled`, `data-pending`,
|
|
42
58
|
* `data-disabled`.
|
|
59
|
+
*
|
|
60
|
+
* @see https://ui.funstack.work/components/popover
|
|
43
61
|
*/
|
|
44
62
|
export declare function PopoverClose({ action, disabled, className, style, children, render, ...rest }: PopoverCloseProps): ReactNode;
|
|
45
63
|
export declare namespace PopoverClose {
|
|
@@ -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":";;;;;;;iBAYiB;;WAEN;;WAEA;;;;;;;iBAQM,0BAA0B,KACzC;;;;;;;;;EAWA,SAAS,QAAQ,SAAS;;;;;;;;EAQ1B;;EAEA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;;;;;wBAmBvC,eACd,QACA,UACA,WACA,OACA,UACA,WACG,QACF,oBAAiB;yBARJ"}
|
|
@@ -17,6 +17,8 @@ import { usePopoverContext } from "./popover-context.mjs";
|
|
|
17
17
|
* Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `commandfor`,
|
|
18
18
|
* `command`, `onClick` (library mode, or with `action`), `aria-disabled`, `data-pending`,
|
|
19
19
|
* `data-disabled`.
|
|
20
|
+
*
|
|
21
|
+
* @see https://ui.funstack.work/components/popover
|
|
20
22
|
*/
|
|
21
23
|
function PopoverClose({ action, disabled = false, className, style, children, render, ...rest }) {
|
|
22
24
|
const ctx = usePopoverContext("Popover.Close");
|
|
@@ -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-details.js\";\nimport { isPopoverOpen } from \"../internal/popover-open.js\";\nimport type { Action, ActionDetails, RenderProp, StateValue } from \"../internal/types.js\";\nimport { useOverlayClose } from \"../internal/use-overlay-close.js\";\nimport { usePopoverContext } from \"./popover-context.js\";\n\nexport interface PopoverCloseState {\n /** The `action` is in flight. */\n readonly pending: boolean;\n readonly disabled: boolean;\n}\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. Without `action` in\n * JS-free mode the button is a native `command=\"hide-popover\"` invoker.\n */\n action?: Action<[details: ActionDetails]>;\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 disabled?: boolean;\n className?: StateValue<string | undefined, PopoverCloseState>;\n style?: StateValue<CSSProperties | undefined, PopoverCloseState>;\n children?: StateValue<ReactNode, PopoverCloseState>;\n render?: RenderProp<ComponentPropsWithRef<\"button\">, PopoverCloseState>;\n}\n\n/**\n * A close button: `<button type=\"button\" commandfor command=\"hide-popover\">`. 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); a rejection leaves the\n * popover open. 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`, `onClick` (library mode, or with `action`), `aria-disabled`, `data-pending`,\n * `data-disabled`.\n */\nexport function PopoverClose({\n action,\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 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":"
|
|
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-details.js\";\nimport { isPopoverOpen } from \"../internal/popover-open.js\";\nimport type { Action, ActionDetails, RenderProp, StateValue } from \"../internal/types.js\";\nimport { useOverlayClose } from \"../internal/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 /** The `action` is in flight. */\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. Without `action` in\n * JS-free mode the button is a native `command=\"hide-popover\"` invoker.\n */\n action?: Action<[details: ActionDetails]>;\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\">`. 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); a rejection leaves the\n * popover open. 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`, `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 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 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":";;;;;;;;;;;;;;;;;;;;;;AAuEA,SAAgB,aAAa,EAC3B,QACA,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,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"}
|
|
@@ -2,17 +2,29 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
|
|
|
2
2
|
import { PopoverPopupState } from "./popover-popup.mjs";
|
|
3
3
|
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
4
4
|
//#region src/popover/popover-description.d.ts
|
|
5
|
+
/** State of `Popover.Description`: the Popup's state. */
|
|
5
6
|
export type PopoverDescriptionState = PopoverPopupState;
|
|
7
|
+
/**
|
|
8
|
+
* Props of `Popover.Description`.
|
|
9
|
+
*
|
|
10
|
+
* @see https://ui.funstack.work/components/popover
|
|
11
|
+
*/
|
|
6
12
|
export interface PopoverDescriptionProps extends Omit<ComponentPropsWithRef<"p">, "id" | "className" | "style" | "children"> {
|
|
13
|
+
/** Class name, or a function of the part's state that returns one. */
|
|
7
14
|
className?: StateValue<string | undefined, PopoverDescriptionState>;
|
|
15
|
+
/** Inline style, or a function of the part's state that returns one. */
|
|
8
16
|
style?: StateValue<CSSProperties | undefined, PopoverDescriptionState>;
|
|
17
|
+
/** Content, or a function of the part's state. */
|
|
9
18
|
children?: StateValue<ReactNode, PopoverDescriptionState>;
|
|
19
|
+
/** Replace the default `<p>` (element form) or take over rendering (function form). */
|
|
10
20
|
render?: RenderProp<ComponentPropsWithRef<"p">, PopoverDescriptionState>;
|
|
11
21
|
}
|
|
12
22
|
/**
|
|
13
23
|
* The popover's description: a `<p>` whose id the Popup references with `aria-describedby`.
|
|
14
24
|
*
|
|
15
25
|
* Owned key (conventions 1.2): `id`.
|
|
26
|
+
*
|
|
27
|
+
* @see https://ui.funstack.work/components/popover
|
|
16
28
|
*/
|
|
17
29
|
export declare function PopoverDescription({ className, style, children, render, ...rest }: PopoverDescriptionProps): ReactNode;
|
|
18
30
|
export declare namespace PopoverDescription {
|
|
@@ -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"}
|
|
@@ -6,6 +6,8 @@ import { usePopoverContext, usePopoverPopupState } from "./popover-context.mjs";
|
|
|
6
6
|
* The popover's description: a `<p>` whose id the Popup references with `aria-describedby`.
|
|
7
7
|
*
|
|
8
8
|
* Owned key (conventions 1.2): `id`.
|
|
9
|
+
*
|
|
10
|
+
* @see https://ui.funstack.work/components/popover
|
|
9
11
|
*/
|
|
10
12
|
function PopoverDescription({ className, style, children, render, ...rest }) {
|
|
11
13
|
const ctx = usePopoverContext("Popover.Description");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-description.mjs","names":[],"sources":["../../src/popover/popover-description.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { usePopoverContext, usePopoverPopupState } from \"./popover-context.js\";\nimport type { PopoverPopupState } from \"./popover-popup.js\";\n\nexport type PopoverDescriptionState = PopoverPopupState;\n\nexport interface PopoverDescriptionProps extends Omit<\n ComponentPropsWithRef<\"p\">,\n \"id\" | \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, PopoverDescriptionState>;\n style?: StateValue<CSSProperties | undefined, PopoverDescriptionState>;\n children?: StateValue<ReactNode, PopoverDescriptionState>;\n render?: RenderProp<ComponentPropsWithRef<\"p\">, PopoverDescriptionState>;\n}\n\n/**\n * The popover's description: a `<p>` whose id the Popup references with `aria-describedby`.\n *\n * Owned key (conventions 1.2): `id`.\n */\nexport function PopoverDescription({\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverDescriptionProps) {\n const ctx = usePopoverContext(\"Popover.Description\");\n const state = usePopoverPopupState(ctx);\n return useRender<ComponentPropsWithRef<\"p\">, PopoverDescriptionState>({\n defaultElement: \"p\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: { id: ctx.ids.description },\n });\n}\n\nPopoverDescription.displayName = \"PopoverDescription\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-description.mjs","names":[],"sources":["../../src/popover/popover-description.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { usePopoverContext, usePopoverPopupState } from \"./popover-context.js\";\nimport type { PopoverPopupState } from \"./popover-popup.js\";\n\n/** State of `Popover.Description`: the Popup's state. */\nexport type PopoverDescriptionState = PopoverPopupState;\n\n/**\n * Props of `Popover.Description`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverDescriptionProps extends Omit<\n ComponentPropsWithRef<\"p\">,\n \"id\" | \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, PopoverDescriptionState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, PopoverDescriptionState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, PopoverDescriptionState>;\n /** Replace the default `<p>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"p\">, PopoverDescriptionState>;\n}\n\n/**\n * The popover's description: a `<p>` whose id the Popup references with `aria-describedby`.\n *\n * Owned key (conventions 1.2): `id`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverDescription({\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverDescriptionProps) {\n const ctx = usePopoverContext(\"Popover.Description\");\n const state = usePopoverPopupState(ctx);\n return useRender<ComponentPropsWithRef<\"p\">, PopoverDescriptionState>({\n defaultElement: \"p\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: { id: ctx.ids.description },\n });\n}\n\nPopoverDescription.displayName = \"PopoverDescription\";\n"],"mappings":";;;;;;;;;;;AAoCA,SAAgB,mBAAmB,EACjC,WACA,OACA,UACA,QACA,GAAG,QACuB;CAC1B,MAAM,MAAM,kBAAkB,qBAAqB;CACnD,MAAM,QAAQ,qBAAqB,GAAG;CACtC,OAAO,UAA+D;EACpE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc,EAAE,IAAI,IAAI,IAAI,YAAY;CAC1C,CAAC;AACH;AAEA,mBAAmB,cAAc"}
|
|
@@ -4,7 +4,15 @@ import { CSSProperties, ComponentPropsWithRef, ReactNode, RefObject, ViewTransit
|
|
|
4
4
|
//#region src/popover/popover-popup.d.ts
|
|
5
5
|
/** `inline-start` / `inline-end` follow the popup's `direction` (conventions 13.1). */
|
|
6
6
|
export type PopoverSide = AnchorSide;
|
|
7
|
+
/**
|
|
8
|
+
* Alignment of the Popup along its side: inline-relative on a top / bottom side, the top / bottom
|
|
9
|
+
* edges on the others.
|
|
10
|
+
*/
|
|
7
11
|
export type PopoverAlign = AnchorAlign;
|
|
12
|
+
/**
|
|
13
|
+
* State of `Popover.Popup`, passed to the function forms of `className`, `style`, `children` and
|
|
14
|
+
* `render`.
|
|
15
|
+
*/
|
|
8
16
|
export interface PopoverPopupState {
|
|
9
17
|
/**
|
|
10
18
|
* Committed open state (library mode); `false` in JS-free mode. Read `:popover-open` for the
|
|
@@ -19,18 +27,27 @@ export interface PopoverPopupState {
|
|
|
19
27
|
/** While shown: the resolved alignment; otherwise the `align` prop. */
|
|
20
28
|
readonly align: PopoverAlign;
|
|
21
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Props of `Popover.Popup`.
|
|
32
|
+
*
|
|
33
|
+
* @see https://ui.funstack.work/components/popover
|
|
34
|
+
*/
|
|
22
35
|
export interface PopoverPopupProps extends Omit<ComponentPropsWithRef<"dialog">, "id" | "popover" | "open" | "aria-modal" | "onToggle" | "onBeforeToggle" | "className" | "style" | "children"> {
|
|
23
36
|
/**
|
|
24
37
|
* Placement relative to the Trigger through inline `position-area`, with
|
|
25
|
-
* `position-try-fallbacks` flipping it when it does not fit.
|
|
38
|
+
* `position-try-fallbacks` flipping it when it does not fit.
|
|
26
39
|
* `"inline-start"` / `"inline-end"` follow the popup's direction. `null` emits no inline
|
|
27
40
|
* positioning (and no `data-side` / `data-align`), so a stylesheet owns placement.
|
|
41
|
+
*
|
|
42
|
+
* @defaultValue `"bottom"`
|
|
28
43
|
*/
|
|
29
44
|
side?: PopoverSide | null;
|
|
30
45
|
/**
|
|
31
|
-
* Alignment along the side.
|
|
46
|
+
* Alignment along the side. On a top / bottom side `start` / `end` are
|
|
32
47
|
* inline-relative (mirrored under `direction: rtl`); on the other sides the top / bottom
|
|
33
48
|
* edges. Ignored when `side` is `null`.
|
|
49
|
+
*
|
|
50
|
+
* @defaultValue `"center"`
|
|
34
51
|
*/
|
|
35
52
|
align?: PopoverAlign;
|
|
36
53
|
/**
|
|
@@ -42,16 +59,20 @@ export interface PopoverPopupProps extends Omit<ComponentPropsWithRef<"dialog">,
|
|
|
42
59
|
* stopped, pre-rendered at low priority. Not in the server HTML.
|
|
43
60
|
*
|
|
44
61
|
* Ignored in JS-free mode (always mounted).
|
|
62
|
+
*
|
|
63
|
+
* @defaultValue `false`
|
|
45
64
|
*/
|
|
46
65
|
keepMounted?: boolean;
|
|
47
66
|
/**
|
|
48
67
|
* Element to focus when the popover opens: a ref, or a selector resolved inside the popup.
|
|
49
68
|
* The library writes `autofocus` on it right before `showPopover()` and the platform focuses
|
|
50
|
-
* it.
|
|
51
|
-
* itself if none); for `render={<div />}` focus stays on the Trigger.
|
|
69
|
+
* it.
|
|
52
70
|
*
|
|
53
71
|
* In JS-free mode the browser opens the popover itself, so the attribute is written after
|
|
54
72
|
* hydration and kept while mounted; before hydration only `autoFocus` in the markup works.
|
|
73
|
+
*
|
|
74
|
+
* @defaultValue the platform's choice for a `<dialog>` (first focusable descendant; the popup
|
|
75
|
+
* itself if none); for `render={<div />}` focus stays on the Trigger
|
|
55
76
|
*/
|
|
56
77
|
initialFocus?: RefObject<HTMLElement | null> | string;
|
|
57
78
|
/**
|
|
@@ -67,8 +88,11 @@ export interface PopoverPopupProps extends Omit<ComponentPropsWithRef<"dialog">,
|
|
|
67
88
|
* A plain open starts none: the children mount under the already-mounted popover element.
|
|
68
89
|
*/
|
|
69
90
|
transition?: ViewTransitionClass;
|
|
91
|
+
/** Class name, or a function of the part's state that returns one. */
|
|
70
92
|
className?: StateValue<string | undefined, PopoverPopupState>;
|
|
93
|
+
/** Inline style, or a function of the part's state that returns one. */
|
|
71
94
|
style?: StateValue<CSSProperties | undefined, PopoverPopupState>;
|
|
95
|
+
/** Content, or a function of the part's state. */
|
|
72
96
|
children?: StateValue<ReactNode, PopoverPopupState>;
|
|
73
97
|
/** A `<dialog>` (default) or a `<div>` (focus stays on the Trigger). */
|
|
74
98
|
render?: RenderProp<ComponentPropsWithRef<"dialog">, PopoverPopupState>;
|
|
@@ -90,6 +114,8 @@ export interface PopoverPopupProps extends Omit<ComponentPropsWithRef<"dialog">,
|
|
|
90
114
|
* Owned keys (conventions 1.2): `id`, `popover`, `open`, `aria-modal`, `aria-labelledby` and
|
|
91
115
|
* `aria-describedby` (token-merged), and `data-side` / `data-align` unless `side` is `null`.
|
|
92
116
|
* `role` is a default (`"dialog"`) the consumer may override.
|
|
117
|
+
*
|
|
118
|
+
* @see https://ui.funstack.work/components/popover
|
|
93
119
|
*/
|
|
94
120
|
export declare function PopoverPopup({ side: sideProp, align: alignProp, keepMounted, initialFocus, transition, className, style, children, render, ...rest }: PopoverPopupProps): ReactNode;
|
|
95
121
|
export declare namespace PopoverPopup {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-popup.d.mts","names":[],"sources":["../../src/popover/popover-popup.tsx"],"mappings":";;;;;YAoBY,cAAc
|
|
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;;;;;;;;;;;;;EAazB,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;;;;;;;;;wBAuBvC,eACd,MAAM,UACN,OAAO,WACP,aACA,cACA,YACA,WACA,OACA,UACA,WACG,QACF,oBAAiB;yBAXJ"}
|
|
@@ -26,6 +26,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
26
26
|
* Owned keys (conventions 1.2): `id`, `popover`, `open`, `aria-modal`, `aria-labelledby` and
|
|
27
27
|
* `aria-describedby` (token-merged), and `data-side` / `data-align` unless `side` is `null`.
|
|
28
28
|
* `role` is a default (`"dialog"`) the consumer may override.
|
|
29
|
+
*
|
|
30
|
+
* @see https://ui.funstack.work/components/popover
|
|
29
31
|
*/
|
|
30
32
|
function PopoverPopup({ side: sideProp = "bottom", align: alignProp = "center", keepMounted, initialFocus, transition, className, style, children, render, ...rest }) {
|
|
31
33
|
const ctx = usePopoverContext("Popover.Popup");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-popup.mjs","names":[],"sources":["../../src/popover/popover-popup.tsx"],"sourcesContent":["\"use client\";\nimport type {\n ComponentPropsWithRef,\n CSSProperties,\n ReactNode,\n RefObject,\n ViewTransitionClass,\n} from \"react\";\nimport type { AnchorAlign, AnchorSide } from \"../internal/anchor-position.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useJsFreePropWarnings } from \"../internal/overlay-popup.js\";\nimport { useMergedRefs } from \"../internal/use-merged-refs.js\";\nimport { usePopoverPopup } from \"../internal/use-popover-popup.js\";\nimport { useAnchoredPlacement } from \"../internal/use-resolved-placement.js\";\nimport { resolveStateValue, useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { PopoverPopupContext, usePopoverContext } from \"./popover-context.js\";\n\n/** `inline-start` / `inline-end` follow the popup's `direction` (conventions 13.1). */\nexport type PopoverSide = AnchorSide;\nexport type PopoverAlign = AnchorAlign;\n\nexport interface PopoverPopupState {\n /**\n * Committed open state (library mode); `false` in JS-free mode. Read `:popover-open` for the\n * DOM truth.\n */\n readonly open: boolean;\n /**\n * While shown: the physical side the browser placed the popup on (after any fallback flip;\n * conventions 13.2). Otherwise the `side` prop. `null` with `side={null}`.\n */\n readonly side: PopoverSide | null;\n /** While shown: the resolved alignment; otherwise the `align` prop. */\n readonly align: PopoverAlign;\n}\n\nexport interface PopoverPopupProps extends Omit<\n ComponentPropsWithRef<\"dialog\">,\n | \"id\"\n | \"popover\"\n | \"open\"\n | \"aria-modal\"\n | \"onToggle\"\n | \"onBeforeToggle\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * Placement relative to the Trigger through inline `position-area`, with\n * `position-try-fallbacks` flipping it when it does not fit. Default `\"bottom\"`.\n * `\"inline-start\"` / `\"inline-end\"` follow the popup's direction. `null` emits no inline\n * positioning (and no `data-side` / `data-align`), so a stylesheet owns placement.\n */\n side?: PopoverSide | null;\n /**\n * Alignment along the side. Default `\"center\"`. On a top / bottom side `start` / `end` are\n * inline-relative (mirrored under `direction: rtl`); on the other sides the top / bottom\n * edges. Ignored when `side` is `null`.\n */\n align?: PopoverAlign;\n /**\n * Library mode: what happens to the children while the popover is closed.\n * - `false` (default): not rendered. Mounting them is part of the opening transition, so\n * content that suspends holds the open until it is ready. Unmount waits for the popover's\n * exit animation (CSS), or happens in the close commit when `transition` is set.\n * - `true`: rendered inside `<Activity mode=\"hidden\">`: DOM and state preserved, effects\n * stopped, pre-rendered at low priority. Not in the server HTML.\n *\n * Ignored in JS-free mode (always mounted).\n */\n keepMounted?: boolean;\n /**\n * Element to focus when the popover opens: a ref, or a selector resolved inside the popup.\n * The library writes `autofocus` on it right before `showPopover()` and the platform focuses\n * it. Default: the platform's choice for a `<dialog>` (first focusable descendant; the popup\n * itself if none); for `render={<div />}` focus stays on the Trigger.\n *\n * In JS-free mode the browser opens the popover itself, so the attribute is written after\n * hydration and kept while mounted; before hydration only `autoFocus` in the markup works.\n */\n initialFocus?: RefObject<HTMLElement | null> | string;\n /**\n * Library mode only. Forwarded to the `<ViewTransition default>` around the popover element\n * itself. Animates the opening commit, content changes while open, and every library-driven\n * close (Trigger, Close, controlled `open={false}`), in all engines; dismissals (Escape,\n * click outside) are the browser's and animate with CSS only. Ignored (dev warning) in JS-free\n * mode.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n * A plain open starts none: the children mount under the already-mounted popover element.\n */\n transition?: ViewTransitionClass;\n className?: StateValue<string | undefined, PopoverPopupState>;\n style?: StateValue<CSSProperties | undefined, PopoverPopupState>;\n children?: StateValue<ReactNode, PopoverPopupState>;\n /** A `<dialog>` (default) or a `<div>` (focus stays on the Trigger). */\n render?: RenderProp<ComponentPropsWithRef<\"dialog\">, PopoverPopupState>;\n}\n\n/**\n * The popover itself: a `<dialog popover=\"auto\" aria-modal=\"false\" role=\"dialog\">` with the id\n * the Trigger's `popovertarget` names, placed against the Trigger with CSS Anchor Positioning and\n * wired to Title and Description through `aria-labelledby` / `aria-describedby`. Style it with\n * `:popover-open`; it emits `data-side` / `data-align` but no `data-open`. While shown, those are\n * where the browser placed it (the applied `position-try-fallbacks` option; conventions 13.2),\n * in both modes; otherwise the requested values.\n *\n * In library mode the children render from committed state, so content that suspends keeps the\n * popover closed (and the Trigger pending) until it is ready; `showPopover({ source: trigger })`\n * runs in the layout effect of the commit that mounted them, and a library-driven close runs\n * `hidePopover()` in the commit that ends it. Dismissals are the browser's: the native `toggle`\n * event becomes `openChangeAction(false, { reason: \"dismiss\" })`.\n *\n * Owned keys (conventions 1.2): `id`, `popover`, `open`, `aria-modal`, `aria-labelledby` and\n * `aria-describedby` (token-merged), and `data-side` / `data-align` unless `side` is `null`.\n * `role` is a default (`\"dialog\"`) the consumer may override.\n */\nexport function PopoverPopup({\n side: sideProp = \"bottom\",\n align: alignProp = \"center\",\n keepMounted,\n initialFocus,\n transition,\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverPopupProps) {\n const ctx = usePopoverContext(\"Popover.Popup\");\n const isLibrary = ctx.mode === \"library\";\n const { ids } = ctx;\n\n useJsFreePropWarnings(\"Popover.Popup\", \"popover\", isLibrary, transition, keepMounted);\n\n const { setElement, renderContent } = usePopoverPopup(ctx, {\n part: \"Popover.Popup\",\n initialFocus,\n keepMounted,\n transition: isLibrary ? transition : undefined,\n });\n\n // Resolved while shown, in library and JS-free mode alike (it hangs off the element's ref and\n // the platform's `toggle`, not off library state).\n const placement = useAnchoredPlacement({ side: sideProp, align: alignProp });\n const { side, align } = placement;\n const ref = useMergedRefs(setElement, placement.ref);\n\n const state: PopoverPopupState = { open: ctx.committed, side, align };\n\n const content = (s: PopoverPopupState): ReactNode => (\n <PopoverPopupContext value={s}>\n {renderContent(() => resolveStateValue(children, s))}\n </PopoverPopupContext>\n );\n\n const libraryProps: ComponentPropsWithRef<\"dialog\"> & DataAttributes = {\n id: ids.popup,\n popover: \"auto\",\n // Never rendered: `showPopover()` does not set it, and an `open` attribute would show the\n // <dialog> outside the top layer. Owned so a `render` element cannot add it.\n open: undefined,\n // Chromium exposes a <dialog popover> as modal without it (design, Decisions 4).\n \"aria-modal\": \"false\",\n \"aria-labelledby\": ids.title,\n \"aria-describedby\": ids.description,\n // Not owned with `side={null}`: the stylesheet (or a render element) may set them.\n ...placement.dataAttributes,\n };\n\n const element = useRender<ComponentPropsWithRef<\"dialog\">, PopoverPopupState>({\n defaultElement: \"dialog\",\n render,\n state,\n className,\n // The consumer's style wins over the inline placement (design 8).\n style: placement.style(style),\n children: content,\n // `role` is a default the consumer's `rest` overrides (design 3.3): WebKit implements no\n // minimum role for `[popover]`, and a `<div>` popup needs it.\n props: { role: \"dialog\", ...rest },\n libraryProps,\n ref,\n });\n\n return useTransitionBoundary(\"Popover.Popup\", isLibrary ? transition : undefined, element);\n}\n\nPopoverPopup.displayName = \"PopoverPopup\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0HA,SAAgB,aAAa,EAC3B,MAAM,WAAW,UACjB,OAAO,YAAY,UACnB,aACA,cACA,YACA,WACA,OACA,UACA,QACA,GAAG,QACiB;CACpB,MAAM,MAAM,kBAAkB,eAAe;CAC7C,MAAM,YAAY,IAAI,SAAS;CAC/B,MAAM,EAAE,QAAQ;CAEhB,sBAAsB,iBAAiB,WAAW,WAAW,YAAY,WAAW;CAEpF,MAAM,EAAE,YAAY,kBAAkB,gBAAgB,KAAK;EACzD,MAAM;EACN;EACA;EACA,YAAY,YAAY,aAAa,KAAA;CACvC,CAAC;CAID,MAAM,YAAY,qBAAqB;EAAE,MAAM;EAAU,OAAO;CAAU,CAAC;CAC3E,MAAM,EAAE,MAAM,UAAU;CACxB,MAAM,MAAM,cAAc,YAAY,UAAU,GAAG;CAEnD,MAAM,QAA2B;EAAE,MAAM,IAAI;EAAW;EAAM;CAAM;CAEpE,MAAM,WAAW,MACf,oBAAC,qBAAD;EAAqB,OAAO;EACzB,UAAA,oBAAoB,kBAAkB,UAAU,CAAC,CAAC;CAChC,CAAA;CAGvB,MAAM,eAAiE;EACrE,IAAI,IAAI;EACR,SAAS;EAGT,MAAM,KAAA;EAEN,cAAc;EACd,mBAAmB,IAAI;EACvB,oBAAoB,IAAI;EAExB,GAAG,UAAU;CACf;CAEA,MAAM,UAAU,UAA8D;EAC5E,gBAAgB;EAChB;EACA;EACA;EAEA,OAAO,UAAU,MAAM,KAAK;EAC5B,UAAU;EAGV,OAAO;GAAE,MAAM;GAAU,GAAG;EAAK;EACjC;EACA;CACF,CAAC;CAED,OAAO,sBAAsB,iBAAiB,YAAY,aAAa,KAAA,GAAW,OAAO;AAC3F;AAEA,aAAa,cAAc"}
|
|
1
|
+
{"version":3,"file":"popover-popup.mjs","names":[],"sources":["../../src/popover/popover-popup.tsx"],"sourcesContent":["\"use client\";\nimport type {\n ComponentPropsWithRef,\n CSSProperties,\n ReactNode,\n RefObject,\n ViewTransitionClass,\n} from \"react\";\nimport type { AnchorAlign, AnchorSide } from \"../internal/anchor-position.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useJsFreePropWarnings } from \"../internal/overlay-popup.js\";\nimport { useMergedRefs } from \"../internal/use-merged-refs.js\";\nimport { usePopoverPopup } from \"../internal/use-popover-popup.js\";\nimport { useAnchoredPlacement } from \"../internal/use-resolved-placement.js\";\nimport { resolveStateValue, useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { PopoverPopupContext, usePopoverContext } from \"./popover-context.js\";\n\n/** `inline-start` / `inline-end` follow the popup's `direction` (conventions 13.1). */\nexport type PopoverSide = AnchorSide;\n/**\n * Alignment of the Popup along its side: inline-relative on a top / bottom side, the top / bottom\n * edges on the others.\n */\nexport type PopoverAlign = AnchorAlign;\n\n/**\n * State of `Popover.Popup`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface PopoverPopupState {\n /**\n * Committed open state (library mode); `false` in JS-free mode. Read `:popover-open` for the\n * DOM truth.\n */\n readonly open: boolean;\n /**\n * While shown: the physical side the browser placed the popup on (after any fallback flip;\n * conventions 13.2). Otherwise the `side` prop. `null` with `side={null}`.\n */\n readonly side: PopoverSide | null;\n /** While shown: the resolved alignment; otherwise the `align` prop. */\n readonly align: PopoverAlign;\n}\n\n/**\n * Props of `Popover.Popup`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverPopupProps extends Omit<\n ComponentPropsWithRef<\"dialog\">,\n | \"id\"\n | \"popover\"\n | \"open\"\n | \"aria-modal\"\n | \"onToggle\"\n | \"onBeforeToggle\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * Placement relative to the Trigger through inline `position-area`, with\n * `position-try-fallbacks` flipping it when it does not fit.\n * `\"inline-start\"` / `\"inline-end\"` follow the popup's direction. `null` emits no inline\n * positioning (and no `data-side` / `data-align`), so a stylesheet owns placement.\n *\n * @defaultValue `\"bottom\"`\n */\n side?: PopoverSide | null;\n /**\n * Alignment along the side. On a top / bottom side `start` / `end` are\n * inline-relative (mirrored under `direction: rtl`); on the other sides the top / bottom\n * edges. Ignored when `side` is `null`.\n *\n * @defaultValue `\"center\"`\n */\n align?: PopoverAlign;\n /**\n * Library mode: what happens to the children while the popover is closed.\n * - `false` (default): not rendered. Mounting them is part of the opening transition, so\n * content that suspends holds the open until it is ready. Unmount waits for the popover's\n * exit animation (CSS), or happens in the close commit when `transition` is set.\n * - `true`: rendered inside `<Activity mode=\"hidden\">`: DOM and state preserved, effects\n * stopped, pre-rendered at low priority. Not in the server HTML.\n *\n * Ignored in JS-free mode (always mounted).\n *\n * @defaultValue `false`\n */\n keepMounted?: boolean;\n /**\n * Element to focus when the popover opens: a ref, or a selector resolved inside the popup.\n * The library writes `autofocus` on it right before `showPopover()` and the platform focuses\n * it.\n *\n * In JS-free mode the browser opens the popover itself, so the attribute is written after\n * hydration and kept while mounted; before hydration only `autoFocus` in the markup works.\n *\n * @defaultValue the platform's choice for a `<dialog>` (first focusable descendant; the popup\n * itself if none); for `render={<div />}` focus stays on the Trigger\n */\n initialFocus?: RefObject<HTMLElement | null> | string;\n /**\n * Library mode only. Forwarded to the `<ViewTransition default>` around the popover element\n * itself. Animates the opening commit, content changes while open, and every library-driven\n * close (Trigger, Close, controlled `open={false}`), in all engines; dismissals (Escape,\n * click outside) are the browser's and animate with CSS only. Ignored (dev warning) in JS-free\n * mode.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n * A plain open starts none: the children mount under the already-mounted popover element.\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, PopoverPopupState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, PopoverPopupState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, PopoverPopupState>;\n /** A `<dialog>` (default) or a `<div>` (focus stays on the Trigger). */\n render?: RenderProp<ComponentPropsWithRef<\"dialog\">, PopoverPopupState>;\n}\n\n/**\n * The popover itself: a `<dialog popover=\"auto\" aria-modal=\"false\" role=\"dialog\">` with the id\n * the Trigger's `popovertarget` names, placed against the Trigger with CSS Anchor Positioning and\n * wired to Title and Description through `aria-labelledby` / `aria-describedby`. Style it with\n * `:popover-open`; it emits `data-side` / `data-align` but no `data-open`. While shown, those are\n * where the browser placed it (the applied `position-try-fallbacks` option; conventions 13.2),\n * in both modes; otherwise the requested values.\n *\n * In library mode the children render from committed state, so content that suspends keeps the\n * popover closed (and the Trigger pending) until it is ready; `showPopover({ source: trigger })`\n * runs in the layout effect of the commit that mounted them, and a library-driven close runs\n * `hidePopover()` in the commit that ends it. Dismissals are the browser's: the native `toggle`\n * event becomes `openChangeAction(false, { reason: \"dismiss\" })`.\n *\n * Owned keys (conventions 1.2): `id`, `popover`, `open`, `aria-modal`, `aria-labelledby` and\n * `aria-describedby` (token-merged), and `data-side` / `data-align` unless `side` is `null`.\n * `role` is a default (`\"dialog\"`) the consumer may override.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverPopup({\n side: sideProp = \"bottom\",\n align: alignProp = \"center\",\n keepMounted,\n initialFocus,\n transition,\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverPopupProps) {\n const ctx = usePopoverContext(\"Popover.Popup\");\n const isLibrary = ctx.mode === \"library\";\n const { ids } = ctx;\n\n useJsFreePropWarnings(\"Popover.Popup\", \"popover\", isLibrary, transition, keepMounted);\n\n const { setElement, renderContent } = usePopoverPopup(ctx, {\n part: \"Popover.Popup\",\n initialFocus,\n keepMounted,\n transition: isLibrary ? transition : undefined,\n });\n\n // Resolved while shown, in library and JS-free mode alike (it hangs off the element's ref and\n // the platform's `toggle`, not off library state).\n const placement = useAnchoredPlacement({ side: sideProp, align: alignProp });\n const { side, align } = placement;\n const ref = useMergedRefs(setElement, placement.ref);\n\n const state: PopoverPopupState = { open: ctx.committed, side, align };\n\n const content = (s: PopoverPopupState): ReactNode => (\n <PopoverPopupContext value={s}>\n {renderContent(() => resolveStateValue(children, s))}\n </PopoverPopupContext>\n );\n\n const libraryProps: ComponentPropsWithRef<\"dialog\"> & DataAttributes = {\n id: ids.popup,\n popover: \"auto\",\n // Never rendered: `showPopover()` does not set it, and an `open` attribute would show the\n // <dialog> outside the top layer. Owned so a `render` element cannot add it.\n open: undefined,\n // Chromium exposes a <dialog popover> as modal without it (design, Decisions 4).\n \"aria-modal\": \"false\",\n \"aria-labelledby\": ids.title,\n \"aria-describedby\": ids.description,\n // Not owned with `side={null}`: the stylesheet (or a render element) may set them.\n ...placement.dataAttributes,\n };\n\n const element = useRender<ComponentPropsWithRef<\"dialog\">, PopoverPopupState>({\n defaultElement: \"dialog\",\n render,\n state,\n className,\n // The consumer's style wins over the inline placement (design 8).\n style: placement.style(style),\n children: content,\n // `role` is a default the consumer's `rest` overrides (design 3.3): WebKit implements no\n // minimum role for `[popover]`, and a `<div>` popup needs it.\n props: { role: \"dialog\", ...rest },\n libraryProps,\n ref,\n });\n\n return useTransitionBoundary(\"Popover.Popup\", isLibrary ? transition : undefined, element);\n}\n\nPopoverPopup.displayName = \"PopoverPopup\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoJA,SAAgB,aAAa,EAC3B,MAAM,WAAW,UACjB,OAAO,YAAY,UACnB,aACA,cACA,YACA,WACA,OACA,UACA,QACA,GAAG,QACiB;CACpB,MAAM,MAAM,kBAAkB,eAAe;CAC7C,MAAM,YAAY,IAAI,SAAS;CAC/B,MAAM,EAAE,QAAQ;CAEhB,sBAAsB,iBAAiB,WAAW,WAAW,YAAY,WAAW;CAEpF,MAAM,EAAE,YAAY,kBAAkB,gBAAgB,KAAK;EACzD,MAAM;EACN;EACA;EACA,YAAY,YAAY,aAAa,KAAA;CACvC,CAAC;CAID,MAAM,YAAY,qBAAqB;EAAE,MAAM;EAAU,OAAO;CAAU,CAAC;CAC3E,MAAM,EAAE,MAAM,UAAU;CACxB,MAAM,MAAM,cAAc,YAAY,UAAU,GAAG;CAEnD,MAAM,QAA2B;EAAE,MAAM,IAAI;EAAW;EAAM;CAAM;CAEpE,MAAM,WAAW,MACf,oBAAC,qBAAD;EAAqB,OAAO;EACzB,UAAA,oBAAoB,kBAAkB,UAAU,CAAC,CAAC;CAChC,CAAA;CAGvB,MAAM,eAAiE;EACrE,IAAI,IAAI;EACR,SAAS;EAGT,MAAM,KAAA;EAEN,cAAc;EACd,mBAAmB,IAAI;EACvB,oBAAoB,IAAI;EAExB,GAAG,UAAU;CACf;CAEA,MAAM,UAAU,UAA8D;EAC5E,gBAAgB;EAChB;EACA;EACA;EAEA,OAAO,UAAU,MAAM,KAAK;EAC5B,UAAU;EAGV,OAAO;GAAE,MAAM;GAAU,GAAG;EAAK;EACjC;EACA;CACF,CAAC;CAED,OAAO,sBAAsB,iBAAiB,YAAY,aAAa,KAAA,GAAW,OAAO;AAC3F;AAEA,aAAa,cAAc"}
|
|
@@ -13,12 +13,18 @@ export interface PopoverOpenChangeDetails extends ActionDetails {
|
|
|
13
13
|
*/
|
|
14
14
|
readonly reason: ChangeReason;
|
|
15
15
|
}
|
|
16
|
+
/** State of `Popover.Root`, passed to the function forms of `children`. */
|
|
16
17
|
export interface PopoverRootState {
|
|
17
18
|
/** Optimistic open state (`false` in JS-free mode). Content rendered from it must not suspend. */
|
|
18
19
|
readonly open: boolean;
|
|
19
20
|
/** An `openChangeAction` dispatched through this Popover is in flight (library mode only). */
|
|
20
21
|
readonly pending: boolean;
|
|
21
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Props of `Popover.Root`.
|
|
25
|
+
*
|
|
26
|
+
* @see https://ui.funstack.work/components/popover
|
|
27
|
+
*/
|
|
22
28
|
export interface PopoverRootProps {
|
|
23
29
|
/**
|
|
24
30
|
* Controlled open state. `undefined` means uncontrolled (and, with `defaultOpen` and
|
|
@@ -43,6 +49,7 @@ export interface PopoverRootProps {
|
|
|
43
49
|
* `startTransition` (React limitation).
|
|
44
50
|
*/
|
|
45
51
|
openChangeAction?: ChangeAction<boolean, PopoverOpenChangeDetails>;
|
|
52
|
+
/** The parts. The function form receives the optimistic state and must not suspend. */
|
|
46
53
|
children?: StateValue<ReactNode, PopoverRootState>;
|
|
47
54
|
}
|
|
48
55
|
/**
|
|
@@ -55,6 +62,8 @@ export interface PopoverRootProps {
|
|
|
55
62
|
* transitions (the Trigger shows `data-pending`, content renders from committed state,
|
|
56
63
|
* `showPopover()` / `hidePopover()` run when the change has committed); dismissals are the
|
|
57
64
|
* browser's and `openChangeAction(false)` is a notification.
|
|
65
|
+
*
|
|
66
|
+
* @see https://ui.funstack.work/components/popover
|
|
58
67
|
*/
|
|
59
68
|
export declare function PopoverRoot({ open, defaultOpen, openChangeAction, children }: PopoverRootProps): import("react").JSX.Element;
|
|
60
69
|
export declare namespace PopoverRoot {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-root.d.mts","names":[],"sources":["../../src/popover/popover-root.tsx"],"mappings":";;;;iBAQiB,iCAAiC;;;;;;;;;WASvC,QAAQ;;
|
|
1
|
+
{"version":3,"file":"popover-root.d.mts","names":[],"sources":["../../src/popover/popover-root.tsx"],"mappings":";;;;iBAQiB,iCAAiC;;;;;;;;;WASvC,QAAQ;;;iBAIF;;WAEN;;WAEA;;;;;;;iBAQM;;;;;EAKf;;;;;EAKA;;;;;;;;;;;;;EAaA,mBAAmB,sBAAsB;;EAEzC,WAAW,WAAW,WAAW;;;;;;;;;;;;;;;wBAgBnB,cAAc,MAAM,aAAa,kBAAkB,YAAY,mCAAgB,IAAA;yBAA/E"}
|
|
@@ -14,6 +14,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
14
14
|
* transitions (the Trigger shows `data-pending`, content renders from committed state,
|
|
15
15
|
* `showPopover()` / `hidePopover()` run when the change has committed); dismissals are the
|
|
16
16
|
* browser's and `openChangeAction(false)` is a notification.
|
|
17
|
+
*
|
|
18
|
+
* @see https://ui.funstack.work/components/popover
|
|
17
19
|
*/
|
|
18
20
|
function PopoverRoot({ open, defaultOpen, openChangeAction, children }) {
|
|
19
21
|
const context = useOverlayRoot({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-root.mjs","names":[],"sources":["../../src/popover/popover-root.tsx"],"sourcesContent":["\"use client\";\nimport type { ReactNode } from \"react\";\nimport type { ActionDetails, ChangeAction, ChangeReason, StateValue } from \"../internal/types.js\";\nimport { popoverDetails, useOverlayRoot } from \"../internal/use-overlay-root.js\";\nimport { resolveStateValue } from \"../internal/use-render.js\";\nimport { PopoverContext } from \"./popover-context.js\";\n\n/** Details passed as the second argument of `openChangeAction`. */\nexport interface PopoverOpenChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user acted on a part: Trigger (open or close), Close, or a foreign invoker\n * (`details.event` is a `CommandEvent` / `ToggleEvent` then).\n * `\"dismiss\"`: the user closed the popover without a part: Escape, Android back, an assistive-\n * technology dismiss gesture, a click outside; or script / another top-layer element hid it.\n * `\"platform\"`: the popover was found open on mount (opened before hydration); `event` is\n * `undefined`.\n */\n readonly reason: ChangeReason;\n}\n\nexport interface PopoverRootState {\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 Popover is in flight (library mode only). */\n readonly pending: boolean;\n}\n\nexport interface PopoverRootProps {\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. Opens after hydration, never in the server\n * HTML.\n */\n defaultOpen?: boolean;\n /**\n * Awaited for `true` (the popover opens when it resolves and the content has rendered) and for\n * a `false` the user asked a part for (Trigger, Close: the popover hides when it resolves, with\n * a view transition if `transition` is set; a controlled parent that keeps `open` vetoes it).\n * A notification for a dismissal (Escape, click outside: the popover is already hidden; the\n * action runs inside the Root's transition, and a controlled parent that keeps `open` gets it\n * re-opened, which is not a veto). May be a Server Function. Rejections reach the nearest\n * Error Boundary above 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, PopoverOpenChangeDetails>;\n children?: StateValue<ReactNode, PopoverRootState>;\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 Popover runs in **JS-free mode**: the\n * Trigger is a native `popovertarget` invoker and the browser owns everything. With any\n * of them it runs in **library mode**: opening and the closes the user asks a part for are\n * transitions (the Trigger shows `data-pending`, content renders from committed state,\n * `showPopover()` / `hidePopover()` run when the change has committed); dismissals are the\n * browser's and `openChangeAction(false)` is a notification.\n */\nexport function PopoverRoot({ open, defaultOpen, openChangeAction, children }: PopoverRootProps) {\n const context = useOverlayRoot<PopoverOpenChangeDetails>({\n component: \"popover\",\n part: \"Popover.Root\",\n open,\n defaultOpen,\n openChangeAction,\n details: popoverDetails,\n });\n\n const state: PopoverRootState = { open: context.optimistic, pending: context.pending };\n\n return <PopoverContext value={context}>{resolveStateValue(children, state)}</PopoverContext>;\n}\n\nPopoverRoot.displayName = \"PopoverRoot\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-root.mjs","names":[],"sources":["../../src/popover/popover-root.tsx"],"sourcesContent":["\"use client\";\nimport type { ReactNode } from \"react\";\nimport type { ActionDetails, ChangeAction, ChangeReason, StateValue } from \"../internal/types.js\";\nimport { popoverDetails, useOverlayRoot } from \"../internal/use-overlay-root.js\";\nimport { resolveStateValue } from \"../internal/use-render.js\";\nimport { PopoverContext } from \"./popover-context.js\";\n\n/** Details passed as the second argument of `openChangeAction`. */\nexport interface PopoverOpenChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user acted on a part: Trigger (open or close), Close, or a foreign invoker\n * (`details.event` is a `CommandEvent` / `ToggleEvent` then).\n * `\"dismiss\"`: the user closed the popover without a part: Escape, Android back, an assistive-\n * technology dismiss gesture, a click outside; or script / another top-layer element hid it.\n * `\"platform\"`: the popover was found open on mount (opened before hydration); `event` is\n * `undefined`.\n */\n readonly reason: ChangeReason;\n}\n\n/** State of `Popover.Root`, passed to the function forms of `children`. */\nexport interface PopoverRootState {\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 Popover is in flight (library mode only). */\n readonly pending: boolean;\n}\n\n/**\n * Props of `Popover.Root`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverRootProps {\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. Opens after hydration, never in the server\n * HTML.\n */\n defaultOpen?: boolean;\n /**\n * Awaited for `true` (the popover opens when it resolves and the content has rendered) and for\n * a `false` the user asked a part for (Trigger, Close: the popover hides when it resolves, with\n * a view transition if `transition` is set; a controlled parent that keeps `open` vetoes it).\n * A notification for a dismissal (Escape, click outside: the popover is already hidden; the\n * action runs inside the Root's transition, and a controlled parent that keeps `open` gets it\n * re-opened, which is not a veto). May be a Server Function. Rejections reach the nearest\n * Error Boundary above 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, PopoverOpenChangeDetails>;\n /** The parts. The function form receives the optimistic state and must not suspend. */\n children?: StateValue<ReactNode, PopoverRootState>;\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 Popover runs in **JS-free mode**: the\n * Trigger is a native `popovertarget` invoker and the browser owns everything. With any\n * of them it runs in **library mode**: opening and the closes the user asks a part for are\n * transitions (the Trigger shows `data-pending`, content renders from committed state,\n * `showPopover()` / `hidePopover()` run when the change has committed); dismissals are the\n * browser's and `openChangeAction(false)` is a notification.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverRoot({ open, defaultOpen, openChangeAction, children }: PopoverRootProps) {\n const context = useOverlayRoot<PopoverOpenChangeDetails>({\n component: \"popover\",\n part: \"Popover.Root\",\n open,\n defaultOpen,\n openChangeAction,\n details: popoverDetails,\n });\n\n const state: PopoverRootState = { open: context.optimistic, pending: context.pending };\n\n return <PopoverContext value={context}>{resolveStateValue(children, state)}</PopoverContext>;\n}\n\nPopoverRoot.displayName = \"PopoverRoot\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0EA,SAAgB,YAAY,EAAE,MAAM,aAAa,kBAAkB,YAA8B;CAC/F,MAAM,UAAU,eAAyC;EACvD,WAAW;EACX,MAAM;EACN;EACA;EACA;EACA,SAAS;CACX,CAAC;CAED,MAAM,QAA0B;EAAE,MAAM,QAAQ;EAAY,SAAS,QAAQ;CAAQ;CAErF,OAAO,oBAAC,gBAAD;EAAgB,OAAO;EAAU,UAAA,kBAAkB,UAAU,KAAK;CAAkB,CAAA;AAC7F;AAEA,YAAY,cAAc"}
|
|
@@ -2,10 +2,19 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
|
|
|
2
2
|
import { PopoverPopupState } from "./popover-popup.mjs";
|
|
3
3
|
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
4
4
|
//#region src/popover/popover-title.d.ts
|
|
5
|
+
/** State of `Popover.Title`: the Popup's state. */
|
|
5
6
|
export type PopoverTitleState = PopoverPopupState;
|
|
7
|
+
/**
|
|
8
|
+
* Props of `Popover.Title`.
|
|
9
|
+
*
|
|
10
|
+
* @see https://ui.funstack.work/components/popover
|
|
11
|
+
*/
|
|
6
12
|
export interface PopoverTitleProps extends Omit<ComponentPropsWithRef<"h2">, "id" | "className" | "style" | "children"> {
|
|
13
|
+
/** Class name, or a function of the part's state that returns one. */
|
|
7
14
|
className?: StateValue<string | undefined, PopoverTitleState>;
|
|
15
|
+
/** Inline style, or a function of the part's state that returns one. */
|
|
8
16
|
style?: StateValue<CSSProperties | undefined, PopoverTitleState>;
|
|
17
|
+
/** Content, or a function of the part's state. */
|
|
9
18
|
children?: StateValue<ReactNode, PopoverTitleState>;
|
|
10
19
|
/** `render={<h3 />}` changes the heading level. */
|
|
11
20
|
render?: RenderProp<ComponentPropsWithRef<"h2">, PopoverTitleState>;
|
|
@@ -14,6 +23,8 @@ export interface PopoverTitleProps extends Omit<ComponentPropsWithRef<"h2">, "id
|
|
|
14
23
|
* The popover's name: an `<h2>` whose id the Popup references with `aria-labelledby`.
|
|
15
24
|
*
|
|
16
25
|
* Owned key (conventions 1.2): `id`.
|
|
26
|
+
*
|
|
27
|
+
* @see https://ui.funstack.work/components/popover
|
|
17
28
|
*/
|
|
18
29
|
export declare function PopoverTitle({ className, style, children, render, ...rest }: PopoverTitleProps): ReactNode;
|
|
19
30
|
export declare namespace PopoverTitle {
|
|
@@ -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"}
|
|
@@ -6,6 +6,8 @@ import { usePopoverContext, usePopoverPopupState } from "./popover-context.mjs";
|
|
|
6
6
|
* The popover's name: an `<h2>` whose id the Popup references with `aria-labelledby`.
|
|
7
7
|
*
|
|
8
8
|
* Owned key (conventions 1.2): `id`.
|
|
9
|
+
*
|
|
10
|
+
* @see https://ui.funstack.work/components/popover
|
|
9
11
|
*/
|
|
10
12
|
function PopoverTitle({ className, style, children, render, ...rest }) {
|
|
11
13
|
const ctx = usePopoverContext("Popover.Title");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-title.mjs","names":[],"sources":["../../src/popover/popover-title.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { usePopoverContext, usePopoverPopupState } from \"./popover-context.js\";\nimport type { PopoverPopupState } from \"./popover-popup.js\";\n\nexport type PopoverTitleState = PopoverPopupState;\n\nexport interface PopoverTitleProps extends Omit<\n ComponentPropsWithRef<\"h2\">,\n \"id\" | \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, PopoverTitleState>;\n style?: StateValue<CSSProperties | undefined, PopoverTitleState>;\n children?: StateValue<ReactNode, PopoverTitleState>;\n /** `render={<h3 />}` changes the heading level. */\n render?: RenderProp<ComponentPropsWithRef<\"h2\">, PopoverTitleState>;\n}\n\n/**\n * The popover's name: an `<h2>` whose id the Popup references with `aria-labelledby`.\n *\n * Owned key (conventions 1.2): `id`.\n */\nexport function PopoverTitle({ className, style, children, render, ...rest }: PopoverTitleProps) {\n const ctx = usePopoverContext(\"Popover.Title\");\n const state = usePopoverPopupState(ctx);\n return useRender<ComponentPropsWithRef<\"h2\">, PopoverTitleState>({\n defaultElement: \"h2\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: { id: ctx.ids.title },\n });\n}\n\nPopoverTitle.displayName = \"PopoverTitle\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-title.mjs","names":[],"sources":["../../src/popover/popover-title.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { usePopoverContext, usePopoverPopupState } from \"./popover-context.js\";\nimport type { PopoverPopupState } from \"./popover-popup.js\";\n\n/** State of `Popover.Title`: the Popup's state. */\nexport type PopoverTitleState = PopoverPopupState;\n\n/**\n * Props of `Popover.Title`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverTitleProps extends Omit<\n ComponentPropsWithRef<\"h2\">,\n \"id\" | \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, PopoverTitleState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, PopoverTitleState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, PopoverTitleState>;\n /** `render={<h3 />}` changes the heading level. */\n render?: RenderProp<ComponentPropsWithRef<\"h2\">, PopoverTitleState>;\n}\n\n/**\n * The popover's name: an `<h2>` whose id the Popup references with `aria-labelledby`.\n *\n * Owned key (conventions 1.2): `id`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverTitle({ className, style, children, render, ...rest }: PopoverTitleProps) {\n const ctx = usePopoverContext(\"Popover.Title\");\n const state = usePopoverPopupState(ctx);\n return useRender<ComponentPropsWithRef<\"h2\">, PopoverTitleState>({\n defaultElement: \"h2\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: { id: ctx.ids.title },\n });\n}\n\nPopoverTitle.displayName = \"PopoverTitle\";\n"],"mappings":";;;;;;;;;;;AAoCA,SAAgB,aAAa,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA2B;CAC/F,MAAM,MAAM,kBAAkB,eAAe;CAC7C,MAAM,QAAQ,qBAAqB,GAAG;CACtC,OAAO,UAA0D;EAC/D,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc,EAAE,IAAI,IAAI,IAAI,MAAM;CACpC,CAAC;AACH;AAEA,aAAa,cAAc"}
|
|
@@ -2,15 +2,28 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
|
|
|
2
2
|
import { PopoverTriggerHookState } from "../internal/use-popover-trigger.mjs";
|
|
3
3
|
import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
4
4
|
//#region src/popover/popover-trigger.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* State of `Popover.Trigger`, passed to the function forms of `className`, `style`, `children` and
|
|
7
|
+
* `render`.
|
|
8
|
+
*/
|
|
5
9
|
export type PopoverTriggerState = PopoverTriggerHookState;
|
|
10
|
+
/**
|
|
11
|
+
* Props of `Popover.Trigger`.
|
|
12
|
+
*
|
|
13
|
+
* @see https://ui.funstack.work/components/popover
|
|
14
|
+
*/
|
|
6
15
|
export interface PopoverTriggerProps extends Omit<ComponentPropsWithRef<"button">, "onClick" | "aria-expanded" | "commandfor" | "command" | "popoverTarget" | "popoverTargetAction" | "className" | "style" | "children"> {
|
|
7
16
|
/**
|
|
8
17
|
* Never dispatches. Native `disabled` on a `<button>` (no longer an invoker); in library mode
|
|
9
18
|
* with a link or component `render`, `aria-disabled="true"` instead: the element stays
|
|
10
19
|
* focusable.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue `false`
|
|
11
22
|
*/
|
|
12
23
|
disabled?: boolean;
|
|
24
|
+
/** Class name, or a function of the part's state that returns one. */
|
|
13
25
|
className?: StateValue<string | undefined, PopoverTriggerState>;
|
|
26
|
+
/** Inline style, or a function of the part's state that returns one. */
|
|
14
27
|
style?: StateValue<CSSProperties | undefined, PopoverTriggerState>;
|
|
15
28
|
/** Rendered from optimistic state; must not suspend. */
|
|
16
29
|
children?: StateValue<ReactNode, PopoverTriggerState>;
|
|
@@ -33,6 +46,8 @@ export interface PopoverTriggerProps extends Omit<ComponentPropsWithRef<"button"
|
|
|
33
46
|
* (library mode), `data-open`, `data-pending`, `data-disabled`; `commandfor`, `command` and
|
|
34
47
|
* `popoverTargetAction` (never written; omitted from the props type). `aria-haspopup` and
|
|
35
48
|
* `aria-controls` pass through.
|
|
49
|
+
*
|
|
50
|
+
* @see https://ui.funstack.work/components/popover
|
|
36
51
|
*/
|
|
37
52
|
export declare function PopoverTrigger({ disabled, className, style, children, render, ...rest }: PopoverTriggerProps): ReactNode;
|
|
38
53
|
export declare namespace PopoverTrigger {
|
|
@@ -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"}
|
|
@@ -16,6 +16,8 @@ import { usePopoverTrigger } from "../internal/use-popover-trigger.mjs";
|
|
|
16
16
|
* (library mode), `data-open`, `data-pending`, `data-disabled`; `commandfor`, `command` and
|
|
17
17
|
* `popoverTargetAction` (never written; omitted from the props type). `aria-haspopup` and
|
|
18
18
|
* `aria-controls` pass through.
|
|
19
|
+
*
|
|
20
|
+
* @see https://ui.funstack.work/components/popover
|
|
19
21
|
*/
|
|
20
22
|
function PopoverTrigger({ disabled = false, className, style, children, render, ...rest }) {
|
|
21
23
|
const ctx = usePopoverContext("Popover.Trigger");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-trigger.mjs","names":[],"sources":["../../src/popover/popover-trigger.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { usePopoverTrigger } from \"../internal/use-popover-trigger.js\";\nimport type { PopoverTriggerHookState } from \"../internal/use-popover-trigger.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { usePopoverContext } from \"./popover-context.js\";\n\nexport type PopoverTriggerState = PopoverTriggerHookState;\n\nexport interface PopoverTriggerProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n | \"onClick\"\n | \"aria-expanded\"\n | \"commandfor\"\n | \"command\"\n | \"popoverTarget\"\n | \"popoverTargetAction\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * Never dispatches. Native `disabled` on a `<button>` (no longer an invoker); in library mode\n * with a link or component `render`, `aria-disabled=\"true\"` instead: the element stays\n * focusable.\n */\n disabled?: boolean;\n className?: StateValue<string | undefined, PopoverTriggerState>;\n style?: StateValue<CSSProperties | undefined, PopoverTriggerState>;\n /** Rendered from optimistic state; must not suspend. */\n children?: StateValue<ReactNode, PopoverTriggerState>;\n /**\n * Should render a `<button>`; another element works only in library mode (click handler), and\n * a press on it while the popup is open is a light dismiss rather than the awaited close.\n */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, PopoverTriggerState>;\n}\n\n/**\n * The toggle: `<button type=\"button\" popovertarget>`, with no `aria-expanded`: the browser exposes\n * the popover's state on its invoker. In JS-free mode the browser toggles the popover and the\n * Popup keeps `data-open` current. In library mode the click is cancelled (so the toggle does not\n * run) and dispatched through the Root's transition: an open, or a library-owned close while open.\n * The button shows optimistic `data-open` and `data-pending` until the change has landed; a\n * non-button `render` renders `aria-expanded` from the shown popup (in the top layer).\n *\n * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `aria-disabled`\n * (library mode, link or component `render`), `popoverTarget`, `aria-expanded`, `onClick`\n * (library mode), `data-open`, `data-pending`, `data-disabled`; `commandfor`, `command` and\n * `popoverTargetAction` (never written; omitted from the props type). `aria-haspopup` and\n * `aria-controls` pass through.\n */\nexport function PopoverTrigger({\n disabled = false,\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverTriggerProps) {\n const ctx = usePopoverContext(\"Popover.Trigger\");\n const { state, libraryProps, ref } = usePopoverTrigger(ctx, {\n part: \"Popover.Trigger\",\n disabled,\n render,\n });\n\n return useRender<ComponentPropsWithRef<\"button\">, PopoverTriggerState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps,\n ref,\n });\n}\n\nPopoverTrigger.displayName = \"PopoverTrigger\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-trigger.mjs","names":[],"sources":["../../src/popover/popover-trigger.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { usePopoverTrigger } from \"../internal/use-popover-trigger.js\";\nimport type { PopoverTriggerHookState } from \"../internal/use-popover-trigger.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { usePopoverContext } from \"./popover-context.js\";\n\n/**\n * State of `Popover.Trigger`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport type PopoverTriggerState = PopoverTriggerHookState;\n\n/**\n * Props of `Popover.Trigger`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverTriggerProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n | \"onClick\"\n | \"aria-expanded\"\n | \"commandfor\"\n | \"command\"\n | \"popoverTarget\"\n | \"popoverTargetAction\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * Never dispatches. Native `disabled` on a `<button>` (no longer an invoker); in library mode\n * with a link or component `render`, `aria-disabled=\"true\"` instead: the element stays\n * 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, PopoverTriggerState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, PopoverTriggerState>;\n /** Rendered from optimistic state; must not suspend. */\n children?: StateValue<ReactNode, PopoverTriggerState>;\n /**\n * Should render a `<button>`; another element works only in library mode (click handler), and\n * a press on it while the popup is open is a light dismiss rather than the awaited close.\n */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, PopoverTriggerState>;\n}\n\n/**\n * The toggle: `<button type=\"button\" popovertarget>`, with no `aria-expanded`: the browser exposes\n * the popover's state on its invoker. In JS-free mode the browser toggles the popover and the\n * Popup keeps `data-open` current. In library mode the click is cancelled (so the toggle does not\n * run) and dispatched through the Root's transition: an open, or a library-owned close while open.\n * The button shows optimistic `data-open` and `data-pending` until the change has landed; a\n * non-button `render` renders `aria-expanded` from the shown popup (in the top layer).\n *\n * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `aria-disabled`\n * (library mode, link or component `render`), `popoverTarget`, `aria-expanded`, `onClick`\n * (library mode), `data-open`, `data-pending`, `data-disabled`; `commandfor`, `command` and\n * `popoverTargetAction` (never written; omitted from the props type). `aria-haspopup` and\n * `aria-controls` pass through.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverTrigger({\n disabled = false,\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverTriggerProps) {\n const ctx = usePopoverContext(\"Popover.Trigger\");\n const { state, libraryProps, ref } = usePopoverTrigger(ctx, {\n part: \"Popover.Trigger\",\n disabled,\n render,\n });\n\n return useRender<ComponentPropsWithRef<\"button\">, PopoverTriggerState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps,\n ref,\n });\n}\n\nPopoverTrigger.displayName = \"PopoverTrigger\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoEA,SAAgB,eAAe,EAC7B,WAAW,OACX,WACA,OACA,UACA,QACA,GAAG,QACmB;CACtB,MAAM,MAAM,kBAAkB,iBAAiB;CAC/C,MAAM,EAAE,OAAO,cAAc,QAAQ,kBAAkB,KAAK;EAC1D,MAAM;EACN;EACA;CACF,CAAC;CAED,OAAO,UAAgE;EACrE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;EACA;CACF,CAAC;AACH;AAEA,eAAe,cAAc"}
|
|
@@ -11,6 +11,8 @@ import { ProgressValue, ProgressValueProps } from "./progress-value.mjs";
|
|
|
11
11
|
* (the fill, sized by your CSS from `--progress-value`), `Label` and `Value`. Output-only: no
|
|
12
12
|
* actions and no pending state; a `value` of `null` (the default) is indeterminate. Write a value
|
|
13
13
|
* that reports on a pending action with a plain `setState`, never inside `startTransition`.
|
|
14
|
+
*
|
|
15
|
+
* @see https://ui.funstack.work/components/progress
|
|
14
16
|
*/
|
|
15
17
|
export declare const Progress: {
|
|
16
18
|
readonly Root: typeof ProgressRoot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/progress/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/progress/index.ts"],"mappings":";;;;;;;;;;;;;;;;qBAkBa;WACX,aAAI;WACJ,cAAK;WACL,kBAAS;WACT,cAAK;WACL,cAAK"}
|
package/dist/progress/index.mjs
CHANGED
|
@@ -10,6 +10,8 @@ import { ProgressValue } from "./progress-value.mjs";
|
|
|
10
10
|
* (the fill, sized by your CSS from `--progress-value`), `Label` and `Value`. Output-only: no
|
|
11
11
|
* actions and no pending state; a `value` of `null` (the default) is indeterminate. Write a value
|
|
12
12
|
* that reports on a pending action with a plain `setState`, never inside `startTransition`.
|
|
13
|
+
*
|
|
14
|
+
* @see https://ui.funstack.work/components/progress
|
|
13
15
|
*/
|
|
14
16
|
const Progress = {
|
|
15
17
|
Root: ProgressRoot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/progress/index.ts"],"sourcesContent":["// Ships the platform attribute typings with this subpath (conventions 7.4). Type-only: the\n// built JS has no import of it.\nimport \"../internal/platform-attributes.js\";\nimport { ProgressIndicator } from \"./progress-indicator.js\";\nimport { ProgressLabel } from \"./progress-label.js\";\nimport { ProgressRoot } from \"./progress-root.js\";\nimport { ProgressTrack } from \"./progress-track.js\";\nimport { ProgressValue } from \"./progress-value.js\";\n\n/**\n * Progress (WAI-ARIA `progressbar`): `Root` (`div[role=progressbar]`, directive-free, so a\n * Server Component may render it and it runs on the server), `Track` (the rail), `Indicator`\n * (the fill, sized by your CSS from `--progress-value`), `Label` and `Value`. Output-only: no\n * actions and no pending state; a `value` of `null` (the default) is indeterminate. Write a value\n * that reports on a pending action with a plain `setState`, never inside `startTransition`.\n */\nexport const Progress = {\n Root: ProgressRoot,\n Track: ProgressTrack,\n Indicator: ProgressIndicator,\n Label: ProgressLabel,\n Value: ProgressValue,\n} as const;\n\nexport type { ProgressRootProps, ProgressState } from \"./progress-root.js\";\nexport type { ProgressTrackProps } from \"./progress-track.js\";\nexport type { ProgressIndicatorProps } from \"./progress-indicator.js\";\nexport type { ProgressLabelProps } from \"./progress-label.js\";\nexport type { ProgressValueProps } from \"./progress-value.js\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/progress/index.ts"],"sourcesContent":["// Ships the platform attribute typings with this subpath (conventions 7.4). Type-only: the\n// built JS has no import of it.\nimport \"../internal/platform-attributes.js\";\nimport { ProgressIndicator } from \"./progress-indicator.js\";\nimport { ProgressLabel } from \"./progress-label.js\";\nimport { ProgressRoot } from \"./progress-root.js\";\nimport { ProgressTrack } from \"./progress-track.js\";\nimport { ProgressValue } from \"./progress-value.js\";\n\n/**\n * Progress (WAI-ARIA `progressbar`): `Root` (`div[role=progressbar]`, directive-free, so a\n * Server Component may render it and it runs on the server), `Track` (the rail), `Indicator`\n * (the fill, sized by your CSS from `--progress-value`), `Label` and `Value`. Output-only: no\n * actions and no pending state; a `value` of `null` (the default) is indeterminate. Write a value\n * that reports on a pending action with a plain `setState`, never inside `startTransition`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport const Progress = {\n Root: ProgressRoot,\n Track: ProgressTrack,\n Indicator: ProgressIndicator,\n Label: ProgressLabel,\n Value: ProgressValue,\n} as const;\n\nexport type { ProgressRootProps, ProgressState } from \"./progress-root.js\";\nexport type { ProgressTrackProps } from \"./progress-track.js\";\nexport type { ProgressIndicatorProps } from \"./progress-indicator.js\";\nexport type { ProgressLabelProps } from \"./progress-label.js\";\nexport type { ProgressValueProps } from \"./progress-value.js\";\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAa,WAAW;CACtB,MAAM;CACN,OAAO;CACP,WAAW;CACX,OAAO;CACP,OAAO;AACT"}
|