@wordpress/ui 0.12.0 → 0.13.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/tooltip/stories/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,KAAK,OAAO,MAAM,KAAK,CAAC;AAE/B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/tooltip/stories/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,KAAK,OAAO,MAAM,KAAK,CAAC;AAE/B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAAC,IAAI,CAiBpC,CAAC;eACa,IAAI;AAEnB,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAE,OAAO,OAAO,CAAC,IAAI,CASlD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAE,OAAO,OAAO,CAAC,IAAI,CAMnD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAE,OAAO,OAAO,CAAC,IAAI,CA6CtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAE,OAAO,OAAO,CAAC,IAAI,CAmB/D,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAE,OAAO,OAAO,CAAC,IAAI,CAkB3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAE,OAAO,OAAO,CAAC,IAAI,CAoBvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-guidelines.story.d.ts","sourceRoot":"","sources":["../../../src/tooltip/stories/usage-guidelines.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAa5D,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"usage-guidelines.story.d.ts","sourceRoot":"","sources":["../../../src/tooltip/stories/usage-guidelines.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAa5D,QAAA,MAAM,IAAI,EAAE,IAWX,CAAC;eACa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KA2B9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,KA0ChC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAYnC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import type { ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react';
|
|
|
2
2
|
import type { Tooltip as _Tooltip } from '@base-ui/react/tooltip';
|
|
3
3
|
import type { ComponentProps } from '../utils/types';
|
|
4
4
|
export type PortalProps = ComponentPropsWithoutRef<typeof _Tooltip.Portal>;
|
|
5
|
+
export type PositionerProps = ComponentPropsWithoutRef<typeof _Tooltip.Positioner>;
|
|
5
6
|
export type RootProps = Pick<_Tooltip.Root.Props, 'disabled' | 'children'>;
|
|
6
7
|
export type ProviderProps = Pick<_Tooltip.Provider.Props, 'delay' | 'children'>;
|
|
7
8
|
export interface TriggerProps extends ComponentProps<'button'> {
|
|
@@ -10,7 +11,7 @@ export interface TriggerProps extends ComponentProps<'button'> {
|
|
|
10
11
|
*/
|
|
11
12
|
children?: ReactNode;
|
|
12
13
|
}
|
|
13
|
-
export interface PopupProps extends ComponentProps<'div'
|
|
14
|
+
export interface PopupProps extends ComponentProps<'div'> {
|
|
14
15
|
/**
|
|
15
16
|
* The content to be rendered inside the component.
|
|
16
17
|
*/
|
|
@@ -22,5 +23,13 @@ export interface PopupProps extends ComponentProps<'div'>, Pick<_Tooltip.Positio
|
|
|
22
23
|
* be ignored.
|
|
23
24
|
*/
|
|
24
25
|
portal?: ReactElement<Omit<PortalProps, 'children'>>;
|
|
26
|
+
/**
|
|
27
|
+
* Optional positioner element, typically `<Tooltip.Positioner />` with
|
|
28
|
+
* custom positioning props (`side`, `align`, `sideOffset`, collision
|
|
29
|
+
* settings, etc.). When omitted, `Tooltip.Popup` uses `Tooltip.Positioner`
|
|
30
|
+
* with default props. Do not pass `children` on the positioner element;
|
|
31
|
+
* they would be ignored.
|
|
32
|
+
*/
|
|
33
|
+
positioner?: ReactElement<Omit<PositionerProps, 'children'>>;
|
|
25
34
|
}
|
|
26
35
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,KAAK,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,wBAAwB,CAAE,OAAO,QAAQ,CAAC,MAAM,CAAE,CAAC;AAE7E,MAAM,MAAM,SAAS,GAAG,IAAI,CAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAAE,CAAC;AAE7E,MAAM,MAAM,aAAa,GAAG,IAAI,CAC/B,QAAQ,CAAC,QAAQ,CAAC,KAAK,EACvB,OAAO,GAAG,UAAU,CACpB,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAE,QAAQ,CAAE;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,KAAK,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,wBAAwB,CAAE,OAAO,QAAQ,CAAC,MAAM,CAAE,CAAC;AAE7E,MAAM,MAAM,eAAe,GAAG,wBAAwB,CACrD,OAAO,QAAQ,CAAC,UAAU,CAC1B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,IAAI,CAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAAE,CAAC;AAE7E,MAAM,MAAM,aAAa,GAAG,IAAI,CAC/B,QAAQ,CAAC,QAAQ,CAAC,KAAK,EACvB,OAAO,GAAG,UAAU,CACpB,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAE,QAAQ,CAAE;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAE,KAAK,CAAE;IAC1D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,YAAY,CAAE,IAAI,CAAE,WAAW,EAAE,UAAU,CAAE,CAAE,CAAC;IAEzD;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,YAAY,CAAE,IAAI,CAAE,eAAe,EAAE,UAAU,CAAE,CAAE,CAAC;CACjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-overlay-modal-context.d.ts","sourceRoot":"","sources":["../../src/utils/create-overlay-modal-context.tsx"],"names":[],"mappings":"AAEA,KAAK,yBAAyB,CAAE,KAAK,IAAK;IACzC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,yBAAyB,CAAE,KAAK,EAAI,YAAY,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"create-overlay-modal-context.d.ts","sourceRoot":"","sources":["../../src/utils/create-overlay-modal-context.tsx"],"names":[],"mappings":"AAEA,KAAK,yBAAyB,CAAE,KAAK,IAAK;IACzC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,yBAAyB,CAAE,KAAK,EAAI,YAAY,EAAE,KAAK;IAmBrE,QAAQ,yBAbN,yBAAyB,CAAE,KAAK,CAAE;IAcpC,QAAQ;EAET"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Fills an optional "slot" element prop with content by cloning it and
|
|
4
|
+
* injecting the given `children`. When `slot` is undefined, the provided
|
|
5
|
+
* `defaultSlot` is used in its place.
|
|
6
|
+
*
|
|
7
|
+
* Shared by overlay `Popup` components for their slot-shaped customization
|
|
8
|
+
* props (e.g. `portal`, `positioner`), so the merge behavior — defaults,
|
|
9
|
+
* children injection — stays consistent across all of them.
|
|
10
|
+
*
|
|
11
|
+
* Callers should type the slot prop as `ReactElement<Omit<Props, 'children'>>`:
|
|
12
|
+
* any subtree passed on the slot element is overwritten by `children`.
|
|
13
|
+
*
|
|
14
|
+
* @param slot Optional element from the slot prop (e.g. `<Tooltip.Portal … />`
|
|
15
|
+
* or `<Tooltip.Positioner … />`). When omitted, `defaultSlot`
|
|
16
|
+
* is used. Injected `children` replace any subtree the caller
|
|
17
|
+
* may have passed on the slot element.
|
|
18
|
+
* @param defaultSlot Unpopulated default element used when `slot` is omitted
|
|
19
|
+
* (e.g. `<Tooltip.Portal />`).
|
|
20
|
+
* @param children Content to inject as the slot's children (backdrop,
|
|
21
|
+
* positioner, popup subtree, etc.).
|
|
22
|
+
*/
|
|
23
|
+
export declare function renderSlotWithChildren(slot: ReactElement | undefined, defaultSlot: ReactElement, children: ReactNode): ReactElement;
|
|
24
|
+
//# sourceMappingURL=render-slot-with-children.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-slot-with-children.d.ts","sourceRoot":"","sources":["../../src/utils/render-slot-with-children.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,YAAY,GAAG,SAAS,EAC9B,WAAW,EAAE,YAAY,EACzB,QAAQ,EAAE,SAAS,GACjB,YAAY,CAEd"}
|
|
@@ -26,7 +26,7 @@ type InitialFocus = _Popover.Popup.Props['initialFocus'];
|
|
|
26
26
|
* @param props.initialFocus The consumer-provided `initialFocus` value.
|
|
27
27
|
* @param props.deprioritizedAttributes The data attributes whose elements should be deprioritized.
|
|
28
28
|
*/
|
|
29
|
-
export declare function useDeprioritizedInitialFocus({ initialFocus, deprioritizedAttributes
|
|
29
|
+
export declare function useDeprioritizedInitialFocus({ initialFocus, deprioritizedAttributes }: {
|
|
30
30
|
initialFocus: InitialFocus;
|
|
31
31
|
deprioritizedAttributes: string[];
|
|
32
32
|
}): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-deprioritized-initial-focus.d.ts","sourceRoot":"","sources":["../../src/utils/use-deprioritized-initial-focus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIlE;;;;GAIG;AACH,KAAK,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAE,cAAc,CAAE,CAAC;AAe3D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,4BAA4B,CAAE,EAC7C,YAAY,EACZ,uBAAuB,
|
|
1
|
+
{"version":3,"file":"use-deprioritized-initial-focus.d.ts","sourceRoot":"","sources":["../../src/utils/use-deprioritized-initial-focus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIlE;;;;GAIG;AACH,KAAK,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAE,cAAc,CAAE,CAAC;AAe3D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,4BAA4B,CAAE,EAC7C,YAAY,EACZ,uBAAuB,EACvB,EAAE;IACF,YAAY,EAAE,YAAY,CAAC;IAC3B,uBAAuB,EAAE,MAAM,EAAE,CAAC;CAClC;;;EAsCA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/visually-hidden/stories/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAErC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,cAAc,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/visually-hidden/stories/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAErC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,cAAc,CAUtC,CAAC;eACa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,cAAc,CAAE,CAAC;AAE/C,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAgB/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Themeable React UI components for the WordPress Design System.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -44,15 +44,16 @@
|
|
|
44
44
|
"sideEffects": false,
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@base-ui/react": "^1.4.1",
|
|
47
|
-
"@wordpress/a11y": "^4.
|
|
48
|
-
"@wordpress/compose": "^7.
|
|
49
|
-
"@wordpress/element": "^6.
|
|
50
|
-
"@wordpress/i18n": "^6.
|
|
51
|
-
"@wordpress/icons": "^13.
|
|
52
|
-
"@wordpress/keycodes": "^4.
|
|
53
|
-
"@wordpress/primitives": "^4.
|
|
54
|
-
"@wordpress/private-apis": "^1.
|
|
55
|
-
"@wordpress/
|
|
47
|
+
"@wordpress/a11y": "^4.46.0",
|
|
48
|
+
"@wordpress/compose": "^7.46.0",
|
|
49
|
+
"@wordpress/element": "^6.46.0",
|
|
50
|
+
"@wordpress/i18n": "^6.19.0",
|
|
51
|
+
"@wordpress/icons": "^13.1.0",
|
|
52
|
+
"@wordpress/keycodes": "^4.46.0",
|
|
53
|
+
"@wordpress/primitives": "^4.46.0",
|
|
54
|
+
"@wordpress/private-apis": "^1.46.0",
|
|
55
|
+
"@wordpress/style-runtime": "^0.2.0",
|
|
56
|
+
"@wordpress/theme": "^0.13.0",
|
|
56
57
|
"clsx": "^2.1.1",
|
|
57
58
|
"tabbable": "^6.4.0"
|
|
58
59
|
},
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
"@storybook/react-vite": "^10.2.8",
|
|
62
63
|
"@testing-library/jest-dom": "^6.9.1",
|
|
63
64
|
"@types/jest": "^29.5.14",
|
|
64
|
-
"@types/node": "^20.
|
|
65
|
+
"@types/node": "^20.19.39",
|
|
65
66
|
"storybook": "^10.2.8"
|
|
66
67
|
},
|
|
67
68
|
"peerDependencies": {
|
|
@@ -71,5 +72,5 @@
|
|
|
71
72
|
"publishConfig": {
|
|
72
73
|
"access": "public"
|
|
73
74
|
},
|
|
74
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "51264e33b95fadff9a06b68141e674ce9cde9675"
|
|
75
76
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
privateApis as themePrivateApis,
|
|
9
9
|
} from '@wordpress/theme';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { renderSlotWithChildren } from '../utils/render-slot-with-children';
|
|
12
12
|
import { Button } from '../button';
|
|
13
13
|
import dialogStyles from '../dialog/style.module.css';
|
|
14
14
|
import focusStyles from '../utils/css/focus.module.css';
|
|
@@ -178,7 +178,7 @@ const Popup = forwardRef< HTMLDivElement, PopupProps >(
|
|
|
178
178
|
</>
|
|
179
179
|
);
|
|
180
180
|
|
|
181
|
-
return
|
|
181
|
+
return renderSlotWithChildren( portal, <Portal />, portalChildren );
|
|
182
182
|
}
|
|
183
183
|
);
|
|
184
184
|
|
|
@@ -12,12 +12,20 @@ const meta: Meta< typeof AlertDialog.Root > = {
|
|
|
12
12
|
component: AlertDialog.Root,
|
|
13
13
|
subcomponents: {
|
|
14
14
|
'AlertDialog.Trigger': AlertDialog.Trigger,
|
|
15
|
+
'AlertDialog.Portal': AlertDialog.Portal,
|
|
15
16
|
'AlertDialog.Popup': AlertDialog.Popup,
|
|
16
17
|
},
|
|
17
18
|
argTypes: {
|
|
18
19
|
onConfirm: { action: fn() },
|
|
19
20
|
onOpenChange: { action: fn() },
|
|
20
21
|
},
|
|
22
|
+
parameters: {
|
|
23
|
+
componentStatus: {
|
|
24
|
+
status: 'use-with-caution',
|
|
25
|
+
whereUsed: 'global',
|
|
26
|
+
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).',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
21
29
|
};
|
|
22
30
|
export default meta;
|
|
23
31
|
|
package/src/button/button.tsx
CHANGED
|
@@ -9,6 +9,9 @@ import resetStyles from '../utils/css/resets.module.css';
|
|
|
9
9
|
import focusStyles from '../utils/css/focus.module.css';
|
|
10
10
|
import defenseStyles from '../utils/css/global-css-defense.module.css';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* A versatile button component with multiple variants, tones, and sizes.
|
|
14
|
+
*/
|
|
12
15
|
export const Button = forwardRef< HTMLButtonElement, ButtonProps >(
|
|
13
16
|
function Button(
|
|
14
17
|
{
|
package/src/button/icon.tsx
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { forwardRef } from '@wordpress/element';
|
|
2
|
-
import { type
|
|
2
|
+
import { type ButtonIconProps } from './types';
|
|
3
3
|
import { Icon } from '../icon';
|
|
4
4
|
|
|
5
|
-
interface ButtonIconProps extends IconProps {
|
|
6
|
-
/**
|
|
7
|
-
* The icon to display, from the `@wordpress/icons` package.
|
|
8
|
-
*/
|
|
9
|
-
icon: IconProps[ 'icon' ];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
5
|
export const ButtonIcon = forwardRef< SVGSVGElement, ButtonIconProps >(
|
|
13
6
|
function ButtonIcon( { icon, ...props }, ref ) {
|
|
14
7
|
return (
|
package/src/button/index.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { Button as
|
|
1
|
+
import { Button as _Button } from './button';
|
|
2
2
|
import { ButtonIcon } from './icon';
|
|
3
3
|
|
|
4
|
+
ButtonIcon.displayName = 'Button.Icon';
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* A versatile button component with multiple variants, tones, and sizes.
|
|
6
|
-
* Built on design tokens for consistent theming and accessibility.
|
|
7
8
|
*/
|
|
8
|
-
export const Button = Object.assign(
|
|
9
|
+
export const Button = Object.assign( _Button, {
|
|
9
10
|
/**
|
|
10
11
|
* An icon component specifically designed to work well when rendered inside
|
|
11
12
|
* a `Button` component.
|
|
12
13
|
*/
|
|
13
14
|
Icon: ButtonIcon,
|
|
14
|
-
} )
|
|
15
|
-
Icon: typeof ButtonIcon;
|
|
16
|
-
};
|
|
15
|
+
} );
|
|
@@ -6,11 +6,21 @@ import { Button } from '../index';
|
|
|
6
6
|
const meta: Meta< typeof Button > = {
|
|
7
7
|
title: 'Design System/Components/Button',
|
|
8
8
|
component: Button,
|
|
9
|
+
subcomponents: {
|
|
10
|
+
'Button.Icon': Button.Icon,
|
|
11
|
+
},
|
|
9
12
|
argTypes: {
|
|
10
13
|
'aria-pressed': {
|
|
11
14
|
control: { type: 'boolean' },
|
|
12
15
|
},
|
|
13
16
|
},
|
|
17
|
+
parameters: {
|
|
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 style consistency with `@wordpress/components` and text overflow behavior. See [WordPress/gutenberg#76135](https://github.com/WordPress/gutenberg/issues/76135).',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
14
24
|
};
|
|
15
25
|
export default meta;
|
|
16
26
|
|
package/src/button/types.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode, type HTMLAttributes } from 'react';
|
|
2
2
|
import type { Button as _Button } from '@base-ui/react/button';
|
|
3
|
+
import { type IconProps } from '../icon/types';
|
|
3
4
|
import type { ComponentProps } from '../utils/types';
|
|
4
5
|
|
|
5
6
|
type _ButtonProps = ComponentProps< typeof _Button >;
|
|
@@ -70,3 +71,10 @@ export interface ButtonProps
|
|
|
70
71
|
*/
|
|
71
72
|
loadingAnnouncement?: string;
|
|
72
73
|
}
|
|
74
|
+
|
|
75
|
+
export interface ButtonIconProps extends IconProps {
|
|
76
|
+
/**
|
|
77
|
+
* The icon to display, from the `@wordpress/icons` package.
|
|
78
|
+
*/
|
|
79
|
+
icon: IconProps[ 'icon' ];
|
|
80
|
+
}
|
|
@@ -10,6 +10,12 @@ const meta: Meta< typeof Collapsible.Root > = {
|
|
|
10
10
|
'Collapsible.Trigger': Collapsible.Trigger,
|
|
11
11
|
'Collapsible.Panel': Collapsible.Panel,
|
|
12
12
|
},
|
|
13
|
+
parameters: {
|
|
14
|
+
componentStatus: {
|
|
15
|
+
status: 'recommended',
|
|
16
|
+
whereUsed: 'global',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
13
19
|
};
|
|
14
20
|
export default meta;
|
|
15
21
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeProps, useRender } from '@base-ui/react';
|
|
1
2
|
import clsx from 'clsx';
|
|
2
3
|
import { forwardRef, useMemo, useState } from '@wordpress/element';
|
|
3
4
|
import { chevronDown } from '@wordpress/icons';
|
|
@@ -15,6 +16,12 @@ import type { HeaderProps } from './types';
|
|
|
15
16
|
* toggle trigger — clicking anywhere on it expands or collapses the
|
|
16
17
|
* card's content.
|
|
17
18
|
*
|
|
19
|
+
* Defaults to a `<div>` wrapper around the trigger. Since the right heading
|
|
20
|
+
* level depends on the surrounding document outline, the consumer is
|
|
21
|
+
* expected to opt in to heading semantics. Pass `render` to wrap the
|
|
22
|
+
* trigger in a heading (e.g. `render={ <h2 /> }`), following the W3C APG
|
|
23
|
+
* accordion pattern (heading wraps button).
|
|
24
|
+
*
|
|
18
25
|
* Avoid placing interactive elements (buttons, links, inputs) inside the
|
|
19
26
|
* header, since the entire area is clickable and their events will bubble
|
|
20
27
|
* to trigger the collapse toggle.
|
|
@@ -31,48 +38,54 @@ export const Header = forwardRef< HTMLDivElement, HeaderProps >(
|
|
|
31
38
|
[ setDescriptionId ]
|
|
32
39
|
);
|
|
33
40
|
|
|
34
|
-
return (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<div
|
|
52
|
-
className={ clsx(
|
|
53
|
-
styles[ 'header-trigger-positioner' ]
|
|
54
|
-
) }
|
|
55
|
-
>
|
|
56
|
-
<div
|
|
57
|
-
className={ clsx(
|
|
58
|
-
styles[ 'header-trigger-wrapper' ],
|
|
59
|
-
defenseStyles.div,
|
|
60
|
-
// While the interactive trigger element is the whole header,
|
|
61
|
-
// the focus ring will be displayed only on the icon to visually
|
|
62
|
-
// emulate it being the button.
|
|
63
|
-
focusStyles[
|
|
64
|
-
'outset-ring--focus-parent-visible'
|
|
65
|
-
]
|
|
66
|
-
) }
|
|
41
|
+
return useRender( {
|
|
42
|
+
defaultTagName: 'div',
|
|
43
|
+
render,
|
|
44
|
+
ref,
|
|
45
|
+
props: mergeProps< 'div' >( restProps, {
|
|
46
|
+
className: clsx(
|
|
47
|
+
defenseStyles.heading,
|
|
48
|
+
styles[ 'heading-wrapper' ],
|
|
49
|
+
className
|
|
50
|
+
),
|
|
51
|
+
children: (
|
|
52
|
+
<HeaderDescriptionIdContext.Provider value={ contextValue }>
|
|
53
|
+
<Collapsible.Trigger
|
|
54
|
+
className={ styles.header }
|
|
55
|
+
render={ <Card.Header /> }
|
|
56
|
+
nativeButton={ false }
|
|
57
|
+
aria-describedby={ descriptionId }
|
|
67
58
|
>
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
59
|
+
<div className={ styles[ 'header-content' ] }>
|
|
60
|
+
{ children }
|
|
61
|
+
</div>
|
|
62
|
+
<div
|
|
63
|
+
className={ clsx(
|
|
64
|
+
styles[ 'header-trigger-positioner' ]
|
|
65
|
+
) }
|
|
66
|
+
>
|
|
67
|
+
<div
|
|
68
|
+
className={ clsx(
|
|
69
|
+
styles[ 'header-trigger-wrapper' ],
|
|
70
|
+
defenseStyles.div,
|
|
71
|
+
// While the interactive trigger element is the whole header,
|
|
72
|
+
// the focus ring will be displayed only on the icon to visually
|
|
73
|
+
// emulate it being the button.
|
|
74
|
+
focusStyles[
|
|
75
|
+
'outset-ring--focus-parent-visible'
|
|
76
|
+
]
|
|
77
|
+
) }
|
|
78
|
+
>
|
|
79
|
+
<Icon
|
|
80
|
+
icon={ chevronDown }
|
|
81
|
+
className={ styles[ 'header-trigger' ] }
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</Collapsible.Trigger>
|
|
86
|
+
</HeaderDescriptionIdContext.Provider>
|
|
87
|
+
),
|
|
88
|
+
} ),
|
|
89
|
+
} );
|
|
77
90
|
}
|
|
78
91
|
);
|
|
@@ -34,6 +34,12 @@ const meta: Meta< typeof CollapsibleCard.Root > = {
|
|
|
34
34
|
'CollapsibleCard.HeaderDescription': CollapsibleCard.HeaderDescription,
|
|
35
35
|
'CollapsibleCard.Content': CollapsibleCard.Content,
|
|
36
36
|
},
|
|
37
|
+
parameters: {
|
|
38
|
+
componentStatus: {
|
|
39
|
+
status: 'recommended',
|
|
40
|
+
whereUsed: 'global',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
37
43
|
};
|
|
38
44
|
export default meta;
|
|
39
45
|
|
|
@@ -159,6 +165,61 @@ export const Stacked: Story = {
|
|
|
159
165
|
),
|
|
160
166
|
};
|
|
161
167
|
|
|
168
|
+
/**
|
|
169
|
+
* `CollapsibleCard.Header` renders a `<div>` wrapper by default. Pass an
|
|
170
|
+
* `<h1>`–`<h6>` React element to the `render` prop to wrap the trigger in
|
|
171
|
+
* a heading and contribute to the document outline. The right level
|
|
172
|
+
* depends on the surrounding outline, so the consumer is expected to opt
|
|
173
|
+
* in.
|
|
174
|
+
*/
|
|
175
|
+
export const WithHeadingElement: Story = {
|
|
176
|
+
parameters: { controls: { disable: true } },
|
|
177
|
+
render: () => (
|
|
178
|
+
<div
|
|
179
|
+
style={ {
|
|
180
|
+
display: 'flex',
|
|
181
|
+
flexDirection: 'column',
|
|
182
|
+
gap: 'var(--wpds-dimension-gap-lg)',
|
|
183
|
+
} }
|
|
184
|
+
>
|
|
185
|
+
<CollapsibleCard.Root>
|
|
186
|
+
<CollapsibleCard.Header render={ <h2 /> }>
|
|
187
|
+
<Card.Title>Heading level 2</Card.Title>
|
|
188
|
+
</CollapsibleCard.Header>
|
|
189
|
+
<CollapsibleCard.Content>
|
|
190
|
+
<Text>
|
|
191
|
+
The wrapper renders as an h2 element when the consumer
|
|
192
|
+
passes an h2 React element to the render prop.
|
|
193
|
+
</Text>
|
|
194
|
+
</CollapsibleCard.Content>
|
|
195
|
+
</CollapsibleCard.Root>
|
|
196
|
+
<CollapsibleCard.Root>
|
|
197
|
+
<CollapsibleCard.Header render={ <h3 /> }>
|
|
198
|
+
<Card.Title>Heading level 3</Card.Title>
|
|
199
|
+
</CollapsibleCard.Header>
|
|
200
|
+
<CollapsibleCard.Content>
|
|
201
|
+
<Text>
|
|
202
|
+
Pass any of h1–h6 to choose the level that fits the
|
|
203
|
+
surrounding document outline.
|
|
204
|
+
</Text>
|
|
205
|
+
</CollapsibleCard.Content>
|
|
206
|
+
</CollapsibleCard.Root>
|
|
207
|
+
<CollapsibleCard.Root>
|
|
208
|
+
<CollapsibleCard.Header>
|
|
209
|
+
<Card.Title>No heading (default)</Card.Title>
|
|
210
|
+
</CollapsibleCard.Header>
|
|
211
|
+
<CollapsibleCard.Content>
|
|
212
|
+
<Text>
|
|
213
|
+
Without a render prop, the header wraps the trigger in a
|
|
214
|
+
plain div and does not contribute to the document
|
|
215
|
+
outline.
|
|
216
|
+
</Text>
|
|
217
|
+
</CollapsibleCard.Content>
|
|
218
|
+
</CollapsibleCard.Root>
|
|
219
|
+
</div>
|
|
220
|
+
),
|
|
221
|
+
};
|
|
222
|
+
|
|
162
223
|
/**
|
|
163
224
|
* A collapsible card with a `HeaderDescription` that provides supplementary
|
|
164
225
|
* information (e.g. status, summary) as an `aria-describedby` relationship.
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
|
|
2
2
|
|
|
3
3
|
@layer wp-ui-components {
|
|
4
|
+
/*
|
|
5
|
+
* Style overrides for the outer wrapper rendered by `CollapsibleCard.Header`
|
|
6
|
+
* (defaults to `<div>`, but consumers can opt into a heading level via
|
|
7
|
+
* `render={ <h2 /> }` etc.). Combined with `defenseStyles.heading` so that,
|
|
8
|
+
* when the wrapper renders as an h1–h6, the unlayered defense class beats
|
|
9
|
+
* wp-admin's bare `h2`/`h3`/etc. selectors. Keeps the wrapper visually
|
|
10
|
+
* transparent so UA and host stylesheets don't bleed into the inner
|
|
11
|
+
* trigger.
|
|
12
|
+
*/
|
|
13
|
+
.heading-wrapper {
|
|
14
|
+
--_gcd-heading-color: inherit;
|
|
15
|
+
--_gcd-heading-font-size: inherit;
|
|
16
|
+
--_gcd-heading-font-weight: inherit;
|
|
17
|
+
--_gcd-heading-margin: 0;
|
|
18
|
+
|
|
19
|
+
/* Properties not covered by the defense file. */
|
|
20
|
+
font-family: inherit;
|
|
21
|
+
line-height: inherit;
|
|
22
|
+
}
|
|
23
|
+
|
|
4
24
|
.header-content {
|
|
5
25
|
flex: 1;
|
|
6
26
|
min-width: 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { render, screen } from '@testing-library/react';
|
|
1
|
+
import { render, screen, within } from '@testing-library/react';
|
|
2
2
|
import { userEvent } from '@testing-library/user-event';
|
|
3
3
|
import { createRef } from '@wordpress/element';
|
|
4
4
|
import * as Card from '../../card';
|
|
@@ -179,6 +179,65 @@ describe( 'CollapsibleCard', () => {
|
|
|
179
179
|
} );
|
|
180
180
|
} );
|
|
181
181
|
|
|
182
|
+
describe( 'header wrapper', () => {
|
|
183
|
+
it( 'does not contribute a heading to the document outline by default', () => {
|
|
184
|
+
render(
|
|
185
|
+
<CollapsibleCard.Root>
|
|
186
|
+
<CollapsibleCard.Header>
|
|
187
|
+
<Card.Title>Title</Card.Title>
|
|
188
|
+
</CollapsibleCard.Header>
|
|
189
|
+
</CollapsibleCard.Root>
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
expect(
|
|
193
|
+
screen.queryByRole( 'heading', { name: 'Title' } )
|
|
194
|
+
).not.toBeInTheDocument();
|
|
195
|
+
expect(
|
|
196
|
+
screen.getByRole( 'button', { name: 'Title' } )
|
|
197
|
+
).toBeVisible();
|
|
198
|
+
} );
|
|
199
|
+
|
|
200
|
+
it( 'wraps the trigger in a heading via `render`', () => {
|
|
201
|
+
render(
|
|
202
|
+
<CollapsibleCard.Root>
|
|
203
|
+
<CollapsibleCard.Header render={ <h2 /> }>
|
|
204
|
+
<Card.Title>Title</Card.Title>
|
|
205
|
+
</CollapsibleCard.Header>
|
|
206
|
+
</CollapsibleCard.Root>
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
const heading = screen.getByRole( 'heading', {
|
|
210
|
+
level: 2,
|
|
211
|
+
name: 'Title',
|
|
212
|
+
} );
|
|
213
|
+
expect( heading ).toBeVisible();
|
|
214
|
+
expect(
|
|
215
|
+
within( heading ).getByRole( 'button', { name: 'Title' } )
|
|
216
|
+
).toBeVisible();
|
|
217
|
+
} );
|
|
218
|
+
|
|
219
|
+
it( 'forwards `className` and other props to the outer wrapper', () => {
|
|
220
|
+
render(
|
|
221
|
+
<CollapsibleCard.Root>
|
|
222
|
+
<CollapsibleCard.Header
|
|
223
|
+
className="custom-header"
|
|
224
|
+
data-testid="header"
|
|
225
|
+
>
|
|
226
|
+
<Card.Title>Title</Card.Title>
|
|
227
|
+
</CollapsibleCard.Header>
|
|
228
|
+
</CollapsibleCard.Root>
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
const wrapper = screen.getByTestId( 'header' );
|
|
232
|
+
expect( wrapper ).toHaveClass( 'custom-header' );
|
|
233
|
+
// The forwarded attributes land on the outer wrapper, not the
|
|
234
|
+
// inner button trigger.
|
|
235
|
+
expect(
|
|
236
|
+
within( wrapper ).getByRole( 'button', { name: 'Title' } )
|
|
237
|
+
).not.toHaveAttribute( 'data-testid' );
|
|
238
|
+
} );
|
|
239
|
+
} );
|
|
240
|
+
|
|
182
241
|
describe( 'HeaderDescription', () => {
|
|
183
242
|
it( 'sets aria-describedby on the trigger pointing to the description', () => {
|
|
184
243
|
render(
|
package/src/dialog/popup.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { unlock } from '../lock-unlock';
|
|
10
10
|
import { useDeprioritizedInitialFocus } from '../utils/use-deprioritized-initial-focus';
|
|
11
11
|
import { SCROLL_CONTAINER_ATTR } from '../utils/use-overlay-scroll-state-attributes';
|
|
12
|
-
import {
|
|
12
|
+
import { renderSlotWithChildren } from '../utils/render-slot-with-children';
|
|
13
13
|
import { DialogValidationProvider, useDialogModal } from './context';
|
|
14
14
|
import { Portal } from './portal';
|
|
15
15
|
import styles from './style.module.css';
|
|
@@ -24,8 +24,7 @@ const CLOSE_ICON_ATTR = 'data-wp-ui-dialog-close-icon';
|
|
|
24
24
|
* Renders the dialog popup element that contains the dialog content.
|
|
25
25
|
* Uses a portal to render outside the DOM hierarchy.
|
|
26
26
|
*
|
|
27
|
-
* When `portal` is omitted, defaults to `Dialog.Portal`.
|
|
28
|
-
* handled by `renderPortalWithChildren` (shared with other overlay `Popup`s).
|
|
27
|
+
* When `portal` is omitted, defaults to `Dialog.Portal`.
|
|
29
28
|
*/
|
|
30
29
|
const Popup = forwardRef< HTMLDivElement, PopupProps >( function DialogPopup(
|
|
31
30
|
{
|
|
@@ -80,7 +79,7 @@ const Popup = forwardRef< HTMLDivElement, PopupProps >( function DialogPopup(
|
|
|
80
79
|
</>
|
|
81
80
|
);
|
|
82
81
|
|
|
83
|
-
return
|
|
82
|
+
return renderSlotWithChildren( portal, <Portal />, portalChildren );
|
|
84
83
|
} );
|
|
85
84
|
|
|
86
85
|
export { Popup };
|