@wordpress/components 28.1.0 → 28.3.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 (451) hide show
  1. package/CHANGELOG.md +179 -120
  2. package/build/animation/index.js.map +1 -1
  3. package/build/autocomplete/autocompleter-ui.js +1 -0
  4. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  5. package/build/autocomplete/index.js.map +1 -1
  6. package/build/base-control/index.js +14 -7
  7. package/build/base-control/index.js.map +1 -1
  8. package/build/border-box-control/border-box-control-visualizer/component.js +0 -4
  9. package/build/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  10. package/build/button/index.js +5 -3
  11. package/build/button/index.js.map +1 -1
  12. package/build/button/types.js.map +1 -1
  13. package/build/combobox-control/index.js +4 -1
  14. package/build/combobox-control/index.js.map +1 -1
  15. package/build/composite/current/index.js.map +1 -1
  16. package/build/custom-select-control-v2/custom-select.js +58 -36
  17. package/build/custom-select-control-v2/custom-select.js.map +1 -1
  18. package/build/custom-select-control-v2/default-component/index.js +0 -1
  19. package/build/custom-select-control-v2/default-component/index.js.map +1 -1
  20. package/build/custom-select-control-v2/item.js +2 -0
  21. package/build/custom-select-control-v2/item.js.map +1 -1
  22. package/build/custom-select-control-v2/legacy-component/index.js +33 -15
  23. package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
  24. package/build/custom-select-control-v2/styles.js +92 -65
  25. package/build/custom-select-control-v2/styles.js.map +1 -1
  26. package/build/custom-select-control-v2/types.js.map +1 -1
  27. package/build/date-time/date-time/index.js +3 -1
  28. package/build/date-time/date-time/index.js.map +1 -1
  29. package/build/date-time/index.js +7 -0
  30. package/build/date-time/index.js.map +1 -1
  31. package/build/date-time/time/index.js +62 -145
  32. package/build/date-time/time/index.js.map +1 -1
  33. package/build/date-time/time-input/index.js +159 -0
  34. package/build/date-time/time-input/index.js.map +1 -0
  35. package/build/date-time/types.js.map +1 -1
  36. package/build/date-time/utils.js +64 -0
  37. package/build/date-time/utils.js.map +1 -1
  38. package/build/disclosure/index.js +0 -1
  39. package/build/disclosure/index.js.map +1 -1
  40. package/build/divider/component.js +0 -1
  41. package/build/divider/component.js.map +1 -1
  42. package/build/divider/types.js.map +1 -1
  43. package/build/drop-zone/index.js +16 -79
  44. package/build/drop-zone/index.js.map +1 -1
  45. package/build/dropdown-menu/index.js +1 -0
  46. package/build/dropdown-menu/index.js.map +1 -1
  47. package/build/dropdown-menu-v2/index.js +0 -1
  48. package/build/dropdown-menu-v2/index.js.map +1 -1
  49. package/build/dropdown-menu-v2/styles.js +15 -16
  50. package/build/dropdown-menu-v2/styles.js.map +1 -1
  51. package/build/dropdown-menu-v2/types.js.map +1 -1
  52. package/build/font-size-picker/font-size-picker-select.js +2 -2
  53. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  54. package/build/font-size-picker/index.js +1 -1
  55. package/build/font-size-picker/index.js.map +1 -1
  56. package/build/font-size-picker/utils.js +0 -4
  57. package/build/font-size-picker/utils.js.map +1 -1
  58. package/build/form-token-field/token.js +4 -1
  59. package/build/form-token-field/token.js.map +1 -1
  60. package/build/higher-order/with-spoken-messages/index.js +1 -2
  61. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  62. package/build/lock-unlock.js +1 -1
  63. package/build/lock-unlock.js.map +1 -1
  64. package/build/menu-items-choice/types.js.map +1 -1
  65. package/build/palette-edit/index.js +30 -38
  66. package/build/palette-edit/index.js.map +1 -1
  67. package/build/palette-edit/types.js.map +1 -1
  68. package/build/popover/index.js +0 -4
  69. package/build/popover/index.js.map +1 -1
  70. package/build/popover/utils.js +0 -1
  71. package/build/popover/utils.js.map +1 -1
  72. package/build/private-apis.js +2 -4
  73. package/build/private-apis.js.map +1 -1
  74. package/build/progress-bar/styles.js +19 -13
  75. package/build/progress-bar/styles.js.map +1 -1
  76. package/build/radio-group/context.js +0 -1
  77. package/build/radio-group/context.js.map +1 -1
  78. package/build/radio-group/index.js +0 -1
  79. package/build/radio-group/index.js.map +1 -1
  80. package/build/radio-group/radio.js +0 -1
  81. package/build/radio-group/radio.js.map +1 -1
  82. package/build/range-control/index.js +4 -1
  83. package/build/range-control/index.js.map +1 -1
  84. package/build/range-control/styles/range-control-styles.js +34 -28
  85. package/build/range-control/styles/range-control-styles.js.map +1 -1
  86. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  87. package/build/select-control/index.js +1 -2
  88. package/build/select-control/index.js.map +1 -1
  89. package/build/select-control/styles/select-control-styles.js +13 -8
  90. package/build/select-control/styles/select-control-styles.js.map +1 -1
  91. package/build/tab-panel/index.js +0 -1
  92. package/build/tab-panel/index.js.map +1 -1
  93. package/build/tabs/index.js +0 -1
  94. package/build/tabs/index.js.map +1 -1
  95. package/build/tabs/styles.js +3 -5
  96. package/build/tabs/styles.js.map +1 -1
  97. package/build/tabs/tablist.js +148 -37
  98. package/build/tabs/tablist.js.map +1 -1
  99. package/build/tabs/types.js.map +1 -1
  100. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +0 -2
  101. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  102. package/build/toggle-group-control/toggle-group-control/component.js +0 -2
  103. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  104. package/build/toggle-group-control/toggle-group-control-option-base/component.js +0 -4
  105. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  106. package/build/toolbar/toolbar/toolbar-container.js +0 -1
  107. package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
  108. package/build/toolbar/toolbar/types.js.map +1 -1
  109. package/build/toolbar/toolbar-button/index.js +27 -19
  110. package/build/toolbar/toolbar-button/index.js.map +1 -1
  111. package/build/toolbar/toolbar-button/types.js.map +1 -1
  112. package/build/toolbar/toolbar-context/index.js +0 -1
  113. package/build/toolbar/toolbar-context/index.js.map +1 -1
  114. package/build/toolbar/toolbar-item/index.js +1 -1
  115. package/build/toolbar/toolbar-item/index.js.map +1 -1
  116. package/build/tooltip/index.js +3 -2
  117. package/build/tooltip/index.js.map +1 -1
  118. package/build/tooltip/types.js.map +1 -1
  119. package/build/unit-control/index.js +3 -3
  120. package/build/unit-control/index.js.map +1 -1
  121. package/build/unit-control/styles/unit-control-styles.js +7 -7
  122. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  123. package/build/utils/hooks/use-update-effect.js +4 -1
  124. package/build/utils/hooks/use-update-effect.js.map +1 -1
  125. package/build-module/animation/index.js +0 -1
  126. package/build-module/animation/index.js.map +1 -1
  127. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  128. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  129. package/build-module/autocomplete/index.js.map +1 -1
  130. package/build-module/base-control/index.js +13 -6
  131. package/build-module/base-control/index.js.map +1 -1
  132. package/build-module/border-box-control/border-box-control-visualizer/component.js +0 -4
  133. package/build-module/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  134. package/build-module/button/index.js +5 -3
  135. package/build-module/button/index.js.map +1 -1
  136. package/build-module/button/types.js.map +1 -1
  137. package/build-module/combobox-control/index.js +4 -1
  138. package/build-module/combobox-control/index.js.map +1 -1
  139. package/build-module/composite/current/index.js +0 -3
  140. package/build-module/composite/current/index.js.map +1 -1
  141. package/build-module/custom-select-control-v2/custom-select.js +59 -38
  142. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  143. package/build-module/custom-select-control-v2/default-component/index.js +0 -1
  144. package/build-module/custom-select-control-v2/default-component/index.js.map +1 -1
  145. package/build-module/custom-select-control-v2/item.js +2 -0
  146. package/build-module/custom-select-control-v2/item.js.map +1 -1
  147. package/build-module/custom-select-control-v2/legacy-component/index.js +33 -16
  148. package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
  149. package/build-module/custom-select-control-v2/styles.js +90 -63
  150. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  151. package/build-module/custom-select-control-v2/types.js.map +1 -1
  152. package/build-module/date-time/date-time/index.js +4 -1
  153. package/build-module/date-time/date-time/index.js.map +1 -1
  154. package/build-module/date-time/index.js +2 -1
  155. package/build-module/date-time/index.js.map +1 -1
  156. package/build-module/date-time/time/index.js +65 -149
  157. package/build-module/date-time/time/index.js.map +1 -1
  158. package/build-module/date-time/time-input/index.js +151 -0
  159. package/build-module/date-time/time-input/index.js.map +1 -0
  160. package/build-module/date-time/types.js.map +1 -1
  161. package/build-module/date-time/utils.js +61 -0
  162. package/build-module/date-time/utils.js.map +1 -1
  163. package/build-module/disclosure/index.js +0 -1
  164. package/build-module/disclosure/index.js.map +1 -1
  165. package/build-module/divider/component.js +0 -1
  166. package/build-module/divider/component.js.map +1 -1
  167. package/build-module/divider/types.js.map +1 -1
  168. package/build-module/drop-zone/index.js +17 -80
  169. package/build-module/drop-zone/index.js.map +1 -1
  170. package/build-module/dropdown-menu/index.js +1 -0
  171. package/build-module/dropdown-menu/index.js.map +1 -1
  172. package/build-module/dropdown-menu-v2/index.js +0 -1
  173. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  174. package/build-module/dropdown-menu-v2/styles.js +14 -15
  175. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  176. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  177. package/build-module/font-size-picker/font-size-picker-select.js +1 -1
  178. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  179. package/build-module/font-size-picker/index.js +1 -1
  180. package/build-module/font-size-picker/index.js.map +1 -1
  181. package/build-module/font-size-picker/utils.js +0 -4
  182. package/build-module/font-size-picker/utils.js.map +1 -1
  183. package/build-module/form-token-field/token.js +4 -1
  184. package/build-module/form-token-field/token.js.map +1 -1
  185. package/build-module/higher-order/with-spoken-messages/index.js +1 -2
  186. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  187. package/build-module/lock-unlock.js +1 -1
  188. package/build-module/lock-unlock.js.map +1 -1
  189. package/build-module/menu-items-choice/types.js.map +1 -1
  190. package/build-module/palette-edit/index.js +31 -39
  191. package/build-module/palette-edit/index.js.map +1 -1
  192. package/build-module/palette-edit/types.js.map +1 -1
  193. package/build-module/popover/index.js +0 -3
  194. package/build-module/popover/index.js.map +1 -1
  195. package/build-module/popover/utils.js +0 -1
  196. package/build-module/popover/utils.js.map +1 -1
  197. package/build-module/private-apis.js +2 -4
  198. package/build-module/private-apis.js.map +1 -1
  199. package/build-module/progress-bar/styles.js +21 -13
  200. package/build-module/progress-bar/styles.js.map +1 -1
  201. package/build-module/radio-group/context.js +0 -1
  202. package/build-module/radio-group/context.js.map +1 -1
  203. package/build-module/radio-group/index.js +0 -1
  204. package/build-module/radio-group/index.js.map +1 -1
  205. package/build-module/radio-group/radio.js +0 -1
  206. package/build-module/radio-group/radio.js.map +1 -1
  207. package/build-module/range-control/index.js +4 -1
  208. package/build-module/range-control/index.js.map +1 -1
  209. package/build-module/range-control/styles/range-control-styles.js +34 -28
  210. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  211. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  212. package/build-module/select-control/index.js +2 -3
  213. package/build-module/select-control/index.js.map +1 -1
  214. package/build-module/select-control/styles/select-control-styles.js +12 -7
  215. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  216. package/build-module/tab-panel/index.js +0 -1
  217. package/build-module/tab-panel/index.js.map +1 -1
  218. package/build-module/tabs/index.js +0 -1
  219. package/build-module/tabs/index.js.map +1 -1
  220. package/build-module/tabs/styles.js +3 -4
  221. package/build-module/tabs/styles.js.map +1 -1
  222. package/build-module/tabs/tablist.js +149 -38
  223. package/build-module/tabs/tablist.js.map +1 -1
  224. package/build-module/tabs/types.js.map +1 -1
  225. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +0 -1
  226. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  227. package/build-module/toggle-group-control/toggle-group-control/component.js +0 -1
  228. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  229. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +0 -2
  230. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  231. package/build-module/toolbar/toolbar/toolbar-container.js +0 -1
  232. package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
  233. package/build-module/toolbar/toolbar/types.js.map +1 -1
  234. package/build-module/toolbar/toolbar-button/index.js +27 -19
  235. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  236. package/build-module/toolbar/toolbar-button/types.js.map +1 -1
  237. package/build-module/toolbar/toolbar-context/index.js +0 -1
  238. package/build-module/toolbar/toolbar-context/index.js.map +1 -1
  239. package/build-module/toolbar/toolbar-item/index.js +1 -1
  240. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  241. package/build-module/tooltip/index.js +3 -2
  242. package/build-module/tooltip/index.js.map +1 -1
  243. package/build-module/tooltip/types.js.map +1 -1
  244. package/build-module/unit-control/index.js +3 -3
  245. package/build-module/unit-control/index.js.map +1 -1
  246. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  247. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  248. package/build-module/utils/hooks/use-update-effect.js +4 -1
  249. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  250. package/build-style/style-rtl.css +46 -6
  251. package/build-style/style.css +46 -6
  252. package/build-types/animation/index.d.ts.map +1 -1
  253. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  254. package/build-types/autocomplete/index.d.ts.map +1 -1
  255. package/build-types/base-control/index.d.ts +6 -20
  256. package/build-types/base-control/index.d.ts.map +1 -1
  257. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  258. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
  259. package/build-types/button/deprecated.d.ts +4 -4
  260. package/build-types/button/index.d.ts.map +1 -1
  261. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  262. package/build-types/button/types.d.ts +27 -10
  263. package/build-types/button/types.d.ts.map +1 -1
  264. package/build-types/combobox-control/index.d.ts.map +1 -1
  265. package/build-types/composite/current/index.d.ts.map +1 -1
  266. package/build-types/custom-select-control/stories/index.story.d.ts +15 -0
  267. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  268. package/build-types/custom-select-control-v2/custom-select.d.ts +2 -2
  269. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  270. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
  271. package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
  272. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  273. package/build-types/custom-select-control-v2/stories/default.story.d.ts +6 -3
  274. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
  275. package/build-types/custom-select-control-v2/styles.d.ts +18 -22
  276. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  277. package/build-types/custom-select-control-v2/types.d.ts +13 -2
  278. package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
  279. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  280. package/build-types/date-time/index.d.ts +2 -1
  281. package/build-types/date-time/index.d.ts.map +1 -1
  282. package/build-types/date-time/stories/time-input.story.d.ts +12 -0
  283. package/build-types/date-time/stories/time-input.story.d.ts.map +1 -0
  284. package/build-types/date-time/time/index.d.ts +1 -1
  285. package/build-types/date-time/time/index.d.ts.map +1 -1
  286. package/build-types/date-time/time-input/index.d.ts +5 -0
  287. package/build-types/date-time/time-input/index.d.ts.map +1 -0
  288. package/build-types/date-time/time-input/test/index.d.ts +2 -0
  289. package/build-types/date-time/time-input/test/index.d.ts.map +1 -0
  290. package/build-types/date-time/types.d.ts +54 -0
  291. package/build-types/date-time/types.d.ts.map +1 -1
  292. package/build-types/date-time/utils.d.ts +40 -0
  293. package/build-types/date-time/utils.d.ts.map +1 -1
  294. package/build-types/disclosure/index.d.ts.map +1 -1
  295. package/build-types/divider/component.d.ts.map +1 -1
  296. package/build-types/divider/types.d.ts.map +1 -1
  297. package/build-types/drop-zone/index.d.ts +3 -0
  298. package/build-types/drop-zone/index.d.ts.map +1 -1
  299. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  300. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  301. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  302. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  303. package/build-types/font-size-picker/styles.d.ts +1 -1
  304. package/build-types/font-size-picker/utils.d.ts.map +1 -1
  305. package/build-types/form-token-field/token.d.ts.map +1 -1
  306. package/build-types/higher-order/with-spoken-messages/index.d.ts +1 -2
  307. package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
  308. package/build-types/menu-items-choice/types.d.ts +1 -1
  309. package/build-types/menu-items-choice/types.d.ts.map +1 -1
  310. package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
  311. package/build-types/navigator/navigator-back-button/hook.d.ts +1 -1
  312. package/build-types/navigator/navigator-button/component.d.ts +1 -1
  313. package/build-types/navigator/navigator-button/hook.d.ts +1 -1
  314. package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -1
  315. package/build-types/palette-edit/index.d.ts.map +1 -1
  316. package/build-types/palette-edit/types.d.ts +1 -3
  317. package/build-types/palette-edit/types.d.ts.map +1 -1
  318. package/build-types/popover/index.d.ts.map +1 -1
  319. package/build-types/popover/utils.d.ts.map +1 -1
  320. package/build-types/private-apis.d.ts.map +1 -1
  321. package/build-types/progress-bar/styles.d.ts.map +1 -1
  322. package/build-types/radio-group/context.d.ts.map +1 -1
  323. package/build-types/radio-group/index.d.ts.map +1 -1
  324. package/build-types/radio-group/radio.d.ts.map +1 -1
  325. package/build-types/range-control/index.d.ts.map +1 -1
  326. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  327. package/build-types/resizable-box/resize-tooltip/utils.d.ts +2 -2
  328. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  329. package/build-types/select-control/index.d.ts.map +1 -1
  330. package/build-types/select-control/styles/select-control-styles.d.ts +5 -0
  331. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  332. package/build-types/tab-panel/index.d.ts.map +1 -1
  333. package/build-types/tabs/index.d.ts.map +1 -1
  334. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  335. package/build-types/tabs/styles.d.ts.map +1 -1
  336. package/build-types/tabs/tablist.d.ts.map +1 -1
  337. package/build-types/tabs/types.d.ts.map +1 -1
  338. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  339. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  340. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  341. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  342. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  343. package/build-types/toolbar/toolbar/types.d.ts +6 -0
  344. package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
  345. package/build-types/toolbar/toolbar-button/index.d.ts +3 -96
  346. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  347. package/build-types/toolbar/toolbar-button/types.d.ts +18 -0
  348. package/build-types/toolbar/toolbar-button/types.d.ts.map +1 -1
  349. package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
  350. package/build-types/toolbar/toolbar-item/index.d.ts +1 -3
  351. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  352. package/build-types/tooltip/index.d.ts.map +1 -1
  353. package/build-types/tooltip/types.d.ts +4 -0
  354. package/build-types/tooltip/types.d.ts.map +1 -1
  355. package/build-types/unit-control/index.d.ts.map +1 -1
  356. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  357. package/build-types/utils/hooks/use-update-effect.d.ts +1 -1
  358. package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
  359. package/package.json +19 -19
  360. package/src/animation/index.tsx +0 -1
  361. package/src/autocomplete/autocompleter-ui.tsx +1 -0
  362. package/src/autocomplete/index.tsx +0 -1
  363. package/src/base-control/index.tsx +16 -6
  364. package/src/base-control/stories/index.story.tsx +0 -1
  365. package/src/border-box-control/border-box-control-visualizer/component.tsx +0 -5
  366. package/src/button/README.md +13 -0
  367. package/src/button/index.tsx +6 -4
  368. package/src/button/stories/e2e/index.story.tsx +2 -1
  369. package/src/button/test/index.tsx +17 -2
  370. package/src/button/types.ts +27 -10
  371. package/src/combobox-control/index.tsx +2 -0
  372. package/src/composite/current/index.ts +0 -2
  373. package/src/custom-select-control/stories/index.story.tsx +32 -3
  374. package/src/custom-select-control/test/index.js +247 -28
  375. package/src/custom-select-control-v2/custom-select.tsx +58 -23
  376. package/src/custom-select-control-v2/default-component/index.tsx +0 -1
  377. package/src/custom-select-control-v2/item.tsx +5 -1
  378. package/src/custom-select-control-v2/legacy-component/index.tsx +45 -16
  379. package/src/custom-select-control-v2/legacy-component/test/index.tsx +261 -43
  380. package/src/custom-select-control-v2/styles.ts +156 -74
  381. package/src/custom-select-control-v2/test/index.tsx +35 -5
  382. package/src/custom-select-control-v2/types.ts +19 -6
  383. package/src/date-time/README.md +8 -0
  384. package/src/date-time/date-time/index.tsx +2 -1
  385. package/src/date-time/index.ts +2 -1
  386. package/src/date-time/stories/time-input.story.tsx +36 -0
  387. package/src/date-time/time/index.tsx +77 -194
  388. package/src/date-time/time/test/index.tsx +61 -0
  389. package/src/date-time/time-input/index.tsx +196 -0
  390. package/src/date-time/time-input/test/index.tsx +171 -0
  391. package/src/date-time/types.ts +63 -0
  392. package/src/date-time/utils.ts +69 -0
  393. package/src/dimension-control/test/__snapshots__/index.test.js.snap +116 -96
  394. package/src/disclosure/index.tsx +0 -1
  395. package/src/divider/component.tsx +0 -1
  396. package/src/divider/types.ts +0 -1
  397. package/src/drop-zone/index.tsx +17 -76
  398. package/src/drop-zone/style.scss +51 -16
  399. package/src/dropdown-menu/index.tsx +1 -0
  400. package/src/dropdown-menu-v2/index.tsx +0 -1
  401. package/src/dropdown-menu-v2/styles.ts +0 -1
  402. package/src/dropdown-menu-v2/types.ts +0 -1
  403. package/src/font-size-picker/font-size-picker-select.tsx +1 -1
  404. package/src/font-size-picker/index.tsx +1 -1
  405. package/src/font-size-picker/test/index.tsx +6 -6
  406. package/src/font-size-picker/utils.ts +0 -5
  407. package/src/form-token-field/token.tsx +2 -0
  408. package/src/higher-order/navigate-regions/style.scss +25 -13
  409. package/src/higher-order/with-spoken-messages/index.tsx +1 -2
  410. package/src/lock-unlock.js +1 -1
  411. package/src/menu-items-choice/types.ts +2 -1
  412. package/src/palette-edit/index.tsx +33 -45
  413. package/src/palette-edit/test/index.tsx +3 -4
  414. package/src/palette-edit/types.ts +1 -3
  415. package/src/popover/index.tsx +0 -2
  416. package/src/popover/utils.ts +0 -1
  417. package/src/private-apis.ts +2 -5
  418. package/src/progress-bar/styles.ts +18 -9
  419. package/src/radio-group/context.tsx +0 -1
  420. package/src/radio-group/index.tsx +0 -1
  421. package/src/radio-group/radio.tsx +0 -1
  422. package/src/range-control/index.tsx +2 -0
  423. package/src/range-control/styles/range-control-styles.ts +6 -2
  424. package/src/resizable-box/resize-tooltip/utils.ts +1 -1
  425. package/src/select-control/index.tsx +3 -4
  426. package/src/select-control/styles/select-control-styles.ts +17 -6
  427. package/src/tab-panel/index.tsx +0 -1
  428. package/src/tabs/index.tsx +0 -1
  429. package/src/tabs/stories/index.story.tsx +25 -18
  430. package/src/tabs/styles.ts +18 -14
  431. package/src/tabs/tablist.tsx +187 -43
  432. package/src/tabs/types.ts +0 -1
  433. package/src/theme/stories/index.story.tsx +2 -0
  434. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +0 -1
  435. package/src/toggle-group-control/toggle-group-control/component.tsx +0 -2
  436. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +0 -2
  437. package/src/toolbar/toolbar/README.md +9 -0
  438. package/src/toolbar/toolbar/style.scss +7 -0
  439. package/src/toolbar/toolbar/toolbar-container.tsx +0 -1
  440. package/src/toolbar/toolbar/types.ts +6 -0
  441. package/src/toolbar/toolbar-button/index.tsx +30 -17
  442. package/src/toolbar/toolbar-button/types.ts +19 -0
  443. package/src/toolbar/toolbar-context/index.ts +0 -1
  444. package/src/toolbar/toolbar-item/index.tsx +1 -1
  445. package/src/tooltip/index.tsx +3 -2
  446. package/src/tooltip/test/index.tsx +18 -0
  447. package/src/tooltip/types.ts +4 -0
  448. package/src/unit-control/index.tsx +3 -2
  449. package/src/unit-control/styles/unit-control-styles.ts +10 -4
  450. package/src/utils/hooks/use-update-effect.js +8 -1
  451. package/tsconfig.tsbuildinfo +1 -1
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- // eslint-disable-next-line no-restricted-imports
5
4
  import * as Ariakit from '@ariakit/react';
