@wordpress/components 19.17.0 → 20.0.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 (773) hide show
  1. package/CHANGELOG.md +75 -1
  2. package/CONTRIBUTING.md +10 -10
  3. package/build/alignment-matrix-control/index.js +1 -1
  4. package/build/alignment-matrix-control/index.js.map +1 -1
  5. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  6. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  7. package/build/angle-picker-control/index.js +3 -0
  8. package/build/angle-picker-control/index.js.map +1 -1
  9. package/build/angle-picker-control/styles/angle-picker-control-styles.js +14 -4
  10. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  11. package/build/autocomplete/index.js +9 -11
  12. package/build/autocomplete/index.js.map +1 -1
  13. package/build/base-control/styles/base-control-styles.js +8 -8
  14. package/build/base-control/styles/base-control-styles.js.map +1 -1
  15. package/build/base-field/styles.js +5 -5
  16. package/build/base-field/styles.js.map +1 -1
  17. package/build/box-control/styles/box-control-visualizer-styles.js +8 -8
  18. package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  19. package/build/card/card/component.js +6 -11
  20. package/build/card/card/component.js.map +1 -1
  21. package/build/card/card/hook.js +0 -10
  22. package/build/card/card/hook.js.map +1 -1
  23. package/build/card/card/index.js.map +1 -1
  24. package/build/card/card-body/component.js +7 -8
  25. package/build/card/card-body/component.js.map +1 -1
  26. package/build/card/card-body/hook.js +0 -4
  27. package/build/card/card-body/hook.js.map +1 -1
  28. package/build/card/card-body/index.js.map +1 -1
  29. package/build/card/card-divider/component.js +7 -8
  30. package/build/card/card-divider/component.js.map +1 -1
  31. package/build/card/card-divider/hook.js +0 -4
  32. package/build/card/card-divider/hook.js.map +1 -1
  33. package/build/card/card-divider/index.js.map +1 -1
  34. package/build/card/card-footer/component.js +7 -8
  35. package/build/card/card-footer/component.js.map +1 -1
  36. package/build/card/card-footer/hook.js +0 -4
  37. package/build/card/card-footer/hook.js.map +1 -1
  38. package/build/card/card-footer/index.js.map +1 -1
  39. package/build/card/card-header/component.js +7 -8
  40. package/build/card/card-header/component.js.map +1 -1
  41. package/build/card/card-header/hook.js +0 -4
  42. package/build/card/card-header/hook.js.map +1 -1
  43. package/build/card/card-header/index.js.map +1 -1
  44. package/build/card/card-media/component.js +7 -7
  45. package/build/card/card-media/component.js.map +1 -1
  46. package/build/card/card-media/hook.js +0 -4
  47. package/build/card/card-media/hook.js.map +1 -1
  48. package/build/card/card-media/index.js.map +1 -1
  49. package/build/card/context.js.map +1 -1
  50. package/build/card/index.js.map +1 -1
  51. package/build/card/styles.js +17 -17
  52. package/build/card/styles.js.map +1 -1
  53. package/build/color-list-picker/index.js +16 -5
  54. package/build/color-list-picker/index.js.map +1 -1
  55. package/build/color-palette/index.js +22 -12
  56. package/build/color-palette/index.js.map +1 -1
  57. package/build/color-palette/index.native.js +3 -3
  58. package/build/color-palette/index.native.js.map +1 -1
  59. package/build/combobox-control/index.js +7 -4
  60. package/build/combobox-control/index.js.map +1 -1
  61. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  62. package/build/custom-gradient-picker/gradient-bar/constants.js.map +1 -0
  63. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +34 -41
  64. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -0
  65. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -1
  66. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -0
  67. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  68. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -0
  69. package/build/custom-gradient-picker/index.js +19 -4
  70. package/build/custom-gradient-picker/index.js.map +1 -1
  71. package/build/custom-select-control/index.js +21 -11
  72. package/build/custom-select-control/index.js.map +1 -1
  73. package/build/custom-select-control/styles.js +34 -0
  74. package/build/custom-select-control/styles.js.map +1 -0
  75. package/build/date-time/constants.js +9 -0
  76. package/build/date-time/constants.js.map +1 -0
  77. package/build/date-time/date/index.js +175 -186
  78. package/build/date-time/date/index.js.map +1 -1
  79. package/build/date-time/date/styles.js +59 -40
  80. package/build/date-time/date/styles.js.map +1 -1
  81. package/build/date-time/date-time/index.js +5 -2
  82. package/build/date-time/date-time/index.js.map +1 -1
  83. package/build/date-time/time/index.js +22 -17
  84. package/build/date-time/time/index.js.map +1 -1
  85. package/build/date-time/utils.js +27 -0
  86. package/build/date-time/utils.js.map +1 -0
  87. package/build/dimension-control/index.js +2 -6
  88. package/build/dimension-control/index.js.map +1 -1
  89. package/build/disabled/index.js +28 -11
  90. package/build/disabled/index.js.map +1 -1
  91. package/build/disabled/styles/disabled-styles.js +3 -3
  92. package/build/disabled/styles/disabled-styles.js.map +1 -1
  93. package/build/{swatch → disabled}/types.js +0 -0
  94. package/build/{swatch → disabled}/types.js.map +0 -0
  95. package/build/drop-zone/index.js +2 -4
  96. package/build/drop-zone/index.js.map +1 -1
  97. package/build/dropdown/index.js +5 -6
  98. package/build/dropdown/index.js.map +1 -1
  99. package/build/duotone-picker/custom-duotone-bar.js +2 -2
  100. package/build/duotone-picker/custom-duotone-bar.js.map +1 -1
  101. package/build/duotone-picker/duotone-picker.js +9 -1
  102. package/build/duotone-picker/duotone-picker.js.map +1 -1
  103. package/build/duotone-picker/duotone-swatch.js +13 -3
  104. package/build/duotone-picker/duotone-swatch.js.map +1 -1
  105. package/build/focal-point-picker/index.js +4 -6
  106. package/build/focal-point-picker/index.js.map +1 -1
  107. package/build/focal-point-picker/styles/focal-point-style.js +4 -4
  108. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  109. package/build/font-size-picker/index.js +43 -14
  110. package/build/font-size-picker/index.js.map +1 -1
  111. package/build/font-size-picker/utils.js +32 -22
  112. package/build/font-size-picker/utils.js.map +1 -1
  113. package/build/form-token-field/index.js +29 -20
  114. package/build/form-token-field/index.js.map +1 -1
  115. package/build/gradient-picker/index.js +15 -3
  116. package/build/gradient-picker/index.js.map +1 -1
  117. package/build/guide/index.js +5 -3
  118. package/build/guide/index.js.map +1 -1
  119. package/build/guide/page-control.js +3 -7
  120. package/build/guide/page-control.js.map +1 -1
  121. package/build/item-group/styles.js +10 -10
  122. package/build/item-group/styles.js.map +1 -1
  123. package/build/mobile/bottom-sheet/index.native.js +3 -6
  124. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  125. package/build/mobile/global-styles-context/utils.native.js +3 -1
  126. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  127. package/build/mobile/image/index.native.js +6 -26
  128. package/build/mobile/image/index.native.js.map +1 -1
  129. package/build/mobile/picker/index.android.js +3 -3
  130. package/build/mobile/picker/index.android.js.map +1 -1
  131. package/build/modal/index.js +1 -3
  132. package/build/modal/index.js.map +1 -1
  133. package/build/navigable-container/container.js +9 -8
  134. package/build/navigable-container/container.js.map +1 -1
  135. package/build/navigable-container/menu.js +3 -9
  136. package/build/navigable-container/menu.js.map +1 -1
  137. package/build/navigator/navigator-back-button/hook.js +0 -4
  138. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  139. package/build/navigator/navigator-button/hook.js +0 -4
  140. package/build/navigator/navigator-button/hook.js.map +1 -1
  141. package/build/notice/list.js +10 -6
  142. package/build/notice/list.js.map +1 -1
  143. package/build/palette-edit/index.js +1 -0
  144. package/build/palette-edit/index.js.map +1 -1
  145. package/build/palette-edit/styles.js +10 -10
  146. package/build/palette-edit/styles.js.map +1 -1
  147. package/build/popover/index.js +100 -97
  148. package/build/popover/index.js.map +1 -1
  149. package/build/popover/utils.js +178 -0
  150. package/build/popover/utils.js.map +1 -0
  151. package/build/range-control/index.js +3 -0
  152. package/build/range-control/index.js.map +1 -1
  153. package/build/range-control/styles/range-control-styles.js +43 -37
  154. package/build/range-control/styles/range-control-styles.js.map +1 -1
  155. package/build/select-control/chevron-down.js +30 -0
  156. package/build/select-control/chevron-down.js.map +1 -0
  157. package/build/select-control/index.js +7 -7
  158. package/build/select-control/index.js.map +1 -1
  159. package/build/select-control/styles/select-control-styles.js +30 -15
  160. package/build/select-control/styles/select-control-styles.js.map +1 -1
  161. package/build/snackbar/list.js +5 -3
  162. package/build/snackbar/list.js.map +1 -1
  163. package/build/spinner/index.js +2 -0
  164. package/build/spinner/index.js.map +1 -1
  165. package/build/text/styles.js +7 -7
  166. package/build/text/styles.js.map +1 -1
  167. package/build/toggle-group-control/toggle-group-control/component.js +16 -8
  168. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  169. package/build/toggle-group-control/toggle-group-control/styles.js +7 -5
  170. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  171. package/build/toggle-group-control/toggle-group-control-option/component.js +15 -5
  172. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  173. package/build/toggle-group-control/toggle-group-control-option-base/component.js +5 -1
  174. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  175. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +20 -7
  176. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  177. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +26 -7
  178. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  179. package/build/tools-panel/styles.js +11 -11
  180. package/build/tools-panel/styles.js.map +1 -1
  181. package/build/tooltip/index.js +1 -7
  182. package/build/tooltip/index.js.map +1 -1
  183. package/build/tree-grid/index.js +4 -10
  184. package/build/tree-grid/index.js.map +1 -1
  185. package/build/ui/context/context-connect.js +1 -3
  186. package/build/ui/context/context-connect.js.map +1 -1
  187. package/build/unit-control/index.js +2 -3
  188. package/build/unit-control/index.js.map +1 -1
  189. package/build/utils/colors-values.js +52 -142
  190. package/build/utils/colors-values.js.map +1 -1
  191. package/build/utils/config-values.js +1 -1
  192. package/build/utils/config-values.js.map +1 -1
  193. package/build/utils/input/input-control.js +1 -1
  194. package/build/utils/input/input-control.js.map +1 -1
  195. package/build/utils/rtl.js +6 -5
  196. package/build/utils/rtl.js.map +1 -1
  197. package/build/utils/strings.js +50 -0
  198. package/build/utils/strings.js.map +1 -0
  199. package/build-module/alignment-matrix-control/index.js +1 -1
  200. package/build-module/alignment-matrix-control/index.js.map +1 -1
  201. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  202. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  203. package/build-module/angle-picker-control/index.js +3 -0
  204. package/build-module/angle-picker-control/index.js.map +1 -1
  205. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +13 -4
  206. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  207. package/build-module/autocomplete/index.js +9 -10
  208. package/build-module/autocomplete/index.js.map +1 -1
  209. package/build-module/base-control/styles/base-control-styles.js +8 -8
  210. package/build-module/base-control/styles/base-control-styles.js.map +1 -1
  211. package/build-module/base-field/styles.js +5 -5
  212. package/build-module/base-field/styles.js.map +1 -1
  213. package/build-module/box-control/styles/box-control-visualizer-styles.js +8 -8
  214. package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  215. package/build-module/card/card/component.js +5 -10
  216. package/build-module/card/card/component.js.map +1 -1
  217. package/build-module/card/card/hook.js +0 -9
  218. package/build-module/card/card/hook.js.map +1 -1
  219. package/build-module/card/card/index.js.map +1 -1
  220. package/build-module/card/card-body/component.js +7 -8
  221. package/build-module/card/card-body/component.js.map +1 -1
  222. package/build-module/card/card-body/hook.js +0 -4
  223. package/build-module/card/card-body/hook.js.map +1 -1
  224. package/build-module/card/card-body/index.js.map +1 -1
  225. package/build-module/card/card-divider/component.js +7 -8
  226. package/build-module/card/card-divider/component.js.map +1 -1
  227. package/build-module/card/card-divider/hook.js +0 -4
  228. package/build-module/card/card-divider/hook.js.map +1 -1
  229. package/build-module/card/card-divider/index.js.map +1 -1
  230. package/build-module/card/card-footer/component.js +7 -8
  231. package/build-module/card/card-footer/component.js.map +1 -1
  232. package/build-module/card/card-footer/hook.js +0 -4
  233. package/build-module/card/card-footer/hook.js.map +1 -1
  234. package/build-module/card/card-footer/index.js.map +1 -1
  235. package/build-module/card/card-header/component.js +7 -8
  236. package/build-module/card/card-header/component.js.map +1 -1
  237. package/build-module/card/card-header/hook.js +0 -4
  238. package/build-module/card/card-header/hook.js.map +1 -1
  239. package/build-module/card/card-header/index.js.map +1 -1
  240. package/build-module/card/card-media/component.js +7 -7
  241. package/build-module/card/card-media/component.js.map +1 -1
  242. package/build-module/card/card-media/hook.js +0 -4
  243. package/build-module/card/card-media/hook.js.map +1 -1
  244. package/build-module/card/card-media/index.js.map +1 -1
  245. package/build-module/card/context.js.map +1 -1
  246. package/build-module/card/index.js.map +1 -1
  247. package/build-module/card/styles.js +17 -17
  248. package/build-module/card/styles.js.map +1 -1
  249. package/build-module/color-list-picker/index.js +13 -5
  250. package/build-module/color-list-picker/index.js.map +1 -1
  251. package/build-module/color-palette/index.js +22 -11
  252. package/build-module/color-palette/index.js.map +1 -1
  253. package/build-module/color-palette/index.native.js +4 -4
  254. package/build-module/color-palette/index.native.js.map +1 -1
  255. package/build-module/combobox-control/index.js +6 -3
  256. package/build-module/combobox-control/index.js.map +1 -1
  257. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  258. package/build-module/custom-gradient-picker/gradient-bar/constants.js.map +1 -0
  259. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +34 -41
  260. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -0
  261. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -1
  262. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -0
  263. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  264. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -0
  265. package/build-module/custom-gradient-picker/index.js +16 -3
  266. package/build-module/custom-gradient-picker/index.js.map +1 -1
  267. package/build-module/custom-select-control/index.js +20 -12
  268. package/build-module/custom-select-control/index.js.map +1 -1
  269. package/build-module/custom-select-control/styles.js +22 -0
  270. package/build-module/custom-select-control/styles.js.map +1 -0
  271. package/build-module/date-time/constants.js +2 -0
  272. package/build-module/date-time/constants.js.map +1 -0
  273. package/build-module/date-time/date/index.js +178 -184
  274. package/build-module/date-time/date/index.js.map +1 -1
  275. package/build-module/date-time/date/styles.js +47 -38
  276. package/build-module/date-time/date/styles.js.map +1 -1
  277. package/build-module/date-time/date-time/index.js +4 -2
  278. package/build-module/date-time/date-time/index.js.map +1 -1
  279. package/build-module/date-time/time/index.js +20 -16
  280. package/build-module/date-time/time/index.js.map +1 -1
  281. package/build-module/date-time/utils.js +19 -0
  282. package/build-module/date-time/utils.js.map +1 -0
  283. package/build-module/dimension-control/index.js +1 -5
  284. package/build-module/dimension-control/index.js.map +1 -1
  285. package/build-module/disabled/index.js +28 -11
  286. package/build-module/disabled/index.js.map +1 -1
  287. package/build-module/disabled/styles/disabled-styles.js +3 -3
  288. package/build-module/disabled/styles/disabled-styles.js.map +1 -1
  289. package/build-module/{swatch → disabled}/types.js +0 -0
  290. package/build-module/{swatch → disabled}/types.js.map +0 -0
  291. package/build-module/drop-zone/index.js +2 -3
  292. package/build-module/drop-zone/index.js.map +1 -1
  293. package/build-module/dropdown/index.js +5 -6
  294. package/build-module/dropdown/index.js.map +1 -1
  295. package/build-module/duotone-picker/custom-duotone-bar.js +1 -1
  296. package/build-module/duotone-picker/custom-duotone-bar.js.map +1 -1
  297. package/build-module/duotone-picker/duotone-picker.js +7 -1
  298. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  299. package/build-module/duotone-picker/duotone-swatch.js +11 -3
  300. package/build-module/duotone-picker/duotone-swatch.js.map +1 -1
  301. package/build-module/focal-point-picker/index.js +4 -5
  302. package/build-module/focal-point-picker/index.js.map +1 -1
  303. package/build-module/focal-point-picker/styles/focal-point-style.js +4 -4
  304. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  305. package/build-module/font-size-picker/index.js +39 -14
  306. package/build-module/font-size-picker/index.js.map +1 -1
  307. package/build-module/font-size-picker/utils.js +31 -23
  308. package/build-module/font-size-picker/utils.js.map +1 -1
  309. package/build-module/form-token-field/index.js +30 -20
  310. package/build-module/form-token-field/index.js.map +1 -1
  311. package/build-module/gradient-picker/index.js +14 -3
  312. package/build-module/gradient-picker/index.js.map +1 -1
  313. package/build-module/guide/index.js +5 -3
  314. package/build-module/guide/index.js.map +1 -1
  315. package/build-module/guide/page-control.js +3 -6
  316. package/build-module/guide/page-control.js.map +1 -1
  317. package/build-module/item-group/styles.js +10 -10
  318. package/build-module/item-group/styles.js.map +1 -1
  319. package/build-module/mobile/bottom-sheet/index.native.js +3 -5
  320. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  321. package/build-module/mobile/global-styles-context/utils.native.js +2 -1
  322. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  323. package/build-module/mobile/image/index.native.js +8 -28
  324. package/build-module/mobile/image/index.native.js.map +1 -1
  325. package/build-module/mobile/picker/index.android.js +3 -3
  326. package/build-module/mobile/picker/index.android.js.map +1 -1
  327. package/build-module/modal/index.js +1 -2
  328. package/build-module/modal/index.js.map +1 -1
  329. package/build-module/navigable-container/container.js +9 -7
  330. package/build-module/navigable-container/container.js.map +1 -1
  331. package/build-module/navigable-container/menu.js +3 -8
  332. package/build-module/navigable-container/menu.js.map +1 -1
  333. package/build-module/navigator/navigator-back-button/hook.js +0 -4
  334. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  335. package/build-module/navigator/navigator-button/hook.js +0 -4
  336. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  337. package/build-module/notice/list.js +10 -5
  338. package/build-module/notice/list.js.map +1 -1
  339. package/build-module/palette-edit/index.js +1 -0
  340. package/build-module/palette-edit/index.js.map +1 -1
  341. package/build-module/palette-edit/styles.js +10 -10
  342. package/build-module/palette-edit/styles.js.map +1 -1
  343. package/build-module/popover/index.js +100 -98
  344. package/build-module/popover/index.js.map +1 -1
  345. package/build-module/popover/utils.js +164 -0
  346. package/build-module/popover/utils.js.map +1 -0
  347. package/build-module/range-control/index.js +3 -0
  348. package/build-module/range-control/index.js.map +1 -1
  349. package/build-module/range-control/styles/range-control-styles.js +43 -37
  350. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  351. package/build-module/select-control/chevron-down.js +21 -0
  352. package/build-module/select-control/chevron-down.js.map +1 -0
  353. package/build-module/select-control/index.js +7 -7
  354. package/build-module/select-control/index.js.map +1 -1
  355. package/build-module/select-control/styles/select-control-styles.js +24 -13
  356. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  357. package/build-module/snackbar/list.js +5 -2
  358. package/build-module/snackbar/list.js.map +1 -1
  359. package/build-module/spinner/index.js +2 -0
  360. package/build-module/spinner/index.js.map +1 -1
  361. package/build-module/text/styles.js +7 -7
  362. package/build-module/text/styles.js.map +1 -1
  363. package/build-module/toggle-group-control/toggle-group-control/component.js +14 -7
  364. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  365. package/build-module/toggle-group-control/toggle-group-control/styles.js +5 -4
  366. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  367. package/build-module/toggle-group-control/toggle-group-control-option/component.js +17 -3
  368. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  369. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +5 -1
  370. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  371. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +16 -6
  372. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  373. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +27 -5
  374. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  375. package/build-module/tools-panel/styles.js +11 -11
  376. package/build-module/tools-panel/styles.js.map +1 -1
  377. package/build-module/tooltip/index.js +1 -6
  378. package/build-module/tooltip/index.js.map +1 -1
  379. package/build-module/tree-grid/index.js +4 -9
  380. package/build-module/tree-grid/index.js.map +1 -1
  381. package/build-module/ui/context/context-connect.js +1 -2
  382. package/build-module/ui/context/context-connect.js.map +1 -1
  383. package/build-module/unit-control/index.js +2 -2
  384. package/build-module/unit-control/index.js.map +1 -1
  385. package/build-module/utils/colors-values.js +52 -141
  386. package/build-module/utils/colors-values.js.map +1 -1
  387. package/build-module/utils/config-values.js +1 -1
  388. package/build-module/utils/config-values.js.map +1 -1
  389. package/build-module/utils/input/input-control.js +1 -1
  390. package/build-module/utils/input/input-control.js.map +1 -1
  391. package/build-module/utils/rtl.js +6 -4
  392. package/build-module/utils/rtl.js.map +1 -1
  393. package/build-module/utils/strings.js +37 -0
  394. package/build-module/utils/strings.js.map +1 -0
  395. package/build-style/style-rtl.css +176 -1227
  396. package/build-style/style.css +171 -1225
  397. package/build-types/card/card/component.d.ts +3 -3
  398. package/build-types/card/card/component.d.ts.map +1 -1
  399. package/build-types/card/card/hook.d.ts +7 -2
  400. package/build-types/card/card/hook.d.ts.map +1 -1
  401. package/build-types/card/card/index.d.ts +2 -2
  402. package/build-types/card/card/index.d.ts.map +1 -1
  403. package/build-types/card/card-body/component.d.ts +3 -3
  404. package/build-types/card/card-body/component.d.ts.map +1 -1
  405. package/build-types/card/card-body/hook.d.ts +5 -2
  406. package/build-types/card/card-body/hook.d.ts.map +1 -1
  407. package/build-types/card/card-body/index.d.ts +2 -2
  408. package/build-types/card/card-body/index.d.ts.map +1 -1
  409. package/build-types/card/card-divider/component.d.ts +3 -3
  410. package/build-types/card/card-divider/component.d.ts.map +1 -1
  411. package/build-types/card/card-divider/hook.d.ts +5 -2
  412. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  413. package/build-types/card/card-divider/index.d.ts +2 -2
  414. package/build-types/card/card-divider/index.d.ts.map +1 -1
  415. package/build-types/card/card-footer/component.d.ts +3 -3
  416. package/build-types/card/card-footer/component.d.ts.map +1 -1
  417. package/build-types/card/card-footer/hook.d.ts +5 -2
  418. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  419. package/build-types/card/card-footer/index.d.ts +2 -2
  420. package/build-types/card/card-footer/index.d.ts.map +1 -1
  421. package/build-types/card/card-header/component.d.ts +3 -3
  422. package/build-types/card/card-header/component.d.ts.map +1 -1
  423. package/build-types/card/card-header/hook.d.ts +5 -2
  424. package/build-types/card/card-header/hook.d.ts.map +1 -1
  425. package/build-types/card/card-header/index.d.ts +2 -2
  426. package/build-types/card/card-header/index.d.ts.map +1 -1
  427. package/build-types/card/card-media/component.d.ts +3 -4
  428. package/build-types/card/card-media/component.d.ts.map +1 -1
  429. package/build-types/card/card-media/hook.d.ts +6 -5
  430. package/build-types/card/card-media/hook.d.ts.map +1 -1
  431. package/build-types/card/card-media/index.d.ts +2 -2
  432. package/build-types/card/card-media/index.d.ts.map +1 -1
  433. package/build-types/card/context.d.ts +3 -2
  434. package/build-types/card/context.d.ts.map +1 -1
  435. package/build-types/card/index.d.ts +6 -6
  436. package/build-types/card/index.d.ts.map +1 -1
  437. package/build-types/card/stories/index.d.ts +12 -0
  438. package/build-types/card/stories/index.d.ts.map +1 -0
  439. package/build-types/card/styles.d.ts +20 -22
  440. package/build-types/card/styles.d.ts.map +1 -1
  441. package/build-types/card/test/index.d.ts +2 -0
  442. package/build-types/{flyout → card/test}/index.d.ts.map +1 -1
  443. package/build-types/card/types.d.ts +7 -1
  444. package/build-types/card/types.d.ts.map +1 -1
  445. package/build-types/color-palette/index.d.ts +2 -1
  446. package/build-types/color-palette/index.d.ts.map +1 -1
  447. package/build-types/color-picker/styles.d.ts +2 -2
  448. package/build-types/date-time/constants.d.ts +2 -0
  449. package/build-types/date-time/constants.d.ts.map +1 -0
  450. package/build-types/date-time/date/index.d.ts +3 -1
  451. package/build-types/date-time/date/index.d.ts.map +1 -1
  452. package/build-types/date-time/date/styles.d.ts +22 -8
  453. package/build-types/date-time/date/styles.d.ts.map +1 -1
  454. package/build-types/date-time/date/test/index.d.ts +1 -1
  455. package/build-types/date-time/date/test/index.d.ts.map +1 -1
  456. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  457. package/build-types/date-time/time/index.d.ts.map +1 -1
  458. package/build-types/date-time/utils.d.ts +8 -0
  459. package/build-types/date-time/utils.d.ts.map +1 -0
  460. package/build-types/disabled/index.d.ts +35 -28
  461. package/build-types/disabled/index.d.ts.map +1 -1
  462. package/build-types/disabled/stories/index.d.ts +13 -0
  463. package/build-types/disabled/stories/index.d.ts.map +1 -0
  464. package/build-types/disabled/styles/disabled-styles.d.ts +2 -1
  465. package/build-types/disabled/styles/disabled-styles.d.ts.map +1 -1
  466. package/build-types/disabled/test/index.d.ts +2 -0
  467. package/build-types/{flyout/flyout → disabled/test}/index.d.ts.map +1 -1
  468. package/build-types/disabled/types.d.ts +14 -0
  469. package/build-types/disabled/types.d.ts.map +1 -0
  470. package/build-types/dropdown/index.d.ts.map +1 -1
  471. package/build-types/form-token-field/index.d.ts.map +1 -1
  472. package/build-types/form-token-field/stories/index.d.ts +1 -0
  473. package/build-types/form-token-field/stories/index.d.ts.map +1 -1
  474. package/build-types/form-token-field/test/index.d.ts +2 -0
  475. package/build-types/form-token-field/test/index.d.ts.map +1 -0
  476. package/build-types/form-token-field/types.d.ts +7 -0
  477. package/build-types/form-token-field/types.d.ts.map +1 -1
  478. package/build-types/navigable-container/menu.d.ts.map +1 -1
  479. package/build-types/navigator/navigator-back-button/hook.d.ts +0 -3
  480. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  481. package/build-types/navigator/navigator-button/hook.d.ts +0 -3
  482. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  483. package/build-types/placeholder/test/index.d.ts +2 -0
  484. package/build-types/placeholder/test/index.d.ts.map +1 -0
  485. package/build-types/popover/index.d.ts +1 -1
  486. package/build-types/popover/index.d.ts.map +1 -1
  487. package/build-types/popover/utils.d.ts +26 -69
  488. package/build-types/popover/utils.d.ts.map +1 -1
  489. package/build-types/range-control/index.d.ts +2 -2
  490. package/build-types/range-control/index.d.ts.map +1 -1
  491. package/build-types/range-control/styles/range-control-styles.d.ts +5 -2
  492. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  493. package/build-types/range-control/types.d.ts +2 -2
  494. package/build-types/range-control/types.d.ts.map +1 -1
  495. package/build-types/select-control/chevron-down.d.ts +4 -0
  496. package/build-types/select-control/chevron-down.d.ts.map +1 -0
  497. package/build-types/select-control/index.d.ts.map +1 -1
  498. package/build-types/select-control/styles/select-control-styles.d.ts +8 -0
  499. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  500. package/build-types/spinner/index.d.ts.map +1 -1
  501. package/build-types/toggle-group-control/stories/index.d.ts +25 -0
  502. package/build-types/toggle-group-control/stories/index.d.ts.map +1 -0
  503. package/build-types/toggle-group-control/test/index.d.ts +2 -0
  504. package/build-types/toggle-group-control/test/index.d.ts.map +1 -0
  505. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +6 -3
  506. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  507. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -0
  508. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  509. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +6 -7
  510. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  511. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  512. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +4 -0
  513. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  514. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +11 -9
  515. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  516. package/build-types/toggle-group-control/types.d.ts +23 -10
  517. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  518. package/build-types/tooltip/index.d.ts.map +1 -1
  519. package/build-types/ui/context/context-connect.d.ts +3 -0
  520. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  521. package/build-types/ui/form-group/use-form-group.d.ts +2 -2
  522. package/build-types/unit-control/index.d.ts +2 -1
  523. package/build-types/unit-control/index.d.ts.map +1 -1
  524. package/build-types/unit-control/types.d.ts +5 -1
  525. package/build-types/unit-control/types.d.ts.map +1 -1
  526. package/build-types/utils/colors-values.d.ts +18 -97
  527. package/build-types/utils/colors-values.d.ts.map +1 -1
  528. package/build-types/utils/rtl.d.ts.map +1 -1
  529. package/build-types/utils/strings.d.ts +2 -0
  530. package/build-types/utils/strings.d.ts.map +1 -0
  531. package/package.json +22 -21
  532. package/src/alignment-matrix-control/index.js +1 -1
  533. package/src/alignment-matrix-control/stories/index.js +49 -24
  534. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +1 -3
  535. package/src/angle-picker-control/index.js +7 -1
  536. package/src/angle-picker-control/stories/index.js +8 -5
  537. package/src/angle-picker-control/styles/angle-picker-control-styles.js +12 -3
  538. package/src/autocomplete/index.js +9 -18
  539. package/src/base-control/styles/base-control-styles.ts +1 -1
  540. package/src/base-field/styles.js +1 -1
  541. package/src/base-field/test/__snapshots__/index.js.snap +2 -2
  542. package/src/box-control/styles/box-control-visualizer-styles.js +0 -1
  543. package/src/box-control/test/index.js +8 -8
  544. package/src/button/test/index.js +188 -146
  545. package/src/card/card/{component.js → component.tsx} +13 -9
  546. package/src/card/card/{hook.js → hook.ts} +11 -11
  547. package/src/card/card/{index.js → index.ts} +0 -0
  548. package/src/card/card-body/{component.js → component.tsx} +13 -9
  549. package/src/card/card-body/{hook.js → hook.ts} +5 -5
  550. package/src/card/card-body/{index.js → index.ts} +0 -0
  551. package/src/card/card-divider/{component.js → component.tsx} +16 -10
  552. package/src/card/card-divider/{hook.js → hook.ts} +5 -5
  553. package/src/card/card-divider/{index.js → index.ts} +0 -0
  554. package/src/card/card-footer/{component.js → component.tsx} +13 -9
  555. package/src/card/card-footer/{hook.js → hook.ts} +5 -5
  556. package/src/card/card-footer/{index.js → index.ts} +0 -0
  557. package/src/card/card-header/{component.js → component.tsx} +13 -9
  558. package/src/card/card-header/{hook.js → hook.ts} +5 -5
  559. package/src/card/card-header/{index.js → index.ts} +0 -0
  560. package/src/card/card-media/{component.js → component.tsx} +13 -8
  561. package/src/card/card-media/{hook.js → hook.ts} +5 -5
  562. package/src/card/card-media/{index.js → index.ts} +0 -0
  563. package/src/card/{context.js → context.ts} +0 -0
  564. package/src/card/{index.js → index.ts} +0 -0
  565. package/src/card/stories/index.tsx +75 -0
  566. package/src/card/{styles.js → styles.ts} +0 -0
  567. package/src/card/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  568. package/src/card/test/{index.js → index.tsx} +3 -3
  569. package/src/card/types.ts +8 -1
  570. package/src/color-list-picker/index.js +15 -3
  571. package/src/color-list-picker/style.scss +11 -0
  572. package/src/color-palette/index.js +32 -16
  573. package/src/color-palette/index.native.js +10 -6
  574. package/src/color-palette/stories/index.js +1 -1
  575. package/src/color-palette/test/__snapshots__/index.js.snap +17 -3
  576. package/src/combobox-control/index.js +6 -5
  577. package/src/combobox-control/stories/index.js +9 -3
  578. package/src/combobox-control/style.scss +0 -1
  579. package/src/confirm-dialog/test/index.js +85 -62
  580. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  581. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +54 -50
  582. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -3
  583. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/test/utils.js +0 -0
  584. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  585. package/src/custom-gradient-picker/index.js +18 -3
  586. package/src/custom-gradient-picker/stories/index.js +4 -3
  587. package/src/custom-gradient-picker/style.scss +30 -27
  588. package/src/custom-select-control/README.md +10 -0
  589. package/src/custom-select-control/index.js +22 -16
  590. package/src/custom-select-control/stories/index.js +1 -1
  591. package/src/custom-select-control/style.scss +0 -12
  592. package/src/custom-select-control/styles.ts +28 -0
  593. package/src/custom-select-control/test/index.js +4 -1
  594. package/src/date-time/constants.ts +1 -0
  595. package/src/date-time/date/index.tsx +289 -184
  596. package/src/date-time/date/styles.ts +86 -27
  597. package/src/date-time/date/test/index.tsx +18 -28
  598. package/src/date-time/date-time/index.tsx +3 -2
  599. package/src/date-time/time/index.tsx +23 -19
  600. package/src/date-time/utils.ts +17 -0
  601. package/src/dimension-control/index.js +1 -5
  602. package/src/disabled/index.tsx +80 -0
  603. package/src/disabled/stories/index.tsx +87 -0
  604. package/src/disabled/styles/{disabled-styles.js → disabled-styles.tsx} +0 -0
  605. package/src/disabled/test/index.tsx +174 -0
  606. package/src/disabled/types.ts +13 -0
  607. package/src/drop-zone/index.js +2 -3
  608. package/src/dropdown/index.js +3 -5
  609. package/src/dropdown-menu/stories/index.js +13 -2
  610. package/src/duotone-picker/custom-duotone-bar.js +1 -1
  611. package/src/duotone-picker/duotone-picker.js +34 -26
  612. package/src/duotone-picker/duotone-swatch.js +12 -5
  613. package/src/duotone-picker/stories/duotone-picker.js +66 -0
  614. package/src/duotone-picker/stories/duotone-swatch.js +32 -0
  615. package/src/focal-point-picker/index.js +10 -5
  616. package/src/focal-point-picker/styles/focal-point-style.js +0 -1
  617. package/src/focal-point-picker/test/index.js +78 -45
  618. package/src/font-size-picker/index.js +161 -144
  619. package/src/font-size-picker/stories/index.js +1 -0
  620. package/src/font-size-picker/style.scss +8 -5
  621. package/src/font-size-picker/test/index.js +13 -6
  622. package/src/font-size-picker/test/{util.js → utils.js} +77 -1
  623. package/src/font-size-picker/utils.js +38 -23
  624. package/src/form-token-field/README.md +1 -0
  625. package/src/form-token-field/index.tsx +41 -33
  626. package/src/form-token-field/stories/index.tsx +8 -0
  627. package/src/form-token-field/test/index.tsx +2106 -0
  628. package/src/form-token-field/types.ts +7 -0
  629. package/src/gradient-picker/index.js +22 -7
  630. package/src/gradient-picker/stories/index.js +56 -81
  631. package/src/guide/index.js +3 -1
  632. package/src/guide/page-control.js +1 -6
  633. package/src/guide/stories/index.js +12 -11
  634. package/src/guide/test/index.js +54 -37
  635. package/src/guide/test/page-control.js +14 -17
  636. package/src/higher-order/with-notices/test/index.js +4 -2
  637. package/src/higher-order/with-spoken-messages/test/index.js +1 -1
  638. package/src/item-group/styles.ts +3 -3
  639. package/src/menu-group/test/index.js +18 -7
  640. package/src/mobile/bottom-sheet/index.native.js +2 -4
  641. package/src/mobile/global-styles-context/utils.native.js +2 -1
  642. package/src/mobile/image/index.native.js +9 -30
  643. package/src/mobile/picker/index.android.js +10 -4
  644. package/src/mobile/picker/styles.native.scss +4 -4
  645. package/src/modal/index.js +1 -2
  646. package/src/modal/test/index.js +11 -9
  647. package/src/navigable-container/container.js +12 -18
  648. package/src/navigable-container/menu.js +3 -7
  649. package/src/navigable-container/test/menu.js +14 -11
  650. package/src/navigator/navigator-back-button/hook.ts +0 -3
  651. package/src/navigator/navigator-button/hook.ts +0 -3
  652. package/src/notice/list.js +12 -10
  653. package/src/palette-edit/index.js +1 -0
  654. package/src/palette-edit/styles.js +6 -5
  655. package/src/placeholder/README.md +1 -1
  656. package/src/placeholder/style.scss +65 -20
  657. package/src/placeholder/test/index.tsx +174 -0
  658. package/src/popover/index.js +133 -112
  659. package/src/popover/stories/index.js +17 -3
  660. package/src/popover/test/__snapshots__/index.js.snap +6 -6
  661. package/src/popover/test/index.js +129 -36
  662. package/src/popover/utils.js +107 -0
  663. package/src/range-control/index.tsx +3 -0
  664. package/src/range-control/styles/range-control-styles.ts +9 -4
  665. package/src/range-control/types.ts +5 -2
  666. package/src/select-control/chevron-down.tsx +25 -0
  667. package/src/select-control/index.tsx +6 -9
  668. package/src/select-control/styles/select-control-styles.ts +23 -14
  669. package/src/slot-fill/test/slot.js +5 -5
  670. package/src/snackbar/list.js +3 -2
  671. package/src/spinner/index.tsx +2 -0
  672. package/src/style.scss +0 -2
  673. package/src/text/styles.js +1 -1
  674. package/src/text/test/index.tsx +1 -1
  675. package/src/toggle-group-control/stories/index.tsx +127 -0
  676. package/src/toggle-group-control/test/__snapshots__/{index.js.snap → index.tsx.snap} +28 -22
  677. package/src/toggle-group-control/test/{index.js → index.tsx} +2 -4
  678. package/src/toggle-group-control/toggle-group-control/README.md +2 -0
  679. package/src/toggle-group-control/toggle-group-control/component.tsx +18 -9
  680. package/src/toggle-group-control/toggle-group-control/styles.ts +9 -6
  681. package/src/toggle-group-control/toggle-group-control-option/component.tsx +19 -3
  682. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -0
  683. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +18 -0
  684. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +6 -8
  685. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +30 -7
  686. package/src/toggle-group-control/types.ts +74 -59
  687. package/src/toolbar/test/index.js +4 -4
  688. package/src/toolbar-group/test/index.js +9 -15
  689. package/src/tools-panel/styles.ts +2 -2
  690. package/src/tools-panel/test/index.js +3 -2
  691. package/src/tooltip/index.js +1 -5
  692. package/src/tooltip/test/index.js +188 -172
  693. package/src/tree-grid/index.js +4 -9
  694. package/src/ui/context/context-connect.ts +3 -2
  695. package/src/unit-control/index.tsx +2 -2
  696. package/src/unit-control/types.ts +10 -1
  697. package/src/utils/colors-values.js +42 -137
  698. package/src/utils/config-values.js +1 -1
  699. package/src/utils/input/input-control.js +6 -6
  700. package/src/utils/rtl.js +6 -2
  701. package/src/utils/strings.ts +72 -0
  702. package/src/utils/test/strings.js +15 -0
  703. package/tsconfig.json +0 -1
  704. package/tsconfig.tsbuildinfo +1 -1
  705. package/build/custom-gradient-bar/constants.js.map +0 -1
  706. package/build/custom-gradient-bar/control-points.js.map +0 -1
  707. package/build/custom-gradient-bar/index.js.map +0 -1
  708. package/build/custom-gradient-bar/utils.js.map +0 -1
  709. package/build/date-time/date/utils.js +0 -34
  710. package/build/date-time/date/utils.js.map +0 -1
  711. package/build/swatch/index.js +0 -41
  712. package/build/swatch/index.js.map +0 -1
  713. package/build-module/custom-gradient-bar/constants.js.map +0 -1
  714. package/build-module/custom-gradient-bar/control-points.js.map +0 -1
  715. package/build-module/custom-gradient-bar/index.js.map +0 -1
  716. package/build-module/custom-gradient-bar/utils.js.map +0 -1
  717. package/build-module/date-time/date/utils.js +0 -22
  718. package/build-module/date-time/date/utils.js.map +0 -1
  719. package/build-module/swatch/index.js +0 -30
  720. package/build-module/swatch/index.js.map +0 -1
  721. package/build-types/color-picker/color-display.d.ts +0 -13
  722. package/build-types/color-picker/color-display.d.ts.map +0 -1
  723. package/build-types/date-time/date/test/utils.d.ts +0 -2
  724. package/build-types/date-time/date/test/utils.d.ts.map +0 -1
  725. package/build-types/date-time/date/utils.d.ts +0 -15
  726. package/build-types/date-time/date/utils.d.ts.map +0 -1
  727. package/build-types/flyout/context.d.ts +0 -6
  728. package/build-types/flyout/context.d.ts.map +0 -1
  729. package/build-types/flyout/flyout/component.d.ts +0 -21
  730. package/build-types/flyout/flyout/component.d.ts.map +0 -1
  731. package/build-types/flyout/flyout/hook.d.ts +0 -270
  732. package/build-types/flyout/flyout/hook.d.ts.map +0 -1
  733. package/build-types/flyout/flyout/index.d.ts +0 -3
  734. package/build-types/flyout/flyout-content/component.d.ts +0 -3
  735. package/build-types/flyout/flyout-content/component.d.ts.map +0 -1
  736. package/build-types/flyout/flyout-content/index.d.ts +0 -2
  737. package/build-types/flyout/flyout-content/index.d.ts.map +0 -1
  738. package/build-types/flyout/index.d.ts +0 -2
  739. package/build-types/flyout/styles.d.ts +0 -22
  740. package/build-types/flyout/styles.d.ts.map +0 -1
  741. package/build-types/flyout/types.d.ts +0 -80
  742. package/build-types/flyout/types.d.ts.map +0 -1
  743. package/build-types/flyout/utils.d.ts +0 -8
  744. package/build-types/flyout/utils.d.ts.map +0 -1
  745. package/build-types/form-token-field/test/lib/fixtures.d.ts +0 -26
  746. package/build-types/form-token-field/test/lib/fixtures.d.ts.map +0 -1
  747. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +0 -21
  748. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +0 -1
  749. package/build-types/swatch/index.d.ts +0 -5
  750. package/build-types/swatch/index.d.ts.map +0 -1
  751. package/build-types/swatch/types.d.ts +0 -11
  752. package/build-types/swatch/types.d.ts.map +0 -1
  753. package/build-types/utils/hooks/use-combined-ref.d.ts +0 -8
  754. package/build-types/utils/hooks/use-combined-ref.d.ts.map +0 -1
  755. package/src/card/stories/index.js +0 -209
  756. package/src/date-time/date/datepicker.scss +0 -863
  757. package/src/date-time/date/style.scss +0 -85
  758. package/src/date-time/date/test/utils.ts +0 -32
  759. package/src/date-time/date/utils.ts +0 -20
  760. package/src/date-time/style.scss +0 -1
  761. package/src/disabled/index.js +0 -55
  762. package/src/disabled/stories/index.js +0 -61
  763. package/src/disabled/test/index.js +0 -240
  764. package/src/form-token-field/test/index.js +0 -411
  765. package/src/form-token-field/test/lib/fixtures.js +0 -89
  766. package/src/form-token-field/test/lib/token-field-wrapper.tsx +0 -71
  767. package/src/menu-group/test/__snapshots__/index.js.snap +0 -23
  768. package/src/placeholder/test/index.js +0 -163
  769. package/src/swatch/index.tsx +0 -22
  770. package/src/swatch/style.scss +0 -21
  771. package/src/swatch/types.ts +0 -11
  772. package/src/toggle-group-control/stories/index.js +0 -203
  773. package/src/tools-panel/test/__snapshots__/index.js.snap +0 -210
