@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
package/src/panel/body.tsx
CHANGED
|
@@ -109,7 +109,9 @@ const PanelBodyTitle = forwardRef(
|
|
|
109
109
|
}: WordPressComponentProps< PanelBodyTitleProps, 'button' >,
|
|
110
110
|
ref: React.ForwardedRef< any >
|
|
111
111
|
) => {
|
|
112
|
-
if ( ! title )
|
|
112
|
+
if ( ! title ) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
113
115
|
|
|
114
116
|
return (
|
|
115
117
|
<h2 className="components-panel__body-title">
|
package/src/panel/style.scss
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
font-size: $default-font-size;
|
|
4
4
|
box-sizing: border-box;
|
|
5
5
|
position: relative;
|
|
6
|
-
padding:
|
|
6
|
+
padding: $grid-unit-30;
|
|
7
7
|
width: 100%;
|
|
8
8
|
text-align: left;
|
|
9
9
|
margin: 0;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
align-items: flex-start;
|
|
14
|
+
gap: $grid-unit-20;
|
|
14
15
|
|
|
15
16
|
// Some editor styles unset this.
|
|
16
17
|
-moz-font-smoothing: subpixel-antialiased;
|
|
@@ -38,15 +39,14 @@
|
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
.components-placeholder__label {
|
|
41
|
-
display: flex;
|
|
42
42
|
font-weight: 600;
|
|
43
|
-
margin-bottom: $grid-unit-20;
|
|
44
43
|
align-items: center;
|
|
44
|
+
display: flex;
|
|
45
45
|
|
|
46
46
|
> svg,
|
|
47
47
|
.dashicon,
|
|
48
48
|
.block-editor-block-icon {
|
|
49
|
-
margin-right: $grid-unit-
|
|
49
|
+
margin-right: $grid-unit-05;
|
|
50
50
|
fill: currentColor;
|
|
51
51
|
// Optimizate for high contrast modes.
|
|
52
52
|
// See also https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/.
|
|
@@ -67,6 +67,8 @@
|
|
|
67
67
|
flex-direction: row;
|
|
68
68
|
width: 100%;
|
|
69
69
|
flex-wrap: wrap;
|
|
70
|
+
gap: $grid-unit-15;
|
|
71
|
+
justify-content: flex-start;
|
|
70
72
|
|
|
71
73
|
p {
|
|
72
74
|
font-family: $default-font;
|
|
@@ -85,24 +87,11 @@
|
|
|
85
87
|
flex: 1 1 auto;
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
.components-placeholder__instructions {
|
|
89
|
-
margin-bottom: 1em;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
90
|
.components-placeholder__error {
|
|
93
|
-
margin-top: 1em;
|
|
94
91
|
width: 100%;
|
|
92
|
+
gap: $grid-unit-10;
|
|
95
93
|
}
|
|
96
94
|
|
|
97
|
-
.components-placeholder__fieldset .components-button {
|
|
98
|
-
margin-right: $grid-unit-15;
|
|
99
|
-
margin-bottom: $grid-unit-15; // If buttons wrap we need vertical space between.
|
|
100
|
-
|
|
101
|
-
&:last-child {
|
|
102
|
-
margin-bottom: 0;
|
|
103
|
-
margin-right: 0;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
95
|
|
|
107
96
|
// Any `<Button />` component with `variant="link"` prop will need extra spacing if placed
|
|
108
97
|
// immediately after a button which is *not* an `variant="link"` style button. This is because
|
|
@@ -119,14 +108,6 @@
|
|
|
119
108
|
|
|
120
109
|
// Element queries to show different layouts at various sizes.
|
|
121
110
|
.components-placeholder {
|
|
122
|
-
// Medium and large sizes.
|
|
123
|
-
&.is-large {
|
|
124
|
-
.components-placeholder__label {
|
|
125
|
-
font-size: 18pt;
|
|
126
|
-
font-weight: normal;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
111
|
// Medium and small sizes.
|
|
131
112
|
&.is-medium,
|
|
132
113
|
&.is-small {
|
|
@@ -139,16 +120,15 @@
|
|
|
139
120
|
flex-direction: column;
|
|
140
121
|
}
|
|
141
122
|
|
|
142
|
-
.components-placeholder__fieldset
|
|
143
|
-
|
|
123
|
+
.components-placeholder__fieldset > *,
|
|
124
|
+
.components-button {
|
|
125
|
+
width: 100%;
|
|
126
|
+
justify-content: center;
|
|
144
127
|
}
|
|
145
128
|
}
|
|
146
129
|
|
|
147
|
-
// Small sizes.
|
|
148
130
|
&.is-small {
|
|
149
|
-
|
|
150
|
-
padding: 0 $grid-unit-10 2px;
|
|
151
|
-
}
|
|
131
|
+
padding: $grid-unit-20;
|
|
152
132
|
}
|
|
153
133
|
}
|
|
154
134
|
|
|
@@ -179,8 +159,6 @@
|
|
|
179
159
|
}
|
|
180
160
|
|
|
181
161
|
.components-placeholder__fieldset {
|
|
182
|
-
width: auto;
|
|
183
|
-
|
|
184
162
|
// Unset intrinsic margins.
|
|
185
163
|
margin-left: 0;
|
|
186
164
|
margin-right: 0;
|
package/src/popover/index.tsx
CHANGED
|
@@ -226,8 +226,9 @@ const UnforwardedPopover = (
|
|
|
226
226
|
const { firstElementChild } = refs.floating.current ?? {};
|
|
227
227
|
|
|
228
228
|
// Only HTMLElement instances have the `style` property.
|
|
229
|
-
if ( ! ( firstElementChild instanceof HTMLElement ) )
|
|
229
|
+
if ( ! ( firstElementChild instanceof HTMLElement ) ) {
|
|
230
230
|
return;
|
|
231
|
+
}
|
|
231
232
|
|
|
232
233
|
// Reduce the height of the popover to the available space.
|
|
233
234
|
Object.assign( firstElementChild.style, {
|
|
@@ -17,7 +17,9 @@ export function overlayMiddlewares() {
|
|
|
17
17
|
const { firstElementChild } = elements.floating ?? {};
|
|
18
18
|
|
|
19
19
|
// Only HTMLElement instances have the `style` property.
|
|
20
|
-
if ( ! ( firstElementChild instanceof HTMLElement ) )
|
|
20
|
+
if ( ! ( firstElementChild instanceof HTMLElement ) ) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
21
23
|
|
|
22
24
|
// Reduce the height of the popover to the available space.
|
|
23
25
|
Object.assign( firstElementChild.style, {
|
|
@@ -7,8 +7,6 @@ import type { StoryFn, Meta } from '@storybook/react';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { useState, useRef, useEffect } from '@wordpress/element';
|
|
10
|
-
// @ts-expect-error The `@wordpress/block-editor` is not typed
|
|
11
|
-
import { __unstableIframe as Iframe } from '@wordpress/block-editor';
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
12
|
* Internal dependencies
|
|
@@ -13,7 +13,9 @@ export default function AuthorSelect( {
|
|
|
13
13
|
selectedAuthorId,
|
|
14
14
|
onChange: onChangeProp,
|
|
15
15
|
}: AuthorSelectProps ) {
|
|
16
|
-
if ( ! authorList )
|
|
16
|
+
if ( ! authorList ) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
17
19
|
const termsTree = buildTermsTree( authorList );
|
|
18
20
|
return (
|
|
19
21
|
<TreeSelect
|
|
@@ -92,7 +92,7 @@ function useMarks( {
|
|
|
92
92
|
if ( ! Array.isArray( marks ) ) {
|
|
93
93
|
marks = [];
|
|
94
94
|
const count = 1 + Math.round( range / step );
|
|
95
|
-
while ( count > marks.push( { value: step * marks.length + min } ) )
|
|
95
|
+
while ( count > marks.push( { value: step * marks.length + min } ) ) {}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
const placedMarks: RangeMarkProps[] = [];
|
|
@@ -8,7 +8,7 @@ import styled from '@emotion/styled';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
import NumberControl from '../../number-control';
|
|
11
|
-
import { COLORS,
|
|
11
|
+
import { COLORS, rtl } from '../../utils';
|
|
12
12
|
import { space } from '../../utils/space';
|
|
13
13
|
|
|
14
14
|
import type {
|
|
@@ -287,13 +287,15 @@ export const Tooltip = styled.span< TooltipProps >`
|
|
|
287
287
|
pointer-events: none;
|
|
288
288
|
position: absolute;
|
|
289
289
|
text-align: center;
|
|
290
|
-
transition: opacity 120ms ease;
|
|
291
290
|
user-select: none;
|
|
292
291
|
line-height: 1.4;
|
|
293
292
|
|
|
293
|
+
@media not ( prefers-reduced-motion ) {
|
|
294
|
+
transition: opacity 120ms ease;
|
|
295
|
+
}
|
|
296
|
+
|
|
294
297
|
${ tooltipShow };
|
|
295
298
|
${ tooltipPosition };
|
|
296
|
-
${ reduceMotion( 'transition' ) };
|
|
297
299
|
${ rtl(
|
|
298
300
|
{ transform: 'translateX(-50%)' },
|
|
299
301
|
{ transform: 'translateX(50%)' }
|
|
@@ -41,7 +41,9 @@ function Label(
|
|
|
41
41
|
const isBottom = position === POSITIONS.bottom;
|
|
42
42
|
const isCorner = position === POSITIONS.corner;
|
|
43
43
|
|
|
44
|
-
if ( ! showLabel )
|
|
44
|
+
if ( ! showLabel ) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
45
47
|
|
|
46
48
|
let style: React.CSSProperties = {
|
|
47
49
|
opacity: showLabel ? 1 : undefined,
|
|
@@ -90,7 +90,9 @@ export function useResizeLabel( {
|
|
|
90
90
|
* If axis is controlled, we will avoid resetting the moveX and moveY values.
|
|
91
91
|
* This will allow for the preferred axis values to persist in the label.
|
|
92
92
|
*/
|
|
93
|
-
if ( isAxisControlled )
|
|
93
|
+
if ( isAxisControlled ) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
94
96
|
setMoveX( false );
|
|
95
97
|
setMoveY( false );
|
|
96
98
|
};
|
|
@@ -109,12 +111,16 @@ export function useResizeLabel( {
|
|
|
109
111
|
*/
|
|
110
112
|
const isRendered = width !== null || height !== null;
|
|
111
113
|
|
|
112
|
-
if ( ! isRendered )
|
|
114
|
+
if ( ! isRendered ) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
113
117
|
|
|
114
118
|
const didWidthChange = width !== widthRef.current;
|
|
115
119
|
const didHeightChange = height !== heightRef.current;
|
|
116
120
|
|
|
117
|
-
if ( ! didWidthChange && ! didHeightChange )
|
|
121
|
+
if ( ! didWidthChange && ! didHeightChange ) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
118
124
|
|
|
119
125
|
/*
|
|
120
126
|
* After the initial render, the useResizeAware will set the first
|
|
@@ -194,7 +200,9 @@ function getSizeLabel( {
|
|
|
194
200
|
showPx = false,
|
|
195
201
|
width,
|
|
196
202
|
}: GetSizeLabelArgs ): string | undefined {
|
|
197
|
-
if ( ! moveX && ! moveY )
|
|
203
|
+
if ( ! moveX && ! moveY ) {
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
198
206
|
|
|
199
207
|
/*
|
|
200
208
|
* Corner position...
|
|
@@ -55,7 +55,9 @@ function UnforwardedSelectControl(
|
|
|
55
55
|
const helpId = help ? `${ id }__help` : undefined;
|
|
56
56
|
|
|
57
57
|
// Disable reason: A select with an onchange throws a warning.
|
|
58
|
-
if ( ! options?.length && ! children )
|
|
58
|
+
if ( ! options?.length && ! children ) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
59
61
|
|
|
60
62
|
const handleOnChange = (
|
|
61
63
|
event: React.ChangeEvent< HTMLSelectElement >
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { createContext } from '@wordpress/element';
|
|
5
5
|
import warning from '@wordpress/warning';
|
|
6
|
+
import { observableMap } from '@wordpress/compose';
|
|
7
|
+
|
|
6
8
|
/**
|
|
7
9
|
* Internal dependencies
|
|
8
10
|
*/
|
|
9
11
|
import type { SlotFillBubblesVirtuallyContext } from '../types';
|
|
10
|
-
import { observableMap } from './observable-map';
|
|
11
12
|
|
|
12
13
|
const initialContextValue: SlotFillBubblesVirtuallyContext = {
|
|
13
14
|
slots: observableMap(),
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useMemo } from '@wordpress/element';
|
|
5
5
|
import isShallowEqual from '@wordpress/is-shallow-equal';
|
|
6
|
+
import { observableMap } from '@wordpress/compose';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -12,7 +13,6 @@ import type {
|
|
|
12
13
|
SlotFillProviderProps,
|
|
13
14
|
SlotFillBubblesVirtuallyContext,
|
|
14
15
|
} from '../types';
|
|
15
|
-
import { observableMap } from './observable-map';
|
|
16
16
|
|
|
17
17
|
function createSlotRegistry(): SlotFillBubblesVirtuallyContext {
|
|
18
18
|
const slots: SlotFillBubblesVirtuallyContext[ 'slots' ] = observableMap();
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useContext } from '@wordpress/element';
|
|
5
|
+
import { useObservableValue } from '@wordpress/compose';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
8
9
|
*/
|
|
9
10
|
import SlotFillContext from './slot-fill-context';
|
|
10
11
|
import type { SlotKey } from '../types';
|
|
11
|
-
import { useObservableValue } from './observable-map';
|
|
12
12
|
|
|
13
13
|
export default function useSlotFills( name: SlotKey ) {
|
|
14
14
|
const registry = useContext( SlotFillContext );
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useMemo, useContext } from '@wordpress/element';
|
|
5
|
+
import { useObservableValue } from '@wordpress/compose';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
@@ -13,7 +14,6 @@ import type {
|
|
|
13
14
|
FillProps,
|
|
14
15
|
SlotKey,
|
|
15
16
|
} from '../types';
|
|
16
|
-
import { useObservableValue } from './observable-map';
|
|
17
17
|
|
|
18
18
|
export default function useSlot( name: SlotKey ) {
|
|
19
19
|
const registry = useContext( SlotFillContext );
|
package/src/slot-fill/types.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import type { Component, MutableRefObject, ReactNode, RefObject } from 'react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import type { ObservableMap } from '
|
|
9
|
+
import type { ObservableMap } from '@wordpress/compose';
|
|
10
10
|
|
|
11
11
|
export type DistributiveOmit< T, K extends keyof any > = T extends any
|
|
12
12
|
? Omit< T, K >
|
|
@@ -8,8 +8,8 @@ Snapshot Diff:
|
|
|
8
8
|
@@ -1,8 +1,8 @@
|
|
9
9
|
<div>
|
|
10
10
|
<div
|
|
11
|
-
- class="components-surface css-
|
|
12
|
-
+ class="components-surface css-
|
|
11
|
+
- class="components-surface css-1bmtyqd-PolymorphicDiv-Surface-getBorders-primary e19lxcc00"
|
|
12
|
+
+ class="components-surface css-1u146xf-PolymorphicDiv-Surface-getBorders-primary e19lxcc00"
|
|
13
13
|
data-wp-c16t="true"
|
|
14
14
|
data-wp-component="Surface"
|
|
15
15
|
>
|
|
@@ -25,8 +25,8 @@ Snapshot Diff:
|
|
|
25
25
|
@@ -1,8 +1,8 @@
|
|
26
26
|
<div>
|
|
27
27
|
<div
|
|
28
|
-
- class="components-surface css-
|
|
29
|
-
+ class="components-surface css-
|
|
28
|
+
- class="components-surface css-iin9ud-PolymorphicDiv-Surface-getBorders-primary e19lxcc00"
|
|
29
|
+
+ class="components-surface css-1u146xf-PolymorphicDiv-Surface-getBorders-primary e19lxcc00"
|
|
30
30
|
data-wp-c16t="true"
|
|
31
31
|
data-wp-component="Surface"
|
|
32
32
|
>
|
|
@@ -42,8 +42,8 @@ Snapshot Diff:
|
|
|
42
42
|
@@ -1,8 +1,8 @@
|
|
43
43
|
<div>
|
|
44
44
|
<div
|
|
45
|
-
- class="components-surface css-
|
|
46
|
-
+ class="components-surface css-
|
|
45
|
+
- class="components-surface css-4j30ez-PolymorphicDiv-Surface-getBorders-primary e19lxcc00"
|
|
46
|
+
+ class="components-surface css-1u146xf-PolymorphicDiv-Surface-getBorders-primary e19lxcc00"
|
|
47
47
|
data-wp-c16t="true"
|
|
48
48
|
data-wp-component="Surface"
|
|
49
49
|
>
|
|
@@ -59,8 +59,8 @@ Snapshot Diff:
|
|
|
59
59
|
@@ -1,8 +1,8 @@
|
|
60
60
|
<div>
|
|
61
61
|
<div
|
|
62
|
-
- class="components-surface css-
|
|
63
|
-
+ class="components-surface css-
|
|
62
|
+
- class="components-surface css-1v7smm4-PolymorphicDiv-Surface-getBorders-primary e19lxcc00"
|
|
63
|
+
+ class="components-surface css-1u146xf-PolymorphicDiv-Surface-getBorders-primary e19lxcc00"
|
|
64
64
|
data-wp-c16t="true"
|
|
65
65
|
data-wp-component="Surface"
|
|
66
66
|
>
|
|
@@ -94,8 +94,8 @@ Snapshot Diff:
|
|
|
94
94
|
@@ -1,8 +1,8 @@
|
|
95
95
|
<div>
|
|
96
96
|
<div
|
|
97
|
-
- class="components-surface css-
|
|
98
|
-
+ class="components-surface css-
|
|
97
|
+
- class="components-surface css-1afnk4j-PolymorphicDiv-Surface-getBorders-secondary e19lxcc00"
|
|
98
|
+
+ class="components-surface css-1u146xf-PolymorphicDiv-Surface-getBorders-primary e19lxcc00"
|
|
99
99
|
data-wp-c16t="true"
|
|
100
100
|
data-wp-component="Surface"
|
|
101
101
|
>
|
|
@@ -14,9 +14,13 @@ export function getLineHeight(
|
|
|
14
14
|
adjustLineHeightForInnerControls: Props[ 'adjustLineHeightForInnerControls' ],
|
|
15
15
|
lineHeight: CSSProperties[ 'lineHeight' ]
|
|
16
16
|
) {
|
|
17
|
-
if ( lineHeight )
|
|
17
|
+
if ( lineHeight ) {
|
|
18
|
+
return lineHeight;
|
|
19
|
+
}
|
|
18
20
|
|
|
19
|
-
if ( ! adjustLineHeightForInnerControls )
|
|
21
|
+
if ( ! adjustLineHeightForInnerControls ) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
20
24
|
|
|
21
25
|
let value = `calc(${ CONFIG.controlHeight } + ${ space( 2 ) })`;
|
|
22
26
|
|
package/src/text/utils.ts
CHANGED
|
@@ -99,8 +99,12 @@ export function createHighlighterText( {
|
|
|
99
99
|
unhighlightClassName = '',
|
|
100
100
|
unhighlightStyle,
|
|
101
101
|
}: Options ) {
|
|
102
|
-
if ( ! children )
|
|
103
|
-
|
|
102
|
+
if ( ! children ) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
if ( typeof children !== 'string' ) {
|
|
106
|
+
return children;
|
|
107
|
+
}
|
|
104
108
|
|
|
105
109
|
const textToHighlight = children;
|
|
106
110
|
|
|
@@ -76,7 +76,9 @@ function warnContrastIssues( issues: ReturnType< typeof checkContrasts > ) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
function generateAccentDependentColors( accent?: string ) {
|
|
79
|
-
if ( ! accent )
|
|
79
|
+
if ( ! accent ) {
|
|
80
|
+
return {};
|
|
81
|
+
}
|
|
80
82
|
|
|
81
83
|
return {
|
|
82
84
|
accent,
|
|
@@ -87,7 +89,9 @@ function generateAccentDependentColors( accent?: string ) {
|
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
function generateBackgroundDependentColors( background?: string ) {
|
|
90
|
-
if ( ! background )
|
|
92
|
+
if ( ! background ) {
|
|
93
|
+
return {};
|
|
94
|
+
}
|
|
91
95
|
|
|
92
96
|
const foreground = getForegroundForColor( background );
|
|
93
97
|
|
|
@@ -107,8 +107,6 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
107
107
|
padding: 0 12px;
|
|
108
108
|
position: relative;
|
|
109
109
|
text-align: center;
|
|
110
|
-
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
111
|
-
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
112
110
|
-webkit-user-select: none;
|
|
113
111
|
-moz-user-select: none;
|
|
114
112
|
-ms-user-select: none;
|
|
@@ -123,9 +121,10 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
123
121
|
color: #fff;
|
|
124
122
|
}
|
|
125
123
|
|
|
126
|
-
@media ( prefers-reduced-motion
|
|
124
|
+
@media not ( prefers-reduced-motion ) {
|
|
127
125
|
.emotion-12 {
|
|
128
|
-
transition
|
|
126
|
+
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
127
|
+
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
129
128
|
}
|
|
130
129
|
}
|
|
131
130
|
|
|
@@ -190,8 +189,6 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
190
189
|
padding: 0 12px;
|
|
191
190
|
position: relative;
|
|
192
191
|
text-align: center;
|
|
193
|
-
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
194
|
-
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
195
192
|
-webkit-user-select: none;
|
|
196
193
|
-moz-user-select: none;
|
|
197
194
|
-ms-user-select: none;
|
|
@@ -205,9 +202,10 @@ exports[`ToggleGroupControl controlled should render correctly with icons 1`] =
|
|
|
205
202
|
padding-right: 0;
|
|
206
203
|
}
|
|
207
204
|
|
|
208
|
-
@media ( prefers-reduced-motion
|
|
205
|
+
@media not ( prefers-reduced-motion ) {
|
|
209
206
|
.emotion-18 {
|
|
210
|
-
transition
|
|
207
|
+
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
208
|
+
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
211
209
|
}
|
|
212
210
|
}
|
|
213
211
|
|
|
@@ -436,8 +434,6 @@ exports[`ToggleGroupControl controlled should render correctly with text options
|
|
|
436
434
|
padding: 0 12px;
|
|
437
435
|
position: relative;
|
|
438
436
|
text-align: center;
|
|
439
|
-
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
440
|
-
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
441
437
|
-webkit-user-select: none;
|
|
442
438
|
-moz-user-select: none;
|
|
443
439
|
-ms-user-select: none;
|
|
@@ -446,9 +442,10 @@ exports[`ToggleGroupControl controlled should render correctly with text options
|
|
|
446
442
|
z-index: 2;
|
|
447
443
|
}
|
|
448
444
|
|
|
449
|
-
@media ( prefers-reduced-motion
|
|
445
|
+
@media not ( prefers-reduced-motion ) {
|
|
450
446
|
.emotion-12 {
|
|
451
|
-
transition
|
|
447
|
+
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
448
|
+
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
452
449
|
}
|
|
453
450
|
}
|
|
454
451
|
|
|
@@ -656,8 +653,6 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
656
653
|
padding: 0 12px;
|
|
657
654
|
position: relative;
|
|
658
655
|
text-align: center;
|
|
659
|
-
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
660
|
-
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
661
656
|
-webkit-user-select: none;
|
|
662
657
|
-moz-user-select: none;
|
|
663
658
|
-ms-user-select: none;
|
|
@@ -672,9 +667,10 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
672
667
|
color: #fff;
|
|
673
668
|
}
|
|
674
669
|
|
|
675
|
-
@media ( prefers-reduced-motion
|
|
670
|
+
@media not ( prefers-reduced-motion ) {
|
|
676
671
|
.emotion-12 {
|
|
677
|
-
transition
|
|
672
|
+
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
673
|
+
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
678
674
|
}
|
|
679
675
|
}
|
|
680
676
|
|
|
@@ -739,8 +735,6 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
739
735
|
padding: 0 12px;
|
|
740
736
|
position: relative;
|
|
741
737
|
text-align: center;
|
|
742
|
-
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
743
|
-
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
744
738
|
-webkit-user-select: none;
|
|
745
739
|
-moz-user-select: none;
|
|
746
740
|
-ms-user-select: none;
|
|
@@ -754,9 +748,10 @@ exports[`ToggleGroupControl uncontrolled should render correctly with icons 1`]
|
|
|
754
748
|
padding-right: 0;
|
|
755
749
|
}
|
|
756
750
|
|
|
757
|
-
@media ( prefers-reduced-motion
|
|
751
|
+
@media not ( prefers-reduced-motion ) {
|
|
758
752
|
.emotion-18 {
|
|
759
|
-
transition
|
|
753
|
+
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
754
|
+
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
760
755
|
}
|
|
761
756
|
}
|
|
762
757
|
|
|
@@ -979,8 +974,6 @@ exports[`ToggleGroupControl uncontrolled should render correctly with text optio
|
|
|
979
974
|
padding: 0 12px;
|
|
980
975
|
position: relative;
|
|
981
976
|
text-align: center;
|
|
982
|
-
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
983
|
-
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
984
977
|
-webkit-user-select: none;
|
|
985
978
|
-moz-user-select: none;
|
|
986
979
|
-ms-user-select: none;
|
|
@@ -989,9 +982,10 @@ exports[`ToggleGroupControl uncontrolled should render correctly with text optio
|
|
|
989
982
|
z-index: 2;
|
|
990
983
|
}
|
|
991
984
|
|
|
992
|
-
@media ( prefers-reduced-motion
|
|
985
|
+
@media not ( prefers-reduced-motion ) {
|
|
993
986
|
.emotion-12 {
|
|
994
|
-
transition
|
|
987
|
+
-webkit-transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
988
|
+
transition: background 160ms linear,color 160ms linear,font-weight 60ms linear;
|
|
995
989
|
}
|
|
996
990
|
}
|
|
997
991
|
|
|
@@ -147,7 +147,9 @@ function ToggleGroupControlOptionBase(
|
|
|
147
147
|
{ ...commonProps }
|
|
148
148
|
onFocus={ ( event ) => {
|
|
149
149
|
onFocusProp?.( event );
|
|
150
|
-
if ( event.defaultPrevented )
|
|
150
|
+
if ( event.defaultPrevented ) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
151
153
|
toggleGroupControlContext.setValue( value );
|
|
152
154
|
} }
|
|
153
155
|
/>
|
|
@@ -7,7 +7,7 @@ import styled from '@emotion/styled';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import { CONFIG, COLORS
|
|
10
|
+
import { CONFIG, COLORS } from '../../utils';
|
|
11
11
|
import type {
|
|
12
12
|
ToggleGroupControlProps,
|
|
13
13
|
ToggleGroupControlOptionBaseProps,
|
|
@@ -50,11 +50,12 @@ export const buttonView = ( {
|
|
|
50
50
|
padding: 0 12px;
|
|
51
51
|
position: relative;
|
|
52
52
|
text-align: center;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
@media not ( prefers-reduced-motion ) {
|
|
54
|
+
transition:
|
|
55
|
+
background ${ CONFIG.transitionDurationFast } linear,
|
|
56
|
+
color ${ CONFIG.transitionDurationFast } linear,
|
|
57
|
+
font-weight 60ms linear;
|
|
58
|
+
}
|
|
58
59
|
user-select: none;
|
|
59
60
|
width: 100%;
|
|
60
61
|
z-index: 2;
|