6
5
  import { css } from '@emotion/react';
7
6
  import styled from '@emotion/styled';
@@ -10,113 +9,196 @@ import styled from '@emotion/styled';
10
9
  */
11
10
  import { COLORS, CONFIG } from '../utils';
12
11
  import { space } from '../utils/space';
12
+ import { chevronIconSize } from '../select-control/styles/select-control-styles';
13
+ import { fontSizeStyles } from '../input-control/styles/input-control-styles';
13
14
  import type { CustomSelectButtonSize } from './types';
14
15
 
15
- const ITEM_PADDING = space( 2 );
16
+ const INLINE_PADDING = {
17
+ compact: 8, // space(2)
18
+ small: 8, // space(2)
19
+ default: 16, // space(4)
20
+ };
16
21
 
17
- export const WithHintWrapper = styled.div`
18
- display: flex;
19
- justify-content: space-between;
20
- flex: 1;
21
- `;
22
+ const getSelectSize = (
23
+ size: NonNullable< CustomSelectButtonSize[ 'size' ] >,
24
+ heightProperty: 'minHeight' | 'height'
25
+ ) => {
26
+ const sizes = {
27
+ compact: {
28
+ [ heightProperty ]: 32,
29
+ paddingInlineStart: INLINE_PADDING.compact,
30
+ paddingInlineEnd: INLINE_PADDING.compact + chevronIconSize,
31
+ },
32
+ default: {
33
+ [ heightProperty ]: 40,
34
+ paddingInlineStart: INLINE_PADDING.default,
35
+ paddingInlineEnd: INLINE_PADDING.default + chevronIconSize,
36
+ },
37
+ small: {
38
+ [ heightProperty ]: 24,
39
+ paddingInlineStart: INLINE_PADDING.small,
40
+ paddingInlineEnd: INLINE_PADDING.small + chevronIconSize,
41
+ },
42
+ };
22
43
 
23
- export const SelectedExperimentalHintItem = styled.span`
24
- color: ${ COLORS.theme.gray[ 600 ] };
25
- margin-inline-start: ${ space( 2 ) };
26
- `;
44
+ return sizes[ size ] || sizes.default;
45
+ };
27
46
 
