@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
@@ -1,2 +0,0 @@
1
- export { default as Spinner } from "./component";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/spinner/index.js"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- export const ContainerView: import("@emotion/styled").StyledComponent<{
2
- theme?: import("@emotion/react").Theme | undefined;
3
- as?: import("react").ElementType<any> | undefined;
4
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
- export const BarsWrapperView: import("@emotion/styled").StyledComponent<{
6
- theme?: import("@emotion/react").Theme | undefined;
7
- as?: import("react").ElementType<any> | undefined;
8
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
9
- export const BarsView: import("@emotion/styled").StyledComponent<{
10
- theme?: import("@emotion/react").Theme | undefined;
11
- as?: import("react").ElementType<any> | undefined;
12
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
13
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/ui/spinner/styles.js"],"names":[],"mappings":"AAUA;;;0GAIE;AAEF;;;0GAQE;AAEF;;;0GAkFE"}
@@ -1,3 +0,0 @@
1
- export const BASE_SIZE: 16;
2
- export const WRAPPER_SIZE: 36;
3
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/ui/spinner/utils.js"],"names":[],"mappings":"AAAA,2BAA4B;AAC5B,8BAA+B"}
@@ -1,3 +0,0 @@
1
- import type { CSSInterpolation } from '@emotion/css';
2
- export declare function getHighDpi(strings: TemplateStringsArray, ...interpolations: CSSInterpolation[]): import("@emotion/utils").SerializedStyles;
3
- //# sourceMappingURL=get-high-dpi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-high-dpi.d.ts","sourceRoot":"","sources":["../../../src/ui/utils/get-high-dpi.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,wBAAgB,UAAU,CACzB,OAAO,EAAE,oBAAoB,EAC7B,GAAG,cAAc,EAAE,gBAAgB,EAAE,6CAUrC"}
@@ -1,33 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import type { ComponentMeta, ComponentStory } from '@storybook/react';
5
- /**
6
- * Internal dependencies
7
- */
8
- import { UnitControl } from '../';
9
- declare const meta: ComponentMeta<typeof UnitControl>;
10
- export default meta;
11
- export declare const Default: ComponentStory<typeof UnitControl>;
12
- /**
13
- * If the `isPressEnterToChange` prop is set to `true`, the `onChange` callback
14
- * will not fire while a new value is typed in the input field (you can verify this
15
- * behavior by inspecting the console's output).
16
- */
17
- export declare const PressEnterToChange: ComponentStory<typeof UnitControl>;
18
- /**
19
- * Most of `NumberControl`'s props can be passed to `UnitControl`, and they will
20
- * affect its numeric input field.
21
- */
22
- export declare const TweakingTheNumberInput: ComponentStory<typeof UnitControl>;
23
- /**
24
- * When only one unit is available, the unit selection dropdown becomes static text.
25
- */
26
- export declare const WithSingleUnit: ComponentStory<typeof UnitControl>;
27
- /**
28
- * It is possible to pass a custom list of units. Every time the unit changes,
29
- * if the `isResetValueOnUnitChange` is set to `true`, the input's quantity is
30
- * reset to the new unit's default value.
31
- */
32
- export declare const WithCustomUnits: ComponentStory<typeof UnitControl>;
33
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/unit-control/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOtE;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAGlC,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,WAAW,CAkB5C,CAAC;AACF,eAAe,IAAI,CAAC;AAoBpB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAE,OAAO,WAAW,CAC7B,CAAC;AAK5B;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAE,OAAO,WAAW,CACxC,CAAC;AAM5B;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAE,OAAO,WAAW,CAC5C,CAAC;AAS5B;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,cAAc,CAAE,OAAO,WAAW,CACpC,CAAC;AAM5B;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,CAAE,OAAO,WAAW,CAgB/D,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * @param {TemplateStringsArray} strings
3
- * @param {import('@emotion/css/create-instance').CSSInterpolation[]} interpolations
4
- */
5
- export function firefoxOnly(strings: TemplateStringsArray, ...interpolations: import('@emotion/css/create-instance').CSSInterpolation[]): import("@emotion/utils").SerializedStyles;
6
- /**
7
- * @param {TemplateStringsArray} strings
8
- * @param {import('@emotion/css/create-instance').CSSInterpolation[]} interpolations
9
- */
10
- export function safariOnly(strings: TemplateStringsArray, ...interpolations: import('@emotion/css/create-instance').CSSInterpolation[]): import("@emotion/utils").SerializedStyles;
11
- //# sourceMappingURL=browsers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browsers.d.ts","sourceRoot":"","sources":["../../src/utils/browsers.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,qCAHW,oBAAoB,qBACpB,OAAO,8BAA8B,EAAE,gBAAgB,EAAE,6CAUnE;AAED;;;GAGG;AACH,oCAHW,oBAAoB,qBACpB,OAAO,8BAA8B,EAAE,gBAAgB,EAAE,6CAYnE"}
@@ -1,11 +0,0 @@
1
- type EventHandler<T extends Event> = (event: T) => void;
2
- /**
3
- * Merges two sets of event handlers together.
4
- *
5
- * @template TEvent
6
- * @param handlers
7
- * @param extraHandlers
8
- */
9
- export declare function mergeEventHandlers<TEvent extends Event, TLeft extends Record<string, EventHandler<TEvent>>, TRight extends Record<string, EventHandler<TEvent>>>(handlers: TLeft, extraHandlers: TRight): TLeft & TRight;
10
- export {};
11
- //# sourceMappingURL=events.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,CAAE,CAAC,SAAS,KAAK,IAAK,CAAE,KAAK,EAAE,CAAC,KAAM,IAAI,CAAC;AAuB5D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,SAAS,KAAK,EACpB,KAAK,SAAS,MAAM,CAAE,MAAM,EAAE,YAAY,CAAE,MAAM,CAAE,CAAE,EACtD,MAAM,SAAS,MAAM,CAAE,MAAM,EAAE,YAAY,CAAE,MAAM,CAAE,CAAE,EACrD,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,GAAI,KAAK,GAAG,MAAM,CAe1D"}
@@ -1,9 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import type { ComponentStory, ComponentMeta } from '@storybook/react';
5
- import { VStack } from '../..';
6
- declare const meta: ComponentMeta<typeof VStack>;
7
- export default meta;
8
- export declare const Default: ComponentStory<typeof VStack>;
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v-stack/stories/e2e/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,MAAM,CAGvC,CAAC;AACF,eAAe,IAAI,CAAC;AAiBpB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAE,OAAO,MAAM,CAAwB,CAAC"}
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * External dependencies
4
- */
5
- import type { ComponentMeta, ComponentStory } from '@storybook/react';
6
- import { VStack } from '..';
7
- declare const meta: ComponentMeta<typeof VStack>;
8
- export default meta;
9
- export declare const Default: ComponentStory<import("../../ui/context").WordPressComponent<"div", Omit<import("../../h-stack/types").Props, "spacing" | "alignment"> & {
10
- alignment?: "initial" | "left" | "right" | (string & {}) | "bottom" | "top" | "-moz-initial" | "inherit" | "revert" | "revert-layer" | "unset" | "stretch" | "center" | "end" | "flex-end" | "flex-start" | "start" | "baseline" | "normal" | "self-end" | "self-start" | "edge" | "bottomLeft" | "bottomRight" | "topLeft" | "topRight" | undefined;
11
- spacing?: import("csstype").Property.Width<string | number> | undefined;
12
- } & import("react").RefAttributes<any>, true>>;
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v-stack/stories/index.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMtE,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAgB5B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,MAAM,CAkBvC,CAAC;AACF,eAAe,IAAI,CAAC;AAiBpB,eAAO,MAAM,OAAO;;;8CAAsB,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import type { ComponentMeta, ComponentStory } from '@storybook/react';
5
- /**
6
- * Internal dependencies
7
- */
8
- import { View } from '..';
9
- declare const meta: ComponentMeta<typeof View>;
10
- export default meta;
11
- export declare const Default: ComponentStory<typeof View>;
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/view/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,IAAI,CAWrC,CAAC;AACF,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAE,OAAO,IAAI,CAAwB,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import type { ComponentMeta, ComponentStory } from '@storybook/react';
5
- /**
6
- * Internal dependencies
7
- */
8
- import { VisuallyHidden } from '..';
9
- declare const meta: ComponentMeta<typeof VisuallyHidden>;
10
- export default meta;
11
- export declare const Default: ComponentStory<typeof VisuallyHidden>;
12
- export declare const WithForwardedProps: ComponentStory<typeof VisuallyHidden>;
13
- export declare const WithAdditionalClassNames: ComponentStory<typeof VisuallyHidden>;
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/visually-hidden/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEpC,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,cAAc,CAa/C,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAE,OAAO,cAAc,CAa1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAE,OAAO,cAAc,CAWrE,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,cAAc,CACpD,OAAO,cAAc,CAUrB,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { ComponentMeta, ComponentStory } from '@storybook/react';
2
- import { ZStack } from '..';
3
- declare const meta: ComponentMeta<typeof ZStack>;
4
- export default meta;
5
- export declare const Default: ComponentStory<typeof ZStack>;
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/z-stack/stories/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOtE,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAE5B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,MAAM,CAavC,CAAC;AACF,eAAe,IAAI,CAAC;AAsCpB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAE,OAAO,MAAM,CAAwB,CAAC"}
@@ -1,20 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { css } from '@emotion/react';
5
- // eslint-disable-next-line no-restricted-imports
6
- import type { CSSInterpolation } from '@emotion/css';
7
-
8
- export function getHighDpi(
9
- strings: TemplateStringsArray,
10
- ...interpolations: CSSInterpolation[]
11
- ) {
12
- const interpolatedStyles = css( strings, ...interpolations );
13
-
14
- return css`
15
- @media ( -webkit-min-device-pixel-ratio: 1.25 ),
16
- ( min-resolution: 120dpi ) {
17
- ${ interpolatedStyles }
18
- }
19
- `;
20
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { css } from '@emotion/react';
5
-
6
- /* eslint-disable jsdoc/no-undefined-types */
7
- /**
8
- * @param {TemplateStringsArray} strings
9
- * @param {import('@emotion/css/create-instance').CSSInterpolation[]} interpolations
10
- */
11
- export function firefoxOnly( strings, ...interpolations ) {
12
- const interpolatedStyles = css( strings, ...interpolations );
13
-
14
- return css`
15
- @-moz-document url-prefix() {
16
- ${ interpolatedStyles };
17
- }
18
- `;
19
- }
20
-
21
- /**
22
- * @param {TemplateStringsArray} strings
23
- * @param {import('@emotion/css/create-instance').CSSInterpolation[]} interpolations
24
- */
25
- export function safariOnly( strings, ...interpolations ) {
26
- const interpolatedStyles = css( strings, ...interpolations );
27
-
28
- return css`
29
- @media not all and ( min-resolution: 0.001dpcm ) {
30
- @supports ( -webkit-appearance: none ) {
31
- ${ interpolatedStyles }
32
- }
33
- }
34
- `;
35
- }
36
- /* eslint-enable jsdoc/no-undefined-types */
@@ -1,50 +0,0 @@
1
- type EventHandler< T extends Event > = ( event: T ) => void;
2
-
3
- /**
4
- * Merges event handlers together.
5
- *
6
- * @template TEvent
7
- * @param handler
8
- * @param otherHandler
9
- */
10
- function mergeEvent< TEvent extends Event >(
11
- handler: EventHandler< TEvent >,
12
- otherHandler: EventHandler< TEvent >
13
- ): EventHandler< TEvent > {
14
- return ( event: TEvent ) => {
15
- if ( typeof handler === 'function' ) {
16
- handler( event );
17
- }
18
- if ( typeof otherHandler === 'function' ) {
19
- otherHandler( event );
20
- }
21
- };
22
- }
23
-
24
- /**
25
- * Merges two sets of event handlers together.
26
- *
27
- * @template TEvent
28
- * @param handlers
29
- * @param extraHandlers
30
- */
31
- export function mergeEventHandlers<
32
- TEvent extends Event,
33
- TLeft extends Record< string, EventHandler< TEvent > >,
34
- TRight extends Record< string, EventHandler< TEvent > >
35
- >( handlers: TLeft, extraHandlers: TRight ): TLeft & TRight {
36
- // @ts-ignore We'll fill in all the properties below
37
- const mergedHandlers: TLeft & TRight = {
38
- ...handlers,
39
- };
40
-
41
- for ( const [ key, handler ] of Object.entries( extraHandlers ) ) {
42
- // @ts-ignore
43
- mergedHandlers[ key as keyof typeof mergedHandlers ] =
44
- key in mergedHandlers
45
- ? mergeEvent( mergedHandlers[ key ], handler )
46
- : handler;
47
- }
48
-
49
- return mergedHandlers;
50
- }
@@ -1,63 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { mergeEventHandlers } from '../events';
5
-
6
- describe( 'mergeEventHandlers', () => {
7
- it( 'should merge the two event handler objects', () => {
8
- const left = {
9
- onclick: jest.fn(),
10
- };
11
-
12
- const right = {
13
- onclick: jest.fn(),
14
- };
15
-
16
- const merged = mergeEventHandlers( left, right );
17
-
18
- merged.onclick();
19
-
20
- expect( left.onclick ).toHaveBeenCalled();
21
- expect( right.onclick ).toHaveBeenCalled();
22
- } );
23
-
24
- it( 'should preserve all handlers from the left hand side that do not overlap with the right', () => {
25
- const left = {
26
- ArrowUp: jest.fn(),
27
- ArrowDown: jest.fn(),
28
- };
29
-
30
- const right = {
31
- ArrowUp: jest.fn(),
32
- };
33
-
34
- const merged = mergeEventHandlers( left, right );
35
-
36
- merged.ArrowUp();
37
-
38
- expect( left.ArrowUp ).toHaveBeenCalled();
39
- expect( right.ArrowUp ).toHaveBeenCalled();
40
-
41
- expect( merged.ArrowDown ).toBe( left.ArrowDown );
42
- } );
43
-
44
- it( 'should preserve all handlers form the right hand side that do not overlap with the left', () => {
45
- const right = {
46
- ArrowUp: jest.fn(),
47
- ArrowDown: jest.fn(),
48
- };
49
-
50
- const left = {
51
- ArrowUp: jest.fn(),
52
- };
53
-
54
- const merged = mergeEventHandlers( left, right );
55
-
56
- merged.ArrowUp();
57
-
58
- expect( left.ArrowUp ).toHaveBeenCalled();
59
- expect( right.ArrowUp ).toHaveBeenCalled();
60
-
61
- expect( merged.ArrowDown ).toBe( right.ArrowDown );
62
- } );
63
- } );
@@ -1,101 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { isValueNumeric } from '../values';
5
-
6
- /**
7
- * This works because Node 12 ships with `small-icu` instead of `full-icu`
8
- * meaning it only supports the `en-US` locale. If we test for support of the
9
- * `pt-BR` locale, we can detect when we're running in a "full-icu" environment
10
- * i.e., either Node 14+ or previous versions built with the `full-icu` option.
11
- *
12
- * Furthermore, this is safe to run in a `jsdom` test environment because, as the
13
- * issue linked below describes, `jsdom` does not implement the Intl object, instead
14
- * relying on the relevant Node implementation.
15
- *
16
- * @see https://nodejs.org/docs/latest-v12.x/api/intl.html#intl_options_for_building_node_js
17
- * @see https://nodejs.org/docs/latest-v14.x/api/intl.html#intl_options_for_building_node_js
18
- * @see https://github.com/jsdom/jsdom/issues/1626
19
- *
20
- * @todo Remove when Node 12 is deprecated
21
- * @param {() => void} testCallback
22
- */
23
- function scopeTestToFullICU( testCallback ) {
24
- if ( Intl.NumberFormat.supportedLocalesOf( 'pt-BR' ).length === 1 ) {
25
- testCallback();
26
- }
27
- }
28
-
29
- describe( 'isValueNumeric', () => {
30
- it( 'should handle space separated numbers for locales with period decimal delimiters', () => {
31
- expect( isValueNumeric( '1 000.1', 'en-US' ) ).toBe( true );
32
- } );
33
-
34
- it.each( [
35
- '999',
36
- '99.33',
37
- 0.0003,
38
- 2222,
39
- '22,222,222',
40
- -888,
41
- new Number(),
42
- ] )(
43
- 'should return `true` for numeric values %s for locale with comma delimiter',
44
- ( x ) => {
45
- expect( isValueNumeric( x, 'en-US' ) ).toBe( true );
46
- }
47
- );
48
-
49
- it.each( [ null, , 'Stringy', {}, [] ] )(
50
- 'should return `false` for non-numeric value %s for locale with comma delimiter',
51
- ( x ) => {
52
- expect( isValueNumeric( x, 'en-US' ) ).toBe( false );
53
- }
54
- );
55
-
56
- scopeTestToFullICU( () => {
57
- it( 'should handle space separated numbers for locales with comma decimal delimiters', () => {
58
- expect( isValueNumeric( '1 000,1', 'pt-BR' ) ).toBe( true );
59
- } );
60
-
61
- it.each( [
62
- '999',
63
- '99,33',
64
- 0.0003,
65
- 2222,
66
- '22.222.222',
67
- -888,
68
- new Number(),
69
- ] )(
70
- 'should return `true` for numeric values %s for locale with period delimiter',
71
- ( x ) => {
72
- expect( isValueNumeric( x, 'pt-BR' ) ).toBe( true );
73
- }
74
- );
75
-
76
- it.each( [ null, , 'Stringy', {}, [] ] )(
77
- 'should return `false` for non-numeric value %s for locale with period delimiter',
78
- ( x ) => {
79
- expect( isValueNumeric( x, 'pt-BR' ) ).toBe( false );
80
- }
81
- );
82
-
83
- it( 'should handle arabic locales with western arabic numerals', () => {
84
- expect( isValueNumeric( '1.000,1', 'ar' ) ).toBe( true );
85
- expect( isValueNumeric( '1.000,1', 'fa' ) ).toBe( true );
86
- expect( isValueNumeric( '1.000,1', 'ur' ) ).toBe( true );
87
- expect( isValueNumeric( '1.000,1', 'ckb' ) ).toBe( true );
88
- expect( isValueNumeric( '1.000,1', 'ps' ) ).toBe( true );
89
- expect( isValueNumeric( '1.000,a', 'ar' ) ).toBe( false );
90
- } );
91
-
92
- it( 'should handle arabic locales with eastern arabic numerals', () => {
93
- expect( isValueNumeric( '١٬٠٠٠٫١', 'ar' ) ).toBe( true );
94
- expect( isValueNumeric( '۴۵۶٫۱', 'fa' ) ).toBe( true );
95
- expect( isValueNumeric( '١٬٠٠٠٫١', 'ur' ) ).toBe( true );
96
- expect( isValueNumeric( '١٬٠٠٠٫١', 'ckb' ) ).toBe( true );
97
- expect( isValueNumeric( '١٬٠٠٠٫١', 'ps' ) ).toBe( true );
98
- expect( isValueNumeric( '١٬٠٠٠٫a', 'ar' ) ).toBe( false );
99
- } );
100
- } );
101
- } );