@wordpress/components 25.9.1 → 25.11.1-next.f8d8eceb.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/build/alignment-matrix-control/cell.js +8 -5
  3. package/build/alignment-matrix-control/cell.js.map +1 -1
  4. package/build/alignment-matrix-control/index.js +27 -43
  5. package/build/alignment-matrix-control/index.js.map +1 -1
  6. package/build/alignment-matrix-control/utils.js +29 -9
  7. package/build/alignment-matrix-control/utils.js.map +1 -1
  8. package/build/autocomplete/index.js +104 -52
  9. package/build/autocomplete/index.js.map +1 -1
  10. package/build/circular-option-picker/circular-option-picker-option.js +20 -39
  11. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  12. package/build/circular-option-picker/circular-option-picker.js +11 -32
  13. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  14. package/build/circular-option-picker/types.js.map +1 -1
  15. package/build/color-palette/index.js +7 -2
  16. package/build/color-palette/index.js.map +1 -1
  17. package/build/color-picker/component.js +12 -2
  18. package/build/color-picker/component.js.map +1 -1
  19. package/build/color-picker/picker.js +77 -1
  20. package/build/color-picker/picker.js.map +1 -1
  21. package/build/color-picker/styles.js +8 -8
  22. package/build/color-picker/styles.js.map +1 -1
  23. package/build/color-picker/types.js.map +1 -1
  24. package/build/composite/v2.js +43 -0
  25. package/build/composite/v2.js.map +1 -0
  26. package/build/confirm-dialog/component.js +74 -8
  27. package/build/confirm-dialog/component.js.map +1 -1
  28. package/build/confirm-dialog/types.js.map +1 -1
  29. package/build/custom-gradient-picker/gradient-bar/control-points.js +13 -4
  30. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  31. package/build/dropdown-menu-v2-ariakit/index.js +217 -0
  32. package/build/dropdown-menu-v2-ariakit/index.js.map +1 -0
  33. package/build/dropdown-menu-v2-ariakit/styles.js +157 -0
  34. package/build/dropdown-menu-v2-ariakit/styles.js.map +1 -0
  35. package/build/dropdown-menu-v2-ariakit/types.js +6 -0
  36. package/build/dropdown-menu-v2-ariakit/types.js.map +1 -0
  37. package/build/font-size-picker/utils.js +1 -1
  38. package/build/font-size-picker/utils.js.map +1 -1
  39. package/build/input-control/styles/input-control-styles.js +23 -23
  40. package/build/input-control/styles/input-control-styles.js.map +1 -1
  41. package/build/mobile/global-styles-context/utils.native.js +1 -1
  42. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  43. package/build/modal/index.js +45 -16
  44. package/build/modal/index.js.map +1 -1
  45. package/build/palette-edit/index.js +4 -0
  46. package/build/palette-edit/index.js.map +1 -1
  47. package/build/popover/index.js +34 -6
  48. package/build/popover/index.js.map +1 -1
  49. package/build/private-apis.js +18 -2
  50. package/build/private-apis.js.map +1 -1
  51. package/build/progress-bar/styles.js +5 -5
  52. package/build/progress-bar/styles.js.map +1 -1
  53. package/build/sandbox/index.js +1 -1
  54. package/build/sandbox/index.js.map +1 -1
  55. package/build/sandbox/index.native.js +1 -1
  56. package/build/sandbox/index.native.js.map +1 -1
  57. package/build/select-control/styles/select-control-styles.js +8 -8
  58. package/build/select-control/styles/select-control-styles.js.map +1 -1
  59. package/build/tabs/context.js +16 -0
  60. package/build/tabs/context.js.map +1 -0
  61. package/build/tabs/index.js +147 -0
  62. package/build/tabs/index.js.map +1 -0
  63. package/build/tabs/styles.js +38 -0
  64. package/build/tabs/styles.js.map +1 -0
  65. package/build/tabs/tab.js +46 -0
  66. package/build/tabs/tab.js.map +1 -0
  67. package/build/tabs/tablist.js +47 -0
  68. package/build/tabs/tablist.js.map +1 -0
  69. package/build/tabs/tabpanel.js +48 -0
  70. package/build/tabs/tabpanel.js.map +1 -0
  71. package/build/tabs/types.js +6 -0
  72. package/build/tabs/types.js.map +1 -0
  73. package/build/text/component.js +7 -6
  74. package/build/text/component.js.map +1 -1
  75. package/build/text/hook.js +6 -15
  76. package/build/text/hook.js.map +1 -1
  77. package/build/text/index.js.map +1 -1
  78. package/build/text/styles.js +7 -7
  79. package/build/text/styles.js.map +1 -1
  80. package/build/text/types.js.map +1 -1
  81. package/build/text/utils.js +17 -33
  82. package/build/text/utils.js.map +1 -1
  83. package/build/toggle-group-control/toggle-group-control-option-base/component.js +1 -0
  84. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  85. package/build/toolbar/toolbar/index.js +17 -10
  86. package/build/toolbar/toolbar/index.js.map +1 -1
  87. package/build/toolbar/toolbar/types.js.map +1 -1
  88. package/build/tools-panel/tools-panel-item/hook.js +2 -2
  89. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  90. package/build/tools-panel/types.js.map +1 -1
  91. package/build/tooltip/index.js +2 -2
  92. package/build/tooltip/index.js.map +1 -1
  93. package/build/unit-control/utils.js +108 -0
  94. package/build/unit-control/utils.js.map +1 -1
  95. package/build/utils/unit-values.js +1 -1
  96. package/build/utils/unit-values.js.map +1 -1
  97. package/build-module/alignment-matrix-control/cell.js +7 -4
  98. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  99. package/build-module/alignment-matrix-control/index.js +27 -43
  100. package/build-module/alignment-matrix-control/index.js.map +1 -1
  101. package/build-module/alignment-matrix-control/utils.js +29 -8
  102. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  103. package/build-module/autocomplete/index.js +104 -52
  104. package/build-module/autocomplete/index.js.map +1 -1
  105. package/build-module/circular-option-picker/circular-option-picker-option.js +20 -39
  106. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  107. package/build-module/circular-option-picker/circular-option-picker.js +10 -31
  108. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  109. package/build-module/circular-option-picker/types.js.map +1 -1
  110. package/build-module/color-palette/index.js +7 -2
  111. package/build-module/color-palette/index.js.map +1 -1
  112. package/build-module/color-picker/component.js +13 -3
  113. package/build-module/color-picker/component.js.map +1 -1
  114. package/build-module/color-picker/picker.js +78 -2
  115. package/build-module/color-picker/picker.js.map +1 -1
  116. package/build-module/color-picker/styles.js +8 -8
  117. package/build-module/color-picker/styles.js.map +1 -1
  118. package/build-module/color-picker/types.js.map +1 -1
  119. package/build-module/composite/v2.js +15 -0
  120. package/build-module/composite/v2.js.map +1 -0
  121. package/build-module/confirm-dialog/component.js +72 -7
  122. package/build-module/confirm-dialog/component.js.map +1 -1
  123. package/build-module/confirm-dialog/types.js.map +1 -1
  124. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +13 -4
  125. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  126. package/build-module/dropdown-menu-v2-ariakit/index.js +199 -0
  127. package/build-module/dropdown-menu-v2-ariakit/index.js.map +1 -0
  128. package/build-module/dropdown-menu-v2-ariakit/styles.js +136 -0
  129. package/build-module/dropdown-menu-v2-ariakit/styles.js.map +1 -0
  130. package/build-module/dropdown-menu-v2-ariakit/types.js +2 -0
  131. package/build-module/dropdown-menu-v2-ariakit/types.js.map +1 -0
  132. package/build-module/font-size-picker/utils.js +1 -1
  133. package/build-module/font-size-picker/utils.js.map +1 -1
  134. package/build-module/input-control/styles/input-control-styles.js +23 -23
  135. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  136. package/build-module/mobile/global-styles-context/utils.native.js +2 -2
  137. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  138. package/build-module/modal/index.js +47 -18
  139. package/build-module/modal/index.js.map +1 -1
  140. package/build-module/palette-edit/index.js +4 -0
  141. package/build-module/palette-edit/index.js.map +1 -1
  142. package/build-module/popover/index.js +34 -6
  143. package/build-module/popover/index.js.map +1 -1
  144. package/build-module/private-apis.js +18 -2
  145. package/build-module/private-apis.js.map +1 -1
  146. package/build-module/progress-bar/styles.js +5 -5
  147. package/build-module/progress-bar/styles.js.map +1 -1
  148. package/build-module/sandbox/index.js +1 -1
  149. package/build-module/sandbox/index.js.map +1 -1
  150. package/build-module/sandbox/index.native.js +1 -1
  151. package/build-module/sandbox/index.native.js.map +1 -1
  152. package/build-module/select-control/styles/select-control-styles.js +8 -8
  153. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  154. package/build-module/tabs/context.js +12 -0
  155. package/build-module/tabs/context.js.map +1 -0
  156. package/build-module/tabs/index.js +142 -0
  157. package/build-module/tabs/index.js.map +1 -0
  158. package/build-module/tabs/styles.js +36 -0
  159. package/build-module/tabs/styles.js.map +1 -0
  160. package/build-module/tabs/tab.js +43 -0
  161. package/build-module/tabs/tab.js.map +1 -0
  162. package/build-module/tabs/tablist.js +41 -0
  163. package/build-module/tabs/tablist.js.map +1 -0
  164. package/build-module/tabs/tabpanel.js +43 -0
  165. package/build-module/tabs/tabpanel.js.map +1 -0
  166. package/build-module/tabs/types.js +2 -0
  167. package/build-module/tabs/types.js.map +1 -0
  168. package/build-module/text/component.js +6 -6
  169. package/build-module/text/component.js.map +1 -1
  170. package/build-module/text/hook.js +11 -19
  171. package/build-module/text/hook.js.map +1 -1
  172. package/build-module/text/index.js.map +1 -1
  173. package/build-module/text/styles.js +7 -7
  174. package/build-module/text/styles.js.map +1 -1
  175. package/build-module/text/types.js.map +1 -1
  176. package/build-module/text/utils.js +17 -10
  177. package/build-module/text/utils.js.map +1 -1
  178. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +1 -0
  179. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  180. package/build-module/toolbar/toolbar/index.js +18 -11
  181. package/build-module/toolbar/toolbar/index.js.map +1 -1
  182. package/build-module/toolbar/toolbar/types.js.map +1 -1
  183. package/build-module/tools-panel/tools-panel-item/hook.js +2 -2
  184. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  185. package/build-module/tools-panel/types.js.map +1 -1
  186. package/build-module/tooltip/index.js +2 -2
  187. package/build-module/tooltip/index.js.map +1 -1
  188. package/build-module/unit-control/utils.js +108 -0
  189. package/build-module/unit-control/utils.js.map +1 -1
  190. package/build-module/utils/unit-values.js +1 -1
  191. package/build-module/utils/unit-values.js.map +1 -1
  192. package/build-style/style-rtl.css +17 -5
  193. package/build-style/style.css +17 -5
  194. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  195. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  196. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  197. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  198. package/build-types/alignment-matrix-control/utils.d.ts +9 -9
  199. package/build-types/alignment-matrix-control/utils.d.ts.map +1 -1
  200. package/build-types/autocomplete/index.d.ts.map +1 -1
  201. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  202. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  203. package/build-types/circular-option-picker/types.d.ts +4 -6
  204. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  205. package/build-types/color-palette/index.d.ts.map +1 -1
  206. package/build-types/color-picker/component.d.ts.map +1 -1
  207. package/build-types/color-picker/picker.d.ts +1 -1
  208. package/build-types/color-picker/picker.d.ts.map +1 -1
  209. package/build-types/color-picker/styles.d.ts.map +1 -1
  210. package/build-types/color-picker/types.d.ts +3 -0
  211. package/build-types/color-picker/types.d.ts.map +1 -1
  212. package/build-types/composite/v2.d.ts +12 -0
  213. package/build-types/composite/v2.d.ts.map +1 -0
  214. package/build-types/confirm-dialog/component.d.ts +70 -29
  215. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  216. package/build-types/confirm-dialog/stories/index.story.d.ts +11 -0
  217. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -0
  218. package/build-types/confirm-dialog/test/index.d.ts +2 -0
  219. package/build-types/confirm-dialog/test/index.d.ts.map +1 -0
  220. package/build-types/confirm-dialog/types.d.ts +32 -10
  221. package/build-types/confirm-dialog/types.d.ts.map +1 -1
  222. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  223. package/build-types/dropdown-menu-v2-ariakit/index.d.ts +11 -0
  224. package/build-types/dropdown-menu-v2-ariakit/index.d.ts.map +1 -0
  225. package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts +16 -0
  226. package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts.map +1 -0
  227. package/build-types/dropdown-menu-v2-ariakit/styles.d.ts +88 -0
  228. package/build-types/dropdown-menu-v2-ariakit/styles.d.ts.map +1 -0
  229. package/build-types/dropdown-menu-v2-ariakit/test/index.d.ts +2 -0
  230. package/build-types/dropdown-menu-v2-ariakit/test/index.d.ts.map +1 -0
  231. package/build-types/dropdown-menu-v2-ariakit/types.d.ts +174 -0
  232. package/build-types/dropdown-menu-v2-ariakit/types.d.ts.map +1 -0
  233. package/build-types/font-size-picker/utils.d.ts.map +1 -1
  234. package/build-types/heading/stories/index.story.d.ts.map +1 -1
  235. package/build-types/modal/index.d.ts.map +1 -1
  236. package/build-types/palette-edit/index.d.ts.map +1 -1
  237. package/build-types/popover/index.d.ts +1 -1
  238. package/build-types/popover/index.d.ts.map +1 -1
  239. package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
  240. package/build-types/private-apis.d.ts.map +1 -1
  241. package/build-types/progress-bar/styles.d.ts.map +1 -1
  242. package/build-types/sandbox/index.d.ts.map +1 -1
  243. package/build-types/tabs/context.d.ts +8 -0
  244. package/build-types/tabs/context.d.ts.map +1 -0
  245. package/build-types/tabs/index.d.ts +13 -0
  246. package/build-types/tabs/index.d.ts.map +1 -0
  247. package/build-types/tabs/stories/index.story.d.ts +20 -0
  248. package/build-types/tabs/stories/index.story.d.ts.map +1 -0
  249. package/build-types/tabs/styles.d.ts +17 -0
  250. package/build-types/tabs/styles.d.ts.map +1 -0
  251. package/build-types/tabs/tab.d.ts +10 -0
  252. package/build-types/tabs/tab.d.ts.map +1 -0
  253. package/build-types/tabs/tablist.d.ts +7 -0
  254. package/build-types/tabs/tablist.d.ts.map +1 -0
  255. package/build-types/tabs/tabpanel.d.ts +7 -0
  256. package/build-types/tabs/tabpanel.d.ts.map +1 -0
  257. package/build-types/tabs/test/index.d.ts +2 -0
  258. package/build-types/tabs/test/index.d.ts.map +1 -0
  259. package/build-types/tabs/types.d.ts +134 -0
  260. package/build-types/tabs/types.d.ts.map +1 -0
  261. package/build-types/text/component.d.ts +4 -2
  262. package/build-types/text/component.d.ts.map +1 -1
  263. package/build-types/text/hook.d.ts +171 -165
  264. package/build-types/text/hook.d.ts.map +1 -1
  265. package/build-types/text/index.d.ts +2 -2
  266. package/build-types/text/index.d.ts.map +1 -1
  267. package/build-types/text/stories/index.story.d.ts +21 -0
  268. package/build-types/text/stories/index.story.d.ts.map +1 -0
  269. package/build-types/text/styles.d.ts +7 -7
  270. package/build-types/text/styles.d.ts.map +1 -1
  271. package/build-types/text/types.d.ts +1 -1
  272. package/build-types/text/types.d.ts.map +1 -1
  273. package/build-types/text/utils.d.ts +56 -61
  274. package/build-types/text/utils.d.ts.map +1 -1
  275. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  276. package/build-types/toolbar/stories/index.story.d.ts +5 -0
  277. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  278. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  279. package/build-types/toolbar/toolbar/types.d.ts +10 -0
  280. package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
  281. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  282. package/build-types/tools-panel/types.d.ts +2 -0
  283. package/build-types/tools-panel/types.d.ts.map +1 -1
  284. package/build-types/tooltip/index.d.ts.map +1 -1
  285. package/build-types/unit-control/utils.d.ts.map +1 -1
  286. package/package.json +21 -20
  287. package/src/alignment-matrix-control/cell.tsx +6 -2
  288. package/src/alignment-matrix-control/index.tsx +31 -54
  289. package/src/alignment-matrix-control/stories/index.story.tsx +3 -7
  290. package/src/alignment-matrix-control/test/index.tsx +117 -18
  291. package/src/alignment-matrix-control/utils.tsx +33 -9
  292. package/src/autocomplete/index.tsx +136 -77
  293. package/src/button/style.scss +1 -2
  294. package/src/circular-option-picker/circular-option-picker-option.tsx +24 -38
  295. package/src/circular-option-picker/circular-option-picker.tsx +11 -28
  296. package/src/circular-option-picker/types.ts +6 -5
  297. package/src/color-palette/index.tsx +6 -1
  298. package/src/color-picker/component.tsx +25 -3
  299. package/src/color-picker/picker.tsx +96 -2
  300. package/src/color-picker/styles.ts +0 -1
  301. package/src/color-picker/types.ts +3 -0
  302. package/src/composite/v2.ts +22 -0
  303. package/src/confirm-dialog/README.md +1 -1
  304. package/src/confirm-dialog/component.tsx +79 -13
  305. package/src/confirm-dialog/stories/{index.story.js → index.story.tsx} +26 -24
  306. package/src/confirm-dialog/test/{index.js → index.tsx} +3 -3
  307. package/src/confirm-dialog/types.ts +32 -12
  308. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +32 -25
  309. package/src/dimension-control/test/__snapshots__/index.test.js.snap +8 -8
  310. package/src/dropdown-menu-v2-ariakit/README.md +324 -0
  311. package/src/dropdown-menu-v2-ariakit/index.tsx +318 -0
  312. package/src/dropdown-menu-v2-ariakit/stories/index.story.tsx +506 -0
  313. package/src/dropdown-menu-v2-ariakit/styles.ts +297 -0
  314. package/src/dropdown-menu-v2-ariakit/test/index.tsx +1139 -0
  315. package/src/dropdown-menu-v2-ariakit/types.ts +186 -0
  316. package/src/font-size-picker/utils.ts +2 -1
  317. package/src/heading/stories/index.story.tsx +2 -4
  318. package/src/input-control/styles/input-control-styles.tsx +2 -2
  319. package/src/mobile/global-styles-context/utils.native.js +2 -2
  320. package/src/modal/index.tsx +58 -22
  321. package/src/modal/test/index.tsx +29 -0
  322. package/src/notice/style.scss +0 -1
  323. package/src/palette-edit/index.tsx +4 -0
  324. package/src/popover/index.tsx +99 -57
  325. package/src/popover/style.scss +9 -0
  326. package/src/private-apis.ts +31 -1
  327. package/src/progress-bar/styles.ts +19 -4
  328. package/src/sandbox/index.native.js +1 -1
  329. package/src/sandbox/index.tsx +3 -1
  330. package/src/select-control/styles/select-control-styles.ts +2 -2
  331. package/src/tabs/README.md +242 -0
  332. package/src/tabs/context.ts +13 -0
  333. package/src/tabs/index.tsx +167 -0
  334. package/src/tabs/stories/index.story.tsx +352 -0
  335. package/src/tabs/styles.ts +103 -0
  336. package/src/tabs/tab.tsx +39 -0
  337. package/src/tabs/tablist.tsx +40 -0
  338. package/src/tabs/tabpanel.tsx +42 -0
  339. package/src/tabs/test/index.tsx +1133 -0
  340. package/src/tabs/types.ts +142 -0
  341. package/src/text/README.md +2 -2
  342. package/src/text/{component.js → component.tsx} +10 -6
  343. package/src/text/{hook.js → hook.ts} +12 -15
  344. package/src/text/stories/index.story.tsx +80 -0
  345. package/src/text/types.ts +1 -6
  346. package/src/text/{utils.js → utils.ts} +40 -14
  347. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +16 -0
  348. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +1 -0
  349. package/src/toolbar/stories/index.story.tsx +15 -0
  350. package/src/toolbar/test/index.tsx +8 -0
  351. package/src/toolbar/toolbar/README.md +9 -0
  352. package/src/toolbar/toolbar/index.tsx +21 -12
  353. package/src/toolbar/toolbar/style.scss +9 -0
  354. package/src/toolbar/toolbar/types.ts +10 -0
  355. package/src/tools-panel/tools-panel/README.md +3 -0
  356. package/src/tools-panel/tools-panel-item/hook.ts +4 -6
  357. package/src/tools-panel/types.ts +2 -0
  358. package/src/tooltip/index.tsx +2 -3
  359. package/src/unit-control/utils.ts +124 -0
  360. package/src/utils/unit-values.ts +1 -1
  361. package/tsconfig.tsbuildinfo +1 -1
  362. package/src/text/stories/index.story.js +0 -53
  363. /package/src/text/{index.js → index.ts} +0 -0
  364. /package/src/text/{styles.js → styles.ts} +0 -0
