@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
|
@@ -7,6 +7,7 @@ import * as Ariakit from '@ariakit/react';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { useMemo, forwardRef } from '@wordpress/element';
|
|
10
|
+
import { isRTL } from '@wordpress/i18n';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
@@ -34,6 +35,7 @@ function UnforwardedRadioGroup(
|
|
|
34
35
|
setValue: ( newValue ) => {
|
|
35
36
|
onChange?.( newValue ?? undefined );
|
|
36
37
|
},
|
|
38
|
+
rtl: isRTL(),
|
|
37
39
|
} );
|
|
38
40
|
|
|
39
41
|
const contextValue = useMemo(
|
|
@@ -14,7 +14,8 @@ import ResizableBox from '..';
|
|
|
14
14
|
import { useState } from '@wordpress/element';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof ResizableBox > = {
|
|
17
|
-
title: 'Components/ResizableBox',
|
|
17
|
+
title: 'Components/Utilities/ResizableBox',
|
|
18
|
+
id: 'components-resizablebox',
|
|
18
19
|
component: ResizableBox,
|
|
19
20
|
argTypes: {
|
|
20
21
|
children: { control: { type: null } },
|
|
@@ -336,9 +336,7 @@ const Sandbox = forwardRef( function Sandbox(
|
|
|
336
336
|
|
|
337
337
|
useEffect( () => {
|
|
338
338
|
updateContentHtml();
|
|
339
|
-
//
|
|
340
|
-
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
341
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
339
|
+
// See https://github.com/WordPress/gutenberg/pull/41166
|
|
342
340
|
}, [ html, title, type, styles, scripts ] );
|
|
343
341
|
|
|
344
342
|
useEffect( () => {
|
package/src/sandbox/index.tsx
CHANGED
|
@@ -262,23 +262,20 @@ function SandBox( {
|
|
|
262
262
|
checkMessageForResize
|
|
263
263
|
);
|
|
264
264
|
};
|
|
265
|
-
//
|
|
265
|
+
// Passing `exhaustive-deps` will likely involve a more detailed refactor.
|
|
266
266
|
// See https://github.com/WordPress/gutenberg/pull/44378
|
|
267
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
268
267
|
}, [] );
|
|
269
268
|
|
|
270
269
|
useEffect( () => {
|
|
271
270
|
trySandBox();
|
|
272
|
-
//
|
|
271
|
+
// Passing `exhaustive-deps` will likely involve a more detailed refactor.
|
|
273
272
|
// See https://github.com/WordPress/gutenberg/pull/44378
|
|
274
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
275
273
|
}, [ title, styles, scripts ] );
|
|
276
274
|
|
|
277
275
|
useEffect( () => {
|
|
278
276
|
trySandBox( true );
|
|
279
|
-
//
|
|
277
|
+
// Passing `exhaustive-deps` will likely involve a more detailed refactor.
|
|
280
278
|
// See https://github.com/WordPress/gutenberg/pull/44378
|
|
281
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
282
279
|
}, [ html, type ] );
|
|
283
280
|
|
|
284
281
|
return (
|
|
@@ -10,7 +10,8 @@ import SandBox from '..';
|
|
|
10
10
|
|
|
11
11
|
const meta: Meta< typeof SandBox > = {
|
|
12
12
|
component: SandBox,
|
|
13
|
-
title: 'Components/SandBox',
|
|
13
|
+
title: 'Components/Utilities/SandBox',
|
|
14
|
+
id: 'components-sandbox',
|
|
14
15
|
argTypes: {
|
|
15
16
|
onFocus: { control: { type: null } },
|
|
16
17
|
},
|
|
@@ -17,7 +17,8 @@ import ScrollLock from '..';
|
|
|
17
17
|
|
|
18
18
|
const meta: Meta< typeof ScrollLock > = {
|
|
19
19
|
component: ScrollLock,
|
|
20
|
-
title: 'Components/ScrollLock',
|
|
20
|
+
title: 'Components/Utilities/ScrollLock',
|
|
21
|
+
id: 'components-scrolllock',
|
|
21
22
|
parameters: {
|
|
22
23
|
controls: { hideNoControlsWarning: true },
|
|
23
24
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -122,9 +122,7 @@ function SearchControl( {
|
|
|
122
122
|
mergeFutureStyles( activeDarkStyles, [ isActive, isDark ] );
|
|
123
123
|
|
|
124
124
|
setCurrentStyles( futureStyles );
|
|
125
|
-
//
|
|
126
|
-
// see https://github.com/WordPress/gutenberg/pull/41166
|
|
127
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
125
|
+
// See https://github.com/WordPress/gutenberg/pull/41166
|
|
128
126
|
}, [ isActive, isDark ] );
|
|
129
127
|
|
|
130
128
|
const clearInput = useCallback( () => {
|
|
@@ -49,11 +49,10 @@ function Slot(
|
|
|
49
49
|
return () => {
|
|
50
50
|
unregisterSlot( name, ref );
|
|
51
51
|
};
|
|
52
|
-
//
|
|
52
|
+
// We don't want to unregister and register the slot whenever
|
|
53
53
|
// `fillProps` change, which would cause the fill to be re-mounted. Instead,
|
|
54
54
|
// we can just update the slot (see hook below).
|
|
55
55
|
// For more context, see https://github.com/WordPress/gutenberg/pull/44403#discussion_r994415973
|
|
56
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
56
|
}, [ registerSlot, unregisterSlot, name ] );
|
|
58
57
|
// fillProps may be an update that interacts with the layout, so we
|
|
59
58
|
// useLayoutEffect.
|
package/src/slot-fill/fill.ts
CHANGED
|
@@ -23,9 +23,8 @@ export default function Fill( { name, children }: FillComponentProps ) {
|
|
|
23
23
|
const refValue = ref.current;
|
|
24
24
|
registerFill( name, refValue );
|
|
25
25
|
return () => unregisterFill( name, refValue );
|
|
26
|
-
//
|
|
26
|
+
// The useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior.
|
|
27
27
|
// We'll leave them as-is until a more detailed investigation/refactor can be performed.
|
|
28
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
28
|
}, [] );
|
|
30
29
|
|
|
31
30
|
useLayoutEffect( () => {
|
|
@@ -33,9 +32,8 @@ export default function Fill( { name, children }: FillComponentProps ) {
|
|
|
33
32
|
if ( slot ) {
|
|
34
33
|
slot.forceUpdate();
|
|
35
34
|
}
|
|
36
|
-
//
|
|
35
|
+
// The useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior.
|
|
37
36
|
// We'll leave them as-is until a more detailed investigation/refactor can be performed.
|
|
38
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
37
|
}, [ children ] );
|
|
40
38
|
|
|
41
39
|
useLayoutEffect( () => {
|
|
@@ -46,9 +44,8 @@ export default function Fill( { name, children }: FillComponentProps ) {
|
|
|
46
44
|
unregisterFill( ref.current.name, ref.current );
|
|
47
45
|
ref.current.name = name;
|
|
48
46
|
registerFill( name, ref.current );
|
|
49
|
-
//
|
|
47
|
+
// The useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior.
|
|
50
48
|
// We'll leave them as-is until a more detailed investigation/refactor can be performed.
|
|
51
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
52
49
|
}, [ name ] );
|
|
53
50
|
|
|
54
51
|
return null;
|
|
@@ -15,7 +15,8 @@ import { Slot, Fill, Provider as SlotFillProvider } from '../';
|
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof Slot > = {
|
|
17
17
|
component: Slot,
|
|
18
|
-
title: 'Components/SlotFill',
|
|
18
|
+
title: 'Components/Utilities/SlotFill',
|
|
19
|
+
id: 'components-slotfill',
|
|
19
20
|
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
20
21
|
subcomponents: { Fill, SlotFillProvider },
|
|
21
22
|
argTypes: {
|
package/src/spacer/hook.ts
CHANGED
|
@@ -12,8 +12,9 @@ import { space } from '../utils/space';
|
|
|
12
12
|
import { rtl, useCx } from '../utils';
|
|
13
13
|
import type { SpacerProps } from './types';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
typeof o !== 'undefined' && o !== null;
|
|
15
|
+
function isDefined< T >( o: T ): o is Exclude< T, null | undefined > {
|
|
16
|
+
return typeof o !== 'undefined' && o !== null;
|
|
17
|
+
}
|
|
17
18
|
|
|
18
19
|
export function useSpacer(
|
|
19
20
|
props: WordPressComponentProps< SpacerProps, 'div' >
|
package/src/tab-panel/index.tsx
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
useCallback,
|
|
17
17
|
} from '@wordpress/element';
|
|
18
18
|
import { useInstanceId, usePrevious } from '@wordpress/compose';
|
|
19
|
+
import { isRTL } from '@wordpress/i18n';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Internal dependencies
|
|
@@ -120,6 +121,7 @@ const UnforwardedTabPanel = (
|
|
|
120
121
|
orientation,
|
|
121
122
|
selectOnMove,
|
|
122
123
|
defaultSelectedId: prependInstanceId( initialTabName ),
|
|
124
|
+
rtl: isRTL(),
|
|
123
125
|
} );
|
|
124
126
|
|
|
125
127
|
const selectedTabName = extractTabName(
|
|
@@ -218,6 +220,7 @@ const UnforwardedTabPanel = (
|
|
|
218
220
|
) }-view` }
|
|
219
221
|
render={
|
|
220
222
|
<Button
|
|
223
|
+
__next40pxDefaultSize
|
|
221
224
|
icon={ tab.icon }
|
|
222
225
|
label={ tab.icon && tab.title }
|
|
223
226
|
showTooltip={ !! tab.icon }
|
|
@@ -14,7 +14,8 @@ import { link, more, wordpress } from '@wordpress/icons';
|
|
|
14
14
|
import TabPanel from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof TabPanel > = {
|
|
17
|
-
title: 'Components/TabPanel',
|
|
17
|
+
title: 'Components/Containers/TabPanel',
|
|
18
|
+
id: 'components-tabpanel',
|
|
18
19
|
component: TabPanel,
|
|
19
20
|
parameters: {
|
|
20
21
|
actions: { argTypesRegex: '^on.*' },
|
package/src/tab-panel/style.scss
CHANGED
|
@@ -7,12 +7,10 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
// This tab style CSS is duplicated verbatim in
|
|
11
|
-
// /packages/edit-post/src/components/sidebar/settings-header/style.scss
|
|
12
10
|
.components-tab-panel__tabs-item {
|
|
13
11
|
position: relative;
|
|
14
12
|
border-radius: 0;
|
|
15
|
-
height: $grid-unit-60;
|
|
13
|
+
height: $grid-unit-60 !important; // https://github.com/WordPress/gutenberg/pull/65075#discussion_r1746282734
|
|
16
14
|
background: transparent;
|
|
17
15
|
border: none;
|
|
18
16
|
box-shadow: none;
|
package/src/tabs/README.md
CHANGED
|
@@ -109,45 +109,81 @@ Tabs is comprised of four individual components:
|
|
|
109
109
|
|
|
110
110
|
###### `children`: `React.ReactNode`
|
|
111
111
|
|
|
112
|
-
The children elements, which should
|
|
112
|
+
The children elements, which should include one instance of the `Tabs.Tablist` component and as many instances of the `Tabs.TabPanel` components as there are `Tabs.Tab` components.
|
|
113
113
|
|
|
114
114
|
- Required: Yes
|
|
115
115
|
|
|
116
116
|
###### `selectOnMove`: `boolean`
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
Determines if the tab should be selected when it receives focus. If set to `false`, the tab will only be selected upon clicking, not when using arrow keys to shift focus (manual tab activation). See the [official W3C docs](https://www.w3.org/WAI/ARIA/apg/patterns/tabpanel/) for more info.
|
|
119
119
|
|
|
120
120
|
- Required: No
|
|
121
121
|
- Default: `true`
|
|
122
122
|
|
|
123
|
-
###### `
|
|
123
|
+
###### `selectedTabId`: `string | null`
|
|
124
|
+
|
|
125
|
+
The id of the tab whose panel is currently visible.
|
|
126
|
+
|
|
127
|
+
If left `undefined`, it will be automatically set to the first enabled tab, and the component assumes it is being used in "uncontrolled" mode.
|
|
128
|
+
|
|
129
|
+
Consequently, any value different than `undefined` will set the component in "controlled" mode. When in "controlled" mode, the `null` value will result in no tabs being selected, and the tablist becoming tabbable.
|
|
130
|
+
|
|
131
|
+
- Required: No
|
|
132
|
+
|
|
133
|
+
###### `defaultTabId`: `string | null`
|
|
124
134
|
|
|
125
|
-
The id of the tab
|
|
135
|
+
The id of the tab whose panel is currently visible.
|
|
126
136
|
|
|
127
|
-
|
|
137
|
+
If left `undefined`, it will be automatically set to the first enabled tab. If set to `null`, no tab will be selected, and the tablist will be tabbable.
|
|
138
|
+
|
|
139
|
+
_Note: this prop will be overridden by the `selectedTabId` prop if it is provided (meaning the component will be used in "controlled" mode)._
|
|
128
140
|
|
|
129
141
|
- Required: No
|
|
130
142
|
|
|
131
143
|
###### `onSelect`: `( ( selectedId: string | null | undefined ) => void )`
|
|
132
144
|
|
|
133
|
-
The function called when
|
|
145
|
+
The function called when the `selectedTabId` changes.
|
|
134
146
|
|
|
135
147
|
- Required: No
|
|
136
148
|
- Default: `noop`
|
|
137
149
|
|
|
138
|
-
###### `
|
|
150
|
+
###### `activeTabId`: `string | null`
|
|
151
|
+
|
|
152
|
+
The current active tab `id`. The active tab is the tab element within the tablist widget that has DOM focus.
|
|
153
|
+
|
|
154
|
+
- `null` represents the tablist (ie. the base composite element). Users
|
|
155
|
+
will be able to navigate out of it using arrow keys;
|
|
156
|
+
- If `activeTabId` is initially set to `null`, the base composite element
|
|
157
|
+
itself will have focus and users will be able to navigate to it using
|
|
158
|
+
arrow keys.
|
|
159
|
+
|
|
160
|
+
- Required: No
|
|
161
|
+
|
|
162
|
+
###### `defaultActiveTabId`: `string | null`
|
|
163
|
+
|
|
164
|
+
The tab id that should be active by default when the composite widget is rendered. If `null`, the tablist element itself will have focus and users will be able to navigate to it using arrow keys. If `undefined`, the first enabled item will be focused.
|
|
139
165
|
|
|
140
|
-
|
|
166
|
+
_Note: this prop will be overridden by the `activeTabId` prop if it is provided._
|
|
141
167
|
|
|
142
168
|
- Required: No
|
|
143
|
-
- Default: `horizontal`
|
|
144
169
|
|
|
145
|
-
###### `
|
|
170
|
+
###### `onActiveTabIdChange`: `( ( activeId: string | null | undefined ) => void )`
|
|
146
171
|
|
|
147
|
-
The
|
|
148
|
-
If left `undefined`, the component assumes it is being used in uncontrolled mode. Consequently, any value different than `undefined` will set the component in `controlled` mode. When in controlled mode, the `null` value will result in no tab being selected.
|
|
172
|
+
The function called when the `selectedTabId` changes.
|
|
149
173
|
|
|
150
|
-
-
|
|
174
|
+
- Required: No
|
|
175
|
+
- Default: `noop`
|
|
176
|
+
|
|
177
|
+
###### `orientation`: `'horizontal' | 'vertical' | 'both'`
|
|
178
|
+
|
|
179
|
+
Defines the orientation of the tablist and determines which arrow keys can be used to move focus:
|
|
180
|
+
|
|
181
|
+
- `both`: all arrow keys work;
|
|
182
|
+
- `horizontal`: only left and right arrow keys work;
|
|
183
|
+
- `vertical`: only up and down arrow keys work.
|
|
184
|
+
|
|
185
|
+
- Required: No
|
|
186
|
+
- Default: `horizontal`
|
|
151
187
|
|
|
152
188
|
#### TabList
|
|
153
189
|
|
|
@@ -155,7 +191,7 @@ If left `undefined`, the component assumes it is being used in uncontrolled mode
|
|
|
155
191
|
|
|
156
192
|
###### `children`: `React.ReactNode`
|
|
157
193
|
|
|
158
|
-
The children elements, which should
|
|
194
|
+
The children elements, which should include one or more instances of the `Tabs.Tab` component.
|
|
159
195
|
|
|
160
196
|
- Required: No
|
|
161
197
|
|
|
@@ -165,26 +201,28 @@ The children elements, which should be a series of `Tabs.TabPanel` components.
|
|
|
165
201
|
|
|
166
202
|
###### `tabId`: `string`
|
|
167
203
|
|
|
168
|
-
|
|
204
|
+
The unique ID of the tab. It will be used to register the tab and match it to a corresponding `Tabs.TabPanel` component. If not provided, a unique ID will be automatically generated.
|
|
169
205
|
|
|
170
206
|
- Required: Yes
|
|
171
207
|
|
|
172
208
|
###### `children`: `React.ReactNode`
|
|
173
209
|
|
|
174
|
-
The
|
|
210
|
+
The contents of the tab.
|
|
175
211
|
|
|
176
212
|
- Required: No
|
|
177
213
|
|
|
178
214
|
###### `disabled`: `boolean`
|
|
179
215
|
|
|
180
|
-
Determines if the tab
|
|
216
|
+
Determines if the tab should be disabled. Note that disabled tabs can still be accessed via the keyboard when navigating through the tablist.
|
|
181
217
|
|
|
182
218
|
- Required: No
|
|
183
219
|
- Default: `false`
|
|
184
220
|
|
|
185
221
|
###### `render`: `React.ReactNode`
|
|
186
222
|
|
|
187
|
-
|
|
223
|
+
Allows the component to be rendered as a different HTML element or React component. The value can be a React element or a function that takes in the original component props and gives back a React element with the props merged.
|
|
224
|
+
|
|
225
|
+
By default, the tab will be rendered as a `button` element.
|
|
188
226
|
|
|
189
227
|
- Required: No
|
|
190
228
|
|
|
@@ -194,19 +232,23 @@ The type of component to render the tab button as. If this prop is not provided,
|
|
|
194
232
|
|
|
195
233
|
###### `children`: `React.ReactNode`
|
|
196
234
|
|
|
197
|
-
The
|
|
235
|
+
The contents of the tab panel.
|
|
198
236
|
|
|
199
237
|
- Required: No
|
|
200
238
|
|
|
201
239
|
###### `tabId`: `string`
|
|
202
240
|
|
|
203
|
-
|
|
241
|
+
The unique `id` of the `Tabs.Tab` component controlling this panel. This connection is used to assign the `aria-labelledby` attribute to the tab panel and to determine if the tab panel should be visible.
|
|
242
|
+
|
|
243
|
+
If not provided, this link is automatically established by matching the order of `Tabs.Tab` and `Tabs.TabPanel` elements in the DOM.
|
|
204
244
|
|
|
205
245
|
- Required: Yes
|
|
206
246
|
|
|
207
247
|
###### `focusable`: `boolean`
|
|
208
248
|
|
|
209
|
-
Determines whether or not the tabpanel element should be focusable.
|
|
249
|
+
Determines whether or not the tabpanel element should be focusable.
|
|
250
|
+
|
|
251
|
+
If `false`, pressing the tab key will skip over the tabpanel, and instead focus on the first focusable element in the panel (if there is one).
|
|
210
252
|
|
|
211
253
|
- Required: No
|
|
212
254
|
- Default: `true`
|