@wordpress/components 21.2.0 → 22.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 -3
- package/CONTRIBUTING.md +20 -0
- package/build/angle-picker-control/index.js +1 -1
- package/build/angle-picker-control/index.js.map +1 -1
- package/build/autocomplete/autocompleter-ui.js +28 -2
- package/build/autocomplete/autocompleter-ui.js.map +1 -1
- package/build/border-box-control/border-box-control/component.js +65 -15
- package/build/border-box-control/border-box-control/component.js.map +1 -1
- package/build/border-box-control/border-box-control/hook.js +11 -4
- package/build/border-box-control/border-box-control/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-linked-button/hook.js +3 -3
- package/build/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/component.js +3 -3
- package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build/border-box-control/border-box-control-split-controls/hook.js +8 -11
- package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
- package/build/border-box-control/border-box-control-visualizer/hook.js +3 -7
- package/build/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
- package/build/border-box-control/styles.js +34 -34
- package/build/border-box-control/styles.js.map +1 -1
- package/build/border-control/border-control/component.js +7 -4
- package/build/border-control/border-control/component.js.map +1 -1
- package/build/border-control/border-control/hook.js +12 -5
- package/build/border-control/border-control/hook.js.map +1 -1
- package/build/border-control/border-control-dropdown/hook.js +5 -5
- package/build/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build/border-control/styles.js +19 -34
- package/build/border-control/styles.js.map +1 -1
- package/build/box-control/index.js +6 -2
- package/build/box-control/index.js.map +1 -1
- package/build/circular-option-picker/index.js +14 -14
- package/build/circular-option-picker/index.js.map +1 -1
- package/build/color-palette/index.js +83 -30
- package/build/color-palette/index.js.map +1 -1
- package/build/color-palette/styles.js +3 -3
- package/build/color-palette/styles.js.map +1 -1
- package/build/color-palette/types.js +6 -0
- package/build/color-palette/types.js.map +1 -0
- package/build/color-picker/input-with-slider.js +1 -1
- package/build/color-picker/input-with-slider.js.map +1 -1
- package/build/custom-gradient-picker/gradient-bar/index.js +1 -3
- package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build/custom-select-control/index.js +8 -4
- package/build/custom-select-control/index.js.map +1 -1
- package/build/date-time/date-time/index.js +2 -0
- package/build/date-time/date-time/index.js.map +1 -1
- package/build/date-time/time/index.js +4 -4
- package/build/date-time/time/index.js.map +1 -1
- package/build/disabled/index.js +14 -27
- package/build/disabled/index.js.map +1 -1
- package/build/external-link/index.js +13 -2
- package/build/external-link/index.js.map +1 -1
- package/build/focusable-iframe/index.js +0 -1
- package/build/focusable-iframe/index.js.map +1 -1
- package/build/font-size-picker/index.js +62 -49
- package/build/font-size-picker/index.js.map +1 -1
- package/build/font-size-picker/styles.js +5 -13
- package/build/font-size-picker/styles.js.map +1 -1
- package/build/font-size-picker/utils.js +1 -22
- package/build/font-size-picker/utils.js.map +1 -1
- package/build/form-file-upload/index.js.map +1 -1
- package/build/form-token-field/suggestions-list.js +5 -5
- package/build/form-token-field/suggestions-list.js.map +1 -1
- package/build/higher-order/with-fallback-styles/index.js +1 -1
- package/build/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build/higher-order/with-filters/index.js +1 -7
- package/build/higher-order/with-filters/index.js.map +1 -1
- package/build/index.js +15 -7
- package/build/index.js.map +1 -1
- package/build/input-control/index.js +2 -0
- package/build/input-control/index.js.map +1 -1
- package/build/input-control/input-base.js +1 -1
- package/build/input-control/input-base.js.map +1 -1
- package/build/input-control/styles/input-control-styles.js +21 -21
- package/build/input-control/styles/input-control-styles.js.map +1 -1
- package/build/isolated-event-container/index.js +5 -9
- package/build/isolated-event-container/index.js.map +1 -1
- package/build/item-group/styles.js +10 -10
- package/build/item-group/styles.js.map +1 -1
- package/build/modal/aria-helper.js +2 -3
- package/build/modal/aria-helper.js.map +1 -1
- package/build/modal/index.js +42 -11
- package/build/modal/index.js.map +1 -1
- package/build/modal/types.js +6 -0
- package/build/modal/types.js.map +1 -0
- package/build/navigator/index.js +8 -8
- package/build/navigator/index.js.map +1 -1
- package/build/navigator/navigator-back-button/component.js +5 -4
- package/build/navigator/navigator-back-button/component.js.map +1 -1
- package/build/navigator/navigator-back-button/index.js +1 -1
- package/build/navigator/navigator-back-button/index.js.map +1 -1
- package/build/navigator/navigator-button/component.js +5 -4
- package/build/navigator/navigator-button/component.js.map +1 -1
- package/build/navigator/navigator-button/index.js +1 -1
- package/build/navigator/navigator-button/index.js.map +1 -1
- package/build/navigator/navigator-provider/component.js +10 -7
- package/build/navigator/navigator-provider/component.js.map +1 -1
- package/build/navigator/navigator-provider/index.js +1 -1
- package/build/navigator/navigator-provider/index.js.map +1 -1
- package/build/navigator/navigator-screen/component.js +11 -8
- package/build/navigator/navigator-screen/component.js.map +1 -1
- package/build/navigator/navigator-screen/index.js +1 -1
- package/build/navigator/navigator-screen/index.js.map +1 -1
- package/build/number-control/index.js +82 -22
- package/build/number-control/index.js.map +1 -1
- package/build/number-control/styles/number-control-styles.js +36 -6
- package/build/number-control/styles/number-control-styles.js.map +1 -1
- package/build/popover/index.js +15 -29
- package/build/popover/index.js.map +1 -1
- package/build/radio-group/index.js +7 -1
- package/build/radio-group/index.js.map +1 -1
- package/build/{radio → radio-group/radio}/index.js +7 -1
- package/build/radio-group/radio/index.js.map +1 -0
- package/build/{radio-context → radio-group/radio-context}/index.js +0 -0
- package/build/radio-group/radio-context/index.js.map +1 -0
- package/build/sandbox/index.js +55 -59
- package/build/sandbox/index.js.map +1 -1
- package/build/sandbox/index.native.js +63 -62
- package/build/sandbox/index.native.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/fill.js +9 -5
- package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/slot.js +13 -8
- package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build/slot-fill/bubbles-virtually/use-slot.js +15 -9
- package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build/slot-fill/fill.js +12 -4
- package/build/slot-fill/fill.js.map +1 -1
- package/build/slot-fill/use-slot.js +3 -1
- package/build/slot-fill/use-slot.js.map +1 -1
- package/build/snackbar/index.js +1 -1
- package/build/snackbar/index.js.map +1 -1
- package/build/tab-panel/index.js +5 -9
- package/build/tab-panel/index.js.map +1 -1
- package/build/text-control/index.js +0 -2
- package/build/text-control/index.js.map +1 -1
- package/build/theme/index.js +62 -0
- package/build/theme/index.js.map +1 -0
- package/build/theme/styles.js +33 -0
- package/build/theme/styles.js.map +1 -0
- package/build/theme/types.js +6 -0
- package/build/theme/types.js.map +1 -0
- package/build/toggle-control/index.js +15 -3
- package/build/toggle-control/index.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/as-button-group.js +90 -0
- package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -0
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js +90 -0
- package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -0
- package/build/toggle-group-control/toggle-group-control/component.js +21 -50
- package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control/styles.js +8 -8
- package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/component.js +39 -17
- package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js +23 -23
- package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build/toolbar-dropdown-menu/index.js +1 -1
- package/build/toolbar-dropdown-menu/index.js.map +1 -1
- package/build/tools-panel/tools-panel/hook.js +3 -3
- package/build/tools-panel/tools-panel/hook.js.map +1 -1
- package/build/tools-panel/tools-panel-item/hook.js +6 -6
- package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build/tooltip/index.js +4 -1
- package/build/tooltip/index.js.map +1 -1
- package/build/tooltip/index.native.js +17 -4
- package/build/tooltip/index.native.js.map +1 -1
- package/build/ui/context/context-system-provider.js +9 -22
- package/build/ui/context/context-system-provider.js.map +1 -1
- package/build/unit-control/index.js +7 -9
- package/build/unit-control/index.js.map +1 -1
- package/build/unit-control/styles/unit-control-styles.js +15 -25
- package/build/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build/utils/config-values.js +0 -1
- package/build/utils/config-values.js.map +1 -1
- package/build/utils/hooks/use-update-effect.js +5 -1
- package/build/utils/hooks/use-update-effect.js.map +1 -1
- package/build-module/angle-picker-control/index.js +1 -1
- package/build-module/angle-picker-control/index.js.map +1 -1
- package/build-module/autocomplete/autocompleter-ui.js +29 -3
- package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
- package/build-module/border-box-control/border-box-control/component.js +63 -13
- 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 +11 -4
- package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-linked-button/hook.js +3 -3
- package/build-module/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/component.js +3 -3
- package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
- package/build-module/border-box-control/border-box-control-split-controls/hook.js +9 -10
- package/build-module/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
- package/build-module/border-box-control/border-box-control-visualizer/hook.js +4 -6
- package/build-module/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
- package/build-module/border-box-control/styles.js +26 -28
- package/build-module/border-box-control/styles.js.map +1 -1
- package/build-module/border-control/border-control/component.js +7 -4
- package/build-module/border-control/border-control/component.js.map +1 -1
- package/build-module/border-control/border-control/hook.js +12 -5
- package/build-module/border-control/border-control/hook.js.map +1 -1
- package/build-module/border-control/border-control-dropdown/hook.js +5 -5
- package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
- package/build-module/border-control/styles.js +20 -36
- package/build-module/border-control/styles.js.map +1 -1
- package/build-module/box-control/index.js +6 -2
- package/build-module/box-control/index.js.map +1 -1
- package/build-module/circular-option-picker/index.js +14 -14
- package/build-module/circular-option-picker/index.js.map +1 -1
- package/build-module/color-palette/index.js +81 -28
- package/build-module/color-palette/index.js.map +1 -1
- package/build-module/color-palette/styles.js +3 -3
- package/build-module/color-palette/styles.js.map +1 -1
- package/build-module/color-palette/types.js +2 -0
- package/build-module/color-palette/types.js.map +1 -0
- package/build-module/color-picker/input-with-slider.js +1 -1
- package/build-module/color-picker/input-with-slider.js.map +1 -1
- package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -2
- package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
- package/build-module/custom-select-control/index.js +8 -4
- package/build-module/custom-select-control/index.js.map +1 -1
- package/build-module/date-time/date-time/index.js +2 -0
- package/build-module/date-time/date-time/index.js.map +1 -1
- package/build-module/date-time/time/index.js +4 -4
- package/build-module/date-time/time/index.js.map +1 -1
- package/build-module/disabled/index.js +15 -27
- package/build-module/disabled/index.js.map +1 -1
- package/build-module/external-link/index.js +13 -2
- package/build-module/external-link/index.js.map +1 -1
- package/build-module/focusable-iframe/index.js +0 -1
- package/build-module/focusable-iframe/index.js.map +1 -1
- package/build-module/font-size-picker/index.js +66 -51
- package/build-module/font-size-picker/index.js.map +1 -1
- package/build-module/font-size-picker/styles.js +5 -13
- package/build-module/font-size-picker/styles.js.map +1 -1
- package/build-module/font-size-picker/utils.js +1 -20
- package/build-module/font-size-picker/utils.js.map +1 -1
- package/build-module/form-file-upload/index.js.map +1 -1
- package/build-module/form-token-field/suggestions-list.js +5 -5
- package/build-module/form-token-field/suggestions-list.js.map +1 -1
- package/build-module/higher-order/with-fallback-styles/index.js +2 -2
- package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
- package/build-module/higher-order/with-filters/index.js +1 -6
- package/build-module/higher-order/with-filters/index.js.map +1 -1
- package/build-module/index.js +4 -3
- package/build-module/index.js.map +1 -1
- package/build-module/input-control/index.js +2 -0
- package/build-module/input-control/index.js.map +1 -1
- package/build-module/input-control/input-base.js +1 -1
- package/build-module/input-control/input-base.js.map +1 -1
- package/build-module/input-control/styles/input-control-styles.js +21 -21
- package/build-module/input-control/styles/input-control-styles.js.map +1 -1
- package/build-module/isolated-event-container/index.js +7 -9
- package/build-module/isolated-event-container/index.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/aria-helper.js +2 -3
- package/build-module/modal/aria-helper.js.map +1 -1
- package/build-module/modal/index.js +44 -12
- package/build-module/modal/index.js.map +1 -1
- package/build-module/modal/types.js +2 -0
- package/build-module/modal/types.js.map +1 -0
- package/build-module/navigator/index.js +4 -4
- package/build-module/navigator/index.js.map +1 -1
- package/build-module/navigator/navigator-back-button/component.js +3 -3
- package/build-module/navigator/navigator-back-button/component.js.map +1 -1
- package/build-module/navigator/navigator-back-button/index.js +1 -1
- package/build-module/navigator/navigator-back-button/index.js.map +1 -1
- package/build-module/navigator/navigator-button/component.js +3 -3
- package/build-module/navigator/navigator-button/component.js.map +1 -1
- package/build-module/navigator/navigator-button/index.js +1 -1
- package/build-module/navigator/navigator-button/index.js.map +1 -1
- package/build-module/navigator/navigator-provider/component.js +8 -6
- package/build-module/navigator/navigator-provider/component.js.map +1 -1
- package/build-module/navigator/navigator-provider/index.js +1 -1
- package/build-module/navigator/navigator-provider/index.js.map +1 -1
- package/build-module/navigator/navigator-screen/component.js +9 -7
- package/build-module/navigator/navigator-screen/component.js.map +1 -1
- package/build-module/navigator/navigator-screen/index.js +1 -1
- package/build-module/navigator/navigator-screen/index.js.map +1 -1
- package/build-module/number-control/index.js +81 -26
- package/build-module/number-control/index.js.map +1 -1
- package/build-module/number-control/styles/number-control-styles.js +30 -4
- package/build-module/number-control/styles/number-control-styles.js.map +1 -1
- package/build-module/popover/index.js +15 -29
- package/build-module/popover/index.js.map +1 -1
- package/build-module/radio-group/index.js +6 -1
- package/build-module/radio-group/index.js.map +1 -1
- package/build-module/{radio → radio-group/radio}/index.js +6 -1
- package/build-module/radio-group/radio/index.js.map +1 -0
- package/build-module/{radio-context → radio-group/radio-context}/index.js +0 -0
- package/build-module/radio-group/radio-context/index.js.map +1 -0
- package/build-module/sandbox/index.js +56 -59
- package/build-module/sandbox/index.js.map +1 -1
- package/build-module/sandbox/index.native.js +54 -52
- package/build-module/sandbox/index.native.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/fill.js +9 -5
- package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/slot.js +13 -8
- package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
- package/build-module/slot-fill/bubbles-virtually/use-slot.js +15 -9
- package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
- package/build-module/slot-fill/fill.js +12 -4
- package/build-module/slot-fill/fill.js.map +1 -1
- package/build-module/slot-fill/use-slot.js +3 -1
- package/build-module/slot-fill/use-slot.js.map +1 -1
- package/build-module/snackbar/index.js +1 -1
- package/build-module/snackbar/index.js.map +1 -1
- package/build-module/tab-panel/index.js +5 -9
- package/build-module/tab-panel/index.js.map +1 -1
- package/build-module/text-control/index.js +0 -2
- package/build-module/text-control/index.js.map +1 -1
- package/build-module/theme/index.js +52 -0
- package/build-module/theme/index.js.map +1 -0
- package/build-module/theme/styles.js +25 -0
- package/build-module/theme/styles.js.map +1 -0
- package/build-module/theme/types.js +2 -0
- package/build-module/theme/types.js.map +1 -0
- package/build-module/toggle-control/index.js +15 -3
- package/build-module/toggle-control/index.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +76 -0
- package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -0
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +75 -0
- package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -0
- package/build-module/toggle-group-control/toggle-group-control/component.js +19 -49
- 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 +7 -6
- package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +39 -17
- package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +21 -18
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
- package/build-module/toolbar-dropdown-menu/index.js +1 -1
- package/build-module/toolbar-dropdown-menu/index.js.map +1 -1
- package/build-module/tools-panel/tools-panel/hook.js +3 -3
- package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
- package/build-module/tools-panel/tools-panel-item/hook.js +6 -6
- package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
- package/build-module/tooltip/index.js +4 -1
- package/build-module/tooltip/index.js.map +1 -1
- package/build-module/tooltip/index.native.js +17 -4
- package/build-module/tooltip/index.native.js.map +1 -1
- package/build-module/ui/context/context-system-provider.js +6 -20
- package/build-module/ui/context/context-system-provider.js.map +1 -1
- package/build-module/unit-control/index.js +8 -10
- package/build-module/unit-control/index.js.map +1 -1
- package/build-module/unit-control/styles/unit-control-styles.js +8 -24
- package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
- package/build-module/utils/config-values.js +0 -1
- package/build-module/utils/config-values.js.map +1 -1
- package/build-module/utils/hooks/use-update-effect.js +5 -1
- package/build-module/utils/hooks/use-update-effect.js.map +1 -1
- package/build-style/style-rtl.css +45 -61
- package/build-style/style.css +43 -59
- package/build-types/base-field/hook.d.ts +11 -11
- package/build-types/border-box-control/border-box-control/component.d.ts +53 -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 +14 -12
- 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/hook.d.ts +12 -12
- package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
- package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +12 -12
- 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/hook.d.ts +12 -12
- package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
- package/build-types/border-box-control/stories/index.d.ts +17 -0
- package/build-types/border-box-control/stories/index.d.ts.map +1 -0
- package/build-types/border-box-control/styles.d.ts +7 -6
- package/build-types/border-box-control/styles.d.ts.map +1 -1
- package/build-types/border-box-control/types.d.ts +12 -16
- package/build-types/border-box-control/types.d.ts.map +1 -1
- package/build-types/border-control/border-control/component.d.ts +2 -1
- package/build-types/border-control/border-control/component.d.ts.map +1 -1
- package/build-types/border-control/border-control/hook.d.ts +14 -13
- package/build-types/border-control/border-control/hook.d.ts.map +1 -1
- package/build-types/border-control/border-control-dropdown/component.d.ts +1 -1
- package/build-types/border-control/border-control-dropdown/hook.d.ts +11 -11
- 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 +11 -11
- package/build-types/border-control/stories/index.d.ts +12 -6
- package/build-types/border-control/stories/index.d.ts.map +1 -1
- package/build-types/border-control/styles.d.ts +3 -3
- package/build-types/border-control/styles.d.ts.map +1 -1
- package/build-types/border-control/types.d.ts +11 -9
- package/build-types/border-control/types.d.ts.map +1 -1
- package/build-types/card/card/hook.d.ts +12 -12
- package/build-types/card/card-body/hook.d.ts +12 -12
- package/build-types/card/card-divider/hook.d.ts +13 -13
- package/build-types/card/card-footer/hook.d.ts +12 -12
- package/build-types/card/card-header/hook.d.ts +12 -12
- package/build-types/card/card-media/hook.d.ts +12 -12
- package/build-types/card/stories/index.d.ts.map +1 -1
- package/build-types/circular-option-picker/index.d.ts +4 -24
- package/build-types/circular-option-picker/index.d.ts.map +1 -1
- package/build-types/color-palette/index.d.ts +33 -18
- package/build-types/color-palette/index.d.ts.map +1 -1
- package/build-types/color-palette/stories/index.d.ts +21 -0
- package/build-types/color-palette/stories/index.d.ts.map +1 -0
- package/build-types/color-palette/styles.d.ts +3 -2
- package/build-types/color-palette/styles.d.ts.map +1 -1
- package/build-types/color-palette/test/index.d.ts +2 -0
- package/build-types/color-palette/test/index.d.ts.map +1 -0
- package/build-types/color-palette/types.d.ts +86 -0
- package/build-types/color-palette/types.d.ts.map +1 -0
- package/build-types/color-picker/styles.d.ts +5 -4
- package/build-types/color-picker/styles.d.ts.map +1 -1
- package/build-types/confirm-dialog/component.d.ts +4 -4
- package/build-types/confirm-dialog/types.d.ts +5 -1
- package/build-types/confirm-dialog/types.d.ts.map +1 -1
- package/build-types/custom-select-control/index.d.ts +1 -12
- package/build-types/custom-select-control/index.d.ts.map +1 -1
- package/build-types/custom-select-control/styles.d.ts +3 -1
- package/build-types/custom-select-control/styles.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +3 -3
- package/build-types/date-time/date-time/index.d.ts +2 -0
- package/build-types/date-time/date-time/index.d.ts.map +1 -1
- package/build-types/date-time/date-time/styles.d.ts +3 -3
- package/build-types/date-time/stories/date-time.d.ts.map +1 -1
- package/build-types/date-time/time/styles.d.ts +8 -4
- package/build-types/date-time/time/styles.d.ts.map +1 -1
- package/build-types/disabled/index.d.ts +8 -1
- package/build-types/disabled/index.d.ts.map +1 -1
- package/build-types/elevation/hook.d.ts +12 -12
- package/build-types/external-link/index.d.ts.map +1 -1
- package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
- package/build-types/external-link/test/index.d.ts +2 -0
- package/build-types/external-link/test/index.d.ts.map +1 -0
- package/build-types/flex/flex/hook.d.ts +12 -12
- package/build-types/flex/flex-block/hook.d.ts +12 -12
- package/build-types/flex/flex-item/hook.d.ts +12 -12
- package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -2
- package/build-types/focal-point-picker/styles/focal-point-style.d.ts +3 -3
- package/build-types/focusable-iframe/index.d.ts.map +1 -1
- package/build-types/font-size-picker/index.d.ts.map +1 -1
- package/build-types/font-size-picker/styles.d.ts.map +1 -1
- package/build-types/font-size-picker/types.d.ts +1 -1
- package/build-types/font-size-picker/utils.d.ts +0 -8
- package/build-types/font-size-picker/utils.d.ts.map +1 -1
- package/build-types/form-file-upload/index.d.ts.map +1 -1
- package/build-types/form-file-upload/types.d.ts +5 -4
- package/build-types/form-file-upload/types.d.ts.map +1 -1
- package/build-types/grid/hook.d.ts +12 -12
- package/build-types/h-stack/component.d.ts +1 -1
- package/build-types/h-stack/hook.d.ts +12 -12
- package/build-types/heading/hook.d.ts +12 -12
- 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 +5 -2
- package/build-types/input-control/input-base.d.ts.map +1 -1
- package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
- package/build-types/input-control/types.d.ts +3 -8
- package/build-types/input-control/types.d.ts.map +1 -1
- package/build-types/input-control/utils.d.ts +1 -1
- package/build-types/isolated-event-container/index.d.ts +3 -2
- package/build-types/isolated-event-container/index.d.ts.map +1 -1
- package/build-types/item-group/item/hook.d.ts +13 -13
- package/build-types/item-group/item-group/hook.d.ts +13 -13
- package/build-types/modal/aria-helper.d.ts +4 -4
- package/build-types/modal/aria-helper.d.ts.map +1 -1
- package/build-types/modal/index.d.ts +35 -2
- package/build-types/modal/index.d.ts.map +1 -1
- package/build-types/modal/stories/index.d.ts +9 -0
- package/build-types/modal/stories/index.d.ts.map +1 -0
- package/build-types/modal/test/aria-helper.d.ts +2 -0
- package/build-types/modal/test/aria-helper.d.ts.map +1 -0
- package/build-types/modal/test/index.d.ts +2 -0
- package/build-types/modal/test/index.d.ts.map +1 -0
- package/build-types/modal/types.d.ts +134 -0
- package/build-types/modal/types.d.ts.map +1 -0
- package/build-types/navigator/index.d.ts +4 -4
- package/build-types/navigator/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/component.d.ts +4 -2
- package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/hook.d.ts +14 -13
- package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-back-button/index.d.ts +1 -1
- package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/component.d.ts +4 -2
- package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/hook.d.ts +14 -13
- package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
- package/build-types/navigator/navigator-button/index.d.ts +1 -1
- package/build-types/navigator/navigator-button/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/component.d.ts +2 -2
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-provider/index.d.ts +1 -1
- package/build-types/navigator/navigator-provider/index.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/component.d.ts +2 -2
- package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
- package/build-types/navigator/navigator-screen/index.d.ts +1 -1
- package/build-types/navigator/navigator-screen/index.d.ts.map +1 -1
- package/build-types/navigator/stories/index.d.ts +9 -0
- package/build-types/navigator/stories/index.d.ts.map +1 -0
- package/build-types/navigator/test/index.d.ts +2 -0
- package/build-types/navigator/test/index.d.ts.map +1 -0
- package/build-types/navigator/types.d.ts +4 -1
- package/build-types/navigator/types.d.ts.map +1 -1
- package/build-types/number-control/index.d.ts +2 -4
- package/build-types/number-control/index.d.ts.map +1 -1
- package/build-types/number-control/styles/number-control-styles.d.ts +5 -0
- package/build-types/number-control/styles/number-control-styles.d.ts.map +1 -1
- package/build-types/number-control/types.d.ts +12 -0
- package/build-types/number-control/types.d.ts.map +1 -1
- 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/popover/stories/index.d.ts +2 -0
- package/build-types/popover/stories/index.d.ts.map +1 -1
- package/build-types/popover/types.d.ts +18 -14
- package/build-types/popover/types.d.ts.map +1 -1
- package/build-types/radio-group/index.d.ts +10 -0
- package/build-types/radio-group/index.d.ts.map +1 -0
- package/build-types/radio-group/radio/index.d.ts +7 -0
- package/build-types/radio-group/radio/index.d.ts.map +1 -0
- package/build-types/{radio-context → radio-group/radio-context}/index.d.ts +0 -0
- package/build-types/radio-group/radio-context/index.d.ts.map +1 -0
- package/build-types/range-control/index.d.ts +1 -1
- package/build-types/range-control/styles/range-control-styles.d.ts +2 -1
- package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
- package/build-types/resizable-box/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
- package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
- package/build-types/scrollable/hook.d.ts +12 -12
- package/build-types/search-control/index.d.ts +2 -2
- package/build-types/search-control/stories/index.d.ts +4 -4
- package/build-types/select-control/stories/index.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
- package/build-types/slot-fill/fill.d.ts.map +1 -1
- package/build-types/slot-fill/use-slot.d.ts.map +1 -1
- package/build-types/spacer/hook.d.ts +12 -12
- package/build-types/spinner/index.d.ts +1 -1
- package/build-types/surface/hook.d.ts +12 -12
- package/build-types/tab-panel/index.d.ts.map +1 -1
- package/build-types/text/hook.d.ts +12 -12
- package/build-types/text-control/index.d.ts +2 -4
- package/build-types/text-control/index.d.ts.map +1 -1
- package/build-types/text-control/stories/index.d.ts.map +1 -1
- package/build-types/theme/index.d.ts +31 -0
- package/build-types/theme/index.d.ts.map +1 -0
- package/build-types/theme/stories/index.d.ts +13 -0
- package/build-types/theme/stories/index.d.ts.map +1 -0
- package/build-types/theme/styles.d.ts +10 -0
- package/build-types/theme/styles.d.ts.map +1 -0
- package/build-types/theme/test/index.d.ts +2 -0
- package/build-types/theme/test/index.d.ts.map +1 -0
- package/build-types/theme/types.d.ts +21 -0
- package/build-types/theme/types.d.ts.map +1 -0
- package/build-types/toggle-control/index.d.ts.map +1 -1
- package/build-types/toggle-control/types.d.ts +2 -1
- package/build-types/toggle-control/types.d.ts.map +1 -1
- package/build-types/toggle-group-control/stories/index.d.ts +2 -2
- 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 +6 -0
- package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +6 -0
- package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts +2 -2
- package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +2 -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-base/component.d.ts.map +1 -1
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +4 -7
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +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 +19 -14
- package/build-types/toggle-group-control/types.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +12 -12
- package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel-header/hook.d.ts +12 -12
- package/build-types/tools-panel/tools-panel-item/hook.d.ts +12 -12
- package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
- package/build-types/tooltip/index.d.ts.map +1 -1
- package/build-types/truncate/hook.d.ts +12 -12
- package/build-types/ui/context/context-system-provider.d.ts.map +1 -1
- package/build-types/ui/control-group/hook.d.ts +12 -12
- package/build-types/ui/control-label/component.d.ts +1 -1
- package/build-types/ui/control-label/hook.d.ts +12 -12
- package/build-types/ui/form-group/form-group.d.ts +4 -4
- package/build-types/ui/form-group/use-form-group.d.ts +28 -28
- package/build-types/unit-control/index.d.ts +2 -2
- package/build-types/unit-control/index.d.ts.map +1 -1
- package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -5
- package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
- package/build-types/unit-control/types.d.ts +3 -3
- package/build-types/unit-control/types.d.ts.map +1 -1
- package/build-types/utils/config-values.d.ts +0 -1
- package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
- package/build-types/utils/types.d.ts +0 -14
- package/build-types/utils/types.d.ts.map +1 -1
- package/build-types/v-stack/component.d.ts +2 -2
- package/build-types/v-stack/hook.d.ts +12 -12
- package/build-types/v-stack/stories/index.d.ts +2 -2
- package/package.json +17 -17
- package/src/angle-picker-control/index.js +1 -1
- package/src/angle-picker-control/stories/index.js +3 -0
- package/src/autocomplete/autocompleter-ui.js +29 -2
- package/src/autocomplete/test/index.js +89 -0
- package/src/base-field/test/index.js +4 -6
- package/src/border-box-control/border-box-control/README.md +8 -0
- package/src/border-box-control/border-box-control/component.tsx +66 -13
- package/src/border-box-control/border-box-control/hook.ts +11 -2
- package/src/border-box-control/border-box-control-linked-button/hook.ts +3 -6
- package/src/border-box-control/border-box-control-split-controls/component.tsx +3 -6
- package/src/border-box-control/border-box-control-split-controls/hook.ts +11 -14
- package/src/border-box-control/border-box-control-visualizer/hook.ts +4 -7
- package/src/border-box-control/stories/index.tsx +90 -0
- package/src/border-box-control/styles.ts +28 -22
- package/src/border-box-control/test/index.js +291 -121
- package/src/border-box-control/types.ts +12 -16
- package/src/border-control/border-control/README.md +14 -0
- package/src/border-control/border-control/component.tsx +6 -3
- package/src/border-control/border-control/hook.ts +10 -6
- package/src/border-control/border-control-dropdown/hook.ts +5 -7
- package/src/border-control/stories/index.tsx +12 -14
- package/src/border-control/styles.ts +20 -23
- package/src/border-control/test/index.js +139 -96
- package/src/border-control/types.ts +11 -9
- package/src/box-control/README.md +14 -0
- package/src/box-control/index.js +4 -0
- package/src/box-control/stories/index.js +8 -27
- package/src/button/README.md +2 -15
- package/src/button/stories/index.js +109 -178
- package/src/button/style.scss +40 -77
- package/src/button/test/index.js +3 -5
- package/src/card/stories/index.tsx +27 -31
- package/src/card/test/__snapshots__/index.tsx.snap +36 -35
- package/src/card/test/index.tsx +2 -6
- package/src/circular-option-picker/index.js +14 -20
- package/src/color-palette/README.md +51 -49
- package/src/color-palette/{index.js → index.tsx} +132 -51
- package/src/color-palette/stories/{index.js → index.tsx} +38 -27
- package/src/color-palette/style.scss +2 -2
- package/src/color-palette/{styles.js → styles.ts} +0 -0
- package/src/color-palette/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
- package/src/color-palette/test/{index.js → index.tsx} +1 -1
- package/src/color-palette/types.ts +93 -0
- package/src/color-picker/input-with-slider.tsx +1 -1
- package/src/combobox-control/test/index.js +1 -1
- package/src/confirm-dialog/types.ts +6 -0
- package/src/custom-gradient-picker/gradient-bar/index.js +1 -3
- package/src/custom-select-control/README.md +14 -0
- package/src/custom-select-control/index.js +22 -15
- package/src/date-time/date-time/index.tsx +2 -0
- package/src/date-time/stories/date-time.tsx +4 -0
- package/src/date-time/time/index.tsx +4 -4
- package/src/date-time/time/test/index.tsx +2 -6
- package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -0
- package/src/disabled/README.md +2 -0
- package/src/disabled/index.tsx +19 -34
- package/src/disabled/test/index.tsx +9 -82
- package/src/dropdown/test/index.js +4 -3
- package/src/external-link/index.tsx +14 -6
- package/src/external-link/test/index.tsx +106 -0
- package/src/focusable-iframe/index.js +0 -1
- package/src/font-size-picker/README.md +3 -3
- package/src/font-size-picker/index.tsx +153 -143
- package/src/font-size-picker/styles.ts +3 -1
- package/src/font-size-picker/test/index.tsx +447 -174
- package/src/font-size-picker/test/utils.ts +6 -50
- package/src/font-size-picker/types.ts +1 -1
- package/src/font-size-picker/utils.ts +1 -23
- package/src/form-file-upload/README.md +1 -3
- package/src/form-file-upload/index.tsx +1 -0
- package/src/form-file-upload/test/index.tsx +1 -1
- package/src/form-file-upload/types.ts +5 -4
- package/src/form-toggle/test/__snapshots__/index.tsx.snap +15 -13
- package/src/form-toggle/test/index.tsx +1 -1
- package/src/form-token-field/suggestions-list.tsx +5 -5
- package/src/h-stack/test/__snapshots__/index.tsx.snap +36 -30
- package/src/h-stack/test/index.tsx +3 -3
- package/src/higher-order/with-fallback-styles/index.js +6 -2
- package/src/higher-order/with-filters/index.js +4 -9
- package/src/higher-order/with-focus-outside/test/index.js +44 -45
- package/src/higher-order/with-focus-return/test/index.js +34 -30
- package/src/higher-order/with-notices/test/index.js +1 -1
- package/src/index.js +4 -2
- package/src/input-control/index.tsx +2 -0
- package/src/input-control/input-base.tsx +3 -3
- package/src/input-control/styles/input-control-styles.tsx +1 -0
- package/src/input-control/test/index.js +2 -2
- package/src/input-control/types.ts +4 -11
- package/src/isolated-event-container/index.tsx +32 -0
- package/src/item-group/styles.ts +1 -1
- package/src/item-group/test/__snapshots__/index.js.snap +90 -85
- package/src/item-group/test/index.js +8 -18
- package/src/menu-item/test/index.js +0 -3
- package/src/mobile/bottom-sheet/test/range-cell.native.js +16 -14
- package/src/modal/README.md +53 -54
- package/src/modal/{aria-helper.js → aria-helper.ts} +5 -7
- package/src/modal/{index.js → index.tsx} +48 -12
- package/src/modal/stories/{index.js → index.tsx} +47 -42
- package/src/modal/test/{aria-helper.js → aria-helper.ts} +0 -0
- package/src/modal/test/{index.js → index.tsx} +13 -3
- package/src/modal/types.ts +144 -0
- package/src/navigation/test/index.js +1 -1
- package/src/navigator/index.ts +4 -4
- package/src/navigator/navigator-back-button/component.tsx +4 -4
- package/src/navigator/navigator-back-button/index.ts +1 -1
- package/src/navigator/navigator-button/component.tsx +4 -4
- package/src/navigator/navigator-button/index.ts +1 -1
- package/src/navigator/navigator-provider/component.tsx +6 -4
- package/src/navigator/navigator-provider/index.ts +1 -1
- package/src/navigator/navigator-screen/component.tsx +17 -6
- package/src/navigator/navigator-screen/index.ts +1 -1
- package/src/navigator/stories/index.tsx +210 -0
- package/src/navigator/test/index.tsx +509 -0
- package/src/navigator/types.ts +2 -0
- package/src/notice/test/__snapshots__/index.js.snap +39 -38
- package/src/notice/test/index.js +15 -36
- package/src/notice/test/list.js +6 -14
- package/src/number-control/README.md +9 -4
- package/src/number-control/index.tsx +100 -33
- package/src/number-control/styles/number-control-styles.js +26 -1
- package/src/number-control/test/index.js +53 -2
- package/src/number-control/types.ts +12 -0
- package/src/panel/test/body.js +2 -2
- package/src/placeholder/style.scss +5 -0
- package/src/popover/README.md +12 -7
- package/src/popover/index.tsx +20 -30
- package/src/popover/stories/index.tsx +29 -1
- package/src/popover/style.scss +9 -0
- package/src/popover/types.ts +18 -15
- package/src/radio-group/README.md +4 -0
- package/src/radio-group/index.js +6 -1
- package/src/{radio → radio-group/radio}/index.js +6 -1
- package/src/{radio-context → radio-group/radio-context}/index.js +0 -0
- package/src/radio-group/stories/index.js +11 -2
- package/src/sandbox/index.js +62 -47
- package/src/sandbox/index.native.js +72 -52
- package/src/sandbox/test/index.js +8 -11
- package/src/select-control/stories/index.tsx +9 -4
- package/src/shortcut/test/index.tsx +1 -1
- package/src/slot-fill/bubbles-virtually/fill.js +5 -5
- package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +5 -3
- package/src/slot-fill/bubbles-virtually/slot.js +10 -8
- package/src/slot-fill/bubbles-virtually/use-slot.js +15 -9
- package/src/slot-fill/fill.js +12 -2
- package/src/slot-fill/use-slot.js +3 -0
- package/src/snackbar/index.js +1 -1
- package/src/style.scss +4 -0
- package/src/surface/test/__snapshots__/index.tsx.snap +58 -46
- package/src/surface/test/index.tsx +6 -16
- package/src/tab-panel/index.tsx +5 -9
- package/src/tab-panel/test/index.tsx +78 -1
- package/src/text/test/__snapshots__/index.tsx.snap +19 -15
- package/src/text/test/index.tsx +2 -2
- package/src/text-control/index.tsx +0 -2
- package/src/text-control/stories/index.tsx +5 -6
- package/src/text-highlight/test/index.tsx +1 -3
- package/src/theme/README.md +34 -0
- package/src/theme/index.tsx +51 -0
- package/src/theme/stories/index.tsx +47 -0
- package/src/theme/styles.ts +28 -0
- package/src/theme/test/index.tsx +101 -0
- package/src/theme/types.ts +21 -0
- package/src/toggle-control/README.md +6 -4
- package/src/toggle-control/index.tsx +13 -2
- package/src/toggle-control/types.ts +2 -4
- package/src/toggle-group-control/stories/index.tsx +4 -4
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +219 -160
- package/src/toggle-group-control/test/index.tsx +129 -2
- package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +103 -0
- package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +99 -0
- package/src/toggle-group-control/toggle-group-control/component.tsx +29 -74
- package/src/toggle-group-control/toggle-group-control/styles.ts +12 -10
- package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +49 -25
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +39 -19
- package/src/toggle-group-control/types.ts +75 -63
- package/src/toolbar/test/index.js +2 -2
- package/src/toolbar-dropdown-menu/index.js +1 -1
- package/src/toolbar-group/test/index.js +6 -10
- package/src/tools-panel/stories/index.js +0 -1
- package/src/tools-panel/stories/tools-panel-with-item-group-slot.js +0 -1
- package/src/tools-panel/test/index.js +4 -6
- package/src/tools-panel/tools-panel/hook.ts +2 -9
- package/src/tools-panel/tools-panel-item/hook.ts +17 -3
- package/src/tooltip/index.js +3 -0
- package/src/tooltip/index.native.js +15 -0
- package/src/tooltip/test/index.native.js +1 -2
- package/src/tree-grid/test/__snapshots__/cell.js.snap +20 -20
- package/src/tree-grid/test/__snapshots__/roving-tab-index-item.js.snap +17 -15
- package/src/tree-grid/test/__snapshots__/roving-tab-index.js.snap +3 -1
- package/src/tree-grid/test/__snapshots__/row.js.snap +33 -25
- package/src/tree-grid/test/cell.js +4 -4
- package/src/tree-grid/test/roving-tab-index-item.js +8 -8
- package/src/tree-grid/test/roving-tab-index.js +3 -3
- package/src/tree-grid/test/row.js +20 -16
- package/src/truncate/test/index.tsx +4 -4
- package/src/ui/context/context-system-provider.js +5 -18
- package/src/ui/context/test/__snapshots__/context-system-provider.js.snap +23 -17
- package/src/ui/context/test/context-system-provider.js +3 -3
- package/src/ui/control-group/test/__snapshots__/index.js.snap +18 -16
- package/src/ui/control-group/test/index.js +1 -1
- package/src/ui/control-label/test/__snapshots__/index.js.snap +27 -21
- package/src/ui/control-label/test/index.js +3 -3
- package/src/ui/form-group/test/__snapshots__/index.js.snap +34 -30
- package/src/ui/form-group/test/index.js +2 -2
- package/src/ui/shortcut/test/__snapshots__/index.js.snap +1 -1
- package/src/ui/shortcut/test/index.js +3 -2
- package/src/ui/spinner/test/__snapshots__/index.js.snap +75 -73
- package/src/ui/spinner/test/index.js +10 -13
- package/src/ui/tooltip/test/index.js +16 -14
- package/src/unit-control/index.tsx +29 -30
- package/src/unit-control/styles/unit-control-styles.ts +6 -12
- package/src/unit-control/test/utils.ts +43 -0
- package/src/unit-control/types.ts +5 -6
- package/src/utils/config-values.js +0 -1
- package/src/utils/hooks/use-update-effect.js +5 -1
- package/src/utils/theme-variables.scss +8 -0
- package/src/utils/types.ts +0 -15
- package/src/v-stack/test/__snapshots__/index.tsx.snap +36 -30
- package/src/v-stack/test/index.tsx +3 -3
- package/src/view/test/__snapshots__/index.js.snap +34 -24
- package/src/view/test/index.js +5 -5
- package/src/visually-hidden/README.md +4 -0
- package/tsconfig.json +0 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/build/radio/index.js.map +0 -1
- package/build/radio-context/index.js.map +0 -1
- package/build-module/radio/index.js.map +0 -1
- package/build-module/radio-context/index.js.map +0 -1
- package/build-types/radio-context/index.d.ts.map +0 -1
- package/src/border-box-control/stories/index.js +0 -106
- package/src/form-file-upload/stories/index.js +0 -51
- package/src/isolated-event-container/index.js +0 -28
- package/src/navigator/stories/index.js +0 -194
- package/src/navigator/test/index.js +0 -472
- package/src/radio/stories/index.js +0 -20
|
@@ -40,36 +40,32 @@ const meta: ComponentMeta< typeof Card > = {
|
|
|
40
40
|
|
|
41
41
|
export default meta;
|
|
42
42
|
|
|
43
|
-
const Template: ComponentStory< typeof Card > = ( args ) =>
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</Card>
|
|
71
|
-
</div>
|
|
72
|
-
);
|
|
73
|
-
};
|
|
43
|
+
const Template: ComponentStory< typeof Card > = ( args ) => (
|
|
44
|
+
<Card { ...args }>
|
|
45
|
+
<CardHeader>
|
|
46
|
+
<Heading>CardHeader</Heading>
|
|
47
|
+
</CardHeader>
|
|
48
|
+
<CardBody>
|
|
49
|
+
<Text>CardBody</Text>
|
|
50
|
+
</CardBody>
|
|
51
|
+
<CardBody>
|
|
52
|
+
<Text>CardBody (before CardDivider)</Text>
|
|
53
|
+
</CardBody>
|
|
54
|
+
<CardDivider />
|
|
55
|
+
<CardBody>
|
|
56
|
+
<Text>CardBody (after CardDivider)</Text>
|
|
57
|
+
</CardBody>
|
|
58
|
+
<CardMedia>
|
|
59
|
+
<img
|
|
60
|
+
alt="Card Media"
|
|
61
|
+
src="https://images.unsplash.com/photo-1566125882500-87e10f726cdc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1867&q=80"
|
|
62
|
+
/>
|
|
63
|
+
</CardMedia>
|
|
64
|
+
<CardFooter>
|
|
65
|
+
<Text>CardFooter</Text>
|
|
66
|
+
<Button variant="secondary">Action Button</Button>
|
|
67
|
+
</CardFooter>
|
|
68
|
+
</Card>
|
|
69
|
+
);
|
|
74
70
|
|
|
75
71
|
export const Default: ComponentStory< typeof Card > = Template.bind( {} );
|
|
@@ -90,27 +90,27 @@ Snapshot Diff:
|
|
|
90
90
|
- First value
|
|
91
91
|
+ Second value
|
|
92
92
|
|
|
93
|
-
@@ -
|
|
94
|
-
>
|
|
95
|
-
<div
|
|
96
|
-
class="css-mgwsf4-View-Content e19lxcc00"
|
|
93
|
+
@@ -6,18 +6,18 @@
|
|
97
94
|
>
|
|
98
95
|
<div
|
|
99
|
-
|
|
100
|
-
+ class="components-flex components-card__header components-card-header css-2feznw-View-Flex-base-ItemsRow-Header-borderRadius-borderColor-large e19lxcc00"
|
|
101
|
-
data-wp-c16t="true"
|
|
102
|
-
data-wp-component="CardHeader"
|
|
103
|
-
>
|
|
104
|
-
Header
|
|
105
|
-
</div>
|
|
106
|
-
<div
|
|
107
|
-
- class="components-card__body components-card-body css-1nwhnu3-View-Body-borderRadius-medium e19lxcc00"
|
|
108
|
-
+ class="components-card__body components-card-body css-1nonx1n-View-Body-borderRadius-large e19lxcc00"
|
|
109
|
-
data-wp-c16t="true"
|
|
110
|
-
data-wp-component="CardBody"
|
|
96
|
+
class="css-mgwsf4-View-Content e19lxcc00"
|
|
111
97
|
>
|
|
112
|
-
|
|
113
|
-
|
|
98
|
+
<div
|
|
99
|
+
- class="components-flex components-card__header components-card-header css-3fkkv8-View-Flex-base-ItemsRow-Header-borderRadius-borderColor-medium e19lxcc00"
|
|
100
|
+
+ class="components-flex components-card__header components-card-header css-2feznw-View-Flex-base-ItemsRow-Header-borderRadius-borderColor-large e19lxcc00"
|
|
101
|
+
data-wp-c16t="true"
|
|
102
|
+
data-wp-component="CardHeader"
|
|
103
|
+
>
|
|
104
|
+
Header
|
|
105
|
+
</div>
|
|
106
|
+
<div
|
|
107
|
+
- class="components-card__body components-card-body css-1nwhnu3-View-Body-borderRadius-medium e19lxcc00"
|
|
108
|
+
+ class="components-card__body components-card-body css-1nonx1n-View-Body-borderRadius-large e19lxcc00"
|
|
109
|
+
data-wp-c16t="true"
|
|
110
|
+
data-wp-component="CardBody"
|
|
111
|
+
>
|
|
112
|
+
Code is Poetry
|
|
113
|
+
</div>
|
|
114
114
|
`;
|
|
115
115
|
|
|
116
116
|
exports[`Card Card component should add rounded border when the isRounded prop is true 1`] = `
|
|
@@ -768,24 +768,25 @@ Snapshot Diff:
|
|
|
768
768
|
- First value
|
|
769
769
|
+ Second value
|
|
770
770
|
|
|
771
|
-
@@ -
|
|
772
|
-
|
|
773
|
-
|
|
771
|
+
@@ -9,17 +9,17 @@
|
|
772
|
+
>
|
|
773
|
+
Code is Poetry
|
|
774
|
+
</div>
|
|
775
|
+
<div
|
|
776
|
+
aria-hidden="true"
|
|
777
|
+
- class="components-elevation css-1lsfy80-View-Elevation-sx-Base-elevationClassName e19lxcc00"
|
|
778
|
+
+ class="components-elevation css-15t1t3g-View-Elevation-sx-Base-elevationClassName e19lxcc00"
|
|
779
|
+
data-wp-c16t="true"
|
|
780
|
+
data-wp-component="Elevation"
|
|
781
|
+
/>
|
|
782
|
+
<div
|
|
783
|
+
aria-hidden="true"
|
|
784
|
+
- class="components-elevation css-18cl04p-View-Elevation-sx-Base-elevationClassName e19lxcc00"
|
|
785
|
+
+ class="components-elevation css-15t1t3g-View-Elevation-sx-Base-elevationClassName e19lxcc00"
|
|
786
|
+
data-wp-c16t="true"
|
|
787
|
+
data-wp-component="Elevation"
|
|
788
|
+
/>
|
|
774
789
|
</div>
|
|
775
|
-
<div
|
|
776
|
-
aria-hidden="true"
|
|
777
|
-
- class="components-elevation css-1lsfy80-View-Elevation-sx-Base-elevationClassName e19lxcc00"
|
|
778
|
-
+ class="components-elevation css-15t1t3g-View-Elevation-sx-Base-elevationClassName e19lxcc00"
|
|
779
|
-
data-wp-c16t="true"
|
|
780
|
-
data-wp-component="Elevation"
|
|
781
|
-
/>
|
|
782
|
-
<div
|
|
783
|
-
aria-hidden="true"
|
|
784
|
-
- class="components-elevation css-18cl04p-View-Elevation-sx-Base-elevationClassName e19lxcc00"
|
|
785
|
-
+ class="components-elevation css-15t1t3g-View-Elevation-sx-Base-elevationClassName e19lxcc00"
|
|
786
|
-
data-wp-c16t="true"
|
|
787
|
-
data-wp-component="Elevation"
|
|
788
|
-
/>
|
|
789
790
|
</div>
|
|
790
791
|
`;
|
|
791
792
|
|
package/src/card/test/index.tsx
CHANGED
|
@@ -70,9 +70,7 @@ describe( 'Card', () => {
|
|
|
70
70
|
<Card>Code is Poetry</Card>
|
|
71
71
|
);
|
|
72
72
|
|
|
73
|
-
expect( withElevation
|
|
74
|
-
withoutElevation.firstChild
|
|
75
|
-
);
|
|
73
|
+
expect( withElevation ).toMatchDiffSnapshot( withoutElevation );
|
|
76
74
|
} );
|
|
77
75
|
|
|
78
76
|
it( 'should add different amounts of white space when using the size prop', () => {
|
|
@@ -90,9 +88,7 @@ describe( 'Card', () => {
|
|
|
90
88
|
</Card>
|
|
91
89
|
);
|
|
92
90
|
|
|
93
|
-
expect( withSizeDefault
|
|
94
|
-
withSizeLarge.firstChild
|
|
95
|
-
);
|
|
91
|
+
expect( withSizeDefault ).toMatchDiffSnapshot( withSizeLarge );
|
|
96
92
|
} );
|
|
97
93
|
|
|
98
94
|
it( 'should warn when the isElevated prop is passed', () => {
|
|
@@ -16,13 +16,14 @@ import Button from '../button';
|
|
|
16
16
|
import Dropdown from '../dropdown';
|
|
17
17
|
import Tooltip from '../tooltip';
|
|
18
18
|
|
|
19
|
-
function Option( {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
function Option( props ) {
|
|
20
|
+
const {
|
|
21
|
+
className,
|
|
22
|
+
isSelected,
|
|
23
|
+
selectedIconProps,
|
|
24
|
+
tooltipText,
|
|
25
|
+
...additionalProps
|
|
26
|
+
} = props;
|
|
26
27
|
const optionButton = (
|
|
27
28
|
<Button
|
|
28
29
|
isPressed={ isSelected }
|
|
@@ -52,12 +53,8 @@ function Option( {
|
|
|
52
53
|
);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
function DropdownLinkAction( {
|
|
56
|
-
buttonProps,
|
|
57
|
-
className,
|
|
58
|
-
dropdownProps,
|
|
59
|
-
linkText,
|
|
60
|
-
} ) {
|
|
56
|
+
function DropdownLinkAction( props ) {
|
|
57
|
+
const { buttonProps, className, dropdownProps, linkText } = props;
|
|
61
58
|
return (
|
|
62
59
|
<Dropdown
|
|
63
60
|
className={ classnames(
|
|
@@ -80,7 +77,8 @@ function DropdownLinkAction( {
|
|
|
80
77
|
);
|
|
81
78
|
}
|
|
82
79
|
|
|
83
|
-
function ButtonAction(
|
|
80
|
+
function ButtonAction( props ) {
|
|
81
|
+
const { className, children, ...additionalProps } = props;
|
|
84
82
|
return (
|
|
85
83
|
<Button
|
|
86
84
|
className={ classnames(
|
|
@@ -95,12 +93,8 @@ function ButtonAction( { className, children, ...additionalProps } ) {
|
|
|
95
93
|
);
|
|
96
94
|
}
|
|
97
95
|
|
|
98
|
-
export default function CircularOptionPicker( {
|
|
99
|
-
actions,
|
|
100
|
-
className,
|
|
101
|
-
options,
|
|
102
|
-
children,
|
|
103
|
-
} ) {
|
|
96
|
+
export default function CircularOptionPicker( props ) {
|
|
97
|
+
const { actions, className, options, children } = props;
|
|
104
98
|
return (
|
|
105
99
|
<div
|
|
106
100
|
className={ classnames(
|
|
@@ -1,54 +1,6 @@
|
|
|
1
1
|
# ColorPalette
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
The component accepts the following props.
|
|
6
|
-
|
|
7
|
-
{ colors, disableCustomColors = false, value, onChange, className, clearable = true }
|
|
8
|
-
|
|
9
|
-
### colors
|
|
10
|
-
|
|
11
|
-
Array with the colors to be shown.
|
|
12
|
-
|
|
13
|
-
- Type: `Array`
|
|
14
|
-
- Required: Yes
|
|
15
|
-
|
|
16
|
-
### disableCustomColors
|
|
17
|
-
|
|
18
|
-
Whether to allow custom color or not.
|
|
19
|
-
|
|
20
|
-
- Type: `Boolean`
|
|
21
|
-
- Required: No
|
|
22
|
-
- Default: false
|
|
23
|
-
|
|
24
|
-
### value
|
|
25
|
-
|
|
26
|
-
currently active value
|
|
27
|
-
|
|
28
|
-
- Type: `String`
|
|
29
|
-
- Required: No
|
|
30
|
-
|
|
31
|
-
### onChange
|
|
32
|
-
|
|
33
|
-
Callback called when a color is selected.
|
|
34
|
-
|
|
35
|
-
- Type: `Function`
|
|
36
|
-
- Required: Yes
|
|
37
|
-
|
|
38
|
-
### className
|
|
39
|
-
|
|
40
|
-
classes to be applied to the container.
|
|
41
|
-
|
|
42
|
-
- Type: `String`
|
|
43
|
-
- Required: No
|
|
44
|
-
|
|
45
|
-
### clearable
|
|
46
|
-
|
|
47
|
-
Whether the palette should have a clearing button or not.
|
|
48
|
-
|
|
49
|
-
- Type: `Boolean`
|
|
50
|
-
- Required: No
|
|
51
|
-
- Default: true
|
|
3
|
+
`ColorPalette` allows the user to pick a color from a list of pre-defined color entries.
|
|
52
4
|
|
|
53
5
|
## Usage
|
|
54
6
|
|
|
@@ -79,3 +31,53 @@ If you're using this component outside the editor, you can
|
|
|
79
31
|
for the `ColorPalette`'s color swatches, by rendering your `ColorPalette` with a
|
|
80
32
|
`Popover.Slot` further up the element tree and within a
|
|
81
33
|
`SlotFillProvider` overall.
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
The component accepts the following props.
|
|
38
|
+
|
|
39
|
+
### `colors`: `( PaletteObject | ColorObject )[]`
|
|
40
|
+
|
|
41
|
+
Array with the colors to be shown. When displaying multiple color palettes to choose from, the format of the array changes from an array of colors objects, to an array of color palettes.
|
|
42
|
+
|
|
43
|
+
- Required: No
|
|
44
|
+
- Default: `[]`
|
|
45
|
+
|
|
46
|
+
### `disableCustomColors`: `boolean`
|
|
47
|
+
|
|
48
|
+
Whether to allow the user to pick a custom color on top of the predefined choices (defined via the `colors` prop).
|
|
49
|
+
|
|
50
|
+
- Required: No
|
|
51
|
+
- Default: `false`
|
|
52
|
+
|
|
53
|
+
### `enableAlpha`: `boolean`
|
|
54
|
+
|
|
55
|
+
Whether the color picker should display the alpha channel both in the bottom inputs as well as in the color picker itself.
|
|
56
|
+
|
|
57
|
+
- Required: No
|
|
58
|
+
- Default: `false`
|
|
59
|
+
|
|
60
|
+
### `value`: `string`
|
|
61
|
+
|
|
62
|
+
currently active value
|
|
63
|
+
|
|
64
|
+
- Required: No
|
|
65
|
+
|
|
66
|
+
### `onChange`: `OnColorChange`
|
|
67
|
+
|
|
68
|
+
Callback called when a color is selected.
|
|
69
|
+
|
|
70
|
+
- Required: Yes
|
|
71
|
+
|
|
72
|
+
### `className`: `string`
|
|
73
|
+
|
|
74
|
+
classes to be applied to the container.
|
|
75
|
+
|
|
76
|
+
- Required: No
|
|
77
|
+
|
|
78
|
+
### `clearable`: `boolean`
|
|
79
|
+
|
|
80
|
+
Whether the palette should have a clearing button.
|
|
81
|
+
|
|
82
|
+
- Required: No
|
|
83
|
+
- Default: `true`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
/**
|
|
3
2
|
* External dependencies
|
|
4
3
|
*/
|
|
4
|
+
import type { ForwardedRef } from 'react';
|
|
5
5
|
import { colord, extend } from 'colord';
|
|
6
6
|
import namesPlugin from 'colord/plugins/names';
|
|
7
7
|
import a11yPlugin from 'colord/plugins/a11y';
|
|
@@ -10,7 +10,7 @@ import a11yPlugin from 'colord/plugins/a11y';
|
|
|
10
10
|
* WordPress dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { __, sprintf } from '@wordpress/i18n';
|
|
13
|
-
import { useCallback, useMemo } from '@wordpress/element';
|
|
13
|
+
import { useCallback, useMemo, forwardRef } from '@wordpress/element';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
@@ -23,6 +23,15 @@ import { Flex, FlexItem } from '../flex';
|
|
|
23
23
|
import { Truncate } from '../truncate';
|
|
24
24
|
import { ColorHeading } from './styles';
|
|
25
25
|
import DropdownContentWrapper from '../dropdown/dropdown-content-wrapper';
|
|
26
|
+
import type {
|
|
27
|
+
ColorObject,
|
|
28
|
+
ColorPaletteProps,
|
|
29
|
+
CustomColorPickerDropdownProps,
|
|
30
|
+
MultiplePalettesProps,
|
|
31
|
+
PaletteObject,
|
|
32
|
+
SinglePaletteProps,
|
|
33
|
+
} from './types';
|
|
34
|
+
import type { WordPressComponentProps } from '../ui/context';
|
|
26
35
|
|
|
27
36
|
extend( [ namesPlugin, a11yPlugin ] );
|
|
28
37
|
|
|
@@ -33,7 +42,7 @@ function SinglePalette( {
|
|
|
33
42
|
onChange,
|
|
34
43
|
value,
|
|
35
44
|
actions,
|
|
36
|
-
} ) {
|
|
45
|
+
}: SinglePaletteProps ) {
|
|
37
46
|
const colorOptions = useMemo( () => {
|
|
38
47
|
return colors.map( ( { color, name }, index ) => {
|
|
39
48
|
const colordColor = colord( color );
|
|
@@ -74,6 +83,11 @@ function SinglePalette( {
|
|
|
74
83
|
);
|
|
75
84
|
} );
|
|
76
85
|
}, [ colors, value, onChange, clearColor ] );
|
|
86
|
+
|
|
87
|
+
if ( colors.length === 0 ) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
77
91
|
return (
|
|
78
92
|
<CircularOptionPicker
|
|
79
93
|
className={ className }
|
|
@@ -90,7 +104,11 @@ function MultiplePalettes( {
|
|
|
90
104
|
onChange,
|
|
91
105
|
value,
|
|
92
106
|
actions,
|
|
93
|
-
} ) {
|
|
107
|
+
}: MultiplePalettesProps ) {
|
|
108
|
+
if ( colors.length === 0 ) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
|
|
94
112
|
return (
|
|
95
113
|
<VStack spacing={ 3 } className={ className }>
|
|
96
114
|
{ colors.map( ( { name, colors: colorPalette }, index ) => {
|
|
@@ -117,7 +135,7 @@ export function CustomColorPickerDropdown( {
|
|
|
117
135
|
isRenderedInSidebar,
|
|
118
136
|
popoverProps: receivedPopoverProps,
|
|
119
137
|
...props
|
|
120
|
-
} ) {
|
|
138
|
+
}: CustomColorPickerDropdownProps ) {
|
|
121
139
|
const popoverProps = useMemo(
|
|
122
140
|
() => ( {
|
|
123
141
|
shift: true,
|
|
@@ -148,9 +166,9 @@ export function CustomColorPickerDropdown( {
|
|
|
148
166
|
}
|
|
149
167
|
|
|
150
168
|
export const extractColorNameFromCurrentValue = (
|
|
151
|
-
currentValue,
|
|
152
|
-
colors = [],
|
|
153
|
-
showMultiplePalettes = false
|
|
169
|
+
currentValue?: ColorPaletteProps[ 'value' ],
|
|
170
|
+
colors: ColorPaletteProps[ 'colors' ] = [],
|
|
171
|
+
showMultiplePalettes: ColorPaletteProps[ '__experimentalHasMultipleOrigins' ] = false
|
|
154
172
|
) => {
|
|
155
173
|
if ( ! currentValue ) {
|
|
156
174
|
return '';
|
|
@@ -162,7 +180,10 @@ export const extractColorNameFromCurrentValue = (
|
|
|
162
180
|
: colord( currentValue ).toHex();
|
|
163
181
|
|
|
164
182
|
// Normalize format of `colors` to simplify the following loop
|
|
165
|
-
|
|
183
|
+
type normalizedPaletteObject = { colors: ColorObject[] };
|
|
184
|
+
const colorPalettes: normalizedPaletteObject[] = showMultiplePalettes
|
|
185
|
+
? ( colors as PaletteObject[] )
|
|
186
|
+
: [ { colors: colors as ColorObject[] } ];
|
|
166
187
|
for ( const { colors: paletteColors } of colorPalettes ) {
|
|
167
188
|
for ( const { name: colorName, color: colorValue } of paletteColors ) {
|
|
168
189
|
const normalizedColorValue = currentValueIsCssVariable
|
|
@@ -179,28 +200,62 @@ export const extractColorNameFromCurrentValue = (
|
|
|
179
200
|
return __( 'Custom' );
|
|
180
201
|
};
|
|
181
202
|
|
|
182
|
-
export const showTransparentBackground = ( currentValue ) => {
|
|
203
|
+
export const showTransparentBackground = ( currentValue?: string ) => {
|
|
183
204
|
if ( typeof currentValue === 'undefined' ) {
|
|
184
205
|
return true;
|
|
185
206
|
}
|
|
186
207
|
return colord( currentValue ).alpha() === 0;
|
|
187
208
|
};
|
|
188
209
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
colors
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
210
|
+
const areColorsMultiplePalette = (
|
|
211
|
+
colors: NonNullable< ColorPaletteProps[ 'colors' ] >
|
|
212
|
+
): colors is PaletteObject[] => {
|
|
213
|
+
return colors.every( ( colorObj ) =>
|
|
214
|
+
Array.isArray( ( colorObj as PaletteObject ).colors )
|
|
215
|
+
);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
function UnforwardedColorPalette(
|
|
219
|
+
props: WordPressComponentProps< ColorPaletteProps, 'div' >,
|
|
220
|
+
forwardedRef: ForwardedRef< any >
|
|
221
|
+
) {
|
|
222
|
+
const {
|
|
223
|
+
clearable = true,
|
|
224
|
+
colors = [],
|
|
225
|
+
disableCustomColors = false,
|
|
226
|
+
enableAlpha,
|
|
227
|
+
onChange,
|
|
228
|
+
value,
|
|
229
|
+
__experimentalHasMultipleOrigins = false,
|
|
230
|
+
__experimentalIsRenderedInSidebar = false,
|
|
231
|
+
...otherProps
|
|
232
|
+
} = props;
|
|
200
233
|
const clearColor = useCallback( () => onChange( undefined ), [ onChange ] );
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
234
|
+
|
|
235
|
+
const buttonLabelName = useMemo(
|
|
236
|
+
() =>
|
|
237
|
+
extractColorNameFromCurrentValue(
|
|
238
|
+
value,
|
|
239
|
+
colors,
|
|
240
|
+
__experimentalHasMultipleOrigins
|
|
241
|
+
),
|
|
242
|
+
[ value, colors, __experimentalHasMultipleOrigins ]
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
// Make sure that the `colors` array has a format (single/multiple) that is
|
|
246
|
+
// compatible with the `__experimentalHasMultipleOrigins` flag. This is true
|
|
247
|
+
// when __experimentalHasMultipleOrigins and areColorsMultiplePalette() are
|
|
248
|
+
// either both `true` or both `false`.
|
|
249
|
+
if (
|
|
250
|
+
colors.length > 0 &&
|
|
251
|
+
__experimentalHasMultipleOrigins !== areColorsMultiplePalette( colors )
|
|
252
|
+
) {
|
|
253
|
+
// eslint-disable-next-line no-console
|
|
254
|
+
console.warn(
|
|
255
|
+
'wp.components.ColorPalette: please specify a format for the `colors` prop that is compatible with the `__experimentalHasMultipleOrigins` prop.'
|
|
256
|
+
);
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
204
259
|
|
|
205
260
|
const renderCustomColorPicker = () => (
|
|
206
261
|
<DropdownContentWrapper paddingSize="none">
|
|
@@ -212,20 +267,11 @@ export default function ColorPalette( {
|
|
|
212
267
|
</DropdownContentWrapper>
|
|
213
268
|
);
|
|
214
269
|
|
|
215
|
-
const colordColor = colord( value );
|
|
270
|
+
const colordColor = colord( value ?? '' );
|
|
216
271
|
|
|
217
272
|
const valueWithoutLeadingHash = value?.startsWith( '#' )
|
|
218
273
|
? value.substring( 1 )
|
|
219
274
|
: value ?? '';
|
|
220
|
-
const buttonLabelName = useMemo(
|
|
221
|
-
() =>
|
|
222
|
-
extractColorNameFromCurrentValue(
|
|
223
|
-
value,
|
|
224
|
-
colors,
|
|
225
|
-
showMultiplePalettes
|
|
226
|
-
),
|
|
227
|
-
[ value, colors, showMultiplePalettes ]
|
|
228
|
-
);
|
|
229
275
|
|
|
230
276
|
const customColorAccessibleLabel = !! valueWithoutLeadingHash
|
|
231
277
|
? sprintf(
|
|
@@ -238,8 +284,20 @@ export default function ColorPalette( {
|
|
|
238
284
|
)
|
|
239
285
|
: __( 'Custom color picker.' );
|
|
240
286
|
|
|
287
|
+
const paletteCommonProps = {
|
|
288
|
+
clearable,
|
|
289
|
+
clearColor,
|
|
290
|
+
onChange,
|
|
291
|
+
value,
|
|
292
|
+
actions: !! clearable && (
|
|
293
|
+
<CircularOptionPicker.ButtonAction onClick={ clearColor }>
|
|
294
|
+
{ __( 'Clear' ) }
|
|
295
|
+
</CircularOptionPicker.ButtonAction>
|
|
296
|
+
),
|
|
297
|
+
};
|
|
298
|
+
|
|
241
299
|
return (
|
|
242
|
-
<VStack spacing={ 3 }
|
|
300
|
+
<VStack spacing={ 3 } ref={ forwardedRef } { ...otherProps }>
|
|
243
301
|
{ ! disableCustomColors && (
|
|
244
302
|
<CustomColorPickerDropdown
|
|
245
303
|
isRenderedInSidebar={ __experimentalIsRenderedInSidebar }
|
|
@@ -284,22 +342,45 @@ export default function ColorPalette( {
|
|
|
284
342
|
) }
|
|
285
343
|
/>
|
|
286
344
|
) }
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
{ __( 'Clear' ) }
|
|
299
|
-
</CircularOptionPicker.ButtonAction>
|
|
300
|
-
)
|
|
301
|
-
}
|
|
302
|
-
/>
|
|
345
|
+
{ __experimentalHasMultipleOrigins ? (
|
|
346
|
+
<MultiplePalettes
|
|
347
|
+
{ ...paletteCommonProps }
|
|
348
|
+
colors={ colors as PaletteObject[] }
|
|
349
|
+
/>
|
|
350
|
+
) : (
|
|
351
|
+
<SinglePalette
|
|
352
|
+
{ ...paletteCommonProps }
|
|
353
|
+
colors={ colors as ColorObject[] }
|
|
354
|
+
/>
|
|
355
|
+
) }
|
|
303
356
|
</VStack>
|
|
304
357
|
);
|
|
305
358
|
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Allows the user to pick a color from a list of pre-defined color entries.
|
|
362
|
+
*
|
|
363
|
+
* ```jsx
|
|
364
|
+
* import { ColorPalette } from '@wordpress/components';
|
|
365
|
+
* import { useState } from '@wordpress/element';
|
|
366
|
+
*
|
|
367
|
+
* const MyColorPalette = () => {
|
|
368
|
+
* const [ color, setColor ] = useState ( '#f00' )
|
|
369
|
+
* const colors = [
|
|
370
|
+
* { name: 'red', color: '#f00' },
|
|
371
|
+
* { name: 'white', color: '#fff' },
|
|
372
|
+
* { name: 'blue', color: '#00f' },
|
|
373
|
+
* ];
|
|
374
|
+
* return (
|
|
375
|
+
* <ColorPalette
|
|
376
|
+
* colors={ colors }
|
|
377
|
+
* value={ color }
|
|
378
|
+
* onChange={ ( color ) => setColor( color ) }
|
|
379
|
+
* />
|
|
380
|
+
* );
|
|
381
|
+
* } );
|
|
382
|
+
* ```
|
|
383
|
+
*/
|
|
384
|
+
export const ColorPalette = forwardRef( UnforwardedColorPalette );
|
|
385
|
+
|
|
386
|
+
export default ColorPalette;
|