@wordpress/components 19.14.0 → 19.17.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 (1156) hide show
  1. package/CHANGELOG.md +138 -12
  2. package/build/angle-picker-control/index.js +2 -2
  3. package/build/angle-picker-control/index.js.map +1 -1
  4. package/build/autocomplete/get-default-use-items.js +5 -1
  5. package/build/autocomplete/get-default-use-items.js.map +1 -1
  6. package/build/autocomplete/index.js +5 -1
  7. package/build/autocomplete/index.js.map +1 -1
  8. package/build/base-control/index.js +6 -3
  9. package/build/base-control/index.js.map +1 -1
  10. package/build/base-control/styles/base-control-styles.js +8 -8
  11. package/build/base-control/styles/base-control-styles.js.map +1 -1
  12. package/build/border-control/border-control/component.js +38 -25
  13. package/build/border-control/border-control/component.js.map +1 -1
  14. package/build/border-control/border-control/hook.js +4 -7
  15. package/build/border-control/border-control/hook.js.map +1 -1
  16. package/build/border-control/border-control-dropdown/component.js +13 -7
  17. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  18. package/build/border-control/border-control-dropdown/hook.js +0 -4
  19. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  20. package/build/border-control/styles.js +29 -60
  21. package/build/border-control/styles.js.map +1 -1
  22. package/build/box-control/all-input-control.js +2 -27
  23. package/build/box-control/all-input-control.js.map +1 -1
  24. package/build/box-control/axial-input-controls.js +1 -1
  25. package/build/box-control/axial-input-controls.js.map +1 -1
  26. package/build/box-control/index.js +11 -6
  27. package/build/box-control/index.js.map +1 -1
  28. package/build/box-control/styles/box-control-styles.js +17 -9
  29. package/build/box-control/styles/box-control-styles.js.map +1 -1
  30. package/build/box-control/utils.js +37 -8
  31. package/build/box-control/utils.js.map +1 -1
  32. package/build/color-palette/index.js +14 -2
  33. package/build/color-palette/index.js.map +1 -1
  34. package/build/color-picker/hex-input.js +7 -5
  35. package/build/color-picker/hex-input.js.map +1 -1
  36. package/build/color-picker/index.native.js +35 -34
  37. package/build/color-picker/index.native.js.map +1 -1
  38. package/build/color-picker/input-with-slider.js +6 -3
  39. package/build/color-picker/input-with-slider.js.map +1 -1
  40. package/build/color-picker/styles.js +33 -50
  41. package/build/color-picker/styles.js.map +1 -1
  42. package/build/color-picker/use-deprecated-props.js +22 -31
  43. package/build/color-picker/use-deprecated-props.js.map +1 -1
  44. package/build/combobox-control/index.js +33 -19
  45. package/build/combobox-control/index.js.map +1 -1
  46. package/build/combobox-control/styles.js +39 -0
  47. package/build/combobox-control/styles.js.map +1 -0
  48. package/build/custom-select-control/index.js +29 -9
  49. package/build/custom-select-control/index.js.map +1 -1
  50. package/build/date-time/time/index.js +6 -2
  51. package/build/date-time/time/index.js.map +1 -1
  52. package/build/date-time/time/styles.js +17 -24
  53. package/build/date-time/time/styles.js.map +1 -1
  54. package/build/divider/component.js +0 -1
  55. package/build/divider/component.js.map +1 -1
  56. package/build/divider/index.js.map +1 -1
  57. package/build/divider/styles.js +5 -5
  58. package/build/divider/styles.js.map +1 -1
  59. package/build/dropdown/dropdown-content-wrapper.js +60 -0
  60. package/build/dropdown/dropdown-content-wrapper.js.map +1 -0
  61. package/build/dropdown/styles.js +42 -0
  62. package/build/dropdown/styles.js.map +1 -0
  63. package/build/dropdown/types.js +6 -0
  64. package/build/dropdown/types.js.map +1 -0
  65. package/build/dropdown-menu/index.js +5 -5
  66. package/build/dropdown-menu/index.js.map +1 -1
  67. package/build/dropdown-menu/index.native.js +5 -5
  68. package/build/dropdown-menu/index.native.js.map +1 -1
  69. package/build/elevation/component.js +15 -15
  70. package/build/elevation/component.js.map +1 -1
  71. package/build/elevation/hook.js +6 -18
  72. package/build/elevation/hook.js.map +1 -1
  73. package/build/elevation/index.js.map +1 -1
  74. package/build/elevation/styles.js +1 -1
  75. package/build/elevation/styles.js.map +1 -1
  76. package/build/external-link/index.js +7 -3
  77. package/build/external-link/index.js.map +1 -1
  78. package/build/flex/flex/component.js +20 -26
  79. package/build/flex/flex/component.js.map +1 -1
  80. package/build/flex/flex/hook.js +6 -16
  81. package/build/flex/flex/hook.js.map +1 -1
  82. package/build/flex/flex/index.js.map +1 -1
  83. package/build/flex/flex-block/component.js +18 -12
  84. package/build/flex/flex-block/component.js.map +1 -1
  85. package/build/flex/flex-block/hook.js +0 -4
  86. package/build/flex/flex-block/hook.js.map +1 -1
  87. package/build/flex/flex-block/index.js.map +1 -1
  88. package/build/flex/flex-item/component.js +18 -12
  89. package/build/flex/flex-item/component.js.map +1 -1
  90. package/build/flex/flex-item/hook.js +1 -5
  91. package/build/flex/flex-item/hook.js.map +1 -1
  92. package/build/flex/flex-item/index.js.map +1 -1
  93. package/build/flex/index.js.map +1 -1
  94. package/build/flex/styles.js +5 -5
  95. package/build/flex/styles.js.map +1 -1
  96. package/build/focal-point-picker/grid.js +2 -7
  97. package/build/focal-point-picker/grid.js.map +1 -1
  98. package/build/focal-point-picker/index.native.js +8 -8
  99. package/build/focal-point-picker/index.native.js.map +1 -1
  100. package/build/focal-point-picker/styles/focal-point-picker-style.js +22 -22
  101. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  102. package/build/focal-point-picker/styles/focal-point-style.js +5 -5
  103. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  104. package/build/focal-point-picker/tooltip/index.native.js +11 -12
  105. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  106. package/build/font-size-picker/index.js +15 -6
  107. package/build/font-size-picker/index.js.map +1 -1
  108. package/build/form-token-field/index.js +28 -9
  109. package/build/form-token-field/index.js.map +1 -1
  110. package/build/form-token-field/styles.js +40 -0
  111. package/build/form-token-field/styles.js.map +1 -0
  112. package/build/form-token-field/suggestions-list.js +21 -13
  113. package/build/form-token-field/suggestions-list.js.map +1 -1
  114. package/build/grid/component.js +7 -8
  115. package/build/grid/component.js.map +1 -1
  116. package/build/grid/hook.js +1 -5
  117. package/build/grid/hook.js.map +1 -1
  118. package/build/grid/index.js.map +1 -1
  119. package/build/grid/utils.js +4 -7
  120. package/build/grid/utils.js.map +1 -1
  121. package/build/h-stack/component.js +5 -9
  122. package/build/h-stack/component.js.map +1 -1
  123. package/build/h-stack/hook.js +8 -10
  124. package/build/h-stack/hook.js.map +1 -1
  125. package/build/h-stack/index.js.map +1 -1
  126. package/build/h-stack/utils.js +7 -18
  127. package/build/h-stack/utils.js.map +1 -1
  128. package/build/icon/index.js.map +1 -1
  129. package/build/index.js +31 -1
  130. package/build/index.js.map +1 -1
  131. package/build/input-control/index.js +7 -0
  132. package/build/input-control/index.js.map +1 -1
  133. package/build/input-control/input-base.js +24 -3
  134. package/build/input-control/input-base.js.map +1 -1
  135. package/build/input-control/input-prefix-wrapper.js +54 -0
  136. package/build/input-control/input-prefix-wrapper.js.map +1 -0
  137. package/build/input-control/input-suffix-wrapper.js +54 -0
  138. package/build/input-control/input-suffix-wrapper.js.map +1 -0
  139. package/build/input-control/reducer/actions.js +3 -1
  140. package/build/input-control/reducer/actions.js.map +1 -1
  141. package/build/input-control/reducer/reducer.js +28 -11
  142. package/build/input-control/reducer/reducer.js.map +1 -1
  143. package/build/input-control/reducer/state.js.map +1 -1
  144. package/build/input-control/styles/input-control-styles.js +61 -42
  145. package/build/input-control/styles/input-control-styles.js.map +1 -1
  146. package/build/menu-item/index.js +1 -3
  147. package/build/menu-item/index.js.map +1 -1
  148. package/build/mobile/focal-point-settings-panel/index.native.js +1 -1
  149. package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  150. package/build/mobile/global-styles-context/utils.native.js +23 -3
  151. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  152. package/build/mobile/image/index.native.js +31 -5
  153. package/build/mobile/image/index.native.js.map +1 -1
  154. package/build/mobile/link-picker/link-picker-screen.native.js +10 -4
  155. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  156. package/build/mobile/media-edit/index.native.js +1 -7
  157. package/build/mobile/media-edit/index.native.js.map +1 -1
  158. package/build/mobile/picker/index.ios.js +16 -3
  159. package/build/mobile/picker/index.ios.js.map +1 -1
  160. package/build/modal/index.js +17 -3
  161. package/build/modal/index.js.map +1 -1
  162. package/build/navigation/index.js +4 -1
  163. package/build/navigation/index.js.map +1 -1
  164. package/build/navigation/item/base.js +3 -0
  165. package/build/navigation/item/base.js.map +1 -1
  166. package/build/placeholder/index.js +11 -14
  167. package/build/placeholder/index.js.map +1 -1
  168. package/build/placeholder/types.js +6 -0
  169. package/build/placeholder/types.js.map +1 -0
  170. package/build/popover/index.js +129 -75
  171. package/build/popover/index.js.map +1 -1
  172. package/build/radio-control/index.js +1 -3
  173. package/build/radio-control/index.js.map +1 -1
  174. package/build/range-control/index.js +54 -40
  175. package/build/range-control/index.js.map +1 -1
  176. package/build/range-control/input-range.js +5 -7
  177. package/build/range-control/input-range.js.map +1 -1
  178. package/build/range-control/mark.js +5 -7
  179. package/build/range-control/mark.js.map +1 -1
  180. package/build/range-control/rail.js +10 -16
  181. package/build/range-control/rail.js.map +1 -1
  182. package/build/range-control/styles/range-control-styles.js +74 -74
  183. package/build/range-control/styles/range-control-styles.js.map +1 -1
  184. package/build/range-control/tooltip.js +5 -7
  185. package/build/range-control/tooltip.js.map +1 -1
  186. package/build/range-control/types.js +6 -0
  187. package/build/range-control/types.js.map +1 -0
  188. package/build/range-control/utils.js +23 -30
  189. package/build/range-control/utils.js.map +1 -1
  190. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  191. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  192. package/build/resizable-box/resize-tooltip/utils.js +2 -7
  193. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  194. package/build/sandbox/index.native.js +13 -2
  195. package/build/sandbox/index.native.js.map +1 -1
  196. package/build/scroll-lock/index.js +35 -6
  197. package/build/scroll-lock/index.js.map +1 -1
  198. package/build/scrollable/component.js +7 -8
  199. package/build/scrollable/component.js.map +1 -1
  200. package/build/scrollable/hook.js +0 -8
  201. package/build/scrollable/hook.js.map +1 -1
  202. package/build/scrollable/index.js.map +1 -1
  203. package/build/scrollable/styles.js +7 -7
  204. package/build/scrollable/styles.js.map +1 -1
  205. package/build/select-control/index.js +1 -3
  206. package/build/select-control/index.js.map +1 -1
  207. package/build/select-control/styles/select-control-styles.js +32 -12
  208. package/build/select-control/styles/select-control-styles.js.map +1 -1
  209. package/build/shortcut/index.js +6 -21
  210. package/build/shortcut/index.js.map +1 -1
  211. package/build/shortcut/types.js +6 -0
  212. package/build/shortcut/types.js.map +1 -0
  213. package/build/slot-fill/index.native.js +6 -8
  214. package/build/slot-fill/index.native.js.map +1 -1
  215. package/build/slot-fill/provider.js +4 -8
  216. package/build/slot-fill/provider.js.map +1 -1
  217. package/build/slot-fill/slot.js +4 -8
  218. package/build/slot-fill/slot.js.map +1 -1
  219. package/build/spacer/component.js +3 -1
  220. package/build/spacer/component.js.map +1 -1
  221. package/build/spacer/hook.js +2 -2
  222. package/build/spacer/hook.js.map +1 -1
  223. package/build/spacer/index.js.map +1 -1
  224. package/build/style-provider/index.js +10 -7
  225. package/build/style-provider/index.js.map +1 -1
  226. package/build/style-provider/types.js +6 -0
  227. package/build/style-provider/types.js.map +1 -0
  228. package/build/swatch/index.js +2 -0
  229. package/build/swatch/index.js.map +1 -1
  230. package/build/swatch/types.js +6 -0
  231. package/build/swatch/types.js.map +1 -0
  232. package/build/text/hook.js +5 -8
  233. package/build/text/hook.js.map +1 -1
  234. package/build/text-highlight/index.js +22 -5
  235. package/build/text-highlight/index.js.map +1 -1
  236. package/build/text-highlight/types.js +6 -0
  237. package/build/text-highlight/types.js.map +1 -0
  238. package/build/tip/index.js +5 -11
  239. package/build/tip/index.js.map +1 -1
  240. package/build/tip/types.js +6 -0
  241. package/build/tip/types.js.map +1 -0
  242. package/build/toggle-group-control/toggle-group-control/component.js +4 -1
  243. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  244. package/build/toggle-group-control/toggle-group-control/styles.js +20 -4
  245. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  246. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +7 -9
  247. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  248. package/build/toolbar-group/index.js +3 -3
  249. package/build/toolbar-group/index.js.map +1 -1
  250. package/build/tools-panel/styles.js +13 -10
  251. package/build/tools-panel/styles.js.map +1 -1
  252. package/build/tools-panel/tools-panel/hook.js +1 -1
  253. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  254. package/build/tooltip/index.js +51 -14
  255. package/build/tooltip/index.js.map +1 -1
  256. package/build/tree-select/index.js +4 -4
  257. package/build/tree-select/index.js.map +1 -1
  258. package/build/ui/context/use-context-system.js +7 -2
  259. package/build/ui/context/use-context-system.js.map +1 -1
  260. package/build/ui/tooltip/styles.js +4 -4
  261. package/build/ui/tooltip/styles.js.map +1 -1
  262. package/build/ui/utils/get-valid-children.js.map +1 -1
  263. package/build/ui/utils/space.js +7 -1
  264. package/build/ui/utils/space.js.map +1 -1
  265. package/build/unit-control/styles/unit-control-styles.js +38 -29
  266. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  267. package/build/utils/base-label.js +24 -0
  268. package/build/utils/base-label.js.map +1 -0
  269. package/build/utils/box-sizing.js +22 -0
  270. package/build/utils/box-sizing.js.map +1 -0
  271. package/build/utils/style-mixins.js +16 -0
  272. package/build/utils/style-mixins.js.map +1 -1
  273. package/build/visually-hidden/component.js +12 -13
  274. package/build/visually-hidden/component.js.map +1 -1
  275. package/build/visually-hidden/index.js.map +1 -1
  276. package/build/visually-hidden/styles.js +3 -1
  277. package/build/visually-hidden/styles.js.map +1 -1
  278. package/build/visually-hidden/types.js +6 -0
  279. package/build/visually-hidden/types.js.map +1 -0
  280. package/build-module/angle-picker-control/index.js +2 -2
  281. package/build-module/angle-picker-control/index.js.map +1 -1
  282. package/build-module/autocomplete/get-default-use-items.js +3 -2
  283. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  284. package/build-module/autocomplete/index.js +3 -2
  285. package/build-module/autocomplete/index.js.map +1 -1
  286. package/build-module/base-control/index.js +7 -5
  287. package/build-module/base-control/index.js.map +1 -1
  288. package/build-module/base-control/styles/base-control-styles.js +9 -9
  289. package/build-module/base-control/styles/base-control-styles.js.map +1 -1
  290. package/build-module/border-control/border-control/component.js +37 -25
  291. package/build-module/border-control/border-control/component.js.map +1 -1
  292. package/build-module/border-control/border-control/hook.js +4 -7
  293. package/build-module/border-control/border-control/hook.js.map +1 -1
  294. package/build-module/border-control/border-control-dropdown/component.js +12 -7
  295. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  296. package/build-module/border-control/border-control-dropdown/hook.js +0 -4
  297. package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
  298. package/build-module/border-control/styles.js +30 -54
  299. package/build-module/border-control/styles.js.map +1 -1
  300. package/build-module/box-control/all-input-control.js +3 -28
  301. package/build-module/box-control/all-input-control.js.map +1 -1
  302. package/build-module/box-control/axial-input-controls.js +1 -1
  303. package/build-module/box-control/axial-input-controls.js.map +1 -1
  304. package/build-module/box-control/index.js +5 -5
  305. package/build-module/box-control/index.js.map +1 -1
  306. package/build-module/box-control/styles/box-control-styles.js +18 -10
  307. package/build-module/box-control/styles/box-control-styles.js.map +1 -1
  308. package/build-module/box-control/utils.js +35 -7
  309. package/build-module/box-control/utils.js.map +1 -1
  310. package/build-module/color-palette/index.js +10 -1
  311. package/build-module/color-palette/index.js.map +1 -1
  312. package/build-module/color-picker/hex-input.js +6 -4
  313. package/build-module/color-picker/hex-input.js.map +1 -1
  314. package/build-module/color-picker/index.native.js +36 -35
  315. package/build-module/color-picker/index.native.js.map +1 -1
  316. package/build-module/color-picker/input-with-slider.js +6 -3
  317. package/build-module/color-picker/input-with-slider.js.map +1 -1
  318. package/build-module/color-picker/styles.js +25 -48
  319. package/build-module/color-picker/styles.js.map +1 -1
  320. package/build-module/color-picker/use-deprecated-props.js +22 -31
  321. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  322. package/build-module/combobox-control/index.js +32 -19
  323. package/build-module/combobox-control/index.js.map +1 -1
  324. package/build-module/combobox-control/styles.js +27 -0
  325. package/build-module/combobox-control/styles.js.map +1 -0
  326. package/build-module/custom-select-control/index.js +28 -11
  327. package/build-module/custom-select-control/index.js.map +1 -1
  328. package/build-module/date-time/time/index.js +6 -3
  329. package/build-module/date-time/time/index.js.map +1 -1
  330. package/build-module/date-time/time/styles.js +15 -21
  331. package/build-module/date-time/time/styles.js.map +1 -1
  332. package/build-module/divider/component.js +0 -1
  333. package/build-module/divider/component.js.map +1 -1
  334. package/build-module/divider/index.js.map +1 -1
  335. package/build-module/divider/styles.js +5 -5
  336. package/build-module/divider/styles.js.map +1 -1
  337. package/build-module/dropdown/dropdown-content-wrapper.js +47 -0
  338. package/build-module/dropdown/dropdown-content-wrapper.js.map +1 -0
  339. package/build-module/dropdown/styles.js +31 -0
  340. package/build-module/dropdown/styles.js.map +1 -0
  341. package/build-module/dropdown/types.js +2 -0
  342. package/build-module/dropdown/types.js.map +1 -0
  343. package/build-module/dropdown-menu/index.js +5 -4
  344. package/build-module/dropdown-menu/index.js.map +1 -1
  345. package/build-module/dropdown-menu/index.native.js +5 -4
  346. package/build-module/dropdown-menu/index.native.js.map +1 -1
  347. package/build-module/elevation/component.js +15 -15
  348. package/build-module/elevation/component.js.map +1 -1
  349. package/build-module/elevation/hook.js +6 -18
  350. package/build-module/elevation/hook.js.map +1 -1
  351. package/build-module/elevation/index.js.map +1 -1
  352. package/build-module/elevation/styles.js +1 -1
  353. package/build-module/elevation/styles.js.map +1 -1
  354. package/build-module/external-link/index.js +7 -2
  355. package/build-module/external-link/index.js.map +1 -1
  356. package/build-module/flex/flex/component.js +20 -26
  357. package/build-module/flex/flex/component.js.map +1 -1
  358. package/build-module/flex/flex/hook.js +6 -15
  359. package/build-module/flex/flex/hook.js.map +1 -1
  360. package/build-module/flex/flex/index.js.map +1 -1
  361. package/build-module/flex/flex-block/component.js +18 -12
  362. package/build-module/flex/flex-block/component.js.map +1 -1
  363. package/build-module/flex/flex-block/hook.js +0 -4
  364. package/build-module/flex/flex-block/hook.js.map +1 -1
  365. package/build-module/flex/flex-block/index.js.map +1 -1
  366. package/build-module/flex/flex-item/component.js +18 -12
  367. package/build-module/flex/flex-item/component.js.map +1 -1
  368. package/build-module/flex/flex-item/hook.js +1 -5
  369. package/build-module/flex/flex-item/hook.js.map +1 -1
  370. package/build-module/flex/flex-item/index.js.map +1 -1
  371. package/build-module/flex/index.js.map +1 -1
  372. package/build-module/flex/styles.js +5 -5
  373. package/build-module/flex/styles.js.map +1 -1
  374. package/build-module/focal-point-picker/grid.js +2 -6
  375. package/build-module/focal-point-picker/grid.js.map +1 -1
  376. package/build-module/focal-point-picker/index.native.js +8 -8
  377. package/build-module/focal-point-picker/index.native.js.map +1 -1
  378. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +22 -22
  379. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  380. package/build-module/focal-point-picker/styles/focal-point-style.js +5 -5
  381. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  382. package/build-module/focal-point-picker/tooltip/index.native.js +11 -12
  383. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  384. package/build-module/font-size-picker/index.js +14 -6
  385. package/build-module/font-size-picker/index.js.map +1 -1
  386. package/build-module/form-token-field/index.js +25 -8
  387. package/build-module/form-token-field/index.js.map +1 -1
  388. package/build-module/form-token-field/styles.js +28 -0
  389. package/build-module/form-token-field/styles.js.map +1 -0
  390. package/build-module/form-token-field/suggestions-list.js +21 -13
  391. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  392. package/build-module/grid/component.js +7 -8
  393. package/build-module/grid/component.js.map +1 -1
  394. package/build-module/grid/hook.js +1 -5
  395. package/build-module/grid/hook.js.map +1 -1
  396. package/build-module/grid/index.js.map +1 -1
  397. package/build-module/grid/utils.js +3 -8
  398. package/build-module/grid/utils.js.map +1 -1
  399. package/build-module/h-stack/component.js +3 -7
  400. package/build-module/h-stack/component.js.map +1 -1
  401. package/build-module/h-stack/hook.js +10 -12
  402. package/build-module/h-stack/hook.js.map +1 -1
  403. package/build-module/h-stack/index.js.map +1 -1
  404. package/build-module/h-stack/utils.js +7 -19
  405. package/build-module/h-stack/utils.js.map +1 -1
  406. package/build-module/icon/index.js.map +1 -1
  407. package/build-module/index.js +4 -1
  408. package/build-module/index.js.map +1 -1
  409. package/build-module/input-control/index.js +6 -0
  410. package/build-module/input-control/index.js.map +1 -1
  411. package/build-module/input-control/input-base.js +25 -5
  412. package/build-module/input-control/input-base.js.map +1 -1
  413. package/build-module/input-control/input-prefix-wrapper.js +41 -0
  414. package/build-module/input-control/input-prefix-wrapper.js.map +1 -0
  415. package/build-module/input-control/input-suffix-wrapper.js +41 -0
  416. package/build-module/input-control/input-suffix-wrapper.js.map +1 -0
  417. package/build-module/input-control/reducer/actions.js +1 -0
  418. package/build-module/input-control/reducer/actions.js.map +1 -1
  419. package/build-module/input-control/reducer/reducer.js +28 -11
  420. package/build-module/input-control/reducer/reducer.js.map +1 -1
  421. package/build-module/input-control/reducer/state.js.map +1 -1
  422. package/build-module/input-control/styles/input-control-styles.js +58 -42
  423. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  424. package/build-module/menu-item/index.js +1 -2
  425. package/build-module/menu-item/index.js.map +1 -1
  426. package/build-module/mobile/focal-point-settings-panel/index.native.js +2 -2
  427. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  428. package/build-module/mobile/global-styles-context/utils.native.js +23 -4
  429. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  430. package/build-module/mobile/image/index.native.js +33 -8
  431. package/build-module/mobile/image/index.native.js.map +1 -1
  432. package/build-module/mobile/link-picker/link-picker-screen.native.js +11 -4
  433. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  434. package/build-module/mobile/media-edit/index.native.js +1 -6
  435. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  436. package/build-module/mobile/picker/index.ios.js +14 -3
  437. package/build-module/mobile/picker/index.ios.js.map +1 -1
  438. package/build-module/modal/index.js +19 -5
  439. package/build-module/modal/index.js.map +1 -1
  440. package/build-module/navigation/index.js +4 -1
  441. package/build-module/navigation/index.js.map +1 -1
  442. package/build-module/navigation/item/base.js +3 -0
  443. package/build-module/navigation/item/base.js.map +1 -1
  444. package/build-module/placeholder/index.js +10 -15
  445. package/build-module/placeholder/index.js.map +1 -1
  446. package/build-module/placeholder/types.js +2 -0
  447. package/build-module/placeholder/types.js.map +1 -0
  448. package/build-module/popover/index.js +128 -75
  449. package/build-module/popover/index.js.map +1 -1
  450. package/build-module/radio-control/index.js +1 -2
  451. package/build-module/radio-control/index.js.map +1 -1
  452. package/build-module/range-control/index.js +54 -40
  453. package/build-module/range-control/index.js.map +1 -1
  454. package/build-module/range-control/input-range.js +5 -6
  455. package/build-module/range-control/input-range.js.map +1 -1
  456. package/build-module/range-control/mark.js +5 -6
  457. package/build-module/range-control/mark.js.map +1 -1
  458. package/build-module/range-control/rail.js +10 -15
  459. package/build-module/range-control/rail.js.map +1 -1
  460. package/build-module/range-control/styles/range-control-styles.js +74 -76
  461. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  462. package/build-module/range-control/tooltip.js +5 -6
  463. package/build-module/range-control/tooltip.js.map +1 -1
  464. package/build-module/range-control/types.js +2 -0
  465. package/build-module/range-control/types.js.map +1 -0
  466. package/build-module/range-control/utils.js +23 -30
  467. package/build-module/range-control/utils.js.map +1 -1
  468. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  469. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  470. package/build-module/resizable-box/resize-tooltip/utils.js +2 -6
  471. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  472. package/build-module/sandbox/index.native.js +13 -3
  473. package/build-module/sandbox/index.native.js.map +1 -1
  474. package/build-module/scroll-lock/index.js +32 -6
  475. package/build-module/scroll-lock/index.js.map +1 -1
  476. package/build-module/scrollable/component.js +7 -8
  477. package/build-module/scrollable/component.js.map +1 -1
  478. package/build-module/scrollable/hook.js +0 -8
  479. package/build-module/scrollable/hook.js.map +1 -1
  480. package/build-module/scrollable/index.js.map +1 -1
  481. package/build-module/scrollable/styles.js +7 -7
  482. package/build-module/scrollable/styles.js.map +1 -1
  483. package/build-module/select-control/index.js +1 -2
  484. package/build-module/select-control/index.js.map +1 -1
  485. package/build-module/select-control/styles/select-control-styles.js +32 -12
  486. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  487. package/build-module/shortcut/index.js +6 -20
  488. package/build-module/shortcut/index.js.map +1 -1
  489. package/build-module/shortcut/types.js +2 -0
  490. package/build-module/shortcut/types.js.map +1 -0
  491. package/build-module/slot-fill/index.native.js +6 -7
  492. package/build-module/slot-fill/index.native.js.map +1 -1
  493. package/build-module/slot-fill/provider.js +4 -7
  494. package/build-module/slot-fill/provider.js.map +1 -1
  495. package/build-module/slot-fill/slot.js +4 -7
  496. package/build-module/slot-fill/slot.js.map +1 -1
  497. package/build-module/spacer/component.js +3 -1
  498. package/build-module/spacer/component.js.map +1 -1
  499. package/build-module/spacer/hook.js +2 -2
  500. package/build-module/spacer/hook.js.map +1 -1
  501. package/build-module/spacer/index.js.map +1 -1
  502. package/build-module/style-provider/index.js +10 -5
  503. package/build-module/style-provider/index.js.map +1 -1
  504. package/build-module/style-provider/types.js +2 -0
  505. package/build-module/style-provider/types.js.map +1 -0
  506. package/build-module/swatch/index.js +2 -0
  507. package/build-module/swatch/index.js.map +1 -1
  508. package/build-module/swatch/types.js +2 -0
  509. package/build-module/swatch/types.js.map +1 -0
  510. package/build-module/text/hook.js +5 -7
  511. package/build-module/text/hook.js.map +1 -1
  512. package/build-module/text-highlight/index.js +23 -6
  513. package/build-module/text-highlight/index.js.map +1 -1
  514. package/build-module/text-highlight/types.js +2 -0
  515. package/build-module/text-highlight/types.js.map +1 -0
  516. package/build-module/tip/index.js +6 -10
  517. package/build-module/tip/index.js.map +1 -1
  518. package/build-module/tip/types.js +2 -0
  519. package/build-module/tip/types.js.map +1 -0
  520. package/build-module/toggle-group-control/toggle-group-control/component.js +4 -1
  521. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  522. package/build-module/toggle-group-control/toggle-group-control/styles.js +15 -3
  523. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  524. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +6 -7
  525. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  526. package/build-module/toolbar-group/index.js +3 -2
  527. package/build-module/toolbar-group/index.js.map +1 -1
  528. package/build-module/tools-panel/styles.js +12 -11
  529. package/build-module/tools-panel/styles.js.map +1 -1
  530. package/build-module/tools-panel/tools-panel/hook.js +1 -1
  531. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  532. package/build-module/tooltip/index.js +53 -16
  533. package/build-module/tooltip/index.js.map +1 -1
  534. package/build-module/tree-select/index.js +5 -5
  535. package/build-module/tree-select/index.js.map +1 -1
  536. package/build-module/ui/context/use-context-system.js +7 -2
  537. package/build-module/ui/context/use-context-system.js.map +1 -1
  538. package/build-module/ui/tooltip/styles.js +4 -4
  539. package/build-module/ui/tooltip/styles.js.map +1 -1
  540. package/build-module/ui/utils/get-valid-children.js.map +1 -1
  541. package/build-module/ui/utils/space.js +7 -1
  542. package/build-module/ui/utils/space.js.map +1 -1
  543. package/build-module/unit-control/styles/unit-control-styles.js +39 -30
  544. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  545. package/build-module/utils/base-label.js +18 -0
  546. package/build-module/utils/base-label.js.map +1 -0
  547. package/build-module/utils/box-sizing.js +16 -0
  548. package/build-module/utils/box-sizing.js.map +1 -0
  549. package/build-module/utils/style-mixins.js +2 -0
  550. package/build-module/utils/style-mixins.js.map +1 -1
  551. package/build-module/visually-hidden/component.js +12 -13
  552. package/build-module/visually-hidden/component.js.map +1 -1
  553. package/build-module/visually-hidden/index.js.map +1 -1
  554. package/build-module/visually-hidden/styles.js +3 -1
  555. package/build-module/visually-hidden/styles.js.map +1 -1
  556. package/build-module/visually-hidden/types.js +2 -0
  557. package/build-module/visually-hidden/types.js.map +1 -0
  558. package/build-style/style-rtl.css +75 -75
  559. package/build-style/style.css +77 -73
  560. package/build-types/base-control/index.d.ts +4 -3
  561. package/build-types/base-control/index.d.ts.map +1 -1
  562. package/build-types/base-control/stories/index.d.ts +1 -1
  563. package/build-types/base-control/stories/index.d.ts.map +1 -1
  564. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  565. package/build-types/base-control/types.d.ts +0 -1
  566. package/build-types/base-control/types.d.ts.map +1 -1
  567. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  568. package/build-types/border-control/border-control/hook.d.ts +2 -2
  569. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  570. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  571. package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
  572. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  573. package/build-types/border-control/stories/index.d.ts.map +1 -1
  574. package/build-types/border-control/styles.d.ts +1 -4
  575. package/build-types/border-control/styles.d.ts.map +1 -1
  576. package/build-types/card/card-divider/hook.d.ts +1 -1
  577. package/build-types/color-palette/index.d.ts +1 -0
  578. package/build-types/color-palette/index.d.ts.map +1 -1
  579. package/build-types/color-picker/color-display.d.ts +13 -0
  580. package/build-types/color-picker/color-display.d.ts.map +1 -0
  581. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  582. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  583. package/build-types/color-picker/styles.d.ts +30 -31
  584. package/build-types/color-picker/styles.d.ts.map +1 -1
  585. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
  586. package/build-types/date-time/time/index.d.ts.map +1 -1
  587. package/build-types/date-time/time/styles.d.ts +0 -4
  588. package/build-types/date-time/time/styles.d.ts.map +1 -1
  589. package/build-types/divider/component.d.ts +2 -3
  590. package/build-types/divider/component.d.ts.map +1 -1
  591. package/build-types/divider/index.d.ts +1 -1
  592. package/build-types/divider/index.d.ts.map +1 -1
  593. package/build-types/divider/styles.d.ts +6 -2
  594. package/build-types/divider/styles.d.ts.map +1 -1
  595. package/build-types/divider/test/index.d.ts +2 -0
  596. package/build-types/divider/test/index.d.ts.map +1 -0
  597. package/build-types/divider/types.d.ts +18 -10
  598. package/build-types/divider/types.d.ts.map +1 -1
  599. package/build-types/dropdown/dropdown-content-wrapper.d.ts +23 -0
  600. package/build-types/dropdown/dropdown-content-wrapper.d.ts.map +1 -0
  601. package/build-types/dropdown/styles.d.ts +7 -0
  602. package/build-types/dropdown/styles.d.ts.map +1 -0
  603. package/build-types/dropdown/types.d.ts +9 -0
  604. package/build-types/dropdown/types.d.ts.map +1 -0
  605. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  606. package/build-types/elevation/component.d.ts +11 -10
  607. package/build-types/elevation/component.d.ts.map +1 -1
  608. package/build-types/elevation/hook.d.ts +6 -7
  609. package/build-types/elevation/hook.d.ts.map +1 -1
  610. package/build-types/elevation/index.d.ts +2 -2
  611. package/build-types/elevation/index.d.ts.map +1 -1
  612. package/build-types/elevation/stories/index.d.ts +22 -0
  613. package/build-types/elevation/stories/index.d.ts.map +1 -0
  614. package/build-types/elevation/styles.d.ts +1 -1
  615. package/build-types/elevation/styles.d.ts.map +1 -1
  616. package/build-types/elevation/test/index.d.ts +2 -0
  617. package/build-types/elevation/test/index.d.ts.map +1 -0
  618. package/build-types/elevation/types.d.ts +12 -19
  619. package/build-types/elevation/types.d.ts.map +1 -1
  620. package/build-types/external-link/index.d.ts.map +1 -1
  621. package/build-types/flex/flex/component.d.ts +16 -21
  622. package/build-types/flex/flex/component.d.ts.map +1 -1
  623. package/build-types/flex/flex/hook.d.ts +5 -2
  624. package/build-types/flex/flex/hook.d.ts.map +1 -1
  625. package/build-types/flex/flex/index.d.ts +2 -2
  626. package/build-types/flex/flex/index.d.ts.map +1 -1
  627. package/build-types/flex/flex-block/component.d.ts +14 -7
  628. package/build-types/flex/flex-block/component.d.ts.map +1 -1
  629. package/build-types/flex/flex-block/hook.d.ts +6 -3
  630. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  631. package/build-types/flex/flex-block/index.d.ts +2 -2
  632. package/build-types/flex/flex-block/index.d.ts.map +1 -1
  633. package/build-types/flex/flex-item/component.d.ts +14 -7
  634. package/build-types/flex/flex-item/component.d.ts.map +1 -1
  635. package/build-types/flex/flex-item/hook.d.ts +6 -3
  636. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  637. package/build-types/flex/flex-item/index.d.ts +2 -2
  638. package/build-types/flex/flex-item/index.d.ts.map +1 -1
  639. package/build-types/flex/index.d.ts +3 -3
  640. package/build-types/flex/index.d.ts.map +1 -1
  641. package/build-types/flex/stories/index.d.ts +13 -0
  642. package/build-types/flex/stories/index.d.ts.map +1 -0
  643. package/build-types/flex/styles.d.ts +5 -5
  644. package/build-types/flex/styles.d.ts.map +1 -1
  645. package/build-types/flex/test/index.d.ts +2 -0
  646. package/build-types/flex/test/index.d.ts.map +1 -0
  647. package/build-types/flex/types.d.ts +17 -10
  648. package/build-types/flex/types.d.ts.map +1 -1
  649. package/build-types/flyout/context.d.ts +6 -0
  650. package/build-types/flyout/context.d.ts.map +1 -0
  651. package/build-types/flyout/flyout/component.d.ts +21 -0
  652. package/build-types/flyout/flyout/component.d.ts.map +1 -0
  653. package/build-types/flyout/flyout/hook.d.ts +270 -0
  654. package/build-types/flyout/flyout/hook.d.ts.map +1 -0
  655. package/build-types/flyout/flyout/index.d.ts +3 -0
  656. package/build-types/flyout/flyout/index.d.ts.map +1 -0
  657. package/build-types/flyout/flyout-content/component.d.ts +3 -0
  658. package/build-types/flyout/flyout-content/component.d.ts.map +1 -0
  659. package/build-types/flyout/flyout-content/index.d.ts +2 -0
  660. package/build-types/flyout/flyout-content/index.d.ts.map +1 -0
  661. package/build-types/flyout/index.d.ts +2 -0
  662. package/build-types/flyout/index.d.ts.map +1 -0
  663. package/build-types/flyout/styles.d.ts +22 -0
  664. package/build-types/flyout/styles.d.ts.map +1 -0
  665. package/build-types/flyout/types.d.ts +80 -0
  666. package/build-types/flyout/types.d.ts.map +1 -0
  667. package/build-types/flyout/utils.d.ts +8 -0
  668. package/build-types/flyout/utils.d.ts.map +1 -0
  669. package/build-types/form-token-field/index.d.ts.map +1 -1
  670. package/build-types/form-token-field/stories/index.d.ts +6 -0
  671. package/build-types/form-token-field/stories/index.d.ts.map +1 -1
  672. package/build-types/form-token-field/styles.d.ts +14 -0
  673. package/build-types/form-token-field/styles.d.ts.map +1 -0
  674. package/build-types/form-token-field/suggestions-list.d.ts +1 -1
  675. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  676. package/build-types/form-token-field/types.d.ts +22 -3
  677. package/build-types/form-token-field/types.d.ts.map +1 -1
  678. package/build-types/grid/component.d.ts +3 -3
  679. package/build-types/grid/component.d.ts.map +1 -1
  680. package/build-types/grid/hook.d.ts +5 -2
  681. package/build-types/grid/hook.d.ts.map +1 -1
  682. package/build-types/grid/index.d.ts +2 -2
  683. package/build-types/grid/index.d.ts.map +1 -1
  684. package/build-types/grid/stories/index.d.ts +9 -0
  685. package/build-types/grid/stories/index.d.ts.map +1 -0
  686. package/build-types/grid/test/grid.d.ts +2 -0
  687. package/build-types/grid/test/grid.d.ts.map +1 -0
  688. package/build-types/grid/types.d.ts +16 -15
  689. package/build-types/grid/types.d.ts.map +1 -1
  690. package/build-types/grid/utils.d.ts +50 -69
  691. package/build-types/grid/utils.d.ts.map +1 -1
  692. package/build-types/h-stack/component.d.ts +3 -2
  693. package/build-types/h-stack/component.d.ts.map +1 -1
  694. package/build-types/h-stack/hook.d.ts +5 -3
  695. package/build-types/h-stack/hook.d.ts.map +1 -1
  696. package/build-types/h-stack/index.d.ts +2 -2
  697. package/build-types/h-stack/index.d.ts.map +1 -1
  698. package/build-types/h-stack/stories/index.d.ts +9 -0
  699. package/build-types/h-stack/stories/index.d.ts.map +1 -0
  700. package/build-types/h-stack/test/index.d.ts +2 -0
  701. package/build-types/h-stack/test/index.d.ts.map +1 -0
  702. package/build-types/h-stack/utils.d.ts +8 -4
  703. package/build-types/h-stack/utils.d.ts.map +1 -1
  704. package/build-types/icon/index.d.ts +1 -1
  705. package/build-types/icon/index.d.ts.map +1 -1
  706. package/build-types/input-control/index.d.ts +1 -1
  707. package/build-types/input-control/index.d.ts.map +1 -1
  708. package/build-types/input-control/input-base.d.ts +1 -1
  709. package/build-types/input-control/input-base.d.ts.map +1 -1
  710. package/build-types/input-control/input-prefix-wrapper.d.ts +19 -0
  711. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -0
  712. package/build-types/input-control/input-suffix-wrapper.d.ts +19 -0
  713. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -0
  714. package/build-types/input-control/reducer/actions.d.ts +3 -1
  715. package/build-types/input-control/reducer/actions.d.ts.map +1 -1
  716. package/build-types/input-control/reducer/reducer.d.ts +2 -2
  717. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  718. package/build-types/input-control/reducer/state.d.ts +2 -2
  719. package/build-types/input-control/reducer/state.d.ts.map +1 -1
  720. package/build-types/input-control/stories/index.d.ts +10 -0
  721. package/build-types/input-control/stories/index.d.ts.map +1 -1
  722. package/build-types/input-control/styles/input-control-styles.d.ts +21 -0
  723. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  724. package/build-types/input-control/types.d.ts +45 -3
  725. package/build-types/input-control/types.d.ts.map +1 -1
  726. package/build-types/menu-item/index.d.ts.map +1 -1
  727. package/build-types/placeholder/index.d.ts +16 -0
  728. package/build-types/placeholder/index.d.ts.map +1 -0
  729. package/build-types/placeholder/stories/index.d.ts +12 -0
  730. package/build-types/placeholder/stories/index.d.ts.map +1 -0
  731. package/build-types/placeholder/types.d.ts +47 -0
  732. package/build-types/placeholder/types.d.ts.map +1 -0
  733. package/build-types/popover/index.d.ts +1 -1
  734. package/build-types/popover/index.d.ts.map +1 -1
  735. package/build-types/popover/utils.d.ts +70 -0
  736. package/build-types/popover/utils.d.ts.map +1 -0
  737. package/build-types/radio-control/index.d.ts.map +1 -1
  738. package/build-types/range-control/index.d.ts +54 -29
  739. package/build-types/range-control/index.d.ts.map +1 -1
  740. package/build-types/range-control/input-range.d.ts +7 -10
  741. package/build-types/range-control/input-range.d.ts.map +1 -1
  742. package/build-types/range-control/mark.d.ts +4 -7
  743. package/build-types/range-control/mark.d.ts.map +1 -1
  744. package/build-types/range-control/rail.d.ts +4 -9
  745. package/build-types/range-control/rail.d.ts.map +1 -1
  746. package/build-types/range-control/stories/index.d.ts +48 -0
  747. package/build-types/range-control/stories/index.d.ts.map +1 -0
  748. package/build-types/range-control/styles/range-control-styles.d.ts +32 -40
  749. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  750. package/build-types/range-control/test/index.d.ts +2 -0
  751. package/build-types/range-control/test/index.d.ts.map +1 -0
  752. package/build-types/range-control/tooltip.d.ts +4 -11
  753. package/build-types/range-control/tooltip.d.ts.map +1 -1
  754. package/build-types/range-control/types.d.ts +304 -0
  755. package/build-types/range-control/types.d.ts.map +1 -0
  756. package/build-types/range-control/utils.d.ts +15 -33
  757. package/build-types/range-control/utils.d.ts.map +1 -1
  758. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  759. package/build-types/scroll-lock/index.d.ts +32 -3
  760. package/build-types/scroll-lock/index.d.ts.map +1 -1
  761. package/build-types/scroll-lock/stories/index.d.ts +9 -0
  762. package/build-types/scroll-lock/stories/index.d.ts.map +1 -0
  763. package/build-types/scroll-lock/test/index.d.ts +2 -0
  764. package/build-types/scroll-lock/test/index.d.ts.map +1 -0
  765. package/build-types/scrollable/component.d.ts +3 -3
  766. package/build-types/scrollable/component.d.ts.map +1 -1
  767. package/build-types/scrollable/hook.d.ts +5 -2
  768. package/build-types/scrollable/hook.d.ts.map +1 -1
  769. package/build-types/scrollable/index.d.ts +2 -2
  770. package/build-types/scrollable/index.d.ts.map +1 -1
  771. package/build-types/scrollable/stories/index.d.ts +9 -0
  772. package/build-types/scrollable/stories/index.d.ts.map +1 -0
  773. package/build-types/scrollable/styles.d.ts +7 -7
  774. package/build-types/scrollable/styles.d.ts.map +1 -1
  775. package/build-types/scrollable/test/index.d.ts +2 -0
  776. package/build-types/scrollable/test/index.d.ts.map +1 -0
  777. package/build-types/scrollable/types.d.ts +9 -6
  778. package/build-types/scrollable/types.d.ts.map +1 -1
  779. package/build-types/select-control/index.d.ts.map +1 -1
  780. package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
  781. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  782. package/build-types/select-control/types.d.ts +1 -1
  783. package/build-types/select-control/types.d.ts.map +1 -1
  784. package/build-types/shortcut/index.d.ts +5 -24
  785. package/build-types/shortcut/index.d.ts.map +1 -1
  786. package/build-types/shortcut/test/index.d.ts +2 -0
  787. package/build-types/shortcut/test/index.d.ts.map +1 -0
  788. package/build-types/shortcut/types.d.ts +14 -0
  789. package/build-types/shortcut/types.d.ts.map +1 -0
  790. package/build-types/slot-fill/provider.d.ts.map +1 -1
  791. package/build-types/slot-fill/slot.d.ts.map +1 -1
  792. package/build-types/spacer/component.d.ts +5 -3
  793. package/build-types/spacer/component.d.ts.map +1 -1
  794. package/build-types/spacer/hook.d.ts +2 -2
  795. package/build-types/spacer/hook.d.ts.map +1 -1
  796. package/build-types/spacer/index.d.ts +1 -1
  797. package/build-types/spacer/index.d.ts.map +1 -1
  798. package/build-types/spacer/test/index.d.ts +2 -0
  799. package/build-types/spacer/test/index.d.ts.map +1 -0
  800. package/build-types/spacer/types.d.ts +41 -29
  801. package/build-types/spacer/types.d.ts.map +1 -1
  802. package/build-types/style-provider/index.d.ts +7 -4
  803. package/build-types/style-provider/index.d.ts.map +1 -1
  804. package/build-types/style-provider/types.d.ts +15 -0
  805. package/build-types/style-provider/types.d.ts.map +1 -0
  806. package/build-types/swatch/index.d.ts +5 -0
  807. package/build-types/swatch/index.d.ts.map +1 -0
  808. package/build-types/swatch/types.d.ts +11 -0
  809. package/build-types/swatch/types.d.ts.map +1 -0
  810. package/build-types/text/hook.d.ts.map +1 -1
  811. package/build-types/text-highlight/index.d.ts +23 -0
  812. package/build-types/text-highlight/index.d.ts.map +1 -0
  813. package/build-types/text-highlight/stories/index.d.ts +12 -0
  814. package/build-types/text-highlight/stories/index.d.ts.map +1 -0
  815. package/build-types/text-highlight/test/index.d.ts +2 -0
  816. package/build-types/text-highlight/test/index.d.ts.map +1 -0
  817. package/build-types/text-highlight/types.d.ts +17 -0
  818. package/build-types/text-highlight/types.d.ts.map +1 -0
  819. package/build-types/tip/index.d.ts +5 -14
  820. package/build-types/tip/index.d.ts.map +1 -1
  821. package/build-types/tip/stories/index.d.ts +12 -0
  822. package/build-types/tip/stories/index.d.ts.map +1 -0
  823. package/build-types/tip/types.d.ts +11 -0
  824. package/build-types/tip/types.d.ts.map +1 -0
  825. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +5 -1
  826. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  827. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +0 -1
  828. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  829. package/build-types/toggle-group-control/types.d.ts +6 -0
  830. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  831. package/build-types/tools-panel/styles.d.ts +1 -1
  832. package/build-types/tools-panel/styles.d.ts.map +1 -1
  833. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  834. package/build-types/tooltip/index.d.ts.map +1 -1
  835. package/build-types/tree-select/index.d.ts.map +1 -1
  836. package/build-types/tree-select/types.d.ts +1 -0
  837. package/build-types/tree-select/types.d.ts.map +1 -1
  838. package/build-types/ui/context/use-context-system.d.ts.map +1 -1
  839. package/build-types/ui/form-group/form-group.d.ts +1 -1
  840. package/build-types/ui/form-group/types.d.ts +1 -1
  841. package/build-types/ui/form-group/types.d.ts.map +1 -1
  842. package/build-types/ui/form-group/use-form-group.d.ts +3 -3
  843. package/build-types/ui/tooltip/styles.d.ts.map +1 -1
  844. package/build-types/ui/utils/get-valid-children.d.ts +2 -2
  845. package/build-types/ui/utils/get-valid-children.d.ts.map +1 -1
  846. package/build-types/ui/utils/space.d.ts +7 -1
  847. package/build-types/ui/utils/space.d.ts.map +1 -1
  848. package/build-types/unit-control/index.d.ts +3 -3
  849. package/build-types/unit-control/index.d.ts.map +1 -1
  850. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  851. package/build-types/unit-control/styles/unit-control-styles.d.ts +0 -1
  852. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  853. package/build-types/unit-control/types.d.ts +2 -8
  854. package/build-types/unit-control/types.d.ts.map +1 -1
  855. package/build-types/utils/base-label.d.ts +2 -0
  856. package/build-types/utils/base-label.d.ts.map +1 -0
  857. package/build-types/utils/box-sizing.d.ts +2 -0
  858. package/build-types/utils/box-sizing.d.ts.map +1 -0
  859. package/build-types/utils/hooks/use-combined-ref.d.ts +8 -0
  860. package/build-types/utils/hooks/use-combined-ref.d.ts.map +1 -0
  861. package/build-types/utils/style-mixins.d.ts +2 -0
  862. package/build-types/visually-hidden/component.d.ts +8 -10
  863. package/build-types/visually-hidden/component.d.ts.map +1 -1
  864. package/build-types/visually-hidden/index.d.ts +1 -1
  865. package/build-types/visually-hidden/index.d.ts.map +1 -1
  866. package/build-types/visually-hidden/stories/index.d.ts +14 -0
  867. package/build-types/visually-hidden/stories/index.d.ts.map +1 -0
  868. package/build-types/visually-hidden/styles.d.ts +5 -2
  869. package/build-types/visually-hidden/styles.d.ts.map +1 -1
  870. package/build-types/visually-hidden/test/index.d.ts +2 -0
  871. package/build-types/visually-hidden/test/index.d.ts.map +1 -0
  872. package/build-types/visually-hidden/types.d.ts +11 -0
  873. package/build-types/visually-hidden/types.d.ts.map +1 -0
  874. package/package.json +17 -17
  875. package/src/angle-picker-control/index.js +1 -2
  876. package/src/autocomplete/get-default-use-items.js +3 -2
  877. package/src/autocomplete/index.js +3 -2
  878. package/src/base-control/index.tsx +5 -3
  879. package/src/base-control/stories/index.tsx +1 -0
  880. package/src/base-control/styles/base-control-styles.ts +10 -1
  881. package/src/base-control/types.ts +0 -1
  882. package/src/border-control/border-control/component.tsx +41 -32
  883. package/src/border-control/border-control/hook.ts +5 -10
  884. package/src/border-control/border-control-dropdown/component.tsx +50 -45
  885. package/src/border-control/border-control-dropdown/hook.ts +0 -5
  886. package/src/border-control/stories/index.tsx +3 -0
  887. package/src/border-control/styles.ts +25 -70
  888. package/src/border-control/test/index.js +19 -8
  889. package/src/box-control/all-input-control.js +3 -27
  890. package/src/box-control/axial-input-controls.js +1 -1
  891. package/src/box-control/index.js +6 -7
  892. package/src/box-control/styles/box-control-styles.js +1 -2
  893. package/src/box-control/utils.js +38 -13
  894. package/src/button/README.md +1 -1
  895. package/src/card/test/__snapshots__/index.js.snap +8 -8
  896. package/src/color-palette/index.js +19 -8
  897. package/src/color-palette/style.scss +5 -0
  898. package/src/color-palette/test/utils.ts +19 -1
  899. package/src/color-picker/hex-input.tsx +5 -3
  900. package/src/color-picker/index.native.js +20 -27
  901. package/src/color-picker/input-with-slider.tsx +4 -1
  902. package/src/color-picker/styles.ts +3 -16
  903. package/src/color-picker/use-deprecated-props.ts +24 -43
  904. package/src/combobox-control/README.md +7 -0
  905. package/src/combobox-control/index.js +34 -17
  906. package/src/combobox-control/stories/index.js +51 -6
  907. package/src/combobox-control/style.scss +1 -1
  908. package/src/combobox-control/styles.ts +27 -0
  909. package/src/confirm-dialog/README.md +1 -1
  910. package/src/custom-gradient-picker/style.scss +0 -12
  911. package/src/custom-select-control/index.js +47 -28
  912. package/src/custom-select-control/stories/index.js +7 -2
  913. package/src/custom-select-control/style.scss +5 -34
  914. package/src/date-time/time/index.tsx +7 -5
  915. package/src/date-time/time/styles.ts +3 -6
  916. package/src/divider/README.md +12 -5
  917. package/src/divider/component.tsx +2 -3
  918. package/src/divider/index.ts +1 -1
  919. package/src/divider/stories/index.tsx +4 -4
  920. package/src/divider/styles.ts +7 -7
  921. package/src/divider/test/__snapshots__/{index.js.snap → index.tsx.snap} +7 -7
  922. package/src/divider/test/index.tsx +40 -0
  923. package/src/divider/types.ts +21 -15
  924. package/src/draggable/README.md +1 -1
  925. package/src/dropdown/dropdown-content-wrapper.tsx +59 -0
  926. package/src/dropdown/stories/index.js +60 -69
  927. package/src/dropdown/styles.ts +38 -0
  928. package/src/dropdown/types.ts +8 -0
  929. package/src/dropdown-menu/index.js +3 -4
  930. package/src/dropdown-menu/index.native.js +3 -5
  931. package/src/elevation/README.md +16 -14
  932. package/src/elevation/component.tsx +48 -0
  933. package/src/elevation/{hook.js → hook.ts} +23 -20
  934. package/src/elevation/{index.js → index.ts} +0 -0
  935. package/src/elevation/stories/index.tsx +85 -0
  936. package/src/elevation/{styles.js → styles.ts} +0 -0
  937. package/src/elevation/test/__snapshots__/{index.js.snap → index.tsx.snap} +19 -13
  938. package/src/elevation/test/index.tsx +64 -0
  939. package/src/elevation/types.ts +12 -19
  940. package/src/external-link/index.tsx +20 -4
  941. package/src/flex/flex/README.md +20 -18
  942. package/src/flex/flex/component.tsx +59 -0
  943. package/src/flex/flex/{hook.js → hook.ts} +14 -13
  944. package/src/flex/flex/{index.js → index.ts} +0 -0
  945. package/src/flex/flex-block/README.md +3 -7
  946. package/src/flex/flex-block/component.tsx +41 -0
  947. package/src/flex/flex-block/{hook.js → hook.ts} +5 -5
  948. package/src/flex/flex-block/{index.js → index.ts} +0 -0
  949. package/src/flex/flex-item/README.md +6 -9
  950. package/src/flex/flex-item/component.tsx +41 -0
  951. package/src/flex/flex-item/{hook.js → hook.ts} +10 -7
  952. package/src/flex/flex-item/{index.js → index.ts} +0 -0
  953. package/src/flex/{index.js → index.ts} +0 -0
  954. package/src/flex/stories/index.tsx +81 -0
  955. package/src/flex/{styles.js → styles.ts} +0 -0
  956. package/src/flex/test/__snapshots__/{index.js.snap → index.tsx.snap} +49 -9
  957. package/src/flex/test/index.tsx +84 -0
  958. package/src/flex/types.ts +17 -10
  959. package/src/focal-point-picker/grid.js +2 -5
  960. package/src/focal-point-picker/index.native.js +8 -8
  961. package/src/focal-point-picker/styles/focal-point-picker-style.js +0 -5
  962. package/src/focal-point-picker/styles/focal-point-style.js +0 -1
  963. package/src/focal-point-picker/tooltip/index.native.js +10 -11
  964. package/src/font-size-picker/index.js +18 -7
  965. package/src/font-size-picker/stories/index.js +6 -0
  966. package/src/form-token-field/README.md +2 -1
  967. package/src/form-token-field/index.tsx +50 -26
  968. package/src/form-token-field/stories/index.tsx +14 -0
  969. package/src/form-token-field/style.scss +2 -12
  970. package/src/form-token-field/styles.ts +32 -0
  971. package/src/form-token-field/suggestions-list.tsx +23 -16
  972. package/src/form-token-field/test/index.js +1 -1
  973. package/src/form-token-field/types.ts +23 -2
  974. package/src/grid/README.md +33 -19
  975. package/src/grid/{component.js → component.tsx} +13 -9
  976. package/src/grid/{hook.js → hook.ts} +5 -5
  977. package/src/grid/{index.js → index.ts} +0 -0
  978. package/src/grid/stories/index.tsx +72 -0
  979. package/src/grid/test/{grid.js → grid.tsx} +4 -4
  980. package/src/grid/types.ts +16 -17
  981. package/src/grid/{utils.js → utils.ts} +9 -7
  982. package/src/guide/style.scss +1 -0
  983. package/src/h-stack/{component.js → component.tsx} +8 -8
  984. package/src/h-stack/{hook.js → hook.tsx} +21 -16
  985. package/src/h-stack/{index.js → index.ts} +0 -0
  986. package/src/h-stack/stories/index.tsx +92 -0
  987. package/src/h-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  988. package/src/h-stack/test/{index.js → index.tsx} +0 -0
  989. package/src/h-stack/{utils.js → utils.ts} +14 -14
  990. package/src/higher-order/navigate-regions/README.md +4 -1
  991. package/src/icon/index.tsx +1 -1
  992. package/src/index.js +7 -1
  993. package/src/input-control/index.tsx +6 -0
  994. package/src/input-control/input-base.tsx +28 -13
  995. package/src/input-control/input-prefix-wrapper.tsx +48 -0
  996. package/src/input-control/input-suffix-wrapper.tsx +48 -0
  997. package/src/input-control/reducer/actions.ts +3 -1
  998. package/src/input-control/reducer/reducer.ts +27 -10
  999. package/src/input-control/reducer/state.ts +7 -2
  1000. package/src/input-control/stories/index.tsx +15 -2
  1001. package/src/input-control/styles/input-control-styles.tsx +28 -12
  1002. package/src/input-control/test/index.js +20 -4
  1003. package/src/input-control/types.ts +52 -3
  1004. package/src/menu-item/index.js +1 -2
  1005. package/src/mobile/focal-point-settings-panel/index.native.js +2 -2
  1006. package/src/mobile/global-styles-context/utils.native.js +21 -4
  1007. package/src/mobile/image/index.native.js +38 -7
  1008. package/src/mobile/link-picker/link-picker-screen.native.js +12 -4
  1009. package/src/mobile/media-edit/index.native.js +2 -7
  1010. package/src/mobile/picker/index.ios.js +16 -0
  1011. package/src/mobile/picker/styles.native.scss +8 -0
  1012. package/src/modal/index.js +21 -2
  1013. package/src/modal/stories/index.js +17 -1
  1014. package/src/modal/style.scss +14 -19
  1015. package/src/navigation/index.js +3 -0
  1016. package/src/navigation/item/base.js +2 -1
  1017. package/src/panel/style.scss +4 -1
  1018. package/src/placeholder/README.md +49 -9
  1019. package/src/placeholder/{index.js → index.tsx} +27 -23
  1020. package/src/placeholder/stories/index.tsx +64 -0
  1021. package/src/placeholder/style.scss +0 -4
  1022. package/src/placeholder/types.ts +48 -0
  1023. package/src/popover/README.md +9 -2
  1024. package/src/popover/index.js +160 -79
  1025. package/src/popover/stories/index.js +199 -96
  1026. package/src/popover/style.scss +61 -7
  1027. package/src/popover/test/index.js +23 -1
  1028. package/src/radio-control/index.tsx +1 -2
  1029. package/src/range-control/README.md +108 -80
  1030. package/src/range-control/{index.js → index.tsx} +78 -48
  1031. package/src/range-control/{input-range.js → input-range.tsx} +11 -7
  1032. package/src/range-control/{mark.js → mark.tsx} +15 -9
  1033. package/src/range-control/{rail.js → rail.tsx} +40 -23
  1034. package/src/range-control/stories/index.tsx +244 -0
  1035. package/src/range-control/styles/{range-control-styles.js → range-control-styles.ts} +28 -36
  1036. package/src/range-control/test/index.tsx +341 -0
  1037. package/src/range-control/{tooltip.js → tooltip.tsx} +19 -14
  1038. package/src/range-control/types.ts +328 -0
  1039. package/src/range-control/utils.ts +135 -0
  1040. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +1 -1
  1041. package/src/resizable-box/resize-tooltip/utils.ts +2 -3
  1042. package/src/sandbox/index.native.js +14 -1
  1043. package/src/scroll-lock/README.md +1 -1
  1044. package/src/scroll-lock/{index.js → index.tsx} +34 -7
  1045. package/src/scroll-lock/stories/index.tsx +96 -0
  1046. package/src/scroll-lock/test/index.tsx +26 -0
  1047. package/src/scrollable/README.md +14 -8
  1048. package/src/scrollable/{component.js → component.tsx} +13 -10
  1049. package/src/scrollable/{hook.js → hook.ts} +5 -7
  1050. package/src/scrollable/{index.js → index.ts} +0 -0
  1051. package/src/scrollable/stories/{index.js → index.tsx} +29 -34
  1052. package/src/scrollable/{styles.js → styles.ts} +0 -0
  1053. package/src/scrollable/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
  1054. package/src/scrollable/test/index.tsx +34 -0
  1055. package/src/scrollable/types.ts +10 -5
  1056. package/src/select-control/index.tsx +1 -2
  1057. package/src/select-control/styles/select-control-styles.ts +33 -10
  1058. package/src/select-control/test/select-control.tsx +22 -15
  1059. package/src/select-control/types.ts +1 -0
  1060. package/src/shortcut/index.tsx +32 -0
  1061. package/src/shortcut/test/__snapshots__/index.tsx.snap +15 -0
  1062. package/src/shortcut/test/index.tsx +41 -0
  1063. package/src/shortcut/types.ts +10 -0
  1064. package/src/slot-fill/index.native.js +2 -7
  1065. package/src/slot-fill/provider.js +3 -7
  1066. package/src/slot-fill/slot.js +21 -24
  1067. package/src/spacer/README.md +43 -37
  1068. package/src/spacer/component.tsx +5 -3
  1069. package/src/spacer/hook.ts +4 -2
  1070. package/src/spacer/index.ts +1 -1
  1071. package/src/spacer/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
  1072. package/src/spacer/test/index.tsx +149 -0
  1073. package/src/spacer/types.ts +41 -29
  1074. package/src/style-provider/index.tsx +41 -0
  1075. package/src/style-provider/types.ts +15 -0
  1076. package/src/swatch/{index.js → index.tsx} +4 -1
  1077. package/src/swatch/types.ts +11 -0
  1078. package/src/tab-panel/README.md +1 -1
  1079. package/src/text/hook.js +5 -3
  1080. package/src/text-highlight/README.md +6 -6
  1081. package/src/text-highlight/index.tsx +49 -0
  1082. package/src/text-highlight/stories/index.tsx +33 -0
  1083. package/src/text-highlight/test/index.tsx +93 -0
  1084. package/src/text-highlight/types.ts +16 -0
  1085. package/src/tip/index.tsx +22 -0
  1086. package/src/tip/stories/index.tsx +33 -0
  1087. package/src/tip/types.ts +11 -0
  1088. package/src/toggle-group-control/stories/index.js +19 -3
  1089. package/src/toggle-group-control/test/__snapshots__/index.js.snap +28 -4
  1090. package/src/toggle-group-control/toggle-group-control/component.tsx +3 -3
  1091. package/src/toggle-group-control/toggle-group-control/styles.ts +22 -2
  1092. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +0 -4
  1093. package/src/toggle-group-control/types.ts +6 -0
  1094. package/src/toolbar-group/index.js +1 -2
  1095. package/src/tools-panel/styles.ts +7 -16
  1096. package/src/tools-panel/test/__snapshots__/index.js.snap +2 -11
  1097. package/src/tools-panel/tools-panel/README.md +94 -21
  1098. package/src/tools-panel/tools-panel/hook.ts +6 -1
  1099. package/src/tooltip/index.js +56 -10
  1100. package/src/tooltip/stories/index.js +28 -13
  1101. package/src/tooltip/style.scss +1 -1
  1102. package/src/tree-select/index.tsx +7 -6
  1103. package/src/tree-select/types.ts +4 -0
  1104. package/src/ui/context/test/context-system-provider.js +101 -1
  1105. package/src/ui/context/use-context-system.js +7 -2
  1106. package/src/ui/form-group/types.ts +1 -1
  1107. package/src/ui/tooltip/styles.js +1 -0
  1108. package/src/ui/tooltip/test/__snapshots__/index.js.snap +1 -0
  1109. package/src/ui/utils/get-valid-children.ts +4 -2
  1110. package/src/ui/utils/space.ts +7 -1
  1111. package/src/unit-control/stories/index.tsx +16 -23
  1112. package/src/unit-control/styles/unit-control-styles.ts +100 -46
  1113. package/src/unit-control/test/__snapshots__/index.tsx.snap +4 -4
  1114. package/src/unit-control/types.ts +2 -8
  1115. package/src/utils/base-label.ts +13 -0
  1116. package/src/utils/box-sizing.ts +14 -0
  1117. package/src/utils/style-mixins.js +2 -0
  1118. package/src/visually-hidden/{component.js → component.tsx} +23 -15
  1119. package/src/visually-hidden/{index.js → index.ts} +0 -0
  1120. package/src/visually-hidden/stories/index.tsx +66 -0
  1121. package/src/visually-hidden/{styles.js → styles.ts} +6 -2
  1122. package/src/visually-hidden/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1123. package/src/visually-hidden/test/index.tsx +17 -0
  1124. package/src/visually-hidden/types.ts +11 -0
  1125. package/tsconfig.json +3 -0
  1126. package/tsconfig.tsbuildinfo +1 -1
  1127. package/src/divider/test/index.js +0 -41
  1128. package/src/elevation/component.js +0 -43
  1129. package/src/elevation/stories/index.js +0 -148
  1130. package/src/elevation/test/index.js +0 -51
  1131. package/src/flex/flex/component.js +0 -60
  1132. package/src/flex/flex-block/component.js +0 -30
  1133. package/src/flex/flex-item/component.js +0 -30
  1134. package/src/flex/stories/index.js +0 -29
  1135. package/src/flex/test/index.js +0 -77
  1136. package/src/grid/stories/index.js +0 -49
  1137. package/src/h-stack/stories/index.js +0 -22
  1138. package/src/placeholder/stories/index.js +0 -44
  1139. package/src/popover/stories/_utils.js +0 -64
  1140. package/src/range-control/stories/index.js +0 -180
  1141. package/src/range-control/test/index.js +0 -320
  1142. package/src/range-control/utils.js +0 -131
  1143. package/src/scroll-lock/stories/index.js +0 -71
  1144. package/src/scroll-lock/test/index.js +0 -53
  1145. package/src/scrollable/test/index.js +0 -31
  1146. package/src/shortcut/index.js +0 -41
  1147. package/src/shortcut/test/index.js +0 -37
  1148. package/src/spacer/test/index.js +0 -146
  1149. package/src/style-provider/index.js +0 -31
  1150. package/src/text-highlight/index.js +0 -28
  1151. package/src/text-highlight/stories/index.js +0 -28
  1152. package/src/text-highlight/test/index.js +0 -120
  1153. package/src/tip/index.js +0 -24
  1154. package/src/tip/stories/index.js +0 -26
  1155. package/src/visually-hidden/stories/index.js +0 -42
  1156. package/src/visually-hidden/test/index.js +0 -19
