@wordpress/components 25.6.1 → 25.8.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 (1064) hide show
  1. package/CHANGELOG.md +70 -1
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +3 -8
  4. package/build/animation/index.js +6 -0
  5. package/build/animation/index.js.map +1 -1
  6. package/build/border-control/border-control-dropdown/component.js +1 -1
  7. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  8. package/build/border-control/styles.js +20 -20
  9. package/build/border-control/styles.js.map +1 -1
  10. package/build/box-control/unit-control.js +1 -1
  11. package/build/box-control/unit-control.js.map +1 -1
  12. package/build/button/index.js +9 -1
  13. package/build/button/index.js.map +1 -1
  14. package/build/button/types.js.map +1 -1
  15. package/build/circular-option-picker/circular-option-picker-actions.js +53 -0
  16. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -0
  17. package/build/circular-option-picker/circular-option-picker-context.js +14 -0
  18. package/build/circular-option-picker/circular-option-picker-context.js.map +1 -0
  19. package/build/circular-option-picker/circular-option-picker-option-group.js +26 -0
  20. package/build/circular-option-picker/circular-option-picker-option-group.js.map +1 -0
  21. package/build/circular-option-picker/circular-option-picker-option.js +122 -0
  22. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -0
  23. package/build/circular-option-picker/circular-option-picker.js +172 -0
  24. package/build/circular-option-picker/circular-option-picker.js.map +1 -0
  25. package/build/circular-option-picker/index.js +29 -137
  26. package/build/circular-option-picker/index.js.map +1 -1
  27. package/build/circular-option-picker/types.js.map +1 -1
  28. package/build/color-palette/index.js +58 -19
  29. package/build/color-palette/index.js.map +1 -1
  30. package/build/color-palette/types.js.map +1 -1
  31. package/build/color-picker/hsv-color-picker.native.js +92 -0
  32. package/build/color-picker/hsv-color-picker.native.js.map +1 -0
  33. package/build/color-picker/hue-picker.native.js +195 -0
  34. package/build/color-picker/hue-picker.native.js.map +1 -0
  35. package/build/color-picker/index.native.js +3 -2
  36. package/build/color-picker/index.native.js.map +1 -1
  37. package/build/color-picker/saturation-picker.native.js +178 -0
  38. package/build/color-picker/saturation-picker.native.js.map +1 -0
  39. package/build/combobox-control/index.js +0 -3
  40. package/build/combobox-control/index.js.map +1 -1
  41. package/build/composite/index.js.map +1 -1
  42. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  43. package/build/date-time/time/timezone.js +1 -1
  44. package/build/date-time/time/timezone.js.map +1 -1
  45. package/build/dropdown/index.js +11 -23
  46. package/build/dropdown/index.js.map +1 -1
  47. package/build/dropdown/types.js.map +1 -1
  48. package/build/dropdown-menu/index.js +7 -1
  49. package/build/dropdown-menu/index.js.map +1 -1
  50. package/build/dropdown-menu/types.js.map +1 -1
  51. package/build/dropdown-menu-v2/styles.js +16 -16
  52. package/build/dropdown-menu-v2/styles.js.map +1 -1
  53. package/build/duotone-picker/color-list-picker/index.js +18 -3
  54. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  55. package/build/duotone-picker/duotone-picker.js +33 -1
  56. package/build/duotone-picker/duotone-picker.js.map +1 -1
  57. package/build/duotone-picker/types.js.map +1 -1
  58. package/build/focusable-iframe/index.js +0 -4
  59. package/build/focusable-iframe/index.js.map +1 -1
  60. package/build/focusable-iframe/types.js +6 -0
  61. package/build/focusable-iframe/types.js.map +1 -0
  62. package/build/form-token-field/index.js +6 -2
  63. package/build/form-token-field/index.js.map +1 -1
  64. package/build/form-token-field/types.js.map +1 -1
  65. package/build/gradient-picker/index.js +57 -15
  66. package/build/gradient-picker/index.js.map +1 -1
  67. package/build/gradient-picker/types.js.map +1 -1
  68. package/build/higher-order/navigate-regions/index.js.map +1 -1
  69. package/build/higher-order/with-focus-outside/index.js +1 -2
  70. package/build/higher-order/with-focus-outside/index.js.map +1 -1
  71. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  72. package/build/index.js +6 -0
  73. package/build/index.js.map +1 -1
  74. package/build/input-control/styles/input-control-styles.js +22 -22
  75. package/build/input-control/styles/input-control-styles.js.map +1 -1
  76. package/build/item-group/item/component.js +0 -1
  77. package/build/item-group/item/component.js.map +1 -1
  78. package/build/item-group/item-group/component.js +0 -1
  79. package/build/item-group/item-group/component.js.map +1 -1
  80. package/build/menu-item/index.js +6 -4
  81. package/build/menu-item/index.js.map +1 -1
  82. package/build/menu-item/types.js.map +1 -1
  83. package/build/mobile/bottom-sheet/index.native.js +1 -0
  84. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  85. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  86. package/build/mobile/link-settings/link-settings-navigation.native.js +1 -1
  87. package/build/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  88. package/build/navigation/index.js +0 -1
  89. package/build/navigation/index.js.map +1 -1
  90. package/build/navigation/use-navigation-tree-nodes.js.map +1 -1
  91. package/build/navigator/navigator-provider/component.js +1 -2
  92. package/build/navigator/navigator-provider/component.js.map +1 -1
  93. package/build/notice/index.js +19 -7
  94. package/build/notice/index.js.map +1 -1
  95. package/build/palette-edit/styles.js +10 -10
  96. package/build/palette-edit/styles.js.map +1 -1
  97. package/build/placeholder/index.js.map +1 -1
  98. package/build/popover/index.js +68 -151
  99. package/build/popover/index.js.map +1 -1
  100. package/build/popover/overlay-middlewares.js.map +1 -1
  101. package/build/popover/types.js.map +1 -1
  102. package/build/popover/utils.js +10 -87
  103. package/build/popover/utils.js.map +1 -1
  104. package/build/progress-bar/styles.js +6 -5
  105. package/build/progress-bar/styles.js.map +1 -1
  106. package/build/search-control/index.js +12 -3
  107. package/build/search-control/index.js.map +1 -1
  108. package/build/search-control/index.native.js +27 -24
  109. package/build/search-control/index.native.js.map +1 -1
  110. package/build/search-control/types.js.map +1 -1
  111. package/build/shortcut/index.js +13 -0
  112. package/build/shortcut/index.js.map +1 -1
  113. package/build/slot-fill/bubbles-virtually/slot-fill-context.js +3 -1
  114. package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  115. package/build/slot-fill/bubbles-virtually/slot.js +14 -8
  116. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  117. package/build/slot-fill/index.js +5 -0
  118. package/build/slot-fill/index.js.map +1 -1
  119. package/build/spinner/index.js +0 -1
  120. package/build/spinner/index.js.map +1 -1
  121. package/build/text/styles.js +7 -7
  122. package/build/text/styles.js.map +1 -1
  123. package/build/theme/index.js +0 -1
  124. package/build/theme/index.js.map +1 -1
  125. package/build/toggle-group-control/toggle-group-control/as-button-group.js +30 -45
  126. package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  127. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +40 -41
  128. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  129. package/build/toggle-group-control/toggle-group-control/component.js +10 -5
  130. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  131. package/build/toggle-group-control/toggle-group-control/styles.js +9 -16
  132. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  133. package/build/toggle-group-control/toggle-group-control/utils.js +44 -0
  134. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -0
  135. package/build/toggle-group-control/toggle-group-control-option-base/component.js +36 -17
  136. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  137. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +10 -8
  138. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  139. package/build/toggle-group-control/types.js.map +1 -1
  140. package/build/toolbar/toolbar/index.js +7 -1
  141. package/build/toolbar/toolbar/index.js.map +1 -1
  142. package/build/toolbar/toolbar-dropdown-menu/index.js +1 -3
  143. package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  144. package/build/toolbar/toolbar-group/index.js +16 -12
  145. package/build/toolbar/toolbar-group/index.js.map +1 -1
  146. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +0 -2
  147. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  148. package/build/toolbar/toolbar-group/toolbar-group-container.js +3 -1
  149. package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  150. package/build/toolbar/toolbar-group/types.js +6 -0
  151. package/build/toolbar/toolbar-group/types.js.map +1 -0
  152. package/build/toolbar/toolbar-item/index.js +1 -1
  153. package/build/toolbar/toolbar-item/index.js.map +1 -1
  154. package/build/tools-panel/tools-panel/component.js +0 -1
  155. package/build/tools-panel/tools-panel/component.js.map +1 -1
  156. package/build/tools-panel/tools-panel-header/component.js +5 -1
  157. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  158. package/build/tooltip/index.js +51 -225
  159. package/build/tooltip/index.js.map +1 -1
  160. package/build/tooltip/types.js +6 -0
  161. package/build/tooltip/types.js.map +1 -0
  162. package/build/tree-select/index.js +0 -1
  163. package/build/tree-select/index.js.map +1 -1
  164. package/build/ui/context/context-connect.js.map +1 -1
  165. package/build/ui/context/wordpress-component.js.map +1 -1
  166. package/build/unit-control/index.js +0 -1
  167. package/build/unit-control/index.js.map +1 -1
  168. package/build/unit-control/styles/unit-control-styles.js +7 -7
  169. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  170. package/build/utils/colors-values.js +1 -1
  171. package/build/utils/colors-values.js.map +1 -1
  172. package/build/utils/hooks/use-cx.js +2 -1
  173. package/build/utils/hooks/use-cx.js.map +1 -1
  174. package/build/utils/use-deprecated-props.js.map +1 -1
  175. package/build/view/component.js +1 -2
  176. package/build/view/component.js.map +1 -1
  177. package/build-module/animation/index.js +1 -1
  178. package/build-module/animation/index.js.map +1 -1
  179. package/build-module/border-control/border-control-dropdown/component.js +1 -1
  180. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  181. package/build-module/border-control/styles.js +20 -20
  182. package/build-module/border-control/styles.js.map +1 -1
  183. package/build-module/box-control/unit-control.js +1 -1
  184. package/build-module/box-control/unit-control.js.map +1 -1
  185. package/build-module/button/index.js +9 -1
  186. package/build-module/button/index.js.map +1 -1
  187. package/build-module/button/types.js.map +1 -1
  188. package/build-module/circular-option-picker/circular-option-picker-actions.js +44 -0
  189. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -0
  190. package/build-module/circular-option-picker/circular-option-picker-context.js +11 -0
  191. package/build-module/circular-option-picker/circular-option-picker-context.js.map +1 -0
  192. package/build-module/circular-option-picker/circular-option-picker-option-group.js +23 -0
  193. package/build-module/circular-option-picker/circular-option-picker-option-group.js.map +1 -0
  194. package/build-module/circular-option-picker/circular-option-picker-option.js +114 -0
  195. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -0
  196. package/build-module/circular-option-picker/circular-option-picker.js +165 -0
  197. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -0
  198. package/build-module/circular-option-picker/index.js +4 -132
  199. package/build-module/circular-option-picker/index.js.map +1 -1
  200. package/build-module/circular-option-picker/types.js.map +1 -1
  201. package/build-module/color-palette/index.js +58 -19
  202. package/build-module/color-palette/index.js.map +1 -1
  203. package/build-module/color-palette/types.js.map +1 -1
  204. package/build-module/color-picker/hsv-color-picker.native.js +84 -0
  205. package/build-module/color-picker/hsv-color-picker.native.js.map +1 -0
  206. package/build-module/color-picker/hue-picker.native.js +185 -0
  207. package/build-module/color-picker/hue-picker.native.js.map +1 -0
  208. package/build-module/color-picker/index.native.js +2 -1
  209. package/build-module/color-picker/index.native.js.map +1 -1
  210. package/build-module/color-picker/saturation-picker.native.js +168 -0
  211. package/build-module/color-picker/saturation-picker.native.js.map +1 -0
  212. package/build-module/combobox-control/index.js +0 -3
  213. package/build-module/combobox-control/index.js.map +1 -1
  214. package/build-module/composite/index.js +2 -0
  215. package/build-module/composite/index.js.map +1 -1
  216. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  217. package/build-module/date-time/time/timezone.js +1 -1
  218. package/build-module/date-time/time/timezone.js.map +1 -1
  219. package/build-module/dropdown/index.js +12 -24
  220. package/build-module/dropdown/index.js.map +1 -1
  221. package/build-module/dropdown/types.js.map +1 -1
  222. package/build-module/dropdown-menu/index.js +7 -1
  223. package/build-module/dropdown-menu/index.js.map +1 -1
  224. package/build-module/dropdown-menu/types.js.map +1 -1
  225. package/build-module/dropdown-menu-v2/styles.js +16 -16
  226. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  227. package/build-module/duotone-picker/color-list-picker/index.js +18 -3
  228. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  229. package/build-module/duotone-picker/duotone-picker.js +33 -1
  230. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  231. package/build-module/duotone-picker/types.js.map +1 -1
  232. package/build-module/focusable-iframe/index.js +2 -3
  233. package/build-module/focusable-iframe/index.js.map +1 -1
  234. package/build-module/focusable-iframe/types.js +2 -0
  235. package/build-module/focusable-iframe/types.js.map +1 -0
  236. package/build-module/form-token-field/index.js +6 -2
  237. package/build-module/form-token-field/index.js.map +1 -1
  238. package/build-module/form-token-field/types.js.map +1 -1
  239. package/build-module/gradient-picker/index.js +57 -15
  240. package/build-module/gradient-picker/index.js.map +1 -1
  241. package/build-module/gradient-picker/types.js.map +1 -1
  242. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  243. package/build-module/higher-order/with-focus-outside/index.js +1 -3
  244. package/build-module/higher-order/with-focus-outside/index.js.map +1 -1
  245. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  246. package/build-module/index.js +1 -1
  247. package/build-module/index.js.map +1 -1
  248. package/build-module/input-control/styles/input-control-styles.js +23 -23
  249. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  250. package/build-module/item-group/item/component.js +0 -1
  251. package/build-module/item-group/item/component.js.map +1 -1
  252. package/build-module/item-group/item-group/component.js +0 -1
  253. package/build-module/item-group/item-group/component.js.map +1 -1
  254. package/build-module/menu-item/index.js +4 -2
  255. package/build-module/menu-item/index.js.map +1 -1
  256. package/build-module/menu-item/types.js.map +1 -1
  257. package/build-module/mobile/bottom-sheet/index.native.js +1 -0
  258. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  259. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  260. package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -1
  261. package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  262. package/build-module/navigation/index.js +0 -1
  263. package/build-module/navigation/index.js.map +1 -1
  264. package/build-module/navigation/use-navigation-tree-nodes.js.map +1 -1
  265. package/build-module/navigator/navigator-provider/component.js +1 -2
  266. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  267. package/build-module/notice/index.js +19 -7
  268. package/build-module/notice/index.js.map +1 -1
  269. package/build-module/palette-edit/styles.js +10 -10
  270. package/build-module/palette-edit/styles.js.map +1 -1
  271. package/build-module/placeholder/index.js.map +1 -1
  272. package/build-module/popover/index.js +72 -155
  273. package/build-module/popover/index.js.map +1 -1
  274. package/build-module/popover/overlay-middlewares.js.map +1 -1
  275. package/build-module/popover/types.js.map +1 -1
  276. package/build-module/popover/utils.js +9 -83
  277. package/build-module/popover/utils.js.map +1 -1
  278. package/build-module/progress-bar/styles.js +6 -5
  279. package/build-module/progress-bar/styles.js.map +1 -1
  280. package/build-module/search-control/index.js +12 -3
  281. package/build-module/search-control/index.js.map +1 -1
  282. package/build-module/search-control/index.native.js +28 -25
  283. package/build-module/search-control/index.native.js.map +1 -1
  284. package/build-module/search-control/types.js.map +1 -1
  285. package/build-module/shortcut/index.js +13 -0
  286. package/build-module/shortcut/index.js.map +1 -1
  287. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +3 -1
  288. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  289. package/build-module/slot-fill/bubbles-virtually/slot.js +14 -8
  290. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  291. package/build-module/slot-fill/index.js +6 -1
  292. package/build-module/slot-fill/index.js.map +1 -1
  293. package/build-module/spinner/index.js +0 -1
  294. package/build-module/spinner/index.js.map +1 -1
  295. package/build-module/text/styles.js +7 -7
  296. package/build-module/text/styles.js.map +1 -1
  297. package/build-module/theme/index.js +0 -1
  298. package/build-module/theme/index.js.map +1 -1
  299. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +32 -47
  300. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  301. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +41 -42
  302. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  303. package/build-module/toggle-group-control/toggle-group-control/component.js +10 -6
  304. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  305. package/build-module/toggle-group-control/toggle-group-control/styles.js +8 -14
  306. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  307. package/build-module/toggle-group-control/toggle-group-control/utils.js +42 -0
  308. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -0
  309. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +35 -16
  310. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  311. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +8 -7
  312. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  313. package/build-module/toggle-group-control/types.js.map +1 -1
  314. package/build-module/toolbar/toolbar/index.js +7 -1
  315. package/build-module/toolbar/toolbar/index.js.map +1 -1
  316. package/build-module/toolbar/toolbar-dropdown-menu/index.js +5 -3
  317. package/build-module/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  318. package/build-module/toolbar/toolbar-group/index.js +15 -12
  319. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  320. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js +0 -2
  321. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  322. package/build-module/toolbar/toolbar-group/toolbar-group-container.js +3 -1
  323. package/build-module/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  324. package/build-module/toolbar/toolbar-group/types.js +2 -0
  325. package/build-module/toolbar/toolbar-group/types.js.map +1 -0
  326. package/build-module/toolbar/toolbar-item/index.js +1 -1
  327. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  328. package/build-module/tools-panel/tools-panel/component.js +0 -1
  329. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  330. package/build-module/tools-panel/tools-panel-header/component.js +5 -1
  331. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  332. package/build-module/tooltip/index.js +53 -224
  333. package/build-module/tooltip/index.js.map +1 -1
  334. package/build-module/tooltip/types.js +2 -0
  335. package/build-module/tooltip/types.js.map +1 -0
  336. package/build-module/tree-select/index.js +0 -1
  337. package/build-module/tree-select/index.js.map +1 -1
  338. package/build-module/ui/context/context-connect.js.map +1 -1
  339. package/build-module/ui/context/wordpress-component.js.map +1 -1
  340. package/build-module/unit-control/index.js +0 -1
  341. package/build-module/unit-control/index.js.map +1 -1
  342. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  343. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  344. package/build-module/utils/colors-values.js +1 -1
  345. package/build-module/utils/colors-values.js.map +1 -1
  346. package/build-module/utils/hooks/use-cx.js +2 -1
  347. package/build-module/utils/hooks/use-cx.js.map +1 -1
  348. package/build-module/utils/use-deprecated-props.js.map +1 -1
  349. package/build-module/view/component.js +1 -2
  350. package/build-module/view/component.js.map +1 -1
  351. package/build-style/style-rtl.css +35 -63
  352. package/build-style/style.css +35 -63
  353. package/build-types/alignment-matrix-control/stories/index.story.d.ts +2 -2
  354. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  355. package/build-types/angle-picker-control/stories/index.story.d.ts +2 -2
  356. package/build-types/angle-picker-control/stories/index.story.d.ts.map +1 -1
  357. package/build-types/animate/stories/index.story.d.ts +9 -9
  358. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  359. package/build-types/animation/index.d.ts +1 -1
  360. package/build-types/animation/index.d.ts.map +1 -1
  361. package/build-types/base-control/hooks.d.ts +1 -1
  362. package/build-types/base-control/stories/index.story.d.ts +4 -4
  363. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  364. package/build-types/border-box-control/border-box-control/component.d.ts +1 -1
  365. package/build-types/border-box-control/border-box-control/hook.d.ts +46 -46
  366. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +51 -51
  367. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +1 -1
  368. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +46 -46
  369. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +46 -46
  370. package/build-types/border-box-control/stories/index.story.d.ts +4 -4
  371. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  372. package/build-types/border-control/border-control/hook.d.ts +45 -45
  373. package/build-types/border-control/border-control-dropdown/hook.d.ts +45 -45
  374. package/build-types/border-control/border-control-style-picker/hook.d.ts +45 -45
  375. package/build-types/border-control/stories/index.story.d.ts +8 -8
  376. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  377. package/build-types/box-control/styles/box-control-styles.d.ts +1 -1
  378. package/build-types/button/deprecated.d.ts +16 -22
  379. package/build-types/button/deprecated.d.ts.map +1 -1
  380. package/build-types/button/index.d.ts.map +1 -1
  381. package/build-types/button/stories/e2e/index.story.d.ts +3 -3
  382. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  383. package/build-types/button/stories/index.story.d.ts +10 -9
  384. package/build-types/button/stories/index.story.d.ts.map +1 -1
  385. package/build-types/button/types.d.ts +0 -4
  386. package/build-types/button/types.d.ts.map +1 -1
  387. package/build-types/button-group/stories/index.story.d.ts +3 -3
  388. package/build-types/button-group/stories/index.story.d.ts.map +1 -1
  389. package/build-types/card/card/hook.d.ts +46 -46
  390. package/build-types/card/card-body/hook.d.ts +46 -46
  391. package/build-types/card/card-divider/hook.d.ts +47 -47
  392. package/build-types/card/card-footer/hook.d.ts +46 -46
  393. package/build-types/card/card-header/hook.d.ts +46 -46
  394. package/build-types/card/card-media/hook.d.ts +46 -46
  395. package/build-types/card/stories/index.story.d.ts +4 -4
  396. package/build-types/card/stories/index.story.d.ts.map +1 -1
  397. package/build-types/checkbox-control/stories/index.story.d.ts +4 -4
  398. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  399. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts +7 -0
  400. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -0
  401. package/build-types/circular-option-picker/circular-option-picker-context.d.ts +7 -0
  402. package/build-types/circular-option-picker/circular-option-picker-context.d.ts.map +1 -0
  403. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts +7 -0
  404. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts.map +1 -0
  405. package/build-types/circular-option-picker/circular-option-picker-option.d.ts +4 -0
  406. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -0
  407. package/build-types/circular-option-picker/circular-option-picker.d.ts +11 -0
  408. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -0
  409. package/build-types/circular-option-picker/index.d.ts +5 -56
  410. package/build-types/circular-option-picker/index.d.ts.map +1 -1
  411. package/build-types/circular-option-picker/stories/index.story.d.ts +5 -3
  412. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  413. package/build-types/circular-option-picker/test/index.d.ts +2 -0
  414. package/build-types/circular-option-picker/test/index.d.ts.map +1 -0
  415. package/build-types/circular-option-picker/types.d.ts +53 -1
  416. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  417. package/build-types/color-indicator/stories/index.story.d.ts +3 -3
  418. package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
  419. package/build-types/color-palette/index.d.ts +3 -19
  420. package/build-types/color-palette/index.d.ts.map +1 -1
  421. package/build-types/color-palette/stories/index.story.d.ts +6 -39
  422. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  423. package/build-types/color-palette/styles.d.ts +1 -1
  424. package/build-types/color-palette/types.d.ts +31 -1
  425. package/build-types/color-palette/types.d.ts.map +1 -1
  426. package/build-types/color-picker/component.d.ts +1 -1
  427. package/build-types/color-picker/stories/index.story.d.ts +3 -3
  428. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  429. package/build-types/color-picker/styles.d.ts +6 -6
  430. package/build-types/combobox-control/index.d.ts.map +1 -1
  431. package/build-types/combobox-control/stories/index.story.d.ts +4 -4
  432. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  433. package/build-types/composite/index.d.ts +14 -1
  434. package/build-types/composite/index.d.ts.map +1 -1
  435. package/build-types/custom-gradient-picker/stories/index.story.d.ts +2 -2
  436. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  437. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +2 -2
  438. package/build-types/date-time/date/styles.d.ts +3 -3
  439. package/build-types/date-time/date-time/styles.d.ts +2 -2
  440. package/build-types/date-time/stories/date-time.story.d.ts +5 -5
  441. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  442. package/build-types/date-time/stories/date.story.d.ts +5 -5
  443. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  444. package/build-types/date-time/stories/time.story.d.ts +3 -3
  445. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  446. package/build-types/date-time/time/styles.d.ts +12 -12
  447. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  448. package/build-types/disabled/stories/index.story.d.ts +4 -4
  449. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  450. package/build-types/divider/stories/index.story.d.ts +5 -5
  451. package/build-types/divider/stories/index.story.d.ts.map +1 -1
  452. package/build-types/draggable/stories/index.story.d.ts +4 -4
  453. package/build-types/draggable/stories/index.story.d.ts.map +1 -1
  454. package/build-types/drop-zone/stories/index.story.d.ts +2 -2
  455. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  456. package/build-types/dropdown/index.d.ts.map +1 -1
  457. package/build-types/dropdown/stories/index.story.d.ts +6 -5
  458. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  459. package/build-types/dropdown/types.d.ts +12 -4
  460. package/build-types/dropdown/types.d.ts.map +1 -1
  461. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  462. package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
  463. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  464. package/build-types/dropdown-menu/types.d.ts +22 -5
  465. package/build-types/dropdown-menu/types.d.ts.map +1 -1
  466. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +2 -2
  467. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  468. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  469. package/build-types/duotone-picker/duotone-picker.d.ts +1 -1
  470. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  471. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +2 -2
  472. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
  473. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +2 -2
  474. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
  475. package/build-types/duotone-picker/types.d.ts +31 -1
  476. package/build-types/duotone-picker/types.d.ts.map +1 -1
  477. package/build-types/elevation/hook.d.ts +46 -46
  478. package/build-types/elevation/stories/index.story.d.ts +5 -5
  479. package/build-types/elevation/stories/index.story.d.ts.map +1 -1
  480. package/build-types/external-link/stories/index.story.d.ts +3 -3
  481. package/build-types/external-link/stories/index.story.d.ts.map +1 -1
  482. package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
  483. package/build-types/flex/flex/hook.d.ts +46 -46
  484. package/build-types/flex/flex-block/hook.d.ts +46 -46
  485. package/build-types/flex/flex-item/hook.d.ts +46 -46
  486. package/build-types/flex/stories/index.story.d.ts +4 -4
  487. package/build-types/flex/stories/index.story.d.ts.map +1 -1
  488. package/build-types/focal-point-picker/stories/index.story.d.ts +10 -10
  489. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  490. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  491. package/build-types/focusable-iframe/index.d.ts +4 -5
  492. package/build-types/focusable-iframe/index.d.ts.map +1 -1
  493. package/build-types/focusable-iframe/types.d.ts +8 -0
  494. package/build-types/focusable-iframe/types.d.ts.map +1 -0
  495. package/build-types/font-size-picker/stories/e2e/index.story.d.ts +2 -2
  496. package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +1 -1
  497. package/build-types/font-size-picker/stories/index.story.d.ts +8 -8
  498. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  499. package/build-types/font-size-picker/styles.d.ts +2 -2
  500. package/build-types/form-file-upload/stories/index.story.d.ts +2 -2
  501. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  502. package/build-types/form-toggle/stories/index.story.d.ts +3 -3
  503. package/build-types/form-toggle/stories/index.story.d.ts.map +1 -1
  504. package/build-types/form-token-field/index.d.ts.map +1 -1
  505. package/build-types/form-token-field/stories/index.story.d.ts +7 -7
  506. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  507. package/build-types/form-token-field/types.d.ts +6 -0
  508. package/build-types/form-token-field/types.d.ts.map +1 -1
  509. package/build-types/gradient-picker/index.d.ts +1 -1
  510. package/build-types/gradient-picker/index.d.ts.map +1 -1
  511. package/build-types/gradient-picker/stories/index.story.d.ts +5 -38
  512. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  513. package/build-types/gradient-picker/types.d.ts +31 -1
  514. package/build-types/gradient-picker/types.d.ts.map +1 -1
  515. package/build-types/grid/hook.d.ts +46 -46
  516. package/build-types/grid/stories/index.story.d.ts +3 -3
  517. package/build-types/grid/stories/index.story.d.ts.map +1 -1
  518. package/build-types/guide/stories/index.story.d.ts +2 -2
  519. package/build-types/guide/stories/index.story.d.ts.map +1 -1
  520. package/build-types/h-stack/component.d.ts +1 -1
  521. package/build-types/h-stack/hook.d.ts +46 -46
  522. package/build-types/h-stack/stories/e2e/index.story.d.ts +3 -3
  523. package/build-types/h-stack/stories/e2e/index.story.d.ts.map +1 -1
  524. package/build-types/h-stack/stories/index.story.d.ts +3 -3
  525. package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
  526. package/build-types/heading/hook.d.ts +45 -45
  527. package/build-types/heading/stories/index.story.d.ts +3 -3
  528. package/build-types/heading/stories/index.story.d.ts.map +1 -1
  529. package/build-types/higher-order/navigate-regions/index.d.ts.map +1 -1
  530. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -0
  531. package/build-types/higher-order/with-focus-outside/index.d.ts.map +1 -1
  532. package/build-types/higher-order/with-focus-outside/test/index.d.ts +2 -0
  533. package/build-types/higher-order/with-focus-outside/test/index.d.ts.map +1 -0
  534. package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
  535. package/build-types/icon/stories/index.story.d.ts +4 -4
  536. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  537. package/build-types/index.d.ts +1 -1
  538. package/build-types/index.d.ts.map +1 -1
  539. package/build-types/input-control/stories/index.story.d.ts +2 -2
  540. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  541. package/build-types/isolated-event-container/test/index.d.ts +2 -0
  542. package/build-types/isolated-event-container/test/index.d.ts.map +1 -0
  543. package/build-types/item-group/item/component.d.ts +0 -1
  544. package/build-types/item-group/item/component.d.ts.map +1 -1
  545. package/build-types/item-group/item/hook.d.ts +46 -46
  546. package/build-types/item-group/item-group/component.d.ts +0 -1
  547. package/build-types/item-group/item-group/component.d.ts.map +1 -1
  548. package/build-types/item-group/item-group/hook.d.ts +46 -46
  549. package/build-types/item-group/stories/index.story.d.ts +6 -6
  550. package/build-types/item-group/stories/index.story.d.ts.map +1 -1
  551. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +2 -2
  552. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  553. package/build-types/menu-group/stories/index.story.d.ts +3 -3
  554. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  555. package/build-types/menu-item/index.d.ts +5 -58
  556. package/build-types/menu-item/index.d.ts.map +1 -1
  557. package/build-types/menu-item/stories/index.story.d.ts +74 -0
  558. package/build-types/menu-item/stories/index.story.d.ts.map +1 -0
  559. package/build-types/menu-item/types.d.ts +3 -2
  560. package/build-types/menu-item/types.d.ts.map +1 -1
  561. package/build-types/menu-items-choice/stories/index.story.d.ts +3 -3
  562. package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
  563. package/build-types/modal/stories/index.story.d.ts +4 -4
  564. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  565. package/build-types/navigable-container/menu.d.ts +1 -1
  566. package/build-types/navigable-container/stories/navigable-menu.story.d.ts +3 -3
  567. package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
  568. package/build-types/navigable-container/stories/tabbable-container.story.d.ts +3 -3
  569. package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
  570. package/build-types/navigation/back-button/index.d.ts +1 -1
  571. package/build-types/navigation/index.d.ts +0 -1
  572. package/build-types/navigation/index.d.ts.map +1 -1
  573. package/build-types/navigation/stories/index.story.d.ts +2 -2
  574. package/build-types/navigation/stories/index.story.d.ts.map +1 -1
  575. package/build-types/navigation/stories/utils/controlled-state.d.ts +2 -2
  576. package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -1
  577. package/build-types/navigation/stories/utils/default.d.ts +2 -2
  578. package/build-types/navigation/stories/utils/default.d.ts.map +1 -1
  579. package/build-types/navigation/stories/utils/group.d.ts +2 -2
  580. package/build-types/navigation/stories/utils/group.d.ts.map +1 -1
  581. package/build-types/navigation/stories/utils/hide-if-empty.d.ts +2 -2
  582. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -1
  583. package/build-types/navigation/stories/utils/more-examples.d.ts +2 -2
  584. package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -1
  585. package/build-types/navigation/stories/utils/search.d.ts +2 -2
  586. package/build-types/navigation/stories/utils/search.d.ts.map +1 -1
  587. package/build-types/navigation/styles/navigation-styles.d.ts +5 -3
  588. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  589. package/build-types/navigator/navigator-back-button/component.d.ts +2 -3
  590. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  591. package/build-types/navigator/navigator-back-button/hook.d.ts +53 -54
  592. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  593. package/build-types/navigator/navigator-button/component.d.ts +2 -3
  594. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  595. package/build-types/navigator/navigator-button/hook.d.ts +53 -54
  596. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  597. package/build-types/navigator/navigator-provider/component.d.ts +0 -1
  598. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  599. package/build-types/navigator/navigator-to-parent-button/component.d.ts +2 -3
  600. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  601. package/build-types/navigator/stories/index.story.d.ts +5 -5
  602. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  603. package/build-types/notice/index.d.ts.map +1 -1
  604. package/build-types/notice/stories/index.story.d.ts +3 -3
  605. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  606. package/build-types/number-control/index.d.ts +3 -3
  607. package/build-types/number-control/stories/index.story.d.ts +5 -5
  608. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  609. package/build-types/palette-edit/stories/index.story.d.ts +2 -2
  610. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  611. package/build-types/palette-edit/styles.d.ts +4 -4
  612. package/build-types/panel/stories/index.story.d.ts +6 -6
  613. package/build-types/panel/stories/index.story.d.ts.map +1 -1
  614. package/build-types/placeholder/index.d.ts.map +1 -1
  615. package/build-types/placeholder/stories/index.story.d.ts +3 -3
  616. package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
  617. package/build-types/popover/index.d.ts +1 -1
  618. package/build-types/popover/index.d.ts.map +1 -1
  619. package/build-types/popover/overlay-middlewares.d.ts +3 -3
  620. package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
  621. package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
  622. package/build-types/popover/stories/index.story.d.ts +7 -7
  623. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  624. package/build-types/popover/types.d.ts +6 -4
  625. package/build-types/popover/types.d.ts.map +1 -1
  626. package/build-types/popover/utils.d.ts +3 -27
  627. package/build-types/popover/utils.d.ts.map +1 -1
  628. package/build-types/progress-bar/stories/index.story.d.ts +3 -3
  629. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  630. package/build-types/progress-bar/styles.d.ts.map +1 -1
  631. package/build-types/query-controls/stories/index.story.d.ts +4 -4
  632. package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
  633. package/build-types/radio-control/stories/index.story.d.ts +3 -3
  634. package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
  635. package/build-types/range-control/index.d.ts +1 -1
  636. package/build-types/range-control/stories/index.story.d.ts +9 -9
  637. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  638. package/build-types/range-control/styles/range-control-styles.d.ts +3 -3
  639. package/build-types/resizable-box/index.d.ts +1 -1
  640. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  641. package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
  642. package/build-types/resizable-box/stories/index.story.d.ts +4 -4
  643. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  644. package/build-types/responsive-wrapper/stories/index.story.d.ts +3 -3
  645. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  646. package/build-types/sandbox/stories/index.story.d.ts +2 -2
  647. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  648. package/build-types/scroll-lock/stories/index.story.d.ts +3 -3
  649. package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
  650. package/build-types/scrollable/hook.d.ts +46 -46
  651. package/build-types/scrollable/stories/index.story.d.ts +3 -3
  652. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  653. package/build-types/search-control/index.d.ts +4 -2
  654. package/build-types/search-control/index.d.ts.map +1 -1
  655. package/build-types/search-control/stories/index.story.d.ts +10 -6
  656. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  657. package/build-types/search-control/types.d.ts +12 -0
  658. package/build-types/search-control/types.d.ts.map +1 -1
  659. package/build-types/select-control/stories/index.story.d.ts +2 -2
  660. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  661. package/build-types/shortcut/index.d.ts +13 -0
  662. package/build-types/shortcut/index.d.ts.map +1 -1
  663. package/build-types/shortcut/stories/index.story.d.ts +13 -0
  664. package/build-types/shortcut/stories/index.story.d.ts.map +1 -0
  665. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts +1 -0
  666. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
  667. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -6
  668. package/build-types/slot-fill/index.d.ts +1 -1
  669. package/build-types/slot-fill/index.d.ts.map +1 -1
  670. package/build-types/snackbar/stories/index.story.d.ts +7 -7
  671. package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
  672. package/build-types/snackbar/stories/list.story.d.ts +3 -3
  673. package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
  674. package/build-types/spacer/hook.d.ts +46 -46
  675. package/build-types/spacer/stories/index.story.d.ts +3 -3
  676. package/build-types/spacer/stories/index.story.d.ts.map +1 -1
  677. package/build-types/spinner/index.d.ts +1 -2
  678. package/build-types/spinner/index.d.ts.map +1 -1
  679. package/build-types/spinner/stories/index.story.d.ts +4 -4
  680. package/build-types/spinner/stories/index.story.d.ts.map +1 -1
  681. package/build-types/surface/hook.d.ts +46 -46
  682. package/build-types/surface/stories/index.story.d.ts +3 -3
  683. package/build-types/surface/stories/index.story.d.ts.map +1 -1
  684. package/build-types/tab-panel/stories/index.story.d.ts +2 -2
  685. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  686. package/build-types/text/hook.d.ts +46 -46
  687. package/build-types/text/styles.d.ts.map +1 -1
  688. package/build-types/text-control/index.d.ts +3 -3
  689. package/build-types/text-control/stories/index.story.d.ts +4 -4
  690. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  691. package/build-types/text-highlight/stories/index.story.d.ts +3 -3
  692. package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
  693. package/build-types/textarea-control/stories/index.story.d.ts +3 -3
  694. package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
  695. package/build-types/theme/index.d.ts +0 -1
  696. package/build-types/theme/index.d.ts.map +1 -1
  697. package/build-types/theme/stories/index.story.d.ts +4 -4
  698. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  699. package/build-types/tip/stories/index.story.d.ts +3 -3
  700. package/build-types/tip/stories/index.story.d.ts.map +1 -1
  701. package/build-types/toggle-control/stories/index.story.d.ts +4 -4
  702. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  703. package/build-types/toggle-group-control/stories/index.story.d.ts +6 -6
  704. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  705. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +2 -4
  706. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  707. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +2 -4
  708. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  709. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +2 -2
  710. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  711. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -5
  712. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  713. package/build-types/toggle-group-control/toggle-group-control/utils.d.ts +18 -0
  714. package/build-types/toggle-group-control/toggle-group-control/utils.d.ts.map +1 -0
  715. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -1
  716. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +5 -1
  717. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  718. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +1 -0
  719. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  720. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  721. package/build-types/toggle-group-control/types.d.ts +13 -24
  722. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  723. package/build-types/toolbar/stories/index.story.d.ts +2 -2
  724. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  725. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  726. package/build-types/toolbar/toolbar-button/index.d.ts +16 -22
  727. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  728. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +3 -1
  729. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts.map +1 -1
  730. package/build-types/toolbar/toolbar-group/index.d.ts +10 -14
  731. package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -1
  732. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts +3 -5
  733. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -1
  734. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +7 -5
  735. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -1
  736. package/build-types/toolbar/toolbar-group/types.d.ts +77 -0
  737. package/build-types/toolbar/toolbar-group/types.d.ts.map +1 -0
  738. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  739. package/build-types/tools-panel/stories/index.story.d.ts +8 -8
  740. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  741. package/build-types/tools-panel/tools-panel/component.d.ts +0 -1
  742. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  743. package/build-types/tools-panel/tools-panel/hook.d.ts +46 -46
  744. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  745. package/build-types/tools-panel/tools-panel-header/hook.d.ts +46 -46
  746. package/build-types/tools-panel/tools-panel-item/hook.d.ts +46 -46
  747. package/build-types/tooltip/index.d.ts +8 -5
  748. package/build-types/tooltip/index.d.ts.map +1 -1
  749. package/build-types/tooltip/stories/index.story.d.ts +13 -0
  750. package/build-types/tooltip/stories/index.story.d.ts.map +1 -0
  751. package/build-types/tooltip/test/index.d.ts +2 -0
  752. package/build-types/tooltip/test/index.d.ts.map +1 -0
  753. package/build-types/tooltip/test/utils/index.d.ts +11 -0
  754. package/build-types/tooltip/test/utils/index.d.ts.map +1 -0
  755. package/build-types/tooltip/types.d.ts +61 -0
  756. package/build-types/tooltip/types.d.ts.map +1 -0
  757. package/build-types/tree-grid/stories/index.story.d.ts +2 -2
  758. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  759. package/build-types/tree-select/index.d.ts +0 -1
  760. package/build-types/tree-select/index.d.ts.map +1 -1
  761. package/build-types/tree-select/stories/index.story.d.ts +2 -2
  762. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  763. package/build-types/truncate/hook.d.ts +46 -46
  764. package/build-types/truncate/stories/index.story.d.ts +4 -4
  765. package/build-types/truncate/stories/index.story.d.ts.map +1 -1
  766. package/build-types/ui/tooltip/content.d.ts +1 -1
  767. package/build-types/unit-control/index.d.ts +1 -2
  768. package/build-types/unit-control/index.d.ts.map +1 -1
  769. package/build-types/unit-control/stories/index.story.d.ts +7 -7
  770. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  771. package/build-types/unit-control/styles/unit-control-styles.d.ts +3 -3
  772. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  773. package/build-types/unit-control/unit-select-control.d.ts +1 -1
  774. package/build-types/utils/hooks/use-cx.d.ts +2 -1
  775. package/build-types/utils/hooks/use-cx.d.ts.map +1 -1
  776. package/build-types/utils/use-deprecated-props.d.ts +1 -1
  777. package/build-types/v-stack/component.d.ts +1 -1
  778. package/build-types/v-stack/hook.d.ts +46 -46
  779. package/build-types/v-stack/stories/e2e/index.story.d.ts +3 -3
  780. package/build-types/v-stack/stories/e2e/index.story.d.ts.map +1 -1
  781. package/build-types/v-stack/stories/index.story.d.ts +4 -4
  782. package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
  783. package/build-types/view/component.d.ts +0 -1
  784. package/build-types/view/component.d.ts.map +1 -1
  785. package/build-types/view/stories/index.story.d.ts +3 -3
  786. package/build-types/view/stories/index.story.d.ts.map +1 -1
  787. package/build-types/visually-hidden/stories/index.story.d.ts +5 -5
  788. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
  789. package/build-types/z-stack/stories/index.story.d.ts +3 -3
  790. package/build-types/z-stack/stories/index.story.d.ts.map +1 -1
  791. package/package.json +20 -20
  792. package/src/alignment-matrix-control/stories/index.story.tsx +7 -3
  793. package/src/angle-picker-control/stories/index.story.tsx +3 -3
  794. package/src/animate/stories/index.story.tsx +12 -10
  795. package/src/animation/index.tsx +1 -0
  796. package/src/base-control/stories/index.story.tsx +5 -9
  797. package/src/border-box-control/stories/index.story.tsx +5 -9
  798. package/src/border-control/border-control/README.md +2 -2
  799. package/src/border-control/border-control-dropdown/component.tsx +1 -1
  800. package/src/border-control/stories/index.story.tsx +8 -14
  801. package/src/border-control/styles.ts +7 -7
  802. package/src/border-control/test/index.js +79 -69
  803. package/src/box-control/unit-control.tsx +1 -1
  804. package/src/button/README.md +0 -6
  805. package/src/button/index.tsx +9 -1
  806. package/src/button/stories/e2e/index.story.tsx +3 -3
  807. package/src/button/stories/index.story.tsx +10 -10
  808. package/src/button/test/index.tsx +19 -0
  809. package/src/button/types.ts +0 -4
  810. package/src/button-group/stories/index.story.tsx +4 -6
  811. package/src/card/stories/index.story.tsx +5 -5
  812. package/src/checkbox-control/stories/index.story.tsx +7 -6
  813. package/src/circular-option-picker/README.md +14 -0
  814. package/src/circular-option-picker/circular-option-picker-actions.tsx +60 -0
  815. package/src/circular-option-picker/circular-option-picker-context.tsx +12 -0
  816. package/src/circular-option-picker/circular-option-picker-option-group.tsx +34 -0
  817. package/src/circular-option-picker/circular-option-picker-option.tsx +139 -0
  818. package/src/circular-option-picker/circular-option-picker.tsx +202 -0
  819. package/src/circular-option-picker/index.tsx +7 -174
  820. package/src/circular-option-picker/stories/index.story.tsx +42 -5
  821. package/src/circular-option-picker/style.scss +11 -7
  822. package/src/circular-option-picker/test/index.tsx +133 -0
  823. package/src/circular-option-picker/types.ts +64 -1
  824. package/src/color-indicator/stories/index.story.tsx +4 -6
  825. package/src/color-palette/README.md +14 -0
  826. package/src/color-palette/index.tsx +69 -28
  827. package/src/color-palette/stories/index.story.tsx +24 -19
  828. package/src/color-palette/test/index.tsx +32 -30
  829. package/src/color-palette/types.ts +34 -1
  830. package/src/color-picker/hsv-color-picker.native.js +88 -0
  831. package/src/color-picker/hue-picker.native.js +194 -0
  832. package/src/color-picker/index.native.js +2 -1
  833. package/src/color-picker/saturation-picker.native.js +163 -0
  834. package/src/color-picker/stories/index.story.tsx +3 -3
  835. package/src/color-picker/style.native.scss +23 -0
  836. package/src/combobox-control/index.tsx +7 -5
  837. package/src/combobox-control/stories/index.story.tsx +3 -3
  838. package/src/composite/{index.js → index.ts} +3 -0
  839. package/src/confirm-dialog/stories/index.story.js +13 -14
  840. package/src/confirm-dialog/test/index.js +10 -18
  841. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +1 -1
  842. package/src/custom-gradient-picker/gradient-bar/test/utils.ts +5 -5
  843. package/src/custom-gradient-picker/stories/index.story.tsx +3 -3
  844. package/src/date-time/stories/date-time.story.tsx +8 -10
  845. package/src/date-time/stories/date.story.tsx +8 -9
  846. package/src/date-time/stories/time.story.tsx +4 -4
  847. package/src/date-time/time/timezone.tsx +1 -1
  848. package/src/dimension-control/stories/index.story.tsx +3 -3
  849. package/src/disabled/stories/index.story.tsx +4 -4
  850. package/src/divider/stories/index.story.tsx +6 -6
  851. package/src/draggable/stories/index.story.tsx +5 -7
  852. package/src/drop-zone/stories/index.story.tsx +3 -3
  853. package/src/dropdown/README.md +13 -3
  854. package/src/dropdown/index.tsx +16 -34
  855. package/src/dropdown/stories/index.story.tsx +17 -12
  856. package/src/dropdown/types.ts +12 -4
  857. package/src/dropdown-menu/README.md +18 -0
  858. package/src/dropdown-menu/index.tsx +8 -1
  859. package/src/dropdown-menu/stories/index.story.tsx +8 -3
  860. package/src/dropdown-menu/types.ts +23 -6
  861. package/src/dropdown-menu-v2/stories/index.story.tsx +24 -10
  862. package/src/dropdown-menu-v2/styles.ts +1 -1
  863. package/src/duotone-picker/README.md +14 -0
  864. package/src/duotone-picker/color-list-picker/index.tsx +28 -12
  865. package/src/duotone-picker/duotone-picker.tsx +33 -0
  866. package/src/duotone-picker/stories/duotone-picker.story.tsx +3 -6
  867. package/src/duotone-picker/stories/duotone-swatch.story.tsx +3 -3
  868. package/src/duotone-picker/types.ts +34 -1
  869. package/src/elevation/stories/index.story.tsx +7 -7
  870. package/src/external-link/stories/index.story.tsx +4 -6
  871. package/src/flex/stories/index.story.tsx +6 -6
  872. package/src/focal-point-picker/stories/index.story.tsx +3 -3
  873. package/src/focusable-iframe/{index.js → index.tsx} +7 -4
  874. package/src/focusable-iframe/types.ts +9 -0
  875. package/src/font-size-picker/stories/e2e/index.story.tsx +3 -3
  876. package/src/font-size-picker/stories/index.story.tsx +10 -10
  877. package/src/form-file-upload/stories/index.story.tsx +3 -3
  878. package/src/form-toggle/stories/index.story.tsx +4 -7
  879. package/src/form-token-field/README.md +1 -0
  880. package/src/form-token-field/index.tsx +5 -1
  881. package/src/form-token-field/stories/index.story.tsx +10 -11
  882. package/src/form-token-field/style.scss +5 -9
  883. package/src/form-token-field/test/index.tsx +36 -1
  884. package/src/form-token-field/types.ts +7 -1
  885. package/src/gradient-picker/README.md +14 -0
  886. package/src/gradient-picker/index.tsx +60 -11
  887. package/src/gradient-picker/stories/index.story.tsx +3 -3
  888. package/src/gradient-picker/types.ts +34 -1
  889. package/src/grid/stories/index.story.tsx +4 -4
  890. package/src/guide/stories/index.story.tsx +3 -3
  891. package/src/h-stack/stories/e2e/index.story.tsx +4 -4
  892. package/src/h-stack/stories/index.story.tsx +4 -4
  893. package/src/heading/stories/index.story.tsx +3 -3
  894. package/src/higher-order/navigate-regions/index.tsx +5 -6
  895. package/src/higher-order/with-filters/test/index.tsx +36 -43
  896. package/src/higher-order/with-focus-outside/{index.js → index.tsx} +8 -5
  897. package/src/higher-order/with-focus-outside/test/{index.js → index.tsx} +13 -11
  898. package/src/higher-order/with-notices/test/index.tsx +1 -1
  899. package/src/higher-order/with-spoken-messages/index.tsx +7 -8
  900. package/src/icon/stories/index.story.tsx +5 -5
  901. package/src/index.ts +5 -1
  902. package/src/input-control/stories/index.story.tsx +5 -3
  903. package/src/input-control/styles/input-control-styles.tsx +2 -2
  904. package/src/isolated-event-container/test/{index.js → index.tsx} +1 -1
  905. package/src/item-group/item/component.tsx +0 -1
  906. package/src/item-group/item-group/component.tsx +0 -1
  907. package/src/item-group/stories/index.story.tsx +11 -12
  908. package/src/keyboard-shortcuts/stories/index.story.tsx +3 -3
  909. package/src/menu-group/stories/index.story.tsx +5 -5
  910. package/src/menu-item/README.md +1 -1
  911. package/src/menu-item/index.tsx +5 -2
  912. package/src/menu-item/stories/index.story.tsx +80 -0
  913. package/src/menu-item/types.ts +3 -2
  914. package/src/menu-items-choice/stories/index.story.tsx +4 -6
  915. package/src/mobile/bottom-sheet/index.native.js +1 -0
  916. package/src/mobile/global-styles-context/index.native.js +7 -8
  917. package/src/mobile/link-settings/link-settings-navigation.native.js +1 -1
  918. package/src/modal/stories/index.story.tsx +5 -10
  919. package/src/modal/test/index.tsx +107 -0
  920. package/src/navigable-container/stories/navigable-menu.story.tsx +3 -3
  921. package/src/navigable-container/stories/tabbable-container.story.tsx +3 -3
  922. package/src/navigation/index.tsx +0 -1
  923. package/src/navigation/stories/index.story.tsx +16 -2
  924. package/src/navigation/stories/utils/controlled-state.tsx +2 -2
  925. package/src/navigation/stories/utils/default.tsx +2 -2
  926. package/src/navigation/stories/utils/group.tsx +2 -2
  927. package/src/navigation/stories/utils/hide-if-empty.tsx +2 -2
  928. package/src/navigation/stories/utils/more-examples.tsx +2 -2
  929. package/src/navigation/stories/utils/search.tsx +2 -2
  930. package/src/navigation/use-navigation-tree-nodes.tsx +1 -1
  931. package/src/navigator/navigator-provider/component.tsx +0 -1
  932. package/src/navigator/stories/index.story.tsx +9 -10
  933. package/src/notice/index.tsx +18 -6
  934. package/src/notice/stories/index.story.tsx +6 -6
  935. package/src/notice/style.scss +0 -1
  936. package/src/notice/test/__snapshots__/index.tsx.snap +9 -1
  937. package/src/number-control/stories/index.story.tsx +3 -3
  938. package/src/palette-edit/stories/index.story.tsx +3 -3
  939. package/src/palette-edit/styles.js +2 -2
  940. package/src/panel/stories/index.story.tsx +9 -11
  941. package/src/placeholder/index.tsx +1 -0
  942. package/src/placeholder/stories/index.story.tsx +4 -6
  943. package/src/placeholder/style.scss +2 -4
  944. package/src/popover/README.md +2 -2
  945. package/src/popover/index.tsx +106 -203
  946. package/src/popover/overlay-middlewares.tsx +2 -2
  947. package/src/popover/stories/index.story.tsx +8 -10
  948. package/src/popover/test/index.tsx +18 -4
  949. package/src/popover/types.ts +6 -5
  950. package/src/popover/utils.ts +19 -118
  951. package/src/progress-bar/stories/index.story.tsx +4 -6
  952. package/src/progress-bar/styles.ts +4 -1
  953. package/src/query-controls/stories/index.story.tsx +5 -6
  954. package/src/radio-control/stories/index.story.tsx +4 -6
  955. package/src/radio-group/stories/index.story.js +1 -0
  956. package/src/range-control/stories/index.story.tsx +12 -18
  957. package/src/resizable-box/stories/index.story.tsx +3 -3
  958. package/src/responsive-wrapper/stories/index.story.tsx +4 -5
  959. package/src/sandbox/stories/index.story.tsx +3 -5
  960. package/src/scroll-lock/stories/index.story.tsx +3 -3
  961. package/src/scrollable/stories/index.story.tsx +4 -4
  962. package/src/search-control/README.md +7 -0
  963. package/src/search-control/index.native.js +39 -27
  964. package/src/search-control/index.tsx +10 -1
  965. package/src/search-control/stories/index.story.tsx +3 -3
  966. package/src/search-control/style.scss +14 -7
  967. package/src/search-control/types.ts +12 -0
  968. package/src/select-control/stories/index.story.tsx +3 -3
  969. package/src/shortcut/index.tsx +13 -0
  970. package/src/shortcut/stories/index.story.tsx +33 -0
  971. package/src/slot-fill/README.md +5 -5
  972. package/src/slot-fill/bubbles-virtually/slot-fill-context.js +3 -0
  973. package/src/slot-fill/bubbles-virtually/slot.js +17 -5
  974. package/src/slot-fill/index.js +6 -1
  975. package/src/slot-fill/stories/index.story.js +2 -0
  976. package/src/slot-fill/test/__snapshots__/slot.js.snap +12 -4
  977. package/src/snackbar/stories/index.story.tsx +10 -13
  978. package/src/snackbar/stories/list.story.tsx +3 -3
  979. package/src/spacer/stories/index.story.tsx +4 -4
  980. package/src/spinner/index.tsx +0 -1
  981. package/src/spinner/stories/index.story.tsx +5 -5
  982. package/src/surface/stories/index.story.tsx +4 -4
  983. package/src/tab-panel/stories/index.story.tsx +5 -13
  984. package/src/tab-panel/test/index.tsx +14 -25
  985. package/src/text/styles.js +2 -1
  986. package/src/text-control/stories/index.story.tsx +7 -6
  987. package/src/text-highlight/stories/index.story.tsx +4 -6
  988. package/src/textarea-control/stories/index.story.tsx +4 -6
  989. package/src/theme/README.md +5 -5
  990. package/src/theme/index.tsx +0 -1
  991. package/src/theme/stories/index.story.tsx +5 -5
  992. package/src/tip/stories/index.story.tsx +4 -4
  993. package/src/toggle-control/stories/index.story.tsx +3 -3
  994. package/src/toggle-group-control/stories/index.story.tsx +17 -11
  995. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +567 -59
  996. package/src/toggle-group-control/test/index.tsx +110 -56
  997. package/src/toggle-group-control/toggle-group-control/README.md +0 -1
  998. package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +39 -57
  999. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +52 -48
  1000. package/src/toggle-group-control/toggle-group-control/component.tsx +12 -6
  1001. package/src/toggle-group-control/toggle-group-control/styles.ts +2 -19
  1002. package/src/toggle-group-control/toggle-group-control/utils.ts +50 -0
  1003. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +70 -20
  1004. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +17 -3
  1005. package/src/toggle-group-control/types.ts +14 -32
  1006. package/src/toolbar/stories/index.story.tsx +16 -8
  1007. package/src/toolbar/test/toolbar-group.tsx +13 -7
  1008. package/src/toolbar/toolbar/index.tsx +9 -1
  1009. package/src/toolbar/toolbar-dropdown-menu/{index.js → index.tsx} +11 -4
  1010. package/src/toolbar/toolbar-group/README.md +2 -2
  1011. package/src/toolbar/toolbar-group/{index.js → index.tsx} +19 -14
  1012. package/src/toolbar/toolbar-group/{toolbar-group-collapsed.js → toolbar-group-collapsed.tsx} +10 -4
  1013. package/src/toolbar/toolbar-group/toolbar-group-container.tsx +16 -0
  1014. package/src/toolbar/toolbar-group/types.ts +92 -0
  1015. package/src/toolbar/toolbar-item/index.tsx +3 -1
  1016. package/src/tools-panel/stories/index.story.tsx +17 -12
  1017. package/src/tools-panel/tools-panel/component.tsx +0 -1
  1018. package/src/tools-panel/tools-panel-header/component.tsx +3 -0
  1019. package/src/tooltip/README.md +31 -28
  1020. package/src/tooltip/index.tsx +106 -0
  1021. package/src/tooltip/stories/index.story.tsx +59 -0
  1022. package/src/tooltip/style.scss +2 -27
  1023. package/src/tooltip/test/index.tsx +335 -0
  1024. package/src/tooltip/test/utils/index.tsx +20 -0
  1025. package/src/tooltip/types.ts +61 -0
  1026. package/src/tree-grid/stories/index.story.tsx +5 -3
  1027. package/src/tree-select/index.tsx +0 -1
  1028. package/src/tree-select/stories/index.story.tsx +3 -3
  1029. package/src/truncate/stories/index.story.tsx +5 -7
  1030. package/src/ui/context/context-connect.ts +3 -3
  1031. package/src/ui/context/wordpress-component.ts +4 -4
  1032. package/src/unit-control/index.tsx +9 -5
  1033. package/src/unit-control/stories/index.story.tsx +10 -9
  1034. package/src/unit-control/styles/unit-control-styles.ts +3 -1
  1035. package/src/unit-control/test/utils.ts +1 -1
  1036. package/src/utils/colors-values.js +1 -1
  1037. package/src/utils/hooks/use-cx.ts +2 -1
  1038. package/src/utils/use-deprecated-props.ts +1 -1
  1039. package/src/v-stack/stories/e2e/index.story.tsx +4 -4
  1040. package/src/v-stack/stories/index.story.tsx +3 -3
  1041. package/src/view/component.tsx +0 -1
  1042. package/src/view/stories/index.story.tsx +4 -4
  1043. package/src/visually-hidden/stories/index.story.tsx +7 -7
  1044. package/src/z-stack/stories/index.story.tsx +4 -4
  1045. package/tsconfig.tsbuildinfo +1 -1
  1046. package/build/popover/limit-shift.js +0 -129
  1047. package/build/popover/limit-shift.js.map +0 -1
  1048. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +0 -78
  1049. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +0 -1
  1050. package/build-module/popover/limit-shift.js +0 -122
  1051. package/build-module/popover/limit-shift.js.map +0 -1
  1052. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js +0 -76
  1053. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +0 -1
  1054. package/build-types/popover/limit-shift.d.ts +0 -87
  1055. package/build-types/popover/limit-shift.d.ts.map +0 -1
  1056. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts +0 -9
  1057. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +0 -1
  1058. package/src/color-palette/test/__snapshots__/index.tsx.snap +0 -288
  1059. package/src/popover/limit-shift.ts +0 -205
  1060. package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +0 -84
  1061. package/src/toolbar/toolbar-group/toolbar-group-container.js +0 -8
  1062. package/src/tooltip/index.js +0 -293
  1063. package/src/tooltip/stories/index.story.js +0 -85
  1064. package/src/tooltip/test/index.js +0 -323
