@wordpress/components 28.10.0 → 28.11.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/build/autocomplete/autocompleter-ui.js +2 -6
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.native.js +2 -4
- package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build/autocomplete/index.js +4 -5
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/types.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +1 -0
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +6 -0
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-control/border-control/component.js +1 -0
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +6 -0
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +12 -12
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/color-palette/index.js +1 -1
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/index.native.js +1 -2
- package/build/color-palette/index.native.js.map +1 -1
- package/build/color-picker/index.native.js +0 -1
- package/build/color-picker/index.native.js.map +1 -1
- package/build/composite/legacy/index.js +5 -2
- package/build/composite/legacy/index.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/date-time/date/index.js +0 -1
- package/build/date-time/date/index.js.map +1 -1
- package/build/font-size-picker/index.native.js +6 -6
- package/build/font-size-picker/index.native.js.map +1 -1
- package/build/form-token-field/index.js +0 -3
- package/build/form-token-field/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +7 -3
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/{dropdown-menu-v2 → menu}/checkbox-item.js +8 -8
- package/build/menu/checkbox-item.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/context.js +2 -2
- package/build/menu/context.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/group-label.js +5 -5
- package/build/menu/group-label.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/group.js +5 -5
- package/build/menu/group.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/index.js +38 -38
- package/build/menu/index.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/item-help-text.js +3 -3
- package/build/menu/item-help-text.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/item-label.js +3 -3
- package/build/menu/item-label.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/item.js +7 -7
- package/build/menu/item.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/radio-item.js +8 -8
- package/build/menu/radio-item.js.map +1 -0
- package/build/{dropdown-menu-v2 → menu}/separator.js +6 -6
- package/build/menu/separator.js.map +1 -0
- package/build/menu/styles.js +150 -0
- package/build/menu/styles.js.map +1 -0
- package/build/menu/types.js.map +1 -0
- package/build/menu/use-temporary-focus-visible-fix.js.map +1 -0
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
- package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js +1 -1
- package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
- package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
- package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet-select-control/index.native.js +2 -2
- package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build/mobile/color-settings/index.native.js +1 -3
- package/build/mobile/color-settings/index.native.js.map +1 -1
- package/build/mobile/color-settings/picker-screen.native.js +1 -3
- package/build/mobile/color-settings/picker-screen.native.js.map +1 -1
- package/build/mobile/image/index.native.js +1 -3
- package/build/mobile/image/index.native.js.map +1 -1
- package/build/mobile/keyboard-avoiding-view/index.ios.js +1 -3
- package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build/mobile/link-picker/link-picker-results.native.js +2 -5
- package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build/mobile/link-picker/link-picker-screen.native.js +1 -3
- package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build/mobile/link-settings/index.native.js +6 -18
- package/build/mobile/link-settings/index.native.js.map +1 -1
- package/build/mobile/link-settings/link-settings-screen.native.js +1 -3
- package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
- package/build/mobile/segmented-control/index.native.js +2 -6
- package/build/mobile/segmented-control/index.native.js.map +1 -1
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
- package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build/navigation/index.js +1 -2
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/use-navigation-tree-item.js +2 -2
- package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +2 -2
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/use-navigation-tree-menu.js +2 -2
- package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
- package/build/palette-edit/index.js +4 -2
- package/build/palette-edit/index.js.map +1 -1
- package/build/palette-edit/styles.js +13 -28
- package/build/palette-edit/styles.js.map +1 -1
- package/build/private-apis.js +4 -4
- package/build/private-apis.js.map +1 -1
- package/build/radio-group/index.js +3 -1
- package/build/radio-group/index.js.map +1 -1
- package/build/sandbox/index.js +3 -6
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/index.native.js +1 -3
- package/build/sandbox/index.native.js.map +1 -1
- package/build/search-control/index.native.js +1 -3
- package/build/search-control/index.native.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +1 -2
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/fill.js +3 -6
- package/build/slot-fill/fill.js.map +1 -1
- package/build/spacer/hook.js +5 -3
- package/build/spacer/hook.js.map +1 -1
- package/build/tab-panel/index.js +4 -1
- package/build/tab-panel/index.js.map +1 -1
- package/build/tabs/index.js +48 -113
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/styles.js +12 -12
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tab.js +23 -6
- package/build/tabs/tab.js.map +1 -1
- package/build/tabs/tablist.js +24 -12
- package/build/tabs/tablist.js.map +1 -1
- package/build/tabs/types.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +2 -1
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toolbar/toolbar/index.js +3 -0
- package/build/toolbar/toolbar/index.js.map +1 -1
- package/build/tools-panel/tools-panel-header/component.js +1 -1
- package/build/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +0 -2
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tooltip/index.native.js +5 -15
- package/build/tooltip/index.native.js.map +1 -1
- package/build/unit-control/index.native.js +2 -6
- package/build/unit-control/index.native.js.map +1 -1
- package/build/utils/deprecated-36px-size.js +27 -0
- package/build/utils/deprecated-36px-size.js.map +1 -0
- package/build/utils/element-rect.js +13 -2
- package/build/utils/element-rect.js.map +1 -1
- package/build/utils/hooks/use-animated-offset-rect.js +3 -2
- package/build/utils/hooks/use-animated-offset-rect.js.map +1 -1
- package/build/utils/hooks/use-update-effect.js +0 -2
- package/build/utils/hooks/use-update-effect.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +2 -6
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.native.js +2 -4
- package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
- package/build-module/autocomplete/index.js +4 -5
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/types.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +1 -0
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control/hook.js +6 -0
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-control/border-control/component.js +1 -0
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +7 -0
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +12 -12
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/color-palette/index.js +1 -1
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/index.native.js +1 -2
- package/build-module/color-palette/index.native.js.map +1 -1
- package/build-module/color-picker/index.native.js +0 -1
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/composite/legacy/index.js +5 -2
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/date-time/date/index.js +0 -1
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/font-size-picker/index.native.js +7 -7
- package/build-module/font-size-picker/index.native.js.map +1 -1
- package/build-module/form-token-field/index.js +0 -3
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +7 -3
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/{dropdown-menu-v2 → menu}/checkbox-item.js +8 -8
- package/build-module/menu/checkbox-item.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/context.js +1 -1
- package/build-module/menu/context.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/group-label.js +5 -5
- package/build-module/menu/group-label.js.map +1 -0
- package/build-module/menu/group.js +21 -0
- package/build-module/menu/group.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/index.js +46 -46
- package/build-module/menu/index.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/item-help-text.js +2 -2
- package/build-module/menu/item-help-text.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/item-label.js +2 -2
- package/build-module/menu/item-label.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/item.js +7 -7
- package/build-module/menu/item.js.map +1 -0
- package/build-module/{dropdown-menu-v2 → menu}/radio-item.js +8 -8
- package/build-module/menu/radio-item.js.map +1 -0
- package/build-module/menu/separator.js +22 -0
- package/build-module/menu/separator.js.map +1 -0
- package/build-module/menu/styles.js +143 -0
- package/build-module/menu/styles.js.map +1 -0
- package/build-module/menu/types.js.map +1 -0
- package/build-module/menu/use-temporary-focus-visible-fix.js.map +1 -0
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
- package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js +1 -1
- package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
- package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
- package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-select-control/index.native.js +2 -2
- package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/index.native.js +1 -3
- package/build-module/mobile/color-settings/index.native.js.map +1 -1
- package/build-module/mobile/color-settings/picker-screen.native.js +1 -3
- package/build-module/mobile/color-settings/picker-screen.native.js.map +1 -1
- package/build-module/mobile/image/index.native.js +1 -3
- package/build-module/mobile/image/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js +1 -3
- package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-results.native.js +2 -5
- package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
- package/build-module/mobile/link-picker/link-picker-screen.native.js +1 -3
- package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
- package/build-module/mobile/link-settings/index.native.js +6 -18
- package/build-module/mobile/link-settings/index.native.js.map +1 -1
- package/build-module/mobile/link-settings/link-settings-screen.native.js +1 -3
- package/build-module/mobile/link-settings/link-settings-screen.native.js.map +1 -1
- package/build-module/mobile/segmented-control/index.native.js +2 -6
- package/build-module/mobile/segmented-control/index.native.js.map +1 -1
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
- package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
- package/build-module/navigation/index.js +1 -2
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/item/use-navigation-tree-item.js +2 -2
- package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +2 -2
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/use-navigation-tree-menu.js +2 -2
- package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
- package/build-module/palette-edit/index.js +6 -4
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/palette-edit/styles.js +13 -29
- package/build-module/palette-edit/styles.js.map +1 -1
- package/build-module/private-apis.js +3 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/radio-group/index.js +3 -1
- package/build-module/radio-group/index.js.map +1 -1
- package/build-module/sandbox/index.js +3 -6
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +1 -3
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/search-control/index.native.js +1 -3
- package/build-module/search-control/index.native.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +1 -2
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/fill.js +3 -6
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/spacer/hook.js +5 -3
- package/build-module/spacer/hook.js.map +1 -1
- package/build-module/tab-panel/index.js +4 -1
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/tabs/index.js +47 -112
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/styles.js +11 -11
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tab.js +21 -6
- package/build-module/tabs/tab.js.map +1 -1
- package/build-module/tabs/tablist.js +24 -12
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/tabs/types.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +2 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toolbar/toolbar/index.js +3 -0
- package/build-module/toolbar/toolbar/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js +1 -1
- package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +0 -2
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tooltip/index.native.js +5 -15
- package/build-module/tooltip/index.native.js.map +1 -1
- package/build-module/unit-control/index.native.js +2 -6
- package/build-module/unit-control/index.native.js.map +1 -1
- package/build-module/utils/deprecated-36px-size.js +19 -0
- package/build-module/utils/deprecated-36px-size.js.map +1 -0
- package/build-module/utils/element-rect.js +13 -2
- package/build-module/utils/element-rect.js.map +1 -1
- package/build-module/utils/hooks/use-animated-offset-rect.js +3 -2
- package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -1
- package/build-module/utils/hooks/use-update-effect.js +0 -2
- package/build-module/utils/hooks/use-update-effect.js.map +1 -1
- package/build-style/style-rtl.css +6 -6
- package/build-style/style.css +6 -6
- package/build-types/animate/stories/index.story.d.ts.map +1 -1
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts.map +1 -1
- package/build-types/base-control/types.d.ts +3 -0
- package/build-types/base-control/types.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/component.d.ts +1 -0
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +1 -0
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/stories/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/card/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/legacy/index.d.ts.map +1 -1
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/disabled/stories/index.story.d.ts.map +1 -1
- package/build-types/draggable/stories/index.story.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
- package/build-types/item-group/stories/index.story.d.ts +1 -1
- package/build-types/item-group/stories/index.story.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/checkbox-item.d.ts +3 -0
- package/build-types/menu/checkbox-item.d.ts.map +1 -0
- package/build-types/menu/context.d.ts +6 -0
- package/build-types/menu/context.d.ts.map +1 -0
- package/build-types/menu/group-label.d.ts +3 -0
- package/build-types/menu/group-label.d.ts.map +1 -0
- package/build-types/menu/group.d.ts +3 -0
- package/build-types/menu/group.d.ts.map +1 -0
- package/build-types/menu/index.d.ts +40 -0
- package/build-types/menu/index.d.ts.map +1 -0
- package/build-types/{dropdown-menu-v2 → menu}/item-help-text.d.ts +1 -1
- package/build-types/menu/item-help-text.d.ts.map +1 -0
- package/build-types/{dropdown-menu-v2 → menu}/item-label.d.ts +1 -1
- package/build-types/menu/item-label.d.ts.map +1 -0
- package/build-types/menu/item.d.ts +3 -0
- package/build-types/menu/item.d.ts.map +1 -0
- package/build-types/menu/radio-item.d.ts +3 -0
- package/build-types/menu/radio-item.d.ts.map +1 -0
- package/build-types/menu/separator.d.ts +3 -0
- package/build-types/menu/separator.d.ts.map +1 -0
- package/build-types/menu/stories/index.story.d.ts +16 -0
- package/build-types/menu/stories/index.story.d.ts.map +1 -0
- package/build-types/{dropdown-menu-v2 → menu}/styles.d.ts +13 -13
- package/build-types/menu/styles.d.ts.map +1 -0
- package/build-types/menu/test/index.d.ts.map +1 -0
- package/build-types/{dropdown-menu-v2 → menu}/types.d.ts +22 -21
- package/build-types/menu/types.d.ts.map +1 -0
- package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +1 -0
- package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
- package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
- package/build-types/navigation/index.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts.map +1 -1
- package/build-types/palette-edit/styles.d.ts +0 -256
- package/build-types/palette-edit/styles.d.ts.map +1 -1
- package/build-types/panel/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
- package/build-types/sandbox/index.d.ts.map +1 -1
- package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
- package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
- package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts +21 -8
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts +1 -1
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts +6 -3
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tab.d.ts +0 -3
- package/build-types/tabs/tab.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/tabs/types.d.ts +85 -48
- package/build-types/tabs/types.d.ts.map +1 -1
- package/build-types/theme/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/utils/deprecated-36px-size.d.ts +6 -0
- package/build-types/utils/deprecated-36px-size.d.ts.map +1 -0
- package/build-types/utils/element-rect.d.ts +1 -1
- package/build-types/utils/element-rect.d.ts.map +1 -1
- package/build-types/utils/hooks/use-animated-offset-rect.d.ts +8 -1
- package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -1
- package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
- package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
- package/package.json +20 -19
- package/src/alignment-matrix-control/README.md +1 -2
- package/src/angle-picker-control/README.md +1 -2
- package/src/animate/stories/index.story.tsx +2 -1
- package/src/autocomplete/autocompleter-ui.native.js +2 -4
- package/src/autocomplete/autocompleter-ui.tsx +2 -6
- package/src/autocomplete/index.tsx +4 -5
- package/src/base-control/README.md +58 -47
- package/src/base-control/docs-manifest.json +12 -0
- package/src/base-control/stories/index.story.tsx +4 -0
- package/src/base-control/types.ts +3 -0
- package/src/border-box-control/border-box-control/README.md +1 -0
- package/src/border-box-control/border-box-control/component.tsx +1 -0
- package/src/border-box-control/border-box-control/hook.ts +7 -0
- package/src/border-box-control/stories/index.story.tsx +1 -0
- package/src/border-box-control/test/index.tsx +1 -0
- package/src/border-control/border-control/README.md +1 -0
- package/src/border-control/border-control/component.tsx +1 -0
- package/src/border-control/border-control/hook.ts +7 -1
- package/src/border-control/border-control-dropdown/component.tsx +24 -12
- package/src/border-control/stories/index.story.tsx +1 -0
- package/src/border-control/test/index.js +1 -0
- package/src/button/stories/index.story.tsx +2 -1
- package/src/card/stories/index.story.tsx +2 -1
- package/src/color-palette/index.native.js +1 -2
- package/src/color-palette/index.tsx +1 -1
- package/src/color-palette/style.scss +2 -4
- package/src/color-picker/index.native.js +0 -1
- package/src/composite/legacy/index.tsx +5 -2
- package/src/composite/stories/index.story.tsx +2 -1
- package/src/custom-gradient-picker/gradient-bar/control-points.tsx +1 -1
- package/src/date-time/date/index.tsx +0 -1
- package/src/disabled/stories/index.story.tsx +2 -1
- package/src/draggable/stories/index.story.tsx +2 -1
- package/src/font-size-picker/index.native.js +7 -7
- package/src/form-token-field/index.tsx +0 -3
- package/src/form-token-field/style.scss +4 -1
- package/src/form-token-field/suggestions-list.tsx +6 -0
- package/src/item-group/stories/index.story.tsx +8 -4
- package/src/keyboard-shortcuts/stories/index.story.tsx +2 -1
- package/src/{dropdown-menu-v2 → menu}/README.md +34 -34
- package/src/{dropdown-menu-v2 → menu}/checkbox-item.tsx +14 -14
- package/src/menu/context.tsx +13 -0
- package/src/{dropdown-menu-v2 → menu}/group-label.tsx +8 -8
- package/src/menu/group.tsx +26 -0
- package/src/{dropdown-menu-v2 → menu}/index.tsx +65 -70
- package/src/{dropdown-menu-v2 → menu}/item-help-text.tsx +3 -7
- package/src/{dropdown-menu-v2 → menu}/item-label.tsx +3 -7
- package/src/{dropdown-menu-v2 → menu}/item.tsx +13 -13
- package/src/{dropdown-menu-v2 → menu}/radio-item.tsx +14 -14
- package/src/menu/separator.tsx +27 -0
- package/src/menu/stories/index.story.tsx +542 -0
- package/src/{dropdown-menu-v2 → menu}/styles.ts +17 -17
- package/src/{dropdown-menu-v2 → menu}/test/index.tsx +145 -225
- package/src/{dropdown-menu-v2 → menu}/types.ts +24 -23
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
- package/src/mobile/bottom-sheet/range-cell.native.js +1 -1
- package/src/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
- package/src/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
- package/src/mobile/bottom-sheet-select-control/index.native.js +2 -2
- package/src/mobile/color-settings/index.native.js +1 -3
- package/src/mobile/color-settings/picker-screen.native.js +1 -3
- package/src/mobile/image/index.native.js +1 -3
- package/src/mobile/keyboard-avoiding-view/index.ios.js +1 -3
- package/src/mobile/link-picker/link-picker-results.native.js +2 -5
- package/src/mobile/link-picker/link-picker-screen.native.js +1 -3
- package/src/mobile/link-settings/index.native.js +6 -18
- package/src/mobile/link-settings/link-settings-screen.native.js +1 -3
- package/src/mobile/segmented-control/index.native.js +2 -6
- package/src/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
- package/src/navigable-container/stories/navigable-menu.story.tsx +2 -1
- package/src/navigable-container/stories/tabbable-container.story.tsx +2 -1
- package/src/navigation/index.tsx +1 -2
- package/src/navigation/item/use-navigation-tree-item.tsx +2 -2
- package/src/navigation/menu/menu-title-search.tsx +2 -2
- package/src/navigation/menu/use-navigation-tree-menu.tsx +2 -2
- package/src/palette-edit/index.tsx +4 -5
- package/src/palette-edit/styles.ts +1 -67
- package/src/panel/stories/index.story.tsx +2 -1
- package/src/private-apis.ts +3 -3
- package/src/radio-group/index.tsx +2 -0
- package/src/resizable-box/stories/index.story.tsx +2 -1
- package/src/sandbox/index.native.js +1 -3
- package/src/sandbox/index.tsx +3 -6
- package/src/sandbox/stories/index.story.tsx +2 -1
- package/src/scroll-lock/stories/index.story.tsx +2 -1
- package/src/search-control/index.native.js +1 -3
- package/src/shortcut/stories/index.story.tsx +2 -1
- package/src/slot-fill/bubbles-virtually/slot.tsx +1 -2
- package/src/slot-fill/fill.ts +3 -6
- package/src/slot-fill/stories/index.story.tsx +2 -1
- package/src/spacer/hook.ts +3 -2
- package/src/tab-panel/index.tsx +3 -0
- package/src/tab-panel/stories/index.story.tsx +2 -1
- package/src/tab-panel/style.scss +1 -3
- package/src/tabs/README.md +63 -21
- package/src/tabs/index.tsx +112 -189
- package/src/tabs/stories/index.story.tsx +5 -2
- package/src/tabs/styles.ts +13 -5
- package/src/tabs/tab.tsx +23 -3
- package/src/tabs/tablist.tsx +31 -15
- package/src/tabs/test/index.tsx +131 -118
- package/src/tabs/types.ts +89 -49
- package/src/theme/stories/index.story.tsx +2 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +1 -0
- package/src/toolbar/toolbar/index.tsx +3 -0
- package/src/tools-panel/tools-panel-header/component.tsx +1 -1
- package/src/tools-panel/tools-panel-item/hook.ts +0 -2
- package/src/tooltip/index.native.js +5 -15
- package/src/unit-control/index.native.js +2 -6
- package/src/utils/deprecated-36px-size.ts +24 -0
- package/src/utils/element-rect.ts +14 -2
- package/src/utils/hooks/use-animated-offset-rect.ts +13 -1
- package/src/utils/hooks/use-update-effect.js +0 -2
- package/src/visually-hidden/stories/index.story.tsx +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/dropdown-menu-v2/checkbox-item.js.map +0 -1
- package/build/dropdown-menu-v2/context.js.map +0 -1
- package/build/dropdown-menu-v2/group-label.js.map +0 -1
- package/build/dropdown-menu-v2/group.js.map +0 -1
- package/build/dropdown-menu-v2/index.js.map +0 -1
- package/build/dropdown-menu-v2/item-help-text.js.map +0 -1
- package/build/dropdown-menu-v2/item-label.js.map +0 -1
- package/build/dropdown-menu-v2/item.js.map +0 -1
- package/build/dropdown-menu-v2/radio-item.js.map +0 -1
- package/build/dropdown-menu-v2/separator.js.map +0 -1
- package/build/dropdown-menu-v2/styles.js +0 -150
- package/build/dropdown-menu-v2/styles.js.map +0 -1
- package/build/dropdown-menu-v2/types.js.map +0 -1
- package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
- package/build-module/dropdown-menu-v2/checkbox-item.js.map +0 -1
- package/build-module/dropdown-menu-v2/context.js.map +0 -1
- package/build-module/dropdown-menu-v2/group-label.js.map +0 -1
- package/build-module/dropdown-menu-v2/group.js +0 -21
- package/build-module/dropdown-menu-v2/group.js.map +0 -1
- package/build-module/dropdown-menu-v2/index.js.map +0 -1
- package/build-module/dropdown-menu-v2/item-help-text.js.map +0 -1
- package/build-module/dropdown-menu-v2/item-label.js.map +0 -1
- package/build-module/dropdown-menu-v2/item.js.map +0 -1
- package/build-module/dropdown-menu-v2/radio-item.js.map +0 -1
- package/build-module/dropdown-menu-v2/separator.js +0 -22
- package/build-module/dropdown-menu-v2/separator.js.map +0 -1
- package/build-module/dropdown-menu-v2/styles.js +0 -143
- package/build-module/dropdown-menu-v2/styles.js.map +0 -1
- package/build-module/dropdown-menu-v2/types.js.map +0 -1
- package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
- package/build-types/dropdown-menu-v2/checkbox-item.d.ts +0 -3
- package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/context.d.ts +0 -6
- package/build-types/dropdown-menu-v2/context.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/group-label.d.ts +0 -3
- package/build-types/dropdown-menu-v2/group-label.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/group.d.ts +0 -3
- package/build-types/dropdown-menu-v2/group.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/index.d.ts +0 -40
- package/build-types/dropdown-menu-v2/index.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/item-label.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/item.d.ts +0 -3
- package/build-types/dropdown-menu-v2/item.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/radio-item.d.ts +0 -3
- package/build-types/dropdown-menu-v2/radio-item.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/separator.d.ts +0 -3
- package/build-types/dropdown-menu-v2/separator.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts +0 -16
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/styles.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/test/index.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/types.d.ts.map +0 -1
- package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +0 -1
- package/src/dropdown-menu-v2/context.tsx +0 -13
- package/src/dropdown-menu-v2/group.tsx +0 -26
- package/src/dropdown-menu-v2/separator.tsx +0 -27
- package/src/dropdown-menu-v2/stories/index.story.tsx +0 -639
- /package/build/{dropdown-menu-v2 → menu}/types.js +0 -0
- /package/build/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
- /package/build-module/{dropdown-menu-v2 → menu}/types.js +0 -0
- /package/build-module/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
- /package/build-types/{dropdown-menu-v2 → menu}/test/index.d.ts +0 -0
- /package/build-types/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.d.ts +0 -0
- /package/src/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.ts +0 -0
|
@@ -124,17 +124,14 @@ export function FormTokenField( props: FormTokenFieldProps ) {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
// TODO: updateSuggestions() should first be refactored so its actual deps are clearer.
|
|
127
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
128
127
|
}, [ suggestions, prevSuggestions, value, prevValue ] );
|
|
129
128
|
|
|
130
129
|
useEffect( () => {
|
|
131
130
|
updateSuggestions();
|
|
132
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
133
131
|
}, [ incompleteTokenValue ] );
|
|
134
132
|
|
|
135
133
|
useEffect( () => {
|
|
136
134
|
updateSuggestions();
|
|
137
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
138
135
|
}, [ __experimentalAutoSelectFirstMatch ] );
|
|
139
136
|
|
|
140
137
|
if ( disabled && isActive ) {
|
|
@@ -173,7 +173,6 @@
|
|
|
173
173
|
padding: $grid-unit-10 $grid-unit-15;
|
|
174
174
|
min-height: $button-size-compact;
|
|
175
175
|
margin: 0;
|
|
176
|
-
cursor: pointer;
|
|
177
176
|
box-sizing: border-box;
|
|
178
177
|
|
|
179
178
|
&.is-selected {
|
|
@@ -189,4 +188,8 @@
|
|
|
189
188
|
background-color: $components-color-accent-transparent-40;
|
|
190
189
|
}
|
|
191
190
|
}
|
|
191
|
+
|
|
192
|
+
&:not(.is-empty) {
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
}
|
|
192
195
|
}
|
|
@@ -8,6 +8,7 @@ import type { MouseEventHandler, ReactNode } from 'react';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { useRefEffect } from '@wordpress/compose';
|
|
11
|
+
import { __ } from '@wordpress/i18n';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Internal dependencies
|
|
@@ -156,6 +157,11 @@ export function SuggestionsList<
|
|
|
156
157
|
);
|
|
157
158
|
/* eslint-enable jsx-a11y/click-events-have-key-events */
|
|
158
159
|
} ) }
|
|
160
|
+
{ suggestions.length === 0 && (
|
|
161
|
+
<li className="components-form-token-field__suggestion is-empty">
|
|
162
|
+
{ __( 'No items found' ) }
|
|
163
|
+
</li>
|
|
164
|
+
) }
|
|
159
165
|
</ul>
|
|
160
166
|
);
|
|
161
167
|
}
|
|
@@ -37,6 +37,8 @@ const Template: StoryFn< typeof ItemGroup > = ( props ) => (
|
|
|
37
37
|
|
|
38
38
|
export const Default: StoryFn< typeof ItemGroup > = Template.bind( {} );
|
|
39
39
|
Default.args = {
|
|
40
|
+
isBordered: true,
|
|
41
|
+
isSeparated: true,
|
|
40
42
|
children: (
|
|
41
43
|
[
|
|
42
44
|
{
|
|
@@ -67,6 +69,7 @@ export const NonClickableItems: StoryFn< typeof ItemGroup > = Template.bind(
|
|
|
67
69
|
{}
|
|
68
70
|
);
|
|
69
71
|
NonClickableItems.args = {
|
|
72
|
+
...Default.args,
|
|
70
73
|
children: (
|
|
71
74
|
[
|
|
72
75
|
{
|
|
@@ -83,6 +86,7 @@ NonClickableItems.args = {
|
|
|
83
86
|
|
|
84
87
|
export const CustomItemSize: StoryFn< typeof ItemGroup > = Template.bind( {} );
|
|
85
88
|
CustomItemSize.args = {
|
|
89
|
+
...Default.args,
|
|
86
90
|
children: (
|
|
87
91
|
[
|
|
88
92
|
{
|
|
@@ -98,9 +102,9 @@ CustomItemSize.args = {
|
|
|
98
102
|
).map( mapPropsToItem ),
|
|
99
103
|
};
|
|
100
104
|
|
|
101
|
-
export const
|
|
102
|
-
|
|
105
|
+
export const WithoutBorder: StoryFn< typeof ItemGroup > = Template.bind( {} );
|
|
106
|
+
WithoutBorder.args = {
|
|
103
107
|
...Default.args,
|
|
104
|
-
isBordered:
|
|
105
|
-
isSeparated:
|
|
108
|
+
isBordered: false,
|
|
109
|
+
isSeparated: false,
|
|
106
110
|
};
|
|
@@ -10,7 +10,8 @@ import KeyboardShortcuts from '..';
|
|
|
10
10
|
|
|
11
11
|
const meta: Meta< typeof KeyboardShortcuts > = {
|
|
12
12
|
component: KeyboardShortcuts,
|
|
13
|
-
title: 'Components/KeyboardShortcuts',
|
|
13
|
+
title: 'Components/Utilities/KeyboardShortcuts',
|
|
14
|
+
id: 'components-keyboardshortcuts',
|
|
14
15
|
parameters: {
|
|
15
16
|
controls: { expanded: true },
|
|
16
17
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
# `
|
|
1
|
+
# `Menu`
|
|
2
2
|
|
|
3
3
|
<div class="callout callout-alert">
|
|
4
4
|
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
|
-
`
|
|
7
|
+
`Menu` displays a menu to the user (such as a set of actions or functions). The menu is rendered in a popover (this pattern is also known as a "Dropdown menu"), which is triggered by a button.
|
|
8
8
|
|
|
9
9
|
## Design guidelines
|
|
10
10
|
|
|
11
11
|
### Usage
|
|
12
12
|
|
|
13
|
-
#### When to use a
|
|
13
|
+
#### When to use a `Menu`
|
|
14
14
|
|
|
15
|
-
Use a
|
|
15
|
+
Use a `Menu` when you want users to:
|
|
16
16
|
|
|
17
17
|
- Choose an action or change a setting from a list, AND
|
|
18
18
|
- Only see the available choices contextually.
|
|
19
19
|
|
|
20
|
-
`
|
|
20
|
+
`Menu` is a React component to render an expandable menu of buttons. It is similar in purpose to a `<select>` element, with the distinction that it does not maintain a value. Instead, each option behaves as an action button.
|
|
21
21
|
|
|
22
|
-
If you need to display all the available options at all times, consider using a Toolbar instead. Use a `
|
|
22
|
+
If you need to display all the available options at all times, consider using a Toolbar instead. Use a `Menu` to display a list of actions after the user interacts with a button.
|
|
23
23
|
|
|
24
24
|
**Do**
|
|
25
|
-
Use a `
|
|
25
|
+
Use a `Menu` to display a list of actions after the user interacts with an icon.
|
|
26
26
|
|
|
27
|
-
**Don’t** use a `
|
|
27
|
+
**Don’t** use a `Menu` for important actions that should always be visible. Use a `Toolbar` instead.
|
|
28
28
|
|
|
29
29
|
**Don’t**
|
|
30
|
-
Don’t use a `
|
|
30
|
+
Don’t use a `Menu` for frequently used actions. Use a `Toolbar` instead.
|
|
31
31
|
|
|
32
32
|
#### Behavior
|
|
33
33
|
|
|
34
|
-
Generally, the parent button should indicate that interacting with it will show a `
|
|
34
|
+
Generally, the parent button should indicate that interacting with it will show a `Menu`.
|
|
35
35
|
|
|
36
|
-
The parent button should retain the same visual styling regardless of whether the `
|
|
36
|
+
The parent button should retain the same visual styling regardless of whether the `Menu` is displayed or not.
|
|
37
37
|
|
|
38
38
|
#### Placement
|
|
39
39
|
|
|
40
|
-
The `
|
|
40
|
+
The `Menu` should typically appear directly below, or below and to the left of, the parent button. If there isn’t enough space below to display the full `Menu`, it can be displayed instead above the parent button.
|
|
41
41
|
|
|
42
42
|
## Development guidelines
|
|
43
43
|
|
|
44
44
|
This component is still highly experimental, and it's not normally accessible to consumers of the `@wordpress/components` package.
|
|
45
45
|
|
|
46
|
-
The component exposes a set of components that are meant to be used in combination with each other in order to implement a `
|
|
46
|
+
The component exposes a set of components that are meant to be used in combination with each other in order to implement a `Menu` correctly.
|
|
47
47
|
|
|
48
|
-
### `
|
|
48
|
+
### `Menu`
|
|
49
49
|
|
|
50
50
|
The root component, used to specify the menu's trigger and its contents.
|
|
51
51
|
|
|
@@ -55,45 +55,45 @@ The component accepts the following props:
|
|
|
55
55
|
|
|
56
56
|
##### `trigger`: `React.ReactNode`
|
|
57
57
|
|
|
58
|
-
The
|
|
58
|
+
The button triggering the menu popover.
|
|
59
59
|
|
|
60
60
|
- Required: yes
|
|
61
61
|
|
|
62
62
|
##### `children`: `React.ReactNode`
|
|
63
63
|
|
|
64
|
-
The contents of the
|
|
64
|
+
The contents of the menu (ie. one or more menu items).
|
|
65
65
|
|
|
66
66
|
- Required: yes
|
|
67
67
|
|
|
68
68
|
##### `defaultOpen`: `boolean`
|
|
69
69
|
|
|
70
|
-
The open state of the
|
|
70
|
+
The open state of the menu popover when it is initially rendered. Use when not wanting to control its open state.
|
|
71
71
|
|
|
72
72
|
- Required: no
|
|
73
73
|
- Default: `false`
|
|
74
74
|
|
|
75
75
|
##### `open`: `boolean`
|
|
76
76
|
|
|
77
|
-
The controlled open state of the
|
|
77
|
+
The controlled open state of the menu popover. Must be used in conjunction with `onOpenChange`.
|
|
78
78
|
|
|
79
79
|
- Required: no
|
|
80
80
|
|
|
81
81
|
##### `onOpenChange`: `(open: boolean) => void`
|
|
82
82
|
|
|
83
|
-
Event handler called when the open state of the
|
|
83
|
+
Event handler called when the open state of the menu popover changes.
|
|
84
84
|
|
|
85
85
|
- Required: no
|
|
86
86
|
|
|
87
87
|
##### `modal`: `boolean`
|
|
88
88
|
|
|
89
|
-
The modality of the
|
|
89
|
+
The modality of the menu popover. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.
|
|
90
90
|
|
|
91
91
|
- Required: no
|
|
92
92
|
- Default: `true`
|
|
93
93
|
|
|
94
94
|
##### `placement`: ``'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end'`
|
|
95
95
|
|
|
96
|
-
The placement of the
|
|
96
|
+
The placement of the menu popover.
|
|
97
97
|
|
|
98
98
|
- Required: no
|
|
99
99
|
- Default: `'bottom-start'` for root-level menus, `'right-start'` for nested menus
|
|
@@ -112,7 +112,7 @@ The skidding of the popover along the anchor element. Can be set to negative val
|
|
|
112
112
|
- Required: no
|
|
113
113
|
- Default: `0` for root-level menus, `-8` for nested menus
|
|
114
114
|
|
|
115
|
-
### `
|
|
115
|
+
### `Menu.Item`
|
|
116
116
|
|
|
117
117
|
Used to render a menu item.
|
|
118
118
|
|
|
@@ -140,7 +140,7 @@ The contents of the item's suffix.
|
|
|
140
140
|
|
|
141
141
|
##### `hideOnClick`: `boolean`
|
|
142
142
|
|
|
143
|
-
Whether to hide the
|
|
143
|
+
Whether to hide the menu popover when the menu item is clicked.
|
|
144
144
|
|
|
145
145
|
- Required: no
|
|
146
146
|
- Default: `true`
|
|
@@ -152,7 +152,7 @@ Determines if the element is disabled.
|
|
|
152
152
|
- Required: no
|
|
153
153
|
- Default: `false`
|
|
154
154
|
|
|
155
|
-
### `
|
|
155
|
+
### `Menu.CheckboxItem`
|
|
156
156
|
|
|
157
157
|
Used to render a checkbox item.
|
|
158
158
|
|
|
@@ -174,7 +174,7 @@ The contents of the item's suffix.
|
|
|
174
174
|
|
|
175
175
|
##### `hideOnClick`: `boolean`
|
|
176
176
|
|
|
177
|
-
Whether to hide the
|
|
177
|
+
Whether to hide the menu popover when the menu item is clicked.
|
|
178
178
|
|
|
179
179
|
- Required: no
|
|
180
180
|
- Default: `false`
|
|
@@ -218,7 +218,7 @@ Event handler called when the checked state of the checkbox menu item changes.
|
|
|
218
218
|
|
|
219
219
|
- Required: no
|
|
220
220
|
|
|
221
|
-
### `
|
|
221
|
+
### `Menu.RadioItem`
|
|
222
222
|
|
|
223
223
|
Used to render a radio item.
|
|
224
224
|
|
|
@@ -240,7 +240,7 @@ The contents of the item's suffix.
|
|
|
240
240
|
|
|
241
241
|
##### `hideOnClick`: `boolean`
|
|
242
242
|
|
|
243
|
-
Whether to hide the
|
|
243
|
+
Whether to hide the menu popover when the menu item is clicked.
|
|
244
244
|
|
|
245
245
|
- Required: no
|
|
246
246
|
- Default: `false`
|
|
@@ -283,7 +283,7 @@ Event handler called when the checked radio menu item changes.
|
|
|
283
283
|
|
|
284
284
|
- Required: no
|
|
285
285
|
|
|
286
|
-
### `
|
|
286
|
+
### `Menu.ItemLabel`
|
|
287
287
|
|
|
288
288
|
Used to render the menu item's label.
|
|
289
289
|
|
|
@@ -297,7 +297,7 @@ The label contents.
|
|
|
297
297
|
|
|
298
298
|
- Required: yes
|
|
299
299
|
|
|
300
|
-
### `
|
|
300
|
+
### `Menu.ItemHelpText`
|
|
301
301
|
|
|
302
302
|
Used to render the menu item's help text.
|
|
303
303
|
|
|
@@ -311,7 +311,7 @@ The help text contents.
|
|
|
311
311
|
|
|
312
312
|
- Required: yes
|
|
313
313
|
|
|
314
|
-
### `
|
|
314
|
+
### `Menu.Group`
|
|
315
315
|
|
|
316
316
|
Used to group menu items.
|
|
317
317
|
|
|
@@ -321,11 +321,11 @@ The component accepts the following props:
|
|
|
321
321
|
|
|
322
322
|
##### `children`: `React.ReactNode`
|
|
323
323
|
|
|
324
|
-
The contents of the group.
|
|
324
|
+
The contents of the menu group (ie. an optional menu group label and one or more menu items).
|
|
325
325
|
|
|
326
326
|
- Required: yes
|
|
327
327
|
|
|
328
|
-
### `
|
|
328
|
+
### `Menu.GroupLabel`
|
|
329
329
|
|
|
330
330
|
Used to render a group label. The label text should be kept as short as possible.
|
|
331
331
|
|
|
@@ -335,10 +335,10 @@ The component accepts the following props:
|
|
|
335
335
|
|
|
336
336
|
##### `children`: `React.ReactNode`
|
|
337
337
|
|
|
338
|
-
The contents of the group label.
|
|
338
|
+
The contents of the menu group label.
|
|
339
339
|
|
|
340
340
|
- Required: yes
|
|
341
341
|
|
|
342
|
-
### `
|
|
342
|
+
### `Menu.Separator`
|
|
343
343
|
|
|
344
344
|
Used to render a visual separator.
|
|
@@ -13,33 +13,33 @@ import { Icon, check } from '@wordpress/icons';
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
import type { WordPressComponentProps } from '../context';
|
|
16
|
-
import {
|
|
17
|
-
import type {
|
|
16
|
+
import { MenuContext } from './context';
|
|
17
|
+
import type { MenuCheckboxItemProps } from './types';
|
|
18
18
|
import * as Styled from './styles';
|
|
19
19
|
import { useTemporaryFocusVisibleFix } from './use-temporary-focus-visible-fix';
|
|
20
20
|
|
|
21
|
-
export const
|
|
21
|
+
export const MenuCheckboxItem = forwardRef<
|
|
22
22
|
HTMLDivElement,
|
|
23
|
-
WordPressComponentProps<
|
|
24
|
-
>( function
|
|
23
|
+
WordPressComponentProps< MenuCheckboxItemProps, 'div', false >
|
|
24
|
+
>( function MenuCheckboxItem(
|
|
25
25
|
{ suffix, children, onBlur, hideOnClick = false, ...props },
|
|
26
26
|
ref
|
|
27
27
|
) {
|
|
28
28
|
// TODO: Remove when https://github.com/ariakit/ariakit/issues/4083 is fixed
|
|
29
29
|
const focusVisibleFixProps = useTemporaryFocusVisibleFix( { onBlur } );
|
|
30
|
-
const
|
|
30
|
+
const menuContext = useContext( MenuContext );
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<Styled.
|
|
33
|
+
<Styled.MenuCheckboxItem
|
|
34
34
|
ref={ ref }
|
|
35
35
|
{ ...props }
|
|
36
36
|
{ ...focusVisibleFixProps }
|
|
37
37
|
accessibleWhenDisabled
|
|
38
38
|
hideOnClick={ hideOnClick }
|
|
39
|
-
store={
|
|
39
|
+
store={ menuContext?.store }
|
|
40
40
|
>
|
|
41
41
|
<Ariakit.MenuItemCheck
|
|
42
|
-
store={
|
|
42
|
+
store={ menuContext?.store }
|
|
43
43
|
render={ <Styled.ItemPrefixWrapper /> }
|
|
44
44
|
// Override some ariakit inline styles
|
|
45
45
|
style={ { width: 'auto', height: 'auto' } }
|
|
@@ -47,17 +47,17 @@ export const DropdownMenuCheckboxItem = forwardRef<
|
|
|
47
47
|
<Icon icon={ check } size={ 24 } />
|
|
48
48
|
</Ariakit.MenuItemCheck>
|
|
49
49
|
|
|
50
|
-
<Styled.
|
|
51
|
-
<Styled.
|
|
50
|
+
<Styled.MenuItemContentWrapper>
|
|
51
|
+
<Styled.MenuItemChildrenWrapper>
|
|
52
52
|
{ children }
|
|
53
|
-
</Styled.
|
|
53
|
+
</Styled.MenuItemChildrenWrapper>
|
|
54
54
|
|
|
55
55
|
{ suffix && (
|
|
56
56
|
<Styled.ItemSuffixWrapper>
|
|
57
57
|
{ suffix }
|
|
58
58
|
</Styled.ItemSuffixWrapper>
|
|
59
59
|
) }
|
|
60
|
-
</Styled.
|
|
61
|
-
</Styled.
|
|
60
|
+
</Styled.MenuItemContentWrapper>
|
|
61
|
+
</Styled.MenuCheckboxItem>
|
|
62
62
|
);
|
|
63
63
|
} );
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { createContext } from '@wordpress/element';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import type { MenuContext as MenuContextType } from './types';
|
|
10
|
+
|
|
11
|
+
export const MenuContext = createContext< MenuContextType | undefined >(
|
|
12
|
+
undefined
|
|
13
|
+
);
|
|
@@ -7,18 +7,18 @@ import { forwardRef, useContext } from '@wordpress/element';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import type { WordPressComponentProps } from '../context';
|
|
10
|
-
import {
|
|
10
|
+
import { MenuContext } from './context';
|
|
11
11
|
import { Text } from '../text';
|
|
12
|
-
import type {
|
|
12
|
+
import type { MenuGroupLabelProps } from './types';
|
|
13
13
|
import * as Styled from './styles';
|
|
14
14
|
|
|
15
|
-
export const
|
|
15
|
+
export const MenuGroupLabel = forwardRef<
|
|
16
16
|
HTMLDivElement,
|
|
17
|
-
WordPressComponentProps<
|
|
18
|
-
>( function
|
|
19
|
-
const
|
|
17
|
+
WordPressComponentProps< MenuGroupLabelProps, 'div', false >
|
|
18
|
+
>( function MenuGroup( props, ref ) {
|
|
19
|
+
const menuContext = useContext( MenuContext );
|
|
20
20
|
return (
|
|
21
|
-
<Styled.
|
|
21
|
+
<Styled.MenuGroupLabel
|
|
22
22
|
ref={ ref }
|
|
23
23
|
render={
|
|
24
24
|
// @ts-expect-error The `children` prop is passed
|
|
@@ -31,7 +31,7 @@ export const DropdownMenuGroupLabel = forwardRef<
|
|
|
31
31
|
/>
|
|
32
32
|
}
|
|
33
33
|
{ ...props }
|
|
34
|
-
store={
|
|
34
|
+
store={ menuContext?.store }
|
|
35
35
|
/>
|
|
36
36
|
);
|
|
37
37
|
} );
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { forwardRef, useContext } from '@wordpress/element';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import type { WordPressComponentProps } from '../context';
|
|
10
|
+
import { MenuContext } from './context';
|
|
11
|
+
import type { MenuGroupProps } from './types';
|
|
12
|
+
import * as Styled from './styles';
|
|
13
|
+
|
|
14
|
+
export const MenuGroup = forwardRef<
|
|
15
|
+
HTMLDivElement,
|
|
16
|
+
WordPressComponentProps< MenuGroupProps, 'div', false >
|
|
17
|
+
>( function MenuGroup( props, ref ) {
|
|
18
|
+
const menuContext = useContext( MenuContext );
|
|
19
|
+
return (
|
|
20
|
+
<Styled.MenuGroup
|
|
21
|
+
ref={ ref }
|
|
22
|
+
{ ...props }
|
|
23
|
+
store={ menuContext?.store }
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
} );
|