@wordpress/components 29.5.1 → 29.7.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.
Files changed (100) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/build/angle-picker-control/index.js +1 -1
  3. package/build/angle-picker-control/index.js.map +1 -1
  4. package/build/autocomplete/index.js +5 -30
  5. package/build/autocomplete/index.js.map +1 -1
  6. package/build/custom-select-control-v2/styles.js +9 -9
  7. package/build/custom-select-control-v2/styles.js.map +1 -1
  8. package/build/font-size-picker/font-size-picker-select.js +1 -8
  9. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  10. package/build/font-size-picker/index.js +12 -34
  11. package/build/font-size-picker/index.js.map +1 -1
  12. package/build/font-size-picker/styles.js +12 -19
  13. package/build/font-size-picker/styles.js.map +1 -1
  14. package/build/font-size-picker/utils.js +0 -22
  15. package/build/font-size-picker/utils.js.map +1 -1
  16. package/build/number-control/index.js +6 -4
  17. package/build/number-control/index.js.map +1 -1
  18. package/build/range-control/index.js +6 -5
  19. package/build/range-control/index.js.map +1 -1
  20. package/build/toolbar/toolbar-dropdown-menu/index.js +4 -3
  21. package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  22. package/build/toolbar/toolbar-item/index.js +4 -3
  23. package/build/toolbar/toolbar-item/index.js.map +1 -1
  24. package/build/utils/get-node-text.js +30 -0
  25. package/build/utils/get-node-text.js.map +1 -0
  26. package/build/utils/math.js +18 -15
  27. package/build/utils/math.js.map +1 -1
  28. package/build-module/angle-picker-control/index.js +1 -1
  29. package/build-module/angle-picker-control/index.js.map +1 -1
  30. package/build-module/autocomplete/index.js +3 -28
  31. package/build-module/autocomplete/index.js.map +1 -1
  32. package/build-module/custom-select-control-v2/styles.js +9 -9
  33. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  34. package/build-module/font-size-picker/font-size-picker-select.js +2 -9
  35. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  36. package/build-module/font-size-picker/index.js +14 -36
  37. package/build-module/font-size-picker/index.js.map +1 -1
  38. package/build-module/font-size-picker/styles.js +11 -18
  39. package/build-module/font-size-picker/styles.js.map +1 -1
  40. package/build-module/font-size-picker/utils.js +0 -22
  41. package/build-module/font-size-picker/utils.js.map +1 -1
  42. package/build-module/number-control/index.js +7 -5
  43. package/build-module/number-control/index.js.map +1 -1
  44. package/build-module/range-control/index.js +6 -5
  45. package/build-module/range-control/index.js.map +1 -1
  46. package/build-module/toolbar/toolbar-dropdown-menu/index.js +3 -2
  47. package/build-module/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  48. package/build-module/toolbar/toolbar-item/index.js +3 -2
  49. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  50. package/build-module/utils/get-node-text.js +24 -0
  51. package/build-module/utils/get-node-text.js.map +1 -0
  52. package/build-module/utils/math.js +17 -14
  53. package/build-module/utils/math.js.map +1 -1
  54. package/build-style/style-rtl.css +1 -3
  55. package/build-style/style.css +1 -3
  56. package/build-types/angle-picker-control/index.d.ts +1 -1
  57. package/build-types/autocomplete/index.d.ts +2 -2
  58. package/build-types/autocomplete/index.d.ts.map +1 -1
  59. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  60. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  61. package/build-types/font-size-picker/index.d.ts.map +1 -1
  62. package/build-types/font-size-picker/styles.d.ts +0 -4
  63. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  64. package/build-types/font-size-picker/utils.d.ts +1 -9
  65. package/build-types/font-size-picker/utils.d.ts.map +1 -1
  66. package/build-types/number-control/index.d.ts.map +1 -1
  67. package/build-types/range-control/index.d.ts +6 -5
  68. package/build-types/range-control/index.d.ts.map +1 -1
  69. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +2 -2
  70. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts.map +1 -1
  71. package/build-types/toolbar/toolbar-item/index.d.ts +2 -2
  72. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  73. package/build-types/utils/get-node-text.d.ts +3 -0
  74. package/build-types/utils/get-node-text.d.ts.map +1 -0
  75. package/build-types/utils/math.d.ts +10 -11
  76. package/build-types/utils/math.d.ts.map +1 -1
  77. package/package.json +19 -19
  78. package/src/angle-picker-control/README.md +1 -1
  79. package/src/angle-picker-control/index.tsx +1 -1
  80. package/src/autocomplete/index.tsx +3 -30
  81. package/src/button/style.scss +0 -2
  82. package/src/custom-select-control-v2/styles.ts +1 -0
  83. package/src/font-size-picker/font-size-picker-select.tsx +2 -12
  84. package/src/font-size-picker/index.tsx +18 -47
  85. package/src/font-size-picker/styles.ts +0 -5
  86. package/src/font-size-picker/test/index.tsx +36 -80
  87. package/src/font-size-picker/test/utils.ts +1 -37
  88. package/src/font-size-picker/utils.ts +1 -24
  89. package/src/form-token-field/style.scss +1 -1
  90. package/src/number-control/index.tsx +8 -7
  91. package/src/number-control/test/index.tsx +15 -2
  92. package/src/range-control/index.tsx +6 -5
  93. package/src/toolbar/toolbar-dropdown-menu/index.tsx +3 -2
  94. package/src/toolbar/toolbar-item/index.tsx +3 -2
  95. package/src/utils/get-node-text.ts +24 -0
  96. package/src/utils/math.js +17 -22
  97. package/src/utils/test/get-node-text.js +37 -0
  98. package/src/utils/test/math.js +28 -32
  99. package/src/utils/theme-variables.scss +0 -4
  100. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__","isRTL","useRef","useState","forwardRef","useInstanceId","useMergeRefs","BaseControl","Button","Icon","COLORS","floatClamp","useControlledRangeValue","clamp","InputRange","RangeRail","SimpleTooltip","ActionRightWrapper","AfterIconWrapper","BeforeIconWrapper","InputNumber","Root","Track","ThumbWrapper","Thumb","Wrapper","space","maybeWarnDeprecated36pxSize","jsx","_jsx","jsxs","_jsxs","noop","computeResetValue","resetFallbackValue","initialPosition","undefined","Number","isNaN","UnforwardedRangeControl","props","forwardedRef","__nextHasNoMarginBottom","afterIcon","allowReset","beforeIcon","className","color","colorProp","theme","accent","currentInput","disabled","help","hideLabelFromVision","isShiftStepEnabled","label","marks","max","min","onBlur","onChange","onFocus","onMouseLeave","onMouseMove","railColor","renderTooltipContent","v","__next40pxDefaultSize","shiftStep","showTooltip","showTooltipProp","step","trackColor","value","valueProp","withInputField","__shouldNotWarnDeprecated36pxSize","otherProps","setValue","initial","isResetPendent","hasTooltip","hasInputField","setShowTooltip","isFocused","setIsFocused","inputRef","isCurrentlyFocused","current","matches","isThumbFocused","isValueReset","currentValue","inputSliderValue","rangeFillValue","fillValue","fillValueOffset","classes","wrapperClasses","id","describedBy","enableTooltip","isFinite","handleOnRangeChange","event","nextValue","parseFloat","target","handleOnChange","next","handleOnInputNumberBlur","handleOnReset","resetValue","handleShowTooltip","handleHideTooltip","handleOnBlur","handleOnFocus","offsetStyle","componentName","size","__associatedWPComponentName","children","icon","ref","style","width","tooltipPosition","show","inputMode","__unstableInputWidth","accessibleWhenDisabled","variant","onClick","RangeControl"],"sources":["@wordpress/components/src/range-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent, FocusEvent, ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useRef, useState, forwardRef } from '@wordpress/element';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { COLORS } from '../utils';\nimport { floatClamp, useControlledRangeValue } from './utils';\nimport { clamp } from '../utils/math';\nimport InputRange from './input-range';\nimport RangeRail from './rail';\nimport SimpleTooltip from './tooltip';\nimport {\n\tActionRightWrapper,\n\tAfterIconWrapper,\n\tBeforeIconWrapper,\n\tInputNumber,\n\tRoot,\n\tTrack,\n\tThumbWrapper,\n\tThumb,\n\tWrapper,\n} from './styles/range-control-styles';\n\nimport type { RangeControlProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport { space } from '../utils/space';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\n/**\n * Computes the value that `RangeControl` should reset to when pressing\n * the reset button.\n */\nfunction computeResetValue( {\n\tresetFallbackValue,\n\tinitialPosition,\n}: Pick< RangeControlProps, 'resetFallbackValue' | 'initialPosition' > ) {\n\tif ( resetFallbackValue !== undefined ) {\n\t\treturn ! Number.isNaN( resetFallbackValue ) ? resetFallbackValue : null;\n\t}\n\n\tif ( initialPosition !== undefined ) {\n\t\treturn ! Number.isNaN( initialPosition ) ? initialPosition : null;\n\t}\n\n\treturn null;\n}\n\nfunction UnforwardedRangeControl(\n\tprops: WordPressComponentProps< RangeControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tafterIcon,\n\t\tallowReset = false,\n\t\tbeforeIcon,\n\t\tclassName,\n\t\tcolor: colorProp = COLORS.theme.accent,\n\t\tcurrentInput,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision = false,\n\t\tinitialPosition,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmarks = false,\n\t\tmax = 100,\n\t\tmin = 0,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonFocus = noop,\n\t\tonMouseLeave = noop,\n\t\tonMouseMove = noop,\n\t\trailColor,\n\t\trenderTooltipContent = ( v ) => v,\n\t\tresetFallbackValue,\n\t\t__next40pxDefaultSize = false,\n\t\tshiftStep = 10,\n\t\tshowTooltip: showTooltipProp,\n\t\tstep = 1,\n\t\ttrackColor,\n\t\tvalue: valueProp,\n\t\twithInputField = true,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...otherProps\n\t} = props;\n\n\tconst [ value, setValue ] = useControlledRangeValue( {\n\t\tmin,\n\t\tmax,\n\t\tvalue: valueProp ?? null,\n\t\tinitial: initialPosition,\n\t} );\n\tconst isResetPendent = useRef( false );\n\n\tlet hasTooltip = showTooltipProp;\n\tlet hasInputField = withInputField;\n\n\tif ( step === 'any' ) {\n\t\t// The tooltip and number input field are hidden when the step is \"any\"\n\t\t// because the decimals get too lengthy to fit well.\n\t\thasTooltip = false;\n\t\thasInputField = false;\n\t}\n\n\tconst [ showTooltip, setShowTooltip ] = useState( hasTooltip );\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst isCurrentlyFocused = inputRef.current?.matches( ':focus' );\n\tconst isThumbFocused = ! disabled && isFocused;\n\n\tconst isValueReset = value === null;\n\tconst currentValue = value !== undefined ? value : currentInput;\n\n\tconst inputSliderValue = isValueReset ? '' : currentValue;\n\tconst rangeFillValue = isValueReset ? ( max - min ) / 2 + min : value;\n\n\tconst fillValue = isValueReset\n\t\t? 50\n\t\t: ( ( value - min ) / ( max - min ) ) * 100;\n\tconst fillValueOffset = `${ clamp( fillValue, 0, 100 ) }%`;\n\n\tconst classes = clsx( 'components-range-control', className );\n\n\tconst wrapperClasses = clsx(\n\t\t'components-range-control__wrapper',\n\t\t!! marks && 'is-marked'\n\t);\n\n\tconst id = useInstanceId(\n\t\tUnforwardedRangeControl,\n\t\t'inspector-range-control'\n\t);\n\tconst describedBy = !! help ? `${ id }__help` : undefined;\n\tconst enableTooltip = hasTooltip !== false && Number.isFinite( value );\n\n\tconst handleOnRangeChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = parseFloat( event.target.value );\n\t\tsetValue( nextValue );\n\t\tonChange( nextValue );\n\t};\n\n\tconst handleOnChange = ( next?: string ) => {\n\t\t// @ts-expect-error TODO: Investigate if it's problematic for setValue() to\n\t\t// potentially receive a NaN when next is undefined.\n\t\tlet nextValue = parseFloat( next );\n\t\tsetValue( nextValue );\n\n\t\t/*\n\t\t * Calls onChange only when nextValue is numeric\n\t\t * otherwise may queue a reset for the blur event.\n\t\t */\n\t\tif ( ! isNaN( nextValue ) ) {\n\t\t\tif ( nextValue < min || nextValue > max ) {\n\t\t\t\tnextValue = floatClamp( nextValue, min, max ) as number;\n\t\t\t}\n\n\t\t\tonChange( nextValue );\n\t\t\tisResetPendent.current = false;\n\t\t} else if ( allowReset ) {\n\t\t\tisResetPendent.current = true;\n\t\t}\n\t};\n\n\tconst handleOnInputNumberBlur = () => {\n\t\tif ( isResetPendent.current ) {\n\t\t\thandleOnReset();\n\t\t\tisResetPendent.current = false;\n\t\t}\n\t};\n\n\tconst handleOnReset = () => {\n\t\t// Reset to `resetFallbackValue` if defined, otherwise set internal value\n\t\t// to `null` — which, if propagated to the `value` prop, will cause\n\t\t// the value to be reset to the `initialPosition` prop if defined.\n\t\tconst resetValue = Number.isNaN( resetFallbackValue )\n\t\t\t? null\n\t\t\t: resetFallbackValue ?? null;\n\n\t\tsetValue( resetValue );\n\n\t\t/**\n\t\t * Previously, this callback would always receive undefined as\n\t\t * an argument. This behavior is unexpected, specifically\n\t\t * when resetFallbackValue is defined.\n\t\t *\n\t\t * The value of undefined is not ideal. Passing it through\n\t\t * to internal <input /> elements would change it from a\n\t\t * controlled component to an uncontrolled component.\n\t\t *\n\t\t * For now, to minimize unexpected regressions, we're going to\n\t\t * preserve the undefined callback argument, except when a\n\t\t * resetFallbackValue is defined.\n\t\t */\n\t\tonChange( resetValue ?? undefined );\n\t};\n\n\tconst handleShowTooltip = () => setShowTooltip( true );\n\tconst handleHideTooltip = () => setShowTooltip( false );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused( false );\n\t\thandleHideTooltip();\n\t};\n\n\tconst handleOnFocus = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused( true );\n\t\thandleShowTooltip();\n\t};\n\n\tconst offsetStyle = {\n\t\t[ isRTL() ? 'right' : 'left' ]: fillValueOffset,\n\t};\n\n\t// Add default size deprecation warning.\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'RangeControl',\n\t\t__next40pxDefaultSize,\n\t\tsize: undefined,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"RangeControl\"\n\t\t\tclassName={ classes }\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ `${ id }` }\n\t\t\thelp={ help }\n\t\t>\n\t\t\t<Root\n\t\t\t\tclassName=\"components-range-control__root\"\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t>\n\t\t\t\t{ beforeIcon && (\n\t\t\t\t\t<BeforeIconWrapper>\n\t\t\t\t\t\t<Icon icon={ beforeIcon } />\n\t\t\t\t\t</BeforeIconWrapper>\n\t\t\t\t) }\n\t\t\t\t<Wrapper\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t\tclassName={ wrapperClasses }\n\t\t\t\t\tcolor={ colorProp }\n\t\t\t\t\tmarks={ !! marks }\n\t\t\t\t>\n\t\t\t\t\t<InputRange\n\t\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\t\tclassName=\"components-range-control__slider\"\n\t\t\t\t\t\tdescribedBy={ describedBy }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tid={ `${ id }` }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\t\t\tonChange={ handleOnRangeChange }\n\t\t\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\t\t\tonMouseMove={ onMouseMove }\n\t\t\t\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\t\t\t\tref={ useMergeRefs( [ inputRef, forwardedRef ] ) }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ inputSliderValue ?? undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<RangeRail\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tmarks={ marks }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\trailColor={ railColor }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ rangeFillValue }\n\t\t\t\t\t/>\n\t\t\t\t\t<Track\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tclassName=\"components-range-control__track\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tstyle={ { width: fillValueOffset } }\n\t\t\t\t\t\ttrackColor={ trackColor }\n\t\t\t\t\t/>\n\t\t\t\t\t<ThumbWrapper\n\t\t\t\t\t\tclassName=\"components-range-control__thumb-wrapper\"\n\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Thumb\n\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\tisFocused={ isThumbFocused }\n\t\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ThumbWrapper>\n\t\t\t\t\t{ enableTooltip && (\n\t\t\t\t\t\t<SimpleTooltip\n\t\t\t\t\t\t\tclassName=\"components-range-control__tooltip\"\n\t\t\t\t\t\t\tinputRef={ inputRef }\n\t\t\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\t\t\trenderTooltipContent={ renderTooltipContent }\n\t\t\t\t\t\t\tshow={ isCurrentlyFocused || showTooltip }\n\t\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Wrapper>\n\t\t\t\t{ afterIcon && (\n\t\t\t\t\t<AfterIconWrapper>\n\t\t\t\t\t\t<Icon icon={ afterIcon } />\n\t\t\t\t\t</AfterIconWrapper>\n\t\t\t\t) }\n\t\t\t\t{ hasInputField && (\n\t\t\t\t\t<InputNumber\n\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\tclassName=\"components-range-control__number\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tinputMode=\"decimal\"\n\t\t\t\t\t\tisShiftStepEnabled={ isShiftStepEnabled }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnInputNumberBlur }\n\t\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\t\tshiftStep={ shiftStep }\n\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t? '__unstable-large'\n\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableInputWidth={\n\t\t\t\t\t\t\t__next40pxDefaultSize ? space( 20 ) : space( 16 )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if the `null` value is necessary\n\t\t\t\t\t\tvalue={ inputSliderValue }\n\t\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ allowReset && (\n\t\t\t\t\t<ActionRightWrapper>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"components-range-control__reset\"\n\t\t\t\t\t\t\t// If the RangeControl itself is disabled, the reset button shouldn't be in the tab sequence.\n\t\t\t\t\t\t\taccessibleWhenDisabled={ ! disabled }\n\t\t\t\t\t\t\t// The reset button should be disabled if RangeControl itself is disabled,\n\t\t\t\t\t\t\t// or if the current `value` is equal to the value that would be currently\n\t\t\t\t\t\t\t// assigned when clicking the button.\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\tdisabled ||\n\t\t\t\t\t\t\t\tvalue ===\n\t\t\t\t\t\t\t\t\tcomputeResetValue( {\n\t\t\t\t\t\t\t\t\t\tresetFallbackValue,\n\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</ActionRightWrapper>\n\t\t\t\t) }\n\t\t\t</Root>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * RangeControls are used to make selections from a range of incremental values.\n *\n * ```jsx\n * import { RangeControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyRangeControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <RangeControl\n * __nextHasNoMarginBottom\n * __next40pxDefaultSize\n * help=\"Please select how transparent you would like this.\"\n * initialPosition={50}\n * label=\"Opacity\"\n * max={100}\n * min={0}\n * onChange={() => {}}\n * />\n * );\n * };\n * ```\n */\nexport const RangeControl = forwardRef( UnforwardedRangeControl );\n\nexport default RangeControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SAASC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;AACjE,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;;AAEhE;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,UAAU,EAAEC,uBAAuB,QAAQ,SAAS;AAC7D,SAASC,KAAK,QAAQ,eAAe;AACrC,OAAOC,U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AC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMsI,YAAY,GAAGlI,UAAU,CAAEmC,uBAAwB,CAAC;AAEjE,eAAe+F,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","isRTL","useRef","useState","forwardRef","useInstanceId","useMergeRefs","BaseControl","Button","Icon","COLORS","floatClamp","useControlledRangeValue","clamp","InputRange","RangeRail","SimpleTooltip","ActionRightWrapper","AfterIconWrapper","BeforeIconWrapper","InputNumber","Root","Track","ThumbWrapper","Thumb","Wrapper","space","maybeWarnDeprecated36pxSize","jsx","_jsx","jsxs","_jsxs","noop","computeResetValue","resetFallbackValue","initialPosition","undefined","Number","isNaN","UnforwardedRangeControl","props","forwardedRef","__nextHasNoMarginBottom","afterIcon","allowReset","beforeIcon","className","color","colorProp","theme","accent","currentInput","disabled","help","hideLabelFromVision","isShiftStepEnabled","label","marks","max","min","onBlur","onChange","onFocus","onMouseLeave","onMouseMove","railColor","renderTooltipContent","v","__next40pxDefaultSize","shiftStep","showTooltip","showTooltipProp","step","trackColor","value","valueProp","withInputField","__shouldNotWarnDeprecated36pxSize","otherProps","setValue","initial","isResetPendent","hasTooltip","hasInputField","setShowTooltip","isFocused","setIsFocused","inputRef","isCurrentlyFocused","current","matches","isThumbFocused","isValueReset","currentValue","inputSliderValue","rangeFillValue","fillValue","fillValueOffset","classes","wrapperClasses","id","describedBy","enableTooltip","isFinite","handleOnRangeChange","event","nextValue","parseFloat","target","handleOnChange","next","handleOnInputNumberBlur","handleOnReset","resetValue","handleShowTooltip","handleHideTooltip","handleOnBlur","handleOnFocus","offsetStyle","componentName","size","__associatedWPComponentName","children","icon","ref","style","width","tooltipPosition","show","inputMode","__unstableInputWidth","accessibleWhenDisabled","variant","onClick","RangeControl"],"sources":["@wordpress/components/src/range-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent, FocusEvent, ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useRef, useState, forwardRef } from '@wordpress/element';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { COLORS } from '../utils';\nimport { floatClamp, useControlledRangeValue } from './utils';\nimport { clamp } from '../utils/math';\nimport InputRange from './input-range';\nimport RangeRail from './rail';\nimport SimpleTooltip from './tooltip';\nimport {\n\tActionRightWrapper,\n\tAfterIconWrapper,\n\tBeforeIconWrapper,\n\tInputNumber,\n\tRoot,\n\tTrack,\n\tThumbWrapper,\n\tThumb,\n\tWrapper,\n} from './styles/range-control-styles';\n\nimport type { RangeControlProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport { space } from '../utils/space';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\n/**\n * Computes the value that `RangeControl` should reset to when pressing\n * the reset button.\n */\nfunction computeResetValue( {\n\tresetFallbackValue,\n\tinitialPosition,\n}: Pick< RangeControlProps, 'resetFallbackValue' | 'initialPosition' > ) {\n\tif ( resetFallbackValue !== undefined ) {\n\t\treturn ! Number.isNaN( resetFallbackValue ) ? resetFallbackValue : null;\n\t}\n\n\tif ( initialPosition !== undefined ) {\n\t\treturn ! Number.isNaN( initialPosition ) ? initialPosition : null;\n\t}\n\n\treturn null;\n}\n\nfunction UnforwardedRangeControl(\n\tprops: WordPressComponentProps< RangeControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tafterIcon,\n\t\tallowReset = false,\n\t\tbeforeIcon,\n\t\tclassName,\n\t\tcolor: colorProp = COLORS.theme.accent,\n\t\tcurrentInput,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision = false,\n\t\tinitialPosition,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmarks = false,\n\t\tmax = 100,\n\t\tmin = 0,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonFocus = noop,\n\t\tonMouseLeave = noop,\n\t\tonMouseMove = noop,\n\t\trailColor,\n\t\trenderTooltipContent = ( v ) => v,\n\t\tresetFallbackValue,\n\t\t__next40pxDefaultSize = false,\n\t\tshiftStep = 10,\n\t\tshowTooltip: showTooltipProp,\n\t\tstep = 1,\n\t\ttrackColor,\n\t\tvalue: valueProp,\n\t\twithInputField = true,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...otherProps\n\t} = props;\n\n\tconst [ value, setValue ] = useControlledRangeValue( {\n\t\tmin,\n\t\tmax,\n\t\tvalue: valueProp ?? null,\n\t\tinitial: initialPosition,\n\t} );\n\tconst isResetPendent = useRef( false );\n\n\tlet hasTooltip = showTooltipProp;\n\tlet hasInputField = withInputField;\n\n\tif ( step === 'any' ) {\n\t\t// The tooltip and number input field are hidden when the step is \"any\"\n\t\t// because the decimals get too lengthy to fit well.\n\t\thasTooltip = false;\n\t\thasInputField = false;\n\t}\n\n\tconst [ showTooltip, setShowTooltip ] = useState( hasTooltip );\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst isCurrentlyFocused = inputRef.current?.matches( ':focus' );\n\tconst isThumbFocused = ! disabled && isFocused;\n\n\tconst isValueReset = value === null;\n\tconst currentValue = value !== undefined ? value : currentInput;\n\n\tconst inputSliderValue = isValueReset ? '' : currentValue;\n\tconst rangeFillValue = isValueReset ? ( max - min ) / 2 + min : value;\n\n\tconst fillValue = isValueReset\n\t\t? 50\n\t\t: ( ( value - min ) / ( max - min ) ) * 100;\n\tconst fillValueOffset = `${ clamp( fillValue, 0, 100 ) }%`;\n\n\tconst classes = clsx( 'components-range-control', className );\n\n\tconst wrapperClasses = clsx(\n\t\t'components-range-control__wrapper',\n\t\t!! marks && 'is-marked'\n\t);\n\n\tconst id = useInstanceId(\n\t\tUnforwardedRangeControl,\n\t\t'inspector-range-control'\n\t);\n\tconst describedBy = !! help ? `${ id }__help` : undefined;\n\tconst enableTooltip = hasTooltip !== false && Number.isFinite( value );\n\n\tconst handleOnRangeChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = parseFloat( event.target.value );\n\t\tsetValue( nextValue );\n\t\tonChange( nextValue );\n\t};\n\n\tconst handleOnChange = ( next?: string ) => {\n\t\t// @ts-expect-error TODO: Investigate if it's problematic for setValue() to\n\t\t// potentially receive a NaN when next is undefined.\n\t\tlet nextValue = parseFloat( next );\n\t\tsetValue( nextValue );\n\n\t\t/*\n\t\t * Calls onChange only when nextValue is numeric\n\t\t * otherwise may queue a reset for the blur event.\n\t\t */\n\t\tif ( ! isNaN( nextValue ) ) {\n\t\t\tif ( nextValue < min || nextValue > max ) {\n\t\t\t\tnextValue = floatClamp( nextValue, min, max ) as number;\n\t\t\t}\n\n\t\t\tonChange( nextValue );\n\t\t\tisResetPendent.current = false;\n\t\t} else if ( allowReset ) {\n\t\t\tisResetPendent.current = true;\n\t\t}\n\t};\n\n\tconst handleOnInputNumberBlur = () => {\n\t\tif ( isResetPendent.current ) {\n\t\t\thandleOnReset();\n\t\t\tisResetPendent.current = false;\n\t\t}\n\t};\n\n\tconst handleOnReset = () => {\n\t\t// Reset to `resetFallbackValue` if defined, otherwise set internal value\n\t\t// to `null` — which, if propagated to the `value` prop, will cause\n\t\t// the value to be reset to the `initialPosition` prop if defined.\n\t\tconst resetValue = Number.isNaN( resetFallbackValue )\n\t\t\t? null\n\t\t\t: resetFallbackValue ?? null;\n\n\t\tsetValue( resetValue );\n\n\t\t/**\n\t\t * Previously, this callback would always receive undefined as\n\t\t * an argument. This behavior is unexpected, specifically\n\t\t * when resetFallbackValue is defined.\n\t\t *\n\t\t * The value of undefined is not ideal. Passing it through\n\t\t * to internal <input /> elements would change it from a\n\t\t * controlled component to an uncontrolled component.\n\t\t *\n\t\t * For now, to minimize unexpected regressions, we're going to\n\t\t * preserve the undefined callback argument, except when a\n\t\t * resetFallbackValue is defined.\n\t\t */\n\t\tonChange( resetValue ?? undefined );\n\t};\n\n\tconst handleShowTooltip = () => setShowTooltip( true );\n\tconst handleHideTooltip = () => setShowTooltip( false );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused( false );\n\t\thandleHideTooltip();\n\t};\n\n\tconst handleOnFocus = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused( true );\n\t\thandleShowTooltip();\n\t};\n\n\tconst offsetStyle = {\n\t\t[ isRTL() ? 'right' : 'left' ]: fillValueOffset,\n\t};\n\n\t// Add default size deprecation warning.\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'RangeControl',\n\t\t__next40pxDefaultSize,\n\t\tsize: undefined,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"RangeControl\"\n\t\t\tclassName={ classes }\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ `${ id }` }\n\t\t\thelp={ help }\n\t\t>\n\t\t\t<Root\n\t\t\t\tclassName=\"components-range-control__root\"\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t>\n\t\t\t\t{ beforeIcon && (\n\t\t\t\t\t<BeforeIconWrapper>\n\t\t\t\t\t\t<Icon icon={ beforeIcon } />\n\t\t\t\t\t</BeforeIconWrapper>\n\t\t\t\t) }\n\t\t\t\t<Wrapper\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t\tclassName={ wrapperClasses }\n\t\t\t\t\tcolor={ colorProp }\n\t\t\t\t\tmarks={ !! marks }\n\t\t\t\t>\n\t\t\t\t\t<InputRange\n\t\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\t\tclassName=\"components-range-control__slider\"\n\t\t\t\t\t\tdescribedBy={ describedBy }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tid={ `${ id }` }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\t\t\tonChange={ handleOnRangeChange }\n\t\t\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\t\t\tonMouseMove={ onMouseMove }\n\t\t\t\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\t\t\t\tref={ useMergeRefs( [ inputRef, forwardedRef ] ) }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ inputSliderValue ?? undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<RangeRail\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tmarks={ marks }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\trailColor={ railColor }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ rangeFillValue }\n\t\t\t\t\t/>\n\t\t\t\t\t<Track\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tclassName=\"components-range-control__track\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tstyle={ { width: fillValueOffset } }\n\t\t\t\t\t\ttrackColor={ trackColor }\n\t\t\t\t\t/>\n\t\t\t\t\t<ThumbWrapper\n\t\t\t\t\t\tclassName=\"components-range-control__thumb-wrapper\"\n\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Thumb\n\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\tisFocused={ isThumbFocused }\n\t\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ThumbWrapper>\n\t\t\t\t\t{ enableTooltip && (\n\t\t\t\t\t\t<SimpleTooltip\n\t\t\t\t\t\t\tclassName=\"components-range-control__tooltip\"\n\t\t\t\t\t\t\tinputRef={ inputRef }\n\t\t\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\t\t\trenderTooltipContent={ renderTooltipContent }\n\t\t\t\t\t\t\tshow={ isCurrentlyFocused || showTooltip }\n\t\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Wrapper>\n\t\t\t\t{ afterIcon && (\n\t\t\t\t\t<AfterIconWrapper>\n\t\t\t\t\t\t<Icon icon={ afterIcon } />\n\t\t\t\t\t</AfterIconWrapper>\n\t\t\t\t) }\n\t\t\t\t{ hasInputField && (\n\t\t\t\t\t<InputNumber\n\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\tclassName=\"components-range-control__number\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tinputMode=\"decimal\"\n\t\t\t\t\t\tisShiftStepEnabled={ isShiftStepEnabled }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnInputNumberBlur }\n\t\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\t\tshiftStep={ shiftStep }\n\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t? '__unstable-large'\n\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableInputWidth={\n\t\t\t\t\t\t\t__next40pxDefaultSize ? space( 20 ) : space( 16 )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if the `null` value is necessary\n\t\t\t\t\t\tvalue={ inputSliderValue }\n\t\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ allowReset && (\n\t\t\t\t\t<ActionRightWrapper>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"components-range-control__reset\"\n\t\t\t\t\t\t\t// If the RangeControl itself is disabled, the reset button shouldn't be in the tab sequence.\n\t\t\t\t\t\t\taccessibleWhenDisabled={ ! disabled }\n\t\t\t\t\t\t\t// The reset button should be disabled if RangeControl itself is disabled,\n\t\t\t\t\t\t\t// or if the current `value` is equal to the value that would be currently\n\t\t\t\t\t\t\t// assigned when clicking the button.\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\tdisabled ||\n\t\t\t\t\t\t\t\tvalue ===\n\t\t\t\t\t\t\t\t\tcomputeResetValue( {\n\t\t\t\t\t\t\t\t\t\tresetFallbackValue,\n\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</ActionRightWrapper>\n\t\t\t\t) }\n\t\t\t</Root>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * RangeControls are used to make selections from a range of incremental values.\n *\n * ```jsx\n * import { RangeControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyRangeControl = () => {\n * const [ value, setValue ] = useState();\n * return (\n * <RangeControl\n * __nextHasNoMarginBottom\n * __next40pxDefaultSize\n * help=\"Please select how transparent you would like this.\"\n * initialPosition={ 50 }\n * label=\"Opacity\"\n * max={ 100 }\n * min={ 0 }\n * value={ value }\n * onChange={ setValue }\n * />\n * );\n * };\n * ```\n */\nexport const RangeControl = forwardRef( UnforwardedRangeControl );\n\nexport default RangeControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SAASC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;AACjE,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;;AAEhE;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,UAAU,EAAEC,uBAAuB,QAAQ,SAAS;AAC7D,SAASC,KAAK,QAAQ,eAAe;AACrC,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,SAAS,MAAM,QAAQ;AAC9B,OAAOC,aAAa,MAAM,WAAW;AACrC,SACCC,kBAAkB,EAClBC,gBAAgB,EAChBC,iBAAiB,EACjBC,WAAW,EACXC,IAAI,EACJC,KAAK,EACLC,YAAY,EACZC,KAAK,EACLC,OAAO,QACD,+BAA+B;AAItC,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,2BAA2B,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE5E,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAAE;EAC3BC,kBAAkB;EAClBC;AACoE,CAAC,EAAG;EACxE,IAAKD,kBAAkB,KAAKE,SAAS,EAAG;IACvC,OAAO,CAAEC,MAAM,CAACC,KAAK,CAAEJ,kBAAmB,CAAC,GAAGA,kBAAkB,GAAG,IAAI;EACxE;EAEA,IAAKC,eAAe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AAK,CAAE,EAAG,CAAC,GAAGA,KAAK,CAAE,EAAG,CAChD;QACD8C,IAAI,EAAGA;QACP;QAAA;QACAE,KAAK,EAAGoB,gBAAkB;QAC1BjB,iCAAiC;MAAA,CACjC,CACD,EACCjC,UAAU,iBACXf,IAAA,CAACZ,kBAAkB;QAAAyG,QAAA,eAClB7F,IAAA,CAACrB,MAAM;UACNsC,SAAS,EAAC;UACV;UAAA;UACAqF,sBAAsB,EAAG,CAAE/E;UAC3B;UACA;UACA;UAAA;UACAA,QAAQ,EACPA,QAAQ,IACRsB,KAAK,KACJzC,iBAAiB,CAAE;YAClBC,kBAAkB;YAClBC;UACD,CAAE,CACH;UACDiG,OAAO,EAAC,WAAW;UACnBZ,IAAI,EAAC,OAAO;UACZa,OAAO,EAAGrB,aAAe;UAAAU,QAAA,EAEvB1H,EAAE,CAAE,OAAQ;QAAC,CACR;MAAC,CACU,CACpB;IAAA,CACI;EAAC,CACK,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMsI,YAAY,GAAGlI,UAAU,CAAEmC,uBAAwB,CAAC;AAEjE,eAAe+F,YAAY","ignoreList":[]}
@@ -14,7 +14,7 @@ import ToolbarItem from '../toolbar-item';
14
14
  import ToolbarContext from '../toolbar-context';
15
15
  import DropdownMenu from '../../dropdown-menu';
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
- function ToolbarDropdownMenu(props, ref) {
17
+ function UnforwardedToolbarDropdownMenu(props, ref) {
18
18
  const accessibleToolbarState = useContext(ToolbarContext);
19
19
  if (!accessibleToolbarState) {
20
20
  return /*#__PURE__*/_jsx(DropdownMenu, {
@@ -37,5 +37,6 @@ function ToolbarDropdownMenu(props, ref) {
37
37
  })
38
38
  });
39
39
  }
40
- export default forwardRef(ToolbarDropdownMenu);
40
+ export const ToolbarDropdownMenu = forwardRef(UnforwardedToolbarDropdownMenu);
41
+ export default ToolbarDropdownMenu;
41
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","useContext","ToolbarItem","ToolbarContext","DropdownMenu","jsx","_jsx","ToolbarDropdownMenu","props","ref","accessibleToolbarState","toggleProps","children","toolbarItemProps","popoverProps"],"sources":["@wordpress/components/src/toolbar/toolbar-dropdown-menu/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ToolbarItem from '../toolbar-item';\nimport ToolbarContext from '../toolbar-context';\nimport DropdownMenu from '../../dropdown-menu';\nimport type { DropdownMenuProps } from '../../dropdown-menu/types';\n\nfunction ToolbarDropdownMenu(\n\tprops: DropdownMenuProps,\n\tref: ForwardedRef< any >\n) {\n\tconst accessibleToolbarState = useContext( ToolbarContext );\n\n\tif ( ! accessibleToolbarState ) {\n\t\treturn <DropdownMenu { ...props } />;\n\t}\n\n\t// ToolbarItem will pass all props to the render prop child, which will pass\n\t// all props to the toggle of DropdownMenu. This means that ToolbarDropdownMenu\n\t// has the same API as DropdownMenu.\n\treturn (\n\t\t<ToolbarItem ref={ ref } { ...props.toggleProps }>\n\t\t\t{ ( toolbarItemProps ) => (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t...props.popoverProps,\n\t\t\t\t\t} }\n\t\t\t\t\ttoggleProps={ toolbarItemProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</ToolbarItem>\n\t);\n}\n\nexport default forwardRef( ToolbarDropdownMenu );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,YAAY,MAAM,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG/C,SAASC,mBAAmBA,CAC3BC,KAAwB,EACxBC,GAAwB,EACvB;EACD,MAAMC,sBAAsB,GAAGT,UAAU,CAAEE,cAAe,CAAC;EAE3D,IAAK,CAAEO,sBAAsB,EAAG;IAC/B,oBAAOJ,IAAA,CAACF,YAAY;MAAA,GAAMI;IAAK,CAAI,CAAC;EACrC;;EAEA;EACA;EACA;EACA,oBACCF,IAAA,CAACJ,WAAW;IAACO,GAAG,EAAGA,GAAK;IAAA,GAAMD,KAAK,CAACG,WAAW;IAAAC,QAAA,EAC1CC,gBAAgB,iBACnBP,IAAA,CAACF,YAAY;MAAA,GACPI,KAAK;MACVM,YAAY,EAAG;QACd,GAAGN,KAAK,CAACM;MACV,CAAG;MACHH,WAAW,EAAGE;IAAkB,CAChC;EACD,CACW,CAAC;AAEhB;AAEA,eAAeb,UAAU,CAAEO,mBAAoB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","useContext","ToolbarItem","ToolbarContext","DropdownMenu","jsx","_jsx","UnforwardedToolbarDropdownMenu","props","ref","accessibleToolbarState","toggleProps","children","toolbarItemProps","popoverProps","ToolbarDropdownMenu"],"sources":["@wordpress/components/src/toolbar/toolbar-dropdown-menu/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ToolbarItem from '../toolbar-item';\nimport ToolbarContext from '../toolbar-context';\nimport DropdownMenu from '../../dropdown-menu';\nimport type { DropdownMenuProps } from '../../dropdown-menu/types';\n\nfunction UnforwardedToolbarDropdownMenu(\n\tprops: DropdownMenuProps,\n\tref: ForwardedRef< any >\n) {\n\tconst accessibleToolbarState = useContext( ToolbarContext );\n\n\tif ( ! accessibleToolbarState ) {\n\t\treturn <DropdownMenu { ...props } />;\n\t}\n\n\t// ToolbarItem will pass all props to the render prop child, which will pass\n\t// all props to the toggle of DropdownMenu. This means that ToolbarDropdownMenu\n\t// has the same API as DropdownMenu.\n\treturn (\n\t\t<ToolbarItem ref={ ref } { ...props.toggleProps }>\n\t\t\t{ ( toolbarItemProps ) => (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t...props.popoverProps,\n\t\t\t\t\t} }\n\t\t\t\t\ttoggleProps={ toolbarItemProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</ToolbarItem>\n\t);\n}\n\nexport const ToolbarDropdownMenu = forwardRef( UnforwardedToolbarDropdownMenu );\nexport default ToolbarDropdownMenu;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,YAAY,MAAM,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG/C,SAASC,8BAA8BA,CACtCC,KAAwB,EACxBC,GAAwB,EACvB;EACD,MAAMC,sBAAsB,GAAGT,UAAU,CAAEE,cAAe,CAAC;EAE3D,IAAK,CAAEO,sBAAsB,EAAG;IAC/B,oBAAOJ,IAAA,CAACF,YAAY;MAAA,GAAMI;IAAK,CAAI,CAAC;EACrC;;EAEA;EACA;EACA;EACA,oBACCF,IAAA,CAACJ,WAAW;IAACO,GAAG,EAAGA,GAAK;IAAA,GAAMD,KAAK,CAACG,WAAW;IAAAC,QAAA,EAC1CC,gBAAgB,iBACnBP,IAAA,CAACF,YAAY;MAAA,GACPI,KAAK;MACVM,YAAY,EAAG;QACd,GAAGN,KAAK,CAACM;MACV,CAAG;MACHH,WAAW,EAAGE;IAAkB,CAChC;EACD,CACW,CAAC;AAEhB;AAEA,OAAO,MAAME,mBAAmB,GAAGf,UAAU,CAAEO,8BAA+B,CAAC;AAC/E,eAAeQ,mBAAmB","ignoreList":[]}
@@ -13,7 +13,7 @@ import warning from '@wordpress/warning';
13
13
  */
14
14
  import ToolbarContext from '../toolbar-context';
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
- function ToolbarItem({
16
+ function UnforwardedToolbarItem({
17
17
  children,
18
18
  as: Component,
19
19
  ...props
@@ -51,5 +51,6 @@ function ToolbarItem({
51
51
  render: render
52
52
  });
53
53
  }
54
- export default forwardRef(ToolbarItem);
54
+ export const ToolbarItem = forwardRef(UnforwardedToolbarItem);
55
+ export default ToolbarItem;
55
56
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","forwardRef","useContext","warning","ToolbarContext","jsx","_jsx","ToolbarItem","children","as","Component","props","ref","accessibleToolbarStore","isRenderProp","globalThis","SCRIPT_DEBUG","allProps","render","accessibleWhenDisabled","store"],"sources":["@wordpress/components/src/toolbar/toolbar-item/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport ToolbarContext from '../toolbar-context';\nimport type { ToolbarItemProps } from './types';\n\nfunction ToolbarItem(\n\t{ children, as: Component, ...props }: ToolbarItemProps,\n\tref: ForwardedRef< any >\n) {\n\tconst accessibleToolbarStore = useContext( ToolbarContext );\n\tconst isRenderProp = typeof children === 'function';\n\n\tif ( ! isRenderProp && ! Component ) {\n\t\twarning(\n\t\t\t'`ToolbarItem` is a generic headless component. You must pass either a `children` prop as a function or an `as` prop as a component. ' +\n\t\t\t\t'See https://developer.wordpress.org/block-editor/components/toolbar-item/'\n\t\t);\n\t\treturn null;\n\t}\n\n\tconst allProps = { ...props, ref, 'data-toolbar-item': true };\n\n\tif ( ! accessibleToolbarStore ) {\n\t\tif ( Component ) {\n\t\t\treturn <Component { ...allProps }>{ children }</Component>;\n\t\t}\n\t\tif ( ! isRenderProp ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn children( allProps );\n\t}\n\n\tconst render = isRenderProp\n\t\t? children\n\t\t: Component && <Component>{ children }</Component>;\n\n\treturn (\n\t\t<Ariakit.ToolbarItem\n\t\t\taccessibleWhenDisabled\n\t\t\t{ ...allProps }\n\t\t\tstore={ accessibleToolbarStore }\n\t\t\trender={ render }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( ToolbarItem );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AAGzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGhD,SAASC,WAAWA,CACnB;EAAEC,QAAQ;EAAEC,EAAE,EAAEC,SAAS;EAAE,GAAGC;AAAwB,CAAC,EACvDC,GAAwB,EACvB;EACD,MAAMC,sBAAsB,GAAGX,UAAU,CAAEE,cAAe,CAAC;EAC3D,MAAMU,YAAY,GAAG,OAAON,QAAQ,KAAK,UAAU;EAEnD,IAAK,CAAEM,YAAY,IAAI,CAAEJ,SAAS,EAAG;IACpCK,UAAA,CAAAC,YAAA,YAAAb,OAAO,CACN,sIAAsI,GACrI,2EACF,CAAC;IACD,OAAO,IAAI;EACZ;EAEA,MAAMc,QAAQ,GAAG;IAAE,GAAGN,KAAK;IAAEC,GAAG;IAAE,mBAAmB,EAAE;EAAK,CAAC;EAE7D,IAAK,CAAEC,sBAAsB,EAAG;IAC/B,IAAKH,SAAS,EAAG;MAChB,oBAAOJ,IAAA,CAACI,SAAS;QAAA,GAAMO,QAAQ;QAAAT,QAAA,EAAKA;MAAQ,CAAa,CAAC;IAC3D;IACA,IAAK,CAAEM,YAAY,EAAG;MACrB,OAAO,IAAI;IACZ;IACA,OAAON,QAAQ,CAAES,QAAS,CAAC;EAC5B;EAEA,MAAMC,MAAM,GAAGJ,YAAY,GACxBN,QAAQ,GACRE,SAAS,iBAAIJ,IAAA,CAACI,SAAS;IAAAF,QAAA,EAAGA;EAAQ,CAAa,CAAC;EAEnD,oBACCF,IAAA,CAACN,OAAO,CAACO,WAAW;IACnBY,sBAAsB;IAAA,GACjBF,QAAQ;IACbG,KAAK,EAAGP,sBAAwB;IAChCK,MAAM,EAAGA;EAAQ,CACjB,CAAC;AAEJ;AAEA,eAAejB,UAAU,CAAEM,WAAY,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","forwardRef","useContext","warning","ToolbarContext","jsx","_jsx","UnforwardedToolbarItem","children","as","Component","props","ref","accessibleToolbarStore","isRenderProp","globalThis","SCRIPT_DEBUG","allProps","render","ToolbarItem","accessibleWhenDisabled","store"],"sources":["@wordpress/components/src/toolbar/toolbar-item/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport ToolbarContext from '../toolbar-context';\nimport type { ToolbarItemProps } from './types';\n\nfunction UnforwardedToolbarItem(\n\t{ children, as: Component, ...props }: ToolbarItemProps,\n\tref: ForwardedRef< any >\n) {\n\tconst accessibleToolbarStore = useContext( ToolbarContext );\n\tconst isRenderProp = typeof children === 'function';\n\n\tif ( ! isRenderProp && ! Component ) {\n\t\twarning(\n\t\t\t'`ToolbarItem` is a generic headless component. You must pass either a `children` prop as a function or an `as` prop as a component. ' +\n\t\t\t\t'See https://developer.wordpress.org/block-editor/components/toolbar-item/'\n\t\t);\n\t\treturn null;\n\t}\n\n\tconst allProps = { ...props, ref, 'data-toolbar-item': true };\n\n\tif ( ! accessibleToolbarStore ) {\n\t\tif ( Component ) {\n\t\t\treturn <Component { ...allProps }>{ children }</Component>;\n\t\t}\n\t\tif ( ! isRenderProp ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn children( allProps );\n\t}\n\n\tconst render = isRenderProp\n\t\t? children\n\t\t: Component && <Component>{ children }</Component>;\n\n\treturn (\n\t\t<Ariakit.ToolbarItem\n\t\t\taccessibleWhenDisabled\n\t\t\t{ ...allProps }\n\t\t\tstore={ accessibleToolbarStore }\n\t\t\trender={ render }\n\t\t/>\n\t);\n}\n\nexport const ToolbarItem = forwardRef( UnforwardedToolbarItem );\nexport default ToolbarItem;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AAGzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGhD,SAASC,sBAAsBA,CAC9B;EAAEC,QAAQ;EAAEC,EAAE,EAAEC,SAAS;EAAE,GAAGC;AAAwB,CAAC,EACvDC,GAAwB,EACvB;EACD,MAAMC,sBAAsB,GAAGX,UAAU,CAAEE,cAAe,CAAC;EAC3D,MAAMU,YAAY,GAAG,OAAON,QAAQ,KAAK,UAAU;EAEnD,IAAK,CAAEM,YAAY,IAAI,CAAEJ,SAAS,EAAG;IACpCK,UAAA,CAAAC,YAAA,YAAAb,OAAO,CACN,sIAAsI,GACrI,2EACF,CAAC;IACD,OAAO,IAAI;EACZ;EAEA,MAAMc,QAAQ,GAAG;IAAE,GAAGN,KAAK;IAAEC,GAAG;IAAE,mBAAmB,EAAE;EAAK,CAAC;EAE7D,IAAK,CAAEC,sBAAsB,EAAG;IAC/B,IAAKH,SAAS,EAAG;MAChB,oBAAOJ,IAAA,CAACI,SAAS;QAAA,GAAMO,QAAQ;QAAAT,QAAA,EAAKA;MAAQ,CAAa,CAAC;IAC3D;IACA,IAAK,CAAEM,YAAY,EAAG;MACrB,OAAO,IAAI;IACZ;IACA,OAAON,QAAQ,CAAES,QAAS,CAAC;EAC5B;EAEA,MAAMC,MAAM,GAAGJ,YAAY,GACxBN,QAAQ,GACRE,SAAS,iBAAIJ,IAAA,CAACI,SAAS;IAAAF,QAAA,EAAGA;EAAQ,CAAa,CAAC;EAEnD,oBACCF,IAAA,CAACN,OAAO,CAACmB,WAAW;IACnBC,sBAAsB;IAAA,GACjBH,QAAQ;IACbI,KAAK,EAAGR,sBAAwB;IAChCK,MAAM,EAAGA;EAAQ,CACjB,CAAC;AAEJ;AAEA,OAAO,MAAMC,WAAW,GAAGlB,UAAU,CAAEM,sBAAuB,CAAC;AAC/D,eAAeY,WAAW","ignoreList":[]}
@@ -0,0 +1,24 @@
1
+ const getNodeText = node => {
2
+ if (node === null) {
3
+ return '';
4
+ }
5
+ switch (typeof node) {
6
+ case 'string':
7
+ case 'number':
8
+ return node.toString();
9
+ case 'object':
10
+ {
11
+ if (node instanceof Array) {
12
+ return node.map(getNodeText).join('');
13
+ }
14
+ if ('props' in node) {
15
+ return getNodeText(node.props.children);
16
+ }
17
+ return '';
18
+ }
19
+ default:
20
+ return '';
21
+ }
22
+ };
23
+ export default getNodeText;
24
+ //# sourceMappingURL=get-node-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getNodeText","node","toString","Array","map","join","props","children"],"sources":["@wordpress/components/src/utils/get-node-text.ts"],"sourcesContent":["const getNodeText = ( node: React.ReactNode ): string => {\n\tif ( node === null ) {\n\t\treturn '';\n\t}\n\n\tswitch ( typeof node ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn node.toString();\n\t\tcase 'object': {\n\t\t\tif ( node instanceof Array ) {\n\t\t\t\treturn node.map( getNodeText ).join( '' );\n\t\t\t}\n\t\t\tif ( 'props' in node ) {\n\t\t\t\treturn getNodeText( node.props.children );\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\t\tdefault:\n\t\t\treturn '';\n\t}\n};\n\nexport default getNodeText;\n"],"mappings":"AAAA,MAAMA,WAAW,GAAKC,IAAqB,IAAc;EACxD,IAAKA,IAAI,KAAK,IAAI,EAAG;IACpB,OAAO,EAAE;EACV;EAEA,QAAS,OAAOA,IAAI;IACnB,KAAK,QAAQ;IACb,KAAK,QAAQ;MACZ,OAAOA,IAAI,CAACC,QAAQ,CAAC,CAAC;IACvB,KAAK,QAAQ;MAAE;QACd,IAAKD,IAAI,YAAYE,KAAK,EAAG;UAC5B,OAAOF,IAAI,CAACG,GAAG,CAAEJ,WAAY,CAAC,CAACK,IAAI,CAAE,EAAG,CAAC;QAC1C;QACA,IAAK,OAAO,IAAIJ,IAAI,EAAG;UACtB,OAAOD,WAAW,CAAEC,IAAI,CAACK,KAAK,CAACC,QAAS,CAAC;QAC1C;QACA,OAAO,EAAE;MACV;IACA;MACC,OAAO,EAAE;EACX;AACD,CAAC;AAED,eAAeP,WAAW","ignoreList":[]}
@@ -52,9 +52,9 @@ function getPrecision(value) {
52
52
  /**
53
53
  * Clamps a value based on a min/max range.
54
54
  *
55
- * @param {number} value The value.
56
- * @param {number} min The minimum range.
57
- * @param {number} max The maximum range.
55
+ * @param {number|string} value The value.
56
+ * @param {number} min The minimum range.
57
+ * @param {number} max The maximum range.
58
58
  *
59
59
  * @return {number} The clamped value.
60
60
  */
@@ -64,21 +64,24 @@ export function clamp(value, min, max) {
64
64
  }
65
65
 
66
66
  /**
67
- * Clamps a value based on a min/max range with rounding
67
+ * Rounds a value to the nearest step offset by a minimum.
68
68
  *
69
- * @param {number | string} value The value.
70
- * @param {number} min The minimum range.
71
- * @param {number} max The maximum range.
72
- * @param {number} step A multiplier for the value.
69
+ * @param {number|string} value The value.
70
+ * @param {number} min The minimum range.
71
+ * @param {number} step The increment for the value.
73
72
  *
74
- * @return {number} The rounded and clamped value.
73
+ * @return {number} The value as a valid step.
75
74
  */
76
- export function roundClamp(value = 0, min = Infinity, max = Infinity, step = 1) {
75
+ export function ensureValidStep(value, min, step) {
77
76
  const baseValue = getNumber(value);
78
77
  const stepValue = getNumber(step);
79
- const precision = getPrecision(step);
80
- const rounded = Math.round(baseValue / stepValue) * stepValue;
81
- const clampedValue = clamp(rounded, min, max);
82
- return precision ? getNumber(clampedValue.toFixed(precision)) : clampedValue;
78
+ const precision = Math.max(getPrecision(step), getPrecision(min));
79
+ const realMin = Math.abs(min) === Infinity ? 0 : min;
80
+ // If the step is not a factor of the minimum then the step must be
81
+ // offset by the minimum.
82
+ const tare = realMin % stepValue ? realMin : 0;
83
+ const rounded = Math.round((baseValue - tare) / stepValue) * stepValue;
84
+ const fromMin = rounded + tare;
85
+ return precision ? getNumber(fromMin.toFixed(precision)) : fromMin;
83
86
  }
84
87
  //# sourceMappingURL=math.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getNumber","value","number","Number","isNaN","add","args","reduce","sum","arg","subtract","diff","index","getPrecision","split","undefined","length","clamp","min","max","baseValue","Math","roundClamp","Infinity","step","stepValue","precision","rounded","round","clampedValue","toFixed"],"sources":["@wordpress/components/src/utils/math.js"],"sourcesContent":["/**\n * Parses and retrieves a number value.\n *\n * @param {unknown} value The incoming value.\n *\n * @return {number} The parsed number value.\n */\nexport function getNumber( value ) {\n\tconst number = Number( value );\n\n\treturn isNaN( number ) ? 0 : number;\n}\n\n/**\n * Safely adds 2 values.\n *\n * @param {Array<number|string>} args Values to add together.\n *\n * @return {number} The sum of values.\n */\nexport function add( ...args ) {\n\treturn args.reduce(\n\t\t/** @type {(sum:number, arg: number|string) => number} */\n\t\t( sum, arg ) => sum + getNumber( arg ),\n\t\t0\n\t);\n}\n\n/**\n * Safely subtracts 2 values.\n *\n * @param {Array<number|string>} args Values to subtract together.\n *\n * @return {number} The difference of the values.\n */\nexport function subtract( ...args ) {\n\treturn args.reduce(\n\t\t/** @type {(diff:number, arg: number|string, index:number) => number} */\n\t\t( diff, arg, index ) => {\n\t\t\tconst value = getNumber( arg );\n\t\t\treturn index === 0 ? value : diff - value;\n\t\t},\n\t\t0\n\t);\n}\n\n/**\n * Determines the decimal position of a number value.\n *\n * @param {number} value The number to evaluate.\n *\n * @return {number} The number of decimal places.\n */\nfunction getPrecision( value ) {\n\tconst split = ( value + '' ).split( '.' );\n\treturn split[ 1 ] !== undefined ? split[ 1 ].length : 0;\n}\n\n/**\n * Clamps a value based on a min/max range.\n *\n * @param {number} value The value.\n * @param {number} min The minimum range.\n * @param {number} max The maximum range.\n *\n * @return {number} The clamped value.\n */\nexport function clamp( value, min, max ) {\n\tconst baseValue = getNumber( value );\n\treturn Math.max( min, Math.min( baseValue, max ) );\n}\n\n/**\n * Clamps a value based on a min/max range with rounding\n *\n * @param {number | string} value The value.\n * @param {number} min The minimum range.\n * @param {number} max The maximum range.\n * @param {number} step A multiplier for the value.\n *\n * @return {number} The rounded and clamped value.\n */\nexport function roundClamp(\n\tvalue = 0,\n\tmin = Infinity,\n\tmax = Infinity,\n\tstep = 1\n) {\n\tconst baseValue = getNumber( value );\n\tconst stepValue = getNumber( step );\n\tconst precision = getPrecision( step );\n\tconst rounded = Math.round( baseValue / stepValue ) * stepValue;\n\tconst clampedValue = clamp( rounded, min, max );\n\n\treturn precision\n\t\t? getNumber( clampedValue.toFixed( precision ) )\n\t\t: clampedValue;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,SAASA,CAAEC,KAAK,EAAG;EAClC,MAAMC,MAAM,GAAGC,MAAM,CAAEF,KAAM,CAAC;EAE9B,OAAOG,KAAK,CAAEF,MAAO,CAAC,GAAG,CAAC,GAAGA,MAAM;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,GAAGA,CAAE,GAAGC,IAAI,EAAG;EAC9B,OAAOA,IAAI,CAACC,MAAM,CACjB;EACA,CAAEC,GAAG,EAAEC,GAAG,KAAMD,GAAG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EACnC,MAAME,SAAS,GAAGb,YAAY,CAAEW,IAAK,CAAC;EACtC,MAAMG,OAAO,GAAGN,IAAI,CAACO,KAAK,CAAER,SAAS,GAAGK,SAAU,CAAC,GAAGA,SAAS;EAC/D,MAAMI,YAAY,GAAGZ,KAAK,CAAEU,OAAO,EAAET,GAAG,EAAEC,GAAI,CAAC;EAE/C,OAAOO,SAAS,GACb1B,SAAS,CAAE6B,YAAY,CAACC,OAAO,CAAEJ,SAAU,CAAE,CAAC,GAC9CG,YAAY;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["getNumber","value","number","Number","isNaN","add","args","reduce","sum","arg","subtract","diff","index","getPrecision","split","undefined","length","clamp","min","max","baseValue","Math","ensureValidStep","step","stepValue","precision","realMin","abs","Infinity","tare","rounded","round","fromMin","toFixed"],"sources":["@wordpress/components/src/utils/math.js"],"sourcesContent":["/**\n * Parses and retrieves a number value.\n *\n * @param {unknown} value The incoming value.\n *\n * @return {number} The parsed number value.\n */\nexport function getNumber( value ) {\n\tconst number = Number( value );\n\n\treturn isNaN( number ) ? 0 : number;\n}\n\n/**\n * Safely adds 2 values.\n *\n * @param {Array<number|string>} args Values to add together.\n *\n * @return {number} The sum of values.\n */\nexport function add( ...args ) {\n\treturn args.reduce(\n\t\t/** @type {(sum:number, arg: number|string) => number} */\n\t\t( sum, arg ) => sum + getNumber( arg ),\n\t\t0\n\t);\n}\n\n/**\n * Safely subtracts 2 values.\n *\n * @param {Array<number|string>} args Values to subtract together.\n *\n * @return {number} The difference of the values.\n */\nexport function subtract( ...args ) {\n\treturn args.reduce(\n\t\t/** @type {(diff:number, arg: number|string, index:number) => number} */\n\t\t( diff, arg, index ) => {\n\t\t\tconst value = getNumber( arg );\n\t\t\treturn index === 0 ? value : diff - value;\n\t\t},\n\t\t0\n\t);\n}\n\n/**\n * Determines the decimal position of a number value.\n *\n * @param {number} value The number to evaluate.\n *\n * @return {number} The number of decimal places.\n */\nfunction getPrecision( value ) {\n\tconst split = ( value + '' ).split( '.' );\n\treturn split[ 1 ] !== undefined ? split[ 1 ].length : 0;\n}\n\n/**\n * Clamps a value based on a min/max range.\n *\n * @param {number|string} value The value.\n * @param {number} min The minimum range.\n * @param {number} max The maximum range.\n *\n * @return {number} The clamped value.\n */\nexport function clamp( value, min, max ) {\n\tconst baseValue = getNumber( value );\n\treturn Math.max( min, Math.min( baseValue, max ) );\n}\n\n/**\n * Rounds a value to the nearest step offset by a minimum.\n *\n * @param {number|string} value The value.\n * @param {number} min The minimum range.\n * @param {number} step The increment for the value.\n *\n * @return {number} The value as a valid step.\n */\nexport function ensureValidStep( value, min, step ) {\n\tconst baseValue = getNumber( value );\n\tconst stepValue = getNumber( step );\n\tconst precision = Math.max( getPrecision( step ), getPrecision( min ) );\n\tconst realMin = Math.abs( min ) === Infinity ? 0 : min;\n\t// If the step is not a factor of the minimum then the step must be\n\t// offset by the minimum.\n\tconst tare = realMin % stepValue ? realMin : 0;\n\tconst rounded = Math.round( ( baseValue - tare ) / stepValue ) * stepValue;\n\tconst fromMin = rounded + tare;\n\treturn precision ? getNumber( fromMin.toFixed( precision ) ) : fromMin;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,SAASA,CAAEC,KAAK,EAAG;EAClC,MAAMC,MAAM,GAAGC,MAAM,CAAEF,KAAM,CAAC;EAE9B,OAAOG,KAAK,CAAEF,MAAO,CAAC,GAAG,CAAC,GAAGA,MAAM;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,GAAGA,CAAE,GAAGC,IAAI,EAAG;EAC9B,OAAOA,IAAI,CAACC,MAAM,CACjB;EACA,CAAEC,GAAG,EAAEC,GAAG,KAAMD,GAAG,GAAGR,SAAS,CAAES,GAAI,CAAC,EACtC,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAE,GAAGJ,IAAI,EAAG;EACnC,OAAOA,IAAI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A;EACA,MAAMW,IAAI,GAAGH,OAAO,GAAGF,SAAS,GAAGE,OAAO,GAAG,CAAC;EAC9C,MAAMI,OAAO,GAAGT,IAAI,CAACU,KAAK,CAAE,CAAEX,SAAS,GAAGS,IAAI,IAAKL,SAAU,CAAC,GAAGA,SAAS;EAC1E,MAAMQ,OAAO,GAAGF,OAAO,GAAGD,IAAI;EAC9B,OAAOJ,SAAS,GAAGzB,SAAS,CAAEgC,OAAO,CAACC,OAAO,CAAER,SAAU,CAAE,CAAC,GAAGO,OAAO;AACvE","ignoreList":[]}
@@ -485,7 +485,6 @@ p + .components-button.is-tertiary {
485
485
  }
486
486
  .components-button.is-compact.has-icon:not(.has-text) {
487
487
  padding: 0;
488
- width: 32px;
489
488
  min-width: 32px;
490
489
  }
491
490
  .components-button.is-small {
@@ -496,7 +495,6 @@ p + .components-button.is-tertiary {
496
495
  }
497
496
  .components-button.is-small.has-icon:not(.has-text) {
498
497
  padding: 0;
499
- width: 24px;
500
498
  min-width: 24px;
501
499
  }
502
500
  .components-button.has-icon {
@@ -1616,7 +1614,7 @@ body.is-dragging-components-draggable {
1616
1614
  color: #949494;
1617
1615
  }
1618
1616
  .components-form-token-field__suggestion[aria-disabled=true].is-selected {
1619
- background-color: rgba(var(--wp-components-color-accent--rgb, var(--wp-admin-theme-color--rgb)), 0.04);
1617
+ background: color-mix(in srgb, var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9)) 4%, transparent);
1620
1618
  }
1621
1619
  .components-form-token-field__suggestion:not(.is-empty) {
1622
1620
  cursor: pointer;
@@ -485,7 +485,6 @@ p + .components-button.is-tertiary {
485
485
  }
486
486
  .components-button.is-compact.has-icon:not(.has-text) {
487
487
  padding: 0;
488
- width: 32px;
489
488
  min-width: 32px;
490
489
  }
491
490
  .components-button.is-small {
@@ -496,7 +495,6 @@ p + .components-button.is-tertiary {
496
495
  }
497
496
  .components-button.is-small.has-icon:not(.has-text) {
498
497
  padding: 0;
499
- width: 24px;
500
498
  min-width: 24px;
501
499
  }
502
500
  .components-button.has-icon {
@@ -1621,7 +1619,7 @@ body.is-dragging-components-draggable {
1621
1619
  color: #949494;
1622
1620
  }
1623
1621
  .components-form-token-field__suggestion[aria-disabled=true].is-selected {
1624
- background-color: rgba(var(--wp-components-color-accent--rgb, var(--wp-admin-theme-color--rgb)), 0.04);
1622
+ background: color-mix(in srgb, var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9)) 4%, transparent);
1625
1623
  }
1626
1624
  .components-form-token-field__suggestion:not(.is-empty) {
1627
1625
  cursor: pointer;
@@ -15,7 +15,7 @@ import type { AnglePickerControlProps } from './types';
15
15
  * <AnglePickerControl
16
16
  * value={ angle }
17
17
  * onChange={ setAngle }
18
- * </>
18
+ * />
19
19
  * );
20
20
  * }
21
21
  * ```
@@ -3,7 +3,7 @@ export declare function useAutocomplete({ record, onChange, onReplace, completer
3
3
  listBoxId: string | undefined;
4
4
  activeId: string | null;
5
5
  onKeyDown: (event: KeyboardEvent) => void;
6
- popover: false | import("react").JSX.Element | null;
6
+ popover: false | import("react").JSX.Element;
7
7
  };
8
8
  export declare function useAutocompleteProps(options: UseAutocompleteProps): {
9
9
  ref: (instance: HTMLElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES];
@@ -13,7 +13,7 @@ export declare function useAutocompleteProps(options: UseAutocompleteProps): {
13
13
  'aria-activedescendant'?: undefined;
14
14
  } | {
15
15
  ref: (instance: HTMLElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES];
16
- children: false | import("react").JSX.Element | null;
16
+ children: false | import("react").JSX.Element;
17
17
  'aria-autocomplete': string | undefined;
18
18
  'aria-owns': string | undefined;
19
19
  'aria-activedescendant': string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/autocomplete/index.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EACX,iBAAiB,EAMjB,oBAAoB,EAEpB,MAAM,SAAS,CAAC;AAoCjB,wBAAgB,eAAe,CAAE,EAChC,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GACV,EAAE,oBAAoB;;;;;EA6UtB;AAeD,wBAAgB,oBAAoB,CAAE,OAAO,EAAE,oBAAoB;;;;;;;;;;;;EAsClE;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,EACrC,QAAQ,EACR,UAAU,EACV,GAAG,OAAO,EACV,EAAE,iBAAiB,+BAQnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/autocomplete/index.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EACX,iBAAiB,EAMjB,oBAAoB,EAEpB,MAAM,SAAS,CAAC;AAQjB,wBAAgB,eAAe,CAAE,EAChC,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GACV,EAAE,oBAAoB;;;;;EA8UtB;AAeD,wBAAgB,oBAAoB,CAAE,OAAO,EAAE,oBAAoB;;;;;;;;;;;;EAsClE;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,EACrC,QAAQ,EACR,UAAU,EACV,GAAG,OAAO,EACV,EAAE,iBAAiB,+BAQnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/custom-select-control-v2/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAU1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AA+DtD,eAAO,MAAM,MAAM;;;;;;;UAQX,WAAW,CAAE,sBAAsB,CAAE,MAAM,CAAE,CAAE;yBAChC,OA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,"file":"font-size-picker-select.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/font-size-picker-select.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACX,yBAAyB,EAEzB,MAAM,SAAS,CAAC;AASjB,QAAA,MAAM,oBAAoB,UAAY,yBAAyB,gCAwD9D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"font-size-picker-select.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/font-size-picker-select.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EACX,yBAAyB,EAEzB,MAAM,SAAS,CAAC;AASjB,QAAA,MAAM,oBAAoB,UAAY,yBAAyB,gCA+C9D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/index.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAoRnD,eAAO,MAAM,cAAc,qGAA0C,CAAC;AAEtE,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAwPnD,eAAO,MAAM,cAAc,qGAA0C,CAAC;AAEtE,eAAe,cAAc,CAAC"}
@@ -18,8 +18,4 @@ export declare const HeaderLabel: import("@emotion/styled").StyledComponent<impo
18
18
  } & import("react").RefAttributes<any> & {
19
19
  theme?: import("@emotion/react").Theme;
20
20
  }, {}, {}>;
21
- export declare const HeaderHint: import("@emotion/styled").StyledComponent<{
22
- theme?: import("@emotion/react").Theme;
23
- as?: React.ElementType;
24
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
25
21
  //# sourceMappingURL=styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/styles.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,SAAS;;SAYR,MAAO,WACpB;2HARA,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;UAElB,CAAC;AAEF,eAAO,MAAM,YAAY;;UAExB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;UAKvB,CAAC;AAEF,eAAO,MAAM,UAAU;;SAVT,MAAO,WACpB;2GAWA,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/styles.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,SAAS;;SAeR,MAAO,WAAW;2HAV/B,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;UAElB,CAAC;AAEF,eAAO,MAAM,YAAY;;UAExB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;UAKvB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import type { FontSizePickerProps, FontSize } from './types';
4
+ import type { FontSizePickerProps } from './types';
5
5
  /**
6
6
  * Some themes use css vars for their font sizes, so until we
7
7
  * have the way of calculating them don't display them.
@@ -10,12 +10,4 @@ import type { FontSizePickerProps, FontSize } from './types';
10
10
  * @return Whether the value is a simple css value.
11
11
  */
12
12
  export declare function isSimpleCssValue(value: NonNullable<FontSizePickerProps['value']>): boolean;
13
- /**
14
- * If all of the given font sizes have the same unit (e.g. 'px'), return that
15
- * unit. Otherwise return null.
16
- *
17
- * @param fontSizes List of font sizes.
18
- * @return The common unit, or null.
19
- */
20
- export declare function getCommonSizeUnit(fontSizes: FontSize[]): string | null | undefined;
21
13
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG7D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,WAAW,CAAE,mBAAmB,CAAE,OAAO,CAAE,CAAE,WAKpD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAE,SAAS,EAAE,QAAQ,EAAE,6BAavD"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/font-size-picker/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,WAAW,CAAE,mBAAmB,CAAE,OAAO,CAAE,CAAE,WAKpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/number-control/index.tsx"],"names":[],"mappings":"AAyRA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;8iLAAyC,CAAC;AAEpE,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/number-control/index.tsx"],"names":[],"mappings":"AA0RA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;8iLAAyC,CAAC;AAEpE,eAAe,aAAa,CAAC"}
@@ -6,17 +6,18 @@
6
6
  * import { useState } from '@wordpress/element';
7
7
  *
8
8
  * const MyRangeControl = () => {
9
- * const [ isChecked, setChecked ] = useState( true );
9
+ * const [ value, setValue ] = useState();
10
10
  * return (
11
11
  * <RangeControl
12
12
  * __nextHasNoMarginBottom
13
13
  * __next40pxDefaultSize
14
14
  * help="Please select how transparent you would like this."
15
- * initialPosition={50}
15
+ * initialPosition={ 50 }
16
16
  * label="Opacity"
17
- * max={100}
18
- * min={0}
19
- * onChange={() => {}}
17
+ * max={ 100 }
18
+ * min={ 0 }
19
+ * value={ value }
20
+ * onChange={ setValue }
20
21
  * />
21
22
  * );
22
23
  * };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/range-control/index.tsx"],"names":[],"mappings":"AAiYA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,YAAY;;;;aAjXuB,CAAC;;;;;;;;;;;;;;qBAiHmB,CAAC;;;;;iCAwBzC,CAAA;;;;;;;;;;8uBAwOqC,CAAC;AAElE,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/range-control/index.tsx"],"names":[],"mappings":"AAiYA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,YAAY;;;;aAlXuB,CAAC;;;;;;;;;;;;;;qBAiHmB,CAAC;;;;;iCAwBzC,CAAA;;;;;;;;;;8uBAyOqC,CAAC;AAElE,eAAe,YAAY,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import type { DropdownMenuProps } from '../../dropdown-menu/types';
2
- declare const _default: import("react").ForwardRefExoticComponent<DropdownMenuProps & import("react").RefAttributes<any>>;
3
- export default _default;
2
+ export declare const ToolbarDropdownMenu: import("react").ForwardRefExoticComponent<DropdownMenuProps & import("react").RefAttributes<any>>;
3
+ export default ToolbarDropdownMenu;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar-dropdown-menu/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;;AA8BnE,wBAAiD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar-dropdown-menu/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AA8BnE,eAAO,MAAM,mBAAmB,mGAA+C,CAAC;AAChF,eAAe,mBAAmB,CAAC"}
@@ -1,6 +1,6 @@
1
- declare const _default: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<any>, "children"> & {
1
+ export declare const ToolbarItem: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<any>, "children"> & {
2
2
  as?: import("react").ElementType;
3
3
  children?: import("react").ReactNode | ((props: import("react").HTMLAttributes<any> & import("react").RefAttributes<any>) => import("react").ReactElement | null);
4
4
  } & import("react").RefAttributes<any>>;
5
- export default _default;
5
+ export default ToolbarItem;
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar-item/index.tsx"],"names":[],"mappings":";;;;AA2DA,wBAAyC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar-item/index.tsx"],"names":[],"mappings":"AA2DA,eAAO,MAAM,WAAW;;;uCAAuC,CAAC;AAChE,eAAe,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const getNodeText: (node: React.ReactNode) => string;
2
+ export default getNodeText;
3
+ //# sourceMappingURL=get-node-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-node-text.d.ts","sourceRoot":"","sources":["../../src/utils/get-node-text.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW,SAAW,KAAK,CAAC,SAAS,KAAI,MAqB9C,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -25,22 +25,21 @@ export function subtract(...args: Array<number | string>): number;
25
25
  /**
26
26
  * Clamps a value based on a min/max range.
27
27
  *
28
- * @param {number} value The value.
29
- * @param {number} min The minimum range.
30
- * @param {number} max The maximum range.
28
+ * @param {number|string} value The value.
29
+ * @param {number} min The minimum range.
30
+ * @param {number} max The maximum range.
31
31
  *
32
32
  * @return {number} The clamped value.
33
33
  */
34
- export function clamp(value: number, min: number, max: number): number;
34
+ export function clamp(value: number | string, min: number, max: number): number;
35
35
  /**
36
- * Clamps a value based on a min/max range with rounding
36
+ * Rounds a value to the nearest step offset by a minimum.
37
37
  *
38
- * @param {number | string} value The value.
39
- * @param {number} min The minimum range.
40
- * @param {number} max The maximum range.
41
- * @param {number} step A multiplier for the value.
38
+ * @param {number|string} value The value.
39
+ * @param {number} min The minimum range.
40
+ * @param {number} step The increment for the value.
42
41
  *
43
- * @return {number} The rounded and clamped value.
42
+ * @return {number} The value as a valid step.
44
43
  */
45
- export function roundClamp(value?: number | string, min?: number, max?: number, step?: number): number;
44
+ export function ensureValidStep(value: number | string, min: number, step: number): number;
46
45
  //# sourceMappingURL=math.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/utils/math.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,iCAJW,OAAO,GAEN,MAAM,CAMjB;AAED;;;;;;GAMG;AACH,6BAJW,KAAK,CAAC,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAQjB;AAED;;;;;;GAMG;AACH,kCAJW,KAAK,CAAC,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAWjB;AAcD;;;;;;;;GAQG;AACH,6BANW,MAAM,OACN,MAAM,OACN,MAAM,GAEL,MAAM,CAKjB;AAED;;;;;;;;;GASG;AACH,mCAPW,MAAM,GAAG,MAAM,QACf,MAAM,QACN,MAAM,SACN,MAAM,GAEL,MAAM,CAiBjB"}
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/utils/math.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,iCAJW,OAAO,GAEN,MAAM,CAMjB;AAED;;;;;;GAMG;AACH,6BAJW,KAAK,CAAC,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAQjB;AAED;;;;;;GAMG;AACH,kCAJW,KAAK,CAAC,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAWjB;AAcD;;;;;;;;GAQG;AACH,6BANW,MAAM,GAAC,MAAM,OACb,MAAM,OACN,MAAM,GAEL,MAAM,CAKjB;AAED;;;;;;;;GAQG;AACH,uCANW,MAAM,GAAC,MAAM,OACb,MAAM,QACN,MAAM,GAEL,MAAM,CAajB"}