@wordpress/components 22.0.0 → 23.0.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 +99 -0
- package/build/alignment-matrix-control/cell.js.map +1 -1
- package/build/alignment-matrix-control/icon.js +4 -2
- package/build/alignment-matrix-control/icon.js.map +1 -1
- package/build/alignment-matrix-control/index.js +25 -1
- package/build/alignment-matrix-control/index.js.map +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +13 -13
- package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +16 -16
- package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build/alignment-matrix-control/types.js +6 -0
- package/build/alignment-matrix-control/types.js.map +1 -0
- package/build/alignment-matrix-control/utils.js +9 -8
- package/build/alignment-matrix-control/utils.js.map +1 -1
- package/build/angle-picker-control/index.js +3 -1
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/angle-picker-control/styles/angle-picker-control-styles.js +9 -9
- package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build/autocomplete/index.js +45 -12
- package/build/autocomplete/index.js.map +1 -1
- package/build/base-control/hooks.js +52 -0
- package/build/base-control/hooks.js.map +1 -0
- package/build/base-control/index.js +24 -7
- package/build/base-control/index.js.map +1 -1
- package/build/base-field/hook.js +0 -14
- package/build/base-field/hook.js.map +1 -1
- package/build/base-field/index.js.map +1 -1
- package/build/base-field/styles.js +5 -5
- package/build/base-field/styles.js.map +1 -1
- package/build/base-field/types.js +6 -0
- package/build/base-field/types.js.map +1 -0
- package/build/border-box-control/border-box-control/component.js +1 -1
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +13 -1
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/hook.js +11 -1
- package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
- package/build/border-control/border-control/component.js +3 -2
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +11 -1
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/component.js +1 -1
- package/build/border-control/border-control-dropdown/component.js.map +1 -1
- package/build/border-control/border-control-dropdown/hook.js +10 -2
- package/build/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build/border-control/styles.js +16 -16
- package/build/border-control/styles.js.map +1 -1
- package/build/box-control/linked-button.js +3 -4
- package/build/box-control/linked-button.js.map +1 -1
- package/build/color-palette/index.js +3 -8
- package/build/color-palette/index.js.map +1 -1
- package/build/color-picker/input-with-slider.js +18 -3
- 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/custom-select-control/index.js +19 -4
- package/build/custom-select-control/index.js.map +1 -1
- package/build/dashicon/index.js +18 -6
- package/build/dashicon/index.js.map +1 -1
- package/build/date-time/date-time/index.js +4 -4
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/draggable/index.js +58 -38
- package/build/draggable/index.js.map +1 -1
- package/build/draggable/types.js +6 -0
- package/build/draggable/types.js.map +1 -0
- package/build/duotone-picker/duotone-picker.js +2 -2
- package/build/duotone-picker/duotone-picker.js.map +1 -1
- package/build/flex/flex/hook.js +2 -3
- package/build/flex/flex/hook.js.map +1 -1
- package/build/focal-point-picker/focal-point.js +2 -12
- package/build/focal-point-picker/focal-point.js.map +1 -1
- package/build/focal-point-picker/styles/focal-point-style.js +11 -51
- package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build/font-size-picker/constants.js +41 -0
- package/build/font-size-picker/constants.js.map +1 -0
- package/build/font-size-picker/font-size-picker-select.js +97 -0
- package/build/font-size-picker/font-size-picker-select.js.map +1 -0
- package/build/font-size-picker/font-size-picker-toggle-group.js +50 -0
- package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -0
- package/build/font-size-picker/index.js +39 -76
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/utils.js +17 -89
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/form-token-field/index.js +9 -6
- package/build/form-token-field/index.js.map +1 -1
- package/build/gradient-picker/index.js +3 -9
- package/build/gradient-picker/index.js.map +1 -1
- package/build/higher-order/navigate-regions/index.js +3 -0
- package/build/higher-order/navigate-regions/index.js.map +1 -1
- package/build/higher-order/with-fallback-styles/index.js +2 -2
- package/build/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build/icon/index.js +3 -2
- package/build/icon/index.js.map +1 -1
- package/build/index.js +21 -1
- package/build/index.js.map +1 -1
- package/build/input-control/index.js +17 -5
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +2 -0
- package/build/input-control/input-base.js.map +1 -1
- package/build/menu-group/index.js +17 -3
- package/build/menu-group/index.js.map +1 -1
- package/build/menu-group/types.js +6 -0
- package/build/menu-group/types.js.map +1 -0
- package/build/mobile/bottom-sheet/cell.native.js +1 -1
- package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build/mobile/bottom-sheet/switch-cell.native.js +1 -3
- package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build/mobile/global-styles-context/index.native.js +8 -8
- package/build/mobile/global-styles-context/index.native.js.map +1 -1
- package/build/mobile/keyboard-aware-flat-list/index.ios.js +4 -2
- package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build/modal/index.js +8 -0
- package/build/modal/index.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +12 -8
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +9 -5
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/number-control/styles/number-control-styles.js +8 -8
- package/build/number-control/styles/number-control-styles.js.map +1 -1
- package/build/palette-edit/index.js +75 -34
- package/build/palette-edit/index.js.map +1 -1
- package/build/popover/index.js +18 -6
- package/build/popover/index.js.map +1 -1
- package/build/query-controls/index.js +1 -0
- package/build/query-controls/index.js.map +1 -1
- package/build/range-control/styles/range-control-styles.js +47 -57
- package/build/range-control/styles/range-control-styles.js.map +1 -1
- package/build/snackbar/index.js +35 -24
- package/build/snackbar/index.js.map +1 -1
- package/build/snackbar/list.js +14 -19
- package/build/snackbar/list.js.map +1 -1
- package/build/snackbar/types.js +6 -0
- package/build/snackbar/types.js.map +1 -0
- package/build/spinner/styles.js +4 -4
- package/build/spinner/styles.js.map +1 -1
- package/build/tab-panel/index.js +12 -8
- package/build/tab-panel/index.js.map +1 -1
- package/build/theme/color-algorithms.js +118 -0
- package/build/theme/color-algorithms.js.map +1 -0
- package/build/theme/index.js +21 -18
- package/build/theme/index.js.map +1 -1
- package/build/theme/styles.js +10 -7
- package/build/theme/styles.js.map +1 -1
- package/build/toggle-control/index.js +5 -2
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/component.js +1 -0
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +11 -6
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/tools-panel/styles.js +14 -14
- package/build/tools-panel/styles.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +9 -5
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/ui/context/context-system-provider.js +3 -1
- package/build/ui/context/context-system-provider.js.map +1 -1
- package/build/unit-control/index.js +5 -2
- package/build/unit-control/index.js.map +1 -1
- package/build/utils/colors-values.js +4 -3
- package/build/utils/colors-values.js.map +1 -1
- package/build/utils/config-values.js +0 -2
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/hooks/use-controlled-value.js.map +1 -1
- package/build/utils/input/base.js +2 -2
- package/build/utils/input/base.js.map +1 -1
- package/build/view/index.js.map +1 -1
- package/build-module/alignment-matrix-control/cell.js.map +1 -1
- package/build-module/alignment-matrix-control/icon.js +4 -2
- package/build-module/alignment-matrix-control/icon.js.map +1 -1
- package/build-module/alignment-matrix-control/index.js +23 -1
- package/build-module/alignment-matrix-control/index.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +13 -13
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +16 -16
- package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
- package/build-module/alignment-matrix-control/types.js +2 -0
- package/build-module/alignment-matrix-control/types.js.map +1 -0
- package/build-module/alignment-matrix-control/utils.js +13 -8
- package/build-module/alignment-matrix-control/utils.js.map +1 -1
- package/build-module/angle-picker-control/index.js +2 -1
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +9 -9
- package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
- package/build-module/autocomplete/index.js +45 -12
- package/build-module/autocomplete/index.js.map +1 -1
- package/build-module/base-control/hooks.js +41 -0
- package/build-module/base-control/hooks.js.map +1 -0
- package/build-module/base-control/index.js +18 -8
- package/build-module/base-control/index.js.map +1 -1
- package/build-module/base-field/hook.js +0 -14
- package/build-module/base-field/hook.js.map +1 -1
- package/build-module/base-field/index.js.map +1 -1
- package/build-module/base-field/styles.js +5 -5
- package/build-module/base-field/styles.js.map +1 -1
- package/build-module/base-field/types.js +2 -0
- package/build-module/base-field/types.js.map +1 -0
- package/build-module/border-box-control/border-box-control/component.js +1 -1
- package/build-module/border-box-control/border-box-control/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control/hook.js +13 -1
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/hook.js +11 -1
- package/build-module/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
- package/build-module/border-control/border-control/component.js +3 -2
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +11 -1
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/component.js +1 -1
- package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/hook.js +10 -2
- package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build-module/border-control/styles.js +17 -17
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/box-control/linked-button.js +3 -4
- package/build-module/box-control/linked-button.js.map +1 -1
- package/build-module/color-palette/index.js +3 -8
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-picker/input-with-slider.js +18 -3
- 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/custom-select-control/index.js +19 -4
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/dashicon/index.js +18 -6
- package/build-module/dashicon/index.js.map +1 -1
- package/build-module/date-time/date-time/index.js +4 -4
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/draggable/index.js +59 -38
- package/build-module/draggable/index.js.map +1 -1
- package/build-module/draggable/types.js +2 -0
- package/build-module/draggable/types.js.map +1 -0
- package/build-module/duotone-picker/duotone-picker.js +2 -2
- package/build-module/duotone-picker/duotone-picker.js.map +1 -1
- package/build-module/flex/flex/hook.js +2 -3
- package/build-module/flex/flex/hook.js.map +1 -1
- package/build-module/focal-point-picker/focal-point.js +3 -13
- package/build-module/focal-point-picker/focal-point.js.map +1 -1
- package/build-module/focal-point-picker/styles/focal-point-style.js +6 -52
- package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
- package/build-module/font-size-picker/constants.js +31 -0
- package/build-module/font-size-picker/constants.js.map +1 -0
- package/build-module/font-size-picker/font-size-picker-select.js +83 -0
- package/build-module/font-size-picker/font-size-picker-select.js.map +1 -0
- package/build-module/font-size-picker/font-size-picker-toggle-group.js +40 -0
- package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -0
- package/build-module/font-size-picker/index.js +38 -76
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/utils.js +15 -86
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/form-token-field/index.js +9 -6
- package/build-module/form-token-field/index.js.map +1 -1
- package/build-module/gradient-picker/index.js +3 -8
- package/build-module/gradient-picker/index.js.map +1 -1
- package/build-module/higher-order/navigate-regions/index.js +3 -0
- package/build-module/higher-order/navigate-regions/index.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +2 -2
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/icon/index.js +3 -2
- package/build-module/icon/index.js.map +1 -1
- package/build-module/index.js +3 -2
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/index.js +16 -5
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +2 -0
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/menu-group/index.js +20 -2
- package/build-module/menu-group/index.js.map +1 -1
- package/build-module/menu-group/types.js +2 -0
- package/build-module/menu-group/types.js.map +1 -0
- package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
- package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
- package/build-module/mobile/bottom-sheet/switch-cell.native.js +1 -2
- package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
- package/build-module/mobile/global-styles-context/index.native.js +8 -7
- package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
- package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
- package/build-module/modal/index.js +8 -0
- package/build-module/modal/index.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +12 -8
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +9 -5
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/number-control/styles/number-control-styles.js +8 -10
- package/build-module/number-control/styles/number-control-styles.js.map +1 -1
- package/build-module/palette-edit/index.js +76 -35
- package/build-module/palette-edit/index.js.map +1 -1
- package/build-module/popover/index.js +18 -6
- package/build-module/popover/index.js.map +1 -1
- package/build-module/query-controls/index.js +1 -0
- package/build-module/query-controls/index.js.map +1 -1
- package/build-module/range-control/styles/range-control-styles.js +47 -57
- package/build-module/range-control/styles/range-control-styles.js.map +1 -1
- package/build-module/snackbar/index.js +33 -23
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/snackbar/list.js +14 -22
- package/build-module/snackbar/list.js.map +1 -1
- package/build-module/snackbar/types.js +2 -0
- package/build-module/snackbar/types.js.map +1 -0
- package/build-module/spinner/styles.js +4 -4
- package/build-module/spinner/styles.js.map +1 -1
- package/build-module/tab-panel/index.js +13 -9
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/theme/color-algorithms.js +105 -0
- package/build-module/theme/color-algorithms.js.map +1 -0
- package/build-module/theme/index.js +21 -17
- package/build-module/theme/index.js.map +1 -1
- package/build-module/theme/styles.js +8 -6
- package/build-module/theme/styles.js.map +1 -1
- package/build-module/toggle-control/index.js +4 -2
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/component.js +1 -0
- package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/styles.js +12 -6
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/tools-panel/styles.js +14 -14
- package/build-module/tools-panel/styles.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +9 -5
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/ui/context/context-system-provider.js +3 -2
- package/build-module/ui/context/context-system-provider.js.map +1 -1
- package/build-module/unit-control/index.js +5 -2
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/utils/colors-values.js +4 -3
- package/build-module/utils/colors-values.js.map +1 -1
- package/build-module/utils/config-values.js +0 -2
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
- package/build-module/utils/input/base.js +2 -2
- package/build-module/utils/input/base.js.map +1 -1
- package/build-module/view/index.js.map +1 -1
- package/build-style/style-rtl.css +145 -100
- package/build-style/style.css +145 -100
- package/build-types/alignment-matrix-control/cell.d.ts +5 -0
- package/build-types/alignment-matrix-control/cell.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/icon.d.ts +6 -0
- package/build-types/alignment-matrix-control/icon.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/index.d.ts +30 -0
- package/build-types/alignment-matrix-control/index.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/stories/index.d.ts +14 -0
- package/build-types/alignment-matrix-control/stories/index.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +19 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts +23 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/test/index.d.ts +2 -0
- package/build-types/alignment-matrix-control/test/index.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/types.d.ts +39 -0
- package/build-types/alignment-matrix-control/types.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/utils.d.ts +33 -0
- package/build-types/alignment-matrix-control/utils.d.ts.map +1 -0
- package/build-types/base-control/hooks.d.ts +23 -0
- package/build-types/base-control/hooks.d.ts.map +1 -0
- package/build-types/base-control/index.d.ts +17 -7
- package/build-types/base-control/index.d.ts.map +1 -1
- package/build-types/base-control/stories/index.d.ts.map +1 -1
- package/build-types/base-control/test/index.d.ts +2 -0
- package/build-types/base-control/test/index.d.ts.map +1 -0
- package/build-types/base-control/types.d.ts +8 -2
- package/build-types/base-control/types.d.ts.map +1 -1
- package/build-types/base-field/hook.d.ts +7 -31
- package/build-types/base-field/hook.d.ts.map +1 -1
- package/build-types/base-field/index.d.ts +1 -1
- package/build-types/base-field/index.d.ts.map +1 -1
- package/build-types/base-field/styles.d.ts +5 -5
- package/build-types/base-field/styles.d.ts.map +1 -1
- package/build-types/base-field/test/index.d.ts +2 -0
- package/build-types/base-field/test/index.d.ts.map +1 -0
- package/build-types/base-field/types.d.ts +29 -0
- package/build-types/base-field/types.d.ts.map +1 -0
- package/build-types/border-box-control/border-box-control/component.d.ts +4 -4
- package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control/hook.d.ts +8 -8
- package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/component.d.ts +4 -2
- package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +2 -2
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +3 -3
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +7 -7
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/component.d.ts +3 -2
- package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +2 -2
- package/build-types/border-box-control/stories/index.d.ts +3 -3
- package/build-types/border-box-control/types.d.ts +5 -38
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +4 -2
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +7 -7
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts +3 -3
- package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +7 -7
- package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-style-picker/hook.d.ts +2 -2
- package/build-types/border-control/stories/index.d.ts +24 -12
- package/build-types/border-control/stories/index.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +10 -51
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +2 -2
- package/build-types/card/card-body/hook.d.ts +2 -2
- package/build-types/card/card-divider/hook.d.ts +2 -2
- package/build-types/card/card-footer/hook.d.ts +2 -2
- package/build-types/card/card-header/hook.d.ts +2 -2
- package/build-types/card/card-media/hook.d.ts +2 -2
- package/build-types/color-palette/index.d.ts +16 -2
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.d.ts +30 -2
- package/build-types/color-palette/stories/index.d.ts.map +1 -1
- package/build-types/color-palette/styles.d.ts +1 -1
- package/build-types/color-palette/types.d.ts +14 -10
- package/build-types/color-palette/types.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 +5 -5
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/dashicon/index.d.ts +7 -16
- package/build-types/dashicon/index.d.ts.map +1 -1
- package/build-types/dashicon/types.d.ts +14 -0
- package/build-types/dashicon/types.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +3 -3
- package/build-types/date-time/date-time/styles.d.ts +3 -3
- package/build-types/date-time/time/styles.d.ts +8 -8
- package/build-types/date-time/types.d.ts +0 -16
- package/build-types/date-time/types.d.ts.map +1 -1
- package/build-types/draggable/index.d.ts +42 -66
- package/build-types/draggable/index.d.ts.map +1 -1
- package/build-types/draggable/stories/index.d.ts +12 -0
- package/build-types/draggable/stories/index.d.ts.map +1 -0
- package/build-types/draggable/types.d.ts +58 -0
- package/build-types/draggable/types.d.ts.map +1 -0
- package/build-types/elevation/hook.d.ts +2 -2
- package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
- package/build-types/flex/flex/hook.d.ts +2 -2
- package/build-types/flex/flex/hook.d.ts.map +1 -1
- package/build-types/flex/flex-block/hook.d.ts +2 -2
- package/build-types/flex/flex-item/hook.d.ts +2 -2
- package/build-types/focal-point-picker/focal-point.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -5
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
- package/build-types/focal-point-picker/styles/focal-point-style.d.ts +1 -12
- package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
- package/build-types/font-size-picker/constants.d.ts +15 -0
- package/build-types/font-size-picker/constants.d.ts.map +1 -0
- package/build-types/font-size-picker/font-size-picker-select.d.ts +5 -0
- package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -0
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts +5 -0
- package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -0
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/types.d.ts +13 -13
- package/build-types/font-size-picker/types.d.ts.map +1 -1
- package/build-types/font-size-picker/utils.d.ts +6 -18
- package/build-types/font-size-picker/utils.d.ts.map +1 -1
- package/build-types/form-token-field/index.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +2 -2
- package/build-types/h-stack/component.d.ts +1 -1
- package/build-types/h-stack/hook.d.ts +2 -2
- package/build-types/heading/hook.d.ts +2 -2
- package/build-types/icon/index.d.ts +1 -1
- package/build-types/icon/index.d.ts.map +1 -1
- package/build-types/input-control/index.d.ts +1 -1
- package/build-types/input-control/index.d.ts.map +1 -1
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/stories/index.d.ts +1 -0
- package/build-types/input-control/stories/index.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +2 -1
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +2 -2
- package/build-types/item-group/item-group/hook.d.ts +2 -2
- package/build-types/menu-group/index.d.ts +21 -1
- package/build-types/menu-group/index.d.ts.map +1 -1
- package/build-types/menu-group/test/index.d.ts +2 -0
- package/build-types/menu-group/test/index.d.ts.map +1 -0
- package/build-types/menu-group/types.d.ts +23 -0
- package/build-types/menu-group/types.d.ts.map +1 -0
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/stories/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +3 -3
- package/build-types/navigator/navigator-button/hook.d.ts +3 -3
- 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/number-control/index.d.ts +2 -2
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.d.ts +25 -0
- package/build-types/number-control/stories/index.d.ts.map +1 -0
- package/build-types/number-control/styles/number-control-styles.d.ts +6 -6
- package/build-types/number-control/styles/number-control-styles.d.ts.map +1 -1
- package/build-types/number-control/test/index.d.ts +2 -0
- package/build-types/number-control/test/index.d.ts.map +1 -0
- package/build-types/popover/index.d.ts +1 -1
- package/build-types/popover/index.d.ts.map +1 -1
- package/build-types/popover/stories/e2e/index.d.ts +1 -1
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +2 -2
- package/build-types/resizable-box/resize-tooltip/index.d.ts +15 -19
- package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts +4 -3
- package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
- package/build-types/scrollable/hook.d.ts +2 -2
- package/build-types/search-control/index.d.ts +1 -1
- package/build-types/search-control/stories/index.d.ts +2 -2
- package/build-types/snackbar/index.d.ts +19 -0
- package/build-types/snackbar/index.d.ts.map +1 -0
- package/build-types/snackbar/list.d.ts +18 -0
- package/build-types/snackbar/list.d.ts.map +1 -0
- package/build-types/snackbar/stories/index.d.ts +16 -0
- package/build-types/snackbar/stories/index.d.ts.map +1 -0
- package/build-types/snackbar/stories/list.d.ts +12 -0
- package/build-types/snackbar/stories/list.d.ts.map +1 -0
- package/build-types/snackbar/types.d.ts +111 -0
- package/build-types/snackbar/types.d.ts.map +1 -0
- package/build-types/spacer/hook.d.ts +2 -2
- package/build-types/spinner/index.d.ts +1 -1
- package/build-types/surface/hook.d.ts +2 -2
- package/build-types/tab-panel/index.d.ts +1 -1
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/tab-panel/types.d.ts +19 -1
- package/build-types/tab-panel/types.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +2 -2
- package/build-types/text-control/index.d.ts +2 -2
- package/build-types/text-control/stories/index.d.ts.map +1 -1
- package/build-types/text-control/types.d.ts +1 -5
- package/build-types/text-control/types.d.ts.map +1 -1
- package/build-types/theme/color-algorithms.d.ts +20 -0
- package/build-types/theme/color-algorithms.d.ts.map +1 -0
- package/build-types/theme/index.d.ts +1 -1
- package/build-types/theme/index.d.ts.map +1 -1
- package/build-types/theme/stories/index.d.ts +4 -0
- package/build-types/theme/stories/index.d.ts.map +1 -1
- package/build-types/theme/styles.d.ts +3 -2
- package/build-types/theme/styles.d.ts.map +1 -1
- package/build-types/theme/test/color-algorithms.d.ts +2 -0
- package/build-types/theme/test/color-algorithms.d.ts.map +1 -0
- package/build-types/theme/types.d.ts +41 -3
- package/build-types/theme/types.d.ts.map +1 -1
- package/build-types/toggle-control/index.d.ts.map +1 -1
- package/build-types/toggle-group-control/stories/index.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -2
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
- package/build-types/toggle-group-control/types.d.ts +2 -1
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +2 -2
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +2 -2
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +2 -2
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +2 -2
- package/build-types/ui/context/context-system-provider.d.ts.map +1 -1
- package/build-types/ui/control-group/hook.d.ts +2 -2
- package/build-types/ui/control-label/hook.d.ts +2 -2
- package/build-types/ui/form-group/form-group.d.ts +2 -2
- package/build-types/ui/form-group/use-form-group.d.ts +5 -5
- package/build-types/unit-control/index.d.ts +2 -1
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -2
- package/build-types/unit-control/types.d.ts +4 -0
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/utils/colors-values.d.ts +1 -0
- package/build-types/utils/colors-values.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +0 -2
- package/build-types/utils/hooks/use-controlled-value.d.ts +2 -1
- package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
- package/build-types/v-stack/component.d.ts +2 -2
- package/build-types/v-stack/hook.d.ts +2 -2
- package/build-types/v-stack/stories/index.d.ts +2 -2
- package/build-types/view/index.d.ts +1 -1
- package/build-types/view/index.d.ts.map +1 -1
- package/package.json +21 -20
- package/src/alignment-matrix-control/README.md +7 -7
- package/src/alignment-matrix-control/{cell.js → cell.tsx} +7 -1
- package/src/alignment-matrix-control/{icon.js → icon.tsx} +6 -3
- package/src/alignment-matrix-control/{index.js → index.tsx} +31 -4
- package/src/alignment-matrix-control/stories/{index.js → index.tsx} +17 -9
- package/src/alignment-matrix-control/styles/{alignment-matrix-control-icon-styles.js → alignment-matrix-control-icon-styles.ts} +11 -3
- package/src/alignment-matrix-control/styles/{alignment-matrix-control-styles.js → alignment-matrix-control-styles.ts} +13 -3
- package/src/alignment-matrix-control/test/{index.js → index.tsx} +5 -5
- package/src/alignment-matrix-control/types.ts +54 -0
- package/src/alignment-matrix-control/{utils.js → utils.tsx} +24 -14
- package/src/angle-picker-control/index.js +2 -1
- package/src/angle-picker-control/styles/angle-picker-control-styles.js +4 -0
- package/src/autocomplete/index.js +55 -15
- package/src/autocomplete/style.scss +1 -1
- package/src/base-control/README.md +21 -12
- package/src/base-control/hooks.ts +45 -0
- package/src/base-control/index.tsx +18 -7
- package/src/base-control/stories/index.tsx +8 -10
- package/src/base-control/test/index.tsx +52 -0
- package/src/base-control/types.ts +8 -2
- package/src/base-field/README.md +21 -22
- package/src/base-field/{hook.js → hook.ts} +5 -15
- package/src/base-field/{index.js → index.ts} +0 -0
- package/src/base-field/{styles.js → styles.ts} +2 -2
- package/src/base-field/test/__snapshots__/{index.js.snap → index.tsx.snap} +13 -11
- package/src/base-field/test/index.tsx +84 -0
- package/src/base-field/types.ts +29 -0
- package/src/border-box-control/border-box-control/README.md +6 -17
- package/src/border-box-control/border-box-control/component.tsx +1 -1
- package/src/border-box-control/border-box-control/hook.ts +18 -4
- package/src/border-box-control/border-box-control-split-controls/hook.ts +10 -0
- package/src/border-box-control/test/index.js +3 -1
- package/src/border-box-control/types.ts +32 -58
- package/src/border-control/border-control/README.md +4 -17
- package/src/border-control/border-control/component.tsx +3 -2
- package/src/border-control/border-control/hook.ts +10 -0
- package/src/border-control/border-control-dropdown/component.tsx +7 -6
- package/src/border-control/border-control-dropdown/hook.ts +9 -1
- package/src/border-control/styles.ts +1 -10
- package/src/border-control/types.ts +43 -80
- package/src/box-control/linked-button.js +8 -11
- package/src/box-control/test/index.js +206 -135
- package/src/button/stories/index.js +30 -0
- package/src/button/style.scss +17 -14
- package/src/button/test/index.js +32 -15
- package/src/card/test/__snapshots__/index.tsx.snap +64 -368
- package/src/card/test/index.tsx +34 -22
- package/src/checkbox-control/style.scss +3 -3
- package/src/circular-option-picker/style.scss +1 -0
- package/src/color-palette/README.md +12 -16
- package/src/color-palette/index.tsx +5 -7
- package/src/color-palette/stories/index.tsx +1 -5
- package/src/color-palette/style.scss +1 -1
- package/src/color-palette/test/__snapshots__/index.tsx.snap +4 -4
- package/src/color-palette/test/index.tsx +84 -36
- package/src/color-palette/types.ts +14 -10
- package/src/color-picker/README.md +1 -0
- package/src/color-picker/input-with-slider.tsx +14 -2
- package/src/color-picker/styles.ts +0 -4
- package/src/confirm-dialog/README.md +3 -2
- package/src/custom-select-control/README.md +14 -0
- package/src/custom-select-control/index.js +21 -2
- package/src/custom-select-control/stories/index.js +1 -0
- package/src/custom-select-control/style.scss +6 -1
- package/src/custom-select-control/test/index.js +39 -0
- package/src/dashicon/index.tsx +51 -0
- package/src/dashicon/types.ts +17 -0
- package/src/date-time/date/test/index.tsx +2 -2
- package/src/date-time/date-time/index.tsx +2 -2
- package/src/date-time/types.ts +0 -19
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -8
- package/src/disabled/test/index.tsx +21 -11
- package/src/divider/test/index.tsx +4 -4
- package/src/draggable/README.md +13 -18
- package/src/draggable/{index.js → index.tsx} +71 -47
- package/src/draggable/stories/index.tsx +83 -0
- package/src/draggable/types.ts +58 -0
- package/src/drop-zone/style.scss +1 -1
- package/src/dropdown/test/index.js +39 -49
- package/src/dropdown-menu/test/index.js +18 -12
- package/src/duotone-picker/duotone-picker.js +2 -2
- package/src/flex/flex/hook.ts +0 -3
- package/src/flex/test/index.tsx +29 -3
- package/src/focal-point-picker/focal-point.tsx +2 -24
- package/src/focal-point-picker/styles/focal-point-style.ts +8 -32
- package/src/focal-point-picker/test/media.js +26 -21
- package/src/font-size-picker/constants.ts +37 -0
- package/src/font-size-picker/font-size-picker-select.tsx +98 -0
- package/src/font-size-picker/font-size-picker-toggle-group.tsx +41 -0
- package/src/font-size-picker/index.tsx +55 -118
- package/src/font-size-picker/test/index.tsx +253 -44
- package/src/font-size-picker/test/utils.ts +58 -98
- package/src/font-size-picker/types.ts +25 -16
- package/src/font-size-picker/utils.ts +16 -102
- package/src/form-toggle/style.scss +3 -3
- package/src/form-token-field/index.tsx +13 -5
- package/src/form-token-field/style.scss +3 -3
- package/src/form-token-field/test/index.tsx +6 -6
- package/src/gradient-picker/index.js +5 -8
- package/src/grid/test/grid.tsx +31 -31
- package/src/higher-order/navigate-regions/index.js +4 -0
- package/src/higher-order/navigate-regions/style.scss +52 -20
- package/src/higher-order/with-fallback-styles/index.js +4 -2
- package/src/higher-order/with-filters/test/index.js +94 -101
- package/src/higher-order/with-focus-return/test/index.js +1 -4
- package/src/higher-order/with-notices/test/index.js +1 -1
- package/src/icon/index.tsx +3 -2
- package/src/icon/test/index.js +10 -0
- package/src/index.js +3 -2
- package/src/input-control/index.tsx +42 -28
- package/src/input-control/input-base.tsx +8 -1
- package/src/input-control/stories/index.tsx +6 -0
- package/src/input-control/test/index.js +18 -0
- package/src/input-control/types.ts +2 -0
- package/src/item-group/stories/index.js +1 -1
- package/src/menu-group/{index.js → index.tsx} +22 -3
- package/src/menu-group/test/{index.js → index.tsx} +0 -0
- package/src/menu-group/types.ts +23 -0
- package/src/menu-item/style.scss +1 -1
- package/src/mobile/bottom-sheet/cell.native.js +1 -1
- package/src/mobile/bottom-sheet/switch-cell.native.js +2 -2
- package/src/mobile/bottom-sheet/test/range-cell.native.js +4 -4
- package/src/mobile/global-styles-context/index.native.js +9 -11
- package/src/mobile/html-text-input/test/index.native.js +2 -2
- package/src/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
- package/src/mobile/link-settings/test/edit.native.js +70 -126
- package/src/mobile/link-settings/test/link-settings-navigation.native.js +5 -5
- package/src/modal/index.tsx +11 -0
- package/src/modal/stories/index.tsx +3 -0
- package/src/modal/test/index.tsx +15 -0
- package/src/navigation/stories/index.js +6 -6
- package/src/navigation/stories/{controlled-state.js → utils/controlled-state.js} +3 -3
- package/src/navigation/stories/{default.js → utils/default.js} +3 -3
- package/src/navigation/stories/{group.js → utils/group.js} +4 -4
- package/src/navigation/stories/{hide-if-empty.js → utils/hide-if-empty.js} +3 -3
- package/src/navigation/stories/{more-examples.js → utils/more-examples.js} +4 -4
- package/src/navigation/stories/{search.js → utils/search.js} +5 -5
- package/src/navigator/navigator-provider/component.tsx +13 -10
- package/src/navigator/navigator-screen/component.tsx +8 -3
- package/src/notice/README.md +2 -1
- package/src/notice/style.scss +1 -1
- package/src/notice/test/list.js +8 -5
- package/src/number-control/stories/{index.js → index.tsx} +24 -7
- package/src/number-control/styles/{number-control-styles.js → number-control-styles.ts} +5 -3
- package/src/number-control/test/index.tsx +600 -0
- package/src/palette-edit/index.js +91 -39
- package/src/palette-edit/test/index.js +25 -1
- package/src/panel/style.scss +1 -1
- package/src/popover/index.tsx +28 -9
- package/src/popover/style.scss +12 -11
- package/src/popover/test/index.tsx +25 -15
- package/src/query-controls/index.js +1 -0
- package/src/range-control/styles/range-control-styles.ts +2 -2
- package/src/range-control/test/index.tsx +57 -60
- package/src/resizable-box/style.scss +3 -2
- package/src/sandbox/test/index.js +13 -11
- package/src/scrollable/test/index.tsx +7 -3
- package/src/search-control/style.scss +5 -1
- package/src/snackbar/README.md +63 -8
- package/src/snackbar/{index.js → index.tsx} +46 -28
- package/src/snackbar/{list.js → list.tsx} +20 -21
- package/src/snackbar/stories/index.tsx +96 -0
- package/src/snackbar/stories/list.tsx +98 -0
- package/src/snackbar/style.scss +2 -2
- package/src/snackbar/types.ts +116 -0
- package/src/spacer/test/index.tsx +33 -3
- package/src/spinner/styles.ts +1 -1
- package/src/surface/test/index.tsx +12 -12
- package/src/tab-panel/README.md +9 -0
- package/src/tab-panel/index.tsx +23 -9
- package/src/tab-panel/style.scss +46 -35
- package/src/tab-panel/test/index.tsx +111 -0
- package/src/tab-panel/types.ts +20 -1
- package/src/text/test/__snapshots__/index.tsx.snap +1 -0
- package/src/text/test/index.tsx +100 -48
- package/src/text-control/stories/index.tsx +0 -1
- package/src/text-control/types.ts +1 -6
- package/src/theme/README.md +32 -2
- package/src/theme/color-algorithms.ts +138 -0
- package/src/theme/index.tsx +23 -16
- package/src/theme/stories/index.tsx +67 -0
- package/src/theme/styles.ts +22 -17
- package/src/theme/test/color-algorithms.ts +100 -0
- package/src/theme/test/index.tsx +68 -35
- package/src/theme/types.ts +43 -3
- package/src/toggle-control/index.tsx +4 -2
- package/src/toggle-group-control/stories/index.tsx +2 -0
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -8
- package/src/toggle-group-control/test/index.tsx +40 -17
- package/src/toggle-group-control/toggle-group-control/README.md +8 -1
- package/src/toggle-group-control/toggle-group-control/component.tsx +1 -1
- package/src/toggle-group-control/toggle-group-control/styles.ts +22 -16
- package/src/toggle-group-control/types.ts +2 -1
- package/src/toolbar-group/test/index.js +8 -6
- package/src/tools-panel/stories/index.js +1 -1
- package/src/tools-panel/stories/{tools-panel-with-item-group-slot.js → utils/tools-panel-with-item-group-slot.js} +14 -11
- package/src/tools-panel/styles.ts +1 -1
- package/src/tools-panel/test/index.js +20 -14
- package/src/tools-panel/tools-panel-item/hook.ts +6 -1
- package/src/tooltip/README.md +7 -0
- package/src/tooltip/style.scss +2 -2
- package/src/tooltip/test/index.js +109 -18
- package/src/tree-grid/test/index.js +12 -12
- package/src/truncate/test/index.tsx +9 -9
- package/src/ui/context/context-system-provider.js +3 -2
- package/src/ui/context/test/context-system-provider.js +5 -4
- package/src/ui/control-label/test/index.js +3 -5
- package/src/ui/form-group/test/index.js +16 -17
- package/src/unit-control/README.md +9 -1
- package/src/unit-control/index.tsx +3 -0
- package/src/unit-control/test/index.tsx +1 -0
- package/src/unit-control/types.ts +4 -0
- package/src/utils/colors-values.js +5 -3
- package/src/utils/config-values.js +0 -2
- package/src/utils/hooks/stories/use-cx.js +1 -1
- package/src/utils/hooks/use-controlled-value.ts +2 -2
- package/src/utils/input/base.js +2 -2
- package/src/utils/theme-variables.scss +20 -0
- package/src/view/{index.js → index.ts} +0 -0
- package/tsconfig.json +2 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/src/base-field/test/index.js +0 -67
- package/src/dashicon/index.js +0 -26
- package/src/draggable/stories/index.js +0 -72
- package/src/number-control/test/index.js +0 -478
- package/src/snackbar/stories/index.js +0 -89
|
@@ -29,6 +29,7 @@ show "Mixed" placeholder text.
|
|
|
29
29
|
```jsx
|
|
30
30
|
import { __experimentalBorderBoxControl as BorderBoxControl } from '@wordpress/components';
|
|
31
31
|
import { __ } from '@wordpress/i18n';
|
|
32
|
+
import { useState } from '@wordpress/element';
|
|
32
33
|
|
|
33
34
|
const colors = [
|
|
34
35
|
{ name: 'Blue 20', color: '#72aee6' },
|
|
@@ -68,7 +69,7 @@ a `SlotFillProvider` overall.
|
|
|
68
69
|
|
|
69
70
|
## Props
|
|
70
71
|
|
|
71
|
-
### `colors`: `
|
|
72
|
+
### `colors`: `( PaletteObject | ColorObject )[]`
|
|
72
73
|
|
|
73
74
|
An array of color definitions. This may also be a multi-dimensional array where
|
|
74
75
|
colors are organized by multiple origins.
|
|
@@ -76,6 +77,7 @@ colors are organized by multiple origins.
|
|
|
76
77
|
Each color may be an object containing a `name` and `color` value.
|
|
77
78
|
|
|
78
79
|
- Required: No
|
|
80
|
+
- Default: `[]`
|
|
79
81
|
|
|
80
82
|
### `disableCustomColors`: `boolean`
|
|
81
83
|
|
|
@@ -89,6 +91,7 @@ This controls whether the alpha channel will be offered when selecting
|
|
|
89
91
|
custom colors.
|
|
90
92
|
|
|
91
93
|
- Required: No
|
|
94
|
+
- Default: `false`
|
|
92
95
|
|
|
93
96
|
### `enableStyle`: `boolean`
|
|
94
97
|
|
|
@@ -124,7 +127,7 @@ _Note: The will be `undefined` if a user clears all borders._
|
|
|
124
127
|
|
|
125
128
|
### `popoverPlacement`: `string`
|
|
126
129
|
|
|
127
|
-
The position of the color
|
|
130
|
+
The position of the color popovers relative to the control wrapper.
|
|
128
131
|
|
|
129
132
|
By default, popovers are displayed relative to the button that initiated the popover. By supplying a popover placement, you force the popover to display in a specific location.
|
|
130
133
|
|
|
@@ -134,7 +137,7 @@ The available base placements are 'top', 'right', 'bottom', 'left'. Each of thes
|
|
|
134
137
|
|
|
135
138
|
### `popoverOffset`: `number`
|
|
136
139
|
|
|
137
|
-
|
|
140
|
+
The space between the popover and the control wrapper.
|
|
138
141
|
|
|
139
142
|
- Required: No
|
|
140
143
|
|
|
@@ -166,17 +169,3 @@ const splitBorders = {
|
|
|
166
169
|
```
|
|
167
170
|
|
|
168
171
|
- Required: No
|
|
169
|
-
|
|
170
|
-
### `__experimentalHasMultipleOrigins`: `boolean`
|
|
171
|
-
|
|
172
|
-
This is passed on to the color related sub-components which need to be made
|
|
173
|
-
aware of whether the colors prop contains multiple origins.
|
|
174
|
-
|
|
175
|
-
- Required: No
|
|
176
|
-
|
|
177
|
-
### `__experimentalIsRenderedInSidebar`: `boolean`
|
|
178
|
-
|
|
179
|
-
This is passed on to the color related sub-components so they may render more
|
|
180
|
-
effectively when used within a sidebar.
|
|
181
|
-
|
|
182
|
-
- Required: No
|
|
@@ -25,10 +25,18 @@ import type { Borders, BorderSide, BorderBoxControlProps } from '../types';
|
|
|
25
25
|
export function useBorderBoxControl(
|
|
26
26
|
props: WordPressComponentProps< BorderBoxControlProps, 'div' >
|
|
27
27
|
) {
|
|
28
|
-
const {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const {
|
|
29
|
+
className,
|
|
30
|
+
colors = [],
|
|
31
|
+
onChange,
|
|
32
|
+
enableAlpha = false,
|
|
33
|
+
enableStyle = true,
|
|
34
|
+
size = 'default',
|
|
35
|
+
value,
|
|
36
|
+
__experimentalHasMultipleOrigins = false,
|
|
37
|
+
__experimentalIsRenderedInSidebar = false,
|
|
38
|
+
...otherProps
|
|
39
|
+
} = useContextSystem( props, 'BorderBoxControl' );
|
|
32
40
|
|
|
33
41
|
const mixedBorders = hasMixedBorders( value );
|
|
34
42
|
const splitBorders = hasSplitBorders( value );
|
|
@@ -114,7 +122,10 @@ export function useBorderBoxControl(
|
|
|
114
122
|
return {
|
|
115
123
|
...otherProps,
|
|
116
124
|
className: classes,
|
|
125
|
+
colors,
|
|
117
126
|
disableUnits: mixedBorders && ! hasWidthValue,
|
|
127
|
+
enableAlpha,
|
|
128
|
+
enableStyle,
|
|
118
129
|
hasMixedBorders: mixedBorders,
|
|
119
130
|
isLinked,
|
|
120
131
|
linkedControlClassName,
|
|
@@ -122,7 +133,10 @@ export function useBorderBoxControl(
|
|
|
122
133
|
onSplitChange,
|
|
123
134
|
toggleLinked,
|
|
124
135
|
linkedValue,
|
|
136
|
+
size,
|
|
125
137
|
splitValue,
|
|
126
138
|
wrapperClassName,
|
|
139
|
+
__experimentalHasMultipleOrigins,
|
|
140
|
+
__experimentalIsRenderedInSidebar,
|
|
127
141
|
};
|
|
128
142
|
}
|
|
@@ -17,7 +17,12 @@ export function useBorderBoxControlSplitControls(
|
|
|
17
17
|
) {
|
|
18
18
|
const {
|
|
19
19
|
className,
|
|
20
|
+
colors = [],
|
|
21
|
+
enableAlpha = false,
|
|
22
|
+
enableStyle = true,
|
|
20
23
|
size = 'default',
|
|
24
|
+
__experimentalHasMultipleOrigins = false,
|
|
25
|
+
__experimentalIsRenderedInSidebar = false,
|
|
21
26
|
...otherProps
|
|
22
27
|
} = useContextSystem( props, 'BorderBoxControlSplitControls' );
|
|
23
28
|
|
|
@@ -39,7 +44,12 @@ export function useBorderBoxControlSplitControls(
|
|
|
39
44
|
...otherProps,
|
|
40
45
|
centeredClassName,
|
|
41
46
|
className: classes,
|
|
47
|
+
colors,
|
|
48
|
+
enableAlpha,
|
|
49
|
+
enableStyle,
|
|
42
50
|
rightAlignedClassName,
|
|
43
51
|
size,
|
|
52
|
+
__experimentalHasMultipleOrigins,
|
|
53
|
+
__experimentalIsRenderedInSidebar,
|
|
44
54
|
};
|
|
45
55
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { render, screen } from '@testing-library/react';
|
|
5
5
|
import userEvent from '@testing-library/user-event';
|
|
6
|
+
import { act } from 'react-test-renderer';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -186,6 +187,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
186
187
|
|
|
187
188
|
const colorButton = screen.getByLabelText( colorPickerRegex );
|
|
188
189
|
await user.click( colorButton );
|
|
190
|
+
await act( () => Promise.resolve() );
|
|
189
191
|
|
|
190
192
|
const styleLabel = screen.queryByText( 'Style' );
|
|
191
193
|
const solidButton = screen.queryByRole( 'button', {
|
|
@@ -309,7 +311,7 @@ describe( 'BorderBoxControl', () => {
|
|
|
309
311
|
await user.click( colorButtons[ 3 ] );
|
|
310
312
|
assertStyleOptionsMissing();
|
|
311
313
|
await user.click( colorButtons[ 3 ] );
|
|
312
|
-
}
|
|
314
|
+
} );
|
|
313
315
|
} );
|
|
314
316
|
|
|
315
317
|
describe( 'onChange handling', () => {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
Border,
|
|
6
|
+
ColorProps,
|
|
7
|
+
LabelProps,
|
|
8
|
+
BorderControlProps,
|
|
9
|
+
} from '../border-control/types';
|
|
5
10
|
import type { PopoverProps } from '../popover/types';
|
|
6
11
|
|
|
7
12
|
export type Borders = {
|
|
@@ -16,11 +21,8 @@ export type BorderProp = keyof Border;
|
|
|
16
21
|
export type BorderSide = keyof Borders;
|
|
17
22
|
|
|
18
23
|
export type BorderBoxControlProps = ColorProps &
|
|
19
|
-
LabelProps &
|
|
20
|
-
|
|
21
|
-
* This controls whether to support border style selections.
|
|
22
|
-
*/
|
|
23
|
-
enableStyle?: boolean;
|
|
24
|
+
LabelProps &
|
|
25
|
+
Pick< BorderControlProps, 'enableStyle' | 'size' > & {
|
|
24
26
|
/**
|
|
25
27
|
* A callback function invoked when any border value is changed. The value
|
|
26
28
|
* received may be a "flat" border object, one that has properties defining
|
|
@@ -43,15 +45,9 @@ export type BorderBoxControlProps = ColorProps &
|
|
|
43
45
|
* properties but for each side; `top`, `right`, `bottom`, and `left`.
|
|
44
46
|
*/
|
|
45
47
|
value: AnyBorder;
|
|
46
|
-
/**
|
|
47
|
-
* Size of the control.
|
|
48
|
-
*
|
|
49
|
-
* @default 'default'
|
|
50
|
-
*/
|
|
51
|
-
size?: 'default' | '__unstable-large';
|
|
52
48
|
};
|
|
53
49
|
|
|
54
|
-
export type LinkedButtonProps = {
|
|
50
|
+
export type LinkedButtonProps = Pick< BorderBoxControlProps, 'size' > & {
|
|
55
51
|
/**
|
|
56
52
|
* This prop allows the `LinkedButton` to reflect whether the parent
|
|
57
53
|
* `BorderBoxControl` is currently displaying "linked" or "unlinked"
|
|
@@ -64,58 +60,36 @@ export type LinkedButtonProps = {
|
|
|
64
60
|
* `BorderBoxControl`.
|
|
65
61
|
*/
|
|
66
62
|
onClick: () => void;
|
|
67
|
-
/**
|
|
68
|
-
* Size of the control.
|
|
69
|
-
*
|
|
70
|
-
* @default 'default'
|
|
71
|
-
*/
|
|
72
|
-
size?: 'default' | '__unstable-large';
|
|
73
63
|
};
|
|
74
64
|
|
|
75
|
-
export type VisualizerProps = {
|
|
65
|
+
export type VisualizerProps = Pick< BorderBoxControlProps, 'size' > & {
|
|
76
66
|
/**
|
|
77
67
|
* An object representing the current border configuration. It contains
|
|
78
68
|
* properties for each side, with each side an object reflecting the border
|
|
79
69
|
* color, style, and width.
|
|
80
70
|
*/
|
|
81
71
|
value?: Borders;
|
|
82
|
-
/**
|
|
83
|
-
* Size of the control.
|
|
84
|
-
*
|
|
85
|
-
* @default 'default'
|
|
86
|
-
*/
|
|
87
|
-
size?: 'default' | '__unstable-large';
|
|
88
72
|
};
|
|
89
73
|
|
|
90
|
-
export type SplitControlsProps = ColorProps &
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
* color, style, and width.
|
|
113
|
-
*/
|
|
114
|
-
value?: Borders;
|
|
115
|
-
/**
|
|
116
|
-
* Size of the control.
|
|
117
|
-
*
|
|
118
|
-
* @default 'default'
|
|
119
|
-
*/
|
|
120
|
-
size?: 'default' | '__unstable-large';
|
|
121
|
-
};
|
|
74
|
+
export type SplitControlsProps = ColorProps &
|
|
75
|
+
Pick< BorderBoxControlProps, 'enableStyle' | 'size' > & {
|
|
76
|
+
/**
|
|
77
|
+
* A callback that is invoked whenever an individual side's border has
|
|
78
|
+
* changed.
|
|
79
|
+
*/
|
|
80
|
+
onChange: ( value: Border | undefined, side: BorderSide ) => void;
|
|
81
|
+
/**
|
|
82
|
+
* The position of the color popovers compared to the control wrapper.
|
|
83
|
+
*/
|
|
84
|
+
popoverPlacement?: PopoverProps[ 'placement' ];
|
|
85
|
+
/**
|
|
86
|
+
* The space between the popover and the control wrapper.
|
|
87
|
+
*/
|
|
88
|
+
popoverOffset?: PopoverProps[ 'offset' ];
|
|
89
|
+
/**
|
|
90
|
+
* An object representing the current border configuration. It contains
|
|
91
|
+
* properties for each side, with each side an object reflecting the border
|
|
92
|
+
* color, style, and width.
|
|
93
|
+
*/
|
|
94
|
+
value?: Borders;
|
|
95
|
+
};
|
|
@@ -51,7 +51,7 @@ for the `BorderControl`'s color and style options, by rendering your
|
|
|
51
51
|
|
|
52
52
|
## Props
|
|
53
53
|
|
|
54
|
-
### `colors`: `
|
|
54
|
+
### `colors`: `( PaletteObject | ColorObject )[]`
|
|
55
55
|
|
|
56
56
|
An array of color definitions. This may also be a multi-dimensional array where
|
|
57
57
|
colors are organized by multiple origins.
|
|
@@ -59,6 +59,7 @@ colors are organized by multiple origins.
|
|
|
59
59
|
Each color may be an object containing a `name` and `color` value.
|
|
60
60
|
|
|
61
61
|
- Required: No
|
|
62
|
+
- Default: `[]`
|
|
62
63
|
|
|
63
64
|
### `disableCustomColors`: `boolean`
|
|
64
65
|
|
|
@@ -78,11 +79,11 @@ This controls whether the alpha channel will be offered when selecting
|
|
|
78
79
|
custom colors.
|
|
79
80
|
|
|
80
81
|
- Required: No
|
|
82
|
+
- Default: `false`
|
|
81
83
|
|
|
82
84
|
### `enableStyle`: `boolean`
|
|
83
85
|
|
|
84
|
-
This controls whether to
|
|
85
|
-
`BorderDropdown` sub-component.
|
|
86
|
+
This controls whether to support border style selection.
|
|
86
87
|
|
|
87
88
|
- Required: No
|
|
88
89
|
- Default: `true`
|
|
@@ -172,17 +173,3 @@ Flags whether this `BorderControl` should also render a `RangeControl` for
|
|
|
172
173
|
additional control over a border's width.
|
|
173
174
|
|
|
174
175
|
- Required: No
|
|
175
|
-
|
|
176
|
-
### `__experimentalHasMultipleOrigins`: `boolean`
|
|
177
|
-
|
|
178
|
-
This is passed on to the color related sub-components which need to be made
|
|
179
|
-
aware of whether the colors prop contains multiple origins.
|
|
180
|
-
|
|
181
|
-
- Required: No
|
|
182
|
-
|
|
183
|
-
### `__experimentalIsRenderedInSidebar`: `boolean`
|
|
184
|
-
|
|
185
|
-
This is passed on to the color related sub-components so they may render more
|
|
186
|
-
effectively when used within a sidebar.
|
|
187
|
-
|
|
188
|
-
- Required: No
|
|
@@ -41,7 +41,7 @@ const UnconnectedBorderControl = (
|
|
|
41
41
|
disableCustomColors,
|
|
42
42
|
disableUnits,
|
|
43
43
|
enableAlpha,
|
|
44
|
-
enableStyle
|
|
44
|
+
enableStyle,
|
|
45
45
|
hideLabelFromVision,
|
|
46
46
|
innerWrapperClassName,
|
|
47
47
|
inputWidth,
|
|
@@ -53,7 +53,7 @@ const UnconnectedBorderControl = (
|
|
|
53
53
|
__unstablePopoverProps,
|
|
54
54
|
previousStyleSelection,
|
|
55
55
|
showDropdownHeader,
|
|
56
|
-
size
|
|
56
|
+
size,
|
|
57
57
|
sliderClassName,
|
|
58
58
|
value: border,
|
|
59
59
|
widthUnit,
|
|
@@ -104,6 +104,7 @@ const UnconnectedBorderControl = (
|
|
|
104
104
|
/>
|
|
105
105
|
{ withSlider && (
|
|
106
106
|
<RangeControl
|
|
107
|
+
__nextHasNoMarginBottom
|
|
107
108
|
label={ __( 'Border width' ) }
|
|
108
109
|
hideLabelFromVision
|
|
109
110
|
className={ sliderClassName }
|
|
@@ -30,12 +30,17 @@ export function useBorderControl(
|
|
|
30
30
|
) {
|
|
31
31
|
const {
|
|
32
32
|
className,
|
|
33
|
+
colors = [],
|
|
33
34
|
isCompact,
|
|
34
35
|
onChange,
|
|
36
|
+
enableAlpha = true,
|
|
37
|
+
enableStyle = true,
|
|
35
38
|
shouldSanitizeBorder = true,
|
|
36
39
|
size = 'default',
|
|
37
40
|
value: border,
|
|
38
41
|
width,
|
|
42
|
+
__experimentalHasMultipleOrigins = false,
|
|
43
|
+
__experimentalIsRenderedInSidebar = false,
|
|
39
44
|
...otherProps
|
|
40
45
|
} = useContextSystem( props, 'BorderControl' );
|
|
41
46
|
|
|
@@ -137,6 +142,9 @@ export function useBorderControl(
|
|
|
137
142
|
return {
|
|
138
143
|
...otherProps,
|
|
139
144
|
className: classes,
|
|
145
|
+
colors,
|
|
146
|
+
enableAlpha,
|
|
147
|
+
enableStyle,
|
|
140
148
|
innerWrapperClassName,
|
|
141
149
|
inputWidth: wrapperWidth,
|
|
142
150
|
onBorderChange,
|
|
@@ -148,5 +156,7 @@ export function useBorderControl(
|
|
|
148
156
|
widthUnit,
|
|
149
157
|
widthValue,
|
|
150
158
|
size,
|
|
159
|
+
__experimentalHasMultipleOrigins,
|
|
160
|
+
__experimentalIsRenderedInSidebar,
|
|
151
161
|
};
|
|
152
162
|
}
|
|
@@ -24,12 +24,13 @@ import { useBorderControlDropdown } from './hook';
|
|
|
24
24
|
import { StyledLabel } from '../../base-control/styles/base-control-styles';
|
|
25
25
|
import DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';
|
|
26
26
|
|
|
27
|
-
import type {
|
|
27
|
+
import type { ColorObject, PaletteObject } from '../../color-palette/types';
|
|
28
|
+
import type { ColorProps, DropdownProps } from '../types';
|
|
28
29
|
|
|
29
30
|
const noop = () => undefined;
|
|
30
31
|
const getColorObject = (
|
|
31
32
|
colorValue: CSSProperties[ 'borderColor' ],
|
|
32
|
-
colors:
|
|
33
|
+
colors: ColorProps[ 'colors' ] | undefined,
|
|
33
34
|
hasMultipleColorOrigins: boolean
|
|
34
35
|
) => {
|
|
35
36
|
if ( ! colorValue || ! colors ) {
|
|
@@ -39,7 +40,7 @@ const getColorObject = (
|
|
|
39
40
|
if ( hasMultipleColorOrigins ) {
|
|
40
41
|
let matchedColor;
|
|
41
42
|
|
|
42
|
-
( colors as
|
|
43
|
+
( colors as PaletteObject[] ).some( ( origin ) =>
|
|
43
44
|
origin.colors.some( ( color ) => {
|
|
44
45
|
if ( color.color === colorValue ) {
|
|
45
46
|
matchedColor = color;
|
|
@@ -53,14 +54,14 @@ const getColorObject = (
|
|
|
53
54
|
return matchedColor;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
return ( colors as
|
|
57
|
+
return ( colors as ColorObject[] ).find(
|
|
57
58
|
( color ) => color.color === colorValue
|
|
58
59
|
);
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
const getToggleAriaLabel = (
|
|
62
63
|
colorValue: CSSProperties[ 'borderColor' ],
|
|
63
|
-
colorObject:
|
|
64
|
+
colorObject: ColorObject | undefined,
|
|
64
65
|
style: CSSProperties[ 'borderStyle' ],
|
|
65
66
|
isStyleEnabled: boolean
|
|
66
67
|
) => {
|
|
@@ -131,6 +132,7 @@ const BorderControlDropdown = (
|
|
|
131
132
|
colors,
|
|
132
133
|
disableCustomColors,
|
|
133
134
|
enableAlpha,
|
|
135
|
+
enableStyle,
|
|
134
136
|
indicatorClassName,
|
|
135
137
|
indicatorWrapperClassName,
|
|
136
138
|
onReset,
|
|
@@ -140,7 +142,6 @@ const BorderControlDropdown = (
|
|
|
140
142
|
popoverControlsClassName,
|
|
141
143
|
resetButtonClassName,
|
|
142
144
|
showDropdownHeader,
|
|
143
|
-
enableStyle = true,
|
|
144
145
|
__unstablePopoverProps,
|
|
145
146
|
...otherProps
|
|
146
147
|
} = useBorderControlDropdown( props );
|
|
@@ -19,10 +19,14 @@ export function useBorderControlDropdown(
|
|
|
19
19
|
const {
|
|
20
20
|
border,
|
|
21
21
|
className,
|
|
22
|
-
colors,
|
|
22
|
+
colors = [],
|
|
23
|
+
enableAlpha = false,
|
|
24
|
+
enableStyle = true,
|
|
23
25
|
onChange,
|
|
24
26
|
previousStyleSelection,
|
|
25
27
|
size = 'default',
|
|
28
|
+
__experimentalHasMultipleOrigins = false,
|
|
29
|
+
__experimentalIsRenderedInSidebar = false,
|
|
26
30
|
...otherProps
|
|
27
31
|
} = useContextSystem( props, 'BorderControlDropdown' );
|
|
28
32
|
|
|
@@ -81,6 +85,8 @@ export function useBorderControlDropdown(
|
|
|
81
85
|
border,
|
|
82
86
|
className: classes,
|
|
83
87
|
colors,
|
|
88
|
+
enableAlpha,
|
|
89
|
+
enableStyle,
|
|
84
90
|
indicatorClassName,
|
|
85
91
|
indicatorWrapperClassName,
|
|
86
92
|
onColorChange,
|
|
@@ -89,5 +95,7 @@ export function useBorderControlDropdown(
|
|
|
89
95
|
popoverContentClassName,
|
|
90
96
|
popoverControlsClassName,
|
|
91
97
|
resetButtonClassName,
|
|
98
|
+
__experimentalHasMultipleOrigins,
|
|
99
|
+
__experimentalIsRenderedInSidebar,
|
|
92
100
|
};
|
|
93
101
|
}
|
|
@@ -8,10 +8,7 @@ import { css } from '@emotion/react';
|
|
|
8
8
|
*/
|
|
9
9
|
import { COLORS, CONFIG, boxSizingReset, rtl } from '../utils';
|
|
10
10
|
import { space } from '../ui/utils/space';
|
|
11
|
-
import {
|
|
12
|
-
StyledField,
|
|
13
|
-
StyledLabel,
|
|
14
|
-
} from '../base-control/styles/base-control-styles';
|
|
11
|
+
import { StyledLabel } from '../base-control/styles/base-control-styles';
|
|
15
12
|
import {
|
|
16
13
|
ValueInput as UnitControlWrapper,
|
|
17
14
|
UnitSelect,
|
|
@@ -193,10 +190,4 @@ export const borderStyleButton = css`
|
|
|
193
190
|
export const borderSlider = () => css`
|
|
194
191
|
flex: 1 1 60%;
|
|
195
192
|
${ rtl( { marginRight: space( 3 ) } )() }
|
|
196
|
-
|
|
197
|
-
${ StyledField } {
|
|
198
|
-
margin-bottom: 0;
|
|
199
|
-
font-size: 0;
|
|
200
|
-
display: flex;
|
|
201
|
-
}
|
|
202
193
|
`;
|
|
@@ -6,6 +6,7 @@ import type { CSSProperties } from 'react';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
+
import type { ColorPaletteProps } from '../color-palette/types';
|
|
9
10
|
import type { PopoverProps } from '../popover/types';
|
|
10
11
|
|
|
11
12
|
export type Border = {
|
|
@@ -14,43 +15,17 @@ export type Border = {
|
|
|
14
15
|
width?: CSSProperties[ 'borderWidth' ];
|
|
15
16
|
};
|
|
16
17
|
|
|
17
|
-
export type
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
colors: Color[];
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type Colors = ColorOrigin[] | Color[];
|
|
28
|
-
|
|
29
|
-
export type ColorProps = {
|
|
30
|
-
/**
|
|
31
|
-
* An array of color definitions. This may also be a multi-dimensional array
|
|
32
|
-
* where colors are organized by multiple origins.
|
|
33
|
-
*/
|
|
34
|
-
colors?: Colors;
|
|
18
|
+
export type ColorProps = Pick<
|
|
19
|
+
ColorPaletteProps,
|
|
20
|
+
| 'colors'
|
|
21
|
+
| 'enableAlpha'
|
|
22
|
+
| '__experimentalHasMultipleOrigins'
|
|
23
|
+
| '__experimentalIsRenderedInSidebar'
|
|
24
|
+
> & {
|
|
35
25
|
/**
|
|
36
26
|
* This toggles the ability to choose custom colors.
|
|
37
27
|
*/
|
|
38
28
|
disableCustomColors?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* This controls whether the alpha channel will be offered when selecting
|
|
41
|
-
* custom colors.
|
|
42
|
-
*/
|
|
43
|
-
enableAlpha?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* This is passed on to the color related sub-components which need to be
|
|
46
|
-
* made aware of whether the colors prop contains multiple origins.
|
|
47
|
-
*/
|
|
48
|
-
__experimentalHasMultipleOrigins?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* This is passed on to the color related sub-components so they may render
|
|
51
|
-
* more effectively when used within a sidebar.
|
|
52
|
-
*/
|
|
53
|
-
__experimentalIsRenderedInSidebar?: boolean;
|
|
54
29
|
};
|
|
55
30
|
|
|
56
31
|
export type LabelProps = {
|
|
@@ -72,8 +47,7 @@ export type BorderControlProps = ColorProps &
|
|
|
72
47
|
*/
|
|
73
48
|
disableUnits?: boolean;
|
|
74
49
|
/**
|
|
75
|
-
* This controls whether to
|
|
76
|
-
* `BorderDropdown` sub-component.
|
|
50
|
+
* This controls whether to support border style selection.
|
|
77
51
|
*
|
|
78
52
|
* @default true
|
|
79
53
|
*/
|
|
@@ -107,6 +81,12 @@ export type BorderControlProps = ColorProps &
|
|
|
107
81
|
* and a close button.
|
|
108
82
|
*/
|
|
109
83
|
showDropdownHeader?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Size of the control.
|
|
86
|
+
*
|
|
87
|
+
* @default 'default'
|
|
88
|
+
*/
|
|
89
|
+
size?: 'default' | '__unstable-large';
|
|
110
90
|
/**
|
|
111
91
|
* An object representing a border or `undefined`. Used to set the
|
|
112
92
|
* current border configuration for this component.
|
|
@@ -122,55 +102,38 @@ export type BorderControlProps = ColorProps &
|
|
|
122
102
|
* `RangeControl` for additional control over a border's width.
|
|
123
103
|
*/
|
|
124
104
|
withSlider?: boolean;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export type DropdownProps = ColorProps &
|
|
108
|
+
Pick< BorderControlProps, 'enableStyle' | 'size' > & {
|
|
125
109
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
110
|
+
* An object representing a border or `undefined`. This component will
|
|
111
|
+
* extract the border color and style selections from this object to use as
|
|
112
|
+
* values for its popover controls.
|
|
129
113
|
*/
|
|
130
|
-
|
|
114
|
+
border?: Border;
|
|
115
|
+
/**
|
|
116
|
+
* An internal prop used to control the visibility of the dropdown.
|
|
117
|
+
*/
|
|
118
|
+
__unstablePopoverProps?: Omit< PopoverProps, 'children' >;
|
|
119
|
+
/**
|
|
120
|
+
* A callback invoked when the border color or style selections change.
|
|
121
|
+
*/
|
|
122
|
+
onChange: ( newBorder?: Border ) => void;
|
|
123
|
+
/**
|
|
124
|
+
* Any previous style selection made by the user. This can be used to
|
|
125
|
+
* reapply that previous selection when, for example, a zero border width is
|
|
126
|
+
* to a non-zero value.
|
|
127
|
+
*/
|
|
128
|
+
previousStyleSelection?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Whether or not to render a header for the border color and style picker
|
|
131
|
+
* dropdown. The header includes a label for the color picker and a
|
|
132
|
+
* close button.
|
|
133
|
+
*/
|
|
134
|
+
showDropdownHeader?: boolean;
|
|
131
135
|
};
|
|
132
136
|
|
|
133
|
-
export type DropdownProps = ColorProps & {
|
|
134
|
-
/**
|
|
135
|
-
* An object representing a border or `undefined`. This component will
|
|
136
|
-
* extract the border color and style selections from this object to use as
|
|
137
|
-
* values for its popover controls.
|
|
138
|
-
*/
|
|
139
|
-
border?: Border;
|
|
140
|
-
/**
|
|
141
|
-
* An internal prop used to control the visibility of the dropdown.
|
|
142
|
-
*/
|
|
143
|
-
__unstablePopoverProps?: Omit< PopoverProps, 'children' >;
|
|
144
|
-
/**
|
|
145
|
-
* This controls whether to render border style options.
|
|
146
|
-
*
|
|
147
|
-
* @default true
|
|
148
|
-
*/
|
|
149
|
-
enableStyle?: boolean;
|
|
150
|
-
/**
|
|
151
|
-
* A callback invoked when the border color or style selections change.
|
|
152
|
-
*/
|
|
153
|
-
onChange: ( newBorder?: Border ) => void;
|
|
154
|
-
/**
|
|
155
|
-
* Any previous style selection made by the user. This can be used to
|
|
156
|
-
* reapply that previous selection when, for example, a zero border width is
|
|
157
|
-
* to a non-zero value.
|
|
158
|
-
*/
|
|
159
|
-
previousStyleSelection?: string;
|
|
160
|
-
/**
|
|
161
|
-
* Whether or not to render a header for the border color and style picker
|
|
162
|
-
* dropdown. The header includes a label for the color picker and a
|
|
163
|
-
* close button.
|
|
164
|
-
*/
|
|
165
|
-
showDropdownHeader?: boolean;
|
|
166
|
-
/**
|
|
167
|
-
* Size of the control.
|
|
168
|
-
*
|
|
169
|
-
* @default 'default'
|
|
170
|
-
*/
|
|
171
|
-
size?: 'default' | '__unstable-large';
|
|
172
|
-
};
|
|
173
|
-
|
|
174
137
|
export type StylePickerProps = LabelProps & {
|
|
175
138
|
/**
|
|
176
139
|
* A callback function invoked when a border style is selected or cleared.
|