@wordpress/components 29.6.0 → 29.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/CHANGELOG.md +34 -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/number-control/index.js +6 -4
  9. package/build/number-control/index.js.map +1 -1
  10. package/build/popover/index.js +29 -17
  11. package/build/popover/index.js.map +1 -1
  12. package/build/popover/types.js.map +1 -1
  13. package/build/range-control/index.js +6 -5
  14. package/build/range-control/index.js.map +1 -1
  15. package/build/toolbar/toolbar-dropdown-menu/index.js +4 -3
  16. package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  17. package/build/toolbar/toolbar-item/index.js +4 -3
  18. package/build/toolbar/toolbar-item/index.js.map +1 -1
  19. package/build/utils/get-node-text.js +30 -0
  20. package/build/utils/get-node-text.js.map +1 -0
  21. package/build/utils/math.js +18 -15
  22. package/build/utils/math.js.map +1 -1
  23. package/build-module/angle-picker-control/index.js +1 -1
  24. package/build-module/angle-picker-control/index.js.map +1 -1
  25. package/build-module/autocomplete/index.js +3 -28
  26. package/build-module/autocomplete/index.js.map +1 -1
  27. package/build-module/custom-select-control-v2/styles.js +9 -9
  28. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  29. package/build-module/number-control/index.js +7 -5
  30. package/build-module/number-control/index.js.map +1 -1
  31. package/build-module/popover/index.js +28 -16
  32. package/build-module/popover/index.js.map +1 -1
  33. package/build-module/popover/types.js.map +1 -1
  34. package/build-module/range-control/index.js +6 -5
  35. package/build-module/range-control/index.js.map +1 -1
  36. package/build-module/toolbar/toolbar-dropdown-menu/index.js +3 -2
  37. package/build-module/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  38. package/build-module/toolbar/toolbar-item/index.js +3 -2
  39. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  40. package/build-module/utils/get-node-text.js +24 -0
  41. package/build-module/utils/get-node-text.js.map +1 -0
  42. package/build-module/utils/math.js +17 -14
  43. package/build-module/utils/math.js.map +1 -1
  44. package/build-style/style-rtl.css +15 -13
  45. package/build-style/style.css +15 -13
  46. package/build-types/angle-picker-control/index.d.ts +1 -1
  47. package/build-types/autocomplete/index.d.ts +2 -2
  48. package/build-types/autocomplete/index.d.ts.map +1 -1
  49. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  50. package/build-types/number-control/index.d.ts.map +1 -1
  51. package/build-types/popover/index.d.ts +18 -2
  52. package/build-types/popover/index.d.ts.map +1 -1
  53. package/build-types/popover/stories/e2e/index.story.d.ts +8 -1
  54. package/build-types/popover/stories/e2e/index.story.d.ts.map +1 -1
  55. package/build-types/popover/stories/index.story.d.ts +1 -0
  56. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  57. package/build-types/popover/test/utils/index.d.ts.map +1 -1
  58. package/build-types/popover/types.d.ts +9 -0
  59. package/build-types/popover/types.d.ts.map +1 -1
  60. package/build-types/range-control/index.d.ts +6 -5
  61. package/build-types/range-control/index.d.ts.map +1 -1
  62. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +2 -2
  63. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts.map +1 -1
  64. package/build-types/toolbar/toolbar-item/index.d.ts +2 -2
  65. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  66. package/build-types/utils/get-node-text.d.ts +3 -0
  67. package/build-types/utils/get-node-text.d.ts.map +1 -0
  68. package/build-types/utils/math.d.ts +10 -11
  69. package/build-types/utils/math.d.ts.map +1 -1
  70. package/package.json +20 -20
  71. package/src/angle-picker-control/README.md +1 -1
  72. package/src/angle-picker-control/index.tsx +1 -1
  73. package/src/autocomplete/index.tsx +3 -30
  74. package/src/button/style.scss +1 -1
  75. package/src/combobox-control/style.scss +4 -2
  76. package/src/custom-select-control-v2/styles.ts +1 -0
  77. package/src/form-token-field/style.scss +6 -6
  78. package/src/number-control/index.tsx +8 -7
  79. package/src/number-control/test/index.tsx +15 -2
  80. package/src/popover/index.tsx +34 -20
  81. package/src/popover/stories/index.story.tsx +83 -2
  82. package/src/popover/test/utils/index.tsx +0 -1
  83. package/src/popover/types.ts +10 -0
  84. package/src/range-control/index.tsx +6 -5
  85. package/src/toolbar/toolbar-dropdown-menu/index.tsx +3 -2
  86. package/src/toolbar/toolbar-item/index.tsx +3 -2
  87. package/src/utils/get-node-text.ts +24 -0
  88. package/src/utils/math.js +17 -22
  89. package/src/utils/test/get-node-text.js +37 -0
  90. package/src/utils/test/math.js +28 -32
  91. package/src/utils/theme-variables.scss +0 -4
  92. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","_interopRequireWildcard","require","_react2","_utils","_space","_selectControlStyles","_inputControlStyles","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_EMOTION_STRINGIFIED_CSS_ERROR__","ANIMATION_PARAMS","SLIDE_AMOUNT","DURATION","EASING","INLINE_PADDING","compact","CONFIG","controlPaddingXSmall","small","controlPaddingX","getSelectSize","size","heightProperty","sizes","paddingInlineStart","paddingInlineEnd","chevronIconSize","getSelectItemSize","checkmarkCorrection","Select","exports","_base","process","env","NODE_ENV","shouldForwardProp","prop","target","label","hasCustomRenderProp","css","COLORS","theme","background","foreground","truncateStyles","fontSizeStyles","inputSize","slideDownAndFade","keyframes","opacity","transform","SelectPopover","radiusSmall","elevationMedium","SelectItem","fontSize","space","gray","name","styles","map","toString","SelectedExperimentalHintWrapper","SelectedExperimentalHintItem","WithHintItemWrapper","WithHintItemHint","fontLineHeightBase","SelectedItemCheck","SelectItemCheck"],"sources":["@wordpress/components/src/custom-select-control-v2/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { css, keyframes } from '@emotion/react';\nimport styled from '@emotion/styled';\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\nimport { space } from '../utils/space';\nimport { chevronIconSize } from '../select-control/styles/select-control-styles';\nimport { fontSizeStyles } from '../input-control/styles/input-control-styles';\nimport type { CustomSelectButtonSize } from './types';\n\n// TODO: extract to common utils and apply to relevant components\nconst ANIMATION_PARAMS = {\n\tSLIDE_AMOUNT: '2px',\n\tDURATION: '400ms',\n\tEASING: 'cubic-bezier( 0.16, 1, 0.3, 1 )',\n};\n\nconst INLINE_PADDING = {\n\tcompact: CONFIG.controlPaddingXSmall,\n\tsmall: CONFIG.controlPaddingXSmall,\n\tdefault: CONFIG.controlPaddingX,\n};\n\nconst getSelectSize = (\n\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >,\n\theightProperty: 'minHeight' | 'height'\n) => {\n\tconst sizes = {\n\t\tcompact: {\n\t\t\t[ heightProperty ]: 32,\n\t\t\tpaddingInlineStart: INLINE_PADDING.compact,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.compact + chevronIconSize,\n\t\t},\n\t\tdefault: {\n\t\t\t[ heightProperty ]: 40,\n\t\t\tpaddingInlineStart: INLINE_PADDING.default,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.default + chevronIconSize,\n\t\t},\n\t\tsmall: {\n\t\t\t[ heightProperty ]: 24,\n\t\t\tpaddingInlineStart: INLINE_PADDING.small,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.small + chevronIconSize,\n\t\t},\n\t};\n\n\treturn sizes[ size ] || sizes.default;\n};\n\nconst getSelectItemSize = (\n\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >\n) => {\n\t// Used to visually align the checkmark with the chevron\n\tconst checkmarkCorrection = 6;\n\tconst sizes = {\n\t\tcompact: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.compact,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.compact - checkmarkCorrection,\n\t\t},\n\t\tdefault: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.default,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.default - checkmarkCorrection,\n\t\t},\n\t\tsmall: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.small,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.small - checkmarkCorrection,\n\t\t},\n\t};\n\n\treturn sizes[ size ] || sizes.default;\n};\n\nexport const Select = styled( Ariakit.Select, {\n\t// Do not forward `hasCustomRenderProp` to the underlying Ariakit.Select component\n\tshouldForwardProp: ( prop ) => prop !== 'hasCustomRenderProp',\n} )(\n\t( {\n\t\tsize,\n\t\thasCustomRenderProp,\n\t}: {\n\t\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >;\n\t\thasCustomRenderProp: boolean;\n\t} ) => css`\n\t\tdisplay: block;\n\t\tbackground-color: ${ COLORS.theme.background };\n\t\tborder: none;\n\t\tcolor: ${ COLORS.theme.foreground };\n\t\tcursor: pointer;\n\t\tfont-family: inherit;\n\t\ttext-align: start;\n\t\tuser-select: none;\n\t\twidth: 100%;\n\n\t\t&[data-focus-visible] {\n\t\t\toutline: none; // handled by InputBase component\n\t\t}\n\n\t\t${ getSelectSize( size, hasCustomRenderProp ? 'minHeight' : 'height' ) }\n\t\t${ ! hasCustomRenderProp && truncateStyles }\n\t\t${ fontSizeStyles( { inputSize: size } ) }\n\t`\n);\n\nconst slideDownAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateY(-${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateY(0)' },\n} );\n\nexport const SelectPopover = styled( Ariakit.SelectPopover )`\n\tdisplay: flex;\n\tflex-direction: column;\n\n\tbackground-color: ${ COLORS.theme.background };\n\tborder-radius: ${ CONFIG.radiusSmall };\n\tborder: 1px solid ${ COLORS.theme.foreground };\n\tbox-shadow: ${ CONFIG.elevationMedium };\n\n\t/* z-index(\".components-popover\") */\n\tz-index: 1000000;\n\n\tmax-height: min( var( --popover-available-height, 400px ), 400px );\n\toverflow: auto;\n\toverscroll-behavior: contain;\n\n\t/* The smallest size without overflowing the container. */\n\tmin-width: min-content;\n\n\t/* Animation */\n\t&[data-open] {\n\t\t@media not ( prefers-reduced-motion ) {\n\t\t\tanimation-duration: ${ ANIMATION_PARAMS.DURATION };\n\t\t\tanimation-timing-function: ${ ANIMATION_PARAMS.EASING };\n\t\t\tanimation-name: ${ slideDownAndFade };\n\t\t\twill-change: transform, opacity;\n\t\t}\n\t}\n\n\t&[data-focus-visible] {\n\t\t/* The outline will be on the trigger, rather than the popover. */\n\t\toutline: none;\n\t}\n`;\n\nexport const SelectItem = styled( Ariakit.SelectItem )(\n\t( {\n\t\tsize,\n\t}: {\n\t\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >;\n\t} ) => css`\n\t\tcursor: default;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tfont-size: ${ CONFIG.fontSize };\n\t\t// TODO: reassess line-height for non-legacy v2\n\t\tline-height: 28px;\n\t\tpadding-block: ${ space( 2 ) };\n\t\tscroll-margin: ${ space( 1 ) };\n\t\tuser-select: none;\n\n\t\t&[aria-disabled='true'] {\n\t\t\tcursor: not-allowed;\n\t\t}\n\n\t\t&[data-active-item] {\n\t\t\tbackground-color: ${ COLORS.theme.gray[ 300 ] };\n\t\t}\n\n\t\t${ getSelectItemSize( size ) }\n\t`\n);\n\nconst truncateStyles = css`\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n`;\n\nexport const SelectedExperimentalHintWrapper = styled.div`\n\t${ truncateStyles }\n`;\n\nexport const SelectedExperimentalHintItem = styled.span`\n\tcolor: ${ COLORS.theme.gray[ 600 ] };\n\tmargin-inline-start: ${ space( 2 ) };\n`;\n\nexport const WithHintItemWrapper = styled.div`\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tflex-wrap: wrap;\n\tflex: 1;\n\tcolumn-gap: ${ space( 4 ) };\n`;\n\nexport const WithHintItemHint = styled.span`\n\tcolor: ${ COLORS.theme.gray[ 600 ] };\n\ttext-align: initial;\n\tline-height: ${ CONFIG.fontLineHeightBase };\n\tpadding-inline-end: ${ space( 1 ) };\n\tmargin-block: ${ space( 1 ) };\n`;\n\nexport const SelectedItemCheck = styled( Ariakit.SelectItemCheck )`\n\tdisplay: flex;\n\talign-items: center;\n\tmargin-inline-start: ${ space( 2 ) };\n\n\t// Keep the checkmark vertically aligned at the top. Since the item text has a\n\t// 28px line height and the checkmark is 24px tall, a (28-24)/2 = 2px margin\n\t// is applied to keep the correct alignment between the text and the checkmark.\n\talign-self: start;\n\tmargin-block-start: 2px;\n\n\t// Since the checkmark's dimensions are applied with 'em' units, setting a\n\t// font size of 0 allows the space reserved for the checkmark to collapse for\n\t// items that are not selected or that don't have an associated item hint.\n\tfont-size: 0;\n\t${ WithHintItemWrapper } ~ &,\n\t&:not(:empty) {\n\t\tfont-size: 24px; // Size of checkmark icon\n\t}\n`;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAA8E,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA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utils","_space","_selectControlStyles","_inputControlStyles","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_EMOTION_STRINGIFIED_CSS_ERROR__","ANIMATION_PARAMS","SLIDE_AMOUNT","DURATION","EASING","INLINE_PADDING","compact","CONFIG","controlPaddingXSmall","small","controlPaddingX","getSelectSize","size","heightProperty","sizes","paddingInlineStart","paddingInlineEnd","chevronIconSize","getSelectItemSize","checkmarkCorrection","Select","exports","_base","process","env","NODE_ENV","shouldForwardProp","prop","target","label","hasCustomRenderProp","css","COLORS","theme","background","foreground","truncateStyles","fontSizeStyles","inputSize","slideDownAndFade","keyframes","opacity","transform","SelectPopover","radiusSmall","elevationMedium","SelectItem","fontSize","space","gray","name","styles","map","toString","SelectedExperimentalHintWrapper","SelectedExperimentalHintItem","WithHintItemWrapper","WithHintItemHint","fontLineHeightBase","SelectedItemCheck","SelectItemCheck"],"sources":["@wordpress/components/src/custom-select-control-v2/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { css, keyframes } from '@emotion/react';\nimport styled from '@emotion/styled';\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\nimport { space } from '../utils/space';\nimport { chevronIconSize } from '../select-control/styles/select-control-styles';\nimport { fontSizeStyles } from '../input-control/styles/input-control-styles';\nimport type { CustomSelectButtonSize } from './types';\n\n// TODO: extract to common utils and apply to relevant components\nconst ANIMATION_PARAMS = {\n\tSLIDE_AMOUNT: '2px',\n\tDURATION: '400ms',\n\tEASING: 'cubic-bezier( 0.16, 1, 0.3, 1 )',\n};\n\nconst INLINE_PADDING = {\n\tcompact: CONFIG.controlPaddingXSmall,\n\tsmall: CONFIG.controlPaddingXSmall,\n\tdefault: CONFIG.controlPaddingX,\n};\n\nconst getSelectSize = (\n\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >,\n\theightProperty: 'minHeight' | 'height'\n) => {\n\tconst sizes = {\n\t\tcompact: {\n\t\t\t[ heightProperty ]: 32,\n\t\t\tpaddingInlineStart: INLINE_PADDING.compact,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.compact + chevronIconSize,\n\t\t},\n\t\tdefault: {\n\t\t\t[ heightProperty ]: 40,\n\t\t\tpaddingInlineStart: INLINE_PADDING.default,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.default + chevronIconSize,\n\t\t},\n\t\tsmall: {\n\t\t\t[ heightProperty ]: 24,\n\t\t\tpaddingInlineStart: INLINE_PADDING.small,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.small + chevronIconSize,\n\t\t},\n\t};\n\n\treturn sizes[ size ] || sizes.default;\n};\n\nconst getSelectItemSize = (\n\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >\n) => {\n\t// Used to visually align the checkmark with the chevron\n\tconst checkmarkCorrection = 6;\n\tconst sizes = {\n\t\tcompact: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.compact,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.compact - checkmarkCorrection,\n\t\t},\n\t\tdefault: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.default,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.default - checkmarkCorrection,\n\t\t},\n\t\tsmall: {\n\t\t\tpaddingInlineStart: INLINE_PADDING.small,\n\t\t\tpaddingInlineEnd: INLINE_PADDING.small - checkmarkCorrection,\n\t\t},\n\t};\n\n\treturn sizes[ size ] || sizes.default;\n};\n\nexport const Select = styled( Ariakit.Select, {\n\t// Do not forward `hasCustomRenderProp` to the underlying Ariakit.Select component\n\tshouldForwardProp: ( prop ) => prop !== 'hasCustomRenderProp',\n} )(\n\t( {\n\t\tsize,\n\t\thasCustomRenderProp,\n\t}: {\n\t\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >;\n\t\thasCustomRenderProp: boolean;\n\t} ) => css`\n\t\tdisplay: block;\n\t\tbackground-color: ${ COLORS.theme.background };\n\t\tborder: none;\n\t\tcolor: ${ COLORS.theme.foreground };\n\t\tcursor: pointer;\n\t\tfont-family: inherit;\n\t\ttext-align: start;\n\t\tuser-select: none;\n\t\twidth: 100%;\n\n\t\t&[data-focus-visible] {\n\t\t\toutline: none; // handled by InputBase component\n\t\t}\n\n\t\t${ getSelectSize( size, hasCustomRenderProp ? 'minHeight' : 'height' ) }\n\t\t${ ! hasCustomRenderProp && truncateStyles }\n\t\t${ fontSizeStyles( { inputSize: size } ) }\n\t`\n);\n\nconst slideDownAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateY(-${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateY(0)' },\n} );\n\nexport const SelectPopover = styled( Ariakit.SelectPopover )`\n\tdisplay: flex;\n\tflex-direction: column;\n\n\tbackground-color: ${ COLORS.theme.background };\n\tborder-radius: ${ CONFIG.radiusSmall };\n\tborder: 1px solid ${ COLORS.theme.foreground };\n\tbox-shadow: ${ CONFIG.elevationMedium };\n\n\t/* z-index(\".components-popover\") */\n\tz-index: 1000000;\n\n\tmax-height: min( var( --popover-available-height, 400px ), 400px );\n\toverflow: auto;\n\toverscroll-behavior: contain;\n\n\t/* The smallest size without overflowing the container. */\n\tmin-width: min-content;\n\n\t/* Animation */\n\t&[data-open] {\n\t\t@media not ( prefers-reduced-motion ) {\n\t\t\tanimation-duration: ${ ANIMATION_PARAMS.DURATION };\n\t\t\tanimation-timing-function: ${ ANIMATION_PARAMS.EASING };\n\t\t\tanimation-name: ${ slideDownAndFade };\n\t\t\twill-change: transform, opacity;\n\t\t}\n\t}\n\n\t&[data-focus-visible] {\n\t\t/* The outline will be on the trigger, rather than the popover. */\n\t\toutline: none;\n\t}\n`;\n\nexport const SelectItem = styled( Ariakit.SelectItem )(\n\t( {\n\t\tsize,\n\t}: {\n\t\tsize: NonNullable< CustomSelectButtonSize[ 'size' ] >;\n\t} ) => css`\n\t\tcursor: default;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tfont-size: ${ CONFIG.fontSize };\n\t\t// TODO: reassess line-height for non-legacy v2\n\t\tline-height: 28px;\n\t\tpadding-block: ${ space( 2 ) };\n\t\tscroll-margin: ${ space( 1 ) };\n\t\tuser-select: none;\n\n\t\t&[aria-disabled='true'] {\n\t\t\tcursor: not-allowed;\n\t\t}\n\n\t\t&[data-active-item] {\n\t\t\tbackground-color: ${ COLORS.theme.gray[ 300 ] };\n\t\t}\n\n\t\t${ getSelectItemSize( size ) }\n\t`\n);\n\nconst truncateStyles = css`\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n`;\n\nexport const SelectedExperimentalHintWrapper = styled.div`\n\t${ truncateStyles }\n`;\n\nexport const SelectedExperimentalHintItem = styled.span`\n\tcolor: ${ COLORS.theme.gray[ 600 ] };\n\tmargin-inline-start: ${ space( 2 ) };\n`;\n\nexport const WithHintItemWrapper = styled.div`\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tflex-wrap: wrap;\n\tflex: 1;\n\tcolumn-gap: ${ space( 4 ) };\n`;\n\nexport const WithHintItemHint = styled.span`\n\tcolor: ${ COLORS.theme.gray[ 600 ] };\n\ttext-align: initial;\n\tline-height: ${ CONFIG.fontLineHeightBase };\n\tpadding-inline-end: ${ space( 1 ) };\n\tmargin-block: ${ space( 1 ) };\n`;\n\nexport const SelectedItemCheck = styled( Ariakit.SelectItemCheck )`\n\tdisplay: flex;\n\talign-items: center;\n\tmargin-inline-start: ${ space( 2 ) };\n\tfill: currentColor;\n\n\t// Keep the checkmark vertically aligned at the top. Since the item text has a\n\t// 28px line height and the checkmark is 24px tall, a (28-24)/2 = 2px margin\n\t// is applied to keep the correct alignment between the text and the checkmark.\n\talign-self: start;\n\tmargin-block-start: 2px;\n\n\t// Since the checkmark's dimensions are applied with 'em' units, setting a\n\t// font size of 0 allows the space reserved for the checkmark to collapse for\n\t// items that are not selected or that don't have an associated item hint.\n\tfont-size: 0;\n\t${ WithHintItemWrapper } ~ &,\n\t&:not(:empty) {\n\t\tfont-size: 24px; // Size of checkmark icon\n\t}\n`;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAA8E,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,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EAAAG,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,aAClBG,aAAM,CAACC,KAAK,CAACgB,IAAI,CAAE,GAAG,CAAE,sCAElB1C,aAAM,CAACmD,kBAAkB,0BAClB,IAAAV,YAAK,EAAE,CAAE,CAAC,oBAChB,IAAAA,YAAK,EAAE,CAAE,CAAC,SAAAzB,OAAA,CAAAC,GAAA,CAAAC,QAAA,glSAC3B;AAEM,MAAMkC,iBAAiB,GAAAtC,OAAA,CAAAsC,iBAAA,gBAAG,IAAArC,KAAA,CAAApC,OAAA,EAAQd,OAAO,CAACwF,eAAe,EAAArC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,yDAGzC,IAAAmB,YAAK,EAAE,CAAE,CAAC,6EAa/BQ,mBAAmB,yCAAAjC,OAAA,CAAAC,GAAA,CAAAC,QAAA,glSAItB","ignoreList":[]}
