: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
let resetValue = parseFloat(`${resetFallbackValue}`);
let onChangeResetValue = resetValue;
onChangeResetValue = undefined;
* Previously, this callback would always receive undefined as
* an argument. This behavior is unexpected, specifically
* when resetFallbackValue is defined.
* The value of undefined is not ideal. Passing it through
* to internal <input /> elements would change it from a
* controlled component to an uncontrolled component.
* For now, to minimize unexpected regressions, we're going to
* preserve the undefined callback argument, except when a
* resetFallbackValue is defined.
onChange(onChangeResetValue);
const handleShowTooltip = () => setShowTooltip(true);
const handleHideTooltip = () => setShowTooltip(false);
const handleOnBlur = event => {
const handleOnFocus = event => {
[(0,external_wp_i18n_namespaceObject.isRTL)() ? 'right' : 'left']: fillValueOffset
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control, {
__nextHasNoMarginBottom: __nextHasNoMarginBottom,
hideLabelFromVision: hideLabelFromVision,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(range_control_styles_Root, {
className: "components-range-control__root",
__next40pxDefaultSize: __next40pxDefaultSize,
children: [beforeIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BeforeIconWrapper, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(range_control_styles_Wrapper, {
__nextHasNoMarginBottom: __nextHasNoMarginBottom,
className: wrapperClasses,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(input_range, {
className: "components-range-control__slider",
describedBy: describedBy,
onChange: handleOnRangeChange,
onMouseMove: onMouseMove,
onMouseLeave: onMouseLeave,
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([inputRef, forwardedRef]),
value: inputSliderValue !== null && inputSliderValue !== void 0 ? inputSliderValue : undefined
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RangeRail, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Track, {
className: "components-range-control__track",
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ThumbWrapper, {
className: "components-range-control__thumb-wrapper",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Thumb, {
isFocused: isThumbFocused,
}), enableTooltip && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SimpleTooltip, {
className: "components-range-control__tooltip",
tooltipPosition: "bottom",
renderTooltipContent: renderTooltipContent,
show: isCurrentlyFocused || showTooltip,
}), afterIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AfterIconWrapper, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
}), hasInputField && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InputNumber, {
className: "components-range-control__number",
isShiftStepEnabled: isShiftStepEnabled,
onBlur: handleOnInputNumberBlur,
onChange: handleOnChange,
size: __next40pxDefaultSize ? '__unstable-large' : 'default',
__unstableInputWidth: __next40pxDefaultSize ? space(20) : space(16),
// @ts-expect-error TODO: Investigate if the `null` value is necessary
}), allowReset && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionRightWrapper, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, {
className: "components-range-control__reset",
disabled: disabled || value === undefined,
children: (0,external_wp_i18n_namespaceObject.__)('Reset')
* RangeControls are used to make selections from a range of incremental values.
* import { RangeControl } from '@wordpress/components';
* import { useState } from '@wordpress/element';
* const MyRangeControl = () => {
* const [ isChecked, setChecked ] = useState( true );
* help="Please select how transparent you would like this."
const RangeControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedRangeControl);
/* harmony default export */ const range_control = (RangeControl);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/styles.js
const NumberControlWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(number_control, true ? {
} : 0)("width:", space(24), ";" + ( true ? "" : 0));
const styles_SelectControl = /*#__PURE__*/emotion_styled_base_browser_esm(select_control, true ? {
} : 0)("margin-left:", space(-2), ";width:5em;" + ( true ? "" : 0));
const styles_RangeControl = /*#__PURE__*/emotion_styled_base_browser_esm(range_control, true ? {
} : 0)("flex:1;margin-right:", space(2), ";" + ( true ? "" : 0));
// Make the Hue circle picker not go out of the bar.
const interactiveHueStyles = `
.react-colorful__interactive {
width: calc( 100% - ${space(2)} );
margin-left: ${space(1)};
const AuxiliaryColorArtefactWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? {
} : 0)("padding-top:", space(2), ";padding-right:0;padding-left:0;padding-bottom:0;" + ( true ? "" : 0));
const AuxiliaryColorArtefactHStackHeader = /*#__PURE__*/emotion_styled_base_browser_esm(h_stack_component, true ? {
} : 0)("padding-left:", space(4), ";padding-right:", space(4), ";" + ( true ? "" : 0));
const ColorInputWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(flex_component, true ? {
} : 0)("padding-top:", space(4), ";padding-left:", space(4), ";padding-right:", space(3), ";padding-bottom:", space(5), ";" + ( true ? "" : 0));
const ColorfulWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? {
} : 0)(boxSizingReset, ";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:", space(4), ";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:", space(2), ";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ", config_values.borderWidthFocus, " #fff;}", interactiveHueStyles, ";" + ( true ? "" : 0));
const CopyButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? {
} : 0)("&&&&&{min-width:", space(6), ";padding:0;>svg{margin-right:0;}}" + ( true ? "" : 0));
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/copy.js
const copy_copy = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"
/* harmony default export */ const library_copy = (copy_copy);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/color-copy-button.js
const ColorCopyButton = props => {
const [copiedColor, setCopiedColor] = (0,external_wp_element_namespaceObject.useState)(null);
const copyTimer = (0,external_wp_element_namespaceObject.useRef)();
const copyRef = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(() => {
return color.toHslString();
return color.toRgbString();
clearTimeout(copyTimer.current);
setCopiedColor(color.toHex());
copyTimer.current = setTimeout(() => {
copyTimer.current = undefined;
(0,external_wp_element_namespaceObject.useEffect)(() => {
// Clear copyTimer on component unmount.
clearTimeout(copyTimer.current);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip, {
text: copiedColor === color.toHex() ? (0,external_wp_i18n_namespaceObject.__)('Copied!') : (0,external_wp_i18n_namespaceObject.__)('Copy'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/input-with-slider.js
const InputWithSlider = ({
const onNumberControlChange = newValue => {
if (typeof newValue === 'string') {
onChange(parseInt(newValue, 10));
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NumberControlWrapper, {
hideLabelFromVision: true,
onChange: onNumberControlChange,
prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(spacer_component, {
color: COLORS.theme.accent,
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_RangeControl, {
__nextHasNoMarginBottom: true,
hideLabelFromVision: true,
// See: https://github.com/WordPress/gutenberg/pull/40535#issuecomment-1172418185
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/rgb-input.js
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
onChange: nextR => onChange(w({
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
onChange: nextG => onChange(w({
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
onChange: nextB => onChange(w({
}), enableAlpha && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InputWithSlider, {
value: Math.trunc(a * 100),
onChange: nextA => onChange(w({
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-picker/hsl-input.js
const colorPropHSLA = (0,external_wp_element_namespaceObject.useMemo)(() => color.toHsl(), [color]);
const [internalHSLA, setInternalHSLA] = (0,external_wp_element_namespaceObject.useState)({
const isInternalColorSameAsReceivedColor = color.isEqual(w(internalHSLA));
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isInternalColorSameAsReceivedColor) {
// Keep internal HSLA color up to date with the received color prop
setInternalHSLA(colorPropHSLA);
}, [colorPropHSLA, isInternalColorSameAsReceivedColor]);
// If the internal color is equal to the received color prop, we can use the
// HSLA values from the local state which, compared to the received color prop,
// retain more details about the actual H and S values that the user selected,
// and thus allow for better UX when interacting with the H and S sliders.
const colorValue = isInternalColorSameAsReceivedColor ? internalHSLA : colorPropHSLA;
const updateHSLAValue = partialNewValue => {
const nextOnChangeValue = w({
// Fire `onChange` only if the resulting color is different from the
// Otherwise, update the internal HSLA color to cause a re-render.
if (!color.isEqual(nextOnChangeValue)) {
onChange(nextOnChangeValue);
setInternalHSLA(prevHSLA => ({