@wordpress/components 28.6.0 → 28.8.1-next.5368f64a9.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 (644) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/CONTRIBUTING.md +42 -19
  3. package/build/alignment-matrix-control/cell.js +4 -7
  4. package/build/alignment-matrix-control/cell.js.map +1 -1
  5. package/build/alignment-matrix-control/icon.js +31 -19
  6. package/build/alignment-matrix-control/icon.js.map +1 -1
  7. package/build/alignment-matrix-control/index.js +55 -51
  8. package/build/alignment-matrix-control/index.js.map +1 -1
  9. package/build/alignment-matrix-control/styles.js +73 -0
  10. package/build/alignment-matrix-control/styles.js.map +1 -0
  11. package/build/alignment-matrix-control/types.js.map +1 -1
  12. package/build/angle-picker-control/angle-circle.js +9 -9
  13. package/build/angle-picker-control/angle-circle.js.map +1 -1
  14. package/build/border-control/border-control/component.js +18 -13
  15. package/build/border-control/border-control/component.js.map +1 -1
  16. package/build/circular-option-picker/circular-option-picker-option.js +15 -9
  17. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  18. package/build/circular-option-picker/circular-option-picker.js +15 -12
  19. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  20. package/build/circular-option-picker/types.js.map +1 -1
  21. package/build/clipboard-button/index.js +6 -6
  22. package/build/clipboard-button/index.js.map +1 -1
  23. package/build/color-palette/utils.js +1 -2
  24. package/build/color-palette/utils.js.map +1 -1
  25. package/build/color-picker/color-copy-button.js +8 -8
  26. package/build/color-picker/color-copy-button.js.map +1 -1
  27. package/build/color-picker/hex-input.js +8 -8
  28. package/build/color-picker/hex-input.js.map +1 -1
  29. package/build/color-picker/input-with-slider.js +8 -8
  30. package/build/color-picker/input-with-slider.js.map +1 -1
  31. package/build/color-picker/styles.js +8 -8
  32. package/build/color-picker/styles.js.map +1 -1
  33. package/build/combobox-control/types.js.map +1 -1
  34. package/build/composite/context.js +1 -1
  35. package/build/composite/context.js.map +1 -1
  36. package/build/composite/group-label.js +33 -0
  37. package/build/composite/group-label.js.map +1 -0
  38. package/build/composite/group.js +33 -0
  39. package/build/composite/group.js.map +1 -0
  40. package/build/composite/hover.js +33 -0
  41. package/build/composite/hover.js.map +1 -0
  42. package/build/composite/index.js +63 -118
  43. package/build/composite/index.js.map +1 -1
  44. package/build/composite/item.js +33 -0
  45. package/build/composite/item.js.map +1 -0
  46. package/build/composite/legacy/index.js +59 -7
  47. package/build/composite/legacy/index.js.map +1 -1
  48. package/build/composite/row.js +33 -0
  49. package/build/composite/row.js.map +1 -0
  50. package/build/composite/typeahead.js +33 -0
  51. package/build/composite/typeahead.js.map +1 -0
  52. package/build/composite/types.js.map +1 -1
  53. package/build/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  54. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  55. package/build/custom-select-control-v2/styles.js +12 -14
  56. package/build/custom-select-control-v2/styles.js.map +1 -1
  57. package/build/date-time/date/index.js +1 -1
  58. package/build/date-time/date/index.js.map +1 -1
  59. package/build/date-time/date/styles.js +37 -26
  60. package/build/date-time/date/styles.js.map +1 -1
  61. package/build/date-time/date/use-lilius/index.js +163 -0
  62. package/build/date-time/date/use-lilius/index.js.map +1 -0
  63. package/build/date-time/time/time-input/index.js +17 -19
  64. package/build/date-time/time/time-input/index.js.map +1 -1
  65. package/build/dimension-control/index.js +6 -1
  66. package/build/dimension-control/index.js.map +1 -1
  67. package/build/draggable/index.js +4 -4
  68. package/build/draggable/index.js.map +1 -1
  69. package/build/dropdown-menu-v2/checkbox-item.js +69 -0
  70. package/build/dropdown-menu-v2/checkbox-item.js.map +1 -0
  71. package/build/dropdown-menu-v2/context.js +17 -0
  72. package/build/dropdown-menu-v2/context.js.map +1 -0
  73. package/build/dropdown-menu-v2/group-label.js +40 -0
  74. package/build/dropdown-menu-v2/group-label.js.map +1 -0
  75. package/build/dropdown-menu-v2/group.js +29 -0
  76. package/build/dropdown-menu-v2/group.js.map +1 -0
  77. package/build/dropdown-menu-v2/index.js +58 -146
  78. package/build/dropdown-menu-v2/index.js.map +1 -1
  79. package/build/dropdown-menu-v2/item-help-text.js +27 -0
  80. package/build/dropdown-menu-v2/item-help-text.js.map +1 -0
  81. package/build/dropdown-menu-v2/item-label.js +27 -0
  82. package/build/dropdown-menu-v2/item-label.js.map +1 -0
  83. package/build/dropdown-menu-v2/item.js +53 -0
  84. package/build/dropdown-menu-v2/item.js.map +1 -0
  85. package/build/dropdown-menu-v2/radio-item.js +79 -0
  86. package/build/dropdown-menu-v2/radio-item.js.map +1 -0
  87. package/build/dropdown-menu-v2/separator.js +30 -0
  88. package/build/dropdown-menu-v2/separator.js.map +1 -0
  89. package/build/dropdown-menu-v2/styles.js +54 -78
  90. package/build/dropdown-menu-v2/styles.js.map +1 -1
  91. package/build/dropdown-menu-v2/types.js.map +1 -1
  92. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js +27 -0
  93. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  94. package/build/focal-point-picker/styles/focal-point-style.js +7 -2
  95. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  96. package/build/form-token-field/types.js.map +1 -1
  97. package/build/index.js +13 -0
  98. package/build/index.js.map +1 -1
  99. package/build/input-control/index.js +2 -2
  100. package/build/input-control/index.js.map +1 -1
  101. package/build/input-control/input-base.js +5 -10
  102. package/build/input-control/input-base.js.map +1 -1
  103. package/build/input-control/input-prefix-wrapper.js +3 -3
  104. package/build/input-control/input-prefix-wrapper.js.map +1 -1
  105. package/build/input-control/input-suffix-wrapper.js +2 -3
  106. package/build/input-control/input-suffix-wrapper.js.map +1 -1
  107. package/build/input-control/reducer/reducer.js +8 -8
  108. package/build/input-control/reducer/reducer.js.map +1 -1
  109. package/build/input-control/styles/input-control-styles.js +75 -45
  110. package/build/input-control/styles/input-control-styles.js.map +1 -1
  111. package/build/input-control/types.js.map +1 -1
  112. package/build/input-control/utils.js +3 -3
  113. package/build/input-control/utils.js.map +1 -1
  114. package/build/item-group/styles.js +10 -10
  115. package/build/item-group/styles.js.map +1 -1
  116. package/build/modal/index.js +16 -9
  117. package/build/modal/index.js.map +1 -1
  118. package/build/navigation/index.js +4 -4
  119. package/build/navigation/index.js.map +1 -1
  120. package/build/navigation/styles/navigation-styles.js +13 -13
  121. package/build/navigation/styles/navigation-styles.js.map +1 -1
  122. package/build/navigator/index.js +12 -13
  123. package/build/navigator/index.js.map +1 -1
  124. package/build/navigator/navigator-back-button/hook.js +2 -2
  125. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  126. package/build/navigator/navigator-button/hook.js +2 -2
  127. package/build/navigator/navigator-button/hook.js.map +1 -1
  128. package/build/navigator/navigator-provider/component.js +99 -67
  129. package/build/navigator/navigator-provider/component.js.map +1 -1
  130. package/build/navigator/navigator-screen/component.js +5 -0
  131. package/build/navigator/navigator-screen/component.js.map +1 -1
  132. package/build/navigator/navigator-to-parent-button/component.js +2 -2
  133. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  134. package/build/navigator/types.js.map +1 -1
  135. package/build/navigator/use-navigator.js +1 -2
  136. package/build/navigator/use-navigator.js.map +1 -1
  137. package/build/palette-edit/index.js +2 -2
  138. package/build/palette-edit/index.js.map +1 -1
  139. package/build/private-apis.js +1 -14
  140. package/build/private-apis.js.map +1 -1
  141. package/build/range-control/styles/range-control-styles.js +30 -30
  142. package/build/range-control/styles/range-control-styles.js.map +1 -1
  143. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  144. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  145. package/build/select-control/styles/select-control-styles.js +12 -12
  146. package/build/select-control/styles/select-control-styles.js.map +1 -1
  147. package/build/slot-fill/bubbles-virtually/fill.js +4 -4
  148. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  149. package/build/slot-fill/index.js +1 -0
  150. package/build/slot-fill/index.js.map +1 -1
  151. package/build/snackbar/index.js +4 -4
  152. package/build/snackbar/index.js.map +1 -1
  153. package/build/tabs/index.js +4 -4
  154. package/build/tabs/index.js.map +1 -1
  155. package/build/tabs/styles.js +3 -3
  156. package/build/tabs/styles.js.map +1 -1
  157. package/build/tabs/tablist.js +5 -4
  158. package/build/tabs/tablist.js.map +1 -1
  159. package/build/toggle-group-control/toggle-group-control/utils.js +6 -6
  160. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  161. package/build/tools-panel/tools-panel/hook.js +6 -6
  162. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  163. package/build/unit-control/styles/unit-control-styles.js +7 -7
  164. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  165. package/build/utils/config-values.js +6 -4
  166. package/build/utils/config-values.js.map +1 -1
  167. package/build/utils/element-rect.js +73 -105
  168. package/build/utils/element-rect.js.map +1 -1
  169. package/build/utils/hooks/use-update-effect.js +4 -4
  170. package/build/utils/hooks/use-update-effect.js.map +1 -1
  171. package/build-module/alignment-matrix-control/cell.js +2 -5
  172. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  173. package/build-module/alignment-matrix-control/icon.js +31 -19
  174. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  175. package/build-module/alignment-matrix-control/index.js +55 -50
  176. package/build-module/alignment-matrix-control/index.js.map +1 -1
  177. package/build-module/alignment-matrix-control/styles.js +70 -0
  178. package/build-module/alignment-matrix-control/styles.js.map +1 -0
  179. package/build-module/alignment-matrix-control/types.js.map +1 -1
  180. package/build-module/angle-picker-control/angle-circle.js +9 -9
  181. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  182. package/build-module/border-control/border-control/component.js +18 -13
  183. package/build-module/border-control/border-control/component.js.map +1 -1
  184. package/build-module/circular-option-picker/circular-option-picker-option.js +16 -10
  185. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  186. package/build-module/circular-option-picker/circular-option-picker.js +16 -13
  187. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  188. package/build-module/circular-option-picker/types.js.map +1 -1
  189. package/build-module/clipboard-button/index.js +6 -6
  190. package/build-module/clipboard-button/index.js.map +1 -1
  191. package/build-module/color-palette/utils.js +1 -2
  192. package/build-module/color-palette/utils.js.map +1 -1
  193. package/build-module/color-picker/color-copy-button.js +8 -8
  194. package/build-module/color-picker/color-copy-button.js.map +1 -1
  195. package/build-module/color-picker/hex-input.js +7 -8
  196. package/build-module/color-picker/hex-input.js.map +1 -1
  197. package/build-module/color-picker/input-with-slider.js +7 -8
  198. package/build-module/color-picker/input-with-slider.js.map +1 -1
  199. package/build-module/color-picker/styles.js +8 -8
  200. package/build-module/color-picker/styles.js.map +1 -1
  201. package/build-module/combobox-control/types.js.map +1 -1
  202. package/build-module/composite/context.js +1 -1
  203. package/build-module/composite/context.js.map +1 -1
  204. package/build-module/composite/group-label.js +25 -0
  205. package/build-module/composite/group-label.js.map +1 -0
  206. package/build-module/composite/group.js +25 -0
  207. package/build-module/composite/group.js.map +1 -0
  208. package/build-module/composite/hover.js +25 -0
  209. package/build-module/composite/hover.js.map +1 -0
  210. package/build-module/composite/index.js +64 -118
  211. package/build-module/composite/index.js.map +1 -1
  212. package/build-module/composite/item.js +25 -0
  213. package/build-module/composite/item.js.map +1 -0
  214. package/build-module/composite/legacy/index.js +57 -8
  215. package/build-module/composite/legacy/index.js.map +1 -1
  216. package/build-module/composite/row.js +25 -0
  217. package/build-module/composite/row.js.map +1 -0
  218. package/build-module/composite/typeahead.js +25 -0
  219. package/build-module/composite/typeahead.js.map +1 -0
  220. package/build-module/composite/types.js.map +1 -1
  221. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  222. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  223. package/build-module/custom-select-control-v2/styles.js +12 -14
  224. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  225. package/build-module/date-time/date/index.js +1 -2
  226. package/build-module/date-time/date/index.js.map +1 -1
  227. package/build-module/date-time/date/styles.js +33 -26
  228. package/build-module/date-time/date/styles.js.map +1 -1
  229. package/build-module/date-time/date/use-lilius/index.js +158 -0
  230. package/build-module/date-time/date/use-lilius/index.js.map +1 -0
  231. package/build-module/date-time/time/time-input/index.js +17 -19
  232. package/build-module/date-time/time/time-input/index.js.map +1 -1
  233. package/build-module/dimension-control/index.js +6 -1
  234. package/build-module/dimension-control/index.js.map +1 -1
  235. package/build-module/draggable/index.js +4 -4
  236. package/build-module/draggable/index.js.map +1 -1
  237. package/build-module/dropdown-menu-v2/checkbox-item.js +62 -0
  238. package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -0
  239. package/build-module/dropdown-menu-v2/context.js +11 -0
  240. package/build-module/dropdown-menu-v2/context.js.map +1 -0
  241. package/build-module/dropdown-menu-v2/group-label.js +32 -0
  242. package/build-module/dropdown-menu-v2/group-label.js.map +1 -0
  243. package/build-module/dropdown-menu-v2/group.js +21 -0
  244. package/build-module/dropdown-menu-v2/group.js.map +1 -0
  245. package/build-module/dropdown-menu-v2/index.js +57 -144
  246. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  247. package/build-module/dropdown-menu-v2/item-help-text.js +19 -0
  248. package/build-module/dropdown-menu-v2/item-help-text.js.map +1 -0
  249. package/build-module/dropdown-menu-v2/item-label.js +19 -0
  250. package/build-module/dropdown-menu-v2/item-label.js.map +1 -0
  251. package/build-module/dropdown-menu-v2/item.js +46 -0
  252. package/build-module/dropdown-menu-v2/item.js.map +1 -0
  253. package/build-module/dropdown-menu-v2/radio-item.js +72 -0
  254. package/build-module/dropdown-menu-v2/radio-item.js.map +1 -0
  255. package/build-module/dropdown-menu-v2/separator.js +22 -0
  256. package/build-module/dropdown-menu-v2/separator.js.map +1 -0
  257. package/build-module/dropdown-menu-v2/styles.js +54 -78
  258. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  259. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  260. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js +20 -0
  261. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  262. package/build-module/focal-point-picker/styles/focal-point-style.js +6 -2
  263. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  264. package/build-module/form-token-field/types.js.map +1 -1
  265. package/build-module/index.js +3 -1
  266. package/build-module/index.js.map +1 -1
  267. package/build-module/input-control/index.js +2 -2
  268. package/build-module/input-control/index.js.map +1 -1
  269. package/build-module/input-control/input-base.js +6 -11
  270. package/build-module/input-control/input-base.js.map +1 -1
  271. package/build-module/input-control/input-prefix-wrapper.js +4 -3
  272. package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
  273. package/build-module/input-control/input-suffix-wrapper.js +3 -3
  274. package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
  275. package/build-module/input-control/reducer/reducer.js +8 -8
  276. package/build-module/input-control/reducer/reducer.js.map +1 -1
  277. package/build-module/input-control/styles/input-control-styles.js +74 -44
  278. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  279. package/build-module/input-control/types.js.map +1 -1
  280. package/build-module/input-control/utils.js +3 -3
  281. package/build-module/input-control/utils.js.map +1 -1
  282. package/build-module/item-group/styles.js +10 -10
  283. package/build-module/item-group/styles.js.map +1 -1
  284. package/build-module/modal/index.js +17 -9
  285. package/build-module/modal/index.js.map +1 -1
  286. package/build-module/navigation/index.js +4 -4
  287. package/build-module/navigation/index.js.map +1 -1
  288. package/build-module/navigation/styles/navigation-styles.js +14 -14
  289. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  290. package/build-module/navigator/index.js +6 -6
  291. package/build-module/navigator/index.js.map +1 -1
  292. package/build-module/navigator/navigator-back-button/hook.js +1 -1
  293. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  294. package/build-module/navigator/navigator-button/hook.js +1 -1
  295. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  296. package/build-module/navigator/navigator-provider/component.js +99 -67
  297. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  298. package/build-module/navigator/navigator-screen/component.js +4 -0
  299. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  300. package/build-module/navigator/navigator-to-parent-button/component.js +1 -1
  301. package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
  302. package/build-module/navigator/types.js.map +1 -1
  303. package/build-module/navigator/use-navigator.js +1 -2
  304. package/build-module/navigator/use-navigator.js.map +1 -1
  305. package/build-module/palette-edit/index.js +2 -2
  306. package/build-module/palette-edit/index.js.map +1 -1
  307. package/build-module/private-apis.js +1 -14
  308. package/build-module/private-apis.js.map +1 -1
  309. package/build-module/range-control/styles/range-control-styles.js +31 -31
  310. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  311. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
  312. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  313. package/build-module/select-control/styles/select-control-styles.js +13 -13
  314. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  315. package/build-module/slot-fill/bubbles-virtually/fill.js +4 -4
  316. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  317. package/build-module/slot-fill/index.js +1 -0
  318. package/build-module/slot-fill/index.js.map +1 -1
  319. package/build-module/snackbar/index.js +4 -4
  320. package/build-module/snackbar/index.js.map +1 -1
  321. package/build-module/tabs/index.js +4 -4
  322. package/build-module/tabs/index.js.map +1 -1
  323. package/build-module/tabs/styles.js +4 -4
  324. package/build-module/tabs/styles.js.map +1 -1
  325. package/build-module/tabs/tablist.js +5 -4
  326. package/build-module/tabs/tablist.js.map +1 -1
  327. package/build-module/toggle-group-control/toggle-group-control/utils.js +6 -6
  328. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  329. package/build-module/tools-panel/tools-panel/hook.js +6 -6
  330. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  331. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  332. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  333. package/build-module/utils/config-values.js +6 -4
  334. package/build-module/utils/config-values.js.map +1 -1
  335. package/build-module/utils/element-rect.js +74 -105
  336. package/build-module/utils/element-rect.js.map +1 -1
  337. package/build-module/utils/hooks/use-update-effect.js +4 -4
  338. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  339. package/build-style/style-rtl.css +11 -27
  340. package/build-style/style.css +11 -27
  341. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  342. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  343. package/build-types/alignment-matrix-control/icon.d.ts +1 -1
  344. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  345. package/build-types/alignment-matrix-control/index.d.ts +16 -6
  346. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  347. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  348. package/build-types/alignment-matrix-control/{styles/alignment-matrix-control-styles.d.ts → styles.d.ts} +9 -10
  349. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -0
  350. package/build-types/alignment-matrix-control/types.d.ts +12 -1
  351. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  352. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  353. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  354. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  355. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  356. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  357. package/build-types/circular-option-picker/types.d.ts +2 -2
  358. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  359. package/build-types/color-palette/utils.d.ts.map +1 -1
  360. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  361. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  362. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  363. package/build-types/color-picker/styles.d.ts.map +1 -1
  364. package/build-types/combobox-control/types.d.ts +1 -0
  365. package/build-types/combobox-control/types.d.ts.map +1 -1
  366. package/build-types/composite/context.d.ts.map +1 -1
  367. package/build-types/composite/group-label.d.ts +3 -0
  368. package/build-types/composite/group-label.d.ts.map +1 -0
  369. package/build-types/composite/group.d.ts +3 -0
  370. package/build-types/composite/group.d.ts.map +1 -0
  371. package/build-types/composite/hover.d.ts +3 -0
  372. package/build-types/composite/hover.d.ts.map +1 -0
  373. package/build-types/composite/index.d.ts +63 -47
  374. package/build-types/composite/index.d.ts.map +1 -1
  375. package/build-types/composite/item.d.ts +3 -0
  376. package/build-types/composite/item.d.ts.map +1 -0
  377. package/build-types/composite/legacy/index.d.ts +23 -3
  378. package/build-types/composite/legacy/index.d.ts.map +1 -1
  379. package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -1
  380. package/build-types/composite/row.d.ts +3 -0
  381. package/build-types/composite/row.d.ts.map +1 -0
  382. package/build-types/composite/stories/index.story.d.ts +9 -8
  383. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  384. package/build-types/composite/typeahead.d.ts +3 -0
  385. package/build-types/composite/typeahead.d.ts.map +1 -0
  386. package/build-types/composite/types.d.ts +12 -11
  387. package/build-types/composite/types.d.ts.map +1 -1
  388. package/build-types/date-time/date/index.d.ts +0 -3
  389. package/build-types/date-time/date/index.d.ts.map +1 -1
  390. package/build-types/date-time/date/styles.d.ts.map +1 -1
  391. package/build-types/date-time/date/test/use-lilius.d.ts +2 -0
  392. package/build-types/date-time/date/test/use-lilius.d.ts.map +1 -0
  393. package/build-types/date-time/date/use-lilius/index.d.ts +169 -0
  394. package/build-types/date-time/date/use-lilius/index.d.ts.map +1 -0
  395. package/build-types/date-time/time/time-input/index.d.ts.map +1 -1
  396. package/build-types/dimension-control/index.d.ts +1 -1
  397. package/build-types/dimension-control/index.d.ts.map +1 -1
  398. package/build-types/dimension-control/stories/index.story.d.ts +5 -0
  399. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  400. package/build-types/dropdown-menu-v2/checkbox-item.d.ts +3 -0
  401. package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +1 -0
  402. package/build-types/dropdown-menu-v2/context.d.ts +6 -0
  403. package/build-types/dropdown-menu-v2/context.d.ts.map +1 -0
  404. package/build-types/dropdown-menu-v2/group-label.d.ts +3 -0
  405. package/build-types/dropdown-menu-v2/group-label.d.ts.map +1 -0
  406. package/build-types/dropdown-menu-v2/group.d.ts +3 -0
  407. package/build-types/dropdown-menu-v2/group.d.ts.map +1 -0
  408. package/build-types/dropdown-menu-v2/index.d.ts +39 -18
  409. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  410. package/build-types/dropdown-menu-v2/item-help-text.d.ts +6 -0
  411. package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +1 -0
  412. package/build-types/dropdown-menu-v2/item-label.d.ts +6 -0
  413. package/build-types/dropdown-menu-v2/item-label.d.ts.map +1 -0
  414. package/build-types/dropdown-menu-v2/item.d.ts +3 -0
  415. package/build-types/dropdown-menu-v2/item.d.ts.map +1 -0
  416. package/build-types/dropdown-menu-v2/radio-item.d.ts +3 -0
  417. package/build-types/dropdown-menu-v2/radio-item.d.ts.map +1 -0
  418. package/build-types/dropdown-menu-v2/separator.d.ts +3 -0
  419. package/build-types/dropdown-menu-v2/separator.d.ts.map +1 -0
  420. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +10 -10
  421. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  422. package/build-types/dropdown-menu-v2/styles.d.ts +14 -6
  423. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  424. package/build-types/dropdown-menu-v2/types.d.ts +6 -0
  425. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  426. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts +8 -0
  427. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +1 -0
  428. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
  429. package/build-types/form-token-field/types.d.ts +1 -0
  430. package/build-types/form-token-field/types.d.ts.map +1 -1
  431. package/build-types/index.d.ts +4 -1
  432. package/build-types/index.d.ts.map +1 -1
  433. package/build-types/input-control/input-base.d.ts.map +1 -1
  434. package/build-types/input-control/input-prefix-wrapper.d.ts +2 -2
  435. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
  436. package/build-types/input-control/input-suffix-wrapper.d.ts +2 -2
  437. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
  438. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  439. package/build-types/input-control/stories/index.story.d.ts +9 -0
  440. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  441. package/build-types/input-control/styles/input-control-styles.d.ts +15 -9
  442. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  443. package/build-types/input-control/types.d.ts +23 -6
  444. package/build-types/input-control/types.d.ts.map +1 -1
  445. package/build-types/modal/index.d.ts.map +1 -1
  446. package/build-types/modal/stories/index.story.d.ts +3 -0
  447. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  448. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  449. package/build-types/navigator/index.d.ts +6 -6
  450. package/build-types/navigator/index.d.ts.map +1 -1
  451. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  452. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  453. package/build-types/navigator/stories/index.story.d.ts +1 -1
  454. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  455. package/build-types/navigator/types.d.ts +3 -1
  456. package/build-types/navigator/types.d.ts.map +1 -1
  457. package/build-types/navigator/use-navigator.d.ts +1 -2
  458. package/build-types/navigator/use-navigator.d.ts.map +1 -1
  459. package/build-types/private-apis.d.ts.map +1 -1
  460. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  461. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  462. package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
  463. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  464. package/build-types/slot-fill/index.d.ts +3 -0
  465. package/build-types/slot-fill/index.d.ts.map +1 -1
  466. package/build-types/tabs/index.d.ts.map +1 -1
  467. package/build-types/tabs/styles.d.ts.map +1 -1
  468. package/build-types/tabs/tablist.d.ts.map +1 -1
  469. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  470. package/build-types/utils/config-values.d.ts +3 -3
  471. package/build-types/utils/element-rect.d.ts +32 -74
  472. package/build-types/utils/element-rect.d.ts.map +1 -1
  473. package/package.json +19 -20
  474. package/src/alignment-matrix-control/README.md +1 -5
  475. package/src/alignment-matrix-control/cell.tsx +3 -9
  476. package/src/alignment-matrix-control/icon.tsx +48 -30
  477. package/src/alignment-matrix-control/index.tsx +60 -50
  478. package/src/alignment-matrix-control/stories/index.story.tsx +3 -12
  479. package/src/alignment-matrix-control/styles.ts +113 -0
  480. package/src/alignment-matrix-control/types.ts +12 -1
  481. package/src/angle-picker-control/angle-circle.tsx +11 -9
  482. package/src/border-control/border-control/component.tsx +23 -16
  483. package/src/circular-option-picker/circular-option-picker-option.tsx +16 -19
  484. package/src/circular-option-picker/circular-option-picker.tsx +26 -12
  485. package/src/circular-option-picker/types.ts +2 -2
  486. package/src/clipboard-button/index.tsx +6 -6
  487. package/src/color-palette/test/utils.ts +21 -2
  488. package/src/color-palette/utils.ts +1 -3
  489. package/src/color-picker/color-copy-button.tsx +10 -8
  490. package/src/color-picker/hex-input.tsx +6 -10
  491. package/src/color-picker/input-with-slider.tsx +6 -10
  492. package/src/color-picker/styles.ts +1 -1
  493. package/src/combobox-control/types.ts +1 -0
  494. package/src/composite/README.md +5 -24
  495. package/src/composite/{context.ts → context.tsx} +1 -2
  496. package/src/composite/group-label.tsx +30 -0
  497. package/src/composite/group.tsx +30 -0
  498. package/src/composite/hover.tsx +30 -0
  499. package/src/composite/index.tsx +71 -166
  500. package/src/composite/item.tsx +30 -0
  501. package/src/composite/legacy/index.tsx +73 -11
  502. package/src/composite/legacy/stories/index.story.tsx +2 -1
  503. package/src/composite/legacy/test/index.tsx +57 -1
  504. package/src/composite/row.tsx +30 -0
  505. package/src/composite/stories/index.story.tsx +254 -365
  506. package/src/composite/typeahead.tsx +30 -0
  507. package/src/composite/types.ts +14 -16
  508. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +10 -10
  509. package/src/custom-gradient-picker/style.scss +2 -21
  510. package/src/custom-select-control-v2/styles.ts +4 -4
  511. package/src/date-time/date/index.tsx +1 -1
  512. package/src/date-time/date/styles.ts +33 -13
  513. package/src/date-time/date/test/use-lilius.ts +417 -0
  514. package/src/date-time/date/use-lilius/index.ts +394 -0
  515. package/src/date-time/time/test/index.tsx +3 -6
  516. package/src/date-time/time/time-input/index.tsx +25 -25
  517. package/src/date-time/time/time-input/test/index.tsx +6 -7
  518. package/src/dimension-control/README.md +4 -0
  519. package/src/dimension-control/index.tsx +7 -1
  520. package/src/dimension-control/stories/index.story.tsx +7 -2
  521. package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -16
  522. package/src/dimension-control/test/index.test.js +1 -0
  523. package/src/draggable/index.tsx +4 -4
  524. package/src/dropdown-menu-v2/README.md +73 -60
  525. package/src/dropdown-menu-v2/checkbox-item.tsx +63 -0
  526. package/src/dropdown-menu-v2/context.tsx +13 -0
  527. package/src/dropdown-menu-v2/group-label.tsx +37 -0
  528. package/src/dropdown-menu-v2/group.tsx +26 -0
  529. package/src/dropdown-menu-v2/index.tsx +57 -197
  530. package/src/dropdown-menu-v2/item-help-text.tsx +23 -0
  531. package/src/dropdown-menu-v2/item-label.tsx +23 -0
  532. package/src/dropdown-menu-v2/item.tsx +50 -0
  533. package/src/dropdown-menu-v2/radio-item.tsx +70 -0
  534. package/src/dropdown-menu-v2/separator.tsx +27 -0
  535. package/src/dropdown-menu-v2/stories/index.story.tsx +295 -262
  536. package/src/dropdown-menu-v2/styles.ts +102 -66
  537. package/src/dropdown-menu-v2/test/index.tsx +159 -132
  538. package/src/dropdown-menu-v2/types.ts +7 -0
  539. package/src/dropdown-menu-v2/use-temporary-focus-visible-fix.ts +22 -0
  540. package/src/focal-point-picker/styles/focal-point-style.ts +6 -1
  541. package/src/form-toggle/style.scss +1 -1
  542. package/src/form-token-field/style.scss +2 -3
  543. package/src/form-token-field/types.ts +1 -0
  544. package/src/index.ts +6 -1
  545. package/src/input-control/index.tsx +2 -2
  546. package/src/input-control/input-base.tsx +4 -14
  547. package/src/input-control/input-prefix-wrapper.tsx +8 -4
  548. package/src/input-control/input-suffix-wrapper.tsx +4 -6
  549. package/src/input-control/reducer/reducer.ts +13 -10
  550. package/src/input-control/stories/index.story.tsx +31 -12
  551. package/src/input-control/styles/input-control-styles.tsx +42 -11
  552. package/src/input-control/types.ts +23 -7
  553. package/src/input-control/utils.ts +3 -3
  554. package/src/item-group/styles.ts +3 -3
  555. package/src/item-group/test/__snapshots__/index.js.snap +3 -3
  556. package/src/modal/index.tsx +21 -12
  557. package/src/modal/stories/index.story.tsx +8 -14
  558. package/src/modal/style.scss +5 -9
  559. package/src/navigation/index.tsx +4 -4
  560. package/src/navigation/styles/navigation-styles.tsx +3 -3
  561. package/src/navigator/index.ts +6 -6
  562. package/src/navigator/navigator-back-button/hook.ts +1 -1
  563. package/src/navigator/navigator-button/hook.ts +1 -1
  564. package/src/navigator/navigator-provider/README.md +2 -3
  565. package/src/navigator/navigator-provider/component.tsx +97 -82
  566. package/src/navigator/navigator-screen/component.tsx +7 -0
  567. package/src/navigator/navigator-to-parent-button/component.tsx +1 -1
  568. package/src/navigator/stories/index.story.tsx +82 -253
  569. package/src/navigator/test/index.tsx +8 -0
  570. package/src/navigator/types.ts +3 -1
  571. package/src/navigator/use-navigator.ts +1 -3
  572. package/src/palette-edit/index.tsx +2 -2
  573. package/src/private-apis.ts +1 -23
  574. package/src/range-control/styles/range-control-styles.ts +7 -7
  575. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -2
  576. package/src/resizable-box/style.scss +2 -2
  577. package/src/select-control/README.md +2 -2
  578. package/src/select-control/styles/select-control-styles.ts +5 -5
  579. package/src/slot-fill/bubbles-virtually/fill.tsx +4 -4
  580. package/src/slot-fill/index.tsx +1 -0
  581. package/src/snackbar/index.tsx +4 -4
  582. package/src/tab-panel/style.scss +0 -1
  583. package/src/tabs/index.tsx +8 -4
  584. package/src/tabs/styles.ts +42 -14
  585. package/src/tabs/tablist.tsx +5 -4
  586. package/src/text-control/style.scss +3 -2
  587. package/src/toggle-group-control/toggle-group-control/utils.ts +7 -7
  588. package/src/tools-panel/tools-panel/hook.ts +6 -6
  589. package/src/unit-control/styles/unit-control-styles.ts +2 -1
  590. package/src/utils/config-values.js +6 -4
  591. package/src/utils/element-rect.ts +93 -130
  592. package/src/utils/hooks/use-update-effect.js +4 -4
  593. package/tsconfig.tsbuildinfo +1 -1
  594. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -66
  595. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  596. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -77
  597. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  598. package/build/navigator/navigator-back-button/index.js +0 -14
  599. package/build/navigator/navigator-back-button/index.js.map +0 -1
  600. package/build/navigator/navigator-button/index.js +0 -14
  601. package/build/navigator/navigator-button/index.js.map +0 -1
  602. package/build/navigator/navigator-provider/index.js +0 -14
  603. package/build/navigator/navigator-provider/index.js.map +0 -1
  604. package/build/navigator/navigator-screen/index.js +0 -14
  605. package/build/navigator/navigator-screen/index.js.map +0 -1
  606. package/build/navigator/navigator-to-parent-button/index.js +0 -14
  607. package/build/navigator/navigator-to-parent-button/index.js.map +0 -1
  608. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -63
  609. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  610. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -72
  611. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  612. package/build-module/navigator/navigator-back-button/index.js +0 -2
  613. package/build-module/navigator/navigator-back-button/index.js.map +0 -1
  614. package/build-module/navigator/navigator-button/index.js +0 -2
  615. package/build-module/navigator/navigator-button/index.js.map +0 -1
  616. package/build-module/navigator/navigator-provider/index.js +0 -2
  617. package/build-module/navigator/navigator-provider/index.js.map +0 -1
  618. package/build-module/navigator/navigator-screen/index.js +0 -2
  619. package/build-module/navigator/navigator-screen/index.js.map +0 -1
  620. package/build-module/navigator/navigator-to-parent-button/index.js +0 -2
  621. package/build-module/navigator/navigator-to-parent-button/index.js.map +0 -1
  622. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +0 -18
  623. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +0 -1
  624. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +0 -1
  625. package/build-types/composite/stories/utils.d.ts +0 -29
  626. package/build-types/composite/stories/utils.d.ts.map +0 -1
  627. package/build-types/navigator/navigator-back-button/index.d.ts +0 -2
  628. package/build-types/navigator/navigator-back-button/index.d.ts.map +0 -1
  629. package/build-types/navigator/navigator-button/index.d.ts +0 -2
  630. package/build-types/navigator/navigator-button/index.d.ts.map +0 -1
  631. package/build-types/navigator/navigator-provider/index.d.ts +0 -2
  632. package/build-types/navigator/navigator-provider/index.d.ts.map +0 -1
  633. package/build-types/navigator/navigator-screen/index.d.ts +0 -2
  634. package/build-types/navigator/navigator-screen/index.d.ts.map +0 -1
  635. package/build-types/navigator/navigator-to-parent-button/index.d.ts +0 -2
  636. package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +0 -1
  637. package/src/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.ts +0 -77
  638. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +0 -102
  639. package/src/composite/stories/utils.tsx +0 -76
  640. package/src/navigator/navigator-back-button/index.ts +0 -1
  641. package/src/navigator/navigator-button/index.ts +0 -1
  642. package/src/navigator/navigator-provider/index.ts +0 -1
  643. package/src/navigator/navigator-screen/index.ts +0 -1
  644. package/src/navigator/navigator-to-parent-button/index.ts +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_dateFns","require","_element","Month","exports","Day","inRange","date","min","max","isEqual","isAfter","isBefore","clearTime","set","hours","minutes","seconds","milliseconds","useLilius","weekStartsOn","SUNDAY","viewing","initialViewing","Date","selected","initialSelected","numberOfMonths","setViewing","useState","viewToday","useCallback","startOfToday","viewMonth","month","v","setMonth","viewPreviousMonth","subMonths","viewNextMonth","addMonths","viewYear","year","setYear","viewPreviousYear","subYears","viewNextYear","addYears","setSelected","map","clearSelected","isSelected","findIndex","s","select","replaceExisting","Array","isArray","selectedItems","concat","deselect","filter","d","getTime","includes","toggle","selectRange","start","end","eachDayOfInterval","deselectRange","calendar","useMemo","eachMonthOfInterval","startOfMonth","endOfMonth","eachWeekOfInterval","week","startOfWeek","endOfWeek"],"sources":["@wordpress/components/src/date-time/date/use-lilius/index.ts"],"sourcesContent":["/**\n * This source is a local copy of the use-lilius library, since the original\n * library is not actively maintained.\n * @see https://github.com/WordPress/gutenberg/discussions/64968\n *\n * use-lilius@2.0.5\n * https://github.com/Avarios/use-lilius\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2021-Present Danny Tatom\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * External dependencies\n */\nimport {\n\taddMonths,\n\taddYears,\n\teachDayOfInterval,\n\teachMonthOfInterval,\n\teachWeekOfInterval,\n\tendOfMonth,\n\tendOfWeek,\n\tisAfter,\n\tisBefore,\n\tisEqual,\n\tset,\n\tsetMonth,\n\tsetYear,\n\tstartOfMonth,\n\tstartOfToday,\n\tstartOfWeek,\n\tsubMonths,\n\tsubYears,\n} from 'date-fns';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useState } from '@wordpress/element';\n\nexport enum Month {\n\tJANUARY,\n\tFEBRUARY,\n\tMARCH,\n\tAPRIL,\n\tMAY,\n\tJUNE,\n\tJULY,\n\tAUGUST,\n\tSEPTEMBER,\n\tOCTOBER,\n\tNOVEMBER,\n\tDECEMBER,\n}\n\nexport enum Day {\n\tSUNDAY,\n\tMONDAY,\n\tTUESDAY,\n\tWEDNESDAY,\n\tTHURSDAY,\n\tFRIDAY,\n\tSATURDAY,\n}\n\nexport interface Options {\n\t/**\n\t * What day a week starts on within the calendar matrix.\n\t *\n\t * @default Day.SUNDAY\n\t */\n\tweekStartsOn?: Day;\n\n\t/**\n\t * The initial viewing date.\n\t *\n\t * @default new Date()\n\t */\n\tviewing?: Date;\n\n\t/**\n\t * The initial date(s) selection.\n\t *\n\t * @default []\n\t */\n\tselected?: Date[];\n\n\t/**\n\t * The number of months in the calendar.\n\t *\n\t * @default 1\n\t */\n\tnumberOfMonths?: number;\n}\n\nexport interface Returns {\n\t/**\n\t * Returns a copy of the given date with the time set to 00:00:00:00.\n\t */\n\tclearTime: ( date: Date ) => Date;\n\n\t/**\n\t * Returns whether or not a date is between 2 other dates (inclusive).\n\t */\n\tinRange: ( date: Date, min: Date, max: Date ) => boolean;\n\n\t/**\n\t * The date represented in the calendar matrix. Note that\n\t * the month and year are the only parts used.\n\t */\n\tviewing: Date;\n\n\t/**\n\t * Set the date represented in the calendar matrix. Note that\n\t * the month and year are the only parts used.\n\t */\n\tsetViewing: React.Dispatch< React.SetStateAction< Date > >;\n\n\t/**\n\t * Set the viewing date to today.\n\t */\n\tviewToday: () => void;\n\n\t/**\n\t * Set the viewing date to the given month.\n\t */\n\tviewMonth: ( month: Month ) => void;\n\n\t/**\n\t * Set the viewing date to the month before the current.\n\t */\n\tviewPreviousMonth: () => void;\n\n\t/**\n\t * Set the viewing date to the month after the current.\n\t */\n\tviewNextMonth: () => void;\n\n\t/**\n\t * Set the viewing date to the given year.\n\t */\n\tviewYear: ( year: number ) => void;\n\n\t/**\n\t * Set the viewing date to the year before the current.\n\t */\n\tviewPreviousYear: () => void;\n\n\t/**\n\t * Set the viewing date to the year after the current.\n\t */\n\tviewNextYear: () => void;\n\n\t/**\n\t * The dates currently selected.\n\t */\n\tselected: Date[];\n\n\t/**\n\t * Override the currently selected dates.\n\t */\n\tsetSelected: React.Dispatch< React.SetStateAction< Date[] > >;\n\n\t/**\n\t * Reset the selected dates to [].\n\t */\n\tclearSelected: () => void;\n\n\t/**\n\t * Determine whether or not a date has been selected.\n\t */\n\tisSelected: ( date: Date ) => boolean;\n\n\t/**\n\t * Select one or more dates.\n\t */\n\tselect: ( date: Date | Date[], replaceExisting?: boolean ) => void;\n\n\t/**\n\t * Deselect one or more dates.\n\t */\n\tdeselect: ( date: Date | Date[] ) => void;\n\n\t/**\n\t * Toggle the selection of a date.\n\t */\n\ttoggle: ( date: Date, replaceExisting?: boolean ) => void;\n\n\t/**\n\t * Select a range of dates (inclusive).\n\t */\n\tselectRange: ( start: Date, end: Date, replaceExisting?: boolean ) => void;\n\n\t/**\n\t * Deselect a range of dates (inclusive).\n\t */\n\tdeselectRange: ( start: Date, end: Date ) => void;\n\n\t/**\n\t * A matrix of days based on the current viewing date.\n\t */\n\tcalendar: Date[][][];\n}\n\nconst inRange = ( date: Date, min: Date, max: Date ) =>\n\t( isEqual( date, min ) || isAfter( date, min ) ) &&\n\t( isEqual( date, max ) || isBefore( date, max ) );\n\nconst clearTime = ( date: Date ) =>\n\tset( date, { hours: 0, minutes: 0, seconds: 0, milliseconds: 0 } );\n\nexport const useLilius = ( {\n\tweekStartsOn = Day.SUNDAY,\n\tviewing: initialViewing = new Date(),\n\tselected: initialSelected = [],\n\tnumberOfMonths = 1,\n}: Options = {} ): Returns => {\n\tconst [ viewing, setViewing ] = useState< Date >( initialViewing );\n\n\tconst viewToday = useCallback(\n\t\t() => setViewing( startOfToday() ),\n\t\t[ setViewing ]\n\t);\n\n\tconst viewMonth = useCallback(\n\t\t( month: Month ) => setViewing( ( v ) => setMonth( v, month ) ),\n\t\t[]\n\t);\n\n\tconst viewPreviousMonth = useCallback(\n\t\t() => setViewing( ( v ) => subMonths( v, 1 ) ),\n\t\t[]\n\t);\n\n\tconst viewNextMonth = useCallback(\n\t\t() => setViewing( ( v ) => addMonths( v, 1 ) ),\n\t\t[]\n\t);\n\n\tconst viewYear = useCallback(\n\t\t( year: number ) => setViewing( ( v ) => setYear( v, year ) ),\n\t\t[]\n\t);\n\n\tconst viewPreviousYear = useCallback(\n\t\t() => setViewing( ( v ) => subYears( v, 1 ) ),\n\t\t[]\n\t);\n\n\tconst viewNextYear = useCallback(\n\t\t() => setViewing( ( v ) => addYears( v, 1 ) ),\n\t\t[]\n\t);\n\n\tconst [ selected, setSelected ] = useState< Date[] >(\n\t\tinitialSelected.map( clearTime )\n\t);\n\n\tconst clearSelected = () => setSelected( [] );\n\n\tconst isSelected = useCallback(\n\t\t( date: Date ) =>\n\t\t\tselected.findIndex( ( s ) => isEqual( s, date ) ) > -1,\n\t\t[ selected ]\n\t);\n\n\tconst select = useCallback(\n\t\t( date: Date | Date[], replaceExisting?: boolean ) => {\n\t\t\tif ( replaceExisting ) {\n\t\t\t\tsetSelected( Array.isArray( date ) ? date : [ date ] );\n\t\t\t} else {\n\t\t\t\tsetSelected( ( selectedItems ) =>\n\t\t\t\t\tselectedItems.concat(\n\t\t\t\t\t\tArray.isArray( date ) ? date : [ date ]\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\tconst deselect = useCallback(\n\t\t( date: Date | Date[] ) =>\n\t\t\tsetSelected( ( selectedItems ) =>\n\t\t\t\tArray.isArray( date )\n\t\t\t\t\t? selectedItems.filter(\n\t\t\t\t\t\t\t( s ) =>\n\t\t\t\t\t\t\t\t! date\n\t\t\t\t\t\t\t\t\t.map( ( d ) => d.getTime() )\n\t\t\t\t\t\t\t\t\t.includes( s.getTime() )\n\t\t\t\t\t )\n\t\t\t\t\t: selectedItems.filter( ( s ) => ! isEqual( s, date ) )\n\t\t\t),\n\t\t[]\n\t);\n\n\tconst toggle = useCallback(\n\t\t( date: Date, replaceExisting?: boolean ) =>\n\t\t\tisSelected( date )\n\t\t\t\t? deselect( date )\n\t\t\t\t: select( date, replaceExisting ),\n\t\t[ deselect, isSelected, select ]\n\t);\n\n\tconst selectRange = useCallback(\n\t\t( start: Date, end: Date, replaceExisting?: boolean ) => {\n\t\t\tif ( replaceExisting ) {\n\t\t\t\tsetSelected( eachDayOfInterval( { start, end } ) );\n\t\t\t} else {\n\t\t\t\tsetSelected( ( selectedItems ) =>\n\t\t\t\t\tselectedItems.concat( eachDayOfInterval( { start, end } ) )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\tconst deselectRange = useCallback( ( start: Date, end: Date ) => {\n\t\tsetSelected( ( selectedItems ) =>\n\t\t\tselectedItems.filter(\n\t\t\t\t( s ) =>\n\t\t\t\t\t! eachDayOfInterval( { start, end } )\n\t\t\t\t\t\t.map( ( d ) => d.getTime() )\n\t\t\t\t\t\t.includes( s.getTime() )\n\t\t\t)\n\t\t);\n\t}, [] );\n\n\tconst calendar = useMemo< Date[][][] >(\n\t\t() =>\n\t\t\teachMonthOfInterval( {\n\t\t\t\tstart: startOfMonth( viewing ),\n\t\t\t\tend: endOfMonth( addMonths( viewing, numberOfMonths - 1 ) ),\n\t\t\t} ).map( ( month ) =>\n\t\t\t\teachWeekOfInterval(\n\t\t\t\t\t{\n\t\t\t\t\t\tstart: startOfMonth( month ),\n\t\t\t\t\t\tend: endOfMonth( month ),\n\t\t\t\t\t},\n\t\t\t\t\t{ weekStartsOn }\n\t\t\t\t).map( ( week ) =>\n\t\t\t\t\teachDayOfInterval( {\n\t\t\t\t\t\tstart: startOfWeek( week, { weekStartsOn } ),\n\t\t\t\t\t\tend: endOfWeek( week, { weekStartsOn } ),\n\t\t\t\t\t} )\n\t\t\t\t)\n\t\t\t),\n\t\t[ viewing, weekStartsOn, numberOfMonths ]\n\t);\n\n\treturn {\n\t\tclearTime,\n\t\tinRange,\n\t\tviewing,\n\t\tsetViewing,\n\t\tviewToday,\n\t\tviewMonth,\n\t\tviewPreviousMonth,\n\t\tviewNextMonth,\n\t\tviewYear,\n\t\tviewPreviousYear,\n\t\tviewNextYear,\n\t\tselected,\n\t\tsetSelected,\n\t\tclearSelected,\n\t\tisSelected,\n\t\tselect,\n\t\tdeselect,\n\t\ttoggle,\n\t\tselectRange,\n\t\tdeselectRange,\n\t\tcalendar,\n\t};\n};\n"],"mappings":";;;;;;AAkCA,IAAAA,QAAA,GAAAC,OAAA;AAwBA,IAAAC,QAAA,GAAAD,OAAA;AA1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAsBA;AACA;AACA;AAFA,IAKYE,KAAK,GAAAC,OAAA,CAAAD,KAAA,0BAALA,KAAK;EAALA,KAAK,CAALA,KAAK;EAALA,KAAK,CAALA,KAAK;E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AAK,IACf,IAAA0C,2BAAkB,EACjB;IACCT,KAAK,EAAE,IAAAO,qBAAY,EAAExC,KAAM,CAAC;IAC5BkC,GAAG,EAAE,IAAAO,mBAAU,EAAEzC,KAAM;EACxB,CAAC,EACD;IAAEd;EAAa,CAChB,CAAC,CAAC6B,GAAG,CAAI4B,IAAI,IACZ,IAAAR,0BAAiB,EAAE;IAClBF,KAAK,EAAE,IAAAW,oBAAW,EAAED,IAAI,EAAE;MAAEzD;IAAa,CAAE,CAAC;IAC5CgD,GAAG,EAAE,IAAAW,kBAAS,EAAEF,IAAI,EAAE;MAAEzD;IAAa,CAAE;EACxC,CAAE,CACH,CACD,CAAC,EACF,CAAEE,OAAO,EAAEF,YAAY,EAAEO,cAAc,CACxC,CAAC;EAED,OAAO;IACNd,SAAS;IACTP,OAAO;IACPgB,OAAO;IACPM,UAAU;IACVE,SAAS;IACTG,SAAS;IACTI,iBAAiB;IACjBE,aAAa;IACbE,QAAQ;IACRG,gBAAgB;IAChBE,YAAY;IACZrB,QAAQ;IACRuB,WAAW;IACXE,aAAa;IACbC,UAAU;IACVG,MAAM;IACNM,QAAQ;IACRK,MAAM;IACNC,WAAW;IACXI,aAAa;IACbC;EACD,CAAC;AACF,CAAC;AAACnE,OAAA,CAAAe,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -11,11 +11,10 @@ var _i18n = require("@wordpress/i18n");
11
11
  var _element = require("@wordpress/element");
12
12
  var _styles = require("../styles");
13
13
  var _hStack = require("../../../h-stack");
14
- var _button = _interopRequireDefault(require("../../../button"));
15
- var _buttonGroup = _interopRequireDefault(require("../../../button-group"));
16
14
  var _utils = require("../../utils");
17
15
  var _utils2 = require("../../../utils");
18
16
  var _baseControl = _interopRequireDefault(require("../../../base-control"));
17
+ var _toggleGroupControl = require("../../../toggle-group-control");
19
18
  var _jsxRuntime = require("react/jsx-runtime");
20
19
  /**
21
20
  * External dependencies
@@ -133,23 +132,22 @@ function TimeInput({
133
132
  __unstableStateReducer: (0, _utils.buildPadInputStateReducer)(2),
134
133
  ...minutesProps
135
134
  })]
136
- }), is12Hour && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_buttonGroup.default, {
137
- className: "components-datetime__time-field components-datetime__time-field-am-pm" // Unused, for backwards compatibility.
138
- ,
139
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
140
- className: "components-datetime__time-am-button" // Unused, for backwards compatibility.
141
- ,
142
- variant: dayPeriod === 'AM' ? 'primary' : 'secondary',
143
- __next40pxDefaultSize: true,
144
- onClick: buildAmPmChangeCallback('AM'),
145
- children: (0, _i18n.__)('AM')
146
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
147
- className: "components-datetime__time-pm-button" // Unused, for backwards compatibility.
148
- ,
149
- variant: dayPeriod === 'PM' ? 'primary' : 'secondary',
150
- __next40pxDefaultSize: true,
151
- onClick: buildAmPmChangeCallback('PM'),
152
- children: (0, _i18n.__)('PM')
135
+ }), is12Hour && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_toggleGroupControl.ToggleGroupControl, {
136
+ __next40pxDefaultSize: true,
137
+ __nextHasNoMarginBottom: true,
138
+ isBlock: true,
139
+ label: (0, _i18n.__)('Select AM or PM'),
140
+ hideLabelFromVision: true,
141
+ value: dayPeriod,
142
+ onChange: newValue => {
143
+ buildAmPmChangeCallback(newValue)();
144
+ },
145
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_toggleGroupControl.ToggleGroupControlOption, {
146
+ value: "AM",
147
+ label: (0, _i18n.__)('AM')
148
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_toggleGroupControl.ToggleGroupControlOption, {
149
+ value: "PM",
150
+ label: (0, _i18n.__)('PM')
153
151
  })]
154
152
  })]
155
153
  })]
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_styles","_hStack","_button","_buttonGroup","_utils","_utils2","_baseControl","_jsxRuntime","TimeInput","value","valueProp","defaultValue","is12Hour","label","minutesProps","onChange","hours","Date","getHours","minutes","getMinutes","setValue","useControlledValue","dayPeriod","parseDayPeriod","hours12Format","from24hTo12h","buildNumberControlChangeCallback","method","_value","event","validateInputElementTarget","numberValue","Number","from12hTo24h","buildAmPmChangeCallback","_hours","Wrapper","Fieldset","Fragment","jsxs","children","jsx","default","VisualLabel","as","HStack","alignment","expanded","TimeWrapper","className","HoursInput","__","hideLabelFromVision","__next40pxDefaultSize","String","padStart","step","min","max","required","spinControls","isPressEnterToChange","isDragEnabled","isShiftStepEnabled","__unstableStateReducer","buildPadInputStateReducer","TimeSeparator","MinutesInput","clsx","args","variant","onClick","_default","exports"],"sources":["@wordpress/components/src/date-time/time/time-input/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTimeWrapper,\n\tTimeSeparator,\n\tHoursInput,\n\tMinutesInput,\n\tFieldset,\n} from '../styles';\nimport { HStack } from '../../../h-stack';\nimport Button from '../../../button';\nimport ButtonGroup from '../../../button-group';\nimport {\n\tfrom12hTo24h,\n\tfrom24hTo12h,\n\tbuildPadInputStateReducer,\n\tvalidateInputElementTarget,\n} from '../../utils';\nimport type { TimeInputProps } from '../../types';\nimport type { InputChangeCallback } from '../../../input-control/types';\nimport { useControlledValue } from '../../../utils';\nimport BaseControl from '../../../base-control';\n\nexport function TimeInput( {\n\tvalue: valueProp,\n\tdefaultValue,\n\tis12Hour,\n\tlabel,\n\tminutesProps,\n\tonChange,\n}: TimeInputProps ) {\n\tconst [\n\t\tvalue = {\n\t\t\thours: new Date().getHours(),\n\t\t\tminutes: new Date().getMinutes(),\n\t\t},\n\t\tsetValue,\n\t] = useControlledValue( {\n\t\tvalue: valueProp,\n\t\tonChange,\n\t\tdefaultValue,\n\t} );\n\tconst dayPeriod = parseDayPeriod( value.hours );\n\tconst hours12Format = from24hTo12h( value.hours );\n\n\tconst buildNumberControlChangeCallback = (\n\t\tmethod: 'hours' | 'minutes'\n\t): InputChangeCallback => {\n\t\treturn ( _value, { event } ) => {\n\t\t\tif ( ! validateInputElementTarget( event ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We can safely assume value is a number if target is valid.\n\t\t\tconst numberValue = Number( _value );\n\n\t\t\tsetValue( {\n\t\t\t\t...value,\n\t\t\t\t[ method ]:\n\t\t\t\t\tmethod === 'hours' && is12Hour\n\t\t\t\t\t\t? from12hTo24h( numberValue, dayPeriod === 'PM' )\n\t\t\t\t\t\t: numberValue,\n\t\t\t} );\n\t\t};\n\t};\n\n\tconst buildAmPmChangeCallback = ( _value: 'AM' | 'PM' ) => {\n\t\treturn () => {\n\t\t\tif ( dayPeriod === _value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetValue( {\n\t\t\t\t...value,\n\t\t\t\thours: from12hTo24h( hours12Format, _value === 'PM' ),\n\t\t\t} );\n\t\t};\n\t};\n\n\tfunction parseDayPeriod( _hours: number ) {\n\t\treturn _hours < 12 ? 'AM' : 'PM';\n\t}\n\n\tconst Wrapper = label ? Fieldset : Fragment;\n\n\treturn (\n\t\t<Wrapper>\n\t\t\t{ label && (\n\t\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t\t{ label }\n\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t) }\n\n\t\t\t<HStack alignment=\"left\" expanded={ false }>\n\t\t\t\t<TimeWrapper\n\t\t\t\t\tclassName=\"components-datetime__time-field components-datetime__time-field-time\" // Unused, for backwards compatibility.\n\t\t\t\t>\n\t\t\t\t\t<HoursInput\n\t\t\t\t\t\tclassName=\"components-datetime__time-field-hours-input\" // Unused, for backwards compatibility.\n\t\t\t\t\t\tlabel={ __( 'Hours' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ String(\n\t\t\t\t\t\t\tis12Hour ? hours12Format : value.hours\n\t\t\t\t\t\t).padStart( 2, '0' ) }\n\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\tmin={ is12Hour ? 1 : 0 }\n\t\t\t\t\t\tmax={ is12Hour ? 12 : 23 }\n\t\t\t\t\t\trequired\n\t\t\t\t\t\tspinControls=\"none\"\n\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\tisShiftStepEnabled={ false }\n\t\t\t\t\t\tonChange={ buildNumberControlChangeCallback( 'hours' ) }\n\t\t\t\t\t\t__unstableStateReducer={ buildPadInputStateReducer(\n\t\t\t\t\t\t\t2\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TimeSeparator\n\t\t\t\t\t\tclassName=\"components-datetime__time-separator\" // Unused, for backwards compatibility.\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t>\n\t\t\t\t\t\t:\n\t\t\t\t\t</TimeSeparator>\n\t\t\t\t\t<MinutesInput\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'components-datetime__time-field-minutes-input', // Unused, for backwards compatibility.\n\t\t\t\t\t\t\tminutesProps?.className\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Minutes' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ String( value.minutes ).padStart( 2, '0' ) }\n\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ 59 }\n\t\t\t\t\t\trequired\n\t\t\t\t\t\tspinControls=\"none\"\n\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\tisShiftStepEnabled={ false }\n\t\t\t\t\t\tonChange={ ( ...args ) => {\n\t\t\t\t\t\t\tbuildNumberControlChangeCallback( 'minutes' )(\n\t\t\t\t\t\t\t\t...args\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tminutesProps?.onChange?.( ...args );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t__unstableStateReducer={ buildPadInputStateReducer(\n\t\t\t\t\t\t\t2\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ...minutesProps }\n\t\t\t\t\t/>\n\t\t\t\t</TimeWrapper>\n\t\t\t\t{ is12Hour && (\n\t\t\t\t\t<ButtonGroup\n\t\t\t\t\t\tclassName=\"components-datetime__time-field components-datetime__time-field-am-pm\" // Unused, for backwards compatibility.\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"components-datetime__time-am-button\" // Unused, for backwards compatibility.\n\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\tdayPeriod === 'AM' ? 'primary' : 'secondary'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tonClick={ buildAmPmChangeCallback( 'AM' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'AM' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"components-datetime__time-pm-button\" // Unused, for backwards compatibility.\n\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\tdayPeriod === 'PM' ? 'primary' : 'secondary'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tonClick={ buildAmPmChangeCallback( 'PM' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'PM' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</ButtonGroup>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</Wrapper>\n\t);\n}\nexport default TimeInput;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAA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AAgC,CAAE,SAAU,CAAC,CAC5C,GAAG2C,IACJ,CAAC;YACDxD,YAAY,EAAEC,QAAQ,GAAI,GAAGuD,IAAK,CAAC;UACpC,CAAG;UACHL,sBAAsB,EAAG,IAAAC,gCAAyB,EACjD,CACD,CAAG;UAAA,GACEpD;QAAY,CACjB,CAAC;MAAA,CACU,CAAC,EACZF,QAAQ,iBACT,IAAAL,WAAA,CAAAiC,IAAA,EAACrC,YAAA,CAAAwC,OAAW;QACXO,SAAS,EAAC,uEAAuE,CAAC;QAAA;QAAAT,QAAA,gBAElF,IAAAlC,WAAA,CAAAmC,GAAA,EAACxC,OAAA,CAAAyC,OAAM;UACNO,SAAS,EAAC,qCAAqC,CAAC;UAAA;UAChDqB,OAAO,EACNhD,SAAS,KAAK,IAAI,GAAG,SAAS,GAAG,WACjC;UACD+B,qBAAqB;UACrBkB,OAAO,EAAGrC,uBAAuB,CAAE,IAAK,CAAG;UAAAM,QAAA,EAEzC,IAAAW,QAAE,EAAE,IAAK;QAAC,CACL,CAAC,eACT,IAAA7C,WAAA,CAAAmC,GAAA,EAACxC,OAAA,CAAAyC,OAAM;UACNO,SAAS,EAAC,qCAAqC,CAAC;UAAA;UAChDqB,OAAO,EACNhD,SAAS,KAAK,IAAI,GAAG,SAAS,GAAG,WACjC;UACD+B,qBAAqB;UACrBkB,OAAO,EAAGrC,uBAAuB,CAAE,IAAK,CAAG;UAAAM,QAAA,EAEzC,IAAAW,QAAE,EAAE,IAAK;QAAC,CACL,CAAC;MAAA,CACG,CACb;IAAA,CACM,CAAC;EAAA,CACD,CAAC;AAEZ;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAA/B,OAAA,GACcnC,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_styles","_hStack","_utils","_utils2","_baseControl","_toggleGroupControl","_jsxRuntime","TimeInput","value","valueProp","defaultValue","is12Hour","label","minutesProps","onChange","hours","Date","getHours","minutes","getMinutes","setValue","useControlledValue","dayPeriod","parseDayPeriod","hours12Format","from24hTo12h","buildNumberControlChangeCallback","method","_value","event","validateInputElementTarget","numberValue","Number","from12hTo24h","buildAmPmChangeCallback","_hours","Wrapper","Fieldset","Fragment","jsxs","children","jsx","default","VisualLabel","as","HStack","alignment","expanded","TimeWrapper","className","HoursInput","__","hideLabelFromVision","__next40pxDefaultSize","String","padStart","step","min","max","required","spinControls","isPressEnterToChange","isDragEnabled","isShiftStepEnabled","__unstableStateReducer","buildPadInputStateReducer","TimeSeparator","MinutesInput","clsx","args","ToggleGroupControl","__nextHasNoMarginBottom","isBlock","newValue","ToggleGroupControlOption","_default","exports"],"sources":["@wordpress/components/src/date-time/time/time-input/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTimeWrapper,\n\tTimeSeparator,\n\tHoursInput,\n\tMinutesInput,\n\tFieldset,\n} from '../styles';\nimport { HStack } from '../../../h-stack';\nimport {\n\tfrom12hTo24h,\n\tfrom24hTo12h,\n\tbuildPadInputStateReducer,\n\tvalidateInputElementTarget,\n} from '../../utils';\nimport type { TimeInputProps } from '../../types';\nimport type { InputChangeCallback } from '../../../input-control/types';\nimport { useControlledValue } from '../../../utils';\nimport BaseControl from '../../../base-control';\nimport {\n\tToggleGroupControl,\n\tToggleGroupControlOption,\n} from '../../../toggle-group-control';\n\nexport function TimeInput( {\n\tvalue: valueProp,\n\tdefaultValue,\n\tis12Hour,\n\tlabel,\n\tminutesProps,\n\tonChange,\n}: TimeInputProps ) {\n\tconst [\n\t\tvalue = {\n\t\t\thours: new Date().getHours(),\n\t\t\tminutes: new Date().getMinutes(),\n\t\t},\n\t\tsetValue,\n\t] = useControlledValue( {\n\t\tvalue: valueProp,\n\t\tonChange,\n\t\tdefaultValue,\n\t} );\n\tconst dayPeriod = parseDayPeriod( value.hours );\n\tconst hours12Format = from24hTo12h( value.hours );\n\n\tconst buildNumberControlChangeCallback = (\n\t\tmethod: 'hours' | 'minutes'\n\t): InputChangeCallback => {\n\t\treturn ( _value, { event } ) => {\n\t\t\tif ( ! validateInputElementTarget( event ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We can safely assume value is a number if target is valid.\n\t\t\tconst numberValue = Number( _value );\n\n\t\t\tsetValue( {\n\t\t\t\t...value,\n\t\t\t\t[ method ]:\n\t\t\t\t\tmethod === 'hours' && is12Hour\n\t\t\t\t\t\t? from12hTo24h( numberValue, dayPeriod === 'PM' )\n\t\t\t\t\t\t: numberValue,\n\t\t\t} );\n\t\t};\n\t};\n\n\tconst buildAmPmChangeCallback = ( _value: 'AM' | 'PM' ) => {\n\t\treturn () => {\n\t\t\tif ( dayPeriod === _value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetValue( {\n\t\t\t\t...value,\n\t\t\t\thours: from12hTo24h( hours12Format, _value === 'PM' ),\n\t\t\t} );\n\t\t};\n\t};\n\n\tfunction parseDayPeriod( _hours: number ) {\n\t\treturn _hours < 12 ? 'AM' : 'PM';\n\t}\n\n\tconst Wrapper = label ? Fieldset : Fragment;\n\n\treturn (\n\t\t<Wrapper>\n\t\t\t{ label && (\n\t\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t\t{ label }\n\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t) }\n\n\t\t\t<HStack alignment=\"left\" expanded={ false }>\n\t\t\t\t<TimeWrapper\n\t\t\t\t\tclassName=\"components-datetime__time-field components-datetime__time-field-time\" // Unused, for backwards compatibility.\n\t\t\t\t>\n\t\t\t\t\t<HoursInput\n\t\t\t\t\t\tclassName=\"components-datetime__time-field-hours-input\" // Unused, for backwards compatibility.\n\t\t\t\t\t\tlabel={ __( 'Hours' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ String(\n\t\t\t\t\t\t\tis12Hour ? hours12Format : value.hours\n\t\t\t\t\t\t).padStart( 2, '0' ) }\n\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\tmin={ is12Hour ? 1 : 0 }\n\t\t\t\t\t\tmax={ is12Hour ? 12 : 23 }\n\t\t\t\t\t\trequired\n\t\t\t\t\t\tspinControls=\"none\"\n\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\tisShiftStepEnabled={ false }\n\t\t\t\t\t\tonChange={ buildNumberControlChangeCallback( 'hours' ) }\n\t\t\t\t\t\t__unstableStateReducer={ buildPadInputStateReducer(\n\t\t\t\t\t\t\t2\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TimeSeparator\n\t\t\t\t\t\tclassName=\"components-datetime__time-separator\" // Unused, for backwards compatibility.\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t>\n\t\t\t\t\t\t:\n\t\t\t\t\t</TimeSeparator>\n\t\t\t\t\t<MinutesInput\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'components-datetime__time-field-minutes-input', // Unused, for backwards compatibility.\n\t\t\t\t\t\t\tminutesProps?.className\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Minutes' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ String( value.minutes ).padStart( 2, '0' ) }\n\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ 59 }\n\t\t\t\t\t\trequired\n\t\t\t\t\t\tspinControls=\"none\"\n\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\tisDragEnabled={ false }\n\t\t\t\t\t\tisShiftStepEnabled={ false }\n\t\t\t\t\t\tonChange={ ( ...args ) => {\n\t\t\t\t\t\t\tbuildNumberControlChangeCallback( 'minutes' )(\n\t\t\t\t\t\t\t\t...args\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tminutesProps?.onChange?.( ...args );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t__unstableStateReducer={ buildPadInputStateReducer(\n\t\t\t\t\t\t\t2\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ...minutesProps }\n\t\t\t\t\t/>\n\t\t\t\t</TimeWrapper>\n\t\t\t\t{ is12Hour && (\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\tlabel={ __( 'Select AM or PM' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ dayPeriod }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tbuildAmPmChangeCallback(\n\t\t\t\t\t\t\t\tnewValue as 'AM' | 'PM'\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\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"AM\"\n\t\t\t\t\t\t\tlabel={ __( 'AM' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"PM\"\n\t\t\t\t\t\t\tlabel={ __( 'PM' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</Wrapper>\n\t);\n}\nexport default TimeInput;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AAOA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;A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,CACU,CAAC,EACZF,QAAQ,iBACT,IAAAL,WAAA,CAAAiC,IAAA,EAAClC,mBAAA,CAAAiE,kBAAkB;QAClBjB,qBAAqB;QACrBkB,uBAAuB;QACvBC,OAAO;QACP5D,KAAK,EAAG,IAAAuC,QAAE,EAAE,iBAAkB,CAAG;QACjCC,mBAAmB;QACnB5C,KAAK,EAAGc,SAAW;QACnBR,QAAQ,EAAK2D,QAAQ,IAAM;UAC1BvC,uBAAuB,CACtBuC,QACD,CAAC,CAAC,CAAC;QACJ,CAAG;QAAAjC,QAAA,gBAEH,IAAAlC,WAAA,CAAAmC,GAAA,EAACpC,mBAAA,CAAAqE,wBAAwB;UACxBlE,KAAK,EAAC,IAAI;UACVI,KAAK,EAAG,IAAAuC,QAAE,EAAE,IAAK;QAAG,CACpB,CAAC,eACF,IAAA7C,WAAA,CAAAmC,GAAA,EAACpC,mBAAA,CAAAqE,wBAAwB;UACxBlE,KAAK,EAAC,IAAI;UACVI,KAAK,EAAG,IAAAuC,QAAE,EAAE,IAAK;QAAG,CACpB,CAAC;MAAA,CACiB,CACpB;IAAA,CACM,CAAC;EAAA,CACD,CAAC;AAEZ;AAAC,IAAAwB,QAAA,GAAAC,OAAA,CAAAlC,OAAA,GACcnC,SAAS","ignoreList":[]}
@@ -12,6 +12,7 @@ var _icon = _interopRequireDefault(require("../icon"));
12
12
  var _selectControl = _interopRequireDefault(require("../select-control"));
13
13
  var _sizes = _interopRequireWildcard(require("./sizes"));
14
14
  var _context = require("../context");
15
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
15
16
  var _jsxRuntime = require("react/jsx-runtime");
16
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -40,7 +41,7 @@ const CONTEXT_VALUE = {
40
41
  /**
41
42
  * `DimensionControl` is a component designed to provide a UI to control spacing and/or dimensions.
42
43
  *
43
- * This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
44
+ * @deprecated
44
45
  *
45
46
  * ```jsx
46
47
  * import { __experimentalDimensionControl as DimensionControl } from '@wordpress/components';
@@ -72,6 +73,10 @@ function DimensionControl(props) {
72
73
  onChange,
73
74
  className = ''
74
75
  } = props;
76
+ (0, _deprecated.default)('wp.components.DimensionControl', {
77
+ since: '6.7',
78
+ version: '7.0'
79
+ });
75
80
  const onChangeSpacingSize = val => {
76
81
  const theSize = (0, _sizes.findSizeBySlug)(sizes, val);
77
82
  if (!theSize || value === theSize.slug) {
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_icon","_selectControl","_sizes","_interopRequireWildcard","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CONTEXT_VALUE","BaseControl","_overrides","__associatedWPComponentName","DimensionControl","props","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","sizes","sizesTable","icon","onChange","className","onChangeSpacingSize","val","theSize","findSizeBySlug","slug","undefined","formatSizesAsOptions","theSizes","options","map","name","__","selectLabel","jsxs","Fragment","children","jsx","ContextSystemProvider","clsx","hideLabelFromVision","_default","exports"],"sources":["@wordpress/components/src/dimension-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Icon from '../icon';\nimport SelectControl from '../select-control';\nimport sizesTable, { findSizeBySlug } from './sizes';\nimport type { DimensionControlProps, Size } from './types';\nimport type { SelectControlSingleSelectionProps } from '../select-control/types';\nimport { ContextSystemProvider } from '../context';\n\nconst CONTEXT_VALUE = {\n\tBaseControl: {\n\t\t// Temporary during deprecation grace period: Overrides the underlying `__associatedWPComponentName`\n\t\t// via the context system to override the value set by SelectControl.\n\t\t_overrides: { __associatedWPComponentName: 'DimensionControl' },\n\t},\n};\n\n/**\n * `DimensionControl` is a component designed to provide a UI to control spacing and/or dimensions.\n *\n * This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.\n *\n * ```jsx\n * import { __experimentalDimensionControl as DimensionControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * export default function MyCustomDimensionControl() {\n * \tconst [ paddingSize, setPaddingSize ] = useState( '' );\n *\n * \treturn (\n * \t\t<DimensionControl\n * \t\t\t__nextHasNoMarginBottom\n * \t\t\tlabel={ 'Padding' }\n * \t\t\ticon={ 'desktop' }\n * \t\t\tonChange={ ( value ) => setPaddingSize( value ) }\n * \t\t\tvalue={ paddingSize }\n * \t\t/>\n * \t);\n * }\n * ```\n */\nexport function DimensionControl( props: DimensionControlProps ) {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\t__nextHasNoMarginBottom = false,\n\t\tlabel,\n\t\tvalue,\n\t\tsizes = sizesTable,\n\t\ticon,\n\t\tonChange,\n\t\tclassName = '',\n\t} = props;\n\n\tconst onChangeSpacingSize: SelectControlSingleSelectionProps[ 'onChange' ] =\n\t\t( val ) => {\n\t\t\tconst theSize = findSizeBySlug( sizes, val );\n\n\t\t\tif ( ! theSize || value === theSize.slug ) {\n\t\t\t\tonChange?.( undefined );\n\t\t\t} else if ( typeof onChange === 'function' ) {\n\t\t\t\tonChange( theSize.slug );\n\t\t\t}\n\t\t};\n\n\tconst formatSizesAsOptions = ( theSizes: Size[] ) => {\n\t\tconst options = theSizes.map( ( { name, slug } ) => ( {\n\t\t\tlabel: name,\n\t\t\tvalue: slug,\n\t\t} ) );\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: __( 'Default' ),\n\t\t\t\tvalue: '',\n\t\t\t},\n\t\t\t...options,\n\t\t];\n\t};\n\n\tconst selectLabel = (\n\t\t<>\n\t\t\t{ icon && <Icon icon={ icon } /> }\n\t\t\t{ label }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<ContextSystemProvider value={ CONTEXT_VALUE }>\n\t\t\t<SelectControl\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tclassName,\n\t\t\t\t\t'block-editor-dimension-control'\n\t\t\t\t) }\n\t\t\t\tlabel={ selectLabel }\n\t\t\t\thideLabelFromVision={ false }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChangeSpacingSize }\n\t\t\t\toptions={ formatSizesAsOptions( sizes ) }\n\t\t\t/>\n\t\t</ContextSystemProvider>\n\t);\n}\n\nexport default DimensionControl;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,cAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAC,uBAAA,CAAAL,OAAA;AAGA,IAAAM,QAAA,GAAAN,OAAA;AAAmD,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KA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AnD,WAAA,CAAAoD,GAAA,EAACxD,cAAA,CAAAW,OAAa;MACboB,qBAAqB,EAAGA,qBAAuB;MAC/CC,uBAAuB,EAAGA,uBAAyB;MACnDO,SAAS,EAAG,IAAAmB,aAAI,EACfnB,SAAS,EACT,gCACD,CAAG;MACHN,KAAK,EAAGmB,WAAa;MACrBO,mBAAmB,EAAG,KAAO;MAC7BzB,KAAK,EAAGA,KAAO;MACfI,QAAQ,EAAGE,mBAAqB;MAChCQ,OAAO,EAAGF,oBAAoB,CAAEX,KAAM;IAAG,CACzC;EAAC,CACoB,CAAC;AAE1B;AAAC,IAAAyB,QAAA,GAAAC,OAAA,CAAAlD,OAAA,GAEckB,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_icon","_selectControl","_sizes","_interopRequireWildcard","_context","_deprecated","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CONTEXT_VALUE","BaseControl","_overrides","__associatedWPComponentName","DimensionControl","props","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","sizes","sizesTable","icon","onChange","className","deprecated","since","version","onChangeSpacingSize","val","theSize","findSizeBySlug","slug","undefined","formatSizesAsOptions","theSizes","options","map","name","__","selectLabel","jsxs","Fragment","children","jsx","ContextSystemProvider","clsx","hideLabelFromVision","_default","exports"],"sources":["@wordpress/components/src/dimension-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Icon from '../icon';\nimport SelectControl from '../select-control';\nimport sizesTable, { findSizeBySlug } from './sizes';\nimport type { DimensionControlProps, Size } from './types';\nimport type { SelectControlSingleSelectionProps } from '../select-control/types';\nimport { ContextSystemProvider } from '../context';\nimport deprecated from '@wordpress/deprecated';\n\nconst CONTEXT_VALUE = {\n\tBaseControl: {\n\t\t// Temporary during deprecation grace period: Overrides the underlying `__associatedWPComponentName`\n\t\t// via the context system to override the value set by SelectControl.\n\t\t_overrides: { __associatedWPComponentName: 'DimensionControl' },\n\t},\n};\n\n/**\n * `DimensionControl` is a component designed to provide a UI to control spacing and/or dimensions.\n *\n * @deprecated\n *\n * ```jsx\n * import { __experimentalDimensionControl as DimensionControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * export default function MyCustomDimensionControl() {\n * \tconst [ paddingSize, setPaddingSize ] = useState( '' );\n *\n * \treturn (\n * \t\t<DimensionControl\n * \t\t\t__nextHasNoMarginBottom\n * \t\t\tlabel={ 'Padding' }\n * \t\t\ticon={ 'desktop' }\n * \t\t\tonChange={ ( value ) => setPaddingSize( value ) }\n * \t\t\tvalue={ paddingSize }\n * \t\t/>\n * \t);\n * }\n * ```\n */\nexport function DimensionControl( props: DimensionControlProps ) {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\t__nextHasNoMarginBottom = false,\n\t\tlabel,\n\t\tvalue,\n\t\tsizes = sizesTable,\n\t\ticon,\n\t\tonChange,\n\t\tclassName = '',\n\t} = props;\n\n\tdeprecated( 'wp.components.DimensionControl', {\n\t\tsince: '6.7',\n\t\tversion: '7.0',\n\t} );\n\n\tconst onChangeSpacingSize: SelectControlSingleSelectionProps[ 'onChange' ] =\n\t\t( val ) => {\n\t\t\tconst theSize = findSizeBySlug( sizes, val );\n\n\t\t\tif ( ! theSize || value === theSize.slug ) {\n\t\t\t\tonChange?.( undefined );\n\t\t\t} else if ( typeof onChange === 'function' ) {\n\t\t\t\tonChange( theSize.slug );\n\t\t\t}\n\t\t};\n\n\tconst formatSizesAsOptions = ( theSizes: Size[] ) => {\n\t\tconst options = theSizes.map( ( { name, slug } ) => ( {\n\t\t\tlabel: name,\n\t\t\tvalue: slug,\n\t\t} ) );\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: __( 'Default' ),\n\t\t\t\tvalue: '',\n\t\t\t},\n\t\t\t...options,\n\t\t];\n\t};\n\n\tconst selectLabel = (\n\t\t<>\n\t\t\t{ icon && <Icon icon={ icon } /> }\n\t\t\t{ label }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<ContextSystemProvider value={ CONTEXT_VALUE }>\n\t\t\t<SelectControl\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tclassName,\n\t\t\t\t\t'block-editor-dimension-control'\n\t\t\t\t) }\n\t\t\t\tlabel={ selectLabel }\n\t\t\t\thideLabelFromVision={ false }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChangeSpacingSize }\n\t\t\t\toptions={ formatSizesAsOptions( sizes ) }\n\t\t\t/>\n\t\t</ContextSystemProvider>\n\t);\n}\n\nexport default DimensionControl;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,cAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAC,uBAAA,CAAAL,OAAA;AAGA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAR,sBAAA,CAAAC,OAAA;AAA+C,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA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,EAAC5D,cAAA,CAAAY,OAAa;MACboB,qBAAqB,EAAGA,qBAAuB;MAC/CC,uBAAuB,EAAGA,uBAAyB;MACnDO,SAAS,EAAG,IAAAsB,aAAI,EACftB,SAAS,EACT,gCACD,CAAG;MACHN,KAAK,EAAGsB,WAAa;MACrBO,mBAAmB,EAAG,KAAO;MAC7B5B,KAAK,EAAGA,KAAO;MACfI,QAAQ,EAAGK,mBAAqB;MAChCQ,OAAO,EAAGF,oBAAoB,CAAEd,KAAM;IAAG,CACzC;EAAC,CACoB,CAAC;AAE1B;AAAC,IAAA4B,QAAA,GAAAC,OAAA,CAAArD,OAAA,GAEckB,gBAAgB","ignoreList":[]}
@@ -77,7 +77,7 @@ function Draggable({
77
77
  __experimentalDragComponent: dragComponent
78
78
  }) {
79
79
  const dragComponentRef = (0, _element.useRef)(null);
80
- const cleanup = (0, _element.useRef)(() => {});
80
+ const cleanupRef = (0, _element.useRef)(() => {});
81
81
 
82
82
  /**
83
83
  * Removes the element clone, resets cursor, and removes drag listener.
@@ -86,7 +86,7 @@ function Draggable({
86
86
  */
87
87
  function end(event) {
88
88
  event.preventDefault();
89
- cleanup.current();
89
+ cleanupRef.current();
90
90
  if (onDragEnd) {
91
91
  onDragEnd(event);
92
92
  }
@@ -200,7 +200,7 @@ function Draggable({
200
200
  if (onDragStart) {
201
201
  onDragStart(event);
202
202
  }
203
- cleanup.current = () => {
203
+ cleanupRef.current = () => {
204
204
  // Remove drag clone.
205
205
  if (cloneWrapper && cloneWrapper.parentNode) {
206
206
  cloneWrapper.parentNode.removeChild(cloneWrapper);
@@ -215,7 +215,7 @@ function Draggable({
215
215
  };
216
216
  }
217
217
  (0, _element.useEffect)(() => () => {
218
- cleanup.current();
218
+ cleanupRef.current();
219
219
  }, []);
220
220
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
221
221
  children: [children({
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_element","_jsxRuntime","dragImageClass","cloneWrapperClass","clonePadding","bodyClass","Draggable","children","onDragStart","onDragOver","onDragEnd","appendToOwnerDocument","cloneClassname","elementId","transferData","__experimentalTransferDataType","transferDataType","__experimentalDragComponent","dragComponent","dragComponentRef","useRef","cleanup","end","event","preventDefault","current","start","ownerDocument","target","dataTransfer","setData","JSON","stringify","cloneWrapper","createElement","style","top","left","dragImage","setDragImage","classList","add","body","appendChild","x","y","clientX","clientY","transform","clonedDragComponent","innerHTML","element","getElementById","elementRect","getBoundingClientRect","elementWrapper","parentNode","elementTopOffset","elementLeftOffset","width","clone","cloneNode","id","Array","from","querySelectorAll","forEach","child","removeChild","cursorLeft","cursorTop","over","e","nextX","nextY","throttledDragOver","throttle","addEventListener","remove","removeEventListener","useEffect","jsxs","Fragment","onDraggableStart","onDraggableEnd","jsx","className","display","ref","_default","exports","default"],"sources":["@wordpress/components/src/draggable/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { DragEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { throttle } from '@wordpress/compose';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DraggableProps } from './types';\n\nconst dragImageClass = 'components-draggable__invisible-drag-image';\nconst cloneWrapperClass = 'components-draggable__clone';\nconst clonePadding = 0;\nconst bodyClass = 'is-dragging-components-draggable';\n\n/**\n * `Draggable` is a Component that provides a way to set up a cross-browser\n * (including IE) customizable drag image and the transfer data for the drag\n * event. It decouples the drag handle and the element to drag: use it by\n * wrapping the component that will become the drag handle and providing the DOM\n * ID of the element to drag.\n *\n * Note that the drag handle needs to declare the `draggable=\"true\"` property\n * and bind the `Draggable`s `onDraggableStart` and `onDraggableEnd` event\n * handlers to its own `onDragStart` and `onDragEnd` respectively. `Draggable`\n * takes care of the logic to setup the drag image and the transfer data, but is\n * not concerned with creating an actual DOM element that is draggable.\n *\n * ```jsx\n * import { Draggable, Panel, PanelBody } from '@wordpress/components';\n * import { Icon, more } from '@wordpress/icons';\n *\n * const MyDraggable = () => (\n * <div id=\"draggable-panel\">\n * <Panel header=\"Draggable panel\">\n * <PanelBody>\n * <Draggable elementId=\"draggable-panel\" transferData={ {} }>\n * { ( { onDraggableStart, onDraggableEnd } ) => (\n * <div\n * className=\"example-drag-handle\"\n * draggable\n * onDragStart={ onDraggableStart }\n * onDragEnd={ onDraggableEnd }\n * >\n * <Icon icon={ more } />\n * </div>\n * ) }\n * </Draggable>\n * </PanelBody>\n * </Panel>\n * </div>\n * );\n * ```\n */\nexport function Draggable( {\n\tchildren,\n\tonDragStart,\n\tonDragOver,\n\tonDragEnd,\n\tappendToOwnerDocument = false,\n\tcloneClassname,\n\telementId,\n\ttransferData,\n\t__experimentalTransferDataType: transferDataType = 'text',\n\t__experimentalDragComponent: dragComponent,\n}: DraggableProps ) {\n\tconst dragComponentRef = useRef< HTMLDivElement >( null );\n\tconst cleanup = useRef( () => {} );\n\n\t/**\n\t * Removes the element clone, resets cursor, and removes drag listener.\n\t *\n\t * @param event The non-custom DragEvent.\n\t */\n\tfunction end( event: DragEvent ) {\n\t\tevent.preventDefault();\n\t\tcleanup.current();\n\n\t\tif ( onDragEnd ) {\n\t\t\tonDragEnd( event );\n\t\t}\n\t}\n\n\t/**\n\t * This method does a couple of things:\n\t *\n\t * - Clones the current element and spawns clone over original element.\n\t * - Adds a fake temporary drag image to avoid browser defaults.\n\t * - Sets transfer data.\n\t * - Adds dragover listener.\n\t *\n\t * @param event The non-custom DragEvent.\n\t */\n\tfunction start( event: DragEvent ) {\n\t\tconst { ownerDocument } = event.target as HTMLElement;\n\n\t\tevent.dataTransfer.setData(\n\t\t\ttransferDataType,\n\t\t\tJSON.stringify( transferData )\n\t\t);\n\n\t\tconst cloneWrapper = ownerDocument.createElement( 'div' );\n\t\t// Reset position to 0,0. Natural stacking order will position this lower, even with a transform otherwise.\n\t\tcloneWrapper.style.top = '0';\n\t\tcloneWrapper.style.left = '0';\n\n\t\tconst dragImage = ownerDocument.createElement( 'div' );\n\n\t\t// Set a fake drag image to avoid browser defaults. Remove from DOM\n\t\t// right after. event.dataTransfer.setDragImage is not supported yet in\n\t\t// IE, we need to check for its existence first.\n\t\tif ( 'function' === typeof event.dataTransfer.setDragImage ) {\n\t\t\tdragImage.classList.add( dragImageClass );\n\t\t\townerDocument.body.appendChild( dragImage );\n\t\t\tevent.dataTransfer.setDragImage( dragImage, 0, 0 );\n\t\t}\n\n\t\tcloneWrapper.classList.add( cloneWrapperClass );\n\n\t\tif ( cloneClassname ) {\n\t\t\tcloneWrapper.classList.add( cloneClassname );\n\t\t}\n\n\t\tlet x = 0;\n\t\tlet y = 0;\n\t\t// If a dragComponent is defined, the following logic will clone the\n\t\t// HTML node and inject it into the cloneWrapper.\n\t\tif ( dragComponentRef.current ) {\n\t\t\t// Position dragComponent at the same position as the cursor.\n\t\t\tx = event.clientX;\n\t\t\ty = event.clientY;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\tconst clonedDragComponent = ownerDocument.createElement( 'div' );\n\t\t\tclonedDragComponent.innerHTML = dragComponentRef.current.innerHTML;\n\t\t\tcloneWrapper.appendChild( clonedDragComponent );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\townerDocument.body.appendChild( cloneWrapper );\n\t\t} else {\n\t\t\tconst element = ownerDocument.getElementById(\n\t\t\t\telementId\n\t\t\t) as HTMLElement;\n\n\t\t\t// Prepare element clone and append to element wrapper.\n\t\t\tconst elementRect = element.getBoundingClientRect();\n\t\t\tconst elementWrapper = element.parentNode;\n\t\t\tconst elementTopOffset = elementRect.top;\n\t\t\tconst elementLeftOffset = elementRect.left;\n\n\t\t\tcloneWrapper.style.width = `${\n\t\t\t\telementRect.width + clonePadding * 2\n\t\t\t}px`;\n\n\t\t\tconst clone = element.cloneNode( true ) as HTMLElement;\n\t\t\tclone.id = `clone-${ elementId }`;\n\n\t\t\t// Position clone right over the original element (20px padding).\n\t\t\tx = elementLeftOffset - clonePadding;\n\t\t\ty = elementTopOffset - clonePadding;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\t// Hack: Remove iFrames as it's causing the embeds drag clone to freeze.\n\t\t\tArray.from< HTMLIFrameElement >(\n\t\t\t\tclone.querySelectorAll( 'iframe' )\n\t\t\t).forEach( ( child ) => child.parentNode?.removeChild( child ) );\n\n\t\t\tcloneWrapper.appendChild( clone );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\tif ( appendToOwnerDocument ) {\n\t\t\t\townerDocument.body.appendChild( cloneWrapper );\n\t\t\t} else {\n\t\t\t\telementWrapper?.appendChild( cloneWrapper );\n\t\t\t}\n\t\t}\n\n\t\t// Mark the current cursor coordinates.\n\t\tlet cursorLeft = event.clientX;\n\t\tlet cursorTop = event.clientY;\n\n\t\tfunction over( e: DragEvent ) {\n\t\t\t// Skip doing any work if mouse has not moved.\n\t\t\tif ( cursorLeft === e.clientX && cursorTop === e.clientY ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextX = x + e.clientX - cursorLeft;\n\t\t\tconst nextY = y + e.clientY - cursorTop;\n\t\t\tcloneWrapper.style.transform = `translate( ${ nextX }px, ${ nextY }px )`;\n\t\t\tcursorLeft = e.clientX;\n\t\t\tcursorTop = e.clientY;\n\t\t\tx = nextX;\n\t\t\ty = nextY;\n\t\t\tif ( onDragOver ) {\n\t\t\t\tonDragOver( e );\n\t\t\t}\n\t\t}\n\n\t\t// Aim for 60fps (16 ms per frame) for now. We can potentially use requestAnimationFrame (raf) instead,\n\t\t// note that browsers may throttle raf below 60fps in certain conditions.\n\t\t// @ts-ignore\n\t\tconst throttledDragOver = throttle( over, 16 );\n\n\t\townerDocument.addEventListener( 'dragover', throttledDragOver );\n\n\t\t// Update cursor to 'grabbing', document wide.\n\t\townerDocument.body.classList.add( bodyClass );\n\n\t\tif ( onDragStart ) {\n\t\t\tonDragStart( event );\n\t\t}\n\n\t\tcleanup.current = () => {\n\t\t\t// Remove drag clone.\n\t\t\tif ( cloneWrapper && cloneWrapper.parentNode ) {\n\t\t\t\tcloneWrapper.parentNode.removeChild( cloneWrapper );\n\t\t\t}\n\n\t\t\tif ( dragImage && dragImage.parentNode ) {\n\t\t\t\tdragImage.parentNode.removeChild( dragImage );\n\t\t\t}\n\n\t\t\t// Reset cursor.\n\t\t\townerDocument.body.classList.remove( bodyClass );\n\n\t\t\townerDocument.removeEventListener( 'dragover', throttledDragOver );\n\t\t};\n\t}\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tcleanup.current();\n\t\t},\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ children( {\n\t\t\t\tonDraggableStart: start,\n\t\t\t\tonDraggableEnd: end,\n\t\t\t} ) }\n\t\t\t{ dragComponent && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"components-draggable-drag-component-root\"\n\t\t\t\t\tstyle={ { display: 'none' } }\n\t\t\t\t\tref={ dragComponentRef }\n\t\t\t\t>\n\t\t\t\t\t{ dragComponent }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Draggable;\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAuD,IAAAE,WAAA,GAAAF,OAAA;AATvD;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,MAAMG,cAAc,GAAG,4CAA4C;AACnE,MAAMC,iBAAiB,GAAG,6BAA6B;AACvD,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,SAAS,GAAG,kCAAkC;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAE;EAC1BC,QAAQ;EACRC,WAAW;EACXC,U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AEtBW;IAAa,CACX,CACL;EAAA,CACA,CAAC;AAEL;AAAC,IAAAuE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrF,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_element","_jsxRuntime","dragImageClass","cloneWrapperClass","clonePadding","bodyClass","Draggable","children","onDragStart","onDragOver","onDragEnd","appendToOwnerDocument","cloneClassname","elementId","transferData","__experimentalTransferDataType","transferDataType","__experimentalDragComponent","dragComponent","dragComponentRef","useRef","cleanupRef","end","event","preventDefault","current","start","ownerDocument","target","dataTransfer","setData","JSON","stringify","cloneWrapper","createElement","style","top","left","dragImage","setDragImage","classList","add","body","appendChild","x","y","clientX","clientY","transform","clonedDragComponent","innerHTML","element","getElementById","elementRect","getBoundingClientRect","elementWrapper","parentNode","elementTopOffset","elementLeftOffset","width","clone","cloneNode","id","Array","from","querySelectorAll","forEach","child","removeChild","cursorLeft","cursorTop","over","e","nextX","nextY","throttledDragOver","throttle","addEventListener","remove","removeEventListener","useEffect","jsxs","Fragment","onDraggableStart","onDraggableEnd","jsx","className","display","ref","_default","exports","default"],"sources":["@wordpress/components/src/draggable/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { DragEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { throttle } from '@wordpress/compose';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DraggableProps } from './types';\n\nconst dragImageClass = 'components-draggable__invisible-drag-image';\nconst cloneWrapperClass = 'components-draggable__clone';\nconst clonePadding = 0;\nconst bodyClass = 'is-dragging-components-draggable';\n\n/**\n * `Draggable` is a Component that provides a way to set up a cross-browser\n * (including IE) customizable drag image and the transfer data for the drag\n * event. It decouples the drag handle and the element to drag: use it by\n * wrapping the component that will become the drag handle and providing the DOM\n * ID of the element to drag.\n *\n * Note that the drag handle needs to declare the `draggable=\"true\"` property\n * and bind the `Draggable`s `onDraggableStart` and `onDraggableEnd` event\n * handlers to its own `onDragStart` and `onDragEnd` respectively. `Draggable`\n * takes care of the logic to setup the drag image and the transfer data, but is\n * not concerned with creating an actual DOM element that is draggable.\n *\n * ```jsx\n * import { Draggable, Panel, PanelBody } from '@wordpress/components';\n * import { Icon, more } from '@wordpress/icons';\n *\n * const MyDraggable = () => (\n * <div id=\"draggable-panel\">\n * <Panel header=\"Draggable panel\">\n * <PanelBody>\n * <Draggable elementId=\"draggable-panel\" transferData={ {} }>\n * { ( { onDraggableStart, onDraggableEnd } ) => (\n * <div\n * className=\"example-drag-handle\"\n * draggable\n * onDragStart={ onDraggableStart }\n * onDragEnd={ onDraggableEnd }\n * >\n * <Icon icon={ more } />\n * </div>\n * ) }\n * </Draggable>\n * </PanelBody>\n * </Panel>\n * </div>\n * );\n * ```\n */\nexport function Draggable( {\n\tchildren,\n\tonDragStart,\n\tonDragOver,\n\tonDragEnd,\n\tappendToOwnerDocument = false,\n\tcloneClassname,\n\telementId,\n\ttransferData,\n\t__experimentalTransferDataType: transferDataType = 'text',\n\t__experimentalDragComponent: dragComponent,\n}: DraggableProps ) {\n\tconst dragComponentRef = useRef< HTMLDivElement >( null );\n\tconst cleanupRef = useRef( () => {} );\n\n\t/**\n\t * Removes the element clone, resets cursor, and removes drag listener.\n\t *\n\t * @param event The non-custom DragEvent.\n\t */\n\tfunction end( event: DragEvent ) {\n\t\tevent.preventDefault();\n\t\tcleanupRef.current();\n\n\t\tif ( onDragEnd ) {\n\t\t\tonDragEnd( event );\n\t\t}\n\t}\n\n\t/**\n\t * This method does a couple of things:\n\t *\n\t * - Clones the current element and spawns clone over original element.\n\t * - Adds a fake temporary drag image to avoid browser defaults.\n\t * - Sets transfer data.\n\t * - Adds dragover listener.\n\t *\n\t * @param event The non-custom DragEvent.\n\t */\n\tfunction start( event: DragEvent ) {\n\t\tconst { ownerDocument } = event.target as HTMLElement;\n\n\t\tevent.dataTransfer.setData(\n\t\t\ttransferDataType,\n\t\t\tJSON.stringify( transferData )\n\t\t);\n\n\t\tconst cloneWrapper = ownerDocument.createElement( 'div' );\n\t\t// Reset position to 0,0. Natural stacking order will position this lower, even with a transform otherwise.\n\t\tcloneWrapper.style.top = '0';\n\t\tcloneWrapper.style.left = '0';\n\n\t\tconst dragImage = ownerDocument.createElement( 'div' );\n\n\t\t// Set a fake drag image to avoid browser defaults. Remove from DOM\n\t\t// right after. event.dataTransfer.setDragImage is not supported yet in\n\t\t// IE, we need to check for its existence first.\n\t\tif ( 'function' === typeof event.dataTransfer.setDragImage ) {\n\t\t\tdragImage.classList.add( dragImageClass );\n\t\t\townerDocument.body.appendChild( dragImage );\n\t\t\tevent.dataTransfer.setDragImage( dragImage, 0, 0 );\n\t\t}\n\n\t\tcloneWrapper.classList.add( cloneWrapperClass );\n\n\t\tif ( cloneClassname ) {\n\t\t\tcloneWrapper.classList.add( cloneClassname );\n\t\t}\n\n\t\tlet x = 0;\n\t\tlet y = 0;\n\t\t// If a dragComponent is defined, the following logic will clone the\n\t\t// HTML node and inject it into the cloneWrapper.\n\t\tif ( dragComponentRef.current ) {\n\t\t\t// Position dragComponent at the same position as the cursor.\n\t\t\tx = event.clientX;\n\t\t\ty = event.clientY;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\tconst clonedDragComponent = ownerDocument.createElement( 'div' );\n\t\t\tclonedDragComponent.innerHTML = dragComponentRef.current.innerHTML;\n\t\t\tcloneWrapper.appendChild( clonedDragComponent );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\townerDocument.body.appendChild( cloneWrapper );\n\t\t} else {\n\t\t\tconst element = ownerDocument.getElementById(\n\t\t\t\telementId\n\t\t\t) as HTMLElement;\n\n\t\t\t// Prepare element clone and append to element wrapper.\n\t\t\tconst elementRect = element.getBoundingClientRect();\n\t\t\tconst elementWrapper = element.parentNode;\n\t\t\tconst elementTopOffset = elementRect.top;\n\t\t\tconst elementLeftOffset = elementRect.left;\n\n\t\t\tcloneWrapper.style.width = `${\n\t\t\t\telementRect.width + clonePadding * 2\n\t\t\t}px`;\n\n\t\t\tconst clone = element.cloneNode( true ) as HTMLElement;\n\t\t\tclone.id = `clone-${ elementId }`;\n\n\t\t\t// Position clone right over the original element (20px padding).\n\t\t\tx = elementLeftOffset - clonePadding;\n\t\t\ty = elementTopOffset - clonePadding;\n\t\t\tcloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;\n\n\t\t\t// Hack: Remove iFrames as it's causing the embeds drag clone to freeze.\n\t\t\tArray.from< HTMLIFrameElement >(\n\t\t\t\tclone.querySelectorAll( 'iframe' )\n\t\t\t).forEach( ( child ) => child.parentNode?.removeChild( child ) );\n\n\t\t\tcloneWrapper.appendChild( clone );\n\n\t\t\t// Inject the cloneWrapper into the DOM.\n\t\t\tif ( appendToOwnerDocument ) {\n\t\t\t\townerDocument.body.appendChild( cloneWrapper );\n\t\t\t} else {\n\t\t\t\telementWrapper?.appendChild( cloneWrapper );\n\t\t\t}\n\t\t}\n\n\t\t// Mark the current cursor coordinates.\n\t\tlet cursorLeft = event.clientX;\n\t\tlet cursorTop = event.clientY;\n\n\t\tfunction over( e: DragEvent ) {\n\t\t\t// Skip doing any work if mouse has not moved.\n\t\t\tif ( cursorLeft === e.clientX && cursorTop === e.clientY ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextX = x + e.clientX - cursorLeft;\n\t\t\tconst nextY = y + e.clientY - cursorTop;\n\t\t\tcloneWrapper.style.transform = `translate( ${ nextX }px, ${ nextY }px )`;\n\t\t\tcursorLeft = e.clientX;\n\t\t\tcursorTop = e.clientY;\n\t\t\tx = nextX;\n\t\t\ty = nextY;\n\t\t\tif ( onDragOver ) {\n\t\t\t\tonDragOver( e );\n\t\t\t}\n\t\t}\n\n\t\t// Aim for 60fps (16 ms per frame) for now. We can potentially use requestAnimationFrame (raf) instead,\n\t\t// note that browsers may throttle raf below 60fps in certain conditions.\n\t\t// @ts-ignore\n\t\tconst throttledDragOver = throttle( over, 16 );\n\n\t\townerDocument.addEventListener( 'dragover', throttledDragOver );\n\n\t\t// Update cursor to 'grabbing', document wide.\n\t\townerDocument.body.classList.add( bodyClass );\n\n\t\tif ( onDragStart ) {\n\t\t\tonDragStart( event );\n\t\t}\n\n\t\tcleanupRef.current = () => {\n\t\t\t// Remove drag clone.\n\t\t\tif ( cloneWrapper && cloneWrapper.parentNode ) {\n\t\t\t\tcloneWrapper.parentNode.removeChild( cloneWrapper );\n\t\t\t}\n\n\t\t\tif ( dragImage && dragImage.parentNode ) {\n\t\t\t\tdragImage.parentNode.removeChild( dragImage );\n\t\t\t}\n\n\t\t\t// Reset cursor.\n\t\t\townerDocument.body.classList.remove( bodyClass );\n\n\t\t\townerDocument.removeEventListener( 'dragover', throttledDragOver );\n\t\t};\n\t}\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tcleanupRef.current();\n\t\t},\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ children( {\n\t\t\t\tonDraggableStart: start,\n\t\t\t\tonDraggableEnd: end,\n\t\t\t} ) }\n\t\t\t{ dragComponent && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"components-draggable-drag-component-root\"\n\t\t\t\t\tstyle={ { display: 'none' } }\n\t\t\t\t\tref={ dragComponentRef }\n\t\t\t\t>\n\t\t\t\t\t{ dragComponent }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Draggable;\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAuD,IAAAE,WAAA,GAAAF,OAAA;AATvD;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,MAAMG,cAAc,GAAG,4CAA4C;AACnE,MAAMC,iBAAiB,GAAG,6BAA6B;AACvD,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,SAAS,GAAG,kCAAkC;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AE,CAAC,EACDJ,aAAa,iBACd,IAAAjB,WAAA,CAAAoF,GAAA;MACCC,SAAS,EAAC,0CAA0C;MACpDnD,KAAK,EAAG;QAAEoD,OAAO,EAAE;MAAO,CAAG;MAC7BC,GAAG,EAAGrE,gBAAkB;MAAAZ,QAAA,EAEtBW;IAAa,CACX,CACL;EAAA,CACA,CAAC;AAEL;AAAC,IAAAuE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrF,SAAS","ignoreList":[]}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DropdownMenuCheckboxItem = void 0;
7
+ var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
8
+ var _element = require("@wordpress/element");
9
+ var _icons = require("@wordpress/icons");
10
+ var _context = require("./context");
11
+ var Styled = _interopRequireWildcard(require("./styles"));
12
+ var _useTemporaryFocusVisibleFix = require("./use-temporary-focus-visible-fix");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ /**
17
+ * External dependencies
18
+ */
19
+
20
+ /**
21
+ * WordPress dependencies
22
+ */
23
+
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+
28
+ const DropdownMenuCheckboxItem = exports.DropdownMenuCheckboxItem = (0, _element.forwardRef)(function DropdownMenuCheckboxItem({
29
+ suffix,
30
+ children,
31
+ onBlur,
32
+ hideOnClick = false,
33
+ ...props
34
+ }, ref) {
35
+ // TODO: Remove when https://github.com/ariakit/ariakit/issues/4083 is fixed
36
+ const focusVisibleFixProps = (0, _useTemporaryFocusVisibleFix.useTemporaryFocusVisibleFix)({
37
+ onBlur
38
+ });
39
+ const dropdownMenuContext = (0, _element.useContext)(_context.DropdownMenuContext);
40
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.DropdownMenuCheckboxItem, {
41
+ ref: ref,
42
+ ...props,
43
+ ...focusVisibleFixProps,
44
+ accessibleWhenDisabled: true,
45
+ hideOnClick: hideOnClick,
46
+ store: dropdownMenuContext?.store,
47
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Ariakit.MenuItemCheck, {
48
+ store: dropdownMenuContext?.store,
49
+ render: /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.ItemPrefixWrapper, {})
50
+ // Override some ariakit inline styles
51
+ ,
52
+ style: {
53
+ width: 'auto',
54
+ height: 'auto'
55
+ },
56
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
57
+ icon: _icons.check,
58
+ size: 24
59
+ })
60
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.DropdownMenuItemContentWrapper, {
61
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.DropdownMenuItemChildrenWrapper, {
62
+ children: children
63
+ }), suffix && /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.ItemSuffixWrapper, {
64
+ children: suffix
65
+ })]
66
+ })]
67
+ });
68
+ });
69
+ //# sourceMappingURL=checkbox-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_icons","_context","Styled","_useTemporaryFocusVisibleFix","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DropdownMenuCheckboxItem","exports","forwardRef","suffix","children","onBlur","hideOnClick","props","ref","focusVisibleFixProps","useTemporaryFocusVisibleFix","dropdownMenuContext","useContext","DropdownMenuContext","jsxs","accessibleWhenDisabled","store","jsx","MenuItemCheck","render","ItemPrefixWrapper","style","width","height","Icon","icon","check","size","DropdownMenuItemContentWrapper","DropdownMenuItemChildrenWrapper","ItemSuffixWrapper"],"sources":["@wordpress/components/src/dropdown-menu-v2/checkbox-item.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\nimport { Icon, check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { DropdownMenuContext } from './context';\nimport type { DropdownMenuCheckboxItemProps } from './types';\nimport * as Styled from './styles';\nimport { useTemporaryFocusVisibleFix } from './use-temporary-focus-visible-fix';\n\nexport const DropdownMenuCheckboxItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuCheckboxItemProps, 'div', false >\n>( function DropdownMenuCheckboxItem(\n\t{ suffix, children, onBlur, hideOnClick = false, ...props },\n\tref\n) {\n\t// TODO: Remove when https://github.com/ariakit/ariakit/issues/4083 is fixed\n\tconst focusVisibleFixProps = useTemporaryFocusVisibleFix( { onBlur } );\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\n\treturn (\n\t\t<Styled.DropdownMenuCheckboxItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\t{ ...focusVisibleFixProps }\n\t\t\taccessibleWhenDisabled\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ dropdownMenuContext?.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t\t// Override some ariakit inline styles\n\t\t\t\tstyle={ { width: 'auto', height: 'auto' } }\n\t\t\t>\n\t\t\t\t<Icon icon={ check } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t<Styled.DropdownMenuItemContentWrapper>\n\t\t\t\t<Styled.DropdownMenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.DropdownMenuItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.DropdownMenuItemContentWrapper>\n\t\t</Styled.DropdownMenuCheckboxItem>\n\t);\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAMA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,4BAAA,GAAAL,OAAA;AAAgF,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA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AAzB,WAAA,CAAAsC,GAAA,EAAC9C,OAAO,CAAC+C,aAAa;MACrBF,KAAK,EAAGL,mBAAmB,EAAEK,KAAO;MACpCG,MAAM,eAAG,IAAAxC,WAAA,CAAAsC,GAAA,EAACxC,MAAM,CAAC2C,iBAAiB,IAAE;MACpC;MAAA;MACAC,KAAK,EAAG;QAAEC,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE;MAAO,CAAG;MAAAnB,QAAA,eAE3C,IAAAzB,WAAA,CAAAsC,GAAA,EAAC1C,MAAA,CAAAiD,IAAI;QAACC,IAAI,EAAGC,YAAO;QAACC,IAAI,EAAG;MAAI,CAAE;IAAC,CACb,CAAC,eAExB,IAAAhD,WAAA,CAAAmC,IAAA,EAACrC,MAAM,CAACmD,8BAA8B;MAAAxB,QAAA,gBACrC,IAAAzB,WAAA,CAAAsC,GAAA,EAACxC,MAAM,CAACoD,+BAA+B;QAAAzB,QAAA,EACpCA;MAAQ,CAC6B,CAAC,EAEvCD,MAAM,iBACP,IAAAxB,WAAA,CAAAsC,GAAA,EAACxC,MAAM,CAACqD,iBAAiB;QAAA1B,QAAA,EACtBD;MAAM,CACiB,CAC1B;IAAA,CACqC,CAAC;EAAA,CACR,CAAC;AAEpC,CAAE,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DropdownMenuContext = void 0;
7
+ var _element = require("@wordpress/element");
8
+ /**
9
+ * WordPress dependencies
10
+ */
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+
16
+ const DropdownMenuContext = exports.DropdownMenuContext = (0, _element.createContext)(undefined);
17
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_element","require","DropdownMenuContext","exports","createContext","undefined"],"sources":["@wordpress/components/src/dropdown-menu-v2/context.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DropdownMenuContext as DropdownMenuContextType } from './types';\n\nexport const DropdownMenuContext = createContext<\n\tDropdownMenuContextType | undefined\n>( undefined );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,sBAAa,EAE7CC,SAAU,CAAC","ignoreList":[]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DropdownMenuGroupLabel = void 0;
7
+ var _element = require("@wordpress/element");
8
+ var _context = require("./context");
9
+ var _text = require("../text");
10
+ var Styled = _interopRequireWildcard(require("./styles"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ /**
15
+ * WordPress dependencies
16
+ */
17
+
18
+ /**
19
+ * Internal dependencies
20
+ */
21
+
22
+ const DropdownMenuGroupLabel = exports.DropdownMenuGroupLabel = (0, _element.forwardRef)(function DropdownMenuGroup(props, ref) {
23
+ const dropdownMenuContext = (0, _element.useContext)(_context.DropdownMenuContext);
24
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.DropdownMenuGroupLabel, {
25
+ ref: ref,
26
+ render:
27
+ /*#__PURE__*/
28
+ // @ts-expect-error The `children` prop is passed
29
+ (0, _jsxRuntime.jsx)(_text.Text, {
30
+ upperCase: true,
31
+ variant: "muted",
32
+ size: "11px",
33
+ weight: 500,
34
+ lineHeight: "16px"
35
+ }),
36
+ ...props,
37
+ store: dropdownMenuContext?.store
38
+ });
39
+ });
40
+ //# sourceMappingURL=group-label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_element","require","_context","_text","Styled","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DropdownMenuGroupLabel","exports","forwardRef","DropdownMenuGroup","props","ref","dropdownMenuContext","useContext","DropdownMenuContext","jsx","render","Text","upperCase","variant","size","weight","lineHeight","store"],"sources":["@wordpress/components/src/dropdown-menu-v2/group-label.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { DropdownMenuContext } from './context';\nimport { Text } from '../text';\nimport type { DropdownMenuGroupLabelProps } from './types';\nimport * as Styled from './styles';\n\nexport const DropdownMenuGroupLabel = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuGroupLabelProps, 'div', false >\n>( function DropdownMenuGroup( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuGroupLabel\n\t\t\tref={ ref }\n\t\t\trender={\n\t\t\t\t// @ts-expect-error The `children` prop is passed\n\t\t\t\t<Text\n\t\t\t\t\tupperCase\n\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\tsize=\"11px\"\n\t\t\t\t\tweight={ 500 }\n\t\t\t\t\tlineHeight=\"16px\"\n\t\t\t\t/>\n\t\t\t}\n\t\t\t{ ...props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L,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAZnC;AACA;AACA;;AAGA;AACA;AACA;;AAOO,MAAMW,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,IAAAE,mBAAU,EAG7C,SAASC,iBAAiBA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EAC3C,MAAMC,mBAAmB,GAAG,IAAAC,mBAAU,EAAEC,4BAAoB,CAAC;EAC7D,oBACC,IAAA7B,WAAA,CAAA8B,GAAA,EAAChC,MAAM,CAACuB,sBAAsB;IAC7BK,GAAG,EAAGA,GAAK;IACXK,MAAM;IAAA;IACL;IACA,IAAA/B,WAAA,CAAA8B,GAAA,EAACjC,KAAA,CAAAmC,IAAI;MACJC,SAAS;MACTC,OAAO,EAAC,OAAO;MACfC,IAAI,EAAC,MAAM;MACXC,MAAM,EAAG,GAAK;MACdC,UAAU,EAAC;IAAM,CACjB,CACD;IAAA,GACIZ,KAAK;IACVa,KAAK,EAAGX,mBAAmB,EAAEW;EAAO,CACpC,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DropdownMenuGroup = void 0;
7
+ var _element = require("@wordpress/element");
8
+ var _context = require("./context");
9
+ var Styled = _interopRequireWildcard(require("./styles"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
+ /**
14
+ * WordPress dependencies
15
+ */
16
+
17
+ /**
18
+ * Internal dependencies
19
+ */
20
+
21
+ const DropdownMenuGroup = exports.DropdownMenuGroup = (0, _element.forwardRef)(function DropdownMenuGroup(props, ref) {
22
+ const dropdownMenuContext = (0, _element.useContext)(_context.DropdownMenuContext);
23
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.DropdownMenuGroup, {
24
+ ref: ref,
25
+ ...props,
26
+ store: dropdownMenuContext?.store
27
+ });
28
+ });
29
+ //# sourceMappingURL=group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_element","require","_context","Styled","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DropdownMenuGroup","exports","forwardRef","props","ref","dropdownMenuContext","useContext","DropdownMenuContext","jsx","store"],"sources":["@wordpress/components/src/dropdown-menu-v2/group.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { DropdownMenuContext } from './context';\nimport type { DropdownMenuGroupProps } from './types';\nimport * as Styled from './styles';\n\nexport const DropdownMenuGroup = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< DropdownMenuGroupProps, 'div', false >\n>( function DropdownMenuGroup( props, ref ) {\n\tconst dropdownMenuContext = useContext( DropdownMenuContext );\n\treturn (\n\t\t<Styled.DropdownMenuGroup\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ dropdownMenuContext?.store }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;AAGA,IAA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