@@ -78,12 +78,14 @@ function UnforwardedNumberControl(props, forwardedRef) {
78
78
  const isStepAny = step === 'any';
79
79
  const baseStep = isStepAny ? 1 : (0, _values.ensureNumber)(step);
80
80
  const baseSpin = (0, _values.ensureNumber)(spinFactor) * baseStep;
81
- const baseValue = (0, _math.roundClamp)(0, min, max, baseStep);
82
81
  const constrainValue = (value, stepOverride) => {
83
- // When step is "any" clamp the value, otherwise round and clamp it.
84
- // Use '' + to convert to string for use in input value attribute.
85
- return isStepAny ? '' + Math.min(max, Math.max(min, (0, _values.ensureNumber)(value))) : '' + (0, _math.roundClamp)(value, min, max, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep);
82
+ // When step is not "any" the value must be a valid step.
83
+ if (!isStepAny) {
84
+ value = (0, _math.ensureValidStep)(value, min, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep);
85
+ }
86
+ return `${(0, _math.clamp)(value, min, max)}`;
86
87
  };
88
+ const baseValue = constrainValue(0);
87
89
  const autoComplete = typeProp === 'number' ? 'off' : undefined;
88
90
  const classes = (0, _clsx.default)('components-number-control', className);
89
91
  const cx = (0, _utils.useCx)();
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_icons","_compose","_deprecated","_numberControlStyles","inputControlActionTypes","_interopRequireWildcard","_math","_values","_hStack","_spacer","_utils","_useDeprecatedProps","_deprecated36pxSize","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","noop","UnforwardedNumberControl","props","forwardedRef","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","spinControls","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","spinFactor","type","typeProp","value","valueProp","size","suffix","onChange","__shouldNotWarnDeprecated36pxSize","restProps","useDeprecated36pxDefaultSizeProp","maybeWarnDeprecated36pxSize","componentName","__next40pxDefaultSize","deprecated","alternative","since","version","inputRef","useRef","mergedRef","useMergeRefs","isStepAny","baseStep","ensureNumber","baseSpin","baseValue","roundClamp","constrainValue","stepOverride","Math","autoComplete","undefined","classes","clsx","cx","useCx","spinButtonClasses","styles","smallSpinButtons","spinValue","direction","event","preventDefault","shift","shiftKey","delta","nextValue","isValueEmpty","add","subtract","numberControlStateReducer","state","action","nextState","payload","currentValue","PRESS_UP","PRESS_DOWN","DRAG","x","y","enableShift","modifier","directionModifier","isRTL","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","buildSpinButtonClickHandler","String","target","current","jsx","Input","inputMode","ref","_stateReducerProp","baseState","jsxs","Fragment","children","Spacer","marginBottom","marginRight","HStack","spacing","SpinButton","icon","plusIcon","__","onClick","resetIcon","NumberControl","exports","forwardRef","_default"],"sources":["@wordpress/components/src/number-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { plus as plusIcon, reset as resetIcon } from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Input, SpinButton, styles } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { NumberControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\nimport { useCx } from '../utils';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\nfunction UnforwardedNumberControl(\n\tprops: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tspinControls = hideHTMLArrows ? 'none' : 'native',\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\tspinFactor = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tonChange = noop,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp< NumberControlProps >( props );\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'NumberControl',\n\t\tsize,\n\t\t__next40pxDefaultSize: restProps.__next40pxDefaultSize,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\tif ( hideHTMLArrows ) {\n\t\tdeprecated( 'wp.components.NumberControl hideHTMLArrows prop ', {\n\t\t\talternative: 'spinControls=\"none\"',\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.3',\n\t\t} );\n\t}\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst mergedRef = useMergeRefs( [ inputRef, forwardedRef ] );\n\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : ensureNumber( step );\n\tconst baseSpin = ensureNumber( spinFactor ) * baseStep;\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = (\n\t\tvalue: number | string,\n\t\tstepOverride?: number\n\t) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it.\n\t\t// Use '' + to convert to string for use in input value attribute.\n\t\treturn isStepAny\n\t\t\t? '' + Math.min( max, Math.max( min, ensureNumber( value ) ) )\n\t\t\t: '' + roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : undefined;\n\tconst classes = clsx( 'components-number-control', className );\n\tconst cx = useCx();\n\tconst spinButtonClasses = cx( size === 'small' && styles.smallSpinButtons );\n\n\tconst spinValue = (\n\t\tvalue: string | number | undefined,\n\t\tdirection: 'up' | 'down',\n\t\tevent: KeyboardEvent | MouseEvent | undefined\n\t) => {\n\t\tevent?.preventDefault();\n\t\tconst shift = event?.shiftKey && isShiftStepEnabled;\n\t\tconst delta = shift ? ensureNumber( shiftStep ) * baseSpin : baseSpin;\n\t\tlet nextValue = isValueEmpty( value ) ? baseValue : value;\n\t\tif ( direction === 'up' ) {\n\t\t\tnextValue = add( nextValue, delta );\n\t\t} else if ( direction === 'down' ) {\n\t\t\tnextValue = subtract( nextValue, delta );\n\t\t}\n\t\treturn constrainValue( nextValue, shift ? delta : undefined );\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer: NumberControlProps[ '__unstableStateReducer' ] =\n\t\t( state, action ) => {\n\t\t\tconst nextState = { ...state };\n\n\t\t\tconst { type, payload } = action;\n\t\t\tconst event = payload.event;\n\t\t\tconst currentValue = nextState.value;\n\n\t\t\t/**\n\t\t\t * Handles custom UP and DOWN Keyboard events\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t\t) {\n\t\t\t\tnextState.value = spinValue(\n\t\t\t\t\tcurrentValue,\n\t\t\t\t\ttype === inputControlActionTypes.PRESS_UP ? 'up' : 'down',\n\t\t\t\t\tevent as KeyboardEvent | undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles drag to update events\n\t\t\t */\n\t\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\t\tconst [ x, y ] = payload.delta;\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseSpin\n\t\t\t\t\t: baseSpin;\n\n\t\t\t\tlet directionModifier;\n\t\t\t\tlet delta;\n\n\t\t\t\tswitch ( dragDirection ) {\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'w':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( delta !== 0 ) {\n\t\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\t\tnextState.value = constrainValue(\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\t\tenableShift ? modifier : undefined\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles commit (ENTER key press or blur)\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t\t) {\n\t\t\t\tconst applyEmptyValue =\n\t\t\t\t\trequired === false && currentValue === '';\n\n\t\t\t\tnextState.value = applyEmptyValue\n\t\t\t\t\t? currentValue\n\t\t\t\t\t: // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t constrainValue( currentValue );\n\t\t\t}\n\n\t\t\treturn nextState;\n\t\t};\n\n\tconst buildSpinButtonClickHandler =\n\t\t( direction: 'up' | 'down' ) =>\n\t\t( event: MouseEvent< HTMLButtonElement > ) =>\n\t\t\tonChange( String( spinValue( valueProp, direction, event ) ), {\n\t\t\t\t// Set event.target to the <input> so that consumers can use\n\t\t\t\t// e.g. event.target.validity.\n\t\t\t\tevent: {\n\t\t\t\t\t...event,\n\t\t\t\t\ttarget: inputRef.current!,\n\t\t\t\t},\n\t\t\t} );\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...restProps }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ spinControls !== 'native' }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max === Infinity ? undefined : max }\n\t\t\tmin={ min === -Infinity ? undefined : min }\n\t\t\tref={ mergedRef }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ ( state, action ) => {\n\t\t\t\tconst baseState = numberControlStateReducer( state, action );\n\t\t\t\treturn stateReducerProp?.( baseState, action ) ?? baseState;\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\tsuffix={\n\t\t\t\tspinControls === 'custom' ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t<Spacer marginBottom={ 0 } marginRight={ 2 }>\n\t\t\t\t\t\t\t<HStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ plusIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Increment' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'up'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Decrement' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'down'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\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,EAAC/H,oBAAA,CAAA6I,UAAU;YACVxG,SAAS,EAAGkD,iBAAmB;YAC/BuD,IAAI,EAAGI,YAAW;YAClB3F,IAAI,EAAC,OAAO;YACZZ,KAAK,EAAG,IAAAqG,QAAE,EAAE,WAAY,CAAG;YAC3BC,OAAO,EAAGtB,2BAA2B,CACpC,MACD;UAAG,CACH,CAAC;QAAA,CACK;MAAC,CACF,CAAC;IAAA,CACR,CAAC,GAEHnE,MAED;IACDC,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ;AAEO,MAAM0F,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,mBAAU,EAAErH,wBAAyB,CAAC;AAAC,IAAAsH,QAAA,GAAAF,OAAA,CAAAnI,OAAA,GAErDkI,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_icons","_compose","_deprecated","_numberControlStyles","inputControlActionTypes","_interopRequireWildcard","_math","_values","_hStack","_spacer","_utils","_useDeprecatedProps","_deprecated36pxSize","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","noop","UnforwardedNumberControl","props","forwardedRef","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","spinControls","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","spinFactor","type","typeProp","value","valueProp","size","suffix","onChange","__shouldNotWarnDeprecated36pxSize","restProps","useDeprecated36pxDefaultSizeProp","maybeWarnDeprecated36pxSize","componentName","__next40pxDefaultSize","deprecated","alternative","since","version","inputRef","useRef","mergedRef","useMergeRefs","isStepAny","baseStep","ensureNumber","baseSpin","constrainValue","stepOverride","ensureValidStep","clamp","baseValue","autoComplete","undefined","classes","clsx","cx","useCx","spinButtonClasses","styles","smallSpinButtons","spinValue","direction","event","preventDefault","shift","shiftKey","delta","nextValue","isValueEmpty","add","subtract","numberControlStateReducer","state","action","nextState","payload","currentValue","PRESS_UP","PRESS_DOWN","DRAG","x","y","enableShift","modifier","directionModifier","isRTL","Math","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","buildSpinButtonClickHandler","String","target","current","jsx","Input","inputMode","ref","_stateReducerProp","baseState","jsxs","Fragment","children","Spacer","marginBottom","marginRight","HStack","spacing","SpinButton","icon","plusIcon","__","onClick","resetIcon","NumberControl","exports","forwardRef","_default"],"sources":["@wordpress/components/src/number-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { plus as plusIcon, reset as resetIcon } from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Input, SpinButton, styles } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, clamp, ensureValidStep } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { NumberControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\nimport { useCx } from '../utils';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\nfunction UnforwardedNumberControl(\n\tprops: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tspinControls = hideHTMLArrows ? 'none' : 'native',\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\tspinFactor = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tonChange = noop,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp< NumberControlProps >( props );\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'NumberControl',\n\t\tsize,\n\t\t__next40pxDefaultSize: restProps.__next40pxDefaultSize,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\tif ( hideHTMLArrows ) {\n\t\tdeprecated( 'wp.components.NumberControl hideHTMLArrows prop ', {\n\t\t\talternative: 'spinControls=\"none\"',\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.3',\n\t\t} );\n\t}\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst mergedRef = useMergeRefs( [ inputRef, forwardedRef ] );\n\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : ensureNumber( step );\n\tconst baseSpin = ensureNumber( spinFactor ) * baseStep;\n\tconst constrainValue = (\n\t\tvalue: number | string,\n\t\tstepOverride?: number\n\t) => {\n\t\t// When step is not \"any\" the value must be a valid step.\n\t\tif ( ! isStepAny ) {\n\t\t\tvalue = ensureValidStep( value, min, stepOverride ?? baseStep );\n\t\t}\n\n\t\treturn `${ clamp( value, min, max ) }`;\n\t};\n\tconst baseValue = constrainValue( 0 );\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : undefined;\n\tconst classes = clsx( 'components-number-control', className );\n\tconst cx = useCx();\n\tconst spinButtonClasses = cx( size === 'small' && styles.smallSpinButtons );\n\n\tconst spinValue = (\n\t\tvalue: string | number | undefined,\n\t\tdirection: 'up' | 'down',\n\t\tevent: KeyboardEvent | MouseEvent | undefined\n\t) => {\n\t\tevent?.preventDefault();\n\t\tconst shift = event?.shiftKey && isShiftStepEnabled;\n\t\tconst delta = shift ? ensureNumber( shiftStep ) * baseSpin : baseSpin;\n\t\tlet nextValue = isValueEmpty( value ) ? baseValue : value;\n\t\tif ( direction === 'up' ) {\n\t\t\tnextValue = add( nextValue, delta );\n\t\t} else if ( direction === 'down' ) {\n\t\t\tnextValue = subtract( nextValue, delta );\n\t\t}\n\t\treturn constrainValue( nextValue, shift ? delta : undefined );\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer: NumberControlProps[ '__unstableStateReducer' ] =\n\t\t( state, action ) => {\n\t\t\tconst nextState = { ...state };\n\n\t\t\tconst { type, payload } = action;\n\t\t\tconst event = payload.event;\n\t\t\tconst currentValue = nextState.value;\n\n\t\t\t/**\n\t\t\t * Handles custom UP and DOWN Keyboard events\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t\t) {\n\t\t\t\tnextState.value = spinValue(\n\t\t\t\t\tcurrentValue,\n\t\t\t\t\ttype === inputControlActionTypes.PRESS_UP ? 'up' : 'down',\n\t\t\t\t\tevent as KeyboardEvent | undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles drag to update events\n\t\t\t */\n\t\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\t\tconst [ x, y ] = payload.delta;\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseSpin\n\t\t\t\t\t: baseSpin;\n\n\t\t\t\tlet directionModifier;\n\t\t\t\tlet delta;\n\n\t\t\t\tswitch ( dragDirection ) {\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'w':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( delta !== 0 ) {\n\t\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\t\tnextState.value = constrainValue(\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\t\tenableShift ? modifier : undefined\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles commit (ENTER key press or blur)\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t\t) {\n\t\t\t\tconst applyEmptyValue =\n\t\t\t\t\trequired === false && currentValue === '';\n\n\t\t\t\tnextState.value = applyEmptyValue\n\t\t\t\t\t? currentValue\n\t\t\t\t\t: // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t constrainValue( currentValue );\n\t\t\t}\n\n\t\t\treturn nextState;\n\t\t};\n\n\tconst buildSpinButtonClickHandler =\n\t\t( direction: 'up' | 'down' ) =>\n\t\t( event: MouseEvent< HTMLButtonElement > ) =>\n\t\t\tonChange( String( spinValue( valueProp, direction, event ) ), {\n\t\t\t\t// Set event.target to the <input> so that consumers can use\n\t\t\t\t// e.g. event.target.validity.\n\t\t\t\tevent: {\n\t\t\t\t\t...event,\n\t\t\t\t\ttarget: inputRef.current!,\n\t\t\t\t},\n\t\t\t} );\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...restProps }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ spinControls !== 'native' }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max === Infinity ? undefined : max }\n\t\t\tmin={ min === -Infinity ? undefined : min }\n\t\t\tref={ mergedRef }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ ( state, action ) => {\n\t\t\t\tconst baseState = numberControlStateReducer( state, action );\n\t\t\t\treturn stateReducerProp?.( baseState, action ) ?? baseState;\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\tsuffix={\n\t\t\t\tspinControls === 'custom' ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t<Spacer marginBottom={ 0 } marginRight={ 2 }>\n\t\t\t\t\t\t\t<HStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ plusIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Increment' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'up'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Decrement' ) }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'down'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tsuffix\n\t\t\t\t)\n\t\t\t}\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nexport const NumberControl = forwardRef( UnforwardedNumberControl );\n\nexport default NumberControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAC,uBAAA,CAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAGA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,mBAAA,GAAAd,OAAA;AACA,IAAAe,mBAAA,GAAAf,OAAA;AAA4E,IAAAgB,WAAA,GAAAhB,OAAA;AAAA,SAAAiB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAA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AAChI,oBAAA,CAAA8I,UAAU;YACVzG,SAAS,EAAGkD,iBAAmB;YAC/BwD,IAAI,EAAGC,WAAU;YACjBzF,IAAI,EAAC,OAAO;YACZZ,KAAK,EAAG,IAAAsG,QAAE,EAAE,WAAY,CAAG;YAC3BC,OAAO,EAAGtB,2BAA2B,CACpC,IACD;UAAG,CACH,CAAC,eACF,IAAAlH,WAAA,CAAAsH,GAAA,EAAChI,oBAAA,CAAA8I,UAAU;YACVzG,SAAS,EAAGkD,iBAAmB;YAC/BwD,IAAI,EAAGI,YAAW;YAClB5F,IAAI,EAAC,OAAO;YACZZ,KAAK,EAAG,IAAAsG,QAAE,EAAE,WAAY,CAAG;YAC3BC,OAAO,EAAGtB,2BAA2B,CACpC,MACD;UAAG,CACH,CAAC;QAAA,CACK;MAAC,CACF,CAAC;IAAA,CACR,CAAC,GAEHpE,MAED;IACDC,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ;AAEO,MAAM2F,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,mBAAU,EAAEtH,wBAAyB,CAAC;AAAC,IAAAuH,QAAA,GAAAF,OAAA,CAAApI,OAAA,GAErDmI,aAAa","ignoreList":[]}
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = exports.SLOT_NAME = exports.Popover = void 0;
7
+ exports.default = exports.SLOT_NAME = exports.PopoverSlot = exports.Popover = void 0;
8
8
  var _clsx = _interopRequireDefault(require("clsx"));
9
9
  var _reactDom = require("@floating-ui/react-dom");
10
10
  var _framerMotion = require("framer-motion");
@@ -338,6 +338,18 @@ const UnforwardedPopover = (props, forwardedRef) => {
338
338
  });
339
339
  };
340
340
 
341
+ // Export the PopoverSlot individually to allow typescript to pick the types up.
342
+ const PopoverSlot = exports.PopoverSlot = (0, _element.forwardRef)(({
343
+ name = SLOT_NAME
344
+ }, ref) => {
345
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_slotFill.Slot, {
346
+ bubblesVirtually: true,
347
+ name: name,
348
+ className: "popover-slot",
349
+ ref: ref
350
+ });
351
+ });
352
+
341
353
  /**
342
354
  * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.
343
355
  *
@@ -361,21 +373,21 @@ const UnforwardedPopover = (props, forwardedRef) => {
361
373
  * ```
362
374
  *
363
375
  */
364
- const Popover = exports.Popover = (0, _context.contextConnect)(UnforwardedPopover, 'Popover');
365
- function PopoverSlot({
366
- name = SLOT_NAME
367
- }, ref) {
368
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_slotFill.Slot, {
369
- bubblesVirtually: true,
370
- name: name,
371
- className: "popover-slot",
372
- ref: ref
373
- });
374
- }
375
-
376
- // @ts-expect-error For Legacy Reasons
377
- Popover.Slot = (0, _element.forwardRef)(PopoverSlot);
378
- // @ts-expect-error For Legacy Reasons
379
- Popover.__unstableSlotNameProvider = slotNameContext.Provider;
376
+ const Popover = exports.Popover = Object.assign((0, _context.contextConnect)(UnforwardedPopover, 'Popover'), {
377
+ /**
378
+ * Renders a slot that is used internally by Popover for rendering content.
379
+ */
380
+ Slot: Object.assign(PopoverSlot, {
381
+ displayName: 'Popover.Slot'
382
+ }),
383
+ /**
384
+ * Provides a context to manage popover slot names.
385
+ *
386
+ * This is marked as unstable and should not be used directly.
387
+ */
388
+ __unstableSlotNameProvider: Object.assign(slotNameContext.Provider, {
389
+ displayName: 'Popover.__unstableSlotNameProvider'
390
+ })
391
+ });
380
392
  var _default = exports.default = Popover;