@@ -1 +1 @@
1
- {"version":3,"names":["css","COLORS","CONFIG","boxSizingReset","rtl","space","StyledLabel","ValueInput","UnitControlWrapper","UnitSelect","labelStyles","process","env","NODE_ENV","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","focusBoxShadow","borderWidth","ui","borderFocus","borderControl","innerWrapper","wrapperWidth","wrapperHeight","size","borderControlDropdown","borderRadius","border","colorIndicatorBorder","color","style","fallbackColor","gray","undefined","colorIndicatorWrapper","swatchSize","swatchGap","borderControlPopoverControls","borderControlPopoverContent","borderColorIndicator","resetButton","borderControlStylePicker","borderStyleButton","borderSlider","marginRight"],"sources":["@wordpress/components/src/border-control/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG, boxSizingReset, rtl } from '../utils';\nimport { space } from '../ui/utils/space';\nimport { StyledLabel } from '../base-control/styles/base-control-styles';\nimport {\n\tValueInput as UnitControlWrapper,\n\tUnitSelect,\n} from '../unit-control/styles/unit-control-styles';\n\nimport type { Border } from './types';\n\nconst labelStyles = css`\n\tfont-weight: 500;\n`;\n\nconst focusBoxShadow = css`\n\tbox-shadow: inset 0 0 0 ${ CONFIG.borderWidth } ${ COLORS.ui.borderFocus };\n`;\n\nexport const borderControl = css`\n\tborder: 0;\n\tpadding: 0;\n\tmargin: 0;\n\t${ boxSizingReset }\n`;\n\nexport const innerWrapper = () => css`\n\t${ UnitControlWrapper } {\n\t\tflex: 1 1 40%;\n\t}\n\t&& ${ UnitSelect } {\n\t\t/* Prevent unit select forcing min height larger than its UnitControl */\n\t\tmin-height: 0;\n\t}\n`;\n\n/*\n * This style is only applied to the UnitControl wrapper when the border width\n * field should be a set width. Omitting this allows the UnitControl &\n * RangeControl to share the available width in a 40/60 split respectively.\n */\nexport const wrapperWidth = css`\n\t${ UnitControlWrapper } {\n\t\t/* Force the UnitControl's set width. */\n\t\tflex: 0 0 auto;\n\t}\n`;\n\nexport const wrapperHeight = ( size?: 'default' | '__unstable-large' ) => {\n\treturn css`\n\t\theight: ${ size === '__unstable-large' ? '40px' : '30px' };\n\t`;\n};\n\nexport const borderControlDropdown = (\n\tsize?: 'default' | '__unstable-large'\n) => css`\n\tbackground: #fff;\n\n\t&& > button {\n\t\t/*\n\t\t * Override button component styles to fit within BorderControl\n\t\t * regardless of size.\n\t\t */\n\t\theight: ${ size === '__unstable-large' ? '40px' : '30px' };\n\t\twidth: ${ size === '__unstable-large' ? '40px' : '30px' };\n\t\tpadding: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\t${ rtl(\n\t\t\t{ borderRadius: `2px 0 0 2px` },\n\t\t\t{ borderRadius: `0 2px 2px 0` }\n\t\t)() }\n\t\tborder: ${ CONFIG.borderWidth } solid ${ COLORS.ui.border };\n\n\t\t&:focus,\n\t\t&:hover:not( :disabled ) {\n\t\t\t${ focusBoxShadow }\n\t\t\tborder-color: ${ COLORS.ui.borderFocus };\n\t\t\tz-index: 1;\n\t\t\tposition: relative;\n\t\t}\n\t}\n`;\n\nexport const colorIndicatorBorder = ( border?: Border ) => {\n\tconst { color, style } = border || {};\n\n\tconst fallbackColor =\n\t\t!! style && style !== 'none' ? COLORS.gray[ 300 ] : undefined;\n\n\treturn css`\n\t\tborder-style: ${ style === 'none' ? 'solid' : style };\n\t\tborder-color: ${ color || fallbackColor };\n\t`;\n};\n\nexport const colorIndicatorWrapper = (\n\tborder?: Border,\n\tsize?: 'default' | '__unstable-large'\n) => {\n\tconst { style } = border || {};\n\n\treturn css`\n\t\tborder-radius: 9999px;\n\t\tborder: 2px solid transparent;\n\t\t${ style ? colorIndicatorBorder( border ) : undefined }\n\t\twidth: ${ size === '__unstable-large' ? '24px' : '22px' };\n\t\theight: ${ size === '__unstable-large' ? '24px' : '22px' };\n\t\tpadding: ${ size === '__unstable-large' ? '2px' : '1px' };\n\n\t\t/*\n\t\t * ColorIndicator\n\t\t *\n\t\t * The transparent colors used here ensure visibility of the indicator\n\t\t * over the active state of the border control dropdown's toggle button.\n\t\t */\n\t\t& > span {\n\t\t\theight: ${ space( 4 ) };\n\t\t\twidth: ${ space( 4 ) };\n\t\t\tbackground: linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);\n\t\t}\n\t`;\n};\n\n// Must equal $color-palette-circle-size from:\n// @wordpress/components/src/circular-option-picker/style.scss\nconst swatchSize = 28;\nconst swatchGap = 12;\n\nexport const borderControlPopoverControls = css`\n\twidth: ${ swatchSize * 6 + swatchGap * 5 }px;\n\n\t> div:first-of-type > ${ StyledLabel } {\n\t\tmargin-bottom: 0;\n\t\t${ labelStyles }\n\t}\n\n\t&& ${ StyledLabel } + button:not( .has-text ) {\n\t\tmin-width: 24px;\n\t\tpadding: 0;\n\t}\n`;\n\nexport const borderControlPopoverContent = css``;\nexport const borderColorIndicator = css``;\n\nexport const resetButton = css`\n\tjustify-content: center;\n\twidth: 100%;\n\n\t/* Override button component styling */\n\t&& {\n\t\tborder-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 200 ] };\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t\theight: 46px;\n\t}\n`;\n\nexport const borderControlStylePicker = css`\n\t${ StyledLabel } {\n\t\t${ labelStyles }\n\t}\n`;\n\nexport const borderStyleButton = css`\n\t&&&&& {\n\t\tmin-width: 30px;\n\t\twidth: 30px;\n\t\theight: 30px;\n\t\tpadding: 3px;\n\t}\n`;\n\nexport const borderSlider = () => css`\n\tflex: 1 1 60%;\n\t${ rtl( { marginRight: space( 3 ) } )() }\n`;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,GAAG,QAAQ,gBAAgB;;AAEpC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,MAAM,EAAEC,cAAc,EAAEC,GAAG,QAAQ,UAAU;AAC9D,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,WAAW,QAAQ,4CAA4C;AACx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AED,OAAO,MAAM4B,YAAY,GAAGA,CAAA,kBAAM9C,GAAG,kBAEjCI,GAAG,CAAE;EAAE2C,WAAW,EAAE1C,KAAK,CAAE,CAAE;AAAE,CAAE,CAAC,CAAC,CAAC,SAAAM,OAAA,CAAAC,GAAA,CAAAC,QAAA,kDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,moNACvC"}
1
+ {"version":3,"names":["css","COLORS","CONFIG","boxSizingReset","rtl","space","StyledLabel","ValueInput","UnitControlWrapper","UnitSelect","labelStyles","process","env","NODE_ENV","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","focusBoxShadow","controlBoxShadowFocus","borderControl","innerWrapper","wrapperWidth","wrapperHeight","size","borderControlDropdown","borderRadius","borderWidth","ui","border","borderFocus","colorIndicatorBorder","color","style","fallbackColor","gray","undefined","colorIndicatorWrapper","swatchSize","swatchGap","borderControlPopoverControls","borderControlPopoverContent","borderColorIndicator","resetButton","borderControlStylePicker","borderStyleButton","borderSlider","marginRight"],"sources":["@wordpress/components/src/border-control/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG, boxSizingReset, rtl } from '../utils';\nimport { space } from '../ui/utils/space';\nimport { StyledLabel } from '../base-control/styles/base-control-styles';\nimport {\n\tValueInput as UnitControlWrapper,\n\tUnitSelect,\n} from '../unit-control/styles/unit-control-styles';\n\nimport type { Border } from './types';\n\nconst labelStyles = css`\n\tfont-weight: 500;\n`;\n\nconst focusBoxShadow = css`\n\tbox-shadow: inset ${ CONFIG.controlBoxShadowFocus };\n`;\n\nexport const borderControl = css`\n\tborder: 0;\n\tpadding: 0;\n\tmargin: 0;\n\t${ boxSizingReset }\n`;\n\nexport const innerWrapper = () => css`\n\t${ UnitControlWrapper } {\n\t\tflex: 1 1 40%;\n\t}\n\t&& ${ UnitSelect } {\n\t\t/* Prevent unit select forcing min height larger than its UnitControl */\n\t\tmin-height: 0;\n\t}\n`;\n\n/*\n * This style is only applied to the UnitControl wrapper when the border width\n * field should be a set width. Omitting this allows the UnitControl &\n * RangeControl to share the available width in a 40/60 split respectively.\n */\nexport const wrapperWidth = css`\n\t${ UnitControlWrapper } {\n\t\t/* Force the UnitControl's set width. */\n\t\tflex: 0 0 auto;\n\t}\n`;\n\nexport const wrapperHeight = ( size?: 'default' | '__unstable-large' ) => {\n\treturn css`\n\t\theight: ${ size === '__unstable-large' ? '40px' : '30px' };\n\t`;\n};\n\nexport const borderControlDropdown = (\n\tsize?: 'default' | '__unstable-large'\n) => css`\n\tbackground: #fff;\n\n\t&& > button {\n\t\t/*\n\t\t * Override button component styles to fit within BorderControl\n\t\t * regardless of size.\n\t\t */\n\t\theight: ${ size === '__unstable-large' ? '40px' : '30px' };\n\t\twidth: ${ size === '__unstable-large' ? '40px' : '30px' };\n\t\tpadding: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\t${ rtl(\n\t\t\t{ borderRadius: `2px 0 0 2px` },\n\t\t\t{ borderRadius: `0 2px 2px 0` }\n\t\t)() }\n\t\tborder: ${ CONFIG.borderWidth } solid ${ COLORS.ui.border };\n\n\t\t&:focus,\n\t\t&:hover:not( :disabled ) {\n\t\t\t${ focusBoxShadow }\n\t\t\tborder-color: ${ COLORS.ui.borderFocus };\n\t\t\tz-index: 1;\n\t\t\tposition: relative;\n\t\t}\n\t}\n`;\n\nexport const colorIndicatorBorder = ( border?: Border ) => {\n\tconst { color, style } = border || {};\n\n\tconst fallbackColor =\n\t\t!! style && style !== 'none' ? COLORS.gray[ 300 ] : undefined;\n\n\treturn css`\n\t\tborder-style: ${ style === 'none' ? 'solid' : style };\n\t\tborder-color: ${ color || fallbackColor };\n\t`;\n};\n\nexport const colorIndicatorWrapper = (\n\tborder?: Border,\n\tsize?: 'default' | '__unstable-large'\n) => {\n\tconst { style } = border || {};\n\n\treturn css`\n\t\tborder-radius: 9999px;\n\t\tborder: 2px solid transparent;\n\t\t${ style ? colorIndicatorBorder( border ) : undefined }\n\t\twidth: ${ size === '__unstable-large' ? '24px' : '22px' };\n\t\theight: ${ size === '__unstable-large' ? '24px' : '22px' };\n\t\tpadding: ${ size === '__unstable-large' ? '2px' : '1px' };\n\n\t\t/*\n\t\t * ColorIndicator\n\t\t *\n\t\t * The transparent colors used here ensure visibility of the indicator\n\t\t * over the active state of the border control dropdown's toggle button.\n\t\t */\n\t\t& > span {\n\t\t\theight: ${ space( 4 ) };\n\t\t\twidth: ${ space( 4 ) };\n\t\t\tbackground: linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);\n\t\t}\n\t`;\n};\n\n// Must equal $color-palette-circle-size from:\n// @wordpress/components/src/circular-option-picker/style.scss\nconst swatchSize = 28;\nconst swatchGap = 12;\n\nexport const borderControlPopoverControls = css`\n\twidth: ${ swatchSize * 6 + swatchGap * 5 }px;\n\n\t> div:first-of-type > ${ StyledLabel } {\n\t\tmargin-bottom: 0;\n\t\t${ labelStyles }\n\t}\n\n\t&& ${ StyledLabel } + button:not( .has-text ) {\n\t\tmin-width: 24px;\n\t\tpadding: 0;\n\t}\n`;\n\nexport const borderControlPopoverContent = css``;\nexport const borderColorIndicator = css``;\n\nexport const resetButton = css`\n\tjustify-content: center;\n\twidth: 100%;\n\n\t/* Override button component styling */\n\t&& {\n\t\tborder-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 400 ] };\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t\theight: 40px;\n\t}\n`;\n\nexport const borderControlStylePicker = css`\n\t${ StyledLabel } {\n\t\t${ labelStyles }\n\t}\n`;\n\nexport const borderStyleButton = css`\n\t&&&&& {\n\t\tmin-width: 32px;\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tpadding: 4px;\n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ACVI,WAAW,UAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,8DAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,umNAEf;AAED,OAAO,MAAMiC,iBAAiB,GAAAnC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,CAO7B;AAED,OAAO,MAAM6B,YAAY,GAAGA,CAAA,kBAAM/C,GAAG,kBAEjCI,GAAG,CAAE;EAAE4C,WAAW,EAAE3C,KAAK,CAAE,CAAE;AAAE,CAAE,CAAC,CAAC,CAAC,SAAAM,OAAA,CAAAC,GAAA,CAAAC,QAAA,kDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,umNACvC"}
@@ -62,7 +62,7 @@ function Tooltip({
62
62
  */
63
63
  return createElement(BaseTooltip, {
64
64
  text: text,
65
- position: "top"
65
+ placement: "top"
66
66
  }, createElement("div", null, children));
67
67
  }
68
68
  //# sourceMappingURL=unit-control.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useHover","BaseTooltip","UnitControlWrapper","UnitControl","noop","BoxUnitControl","isFirst","isLast","isOnly","onHoverOn","onHoverOff","label","value","props","bindHoverGesture","event","state","hovering","createElement","Tooltip","text","className","isPressEnterToChange","isResetValueOnUnitChange","children","position"],"sources":["@wordpress/components/src/box-control/unit-control.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useHover } from '@use-gesture/react';\n\n/**\n * Internal dependencies\n */\nimport BaseTooltip from '../tooltip';\nimport { UnitControlWrapper, UnitControl } from './styles/box-control-styles';\nimport type { BoxUnitControlProps } from './types';\n\nconst noop = () => {};\n\nexport default function BoxUnitControl( {\n\tisFirst,\n\tisLast,\n\tisOnly,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tlabel,\n\tvalue,\n\t...props\n}: BoxUnitControlProps ) {\n\tconst bindHoverGesture = useHover( ( { event, ...state } ) => {\n\t\tif ( state.hovering ) {\n\t\t\tonHoverOn( event, state );\n\t\t} else {\n\t\t\tonHoverOff( event, state );\n\t\t}\n\t} );\n\n\treturn (\n\t\t<UnitControlWrapper { ...bindHoverGesture() }>\n\t\t\t<Tooltip text={ label }>\n\t\t\t\t<UnitControl\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\tisFirst={ isFirst }\n\t\t\t\t\tisLast={ isLast }\n\t\t\t\t\tisOnly={ isOnly }\n\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\tisResetValueOnUnitChange={ false }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t</UnitControlWrapper>\n\t);\n}\n\nfunction Tooltip( {\n\tchildren,\n\ttext,\n}: {\n\tchildren: JSX.Element;\n\ttext?: string;\n} ) {\n\tif ( ! text ) return children;\n\n\t/**\n\t * Wrapping the children in a `<div />` as Tooltip as it attempts\n\t * to render the <UnitControl />. Using a plain `<div />` appears to\n\t * resolve this issue.\n\t *\n\t * Originally discovered and referenced here:\n\t * https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026\n\t */\n\treturn (\n\t\t<BaseTooltip text={ text } position=\"top\">\n\t\t\t<div>{ children }</div>\n\t\t</BaseTooltip>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,OAAOC,WAAW,MAAM,YAAY;AACpC,SAASC,kBAAkB,EAAEC,WAAW,QAAQ,6BAA6B;AAG7E,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,eAAe,SAASC,cAAcA,CAAE;EACvCC,OAAO;EACPC,MAAM;EACNC,MAAM;EACNC,SAAS,GAAGL,IAAI;EAChBM,UAAU,GAAGN,IAAI;EACjBO,KAAK;EACLC,KAAK;EACL,GAAGC;AACiB,CAAC,EAAG;EACxB,MAAMC,gBAAgB,GAAGd,QAAQ,CAAE,CAAE;IAAEe,KAAK;IAAE,GAAGC;EAAM,CAAC,KAAM;IAC7D,IAAKA,KAAK,CAACC,QAAQ,EAAG;MACrBR,SAAS,CAAEM,KAAK,EAAEC,KAAM,CAAC;IAC1B,CAAC,MAAM;MACNN,UAAU,CAAEK,KAAK,EAAEC,KAAM,CAAC;IAC3B;EACD,CAAE,CAAC;EAEH,OACCE,aAAA,CAAChB,kBAAkB;IAAA,GAAMY,gBAAgB,CAAC;EAAC,GAC1CI,aAAA,CAACC,OAAO;IAACC,IAAI,EAAGT;EAAO,GACtBO,aAAA,CAACf,WAAW;IACX,cAAaQ,KAAO;IACpBU,SAAS,EAAC,qCAAqC;IAC/Cf,OAAO,EAAGA,OAAS;IACnBC,MAAM,EAAGA,MAAQ;IACjBC,MAAM,EAAGA,MAAQ;IACjBc,oBAAoB;IACpBC,wBAAwB,EAAG,KAAO;IAClCX,KAAK,EAAGA,KAAO;IAAA,GACVC;EAAK,CACV,CACO,CACU,CAAC;AAEvB;AAEA,SAASM,OAAOA,CAAE;EACjBK,QAAQ;EACRJ;AAID,CAAC,EAAG;EACH,IAAK,CAAEA,IAAI,EAAG,OAAOI,QAAQ;;EAE7B;AACD;AACA;AACA;AACA;AACA;AACA;AACA;EACC,OACCN,aAAA,CAACjB,WAAW;IAACmB,IAAI,EAAGA,IAAM;IAACK,QAAQ,EAAC;EAAK,GACxCP,aAAA,cAAOM,QAAe,CACV,CAAC;AAEhB"}
1
+ {"version":3,"names":["useHover","BaseTooltip","UnitControlWrapper","UnitControl","noop","BoxUnitControl","isFirst","isLast","isOnly","onHoverOn","onHoverOff","label","value","props","bindHoverGesture","event","state","hovering","createElement","Tooltip","text","className","isPressEnterToChange","isResetValueOnUnitChange","children","placement"],"sources":["@wordpress/components/src/box-control/unit-control.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useHover } from '@use-gesture/react';\n\n/**\n * Internal dependencies\n */\nimport BaseTooltip from '../tooltip';\nimport { UnitControlWrapper, UnitControl } from './styles/box-control-styles';\nimport type { BoxUnitControlProps } from './types';\n\nconst noop = () => {};\n\nexport default function BoxUnitControl( {\n\tisFirst,\n\tisLast,\n\tisOnly,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tlabel,\n\tvalue,\n\t...props\n}: BoxUnitControlProps ) {\n\tconst bindHoverGesture = useHover( ( { event, ...state } ) => {\n\t\tif ( state.hovering ) {\n\t\t\tonHoverOn( event, state );\n\t\t} else {\n\t\t\tonHoverOff( event, state );\n\t\t}\n\t} );\n\n\treturn (\n\t\t<UnitControlWrapper { ...bindHoverGesture() }>\n\t\t\t<Tooltip text={ label }>\n\t\t\t\t<UnitControl\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\tisFirst={ isFirst }\n\t\t\t\t\tisLast={ isLast }\n\t\t\t\t\tisOnly={ isOnly }\n\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\tisResetValueOnUnitChange={ false }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t</UnitControlWrapper>\n\t);\n}\n\nfunction Tooltip( {\n\tchildren,\n\ttext,\n}: {\n\tchildren: JSX.Element;\n\ttext?: string;\n} ) {\n\tif ( ! text ) return children;\n\n\t/**\n\t * Wrapping the children in a `<div />` as Tooltip as it attempts\n\t * to render the <UnitControl />. Using a plain `<div />` appears to\n\t * resolve this issue.\n\t *\n\t * Originally discovered and referenced here:\n\t * https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026\n\t */\n\treturn (\n\t\t<BaseTooltip text={ text } placement=\"top\">\n\t\t\t<div>{ children }</div>\n\t\t</BaseTooltip>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,OAAOC,WAAW,MAAM,YAAY;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{ useInstanceId } from '@wordpress/compose';
16
16
  import Tooltip from '../tooltip';
17
17
  import Icon from '../icon';
18
18
  import { VisuallyHidden } from '../visually-hidden';
19
+ import { positionToPlacement } from '../popover/utils';
19
20
  const disabledEventsOnDisabledButton = ['onMouseDown', 'onClick'];
20
21
  function useDeprecatedProps({
21
22
  isDefault,
@@ -177,6 +178,13 @@ export function UnforwardedButton(props, ref) {
177
178
  ...additionalProps,
178
179
  ...commonProps
179
180
  }, elementChildren);
181
+
182
+ // Convert legacy `position` values to be used with the new `placement` prop
183
+ let computedPlacement;
184
+ // if `tooltipPosition` is defined, compute value to `placement`
185
+ if (tooltipPosition !== undefined) {
186
+ computedPlacement = positionToPlacement(tooltipPosition);
187
+ }
180
188
  if (!shouldShowTooltip) {
181
189
  return createElement(Fragment, null, element, describedBy && createElement(VisuallyHidden, null, createElement("span", {
182
190
  id: descriptionId
@@ -185,7 +193,7 @@ export function UnforwardedButton(props, ref) {
185
193
  return createElement(Fragment, null, createElement(Tooltip, {
186
194
  text: children?.length && describedBy ? describedBy : label,
187
195
  shortcut: shortcut,
188
- position: tooltipPosition
196
+ placement: computedPlacement
189
197
  }, element), describedBy && createElement(VisuallyHidden, null, createElement("span", {
190
198
  id: descriptionId
191
199
  }, describedBy)));
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","deprecated","forwardRef","useInstanceId","Tooltip","Icon","VisuallyHidden","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isSmall","size","variant","otherProps","computedSize","computedVariant","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","since","alternative","version","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isPressed","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","buttonOrAnchorProps","href","target","additionalProps","undefined","instanceId","Button","hasChildren","Array","isArray","classes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","createElement","Fragment","element","id","position"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisSmall,\n\tsize,\n\tvariant,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tif ( isSmall ) {\n\t\tcomputedSize ??= 'small';\n\t}\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'Button isDefault prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...otherProps,\n\t\tsize: computedSize,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function UnforwardedButton(\n\tprops: ButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tisPressed,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\tsize = 'default',\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...buttonOrAnchorProps\n\t} = useDeprecatedProps( props );\n\n\tconst { href, target, ...additionalProps } =\n\t\t'href' in buttonOrAnchorProps\n\t\t\t? buttonOrAnchorProps\n\t\t\t: { href: undefined, target: undefined, ...buttonOrAnchorProps };\n\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst hasChildren =\n\t\t( 'string' === typeof children && !! children ) ||\n\t\t( Array.isArray( children ) &&\n\t\t\tchildren?.[ 0 ] &&\n\t\t\tchildren[ 0 ] !== null &&\n\t\t\t// Tooltip should not considered as a child\n\t\t\tchildren?.[ 0 ]?.props?.className !== 'components-tooltip' );\n\n\tconst classes = classnames( 'components-button', className, {\n\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': size === 'small',\n\t\t'is-compact': size === 'compact',\n\t\t'is-tertiary': variant === 'tertiary',\n\t\t'is-pressed': isPressed,\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && hasChildren,\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst buttonProps: ComponentPropsWithoutRef< 'button' > =\n\t\tTag === 'button'\n\t\t\t? {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-pressed': isPressed,\n\t\t\t }\n\t\t\t: {};\n\tconst anchorProps: ComponentPropsWithoutRef< 'a' > =\n\t\tTag === 'a' ? { href, target } : {};\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\tbuttonProps[ 'aria-disabled' ] = true;\n\t\tanchorProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event: MouseEvent ) => {\n\t\t\t\tif ( event ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t! ( children as string | ReactElement[] )?.length &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : undefined;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst commonProps = {\n\t\tclassName: classes,\n\t\t'aria-label': additionalProps[ 'aria-label' ] || label,\n\t\t'aria-describedby': describedById,\n\t\tref,\n\t};\n\n\tconst elementChildren = (\n\t\t<>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ children }\n\t\t</>\n\t);\n\n\tconst element =\n\t\tTag === 'a' ? (\n\t\t\t<a\n\t\t\t\t{ ...anchorProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLAnchorElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\t{ ...buttonProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLButtonElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</button>\n\t\t);\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ element }\n\t\t\t\t{ describedBy && (\n\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip\n\t\t\t\ttext={\n\t\t\t\t\t( children as string | ReactElement[] )?.length &&\n\t\t\t\t\tdescribedBy\n\t\t\t\t\t\t? describedBy\n\t\t\t\t\t\t: label\n\t\t\t\t}\n\t\t\t\tshortcut={ shortcut }\n\t\t\t\tposition={ tooltipPosition }\n\t\t\t>\n\t\t\t\t{ element }\n\t\t\t</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef( UnforwardedButton );\nexport default Button;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,U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ACR;EAEF,IAAK,CAAEL,iBAAiB,EAAG;IAC1B,OACCM,aAAA,CAAAC,QAAA,QACGC,OAAO,EACP7B,WAAW,IACZ2B,aAAA,CAACtE,cAAc,QACdsE,aAAA;MAAMG,EAAE,EAAGP;IAAe,GAAGvB,WAAmB,CACjC,CAEhB,CAAC;EAEL;EAEA,OACC2B,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACxE,OAAO;IACP0C,IAAI,EACDD,QAAQ,EAA+B0B,MAAM,IAC/CtB,WAAW,GACRA,WAAW,GACXL,KACH;IACDD,QAAQ,EAAGA,QAAU;IACrBqC,QAAQ,EAAGtC;EAAiB,GAE1BoC,OACM,CAAC,EACR7B,WAAW,IACZ2B,aAAA,CAACtE,cAAc,QACdsE,aAAA;IAAMG,EAAE,EAAGP;EAAe,GAAGvB,WAAmB,CACjC,CAEhB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMO,MAAM,GAAGtD,UAAU,CAAE2B,iBAAkB,CAAC;AACrD,eAAe2B,MAAM"}
1
+ {"version":3,"names":["classnames","deprecated","forwardRef","useInstanceId","Tooltip","Icon","VisuallyHidden","positionToPlacement","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isSmall","size","variant","otherProps","computedSize","computedVariant","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","since","alternative","version","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isPressed","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","buttonOrAnchorProps","href","target","additionalProps","undefined","instanceId","Button","hasChildren","Array","isArray","classes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","createElement","Fragment","element","computedPlacement","id","placement"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\nimport { positionToPlacement } from '../popover/utils';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisSmall,\n\tsize,\n\tvariant,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tif ( isSmall ) {\n\t\tcomputedSize ??= 'small';\n\t}\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'Button isDefault prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...otherProps,\n\t\tsize: computedSize,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function UnforwardedButton(\n\tprops: ButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tisPressed,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\tsize = 'default',\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...buttonOrAnchorProps\n\t} = useDeprecatedProps( props );\n\n\tconst { href, target, ...additionalProps } =\n\t\t'href' in buttonOrAnchorProps\n\t\t\t? buttonOrAnchorProps\n\t\t\t: { href: undefined, target: undefined, ...buttonOrAnchorProps };\n\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst hasChildren =\n\t\t( 'string' === typeof children && !! children ) ||\n\t\t( Array.isArray( children ) &&\n\t\t\tchildren?.[ 0 ] &&\n\t\t\tchildren[ 0 ] !== null &&\n\t\t\t// Tooltip should not considered as a child\n\t\t\tchildren?.[ 0 ]?.props?.className !== 'components-tooltip' );\n\n\tconst classes = classnames( 'components-button', className, {\n\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': size === 'small',\n\t\t'is-compact': size === 'compact',\n\t\t'is-tertiary': variant === 'tertiary',\n\t\t'is-pressed': isPressed,\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && hasChildren,\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst buttonProps: ComponentPropsWithoutRef< 'button' > =\n\t\tTag === 'button'\n\t\t\t? {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-pressed': isPressed,\n\t\t\t }\n\t\t\t: {};\n\tconst anchorProps: ComponentPropsWithoutRef< 'a' > =\n\t\tTag === 'a' ? { href, target } : {};\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\tbuttonProps[ 'aria-disabled' ] = true;\n\t\tanchorProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event: MouseEvent ) => {\n\t\t\t\tif ( event ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t! ( children as string | ReactElement[] )?.length &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : undefined;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst commonProps = {\n\t\tclassName: classes,\n\t\t'aria-label': additionalProps[ 'aria-label' ] || label,\n\t\t'aria-describedby': describedById,\n\t\tref,\n\t};\n\n\tconst elementChildren = (\n\t\t<>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ children }\n\t\t</>\n\t);\n\n\tconst element =\n\t\tTag === 'a' ? (\n\t\t\t<a\n\t\t\t\t{ ...anchorProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLAnchorElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\t{ ...buttonProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLButtonElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</button>\n\t\t);\n\n\t// Convert legacy `position` values to be used with the new `placement` prop\n\tlet computedPlacement;\n\t// if `tooltipPosition` is defined, compute value to `placement`\n\tif ( tooltipPosition !== undefined ) {\n\t\tcomputedPlacement = positionToPlacement( tooltipPosition );\n\t}\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ element }\n\t\t\t\t{ describedBy && (\n\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip\n\t\t\t\ttext={\n\t\t\t\t\t( children as string | ReactElement[] )?.length &&\n\t\t\t\t\tdescribedBy\n\t\t\t\t\t\t? describedBy\n\t\t\t\t\t\t: label\n\t\t\t\t}\n\t\t\t\tshortcut={ shortcut }\n\t\t\t\tplacement={ computedPlacement }\n\t\t\t>\n\t\t\t\t{ element }\n\t\t\t</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef( UnforwardedButton );\nexport default Button;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AASnC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SAASC,mBAAmB,QAAQ,kBAAkB;AAEtD,MAAMC,8BAA8B,GAAG,CAAE,aAAa,EAAE,SAAS,CAAW;AAE5E,SAASC,kBAAkBA,CAAE;EAC5BC,SAAS;EACTC,SAAS;EACTC,WAAW;EACXC,UAAU;EACVC,MAAM;EACNC,OAAO;EACPC,IAAI;EACJC,OAAO;EACP,GAAGC;AACiC,CAAC,EAAgB;EACrD,IAAIC,YAAY,GAAGH,IAAI;EACvB,IAAII,eAAe,GAAGH,OAAO;EAE7B,IAAKF,OAAO,EAAG;IAAA,IAAAM,aAAA;IACd,CAAAA,aAAA,GAAAF,YAAY,cAAAE,aAAA,cAAAA,aAAA,GAAZF,YAAY,GAAK,OAAO;EACzB;EAEA,IAAKR,SAAS,EAAG;IAAA,IAAAW,gBAAA;IAChB,CAAAA,gBAAA,GAAAF,eAAe,cAAAE,gBAAA,cAAAA,gBAAA,GAAfF,eAAe,GAAK,SAAS;EAC9B;EAEA,IAAKP,UAAU,EAAG;IAAA,IAAAU,iBAAA;IACjB,CAAAA,iBAAA,GAAAH,eAAe,cAAAG,iBAAA,cAAAA,iBAAA,GAAfH,eAAe,GAAK,UAAU;EAC/B;EAEA,IAAKR,WAAW,EAAG;IAAA,IAAAY,iBAAA;IAClB,CAAAA,iBAAA,GAAAJ,eAAe,cAAAI,iBAAA,cAAAA,iBAAA,GAAfJ,eAAe,GAAK,WAAW;EAChC;EAEA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AAA,GACTZ,eAAe;IAAA,GACjBqB;EAAW,GAEdC,eACA,CAAC,GAEJC,aAAA;IAAA,GACMb,WAAW;IAAA,GACTV,eAAe;IAAA,GACjBqB;EAAW,GAEdC,eACK,CACR;;EAEF;EACA,IAAII,iBAAiB;EACrB;EACA,IAAKrC,eAAe,KAAKY,SAAS,EAAG;IACpCyB,iBAAiB,GAAGzE,mBAAmB,CAAEoC,eAAgB,CAAC;EAC3D;EAEA,IAAK,CAAE4B,iBAAiB,EAAG;IAC1B,OACCM,aAAA,CAAAC,QAAA,QACGC,OAAO,EACP7B,WAAW,IACZ2B,aAAA,CAACvE,cAAc,QACduE,aAAA;MAAMI,EAAE,EAAGR;IAAe,GAAGvB,WAAmB,CACjC,CAEhB,CAAC;EAEL;EAEA,OACC2B,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACzE,OAAO;IACP2C,IAAI,EACDD,QAAQ,EAA+B0B,MAAM,IAC/CtB,WAAW,GACRA,WAAW,GACXL,KACH;IACDD,QAAQ,EAAGA,QAAU;IACrBsC,SAAS,EAAGF;EAAmB,GAE7BD,OACM,CAAC,EACR7B,WAAW,IACZ2B,aAAA,CAACvE,cAAc,QACduE,aAAA;IAAMI,EAAE,EAAGR;EAAe,GAAGvB,WAAmB,CACjC,CAEhB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMO,MAAM,GAAGvD,UAAU,CAAE4B,iBAAkB,CAAC;AACrD,eAAe2B,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/button/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Props as IconProps } from '../icon';\nimport type { PopoverProps } from '../popover/types';\nimport type { WordPressComponentProps } from '../ui/context/wordpress-component';\n\nexport type ButtonProps =\n\t| WordPressComponentProps< ButtonAsButtonProps, 'button', false >\n\t| WordPressComponentProps< ButtonAsAnchorProps, 'a', false >;\n\nexport type ButtonAsButtonProps = BaseButtonProps & _ButtonProps;\nexport type ButtonAsAnchorProps = BaseButtonProps & AnchorProps;\n\ntype BaseButtonProps = {\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * The button's children.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An accessible description for the button.\n\t */\n\tdescribedBy?: string;\n\t/**\n\t * Whether the button is focused.\n\t */\n\tfocus?: boolean;\n\t/**\n\t * If provided, renders an Icon component inside the button.\n\t */\n\ticon?: IconProps[ 'icon' ];\n\t/**\n\t * If provided with `icon`, sets the position of icon relative to the `text`.\n\t *\n\t * @default 'left'\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * If provided with `icon`, sets the icon size.\n\t * Please refer to the Icon component for more details regarding\n\t * the default value of its `size` prop.\n\t */\n\ticonSize?: IconProps[ 'size' ];\n\t/**\n\t * Indicates activity while a action is being performed.\n\t */\n\tisBusy?: boolean;\n\t/**\n\t * Renders a red text-based button style to indicate destructive behavior.\n\t */\n\tisDestructive?: boolean;\n\t/**\n\t * Renders a pressed button style.\n\t */\n\tisPressed?: boolean;\n\t// TODO: Deprecate officially (add console warning and move to DeprecatedButtonProps).\n\t/**\n\t * Decreases the size of the button.\n\t *\n\t * Deprecated in favor of the `size` prop. If both props are defined, the `size` prop will take precedence.\n\t *\n\t * @deprecated Use the `'small'` value on the `size` prop instead.\n\t */\n\tisSmall?: boolean;\n\t/**\n\t * Sets the `aria-label` of the component, if none is provided.\n\t * Sets the Tooltip content if `showTooltip` is provided.\n\t */\n\tlabel?: string;\n\t/**\n\t * If provided with `showTooltip`, appends the Shortcut label to the tooltip content.\n\t * If an object is provided, it should contain `display` and `ariaLabel` keys.\n\t */\n\tshortcut?: string | { display: string; ariaLabel: string };\n\t/**\n\t * If provided, renders a Tooltip component for the button.\n\t */\n\tshowTooltip?: boolean;\n\t/**\n\t * The size of the button.\n\t *\n\t * - `'default'`: For normal text-label buttons, unless it is a toggle button.\n\t * - `'compact'`: For toggle buttons, icon buttons, and buttons when used in context of either.\n\t * - `'small'`: For icon buttons associated with more advanced or auxiliary features.\n\t *\n\t * If the deprecated `isSmall` prop is also defined, this prop will take precedence.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'compact' | 'small';\n\t/**\n\t * If provided, displays the given text inside the button. If the button contains children elements, the text is displayed before them.\n\t */\n\ttext?: string;\n\t/**\n\t * If provided with `showTooltip`, sets the position of the tooltip.\n\t * Please refer to the Tooltip component for more details regarding the defaults.\n\t */\n\ttooltipPosition?: PopoverProps[ 'position' ];\n\t/**\n\t * Specifies the button's style.\n\t * The accepted values are:\n\t * 'primary' (the primary button styles)\n\t * 'secondary' (the default button styles)\n\t * 'tertiary' (the text-based button styles)\n\t * 'link' (the link button styles)\n\t */\n\tvariant?: 'primary' | 'secondary' | 'tertiary' | 'link';\n\t/**\n\t * Whether this is focusable.\n\t */\n\t__experimentalIsFocusable?: boolean;\n};\n\ntype _ButtonProps = {\n\t/**\n\t * Whether the button is disabled.\n\t * If `true`, this will force a `button` element to be rendered.\n\t */\n\tdisabled?: boolean;\n};\n\ntype AnchorProps = {\n\t/**\n\t * Whether the button is disabled.\n\t * If `true`, this will force a `button` element to be rendered.\n\t */\n\tdisabled?: false;\n\t/**\n\t * If provided, renders `a` instead of `button`.\n\t */\n\thref: string;\n\t/**\n\t * If provided with `href`, sets the `target` attribute to the `a`.\n\t */\n\ttarget?: string;\n};\n\nexport type DeprecatedButtonProps = {\n\tisDefault?: boolean;\n\tisLink?: boolean;\n\tisPrimary?: boolean;\n\tisSecondary?: boolean;\n\tisTertiary?: boolean;\n};\n\nexport type DeprecatedIconButtonProps = {\n\tlabelPosition: ButtonProps[ 'tooltipPosition' ];\n\tshowTooltip?: boolean;\n\tsize: ButtonProps[ 'iconSize' ];\n\tlabel: ButtonProps[ 'label' ];\n\ttooltip: ButtonProps[ 'label' ];\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/button/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Props as IconProps } from '../icon';\nimport type { PopoverProps } from '../popover/types';\nimport type { WordPressComponentProps } from '../ui/context/wordpress-component';\n\nexport type ButtonProps =\n\t| WordPressComponentProps< ButtonAsButtonProps, 'button', false >\n\t| WordPressComponentProps< ButtonAsAnchorProps, 'a', false >;\n\nexport type ButtonAsButtonProps = BaseButtonProps & _ButtonProps;\nexport type ButtonAsAnchorProps = BaseButtonProps & AnchorProps;\n\ntype BaseButtonProps = {\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * The button's children.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An accessible description for the button.\n\t */\n\tdescribedBy?: string;\n\t/**\n\t * If provided, renders an Icon component inside the button.\n\t */\n\ticon?: IconProps[ 'icon' ];\n\t/**\n\t * If provided with `icon`, sets the position of icon relative to the `text`.\n\t *\n\t * @default 'left'\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * If provided with `icon`, sets the icon size.\n\t * Please refer to the Icon component for more details regarding\n\t * the default value of its `size` prop.\n\t */\n\ticonSize?: IconProps[ 'size' ];\n\t/**\n\t * Indicates activity while a action is being performed.\n\t */\n\tisBusy?: boolean;\n\t/**\n\t * Renders a red text-based button style to indicate destructive behavior.\n\t */\n\tisDestructive?: boolean;\n\t/**\n\t * Renders a pressed button style.\n\t */\n\tisPressed?: boolean;\n\t// TODO: Deprecate officially (add console warning and move to DeprecatedButtonProps).\n\t/**\n\t * Decreases the size of the button.\n\t *\n\t * Deprecated in favor of the `size` prop. If both props are defined, the `size` prop will take precedence.\n\t *\n\t * @deprecated Use the `'small'` value on the `size` prop instead.\n\t */\n\tisSmall?: boolean;\n\t/**\n\t * Sets the `aria-label` of the component, if none is provided.\n\t * Sets the Tooltip content if `showTooltip` is provided.\n\t */\n\tlabel?: string;\n\t/**\n\t * If provided with `showTooltip`, appends the Shortcut label to the tooltip content.\n\t * If an object is provided, it should contain `display` and `ariaLabel` keys.\n\t */\n\tshortcut?: string | { display: string; ariaLabel: string };\n\t/**\n\t * If provided, renders a Tooltip component for the button.\n\t */\n\tshowTooltip?: boolean;\n\t/**\n\t * The size of the button.\n\t *\n\t * - `'default'`: For normal text-label buttons, unless it is a toggle button.\n\t * - `'compact'`: For toggle buttons, icon buttons, and buttons when used in context of either.\n\t * - `'small'`: For icon buttons associated with more advanced or auxiliary features.\n\t *\n\t * If the deprecated `isSmall` prop is also defined, this prop will take precedence.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'compact' | 'small';\n\t/**\n\t * If provided, displays the given text inside the button. If the button contains children elements, the text is displayed before them.\n\t */\n\ttext?: string;\n\t/**\n\t * If provided with `showTooltip`, sets the position of the tooltip.\n\t * Please refer to the Tooltip component for more details regarding the defaults.\n\t */\n\ttooltipPosition?: PopoverProps[ 'position' ];\n\t/**\n\t * Specifies the button's style.\n\t * The accepted values are:\n\t * 'primary' (the primary button styles)\n\t * 'secondary' (the default button styles)\n\t * 'tertiary' (the text-based button styles)\n\t * 'link' (the link button styles)\n\t */\n\tvariant?: 'primary' | 'secondary' | 'tertiary' | 'link';\n\t/**\n\t * Whether this is focusable.\n\t */\n\t__experimentalIsFocusable?: boolean;\n};\n\ntype _ButtonProps = {\n\t/**\n\t * Whether the button is disabled.\n\t * If `true`, this will force a `button` element to be rendered.\n\t */\n\tdisabled?: boolean;\n};\n\ntype AnchorProps = {\n\t/**\n\t * Whether the button is disabled.\n\t * If `true`, this will force a `button` element to be rendered.\n\t */\n\tdisabled?: false;\n\t/**\n\t * If provided, renders `a` instead of `button`.\n\t */\n\thref: string;\n\t/**\n\t * If provided with `href`, sets the `target` attribute to the `a`.\n\t */\n\ttarget?: string;\n};\n\nexport type DeprecatedButtonProps = {\n\tisDefault?: boolean;\n\tisLink?: boolean;\n\tisPrimary?: boolean;\n\tisSecondary?: boolean;\n\tisTertiary?: boolean;\n};\n\nexport type DeprecatedIconButtonProps = {\n\tlabelPosition: ButtonProps[ 'tooltipPosition' ];\n\tshowTooltip?: boolean;\n\tsize: ButtonProps[ 'iconSize' ];\n\tlabel: ButtonProps[ 'label' ];\n\ttooltip: ButtonProps[ 'label' ];\n};\n"],"mappings":""}
@@ -0,0 +1,44 @@
1
+ import { createElement } from "@wordpress/element";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import classnames from 'classnames';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import Button from '../button';
11
+ import Dropdown from '../dropdown';
12
+ export function DropdownLinkAction({
13
+ buttonProps,
14
+ className,
15
+ dropdownProps,
16
+ linkText
17
+ }) {
18
+ return createElement(Dropdown, {
19
+ className: classnames('components-circular-option-picker__dropdown-link-action', className),
20
+ renderToggle: ({
21
+ isOpen,
22
+ onToggle
23
+ }) => createElement(Button, {
24
+ "aria-expanded": isOpen,
25
+ "aria-haspopup": "true",
26
+ onClick: onToggle,
27
+ variant: "link",
28
+ ...buttonProps
29
+ }, linkText),
30
+ ...dropdownProps
31
+ });
32
+ }
33
+ export function ButtonAction({
34
+ className,
35
+ children,
36
+ ...additionalProps
37
+ }) {
38
+ return createElement(Button, {
39
+ className: classnames('components-circular-option-picker__clear', className),
40
+ variant: "tertiary",
41
+ ...additionalProps
42
+ }, children);
43
+ }
44
+ //# sourceMappingURL=circular-option-picker-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["classnames","Button","Dropdown","DropdownLinkAction","buttonProps","className","dropdownProps","linkText","createElement","renderToggle","isOpen","onToggle","onClick","variant","ButtonAction","children","additionalProps"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-actions.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport type { DropdownLinkActionProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport function DropdownLinkAction( {\n\tbuttonProps,\n\tclassName,\n\tdropdownProps,\n\tlinkText,\n}: DropdownLinkActionProps ) {\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-circular-option-picker__dropdown-link-action',\n\t\t\t\tclassName\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={ onToggle }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t>\n\t\t\t\t\t{ linkText }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ ...dropdownProps }\n\t\t/>\n\t);\n}\n\nexport function ButtonAction( {\n\tclassName,\n\tchildren,\n\t...additionalProps\n}: WordPressComponentProps< ButtonAsButtonProps, 'button', false > ) {\n\treturn (\n\t\t<Button\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-circular-option-picker__clear',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tvariant=\"tertiary\"\n\t\t\t{ ...additionalProps }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,QAAQ,MAAM,aAAa;AAKlC,OAAO,SAASC,kBAAkBA,CAAE;EACnCC,WAAW;EACXC,SAAS;EACTC,aAAa;EACbC;AACwB,CAAC,EAAG;EAC5B,OACCC,aAAA,CAACN,QAAQ;IACRG,SAAS,EAAGL,UAAU,CACrB,yDAAyD,EACzDK,SACD,CAAG;IACHI,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,KACpCH,aAAA,CAACP,MAAM;MACN,iBAAgBS,MAAQ;MACxB,iBAAc,MAAM;MACpBE,OAAO,EAAGD,QAAU;MACpBE,OAAO,EAAC,MAAM;MAAA,GACTT;IAAW,GAEdG,QACK,CACN;IAAA,GACED;EAAa,CAClB,CAAC;AAEJ;AAEA,OAAO,SAASQ,YAAYA,CAAE;EAC7BT,SAAS;EACTU,QAAQ;EACR,GAAGC;AAC6D,CAAC,EAAG;EACpE,OACCR,aAAA,CAACP,MAAM;IACNI,SAAS,EAAGL,UAAU,CACrB,0CAA0C,EAC1CK,SACD,CAAG;IACHQ,OAAO,EAAC,UAAU;IAAA,GACbG;EAAe,GAElBD,QACK,CAAC;AAEX"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { createContext } from '@wordpress/element';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+
10
+ export const CircularOptionPickerContext = createContext({});
11
+ //# sourceMappingURL=circular-option-picker-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createContext","CircularOptionPickerContext"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-context.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { CircularOptionPickerContextProps } from './types';\n\nexport const CircularOptionPickerContext =\n\tcreateContext< CircularOptionPickerContextProps >( {} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;;AAGA,OAAO,MAAMC,2BAA2B,GACvCD,aAAa,CAAsC,CAAC,CAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { createElement } from "@wordpress/element";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import classnames from 'classnames';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+
11
+ export function OptionGroup({
12
+ className,
13
+ options,
14
+ ...additionalProps
15
+ }) {
16
+ const role = 'aria-label' in additionalProps || 'aria-labelledby' in additionalProps ? 'group' : undefined;
17
+ return createElement("div", {
18
+ ...additionalProps,
19
+ role: role,
20
+ className: classnames('components-circular-option-picker__option-group', 'components-circular-option-picker__swatches', className)
21
+ }, options);
22
+ }
23
+ //# sourceMappingURL=circular-option-picker-option-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["classnames","OptionGroup","className","options","additionalProps","role","undefined","createElement"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-option-group.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport type { OptionGroupProps } from './types';\n\nexport function OptionGroup( {\n\tclassName,\n\toptions,\n\t...additionalProps\n}: OptionGroupProps ) {\n\tconst role =\n\t\t'aria-label' in additionalProps || 'aria-labelledby' in additionalProps\n\t\t\t? 'group'\n\t\t\t: undefined;\n\n\treturn (\n\t\t<div\n\t\t\t{ ...additionalProps }\n\t\t\trole={ role }\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-circular-option-picker__option-group',\n\t\t\t\t'components-circular-option-picker__swatches',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ options }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;;AAGA,OAAO,SAASC,WAAWA,CAAE;EAC5BC,SAAS;EACTC,OAAO;EACP,GAAGC;AACc,CAAC,EAAG;EACrB,MAAMC,IAAI,GACT,YAAY,IAAID,eAAe,IAAI,iBAAiB,IAAIA,eAAe,GACpE,OAAO,GACPE,SAAS;EAEb,OACCC,aAAA;IAAA,GACMH,eAAe;IACpBC,IAAI,EAAGA,IAAM;IACbH,SAAS,EAAGF,UAAU,CACrB,iDAAiD,EACjD,6CAA6C,EAC7CE,SACD;EAAG,GAEDC,OACE,CAAC;AAER"}
@@ -0,0 +1,114 @@
1
+ import { createElement } from "@wordpress/element";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import classnames from 'classnames';
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { useInstanceId } from '@wordpress/compose';
10
+ import { forwardRef, useContext, useEffect } from '@wordpress/element';
11
+ import { Icon, check } from '@wordpress/icons';
12
+
13
+ /**
14
+ * Internal dependencies
15
+ */
16
+ import { CircularOptionPickerContext } from './circular-option-picker-context';
17
+ import Button from '../button';
18
+ import { CompositeItem } from '../composite';
19
+ import Tooltip from '../tooltip';
20
+ const hasSelectedOption = new Map();
21
+ function UnforwardedOptionAsButton(props, forwardedRef) {
22
+ return createElement(Button, {
23
+ ...props,
24
+ ref: forwardedRef
25
+ });
26
+ }
27
+ const OptionAsButton = forwardRef(UnforwardedOptionAsButton);
28
+ function UnforwardedOptionAsOption(props, forwardedRef) {
29
+ const {
30
+ id,
31
+ className,
32
+ isSelected,
33
+ context,
34
+ ...additionalProps
35
+ } = props;
36
+ const {
37
+ isComposite,
38
+ ..._compositeState
39
+ } = context;
40
+ const compositeState = _compositeState;
41
+ const {
42
+ baseId,
43
+ currentId,
44
+ setCurrentId
45
+ } = compositeState;
46
+ useEffect(() => {
47
+ // If we call `setCurrentId` here, it doesn't update for other
48
+ // Option renders in the same pass. So we have to store our own
49
+ // map to make sure that we only set the first selected option.
50
+ // We still need to check `currentId` because the control will
51
+ // update this as the user moves around, and that state should
52
+ // be maintained as the group gains and loses focus.
53
+ if (isSelected && !currentId && !hasSelectedOption.get(baseId)) {
54
+ hasSelectedOption.set(baseId, true);
55
+ setCurrentId(id);
56
+ }
57
+ }, [baseId, currentId, id, isSelected, setCurrentId]);
58
+ return createElement(CompositeItem, {
59
+ ...additionalProps,
60
+ ...compositeState,
61
+ as: Button,
62
+ id: id
63
+ // Ideally we'd let the underlying `Button` component
64
+ // handle this by passing `isPressed` as a prop.
65
+ // Unfortunately doing so also sets `aria-pressed` as
66
+ // an attribute on the element, which is incompatible
67
+ // with `role="option"`, and there is no way at this
68
+ // point to override that behaviour.
69
+ ,
70
+ className: classnames(className, {
71
+ 'is-pressed': isSelected
72
+ }),
73
+ role: "option",
74
+ "aria-selected": !!isSelected,
75
+ ref: forwardedRef
76
+ });
77
+ }
78
+ const OptionAsOption = forwardRef(UnforwardedOptionAsOption);
79
+ export function Option({
80
+ className,
81
+ isSelected,
82
+ selectedIconProps = {},
83
+ tooltipText,
84
+ ...additionalProps
85
+ }) {
86
+ const compositeContext = useContext(CircularOptionPickerContext);
87
+ const {
88
+ isComposite,
89
+ baseId
90
+ } = compositeContext;
91
+ const id = useInstanceId(Option, baseId || 'components-circular-option-picker__option');
92
+ const commonProps = {
93
+ id,
94
+ className: 'components-circular-option-picker__option',
95
+ ...additionalProps
96
+ };
97
+ const optionControl = isComposite ? createElement(OptionAsOption, {
98
+ ...commonProps,
99
+ context: compositeContext,
100
+ isSelected: isSelected
101
+ }) : createElement(OptionAsButton, {
102
+ ...commonProps,
103
+ isPressed: isSelected
104
+ });
105
+ return createElement("div", {
106
+ className: classnames(className, 'components-circular-option-picker__option-wrapper')
107
+ }, tooltipText ? createElement(Tooltip, {
108
+ text: tooltipText
109
+ }, optionControl) : optionControl, isSelected && createElement(Icon, {
110
+ icon: check,
111
+ ...selectedIconProps
112
+ }));
113
+ }
114
+ //# sourceMappingURL=circular-option-picker-option.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["classnames","useInstanceId","forwardRef","useContext","useEffect","Icon","check","CircularOptionPickerContext","Button","CompositeItem","Tooltip","hasSelectedOption","Map","UnforwardedOptionAsButton","props","forwardedRef","createElement","ref","OptionAsButton","UnforwardedOptionAsOption","id","className","isSelected","context","additionalProps","isComposite","_compositeState","compositeState","baseId","currentId","setCurrentId","get","set","as","role","OptionAsOption","Option","selectedIconProps","tooltipText","compositeContext","commonProps","optionControl","isPressed","text","icon"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-option.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useContext, useEffect } from '@wordpress/element';\nimport { Icon, check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { CircularOptionPickerContext } from './circular-option-picker-context';\nimport Button from '../button';\nimport { CompositeItem } from '../composite';\nimport Tooltip from '../tooltip';\nimport type {\n\tOptionProps,\n\tCircularOptionPickerCompositeState,\n\tCircularOptionPickerContextProps,\n} from './types';\n\nconst hasSelectedOption = new Map();\n\nfunction UnforwardedOptionAsButton(\n\tprops: {\n\t\tid?: string;\n\t\tclassName?: string;\n\t\tisPressed?: boolean;\n\t},\n\tforwardedRef: ForwardedRef< any >\n) {\n\treturn <Button { ...props } ref={ forwardedRef }></Button>;\n}\n\nconst OptionAsButton = forwardRef( UnforwardedOptionAsButton );\n\nfunction UnforwardedOptionAsOption(\n\tprops: {\n\t\tid: string;\n\t\tclassName?: string;\n\t\tisSelected?: boolean;\n\t\tcontext: CircularOptionPickerContextProps;\n\t},\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { id, className, isSelected, context, ...additionalProps } = props;\n\tconst { isComposite, ..._compositeState } = context;\n\tconst compositeState =\n\t\t_compositeState as CircularOptionPickerCompositeState;\n\tconst { baseId, currentId, setCurrentId } = compositeState;\n\n\tuseEffect( () => {\n\t\t// If we call `setCurrentId` here, it doesn't update for other\n\t\t// Option renders in the same pass. So we have to store our own\n\t\t// map to make sure that we only set the first selected option.\n\t\t// We still need to check `currentId` because the control will\n\t\t// update this as the user moves around, and that state should\n\t\t// be maintained as the group gains and loses focus.\n\t\tif ( isSelected && ! currentId && ! hasSelectedOption.get( baseId ) ) {\n\t\t\thasSelectedOption.set( baseId, true );\n\t\t\tsetCurrentId( id );\n\t\t}\n\t}, [ baseId, currentId, id, isSelected, setCurrentId ] );\n\n\treturn (\n\t\t<CompositeItem\n\t\t\t{ ...additionalProps }\n\t\t\t{ ...compositeState }\n\t\t\tas={ Button }\n\t\t\tid={ id }\n\t\t\t// Ideally we'd let the underlying `Button` component\n\t\t\t// handle this by passing `isPressed` as a prop.\n\t\t\t// Unfortunately doing so also sets `aria-pressed` as\n\t\t\t// an attribute on the element, which is incompatible\n\t\t\t// with `role=\"option\"`, and there is no way at this\n\t\t\t// point to override that behaviour.\n\t\t\tclassName={ classnames( className, {\n\t\t\t\t'is-pressed': isSelected,\n\t\t\t} ) }\n\t\t\trole=\"option\"\n\t\t\taria-selected={ !! isSelected }\n\t\t\tref={ forwardedRef }\n\t\t/>\n\t);\n}\n\nconst OptionAsOption = forwardRef( UnforwardedOptionAsOption );\n\nexport function Option( {\n\tclassName,\n\tisSelected,\n\tselectedIconProps = {},\n\ttooltipText,\n\t...additionalProps\n}: OptionProps ) {\n\tconst compositeContext = useContext( CircularOptionPickerContext );\n\tconst { isComposite, baseId } = compositeContext;\n\tconst id = useInstanceId(\n\t\tOption,\n\t\tbaseId || 'components-circular-option-picker__option'\n\t);\n\n\tconst commonProps = {\n\t\tid,\n\t\tclassName: 'components-circular-option-picker__option',\n\t\t...additionalProps,\n\t};\n\n\tconst optionControl = isComposite ? (\n\t\t<OptionAsOption\n\t\t\t{ ...commonProps }\n\t\t\tcontext={ compositeContext }\n\t\t\tisSelected={ isSelected }\n\t\t/>\n\t) : (\n\t\t<OptionAsButton { ...commonProps } isPressed={ isSelected } />\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'components-circular-option-picker__option-wrapper'\n\t\t\t) }\n\t\t>\n\t\t\t{ tooltipText ? (\n\t\t\t\t<Tooltip text={ tooltipText }>{ optionControl }</Tooltip>\n\t\t\t) : (\n\t\t\t\toptionControl\n\t\t\t) }\n\t\t\t{ isSelected && <Icon icon={ check } { ...selectedIconProps } /> }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AAC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AAI,EAAGL;EAAa,GAAGG,aAAwB,CAAC,GAEzDA,aACA,EACCnB,UAAU,IAAIN,aAAA,CAACX,IAAI;IAACuC,IAAI,EAAGtC,KAAO;IAAA,GAAM+B;EAAiB,CAAI,CAC3D,CAAC;AAER"}
@@ -0,0 +1,165 @@
1
+ import { createElement } from "@wordpress/element";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import classnames from 'classnames';
6
+
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+ import { useInstanceId } from '@wordpress/compose';
11
+ import { useEffect } from '@wordpress/element';
12
+ import { isRTL } from '@wordpress/i18n';
13
+
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+ import { CircularOptionPickerContext } from './circular-option-picker-context';
18
+ import { Composite, useCompositeState } from '../composite';
19
+ import { Option } from './circular-option-picker-option';
20
+ import { OptionGroup } from './circular-option-picker-option-group';
21
+ import { ButtonAction, DropdownLinkAction } from './circular-option-picker-actions';
22
+
23
+ /**
24
+ *`CircularOptionPicker` is a component that displays a set of options as circular buttons.
25
+ *
26
+ * ```jsx
27
+ * import { CircularOptionPicker } from '../circular-option-picker';
28
+ * import { useState } from '@wordpress/element';
29
+ *
30
+ * const Example = () => {
31
+ * const [ currentColor, setCurrentColor ] = useState();
32
+ * const colors = [
33
+ * { color: '#f00', name: 'Red' },
34
+ * { color: '#0f0', name: 'Green' },
35
+ * { color: '#00f', name: 'Blue' },
36
+ * ];
37
+ * const colorOptions = (
38
+ * <>
39
+ * { colors.map( ( { color, name }, index ) => {
40
+ * return (
41
+ * <CircularOptionPicker.Option
42
+ * key={ `${ color }-${ index }` }
43
+ * tooltipText={ name }
44
+ * style={ { backgroundColor: color, color } }
45
+ * isSelected={ index === currentColor }
46
+ * onClick={ () => setCurrentColor( index ) }
47
+ * aria-label={ name }
48
+ * />
49
+ * );
50
+ * } ) }
51
+ * </>
52
+ * );
53
+ * return (
54
+ * <CircularOptionPicker
55
+ * options={ colorOptions }
56
+ * actions={
57
+ * <CircularOptionPicker.ButtonAction
58
+ * onClick={ () => setCurrentColor( undefined ) }
59
+ * >
60
+ * { 'Clear' }
61
+ * </CircularOptionPicker.ButtonAction>
62
+ * }
63
+ * />
64
+ * );
65
+ * };
66
+ * ```
67
+ */
68
+
69
+ function ListboxCircularOptionPicker(props) {
70
+ const {
71
+ actions,
72
+ options,
73
+ baseId,
74
+ className,
75
+ loop = true,
76
+ children,
77
+ ...additionalProps
78
+ } = props;
79
+ const rtl = isRTL();
80
+ const compositeState = useCompositeState({
81
+ baseId,
82
+ loop,
83
+ rtl
84
+ });
85
+ const {
86
+ setBaseId,
87
+ setLoop,
88
+ setRTL
89
+ } = compositeState;
90
+
91
+ // These are necessary as `useCompositeState` is sealed after
92
+ // the first render, so although unlikely to happen, if a state
93
+ // property should change, we need to process it accordingly.
94
+
95
+ useEffect(() => {
96
+ setBaseId(baseId);
97
+ }, [setBaseId, baseId]);
98
+ useEffect(() => {
99
+ setLoop(loop);
100
+ }, [setLoop, loop]);
101
+ useEffect(() => {
102
+ setRTL(rtl);
103
+ }, [setRTL, rtl]);
104
+ const compositeContext = {
105
+ isComposite: true,
106
+ ...compositeState
107
+ };
108
+ return createElement("div", {
109
+ className: className
110
+ }, createElement(CircularOptionPickerContext.Provider, {
111
+ value: compositeContext
112
+ }, createElement(Composite, {
113
+ ...additionalProps,
114
+ ...compositeState,
115
+ role: 'listbox'
116
+ }, options), children, actions));
117
+ }
118
+ function ButtonsCircularOptionPicker(props) {
119
+ const {
120
+ actions,
121
+ options,
122
+ children,
123
+ baseId,
124
+ ...additionalProps
125
+ } = props;
126
+ return createElement("div", {
127
+ ...additionalProps
128
+ }, createElement(CircularOptionPickerContext.Provider, {
129
+ value: {
130
+ isComposite: false,
131
+ baseId
132
+ }
133
+ }, options, children, actions));
134
+ }
135
+ function CircularOptionPicker(props) {
136
+ const {
137
+ asButtons,
138
+ actions: actionsProp,
139
+ options: optionsProp,
140
+ children,
141
+ className,
142
+ ...additionalProps
143
+ } = props;
144
+ const baseId = useInstanceId(CircularOptionPicker, 'components-circular-option-picker', additionalProps.id);
145
+ const OptionPickerImplementation = asButtons ? ButtonsCircularOptionPicker : ListboxCircularOptionPicker;
146
+ const actions = actionsProp ? createElement("div", {
147
+ className: "components-circular-option-picker__custom-clear-wrapper"
148
+ }, actionsProp) : undefined;
149
+ const options = createElement("div", {
150
+ className: 'components-circular-option-picker__swatches'
151
+ }, optionsProp);
152
+ return createElement(OptionPickerImplementation, {
153
+ ...additionalProps,
154
+ baseId: baseId,
155
+ className: classnames('components-circular-option-picker', className),
156
+ actions: actions,
157
+ options: options
158
+ }, children);
159
+ }
160
+ CircularOptionPicker.Option = Option;
161
+ CircularOptionPicker.OptionGroup = OptionGroup;
162
+ CircularOptionPicker.ButtonAction = ButtonAction;
163
+ CircularOptionPicker.DropdownLinkAction = DropdownLinkAction;
164
+ export default CircularOptionPicker;
165
+ //# sourceMappingURL=circular-option-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["classnames","useInstanceId","useEffect","isRTL","CircularOptionPickerContext","Composite","useCompositeState","Option","OptionGroup","ButtonAction","DropdownLinkAction","ListboxCircularOptionPicker","props","actions","options","baseId","className","loop","children","additionalProps","rtl","compositeState","setBaseId","setLoop","setRTL","compositeContext","isComposite","createElement","Provider","value","role","ButtonsCircularOptionPicker","CircularOptionPicker","asButtons","actionsProp","optionsProp","id","OptionPickerImplementation","undefined"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { CircularOptionPickerContext } from './circular-option-picker-context';\nimport { Composite, useCompositeState } from '../composite';\nimport type {\n\tCircularOptionPickerProps,\n\tListboxCircularOptionPickerProps,\n\tButtonsCircularOptionPickerProps,\n} from './types';\nimport { Option } from './circular-option-picker-option';\nimport { OptionGroup } from './circular-option-picker-option-group';\nimport {\n\tButtonAction,\n\tDropdownLinkAction,\n} from './circular-option-picker-actions';\n\n/**\n *`CircularOptionPicker` is a component that displays a set of options as circular buttons.\n *\n * ```jsx\n * import { CircularOptionPicker } from '../circular-option-picker';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ currentColor, setCurrentColor ] = useState();\n * \tconst colors = [\n * \t\t{ color: '#f00', name: 'Red' },\n * \t\t{ color: '#0f0', name: 'Green' },\n * \t\t{ color: '#00f', name: 'Blue' },\n * \t];\n * \tconst colorOptions = (\n * \t\t<>\n * \t\t\t{ colors.map( ( { color, name }, index ) => {\n * \t\t\t\treturn (\n * \t\t\t\t\t<CircularOptionPicker.Option\n * \t\t\t\t\t\tkey={ `${ color }-${ index }` }\n * \t\t\t\t\t\ttooltipText={ name }\n * \t\t\t\t\t\tstyle={ { backgroundColor: color, color } }\n * \t\t\t\t\t\tisSelected={ index === currentColor }\n * \t\t\t\t\t\tonClick={ () => setCurrentColor( index ) }\n * \t\t\t\t\t\taria-label={ name }\n * \t\t\t\t\t/>\n * \t\t\t\t);\n * \t\t\t} ) }\n * \t\t</>\n * \t);\n * \treturn (\n * \t\t<CircularOptionPicker\n * \t\t\t\toptions={ colorOptions }\n * \t\t\t\tactions={\n * \t\t\t\t\t<CircularOptionPicker.ButtonAction\n * \t\t\t\t\t\tonClick={ () => setCurrentColor( undefined ) }\n * \t\t\t\t\t>\n * \t\t\t\t\t\t{ 'Clear' }\n * \t\t\t\t\t</CircularOptionPicker.ButtonAction>\n * \t\t\t\t}\n * \t\t\t/>\n * \t);\n * };\n * ```\n */\n\nfunction ListboxCircularOptionPicker(\n\tprops: ListboxCircularOptionPickerProps\n) {\n\tconst {\n\t\tactions,\n\t\toptions,\n\t\tbaseId,\n\t\tclassName,\n\t\tloop = true,\n\t\tchildren,\n\t\t...additionalProps\n\t} = props;\n\tconst rtl = isRTL();\n\n\tconst compositeState = useCompositeState( { baseId, loop, rtl } );\n\tconst { setBaseId, setLoop, setRTL } = compositeState;\n\n\t// These are necessary as `useCompositeState` is sealed after\n\t// the first render, so although unlikely to happen, if a state\n\t// property should change, we need to process it accordingly.\n\n\tuseEffect( () => {\n\t\tsetBaseId( baseId );\n\t}, [ setBaseId, baseId ] );\n\n\tuseEffect( () => {\n\t\tsetLoop( loop );\n\t}, [ setLoop, loop ] );\n\n\tuseEffect( () => {\n\t\tsetRTL( rtl );\n\t}, [ setRTL, rtl ] );\n\n\tconst compositeContext = {\n\t\tisComposite: true,\n\t\t...compositeState,\n\t};\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t<CircularOptionPickerContext.Provider value={ compositeContext }>\n\t\t\t\t<Composite\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\t{ ...compositeState }\n\t\t\t\t\trole={ 'listbox' }\n\t\t\t\t>\n\t\t\t\t\t{ options }\n\t\t\t\t</Composite>\n\t\t\t\t{ children }\n\t\t\t\t{ actions }\n\t\t\t</CircularOptionPickerContext.Provider>\n\t\t</div>\n\t);\n}\n\nfunction ButtonsCircularOptionPicker(\n\tprops: ButtonsCircularOptionPickerProps\n) {\n\tconst { actions, options, children, baseId, ...additionalProps } = props;\n\n\treturn (\n\t\t<div { ...additionalProps }>\n\t\t\t<CircularOptionPickerContext.Provider\n\t\t\t\tvalue={ { isComposite: false, baseId } }\n\t\t\t>\n\t\t\t\t{ options }\n\t\t\t\t{ children }\n\t\t\t\t{ actions }\n\t\t\t</CircularOptionPickerContext.Provider>\n\t\t</div>\n\t);\n}\n\nfunction CircularOptionPicker( props: CircularOptionPickerProps ) {\n\tconst {\n\t\tasButtons,\n\t\tactions: actionsProp,\n\t\toptions: optionsProp,\n\t\tchildren,\n\t\tclassName,\n\t\t...additionalProps\n\t} = props;\n\n\tconst baseId = useInstanceId(\n\t\tCircularOptionPicker,\n\t\t'components-circular-option-picker',\n\t\tadditionalProps.id\n\t);\n\n\tconst OptionPickerImplementation = asButtons\n\t\t? ButtonsCircularOptionPicker\n\t\t: ListboxCircularOptionPicker;\n\n\tconst actions = actionsProp ? (\n\t\t<div className=\"components-circular-option-picker__custom-clear-wrapper\">\n\t\t\t{ actionsProp }\n\t\t</div>\n\t) : undefined;\n\n\tconst options = (\n\t\t<div className={ 'components-circular-option-picker__swatches' }>\n\t\t\t{ optionsProp }\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<OptionPickerImplementation\n\t\t\t{ ...additionalProps }\n\t\t\tbaseId={ baseId }\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-circular-option-picker',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tactions={ actions }\n\t\t\toptions={ options }\n\t\t>\n\t\t\t{ children }\n\t\t</OptionPickerImplementation>\n\t);\n}\n\nCircularOptionPicker.Option = Option;\nCircularOptionPicker.OptionGroup = OptionGroup;\nCircularOptionPicker.ButtonAction = ButtonAction;\nCircularOptionPicker.DropdownLinkAction = DropdownLinkAction;\n\nexport default CircularOptionPicker;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,SAAS,EAAEC,iBAAiB,QAAQ,cAAc;AAM3D,SAASC,MAAM,QAAQ,iCAAiC;AACxD,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SACCC,YAAY,EACZC,kBAAkB,QACZ,kCAAkC;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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