@wordpress/components 28.10.0 → 28.12.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 +61 -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 +13 -13
- 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-file-upload/index.js +5 -1
- package/build/form-file-upload/index.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/form-token-field/token.js +1 -0
- package/build/form-token-field/token.js.map +1 -1
- package/build/guide/page-control.js +1 -0
- package/build/guide/page-control.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/menu-item/index.js +1 -0
- package/build/menu-item/index.js.map +1 -1
- 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/notice/index.js +2 -0
- package/build/notice/index.js.map +1 -1
- package/build/palette-edit/index.js +9 -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/panel/body.js +1 -0
- package/build/panel/body.js.map +1 -1
- package/build/popover/index.js +4 -1
- package/build/popover/index.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/radio-group/radio.js +6 -0
- package/build/radio-group/radio.js.map +1 -1
- package/build/radio-group/types.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/snackbar/index.js +2 -1
- package/build/snackbar/index.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 +37 -14
- 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 +3 -2
- 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 +13 -13
- 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-file-upload/index.js +5 -1
- package/build-module/form-file-upload/index.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/form-token-field/token.js +1 -0
- package/build-module/form-token-field/token.js.map +1 -1
- package/build-module/guide/page-control.js +1 -0
- package/build-module/guide/page-control.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/menu-item/index.js +1 -0
- package/build-module/menu-item/index.js.map +1 -1
- 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/notice/index.js +2 -0
- package/build-module/notice/index.js.map +1 -1
- package/build-module/palette-edit/index.js +11 -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/panel/body.js +1 -0
- package/build-module/panel/body.js.map +1 -1
- package/build-module/popover/index.js +4 -1
- package/build-module/popover/index.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/radio-group/radio.js +6 -0
- package/build-module/radio-group/radio.js.map +1 -1
- package/build-module/radio-group/types.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/snackbar/index.js +2 -1
- package/build-module/snackbar/index.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 +37 -14
- 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 +3 -2
- 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 +21 -35
- package/build-style/style.css +21 -35
- 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/confirm-dialog/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/dropdown/stories/index.story.d.ts.map +1 -1
- package/build-types/external-link/stories/index.story.d.ts.map +1 -1
- package/build-types/form-file-upload/index.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/form-token-field/token.d.ts.map +1 -1
- package/build-types/guide/page-control.d.ts.map +1 -1
- package/build-types/heading/stories/index.story.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/lock-unlock.d.ts +2 -2
- 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/menu-item/index.d.ts.map +1 -1
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- 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/navigator/stories/index.story.d.ts.map +1 -1
- package/build-types/notice/index.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.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/body.d.ts.map +1 -1
- package/build-types/panel/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts.map +1 -1
- package/build-types/radio-group/radio.d.ts +4 -2
- package/build-types/radio-group/radio.d.ts.map +1 -1
- package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
- package/build-types/radio-group/types.d.ts +5 -1
- package/build-types/radio-group/types.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/snackbar/index.d.ts.map +1 -1
- package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
- package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/spinner/stories/index.story.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/text/stories/index.story.d.ts.map +1 -1
- package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
- package/build-types/theme/stories/index.story.d.ts.map +1 -1
- package/build-types/tip/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/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/truncate/stories/index.story.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 +21 -20
- 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 +25 -13
- 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/confirm-dialog/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/dropdown/stories/index.story.tsx +2 -1
- package/src/external-link/stories/index.story.tsx +2 -1
- package/src/font-size-picker/index.native.js +7 -7
- package/src/form-file-upload/index.tsx +7 -1
- package/src/form-token-field/index.tsx +0 -3
- package/src/form-token-field/style.scss +12 -13
- package/src/form-token-field/suggestions-list.tsx +6 -0
- package/src/form-token-field/token.tsx +1 -0
- package/src/guide/page-control.tsx +1 -0
- package/src/guide/style.scss +4 -6
- package/src/heading/stories/index.story.tsx +2 -1
- 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 +543 -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/menu-item/index.tsx +1 -0
- package/src/menu-item/test/__snapshots__/index.js.snap +4 -4
- 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/modal/stories/index.story.tsx +2 -1
- 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/navigator/stories/index.story.tsx +2 -1
- package/src/notice/index.tsx +2 -0
- package/src/notice/stories/index.story.tsx +7 -2
- package/src/notice/test/__snapshots__/index.tsx.snap +4 -4
- package/src/palette-edit/index.tsx +9 -5
- package/src/palette-edit/styles.ts +1 -67
- package/src/panel/body.tsx +1 -0
- package/src/panel/stories/index.story.tsx +2 -1
- package/src/popover/index.tsx +3 -0
- package/src/popover/stories/index.story.tsx +2 -1
- package/src/private-apis.ts +3 -3
- package/src/progress-bar/stories/index.story.tsx +2 -1
- package/src/radio-group/README.md +8 -8
- package/src/radio-group/index.tsx +2 -0
- package/src/radio-group/radio.tsx +7 -0
- package/src/radio-group/stories/index.story.tsx +16 -4
- package/src/radio-group/types.ts +6 -1
- 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/snackbar/index.tsx +2 -1
- package/src/snackbar/stories/index.story.tsx +2 -1
- package/src/snackbar/stories/list.story.tsx +2 -1
- package/src/snackbar/style.scss +7 -16
- package/src/spacer/hook.ts +3 -2
- package/src/spinner/stories/index.story.tsx +2 -1
- 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 +44 -17
- package/src/tabs/test/index.tsx +131 -118
- package/src/tabs/types.ts +89 -49
- package/src/text/stories/index.story.tsx +2 -1
- package/src/text-highlight/stories/index.story.tsx +2 -1
- package/src/theme/stories/index.story.tsx +2 -1
- package/src/tip/stories/index.story.tsx +2 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +2 -1
- 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/tooltip/stories/index.story.tsx +2 -1
- package/src/tree-grid/stories/index.story.tsx +2 -1
- package/src/truncate/stories/index.story.tsx +2 -1
- package/src/unit-control/index.native.js +2 -6
- package/src/utils/deprecated-36px-size.ts +27 -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
|
@@ -23,6 +23,7 @@ export default function PageControl({
|
|
|
23
23
|
// Set aria-current="step" on the active page, see https://www.w3.org/TR/wai-aria-1.1/#aria-current
|
|
24
24
|
"aria-current": page === currentPage ? 'step' : undefined,
|
|
25
25
|
children: /*#__PURE__*/_jsx(Button, {
|
|
26
|
+
size: "small",
|
|
26
27
|
icon: /*#__PURE__*/_jsx(PageControlIcon, {}),
|
|
27
28
|
"aria-label": sprintf(/* translators: 1: current page number 2: total number of pages */
|
|
28
29
|
__('Page %1$d of %2$d'), page + 1, numberOfPages),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","Button","PageControlIcon","jsx","_jsx","PageControl","currentPage","numberOfPages","setCurrentPage","className","children","Array","from","length","map","_","page","undefined","icon","onClick"],"sources":["@wordpress/components/src/guide/page-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { PageControlIcon } from './icons';\nimport type { PageControlProps } from './types';\n\nexport default function PageControl( {\n\tcurrentPage,\n\tnumberOfPages,\n\tsetCurrentPage,\n}: PageControlProps ) {\n\treturn (\n\t\t<ul\n\t\t\tclassName=\"components-guide__page-control\"\n\t\t\taria-label={ __( 'Guide controls' ) }\n\t\t>\n\t\t\t{ Array.from( { length: numberOfPages } ).map( ( _, page ) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={ page }\n\t\t\t\t\t// Set aria-current=\"step\" on the active page, see https://www.w3.org/TR/wai-aria-1.1/#aria-current\n\t\t\t\t\taria-current={ page === currentPage ? 'step' : undefined }\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ page }\n\t\t\t\t\t\ticon={ <PageControlIcon /> }\n\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t/* translators: 1: current page number 2: total number of pages */\n\t\t\t\t\t\t\t__( 'Page %1$d of %2$d' ),\n\t\t\t\t\t\t\tpage + 1,\n\t\t\t\t\t\t\tnumberOfPages\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ () => setCurrentPage( page ) }\n\t\t\t\t\t/>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,eAAe,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG1C,eAAe,SAASC,WAAWA,CAAE;EACpCC,WAAW;EACXC,aAAa;EACbC;AACiB,CAAC,EAAG;EACrB,oBACCJ,IAAA;IACCK,SAAS,EAAC,gCAAgC;IAC1C,cAAaV,EAAE,CAAE,gBAAiB,CAAG;IAAAW,QAAA,EAEnCC,KAAK,CAACC,IAAI,CAAE;MAAEC,MAAM,EAAEN;IAAc,CAAE,CAAC,CAACO,GAAG,CAAE,CAAEC,CAAC,EAAEC,IAAI,kBACvDZ,IAAA;MAEC;MACA,gBAAeY,IAAI,KAAKV,WAAW,GAAG,MAAM,GAAGW,SAAW;MAAAP,QAAA,eAE1DN,IAAA,CAACH,MAAM;
|
|
1
|
+
{"version":3,"names":["__","sprintf","Button","PageControlIcon","jsx","_jsx","PageControl","currentPage","numberOfPages","setCurrentPage","className","children","Array","from","length","map","_","page","undefined","size","icon","onClick"],"sources":["@wordpress/components/src/guide/page-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { PageControlIcon } from './icons';\nimport type { PageControlProps } from './types';\n\nexport default function PageControl( {\n\tcurrentPage,\n\tnumberOfPages,\n\tsetCurrentPage,\n}: PageControlProps ) {\n\treturn (\n\t\t<ul\n\t\t\tclassName=\"components-guide__page-control\"\n\t\t\taria-label={ __( 'Guide controls' ) }\n\t\t>\n\t\t\t{ Array.from( { length: numberOfPages } ).map( ( _, page ) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={ page }\n\t\t\t\t\t// Set aria-current=\"step\" on the active page, see https://www.w3.org/TR/wai-aria-1.1/#aria-current\n\t\t\t\t\taria-current={ page === currentPage ? 'step' : undefined }\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tkey={ page }\n\t\t\t\t\t\ticon={ <PageControlIcon /> }\n\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t/* translators: 1: current page number 2: total number of pages */\n\t\t\t\t\t\t\t__( 'Page %1$d of %2$d' ),\n\t\t\t\t\t\t\tpage + 1,\n\t\t\t\t\t\t\tnumberOfPages\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ () => setCurrentPage( page ) }\n\t\t\t\t\t/>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,eAAe,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG1C,eAAe,SAASC,WAAWA,CAAE;EACpCC,WAAW;EACXC,aAAa;EACbC;AACiB,CAAC,EAAG;EACrB,oBACCJ,IAAA;IACCK,SAAS,EAAC,gCAAgC;IAC1C,cAAaV,EAAE,CAAE,gBAAiB,CAAG;IAAAW,QAAA,EAEnCC,KAAK,CAACC,IAAI,CAAE;MAAEC,MAAM,EAAEN;IAAc,CAAE,CAAC,CAACO,GAAG,CAAE,CAAEC,CAAC,EAAEC,IAAI,kBACvDZ,IAAA;MAEC;MACA,gBAAeY,IAAI,KAAKV,WAAW,GAAG,MAAM,GAAGW,SAAW;MAAAP,QAAA,eAE1DN,IAAA,CAACH,MAAM;QACNiB,IAAI,EAAC,OAAO;QAEZC,IAAI,eAAGf,IAAA,CAACF,eAAe,IAAE,CAAG;QAC5B,cAAaF,OAAO,CACnB;QACAD,EAAE,CAAE,mBAAoB,CAAC,EACzBiB,IAAI,GAAG,CAAC,EACRT,aACD,CAAG;QACHa,OAAO,EAAGA,CAAA,KAAMZ,cAAc,CAAEQ,IAAK;MAAG,GARlCA,IASN;IAAC,GAfIA,IAgBH,CACH;EAAC,CACA,CAAC;AAEP","ignoreList":[]}
|
|
@@ -13,11 +13,11 @@ import { Icon, check } from '@wordpress/icons';
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import { MenuContext } from './context';
|
|
17
17
|
import * as Styled from './styles';
|
|
18
18
|
import { useTemporaryFocusVisibleFix } from './use-temporary-focus-visible-fix';
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
export const
|
|
20
|
+
export const MenuCheckboxItem = forwardRef(function MenuCheckboxItem({
|
|
21
21
|
suffix,
|
|
22
22
|
children,
|
|
23
23
|
onBlur,
|
|
@@ -28,16 +28,16 @@ export const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckbox
|
|
|
28
28
|
const focusVisibleFixProps = useTemporaryFocusVisibleFix({
|
|
29
29
|
onBlur
|
|
30
30
|
});
|
|
31
|
-
const
|
|
32
|
-
return /*#__PURE__*/_jsxs(Styled.
|
|
31
|
+
const menuContext = useContext(MenuContext);
|
|
32
|
+
return /*#__PURE__*/_jsxs(Styled.MenuCheckboxItem, {
|
|
33
33
|
ref: ref,
|
|
34
34
|
...props,
|
|
35
35
|
...focusVisibleFixProps,
|
|
36
36
|
accessibleWhenDisabled: true,
|
|
37
37
|
hideOnClick: hideOnClick,
|
|
38
|
-
store:
|
|
38
|
+
store: menuContext?.store,
|
|
39
39
|
children: [/*#__PURE__*/_jsx(Ariakit.MenuItemCheck, {
|
|
40
|
-
store:
|
|
40
|
+
store: menuContext?.store,
|
|
41
41
|
render: /*#__PURE__*/_jsx(Styled.ItemPrefixWrapper, {})
|
|
42
42
|
// Override some ariakit inline styles
|
|
43
43
|
,
|
|
@@ -49,8 +49,8 @@ export const DropdownMenuCheckboxItem = forwardRef(function DropdownMenuCheckbox
|
|
|
49
49
|
icon: check,
|
|
50
50
|
size: 24
|
|
51
51
|
})
|
|
52
|
-
}), /*#__PURE__*/_jsxs(Styled.
|
|
53
|
-
children: [/*#__PURE__*/_jsx(Styled.
|
|
52
|
+
}), /*#__PURE__*/_jsxs(Styled.MenuItemContentWrapper, {
|
|
53
|
+
children: [/*#__PURE__*/_jsx(Styled.MenuItemChildrenWrapper, {
|
|
54
54
|
children: children
|
|
55
55
|
}), suffix && /*#__PURE__*/_jsx(Styled.ItemSuffixWrapper, {
|
|
56
56
|
children: suffix
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Ariakit","forwardRef","useContext","Icon","check","MenuContext","Styled","useTemporaryFocusVisibleFix","jsx","_jsx","jsxs","_jsxs","MenuCheckboxItem","suffix","children","onBlur","hideOnClick","props","ref","focusVisibleFixProps","menuContext","accessibleWhenDisabled","store","MenuItemCheck","render","ItemPrefixWrapper","style","width","height","icon","size","MenuItemContentWrapper","MenuItemChildrenWrapper","ItemSuffixWrapper"],"sources":["@wordpress/components/src/menu/checkbox-item.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\nimport { Icon, check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { MenuContext } from './context';\nimport type { MenuCheckboxItemProps } from './types';\nimport * as Styled from './styles';\nimport { useTemporaryFocusVisibleFix } from './use-temporary-focus-visible-fix';\n\nexport const MenuCheckboxItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuCheckboxItemProps, 'div', false >\n>( function MenuCheckboxItem(\n\t{ suffix, children, onBlur, hideOnClick = false, ...props },\n\tref\n) {\n\t// TODO: Remove when https://github.com/ariakit/ariakit/issues/4083 is fixed\n\tconst focusVisibleFixProps = useTemporaryFocusVisibleFix( { onBlur } );\n\tconst menuContext = useContext( MenuContext );\n\n\treturn (\n\t\t<Styled.MenuCheckboxItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\t{ ...focusVisibleFixProps }\n\t\t\taccessibleWhenDisabled\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ menuContext?.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ menuContext?.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t\t// Override some ariakit inline styles\n\t\t\t\tstyle={ { width: 'auto', height: 'auto' } }\n\t\t\t>\n\t\t\t\t<Icon icon={ check } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t<Styled.MenuItemContentWrapper>\n\t\t\t\t<Styled.MenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.MenuItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.MenuItemContentWrapper>\n\t\t</Styled.MenuCheckboxItem>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;;AAE9C;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AAEvC,OAAO,KAAKC,MA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AC;EAAA,CACR,CAAC;AAE5B,CAAE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","MenuContext","undefined"],"sources":["@wordpress/components/src/menu/context.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { MenuContext as MenuContextType } from './types';\n\nexport const MenuContext = createContext< MenuContextType | undefined >(\n\tundefined\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;;AAGA,OAAO,MAAMC,WAAW,GAAGD,aAAa,CACvCE,SACD,CAAC","ignoreList":[]}
|
|
@@ -7,13 +7,13 @@ import { forwardRef, useContext } from '@wordpress/element';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { MenuContext } from './context';
|
|
11
11
|
import { Text } from '../text';
|
|
12
12
|
import * as Styled from './styles';
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
export const
|
|
15
|
-
const
|
|
16
|
-
return /*#__PURE__*/_jsx(Styled.
|
|
14
|
+
export const MenuGroupLabel = forwardRef(function MenuGroup(props, ref) {
|
|
15
|
+
const menuContext = useContext(MenuContext);
|
|
16
|
+
return /*#__PURE__*/_jsx(Styled.MenuGroupLabel, {
|
|
17
17
|
ref: ref,
|
|
18
18
|
render:
|
|
19
19
|
/*#__PURE__*/
|
|
@@ -26,7 +26,7 @@ export const DropdownMenuGroupLabel = forwardRef(function DropdownMenuGroup(prop
|
|
|
26
26
|
lineHeight: "16px"
|
|
27
27
|
}),
|
|
28
28
|
...props,
|
|
29
|
-
store:
|
|
29
|
+
store: menuContext?.store
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
32
|
//# sourceMappingURL=group-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","useContext","MenuContext","Text","Styled","jsx","_jsx","MenuGroupLabel","MenuGroup","props","ref","menuContext","render","upperCase","variant","size","weight","lineHeight","store"],"sources":["@wordpress/components/src/menu/group-label.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { MenuContext } from './context';\nimport { Text } from '../text';\nimport type { MenuGroupLabelProps } from './types';\nimport * as Styled from './styles';\n\nexport const MenuGroupLabel = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuGroupLabelProps, 'div', false >\n>( function MenuGroup( props, ref ) {\n\tconst menuContext = useContext( MenuContext );\n\treturn (\n\t\t<Styled.MenuGroupLabel\n\t\t\tref={ ref }\n\t\t\trender={\n\t\t\t\t// @ts-expect-error The `children` prop is passed\n\t\t\t\t<Text\n\t\t\t\t\tupperCase\n\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\tsize=\"11px\"\n\t\t\t\t\tweight={ 500 }\n\t\t\t\t\tlineHeight=\"16px\"\n\t\t\t\t/>\n\t\t\t}\n\t\t\t{ ...props }\n\t\t\tstore={ menuContext?.store }\n\t\t/>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,IAAI,QAAQ,SAAS;AAE9B,OAAO,KAAKC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,OAAO,MAAMC,cAAc,GAAGP,UAAU,CAGrC,SAASQ,SAASA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACnC,MAAMC,WAAW,GAAGV,UAAU,CAAEC,WAAY,CAAC;EAC7C,oBACCI,IAAA,CAACF,MAAM,CAACG,cAAc;IACrBG,GAAG,EAAGA,GAAK;IACXE,MAAM;IAAA;IACL;IACAN,IAAA,CAACH,IAAI;MACJU,SAAS;MACTC,OAAO,EAAC,OAAO;MACfC,IAAI,EAAC,MAAM;MACXC,MAAM,EAAG,GAAK;MACdC,UAAU,EAAC;IAAM,CACjB,CACD;IAAA,GACIR,KAAK;IACVS,KAAK,EAAGP,WAAW,EAAEO;EAAO,CAC5B,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { forwardRef, useContext } from '@wordpress/element';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { MenuContext } from './context';
|
|
11
|
+
import * as Styled from './styles';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export const MenuGroup = forwardRef(function MenuGroup(props, ref) {
|
|
14
|
+
const menuContext = useContext(MenuContext);
|
|
15
|
+
return /*#__PURE__*/_jsx(Styled.MenuGroup, {
|
|
16
|
+
ref: ref,
|
|
17
|
+
...props,
|
|
18
|
+
store: menuContext?.store
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","useContext","MenuContext","Styled","jsx","_jsx","MenuGroup","props","ref","menuContext","store"],"sources":["@wordpress/components/src/menu/group.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { MenuContext } from './context';\nimport type { MenuGroupProps } from './types';\nimport * as Styled from './styles';\n\nexport const MenuGroup = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuGroupProps, 'div', false >\n>( function MenuGroup( props, ref ) {\n\tconst menuContext = useContext( MenuContext );\n\treturn (\n\t\t<Styled.MenuGroup\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ menuContext?.store }\n\t\t/>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AAEvC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,OAAO,MAAMC,SAAS,GAAGN,UAAU,CAGhC,SAASM,SAASA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACnC,MAAMC,WAAW,GAAGR,UAAU,CAAEC,WAAY,CAAC;EAC7C,oBACCG,IAAA,CAACF,MAAM,CAACG,SAAS;IAChBE,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVG,KAAK,EAAGD,WAAW,EAAEC;EAAO,CAC5B,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
|
|
@@ -16,17 +16,17 @@ import { chevronRightSmall } from '@wordpress/icons';
|
|
|
16
16
|
*/
|
|
17
17
|
import { useContextSystem, contextConnect } from '../context';
|
|
18
18
|
import * as Styled from './styles';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
19
|
+
import { MenuContext } from './context';
|
|
20
|
+
import { MenuItem } from './item';
|
|
21
|
+
import { MenuCheckboxItem } from './checkbox-item';
|
|
22
|
+
import { MenuRadioItem } from './radio-item';
|
|
23
|
+
import { MenuGroup } from './group';
|
|
24
|
+
import { MenuGroupLabel } from './group-label';
|
|
25
|
+
import { MenuSeparator } from './separator';
|
|
26
|
+
import { MenuItemLabel } from './item-label';
|
|
27
|
+
import { MenuItemHelpText } from './item-help-text';
|
|
28
28
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
-
const
|
|
29
|
+
const UnconnectedMenu = (props, ref) => {
|
|
30
30
|
var _props$placement;
|
|
31
31
|
const {
|
|
32
32
|
// Store props
|
|
@@ -45,13 +45,13 @@ const UnconnectedDropdownMenu = (props, ref) => {
|
|
|
45
45
|
variant,
|
|
46
46
|
// Rest
|
|
47
47
|
...otherProps
|
|
48
|
-
} = useContextSystem(props, '
|
|
49
|
-
const parentContext = useContext(
|
|
48
|
+
} = useContextSystem(props, 'Menu');
|
|
49
|
+
const parentContext = useContext(MenuContext);
|
|
50
50
|
const computedDirection = isRTL() ? 'rtl' : 'ltr';
|
|
51
51
|
|
|
52
52
|
// If an explicit value for the `placement` prop is not passed,
|
|
53
|
-
// apply a default placement of `bottom-start` for the root
|
|
54
|
-
// and of `right-start` for nested
|
|
53
|
+
// apply a default placement of `bottom-start` for the root menu popover,
|
|
54
|
+
// and of `right-start` for nested menu popovers.
|
|
55
55
|
let computedPlacement = (_props$placement = props.placement) !== null && _props$placement !== void 0 ? _props$placement : parentContext?.store ? 'right-start' : 'bottom-start';
|
|
56
56
|
// Swap left/right in case of RTL direction
|
|
57
57
|
if (computedDirection === 'rtl') {
|
|
@@ -61,7 +61,7 @@ const UnconnectedDropdownMenu = (props, ref) => {
|
|
|
61
61
|
computedPlacement = computedPlacement.replace('left', 'right');
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const menuStore = Ariakit.useMenuStore({
|
|
65
65
|
parent: parentContext?.store,
|
|
66
66
|
open,
|
|
67
67
|
defaultOpen,
|
|
@@ -73,17 +73,17 @@ const UnconnectedDropdownMenu = (props, ref) => {
|
|
|
73
73
|
rtl: computedDirection === 'rtl'
|
|
74
74
|
});
|
|
75
75
|
const contextValue = useMemo(() => ({
|
|
76
|
-
store:
|
|
76
|
+
store: menuStore,
|
|
77
77
|
variant
|
|
78
|
-
}), [
|
|
78
|
+
}), [menuStore, variant]);
|
|
79
79
|
|
|
80
80
|
// Extract the side from the applied placement — useful for animations.
|
|
81
81
|
// Using `currentPlacement` instead of `placement` to make sure that we
|
|
82
82
|
// use the final computed placement (including "flips" etc).
|
|
83
|
-
const appliedPlacementSide = useStoreState(
|
|
84
|
-
if (
|
|
83
|
+
const appliedPlacementSide = useStoreState(menuStore, 'currentPlacement').split('-')[0];
|
|
84
|
+
if (menuStore.parent && !(isValidElement(trigger) && MenuItem === trigger.type)) {
|
|
85
85
|
// eslint-disable-next-line no-console
|
|
86
|
-
console.warn('For nested
|
|
86
|
+
console.warn('For nested Menus, the `trigger` should always be a `MenuItem`.');
|
|
87
87
|
}
|
|
88
88
|
const hideOnEscape = useCallback(event => {
|
|
89
89
|
// Pressing Escape can cause unexpected consequences (ie. exiting
|
|
@@ -101,8 +101,8 @@ const UnconnectedDropdownMenu = (props, ref) => {
|
|
|
101
101
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
102
102
|
children: [/*#__PURE__*/_jsx(Ariakit.MenuButton, {
|
|
103
103
|
ref: ref,
|
|
104
|
-
store:
|
|
105
|
-
render:
|
|
104
|
+
store: menuStore,
|
|
105
|
+
render: menuStore.parent ? cloneElement(trigger, {
|
|
106
106
|
// Add submenu arrow, unless a `suffix` is explicitly specified
|
|
107
107
|
suffix: /*#__PURE__*/_jsxs(_Fragment, {
|
|
108
108
|
children: [trigger.props.suffix, /*#__PURE__*/_jsx(Styled.SubmenuChevronIcon, {
|
|
@@ -116,15 +116,15 @@ const UnconnectedDropdownMenu = (props, ref) => {
|
|
|
116
116
|
}), /*#__PURE__*/_jsx(Ariakit.Menu, {
|
|
117
117
|
...otherProps,
|
|
118
118
|
modal: modal,
|
|
119
|
-
store:
|
|
119
|
+
store: menuStore
|
|
120
120
|
// Root menu has an 8px distance from its trigger,
|
|
121
121
|
// otherwise 0 (which causes the submenu to slightly overlap)
|
|
122
122
|
,
|
|
123
|
-
gutter: gutter !== null && gutter !== void 0 ? gutter :
|
|
123
|
+
gutter: gutter !== null && gutter !== void 0 ? gutter : menuStore.parent ? 0 : 8
|
|
124
124
|
// Align nested menu by the same (but opposite) amount
|
|
125
125
|
// as the menu container's padding.
|
|
126
126
|
,
|
|
127
|
-
shift: shift !== null && shift !== void 0 ? shift :
|
|
127
|
+
shift: shift !== null && shift !== void 0 ? shift : menuStore.parent ? -4 : 0,
|
|
128
128
|
hideOnHoverOutside: false,
|
|
129
129
|
"data-side": appliedPlacementSide,
|
|
130
130
|
wrapperProps: wrapperProps,
|
|
@@ -142,41 +142,41 @@ const UnconnectedDropdownMenu = (props, ref) => {
|
|
|
142
142
|
...renderProps
|
|
143
143
|
})
|
|
144
144
|
}),
|
|
145
|
-
children: /*#__PURE__*/_jsx(
|
|
145
|
+
children: /*#__PURE__*/_jsx(MenuContext.Provider, {
|
|
146
146
|
value: contextValue,
|
|
147
147
|
children: children
|
|
148
148
|
})
|
|
149
149
|
})]
|
|
150
150
|
});
|
|
151
151
|
};
|
|
152
|
-
export const
|
|
153
|
-
Context: Object.assign(
|
|
154
|
-
displayName: '
|
|
152
|
+
export const Menu = Object.assign(contextConnect(UnconnectedMenu, 'Menu'), {
|
|
153
|
+
Context: Object.assign(MenuContext, {
|
|
154
|
+
displayName: 'Menu.Context'
|
|
155
155
|
}),
|
|
156
|
-
Item: Object.assign(
|
|
157
|
-
displayName: '
|
|
156
|
+
Item: Object.assign(MenuItem, {
|
|
157
|
+
displayName: 'Menu.Item'
|
|
158
158
|
}),
|
|
159
|
-
RadioItem: Object.assign(
|
|
160
|
-
displayName: '
|
|
159
|
+
RadioItem: Object.assign(MenuRadioItem, {
|
|
160
|
+
displayName: 'Menu.RadioItem'
|
|
161
161
|
}),
|
|
162
|
-
CheckboxItem: Object.assign(
|
|
163
|
-
displayName: '
|
|
162
|
+
CheckboxItem: Object.assign(MenuCheckboxItem, {
|
|
163
|
+
displayName: 'Menu.CheckboxItem'
|
|
164
164
|
}),
|
|
165
|
-
Group: Object.assign(
|
|
166
|
-
displayName: '
|
|
165
|
+
Group: Object.assign(MenuGroup, {
|
|
166
|
+
displayName: 'Menu.Group'
|
|
167
167
|
}),
|
|
168
|
-
GroupLabel: Object.assign(
|
|
169
|
-
displayName: '
|
|
168
|
+
GroupLabel: Object.assign(MenuGroupLabel, {
|
|
169
|
+
displayName: 'Menu.GroupLabel'
|
|
170
170
|
}),
|
|
171
|
-
Separator: Object.assign(
|
|
172
|
-
displayName: '
|
|
171
|
+
Separator: Object.assign(MenuSeparator, {
|
|
172
|
+
displayName: 'Menu.Separator'
|
|
173
173
|
}),
|
|
174
|
-
ItemLabel: Object.assign(
|
|
175
|
-
displayName: '
|
|
174
|
+
ItemLabel: Object.assign(MenuItemLabel, {
|
|
175
|
+
displayName: 'Menu.ItemLabel'
|
|
176
176
|
}),
|
|
177
|
-
ItemHelpText: Object.assign(
|
|
178
|
-
displayName: '
|
|
177
|
+
ItemHelpText: Object.assign(MenuItemHelpText, {
|
|
178
|
+
displayName: 'Menu.ItemHelpText'
|
|
179
179
|
})
|
|
180
180
|
});
|
|
181
|
-
export default
|
|
181
|
+
export default Menu;
|
|
182
182
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Ariakit","useStoreState","useContext","useMemo","cloneElement","isValidElement","useCallback","isRTL","chevronRightSmall","useContextSystem","contextConnect","Styled","MenuContext","MenuItem","MenuCheckboxItem","MenuRadioItem","MenuGroup","MenuGroupLabel","MenuSeparator","MenuItemLabel","MenuItemHelpText","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","UnconnectedMenu","props","ref","_props$placement","open","defaultOpen","onOpenChange","placement","trigger","gutter","children","shift","modal","variant","otherProps","parentContext","computedDirection","computedPlacement","store","test","replace","menuStore","useMenuStore","parent","focusLoop","setOpen","willBeOpen","rtl","contextValue","appliedPlacementSide","split","type","console","warn","hideOnEscape","event","preventDefault","wrapperProps","dir","style","direction","MenuButton","render","suffix","SubmenuChevronIcon","icon","size","preserveAspectRatio","Menu","hideOnHoverOutside","unmountOnHide","renderProps","MenuPopoverOuterWrapper","MenuPopoverInnerWrapper","Provider","value","Object","assign","Context","displayName","Item","RadioItem","CheckboxItem","Group","GroupLabel","Separator","ItemLabel","ItemHelpText"],"sources":["@wordpress/components/src/menu/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { useStoreState } from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseContext,\n\tuseMemo,\n\tcloneElement,\n\tisValidElement,\n\tuseCallback,\n} from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, contextConnect } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type { MenuContext as MenuContextType, MenuProps } from './types';\nimport * as Styled from './styles';\nimport { MenuContext } from './context';\nimport { MenuItem } from './item';\nimport { MenuCheckboxItem } from './checkbox-item';\nimport { MenuRadioItem } from './radio-item';\nimport { MenuGroup } from './group';\nimport { MenuGroupLabel } from './group-label';\nimport { MenuSeparator } from './separator';\nimport { MenuItemLabel } from './item-label';\nimport { MenuItemHelpText } from './item-help-text';\n\nconst UnconnectedMenu = (\n\tprops: WordPressComponentProps< MenuProps, 'div', false >,\n\tref: React.ForwardedRef< HTMLDivElement >\n) => {\n\tconst {\n\t\t// Store props\n\t\topen,\n\t\tdefaultOpen = false,\n\t\tonOpenChange,\n\t\tplacement,\n\n\t\t// Menu trigger props\n\t\ttrigger,\n\n\t\t// Menu props\n\t\tgutter,\n\t\tchildren,\n\t\tshift,\n\t\tmodal = true,\n\n\t\t// From internal components context\n\t\tvariant,\n\n\t\t// Rest\n\t\t...otherProps\n\t} = useContextSystem< typeof props & Pick< MenuContextType, 'variant' > >(\n\t\tprops,\n\t\t'Menu'\n\t);\n\n\tconst parentContext = useContext( MenuContext );\n\n\tconst computedDirection = isRTL() ? 'rtl' : 'ltr';\n\n\t// If an explicit value for the `placement` prop is not passed,\n\t// apply a default placement of `bottom-start` for the root menu popover,\n\t// and of `right-start` for nested menu popovers.\n\tlet computedPlacement =\n\t\tprops.placement ??\n\t\t( parentContext?.store ? 'right-start' : 'bottom-start' );\n\t// Swap left/right in case of RTL direction\n\tif ( computedDirection === 'rtl' ) {\n\t\tif ( /right/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'right',\n\t\t\t\t'left'\n\t\t\t) as typeof computedPlacement;\n\t\t} else if ( /left/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'left',\n\t\t\t\t'right'\n\t\t\t) as typeof computedPlacement;\n\t\t}\n\t}\n\n\tconst menuStore = Ariakit.useMenuStore( {\n\t\tparent: parentContext?.store,\n\t\topen,\n\t\tdefaultOpen,\n\t\tplacement: computedPlacement,\n\t\tfocusLoop: true,\n\t\tsetOpen( willBeOpen ) {\n\t\t\tonOpenChange?.( willBeOpen );\n\t\t},\n\t\trtl: computedDirection === 'rtl',\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( { store: menuStore, variant } ),\n\t\t[ menuStore, variant ]\n\t);\n\n\t// Extract the side from the applied placement — useful for animations.\n\t// Using `currentPlacement` instead of `placement` to make sure that we\n\t// use the final computed placement (including \"flips\" etc).\n\tconst appliedPlacementSide = useStoreState(\n\t\tmenuStore,\n\t\t'currentPlacement'\n\t).split( '-' )[ 0 ];\n\n\tif (\n\t\tmenuStore.parent &&\n\t\t! ( isValidElement( trigger ) && MenuItem === trigger.type )\n\t) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t'For nested Menus, the `trigger` should always be a `MenuItem`.'\n\t\t);\n\t}\n\n\tconst hideOnEscape = useCallback(\n\t\t( event: React.KeyboardEvent< Element > ) => {\n\t\t\t// Pressing Escape can cause unexpected consequences (ie. exiting\n\t\t\t// full screen mode on MacOs, close parent modals...).\n\t\t\tevent.preventDefault();\n\t\t\t// Returning `true` causes the menu to hide.\n\t\t\treturn true;\n\t\t},\n\t\t[]\n\t);\n\n\tconst wrapperProps = useMemo(\n\t\t() => ( {\n\t\t\tdir: computedDirection,\n\t\t\tstyle: {\n\t\t\t\tdirection:\n\t\t\t\t\tcomputedDirection as React.CSSProperties[ 'direction' ],\n\t\t\t},\n\t\t} ),\n\t\t[ computedDirection ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ /* Menu trigger */ }\n\t\t\t<Ariakit.MenuButton\n\t\t\t\tref={ ref }\n\t\t\t\tstore={ menuStore }\n\t\t\t\trender={\n\t\t\t\t\tmenuStore.parent\n\t\t\t\t\t\t? cloneElement( trigger, {\n\t\t\t\t\t\t\t\t// Add submenu arrow, unless a `suffix` is explicitly specified\n\t\t\t\t\t\t\t\tsuffix: (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ trigger.props.suffix }\n\t\t\t\t\t\t\t\t\t\t<Styled.SubmenuChevronIcon\n\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t\t\tpreserveAspectRatio=\"xMidYMid slice\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t } )\n\t\t\t\t\t\t: trigger\n\t\t\t\t}\n\t\t\t/>\n\n\t\t\t{ /* Menu popover */ }\n\t\t\t<Ariakit.Menu\n\t\t\t\t{ ...otherProps }\n\t\t\t\tmodal={ modal }\n\t\t\t\tstore={ menuStore }\n\t\t\t\t// Root menu has an 8px distance from its trigger,\n\t\t\t\t// otherwise 0 (which causes the submenu to slightly overlap)\n\t\t\t\tgutter={ gutter ?? ( menuStore.parent ? 0 : 8 ) }\n\t\t\t\t// Align nested menu by the same (but opposite) amount\n\t\t\t\t// as the menu container's padding.\n\t\t\t\tshift={ shift ?? ( menuStore.parent ? -4 : 0 ) }\n\t\t\t\thideOnHoverOutside={ false }\n\t\t\t\tdata-side={ appliedPlacementSide }\n\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\thideOnEscape={ hideOnEscape }\n\t\t\t\tunmountOnHide\n\t\t\t\trender={ ( renderProps ) => (\n\t\t\t\t\t// Two wrappers are needed for the entry animation, where the menu\n\t\t\t\t\t// container scales with a different factor than its contents.\n\t\t\t\t\t// The {...renderProps} are passed to the inner wrapper, so that the\n\t\t\t\t\t// menu element is the direct parent of the menu item elements.\n\t\t\t\t\t<Styled.MenuPopoverOuterWrapper variant={ variant }>\n\t\t\t\t\t\t<Styled.MenuPopoverInnerWrapper { ...renderProps } />\n\t\t\t\t\t</Styled.MenuPopoverOuterWrapper>\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<MenuContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</MenuContext.Provider>\n\t\t\t</Ariakit.Menu>\n\t\t</>\n\t);\n};\n\nexport const Menu = Object.assign( contextConnect( UnconnectedMenu, 'Menu' ), {\n\tContext: Object.assign( MenuContext, {\n\t\tdisplayName: 'Menu.Context',\n\t} ),\n\tItem: Object.assign( MenuItem, {\n\t\tdisplayName: 'Menu.Item',\n\t} ),\n\tRadioItem: Object.assign( MenuRadioItem, {\n\t\tdisplayName: 'Menu.RadioItem',\n\t} ),\n\tCheckboxItem: Object.assign( MenuCheckboxItem, {\n\t\tdisplayName: 'Menu.CheckboxItem',\n\t} ),\n\tGroup: Object.assign( MenuGroup, {\n\t\tdisplayName: 'Menu.Group',\n\t} ),\n\tGroupLabel: Object.assign( MenuGroupLabel, {\n\t\tdisplayName: 'Menu.GroupLabel',\n\t} ),\n\tSeparator: Object.assign( MenuSeparator, {\n\t\tdisplayName: 'Menu.Separator',\n\t} ),\n\tItemLabel: Object.assign( MenuItemLabel, {\n\t\tdisplayName: 'Menu.ItemLabel',\n\t} ),\n\tItemHelpText: Object.assign( MenuItemH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ET,MAAM,CAACC,MAAM,CAAElE,aAAa,EAAE;IACxCoE,WAAW,EAAE;EACd,CAAE,CAAC;EACHO,SAAS,EAAEV,MAAM,CAACC,MAAM,CAAEjE,aAAa,EAAE;IACxCmE,WAAW,EAAE;EACd,CAAE,CAAC;EACHQ,YAAY,EAAEX,MAAM,CAACC,MAAM,CAAEhE,gBAAgB,EAAE;IAC9CkE,WAAW,EAAE;EACd,CAAE;AACH,CAAE,CAAC;AAEH,eAAeX,IAAI","ignoreList":[]}
|
|
@@ -9,8 +9,8 @@ import { forwardRef } from '@wordpress/element';
|
|
|
9
9
|
|
|
10
10
|
import * as Styled from './styles';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
export const
|
|
13
|
-
return /*#__PURE__*/_jsx(Styled.
|
|
12
|
+
export const MenuItemHelpText = forwardRef(function MenuItemHelpText(props, ref) {
|
|
13
|
+
return /*#__PURE__*/_jsx(Styled.MenuItemHelpText, {
|
|
14
14
|
numberOfLines: 2,
|
|
15
15
|
ref: ref,
|
|
16
16
|
...props
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Styled","jsx","_jsx","MenuItemHelpText","props","ref","numberOfLines"],"sources":["@wordpress/components/src/menu/item-help-text.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport * as Styled from './styles';\n\nexport const MenuItemHelpText = forwardRef<\n\tHTMLSpanElement,\n\tWordPressComponentProps< { children: React.ReactNode }, 'span', true >\n>( function MenuItemHelpText( props, ref ) {\n\treturn (\n\t\t<Styled.MenuItemHelpText numberOfLines={ 2 } ref={ ref } { ...props } />\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAEA,OAAO,KAAKC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,OAAO,MAAMC,gBAAgB,GAAGJ,UAAU,CAGvC,SAASI,gBAAgBA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EAC1C,oBACCH,IAAA,CAACF,MAAM,CAACG,gBAAgB;IAACG,aAAa,EAAG,CAAG;IAACD,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AAE1E,CAAE,CAAC","ignoreList":[]}
|
|
@@ -9,8 +9,8 @@ import { forwardRef } from '@wordpress/element';
|
|
|
9
9
|
|
|
10
10
|
import * as Styled from './styles';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
export const
|
|
13
|
-
return /*#__PURE__*/_jsx(Styled.
|
|
12
|
+
export const MenuItemLabel = forwardRef(function MenuItemLabel(props, ref) {
|
|
13
|
+
return /*#__PURE__*/_jsx(Styled.MenuItemLabel, {
|
|
14
14
|
numberOfLines: 1,
|
|
15
15
|
ref: ref,
|
|
16
16
|
...props
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Styled","jsx","_jsx","MenuItemLabel","props","ref","numberOfLines"],"sources":["@wordpress/components/src/menu/item-label.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport * as Styled from './styles';\n\nexport const MenuItemLabel = forwardRef<\n\tHTMLSpanElement,\n\tWordPressComponentProps< { children: React.ReactNode }, 'span', true >\n>( function MenuItemLabel( props, ref ) {\n\treturn (\n\t\t<Styled.MenuItemLabel numberOfLines={ 1 } ref={ ref } { ...props } />\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAEA,OAAO,KAAKC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,OAAO,MAAMC,aAAa,GAAGJ,UAAU,CAGpC,SAASI,aAAaA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACvC,oBACCH,IAAA,CAACF,MAAM,CAACG,aAAa;IAACG,aAAa,EAAG,CAAG;IAACD,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AAEvE,CAAE,CAAC","ignoreList":[]}
|
|
@@ -8,10 +8,10 @@ import { forwardRef, useContext } from '@wordpress/element';
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import * as Styled from './styles';
|
|
11
|
-
import {
|
|
11
|
+
import { MenuContext } from './context';
|
|
12
12
|
import { useTemporaryFocusVisibleFix } from './use-temporary-focus-visible-fix';
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
export const
|
|
14
|
+
export const MenuItem = forwardRef(function MenuItem({
|
|
15
15
|
prefix,
|
|
16
16
|
suffix,
|
|
17
17
|
children,
|
|
@@ -23,18 +23,18 @@ export const DropdownMenuItem = forwardRef(function DropdownMenuItem({
|
|
|
23
23
|
const focusVisibleFixProps = useTemporaryFocusVisibleFix({
|
|
24
24
|
onBlur
|
|
25
25
|
});
|
|
26
|
-
const
|
|
27
|
-
return /*#__PURE__*/_jsxs(Styled.
|
|
26
|
+
const menuContext = useContext(MenuContext);
|
|
27
|
+
return /*#__PURE__*/_jsxs(Styled.MenuItem, {
|
|
28
28
|
ref: ref,
|
|
29
29
|
...props,
|
|
30
30
|
...focusVisibleFixProps,
|
|
31
31
|
accessibleWhenDisabled: true,
|
|
32
32
|
hideOnClick: hideOnClick,
|
|
33
|
-
store:
|
|
33
|
+
store: menuContext?.store,
|
|
34
34
|
children: [/*#__PURE__*/_jsx(Styled.ItemPrefixWrapper, {
|
|
35
35
|
children: prefix
|
|
36
|
-
}), /*#__PURE__*/_jsxs(Styled.
|
|
37
|
-
children: [/*#__PURE__*/_jsx(Styled.
|
|
36
|
+
}), /*#__PURE__*/_jsxs(Styled.MenuItemContentWrapper, {
|
|
37
|
+
children: [/*#__PURE__*/_jsx(Styled.MenuItemChildrenWrapper, {
|
|
38
38
|
children: children
|
|
39
39
|
}), suffix && /*#__PURE__*/_jsx(Styled.ItemSuffixWrapper, {
|
|
40
40
|
children: suffix
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","useContext","Styled","MenuContext","useTemporaryFocusVisibleFix","jsx","_jsx","jsxs","_jsxs","MenuItem","prefix","suffix","children","onBlur","hideOnClick","props","ref","focusVisibleFixProps","menuContext","accessibleWhenDisabled","store","ItemPrefixWrapper","MenuItemContentWrapper","MenuItemChildrenWrapper","ItemSuffixWrapper"],"sources":["@wordpress/components/src/menu/item.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { MenuItemProps } from './types';\nimport * as Styled from './styles';\nimport { MenuContext } from './context';\nimport { useTemporaryFocusVisibleFix } from './use-temporary-focus-visible-fix';\n\nexport const MenuItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuItemProps, 'div', false >\n>( function MenuItem(\n\t{ prefix, suffix, children, onBlur, hideOnClick = true, ...props },\n\tref\n) {\n\t// TODO: Remove when https://github.com/ariakit/ariakit/issues/4083 is fixed\n\tconst focusVisibleFixProps = useTemporaryFocusVisibleFix( { onBlur } );\n\tconst menuContext = useContext( MenuContext );\n\n\treturn (\n\t\t<Styled.MenuItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\t{ ...focusVisibleFixProps }\n\t\t\taccessibleWhenDisabled\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ menuContext?.store }\n\t\t>\n\t\t\t<Styled.ItemPrefixWrapper>{ prefix }</Styled.ItemPrefixWrapper>\n\n\t\t\t<Styled.MenuItemContentWrapper>\n\t\t\t\t<Styled.MenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\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BACPL,IAAA,CAACJ,MAAM,CAACsB,iBAAiB;QAAAZ,QAAA,EACtBD;MAAM,CACiB,CAC1B;IAAA,CAC6B,CAAC;EAAA,CAChB,CAAC;AAEpB,CAAE,CAAC","ignoreList":[]}
|
|
@@ -13,7 +13,7 @@ import { Icon } from '@wordpress/icons';
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import { MenuContext } from './context';
|
|
17
17
|
import * as Styled from './styles';
|
|
18
18
|
import { SVG, Circle } from '@wordpress/primitives';
|
|
19
19
|
import { useTemporaryFocusVisibleFix } from './use-temporary-focus-visible-fix';
|
|
@@ -27,7 +27,7 @@ const radioCheck = /*#__PURE__*/_jsx(SVG, {
|
|
|
27
27
|
r: 3
|
|
28
28
|
})
|
|
29
29
|
});
|
|
30
|
-
export const
|
|
30
|
+
export const MenuRadioItem = forwardRef(function MenuRadioItem({
|
|
31
31
|
suffix,
|
|
32
32
|
children,
|
|
33
33
|
onBlur,
|
|
@@ -38,16 +38,16 @@ export const DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem({
|
|
|
38
38
|
const focusVisibleFixProps = useTemporaryFocusVisibleFix({
|
|
39
39
|
onBlur
|
|
40
40
|
});
|
|
41
|
-
const
|
|
42
|
-
return /*#__PURE__*/_jsxs(Styled.
|
|
41
|
+
const menuContext = useContext(MenuContext);
|
|
42
|
+
return /*#__PURE__*/_jsxs(Styled.MenuRadioItem, {
|
|
43
43
|
ref: ref,
|
|
44
44
|
...props,
|
|
45
45
|
...focusVisibleFixProps,
|
|
46
46
|
accessibleWhenDisabled: true,
|
|
47
47
|
hideOnClick: hideOnClick,
|
|
48
|
-
store:
|
|
48
|
+
store: menuContext?.store,
|
|
49
49
|
children: [/*#__PURE__*/_jsx(Ariakit.MenuItemCheck, {
|
|
50
|
-
store:
|
|
50
|
+
store: menuContext?.store,
|
|
51
51
|
render: /*#__PURE__*/_jsx(Styled.ItemPrefixWrapper, {})
|
|
52
52
|
// Override some ariakit inline styles
|
|
53
53
|
,
|
|
@@ -59,8 +59,8 @@ export const DropdownMenuRadioItem = forwardRef(function DropdownMenuRadioItem({
|
|
|
59
59
|
icon: radioCheck,
|
|
60
60
|
size: 24
|
|
61
61
|
})
|
|
62
|
-
}), /*#__PURE__*/_jsxs(Styled.
|
|
63
|
-
children: [/*#__PURE__*/_jsx(Styled.
|
|
62
|
+
}), /*#__PURE__*/_jsxs(Styled.MenuItemContentWrapper, {
|
|
63
|
+
children: [/*#__PURE__*/_jsx(Styled.MenuItemChildrenWrapper, {
|
|
64
64
|
children: children
|
|
65
65
|
}), suffix && /*#__PURE__*/_jsx(Styled.ItemSuffixWrapper, {
|
|
66
66
|
children: suffix
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Ariakit","forwardRef","useContext","Icon","MenuContext","Styled","SVG","Circle","useTemporaryFocusVisibleFix","jsx","_jsx","jsxs","_jsxs","radioCheck","xmlns","viewBox","children","cx","cy","r","MenuRadioItem","suffix","onBlur","hideOnClick","props","ref","focusVisibleFixProps","menuContext","accessibleWhenDisabled","store","MenuItemCheck","render","ItemPrefixWrapper","style","width","height","icon","size","MenuItemContentWrapper","MenuItemChildrenWrapper","ItemSuffixWrapper"],"sources":["@wordpress/components/src/menu/radio-item.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\nimport { Icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { MenuContext } from './context';\nimport type { MenuRadioItemProps } from './types';\nimport * as Styled from './styles';\nimport { SVG, Circle } from '@wordpress/primitives';\nimport { useTemporaryFocusVisibleFix } from './use-temporary-focus-visible-fix';\n\nconst radioCheck = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Circle cx={ 12 } cy={ 12 } r={ 3 }></Circle>\n\t</SVG>\n);\n\nexport const MenuRadioItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuRadioItemProps, 'div', false >\n>( function MenuRadioItem(\n\t{ suffix, children, onBlur, hideOnClick = false, ...props },\n\tref\n) {\n\t// TODO: Remove when https://github.com/ariakit/ariakit/issues/4083 is fixed\n\tconst focusVisibleFixProps = useTemporaryFocusVisibleFix( { onBlur } );\n\tconst menuContext = useContext( MenuContext );\n\n\treturn (\n\t\t<Styled.MenuRadioItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\t{ ...focusVisibleFixProps }\n\t\t\taccessibleWhenDisabled\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ menuContext?.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ menuContext?.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t\t// Override some ariakit inline styles\n\t\t\t\tstyle={ { width: 'auto', height: 'auto' } }\n\t\t\t>\n\t\t\t\t<Icon icon={ radioCheck } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t<Styled.MenuItemContentWrapper>\n\t\t\t\t<Styled.MenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.MenuItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.MenuItemContentWrapper>\n\t\t</Styled.MenuRadioItem>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,IAAI,QAAQ,kBAAkB;;AAEvC;AACA;AACA;;AAEA,SAASC,WAAW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UAAY;QAACwB,IAAI,EAAG;MAAI,CAAE;IAAC,CAClB,CAAC,eAExBzB,KAAA,CAACP,MAAM,CAACiC,sBAAsB;MAAAtB,QAAA,gBAC7BN,IAAA,CAACL,MAAM,CAACkC,uBAAuB;QAAAvB,QAAA,EAC5BA;MAAQ,CACqB,CAAC,EAE/BK,MAAM,iBACPX,IAAA,CAACL,MAAM,CAACmC,iBAAiB;QAAAxB,QAAA,EACtBK;MAAM,CACiB,CAC1B;IAAA,CAC6B,CAAC;EAAA,CACX,CAAC;AAEzB,CAAE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { forwardRef, useContext } from '@wordpress/element';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { MenuContext } from './context';
|
|
11
|
+
import * as Styled from './styles';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export const MenuSeparator = forwardRef(function MenuSeparator(props, ref) {
|
|
14
|
+
const menuContext = useContext(MenuContext);
|
|
15
|
+
return /*#__PURE__*/_jsx(Styled.MenuSeparator, {
|
|
16
|
+
ref: ref,
|
|
17
|
+
...props,
|
|
18
|
+
store: menuContext?.store,
|
|
19
|
+
variant: menuContext?.variant
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","useContext","MenuContext","Styled","jsx","_jsx","MenuSeparator","props","ref","menuContext","store","variant"],"sources":["@wordpress/components/src/menu/separator.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { MenuContext } from './context';\nimport type { MenuSeparatorProps } from './types';\nimport * as Styled from './styles';\n\nexport const MenuSeparator = forwardRef<\n\tHTMLHRElement,\n\tWordPressComponentProps< MenuSeparatorProps, 'hr', false >\n>( function MenuSeparator( props, ref ) {\n\tconst menuContext = useContext( MenuContext );\n\treturn (\n\t\t<Styled.MenuSeparator\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ menuContext?.store }\n\t\t\tvariant={ menuContext?.variant }\n\t\t/>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AAEvC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,OAAO,MAAMC,aAAa,GAAGN,UAAU,CAGpC,SAASM,aAAaA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACvC,MAAMC,WAAW,GAAGR,UAAU,CAAEC,WAAY,CAAC;EAC7C,oBACCG,IAAA,CAACF,MAAM,CAACG,aAAa;IACpBE,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVG,KAAK,EAAGD,WAAW,EAAEC,KAAO;IAC5BC,OAAO,EAAGF,WAAW,EAAEE;EAAS,CAChC,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
|