@wordpress/components 28.6.0 → 28.8.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 +122 -0
- package/CONTRIBUTING.md +42 -19
- package/build/alignment-matrix-control/cell.js +4 -7
- package/build/alignment-matrix-control/cell.js.map +1 -1
- package/build/alignment-matrix-control/icon.js +31 -19
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/index.js +55 -51
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/styles.js +73 -0
- package/build/alignment-matrix-control/styles.js.map +1 -0
- package/build/alignment-matrix-control/types.js.map +1 -1
- package/build/angle-picker-control/angle-circle.js +9 -9
- package/build/angle-picker-control/angle-circle.js.map +1 -1
- package/build/border-control/border-control/component.js +18 -13
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/box-control/all-input-control.js +1 -2
- package/build/box-control/all-input-control.js.map +1 -1
- package/build/box-control/utils.js +1 -1
- package/build/box-control/utils.js.map +1 -1
- package/build/card/card/component.js +2 -2
- package/build/card/card/component.js.map +1 -1
- package/build/card/styles.js +18 -18
- package/build/card/styles.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker-option.js +15 -9
- package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build/circular-option-picker/circular-option-picker.js +15 -12
- package/build/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build/circular-option-picker/types.js.map +1 -1
- package/build/clipboard-button/index.js +6 -6
- package/build/clipboard-button/index.js.map +1 -1
- package/build/color-palette/utils.js +1 -2
- package/build/color-palette/utils.js.map +1 -1
- package/build/color-picker/color-copy-button.js +8 -8
- package/build/color-picker/color-copy-button.js.map +1 -1
- package/build/color-picker/hex-input.js +8 -8
- package/build/color-picker/hex-input.js.map +1 -1
- package/build/color-picker/input-with-slider.js +8 -8
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/color-picker/styles.js +8 -8
- package/build/color-picker/styles.js.map +1 -1
- package/build/combobox-control/index.js +3 -1
- package/build/combobox-control/index.js.map +1 -1
- package/build/combobox-control/types.js.map +1 -1
- package/build/composite/context.js +1 -1
- package/build/composite/context.js.map +1 -1
- package/build/composite/group-label.js +33 -0
- package/build/composite/group-label.js.map +1 -0
- package/build/composite/group.js +33 -0
- package/build/composite/group.js.map +1 -0
- package/build/composite/hover.js +33 -0
- package/build/composite/hover.js.map +1 -0
- package/build/composite/index.js +63 -118
- package/build/composite/index.js.map +1 -1
- package/build/composite/item.js +33 -0
- package/build/composite/item.js.map +1 -0
- package/build/composite/legacy/index.js +59 -7
- package/build/composite/legacy/index.js.map +1 -1
- package/build/composite/row.js +33 -0
- package/build/composite/row.js.map +1 -0
- package/build/composite/typeahead.js +33 -0
- package/build/composite/typeahead.js.map +1 -0
- package/build/composite/types.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/control-points.js +8 -8
- package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build/custom-select-control-v2/styles.js +12 -14
- package/build/custom-select-control-v2/styles.js.map +1 -1
- package/build/date-time/date/index.js +1 -1
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date/styles.js +37 -26
- package/build/date-time/date/styles.js.map +1 -1
- package/build/date-time/date/use-lilius/index.js +163 -0
- package/build/date-time/date/use-lilius/index.js.map +1 -0
- package/build/date-time/time/time-input/index.js +17 -19
- package/build/date-time/time/time-input/index.js.map +1 -1
- package/build/dimension-control/index.js +6 -1
- package/build/dimension-control/index.js.map +1 -1
- package/build/draggable/index.js +4 -4
- package/build/draggable/index.js.map +1 -1
- package/build/dropdown-menu-v2/checkbox-item.js +69 -0
- package/build/dropdown-menu-v2/checkbox-item.js.map +1 -0
- package/build/dropdown-menu-v2/context.js +17 -0
- package/build/dropdown-menu-v2/context.js.map +1 -0
- package/build/dropdown-menu-v2/group-label.js +40 -0
- package/build/dropdown-menu-v2/group-label.js.map +1 -0
- package/build/dropdown-menu-v2/group.js +29 -0
- package/build/dropdown-menu-v2/group.js.map +1 -0
- package/build/dropdown-menu-v2/index.js +58 -146
- package/build/dropdown-menu-v2/index.js.map +1 -1
- package/build/dropdown-menu-v2/item-help-text.js +27 -0
- package/build/dropdown-menu-v2/item-help-text.js.map +1 -0
- package/build/dropdown-menu-v2/item-label.js +27 -0
- package/build/dropdown-menu-v2/item-label.js.map +1 -0
- package/build/dropdown-menu-v2/item.js +53 -0
- package/build/dropdown-menu-v2/item.js.map +1 -0
- package/build/dropdown-menu-v2/radio-item.js +79 -0
- package/build/dropdown-menu-v2/radio-item.js.map +1 -0
- package/build/dropdown-menu-v2/separator.js +30 -0
- package/build/dropdown-menu-v2/separator.js.map +1 -0
- package/build/dropdown-menu-v2/styles.js +55 -79
- package/build/dropdown-menu-v2/styles.js.map +1 -1
- package/build/dropdown-menu-v2/types.js.map +1 -1
- package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js +27 -0
- package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
- package/build/focal-point-picker/styles/focal-point-style.js +7 -2
- package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build/form-token-field/types.js.map +1 -1
- package/build/index.js +13 -0
- package/build/index.js.map +1 -1
- package/build/input-control/index.js +2 -2
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +5 -10
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/input-prefix-wrapper.js +3 -3
- package/build/input-control/input-prefix-wrapper.js.map +1 -1
- package/build/input-control/input-suffix-wrapper.js +2 -3
- package/build/input-control/input-suffix-wrapper.js.map +1 -1
- package/build/input-control/reducer/reducer.js +8 -8
- package/build/input-control/reducer/reducer.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +75 -45
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/input-control/types.js.map +1 -1
- package/build/input-control/utils.js +3 -3
- package/build/input-control/utils.js.map +1 -1
- package/build/item-group/styles.js +10 -10
- package/build/item-group/styles.js.map +1 -1
- package/build/modal/index.js +32 -17
- package/build/modal/index.js.map +1 -1
- package/build/modal/types.js.map +1 -1
- package/build/modal/use-modal-exit-animation.js +75 -0
- package/build/modal/use-modal-exit-animation.js.map +1 -0
- package/build/navigation/index.js +4 -4
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/styles/navigation-styles.js +13 -13
- package/build/navigation/styles/navigation-styles.js.map +1 -1
- package/build/navigator/index.js +12 -13
- package/build/navigator/index.js.map +1 -1
- package/build/navigator/navigator-back-button/hook.js +2 -2
- package/build/navigator/navigator-back-button/hook.js.map +1 -1
- package/build/navigator/navigator-button/hook.js +2 -2
- package/build/navigator/navigator-button/hook.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +99 -67
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +5 -0
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/navigator-to-parent-button/component.js +2 -2
- package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build/navigator/types.js.map +1 -1
- package/build/navigator/use-navigator.js +1 -2
- package/build/navigator/use-navigator.js.map +1 -1
- package/build/palette-edit/index.js +2 -2
- package/build/palette-edit/index.js.map +1 -1
- package/build/private-apis.js +1 -14
- package/build/private-apis.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +30 -30
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
- package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build/select-control/styles/select-control-styles.js +12 -12
- package/build/select-control/styles/select-control-styles.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +4 -4
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/slot-fill/index.js +1 -0
- package/build/slot-fill/index.js.map +1 -1
- package/build/snackbar/index.js +4 -4
- package/build/snackbar/index.js.map +1 -1
- package/build/tabs/index.js +4 -4
- package/build/tabs/index.js.map +1 -1
- package/build/tabs/styles.js +3 -3
- package/build/tabs/styles.js.map +1 -1
- package/build/tabs/tablist.js +5 -4
- package/build/tabs/tablist.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/utils.js +6 -6
- package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +6 -6
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +7 -7
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/utils/config-values.js +10 -9
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/element-rect.js +73 -105
- package/build/utils/element-rect.js.map +1 -1
- package/build/utils/hooks/use-update-effect.js +4 -4
- package/build/utils/hooks/use-update-effect.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js +2 -5
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js +31 -19
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +55 -50
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/styles.js +70 -0
- package/build-module/alignment-matrix-control/styles.js.map +1 -0
- package/build-module/alignment-matrix-control/types.js.map +1 -1
- package/build-module/angle-picker-control/angle-circle.js +9 -9
- package/build-module/angle-picker-control/angle-circle.js.map +1 -1
- package/build-module/border-control/border-control/component.js +18 -13
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/box-control/all-input-control.js +2 -2
- package/build-module/box-control/all-input-control.js.map +1 -1
- package/build-module/box-control/utils.js +1 -1
- package/build-module/box-control/utils.js.map +1 -1
- package/build-module/card/card/component.js +2 -2
- package/build-module/card/card/component.js.map +1 -1
- package/build-module/card/styles.js +18 -18
- package/build-module/card/styles.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker-option.js +16 -10
- package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
- package/build-module/circular-option-picker/circular-option-picker.js +16 -13
- package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
- package/build-module/circular-option-picker/types.js.map +1 -1
- package/build-module/clipboard-button/index.js +6 -6
- package/build-module/clipboard-button/index.js.map +1 -1
- package/build-module/color-palette/utils.js +1 -2
- package/build-module/color-palette/utils.js.map +1 -1
- package/build-module/color-picker/color-copy-button.js +8 -8
- package/build-module/color-picker/color-copy-button.js.map +1 -1
- package/build-module/color-picker/hex-input.js +7 -8
- package/build-module/color-picker/hex-input.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +7 -8
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/color-picker/styles.js +8 -8
- package/build-module/color-picker/styles.js.map +1 -1
- package/build-module/combobox-control/index.js +3 -1
- package/build-module/combobox-control/index.js.map +1 -1
- package/build-module/combobox-control/types.js.map +1 -1
- package/build-module/composite/context.js +1 -1
- package/build-module/composite/context.js.map +1 -1
- package/build-module/composite/group-label.js +25 -0
- package/build-module/composite/group-label.js.map +1 -0
- package/build-module/composite/group.js +25 -0
- package/build-module/composite/group.js.map +1 -0
- package/build-module/composite/hover.js +25 -0
- package/build-module/composite/hover.js.map +1 -0
- package/build-module/composite/index.js +64 -118
- package/build-module/composite/index.js.map +1 -1
- package/build-module/composite/item.js +25 -0
- package/build-module/composite/item.js.map +1 -0
- package/build-module/composite/legacy/index.js +57 -8
- package/build-module/composite/legacy/index.js.map +1 -1
- package/build-module/composite/row.js +25 -0
- package/build-module/composite/row.js.map +1 -0
- package/build-module/composite/typeahead.js +25 -0
- package/build-module/composite/typeahead.js.map +1 -0
- package/build-module/composite/types.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -8
- package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
- package/build-module/custom-select-control-v2/styles.js +12 -14
- package/build-module/custom-select-control-v2/styles.js.map +1 -1
- package/build-module/date-time/date/index.js +1 -2
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date/styles.js +33 -26
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/date-time/date/use-lilius/index.js +158 -0
- package/build-module/date-time/date/use-lilius/index.js.map +1 -0
- package/build-module/date-time/time/time-input/index.js +17 -19
- package/build-module/date-time/time/time-input/index.js.map +1 -1
- package/build-module/dimension-control/index.js +6 -1
- package/build-module/dimension-control/index.js.map +1 -1
- package/build-module/draggable/index.js +4 -4
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/checkbox-item.js +62 -0
- package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -0
- package/build-module/dropdown-menu-v2/context.js +11 -0
- package/build-module/dropdown-menu-v2/context.js.map +1 -0
- package/build-module/dropdown-menu-v2/group-label.js +32 -0
- package/build-module/dropdown-menu-v2/group-label.js.map +1 -0
- package/build-module/dropdown-menu-v2/group.js +21 -0
- package/build-module/dropdown-menu-v2/group.js.map +1 -0
- package/build-module/dropdown-menu-v2/index.js +57 -144
- package/build-module/dropdown-menu-v2/index.js.map +1 -1
- package/build-module/dropdown-menu-v2/item-help-text.js +19 -0
- package/build-module/dropdown-menu-v2/item-help-text.js.map +1 -0
- package/build-module/dropdown-menu-v2/item-label.js +19 -0
- package/build-module/dropdown-menu-v2/item-label.js.map +1 -0
- package/build-module/dropdown-menu-v2/item.js +46 -0
- package/build-module/dropdown-menu-v2/item.js.map +1 -0
- package/build-module/dropdown-menu-v2/radio-item.js +72 -0
- package/build-module/dropdown-menu-v2/radio-item.js.map +1 -0
- package/build-module/dropdown-menu-v2/separator.js +22 -0
- package/build-module/dropdown-menu-v2/separator.js.map +1 -0
- package/build-module/dropdown-menu-v2/styles.js +55 -79
- package/build-module/dropdown-menu-v2/styles.js.map +1 -1
- package/build-module/dropdown-menu-v2/types.js.map +1 -1
- package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js +20 -0
- package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
- package/build-module/focal-point-picker/styles/focal-point-style.js +6 -2
- package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build-module/form-token-field/types.js.map +1 -1
- package/build-module/index.js +3 -1
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/index.js +2 -2
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +6 -11
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/input-prefix-wrapper.js +4 -3
- package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
- package/build-module/input-control/input-suffix-wrapper.js +3 -3
- package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
- package/build-module/input-control/reducer/reducer.js +8 -8
- package/build-module/input-control/reducer/reducer.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +74 -44
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/input-control/types.js.map +1 -1
- package/build-module/input-control/utils.js +3 -3
- package/build-module/input-control/utils.js.map +1 -1
- package/build-module/item-group/styles.js +10 -10
- package/build-module/item-group/styles.js.map +1 -1
- package/build-module/modal/index.js +34 -17
- package/build-module/modal/index.js.map +1 -1
- package/build-module/modal/types.js.map +1 -1
- package/build-module/modal/use-modal-exit-animation.js +68 -0
- package/build-module/modal/use-modal-exit-animation.js.map +1 -0
- package/build-module/navigation/index.js +4 -4
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/styles/navigation-styles.js +14 -14
- package/build-module/navigation/styles/navigation-styles.js.map +1 -1
- package/build-module/navigator/index.js +6 -6
- package/build-module/navigator/index.js.map +1 -1
- package/build-module/navigator/navigator-back-button/hook.js +1 -1
- package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-button/hook.js +1 -1
- package/build-module/navigator/navigator-button/hook.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +99 -67
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +4 -0
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/navigator-to-parent-button/component.js +1 -1
- package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
- package/build-module/navigator/types.js.map +1 -1
- package/build-module/navigator/use-navigator.js +1 -2
- package/build-module/navigator/use-navigator.js.map +1 -1
- package/build-module/palette-edit/index.js +2 -2
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/private-apis.js +1 -14
- package/build-module/private-apis.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +31 -31
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
- package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
- package/build-module/select-control/styles/select-control-styles.js +13 -13
- package/build-module/select-control/styles/select-control-styles.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +4 -4
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/slot-fill/index.js +1 -0
- package/build-module/slot-fill/index.js.map +1 -1
- package/build-module/snackbar/index.js +4 -4
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/tabs/index.js +4 -4
- package/build-module/tabs/index.js.map +1 -1
- package/build-module/tabs/styles.js +4 -4
- package/build-module/tabs/styles.js.map +1 -1
- package/build-module/tabs/tablist.js +5 -4
- package/build-module/tabs/tablist.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/utils.js +6 -6
- package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +6 -6
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +7 -7
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/utils/config-values.js +10 -9
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/element-rect.js +74 -105
- package/build-module/utils/element-rect.js.map +1 -1
- package/build-module/utils/hooks/use-update-effect.js +4 -4
- package/build-module/utils/hooks/use-update-effect.js.map +1 -1
- package/build-style/style-rtl.css +60 -31
- package/build-style/style.css +60 -31
- package/build-types/alignment-matrix-control/cell.d.ts +1 -1
- package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/icon.d.ts +1 -1
- package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/index.d.ts +16 -6
- package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
- package/build-types/alignment-matrix-control/{styles/alignment-matrix-control-styles.d.ts → styles.d.ts} +9 -10
- package/build-types/alignment-matrix-control/styles.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/types.d.ts +12 -1
- package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
- package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/box-control/all-input-control.d.ts.map +1 -1
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/box-control/utils.d.ts +1 -1
- package/build-types/box-control/utils.d.ts.map +1 -1
- package/build-types/button-group/stories/index.story.d.ts +2 -2
- package/build-types/button-group/stories/index.story.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
- package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
- package/build-types/circular-option-picker/types.d.ts +2 -2
- package/build-types/circular-option-picker/types.d.ts.map +1 -1
- package/build-types/color-palette/utils.d.ts.map +1 -1
- package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
- package/build-types/color-picker/hex-input.d.ts.map +1 -1
- package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/combobox-control/index.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts +4 -0
- package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/types.d.ts +5 -0
- package/build-types/combobox-control/types.d.ts.map +1 -1
- package/build-types/composite/context.d.ts.map +1 -1
- package/build-types/composite/group-label.d.ts +3 -0
- package/build-types/composite/group-label.d.ts.map +1 -0
- package/build-types/composite/group.d.ts +3 -0
- package/build-types/composite/group.d.ts.map +1 -0
- package/build-types/composite/hover.d.ts +3 -0
- package/build-types/composite/hover.d.ts.map +1 -0
- package/build-types/composite/index.d.ts +63 -47
- package/build-types/composite/index.d.ts.map +1 -1
- package/build-types/composite/item.d.ts +3 -0
- package/build-types/composite/item.d.ts.map +1 -0
- package/build-types/composite/legacy/index.d.ts +23 -3
- package/build-types/composite/legacy/index.d.ts.map +1 -1
- package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/row.d.ts +3 -0
- package/build-types/composite/row.d.ts.map +1 -0
- package/build-types/composite/stories/index.story.d.ts +9 -8
- package/build-types/composite/stories/index.story.d.ts.map +1 -1
- package/build-types/composite/typeahead.d.ts +3 -0
- package/build-types/composite/typeahead.d.ts.map +1 -0
- package/build-types/composite/types.d.ts +12 -11
- package/build-types/composite/types.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts +0 -3
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/date-time/date/test/use-lilius.d.ts +2 -0
- package/build-types/date-time/date/test/use-lilius.d.ts.map +1 -0
- package/build-types/date-time/date/use-lilius/index.d.ts +169 -0
- package/build-types/date-time/date/use-lilius/index.d.ts.map +1 -0
- package/build-types/date-time/time/time-input/index.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts +1 -1
- package/build-types/dimension-control/index.d.ts.map +1 -1
- package/build-types/dimension-control/stories/index.story.d.ts +5 -0
- package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/checkbox-item.d.ts +3 -0
- package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/context.d.ts +6 -0
- package/build-types/dropdown-menu-v2/context.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/group-label.d.ts +3 -0
- package/build-types/dropdown-menu-v2/group-label.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/group.d.ts +3 -0
- package/build-types/dropdown-menu-v2/group.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/index.d.ts +39 -18
- package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/item-help-text.d.ts +6 -0
- package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/item-label.d.ts +6 -0
- package/build-types/dropdown-menu-v2/item-label.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/item.d.ts +3 -0
- package/build-types/dropdown-menu-v2/item.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/radio-item.d.ts +3 -0
- package/build-types/dropdown-menu-v2/radio-item.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/separator.d.ts +3 -0
- package/build-types/dropdown-menu-v2/separator.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts +10 -10
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/styles.d.ts +14 -6
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/types.d.ts +6 -0
- package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
- package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts +8 -0
- package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +1 -0
- package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
- package/build-types/form-token-field/types.d.ts +1 -0
- package/build-types/form-token-field/types.d.ts.map +1 -1
- package/build-types/index.d.ts +4 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/input-prefix-wrapper.d.ts +2 -2
- package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
- package/build-types/input-control/input-suffix-wrapper.d.ts +2 -2
- package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
- package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts +9 -0
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts +15 -9
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +23 -6
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/stories/index.story.d.ts +3 -0
- package/build-types/modal/stories/index.story.d.ts.map +1 -1
- package/build-types/modal/types.d.ts +6 -10
- package/build-types/modal/types.d.ts.map +1 -1
- package/build-types/modal/use-modal-exit-animation.d.ts +9 -0
- package/build-types/modal/use-modal-exit-animation.d.ts.map +1 -0
- package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
- package/build-types/navigator/index.d.ts +6 -6
- package/build-types/navigator/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/stories/index.story.d.ts +1 -1
- package/build-types/navigator/stories/index.story.d.ts.map +1 -1
- package/build-types/navigator/types.d.ts +3 -1
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/navigator/use-navigator.d.ts +1 -2
- package/build-types/navigator/use-navigator.d.ts.map +1 -1
- package/build-types/private-apis.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/styles/resize-tooltip.styles.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/slot-fill/index.d.ts +3 -0
- package/build-types/slot-fill/index.d.ts.map +1 -1
- package/build-types/tabs/index.d.ts.map +1 -1
- package/build-types/tabs/styles.d.ts.map +1 -1
- package/build-types/tabs/tablist.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +3 -4
- package/build-types/utils/element-rect.d.ts +32 -74
- package/build-types/utils/element-rect.d.ts.map +1 -1
- package/package.json +19 -20
- package/src/alignment-matrix-control/README.md +1 -5
- package/src/alignment-matrix-control/cell.tsx +3 -9
- package/src/alignment-matrix-control/icon.tsx +48 -30
- package/src/alignment-matrix-control/index.tsx +60 -50
- package/src/alignment-matrix-control/stories/index.story.tsx +3 -12
- package/src/alignment-matrix-control/styles.ts +113 -0
- package/src/alignment-matrix-control/types.ts +12 -1
- package/src/angle-picker-control/angle-circle.tsx +11 -9
- package/src/border-control/border-control/component.tsx +23 -16
- package/src/box-control/README.md +7 -0
- package/src/box-control/all-input-control.tsx +2 -3
- package/src/box-control/utils.ts +1 -1
- package/src/button-group/stories/index.story.tsx +10 -15
- package/src/card/card/component.tsx +1 -1
- package/src/card/styles.ts +1 -1
- package/src/card/test/__snapshots__/index.tsx.snap +54 -54
- package/src/circular-option-picker/circular-option-picker-option.tsx +16 -19
- package/src/circular-option-picker/circular-option-picker.tsx +26 -12
- package/src/circular-option-picker/types.ts +2 -2
- package/src/clipboard-button/index.tsx +6 -6
- package/src/color-palette/test/utils.ts +21 -2
- package/src/color-palette/utils.ts +1 -3
- package/src/color-picker/color-copy-button.tsx +10 -8
- package/src/color-picker/hex-input.tsx +6 -10
- package/src/color-picker/input-with-slider.tsx +6 -10
- package/src/color-picker/styles.ts +1 -1
- package/src/combobox-control/README.md +7 -0
- package/src/combobox-control/index.tsx +2 -0
- package/src/combobox-control/test/index.tsx +40 -0
- package/src/combobox-control/types.ts +5 -0
- package/src/composite/README.md +5 -24
- package/src/composite/{context.ts → context.tsx} +1 -2
- package/src/composite/group-label.tsx +30 -0
- package/src/composite/group.tsx +30 -0
- package/src/composite/hover.tsx +30 -0
- package/src/composite/index.tsx +71 -166
- package/src/composite/item.tsx +30 -0
- package/src/composite/legacy/index.tsx +73 -11
- package/src/composite/legacy/stories/index.story.tsx +2 -1
- package/src/composite/legacy/test/index.tsx +57 -1
- package/src/composite/row.tsx +30 -0
- package/src/composite/stories/index.story.tsx +254 -365
- package/src/composite/typeahead.tsx +30 -0
- package/src/composite/types.ts +14 -16
- package/src/custom-gradient-picker/gradient-bar/control-points.tsx +10 -10
- package/src/custom-gradient-picker/style.scss +2 -21
- package/src/custom-select-control-v2/styles.ts +5 -4
- package/src/date-time/date/index.tsx +1 -1
- package/src/date-time/date/styles.ts +33 -13
- package/src/date-time/date/test/use-lilius.ts +417 -0
- package/src/date-time/date/use-lilius/index.ts +394 -0
- package/src/date-time/time/test/index.tsx +3 -6
- package/src/date-time/time/time-input/index.tsx +25 -25
- package/src/date-time/time/time-input/test/index.tsx +6 -7
- package/src/dimension-control/README.md +4 -0
- package/src/dimension-control/index.tsx +7 -1
- package/src/dimension-control/stories/index.story.tsx +7 -2
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -16
- package/src/dimension-control/test/index.test.js +1 -0
- package/src/draggable/index.tsx +4 -4
- package/src/dropdown-menu-v2/README.md +73 -60
- package/src/dropdown-menu-v2/checkbox-item.tsx +63 -0
- package/src/dropdown-menu-v2/context.tsx +13 -0
- package/src/dropdown-menu-v2/group-label.tsx +37 -0
- package/src/dropdown-menu-v2/group.tsx +26 -0
- package/src/dropdown-menu-v2/index.tsx +57 -197
- package/src/dropdown-menu-v2/item-help-text.tsx +23 -0
- package/src/dropdown-menu-v2/item-label.tsx +23 -0
- package/src/dropdown-menu-v2/item.tsx +50 -0
- package/src/dropdown-menu-v2/radio-item.tsx +70 -0
- package/src/dropdown-menu-v2/separator.tsx +27 -0
- package/src/dropdown-menu-v2/stories/index.story.tsx +295 -262
- package/src/dropdown-menu-v2/styles.ts +103 -67
- package/src/dropdown-menu-v2/test/index.tsx +159 -132
- package/src/dropdown-menu-v2/types.ts +7 -0
- package/src/dropdown-menu-v2/use-temporary-focus-visible-fix.ts +22 -0
- package/src/focal-point-picker/styles/focal-point-style.ts +6 -1
- package/src/form-toggle/style.scss +2 -1
- package/src/form-token-field/style.scss +2 -3
- package/src/form-token-field/types.ts +1 -0
- package/src/index.ts +6 -1
- package/src/input-control/index.tsx +2 -2
- package/src/input-control/input-base.tsx +4 -14
- package/src/input-control/input-prefix-wrapper.tsx +8 -4
- package/src/input-control/input-suffix-wrapper.tsx +4 -6
- package/src/input-control/reducer/reducer.ts +13 -10
- package/src/input-control/stories/index.story.tsx +31 -12
- package/src/input-control/styles/input-control-styles.tsx +42 -11
- package/src/input-control/types.ts +23 -7
- package/src/input-control/utils.ts +3 -3
- package/src/item-group/styles.ts +3 -3
- package/src/item-group/test/__snapshots__/index.js.snap +3 -3
- package/src/modal/index.tsx +47 -24
- package/src/modal/stories/index.story.tsx +8 -14
- package/src/modal/style.scss +34 -11
- package/src/modal/types.ts +6 -18
- package/src/modal/use-modal-exit-animation.ts +99 -0
- package/src/navigation/index.tsx +4 -4
- package/src/navigation/styles/navigation-styles.tsx +3 -3
- package/src/navigator/index.ts +6 -6
- package/src/navigator/navigator-back-button/hook.ts +1 -1
- package/src/navigator/navigator-button/hook.ts +1 -1
- package/src/navigator/navigator-provider/README.md +2 -3
- package/src/navigator/navigator-provider/component.tsx +97 -82
- package/src/navigator/navigator-screen/component.tsx +7 -0
- package/src/navigator/navigator-to-parent-button/component.tsx +1 -1
- package/src/navigator/stories/index.story.tsx +82 -253
- package/src/navigator/test/index.tsx +8 -0
- package/src/navigator/types.ts +3 -1
- package/src/navigator/use-navigator.ts +1 -3
- package/src/palette-edit/index.tsx +2 -2
- package/src/popover/style.scss +3 -2
- package/src/private-apis.ts +1 -23
- package/src/range-control/styles/range-control-styles.ts +8 -7
- package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -2
- package/src/resizable-box/style.scss +3 -3
- package/src/select-control/README.md +2 -2
- package/src/select-control/styles/select-control-styles.ts +5 -5
- package/src/slot-fill/bubbles-virtually/fill.tsx +4 -4
- package/src/slot-fill/index.tsx +1 -0
- package/src/snackbar/index.tsx +4 -4
- package/src/snackbar/style.scss +1 -1
- package/src/tab-panel/style.scss +0 -1
- package/src/tabs/index.tsx +8 -4
- package/src/tabs/styles.ts +42 -14
- package/src/tabs/tablist.tsx +5 -4
- package/src/text-control/style.scss +3 -2
- package/src/toggle-group-control/toggle-group-control/utils.ts +7 -7
- package/src/tools-panel/tools-panel/hook.ts +6 -6
- package/src/tooltip/style.scss +1 -0
- package/src/unit-control/styles/unit-control-styles.ts +2 -1
- package/src/utils/config-values.js +10 -9
- package/src/utils/element-rect.ts +93 -130
- package/src/utils/hooks/use-update-effect.js +4 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -66
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -77
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
- package/build/navigator/navigator-back-button/index.js +0 -14
- package/build/navigator/navigator-back-button/index.js.map +0 -1
- package/build/navigator/navigator-button/index.js +0 -14
- package/build/navigator/navigator-button/index.js.map +0 -1
- package/build/navigator/navigator-provider/index.js +0 -14
- package/build/navigator/navigator-provider/index.js.map +0 -1
- package/build/navigator/navigator-screen/index.js +0 -14
- package/build/navigator/navigator-screen/index.js.map +0 -1
- package/build/navigator/navigator-to-parent-button/index.js +0 -14
- package/build/navigator/navigator-to-parent-button/index.js.map +0 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -63
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -72
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
- package/build-module/navigator/navigator-back-button/index.js +0 -2
- package/build-module/navigator/navigator-back-button/index.js.map +0 -1
- package/build-module/navigator/navigator-button/index.js +0 -2
- package/build-module/navigator/navigator-button/index.js.map +0 -1
- package/build-module/navigator/navigator-provider/index.js +0 -2
- package/build-module/navigator/navigator-provider/index.js.map +0 -1
- package/build-module/navigator/navigator-screen/index.js +0 -2
- package/build-module/navigator/navigator-screen/index.js.map +0 -1
- package/build-module/navigator/navigator-to-parent-button/index.js +0 -2
- package/build-module/navigator/navigator-to-parent-button/index.js.map +0 -1
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +0 -18
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +0 -1
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +0 -1
- package/build-types/composite/stories/utils.d.ts +0 -29
- package/build-types/composite/stories/utils.d.ts.map +0 -1
- package/build-types/navigator/navigator-back-button/index.d.ts +0 -2
- package/build-types/navigator/navigator-back-button/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-button/index.d.ts +0 -2
- package/build-types/navigator/navigator-button/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-provider/index.d.ts +0 -2
- package/build-types/navigator/navigator-provider/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-screen/index.d.ts +0 -2
- package/build-types/navigator/navigator-screen/index.d.ts.map +0 -1
- package/build-types/navigator/navigator-to-parent-button/index.d.ts +0 -2
- package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +0 -1
- package/src/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.ts +0 -77
- package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +0 -102
- package/src/composite/stories/utils.tsx +0 -76
- package/src/navigator/navigator-back-button/index.ts +0 -1
- package/src/navigator/navigator-button/index.ts +0 -1
- package/src/navigator/navigator-provider/index.ts +0 -1
- package/src/navigator/navigator-screen/index.ts +0 -1
- package/src/navigator/navigator-to-parent-button/index.ts +0 -1
|
@@ -8,8 +8,8 @@ Snapshot Diff:
|
|
|
8
8
|
@@ -1,8 +1,8 @@
|
|
9
9
|
<div>
|
|
10
10
|
<div
|
|
11
|
-
- class="components-card__body components-card-body css-
|
|
12
|
-
+ class="components-scrollable components-card__body components-card-body css-
|
|
11
|
+
- class="components-card__body components-card-body css-12jqy32-PolymorphicDiv-Body-borderRadius-medium e19lxcc00"
|
|
12
|
+
+ class="components-scrollable components-card__body components-card-body css-26nv7r-PolymorphicDiv-Scrollable-scrollableScrollbar-scrollY-Body-borderRadius-medium e19lxcc00"
|
|
13
13
|
data-wp-c16t="true"
|
|
14
14
|
data-wp-component="CardBody"
|
|
15
15
|
>
|
|
@@ -25,8 +25,8 @@ Snapshot Diff:
|
|
|
25
25
|
@@ -1,8 +1,8 @@
|
|
26
26
|
<div>
|
|
27
27
|
<div
|
|
28
|
-
- class="components-card__body components-card-body css-
|
|
29
|
-
+ class="components-card__body components-card-body css-
|
|
28
|
+
- class="components-card__body components-card-body css-12jqy32-PolymorphicDiv-Body-borderRadius-medium e19lxcc00"
|
|
29
|
+
+ class="components-card__body components-card-body css-1j7lja1-PolymorphicDiv-Body-borderRadius-medium-shady e19lxcc00"
|
|
30
30
|
data-wp-c16t="true"
|
|
31
31
|
data-wp-component="CardBody"
|
|
32
32
|
>
|
|
@@ -42,8 +42,8 @@ Snapshot Diff:
|
|
|
42
42
|
@@ -1,8 +1,8 @@
|
|
43
43
|
<div>
|
|
44
44
|
<div
|
|
45
|
-
- class="components-flex components-card__footer components-card-footer css-
|
|
46
|
-
+ class="components-flex components-card__footer components-card-footer css-
|
|
45
|
+
- class="components-flex components-card__footer components-card-footer css-19sc0cg-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-medium e19lxcc00"
|
|
46
|
+
+ class="components-flex components-card__footer components-card-footer css-14budie-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-medium-shady e19lxcc00"
|
|
47
47
|
data-wp-c16t="true"
|
|
48
48
|
data-wp-component="CardFooter"
|
|
49
49
|
>
|
|
@@ -59,8 +59,8 @@ Snapshot Diff:
|
|
|
59
59
|
@@ -1,8 +1,8 @@
|
|
60
60
|
<div>
|
|
61
61
|
<div
|
|
62
|
-
- class="components-flex components-card__footer components-card-footer css-
|
|
63
|
-
+ class="components-flex components-card__footer components-card-footer css-
|
|
62
|
+
- class="components-flex components-card__footer components-card-footer css-19sc0cg-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-medium e19lxcc00"
|
|
63
|
+
+ class="components-flex components-card__footer components-card-footer css-2io175-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-medium e19lxcc00"
|
|
64
64
|
data-wp-c16t="true"
|
|
65
65
|
data-wp-component="CardFooter"
|
|
66
66
|
>
|
|
@@ -76,8 +76,8 @@ Snapshot Diff:
|
|
|
76
76
|
@@ -1,8 +1,8 @@
|
|
77
77
|
<div>
|
|
78
78
|
<div
|
|
79
|
-
- class="components-flex components-card__header components-card-header css-
|
|
80
|
-
+ class="components-flex components-card__header components-card-header css-
|
|
79
|
+
- class="components-flex components-card__header components-card-header css-1qwshfy-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-medium e19lxcc00"
|
|
80
|
+
+ class="components-flex components-card__header components-card-header css-1bzc8bz-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-medium-shady e19lxcc00"
|
|
81
81
|
data-wp-c16t="true"
|
|
82
82
|
data-wp-component="CardHeader"
|
|
83
83
|
>
|
|
@@ -96,16 +96,16 @@ Snapshot Diff:
|
|
|
96
96
|
class="css-76dw7d-PolymorphicDiv-Content e19lxcc00"
|
|
97
97
|
>
|
|
98
98
|
<div
|
|
99
|
-
- class="components-flex components-card__header components-card-header css-
|
|
100
|
-
+ class="components-flex components-card__header components-card-header css-
|
|
99
|
+
- class="components-flex components-card__header components-card-header css-1qwshfy-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-medium e19lxcc00"
|
|
100
|
+
+ class="components-flex components-card__header components-card-header css-1t2zg3y-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-large e19lxcc00"
|
|
101
101
|
data-wp-c16t="true"
|
|
102
102
|
data-wp-component="CardHeader"
|
|
103
103
|
>
|
|
104
104
|
Header
|
|
105
105
|
</div>
|
|
106
106
|
<div
|
|
107
|
-
- class="components-card__body components-card-body css-
|
|
108
|
-
+ class="components-card__body components-card-body css-
|
|
107
|
+
- class="components-card__body components-card-body css-12jqy32-PolymorphicDiv-Body-borderRadius-medium e19lxcc00"
|
|
108
|
+
+ class="components-card__body components-card-body css-e0vrqx-PolymorphicDiv-Body-borderRadius-large e19lxcc00"
|
|
109
109
|
data-wp-c16t="true"
|
|
110
110
|
data-wp-component="CardBody"
|
|
111
111
|
>
|
|
@@ -122,7 +122,7 @@ Snapshot Diff:
|
|
|
122
122
|
Array [
|
|
123
123
|
Object {
|
|
124
124
|
"background-color": "#fff",
|
|
125
|
-
- "border-radius": "calc(
|
|
125
|
+
- "border-radius": "calc(8px - 1px)",
|
|
126
126
|
"box-shadow": "0 0 0 1px rgba(0, 0, 0, 0.1)",
|
|
127
127
|
"color": "#1e1e1e",
|
|
128
128
|
"outline": "none",
|
|
@@ -141,24 +141,24 @@ Snapshot Diff:
|
|
|
141
141
|
class="css-76dw7d-PolymorphicDiv-Content e19lxcc00"
|
|
142
142
|
>
|
|
143
143
|
<div
|
|
144
|
-
- class="components-flex components-card__header components-card-header css-
|
|
145
|
-
+ class="components-flex components-card__header components-card-header css-
|
|
144
|
+
- class="components-flex components-card__header components-card-header css-ubn8f6-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-large-borderless e19lxcc00"
|
|
145
|
+
+ class="components-flex components-card__header components-card-header css-1t1rswf-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-small e19lxcc00"
|
|
146
146
|
data-wp-c16t="true"
|
|
147
147
|
data-wp-component="CardHeader"
|
|
148
148
|
>
|
|
149
149
|
Header
|
|
150
150
|
</div>
|
|
151
151
|
<div
|
|
152
|
-
- class="components-card__body components-card-body css-
|
|
153
|
-
+ class="components-card__body components-card-body css-
|
|
152
|
+
- class="components-card__body components-card-body css-e0vrqx-PolymorphicDiv-Body-borderRadius-large e19lxcc00"
|
|
153
|
+
+ class="components-card__body components-card-body css-12jqy32-PolymorphicDiv-Body-borderRadius-medium e19lxcc00"
|
|
154
154
|
data-wp-c16t="true"
|
|
155
155
|
data-wp-component="CardBody"
|
|
156
156
|
>
|
|
157
157
|
Body
|
|
158
158
|
</div>
|
|
159
159
|
<div
|
|
160
|
-
- class="components-flex components-card__footer components-card-footer css-
|
|
161
|
-
+ class="components-flex components-card__footer components-card-footer css-
|
|
160
|
+
- class="components-flex components-card__footer components-card-footer css-167csgt-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-large-borderless e19lxcc00"
|
|
161
|
+
+ class="components-flex components-card__footer components-card-footer css-1kcgqsk-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-xSmallCardPadding e19lxcc00"
|
|
162
162
|
data-wp-c16t="true"
|
|
163
163
|
data-wp-component="CardFooter"
|
|
164
164
|
>
|
|
@@ -174,8 +174,8 @@ Snapshot Diff:
|
|
|
174
174
|
@@ -1,30 +1,30 @@
|
|
175
175
|
<div>
|
|
176
176
|
<div
|
|
177
|
-
- class="components-surface components-card css-
|
|
178
|
-
+ class="components-surface components-card css-
|
|
177
|
+
- class="components-surface components-card css-1hs39fv-PolymorphicDiv-Surface-getBorders-primary-Card-boxShadowless-rounded e19lxcc00"
|
|
178
|
+
+ class="components-surface components-card css-1c6nh8q-PolymorphicDiv-Surface-getBorders-primary-Card-rounded e19lxcc00"
|
|
179
179
|
data-wp-c16t="true"
|
|
180
180
|
data-wp-component="Card"
|
|
181
181
|
>
|
|
@@ -183,24 +183,24 @@ Snapshot Diff:
|
|
|
183
183
|
class="css-76dw7d-PolymorphicDiv-Content e19lxcc00"
|
|
184
184
|
>
|
|
185
185
|
<div
|
|
186
|
-
- class="components-flex components-card__header components-card-header css-
|
|
187
|
-
+ class="components-flex components-card__header components-card-header css-
|
|
186
|
+
- class="components-flex components-card__header components-card-header css-ubn8f6-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-large-borderless e19lxcc00"
|
|
187
|
+
+ class="components-flex components-card__header components-card-header css-1t1rswf-PolymorphicDiv-Flex-base-ItemsRow-Header-borderRadius-borderColor-small e19lxcc00"
|
|
188
188
|
data-wp-c16t="true"
|
|
189
189
|
data-wp-component="CardHeader"
|
|
190
190
|
>
|
|
191
191
|
Header
|
|
192
192
|
</div>
|
|
193
193
|
<div
|
|
194
|
-
- class="components-card__body components-card-body css-
|
|
195
|
-
+ class="components-card__body components-card-body css-
|
|
194
|
+
- class="components-card__body components-card-body css-e0vrqx-PolymorphicDiv-Body-borderRadius-large e19lxcc00"
|
|
195
|
+
+ class="components-card__body components-card-body css-hms9n9-PolymorphicDiv-Body-borderRadius-small e19lxcc00"
|
|
196
196
|
data-wp-c16t="true"
|
|
197
197
|
data-wp-component="CardBody"
|
|
198
198
|
>
|
|
199
199
|
Body
|
|
200
200
|
</div>
|
|
201
201
|
<div
|
|
202
|
-
- class="components-flex components-card__footer components-card-footer css-
|
|
203
|
-
+ class="components-flex components-card__footer components-card-footer css-
|
|
202
|
+
- class="components-flex components-card__footer components-card-footer css-167csgt-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-large-borderless e19lxcc00"
|
|
203
|
+
+ class="components-flex components-card__footer components-card-footer css-18yn3ff-PolymorphicDiv-Flex-base-ItemsRow-Footer-borderRadius-borderColor-small e19lxcc00"
|
|
204
204
|
data-wp-c16t="true"
|
|
205
205
|
data-wp-component="CardFooter"
|
|
206
206
|
>
|
|
@@ -215,7 +215,7 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
215
215
|
position: relative;
|
|
216
216
|
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
217
217
|
outline: none;
|
|
218
|
-
border-radius: calc(
|
|
218
|
+
border-radius: calc(8px - 1px);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
.emotion-2 {
|
|
@@ -254,13 +254,13 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
.emotion-4:first-of-type {
|
|
257
|
-
border-top-left-radius: calc(
|
|
258
|
-
border-top-right-radius: calc(
|
|
257
|
+
border-top-left-radius: calc(8px - 1px);
|
|
258
|
+
border-top-right-radius: calc(8px - 1px);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
.emotion-4:last-of-type {
|
|
262
|
-
border-bottom-left-radius: calc(
|
|
263
|
-
border-bottom-right-radius: calc(
|
|
262
|
+
border-bottom-left-radius: calc(8px - 1px);
|
|
263
|
+
border-bottom-right-radius: calc(8px - 1px);
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
.emotion-6 {
|
|
@@ -271,13 +271,13 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
.emotion-6:first-of-type {
|
|
274
|
-
border-top-left-radius: calc(
|
|
275
|
-
border-top-right-radius: calc(
|
|
274
|
+
border-top-left-radius: calc(8px - 1px);
|
|
275
|
+
border-top-right-radius: calc(8px - 1px);
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
.emotion-6:last-of-type {
|
|
279
|
-
border-bottom-left-radius: calc(
|
|
280
|
-
border-bottom-right-radius: calc(
|
|
279
|
+
border-bottom-left-radius: calc(8px - 1px);
|
|
280
|
+
border-bottom-right-radius: calc(8px - 1px);
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
.emotion-10 {
|
|
@@ -306,13 +306,13 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
.emotion-14:first-of-type {
|
|
309
|
-
border-top-left-radius: calc(
|
|
310
|
-
border-top-right-radius: calc(
|
|
309
|
+
border-top-left-radius: calc(8px - 1px);
|
|
310
|
+
border-top-right-radius: calc(8px - 1px);
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
.emotion-14:last-of-type {
|
|
314
|
-
border-bottom-left-radius: calc(
|
|
315
|
-
border-bottom-right-radius: calc(
|
|
314
|
+
border-bottom-left-radius: calc(8px - 1px);
|
|
315
|
+
border-bottom-right-radius: calc(8px - 1px);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
.emotion-16 {
|
|
@@ -347,13 +347,13 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
.emotion-16:first-of-type {
|
|
350
|
-
border-top-left-radius: calc(
|
|
351
|
-
border-top-right-radius: calc(
|
|
350
|
+
border-top-left-radius: calc(8px - 1px);
|
|
351
|
+
border-top-right-radius: calc(8px - 1px);
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
.emotion-16:last-of-type {
|
|
355
|
-
border-bottom-left-radius: calc(
|
|
356
|
-
border-bottom-right-radius: calc(
|
|
355
|
+
border-bottom-left-radius: calc(8px - 1px);
|
|
356
|
+
border-bottom-right-radius: calc(8px - 1px);
|
|
357
357
|
}
|
|
358
358
|
|
|
359
359
|
.emotion-18 {
|
|
@@ -370,7 +370,7 @@ exports[`Card Card component should render correctly 1`] = `
|
|
|
370
370
|
left: 0;
|
|
371
371
|
right: 0;
|
|
372
372
|
top: 0;
|
|
373
|
-
border-radius:
|
|
373
|
+
border-radius: 8px;
|
|
374
374
|
}
|
|
375
375
|
|
|
376
376
|
@media not ( prefers-reduced-motion ) {
|
|
@@ -469,15 +469,15 @@ Snapshot Diff:
|
|
|
469
469
|
</div>
|
|
470
470
|
<div
|
|
471
471
|
aria-hidden="true"
|
|
472
|
-
- class="components-elevation css-
|
|
473
|
-
+ class="components-elevation css-
|
|
472
|
+
- class="components-elevation css-a91pvj-PolymorphicDiv-Elevation-sx-Base-sx-Base-elevationClassName e19lxcc00"
|
|
473
|
+
+ class="components-elevation css-1q4cuxd-PolymorphicDiv-Elevation-sx-Base-sx-Base-elevationClassName e19lxcc00"
|
|
474
474
|
data-wp-c16t="true"
|
|
475
475
|
data-wp-component="Elevation"
|
|
476
476
|
/>
|
|
477
477
|
<div
|
|
478
478
|
aria-hidden="true"
|
|
479
|
-
- class="components-elevation css-
|
|
480
|
-
+ class="components-elevation css-
|
|
479
|
+
- class="components-elevation css-5u83fl-PolymorphicDiv-Elevation-sx-Base-sx-Base-elevationClassName e19lxcc00"
|
|
480
|
+
+ class="components-elevation css-1q4cuxd-PolymorphicDiv-Elevation-sx-Base-sx-Base-elevationClassName e19lxcc00"
|
|
481
481
|
data-wp-c16t="true"
|
|
482
482
|
data-wp-component="Elevation"
|
|
483
483
|
/>
|
|
@@ -497,7 +497,7 @@ exports[`Card Card component should warn when the isElevated prop is passed 1`]
|
|
|
497
497
|
position: relative;
|
|
498
498
|
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
499
499
|
outline: none;
|
|
500
|
-
border-radius: calc(
|
|
500
|
+
border-radius: calc(8px - 1px);
|
|
501
501
|
}
|
|
502
502
|
|
|
503
503
|
.emotion-2 {
|
|
@@ -518,7 +518,7 @@ exports[`Card Card component should warn when the isElevated prop is passed 1`]
|
|
|
518
518
|
left: 0;
|
|
519
519
|
right: 0;
|
|
520
520
|
top: 0;
|
|
521
|
-
border-radius:
|
|
521
|
+
border-radius: 8px;
|
|
522
522
|
}
|
|
523
523
|
|
|
524
524
|
@media not ( prefers-reduced-motion ) {
|
|
@@ -542,7 +542,7 @@ exports[`Card Card component should warn when the isElevated prop is passed 1`]
|
|
|
542
542
|
left: 0;
|
|
543
543
|
right: 0;
|
|
544
544
|
top: 0;
|
|
545
|
-
border-radius:
|
|
545
|
+
border-radius: 8px;
|
|
546
546
|
}
|
|
547
547
|
|
|
548
548
|
@media not ( prefers-reduced-motion ) {
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { useStoreState } from '@ariakit/react';
|
|
6
5
|
import type { ForwardedRef } from 'react';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* WordPress dependencies
|
|
10
9
|
*/
|
|
11
10
|
import { useInstanceId } from '@wordpress/compose';
|
|
12
|
-
import { forwardRef, useContext } from '@wordpress/element';
|
|
11
|
+
import { forwardRef, useContext, useEffect } from '@wordpress/element';
|
|
13
12
|
import { Icon, check } from '@wordpress/icons';
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -46,18 +45,21 @@ function UnforwardedOptionAsOption(
|
|
|
46
45
|
id: string;
|
|
47
46
|
className?: string;
|
|
48
47
|
isSelected?: boolean;
|
|
49
|
-
compositeStore: NonNullable<
|
|
50
|
-
React.ComponentProps< typeof Composite >[ 'store' ]
|
|
51
|
-
>;
|
|
52
48
|
},
|
|
53
49
|
forwardedRef: ForwardedRef< any >
|
|
54
50
|
) {
|
|
55
|
-
const { id, isSelected,
|
|
56
|
-
const activeId = useStoreState( compositeStore, 'activeId' );
|
|
51
|
+
const { id, isSelected, ...additionalProps } = props;
|
|
57
52
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
const { setActiveId, activeId } = useContext( CircularOptionPickerContext );
|
|
54
|
+
|
|
55
|
+
useEffect( () => {
|
|
56
|
+
if ( isSelected && ! activeId ) {
|
|
57
|
+
// The setTimeout call is necessary to make sure that this update
|
|
58
|
+
// doesn't get overridden by `Composite`'s internal logic, which picks
|
|
59
|
+
// an initial active item if one is not specifically set.
|
|
60
|
+
window.setTimeout( () => setActiveId?.( id ), 0 );
|
|
61
|
+
}
|
|
62
|
+
}, [ isSelected, setActiveId, activeId, id ] );
|
|
61
63
|
|
|
62
64
|
return (
|
|
63
65
|
<Composite.Item
|
|
@@ -83,9 +85,7 @@ export function Option( {
|
|
|
83
85
|
tooltipText,
|
|
84
86
|
...additionalProps
|
|
85
87
|
}: OptionProps ) {
|
|
86
|
-
const { baseId,
|
|
87
|
-
CircularOptionPickerContext
|
|
88
|
-
);
|
|
88
|
+
const { baseId, setActiveId } = useContext( CircularOptionPickerContext );
|
|
89
89
|
const id = useInstanceId(
|
|
90
90
|
Option,
|
|
91
91
|
baseId || 'components-circular-option-picker__option'
|
|
@@ -97,12 +97,9 @@ export function Option( {
|
|
|
97
97
|
...additionalProps,
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
compositeStore={ compositeStore }
|
|
104
|
-
isSelected={ isSelected }
|
|
105
|
-
/>
|
|
100
|
+
const isListbox = setActiveId !== undefined;
|
|
101
|
+
const optionControl = isListbox ? (
|
|
102
|
+
<OptionAsOption { ...commonProps } isSelected={ isSelected } />
|
|
106
103
|
) : (
|
|
107
104
|
<OptionAsButton { ...commonProps } isPressed={ isSelected } />
|
|
108
105
|
);
|
|
@@ -8,12 +8,13 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import { useInstanceId } from '@wordpress/compose';
|
|
10
10
|
import { isRTL } from '@wordpress/i18n';
|
|
11
|
+
import { useMemo, useState } from '@wordpress/element';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Internal dependencies
|
|
14
15
|
*/
|
|
15
16
|
import { CircularOptionPickerContext } from './circular-option-picker-context';
|
|
16
|
-
import { Composite
|
|
17
|
+
import { Composite } from '../composite';
|
|
17
18
|
import type {
|
|
18
19
|
CircularOptionPickerProps,
|
|
19
20
|
ListboxCircularOptionPickerProps,
|
|
@@ -85,24 +86,30 @@ function ListboxCircularOptionPicker(
|
|
|
85
86
|
...additionalProps
|
|
86
87
|
} = props;
|
|
87
88
|
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
} );
|
|
89
|
+
const [ activeId, setActiveId ] = useState< string | null | undefined >(
|
|
90
|
+
undefined
|
|
91
|
+
);
|
|
92
92
|
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
const contextValue = useMemo(
|
|
94
|
+
() => ( {
|
|
95
|
+
baseId,
|
|
96
|
+
activeId,
|
|
97
|
+
setActiveId,
|
|
98
|
+
} ),
|
|
99
|
+
[ baseId, activeId, setActiveId ]
|
|
100
|
+
);
|
|
97
101
|
|
|
98
102
|
return (
|
|
99
103
|
<div className={ className }>
|
|
100
|
-
<CircularOptionPickerContext.Provider value={
|
|
104
|
+
<CircularOptionPickerContext.Provider value={ contextValue }>
|
|
101
105
|
<Composite
|
|
102
106
|
{ ...additionalProps }
|
|
103
107
|
id={ baseId }
|
|
104
|
-
|
|
108
|
+
focusLoop={ loop }
|
|
109
|
+
rtl={ isRTL() }
|
|
105
110
|
role="listbox"
|
|
111
|
+
activeId={ activeId }
|
|
112
|
+
setActiveId={ setActiveId }
|
|
106
113
|
>
|
|
107
114
|
{ options }
|
|
108
115
|
</Composite>
|
|
@@ -118,9 +125,16 @@ function ButtonsCircularOptionPicker(
|
|
|
118
125
|
) {
|
|
119
126
|
const { actions, options, children, baseId, ...additionalProps } = props;
|
|
120
127
|
|
|
128
|
+
const contextValue = useMemo(
|
|
129
|
+
() => ( {
|
|
130
|
+
baseId,
|
|
131
|
+
} ),
|
|
132
|
+
[ baseId ]
|
|
133
|
+
);
|
|
134
|
+
|
|
121
135
|
return (
|
|
122
136
|
<div { ...additionalProps } id={ baseId }>
|
|
123
|
-
<CircularOptionPickerContext.Provider value={
|
|
137
|
+
<CircularOptionPickerContext.Provider value={ contextValue }>
|
|
124
138
|
{ options }
|
|
125
139
|
{ children }
|
|
126
140
|
{ actions }
|
|
@@ -14,7 +14,6 @@ import type { Icon } from '@wordpress/icons';
|
|
|
14
14
|
import type { ButtonAsButtonProps } from '../button/types';
|
|
15
15
|
import type { DropdownProps } from '../dropdown/types';
|
|
16
16
|
import type { WordPressComponentProps } from '../context';
|
|
17
|
-
import type { Composite } from '../composite';
|
|
18
17
|
|
|
19
18
|
type CommonCircularOptionPickerProps = {
|
|
20
19
|
/**
|
|
@@ -125,5 +124,6 @@ export type OptionProps = Omit<
|
|
|
125
124
|
|
|
126
125
|
export type CircularOptionPickerContextProps = {
|
|
127
126
|
baseId?: string;
|
|
128
|
-
|
|
127
|
+
activeId?: string | null | undefined;
|
|
128
|
+
setActiveId?: ( newId: string | null | undefined ) => void;
|
|
129
129
|
};
|
|
@@ -32,21 +32,21 @@ export default function ClipboardButton( {
|
|
|
32
32
|
alternative: 'wp.compose.useCopyToClipboard',
|
|
33
33
|
} );
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const timeoutIdRef = useRef< NodeJS.Timeout >();
|
|
36
36
|
const ref = useCopyToClipboard( text, () => {
|
|
37
37
|
onCopy();
|
|
38
|
-
if (
|
|
39
|
-
clearTimeout(
|
|
38
|
+
if ( timeoutIdRef.current ) {
|
|
39
|
+
clearTimeout( timeoutIdRef.current );
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
if ( onFinishCopy ) {
|
|
43
|
-
|
|
43
|
+
timeoutIdRef.current = setTimeout( () => onFinishCopy(), TIMEOUT );
|
|
44
44
|
}
|
|
45
45
|
} );
|
|
46
46
|
|
|
47
47
|
useEffect( () => {
|
|
48
|
-
if (
|
|
49
|
-
clearTimeout(
|
|
48
|
+
if ( timeoutIdRef.current ) {
|
|
49
|
+
clearTimeout( timeoutIdRef.current );
|
|
50
50
|
}
|
|
51
51
|
}, [] );
|
|
52
52
|
|
|
@@ -26,18 +26,37 @@ describe( 'ColorPalette: Utils', () => {
|
|
|
26
26
|
} );
|
|
27
27
|
|
|
28
28
|
describe( 'normalizeColorValue', () => {
|
|
29
|
-
test( 'should return the value
|
|
29
|
+
test( 'should return the value if the value argument is not a CSS variable', () => {
|
|
30
30
|
const element = document.createElement( 'div' );
|
|
31
31
|
expect( normalizeColorValue( '#ff0000', element ) ).toBe(
|
|
32
32
|
'#ff0000'
|
|
33
33
|
);
|
|
34
34
|
} );
|
|
35
|
-
test( 'should return the background color computed from
|
|
35
|
+
test( 'should return the background color computed from an element if the value argument is a CSS variable', () => {
|
|
36
36
|
const element = document.createElement( 'div' );
|
|
37
37
|
element.style.backgroundColor = '#ff0000';
|
|
38
38
|
expect( normalizeColorValue( 'var(--red)', element ) ).toBe(
|
|
39
39
|
'#ff0000'
|
|
40
40
|
);
|
|
41
41
|
} );
|
|
42
|
+
test( 'should return the background color computed from an element if the value argument is a color mix', () => {
|
|
43
|
+
const element = document.createElement( 'div' );
|
|
44
|
+
element.style.backgroundColor = '#ff0000';
|
|
45
|
+
expect(
|
|
46
|
+
normalizeColorValue(
|
|
47
|
+
'color-mix(in oklab, #a71e14, white)',
|
|
48
|
+
element
|
|
49
|
+
)
|
|
50
|
+
).toBe( '#ff0000' );
|
|
51
|
+
} );
|
|
52
|
+
test( 'should return the value if the value argument is undefined', () => {
|
|
53
|
+
const element = document.createElement( 'div' );
|
|
54
|
+
expect( normalizeColorValue( undefined, element ) ).toBe(
|
|
55
|
+
undefined
|
|
56
|
+
);
|
|
57
|
+
} );
|
|
58
|
+
test( 'should return the value if the element argument is null', () => {
|
|
59
|
+
expect( normalizeColorValue( '#ff0000', null ) ).toBe( '#ff0000' );
|
|
60
|
+
} );
|
|
42
61
|
} );
|
|
43
62
|
} );
|
|
@@ -92,9 +92,7 @@ export const normalizeColorValue = (
|
|
|
92
92
|
value: string | undefined,
|
|
93
93
|
element: HTMLElement | null
|
|
94
94
|
) => {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if ( valueIsSimpleColor || element === null ) {
|
|
95
|
+
if ( ! value || ! element || isSimpleCSSColor( value ) ) {
|
|
98
96
|
return value;
|
|
99
97
|
}
|
|
100
98
|
|
|
@@ -17,7 +17,9 @@ import type { ColorCopyButtonProps } from './types';
|
|
|
17
17
|
export const ColorCopyButton = ( props: ColorCopyButtonProps ) => {
|
|
18
18
|
const { color, colorType } = props;
|
|
19
19
|
const [ copiedColor, setCopiedColor ] = useState< string | null >( null );
|
|
20
|
-
const
|
|
20
|
+
const copyTimerRef = useRef<
|
|
21
|
+
ReturnType< typeof setTimeout > | undefined
|
|
22
|
+
>();
|
|
21
23
|
const copyRef = useCopyToClipboard< HTMLDivElement >(
|
|
22
24
|
() => {
|
|
23
25
|
switch ( colorType ) {
|
|
@@ -34,21 +36,21 @@ export const ColorCopyButton = ( props: ColorCopyButtonProps ) => {
|
|
|
34
36
|
}
|
|
35
37
|
},
|
|
36
38
|
() => {
|
|
37
|
-
if (
|
|
38
|
-
clearTimeout(
|
|
39
|
+
if ( copyTimerRef.current ) {
|
|
40
|
+
clearTimeout( copyTimerRef.current );
|
|
39
41
|
}
|
|
40
42
|
setCopiedColor( color.toHex() );
|
|
41
|
-
|
|
43
|
+
copyTimerRef.current = setTimeout( () => {
|
|
42
44
|
setCopiedColor( null );
|
|
43
|
-
|
|
45
|
+
copyTimerRef.current = undefined;
|
|
44
46
|
}, 3000 );
|
|
45
47
|
}
|
|
46
48
|
);
|
|
47
49
|
useEffect( () => {
|
|
48
|
-
// Clear
|
|
50
|
+
// Clear copyTimerRef on component unmount.
|
|
49
51
|
return () => {
|
|
50
|
-
if (
|
|
51
|
-
clearTimeout(
|
|
52
|
+
if ( copyTimerRef.current ) {
|
|
53
|
+
clearTimeout( copyTimerRef.current );
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
56
|
}, [] );
|
|
@@ -13,11 +13,10 @@ import { __ } from '@wordpress/i18n';
|
|
|
13
13
|
*/
|
|
14
14
|
import { InputControl } from '../input-control';
|
|
15
15
|
import { Text } from '../text';
|
|
16
|
-
import { Spacer } from '../spacer';
|
|
17
|
-
import { space } from '../utils/space';
|
|
18
16
|
import { COLORS } from '../utils/colors-values';
|
|
19
17
|
import type { StateReducer } from '../input-control/reducer/state';
|
|
20
18
|
import type { HexInputProps } from './types';
|
|
19
|
+
import InputControlPrefixWrapper from '../input-control/input-prefix-wrapper';
|
|
21
20
|
|
|
22
21
|
export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {
|
|
23
22
|
const handleChange = ( nextValue: string | undefined ) => {
|
|
@@ -48,14 +47,11 @@ export const HexInput = ( { color, onChange, enableAlpha }: HexInputProps ) => {
|
|
|
48
47
|
return (
|
|
49
48
|
<InputControl
|
|
50
49
|
prefix={
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
>
|
|
57
|
-
#
|
|
58
|
-
</Spacer>
|
|
50
|
+
<InputControlPrefixWrapper>
|
|
51
|
+
<Text color={ COLORS.theme.accent } lineHeight={ 1 }>
|
|
52
|
+
#
|
|
53
|
+
</Text>
|
|
54
|
+
</InputControlPrefixWrapper>
|
|
59
55
|
}
|
|
60
56
|
value={ color.toHex().slice( 1 ).toUpperCase() }
|
|
61
57
|
onChange={ handleChange }
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { HStack } from '../h-stack';
|
|
5
5
|
import { Text } from '../text';
|
|
6
|
-
import { Spacer } from '../spacer';
|
|
7
|
-
import { space } from '../utils/space';
|
|
8
6
|
import { RangeControl, NumberControlWrapper } from './styles';
|
|
9
7
|
import { COLORS } from '../utils/colors-values';
|
|
10
8
|
import type { InputWithSliderProps } from './types';
|
|
9
|
+
import InputControlPrefixWrapper from '../input-control/input-prefix-wrapper';
|
|
11
10
|
|
|
12
11
|
export const InputWithSlider = ( {
|
|
13
12
|
min,
|
|
@@ -39,14 +38,11 @@ export const InputWithSlider = ( {
|
|
|
39
38
|
value={ value }
|
|
40
39
|
onChange={ onNumberControlChange }
|
|
41
40
|
prefix={
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
>
|
|
48
|
-
{ abbreviation }
|
|
49
|
-
</Spacer>
|
|
41
|
+
<InputControlPrefixWrapper>
|
|
42
|
+
<Text color={ COLORS.theme.accent } lineHeight={ 1 }>
|
|
43
|
+
{ abbreviation }
|
|
44
|
+
</Text>
|
|
45
|
+
</InputControlPrefixWrapper>
|
|
50
46
|
}
|
|
51
47
|
spinControls="none"
|
|
52
48
|
size="__unstable-large"
|