@@ -11,4 +11,9 @@ declare const meta: Meta<typeof Toolbar>;
11
11
  export default meta;
12
12
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../toolbar/types").ToolbarProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "as" | keyof import("../toolbar/types").ToolbarProps> & import("react").RefAttributes<any>>;
13
13
  export declare const WithoutGroup: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../toolbar/types").ToolbarProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "as" | keyof import("../toolbar/types").ToolbarProps> & import("react").RefAttributes<any>>;
14
+ /**
15
+ * Set the variant to `unstyled` to remove default border styles.
16
+ * Otherwise, leave it as `undefined` for default styles.
17
+ */
18
+ export declare const Unstyled: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../toolbar/types").ToolbarProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "as" | keyof import("../toolbar/types").ToolbarProps> & import("react").RefAttributes<any>>;
14
19
  //# sourceMappingURL=index.story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/toolbar/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAwBtD;;GAEG;AACH,OAAO,EACN,OAAO,EAKP,MAAM,IAAI,CAAC;AAGZ,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAoB/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAgBpB,eAAO,MAAM,OAAO,iZAAsB,CAAC;AA8F3C,eAAO,MAAM,YAAY,iZAAsB,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/toolbar/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAwBtD;;GAEG;AACH,OAAO,EACN,OAAO,EAKP,MAAM,IAAI,CAAC;AAGZ,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAwB/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAgBpB,eAAO,MAAM,OAAO,iZAAsB,CAAC;AA8F3C,eAAO,MAAM,YAAY,iZAAsB,CAAC;AAahD;;;GAGG;AAEH,eAAO,MAAM,QAAQ,iZAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar/index.tsx"],"names":[],"mappings":";AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAsD5C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO,uSAAmC,CAAC;AACxD,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar/index.tsx"],"names":[],"mappings":";AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA+D5C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO,uSAAmC,CAAC;AACxD,eAAe,OAAO,CAAC"}
