@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
|
@@ -26,7 +26,7 @@ const Root = (0, _base.default)("div", process.env.NODE_ENV === "production" ? {
|
|
|
26
26
|
} : {
|
|
27
27
|
name: "1cd7zoc",
|
|
28
28
|
styles: "bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0",
|
|
29
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
29
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVc4QiIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3Jlc2l6YWJsZS1ib3gvcmVzaXplLXRvb2x0aXAvc3R5bGVzL3Jlc2l6ZS10b29sdGlwLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0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dERhcmsgfTtcblx0cGFkZGluZzogNHB4IDhweDtcblx0cG9zaXRpb246IHJlbGF0aXZlO1xuYDtcblxuLy8gVE9ETzogUmVzb2x2ZSBuZWVkIHRvIHVzZSAmJiYgdG8gaW5jcmVhc2Ugc3BlY2lmaWNpdHlcbi8vIGh0dHBzOi8vZ2l0aHViLmNvbS9Xb3JkUHJlc3MvZ3V0ZW5iZXJnL2lzc3Vlcy8xODQ4M1xuXG5leHBvcnQgY29uc3QgTGFiZWxUZXh0ID0gc3R5bGVkKCBUZXh0IClgXG5cdCYmJiB7XG5cdFx0Y29sb3I6ICR7IENPTE9SUy51aS50ZXh0RGFyayB9O1xuXHRcdGRpc3BsYXk6IGJsb2NrO1xuXHRcdGZvbnQtc2l6ZTogMTNweDtcblx0XHRsaW5lLWhlaWdodDogMS40O1xuXHRcdHdoaXRlLXNwYWNlOiBub3dyYXA7XG5cdH1cbmA7XG4iXX0= */",
|
|
30
30
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
31
31
|
});
|
|
32
32
|
exports.Root = Root;
|
|
@@ -41,7 +41,7 @@ const TooltipWrapper = (0, _base.default)("div", process.env.NODE_ENV === "produ
|
|
|
41
41
|
} : {
|
|
42
42
|
name: "ajymcs",
|
|
43
43
|
styles: "align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear",
|
|
44
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
44
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFCd0MiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnR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mYW1pbHk6ICR7IGZvbnQoICdkZWZhdWx0LmZvbnRGYW1pbHknICkgfTtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */",
|
|
45
45
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
46
46
|
});
|
|
47
47
|
exports.TooltipWrapper = TooltipWrapper;
|
|
@@ -50,7 +50,7 @@ const Tooltip = (0, _base.default)("div", process.env.NODE_ENV === "production"
|
|
|
50
50
|
} : {
|
|
51
51
|
target: "e1wq7y4k1",
|
|
52
52
|
label: "Tooltip"
|
|
53
|
-
})("background:", _utils.COLORS.gray[900], ";border-radius:2px;box-sizing:border-box;font-size:12px;color:", _utils.COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
53
|
+
})("background:", _utils.COLORS.gray[900], ";border-radius:2px;box-sizing:border-box;font-family:", (0, _utils.font)('default.fontFamily'), ";font-size:12px;color:", _utils.COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStCaUMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi8uLi8uLi90ZXh0JztcbmltcG9ydCB7IGZvbnQsIENPTE9SUyB9IGZyb20gJy4uLy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IFJvb3QgPSBzdHlsZWQuZGl2YFxuXHRib3R0b206IDA7XG5cdGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cdGxlZnQ6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHJpZ2h0OiAwO1xuXHR0b3A6IDA7XG5gO1xuXG5leHBvcnQgY29uc3QgVG9vbHRpcFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRib3gtc2l6aW5nOiBib3JkZXItYm94O1xuXHRkaXNwbGF5OiBpbmxpbmUtZmxleDtcblx0anVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG5cdG9wYWNpdHk6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHR0cmFuc2l0aW9uOiBvcGFjaXR5IDEyMG1zIGxpbmVhcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1mYW1pbHk6ICR7IGZvbnQoICdkZWZhdWx0LmZvbnRGYW1pbHknICkgfTtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */")); // TODO: Resolve need to use &&& to increase specificity
|
|
54
54
|
// https://github.com/WordPress/gutenberg/issues/18483
|
|
55
55
|
|
|
56
56
|
exports.Tooltip = Tooltip;
|
|
@@ -59,6 +59,6 @@ const LabelText = ( /*#__PURE__*/0, _base.default)(_text.Text, process.env.NODE_
|
|
|
59
59
|
} : {
|
|
60
60
|
target: "e1wq7y4k0",
|
|
61
61
|
label: "LabelText"
|
|
62
|
-
})("&&&{color:", _utils.COLORS.ui.textDark, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
62
|
+
})("&&&{color:", _utils.COLORS.ui.textDark, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTZDdUMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi8uLi8uLi90ZXh0JztcbmltcG9ydCB7IGZvbnQsIENPTE9SUyB9IGZyb20gJy4uLy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IFJvb3QgPSBzdHlsZWQuZGl2YFxuXHRib3R0b206IDA7XG5cdGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cdGxlZnQ6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHRwb3NpdGl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Q6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */"));
|
|
63
63
|
exports.LabelText = LabelText;
|
|
64
64
|
//# sourceMappingURL=resize-tooltip.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts"],"names":["Root","TooltipWrapper","Tooltip","COLORS","gray","ui","textDark","LabelText","Text"],"mappings":";;;;;;;;;;;AAQA;;AACA;;;;AAEO,MAAMA,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAV;;AAUA,MAAMC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAApB;;AAUA,MAAMC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,kBACJC,cAAOC,IAAP,CAAa,GAAb,CADI,
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts"],"names":["Root","TooltipWrapper","Tooltip","COLORS","gray","ui","textDark","LabelText","Text"],"mappings":";;;;;;;;;;;AAQA;;AACA;;;;AAEO,MAAMA,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAV;;AAUA,MAAMC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAApB;;AAUA,MAAMC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,kBACJC,cAAOC,IAAP,CAAa,GAAb,CADI,2DAIH,iBAAM,oBAAN,CAJG,4BAMTD,cAAOE,EAAP,CAAUC,QAND,uiEAAb,C,CAWP;AACA;;;AAEO,MAAMC,SAAS,GAAG,iCAAQC,UAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,eAEVL,cAAOE,EAAP,CAAUC,QAFA,skEAAf","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { Text } from '../../../text';\nimport { font, COLORS } from '../../../utils';\n\nexport const Root = styled.div`\n\tbottom: 0;\n\tbox-sizing: border-box;\n\tleft: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n`;\n\nexport const TooltipWrapper = styled.div`\n\talign-items: center;\n\tbox-sizing: border-box;\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\topacity: 0;\n\tpointer-events: none;\n\ttransition: opacity 120ms linear;\n`;\n\nexport const Tooltip = styled.div`\n\tbackground: ${ COLORS.gray[ 900 ] };\n\tborder-radius: 2px;\n\tbox-sizing: border-box;\n\tfont-family: ${ font( 'default.fontFamily' ) };\n\tfont-size: 12px;\n\tcolor: ${ COLORS.ui.textDark };\n\tpadding: 4px 8px;\n\tposition: relative;\n`;\n\n// TODO: Resolve need to use &&& to increase specificity\n// https://github.com/WordPress/gutenberg/issues/18483\n\nexport const LabelText = styled( Text )`\n\t&&& {\n\t\tcolor: ${ COLORS.ui.textDark };\n\t\tdisplay: block;\n\t\tfont-size: 13px;\n\t\tline-height: 1.4;\n\t\twhite-space: nowrap;\n\t}\n`;\n"]}
|
|
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var _compose = require("@wordpress/compose");
|
|
15
|
-
|
|
16
14
|
/**
|
|
17
15
|
* External dependencies
|
|
18
16
|
*/
|
|
@@ -44,25 +42,26 @@ function ResponsiveWrapper(_ref) {
|
|
|
44
42
|
children,
|
|
45
43
|
isInline = false
|
|
46
44
|
} = _ref;
|
|
47
|
-
const [containerResizeListener, {
|
|
48
|
-
width: containerWidth
|
|
49
|
-
}] = (0, _compose.useResizeObserver)();
|
|
50
45
|
|
|
51
46
|
if (_element.Children.count(children) !== 1) {
|
|
52
47
|
return null;
|
|
53
48
|
}
|
|
54
49
|
|
|
55
|
-
const imageStyle = {
|
|
56
|
-
paddingBottom: naturalWidth < (containerWidth !== null && containerWidth !== void 0 ? containerWidth : 0) ? naturalHeight : naturalHeight / naturalWidth * 100 + '%'
|
|
57
|
-
};
|
|
58
50
|
const TagName = isInline ? 'span' : 'div';
|
|
51
|
+
let aspectRatio;
|
|
52
|
+
|
|
53
|
+
if (naturalWidth && naturalHeight) {
|
|
54
|
+
aspectRatio = `${naturalWidth} / ${naturalHeight}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
59
57
|
return (0, _element.createElement)(TagName, {
|
|
60
58
|
className: "components-responsive-wrapper"
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
}, (0, _element.createElement)("div", null, (0, _element.cloneElement)(children, {
|
|
60
|
+
className: (0, _classnames.default)('components-responsive-wrapper__content', children.props.className),
|
|
61
|
+
style: { ...children.props.style,
|
|
62
|
+
aspectRatio
|
|
63
|
+
}
|
|
64
|
+
})));
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
var _default = ResponsiveWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/responsive-wrapper/index.tsx"],"names":["ResponsiveWrapper","naturalWidth","naturalHeight","children","isInline","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/responsive-wrapper/index.tsx"],"names":["ResponsiveWrapper","naturalWidth","naturalHeight","children","isInline","Children","count","TagName","aspectRatio","className","props","style"],"mappings":";;;;;;;;;AAQA;;AALA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAT,OAK4B;AAAA,MALA;AAC3BC,IAAAA,YAD2B;AAE3BC,IAAAA,aAF2B;AAG3BC,IAAAA,QAH2B;AAI3BC,IAAAA,QAAQ,GAAG;AAJgB,GAKA;;AAC3B,MAAKC,kBAASC,KAAT,CAAgBH,QAAhB,MAA+B,CAApC,EAAwC;AACvC,WAAO,IAAP;AACA;;AAED,QAAMI,OAAO,GAAGH,QAAQ,GAAG,MAAH,GAAY,KAApC;AACA,MAAII,WAAJ;;AACA,MAAKP,YAAY,IAAIC,aAArB,EAAqC;AACpCM,IAAAA,WAAW,GAAI,GAAGP,YAAc,MAAMC,aAAe,EAArD;AACA;;AAED,SACC,4BAAC,OAAD;AAAS,IAAA,SAAS,EAAC;AAAnB,KACC,yCACG,2BAAcC,QAAd,EAAwB;AACzBM,IAAAA,SAAS,EAAE,yBACV,wCADU,EAEVN,QAAQ,CAACO,KAAT,CAAeD,SAFL,CADc;AAKzBE,IAAAA,KAAK,EAAE,EACN,GAAGR,QAAQ,CAACO,KAAT,CAAeC,KADZ;AAENH,MAAAA;AAFM;AALkB,GAAxB,CADH,CADD,CADD;AAgBA;;eAEcR,iB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { cloneElement, Children } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ResponsiveWrapperProps } from './types';\n\n/**\n * A wrapper component that maintains its aspect ratio when resized.\n *\n * ```jsx\n * import { ResponsiveWrapper } from '@wordpress/components';\n *\n * const MyResponsiveWrapper = () => (\n * \t<ResponsiveWrapper naturalWidth={ 2000 } naturalHeight={ 680 }>\n * \t\t<img\n * \t\t\tsrc=\"https://s.w.org/style/images/about/WordPress-logotype-standard.png\"\n * \t\t\talt=\"WordPress\"\n * \t\t/>\n * \t</ResponsiveWrapper>\n * );\n * ```\n */\nfunction ResponsiveWrapper( {\n\tnaturalWidth,\n\tnaturalHeight,\n\tchildren,\n\tisInline = false,\n}: ResponsiveWrapperProps ) {\n\tif ( Children.count( children ) !== 1 ) {\n\t\treturn null;\n\t}\n\n\tconst TagName = isInline ? 'span' : 'div';\n\tlet aspectRatio;\n\tif ( naturalWidth && naturalHeight ) {\n\t\taspectRatio = `${ naturalWidth } / ${ naturalHeight }`;\n\t}\n\n\treturn (\n\t\t<TagName className=\"components-responsive-wrapper\">\n\t\t\t<div>\n\t\t\t\t{ cloneElement( children, {\n\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t'components-responsive-wrapper__content',\n\t\t\t\t\t\tchildren.props.className\n\t\t\t\t\t),\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...children.props.style,\n\t\t\t\t\t\taspectRatio,\n\t\t\t\t\t},\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t</TagName>\n\t);\n}\n\nexport default ResponsiveWrapper;\n"]}
|
|
@@ -42,8 +42,8 @@ function useUniqueId(idProp) {
|
|
|
42
42
|
return idProp || id;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
function UnforwardedSelectControl(
|
|
46
|
-
|
|
45
|
+
function UnforwardedSelectControl(props, ref) {
|
|
46
|
+
const {
|
|
47
47
|
className,
|
|
48
48
|
disabled = false,
|
|
49
49
|
help,
|
|
@@ -52,7 +52,7 @@ function UnforwardedSelectControl(_ref, ref) {
|
|
|
52
52
|
label,
|
|
53
53
|
multiple = false,
|
|
54
54
|
onBlur = noop,
|
|
55
|
-
onChange
|
|
55
|
+
onChange,
|
|
56
56
|
onFocus = noop,
|
|
57
57
|
options = [],
|
|
58
58
|
size = 'default',
|
|
@@ -63,8 +63,8 @@ function UnforwardedSelectControl(_ref, ref) {
|
|
|
63
63
|
suffix,
|
|
64
64
|
__next36pxDefaultSize = false,
|
|
65
65
|
__nextHasNoMarginBottom = false,
|
|
66
|
-
...
|
|
67
|
-
} =
|
|
66
|
+
...restProps
|
|
67
|
+
} = props;
|
|
68
68
|
const [isFocused, setIsFocused] = (0, _element.useState)(false);
|
|
69
69
|
const id = useUniqueId(idProp);
|
|
70
70
|
const helpId = help ? `${id}__help` : undefined; // Disable reason: A select with an onchange throws a warning.
|
|
@@ -82,31 +82,35 @@ function UnforwardedSelectControl(_ref, ref) {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
const handleOnChange = event => {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
var _props$onChange2;
|
|
86
|
+
|
|
87
|
+
if (props.multiple) {
|
|
88
|
+
var _props$onChange;
|
|
89
|
+
|
|
90
|
+
const selectedOptions = Array.from(event.target.options).filter(_ref => {
|
|
87
91
|
let {
|
|
88
92
|
selected
|
|
89
|
-
} =
|
|
93
|
+
} = _ref;
|
|
90
94
|
return selected;
|
|
91
95
|
});
|
|
92
|
-
const newValues = selectedOptions.map(
|
|
96
|
+
const newValues = selectedOptions.map(_ref2 => {
|
|
93
97
|
let {
|
|
94
98
|
value
|
|
95
|
-
} =
|
|
99
|
+
} = _ref2;
|
|
96
100
|
return value;
|
|
97
101
|
});
|
|
98
|
-
onChange(newValues
|
|
102
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, newValues, {
|
|
103
|
+
event
|
|
104
|
+
});
|
|
99
105
|
return;
|
|
100
106
|
}
|
|
101
107
|
|
|
102
|
-
onChange(event.target.value, {
|
|
108
|
+
(_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 ? void 0 : _props$onChange2.call(props, event.target.value, {
|
|
103
109
|
event
|
|
104
110
|
});
|
|
105
111
|
};
|
|
106
112
|
|
|
107
113
|
const classes = (0, _classnames.default)('components-select-control', className);
|
|
108
|
-
/* eslint-disable jsx-a11y/no-onchange */
|
|
109
|
-
|
|
110
114
|
return (0, _element.createElement)(_baseControl.default, {
|
|
111
115
|
help: help,
|
|
112
116
|
id: id,
|
|
@@ -123,7 +127,7 @@ function UnforwardedSelectControl(_ref, ref) {
|
|
|
123
127
|
prefix: prefix,
|
|
124
128
|
labelPosition: labelPosition,
|
|
125
129
|
__next36pxDefaultSize: __next36pxDefaultSize
|
|
126
|
-
}, (0, _element.createElement)(_selectControlStyles.Select, (0, _extends2.default)({},
|
|
130
|
+
}, (0, _element.createElement)(_selectControlStyles.Select, (0, _extends2.default)({}, restProps, {
|
|
127
131
|
__next36pxDefaultSize: __next36pxDefaultSize,
|
|
128
132
|
"aria-describedby": helpId,
|
|
129
133
|
className: "components-select-control__input",
|
|
@@ -144,7 +148,6 @@ function UnforwardedSelectControl(_ref, ref) {
|
|
|
144
148
|
disabled: option.disabled
|
|
145
149
|
}, option.label);
|
|
146
150
|
}))));
|
|
147
|
-
/* eslint-enable jsx-a11y/no-onchange */
|
|
148
151
|
}
|
|
149
152
|
/**
|
|
150
153
|
* `SelectControl` allows users to select from a single or multiple option menu.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/select-control/index.tsx"],"names":["noop","useUniqueId","idProp","instanceId","SelectControl","id","UnforwardedSelectControl","ref","className","disabled","help","hideLabelFromVision","label","multiple","onBlur","onChange","onFocus","options","size","value","valueProp","labelPosition","children","prefix","suffix","__next36pxDefaultSize","__nextHasNoMarginBottom","
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/select-control/index.tsx"],"names":["noop","useUniqueId","idProp","instanceId","SelectControl","id","UnforwardedSelectControl","props","ref","className","disabled","help","hideLabelFromVision","label","multiple","onBlur","onChange","onFocus","options","size","value","valueProp","labelPosition","children","prefix","suffix","__next36pxDefaultSize","__nextHasNoMarginBottom","restProps","isFocused","setIsFocused","helpId","undefined","length","handleOnBlur","event","handleOnFocus","handleOnChange","selectedOptions","Array","from","target","filter","selected","newValues","map","classes","option","index","key"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AAMA;;AACA;;AACA;;AAGA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAQA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,WAAT,CAAsBC,MAAtB,EAAwC;AACvC,QAAMC,UAAU,GAAG,4BAAeC,aAAf,CAAnB;AACA,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,OAT5B;AAWC,IAAA,MAAM,EAAGU,MAXV;AAYC,IAAA,aAAa,EAAGF,aAZjB;AAaC,IAAA,qBAAqB,EAAGI;AAbzB,KAeC,4BAAC,2BAAD,6BACME,SADN;AAEC,IAAA,qBAAqB,EAAGF,qBAFzB;AAGC,wBAAmBK,MAHpB;AAIC,IAAA,SAAS,EAAC,kCAJX;AAKC,IAAA,QAAQ,EAAGrB,QALZ;AAMC,IAAA,EAAE,EAAGL,EANN;AAOC,IAAA,QAAQ,EAAGS,QAPZ;AAQC,IAAA,MAAM,EAAGoB,YARV;AASC,IAAA,QAAQ,EAAGG,cATZ;AAUC,IAAA,OAAO,EAAGD,aAVX;AAWC,IAAA,GAAG,EAAG5B,GAXP;AAYC,IAAA,UAAU,EAAGW,IAZd;AAaC,IAAA,KAAK,EAAGE;AAbT,MAeGE,QAAQ,IACTL,OAAO,CAAC2B,GAAR,CAAa,CAAEE,MAAF,EAAUC,KAAV,KAAqB;AACjC,UAAMC,GAAG,GACRF,MAAM,CAAC1C,EAAP,IACC,GAAG0C,MAAM,CAAClC,KAAO,IAAIkC,MAAM,CAAC3B,KAAO,IAAI4B,KAAO,EAFhD;AAIA,WACC;AACC,MAAA,GAAG,EAAGC,GADP;AAEC,MAAA,KAAK,EAAGF,MAAM,CAAC3B,KAFhB;AAGC,MAAA,QAAQ,EAAG2B,MAAM,CAACrC;AAHnB,OAKGqC,MAAM,CAAClC,KALV,CADD;AASA,GAdD,CAhBF,CAfD,CALD,CADD;AAwDA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMT,aAAa,GAAG,yBAAYE,wBAAZ,CAAtB;;eAEQF,a","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport InputBase from '../input-control/input-base';\nimport { Select } from './styles/select-control-styles';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { SelectControlProps } from './types';\nimport SelectControlChevronDown from './chevron-down';\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( SelectControl );\n\tconst id = `inspector-select-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\nfunction UnforwardedSelectControl(\n\tprops: WordPressComponentProps< SelectControlProps, 'select', false >,\n\tref: React.ForwardedRef< HTMLSelectElement >\n) {\n\tconst {\n\t\tclassName,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision,\n\t\tid: idProp,\n\t\tlabel,\n\t\tmultiple = false,\n\t\tonBlur = noop,\n\t\tonChange,\n\t\tonFocus = noop,\n\t\toptions = [],\n\t\tsize = 'default',\n\t\tvalue: valueProp,\n\t\tlabelPosition = 'top',\n\t\tchildren,\n\t\tprefix,\n\t\tsuffix,\n\t\t__next36pxDefaultSize = false,\n\t\t__nextHasNoMarginBottom = false,\n\t\t...restProps\n\t} = props;\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst id = useUniqueId( idProp );\n\tconst helpId = help ? `${ id }__help` : undefined;\n\n\t// Disable reason: A select with an onchange throws a warning.\n\tif ( ! options?.length && ! children ) return null;\n\n\tconst handleOnBlur = ( event: React.FocusEvent< HTMLSelectElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused( false );\n\t};\n\n\tconst handleOnFocus = ( event: React.FocusEvent< HTMLSelectElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused( true );\n\t};\n\n\tconst handleOnChange = (\n\t\tevent: React.ChangeEvent< HTMLSelectElement >\n\t) => {\n\t\tif ( props.multiple ) {\n\t\t\tconst selectedOptions = Array.from( event.target.options ).filter(\n\t\t\t\t( { selected } ) => selected\n\t\t\t);\n\t\t\tconst newValues = selectedOptions.map( ( { value } ) => value );\n\t\t\tprops.onChange?.( newValues, { event } );\n\t\t\treturn;\n\t\t}\n\n\t\tprops.onChange?.( event.target.value, { event } );\n\t};\n\n\tconst classes = classNames( 'components-select-control', className );\n\n\treturn (\n\t\t<BaseControl\n\t\t\thelp={ help }\n\t\t\tid={ id }\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t>\n\t\t\t<InputBase\n\t\t\t\tclassName={ classes }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\tisFocused={ isFocused }\n\t\t\t\tlabel={ label }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={\n\t\t\t\t\tsuffix || ( ! multiple && <SelectControlChevronDown /> )\n\t\t\t\t}\n\t\t\t\tprefix={ prefix }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t>\n\t\t\t\t<Select\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\t\taria-describedby={ helpId }\n\t\t\t\t\tclassName=\"components-select-control__input\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tmultiple={ multiple }\n\t\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tselectSize={ size }\n\t\t\t\t\tvalue={ valueProp }\n\t\t\t\t>\n\t\t\t\t\t{ children ||\n\t\t\t\t\t\toptions.map( ( option, index ) => {\n\t\t\t\t\t\t\tconst key =\n\t\t\t\t\t\t\t\toption.id ||\n\t\t\t\t\t\t\t\t`${ option.label }-${ option.value }-${ index }`;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<option\n\t\t\t\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\tdisabled={ option.disabled }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ option.label }\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t</Select>\n\t\t\t</InputBase>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * `SelectControl` allows users to select from a single or multiple option menu.\n * It functions as a wrapper around the browser's native `<select>` element.\n *\n * @example\n * import { SelectControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MySelectControl = () => {\n * const [ size, setSize ] = useState( '50%' );\n *\n * return (\n * <SelectControl\n * label=\"Size\"\n * value={ size }\n * options={ [\n * { label: 'Big', value: '100%' },\n * { label: 'Medium', value: '50%' },\n * { label: 'Small', value: '25%' },\n * ] }\n * onChange={ setSize }\n * />\n * );\n * };\n */\nexport const SelectControl = forwardRef( UnforwardedSelectControl );\n\nexport default SelectControl;\n"]}
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = void 0;
|
|
8
|
+
exports.default = exports.ToolbarButton = void 0;
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
@@ -21,8 +21,6 @@ var _toolbarContext = _interopRequireDefault(require("../toolbar-context"));
|
|
|
21
21
|
|
|
22
22
|
var _toolbarButtonContainer = _interopRequireDefault(require("./toolbar-button-container"));
|
|
23
23
|
|
|
24
|
-
// @ts-nocheck
|
|
25
|
-
|
|
26
24
|
/**
|
|
27
25
|
* External dependencies
|
|
28
26
|
*/
|
|
@@ -34,15 +32,15 @@ var _toolbarButtonContainer = _interopRequireDefault(require("./toolbar-button-c
|
|
|
34
32
|
/**
|
|
35
33
|
* Internal dependencies
|
|
36
34
|
*/
|
|
37
|
-
function
|
|
35
|
+
function UnforwardedToolbarButton(_ref, ref) {
|
|
38
36
|
let {
|
|
39
|
-
|
|
37
|
+
children,
|
|
40
38
|
className,
|
|
39
|
+
containerClassName,
|
|
41
40
|
extraProps,
|
|
42
|
-
children,
|
|
43
|
-
title,
|
|
44
41
|
isActive,
|
|
45
42
|
isDisabled,
|
|
43
|
+
title,
|
|
46
44
|
...props
|
|
47
45
|
} = _ref;
|
|
48
46
|
const accessibleToolbarState = (0, _element.useContext)(_toolbarContext.default);
|
|
@@ -57,7 +55,7 @@ function ToolbarButton(_ref, ref) {
|
|
|
57
55
|
shortcut: props.shortcut,
|
|
58
56
|
"data-subscript": props.subscript,
|
|
59
57
|
onClick: event => {
|
|
60
|
-
event.stopPropagation();
|
|
58
|
+
event.stopPropagation(); // TODO: Possible bug; maybe use onClick instead of props.onClick.
|
|
61
59
|
|
|
62
60
|
if (props.onClick) {
|
|
63
61
|
props.onClick(event);
|
|
@@ -77,14 +75,38 @@ function ToolbarButton(_ref, ref) {
|
|
|
77
75
|
className: (0, _classnames.default)('components-toolbar-button', className)
|
|
78
76
|
}, extraProps, props, {
|
|
79
77
|
ref: ref
|
|
80
|
-
}),
|
|
78
|
+
}), // @ts-expect-error
|
|
79
|
+
toolbarItemProps => (0, _element.createElement)(_button.default, (0, _extends2.default)({
|
|
81
80
|
label: title,
|
|
82
81
|
isPressed: isActive,
|
|
83
82
|
disabled: isDisabled
|
|
84
83
|
}, toolbarItemProps), children));
|
|
85
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* ToolbarButton can be used to add actions to a toolbar, usually inside a Toolbar
|
|
87
|
+
* or ToolbarGroup when used to create general interfaces.
|
|
88
|
+
*
|
|
89
|
+
* ```jsx
|
|
90
|
+
* import { Toolbar, ToolbarButton } from '@wordpress/components';
|
|
91
|
+
* import { edit } from '@wordpress/icons';
|
|
92
|
+
*
|
|
93
|
+
* function MyToolbar() {
|
|
94
|
+
* return (
|
|
95
|
+
* <Toolbar label="Options">
|
|
96
|
+
* <ToolbarButton
|
|
97
|
+
* icon={ edit }
|
|
98
|
+
* label="Edit"
|
|
99
|
+
* onClick={ () => alert( 'Editing' ) }
|
|
100
|
+
* />
|
|
101
|
+
* </Toolbar>
|
|
102
|
+
* );
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
86
106
|
|
|
87
|
-
var _default = (0, _element.forwardRef)(ToolbarButton);
|
|
88
107
|
|
|
108
|
+
const ToolbarButton = (0, _element.forwardRef)(UnforwardedToolbarButton);
|
|
109
|
+
exports.ToolbarButton = ToolbarButton;
|
|
110
|
+
var _default = ToolbarButton;
|
|
89
111
|
exports.default = _default;
|
|
90
112
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/toolbar/toolbar-button/index.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/toolbar/toolbar-button/index.tsx"],"names":["UnforwardedToolbarButton","ref","children","className","containerClassName","extraProps","isActive","isDisabled","title","props","accessibleToolbarState","ToolbarContext","icon","shortcut","subscript","event","stopPropagation","onClick","toolbarItemProps","ToolbarButton"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAWA;;AACA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AASA,SAASA,wBAAT,OAWCC,GAXD,EAYE;AAAA,MAXD;AACCC,IAAAA,QADD;AAECC,IAAAA,SAFD;AAGCC,IAAAA,kBAHD;AAICC,IAAAA,UAJD;AAKCC,IAAAA,QALD;AAMCC,IAAAA,UAND;AAOCC,IAAAA,KAPD;AAQC,OAAGC;AARJ,GAWC;AACD,QAAMC,sBAAsB,GAAG,yBAAYC,uBAAZ,CAA/B;;AAEA,MAAK,CAAED,sBAAP,EAAgC;AAC/B,WACC,4BAAC,+BAAD;AAAwB,MAAA,SAAS,EAAGN;AAApC,OACC,4BAAC,eAAD;AACC,MAAA,GAAG,EAAGH,GADP;AAEC,MAAA,IAAI,EAAGQ,KAAK,CAACG,IAFd;AAGC,MAAA,KAAK,EAAGJ,KAHT;AAIC,MAAA,QAAQ,EAAGC,KAAK,CAACI,QAJlB;AAKC,wBAAiBJ,KAAK,CAACK,SALxB;AAMC,MAAA,OAAO,EACNC,KADS,IAKL;AACJA,QAAAA,KAAK,CAACC,eAAN,GADI,CAEJ;;AACA,YAAKP,KAAK,CAACQ,OAAX,EAAqB;AACpBR,UAAAA,KAAK,CAACQ,OAAN,CAAeF,KAAf;AACA;AACD,OAjBF;AAkBC,MAAA,SAAS,EAAG,yBACX,6BADW,EAEXZ,SAFW,CAlBb;AAsBC,MAAA,SAAS,EAAGG,QAtBb;AAuBC,MAAA,QAAQ,EAAGC,UAvBZ;AAwBC;AAxBD,OAyBMF,UAzBN,EA0BMI,KA1BN,GA4BGP,QA5BH,CADD,CADD;AAkCA,GAtCA,CAwCD;AACA;AACA;;;AACA,SACC,4BAAC,oBAAD;AACC,IAAA,SAAS,EAAG,yBAAY,2BAAZ,EAAyCC,SAAzC;AADb,KAEME,UAFN,EAGMI,KAHN;AAIC,IAAA,GAAG,EAAGR;AAJP,MAOE;AACEiB,EAAAA,gBAAF,IACC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAGV,KADT;AAEC,IAAA,SAAS,EAAGF,QAFb;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAIMW,gBAJN,GAMGhB,QANH,CATH,CADD;AAsBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMiB,aAAa,GAAG,yBAAYnB,wBAAZ,CAAtB;;eACQmB,a","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport ToolbarItem from '../toolbar-item';\nimport ToolbarContext from '../toolbar-context';\nimport ToolbarButtonContainer from './toolbar-button-container';\nimport type { ToolbarButtonProps } from './types';\nimport type { WordPressComponentProps } from '../../ui/context';\nimport type React from 'react';\n\nfunction UnforwardedToolbarButton(\n\t{\n\t\tchildren,\n\t\tclassName,\n\t\tcontainerClassName,\n\t\textraProps,\n\t\tisActive,\n\t\tisDisabled,\n\t\ttitle,\n\t\t...props\n\t}: WordPressComponentProps< ToolbarButtonProps, typeof Button, false >,\n\tref: ForwardedRef< any >\n) {\n\tconst accessibleToolbarState = useContext( ToolbarContext );\n\n\tif ( ! accessibleToolbarState ) {\n\t\treturn (\n\t\t\t<ToolbarButtonContainer className={ containerClassName }>\n\t\t\t\t<Button\n\t\t\t\t\tref={ ref }\n\t\t\t\t\ticon={ props.icon }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tshortcut={ props.shortcut }\n\t\t\t\t\tdata-subscript={ props.subscript }\n\t\t\t\t\tonClick={ (\n\t\t\t\t\t\tevent: React.MouseEvent<\n\t\t\t\t\t\t\tHTMLButtonElement & HTMLAnchorElement,\n\t\t\t\t\t\t\tMouseEvent\n\t\t\t\t\t\t>\n\t\t\t\t\t) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t// TODO: Possible bug; maybe use onClick instead of props.onClick.\n\t\t\t\t\t\tif ( props.onClick ) {\n\t\t\t\t\t\t\tprops.onClick( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'components-toolbar__control',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\tdata-toolbar-item\n\t\t\t\t\t{ ...extraProps }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</Button>\n\t\t\t</ToolbarButtonContainer>\n\t\t);\n\t}\n\n\t// ToobarItem will pass all props to the render prop child, which will pass\n\t// all props to Button. This means that ToolbarButton has the same API as\n\t// Button.\n\treturn (\n\t\t<ToolbarItem\n\t\t\tclassName={ classnames( 'components-toolbar-button', className ) }\n\t\t\t{ ...extraProps }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{\n\t\t\t\t// @ts-expect-error\n\t\t\t\t( toolbarItemProps ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\t\t{ ...toolbarItemProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</Button>\n\t\t\t\t)\n\t\t\t}\n\t\t</ToolbarItem>\n\t);\n}\n\n/**\n * ToolbarButton can be used to add actions to a toolbar, usually inside a Toolbar\n * or ToolbarGroup when used to create general interfaces.\n *\n * ```jsx\n * import { Toolbar, ToolbarButton } from '@wordpress/components';\n * import { edit } from '@wordpress/icons';\n *\n * function MyToolbar() {\n * return (\n *\t\t<Toolbar label=\"Options\">\n *\t\t\t<ToolbarButton\n *\t\t\t\ticon={ edit }\n *\t\t\t\tlabel=\"Edit\"\n *\t\t\t\tonClick={ () => alert( 'Editing' ) }\n *\t\t\t/>\n *\t\t</Toolbar>\n * );\n * }\n * ```\n */\nexport const ToolbarButton = forwardRef( UnforwardedToolbarButton );\nexport default ToolbarButton;\n"]}
|
|
@@ -7,10 +7,18 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _element = require("@wordpress/element");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
const ToolbarButtonContainer = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
children,
|
|
16
|
+
className
|
|
17
|
+
} = _ref;
|
|
18
|
+
return (0, _element.createElement)("div", {
|
|
19
|
+
className: className
|
|
20
|
+
}, children);
|
|
21
|
+
};
|
|
14
22
|
|
|
15
23
|
var _default = ToolbarButtonContainer;
|
|
16
24
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/toolbar/toolbar-button/toolbar-button-container.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/toolbar/toolbar-button/toolbar-button-container.tsx"],"names":["ToolbarButtonContainer","children","className"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AAGA,MAAMA,sBAAsB,GAAG;AAAA,MAAE;AAChCC,IAAAA,QADgC;AAEhCC,IAAAA;AAFgC,GAAF;AAAA,SAI9B;AAAK,IAAA,SAAS,EAAGA;AAAjB,KAA+BD,QAA/B,CAJ8B;AAAA,CAA/B;;eAOeD,sB","sourcesContent":["/**\n * Internal dependencies\n */\nimport type { ToolbarButtonContainerProps } from './types';\n\nconst ToolbarButtonContainer = ( {\n\tchildren,\n\tclassName,\n}: ToolbarButtonContainerProps ) => (\n\t<div className={ className }>{ children }</div>\n);\n\nexport default ToolbarButtonContainer;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -7,12 +7,14 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _element = require("@wordpress/element");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* External dependencies
|
|
12
|
+
*/
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* WordPress dependencies
|
|
14
16
|
*/
|
|
15
|
-
const ToolbarContext = (0, _element.createContext)();
|
|
17
|
+
const ToolbarContext = (0, _element.createContext)(undefined);
|
|
16
18
|
var _default = ToolbarContext;
|
|
17
19
|
exports.default = _default;
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/toolbar/toolbar-context/index.
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/toolbar/toolbar-context/index.ts"],"names":["ToolbarContext","undefined"],"mappings":";;;;;;;AAQA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,4BACtBC,SADsB,CAAvB;eAIeD,c","sourcesContent":["/**\n * External dependencies\n */\nimport type { ToolbarStateReturn } from 'reakit/Toolbar';\n\n/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nconst ToolbarContext = createContext< ToolbarStateReturn | undefined >(\n\tundefined\n);\n\nexport default ToolbarContext;\n"]}
|
package/build/tooltip/index.js
CHANGED
|
@@ -9,6 +9,10 @@ exports.default = exports.TOOLTIP_DELAY = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
12
16
|
var _compose = require("@wordpress/compose");
|
|
13
17
|
|
|
14
18
|
var _popover = _interopRequireDefault(require("../popover"));
|
|
@@ -17,6 +21,10 @@ var _shortcut = _interopRequireDefault(require("../shortcut"));
|
|
|
17
21
|
|
|
18
22
|
// @ts-nocheck
|
|
19
23
|
|
|
24
|
+
/**
|
|
25
|
+
* External dependencies
|
|
26
|
+
*/
|
|
27
|
+
|
|
20
28
|
/**
|
|
21
29
|
* WordPress dependencies
|
|
22
30
|
*/
|
|
@@ -73,18 +81,20 @@ const addPopoverToGrandchildren = _ref3 => {
|
|
|
73
81
|
offset,
|
|
74
82
|
position,
|
|
75
83
|
shortcut,
|
|
76
|
-
text
|
|
84
|
+
text,
|
|
85
|
+
className,
|
|
86
|
+
...props
|
|
77
87
|
} = _ref3;
|
|
78
|
-
return (0, _element.concatChildren)(grandchildren, isOver && (0, _element.createElement)(_popover.default, {
|
|
88
|
+
return (0, _element.concatChildren)(grandchildren, isOver && (0, _element.createElement)(_popover.default, (0, _extends2.default)({
|
|
79
89
|
focusOnMount: false,
|
|
80
90
|
position: position,
|
|
81
|
-
className:
|
|
91
|
+
className: (0, _classnames.default)('components-tooltip', className),
|
|
82
92
|
"aria-hidden": "true",
|
|
83
93
|
animate: false,
|
|
84
94
|
offset: offset,
|
|
85
95
|
anchor: anchor,
|
|
86
96
|
shift: true
|
|
87
|
-
}, text, (0, _element.createElement)(_shortcut.default, {
|
|
97
|
+
}, props), text, (0, _element.createElement)(_shortcut.default, {
|
|
88
98
|
className: "components-tooltip__shortcut",
|
|
89
99
|
shortcut: shortcut
|
|
90
100
|
})));
|
|
@@ -115,7 +125,8 @@ function Tooltip(props) {
|
|
|
115
125
|
position = 'bottom middle',
|
|
116
126
|
text,
|
|
117
127
|
shortcut,
|
|
118
|
-
delay = TOOLTIP_DELAY
|
|
128
|
+
delay = TOOLTIP_DELAY,
|
|
129
|
+
...popoverProps
|
|
119
130
|
} = props;
|
|
120
131
|
/**
|
|
121
132
|
* Whether a mouse is currently pressed, used in determining whether
|
|
@@ -269,7 +280,8 @@ function Tooltip(props) {
|
|
|
269
280
|
};
|
|
270
281
|
const childrenWithPopover = addPopoverToGrandchildren({
|
|
271
282
|
grandchildren,
|
|
272
|
-
...popoverData
|
|
283
|
+
...popoverData,
|
|
284
|
+
...popoverProps
|
|
273
285
|
});
|
|
274
286
|
return getElementWithPopover({
|
|
275
287
|
child,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/components/src/tooltip/index.js"],"names":["TOOLTIP_DELAY","eventCatcher","getDisabledElement","eventHandlers","child","childrenWithPopover","mergedRefs","children","ref","getRegularElement","addPopoverToGrandchildren","anchor","grandchildren","isOver","offset","position","shortcut","text","emitToChild","eventName","event","Children","count","only","props","disabled","Tooltip","delay","isMouseDown","setIsMouseDown","setIsOver","delayedSetIsOver","popoverAnchor","setPopoverAnchor","existingChildRef","toArray","mergedChildRefs","createMouseDown","target","tagName","document","addEventListener","cancelIsMouseDown","createMouseUp","removeEventListener","createMouseEvent","type","createToggleIsOver","isDelayed","currentTarget","cancel","_isOver","includes","clearOnUnmount","process","env","NODE_ENV","console","error","onMouseEnter","onMouseLeave","onClick","onFocus","onBlur","onMouseDown","getElementWithPopover","popoverData"],"mappings":";;;;;;;;;AAKA;;AAOA;;AAKA;;AACA;;AAlBA;;AAEA;AACA;AACA;;AAUA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,aAAa,GAAG,GAAtB;;AAEP,MAAMC,YAAY,GAAG;AAAK,EAAA,SAAS,EAAC;AAAf,EAArB;;AAEA,MAAMC,kBAAkB,GAAG,QAKpB;AAAA,MALsB;AAC5BC,IAAAA,aAD4B;AAE5BC,IAAAA,KAF4B;AAG5BC,IAAAA,mBAH4B;AAI5BC,IAAAA;AAJ4B,GAKtB;AACN,SAAO,2BACN;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG,2BAAcL,YAAd,EAA4BE,aAA5B,CADH,EAEG,2BAAcC,KAAd,EAAqB;AACtBG,IAAAA,QAAQ,EAAEF,mBADY;AAEtBG,IAAAA,GAAG,EAAEF;AAFiB,GAArB,CAFH,CADM,EAQN,EAAE,GAAGH;AAAL,GARM,CAAP;AAUA,CAhBD;;AAkBA,MAAMM,iBAAiB,GAAG,SAKnB;AAAA,MALqB;AAC3BL,IAAAA,KAD2B;AAE3BD,IAAAA,aAF2B;AAG3BE,IAAAA,mBAH2B;AAI3BC,IAAAA;AAJ2B,GAKrB;AACN,SAAO,2BAAcF,KAAd,EAAqB,EAC3B,GAAGD,aADwB;AAE3BI,IAAAA,QAAQ,EAAEF,mBAFiB;AAG3BG,IAAAA,GAAG,EAAEF;AAHsB,GAArB,CAAP;AAKA,CAXD;;AAaA,MAAMI,yBAAyB,GAAG;AAAA,MAAE;AACnCC,IAAAA,MADmC;AAEnCC,IAAAA,aAFmC;AAGnCC,IAAAA,MAH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\n\tChildren,\n\tcloneElement,\n\tconcatChildren,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useDebounce, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Popover from '../popover';\nimport Shortcut from '../shortcut';\n\n/**\n * Time over children to wait before showing tooltip\n *\n * @type {number}\n */\nexport const TOOLTIP_DELAY = 700;\n\nconst eventCatcher = <div className=\"event-catcher\" />;\n\nconst getDisabledElement = ( {\n\teventHandlers,\n\tchild,\n\tchildrenWithPopover,\n\tmergedRefs,\n} ) => {\n\treturn cloneElement(\n\t\t<span className=\"disabled-element-wrapper\">\n\t\t\t{ cloneElement( eventCatcher, eventHandlers ) }\n\t\t\t{ cloneElement( child, {\n\t\t\t\tchildren: childrenWithPopover,\n\t\t\t\tref: mergedRefs,\n\t\t\t} ) }\n\t\t</span>,\n\t\t{ ...eventHandlers }\n\t);\n};\n\nconst getRegularElement = ( {\n\tchild,\n\teventHandlers,\n\tchildrenWithPopover,\n\tmergedRefs,\n} ) => {\n\treturn cloneElement( child, {\n\t\t...eventHandlers,\n\t\tchildren: childrenWithPopover,\n\t\tref: mergedRefs,\n\t} );\n};\n\nconst addPopoverToGrandchildren = ( {\n\tanchor,\n\tgrandchildren,\n\tisOver,\n\toffset,\n\tposition,\n\tshortcut,\n\ttext,\n} ) =>\n\tconcatChildren(\n\t\tgrandchildren,\n\t\tisOver && (\n\t\t\t<Popover\n\t\t\t\tfocusOnMount={ false }\n\t\t\t\tposition={ position }\n\t\t\t\tclassName=\"components-tooltip\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tanimate={ false }\n\t\t\t\toffset={ offset }\n\t\t\t\tanchor={ anchor }\n\t\t\t\tshift\n\t\t\t>\n\t\t\t\t{ text }\n\t\t\t\t<Shortcut\n\t\t\t\t\tclassName=\"components-tooltip__shortcut\"\n\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t/>\n\t\t\t</Popover>\n\t\t)\n\t);\n\nconst emitToChild = ( children, eventName, event ) => {\n\tif ( Children.count( children ) !== 1 ) {\n\t\treturn;\n\t}\n\n\tconst child = Children.only( children );\n\n\t// If the underlying element is disabled, do not emit the event.\n\tif ( child.props.disabled ) {\n\t\treturn;\n\t}\n\n\tif ( typeof child.props[ eventName ] === 'function' ) {\n\t\tchild.props[ eventName ]( event );\n\t}\n};\n\nfunction Tooltip( props ) {\n\tconst {\n\t\tchildren,\n\t\tposition = 'bottom middle',\n\t\ttext,\n\t\tshortcut,\n\t\tdelay = TOOLTIP_DELAY,\n\t} = props;\n\t/**\n\t * Whether a mouse is currently pressed, used in determining whether\n\t * to handle a focus event as displaying the tooltip immediately.\n\t *\n\t * @type {boolean}\n\t */\n\tconst [ isMouseDown, setIsMouseDown ] = useState( false );\n\tconst [ isOver, setIsOver ] = useState( false );\n\tconst delayedSetIsOver = useDebounce( setIsOver, delay );\n\t// Using internal state (instead of a ref) for the popover anchor to make sure\n\t// that the component re-renders when the anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\n\t// Create a reference to the Tooltip's child, to be passed to the Popover\n\t// so that the Tooltip can be correctly positioned. Also, merge with the\n\t// existing ref for the first child, so that its ref is preserved.\n\tconst existingChildRef = Children.toArray( children )[ 0 ]?.ref;\n\tconst mergedChildRefs = useMergeRefs( [\n\t\tsetPopoverAnchor,\n\t\texistingChildRef,\n\t] );\n\n\tconst createMouseDown = ( event ) => {\n\t\t// In firefox, the mouse down event is also fired when the select\n\t\t// list is chosen.\n\t\t// Cancel further processing because re-rendering of child components\n\t\t// causes onChange to be triggered with the old value.\n\t\t// See https://github.com/WordPress/gutenberg/pull/42483\n\t\tif ( event.target.tagName === 'OPTION' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Preserve original child callback behavior.\n\t\temitToChild( children, 'onMouseDown', event );\n\n\t\t// On mouse down, the next `mouseup` should revert the value of the\n\t\t// instance property and remove its own event handler. The bind is\n\t\t// made on the document since the `mouseup` might not occur within\n\t\t// the bounds of the element.\n\t\tdocument.addEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( true );\n\t};\n\n\tconst createMouseUp = ( event ) => {\n\t\t// In firefox, the mouse up event is also fired when the select\n\t\t// list is chosen.\n\t\t// Cancel further processing because re-rendering of child components\n\t\t// causes onChange to be triggered with the old value.\n\t\t// See https://github.com/WordPress/gutenberg/pull/42483\n\t\tif ( event.target.tagName === 'OPTION' ) {\n\t\t\treturn;\n\t\t}\n\n\t\temitToChild( children, 'onMouseUp', event );\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( false );\n\t};\n\n\tconst createMouseEvent = ( type ) => {\n\t\tif ( type === 'mouseUp' ) return createMouseUp;\n\t\tif ( type === 'mouseDown' ) return createMouseDown;\n\t};\n\n\t/**\n\t * Prebound `isInMouseDown` handler, created as a constant reference to\n\t * assure ability to remove in component unmount.\n\t *\n\t * @type {Function}\n\t */\n\tconst cancelIsMouseDown = createMouseEvent( 'mouseUp' );\n\n\tconst createToggleIsOver = ( eventName, isDelayed ) => {\n\t\treturn ( event ) => {\n\t\t\t// Preserve original child callback behavior.\n\t\t\temitToChild( children, eventName, event );\n\n\t\t\t// Mouse events behave unreliably in React for disabled elements,\n\t\t\t// firing on mouseenter but not mouseleave. Further, the default\n\t\t\t// behavior for disabled elements in some browsers is to ignore\n\t\t\t// mouse events. Don't bother trying to handle them.\n\t\t\t//\n\t\t\t// See: https://github.com/facebook/react/issues/4251\n\t\t\tif ( event.currentTarget.disabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// A focus event will occur as a result of a mouse click, but it\n\t\t\t// should be disambiguated between interacting with the button and\n\t\t\t// using an explicit focus shift as a cue to display the tooltip.\n\t\t\tif ( 'focus' === event.type && isMouseDown ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Needed in case unsetting is over while delayed set pending, i.e.\n\t\t\t// quickly blur/mouseleave before delayedSetIsOver is called.\n\t\t\tdelayedSetIsOver.cancel();\n\n\t\t\tconst _isOver = [ 'focus', 'mouseenter' ].includes( event.type );\n\t\t\tif ( _isOver === isOver ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isDelayed ) {\n\t\t\t\tdelayedSetIsOver( _isOver );\n\t\t\t} else {\n\t\t\t\tsetIsOver( _isOver );\n\t\t\t}\n\t\t};\n\t};\n\tconst clearOnUnmount = () => {\n\t\tdelayedSetIsOver.cancel();\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t};\n\n\t// Ignore reason: updating the deps array here could cause unexpected changes in behavior.\n\t// Deferring until a more detailed investigation/refactor can be performed.\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tuseEffect( () => clearOnUnmount, [] );\n\n\tif ( Children.count( children ) !== 1 ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\n\t\treturn children;\n\t}\n\n\tconst eventHandlers = {\n\t\tonMouseEnter: createToggleIsOver( 'onMouseEnter', true ),\n\t\tonMouseLeave: createToggleIsOver( 'onMouseLeave' ),\n\t\tonClick: createToggleIsOver( 'onClick' ),\n\t\tonFocus: createToggleIsOver( 'onFocus' ),\n\t\tonBlur: createToggleIsOver( 'onBlur' ),\n\t\tonMouseDown: createMouseEvent( 'mouseDown' ),\n\t};\n\n\tconst child = Children.only( children );\n\tconst { children: grandchildren, disabled } = child.props;\n\tconst getElementWithPopover = disabled\n\t\t? getDisabledElement\n\t\t: getRegularElement;\n\n\tconst popoverData = {\n\t\tanchor: popoverAnchor,\n\t\tisOver,\n\t\toffset: 4,\n\t\tposition,\n\t\tshortcut,\n\t\ttext,\n\t};\n\tconst childrenWithPopover = addPopoverToGrandchildren( {\n\t\tgrandchildren,\n\t\t...popoverData,\n\t} );\n\n\treturn getElementWithPopover( {\n\t\tchild,\n\t\teventHandlers,\n\t\tchildrenWithPopover,\n\t\tmergedRefs: mergedChildRefs,\n\t} );\n}\n\nexport default Tooltip;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/components/src/tooltip/index.js"],"names":["TOOLTIP_DELAY","eventCatcher","getDisabledElement","eventHandlers","child","childrenWithPopover","mergedRefs","children","ref","getRegularElement","addPopoverToGrandchildren","anchor","grandchildren","isOver","offset","position","shortcut","text","className","props","emitToChild","eventName","event","Children","count","only","disabled","Tooltip","delay","popoverProps","isMouseDown","setIsMouseDown","setIsOver","delayedSetIsOver","popoverAnchor","setPopoverAnchor","existingChildRef","toArray","mergedChildRefs","createMouseDown","target","tagName","document","addEventListener","cancelIsMouseDown","createMouseUp","removeEventListener","createMouseEvent","type","createToggleIsOver","isDelayed","currentTarget","cancel","_isOver","includes","clearOnUnmount","process","env","NODE_ENV","console","error","onMouseEnter","onMouseLeave","onClick","onFocus","onBlur","onMouseDown","getElementWithPopover","popoverData"],"mappings":";;;;;;;;;AAUA;;;;AALA;;AAYA;;AAKA;;AACA;;AAvBA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,aAAa,GAAG,GAAtB;;AAEP,MAAMC,YAAY,GAAG;AAAK,EAAA,SAAS,EAAC;AAAf,EAArB;;AAEA,MAAMC,kBAAkB,GAAG,QAKpB;AAAA,MALsB;AAC5BC,IAAAA,aAD4B;AAE5BC,IAAAA,KAF4B;AAG5BC,IAAAA,mBAH4B;AAI5BC,IAAAA;AAJ4B,GAKtB;AACN,SAAO,2BACN;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG,2BAAcL,YAAd,EAA4BE,aAA5B,CADH,EAEG,2BAAcC,KAAd,EAAqB;AACtBG,IAAAA,QAAQ,EAAEF,mBADY;AAEtBG,IAAAA,GAAG,EAAEF;AAFiB,GAArB,CAFH,CADM,EAQN,EAAE,GAAGH;AAAL,GARM,CAAP;AAUA,CAhBD;;AAkBA,M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QAAM2D,WAAW,GAAG;AACnBzD,IAAAA,MAAM,EAAEuB,aADW;AAEnBrB,IAAAA,MAFmB;AAGnBC,IAAAA,MAAM,EAAE,CAHW;AAInBC,IAAAA,QAJmB;AAKnBC,IAAAA,QALmB;AAMnBC,IAAAA;AANmB,GAApB;AAQA,QAAMZ,mBAAmB,GAAGK,yBAAyB,CAAE;AACtDE,IAAAA,aADsD;AAEtD,OAAGwD,WAFmD;AAGtD,OAAGvC;AAHmD,GAAF,CAArD;AAMA,SAAOsC,qBAAqB,CAAE;AAC7B/D,IAAAA,KAD6B;AAE7BD,IAAAA,aAF6B;AAG7BE,IAAAA,mBAH6B;AAI7BC,IAAAA,UAAU,EAAEgC;AAJiB,GAAF,CAA5B;AAMA;;eAEcX,O","sourcesContent":["// @ts-nocheck\n\n/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tChildren,\n\tcloneElement,\n\tconcatChildren,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useDebounce, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Popover from '../popover';\nimport Shortcut from '../shortcut';\n\n/**\n * Time over children to wait before showing tooltip\n *\n * @type {number}\n */\nexport const TOOLTIP_DELAY = 700;\n\nconst eventCatcher = <div className=\"event-catcher\" />;\n\nconst getDisabledElement = ( {\n\teventHandlers,\n\tchild,\n\tchildrenWithPopover,\n\tmergedRefs,\n} ) => {\n\treturn cloneElement(\n\t\t<span className=\"disabled-element-wrapper\">\n\t\t\t{ cloneElement( eventCatcher, eventHandlers ) }\n\t\t\t{ cloneElement( child, {\n\t\t\t\tchildren: childrenWithPopover,\n\t\t\t\tref: mergedRefs,\n\t\t\t} ) }\n\t\t</span>,\n\t\t{ ...eventHandlers }\n\t);\n};\n\nconst getRegularElement = ( {\n\tchild,\n\teventHandlers,\n\tchildrenWithPopover,\n\tmergedRefs,\n} ) => {\n\treturn cloneElement( child, {\n\t\t...eventHandlers,\n\t\tchildren: childrenWithPopover,\n\t\tref: mergedRefs,\n\t} );\n};\n\nconst addPopoverToGrandchildren = ( {\n\tanchor,\n\tgrandchildren,\n\tisOver,\n\toffset,\n\tposition,\n\tshortcut,\n\ttext,\n\tclassName,\n\t...props\n} ) =>\n\tconcatChildren(\n\t\tgrandchildren,\n\t\tisOver && (\n\t\t\t<Popover\n\t\t\t\tfocusOnMount={ false }\n\t\t\t\tposition={ position }\n\t\t\t\tclassName={ classNames( 'components-tooltip', className ) }\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tanimate={ false }\n\t\t\t\toffset={ offset }\n\t\t\t\tanchor={ anchor }\n\t\t\t\tshift\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ text }\n\t\t\t\t<Shortcut\n\t\t\t\t\tclassName=\"components-tooltip__shortcut\"\n\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t/>\n\t\t\t</Popover>\n\t\t)\n\t);\n\nconst emitToChild = ( children, eventName, event ) => {\n\tif ( Children.count( children ) !== 1 ) {\n\t\treturn;\n\t}\n\n\tconst child = Children.only( children );\n\n\t// If the underlying element is disabled, do not emit the event.\n\tif ( child.props.disabled ) {\n\t\treturn;\n\t}\n\n\tif ( typeof child.props[ eventName ] === 'function' ) {\n\t\tchild.props[ eventName ]( event );\n\t}\n};\n\nfunction Tooltip( props ) {\n\tconst {\n\t\tchildren,\n\t\tposition = 'bottom middle',\n\t\ttext,\n\t\tshortcut,\n\t\tdelay = TOOLTIP_DELAY,\n\t\t...popoverProps\n\t} = props;\n\t/**\n\t * Whether a mouse is currently pressed, used in determining whether\n\t * to handle a focus event as displaying the tooltip immediately.\n\t *\n\t * @type {boolean}\n\t */\n\tconst [ isMouseDown, setIsMouseDown ] = useState( false );\n\tconst [ isOver, setIsOver ] = useState( false );\n\tconst delayedSetIsOver = useDebounce( setIsOver, delay );\n\t// Using internal state (instead of a ref) for the popover anchor to make sure\n\t// that the component re-renders when the anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\n\t// Create a reference to the Tooltip's child, to be passed to the Popover\n\t// so that the Tooltip can be correctly positioned. Also, merge with the\n\t// existing ref for the first child, so that its ref is preserved.\n\tconst existingChildRef = Children.toArray( children )[ 0 ]?.ref;\n\tconst mergedChildRefs = useMergeRefs( [\n\t\tsetPopoverAnchor,\n\t\texistingChildRef,\n\t] );\n\n\tconst createMouseDown = ( event ) => {\n\t\t// In firefox, the mouse down event is also fired when the select\n\t\t// list is chosen.\n\t\t// Cancel further processing because re-rendering of child components\n\t\t// causes onChange to be triggered with the old value.\n\t\t// See https://github.com/WordPress/gutenberg/pull/42483\n\t\tif ( event.target.tagName === 'OPTION' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Preserve original child callback behavior.\n\t\temitToChild( children, 'onMouseDown', event );\n\n\t\t// On mouse down, the next `mouseup` should revert the value of the\n\t\t// instance property and remove its own event handler. The bind is\n\t\t// made on the document since the `mouseup` might not occur within\n\t\t// the bounds of the element.\n\t\tdocument.addEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( true );\n\t};\n\n\tconst createMouseUp = ( event ) => {\n\t\t// In firefox, the mouse up event is also fired when the select\n\t\t// list is chosen.\n\t\t// Cancel further processing because re-rendering of child components\n\t\t// causes onChange to be triggered with the old value.\n\t\t// See https://github.com/WordPress/gutenberg/pull/42483\n\t\tif ( event.target.tagName === 'OPTION' ) {\n\t\t\treturn;\n\t\t}\n\n\t\temitToChild( children, 'onMouseUp', event );\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( false );\n\t};\n\n\tconst createMouseEvent = ( type ) => {\n\t\tif ( type === 'mouseUp' ) return createMouseUp;\n\t\tif ( type === 'mouseDown' ) return createMouseDown;\n\t};\n\n\t/**\n\t * Prebound `isInMouseDown` handler, created as a constant reference to\n\t * assure ability to remove in component unmount.\n\t *\n\t * @type {Function}\n\t */\n\tconst cancelIsMouseDown = createMouseEvent( 'mouseUp' );\n\n\tconst createToggleIsOver = ( eventName, isDelayed ) => {\n\t\treturn ( event ) => {\n\t\t\t// Preserve original child callback behavior.\n\t\t\temitToChild( children, eventName, event );\n\n\t\t\t// Mouse events behave unreliably in React for disabled elements,\n\t\t\t// firing on mouseenter but not mouseleave. Further, the default\n\t\t\t// behavior for disabled elements in some browsers is to ignore\n\t\t\t// mouse events. Don't bother trying to handle them.\n\t\t\t//\n\t\t\t// See: https://github.com/facebook/react/issues/4251\n\t\t\tif ( event.currentTarget.disabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// A focus event will occur as a result of a mouse click, but it\n\t\t\t// should be disambiguated between interacting with the button and\n\t\t\t// using an explicit focus shift as a cue to display the tooltip.\n\t\t\tif ( 'focus' === event.type && isMouseDown ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Needed in case unsetting is over while delayed set pending, i.e.\n\t\t\t// quickly blur/mouseleave before delayedSetIsOver is called.\n\t\t\tdelayedSetIsOver.cancel();\n\n\t\t\tconst _isOver = [ 'focus', 'mouseenter' ].includes( event.type );\n\t\t\tif ( _isOver === isOver ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isDelayed ) {\n\t\t\t\tdelayedSetIsOver( _isOver );\n\t\t\t} else {\n\t\t\t\tsetIsOver( _isOver );\n\t\t\t}\n\t\t};\n\t};\n\tconst clearOnUnmount = () => {\n\t\tdelayedSetIsOver.cancel();\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t};\n\n\t// Ignore reason: updating the deps array here could cause unexpected changes in behavior.\n\t// Deferring until a more detailed investigation/refactor can be performed.\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tuseEffect( () => clearOnUnmount, [] );\n\n\tif ( Children.count( children ) !== 1 ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\n\t\treturn children;\n\t}\n\n\tconst eventHandlers = {\n\t\tonMouseEnter: createToggleIsOver( 'onMouseEnter', true ),\n\t\tonMouseLeave: createToggleIsOver( 'onMouseLeave' ),\n\t\tonClick: createToggleIsOver( 'onClick' ),\n\t\tonFocus: createToggleIsOver( 'onFocus' ),\n\t\tonBlur: createToggleIsOver( 'onBlur' ),\n\t\tonMouseDown: createMouseEvent( 'mouseDown' ),\n\t};\n\n\tconst child = Children.only( children );\n\tconst { children: grandchildren, disabled } = child.props;\n\tconst getElementWithPopover = disabled\n\t\t? getDisabledElement\n\t\t: getRegularElement;\n\n\tconst popoverData = {\n\t\tanchor: popoverAnchor,\n\t\tisOver,\n\t\toffset: 4,\n\t\tposition,\n\t\tshortcut,\n\t\ttext,\n\t};\n\tconst childrenWithPopover = addPopoverToGrandchildren( {\n\t\tgrandchildren,\n\t\t...popoverData,\n\t\t...popoverProps,\n\t} );\n\n\treturn getElementWithPopover( {\n\t\tchild,\n\t\teventHandlers,\n\t\tchildrenWithPopover,\n\t\tmergedRefs: mergedChildRefs,\n\t} );\n}\n\nexport default Tooltip;\n"]}
|