@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,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/components/src/navigation/constants.tsx
|
|
21
|
-
var constants_exports = {};
|
|
22
|
-
__export(constants_exports, {
|
|
23
|
-
ROOT_MENU: () => ROOT_MENU,
|
|
24
|
-
SEARCH_FOCUS_DELAY: () => SEARCH_FOCUS_DELAY
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(constants_exports);
|
|
27
|
-
var ROOT_MENU = "root";
|
|
28
|
-
var SEARCH_FOCUS_DELAY = 100;
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
ROOT_MENU,
|
|
32
|
-
SEARCH_FOCUS_DELAY
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=constants.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/navigation/constants.tsx"],
|
|
4
|
-
"sourcesContent": ["export const ROOT_MENU = 'root';\nexport const SEARCH_FOCUS_DELAY = 100;"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,YAAY;AAClB,IAAM,qBAAqB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/components/src/navigation/context.tsx
|
|
21
|
-
var context_exports = {};
|
|
22
|
-
__export(context_exports, {
|
|
23
|
-
NavigationContext: () => NavigationContext,
|
|
24
|
-
useNavigationContext: () => useNavigationContext
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(context_exports);
|
|
27
|
-
var import_element = require("@wordpress/element");
|
|
28
|
-
var import_constants = require("./constants.cjs");
|
|
29
|
-
var noop = () => {
|
|
30
|
-
};
|
|
31
|
-
var defaultIsEmpty = () => false;
|
|
32
|
-
var defaultGetter = () => void 0;
|
|
33
|
-
var NavigationContext = (0, import_element.createContext)({
|
|
34
|
-
activeItem: void 0,
|
|
35
|
-
activeMenu: import_constants.ROOT_MENU,
|
|
36
|
-
setActiveMenu: noop,
|
|
37
|
-
navigationTree: {
|
|
38
|
-
items: {},
|
|
39
|
-
getItem: defaultGetter,
|
|
40
|
-
addItem: noop,
|
|
41
|
-
removeItem: noop,
|
|
42
|
-
menus: {},
|
|
43
|
-
getMenu: defaultGetter,
|
|
44
|
-
addMenu: noop,
|
|
45
|
-
removeMenu: noop,
|
|
46
|
-
childMenu: {},
|
|
47
|
-
traverseMenu: noop,
|
|
48
|
-
isMenuEmpty: defaultIsEmpty
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
NavigationContext.displayName = "NavigationContext";
|
|
52
|
-
var useNavigationContext = () => (0, import_element.useContext)(NavigationContext);
|
|
53
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
-
0 && (module.exports = {
|
|
55
|
-
NavigationContext,
|
|
56
|
-
useNavigationContext
|
|
57
|
-
});
|
|
58
|
-
//# sourceMappingURL=context.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/navigation/context.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ROOT_MENU } from './constants';\nconst noop = () => {};\nconst defaultIsEmpty = () => false;\nconst defaultGetter = () => undefined;\nexport const NavigationContext = createContext({\n activeItem: undefined,\n activeMenu: ROOT_MENU,\n setActiveMenu: noop,\n navigationTree: {\n items: {},\n getItem: defaultGetter,\n addItem: noop,\n removeItem: noop,\n menus: {},\n getMenu: defaultGetter,\n addMenu: noop,\n removeMenu: noop,\n childMenu: {},\n traverseMenu: noop,\n isMenuEmpty: defaultIsEmpty\n }\n});\nNavigationContext.displayName = 'NavigationContext';\nexport const useNavigationContext = () => useContext(NavigationContext);"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0C;AAK1C,uBAA0B;AAC1B,IAAM,OAAO,MAAM;AAAC;AACpB,IAAM,iBAAiB,MAAM;AAC7B,IAAM,gBAAgB,MAAM;AACrB,IAAM,wBAAoB,8BAAc;AAAA,EAC7C,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,gBAAgB;AAAA,IACd,OAAO,CAAC;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,OAAO,CAAC;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW,CAAC;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AACF,CAAC;AACD,kBAAkB,cAAc;AACzB,IAAM,uBAAuB,UAAM,2BAAW,iBAAiB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/components/src/navigation/group/context.tsx
|
|
21
|
-
var context_exports = {};
|
|
22
|
-
__export(context_exports, {
|
|
23
|
-
NavigationGroupContext: () => NavigationGroupContext,
|
|
24
|
-
useNavigationGroupContext: () => useNavigationGroupContext
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(context_exports);
|
|
27
|
-
var import_element = require("@wordpress/element");
|
|
28
|
-
var NavigationGroupContext = (0, import_element.createContext)({
|
|
29
|
-
group: void 0
|
|
30
|
-
});
|
|
31
|
-
NavigationGroupContext.displayName = "NavigationGroupContext";
|
|
32
|
-
var useNavigationGroupContext = () => (0, import_element.useContext)(NavigationGroupContext);
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
NavigationGroupContext,
|
|
36
|
-
useNavigationGroupContext
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=context.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/navigation/group/context.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nexport const NavigationGroupContext = createContext({\n group: undefined\n});\nNavigationGroupContext.displayName = 'NavigationGroupContext';\nexport const useNavigationGroupContext = () => useContext(NavigationGroupContext);"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0C;AAMnC,IAAM,6BAAyB,8BAAc;AAAA,EAClD,OAAO;AACT,CAAC;AACD,uBAAuB,cAAc;AAC9B,IAAM,4BAA4B,UAAM,2BAAW,sBAAsB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,88 +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/group/index.tsx
|
|
31
|
-
var group_exports = {};
|
|
32
|
-
__export(group_exports, {
|
|
33
|
-
NavigationGroup: () => NavigationGroup,
|
|
34
|
-
default: () => group_default
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(group_exports);
|
|
37
|
-
var import_clsx = __toESM(require("clsx"));
|
|
38
|
-
var import_element = require("@wordpress/element");
|
|
39
|
-
var import_context = require("./context.cjs");
|
|
40
|
-
var import_navigation_styles = require("../styles/navigation-styles.cjs");
|
|
41
|
-
var import_context2 = require("../context.cjs");
|
|
42
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
-
var uniqueId = 0;
|
|
44
|
-
function NavigationGroup({
|
|
45
|
-
children,
|
|
46
|
-
className,
|
|
47
|
-
title
|
|
48
|
-
}) {
|
|
49
|
-
const [groupId] = (0, import_element.useState)(`group-${++uniqueId}`);
|
|
50
|
-
const {
|
|
51
|
-
navigationTree: {
|
|
52
|
-
items
|
|
53
|
-
}
|
|
54
|
-
} = (0, import_context2.useNavigationContext)();
|
|
55
|
-
const context = {
|
|
56
|
-
group: groupId
|
|
57
|
-
};
|
|
58
|
-
if (!Object.values(items).some((item) => item.group === groupId && item._isVisible)) {
|
|
59
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.NavigationGroupContext.Provider, {
|
|
60
|
-
value: context,
|
|
61
|
-
children
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
const groupTitleId = `components-navigation__group-title-${groupId}`;
|
|
65
|
-
const classes = (0, import_clsx.default)("components-navigation__group", className);
|
|
66
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.NavigationGroupContext.Provider, {
|
|
67
|
-
value: context,
|
|
68
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
|
|
69
|
-
className: classes,
|
|
70
|
-
children: [title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.GroupTitleUI, {
|
|
71
|
-
className: "components-navigation__group-title",
|
|
72
|
-
id: groupTitleId,
|
|
73
|
-
level: 3,
|
|
74
|
-
children: title
|
|
75
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", {
|
|
76
|
-
"aria-labelledby": groupTitleId,
|
|
77
|
-
role: "group",
|
|
78
|
-
children
|
|
79
|
-
})]
|
|
80
|
-
})
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
var group_default = NavigationGroup;
|
|
84
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
-
0 && (module.exports = {
|
|
86
|
-
NavigationGroup
|
|
87
|
-
});
|
|
88
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/navigation/group/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { NavigationGroupContext } from './context';\nimport { GroupTitleUI } from '../styles/navigation-styles';\nimport { useNavigationContext } from '../context';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nlet uniqueId = 0;\n\n/**\n * @deprecated Use `Navigator` instead.\n */\nexport function NavigationGroup({\n children,\n className,\n title\n}) {\n const [groupId] = useState(`group-${++uniqueId}`);\n const {\n navigationTree: {\n items\n }\n } = useNavigationContext();\n const context = {\n group: groupId\n };\n\n // Keep the children rendered to make sure invisible items are included in the navigation tree.\n if (!Object.values(items).some(item => item.group === groupId && item._isVisible)) {\n return /*#__PURE__*/_jsx(NavigationGroupContext.Provider, {\n value: context,\n children: children\n });\n }\n const groupTitleId = `components-navigation__group-title-${groupId}`;\n const classes = clsx('components-navigation__group', className);\n return /*#__PURE__*/_jsx(NavigationGroupContext.Provider, {\n value: context,\n children: /*#__PURE__*/_jsxs(\"li\", {\n className: classes,\n children: [title && /*#__PURE__*/_jsx(GroupTitleUI, {\n className: \"components-navigation__group-title\",\n id: groupTitleId,\n level: 3,\n children: title\n }), /*#__PURE__*/_jsx(\"ul\", {\n \"aria-labelledby\": groupTitleId,\n role: \"group\",\n children: children\n })]\n })\n });\n}\nexport default NavigationGroup;"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAAyB;AAKzB,qBAAuC;AACvC,+BAA6B;AAC7B,IAAAA,kBAAqC;AACrC,yBAA2C;AAC3C,IAAI,WAAW;AAKR,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,CAAC,OAAO,QAAI,yBAAS,SAAS,EAAE,QAAQ,EAAE;AAChD,QAAM;AAAA,IACJ,gBAAgB;AAAA,MACd;AAAA,IACF;AAAA,EACF,QAAI,sCAAqB;AACzB,QAAM,UAAU;AAAA,IACd,OAAO;AAAA,EACT;AAGA,MAAI,CAAC,OAAO,OAAO,KAAK,EAAE,KAAK,UAAQ,KAAK,UAAU,WAAW,KAAK,UAAU,GAAG;AACjF,WAAoB,uCAAAC,KAAK,sCAAuB,UAAU;AAAA,MACxD,OAAO;AAAA,MACP;AAAA,IACF,CAAC;AAAA,EACH;AACA,QAAM,eAAe,sCAAsC,OAAO;AAClE,QAAM,cAAU,YAAAC,SAAK,gCAAgC,SAAS;AAC9D,SAAoB,uCAAAD,KAAK,sCAAuB,UAAU;AAAA,IACxD,OAAO;AAAA,IACP,UAAuB,uCAAAE,MAAM,MAAM;AAAA,MACjC,WAAW;AAAA,MACX,UAAU,CAAC,SAAsB,uCAAAF,KAAK,uCAAc;AAAA,QAClD,WAAW;AAAA,QACX,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,UAAU;AAAA,MACZ,CAAC,GAAgB,uCAAAA,KAAK,MAAM;AAAA,QAC1B,mBAAmB;AAAA,QACnB,MAAM;AAAA,QACN;AAAA,MACF,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA,EACH,CAAC;AACH;AACA,IAAO,gBAAQ;",
|
|
6
|
-
"names": ["import_context", "_jsx", "clsx", "_jsxs"]
|
|
7
|
-
}
|
|
@@ -1,113 +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/index.tsx
|
|
31
|
-
var navigation_exports = {};
|
|
32
|
-
__export(navigation_exports, {
|
|
33
|
-
Navigation: () => Navigation,
|
|
34
|
-
default: () => navigation_default
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(navigation_exports);
|
|
37
|
-
var import_clsx = __toESM(require("clsx"));
|
|
38
|
-
var import_deprecated = __toESM(require("@wordpress/deprecated"));
|
|
39
|
-
var import_element = require("@wordpress/element");
|
|
40
|
-
var import_i18n = require("@wordpress/i18n");
|
|
41
|
-
var import_animate = require("../animate/index.cjs");
|
|
42
|
-
var import_constants = require("./constants.cjs");
|
|
43
|
-
var import_context = require("./context.cjs");
|
|
44
|
-
var import_navigation_styles = require("./styles/navigation-styles.cjs");
|
|
45
|
-
var import_use_create_navigation_tree = require("./use-create-navigation-tree.cjs");
|
|
46
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
|
-
var noop = () => {
|
|
48
|
-
};
|
|
49
|
-
function Navigation({
|
|
50
|
-
activeItem,
|
|
51
|
-
activeMenu = import_constants.ROOT_MENU,
|
|
52
|
-
children,
|
|
53
|
-
className,
|
|
54
|
-
onActivateMenu = noop
|
|
55
|
-
}) {
|
|
56
|
-
const [menu, setMenu] = (0, import_element.useState)(activeMenu);
|
|
57
|
-
const [slideOrigin, setSlideOrigin] = (0, import_element.useState)();
|
|
58
|
-
const navigationTree = (0, import_use_create_navigation_tree.useCreateNavigationTree)();
|
|
59
|
-
const defaultSlideOrigin = (0, import_i18n.isRTL)() ? "right" : "left";
|
|
60
|
-
(0, import_deprecated.default)("wp.components.Navigation (and all subcomponents)", {
|
|
61
|
-
since: "6.8",
|
|
62
|
-
version: "7.1",
|
|
63
|
-
alternative: "wp.components.Navigator"
|
|
64
|
-
});
|
|
65
|
-
const setActiveMenu = (menuId, slideInOrigin = defaultSlideOrigin) => {
|
|
66
|
-
if (!navigationTree.getMenu(menuId)) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
setSlideOrigin(slideInOrigin);
|
|
70
|
-
setMenu(menuId);
|
|
71
|
-
onActivateMenu(menuId);
|
|
72
|
-
};
|
|
73
|
-
const isMountedRef = (0, import_element.useRef)(false);
|
|
74
|
-
(0, import_element.useEffect)(() => {
|
|
75
|
-
if (!isMountedRef.current) {
|
|
76
|
-
isMountedRef.current = true;
|
|
77
|
-
}
|
|
78
|
-
}, []);
|
|
79
|
-
(0, import_element.useEffect)(() => {
|
|
80
|
-
if (activeMenu !== menu) {
|
|
81
|
-
setActiveMenu(activeMenu);
|
|
82
|
-
}
|
|
83
|
-
}, [activeMenu]);
|
|
84
|
-
const context = {
|
|
85
|
-
activeItem,
|
|
86
|
-
activeMenu: menu,
|
|
87
|
-
setActiveMenu,
|
|
88
|
-
navigationTree
|
|
89
|
-
};
|
|
90
|
-
const classes = (0, import_clsx.default)("components-navigation", className);
|
|
91
|
-
const animateClassName = (0, import_animate.getAnimateClassName)({
|
|
92
|
-
type: "slide-in",
|
|
93
|
-
origin: slideOrigin
|
|
94
|
-
});
|
|
95
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.NavigationUI, {
|
|
96
|
-
className: classes,
|
|
97
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
98
|
-
className: animateClassName ? (0, import_clsx.default)({
|
|
99
|
-
[animateClassName]: isMountedRef.current && slideOrigin
|
|
100
|
-
}) : void 0,
|
|
101
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.NavigationContext.Provider, {
|
|
102
|
-
value: context,
|
|
103
|
-
children
|
|
104
|
-
})
|
|
105
|
-
}, menu)
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
var navigation_default = Navigation;
|
|
109
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
-
0 && (module.exports = {
|
|
111
|
-
Navigation
|
|
112
|
-
});
|
|
113
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/navigation/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getAnimateClassName } from '../animate';\nimport { ROOT_MENU } from './constants';\nimport { NavigationContext } from './context';\nimport { NavigationUI } from './styles/navigation-styles';\nimport { useCreateNavigationTree } from './use-create-navigation-tree';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst noop = () => {};\n\n/**\n * Render a navigation list with optional groupings and hierarchy.\n *\n * @deprecated Use `Navigator` instead.\n *\n * ```jsx\n * import {\n * __experimentalNavigation as Navigation,\n * __experimentalNavigationGroup as NavigationGroup,\n * __experimentalNavigationItem as NavigationItem,\n * __experimentalNavigationMenu as NavigationMenu,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <Navigation>\n * <NavigationMenu title=\"Home\">\n * <NavigationGroup title=\"Group 1\">\n * <NavigationItem item=\"item-1\" title=\"Item 1\" />\n * <NavigationItem item=\"item-2\" title=\"Item 2\" />\n * </NavigationGroup>\n * <NavigationGroup title=\"Group 2\">\n * <NavigationItem\n * item=\"item-3\"\n * navigateToMenu=\"category\"\n * title=\"Category\"\n * />\n * </NavigationGroup>\n * </NavigationMenu>\n *\n * <NavigationMenu\n * backButtonLabel=\"Home\"\n * menu=\"category\"\n * parentMenu=\"root\"\n * title=\"Category\"\n * >\n * <NavigationItem badge=\"1\" item=\"child-1\" title=\"Child 1\" />\n * <NavigationItem item=\"child-2\" title=\"Child 2\" />\n * </NavigationMenu>\n * </Navigation>\n * );\n * ```\n */\nexport function Navigation({\n activeItem,\n activeMenu = ROOT_MENU,\n children,\n className,\n onActivateMenu = noop\n}) {\n const [menu, setMenu] = useState(activeMenu);\n const [slideOrigin, setSlideOrigin] = useState();\n const navigationTree = useCreateNavigationTree();\n const defaultSlideOrigin = isRTL() ? 'right' : 'left';\n deprecated('wp.components.Navigation (and all subcomponents)', {\n since: '6.8',\n version: '7.1',\n alternative: 'wp.components.Navigator'\n });\n const setActiveMenu = (menuId, slideInOrigin = defaultSlideOrigin) => {\n if (!navigationTree.getMenu(menuId)) {\n return;\n }\n setSlideOrigin(slideInOrigin);\n setMenu(menuId);\n onActivateMenu(menuId);\n };\n\n // Used to prevent the sliding animation on mount\n const isMountedRef = useRef(false);\n useEffect(() => {\n if (!isMountedRef.current) {\n isMountedRef.current = true;\n }\n }, []);\n useEffect(() => {\n if (activeMenu !== menu) {\n setActiveMenu(activeMenu);\n }\n // Not adding deps for now, as it would require either a larger refactor or some questionable workarounds.\n // See https://github.com/WordPress/gutenberg/pull/41612 for context.\n }, [activeMenu]);\n const context = {\n activeItem,\n activeMenu: menu,\n setActiveMenu,\n navigationTree\n };\n const classes = clsx('components-navigation', className);\n const animateClassName = getAnimateClassName({\n type: 'slide-in',\n origin: slideOrigin\n });\n return /*#__PURE__*/_jsx(NavigationUI, {\n className: classes,\n children: /*#__PURE__*/_jsx(\"div\", {\n className: animateClassName ? clsx({\n [animateClassName]: isMountedRef.current && slideOrigin\n }) : undefined,\n children: /*#__PURE__*/_jsx(NavigationContext.Provider, {\n value: context,\n children: children\n })\n }, menu)\n });\n}\nexport default Navigation;"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,wBAAuB;AACvB,qBAA4C;AAC5C,kBAAsB;AAKtB,qBAAoC;AACpC,uBAA0B;AAC1B,qBAAkC;AAClC,+BAA6B;AAC7B,wCAAwC;AACxC,yBAA4B;AAC5B,IAAM,OAAO,MAAM;AAAC;AA4Cb,SAAS,WAAW;AAAA,EACzB;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA,iBAAiB;AACnB,GAAG;AACD,QAAM,CAAC,MAAM,OAAO,QAAI,yBAAS,UAAU;AAC3C,QAAM,CAAC,aAAa,cAAc,QAAI,yBAAS;AAC/C,QAAM,qBAAiB,2DAAwB;AAC/C,QAAM,yBAAqB,mBAAM,IAAI,UAAU;AAC/C,wBAAAA,SAAW,oDAAoD;AAAA,IAC7D,OAAO;AAAA,IACP,SAAS;AAAA,IACT,aAAa;AAAA,EACf,CAAC;AACD,QAAM,gBAAgB,CAAC,QAAQ,gBAAgB,uBAAuB;AACpE,QAAI,CAAC,eAAe,QAAQ,MAAM,GAAG;AACnC;AAAA,IACF;AACA,mBAAe,aAAa;AAC5B,YAAQ,MAAM;AACd,mBAAe,MAAM;AAAA,EACvB;AAGA,QAAM,mBAAe,uBAAO,KAAK;AACjC,gCAAU,MAAM;AACd,QAAI,CAAC,aAAa,SAAS;AACzB,mBAAa,UAAU;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,CAAC;AACL,gCAAU,MAAM;AACd,QAAI,eAAe,MAAM;AACvB,oBAAc,UAAU;AAAA,IAC1B;AAAA,EAGF,GAAG,CAAC,UAAU,CAAC;AACf,QAAM,UAAU;AAAA,IACd;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,EACF;AACA,QAAM,cAAU,YAAAC,SAAK,yBAAyB,SAAS;AACvD,QAAM,uBAAmB,oCAAoB;AAAA,IAC3C,MAAM;AAAA,IACN,QAAQ;AAAA,EACV,CAAC;AACD,SAAoB,uCAAAC,KAAK,uCAAc;AAAA,IACrC,WAAW;AAAA,IACX,UAAuB,uCAAAA,KAAK,OAAO;AAAA,MACjC,WAAW,uBAAmB,YAAAD,SAAK;AAAA,QACjC,CAAC,gBAAgB,GAAG,aAAa,WAAW;AAAA,MAC9C,CAAC,IAAI;AAAA,MACL,UAAuB,uCAAAC,KAAK,iCAAkB,UAAU;AAAA,QACtD,OAAO;AAAA,QACP;AAAA,MACF,CAAC;AAAA,IACH,GAAG,IAAI;AAAA,EACT,CAAC;AACH;AACA,IAAO,qBAAQ;",
|
|
6
|
-
"names": ["deprecated", "clsx", "_jsx"]
|
|
7
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/components/src/navigation/item/base-content.tsx
|
|
21
|
-
var base_content_exports = {};
|
|
22
|
-
__export(base_content_exports, {
|
|
23
|
-
default: () => NavigationItemBaseContent
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(base_content_exports);
|
|
26
|
-
var import_navigation_styles = require("../styles/navigation-styles.cjs");
|
|
27
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
-
function NavigationItemBaseContent(props) {
|
|
29
|
-
const {
|
|
30
|
-
badge,
|
|
31
|
-
title
|
|
32
|
-
} = props;
|
|
33
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
34
|
-
children: [title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.ItemTitleUI, {
|
|
35
|
-
className: "components-navigation__item-title",
|
|
36
|
-
as: "span",
|
|
37
|
-
children: title
|
|
38
|
-
}), badge && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.ItemBadgeUI, {
|
|
39
|
-
className: "components-navigation__item-badge",
|
|
40
|
-
children: badge
|
|
41
|
-
})]
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=base-content.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/navigation/item/base-content.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport { ItemBadgeUI, ItemTitleUI } from '../styles/navigation-styles';\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default function NavigationItemBaseContent(props) {\n const {\n badge,\n title\n } = props;\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [title && /*#__PURE__*/_jsx(ItemTitleUI, {\n className: \"components-navigation__item-title\",\n as: \"span\",\n children: title\n }), badge && /*#__PURE__*/_jsx(ItemBadgeUI, {\n className: \"components-navigation__item-badge\",\n children: badge\n })]\n });\n}"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,+BAAyC;AACzC,yBAAkE;AACnD,SAAR,0BAA2C,OAAO;AACvD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF,IAAI;AACJ,SAAoB,uCAAAA,MAAM,mBAAAC,UAAW;AAAA,IACnC,UAAU,CAAC,SAAsB,uCAAAC,KAAK,sCAAa;AAAA,MACjD,WAAW;AAAA,MACX,IAAI;AAAA,MACJ,UAAU;AAAA,IACZ,CAAC,GAAG,SAAsB,uCAAAA,KAAK,sCAAa;AAAA,MAC1C,WAAW;AAAA,MACX,UAAU;AAAA,IACZ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;",
|
|
6
|
-
"names": ["_jsxs", "_Fragment", "_jsx"]
|
|
7
|
-
}
|
|
@@ -1,66 +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/item/base.tsx
|
|
31
|
-
var base_exports = {};
|
|
32
|
-
__export(base_exports, {
|
|
33
|
-
default: () => NavigationItemBase
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(base_exports);
|
|
36
|
-
var import_clsx = __toESM(require("clsx"));
|
|
37
|
-
var import_element = require("@wordpress/element");
|
|
38
|
-
var import_context = require("../context.cjs");
|
|
39
|
-
var import_use_navigation_tree_item = require("./use-navigation-tree-item.cjs");
|
|
40
|
-
var import_navigation_styles = require("../styles/navigation-styles.cjs");
|
|
41
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
-
var uniqueId = 0;
|
|
43
|
-
function NavigationItemBase(props) {
|
|
44
|
-
const {
|
|
45
|
-
children,
|
|
46
|
-
className,
|
|
47
|
-
title,
|
|
48
|
-
href,
|
|
49
|
-
...restProps
|
|
50
|
-
} = props;
|
|
51
|
-
const [itemId] = (0, import_element.useState)(`item-${++uniqueId}`);
|
|
52
|
-
(0, import_use_navigation_tree_item.useNavigationTreeItem)(itemId, props);
|
|
53
|
-
const {
|
|
54
|
-
navigationTree
|
|
55
|
-
} = (0, import_context.useNavigationContext)();
|
|
56
|
-
if (!navigationTree.getItem(itemId)?._isVisible) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
const classes = (0, import_clsx.default)("components-navigation__item", className);
|
|
60
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.ItemBaseUI, {
|
|
61
|
-
className: classes,
|
|
62
|
-
...restProps,
|
|
63
|
-
children
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=base.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/navigation/item/base.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { useNavigationTreeItem } from './use-navigation-tree-item';\nimport { ItemBaseUI } from '../styles/navigation-styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nlet uniqueId = 0;\nexport default function NavigationItemBase(props) {\n // Also avoid to pass the `title` and `href` props to the ItemBaseUI styled component.\n const {\n children,\n className,\n title,\n href,\n ...restProps\n } = props;\n const [itemId] = useState(`item-${++uniqueId}`);\n useNavigationTreeItem(itemId, props);\n const {\n navigationTree\n } = useNavigationContext();\n if (!navigationTree.getItem(itemId)?._isVisible) {\n return null;\n }\n const classes = clsx('components-navigation__item', className);\n return /*#__PURE__*/_jsx(ItemBaseUI, {\n className: classes,\n ...restProps,\n children: children\n });\n}"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAAyB;AAKzB,qBAAqC;AACrC,sCAAsC;AACtC,+BAA2B;AAC3B,yBAA4B;AAC5B,IAAI,WAAW;AACA,SAAR,mBAAoC,OAAO;AAEhD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,CAAC,MAAM,QAAI,yBAAS,QAAQ,EAAE,QAAQ,EAAE;AAC9C,6DAAsB,QAAQ,KAAK;AACnC,QAAM;AAAA,IACJ;AAAA,EACF,QAAI,qCAAqB;AACzB,MAAI,CAAC,eAAe,QAAQ,MAAM,GAAG,YAAY;AAC/C,WAAO;AAAA,EACT;AACA,QAAM,cAAU,YAAAA,SAAK,+BAA+B,SAAS;AAC7D,SAAoB,uCAAAC,KAAK,qCAAY;AAAA,IACnC,WAAW;AAAA,IACX,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;",
|
|
6
|
-
"names": ["clsx", "_jsx"]
|
|
7
|
-
}
|
|
@@ -1,119 +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/item/index.tsx
|
|
31
|
-
var item_exports = {};
|
|
32
|
-
__export(item_exports, {
|
|
33
|
-
NavigationItem: () => NavigationItem,
|
|
34
|
-
default: () => item_default
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(item_exports);
|
|
37
|
-
var import_clsx = __toESM(require("clsx"));
|
|
38
|
-
var import_icons = require("@wordpress/icons");
|
|
39
|
-
var import_i18n = require("@wordpress/i18n");
|
|
40
|
-
var import_button = __toESM(require("../../button/index.cjs"));
|
|
41
|
-
var import_context = require("../context.cjs");
|
|
42
|
-
var import_navigation_styles = require("../styles/navigation-styles.cjs");
|
|
43
|
-
var import_base_content = __toESM(require("./base-content.cjs"));
|
|
44
|
-
var import_base = __toESM(require("./base.cjs"));
|
|
45
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
46
|
-
var noop = () => {
|
|
47
|
-
};
|
|
48
|
-
function NavigationItem(props) {
|
|
49
|
-
const {
|
|
50
|
-
badge,
|
|
51
|
-
children,
|
|
52
|
-
className,
|
|
53
|
-
href,
|
|
54
|
-
item,
|
|
55
|
-
navigateToMenu,
|
|
56
|
-
onClick = noop,
|
|
57
|
-
title,
|
|
58
|
-
icon,
|
|
59
|
-
hideIfTargetMenuEmpty,
|
|
60
|
-
isText,
|
|
61
|
-
...restProps
|
|
62
|
-
} = props;
|
|
63
|
-
const {
|
|
64
|
-
activeItem,
|
|
65
|
-
setActiveMenu,
|
|
66
|
-
navigationTree: {
|
|
67
|
-
isMenuEmpty
|
|
68
|
-
}
|
|
69
|
-
} = (0, import_context.useNavigationContext)();
|
|
70
|
-
if (hideIfTargetMenuEmpty && navigateToMenu && isMenuEmpty(navigateToMenu)) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
const isActive = item && activeItem === item;
|
|
74
|
-
const classes = (0, import_clsx.default)(className, {
|
|
75
|
-
"is-active": isActive
|
|
76
|
-
});
|
|
77
|
-
const onItemClick = (event) => {
|
|
78
|
-
if (navigateToMenu) {
|
|
79
|
-
setActiveMenu(navigateToMenu);
|
|
80
|
-
}
|
|
81
|
-
onClick(event);
|
|
82
|
-
};
|
|
83
|
-
const navigationIcon = (0, import_i18n.isRTL)() ? import_icons.chevronLeft : import_icons.chevronRight;
|
|
84
|
-
const baseProps = children ? props : {
|
|
85
|
-
...props,
|
|
86
|
-
onClick: void 0
|
|
87
|
-
};
|
|
88
|
-
const itemProps = isText ? restProps : {
|
|
89
|
-
as: import_button.default,
|
|
90
|
-
__next40pxDefaultSize: "as" in restProps ? restProps.as === void 0 : true,
|
|
91
|
-
href,
|
|
92
|
-
onClick: onItemClick,
|
|
93
|
-
"aria-current": isActive ? "page" : void 0,
|
|
94
|
-
...restProps
|
|
95
|
-
};
|
|
96
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_base.default, {
|
|
97
|
-
...baseProps,
|
|
98
|
-
className: classes,
|
|
99
|
-
children: children || /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_navigation_styles.ItemUI, {
|
|
100
|
-
...itemProps,
|
|
101
|
-
children: [icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_styles.ItemIconUI, {
|
|
102
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, {
|
|
103
|
-
icon
|
|
104
|
-
})
|
|
105
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_base_content.default, {
|
|
106
|
-
title,
|
|
107
|
-
badge
|
|
108
|
-
}), navigateToMenu && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, {
|
|
109
|
-
icon: navigationIcon
|
|
110
|
-
})]
|
|
111
|
-
})
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
var item_default = NavigationItem;
|
|
115
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
116
|
-
0 && (module.exports = {
|
|
117
|
-
NavigationItem
|
|
118
|
-
});
|
|
119
|
-
//# sourceMappingURL=index.cjs.map
|