@wordpress/components 27.4.0 → 27.5.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 +27 -1
- package/build/alignment-matrix-control/index.js +3 -1
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +8 -8
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build/alignment-matrix-control/utils.js +6 -2
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +3 -1
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/autocomplete/index.js +21 -7
- package/build/autocomplete/index.js.map +1 -1
- package/build/checkbox-control/index.js +9 -2
- package/build/checkbox-control/index.js.map +1 -1
- package/build/color-picker/hex-input.js +3 -1
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/hue-picker.native.js +6 -2
- package/build/color-picker/hue-picker.native.js.map +1 -1
- package/build/color-picker/index.native.js +9 -3
- package/build/color-picker/index.native.js.map +1 -1
- package/build/color-picker/saturation-picker.native.js +6 -2
- package/build/color-picker/saturation-picker.native.js.map +1 -1
- package/build/color-picker/use-deprecated-props.js +9 -3
- package/build/color-picker/use-deprecated-props.js.map +1 -1
- package/build/context/context-connect.js +6 -2
- package/build/context/context-connect.js.map +1 -1
- package/build/custom-select-control-v2/legacy-component/index.js +3 -1
- package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
- package/build/drop-zone/index.js +72 -64
- package/build/drop-zone/index.js.map +1 -1
- package/build/dropdown/styles.js +5 -3
- package/build/dropdown/styles.js.map +1 -1
- package/build/duotone-picker/utils.js +3 -1
- package/build/duotone-picker/utils.js.map +1 -1
- package/build/elevation/hook.js +5 -6
- package/build/elevation/hook.js.map +1 -1
- package/build/focal-point-picker/controls.js +3 -1
- package/build/focal-point-picker/controls.js.map +1 -1
- package/build/focal-point-picker/index.js +21 -7
- package/build/focal-point-picker/index.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-picker-style.js +12 -12
- package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build/focal-point-picker/tooltip/index.native.js +3 -8
- package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build/focal-point-picker/utils.js +3 -1
- package/build/focal-point-picker/utils.js.map +1 -1
- package/build/font-size-picker/index.js +3 -2
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/types.js.map +1 -1
- package/build/input-control/input-field.js +3 -1
- package/build/input-control/input-field.js.map +1 -1
- package/build/input-control/label.js +3 -1
- package/build/input-control/label.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +31 -23
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/input-control/utils.js +8 -4
- package/build/input-control/utils.js.map +1 -1
- package/build/item-group/item/hook.js +0 -4
- package/build/item-group/item/hook.js.map +1 -1
- package/build/mobile/gradient/index.native.js +3 -1
- package/build/mobile/gradient/index.native.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.android.js +9 -3
- package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.ios.js +15 -13
- package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/shared.native.js +33 -0
- package/build/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
- package/build/modal/aria-helper.js +9 -3
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +6 -2
- package/build/modal/index.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js +12 -12
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/panel/body.js +3 -1
- package/build/panel/body.js.map +1 -1
- package/build/popover/index.js +3 -1
- package/build/popover/index.js.map +1 -1
- package/build/popover/overlay-middlewares.js +3 -1
- package/build/popover/overlay-middlewares.js.map +1 -1
- package/build/query-controls/author-select.js +3 -1
- package/build/query-controls/author-select.js.map +1 -1
- package/build/range-control/rail.js +1 -1
- package/build/range-control/rail.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +29 -29
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/resizable-box/resize-tooltip/index.js +3 -1
- package/build/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build/resizable-box/resize-tooltip/label.js +3 -1
- package/build/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build/resizable-box/resize-tooltip/utils.js +12 -4
- package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build/select-control/index.js +3 -1
- package/build/select-control/index.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +8 -6
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js +3 -3
- package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +3 -3
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/use-slot-fills.js +2 -2
- package/build/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/use-slot.js +2 -2
- package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build/slot-fill/types.js.map +1 -1
- package/build/text/get-line-height.js +6 -2
- package/build/text/get-line-height.js.map +1 -1
- package/build/text/utils.js +6 -2
- package/build/text/utils.js.map +1 -1
- package/build/theme/color-algorithms.js +6 -2
- package/build/theme/color-algorithms.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/tree-grid/roving-tab-index-item.js +3 -1
- package/build/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build/unit-control/index.js +3 -1
- package/build/unit-control/index.js.map +1 -1
- package/build/utils/colors.js +21 -7
- package/build/utils/colors.js.map +1 -1
- package/build/utils/font-size.js +3 -1
- package/build/utils/font-size.js.map +1 -1
- package/build/utils/get-valid-children.js +3 -1
- package/build/utils/get-valid-children.js.map +1 -1
- package/build/utils/input/base.js +2 -3
- package/build/utils/input/base.js.map +1 -1
- package/build/utils/strings.js +11 -57
- package/build/utils/strings.js.map +1 -1
- package/build/utils/use-responsive-value.js +3 -1
- package/build/utils/use-responsive-value.js.map +1 -1
- package/build/view/component.js +26 -8
- package/build/view/component.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +3 -1
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build-module/alignment-matrix-control/utils.js +6 -2
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +3 -1
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/autocomplete/index.js +21 -7
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/checkbox-control/index.js +9 -2
- package/build-module/checkbox-control/index.js.map +1 -1
- package/build-module/color-picker/hex-input.js +3 -1
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/hue-picker.native.js +6 -2
- package/build-module/color-picker/hue-picker.native.js.map +1 -1
- package/build-module/color-picker/index.native.js +9 -3
- package/build-module/color-picker/index.native.js.map +1 -1
- package/build-module/color-picker/saturation-picker.native.js +6 -2
- package/build-module/color-picker/saturation-picker.native.js.map +1 -1
- package/build-module/color-picker/use-deprecated-props.js +9 -3
- package/build-module/color-picker/use-deprecated-props.js.map +1 -1
- package/build-module/context/context-connect.js +6 -2
- package/build-module/context/context-connect.js.map +1 -1
- package/build-module/custom-select-control-v2/legacy-component/index.js +3 -1
- package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
- package/build-module/drop-zone/index.js +72 -64
- package/build-module/drop-zone/index.js.map +1 -1
- package/build-module/dropdown/styles.js +5 -3
- package/build-module/dropdown/styles.js.map +1 -1
- package/build-module/duotone-picker/utils.js +3 -1
- package/build-module/duotone-picker/utils.js.map +1 -1
- package/build-module/elevation/hook.js +6 -7
- package/build-module/elevation/hook.js.map +1 -1
- package/build-module/focal-point-picker/controls.js +3 -1
- package/build-module/focal-point-picker/controls.js.map +1 -1
- package/build-module/focal-point-picker/index.js +21 -7
- package/build-module/focal-point-picker/index.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js +13 -13
- package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
- package/build-module/focal-point-picker/tooltip/index.native.js +3 -8
- package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
- package/build-module/focal-point-picker/utils.js +3 -1
- package/build-module/focal-point-picker/utils.js.map +1 -1
- package/build-module/font-size-picker/index.js +3 -2
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/types.js.map +1 -1
- package/build-module/input-control/input-field.js +3 -1
- package/build-module/input-control/input-field.js.map +1 -1
- package/build-module/input-control/label.js +3 -1
- package/build-module/input-control/label.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +31 -23
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/input-control/utils.js +8 -4
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/item-group/item/hook.js +0 -4
- package/build-module/item-group/item/hook.js.map +1 -1
- package/build-module/mobile/gradient/index.native.js +3 -1
- package/build-module/mobile/gradient/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js +9 -3
- package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +16 -15
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/shared.native.js +27 -0
- package/build-module/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
- package/build-module/modal/aria-helper.js +9 -3
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +6 -2
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js +13 -13
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/panel/body.js +3 -1
- package/build-module/panel/body.js.map +1 -1
- package/build-module/popover/index.js +3 -1
- package/build-module/popover/index.js.map +1 -1
- package/build-module/popover/overlay-middlewares.js +3 -1
- package/build-module/popover/overlay-middlewares.js.map +1 -1
- package/build-module/query-controls/author-select.js +3 -1
- package/build-module/query-controls/author-select.js.map +1 -1
- package/build-module/range-control/rail.js +1 -1
- package/build-module/range-control/rail.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +30 -30
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/index.js +3 -1
- package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/label.js +3 -1
- package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/utils.js +12 -4
- package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
- package/build-module/select-control/index.js +3 -1
- package/build-module/select-control/index.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +8 -6
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +2 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build-module/slot-fill/types.js.map +1 -1
- package/build-module/text/get-line-height.js +6 -2
- package/build-module/text/get-line-height.js.map +1 -1
- package/build-module/text/utils.js +6 -2
- package/build-module/text/utils.js.map +1 -1
- package/build-module/theme/color-algorithms.js +6 -2
- package/build-module/theme/color-algorithms.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +10 -10
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/tree-grid/roving-tab-index-item.js +3 -1
- package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
- package/build-module/unit-control/index.js +3 -1
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/utils/colors.js +21 -7
- package/build-module/utils/colors.js.map +1 -1
- package/build-module/utils/font-size.js +3 -1
- package/build-module/utils/font-size.js.map +1 -1
- package/build-module/utils/get-valid-children.js +3 -1
- package/build-module/utils/get-valid-children.js.map +1 -1
- package/build-module/utils/input/base.js +2 -3
- package/build-module/utils/input/base.js.map +1 -1
- package/build-module/utils/strings.js +12 -57
- package/build-module/utils/strings.js.map +1 -1
- package/build-module/utils/use-responsive-value.js +3 -1
- package/build-module/utils/use-responsive-value.js.map +1 -1
- package/build-module/view/component.js +26 -8
- package/build-module/view/component.js.map +1 -1
- package/build-style/style-rtl.css +39 -36
- package/build-style/style.css +39 -36
- package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/utils.d.ts.map +1 -1
- package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +4 -4
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +4 -4
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +4 -4
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +4 -4
- package/build-types/border-control/border-control/hook.d.ts +4 -4
- package/build-types/border-control/border-control-dropdown/hook.d.ts +4 -4
- package/build-types/box-control/stories/index.story.d.ts +24 -24
- package/build-types/card/card/hook.d.ts +4 -4
- package/build-types/card/card-body/hook.d.ts +4 -4
- package/build-types/card/card-divider/hook.d.ts +4 -4
- package/build-types/card/card-footer/hook.d.ts +4 -4
- package/build-types/card/card-header/hook.d.ts +4 -4
- package/build-types/card/card-media/hook.d.ts +4 -4
- package/build-types/checkbox-control/index.d.ts.map +1 -1
- package/build-types/color-picker/hex-input.d.ts.map +1 -1
- package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
- package/build-types/context/context-connect.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
- package/build-types/drop-zone/index.d.ts.map +1 -1
- package/build-types/dropdown/styles.d.ts.map +1 -1
- package/build-types/duotone-picker/utils.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +4 -4
- package/build-types/elevation/hook.d.ts.map +1 -1
- package/build-types/flex/flex/hook.d.ts +4 -4
- package/build-types/flex/flex-block/hook.d.ts +4 -4
- package/build-types/flex/flex-item/hook.d.ts +4 -4
- package/build-types/focal-point-picker/controls.d.ts.map +1 -1
- package/build-types/focal-point-picker/index.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
- package/build-types/focal-point-picker/utils.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.story.d.ts.map +1 -1
- package/build-types/font-size-picker/types.d.ts +2 -0
- package/build-types/font-size-picker/types.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +4 -4
- package/build-types/h-stack/hook.d.ts +4 -4
- package/build-types/heading/hook.d.ts +4 -4
- package/build-types/input-control/input-field.d.ts.map +1 -1
- package/build-types/input-control/label.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts +2 -1
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/utils.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +5 -5
- package/build-types/item-group/item/hook.d.ts.map +1 -1
- package/build-types/item-group/item-group/hook.d.ts +4 -4
- package/build-types/modal/aria-helper.d.ts.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +4 -4
- package/build-types/navigator/navigator-button/hook.d.ts +4 -4
- package/build-types/palette-edit/styles.d.ts +749 -10
- package/build-types/palette-edit/styles.d.ts.map +1 -1
- package/build-types/panel/body.d.ts.map +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
- package/build-types/popover/stories/index.story.d.ts.map +1 -1
- package/build-types/query-controls/author-select.d.ts.map +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +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.map +1 -1
- package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +4 -4
- package/build-types/select-control/index.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
- package/build-types/slot-fill/types.d.ts +2 -2
- package/build-types/slot-fill/types.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +4 -4
- package/build-types/surface/hook.d.ts +4 -4
- package/build-types/text/get-line-height.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +4 -4
- package/build-types/text/utils.d.ts.map +1 -1
- package/build-types/text-control/index.d.ts +1 -1
- package/build-types/theme/color-algorithms.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +4 -4
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +4 -4
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +4 -4
- package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +4 -4
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/utils/colors.d.ts.map +1 -1
- package/build-types/utils/font-size.d.ts.map +1 -1
- package/build-types/utils/get-valid-children.d.ts.map +1 -1
- package/build-types/utils/input/base.d.ts.map +1 -1
- package/build-types/utils/strings.d.ts.map +1 -1
- package/build-types/utils/use-responsive-value.d.ts.map +1 -1
- package/build-types/v-stack/hook.d.ts +4 -4
- package/build-types/view/component.d.ts +253 -7
- package/build-types/view/component.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/alignment-matrix-control/index.tsx +3 -1
- package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +4 -3
- package/src/alignment-matrix-control/utils.tsx +6 -2
- package/src/autocomplete/autocompleter-ui.tsx +3 -1
- package/src/autocomplete/index.tsx +21 -7
- package/src/autocomplete/style.scss +10 -4
- package/src/box-control/test/index.tsx +22 -0
- package/src/card/test/__snapshots__/index.tsx.snap +44 -47
- package/src/checkbox-control/index.tsx +44 -35
- package/src/checkbox-control/style.scss +12 -1
- package/src/checkbox-control/test/__snapshots__/index.tsx.snap +27 -26
- package/src/checkbox-control/test/index.tsx +5 -0
- package/src/color-picker/hex-input.tsx +3 -1
- package/src/color-picker/hue-picker.native.js +6 -2
- package/src/color-picker/index.native.js +9 -3
- package/src/color-picker/saturation-picker.native.js +6 -2
- package/src/color-picker/use-deprecated-props.ts +9 -3
- package/src/context/context-connect.ts +6 -2
- package/src/custom-select-control-v2/README.md +0 -4
- package/src/custom-select-control-v2/legacy-component/index.tsx +3 -1
- package/src/custom-select-control-v2/stories/default.story.tsx +1 -1
- package/src/custom-select-control-v2/stories/legacy.story.tsx +1 -1
- package/src/drop-zone/index.tsx +66 -66
- package/src/dropdown/styles.ts +3 -1
- package/src/duotone-picker/utils.ts +3 -1
- package/src/elevation/hook.ts +6 -3
- package/src/elevation/test/__snapshots__/index.tsx.snap +18 -24
- package/src/flex/test/__snapshots__/index.tsx.snap +4 -4
- package/src/focal-point-picker/controls.tsx +3 -1
- package/src/focal-point-picker/index.tsx +20 -7
- package/src/focal-point-picker/styles/focal-point-picker-style.ts +4 -3
- package/src/focal-point-picker/tooltip/index.native.js +1 -7
- package/src/focal-point-picker/utils.ts +3 -1
- package/src/font-size-picker/README.md +1 -0
- package/src/font-size-picker/index.tsx +4 -2
- package/src/font-size-picker/stories/index.story.tsx +0 -1
- package/src/font-size-picker/types.ts +2 -0
- package/src/higher-order/navigate-regions/style.scss +3 -3
- package/src/input-control/input-field.tsx +3 -1
- package/src/input-control/label.tsx +3 -1
- package/src/input-control/stories/index.story.tsx +31 -1
- package/src/input-control/styles/input-control-styles.tsx +12 -4
- package/src/input-control/test/index.js +8 -4
- package/src/input-control/utils.ts +3 -2
- package/src/item-group/item/hook.ts +1 -10
- package/src/item-group/test/__snapshots__/index.js.snap +16 -16
- package/src/mobile/gradient/index.native.js +3 -1
- package/src/mobile/keyboard-aware-flat-list/index.android.js +11 -2
- package/src/mobile/keyboard-aware-flat-list/index.ios.js +30 -19
- package/src/mobile/keyboard-aware-flat-list/shared.native.js +26 -0
- package/src/mobile/keyboard-aware-flat-list/styles.native.scss +8 -0
- package/src/modal/aria-helper.ts +8 -3
- package/src/modal/index.tsx +6 -2
- package/src/modal/test/index.tsx +11 -4
- package/src/navigation/styles/navigation-styles.tsx +4 -3
- package/src/panel/body.tsx +3 -1
- package/src/panel/style.scss +1 -0
- package/src/placeholder/style.scss +12 -34
- package/src/popover/index.tsx +2 -1
- package/src/popover/overlay-middlewares.tsx +3 -1
- package/src/popover/stories/index.story.tsx +0 -2
- package/src/query-controls/author-select.tsx +3 -1
- package/src/range-control/rail.tsx +1 -1
- package/src/range-control/styles/range-control-styles.ts +5 -3
- package/src/resizable-box/resize-tooltip/index.tsx +3 -1
- package/src/resizable-box/resize-tooltip/label.tsx +3 -1
- package/src/resizable-box/resize-tooltip/utils.ts +12 -4
- package/src/select-control/index.tsx +3 -1
- package/src/select-control/styles/select-control-styles.ts +3 -1
- package/src/slot-fill/bubbles-virtually/slot-fill-context.ts +2 -1
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +1 -1
- package/src/slot-fill/bubbles-virtually/use-slot-fills.ts +1 -1
- package/src/slot-fill/bubbles-virtually/use-slot.ts +1 -1
- package/src/slot-fill/types.ts +2 -2
- package/src/surface/test/__snapshots__/index.tsx.snap +10 -10
- package/src/text/get-line-height.ts +6 -2
- package/src/text/utils.ts +6 -2
- package/src/theme/color-algorithms.ts +6 -2
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +18 -24
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -1
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +7 -6
- package/src/toolbar/toolbar/style.scss +2 -2
- package/src/tree-grid/roving-tab-index-item.tsx +3 -1
- package/src/unit-control/index.tsx +5 -1
- package/src/utils/colors.js +21 -7
- package/src/utils/font-size.ts +3 -1
- package/src/utils/get-valid-children.ts +3 -1
- package/src/utils/input/base.js +4 -3
- package/src/utils/strings.ts +11 -59
- package/src/utils/test/strings.js +62 -0
- package/src/utils/use-responsive-value.ts +2 -1
- package/src/view/component.tsx +18 -11
- package/tsconfig.json +1 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/build/slot-fill/bubbles-virtually/observable-map.js +0 -68
- package/build/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
- package/build/view/types.js +0 -6
- package/build/view/types.js.map +0 -1
- package/build-module/slot-fill/bubbles-virtually/observable-map.js +0 -60
- package/build-module/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
- package/build-module/view/types.js +0 -2
- package/build-module/view/types.js.map +0 -1
- package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts +0 -19
- package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts.map +0 -1
- package/build-types/view/types.d.ts +0 -8
- package/build-types/view/types.d.ts.map +0 -1
- package/src/slot-fill/bubbles-virtually/observable-map.ts +0 -79
- package/src/slot-fill/test/observable-map.js +0 -83
- package/src/utils/hooks/stories/use-cx.js +0 -157
- package/src/view/types.ts +0 -6
|
@@ -5,32 +5,33 @@ Snapshot Diff:
|
|
|
5
5
|
- First value
|
|
6
6
|
+ Second value
|
|
7
7
|
|
|
8
|
-
@@ -
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
+
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
+
|
|
19
|
-
+
|
|
20
|
-
+
|
|
21
|
-
+
|
|
22
|
-
+
|
|
23
|
-
+
|
|
24
|
-
+
|
|
25
|
-
+
|
|
26
|
-
+
|
|
27
|
-
+
|
|
28
|
-
+
|
|
29
|
-
+
|
|
30
|
-
+
|
|
31
|
-
|
|
32
|
-
+
|
|
33
|
-
|
|
8
|
+
@@ -13,14 +13,28 @@
|
|
9
|
+
<span
|
|
10
|
+
class="components-checkbox-control__input-container"
|
|
11
|
+
>
|
|
12
|
+
<input
|
|
13
|
+
class="components-checkbox-control__input"
|
|
14
|
+
- id="inspector-checkbox-control-6"
|
|
15
|
+
+ id="inspector-checkbox-control-7"
|
|
16
|
+
type="checkbox"
|
|
17
|
+
value="1"
|
|
18
|
+
+ />
|
|
19
|
+
+ <svg
|
|
20
|
+
+ aria-hidden="true"
|
|
21
|
+
+ class="components-checkbox-control__indeterminate"
|
|
22
|
+
+ focusable="false"
|
|
23
|
+
+ height="24"
|
|
24
|
+
+ role="presentation"
|
|
25
|
+
+ viewBox="0 0 24 24"
|
|
26
|
+
+ width="24"
|
|
27
|
+
+ xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
+ >
|
|
29
|
+
+ <path
|
|
30
|
+
+ d="M7 11.5h10V13H7z"
|
|
31
|
+
/>
|
|
32
|
+
+ </svg>
|
|
33
|
+
</span>
|
|
34
|
+
</div>
|
|
34
35
|
</div>
|
|
35
36
|
</div>
|
|
36
37
|
</div>
|
|
@@ -86,6 +86,11 @@ describe( 'CheckboxControl', () => {
|
|
|
86
86
|
containerIndeterminate
|
|
87
87
|
);
|
|
88
88
|
} );
|
|
89
|
+
|
|
90
|
+
it( 'should associate the `help` text accessibly', () => {
|
|
91
|
+
render( <CheckboxControl help="Help text" /> );
|
|
92
|
+
expect( getInput() ).toHaveAccessibleDescription( 'Help text' );
|
|
93
|
+
} );
|
|
89
94
|
} );
|
|
90
95
|
|
|
91
96
|
describe( 'Value', () => {
|
|
@@ -21,7 +21,9 @@ import type { HexInputProps } from './types';
|
|
|
21
21
|
|
|
22
22
|
export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {
|
|
23
23
|
const handleChange = ( nextValue: string | undefined ) => {
|
|
24
|
-
if ( ! nextValue )
|
|
24
|
+
if ( ! nextValue ) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
25
27
|
const hexValue = nextValue.startsWith( '#' )
|
|
26
28
|
? nextValue
|
|
27
29
|
: '#' + nextValue;
|
|
@@ -72,8 +72,12 @@ export default class HuePicker extends Component {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
normalizeValue( value ) {
|
|
75
|
-
if ( value < 0 )
|
|
76
|
-
|
|
75
|
+
if ( value < 0 ) {
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
if ( value > 1 ) {
|
|
79
|
+
return 1;
|
|
80
|
+
}
|
|
77
81
|
return value;
|
|
78
82
|
}
|
|
79
83
|
|
|
@@ -82,9 +82,15 @@ function ColorPicker( {
|
|
|
82
82
|
const currentColor = combineToHex();
|
|
83
83
|
|
|
84
84
|
const updateColor = ( { hue: h, saturation: s, value: v } ) => {
|
|
85
|
-
if ( h !== undefined )
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
if ( h !== undefined ) {
|
|
86
|
+
setHue( h );
|
|
87
|
+
}
|
|
88
|
+
if ( s !== undefined ) {
|
|
89
|
+
setSaturation( s );
|
|
90
|
+
}
|
|
91
|
+
if ( v !== undefined ) {
|
|
92
|
+
setValue( v );
|
|
93
|
+
}
|
|
88
94
|
setColor( combineToHex( h, s, v ) );
|
|
89
95
|
};
|
|
90
96
|
|
|
@@ -56,8 +56,12 @@ export default class SaturationValuePicker extends Component {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
normalizeValue( value ) {
|
|
59
|
-
if ( value < 0 )
|
|
60
|
-
|
|
59
|
+
if ( value < 0 ) {
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
if ( value > 1 ) {
|
|
63
|
+
return 1;
|
|
64
|
+
}
|
|
61
65
|
return value;
|
|
62
66
|
}
|
|
63
67
|
|
|
@@ -25,11 +25,17 @@ function isLegacyProps( props: any ): props is LegacyProps {
|
|
|
25
25
|
function getColorFromLegacyProps(
|
|
26
26
|
color: LegacyProps[ 'color' ]
|
|
27
27
|
): string | undefined {
|
|
28
|
-
if ( color === undefined )
|
|
28
|
+
if ( color === undefined ) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
29
31
|
|
|
30
|
-
if ( typeof color === 'string' )
|
|
32
|
+
if ( typeof color === 'string' ) {
|
|
33
|
+
return color;
|
|
34
|
+
}
|
|
31
35
|
|
|
32
|
-
if ( color.hex )
|
|
36
|
+
if ( color.hex ) {
|
|
37
|
+
return color.hex;
|
|
38
|
+
}
|
|
33
39
|
|
|
34
40
|
return undefined;
|
|
35
41
|
}
|
|
@@ -116,7 +116,9 @@ function _contextConnect<
|
|
|
116
116
|
export function getConnectNamespace(
|
|
117
117
|
Component: ReactChild | undefined | {}
|
|
118
118
|
): string[] {
|
|
119
|
-
if ( ! Component )
|
|
119
|
+
if ( ! Component ) {
|
|
120
|
+
return [];
|
|
121
|
+
}
|
|
120
122
|
|
|
121
123
|
let namespaces = [];
|
|
122
124
|
|
|
@@ -145,7 +147,9 @@ export function hasConnectNamespace(
|
|
|
145
147
|
Component: ReactNode,
|
|
146
148
|
match: string[] | string
|
|
147
149
|
): boolean {
|
|
148
|
-
if ( ! Component )
|
|
150
|
+
if ( ! Component ) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
149
153
|
|
|
150
154
|
if ( typeof match === 'string' ) {
|
|
151
155
|
return getConnectNamespace( Component ).includes( match );
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
# CustomSelectControlV2
|
|
2
2
|
|
|
3
|
-
<div class="callout callout-alert">
|
|
4
|
-
This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
3
|
Used to render a customizable select control component.
|
|
8
4
|
|
|
9
5
|
## Development guidelines
|
|
@@ -30,7 +30,9 @@ function CustomSelectControl( props: LegacyCustomSelectProps ) {
|
|
|
30
30
|
// Forward props + store from v2 implementation
|
|
31
31
|
const store = Ariakit.useSelectStore( {
|
|
32
32
|
async setValue( nextValue ) {
|
|
33
|
-
if ( ! onChange )
|
|
33
|
+
if ( ! onChange ) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
34
36
|
|
|
35
37
|
// Executes the logic in a microtask after the popup is closed.
|
|
36
38
|
// This is simply to ensure the isOpen state matches that in Downshift.
|
|
@@ -14,7 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import CustomSelectControlV2 from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof CustomSelectControlV2 > = {
|
|
17
|
-
title: 'Components
|
|
17
|
+
title: 'Components/CustomSelectControl v2/Default',
|
|
18
18
|
component: CustomSelectControlV2,
|
|
19
19
|
subcomponents: {
|
|
20
20
|
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
@@ -15,7 +15,7 @@ import CustomSelectControl from '../legacy-component';
|
|
|
15
15
|
import * as V1Story from '../../custom-select-control/stories/index.story';
|
|
16
16
|
|
|
17
17
|
const meta: Meta< typeof CustomSelectControl > = {
|
|
18
|
-
title: 'Components
|
|
18
|
+
title: 'Components/CustomSelectControl v2/Legacy',
|
|
19
19
|
component: CustomSelectControl,
|
|
20
20
|
argTypes: {
|
|
21
21
|
onChange: { control: { type: null } },
|
package/src/drop-zone/index.tsx
CHANGED
|
@@ -25,6 +25,71 @@ import {
|
|
|
25
25
|
import type { DropType, DropZoneProps } from './types';
|
|
26
26
|
import type { WordPressComponentProps } from '../context';
|
|
27
27
|
|
|
28
|
+
const backdrop = {
|
|
29
|
+
hidden: { opacity: 0 },
|
|
30
|
+
show: {
|
|
31
|
+
opacity: 1,
|
|
32
|
+
transition: {
|
|
33
|
+
type: 'tween',
|
|
34
|
+
duration: 0.2,
|
|
35
|
+
delay: 0,
|
|
36
|
+
delayChildren: 0.1,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
exit: {
|
|
40
|
+
opacity: 0,
|
|
41
|
+
transition: {
|
|
42
|
+
duration: 0.2,
|
|
43
|
+
delayChildren: 0,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const foreground = {
|
|
49
|
+
hidden: { opacity: 0, scale: 0.9 },
|
|
50
|
+
show: {
|
|
51
|
+
opacity: 1,
|
|
52
|
+
scale: 1,
|
|
53
|
+
transition: {
|
|
54
|
+
duration: 0.1,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
exit: { opacity: 0, scale: 0.9 },
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
function DropIndicator( { label }: { label?: string } ) {
|
|
61
|
+
const disableMotion = useReducedMotion();
|
|
62
|
+
const children = (
|
|
63
|
+
<motion.div
|
|
64
|
+
variants={ backdrop }
|
|
65
|
+
initial={ disableMotion ? 'show' : 'hidden' }
|
|
66
|
+
animate="show"
|
|
67
|
+
exit={ disableMotion ? 'show' : 'exit' }
|
|
68
|
+
className="components-drop-zone__content"
|
|
69
|
+
// Without this, when this div is shown,
|
|
70
|
+
// Safari calls a onDropZoneLeave causing a loop because of this bug
|
|
71
|
+
// https://bugs.webkit.org/show_bug.cgi?id=66547
|
|
72
|
+
style={ { pointerEvents: 'none' } }
|
|
73
|
+
>
|
|
74
|
+
<motion.div variants={ foreground }>
|
|
75
|
+
<Icon
|
|
76
|
+
icon={ upload }
|
|
77
|
+
className="components-drop-zone__content-icon"
|
|
78
|
+
/>
|
|
79
|
+
<span className="components-drop-zone__content-text">
|
|
80
|
+
{ label ? label : __( 'Drop files to upload' ) }
|
|
81
|
+
</span>
|
|
82
|
+
</motion.div>
|
|
83
|
+
</motion.div>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
if ( disableMotion ) {
|
|
87
|
+
return children;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return <AnimatePresence>{ children }</AnimatePresence>;
|
|
91
|
+
}
|
|
92
|
+
|
|
28
93
|
/**
|
|
29
94
|
* `DropZone` is a component creating a drop zone area taking the full size of its parent element. It supports dropping files, HTML content or any other HTML drop event.
|
|
30
95
|
*
|
|
@@ -116,67 +181,6 @@ export function DropZoneComponent( {
|
|
|
116
181
|
setIsDraggingOverElement( false );
|
|
117
182
|
},
|
|
118
183
|
} );
|
|
119
|
-
const disableMotion = useReducedMotion();
|
|
120
|
-
|
|
121
|
-
let children;
|
|
122
|
-
const backdrop = {
|
|
123
|
-
hidden: { opacity: 0 },
|
|
124
|
-
show: {
|
|
125
|
-
opacity: 1,
|
|
126
|
-
transition: {
|
|
127
|
-
type: 'tween',
|
|
128
|
-
duration: 0.2,
|
|
129
|
-
delay: 0,
|
|
130
|
-
delayChildren: 0.1,
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
exit: {
|
|
134
|
-
opacity: 0,
|
|
135
|
-
transition: {
|
|
136
|
-
duration: 0.2,
|
|
137
|
-
delayChildren: 0,
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
const foreground = {
|
|
143
|
-
hidden: { opacity: 0, scale: 0.9 },
|
|
144
|
-
show: {
|
|
145
|
-
opacity: 1,
|
|
146
|
-
scale: 1,
|
|
147
|
-
transition: {
|
|
148
|
-
duration: 0.1,
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
exit: { opacity: 0, scale: 0.9 },
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
if ( isDraggingOverElement ) {
|
|
155
|
-
children = (
|
|
156
|
-
<motion.div
|
|
157
|
-
variants={ backdrop }
|
|
158
|
-
initial={ disableMotion ? 'show' : 'hidden' }
|
|
159
|
-
animate="show"
|
|
160
|
-
exit={ disableMotion ? 'show' : 'exit' }
|
|
161
|
-
className="components-drop-zone__content"
|
|
162
|
-
// Without this, when this div is shown,
|
|
163
|
-
// Safari calls a onDropZoneLeave causing a loop because of this bug
|
|
164
|
-
// https://bugs.webkit.org/show_bug.cgi?id=66547
|
|
165
|
-
style={ { pointerEvents: 'none' } }
|
|
166
|
-
>
|
|
167
|
-
<motion.div variants={ foreground }>
|
|
168
|
-
<Icon
|
|
169
|
-
icon={ upload }
|
|
170
|
-
className="components-drop-zone__content-icon"
|
|
171
|
-
/>
|
|
172
|
-
<span className="components-drop-zone__content-text">
|
|
173
|
-
{ label ? label : __( 'Drop files to upload' ) }
|
|
174
|
-
</span>
|
|
175
|
-
</motion.div>
|
|
176
|
-
</motion.div>
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
184
|
const classes = classnames( 'components-drop-zone', className, {
|
|
181
185
|
'is-active':
|
|
182
186
|
( isDraggingOverDocument || isDraggingOverElement ) &&
|
|
@@ -190,11 +194,7 @@ export function DropZoneComponent( {
|
|
|
190
194
|
|
|
191
195
|
return (
|
|
192
196
|
<div { ...restProps } ref={ ref } className={ classes }>
|
|
193
|
-
{
|
|
194
|
-
children
|
|
195
|
-
) : (
|
|
196
|
-
<AnimatePresence>{ children }</AnimatePresence>
|
|
197
|
-
) }
|
|
197
|
+
{ isDraggingOverElement && <DropIndicator label={ label } /> }
|
|
198
198
|
</div>
|
|
199
199
|
);
|
|
200
200
|
}
|
package/src/dropdown/styles.ts
CHANGED
|
@@ -11,7 +11,9 @@ import { space } from '../utils/space';
|
|
|
11
11
|
import type { DropdownContentWrapperProps } from './types';
|
|
12
12
|
|
|
13
13
|
const padding = ( { paddingSize = 'small' }: DropdownContentWrapperProps ) => {
|
|
14
|
-
if ( paddingSize === 'none' )
|
|
14
|
+
if ( paddingSize === 'none' ) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
15
17
|
|
|
16
18
|
const paddingValues = {
|
|
17
19
|
small: space( 2 ),
|
|
@@ -31,7 +31,9 @@ export function getDefaultColors(
|
|
|
31
31
|
palette: DuotonePickerProps[ 'colorPalette' ]
|
|
32
32
|
) {
|
|
33
33
|
// A default dark and light color are required.
|
|
34
|
-
if ( ! palette || palette.length < 2 )
|
|
34
|
+
if ( ! palette || palette.length < 2 ) {
|
|
35
|
+
return [ '#000', '#fff' ];
|
|
36
|
+
}
|
|
35
37
|
|
|
36
38
|
return palette
|
|
37
39
|
.map( ( { color } ) => ( {
|
package/src/elevation/hook.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { useMemo } from '@wordpress/element';
|
|
|
15
15
|
import type { WordPressComponentProps } from '../context';
|
|
16
16
|
import { useContextSystem } from '../context';
|
|
17
17
|
import * as styles from './styles';
|
|
18
|
-
import { CONFIG
|
|
18
|
+
import { CONFIG } from '../utils';
|
|
19
19
|
import { useCx } from '../utils/hooks/use-cx';
|
|
20
20
|
import { isValueDefined } from '../utils/values';
|
|
21
21
|
import type { ElevationProps } from './types';
|
|
@@ -76,9 +76,12 @@ export function useElevation(
|
|
|
76
76
|
left: offset,
|
|
77
77
|
right: offset,
|
|
78
78
|
top: offset,
|
|
79
|
-
transition,
|
|
80
79
|
},
|
|
81
|
-
|
|
80
|
+
css`
|
|
81
|
+
@media not ( prefers-reduced-motion ) {
|
|
82
|
+
transition: ${ transition };
|
|
83
|
+
}
|
|
84
|
+
`
|
|
82
85
|
);
|
|
83
86
|
|
|
84
87
|
if ( isValueDefined( hoverValue ) ) {
|
|
@@ -15,13 +15,12 @@ exports[`props should render active 1`] = `
|
|
|
15
15
|
left: 0;
|
|
16
16
|
right: 0;
|
|
17
17
|
top: 0;
|
|
18
|
-
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
19
|
-
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
20
18
|
}
|
|
21
19
|
|
|
22
|
-
@media ( prefers-reduced-motion
|
|
20
|
+
@media not ( prefers-reduced-motion ) {
|
|
23
21
|
.emotion-0 {
|
|
24
|
-
transition
|
|
22
|
+
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
23
|
+
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
|
|
@@ -57,13 +56,12 @@ exports[`props should render correctly 1`] = `
|
|
|
57
56
|
left: 0;
|
|
58
57
|
right: 0;
|
|
59
58
|
top: 0;
|
|
60
|
-
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
61
|
-
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
62
59
|
}
|
|
63
60
|
|
|
64
|
-
@media ( prefers-reduced-motion
|
|
61
|
+
@media not ( prefers-reduced-motion ) {
|
|
65
62
|
.emotion-0 {
|
|
66
|
-
transition
|
|
63
|
+
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
64
|
+
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
|
|
@@ -91,13 +89,12 @@ exports[`props should render hover 1`] = `
|
|
|
91
89
|
left: 0;
|
|
92
90
|
right: 0;
|
|
93
91
|
top: 0;
|
|
94
|
-
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
95
|
-
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
96
92
|
}
|
|
97
93
|
|
|
98
|
-
@media ( prefers-reduced-motion
|
|
94
|
+
@media not ( prefers-reduced-motion ) {
|
|
99
95
|
.emotion-0 {
|
|
100
|
-
transition
|
|
96
|
+
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
97
|
+
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
101
98
|
}
|
|
102
99
|
}
|
|
103
100
|
|
|
@@ -129,13 +126,12 @@ exports[`props should render isInteractive 1`] = `
|
|
|
129
126
|
left: 0;
|
|
130
127
|
right: 0;
|
|
131
128
|
top: 0;
|
|
132
|
-
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
133
|
-
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
134
129
|
}
|
|
135
130
|
|
|
136
|
-
@media ( prefers-reduced-motion
|
|
131
|
+
@media not ( prefers-reduced-motion ) {
|
|
137
132
|
.emotion-0 {
|
|
138
|
-
transition
|
|
133
|
+
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
134
|
+
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
139
135
|
}
|
|
140
136
|
}
|
|
141
137
|
|
|
@@ -171,13 +167,12 @@ exports[`props should render offset 1`] = `
|
|
|
171
167
|
left: -2px;
|
|
172
168
|
right: -2px;
|
|
173
169
|
top: -2px;
|
|
174
|
-
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
175
|
-
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
176
170
|
}
|
|
177
171
|
|
|
178
|
-
@media ( prefers-reduced-motion
|
|
172
|
+
@media not ( prefers-reduced-motion ) {
|
|
179
173
|
.emotion-0 {
|
|
180
|
-
transition
|
|
174
|
+
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
175
|
+
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
181
176
|
}
|
|
182
177
|
}
|
|
183
178
|
|
|
@@ -213,13 +208,12 @@ exports[`props should render value 1`] = `
|
|
|
213
208
|
left: 0;
|
|
214
209
|
right: 0;
|
|
215
210
|
top: 0;
|
|
216
|
-
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
217
|
-
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
218
211
|
}
|
|
219
212
|
|
|
220
|
-
@media ( prefers-reduced-motion
|
|
213
|
+
@media not ( prefers-reduced-motion ) {
|
|
221
214
|
.emotion-0 {
|
|
222
|
-
transition
|
|
215
|
+
-webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
216
|
+
transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
223
217
|
}
|
|
224
218
|
}
|
|
225
219
|
|
|
@@ -7,25 +7,25 @@ Snapshot Diff:
|
|
|
7
7
|
|
|
8
8
|
@@ -1,22 +1,18 @@
|
|
9
9
|
<div
|
|
10
|
-
class="components-flex css-
|
|
10
|
+
class="components-flex css-1hwd9hm-PolymorphicDiv-Flex-base-ItemsRow e19lxcc00"
|
|
11
11
|
- data-testid="flex"
|
|
12
12
|
+ data-testid="base-flex"
|
|
13
13
|
data-wp-c16t="true"
|
|
14
14
|
data-wp-component="Flex"
|
|
15
15
|
>
|
|
16
16
|
<div
|
|
17
|
-
class="components-flex-item css-
|
|
17
|
+
class="components-flex-item css-eno349-PolymorphicDiv-Item-sx-Base e19lxcc00"
|
|
18
18
|
data-wp-c16t="true"
|
|
19
19
|
data-wp-component="FlexItem"
|
|
20
20
|
>
|
|
21
21
|
Item
|
|
22
22
|
</div>
|
|
23
23
|
- <div
|
|
24
|
-
- class="css-
|
|
24
|
+
- class="css-161q9d5-PolymorphicDiv e19lxcc00"
|
|
25
25
|
- />
|
|
26
26
|
- <div />
|
|
27
27
|
<div
|
|
28
|
-
class="components-flex-item components-flex-block css-
|
|
28
|
+
class="components-flex-item components-flex-block css-10m3u8l-PolymorphicDiv-Item-sx-Base-block e19lxcc00"
|
|
29
29
|
data-wp-c16t="true"
|
|
30
30
|
data-wp-component="FlexBlock"
|
|
31
31
|
>
|
|
@@ -38,7 +38,9 @@ export default function FocalPointPickerControls( {
|
|
|
38
38
|
value: Parameters< UnitControlOnChangeCallback >[ 0 ],
|
|
39
39
|
axis: FocalPointAxis
|
|
40
40
|
) => {
|
|
41
|
-
if ( value === undefined )
|
|
41
|
+
if ( value === undefined ) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
42
44
|
|
|
43
45
|
const num = parseInt( value, 10 );
|
|
44
46
|
|
|
@@ -111,7 +111,9 @@ export function FocalPointPicker( {
|
|
|
111
111
|
|
|
112
112
|
// `value` can technically be undefined if getValueWithinDragArea() is
|
|
113
113
|
// called before dragAreaRef is set, but this shouldn't happen in reality.
|
|
114
|
-
if ( ! value )
|
|
114
|
+
if ( ! value ) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
115
117
|
|
|
116
118
|
onDragStart?.( value, event );
|
|
117
119
|
setPoint( value );
|
|
@@ -120,7 +122,9 @@ export function FocalPointPicker( {
|
|
|
120
122
|
// Prevents text-selection when dragging.
|
|
121
123
|
event.preventDefault();
|
|
122
124
|
const value = getValueWithinDragArea( event );
|
|
123
|
-
if ( ! value )
|
|
125
|
+
if ( ! value ) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
124
128
|
onDrag?.( value, event );
|
|
125
129
|
setPoint( value );
|
|
126
130
|
},
|
|
@@ -136,7 +140,9 @@ export function FocalPointPicker( {
|
|
|
136
140
|
const dragAreaRef = useRef< HTMLDivElement >( null );
|
|
137
141
|
const [ bounds, setBounds ] = useState( INITIAL_BOUNDS );
|
|
138
142
|
const refUpdateBounds = useRef( () => {
|
|
139
|
-
if ( ! dragAreaRef.current )
|
|
143
|
+
if ( ! dragAreaRef.current ) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
140
146
|
|
|
141
147
|
const { clientWidth: width, clientHeight: height } =
|
|
142
148
|
dragAreaRef.current;
|
|
@@ -150,7 +156,9 @@ export function FocalPointPicker( {
|
|
|
150
156
|
|
|
151
157
|
useEffect( () => {
|
|
152
158
|
const updateBounds = refUpdateBounds.current;
|
|
153
|
-
if ( ! dragAreaRef.current )
|
|
159
|
+
if ( ! dragAreaRef.current ) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
154
162
|
|
|
155
163
|
const { defaultView } = dragAreaRef.current.ownerDocument;
|
|
156
164
|
defaultView?.addEventListener( 'resize', updateBounds );
|
|
@@ -171,7 +179,9 @@ export function FocalPointPicker( {
|
|
|
171
179
|
clientY: number;
|
|
172
180
|
shiftKey: boolean;
|
|
173
181
|
} ) => {
|
|
174
|
-
if ( ! dragAreaRef.current )
|
|
182
|
+
if ( ! dragAreaRef.current ) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
175
185
|
|
|
176
186
|
const { top, left } = dragAreaRef.current.getBoundingClientRect();
|
|
177
187
|
let nextX = ( clientX - left ) / bounds.width;
|
|
@@ -203,8 +213,9 @@ export function FocalPointPicker( {
|
|
|
203
213
|
! [ 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight' ].includes(
|
|
204
214
|
code
|
|
205
215
|
)
|
|
206
|
-
)
|
|
216
|
+
) {
|
|
207
217
|
return;
|
|
218
|
+
}
|
|
208
219
|
|
|
209
220
|
event.preventDefault();
|
|
210
221
|
const value = { x, y };
|
|
@@ -253,7 +264,9 @@ export function FocalPointPicker( {
|
|
|
253
264
|
onKeyDown={ arrowKeyStep }
|
|
254
265
|
onMouseDown={ startDrag }
|
|
255
266
|
onBlur={ () => {
|
|
256
|
-
if ( isDragging )
|
|
267
|
+
if ( isDragging ) {
|
|
268
|
+
endDrag();
|
|
269
|
+
}
|
|
257
270
|
} }
|
|
258
271
|
ref={ dragAreaRef }
|
|
259
272
|
role="button"
|
|
@@ -9,7 +9,7 @@ import styled from '@emotion/styled';
|
|
|
9
9
|
*/
|
|
10
10
|
import { Flex } from '../../flex';
|
|
11
11
|
import UnitControl from '../../unit-control';
|
|
12
|
-
import { COLORS, CONFIG
|
|
12
|
+
import { COLORS, CONFIG } from '../../utils';
|
|
13
13
|
import type { FocalPointPickerControlsProps } from '../types';
|
|
14
14
|
import { INITIAL_BOUNDS } from '../utils';
|
|
15
15
|
|
|
@@ -106,10 +106,11 @@ export const GridView = styled.div`
|
|
|
106
106
|
position: absolute;
|
|
107
107
|
top: 50%;
|
|
108
108
|
transform: translate3d( -50%, -50%, 0 );
|
|
109
|
-
transition: opacity 100ms linear;
|
|
110
109
|
z-index: 1;
|
|
111
110
|
|
|
112
|
-
|
|
111
|
+
@media not ( prefers-reduced-motion ) {
|
|
112
|
+
transition: opacity 100ms linear;
|
|
113
|
+
}
|
|
113
114
|
|
|
114
115
|
opacity: ${ ( { showOverlay }: { showOverlay?: boolean } ) =>
|
|
115
116
|
showOverlay ? 1 : 0 };
|