@wordpress/components 19.15.0 → 20.0.1-next.d6164808d3.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 (1147) hide show
  1. package/CHANGELOG.md +154 -0
  2. package/build/alignment-matrix-control/index.js +1 -1
  3. package/build/alignment-matrix-control/index.js.map +1 -1
  4. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  5. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  6. package/build/angle-picker-control/index.js +5 -2
  7. package/build/angle-picker-control/index.js.map +1 -1
  8. package/build/angle-picker-control/styles/angle-picker-control-styles.js +14 -4
  9. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  10. package/build/autocomplete/index.js +9 -11
  11. package/build/autocomplete/index.js.map +1 -1
  12. package/build/base-control/index.js +6 -3
  13. package/build/base-control/index.js.map +1 -1
  14. package/build/base-control/styles/base-control-styles.js +8 -8
  15. package/build/base-control/styles/base-control-styles.js.map +1 -1
  16. package/build/base-field/styles.js +5 -5
  17. package/build/base-field/styles.js.map +1 -1
  18. package/build/border-control/border-control/component.js +38 -25
  19. package/build/border-control/border-control/component.js.map +1 -1
  20. package/build/border-control/border-control/hook.js +4 -7
  21. package/build/border-control/border-control/hook.js.map +1 -1
  22. package/build/border-control/border-control-dropdown/component.js +13 -7
  23. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  24. package/build/border-control/border-control-dropdown/hook.js +0 -4
  25. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  26. package/build/border-control/styles.js +29 -60
  27. package/build/border-control/styles.js.map +1 -1
  28. package/build/box-control/all-input-control.js +2 -27
  29. package/build/box-control/all-input-control.js.map +1 -1
  30. package/build/box-control/axial-input-controls.js +1 -1
  31. package/build/box-control/axial-input-controls.js.map +1 -1
  32. package/build/box-control/index.js +10 -5
  33. package/build/box-control/index.js.map +1 -1
  34. package/build/box-control/styles/box-control-styles.js +17 -9
  35. package/build/box-control/styles/box-control-styles.js.map +1 -1
  36. package/build/box-control/styles/box-control-visualizer-styles.js +8 -8
  37. package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  38. package/build/box-control/utils.js +37 -8
  39. package/build/box-control/utils.js.map +1 -1
  40. package/build/color-list-picker/index.js +16 -5
  41. package/build/color-list-picker/index.js.map +1 -1
  42. package/build/color-palette/index.js +36 -14
  43. package/build/color-palette/index.js.map +1 -1
  44. package/build/color-palette/index.native.js +3 -3
  45. package/build/color-palette/index.native.js.map +1 -1
  46. package/build/color-picker/hex-input.js +2 -1
  47. package/build/color-picker/hex-input.js.map +1 -1
  48. package/build/color-picker/input-with-slider.js +3 -2
  49. package/build/color-picker/input-with-slider.js.map +1 -1
  50. package/build/color-picker/styles.js +10 -15
  51. package/build/color-picker/styles.js.map +1 -1
  52. package/build/combobox-control/index.js +26 -17
  53. package/build/combobox-control/index.js.map +1 -1
  54. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  55. package/build/custom-gradient-picker/gradient-bar/constants.js.map +1 -0
  56. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +34 -41
  57. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -0
  58. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -1
  59. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -0
  60. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  61. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -0
  62. package/build/custom-gradient-picker/index.js +19 -4
  63. package/build/custom-gradient-picker/index.js.map +1 -1
  64. package/build/custom-select-control/index.js +43 -13
  65. package/build/custom-select-control/index.js.map +1 -1
  66. package/build/custom-select-control/styles.js +34 -0
  67. package/build/custom-select-control/styles.js.map +1 -0
  68. package/build/date-time/constants.js +9 -0
  69. package/build/date-time/constants.js.map +1 -0
  70. package/build/date-time/date/index.js +175 -186
  71. package/build/date-time/date/index.js.map +1 -1
  72. package/build/date-time/date/styles.js +59 -40
  73. package/build/date-time/date/styles.js.map +1 -1
  74. package/build/date-time/date-time/index.js +5 -2
  75. package/build/date-time/date-time/index.js.map +1 -1
  76. package/build/date-time/time/index.js +28 -19
  77. package/build/date-time/time/index.js.map +1 -1
  78. package/build/date-time/time/styles.js +17 -24
  79. package/build/date-time/time/styles.js.map +1 -1
  80. package/build/date-time/utils.js +27 -0
  81. package/build/date-time/utils.js.map +1 -0
  82. package/build/dimension-control/index.js +2 -6
  83. package/build/dimension-control/index.js.map +1 -1
  84. package/build/disabled/index.js +28 -11
  85. package/build/disabled/index.js.map +1 -1
  86. package/build/disabled/styles/disabled-styles.js +3 -3
  87. package/build/disabled/styles/disabled-styles.js.map +1 -1
  88. package/build/disabled/types.js +6 -0
  89. package/build/disabled/types.js.map +1 -0
  90. package/build/divider/component.js +0 -1
  91. package/build/divider/component.js.map +1 -1
  92. package/build/divider/index.js.map +1 -1
  93. package/build/divider/styles.js +5 -5
  94. package/build/divider/styles.js.map +1 -1
  95. package/build/dropdown/dropdown-content-wrapper.js +60 -0
  96. package/build/dropdown/dropdown-content-wrapper.js.map +1 -0
  97. package/build/dropdown/index.js +5 -6
  98. package/build/dropdown/index.js.map +1 -1
  99. package/build/dropdown/styles.js +42 -0
  100. package/build/dropdown/styles.js.map +1 -0
  101. package/build/dropdown/types.js +6 -0
  102. package/build/dropdown/types.js.map +1 -0
  103. package/build/duotone-picker/custom-duotone-bar.js +2 -2
  104. package/build/duotone-picker/custom-duotone-bar.js.map +1 -1
  105. package/build/duotone-picker/duotone-picker.js +9 -1
  106. package/build/duotone-picker/duotone-picker.js.map +1 -1
  107. package/build/duotone-picker/duotone-swatch.js +13 -3
  108. package/build/duotone-picker/duotone-swatch.js.map +1 -1
  109. package/build/elevation/component.js +15 -15
  110. package/build/elevation/component.js.map +1 -1
  111. package/build/elevation/hook.js +5 -17
  112. package/build/elevation/hook.js.map +1 -1
  113. package/build/elevation/index.js.map +1 -1
  114. package/build/elevation/styles.js +1 -1
  115. package/build/elevation/styles.js.map +1 -1
  116. package/build/external-link/index.js +6 -0
  117. package/build/external-link/index.js.map +1 -1
  118. package/build/flex/flex/component.js +20 -26
  119. package/build/flex/flex/component.js.map +1 -1
  120. package/build/flex/flex/hook.js +6 -16
  121. package/build/flex/flex/hook.js.map +1 -1
  122. package/build/flex/flex/index.js.map +1 -1
  123. package/build/flex/flex-block/component.js +18 -12
  124. package/build/flex/flex-block/component.js.map +1 -1
  125. package/build/flex/flex-block/hook.js +0 -4
  126. package/build/flex/flex-block/hook.js.map +1 -1
  127. package/build/flex/flex-block/index.js.map +1 -1
  128. package/build/flex/flex-item/component.js +18 -12
  129. package/build/flex/flex-item/component.js.map +1 -1
  130. package/build/flex/flex-item/hook.js +1 -5
  131. package/build/flex/flex-item/hook.js.map +1 -1
  132. package/build/flex/flex-item/index.js.map +1 -1
  133. package/build/flex/index.js.map +1 -1
  134. package/build/flex/styles.js +5 -5
  135. package/build/flex/styles.js.map +1 -1
  136. package/build/focal-point-picker/index.js +4 -6
  137. package/build/focal-point-picker/index.js.map +1 -1
  138. package/build/focal-point-picker/styles/focal-point-picker-style.js +22 -22
  139. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  140. package/build/focal-point-picker/styles/focal-point-style.js +5 -5
  141. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  142. package/build/font-size-picker/index.js +56 -18
  143. package/build/font-size-picker/index.js.map +1 -1
  144. package/build/font-size-picker/utils.js +32 -22
  145. package/build/font-size-picker/utils.js.map +1 -1
  146. package/build/form-token-field/index.js +17 -7
  147. package/build/form-token-field/index.js.map +1 -1
  148. package/build/form-token-field/suggestions-list.js +19 -6
  149. package/build/form-token-field/suggestions-list.js.map +1 -1
  150. package/build/gradient-picker/index.js +15 -3
  151. package/build/gradient-picker/index.js.map +1 -1
  152. package/build/guide/index.js +5 -3
  153. package/build/guide/index.js.map +1 -1
  154. package/build/guide/page-control.js +3 -7
  155. package/build/guide/page-control.js.map +1 -1
  156. package/build/index.js +31 -1
  157. package/build/index.js.map +1 -1
  158. package/build/input-control/index.js +7 -0
  159. package/build/input-control/index.js.map +1 -1
  160. package/build/input-control/input-base.js +24 -3
  161. package/build/input-control/input-base.js.map +1 -1
  162. package/build/input-control/input-prefix-wrapper.js +54 -0
  163. package/build/input-control/input-prefix-wrapper.js.map +1 -0
  164. package/build/input-control/input-suffix-wrapper.js +54 -0
  165. package/build/input-control/input-suffix-wrapper.js.map +1 -0
  166. package/build/input-control/reducer/actions.js +3 -1
  167. package/build/input-control/reducer/actions.js.map +1 -1
  168. package/build/input-control/reducer/reducer.js +28 -11
  169. package/build/input-control/reducer/reducer.js.map +1 -1
  170. package/build/input-control/reducer/state.js.map +1 -1
  171. package/build/input-control/styles/input-control-styles.js +61 -42
  172. package/build/input-control/styles/input-control-styles.js.map +1 -1
  173. package/build/item-group/styles.js +10 -10
  174. package/build/item-group/styles.js.map +1 -1
  175. package/build/mobile/bottom-sheet/index.native.js +3 -6
  176. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  177. package/build/mobile/global-styles-context/utils.native.js +26 -4
  178. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  179. package/build/mobile/image/index.native.js +9 -5
  180. package/build/mobile/image/index.native.js.map +1 -1
  181. package/build/mobile/link-picker/link-picker-screen.native.js +10 -4
  182. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  183. package/build/mobile/media-edit/index.native.js +1 -7
  184. package/build/mobile/media-edit/index.native.js.map +1 -1
  185. package/build/mobile/picker/index.android.js +3 -3
  186. package/build/mobile/picker/index.android.js.map +1 -1
  187. package/build/mobile/picker/index.ios.js +16 -3
  188. package/build/mobile/picker/index.ios.js.map +1 -1
  189. package/build/modal/index.js +1 -3
  190. package/build/modal/index.js.map +1 -1
  191. package/build/navigable-container/container.js +9 -8
  192. package/build/navigable-container/container.js.map +1 -1
  193. package/build/navigator/navigator-back-button/hook.js +0 -4
  194. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  195. package/build/navigator/navigator-button/hook.js +0 -4
  196. package/build/navigator/navigator-button/hook.js.map +1 -1
  197. package/build/notice/list.js +10 -6
  198. package/build/notice/list.js.map +1 -1
  199. package/build/palette-edit/index.js +1 -0
  200. package/build/palette-edit/index.js.map +1 -1
  201. package/build/palette-edit/styles.js +10 -10
  202. package/build/palette-edit/styles.js.map +1 -1
  203. package/build/placeholder/index.js +11 -14
  204. package/build/placeholder/index.js.map +1 -1
  205. package/build/placeholder/types.js +6 -0
  206. package/build/placeholder/types.js.map +1 -0
  207. package/build/popover/index.js +202 -145
  208. package/build/popover/index.js.map +1 -1
  209. package/build/popover/utils.js +178 -0
  210. package/build/popover/utils.js.map +1 -0
  211. package/build/radio-control/index.js +1 -3
  212. package/build/radio-control/index.js.map +1 -1
  213. package/build/range-control/index.js +3 -0
  214. package/build/range-control/index.js.map +1 -1
  215. package/build/range-control/styles/range-control-styles.js +51 -45
  216. package/build/range-control/styles/range-control-styles.js.map +1 -1
  217. package/build/range-control/utils.js +1 -1
  218. package/build/range-control/utils.js.map +1 -1
  219. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  220. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  221. package/build/sandbox/index.native.js +13 -2
  222. package/build/sandbox/index.native.js.map +1 -1
  223. package/build/scroll-lock/index.js +35 -6
  224. package/build/scroll-lock/index.js.map +1 -1
  225. package/build/select-control/chevron-down.js +30 -0
  226. package/build/select-control/chevron-down.js.map +1 -0
  227. package/build/select-control/index.js +8 -10
  228. package/build/select-control/index.js.map +1 -1
  229. package/build/select-control/styles/select-control-styles.js +54 -19
  230. package/build/select-control/styles/select-control-styles.js.map +1 -1
  231. package/build/shortcut/index.js +4 -13
  232. package/build/shortcut/index.js.map +1 -1
  233. package/build/shortcut/types.js +6 -0
  234. package/build/shortcut/types.js.map +1 -0
  235. package/build/snackbar/list.js +5 -3
  236. package/build/snackbar/list.js.map +1 -1
  237. package/build/spacer/component.js +3 -1
  238. package/build/spacer/component.js.map +1 -1
  239. package/build/spinner/index.js +2 -0
  240. package/build/spinner/index.js.map +1 -1
  241. package/build/style-provider/index.js +10 -7
  242. package/build/style-provider/index.js.map +1 -1
  243. package/build/style-provider/types.js +6 -0
  244. package/build/style-provider/types.js.map +1 -0
  245. package/build/text/hook.js +5 -8
  246. package/build/text/hook.js.map +1 -1
  247. package/build/text/styles.js +7 -7
  248. package/build/text/styles.js.map +1 -1
  249. package/build/toggle-group-control/toggle-group-control/component.js +19 -8
  250. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  251. package/build/toggle-group-control/toggle-group-control/styles.js +22 -4
  252. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  253. package/build/toggle-group-control/toggle-group-control-option/component.js +15 -5
  254. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  255. package/build/toggle-group-control/toggle-group-control-option-base/component.js +5 -1
  256. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  257. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +20 -9
  258. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  259. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +26 -7
  260. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  261. package/build/tools-panel/styles.js +13 -10
  262. package/build/tools-panel/styles.js.map +1 -1
  263. package/build/tools-panel/tools-panel/hook.js +1 -1
  264. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  265. package/build/tooltip/index.js +51 -14
  266. package/build/tooltip/index.js.map +1 -1
  267. package/build/tree-select/index.js +2 -2
  268. package/build/tree-select/index.js.map +1 -1
  269. package/build/ui/context/context-connect.js +1 -3
  270. package/build/ui/context/context-connect.js.map +1 -1
  271. package/build/ui/context/use-context-system.js +7 -2
  272. package/build/ui/context/use-context-system.js.map +1 -1
  273. package/build/ui/tooltip/styles.js +4 -4
  274. package/build/ui/tooltip/styles.js.map +1 -1
  275. package/build/ui/utils/space.js +7 -1
  276. package/build/ui/utils/space.js.map +1 -1
  277. package/build/unit-control/index.js +2 -3
  278. package/build/unit-control/index.js.map +1 -1
  279. package/build/unit-control/styles/unit-control-styles.js +38 -29
  280. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  281. package/build/utils/base-label.js +24 -0
  282. package/build/utils/base-label.js.map +1 -0
  283. package/build/utils/box-sizing.js +22 -0
  284. package/build/utils/box-sizing.js.map +1 -0
  285. package/build/utils/colors-values.js +52 -142
  286. package/build/utils/colors-values.js.map +1 -1
  287. package/build/utils/config-values.js +1 -1
  288. package/build/utils/config-values.js.map +1 -1
  289. package/build/utils/input/input-control.js +1 -1
  290. package/build/utils/input/input-control.js.map +1 -1
  291. package/build/utils/rtl.js +6 -5
  292. package/build/utils/rtl.js.map +1 -1
  293. package/build/utils/strings.js +50 -0
  294. package/build/utils/strings.js.map +1 -0
  295. package/build/utils/style-mixins.js +16 -0
  296. package/build/utils/style-mixins.js.map +1 -1
  297. package/build-module/alignment-matrix-control/index.js +1 -1
  298. package/build-module/alignment-matrix-control/index.js.map +1 -1
  299. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  300. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  301. package/build-module/angle-picker-control/index.js +5 -2
  302. package/build-module/angle-picker-control/index.js.map +1 -1
  303. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +13 -4
  304. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  305. package/build-module/autocomplete/index.js +9 -10
  306. package/build-module/autocomplete/index.js.map +1 -1
  307. package/build-module/base-control/index.js +7 -5
  308. package/build-module/base-control/index.js.map +1 -1
  309. package/build-module/base-control/styles/base-control-styles.js +9 -9
  310. package/build-module/base-control/styles/base-control-styles.js.map +1 -1
  311. package/build-module/base-field/styles.js +5 -5
  312. package/build-module/base-field/styles.js.map +1 -1
  313. package/build-module/border-control/border-control/component.js +37 -25
  314. package/build-module/border-control/border-control/component.js.map +1 -1
  315. package/build-module/border-control/border-control/hook.js +4 -7
  316. package/build-module/border-control/border-control/hook.js.map +1 -1
  317. package/build-module/border-control/border-control-dropdown/component.js +12 -7
  318. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  319. package/build-module/border-control/border-control-dropdown/hook.js +0 -4
  320. package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
  321. package/build-module/border-control/styles.js +30 -54
  322. package/build-module/border-control/styles.js.map +1 -1
  323. package/build-module/box-control/all-input-control.js +3 -28
  324. package/build-module/box-control/all-input-control.js.map +1 -1
  325. package/build-module/box-control/axial-input-controls.js +1 -1
  326. package/build-module/box-control/axial-input-controls.js.map +1 -1
  327. package/build-module/box-control/index.js +4 -4
  328. package/build-module/box-control/index.js.map +1 -1
  329. package/build-module/box-control/styles/box-control-styles.js +18 -10
  330. package/build-module/box-control/styles/box-control-styles.js.map +1 -1
  331. package/build-module/box-control/styles/box-control-visualizer-styles.js +8 -8
  332. package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  333. package/build-module/box-control/utils.js +35 -7
  334. package/build-module/box-control/utils.js.map +1 -1
  335. package/build-module/color-list-picker/index.js +13 -5
  336. package/build-module/color-list-picker/index.js.map +1 -1
  337. package/build-module/color-palette/index.js +32 -12
  338. package/build-module/color-palette/index.js.map +1 -1
  339. package/build-module/color-palette/index.native.js +4 -4
  340. package/build-module/color-palette/index.native.js.map +1 -1
  341. package/build-module/color-picker/hex-input.js +2 -1
  342. package/build-module/color-picker/hex-input.js.map +1 -1
  343. package/build-module/color-picker/input-with-slider.js +3 -2
  344. package/build-module/color-picker/input-with-slider.js.map +1 -1
  345. package/build-module/color-picker/styles.js +10 -16
  346. package/build-module/color-picker/styles.js.map +1 -1
  347. package/build-module/combobox-control/index.js +24 -15
  348. package/build-module/combobox-control/index.js.map +1 -1
  349. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  350. package/build-module/custom-gradient-picker/gradient-bar/constants.js.map +1 -0
  351. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +34 -41
  352. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -0
  353. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -1
  354. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -0
  355. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  356. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -0
  357. package/build-module/custom-gradient-picker/index.js +16 -3
  358. package/build-module/custom-gradient-picker/index.js.map +1 -1
  359. package/build-module/custom-select-control/index.js +41 -16
  360. package/build-module/custom-select-control/index.js.map +1 -1
  361. package/build-module/custom-select-control/styles.js +22 -0
  362. package/build-module/custom-select-control/styles.js.map +1 -0
  363. package/build-module/date-time/constants.js +2 -0
  364. package/build-module/date-time/constants.js.map +1 -0
  365. package/build-module/date-time/date/index.js +178 -184
  366. package/build-module/date-time/date/index.js.map +1 -1
  367. package/build-module/date-time/date/styles.js +47 -38
  368. package/build-module/date-time/date/styles.js.map +1 -1
  369. package/build-module/date-time/date-time/index.js +4 -2
  370. package/build-module/date-time/date-time/index.js.map +1 -1
  371. package/build-module/date-time/time/index.js +26 -19
  372. package/build-module/date-time/time/index.js.map +1 -1
  373. package/build-module/date-time/time/styles.js +15 -21
  374. package/build-module/date-time/time/styles.js.map +1 -1
  375. package/build-module/date-time/utils.js +19 -0
  376. package/build-module/date-time/utils.js.map +1 -0
  377. package/build-module/dimension-control/index.js +1 -5
  378. package/build-module/dimension-control/index.js.map +1 -1
  379. package/build-module/disabled/index.js +28 -11
  380. package/build-module/disabled/index.js.map +1 -1
  381. package/build-module/disabled/styles/disabled-styles.js +3 -3
  382. package/build-module/disabled/styles/disabled-styles.js.map +1 -1
  383. package/build-module/disabled/types.js +2 -0
  384. package/build-module/disabled/types.js.map +1 -0
  385. package/build-module/divider/component.js +0 -1
  386. package/build-module/divider/component.js.map +1 -1
  387. package/build-module/divider/index.js.map +1 -1
  388. package/build-module/divider/styles.js +5 -5
  389. package/build-module/divider/styles.js.map +1 -1
  390. package/build-module/dropdown/dropdown-content-wrapper.js +47 -0
  391. package/build-module/dropdown/dropdown-content-wrapper.js.map +1 -0
  392. package/build-module/dropdown/index.js +5 -6
  393. package/build-module/dropdown/index.js.map +1 -1
  394. package/build-module/dropdown/styles.js +31 -0
  395. package/build-module/dropdown/styles.js.map +1 -0
  396. package/build-module/dropdown/types.js +2 -0
  397. package/build-module/dropdown/types.js.map +1 -0
  398. package/build-module/duotone-picker/custom-duotone-bar.js +1 -1
  399. package/build-module/duotone-picker/custom-duotone-bar.js.map +1 -1
  400. package/build-module/duotone-picker/duotone-picker.js +7 -1
  401. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  402. package/build-module/duotone-picker/duotone-swatch.js +11 -3
  403. package/build-module/duotone-picker/duotone-swatch.js.map +1 -1
  404. package/build-module/elevation/component.js +15 -15
  405. package/build-module/elevation/component.js.map +1 -1
  406. package/build-module/elevation/hook.js +5 -17
  407. package/build-module/elevation/hook.js.map +1 -1
  408. package/build-module/elevation/index.js.map +1 -1
  409. package/build-module/elevation/styles.js +1 -1
  410. package/build-module/elevation/styles.js.map +1 -1
  411. package/build-module/external-link/index.js +6 -0
  412. package/build-module/external-link/index.js.map +1 -1
  413. package/build-module/flex/flex/component.js +20 -26
  414. package/build-module/flex/flex/component.js.map +1 -1
  415. package/build-module/flex/flex/hook.js +6 -15
  416. package/build-module/flex/flex/hook.js.map +1 -1
  417. package/build-module/flex/flex/index.js.map +1 -1
  418. package/build-module/flex/flex-block/component.js +18 -12
  419. package/build-module/flex/flex-block/component.js.map +1 -1
  420. package/build-module/flex/flex-block/hook.js +0 -4
  421. package/build-module/flex/flex-block/hook.js.map +1 -1
  422. package/build-module/flex/flex-block/index.js.map +1 -1
  423. package/build-module/flex/flex-item/component.js +18 -12
  424. package/build-module/flex/flex-item/component.js.map +1 -1
  425. package/build-module/flex/flex-item/hook.js +1 -5
  426. package/build-module/flex/flex-item/hook.js.map +1 -1
  427. package/build-module/flex/flex-item/index.js.map +1 -1
  428. package/build-module/flex/index.js.map +1 -1
  429. package/build-module/flex/styles.js +5 -5
  430. package/build-module/flex/styles.js.map +1 -1
  431. package/build-module/focal-point-picker/index.js +4 -5
  432. package/build-module/focal-point-picker/index.js.map +1 -1
  433. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +22 -22
  434. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  435. package/build-module/focal-point-picker/styles/focal-point-style.js +5 -5
  436. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  437. package/build-module/font-size-picker/index.js +51 -18
  438. package/build-module/font-size-picker/index.js.map +1 -1
  439. package/build-module/font-size-picker/utils.js +31 -23
  440. package/build-module/font-size-picker/utils.js.map +1 -1
  441. package/build-module/form-token-field/index.js +17 -8
  442. package/build-module/form-token-field/index.js.map +1 -1
  443. package/build-module/form-token-field/suggestions-list.js +19 -6
  444. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  445. package/build-module/gradient-picker/index.js +14 -3
  446. package/build-module/gradient-picker/index.js.map +1 -1
  447. package/build-module/guide/index.js +5 -3
  448. package/build-module/guide/index.js.map +1 -1
  449. package/build-module/guide/page-control.js +3 -6
  450. package/build-module/guide/page-control.js.map +1 -1
  451. package/build-module/index.js +4 -1
  452. package/build-module/index.js.map +1 -1
  453. package/build-module/input-control/index.js +6 -0
  454. package/build-module/input-control/index.js.map +1 -1
  455. package/build-module/input-control/input-base.js +25 -5
  456. package/build-module/input-control/input-base.js.map +1 -1
  457. package/build-module/input-control/input-prefix-wrapper.js +41 -0
  458. package/build-module/input-control/input-prefix-wrapper.js.map +1 -0
  459. package/build-module/input-control/input-suffix-wrapper.js +41 -0
  460. package/build-module/input-control/input-suffix-wrapper.js.map +1 -0
  461. package/build-module/input-control/reducer/actions.js +1 -0
  462. package/build-module/input-control/reducer/actions.js.map +1 -1
  463. package/build-module/input-control/reducer/reducer.js +28 -11
  464. package/build-module/input-control/reducer/reducer.js.map +1 -1
  465. package/build-module/input-control/reducer/state.js.map +1 -1
  466. package/build-module/input-control/styles/input-control-styles.js +58 -42
  467. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  468. package/build-module/item-group/styles.js +10 -10
  469. package/build-module/item-group/styles.js.map +1 -1
  470. package/build-module/mobile/bottom-sheet/index.native.js +3 -5
  471. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  472. package/build-module/mobile/global-styles-context/utils.native.js +24 -4
  473. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  474. package/build-module/mobile/image/index.native.js +12 -8
  475. package/build-module/mobile/image/index.native.js.map +1 -1
  476. package/build-module/mobile/link-picker/link-picker-screen.native.js +11 -4
  477. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  478. package/build-module/mobile/media-edit/index.native.js +1 -6
  479. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  480. package/build-module/mobile/picker/index.android.js +3 -3
  481. package/build-module/mobile/picker/index.android.js.map +1 -1
  482. package/build-module/mobile/picker/index.ios.js +14 -3
  483. package/build-module/mobile/picker/index.ios.js.map +1 -1
  484. package/build-module/modal/index.js +1 -2
  485. package/build-module/modal/index.js.map +1 -1
  486. package/build-module/navigable-container/container.js +9 -7
  487. package/build-module/navigable-container/container.js.map +1 -1
  488. package/build-module/navigator/navigator-back-button/hook.js +0 -4
  489. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  490. package/build-module/navigator/navigator-button/hook.js +0 -4
  491. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  492. package/build-module/notice/list.js +10 -5
  493. package/build-module/notice/list.js.map +1 -1
  494. package/build-module/palette-edit/index.js +1 -0
  495. package/build-module/palette-edit/index.js.map +1 -1
  496. package/build-module/palette-edit/styles.js +10 -10
  497. package/build-module/palette-edit/styles.js.map +1 -1
  498. package/build-module/placeholder/index.js +10 -15
  499. package/build-module/placeholder/index.js.map +1 -1
  500. package/build-module/placeholder/types.js +2 -0
  501. package/build-module/placeholder/types.js.map +1 -0
  502. package/build-module/popover/index.js +202 -147
  503. package/build-module/popover/index.js.map +1 -1
  504. package/build-module/popover/utils.js +164 -0
  505. package/build-module/popover/utils.js.map +1 -0
  506. package/build-module/radio-control/index.js +1 -2
  507. package/build-module/radio-control/index.js.map +1 -1
  508. package/build-module/range-control/index.js +3 -0
  509. package/build-module/range-control/index.js.map +1 -1
  510. package/build-module/range-control/styles/range-control-styles.js +51 -45
  511. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  512. package/build-module/range-control/utils.js +1 -1
  513. package/build-module/range-control/utils.js.map +1 -1
  514. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  515. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  516. package/build-module/sandbox/index.native.js +13 -3
  517. package/build-module/sandbox/index.native.js.map +1 -1
  518. package/build-module/scroll-lock/index.js +32 -6
  519. package/build-module/scroll-lock/index.js.map +1 -1
  520. package/build-module/select-control/chevron-down.js +21 -0
  521. package/build-module/select-control/chevron-down.js.map +1 -0
  522. package/build-module/select-control/index.js +8 -9
  523. package/build-module/select-control/index.js.map +1 -1
  524. package/build-module/select-control/styles/select-control-styles.js +48 -17
  525. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  526. package/build-module/shortcut/index.js +4 -13
  527. package/build-module/shortcut/index.js.map +1 -1
  528. package/build-module/shortcut/types.js +2 -0
  529. package/build-module/shortcut/types.js.map +1 -0
  530. package/build-module/snackbar/list.js +5 -2
  531. package/build-module/snackbar/list.js.map +1 -1
  532. package/build-module/spacer/component.js +3 -1
  533. package/build-module/spacer/component.js.map +1 -1
  534. package/build-module/spinner/index.js +2 -0
  535. package/build-module/spinner/index.js.map +1 -1
  536. package/build-module/style-provider/index.js +10 -5
  537. package/build-module/style-provider/index.js.map +1 -1
  538. package/build-module/style-provider/types.js +2 -0
  539. package/build-module/style-provider/types.js.map +1 -0
  540. package/build-module/text/hook.js +5 -7
  541. package/build-module/text/hook.js.map +1 -1
  542. package/build-module/text/styles.js +7 -7
  543. package/build-module/text/styles.js.map +1 -1
  544. package/build-module/toggle-group-control/toggle-group-control/component.js +17 -7
  545. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  546. package/build-module/toggle-group-control/toggle-group-control/styles.js +16 -3
  547. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  548. package/build-module/toggle-group-control/toggle-group-control-option/component.js +17 -3
  549. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  550. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +5 -1
  551. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  552. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +16 -7
  553. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  554. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +27 -5
  555. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  556. package/build-module/tools-panel/styles.js +12 -11
  557. package/build-module/tools-panel/styles.js.map +1 -1
  558. package/build-module/tools-panel/tools-panel/hook.js +1 -1
  559. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  560. package/build-module/tooltip/index.js +53 -16
  561. package/build-module/tooltip/index.js.map +1 -1
  562. package/build-module/tree-select/index.js +3 -3
  563. package/build-module/tree-select/index.js.map +1 -1
  564. package/build-module/ui/context/context-connect.js +1 -2
  565. package/build-module/ui/context/context-connect.js.map +1 -1
  566. package/build-module/ui/context/use-context-system.js +7 -2
  567. package/build-module/ui/context/use-context-system.js.map +1 -1
  568. package/build-module/ui/tooltip/styles.js +4 -4
  569. package/build-module/ui/tooltip/styles.js.map +1 -1
  570. package/build-module/ui/utils/space.js +7 -1
  571. package/build-module/ui/utils/space.js.map +1 -1
  572. package/build-module/unit-control/index.js +2 -2
  573. package/build-module/unit-control/index.js.map +1 -1
  574. package/build-module/unit-control/styles/unit-control-styles.js +39 -30
  575. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  576. package/build-module/utils/base-label.js +18 -0
  577. package/build-module/utils/base-label.js.map +1 -0
  578. package/build-module/utils/box-sizing.js +16 -0
  579. package/build-module/utils/box-sizing.js.map +1 -0
  580. package/build-module/utils/colors-values.js +52 -141
  581. package/build-module/utils/colors-values.js.map +1 -1
  582. package/build-module/utils/config-values.js +1 -1
  583. package/build-module/utils/config-values.js.map +1 -1
  584. package/build-module/utils/input/input-control.js +1 -1
  585. package/build-module/utils/input/input-control.js.map +1 -1
  586. package/build-module/utils/rtl.js +6 -4
  587. package/build-module/utils/rtl.js.map +1 -1
  588. package/build-module/utils/strings.js +37 -0
  589. package/build-module/utils/strings.js.map +1 -0
  590. package/build-module/utils/style-mixins.js +2 -0
  591. package/build-module/utils/style-mixins.js.map +1 -1
  592. package/build-style/style-rtl.css +236 -1281
  593. package/build-style/style.css +237 -1281
  594. package/build-types/base-control/index.d.ts +4 -3
  595. package/build-types/base-control/index.d.ts.map +1 -1
  596. package/build-types/base-control/stories/index.d.ts +1 -1
  597. package/build-types/base-control/stories/index.d.ts.map +1 -1
  598. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  599. package/build-types/base-control/types.d.ts +0 -1
  600. package/build-types/base-control/types.d.ts.map +1 -1
  601. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  602. package/build-types/border-control/border-control/hook.d.ts +1 -1
  603. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  604. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  605. package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
  606. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  607. package/build-types/border-control/stories/index.d.ts.map +1 -1
  608. package/build-types/border-control/styles.d.ts +1 -4
  609. package/build-types/border-control/styles.d.ts.map +1 -1
  610. package/build-types/card/card-divider/hook.d.ts +1 -1
  611. package/build-types/color-palette/index.d.ts +3 -1
  612. package/build-types/color-palette/index.d.ts.map +1 -1
  613. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  614. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  615. package/build-types/color-picker/styles.d.ts +2 -2
  616. package/build-types/color-picker/styles.d.ts.map +1 -1
  617. package/build-types/date-time/constants.d.ts +2 -0
  618. package/build-types/date-time/constants.d.ts.map +1 -0
  619. package/build-types/date-time/date/index.d.ts +3 -1
  620. package/build-types/date-time/date/index.d.ts.map +1 -1
  621. package/build-types/date-time/date/styles.d.ts +22 -8
  622. package/build-types/date-time/date/styles.d.ts.map +1 -1
  623. package/build-types/date-time/date/test/index.d.ts +1 -1
  624. package/build-types/date-time/date/test/index.d.ts.map +1 -1
  625. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  626. package/build-types/date-time/time/index.d.ts.map +1 -1
  627. package/build-types/date-time/time/styles.d.ts +0 -4
  628. package/build-types/date-time/time/styles.d.ts.map +1 -1
  629. package/build-types/date-time/utils.d.ts +8 -0
  630. package/build-types/date-time/utils.d.ts.map +1 -0
  631. package/build-types/disabled/index.d.ts +35 -28
  632. package/build-types/disabled/index.d.ts.map +1 -1
  633. package/build-types/disabled/stories/index.d.ts +13 -0
  634. package/build-types/disabled/stories/index.d.ts.map +1 -0
  635. package/build-types/disabled/styles/disabled-styles.d.ts +2 -1
  636. package/build-types/disabled/styles/disabled-styles.d.ts.map +1 -1
  637. package/build-types/disabled/test/index.d.ts +2 -0
  638. package/build-types/disabled/test/index.d.ts.map +1 -0
  639. package/build-types/disabled/types.d.ts +14 -0
  640. package/build-types/disabled/types.d.ts.map +1 -0
  641. package/build-types/divider/component.d.ts +2 -3
  642. package/build-types/divider/component.d.ts.map +1 -1
  643. package/build-types/divider/index.d.ts +1 -1
  644. package/build-types/divider/index.d.ts.map +1 -1
  645. package/build-types/divider/styles.d.ts +6 -2
  646. package/build-types/divider/styles.d.ts.map +1 -1
  647. package/build-types/divider/test/index.d.ts +2 -0
  648. package/build-types/divider/test/index.d.ts.map +1 -0
  649. package/build-types/divider/types.d.ts +18 -10
  650. package/build-types/divider/types.d.ts.map +1 -1
  651. package/build-types/dropdown/dropdown-content-wrapper.d.ts +23 -0
  652. package/build-types/dropdown/dropdown-content-wrapper.d.ts.map +1 -0
  653. package/build-types/dropdown/index.d.ts.map +1 -1
  654. package/build-types/dropdown/styles.d.ts +7 -0
  655. package/build-types/dropdown/styles.d.ts.map +1 -0
  656. package/build-types/dropdown/types.d.ts +9 -0
  657. package/build-types/dropdown/types.d.ts.map +1 -0
  658. package/build-types/elevation/component.d.ts +11 -10
  659. package/build-types/elevation/component.d.ts.map +1 -1
  660. package/build-types/elevation/hook.d.ts +6 -7
  661. package/build-types/elevation/hook.d.ts.map +1 -1
  662. package/build-types/elevation/index.d.ts +2 -2
  663. package/build-types/elevation/index.d.ts.map +1 -1
  664. package/build-types/elevation/stories/index.d.ts +22 -0
  665. package/build-types/elevation/stories/index.d.ts.map +1 -0
  666. package/build-types/elevation/styles.d.ts +1 -1
  667. package/build-types/elevation/styles.d.ts.map +1 -1
  668. package/build-types/elevation/test/index.d.ts +2 -0
  669. package/build-types/elevation/test/index.d.ts.map +1 -0
  670. package/build-types/elevation/types.d.ts +12 -19
  671. package/build-types/elevation/types.d.ts.map +1 -1
  672. package/build-types/external-link/index.d.ts.map +1 -1
  673. package/build-types/flex/flex/component.d.ts +16 -21
  674. package/build-types/flex/flex/component.d.ts.map +1 -1
  675. package/build-types/flex/flex/hook.d.ts +5 -2
  676. package/build-types/flex/flex/hook.d.ts.map +1 -1
  677. package/build-types/flex/flex/index.d.ts +2 -2
  678. package/build-types/flex/flex/index.d.ts.map +1 -1
  679. package/build-types/flex/flex-block/component.d.ts +14 -7
  680. package/build-types/flex/flex-block/component.d.ts.map +1 -1
  681. package/build-types/flex/flex-block/hook.d.ts +6 -3
  682. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  683. package/build-types/flex/flex-block/index.d.ts +2 -2
  684. package/build-types/flex/flex-block/index.d.ts.map +1 -1
  685. package/build-types/flex/flex-item/component.d.ts +14 -7
  686. package/build-types/flex/flex-item/component.d.ts.map +1 -1
  687. package/build-types/flex/flex-item/hook.d.ts +6 -3
  688. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  689. package/build-types/flex/flex-item/index.d.ts +2 -2
  690. package/build-types/flex/flex-item/index.d.ts.map +1 -1
  691. package/build-types/flex/index.d.ts +3 -3
  692. package/build-types/flex/index.d.ts.map +1 -1
  693. package/build-types/flex/stories/index.d.ts +13 -0
  694. package/build-types/flex/stories/index.d.ts.map +1 -0
  695. package/build-types/flex/styles.d.ts +5 -5
  696. package/build-types/flex/styles.d.ts.map +1 -1
  697. package/build-types/flex/test/index.d.ts +2 -0
  698. package/build-types/flex/test/index.d.ts.map +1 -0
  699. package/build-types/flex/types.d.ts +17 -10
  700. package/build-types/flex/types.d.ts.map +1 -1
  701. package/build-types/form-token-field/index.d.ts.map +1 -1
  702. package/build-types/form-token-field/stories/index.d.ts +7 -0
  703. package/build-types/form-token-field/stories/index.d.ts.map +1 -1
  704. package/build-types/form-token-field/suggestions-list.d.ts +1 -1
  705. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  706. package/build-types/form-token-field/types.d.ts +22 -3
  707. package/build-types/form-token-field/types.d.ts.map +1 -1
  708. package/build-types/input-control/index.d.ts +1 -1
  709. package/build-types/input-control/index.d.ts.map +1 -1
  710. package/build-types/input-control/input-base.d.ts +1 -1
  711. package/build-types/input-control/input-base.d.ts.map +1 -1
  712. package/build-types/input-control/input-prefix-wrapper.d.ts +19 -0
  713. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -0
  714. package/build-types/input-control/input-suffix-wrapper.d.ts +19 -0
  715. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -0
  716. package/build-types/input-control/reducer/actions.d.ts +3 -1
  717. package/build-types/input-control/reducer/actions.d.ts.map +1 -1
  718. package/build-types/input-control/reducer/reducer.d.ts +2 -2
  719. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  720. package/build-types/input-control/reducer/state.d.ts +2 -2
  721. package/build-types/input-control/reducer/state.d.ts.map +1 -1
  722. package/build-types/input-control/stories/index.d.ts +10 -0
  723. package/build-types/input-control/stories/index.d.ts.map +1 -1
  724. package/build-types/input-control/styles/input-control-styles.d.ts +21 -0
  725. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  726. package/build-types/input-control/types.d.ts +45 -3
  727. package/build-types/input-control/types.d.ts.map +1 -1
  728. package/build-types/navigator/navigator-back-button/hook.d.ts +0 -3
  729. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  730. package/build-types/navigator/navigator-button/hook.d.ts +0 -3
  731. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  732. package/build-types/placeholder/index.d.ts +16 -0
  733. package/build-types/placeholder/index.d.ts.map +1 -0
  734. package/build-types/placeholder/stories/index.d.ts +12 -0
  735. package/build-types/placeholder/stories/index.d.ts.map +1 -0
  736. package/build-types/placeholder/test/index.d.ts +2 -0
  737. package/build-types/placeholder/test/index.d.ts.map +1 -0
  738. package/build-types/placeholder/types.d.ts +47 -0
  739. package/build-types/placeholder/types.d.ts.map +1 -0
  740. package/build-types/popover/index.d.ts +2 -2
  741. package/build-types/popover/index.d.ts.map +1 -1
  742. package/build-types/popover/utils.d.ts +27 -0
  743. package/build-types/popover/utils.d.ts.map +1 -0
  744. package/build-types/radio-control/index.d.ts.map +1 -1
  745. package/build-types/range-control/index.d.ts +2 -2
  746. package/build-types/range-control/index.d.ts.map +1 -1
  747. package/build-types/range-control/styles/range-control-styles.d.ts +5 -2
  748. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  749. package/build-types/range-control/types.d.ts +6 -4
  750. package/build-types/range-control/types.d.ts.map +1 -1
  751. package/build-types/range-control/utils.d.ts.map +1 -1
  752. package/build-types/scroll-lock/index.d.ts +32 -3
  753. package/build-types/scroll-lock/index.d.ts.map +1 -1
  754. package/build-types/scroll-lock/stories/index.d.ts +9 -0
  755. package/build-types/scroll-lock/stories/index.d.ts.map +1 -0
  756. package/build-types/scroll-lock/test/index.d.ts +2 -0
  757. package/build-types/scroll-lock/test/index.d.ts.map +1 -0
  758. package/build-types/select-control/chevron-down.d.ts +4 -0
  759. package/build-types/select-control/chevron-down.d.ts.map +1 -0
  760. package/build-types/select-control/index.d.ts.map +1 -1
  761. package/build-types/select-control/styles/select-control-styles.d.ts +9 -1
  762. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  763. package/build-types/select-control/types.d.ts +1 -1
  764. package/build-types/select-control/types.d.ts.map +1 -1
  765. package/build-types/shortcut/index.d.ts +5 -24
  766. package/build-types/shortcut/index.d.ts.map +1 -1
  767. package/build-types/shortcut/test/index.d.ts +2 -0
  768. package/build-types/shortcut/test/index.d.ts.map +1 -0
  769. package/build-types/shortcut/types.d.ts +14 -0
  770. package/build-types/shortcut/types.d.ts.map +1 -0
  771. package/build-types/spacer/component.d.ts +3 -1
  772. package/build-types/spacer/component.d.ts.map +1 -1
  773. package/build-types/spinner/index.d.ts.map +1 -1
  774. package/build-types/style-provider/index.d.ts +7 -4
  775. package/build-types/style-provider/index.d.ts.map +1 -1
  776. package/build-types/style-provider/types.d.ts +15 -0
  777. package/build-types/style-provider/types.d.ts.map +1 -0
  778. package/build-types/text/hook.d.ts.map +1 -1
  779. package/build-types/toggle-group-control/stories/index.d.ts +25 -0
  780. package/build-types/toggle-group-control/stories/index.d.ts.map +1 -0
  781. package/build-types/toggle-group-control/test/index.d.ts +2 -0
  782. package/build-types/toggle-group-control/test/index.d.ts.map +1 -0
  783. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +6 -3
  784. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  785. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +6 -1
  786. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  787. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +6 -7
  788. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  789. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  790. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +4 -1
  791. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  792. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +11 -9
  793. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  794. package/build-types/toggle-group-control/types.d.ts +27 -8
  795. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  796. package/build-types/tools-panel/styles.d.ts +1 -1
  797. package/build-types/tools-panel/styles.d.ts.map +1 -1
  798. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  799. package/build-types/tooltip/index.d.ts.map +1 -1
  800. package/build-types/tree-select/index.d.ts.map +1 -1
  801. package/build-types/tree-select/types.d.ts +1 -0
  802. package/build-types/tree-select/types.d.ts.map +1 -1
  803. package/build-types/ui/context/context-connect.d.ts +3 -0
  804. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  805. package/build-types/ui/context/use-context-system.d.ts.map +1 -1
  806. package/build-types/ui/form-group/use-form-group.d.ts +2 -2
  807. package/build-types/ui/tooltip/styles.d.ts.map +1 -1
  808. package/build-types/ui/utils/space.d.ts +7 -1
  809. package/build-types/ui/utils/space.d.ts.map +1 -1
  810. package/build-types/unit-control/index.d.ts +4 -3
  811. package/build-types/unit-control/index.d.ts.map +1 -1
  812. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  813. package/build-types/unit-control/styles/unit-control-styles.d.ts +0 -1
  814. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  815. package/build-types/unit-control/types.d.ts +7 -9
  816. package/build-types/unit-control/types.d.ts.map +1 -1
  817. package/build-types/utils/base-label.d.ts +2 -0
  818. package/build-types/utils/base-label.d.ts.map +1 -0
  819. package/build-types/utils/box-sizing.d.ts +2 -0
  820. package/build-types/utils/box-sizing.d.ts.map +1 -0
  821. package/build-types/utils/colors-values.d.ts +18 -97
  822. package/build-types/utils/colors-values.d.ts.map +1 -1
  823. package/build-types/utils/rtl.d.ts.map +1 -1
  824. package/build-types/utils/strings.d.ts +2 -0
  825. package/build-types/utils/strings.d.ts.map +1 -0
  826. package/build-types/utils/style-mixins.d.ts +2 -0
  827. package/package.json +22 -21
  828. package/src/alignment-matrix-control/index.js +1 -1
  829. package/src/alignment-matrix-control/stories/index.js +49 -24
  830. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +1 -3
  831. package/src/angle-picker-control/index.js +7 -2
  832. package/src/angle-picker-control/stories/index.js +8 -5
  833. package/src/angle-picker-control/styles/angle-picker-control-styles.js +12 -3
  834. package/src/autocomplete/index.js +9 -18
  835. package/src/base-control/index.tsx +5 -3
  836. package/src/base-control/stories/index.tsx +1 -0
  837. package/src/base-control/styles/base-control-styles.ts +11 -2
  838. package/src/base-control/types.ts +0 -1
  839. package/src/base-field/styles.js +1 -1
  840. package/src/base-field/test/__snapshots__/index.js.snap +2 -2
  841. package/src/border-control/border-control/component.tsx +41 -32
  842. package/src/border-control/border-control/hook.ts +4 -9
  843. package/src/border-control/border-control-dropdown/component.tsx +50 -45
  844. package/src/border-control/border-control-dropdown/hook.ts +0 -5
  845. package/src/border-control/stories/index.tsx +3 -0
  846. package/src/border-control/styles.ts +25 -70
  847. package/src/border-control/test/index.js +19 -8
  848. package/src/box-control/all-input-control.js +3 -27
  849. package/src/box-control/axial-input-controls.js +1 -1
  850. package/src/box-control/index.js +5 -6
  851. package/src/box-control/styles/box-control-styles.js +1 -2
  852. package/src/box-control/styles/box-control-visualizer-styles.js +0 -1
  853. package/src/box-control/test/index.js +8 -8
  854. package/src/box-control/utils.js +38 -13
  855. package/src/button/test/index.js +188 -146
  856. package/src/card/test/__snapshots__/index.js.snap +8 -8
  857. package/src/color-list-picker/index.js +15 -3
  858. package/src/color-list-picker/style.scss +11 -0
  859. package/src/color-palette/index.js +51 -24
  860. package/src/color-palette/index.native.js +10 -6
  861. package/src/color-palette/stories/index.js +1 -1
  862. package/src/color-palette/style.scss +5 -0
  863. package/src/color-palette/test/__snapshots__/index.js.snap +17 -3
  864. package/src/color-palette/test/utils.ts +19 -1
  865. package/src/color-picker/hex-input.tsx +2 -1
  866. package/src/color-picker/input-with-slider.tsx +2 -1
  867. package/src/color-picker/styles.ts +3 -11
  868. package/src/combobox-control/README.md +7 -0
  869. package/src/combobox-control/index.js +25 -15
  870. package/src/combobox-control/stories/index.js +57 -7
  871. package/src/combobox-control/style.scss +0 -1
  872. package/src/confirm-dialog/README.md +1 -1
  873. package/src/confirm-dialog/test/index.js +85 -62
  874. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  875. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +54 -50
  876. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -3
  877. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/test/utils.js +0 -0
  878. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  879. package/src/custom-gradient-picker/index.js +18 -3
  880. package/src/custom-gradient-picker/stories/index.js +4 -3
  881. package/src/custom-gradient-picker/style.scss +30 -39
  882. package/src/custom-select-control/README.md +10 -0
  883. package/src/custom-select-control/index.js +54 -29
  884. package/src/custom-select-control/stories/index.js +7 -2
  885. package/src/custom-select-control/style.scss +2 -43
  886. package/src/custom-select-control/styles.ts +28 -0
  887. package/src/custom-select-control/test/index.js +4 -1
  888. package/src/date-time/constants.ts +1 -0
  889. package/src/date-time/date/index.tsx +289 -184
  890. package/src/date-time/date/styles.ts +86 -27
  891. package/src/date-time/date/test/index.tsx +18 -28
  892. package/src/date-time/date-time/index.tsx +3 -2
  893. package/src/date-time/time/index.tsx +30 -24
  894. package/src/date-time/time/styles.ts +3 -6
  895. package/src/date-time/utils.ts +17 -0
  896. package/src/dimension-control/index.js +1 -5
  897. package/src/disabled/index.tsx +80 -0
  898. package/src/disabled/stories/index.tsx +87 -0
  899. package/src/disabled/styles/{disabled-styles.js → disabled-styles.tsx} +0 -0
  900. package/src/disabled/test/index.tsx +174 -0
  901. package/src/disabled/types.ts +13 -0
  902. package/src/divider/README.md +12 -5
  903. package/src/divider/component.tsx +2 -3
  904. package/src/divider/index.ts +1 -1
  905. package/src/divider/stories/index.tsx +4 -4
  906. package/src/divider/styles.ts +7 -7
  907. package/src/divider/test/__snapshots__/{index.js.snap → index.tsx.snap} +7 -7
  908. package/src/divider/test/index.tsx +40 -0
  909. package/src/divider/types.ts +21 -15
  910. package/src/draggable/README.md +1 -1
  911. package/src/dropdown/dropdown-content-wrapper.tsx +59 -0
  912. package/src/dropdown/index.js +3 -5
  913. package/src/dropdown/stories/index.js +60 -69
  914. package/src/dropdown/styles.ts +38 -0
  915. package/src/dropdown/types.ts +8 -0
  916. package/src/dropdown-menu/stories/index.js +13 -2
  917. package/src/duotone-picker/custom-duotone-bar.js +1 -1
  918. package/src/duotone-picker/duotone-picker.js +34 -26
  919. package/src/duotone-picker/duotone-swatch.js +12 -5
  920. package/src/duotone-picker/stories/duotone-picker.js +66 -0
  921. package/src/duotone-picker/stories/duotone-swatch.js +32 -0
  922. package/src/elevation/README.md +16 -14
  923. package/src/elevation/component.tsx +48 -0
  924. package/src/elevation/{hook.js → hook.ts} +20 -17
  925. package/src/elevation/{index.js → index.ts} +0 -0
  926. package/src/elevation/stories/index.tsx +85 -0
  927. package/src/elevation/{styles.js → styles.ts} +0 -0
  928. package/src/elevation/test/__snapshots__/{index.js.snap → index.tsx.snap} +19 -13
  929. package/src/elevation/test/index.tsx +64 -0
  930. package/src/elevation/types.ts +12 -19
  931. package/src/external-link/index.tsx +10 -0
  932. package/src/flex/flex/README.md +20 -18
  933. package/src/flex/flex/component.tsx +59 -0
  934. package/src/flex/flex/{hook.js → hook.ts} +14 -13
  935. package/src/flex/flex/{index.js → index.ts} +0 -0
  936. package/src/flex/flex-block/README.md +3 -7
  937. package/src/flex/flex-block/component.tsx +41 -0
  938. package/src/flex/flex-block/{hook.js → hook.ts} +5 -5
  939. package/src/flex/flex-block/{index.js → index.ts} +0 -0
  940. package/src/flex/flex-item/README.md +6 -9
  941. package/src/flex/flex-item/component.tsx +41 -0
  942. package/src/flex/flex-item/{hook.js → hook.ts} +10 -7
  943. package/src/flex/flex-item/{index.js → index.ts} +0 -0
  944. package/src/flex/{index.js → index.ts} +0 -0
  945. package/src/flex/stories/index.tsx +81 -0
  946. package/src/flex/{styles.js → styles.ts} +0 -0
  947. package/src/flex/test/__snapshots__/{index.js.snap → index.tsx.snap} +49 -9
  948. package/src/flex/test/index.tsx +84 -0
  949. package/src/flex/types.ts +17 -10
  950. package/src/focal-point-picker/index.js +10 -5
  951. package/src/focal-point-picker/styles/focal-point-picker-style.js +0 -5
  952. package/src/focal-point-picker/styles/focal-point-style.js +0 -2
  953. package/src/focal-point-picker/test/index.js +78 -45
  954. package/src/font-size-picker/index.js +160 -132
  955. package/src/font-size-picker/stories/index.js +7 -0
  956. package/src/font-size-picker/style.scss +8 -5
  957. package/src/font-size-picker/test/index.js +13 -6
  958. package/src/font-size-picker/test/{util.js → utils.js} +77 -1
  959. package/src/font-size-picker/utils.js +38 -23
  960. package/src/form-token-field/README.md +3 -1
  961. package/src/form-token-field/index.tsx +29 -12
  962. package/src/form-token-field/stories/index.tsx +22 -0
  963. package/src/form-token-field/style.scss +0 -5
  964. package/src/form-token-field/suggestions-list.tsx +21 -12
  965. package/src/form-token-field/test/index.js +32 -1
  966. package/src/form-token-field/types.ts +23 -2
  967. package/src/gradient-picker/index.js +22 -7
  968. package/src/gradient-picker/stories/index.js +56 -81
  969. package/src/guide/index.js +3 -1
  970. package/src/guide/page-control.js +1 -6
  971. package/src/guide/stories/index.js +12 -11
  972. package/src/guide/test/index.js +54 -37
  973. package/src/guide/test/page-control.js +14 -17
  974. package/src/higher-order/with-notices/test/index.js +4 -2
  975. package/src/higher-order/with-spoken-messages/test/index.js +1 -1
  976. package/src/index.js +7 -1
  977. package/src/input-control/index.tsx +6 -0
  978. package/src/input-control/input-base.tsx +28 -13
  979. package/src/input-control/input-prefix-wrapper.tsx +48 -0
  980. package/src/input-control/input-suffix-wrapper.tsx +48 -0
  981. package/src/input-control/reducer/actions.ts +3 -1
  982. package/src/input-control/reducer/reducer.ts +27 -10
  983. package/src/input-control/reducer/state.ts +7 -2
  984. package/src/input-control/stories/index.tsx +15 -2
  985. package/src/input-control/styles/input-control-styles.tsx +28 -12
  986. package/src/input-control/test/index.js +20 -4
  987. package/src/input-control/types.ts +52 -3
  988. package/src/item-group/styles.ts +3 -3
  989. package/src/menu-group/test/index.js +18 -7
  990. package/src/mobile/bottom-sheet/index.native.js +2 -4
  991. package/src/mobile/global-styles-context/utils.native.js +22 -4
  992. package/src/mobile/image/index.native.js +17 -8
  993. package/src/mobile/link-picker/link-picker-screen.native.js +12 -4
  994. package/src/mobile/media-edit/index.native.js +2 -7
  995. package/src/mobile/picker/index.android.js +10 -4
  996. package/src/mobile/picker/index.ios.js +16 -0
  997. package/src/mobile/picker/styles.native.scss +12 -4
  998. package/src/modal/index.js +1 -2
  999. package/src/modal/style.scss +5 -1
  1000. package/src/modal/test/index.js +11 -9
  1001. package/src/navigable-container/container.js +12 -18
  1002. package/src/navigable-container/test/menu.js +14 -11
  1003. package/src/navigator/navigator-back-button/hook.ts +0 -3
  1004. package/src/navigator/navigator-button/hook.ts +0 -3
  1005. package/src/notice/list.js +12 -10
  1006. package/src/palette-edit/index.js +1 -0
  1007. package/src/palette-edit/styles.js +6 -5
  1008. package/src/panel/style.scss +4 -1
  1009. package/src/placeholder/README.md +49 -9
  1010. package/src/placeholder/{index.js → index.tsx} +27 -23
  1011. package/src/placeholder/stories/index.tsx +64 -0
  1012. package/src/placeholder/style.scss +65 -24
  1013. package/src/placeholder/test/index.tsx +174 -0
  1014. package/src/placeholder/types.ts +48 -0
  1015. package/src/popover/README.md +7 -0
  1016. package/src/popover/index.js +256 -157
  1017. package/src/popover/stories/index.js +213 -96
  1018. package/src/popover/style.scss +61 -7
  1019. package/src/popover/test/__snapshots__/index.js.snap +6 -6
  1020. package/src/popover/test/index.js +138 -23
  1021. package/src/popover/utils.js +107 -0
  1022. package/src/radio-control/index.tsx +1 -2
  1023. package/src/range-control/README.md +1 -1
  1024. package/src/range-control/index.tsx +3 -0
  1025. package/src/range-control/styles/range-control-styles.ts +9 -16
  1026. package/src/range-control/test/index.tsx +30 -0
  1027. package/src/range-control/types.ts +9 -4
  1028. package/src/range-control/utils.ts +4 -1
  1029. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +1 -1
  1030. package/src/sandbox/index.native.js +14 -1
  1031. package/src/scroll-lock/README.md +1 -1
  1032. package/src/scroll-lock/{index.js → index.tsx} +34 -7
  1033. package/src/scroll-lock/stories/index.tsx +96 -0
  1034. package/src/scroll-lock/test/index.tsx +26 -0
  1035. package/src/select-control/chevron-down.tsx +25 -0
  1036. package/src/select-control/index.tsx +7 -11
  1037. package/src/select-control/styles/select-control-styles.ts +54 -22
  1038. package/src/select-control/types.ts +1 -0
  1039. package/src/shortcut/{index.js → index.tsx} +5 -9
  1040. package/src/shortcut/test/__snapshots__/index.tsx.snap +15 -0
  1041. package/src/shortcut/test/index.tsx +41 -0
  1042. package/src/shortcut/types.ts +10 -0
  1043. package/src/slot-fill/test/slot.js +5 -5
  1044. package/src/snackbar/list.js +3 -2
  1045. package/src/spacer/component.tsx +3 -1
  1046. package/src/spinner/index.tsx +2 -0
  1047. package/src/style-provider/index.tsx +41 -0
  1048. package/src/style-provider/types.ts +15 -0
  1049. package/src/style.scss +0 -2
  1050. package/src/text/hook.js +5 -3
  1051. package/src/text/styles.js +1 -1
  1052. package/src/text/test/index.tsx +1 -1
  1053. package/src/toggle-group-control/stories/index.tsx +127 -0
  1054. package/src/toggle-group-control/test/__snapshots__/{index.js.snap → index.tsx.snap} +56 -26
  1055. package/src/toggle-group-control/test/{index.js → index.tsx} +2 -4
  1056. package/src/toggle-group-control/toggle-group-control/README.md +2 -0
  1057. package/src/toggle-group-control/toggle-group-control/component.tsx +20 -11
  1058. package/src/toggle-group-control/toggle-group-control/styles.ts +30 -7
  1059. package/src/toggle-group-control/toggle-group-control-option/component.tsx +19 -3
  1060. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -0
  1061. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +17 -3
  1062. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +6 -8
  1063. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +30 -7
  1064. package/src/toggle-group-control/types.ts +74 -53
  1065. package/src/toolbar/test/index.js +4 -4
  1066. package/src/toolbar-group/test/index.js +9 -15
  1067. package/src/tools-panel/styles.ts +9 -18
  1068. package/src/tools-panel/test/index.js +3 -2
  1069. package/src/tools-panel/tools-panel/README.md +94 -21
  1070. package/src/tools-panel/tools-panel/hook.ts +6 -1
  1071. package/src/tooltip/index.js +56 -10
  1072. package/src/tooltip/stories/index.js +28 -13
  1073. package/src/tooltip/style.scss +1 -1
  1074. package/src/tooltip/test/index.js +188 -172
  1075. package/src/tree-select/index.tsx +5 -4
  1076. package/src/tree-select/types.ts +4 -0
  1077. package/src/ui/context/context-connect.ts +3 -2
  1078. package/src/ui/context/test/context-system-provider.js +101 -1
  1079. package/src/ui/context/use-context-system.js +7 -2
  1080. package/src/ui/tooltip/styles.js +1 -0
  1081. package/src/ui/tooltip/test/__snapshots__/index.js.snap +1 -0
  1082. package/src/ui/utils/space.ts +7 -1
  1083. package/src/unit-control/index.tsx +2 -2
  1084. package/src/unit-control/stories/index.tsx +16 -23
  1085. package/src/unit-control/styles/unit-control-styles.ts +100 -46
  1086. package/src/unit-control/test/__snapshots__/index.tsx.snap +4 -4
  1087. package/src/unit-control/types.ts +12 -9
  1088. package/src/utils/base-label.ts +13 -0
  1089. package/src/utils/box-sizing.ts +14 -0
  1090. package/src/utils/colors-values.js +42 -137
  1091. package/src/utils/config-values.js +1 -1
  1092. package/src/utils/input/input-control.js +6 -6
  1093. package/src/utils/rtl.js +6 -2
  1094. package/src/utils/strings.ts +72 -0
  1095. package/src/utils/style-mixins.js +2 -0
  1096. package/src/utils/test/strings.js +15 -0
  1097. package/tsconfig.json +1 -0
  1098. package/tsconfig.tsbuildinfo +1 -1
  1099. package/build/custom-gradient-bar/constants.js.map +0 -1
  1100. package/build/custom-gradient-bar/control-points.js.map +0 -1
  1101. package/build/custom-gradient-bar/index.js.map +0 -1
  1102. package/build/custom-gradient-bar/utils.js.map +0 -1
  1103. package/build/date-time/date/utils.js +0 -34
  1104. package/build/date-time/date/utils.js.map +0 -1
  1105. package/build/swatch/index.js +0 -39
  1106. package/build/swatch/index.js.map +0 -1
  1107. package/build-module/custom-gradient-bar/constants.js.map +0 -1
  1108. package/build-module/custom-gradient-bar/control-points.js.map +0 -1
  1109. package/build-module/custom-gradient-bar/index.js.map +0 -1
  1110. package/build-module/custom-gradient-bar/utils.js.map +0 -1
  1111. package/build-module/date-time/date/utils.js +0 -22
  1112. package/build-module/date-time/date/utils.js.map +0 -1
  1113. package/build-module/swatch/index.js +0 -28
  1114. package/build-module/swatch/index.js.map +0 -1
  1115. package/build-types/date-time/date/test/utils.d.ts +0 -2
  1116. package/build-types/date-time/date/test/utils.d.ts.map +0 -1
  1117. package/build-types/date-time/date/utils.d.ts +0 -15
  1118. package/build-types/date-time/date/utils.d.ts.map +0 -1
  1119. package/src/date-time/date/datepicker.scss +0 -863
  1120. package/src/date-time/date/style.scss +0 -85
  1121. package/src/date-time/date/test/utils.ts +0 -32
  1122. package/src/date-time/date/utils.ts +0 -20
  1123. package/src/date-time/style.scss +0 -1
  1124. package/src/disabled/index.js +0 -55
  1125. package/src/disabled/stories/index.js +0 -61
  1126. package/src/disabled/test/index.js +0 -240
  1127. package/src/divider/test/index.js +0 -41
  1128. package/src/elevation/component.js +0 -43
  1129. package/src/elevation/stories/index.js +0 -148
  1130. package/src/elevation/test/index.js +0 -51
  1131. package/src/flex/flex/component.js +0 -60
  1132. package/src/flex/flex-block/component.js +0 -30
  1133. package/src/flex/flex-item/component.js +0 -30
  1134. package/src/flex/stories/index.js +0 -29
  1135. package/src/flex/test/index.js +0 -77
  1136. package/src/menu-group/test/__snapshots__/index.js.snap +0 -23
  1137. package/src/placeholder/stories/index.js +0 -44
  1138. package/src/placeholder/test/index.js +0 -163
  1139. package/src/popover/stories/_utils.js +0 -64
  1140. package/src/scroll-lock/stories/index.js +0 -71
  1141. package/src/scroll-lock/test/index.js +0 -53
  1142. package/src/shortcut/test/index.js +0 -37
  1143. package/src/style-provider/index.js +0 -31
  1144. package/src/swatch/index.js +0 -19
  1145. package/src/swatch/style.scss +0 -21
  1146. package/src/toggle-group-control/stories/index.js +0 -187
  1147. package/src/tools-panel/test/__snapshots__/index.js.snap +0 -219
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/custom-select-control/index.js"],"names":["useSelect","classnames","Icon","check","chevronDown","__","sprintf","useCallback","Button","VisuallyHidden","itemToString","item","name","stateReducer","selectedItem","type","changes","props","items","stateChangeTypes","ToggleButtonKeyDownArrowDown","Math","min","indexOf","length","ToggleButtonKeyDownArrowUp","max","CustomSelectControl","__next36pxDefaultSize","className","hideLabelFromVision","label","describedBy","options","onChange","onSelectedItemChange","value","_selectedItem","getLabelProps","getToggleButtonProps","getMenuProps","getItemProps","isOpen","highlightedIndex","initialSelectedItem","undefined","getDescribedBy","menuProps","onKeyDownHandler","e","stopPropagation","onKeyDown","startsWith","isSmall","map","index","key","__experimentalHint","style"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,WAA1B;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,IAAT,EAAeC,KAAf,EAAsBC,WAAtB,QAAyC,kBAAzC;AAC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AAGC,kBAAY,CAAC,CAAEhC,IAAI,CAAC8C,kBAHrB;AAIC,mCACC7B;AALF,KAHoB,CAJH;AAelB8B,IAAAA,KAAK,EAAE/C,IAAI,CAAC+C;AAfM,GAAF,CADlB,EAmBG/C,IAAI,CAACC,IAnBR,EAoBGD,IAAI,CAAC8C,kBAAL,IACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG9C,IAAI,CAAC8C,kBADR,CArBF,EAyBG9C,IAAI,KAAKG,YAAT,IACD,cAAC,IAAD;AACC,IAAA,IAAI,EAAGX,KADR;AAEC,IAAA,SAAS,EAAC;AAFX,IA1BF,CAFD,CAFF,CA9CD,CADD;AAuFA","sourcesContent":["/**\n * External dependencies\n */\nimport { useSelect } from 'downshift';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Icon, check, chevronDown } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Button, VisuallyHidden } from '../';\n\nconst itemToString = ( item ) => item?.name;\n// This is needed so that in Windows, where\n// the menu does not necessarily open on\n// key up/down, you can still switch between\n// options with the menu closed.\nconst stateReducer = (\n\t{ selectedItem },\n\t{ type, changes, props: { items } }\n) => {\n\tswitch ( type ) {\n\t\tcase useSelect.stateChangeTypes.ToggleButtonKeyDownArrowDown:\n\t\t\t// If we already have a selected item, try to select the next one,\n\t\t\t// without circular navigation. Otherwise, select the first item.\n\t\t\treturn {\n\t\t\t\tselectedItem:\n\t\t\t\t\titems[\n\t\t\t\t\t\tselectedItem\n\t\t\t\t\t\t\t? Math.min(\n\t\t\t\t\t\t\t\t\titems.indexOf( selectedItem ) + 1,\n\t\t\t\t\t\t\t\t\titems.length - 1\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: 0\n\t\t\t\t\t],\n\t\t\t};\n\t\tcase useSelect.stateChangeTypes.ToggleButtonKeyDownArrowUp:\n\t\t\t// If we already have a selected item, try to select the previous one,\n\t\t\t// without circular navigation. Otherwise, select the last item.\n\t\t\treturn {\n\t\t\t\tselectedItem:\n\t\t\t\t\titems[\n\t\t\t\t\t\tselectedItem\n\t\t\t\t\t\t\t? Math.max( items.indexOf( selectedItem ) - 1, 0 )\n\t\t\t\t\t\t\t: items.length - 1\n\t\t\t\t\t],\n\t\t\t};\n\t\tdefault:\n\t\t\treturn changes;\n\t}\n};\nexport default function CustomSelectControl( {\n\t/** Start opting into the larger default height that will become the default size in a future version. */\n\t__next36pxDefaultSize = false,\n\tclassName,\n\thideLabelFromVision,\n\tlabel,\n\tdescribedBy,\n\toptions: items,\n\tonChange: onSelectedItemChange,\n\tvalue: _selectedItem,\n} ) {\n\tconst {\n\t\tgetLabelProps,\n\t\tgetToggleButtonProps,\n\t\tgetMenuProps,\n\t\tgetItemProps,\n\t\tisOpen,\n\t\thighlightedIndex,\n\t\tselectedItem,\n\t} = useSelect( {\n\t\tinitialSelectedItem: items[ 0 ],\n\t\titems,\n\t\titemToString,\n\t\tonSelectedItemChange,\n\t\t...( typeof _selectedItem !== 'undefined' && _selectedItem !== null\n\t\t\t? { selectedItem: _selectedItem }\n\t\t\t: undefined ),\n\t\tstateReducer,\n\t} );\n\n\tfunction getDescribedBy() {\n\t\tif ( describedBy ) {\n\t\t\treturn describedBy;\n\t\t}\n\n\t\tif ( ! selectedItem ) {\n\t\t\treturn __( 'No selection' );\n\t\t}\n\n\t\t// translators: %s: The selected option.\n\t\treturn sprintf( __( 'Currently selected: %s' ), selectedItem.name );\n\t}\n\n\tconst menuProps = getMenuProps( {\n\t\tclassName: 'components-custom-select-control__menu',\n\t\t'aria-hidden': ! isOpen,\n\t} );\n\n\tconst onKeyDownHandler = useCallback(\n\t\t( e ) => {\n\t\t\te.stopPropagation();\n\t\t\tmenuProps?.onKeyDown?.( e );\n\t\t},\n\t\t[ menuProps ]\n\t);\n\n\t// We need this here, because the null active descendant is not fully ARIA compliant.\n\tif (\n\t\tmenuProps[ 'aria-activedescendant' ]?.startsWith( 'downshift-null' )\n\t) {\n\t\tdelete menuProps[ 'aria-activedescendant' ];\n\t}\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-custom-select-control',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ hideLabelFromVision ? (\n\t\t\t\t<VisuallyHidden as=\"label\" { ...getLabelProps() }>\n\t\t\t\t\t{ label }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) : (\n\t\t\t\t/* eslint-disable-next-line jsx-a11y/label-has-associated-control, jsx-a11y/label-has-for */\n\t\t\t\t<label\n\t\t\t\t\t{ ...getLabelProps( {\n\t\t\t\t\t\tclassName: 'components-custom-select-control__label',\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</label>\n\t\t\t) }\n\t\t\t<Button\n\t\t\t\t{ ...getToggleButtonProps( {\n\t\t\t\t\t// This is needed because some speech recognition software don't support `aria-labelledby`.\n\t\t\t\t\t'aria-label': label,\n\t\t\t\t\t'aria-labelledby': undefined,\n\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t'components-custom-select-control__button',\n\t\t\t\t\t\t{ 'is-next-36px-default-size': __next36pxDefaultSize }\n\t\t\t\t\t),\n\t\t\t\t\tisSmall: ! __next36pxDefaultSize,\n\t\t\t\t\tdescribedBy: getDescribedBy(),\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t{ itemToString( selectedItem ) }\n\t\t\t\t<Icon\n\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'components-custom-select-control__button-icon',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-next-36px-default-size': __next36pxDefaultSize,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tsize={ 18 }\n\t\t\t\t/>\n\t\t\t</Button>\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<ul { ...menuProps } onKeyDown={ onKeyDownHandler }>\n\t\t\t\t{ isOpen &&\n\t\t\t\t\titems.map( ( item, index ) => (\n\t\t\t\t\t\t// eslint-disable-next-line react/jsx-key\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t{ ...getItemProps( {\n\t\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\tkey: item.key,\n\t\t\t\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t\t\t\titem.className,\n\t\t\t\t\t\t\t\t\t'components-custom-select-control__item',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'is-highlighted':\n\t\t\t\t\t\t\t\t\t\t\tindex === highlightedIndex,\n\t\t\t\t\t\t\t\t\t\t'has-hint': !! item.__experimentalHint,\n\t\t\t\t\t\t\t\t\t\t'is-next-36px-default-size':\n\t\t\t\t\t\t\t\t\t\t\t__next36pxDefaultSize,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tstyle: item.style,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.name }\n\t\t\t\t\t\t\t{ item.__experimentalHint && (\n\t\t\t\t\t\t\t\t<span className=\"components-custom-select-control__item-hint\">\n\t\t\t\t\t\t\t\t\t{ item.__experimentalHint }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ item === selectedItem && (\n\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\t\t\tclassName=\"components-custom-select-control__item-icon\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/custom-select-control/index.js"],"names":["useSelect","classnames","Icon","check","__","sprintf","useCallback","useState","deprecated","VisuallyHidden","Select","SelectControlSelect","SelectControlChevronDown","InputBaseWithBackCompatMinWidth","StyledLabel","itemToString","item","name","stateReducer","selectedItem","type","changes","props","items","stateChangeTypes","ToggleButtonKeyDownArrowDown","Math","min","indexOf","length","ToggleButtonKeyDownArrowUp","max","CustomSelectControl","__next36pxDefaultSize","__nextUnconstrainedWidth","className","hideLabelFromVision","label","describedBy","options","onChange","onSelectedItemChange","size","value","_selectedItem","getLabelProps","getToggleButtonProps","getMenuProps","getItemProps","isOpen","highlightedIndex","initialSelectedItem","undefined","isFocused","setIsFocused","since","version","hint","getDescribedBy","menuProps","onKeyDownHandler","e","stopPropagation","onKeyDown","startsWith","map","index","key","__experimentalHint","style"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,WAA1B;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,IAAT,EAAeC,KAAf,QAA4B,kBAA5B;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,WAAT,EAAsBC,QAAtB,QAAsC,oBAAtC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AAEA;AACA;AACA;;AACA,SAASC,cAAT,QAA+B,KAA/B;AACA,SAASC,MAAM,IAAIC,mBAAnB,QAA8C,gDAA9C;AACA,OAAOC,wBAAP,MAAqC,gCAArC;AACA,SAASC,+BAAT,QAAgD,UAAhD;AACA,SAASC,WAAT,QAA4B,4CAA5B;;AAEA,MAAMC,YAAY,GAAKC,IAAF,IAAYA,IAAZ,aAAYA,IAAZ,uBAAYA,IAAI,CAAEC,IAAvC,C,CACA;AACA;AACA;AACA;;;AACA,MAAMC,YAAY,GAAG,iBAGhB;AAAA,MAFJ;AAAEC,IAAAA;AAAF,GAEI;AAAA,MADJ;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,OAAR;AAAiBC,IAAAA,KAAK,EAAE;AAAEC,MAAAA;AAAF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C,IAAAA,IADkB;AAElBkD,IAAAA,KAFkB;AAGlBC,IAAAA,GAAG,EAAEnD,IAAI,CAACmD,GAHQ;AAIlBhC,IAAAA,SAAS,EAAElC,UAAU,CACpBe,IAAI,CAACmB,SADe,EAEpB,wCAFoB,EAGpB;AACC,wBACC+B,KAAK,KAAKhB,gBAFZ;AAGC,kBAAY,CAAC,CAAElC,IAAI,CAACoD,kBAHrB;AAIC,mCACCnC;AALF,KAHoB,CAJH;AAelBoC,IAAAA,KAAK,EAAErD,IAAI,CAACqD;AAfM,GAAF,CADlB,EAmBGrD,IAAI,CAACC,IAnBR,EAoBGD,IAAI,CAACoD,kBAAL,IACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGpD,IAAI,CAACoD,kBADR,CArBF,EAyBGpD,IAAI,KAAKG,YAAT,IACD,cAAC,IAAD;AACC,IAAA,IAAI,EAAGhB,KADR;AAEC,IAAA,SAAS,EAAC;AAFX,IA1BF,CAFD,CAFF,CAjDD,CADD;AA0FA","sourcesContent":["/**\n * External dependencies\n */\nimport { useSelect } from 'downshift';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Icon, check } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useState } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../';\nimport { Select as SelectControlSelect } from '../select-control/styles/select-control-styles';\nimport SelectControlChevronDown from '../select-control/chevron-down';\nimport { InputBaseWithBackCompatMinWidth } from './styles';\nimport { StyledLabel } from '../base-control/styles/base-control-styles';\n\nconst itemToString = ( item ) => item?.name;\n// This is needed so that in Windows, where\n// the menu does not necessarily open on\n// key up/down, you can still switch between\n// options with the menu closed.\nconst stateReducer = (\n\t{ selectedItem },\n\t{ type, changes, props: { items } }\n) => {\n\tswitch ( type ) {\n\t\tcase useSelect.stateChangeTypes.ToggleButtonKeyDownArrowDown:\n\t\t\t// If we already have a selected item, try to select the next one,\n\t\t\t// without circular navigation. Otherwise, select the first item.\n\t\t\treturn {\n\t\t\t\tselectedItem:\n\t\t\t\t\titems[\n\t\t\t\t\t\tselectedItem\n\t\t\t\t\t\t\t? Math.min(\n\t\t\t\t\t\t\t\t\titems.indexOf( selectedItem ) + 1,\n\t\t\t\t\t\t\t\t\titems.length - 1\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: 0\n\t\t\t\t\t],\n\t\t\t};\n\t\tcase useSelect.stateChangeTypes.ToggleButtonKeyDownArrowUp:\n\t\t\t// If we already have a selected item, try to select the previous one,\n\t\t\t// without circular navigation. Otherwise, select the last item.\n\t\t\treturn {\n\t\t\t\tselectedItem:\n\t\t\t\t\titems[\n\t\t\t\t\t\tselectedItem\n\t\t\t\t\t\t\t? Math.max( items.indexOf( selectedItem ) - 1, 0 )\n\t\t\t\t\t\t\t: items.length - 1\n\t\t\t\t\t],\n\t\t\t};\n\t\tdefault:\n\t\t\treturn changes;\n\t}\n};\nexport default function CustomSelectControl( {\n\t/** Start opting into the larger default height that will become the default size in a future version. */\n\t__next36pxDefaultSize = false,\n\t/** Start opting into the unconstrained width that will become the default in a future version. */\n\t__nextUnconstrainedWidth = false,\n\tclassName,\n\thideLabelFromVision,\n\tlabel,\n\tdescribedBy,\n\toptions: items,\n\tonChange: onSelectedItemChange,\n\t/** @type {import('../select-control/types').SelectControlProps.size} */\n\tsize = 'default',\n\tvalue: _selectedItem,\n} ) {\n\tconst {\n\t\tgetLabelProps,\n\t\tgetToggleButtonProps,\n\t\tgetMenuProps,\n\t\tgetItemProps,\n\t\tisOpen,\n\t\thighlightedIndex,\n\t\tselectedItem,\n\t} = useSelect( {\n\t\tinitialSelectedItem: items[ 0 ],\n\t\titems,\n\t\titemToString,\n\t\tonSelectedItemChange,\n\t\t...( typeof _selectedItem !== 'undefined' && _selectedItem !== null\n\t\t\t? { selectedItem: _selectedItem }\n\t\t\t: undefined ),\n\t\tstateReducer,\n\t} );\n\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tif ( ! __nextUnconstrainedWidth ) {\n\t\tdeprecated(\n\t\t\t'Constrained width styles for wp.components.CustomSelectControl',\n\t\t\t{\n\t\t\t\tsince: '6.1',\n\t\t\t\tversion: '6.4',\n\t\t\t\thint: 'Set the `__nextUnconstrainedWidth` prop to true to start opting into the new styles, which will become the default in a future version',\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction getDescribedBy() {\n\t\tif ( describedBy ) {\n\t\t\treturn describedBy;\n\t\t}\n\n\t\tif ( ! selectedItem ) {\n\t\t\treturn __( 'No selection' );\n\t\t}\n\n\t\t// translators: %s: The selected option.\n\t\treturn sprintf( __( 'Currently selected: %s' ), selectedItem.name );\n\t}\n\n\tconst menuProps = getMenuProps( {\n\t\tclassName: 'components-custom-select-control__menu',\n\t\t'aria-hidden': ! isOpen,\n\t} );\n\n\tconst onKeyDownHandler = useCallback(\n\t\t( e ) => {\n\t\t\te.stopPropagation();\n\t\t\tmenuProps?.onKeyDown?.( e );\n\t\t},\n\t\t[ menuProps ]\n\t);\n\n\t// We need this here, because the null active descendant is not fully ARIA compliant.\n\tif (\n\t\tmenuProps[ 'aria-activedescendant' ]?.startsWith( 'downshift-null' )\n\t) {\n\t\tdelete menuProps[ 'aria-activedescendant' ];\n\t}\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-custom-select-control',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ hideLabelFromVision ? (\n\t\t\t\t<VisuallyHidden as=\"label\" { ...getLabelProps() }>\n\t\t\t\t\t{ label }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) : (\n\t\t\t\t/* eslint-disable-next-line jsx-a11y/label-has-associated-control, jsx-a11y/label-has-for */\n\t\t\t\t<StyledLabel\n\t\t\t\t\t{ ...getLabelProps( {\n\t\t\t\t\t\tclassName: 'components-custom-select-control__label',\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</StyledLabel>\n\t\t\t) }\n\t\t\t<InputBaseWithBackCompatMinWidth\n\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\t__nextUnconstrainedWidth={ __nextUnconstrainedWidth }\n\t\t\t\tisFocused={ isOpen || isFocused }\n\t\t\t\t__unstableInputWidth={\n\t\t\t\t\t__nextUnconstrainedWidth ? undefined : 'auto'\n\t\t\t\t}\n\t\t\t\tlabelPosition={ __nextUnconstrainedWidth ? undefined : 'top' }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={ <SelectControlChevronDown /> }\n\t\t\t>\n\t\t\t\t<SelectControlSelect\n\t\t\t\t\tas=\"button\"\n\t\t\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t\t\t\tselectSize={ size }\n\t\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\t\t{ ...getToggleButtonProps( {\n\t\t\t\t\t\t// This is needed because some speech recognition software don't support `aria-labelledby`.\n\t\t\t\t\t\t'aria-label': label,\n\t\t\t\t\t\t'aria-labelledby': undefined,\n\t\t\t\t\t\tclassName: 'components-custom-select-control__button',\n\t\t\t\t\t\tdescribedBy: getDescribedBy(),\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ itemToString( selectedItem ) }\n\t\t\t\t</SelectControlSelect>\n\t\t\t</InputBaseWithBackCompatMinWidth>\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<ul { ...menuProps } onKeyDown={ onKeyDownHandler }>\n\t\t\t\t{ isOpen &&\n\t\t\t\t\titems.map( ( item, index ) => (\n\t\t\t\t\t\t// eslint-disable-next-line react/jsx-key\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t{ ...getItemProps( {\n\t\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\tkey: item.key,\n\t\t\t\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t\t\t\titem.className,\n\t\t\t\t\t\t\t\t\t'components-custom-select-control__item',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'is-highlighted':\n\t\t\t\t\t\t\t\t\t\t\tindex === highlightedIndex,\n\t\t\t\t\t\t\t\t\t\t'has-hint': !! item.__experimentalHint,\n\t\t\t\t\t\t\t\t\t\t'is-next-36px-default-size':\n\t\t\t\t\t\t\t\t\t\t\t__next36pxDefaultSize,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tstyle: item.style,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.name }\n\t\t\t\t\t\t\t{ item.__experimentalHint && (\n\t\t\t\t\t\t\t\t<span className=\"components-custom-select-control__item-hint\">\n\t\t\t\t\t\t\t\t\t{ item.__experimentalHint }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ item === selectedItem && (\n\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\t\t\tclassName=\"components-custom-select-control__item-icon\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import _styled from "@emotion/styled/base";
2
+
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import { css } from '@emotion/react';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import InputBase from '../input-control/input-base';
12
+ import { Container as InputControlContainer } from '../input-control/styles/input-control-styles';
13
+
14
+ const backCompatMinWidth = props => !props.__nextUnconstrainedWidth ? /*#__PURE__*/css(InputControlContainer, "{min-width:130px;}" + (process.env.NODE_ENV === "production" ? "" : ";label:backCompatMinWidth;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLXNlbGVjdC1jb250cm9sL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrQk8iLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9jdXN0b20tc2VsZWN0LWNvbnRyb2wvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgSW5wdXRCYXNlIGZyb20gJy4uL2lucHV0LWNvbnRyb2wvaW5wdXQtYmFzZSc7XG5pbXBvcnQgeyBDb250YWluZXIgYXMgSW5wdXRDb250cm9sQ29udGFpbmVyIH0gZnJvbSAnLi4vaW5wdXQtY29udHJvbC9zdHlsZXMvaW5wdXQtY29udHJvbC1zdHlsZXMnO1xuXG50eXBlIEJhY2tDb21wYXRNaW5XaWR0aFByb3BzID0ge1xuXHRfX25leHRVbmNvbnN0cmFpbmVkV2lkdGg6IGJvb2xlYW47XG59O1xuXG5jb25zdCBiYWNrQ29tcGF0TWluV2lkdGggPSAoIHByb3BzOiBCYWNrQ29tcGF0TWluV2lkdGhQcm9wcyApID0+XG5cdCEgcHJvcHMuX19uZXh0VW5jb25zdHJhaW5lZFdpZHRoXG5cdFx0PyBjc3NgXG5cdFx0XHRcdCR7IElucHV0Q29udHJvbENvbnRhaW5lciB9IHtcblx0XHRcdFx0XHRtaW4td2lkdGg6IDEzMHB4O1xuXHRcdFx0XHR9XG5cdFx0ICBgXG5cdFx0OiAnJztcblxuZXhwb3J0IGNvbnN0IElucHV0QmFzZVdpdGhCYWNrQ29tcGF0TWluV2lkdGggPSBzdHlsZWQoIElucHV0QmFzZSApYFxuXHQkeyBiYWNrQ29tcGF0TWluV2lkdGggfVxuYDtcbiJdfQ== */") : '';
15
+
16
+ export const InputBaseWithBackCompatMinWidth = /*#__PURE__*/_styled(InputBase, process.env.NODE_ENV === "production" ? {
17
+ target: "eswuck60"
18
+ } : {
19
+ target: "eswuck60",
20
+ label: "InputBaseWithBackCompatMinWidth"
21
+ })(backCompatMinWidth, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLXNlbGVjdC1jb250cm9sL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5QmtFIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY3VzdG9tLXNlbGVjdC1jb250cm9sL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IElucHV0QmFzZSBmcm9tICcuLi9pbnB1dC1jb250cm9sL2lucHV0LWJhc2UnO1xuaW1wb3J0IHsgQ29udGFpbmVyIGFzIElucHV0Q29udHJvbENvbnRhaW5lciB9IGZyb20gJy4uL2lucHV0LWNvbnRyb2wvc3R5bGVzL2lucHV0LWNvbnRyb2wtc3R5bGVzJztcblxudHlwZSBCYWNrQ29tcGF0TWluV2lkdGhQcm9wcyA9IHtcblx0X19uZXh0VW5jb25zdHJhaW5lZFdpZHRoOiBib29sZWFuO1xufTtcblxuY29uc3QgYmFja0NvbXBhdE1pbldpZHRoID0gKCBwcm9wczogQmFja0NvbXBhdE1pbldpZHRoUHJvcHMgKSA9PlxuXHQhIHByb3BzLl9fbmV4dFVuY29uc3RyYWluZWRXaWR0aFxuXHRcdD8gY3NzYFxuXHRcdFx0XHQkeyBJbnB1dENvbnRyb2xDb250YWluZXIgfSB7XG5cdFx0XHRcdFx0bWluLXdpZHRoOiAxMzBweDtcblx0XHRcdFx0fVxuXHRcdCAgYFxuXHRcdDogJyc7XG5cbmV4cG9ydCBjb25zdCBJbnB1dEJhc2VXaXRoQmFja0NvbXBhdE1pbldpZHRoID0gc3R5bGVkKCBJbnB1dEJhc2UgKWBcblx0JHsgYmFja0NvbXBhdE1pbldpZHRoIH1cbmA7XG4iXX0= */"));
22
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/components/src/custom-select-control/styles.ts"],"names":["css","InputBase","Container","InputControlContainer","backCompatMinWidth","props","__nextUnconstrainedWidth","InputBaseWithBackCompatMinWidth"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,gBAApB;;AAGA;AACA;AACA;AACA,OAAOC,SAAP,MAAsB,6BAAtB;AACA,SAASC,SAAS,IAAIC,qBAAtB,QAAmD,8CAAnD;;AAMA,MAAMC,kBAAkB,GAAKC,KAAF,IAC1B,CAAEA,KAAK,CAACC,wBAAR,gBACGN,GADH,CAEMG,qBAFN,o5CAMG,EAPJ;;AASA,OAAO,MAAMI,+BAA+B,GAAG,qBAAQN,SAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,CACxCG,kBADwC,qzCAArC","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport InputBase from '../input-control/input-base';\nimport { Container as InputControlContainer } from '../input-control/styles/input-control-styles';\n\ntype BackCompatMinWidthProps = {\n\t__nextUnconstrainedWidth: boolean;\n};\n\nconst backCompatMinWidth = ( props: BackCompatMinWidthProps ) =>\n\t! props.__nextUnconstrainedWidth\n\t\t? css`\n\t\t\t\t${ InputControlContainer } {\n\t\t\t\t\tmin-width: 130px;\n\t\t\t\t}\n\t\t `\n\t\t: '';\n\nexport const InputBaseWithBackCompatMinWidth = styled( InputBase )`\n\t${ backCompatMinWidth }\n`;\n"]}
@@ -0,0 +1,2 @@
1
+ export const TIMEZONELESS_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/components/src/date-time/constants.ts"],"names":["TIMEZONELESS_FORMAT"],"mappings":"AAAA,OAAO,MAAMA,mBAAmB,GAAG,uBAA5B","sourcesContent":["export const TIMEZONELESS_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss\";\n"]}
@@ -1,78 +1,26 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
5
4
  * External dependencies
