@wordpress/components 28.6.0 → 28.7.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 (588) hide show
  1. package/CHANGELOG.md +77 -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/group-label.js +33 -0
  35. package/build/composite/group-label.js.map +1 -0
  36. package/build/composite/group.js +33 -0
  37. package/build/composite/group.js.map +1 -0
  38. package/build/composite/hover.js +33 -0
  39. package/build/composite/hover.js.map +1 -0
  40. package/build/composite/index.js +50 -96
  41. package/build/composite/index.js.map +1 -1
  42. package/build/composite/item.js +33 -0
  43. package/build/composite/item.js.map +1 -0
  44. package/build/composite/legacy/index.js +2 -1
  45. package/build/composite/legacy/index.js.map +1 -1
  46. package/build/composite/row.js +33 -0
  47. package/build/composite/row.js.map +1 -0
  48. package/build/composite/store.js +54 -0
  49. package/build/composite/store.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/styles.js +8 -8
  58. package/build/date-time/date/styles.js.map +1 -1
  59. package/build/date-time/time/time-input/index.js +17 -19
  60. package/build/date-time/time/time-input/index.js.map +1 -1
  61. package/build/dimension-control/index.js +6 -1
  62. package/build/dimension-control/index.js.map +1 -1
  63. package/build/draggable/index.js +4 -4
  64. package/build/draggable/index.js.map +1 -1
  65. package/build/dropdown-menu-v2/checkbox-item.js +69 -0
  66. package/build/dropdown-menu-v2/checkbox-item.js.map +1 -0
  67. package/build/dropdown-menu-v2/context.js +17 -0
  68. package/build/dropdown-menu-v2/context.js.map +1 -0
  69. package/build/dropdown-menu-v2/group-label.js +40 -0
  70. package/build/dropdown-menu-v2/group-label.js.map +1 -0
  71. package/build/dropdown-menu-v2/group.js +29 -0
  72. package/build/dropdown-menu-v2/group.js.map +1 -0
  73. package/build/dropdown-menu-v2/index.js +58 -146
  74. package/build/dropdown-menu-v2/index.js.map +1 -1
  75. package/build/dropdown-menu-v2/item-help-text.js +27 -0
  76. package/build/dropdown-menu-v2/item-help-text.js.map +1 -0
  77. package/build/dropdown-menu-v2/item-label.js +27 -0
  78. package/build/dropdown-menu-v2/item-label.js.map +1 -0
  79. package/build/dropdown-menu-v2/item.js +53 -0
  80. package/build/dropdown-menu-v2/item.js.map +1 -0
  81. package/build/dropdown-menu-v2/radio-item.js +79 -0
  82. package/build/dropdown-menu-v2/radio-item.js.map +1 -0
  83. package/build/dropdown-menu-v2/separator.js +30 -0
  84. package/build/dropdown-menu-v2/separator.js.map +1 -0
  85. package/build/dropdown-menu-v2/styles.js +54 -78
  86. package/build/dropdown-menu-v2/styles.js.map +1 -1
  87. package/build/dropdown-menu-v2/types.js.map +1 -1
  88. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js +27 -0
  89. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  90. package/build/focal-point-picker/styles/focal-point-style.js +7 -2
  91. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  92. package/build/form-token-field/types.js.map +1 -1
  93. package/build/index.js +6 -0
  94. package/build/index.js.map +1 -1
  95. package/build/input-control/index.js +2 -2
  96. package/build/input-control/index.js.map +1 -1
  97. package/build/input-control/input-base.js +5 -10
  98. package/build/input-control/input-base.js.map +1 -1
  99. package/build/input-control/input-prefix-wrapper.js +3 -3
  100. package/build/input-control/input-prefix-wrapper.js.map +1 -1
  101. package/build/input-control/input-suffix-wrapper.js +2 -3
  102. package/build/input-control/input-suffix-wrapper.js.map +1 -1
  103. package/build/input-control/reducer/reducer.js +8 -8
  104. package/build/input-control/reducer/reducer.js.map +1 -1
  105. package/build/input-control/styles/input-control-styles.js +75 -45
  106. package/build/input-control/styles/input-control-styles.js.map +1 -1
  107. package/build/input-control/types.js.map +1 -1
  108. package/build/input-control/utils.js +3 -3
  109. package/build/input-control/utils.js.map +1 -1
  110. package/build/item-group/styles.js +10 -10
  111. package/build/item-group/styles.js.map +1 -1
  112. package/build/modal/index.js +5 -5
  113. package/build/modal/index.js.map +1 -1
  114. package/build/navigation/index.js +4 -4
  115. package/build/navigation/index.js.map +1 -1
  116. package/build/navigation/styles/navigation-styles.js +13 -13
  117. package/build/navigation/styles/navigation-styles.js.map +1 -1
  118. package/build/navigator/index.js +12 -13
  119. package/build/navigator/index.js.map +1 -1
  120. package/build/navigator/navigator-back-button/hook.js +2 -2
  121. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  122. package/build/navigator/navigator-button/hook.js +2 -2
  123. package/build/navigator/navigator-button/hook.js.map +1 -1
  124. package/build/navigator/navigator-provider/component.js +99 -67
  125. package/build/navigator/navigator-provider/component.js.map +1 -1
  126. package/build/navigator/navigator-to-parent-button/component.js +2 -2
  127. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  128. package/build/navigator/types.js.map +1 -1
  129. package/build/navigator/use-navigator.js +1 -2
  130. package/build/navigator/use-navigator.js.map +1 -1
  131. package/build/palette-edit/index.js +2 -2
  132. package/build/palette-edit/index.js.map +1 -1
  133. package/build/private-apis.js +5 -9
  134. package/build/private-apis.js.map +1 -1
  135. package/build/range-control/styles/range-control-styles.js +30 -30
  136. package/build/range-control/styles/range-control-styles.js.map +1 -1
  137. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  138. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  139. package/build/select-control/styles/select-control-styles.js +12 -12
  140. package/build/select-control/styles/select-control-styles.js.map +1 -1
  141. package/build/slot-fill/bubbles-virtually/fill.js +4 -4
  142. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  143. package/build/snackbar/index.js +4 -4
  144. package/build/snackbar/index.js.map +1 -1
  145. package/build/tabs/index.js +4 -4
  146. package/build/tabs/index.js.map +1 -1
  147. package/build/tabs/styles.js +3 -3
  148. package/build/tabs/styles.js.map +1 -1
  149. package/build/toggle-group-control/toggle-group-control/utils.js +6 -6
  150. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  151. package/build/tools-panel/tools-panel/hook.js +6 -6
  152. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  153. package/build/unit-control/styles/unit-control-styles.js +7 -7
  154. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  155. package/build/utils/config-values.js +6 -4
  156. package/build/utils/config-values.js.map +1 -1
  157. package/build/utils/hooks/use-update-effect.js +4 -4
  158. package/build/utils/hooks/use-update-effect.js.map +1 -1
  159. package/build-module/alignment-matrix-control/cell.js +2 -5
  160. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  161. package/build-module/alignment-matrix-control/icon.js +31 -19
  162. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  163. package/build-module/alignment-matrix-control/index.js +55 -50
  164. package/build-module/alignment-matrix-control/index.js.map +1 -1
  165. package/build-module/alignment-matrix-control/styles.js +70 -0
  166. package/build-module/alignment-matrix-control/styles.js.map +1 -0
  167. package/build-module/alignment-matrix-control/types.js.map +1 -1
  168. package/build-module/angle-picker-control/angle-circle.js +9 -9
  169. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  170. package/build-module/border-control/border-control/component.js +18 -13
  171. package/build-module/border-control/border-control/component.js.map +1 -1
  172. package/build-module/circular-option-picker/circular-option-picker-option.js +16 -10
  173. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  174. package/build-module/circular-option-picker/circular-option-picker.js +16 -13
  175. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  176. package/build-module/circular-option-picker/types.js.map +1 -1
  177. package/build-module/clipboard-button/index.js +6 -6
  178. package/build-module/clipboard-button/index.js.map +1 -1
  179. package/build-module/color-palette/utils.js +1 -2
  180. package/build-module/color-palette/utils.js.map +1 -1
  181. package/build-module/color-picker/color-copy-button.js +8 -8
  182. package/build-module/color-picker/color-copy-button.js.map +1 -1
  183. package/build-module/color-picker/hex-input.js +7 -8
  184. package/build-module/color-picker/hex-input.js.map +1 -1
  185. package/build-module/color-picker/input-with-slider.js +7 -8
  186. package/build-module/color-picker/input-with-slider.js.map +1 -1
  187. package/build-module/color-picker/styles.js +8 -8
  188. package/build-module/color-picker/styles.js.map +1 -1
  189. package/build-module/combobox-control/types.js.map +1 -1
  190. package/build-module/composite/group-label.js +25 -0
  191. package/build-module/composite/group-label.js.map +1 -0
  192. package/build-module/composite/group.js +25 -0
  193. package/build-module/composite/group.js.map +1 -0
  194. package/build-module/composite/hover.js +25 -0
  195. package/build-module/composite/hover.js.map +1 -0
  196. package/build-module/composite/index.js +51 -96
  197. package/build-module/composite/index.js.map +1 -1
  198. package/build-module/composite/item.js +25 -0
  199. package/build-module/composite/item.js.map +1 -0
  200. package/build-module/composite/legacy/index.js +2 -1
  201. package/build-module/composite/legacy/index.js.map +1 -1
  202. package/build-module/composite/row.js +25 -0
  203. package/build-module/composite/row.js.map +1 -0
  204. package/build-module/composite/store.js +46 -0
  205. package/build-module/composite/store.js.map +1 -0
  206. package/build-module/composite/typeahead.js +25 -0
  207. package/build-module/composite/typeahead.js.map +1 -0
  208. package/build-module/composite/types.js.map +1 -1
  209. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  210. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  211. package/build-module/custom-select-control-v2/styles.js +12 -14
  212. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  213. package/build-module/date-time/date/styles.js +8 -8
  214. package/build-module/date-time/date/styles.js.map +1 -1
  215. package/build-module/date-time/time/time-input/index.js +17 -19
  216. package/build-module/date-time/time/time-input/index.js.map +1 -1
  217. package/build-module/dimension-control/index.js +6 -1
  218. package/build-module/dimension-control/index.js.map +1 -1
  219. package/build-module/draggable/index.js +4 -4
  220. package/build-module/draggable/index.js.map +1 -1
  221. package/build-module/dropdown-menu-v2/checkbox-item.js +62 -0
  222. package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -0
  223. package/build-module/dropdown-menu-v2/context.js +11 -0
  224. package/build-module/dropdown-menu-v2/context.js.map +1 -0
  225. package/build-module/dropdown-menu-v2/group-label.js +32 -0
  226. package/build-module/dropdown-menu-v2/group-label.js.map +1 -0
  227. package/build-module/dropdown-menu-v2/group.js +21 -0
  228. package/build-module/dropdown-menu-v2/group.js.map +1 -0
  229. package/build-module/dropdown-menu-v2/index.js +57 -144
  230. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  231. package/build-module/dropdown-menu-v2/item-help-text.js +19 -0
  232. package/build-module/dropdown-menu-v2/item-help-text.js.map +1 -0
  233. package/build-module/dropdown-menu-v2/item-label.js +19 -0
  234. package/build-module/dropdown-menu-v2/item-label.js.map +1 -0
  235. package/build-module/dropdown-menu-v2/item.js +46 -0
  236. package/build-module/dropdown-menu-v2/item.js.map +1 -0
  237. package/build-module/dropdown-menu-v2/radio-item.js +72 -0
  238. package/build-module/dropdown-menu-v2/radio-item.js.map +1 -0
  239. package/build-module/dropdown-menu-v2/separator.js +22 -0
  240. package/build-module/dropdown-menu-v2/separator.js.map +1 -0
  241. package/build-module/dropdown-menu-v2/styles.js +54 -78
  242. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  243. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  244. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js +20 -0
  245. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  246. package/build-module/focal-point-picker/styles/focal-point-style.js +6 -2
  247. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  248. package/build-module/form-token-field/types.js.map +1 -1
  249. package/build-module/index.js +2 -1
  250. package/build-module/index.js.map +1 -1
  251. package/build-module/input-control/index.js +2 -2
  252. package/build-module/input-control/index.js.map +1 -1
  253. package/build-module/input-control/input-base.js +6 -11
  254. package/build-module/input-control/input-base.js.map +1 -1
  255. package/build-module/input-control/input-prefix-wrapper.js +4 -3
  256. package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
  257. package/build-module/input-control/input-suffix-wrapper.js +3 -3
  258. package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
  259. package/build-module/input-control/reducer/reducer.js +8 -8
  260. package/build-module/input-control/reducer/reducer.js.map +1 -1
  261. package/build-module/input-control/styles/input-control-styles.js +74 -44
  262. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  263. package/build-module/input-control/types.js.map +1 -1
  264. package/build-module/input-control/utils.js +3 -3
  265. package/build-module/input-control/utils.js.map +1 -1
  266. package/build-module/item-group/styles.js +10 -10
  267. package/build-module/item-group/styles.js.map +1 -1
  268. package/build-module/modal/index.js +5 -5
  269. package/build-module/modal/index.js.map +1 -1
  270. package/build-module/navigation/index.js +4 -4
  271. package/build-module/navigation/index.js.map +1 -1
  272. package/build-module/navigation/styles/navigation-styles.js +14 -14
  273. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  274. package/build-module/navigator/index.js +6 -6
  275. package/build-module/navigator/index.js.map +1 -1
  276. package/build-module/navigator/navigator-back-button/hook.js +1 -1
  277. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  278. package/build-module/navigator/navigator-button/hook.js +1 -1
  279. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  280. package/build-module/navigator/navigator-provider/component.js +99 -67
  281. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  282. package/build-module/navigator/navigator-to-parent-button/component.js +1 -1
  283. package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
  284. package/build-module/navigator/types.js.map +1 -1
  285. package/build-module/navigator/use-navigator.js +1 -2
  286. package/build-module/navigator/use-navigator.js.map +1 -1
  287. package/build-module/palette-edit/index.js +2 -2
  288. package/build-module/palette-edit/index.js.map +1 -1
  289. package/build-module/private-apis.js +5 -9
  290. package/build-module/private-apis.js.map +1 -1
  291. package/build-module/range-control/styles/range-control-styles.js +31 -31
  292. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  293. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
  294. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  295. package/build-module/select-control/styles/select-control-styles.js +13 -13
  296. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  297. package/build-module/slot-fill/bubbles-virtually/fill.js +4 -4
  298. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  299. package/build-module/snackbar/index.js +4 -4
  300. package/build-module/snackbar/index.js.map +1 -1
  301. package/build-module/tabs/index.js +4 -4
  302. package/build-module/tabs/index.js.map +1 -1
  303. package/build-module/tabs/styles.js +4 -4
  304. package/build-module/tabs/styles.js.map +1 -1
  305. package/build-module/toggle-group-control/toggle-group-control/utils.js +6 -6
  306. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  307. package/build-module/tools-panel/tools-panel/hook.js +6 -6
  308. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  309. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  310. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  311. package/build-module/utils/config-values.js +6 -4
  312. package/build-module/utils/config-values.js.map +1 -1
  313. package/build-module/utils/hooks/use-update-effect.js +4 -4
  314. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  315. package/build-style/style-rtl.css +11 -23
  316. package/build-style/style.css +11 -23
  317. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  318. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  319. package/build-types/alignment-matrix-control/icon.d.ts +1 -1
  320. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  321. package/build-types/alignment-matrix-control/index.d.ts +16 -6
  322. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  323. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  324. package/build-types/alignment-matrix-control/{styles/alignment-matrix-control-styles.d.ts → styles.d.ts} +9 -10
  325. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -0
  326. package/build-types/alignment-matrix-control/types.d.ts +12 -1
  327. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  328. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  329. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  330. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  331. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  332. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  333. package/build-types/circular-option-picker/types.d.ts +2 -2
  334. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  335. package/build-types/color-palette/utils.d.ts.map +1 -1
  336. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  337. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  338. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  339. package/build-types/color-picker/styles.d.ts.map +1 -1
  340. package/build-types/combobox-control/types.d.ts +1 -0
  341. package/build-types/combobox-control/types.d.ts.map +1 -1
  342. package/build-types/composite/group-label.d.ts +3 -0
  343. package/build-types/composite/group-label.d.ts.map +1 -0
  344. package/build-types/composite/group.d.ts +3 -0
  345. package/build-types/composite/group.d.ts.map +1 -0
  346. package/build-types/composite/hover.d.ts +3 -0
  347. package/build-types/composite/hover.d.ts.map +1 -0
  348. package/build-types/composite/index.d.ts +30 -26
  349. package/build-types/composite/index.d.ts.map +1 -1
  350. package/build-types/composite/item.d.ts +3 -0
  351. package/build-types/composite/item.d.ts.map +1 -0
  352. package/build-types/composite/legacy/index.d.ts +1 -4
  353. package/build-types/composite/legacy/index.d.ts.map +1 -1
  354. package/build-types/composite/row.d.ts +3 -0
  355. package/build-types/composite/row.d.ts.map +1 -0
  356. package/build-types/composite/store.d.ts +25 -0
  357. package/build-types/composite/store.d.ts.map +1 -0
  358. package/build-types/composite/stories/index.story.d.ts +1 -0
  359. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  360. package/build-types/composite/typeahead.d.ts +3 -0
  361. package/build-types/composite/typeahead.d.ts.map +1 -0
  362. package/build-types/composite/types.d.ts +2 -2
  363. package/build-types/composite/types.d.ts.map +1 -1
  364. package/build-types/date-time/time/time-input/index.d.ts.map +1 -1
  365. package/build-types/dimension-control/index.d.ts +1 -1
  366. package/build-types/dimension-control/index.d.ts.map +1 -1
  367. package/build-types/dimension-control/stories/index.story.d.ts +5 -0
  368. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  369. package/build-types/dropdown-menu-v2/checkbox-item.d.ts +3 -0
  370. package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +1 -0
  371. package/build-types/dropdown-menu-v2/context.d.ts +6 -0
  372. package/build-types/dropdown-menu-v2/context.d.ts.map +1 -0
  373. package/build-types/dropdown-menu-v2/group-label.d.ts +3 -0
  374. package/build-types/dropdown-menu-v2/group-label.d.ts.map +1 -0
  375. package/build-types/dropdown-menu-v2/group.d.ts +3 -0
  376. package/build-types/dropdown-menu-v2/group.d.ts.map +1 -0
  377. package/build-types/dropdown-menu-v2/index.d.ts +39 -18
  378. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  379. package/build-types/dropdown-menu-v2/item-help-text.d.ts +6 -0
  380. package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +1 -0
  381. package/build-types/dropdown-menu-v2/item-label.d.ts +6 -0
  382. package/build-types/dropdown-menu-v2/item-label.d.ts.map +1 -0
  383. package/build-types/dropdown-menu-v2/item.d.ts +3 -0
  384. package/build-types/dropdown-menu-v2/item.d.ts.map +1 -0
  385. package/build-types/dropdown-menu-v2/radio-item.d.ts +3 -0
  386. package/build-types/dropdown-menu-v2/radio-item.d.ts.map +1 -0
  387. package/build-types/dropdown-menu-v2/separator.d.ts +3 -0
  388. package/build-types/dropdown-menu-v2/separator.d.ts.map +1 -0
  389. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +10 -10
  390. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  391. package/build-types/dropdown-menu-v2/styles.d.ts +14 -6
  392. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  393. package/build-types/dropdown-menu-v2/types.d.ts +6 -0
  394. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  395. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts +8 -0
  396. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +1 -0
  397. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
  398. package/build-types/form-token-field/types.d.ts +1 -0
  399. package/build-types/form-token-field/types.d.ts.map +1 -1
  400. package/build-types/index.d.ts +3 -1
  401. package/build-types/index.d.ts.map +1 -1
  402. package/build-types/input-control/input-base.d.ts.map +1 -1
  403. package/build-types/input-control/input-prefix-wrapper.d.ts +2 -2
  404. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
  405. package/build-types/input-control/input-suffix-wrapper.d.ts +2 -2
  406. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
  407. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  408. package/build-types/input-control/stories/index.story.d.ts +9 -0
  409. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  410. package/build-types/input-control/styles/input-control-styles.d.ts +15 -9
  411. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  412. package/build-types/input-control/types.d.ts +23 -6
  413. package/build-types/input-control/types.d.ts.map +1 -1
  414. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  415. package/build-types/navigator/index.d.ts +6 -6
  416. package/build-types/navigator/index.d.ts.map +1 -1
  417. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  418. package/build-types/navigator/stories/index.story.d.ts +1 -1
  419. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  420. package/build-types/navigator/types.d.ts +3 -1
  421. package/build-types/navigator/types.d.ts.map +1 -1
  422. package/build-types/navigator/use-navigator.d.ts +1 -2
  423. package/build-types/navigator/use-navigator.d.ts.map +1 -1
  424. package/build-types/private-apis.d.ts.map +1 -1
  425. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  426. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  427. package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
  428. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  429. package/build-types/tabs/index.d.ts.map +1 -1
  430. package/build-types/tabs/styles.d.ts.map +1 -1
  431. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  432. package/build-types/utils/config-values.d.ts +3 -3
  433. package/package.json +19 -19
  434. package/src/alignment-matrix-control/README.md +1 -5
  435. package/src/alignment-matrix-control/cell.tsx +3 -9
  436. package/src/alignment-matrix-control/icon.tsx +48 -30
  437. package/src/alignment-matrix-control/index.tsx +60 -50
  438. package/src/alignment-matrix-control/stories/index.story.tsx +3 -12
  439. package/src/alignment-matrix-control/styles.ts +113 -0
  440. package/src/alignment-matrix-control/types.ts +12 -1
  441. package/src/angle-picker-control/angle-circle.tsx +11 -9
  442. package/src/border-control/border-control/component.tsx +23 -16
  443. package/src/circular-option-picker/circular-option-picker-option.tsx +16 -19
  444. package/src/circular-option-picker/circular-option-picker.tsx +26 -12
  445. package/src/circular-option-picker/types.ts +2 -2
  446. package/src/clipboard-button/index.tsx +6 -6
  447. package/src/color-palette/test/utils.ts +21 -2
  448. package/src/color-palette/utils.ts +1 -3
  449. package/src/color-picker/color-copy-button.tsx +10 -8
  450. package/src/color-picker/hex-input.tsx +6 -10
  451. package/src/color-picker/input-with-slider.tsx +6 -10
  452. package/src/color-picker/styles.ts +1 -1
  453. package/src/combobox-control/types.ts +1 -0
  454. package/src/composite/group-label.tsx +30 -0
  455. package/src/composite/group.tsx +30 -0
  456. package/src/composite/hover.tsx +30 -0
  457. package/src/composite/index.tsx +61 -145
  458. package/src/composite/item.tsx +30 -0
  459. package/src/composite/legacy/index.tsx +2 -1
  460. package/src/composite/row.tsx +30 -0
  461. package/src/composite/store.ts +46 -0
  462. package/src/composite/stories/index.story.tsx +138 -265
  463. package/src/composite/typeahead.tsx +30 -0
  464. package/src/composite/types.ts +2 -2
  465. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +10 -10
  466. package/src/custom-gradient-picker/style.scss +2 -21
  467. package/src/custom-select-control-v2/styles.ts +4 -4
  468. package/src/date-time/date/styles.ts +2 -2
  469. package/src/date-time/time/test/index.tsx +3 -6
  470. package/src/date-time/time/time-input/index.tsx +25 -25
  471. package/src/date-time/time/time-input/test/index.tsx +6 -7
  472. package/src/dimension-control/README.md +4 -0
  473. package/src/dimension-control/index.tsx +7 -1
  474. package/src/dimension-control/stories/index.story.tsx +7 -2
  475. package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -16
  476. package/src/dimension-control/test/index.test.js +1 -0
  477. package/src/draggable/index.tsx +4 -4
  478. package/src/dropdown-menu-v2/README.md +73 -60
  479. package/src/dropdown-menu-v2/checkbox-item.tsx +63 -0
  480. package/src/dropdown-menu-v2/context.tsx +13 -0
  481. package/src/dropdown-menu-v2/group-label.tsx +37 -0
  482. package/src/dropdown-menu-v2/group.tsx +26 -0
  483. package/src/dropdown-menu-v2/index.tsx +57 -197
  484. package/src/dropdown-menu-v2/item-help-text.tsx +23 -0
  485. package/src/dropdown-menu-v2/item-label.tsx +23 -0
  486. package/src/dropdown-menu-v2/item.tsx +50 -0
  487. package/src/dropdown-menu-v2/radio-item.tsx +70 -0
  488. package/src/dropdown-menu-v2/separator.tsx +27 -0
  489. package/src/dropdown-menu-v2/stories/index.story.tsx +295 -262
  490. package/src/dropdown-menu-v2/styles.ts +102 -66
  491. package/src/dropdown-menu-v2/test/index.tsx +159 -132
  492. package/src/dropdown-menu-v2/types.ts +7 -0
  493. package/src/dropdown-menu-v2/use-temporary-focus-visible-fix.ts +22 -0
  494. package/src/focal-point-picker/styles/focal-point-style.ts +6 -1
  495. package/src/form-toggle/style.scss +1 -1
  496. package/src/form-token-field/style.scss +2 -3
  497. package/src/form-token-field/types.ts +1 -0
  498. package/src/index.ts +5 -1
  499. package/src/input-control/index.tsx +2 -2
  500. package/src/input-control/input-base.tsx +4 -14
  501. package/src/input-control/input-prefix-wrapper.tsx +8 -4
  502. package/src/input-control/input-suffix-wrapper.tsx +4 -6
  503. package/src/input-control/reducer/reducer.ts +13 -10
  504. package/src/input-control/stories/index.story.tsx +31 -12
  505. package/src/input-control/styles/input-control-styles.tsx +42 -11
  506. package/src/input-control/types.ts +23 -7
  507. package/src/input-control/utils.ts +3 -3
  508. package/src/item-group/styles.ts +3 -3
  509. package/src/item-group/test/__snapshots__/index.js.snap +3 -3
  510. package/src/modal/index.tsx +5 -5
  511. package/src/modal/style.scss +5 -4
  512. package/src/navigation/index.tsx +4 -4
  513. package/src/navigation/styles/navigation-styles.tsx +3 -3
  514. package/src/navigator/index.ts +6 -6
  515. package/src/navigator/navigator-back-button/hook.ts +1 -1
  516. package/src/navigator/navigator-button/hook.ts +1 -1
  517. package/src/navigator/navigator-provider/README.md +2 -3
  518. package/src/navigator/navigator-provider/component.tsx +97 -82
  519. package/src/navigator/navigator-to-parent-button/component.tsx +1 -1
  520. package/src/navigator/stories/index.story.tsx +82 -253
  521. package/src/navigator/types.ts +3 -1
  522. package/src/navigator/use-navigator.ts +1 -3
  523. package/src/palette-edit/index.tsx +2 -2
  524. package/src/private-apis.ts +5 -18
  525. package/src/range-control/styles/range-control-styles.ts +7 -7
  526. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -2
  527. package/src/resizable-box/style.scss +2 -2
  528. package/src/select-control/styles/select-control-styles.ts +5 -5
  529. package/src/slot-fill/bubbles-virtually/fill.tsx +4 -4
  530. package/src/snackbar/index.tsx +4 -4
  531. package/src/tab-panel/style.scss +0 -1
  532. package/src/tabs/index.tsx +8 -4
  533. package/src/tabs/styles.ts +2 -3
  534. package/src/text-control/style.scss +3 -2
  535. package/src/toggle-group-control/toggle-group-control/utils.ts +7 -7
  536. package/src/tools-panel/tools-panel/hook.ts +6 -6
  537. package/src/unit-control/styles/unit-control-styles.ts +2 -1
  538. package/src/utils/config-values.js +6 -4
  539. package/src/utils/hooks/use-update-effect.js +4 -4
  540. package/tsconfig.tsbuildinfo +1 -1
  541. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -66
  542. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  543. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -77
  544. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  545. package/build/navigator/navigator-back-button/index.js +0 -14
  546. package/build/navigator/navigator-back-button/index.js.map +0 -1
  547. package/build/navigator/navigator-button/index.js +0 -14
  548. package/build/navigator/navigator-button/index.js.map +0 -1
  549. package/build/navigator/navigator-provider/index.js +0 -14
  550. package/build/navigator/navigator-provider/index.js.map +0 -1
  551. package/build/navigator/navigator-screen/index.js +0 -14
  552. package/build/navigator/navigator-screen/index.js.map +0 -1
  553. package/build/navigator/navigator-to-parent-button/index.js +0 -14
  554. package/build/navigator/navigator-to-parent-button/index.js.map +0 -1
  555. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -63
  556. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  557. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -72
  558. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  559. package/build-module/navigator/navigator-back-button/index.js +0 -2
  560. package/build-module/navigator/navigator-back-button/index.js.map +0 -1
  561. package/build-module/navigator/navigator-button/index.js +0 -2
  562. package/build-module/navigator/navigator-button/index.js.map +0 -1
  563. package/build-module/navigator/navigator-provider/index.js +0 -2
  564. package/build-module/navigator/navigator-provider/index.js.map +0 -1
  565. package/build-module/navigator/navigator-screen/index.js +0 -2
  566. package/build-module/navigator/navigator-screen/index.js.map +0 -1
  567. package/build-module/navigator/navigator-to-parent-button/index.js +0 -2
  568. package/build-module/navigator/navigator-to-parent-button/index.js.map +0 -1
  569. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +0 -18
  570. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +0 -1
  571. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +0 -1
  572. package/build-types/navigator/navigator-back-button/index.d.ts +0 -2
  573. package/build-types/navigator/navigator-back-button/index.d.ts.map +0 -1
  574. package/build-types/navigator/navigator-button/index.d.ts +0 -2
  575. package/build-types/navigator/navigator-button/index.d.ts.map +0 -1
  576. package/build-types/navigator/navigator-provider/index.d.ts +0 -2
  577. package/build-types/navigator/navigator-provider/index.d.ts.map +0 -1
  578. package/build-types/navigator/navigator-screen/index.d.ts +0 -2
  579. package/build-types/navigator/navigator-screen/index.d.ts.map +0 -1
  580. package/build-types/navigator/navigator-to-parent-button/index.d.ts +0 -2
  581. package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +0 -1
  582. package/src/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.ts +0 -77
  583. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +0 -102
  584. package/src/navigator/navigator-back-button/index.ts +0 -1
  585. package/src/navigator/navigator-button/index.ts +0 -1
  586. package/src/navigator/navigator-provider/index.ts +0 -1
  587. package/src/navigator/navigator-screen/index.ts +0 -1
  588. package/src/navigator/navigator-to-parent-button/index.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","useMemo","forwardRef","CompositeContext","useCompositeContext","jsx","_jsx","useCompositeStore","focusLoop","focusWrap","focusShift","virtualFocus","orientation","rtl","props","Group","CompositeGroup","ref","context","store","displayName","GroupLabel","CompositeGroupLabel","Item","CompositeItem","Row","CompositeRow","Hover","CompositeHover","Typeahead","CompositeTypeahead","Composite","Object","assign","children","disabled","contextValue","Provider","value","Context"],"sources":["@wordpress/components/src/composite/index.tsx"],"sourcesContent":["/**\n * Composite is a component that may contain navigable items represented by\n * Composite.Item. It's inspired by the WAI-ARIA Composite Role and implements\n * all the keyboard navigation mechanisms to ensure that there's only one\n * tab stop for the whole Composite element. This means that it can behave as\n * a roving tabindex or aria-activedescendant container.\n *\n * @see https://ariakit.org/components/composite\n */\n\n/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { CompositeContext, useCompositeContext } from './context';\nimport type {\n\tCompositeStoreProps,\n\tCompositeProps,\n\tCompositeGroupProps,\n\tCompositeGroupLabelProps,\n\tCompositeItemProps,\n\tCompositeRowProps,\n\tCompositeHoverProps,\n\tCompositeTypeaheadProps,\n} from './types';\n\n/**\n * Creates a composite store.\n *\n * @example\n * ```jsx\n * import { Composite, useCompositeStore } from '@wordpress/components';\n *\n * const store = useCompositeStore();\n * <Composite store={store}>\n * <Composite.Item>Item</Composite.Item>\n * <Composite.Item>Item</Composite.Item>\n * <Composite.Item>Item</Composite.Item>\n * </Composite>\n * ```\n */\nexport function useCompositeStore( {\n\tfocusLoop = false,\n\tfocusWrap = false,\n\tfocusShift = false,\n\tvirtualFocus = false,\n\torientation = 'both',\n\trtl = false,\n\t...props\n}: CompositeStoreProps = {} ) {\n\treturn Ariakit.useCompositeStore( {\n\t\tfocusLoop,\n\t\tfocusWrap,\n\t\tfocusShift,\n\t\tvirtualFocus,\n\t\torientation,\n\t\trtl,\n\t\t...props,\n\t} );\n}\n\nconst Group = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeGroupProps, 'div', false >\n>( function CompositeGroup( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeGroup\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nGroup.displayName = 'Composite.Group';\n\nconst GroupLabel = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeGroupLabelProps, 'div', false >\n>( function CompositeGroupLabel( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeGroupLabel\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nGroupLabel.displayName = 'Composite.GroupLabel';\n\nconst Item = forwardRef<\n\tHTMLButtonElement,\n\tWordPressComponentProps< CompositeItemProps, 'button', false >\n>( function CompositeItem( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeItem\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nItem.displayName = 'Composite.Item';\n\nconst Row = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeRowProps, 'div', false >\n>( function CompositeRow( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeRow\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nRow.displayName = 'Composite.Row';\n\nconst Hover = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeHoverProps, 'div', false >\n>( function CompositeHover( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeHover\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nHover.displayName = 'Composite.Hover';\n\nconst Typeahead = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeTypeaheadProps, 'div', false >\n>( function CompositeTypeahead( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeTypeahead\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\nTypeahead.displayName = 'Composite.Typeahead';\n\n/**\n * Renders a widget based on the WAI-ARIA [`composite`](https://w3c.github.io/aria/#composite)\n * role, which provides a single tab stop on the page and arrow key navigation\n * through the focusable descendants.\n *\n * @example\n * ```jsx\n * import { Composite, useCompositeStore } from '@wordpress/components';\n *\n * const store = useCompositeStore();\n * <Composite store={store}>\n * <Composite.Item>Item 1</Composite.Item>\n * <Composite.Item>Item 2</Composite.Item>\n * </Composite>\n * ```\n */\nexport const Composite = Object.assign(\n\tforwardRef<\n\t\tHTMLDivElement,\n\t\tWordPressComponentProps< CompositeProps, 'div', false >\n\t>( function Composite(\n\t\t{ children, store, disabled = false, ...props },\n\t\tref\n\t) {\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tstore,\n\t\t\t} ),\n\t\t\t[ store ]\n\t\t);\n\n\t\treturn (\n\t\t\t<Ariakit.Composite\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tstore={ store }\n\t\t\t\t{ ...props }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<CompositeContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</CompositeContext.Provider>\n\t\t\t</Ariakit.Composite>\n\t\t);\n\t} ),\n\t{\n\t\tdisplayName: 'Composite',\n\t\t/**\n\t\t * Renders a group element for composite items.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Group>\n\t\t * <Composite.GroupLabel>Label</Composite.GroupLabel>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </CompositeGroup>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tGroup,\n\t\t/**\n\t\t * Renders a label in a composite group. This component must be wrapped with\n\t\t * `Composite.Group` so the `aria-labelledby` prop is properly set on the\n\t\t * composite group element.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Group>\n\t\t * <Composite.GroupLabel>Label</Composite.GroupLabel>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </CompositeGroup>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tGroupLabel,\n\t\t/**\n\t\t * Renders a composite item.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * <Composite.Item>Item 3</Composite.Item>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tItem,\n\t\t/**\n\t\t * Renders a composite row. Wrapping `Composite.Item` elements within\n\t\t * `Composite.Row` will create a two-dimensional composite widget, such as a\n\t\t * grid.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Row>\n\t\t * <Composite.Item>Item 1.1</Composite.Item>\n\t\t * <Composite.Item>Item 1.2</Composite.Item>\n\t\t * <Composite.Item>Item 1.3</Composite.Item>\n\t\t * </Composite.Row>\n\t\t * <Composite.Row>\n\t\t * <Composite.Item>Item 2.1</Composite.Item>\n\t\t * <Composite.Item>Item 2.2</Composite.Item>\n\t\t * <Composite.Item>Item 2.3</Composite.Item>\n\t\t * </Composite.Row>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tRow,\n\t\t/**\n\t\t * Renders an element in a composite widget that receives focus on mouse move\n\t\t * and loses focus to the composite base element on mouse leave. This should\n\t\t * be combined with the `Composite.Item` component.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Hover render={ <Composite.Item /> }>\n\t\t * Item 1\n\t\t * </Composite.Hover>\n\t\t * <Composite.Hover render={ <Composite.Item /> }>\n\t\t * Item 2\n\t\t * </Composite.Hover>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tHover,\n\t\t/**\n\t\t * Renders a component that adds typeahead functionality to composite\n\t\t * components. Hitting printable character keys will move focus to the next\n\t\t * composite item that begins with the input characters.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store} render={ <CompositeTypeahead /> }>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tTypeahead,\n\t\t/**\n\t\t * The React context used by the composite components. It can be used by\n\t\t * to access the composite store, and to forward the context when composite\n\t\t * sub-components are rendered across portals (ie. `SlotFill` components)\n\t\t * that would not otherwise forward the context to the `Fill` children.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite } from '@wordpress/components';\n\t\t * import { useContext } from '@wordpress/element';\n\t\t *\n\t\t * const compositeContext = useContext( Composite.Context );\n\t\t * ```\n\t\t */\n\t\tContext: CompositeContext,\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,OAAO,EAAEC,UAAU,QAAQ,oBAAoB;;AAExD;AACA;AACA;;AAEA,SAASC,gBAAgB,EAAEC,mBAAmB,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAYlE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAE;EAClCC,SAAS,GAAG,KAAK;EACjBC,SAAS,GAAG,KAAK;EACjBC,UAAU,GAAG,KAAK;EAClBC,YAAY,GAAG,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AK;EAAEgB,QAAQ,GAAG,KAAK;EAAE,GAAGrB;AAAM,CAAC,EAC/CG,GAAG,EACF;EACD,MAAMmB,YAAY,GAAGnC,OAAO,CAC3B,OAAQ;IACPkB;EACD,CAAC,CAAE,EACH,CAAEA,KAAK,CACR,CAAC;EAED,oBACCb,IAAA,CAACN,OAAO,CAAC+B,SAAS;IACjBI,QAAQ,EAAGA,QAAU;IACrBhB,KAAK,EAAGA,KAAO;IAAA,GACVL,KAAK;IACVG,GAAG,EAAGA,GAAK;IAAAiB,QAAA,eAEX5B,IAAA,CAACH,gBAAgB,CAACkC,QAAQ;MAACC,KAAK,EAAGF,YAAc;MAAAF,QAAA,EAC9CA;IAAQ,CACgB;EAAC,CACV,CAAC;AAEtB,CAAE,CAAC,EACH;EACCd,WAAW,EAAE,WAAW;EACxB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEL,KAAK;EACL;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,UAAU;EACV;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,IAAI;EACJ;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,GAAG;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,KAAK;EACL;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,SAAS;EACT;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEU,OAAO,EAAEpC;AACV,CACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","useMemo","forwardRef","CompositeContext","CompositeGroup","CompositeGroupLabel","CompositeHover","CompositeItem","CompositeRow","CompositeTypeahead","jsx","_jsx","Composite","Object","assign","activeId","defaultActiveId","setActiveId","focusLoop","focusWrap","focusShift","virtualFocus","orientation","rtl","children","disabled","store","storeProp","props","ref","newStore","useCompositeStore","contextValue","Provider","value","Group","displayName","GroupLabel","Item","Row","Hover","Typeahead","Context"],"sources":["@wordpress/components/src/composite/index.tsx"],"sourcesContent":["/**\n * Composite is a component that may contain navigable items represented by\n * Composite.Item. It's inspired by the WAI-ARIA Composite Role and implements\n * all the keyboard navigation mechanisms to ensure that there's only one\n * tab stop for the whole Composite element. This means that it can behave as\n * a roving tabindex or aria-activedescendant container.\n *\n * @see https://ariakit.org/components/composite\n */\n\n/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { CompositeContext } from './context';\nimport { CompositeGroup } from './group';\nimport { CompositeGroupLabel } from './group-label';\nimport { CompositeHover } from './hover';\nimport { CompositeItem } from './item';\nimport { CompositeRow } from './row';\nimport { CompositeTypeahead } from './typeahead';\nimport type { CompositeProps } from './types';\n\n/**\n * Renders a widget based on the WAI-ARIA [`composite`](https://w3c.github.io/aria/#composite)\n * role, which provides a single tab stop on the page and arrow key navigation\n * through the focusable descendants.\n *\n * @example\n * ```jsx\n * import { Composite, useCompositeStore } from '@wordpress/components';\n *\n * const store = useCompositeStore();\n * <Composite store={store}>\n * <Composite.Item>Item 1</Composite.Item>\n * <Composite.Item>Item 2</Composite.Item>\n * </Composite>\n * ```\n */\nexport const Composite = Object.assign(\n\tforwardRef<\n\t\tHTMLDivElement,\n\t\tWordPressComponentProps< CompositeProps, 'div', false >\n\t>( function Composite(\n\t\t{\n\t\t\t// Composite store props\n\t\t\tactiveId,\n\t\t\tdefaultActiveId,\n\t\t\tsetActiveId,\n\t\t\tfocusLoop = false,\n\t\t\tfocusWrap = false,\n\t\t\tfocusShift = false,\n\t\t\tvirtualFocus = false,\n\t\t\torientation = 'both',\n\t\t\trtl = false,\n\n\t\t\t// Composite component props\n\t\t\tchildren,\n\t\t\tdisabled = false,\n\n\t\t\t// To be removed\n\t\t\tstore: storeProp,\n\n\t\t\t// Rest props\n\t\t\t...props\n\t\t},\n\t\tref\n\t) {\n\t\tconst newStore = Ariakit.useCompositeStore( {\n\t\t\tactiveId,\n\t\t\tdefaultActiveId,\n\t\t\tsetActiveId,\n\t\t\tfocusLoop,\n\t\t\tfocusWrap,\n\t\t\tfocusShift,\n\t\t\tvirtualFocus,\n\t\t\torientation,\n\t\t\trtl,\n\t\t} );\n\n\t\tconst store = storeProp || newStore;\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tstore,\n\t\t\t} ),\n\t\t\t[ store ]\n\t\t);\n\n\t\treturn (\n\t\t\t<Ariakit.Composite\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tstore={ store }\n\t\t\t\t{ ...props }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<CompositeContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</CompositeContext.Provider>\n\t\t\t</Ariakit.Composite>\n\t\t);\n\t} ),\n\t{\n\t\t/**\n\t\t * Renders a group element for composite items.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Group>\n\t\t * <Composite.GroupLabel>Label</Composite.GroupLabel>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </CompositeGroup>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tGroup: Object.assign( CompositeGroup, {\n\t\t\tdisplayName: 'Composite.Group',\n\t\t} ),\n\t\t/**\n\t\t * Renders a label in a composite group. This component must be wrapped with\n\t\t * `Composite.Group` so the `aria-labelledby` prop is properly set on the\n\t\t * composite group element.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Group>\n\t\t * <Composite.GroupLabel>Label</Composite.GroupLabel>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </CompositeGroup>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tGroupLabel: Object.assign( CompositeGroupLabel, {\n\t\t\tdisplayName: 'Composite.GroupLabel',\n\t\t} ),\n\t\t/**\n\t\t * Renders a composite item.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * <Composite.Item>Item 3</Composite.Item>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tItem: Object.assign( CompositeItem, { displayName: 'Composite.Item' } ),\n\t\t/**\n\t\t * Renders a composite row. Wrapping `Composite.Item` elements within\n\t\t * `Composite.Row` will create a two-dimensional composite widget, such as a\n\t\t * grid.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Row>\n\t\t * <Composite.Item>Item 1.1</Composite.Item>\n\t\t * <Composite.Item>Item 1.2</Composite.Item>\n\t\t * <Composite.Item>Item 1.3</Composite.Item>\n\t\t * </Composite.Row>\n\t\t * <Composite.Row>\n\t\t * <Composite.Item>Item 2.1</Composite.Item>\n\t\t * <Composite.Item>Item 2.2</Composite.Item>\n\t\t * <Composite.Item>Item 2.3</Composite.Item>\n\t\t * </Composite.Row>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tRow: Object.assign( CompositeRow, { displayName: 'Composite.Row' } ),\n\t\t/**\n\t\t * Renders an element in a composite widget that receives focus on mouse move\n\t\t * and loses focus to the composite base element on mouse leave. This should\n\t\t * be combined with the `Composite.Item` component.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store}>\n\t\t * <Composite.Hover render={ <Composite.Item /> }>\n\t\t * Item 1\n\t\t * </Composite.Hover>\n\t\t * <Composite.Hover render={ <Composite.Item /> }>\n\t\t * Item 2\n\t\t * </Composite.Hover>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tHover: Object.assign( CompositeHover, {\n\t\t\tdisplayName: 'Composite.Hover',\n\t\t} ),\n\t\t/**\n\t\t * Renders a component that adds typeahead functionality to composite\n\t\t * components. Hitting printable character keys will move focus to the next\n\t\t * composite item that begins with the input characters.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite, useCompositeStore } from '@wordpress/components';\n\t\t *\n\t\t * const store = useCompositeStore();\n\t\t * <Composite store={store} render={ <CompositeTypeahead /> }>\n\t\t * <Composite.Item>Item 1</Composite.Item>\n\t\t * <Composite.Item>Item 2</Composite.Item>\n\t\t * </Composite>\n\t\t * ```\n\t\t */\n\t\tTypeahead: Object.assign( CompositeTypeahead, {\n\t\t\tdisplayName: 'Composite.Typeahead',\n\t\t} ),\n\t\t/**\n\t\t * The React context used by the composite components. It can be used by\n\t\t * to access the composite store, and to forward the context when composite\n\t\t * sub-components are rendered across portals (ie. `SlotFill` components)\n\t\t * that would not otherwise forward the context to the `Fill` children.\n\t\t *\n\t\t * @example\n\t\t * ```jsx\n\t\t * import { Composite } from '@wordpress/components';\n\t\t * import { useContext } from '@wordpress/element';\n\t\t *\n\t\t * const compositeContext = useContext( Composite.Context );\n\t\t * ```\n\t\t */\n\t\tContext: Object.assign( CompositeContext, {\n\t\t\tdisplayName: 'Composite.Context',\n\t\t} ),\n\t}\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,OAAO,EAAEC,UAAU,QAAQ,oBAAoB;;AAExD;AACA;AACA;;AAEA,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,aAAa,QAAQ,QAAQ;AACtC,SAASC,YAAY,QAAQ,OAAO;AACpC,SAASC,kBAAkB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GAAGC,MAAM,CAACC,MAAM,CACrCZ,UAAU,CAGP,SAASU,SAASA,CACpB;EACC;EACAG,QAAQ;EACRC,eAAe;EACfC,WAAW;EACXC,SAAS,GAAG,KAAK;EACjBC,SAAS,GAAG,KAAK;EACjBC,UAAU,GAAG,KAAK;EAClBC,YAAY,GAAG,KAAK;EACpBC,WAAW,GAAG,MAAM;EACpBC,GAAG,GAAG,KAAK;EAEX;EACAC,QAAQ;EACRC,QAAQ,GAAG,KAAK;EAEhB;EACAC,KAAK,EAAEC,SAAS;EAEhB;EACA,GAAGC;AACJ,CAAC,EACDC,GAAG,EACF;EACD,MAAMC,QAAQ,GAAG9B,OAAO,CAAC+B,iBAAiB,CAAE;IAC3ChB,QAAQ;IACRC,eAAe;IACfC,WAAW;IACXC,SAAS;IACTC,SAAS;IACTC,UAAU;IACVC,YAAY;IACZC,WAAW;IACXC;EACD,CAAE,CAAC;EAEH,MAAMG,KAAK,GAAGC,SAAS,IAAIG,QAAQ;EAEnC,MAAME,YAAY,GAAG/B,OAAO,CAC3B,OAAQ;IACPyB;EACD,CAAC,CAAE,EACH,CAAEA,KAAK,CACR,CAAC;EAED,oBACCf,IAAA,CAACX,OAAO,CAACY,SAAS;IACjBa,QAAQ,EAAGA,QAAU;IACrBC,KAAK,EAAGA,KAAO;IAAA,GACVE,KAAK;IACVC,GAAG,EAAGA,GAAK;IAAAL,QAAA,eAEXb,IAAA,CAACR,gBAAgB,CAAC8B,QAAQ;MAACC,KAAK,EAAGF,YAAc;MAAAR,QAAA,EAC9CA;IAAQ,CACgB;EAAC,CACV,CAAC;AAEtB,CAAE,CAAC,EACH;EACC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEW,KAAK,EAAEtB,MAAM,CAACC,MAAM,CAAEV,cAAc,EAAE;IACrCgC,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,UAAU,EAAExB,MAAM,CAACC,MAAM,CAAET,mBAAmB,EAAE;IAC/C+B,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,IAAI,EAAEzB,MAAM,CAACC,MAAM,CAAEP,aAAa,EAAE;IAAE6B,WAAW,EAAE;EAAiB,CAAE,CAAC;EACvE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEG,GAAG,EAAE1B,MAAM,CAACC,MAAM,CAAEN,YAAY,EAAE;IAAE4B,WAAW,EAAE;EAAgB,CAAE,CAAC;EACpE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEI,KAAK,EAAE3B,MAAM,CAACC,MAAM,CAAER,cAAc,EAAE;IACrC8B,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,SAAS,EAAE5B,MAAM,CAACC,MAAM,CAAEL,kBAAkB,EAAE;IAC7C2B,WAAW,EAAE;EACd,CAAE,CAAC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,OAAO,EAAE7B,MAAM,CAACC,MAAM,CAAEX,gBAAgB,EAAE;IACzCiC,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import * as Ariakit from '@ariakit/react';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { forwardRef } from '@wordpress/element';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+
15
+ import { useCompositeContext } from './context';
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ export const CompositeItem = forwardRef(function CompositeItem(props, ref) {
18
+ const context = useCompositeContext();
19
+ return /*#__PURE__*/_jsx(Ariakit.CompositeItem, {
20
+ store: context?.store,
21
+ ...props,
22
+ ref: ref
23
+ });
24
+ });
25
+ //# sourceMappingURL=item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Ariakit","forwardRef","useCompositeContext","jsx","_jsx","CompositeItem","props","ref","context","store"],"sources":["@wordpress/components/src/composite/item.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeItemProps } from './types';\n\nexport const CompositeItem = forwardRef<\n\tHTMLButtonElement,\n\tWordPressComponentProps< CompositeItemProps, 'button', false >\n>( function CompositeItem( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeItem\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAEA,SAASC,mBAAmB,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGhD,OAAO,MAAMC,aAAa,GAAGJ,UAAU,CAGpC,SAASI,aAAaA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACvC,MAAMC,OAAO,GAAGN,mBAAmB,CAAC,CAAC;EACrC,oBACCE,IAAA,CAACJ,OAAO,CAACK,aAAa;IACrBI,KAAK,EAAGD,OAAO,EAAEC,KAAO;IAAA,GACnBH,KAAK;IACVC,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
@@ -21,7 +21,8 @@ import { forwardRef } from '@wordpress/element';
21
21
  /**
22
22
  * Internal dependencies
23
23
  */
24
- import { Composite as Current, useCompositeStore } from '..';
24
+ import { Composite as Current } from '..';
25
+ import { useCompositeStore } from '../store';
25
26
  import { useInstanceId } from '@wordpress/compose';
26
27
 
27
28
  // Legacy composite components can either provide state through a
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","Composite","Current","useCompositeStore","useInstanceId","jsx","_jsx","mapLegacyStatePropsToComponentProps","legacyProps","state","rest","store","props","proxyComposite","ProxiedComponent","propMap","displayName","Component","id","baseId","Object","entries","forEach","from","to","hasOwnProperty","assign","unproxiedCompositeGroup","role","ref","Row","Group","CompositeGroup","CompositeItem","Item","focusable","useCompositeState","legacyStateOptions","currentId","defaultActiveId","orientation","rtl","loop","focusLoop","wrap","focusWrap","shift","focusShift","unstable_virtual","virtualFocus"],"sources":["@wordpress/components/src/composite/legacy/index.tsx"],"sourcesContent":["/**\n * Composite is a component that may contain navigable items represented by\n * CompositeItem. It's inspired by the WAI-ARIA Composite Role and implements\n * all the keyboard navigation mechanisms to ensure that there's only one\n * tab stop for the whole Composite element. This means that it can behave as\n * a roving tabindex or aria-activedescendant container.\n *\n * This file aims at providing components that are as close as possible to the\n * original `reakit`-based implementation (which was removed from the codebase),\n * although it is recommended that consumers of the package switch to the stable,\n * un-prefixed, `ariakit`-based version of `Composite`.\n *\n * @see https://ariakit.org/components/composite\n */\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Composite as Current, useCompositeStore } from '..';\nimport { useInstanceId } from '@wordpress/compose';\n\ntype Orientation = 'horizontal' | 'vertical';\n\nexport interface LegacyStateOptions {\n\t/**\n\t * ID that will serve as a base for all the items IDs.\n\t */\n\tbaseId?: string;\n\t/**\n\t * Determines how next and previous functions will behave. If `rtl` is set\n\t * to `true`, they will be inverted. This only affects the composite widget\n\t * behavior. You still need to set `dir=\"rtl\"` on HTML/CSS.\n\t *\n\t * @default false\n\t */\n\trtl?: boolean;\n\t/**\n\t * Defines the orientation of the composite widget. If the composite has a\n\t * single row or column (one-dimensional), the orientation value determines\n\t * which arrow keys can be used to move focus.\n\t */\n\torientation?: Orientation;\n\t/**\n\t * The current focused item `id`.\n\t */\n\tcurrentId?: string;\n\t/**\n\t * Determines how focus moves from the start and end of rows and columns.\n\t *\n\t * @default false\n\t */\n\tloop?: boolean | Orientation;\n\t/**\n\t * If enabled, moving to the next item from the last one in a row or column\n\t * will focus the first item in the next row or column and vice-versa.\n\t *\n\t * ** Has effect only on two-dimensional composites. **\n\t *\n\t * @default false\n\t */\n\twrap?: boolean | Orientation;\n\t/**\n\t * If enabled, moving up or down when there's no next item or the next item\n\t * is disabled will shift to the item right before it.\n\t *\n\t * ** Has effect only on two-dimensional composites. **\n\t *\n\t * @default false\n\t */\n\tshift?: boolean;\n\tunstable_virtual?: boolean;\n}\n\ntype Component = React.FunctionComponent< any >;\n\ntype CompositeStore = ReturnType< typeof useCompositeStore >;\ntype CompositeStoreState = { store: CompositeStore };\nexport type CompositeState = CompositeStoreState &\n\tRequired< Pick< LegacyStateOptions, 'baseId' > >;\n\n// Legacy composite components can either provide state through a\n// single `state` prop, or via individual props, usually through\n// spreading the state generated by `useCompositeState`.\n// That is, `<Composite* { ...state }>`.\nexport type CompositeStateProps =\n\t| { state: CompositeState }\n\t| ( CompositeState & { state?: never } );\ntype ComponentProps< C extends Component > = React.ComponentPropsWithRef< C >;\nexport type CompositeProps< C extends Component > = ComponentProps< C > &\n\tCompositeStateProps;\ntype CompositeComponent< C extends Component > = (\n\tprops: CompositeProps< C >\n) => React.ReactElement;\ntype CompositeComponentProps = CompositeState &\n\t(\n\t\t| ComponentProps< typeof Current.Group >\n\t\t| ComponentProps< typeof Current.Item >\n\t\t| ComponentProps< typeof Current.Row >\n\t);\n\nfunction mapLegacyStatePropsToComponentProps(\n\tlegacyProps: CompositeStateProps\n): CompositeComponentProps {\n\t// If a `state` prop is provided, we unpack that; otherwise,\n\t// the necessary props are provided directly in `legacyProps`.\n\tif ( legacyProps.state ) {\n\t\tconst { state, ...rest } = legacyProps;\n\t\tconst { store, ...props } =\n\t\t\tmapLegacyStatePropsToComponentProps( state );\n\t\treturn { ...rest, ...props, store };\n\t}\n\n\treturn legacyProps;\n}\n\nfunction proxyComposite< C extends Component >(\n\tProxiedComponent: C | React.ForwardRefExoticComponent< C >,\n\tpropMap: Record< string, string > = {}\n): CompositeComponent< C > {\n\tconst displayName = ProxiedComponent.displayName;\n\tconst Component = ( legacyProps: CompositeStateProps ) => {\n\t\tconst { store, ...rest } =\n\t\t\tmapLegacyStatePropsToComponentProps( legacyProps );\n\t\tconst props = rest as ComponentProps< C >;\n\t\tprops.id = useInstanceId( store, props.baseId, props.id );\n\n\t\tObject.entries( propMap ).forEach( ( [ from, to ] ) => {\n\t\t\tif ( props.hasOwnProperty( from ) ) {\n\t\t\t\tObject.assign( props, { [ to ]: props[ from ] } );\n\t\t\t\tdelete props[ from ];\n\t\t\t}\n\t\t} );\n\n\t\tdelete props.baseId;\n\n\t\treturn <ProxiedComponent { ...props } store={ store } />;\n\t};\n\tComponent.displayName = displayName;\n\treturn Component;\n}\n\n// The old `CompositeGroup` used to behave more like the current\n// `CompositeRow`, but this has been split into two different\n// components. We handle that difference by checking on the\n// provided role, and returning the appropriate component.\nconst unproxiedCompositeGroup = forwardRef<\n\tany,\n\tReact.ComponentPropsWithoutRef< typeof Current.Group | typeof Current.Row >\n>( ( { role, ...props }, ref ) => {\n\tconst Component = role === 'row' ? Current.Row : Current.Group;\n\treturn <Component ref={ ref } role={ role } { ...props } />;\n} );\n\nexport const Composite = proxyComposite( Current, { baseId: 'id' } );\nexport const CompositeGroup = proxyComposite( unproxiedCompositeGroup );\nexport const CompositeItem = proxyComposite( Current.Item, {\n\tfocusable: 'accessibleWhenDisabled',\n} );\n\nexport function useCompositeState(\n\tlegacyStateOptions: LegacyStateOptions = {}\n): CompositeState {\n\tconst {\n\t\tbaseId,\n\t\tcurrentId: defaultActiveId,\n\t\torientation,\n\t\trtl = false,\n\t\tloop: focusLoop = false,\n\t\twrap: focusWrap = false,\n\t\tshift: focusShift = false,\n\t\t// eslint-disable-next-line camelcase\n\t\tunstable_virtual: virtualFocus,\n\t} = legacyStateOptions;\n\n\treturn {\n\t\tbaseId: useInstanceId( Composite, 'composite', baseId ),\n\t\tstore: useCompositeStore( {\n\t\t\tdefaultActiveId,\n\t\t\trtl,\n\t\t\torientation,\n\t\t\tfocusLoop,\n\t\t\tfocusShift,\n\t\t\tfocusWrap,\n\t\t\tvirtualFocus,\n\t\t} ),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA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AEC;EACnB,CAAC,GAAGZ,kBAAkB;EAEtB,OAAO;IACNlB,MAAM,EAAEf,aAAa,CAAEH,SAAS,EAAE,WAAW,EAAEkB,MAAO,CAAC;IACvDR,KAAK,EAAER,iBAAiB,CAAE;MACzBoC,eAAe;MACfE,GAAG;MACHD,WAAW;MACXG,SAAS;MACTI,UAAU;MACVF,SAAS;MACTI;IACD,CAAE;EACH,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","Composite","Current","useCompositeStore","useInstanceId","jsx","_jsx","mapLegacyStatePropsToComponentProps","legacyProps","state","rest","store","props","proxyComposite","ProxiedComponent","propMap","displayName","Component","id","baseId","Object","entries","forEach","from","to","hasOwnProperty","assign","unproxiedCompositeGroup","role","ref","Row","Group","CompositeGroup","CompositeItem","Item","focusable","useCompositeState","legacyStateOptions","currentId","defaultActiveId","orientation","rtl","loop","focusLoop","wrap","focusWrap","shift","focusShift","unstable_virtual","virtualFocus"],"sources":["@wordpress/components/src/composite/legacy/index.tsx"],"sourcesContent":["/**\n * Composite is a component that may contain navigable items represented by\n * CompositeItem. It's inspired by the WAI-ARIA Composite Role and implements\n * all the keyboard navigation mechanisms to ensure that there's only one\n * tab stop for the whole Composite element. This means that it can behave as\n * a roving tabindex or aria-activedescendant container.\n *\n * This file aims at providing components that are as close as possible to the\n * original `reakit`-based implementation (which was removed from the codebase),\n * although it is recommended that consumers of the package switch to the stable,\n * un-prefixed, `ariakit`-based version of `Composite`.\n *\n * @see https://ariakit.org/components/composite\n */\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Composite as Current } from '..';\nimport { useCompositeStore } from '../store';\nimport { useInstanceId } from '@wordpress/compose';\n\ntype Orientation = 'horizontal' | 'vertical';\n\nexport interface LegacyStateOptions {\n\t/**\n\t * ID that will serve as a base for all the items IDs.\n\t */\n\tbaseId?: string;\n\t/**\n\t * Determines how next and previous functions will behave. If `rtl` is set\n\t * to `true`, they will be inverted. This only affects the composite widget\n\t * behavior. You still need to set `dir=\"rtl\"` on HTML/CSS.\n\t *\n\t * @default false\n\t */\n\trtl?: boolean;\n\t/**\n\t * Defines the orientation of the composite widget. If the composite has a\n\t * single row or column (one-dimensional), the orientation value determines\n\t * which arrow keys can be used to move focus.\n\t */\n\torientation?: Orientation;\n\t/**\n\t * The current focused item `id`.\n\t */\n\tcurrentId?: string;\n\t/**\n\t * Determines how focus moves from the start and end of rows and columns.\n\t *\n\t * @default false\n\t */\n\tloop?: boolean | Orientation;\n\t/**\n\t * If enabled, moving to the next item from the last one in a row or column\n\t * will focus the first item in the next row or column and vice-versa.\n\t *\n\t * ** Has effect only on two-dimensional composites. **\n\t *\n\t * @default false\n\t */\n\twrap?: boolean | Orientation;\n\t/**\n\t * If enabled, moving up or down when there's no next item or the next item\n\t * is disabled will shift to the item right before it.\n\t *\n\t * ** Has effect only on two-dimensional composites. **\n\t *\n\t * @default false\n\t */\n\tshift?: boolean;\n\tunstable_virtual?: boolean;\n}\n\ntype Component = React.FunctionComponent< any >;\n\ntype CompositeStore = ReturnType< typeof useCompositeStore >;\ntype CompositeStoreState = { store: CompositeStore };\nexport type CompositeState = CompositeStoreState &\n\tRequired< Pick< LegacyStateOptions, 'baseId' > >;\n\n// Legacy composite components can either provide state through a\n// single `state` prop, or via individual props, usually through\n// spreading the state generated by `useCompositeState`.\n// That is, `<Composite* { ...state }>`.\nexport type CompositeStateProps =\n\t| { state: CompositeState }\n\t| ( CompositeState & { state?: never } );\ntype ComponentProps< C extends Component > = React.ComponentPropsWithRef< C >;\nexport type CompositeProps< C extends Component > = ComponentProps< C > &\n\tCompositeStateProps;\ntype CompositeComponent< C extends Component > = (\n\tprops: CompositeProps< C >\n) => React.ReactElement;\ntype CompositeComponentProps = CompositeState &\n\t(\n\t\t| ComponentProps< typeof Current.Group >\n\t\t| ComponentProps< typeof Current.Item >\n\t\t| ComponentProps< typeof Current.Row >\n\t);\n\nfunction mapLegacyStatePropsToComponentProps(\n\tlegacyProps: CompositeStateProps\n): CompositeComponentProps {\n\t// If a `state` prop is provided, we unpack that; otherwise,\n\t// the necessary props are provided directly in `legacyProps`.\n\tif ( legacyProps.state ) {\n\t\tconst { state, ...rest } = legacyProps;\n\t\tconst { store, ...props } =\n\t\t\tmapLegacyStatePropsToComponentProps( state );\n\t\treturn { ...rest, ...props, store };\n\t}\n\n\treturn legacyProps;\n}\n\nfunction proxyComposite< C extends Component >(\n\tProxiedComponent: C | React.ForwardRefExoticComponent< C >,\n\tpropMap: Record< string, string > = {}\n): CompositeComponent< C > {\n\tconst displayName = ProxiedComponent.displayName;\n\tconst Component = ( legacyProps: CompositeStateProps ) => {\n\t\tconst { store, ...rest } =\n\t\t\tmapLegacyStatePropsToComponentProps( legacyProps );\n\t\tconst props = rest as ComponentProps< C >;\n\t\tprops.id = useInstanceId( store, props.baseId, props.id );\n\n\t\tObject.entries( propMap ).forEach( ( [ from, to ] ) => {\n\t\t\tif ( props.hasOwnProperty( from ) ) {\n\t\t\t\tObject.assign( props, { [ to ]: props[ from ] } );\n\t\t\t\tdelete props[ from ];\n\t\t\t}\n\t\t} );\n\n\t\tdelete props.baseId;\n\n\t\treturn <ProxiedComponent { ...props } store={ store } />;\n\t};\n\tComponent.displayName = displayName;\n\treturn Component;\n}\n\n// The old `CompositeGroup` used to behave more like the current\n// `CompositeRow`, but this has been split into two different\n// components. We handle that difference by checking on the\n// provided role, and returning the appropriate component.\nconst unproxiedCompositeGroup = forwardRef<\n\tany,\n\tReact.ComponentPropsWithoutRef< typeof Current.Group | typeof Current.Row >\n>( ( { role, ...props }, ref ) => {\n\tconst Component = role === 'row' ? Current.Row : Current.Group;\n\treturn <Component ref={ ref } role={ role } { ...props } />;\n} );\n\nexport const Composite = proxyComposite( Current, { baseId: 'id' } );\nexport const CompositeGroup = proxyComposite( unproxiedCompositeGroup );\nexport const CompositeItem = proxyComposite( Current.Item, {\n\tfocusable: 'accessibleWhenDisabled',\n} );\n\nexport function useCompositeState(\n\tlegacyStateOptions: LegacyStateOptions = {}\n): CompositeState {\n\tconst {\n\t\tbaseId,\n\t\tcurrentId: defaultActiveId,\n\t\torientation,\n\t\trtl = false,\n\t\tloop: focusLoop = false,\n\t\twrap: focusWrap = false,\n\t\tshift: focusShift = false,\n\t\t// eslint-disable-next-line camelcase\n\t\tunstable_virtual: virtualFocus,\n\t} = legacyStateOptions;\n\n\treturn {\n\t\tbaseId: useInstanceId( Composite, 'composite', baseId ),\n\t\tstore: useCompositeStore( {\n\t\t\tdefaultActiveId,\n\t\t\trtl,\n\t\t\torientation,\n\t\t\tfocusLoop,\n\t\t\tfocusShift,\n\t\t\tfocusWrap,\n\t\t\tvirtualFocus,\n\t\t} ),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,SAAS,IAAIC,OAAO,QAAQ,IAAI;AACzC,SAASC,iBAAiB,QAAQ,UAAU;AAC5C,SAASC,aAAa,QAAQ,oBAAoB;;AA6DlD;AACA;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAiBA,SAASC,mCAAmCA,CAC3CC,WAAgC,EACN;EAC1B;EACA;EACA,IAAKA,WAAW,CAACC,KAAK,EAAG;IACxB,MAAM;MAAEA,KAAK;MAAE,GAAGC;IAAK,CAAC,GAAGF,WAAW;IACtC,MAAM;MAAEG,KAAK;MAAE,GAAGC;IAAM,CAAC,GACxBL,mCAAmC,CAAEE,KAAM,CAAC;IAC7C,OAAO;MAAE,GAAGC,IAAI;MAAE,GAAGE,KAAK;MAAED;IAAM,CAAC;EACpC;EAEA,OAAOH,WAAW;AACnB;AAEA,SAASK,cAAcA,CACtBC,gBAA0D,EAC1DC,OAAiC,GAAG,CAAC,CAAC,EACZ;EAC1B,MAAMC,WAAW,GAAGF,gBAAgB,CAACE,WAAW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AAE;EAAEiB,MAAM,EAAE;AAAK,CAAE,CAAC;AACpE,OAAO,MAAMa,cAAc,GAAGnB,cAAc,CAAEc,uBAAwB,CAAC;AACvE,OAAO,MAAMM,aAAa,GAAGpB,cAAc,CAAEX,OAAO,CAACgC,IAAI,EAAE;EAC1DC,SAAS,EAAE;AACZ,CAAE,CAAC;AAEH,OAAO,SAASC,iBAAiBA,CAChCC,kBAAsC,GAAG,CAAC,CAAC,EAC1B;EACjB,MAAM;IACLlB,MAAM;IACNmB,SAAS,EAAEC,eAAe;IAC1BC,WAAW;IACXC,GAAG,GAAG,KAAK;IACXC,IAAI,EAAEC,SAAS,GAAG,KAAK;IACvBC,IAAI,EAAEC,SAAS,GAAG,KAAK;IACvBC,KAAK,EAAEC,UAAU,GAAG,KAAK;IACzB;IACAC,gBAAgB,EAAEC;EACnB,CAAC,GAAGZ,kBAAkB;EAEtB,OAAO;IACNlB,MAAM,EAAEf,aAAa,CAAEH,SAAS,EAAE,WAAW,EAAEkB,MAAO,CAAC;IACvDR,KAAK,EAAER,iBAAiB,CAAE;MACzBoC,eAAe;MACfE,GAAG;MACHD,WAAW;MACXG,SAAS;MACTI,UAAU;MACVF,SAAS;MACTI;IACD,CAAE;EACH,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import * as Ariakit from '@ariakit/react';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { forwardRef } from '@wordpress/element';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+
15
+ import { useCompositeContext } from './context';
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ export const CompositeRow = forwardRef(function CompositeRow(props, ref) {
18
+ const context = useCompositeContext();
19
+ return /*#__PURE__*/_jsx(Ariakit.CompositeRow, {
20
+ store: context?.store,
21
+ ...props,
22
+ ref: ref
23
+ });
24
+ });
25
+ //# sourceMappingURL=row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Ariakit","forwardRef","useCompositeContext","jsx","_jsx","CompositeRow","props","ref","context","store"],"sources":["@wordpress/components/src/composite/row.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeRowProps } from './types';\n\nexport const CompositeRow = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeRowProps, 'div', false >\n>( function CompositeRow( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeRow\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAEA,SAASC,mBAAmB,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGhD,OAAO,MAAMC,YAAY,GAAGJ,UAAU,CAGnC,SAASI,YAAYA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACtC,MAAMC,OAAO,GAAGN,mBAAmB,CAAC,CAAC;EACrC,oBACCE,IAAA,CAACJ,OAAO,CAACK,YAAY;IACpBI,KAAK,EAAGD,OAAO,EAAEC,KAAO;IAAA,GACnBH,KAAK;IACVC,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import * as Ariakit from '@ariakit/react';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+
10
+ // Props are already documented in TypeScript types.
11
+ // eslint-disable-next-line jsdoc/require-param
12
+ /**
13
+ * Creates a composite store.
14
+ *
15
+ * @example
16
+ * ```jsx
17
+ * import { Composite, useCompositeStore } from '@wordpress/components';
18
+ *
19
+ * const store = useCompositeStore();
20
+ * <Composite store={store}>
21
+ * <Composite.Item>Item</Composite.Item>
22
+ * <Composite.Item>Item</Composite.Item>
23
+ * <Composite.Item>Item</Composite.Item>
24
+ * </Composite>
25
+ * ```
26
+ */
27
+ export function useCompositeStore({
28
+ focusLoop = false,
29
+ focusWrap = false,
30
+ focusShift = false,
31
+ virtualFocus = false,
32
+ orientation = 'both',
33
+ rtl = false,
34
+ ...props
35
+ } = {}) {
36
+ return Ariakit.useCompositeStore({
37
+ focusLoop,
38
+ focusWrap,
39
+ focusShift,
40
+ virtualFocus,
41
+ orientation,
42
+ rtl,
43
+ ...props
44
+ });
45
+ }
46
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Ariakit","useCompositeStore","focusLoop","focusWrap","focusShift","virtualFocus","orientation","rtl","props"],"sources":["@wordpress/components/src/composite/store.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport type { CompositeStoreProps } from './types';\n\n// Props are already documented in TypeScript types.\n// eslint-disable-next-line jsdoc/require-param\n/**\n * Creates a composite store.\n *\n * @example\n * ```jsx\n * import { Composite, useCompositeStore } from '@wordpress/components';\n *\n * const store = useCompositeStore();\n * <Composite store={store}>\n * <Composite.Item>Item</Composite.Item>\n * <Composite.Item>Item</Composite.Item>\n * <Composite.Item>Item</Composite.Item>\n * </Composite>\n * ```\n */\nexport function useCompositeStore( {\n\tfocusLoop = false,\n\tfocusWrap = false,\n\tfocusShift = false,\n\tvirtualFocus = false,\n\torientation = 'both',\n\trtl = false,\n\t...props\n}: CompositeStoreProps = {} ) {\n\treturn Ariakit.useCompositeStore( {\n\t\tfocusLoop,\n\t\tfocusWrap,\n\t\tfocusShift,\n\t\tvirtualFocus,\n\t\torientation,\n\t\trtl,\n\t\t...props,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAE;EAClCC,SAAS,GAAG,KAAK;EACjBC,SAAS,GAAG,KAAK;EACjBC,UAAU,GAAG,KAAK;EAClBC,YAAY,GAAG,KAAK;EACpBC,WAAW,GAAG,MAAM;EACpBC,GAAG,GAAG,KAAK;EACX,GAAGC;AACiB,CAAC,GAAG,CAAC,CAAC,EAAG;EAC7B,OAAOR,OAAO,CAACC,iBAAiB,CAAE;IACjCC,SAAS;IACTC,SAAS;IACTC,UAAU;IACVC,YAAY;IACZC,WAAW;IACXC,GAAG;IACH,GAAGC;EACJ,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import * as Ariakit from '@ariakit/react';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { forwardRef } from '@wordpress/element';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+
15
+ import { useCompositeContext } from './context';
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ export const CompositeTypeahead = forwardRef(function CompositeTypeahead(props, ref) {
18
+ const context = useCompositeContext();
19
+ return /*#__PURE__*/_jsx(Ariakit.CompositeTypeahead, {
20
+ store: context?.store,
21
+ ...props,
22
+ ref: ref
23
+ });
24
+ });
25
+ //# sourceMappingURL=typeahead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Ariakit","forwardRef","useCompositeContext","jsx","_jsx","CompositeTypeahead","props","ref","context","store"],"sources":["@wordpress/components/src/composite/typeahead.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useCompositeContext } from './context';\nimport type { CompositeTypeaheadProps } from './types';\n\nexport const CompositeTypeahead = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< CompositeTypeaheadProps, 'div', false >\n>( function CompositeTypeahead( props, ref ) {\n\tconst context = useCompositeContext();\n\treturn (\n\t\t<Ariakit.CompositeTypeahead\n\t\t\tstore={ context?.store }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAEA,SAASC,mBAAmB,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGhD,OAAO,MAAMC,kBAAkB,GAAGJ,UAAU,CAGzC,SAASI,kBAAkBA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EAC5C,MAAMC,OAAO,GAAGN,mBAAmB,CAAC,CAAC;EACrC,oBACCE,IAAA,CAACJ,OAAO,CAACK,kBAAkB;IAC1BI,KAAK,EAAGD,OAAO,EAAEC,KAAO;IAAA,GACnBH,KAAK;IACVC,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/composite/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type * as Ariakit from '@ariakit/react';\n\nexport type CompositeContextProps =\n\t| {\n\t\t\t/**\n\t\t\t * Object returned by the `useCompositeStore` hook.\n\t\t\t */\n\t\t\tstore: Ariakit.CompositeStore;\n\t }\n\t| undefined;\n\nexport type CompositeStoreProps = {\n\t/**\n\t * The current active item `id`. The active item is the element within the\n\t * composite widget that has either DOM or virtual focus (in case\n\t * the `virtualFocus` prop is enabled).\n\t * - `null` represents the base composite element (the one with a [composite\n\t * role](https://w3c.github.io/aria/#composite)). Users will be able to\n\t * navigate out of it using arrow keys.\n\t * - If `activeId` is initially set to `null`, the base composite element\n\t * itself will have focus and users will be able to navigate to it using\n\t * arrow keys.\n\t */\n\tactiveId?: Ariakit.CompositeStoreProps[ 'activeId' ];\n\t/**\n\t * The composite item id that should be active by default when the composite\n\t * widget is rendered. If `null`, the composite element itself will have focus\n\t * and users will be able to navigate to it using arrow keys. If `undefined`,\n\t * the first enabled item will be focused.\n\t */\n\tdefaultActiveId?: Ariakit.CompositeStoreProps[ 'defaultActiveId' ];\n\t/**\n\t * A callback that gets called when the `activeId` state changes.\n\t */\n\tsetActiveId?: Ariakit.CompositeStoreProps[ 'setActiveId' ];\n\t/**\n\t * Determines how the focus behaves when the user reaches the end of the\n\t * composite widget.\n\t *\n\t * On one-dimensional composite widgets:\n\t * - `true` loops from the last item to the first item and vice-versa.\n\t * - `horizontal` loops only if `orientation` is `horizontal` or not set.\n\t * - `vertical` loops only if `orientation` is `vertical` or not set.\n\t * - If `activeId` is initially set to `null`, the composite element will\n\t * be focused in between the last and first items.\n\t *\n\t * On two-dimensional composite widgets (ie. when using `CompositeRow`):\n\t * - `true` loops from the last row/column item to the first item in the same\n\t * row/column and vice-versa. If it's the last item in the last row, it\n\t * moves to the first item in the first row and vice-versa.\n\t * - `horizontal` loops only from the last row item to the first item in the\n\t * same row.\n\t * - `vertical` loops only from the last column item to the first item in the\n\t * column row.\n\t * - If `activeId` is initially set to `null`, vertical loop will have no\n\t * effect as moving down from the last row or up from the first row will\n\t * focus on the composite element.\n\t * - If `focusWrap` matches the value of `focusLoop`, it'll wrap between the\n\t * last item in the last row or column and the first item in the first row or\n\t * column and vice-versa.\n\t *\n\t * @default false\n\t */\n\tfocusLoop?: Ariakit.CompositeStoreProps[ 'focusLoop' ];\n\t/**\n\t * **Works only on two-dimensional composite widgets**.\n\t *\n\t * If enabled, moving to the next item from the last one in a row or column\n\t * will focus on the first item in the next row or column and vice-versa.\n\t * - `true` wraps between rows and columns.\n\t * - `horizontal` wraps only between rows.\n\t * - `vertical` wraps only between columns.\n\t * - If `focusLoop` matches the value of `focusWrap`, it'll wrap between the\n\t * last item in the last row or column and the first item in the first row or\n\t * column and vice-versa.\n\t *\n\t * @default false\n\t */\n\tfocusWrap?: Ariakit.CompositeStoreProps[ 'focusWrap' ];\n\t/**\n\t * **Works only on two-dimensional composite widgets**.\n\t *\n\t * If enabled, moving up or down when there's no next item or when the next\n\t * item is disabled will shift to the item right before it.\n\t *\n\t * @default false\n\t */\n\tfocusShift?: Ariakit.CompositeStoreProps[ 'focusShift' ];\n\t/**\n\t * If enabled, the composite element will act as an\n\t * [`aria-activedescendant`](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_focus_activedescendant)\n\t * container instead of [roving\n\t * tabindex](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex).\n\t * DOM focus will remain on the composite element while its items receive\n\t * virtual focus.\n\t *\n\t * In both scenarios, the item in focus will carry the `data-active-item`\n\t * attribute.\n\t *\n\t * @default false\n\t */\n\tvirtualFocus?: Ariakit.CompositeStoreProps[ 'virtualFocus' ];\n\t/**\n\t * Defines the orientation of the composite widget. If the composite has a\n\t * single row or column (one-dimensional), the `orientation` value determines\n\t * which arrow keys can be used to move focus:\n\t * - `both`: all arrow keys work.\n\t * - `horizontal`: only left and right arrow keys work.\n\t * - `vertical`: only up and down arrow keys work.\n\t *\n\t * It doesn't have any effect on two-dimensional composites.\n\t *\n\t * @default \"both\"\n\t */\n\torientation?: Ariakit.CompositeStoreProps[ 'orientation' ];\n\t/**\n\t * Determines how the `store`'s `next` and `previous` functions will behave.\n\t * If `rtl` is set to `true`, they will be inverted.\n\t *\n\t * This only affects the composite widget behavior. You still need to set\n\t * `dir=\"rtl\"` on HTML/CSS.\n\t *\n\t * @default false\n\t */\n\trtl?: Ariakit.CompositeStoreProps[ 'rtl' ];\n};\n\nexport type CompositeProps = {\n\t/**\n\t * Object returned by the `useCompositeStore` hook.\n\t */\n\tstore: Ariakit.CompositeStore;\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeProps[ 'render' ];\n\t/**\n\t * Makes the component a focusable element. When this element gains keyboard\n\t * focus, it gets a `data-focus-visible` attribute and triggers the\n\t * `onFocusVisible` prop.\n\t * The component supports the `disabled` prop even for those elements not\n\t * supporting the native `disabled` attribute. Disabled elements may be\n\t * still accessible via keyboard by using the the `accessibleWhenDisabled`\n\t * prop.\n\t * Non-native focusable elements will lose their focusability entirely.\n\t * However, native focusable elements will retain their inherent focusability.\n\t */\n\tfocusable?: Ariakit.CompositeProps[ 'focusable' ];\n\t/**\n\t * Determines if the element is disabled. This sets the `aria-disabled`\n\t * attribute accordingly, enabling support for all elements, including those\n\t * that don't support the native `disabled` attribute.\n\t *\n\t * This feature can be combined with the `accessibleWhenDisabled` prop to\n\t * make disabled elements still accessible via keyboard.\n\t *\n\t * **Note**: For this prop to work, the `focusable` prop must be set to\n\t * `true`, if it's not set by default.\n\t *\n\t * @default false\n\t */\n\tdisabled?: Ariakit.CompositeProps[ 'disabled' ];\n\t/**\n\t * Indicates whether the element should be focusable even when it is\n\t * `disabled`.\n\t *\n\t * This is important when discoverability is a concern. For example:\n\t *\n\t * > A toolbar in an editor contains a set of special smart paste functions\n\t * that are disabled when the clipboard is empty or when the function is not\n\t * applicable to the current content of the clipboard. It could be helpful to\n\t * keep the disabled buttons focusable if the ability to discover their\n\t * functionality is primarily via their presence on the toolbar.\n\t *\n\t * Learn more on [Focusability of disabled\n\t * controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols).\n\t */\n\taccessibleWhenDisabled?: Ariakit.CompositeProps[ 'accessibleWhenDisabled' ];\n\t/**\n\t * Custom event handler invoked when the element gains focus through keyboard\n\t * interaction or a key press occurs while the element is in focus. This is\n\t * the programmatic equivalent of the `data-focus-visible` attribute.\n\t *\n\t * **Note**: For this prop to work, the `focusable` prop must be set to `true`\n\t * if it's not set by default.\n\t */\n\tonFocusVisible?: Ariakit.CompositeProps[ 'onFocusVisible' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeProps[ 'children' ];\n};\n\nexport type CompositeGroupProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeGroupProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeGroupProps[ 'children' ];\n};\n\nexport type CompositeGroupLabelProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeGroupLabelProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeGroupLabelProps[ 'children' ];\n};\n\nexport type CompositeItemProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeItemProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeItemProps[ 'children' ];\n\t/**\n\t * Indicates whether the element should be focusable even when it is\n\t * `disabled`.\n\t *\n\t * This is important when discoverability is a concern. For example:\n\t *\n\t * > A toolbar in an editor contains a set of special smart paste functions\n\t * that are disabled when the clipboard is empty or when the function is not\n\t * applicable to the current content of the clipboard. It could be helpful to\n\t * keep the disabled buttons focusable if the ability to discover their\n\t * functionality is primarily via their presence on the toolbar.\n\t *\n\t * Learn more on [Focusability of disabled\n\t * controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols).\n\t */\n\taccessibleWhenDisabled?: Ariakit.CompositeItemProps[ 'accessibleWhenDisabled' ];\n};\n\nexport type CompositeRowProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeRowProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeRowProps[ 'children' ];\n};\n\nexport type CompositeHoverProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeHoverProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeHoverProps[ 'children' ];\n};\n\nexport type CompositeTypeaheadProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeTypeaheadProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeTypeaheadProps[ 'children' ];\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/composite/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type * as Ariakit from '@ariakit/react';\n\nexport type CompositeContextProps =\n\t| {\n\t\t\t/**\n\t\t\t * Object returned by the `useCompositeStore` hook.\n\t\t\t */\n\t\t\tstore: Ariakit.CompositeStore;\n\t }\n\t| undefined;\n\nexport type CompositeStoreProps = {\n\t/**\n\t * The current active item `id`. The active item is the element within the\n\t * composite widget that has either DOM or virtual focus (in case\n\t * the `virtualFocus` prop is enabled).\n\t * - `null` represents the base composite element (the one with a [composite\n\t * role](https://w3c.github.io/aria/#composite)). Users will be able to\n\t * navigate out of it using arrow keys.\n\t * - If `activeId` is initially set to `null`, the base composite element\n\t * itself will have focus and users will be able to navigate to it using\n\t * arrow keys.\n\t */\n\tactiveId?: Ariakit.CompositeStoreProps[ 'activeId' ];\n\t/**\n\t * The composite item id that should be active by default when the composite\n\t * widget is rendered. If `null`, the composite element itself will have focus\n\t * and users will be able to navigate to it using arrow keys. If `undefined`,\n\t * the first enabled item will be focused.\n\t */\n\tdefaultActiveId?: Ariakit.CompositeStoreProps[ 'defaultActiveId' ];\n\t/**\n\t * A callback that gets called when the `activeId` state changes.\n\t */\n\tsetActiveId?: Ariakit.CompositeStoreProps[ 'setActiveId' ];\n\t/**\n\t * Determines how the focus behaves when the user reaches the end of the\n\t * composite widget.\n\t *\n\t * On one-dimensional composite widgets:\n\t * - `true` loops from the last item to the first item and vice-versa.\n\t * - `horizontal` loops only if `orientation` is `horizontal` or not set.\n\t * - `vertical` loops only if `orientation` is `vertical` or not set.\n\t * - If `activeId` is initially set to `null`, the composite element will\n\t * be focused in between the last and first items.\n\t *\n\t * On two-dimensional composite widgets (ie. when using `CompositeRow`):\n\t * - `true` loops from the last row/column item to the first item in the same\n\t * row/column and vice-versa. If it's the last item in the last row, it\n\t * moves to the first item in the first row and vice-versa.\n\t * - `horizontal` loops only from the last row item to the first item in the\n\t * same row.\n\t * - `vertical` loops only from the last column item to the first item in the\n\t * column row.\n\t * - If `activeId` is initially set to `null`, vertical loop will have no\n\t * effect as moving down from the last row or up from the first row will\n\t * focus on the composite element.\n\t * - If `focusWrap` matches the value of `focusLoop`, it'll wrap between the\n\t * last item in the last row or column and the first item in the first row or\n\t * column and vice-versa.\n\t *\n\t * @default false\n\t */\n\tfocusLoop?: Ariakit.CompositeStoreProps[ 'focusLoop' ];\n\t/**\n\t * **Works only on two-dimensional composite widgets**.\n\t *\n\t * If enabled, moving to the next item from the last one in a row or column\n\t * will focus on the first item in the next row or column and vice-versa.\n\t * - `true` wraps between rows and columns.\n\t * - `horizontal` wraps only between rows.\n\t * - `vertical` wraps only between columns.\n\t * - If `focusLoop` matches the value of `focusWrap`, it'll wrap between the\n\t * last item in the last row or column and the first item in the first row or\n\t * column and vice-versa.\n\t *\n\t * @default false\n\t */\n\tfocusWrap?: Ariakit.CompositeStoreProps[ 'focusWrap' ];\n\t/**\n\t * **Works only on two-dimensional composite widgets**.\n\t *\n\t * If enabled, moving up or down when there's no next item or when the next\n\t * item is disabled will shift to the item right before it.\n\t *\n\t * @default false\n\t */\n\tfocusShift?: Ariakit.CompositeStoreProps[ 'focusShift' ];\n\t/**\n\t * If enabled, the composite element will act as an\n\t * [`aria-activedescendant`](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_focus_activedescendant)\n\t * container instead of [roving\n\t * tabindex](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex).\n\t * DOM focus will remain on the composite element while its items receive\n\t * virtual focus.\n\t *\n\t * In both scenarios, the item in focus will carry the `data-active-item`\n\t * attribute.\n\t *\n\t * @default false\n\t */\n\tvirtualFocus?: Ariakit.CompositeStoreProps[ 'virtualFocus' ];\n\t/**\n\t * Defines the orientation of the composite widget. If the composite has a\n\t * single row or column (one-dimensional), the `orientation` value determines\n\t * which arrow keys can be used to move focus:\n\t * - `both`: all arrow keys work.\n\t * - `horizontal`: only left and right arrow keys work.\n\t * - `vertical`: only up and down arrow keys work.\n\t *\n\t * It doesn't have any effect on two-dimensional composites.\n\t *\n\t * @default \"both\"\n\t */\n\torientation?: Ariakit.CompositeStoreProps[ 'orientation' ];\n\t/**\n\t * Determines how the `store`'s `next` and `previous` functions will behave.\n\t * If `rtl` is set to `true`, they will be inverted.\n\t *\n\t * This only affects the composite widget behavior. You still need to set\n\t * `dir=\"rtl\"` on HTML/CSS.\n\t *\n\t * @default false\n\t */\n\trtl?: Ariakit.CompositeStoreProps[ 'rtl' ];\n};\n\nexport type CompositeProps = CompositeStoreProps & {\n\t/**\n\t * Object returned by the `useCompositeStore` hook.\n\t */\n\tstore?: Ariakit.CompositeStore;\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeProps[ 'render' ];\n\t/**\n\t * Makes the component a focusable element. When this element gains keyboard\n\t * focus, it gets a `data-focus-visible` attribute and triggers the\n\t * `onFocusVisible` prop.\n\t * The component supports the `disabled` prop even for those elements not\n\t * supporting the native `disabled` attribute. Disabled elements may be\n\t * still accessible via keyboard by using the the `accessibleWhenDisabled`\n\t * prop.\n\t * Non-native focusable elements will lose their focusability entirely.\n\t * However, native focusable elements will retain their inherent focusability.\n\t */\n\tfocusable?: Ariakit.CompositeProps[ 'focusable' ];\n\t/**\n\t * Determines if the element is disabled. This sets the `aria-disabled`\n\t * attribute accordingly, enabling support for all elements, including those\n\t * that don't support the native `disabled` attribute.\n\t *\n\t * This feature can be combined with the `accessibleWhenDisabled` prop to\n\t * make disabled elements still accessible via keyboard.\n\t *\n\t * **Note**: For this prop to work, the `focusable` prop must be set to\n\t * `true`, if it's not set by default.\n\t *\n\t * @default false\n\t */\n\tdisabled?: Ariakit.CompositeProps[ 'disabled' ];\n\t/**\n\t * Indicates whether the element should be focusable even when it is\n\t * `disabled`.\n\t *\n\t * This is important when discoverability is a concern. For example:\n\t *\n\t * > A toolbar in an editor contains a set of special smart paste functions\n\t * that are disabled when the clipboard is empty or when the function is not\n\t * applicable to the current content of the clipboard. It could be helpful to\n\t * keep the disabled buttons focusable if the ability to discover their\n\t * functionality is primarily via their presence on the toolbar.\n\t *\n\t * Learn more on [Focusability of disabled\n\t * controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols).\n\t */\n\taccessibleWhenDisabled?: Ariakit.CompositeProps[ 'accessibleWhenDisabled' ];\n\t/**\n\t * Custom event handler invoked when the element gains focus through keyboard\n\t * interaction or a key press occurs while the element is in focus. This is\n\t * the programmatic equivalent of the `data-focus-visible` attribute.\n\t *\n\t * **Note**: For this prop to work, the `focusable` prop must be set to `true`\n\t * if it's not set by default.\n\t */\n\tonFocusVisible?: Ariakit.CompositeProps[ 'onFocusVisible' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeProps[ 'children' ];\n};\n\nexport type CompositeGroupProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeGroupProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeGroupProps[ 'children' ];\n};\n\nexport type CompositeGroupLabelProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeGroupLabelProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeGroupLabelProps[ 'children' ];\n};\n\nexport type CompositeItemProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeItemProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeItemProps[ 'children' ];\n\t/**\n\t * Indicates whether the element should be focusable even when it is\n\t * `disabled`.\n\t *\n\t * This is important when discoverability is a concern. For example:\n\t *\n\t * > A toolbar in an editor contains a set of special smart paste functions\n\t * that are disabled when the clipboard is empty or when the function is not\n\t * applicable to the current content of the clipboard. It could be helpful to\n\t * keep the disabled buttons focusable if the ability to discover their\n\t * functionality is primarily via their presence on the toolbar.\n\t *\n\t * Learn more on [Focusability of disabled\n\t * controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols).\n\t */\n\taccessibleWhenDisabled?: Ariakit.CompositeItemProps[ 'accessibleWhenDisabled' ];\n};\n\nexport type CompositeRowProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeRowProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeRowProps[ 'children' ];\n};\n\nexport type CompositeHoverProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeHoverProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeHoverProps[ 'children' ];\n};\n\nexport type CompositeTypeaheadProps = {\n\t/**\n\t * Allows the component to be rendered as a different HTML element or React\n\t * component. The value can be a React element or a function that takes in the\n\t * original component props and gives back a React element with the props\n\t * merged.\n\t */\n\trender?: Ariakit.CompositeTypeaheadProps[ 'render' ];\n\t/**\n\t * The contents of the component.\n\t */\n\tchildren?: Ariakit.CompositeTypeaheadProps[ 'children' ];\n};\n"],"mappings":"","ignoreList":[]}
@@ -85,9 +85,9 @@ function ControlPoints({
85
85
  onStopControlPointChange,
86
86
  __experimentalIsRenderedInSidebar
87
87
  }) {
88
- const controlPointMoveState = useRef();
88
+ const controlPointMoveStateRef = useRef();
89
89
  const onMouseMove = event => {
90
- if (controlPointMoveState.current === undefined || gradientPickerDomRef.current === null) {
90
+ if (controlPointMoveStateRef.current === undefined || gradientPickerDomRef.current === null) {
91
91
  return;
92
92
  }
93
93
  const relativePosition = getHorizontalRelativeGradientPosition(event.clientX, gradientPickerDomRef.current);
@@ -95,18 +95,18 @@ function ControlPoints({
95
95
  initialPosition,
96
96
  index,
97
97
  significantMoveHappened
98
- } = controlPointMoveState.current;
98
+ } = controlPointMoveStateRef.current;
99
99
  if (!significantMoveHappened && Math.abs(initialPosition - relativePosition) >= MINIMUM_SIGNIFICANT_MOVE) {
100
- controlPointMoveState.current.significantMoveHappened = true;
100
+ controlPointMoveStateRef.current.significantMoveHappened = true;
101
101
  }
102
102
  onChange(updateControlPointPosition(controlPoints, index, relativePosition));
103
103
  };
104
104
  const cleanEventListeners = () => {
105
- if (window && window.removeEventListener && controlPointMoveState.current && controlPointMoveState.current.listenersActivated) {
105
+ if (window && window.removeEventListener && controlPointMoveStateRef.current && controlPointMoveStateRef.current.listenersActivated) {
106
106
  window.removeEventListener('mousemove', onMouseMove);
107
107
  window.removeEventListener('mouseup', cleanEventListeners);
108
108
  onStopControlPointChange();
109
- controlPointMoveState.current.listenersActivated = false;
109
+ controlPointMoveStateRef.current.listenersActivated = false;
110
110
  }
111
111
  };
112
112
 
@@ -131,7 +131,7 @@ function ControlPoints({
131
131
  onToggle
132
132
  }) => /*#__PURE__*/_jsx(ControlPointButton, {
133
133
  onClick: () => {
134
- if (controlPointMoveState.current && controlPointMoveState.current.significantMoveHappened) {
134
+ if (controlPointMoveStateRef.current && controlPointMoveStateRef.current.significantMoveHappened) {
135
135
  return;
136
136
  }
137
137
  if (isOpen) {
@@ -143,7 +143,7 @@ function ControlPoints({
143
143
  },
144
144
  onMouseDown: () => {
145
145
  if (window && window.addEventListener) {
146
- controlPointMoveState.current = {
146
+ controlPointMoveStateRef.current = {
147
147
  initialPosition,
148
148
  index,
149
149
  significantMoveHappened: false,
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","colord","useInstanceId","useEffect","useRef","useState","useMemo","__","sprintf","plus","Button","HStack","ColorPicker","VisuallyHidden","CustomColorPickerDropdown","addControlPoint","clampPercent","removeControlPoint","updateControlPointColor","updateControlPointColorByPosition","updateControlPointPosition","getHorizontalRelativeGradientPosition","MINIMUM_SIGNIFICANT_MOVE","KEYBOARD_CONTROL_POINT_VARIATION","DropdownContentWrapper","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ControlPointButton","isOpen","position","color","additionalProps","instanceId","descriptionId","children","className","id","GradientColorPickerDropdown","isRenderedInSidebar","props","popoverProps","placement","offset","resize","mergedClassName","ControlPoints","disableRemove","disableAlpha","gradientPickerDomRef","ignoreMarkerPosition","value","controlPoints","onChange","onStartControlPointChange","onStopControlPointChange","__experimentalIsRenderedInSidebar","controlPointMoveState","onMouseMove","event","current","undefined","relativePosition","clientX","initialPosition","index","significantMoveHappened","Math","abs","cleanEventListeners","window","removeEventListener","listenersActivated","cleanEventListenersRef","map","point","onClose","renderToggle","onToggle","onClick","onMouseDown","addEventListener","onKeyDown","code","stopPropagation","renderContent","paddingSize","enableAlpha","toRgbString","length","alignment","variant","style","left","transform","InsertPoint","onOpenInserter","onCloseInserter","insertPosition","alreadyInsertedPoint","setAlreadyInsertedPoint","icon"],"sources":["@wordpress/components/src/custom-gradient-picker/gradient-bar/control-points.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useRef, useState, useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport { HStack } from '../../h-stack';\nimport { ColorPicker } from '../../color-picker';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport { CustomColorPickerDropdown } from '../../color-palette';\n\nimport {\n\taddControlPoint,\n\tclampPercent,\n\tremoveControlPoint,\n\tupdateControlPointColor,\n\tupdateControlPointColorByPosition,\n\tupdateControlPointPosition,\n\tgetHorizontalRelativeGradientPosition,\n} from './utils';\nimport {\n\tMINIMUM_SIGNIFICANT_MOVE,\n\tKEYBOARD_CONTROL_POINT_VARIATION,\n} from './constants';\nimport type { WordPressComponentProps } from '../../context';\nimport type {\n\tControlPointButtonProps,\n\tControlPointMoveState,\n\tControlPointsProps,\n\tInsertPointProps,\n} from '../types';\nimport type { CustomColorPickerDropdownProps } from '../../color-palette/types';\nimport DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';\n\nfunction ControlPointButton( {\n\tisOpen,\n\tposition,\n\tcolor,\n\t...additionalProps\n}: WordPressComponentProps< ControlPointButtonProps, 'button', true > ) {\n\tconst instanceId = useInstanceId( ControlPointButton );\n\tconst descriptionId = `components-custom-gradient-picker__control-point-button-description-${ instanceId }`;\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t// translators: %1$s: gradient position e.g: 70, %2$s: gradient color code e.g: rgb(52,121,151).\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Gradient control point at position %1$s%% with color code %2$s.'\n\t\t\t\t\t),\n\t\t\t\t\tposition,\n\t\t\t\t\tcolor\n\t\t\t\t) }\n\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'components-custom-gradient-picker__control-point-button',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isOpen,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n\nfunction GradientColorPickerDropdown( {\n\tisRenderedInSidebar,\n\tclassName,\n\t...props\n}: CustomColorPickerDropdownProps ) {\n\t// Open the popover below the gradient control/insertion point\n\tconst popoverProps = useMemo(\n\t\t() =>\n\t\t\t( {\n\t\t\t\tplacement: 'bottom',\n\t\t\t\toffset: 8,\n\t\t\t\t// Disabling resize as it would otherwise cause the popover to show\n\t\t\t\t// scrollbars while dragging the color picker's handle close to the\n\t\t\t\t// popover edge.\n\t\t\t\tresize: false,\n\t\t\t} ) as const,\n\t\t[]\n\t);\n\n\tconst mergedClassName = clsx(\n\t\t'components-custom-gradient-picker__control-point-dropdown',\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<CustomColorPickerDropdown\n\t\t\tisRenderedInSidebar={ isRenderedInSidebar }\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tclassName={ mergedClassName }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction ControlPoints( {\n\tdisableRemove,\n\tdisableAlpha,\n\tgradientPickerDomRef,\n\tignoreMarkerPosition,\n\tvalue: controlPoints,\n\tonChange,\n\tonStartControlPointChange,\n\tonStopControlPointChange,\n\t__experimentalIsRenderedInSidebar,\n}: ControlPointsProps ) {\n\tconst controlPointMoveState = useRef< ControlPointMoveState >();\n\n\tconst onMouseMove = ( event: MouseEvent ) => {\n\t\tif (\n\t\t\tcontrolPointMoveState.current === undefined ||\n\t\t\tgradientPickerDomRef.current === null\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst relativePosition = getHorizontalRelativeGradientPosition(\n\t\t\tevent.clientX,\n\t\t\tgradientPickerDomRef.current\n\t\t);\n\n\t\tconst { initialPosition, index, significantMoveHappened } =\n\t\t\tcontrolPointMoveState.current;\n\n\t\tif (\n\t\t\t! significantMoveHappened &&\n\t\t\tMath.abs( initialPosition - relativePosition ) >=\n\t\t\t\tMINIMUM_SIGNIFICANT_MOVE\n\t\t) {\n\t\t\tcontrolPointMoveState.current.significantMoveHappened = true;\n\t\t}\n\n\t\tonChange(\n\t\t\tupdateControlPointPosition( controlPoints, index, relativePosition )\n\t\t);\n\t};\n\n\tconst cleanEventListeners = () => {\n\t\tif (\n\t\t\twindow &&\n\t\t\twindow.removeEventListener &&\n\t\t\tcontrolPointMoveState.current &&\n\t\t\tcontrolPointMoveState.current.listenersActivated\n\t\t) {\n\t\t\twindow.removeEventListener( 'mousemove', onMouseMove );\n\t\t\twindow.removeEventListener( 'mouseup', cleanEventListeners );\n\t\t\tonStopControlPointChange();\n\t\t\tcontrolPointMoveState.current.listenersActivated = false;\n\t\t}\n\t};\n\n\t// Adding `cleanEventListeners` to the dependency array below requires the function itself to be wrapped in a `useCallback`\n\t// This memoization would prevent the event listeners from being properly cleaned.\n\t// Instead, we'll pass a ref to the function in our `useEffect` so `cleanEventListeners` itself is no longer a dependency.\n\tconst cleanEventListenersRef = useRef< () => void >();\n\tcleanEventListenersRef.current = cleanEventListeners;\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tcleanEventListenersRef.current?.();\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t{ controlPoints.map( ( point, index ) => {\n\t\t\t\tconst initialPosition = point?.position;\n\t\t\t\treturn (\n\t\t\t\t\tignoreMarkerPosition !== initialPosition && (\n\t\t\t\t\t\t<GradientColorPickerDropdown\n\t\t\t\t\t\t\tisRenderedInSidebar={\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tonClose={ onStopControlPointChange }\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<ControlPointButton\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveState.current &&\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveState.current\n\t\t\t\t\t\t\t\t\t\t\t\t.significantMoveHappened\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\t\t\t\t\tonStopControlPointChange();\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonMouseDown={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\twindow &&\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveState.current = {\n\t\t\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\tsignificantMoveHappened: false,\n\t\t\t\t\t\t\t\t\t\t\t\tlistenersActivated: true,\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mousemove',\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseMove\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mouseup',\n\t\t\t\t\t\t\t\t\t\t\t\tcleanEventListeners\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\tif ( event.code === 'ArrowLeft' ) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\tevent.code === 'ArrowRight'\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tposition={ point.position }\n\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointColor(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolord(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor\n\t\t\t\t\t\t\t\t\t\t\t\t\t).toRgbString()\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ ! disableRemove &&\n\t\t\t\t\t\t\t\t\t\tcontrolPoints.length > 2 && (\n\t\t\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-custom-gradient-picker__remove-control-point-wrapper\"\n\t\t\t\t\t\t\t\t\t\t\t\talignment=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveControlPoint(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove Control Point'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tleft: `${ point.position }%`,\n\t\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n\nfunction InsertPoint( {\n\tvalue: controlPoints,\n\tonChange,\n\tonOpenInserter,\n\tonCloseInserter,\n\tinsertPosition,\n\tdisableAlpha,\n\t__experimentalIsRenderedInSidebar,\n}: InsertPointProps ) {\n\tconst [ alreadyInsertedPoint, setAlreadyInsertedPoint ] = useState( false );\n\treturn (\n\t\t<GradientColorPickerDropdown\n\t\t\tisRenderedInSidebar={ __experimentalIsRenderedInSidebar }\n\t\t\tclassName=\"components-custom-gradient-picker__inserter\"\n\t\t\tonClose={ () => {\n\t\t\t\tonCloseInserter();\n\t\t\t} }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\tonCloseInserter();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetAlreadyInsertedPoint( false );\n\t\t\t\t\t\t\tonOpenInserter();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t} }\n\t\t\t\t\tclassName=\"components-custom-gradient-picker__insert-point-dropdown\"\n\t\t\t\t\ticon={ plus }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\tif ( ! alreadyInsertedPoint ) {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\taddControlPoint(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsetAlreadyInsertedPoint( true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\tupdateControlPointColorByPosition(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t\tstyle={\n\t\t\t\tinsertPosition !== null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tleft: `${ insertPosition }%`,\n\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\nControlPoints.InsertPoint = InsertPoint;\n\nexport default ControlPoints;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,MAAM,QAAQ,QAAQ;;AAE/B;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,MAAM,EAAEC,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ACiD,WAAW,GAAGA,WAAW;AAEvC,eAAejD,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["clsx","colord","useInstanceId","useEffect","useRef","useState","useMemo","__","sprintf","plus","Button","HStack","ColorPicker","VisuallyHidden","CustomColorPickerDropdown","addControlPoint","clampPercent","removeControlPoint","updateControlPointColor","updateControlPointColorByPosition","updateControlPointPosition","getHorizontalRelativeGradientPosition","MINIMUM_SIGNIFICANT_MOVE","KEYBOARD_CONTROL_POINT_VARIATION","DropdownContentWrapper","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ControlPointButton","isOpen","position","color","additionalProps","instanceId","descriptionId","children","className","id","GradientColorPickerDropdown","isRenderedInSidebar","props","popoverProps","placement","offset","resize","mergedClassName","ControlPoints","disableRemove","disableAlpha","gradientPickerDomRef","ignoreMarkerPosition","value","controlPoints","onChange","onStartControlPointChange","onStopControlPointChange","__experimentalIsRenderedInSidebar","controlPointMoveStateRef","onMouseMove","event","current","undefined","relativePosition","clientX","initialPosition","index","significantMoveHappened","Math","abs","cleanEventListeners","window","removeEventListener","listenersActivated","cleanEventListenersRef","map","point","onClose","renderToggle","onToggle","onClick","onMouseDown","addEventListener","onKeyDown","code","stopPropagation","renderContent","paddingSize","enableAlpha","toRgbString","length","alignment","variant","style","left","transform","InsertPoint","onOpenInserter","onCloseInserter","insertPosition","alreadyInsertedPoint","setAlreadyInsertedPoint","icon"],"sources":["@wordpress/components/src/custom-gradient-picker/gradient-bar/control-points.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useRef, useState, useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { plus } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport { HStack } from '../../h-stack';\nimport { ColorPicker } from '../../color-picker';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport { CustomColorPickerDropdown } from '../../color-palette';\n\nimport {\n\taddControlPoint,\n\tclampPercent,\n\tremoveControlPoint,\n\tupdateControlPointColor,\n\tupdateControlPointColorByPosition,\n\tupdateControlPointPosition,\n\tgetHorizontalRelativeGradientPosition,\n} from './utils';\nimport {\n\tMINIMUM_SIGNIFICANT_MOVE,\n\tKEYBOARD_CONTROL_POINT_VARIATION,\n} from './constants';\nimport type { WordPressComponentProps } from '../../context';\nimport type {\n\tControlPointButtonProps,\n\tControlPointMoveState,\n\tControlPointsProps,\n\tInsertPointProps,\n} from '../types';\nimport type { CustomColorPickerDropdownProps } from '../../color-palette/types';\nimport DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';\n\nfunction ControlPointButton( {\n\tisOpen,\n\tposition,\n\tcolor,\n\t...additionalProps\n}: WordPressComponentProps< ControlPointButtonProps, 'button', true > ) {\n\tconst instanceId = useInstanceId( ControlPointButton );\n\tconst descriptionId = `components-custom-gradient-picker__control-point-button-description-${ instanceId }`;\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t// translators: %1$s: gradient position e.g: 70, %2$s: gradient color code e.g: rgb(52,121,151).\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Gradient control point at position %1$s%% with color code %2$s.'\n\t\t\t\t\t),\n\t\t\t\t\tposition,\n\t\t\t\t\tcolor\n\t\t\t\t) }\n\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'components-custom-gradient-picker__control-point-button',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isOpen,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n\nfunction GradientColorPickerDropdown( {\n\tisRenderedInSidebar,\n\tclassName,\n\t...props\n}: CustomColorPickerDropdownProps ) {\n\t// Open the popover below the gradient control/insertion point\n\tconst popoverProps = useMemo(\n\t\t() =>\n\t\t\t( {\n\t\t\t\tplacement: 'bottom',\n\t\t\t\toffset: 8,\n\t\t\t\t// Disabling resize as it would otherwise cause the popover to show\n\t\t\t\t// scrollbars while dragging the color picker's handle close to the\n\t\t\t\t// popover edge.\n\t\t\t\tresize: false,\n\t\t\t} ) as const,\n\t\t[]\n\t);\n\n\tconst mergedClassName = clsx(\n\t\t'components-custom-gradient-picker__control-point-dropdown',\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<CustomColorPickerDropdown\n\t\t\tisRenderedInSidebar={ isRenderedInSidebar }\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tclassName={ mergedClassName }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction ControlPoints( {\n\tdisableRemove,\n\tdisableAlpha,\n\tgradientPickerDomRef,\n\tignoreMarkerPosition,\n\tvalue: controlPoints,\n\tonChange,\n\tonStartControlPointChange,\n\tonStopControlPointChange,\n\t__experimentalIsRenderedInSidebar,\n}: ControlPointsProps ) {\n\tconst controlPointMoveStateRef = useRef< ControlPointMoveState >();\n\n\tconst onMouseMove = ( event: MouseEvent ) => {\n\t\tif (\n\t\t\tcontrolPointMoveStateRef.current === undefined ||\n\t\t\tgradientPickerDomRef.current === null\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst relativePosition = getHorizontalRelativeGradientPosition(\n\t\t\tevent.clientX,\n\t\t\tgradientPickerDomRef.current\n\t\t);\n\n\t\tconst { initialPosition, index, significantMoveHappened } =\n\t\t\tcontrolPointMoveStateRef.current;\n\n\t\tif (\n\t\t\t! significantMoveHappened &&\n\t\t\tMath.abs( initialPosition - relativePosition ) >=\n\t\t\t\tMINIMUM_SIGNIFICANT_MOVE\n\t\t) {\n\t\t\tcontrolPointMoveStateRef.current.significantMoveHappened = true;\n\t\t}\n\n\t\tonChange(\n\t\t\tupdateControlPointPosition( controlPoints, index, relativePosition )\n\t\t);\n\t};\n\n\tconst cleanEventListeners = () => {\n\t\tif (\n\t\t\twindow &&\n\t\t\twindow.removeEventListener &&\n\t\t\tcontrolPointMoveStateRef.current &&\n\t\t\tcontrolPointMoveStateRef.current.listenersActivated\n\t\t) {\n\t\t\twindow.removeEventListener( 'mousemove', onMouseMove );\n\t\t\twindow.removeEventListener( 'mouseup', cleanEventListeners );\n\t\t\tonStopControlPointChange();\n\t\t\tcontrolPointMoveStateRef.current.listenersActivated = false;\n\t\t}\n\t};\n\n\t// Adding `cleanEventListeners` to the dependency array below requires the function itself to be wrapped in a `useCallback`\n\t// This memoization would prevent the event listeners from being properly cleaned.\n\t// Instead, we'll pass a ref to the function in our `useEffect` so `cleanEventListeners` itself is no longer a dependency.\n\tconst cleanEventListenersRef = useRef< () => void >();\n\tcleanEventListenersRef.current = cleanEventListeners;\n\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tcleanEventListenersRef.current?.();\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t{ controlPoints.map( ( point, index ) => {\n\t\t\t\tconst initialPosition = point?.position;\n\t\t\t\treturn (\n\t\t\t\t\tignoreMarkerPosition !== initialPosition && (\n\t\t\t\t\t\t<GradientColorPickerDropdown\n\t\t\t\t\t\t\tisRenderedInSidebar={\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tonClose={ onStopControlPointChange }\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<ControlPointButton\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveStateRef.current &&\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveStateRef.current\n\t\t\t\t\t\t\t\t\t\t\t\t.significantMoveHappened\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\t\t\t\t\tonStopControlPointChange();\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonMouseDown={ () => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\twindow &&\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tcontrolPointMoveStateRef.current = {\n\t\t\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\tsignificantMoveHappened: false,\n\t\t\t\t\t\t\t\t\t\t\t\tlistenersActivated: true,\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\tonStartControlPointChange();\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mousemove',\n\t\t\t\t\t\t\t\t\t\t\t\tonMouseMove\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t\t\t\t\t\t'mouseup',\n\t\t\t\t\t\t\t\t\t\t\t\tcleanEventListeners\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\tif ( event.code === 'ArrowLeft' ) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\tevent.code === 'ArrowRight'\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t// Stop propagation of the key press event to avoid focus moving\n\t\t\t\t\t\t\t\t\t\t\t// to another editor area.\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointPosition(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tclampPercent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpoint.position +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tKEYBOARD_CONTROL_POINT_VARIATION\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tposition={ point.position }\n\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\t\t\t\t\tcolor={ point.color }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\tupdateControlPointColor(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolord(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor\n\t\t\t\t\t\t\t\t\t\t\t\t\t).toRgbString()\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ ! disableRemove &&\n\t\t\t\t\t\t\t\t\t\tcontrolPoints.length > 2 && (\n\t\t\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-custom-gradient-picker__remove-control-point-wrapper\"\n\t\t\t\t\t\t\t\t\t\t\t\talignment=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveControlPoint(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Remove Control Point'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tleft: `${ point.position }%`,\n\t\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n\nfunction InsertPoint( {\n\tvalue: controlPoints,\n\tonChange,\n\tonOpenInserter,\n\tonCloseInserter,\n\tinsertPosition,\n\tdisableAlpha,\n\t__experimentalIsRenderedInSidebar,\n}: InsertPointProps ) {\n\tconst [ alreadyInsertedPoint, setAlreadyInsertedPoint ] = useState( false );\n\treturn (\n\t\t<GradientColorPickerDropdown\n\t\t\tisRenderedInSidebar={ __experimentalIsRenderedInSidebar }\n\t\t\tclassName=\"components-custom-gradient-picker__inserter\"\n\t\t\tonClose={ () => {\n\t\t\t\tonCloseInserter();\n\t\t\t} }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t\t\tonCloseInserter();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetAlreadyInsertedPoint( false );\n\t\t\t\t\t\t\tonOpenInserter();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t} }\n\t\t\t\t\tclassName=\"components-custom-gradient-picker__insert-point-dropdown\"\n\t\t\t\t\ticon={ plus }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t<ColorPicker\n\t\t\t\t\t\tenableAlpha={ ! disableAlpha }\n\t\t\t\t\t\tonChange={ ( color ) => {\n\t\t\t\t\t\t\tif ( ! alreadyInsertedPoint ) {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\taddControlPoint(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsetAlreadyInsertedPoint( true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\t\t\tupdateControlPointColorByPosition(\n\t\t\t\t\t\t\t\t\t\tcontrolPoints,\n\t\t\t\t\t\t\t\t\t\tinsertPosition,\n\t\t\t\t\t\t\t\t\t\tcolord( color ).toRgbString()\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t\tstyle={\n\t\t\t\tinsertPosition !== null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tleft: `${ insertPosition }%`,\n\t\t\t\t\t\t\ttransform: 'translateX( -50% )',\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\nControlPoints.InsertPoint = InsertPoint;\n\nexport default ControlPoints;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,MAAM,QAAQ,QAAQ;;AAE/B;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACzE,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,IAAI,QAAQ,kBAAkB;;AAEvC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,SAASC,MAAM,QAAQ,eAAe;AACtC,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,yBAAyB,QAAQ,qBAAqB;AAE/D,SACCC,eAAe,EACfC,YAAY,EACZC,kBAAkB,EAClBC,uBAAuB,EACvBC,iCAAiC,EACjCC,0BAA0B,EAC1BC,qCAAqC,QAC/B,SAAS;AAChB,SACCC,wBAAwB,EACxBC,gCAAgC,QAC1B,aAAa;AASpB,OAAOC,sBAAsB,MAAM,yCAAyC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE7E,SAASC,kBAAkBA,CAAE;EAC5BC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACL,GAAGC;AACgE,CAAC,EAAG;EACvE,MAAMC,UAAU,GAAGlC,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