381
393
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_reactDom","_framerMotion","_element","_compose","_icons","_deprecated","_primitives","_i18n","_button","_scrollLock","_slotFill","_utils","_context","_overlayMiddlewares","_styleProvider","_jsxRuntime","SLOT_NAME","exports","ArrowTriangle","jsxs","SVG","xmlns","viewBox","className","role","children","jsx","Path","d","vectorEffect","slotNameContext","createContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offset","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","flip","resize","shift","inline","variant","style","contentStyle","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","useContextSystem","computedFlipProp","computedResizeProp","deprecated","since","version","alternative","computedVariant","arrowRef","useRef","fallbackReferenceElement","setFallbackReferenceElement","useState","anchorRefFallback","useCallback","node","isMobileViewport","useViewportMatch","isExpanded","hasArrow","normalizedPlacementFromProps","positionToPlacement","middleware","overlayMiddlewares","offsetMiddleware","flipMiddleware","size","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","maxHeight","availableHeight","overflow","shiftMiddleware","crossAxis","limiter","limitShift","padding","arrow","element","slotName","useContext","slot","useSlot","onDialogClose","type","event","dialogRef","dialogProps","useDialog","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","useFloating","whileElementsMounted","referenceParam","floatingParam","updateParam","autoUpdate","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","useLayoutEffect","resultingReferenceElement","getReferenceElement","setReference","mergedFloatingRef","useMergeRefs","setFloating","left","computePopoverPosition","shouldReduceMotion","useReducedMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","useMemo","placementToMotionAnimationProps","animationProps","onAnimationComplete","isPositioned","content","motion","div","clsx","ref","tabIndex","default","icon","close","onClick","label","__","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","Fill","name","createPortal","StyleProvider","Fragment","Popover","contextConnect","PopoverSlot","Slot","bubblesVirtually","forwardRef","__unstableSlotNameProvider","Provider","_default"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children` which are re-defined in\n\t\t// `PopoverProps`, and `style` which is merged safely).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' | 'style' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\t\tstyle: contentStyle,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = contextConnect( UnforwardedPopover, 'Popover' );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\n// @ts-expect-error For Legacy Reasons\nPopover.Slot = forwardRef( PopoverSlot );\n// @ts-expect-error For Legacy Reasons\nPopover.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default Popover;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAWA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAWA,IAAAI,QAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAKA,IAAAS,OAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,WAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AAMA,IAAAa,QAAA,GAAAb,OAAA;AAOA,IAAAc,mBAAA,GAAAd,OAAA;AACA,IAAAe,cAAA,GAAAf,OAAA;AAAkD,IAAAgB,WAAA,GAAAhB,OAAA;AA/DlD;AACA;AACA;;AAgBA;AACA;AACA;;AAuBA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACO,MAAMiB,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,SAAS;;AAElC;AACA;AACA;AACA;AACA,MAAME,aAAa,GAAGA,CAAA,kBACrB,IAAAH,WAAA,CAAAI,IAAA,EAACb,WAAA,CAAAc,GAAG;EACHC,KAAK,EAAC,4BAA4B;EAClCC,OAAO,EAAC,aAAa;EACrBC,SAAS,EAAC,8BAA8B;EACxCC,IAAI,EAAC,cAAc;EAAAC,QAAA,gBAEnB,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AAA,CAAAW,GAAA,EAAChB,SAAA,CAAA8L,IAAI;IACJC,gBAAgB;IAChBR,IAAI,EAAGA,IAAM;IACb1K,SAAS,EAAC,cAAc;IACxB2J,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;;AAEA;AACAmB,OAAO,CAACG,IAAI,GAAG,IAAAE,mBAAU,EAAEH,WAAY,CAAC;AACxC;AACAF,OAAO,CAACM,0BAA0B,GAAG7K,eAAe,CAAC8K,QAAQ;AAAC,IAAAC,QAAA,GAAA5L,OAAA,CAAAmK,OAAA,GAE/CiB,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_reactDom","_framerMotion","_element","_compose","_icons","_deprecated","_primitives","_i18n","_button","_scrollLock","_slotFill","_utils","_context","_overlayMiddlewares","_styleProvider","_jsxRuntime","SLOT_NAME","exports","ArrowTriangle","jsxs","SVG","xmlns","viewBox","className","role","children","jsx","Path","d","vectorEffect","slotNameContext","createContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offset","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","flip","resize","shift","inline","variant","style","contentStyle","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","useContextSystem","computedFlipProp","computedResizeProp","deprecated","since","version","alternative","computedVariant","arrowRef","useRef","fallbackReferenceElement","setFallbackReferenceElement","useState","anchorRefFallback","useCallback","node","isMobileViewport","useViewportMatch","isExpanded","hasArrow","normalizedPlacementFromProps","positionToPlacement","middleware","overlayMiddlewares","offsetMiddleware","flipMiddleware","size","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","maxHeight","availableHeight","overflow","shiftMiddleware","crossAxis","limiter","limitShift","padding","arrow","element","slotName","useContext","slot","useSlot","onDialogClose","type","event","dialogRef","dialogProps","useDialog","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","useFloating","whileElementsMounted","referenceParam","floatingParam","updateParam","autoUpdate","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","useLayoutEffect","resultingReferenceElement","getReferenceElement","setReference","mergedFloatingRef","useMergeRefs","setFloating","left","computePopoverPosition","shouldReduceMotion","useReducedMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","useMemo","placementToMotionAnimationProps","animationProps","onAnimationComplete","isPositioned","content","motion","div","clsx","ref","tabIndex","default","icon","close","onClick","label","__","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","Fill","name","createPortal","StyleProvider","Fragment","PopoverSlot","forwardRef","Slot","bubblesVirtually","Popover","contextConnect","displayName","__unstableSlotNameProvider","Provider","_default"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n\tPopoverSlotProps,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children` which are re-defined in\n\t\t// `PopoverProps`, and `style` which is merged safely).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' | 'style' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\t\tstyle: contentStyle,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n// Export the PopoverSlot individually to allow typescript to pick the types up.\nexport const PopoverSlot = forwardRef< HTMLDivElement, PopoverSlotProps >(\n\t( { name = SLOT_NAME }, ref ) => {\n\t\treturn (\n\t\t\t<Slot\n\t\t\t\tbubblesVirtually\n\t\t\t\tname={ name }\n\t\t\t\tclassName=\"popover-slot\"\n\t\t\t\tref={ ref }\n\t\t\t/>\n\t\t);\n\t}\n);\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = Object.assign(\n\tcontextConnect( UnforwardedPopover, 'Popover' ),\n\t{\n\t\t/**\n\t\t * Renders a slot that is used internally by Popover for rendering content.\n\t\t */\n\t\tSlot: Object.assign( PopoverSlot, {\n\t\t\tdisplayName: 'Popover.Slot',\n\t\t} ),\n\t\t/**\n\t\t * Provides a context to manage popover slot names.\n\t\t *\n\t\t * This is marked as unstable and should not be used directly.\n\t\t */\n\t\t__unstableSlotNameProvider: Object.assign( slotNameContext.Provider, {\n\t\t\tdisplayName: 'Popover.__unstableSlotNameProvider',\n\t\t} ),\n\t}\n);\n\nexport default Popover;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAWA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,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ACH;AACF;AACA;AACA;AACA;EACEC,0BAA0B,EAAEjG,MAAM,CAACC,MAAM,CAAE9E,eAAe,CAAC+K,QAAQ,EAAE;IACpEF,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC;AAAC,IAAAG,QAAA,GAAA7L,OAAA,CAAAmK,OAAA,GAEaqB,OAAO","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/popover/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, MutableRefObject, SyntheticEvent } from 'react';\nimport type { Placement } from '@floating-ui/react-dom';\n\ntype PositionYAxis = 'top' | 'middle' | 'bottom';\ntype PositionXAxis = 'left' | 'center' | 'right';\ntype PositionCorner = 'top' | 'right' | 'bottom' | 'left';\n\ntype DomRectWithOwnerDocument = DOMRect & {\n\townerDocument?: Document;\n};\n\ntype PopoverPlacement = Placement | 'overlay';\n\nexport type PopoverAnchorRefReference = MutableRefObject<\n\tElement | null | undefined\n>;\nexport type PopoverAnchorRefTopBottom = { top: Element; bottom: Element };\n\nexport type VirtualElement = Pick< Element, 'getBoundingClientRect' > & {\n\townerDocument?: Document;\n};\n\nexport type PopoverProps = {\n\t/**\n\t * The name of the Slot in which the popover should be rendered. It should\n\t * be also passed to the corresponding `PopoverSlot` component.\n\t *\n\t * @default 'Popover'\n\t */\n\t__unstableSlotName?: string;\n\t/**\n\t * The element that should be used by the popover as its anchor. It can either\n\t * be an `Element` or, alternatively, a `VirtualElement` — ie. an object with\n\t * the `getBoundingClientRect()` and the `ownerDocument` properties defined.\n\t *\n\t * **The anchor element should be stored in local state** rather than a\n\t * plain React ref to ensure reactive updating when it changes.\n\t */\n\tanchor?: Element | VirtualElement | null;\n\t/**\n\t * Whether the popover should animate when opening.\n\t *\n\t * @default true\n\t */\n\tanimate?: boolean;\n\t/**\n\t * The `children` elements rendered as the popover's content.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Show the popover fullscreen on mobile viewports.\n\t */\n\texpandOnMobile?: boolean;\n\t/**\n\t * Specifies whether the popover should flip across its axis if there isn't\n\t * space for it in the normal placement.\n\t * When the using a 'top' placement, the popover will switch to a 'bottom'\n\t * placement. When using a 'left' placement, the popover will switch to a\n\t * `right' placement.\n\t * The popover will retain its alignment of 'start' or 'end' when flipping.\n\t *\n\t * @default true\n\t */\n\tflip?: boolean;\n\t/**\n\t * Determines whether tabbing is constrained to within the popover,\n\t * preventing keyboard focus from leaving the popover content without\n\t * explicit focus elswhere, or whether the popover remains part of the wider\n\t * tab order. If no value is passed, it will be derived from `focusOnMount`.\n\t *\n\t * @default `focusOnMount` !== false\n\t */\n\tconstrainTabbing?: boolean;\n\t/**\n\t * By default, the _first tabbable element_ in the popover will receive focus\n\t * when it mounts. This is the same as setting this prop to `\"firstElement\"`.\n\t * Specifying a `false` value disables the focus handling entirely (this\n\t * should only be done when an appropriately accessible substitute behavior\n\t * exists).\n\t *\n\t * @default 'firstElement'\n\t */\n\tfocusOnMount?: 'firstElement' | boolean;\n\t/**\n\t * A callback invoked when the focus leaves the opened popover. This should\n\t * only be provided in advanced use-cases when a popover should close under\n\t * specific circumstances (for example, if the new `document.activeElement`\n\t * is content of or otherwise controlling popover visibility).\n\t *\n\t * When not provided, the `onClose` callback will be called instead.\n\t */\n\tonFocusOutside?: ( event: SyntheticEvent ) => void;\n\t/**\n\t * Used to customize the header text shown when the popover is toggled to\n\t * fullscreen on mobile viewports (see the `expandOnMobile` prop).\n\t */\n\theaderTitle?: string;\n\t/**\n\t * Used to show/hide the arrow that points at the popover's anchor.\n\t *\n\t * @default true\n\t */\n\tnoArrow?: boolean;\n\t/**\n\t * The distance (in px) between the anchor and the popover.\n\t */\n\toffset?: number;\n\t/**\n\t * A callback invoked when the popover should be closed.\n\t */\n\tonClose?: () => void;\n\t/**\n\t * Used to specify the popover's position with respect to its anchor.\n\t *\n\t * @default 'bottom-start'\n\t */\n\tplacement?: PopoverPlacement;\n\t/**\n\t * Legacy way to specify the popover's position with respect to its anchor.\n\t * _Note: this prop is deprecated. Use the `placement` prop instead._\n\t */\n\tposition?:\n\t\t| `${ PositionYAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis } ${ PositionCorner }`;\n\t/**\n\t * Adjusts the size of the popover to prevent its contents from going out of\n\t * view when meeting the viewport edges.\n\t *\n\t * @default true\n\t */\n\tresize?: boolean;\n\t/**\n\t * Enables the `Popover` to shift in order to stay in view when meeting the\n\t * viewport edges.\n\t *\n\t * @default false\n\t */\n\tshift?: boolean;\n\t/**\n\t * Specifies the popover's style.\n\t *\n\t * Leave undefined for the default style. Other values are:\n\t * - 'unstyled': The popover is essentially without any visible style, it\n\t * has no background, border, outline or drop shadow, but\n\t * the popover contents are still displayed.\n\t * - 'toolbar': A style that has no elevation, but a high contrast with\n\t * other elements. This is matches the style of the\n\t * `Toolbar` component.\n\t *\n\t * @default undefined\n\t */\n\tvariant?: 'unstyled' | 'toolbar';\n\t/**\n\t * Whether to render the popover inline or within the slot.\n\t *\n\t * @default false\n\t */\n\tinline?: boolean;\n\t// Deprecated props\n\t/**\n\t * Prevent the popover from flipping and resizing when meeting the viewport\n\t * edges. _Note: this prop is deprecated. Instead, provide use the individual\n\t * `flip` and `resize` props._\n\t *\n\t * @deprecated\n\t */\n\t__unstableForcePosition?: boolean;\n\t/**\n\t * An object extending a `DOMRect` with an additional optional `ownerDocument`\n\t * property, used to specify a fixed popover position.\n\t *\n\t * @deprecated\n\t */\n\tanchorRect?: DomRectWithOwnerDocument;\n\t/**\n\t * Used to specify a fixed popover position. It can be an `Element`, a React\n\t * reference to an `element`, an object with a `top` and a `bottom` properties\n\t * (both pointing to elements), or a `range`.\n\t *\n\t * @deprecated\n\t */\n\tanchorRef?:\n\t\t| Element\n\t\t| PopoverAnchorRefReference\n\t\t| PopoverAnchorRefTopBottom\n\t\t| Range;\n\t/**\n\t * A function returning the same value as the one expected by the `anchorRect`\n\t * prop, used to specify a dynamic popover position.\n\t *\n\t * @deprecated\n\t */\n\tgetAnchorRect?: (\n\t\tfallbackReferenceElement: Element | null\n\t) => DomRectWithOwnerDocument;\n\t/**\n\t * Used to enable a different visual style for the popover.\n\t * _Note: this prop is deprecated. Use the `variant` prop with the\n\t * 'toolbar' value instead._\n\t *\n\t * @deprecated\n\t */\n\tisAlternate?: boolean;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/popover/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, MutableRefObject, SyntheticEvent } from 'react';\nimport type { Placement } from '@floating-ui/react-dom';\n\ntype PositionYAxis = 'top' | 'middle' | 'bottom';\ntype PositionXAxis = 'left' | 'center' | 'right';\ntype PositionCorner = 'top' | 'right' | 'bottom' | 'left';\n\ntype DomRectWithOwnerDocument = DOMRect & {\n\townerDocument?: Document;\n};\n\ntype PopoverPlacement = Placement | 'overlay';\n\nexport type PopoverAnchorRefReference = MutableRefObject<\n\tElement | null | undefined\n>;\nexport type PopoverAnchorRefTopBottom = { top: Element; bottom: Element };\n\nexport type VirtualElement = Pick< Element, 'getBoundingClientRect' > & {\n\townerDocument?: Document;\n};\n\nexport type PopoverProps = {\n\t/**\n\t * The name of the Slot in which the popover should be rendered. It should\n\t * be also passed to the corresponding `PopoverSlot` component.\n\t *\n\t * @default 'Popover'\n\t */\n\t__unstableSlotName?: string;\n\t/**\n\t * The element that should be used by the popover as its anchor. It can either\n\t * be an `Element` or, alternatively, a `VirtualElement` — ie. an object with\n\t * the `getBoundingClientRect()` and the `ownerDocument` properties defined.\n\t *\n\t * **The anchor element should be stored in local state** rather than a\n\t * plain React ref to ensure reactive updating when it changes.\n\t */\n\tanchor?: Element | VirtualElement | null;\n\t/**\n\t * Whether the popover should animate when opening.\n\t *\n\t * @default true\n\t */\n\tanimate?: boolean;\n\t/**\n\t * The `children` elements rendered as the popover's content.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Show the popover fullscreen on mobile viewports.\n\t */\n\texpandOnMobile?: boolean;\n\t/**\n\t * Specifies whether the popover should flip across its axis if there isn't\n\t * space for it in the normal placement.\n\t * When the using a 'top' placement, the popover will switch to a 'bottom'\n\t * placement. When using a 'left' placement, the popover will switch to a\n\t * `right' placement.\n\t * The popover will retain its alignment of 'start' or 'end' when flipping.\n\t *\n\t * @default true\n\t */\n\tflip?: boolean;\n\t/**\n\t * Determines whether tabbing is constrained to within the popover,\n\t * preventing keyboard focus from leaving the popover content without\n\t * explicit focus elswhere, or whether the popover remains part of the wider\n\t * tab order. If no value is passed, it will be derived from `focusOnMount`.\n\t *\n\t * @default `focusOnMount` !== false\n\t */\n\tconstrainTabbing?: boolean;\n\t/**\n\t * By default, the _first tabbable element_ in the popover will receive focus\n\t * when it mounts. This is the same as setting this prop to `\"firstElement\"`.\n\t * Specifying a `false` value disables the focus handling entirely (this\n\t * should only be done when an appropriately accessible substitute behavior\n\t * exists).\n\t *\n\t * @default 'firstElement'\n\t */\n\tfocusOnMount?: 'firstElement' | boolean;\n\t/**\n\t * A callback invoked when the focus leaves the opened popover. This should\n\t * only be provided in advanced use-cases when a popover should close under\n\t * specific circumstances (for example, if the new `document.activeElement`\n\t * is content of or otherwise controlling popover visibility).\n\t *\n\t * When not provided, the `onClose` callback will be called instead.\n\t */\n\tonFocusOutside?: ( event: SyntheticEvent ) => void;\n\t/**\n\t * Used to customize the header text shown when the popover is toggled to\n\t * fullscreen on mobile viewports (see the `expandOnMobile` prop).\n\t */\n\theaderTitle?: string;\n\t/**\n\t * Used to show/hide the arrow that points at the popover's anchor.\n\t *\n\t * @default true\n\t */\n\tnoArrow?: boolean;\n\t/**\n\t * The distance (in px) between the anchor and the popover.\n\t */\n\toffset?: number;\n\t/**\n\t * A callback invoked when the popover should be closed.\n\t */\n\tonClose?: () => void;\n\t/**\n\t * Used to specify the popover's position with respect to its anchor.\n\t *\n\t * @default 'bottom-start'\n\t */\n\tplacement?: PopoverPlacement;\n\t/**\n\t * Legacy way to specify the popover's position with respect to its anchor.\n\t * _Note: this prop is deprecated. Use the `placement` prop instead._\n\t */\n\tposition?:\n\t\t| `${ PositionYAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis }`\n\t\t| `${ PositionYAxis } ${ PositionXAxis } ${ PositionCorner }`;\n\t/**\n\t * Adjusts the size of the popover to prevent its contents from going out of\n\t * view when meeting the viewport edges.\n\t *\n\t * @default true\n\t */\n\tresize?: boolean;\n\t/**\n\t * Enables the `Popover` to shift in order to stay in view when meeting the\n\t * viewport edges.\n\t *\n\t * @default false\n\t */\n\tshift?: boolean;\n\t/**\n\t * Specifies the popover's style.\n\t *\n\t * Leave undefined for the default style. Other values are:\n\t * - 'unstyled': The popover is essentially without any visible style, it\n\t * has no background, border, outline or drop shadow, but\n\t * the popover contents are still displayed.\n\t * - 'toolbar': A style that has no elevation, but a high contrast with\n\t * other elements. This is matches the style of the\n\t * `Toolbar` component.\n\t *\n\t * @default undefined\n\t */\n\tvariant?: 'unstyled' | 'toolbar';\n\t/**\n\t * Whether to render the popover inline or within the slot.\n\t *\n\t * @default false\n\t */\n\tinline?: boolean;\n\t// Deprecated props\n\t/**\n\t * Prevent the popover from flipping and resizing when meeting the viewport\n\t * edges. _Note: this prop is deprecated. Instead, provide use the individual\n\t * `flip` and `resize` props._\n\t *\n\t * @deprecated\n\t */\n\t__unstableForcePosition?: boolean;\n\t/**\n\t * An object extending a `DOMRect` with an additional optional `ownerDocument`\n\t * property, used to specify a fixed popover position.\n\t *\n\t * @deprecated\n\t */\n\tanchorRect?: DomRectWithOwnerDocument;\n\t/**\n\t * Used to specify a fixed popover position. It can be an `Element`, a React\n\t * reference to an `element`, an object with a `top` and a `bottom` properties\n\t * (both pointing to elements), or a `range`.\n\t *\n\t * @deprecated\n\t */\n\tanchorRef?:\n\t\t| Element\n\t\t| PopoverAnchorRefReference\n\t\t| PopoverAnchorRefTopBottom\n\t\t| Range;\n\t/**\n\t * A function returning the same value as the one expected by the `anchorRect`\n\t * prop, used to specify a dynamic popover position.\n\t *\n\t * @deprecated\n\t */\n\tgetAnchorRect?: (\n\t\tfallbackReferenceElement: Element | null\n\t) => DomRectWithOwnerDocument;\n\t/**\n\t * Used to enable a different visual style for the popover.\n\t * _Note: this prop is deprecated. Use the `variant` prop with the\n\t * 'toolbar' value instead._\n\t *\n\t * @deprecated\n\t */\n\tisAlternate?: boolean;\n};\n\nexport type PopoverSlotProps = {\n\t/**\n\t * The name of the Slot in which the popover should be rendered. It should\n\t * be also passed to the corresponding `PopoverSlot` component.\n\t *\n\t * @default 'Popover'\n\t */\n\tname?: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -321,17 +321,18 @@ function UnforwardedRangeControl(props, forwardedRef) {
321
321
  * import { useState } from '@wordpress/element';