6
5
  */
7
- import moment from 'moment';
8
- // Needed to initialise the default datepicker styles.
9
- // See: https://github.com/airbnb/react-dates#initialize
10
- import 'react-dates/initialize'; // `react-dates` doesn't tree-shake correctly, so we import from the individual
11
- // component here.
12
-
13
- import DayPickerSingleDateController from 'react-dates/lib/components/DayPickerSingleDateController';
6
+ import { useLilius } from 'use-lilius';
7
+ import { format, isSameDay, subMonths, addMonths, startOfDay, isEqual, addDays, subWeeks, addWeeks, isSameMonth } from 'date-fns';
14
8
  /**
15
9
  * WordPress dependencies
16
10
  */
17
11
 
18
- import { useEffect, useRef } from '@wordpress/element';
19
- import { isRTL, _n, sprintf } from '@wordpress/i18n';
12
+ import { __, _n, sprintf, isRTL } from '@wordpress/i18n';
20
13
  import { arrowLeft, arrowRight } from '@wordpress/icons';
14
+ import { dateI18n, __experimentalGetSettings } from '@wordpress/date';
15
+ import { useState, useRef, useEffect } from '@wordpress/element';
21
16
  /**
22
17
  * Internal dependencies
23
18
  */
24
19
 
25
- import { getMomentDate } from './utils';
26
- import { Day, NavPrevButton, NavNextButton } from './styles';
27
- const TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
28
- const ARIAL_LABEL_TIME_FORMAT = 'dddd, LL';
29
-
30
- const noop = () => {};
31
-
32
- function DatePickerDay(_ref) {
33
- let {
34
- day,
35
- events = []
36
- } = _ref;
37
- const ref = useRef(null);
38
- /*
39
- * a11y hack to make the `There is/are n events` string
40
- * available speaking for readers,
41
- * re-defining the aria-label attribute.
42
- * This attribute is handled by the react-dates component.
43
- */
44
-
45
- useEffect(() => {
46
- var _ref$current;
47
-
48
- // Bail when no parent node.
49
- if (!((ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.parentNode) instanceof Element)) {
50
- return;
51
- }
52
-
53
- const {
54
- parentNode
55
- } = ref.current;
56
- const dayAriaLabel = moment(day).format(ARIAL_LABEL_TIME_FORMAT);
57
-
58
- if (!events.length) {
59
- // Set aria-label without event description.
60
- parentNode.setAttribute('aria-label', dayAriaLabel);
61
- return;
62
- }
63
-
64
- const dayWithEventsDescription = sprintf( // translators: 1: Calendar day format, 2: Calendar event number.
65
- _n('%1$s. There is %2$d event.', '%1$s. There are %2$d events.', events.length), dayAriaLabel, events.length);
66
- parentNode.setAttribute('aria-label', dayWithEventsDescription);
67
- }, [day, events.length]);
68
- return createElement(Day, {
69
- ref: ref,
70
- className: "components-datetime__date__day" // Unused, for backwards compatibility.
71
- ,
72
- hasEvents: !!(events !== null && events !== void 0 && events.length),
73
- alignment: "center"
74
- }, day.format('D'));
75
- }
20
+ import { Navigator, NavigatorHeading, Calendar, DayOfWeek, DayButton } from './styles';
21
+ import { inputToDate } from '../utils';
22
+ import Button from '../../button';
23
+ import { TIMEZONELESS_FORMAT } from '../constants';
76
24
  /**
77
25
  * DatePicker is a React component that renders a calendar for date selection.
78
26
  *
@@ -93,141 +41,187 @@ function DatePickerDay(_ref) {
93
41
  * ```
94
42
  */
