@wordpress/components 33.1.1-next.v.202605131032.0 → 34.0.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 +30 -1
- package/build/autocomplete/index.cjs +5 -4
- package/build/autocomplete/index.cjs.map +3 -3
- package/build/border-control/border-control-dropdown/component.cjs +33 -33
- package/build/border-control/border-control-dropdown/component.cjs.map +3 -3
- package/build/box-control/index.cjs +0 -6
- package/build/box-control/index.cjs.map +2 -2
- package/build/box-control/utils.cjs +0 -38
- package/build/box-control/utils.cjs.map +3 -3
- package/build/custom-gradient-picker/gradient-bar/index.cjs.map +2 -2
- package/build/disabled/index.cjs +1 -1
- package/build/disabled/index.cjs.map +2 -2
- package/build/draggable/index.cjs +101 -7
- package/build/draggable/index.cjs.map +3 -3
- package/build/form-token-field/index.cjs +41 -7
- package/build/form-token-field/index.cjs.map +2 -2
- package/build/higher-order/with-notices/index.cjs +3 -15
- package/build/higher-order/with-notices/index.cjs.map +2 -2
- package/build/index.cjs +0 -17
- package/build/index.cjs.map +2 -2
- package/build/input-control/input-base.cjs +31 -34
- package/build/input-control/input-base.cjs.map +2 -2
- package/build/notice/index.cjs +33 -35
- package/build/notice/index.cjs.map +2 -2
- package/build/popover/index.cjs +12 -0
- package/build/popover/index.cjs.map +2 -2
- package/build/responsive-wrapper/index.cjs +4 -3
- package/build/responsive-wrapper/index.cjs.map +2 -2
- package/build/tabs/styles.cjs +5 -5
- package/build/tabs/styles.cjs.map +2 -2
- package/build/tooltip/index.cjs +2 -1
- package/build/tooltip/index.cjs.map +2 -2
- package/build-module/autocomplete/index.mjs +6 -5
- package/build-module/autocomplete/index.mjs.map +2 -2
- package/build-module/border-control/border-control-dropdown/component.mjs +34 -34
- package/build-module/border-control/border-control-dropdown/component.mjs.map +2 -2
- package/build-module/box-control/index.mjs +0 -2
- package/build-module/box-control/index.mjs.map +2 -2
- package/build-module/box-control/utils.mjs +0 -27
- package/build-module/box-control/utils.mjs.map +2 -2
- package/build-module/custom-gradient-picker/gradient-bar/index.mjs.map +2 -2
- package/build-module/disabled/index.mjs +1 -1
- package/build-module/disabled/index.mjs.map +2 -2
- package/build-module/draggable/index.mjs +101 -7
- package/build-module/draggable/index.mjs.map +3 -3
- package/build-module/form-token-field/index.mjs +41 -7
- package/build-module/form-token-field/index.mjs.map +2 -2
- package/build-module/higher-order/with-notices/index.mjs +4 -16
- package/build-module/higher-order/with-notices/index.mjs.map +2 -2
- package/build-module/index.mjs +87 -99
- package/build-module/index.mjs.map +2 -2
- package/build-module/input-control/input-base.mjs +31 -34
- package/build-module/input-control/input-base.mjs.map +2 -2
- package/build-module/notice/index.mjs +34 -36
- package/build-module/notice/index.mjs.map +2 -2
- package/build-module/popover/index.mjs +12 -0
- package/build-module/popover/index.mjs.map +2 -2
- package/build-module/responsive-wrapper/index.mjs +4 -3
- package/build-module/responsive-wrapper/index.mjs.map +2 -2
- package/build-module/tabs/styles.mjs +5 -5
- package/build-module/tabs/styles.mjs.map +2 -2
- package/build-module/tooltip/index.mjs +2 -1
- package/build-module/tooltip/index.mjs.map +2 -2
- package/build-style/style-rtl.css +64 -66
- package/build-style/style.css +64 -66
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/badge/stories/e2e/index.story.d.ts +7 -0
- package/build-types/badge/stories/e2e/index.story.d.ts.map +1 -0
- package/build-types/border-box-control/border-box-control/hook.d.ts +24 -10
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +26 -12
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +24 -10
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +25 -11
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +24 -10
- 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/border-control-dropdown/hook.d.ts +23 -9
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/box-control/index.d.ts +0 -1
- package/build-types/box-control/index.d.ts.map +1 -1
- package/build-types/box-control/styles/box-control-styles.d.ts +3 -4
- package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
- package/build-types/box-control/utils.d.ts +0 -13
- package/build-types/box-control/utils.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts +1 -0
- package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +25 -11
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/card-body/hook.d.ts +25 -11
- package/build-types/card/card-body/hook.d.ts.map +1 -1
- package/build-types/card/card-divider/hook.d.ts +26 -12
- package/build-types/card/card-divider/hook.d.ts.map +1 -1
- package/build-types/card/card-footer/hook.d.ts +25 -11
- package/build-types/card/card-footer/hook.d.ts.map +1 -1
- package/build-types/card/card-header/hook.d.ts +25 -11
- package/build-types/card/card-header/hook.d.ts.map +1 -1
- package/build-types/card/card-media/hook.d.ts +25 -11
- package/build-types/card/card-media/hook.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +3 -4
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/styles.d.ts +4 -12
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
- package/build-types/date-time/time-picker/styles.d.ts +4 -4
- package/build-types/draggable/index.d.ts.map +1 -1
- package/build-types/draggable/stories/index.story.d.ts +4 -5
- package/build-types/draggable/stories/index.story.d.ts.map +1 -1
- package/build-types/draggable/types.d.ts +4 -0
- package/build-types/draggable/types.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +25 -11
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/flex/flex/hook.d.ts +25 -11
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +25 -11
- package/build-types/flex/flex-block/hook.d.ts.map +1 -1
- package/build-types/flex/flex-item/hook.d.ts +25 -11
- package/build-types/flex/flex-item/hook.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +25 -11
- package/build-types/grid/hook.d.ts.map +1 -1
- package/build-types/h-stack/hook.d.ts +25 -11
- package/build-types/h-stack/hook.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +25 -11
- package/build-types/heading/hook.d.ts.map +1 -1
- package/build-types/higher-order/with-fallback-styles/index.d.ts +1 -3
- package/build-types/higher-order/with-filters/index.d.ts +1 -6
- package/build-types/higher-order/with-filters/index.d.ts.map +1 -1
- package/build-types/higher-order/with-notices/index.d.ts +2 -4
- package/build-types/higher-order/with-notices/index.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts +0 -6
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/index.d.ts +1 -6
- package/build-types/index.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts +1 -1
- package/build-types/item-group/item/hook.d.ts +25 -11
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/hook.d.ts +25 -11
- package/build-types/item-group/item-group/hook.d.ts.map +1 -1
- package/build-types/menu/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/styles.d.ts +7 -21
- package/build-types/menu/styles.d.ts.map +1 -1
- package/build-types/modal/use-modal-exit-animation.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +26 -12
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +26 -12
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/notice/index.d.ts.map +1 -1
- package/build-types/notice/types.d.ts +1 -2
- package/build-types/notice/types.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +1 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +1 -1
- package/build-types/number-control/stories/index.story.d.ts.map +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +2 -2
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/range-control/index.d.ts +2 -3
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/stories/index.story.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
- package/build-types/range-control/types.d.ts +1 -5
- package/build-types/range-control/types.d.ts.map +1 -1
- package/build-types/responsive-wrapper/index.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +25 -11
- package/build-types/scrollable/hook.d.ts.map +1 -1
- package/build-types/snackbar/index.d.ts +2 -2
- package/build-types/snackbar/types.d.ts +2 -2
- package/build-types/snackbar/types.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +25 -11
- package/build-types/spacer/hook.d.ts.map +1 -1
- package/build-types/surface/hook.d.ts +25 -11
- package/build-types/surface/hook.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts +0 -6
- package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts +0 -6
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts +3 -9
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +25 -11
- package/build-types/text/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +25 -11
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +25 -11
- package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +25 -11
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +25 -11
- package/build-types/truncate/hook.d.ts.map +1 -1
- package/build-types/unit-control/index.d.ts +1 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
- package/build-types/utils/get-node-text.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +25 -11
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/number-control.d.ts +1 -1
- package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/range-control.d.ts +2 -3
- package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/control-with-error.d.ts +4 -1
- package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
- package/package.json +27 -25
- package/src/autocomplete/README.md +1 -1
- package/src/autocomplete/index.tsx +25 -7
- package/src/badge/stories/e2e/index.story.tsx +21 -0
- package/src/border-control/border-control-dropdown/component.tsx +36 -37
- package/src/box-control/index.tsx +0 -1
- package/src/box-control/utils.ts +0 -43
- package/src/button/stories/e2e/index.story.tsx +11 -0
- package/src/composite/stories/index.story.tsx +0 -1
- package/src/custom-gradient-picker/gradient-bar/index.tsx +1 -1
- package/src/disabled/index.tsx +1 -1
- package/src/draggable/index.tsx +32 -10
- package/src/draggable/stories/index.story.tsx +11 -6
- package/src/draggable/style.module.scss +29 -0
- package/src/draggable/types.ts +4 -0
- package/src/form-file-upload/README.md +1 -1
- package/src/form-token-field/index.tsx +84 -8
- package/src/form-token-field/test/index.tsx +189 -0
- package/src/h-stack/hook.tsx +1 -1
- package/src/higher-order/with-notices/index.tsx +4 -21
- package/src/higher-order/with-notices/test/index.tsx +0 -18
- package/src/icon/stories/index.story.tsx +2 -14
- package/src/index.ts +0 -6
- package/src/input-control/input-base.tsx +2 -2
- package/src/menu/README.md +7 -7
- package/src/menu/stories/index.story.tsx +0 -1
- package/src/menu/test/index.tsx +9 -4
- package/src/modal/style.scss +2 -1
- package/src/notice/README.md +1 -2
- package/src/notice/index.tsx +57 -64
- package/src/notice/style.scss +49 -41
- package/src/notice/test/__snapshots__/index.tsx.snap +23 -23
- package/src/notice/test/index.tsx +5 -5
- package/src/notice/types.ts +1 -2
- package/src/popover/index.tsx +29 -1
- package/src/popover/test/index.tsx +138 -1
- package/src/popover/types.ts +2 -4
- package/src/range-control/stories/index.story.tsx +0 -1
- package/src/range-control/types.ts +1 -5
- package/src/responsive-wrapper/index.tsx +7 -3
- package/src/snackbar/README.md +1 -1
- package/src/snackbar/types.ts +2 -2
- package/src/style.scss +0 -1
- package/src/tab-panel/stories/index.story.tsx +2 -13
- package/src/tab-panel/style.scss +36 -14
- package/src/tabs/README.md +1 -1
- package/src/tabs/stories/index.story.tsx +2 -14
- package/src/tabs/styles.ts +3 -8
- package/src/tabs/tablist.tsx +1 -1
- package/src/tooltip/index.tsx +7 -1
- package/src/tree-grid/test/cell.tsx +0 -1
- package/src/tree-grid/test/roving-tab-index-item.tsx +0 -1
- package/src/tree-select/README.md +1 -1
- package/src/utils/get-node-text.ts +7 -1
- package/src/validated-form-controls/control-with-error.tsx +6 -1
- package/build/navigation/back-button/index.cjs +0 -86
- package/build/navigation/back-button/index.cjs.map +0 -7
- package/build/navigation/constants.cjs +0 -34
- package/build/navigation/constants.cjs.map +0 -7
- package/build/navigation/context.cjs +0 -58
- package/build/navigation/context.cjs.map +0 -7
- package/build/navigation/group/context.cjs +0 -38
- package/build/navigation/group/context.cjs.map +0 -7
- package/build/navigation/group/index.cjs +0 -88
- package/build/navigation/group/index.cjs.map +0 -7
- package/build/navigation/index.cjs +0 -113
- package/build/navigation/index.cjs.map +0 -7
- package/build/navigation/item/base-content.cjs +0 -44
- package/build/navigation/item/base-content.cjs.map +0 -7
- package/build/navigation/item/base.cjs +0 -66
- package/build/navigation/item/base.cjs.map +0 -7
- package/build/navigation/item/index.cjs +0 -119
- package/build/navigation/item/index.cjs.map +0 -7
- package/build/navigation/item/use-navigation-tree-item.cjs +0 -64
- package/build/navigation/item/use-navigation-tree-item.cjs.map +0 -7
- package/build/navigation/menu/context.cjs +0 -39
- package/build/navigation/menu/context.cjs.map +0 -7
- package/build/navigation/menu/index.cjs +0 -114
- package/build/navigation/menu/index.cjs.map +0 -7
- package/build/navigation/menu/menu-title-search.cjs +0 -111
- package/build/navigation/menu/menu-title-search.cjs.map +0 -7
- package/build/navigation/menu/menu-title.cjs +0 -104
- package/build/navigation/menu/menu-title.cjs.map +0 -7
- package/build/navigation/menu/search-no-results-found.cjs +0 -48
- package/build/navigation/menu/search-no-results-found.cjs.map +0 -7
- package/build/navigation/menu/use-navigation-tree-menu.cjs +0 -51
- package/build/navigation/menu/use-navigation-tree-menu.cjs.map +0 -7
- package/build/navigation/styles/navigation-styles.cjs +0 -170
- package/build/navigation/styles/navigation-styles.cjs.map +0 -7
- package/build/navigation/types.cjs +0 -19
- package/build/navigation/types.cjs.map +0 -7
- package/build/navigation/use-create-navigation-tree.cjs +0 -103
- package/build/navigation/use-create-navigation-tree.cjs.map +0 -7
- package/build/navigation/use-navigation-tree-nodes.cjs +0 -60
- package/build/navigation/use-navigation-tree-nodes.cjs.map +0 -7
- package/build/navigation/utils.cjs +0 -45
- package/build/navigation/utils.cjs.map +0 -7
- package/build-module/navigation/back-button/index.mjs +0 -51
- package/build-module/navigation/back-button/index.mjs.map +0 -7
- package/build-module/navigation/constants.mjs +0 -8
- package/build-module/navigation/constants.mjs.map +0 -7
- package/build-module/navigation/context.mjs +0 -32
- package/build-module/navigation/context.mjs.map +0 -7
- package/build-module/navigation/group/context.mjs +0 -12
- package/build-module/navigation/group/context.mjs.map +0 -7
- package/build-module/navigation/group/index.mjs +0 -53
- package/build-module/navigation/group/index.mjs.map +0 -7
- package/build-module/navigation/index.mjs +0 -78
- package/build-module/navigation/index.mjs.map +0 -7
- package/build-module/navigation/item/base-content.mjs +0 -23
- package/build-module/navigation/item/base-content.mjs.map +0 -7
- package/build-module/navigation/item/base.mjs +0 -35
- package/build-module/navigation/item/base.mjs.map +0 -7
- package/build-module/navigation/item/index.mjs +0 -84
- package/build-module/navigation/item/index.mjs.map +0 -7
- package/build-module/navigation/item/use-navigation-tree-item.mjs +0 -39
- package/build-module/navigation/item/use-navigation-tree-item.mjs.map +0 -7
- package/build-module/navigation/menu/context.mjs +0 -13
- package/build-module/navigation/menu/context.mjs.map +0 -7
- package/build-module/navigation/menu/index.mjs +0 -79
- package/build-module/navigation/menu/index.mjs.map +0 -7
- package/build-module/navigation/menu/menu-title-search.mjs +0 -80
- package/build-module/navigation/menu/menu-title-search.mjs.map +0 -7
- package/build-module/navigation/menu/menu-title.mjs +0 -73
- package/build-module/navigation/menu/menu-title.mjs.map +0 -7
- package/build-module/navigation/menu/search-no-results-found.mjs +0 -27
- package/build-module/navigation/menu/search-no-results-found.mjs.map +0 -7
- package/build-module/navigation/menu/use-navigation-tree-menu.mjs +0 -26
- package/build-module/navigation/menu/use-navigation-tree-menu.mjs.map +0 -7
- package/build-module/navigation/styles/navigation-styles.mjs +0 -124
- package/build-module/navigation/styles/navigation-styles.mjs.map +0 -7
- package/build-module/navigation/types.mjs +0 -1
- package/build-module/navigation/types.mjs.map +0 -7
- package/build-module/navigation/use-create-navigation-tree.mjs +0 -78
- package/build-module/navigation/use-create-navigation-tree.mjs.map +0 -7
- package/build-module/navigation/use-navigation-tree-nodes.mjs +0 -35
- package/build-module/navigation/use-navigation-tree-nodes.mjs.map +0 -7
- package/build-module/navigation/utils.mjs +0 -9
- package/build-module/navigation/utils.mjs.map +0 -7
- package/build-types/navigation/back-button/index.d.ts +0 -7
- package/build-types/navigation/back-button/index.d.ts.map +0 -1
- package/build-types/navigation/constants.d.ts +0 -3
- package/build-types/navigation/constants.d.ts.map +0 -1
- package/build-types/navigation/context.d.ts +0 -4
- package/build-types/navigation/context.d.ts.map +0 -1
- package/build-types/navigation/group/context.d.ts +0 -7
- package/build-types/navigation/group/context.d.ts.map +0 -1
- package/build-types/navigation/group/index.d.ts +0 -7
- package/build-types/navigation/group/index.d.ts.map +0 -1
- package/build-types/navigation/index.d.ts +0 -46
- package/build-types/navigation/index.d.ts.map +0 -1
- package/build-types/navigation/item/base-content.d.ts +0 -3
- package/build-types/navigation/item/base-content.d.ts.map +0 -1
- package/build-types/navigation/item/base.d.ts +0 -3
- package/build-types/navigation/item/base.d.ts.map +0 -1
- package/build-types/navigation/item/index.d.ts +0 -7
- package/build-types/navigation/item/index.d.ts.map +0 -1
- package/build-types/navigation/item/use-navigation-tree-item.d.ts +0 -3
- package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +0 -1
- package/build-types/navigation/menu/context.d.ts +0 -7
- package/build-types/navigation/menu/context.d.ts.map +0 -1
- package/build-types/navigation/menu/index.d.ts +0 -7
- package/build-types/navigation/menu/index.d.ts.map +0 -1
- package/build-types/navigation/menu/menu-title-search.d.ts +0 -3
- package/build-types/navigation/menu/menu-title-search.d.ts.map +0 -1
- package/build-types/navigation/menu/menu-title.d.ts +0 -3
- package/build-types/navigation/menu/menu-title.d.ts.map +0 -1
- package/build-types/navigation/menu/search-no-results-found.d.ts +0 -3
- package/build-types/navigation/menu/search-no-results-found.d.ts.map +0 -1
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +0 -3
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +0 -1
- package/build-types/navigation/stories/index.story.d.ts +0 -23
- package/build-types/navigation/stories/index.story.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/controlled-state.d.ts +0 -7
- package/build-types/navigation/stories/utils/controlled-state.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/default.d.ts +0 -10
- package/build-types/navigation/stories/utils/default.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/group.d.ts +0 -10
- package/build-types/navigation/stories/utils/group.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts +0 -10
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/more-examples.d.ts +0 -10
- package/build-types/navigation/stories/utils/more-examples.d.ts.map +0 -1
- package/build-types/navigation/stories/utils/search.d.ts +0 -10
- package/build-types/navigation/stories/utils/search.d.ts.map +0 -1
- package/build-types/navigation/styles/navigation-styles.d.ts +0 -55
- package/build-types/navigation/styles/navigation-styles.d.ts.map +0 -1
- package/build-types/navigation/test/index.d.ts +0 -2
- package/build-types/navigation/test/index.d.ts.map +0 -1
- package/build-types/navigation/types.d.ts +0 -266
- package/build-types/navigation/types.d.ts.map +0 -1
- package/build-types/navigation/use-create-navigation-tree.d.ts +0 -15
- package/build-types/navigation/use-create-navigation-tree.d.ts.map +0 -1
- package/build-types/navigation/use-navigation-tree-nodes.d.ts +0 -10
- package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +0 -1
- package/build-types/navigation/utils.d.ts +0 -3
- package/build-types/navigation/utils.d.ts.map +0 -1
- package/src/draggable/style.scss +0 -21
- package/src/navigation/README.md +0 -267
- package/src/navigation/back-button/index.tsx +0 -73
- package/src/navigation/constants.tsx +0 -2
- package/src/navigation/context.tsx +0 -40
- package/src/navigation/group/context.tsx +0 -16
- package/src/navigation/group/index.tsx +0 -73
- package/src/navigation/index.tsx +0 -152
- package/src/navigation/item/base-content.tsx +0 -31
- package/src/navigation/item/base.tsx +0 -42
- package/src/navigation/item/index.tsx +0 -112
- package/src/navigation/item/use-navigation-tree-item.tsx +0 -47
- package/src/navigation/menu/context.tsx +0 -20
- package/src/navigation/menu/index.tsx +0 -105
- package/src/navigation/menu/menu-title-search.tsx +0 -99
- package/src/navigation/menu/menu-title.tsx +0 -100
- package/src/navigation/menu/search-no-results-found.tsx +0 -34
- package/src/navigation/menu/use-navigation-tree-menu.tsx +0 -29
- package/src/navigation/stories/index.story.tsx +0 -62
- package/src/navigation/stories/style.css +0 -25
- package/src/navigation/stories/utils/controlled-state.tsx +0 -149
- package/src/navigation/stories/utils/default.tsx +0 -92
- package/src/navigation/stories/utils/group.tsx +0 -61
- package/src/navigation/stories/utils/hide-if-empty.tsx +0 -66
- package/src/navigation/stories/utils/more-examples.tsx +0 -162
- package/src/navigation/stories/utils/search.tsx +0 -91
- package/src/navigation/styles/navigation-styles.tsx +0 -197
- package/src/navigation/test/index.tsx +0 -347
- package/src/navigation/types.ts +0 -325
- package/src/navigation/use-create-navigation-tree.tsx +0 -110
- package/src/navigation/use-navigation-tree-nodes.tsx +0 -31
- package/src/navigation/utils.tsx +0 -11
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
act,
|
|
6
|
+
render,
|
|
7
|
+
screen,
|
|
8
|
+
waitFor,
|
|
9
|
+
getByText,
|
|
10
|
+
} from '@testing-library/react';
|
|
5
11
|
import userEvent from '@testing-library/user-event';
|
|
6
12
|
import type { CSSProperties } from 'react';
|
|
7
13
|
|
|
@@ -663,4 +669,135 @@ describe( 'Popover', () => {
|
|
|
663
669
|
} );
|
|
664
670
|
} );
|
|
665
671
|
} );
|
|
672
|
+
|
|
673
|
+
describe( 'wp compat overlay slot', () => {
|
|
674
|
+
function createOverlaySlot() {
|
|
675
|
+
const slot = document.createElement( 'div' );
|
|
676
|
+
slot.setAttribute( 'data-wp-compat-overlay-slot', '' );
|
|
677
|
+
const slotButton = document.createElement( 'button' );
|
|
678
|
+
slotButton.textContent = 'Slotted item';
|
|
679
|
+
slot.appendChild( slotButton );
|
|
680
|
+
document.body.appendChild( slot );
|
|
681
|
+
return { slot, slotButton };
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
it( 'should not call onFocusOutside when focus moves into the wp compat overlay slot', async () => {
|
|
685
|
+
const user = userEvent.setup();
|
|
686
|
+
const onFocusOutside = jest.fn();
|
|
687
|
+
const { slot, slotButton } = createOverlaySlot();
|
|
688
|
+
|
|
689
|
+
render(
|
|
690
|
+
<Popover onFocusOutside={ onFocusOutside }>
|
|
691
|
+
<button>Inside popover</button>
|
|
692
|
+
</Popover>
|
|
693
|
+
);
|
|
694
|
+
|
|
695
|
+
await user.click( screen.getByText( 'Inside popover' ) );
|
|
696
|
+
await user.click( slotButton );
|
|
697
|
+
|
|
698
|
+
await new Promise( ( resolve ) => setTimeout( resolve, 50 ) );
|
|
699
|
+
expect( onFocusOutside ).not.toHaveBeenCalled();
|
|
700
|
+
|
|
701
|
+
document.body.removeChild( slot );
|
|
702
|
+
} );
|
|
703
|
+
|
|
704
|
+
it( 'should not call onFocusOutside when focus returns from the slot to a popover descendant', async () => {
|
|
705
|
+
const user = userEvent.setup();
|
|
706
|
+
const onFocusOutside = jest.fn();
|
|
707
|
+
const { slot, slotButton } = createOverlaySlot();
|
|
708
|
+
|
|
709
|
+
render(
|
|
710
|
+
<Popover onFocusOutside={ onFocusOutside }>
|
|
711
|
+
<button>Inside popover</button>
|
|
712
|
+
</Popover>
|
|
713
|
+
);
|
|
714
|
+
|
|
715
|
+
const insideButton = screen.getByText( 'Inside popover' );
|
|
716
|
+
await user.click( insideButton );
|
|
717
|
+
await user.click( slotButton );
|
|
718
|
+
insideButton.focus();
|
|
719
|
+
|
|
720
|
+
await new Promise( ( resolve ) => setTimeout( resolve, 50 ) );
|
|
721
|
+
expect( onFocusOutside ).not.toHaveBeenCalled();
|
|
722
|
+
|
|
723
|
+
document.body.removeChild( slot );
|
|
724
|
+
} );
|
|
725
|
+
|
|
726
|
+
it( 'should not call onFocusOutside when focus is restored to a popover descendant by the time the blur check runs', async () => {
|
|
727
|
+
// Mimics the base-ui `Select` backdrop dismissal: focus drops
|
|
728
|
+
// to `body` (so the captured `relatedTarget` is `null`), then
|
|
729
|
+
// is synchronously restored to the popover before the blur
|
|
730
|
+
// check runs.
|
|
731
|
+
const onFocusOutside = jest.fn();
|
|
732
|
+
const { slot, slotButton } = createOverlaySlot();
|
|
733
|
+
|
|
734
|
+
render(
|
|
735
|
+
<Popover
|
|
736
|
+
data-testid="popover"
|
|
737
|
+
onFocusOutside={ onFocusOutside }
|
|
738
|
+
>
|
|
739
|
+
<button>Trigger</button>
|
|
740
|
+
</Popover>
|
|
741
|
+
);
|
|
742
|
+
|
|
743
|
+
const trigger = screen.getByText( 'Trigger' );
|
|
744
|
+
const floating = screen.getByTestId( 'popover' );
|
|
745
|
+
|
|
746
|
+
await act( async () => {
|
|
747
|
+
slotButton.focus();
|
|
748
|
+
floating.dispatchEvent(
|
|
749
|
+
new FocusEvent( 'blur', {
|
|
750
|
+
bubbles: true,
|
|
751
|
+
relatedTarget: null,
|
|
752
|
+
} )
|
|
753
|
+
);
|
|
754
|
+
trigger.focus();
|
|
755
|
+
await new Promise( ( resolve ) => setTimeout( resolve, 50 ) );
|
|
756
|
+
} );
|
|
757
|
+
|
|
758
|
+
expect( onFocusOutside ).not.toHaveBeenCalled();
|
|
759
|
+
|
|
760
|
+
document.body.removeChild( slot );
|
|
761
|
+
} );
|
|
762
|
+
|
|
763
|
+
it( 'should still call onFocusOutside when focus moves to a sibling outside the slot', async () => {
|
|
764
|
+
const user = userEvent.setup();
|
|
765
|
+
const onFocusOutside = jest.fn();
|
|
766
|
+
|
|
767
|
+
render(
|
|
768
|
+
<>
|
|
769
|
+
<Popover onFocusOutside={ onFocusOutside }>
|
|
770
|
+
<button>Inside popover</button>
|
|
771
|
+
</Popover>
|
|
772
|
+
<button>Outside</button>
|
|
773
|
+
</>
|
|
774
|
+
);
|
|
775
|
+
|
|
776
|
+
await user.click( screen.getByText( 'Inside popover' ) );
|
|
777
|
+
await user.click( screen.getByText( 'Outside' ) );
|
|
778
|
+
|
|
779
|
+
await waitFor( () => {
|
|
780
|
+
expect( onFocusOutside ).toHaveBeenCalledTimes( 1 );
|
|
781
|
+
} );
|
|
782
|
+
} );
|
|
783
|
+
} );
|
|
784
|
+
|
|
785
|
+
it( 'should call a consumer-provided onKeyDown alongside close-on-Escape', async () => {
|
|
786
|
+
const user = userEvent.setup();
|
|
787
|
+
const onClose = jest.fn();
|
|
788
|
+
const onKeyDown = jest.fn();
|
|
789
|
+
|
|
790
|
+
render(
|
|
791
|
+
<Popover onClose={ onClose } onKeyDown={ onKeyDown }>
|
|
792
|
+
<button>Inside popover</button>
|
|
793
|
+
</Popover>
|
|
794
|
+
);
|
|
795
|
+
|
|
796
|
+
await user.click( screen.getByText( 'Inside popover' ) );
|
|
797
|
+
await user.keyboard( '[Escape]' );
|
|
798
|
+
|
|
799
|
+
expect( onKeyDown ).toHaveBeenCalled();
|
|
800
|
+
expect( onKeyDown.mock.calls[ 0 ][ 0 ].key ).toBe( 'Escape' );
|
|
801
|
+
expect( onClose ).toHaveBeenCalledTimes( 1 );
|
|
802
|
+
} );
|
|
666
803
|
} );
|
package/src/popover/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Placement } from '@floating-ui/react-dom';
|
|
2
2
|
import type { useFocusOnMount } from '@wordpress/compose';
|
|
3
|
-
import type {
|
|
3
|
+
import type { RefObject, ReactNode, SyntheticEvent } from 'react';
|
|
4
4
|
|
|
5
5
|
type PositionYAxis = 'top' | 'middle' | 'bottom';
|
|
6
6
|
type PositionXAxis = 'left' | 'center' | 'right';
|
|
@@ -12,9 +12,7 @@ type DomRectWithOwnerDocument = DOMRect & {
|
|
|
12
12
|
|
|
13
13
|
type PopoverPlacement = Placement | 'overlay';
|
|
14
14
|
|
|
15
|
-
export type PopoverAnchorRefReference =
|
|
16
|
-
Element | null | undefined
|
|
17
|
-
>;
|
|
15
|
+
export type PopoverAnchorRefReference = RefObject< Element | null | undefined >;
|
|
18
16
|
export type PopoverAnchorRefTopBottom = { top: Element; bottom: Element };
|
|
19
17
|
|
|
20
18
|
export type VirtualElement = Pick< Element, 'getBoundingClientRect' > & {
|
|
@@ -35,7 +35,6 @@ const meta: Meta< typeof RangeControl > = {
|
|
|
35
35
|
},
|
|
36
36
|
color: { control: { type: 'color' } },
|
|
37
37
|
help: { control: { type: 'text' } },
|
|
38
|
-
icon: { control: false },
|
|
39
38
|
marks: { control: { type: 'object' } },
|
|
40
39
|
onBlur: { control: false },
|
|
41
40
|
onChange: { control: false },
|
|
@@ -114,10 +114,6 @@ export type RangeControlProps = Pick<
|
|
|
114
114
|
* `undefined`.
|
|
115
115
|
*/
|
|
116
116
|
currentInput?: number;
|
|
117
|
-
/**
|
|
118
|
-
* An icon to be shown above the slider next to its container title.
|
|
119
|
-
*/
|
|
120
|
-
icon?: string;
|
|
121
117
|
/**
|
|
122
118
|
* The slider starting position, used when no `value` is passed.
|
|
123
119
|
* The `initialPosition` will be clamped between the provided `min`
|
|
@@ -153,7 +149,7 @@ export type RangeControlProps = Pick<
|
|
|
153
149
|
*
|
|
154
150
|
* @default () => void
|
|
155
151
|
*/
|
|
156
|
-
onChange?: ( value
|
|
152
|
+
onChange?: ( value: number | undefined ) => void;
|
|
157
153
|
/**
|
|
158
154
|
* Callback for when `RangeControl` input gains focus.
|
|
159
155
|
*
|
|
@@ -45,16 +45,20 @@ function ResponsiveWrapper( {
|
|
|
45
45
|
aspectRatio = `${ naturalWidth } / ${ naturalHeight }`;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
const ch = children as React.ReactElement<
|
|
49
|
+
Pick< React.HTMLAttributes< Element >, 'className' | 'style' >
|
|
50
|
+
>;
|
|
51
|
+
|
|
48
52
|
return (
|
|
49
53
|
<TagName className="components-responsive-wrapper">
|
|
50
54
|
<div>
|
|
51
|
-
{ cloneElement(
|
|
55
|
+
{ cloneElement( ch, {
|
|
52
56
|
className: clsx(
|
|
53
57
|
'components-responsive-wrapper__content',
|
|
54
|
-
|
|
58
|
+
ch.props.className
|
|
55
59
|
),
|
|
56
60
|
style: {
|
|
57
|
-
...
|
|
61
|
+
...ch.props.style,
|
|
58
62
|
aspectRatio,
|
|
59
63
|
},
|
|
60
64
|
} ) }
|
package/src/snackbar/README.md
CHANGED
package/src/snackbar/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { RefObject, ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
@@ -25,7 +25,7 @@ type SnackbarOnlyProps = {
|
|
|
25
25
|
/**
|
|
26
26
|
* A ref to the list that contains the snackbar.
|
|
27
27
|
*/
|
|
28
|
-
listRef?:
|
|
28
|
+
listRef?: RefObject< HTMLDivElement | null >;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export type SnackbarProps = Pick<
|
package/src/style.scss
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
@use "./combobox-control/style.scss" as *;
|
|
13
13
|
@use "./color-palette/style.scss" as *;
|
|
14
14
|
@use "./custom-gradient-picker/style.scss" as *;
|
|
15
|
-
@use "./draggable/style.scss" as *;
|
|
16
15
|
@use "./drop-zone/style.scss" as *;
|
|
17
16
|
@use "./dropdown/style.scss" as *;
|
|
18
17
|
@use "./dropdown-menu/style.scss" as *;
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import type { Meta, StoryFn } from '@storybook/react-vite';
|
|
5
2
|
import { fn } from 'storybook/test';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
3
|
import { link, more, wordpress } from '@wordpress/icons';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
4
|
import TabPanel from '..';
|
|
16
5
|
|
|
17
6
|
const meta: Meta< typeof TabPanel > = {
|
|
@@ -22,9 +11,9 @@ const meta: Meta< typeof TabPanel > = {
|
|
|
22
11
|
controls: { expanded: true },
|
|
23
12
|
docs: { canvas: { sourceState: 'shown' } },
|
|
24
13
|
componentStatus: {
|
|
25
|
-
status: '
|
|
14
|
+
status: 'not-recommended',
|
|
26
15
|
whereUsed: 'global',
|
|
27
|
-
notes: '
|
|
16
|
+
notes: 'Use `Tabs` from `@wordpress/ui` instead.',
|
|
28
17
|
},
|
|
29
18
|
},
|
|
30
19
|
args: {
|
package/src/tab-panel/style.scss
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
@use "@wordpress/base-styles/colors" as *;
|
|
2
1
|
@use "@wordpress/base-styles/variables" as *;
|
|
3
|
-
@use "../utils/theme-variables" as *;
|
|
4
2
|
|
|
5
3
|
.components-tab-panel__tabs {
|
|
6
4
|
display: flex;
|
|
7
5
|
align-items: stretch;
|
|
8
6
|
flex-direction: row;
|
|
7
|
+
|
|
9
8
|
&[aria-orientation="vertical"] {
|
|
10
9
|
flex-direction: column;
|
|
11
10
|
}
|
|
@@ -19,9 +18,19 @@
|
|
|
19
18
|
border: none;
|
|
20
19
|
box-shadow: none;
|
|
21
20
|
cursor: var(--wpds-cursor-control);
|
|
22
|
-
padding: 3px
|
|
21
|
+
padding: 3px var(--wpds-dimension-padding-lg); // Use padding to offset the is-active border, this benefits Windows High Contrast mode
|
|
23
22
|
margin-left: 0;
|
|
24
|
-
font-weight:
|
|
23
|
+
font-weight: var(--wpds-typography-font-weight-regular);
|
|
24
|
+
color: var(--wpds-color-fg-interactive-neutral);
|
|
25
|
+
|
|
26
|
+
&:disabled,
|
|
27
|
+
&[aria-disabled="true"] {
|
|
28
|
+
color: var(--wpds-color-fg-interactive-neutral-disabled);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:not(:disabled, [aria-disabled="true"]):is(:hover, :focus-visible) {
|
|
32
|
+
color: var(--wpds-color-fg-interactive-neutral-active);
|
|
33
|
+
}
|
|
25
34
|
|
|
26
35
|
&:focus:not(:disabled) {
|
|
27
36
|
position: relative;
|
|
@@ -39,8 +48,8 @@
|
|
|
39
48
|
pointer-events: none;
|
|
40
49
|
|
|
41
50
|
// Draw the indicator.
|
|
42
|
-
background:
|
|
43
|
-
height: calc(0 * var(--
|
|
51
|
+
background: var(--wpds-color-stroke-interactive-neutral-strong);
|
|
52
|
+
height: calc(0 * var(--wpds-border-width-focus));
|
|
44
53
|
border-radius: 0;
|
|
45
54
|
|
|
46
55
|
// Animation
|
|
@@ -51,7 +60,7 @@
|
|
|
51
60
|
|
|
52
61
|
// Active.
|
|
53
62
|
&.is-active::after {
|
|
54
|
-
height: calc(1 * var(--
|
|
63
|
+
height: calc(1 * var(--wpds-border-width-focus));
|
|
55
64
|
|
|
56
65
|
// Windows high contrast mode.
|
|
57
66
|
outline: 2px solid transparent;
|
|
@@ -62,15 +71,12 @@
|
|
|
62
71
|
&::before {
|
|
63
72
|
content: "";
|
|
64
73
|
position: absolute;
|
|
65
|
-
|
|
66
|
-
right: $grid-unit-15;
|
|
67
|
-
bottom: $grid-unit-15;
|
|
68
|
-
left: $grid-unit-15;
|
|
74
|
+
inset: var(--wpds-dimension-padding-md);
|
|
69
75
|
pointer-events: none;
|
|
70
76
|
|
|
71
77
|
// Draw the indicator.
|
|
72
78
|
box-shadow: 0 0 0 0 transparent;
|
|
73
|
-
border-radius:
|
|
79
|
+
border-radius: var(--wpds-border-radius-sm);
|
|
74
80
|
|
|
75
81
|
// Animation
|
|
76
82
|
@media not (prefers-reduced-motion) {
|
|
@@ -79,11 +85,25 @@
|
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
&:focus-visible::before {
|
|
82
|
-
box-shadow:
|
|
88
|
+
box-shadow:
|
|
89
|
+
0 0 0 var(--wpds-border-width-focus)
|
|
90
|
+
var(--wpds-color-stroke-focus-brand);
|
|
83
91
|
|
|
84
92
|
// Windows high contrast mode.
|
|
85
93
|
outline: 2px solid transparent;
|
|
86
94
|
}
|
|
95
|
+
|
|
96
|
+
.components-tab-panel__tabs[aria-orientation="vertical"] & {
|
|
97
|
+
border-radius: var(--wpds-border-radius-sm);
|
|
98
|
+
|
|
99
|
+
&::after {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&.is-active {
|
|
104
|
+
background: var(--wpds-color-bg-interactive-neutral-weak-active);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
87
107
|
}
|
|
88
108
|
|
|
89
109
|
.components-tab-panel__tab-content {
|
|
@@ -93,7 +113,9 @@
|
|
|
93
113
|
}
|
|
94
114
|
|
|
95
115
|
&:focus-visible {
|
|
96
|
-
box-shadow:
|
|
116
|
+
box-shadow:
|
|
117
|
+
0 0 0 var(--wpds-border-width-focus)
|
|
118
|
+
var(--wpds-color-stroke-focus-brand);
|
|
97
119
|
|
|
98
120
|
// Windows high contrast mode.
|
|
99
121
|
outline: 2px solid transparent;
|
package/src/tabs/README.md
CHANGED
|
@@ -164,7 +164,7 @@ still be accessed via the keyboard when navigating through the tablist.
|
|
|
164
164
|
|
|
165
165
|
##### `render`
|
|
166
166
|
|
|
167
|
-
- Type: `RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }> | ReactElement<
|
|
167
|
+
- Type: `RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }> | ReactElement<unknown, string | JSXElementConstructor<any>>`
|
|
168
168
|
- Required: No
|
|
169
169
|
|
|
170
170
|
Allows the component to be rendered as a different HTML element or React
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import type { Meta, StoryFn } from '@storybook/react-vite';
|
|
5
2
|
import { fn } from 'storybook/test';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
3
|
import { wordpress, more, link } from '@wordpress/icons';
|
|
11
4
|
import { useState } from '@wordpress/element';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
5
|
import { Tabs } from '..';
|
|
17
6
|
import { Slot, Fill, Provider as SlotFillProvider } from '../../slot-fill';
|
|
18
7
|
import Button from '../../button';
|
|
@@ -27,7 +16,6 @@ const meta: Meta< typeof Tabs > = {
|
|
|
27
16
|
'Tabs.TabList': Tabs.TabList,
|
|
28
17
|
'Tabs.Tab': Tabs.Tab,
|
|
29
18
|
'Tabs.TabPanel': Tabs.TabPanel,
|
|
30
|
-
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
31
19
|
'Tabs.Context': Tabs.Context,
|
|
32
20
|
},
|
|
33
21
|
tags: [ 'status-private' ],
|
|
@@ -35,9 +23,9 @@ const meta: Meta< typeof Tabs > = {
|
|
|
35
23
|
controls: { expanded: true },
|
|
36
24
|
docs: { canvas: { sourceState: 'shown' } },
|
|
37
25
|
componentStatus: {
|
|
38
|
-
status: 'recommended',
|
|
26
|
+
status: 'not-recommended',
|
|
39
27
|
whereUsed: 'global',
|
|
40
|
-
notes: '
|
|
28
|
+
notes: 'Use `Tabs` from `@wordpress/ui` instead.',
|
|
41
29
|
},
|
|
42
30
|
},
|
|
43
31
|
args: {
|
package/src/tabs/styles.ts
CHANGED
|
@@ -99,7 +99,7 @@ export const StyledTabList = styled( Ariakit.TabList )`
|
|
|
99
99
|
)
|
|
100
100
|
);
|
|
101
101
|
border-bottom: var( --wp-admin-border-width-focus ) solid
|
|
102
|
-
${ COLORS.theme.
|
|
102
|
+
${ COLORS.theme.gray[ 700 ] };
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
&[aria-orientation='vertical'] {
|
|
@@ -124,11 +124,7 @@ export const StyledTabList = styled( Ariakit.TabList )`
|
|
|
124
124
|
var( --antialiasing-factor )
|
|
125
125
|
)
|
|
126
126
|
);
|
|
127
|
-
background-color:
|
|
128
|
-
in srgb,
|
|
129
|
-
${ COLORS.theme.accent },
|
|
130
|
-
transparent 96%
|
|
131
|
-
);
|
|
127
|
+
background-color: ${ COLORS.theme.gray[ 100 ] };
|
|
132
128
|
}
|
|
133
129
|
&[data-select-on-move='true']:has(
|
|
134
130
|
:is( :focus-visible, [data-focus-visible] )
|
|
@@ -173,7 +169,7 @@ export const Tab = styled( Ariakit.Tab )`
|
|
|
173
169
|
}
|
|
174
170
|
|
|
175
171
|
&:not( [aria-disabled='true'] ):is( :hover, [data-focus-visible] ) {
|
|
176
|
-
color: ${ COLORS.theme.
|
|
172
|
+
color: ${ COLORS.theme.foreground };
|
|
177
173
|
}
|
|
178
174
|
|
|
179
175
|
&:focus:not( :disabled ) {
|
|
@@ -222,7 +218,6 @@ export const Tab = styled( Ariakit.Tab )`
|
|
|
222
218
|
min-height: ${ space( 10 ) };
|
|
223
219
|
|
|
224
220
|
&[aria-selected='true'] {
|
|
225
|
-
color: ${ COLORS.theme.accent };
|
|
226
221
|
fill: currentColor;
|
|
227
222
|
}
|
|
228
223
|
}
|
package/src/tabs/tablist.tsx
CHANGED
|
@@ -133,7 +133,7 @@ export const TabList = forwardRef<
|
|
|
133
133
|
<StyledTabList
|
|
134
134
|
ref={ refs }
|
|
135
135
|
store={ store }
|
|
136
|
-
render={ ( props ) => (
|
|
136
|
+
render={ ( props: React.HTMLAttributes< HTMLDivElement > ) => (
|
|
137
137
|
<div
|
|
138
138
|
{ ...props }
|
|
139
139
|
// Fallback to -1 to prevent browsers from making the tablist
|
package/src/tooltip/index.tsx
CHANGED
|
@@ -93,7 +93,13 @@ function UnforwardedTooltip(
|
|
|
93
93
|
// `aria-label`
|
|
94
94
|
// See: https://github.com/WordPress/gutenberg/pull/64066
|
|
95
95
|
// See: https://github.com/WordPress/gutenberg/pull/65989
|
|
96
|
-
function addDescribedById(
|
|
96
|
+
function addDescribedById( el: React.ReactElement ) {
|
|
97
|
+
const element = el as React.ReactElement<
|
|
98
|
+
Pick<
|
|
99
|
+
React.HTMLAttributes< Element >,
|
|
100
|
+
'aria-describedby' | 'aria-label'
|
|
101
|
+
>
|
|
102
|
+
>;
|
|
97
103
|
return describedById &&
|
|
98
104
|
mounted &&
|
|
99
105
|
element.props[ 'aria-describedby' ] === undefined &&
|
|
@@ -26,7 +26,6 @@ describe( 'RovingTabIndexItem', () => {
|
|
|
26
26
|
expect( () =>
|
|
27
27
|
render( <RovingTabIndexItem as={ TestButton } /> )
|
|
28
28
|
).toThrow();
|
|
29
|
-
expect( console ).toHaveErrored();
|
|
30
29
|
} );
|
|
31
30
|
|
|
32
31
|
it( 'allows another component to be specified as the rendered component using the `as` prop', () => {
|
|
@@ -118,7 +118,7 @@ If this property is added, an option will be added with this label to represent
|
|
|
118
118
|
|
|
119
119
|
### `onChange`
|
|
120
120
|
|
|
121
|
-
- Type: `((value: string, extra?: { event?: ChangeEvent<HTMLSelectElement>; }) => void) | undefined`
|
|
121
|
+
- Type: `((value: string, extra?: { event?: ChangeEvent<HTMLSelectElement, Element>; }) => void) | undefined`
|
|
122
122
|
- Required: No
|
|
123
123
|
|
|
124
124
|
A function that receives the value of the new option that is being selected as input.
|
|
@@ -12,7 +12,13 @@ const getNodeText = ( node: React.ReactNode ): string => {
|
|
|
12
12
|
return node.map( getNodeText ).join( '' );
|
|
13
13
|
}
|
|
14
14
|
if ( 'props' in node ) {
|
|
15
|
-
return getNodeText(
|
|
15
|
+
return getNodeText(
|
|
16
|
+
(
|
|
17
|
+
node as React.ReactElement<
|
|
18
|
+
React.PropsWithChildren< unknown >
|
|
19
|
+
>
|
|
20
|
+
).props.children
|
|
21
|
+
);
|
|
16
22
|
}
|
|
17
23
|
return '';
|
|
18
24
|
}
|
|
@@ -60,7 +60,12 @@ type ValidityTarget =
|
|
|
60
60
|
| HTMLSelectElement
|
|
61
61
|
| HTMLTextAreaElement;
|
|
62
62
|
|
|
63
|
-
function UnforwardedControlWithError<
|
|
63
|
+
function UnforwardedControlWithError<
|
|
64
|
+
C extends React.ReactElement< {
|
|
65
|
+
label: React.ReactNode;
|
|
66
|
+
required: boolean;
|
|
67
|
+
} >,
|
|
68
|
+
>(
|
|
64
69
|
{
|
|
65
70
|
required,
|
|
66
71
|
markWhenOptional,
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// packages/components/src/navigation/back-button/index.tsx
|
|
31
|
-
var back_button_exports = {};
|
|
32
|
-
__export(back_button_exports, {
|
|
33
|
-
NavigationBackButton: () => NavigationBackButton,
|
|
34
|
-
default: () => back_button_default
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(back_button_exports);
|
|
37
|
-
var import_clsx = __toESM(require("clsx"));
|
|
38
|
-
var import_element = require("@wordpress/element");
|
|
39
|
-
var import_i18n = require("@wordpress/i18n");
|
|
40
|
-
var import_icons = require("@wordpress/icons");
|
|
41
|
-
var import_context = require("../context.cjs");
|
|
42
|
-
var import_navigation_styles = require("../styles/navigation-styles.cjs");
|
|
43
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
-
function UnforwardedNavigationBackButton({
|
|
45
|
-
backButtonLabel,
|
|
46
|
-
className,
|
|
47
|
-
href,
|
|
48
|
-
onClick,
|
|
49
|
-
parentMenu
|
|
50
|
-
}, ref) {
|
|
51
|
-
const {
|
|
52
|
-
setActiveMenu,
|
|
53
|
-
navigationTree
|
|
54
|
-
} = (0, import_context.useNavigationContext)();
|
|
55
|
-
const classes = (0, import_clsx.default)("components-navigation__back-button", className);
|
|
56
|
-
const parentMenuTitle = parentMenu !== void 0 ? navigationTree.getMenu(parentMenu)?.title : void 0;
|
|
57
|
-
const handleOnClick = (event) => {
|
|
58
|
-
if (typeof onClick === "function") {
|
|
59
|
-
onClick(event);
|
|
60
|
-
}
|
|
61
|
-
const animationDirection = (0, import_i18n.isRTL)() ? "left" : "right";
|
|
62
|
-
if (parentMenu && !event.defaultPrevented) {
|
|
63
|
-
setActiveMenu(parentMenu, animationDirection);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const icon = (0, import_i18n.isRTL)() ? import_icons.chevronRight : import_icons.chevronLeft;
|
|
67
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_navigation_styles.MenuBackButtonUI, {
|
|
68
|
-
__next40pxDefaultSize: true,
|
|
69
|
-
className: classes,
|
|
70
|
-
href,
|
|
71
|
-
variant: "tertiary",
|
|
72
|
-
ref,
|
|
73
|
-
onClick: handleOnClick,
|
|
74
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, {
|
|
75
|
-
icon
|
|
76
|
-
}), backButtonLabel || parentMenuTitle || (0, import_i18n.__)("Back")]
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
var NavigationBackButton = (0, import_element.forwardRef)(UnforwardedNavigationBackButton);
|
|
80
|
-
NavigationBackButton.displayName = "NavigationBackButton";
|
|
81
|
-
var back_button_default = NavigationBackButton;
|
|
82
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
-
0 && (module.exports = {
|
|
84
|
-
NavigationBackButton
|
|
85
|
-
});
|
|
86
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/navigation/back-button/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Icon, chevronLeft, chevronRight } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { MenuBackButtonUI } from '../styles/navigation-styles';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction UnforwardedNavigationBackButton({\n backButtonLabel,\n className,\n href,\n onClick,\n parentMenu\n}, ref) {\n const {\n setActiveMenu,\n navigationTree\n } = useNavigationContext();\n const classes = clsx('components-navigation__back-button', className);\n const parentMenuTitle = parentMenu !== undefined ? navigationTree.getMenu(parentMenu)?.title : undefined;\n const handleOnClick = event => {\n if (typeof onClick === 'function') {\n onClick(event);\n }\n const animationDirection = isRTL() ? 'left' : 'right';\n if (parentMenu && !event.defaultPrevented) {\n setActiveMenu(parentMenu, animationDirection);\n }\n };\n const icon = isRTL() ? chevronRight : chevronLeft;\n return /*#__PURE__*/_jsxs(MenuBackButtonUI, {\n __next40pxDefaultSize: true,\n className: classes,\n href: href,\n variant: \"tertiary\",\n ref: ref,\n onClick: handleOnClick,\n children: [/*#__PURE__*/_jsx(Icon, {\n icon: icon\n }), backButtonLabel || parentMenuTitle || __('Back')]\n });\n}\n\n/**\n * @deprecated Use `Navigator` instead.\n */\nexport const NavigationBackButton = forwardRef(UnforwardedNavigationBackButton);\nNavigationBackButton.displayName = 'NavigationBackButton';\nexport default NavigationBackButton;"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAIjB,qBAA2B;AAC3B,kBAA0B;AAC1B,mBAAgD;AAKhD,qBAAqC;AACrC,+BAAiC;AACjC,yBAA2C;AAC3C,SAAS,gCAAgC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG,KAAK;AACN,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF,QAAI,qCAAqB;AACzB,QAAM,cAAU,YAAAA,SAAK,sCAAsC,SAAS;AACpE,QAAM,kBAAkB,eAAe,SAAY,eAAe,QAAQ,UAAU,GAAG,QAAQ;AAC/F,QAAM,gBAAgB,WAAS;AAC7B,QAAI,OAAO,YAAY,YAAY;AACjC,cAAQ,KAAK;AAAA,IACf;AACA,UAAM,yBAAqB,mBAAM,IAAI,SAAS;AAC9C,QAAI,cAAc,CAAC,MAAM,kBAAkB;AACzC,oBAAc,YAAY,kBAAkB;AAAA,IAC9C;AAAA,EACF;AACA,QAAM,WAAO,mBAAM,IAAI,4BAAe;AACtC,SAAoB,uCAAAC,MAAM,2CAAkB;AAAA,IAC1C,uBAAuB;AAAA,IACvB,WAAW;AAAA,IACX;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,SAAS;AAAA,IACT,UAAU,CAAc,uCAAAC,KAAK,mBAAM;AAAA,MACjC;AAAA,IACF,CAAC,GAAG,mBAAmB,uBAAmB,gBAAG,MAAM,CAAC;AAAA,EACtD,CAAC;AACH;AAKO,IAAM,2BAAuB,2BAAW,+BAA+B;AAC9E,qBAAqB,cAAc;AACnC,IAAO,sBAAQ;",
|
|
6
|
-
"names": ["clsx", "_jsxs", "_jsx"]
|
|
7
|
-
}
|