@@ -11,5 +11,15 @@ export type ToolbarProps = {
11
11
  * An accessible label for the toolbar.
12
12
  */
13
13
  label: string;
14
+ /**
15
+ * Specifies the toolbar's style.
16
+ *
17
+ * Leave undefined for the default style. Or `'unstyled'` which
18
+ * removes the border from the toolbar, but keeps the default
19
+ * popover style.
20
+ *
21
+ * @default undefined
22
+ */
23
+ variant?: 'unstyled' | undefined;
14
24
  };
15
25
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,YAAY,GAAG;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACd,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,YAAY,GAAG;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/tools-panel/tools-panel-item/hook.ts"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAG7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAIpD,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,uBAAuB,CAAE,mBAAmB,EAAE,KAAK,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgM5D"}
1
+ {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/tools-panel/tools-panel-item/hook.ts"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAG7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAIpD,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,uBAAuB,CAAE,mBAAmB,EAAE,KAAK,CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8L5D"}
@@ -47,6 +47,8 @@ export type ToolsPanelProps = {
47
47
  /**
48
48
  * Advises the `ToolsPanel` that its child `ToolsPanelItem`s should render
49
49
  * placeholder content instead of null when they are toggled off and hidden.
50
+ * Note that placeholder items won't apply the `className` that would be
51
+ * normally applied to a visible `ToolsPanelItem` via the `className` prop.
50
52
  *
51
53
  * @default false
52
54
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tools-panel/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG,CAAE,UAAU,CAAC,EAAE,GAAG,KAAM,GAAG,CAAC;AACzD,KAAK,QAAQ,GAAG,CAAE,OAAO,CAAC,EAAE,cAAc,EAAE,KAAM,IAAI,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG;IAC7B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B;;;OAGG;IACH,KAAK,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BAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mCAAmC,CAAC,EAAE,MAAM,CAAC;IAC7C,kCAAkC,CAAC,EAAE,MAAM,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,CAAE,MAAM,EAAE,OAAO,CAAE,EAAE,CAAC;IAC7B,UAAU,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACvC,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;IACvC,aAAa,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tooltip/index.tsx"],"names":[],"mappings":";AAaA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C;;GAEG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC,iBAAS,OAAO,CAAE,KAAK,EAAE,YAAY,eA8EpC;AAED,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tooltip/index.tsx"],"names":[],"mappings":";AAaA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C;;GAEG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC,iBAAS,OAAO,CAAE,KAAK,EAAE,YAAY,eA6EpC;AAED,eAAe,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/unit-control/utils.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAiGjD;;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E,CAmB5C;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAE,IAAI,EAAE,MAAM,GAAI,MAAM,GAAG,SAAS,CAG5E;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACtC,iBAAiB,sBAAe,EAChC,cAAc,EAAE,iBAAiB,EAAE,GACjC,iBAAiB,EAAE,CASrB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc;;;;MAQtB,iBAAiB,EAmBrB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CACtC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAC1B,UAAU,CAAC,EAAE,MAAM,EACnB,KAAK,GAAE,iBAAiB,EAAkB,GACxC,iBAAiB,EAAE,CAkBrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "25.9.1",
3
+ "version": "25.11.1-next.f8d8eceb.0",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -30,7 +30,8 @@
30
30
  ],
31
31
  "types": "build-types",
32
32
  "dependencies": {
33
- "@ariakit/react": "^0.3.3",
33
+ "@ariakit/react": "^0.3.5",
34
+ "@ariakit/test": "^0.3.0",
34
35
  "@babel/runtime": "^7.16.0",
35
36
  "@emotion/cache": "^11.7.1",
36
37
  "@emotion/css": "^11.7.1",
@@ -43,23 +44,23 @@
43
44
  "@types/gradient-parser": "0.1.3",
44
45
  "@types/highlight-words-core": "1.2.1",
45
46
  "@use-gesture/react": "^10.2.24",
46
- "@wordpress/a11y": "^3.43.0",
47
- "@wordpress/compose": "^6.20.0",
48
- "@wordpress/date": "^4.43.0",
49
- "@wordpress/deprecated": "^3.43.0",
50
- "@wordpress/dom": "^3.43.0",
51
- "@wordpress/element": "^5.20.0",
52
- "@wordpress/escape-html": "^2.43.0",
53
- "@wordpress/hooks": "^3.43.0",
54
- "@wordpress/html-entities": "^3.43.0",
55
- "@wordpress/i18n": "^4.43.0",
56
- "@wordpress/icons": "^9.34.0",
57
- "@wordpress/is-shallow-equal": "^4.43.0",
58
- "@wordpress/keycodes": "^3.43.0",
59
- "@wordpress/primitives": "^3.41.0",
60
- "@wordpress/private-apis": "^0.25.0",
61
- "@wordpress/rich-text": "^6.20.1",
62
- "@wordpress/warning": "^2.43.0",
47
+ "@wordpress/a11y": "^3.44.1-next.f8d8eceb.0",
48
+ "@wordpress/compose": "^6.21.1-next.f8d8eceb.0",
49
+ "@wordpress/date": "^4.44.1-next.f8d8eceb.0",
50
+ "@wordpress/deprecated": "^3.44.1-next.f8d8eceb.0",
51
+ "@wordpress/dom": "^3.44.1-next.f8d8eceb.0",
52
+ "@wordpress/element": "^5.21.1-next.f8d8eceb.0",
53
+ "@wordpress/escape-html": "^2.44.1-next.f8d8eceb.0",
54
+ "@wordpress/hooks": "^3.44.1-next.f8d8eceb.0",
55
+ "@wordpress/html-entities": "^3.44.1-next.f8d8eceb.0",
56
+ "@wordpress/i18n": "^4.44.1-next.f8d8eceb.0",
57
+ "@wordpress/icons": "^9.35.1-next.f8d8eceb.0",
58
+ "@wordpress/is-shallow-equal": "^4.44.1-next.f8d8eceb.0",
59
+ "@wordpress/keycodes": "^3.44.1-next.f8d8eceb.0",
60
+ "@wordpress/primitives": "^3.42.1-next.f8d8eceb.0",
61
+ "@wordpress/private-apis": "^0.26.1-next.f8d8eceb.0",
62
+ "@wordpress/rich-text": "^6.21.1-next.f8d8eceb.0",
63
+ "@wordpress/warning": "^2.44.1-next.f8d8eceb.0",
63
64
  "change-case": "^4.1.2",
64
65
  "classnames": "^2.3.1",
65
66
  "colord": "^2.7.0",
@@ -89,5 +90,5 @@
89
90
  "publishConfig": {
90
91
  "access": "public"
91
92
  },
92
- "gitHead": "e17f760ed0dc11cce78157d7c2f2086b1b3c09d8"
93
+ "gitHead": "8d8fd197e202b8104ffb1cb83048efd0a6c3faf4"
93
94
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import { CompositeItem } from '../composite';
4
+ import { CompositeItem } from '../composite/v2';
5
5
  import Tooltip from '../tooltip';
6
6
  import { VisuallyHidden } from '../visually-hidden';
7
7
 
@@ -17,6 +17,7 @@ import type { AlignmentMatrixControlCellProps } from './types';
17
17
  import type { WordPressComponentProps } from '../context';
18
18
 
19
19
  export default function Cell( {
20
+ id,
20
21
  isActive = false,
21
22
  value,
22
23
  ...props
@@ -25,7 +26,10 @@ export default function Cell( {
25
26
 
26
27
  return (
27
28
  <Tooltip text={ tooltipText }>
28
- <CompositeItem as={ CellView } role="gridcell" { ...props }>
29
+ <CompositeItem
30
+ id={ id }
31
+ render={ <CellView { ...props } role="gridcell" /> }
32
+ >
29
33
  { /* VoiceOver needs a text content to be rendered within grid cell,
30
34
  otherwise it'll announce the content as "blank". So we use a visually
31
35
  hidden element instead of aria-label. */ }