@@ -1,18 +1,17 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { createElement } from "@wordpress/element";
3
- // @ts-nocheck
4
3
 
5
4
  /**
6
5
  * External dependencies
7
6
  */
8
7
  import classnames from 'classnames';
8
+
9
9
  /**
10
10
  * WordPress dependencies
11
11
  */
12
-
13
12
  import { __, isRTL } from '@wordpress/i18n';
14
13
  import { useRef, useState, forwardRef } from '@wordpress/element';
15
- import { useInstanceId } from '@wordpress/compose';
14
+ import { useInstanceId, useMergeRefs } from '@wordpress/compose';
16
15
  /**
17
16
  * Internal dependencies
18
17
  */
@@ -30,82 +29,74 @@ import { ActionRightWrapper, AfterIconWrapper, BeforeIconWrapper, InputNumber, R
30
29
 
31
30
  const noop = () => {};
32
31
 
33
- function RangeControl(_ref, ref) {
32
+ function UnforwardedRangeControl(props, forwardedRef) {
34
33
  var _inputRef$current;
35
34
 
36
- let {
35
+ const {
37
36
  afterIcon,
38
37
  allowReset = false,
39
38
  beforeIcon,
40
39
  className,
41
- currentInput,
42
40
  color: colorProp = COLORS.ui.theme,
41
+ currentInput,
43
42
  disabled = false,
44
43
  help,
44
+ hideLabelFromVision = false,
45
45
  initialPosition,
46
46
  isShiftStepEnabled = true,
47
47
  label,
48
- hideLabelFromVision = false,
49
48
  marks = false,
50
49
  max = 100,
51
50
  min = 0,
52
51
  onBlur = noop,
53
52
  onChange = noop,
54
53
  onFocus = noop,
55
- onMouseMove = noop,
56
54
  onMouseLeave = noop,
55
+ onMouseMove = noop,
57
56
  railColor,
58
- resetFallbackValue,
59
57
  renderTooltipContent = v => v,
60
- showTooltip: showTooltipProp,
58
+ resetFallbackValue,
61
59
  shiftStep = 10,
60
+ showTooltip: showTooltipProp,
62
61
  step = 1,
63
62
  trackColor,
64
63
  value: valueProp,
65
64
  withInputField = true,
66
- ...props
67
- } = _ref;
65
+ ...otherProps
66
+ } = props;
68
67
  const [value, setValue] = useControlledRangeValue({
69
68
  min,
70
69
  max,
71
- value: valueProp,
70
+ value: valueProp !== null && valueProp !== void 0 ? valueProp : null,
72
71
  initial: initialPosition
73
72
  });
74
73
  const isResetPendent = useRef(false);
74
+ let hasTooltip = showTooltipProp;
75
+ let hasInputField = withInputField;
75
76
 
76
77
  if (step === 'any') {
77
78
  // The tooltip and number input field are hidden when the step is "any"
78
79
  // because the decimals get too lengthy to fit well.
79
- showTooltipProp = false;
80
- withInputField = false;
80
+ hasTooltip = false;
81
+ hasInputField = false;
81
82
  }
82
83
 
83
- const [showTooltip, setShowTooltip] = useState(showTooltipProp);
84
+ const [showTooltip, setShowTooltip] = useState(hasTooltip);
84
85
  const [isFocused, setIsFocused] = useState(false);
85
86
  const inputRef = useRef();
86
-
87
- const setRef = nodeRef => {
88
- inputRef.current = nodeRef;
89
-
90
- if (ref) {
91
- ref(nodeRef);
92
- }
93
- };
94
-
95
87
  const isCurrentlyFocused = (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.matches(':focus');
96
88
  const isThumbFocused = !disabled && isFocused;
97
89
  const isValueReset = value === null;
98
90
  const currentValue = value !== undefined ? value : currentInput;
99
91
  const inputSliderValue = isValueReset ? '' : currentValue;
100
92
  const rangeFillValue = isValueReset ? (max - min) / 2 + min : value;
101
- const calculatedFillValue = (value - min) / (max - min) * 100;
102
- const fillValue = isValueReset ? 50 : calculatedFillValue;
93
+ const fillValue = isValueReset ? 50 : (value - min) / (max - min) * 100;
103
94
  const fillValueOffset = `${clamp(fillValue, 0, 100)}%`;
104
95
  const classes = classnames('components-range-control', className);
105
96
  const wrapperClasses = classnames('components-range-control__wrapper', !!marks && 'is-marked');
106
- const id = useInstanceId(RangeControl, 'inspector-range-control');
97
+ const id = useInstanceId(UnforwardedRangeControl, 'inspector-range-control');
107
98
  const describedBy = !!help ? `${id}__help` : undefined;
108
- const enableTooltip = showTooltipProp !== false && Number.isFinite(value);
99
+ const enableTooltip = hasTooltip !== false && Number.isFinite(value);
109
100
 
110
101
  const handleOnRangeChange = event => {
111
102
  const nextValue = parseFloat(event.target.value);
@@ -113,8 +104,8 @@ function RangeControl(_ref, ref) {
113
104
  onChange(nextValue);
114
105
  };
115
106
 
116
- const handleOnChange = nextValue => {
117
- nextValue = parseFloat(nextValue);
107
+ const handleOnChange = next => {
108
+ let nextValue = parseFloat(next);
118
109
  setValue(nextValue);
119
110
  /*
120
111
  * Calls onChange only when nextValue is numeric
@@ -141,7 +132,7 @@ function RangeControl(_ref, ref) {
141
132
  };
142
133
 
143
134
  const handleOnReset = () => {
144
- let resetValue = parseFloat(resetFallbackValue);
135
+ let resetValue = parseFloat(`${resetFallbackValue}`);
145
136
  let onChangeResetValue = resetValue;
146
137
 
147
138
  if (isNaN(resetValue)) {
@@ -190,7 +181,7 @@ function RangeControl(_ref, ref) {
190
181
  className: classes,
191
182
  label: label,
192
183
  hideLabelFromVision: hideLabelFromVision,
193
- id: id,
184
+ id: `${id}`,
194
185
  help: help
195
186
  }, createElement(Root, {
196
187
  className: "components-range-control__root"
@@ -200,11 +191,11 @@ function RangeControl(_ref, ref) {
200
191
  className: wrapperClasses,
201
192
  color: colorProp,
202
193
  marks: !!marks
203
- }, createElement(InputRange, _extends({}, props, {
194
+ }, createElement(InputRange, _extends({}, otherProps, {
204
195
  className: "components-range-control__slider",
205
196
  describedBy: describedBy,
206
197
  disabled: disabled,
207
- id: id,
198
+ id: `${id}`,
208
199
  label: label,
209
200
  max: max,
210
201
  min: min,
@@ -213,9 +204,9 @@ function RangeControl(_ref, ref) {
213
204
  onFocus: handleOnFocus,
214
205
  onMouseMove: onMouseMove,
215
206
  onMouseLeave: onMouseLeave,
216
- ref: setRef,
207
+ ref: useMergeRefs([inputRef, forwardedRef]),
217
208
  step: step,
218
- value: inputSliderValue
209
+ value: inputSliderValue !== null && inputSliderValue !== void 0 ? inputSliderValue : undefined
219
210
  })), createElement(RangeRail, {
220
211
  "aria-hidden": true,
221
212
  disabled: disabled,
@@ -250,7 +241,7 @@ function RangeControl(_ref, ref) {
250
241
  value: value
251
242
  })), afterIcon && createElement(AfterIconWrapper, null, createElement(Icon, {
252
243
  icon: afterIcon
253
- })), withInputField && createElement(InputNumber, {
244
+ })), hasInputField && createElement(InputNumber, {
254
245
  "aria-label": label,
255
246
  className: "components-range-control__number",
256
247
  disabled: disabled,
@@ -271,7 +262,30 @@ function RangeControl(_ref, ref) {
271
262
  onClick: handleOnReset
272
263
  }, __('Reset')))));
273
264
  }
265
+ /**
266
+ * RangeControls are used to make selections from a range of incremental values.
267
+ *
268
+ * ```jsx
269
+ * import { RangeControl } from '@wordpress/components';
270
+ * import { useState } from '@wordpress/element';
271
+ *
272
+ * const MyRangeControl = () => {
273
+ * const [ isChecked, setChecked ] = useState( true );
274
+ * return (
275
+ * <RangeControl
276
+ * help="Please select how transparent you would like this."
277
+ * initialPosition={50}
278
+ * label="Opacity"
279
+ * max={100}
280
+ * min={0}
281
+ * onChange={() => {}}
282
+ * />
283
+ * );
284
+ * };
285
+ * ```
286
+ */
287
+
274
288
 
275
- const ForwardedComponent = forwardRef(RangeControl);
276
- export default ForwardedComponent;
289
+ export const RangeControl = forwardRef(UnforwardedRangeControl);
290
+ export default RangeControl;
277
291
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/range-control/index.js"],"names":["classnames","__","isRTL","useRef","useState","forwardRef","useInstanceId","BaseControl","Button","Icon","COLORS","floatClamp","useControlledRangeValue","clamp","InputRange","RangeRail","SimpleTooltip","ActionRightWrapper","AfterIconWrapper","BeforeIconWrapper","InputNumber","Root","Track","ThumbWrapper","Thumb","Wrapper","noop","RangeControl","ref","afterIcon","allowReset","beforeIcon","className","currentInput","color","colorProp","ui","theme","disabled","help","initialPosition","isShiftStepEnabled","label","hideLabelFromVision","marks","max","min","onBlur","onChange","onFocus","onMouseMove","onMouseLeave","railColor","resetFallbackValue","renderTooltipContent","v","showTooltip","showTooltipProp","shiftStep","step","trackColor","value","valueProp","withInputField","props","setValue","initial","isResetPendent","setShowTooltip","isFocused","setIsFocused","inputRef","setRef","nodeRef","current","isCurrentlyFocused","matches","isThumbFocused","isValueReset","currentValue","undefined","inputSliderValue","rangeFillValue","calculatedFillValue","fillValue","fillValueOffset","classes","wrapperClasses","id","describedBy","enableTooltip","Number","isFinite","handleOnRangeChange","event","nextValue","parseFloat","target","handleOnChange","isNaN","handleOnInputNumberBlur","handleOnReset","resetValue","onChangeResetValue","handleShowTooltip","handleHideTooltip","handleOnBlur","handleOnFocus","offsetStyle","width","ForwardedComponent"],"mappings":";;AAAA;;AACA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SAASC,MAAT,EAAiBC,QAAjB,EAA2BC,UAA3B,QAA6C,oBAA7C;AACA,SAASC,aAAT,QAA8B,oBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,SAASC,MAAT,QAAuB,UAAvB;AACA,SAASC,UAAT,EAAqBC,uBAArB,QAAoD,SAApD;AACA,SAASC,KAAT,QAAsB,eAAtB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,SAAP,MAAsB,QAAtB;AACA,OAAOC,aAAP,MAA0B,WAA1B;AACA,SACCC,kBADD,EAECC,gBAFD,EAGCC,iBAHD,EAICC,WAJD,EAKCC,IALD,EAMCC,KAND,EAOCC,YAPD,EAQCC,KARD,EASCC,OATD,QAUO,+BAVP;;AAYA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,YAAT,OAiCCC,GAjCD,E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OAAO,EAAGqB;AALX,KAOGpG,EAAE,CAAE,OAAF,CAPL,CADD,CAvFF,CAPD,CADD;AA8GA;;AAED,MAAM6G,kBAAkB,GAAGzG,UAAU,CAAEsB,YAAF,CAArC;AAEA,eAAemF,kBAAf","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useRef, useState, forwardRef } from '@wordpress/element';\nimport { useInstanceId } 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\nconst noop = () => {};\n\nfunction RangeControl(\n\t{\n\t\tafterIcon,\n\t\tallowReset = false,\n\t\tbeforeIcon,\n\t\tclassName,\n\t\tcurrentInput,\n\t\tcolor: colorProp = COLORS.ui.theme,\n\t\tdisabled = false,\n\t\thelp,\n\t\tinitialPosition,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\thideLabelFromVision = false,\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\tonMouseMove = noop,\n\t\tonMouseLeave = noop,\n\t\trailColor,\n\t\tresetFallbackValue,\n\t\trenderTooltipContent = ( v ) => v,\n\t\tshowTooltip: showTooltipProp,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\ttrackColor,\n\t\tvalue: valueProp,\n\t\twithInputField = true,\n\t\t...props\n\t},\n\tref\n) {\n\tconst [ value, setValue ] = useControlledRangeValue( {\n\t\tmin,\n\t\tmax,\n\t\tvalue: valueProp,\n\t\tinitial: initialPosition,\n\t} );\n\tconst isResetPendent = useRef( false );\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\tshowTooltipProp = false;\n\t\twithInputField = false;\n\t}\n\n\tconst [ showTooltip, setShowTooltip ] = useState( showTooltipProp );\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tconst inputRef = useRef();\n\n\tconst setRef = ( nodeRef ) => {\n\t\tinputRef.current = nodeRef;\n\n\t\tif ( ref ) {\n\t\t\tref( nodeRef );\n\t\t}\n\t};\n\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\n\tconst rangeFillValue = isValueReset ? ( max - min ) / 2 + min : value;\n\n\tconst calculatedFillValue = ( ( value - min ) / ( max - min ) ) * 100;\n\tconst fillValue = isValueReset ? 50 : calculatedFillValue;\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( RangeControl, 'inspector-range-control' );\n\tconst describedBy = !! help ? `${ id }__help` : undefined;\n\tconst enableTooltip = showTooltipProp !== false && Number.isFinite( value );\n\n\tconst handleOnRangeChange = ( event ) => {\n\t\tconst nextValue = parseFloat( event.target.value );\n\t\tsetValue( nextValue );\n\t\tonChange( nextValue );\n\t};\n\n\tconst handleOnChange = ( nextValue ) => {\n\t\tnextValue = parseFloat( nextValue );\n\t\tsetValue( nextValue );\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 );\n\t\t\t}\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 = parseFloat( resetFallbackValue );\n\t\tlet onChangeResetValue = 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 ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused( false );\n\t\thandleHideTooltip();\n\t};\n\n\tconst handleOnFocus = ( event ) => {\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{ ...props }\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={ setRef }\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\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{ withInputField && (\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\nconst ForwardedComponent = forwardRef( RangeControl );\n\nexport default ForwardedComponent;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/range-control/index.tsx"],"names":["classnames","__","isRTL","useRef","useState","forwardRef","useInstanceId","useMergeRefs","BaseControl","Button","Icon","COLORS","floatClamp","useControlledRangeValue","clamp","InputRange","RangeRail","SimpleTooltip","ActionRightWrapper","AfterIconWrapper","BeforeIconWrapper","InputNumber","Root","Track","ThumbWrapper","Thumb","Wrapper","noop","UnforwardedRangeControl","props","forwardedRef","afterIcon","allowReset","beforeIcon","className","color","colorProp","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","handleOnF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oBAJxB;AAKC,IAAA,IAAI,EAAGqB,kBAAkB,IAAIjB,WAL9B;AAMC,IAAA,KAAK,EAAGmD,WANT;AAOC,IAAA,KAAK,EAAG/C;AAPT,IAhDF,CAND,EAiEGhC,SAAS,IACV,cAAC,gBAAD,QACC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAGA;AAAb,IADD,CAlEF,EAsEGwC,aAAa,IACd,cAAC,WAAD;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,IAvEF,EAsFGnD,UAAU,IACX,cAAC,kBAAD,QACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,QAAQ,EAAGQ,QAAQ,IAAIuB,KAAK,KAAKmB,SAFlC;AAGC,IAAA,OAAO,EAAC,WAHT;AAIC,IAAA,OAAO,MAJR;AAKC,IAAA,OAAO,EAAGqB;AALX,KAOGtG,EAAE,CAAE,OAAF,CAPL,CADD,CAvFF,CAPD,CADD;AA8GA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAM+G,YAAY,GAAG3G,UAAU,CAAEuB,uBAAF,CAA/B;AAEP,eAAeoF,YAAf","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,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { createElement } from "@wordpress/element";
3
- // @ts-nocheck
4
3
 
5
4
  /**
6
5
  * WordPress dependencies
@@ -15,8 +14,8 @@ import { useDebouncedHoverInteraction } from './utils';
15
14
 
16
15
  const noop = () => {};
17
16
 
18
- function InputRange(_ref, ref) {
19
- let {
17
+ function InputRange(props, ref) {
18
+ const {
20
19
  describedBy,
21
20
  label,
22
21
  onHideTooltip = noop,
@@ -24,15 +23,15 @@ function InputRange(_ref, ref) {
24
23
  onMouseMove = noop,
25
24
  onShowTooltip = noop,
26
25
  value,
27
- ...props
28
- } = _ref;
26
+ ...otherProps
27
+ } = props;
29
28
  const hoverInteractions = useDebouncedHoverInteraction({
30
29
  onHide: onHideTooltip,
31
30
  onMouseLeave,
32
31
  onMouseMove,
33
32
  onShow: onShowTooltip
34
33
  });
35
- return createElement(BaseInputRange, _extends({}, props, hoverInteractions, {
34
+ return createElement(BaseInputRange, _extends({}, otherProps, hoverInteractions, {
36
35
  "aria-describedby": describedBy,
37
36
  "aria-label": label,
38
37
  "aria-hidden": false,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/range-control/input-range.js"],"names":["forwardRef","InputRange","BaseInputRange","useDebouncedHoverInteraction","noop","ref","describedBy","label","onHideTooltip","onMouseLeave","onMouseMove","onShowTooltip","value","props","hoverInteractions","onHide","onShow","ForwardedComponent"],"mappings":";;AAAA;;AACA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,SAASC,UAAU,IAAIC,cAAvB,QAA6C,+BAA7C;AACA,SAASC,4BAAT,QAA6C,SAA7C;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASH,UAAT,OAWCI,GAXD,EAYE;AAAA,MAXD;AACCC,IAAAA,WADD;AAECC,IAAAA,KAFD;AAGCC,IAAAA,aAAa,GAAGJ,IAHjB;AAICK,IAAAA,YAAY,GAAGL,IAJhB;AAKCM,IAAAA,WAAW,GAAGN,IALf;AAMCO,IAAAA,aAAa,GAAGP,IANjB;AAOCQ,IAAAA,KAPD;AAQC,OAAGC;AARJ,GAWC;AACD,QAAMC,iBAAiB,GAAGX,4BAA4B,CAAE;AACvDY,IAAAA,MAAM,EAAEP,aAD+C;AAEvDC,IAAAA,YAFuD;AAGvDC,IAAAA,WAHuD;AAIvDM,IAAAA,MAAM,EAAEL;AAJ+C,GAAF,CAAtD;AAOA,SACC,cAAC,cAAD,eACME,KADN,EAEMC,iBAFN;AAGC,wBAAmBR,WAHpB;AAIC,kBAAaC,KAJd;AAKC,mBAAc,KALf;AAMC,IAAA,GAAG,EAAGF,GANP;AAOC,IAAA,QAAQ,EAAG,CAPZ;AAQC,IAAA,IAAI,EAAC,OARN;AASC,IAAA,KAAK,EAAGO;AATT,KADD;AAaA;;AAED,MAAMK,kBAAkB,GAAGjB,UAAU,CAAEC,UAAF,CAArC;AAEA,eAAegB,kBAAf","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { InputRange as BaseInputRange } from './styles/range-control-styles';\nimport { useDebouncedHoverInteraction } from './utils';\n\nconst noop = () => {};\n\nfunction InputRange(\n\t{\n\t\tdescribedBy,\n\t\tlabel,\n\t\tonHideTooltip = noop,\n\t\tonMouseLeave = noop,\n\t\tonMouseMove = noop,\n\t\tonShowTooltip = noop,\n\t\tvalue,\n\t\t...props\n\t},\n\tref\n) {\n\tconst hoverInteractions = useDebouncedHoverInteraction( {\n\t\tonHide: onHideTooltip,\n\t\tonMouseLeave,\n\t\tonMouseMove,\n\t\tonShow: onShowTooltip,\n\t} );\n\n\treturn (\n\t\t<BaseInputRange\n\t\t\t{ ...props }\n\t\t\t{ ...hoverInteractions }\n\t\t\taria-describedby={ describedBy }\n\t\t\taria-label={ label }\n\t\t\taria-hidden={ false }\n\t\t\tref={ ref }\n\t\t\ttabIndex={ 0 }\n\t\t\ttype=\"range\"\n\t\t\tvalue={ value }\n\t\t/>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( InputRange );\n\nexport default ForwardedComponent;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/range-control/input-range.tsx"],"names":["forwardRef","InputRange","BaseInputRange","useDebouncedHoverInteraction","noop","props","ref","describedBy","label","onHideTooltip","onMouseLeave","onMouseMove","onShowTooltip","value","otherProps","hoverInteractions","onHide","onShow","ForwardedComponent"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,SAASC,UAAU,IAAIC,cAAvB,QAA6C,+BAA7C;AACA,SAASC,4BAAT,QAA6C,SAA7C;;AAKA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASH,UAAT,CACCI,KADD,EAECC,GAFD,EAGE;AACD,QAAM;AACLC,IAAAA,WADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,aAAa,GAAGL,IAHX;AAILM,IAAAA,YAAY,GAAGN,IAJV;AAKLO,IAAAA,WAAW,GAAGP,IALT;AAMLQ,IAAAA,aAAa,GAAGR,IANX;AAOLS,IAAAA,KAPK;AAQL,OAAGC;AARE,MASFT,KATJ;AAWA,QAAMU,iBAAiB,GAAGZ,4BAA4B,CAAE;AACvDa,IAAAA,MAAM,EAAEP,aAD+C;AAEvDC,IAAAA,YAFuD;AAGvDC,IAAAA,WAHuD;AAIvDM,IAAAA,MAAM,EAAEL;AAJ+C,GAAF,CAAtD;AAOA,SACC,cAAC,cAAD,eACME,UADN,EAEMC,iBAFN;AAGC,wBAAmBR,WAHpB;AAIC,kBAAaC,KAJd;AAKC,mBAAc,KALf;AAMC,IAAA,GAAG,EAAGF,GANP;AAOC,IAAA,QAAQ,EAAG,CAPZ;AAQC,IAAA,IAAI,EAAC,OARN;AASC,IAAA,KAAK,EAAGO;AATT,KADD;AAaA;;AAED,MAAMK,kBAAkB,GAAGlB,UAAU,CAAEC,UAAF,CAArC;AAEA,eAAeiB,kBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { InputRange as BaseInputRange } from './styles/range-control-styles';\nimport { useDebouncedHoverInteraction } from './utils';\n\nimport type { InputRangeProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nconst noop = () => {};\n\nfunction InputRange(\n\tprops: WordPressComponentProps< InputRangeProps, 'input' >,\n\tref: React.ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\tdescribedBy,\n\t\tlabel,\n\t\tonHideTooltip = noop,\n\t\tonMouseLeave = noop,\n\t\tonMouseMove = noop,\n\t\tonShowTooltip = noop,\n\t\tvalue,\n\t\t...otherProps\n\t} = props;\n\n\tconst hoverInteractions = useDebouncedHoverInteraction( {\n\t\tonHide: onHideTooltip,\n\t\tonMouseLeave,\n\t\tonMouseMove,\n\t\tonShow: onShowTooltip,\n\t} );\n\n\treturn (\n\t\t<BaseInputRange\n\t\t\t{ ...otherProps }\n\t\t\t{ ...hoverInteractions }\n\t\t\taria-describedby={ describedBy }\n\t\t\taria-label={ label }\n\t\t\taria-hidden={ false }\n\t\t\tref={ ref }\n\t\t\ttabIndex={ 0 }\n\t\t\ttype=\"range\"\n\t\t\tvalue={ value }\n\t\t/>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( InputRange );\n\nexport default ForwardedComponent;\n"]}
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { createElement, Fragment } from "@wordpress/element";
3
- // @ts-nocheck
4
3
 
5
4
  /**
6
5
  * External dependencies
@@ -11,17 +10,17 @@ import classnames from 'classnames';
11
10
  */
12
11
 
13
12
  import { Mark, MarkLabel } from './styles/range-control-styles';
14
- export default function RangeMark(_ref) {
15
- let {
13
+ export default function RangeMark(props) {
14
+ const {
16
15
  className,
17
16
  isFilled = false,
18
17
  label,
19
18
  style = {},
20
- ...props
21
- } = _ref;
19
+ ...otherProps
20
+ } = props;
22
21
  const classes = classnames('components-range-control__mark', isFilled && 'is-filled', className);
23
22
  const labelClasses = classnames('components-range-control__mark-label', isFilled && 'is-filled');
24
- return createElement(Fragment, null, createElement(Mark, _extends({}, props, {
23
+ return createElement(Fragment, null, createElement(Mark, _extends({}, otherProps, {
25
24
  "aria-hidden": "true",
26
25
  className: classes,
27
26
  isFilled: isFilled,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/range-control/mark.js"],"names":["classnames","Mark","MarkLabel","RangeMark","className","isFilled","label","style","props","classes","labelClasses"],"mappings":";;AAAA;;AACA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,IAAT,EAAeC,SAAf,QAAgC,+BAAhC;AAEA,eAAe,SAASC,SAAT,OAMX;AAAA,MAN+B;AAClCC,IAAAA,SADkC;AAElCC,IAAAA,QAAQ,GAAG,KAFuB;AAGlCC,IAAAA,KAHkC;AAIlCC,IAAAA,KAAK,GAAG,EAJ0B;AAKlC,OAAGC;AAL+B,GAM/B;AACH,QAAMC,OAAO,GAAGT,UAAU,CACzB,gCADyB,EAEzBK,QAAQ,IAAI,WAFa,EAGzBD,SAHyB,CAA1B;AAKA,QAAMM,YAAY,GAAGV,UAAU,CAC9B,sCAD8B,EAE9BK,QAAQ,IAAI,WAFkB,CAA/B;AAKA,SACC,8BACC,cAAC,IAAD,eACMG,KADN;AAEC,mBAAY,MAFb;AAGC,IAAA,SAAS,EAAGC,OAHb;AAIC,IAAA,QAAQ,EAAGJ,QAJZ;AAKC,IAAA,KAAK,EAAGE;AALT,KADD,EAQGD,KAAK,IACN,cAAC,SAAD;AACC,mBAAY,MADb;AAEC,IAAA,SAAS,EAAGI,YAFb;AAGC,IAAA,QAAQ,EAAGL,QAHZ;AAIC,IAAA,KAAK,EAAGE;AAJT,KAMGD,KANH,CATF,CADD;AAqBA","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport { Mark, MarkLabel } from './styles/range-control-styles';\n\nexport default function RangeMark( {\n\tclassName,\n\tisFilled = false,\n\tlabel,\n\tstyle = {},\n\t...props\n} ) {\n\tconst classes = classnames(\n\t\t'components-range-control__mark',\n\t\tisFilled && 'is-filled',\n\t\tclassName\n\t);\n\tconst labelClasses = classnames(\n\t\t'components-range-control__mark-label',\n\t\tisFilled && 'is-filled'\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<Mark\n\t\t\t\t{ ...props }\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName={ classes }\n\t\t\t\tisFilled={ isFilled }\n\t\t\t\tstyle={ style }\n\t\t\t/>\n\t\t\t{ label && (\n\t\t\t\t<MarkLabel\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclassName={ labelClasses }\n\t\t\t\t\tisFilled={ isFilled }\n\t\t\t\t\tstyle={ style }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</MarkLabel>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/range-control/mark.tsx"],"names":["classnames","Mark","MarkLabel","RangeMark","props","className","isFilled","label","style","otherProps","classes","labelClasses"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,IAAT,EAAeC,SAAf,QAAgC,+BAAhC;AAKA,eAAe,SAASC,SAAT,CACdC,KADc,EAEb;AACD,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,QAAQ,GAAG,KAFN;AAGLC,IAAAA,KAHK;AAILC,IAAAA,KAAK,GAAG,EAJH;AAKL,OAAGC;AALE,MAMFL,KANJ;AAQA,QAAMM,OAAO,GAAGV,UAAU,CACzB,gCADyB,EAEzBM,QAAQ,IAAI,WAFa,EAGzBD,SAHyB,CAA1B;AAKA,QAAMM,YAAY,GAAGX,UAAU,CAC9B,sCAD8B,EAE9BM,QAAQ,IAAI,WAFkB,CAA/B;AAKA,SACC,8BACC,cAAC,IAAD,eACMG,UADN;AAEC,mBAAY,MAFb;AAGC,IAAA,SAAS,EAAGC,OAHb;AAIC,IAAA,QAAQ,EAAGJ,QAJZ;AAKC,IAAA,KAAK,EAAGE;AALT,KADD,EAQGD,KAAK,IACN,cAAC,SAAD;AACC,mBAAY,MADb;AAEC,IAAA,SAAS,EAAGI,YAFb;AAGC,IAAA,QAAQ,EAAGL,QAHZ;AAIC,IAAA,KAAK,EAAGE;AAJT,KAMGD,KANH,CATF,CADD;AAqBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport { Mark, MarkLabel } from './styles/range-control-styles';\n\nimport type { RangeMarkProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nexport default function RangeMark(\n\tprops: WordPressComponentProps< RangeMarkProps, 'span' >\n) {\n\tconst {\n\t\tclassName,\n\t\tisFilled = false,\n\t\tlabel,\n\t\tstyle = {},\n\t\t...otherProps\n\t} = props;\n\n\tconst classes = classnames(\n\t\t'components-range-control__mark',\n\t\tisFilled && 'is-filled',\n\t\tclassName\n\t);\n\tconst labelClasses = classnames(\n\t\t'components-range-control__mark-label',\n\t\tisFilled && 'is-filled'\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<Mark\n\t\t\t\t{ ...otherProps }\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName={ classes }\n\t\t\t\tisFilled={ isFilled }\n\t\t\t\tstyle={ style }\n\t\t\t/>\n\t\t\t{ label && (\n\t\t\t\t<MarkLabel\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclassName={ labelClasses }\n\t\t\t\t\tisFilled={ isFilled }\n\t\t\t\t\tstyle={ style }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</MarkLabel>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { createElement, Fragment } from "@wordpress/element";
3
- // @ts-nocheck
4
3
 
5
4
  /**
6
5
  * WordPress dependencies
@@ -12,8 +11,8 @@ import { isRTL } from '@wordpress/i18n';
12
11
 
13
12
  import RangeMark from './mark';
14
13
  import { MarksWrapper, Rail } from './styles/range-control-styles';
15
- export default function RangeRail(_ref) {
16
- let {
14
+ export default function RangeRail(props) {
15
+ const {
17
16
  disabled = false,
18
17
  marks = false,
19
18
  min = 0,
@@ -21,7 +20,7 @@ export default function RangeRail(_ref) {
21
20
  step = 1,
22
21
  value = 0,
23
22
  ...restProps
24
- } = _ref;
23
+ } = props;
25
24
  return createElement(Fragment, null, createElement(Rail, _extends({
26
25
  disabled: disabled
27
26
  }, restProps)), marks && createElement(Marks, {
@@ -34,20 +33,16 @@ export default function RangeRail(_ref) {
34
33
  }));
35
34
  }
36
35
 
37
- function Marks(_ref2) {
38
- let {
36
+ function Marks(props) {
37
+ const {
39
38
  disabled = false,
40
39
  marks = false,
41
40
  min = 0,
42
41
  max = 100,
43
- step = 1,
42
+ step: stepProp = 1,
44
43
  value = 0
45
- } = _ref2;
46
-
47
- if (step === 'any') {
48
- step = 1;
49
- }
50
-
44
+ } = props;
45
+ const step = stepProp === 'any' ? 1 : stepProp;
51
46
  const marksData = useMarks({
52
47
  marks,
53
48
  min,
@@ -65,14 +60,14 @@ function Marks(_ref2) {
65
60
  }))));
66
61
  }
67
62
 
68
- function useMarks(_ref3) {
63
+ function useMarks(_ref) {
69
64
  let {
70
65
  marks,
71
66
  min = 0,
72
67
  max = 100,
73
68
  step = 1,
74
69
  value = 0
75
- } = _ref3;
70
+ } = _ref;
76
71
 
77
72
  if (!marks) {
78
73
  return [];
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/range-control/rail.js"],"names":["isRTL","RangeMark","MarksWrapper","Rail","RangeRail","disabled","marks","min","max","step","value","restProps","Marks","marksData","useMarks","map","mark","key","range","Array","isArray","count","Math","round","push","length","placedMarks","forEach","index","isFilled","offset","offsetStyle","style"],"mappings":";;AAAA;;AACA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,iBAAtB;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,QAAtB;AACA,SAASC,YAAT,EAAuBC,IAAvB,QAAmC,+BAAnC;AAEA,eAAe,SAASC,SAAT,OAQX;AAAA,MAR+B;AAClCC,IAAAA,QAAQ,GAAG,KADuB;AAElCC,IAAAA,KAAK,GAAG,KAF0B;AAGlCC,IAAAA,GAAG,GAAG,CAH4B;AAIlCC,IAAAA,GAAG,GAAG,GAJ4B;AAKlCC,IAAAA,IAAI,GAAG,CAL2B;AAMlC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ordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport RangeMark from './mark';\nimport { MarksWrapper, Rail } from './styles/range-control-styles';\n\nexport default function RangeRail( {\n\tdisabled = false,\n\tmarks = false,\n\tmin = 0,\n\tmax = 100,\n\tstep = 1,\n\tvalue = 0,\n\t...restProps\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<Rail disabled={ disabled } { ...restProps } />\n\t\t\t{ marks && (\n\t\t\t\t<Marks\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tmarks={ marks }\n\t\t\t\t\tmin={ min }\n\t\t\t\t\tmax={ max }\n\t\t\t\t\tstep={ step }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction Marks( {\n\tdisabled = false,\n\tmarks = false,\n\tmin = 0,\n\tmax = 100,\n\tstep = 1,\n\tvalue = 0,\n} ) {\n\tif ( step === 'any' ) {\n\t\tstep = 1;\n\t}\n\tconst marksData = useMarks( { marks, min, max, step, value } );\n\n\treturn (\n\t\t<MarksWrapper\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName=\"components-range-control__marks\"\n\t\t>\n\t\t\t{ marksData.map( ( mark ) => (\n\t\t\t\t<RangeMark\n\t\t\t\t\t{ ...mark }\n\t\t\t\t\tkey={ mark.key }\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</MarksWrapper>\n\t);\n}\n\nfunction useMarks( { marks, min = 0, max = 100, step = 1, value = 0 } ) {\n\tif ( ! marks ) {\n\t\treturn [];\n\t}\n\n\tconst range = max - min;\n\tif ( ! Array.isArray( marks ) ) {\n\t\tmarks = [];\n\t\tconst count = 1 + Math.round( range / step );\n\t\twhile ( count > marks.push( { value: step * marks.length + min } ) );\n\t}\n\n\tconst placedMarks = [];\n\tmarks.forEach( ( mark, index ) => {\n\t\tif ( mark.value < min || mark.value > max ) {\n\t\t\treturn;\n\t\t}\n\t\tconst key = `mark-${ index }`;\n\t\tconst isFilled = mark.value <= value;\n\t\tconst offset = `${ ( ( mark.value - min ) / range ) * 100 }%`;\n\n\t\tconst offsetStyle = {\n\t\t\t[ isRTL() ? 'right' : 'left' ]: offset,\n\t\t};\n\n\t\tplacedMarks.push( {\n\t\t\t...mark,\n\t\t\tisFilled,\n\t\t\tkey,\n\t\t\tstyle: offsetStyle,\n\t\t} );\n\t} );\n\n\treturn placedMarks;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/range-control/rail.tsx"],"names":["isRTL","RangeMark","MarksWrapper","Rail","RangeRail","props","disabled","marks","min","max","step","value","restProps","Marks","stepProp","marksData","useMarks","map","mark","key","range","Array","isArray","count","Math","round","push","length","placedMarks","forEach","index","isFilled","offset","offsetStyle","style"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,iBAAtB;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,QAAtB;AACA,SAASC,YAAT,EAAuBC,IAAvB,QAAmC,+BAAnC;AAUA,eAAe,SAASC,SAAT,CACdC,KADc,EAEb;AACD,QAAM;AACLC,IAAAA,QAAQ,GAAG,KADN;AAELC,IAAAA,KAAK,GAAG,KAFH;AAGLC,IAAAA,GAAG,GAAG,CAHD;AAILC,IAAAA,GAAG,GAAG,GAJD;AAKLC,IAAAA,IAAI,GAAG,CALF;AAMLC,IAAAA,KAAK,GAAG,CANH;AAOL,OAAGC;AAPE,MAQFP,KARJ;AAUA,SACC,8BACC,cAAC,IAAD;AAAM,IAAA,QAAQ,EAAGC;AAAjB,KAAiCM,SAAjC,EADD,EAEGL,KAAK,IACN,cAAC,KAAD;AACC,IAAA,QAAQ,EAAGD,QADZ;AAEC,IAAA,KAAK,EAAGC,KAFT;AAGC,IAAA,GAAG,EAAGC,GAHP;AAIC,IAAA,GAAG,EAAGC,GAJP;AAKC,IAAA,IAAI,EAAGC,IALR;AA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I,CAACC,KAAL,CAAYL,KAAK,GAAGV,IAApB,CAAlB;;AACA,WAAQa,KAAK,GAAGhB,KAAK,CAACmB,IAAN,CAAY;AAAEf,MAAAA,KAAK,EAAED,IAAI,GAAGH,KAAK,CAACoB,MAAb,GAAsBnB;AAA/B,KAAZ,CAAhB,CAAoE;AACpE;;AAED,QAAMoB,WAA6B,GAAG,EAAtC;AACArB,EAAAA,KAAK,CAACsB,OAAN,CAAe,CAAEX,IAAF,EAAQY,KAAR,KAAmB;AACjC,QAAKZ,IAAI,CAACP,KAAL,GAAaH,GAAb,IAAoBU,IAAI,CAACP,KAAL,GAAaF,GAAtC,EAA4C;AAC3C;AACA;;AACD,UAAMU,GAAG,GAAI,QAAQW,KAAO,EAA5B;AACA,UAAMC,QAAQ,GAAGb,IAAI,CAACP,KAAL,IAAcA,KAA/B;AACA,UAAMqB,MAAM,GAAI,GAAK,CAAEd,IAAI,CAACP,KAAL,GAAaH,GAAf,IAAuBY,KAAzB,GAAmC,GAAK,GAA3D;AAEA,UAAMa,WAAW,GAAG;AACnB,OAAEjC,KAAK,KAAK,OAAL,GAAe,MAAtB,GAAgCgC;AADb,KAApB;AAIAJ,IAAAA,WAAW,CAACF,IAAZ,CAAkB,EACjB,GAAGR,IADc;AAEjBa,MAAAA,QAFiB;AAGjBZ,MAAAA,GAHiB;AAIjBe,MAAAA,KAAK,EAAED;AAJU,KAAlB;AAMA,GAlBD;AAoBA,SAAOL,WAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport RangeMark from './mark';\nimport { MarksWrapper, Rail } from './styles/range-control-styles';\n\nimport type { WordPressComponentProps } from '../ui/context';\nimport type {\n\tMarksProps,\n\tRangeMarkProps,\n\tRailProps,\n\tUseMarksArgs,\n} from './types';\n\nexport default function RangeRail(\n\tprops: WordPressComponentProps< RailProps, 'span' >\n) {\n\tconst {\n\t\tdisabled = false,\n\t\tmarks = false,\n\t\tmin = 0,\n\t\tmax = 100,\n\t\tstep = 1,\n\t\tvalue = 0,\n\t\t...restProps\n\t} = props;\n\n\treturn (\n\t\t<>\n\t\t\t<Rail disabled={ disabled } { ...restProps } />\n\t\t\t{ marks && (\n\t\t\t\t<Marks\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tmarks={ marks }\n\t\t\t\t\tmin={ min }\n\t\t\t\t\tmax={ max }\n\t\t\t\t\tstep={ step }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction Marks( props: WordPressComponentProps< MarksProps, 'span' > ) {\n\tconst {\n\t\tdisabled = false,\n\t\tmarks = false,\n\t\tmin = 0,\n\t\tmax = 100,\n\t\tstep: stepProp = 1,\n\t\tvalue = 0,\n\t} = props;\n\n\tconst step = stepProp === 'any' ? 1 : stepProp;\n\tconst marksData = useMarks( { marks, min, max, step, value } );\n\n\treturn (\n\t\t<MarksWrapper\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName=\"components-range-control__marks\"\n\t\t>\n\t\t\t{ marksData.map( ( mark ) => (\n\t\t\t\t<RangeMark\n\t\t\t\t\t{ ...mark }\n\t\t\t\t\tkey={ mark.key }\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</MarksWrapper>\n\t);\n}\n\nfunction useMarks( {\n\tmarks,\n\tmin = 0,\n\tmax = 100,\n\tstep = 1,\n\tvalue = 0,\n}: UseMarksArgs ) {\n\tif ( ! marks ) {\n\t\treturn [];\n\t}\n\n\tconst range = max - min;\n\tif ( ! Array.isArray( marks ) ) {\n\t\tmarks = [];\n\t\tconst count = 1 + Math.round( range / step );\n\t\twhile ( count > marks.push( { value: step * marks.length + min } ) );\n\t}\n\n\tconst placedMarks: RangeMarkProps[] = [];\n\tmarks.forEach( ( mark, index ) => {\n\t\tif ( mark.value < min || mark.value > max ) {\n\t\t\treturn;\n\t\t}\n\t\tconst key = `mark-${ index }`;\n\t\tconst isFilled = mark.value <= value;\n\t\tconst offset = `${ ( ( mark.value - min ) / range ) * 100 }%`;\n\n\t\tconst offsetStyle = {\n\t\t\t[ isRTL() ? 'right' : 'left' ]: offset,\n\t\t};\n\n\t\tplacedMarks.push( {\n\t\t\t...mark,\n\t\t\tisFilled,\n\t\t\tkey,\n\t\t\tstyle: offsetStyle,\n\t\t} );\n\t} );\n\n\treturn placedMarks;\n}\n"]}