@wordpress/components 22.0.0 → 22.1.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 (356) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/build/angle-picker-control/index.js +3 -1
  3. package/build/angle-picker-control/index.js.map +1 -1
  4. package/build/autocomplete/index.js +7 -3
  5. package/build/autocomplete/index.js.map +1 -1
  6. package/build/border-box-control/border-box-control/component.js +1 -1
  7. package/build/border-box-control/border-box-control/component.js.map +1 -1
  8. package/build/border-box-control/border-box-control/hook.js +13 -1
  9. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  10. package/build/border-box-control/border-box-control-split-controls/hook.js +11 -1
  11. package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
  12. package/build/border-control/border-control/component.js +2 -2
  13. package/build/border-control/border-control/component.js.map +1 -1
  14. package/build/border-control/border-control/hook.js +11 -1
  15. package/build/border-control/border-control/hook.js.map +1 -1
  16. package/build/border-control/border-control-dropdown/component.js +1 -1
  17. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  18. package/build/border-control/border-control-dropdown/hook.js +10 -2
  19. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  20. package/build/color-palette/index.js +1 -1
  21. package/build/color-palette/index.js.map +1 -1
  22. package/build/color-picker/input-with-slider.js +17 -3
  23. package/build/color-picker/input-with-slider.js.map +1 -1
  24. package/build/custom-select-control/index.js +5 -2
  25. package/build/custom-select-control/index.js.map +1 -1
  26. package/build/dashicon/index.js +17 -2
  27. package/build/dashicon/index.js.map +1 -1
  28. package/build/draggable/index.js +58 -38
  29. package/build/draggable/index.js.map +1 -1
  30. package/build/draggable/types.js +6 -0
  31. package/build/draggable/types.js.map +1 -0
  32. package/build/flex/flex/hook.js +2 -3
  33. package/build/flex/flex/hook.js.map +1 -1
  34. package/build/focal-point-picker/focal-point.js +2 -12
  35. package/build/focal-point-picker/focal-point.js.map +1 -1
  36. package/build/focal-point-picker/styles/focal-point-style.js +11 -51
  37. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  38. package/build/font-size-picker/constants.js +41 -0
  39. package/build/font-size-picker/constants.js.map +1 -0
  40. package/build/font-size-picker/font-size-picker-select.js +97 -0
  41. package/build/font-size-picker/font-size-picker-select.js.map +1 -0
  42. package/build/font-size-picker/font-size-picker-toggle-group.js +50 -0
  43. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -0
  44. package/build/font-size-picker/index.js +39 -76
  45. package/build/font-size-picker/index.js.map +1 -1
  46. package/build/font-size-picker/utils.js +17 -89
  47. package/build/font-size-picker/utils.js.map +1 -1
  48. package/build/form-token-field/index.js +9 -6
  49. package/build/form-token-field/index.js.map +1 -1
  50. package/build/higher-order/navigate-regions/index.js +3 -0
  51. package/build/higher-order/navigate-regions/index.js.map +1 -1
  52. package/build/icon/index.js +3 -2
  53. package/build/icon/index.js.map +1 -1
  54. package/build/index.js +8 -0
  55. package/build/index.js.map +1 -1
  56. package/build/menu-group/index.js +17 -3
  57. package/build/menu-group/index.js.map +1 -1
  58. package/build/menu-group/types.js +6 -0
  59. package/build/menu-group/types.js.map +1 -0
  60. package/build/navigator/navigator-screen/component.js +9 -5
  61. package/build/navigator/navigator-screen/component.js.map +1 -1
  62. package/build/palette-edit/index.js +3 -1
  63. package/build/palette-edit/index.js.map +1 -1
  64. package/build/popover/index.js +8 -4
  65. package/build/popover/index.js.map +1 -1
  66. package/build/range-control/styles/range-control-styles.js +47 -57
  67. package/build/range-control/styles/range-control-styles.js.map +1 -1
  68. package/build/spinner/styles.js +4 -4
  69. package/build/spinner/styles.js.map +1 -1
  70. package/build/tab-panel/index.js +3 -4
  71. package/build/tab-panel/index.js.map +1 -1
  72. package/build/toggle-group-control/toggle-group-control/component.js +1 -0
  73. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  74. package/build/toggle-group-control/toggle-group-control/styles.js +11 -6
  75. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  76. package/build/tools-panel/styles.js +14 -14
  77. package/build/tools-panel/styles.js.map +1 -1
  78. package/build/tools-panel/tools-panel-item/hook.js +9 -5
  79. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  80. package/build/utils/colors-values.js +3 -2
  81. package/build/utils/colors-values.js.map +1 -1
  82. package/build/utils/input/base.js +2 -2
  83. package/build/utils/input/base.js.map +1 -1
  84. package/build/view/index.js.map +1 -1
  85. package/build-module/angle-picker-control/index.js +2 -1
  86. package/build-module/angle-picker-control/index.js.map +1 -1
  87. package/build-module/autocomplete/index.js +7 -3
  88. package/build-module/autocomplete/index.js.map +1 -1
  89. package/build-module/border-box-control/border-box-control/component.js +1 -1
  90. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  91. package/build-module/border-box-control/border-box-control/hook.js +13 -1
  92. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  93. package/build-module/border-box-control/border-box-control-split-controls/hook.js +11 -1
  94. package/build-module/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
  95. package/build-module/border-control/border-control/component.js +2 -2
  96. package/build-module/border-control/border-control/component.js.map +1 -1
  97. package/build-module/border-control/border-control/hook.js +11 -1
  98. package/build-module/border-control/border-control/hook.js.map +1 -1
  99. package/build-module/border-control/border-control-dropdown/component.js +1 -1
  100. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  101. package/build-module/border-control/border-control-dropdown/hook.js +10 -2
  102. package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
  103. package/build-module/color-palette/index.js +1 -1
  104. package/build-module/color-palette/index.js.map +1 -1
  105. package/build-module/color-picker/input-with-slider.js +17 -3
  106. package/build-module/color-picker/input-with-slider.js.map +1 -1
  107. package/build-module/custom-select-control/index.js +5 -2
  108. package/build-module/custom-select-control/index.js.map +1 -1
  109. package/build-module/dashicon/index.js +17 -2
  110. package/build-module/dashicon/index.js.map +1 -1
  111. package/build-module/draggable/index.js +59 -38
  112. package/build-module/draggable/index.js.map +1 -1
  113. package/build-module/draggable/types.js +2 -0
  114. package/build-module/draggable/types.js.map +1 -0
  115. package/build-module/flex/flex/hook.js +2 -3
  116. package/build-module/flex/flex/hook.js.map +1 -1
  117. package/build-module/focal-point-picker/focal-point.js +3 -13
  118. package/build-module/focal-point-picker/focal-point.js.map +1 -1
  119. package/build-module/focal-point-picker/styles/focal-point-style.js +6 -52
  120. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  121. package/build-module/font-size-picker/constants.js +31 -0
  122. package/build-module/font-size-picker/constants.js.map +1 -0
  123. package/build-module/font-size-picker/font-size-picker-select.js +83 -0
  124. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -0
  125. package/build-module/font-size-picker/font-size-picker-toggle-group.js +40 -0
  126. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -0
  127. package/build-module/font-size-picker/index.js +38 -76
  128. package/build-module/font-size-picker/index.js.map +1 -1
  129. package/build-module/font-size-picker/utils.js +15 -86
  130. package/build-module/font-size-picker/utils.js.map +1 -1
  131. package/build-module/form-token-field/index.js +9 -6
  132. package/build-module/form-token-field/index.js.map +1 -1
  133. package/build-module/higher-order/navigate-regions/index.js +3 -0
  134. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  135. package/build-module/icon/index.js +3 -2
  136. package/build-module/icon/index.js.map +1 -1
  137. package/build-module/index.js +1 -0
  138. package/build-module/index.js.map +1 -1
  139. package/build-module/menu-group/index.js +20 -2
  140. package/build-module/menu-group/index.js.map +1 -1
  141. package/build-module/menu-group/types.js +2 -0
  142. package/build-module/menu-group/types.js.map +1 -0
  143. package/build-module/navigator/navigator-screen/component.js +9 -5
  144. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  145. package/build-module/palette-edit/index.js +3 -1
  146. package/build-module/palette-edit/index.js.map +1 -1
  147. package/build-module/popover/index.js +8 -4
  148. package/build-module/popover/index.js.map +1 -1
  149. package/build-module/range-control/styles/range-control-styles.js +47 -57
  150. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  151. package/build-module/spinner/styles.js +4 -4
  152. package/build-module/spinner/styles.js.map +1 -1
  153. package/build-module/tab-panel/index.js +4 -5
  154. package/build-module/tab-panel/index.js.map +1 -1
  155. package/build-module/toggle-group-control/toggle-group-control/component.js +1 -0
  156. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  157. package/build-module/toggle-group-control/toggle-group-control/styles.js +12 -6
  158. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  159. package/build-module/tools-panel/styles.js +14 -14
  160. package/build-module/tools-panel/styles.js.map +1 -1
  161. package/build-module/tools-panel/tools-panel-item/hook.js +9 -5
  162. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  163. package/build-module/utils/colors-values.js +3 -2
  164. package/build-module/utils/colors-values.js.map +1 -1
  165. package/build-module/utils/input/base.js +2 -2
  166. package/build-module/utils/input/base.js.map +1 -1
  167. package/build-module/view/index.js.map +1 -1
  168. package/build-style/style-rtl.css +72 -44
  169. package/build-style/style.css +72 -44
  170. package/build-types/border-box-control/border-box-control/component.d.ts +4 -4
  171. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  172. package/build-types/border-box-control/border-box-control/hook.d.ts +6 -6
  173. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  174. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts +4 -2
  175. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  176. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +3 -3
  177. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +5 -5
  178. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  179. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts +3 -2
  180. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
  181. package/build-types/border-box-control/stories/index.d.ts +3 -3
  182. package/build-types/border-box-control/types.d.ts +5 -38
  183. package/build-types/border-box-control/types.d.ts.map +1 -1
  184. package/build-types/border-control/border-control/component.d.ts +4 -2
  185. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  186. package/build-types/border-control/border-control/hook.d.ts +5 -5
  187. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  188. package/build-types/border-control/border-control-dropdown/component.d.ts +3 -3
  189. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  190. package/build-types/border-control/border-control-dropdown/hook.d.ts +5 -5
  191. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  192. package/build-types/border-control/stories/index.d.ts +24 -12
  193. package/build-types/border-control/stories/index.d.ts.map +1 -1
  194. package/build-types/border-control/types.d.ts +10 -51
  195. package/build-types/border-control/types.d.ts.map +1 -1
  196. package/build-types/color-palette/index.d.ts +16 -2
  197. package/build-types/color-palette/index.d.ts.map +1 -1
  198. package/build-types/color-palette/stories/index.d.ts +31 -2
  199. package/build-types/color-palette/stories/index.d.ts.map +1 -1
  200. package/build-types/color-palette/types.d.ts +14 -10
  201. package/build-types/color-palette/types.d.ts.map +1 -1
  202. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  203. package/build-types/custom-select-control/index.d.ts.map +1 -1
  204. package/build-types/dashicon/index.d.ts +6 -1
  205. package/build-types/dashicon/index.d.ts.map +1 -1
  206. package/build-types/date-time/types.d.ts +0 -16
  207. package/build-types/date-time/types.d.ts.map +1 -1
  208. package/build-types/draggable/index.d.ts +42 -66
  209. package/build-types/draggable/index.d.ts.map +1 -1
  210. package/build-types/draggable/stories/index.d.ts +12 -0
  211. package/build-types/draggable/stories/index.d.ts.map +1 -0
  212. package/build-types/draggable/types.d.ts +58 -0
  213. package/build-types/draggable/types.d.ts.map +1 -0
  214. package/build-types/flex/flex/hook.d.ts.map +1 -1
  215. package/build-types/focal-point-picker/focal-point.d.ts.map +1 -1
  216. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  217. package/build-types/focal-point-picker/styles/focal-point-style.d.ts +1 -12
  218. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
  219. package/build-types/font-size-picker/constants.d.ts +15 -0
  220. package/build-types/font-size-picker/constants.d.ts.map +1 -0
  221. package/build-types/font-size-picker/font-size-picker-select.d.ts +5 -0
  222. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -0
  223. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts +5 -0
  224. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -0
  225. package/build-types/font-size-picker/index.d.ts.map +1 -1
  226. package/build-types/font-size-picker/types.d.ts +13 -13
  227. package/build-types/font-size-picker/types.d.ts.map +1 -1
  228. package/build-types/font-size-picker/utils.d.ts +6 -18
  229. package/build-types/font-size-picker/utils.d.ts.map +1 -1
  230. package/build-types/form-token-field/index.d.ts.map +1 -1
  231. package/build-types/icon/index.d.ts +1 -1
  232. package/build-types/icon/index.d.ts.map +1 -1
  233. package/build-types/menu-group/index.d.ts +21 -1
  234. package/build-types/menu-group/index.d.ts.map +1 -1
  235. package/build-types/menu-group/test/index.d.ts +2 -0
  236. package/build-types/menu-group/test/index.d.ts.map +1 -0
  237. package/build-types/menu-group/types.d.ts +23 -0
  238. package/build-types/menu-group/types.d.ts.map +1 -0
  239. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  240. package/build-types/popover/index.d.ts.map +1 -1
  241. package/build-types/tab-panel/index.d.ts.map +1 -1
  242. package/build-types/toggle-group-control/stories/index.d.ts.map +1 -1
  243. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -2
  244. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  245. package/build-types/toggle-group-control/types.d.ts +2 -1
  246. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  247. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  248. package/build-types/unit-control/index.d.ts +1 -1
  249. package/build-types/utils/colors-values.d.ts +1 -0
  250. package/build-types/utils/colors-values.d.ts.map +1 -1
  251. package/build-types/view/index.d.ts +1 -1
  252. package/build-types/view/index.d.ts.map +1 -1
  253. package/package.json +17 -17
  254. package/src/angle-picker-control/index.js +2 -1
  255. package/src/autocomplete/index.js +12 -3
  256. package/src/autocomplete/style.scss +1 -1
  257. package/src/base-field/test/__snapshots__/index.js.snap +9 -7
  258. package/src/base-field/test/index.js +27 -15
  259. package/src/border-box-control/border-box-control/README.md +5 -17
  260. package/src/border-box-control/border-box-control/component.tsx +1 -1
  261. package/src/border-box-control/border-box-control/hook.ts +18 -4
  262. package/src/border-box-control/border-box-control-split-controls/hook.ts +10 -0
  263. package/src/border-box-control/types.ts +32 -58
  264. package/src/border-control/border-control/README.md +4 -17
  265. package/src/border-control/border-control/component.tsx +2 -2
  266. package/src/border-control/border-control/hook.ts +10 -0
  267. package/src/border-control/border-control-dropdown/component.tsx +7 -6
  268. package/src/border-control/border-control-dropdown/hook.ts +9 -1
  269. package/src/border-control/types.ts +43 -80
  270. package/src/card/test/__snapshots__/index.tsx.snap +64 -368
  271. package/src/card/test/index.tsx +2 -2
  272. package/src/checkbox-control/style.scss +3 -3
  273. package/src/color-palette/README.md +12 -16
  274. package/src/color-palette/index.tsx +1 -1
  275. package/src/color-palette/style.scss +1 -1
  276. package/src/color-palette/types.ts +14 -10
  277. package/src/color-picker/input-with-slider.tsx +13 -2
  278. package/src/custom-select-control/index.js +7 -0
  279. package/src/custom-select-control/stories/index.js +1 -0
  280. package/src/custom-select-control/style.scss +6 -1
  281. package/src/custom-select-control/test/index.js +39 -0
  282. package/src/dashicon/index.js +21 -2
  283. package/src/date-time/date/test/index.tsx +2 -2
  284. package/src/date-time/types.ts +0 -19
  285. package/src/divider/test/index.tsx +4 -4
  286. package/src/draggable/README.md +13 -18
  287. package/src/draggable/{index.js → index.tsx} +71 -47
  288. package/src/draggable/stories/index.tsx +83 -0
  289. package/src/draggable/types.ts +58 -0
  290. package/src/drop-zone/style.scss +1 -1
  291. package/src/flex/flex/hook.ts +0 -3
  292. package/src/flex/test/index.tsx +29 -3
  293. package/src/focal-point-picker/focal-point.tsx +2 -24
  294. package/src/focal-point-picker/styles/focal-point-style.ts +8 -32
  295. package/src/font-size-picker/constants.ts +37 -0
  296. package/src/font-size-picker/font-size-picker-select.tsx +98 -0
  297. package/src/font-size-picker/font-size-picker-toggle-group.tsx +41 -0
  298. package/src/font-size-picker/index.tsx +55 -118
  299. package/src/font-size-picker/test/index.tsx +253 -44
  300. package/src/font-size-picker/test/utils.ts +58 -98
  301. package/src/font-size-picker/types.ts +25 -16
  302. package/src/font-size-picker/utils.ts +16 -102
  303. package/src/form-toggle/style.scss +3 -3
  304. package/src/form-token-field/index.tsx +13 -5
  305. package/src/form-token-field/style.scss +2 -2
  306. package/src/form-token-field/test/index.tsx +6 -6
  307. package/src/higher-order/navigate-regions/index.js +4 -0
  308. package/src/higher-order/navigate-regions/style.scss +72 -20
  309. package/src/higher-order/with-notices/test/index.js +1 -1
  310. package/src/icon/index.tsx +3 -2
  311. package/src/icon/test/index.js +10 -0
  312. package/src/index.js +1 -0
  313. package/src/item-group/stories/index.js +1 -1
  314. package/src/menu-group/{index.js → index.tsx} +22 -3
  315. package/src/menu-group/test/{index.js → index.tsx} +0 -0
  316. package/src/menu-group/types.ts +23 -0
  317. package/src/menu-item/style.scss +1 -1
  318. package/src/mobile/bottom-sheet/test/range-cell.native.js +4 -4
  319. package/src/mobile/html-text-input/test/index.native.js +2 -2
  320. package/src/mobile/link-settings/test/edit.native.js +29 -29
  321. package/src/mobile/link-settings/test/link-settings-navigation.native.js +5 -5
  322. package/src/navigator/navigator-screen/component.tsx +8 -3
  323. package/src/notice/README.md +2 -1
  324. package/src/notice/style.scss +1 -1
  325. package/src/palette-edit/index.js +3 -0
  326. package/src/panel/style.scss +1 -1
  327. package/src/popover/index.tsx +18 -7
  328. package/src/range-control/styles/range-control-styles.ts +2 -2
  329. package/src/resizable-box/style.scss +2 -2
  330. package/src/scrollable/test/index.tsx +7 -3
  331. package/src/search-control/style.scss +1 -1
  332. package/src/snackbar/style.scss +2 -2
  333. package/src/spacer/test/index.tsx +33 -3
  334. package/src/spinner/styles.ts +1 -1
  335. package/src/surface/test/index.tsx +12 -12
  336. package/src/tab-panel/index.tsx +9 -6
  337. package/src/tab-panel/style.scss +4 -5
  338. package/src/text/test/index.tsx +4 -4
  339. package/src/toggle-group-control/stories/index.tsx +2 -0
  340. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -8
  341. package/src/toggle-group-control/test/index.tsx +29 -17
  342. package/src/toggle-group-control/toggle-group-control/README.md +8 -1
  343. package/src/toggle-group-control/toggle-group-control/component.tsx +1 -1
  344. package/src/toggle-group-control/toggle-group-control/styles.ts +22 -16
  345. package/src/toggle-group-control/types.ts +2 -1
  346. package/src/tools-panel/styles.ts +1 -1
  347. package/src/tools-panel/tools-panel-item/hook.ts +6 -1
  348. package/src/tree-grid/test/index.js +12 -12
  349. package/src/truncate/test/index.tsx +9 -9
  350. package/src/ui/form-group/test/index.js +16 -17
  351. package/src/utils/colors-values.js +4 -2
  352. package/src/utils/hooks/stories/use-cx.js +1 -1
  353. package/src/utils/input/base.js +2 -2
  354. package/src/view/{index.js → index.ts} +0 -0
  355. package/tsconfig.tsbuildinfo +1 -1
  356. package/src/draggable/stories/index.js +0 -72