@@ -8,32 +8,17 @@ import classnames from 'classnames';
8
8
  */
9
9
  import { __, isRTL } from '@wordpress/i18n';
10
10
  import { useInstanceId } from '@wordpress/compose';
11
- import { useState, useEffect } from '@wordpress/element';
12
11
 
13
12
  /**
14
13
  * Internal dependencies
15
14
  */
16
15
  import Cell from './cell';
17
- import { Composite, CompositeGroup, useCompositeState } from '../composite';
16
+ import { Composite, CompositeRow, useCompositeStore } from '../composite/v2';
18
17
  import { Root, Row } from './styles/alignment-matrix-control-styles';
19
18
  import AlignmentMatrixControlIcon from './icon';
20
- import { GRID, getItemId } from './utils';
19
+ import { GRID, getItemId, getItemValue } from './utils';
21
20
  import type { WordPressComponentProps } from '../context';
22
- import type {
23
- AlignmentMatrixControlProps,
24
- AlignmentMatrixControlValue,
25
- } from './types';
26
-
27
- const noop = () => {};
28
-
29
- function useBaseId( id?: string ) {
30
- const instanceId = useInstanceId(
31
- AlignmentMatrixControl,
32
- 'alignment-matrix-control'
33
- );
34
-
35
- return id || instanceId;
36
- }
21
+ import type { AlignmentMatrixControlProps } from './types';
37
22
 
