@wordpress/ui 0.12.0 → 0.13.1-next.v.202605131006.0
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/CHANGELOG.md +35 -0
- package/CONTRIBUTING.md +34 -0
- package/build/alert-dialog/popup.cjs +92 -22
- package/build/alert-dialog/popup.cjs.map +3 -3
- package/build/badge/badge.cjs +84 -5
- package/build/badge/badge.cjs.map +3 -3
- package/build/button/button.cjs +90 -20
- package/build/button/button.cjs.map +3 -3
- package/build/button/icon.cjs.map +2 -2
- package/build/button/index.cjs +1 -0
- package/build/button/index.cjs.map +3 -3
- package/build/button/types.cjs.map +1 -1
- package/build/card/content.cjs +84 -5
- package/build/card/content.cjs.map +3 -3
- package/build/card/full-bleed.cjs +84 -5
- package/build/card/full-bleed.cjs.map +3 -3
- package/build/card/header.cjs +84 -5
- package/build/card/header.cjs.map +3 -3
- package/build/card/root.cjs +86 -10
- package/build/card/root.cjs.map +3 -3
- package/build/collapsible-card/content.cjs +85 -6
- package/build/collapsible-card/content.cjs.map +3 -3
- package/build/collapsible-card/header.cjs +131 -52
- package/build/collapsible-card/header.cjs.map +3 -3
- package/build/dialog/content.cjs +86 -10
- package/build/dialog/content.cjs.map +3 -3
- package/build/dialog/description.cjs +84 -5
- package/build/dialog/description.cjs.map +3 -3
- package/build/dialog/footer.cjs +84 -5
- package/build/dialog/footer.cjs.map +3 -3
- package/build/dialog/header.cjs +84 -5
- package/build/dialog/header.cjs.map +3 -3
- package/build/dialog/popup.cjs +86 -7
- package/build/dialog/popup.cjs.map +3 -3
- package/build/dialog/title.cjs +84 -5
- package/build/dialog/title.cjs.map +3 -3
- package/build/drawer/content.cjs +103 -19
- package/build/drawer/content.cjs.map +4 -4
- package/build/drawer/footer.cjs +84 -5
- package/build/drawer/footer.cjs.map +3 -3
- package/build/drawer/header.cjs +84 -5
- package/build/drawer/header.cjs.map +3 -3
- package/build/drawer/popup.cjs +86 -7
- package/build/drawer/popup.cjs.map +3 -3
- package/build/drawer/title.cjs +84 -5
- package/build/drawer/title.cjs.map +3 -3
- package/build/drawer/types.cjs.map +1 -1
- package/build/empty-state/actions.cjs +84 -5
- package/build/empty-state/actions.cjs.map +3 -3
- package/build/empty-state/description.cjs +84 -5
- package/build/empty-state/description.cjs.map +3 -3
- package/build/empty-state/icon.cjs +84 -5
- package/build/empty-state/icon.cjs.map +3 -3
- package/build/empty-state/root.cjs +84 -5
- package/build/empty-state/root.cjs.map +3 -3
- package/build/empty-state/title.cjs +84 -5
- package/build/empty-state/title.cjs.map +3 -3
- package/build/empty-state/visual.cjs +84 -5
- package/build/empty-state/visual.cjs.map +3 -3
- package/build/form/index.cjs +3 -1
- package/build/form/index.cjs.map +2 -2
- package/build/form/primitives/autocomplete/empty.cjs +84 -5
- package/build/form/primitives/autocomplete/empty.cjs.map +3 -3
- package/build/form/primitives/autocomplete/item.cjs +86 -10
- package/build/form/primitives/autocomplete/item.cjs.map +3 -3
- package/build/form/primitives/autocomplete/list-body.cjs +84 -5
- package/build/form/primitives/autocomplete/list-body.cjs.map +3 -3
- package/build/form/primitives/autocomplete/list.cjs +84 -5
- package/build/form/primitives/autocomplete/list.cjs.map +3 -3
- package/build/form/primitives/autocomplete/popup.cjs +90 -17
- package/build/form/primitives/autocomplete/popup.cjs.map +3 -3
- package/build/form/primitives/field/description.cjs +86 -10
- package/build/form/primitives/field/description.cjs.map +3 -3
- package/build/form/primitives/field/details.cjs +84 -5
- package/build/form/primitives/field/details.cjs.map +3 -3
- package/build/form/primitives/field/label.cjs +84 -5
- package/build/form/primitives/field/label.cjs.map +3 -3
- package/build/form/primitives/field/root.cjs +84 -5
- package/build/form/primitives/field/root.cjs.map +3 -3
- package/build/form/primitives/fieldset/description.cjs +86 -10
- package/build/form/primitives/fieldset/description.cjs.map +3 -3
- package/build/form/primitives/fieldset/details.cjs +84 -5
- package/build/form/primitives/fieldset/details.cjs.map +3 -3
- package/build/form/primitives/fieldset/legend.cjs +84 -5
- package/build/form/primitives/fieldset/legend.cjs.map +3 -3
- package/build/form/primitives/fieldset/root.cjs +84 -5
- package/build/form/primitives/fieldset/root.cjs.map +3 -3
- package/build/form/primitives/input/input.cjs +88 -15
- package/build/form/primitives/input/input.cjs.map +3 -3
- package/build/form/primitives/input-layout/input-layout.cjs +88 -15
- package/build/form/primitives/input-layout/input-layout.cjs.map +3 -3
- package/build/form/primitives/input-layout/slot.cjs +84 -5
- package/build/form/primitives/input-layout/slot.cjs.map +3 -3
- package/build/form/primitives/select/item.cjs +87 -11
- package/build/form/primitives/select/item.cjs.map +3 -3
- package/build/form/primitives/select/popup.cjs +90 -17
- package/build/form/primitives/select/popup.cjs.map +3 -3
- package/build/form/primitives/select/root.cjs.map +2 -2
- package/build/form/primitives/select/trigger.cjs +98 -16
- package/build/form/primitives/select/trigger.cjs.map +3 -3
- package/build/form/primitives/select/types.cjs.map +1 -1
- package/build/form/primitives/textarea/textarea.cjs +86 -10
- package/build/form/primitives/textarea/textarea.cjs.map +3 -3
- package/build/form/select-control/context.cjs +37 -0
- package/build/form/select-control/context.cjs.map +7 -0
- package/build/form/select-control/index.cjs +39 -0
- package/build/form/select-control/index.cjs.map +7 -0
- package/build/form/select-control/item.cjs +41 -0
- package/build/form/select-control/item.cjs.map +7 -0
- package/build/form/select-control/select-control.cjs +75 -0
- package/build/form/select-control/select-control.cjs.map +7 -0
- package/build/form/select-control/types.cjs +19 -0
- package/build/form/select-control/types.cjs.map +7 -0
- package/build/form/types.cjs.map +1 -1
- package/build/icon-button/icon-button.cjs +86 -6
- package/build/icon-button/icon-button.cjs.map +3 -3
- package/build/icon-button/types.cjs.map +1 -1
- package/build/link/link.cjs +90 -20
- package/build/link/link.cjs.map +3 -3
- package/build/notice/action-button.cjs +84 -5
- package/build/notice/action-button.cjs.map +3 -3
- package/build/notice/action-link.cjs +84 -5
- package/build/notice/action-link.cjs.map +3 -3
- package/build/notice/actions.cjs +84 -5
- package/build/notice/actions.cjs.map +3 -3
- package/build/notice/close-icon.cjs +84 -5
- package/build/notice/close-icon.cjs.map +3 -3
- package/build/notice/description.cjs +84 -5
- package/build/notice/description.cjs.map +3 -3
- package/build/notice/root.cjs +86 -10
- package/build/notice/root.cjs.map +3 -3
- package/build/notice/title.cjs +84 -5
- package/build/notice/title.cjs.map +3 -3
- package/build/popover/arrow.cjs +84 -5
- package/build/popover/arrow.cjs.map +3 -3
- package/build/popover/popup.cjs +88 -12
- package/build/popover/popup.cjs.map +3 -3
- package/build/popover/title.cjs +84 -5
- package/build/popover/title.cjs.map +3 -3
- package/build/stack/stack.cjs +84 -5
- package/build/stack/stack.cjs.map +3 -3
- package/build/tabs/list.cjs +84 -5
- package/build/tabs/list.cjs.map +3 -3
- package/build/tabs/panel.cjs +86 -10
- package/build/tabs/panel.cjs.map +3 -3
- package/build/tabs/tab.cjs +84 -5
- package/build/tabs/tab.cjs.map +3 -3
- package/build/text/text.cjs +86 -10
- package/build/text/text.cjs.map +3 -3
- package/build/tooltip/index.cjs +3 -0
- package/build/tooltip/index.cjs.map +2 -2
- package/build/tooltip/popup.cjs +111 -40
- package/build/tooltip/popup.cjs.map +3 -3
- package/build/tooltip/positioner.cjs +159 -0
- package/build/tooltip/positioner.cjs.map +7 -0
- package/build/tooltip/types.cjs.map +1 -1
- package/build/utils/{render-portal-with-children.cjs → render-slot-with-children.cjs} +9 -12
- package/build/utils/render-slot-with-children.cjs.map +7 -0
- package/build/visually-hidden/visually-hidden.cjs +84 -5
- package/build/visually-hidden/visually-hidden.cjs.map +3 -3
- package/build-module/alert-dialog/popup.mjs +92 -22
- package/build-module/alert-dialog/popup.mjs.map +3 -3
- package/build-module/badge/badge.mjs +84 -5
- package/build-module/badge/badge.mjs.map +3 -3
- package/build-module/button/button.mjs +90 -20
- package/build-module/button/button.mjs.map +3 -3
- package/build-module/button/icon.mjs.map +2 -2
- package/build-module/button/index.mjs +3 -2
- package/build-module/button/index.mjs.map +2 -2
- package/build-module/card/content.mjs +84 -5
- package/build-module/card/content.mjs.map +3 -3
- package/build-module/card/full-bleed.mjs +84 -5
- package/build-module/card/full-bleed.mjs.map +3 -3
- package/build-module/card/header.mjs +84 -5
- package/build-module/card/header.mjs.map +3 -3
- package/build-module/card/root.mjs +86 -10
- package/build-module/card/root.mjs.map +3 -3
- package/build-module/collapsible-card/content.mjs +85 -6
- package/build-module/collapsible-card/content.mjs.map +3 -3
- package/build-module/collapsible-card/header.mjs +131 -52
- package/build-module/collapsible-card/header.mjs.map +3 -3
- package/build-module/dialog/content.mjs +86 -10
- package/build-module/dialog/content.mjs.map +3 -3
- package/build-module/dialog/description.mjs +84 -5
- package/build-module/dialog/description.mjs.map +3 -3
- package/build-module/dialog/footer.mjs +84 -5
- package/build-module/dialog/footer.mjs.map +3 -3
- package/build-module/dialog/header.mjs +84 -5
- package/build-module/dialog/header.mjs.map +3 -3
- package/build-module/dialog/popup.mjs +86 -7
- package/build-module/dialog/popup.mjs.map +3 -3
- package/build-module/dialog/title.mjs +84 -5
- package/build-module/dialog/title.mjs.map +3 -3
- package/build-module/drawer/content.mjs +103 -19
- package/build-module/drawer/content.mjs.map +3 -3
- package/build-module/drawer/footer.mjs +84 -5
- package/build-module/drawer/footer.mjs.map +3 -3
- package/build-module/drawer/header.mjs +84 -5
- package/build-module/drawer/header.mjs.map +3 -3
- package/build-module/drawer/popup.mjs +86 -7
- package/build-module/drawer/popup.mjs.map +3 -3
- package/build-module/drawer/title.mjs +84 -5
- package/build-module/drawer/title.mjs.map +3 -3
- package/build-module/empty-state/actions.mjs +84 -5
- package/build-module/empty-state/actions.mjs.map +3 -3
- package/build-module/empty-state/description.mjs +84 -5
- package/build-module/empty-state/description.mjs.map +3 -3
- package/build-module/empty-state/icon.mjs +84 -5
- package/build-module/empty-state/icon.mjs.map +3 -3
- package/build-module/empty-state/root.mjs +84 -5
- package/build-module/empty-state/root.mjs.map +3 -3
- package/build-module/empty-state/title.mjs +84 -5
- package/build-module/empty-state/title.mjs.map +3 -3
- package/build-module/empty-state/visual.mjs +84 -5
- package/build-module/empty-state/visual.mjs.map +3 -3
- package/build-module/form/index.mjs +1 -0
- package/build-module/form/index.mjs.map +2 -2
- package/build-module/form/primitives/autocomplete/empty.mjs +84 -5
- package/build-module/form/primitives/autocomplete/empty.mjs.map +3 -3
- package/build-module/form/primitives/autocomplete/item.mjs +86 -10
- package/build-module/form/primitives/autocomplete/item.mjs.map +3 -3
- package/build-module/form/primitives/autocomplete/list-body.mjs +84 -5
- package/build-module/form/primitives/autocomplete/list-body.mjs.map +3 -3
- package/build-module/form/primitives/autocomplete/list.mjs +84 -5
- package/build-module/form/primitives/autocomplete/list.mjs.map +3 -3
- package/build-module/form/primitives/autocomplete/popup.mjs +90 -17
- package/build-module/form/primitives/autocomplete/popup.mjs.map +3 -3
- package/build-module/form/primitives/field/description.mjs +86 -10
- package/build-module/form/primitives/field/description.mjs.map +3 -3
- package/build-module/form/primitives/field/details.mjs +84 -5
- package/build-module/form/primitives/field/details.mjs.map +3 -3
- package/build-module/form/primitives/field/label.mjs +84 -5
- package/build-module/form/primitives/field/label.mjs.map +3 -3
- package/build-module/form/primitives/field/root.mjs +84 -5
- package/build-module/form/primitives/field/root.mjs.map +3 -3
- package/build-module/form/primitives/fieldset/description.mjs +86 -10
- package/build-module/form/primitives/fieldset/description.mjs.map +3 -3
- package/build-module/form/primitives/fieldset/details.mjs +84 -5
- package/build-module/form/primitives/fieldset/details.mjs.map +3 -3
- package/build-module/form/primitives/fieldset/legend.mjs +84 -5
- package/build-module/form/primitives/fieldset/legend.mjs.map +3 -3
- package/build-module/form/primitives/fieldset/root.mjs +84 -5
- package/build-module/form/primitives/fieldset/root.mjs.map +3 -3
- package/build-module/form/primitives/input/input.mjs +88 -15
- package/build-module/form/primitives/input/input.mjs.map +3 -3
- package/build-module/form/primitives/input-layout/input-layout.mjs +88 -15
- package/build-module/form/primitives/input-layout/input-layout.mjs.map +3 -3
- package/build-module/form/primitives/input-layout/slot.mjs +84 -5
- package/build-module/form/primitives/input-layout/slot.mjs.map +3 -3
- package/build-module/form/primitives/select/item.mjs +87 -11
- package/build-module/form/primitives/select/item.mjs.map +3 -3
- package/build-module/form/primitives/select/popup.mjs +90 -17
- package/build-module/form/primitives/select/popup.mjs.map +3 -3
- package/build-module/form/primitives/select/root.mjs.map +2 -2
- package/build-module/form/primitives/select/trigger.mjs +98 -16
- package/build-module/form/primitives/select/trigger.mjs.map +3 -3
- package/build-module/form/primitives/textarea/textarea.mjs +86 -10
- package/build-module/form/primitives/textarea/textarea.mjs.map +3 -3
- package/build-module/form/select-control/context.mjs +11 -0
- package/build-module/form/select-control/context.mjs.map +7 -0
- package/build-module/form/select-control/index.mjs +14 -0
- package/build-module/form/select-control/index.mjs.map +7 -0
- package/build-module/form/select-control/item.mjs +16 -0
- package/build-module/form/select-control/item.mjs.map +7 -0
- package/build-module/form/select-control/select-control.mjs +50 -0
- package/build-module/form/select-control/select-control.mjs.map +7 -0
- package/build-module/form/select-control/types.mjs +1 -0
- package/build-module/form/select-control/types.mjs.map +7 -0
- package/build-module/icon-button/icon-button.mjs +86 -6
- package/build-module/icon-button/icon-button.mjs.map +3 -3
- package/build-module/link/link.mjs +90 -20
- package/build-module/link/link.mjs.map +3 -3
- package/build-module/notice/action-button.mjs +84 -5
- package/build-module/notice/action-button.mjs.map +3 -3
- package/build-module/notice/action-link.mjs +84 -5
- package/build-module/notice/action-link.mjs.map +3 -3
- package/build-module/notice/actions.mjs +84 -5
- package/build-module/notice/actions.mjs.map +3 -3
- package/build-module/notice/close-icon.mjs +84 -5
- package/build-module/notice/close-icon.mjs.map +3 -3
- package/build-module/notice/description.mjs +84 -5
- package/build-module/notice/description.mjs.map +3 -3
- package/build-module/notice/root.mjs +86 -10
- package/build-module/notice/root.mjs.map +3 -3
- package/build-module/notice/title.mjs +84 -5
- package/build-module/notice/title.mjs.map +3 -3
- package/build-module/popover/arrow.mjs +84 -5
- package/build-module/popover/arrow.mjs.map +3 -3
- package/build-module/popover/popup.mjs +88 -12
- package/build-module/popover/popup.mjs.map +3 -3
- package/build-module/popover/title.mjs +84 -5
- package/build-module/popover/title.mjs.map +3 -3
- package/build-module/stack/stack.mjs +84 -5
- package/build-module/stack/stack.mjs.map +3 -3
- package/build-module/tabs/list.mjs +84 -5
- package/build-module/tabs/list.mjs.map +3 -3
- package/build-module/tabs/panel.mjs +86 -10
- package/build-module/tabs/panel.mjs.map +3 -3
- package/build-module/tabs/tab.mjs +84 -5
- package/build-module/tabs/tab.mjs.map +3 -3
- package/build-module/text/text.mjs +86 -10
- package/build-module/text/text.mjs.map +3 -3
- package/build-module/tooltip/index.mjs +2 -0
- package/build-module/tooltip/index.mjs.map +2 -2
- package/build-module/tooltip/popup.mjs +111 -40
- package/build-module/tooltip/popup.mjs.map +3 -3
- package/build-module/tooltip/positioner.mjs +124 -0
- package/build-module/tooltip/positioner.mjs.map +7 -0
- package/build-module/utils/render-slot-with-children.mjs +9 -0
- package/build-module/utils/render-slot-with-children.mjs.map +7 -0
- package/build-module/visually-hidden/visually-hidden.mjs +84 -5
- package/build-module/visually-hidden/visually-hidden.mjs.map +3 -3
- package/build-types/alert-dialog/portal.d.ts +1 -1
- package/build-types/alert-dialog/portal.d.ts.map +1 -1
- package/build-types/alert-dialog/root.d.ts +1 -1
- package/build-types/alert-dialog/root.d.ts.map +1 -1
- package/build-types/alert-dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/badge/stories/choosing-intent.story.d.ts.map +1 -1
- package/build-types/badge/stories/index.story.d.ts.map +1 -1
- package/build-types/button/button.d.ts +3 -0
- package/build-types/button/button.d.ts.map +1 -1
- package/build-types/button/icon.d.ts +1 -8
- package/build-types/button/icon.d.ts.map +1 -1
- package/build-types/button/index.d.ts +6 -5
- package/build-types/button/index.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/button/types.d.ts +7 -0
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/card/stories/index.story.d.ts.map +1 -1
- package/build-types/collapsible/panel.d.ts +1 -1
- package/build-types/collapsible/root.d.ts +1 -1
- package/build-types/collapsible/stories/index.story.d.ts.map +1 -1
- package/build-types/collapsible/trigger.d.ts +1 -1
- package/build-types/collapsible-card/header.d.ts +6 -0
- package/build-types/collapsible-card/header.d.ts.map +1 -1
- package/build-types/collapsible-card/stories/index.story.d.ts +8 -0
- package/build-types/collapsible-card/stories/index.story.d.ts.map +1 -1
- package/build-types/dialog/context.d.ts +2 -2
- package/build-types/dialog/popup.d.ts +1 -2
- package/build-types/dialog/popup.d.ts.map +1 -1
- package/build-types/dialog/portal.d.ts +1 -1
- package/build-types/dialog/portal.d.ts.map +1 -1
- package/build-types/dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/drawer/content.d.ts +7 -4
- package/build-types/drawer/content.d.ts.map +1 -1
- package/build-types/drawer/context.d.ts +2 -2
- package/build-types/drawer/popup.d.ts +1 -2
- package/build-types/drawer/popup.d.ts.map +1 -1
- package/build-types/drawer/stories/index.story.d.ts.map +1 -1
- package/build-types/drawer/types.d.ts +1 -1
- package/build-types/empty-state/stories/index.story.d.ts.map +1 -1
- package/build-types/form/index.d.ts +1 -0
- package/build-types/form/index.d.ts.map +1 -1
- package/build-types/form/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/autocomplete/clear.d.ts +1 -1
- package/build-types/form/primitives/autocomplete/empty.d.ts +1 -1
- package/build-types/form/primitives/autocomplete/input-group.d.ts +1 -1
- package/build-types/form/primitives/autocomplete/item.d.ts +1 -1
- package/build-types/form/primitives/autocomplete/list-body.d.ts +1 -1
- package/build-types/form/primitives/autocomplete/list.d.ts +2 -2
- package/build-types/form/primitives/autocomplete/popup.d.ts +2 -2
- package/build-types/form/primitives/autocomplete/portal.d.ts +1 -1
- package/build-types/form/primitives/autocomplete/portal.d.ts.map +1 -1
- package/build-types/form/primitives/autocomplete/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/field/control.d.ts +2 -2
- package/build-types/form/primitives/field/description.d.ts +1 -1
- package/build-types/form/primitives/field/details.d.ts +1 -1
- package/build-types/form/primitives/field/label.d.ts +3 -3
- package/build-types/form/primitives/field/root.d.ts +3 -3
- package/build-types/form/primitives/field/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/fieldset/description.d.ts +1 -1
- package/build-types/form/primitives/fieldset/details.d.ts +1 -1
- package/build-types/form/primitives/fieldset/legend.d.ts +1 -1
- package/build-types/form/primitives/fieldset/root.d.ts +1 -1
- package/build-types/form/primitives/fieldset/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/input/input.d.ts +5 -5
- package/build-types/form/primitives/input/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/input-layout/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/select/item.d.ts +3 -3
- package/build-types/form/primitives/select/popup.d.ts +2 -2
- package/build-types/form/primitives/select/root.d.ts +12 -1
- package/build-types/form/primitives/select/root.d.ts.map +1 -1
- package/build-types/form/primitives/select/stories/index.story.d.ts +9 -6
- package/build-types/form/primitives/select/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/select/trigger.d.ts +5 -4
- package/build-types/form/primitives/select/trigger.d.ts.map +1 -1
- package/build-types/form/primitives/select/types.d.ts +12 -4
- package/build-types/form/primitives/select/types.d.ts.map +1 -1
- package/build-types/form/primitives/textarea/stories/index.story.d.ts.map +1 -1
- package/build-types/form/primitives/textarea/textarea.d.ts +2 -2
- package/build-types/form/select-control/context.d.ts +3 -0
- package/build-types/form/select-control/context.d.ts.map +1 -0
- package/build-types/form/select-control/index.d.ts +20 -0
- package/build-types/form/select-control/index.d.ts.map +1 -0
- package/build-types/form/select-control/item.d.ts +6 -0
- package/build-types/form/select-control/item.d.ts.map +1 -0
- package/build-types/form/select-control/select-control.d.ts +11 -0
- package/build-types/form/select-control/select-control.d.ts.map +1 -0
- package/build-types/form/select-control/stories/index.story.d.ts +40 -0
- package/build-types/form/select-control/stories/index.story.d.ts.map +1 -0
- package/build-types/form/select-control/test/index.test.d.ts +2 -0
- package/build-types/form/select-control/test/index.test.d.ts.map +1 -0
- package/build-types/form/select-control/types.d.ts +40 -0
- package/build-types/form/select-control/types.d.ts.map +1 -0
- package/build-types/form/types.d.ts +1 -1
- package/build-types/form/types.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/icon-button/icon-button.d.ts +2 -1
- package/build-types/icon-button/icon-button.d.ts.map +1 -1
- package/build-types/icon-button/stories/index.story.d.ts +5 -0
- package/build-types/icon-button/stories/index.story.d.ts.map +1 -1
- package/build-types/icon-button/types.d.ts +8 -0
- package/build-types/icon-button/types.d.ts.map +1 -1
- package/build-types/link/stories/index.story.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/stack/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/context.d.ts +1 -1
- package/build-types/tabs/context.d.ts.map +1 -1
- package/build-types/tabs/list.d.ts +2 -2
- package/build-types/tabs/panel.d.ts +1 -1
- package/build-types/tabs/root.d.ts +1 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/tab.d.ts +1 -1
- package/build-types/text/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts +2 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tooltip/popup.d.ts.map +1 -1
- package/build-types/tooltip/positioner.d.ts +9 -0
- package/build-types/tooltip/positioner.d.ts.map +1 -0
- package/build-types/tooltip/stories/index.story.d.ts +11 -2
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/stories/usage-guidelines.story.d.ts.map +1 -1
- package/build-types/tooltip/types.d.ts +10 -1
- package/build-types/tooltip/types.d.ts.map +1 -1
- package/build-types/utils/create-overlay-modal-context.d.ts.map +1 -1
- package/build-types/utils/render-slot-with-children.d.ts +24 -0
- package/build-types/utils/render-slot-with-children.d.ts.map +1 -0
- package/build-types/utils/use-deprioritized-initial-focus.d.ts +1 -1
- package/build-types/utils/use-deprioritized-initial-focus.d.ts.map +1 -1
- package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
- package/package.json +13 -12
- package/src/alert-dialog/popup.tsx +2 -2
- package/src/alert-dialog/stories/index.story.tsx +8 -0
- package/src/badge/stories/index.story.tsx +6 -0
- package/src/button/button.tsx +3 -0
- package/src/button/icon.tsx +1 -8
- package/src/button/index.ts +5 -6
- package/src/button/stories/index.story.tsx +10 -0
- package/src/button/types.ts +8 -0
- package/src/card/stories/index.story.tsx +6 -0
- package/src/collapsible/stories/index.story.tsx +6 -0
- package/src/collapsible-card/header.tsx +55 -42
- package/src/collapsible-card/stories/index.story.tsx +61 -0
- package/src/collapsible-card/style.module.css +20 -0
- package/src/collapsible-card/test/index.test.tsx +60 -1
- package/src/dialog/popup.tsx +3 -4
- package/src/dialog/stories/index.story.tsx +8 -0
- package/src/dialog/style.module.css +3 -9
- package/src/drawer/content.tsx +31 -16
- package/src/drawer/popup.tsx +3 -4
- package/src/drawer/stories/index.story.tsx +7 -0
- package/src/drawer/style.module.css +41 -9
- package/src/drawer/test/index.test.tsx +56 -0
- package/src/drawer/types.ts +1 -1
- package/src/empty-state/stories/index.story.tsx +7 -0
- package/src/form/index.ts +1 -0
- package/src/form/input-control/stories/index.story.tsx +7 -0
- package/src/form/primitives/autocomplete/popup.tsx +2 -2
- package/src/form/primitives/autocomplete/stories/index.story.tsx +18 -10
- package/src/form/primitives/field/stories/index.story.tsx +12 -5
- package/src/form/primitives/fieldset/stories/index.story.tsx +10 -3
- package/src/form/primitives/input/stories/index.story.tsx +7 -0
- package/src/form/primitives/input-layout/stories/index.story.tsx +8 -1
- package/src/form/primitives/select/item.tsx +1 -1
- package/src/form/primitives/select/popup.tsx +2 -2
- package/src/form/primitives/select/root.tsx +13 -2
- package/src/form/primitives/select/stories/index.story.tsx +132 -61
- package/src/form/primitives/select/test/index.test.tsx +123 -5
- package/src/form/primitives/select/trigger.tsx +11 -8
- package/src/form/primitives/select/types.ts +13 -5
- package/src/form/primitives/textarea/stories/index.story.tsx +7 -0
- package/src/form/select-control/context.tsx +9 -0
- package/src/form/select-control/index.ts +14 -0
- package/src/form/select-control/item.tsx +13 -0
- package/src/form/select-control/select-control.tsx +65 -0
- package/src/form/select-control/stories/index.story.tsx +220 -0
- package/src/form/select-control/test/index.test.tsx +196 -0
- package/src/form/select-control/types.ts +50 -0
- package/src/form/types.ts +1 -1
- package/src/icon/stories/index.story.tsx +7 -0
- package/src/icon-button/icon-button.tsx +2 -1
- package/src/icon-button/stories/index.story.tsx +20 -0
- package/src/icon-button/types.ts +9 -0
- package/src/link/stories/index.story.tsx +6 -0
- package/src/link/style.module.css +1 -0
- package/src/notice/stories/index.story.tsx +7 -0
- package/src/popover/popup.tsx +2 -2
- package/src/popover/stories/index.story.tsx +7 -0
- package/src/stack/stories/index.story.tsx +6 -0
- package/src/tabs/stories/index.story.tsx +15 -1
- package/src/text/stories/index.story.tsx +6 -0
- package/src/text/style.module.css +25 -0
- package/src/tooltip/index.ts +2 -1
- package/src/tooltip/popup.tsx +30 -38
- package/src/tooltip/positioner.tsx +36 -0
- package/src/tooltip/stories/index.story.tsx +61 -10
- package/src/tooltip/stories/usage-guidelines.story.tsx +5 -0
- package/src/tooltip/types.ts +14 -3
- package/src/utils/css/dropdown-motion.module.css +3 -3
- package/src/utils/css/item-popup.module.css +5 -1
- package/src/utils/css/overlay-chrome.module.css +21 -4
- package/src/utils/css/select-trigger.module.css +5 -2
- package/src/utils/render-slot-with-children.ts +31 -0
- package/src/visually-hidden/stories/index.story.tsx +6 -0
- package/build/utils/render-portal-with-children.cjs.map +0 -7
- package/build-module/utils/render-portal-with-children.mjs +0 -12
- package/build-module/utils/render-portal-with-children.mjs.map +0 -7
- package/build-types/utils/render-portal-with-children.d.ts +0 -16
- package/build-types/utils/render-portal-with-children.d.ts.map +0 -1
- package/src/utils/render-portal-with-children.ts +0 -27
|
@@ -12,6 +12,13 @@ const meta: Meta< typeof Tabs.Root > = {
|
|
|
12
12
|
'Tabs.Tab': Tabs.Tab,
|
|
13
13
|
'Tabs.Panel': Tabs.Panel,
|
|
14
14
|
},
|
|
15
|
+
parameters: {
|
|
16
|
+
componentStatus: {
|
|
17
|
+
status: 'use-with-caution',
|
|
18
|
+
whereUsed: 'global',
|
|
19
|
+
notes: 'Not yet recommended for use alongside components from `@wordpress/components`, pending review of color consistency with `@wordpress/components`. See [WordPress/gutenberg#76135](https://github.com/WordPress/gutenberg/issues/76135).',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
15
22
|
};
|
|
16
23
|
export default meta;
|
|
17
24
|
|
|
@@ -281,7 +288,14 @@ export const WithTabIconsAndTooltips: StoryObj< typeof Tabs.Root > = {
|
|
|
281
288
|
} }
|
|
282
289
|
/>
|
|
283
290
|
</Tooltip.Trigger>
|
|
284
|
-
<Tooltip.Popup
|
|
291
|
+
<Tooltip.Popup
|
|
292
|
+
positioner={
|
|
293
|
+
<Tooltip.Positioner
|
|
294
|
+
align="center"
|
|
295
|
+
side="top"
|
|
296
|
+
/>
|
|
297
|
+
}
|
|
298
|
+
>
|
|
285
299
|
{ label }
|
|
286
300
|
</Tooltip.Popup>
|
|
287
301
|
</Tooltip.Root>
|
|
@@ -5,8 +5,13 @@
|
|
|
5
5
|
margin: 0;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
/* Text variants can render as either paragraphs or headings, so each variant
|
|
9
|
+
provides values for both element-specific CSS defenses. */
|
|
8
10
|
.heading-2xl {
|
|
9
11
|
--_gcd-heading-font-size: var(--wpds-typography-font-size-2xl);
|
|
12
|
+
--_gcd-heading-font-weight: var(--wpds-typography-font-weight-medium);
|
|
13
|
+
--_gcd-p-font-size: var(--wpds-typography-font-size-2xl);
|
|
14
|
+
--_gcd-p-line-height: var(--wpds-typography-line-height-2xl);
|
|
10
15
|
|
|
11
16
|
font-family: var(--wpds-typography-font-family-heading);
|
|
12
17
|
font-size: var(--wpds-typography-font-size-2xl);
|
|
@@ -16,6 +21,9 @@
|
|
|
16
21
|
|
|
17
22
|
.heading-xl {
|
|
18
23
|
--_gcd-heading-font-size: var(--wpds-typography-font-size-xl);
|
|
24
|
+
--_gcd-heading-font-weight: var(--wpds-typography-font-weight-medium);
|
|
25
|
+
--_gcd-p-font-size: var(--wpds-typography-font-size-xl);
|
|
26
|
+
--_gcd-p-line-height: var(--wpds-typography-line-height-md);
|
|
19
27
|
|
|
20
28
|
font-family: var(--wpds-typography-font-family-heading);
|
|
21
29
|
font-size: var(--wpds-typography-font-size-xl);
|
|
@@ -25,6 +33,9 @@
|
|
|
25
33
|
|
|
26
34
|
.heading-lg {
|
|
27
35
|
--_gcd-heading-font-size: var(--wpds-typography-font-size-lg);
|
|
36
|
+
--_gcd-heading-font-weight: var(--wpds-typography-font-weight-medium);
|
|
37
|
+
--_gcd-p-font-size: var(--wpds-typography-font-size-lg);
|
|
38
|
+
--_gcd-p-line-height: var(--wpds-typography-line-height-sm);
|
|
28
39
|
|
|
29
40
|
font-family: var(--wpds-typography-font-family-heading);
|
|
30
41
|
font-size: var(--wpds-typography-font-size-lg);
|
|
@@ -34,6 +45,9 @@
|
|
|
34
45
|
|
|
35
46
|
.heading-md {
|
|
36
47
|
--_gcd-heading-font-size: var(--wpds-typography-font-size-md);
|
|
48
|
+
--_gcd-heading-font-weight: var(--wpds-typography-font-weight-medium);
|
|
49
|
+
--_gcd-p-font-size: var(--wpds-typography-font-size-md);
|
|
50
|
+
--_gcd-p-line-height: var(--wpds-typography-line-height-sm);
|
|
37
51
|
|
|
38
52
|
font-family: var(--wpds-typography-font-family-heading);
|
|
39
53
|
font-size: var(--wpds-typography-font-size-md);
|
|
@@ -43,6 +57,9 @@
|
|
|
43
57
|
|
|
44
58
|
.heading-sm {
|
|
45
59
|
--_gcd-heading-font-size: var(--wpds-typography-font-size-xs);
|
|
60
|
+
--_gcd-heading-font-weight: var(--wpds-typography-font-weight-medium);
|
|
61
|
+
--_gcd-p-font-size: var(--wpds-typography-font-size-xs);
|
|
62
|
+
--_gcd-p-line-height: var(--wpds-typography-line-height-xs);
|
|
46
63
|
|
|
47
64
|
font-family: var(--wpds-typography-font-family-heading);
|
|
48
65
|
font-size: var(--wpds-typography-font-size-xs);
|
|
@@ -52,6 +69,8 @@
|
|
|
52
69
|
}
|
|
53
70
|
|
|
54
71
|
.body-xl {
|
|
72
|
+
--_gcd-heading-font-size: var(--wpds-typography-font-size-xl);
|
|
73
|
+
--_gcd-heading-font-weight: var(--wpds-typography-font-weight-regular);
|
|
55
74
|
--_gcd-p-font-size: var(--wpds-typography-font-size-xl);
|
|
56
75
|
--_gcd-p-line-height: var(--wpds-typography-line-height-xl);
|
|
57
76
|
|
|
@@ -62,6 +81,8 @@
|
|
|
62
81
|
}
|
|
63
82
|
|
|
64
83
|
.body-lg {
|
|
84
|
+
--_gcd-heading-font-size: var(--wpds-typography-font-size-lg);
|
|
85
|
+
--_gcd-heading-font-weight: var(--wpds-typography-font-weight-regular);
|
|
65
86
|
--_gcd-p-font-size: var(--wpds-typography-font-size-lg);
|
|
66
87
|
--_gcd-p-line-height: var(--wpds-typography-line-height-md);
|
|
67
88
|
|
|
@@ -72,6 +93,8 @@
|
|
|
72
93
|
}
|
|
73
94
|
|
|
74
95
|
.body-md {
|
|
96
|
+
--_gcd-heading-font-size: var(--wpds-typography-font-size-md);
|
|
97
|
+
--_gcd-heading-font-weight: var(--wpds-typography-font-weight-regular);
|
|
75
98
|
--_gcd-p-font-size: var(--wpds-typography-font-size-md);
|
|
76
99
|
--_gcd-p-line-height: var(--wpds-typography-line-height-sm);
|
|
77
100
|
|
|
@@ -82,6 +105,8 @@
|
|
|
82
105
|
}
|
|
83
106
|
|
|
84
107
|
.body-sm {
|
|
108
|
+
--_gcd-heading-font-size: var(--wpds-typography-font-size-sm);
|
|
109
|
+
--_gcd-heading-font-weight: var(--wpds-typography-font-weight-regular);
|
|
85
110
|
--_gcd-p-font-size: var(--wpds-typography-font-size-sm);
|
|
86
111
|
--_gcd-p-line-height: var(--wpds-typography-line-height-xs);
|
|
87
112
|
|
package/src/tooltip/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Popup } from './popup';
|
|
2
2
|
import { Portal } from './portal';
|
|
3
|
+
import { Positioner } from './positioner';
|
|
3
4
|
import { Trigger } from './trigger';
|
|
4
5
|
import { Root } from './root';
|
|
5
6
|
import { Provider } from './provider';
|
|
6
7
|
|
|
7
|
-
export { Provider, Root, Trigger, Popup, Portal };
|
|
8
|
+
export { Provider, Root, Trigger, Popup, Portal, Positioner };
|
package/src/tooltip/popup.tsx
CHANGED
|
@@ -8,54 +8,46 @@ import {
|
|
|
8
8
|
import type { PopupProps } from './types';
|
|
9
9
|
import { unlock } from '../lock-unlock';
|
|
10
10
|
import { Portal } from './portal';
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
11
|
+
import { Positioner } from './positioner';
|
|
12
|
+
import { renderSlotWithChildren } from '../utils/render-slot-with-children';
|
|
13
13
|
import styles from './style.module.css';
|
|
14
14
|
|
|
15
15
|
const ThemeProvider: typeof ThemeProviderType =
|
|
16
16
|
unlock( themePrivateApis ).ThemeProvider;
|
|
17
17
|
|
|
18
18
|
const Popup = forwardRef< HTMLDivElement, PopupProps >( function TooltipPopup(
|
|
19
|
-
{
|
|
20
|
-
align = 'center',
|
|
21
|
-
portal,
|
|
22
|
-
side = 'top',
|
|
23
|
-
sideOffset = 4,
|
|
24
|
-
children,
|
|
25
|
-
className,
|
|
26
|
-
...props
|
|
27
|
-
},
|
|
19
|
+
{ portal, positioner, children, className, ...props },
|
|
28
20
|
ref
|
|
29
21
|
) {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
{ ...props }
|
|
51
|
-
>
|
|
52
|
-
{ children }
|
|
53
|
-
</_Tooltip.Popup>
|
|
54
|
-
</ThemeProvider>
|
|
55
|
-
</_Tooltip.Positioner>
|
|
22
|
+
const popupContent = (
|
|
23
|
+
/* This should ideally use whatever dark color makes sense,
|
|
24
|
+
* and not be hardcoded to #1e1e1e. The solutions would be to:
|
|
25
|
+
* - review the design of the tooltip, in case we want to stop
|
|
26
|
+
* hardcoding it to a dark background
|
|
27
|
+
* - create new semantic tokens as needed (aliasing either the
|
|
28
|
+
* "inverted bg" or "perma-dark bg" private tokens) and have
|
|
29
|
+
* Tooltip.Popup use them;
|
|
30
|
+
* - remove the hardcoded `bg` setting from the `ThemeProvider`
|
|
31
|
+
* below
|
|
32
|
+
*/
|
|
33
|
+
<ThemeProvider color={ { bg: '#1e1e1e' } }>
|
|
34
|
+
<_Tooltip.Popup
|
|
35
|
+
ref={ ref }
|
|
36
|
+
className={ clsx( styles.popup, className ) }
|
|
37
|
+
{ ...props }
|
|
38
|
+
>
|
|
39
|
+
{ children }
|
|
40
|
+
</_Tooltip.Popup>
|
|
41
|
+
</ThemeProvider>
|
|
56
42
|
);
|
|
57
43
|
|
|
58
|
-
|
|
44
|
+
const positionedPopup = renderSlotWithChildren(
|
|
45
|
+
positioner,
|
|
46
|
+
<Positioner />,
|
|
47
|
+
popupContent
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return renderSlotWithChildren( portal, <Portal />, positionedPopup );
|
|
59
51
|
} );
|
|
60
52
|
|
|
61
53
|
export { Popup };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { Tooltip as _Tooltip } from '@base-ui/react/tooltip';
|
|
3
|
+
import { forwardRef } from '@wordpress/element';
|
|
4
|
+
import type { PositionerProps } from './types';
|
|
5
|
+
import resetStyles from '../utils/css/resets.module.css';
|
|
6
|
+
import styles from './style.module.css';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Positions the floating tooltip content relative to the trigger. Pass to
|
|
10
|
+
* `Tooltip.Popup`'s `positioner` prop to customize `side`, `align`,
|
|
11
|
+
* `sideOffset`, collision behavior, etc. When `positioner` is omitted,
|
|
12
|
+
* `Tooltip.Popup` uses this component with default props.
|
|
13
|
+
*/
|
|
14
|
+
const Positioner = forwardRef< HTMLDivElement, PositionerProps >(
|
|
15
|
+
function TooltipPositioner(
|
|
16
|
+
{ align = 'center', className, side = 'top', sideOffset = 4, ...props },
|
|
17
|
+
ref
|
|
18
|
+
) {
|
|
19
|
+
return (
|
|
20
|
+
<_Tooltip.Positioner
|
|
21
|
+
ref={ ref }
|
|
22
|
+
align={ align }
|
|
23
|
+
side={ side }
|
|
24
|
+
sideOffset={ sideOffset }
|
|
25
|
+
{ ...props }
|
|
26
|
+
className={ clsx(
|
|
27
|
+
resetStyles[ 'box-sizing' ],
|
|
28
|
+
styles.positioner,
|
|
29
|
+
className
|
|
30
|
+
) }
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export { Positioner };
|
|
@@ -7,10 +7,18 @@ const meta: Meta< typeof Tooltip.Root > = {
|
|
|
7
7
|
title: 'Design System/Components/Tooltip',
|
|
8
8
|
component: Tooltip.Root,
|
|
9
9
|
subcomponents: {
|
|
10
|
-
Provider: Tooltip.Provider,
|
|
11
|
-
Trigger: Tooltip.Trigger,
|
|
12
|
-
Popup: Tooltip.Popup,
|
|
13
|
-
|
|
10
|
+
'Tooltip.Provider': Tooltip.Provider,
|
|
11
|
+
'Tooltip.Trigger': Tooltip.Trigger,
|
|
12
|
+
'Tooltip.Popup': Tooltip.Popup,
|
|
13
|
+
'Tooltip.Positioner': Tooltip.Positioner,
|
|
14
|
+
'Tooltip.Portal': Tooltip.Portal,
|
|
15
|
+
},
|
|
16
|
+
parameters: {
|
|
17
|
+
componentStatus: {
|
|
18
|
+
status: 'use-with-caution',
|
|
19
|
+
whereUsed: 'global',
|
|
20
|
+
notes: 'Not yet recommended for use alongside components from `@wordpress/components`, pending review of overlays compatibility. See [WordPress/gutenberg#76135](https://github.com/WordPress/gutenberg/issues/76135).',
|
|
21
|
+
},
|
|
14
22
|
},
|
|
15
23
|
};
|
|
16
24
|
export default meta;
|
|
@@ -40,8 +48,11 @@ export const Disabled: StoryObj< typeof Tooltip.Root > = {
|
|
|
40
48
|
};
|
|
41
49
|
|
|
42
50
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
51
|
+
* Customize where the tooltip appears relative to the trigger by passing a
|
|
52
|
+
* `<Tooltip.Positioner />` element to `Tooltip.Popup`'s `positioner` prop.
|
|
53
|
+
* `Tooltip.Positioner` accepts `side`, `align`, `sideOffset`, and collision
|
|
54
|
+
* settings; when `positioner` is omitted, the tooltip uses the defaults
|
|
55
|
+
* (`side="top"`, `align="center"`, `sideOffset={ 4 }`).
|
|
45
56
|
*/
|
|
46
57
|
export const Positioning: StoryObj< typeof Tooltip.Root > = {
|
|
47
58
|
render: () => (
|
|
@@ -55,27 +66,67 @@ export const Positioning: StoryObj< typeof Tooltip.Root > = {
|
|
|
55
66
|
>
|
|
56
67
|
<Tooltip.Root>
|
|
57
68
|
<Tooltip.Trigger aria-label="Up">⬆️</Tooltip.Trigger>
|
|
58
|
-
<Tooltip.Popup side="top">
|
|
69
|
+
<Tooltip.Popup positioner={ <Tooltip.Positioner side="top" /> }>
|
|
70
|
+
Up
|
|
71
|
+
</Tooltip.Popup>
|
|
59
72
|
</Tooltip.Root>
|
|
60
73
|
|
|
61
74
|
<Tooltip.Root>
|
|
62
75
|
<Tooltip.Trigger aria-label="Forward">➡️</Tooltip.Trigger>
|
|
63
|
-
<Tooltip.Popup
|
|
76
|
+
<Tooltip.Popup
|
|
77
|
+
positioner={ <Tooltip.Positioner side="right" /> }
|
|
78
|
+
>
|
|
79
|
+
Forward
|
|
80
|
+
</Tooltip.Popup>
|
|
64
81
|
</Tooltip.Root>
|
|
65
82
|
|
|
66
83
|
<Tooltip.Root>
|
|
67
84
|
<Tooltip.Trigger aria-label="Down">⬇️</Tooltip.Trigger>
|
|
68
|
-
<Tooltip.Popup
|
|
85
|
+
<Tooltip.Popup
|
|
86
|
+
positioner={ <Tooltip.Positioner side="bottom" /> }
|
|
87
|
+
>
|
|
88
|
+
Down
|
|
89
|
+
</Tooltip.Popup>
|
|
69
90
|
</Tooltip.Root>
|
|
70
91
|
|
|
71
92
|
<Tooltip.Root>
|
|
72
93
|
<Tooltip.Trigger aria-label="Back">⬅️</Tooltip.Trigger>
|
|
73
|
-
<Tooltip.Popup
|
|
94
|
+
<Tooltip.Popup
|
|
95
|
+
positioner={ <Tooltip.Positioner side="left" /> }
|
|
96
|
+
>
|
|
97
|
+
Back
|
|
98
|
+
</Tooltip.Popup>
|
|
74
99
|
</Tooltip.Root>
|
|
75
100
|
</div>
|
|
76
101
|
),
|
|
77
102
|
};
|
|
78
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Beyond `side`, `Tooltip.Positioner` accepts the rest of the positioner
|
|
106
|
+
* surface — `align`, `alignOffset`, `sideOffset`, collision settings, and
|
|
107
|
+
* more — for fine-grained placement.
|
|
108
|
+
*/
|
|
109
|
+
export const WithCustomPositioner: StoryObj< typeof Tooltip.Root > = {
|
|
110
|
+
args: {
|
|
111
|
+
children: (
|
|
112
|
+
<>
|
|
113
|
+
<Tooltip.Trigger aria-label="Save">💾</Tooltip.Trigger>
|
|
114
|
+
<Tooltip.Popup
|
|
115
|
+
positioner={
|
|
116
|
+
<Tooltip.Positioner
|
|
117
|
+
side="right"
|
|
118
|
+
align="start"
|
|
119
|
+
sideOffset={ 16 }
|
|
120
|
+
/>
|
|
121
|
+
}
|
|
122
|
+
>
|
|
123
|
+
Save
|
|
124
|
+
</Tooltip.Popup>
|
|
125
|
+
</>
|
|
126
|
+
),
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
|
|
79
130
|
/**
|
|
80
131
|
* Popovers in Gutenberg are managed with explicit z-index values, which can
|
|
81
132
|
* create situations where a tooltip renders below another popover when you
|
|
@@ -15,6 +15,11 @@ const meta: Meta = {
|
|
|
15
15
|
title: 'Design System/Components/Tooltip/Usage Guidelines',
|
|
16
16
|
parameters: {
|
|
17
17
|
controls: { disable: true },
|
|
18
|
+
componentStatus: {
|
|
19
|
+
status: 'use-with-caution',
|
|
20
|
+
whereUsed: 'global',
|
|
21
|
+
notes: 'Not yet recommended for use alongside components from `@wordpress/components`, pending review of overlays compatibility. See [WordPress/gutenberg#76135](https://github.com/WordPress/gutenberg/issues/76135).',
|
|
22
|
+
},
|
|
18
23
|
},
|
|
19
24
|
tags: [ '!dev' ],
|
|
20
25
|
};
|
package/src/tooltip/types.ts
CHANGED
|
@@ -5,6 +5,10 @@ import type { ComponentProps } from '../utils/types';
|
|
|
5
5
|
|
|
6
6
|
export type PortalProps = ComponentPropsWithoutRef< typeof _Tooltip.Portal >;
|
|
7
7
|
|
|
8
|
+
export type PositionerProps = ComponentPropsWithoutRef<
|
|
9
|
+
typeof _Tooltip.Positioner
|
|
10
|
+
>;
|
|
11
|
+
|
|
8
12
|
export type RootProps = Pick< _Tooltip.Root.Props, 'disabled' | 'children' >;
|
|
9
13
|
|
|
10
14
|
export type ProviderProps = Pick<
|
|
@@ -19,9 +23,7 @@ export interface TriggerProps extends ComponentProps< 'button' > {
|
|
|
19
23
|
children?: ReactNode;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
export interface PopupProps
|
|
23
|
-
extends ComponentProps< 'div' >,
|
|
24
|
-
Pick< _Tooltip.Positioner.Props, 'align' | 'side' | 'sideOffset' > {
|
|
26
|
+
export interface PopupProps extends ComponentProps< 'div' > {
|
|
25
27
|
/**
|
|
26
28
|
* The content to be rendered inside the component.
|
|
27
29
|
*/
|
|
@@ -34,4 +36,13 @@ export interface PopupProps
|
|
|
34
36
|
* be ignored.
|
|
35
37
|
*/
|
|
36
38
|
portal?: ReactElement< Omit< PortalProps, 'children' > >;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optional positioner element, typically `<Tooltip.Positioner />` with
|
|
42
|
+
* custom positioning props (`side`, `align`, `sideOffset`, collision
|
|
43
|
+
* settings, etc.). When omitted, `Tooltip.Popup` uses `Tooltip.Positioner`
|
|
44
|
+
* with default props. Do not pass `children` on the positioner element;
|
|
45
|
+
* they would be ignored.
|
|
46
|
+
*/
|
|
47
|
+
positioner?: ReactElement< Omit< PositionerProps, 'children' > >;
|
|
37
48
|
}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
@layer wp-ui-utilities {
|
|
9
9
|
.dropdown-motion {
|
|
10
10
|
--wp-ui-dropdown-slide-distance: 4px;
|
|
11
|
-
--wp-ui-dropdown-slide-duration:
|
|
12
|
-
--wp-ui-dropdown-slide-easing:
|
|
13
|
-
--wp-ui-dropdown-fade-duration:
|
|
11
|
+
--wp-ui-dropdown-slide-duration: var(--wpds-motion-duration-md);
|
|
12
|
+
--wp-ui-dropdown-slide-easing: var(--wpds-motion-easing-expressive);
|
|
13
|
+
--wp-ui-dropdown-fade-duration: var(--wpds-motion-duration-sm);
|
|
14
14
|
--wp-ui-dropdown-fade-easing: linear;
|
|
15
15
|
|
|
16
16
|
@media not ( prefers-reduced-motion ) {
|
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
align-items: center;
|
|
60
60
|
justify-content: flex-start;
|
|
61
61
|
gap: var(--wpds-dimension-gap-xs);
|
|
62
|
-
cursor: var(--wpds-cursor-control);
|
|
63
62
|
min-height: var(--wp-ui-popup-item-height);
|
|
64
63
|
border-radius: var(--wpds-border-radius-sm);
|
|
65
64
|
user-select: none;
|
|
@@ -70,6 +69,10 @@
|
|
|
70
69
|
padding-inline-start: calc(var(--wp-ui-popup-item-padding-inline) - 4px);
|
|
71
70
|
padding-inline-end: var(--wp-ui-popup-item-padding-inline);
|
|
72
71
|
|
|
72
|
+
&:not([data-disabled]) {
|
|
73
|
+
cursor: var(--wpds-cursor-control);
|
|
74
|
+
}
|
|
75
|
+
|
|
73
76
|
&.is-size-compact {
|
|
74
77
|
--wp-ui-popup-item-height: 32px;
|
|
75
78
|
--wp-ui-popup-item-padding-inline: 8px;
|
|
@@ -90,6 +93,7 @@
|
|
|
90
93
|
&[data-highlighted]:not([aria-disabled="true"]) {
|
|
91
94
|
background-color: var(--wpds-color-bg-interactive-brand-weak-active);
|
|
92
95
|
color: var(--wpds-color-fg-interactive-neutral);
|
|
96
|
+
outline: none; /* Disable user agent focus ring */
|
|
93
97
|
|
|
94
98
|
@media ( forced-colors: active ) {
|
|
95
99
|
outline: 1px solid Highlight;
|
|
@@ -160,20 +160,37 @@
|
|
|
160
160
|
* between the chrome and any preceding / following siblings inside
|
|
161
161
|
* `.content`. No border — the separator is specific to the pinned
|
|
162
162
|
* case.
|
|
163
|
+
*
|
|
164
|
+
* Each rule is duplicated with `> [data-drawer-content] >` so it
|
|
165
|
+
* also fires for `Drawer`, where `Drawer.Content` renders an outer
|
|
166
|
+
* wrapper around Base UI's `_Drawer.Content` marker (so the popup-
|
|
167
|
+
* edge gutter falls outside `[data-drawer-content]` and stays
|
|
168
|
+
* mouse-draggable for swipe-dismiss). The marker is a transparent
|
|
169
|
+
* one-level wrapper, so mirroring each direct-child rule one level
|
|
170
|
+
* deeper through it preserves the same intent: chrome sitting at
|
|
171
|
+
* the scroll body's true visual edge collapses its popup-edge
|
|
172
|
+
* padding; chrome wrapped in arbitrary consumer-supplied
|
|
173
|
+
* intermediate elements keeps its own padding. `Dialog` and
|
|
174
|
+
* `AlertDialog` have no such wrapper, so the `[data-drawer-content]`
|
|
175
|
+
* variants never match for them.
|
|
163
176
|
*/
|
|
164
|
-
.content > .header
|
|
177
|
+
.content > .header,
|
|
178
|
+
.content > [data-drawer-content] > .header {
|
|
165
179
|
padding-inline: 0;
|
|
166
180
|
}
|
|
167
181
|
|
|
168
|
-
.content > .header:first-child
|
|
182
|
+
.content > .header:first-child,
|
|
183
|
+
.content > [data-drawer-content] > .header:first-child {
|
|
169
184
|
padding-block-start: 0;
|
|
170
185
|
}
|
|
171
186
|
|
|
172
|
-
.content > .footer
|
|
187
|
+
.content > .footer,
|
|
188
|
+
.content > [data-drawer-content] > .footer {
|
|
173
189
|
padding-inline: 0;
|
|
174
190
|
}
|
|
175
191
|
|
|
176
|
-
.content > .footer:last-child
|
|
192
|
+
.content > .footer:last-child,
|
|
193
|
+
.content > [data-drawer-content] > .footer:last-child {
|
|
177
194
|
padding-block-end: 0;
|
|
178
195
|
}
|
|
179
196
|
|
|
@@ -26,9 +26,12 @@
|
|
|
26
26
|
font-size: inherit;
|
|
27
27
|
line-height: 1.4;
|
|
28
28
|
text-align: start;
|
|
29
|
-
cursor: var(--wpds-cursor-control);
|
|
30
29
|
user-select: none;
|
|
31
30
|
|
|
31
|
+
&:not([data-disabled]) {
|
|
32
|
+
cursor: var(--wpds-cursor-control);
|
|
33
|
+
}
|
|
34
|
+
|
|
32
35
|
&.is-minimal {
|
|
33
36
|
width: auto;
|
|
34
37
|
}
|
|
@@ -48,7 +51,7 @@
|
|
|
48
51
|
text-overflow: ellipsis;
|
|
49
52
|
white-space: nowrap;
|
|
50
53
|
|
|
51
|
-
|
|
54
|
+
&[data-placeholder] {
|
|
52
55
|
color: var(--wpds-color-fg-interactive-neutral-disabled);
|
|
53
56
|
}
|
|
54
57
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cloneElement } from '@wordpress/element';
|
|
2
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fills an optional "slot" element prop with content by cloning it and
|
|
6
|
+
* injecting the given `children`. When `slot` is undefined, the provided
|
|
7
|
+
* `defaultSlot` is used in its place.
|
|
8
|
+
*
|
|
9
|
+
* Shared by overlay `Popup` components for their slot-shaped customization
|
|
10
|
+
* props (e.g. `portal`, `positioner`), so the merge behavior — defaults,
|
|
11
|
+
* children injection — stays consistent across all of them.
|
|
12
|
+
*
|
|
13
|
+
* Callers should type the slot prop as `ReactElement<Omit<Props, 'children'>>`:
|
|
14
|
+
* any subtree passed on the slot element is overwritten by `children`.
|
|
15
|
+
*
|
|
16
|
+
* @param slot Optional element from the slot prop (e.g. `<Tooltip.Portal … />`
|
|
17
|
+
* or `<Tooltip.Positioner … />`). When omitted, `defaultSlot`
|
|
18
|
+
* is used. Injected `children` replace any subtree the caller
|
|
19
|
+
* may have passed on the slot element.
|
|
20
|
+
* @param defaultSlot Unpopulated default element used when `slot` is omitted
|
|
21
|
+
* (e.g. `<Tooltip.Portal />`).
|
|
22
|
+
* @param children Content to inject as the slot's children (backdrop,
|
|
23
|
+
* positioner, popup subtree, etc.).
|
|
24
|
+
*/
|
|
25
|
+
export function renderSlotWithChildren(
|
|
26
|
+
slot: ReactElement | undefined,
|
|
27
|
+
defaultSlot: ReactElement,
|
|
28
|
+
children: ReactNode
|
|
29
|
+
): ReactElement {
|
|
30
|
+
return cloneElement( slot ?? defaultSlot, { children } );
|
|
31
|
+
}
|
|
@@ -6,6 +6,12 @@ const meta: Meta< typeof VisuallyHidden > = {
|
|
|
6
6
|
tags: [ 'manifest' ],
|
|
7
7
|
title: 'Design System/Components/VisuallyHidden',
|
|
8
8
|
component: VisuallyHidden,
|
|
9
|
+
parameters: {
|
|
10
|
+
componentStatus: {
|
|
11
|
+
status: 'recommended',
|
|
12
|
+
whereUsed: 'global',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
9
15
|
};
|
|
10
16
|
export default meta;
|
|
11
17
|
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/render-portal-with-children.ts"],
|
|
4
|
-
"sourcesContent": ["import { cloneElement } from '@wordpress/element';\nimport type { ReactElement, ReactNode } from 'react';\n\n/**\n * Renders overlay markup (`children`) through an optional `portal` element from\n * `portal={ <Component.Portal \u2026 /> }`, or through the package default portal.\n *\n * Shared by overlay `Popup` components so portal merge behavior stays consistent.\n *\n * @param portal Optional element from the `portal` prop (should have no\n * `children`; callers type this via `Omit<PortalProps,'children'>`).\n * When omitted, `defaultPortal` is used. Injected `children`\n * replace any subtree on the portal element.\n * @param defaultPortal Unpopulated default portal element (e.g. `<Dialog.Portal />`).\n * @param children Popup subtree (backdrop, positioner, etc.) to inject as the portal\u2019s children.\n */\nexport function renderPortalWithChildren(\n\tportal: ReactElement | undefined,\n\tdefaultPortal: ReactElement,\n\tchildren: ReactNode\n): ReactElement {\n\tconst rootPortal = portal ?? defaultPortal;\n\n\treturn cloneElement( rootPortal, {\n\t\tchildren,\n\t} );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA6B;AAgBtB,SAAS,yBACf,QACA,eACA,UACe;AACf,QAAM,aAAa,UAAU;AAE7B,aAAO,6BAAc,YAAY;AAAA,IAChC;AAAA,EACD,CAAE;AACH;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// packages/ui/src/utils/render-portal-with-children.ts
|
|
2
|
-
import { cloneElement } from "@wordpress/element";
|
|
3
|
-
function renderPortalWithChildren(portal, defaultPortal, children) {
|
|
4
|
-
const rootPortal = portal ?? defaultPortal;
|
|
5
|
-
return cloneElement(rootPortal, {
|
|
6
|
-
children
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
renderPortalWithChildren
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=render-portal-with-children.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/render-portal-with-children.ts"],
|
|
4
|
-
"sourcesContent": ["import { cloneElement } from '@wordpress/element';\nimport type { ReactElement, ReactNode } from 'react';\n\n/**\n * Renders overlay markup (`children`) through an optional `portal` element from\n * `portal={ <Component.Portal \u2026 /> }`, or through the package default portal.\n *\n * Shared by overlay `Popup` components so portal merge behavior stays consistent.\n *\n * @param portal Optional element from the `portal` prop (should have no\n * `children`; callers type this via `Omit<PortalProps,'children'>`).\n * When omitted, `defaultPortal` is used. Injected `children`\n * replace any subtree on the portal element.\n * @param defaultPortal Unpopulated default portal element (e.g. `<Dialog.Portal />`).\n * @param children Popup subtree (backdrop, positioner, etc.) to inject as the portal\u2019s children.\n */\nexport function renderPortalWithChildren(\n\tportal: ReactElement | undefined,\n\tdefaultPortal: ReactElement,\n\tchildren: ReactNode\n): ReactElement {\n\tconst rootPortal = portal ?? defaultPortal;\n\n\treturn cloneElement( rootPortal, {\n\t\tchildren,\n\t} );\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,oBAAoB;AAgBtB,SAAS,yBACf,QACA,eACA,UACe;AACf,QAAM,aAAa,UAAU;AAE7B,SAAO,aAAc,YAAY;AAAA,IAChC;AAAA,EACD,CAAE;AACH;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Renders overlay markup (`children`) through an optional `portal` element from
|
|
4
|
-
* `portal={ <Component.Portal … /> }`, or through the package default portal.
|
|
5
|
-
*
|
|
6
|
-
* Shared by overlay `Popup` components so portal merge behavior stays consistent.
|
|
7
|
-
*
|
|
8
|
-
* @param portal Optional element from the `portal` prop (should have no
|
|
9
|
-
* `children`; callers type this via `Omit<PortalProps,'children'>`).
|
|
10
|
-
* When omitted, `defaultPortal` is used. Injected `children`
|
|
11
|
-
* replace any subtree on the portal element.
|
|
12
|
-
* @param defaultPortal Unpopulated default portal element (e.g. `<Dialog.Portal />`).
|
|
13
|
-
* @param children Popup subtree (backdrop, positioner, etc.) to inject as the portal’s children.
|
|
14
|
-
*/
|
|
15
|
-
export declare function renderPortalWithChildren(portal: ReactElement | undefined, defaultPortal: ReactElement, children: ReactNode): ReactElement;
|
|
16
|
-
//# sourceMappingURL=render-portal-with-children.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render-portal-with-children.d.ts","sourceRoot":"","sources":["../../src/utils/render-portal-with-children.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,YAAY,GAAG,SAAS,EAChC,aAAa,EAAE,YAAY,EAC3B,QAAQ,EAAE,SAAS,GACjB,YAAY,CAMd"}
|