@wordpress/components 19.17.0 → 20.0.1-next.d6164808d3.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 (599) hide show
  1. package/CHANGELOG.md +68 -1
  2. package/build/alignment-matrix-control/index.js +1 -1
  3. package/build/alignment-matrix-control/index.js.map +1 -1
  4. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  5. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  6. package/build/angle-picker-control/index.js +3 -0
  7. package/build/angle-picker-control/index.js.map +1 -1
  8. package/build/angle-picker-control/styles/angle-picker-control-styles.js +14 -4
  9. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  10. package/build/autocomplete/index.js +9 -11
  11. package/build/autocomplete/index.js.map +1 -1
  12. package/build/base-control/styles/base-control-styles.js +8 -8
  13. package/build/base-control/styles/base-control-styles.js.map +1 -1
  14. package/build/base-field/styles.js +5 -5
  15. package/build/base-field/styles.js.map +1 -1
  16. package/build/box-control/styles/box-control-visualizer-styles.js +8 -8
  17. package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  18. package/build/color-list-picker/index.js +16 -5
  19. package/build/color-list-picker/index.js.map +1 -1
  20. package/build/color-palette/index.js +22 -12
  21. package/build/color-palette/index.js.map +1 -1
  22. package/build/color-palette/index.native.js +3 -3
  23. package/build/color-palette/index.native.js.map +1 -1
  24. package/build/combobox-control/index.js +7 -4
  25. package/build/combobox-control/index.js.map +1 -1
  26. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  27. package/build/custom-gradient-picker/gradient-bar/constants.js.map +1 -0
  28. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +34 -41
  29. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -0
  30. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -1
  31. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -0
  32. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  33. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -0
  34. package/build/custom-gradient-picker/index.js +19 -4
  35. package/build/custom-gradient-picker/index.js.map +1 -1
  36. package/build/custom-select-control/index.js +21 -11
  37. package/build/custom-select-control/index.js.map +1 -1
  38. package/build/custom-select-control/styles.js +34 -0
  39. package/build/custom-select-control/styles.js.map +1 -0
  40. package/build/date-time/constants.js +9 -0
  41. package/build/date-time/constants.js.map +1 -0
  42. package/build/date-time/date/index.js +175 -186
  43. package/build/date-time/date/index.js.map +1 -1
  44. package/build/date-time/date/styles.js +59 -40
  45. package/build/date-time/date/styles.js.map +1 -1
  46. package/build/date-time/date-time/index.js +5 -2
  47. package/build/date-time/date-time/index.js.map +1 -1
  48. package/build/date-time/time/index.js +22 -17
  49. package/build/date-time/time/index.js.map +1 -1
  50. package/build/date-time/utils.js +27 -0
  51. package/build/date-time/utils.js.map +1 -0
  52. package/build/dimension-control/index.js +2 -6
  53. package/build/dimension-control/index.js.map +1 -1
  54. package/build/disabled/index.js +28 -11
  55. package/build/disabled/index.js.map +1 -1
  56. package/build/disabled/styles/disabled-styles.js +3 -3
  57. package/build/disabled/styles/disabled-styles.js.map +1 -1
  58. package/build/{swatch → disabled}/types.js +0 -0
  59. package/build/{swatch → disabled}/types.js.map +0 -0
  60. package/build/dropdown/index.js +5 -6
  61. package/build/dropdown/index.js.map +1 -1
  62. package/build/duotone-picker/custom-duotone-bar.js +2 -2
  63. package/build/duotone-picker/custom-duotone-bar.js.map +1 -1
  64. package/build/duotone-picker/duotone-picker.js +9 -1
  65. package/build/duotone-picker/duotone-picker.js.map +1 -1
  66. package/build/duotone-picker/duotone-swatch.js +13 -3
  67. package/build/duotone-picker/duotone-swatch.js.map +1 -1
  68. package/build/focal-point-picker/index.js +4 -6
  69. package/build/focal-point-picker/index.js.map +1 -1
  70. package/build/focal-point-picker/styles/focal-point-style.js +4 -4
  71. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  72. package/build/font-size-picker/index.js +43 -14
  73. package/build/font-size-picker/index.js.map +1 -1
  74. package/build/font-size-picker/utils.js +32 -22
  75. package/build/font-size-picker/utils.js.map +1 -1
  76. package/build/form-token-field/index.js +11 -5
  77. package/build/form-token-field/index.js.map +1 -1
  78. package/build/gradient-picker/index.js +15 -3
  79. package/build/gradient-picker/index.js.map +1 -1
  80. package/build/guide/index.js +5 -3
  81. package/build/guide/index.js.map +1 -1
  82. package/build/guide/page-control.js +3 -7
  83. package/build/guide/page-control.js.map +1 -1
  84. package/build/item-group/styles.js +10 -10
  85. package/build/item-group/styles.js.map +1 -1
  86. package/build/mobile/bottom-sheet/index.native.js +3 -6
  87. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  88. package/build/mobile/global-styles-context/utils.native.js +3 -1
  89. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  90. package/build/mobile/image/index.native.js +6 -26
  91. package/build/mobile/image/index.native.js.map +1 -1
  92. package/build/mobile/picker/index.android.js +3 -3
  93. package/build/mobile/picker/index.android.js.map +1 -1
  94. package/build/modal/index.js +1 -3
  95. package/build/modal/index.js.map +1 -1
  96. package/build/navigable-container/container.js +9 -8
  97. package/build/navigable-container/container.js.map +1 -1
  98. package/build/navigator/navigator-back-button/hook.js +0 -4
  99. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  100. package/build/navigator/navigator-button/hook.js +0 -4
  101. package/build/navigator/navigator-button/hook.js.map +1 -1
  102. package/build/notice/list.js +10 -6
  103. package/build/notice/list.js.map +1 -1
  104. package/build/palette-edit/index.js +1 -0
  105. package/build/palette-edit/index.js.map +1 -1
  106. package/build/palette-edit/styles.js +10 -10
  107. package/build/palette-edit/styles.js.map +1 -1
  108. package/build/popover/index.js +100 -97
  109. package/build/popover/index.js.map +1 -1
  110. package/build/popover/utils.js +178 -0
  111. package/build/popover/utils.js.map +1 -0
  112. package/build/range-control/index.js +3 -0
  113. package/build/range-control/index.js.map +1 -1
  114. package/build/range-control/styles/range-control-styles.js +43 -37
  115. package/build/range-control/styles/range-control-styles.js.map +1 -1
  116. package/build/select-control/chevron-down.js +30 -0
  117. package/build/select-control/chevron-down.js.map +1 -0
  118. package/build/select-control/index.js +7 -7
  119. package/build/select-control/index.js.map +1 -1
  120. package/build/select-control/styles/select-control-styles.js +30 -15
  121. package/build/select-control/styles/select-control-styles.js.map +1 -1
  122. package/build/snackbar/list.js +5 -3
  123. package/build/snackbar/list.js.map +1 -1
  124. package/build/spinner/index.js +2 -0
  125. package/build/spinner/index.js.map +1 -1
  126. package/build/text/styles.js +7 -7
  127. package/build/text/styles.js.map +1 -1
  128. package/build/toggle-group-control/toggle-group-control/component.js +16 -8
  129. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  130. package/build/toggle-group-control/toggle-group-control/styles.js +7 -5
  131. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  132. package/build/toggle-group-control/toggle-group-control-option/component.js +15 -5
  133. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  134. package/build/toggle-group-control/toggle-group-control-option-base/component.js +5 -1
  135. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  136. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +20 -7
  137. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  138. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +26 -7
  139. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  140. package/build/tools-panel/styles.js +11 -11
  141. package/build/tools-panel/styles.js.map +1 -1
  142. package/build/ui/context/context-connect.js +1 -3
  143. package/build/ui/context/context-connect.js.map +1 -1
  144. package/build/unit-control/index.js +2 -3
  145. package/build/unit-control/index.js.map +1 -1
  146. package/build/utils/colors-values.js +52 -142
  147. package/build/utils/colors-values.js.map +1 -1
  148. package/build/utils/config-values.js +1 -1
  149. package/build/utils/config-values.js.map +1 -1
  150. package/build/utils/input/input-control.js +1 -1
  151. package/build/utils/input/input-control.js.map +1 -1
  152. package/build/utils/rtl.js +6 -5
  153. package/build/utils/rtl.js.map +1 -1
  154. package/build/utils/strings.js +50 -0
  155. package/build/utils/strings.js.map +1 -0
  156. package/build-module/alignment-matrix-control/index.js +1 -1
  157. package/build-module/alignment-matrix-control/index.js.map +1 -1
  158. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  159. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  160. package/build-module/angle-picker-control/index.js +3 -0
  161. package/build-module/angle-picker-control/index.js.map +1 -1
  162. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +13 -4
  163. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  164. package/build-module/autocomplete/index.js +9 -10
  165. package/build-module/autocomplete/index.js.map +1 -1
  166. package/build-module/base-control/styles/base-control-styles.js +8 -8
  167. package/build-module/base-control/styles/base-control-styles.js.map +1 -1
  168. package/build-module/base-field/styles.js +5 -5
  169. package/build-module/base-field/styles.js.map +1 -1
  170. package/build-module/box-control/styles/box-control-visualizer-styles.js +8 -8
  171. package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  172. package/build-module/color-list-picker/index.js +13 -5
  173. package/build-module/color-list-picker/index.js.map +1 -1
  174. package/build-module/color-palette/index.js +22 -11
  175. package/build-module/color-palette/index.js.map +1 -1
  176. package/build-module/color-palette/index.native.js +4 -4
  177. package/build-module/color-palette/index.native.js.map +1 -1
  178. package/build-module/combobox-control/index.js +6 -3
  179. package/build-module/combobox-control/index.js.map +1 -1
  180. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  181. package/build-module/custom-gradient-picker/gradient-bar/constants.js.map +1 -0
  182. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +34 -41
  183. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -0
  184. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -1
  185. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -0
  186. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  187. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -0
  188. package/build-module/custom-gradient-picker/index.js +16 -3
  189. package/build-module/custom-gradient-picker/index.js.map +1 -1
  190. package/build-module/custom-select-control/index.js +20 -12
  191. package/build-module/custom-select-control/index.js.map +1 -1
  192. package/build-module/custom-select-control/styles.js +22 -0
  193. package/build-module/custom-select-control/styles.js.map +1 -0
  194. package/build-module/date-time/constants.js +2 -0
  195. package/build-module/date-time/constants.js.map +1 -0
  196. package/build-module/date-time/date/index.js +178 -184
  197. package/build-module/date-time/date/index.js.map +1 -1
  198. package/build-module/date-time/date/styles.js +47 -38
  199. package/build-module/date-time/date/styles.js.map +1 -1
  200. package/build-module/date-time/date-time/index.js +4 -2
  201. package/build-module/date-time/date-time/index.js.map +1 -1
  202. package/build-module/date-time/time/index.js +20 -16
  203. package/build-module/date-time/time/index.js.map +1 -1
  204. package/build-module/date-time/utils.js +19 -0
  205. package/build-module/date-time/utils.js.map +1 -0
  206. package/build-module/dimension-control/index.js +1 -5
  207. package/build-module/dimension-control/index.js.map +1 -1
  208. package/build-module/disabled/index.js +28 -11
  209. package/build-module/disabled/index.js.map +1 -1
  210. package/build-module/disabled/styles/disabled-styles.js +3 -3
  211. package/build-module/disabled/styles/disabled-styles.js.map +1 -1
  212. package/build-module/{swatch → disabled}/types.js +0 -0
  213. package/build-module/{swatch → disabled}/types.js.map +0 -0
  214. package/build-module/dropdown/index.js +5 -6
  215. package/build-module/dropdown/index.js.map +1 -1
  216. package/build-module/duotone-picker/custom-duotone-bar.js +1 -1
  217. package/build-module/duotone-picker/custom-duotone-bar.js.map +1 -1
  218. package/build-module/duotone-picker/duotone-picker.js +7 -1
  219. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  220. package/build-module/duotone-picker/duotone-swatch.js +11 -3
  221. package/build-module/duotone-picker/duotone-swatch.js.map +1 -1
  222. package/build-module/focal-point-picker/index.js +4 -5
  223. package/build-module/focal-point-picker/index.js.map +1 -1
  224. package/build-module/focal-point-picker/styles/focal-point-style.js +4 -4
  225. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  226. package/build-module/font-size-picker/index.js +39 -14
  227. package/build-module/font-size-picker/index.js.map +1 -1
  228. package/build-module/font-size-picker/utils.js +31 -23
  229. package/build-module/font-size-picker/utils.js.map +1 -1
  230. package/build-module/form-token-field/index.js +12 -6
  231. package/build-module/form-token-field/index.js.map +1 -1
  232. package/build-module/gradient-picker/index.js +14 -3
  233. package/build-module/gradient-picker/index.js.map +1 -1
  234. package/build-module/guide/index.js +5 -3
  235. package/build-module/guide/index.js.map +1 -1
  236. package/build-module/guide/page-control.js +3 -6
  237. package/build-module/guide/page-control.js.map +1 -1
  238. package/build-module/item-group/styles.js +10 -10
  239. package/build-module/item-group/styles.js.map +1 -1
  240. package/build-module/mobile/bottom-sheet/index.native.js +3 -5
  241. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  242. package/build-module/mobile/global-styles-context/utils.native.js +2 -1
  243. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  244. package/build-module/mobile/image/index.native.js +8 -28
  245. package/build-module/mobile/image/index.native.js.map +1 -1
  246. package/build-module/mobile/picker/index.android.js +3 -3
  247. package/build-module/mobile/picker/index.android.js.map +1 -1
  248. package/build-module/modal/index.js +1 -2
  249. package/build-module/modal/index.js.map +1 -1
  250. package/build-module/navigable-container/container.js +9 -7
  251. package/build-module/navigable-container/container.js.map +1 -1
  252. package/build-module/navigator/navigator-back-button/hook.js +0 -4
  253. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  254. package/build-module/navigator/navigator-button/hook.js +0 -4
  255. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  256. package/build-module/notice/list.js +10 -5
  257. package/build-module/notice/list.js.map +1 -1
  258. package/build-module/palette-edit/index.js +1 -0
  259. package/build-module/palette-edit/index.js.map +1 -1
  260. package/build-module/palette-edit/styles.js +10 -10
  261. package/build-module/palette-edit/styles.js.map +1 -1
  262. package/build-module/popover/index.js +100 -98
  263. package/build-module/popover/index.js.map +1 -1
  264. package/build-module/popover/utils.js +164 -0
  265. package/build-module/popover/utils.js.map +1 -0
  266. package/build-module/range-control/index.js +3 -0
  267. package/build-module/range-control/index.js.map +1 -1
  268. package/build-module/range-control/styles/range-control-styles.js +43 -37
  269. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  270. package/build-module/select-control/chevron-down.js +21 -0
  271. package/build-module/select-control/chevron-down.js.map +1 -0
  272. package/build-module/select-control/index.js +7 -7
  273. package/build-module/select-control/index.js.map +1 -1
  274. package/build-module/select-control/styles/select-control-styles.js +24 -13
  275. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  276. package/build-module/snackbar/list.js +5 -2
  277. package/build-module/snackbar/list.js.map +1 -1
  278. package/build-module/spinner/index.js +2 -0
  279. package/build-module/spinner/index.js.map +1 -1
  280. package/build-module/text/styles.js +7 -7
  281. package/build-module/text/styles.js.map +1 -1
  282. package/build-module/toggle-group-control/toggle-group-control/component.js +14 -7
  283. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  284. package/build-module/toggle-group-control/toggle-group-control/styles.js +5 -4
  285. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  286. package/build-module/toggle-group-control/toggle-group-control-option/component.js +17 -3
  287. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  288. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +5 -1
  289. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  290. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +16 -6
  291. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  292. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +27 -5
  293. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  294. package/build-module/tools-panel/styles.js +11 -11
  295. package/build-module/tools-panel/styles.js.map +1 -1
  296. package/build-module/ui/context/context-connect.js +1 -2
  297. package/build-module/ui/context/context-connect.js.map +1 -1
  298. package/build-module/unit-control/index.js +2 -2
  299. package/build-module/unit-control/index.js.map +1 -1
  300. package/build-module/utils/colors-values.js +52 -141
  301. package/build-module/utils/colors-values.js.map +1 -1
  302. package/build-module/utils/config-values.js +1 -1
  303. package/build-module/utils/config-values.js.map +1 -1
  304. package/build-module/utils/input/input-control.js +1 -1
  305. package/build-module/utils/input/input-control.js.map +1 -1
  306. package/build-module/utils/rtl.js +6 -4
  307. package/build-module/utils/rtl.js.map +1 -1
  308. package/build-module/utils/strings.js +37 -0
  309. package/build-module/utils/strings.js.map +1 -0
  310. package/build-style/style-rtl.css +176 -1227
  311. package/build-style/style.css +171 -1225
  312. package/build-types/color-palette/index.d.ts +2 -1
  313. package/build-types/color-palette/index.d.ts.map +1 -1
  314. package/build-types/color-picker/styles.d.ts +2 -2
  315. package/build-types/date-time/constants.d.ts +2 -0
  316. package/build-types/date-time/constants.d.ts.map +1 -0
  317. package/build-types/date-time/date/index.d.ts +3 -1
  318. package/build-types/date-time/date/index.d.ts.map +1 -1
  319. package/build-types/date-time/date/styles.d.ts +22 -8
  320. package/build-types/date-time/date/styles.d.ts.map +1 -1
  321. package/build-types/date-time/date/test/index.d.ts +1 -1
  322. package/build-types/date-time/date/test/index.d.ts.map +1 -1
  323. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  324. package/build-types/date-time/time/index.d.ts.map +1 -1
  325. package/build-types/date-time/utils.d.ts +8 -0
  326. package/build-types/date-time/utils.d.ts.map +1 -0
  327. package/build-types/disabled/index.d.ts +35 -28
  328. package/build-types/disabled/index.d.ts.map +1 -1
  329. package/build-types/disabled/stories/index.d.ts +13 -0
  330. package/build-types/disabled/stories/index.d.ts.map +1 -0
  331. package/build-types/disabled/styles/disabled-styles.d.ts +2 -1
  332. package/build-types/disabled/styles/disabled-styles.d.ts.map +1 -1
  333. package/build-types/disabled/test/index.d.ts +2 -0
  334. package/build-types/{flyout/flyout → disabled/test}/index.d.ts.map +1 -1
  335. package/build-types/disabled/types.d.ts +14 -0
  336. package/build-types/disabled/types.d.ts.map +1 -0
  337. package/build-types/dropdown/index.d.ts.map +1 -1
  338. package/build-types/form-token-field/index.d.ts.map +1 -1
  339. package/build-types/form-token-field/stories/index.d.ts +1 -0
  340. package/build-types/form-token-field/stories/index.d.ts.map +1 -1
  341. package/build-types/form-token-field/types.d.ts +7 -0
  342. package/build-types/form-token-field/types.d.ts.map +1 -1
  343. package/build-types/navigator/navigator-back-button/hook.d.ts +0 -3
  344. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  345. package/build-types/navigator/navigator-button/hook.d.ts +0 -3
  346. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  347. package/build-types/placeholder/test/index.d.ts +2 -0
  348. package/build-types/{flyout → placeholder/test}/index.d.ts.map +1 -1
  349. package/build-types/popover/index.d.ts +1 -1
  350. package/build-types/popover/index.d.ts.map +1 -1
  351. package/build-types/popover/utils.d.ts +26 -69
  352. package/build-types/popover/utils.d.ts.map +1 -1
  353. package/build-types/range-control/index.d.ts +2 -2
  354. package/build-types/range-control/index.d.ts.map +1 -1
  355. package/build-types/range-control/styles/range-control-styles.d.ts +5 -2
  356. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  357. package/build-types/range-control/types.d.ts +2 -2
  358. package/build-types/range-control/types.d.ts.map +1 -1
  359. package/build-types/select-control/chevron-down.d.ts +4 -0
  360. package/build-types/select-control/chevron-down.d.ts.map +1 -0
  361. package/build-types/select-control/index.d.ts.map +1 -1
  362. package/build-types/select-control/styles/select-control-styles.d.ts +8 -0
  363. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  364. package/build-types/spinner/index.d.ts.map +1 -1
  365. package/build-types/toggle-group-control/stories/index.d.ts +25 -0
  366. package/build-types/toggle-group-control/stories/index.d.ts.map +1 -0
  367. package/build-types/toggle-group-control/test/index.d.ts +2 -0
  368. package/build-types/toggle-group-control/test/index.d.ts.map +1 -0
  369. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +6 -3
  370. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  371. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -0
  372. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  373. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +6 -7
  374. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  375. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  376. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +4 -0
  377. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  378. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +11 -9
  379. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  380. package/build-types/toggle-group-control/types.d.ts +23 -10
  381. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  382. package/build-types/ui/context/context-connect.d.ts +3 -0
  383. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  384. package/build-types/ui/form-group/use-form-group.d.ts +2 -2
  385. package/build-types/unit-control/index.d.ts +2 -1
  386. package/build-types/unit-control/index.d.ts.map +1 -1
  387. package/build-types/unit-control/types.d.ts +5 -1
  388. package/build-types/unit-control/types.d.ts.map +1 -1
  389. package/build-types/utils/colors-values.d.ts +18 -97
  390. package/build-types/utils/colors-values.d.ts.map +1 -1
  391. package/build-types/utils/rtl.d.ts.map +1 -1
  392. package/build-types/utils/strings.d.ts +2 -0
  393. package/build-types/utils/strings.d.ts.map +1 -0
  394. package/package.json +22 -21
  395. package/src/alignment-matrix-control/index.js +1 -1
  396. package/src/alignment-matrix-control/stories/index.js +49 -24
  397. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +1 -3
  398. package/src/angle-picker-control/index.js +7 -1
  399. package/src/angle-picker-control/stories/index.js +8 -5
  400. package/src/angle-picker-control/styles/angle-picker-control-styles.js +12 -3
  401. package/src/autocomplete/index.js +9 -18
  402. package/src/base-control/styles/base-control-styles.ts +1 -1
  403. package/src/base-field/styles.js +1 -1
  404. package/src/base-field/test/__snapshots__/index.js.snap +2 -2
  405. package/src/box-control/styles/box-control-visualizer-styles.js +0 -1
  406. package/src/box-control/test/index.js +8 -8
  407. package/src/button/test/index.js +188 -146
  408. package/src/color-list-picker/index.js +15 -3
  409. package/src/color-list-picker/style.scss +11 -0
  410. package/src/color-palette/index.js +32 -16
  411. package/src/color-palette/index.native.js +10 -6
  412. package/src/color-palette/stories/index.js +1 -1
  413. package/src/color-palette/test/__snapshots__/index.js.snap +17 -3
  414. package/src/combobox-control/index.js +6 -5
  415. package/src/combobox-control/stories/index.js +9 -3
  416. package/src/combobox-control/style.scss +0 -1
  417. package/src/confirm-dialog/test/index.js +85 -62
  418. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  419. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +54 -50
  420. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -3
  421. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/test/utils.js +0 -0
  422. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  423. package/src/custom-gradient-picker/index.js +18 -3
  424. package/src/custom-gradient-picker/stories/index.js +4 -3
  425. package/src/custom-gradient-picker/style.scss +30 -27
  426. package/src/custom-select-control/README.md +10 -0
  427. package/src/custom-select-control/index.js +22 -16
  428. package/src/custom-select-control/stories/index.js +1 -1
  429. package/src/custom-select-control/style.scss +0 -12
  430. package/src/custom-select-control/styles.ts +28 -0
  431. package/src/custom-select-control/test/index.js +4 -1
  432. package/src/date-time/constants.ts +1 -0
  433. package/src/date-time/date/index.tsx +289 -184
  434. package/src/date-time/date/styles.ts +86 -27
  435. package/src/date-time/date/test/index.tsx +18 -28
  436. package/src/date-time/date-time/index.tsx +3 -2
  437. package/src/date-time/time/index.tsx +23 -19
  438. package/src/date-time/utils.ts +17 -0
  439. package/src/dimension-control/index.js +1 -5
  440. package/src/disabled/index.tsx +80 -0
  441. package/src/disabled/stories/index.tsx +87 -0
  442. package/src/disabled/styles/{disabled-styles.js → disabled-styles.tsx} +0 -0
  443. package/src/disabled/test/index.tsx +174 -0
  444. package/src/disabled/types.ts +13 -0
  445. package/src/dropdown/index.js +3 -5
  446. package/src/dropdown-menu/stories/index.js +13 -2
  447. package/src/duotone-picker/custom-duotone-bar.js +1 -1
  448. package/src/duotone-picker/duotone-picker.js +34 -26
  449. package/src/duotone-picker/duotone-swatch.js +12 -5
  450. package/src/duotone-picker/stories/duotone-picker.js +66 -0
  451. package/src/duotone-picker/stories/duotone-swatch.js +32 -0
  452. package/src/focal-point-picker/index.js +10 -5
  453. package/src/focal-point-picker/styles/focal-point-style.js +0 -1
  454. package/src/focal-point-picker/test/index.js +78 -45
  455. package/src/font-size-picker/index.js +161 -144
  456. package/src/font-size-picker/stories/index.js +1 -0
  457. package/src/font-size-picker/style.scss +8 -5
  458. package/src/font-size-picker/test/index.js +13 -6
  459. package/src/font-size-picker/test/{util.js → utils.js} +77 -1
  460. package/src/font-size-picker/utils.js +38 -23
  461. package/src/form-token-field/README.md +1 -0
  462. package/src/form-token-field/index.tsx +24 -10
  463. package/src/form-token-field/stories/index.tsx +8 -0
  464. package/src/form-token-field/test/index.js +31 -0
  465. package/src/form-token-field/types.ts +7 -0
  466. package/src/gradient-picker/index.js +22 -7
  467. package/src/gradient-picker/stories/index.js +56 -81
  468. package/src/guide/index.js +3 -1
  469. package/src/guide/page-control.js +1 -6
  470. package/src/guide/stories/index.js +12 -11
  471. package/src/guide/test/index.js +54 -37
  472. package/src/guide/test/page-control.js +14 -17
  473. package/src/higher-order/with-notices/test/index.js +4 -2
  474. package/src/higher-order/with-spoken-messages/test/index.js +1 -1
  475. package/src/item-group/styles.ts +3 -3
  476. package/src/menu-group/test/index.js +18 -7
  477. package/src/mobile/bottom-sheet/index.native.js +2 -4
  478. package/src/mobile/global-styles-context/utils.native.js +2 -1
  479. package/src/mobile/image/index.native.js +9 -30
  480. package/src/mobile/picker/index.android.js +10 -4
  481. package/src/mobile/picker/styles.native.scss +4 -4
  482. package/src/modal/index.js +1 -2
  483. package/src/modal/test/index.js +11 -9
  484. package/src/navigable-container/container.js +12 -18
  485. package/src/navigable-container/test/menu.js +14 -11
  486. package/src/navigator/navigator-back-button/hook.ts +0 -3
  487. package/src/navigator/navigator-button/hook.ts +0 -3
  488. package/src/notice/list.js +12 -10
  489. package/src/palette-edit/index.js +1 -0
  490. package/src/palette-edit/styles.js +6 -5
  491. package/src/placeholder/README.md +1 -1
  492. package/src/placeholder/style.scss +65 -20
  493. package/src/placeholder/test/index.tsx +174 -0
  494. package/src/popover/index.js +133 -112
  495. package/src/popover/stories/index.js +17 -3
  496. package/src/popover/test/__snapshots__/index.js.snap +6 -6
  497. package/src/popover/test/index.js +129 -36
  498. package/src/popover/utils.js +107 -0
  499. package/src/range-control/index.tsx +3 -0
  500. package/src/range-control/styles/range-control-styles.ts +9 -4
  501. package/src/range-control/types.ts +5 -2
  502. package/src/select-control/chevron-down.tsx +25 -0
  503. package/src/select-control/index.tsx +6 -9
  504. package/src/select-control/styles/select-control-styles.ts +23 -14
  505. package/src/slot-fill/test/slot.js +5 -5
  506. package/src/snackbar/list.js +3 -2
  507. package/src/spinner/index.tsx +2 -0
  508. package/src/style.scss +0 -2
  509. package/src/text/styles.js +1 -1
  510. package/src/text/test/index.tsx +1 -1
  511. package/src/toggle-group-control/stories/index.tsx +127 -0
  512. package/src/toggle-group-control/test/__snapshots__/{index.js.snap → index.tsx.snap} +28 -22
  513. package/src/toggle-group-control/test/{index.js → index.tsx} +2 -4
  514. package/src/toggle-group-control/toggle-group-control/README.md +2 -0
  515. package/src/toggle-group-control/toggle-group-control/component.tsx +18 -9
  516. package/src/toggle-group-control/toggle-group-control/styles.ts +9 -6
  517. package/src/toggle-group-control/toggle-group-control-option/component.tsx +19 -3
  518. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -0
  519. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +18 -0
  520. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +6 -8
  521. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +30 -7
  522. package/src/toggle-group-control/types.ts +74 -59
  523. package/src/toolbar/test/index.js +4 -4
  524. package/src/toolbar-group/test/index.js +9 -15
  525. package/src/tools-panel/styles.ts +2 -2
  526. package/src/tools-panel/test/index.js +3 -2
  527. package/src/tooltip/test/index.js +188 -172
  528. package/src/ui/context/context-connect.ts +3 -2
  529. package/src/unit-control/index.tsx +2 -2
  530. package/src/unit-control/types.ts +10 -1
  531. package/src/utils/colors-values.js +42 -137
  532. package/src/utils/config-values.js +1 -1
  533. package/src/utils/input/input-control.js +6 -6
  534. package/src/utils/rtl.js +6 -2
  535. package/src/utils/strings.ts +72 -0
  536. package/src/utils/test/strings.js +15 -0
  537. package/tsconfig.json +0 -1
  538. package/tsconfig.tsbuildinfo +1 -1
  539. package/build/custom-gradient-bar/constants.js.map +0 -1
  540. package/build/custom-gradient-bar/control-points.js.map +0 -1
  541. package/build/custom-gradient-bar/index.js.map +0 -1
  542. package/build/custom-gradient-bar/utils.js.map +0 -1
  543. package/build/date-time/date/utils.js +0 -34
  544. package/build/date-time/date/utils.js.map +0 -1
  545. package/build/swatch/index.js +0 -41
  546. package/build/swatch/index.js.map +0 -1
  547. package/build-module/custom-gradient-bar/constants.js.map +0 -1
  548. package/build-module/custom-gradient-bar/control-points.js.map +0 -1
  549. package/build-module/custom-gradient-bar/index.js.map +0 -1
  550. package/build-module/custom-gradient-bar/utils.js.map +0 -1
  551. package/build-module/date-time/date/utils.js +0 -22
  552. package/build-module/date-time/date/utils.js.map +0 -1
  553. package/build-module/swatch/index.js +0 -30
  554. package/build-module/swatch/index.js.map +0 -1
  555. package/build-types/color-picker/color-display.d.ts +0 -13
  556. package/build-types/color-picker/color-display.d.ts.map +0 -1
  557. package/build-types/date-time/date/test/utils.d.ts +0 -2
  558. package/build-types/date-time/date/test/utils.d.ts.map +0 -1
  559. package/build-types/date-time/date/utils.d.ts +0 -15
  560. package/build-types/date-time/date/utils.d.ts.map +0 -1
  561. package/build-types/flyout/context.d.ts +0 -6
  562. package/build-types/flyout/context.d.ts.map +0 -1
  563. package/build-types/flyout/flyout/component.d.ts +0 -21
  564. package/build-types/flyout/flyout/component.d.ts.map +0 -1
  565. package/build-types/flyout/flyout/hook.d.ts +0 -270
  566. package/build-types/flyout/flyout/hook.d.ts.map +0 -1
  567. package/build-types/flyout/flyout/index.d.ts +0 -3
  568. package/build-types/flyout/flyout-content/component.d.ts +0 -3
  569. package/build-types/flyout/flyout-content/component.d.ts.map +0 -1
  570. package/build-types/flyout/flyout-content/index.d.ts +0 -2
  571. package/build-types/flyout/flyout-content/index.d.ts.map +0 -1
  572. package/build-types/flyout/index.d.ts +0 -2
  573. package/build-types/flyout/styles.d.ts +0 -22
  574. package/build-types/flyout/styles.d.ts.map +0 -1
  575. package/build-types/flyout/types.d.ts +0 -80
  576. package/build-types/flyout/types.d.ts.map +0 -1
  577. package/build-types/flyout/utils.d.ts +0 -8
  578. package/build-types/flyout/utils.d.ts.map +0 -1
  579. package/build-types/swatch/index.d.ts +0 -5
  580. package/build-types/swatch/index.d.ts.map +0 -1
  581. package/build-types/swatch/types.d.ts +0 -11
  582. package/build-types/swatch/types.d.ts.map +0 -1
  583. package/build-types/utils/hooks/use-combined-ref.d.ts +0 -8
  584. package/build-types/utils/hooks/use-combined-ref.d.ts.map +0 -1
  585. package/src/date-time/date/datepicker.scss +0 -863
  586. package/src/date-time/date/style.scss +0 -85
  587. package/src/date-time/date/test/utils.ts +0 -32
  588. package/src/date-time/date/utils.ts +0 -20
  589. package/src/date-time/style.scss +0 -1
  590. package/src/disabled/index.js +0 -55
  591. package/src/disabled/stories/index.js +0 -61
  592. package/src/disabled/test/index.js +0 -240
  593. package/src/menu-group/test/__snapshots__/index.js.snap +0 -23
  594. package/src/placeholder/test/index.js +0 -163
  595. package/src/swatch/index.tsx +0 -22
  596. package/src/swatch/style.scss +0 -21
  597. package/src/swatch/types.ts +0 -11
  598. package/src/toggle-group-control/stories/index.js +0 -203
  599. package/src/tools-panel/test/__snapshots__/index.js.snap +0 -210
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.positionToPlacement = exports.placementToMotionAnimationProps = exports.getFrameOffset = void 0;
7
+
8
+ /**
9
+ * @typedef {import('../animate').AppearOrigin} AppearOrigin
10
+ * @typedef {import('@floating-ui/react-dom').Placement} FloatingUIPlacement
11
+ * @typedef { 'top left' | 'top center' | 'top right' | 'middle left' | 'middle center' | 'middle right' | 'bottom left' | 'bottom center' | 'bottom right' | 'bottom left' | 'bottom center' | 'bottom right' } LegacyPosition
12
+ */
13
+
14
+ /**
15
+ * Converts the `Popover`'s legacy "position" prop to the new "placement" prop
16
+ * (used by `floating-ui`).
17
+ *
18
+ * @param {LegacyPosition} position The legacy position
19
+ * @return {FloatingUIPlacement} The corresponding placement
20
+ */
21
+ const positionToPlacement = position => {
22
+ const [x, y, z] = position.split(' ');
23
+
24
+ if (['top', 'bottom'].includes(x)) {
25
+ let suffix = '';
26
+
27
+ if (!!z && z === 'left' || y === 'right') {
28
+ suffix = '-start';
29
+ } else if (!!z && z === 'right' || y === 'left') {
30
+ suffix = '-end';
31
+ } // @ts-expect-error More TypeScript effort would be required to reconcile `string` and `Placement` types.
32
+
33
+
34
+ return x + suffix;
35
+ } // @ts-expect-error More TypeScript effort would be required to reconcile `string` and `Placement` types.
36
+
37
+
38
+ return y;
39
+ };
40
+ /**
41
+ * @typedef AnimationOrigin
42
+ * @type {Object}
43
+ * @property {number} originX A number between 0 and 1 (in CSS logical properties jargon, 0 is "start", 0.5 is "center", and 1 is "end")
44
+ * @property {number} originY A number between 0 and 1 (0 is top, 0.5 is center, and 1 is bottom)
45
+ */
46
+
47
+ /** @type {Object.<FloatingUIPlacement, {originX: number, originY: number}>} */
48
+
49
+
50
+ exports.positionToPlacement = positionToPlacement;
51
+ const PLACEMENT_TO_ANIMATION_ORIGIN = {
52
+ top: {
53
+ originX: 0.5,
54
+ originY: 1
55
+ },
56
+ // open from bottom, center
57
+ 'top-start': {
58
+ originX: 0,
59
+ originY: 1
60
+ },
61
+ // open from bottom, left
62
+ 'top-end': {
63
+ originX: 1,
64
+ originY: 1
65
+ },
66
+ // open from bottom, right
67
+ right: {
68
+ originX: 0,
69
+ originY: 0.5
70
+ },
71
+ // open from middle, left
72
+ 'right-start': {
73
+ originX: 0,
74
+ originY: 0
75
+ },
76
+ // open from top, left
77
+ 'right-end': {
78
+ originX: 0,
79
+ originY: 1
80
+ },
81
+ // open from bottom, left
82
+ bottom: {
83
+ originX: 0.5,
84
+ originY: 0
85
+ },
86
+ // open from top, center
87
+ 'bottom-start': {
88
+ originX: 0,
89
+ originY: 0
90
+ },
91
+ // open from top, left
92
+ 'bottom-end': {
93
+ originX: 1,
94
+ originY: 0
95
+ },
96
+ // open from top, right
97
+ left: {
98
+ originX: 1,
99
+ originY: 0.5
100
+ },
101
+ // open from middle, right
102
+ 'left-start': {
103
+ originX: 1,
104
+ originY: 0
105
+ },
106
+ // open from top, right
107
+ 'left-end': {
108
+ originX: 1,
109
+ originY: 1
110
+ } // open from bottom, right
111
+
112
+ };
113
+ /**
114
+ * Given the floating-ui `placement`, compute the framer-motion props for the
115
+ * popover's entry animation.
116
+ *
117
+ * @param {FloatingUIPlacement} placement A placement string from floating ui
118
+ * @return {import('framer-motion').MotionProps} The object containing the motion props
119
+ */
120
+
121
+ const placementToMotionAnimationProps = placement => {
122
+ const translateProp = placement.startsWith('top') || placement.startsWith('bottom') ? 'translateY' : 'translateX';
123
+ const translateDirection = placement.startsWith('top') || placement.startsWith('left') ? 1 : -1;
124
+ return {
125
+ style: PLACEMENT_TO_ANIMATION_ORIGIN[placement],
126
+ initial: {
127
+ opacity: 0,
128
+ scale: 0,
129
+ [translateProp]: `${2 * translateDirection}em`
130
+ },
131
+ animate: {
132
+ opacity: 1,
133
+ scale: 1,
134
+ [translateProp]: 0
135
+ },
136
+ transition: {
137
+ duration: 0.1,
138
+ ease: [0, 0, 0.2, 1]
139
+ }
140
+ };
141
+ };
142
+ /**
143
+ * @typedef FrameOffset
144
+ * @type {Object}
145
+ * @property {number} x A numerical value representing the horizontal offset of the frame.
146
+ * @property {number} y A numerical value representing the vertical offset of the frame.
147
+ */
148
+
149
+ /**
150
+ * Returns the offset of a document's frame element.
151
+ *
152
+ * @param {Document} document A document. This will usually be the document within an iframe.
153
+ *
154
+ * @return {FrameOffset|undefined} The offset of the document's frame element,
155
+ * or undefined if the document has no frame element.
156
+ */
157
+
158
+
159
+ exports.placementToMotionAnimationProps = placementToMotionAnimationProps;
160
+
161
+ const getFrameOffset = document => {
162
+ var _document$defaultView;
163
+
164
+ const frameElement = document === null || document === void 0 ? void 0 : (_document$defaultView = document.defaultView) === null || _document$defaultView === void 0 ? void 0 : _document$defaultView.frameElement;
165
+
166
+ if (!frameElement) {
167
+ return;
168
+ }
169
+
170
+ const iframeRect = frameElement.getBoundingClientRect();
171
+ return {
172
+ x: iframeRect.left,
173
+ y: iframeRect.top
174
+ };
175
+ };
176
+
177
+ exports.getFrameOffset = getFrameOffset;
178
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/components/src/popover/utils.js"],"names":["positionToPlacement","position","x","y","z","split","includes","suffix","PLACEMENT_TO_ANIMATION_ORIGIN","top","originX","originY","right","bottom","left","placementToMotionAnimationProps","placement","translateProp","startsWith","translateDirection","style","initial","opacity","scale","animate","transition","duration","ease","getFrameOffset","document","frame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R,OAAEN,aAAF,GAAoB,GAAG,IAAIE,kBAAoB;AAHvC,KAFH;AAONK,IAAAA,OAAO,EAAE;AAAEF,MAAAA,OAAO,EAAE,CAAX;AAAcC,MAAAA,KAAK,EAAE,CAArB;AAAwB,OAAEN,aAAF,GAAmB;AAA3C,KAPH;AAQNQ,IAAAA,UAAU,EAAE;AAAEC,MAAAA,QAAQ,EAAE,GAAZ;AAAiBC,MAAAA,IAAI,EAAE,CAAE,CAAF,EAAK,CAAL,EAAQ,GAAR,EAAa,CAAb;AAAvB;AARN,GAAP;AAUA,CApBM;AAsBP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,cAAc,GAAKC,QAAF,IAAgB;AAAA;;AAC7C,QAAMC,YAAY,GAAGD,QAAH,aAAGA,QAAH,gDAAGA,QAAQ,CAAEE,WAAb,0DAAG,sBAAuBD,YAA5C;;AACA,MAAK,CAAEA,YAAP,EAAsB;AACrB;AACA;;AACD,QAAME,UAAU,GAAGF,YAAY,CAACG,qBAAb,EAAnB;AACA,SAAO;AAAE/B,IAAAA,CAAC,EAAE8B,UAAU,CAAClB,IAAhB;AAAsBX,IAAAA,CAAC,EAAE6B,UAAU,CAACvB;AAApC,GAAP;AACA,CAPM","sourcesContent":["/**\n * @typedef {import('../animate').AppearOrigin} AppearOrigin\n * @typedef {import('@floating-ui/react-dom').Placement} FloatingUIPlacement\n * @typedef {\t'top left' | 'top center' | 'top right' | 'middle left' | 'middle center' | 'middle right' | 'bottom left' | 'bottom center' | 'bottom right' | 'bottom left' | 'bottom center' | 'bottom right' } LegacyPosition\n */\n\n/**\n * Converts the `Popover`'s legacy \"position\" prop to the new \"placement\" prop\n * (used by `floating-ui`).\n *\n * @param {LegacyPosition} position The legacy position\n * @return {FloatingUIPlacement} The corresponding placement\n */\nexport const positionToPlacement = ( position ) => {\n\tconst [ x, y, z ] = position.split( ' ' );\n\n\tif ( [ 'top', 'bottom' ].includes( x ) ) {\n\t\tlet suffix = '';\n\t\tif ( ( !! z && z === 'left' ) || y === 'right' ) {\n\t\t\tsuffix = '-start';\n\t\t} else if ( ( !! z && z === 'right' ) || y === 'left' ) {\n\t\t\tsuffix = '-end';\n\t\t}\n\n\t\t// @ts-expect-error More TypeScript effort would be required to reconcile `string` and `Placement` types.\n\t\treturn x + suffix;\n\t}\n\n\t// @ts-expect-error More TypeScript effort would be required to reconcile `string` and `Placement` types.\n\treturn y;\n};\n\n/**\n * @typedef AnimationOrigin\n * @type {Object}\n * @property {number} originX A number between 0 and 1 (in CSS logical properties jargon, 0 is \"start\", 0.5 is \"center\", and 1 is \"end\")\n * @property {number} originY A number between 0 and 1 (0 is top, 0.5 is center, and 1 is bottom)\n */\n\n/** @type {Object.<FloatingUIPlacement, {originX: number, originY: number}>} */\nconst PLACEMENT_TO_ANIMATION_ORIGIN = {\n\ttop: { originX: 0.5, originY: 1 }, // open from bottom, center\n\t'top-start': { originX: 0, originY: 1 }, // open from bottom, left\n\t'top-end': { originX: 1, originY: 1 }, // open from bottom, right\n\tright: { originX: 0, originY: 0.5 }, // open from middle, left\n\t'right-start': { originX: 0, originY: 0 }, // open from top, left\n\t'right-end': { originX: 0, originY: 1 }, // open from bottom, left\n\tbottom: { originX: 0.5, originY: 0 }, // open from top, center\n\t'bottom-start': { originX: 0, originY: 0 }, // open from top, left\n\t'bottom-end': { originX: 1, originY: 0 }, // open from top, right\n\tleft: { originX: 1, originY: 0.5 }, // open from middle, right\n\t'left-start': { originX: 1, originY: 0 }, // open from top, right\n\t'left-end': { originX: 1, originY: 1 }, // open from bottom, right\n};\n\n/**\n * Given the floating-ui `placement`, compute the framer-motion props for the\n * popover's entry animation.\n *\n * @param {FloatingUIPlacement} placement A placement string from floating ui\n * @return {import('framer-motion').MotionProps} The object containing the motion props\n */\nexport const placementToMotionAnimationProps = ( placement ) => {\n\tconst translateProp =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'bottom' )\n\t\t\t? 'translateY'\n\t\t\t: 'translateX';\n\tconst translateDirection =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'left' )\n\t\t\t? 1\n\t\t\t: -1;\n\n\treturn {\n\t\tstyle: PLACEMENT_TO_ANIMATION_ORIGIN[ placement ],\n\t\tinitial: {\n\t\t\topacity: 0,\n\t\t\tscale: 0,\n\t\t\t[ translateProp ]: `${ 2 * translateDirection }em`,\n\t\t},\n\t\tanimate: { opacity: 1, scale: 1, [ translateProp ]: 0 },\n\t\ttransition: { duration: 0.1, ease: [ 0, 0, 0.2, 1 ] },\n\t};\n};\n\n/**\n * @typedef FrameOffset\n * @type {Object}\n * @property {number} x A numerical value representing the horizontal offset of the frame.\n * @property {number} y A numerical value representing the vertical offset of the frame.\n */\n\n/**\n * Returns the offset of a document's frame element.\n *\n * @param {Document} document A document. This will usually be the document within an iframe.\n *\n * @return {FrameOffset|undefined} The offset of the document's frame element,\n * or undefined if the document has no frame element.\n */\nexport const getFrameOffset = ( document ) => {\n\tconst frameElement = document?.defaultView?.frameElement;\n\tif ( ! frameElement ) {\n\t\treturn;\n\t}\n\tconst iframeRect = frameElement.getBoundingClientRect();\n\treturn { x: iframeRect.left, y: iframeRect.top };\n};\n"]}
@@ -54,6 +54,7 @@ function UnforwardedRangeControl(props, forwardedRef) {
54
54
  var _inputRef$current;
55
55
 
56
56
  const {
57
+ __nextHasNoMarginBottom = false,
57
58
  afterIcon,
58
59
  allowReset = false,
59
60
  beforeIcon,
@@ -199,6 +200,7 @@ function UnforwardedRangeControl(props, forwardedRef) {
199
200
  [(0, _i18n.isRTL)() ? 'right' : 'left']: fillValueOffset
200
201
  };
201
202
  return (0, _element.createElement)(_baseControl.default, {
203
+ __nextHasNoMarginBottom: __nextHasNoMarginBottom,
202
204
  className: classes,
203
205
  label: label,
204
206
  hideLabelFromVision: hideLabelFromVision,
@@ -209,6 +211,7 @@ function UnforwardedRangeControl(props, forwardedRef) {
209
211
  }, beforeIcon && (0, _element.createElement)(_rangeControlStyles.BeforeIconWrapper, null, (0, _element.createElement)(_icon.default, {
210
212
  icon: beforeIcon
211
213
  })), (0, _element.createElement)(_rangeControlStyles.Wrapper, {
214
+ __nextHasNoMarginBottom: __nextHasNoMarginBottom,
212
215
  className: wrapperClasses,
213
216
  color: colorProp,
214
217
  marks: !!marks
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/range-control/index.tsx"],"names":["noop","UnforwardedRangeControl","props","forwardedRef","afterIcon","allowReset","beforeIcon","className","color","colorProp","COLORS","ui","theme","currentInput","disabled","help","hideLabelFromVision","initialPosition","isShiftStepEnabled","label","marks","max","min","onBlur","onChange","onFocus","onMouseLeave","onMouseMove","railColor","renderTooltipContent","v","resetFallbackValue","shiftStep","showTooltip","showTooltipProp","step","trackColor","value","valueProp","withInputField","otherProps","setValue","initial","isResetPendent","hasTooltip","hasInputField","setShowTooltip","isFocused","setIsFocused","inputRef","isCurrentlyFocused","current","matches","isThumbFocused","isValueReset","currentValue","undefined","inputSliderValue","rangeFillValue","fillValue","fillValueOffset","classes","wrapperClasses","id","describedBy","enableTooltip","Number","isFinite","handleOnRangeChange","event","nextValue","parseFloat","target","handleOnChange","next","isNaN","handleOnInputNumberBlur","handleOnReset","resetValue","onChangeResetValue","handleShowTooltip","handleHideTooltip","handleOnBlur","handleOnFocus","offsetStyle","width","RangeControl"],"mappings":";;;;;;;;;AAUA;;;;AAPA;;AAMA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAzBA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AAyBA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,uBAAT,CACCC,KADD,EAMCC,YAND,EAOE;AAAA;;AACD,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,UAAU,GAAG,KAFR;AAGLC,IAAAA,UAHK;AAILC,IAAAA,SAJK;AAKLC,IAAAA,KAAK,EAAEC,SAAS,GAAG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;AACA;AACA;;;AACO,MAAMS,YAAY,GAAG,yBAAYrF,uBAAZ,CAArB;;eAEQqF,Y","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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 '../ui/context';\n\nconst noop = () => {};\n\nfunction UnforwardedRangeControl< IconProps = unknown >(\n\tprops: WordPressComponentProps<\n\t\tRangeControlProps< IconProps >,\n\t\t'input',\n\t\tfalse\n\t>,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\tafterIcon,\n\t\tallowReset = false,\n\t\tbeforeIcon,\n\t\tclassName,\n\t\tcolor: colorProp = COLORS.ui.theme,\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\tshiftStep = 10,\n\t\tshowTooltip: showTooltipProp,\n\t\tstep = 1,\n\t\ttrackColor,\n\t\tvalue: valueProp,\n\t\twithInputField = true,\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 = classnames( 'components-range-control', className );\n\n\tconst wrapperClasses = classnames(\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\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\tlet resetValue: number | null = parseFloat( `${ resetFallbackValue }` );\n\t\tlet onChangeResetValue: number | undefined = resetValue;\n\n\t\tif ( isNaN( resetValue ) ) {\n\t\t\tresetValue = null;\n\t\t\tonChangeResetValue = undefined;\n\t\t}\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( onChangeResetValue );\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\treturn (\n\t\t<BaseControl\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 className=\"components-range-control__root\">\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\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={ true }\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={ true }\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 style={ offsetStyle } disabled={ disabled }>\n\t\t\t\t\t\t<Thumb\n\t\t\t\t\t\t\taria-hidden={ true }\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\tstep={ step }\n\t\t\t\t\t\tvalue={ inputSliderValue }\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\tdisabled={ disabled || value === undefined }\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tisSmall\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 * 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"]}
1
+ {"version":3,"sources":["@wordpress/components/src/range-control/index.tsx"],"names":["noop","UnforwardedRangeControl","props","forwardedRef","__nextHasNoMarginBottom","afterIcon","allowReset","beforeIcon","className","color","colorProp","COLORS","ui","theme","currentInput","disabled","help","hideLabelFromVision","initialPosition","isShiftStepEnabled","label","marks","max","min","onBlur","onChange","onFocus","onMouseLeave","onMouseMove","railColor","renderTooltipContent","v","resetFallbackValue","shiftStep","showTooltip","showTooltipProp","step","trackColor","value","valueProp","withInputField","otherProps","setValue","initial","isResetPendent","hasTooltip","hasInputField","setShowTooltip","isFocused","setIsFocused","inputRef","isCurrentlyFocused","current","matches","isThumbFocused","isValueReset","currentValue","undefined","inputSliderValue","rangeFillValue","fillValue","fillValueOffset","classes","wrapperClasses","id","describedBy","enableTooltip","Number","isFinite","handleOnRangeChange","event","nextValue","parseFloat","target","handleOnChange","next","isNaN","handleOnInputNumberBlur","handleOnReset","resetValue","onChangeResetValue","handleShowTooltip","handleHideTooltip","handleOnBlur","handleOnFocus","offsetStyle","width","RangeControl"],"mappings":";;;;;;;;;AAUA;;;;AAPA;;AAMA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAzBA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AAyBA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,uBAAT,CACCC,KADD,EAMCC,YAND,EAOE;AAAA;;AACD,QAAM;AACLC,IAAAA,uBAAuB,GAAG,KADrB;AAELC,IAAAA,SAFK;AAGLC,IAAAA,UAAU,GAAG,KAHR;AAILC,IAAAA,UAJK;AAKLC,IAAAA,SALK;AAMLC,IAAAA,KAAK,EAAEC,SAAS,GAAGC,cAAOC,EAAP,CAAUC,KANxB;AAOLC,IAAAA,YAPK;AAQLC,IAAAA,QAAQ,GAAG,KARN;AASLC,IAAAA,IATK;AAULC,IAAAA,mBAAmB,GAAG,KAVjB;AAWLC,IAAAA,eAXK;AAYLC,IAAAA,kBAAkB,GAAG,IAZhB;AAaLC,IAAAA,KAbK;AAcLC,IAAAA,KAAK,GAAG,KAdH;AAeLC,IAAAA,GAAG,GAAG,GAfD;AAgBLC,IAAAA,GAAG,GAAG,CAhBD;AAiBLC,IAAAA,MAAM,GAAGxB,IAjBJ;AAkBLyB,IAAAA,QAAQ,GAAGzB,IAlBN;AAmBL0B,IAAAA,OAAO,GAAG1B,IAnBL;AAoBL2B,IA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,4BAAC,oCAAD,QACC,4BAAC,aAAD;AAAM,IAAA,IAAI,EAAGA;AAAb,IADD,CAnEF,EAuEGyC,aAAa,IACd,4BAAC,+BAAD;AACC,kBAAa1B,KADd;AAEC,IAAA,SAAS,EAAC,kCAFX;AAGC,IAAA,QAAQ,EAAGL,QAHZ;AAIC,IAAA,SAAS,EAAC,SAJX;AAKC,IAAA,kBAAkB,EAAGI,kBALtB;AAMC,IAAA,GAAG,EAAGG,GANP;AAOC,IAAA,GAAG,EAAGC,GAPP;AAQC,IAAA,MAAM,EAAGsD,uBARV;AASC,IAAA,QAAQ,EAAGH,cATZ;AAUC,IAAA,SAAS,EAAGzC,SAVb;AAWC,IAAA,IAAI,EAAGG,IAXR;AAYC,IAAA,KAAK,EAAGsB;AAZT,IAxEF,EAuFGpD,UAAU,IACX,4BAAC,sCAAD,QACC,4BAAC,eAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,QAAQ,EAAGS,QAAQ,IAAIuB,KAAK,KAAKmB,SAFlC;AAGC,IAAA,OAAO,EAAC,WAHT;AAIC,IAAA,OAAO,MAJR;AAKC,IAAA,OAAO,EAAGqB;AALX,KAOG,cAAI,OAAJ,CAPH,CADD,CAxFF,CARD,CADD;AAgHA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMS,YAAY,GAAG,yBAAYtF,uBAAZ,CAArB;;eAEQsF,Y","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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 '../ui/context';\n\nconst noop = () => {};\n\nfunction UnforwardedRangeControl< IconProps = unknown >(\n\tprops: WordPressComponentProps<\n\t\tRangeControlProps< IconProps >,\n\t\t'input',\n\t\tfalse\n\t>,\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.ui.theme,\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\tshiftStep = 10,\n\t\tshowTooltip: showTooltipProp,\n\t\tstep = 1,\n\t\ttrackColor,\n\t\tvalue: valueProp,\n\t\twithInputField = true,\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 = classnames( 'components-range-control', className );\n\n\tconst wrapperClasses = classnames(\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\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\tlet resetValue: number | null = parseFloat( `${ resetFallbackValue }` );\n\t\tlet onChangeResetValue: number | undefined = resetValue;\n\n\t\tif ( isNaN( resetValue ) ) {\n\t\t\tresetValue = null;\n\t\t\tonChangeResetValue = undefined;\n\t\t}\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( onChangeResetValue );\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\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\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 className=\"components-range-control__root\">\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={ true }\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={ true }\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 style={ offsetStyle } disabled={ disabled }>\n\t\t\t\t\t\t<Thumb\n\t\t\t\t\t\t\taria-hidden={ true }\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\tstep={ step }\n\t\t\t\t\t\tvalue={ inputSliderValue }\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\tdisabled={ disabled || value === undefined }\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tisSmall\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 * 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"]}