38
23
  /**
39
24
  *
@@ -61,31 +46,27 @@ export function AlignmentMatrixControl( {
61
46
  label = __( 'Alignment Matrix Control' ),
62
47
  defaultValue = 'center center',
63
48
  value,
64
- onChange = noop,
49
+ onChange,
65
50
  width = 92,
66
51
  ...props
67
52
  }: WordPressComponentProps< AlignmentMatrixControlProps, 'div', false > ) {
68
- const [ immutableDefaultValue ] = useState( value ?? defaultValue );
69
- const baseId = useBaseId( id );
70
- const initialCurrentId = getItemId( baseId, immutableDefaultValue );
53
+ const baseId = useInstanceId(
54
+ AlignmentMatrixControl,
55
+ 'alignment-matrix-control',
56
+ id
57
+ );
71
58
 
72
- const composite = useCompositeState( {
73
- baseId,
74
- currentId: initialCurrentId,
59
+ const compositeStore = useCompositeStore( {
60
+ defaultActiveId: getItemId( baseId, defaultValue ),
61
+ activeId: getItemId( baseId, value ),
62
+ setActiveId: ( nextActiveId ) => {
63
+ const nextValue = getItemValue( baseId, nextActiveId );
64
+ if ( nextValue ) onChange?.( nextValue );
65
+ },
75
66
  rtl: isRTL(),
76
67
  } );
77
68
 
78
- const handleOnChange = ( nextValue: AlignmentMatrixControlValue ) => {
79
- onChange( nextValue );
80
- };
81
-
82
- const { setCurrentId } = composite;
83
-
84
- useEffect( () => {
85
- if ( typeof value !== 'undefined' ) {
86
- setCurrentId( getItemId( baseId, value ) );
87
- }
88
- }, [ value, setCurrentId, baseId ] );
69
+ const activeId = compositeStore.useState( 'activeId' );
89
70
 
90
71
  const classes = classnames(
91
72
  'component-alignment-matrix-control',
@@ -94,38 +75,34 @@ export function AlignmentMatrixControl( {
94
75
 
95
76
  return (
96
77
  <Composite
97
- { ...props }
98
- { ...composite }
99
- aria-label={ label }
100
- as={ Root }
101
- className={ classes }
102
- role="grid"
103
- size={ width }
78
+ store={ compositeStore }
79
+ render={
80
+ <Root
81
+ { ...props }
82
+ aria-label={ label }
83
+ className={ classes }
84
+ id={ baseId }
85
+ role="grid"
86
+ size={ width }
87
+ />
88
+ }
104
89
  >
105
90
  { GRID.map( ( cells, index ) => (
106
- <CompositeGroup
107
- { ...composite }
108
- as={ Row }
109
- role="row"
110
- key={ index }
111
- >
91
+ <CompositeRow render={ <Row role="row" /> } key={ index }>
112
92
  { cells.map( ( cell ) => {
113
93
  const cellId = getItemId( baseId, cell );
114
- const isActive = composite.currentId === cellId;
94
+ const isActive = cellId === activeId;
115
95
 
116
96
  return (
117
97
  <Cell
118
- { ...composite }
119
98
  id={ cellId }
120
99
  isActive={ isActive }
121
100
  key={ cell }
122
101
  value={ cell }
123
- onFocus={ () => handleOnChange( cell ) }
124
- tabIndex={ isActive ? 0 : -1 }
125
102
  />
126
103
  );
127
104
  } ) }
128
- </CompositeGroup>
105
+ </CompositeRow>
129
106
  ) ) }
130
107
  </Composite>
131
108
  );
@@ -6,7 +6,7 @@ import type { Meta, StoryFn } from '@storybook/react';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { useEffect, useState } from '@wordpress/element';
9
+ import { useState } from '@wordpress/element';
10
10
  import { Icon } from '@wordpress/icons';
11
11
 
12
12
  /**
@@ -24,10 +24,11 @@ const meta: Meta< typeof AlignmentMatrixControl > = {
24
24
  'AlignmentMatrixControl.Icon': AlignmentMatrixControl.Icon,
25
25
  },
26
26
  argTypes: {
27
- onChange: { action: 'onChange', control: { type: null } },
27
+ onChange: { control: { type: null } },
28
28
  value: { control: { type: null } },
29
29
  },
30
30
  parameters: {
31
+ actions: { argTypesRegex: '^on.*' },
31
32
  controls: { expanded: true },
32
33
  docs: { canvas: { sourceState: 'shown' } },
33
34
  },
@@ -42,11 +43,6 @@ const Template: StoryFn< typeof AlignmentMatrixControl > = ( {
42
43
  const [ value, setValue ] =
43
44
  useState< AlignmentMatrixControlProps[ 'value' ] >();
44
45
 
45
- // Convenience handler for Canvas view so changes are reflected
46
- useEffect( () => {
47
- setValue( defaultValue );
48
- }, [ defaultValue ] );
49
-
50
46
  return (
51
47
  <AlignmentMatrixControl
52
48
  { ...props }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { render, screen, within } from '@testing-library/react';
4
+ import { render, screen, waitFor, within } from '@testing-library/react';
5
5
  import userEvent from '@testing-library/user-event';
6
6
 
7
7
  /**
@@ -17,34 +17,133 @@ const getCell = ( name: string ) => {
17
17
  return within( getControl() ).getByRole( 'gridcell', { name } );
18
18
  };
19
19
 
20
+ const renderAndInitCompositeStore = async (
21
+ jsx: JSX.Element,
22
+ focusedCell = 'center center'
23
+ ) => {
24
+ const view = render( jsx );
25
+ await waitFor( () => {
26
+ expect( getCell( focusedCell ) ).toHaveAttribute( 'tabindex', '0' );
27
+ } );
28
+ return view;
29
+ };
30
+
20
31
  describe( 'AlignmentMatrixControl', () => {
21
32
  describe( 'Basic rendering', () => {
22
- it( 'should render', () => {
23
- render( <AlignmentMatrixControl /> );
33
+ it( 'should render', async () => {
34
+ await renderAndInitCompositeStore( <AlignmentMatrixControl /> );
24
35
 
25
36
  expect( getControl() ).toBeInTheDocument();
26
37
  } );
38
+
39
+ it( 'should be centered by default', async () => {
40
+ const user = userEvent.setup();
41
+
42
+ await renderAndInitCompositeStore( <AlignmentMatrixControl /> );
43
+
44
+ await user.tab();
45
+
46
+ expect( getCell( 'center center' ) ).toHaveFocus();
47
+ } );
27
48
  } );
28
49
 
29
- describe( 'Change value', () => {
30
- const alignments = [ 'center left', 'center center', 'bottom center' ];
31
- const user = userEvent.setup();
50
+ describe( 'Should change value', () => {
51
+ describe( 'with Mouse', () => {
52
+ describe( 'on cell click', () => {
53
+ it.each( [
54
+ 'top left',
55
+ 'top center',
56
+ 'top right',
57
+ 'center left',
58
+ 'center right',
59
+ 'bottom left',
60
+ 'bottom center',
61
+ 'bottom right',
62
+ ] )( '%s', async ( alignment ) => {
63
+ const user = userEvent.setup();
64
+ const spy = jest.fn();
65
+
66
+ await renderAndInitCompositeStore(
67
+ <AlignmentMatrixControl
68
+ value="center"
69
+ onChange={ spy }
70
+ />
71
+ );
72
+
73
+ const cell = getCell( alignment );
74
+
75
+ await user.click( cell );
32
76
 
33
- it.each( alignments )(
34
- 'should change value on %s cell click',
35
- async ( alignment ) => {
36
- const spy = jest.fn();
77
+ expect( cell ).toHaveFocus();
78
+ expect( spy ).toHaveBeenCalledWith( alignment );
79
+ } );
37
80
 
38
- render(
39
- <AlignmentMatrixControl value="center" onChange={ spy } />
40
- );
81
+ it( 'unless already focused', async () => {
82
+ const user = userEvent.setup();
83
+ const spy = jest.fn();
41
84
 
42
- await user.click( getCell( alignment ) );
85
+ await renderAndInitCompositeStore(
86
+ <AlignmentMatrixControl
87
+ value="center"
88
+ onChange={ spy }
89
+ />
90
+ );
43
91
 
44
- expect( getCell( alignment ) ).toHaveFocus();
92
+ const cell = getCell( 'center center' );
45
93
 
46
- expect( spy ).toHaveBeenCalledWith( alignment );
47
- }
48
- );
94
+ await user.click( cell );
95
+
96
+ expect( cell ).toHaveFocus();
97
+ expect( spy ).not.toHaveBeenCalled();
98
+ } );
99
+ } );
100
+ } );
101
+
102
+ describe( 'with Keyboard', () => {
103
+ describe( 'on arrow press', () => {
104
+ it.each( [
105
+ [ 'ArrowUp', 'top center' ],
106
+ [ 'ArrowLeft', 'center left' ],
107
+ [ 'ArrowDown', 'bottom center' ],
108
+ [ 'ArrowRight', 'center right' ],
109
+ ] )( '%s', async ( keyRef, cellRef ) => {
110
+ const user = userEvent.setup();
111
+ const spy = jest.fn();
112
+
113
+ await renderAndInitCompositeStore(
114
+ <AlignmentMatrixControl onChange={ spy } />
115
+ );
116
+
117
+ await user.tab();
118
+ await user.keyboard( `[${ keyRef }]` );
119
+
120
+ expect( getCell( cellRef ) ).toHaveFocus();
121
+ expect( spy ).toHaveBeenCalledWith( cellRef );
122
+ } );
123
+ } );
124
+
125
+ describe( 'but not at at edge', () => {
126
+ it.each( [
127
+ [ 'ArrowUp', 'top left' ],
128
+ [ 'ArrowLeft', 'top left' ],
129
+ [ 'ArrowDown', 'bottom right' ],
130
+ [ 'ArrowRight', 'bottom right' ],
131
+ ] )( '%s', async ( keyRef, cellRef ) => {
132
+ const user = userEvent.setup();
133
+ const spy = jest.fn();
134
+
135
+ await renderAndInitCompositeStore(
136
+ <AlignmentMatrixControl onChange={ spy } />
137
+ );
138
+
139
+ const cell = getCell( cellRef );
140
+ await user.click( cell );
141
+ await user.keyboard( `[${ keyRef }]` );
142
+
143
+ expect( cell ).toHaveFocus();
144
+ expect( spy ).toHaveBeenCalledWith( cellRef );
145
+ } );
146
+ } );
147
+ } );
49
148
  } );
50
149
  } );
@@ -2,6 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
+
5
6
  /**
6
7
  * Internal dependencies
7
8
  */