322
322
  *
323
323
  * const MyRangeControl = () => {
324
- * const [ isChecked, setChecked ] = useState( true );
324
+ * const [ value, setValue ] = useState();
325
325
  * return (
326
326
  * <RangeControl
327
327
  * __nextHasNoMarginBottom
328
328
  * __next40pxDefaultSize
329
329
  * help="Please select how transparent you would like this."
330
- * initialPosition={50}
330
+ * initialPosition={ 50 }
331
331
  * label="Opacity"
332
- * max={100}
333
- * min={0}
334
- * onChange={() => {}}
332
+ * max={ 100 }
333
+ * min={ 0 }
334
+ * value={ value }
335
+ * onChange={ setValue }
335
336
  * />
336
337
  * );
337
338
  * };
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_compose","_baseControl","_button","_icon","_utils","_utils2","_math","_inputRange","_rail","_tooltip","_rangeControlStyles","_space","_deprecated36pxSize","_jsxRuntime","noop","computeResetValue","resetFallbackValue","initialPosition","undefined","Number","isNaN","UnforwardedRangeControl","props","forwardedRef","__nextHasNoMarginBottom","afterIcon","allowReset","beforeIcon","className","color","colorProp","COLORS","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","useControlledRangeValue","initial","isResetPendent","useRef","hasTooltip","hasInputField","setShowTooltip","useState","isFocused","setIsFocused","inputRef","isCurrentlyFocused","current","matches","isThumbFocused","isValueReset","currentValue","inputSliderValue","rangeFillValue","fillValue","fillValueOffset","clamp","classes","clsx","wrapperClasses","id","useInstanceId","describedBy","enableTooltip","isFinite","handleOnRangeChange","event","nextValue","parseFloat","target","handleOnChange","next","floatClamp","handleOnInputNumberBlur","handleOnReset","resetValue","handleShowTooltip","handleHideTooltip","handleOnBlur","handleOnFocus","offsetStyle","isRTL","maybeWarnDeprecated36pxSize","componentName","size","jsx","default","__associatedWPComponentName","children","jsxs","Root","BeforeIconWrapper","icon","Wrapper","ref","useMergeRefs","Track","style","width","ThumbWrapper","Thumb","tooltipPosition","show","AfterIconWrapper","InputNumber","inputMode","__unstableInputWidth","space","ActionRightWrapper","accessibleWhenDisabled","variant","onClick","__","RangeControl","exports","forwardRef","_default"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAX,sBAAA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,IAAI,EAAGA;QACP;QAAA;QACAE,KAAK,EAAGuB,gBAAkB;QAC1BpB,iCAAiC;MAAA,CACjC,CACD,EACClC,UAAU,iBACX,IAAAb,WAAA,CAAAoG,GAAA,EAACvG,mBAAA,CAAA8H,kBAAkB;QAAApB,QAAA,eAClB,IAAAvG,WAAA,CAAAoG,GAAA,EAAC/G,OAAA,CAAAgH,OAAM;UACNtF,SAAS,EAAC;UACV;UAAA;UACA6G,sBAAsB,EAAG,CAAEtG;UAC3B;UACA;UACA;UAAA;UACAA,QAAQ,EACPA,QAAQ,IACRsB,KAAK,KACJ1C,iBAAiB,CAAE;YAClBC,kBAAkB;YAClBC;UACD,CAAE,CACH;UACDyH,OAAO,EAAC,WAAW;UACnB1B,IAAI,EAAC,OAAO;UACZ2B,OAAO,EAAGrC,aAAe;UAAAc,QAAA,EAEvB,IAAAwB,QAAE,EAAE,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;AACO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,mBAAU,EAAE1H,uBAAwB,CAAC;AAAC,IAAA2H,QAAA,GAAAF,OAAA,CAAA5B,OAAA,GAEnD2B,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_compose","_baseControl","_button","_icon","_utils","_utils2","_math","_inputRange","_rail","_tooltip","_rangeControlStyles","_space","_deprecated36pxSize","_jsxRuntime","noop","computeResetValue","resetFallbackValue","initialPosition","undefined","Number","isNaN","UnforwardedRangeControl","props","forwardedRef","__nextHasNoMarginBottom","afterIcon","allowReset","beforeIcon","className","color","colorProp","COLORS","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","useControlledRangeValue","initial","isResetPendent","useRef","hasTooltip","hasInputField","setShowTooltip","useState","isFocused","setIsFocused","inputRef","isCurrentlyFocused","current","matches","isThumbFocused","isValueReset","currentValue","inputSliderValue","rangeFillValue","fillValue","fillValueOffset","clamp","classes","clsx","wrapperClasses","id","useInstanceId","describedBy","enableTooltip","isFinite","handleOnRangeChange","event","nextValue","parseFloat","target","handleOnChange","next","floatClamp","handleOnInputNumberBlur","handleOnReset","resetValue","handleShowTooltip","handleHideTooltip","handleOnBlur","handleOnFocus","offsetStyle","isRTL","maybeWarnDeprecated36pxSize","componentName","size","jsx","default","__associatedWPComponentName","children","jsxs","Root","BeforeIconWrapper","icon","Wrapper","ref","useMergeRefs","Track","style","width","ThumbWrapper","Thumb","tooltipPosition","show","AfterIconWrapper","InputNumber","inputMode","__unstableInputWidth","space","ActionRightWrapper","accessibleWhenDisabled","variant","onClick","__","RangeControl","exports","forwardRef","_default"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,O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