@wordpress/components 25.6.0 → 25.6.1

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 (438) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/CONTRIBUTING.md +1 -1
  3. package/build/color-palette/utils.js +2 -9
  4. package/build/color-palette/utils.js.map +1 -1
  5. package/build/sandbox/index.js +1 -1
  6. package/build/sandbox/index.js.map +1 -1
  7. package/build/slot-fill/bubbles-virtually/slot-fill-context.js +1 -1
  8. package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  9. package/build/snackbar/index.js +1 -1
  10. package/build/snackbar/index.js.map +1 -1
  11. package/build/theme/color-algorithms.js +2 -2
  12. package/build/theme/color-algorithms.js.map +1 -1
  13. package/build/toolbar/toolbar-item/index.js +1 -1
  14. package/build/toolbar/toolbar-item/index.js.map +1 -1
  15. package/build/toolbar/toolbar-item/index.native.js +1 -1
  16. package/build/toolbar/toolbar-item/index.native.js.map +1 -1
  17. package/build/ui/context/constants.js +2 -6
  18. package/build/ui/context/constants.js.map +1 -1
  19. package/build/ui/context/context-connect.js +1 -1
  20. package/build/ui/context/context-connect.js.map +1 -1
  21. package/build/ui/context/context-system-provider.js +1 -1
  22. package/build/ui/context/context-system-provider.js.map +1 -1
  23. package/build/ui/context/use-context-system.js +1 -1
  24. package/build/ui/context/use-context-system.js.map +1 -1
  25. package/build/utils/math.js +0 -12
  26. package/build/utils/math.js.map +1 -1
  27. package/build/utils/values.js +3 -66
  28. package/build/utils/values.js.map +1 -1
  29. package/build-module/color-palette/utils.js +0 -6
  30. package/build-module/color-palette/utils.js.map +1 -1
  31. package/build-module/sandbox/index.js +1 -1
  32. package/build-module/sandbox/index.js.map +1 -1
  33. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +1 -1
  34. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  35. package/build-module/snackbar/index.js +1 -1
  36. package/build-module/snackbar/index.js.map +1 -1
  37. package/build-module/theme/color-algorithms.js +2 -2
  38. package/build-module/theme/color-algorithms.js.map +1 -1
  39. package/build-module/toolbar/toolbar-item/index.js +1 -1
  40. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  41. package/build-module/toolbar/toolbar-item/index.native.js +1 -1
  42. package/build-module/toolbar/toolbar-item/index.native.js.map +1 -1
  43. package/build-module/ui/context/constants.js +0 -2
  44. package/build-module/ui/context/constants.js.map +1 -1
  45. package/build-module/ui/context/context-connect.js +1 -1
  46. package/build-module/ui/context/context-connect.js.map +1 -1
  47. package/build-module/ui/context/context-system-provider.js +1 -1
  48. package/build-module/ui/context/context-system-provider.js.map +1 -1
  49. package/build-module/ui/context/use-context-system.js +1 -1
  50. package/build-module/ui/context/use-context-system.js.map +1 -1
  51. package/build-module/utils/math.js +0 -11
  52. package/build-module/utils/math.js.map +1 -1
  53. package/build-module/utils/values.js +0 -60
  54. package/build-module/utils/values.js.map +1 -1
  55. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  56. package/build-types/color-palette/utils.d.ts +0 -1
  57. package/build-types/color-palette/utils.d.ts.map +1 -1
  58. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  59. package/build-types/item-group/item/hook.d.ts +1 -1
  60. package/build-types/sandbox/index.d.ts.map +1 -1
  61. package/build-types/search-control/stories/index.story.d.ts +0 -14
  62. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  63. package/build-types/ui/context/constants.d.ts +0 -2
  64. package/build-types/ui/context/constants.d.ts.map +1 -1
  65. package/build-types/utils/math.d.ts +0 -8
  66. package/build-types/utils/math.d.ts.map +1 -1
  67. package/build-types/utils/values.d.ts +0 -13
  68. package/build-types/utils/values.d.ts.map +1 -1
  69. package/package.json +19 -19
  70. package/src/alignment-matrix-control/stories/index.story.tsx +1 -1
  71. package/src/alignment-matrix-control/test/index.tsx +6 -2
  72. package/src/angle-picker-control/stories/index.story.tsx +1 -1
  73. package/src/animate/stories/index.story.tsx +1 -1
  74. package/src/base-control/stories/index.story.tsx +1 -1
  75. package/src/border-box-control/stories/index.story.tsx +1 -1
  76. package/src/border-control/stories/index.story.tsx +1 -1
  77. package/src/button/stories/index.story.tsx +1 -1
  78. package/src/button-group/stories/index.story.tsx +1 -1
  79. package/src/card/stories/index.story.tsx +1 -1
  80. package/src/checkbox-control/stories/index.story.tsx +1 -1
  81. package/src/circular-option-picker/stories/index.story.tsx +4 -1
  82. package/src/color-indicator/stories/index.story.tsx +1 -1
  83. package/src/color-palette/stories/index.story.tsx +1 -1
  84. package/src/color-palette/test/index.tsx +15 -9
  85. package/src/color-palette/test/utils.ts +0 -15
  86. package/src/color-palette/utils.ts +0 -7
  87. package/src/color-picker/stories/index.story.tsx +1 -1
  88. package/src/combobox-control/stories/index.story.tsx +1 -1
  89. package/src/confirm-dialog/stories/index.story.js +1 -1
  90. package/src/custom-gradient-picker/stories/index.story.tsx +1 -1
  91. package/src/date-time/stories/date-time.story.tsx +1 -1
  92. package/src/date-time/stories/date.story.tsx +1 -1
  93. package/src/date-time/stories/time.story.tsx +1 -1
  94. package/src/dimension-control/stories/index.story.tsx +1 -1
  95. package/src/disabled/stories/index.story.tsx +1 -1
  96. package/src/divider/stories/index.story.tsx +1 -1
  97. package/src/drop-zone/stories/index.story.tsx +1 -1
  98. package/src/dropdown-menu/stories/index.story.tsx +1 -1
  99. package/src/dropdown-menu-v2/stories/index.story.tsx +4 -1
  100. package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
  101. package/src/duotone-picker/stories/duotone-swatch.story.tsx +1 -1
  102. package/src/elevation/stories/index.story.tsx +1 -1
  103. package/src/external-link/stories/index.story.tsx +1 -1
  104. package/src/flex/stories/index.story.tsx +1 -1
  105. package/src/focal-point-picker/stories/index.story.tsx +1 -1
  106. package/src/font-size-picker/stories/index.story.tsx +1 -1
  107. package/src/form-file-upload/stories/index.story.tsx +1 -1
  108. package/src/form-toggle/stories/index.story.tsx +1 -1
  109. package/src/form-token-field/stories/index.story.tsx +1 -1
  110. package/src/gradient-picker/stories/index.story.tsx +1 -1
  111. package/src/grid/stories/index.story.tsx +1 -1
  112. package/src/h-stack/stories/index.story.tsx +1 -1
  113. package/src/heading/stories/index.story.tsx +1 -1
  114. package/src/icon/stories/index.story.tsx +1 -1
  115. package/src/input-control/stories/index.story.tsx +1 -1
  116. package/src/item-group/stories/index.story.tsx +1 -1
  117. package/src/keyboard-shortcuts/stories/index.story.tsx +1 -1
  118. package/src/menu-group/stories/index.story.tsx +1 -1
  119. package/src/menu-items-choice/stories/index.story.tsx +1 -1
  120. package/src/navigable-container/stories/navigable-menu.story.tsx +1 -1
  121. package/src/navigable-container/stories/tabbable-container.story.tsx +1 -1
  122. package/src/navigation/stories/index.story.tsx +1 -1
  123. package/src/navigator/stories/index.story.tsx +1 -1
  124. package/src/notice/stories/index.story.tsx +1 -1
  125. package/src/number-control/stories/index.story.tsx +1 -1
  126. package/src/palette-edit/stories/index.story.tsx +1 -1
  127. package/src/panel/stories/index.story.tsx +1 -1
  128. package/src/placeholder/stories/index.story.tsx +1 -1
  129. package/src/progress-bar/stories/index.story.tsx +1 -1
  130. package/src/query-controls/stories/index.story.tsx +1 -1
  131. package/src/radio-control/stories/index.story.tsx +1 -1
  132. package/src/range-control/stories/index.story.tsx +1 -1
  133. package/src/resizable-box/stories/index.story.tsx +1 -1
  134. package/src/responsive-wrapper/stories/index.story.tsx +1 -1
  135. package/src/sandbox/index.tsx +4 -1
  136. package/src/sandbox/stories/index.story.tsx +1 -1
  137. package/src/scroll-lock/stories/index.story.tsx +1 -1
  138. package/src/scrollable/stories/index.story.tsx +1 -1
  139. package/src/search-control/stories/index.story.tsx +1 -1
  140. package/src/select-control/stories/index.story.tsx +1 -1
  141. package/src/slot-fill/stories/index.story.js +1 -1
  142. package/src/snackbar/stories/index.story.tsx +1 -1
  143. package/src/snackbar/stories/list.story.tsx +1 -1
  144. package/src/spacer/stories/index.story.tsx +1 -1
  145. package/src/spinner/stories/index.story.tsx +1 -1
  146. package/src/surface/stories/index.story.tsx +1 -1
  147. package/src/tab-panel/stories/index.story.tsx +1 -1
  148. package/src/text/test/index.tsx +1 -1
  149. package/src/text-control/stories/index.story.tsx +1 -1
  150. package/src/text-highlight/stories/index.story.tsx +1 -1
  151. package/src/textarea-control/stories/index.story.tsx +1 -1
  152. package/src/theme/stories/index.story.tsx +2 -2
  153. package/src/tip/stories/index.story.tsx +1 -1
  154. package/src/toggle-control/stories/index.story.tsx +1 -1
  155. package/src/toggle-group-control/stories/index.story.tsx +1 -1
  156. package/src/toolbar/stories/index.story.tsx +1 -1
  157. package/src/tools-panel/stories/index.story.tsx +1 -1
  158. package/src/tooltip/stories/index.story.js +1 -1
  159. package/src/tree-select/stories/index.story.tsx +1 -1
  160. package/src/truncate/stories/index.story.tsx +1 -1
  161. package/src/ui/context/constants.js +0 -2
  162. package/src/unit-control/stories/index.story.tsx +1 -1
  163. package/src/utils/math.js +0 -11
  164. package/src/utils/values.js +0 -81
  165. package/src/v-stack/stories/index.story.tsx +1 -1
  166. package/src/view/stories/index.story.tsx +1 -1
  167. package/src/visually-hidden/stories/index.story.tsx +1 -1
  168. package/src/z-stack/stories/index.story.tsx +1 -1
  169. package/tsconfig.tsbuildinfo +1 -1
  170. package/build/ui/utils/get-high-dpi.js +0 -16
  171. package/build/ui/utils/get-high-dpi.js.map +0 -1
  172. package/build/utils/browsers.js +0 -32
  173. package/build/utils/browsers.js.map +0 -1
  174. package/build/utils/events.js +0 -43
  175. package/build/utils/events.js.map +0 -1
  176. package/build-module/ui/utils/get-high-dpi.js +0 -11
  177. package/build-module/ui/utils/get-high-dpi.js.map +0 -1
  178. package/build-module/utils/browsers.js +0 -25
  179. package/build-module/utils/browsers.js.map +0 -1
  180. package/build-module/utils/events.js +0 -37
  181. package/build-module/utils/events.js.map +0 -1
  182. package/build-types/alignment-matrix-control/stories/index.d.ts +0 -14
  183. package/build-types/alignment-matrix-control/stories/index.d.ts.map +0 -1
  184. package/build-types/angle-picker-control/stories/index.d.ts +0 -15
  185. package/build-types/angle-picker-control/stories/index.d.ts.map +0 -1
  186. package/build-types/animate/stories/index.d.ts +0 -18
  187. package/build-types/animate/stories/index.d.ts.map +0 -1
  188. package/build-types/base-control/stories/index.d.ts +0 -25
  189. package/build-types/base-control/stories/index.d.ts.map +0 -1
  190. package/build-types/border-box-control/stories/index.d.ts +0 -17
  191. package/build-types/border-box-control/stories/index.d.ts.map +0 -1
  192. package/build-types/border-control/stories/index.d.ts +0 -119
  193. package/build-types/border-control/stories/index.d.ts.map +0 -1
  194. package/build-types/button/stories/e2e/index.d.ts +0 -15
  195. package/build-types/button/stories/e2e/index.d.ts.map +0 -1
  196. package/build-types/button/stories/index.d.ts +0 -20
  197. package/build-types/button/stories/index.d.ts.map +0 -1
  198. package/build-types/button-group/stories/index.d.ts +0 -12
  199. package/build-types/button-group/stories/index.d.ts.map +0 -1
  200. package/build-types/card/stories/index.d.ts +0 -32
  201. package/build-types/card/stories/index.d.ts.map +0 -1
  202. package/build-types/checkbox-control/stories/index.d.ts +0 -13
  203. package/build-types/checkbox-control/stories/index.d.ts.map +0 -1
  204. package/build-types/circular-option-picker/stories/index.d.ts +0 -14
  205. package/build-types/circular-option-picker/stories/index.d.ts.map +0 -1
  206. package/build-types/color-indicator/stories/index.d.ts +0 -12
  207. package/build-types/color-indicator/stories/index.d.ts.map +0 -1
  208. package/build-types/color-palette/stories/index.d.ts +0 -46
  209. package/build-types/color-palette/stories/index.d.ts.map +0 -1
  210. package/build-types/color-picker/stories/index.d.ts +0 -19
  211. package/build-types/color-picker/stories/index.d.ts.map +0 -1
  212. package/build-types/combobox-control/stories/index.d.ts +0 -18
  213. package/build-types/combobox-control/stories/index.d.ts.map +0 -1
  214. package/build-types/custom-gradient-picker/stories/index.d.ts +0 -12
  215. package/build-types/custom-gradient-picker/stories/index.d.ts.map +0 -1
  216. package/build-types/date-time/stories/date-time.d.ts +0 -14
  217. package/build-types/date-time/stories/date-time.d.ts.map +0 -1
  218. package/build-types/date-time/stories/date.d.ts +0 -14
  219. package/build-types/date-time/stories/date.d.ts.map +0 -1
  220. package/build-types/date-time/stories/time.d.ts +0 -12
  221. package/build-types/date-time/stories/time.d.ts.map +0 -1
  222. package/build-types/dimension-control/stories/index.d.ts +0 -12
  223. package/build-types/dimension-control/stories/index.d.ts.map +0 -1
  224. package/build-types/disabled/stories/index.d.ts +0 -13
  225. package/build-types/disabled/stories/index.d.ts.map +0 -1
  226. package/build-types/divider/stories/index.d.ts +0 -11
  227. package/build-types/divider/stories/index.d.ts.map +0 -1
  228. package/build-types/draggable/stories/index.d.ts +0 -20
  229. package/build-types/draggable/stories/index.d.ts.map +0 -1
  230. package/build-types/drop-zone/stories/index.d.ts +0 -12
  231. package/build-types/drop-zone/stories/index.d.ts.map +0 -1
  232. package/build-types/dropdown/stories/index.d.ts +0 -23
  233. package/build-types/dropdown/stories/index.d.ts.map +0 -1
  234. package/build-types/dropdown-menu/stories/index.d.ts +0 -14
  235. package/build-types/dropdown-menu/stories/index.d.ts.map +0 -1
  236. package/build-types/dropdown-menu-v2/stories/index.d.ts +0 -11
  237. package/build-types/dropdown-menu-v2/stories/index.d.ts.map +0 -1
  238. package/build-types/duotone-picker/stories/duotone-picker.d.ts +0 -12
  239. package/build-types/duotone-picker/stories/duotone-picker.d.ts.map +0 -1
  240. package/build-types/duotone-picker/stories/duotone-swatch.d.ts +0 -14
  241. package/build-types/duotone-picker/stories/duotone-swatch.d.ts.map +0 -1
  242. package/build-types/elevation/stories/index.d.ts +0 -22
  243. package/build-types/elevation/stories/index.d.ts.map +0 -1
  244. package/build-types/external-link/stories/index.d.ts +0 -12
  245. package/build-types/external-link/stories/index.d.ts.map +0 -1
  246. package/build-types/flex/stories/index.d.ts +0 -13
  247. package/build-types/flex/stories/index.d.ts.map +0 -1
  248. package/build-types/focal-point-picker/stories/index.d.ts +0 -15
  249. package/build-types/focal-point-picker/stories/index.d.ts.map +0 -1
  250. package/build-types/font-size-picker/stories/e2e/index.d.ts +0 -16
  251. package/build-types/font-size-picker/stories/e2e/index.d.ts.map +0 -1
  252. package/build-types/font-size-picker/stories/index.d.ts +0 -31
  253. package/build-types/font-size-picker/stories/index.d.ts.map +0 -1
  254. package/build-types/form-file-upload/stories/index.d.ts +0 -23
  255. package/build-types/form-file-upload/stories/index.d.ts.map +0 -1
  256. package/build-types/form-toggle/stories/index.d.ts +0 -12
  257. package/build-types/form-toggle/stories/index.d.ts.map +0 -1
  258. package/build-types/form-token-field/stories/index.d.ts +0 -26
  259. package/build-types/form-token-field/stories/index.d.ts.map +0 -1
  260. package/build-types/gradient-picker/stories/index.d.ts +0 -14
  261. package/build-types/gradient-picker/stories/index.d.ts.map +0 -1
  262. package/build-types/grid/stories/index.d.ts +0 -9
  263. package/build-types/grid/stories/index.d.ts.map +0 -1
  264. package/build-types/guide/stories/index.d.ts +0 -9
  265. package/build-types/guide/stories/index.d.ts.map +0 -1
  266. package/build-types/h-stack/stories/e2e/index.d.ts +0 -9
  267. package/build-types/h-stack/stories/e2e/index.d.ts.map +0 -1
  268. package/build-types/h-stack/stories/index.d.ts +0 -9
  269. package/build-types/h-stack/stories/index.d.ts.map +0 -1
  270. package/build-types/heading/stories/index.d.ts +0 -12
  271. package/build-types/heading/stories/index.d.ts.map +0 -1
  272. package/build-types/icon/stories/index.d.ts +0 -22
  273. package/build-types/icon/stories/index.d.ts.map +0 -1
  274. package/build-types/input-control/stories/index.d.ts +0 -28
  275. package/build-types/input-control/stories/index.d.ts.map +0 -1
  276. package/build-types/item-group/stories/index.d.ts +0 -15
  277. package/build-types/item-group/stories/index.d.ts.map +0 -1
  278. package/build-types/keyboard-shortcuts/stories/index.d.ts +0 -12
  279. package/build-types/keyboard-shortcuts/stories/index.d.ts.map +0 -1
  280. package/build-types/menu-group/stories/index.d.ts +0 -17
  281. package/build-types/menu-group/stories/index.d.ts.map +0 -1
  282. package/build-types/menu-items-choice/stories/index.d.ts +0 -12
  283. package/build-types/menu-items-choice/stories/index.d.ts.map +0 -1
  284. package/build-types/modal/stories/index.d.ts +0 -10
  285. package/build-types/modal/stories/index.d.ts.map +0 -1
  286. package/build-types/navigable-container/stories/navigable-menu.d.ts +0 -12
  287. package/build-types/navigable-container/stories/navigable-menu.d.ts.map +0 -1
  288. package/build-types/navigable-container/stories/tabbable-container.d.ts +0 -12
  289. package/build-types/navigable-container/stories/tabbable-container.d.ts.map +0 -1
  290. package/build-types/navigation/stories/index.d.ts +0 -18
  291. package/build-types/navigation/stories/index.d.ts.map +0 -1
  292. package/build-types/navigator/stories/index.d.ts +0 -11
  293. package/build-types/navigator/stories/index.d.ts.map +0 -1
  294. package/build-types/notice/stories/index.d.ts +0 -17
  295. package/build-types/notice/stories/index.d.ts.map +0 -1
  296. package/build-types/number-control/stories/index.d.ts +0 -25
  297. package/build-types/number-control/stories/index.d.ts.map +0 -1
  298. package/build-types/palette-edit/stories/index.d.ts +0 -13
  299. package/build-types/palette-edit/stories/index.d.ts.map +0 -1
  300. package/build-types/panel/stories/index.d.ts +0 -19
  301. package/build-types/panel/stories/index.d.ts.map +0 -1
  302. package/build-types/placeholder/stories/index.d.ts +0 -12
  303. package/build-types/placeholder/stories/index.d.ts.map +0 -1
  304. package/build-types/popover/stories/e2e/index.d.ts +0 -8
  305. package/build-types/popover/stories/e2e/index.d.ts.map +0 -1
  306. package/build-types/popover/stories/index.d.ts +0 -13
  307. package/build-types/popover/stories/index.d.ts.map +0 -1
  308. package/build-types/progress-bar/stories/index.d.ts +0 -12
  309. package/build-types/progress-bar/stories/index.d.ts.map +0 -1
  310. package/build-types/query-controls/stories/index.d.ts +0 -13
  311. package/build-types/query-controls/stories/index.d.ts.map +0 -1
  312. package/build-types/radio-control/stories/index.d.ts +0 -12
  313. package/build-types/radio-control/stories/index.d.ts.map +0 -1
  314. package/build-types/range-control/stories/index.d.ts +0 -48
  315. package/build-types/range-control/stories/index.d.ts.map +0 -1
  316. package/build-types/resizable-box/stories/index.d.ts +0 -61
  317. package/build-types/resizable-box/stories/index.d.ts.map +0 -1
  318. package/build-types/responsive-wrapper/stories/index.d.ts +0 -22
  319. package/build-types/responsive-wrapper/stories/index.d.ts.map +0 -1
  320. package/build-types/sandbox/stories/index.d.ts +0 -12
  321. package/build-types/sandbox/stories/index.d.ts.map +0 -1
  322. package/build-types/scroll-lock/stories/index.d.ts +0 -9
  323. package/build-types/scroll-lock/stories/index.d.ts.map +0 -1
  324. package/build-types/scrollable/stories/index.d.ts +0 -9
  325. package/build-types/scrollable/stories/index.d.ts.map +0 -1
  326. package/build-types/search-control/stories/index.d.ts +0 -47
  327. package/build-types/search-control/stories/index.d.ts.map +0 -1
  328. package/build-types/select-control/stories/index.d.ts +0 -19
  329. package/build-types/select-control/stories/index.d.ts.map +0 -1
  330. package/build-types/snackbar/stories/index.d.ts +0 -16
  331. package/build-types/snackbar/stories/index.d.ts.map +0 -1
  332. package/build-types/snackbar/stories/list.d.ts +0 -12
  333. package/build-types/snackbar/stories/list.d.ts.map +0 -1
  334. package/build-types/spacer/stories/index.d.ts +0 -12
  335. package/build-types/spacer/stories/index.d.ts.map +0 -1
  336. package/build-types/spinner/stories/index.d.ts +0 -13
  337. package/build-types/spinner/stories/index.d.ts.map +0 -1
  338. package/build-types/surface/stories/index.d.ts +0 -12
  339. package/build-types/surface/stories/index.d.ts.map +0 -1
  340. package/build-types/tab-panel/stories/index.d.ts +0 -16
  341. package/build-types/tab-panel/stories/index.d.ts.map +0 -1
  342. package/build-types/text-control/stories/index.d.ts +0 -13
  343. package/build-types/text-control/stories/index.d.ts.map +0 -1
  344. package/build-types/text-highlight/stories/index.d.ts +0 -12
  345. package/build-types/text-highlight/stories/index.d.ts.map +0 -1
  346. package/build-types/textarea-control/stories/index.d.ts +0 -12
  347. package/build-types/textarea-control/stories/index.d.ts.map +0 -1
  348. package/build-types/theme/stories/index.d.ts +0 -17
  349. package/build-types/theme/stories/index.d.ts.map +0 -1
  350. package/build-types/tip/stories/index.d.ts +0 -12
  351. package/build-types/tip/stories/index.d.ts.map +0 -1
  352. package/build-types/toggle-control/stories/index.d.ts +0 -13
  353. package/build-types/toggle-control/stories/index.d.ts.map +0 -1
  354. package/build-types/toggle-group-control/stories/index.d.ts +0 -27
  355. package/build-types/toggle-group-control/stories/index.d.ts.map +0 -1
  356. package/build-types/toolbar/stories/index.d.ts +0 -14
  357. package/build-types/toolbar/stories/index.d.ts.map +0 -1
  358. package/build-types/tools-panel/stories/index.d.ts +0 -17
  359. package/build-types/tools-panel/stories/index.d.ts.map +0 -1
  360. package/build-types/tree-grid/stories/index.d.ts +0 -13
  361. package/build-types/tree-grid/stories/index.d.ts.map +0 -1
  362. package/build-types/tree-select/stories/index.d.ts +0 -12
  363. package/build-types/tree-select/stories/index.d.ts.map +0 -1
  364. package/build-types/truncate/stories/index.d.ts +0 -13
  365. package/build-types/truncate/stories/index.d.ts.map +0 -1
  366. package/build-types/ui/control-group/component.d.ts +0 -27
  367. package/build-types/ui/control-group/component.d.ts.map +0 -1
  368. package/build-types/ui/control-group/context.d.ts +0 -4
  369. package/build-types/ui/control-group/context.d.ts.map +0 -1
  370. package/build-types/ui/control-group/hook.d.ts +0 -266
  371. package/build-types/ui/control-group/hook.d.ts.map +0 -1
  372. package/build-types/ui/control-group/index.d.ts +0 -4
  373. package/build-types/ui/control-group/index.d.ts.map +0 -1
  374. package/build-types/ui/control-group/styles.d.ts +0 -8
  375. package/build-types/ui/control-group/styles.d.ts.map +0 -1
  376. package/build-types/ui/control-group/types.d.ts +0 -27
  377. package/build-types/ui/control-group/types.d.ts.map +0 -1
  378. package/build-types/ui/control-label/component.d.ts +0 -23
  379. package/build-types/ui/control-label/component.d.ts.map +0 -1
  380. package/build-types/ui/control-label/hook.d.ts +0 -265
  381. package/build-types/ui/control-label/hook.d.ts.map +0 -1
  382. package/build-types/ui/control-label/index.d.ts +0 -3
  383. package/build-types/ui/control-label/index.d.ts.map +0 -1
  384. package/build-types/ui/control-label/styles.d.ts +0 -7
  385. package/build-types/ui/control-label/styles.d.ts.map +0 -1
  386. package/build-types/ui/control-label/types.d.ts +0 -9
  387. package/build-types/ui/control-label/types.d.ts.map +0 -1
  388. package/build-types/ui/form-group/form-group-content.d.ts +0 -7
  389. package/build-types/ui/form-group/form-group-content.d.ts.map +0 -1
  390. package/build-types/ui/form-group/form-group-context.d.ts +0 -11
  391. package/build-types/ui/form-group/form-group-context.d.ts.map +0 -1
  392. package/build-types/ui/form-group/form-group-help.d.ts +0 -18
  393. package/build-types/ui/form-group/form-group-help.d.ts.map +0 -1
  394. package/build-types/ui/form-group/form-group-label.d.ts +0 -8
  395. package/build-types/ui/form-group/form-group-label.d.ts.map +0 -1
  396. package/build-types/ui/form-group/form-group-styles.d.ts +0 -2
  397. package/build-types/ui/form-group/form-group-styles.d.ts.map +0 -1
  398. package/build-types/ui/form-group/form-group.d.ts +0 -53
  399. package/build-types/ui/form-group/form-group.d.ts.map +0 -1
  400. package/build-types/ui/form-group/index.d.ts +0 -4
  401. package/build-types/ui/form-group/index.d.ts.map +0 -1
  402. package/build-types/ui/form-group/types.d.ts +0 -30
  403. package/build-types/ui/form-group/types.d.ts.map +0 -1
  404. package/build-types/ui/form-group/use-form-group.d.ts +0 -593
  405. package/build-types/ui/form-group/use-form-group.d.ts.map +0 -1
  406. package/build-types/ui/index.d.ts +0 -6
  407. package/build-types/ui/index.d.ts.map +0 -1
  408. package/build-types/ui/spinner/component.d.ts +0 -13
  409. package/build-types/ui/spinner/component.d.ts.map +0 -1
  410. package/build-types/ui/spinner/index.d.ts +0 -2
  411. package/build-types/ui/spinner/index.d.ts.map +0 -1
  412. package/build-types/ui/spinner/styles.d.ts +0 -13
  413. package/build-types/ui/spinner/styles.d.ts.map +0 -1
  414. package/build-types/ui/spinner/utils.d.ts +0 -3
  415. package/build-types/ui/spinner/utils.d.ts.map +0 -1
  416. package/build-types/ui/utils/get-high-dpi.d.ts +0 -3
  417. package/build-types/ui/utils/get-high-dpi.d.ts.map +0 -1
  418. package/build-types/unit-control/stories/index.d.ts +0 -33
  419. package/build-types/unit-control/stories/index.d.ts.map +0 -1
  420. package/build-types/utils/browsers.d.ts +0 -11
  421. package/build-types/utils/browsers.d.ts.map +0 -1
  422. package/build-types/utils/events.d.ts +0 -11
  423. package/build-types/utils/events.d.ts.map +0 -1
  424. package/build-types/v-stack/stories/e2e/index.d.ts +0 -9
  425. package/build-types/v-stack/stories/e2e/index.d.ts.map +0 -1
  426. package/build-types/v-stack/stories/index.d.ts +0 -13
  427. package/build-types/v-stack/stories/index.d.ts.map +0 -1
  428. package/build-types/view/stories/index.d.ts +0 -12
  429. package/build-types/view/stories/index.d.ts.map +0 -1
  430. package/build-types/visually-hidden/stories/index.d.ts +0 -14
  431. package/build-types/visually-hidden/stories/index.d.ts.map +0 -1
  432. package/build-types/z-stack/stories/index.d.ts +0 -6
  433. package/build-types/z-stack/stories/index.d.ts.map +0 -1
  434. package/src/ui/utils/get-high-dpi.ts +0 -20
  435. package/src/utils/browsers.js +0 -36
  436. package/src/utils/events.ts +0 -50
  437. package/src/utils/test/events.js +0 -63
  438. package/src/utils/test/values.js +0 -101