95
43
 
96
-
97
- export function DatePicker(_ref2) {
44
+ export function DatePicker(_ref) {
98
45
  let {
99
46
  currentDate,
100
47
  onChange,
101
- events,
48
+ events = [],
102
49
  isInvalidDate,
103
50
  onMonthPreviewed,
104
51
  startOfWeek = 0
105
- } = _ref2;
106
- const nodeRef = useRef(null);
107
-
108
- const onMonthPreviewedHandler = newMonthDate => {
109
- onMonthPreviewed === null || onMonthPreviewed === void 0 ? void 0 : onMonthPreviewed(newMonthDate.toISOString());
110
- keepFocusInside();
111
- };
112
- /*
113
- * Todo: We should remove this function ASAP.
114
- * It is kept because focus is lost when we click on the previous and next month buttons.
115
- * This focus loss closes the date picker popover.
116
- * Ideally we should add an upstream commit on react-dates to fix this issue.
117
- */
118
-
119
-
120
- const keepFocusInside = () => {
121
- if (!nodeRef.current) {
122
- return;
123
- }
124
-
125
- const {
126
- ownerDocument
127
- } = nodeRef.current;
128
- const {
129
- activeElement
130
- } = ownerDocument; // If focus was lost.
131
-
132
- if (!activeElement || !nodeRef.current.contains(ownerDocument.activeElement)) {
133
- // Retrieve the focus region div.
134
- const focusRegion = nodeRef.current.querySelector('.DayPicker_focusRegion');
135
-
136
- if (!(focusRegion instanceof HTMLElement)) {
137
- return;
138
- } // Keep the focus on focus region.
139
-
52
+ } = _ref;
53
+ const date = currentDate ? inputToDate(currentDate) : new Date();
54
+ const {
55
+ calendar,
56
+ viewing,
57
+ setSelected,
58
+ setViewing,
59
+ isSelected,
60
+ viewPreviousMonth,
61
+ viewNextMonth
62
+ } = useLilius({
63
+ selected: [startOfDay(date)],
64
+ viewing: startOfDay(date),
65
+ weekStartsOn: startOfWeek
66
+ }); // Used to implement a roving tab index. Tracks the day that receives focus
67
+ // when the user tabs into the calendar.
68
+
69
+ const [focusable, setFocusable] = useState(startOfDay(date)); // Allows us to only programmatically focus() a day when focus was already
70
+ // within the calendar. This stops us stealing focus from e.g. a TimePicker
71
+ // input.
72
+
73
+ const [isFocusWithinCalendar, setIsFocusWithinCalendar] = useState(false); // Update internal state when currentDate prop changes.
74
+
75
+ const [prevCurrentDate, setPrevCurrentDate] = useState(currentDate);
76
+
77
+ if (currentDate !== prevCurrentDate) {
78
+ setPrevCurrentDate(currentDate);
79
+ setSelected([startOfDay(date)]);
80
+ setViewing(startOfDay(date));
81
+ setFocusable(startOfDay(date));
82
+ }
140
83
 
141
- focusRegion.focus();
84
+ return createElement("div", {
85
+ className: "components-datetime__date",
86
+ role: "application",
87
+ "aria-label": __('Calendar')
88
+ }, createElement(Navigator, null, createElement(Button, {
89
+ icon: isRTL() ? arrowRight : arrowLeft,
90
+ variant: "tertiary",
91
+ "aria-label": __('View previous month'),
92
+ onClick: () => {
93
+ viewPreviousMonth();
94
+ setFocusable(subMonths(focusable, 1));
95
+ onMonthPreviewed === null || onMonthPreviewed === void 0 ? void 0 : onMonthPreviewed(format(subMonths(viewing, 1), TIMEZONELESS_FORMAT));
96
+ }
97
+ }), createElement(NavigatorHeading, {
98
+ level: 3
99
+ }, createElement("strong", null, dateI18n('F', viewing, -viewing.getTimezoneOffset())), ' ', dateI18n('Y', viewing, -viewing.getTimezoneOffset())), createElement(Button, {
100
+ icon: isRTL() ? arrowLeft : arrowRight,
101
+ variant: "tertiary",
102
+ "aria-label": __('View next month'),
103
+ onClick: () => {
104
+ viewNextMonth();
105
+ setFocusable(addMonths(focusable, 1));
106
+ onMonthPreviewed === null || onMonthPreviewed === void 0 ? void 0 : onMonthPreviewed(format(addMonths(viewing, 1), TIMEZONELESS_FORMAT));
107
+ }
108
+ })), createElement(Calendar, {
109
+ onFocus: () => setIsFocusWithinCalendar(true),
110
+ onBlur: () => setIsFocusWithinCalendar(false)
111
+ }, calendar[0][0].map(day => createElement(DayOfWeek, {
112
+ key: day.toString()
113
+ }, dateI18n('D', day, -day.getTimezoneOffset()))), calendar[0].map(week => week.map((day, index) => {
114
+ if (!isSameMonth(day, viewing)) {
115
+ return null;
142
116
  }
143
- };
144
-
145
- const onChangeMoment = newDate => {
146
- if (!newDate) {
147
- return;
148
- } // If currentDate is null, use now as momentTime to designate hours, minutes, seconds.
149
-
150
117
 
151
- const momentDate = currentDate ? moment(currentDate) : moment();
152
- const momentTime = {
153
- hours: momentDate.hours(),
154
- minutes: momentDate.minutes(),
155
- seconds: 0
156
- };
157
- onChange === null || onChange === void 0 ? void 0 : onChange(newDate.set(momentTime).format(TIMEZONELESS_FORMAT)); // Keep focus on the date picker.
118
+ return createElement(Day, {
119
+ key: day.toString(),
120
+ day: day,
121
+ column: index + 1,
122
+ isSelected: isSelected(day),
123
+ isFocusable: isEqual(day, focusable),
124
+ isFocusAllowed: isFocusWithinCalendar,
125
+ isToday: isSameDay(day, new Date()),
126
+ isInvalid: isInvalidDate ? isInvalidDate(day) : false,
127
+ numEvents: events.filter(event => isSameDay(event.date, day)).length,
128
+ onClick: () => {
129
+ setSelected([day]);
130
+ setFocusable(day);
131
+ onChange === null || onChange === void 0 ? void 0 : onChange(format( // Don't change the selected date's time fields.
132
+ new Date(day.getFullYear(), day.getMonth(), day.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()), TIMEZONELESS_FORMAT));
133
+ },
134
+ onKeyDown: event => {
135
+ let nextFocusable;
136
+
137
+ if (event.key === 'ArrowLeft') {
138
+ nextFocusable = addDays(day, isRTL() ? 1 : -1);
139
+ }
140
+
141
+ if (event.key === 'ArrowRight') {
142
+ nextFocusable = addDays(day, isRTL() ? -1 : 1);
143
+ }
144
+
145
+ if (event.key === 'ArrowUp') {
146
+ nextFocusable = subWeeks(day, 1);
147
+ }
148
+
149
+ if (event.key === 'ArrowDown') {
150
+ nextFocusable = addWeeks(day, 1);
151
+ }
152
+
153
+ if (nextFocusable) {
154
+ setFocusable(nextFocusable);
155
+
156
+ if (!isSameMonth(nextFocusable, viewing)) {
157
+ setViewing(nextFocusable);
158
+ onMonthPreviewed === null || onMonthPreviewed === void 0 ? void 0 : onMonthPreviewed(format(nextFocusable, TIMEZONELESS_FORMAT));
159
+ }
160
+ }
161
+ }
162
+ });
163
+ }))));
164
+ }
158
165
 
159
- keepFocusInside();
160
- };
166
+ function Day(_ref2) {
167
+ let {
168
+ day,
169
+ column,
170
+ isSelected,
171
+ isFocusable,
172
+ isFocusAllowed,
173
+ isToday,
174
+ isInvalid,
175
+ numEvents,
176
+ onClick,
177
+ onKeyDown
178
+ } = _ref2;
179
+ const ref = useRef(); // Focus the day when it becomes focusable, e.g. because an arrow key is
180
+ // pressed. Only do this if focus is allowed - this stops us stealing focus
181
+ // from e.g. a TimePicker input. Note that isFocusAllowed is not a dep as
182
+ // there is no point calling focus() on an already focused element.
161
183
 
162
- const getEventsPerDay = day => {
163
- if (!(events !== null && events !== void 0 && events.length)) {
164
- return [];
184
+ useEffect(() => {
185
+ if (ref.current && isFocusable && isFocusAllowed) {
186
+ ref.current.focus();
165
187
  }
166
-
167
- return events.filter(eventDay => day.isSame(eventDay.date, 'day'));
168
- };
169
-
170
- const momentDate = getMomentDate(currentDate);
171
- return createElement("div", {
172
- className: "components-datetime__date",
173
- ref: nodeRef
174
- }, createElement(DayPickerSingleDateController, {
175
- date: momentDate,
176
- initialVisibleMonth: null,
177
- daySize: 30,
178
- horizontalMonthPadding: 0,
179
- focused: true,
180
- hideKeyboardShortcutsPanel: true // This is a hack to force the calendar to update on month or year change
181
- // https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665
188
+ }, [isFocusable]);
189
+ return createElement(DayButton, {
190
+ ref: ref,
191
+ className: "components-datetime__date__day" // Unused, for backwards compatibility.
182
192
  ,
183
- key: `datepicker-controller-${momentDate ? momentDate.format('MM-YYYY') : 'null'}`,
184
- noBorder: true,
185
- numberOfMonths: 1,
186
- onDateChange: onChangeMoment,
187
- transitionDuration: 0,
188
- weekDayFormat: "ddd",
189
- dayAriaLabelFormat: ARIAL_LABEL_TIME_FORMAT,
190
- isRTL: isRTL(),
191
- isOutsideRange: date => {
192
- return !!isInvalidDate && isInvalidDate(date.toDate());
193
- },
194
- firstDayOfWeek: startOfWeek,
195
- onPrevMonthClick: onMonthPreviewedHandler,
196
- onNextMonthClick: onMonthPreviewedHandler,
197
- renderDayContents: day => createElement(DatePickerDay, {
198
- day: day,
199
- events: getEventsPerDay(day)
200
- }),
201
- renderMonthElement: _ref3 => {
202
- let {
203
- month
204
- } = _ref3;
205
- return createElement(Fragment, null, createElement("strong", null, month.format('MMMM')), ' ', month.format('YYYY'));
206
- },
207
- renderNavPrevButton: _ref4 => {
208
- let {
209
- ariaLabel,
210
- ...props
211
- } = _ref4;
212
- return createElement(NavPrevButton, _extends({
213
- icon: arrowLeft,
214
- variant: "tertiary",
215
- "aria-label": ariaLabel
216
- }, props));
217
- },
218
- renderNavNextButton: _ref5 => {
219
- let {
220
- ariaLabel,
221
- ...props
222
- } = _ref5;
223
- return createElement(NavNextButton, _extends({
224
- icon: arrowRight,
225
- variant: "tertiary",
226
- "aria-label": ariaLabel
227
- }, props));
228
- },
229
- onFocusChange: noop
230
- }));
193
+ disabled: isInvalid,
194
+ tabIndex: isFocusable ? 0 : -1,
195
+ "aria-label": getDayLabel(day, isSelected, numEvents),
196
+ column: column,
197
+ isSelected: isSelected,
198
+ isToday: isToday,
199
+ hasEvents: numEvents > 0,
200
+ onClick: onClick,
201
+ onKeyDown: onKeyDown
202
+ }, dateI18n('j', day, -day.getTimezoneOffset()));
231
203
  }
204
+
205
+ function getDayLabel(date, isSelected, numEvents) {
206
+ const {
207
+ formats
208
+ } = __experimentalGetSettings();
209
+
210
+ const localizedDate = dateI18n(formats.date, date, -date.getTimezoneOffset());
211
+
212
+ if (isSelected && numEvents > 0) {
213
+ return sprintf( // translators: 1: The calendar date. 2: Number of events on the calendar date.
214
+ _n('%1$s. Selected. There is %2$d event', '%1$s. Selected. There are %2$d events', numEvents), localizedDate, numEvents);
215
+ } else if (isSelected) {
216
+ return sprintf( // translators: %s: The calendar date.
217
+ __('%1$s. Selected'), localizedDate);
218
+ } else if (numEvents > 0) {
219
+ return sprintf( // translators: 1: The calendar date. 2: Number of events on the calendar date.
220
+ _n('%1$s. There is %2$d event', '%1$s. There are %2$d events', numEvents), localizedDate, numEvents);
221
+ }
222
+
223
+ return localizedDate;
224
+ }
225
+
232
226
  export default DatePicker;
233
227
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/date-time/date/index.tsx"],"names":["moment","DayPickerSingleDateController","useEffect","useRef","isRTL","_n","sprintf","arrowLeft","arrowRight","getMomentDate","Day","NavPrevButton","NavNextButton","TIMEZONELESS_FORMAT","ARIAL_LABEL_TIME_FORMAT","noop","DatePickerDay","day","events","ref","current","parentNode","Element","dayAriaLabel","format","length","setAttribute","dayWithEventsDescription","DatePicker","currentDate","onChange","isInvalidDate","onMonthPreviewed","startOfWeek","nodeRef","onMonthPreviewedHandler","newMonthDate","toISOString","keepFocusInside","ownerDocument","activeElement","contains","focusRegion","querySelector","HTMLElement","focus","onChangeMoment","newDate","momentDate","momentTime","hours","minutes","seconds","set","getEventsPerDay","filter","eventDay","isSame","date","toDate","month","ariaLabel","props"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,QAAnB;AAEA;AACA;AACA,OAAO,wBAAP,C,CACA;AACA;;AACA,OAAOC,6BAAP,MAA0C,0DAA1C;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AACA,SAASC,KAAT,EAAgBC,EAAhB,EAAoBC,OAApB,QAAmC,iBAAnC;AACA,SAASC,SAAT,EAAoBC,UAApB,QAAsC,kBAAtC;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,SAA9B;AAEA,SAASC,GAAT,EAAcC,aAAd,EAA6BC,aAA7B,QAAkD,UAAlD;AAEA,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QAAA,OAAO,EAAC,UAFT;AAGC,sBAAaqD;AAHd,SAIMC,KAJN,EADqB;AAAA,KA7CvB;AAqDC,IAAA,aAAa,EAAG/C;AArDjB,IADD,CADD;AA2DA;AAED,eAAea,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport moment from 'moment';\nimport type { Moment } from 'moment';\n// Needed to initialise the default datepicker styles.\n// See: https://github.com/airbnb/react-dates#initialize\nimport 'react-dates/initialize';\n// `react-dates` doesn't tree-shake correctly, so we import from the individual\n// component here.\nimport DayPickerSingleDateController from 'react-dates/lib/components/DayPickerSingleDateController';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { isRTL, _n, sprintf } from '@wordpress/i18n';\nimport { arrowLeft, arrowRight } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getMomentDate } from './utils';\nimport type { DatePickerDayProps, DatePickerProps } from '../types';\nimport { Day, NavPrevButton, NavNextButton } from './styles';\n\nconst TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';\nconst ARIAL_LABEL_TIME_FORMAT = 'dddd, LL';\nconst noop = () => {};\n\nfunction DatePickerDay( { day, events = [] }: DatePickerDayProps ) {\n\tconst ref = useRef< HTMLDivElement >( null );\n\n\t/*\n\t * a11y hack to make the `There is/are n events` string\n\t * available speaking for readers,\n\t * re-defining the aria-label attribute.\n\t * This attribute is handled by the react-dates component.\n\t */\n\tuseEffect( () => {\n\t\t// Bail when no parent node.\n\t\tif ( ! ( ref?.current?.parentNode instanceof Element ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { parentNode } = ref.current;\n\t\tconst dayAriaLabel = moment( day ).format( ARIAL_LABEL_TIME_FORMAT );\n\n\t\tif ( ! events.length ) {\n\t\t\t// Set aria-label without event description.\n\t\t\tparentNode.setAttribute( 'aria-label', dayAriaLabel );\n\t\t\treturn;\n\t\t}\n\n\t\tconst dayWithEventsDescription = sprintf(\n\t\t\t// translators: 1: Calendar day format, 2: Calendar event number.\n\t\t\t_n(\n\t\t\t\t'%1$s. There is %2$d event.',\n\t\t\t\t'%1$s. There are %2$d events.',\n\t\t\t\tevents.length\n\t\t\t),\n\t\t\tdayAriaLabel,\n\t\t\tevents.length\n\t\t);\n\n\t\tparentNode.setAttribute( 'aria-label', dayWithEventsDescription );\n\t}, [ day, events.length ] );\n\n\treturn (\n\t\t<Day\n\t\t\tref={ ref }\n\t\t\tclassName=\"components-datetime__date__day\" // Unused, for backwards compatibility.\n\t\t\thasEvents={ !! events?.length }\n\t\t\talignment=\"center\"\n\t\t>\n\t\t\t{ day.format( 'D' ) }\n\t\t</Day>\n\t);\n}\n\n/**\n * DatePicker is a React component that renders a calendar for date selection.\n *\n * ```jsx\n * import { DatePicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDatePicker = () => {\n * const [ date, setDate ] = useState( new Date() );\n *\n * return (\n * <DatePicker\n * currentDate={ date }\n * onChange={ ( newDate ) => setDate( newDate ) }\n * />\n * );\n * };\n * ```\n */\nexport function DatePicker( {\n\tcurrentDate,\n\tonChange,\n\tevents,\n\tisInvalidDate,\n\tonMonthPreviewed,\n\tstartOfWeek = 0,\n}: DatePickerProps ) {\n\tconst nodeRef = useRef< HTMLDivElement >( null );\n\n\tconst onMonthPreviewedHandler = ( newMonthDate: Moment ) => {\n\t\tonMonthPreviewed?.( newMonthDate.toISOString() );\n\t\tkeepFocusInside();\n\t};\n\n\t/*\n\t * Todo: We should remove this function ASAP.\n\t * It is kept because focus is lost when we click on the previous and next month buttons.\n\t * This focus loss closes the date picker popover.\n\t * Ideally we should add an upstream commit on react-dates to fix this issue.\n\t */\n\tconst keepFocusInside = () => {\n\t\tif ( ! nodeRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { ownerDocument } = nodeRef.current;\n\t\tconst { activeElement } = ownerDocument;\n\n\t\t// If focus was lost.\n\t\tif (\n\t\t\t! activeElement ||\n\t\t\t! nodeRef.current.contains( ownerDocument.activeElement )\n\t\t) {\n\t\t\t// Retrieve the focus region div.\n\t\t\tconst focusRegion = nodeRef.current.querySelector(\n\t\t\t\t'.DayPicker_focusRegion'\n\t\t\t);\n\t\t\tif ( ! ( focusRegion instanceof HTMLElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Keep the focus on focus region.\n\t\t\tfocusRegion.focus();\n\t\t}\n\t};\n\n\tconst onChangeMoment = ( newDate: Moment | null ) => {\n\t\tif ( ! newDate ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If currentDate is null, use now as momentTime to designate hours, minutes, seconds.\n\t\tconst momentDate = currentDate ? moment( currentDate ) : moment();\n\t\tconst momentTime = {\n\t\t\thours: momentDate.hours(),\n\t\t\tminutes: momentDate.minutes(),\n\t\t\tseconds: 0,\n\t\t};\n\n\t\tonChange?.( newDate.set( momentTime ).format( TIMEZONELESS_FORMAT ) );\n\n\t\t// Keep focus on the date picker.\n\t\tkeepFocusInside();\n\t};\n\n\tconst getEventsPerDay = ( day: Moment ) => {\n\t\tif ( ! events?.length ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn events.filter( ( eventDay ) =>\n\t\t\tday.isSame( eventDay.date, 'day' )\n\t\t);\n\t};\n\n\tconst momentDate = getMomentDate( currentDate );\n\n\treturn (\n\t\t<div className=\"components-datetime__date\" ref={ nodeRef }>\n\t\t\t<DayPickerSingleDateController\n\t\t\t\tdate={ momentDate }\n\t\t\t\tinitialVisibleMonth={ null }\n\t\t\t\tdaySize={ 30 }\n\t\t\t\thorizontalMonthPadding={ 0 }\n\t\t\t\tfocused\n\t\t\t\thideKeyboardShortcutsPanel\n\t\t\t\t// This is a hack to force the calendar to update on month or year change\n\t\t\t\t// https://github.com/airbnb/react-dates/issues/240#issuecomment-361776665\n\t\t\t\tkey={ `datepicker-controller-${\n\t\t\t\t\tmomentDate ? momentDate.format( 'MM-YYYY' ) : 'null'\n\t\t\t\t}` }\n\t\t\t\tnoBorder\n\t\t\t\tnumberOfMonths={ 1 }\n\t\t\t\tonDateChange={ onChangeMoment }\n\t\t\t\ttransitionDuration={ 0 }\n\t\t\t\tweekDayFormat=\"ddd\"\n\t\t\t\tdayAriaLabelFormat={ ARIAL_LABEL_TIME_FORMAT }\n\t\t\t\tisRTL={ isRTL() }\n\t\t\t\tisOutsideRange={ ( date ) => {\n\t\t\t\t\treturn !! isInvalidDate && isInvalidDate( date.toDate() );\n\t\t\t\t} }\n\t\t\t\tfirstDayOfWeek={ startOfWeek }\n\t\t\t\tonPrevMonthClick={ onMonthPreviewedHandler }\n\t\t\t\tonNextMonthClick={ onMonthPreviewedHandler }\n\t\t\t\trenderDayContents={ ( day ) => (\n\t\t\t\t\t<DatePickerDay\n\t\t\t\t\t\tday={ day }\n\t\t\t\t\t\tevents={ getEventsPerDay( day ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\trenderMonthElement={ ( { month } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<strong>{ month.format( 'MMMM' ) }</strong>{ ' ' }\n\t\t\t\t\t\t{ month.format( 'YYYY' ) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\trenderNavPrevButton={ ( { ariaLabel, ...props } ) => (\n\t\t\t\t\t<NavPrevButton\n\t\t\t\t\t\ticon={ arrowLeft }\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\trenderNavNextButton={ ( { ariaLabel, ...props } ) => (\n\t\t\t\t\t<NavNextButton\n\t\t\t\t\t\ticon={ arrowRight }\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\tonFocusChange={ noop }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default DatePicker;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/date-time/date/index.tsx"],"names":["useLilius","format","isSameDay","subMonths","addMonths","startOfDay","isEqual","addDays","subWeeks","addWeeks","isSameMonth","__","_n","sprintf","isRTL","arrowLeft","arrowRight","dateI18n","__experimentalGetSettings","useState","useRef","useEffect","Navigator","NavigatorHeading","Calendar","DayOfWeek","DayButton","inputToDate","Button","TIMEZONELESS_FORMAT","DatePicker","currentDate","onChange","events","isInvalidDate","onMonthPreviewed","startOfWeek","date","Date","calendar","viewing","setSelected","setViewing","isSelected","viewPreviousMonth","viewNextMonth","selected","weekStartsOn","focusable","setFocusable","isFocusWithinCalendar","setIsFocusWithinCalendar","prevCurrentDate","setPrevCurrentDate","getTimezoneOffset","map","day","toString","week","index","filter","event","length","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","nextFocusable","key","Day","column","isFocusable","isFocusAllowed","isToday","isInvalid","numEvents","onClick","onKeyDown","ref","current","focus","getDayLabel","formats","localizedDate"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,YAA1B;AACA,SACCC,MADD,EAECC,SAFD,EAGCC,SAHD,EAICC,SAJD,EAKCC,UALD,EAMCC,OAND,EAOCC,OAPD,EAQCC,QARD,EASCC,QATD,EAUCC,WAVD,QAWO,UAXP;AAaA;AACA;AACA;;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,EAA0BC,KAA1B,QAAuC,iBAAvC;AACA,SAASC,SAAT,EAAoBC,UAApB,QAAsC,kBAAtC;AACA,SAASC,QAAT,EAAmBC,yBAAnB,QAAoD,iBAApD;AACA,SAASC,QAAT,EAAmBC,MAAnB,EAA2BC,SAA3B,QAA4C,oBAA5C;AAEA;AACA;AACA;;AAEA,SACCC,SADD,EAECC,gBAFD,EAGCC,QAHD,EAICC,SAJD,EAKCC,SALD,QAMO,UANP;AAOA,SAASC,WAAT,QAA4B,UAA5B;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,SAASC,mBAAT,QAAo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,OAAO,EAAGiC,OARX;AASC,IAAA,SAAS,EAAGE,SAAS,GAAG,CATzB;AAUC,IAAA,OAAO,EAAGC,OAVX;AAWC,IAAA,SAAS,EAAGC;AAXb,KAaG/D,QAAQ,CAAE,GAAF,EAAOuC,GAAP,EAAY,CAACA,GAAG,CAACF,iBAAJ,EAAb,CAbX,CADD;AAiBA;;AAED,SAAS8B,WAAT,CAAsB/C,IAAtB,EAAkCM,UAAlC,EAAuDmC,SAAvD,EAA2E;AAC1E,QAAM;AAAEO,IAAAA;AAAF,MAAcnE,yBAAyB,EAA7C;;AACA,QAAMoE,aAAa,GAAGrE,QAAQ,CAC7BoE,OAAO,CAAChD,IADqB,EAE7BA,IAF6B,EAG7B,CAACA,IAAI,CAACiB,iBAAL,EAH4B,CAA9B;;AAKA,MAAKX,UAAU,IAAImC,SAAS,GAAG,CAA/B,EAAmC;AAClC,WAAOjE,OAAO,EACb;AACAD,IAAAA,EAAE,CACD,qCADC,EAED,uCAFC,EAGDkE,SAHC,CAFW,EAObQ,aAPa,EAQbR,SARa,CAAd;AAUA,GAXD,MAWO,IAAKnC,UAAL,EAAkB;AACxB,WAAO9B,OAAO,EACb;AACAF,IAAAA,EAAE,CAAE,gBAAF,CAFW,EAGb2E,aAHa,CAAd;AAKA,GANM,MAMA,IAAKR,SAAS,GAAG,CAAjB,EAAqB;AAC3B,WAAOjE,OAAO,EACb;AACAD,IAAAA,EAAE,CACD,2BADC,EAED,6BAFC,EAGDkE,SAHC,CAFW,EAObQ,aAPa,EAQbR,SARa,CAAd;AAUA;;AACD,SAAOQ,aAAP;AACA;;AAED,eAAexD,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { useLilius } from 'use-lilius';\nimport {\n\tformat,\n\tisSameDay,\n\tsubMonths,\n\taddMonths,\n\tstartOfDay,\n\tisEqual,\n\taddDays,\n\tsubWeeks,\n\taddWeeks,\n\tisSameMonth,\n} from 'date-fns';\n\n/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, isRTL } from '@wordpress/i18n';\nimport { arrowLeft, arrowRight } from '@wordpress/icons';\nimport { dateI18n, __experimentalGetSettings } from '@wordpress/date';\nimport { useState, useRef, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DatePickerProps } from '../types';\nimport {\n\tNavigator,\n\tNavigatorHeading,\n\tCalendar,\n\tDayOfWeek,\n\tDayButton,\n} from './styles';\nimport { inputToDate } from '../utils';\nimport Button from '../../button';\nimport { TIMEZONELESS_FORMAT } from '../constants';\n\n/**\n * DatePicker is a React component that renders a calendar for date selection.\n *\n * ```jsx\n * import { DatePicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyDatePicker = () => {\n * const [ date, setDate ] = useState( new Date() );\n *\n * return (\n * <DatePicker\n * currentDate={ date }\n * onChange={ ( newDate ) => setDate( newDate ) }\n * />\n * );\n * };\n * ```\n */\nexport function DatePicker( {\n\tcurrentDate,\n\tonChange,\n\tevents = [],\n\tisInvalidDate,\n\tonMonthPreviewed,\n\tstartOfWeek = 0,\n}: DatePickerProps ) {\n\tconst date = currentDate ? inputToDate( currentDate ) : new Date();\n\n\tconst {\n\t\tcalendar,\n\t\tviewing,\n\t\tsetSelected,\n\t\tsetViewing,\n\t\tisSelected,\n\t\tviewPreviousMonth,\n\t\tviewNextMonth,\n\t} = useLilius( {\n\t\tselected: [ startOfDay( date ) ],\n\t\tviewing: startOfDay( date ),\n\t\tweekStartsOn: startOfWeek,\n\t} );\n\n\t// Used to implement a roving tab index. Tracks the day that receives focus\n\t// when the user tabs into the calendar.\n\tconst [ focusable, setFocusable ] = useState( startOfDay( date ) );\n\n\t// Allows us to only programmatically focus() a day when focus was already\n\t// within the calendar. This stops us stealing focus from e.g. a TimePicker\n\t// input.\n\tconst [ isFocusWithinCalendar, setIsFocusWithinCalendar ] =\n\t\tuseState( false );\n\n\t// Update internal state when currentDate prop changes.\n\tconst [ prevCurrentDate, setPrevCurrentDate ] = useState( currentDate );\n\tif ( currentDate !== prevCurrentDate ) {\n\t\tsetPrevCurrentDate( currentDate );\n\t\tsetSelected( [ startOfDay( date ) ] );\n\t\tsetViewing( startOfDay( date ) );\n\t\tsetFocusable( startOfDay( date ) );\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"components-datetime__date\"\n\t\t\trole=\"application\"\n\t\t\taria-label={ __( 'Calendar' ) }\n\t\t>\n\t\t\t<Navigator>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ isRTL() ? arrowRight : arrowLeft }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\taria-label={ __( 'View previous month' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tviewPreviousMonth();\n\t\t\t\t\t\tsetFocusable( subMonths( focusable, 1 ) );\n\t\t\t\t\t\tonMonthPreviewed?.(\n\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\tsubMonths( viewing, 1 ),\n\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t<NavigatorHeading level={ 3 }>\n\t\t\t\t\t<strong>\n\t\t\t\t\t\t{ dateI18n(\n\t\t\t\t\t\t\t'F',\n\t\t\t\t\t\t\tviewing,\n\t\t\t\t\t\t\t-viewing.getTimezoneOffset()\n\t\t\t\t\t\t) }\n\t\t\t\t\t</strong>{ ' ' }\n\t\t\t\t\t{ dateI18n( 'Y', viewing, -viewing.getTimezoneOffset() ) }\n\t\t\t\t</NavigatorHeading>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ isRTL() ? arrowLeft : arrowRight }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\taria-label={ __( 'View next month' ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tviewNextMonth();\n\t\t\t\t\t\tsetFocusable( addMonths( focusable, 1 ) );\n\t\t\t\t\t\tonMonthPreviewed?.(\n\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\taddMonths( viewing, 1 ),\n\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</Navigator>\n\t\t\t<Calendar\n\t\t\t\tonFocus={ () => setIsFocusWithinCalendar( true ) }\n\t\t\t\tonBlur={ () => setIsFocusWithinCalendar( false ) }\n\t\t\t>\n\t\t\t\t{ calendar[ 0 ][ 0 ].map( ( day ) => (\n\t\t\t\t\t<DayOfWeek key={ day.toString() }>\n\t\t\t\t\t\t{ dateI18n( 'D', day, -day.getTimezoneOffset() ) }\n\t\t\t\t\t</DayOfWeek>\n\t\t\t\t) ) }\n\t\t\t\t{ calendar[ 0 ].map( ( week ) =>\n\t\t\t\t\tweek.map( ( day, index ) => {\n\t\t\t\t\t\tif ( ! isSameMonth( day, viewing ) ) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Day\n\t\t\t\t\t\t\t\tkey={ day.toString() }\n\t\t\t\t\t\t\t\tday={ day }\n\t\t\t\t\t\t\t\tcolumn={ index + 1 }\n\t\t\t\t\t\t\t\tisSelected={ isSelected( day ) }\n\t\t\t\t\t\t\t\tisFocusable={ isEqual( day, focusable ) }\n\t\t\t\t\t\t\t\tisFocusAllowed={ isFocusWithinCalendar }\n\t\t\t\t\t\t\t\tisToday={ isSameDay( day, new Date() ) }\n\t\t\t\t\t\t\t\tisInvalid={\n\t\t\t\t\t\t\t\t\tisInvalidDate ? isInvalidDate( day ) : false\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnumEvents={\n\t\t\t\t\t\t\t\t\tevents.filter( ( event ) =>\n\t\t\t\t\t\t\t\t\t\tisSameDay( event.date, day )\n\t\t\t\t\t\t\t\t\t).length\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetSelected( [ day ] );\n\t\t\t\t\t\t\t\t\tsetFocusable( day );\n\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\t\t\t\t// Don't change the selected date's time fields.\n\t\t\t\t\t\t\t\t\t\t\tnew Date(\n\t\t\t\t\t\t\t\t\t\t\t\tday.getFullYear(),\n\t\t\t\t\t\t\t\t\t\t\t\tday.getMonth(),\n\t\t\t\t\t\t\t\t\t\t\t\tday.getDate(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getHours(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getMinutes(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getSeconds(),\n\t\t\t\t\t\t\t\t\t\t\t\tdate.getMilliseconds()\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tlet nextFocusable;\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowLeft' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = addDays(\n\t\t\t\t\t\t\t\t\t\t\tday,\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? 1 : -1\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowRight' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = addDays(\n\t\t\t\t\t\t\t\t\t\t\tday,\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? -1 : 1\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowUp' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = subWeeks( day, 1 );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( event.key === 'ArrowDown' ) {\n\t\t\t\t\t\t\t\t\t\tnextFocusable = addWeeks( day, 1 );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( nextFocusable ) {\n\t\t\t\t\t\t\t\t\t\tsetFocusable( nextFocusable );\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t! isSameMonth(\n\t\t\t\t\t\t\t\t\t\t\t\tnextFocusable,\n\t\t\t\t\t\t\t\t\t\t\t\tviewing\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tsetViewing( nextFocusable );\n\t\t\t\t\t\t\t\t\t\t\tonMonthPreviewed?.(\n\t\t\t\t\t\t\t\t\t\t\t\tformat(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnextFocusable,\n\t\t\t\t\t\t\t\t\t\t\t\t\tTIMEZONELESS_FORMAT\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} )\n\t\t\t\t) }\n\t\t\t</Calendar>\n\t\t</div>\n\t);\n}\n\ntype DayProps = {\n\tday: Date;\n\tcolumn: number;\n\tisSelected: boolean;\n\tisFocusable: boolean;\n\tisFocusAllowed: boolean;\n\tisToday: boolean;\n\tnumEvents: number;\n\tisInvalid: boolean;\n\tonClick: () => void;\n\tonKeyDown: ( event: KeyboardEvent ) => void;\n};\n\nfunction Day( {\n\tday,\n\tcolumn,\n\tisSelected,\n\tisFocusable,\n\tisFocusAllowed,\n\tisToday,\n\tisInvalid,\n\tnumEvents,\n\tonClick,\n\tonKeyDown,\n}: DayProps ) {\n\tconst ref = useRef< HTMLButtonElement >();\n\n\t// Focus the day when it becomes focusable, e.g. because an arrow key is\n\t// pressed. Only do this if focus is allowed - this stops us stealing focus\n\t// from e.g. a TimePicker input. Note that isFocusAllowed is not a dep as\n\t// there is no point calling focus() on an already focused element.\n\tuseEffect( () => {\n\t\tif ( ref.current && isFocusable && isFocusAllowed ) {\n\t\t\tref.current.focus();\n\t\t}\n\t}, [ isFocusable ] );\n\n\treturn (\n\t\t<DayButton\n\t\t\tref={ ref }\n\t\t\tclassName=\"components-datetime__date__day\" // Unused, for backwards compatibility.\n\t\t\tdisabled={ isInvalid }\n\t\t\ttabIndex={ isFocusable ? 0 : -1 }\n\t\t\taria-label={ getDayLabel( day, isSelected, numEvents ) }\n\t\t\tcolumn={ column }\n\t\t\tisSelected={ isSelected }\n\t\t\tisToday={ isToday }\n\t\t\thasEvents={ numEvents > 0 }\n\t\t\tonClick={ onClick }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t>\n\t\t\t{ dateI18n( 'j', day, -day.getTimezoneOffset() ) }\n\t\t</DayButton>\n\t);\n}\n\nfunction getDayLabel( date: Date, isSelected: boolean, numEvents: number ) {\n\tconst { formats } = __experimentalGetSettings();\n\tconst localizedDate = dateI18n(\n\t\tformats.date,\n\t\tdate,\n\t\t-date.getTimezoneOffset()\n\t);\n\tif ( isSelected && numEvents > 0 ) {\n\t\treturn sprintf(\n\t\t\t// translators: 1: The calendar date. 2: Number of events on the calendar date.\n\t\t\t_n(\n\t\t\t\t'%1$s. Selected. There is %2$d event',\n\t\t\t\t'%1$s. Selected. There are %2$d events',\n\t\t\t\tnumEvents\n\t\t\t),\n\t\t\tlocalizedDate,\n\t\t\tnumEvents\n\t\t);\n\t} else if ( isSelected ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: The calendar date.\n\t\t\t__( '%1$s. Selected' ),\n\t\t\tlocalizedDate\n\t\t);\n\t} else if ( numEvents > 0 ) {\n\t\treturn sprintf(\n\t\t\t// translators: 1: The calendar date. 2: Number of events on the calendar date.\n\t\t\t_n(\n\t\t\t\t'%1$s. There is %2$d event',\n\t\t\t\t'%1$s. There are %2$d events',\n\t\t\t\tnumEvents\n\t\t\t),\n\t\t\tlocalizedDate,\n\t\t\tnumEvents\n\t\t);\n\t}\n\treturn localizedDate;\n}\n\nexport default DatePicker;\n"]}