@@ -167,19 +167,19 @@ describe( 'BoxControl', () => {
167
167
  let state = {};
168
168
  const setState = ( newState ) => ( state = newState );
169
169
 
170
- const { getAllByLabelText, getByLabelText } = render(
170
+ render(
171
171
  <BoxControl
172
172
  values={ state }
173
173
  onChange={ ( next ) => setState( next ) }
174
174
  />
175
175
  );
176
176
  const user = setupUser();
177
- const unlink = getByLabelText( /Unlink Sides/ );
177
+ const unlink = screen.getByLabelText( /Unlink Sides/ );
178
178
 
179
179
  await user.click( unlink );
180
180
 
181
- const input = getByLabelText( /Top/ );
182
- const select = getAllByLabelText( /Select unit/ )[ 0 ];
181
+ const input = screen.getByLabelText( /Top/ );
182
+ const select = screen.getAllByLabelText( /Select unit/ )[ 0 ];
183
183
 
184
184
  await user.type( input, '100px' );
185
185
  await user.keyboard( '{Enter}' );
@@ -199,7 +199,7 @@ describe( 'BoxControl', () => {
199
199
  let state = {};
200
200
  const setState = ( newState ) => ( state = newState );
201
201
 
202
- const { getAllByLabelText, getByLabelText } = render(
202
+ render(
203
203
  <BoxControl
204
204
  values={ state }
205
205
  onChange={ ( next ) => setState( next ) }
@@ -207,12 +207,12 @@ describe( 'BoxControl', () => {
207
207
  />
208
208
  );
209
209
  const user = setupUser();
210
- const unlink = getByLabelText( /Unlink Sides/ );
210
+ const unlink = screen.getByLabelText( /Unlink Sides/ );
211
211
 
212
212
  await user.click( unlink );
213
213
 
214
- const input = getByLabelText( /Vertical/ );
215
- const select = getAllByLabelText( /Select unit/ )[ 0 ];
214
+ const input = screen.getByLabelText( /Vertical/ );
215
+ const select = screen.getAllByLabelText( /Select unit/ )[ 0 ];
216
216
 
217
217
  await user.type( input, '100px' );
218
218
  await user.keyboard( '{Enter}' );
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { shallow } from 'enzyme';
5
- import TestUtils from 'react-dom/test-utils';
4
+ import { render, screen } from '@testing-library/react';
5
+
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
@@ -12,172 +12,188 @@ import { plusCircle } from '@wordpress/icons';
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
- import ButtonWithForwardedRef, { Button } from '../';
16
- import { VisuallyHidden } from '../../visually-hidden';
15
+ import Button from '../';
16
+
17
+ jest.mock( '../../icon', () => () => <div data-testid="test-icon" /> );
17
18
 
18
19
  describe( 'Button', () => {
19
20
  describe( 'basic rendering', () => {
20
21
  it( 'should render a button element with only one class', () => {
21
- const button = shallow( <Button /> ).find( 'button' );
22
- expect( button.hasClass( 'components-button' ) ).toBe( true );
23
- expect( button.hasClass( 'is-large' ) ).toBe( false );
24
- expect( button.hasClass( 'is-primary' ) ).toBe( false );
25
- expect( button.hasClass( 'is-pressed' ) ).toBe( false );
26
- expect( button.prop( 'disabled' ) ).toBeUndefined();
27
- expect( button.prop( 'aria-disabled' ) ).toBeUndefined();
28
- expect( button.prop( 'type' ) ).toBe( 'button' );
29
- expect( button.type() ).toBe( 'button' );
22
+ render( <Button /> );
23
+ const button = screen.getByRole( 'button' );
24
+
25
+ expect( button ).toHaveClass( 'components-button' );
26
+ expect( button ).not.toHaveClass( 'is-large' );
27
+ expect( button ).not.toHaveClass( 'is-primary' );
28
+ expect( button ).not.toHaveClass( 'is-pressed' );
29
+ expect( button ).not.toHaveAttribute( 'disabled' );
30
+ expect( button ).not.toHaveAttribute( 'aria-disabled' );
31
+ expect( button ).toHaveAttribute( 'type', 'button' );
30
32
  } );
31
33
 
32
34
  it( 'should render a button element with is-primary class', () => {
33
- const button = shallow( <Button variant="primary" /> ).find(
34
- 'button'
35
- );
36
- expect( button.hasClass( 'is-large' ) ).toBe( false );
37
- expect( button.hasClass( 'is-primary' ) ).toBe( true );
35
+ render( <Button variant="primary" /> );
36
+ const button = screen.getByRole( 'button' );
37
+
38
+ expect( button ).not.toHaveClass( 'is-large' );
39
+ expect( button ).toHaveClass( 'is-primary' );
38
40
  } );
39
41
 
40
42
  it( 'should render a button element with is-secondary and is-small class', () => {
41
- const button = shallow(
42
- <Button variant="secondary" isSmall />
43
- ).find( 'button' );
44
- expect( button.hasClass( 'is-secondary' ) ).toBe( true );
45
- expect( button.hasClass( 'is-large' ) ).toBe( false );
46
- expect( button.hasClass( 'is-small' ) ).toBe( true );
47
- expect( button.hasClass( 'is-primary' ) ).toBe( false );
43
+ render( <Button variant="secondary" isSmall /> );
44
+ const button = screen.getByRole( 'button' );
45
+
46
+ expect( button ).toHaveClass( 'is-secondary' );
47
+ expect( button ).not.toHaveClass( 'is-large' );
48
+ expect( button ).toHaveClass( 'is-small' );
49
+ expect( button ).not.toHaveClass( 'is-primary' );
48
50
  } );
49
51
 
50
52
  it( 'should render a button element with is-tertiary class', () => {
51
- const button = shallow( <Button variant="tertiary" /> ).find(
52
- 'button'
53
- );
54
- expect( button.hasClass( 'is-large' ) ).toBe( false );
55
- expect( button.hasClass( 'is-primary' ) ).toBe( false );
56
- expect( button.hasClass( 'is-secondary' ) ).toBe( false );
57
- expect( button.hasClass( 'is-tertiary' ) ).toBe( true );
53
+ render( <Button variant="tertiary" /> );
54
+ const button = screen.getByRole( 'button' );
55
+
56
+ expect( button ).not.toHaveClass( 'is-large' );
57
+ expect( button ).not.toHaveClass( 'is-primary' );
58
+ expect( button ).not.toHaveClass( 'is-secondary' );
59
+ expect( button ).toHaveClass( 'is-tertiary' );
58
60
  } );
59
61
 
60
62
  it( 'should render a button element with is-link class', () => {
61
- const button = shallow( <Button variant="link" /> ).find(
62
- 'button'
63
- );
64
- expect( button.hasClass( 'is-primary' ) ).toBe( false );
65
- expect( button.hasClass( 'is-secondary' ) ).toBe( false );
66
- expect( button.hasClass( 'is-tertiary' ) ).toBe( false );
67
- expect( button.hasClass( 'is-link' ) ).toBe( true );
63
+ render( <Button variant="link" /> );
64
+ const button = screen.getByRole( 'button' );
65
+
66
+ expect( button ).not.toHaveClass( 'is-primary' );
67
+ expect( button ).not.toHaveClass( 'is-secondary' );
68
+ expect( button ).not.toHaveClass( 'is-tertiary' );
69
+ expect( button ).toHaveClass( 'is-link' );
68
70
  } );
69
71
 
70
72
  it( 'should render a button element with is-pressed without button class', () => {
71
- const button = shallow( <Button isPressed /> ).find( 'button' );
72
- expect( button.hasClass( 'is-pressed' ) ).toBe( true );
73
+ render( <Button isPressed /> );
74
+
75
+ expect( screen.getByRole( 'button' ) ).toHaveClass( 'is-pressed' );
73
76
  } );
74
77
 
75
78
  it( 'should add a disabled prop to the button', () => {
76
- const button = shallow( <Button disabled /> ).find( 'button' );
77
- expect( button.prop( 'disabled' ) ).toBe( true );
79
+ render( <Button disabled /> );
80
+
81
+ expect( screen.getByRole( 'button' ) ).toHaveAttribute(
82
+ 'disabled'
83
+ );
78
84
  } );
79
85
 
80
86
  it( 'should add only aria-disabled attribute when disabled and isFocusable are true', () => {
81
- const button = shallow(
82
- <Button disabled __experimentalIsFocusable />
83
- ).find( 'button' );
84
- expect( button.prop( 'disabled' ) ).toBe( false );
85
- expect( button.prop( 'aria-disabled' ) ).toBe( true );
87
+ render( <Button disabled __experimentalIsFocusable /> );
88
+ const button = screen.getByRole( 'button' );
89
+
90
+ expect( button ).not.toHaveAttribute( 'disabled' );
91
+ expect( button ).toHaveAttribute( 'aria-disabled' );
86
92
  } );
87
93
 
88
- it( 'should not poss the prop target into the element', () => {
89
- const button = shallow( <Button target="_blank" /> ).find(
90
- 'button'
94
+ it( 'should not pass the prop target into the element', () => {
95
+ render( <Button target="_blank" /> );
96
+
97
+ expect( screen.getByRole( 'button' ) ).not.toHaveAttribute(
98
+ 'target'
91
99
  );
92
- expect( button.prop( 'target' ) ).toBeUndefined();
93
100
  } );
94
101
 
95
102
  it( 'should render with an additional className', () => {
96
- const button = shallow( <Button className="gutenberg" /> ).find(
97
- 'button'
98
- );
103
+ render( <Button className="gutenberg" /> );
99
104
 
100
- expect( button.hasClass( 'gutenberg' ) ).toBe( true );
105
+ expect( screen.getByRole( 'button' ) ).toHaveClass( 'gutenberg' );
101
106
  } );
102
107
 
103
- it( 'should render and additional WordPress prop of value awesome', () => {
104
- const button = shallow( <Button WordPress="awesome" /> ).find(
105
- 'button'
106
- );
108
+ it( 'should render an additional WordPress prop of value awesome', () => {
109
+ render( <Button WordPress="awesome" /> );
107
110
 
108
- expect( button.prop( 'WordPress' ) ).toBe( 'awesome' );
111
+ expect( console ).toHaveErrored();
112
+ expect( screen.getByRole( 'button' ) ).toHaveAttribute(
113
+ 'wordpress',
114
+ 'awesome'
115
+ );
109
116
  } );
110
117
 
111
118
  it( 'should render an icon button', () => {
112
- const iconButton = shallow( <Button icon={ plusCircle } /> ).find(
113
- 'button'
114
- );
115
- expect( iconButton.hasClass( 'has-icon' ) ).toBe( true );
116
- expect( iconButton.prop( 'aria-label' ) ).toBeUndefined();
119
+ render( <Button icon={ plusCircle } /> );
120
+ const button = screen.getByRole( 'button' );
121
+
122
+ expect( button ).toHaveClass( 'has-icon' );
123
+ expect( button ).not.toHaveAttribute( 'aria-label' );
117
124
  } );
118
125
 
119
126
  it( 'should render a Dashicon component matching the wordpress icon', () => {
120
- const iconButton = shallow( <Button icon={ plusCircle } /> ).find(
121
- 'button'
127
+ render( <Button icon={ plusCircle } /> );
128
+
129
+ expect( screen.getByRole( 'button' ) ).toContainElement(
130
+ screen.getByTestId( 'test-icon' )
122
131
  );
123
- expect( iconButton.find( 'Icon' ).dive() ).not.toBeNull();
124
132
  } );
125
133
 
126
134
  it( 'should render child elements and icon', () => {
127
- const iconButton = shallow(
135
+ render(
128
136
  <Button
129
137
  icon={ plusCircle }
130
138
  children={ <p className="test">Test</p> }
131
139
  />
132
- ).find( 'button' );
133
- expect( iconButton.find( 'Icon' ).dive() ).not.toBeNull();
134
- expect( iconButton.find( '.test' ).shallow().text() ).toBe(
135
- 'Test'
136
140
  );
137
- } );
138
141
 
139
- it( 'should add an aria-label when the label property is used, with Tooltip wrapper', () => {
140
- const iconButton = shallow(
141
- <Button icon={ plusCircle } label="WordPress" />
142
- ).find( 'Tooltip' );
143
- expect( iconButton.name() ).toBe( 'Tooltip' );
144
- expect( iconButton.prop( 'text' ) ).toBe( 'WordPress' );
145
- expect( iconButton.find( 'button' ).prop( 'aria-label' ) ).toBe(
146
- 'WordPress'
142
+ expect( screen.getByRole( 'button' ) ).toContainElement(
143
+ screen.getByTestId( 'test-icon' )
147
144
  );
145
+
146
+ const paragraph = screen.getByText( 'Test' );
147
+ expect( paragraph ).toBeVisible();
148
+ expect( paragraph ).toHaveClass( 'test' );
149
+ } );
150
+
151
+ it( 'should add an aria-label when the label property is used, with Tooltip wrapper', async () => {
152
+ render( <Button icon={ plusCircle } label="WordPress" /> );
153
+
154
+ expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
155
+
156
+ await screen.getByRole( 'button', { name: 'WordPress' } ).focus();
157
+
158
+ expect( screen.getByText( 'WordPress' ) ).toBeVisible();
148
159
  } );
149
160
 
150
161
  it( 'should support explicit aria-label override', () => {
151
- const iconButton = shallow( <Button aria-label="Custom" /> ).find(
152
- 'button'
162
+ render( <Button aria-label="Custom" /> );
163
+
164
+ expect( screen.getByRole( 'button' ) ).toHaveAttribute(
165
+ 'aria-label',
166
+ 'Custom'
153
167
  );
154
- expect( iconButton.prop( 'aria-label' ) ).toBe( 'Custom' );
155
168
  } );
156
169
 
157
170
  it( 'should support adding aria-describedby text', () => {
158
- const buttonDescription = shallow(
159
- <Button describedBy="Description text" />
160
- )
161
- .find( VisuallyHidden )
162
- .shallow()
163
- .text();
164
- expect( buttonDescription ).toBe( 'Description text' );
171
+ render( <Button describedBy="Description text" /> );
172
+ expect(
173
+ screen.getByRole( 'button', {
174
+ description: 'Description text',
175
+ } )
176
+ ).toBeVisible();
165
177
  } );
166
178
 
167
- it( 'should populate tooltip with label content for buttons without visible labels (no children)', () => {
168
- const buttonTooltip = shallow(
179
+ it( 'should populate tooltip with label content for buttons without visible labels (no children)', async () => {
180
+ render(
169
181
  <Button
170
182
  describedBy="Description text"
171
183
  label="Label"
172
184
  icon={ plusCircle }
173
185
  />
174
- ).find( 'Tooltip' );
186
+ );
187
+
188
+ expect( screen.queryByText( 'Label' ) ).not.toBeInTheDocument();
175
189
 
176
- expect( buttonTooltip.prop( 'text' ) ).toBe( 'Label' );
190
+ await screen.getByRole( 'button', { name: 'Label' } ).focus();
191
+
192
+ expect( screen.getByText( 'Label' ) ).toBeVisible();
177
193
  } );
178
194
 
179
195
  it( 'should populate tooltip with description content for buttons with visible labels (buttons with children)', () => {
180
- const buttonTooltip = shallow(
196
+ render(
181
197
  <Button
182
198
  label="Label"
183
199
  describedBy="Description text"
@@ -186,74 +202,98 @@ describe( 'Button', () => {
186
202
  >
187
203
  Children
188
204
  </Button>
189
- ).find( 'Tooltip' );
205
+ );
190
206
 
191
- expect( buttonTooltip.prop( 'text' ) ).toBe( 'Description text' );
207
+ expect(
208
+ screen.getByRole( 'button', {
209
+ description: 'Description text',
210
+ } )
211
+ ).toBeVisible();
192
212
  } );
193
213
 
194
- it( 'should allow tooltip disable', () => {
195
- const iconButton = shallow(
214
+ it( 'should allow tooltip disable', async () => {
215
+ render(
196
216
  <Button
197
217
  icon={ plusCircle }
198
218
  label="WordPress"
199
219
  showTooltip={ false }
200
220
  />
201
- ).find( 'button' );
202
- expect( iconButton.name() ).toBe( 'button' );
203
- expect( iconButton.prop( 'aria-label' ) ).toBe( 'WordPress' );
221
+ );
222
+ const button = screen.getByRole( 'button', { name: 'WordPress' } );
223
+
224
+ expect( button ).toHaveAttribute( 'aria-label', 'WordPress' );
225
+
226
+ expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
227
+
228
+ await button.focus();
229
+
230
+ expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
204
231
  } );
205
232
 
206
- it( 'should show the tooltip for empty children', () => {
207
- const iconButton = shallow(
233
+ it( 'should show the tooltip for empty children', async () => {
234
+ render(
208
235
  <Button icon={ plusCircle } label="WordPress" children={ [] } />
209
- ).find( 'Tooltip' );
210
- expect( iconButton.name() ).toBe( 'Tooltip' );
211
- expect( iconButton.prop( 'text' ) ).toBe( 'WordPress' );
236
+ );
237
+
238
+ expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
239
+
240
+ await screen.getByRole( 'button', { name: 'WordPress' } ).focus();
241
+
242
+ expect( screen.getByText( 'WordPress' ) ).toBeVisible();
212
243
  } );
213
244
 
214
- it( 'should not show the tooltip when icon and children defined', () => {
215
- const iconButton = shallow(
245
+ it( 'should not show the tooltip when icon and children defined', async () => {
246
+ render(
216
247
  <Button icon={ plusCircle } label="WordPress">
217
248
  Children
218
249
  </Button>
219
- ).find( 'button' );
220
- expect( iconButton.name() ).toBe( 'button' );
250
+ );
251
+
252
+ expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
253
+
254
+ await screen.getByRole( 'button', { name: 'WordPress' } ).focus();
255
+
256
+ expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
221
257
  } );
222
258
 
223
- it( 'should force showing the tooltip even if icon and children defined', () => {
224
- const iconButton = shallow(
259
+ it( 'should force showing the tooltip even if icon and children defined', async () => {
260
+ render(
225
261
  <Button icon={ plusCircle } label="WordPress" showTooltip>
226
262
  Children
227
263
  </Button>
228
- ).find( 'Tooltip' );
229
- expect( iconButton.name() ).toBe( 'Tooltip' );
264
+ );
265
+
266
+ expect( screen.queryByText( 'WordPress' ) ).not.toBeInTheDocument();
267
+
268
+ await screen.getByRole( 'button', { name: 'WordPress' } ).focus();
269
+
270
+ expect( screen.getByText( 'WordPress' ) ).toBeVisible();
230
271
  } );
231
272
  } );
232
273
 
233
274
  describe( 'with href property', () => {
234
275
  it( 'should render a link instead of a button with href prop', () => {
235
- const button = shallow(
236
- <Button href="https://wordpress.org/" />
237
- ).find( 'a' );
276
+ render( <Button href="https://wordpress.org/" /> );
238
277
 
239
- expect( button.type() ).toBe( 'a' );
240
- expect( button.prop( 'href' ) ).toBe( 'https://wordpress.org/' );
278
+ expect( screen.getByRole( 'link' ) ).toHaveAttribute(
279
+ 'href',
280
+ 'https://wordpress.org/'
281
+ );
241
282
  } );
242
283
 
243
284
  it( 'should allow for the passing of the target prop when a link is created', () => {
244
- const button = shallow(
245
- <Button href="https://wordpress.org/" target="_blank" />
246
- ).find( 'a' );
285
+ render( <Button href="https://wordpress.org/" target="_blank" /> );
247
286
 
248
- expect( button.prop( 'target' ) ).toBe( '_blank' );
287
+ expect( screen.getByRole( 'link' ) ).toHaveAttribute(
288
+ 'target',
289
+ '_blank'
290
+ );
249
291
  } );
250
292
 
251
293
  it( 'should become a button again when disabled is supplied', () => {
252
- const button = shallow(
253
- <Button href="https://wordpress.org/" disabled />
254
- ).find( 'button' );
294
+ render( <Button href="https://wordpress.org/" disabled /> );
255
295
 
256
- expect( button.type() ).toBe( 'button' );
296
+ expect( screen.getByRole( 'button' ) ).toBeVisible();
257
297
  } );
258
298
  } );
259
299
 
@@ -261,38 +301,40 @@ describe( 'Button', () => {
261
301
  it( 'should enable access to DOM element', () => {
262
302
  const ref = createRef();
263
303
 
264
- TestUtils.renderIntoDocument(
265
- <ButtonWithForwardedRef ref={ ref } />
266
- );
267
- expect( ref.current.type ).toBe( 'button' );
304
+ render( <Button ref={ ref } /> );
305
+
306
+ expect( ref.current ).toBe( screen.getByRole( 'button' ) );
268
307
  } );
269
308
  } );
270
309
 
271
310
  describe( 'deprecated props', () => {
272
311
  it( 'should not break when the legacy isPrimary prop is passed', () => {
273
- const button = shallow( <Button isPrimary /> ).find( 'button' );
274
- expect( button.hasClass( 'is-primary' ) ).toBe( true );
312
+ render( <Button isPrimary /> );
313
+ expect( screen.getByRole( 'button' ) ).toHaveClass( 'is-primary' );
275
314
  } );
276
315
 
277
316
  it( 'should not break when the legacy isSecondary prop is passed', () => {
278
- const button = shallow( <Button isSecondary /> ).find( 'button' );
279
- expect( button.hasClass( 'is-secondary' ) ).toBe( true );
317
+ render( <Button isSecondary /> );
318
+ expect( screen.getByRole( 'button' ) ).toHaveClass(
319
+ 'is-secondary'
320
+ );
280
321
  } );
281
322
 
282
323
  it( 'should not break when the legacy isTertiary prop is passed', () => {
283
- const button = shallow( <Button isTertiary /> ).find( 'button' );
284
- expect( button.hasClass( 'is-tertiary' ) ).toBe( true );
324
+ render( <Button isTertiary /> );
325
+ expect( screen.getByRole( 'button' ) ).toHaveClass( 'is-tertiary' );
285
326
  } );
286
327
 
287
328
  it( 'should not break when the legacy isLink prop is passed', () => {
288
- const button = shallow( <Button isLink /> ).find( 'button' );
289
- expect( button.hasClass( 'is-link' ) ).toBe( true );
329
+ render( <Button isLink /> );
330
+ expect( screen.getByRole( 'button' ) ).toHaveClass( 'is-link' );
290
331
  } );
291
332
 
292
333
  it( 'should warn when the isDefault prop is passed', () => {
293
- const button = shallow( <Button isDefault /> ).find( 'button' );
294
- expect( button.hasClass( 'is-secondary' ) ).toBe( true );
295
-
334
+ render( <Button isDefault /> );
335
+ expect( screen.getByRole( 'button' ) ).toHaveClass(
336
+ 'is-secondary'
337
+ );
296
338
  expect( console ).toHaveWarned();
297
339
  } );
298
340
  } );
@@ -2,6 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { css } from '@emotion/react';
5
+ import type { ForwardedRef } from 'react';
5
6
 
6
7
  /**
7
8
  * WordPress dependencies
@@ -11,19 +12,23 @@ import { useMemo } from '@wordpress/element';
11
12
  /**
12
13
  * Internal dependencies
13
14
  */
14
- import { contextConnect, ContextSystemProvider } from '../../ui/context';
15
+ import {
16
+ contextConnect,
17
+ ContextSystemProvider,
18
+ WordPressComponentProps,
19
+ } from '../../ui/context';
15
20
  import { Elevation } from '../../elevation';
16
21
  import { View } from '../../view';
17
22
  import * as styles from '../styles';
18
23
  import { useCard } from './hook';
19
24
  import CONFIG from '../../utils/config-values';
20
25
  import { useCx } from '../../utils/hooks/use-cx';
26
+ import type { Props } from '../types';
21
27
 
22
- /**
23
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div'>} props
24
- * @param {import('react').ForwardedRef<any>} forwardedRef
25
- */
26
- function Card( props, forwardedRef ) {
28
+ function UnconnectedCard(
29
+ props: WordPressComponentProps< Props, 'div' >,
30
+ forwardedRef: ForwardedRef< any >
31
+ ) {
27
32
  const {
28
33
  children,
29
34
  elevation,
@@ -77,7 +82,6 @@ function Card( props, forwardedRef ) {
77
82
  * `Card` also provides a convenient set of sub-components such as `CardBody`,
78
83
  * `CardHeader`, `CardFooter`, and more.
79
84
  *
80
- * @example
81
85
  * ```jsx
82
86
  * import {
83
87
  * Card,
@@ -105,6 +109,6 @@ function Card( props, forwardedRef ) {
105
109
  * }
106
110
  * ```
107
111
  */
108
- const ConnectedCard = contextConnect( Card, 'Card' );
112
+ export const Card = contextConnect( UnconnectedCard, 'Card' );
109
113
 
110
- export default ConnectedCard;
114
+ export default Card;
@@ -7,17 +7,20 @@ import { useMemo } from '@wordpress/element';
7
7
  /**
8
8
  * Internal dependencies
9
9
  */
10
- import { useContextSystem } from '../../ui/context';
10
+ import { useContextSystem, WordPressComponentProps } from '../../ui/context';
11
11
  import { useSurface } from '../../surface';
12
12
  import * as styles from '../styles';
13
13
  import { useCx } from '../../utils/hooks/use-cx';
14
+ import type { Props } from '../types';
14
15
 
15
- /**
16
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div'>} props
17
- */
18
- function useDeprecatedProps( { elevation, isElevated, ...otherProps } ) {
19
- /**@type {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div'>} */
20
- const propsToReturn = {
16
+ type CardProps = WordPressComponentProps< Props, 'div' >;
17
+
18
+ function useDeprecatedProps( {
19
+ elevation,
20
+ isElevated,
21
+ ...otherProps
22
+ }: CardProps ) {
23
+ const propsToReturn: Omit< CardProps, 'isElevated' > = {
21
24
  ...otherProps,
22
25
  };
23
26
  let computedElevation = elevation;
@@ -39,10 +42,7 @@ function useDeprecatedProps( { elevation, isElevated, ...otherProps } ) {
39
42
  return propsToReturn;
40
43
  }
41
44
 
42
- /**
43
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').Props, 'div'>} props
44
- */
45
- export function useCard( props ) {
45
+ export function useCard( props: CardProps ) {
46
46
  const {
47
47
  className,
48
48
  elevation = 0,
File without changes