@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,266 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal dependencies
|
|
3
|
-
*/
|
|
4
|
-
import type { ButtonProps } from '../button/types';
|
|
5
|
-
type IfDiscriminantDefinedBothRequired<TDiscriminant, TOther> = {
|
|
6
|
-
[K in keyof (TDiscriminant & TOther)]: NonNullable<(TDiscriminant & TOther)[K]>;
|
|
7
|
-
} | ({
|
|
8
|
-
[K in keyof TDiscriminant]?: never;
|
|
9
|
-
} & {
|
|
10
|
-
[K in keyof TOther]?: TOther[K];
|
|
11
|
-
});
|
|
12
|
-
export type NavigationProps = {
|
|
13
|
-
/**
|
|
14
|
-
* The active item slug.
|
|
15
|
-
*/
|
|
16
|
-
activeItem?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The active menu slug.
|
|
19
|
-
*
|
|
20
|
-
* @default 'root'
|
|
21
|
-
*/
|
|
22
|
-
activeMenu?: string;
|
|
23
|
-
/**
|
|
24
|
-
* The children components.
|
|
25
|
-
*/
|
|
26
|
-
children?: React.ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
* Optional classname for the component.
|
|
29
|
-
*/
|
|
30
|
-
className?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Callback used to sync the active menu between the external state
|
|
33
|
-
* and the Navigation's internal state.
|
|
34
|
-
*/
|
|
35
|
-
onActivateMenu?: (activeMenuSlug: string) => void;
|
|
36
|
-
};
|
|
37
|
-
type _NavigationMenuSearchProps = IfDiscriminantDefinedBothRequired<{
|
|
38
|
-
/**
|
|
39
|
-
* When the `hasSearch` prop is `true`, this callback handles the search
|
|
40
|
-
* input's `onChange` event, making it controlled from the outside.
|
|
41
|
-
* When using this prop, the `search` prop should be also set.
|
|
42
|
-
*/
|
|
43
|
-
onSearch: (searchString: string) => void;
|
|
44
|
-
}, {
|
|
45
|
-
/**
|
|
46
|
-
* When the `hasSearch` is `true` and the `onSearch` prop is provided, this
|
|
47
|
-
* prop controls the value of the search input.
|
|
48
|
-
* Required when the `onSearch` prop is provided.
|
|
49
|
-
*/
|
|
50
|
-
search: string;
|
|
51
|
-
}>;
|
|
52
|
-
export type NavigationMenuProps = _NavigationMenuSearchProps & {
|
|
53
|
-
/**
|
|
54
|
-
* The back button label used in nested menus.
|
|
55
|
-
* If not provided, the label will be inferred from the parent menu's title.
|
|
56
|
-
* If the parent menu's title is not available then it will default to "Back".
|
|
57
|
-
*
|
|
58
|
-
* @default parentMenuTitle ?? 'Back'
|
|
59
|
-
*/
|
|
60
|
-
backButtonLabel?: string;
|
|
61
|
-
/**
|
|
62
|
-
* A callback to handle clicking on the back button.
|
|
63
|
-
* If this prop is provided then the back button will be shown.
|
|
64
|
-
*/
|
|
65
|
-
onBackButtonClick?: React.MouseEventHandler<HTMLElement>;
|
|
66
|
-
/**
|
|
67
|
-
* The children components.
|
|
68
|
-
*/
|
|
69
|
-
children?: React.ReactNode;
|
|
70
|
-
/**
|
|
71
|
-
* Optional classname for the component.
|
|
72
|
-
*/
|
|
73
|
-
className?: string;
|
|
74
|
-
/**
|
|
75
|
-
* When `true`, enables the search feature on the menu title.
|
|
76
|
-
*/
|
|
77
|
-
hasSearch?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Indicates whether the menu is empty or not. Used together with the
|
|
80
|
-
* `hideIfTargetMenuEmpty` prop of `NavigationItem`.
|
|
81
|
-
*/
|
|
82
|
-
isEmpty?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Indicates whether the search is debouncing or not. In case of `true`, the
|
|
85
|
-
* "No results found." text is omitted. Used to prevent showing the
|
|
86
|
-
* "No results found." text between debounced searches.
|
|
87
|
-
*/
|
|
88
|
-
isSearchDebouncing?: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* The unique identifier of the menu.
|
|
91
|
-
* The root menu can omit this prop, and it will default to "root".
|
|
92
|
-
* All other menus need to specify it.
|
|
93
|
-
*
|
|
94
|
-
* @default 'root'
|
|
95
|
-
*/
|
|
96
|
-
menu?: string;
|
|
97
|
-
/**
|
|
98
|
-
* The parent menu slug; used by nested menus to indicate their parent menu.
|
|
99
|
-
*/
|
|
100
|
-
parentMenu?: string;
|
|
101
|
-
/**
|
|
102
|
-
* The menu title. It's also the field used by the menu search function.
|
|
103
|
-
*/
|
|
104
|
-
title?: string;
|
|
105
|
-
/**
|
|
106
|
-
* Use this prop to render additional actions in the menu title.
|
|
107
|
-
*/
|
|
108
|
-
titleAction?: React.ReactNode;
|
|
109
|
-
};
|
|
110
|
-
export type NavigationGroupProps = {
|
|
111
|
-
/**
|
|
112
|
-
* Optional classname for the component.
|
|
113
|
-
*/
|
|
114
|
-
className?: string;
|
|
115
|
-
/**
|
|
116
|
-
* The group title.
|
|
117
|
-
*/
|
|
118
|
-
title?: string;
|
|
119
|
-
/**
|
|
120
|
-
* The children components.
|
|
121
|
-
*/
|
|
122
|
-
children: React.ReactNode;
|
|
123
|
-
};
|
|
124
|
-
type _NavigationItemButtonProps = (ButtonProps & {
|
|
125
|
-
/**
|
|
126
|
-
* If set to `true` the menu item will only act as a text-only item,
|
|
127
|
-
* rather than a `<button />` or `<a />` element.
|
|
128
|
-
*/
|
|
129
|
-
isText?: false;
|
|
130
|
-
}) | {
|
|
131
|
-
/**
|
|
132
|
-
* If set to `true` the menu item will only act as a text-only item,
|
|
133
|
-
* rather than a `<button />` or `<a />` element.
|
|
134
|
-
*/
|
|
135
|
-
isText: true;
|
|
136
|
-
};
|
|
137
|
-
export type NavigationItemBaseProps = {
|
|
138
|
-
/**
|
|
139
|
-
* The item badge content.
|
|
140
|
-
*/
|
|
141
|
-
badge?: string | number;
|
|
142
|
-
/**
|
|
143
|
-
* The children components. When not specified, the item will render the
|
|
144
|
-
* default item UI.
|
|
145
|
-
*/
|
|
146
|
-
children?: React.ReactNode;
|
|
147
|
-
/**
|
|
148
|
-
* Optional classname for the component.
|
|
149
|
-
*/
|
|
150
|
-
className?: string;
|
|
151
|
-
/**
|
|
152
|
-
* If provided, causes the component to render an `<a />` element
|
|
153
|
-
* instead of a `<button />` element.
|
|
154
|
-
*/
|
|
155
|
-
href?: string;
|
|
156
|
-
/**
|
|
157
|
-
* If no `children` are passed, this prop allows to specify a custom icon for
|
|
158
|
-
* the menu item.
|
|
159
|
-
*/
|
|
160
|
-
icon?: React.JSX.Element;
|
|
161
|
-
/**
|
|
162
|
-
* The unique identifier of the item.
|
|
163
|
-
*/
|
|
164
|
-
item?: string;
|
|
165
|
-
/**
|
|
166
|
-
* The child menu slug. If provided, clicking on the item will navigate
|
|
167
|
-
* to the target menu.
|
|
168
|
-
*/
|
|
169
|
-
navigateToMenu?: string;
|
|
170
|
-
/**
|
|
171
|
-
* Indicates whether this item should be hidden if the menu specified in
|
|
172
|
-
* `navigateToMenu` is marked as empty in the `isEmpty` prop.
|
|
173
|
-
* Used together with the `isEmpty` prop of `NavigationMenu`.
|
|
174
|
-
*/
|
|
175
|
-
hideIfTargetMenuEmpty?: boolean;
|
|
176
|
-
/**
|
|
177
|
-
* A callback to handle clicking on a menu item.
|
|
178
|
-
*
|
|
179
|
-
* @default noop
|
|
180
|
-
*/
|
|
181
|
-
onClick?: React.MouseEventHandler;
|
|
182
|
-
/**
|
|
183
|
-
* The item title.
|
|
184
|
-
*/
|
|
185
|
-
title?: string;
|
|
186
|
-
};
|
|
187
|
-
export type NavigationItemProps = _NavigationItemButtonProps & NavigationItemBaseProps;
|
|
188
|
-
export type NavigationItemBaseContentProps = Pick<NavigationItemProps, 'badge' | 'title'>;
|
|
189
|
-
export type NavigationBackButtonProps = {
|
|
190
|
-
/**
|
|
191
|
-
* The text displayed for the button
|
|
192
|
-
*/
|
|
193
|
-
backButtonLabel?: string;
|
|
194
|
-
/**
|
|
195
|
-
* Optional classname for the component.
|
|
196
|
-
*/
|
|
197
|
-
className?: string;
|
|
198
|
-
/**
|
|
199
|
-
* If provided, causes the component to render an `<a />` element
|
|
200
|
-
* instead of a `<button />` element.
|
|
201
|
-
*/
|
|
202
|
-
href?: string;
|
|
203
|
-
/**
|
|
204
|
-
* Callback function called when the button is clicked.
|
|
205
|
-
*/
|
|
206
|
-
onClick?: React.MouseEventHandler;
|
|
207
|
-
/**
|
|
208
|
-
* Id of the parent menu
|
|
209
|
-
*/
|
|
210
|
-
parentMenu?: string;
|
|
211
|
-
};
|
|
212
|
-
export type NavigationMenuTitleSearchProps = Pick<NavigationMenuProps, 'onSearch' | 'search' | 'title'> & {
|
|
213
|
-
debouncedSpeak: (message: string, ariaLive?: 'off' | 'polite' | 'assertive') => void;
|
|
214
|
-
onCloseSearch: () => void;
|
|
215
|
-
};
|
|
216
|
-
export type NavigationMenuTitleProps = Pick<NavigationMenuProps, 'hasSearch' | 'onSearch' | 'search' | 'title' | 'titleAction'>;
|
|
217
|
-
export type NavigationSearchNoResultsFoundProps = Pick<NavigationMenuProps, 'search'>;
|
|
218
|
-
export type Item = Omit<NavigationItemBaseProps, 'children'> & {
|
|
219
|
-
/**
|
|
220
|
-
* The group id
|
|
221
|
-
*/
|
|
222
|
-
group?: string;
|
|
223
|
-
/**
|
|
224
|
-
* The menu id
|
|
225
|
-
*/
|
|
226
|
-
menu?: string;
|
|
227
|
-
/**
|
|
228
|
-
* True is the item is currently visible (ie. the item is part
|
|
229
|
-
* of the active menu, and — if there is a search query — its title
|
|
230
|
-
* matches the search query).
|
|
231
|
-
*/
|
|
232
|
-
_isVisible: boolean;
|
|
233
|
-
};
|
|
234
|
-
export type Menu = Omit<NavigationMenuProps, 'children'> & {
|
|
235
|
-
menu: string;
|
|
236
|
-
};
|
|
237
|
-
export type NavigationGroupContext = {
|
|
238
|
-
/**
|
|
239
|
-
* The unique id of the group
|
|
240
|
-
*/
|
|
241
|
-
group?: string;
|
|
242
|
-
};
|
|
243
|
-
export type NavigationMenuContext = {
|
|
244
|
-
menu?: string;
|
|
245
|
-
search?: string;
|
|
246
|
-
};
|
|
247
|
-
export type NavigationContext = {
|
|
248
|
-
activeItem?: string;
|
|
249
|
-
activeMenu: string;
|
|
250
|
-
setActiveMenu: (parentMenu: string, animationDirection?: 'left' | 'right') => void;
|
|
251
|
-
navigationTree: {
|
|
252
|
-
items: Record<string, Item>;
|
|
253
|
-
getItem: (itemId: string) => Item | undefined;
|
|
254
|
-
addItem: (itemId: string, itemProps: Item) => void;
|
|
255
|
-
removeItem: (itemId: string) => void;
|
|
256
|
-
menus: Record<string, Menu>;
|
|
257
|
-
getMenu: (menuId: string) => Menu | undefined;
|
|
258
|
-
addMenu: (menuId: string, menuProps: Menu) => void;
|
|
259
|
-
removeMenu: (menuId: string) => void;
|
|
260
|
-
childMenu: Record<string, string[]>;
|
|
261
|
-
traverseMenu: (startMenu: string, callback: (menuObject: Menu) => boolean | undefined) => void;
|
|
262
|
-
isMenuEmpty: (menuId: string) => boolean;
|
|
263
|
-
};
|
|
264
|
-
};
|
|
265
|
-
export {};
|
|
266
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigation/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,KAAK,iCAAiC,CAAE,aAAa,EAAE,MAAM,IAG1D;KACE,CAAC,IAAI,MAAM,CAAE,aAAa,GAAG,MAAM,CAAE,GAAI,WAAW,CACrD,CAAE,aAAa,GAAG,MAAM,CAAE,CAAE,CA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
-
export declare const useCreateNavigationTree: () => {
|
|
3
|
-
items: Record<string, Omit<Item, "children">>;
|
|
4
|
-
getItem: (key: string) => Omit<Item, "children">;
|
|
5
|
-
addItem: (key: string, value: Item) => void;
|
|
6
|
-
removeItem: (key: string) => void;
|
|
7
|
-
menus: Record<string, Omit<Menu, "children">>;
|
|
8
|
-
getMenu: (key: string) => Omit<Menu, "children">;
|
|
9
|
-
addMenu: (key: string, value: Menu) => void;
|
|
10
|
-
removeMenu: (key: string) => void;
|
|
11
|
-
childMenu: Record<string, string[]>;
|
|
12
|
-
traverseMenu: (startMenu: string, callback: (menuObject: Menu) => boolean | undefined) => void;
|
|
13
|
-
isMenuEmpty: (menuToCheck: string) => boolean;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=use-create-navigation-tree.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-create-navigation-tree.d.ts","sourceRoot":"","sources":["../../src/navigation/use-create-navigation-tree.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAqB,IAAI,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,uBAAuB;;;;;;;mBAyElB,MAAM,SAAS,IAAI;;;;+BAvBD,MAAM;CA+CzC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare function useNavigationTreeNodes<TNode extends {
|
|
2
|
-
children?: React.ReactNode;
|
|
3
|
-
[key: string]: unknown;
|
|
4
|
-
}>(): {
|
|
5
|
-
nodes: Record<string, Omit<TNode, "children">>;
|
|
6
|
-
getNode: (key: string) => Omit<TNode, "children">;
|
|
7
|
-
addNode: (key: string, value: TNode) => void;
|
|
8
|
-
removeNode: (key: string) => void;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=use-navigation-tree-nodes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-navigation-tree-nodes.d.ts","sourceRoot":"","sources":["../../src/navigation/use-navigation-tree-nodes.tsx"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,CACrC,KAAK,SAAS;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,CAAE,GAAG,EAAE,MAAM,GAAI,OAAO,CAAA;CAAE;;mBAM/C,MAAM;mBAEN,MAAM,SAAS,KAAK;;EAgB3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/navigation/utils.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,UAAY,MAAM,WACa,CAAC;AAE3D,eAAO,MAAM,gBAAgB,UAAY,MAAM,UAAU,MAAM,YACI,CAAC"}
|
package/src/draggable/style.scss
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
@use "@wordpress/base-styles/z-index" as *;
|
|
2
|
-
|
|
3
|
-
body.is-dragging-components-draggable {
|
|
4
|
-
cursor: move;/* Fallback for IE/Edge < 14 */
|
|
5
|
-
cursor: grabbing !important;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.components-draggable__invisible-drag-image {
|
|
9
|
-
position: fixed;
|
|
10
|
-
left: -1000px;
|
|
11
|
-
height: 50px;
|
|
12
|
-
width: 50px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.components-draggable__clone {
|
|
16
|
-
position: fixed;
|
|
17
|
-
padding: 0; // Should match clonePadding variable.
|
|
18
|
-
background: transparent;
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
z-index: z-index(".components-draggable__clone");
|
|
21
|
-
}
|
package/src/navigation/README.md
DELETED
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
# Navigation
|
|
2
|
-
|
|
3
|
-
<div class="callout callout-alert">
|
|
4
|
-
This component is deprecated. Consider using `Navigator` instead.
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
|
-
<div class="callout callout-alert">
|
|
8
|
-
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
Render a navigation list with optional groupings and hierarchy.
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```jsx
|
|
16
|
-
import {
|
|
17
|
-
__experimentalNavigation as Navigation,
|
|
18
|
-
__experimentalNavigationGroup as NavigationGroup,
|
|
19
|
-
__experimentalNavigationItem as NavigationItem,
|
|
20
|
-
__experimentalNavigationMenu as NavigationMenu,
|
|
21
|
-
} from '@wordpress/components';
|
|
22
|
-
|
|
23
|
-
const MyNavigation = () => (
|
|
24
|
-
<Navigation>
|
|
25
|
-
<NavigationMenu title="Home">
|
|
26
|
-
<NavigationGroup title="Group 1">
|
|
27
|
-
<NavigationItem item="item-1" title="Item 1" />
|
|
28
|
-
<NavigationItem item="item-2" title="Item 2" />
|
|
29
|
-
</NavigationGroup>
|
|
30
|
-
<NavigationGroup title="Group 2">
|
|
31
|
-
<NavigationItem
|
|
32
|
-
item="item-3"
|
|
33
|
-
navigateToMenu="category"
|
|
34
|
-
title="Category"
|
|
35
|
-
/>
|
|
36
|
-
</NavigationGroup>
|
|
37
|
-
</NavigationMenu>
|
|
38
|
-
|
|
39
|
-
<NavigationMenu
|
|
40
|
-
backButtonLabel="Home"
|
|
41
|
-
menu="category"
|
|
42
|
-
parentMenu="root"
|
|
43
|
-
title="Category"
|
|
44
|
-
>
|
|
45
|
-
<NavigationItem badge="1" item="child-1" title="Child 1" />
|
|
46
|
-
<NavigationItem item="child-2" title="Child 2" />
|
|
47
|
-
</NavigationMenu>
|
|
48
|
-
</Navigation>
|
|
49
|
-
);
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Navigation Props
|
|
53
|
-
|
|
54
|
-
`Navigation` supports the following props.
|
|
55
|
-
|
|
56
|
-
### `activeItem`
|
|
57
|
-
|
|
58
|
-
- Type: `string`
|
|
59
|
-
- Required: No
|
|
60
|
-
|
|
61
|
-
The active item slug.
|
|
62
|
-
|
|
63
|
-
### `activeMenu`
|
|
64
|
-
|
|
65
|
-
- Type: `string`
|
|
66
|
-
- Required: No
|
|
67
|
-
- Default: "root"
|
|
68
|
-
|
|
69
|
-
The active menu slug.
|
|
70
|
-
|
|
71
|
-
### className
|
|
72
|
-
|
|
73
|
-
- Type: `string`
|
|
74
|
-
- Required: No
|
|
75
|
-
|
|
76
|
-
Optional className for the `Navigation` component.
|
|
77
|
-
|
|
78
|
-
### `onActivateMenu`
|
|
79
|
-
|
|
80
|
-
- Type: `function`
|
|
81
|
-
- Required: No
|
|
82
|
-
|
|
83
|
-
Sync the active menu between the external state and the Navigation's internal state.
|
|
84
|
-
|
|
85
|
-
## Navigation Menu Props
|
|
86
|
-
|
|
87
|
-
`NavigationMenu` supports the following props.
|
|
88
|
-
|
|
89
|
-
### `backButtonLabel`
|
|
90
|
-
|
|
91
|
-
- Type: `string`
|
|
92
|
-
- Required: No
|
|
93
|
-
- Default: parent menu's title or "Back"
|
|
94
|
-
|
|
95
|
-
The back button label used in nested menus. If not provided, the label will be inferred from the parent menu's title.
|
|
96
|
-
If for some reason the parent menu's title is not available then it will default to "Back".
|
|
97
|
-
|
|
98
|
-
### `onBackButtonClick`
|
|
99
|
-
|
|
100
|
-
- Type: `function`
|
|
101
|
-
- Required: No
|
|
102
|
-
|
|
103
|
-
A callback to handle clicking on the back button. If this prop is provided then the back button will be shown.
|
|
104
|
-
|
|
105
|
-
### className
|
|
106
|
-
|
|
107
|
-
- Type: `string`
|
|
108
|
-
- Required: No
|
|
109
|
-
|
|
110
|
-
Optional className for the `NavigationMenu` component.
|
|
111
|
-
|
|
112
|
-
### hasSearch
|
|
113
|
-
|
|
114
|
-
- Type: `boolean`
|
|
115
|
-
- Required: No
|
|
116
|
-
|
|
117
|
-
Enable the search feature on the menu title.
|
|
118
|
-
|
|
119
|
-
### `menu`
|
|
120
|
-
|
|
121
|
-
- Type: `string`
|
|
122
|
-
- Required: No
|
|
123
|
-
- Default: "root"
|
|
124
|
-
|
|
125
|
-
The unique identifier of the menu. The root menu can omit this, and it will default to "root"; all other menus need to specify it.
|
|
126
|
-
|
|
127
|
-
### onSearch
|
|
128
|
-
|
|
129
|
-
- Type: `( searchString: string ) => void;`
|
|
130
|
-
- Required: No
|
|
131
|
-
|
|
132
|
-
When `hasSearch` is active, this function handles the search input's `onChange` event, making it controlled from the outside. It requires setting the `search` prop as well.
|
|
133
|
-
|
|
134
|
-
### isSearchDebouncing
|
|
135
|
-
|
|
136
|
-
- Type: `boolean`
|
|
137
|
-
- Required: No
|
|
138
|
-
|
|
139
|
-
Indicates whether the search is debouncing or not. In case of `true` the "No results found." text is omitted. Used to prevent showing "No results found." text between debounced searches.
|
|
140
|
-
|
|
141
|
-
### `parentMenu`
|
|
142
|
-
|
|
143
|
-
- Type: `string`
|
|
144
|
-
- Required: No
|
|
145
|
-
|
|
146
|
-
The parent menu slug; used by nested menus to indicate their parent menu.
|
|
147
|
-
|
|
148
|
-
### search
|
|
149
|
-
|
|
150
|
-
- Type: `string`
|
|
151
|
-
- Required: No
|
|
152
|
-
|
|
153
|
-
When `hasSearch` is active and `onSearch` is provided, this controls the value of the search input. Required when the `onSearch` prop is provided.
|
|
154
|
-
|
|
155
|
-
### `isEmpty`
|
|
156
|
-
|
|
157
|
-
- Type: `boolean`
|
|
158
|
-
- Required: No
|
|
159
|
-
|
|
160
|
-
Indicates whether the menu is empty or not. Used together with the `hideIfTargetMenuEmpty` prop of Navigation Item.
|
|
161
|
-
|
|
162
|
-
### `title`
|
|
163
|
-
|
|
164
|
-
- Type: `string`
|
|
165
|
-
- Required: No
|
|
166
|
-
|
|
167
|
-
The menu title. It's also the field used by the menu search function.
|
|
168
|
-
|
|
169
|
-
### `titleAction`
|
|
170
|
-
|
|
171
|
-
- Type: `React.ReactNode`
|
|
172
|
-
- Required: No
|
|
173
|
-
|
|
174
|
-
Use this prop to render additional actions in the menu title.
|
|
175
|
-
|
|
176
|
-
## Navigation Group Props
|
|
177
|
-
|
|
178
|
-
`NavigationGroup` supports the following props.
|
|
179
|
-
|
|
180
|
-
### className
|
|
181
|
-
|
|
182
|
-
- Type: `string`
|
|
183
|
-
- Required: No
|
|
184
|
-
|
|
185
|
-
Optional className for the `NavigationGroup` component.
|
|
186
|
-
|
|
187
|
-
### `title`
|
|
188
|
-
|
|
189
|
-
- Type: `string`
|
|
190
|
-
- Required: No
|
|
191
|
-
|
|
192
|
-
The group title.
|
|
193
|
-
|
|
194
|
-
## Navigation Item Props
|
|
195
|
-
|
|
196
|
-
`NavigationItem` supports the following props.
|
|
197
|
-
|
|
198
|
-
### `badge`
|
|
199
|
-
|
|
200
|
-
- Type: `string|Number`
|
|
201
|
-
- Required: No
|
|
202
|
-
|
|
203
|
-
The item badge content.
|
|
204
|
-
|
|
205
|
-
### className
|
|
206
|
-
|
|
207
|
-
- Type: `string`
|
|
208
|
-
- Required: No
|
|
209
|
-
|
|
210
|
-
Optional className for the `NavigationItem` component.
|
|
211
|
-
|
|
212
|
-
### `href`
|
|
213
|
-
|
|
214
|
-
- Type: `string`
|
|
215
|
-
- Required: No
|
|
216
|
-
|
|
217
|
-
If provided, renders `a` instead of `button`.
|
|
218
|
-
|
|
219
|
-
### `icon`
|
|
220
|
-
|
|
221
|
-
- Type: `React.JSX.Element`
|
|
222
|
-
- Required: No
|
|
223
|
-
|
|
224
|
-
If no `children` are passed, this prop allows to specify a custom icon for the menu item.
|
|
225
|
-
|
|
226
|
-
### `item`
|
|
227
|
-
|
|
228
|
-
- Type: `string`
|
|
229
|
-
- Required: No
|
|
230
|
-
|
|
231
|
-
The unique identifier of the item.
|
|
232
|
-
|
|
233
|
-
### `navigateToMenu`
|
|
234
|
-
|
|
235
|
-
- Type: `string`
|
|
236
|
-
- Required: No
|
|
237
|
-
|
|
238
|
-
The child menu slug. If provided, clicking on the item will navigate to the target menu.
|
|
239
|
-
|
|
240
|
-
### `hideIfTargetMenuEmpty`
|
|
241
|
-
|
|
242
|
-
- Type: `boolean`
|
|
243
|
-
- Required: No
|
|
244
|
-
|
|
245
|
-
Indicates whether this item should be hidden if the menu specified in `navigateToMenu` is marked as empty in the `isEmpty` prop. Used together with the `isEmpty` prop of Navigation Menu.
|
|
246
|
-
|
|
247
|
-
### `onClick`
|
|
248
|
-
|
|
249
|
-
- Type: `React.MouseEventHandler`
|
|
250
|
-
- Required: No
|
|
251
|
-
|
|
252
|
-
A callback to handle clicking on a menu item.
|
|
253
|
-
|
|
254
|
-
### `isText`
|
|
255
|
-
|
|
256
|
-
- Type: `boolean`
|
|
257
|
-
- Required: No
|
|
258
|
-
- Default: false
|
|
259
|
-
|
|
260
|
-
If set to true then the menu item will only act as a text-only item rather than a button.
|
|
261
|
-
|
|
262
|
-
### `title`
|
|
263
|
-
|
|
264
|
-
- Type: `string`
|
|
265
|
-
- Required: No
|
|
266
|
-
|
|
267
|
-
The item title.
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
/**
|
|
6
|
-
* WordPress dependencies
|
|
7
|
-
*/
|
|
8
|
-
import { forwardRef } from '@wordpress/element';
|
|
9
|
-
import { __, isRTL } from '@wordpress/i18n';
|
|
10
|
-
import { Icon, chevronLeft, chevronRight } from '@wordpress/icons';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
import { useNavigationContext } from '../context';
|
|
16
|
-
import { MenuBackButtonUI } from '../styles/navigation-styles';
|
|
17
|
-
|
|
18
|
-
import type { NavigationBackButtonProps } from '../types';
|
|
19
|
-
|
|
20
|
-
function UnforwardedNavigationBackButton(
|
|
21
|
-
{
|
|
22
|
-
backButtonLabel,
|
|
23
|
-
className,
|
|
24
|
-
href,
|
|
25
|
-
onClick,
|
|
26
|
-
parentMenu,
|
|
27
|
-
}: NavigationBackButtonProps,
|
|
28
|
-
ref: React.ForwardedRef< HTMLAnchorElement | HTMLButtonElement >
|
|
29
|
-
) {
|
|
30
|
-
const { setActiveMenu, navigationTree } = useNavigationContext();
|
|
31
|
-
|
|
32
|
-
const classes = clsx( 'components-navigation__back-button', className );
|
|
33
|
-
|
|
34
|
-
const parentMenuTitle =
|
|
35
|
-
parentMenu !== undefined
|
|
36
|
-
? navigationTree.getMenu( parentMenu )?.title
|
|
37
|
-
: undefined;
|
|
38
|
-
|
|
39
|
-
const handleOnClick: React.MouseEventHandler< HTMLElement > = ( event ) => {
|
|
40
|
-
if ( typeof onClick === 'function' ) {
|
|
41
|
-
onClick( event );
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const animationDirection = isRTL() ? 'left' : 'right';
|
|
45
|
-
if ( parentMenu && ! event.defaultPrevented ) {
|
|
46
|
-
setActiveMenu( parentMenu, animationDirection );
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const icon = isRTL() ? chevronRight : chevronLeft;
|
|
50
|
-
return (
|
|
51
|
-
<MenuBackButtonUI
|
|
52
|
-
__next40pxDefaultSize
|
|
53
|
-
className={ classes }
|
|
54
|
-
href={ href }
|
|
55
|
-
variant="tertiary"
|
|
56
|
-
ref={ ref }
|
|
57
|
-
onClick={ handleOnClick }
|
|
58
|
-
>
|
|
59
|
-
<Icon icon={ icon } />
|
|
60
|
-
{ backButtonLabel || parentMenuTitle || __( 'Back' ) }
|
|
61
|
-
</MenuBackButtonUI>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @deprecated Use `Navigator` instead.
|
|
67
|
-
*/
|
|
68
|
-
export const NavigationBackButton = forwardRef(
|
|
69
|
-
UnforwardedNavigationBackButton
|
|
70
|
-
);
|
|
71
|
-
NavigationBackButton.displayName = 'NavigationBackButton';
|
|
72
|
-
|
|
73
|
-
export default NavigationBackButton;
|