@wordpress/components 23.5.0 → 23.6.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 +40 -7
- package/build/animate/index.js +3 -1
- package/build/animate/index.js.map +1 -1
- package/build/animation/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +5 -5
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/get-default-use-items.js.map +1 -1
- package/build/autocomplete/index.js +25 -91
- package/build/autocomplete/index.js.map +1 -1
- package/build/autocomplete/types.js +6 -0
- package/build/autocomplete/types.js.map +1 -0
- package/build/custom-gradient-picker/gradient-bar/control-points.js +2 -0
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/index.js +2 -0
- package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/utils.js +2 -0
- package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build/custom-gradient-picker/index.js +2 -0
- package/build/custom-gradient-picker/index.js.map +1 -1
- package/build/custom-gradient-picker/serializer.js +1 -0
- package/build/custom-gradient-picker/serializer.js.map +1 -1
- package/build/custom-gradient-picker/utils.js +2 -0
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/dimension-control/index.js +31 -5
- package/build/dimension-control/index.js.map +1 -1
- package/build/dimension-control/sizes.js +2 -4
- package/build/dimension-control/sizes.js.map +1 -1
- package/build/dimension-control/types.js +6 -0
- package/build/dimension-control/types.js.map +1 -0
- package/build/flex/flex/hook.js +3 -3
- package/build/flex/flex/hook.js.map +1 -1
- package/build/font-size-picker/index.js +2 -1
- package/build/font-size-picker/index.js.map +1 -1
- package/build/form-token-field/index.js +1 -1
- package/build/form-token-field/index.js.map +1 -1
- package/build/gradient-picker/index.js +2 -0
- package/build/gradient-picker/index.js.map +1 -1
- package/build/guide/icons.js.map +1 -1
- package/build/guide/index.js +46 -8
- package/build/guide/index.js.map +1 -1
- package/build/guide/page-control.js.map +1 -1
- package/build/guide/page.js.map +1 -1
- package/build/guide/types.js +6 -0
- package/build/guide/types.js.map +1 -0
- package/build/h-stack/utils.js +5 -5
- package/build/h-stack/utils.js.map +1 -1
- package/build/higher-order/navigate-regions/index.js +33 -3
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-fallback-styles/index.js +2 -2
- package/build/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build/higher-order/with-filters/index.js +31 -7
- package/build/higher-order/with-filters/index.js.map +1 -1
- package/build/higher-order/with-focus-return/index.js +10 -10
- package/build/higher-order/with-focus-return/index.js.map +1 -1
- package/build/higher-order/with-notices/index.js +28 -25
- package/build/higher-order/with-notices/index.js.map +1 -1
- package/build/higher-order/with-notices/types.js +6 -0
- package/build/higher-order/with-notices/types.js.map +1 -0
- package/build/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build/icon/index.js +1 -8
- package/build/icon/index.js.map +1 -1
- package/build/index.native.js +18 -9
- package/build/index.native.js.map +1 -1
- package/build/mobile/bottom-sheet/cell.native.js +1 -1
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet-text-control/index.native.js +4 -3
- package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build/navigation/back-button/index.js +6 -5
- package/build/navigation/back-button/index.js.map +1 -1
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/context.js +7 -4
- package/build/navigation/context.js.map +1 -1
- package/build/navigation/group/context.js.map +1 -1
- package/build/navigation/group/index.js +5 -1
- package/build/navigation/group/index.js.map +1 -1
- package/build/navigation/index.js +49 -3
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/item/base-content.js +0 -1
- package/build/navigation/item/base-content.js.map +1 -1
- package/build/navigation/item/base.js.map +1 -1
- package/build/navigation/item/index.js +5 -1
- package/build/navigation/item/index.js.map +1 -1
- package/build/navigation/item/use-navigation-tree-item.js +1 -1
- package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build/navigation/menu/context.js.map +1 -1
- package/build/navigation/menu/index.js +5 -1
- package/build/navigation/menu/index.js.map +1 -1
- package/build/navigation/menu/menu-title-search.js +8 -6
- package/build/navigation/menu/menu-title-search.js.map +1 -1
- package/build/navigation/menu/menu-title.js +4 -2
- package/build/navigation/menu/menu-title.js.map +1 -1
- package/build/navigation/menu/search-no-results-found.js.map +1 -1
- package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js +36 -36
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/navigation/types.js +6 -0
- package/build/navigation/types.js.map +1 -0
- package/build/navigation/use-create-navigation-tree.js +7 -0
- package/build/navigation/use-create-navigation-tree.js.map +1 -1
- package/build/navigation/use-navigation-tree-nodes.js +3 -5
- package/build/navigation/use-navigation-tree-nodes.js.map +1 -1
- package/build/navigation/utils.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +5 -3
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/number-control/index.js +1 -3
- package/build/number-control/index.js.map +1 -1
- package/build/palette-edit/index.js +67 -27
- package/build/palette-edit/index.js.map +1 -1
- package/build/palette-edit/types.js +6 -0
- package/build/palette-edit/types.js.map +1 -0
- package/build/panel/body.js +15 -17
- package/build/panel/body.js.map +1 -1
- package/build/placeholder/index.js.map +1 -1
- package/build/query-controls/author-select.js +0 -4
- package/build/query-controls/author-select.js.map +1 -1
- package/build/query-controls/category-select.js +0 -4
- package/build/query-controls/category-select.js.map +1 -1
- package/build/query-controls/terms.js +30 -15
- package/build/query-controls/terms.js.map +1 -1
- package/build/range-control/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build/responsive-wrapper/index.js +12 -13
- package/build/responsive-wrapper/index.js.map +1 -1
- package/build/select-control/index.js +19 -16
- package/build/select-control/index.js.map +1 -1
- package/build/toolbar/toolbar-button/index.js +32 -10
- package/build/toolbar/toolbar-button/index.js.map +1 -1
- package/build/toolbar/toolbar-button/toolbar-button-container.js +12 -4
- package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build/toolbar/toolbar-button/types.js +6 -0
- package/build/toolbar/toolbar-button/types.js.map +1 -0
- package/build/toolbar/toolbar-context/index.js +4 -2
- package/build/toolbar/toolbar-context/index.js.map +1 -1
- package/build/tooltip/index.js +18 -6
- package/build/tooltip/index.js.map +1 -1
- package/build/tree-select/index.js.map +1 -1
- package/build/ui/context/get-styled-class-name-from-key.js +2 -2
- package/build/ui/context/get-styled-class-name-from-key.js.map +1 -1
- package/build/utils/font.js +3 -7
- package/build/utils/font.js.map +1 -1
- package/build/v-stack/hook.js +2 -0
- package/build/v-stack/hook.js.map +1 -1
- package/build-module/animate/index.js +3 -1
- package/build-module/animate/index.js.map +1 -1
- package/build-module/animation/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +6 -6
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/get-default-use-items.js.map +1 -1
- package/build-module/autocomplete/index.js +28 -94
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/autocomplete/types.js +2 -0
- package/build-module/autocomplete/types.js.map +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -0
- package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/utils.js +2 -0
- package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
- package/build-module/custom-gradient-picker/index.js +1 -0
- package/build-module/custom-gradient-picker/index.js.map +1 -1
- package/build-module/custom-gradient-picker/serializer.js +1 -0
- package/build-module/custom-gradient-picker/serializer.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js +2 -0
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/dimension-control/index.js +28 -3
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/dimension-control/sizes.js +6 -5
- package/build-module/dimension-control/sizes.js.map +1 -1
- package/build-module/dimension-control/types.js +2 -0
- package/build-module/dimension-control/types.js.map +1 -0
- package/build-module/flex/flex/hook.js +3 -3
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/font-size-picker/index.js +2 -1
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/form-token-field/index.js +1 -1
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/gradient-picker/index.js +1 -0
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/guide/icons.js.map +1 -1
- package/build-module/guide/index.js +45 -8
- package/build-module/guide/index.js.map +1 -1
- package/build-module/guide/page-control.js.map +1 -1
- package/build-module/guide/page.js +4 -0
- package/build-module/guide/page.js.map +1 -1
- package/build-module/guide/types.js +2 -0
- package/build-module/guide/types.js.map +1 -0
- package/build-module/h-stack/utils.js +5 -5
- package/build-module/h-stack/utils.js.map +1 -1
- package/build-module/higher-order/navigate-regions/index.js +33 -3
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +2 -2
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/higher-order/with-filters/index.js +31 -7
- package/build-module/higher-order/with-filters/index.js.map +1 -1
- package/build-module/higher-order/with-focus-return/index.js +10 -10
- package/build-module/higher-order/with-focus-return/index.js.map +1 -1
- package/build-module/higher-order/with-notices/index.js +29 -26
- package/build-module/higher-order/with-notices/index.js.map +1 -1
- package/build-module/higher-order/with-notices/types.js +2 -0
- package/build-module/higher-order/with-notices/types.js.map +1 -0
- package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
- package/build-module/icon/index.js +2 -9
- package/build-module/icon/index.js.map +1 -1
- package/build-module/index.native.js +1 -0
- package/build-module/index.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet-text-control/index.native.js +4 -3
- package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
- package/build-module/navigation/back-button/index.js +4 -3
- package/build-module/navigation/back-button/index.js.map +1 -1
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/context.js +7 -4
- package/build-module/navigation/context.js.map +1 -1
- package/build-module/navigation/group/context.js +4 -0
- package/build-module/navigation/group/context.js.map +1 -1
- package/build-module/navigation/group/index.js +2 -1
- package/build-module/navigation/group/index.js.map +1 -1
- package/build-module/navigation/index.js +46 -3
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/item/base-content.js +0 -1
- package/build-module/navigation/item/base-content.js.map +1 -1
- package/build-module/navigation/item/base.js.map +1 -1
- package/build-module/navigation/item/index.js +2 -1
- package/build-module/navigation/item/index.js.map +1 -1
- package/build-module/navigation/item/use-navigation-tree-item.js +1 -1
- package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
- package/build-module/navigation/menu/context.js +4 -0
- package/build-module/navigation/menu/context.js.map +1 -1
- package/build-module/navigation/menu/index.js +2 -1
- package/build-module/navigation/menu/index.js.map +1 -1
- package/build-module/navigation/menu/menu-title-search.js +8 -6
- package/build-module/navigation/menu/menu-title-search.js.map +1 -1
- package/build-module/navigation/menu/menu-title.js +4 -2
- package/build-module/navigation/menu/menu-title.js.map +1 -1
- package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
- package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js +36 -36
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/navigation/types.js +2 -0
- package/build-module/navigation/types.js.map +1 -0
- package/build-module/navigation/use-create-navigation-tree.js +7 -0
- package/build-module/navigation/use-create-navigation-tree.js.map +1 -1
- package/build-module/navigation/use-navigation-tree-nodes.js +2 -2
- package/build-module/navigation/use-navigation-tree-nodes.js.map +1 -1
- package/build-module/navigation/utils.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +5 -3
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/number-control/index.js +1 -3
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/palette-edit/index.js +65 -27
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/palette-edit/types.js +2 -0
- package/build-module/palette-edit/types.js.map +1 -0
- package/build-module/panel/body.js +12 -12
- package/build-module/panel/body.js.map +1 -1
- package/build-module/placeholder/index.js.map +1 -1
- package/build-module/query-controls/author-select.js +0 -4
- package/build-module/query-controls/author-select.js.map +1 -1
- package/build-module/query-controls/category-select.js +1 -5
- package/build-module/query-controls/category-select.js.map +1 -1
- package/build-module/query-controls/terms.js +29 -16
- package/build-module/query-controls/terms.js.map +1 -1
- package/build-module/range-control/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build-module/responsive-wrapper/index.js +12 -12
- package/build-module/responsive-wrapper/index.js.map +1 -1
- package/build-module/select-control/index.js +20 -17
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/index.js +32 -9
- package/build-module/toolbar/toolbar-button/index.js.map +1 -1
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js +12 -4
- package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
- package/build-module/toolbar/toolbar-button/types.js +2 -0
- package/build-module/toolbar/toolbar-button/types.js.map +1 -0
- package/build-module/toolbar/toolbar-context/index.js +4 -2
- package/build-module/toolbar/toolbar-context/index.js.map +1 -1
- package/build-module/tooltip/index.js +16 -6
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tree-select/index.js.map +1 -1
- package/build-module/ui/context/get-styled-class-name-from-key.js +1 -1
- package/build-module/ui/context/get-styled-class-name-from-key.js.map +1 -1
- package/build-module/utils/font.js +3 -6
- package/build-module/utils/font.js.map +1 -1
- package/build-module/v-stack/hook.js +2 -0
- package/build-module/v-stack/hook.js.map +1 -1
- package/build-style/style-rtl.css +14 -11
- package/build-style/style.css +14 -11
- package/build-types/alignment-matrix-control/types.d.ts +4 -4
- package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
- package/build-types/angle-picker-control/types.d.ts +2 -2
- package/build-types/angle-picker-control/types.d.ts.map +1 -1
- package/build-types/animate/index.d.ts +2 -2
- package/build-types/animate/index.d.ts.map +1 -1
- package/build-types/animation/index.d.ts +8 -1
- package/build-types/animation/index.d.ts.map +1 -1
- package/build-types/autocomplete/autocompleter-ui.d.ts +4 -0
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -0
- package/build-types/autocomplete/get-default-use-items.d.ts +3 -0
- package/build-types/autocomplete/get-default-use-items.d.ts.map +1 -0
- package/build-types/autocomplete/index.d.ts +23 -0
- package/build-types/autocomplete/index.d.ts.map +1 -0
- package/build-types/autocomplete/test/index.d.ts +2 -0
- package/build-types/autocomplete/test/index.d.ts.map +1 -0
- package/build-types/autocomplete/types.d.ts +201 -0
- package/build-types/autocomplete/types.d.ts.map +1 -0
- package/build-types/base-control/types.d.ts +2 -2
- package/build-types/base-control/types.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/styles.d.ts +3 -3
- package/build-types/border-box-control/styles.d.ts.map +1 -1
- package/build-types/border-box-control/types.d.ts +8 -8
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/border-box-control/utils.d.ts +5 -5
- package/build-types/border-box-control/utils.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +3 -3
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +2 -2
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts +4 -4
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +6 -6
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/box-control/types.d.ts +6 -6
- package/build-types/box-control/types.d.ts.map +1 -1
- package/build-types/button/deprecated.d.ts +6 -6
- package/build-types/button/types.d.ts +10 -10
- package/build-types/button/types.d.ts.map +1 -1
- package/build-types/button-group/types.d.ts +1 -1
- package/build-types/button-group/types.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +1 -1
- package/build-types/card/card/hook.d.ts.map +1 -1
- package/build-types/card/types.d.ts +10 -10
- package/build-types/card/types.d.ts.map +1 -1
- package/build-types/checkbox-control/types.d.ts +1 -1
- package/build-types/checkbox-control/types.d.ts.map +1 -1
- package/build-types/circular-option-picker/types.d.ts +4 -4
- package/build-types/circular-option-picker/types.d.ts.map +1 -1
- package/build-types/color-indicator/types.d.ts +1 -1
- package/build-types/color-indicator/types.d.ts.map +1 -1
- package/build-types/color-list-picker/types.d.ts +2 -2
- package/build-types/color-list-picker/types.d.ts.map +1 -1
- package/build-types/color-palette/types.d.ts +7 -7
- package/build-types/color-palette/types.d.ts.map +1 -1
- package/build-types/color-palette/utils.d.ts +1 -1
- package/build-types/color-palette/utils.d.ts.map +1 -1
- package/build-types/color-picker/legacy-adapter.d.ts +1 -1
- package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts +3 -3
- package/build-types/color-picker/types.d.ts +2 -2
- package/build-types/color-picker/types.d.ts.map +1 -1
- package/build-types/color-picker/use-deprecated-props.d.ts +2 -2
- package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
- package/build-types/combobox-control/types.d.ts +2 -2
- package/build-types/combobox-control/types.d.ts.map +1 -1
- package/build-types/confirm-dialog/component.d.ts +4 -4
- package/build-types/confirm-dialog/types.d.ts +5 -5
- package/build-types/confirm-dialog/types.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/constants.d.ts +25 -0
- package/build-types/custom-gradient-picker/constants.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/gradient-bar/constants.d.ts +8 -0
- package/build-types/custom-gradient-picker/gradient-bar/constants.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +25 -0
- package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +10 -0
- package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/gradient-bar/utils.d.ts +138 -0
- package/build-types/custom-gradient-picker/gradient-bar/utils.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/index.d.ts +7 -0
- package/build-types/custom-gradient-picker/index.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/serializer.d.ts +17 -0
- package/build-types/custom-gradient-picker/serializer.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +11 -0
- package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/utils.d.ts +5 -0
- package/build-types/custom-gradient-picker/utils.d.ts.map +1 -0
- package/build-types/custom-select-control/styles.d.ts +1 -1
- package/build-types/custom-select-control/styles.d.ts.map +1 -1
- package/build-types/dashicon/types.d.ts +2 -2
- package/build-types/dashicon/types.d.ts.map +1 -1
- package/build-types/date-time/date-time/styles.d.ts +1 -4
- package/build-types/date-time/date-time/styles.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +1 -1
- package/build-types/date-time/types.d.ts +4 -4
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts +28 -0
- package/build-types/dimension-control/index.d.ts.map +1 -0
- package/build-types/dimension-control/sizes.d.ts +26 -0
- package/build-types/dimension-control/sizes.d.ts.map +1 -0
- package/build-types/dimension-control/stories/index.d.ts +12 -0
- package/build-types/dimension-control/stories/index.d.ts.map +1 -0
- package/build-types/dimension-control/types.d.ts +47 -0
- package/build-types/dimension-control/types.d.ts.map +1 -0
- package/build-types/divider/types.d.ts +1 -1
- package/build-types/divider/types.d.ts.map +1 -1
- package/build-types/draggable/types.d.ts +1 -1
- package/build-types/draggable/types.d.ts.map +1 -1
- package/build-types/drop-zone/types.d.ts +2 -2
- package/build-types/drop-zone/types.d.ts.map +1 -1
- package/build-types/dropdown/types.d.ts +3 -3
- package/build-types/dropdown/types.d.ts.map +1 -1
- package/build-types/elevation/types.d.ts +1 -1
- package/build-types/elevation/types.d.ts.map +1 -1
- package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
- package/build-types/external-link/types.d.ts +1 -1
- package/build-types/external-link/types.d.ts.map +1 -1
- package/build-types/flex/types.d.ts +4 -4
- package/build-types/flex/types.d.ts.map +1 -1
- package/build-types/focal-point-picker/types.d.ts +7 -7
- package/build-types/focal-point-picker/types.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/stories/index.d.ts.map +1 -1
- package/build-types/font-size-picker/types.d.ts +9 -5
- package/build-types/font-size-picker/types.d.ts.map +1 -1
- package/build-types/form-file-upload/types.d.ts +1 -1
- package/build-types/form-file-upload/types.d.ts.map +1 -1
- package/build-types/form-toggle/types.d.ts +1 -1
- package/build-types/form-toggle/types.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/form-token-field/stories/index.d.ts +6 -0
- package/build-types/form-token-field/stories/index.d.ts.map +1 -1
- package/build-types/form-token-field/styles.d.ts +1 -1
- package/build-types/form-token-field/styles.d.ts.map +1 -1
- package/build-types/form-token-field/types.d.ts +1 -1
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/gradient-picker/index.d.ts +12 -0
- package/build-types/gradient-picker/index.d.ts.map +1 -0
- package/build-types/grid/types.d.ts +2 -2
- package/build-types/grid/types.d.ts.map +1 -1
- package/build-types/guide/icons.d.ts +5 -0
- package/build-types/guide/icons.d.ts.map +1 -0
- package/build-types/guide/index.d.ts +37 -0
- package/build-types/guide/index.d.ts.map +1 -0
- package/build-types/guide/page-control.d.ts +4 -0
- package/build-types/guide/page-control.d.ts.map +1 -0
- package/build-types/guide/page.d.ts +7 -0
- package/build-types/guide/page.d.ts.map +1 -0
- package/build-types/guide/stories/index.d.ts +9 -0
- package/build-types/guide/stories/index.d.ts.map +1 -0
- package/build-types/guide/test/index.d.ts +2 -0
- package/build-types/guide/test/index.d.ts.map +1 -0
- package/build-types/guide/types.d.ts +65 -0
- package/build-types/guide/types.d.ts.map +1 -0
- package/build-types/h-stack/types.d.ts +6 -6
- package/build-types/h-stack/types.d.ts.map +1 -1
- package/build-types/heading/hook.d.ts +1 -1
- package/build-types/heading/types.d.ts +2 -2
- package/build-types/heading/types.d.ts.map +1 -1
- package/build-types/higher-order/navigate-regions/index.d.ts +46 -0
- package/build-types/higher-order/navigate-regions/index.d.ts.map +1 -0
- package/build-types/higher-order/with-fallback-styles/index.d.ts +44 -0
- package/build-types/higher-order/with-fallback-styles/index.d.ts.map +1 -0
- package/build-types/higher-order/with-filters/index.d.ts +89 -0
- package/build-types/higher-order/with-filters/index.d.ts.map +1 -0
- package/build-types/higher-order/with-filters/test/index.d.ts +2 -0
- package/build-types/higher-order/with-filters/test/index.d.ts.map +1 -0
- package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
- package/build-types/higher-order/with-focus-return/index.d.ts +20 -0
- package/build-types/higher-order/with-focus-return/index.d.ts.map +1 -0
- package/build-types/higher-order/with-focus-return/test/index.d.ts +2 -0
- package/build-types/higher-order/with-focus-return/test/index.d.ts.map +1 -0
- package/build-types/higher-order/with-notices/index.d.ts +37 -0
- package/build-types/higher-order/with-notices/index.d.ts.map +1 -0
- package/build-types/higher-order/with-notices/test/index.d.ts +2 -0
- package/build-types/higher-order/with-notices/test/index.d.ts.map +1 -0
- package/build-types/higher-order/with-notices/types.d.ts +34 -0
- package/build-types/higher-order/with-notices/types.d.ts.map +1 -0
- package/build-types/higher-order/with-spoken-messages/index.d.ts +13 -2
- package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
- package/build-types/higher-order/with-spoken-messages/test/index.d.ts +2 -0
- package/build-types/higher-order/with-spoken-messages/test/index.d.ts.map +1 -0
- package/build-types/icon/index.d.ts +10 -6
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/icon/test/index.d.ts +2 -0
- package/build-types/icon/test/index.d.ts.map +1 -0
- package/build-types/input-control/reducer/actions.d.ts +15 -15
- package/build-types/input-control/reducer/actions.d.ts.map +1 -1
- package/build-types/input-control/reducer/state.d.ts +1 -1
- package/build-types/input-control/reducer/state.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +4 -4
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +7 -7
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +1 -1
- package/build-types/item-group/types.d.ts +2 -2
- package/build-types/item-group/types.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/types.d.ts +3 -3
- package/build-types/keyboard-shortcuts/types.d.ts.map +1 -1
- package/build-types/menu-group/types.d.ts +1 -1
- package/build-types/menu-group/types.d.ts.map +1 -1
- package/build-types/menu-item/index.d.ts +1 -1
- package/build-types/menu-items-choice/types.d.ts +2 -2
- package/build-types/menu-items-choice/types.d.ts.map +1 -1
- package/build-types/modal/types.d.ts +1 -1
- package/build-types/modal/types.d.ts.map +1 -1
- package/build-types/navigable-container/container.d.ts +1 -1
- package/build-types/navigable-container/menu.d.ts +1 -1
- package/build-types/navigable-container/tabbable.d.ts +1 -1
- package/build-types/navigation/back-button/index.d.ts +5 -0
- package/build-types/navigation/back-button/index.d.ts.map +1 -0
- package/build-types/navigation/constants.d.ts +3 -0
- package/build-types/navigation/constants.d.ts.map +1 -0
- package/build-types/navigation/context.d.ts +5 -0
- package/build-types/navigation/context.d.ts.map +1 -0
- package/build-types/navigation/group/context.d.ts +8 -0
- package/build-types/navigation/group/context.d.ts.map +1 -0
- package/build-types/navigation/group/index.d.ts +5 -0
- package/build-types/navigation/group/index.d.ts.map +1 -0
- package/build-types/navigation/index.d.ts +46 -0
- package/build-types/navigation/index.d.ts.map +1 -0
- package/build-types/navigation/item/base-content.d.ts +4 -0
- package/build-types/navigation/item/base-content.d.ts.map +1 -0
- package/build-types/navigation/item/base.d.ts +4 -0
- package/build-types/navigation/item/base.d.ts.map +1 -0
- package/build-types/navigation/item/index.d.ts +5 -0
- package/build-types/navigation/item/index.d.ts.map +1 -0
- package/build-types/navigation/item/use-navigation-tree-item.d.ts +3 -0
- package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +1 -0
- package/build-types/navigation/menu/context.d.ts +8 -0
- package/build-types/navigation/menu/context.d.ts.map +1 -0
- package/build-types/navigation/menu/index.d.ts +5 -0
- package/build-types/navigation/menu/index.d.ts.map +1 -0
- package/build-types/navigation/menu/menu-title-search.d.ts +4 -0
- package/build-types/navigation/menu/menu-title-search.d.ts.map +1 -0
- package/build-types/navigation/menu/menu-title.d.ts +4 -0
- package/build-types/navigation/menu/menu-title.d.ts.map +1 -0
- package/build-types/navigation/menu/search-no-results-found.d.ts +4 -0
- package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -0
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +3 -0
- package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +1 -0
- package/build-types/navigation/stories/index.d.ts +18 -0
- package/build-types/navigation/stories/index.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/controlled-state.d.ts +7 -0
- package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/default.d.ts +10 -0
- package/build-types/navigation/stories/utils/default.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/group.d.ts +10 -0
- package/build-types/navigation/stories/utils/group.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts +10 -0
- package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/more-examples.d.ts +10 -0
- package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -0
- package/build-types/navigation/stories/utils/search.d.ts +10 -0
- package/build-types/navigation/stories/utils/search.d.ts.map +1 -0
- package/build-types/navigation/styles/navigation-styles.d.ts +58 -0
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -0
- package/build-types/navigation/test/index.d.ts +2 -0
- package/build-types/navigation/test/index.d.ts.map +1 -0
- package/build-types/navigation/types.d.ts +267 -0
- package/build-types/navigation/types.d.ts.map +1 -0
- package/build-types/navigation/use-create-navigation-tree.d.ts +15 -0
- package/build-types/navigation/use-create-navigation-tree.d.ts.map +1 -0
- package/build-types/navigation/use-navigation-tree-nodes.d.ts +11 -0
- package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +1 -0
- package/build-types/navigation/utils.d.ts +3 -0
- package/build-types/navigation/utils.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -1
- package/build-types/navigator/types.d.ts +12 -12
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/notice/types.d.ts +7 -7
- package/build-types/notice/types.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/types.d.ts +1 -1
- package/build-types/number-control/types.d.ts.map +1 -1
- package/build-types/palette-edit/index.d.ts +37 -0
- package/build-types/palette-edit/index.d.ts.map +1 -0
- package/build-types/palette-edit/stories/index.d.ts +13 -0
- package/build-types/palette-edit/stories/index.d.ts.map +1 -0
- package/build-types/palette-edit/styles.d.ts +51 -0
- package/build-types/palette-edit/styles.d.ts.map +1 -0
- package/build-types/palette-edit/test/index.d.ts +2 -0
- package/build-types/palette-edit/test/index.d.ts.map +1 -0
- package/build-types/palette-edit/types.d.ts +114 -0
- package/build-types/palette-edit/types.d.ts.map +1 -0
- package/build-types/panel/body.d.ts +9 -0
- package/build-types/panel/body.d.ts.map +1 -0
- package/build-types/panel/stories/index.d.ts +19 -0
- package/build-types/panel/stories/index.d.ts.map +1 -0
- package/build-types/panel/test/body.d.ts +2 -0
- package/build-types/panel/test/body.d.ts.map +1 -0
- package/build-types/panel/types.d.ts +73 -3
- package/build-types/panel/types.d.ts.map +1 -1
- package/build-types/placeholder/index.d.ts +1 -1
- package/build-types/placeholder/index.d.ts.map +1 -1
- package/build-types/placeholder/types.d.ts +2 -2
- package/build-types/placeholder/types.d.ts.map +1 -1
- package/build-types/popover/limit-shift.d.ts +2 -2
- package/build-types/popover/limit-shift.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +10 -10
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/popover/utils.d.ts +2 -2
- package/build-types/popover/utils.d.ts.map +1 -1
- package/build-types/query-controls/author-select.d.ts.map +1 -1
- package/build-types/query-controls/category-select.d.ts.map +1 -1
- package/build-types/query-controls/terms.d.ts.map +1 -1
- package/build-types/query-controls/types.d.ts +12 -12
- package/build-types/query-controls/types.d.ts.map +1 -1
- package/build-types/radio-control/types.d.ts +1 -1
- package/build-types/radio-control/types.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts +1 -1
- package/build-types/radio-group/radio/index.d.ts +1 -1
- package/build-types/range-control/index.d.ts +2 -2
- package/build-types/range-control/index.d.ts.map +1 -1
- package/build-types/range-control/types.d.ts +17 -17
- package/build-types/range-control/types.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts +2 -2
- package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
- package/build-types/responsive-wrapper/index.d.ts.map +1 -1
- package/build-types/responsive-wrapper/stories/index.d.ts +10 -0
- package/build-types/responsive-wrapper/stories/index.d.ts.map +1 -1
- package/build-types/responsive-wrapper/types.d.ts +3 -3
- package/build-types/responsive-wrapper/types.d.ts.map +1 -1
- package/build-types/sandbox/types.d.ts +1 -1
- package/build-types/sandbox/types.d.ts.map +1 -1
- package/build-types/scrollable/types.d.ts +2 -2
- package/build-types/scrollable/types.d.ts.map +1 -1
- package/build-types/search-control/types.d.ts +1 -1
- package/build-types/search-control/types.d.ts.map +1 -1
- package/build-types/select-control/index.d.ts +2 -1
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/stories/index.d.ts +3 -3
- package/build-types/select-control/stories/index.d.ts.map +1 -1
- package/build-types/select-control/types.d.ts +44 -20
- package/build-types/select-control/types.d.ts.map +1 -1
- package/build-types/shortcut/types.d.ts +1 -1
- package/build-types/shortcut/types.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
- package/build-types/slot-fill/provider.d.ts +1 -0
- package/build-types/slot-fill/provider.d.ts.map +1 -1
- package/build-types/snackbar/types.d.ts +3 -3
- package/build-types/snackbar/types.d.ts.map +1 -1
- package/build-types/spacer/types.d.ts +1 -1
- package/build-types/spacer/types.d.ts.map +1 -1
- package/build-types/spinner/index.d.ts +1 -1
- package/build-types/style-provider/types.d.ts +1 -1
- package/build-types/style-provider/types.d.ts.map +1 -1
- package/build-types/surface/types.d.ts +2 -2
- package/build-types/surface/types.d.ts.map +1 -1
- package/build-types/tab-panel/types.d.ts +5 -5
- package/build-types/tab-panel/types.d.ts.map +1 -1
- package/build-types/text/types.d.ts +3 -3
- package/build-types/text/types.d.ts.map +1 -1
- package/build-types/text-control/types.d.ts +1 -1
- package/build-types/text-control/types.d.ts.map +1 -1
- package/build-types/text-highlight/types.d.ts +1 -1
- package/build-types/text-highlight/types.d.ts.map +1 -1
- package/build-types/textarea-control/types.d.ts +1 -1
- package/build-types/textarea-control/types.d.ts.map +1 -1
- package/build-types/theme/types.d.ts +3 -3
- package/build-types/theme/types.d.ts.map +1 -1
- package/build-types/tip/types.d.ts +1 -1
- package/build-types/tip/types.d.ts.map +1 -1
- package/build-types/toggle-control/types.d.ts +1 -1
- package/build-types/toggle-control/types.d.ts.map +1 -1
- package/build-types/toggle-group-control/types.d.ts +10 -10
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/toolbar/toolbar/types.d.ts +1 -1
- package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/index.d.ts +165 -11
- package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +6 -1
- package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-button/types.d.ts +45 -0
- package/build-types/toolbar/toolbar-button/types.d.ts.map +1 -0
- package/build-types/toolbar/toolbar-context/index.d.ts +6 -1
- package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
- package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +1 -1
- package/build-types/toolbar/toolbar-item/index.d.ts +1 -1
- package/build-types/tools-panel/types.d.ts +11 -11
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/tree-grid/types.d.ts +5 -5
- package/build-types/tree-grid/types.d.ts.map +1 -1
- package/build-types/tree-select/index.d.ts.map +1 -1
- package/build-types/tree-select/types.d.ts +4 -10
- package/build-types/tree-select/types.d.ts.map +1 -1
- package/build-types/truncate/types.d.ts +2 -2
- package/build-types/truncate/types.d.ts.map +1 -1
- package/build-types/ui/context/context-connect.d.ts +1 -1
- package/build-types/ui/context/context-connect.d.ts.map +1 -1
- package/build-types/ui/context/wordpress-component.d.ts +3 -3
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
- package/build-types/ui/control-group/types.d.ts +2 -2
- package/build-types/ui/control-group/types.d.ts.map +1 -1
- package/build-types/ui/control-label/types.d.ts +1 -1
- package/build-types/ui/control-label/types.d.ts.map +1 -1
- package/build-types/ui/form-group/form-group-content.d.ts +1 -1
- package/build-types/ui/form-group/form-group-help.d.ts +1 -1
- package/build-types/ui/form-group/form-group-label.d.ts +1 -1
- package/build-types/ui/form-group/types.d.ts +5 -5
- package/build-types/ui/form-group/types.d.ts.map +1 -1
- package/build-types/ui/form-group/use-form-group.d.ts +3 -3
- package/build-types/ui/spinner/component.d.ts +1 -1
- package/build-types/ui/tooltip/content.d.ts +1 -1
- package/build-types/ui/tooltip/types.d.ts +2 -2
- package/build-types/ui/tooltip/types.d.ts.map +1 -1
- package/build-types/ui/utils/font-size.d.ts +1 -1
- package/build-types/ui/utils/font-size.d.ts.map +1 -1
- package/build-types/ui/utils/space.d.ts +1 -1
- package/build-types/ui/utils/space.d.ts.map +1 -1
- package/build-types/ui/utils/types.d.ts +4 -4
- package/build-types/ui/utils/types.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +5 -5
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/utils/breakpoint-values.d.ts +1 -1
- package/build-types/utils/colors-values.d.ts +1 -1
- package/build-types/utils/config-values.d.ts +9 -9
- package/build-types/utils/events.d.ts +1 -1
- package/build-types/utils/events.d.ts.map +1 -1
- package/build-types/utils/font-values.d.ts +1 -1
- package/build-types/utils/font.d.ts.map +1 -1
- package/build-types/utils/hooks/use-controlled-value.d.ts +1 -1
- package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
- package/build-types/utils/types.d.ts +4 -4
- package/build-types/utils/types.d.ts.map +1 -1
- package/build-types/v-stack/component.d.ts +1 -4
- package/build-types/v-stack/component.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.d.ts +1 -4
- package/build-types/v-stack/stories/index.d.ts.map +1 -1
- package/build-types/v-stack/types.d.ts +5 -3
- package/build-types/v-stack/types.d.ts.map +1 -1
- package/build-types/view/types.d.ts +1 -1
- package/build-types/view/types.d.ts.map +1 -1
- package/build-types/visually-hidden/types.d.ts +1 -1
- package/build-types/visually-hidden/types.d.ts.map +1 -1
- package/build-types/z-stack/types.d.ts +1 -1
- package/build-types/z-stack/types.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/animate/index.js +3 -1
- package/src/autocomplete/README.md +51 -0
- package/src/autocomplete/{autocompleter-ui.js → autocompleter-ui.tsx} +21 -10
- package/src/autocomplete/{get-default-use-items.js → get-default-use-items.tsx} +11 -6
- package/src/autocomplete/{index.js → index.tsx} +77 -111
- package/src/autocomplete/test/{index.js → index.tsx} +31 -20
- package/src/autocomplete/types.ts +220 -0
- package/src/border-control/test/index.js +0 -2
- package/src/button/style.scss +12 -1
- package/src/button/types.ts +2 -2
- package/src/circular-option-picker/types.ts +1 -1
- package/src/color-palette/test/__snapshots__/index.tsx.snap +16 -14
- package/src/custom-gradient-picker/gradient-bar/control-points.js +2 -0
- package/src/custom-gradient-picker/gradient-bar/index.js +2 -0
- package/src/custom-gradient-picker/gradient-bar/utils.js +2 -0
- package/src/custom-gradient-picker/index.js +2 -0
- package/src/custom-gradient-picker/serializer.js +2 -0
- package/src/custom-gradient-picker/utils.js +2 -0
- package/src/dimension-control/README.md +22 -55
- package/src/dimension-control/index.tsx +101 -0
- package/src/dimension-control/{sizes.js → sizes.ts} +8 -5
- package/src/dimension-control/stories/index.tsx +48 -0
- package/src/dimension-control/types.ts +48 -0
- package/src/flex/flex/hook.ts +2 -2
- package/src/font-size-picker/README.md +26 -20
- package/src/font-size-picker/index.tsx +2 -1
- package/src/font-size-picker/stories/index.tsx +1 -0
- package/src/font-size-picker/test/index.tsx +23 -0
- package/src/font-size-picker/types.ts +4 -0
- package/src/form-token-field/index.tsx +4 -1
- package/src/form-token-field/stories/index.tsx +13 -0
- package/src/form-token-field/test/index.tsx +80 -0
- package/src/gradient-picker/index.js +2 -0
- package/src/guide/README.md +17 -15
- package/src/guide/{icons.js → icons.tsx} +1 -1
- package/src/guide/{index.js → index.tsx} +47 -7
- package/src/guide/{page-control.js → page-control.tsx} +2 -1
- package/src/guide/{page.js → page.tsx} +8 -1
- package/src/guide/stories/{index.js → index.tsx} +11 -5
- package/src/guide/test/{index.js → index.tsx} +22 -4
- package/src/guide/types.ts +68 -0
- package/src/h-stack/README.md +2 -2
- package/src/h-stack/types.ts +2 -2
- package/src/h-stack/utils.ts +3 -3
- package/src/higher-order/navigate-regions/{index.js → index.tsx} +47 -11
- package/src/higher-order/with-fallback-styles/{index.js → index.tsx} +22 -5
- package/src/higher-order/with-filters/{index.js → index.tsx} +44 -12
- package/src/higher-order/with-filters/test/{index.js → index.tsx} +5 -1
- package/src/higher-order/with-focus-return/index.tsx +74 -0
- package/src/higher-order/with-focus-return/test/{index.js → index.tsx} +2 -2
- package/src/higher-order/with-notices/README.md +4 -1
- package/src/higher-order/with-notices/index.tsx +116 -0
- package/src/higher-order/with-notices/test/{index.js → index.tsx} +11 -6
- package/src/higher-order/with-notices/types.ts +35 -0
- package/src/higher-order/with-spoken-messages/test/{index.js → index.tsx} +2 -1
- package/src/icon/index.tsx +11 -15
- package/src/icon/test/{index.js → index.tsx} +6 -2
- package/src/index.native.js +1 -0
- package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +1 -1
- package/src/mobile/bottom-sheet/cell.native.js +1 -1
- package/src/mobile/bottom-sheet-text-control/README.md +8 -1
- package/src/mobile/bottom-sheet-text-control/index.native.js +2 -1
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +1 -1
- package/src/navigation/README.md +16 -2
- package/src/navigation/back-button/{index.js → index.tsx} +22 -6
- package/src/navigation/{context.js → context.tsx} +8 -5
- package/src/navigation/group/context.tsx +15 -0
- package/src/navigation/group/{index.js → index.tsx} +9 -1
- package/src/navigation/{index.js → index.tsx} +63 -7
- package/src/navigation/item/{base-content.js → base-content.tsx} +5 -2
- package/src/navigation/item/{base.js → base.tsx} +3 -1
- package/src/navigation/item/{index.js → index.tsx} +8 -2
- package/src/navigation/item/{use-navigation-tree-item.js → use-navigation-tree-item.tsx} +9 -2
- package/src/navigation/menu/context.tsx +18 -0
- package/src/navigation/menu/{index.js → index.tsx} +5 -1
- package/src/navigation/menu/{menu-title-search.js → menu-title-search.tsx} +11 -7
- package/src/navigation/menu/{menu-title.js → menu-title.tsx} +5 -3
- package/src/navigation/menu/{search-no-results-found.js → search-no-results-found.tsx} +5 -1
- package/src/navigation/menu/{use-navigation-tree-menu.js → use-navigation-tree-menu.tsx} +3 -1
- package/src/navigation/stories/index.tsx +53 -0
- package/src/navigation/stories/utils/{controlled-state.js → controlled-state.tsx} +32 -13
- package/src/navigation/stories/utils/{default.js → default.tsx} +20 -6
- package/src/navigation/stories/utils/{group.js → group.tsx} +21 -7
- package/src/navigation/stories/utils/{hide-if-empty.js → hide-if-empty.tsx} +19 -6
- package/src/navigation/stories/utils/{more-examples.js → more-examples.tsx} +30 -12
- package/src/navigation/stories/utils/{search.js → search.tsx} +21 -7
- package/src/navigation/test/{index.js → index.tsx} +17 -4
- package/src/navigation/types.ts +325 -0
- package/src/navigation/{use-create-navigation-tree.js → use-create-navigation-tree.tsx} +37 -25
- package/src/navigation/{use-navigation-tree-nodes.js → use-navigation-tree-nodes.tsx} +10 -6
- package/src/navigation/{utils.js → utils.tsx} +2 -2
- package/src/navigator/navigator-screen/component.tsx +13 -7
- package/src/navigator/test/index.tsx +65 -22
- package/src/number-control/index.tsx +0 -2
- package/src/palette-edit/{index.js → index.tsx} +115 -48
- package/src/palette-edit/stories/index.tsx +82 -0
- package/src/palette-edit/test/{index.js → index.tsx} +15 -3
- package/src/palette-edit/types.ts +126 -0
- package/src/panel/README.md +53 -35
- package/src/panel/{body.js → body.tsx} +31 -17
- package/src/panel/stories/{index.js → index.tsx} +16 -6
- package/src/panel/test/{body.js → body.tsx} +12 -17
- package/src/panel/types.ts +78 -0
- package/src/placeholder/index.tsx +2 -6
- package/src/placeholder/test/index.tsx +1 -1
- package/src/placeholder/types.ts +2 -2
- package/src/popover/test/index.tsx +5 -2
- package/src/query-controls/author-select.tsx +1 -6
- package/src/query-controls/category-select.tsx +1 -6
- package/src/query-controls/terms.ts +29 -18
- package/src/range-control/index.tsx +2 -6
- package/src/range-control/types.ts +3 -3
- package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -1
- package/src/responsive-wrapper/README.md +8 -2
- package/src/responsive-wrapper/index.tsx +18 -17
- package/src/responsive-wrapper/stories/index.tsx +41 -0
- package/src/responsive-wrapper/style.scss +5 -11
- package/src/responsive-wrapper/types.ts +2 -2
- package/src/select-control/index.tsx +16 -16
- package/src/select-control/stories/index.tsx +24 -12
- package/src/select-control/types.ts +68 -40
- package/src/tab-panel/types.ts +4 -4
- package/src/toolbar/toolbar-button/README.md +13 -1
- package/src/toolbar/toolbar-button/{index.js → index.tsx} +55 -20
- package/src/toolbar/toolbar-button/toolbar-button-container.tsx +13 -0
- package/src/toolbar/toolbar-button/types.ts +46 -0
- package/src/toolbar/toolbar-context/index.ts +15 -0
- package/src/tooltip/index.js +11 -1
- package/src/tree-select/index.tsx +5 -2
- package/src/tree-select/types.ts +6 -13
- package/src/ui/context/get-styled-class-name-from-key.ts +1 -1
- package/src/utils/font.js +1 -6
- package/src/v-stack/README.md +2 -2
- package/src/v-stack/hook.ts +6 -4
- package/src/v-stack/stories/index.tsx +28 -7
- package/src/v-stack/test/__snapshots__/index.tsx.snap +20 -18
- package/src/v-stack/types.ts +5 -3
- package/tsconfig.json +1 -14
- package/tsconfig.tsbuildinfo +1 -1
- package/src/dimension-control/index.js +0 -73
- package/src/higher-order/with-focus-return/index.js +0 -64
- package/src/higher-order/with-notices/index.js +0 -104
- package/src/navigation/group/context.js +0 -9
- package/src/navigation/menu/context.js +0 -11
- package/src/navigation/stories/index.js +0 -33
- package/src/toolbar/toolbar-button/toolbar-button-container.js +0 -6
- package/src/toolbar/toolbar-context/index.js +0 -10
- /package/src/animation/{index.js → index.tsx} +0 -0
- /package/src/higher-order/with-filters/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- /package/src/higher-order/with-spoken-messages/{index.js → index.tsx} +0 -0
- /package/src/navigation/{constants.js → constants.tsx} +0 -0
- /package/src/navigation/styles/{navigation-styles.js → navigation-styles.tsx} +0 -0
- /package/src/panel/test/__snapshots__/{body.js.snap → body.tsx.snap} +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { IconType } from '../icon';
|
|
5
|
+
|
|
6
|
+
export type Size = {
|
|
7
|
+
/**
|
|
8
|
+
* Human-readable name of the size.
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* Short unique identifying name of the size.
|
|
13
|
+
*/
|
|
14
|
+
slug: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type DimensionControlProps = {
|
|
18
|
+
/**
|
|
19
|
+
* Label for the control.
|
|
20
|
+
*/
|
|
21
|
+
label: string;
|
|
22
|
+
/**
|
|
23
|
+
* An array of sizes to choose from.
|
|
24
|
+
*
|
|
25
|
+
* @default DEFAULT_SIZES
|
|
26
|
+
*
|
|
27
|
+
* @see packages/components/src/dimension-control/sizes.ts
|
|
28
|
+
*/
|
|
29
|
+
sizes?: Size[];
|
|
30
|
+
/**
|
|
31
|
+
* Optional icon rendered in front on the label.
|
|
32
|
+
*/
|
|
33
|
+
icon?: IconType;
|
|
34
|
+
/**
|
|
35
|
+
* Used to externally control the current value of the control.
|
|
36
|
+
*/
|
|
37
|
+
value?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Function called with the control's internal state changes. The `value` property is equal to a given size slug.
|
|
40
|
+
*/
|
|
41
|
+
onChange?: ( value?: string ) => void;
|
|
42
|
+
/**
|
|
43
|
+
* CSS class applied to `SelectControl`.
|
|
44
|
+
*
|
|
45
|
+
* @default ''
|
|
46
|
+
*/
|
|
47
|
+
className?: string;
|
|
48
|
+
};
|
package/src/flex/flex/hook.ts
CHANGED
|
@@ -40,7 +40,7 @@ function useDeprecatedProps(
|
|
|
40
40
|
|
|
41
41
|
export function useFlex( props: WordPressComponentProps< FlexProps, 'div' > ) {
|
|
42
42
|
const {
|
|
43
|
-
align
|
|
43
|
+
align,
|
|
44
44
|
className,
|
|
45
45
|
direction: directionProp = 'row',
|
|
46
46
|
expanded = true,
|
|
@@ -62,7 +62,7 @@ export function useFlex( props: WordPressComponentProps< FlexProps, 'div' > ) {
|
|
|
62
62
|
|
|
63
63
|
const classes = useMemo( () => {
|
|
64
64
|
const base = css( {
|
|
65
|
-
alignItems: isColumn ? 'normal' :
|
|
65
|
+
alignItems: align ?? ( isColumn ? 'normal' : 'center' ),
|
|
66
66
|
flexDirection: direction,
|
|
67
67
|
flexWrap: wrap ? 'wrap' : undefined,
|
|
68
68
|
gap: space( gap ),
|
|
@@ -49,22 +49,20 @@ const MyFontSizePicker = () => {
|
|
|
49
49
|
|
|
50
50
|
The component accepts the following props:
|
|
51
51
|
|
|
52
|
-
### disableCustomFontSizes
|
|
52
|
+
### `disableCustomFontSizes`: `boolean`
|
|
53
53
|
|
|
54
54
|
If `true`, it will not be possible to choose a custom fontSize. The user will be forced to pick one of the pre-defined sizes passed in fontSizes.
|
|
55
55
|
|
|
56
|
-
- Type: `Boolean`
|
|
57
56
|
- Required: no
|
|
58
57
|
- Default: `false`
|
|
59
58
|
|
|
60
|
-
### fallbackFontSize
|
|
59
|
+
### `fallbackFontSize`: `number`
|
|
61
60
|
|
|
62
61
|
If no value exists, this prop defines the starting position for the font size picker slider. Only relevant if `withSlider` is `true`.
|
|
63
62
|
|
|
64
|
-
- Type: `Number`
|
|
65
63
|
- Required: No
|
|
66
64
|
|
|
67
|
-
### fontSizes
|
|
65
|
+
### `fontSizes`: `FontSize[]`
|
|
68
66
|
|
|
69
67
|
An array of font size objects. The object should contain properties size, name, and slug.
|
|
70
68
|
The property `size` contains a number with the font size value, in `px` or a string specifying the font size CSS property that should be used eg: "13px", "1em", or "clamp(12px, 5vw, 100px)".
|
|
@@ -73,44 +71,52 @@ The `slug` property is a string with a unique identifier for the font size. Used
|
|
|
73
71
|
|
|
74
72
|
**Note:** The slugs `default` and `custom` are reserved and cannot be used.
|
|
75
73
|
|
|
76
|
-
- Type: `Array`
|
|
77
74
|
- Required: No
|
|
75
|
+
- Default: `[]`
|
|
78
76
|
|
|
79
|
-
### onChange
|
|
77
|
+
### `onChange`: `( value: number | string | undefined, selectedItem?: FontSize ) => void`
|
|
80
78
|
|
|
81
79
|
A function that receives the new font size value.
|
|
82
80
|
If onChange is called without any parameter, it should reset the value, attending to what reset means in that context, e.g., set the font size to undefined or set the font size a starting value.
|
|
83
81
|
|
|
84
|
-
- Type: `function`
|
|
85
82
|
- Required: Yes
|
|
86
83
|
|
|
87
|
-
###
|
|
84
|
+
### `size`: `'default' | '__unstable-large'`
|
|
88
85
|
|
|
89
|
-
|
|
86
|
+
Size of the control.
|
|
90
87
|
|
|
91
|
-
- Type: `Number | String`
|
|
92
88
|
- Required: No
|
|
89
|
+
- Default: `'default'`
|
|
93
90
|
|
|
94
|
-
###
|
|
91
|
+
### `units`: `string[]`
|
|
95
92
|
|
|
96
|
-
|
|
93
|
+
Available units for custom font size selection.
|
|
97
94
|
|
|
98
|
-
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
- Required: No
|
|
96
|
+
|
|
97
|
+
### `value`: `number | string`
|
|
98
|
+
|
|
99
|
+
The current font size value.
|
|
101
100
|
|
|
102
|
-
|
|
101
|
+
- Required: No
|
|
102
|
+
|
|
103
|
+
### `withReset`: `boolean`
|
|
103
104
|
|
|
104
105
|
If `true`, a reset button will be displayed alongside the input field when a custom font size is active. Has no effect when `disableCustomFontSizes` is `true`.
|
|
105
106
|
|
|
106
|
-
- Type: `Boolean`
|
|
107
107
|
- Required: no
|
|
108
108
|
- Default: `true`
|
|
109
109
|
|
|
110
|
-
###
|
|
110
|
+
### `withSlider`: `boolean`
|
|
111
|
+
|
|
112
|
+
If `true`, a slider will be displayed alongside the input field when a custom font size is active. Has no effect when `disableCustomFontSizes` is `true`.
|
|
113
|
+
|
|
114
|
+
- Required: no
|
|
115
|
+
- Default: `false`
|
|
116
|
+
|
|
117
|
+
### `__nextHasNoMarginBottom`: `boolean`
|
|
111
118
|
|
|
112
119
|
Start opting into the new margin-free styles that will become the default in a future version, currently scheduled to be WordPress 6.4. (The prop can be safely removed once this happens.)
|
|
113
120
|
|
|
114
|
-
- Type: `Boolean`
|
|
115
121
|
- Required: no
|
|
116
122
|
- Default: `false`
|
|
@@ -50,6 +50,7 @@ const UnforwardedFontSizePicker = (
|
|
|
50
50
|
disableCustomFontSizes = false,
|
|
51
51
|
onChange,
|
|
52
52
|
size = 'default',
|
|
53
|
+
units: unitsProp,
|
|
53
54
|
value,
|
|
54
55
|
withSlider = false,
|
|
55
56
|
withReset = true,
|
|
@@ -64,7 +65,7 @@ const UnforwardedFontSizePicker = (
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
const units = useCustomUnits( {
|
|
67
|
-
availableUnits: [ 'px', 'em', 'rem' ],
|
|
68
|
+
availableUnits: unitsProp || [ 'px', 'em', 'rem' ],
|
|
68
69
|
} );
|
|
69
70
|
|
|
70
71
|
const shouldUseSelectControl = fontSizes.length > 5;
|
|
@@ -699,5 +699,28 @@ describe( 'FontSizePicker', () => {
|
|
|
699
699
|
screen.queryByRole( 'button', { name: 'Reset' } )
|
|
700
700
|
).not.toBeInTheDocument();
|
|
701
701
|
} );
|
|
702
|
+
|
|
703
|
+
it( 'applies custom units to custom font size control', async () => {
|
|
704
|
+
const user = userEvent.setup();
|
|
705
|
+
|
|
706
|
+
render(
|
|
707
|
+
<FontSizePicker
|
|
708
|
+
__nextHasNoMarginBottom
|
|
709
|
+
fontSizes={ fontSizes }
|
|
710
|
+
value={ fontSizes[ 0 ].size }
|
|
711
|
+
units={ [ 'px', 'ch', 'ex' ] }
|
|
712
|
+
/>
|
|
713
|
+
);
|
|
714
|
+
|
|
715
|
+
await user.click(
|
|
716
|
+
screen.getByRole( 'button', { name: 'Set custom size' } )
|
|
717
|
+
);
|
|
718
|
+
|
|
719
|
+
const units = screen.getAllByRole( 'option' );
|
|
720
|
+
expect( units ).toHaveLength( 3 );
|
|
721
|
+
expect( units[ 0 ] ).toHaveAccessibleName( 'px' );
|
|
722
|
+
expect( units[ 1 ] ).toHaveAccessibleName( 'ch' );
|
|
723
|
+
expect( units[ 2 ] ).toHaveAccessibleName( 'ex' );
|
|
724
|
+
} );
|
|
702
725
|
}
|
|
703
726
|
} );
|
|
@@ -153,7 +153,10 @@ export function FormTokenField( props: FormTokenFieldProps ) {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
function onBlur() {
|
|
156
|
-
if (
|
|
156
|
+
if (
|
|
157
|
+
inputHasValidValue() &&
|
|
158
|
+
__experimentalValidateInput( incompleteTokenValue )
|
|
159
|
+
) {
|
|
157
160
|
setIsActive( false );
|
|
158
161
|
} else {
|
|
159
162
|
// Reset to initial state
|
|
@@ -123,3 +123,16 @@ WithCustomRenderItem.args = {
|
|
|
123
123
|
<div>{ `${ item } — a nice place to visit` }</div>
|
|
124
124
|
),
|
|
125
125
|
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Only values for which the `__experimentalValidateInput` function returns
|
|
129
|
+
* `true` will be tokenized. (This is still an experimental feature and is
|
|
130
|
+
* subject to change.)
|
|
131
|
+
*/
|
|
132
|
+
export const WithValidatedInput: ComponentStory< typeof FormTokenField > =
|
|
133
|
+
DefaultTemplate.bind( {} );
|
|
134
|
+
WithValidatedInput.args = {
|
|
135
|
+
...Default.args,
|
|
136
|
+
__experimentalValidateInput: ( input: string ) =>
|
|
137
|
+
continents.includes( input ),
|
|
138
|
+
};
|
|
@@ -950,6 +950,86 @@ describe( 'FormTokenField', () => {
|
|
|
950
950
|
expect( onChangeSpy ).not.toHaveBeenCalled();
|
|
951
951
|
} );
|
|
952
952
|
|
|
953
|
+
it( 'should hide the suggestion list on an empty input', async () => {
|
|
954
|
+
const user = userEvent.setup();
|
|
955
|
+
|
|
956
|
+
const suggestions = [ 'One', 'Two', 'Three' ];
|
|
957
|
+
|
|
958
|
+
render( <FormTokenFieldWithState suggestions={ suggestions } /> );
|
|
959
|
+
|
|
960
|
+
const input = screen.getByRole( 'combobox' );
|
|
961
|
+
|
|
962
|
+
await user.type( input, 'on' );
|
|
963
|
+
|
|
964
|
+
expectVisibleSuggestionsToBe( screen.getByRole( 'listbox' ), [
|
|
965
|
+
'One',
|
|
966
|
+
] );
|
|
967
|
+
|
|
968
|
+
expect( screen.getByRole( 'listbox' ) ).toBeVisible();
|
|
969
|
+
|
|
970
|
+
await user.clear( input );
|
|
971
|
+
|
|
972
|
+
expect( screen.queryByRole( 'listbox' ) ).not.toBeInTheDocument();
|
|
973
|
+
} );
|
|
974
|
+
|
|
975
|
+
it( 'should hide the suggestion list on blur and invalid input', async () => {
|
|
976
|
+
const user = userEvent.setup();
|
|
977
|
+
|
|
978
|
+
const suggestions = [ 'One', 'Two', 'Three' ];
|
|
979
|
+
|
|
980
|
+
render(
|
|
981
|
+
<FormTokenFieldWithState
|
|
982
|
+
suggestions={ suggestions }
|
|
983
|
+
__experimentalValidateInput={ ( token ) =>
|
|
984
|
+
suggestions.includes( token )
|
|
985
|
+
}
|
|
986
|
+
/>
|
|
987
|
+
);
|
|
988
|
+
|
|
989
|
+
const input = screen.getByRole( 'combobox' );
|
|
990
|
+
|
|
991
|
+
await user.type( input, 'on' );
|
|
992
|
+
|
|
993
|
+
expectVisibleSuggestionsToBe( screen.getByRole( 'listbox' ), [
|
|
994
|
+
'One',
|
|
995
|
+
] );
|
|
996
|
+
|
|
997
|
+
expect( screen.getByRole( 'listbox' ) ).toBeVisible();
|
|
998
|
+
|
|
999
|
+
await user.click( document.body );
|
|
1000
|
+
|
|
1001
|
+
expect( screen.queryByRole( 'listbox' ) ).not.toBeInTheDocument();
|
|
1002
|
+
} );
|
|
1003
|
+
|
|
1004
|
+
it( 'should not hide the suggestion list on blur and valid input', async () => {
|
|
1005
|
+
const user = userEvent.setup();
|
|
1006
|
+
|
|
1007
|
+
const suggestions = [ 'One', 'Two', 'Three' ];
|
|
1008
|
+
|
|
1009
|
+
render(
|
|
1010
|
+
<FormTokenFieldWithState
|
|
1011
|
+
suggestions={ suggestions }
|
|
1012
|
+
__experimentalValidateInput={ ( token ) =>
|
|
1013
|
+
suggestions.includes( token )
|
|
1014
|
+
}
|
|
1015
|
+
/>
|
|
1016
|
+
);
|
|
1017
|
+
|
|
1018
|
+
const input = screen.getByRole( 'combobox' );
|
|
1019
|
+
|
|
1020
|
+
await user.type( input, 'One' );
|
|
1021
|
+
|
|
1022
|
+
expectVisibleSuggestionsToBe( screen.getByRole( 'listbox' ), [
|
|
1023
|
+
'One',
|
|
1024
|
+
] );
|
|
1025
|
+
|
|
1026
|
+
expect( screen.getByRole( 'listbox' ) ).toBeVisible();
|
|
1027
|
+
|
|
1028
|
+
await user.click( document.body );
|
|
1029
|
+
|
|
1030
|
+
expect( screen.getByRole( 'listbox' ) ).toBeVisible();
|
|
1031
|
+
} );
|
|
1032
|
+
|
|
953
1033
|
it( 'matches the search text with the suggestions in a case-insensitive way', async () => {
|
|
954
1034
|
const user = userEvent.setup();
|
|
955
1035
|
|
package/src/guide/README.md
CHANGED
|
@@ -37,20 +37,6 @@ function MyTutorial() {
|
|
|
37
37
|
|
|
38
38
|
The component accepts the following props:
|
|
39
39
|
|
|
40
|
-
### onFinish
|
|
41
|
-
|
|
42
|
-
A function which is called when the guide is finished. The guide is finished when the modal is closed or when the user clicks _Finish_ on the last page of the guide.
|
|
43
|
-
|
|
44
|
-
- Type: `function`
|
|
45
|
-
- Required: Yes
|
|
46
|
-
|
|
47
|
-
### pages
|
|
48
|
-
|
|
49
|
-
A list of objects describing each page in the guide. Each object **must** contain a `'content'` property and may optionally contain a `'image'` property.
|
|
50
|
-
|
|
51
|
-
- Type: `array`
|
|
52
|
-
- Required: Yes
|
|
53
|
-
|
|
54
40
|
### className
|
|
55
41
|
|
|
56
42
|
A custom class to add to the modal.
|
|
@@ -62,7 +48,7 @@ A custom class to add to the modal.
|
|
|
62
48
|
|
|
63
49
|
This property is used as the modal's accessibility label. It is required for accessibility reasons.
|
|
64
50
|
|
|
65
|
-
- Type: `
|
|
51
|
+
- Type: `string`
|
|
66
52
|
- Required: Yes
|
|
67
53
|
|
|
68
54
|
### finishButtonText
|
|
@@ -71,3 +57,19 @@ Use this to customize the label of the _Finish_ button shown at the end of the g
|
|
|
71
57
|
|
|
72
58
|
- Type: `string`
|
|
73
59
|
- Required: No
|
|
60
|
+
- Default: `'Finish'`
|
|
61
|
+
|
|
62
|
+
### onFinish
|
|
63
|
+
|
|
64
|
+
A function which is called when the guide is finished. The guide is finished when the modal is closed or when the user clicks _Finish_ on the last page of the guide.
|
|
65
|
+
|
|
66
|
+
- Type: `( event?: KeyboardEvent< HTMLDivElement > | SyntheticEvent ) => void`
|
|
67
|
+
- Required: Yes
|
|
68
|
+
|
|
69
|
+
### pages
|
|
70
|
+
|
|
71
|
+
A list of objects describing each page in the guide. Each object **must** contain a `'content'` property and may optionally contain a `'image'` property.
|
|
72
|
+
|
|
73
|
+
- Type: `{ content: ReactNode; image?: ReactNode; }[]`
|
|
74
|
+
- Required: No
|
|
75
|
+
- Default: `[]`
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { SVG, Circle } from '@wordpress/primitives';
|
|
5
5
|
|
|
6
|
-
export const PageControlIcon = ( { isSelected } ) => (
|
|
6
|
+
export const PageControlIcon = ( { isSelected }: { isSelected: boolean } ) => (
|
|
7
7
|
<SVG width="8" height="8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8
8
|
<Circle
|
|
9
9
|
cx="4"
|
|
@@ -17,16 +17,49 @@ import { focus } from '@wordpress/dom';
|
|
|
17
17
|
import Modal from '../modal';
|
|
18
18
|
import Button from '../button';
|
|
19
19
|
import PageControl from './page-control';
|
|
20
|
+
import type { GuideProps } from './types';
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* `Guide` is a React component that renders a _user guide_ in a modal. The guide consists of several pages which the user can step through one by one. The guide is finished when the modal is closed or when the user clicks _Finish_ on the last page of the guide.
|
|
24
|
+
*
|
|
25
|
+
* ```jsx
|
|
26
|
+
* function MyTutorial() {
|
|
27
|
+
* const [ isOpen, setIsOpen ] = useState( true );
|
|
28
|
+
*
|
|
29
|
+
* if ( ! isOpen ) {
|
|
30
|
+
* return null;
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
* return (
|
|
34
|
+
* <Guide
|
|
35
|
+
* onFinish={ () => setIsOpen( false ) }
|
|
36
|
+
* pages={ [
|
|
37
|
+
* {
|
|
38
|
+
* content: <p>Welcome to the ACME Store!</p>,
|
|
39
|
+
* },
|
|
40
|
+
* {
|
|
41
|
+
* image: <img src="https://acmestore.com/add-to-cart.png" />,
|
|
42
|
+
* content: (
|
|
43
|
+
* <p>
|
|
44
|
+
* Click <i>Add to Cart</i> to buy a product.
|
|
45
|
+
* </p>
|
|
46
|
+
* ),
|
|
47
|
+
* },
|
|
48
|
+
* ] }
|
|
49
|
+
* />
|
|
50
|
+
* );
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
function Guide( {
|
|
22
55
|
children,
|
|
23
56
|
className,
|
|
24
57
|
contentLabel,
|
|
25
|
-
finishButtonText,
|
|
58
|
+
finishButtonText = __( 'Finish' ),
|
|
26
59
|
onFinish,
|
|
27
60
|
pages = [],
|
|
28
|
-
} ) {
|
|
29
|
-
const guideContainer = useRef();
|
|
61
|
+
}: GuideProps ) {
|
|
62
|
+
const guideContainer = useRef< HTMLDivElement >( null );
|
|
30
63
|
const [ currentPage, setCurrentPage ] = useState( 0 );
|
|
31
64
|
|
|
32
65
|
useEffect( () => {
|
|
@@ -42,12 +75,17 @@ export default function Guide( {
|
|
|
42
75
|
// Each time we change the current page, start from the first element of the page.
|
|
43
76
|
// This also solves any focus loss that can happen.
|
|
44
77
|
if ( guideContainer.current ) {
|
|
45
|
-
|
|
78
|
+
(
|
|
79
|
+
focus.tabbable.find( guideContainer.current ) as HTMLElement[]
|
|
80
|
+
)[ 0 ]?.focus();
|
|
46
81
|
}
|
|
47
82
|
}, [ currentPage ] );
|
|
48
83
|
|
|
49
84
|
if ( Children.count( children ) ) {
|
|
50
|
-
pages =
|
|
85
|
+
pages =
|
|
86
|
+
Children.map( children, ( child ) => ( {
|
|
87
|
+
content: child,
|
|
88
|
+
} ) ) ?? [];
|
|
51
89
|
}
|
|
52
90
|
|
|
53
91
|
const canGoBack = currentPage > 0;
|
|
@@ -124,7 +162,7 @@ export default function Guide( {
|
|
|
124
162
|
className="components-guide__finish-button"
|
|
125
163
|
onClick={ onFinish }
|
|
126
164
|
>
|
|
127
|
-
{ finishButtonText
|
|
165
|
+
{ finishButtonText }
|
|
128
166
|
</Button>
|
|
129
167
|
) }
|
|
130
168
|
</div>
|
|
@@ -132,3 +170,5 @@ export default function Guide( {
|
|
|
132
170
|
</Modal>
|
|
133
171
|
);
|
|
134
172
|
}
|
|
173
|
+
|
|
174
|
+
export default Guide;
|
|
@@ -8,12 +8,13 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
8
8
|
*/
|
|
9
9
|
import Button from '../button';
|
|
10
10
|
import { PageControlIcon } from './icons';
|
|
11
|
+
import type { PageControlProps } from './types';
|
|
11
12
|
|
|
12
13
|
export default function PageControl( {
|
|
13
14
|
currentPage,
|
|
14
15
|
numberOfPages,
|
|
15
16
|
setCurrentPage,
|
|
16
|
-
} ) {
|
|
17
|
+
}: PageControlProps ) {
|
|
17
18
|
return (
|
|
18
19
|
<ul
|
|
19
20
|
className="components-guide__page-control"
|
|
@@ -4,7 +4,14 @@
|
|
|
4
4
|
import { useEffect } from '@wordpress/element';
|
|
5
5
|
import deprecated from '@wordpress/deprecated';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import type { WordPressComponentProps } from '../ui/context';
|
|
11
|
+
|
|
12
|
+
export default function GuidePage(
|
|
13
|
+
props: WordPressComponentProps< {}, 'div', false >
|
|
14
|
+
) {
|
|
8
15
|
useEffect( () => {
|
|
9
16
|
deprecated( '<GuidePage>', {
|
|
10
17
|
since: '5.5',
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -7,9 +12,9 @@ import { useState } from '@wordpress/element';
|
|
|
7
12
|
* Internal dependencies
|
|
8
13
|
*/
|
|
9
14
|
import Button from '../../button';
|
|
10
|
-
import Guide from '
|
|
15
|
+
import Guide from '..';
|
|
11
16
|
|
|
12
|
-
|
|
17
|
+
const meta: ComponentMeta< typeof Guide > = {
|
|
13
18
|
title: 'Components/Guide',
|
|
14
19
|
component: Guide,
|
|
15
20
|
argTypes: {
|
|
@@ -18,8 +23,9 @@ export default {
|
|
|
18
23
|
onFinish: { action: 'onFinish' },
|
|
19
24
|
},
|
|
20
25
|
};
|
|
26
|
+
export default meta;
|
|
21
27
|
|
|
22
|
-
const Template = ( { onFinish, ...props } ) => {
|
|
28
|
+
const Template: ComponentStory< typeof Guide > = ( { onFinish, ...props } ) => {
|
|
23
29
|
const [ isOpen, setOpen ] = useState( false );
|
|
24
30
|
|
|
25
31
|
const openGuide = () => setOpen( true );
|
|
@@ -34,8 +40,8 @@ const Template = ( { onFinish, ...props } ) => {
|
|
|
34
40
|
<Guide
|
|
35
41
|
{ ...props }
|
|
36
42
|
onFinish={ ( ...finishArgs ) => {
|
|
37
|
-
closeGuide(
|
|
38
|
-
onFinish( ...finishArgs );
|
|
43
|
+
closeGuide();
|
|
44
|
+
onFinish?.( ...finishArgs );
|
|
39
45
|
} }
|
|
40
46
|
/>
|
|
41
47
|
) }
|
|
@@ -7,17 +7,23 @@ import userEvent from '@testing-library/user-event';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import Guide from '
|
|
10
|
+
import Guide from '..';
|
|
11
|
+
|
|
12
|
+
const defaultProps = {
|
|
13
|
+
onFinish: () => {},
|
|
14
|
+
contentLabel: 'Arbitrary Content Label',
|
|
15
|
+
};
|
|
11
16
|
|
|
12
17
|
describe( 'Guide', () => {
|
|
13
18
|
it( 'renders nothing when there are no pages', () => {
|
|
14
|
-
render( <Guide pages={ [] } /> );
|
|
19
|
+
render( <Guide { ...defaultProps } pages={ [] } /> );
|
|
15
20
|
expect( screen.queryByRole( 'dialog' ) ).not.toBeInTheDocument();
|
|
16
21
|
} );
|
|
17
22
|
|
|
18
23
|
it( 'renders one page at a time', () => {
|
|
19
24
|
render(
|
|
20
25
|
<Guide
|
|
26
|
+
{ ...defaultProps }
|
|
21
27
|
pages={ [
|
|
22
28
|
{ content: <p>Page 1</p> },
|
|
23
29
|
{ content: <p>Page 2</p> },
|
|
@@ -33,6 +39,7 @@ describe( 'Guide', () => {
|
|
|
33
39
|
it( 'hides back button and shows forward button on the first page', () => {
|
|
34
40
|
render(
|
|
35
41
|
<Guide
|
|
42
|
+
{ ...defaultProps }
|
|
36
43
|
pages={ [
|
|
37
44
|
{ content: <p>Page 1</p> },
|
|
38
45
|
{ content: <p>Page 2</p> },
|
|
@@ -55,6 +62,7 @@ describe( 'Guide', () => {
|
|
|
55
62
|
const user = userEvent.setup();
|
|
56
63
|
render(
|
|
57
64
|
<Guide
|
|
65
|
+
{ ...defaultProps }
|
|
58
66
|
pages={ [
|
|
59
67
|
{ content: <p>Page 1</p> },
|
|
60
68
|
{ content: <p>Page 2</p> },
|
|
@@ -78,7 +86,12 @@ describe( 'Guide', () => {
|
|
|
78
86
|
} );
|
|
79
87
|
|
|
80
88
|
it( "doesn't display the page control if there is only one page", () => {
|
|
81
|
-
render(
|
|
89
|
+
render(
|
|
90
|
+
<Guide
|
|
91
|
+
{ ...defaultProps }
|
|
92
|
+
pages={ [ { content: <p>Page 1</p> } ] }
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
82
95
|
expect(
|
|
83
96
|
screen.queryByRole( 'list', { name: 'Guide controls' } )
|
|
84
97
|
).not.toBeInTheDocument();
|
|
@@ -89,6 +102,7 @@ describe( 'Guide', () => {
|
|
|
89
102
|
const onFinish = jest.fn();
|
|
90
103
|
render(
|
|
91
104
|
<Guide
|
|
105
|
+
{ ...defaultProps }
|
|
92
106
|
onFinish={ onFinish }
|
|
93
107
|
pages={ [ { content: <p>Page 1</p> } ] }
|
|
94
108
|
/>
|
|
@@ -103,6 +117,7 @@ describe( 'Guide', () => {
|
|
|
103
117
|
const onFinish = jest.fn();
|
|
104
118
|
render(
|
|
105
119
|
<Guide
|
|
120
|
+
{ ...defaultProps }
|
|
106
121
|
onFinish={ onFinish }
|
|
107
122
|
pages={ [ { content: <p>Page 1</p> } ] }
|
|
108
123
|
/>
|
|
@@ -115,7 +130,7 @@ describe( 'Guide', () => {
|
|
|
115
130
|
|
|
116
131
|
describe( 'page navigation', () => {
|
|
117
132
|
it( 'renders an empty list when there are no pages', () => {
|
|
118
|
-
render( <Guide pages={ [] } /> );
|
|
133
|
+
render( <Guide { ...defaultProps } pages={ [] } /> );
|
|
119
134
|
expect(
|
|
120
135
|
screen.queryByRole( 'list', {
|
|
121
136
|
name: 'Guide controls',
|
|
@@ -131,6 +146,7 @@ describe( 'Guide', () => {
|
|
|
131
146
|
it( 'renders a button for each page', () => {
|
|
132
147
|
render(
|
|
133
148
|
<Guide
|
|
149
|
+
{ ...defaultProps }
|
|
134
150
|
pages={ [
|
|
135
151
|
{ content: <p>Page 1</p> },
|
|
136
152
|
{ content: <p>Page 2</p> },
|
|
@@ -154,6 +170,7 @@ describe( 'Guide', () => {
|
|
|
154
170
|
|
|
155
171
|
render(
|
|
156
172
|
<Guide
|
|
173
|
+
{ ...defaultProps }
|
|
157
174
|
pages={ [
|
|
158
175
|
{ content: <p>Page 1</p> },
|
|
159
176
|
{ content: <p>Page 2</p> },
|
|
@@ -196,6 +213,7 @@ describe( 'Guide', () => {
|
|
|
196
213
|
|
|
197
214
|
render(
|
|
198
215
|
<Guide
|
|
216
|
+
{ ...defaultProps }
|
|
199
217
|
pages={ [
|
|
200
218
|
{ content: <p>Page 1</p> },
|
|
201
219
|
{ content: <p>Page 2</p> },
|