@@ -31,16 +32,24 @@ export const ALIGNMENT_LABEL: Record< AlignmentMatrixControlValue, string > = {
31
32
  export const ALIGNMENTS = GRID.flat();
32
33
 
33
34
  /**
34
- * Parses and transforms an incoming value to better match the alignment values
35
+ * Normalizes and transforms an incoming value to better match the alignment values
35
36
  *
36
37
  * @param value An alignment value to parse.
37
38
  *
38
39
  * @return The parsed value.
39
40
  */
40
- export function transformValue( value: AlignmentMatrixControlValue ) {
41
- const nextValue = value === 'center' ? 'center center' : value;
41
+ function normalize( value?: string | null ) {
42
+ const normalized = value === 'center' ? 'center center' : value;
43
+
44
+ // Strictly speaking, this could be `string | null | undefined`,
45
+ // but will be validated shortly, so we're typecasting to an
46
+ // `AlignmentMatrixControlValue` to keep TypeScript happy.
47
+ const transformed = normalized?.replace(
48
+ '-',
49
+ ' '
50
+ ) as AlignmentMatrixControlValue;
42
51
 
43
- return nextValue.replace( '-', ' ' ) as AlignmentMatrixControlValue;
52
+ return ALIGNMENTS.includes( transformed ) ? transformed : undefined;
44
53
  }
45
54
 
46
55
  /**
@@ -53,11 +62,25 @@ export function transformValue( value: AlignmentMatrixControlValue ) {
53
62
  */
54
63
  export function getItemId(
55
64
  prefixId: string,
56
- value: AlignmentMatrixControlValue
65
+ value?: AlignmentMatrixControlValue
57
66
  ) {
58
- const valueId = transformValue( value ).replace( ' ', '-' );
67
+ const normalized = normalize( value );
68
+ if ( ! normalized ) return;
69
+
70
+ const id = normalized.replace( ' ', '-' );
71
+ return `${ prefixId }-${ id }`;
72
+ }
59
73
 
60
- return `${ prefixId }-${ valueId }`;
74
+ /**
75
+ * Extracts an item value from its ID
76
+ *
77
+ * @param prefixId An ID prefix to remove
78
+ * @param id An item ID
79
+ * @return The item value
80
+ */
81
+ export function getItemValue( prefixId: string, id?: string | null ) {
82
+ const value = id?.replace( prefixId + '-', '' );
83
+ return normalize( value );
61
84
  }
62
85
 
63
86
  /**
@@ -70,8 +93,9 @@ export function getItemId(
70
93
  export function getAlignmentIndex(
71
94
  alignment: AlignmentMatrixControlValue = 'center'
72
95
  ) {
73
- const item = transformValue( alignment );
74
- const index = ALIGNMENTS.indexOf( item );
96
+ const normalized = normalize( alignment );
97
+ if ( ! normalized ) return undefined;
75
98
 
99
+ const index = ALIGNMENTS.indexOf( normalized );
76
100
  return index > -1 ? index : undefined;
77
101
  }