@@ -39,7 +39,7 @@ function useContextSystemBridge({
39
39
  fastDeepEqual(valueRef.current, value) &&
40
40
  // But not the same reference.
41
41
  valueRef.current !== value) {
42
- typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warn(`Please memoize your context: ${JSON.stringify(value)}`) : void 0;
42
+ typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warn(`Please memoize your context: ${JSON.stringify(value)}`) : void 0;
43
43
  }
44
44
  }, [value]);
45
45
 
@@ -1 +1 @@
1
- {"version":3,"names":["deepmerge","fastDeepEqual","isPlainObject","createContext","useContext","useRef","useMemo","memo","warn","useUpdateEffect","ComponentsContext","useComponentsContext","useContextSystemBridge","value","parentContext","valueRef","current","process","env","NODE_ENV","JSON","stringify","config","isMergeableObject","BaseContextSystemProvider","children","contextValue","createElement","Provider","ContextSystemProvider"],"sources":["@wordpress/components/src/ui/context/context-system-provider.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseRef,\n\tuseMemo,\n\tmemo,\n} from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../../utils';\n\nexport const ComponentsContext = createContext(\n\t/** @type {Record<string, any>} */ ( {} )\n);\nexport const useComponentsContext = () => useContext( ComponentsContext );\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge( { value } ) {\n\tconst parentContext = useComponentsContext();\n\n\tconst valueRef = useRef( value );\n\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\t// Objects are equivalent.\n\t\t\tfastDeepEqual( valueRef.current, value ) &&\n\t\t\t// But not the same reference.\n\t\t\tvalueRef.current !== value\n\t\t) {\n\t\t\twarn( `Please memoize your context: ${ JSON.stringify( value ) }` );\n\t\t}\n\t}, [ value ] );\n\n\t// `parentContext` will always be memoized (i.e., the result of this hook itself)\n\t// or the default value from when the `ComponentsContext` was originally\n\t// initialized (which will never change, it's a static variable)\n\t// so this memoization will prevent `deepmerge()` from rerunning unless\n\t// the references to `value` change OR the `parentContext` has an actual material change\n\t// (because again, it's guaranteed to be memoized or a static reference to the empty object\n\t// so we know that the only changes for `parentContext` are material ones... i.e., why we\n\t// don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n\t// need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n\t// correctly warning when the `value` isn't being properly memoized. All of that to say\n\t// that this should be super safe to assume that `useMemo` will only run on actual\n\t// changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n\tconst config = useMemo( () => {\n\t\t// Deep clone `parentContext` to avoid mutating it later.\n\t\treturn deepmerge( parentContext ?? {}, value ?? {}, {\n\t\t\tisMergeableObject: isPlainObject,\n\t\t} );\n\t}, [ parentContext, value ] );\n\n\treturn config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ( { children, value } ) => {\n\tconst contextValue = useContextSystemBridge( { value } );\n\n\treturn (\n\t\t<ComponentsContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</ComponentsContext.Provider>\n\t);\n};\n\nexport const ContextSystemProvider = memo( BaseContextSystemProvider );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,WAAW;AACjC,OAAOC,aAAa,MAAM,qBAAqB;AAC/C,SAASC,aAAa,QAAQ,iBAAiB;;AAE/C;AACA;AACA;AACA,SACCC,aAAa,EACbC,UAAU,EACVC,MAAM,EACNC,OAAO,EACPC,IAAI,QACE,oBAAoB;AAC3B,OAAOC,IAAI,MAAM,oBAAoB;;AAErC;AACA;AACA;AACA,SAASC,eAAe,QAAQ,aAAa;AAE7C,OAAO,MAAMC,iBAAiB,GAAGP,aAAa,EAC7C,kCAAqC,CAAC,CACvC,CAAC;AACD,OAAO,MAAMQ,oBAAoB,GAAGA,CAAA,KAAMP,UAAU,CAAEM,iBAAkB,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,sBAAsBA,CAAE;EAAEC;AAAM,CAAC,EAAG;EAC5C,MAAMC,aAAa,GAAGH,oBAAoB,CAAC,CAAC;EAE5C,MAAMI,QAAQ,GAAGV,MAAM,CAAEQ,KAAM,CAAC;EAEhCJ,eAAe,CAAE,MAAM;IACtB;IACC;IACAR,aAAa,CAAEc,QAAQ,CAACC,OAAO,EAAEH,KAAM,CAAC;IACxC;IACAE,QAAQ,CAACC,OAAO,KAAKH,KAAK,EACzB;MACD,OAAAI,OAAA,oBAAAA,OAAA,CAAAC,GAAA,IAAAD,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAX,IAAI,CAAG,gCAAgCY,IAAI,CAACC,SAAS,CAAER,KAAM,CAAG,EAAE,CAAC;IACpE;EACD,CAAC,EAAE,CAAEA,KAAK,CAAG,CAAC;;EAEd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMS,MAAM,GAAGhB,OAAO,CAAE,MAAM;IAC7B;IACA,OAAON,SAAS,CAAEc,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAI,CAAC,CAAC,EAAED,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,CAAC,CAAC,EAAE;MACnDU,iBAAiB,EAAErB;IACpB,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEY,aAAa,EAAED,KAAK,CAAG,CAAC;EAE7B,OAAOS,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,yBAAyB,GAAGA,CAAE;EAAEC,QAAQ;EAAEZ;AAAM,CAAC,KAAM;EAC5D,MAAMa,YAAY,GAAGd,sBAAsB,CAAE;IAAEC;EAAM,CAAE,CAAC;EAExD,OACCc,aAAA,CAACjB,iBAAiB,CAACkB,QAAQ;IAACf,KAAK,EAAGa;EAAc,GAC/CD,QACyB,CAAC;AAE/B,CAAC;AAED,OAAO,MAAMI,qBAAqB,GAAGtB,IAAI,CAAEiB,yBAA0B,CAAC"}
1
+ {"version":3,"names":["deepmerge","fastDeepEqual","isPlainObject","createContext","useContext","useRef","useMemo","memo","warn","useUpdateEffect","ComponentsContext","useComponentsContext","useContextSystemBridge","value","parentContext","valueRef","current","SCRIPT_DEBUG","JSON","stringify","config","isMergeableObject","BaseContextSystemProvider","children","contextValue","createElement","Provider","ContextSystemProvider"],"sources":["@wordpress/components/src/ui/context/context-system-provider.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport fastDeepEqual from 'fast-deep-equal/es6';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseRef,\n\tuseMemo,\n\tmemo,\n} from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useUpdateEffect } from '../../utils';\n\nexport const ComponentsContext = createContext(\n\t/** @type {Record<string, any>} */ ( {} )\n);\nexport const useComponentsContext = () => useContext( ComponentsContext );\n\n/**\n * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.\n *\n * Note: This function will warn if it detects an un-memoized `value`\n *\n * @param {Object} props\n * @param {Record<string, any>} props.value\n * @return {Record<string, any>} The consolidated value.\n */\nfunction useContextSystemBridge( { value } ) {\n\tconst parentContext = useComponentsContext();\n\n\tconst valueRef = useRef( value );\n\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\t// Objects are equivalent.\n\t\t\tfastDeepEqual( valueRef.current, value ) &&\n\t\t\t// But not the same reference.\n\t\t\tvalueRef.current !== value\n\t\t) {\n\t\t\twarn( `Please memoize your context: ${ JSON.stringify( value ) }` );\n\t\t}\n\t}, [ value ] );\n\n\t// `parentContext` will always be memoized (i.e., the result of this hook itself)\n\t// or the default value from when the `ComponentsContext` was originally\n\t// initialized (which will never change, it's a static variable)\n\t// so this memoization will prevent `deepmerge()` from rerunning unless\n\t// the references to `value` change OR the `parentContext` has an actual material change\n\t// (because again, it's guaranteed to be memoized or a static reference to the empty object\n\t// so we know that the only changes for `parentContext` are material ones... i.e., why we\n\t// don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only\n\t// need to bother with the `value`). The `useUpdateEffect` above will ensure that we are\n\t// correctly warning when the `value` isn't being properly memoized. All of that to say\n\t// that this should be super safe to assume that `useMemo` will only run on actual\n\t// changes to the two dependencies, therefore saving us calls to `deepmerge()`!\n\tconst config = useMemo( () => {\n\t\t// Deep clone `parentContext` to avoid mutating it later.\n\t\treturn deepmerge( parentContext ?? {}, value ?? {}, {\n\t\t\tisMergeableObject: isPlainObject,\n\t\t} );\n\t}, [ parentContext, value ] );\n\n\treturn config;\n}\n\n/**\n * A Provider component that can modify props for connected components within\n * the Context system.\n *\n * @example\n * ```jsx\n * <ContextSystemProvider value={{ Button: { size: 'small' }}}>\n * <Button>...</Button>\n * </ContextSystemProvider>\n * ```\n *\n * @template {Record<string, any>} T\n * @param {Object} options\n * @param {import('react').ReactNode} options.children Children to render.\n * @param {T} options.value Props to render into connected components.\n * @return {JSX.Element} A Provider wrapped component.\n */\nconst BaseContextSystemProvider = ( { children, value } ) => {\n\tconst contextValue = useContextSystemBridge( { value } );\n\n\treturn (\n\t\t<ComponentsContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</ComponentsContext.Provider>\n\t);\n};\n\nexport const ContextSystemProvider = memo( BaseContextSystemProvider );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,WAAW;AACjC,OAAOC,aAAa,MAAM,qBAAqB;AAC/C,SAASC,aAAa,QAAQ,iBAAiB;;AAE/C;AACA;AACA;AACA,SACCC,aAAa,EACbC,UAAU,EACVC,MAAM,EACNC,OAAO,EACPC,IAAI,QACE,oBAAoB;AAC3B,OAAOC,IAAI,MAAM,oBAAoB;;AAErC;AACA;AACA;AACA,SAASC,eAAe,QAAQ,aAAa;AAE7C,OAAO,MAAMC,iBAAiB,GAAGP,aAAa,EAC7C,kCAAqC,CAAC,CACvC,CAAC;AACD,OAAO,MAAMQ,oBAAoB,GAAGA,CAAA,KAAMP,UAAU,CAAEM,iBAAkB,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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@ -28,7 +28,7 @@ import { useCx } from '../../utils/hooks/use-cx';
28
28
  export function useContextSystem(props, namespace) {
29
29
  const contextSystemProps = useComponentsContext();
30
30
  if (typeof namespace === 'undefined') {
31
- typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warn('useContextSystem: Please provide a namespace') : void 0;
31
+ typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warn('useContextSystem: Please provide a namespace') : void 0;
32
32
  }
33
33
  const contextProps = contextSystemProps?.[namespace] || {};
34
34
 
@@ -1 +1 @@
1
- {"version":3,"names":["warn","useComponentsContext","getNamespace","getConnectedNamespace","getStyledClassNameFromKey","useCx","useContextSystem","props","namespace","contextSystemProps","process","env","NODE_ENV","contextProps","finalComponentProps","_overrides","overrideProps","otherContextProps","initialMergedProps","Object","entries","length","assign","cx","classes","className","rendered","renderChildren","children","key","undefined"],"sources":["@wordpress/components/src/ui/context/use-context-system.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useComponentsContext } from './context-system-provider';\nimport { getNamespace, getConnectedNamespace } from './utils';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @template TProps\n * @typedef {TProps & { className: string }} ConnectedProps\n */\n\n/**\n * Custom hook that derives registered props from the Context system.\n * These derived props are then consolidated with incoming component props.\n *\n * @template {{ className?: string }} P\n * @param {P} props Incoming props from the component.\n * @param {string} namespace The namespace to register and to derive context props from.\n * @return {ConnectedProps<P>} The connected props.\n */\nexport function useContextSystem( props, namespace ) {\n\tconst contextSystemProps = useComponentsContext();\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'useContextSystem: Please provide a namespace' );\n\t}\n\n\tconst contextProps = contextSystemProps?.[ namespace ] || {};\n\n\t/* eslint-disable jsdoc/no-undefined-types */\n\t/** @type {ConnectedProps<P>} */\n\t// @ts-ignore We fill in the missing properties below\n\tconst finalComponentProps = {\n\t\t...getConnectedNamespace(),\n\t\t...getNamespace( namespace ),\n\t};\n\t/* eslint-enable jsdoc/no-undefined-types */\n\n\tconst { _overrides: overrideProps, ...otherContextProps } = contextProps;\n\n\tconst initialMergedProps = Object.entries( otherContextProps ).length\n\t\t? Object.assign( {}, otherContextProps, props )\n\t\t: props;\n\n\tconst cx = useCx();\n\n\tconst classes = cx(\n\t\tgetStyledClassNameFromKey( namespace ),\n\t\tprops.className\n\t);\n\n\t// Provides the ability to customize the render of the component.\n\tconst rendered =\n\t\ttypeof initialMergedProps.renderChildren === 'function'\n\t\t\t? initialMergedProps.renderChildren( initialMergedProps )\n\t\t\t: initialMergedProps.children;\n\n\tfor ( const key in initialMergedProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = initialMergedProps[ key ];\n\t}\n\n\tfor ( const key in overrideProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = overrideProps[ key ];\n\t}\n\n\t// Setting an `undefined` explicitly can cause unintended overwrites\n\t// when a `cloneElement()` is involved.\n\tif ( rendered !== undefined ) {\n\t\t// @ts-ignore\n\t\tfinalComponentProps.children = rendered;\n\t}\n\n\tfinalComponentProps.className = classes;\n\n\treturn finalComponentProps;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,oBAAoB;;AAErC;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,YAAY,EAAEC,qBAAqB,QAAQ,SAAS;AAC7D,SAASC,yBAAyB,QAAQ,kCAAkC;AAC5E,SAASC,KAAK,QAAQ,0BAA0B;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,KAAK,EAAEC,SAAS,EAAG;EACpD,MAAMC,kBAAkB,GAAGR,oBAAoB,CAAC,CAAC;EACjD,IAAK,OAAOO,SAA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QAAQ,GAAGF,QAAQ;EACxC;EAEAZ,mBAAmB,CAACW,SAAS,GAAGD,OAAO;EAEvC,OAAOV,mBAAmB;AAC3B"}
1
+ {"version":3,"names":["warn","useComponentsContext","getNamespace","getConnectedNamespace","getStyledClassNameFromKey","useCx","useContextSystem","props","namespace","contextSystemProps","SCRIPT_DEBUG","contextProps","finalComponentProps","_overrides","overrideProps","otherContextProps","initialMergedProps","Object","entries","length","assign","cx","classes","className","rendered","renderChildren","children","key","undefined"],"sources":["@wordpress/components/src/ui/context/use-context-system.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useComponentsContext } from './context-system-provider';\nimport { getNamespace, getConnectedNamespace } from './utils';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @template TProps\n * @typedef {TProps & { className: string }} ConnectedProps\n */\n\n/**\n * Custom hook that derives registered props from the Context system.\n * These derived props are then consolidated with incoming component props.\n *\n * @template {{ className?: string }} P\n * @param {P} props Incoming props from the component.\n * @param {string} namespace The namespace to register and to derive context props from.\n * @return {ConnectedProps<P>} The connected props.\n */\nexport function useContextSystem( props, namespace ) {\n\tconst contextSystemProps = useComponentsContext();\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'useContextSystem: Please provide a namespace' );\n\t}\n\n\tconst contextProps = contextSystemProps?.[ namespace ] || {};\n\n\t/* eslint-disable jsdoc/no-undefined-types */\n\t/** @type {ConnectedProps<P>} */\n\t// @ts-ignore We fill in the missing properties below\n\tconst finalComponentProps = {\n\t\t...getConnectedNamespace(),\n\t\t...getNamespace( namespace ),\n\t};\n\t/* eslint-enable jsdoc/no-undefined-types */\n\n\tconst { _overrides: overrideProps, ...otherContextProps } = contextProps;\n\n\tconst initialMergedProps = Object.entries( otherContextProps ).length\n\t\t? Object.assign( {}, otherContextProps, props )\n\t\t: props;\n\n\tconst cx = useCx();\n\n\tconst classes = cx(\n\t\tgetStyledClassNameFromKey( namespace ),\n\t\tprops.className\n\t);\n\n\t// Provides the ability to customize the render of the component.\n\tconst rendered =\n\t\ttypeof initialMergedProps.renderChildren === 'function'\n\t\t\t? initialMergedProps.renderChildren( initialMergedProps )\n\t\t\t: initialMergedProps.children;\n\n\tfor ( const key in initialMergedProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = initialMergedProps[ key ];\n\t}\n\n\tfor ( const key in overrideProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = overrideProps[ key ];\n\t}\n\n\t// Setting an `undefined` explicitly can cause unintended overwrites\n\t// when a `cloneElement()` is involved.\n\tif ( rendered !== undefined ) {\n\t\t// @ts-ignore\n\t\tfinalComponentProps.children = rendered;\n\t}\n\n\tfinalComponentProps.className = classes;\n\n\treturn finalComponentProps;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,oBAAoB;;AAErC;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,YAAY,EAAEC,qBAAqB,QAAQ,SAAS;AAC7D,SAASC,yBAAyB,QAAQ,kCAAkC;AAC5E,SAASC,KAAK,QAAQ,0BAA0B;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,KAAK,EAAEC,SAAS,EAAG;EACpD,MAAMC,kBAAkB,GAAGR,oBAAoB,CAAC,CAAC;EACjD,IAAK,OAAOO,SAAS,KAAK,WAAW,EAAG;IACvC,OAAAE,YAAA,oBAAAA,YAAA,YAAAV,IAAI,CAAE,8CAA+C,CAAC;EACvD;EAEA,MAAMW,YAAY,GAAGF,kBAAkB,GAAID,SAAS,CAAE,IAAI,CAAC,CAAC;;EAE5D;EACA;EACA;EACA,MAAMI,mBAAmB,GAAG;IAC3B,GAAGT,qBAAqB,CAAC,CAAC;IAC1B,GAAGD,YAAY,CAAEM,SAAU;EAC5B,CAAC;EACD;;EAEA,MAAM;IAAEK,UAAU,EAAEC,aAAa;IAAE,GAAGC;EAAkB,CAAC,GAAGJ,YAAY;EAExE,MAAMK,kBAAkB,GAAGC,MAAM,CAACC,OAAO,CAAEH,iBAAkB,CAAC,CAACI,MAAM,GAClEF,MAAM,CAACG,MAAM,CAAE,CAAC,CAAC,EAAEL,iBAAiB,EAAER,KAAM,CAAC,GAC7CA,KAAK;EAER,MAAMc,EAAE,GAAGhB,KAAK,CAAC,CAAC;EAElB,MAAMiB,OAAO,GAAGD,EAAE,CACjBjB,yBAAyB,CAAEI,SAAU,CAAC,EACtCD,KAAK,CAACgB,SACP,CAAC;;EAED;EACA,MAAMC,QAAQ,GACb,OAAOR,kBAAkB,CAACS,cAAc,KAAK,UAAU,GACpDT,kBAAkB,CAACS,cAAc,CAAET,kBAAmB,CAAC,GACvDA,kBAAkB,CAACU,QAAQ;EAE/B,KAAM,MAAMC,GAAG,IAAIX,kBAAkB,EAAG;IACvC;IACAJ,mBAAmB,CAAEe,GAAG,CAAE,GAAGX,kBAAkB,CAAEW,GAAG,CAAE;EACvD;EAEA,KAAM,MAAMA,GAAG,IAAIb,aAAa,EAAG;IAClC;IACAF,mBAAmB,CAAEe,GAAG,CAAE,GAAGb,aAAa,CAAEa,GAAG,CAAE;EAClD;;EAEA;EACA;EACA,IAAKH,QAAQ,KAAKI,SAAS,EAAG;IAC7B;IACAhB,mBAAmB,CAACc,QAAQ,GAAGF,QAAQ;EACxC;EAEAZ,mBAAmB,CAACW,SAAS,GAAGD,OAAO;EAEvC,OAAOV,mBAAmB;AAC3B"}
@@ -81,15 +81,4 @@ export function roundClamp(value = 0, min = Infinity, max = Infinity, step = 1)
81
81
  const clampedValue = clamp(rounded, min, max);
82
82
  return precision ? getNumber(clampedValue.toFixed(precision)) : clampedValue;
83
83
  }
84
-
85
- /**
86
- * Clamps a value based on a min/max range with rounding.
87
- * Returns a string.
88
- *
89
- * @param {Parameters<typeof roundClamp>} args Arguments for roundClamp().
90
- * @return {string} The rounded and clamped value.
91
- */
92
- export function roundClampString(...args) {
93
- return roundClamp(...args).toString();
94
- }
95
84
  //# sourceMappingURL=math.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getNumber","value","number","Number","isNaN","add","args","reduce","sum","arg","subtract","diff","index","getPrecision","split","undefined","length","clamp","min","max","baseValue","Math","roundClamp","Infinity","step","stepValue","precision","rounded","round","clampedValue","toFixed","roundClampString","toString"],"sources":["@wordpress/components/src/utils/math.js"],"sourcesContent":["/**\n * Parses and retrieves a number value.\n *\n * @param {unknown} value The incoming value.\n *\n * @return {number} The parsed number value.\n */\nexport function getNumber( value ) {\n\tconst number = Number( value );\n\n\treturn isNaN( number ) ? 0 : number;\n}\n\n/**\n * Safely adds 2 values.\n *\n * @param {Array<number|string>} args Values to add together.\n *\n * @return {number} The sum of values.\n */\nexport function add( ...args ) {\n\treturn args.reduce(\n\t\t/** @type {(sum:number, arg: number|string) => number} */\n\t\t( sum, arg ) => sum + getNumber( arg ),\n\t\t0\n\t);\n}\n\n/**\n * Safely subtracts 2 values.\n *\n * @param {Array<number|string>} args Values to subtract together.\n *\n * @return {number} The difference of the values.\n */\nexport function subtract( ...args ) {\n\treturn args.reduce(\n\t\t/** @type {(diff:number, arg: number|string, index:number) => number} */\n\t\t( diff, arg, index ) => {\n\t\t\tconst value = getNumber( arg );\n\t\t\treturn index === 0 ? value : diff - value;\n\t\t},\n\t\t0\n\t);\n}\n\n/**\n * Determines the decimal position of a number value.\n *\n * @param {number} value The number to evaluate.\n *\n * @return {number} The number of decimal places.\n */\nfunction getPrecision( value ) {\n\tconst split = ( value + '' ).split( '.' );\n\treturn split[ 1 ] !== undefined ? split[ 1 ].length : 0;\n}\n\n/**\n * Clamps a value based on a min/max range.\n *\n * @param {number} value The value.\n * @param {number} min The minimum range.\n * @param {number} max The maximum range.\n *\n * @return {number} The clamped value.\n */\nexport function clamp( value, min, max ) {\n\tconst baseValue = getNumber( value );\n\treturn Math.max( min, Math.min( baseValue, max ) );\n}\n\n/**\n * Clamps a value based on a min/max range with rounding\n *\n * @param {number | string} value The value.\n * @param {number} min The minimum range.\n * @param {number} max The maximum range.\n * @param {number} step A multiplier for the value.\n *\n * @return {number} The rounded and clamped value.\n */\nexport function roundClamp(\n\tvalue = 0,\n\tmin = Infinity,\n\tmax = Infinity,\n\tstep = 1\n) {\n\tconst baseValue = getNumber( value );\n\tconst stepValue = getNumber( step );\n\tconst precision = getPrecision( step );\n\tconst rounded = Math.round( baseValue / stepValue ) * stepValue;\n\tconst clampedValue = clamp( rounded, min, max );\n\n\treturn precision\n\t\t? getNumber( clampedValue.toFixed( precision ) )\n\t\t: clampedValue;\n}\n\n/**\n * Clamps a value based on a min/max range with rounding.\n * Returns a string.\n *\n * @param {Parameters<typeof roundClamp>} args Arguments for roundClamp().\n * @return {string} The rounded and clamped value.\n */\nexport function roundClampString( ...args ) {\n\treturn roundClamp( ...args ).toString();\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,SAASA,CAAEC,KAAK,EAAG;EAClC,MAAMC,MAAM,GAAGC,MAAM,CAAEF,KAAM,CAAC;EAE9B,OAAOG,KAAK,CAAEF,MAAO,CAAC,GAAG,CAAC,GAAGA,MAAM;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,GAAGA,CAAE,GAAGC,IAAI,EAAG;EAC9B,OAAOA,IAAI,CAACC,MAAM,EACjB;EACA,CAAEC,GAAG,EAAEC,GAAG,KAAMD,GAAG,GAAGR,SAAS,CAAES,GAAI,CAAC,EACtC,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAE,GAAGJ,IAAI,EAAG;EACnC,OAAOA,IAAI,CAACC,MAAM,EACjB;EACA,CAAEI,IAAI,EAAEF,GAAG,EAAEG,KAAK,KAAM;IACvB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SAAS,GACb1B,SAAS,CAAE6B,YAAY,CAACC,OAAO,CAAEJ,SAAU,CAAE,CAAC,GAC9CG,YAAY;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,gBAAgBA,CAAE,GAAGzB,IAAI,EAAG;EAC3C,OAAOgB,UAAU,CAAE,GAAGhB,IAAK,CAAC,CAAC0B,QAAQ,CAAC,CAAC;AACxC"}
1
+ {"version":3,"names":["getNumber","value","number","Number","isNaN","add","args","reduce","sum","arg","subtract","diff","index","getPrecision","split","undefined","length","clamp","min","max","baseValue","Math","roundClamp","Infinity","step","stepValue","precision","rounded","round","clampedValue","toFixed"],"sources":["@wordpress/components/src/utils/math.js"],"sourcesContent":["/**\n * Parses and retrieves a number value.\n *\n * @param {unknown} value The incoming value.\n *\n * @return {number} The parsed number value.\n */\nexport function getNumber( value ) {\n\tconst number = Number( value );\n\n\treturn isNaN( number ) ? 0 : number;\n}\n\n/**\n * Safely adds 2 values.\n *\n * @param {Array<number|string>} args Values to add together.\n *\n * @return {number} The sum of values.\n */\nexport function add( ...args ) {\n\treturn args.reduce(\n\t\t/** @type {(sum:number, arg: number|string) => number} */\n\t\t( sum, arg ) => sum + getNumber( arg ),\n\t\t0\n\t);\n}\n\n/**\n * Safely subtracts 2 values.\n *\n * @param {Array<number|string>} args Values to subtract together.\n *\n * @return {number} The difference of the values.\n */\nexport function subtract( ...args ) {\n\treturn args.reduce(\n\t\t/** @type {(diff:number, arg: number|string, index:number) => number} */\n\t\t( diff, arg, index ) => {\n\t\t\tconst value = getNumber( arg );\n\t\t\treturn index === 0 ? value : diff - value;\n\t\t},\n\t\t0\n\t);\n}\n\n/**\n * Determines the decimal position of a number value.\n *\n * @param {number} value The number to evaluate.\n *\n * @return {number} The number of decimal places.\n */\nfunction getPrecision( value ) {\n\tconst split = ( value + '' ).split( '.' );\n\treturn split[ 1 ] !== undefined ? split[ 1 ].length : 0;\n}\n\n/**\n * Clamps a value based on a min/max range.\n *\n * @param {number} value The value.\n * @param {number} min The minimum range.\n * @param {number} max The maximum range.\n *\n * @return {number} The clamped value.\n */\nexport function clamp( value, min, max ) {\n\tconst baseValue = getNumber( value );\n\treturn Math.max( min, Math.min( baseValue, max ) );\n}\n\n/**\n * Clamps a value based on a min/max range with rounding\n *\n * @param {number | string} value The value.\n * @param {number} min The minimum range.\n * @param {number} max The maximum range.\n * @param {number} step A multiplier for the value.\n *\n * @return {number} The rounded and clamped value.\n */\nexport function roundClamp(\n\tvalue = 0,\n\tmin = Infinity,\n\tmax = Infinity,\n\tstep = 1\n) {\n\tconst baseValue = getNumber( value );\n\tconst stepValue = getNumber( step );\n\tconst precision = getPrecision( step );\n\tconst rounded = Math.round( baseValue / stepValue ) * stepValue;\n\tconst clampedValue = clamp( rounded, min, max );\n\n\treturn precision\n\t\t? getNumber( clampedValue.toFixed( precision ) )\n\t\t: clampedValue;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,SAASA,CAAEC,KAAK,EAAG;EAClC,MAAMC,MAAM,GAAGC,MAAM,CAAEF,KAAM,CAAC;EAE9B,OAAOG,KAAK,CAAEF,MAAO,CAAC,GAAG,CAAC,GAAGA,MAAM;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,GAAGA,CAAE,GAAGC,IAAI,EAAG;EAC9B,OAAOA,IAAI,CAACC,MAAM,EACjB;EACA,CAAEC,GAAG,EAAEC,GAAG,KAAMD,GAAG,GAAGR,SAAS,CAAES,GAAI,CAAC,EACtC,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAE,GAAGJ,IAAI,EAAG;EACnC,OAAOA,IAAI,CAACC,MAAM,EACjB;EACA,CAAEI,IAAI,EAAEF,GAAG,EAAEG,KAAK,KAAM;IACvB,MAAMX,KAAK,GAAGD,SAAS,CAAES,GAAI,CAAC;IAC9B,OAAOG,KAAK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,CAAC,GAC9CG,YAAY;AAChB"}
@@ -39,44 +39,6 @@ export function getDefinedValue(values = [], fallbackValue) {
39
39
  return (_values$find = values.find(isValueDefined)) !== null && _values$find !== void 0 ? _values$find : fallbackValue;
40
40
  }
41
41
 
42
- /**
43
- * @param {string} [locale]
44
- * @return {[RegExp, RegExp]} The delimiter and decimal regexp
45
- */
46
- const getDelimiterAndDecimalRegex = locale => {
47
- const formatted = Intl.NumberFormat(locale).format(1000.1);
48
- const delimiter = formatted[1];
49
- const decimal = formatted[formatted.length - 2];
50
- return [new RegExp(`\\${delimiter}`, 'g'), new RegExp(`\\${decimal}`, 'g')];
51
- };
52
-
53
- // https://en.wikipedia.org/wiki/Decimal_separator#Current_standards
54
- const INTERNATIONAL_THOUSANDS_DELIMITER = / /g;
55
- const ARABIC_NUMERAL_LOCALES = ['ar', 'fa', 'ur', 'ckb', 'ps'];
56
- const EASTERN_ARABIC_NUMBERS = /([۰-۹]|[٠-٩])/g;
57
-
58
- /**
59
- * Checks to see if a value is a numeric value (`number` or `string`).
60
- *
61
- * Intentionally ignores whether the thousands delimiters are only
62
- * in the thousands marks.
63
- *
64
- * @param {any} value
65
- * @param {string} [locale]
66
- * @return {boolean} Whether value is numeric.
67
- */
68
- export function isValueNumeric(value, locale = window.navigator.language) {
69
- if (ARABIC_NUMERAL_LOCALES.some(l => locale.startsWith(l))) {
70
- locale = 'en-GB';
71
- if (EASTERN_ARABIC_NUMBERS.test(value)) {
72
- value = value.replace(/[٠-٩]/g, ( /** @type {string} */d) => '٠١٢٣٤٥٦٧٨٩'.indexOf(d)).replace(/[۰-۹]/g, ( /** @type {string} */d) => '۰۱۲۳۴۵۶۷۸۹'.indexOf(d)).replace(/٬/g, ',').replace(/٫/g, '.');
73
- }
74
- }
75
- const [delimiterRegexp, decimalRegexp] = getDelimiterAndDecimalRegex(locale);
76
- const valueToCheck = typeof value === 'string' ? value.replace(delimiterRegexp, '').replace(decimalRegexp, '.').replace(INTERNATIONAL_THOUSANDS_DELIMITER, '') : value;
77
- return !isNaN(parseFloat(valueToCheck)) && isFinite(valueToCheck);
78
- }
79
-
80
42
  /**
81
43
  * Converts a string to a number.
82
44
  *
@@ -87,16 +49,6 @@ export const stringToNumber = value => {
87
49
  return parseFloat(value);
88
50
  };
89
51
 
90
- /**
91
- * Converts a number to a string.
92
- *
93
- * @param {number} value
94
- * @return {string} Number as a string.
95
- */
96
- export const numberToString = value => {
97
- return `${value}`;
98
- };
99
-
100
52
  /**
101
53
  * Regardless of the input being a string or a number, returns a number.
102
54
  *
@@ -108,16 +60,4 @@ export const numberToString = value => {
108
60
  export const ensureNumber = value => {
109
61
  return typeof value === 'string' ? stringToNumber(value) : value;
110
62
  };
111
-
112
- /**
113
- * Regardless of the input being a string or a number, returns a number.
114
- *
115
- * Returns `undefined` in case the string is `undefined` or not a valid numeric value.
116
- *
117
- * @param {string | number} value
118
- * @return {string} The converted string, or `undefined` in case the input is `undefined` or `NaN`.
119
- */
120
- export const ensureString = value => {
121
- return typeof value === 'string' ? value : numberToString(value);
122
- };
123
63
  //# sourceMappingURL=values.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isValueDefined","value","undefined","isValueEmpty","isEmptyString","getDefinedValue","values","fallbackValue","_values$find","find","getDelimiterAndDecimalRegex","locale","formatted","Intl","NumberFormat","format","delimiter","decimal","length","RegExp","INTERNATIONAL_THOUSANDS_DELIMITER","ARABIC_NUMERAL_LOCALES","EASTERN_ARABIC_NUMBERS","isValueNumeric","window","navigator","language","some","l","startsWith","test","replace","d","indexOf","delimiterRegexp","decimalRegexp","valueToCheck","isNaN","parseFloat","isFinite","stringToNumber","numberToString","ensureNumber","ensureString"],"sources":["@wordpress/components/src/utils/values.js"],"sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * Determines if a value is null or undefined.\n *\n * @template T\n *\n * @param {T} value The value to check.\n * @return {value is Exclude<T, null | undefined>} Whether value is not null or undefined.\n */\nexport function isValueDefined( value ) {\n\treturn value !== undefined && value !== null;\n}\n/* eslint-enable jsdoc/valid-types */\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Determines if a value is empty, null, or undefined.\n *\n * @param {string | number | null | undefined} value The value to check.\n * @return {value is (\"\" | null | undefined)} Whether value is empty.\n */\nexport function isValueEmpty( value ) {\n\tconst isEmptyString = value === '';\n\n\treturn ! isValueDefined( value ) || isEmptyString;\n}\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * Get the first defined/non-null value from an array.\n *\n * @template T\n *\n * @param {Array<T | null | undefined>} values Values to derive from.\n * @param {T} fallbackValue Fallback value if there are no defined values.\n * @return {T} A defined value or the fallback value.\n */\nexport function getDefinedValue( values = [], fallbackValue ) {\n\treturn values.find( isValueDefined ) ?? fallbackValue;\n}\n\n/**\n * @param {string} [locale]\n * @return {[RegExp, RegExp]} The delimiter and decimal regexp\n */\nconst getDelimiterAndDecimalRegex = ( locale ) => {\n\tconst formatted = Intl.NumberFormat( locale ).format( 1000.1 );\n\tconst delimiter = formatted[ 1 ];\n\tconst decimal = formatted[ formatted.length - 2 ];\n\treturn [\n\t\tnew RegExp( `\\\\${ delimiter }`, 'g' ),\n\t\tnew RegExp( `\\\\${ decimal }`, 'g' ),\n\t];\n};\n\n// https://en.wikipedia.org/wiki/Decimal_separator#Current_standards\nconst INTERNATIONAL_THOUSANDS_DELIMITER = / /g;\n\nconst ARABIC_NUMERAL_LOCALES = [ 'ar', 'fa', 'ur', 'ckb', 'ps' ];\n\nconst EASTERN_ARABIC_NUMBERS = /([۰-۹]|[٠-٩])/g;\n\n/**\n * Checks to see if a value is a numeric value (`number` or `string`).\n *\n * Intentionally ignores whether the thousands delimiters are only\n * in the thousands marks.\n *\n * @param {any} value\n * @param {string} [locale]\n * @return {boolean} Whether value is numeric.\n */\nexport function isValueNumeric( value, locale = window.navigator.language ) {\n\tif ( ARABIC_NUMERAL_LOCALES.some( ( l ) => locale.startsWith( l ) ) ) {\n\t\tlocale = 'en-GB';\n\t\tif ( EASTERN_ARABIC_NUMBERS.test( value ) ) {\n\t\t\tvalue = value\n\t\t\t\t.replace( /[٠-٩]/g, ( /** @type {string} */ d ) =>\n\t\t\t\t\t'٠١٢٣٤٥٦٧٨٩'.indexOf( d )\n\t\t\t\t)\n\t\t\t\t.replace( /[۰-۹]/g, ( /** @type {string} */ d ) =>\n\t\t\t\t\t'۰۱۲۳۴۵۶۷۸۹'.indexOf( d )\n\t\t\t\t)\n\t\t\t\t.replace( /٬/g, ',' )\n\t\t\t\t.replace( /٫/g, '.' );\n\t\t}\n\t}\n\n\tconst [ delimiterRegexp, decimalRegexp ] =\n\t\tgetDelimiterAndDecimalRegex( locale );\n\tconst valueToCheck =\n\t\ttypeof value === 'string'\n\t\t\t? value\n\t\t\t\t\t.replace( delimiterRegexp, '' )\n\t\t\t\t\t.replace( decimalRegexp, '.' )\n\t\t\t\t\t.replace( INTERNATIONAL_THOUSANDS_DELIMITER, '' )\n\t\t\t: value;\n\treturn ! isNaN( parseFloat( valueToCheck ) ) && isFinite( valueToCheck );\n}\n\n/**\n * Converts a string to a number.\n *\n * @param {string} value\n * @return {number} String as a number.\n */\nexport const stringToNumber = ( value ) => {\n\treturn parseFloat( value );\n};\n\n/**\n * Converts a number to a string.\n *\n * @param {number} value\n * @return {string} Number as a string.\n */\nexport const numberToString = ( value ) => {\n\treturn `${ value }`;\n};\n\n/**\n * Regardless of the input being a string or a number, returns a number.\n *\n * Returns `undefined` in case the string is `undefined` or not a valid numeric value.\n *\n * @param {string | number} value\n * @return {number} The parsed number.\n */\nexport const ensureNumber = ( value ) => {\n\treturn typeof value === 'string' ? stringToNumber( value ) : value;\n};\n\n/**\n * Regardless of the input being a string or a number, returns a number.\n *\n * Returns `undefined` in case the string is `undefined` or not a valid numeric value.\n *\n * @param {string | number} value\n * @return {string} The converted string, or `undefined` in case the input is `undefined` or `NaN`.\n */\nexport const ensureString = ( value ) => {\n\treturn typeof value === 'string' ? value : numberToString( value );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AAC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GAAGA,KAAO,EAAC;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMyC,YAAY,GAAKzC,KAAK,IAAM;EACxC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGuC,cAAc,CAAEvC,KAAM,CAAC,GAAGA,KAAK;AACnE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM0C,YAAY,GAAK1C,KAAK,IAAM;EACxC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGwC,cAAc,CAAExC,KAAM,CAAC;AACnE,CAAC"}
1
+ {"version":3,"names":["isValueDefined","value","undefined","isValueEmpty","isEmptyString","getDefinedValue","values","fallbackValue","_values$find","find","stringToNumber","parseFloat","ensureNumber"],"sources":["@wordpress/components/src/utils/values.js"],"sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * Determines if a value is null or undefined.\n *\n * @template T\n *\n * @param {T} value The value to check.\n * @return {value is Exclude<T, null | undefined>} Whether value is not null or undefined.\n */\nexport function isValueDefined( value ) {\n\treturn value !== undefined && value !== null;\n}\n/* eslint-enable jsdoc/valid-types */\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Determines if a value is empty, null, or undefined.\n *\n * @param {string | number | null | undefined} value The value to check.\n * @return {value is (\"\" | null | undefined)} Whether value is empty.\n */\nexport function isValueEmpty( value ) {\n\tconst isEmptyString = value === '';\n\n\treturn ! isValueDefined( value ) || isEmptyString;\n}\n/* eslint-enable jsdoc/valid-types */\n\n/**\n * Get the first defined/non-null value from an array.\n *\n * @template T\n *\n * @param {Array<T | null | undefined>} values Values to derive from.\n * @param {T} fallbackValue Fallback value if there are no defined values.\n * @return {T} A defined value or the fallback value.\n */\nexport function getDefinedValue( values = [], fallbackValue ) {\n\treturn values.find( isValueDefined ) ?? fallbackValue;\n}\n\n/**\n * Converts a string to a number.\n *\n * @param {string} value\n * @return {number} String as a number.\n */\nexport const stringToNumber = ( value ) => {\n\treturn parseFloat( value );\n};\n\n/**\n * Regardless of the input being a string or a number, returns a number.\n *\n * Returns `undefined` in case the string is `undefined` or not a valid numeric value.\n *\n * @param {string | number} value\n * @return {number} The parsed number.\n */\nexport const ensureNumber = ( value ) => {\n\treturn typeof value === 'string' ? stringToNumber( value ) : value;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,cAAcA,CAAEC,KAAK,EAAG;EACvC,OAAOA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,IAAI;AAC7C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,YAAYA,CAAEF,KAAK,EAAG;EACrC,MAAMG,aAAa,GAAGH,KAAK,KAAK,EAAE;EAElC,OAAO,CAAED,cAAc,CAAEC,KAAM,CAAC,IAAIG,aAAa;AAClD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAEC,MAAM,GAAG,EAAE,EAAEC,aAAa,EAAG;EAAA,IAAAC,YAAA;EAC7D,QAAAA,YAAA,GAAOF,MAAM,CAACG,IAAI,CAAET,cAAe,CAAC,cAAAQ,YAAA,cAAAA,YAAA,GAAID,aAAa;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,cAAc,GAAKT,KAAK,IAAM;EAC1C,OAAOU,UAAU,CAAEV,KAAM,CAAC;AAC3B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMW,YAAY,GAAKX,KAAK,IAAM;EACxC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGS,cAAc,CAAET,KAAM,CAAC,GAAGA,KAAK;AACnE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/circular-option-picker/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAKtE;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAOrD,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,oBAAoB,CA8BrD,CAAC;AACF,eAAe,IAAI,CAAC;AAiDpB,eAAO,MAAM,OAAO,6IAAsB,CAAC;AAG3C,eAAO,MAAM,gBAAgB,6IAAsB,CAAC;AAOpD,eAAO,MAAM,sBAAsB,6IAAsB,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/circular-option-picker/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAKtE;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAOrD,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,oBAAoB,CAiCrD,CAAC;AACF,eAAe,IAAI,CAAC;AAiDpB,eAAO,MAAM,OAAO,6IAAsB,CAAC;AAG3C,eAAO,MAAM,gBAAgB,6IAAsB,CAAC;AAOpD,eAAO,MAAM,sBAAsB,6IAAsB,CAAC"}
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import type { ColorObject, ColorPaletteProps, PaletteObject } from './types';
5
5
  export declare const extractColorNameFromCurrentValue: (currentValue?: ColorPaletteProps['value'], colors?: ColorPaletteProps['colors'], showMultiplePalettes?: boolean) => string;
6
- export declare const showTransparentBackground: (currentValue?: string) => boolean;
7
6
  export declare const isMultiplePaletteObject: (obj: PaletteObject | ColorObject) => obj is PaletteObject;
8
7
  export declare const isMultiplePaletteArray: (arr: (PaletteObject | ColorObject)[]) => arr is PaletteObject[];
9
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/color-palette/utils.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7E,eAAO,MAAM,gCAAgC,kBAC7B,iBAAiB,CAAE,OAAO,CAAE,WACnC,iBAAiB,CAAE,QAAQ,CAAE,yBACf,OAAO,WA8B7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,kBAAoB,MAAM,YAK/D,CAAC;AAIF,eAAO,MAAM,uBAAuB,QAC9B,aAAa,GAAG,WAAW,yBAEwC,CAAC;AAE1E,eAAO,MAAM,sBAAsB,QAC7B,CAAE,aAAa,GAAG,WAAW,CAAE,EAAE,2BAMtC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,UACxB,MAAM,GAAG,SAAS,WAChB,WAAW,GAAG,IAAI,uBAgB3B,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/color-palette/utils.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7E,eAAO,MAAM,gCAAgC,kBAC7B,iBAAiB,CAAE,OAAO,CAAE,WACnC,iBAAiB,CAAE,QAAQ,CAAE,yBACf,OAAO,WA8B7B,CAAC;AAIF,eAAO,MAAM,uBAAuB,QAC9B,aAAa,GAAG,WAAW,yBAEwC,CAAC;AAE1E,eAAO,MAAM,sBAAsB,QAC7B,CAAE,aAAa,GAAG,WAAW,CAAE,EAAE,2BAMtC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,UACxB,MAAM,GAAG,SAAS,WAChB,WAAW,GAAG,IAAI,uBAgB3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/dropdown-menu-v2/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAOpD,OAAO,EACN,YAAY,EAUZ,MAAM,IAAI,CAAC;AAiBZ,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,YAAY,CAwBpC,CAAC;AACF,eAAe,IAAI,CAAC;AAiEpB,eAAO,MAAM,OAAO,oOAAsB,CAAC;AAoE3C,eAAO,MAAM,cAAc,EAAE,KAAK,CAAE,OAAO,YAAY,CAItD,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/dropdown-menu-v2/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAOpD,OAAO,EACN,YAAY,EAUZ,MAAM,IAAI,CAAC;AAiBZ,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,YAAY,CA2BpC,CAAC;AACF,eAAe,IAAI,CAAC;AAiEpB,eAAO,MAAM,OAAO,oOAAsB,CAAC;AAoE3C,eAAO,MAAM,cAAc,EAAE,KAAK,CAAE,OAAO,YAAY,CAItD,CAAC"}
@@ -259,7 +259,7 @@ export declare function useItem(props: WordPressComponentProps<ItemProps, 'div'>
259
259
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
260
260
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
261
261
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
262
- as: "symbol" | "object" | "g" | "map" | "filter" | "clipPath" | "mask" | "marker" | "button" | "meter" | "textarea" | "style" | "progress" | "text" | "ruby" | "table" | "small" | "sub" | "circle" | "embed" | "pre" | "caption" | "menu" | "menuitem" | "big" | "link" | "sup" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "canvas" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "mark" | "meta" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "q" | "rp" | "rt" | "s" | "samp" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "summary" | "template" | "tbody" | "td" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view";
262
+ as: "symbol" | "object" | "map" | "filter" | "clipPath" | "mask" | "marker" | "button" | "meter" | "textarea" | "style" | "progress" | "text" | "ruby" | "table" | "small" | "sub" | "circle" | "embed" | "pre" | "caption" | "menu" | "menuitem" | "big" | "link" | "sup" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "canvas" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "mark" | "meta" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "q" | "rp" | "rt" | "s" | "samp" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "summary" | "template" | "tbody" | "td" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view";
263
263
  className: string;
264
264
  onClick: import("react").MouseEventHandler<HTMLDivElement> | undefined;
265
265
  wrapperClassName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.tsx"],"names":[],"mappings":";AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAoG5C;;;;;;;;;;GAUG;AACH,iBAAS,OAAO,CAAE,EACjB,IAAS,EACT,KAAU,EACV,IAAI,EACJ,MAAW,EACX,OAAY,EACZ,OAAO,GACP,EAAE,YAAY,eA4Jd;AAED,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.tsx"],"names":[],"mappings":";AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAoG5C;;;;;;;;;;GAUG;AACH,iBAAS,OAAO,CAAE,EACjB,IAAS,EACT,KAAU,EACV,IAAI,EACJ,MAAW,EACX,OAAY,EACZ,OAAO,GACP,EAAE,YAAY,eA+Jd;AAED,eAAe,OAAO,CAAC"}
@@ -14,13 +14,6 @@ export declare const Default: import("@storybook/types").AnnotatedStoryFn<import
14
14
  onChange: (value: string) => void;
15
15
  onClose?: (() => void) | undefined;
16
16
  placeholder?: string | undefined;
17
- /**
18
- * When an `onClose` callback is provided, the search control will render a close button
19
- * that will trigger the given callback.
20
- *
21
- * Use this if you want the button to trigger your own logic to close the search field entirely,
22
- * rather than just clearing the input value.
23
- */
24
17
  value?: string | undefined;
25
18
  } & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "help" | "children" | "label" | "as" | "placeholder" | "onClose" | "hideLabelFromVision" | "__nextHasNoMarginBottom"> & import("react").RefAttributes<HTMLInputElement>>;
26
19
  /**
@@ -35,13 +28,6 @@ export declare const WithOnClose: import("@storybook/types").AnnotatedStoryFn<im
35
28
  onChange: (value: string) => void;
36
29
  onClose?: (() => void) | undefined;
37
30
  placeholder?: string | undefined;
38
- /**
39
- * When an `onClose` callback is provided, the search control will render a close button
40
- * that will trigger the given callback.
41
- *
42
- * Use this if you want the button to trigger your own logic to close the search field entirely,
43
- * rather than just clearing the input value.
44
- */
45
31
  value?: string | undefined;
46
32
  } & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "help" | "children" | "label" | "as" | "placeholder" | "onClose" | "hideLabelFromVision" | "__nextHasNoMarginBottom"> & import("react").RefAttributes<HTMLInputElement>>;
47
33
  //# sourceMappingURL=index.story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/search-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAOtE;;GAEG;AACH,OAAO,aAAa,MAAM,IAAI,CAAC;AAE/B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,aAAa,CAU9C,CAAC;AACF,eAAe,IAAI,CAAC;AAoBpB,eAAO,MAAM,OAAO;;;;;IAMpB;;;;;;OAMG;;+XAZuC,CAAC;AAM3C;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;;;;IAPxB;;;;;;OAMG;;+XAC2C,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/search-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAOtE;;GAEG;AACH,OAAO,aAAa,MAAM,IAAI,CAAC;AAE/B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,aAAa,CAU9C,CAAC;AACF,eAAe,IAAI,CAAC;AAoBpB,eAAO,MAAM,OAAO;;;;;;+XAAsB,CAAC;AAM3C;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;;;;;+XAAsB,CAAC"}
@@ -1,7 +1,5 @@
1
- export const REACT_TYPEOF_KEY: "$$typeof";
2
1
  export const COMPONENT_NAMESPACE: "data-wp-component";
3
2
  export const CONNECTED_NAMESPACE: "data-wp-c16t";
4
- export const CONTEXT_COMPONENT_NAMESPACE: "data-wp-c5tc8t";
5
3
  /**
6
4
  * Special key where the connected namespaces are stored.
7
5
  * This is attached to Context connected components as a static property.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/ui/context/constants.js"],"names":[],"mappings":"AAAA,0CAA2C;AAC3C,sDAAuD;AACvD,iDAAkD;AAClD,2DAA4D;AAE5D;;;GAGG;AACH,8DAA+D"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/ui/context/constants.js"],"names":[],"mappings":"AAAA,sDAAuD;AACvD,iDAAkD;AAElD;;;GAGG;AACH,8DAA+D"}
@@ -43,12 +43,4 @@ export function clamp(value: number, min: number, max: number): number;
43
43
  * @return {number} The rounded and clamped value.
44
44
  */
45
45
  export function roundClamp(value?: number | string, min?: number, max?: number, step?: number): number;
46
- /**
47
- * Clamps a value based on a min/max range with rounding.
48
- * Returns a string.
49
- *
50
- * @param {Parameters<typeof roundClamp>} args Arguments for roundClamp().
51
- * @return {string} The rounded and clamped value.
52
- */
53
- export function roundClampString(value?: string | number | undefined, min?: number | undefined, max?: number | undefined, step?: number | undefined): string;
54
46
  //# sourceMappingURL=math.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/utils/math.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,iCAJW,OAAO,GAEN,MAAM,CAMjB;AAED;;;;;;GAMG;AACH,6BAJW,MAAM,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAQjB;AAED;;;;;;GAMG;AACH,kCAJW,MAAM,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAWjB;AAcD;;;;;;;;GAQG;AACH,6BANW,MAAM,OACN,MAAM,OACN,MAAM,GAEL,MAAM,CAKjB;AAED;;;;;;;;;GASG;AACH,mCAPW,MAAM,GAAG,MAAM,QACf,MAAM,QACN,MAAM,SACN,MAAM,GAEL,MAAM,CAiBjB;AAED;;;;;;GAMG;AACH,sJAFY,MAAM,CAIjB"}
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/utils/math.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,iCAJW,OAAO,GAEN,MAAM,CAMjB;AAED;;;;;;GAMG;AACH,6BAJW,MAAM,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAQjB;AAED;;;;;;GAMG;AACH,kCAJW,MAAM,MAAM,GAAC,MAAM,CAAC,GAEnB,MAAM,CAWjB;AAcD;;;;;;;;GAQG;AACH,6BANW,MAAM,OACN,MAAM,OACN,MAAM,GAEL,MAAM,CAKjB;AAED;;;;;;;;;GASG;AACH,mCAPW,MAAM,GAAG,MAAM,QACf,MAAM,QACN,MAAM,SACN,MAAM,GAEL,MAAM,CAiBjB"}
@@ -24,19 +24,6 @@ export function isValueEmpty(value: string | number | null | undefined): value i
24
24
  * @return {T} A defined value or the fallback value.
25
25
  */
26
26
  export function getDefinedValue<T>(values: (T | null | undefined)[] | undefined, fallbackValue: T): T;
27
- /**
28
- * Checks to see if a value is a numeric value (`number` or `string`).
29
- *
30
- * Intentionally ignores whether the thousands delimiters are only
31
- * in the thousands marks.
32
- *
33
- * @param {any} value
34
- * @param {string} [locale]
35
- * @return {boolean} Whether value is numeric.
36
- */
37
- export function isValueNumeric(value: any, locale?: string | undefined): boolean;
38
27
  export function stringToNumber(value: string): number;
39
- export function numberToString(value: number): string;
40
28
  export function ensureNumber(value: string | number): number;
41
- export function ensureString(value: string | number): string;
42
29
  //# sourceMappingURL=values.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/utils/values.js"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,mFAEC;AAID;;;;;GAKG;AACH,oCAHW,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,kCAO5C;AAGD;;;;;;;;GAQG;AACH,sGAEC;AAuBD;;;;;;;;;GASG;AACH,sCAJW,GAAG,gCAEF,OAAO,CA4BlB;AAQM,sCAHI,MAAM,GACL,MAAM,CAIjB;AAQM,sCAHI,MAAM,GACL,MAAM,CAIjB;AAUM,oCAHI,MAAM,GAAG,MAAM,GACd,MAAM,CAIjB;AAUM,oCAHI,MAAM,GAAG,MAAM,GACd,MAAM,CAIjB"}
1
+ {"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../src/utils/values.js"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,mFAEC;AAID;;;;;GAKG;AACH,oCAHW,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,kCAO5C;AAGD;;;;;;;;GAQG;AACH,sGAEC;AAQM,sCAHI,MAAM,GACL,MAAM,CAIjB;AAUM,oCAHI,MAAM,GAAG,MAAM,GACd,MAAM,CAIjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "25.6.0",
3
+ "version": "25.6.1",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -41,23 +41,23 @@
41
41
  "@floating-ui/react-dom": "1.0.0",
42
42
  "@radix-ui/react-dropdown-menu": "2.0.4",
43
43
  "@use-gesture/react": "^10.2.24",
44
- "@wordpress/a11y": "^3.40.0",
45
- "@wordpress/compose": "^6.17.0",
46
- "@wordpress/date": "^4.40.0",
47
- "@wordpress/deprecated": "^3.40.0",
48
- "@wordpress/dom": "^3.40.0",
49
- "@wordpress/element": "^5.17.0",
50
- "@wordpress/escape-html": "^2.40.0",
51
- "@wordpress/hooks": "^3.40.0",
52
- "@wordpress/html-entities": "^3.40.0",
53
- "@wordpress/i18n": "^4.40.0",
54
- "@wordpress/icons": "^9.31.0",
55
- "@wordpress/is-shallow-equal": "^4.40.0",
56
- "@wordpress/keycodes": "^3.40.0",
57
- "@wordpress/primitives": "^3.38.0",
58
- "@wordpress/private-apis": "^0.22.0",
59
- "@wordpress/rich-text": "^6.17.0",
60
- "@wordpress/warning": "^2.40.0",
44
+ "@wordpress/a11y": "^3.40.1",
45
+ "@wordpress/compose": "^6.17.1",
46
+ "@wordpress/date": "^4.40.1",
47
+ "@wordpress/deprecated": "^3.40.1",
48
+ "@wordpress/dom": "^3.40.1",
49
+ "@wordpress/element": "^5.17.1",
50
+ "@wordpress/escape-html": "^2.40.1",
51
+ "@wordpress/hooks": "^3.40.1",
52
+ "@wordpress/html-entities": "^3.40.1",
53
+ "@wordpress/i18n": "^4.40.1",
54
+ "@wordpress/icons": "^9.31.1",
55
+ "@wordpress/is-shallow-equal": "^4.40.1",
56
+ "@wordpress/keycodes": "^3.40.1",
57
+ "@wordpress/primitives": "^3.38.1",
58
+ "@wordpress/private-apis": "^0.22.1",
59
+ "@wordpress/rich-text": "^6.17.1",
60
+ "@wordpress/warning": "^2.40.1",
61
61
  "change-case": "^4.1.2",
62
62
  "classnames": "^2.3.1",
63
63
  "colord": "^2.7.0",
@@ -87,5 +87,5 @@
87
87
  "publishConfig": {
88
88
  "access": "public"
89
89
  },
90
- "gitHead": "78a288d55b83a713b2f7d98d5a855c0771a2afc6"
90
+ "gitHead": "bb1fbf87bb0f451744530fc6a85de2dff1263bed"
91
91
  }
@@ -25,7 +25,7 @@ const meta: ComponentMeta< typeof AlignmentMatrixControl > = {
25
25
  },
26
26
  parameters: {
27
27
  controls: { expanded: true },
28
- docs: { source: { state: 'open' } },
28
+ docs: { canvas: { sourceState: 'shown' } },
29
29
  },
30
30
  };
31
31
  export default meta;
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { act, render, screen, within } from '@testing-library/react';
4
+ import { render, screen, within } from '@testing-library/react';
5
+ import userEvent from '@testing-library/user-event';
5
6
 
6
7
  /**
7
8
  * Internal dependencies
@@ -27,6 +28,7 @@ describe( 'AlignmentMatrixControl', () => {
27
28
 
28
29
  describe( 'Change value', () => {
29
30
  const alignments = [ 'center left', 'center center', 'bottom center' ];
31
+ const user = userEvent.setup();
30
32
 
31
33
  it.each( alignments )(
32
34
  'should change value on %s cell click',
@@ -37,7 +39,9 @@ describe( 'AlignmentMatrixControl', () => {
37
39
  <AlignmentMatrixControl value="center" onChange={ spy } />
38
40
  );
39
41
 
40
- await act( () => getCell( alignment ).focus() );
42
+ await user.click( getCell( alignment ) );
43
+
44
+ expect( getCell( alignment ) ).toHaveFocus();
41
45
 
42
46
  expect( spy ).toHaveBeenCalledWith( alignment );
43
47
  }
@@ -25,7 +25,7 @@ const meta: ComponentMeta< typeof AnglePickerControl > = {
25
25
  controls: {
26
26
  expanded: true,
27
27
  },
28
- docs: { source: { state: 'open' } },
28
+ docs: { canvas: { sourceState: 'shown' } },
29
29
  },
30
30
  };
31
31
 
@@ -14,7 +14,7 @@ const meta: ComponentMeta< typeof Animate > = {
14
14
  component: Animate,
15
15
  parameters: {
16
16
  controls: { expanded: true },
17
- docs: { source: { state: 'open' } },
17
+ docs: { canvas: { sourceState: 'shown' } },
18
18
  },
19
19
  };
20
20
  export default meta;
@@ -19,7 +19,7 @@ const meta: ComponentMeta< typeof BaseControl > = {
19
19
  },
20
20
  parameters: {
21
21
  controls: { expanded: true },
22
- docs: { source: { state: 'open' } },
22
+ docs: { canvas: { sourceState: 'shown' } },
23
23
  },
24
24
  };
25
25
  export default meta;
@@ -26,7 +26,7 @@ const meta: ComponentMeta< typeof BorderBoxControl > = {
26
26
  },
27
27
  parameters: {
28
28
  controls: { expanded: true },
29
- docs: { source: { state: 'open' } },
29
+ docs: { canvas: { sourceState: 'shown' } },
30
30
  },
31
31
  };
32
32
  export default meta;
@@ -29,7 +29,7 @@ const meta: ComponentMeta< typeof BorderControl > = {
29
29
  },
30
30
  parameters: {
31
31
  controls: { expanded: true },
32
- docs: { source: { state: 'open' } },
32
+ docs: { canvas: { sourceState: 'shown' } },
33
33
  },
34
34
  };
35
35
  export default meta;
@@ -39,7 +39,7 @@ const meta: Meta< typeof Button > = {
39
39
  },
40
40
  parameters: {
41
41
  controls: { expanded: true },
42
- docs: { source: { state: 'open' } },
42
+ docs: { canvas: { sourceState: 'shown' } },
43
43
  },
44
44
  };
45
45
  export default meta;
@@ -17,7 +17,7 @@ const meta: ComponentMeta< typeof ButtonGroup > = {
17
17
  },
18
18
  parameters: {
19
19
  controls: { expanded: true },
20
- docs: { source: { state: 'open' } },
20
+ docs: { canvas: { sourceState: 'shown' } },
21
21
  },
22
22
  };
23
23
  export default meta;
@@ -33,7 +33,7 @@ const meta: ComponentMeta< typeof Card > = {
33
33
  controls: {
34
34
  expanded: true,
35
35
  },
36
- docs: { source: { state: 'open' } },
36
+ docs: { canvas: { sourceState: 'shown' } },
37
37
  },
38
38
  };
39
39
 
@@ -31,7 +31,7 @@ const meta: ComponentMeta< typeof CheckboxControl > = {
31
31
  expanded: true,
32
32
  exclude: [ 'heading' ],
33
33
  },
34
- docs: { source: { state: 'open' } },
34
+ docs: { canvas: { sourceState: 'shown' } },
35
35
  },
36
36
  };
37
37
  export default meta;
@@ -27,7 +27,10 @@ const meta: ComponentMeta< typeof CircularOptionPicker > = {
27
27
  parameters: {
28
28
  actions: { argTypesRegex: '^on.*' },
29
29
  controls: { expanded: true },
30
- docs: { source: { state: 'open', excludeDecorators: true } },
30
+ docs: {
31
+ canvas: { sourceState: 'shown' },
32
+ source: { excludeDecorators: true },
33
+ },
31
34
  },
32
35
  decorators: [
33
36
  // Share current color state between main component, `actions` and `options`
@@ -20,7 +20,7 @@ const meta: ComponentMeta< typeof ColorIndicator > = {
20
20
  controls: {
21
21
  expanded: true,
22
22
  },
23
- docs: { source: { state: 'open' } },
23
+ docs: { canvas: { sourceState: 'shown' } },
24
24
  },
25
25
  };
26
26
  export default meta;
@@ -26,7 +26,7 @@ const meta: ComponentMeta< typeof ColorPalette > = {
26
26
  },
27
27
  parameters: {
28
28
  controls: { expanded: true },
29
- docs: { source: { state: 'open' } },
29
+ docs: { canvas: { sourceState: 'shown' } },
30
30
  },
31
31
  };
32
32
  export default meta;