@@ -209,9 +209,7 @@ Snapshot Diff:
209
209
  `;
210
210
 
211
211
  exports[`Card Card component should render correctly 1`] = `
212
- Object {
213
- "asFragment": [Function],
214
- "baseElement": .emotion-0 {
212
+ .emotion-0 {
215
213
  background-color: #fff;
216
214
  color: #1e1e1e;
217
215
  position: relative;
@@ -383,384 +381,82 @@ Object {
383
381
  }
384
382
  }
385
383
 
386
- <body>
387
- <div>
384
+ <div>
385
+ <div
386
+ class="components-surface components-card emotion-0 emotion-1"
387
+ data-wp-c16t="true"
388
+ data-wp-component="Card"
389
+ >
390
+ <div
391
+ class="emotion-2 emotion-1"
392
+ >
388
393
  <div
389
- class="components-surface components-card emotion-0 emotion-1"
394
+ class="components-flex components-card__header components-card-header emotion-4 emotion-1"
390
395
  data-wp-c16t="true"
391
- data-wp-component="Card"
396
+ data-wp-component="CardHeader"
392
397
  >
393
- <div
394
- class="emotion-2 emotion-1"
395
- >
396
- <div
397
- class="components-flex components-card__header components-card-header emotion-4 emotion-1"
398
- data-wp-c16t="true"
399
- data-wp-component="CardHeader"
400
- >
401
- Card Header
402
- </div>
403
- <div
404
- class="components-card__body components-card-body emotion-6 emotion-1"
405
- data-wp-c16t="true"
406
- data-wp-component="CardBody"
407
- >
408
- Card Body 1
409
- </div>
410
- <div
411
- class="components-card__body components-card-body emotion-6 emotion-1"
412
- data-wp-c16t="true"
413
- data-wp-component="CardBody"
414
- >
415
- Card Body 2
416
- </div>
417
- <hr
418
- aria-orientation="horizontal"
419
- class="components-divider components-card__divider components-card-divider emotion-10 emotion-11"
420
- data-wp-c16t="true"
421
- data-wp-component="CardDivider"
422
- role="separator"
423
- />
424
- <div
425
- class="components-card__body components-card-body emotion-6 emotion-1"
426
- data-wp-c16t="true"
427
- data-wp-component="CardBody"
428
- >
429
- Card Body 3
430
- </div>
431
- <div
432
- class="components-card__media components-card-media emotion-14 emotion-1"
433
- data-wp-c16t="true"
434
- data-wp-component="CardMedia"
435
- >
436
- <img
437
- alt="Card Media"
438
- src="https://images.unsplash.com/photo-1566125882500-87e10f726cdc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1867&q=80"
439
- />
440
- </div>
441
- <div
442
- class="components-flex components-card__footer components-card-footer emotion-16 emotion-1"
443
- data-wp-c16t="true"
444
- data-wp-component="CardFooter"
445
- >
446
- Card Footer
447
- </div>
448
- </div>
449
- <div
450
- aria-hidden="true"
451
- class="components-elevation emotion-18 emotion-1"
452
- data-wp-c16t="true"
453
- data-wp-component="Elevation"
454
- />
455
- <div
456
- aria-hidden="true"
457
- class="components-elevation emotion-18 emotion-1"
458
- data-wp-c16t="true"
459
- data-wp-component="Elevation"
460
- />
398
+ Card Header
461
399
  </div>
462
- </div>
463
- </body>,
464
- "container": .emotion-0 {
465
- background-color: #fff;
466
- color: #1e1e1e;
467
- position: relative;
468
- box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
469
- outline: none;
470
- border-radius: calc(2px - 1px);
471
- }
472
-
473
- .emotion-2 {
474
- height: 100%;
475
- }
476
-
477
- .emotion-4 {
478
- display: -webkit-box;
479
- display: -webkit-flex;
480
- display: -ms-flexbox;
481
- display: flex;
482
- -webkit-align-items: center;
483
- -webkit-box-align: center;
484
- -ms-flex-align: center;
485
- align-items: center;
486
- -webkit-flex-direction: row;
487
- -ms-flex-direction: row;
488
- flex-direction: row;
489
- gap: calc(4px * 2);
490
- -webkit-box-pack: justify;
491
- -webkit-justify-content: space-between;
492
- justify-content: space-between;
493
- width: 100%;
494
- border-bottom: 1px solid;
495
- box-sizing: border-box;
496
- border-color: rgba(0, 0, 0, 0.1);
497
- padding: calc(4px * 4) calc(4px * 6);
498
- }
499
-
500
- .emotion-4>* {
501
- min-width: 0;
502
- }
503
-
504
- .emotion-4:last-child {
505
- border-bottom: none;
506
- }
507
-
508
- .emotion-4:first-of-type {
509
- border-top-left-radius: calc(2px - 1px);
510
- border-top-right-radius: calc(2px - 1px);
511
- }
512
-
513
- .emotion-4:last-of-type {
514
- border-bottom-left-radius: calc(2px - 1px);
515
- border-bottom-right-radius: calc(2px - 1px);
516
- }
517
-
518
- .emotion-6 {
519
- box-sizing: border-box;
520
- height: auto;
521
- max-height: 100%;
522
- padding: calc(4px * 4) calc(4px * 6);
523
- }
524
-
525
- .emotion-6:first-of-type {
526
- border-top-left-radius: calc(2px - 1px);
527
- border-top-right-radius: calc(2px - 1px);
528
- }
529
-
530
- .emotion-6:last-of-type {
531
- border-bottom-left-radius: calc(2px - 1px);
532
- border-bottom-right-radius: calc(2px - 1px);
533
- }
534
-
535
- .emotion-10 {
536
- border: 0;
537
- margin: 0;
538
- border-bottom: 1px solid currentColor;
539
- height: 0;
540
- width: auto;
541
- box-sizing: border-box;
542
- display: block;
543
- width: 100%;
544
- border-color: rgba(0, 0, 0, 0.1);
545
- }
546
-
547
- .emotion-14 {
548
- box-sizing: border-box;
549
- overflow: hidden;
550
- }
551
-
552
- .emotion-14>img,
553
- .emotion-14>iframe {
554
- display: block;
555
- height: auto;
556
- max-width: 100%;
557
- width: 100%;
558
- }
559
-
560
- .emotion-14:first-of-type {
561
- border-top-left-radius: calc(2px - 1px);
562
- border-top-right-radius: calc(2px - 1px);
563
- }
564
-
565
- .emotion-14:last-of-type {
566
- border-bottom-left-radius: calc(2px - 1px);
567
- border-bottom-right-radius: calc(2px - 1px);
568
- }
569
-
570
- .emotion-16 {
571
- display: -webkit-box;
572
- display: -webkit-flex;
573
- display: -ms-flexbox;
574
- display: flex;
575
- -webkit-align-items: center;
576
- -webkit-box-align: center;
577
- -ms-flex-align: center;
578
- align-items: center;
579
- -webkit-flex-direction: row;
580
- -ms-flex-direction: row;
581
- flex-direction: row;
582
- gap: calc(4px * 2);
583
- -webkit-box-pack: justify;
584
- -webkit-justify-content: space-between;
585
- justify-content: space-between;
586
- width: 100%;
587
- border-top: 1px solid;
588
- box-sizing: border-box;
589
- border-color: rgba(0, 0, 0, 0.1);
590
- padding: calc(4px * 4) calc(4px * 6);
591
- }
592
-
593
- .emotion-16>* {
594
- min-width: 0;
595
- }
596
-
597
- .emotion-16:first-of-type {
598
- border-top: none;
599
- }
600
-
601
- .emotion-16:first-of-type {
602
- border-top-left-radius: calc(2px - 1px);
603
- border-top-right-radius: calc(2px - 1px);
604
- }
605
-
606
- .emotion-16:last-of-type {
607
- border-bottom-left-radius: calc(2px - 1px);
608
- border-bottom-right-radius: calc(2px - 1px);
609
- }
610
-
611
- .emotion-18 {
612
- background: transparent;
613
- display: block;
614
- margin: 0!important;
615
- pointer-events: none;
616
- position: absolute;
617
- will-change: box-shadow;
618
- border-radius: inherit;
619
- bottom: 0;
620
- box-shadow: 0 0px 0px 0 rgba(0, 0, 0, 0);
621
- opacity: 1;
622
- left: 0;
623
- right: 0;
624
- top: 0;
625
- -webkit-transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
626
- transition: box-shadow 200ms cubic-bezier(0.08, 0.52, 0.52, 1);
627
- border-radius: 2px;
628
- }
629
-
630
- @media ( prefers-reduced-motion: reduce ) {
631
- .emotion-18 {
632
- transition-duration: 0ms;
633
- }
634
- }
635
-
636
- <div>
637
- <div
638
- class="components-surface components-card emotion-0 emotion-1"
639
- data-wp-c16t="true"
640
- data-wp-component="Card"
641
- >
642
400
  <div
643
- class="emotion-2 emotion-1"
401
+ class="components-card__body components-card-body emotion-6 emotion-1"
402
+ data-wp-c16t="true"
403
+ data-wp-component="CardBody"
644
404
  >
645
- <div
646
- class="components-flex components-card__header components-card-header emotion-4 emotion-1"
647
- data-wp-c16t="true"
648
- data-wp-component="CardHeader"
649
- >
650
- Card Header
651
- </div>
652
- <div
653
- class="components-card__body components-card-body emotion-6 emotion-1"
654
- data-wp-c16t="true"
655
- data-wp-component="CardBody"
656
- >
657
- Card Body 1
658
- </div>
659
- <div
660
- class="components-card__body components-card-body emotion-6 emotion-1"
661
- data-wp-c16t="true"
662
- data-wp-component="CardBody"
663
- >
664
- Card Body 2
665
- </div>
666
- <hr
667
- aria-orientation="horizontal"
668
- class="components-divider components-card__divider components-card-divider emotion-10 emotion-11"
669
- data-wp-c16t="true"
670
- data-wp-component="CardDivider"
671
- role="separator"
672
- />
673
- <div
674
- class="components-card__body components-card-body emotion-6 emotion-1"
675
- data-wp-c16t="true"
676
- data-wp-component="CardBody"
677
- >
678
- Card Body 3
679
- </div>
680
- <div
681
- class="components-card__media components-card-media emotion-14 emotion-1"
682
- data-wp-c16t="true"
683
- data-wp-component="CardMedia"
684
- >
685
- <img
686
- alt="Card Media"
687
- src="https://images.unsplash.com/photo-1566125882500-87e10f726cdc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1867&q=80"
688
- />
689
- </div>
690
- <div
691
- class="components-flex components-card__footer components-card-footer emotion-16 emotion-1"
692
- data-wp-c16t="true"
693
- data-wp-component="CardFooter"
694
- >
695
- Card Footer
696
- </div>
405
+ Card Body 1
697
406
  </div>
698
407
  <div
699
- aria-hidden="true"
700
- class="components-elevation emotion-18 emotion-1"
408
+ class="components-card__body components-card-body emotion-6 emotion-1"
701
409
  data-wp-c16t="true"
702
- data-wp-component="Elevation"
410
+ data-wp-component="CardBody"
411
+ >
412
+ Card Body 2
413
+ </div>
414
+ <hr
415
+ aria-orientation="horizontal"
416
+ class="components-divider components-card__divider components-card-divider emotion-10 emotion-11"
417
+ data-wp-c16t="true"
418
+ data-wp-component="CardDivider"
419
+ role="separator"
703
420
  />
704
421
  <div
705
- aria-hidden="true"
706
- class="components-elevation emotion-18 emotion-1"
422
+ class="components-card__body components-card-body emotion-6 emotion-1"
707
423
  data-wp-c16t="true"
708
- data-wp-component="Elevation"
709
- />
424
+ data-wp-component="CardBody"
425
+ >
426
+ Card Body 3
427
+ </div>
428
+ <div
429
+ class="components-card__media components-card-media emotion-14 emotion-1"
430
+ data-wp-c16t="true"
431
+ data-wp-component="CardMedia"
432
+ >
433
+ <img
434
+ alt="Card Media"
435
+ src="https://images.unsplash.com/photo-1566125882500-87e10f726cdc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1867&q=80"
436
+ />
437
+ </div>
438
+ <div
439
+ class="components-flex components-card__footer components-card-footer emotion-16 emotion-1"
440
+ data-wp-c16t="true"
441
+ data-wp-component="CardFooter"
442
+ >
443
+ Card Footer
444
+ </div>
710
445
  </div>
711
- </div>,
712
- "debug": [Function],
713
- "findAllByAltText": [Function],
714
- "findAllByDisplayValue": [Function],
715
- "findAllByLabelText": [Function],
716
- "findAllByPlaceholderText": [Function],
717
- "findAllByRole": [Function],
718
- "findAllByTestId": [Function],
719
- "findAllByText": [Function],
720
- "findAllByTitle": [Function],
721
- "findByAltText": [Function],
722
- "findByDisplayValue": [Function],
723
- "findByLabelText": [Function],
724
- "findByPlaceholderText": [Function],
725
- "findByRole": [Function],
726
- "findByTestId": [Function],
727
- "findByText": [Function],
728
- "findByTitle": [Function],
729
- "getAllByAltText": [Function],
730
- "getAllByDisplayValue": [Function],
731
- "getAllByLabelText": [Function],
732
- "getAllByPlaceholderText": [Function],
733
- "getAllByRole": [Function],
734
- "getAllByTestId": [Function],
735
- "getAllByText": [Function],
736
- "getAllByTitle": [Function],
737
- "getByAltText": [Function],
738
- "getByDisplayValue": [Function],
739
- "getByLabelText": [Function],
740
- "getByPlaceholderText": [Function],
741
- "getByRole": [Function],
742
- "getByTestId": [Function],
743
- "getByText": [Function],
744
- "getByTitle": [Function],
745
- "queryAllByAltText": [Function],
746
- "queryAllByDisplayValue": [Function],
747
- "queryAllByLabelText": [Function],
748
- "queryAllByPlaceholderText": [Function],
749
- "queryAllByRole": [Function],
750
- "queryAllByTestId": [Function],
751
- "queryAllByText": [Function],
752
- "queryAllByTitle": [Function],
753
- "queryByAltText": [Function],
754
- "queryByDisplayValue": [Function],
755
- "queryByLabelText": [Function],
756
- "queryByPlaceholderText": [Function],
757
- "queryByRole": [Function],
758
- "queryByTestId": [Function],
759
- "queryByText": [Function],
760
- "queryByTitle": [Function],
761
- "rerender": [Function],
762
- "unmount": [Function],
763
- }
446
+ <div
447
+ aria-hidden="true"
448
+ class="components-elevation emotion-18 emotion-1"
449
+ data-wp-c16t="true"
450
+ data-wp-component="Elevation"
451
+ />
452
+ <div
453
+ aria-hidden="true"
454
+ class="components-elevation emotion-18 emotion-1"
455
+ data-wp-c16t="true"
456
+ data-wp-component="Elevation"
457
+ />
458
+ </div>
459
+ </div>
764
460
  `;
765
461
 
766
462
  exports[`Card Card component should show a box shadow when the elevation prop is greater than 0 1`] = `
@@ -18,7 +18,7 @@ import {
18
18
  describe( 'Card', () => {
19
19
  describe( 'Card component', () => {
20
20
  it( 'should render correctly', () => {
21
- const wrapper = render(
21
+ const { container } = render(
22
22
  <Card>
23
23
  <CardHeader>Card Header</CardHeader>
24
24
  <CardBody>Card Body 1</CardBody>
@@ -34,7 +34,7 @@ describe( 'Card', () => {
34
34
  <CardFooter>Card Footer</CardFooter>
35
35
  </Card>
36
36
  );
37
- expect( wrapper ).toMatchSnapshot();
37
+ expect( container ).toMatchSnapshot();
38
38
  } );
39
39
 
40
40
  it( 'should remove borders when the isBorderless prop is true', () => {
@@ -27,7 +27,7 @@ $checkbox-input-size-sm: 24px; // Width & height for small viewports.
27
27
  @include reduce-motion("transition");
28
28
 
29
29
  &:focus {
30
- box-shadow: 0 0 0 ($border-width * 2) $white, 0 0 0 ($border-width * 2 + $border-width-focus) var(--wp-admin-theme-color);
30
+ box-shadow: 0 0 0 ($border-width * 2) $white, 0 0 0 ($border-width * 2 + $border-width-focus) $components-color-accent;
31
31
 
32
32
  // Only visible in Windows High Contrast mode.
33
33
  outline: 2px solid transparent;
@@ -35,8 +35,8 @@ $checkbox-input-size-sm: 24px; // Width & height for small viewports.
35
35
 
36
36
  &:checked,
37
37
  &:indeterminate {
38
- background: var(--wp-admin-theme-color);
39
- border-color: var(--wp-admin-theme-color);
38
+ background: $components-color-accent;
39
+ border-color: $components-color-accent;
40
40
 
41
41
  // Hide default checkbox styles in IE.
42
42
  &::-ms-check {
@@ -36,6 +36,13 @@ for the `ColorPalette`'s color swatches, by rendering your `ColorPalette` with a
36
36
 
37
37
  The component accepts the following props.
38
38
 
39
+ ### `clearable`: `boolean`
40
+
41
+ Whether the palette should have a clearing button.
42
+
43
+ - Required: No
44
+ - Default: `true`
45
+
39
46
  ### `colors`: `( PaletteObject | ColorObject )[]`
40
47
 
41
48
  Array with the colors to be shown. When displaying multiple color palettes to choose from, the format of the array changes from an array of colors objects, to an array of color palettes.
@@ -45,21 +52,23 @@ Array with the colors to be shown. When displaying multiple color palettes to ch
45
52
 
46
53
  ### `disableCustomColors`: `boolean`
47
54
 
48
- Whether to allow the user to pick a custom color on top of the predefined choices (defined via the `colors` prop).
55
+ Whether to allow the user to pick a custom color on top of the predefined
56
+ choices (defined via the `colors` prop).
49
57
 
50
58
  - Required: No
51
59
  - Default: `false`
52
60
 
53
61
  ### `enableAlpha`: `boolean`
54
62
 
55
- Whether the color picker should display the alpha channel both in the bottom inputs as well as in the color picker itself.
63
+ This controls whether the alpha channel will be offered when selecting custom
64
+ colors.
56
65
 
57
66
  - Required: No
58
67
  - Default: `false`
59
68
 
60
69
  ### `value`: `string`
61
70
 
62
- currently active value
71
+ Currently active value.
63
72
 
64
73
  - Required: No
65
74
 
@@ -68,16 +77,3 @@ currently active value
68
77
  Callback called when a color is selected.
69
78
 
70
79
  - Required: Yes
71
-
72
- ### `className`: `string`
73
-
74
- classes to be applied to the container.
75
-
76
- - Required: No
77
-
78
- ### `clearable`: `boolean`
79
-
80
- Whether the palette should have a clearing button.
81
-
82
- - Required: No
83
- - Default: `true`
@@ -223,7 +223,7 @@ function UnforwardedColorPalette(
223
223
  clearable = true,
224
224
  colors = [],
225
225
  disableCustomColors = false,
226
- enableAlpha,
226
+ enableAlpha = false,
227
227
  onChange,
228
228
  value,
229
229
  __experimentalHasMultipleOrigins = false,
@@ -25,7 +25,7 @@
25
25
  outline: 1px solid transparent;
26
26
 
27
27
  &:focus {
28
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
28
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $components-color-accent;
29
29
  // Show a outline in Windows high contrast mode.
30
30
  outline-width: 2px;
31
31
  }
@@ -3,7 +3,10 @@
3
3
  */
4
4
  import type { CSSProperties, MouseEventHandler, ReactNode } from 'react';
5
5
 
6
- type OnColorChange = ( newColor?: string ) => void;
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import type { PopoverProps } from '../popover/types';
7
10
 
8
11
  export type ColorObject = {
9
12
  name: string;
@@ -18,7 +21,10 @@ export type PaletteObject = {
18
21
  type PaletteProps = {
19
22
  className?: string;
20
23
  clearColor: () => void;
21
- onChange: OnColorChange;
24
+ /**
25
+ * Callback called when a color is selected.
26
+ */
27
+ onChange: ( newColor?: string ) => void;
22
28
  value?: string;
23
29
  actions?: ReactNode;
24
30
  };
@@ -35,14 +41,14 @@ export type MultiplePalettesProps = PaletteProps & {
35
41
  export type CustomColorPickerDropdownProps = {
36
42
  isRenderedInSidebar: boolean;
37
43
  renderContent: () => ReactNode;
38
- popoverProps?: string[];
44
+ popoverProps?: Omit< PopoverProps, 'children' >;
39
45
  renderToggle: ( props: {
40
46
  isOpen: boolean;
41
47
  onToggle: MouseEventHandler< HTMLButtonElement >;
42
48
  } ) => ReactNode;
43
49
  };
44
50
 
45
- export type ColorPaletteProps = {
51
+ export type ColorPaletteProps = Pick< PaletteProps, 'onChange' > & {
46
52
  /**
47
53
  * Whether the palette should have a clearing button.
48
54
  *
@@ -65,14 +71,12 @@ export type ColorPaletteProps = {
65
71
  */
66
72
  disableCustomColors?: boolean;
67
73
  /**
68
- * Whether the color picker should display the alpha channel
69
- * both in the bottom inputs as well as in the color picker itself.
74
+ * This controls whether the alpha channel will be offered when selecting
75
+ * custom colors.
76
+ *
77
+ * @default false
70
78
  */
71
79
  enableAlpha?: boolean;
72
- /**
73
- * Callback called when a color is selected.
74
- */
75
- onChange: OnColorChange;
76
80
  /**
77
81
  * Currently active value.
78
82
  */
@@ -25,6 +25,18 @@ export const InputWithSlider = ( {
25
25
  onChange,
26
26
  value,
27
27
  }: InputWithSliderProps ) => {
28
+ const onNumberControlChange = ( newValue?: number | string ) => {
29
+ if ( ! newValue ) {
30
+ onChange( 0 );
31
+ return;
32
+ }
33
+ if ( typeof newValue === 'string' ) {
34
+ onChange( parseInt( newValue, 10 ) );
35
+ return;
36
+ }
37
+ onChange( newValue );
38
+ };
39
+
28
40
  return (
29
41
  <HStack spacing={ 4 }>
30
42
  <NumberControlWrapper
@@ -33,8 +45,7 @@ export const InputWithSlider = ( {
33
45
  label={ label }
34
46
  hideLabelFromVision
35
47
  value={ value }
36
- // @ts-expect-error TODO: Resolve discrepancy in NumberControl
37
- onChange={ onChange }
48
+ onChange={ onNumberControlChange }
38
49
  prefix={
39
50
  <Spacer
40
51
  as={ Text }
@@ -79,6 +79,7 @@ export default function CustomSelectControl( props ) {
79
79
  value: _selectedItem,
80
80
  onMouseOver,
81
81
  onMouseOut,
82
+ __experimentalShowSelectedHint = false,
82
83
  } = props;
83
84
 
84
85
  const {
@@ -194,6 +195,12 @@ export default function CustomSelectControl( props ) {
194
195
  } ) }
195
196
  >
196
197
  { itemToString( selectedItem ) }
198
+ { __experimentalShowSelectedHint &&
199
+ selectedItem.__experimentalHint && (
200
+ <span className="components-custom-select-control__hint">
201
+ { selectedItem.__experimentalHint }
202
+ </span>
203
+ ) }
197
204
  </SelectControlSelect>
198
205
  </InputBaseWithBackCompatMinWidth>
199
206
  { /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }
@@ -8,6 +8,7 @@ export default {
8
8
  component: CustomSelectControl,
9
9
  argTypes: {
10
10
  __next36pxDefaultSize: { control: { type: 'boolean' } },
11
+ __experimentalShowSelectedHint: { control: { type: 'boolean' } },
11
12
  size: {
12
13
  control: {
13
14
  type: 'radio',