28
- export const ExperimentalHintItem = styled.span`
29
- color: ${ COLORS.theme.gray[ 600 ] };
30
- text-align: right;
31
- margin-inline-end: ${ space( 1 ) };
32
- `;
47
+ const getSelectItemSize = (
48
+ size: NonNullable< CustomSelectButtonSize[ 'size' ] >
49
+ ) => {
50
+ // Used to visually align the checkmark with the chevron
51
+ const checkmarkCorrection = 6;
52
+ const sizes = {
53
+ compact: {
54
+ paddingInlineStart: INLINE_PADDING.compact,
55
+ paddingInlineEnd: INLINE_PADDING.compact - checkmarkCorrection,
56
+ },
57
+ default: {
58
+ paddingInlineStart: INLINE_PADDING.default,
59
+ paddingInlineEnd: INLINE_PADDING.default - checkmarkCorrection,
60
+ },
61
+ small: {
62
+ paddingInlineStart: INLINE_PADDING.small,
63
+ paddingInlineEnd: INLINE_PADDING.small - checkmarkCorrection,
64
+ },
65
+ };
33
66
 
34
- export const SelectLabel = styled( Ariakit.SelectLabel )`
35
- font-size: 11px;
36
- font-weight: 500;
37
- line-height: 1.4;
38
- text-transform: uppercase;
39
- margin-bottom: ${ space( 2 ) };
40
- `;
67
+ return sizes[ size ] || sizes.default;
68
+ };
41
69
 
42
70
  export const Select = styled( Ariakit.Select, {
43
71
  // Do not forward `hasCustomRenderProp` to the underlying Ariakit.Select component
44
72
  shouldForwardProp: ( prop ) => prop !== 'hasCustomRenderProp',
45
- } )( ( {
46
- size,
47
- hasCustomRenderProp,
48
- }: {
49
- size: NonNullable< CustomSelectButtonSize[ 'size' ] >;
50
- hasCustomRenderProp: boolean;
51
- } ) => {
52
- const heightProperty = hasCustomRenderProp ? 'minHeight' : 'height';
53
-
54
- const getSize = () => {
55
- const sizes = {
56
- compact: {
57
- [ heightProperty ]: 32,
58
- paddingInlineStart: space( 2 ),
59
- paddingInlineEnd: space( 1 ),
60
- },
61
- default: {
62
- [ heightProperty ]: 40,
63
- paddingInlineStart: space( 4 ),
64
- paddingInlineEnd: space( 3 ),
65
- },
66
- small: {
67
- [ heightProperty ]: 24,
68
- paddingInlineStart: space( 2 ),
69
- paddingInlineEnd: space( 1 ),
70
- fontSize: 11,
71
- },
72
- };
73
-
74
- return sizes[ size ] || sizes.default;
75
- };
76
-
77
- return css`
78
- display: flex;
79
- align-items: center;
80
- justify-content: space-between;
73
+ } )(
74
+ ( {
75
+ size,
76
+ hasCustomRenderProp,
77
+ }: {
78
+ size: NonNullable< CustomSelectButtonSize[ 'size' ] >;
79
+ hasCustomRenderProp: boolean;
80
+ } ) => css`
81
+ display: block;
81
82
  background-color: ${ COLORS.theme.background };
82
83
  border: none;
84
+ color: ${ COLORS.theme.foreground };
83
85
  cursor: pointer;
84
- font-size: ${ CONFIG.fontSize };
86
+ font-family: inherit;
87
+ text-align: start;
88
+ user-select: none;
85
89
  width: 100%;
86
90
 
87
91
  &[data-focus-visible] {
88
92
  outline: none; // handled by InputBase component
89
93
  }
90
94
 
91
- ${ getSize() }
92
- `;
93
- } );
95
+ ${ getSelectSize( size, hasCustomRenderProp ? 'minHeight' : 'height' ) }
96
+ ${ ! hasCustomRenderProp && truncateStyles }
97
+ ${ fontSizeStyles( { inputSize: size } ) }
98
+ `
99
+ );
94
100
 
95
101
  export const SelectPopover = styled( Ariakit.SelectPopover )`
102
+ display: flex;
103
+ flex-direction: column;
104
+
105
+ background-color: ${ COLORS.theme.background };
96
106
  border-radius: 2px;
97
- background: ${ COLORS.theme.background };
98
107
  border: 1px solid ${ COLORS.theme.foreground };
99
108
 
109
+ /* z-index(".components-popover") */
110
+ z-index: 1000000;
111
+
112
+ max-height: min( var( --popover-available-height, 400px ), 400px );
113
+ overflow: auto;
114
+ overscroll-behavior: contain;
115
+
116
+ // The smallest size without overflowing the container.
117
+ min-width: min-content;
118
+
100
119
  &[data-focus-visible] {
101
120
  outline: none; // outline will be on the trigger, rather than the popover
102
121
  }
103
122
  `;
104
123
 
105
- export const SelectItem = styled( Ariakit.SelectItem )`
124
+ export const SelectItem = styled( Ariakit.SelectItem )(
125
+ ( {
126
+ size,
127
+ }: {
128
+ size: NonNullable< CustomSelectButtonSize[ 'size' ] >;
129
+ } ) => css`
130
+ cursor: default;
131
+ display: flex;
132
+ align-items: center;
133
+ justify-content: space-between;
134
+ font-size: ${ CONFIG.fontSize };
135
+ // TODO: reassess line-height for non-legacy v2
136
+ line-height: 28px;
137
+ padding-block: ${ space( 2 ) };
138
+ scroll-margin: ${ space( 1 ) };
139
+ user-select: none;
140
+
141
+ &[aria-disabled='true'] {
142
+ cursor: not-allowed;
143
+ }
144
+
145
+ &[data-active-item] {
146
+ background-color: ${ COLORS.theme.gray[ 300 ] };
147
+ }
148
+
149
+ ${ getSelectItemSize( size ) }
150
+ `
151
+ );
152
+
153
+ const truncateStyles = css`
154
+ overflow: hidden;
155
+ text-overflow: ellipsis;
156
+ white-space: nowrap;
157
+ `;
158
+
159
+ export const SelectedExperimentalHintWrapper = styled.div`
160
+ ${ truncateStyles }
161
+ `;
162
+
163
+ export const SelectedExperimentalHintItem = styled.span`
164
+ color: ${ COLORS.theme.gray[ 600 ] };
165
+ margin-inline-start: ${ space( 2 ) };
166
+ `;
167
+
168
+ export const WithHintItemWrapper = styled.div`
106
169
  display: flex;
107
- align-items: center;
108
170
  justify-content: space-between;
109
- padding: ${ ITEM_PADDING };
110
- font-size: ${ CONFIG.fontSize };
111
- line-height: 2.15rem; // TODO: Remove this in default but keep for back-compat in legacy
112
- &[data-active-item] {
113
- background-color: ${ COLORS.theme.gray[ 300 ] };
114
- }
171
+ align-items: center;
172
+ flex-wrap: wrap;
173
+ flex: 1;
174
+ column-gap: ${ space( 4 ) };
175
+ `;
176
+
177
+ export const WithHintItemHint = styled.span`
178
+ color: ${ COLORS.theme.gray[ 600 ] };
179
+ text-align: initial;
180
+ line-height: ${ CONFIG.fontLineHeightBase };
181
+ padding-inline-end: ${ space( 1 ) };
182
+ margin-block: ${ space( 1 ) };
115
183
  `;
116
184
 
117
185
  export const SelectedItemCheck = styled( Ariakit.SelectItemCheck )`
118
186
  display: flex;
119
187
  align-items: center;
120
- margin-inline-start: ${ ITEM_PADDING };
121
- font-size: 24px; // Size of checkmark icon
188
+ margin-inline-start: ${ space( 2 ) };
189
+
190
+ // Keep the checkmark vertically aligned at the top. Since the item text has a
191
+ // 28px line height and the checkmark is 24px tall, a (28-24)/2 = 2px margin
192
+ // is applied to keep the correct alignment between the text and the checkmark.
193
+ align-self: start;
194
+ margin-block-start: 2px;
195
+
196
+ // Since the checkmark's dimensions are applied with 'em' units, setting a
197
+ // font size of 0 allows the space reserved for the checkmark to collapse for
198
+ // items that are not selected or that don't have an associated item hint.
199
+ font-size: 0;
200
+ ${ WithHintItemWrapper } ~ &,
201
+ &:not(:empty) {
202
+ font-size: 24px; // Size of checkmark icon
203
+ }
122
204
  `;
@@ -105,14 +105,14 @@ describe.each( [
105
105
  await press.Enter();
106
106
  expect(
107
107
  screen.getByRole( 'listbox', {
108
- name: 'label!',
108
+ name: defaultProps.label,
109
109
  } )
110
110
  ).toBeVisible();
111
111
 
112
112
  await press.Escape();
113
113
  expect(
114
114
  screen.queryByRole( 'listbox', {
115
- name: 'label!',
115
+ name: defaultProps.label,
116
116
  } )
117
117
  ).not.toBeInTheDocument();
118
118
 
@@ -134,7 +134,7 @@ describe.each( [
134
134
  await press.Enter();
135
135
  expect(
136
136
  screen.getByRole( 'listbox', {
137
- name: 'label!',
137
+ name: defaultProps.label,
138
138
  } )
139
139
  ).toHaveFocus();
140
140
 
@@ -156,7 +156,7 @@ describe.each( [
156
156
  await press.Enter();
157
157
  expect(
158
158
  screen.getByRole( 'listbox', {
159
- name: 'label!',
159
+ name: defaultProps.label,
160
160
  } )
161
161
  ).toHaveFocus();
162
162
 
@@ -182,7 +182,7 @@ describe.each( [
182
182
 
183
183
  expect(
184
184
  screen.queryByRole( 'listbox', {
185
- name: 'label!',
185
+ name: defaultProps.label,
186
186
  hidden: true,
187
187
  } )
188
188
  ).not.toBeInTheDocument();
@@ -416,4 +416,34 @@ describe.each( [
416
416
  screen.getByRole( 'option', { name: 'july-9' } )
417
417
  ).toBeVisible();
418
418
  } );
419
+
420
+ it( 'Should open the select popover when focussing the trigger button and pressing arrow down', async () => {
421
+ render( <Component { ...defaultProps } /> );
422
+
423
+ const currentSelectedItem = screen.getByRole( 'combobox', {
424
+ expanded: false,
425
+ } );
426
+
427
+ await sleep();
428
+ await press.Tab();
429
+ expect( currentSelectedItem ).toHaveFocus();
430
+ expect( currentSelectedItem ).toHaveTextContent( items[ 0 ].value );
431
+
432
+ await press.ArrowDown();
433
+ expect(
434
+ screen.getByRole( 'listbox', {
435
+ name: defaultProps.label,
436
+ } )
437
+ ).toBeVisible();
438
+ } );
439
+
440
+ it( 'Should label the component correctly even when the label is not visible', () => {
441
+ render( <Component { ...defaultProps } hideLabelFromVision /> );
442
+
443
+ expect(
444
+ screen.getByRole( 'combobox', {
445
+ name: defaultProps.label,
446
+ } )
447
+ ).toBeVisible();
448
+ } );
419
449
  } );
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- // eslint-disable-next-line no-restricted-imports
5
4
  import type * as Ariakit from '@ariakit/react';
6
5
  import type { FocusEventHandler, MouseEventHandler } from 'react';
7
6
 
@@ -12,8 +11,6 @@ export type CustomSelectStore = {
12
11
  store: Ariakit.SelectStore;
13
12
  };
14
13
 
15
- export type CustomSelectContext = CustomSelectStore | undefined;
16
-
17
14
  type CustomSelectSize< Size = 'compact' | 'default' > = {
18
15
  /**
19
16
  * The size of the control.
@@ -27,6 +24,10 @@ export type CustomSelectButtonSize = CustomSelectSize<
27
24
  'compact' | 'default' | 'small'
28
25
  >;
29
26
 
27
+ export type CustomSelectContext =
28
+ | ( CustomSelectStore & CustomSelectButtonSize )
29
+ | undefined;
30
+
30
31
  export type CustomSelectButtonProps = {
31
32
  /**
32
33
  * An optional default value for the control when used in uncontrolled mode.
@@ -49,7 +50,20 @@ export type CustomSelectButtonProps = {
49
50
  value?: string | string[];
50
51
  };
51
52
 
53
+ // Props only exposed on the internal implementation
54
+ export type _CustomSelectInternalProps = {
55
+ /**
56
+ * True if the consumer is emulating the legacy component behavior and look
57
+ */
58
+ isLegacy?: boolean;
59
+ };
60
+
61
+ // Props that are exposed in exported components
52
62
  export type _CustomSelectProps = CustomSelectButtonProps & {
63
+ /**
64
+ * Additional className added to the root wrapper element.
65
+ */
66
+ className?: string;
53
67
  /**
54
68
  * The child elements. This should be composed of `CustomSelectItem` components.
55
69
  */
@@ -66,9 +80,7 @@ export type _CustomSelectProps = CustomSelectButtonProps & {
66
80
  label: string;
67
81
  };
68
82
 
69
- export type CustomSelectProps = _CustomSelectProps &
70
- CustomSelectButtonProps &
71
- CustomSelectSize;
83
+ export type CustomSelectProps = _CustomSelectProps & CustomSelectSize;
72
84
 
73
85
  /**
74
86
  * The legacy object structure for the options array.
@@ -79,6 +91,7 @@ type LegacyOption = {
79
91
  style?: React.CSSProperties;
80
92
  className?: string;
81
93
  __experimentalHint?: string;
94
+ [ key: string ]: any;
82
95
  };
83
96
 
84
97
  /**
@@ -56,6 +56,14 @@ Whether we use a 12-hour clock. With a 12-hour clock, an AM/PM widget is display
56
56
  - Required: No
57
57
  - Default: false
58
58
 
59
+ ### `dateOrder`: `'dmy' | 'mdy' | 'ymd'`
60
+
61
+ The order of day, month, and year. This prop overrides the time format determined by `is12Hour` prop.
62
+
63
+ - Type: `string`
64
+ - Required: No
65
+ - Default: `'dmy'`
66
+
59
67
  ### `isInvalidDate`: `( date: Date ) => boolean`
60
68
 
61
69
  A callback function which receives a Date object representing a day as an argument, and should return a Boolean to signify if the day is valid or not.
@@ -7,7 +7,6 @@ import type { ForwardedRef } from 'react';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { forwardRef } from '@wordpress/element';
10
- import { __, _x } from '@wordpress/i18n';
11
10
 
12
11
  /**
13
12
  * Internal dependencies
@@ -25,6 +24,7 @@ function UnforwardedDateTimePicker(
25
24
  {
26
25
  currentDate,
27
26
  is12Hour,
27
+ dateOrder,
28
28
  isInvalidDate,
29
29
  onMonthPreviewed = noop,
30
30
  onChange,
@@ -40,6 +40,7 @@ function UnforwardedDateTimePicker(
40
40
  currentTime={ currentDate }
41
41
  onChange={ onChange }
42
42
  is12Hour={ is12Hour }
43
+ dateOrder={ dateOrder }
43
44
  />
44
45
  <DatePicker
45
46
  currentDate={ currentDate }
@@ -3,7 +3,8 @@
3
3
  */
4
4
  import { default as DatePicker } from './date';
5
5
  import { default as TimePicker } from './time';
6
+ import { default as TimeInput } from './time-input';
6
7
  import { default as DateTimePicker } from './date-time';
7
8
 
8
- export { DatePicker, TimePicker };
9
+ export { DatePicker, TimePicker, TimeInput };
9
10
  export default DateTimePicker;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { Meta, StoryFn } from '@storybook/react';
5
+ import { action } from '@storybook/addon-actions';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { TimeInput } from '../time-input';
11
+
12
+ const meta: Meta< typeof TimeInput > = {
13
+ title: 'Components/TimeInput',
14
+ component: TimeInput,
15
+ argTypes: {
16
+ onChange: { action: 'onChange', control: { type: null } },
17
+ },
18
+ tags: [ 'status-wip' ],
19
+ parameters: {
20
+ controls: { expanded: true },
21
+ docs: { canvas: { sourceState: 'shown' } },
22
+ },
23
+ args: {
24
+ onChange: action( 'onChange' ),
25
+ },
26
+ };
27
+ export default meta;
28
+
29
+ const Template: StoryFn< typeof TimeInput > = ( args ) => {
30
+ return <TimeInput { ...args } />;
31
+ };
32
+
33
+ export const Default: StoryFn< typeof TimeInput > = Template.bind( {} );
34
+ Default.args = {
35
+ label: 'Time',
36
+ };