@wordpress/components 25.6.1 → 26.0.1-next.5a1d1283.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 (526) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +3 -8
  4. package/build/color-picker/hsv-color-picker.native.js +92 -0
  5. package/build/color-picker/hsv-color-picker.native.js.map +1 -0
  6. package/build/color-picker/hue-picker.native.js +195 -0
  7. package/build/color-picker/hue-picker.native.js.map +1 -0
  8. package/build/color-picker/index.native.js +3 -2
  9. package/build/color-picker/index.native.js.map +1 -1
  10. package/build/color-picker/saturation-picker.native.js +178 -0
  11. package/build/color-picker/saturation-picker.native.js.map +1 -0
  12. package/build/item-group/item/component.js +0 -1
  13. package/build/item-group/item/component.js.map +1 -1
  14. package/build/item-group/item-group/component.js +0 -1
  15. package/build/item-group/item-group/component.js.map +1 -1
  16. package/build/menu-item/index.js +6 -4
  17. package/build/menu-item/index.js.map +1 -1
  18. package/build/menu-item/types.js.map +1 -1
  19. package/build/mobile/link-settings/link-settings-navigation.native.js +1 -1
  20. package/build/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  21. package/build/navigation/index.js +0 -1
  22. package/build/navigation/index.js.map +1 -1
  23. package/build/navigator/navigator-provider/component.js +1 -2
  24. package/build/navigator/navigator-provider/component.js.map +1 -1
  25. package/build/palette-edit/styles.js +10 -10
  26. package/build/palette-edit/styles.js.map +1 -1
  27. package/build/popover/index.js +38 -75
  28. package/build/popover/index.js.map +1 -1
  29. package/build/popover/overlay-middlewares.js.map +1 -1
  30. package/build/popover/types.js.map +1 -1
  31. package/build/popover/utils.js +5 -50
  32. package/build/popover/utils.js.map +1 -1
  33. package/build/progress-bar/styles.js +6 -5
  34. package/build/progress-bar/styles.js.map +1 -1
  35. package/build/search-control/index.native.js +27 -24
  36. package/build/search-control/index.native.js.map +1 -1
  37. package/build/shortcut/index.js +13 -0
  38. package/build/shortcut/index.js.map +1 -1
  39. package/build/slot-fill/bubbles-virtually/slot-fill-context.js +3 -1
  40. package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  41. package/build/slot-fill/bubbles-virtually/slot.js +14 -8
  42. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  43. package/build/slot-fill/index.js +5 -0
  44. package/build/slot-fill/index.js.map +1 -1
  45. package/build/spinner/index.js +0 -1
  46. package/build/spinner/index.js.map +1 -1
  47. package/build/theme/index.js +0 -1
  48. package/build/theme/index.js.map +1 -1
  49. package/build/tools-panel/tools-panel/component.js +0 -1
  50. package/build/tools-panel/tools-panel/component.js.map +1 -1
  51. package/build/tools-panel/tools-panel-header/component.js +5 -1
  52. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  53. package/build/tree-select/index.js +0 -1
  54. package/build/tree-select/index.js.map +1 -1
  55. package/build/unit-control/index.js +0 -1
  56. package/build/unit-control/index.js.map +1 -1
  57. package/build/utils/hooks/use-cx.js +2 -1
  58. package/build/utils/hooks/use-cx.js.map +1 -1
  59. package/build/view/component.js +1 -2
  60. package/build/view/component.js.map +1 -1
  61. package/build-module/color-picker/hsv-color-picker.native.js +84 -0
  62. package/build-module/color-picker/hsv-color-picker.native.js.map +1 -0
  63. package/build-module/color-picker/hue-picker.native.js +185 -0
  64. package/build-module/color-picker/hue-picker.native.js.map +1 -0
  65. package/build-module/color-picker/index.native.js +2 -1
  66. package/build-module/color-picker/index.native.js.map +1 -1
  67. package/build-module/color-picker/saturation-picker.native.js +168 -0
  68. package/build-module/color-picker/saturation-picker.native.js.map +1 -0
  69. package/build-module/item-group/item/component.js +0 -1
  70. package/build-module/item-group/item/component.js.map +1 -1
  71. package/build-module/item-group/item-group/component.js +0 -1
  72. package/build-module/item-group/item-group/component.js.map +1 -1
  73. package/build-module/menu-item/index.js +4 -2
  74. package/build-module/menu-item/index.js.map +1 -1
  75. package/build-module/menu-item/types.js.map +1 -1
  76. package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -1
  77. package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  78. package/build-module/navigation/index.js +0 -1
  79. package/build-module/navigation/index.js.map +1 -1
  80. package/build-module/navigator/navigator-provider/component.js +1 -2
  81. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  82. package/build-module/palette-edit/styles.js +10 -10
  83. package/build-module/palette-edit/styles.js.map +1 -1
  84. package/build-module/popover/index.js +42 -79
  85. package/build-module/popover/index.js.map +1 -1
  86. package/build-module/popover/overlay-middlewares.js.map +1 -1
  87. package/build-module/popover/types.js.map +1 -1
  88. package/build-module/popover/utils.js +4 -47
  89. package/build-module/popover/utils.js.map +1 -1
  90. package/build-module/progress-bar/styles.js +6 -5
  91. package/build-module/progress-bar/styles.js.map +1 -1
  92. package/build-module/search-control/index.native.js +28 -25
  93. package/build-module/search-control/index.native.js.map +1 -1
  94. package/build-module/shortcut/index.js +13 -0
  95. package/build-module/shortcut/index.js.map +1 -1
  96. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +3 -1
  97. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  98. package/build-module/slot-fill/bubbles-virtually/slot.js +14 -8
  99. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  100. package/build-module/slot-fill/index.js +6 -1
  101. package/build-module/slot-fill/index.js.map +1 -1
  102. package/build-module/spinner/index.js +0 -1
  103. package/build-module/spinner/index.js.map +1 -1
  104. package/build-module/theme/index.js +0 -1
  105. package/build-module/theme/index.js.map +1 -1
  106. package/build-module/tools-panel/tools-panel/component.js +0 -1
  107. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  108. package/build-module/tools-panel/tools-panel-header/component.js +5 -1
  109. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  110. package/build-module/tree-select/index.js +0 -1
  111. package/build-module/tree-select/index.js.map +1 -1
  112. package/build-module/unit-control/index.js +0 -1
  113. package/build-module/unit-control/index.js.map +1 -1
  114. package/build-module/utils/hooks/use-cx.js +2 -1
  115. package/build-module/utils/hooks/use-cx.js.map +1 -1
  116. package/build-module/view/component.js +1 -2
  117. package/build-module/view/component.js.map +1 -1
  118. package/build-types/alignment-matrix-control/stories/index.story.d.ts +2 -2
  119. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  120. package/build-types/angle-picker-control/stories/index.story.d.ts +2 -2
  121. package/build-types/angle-picker-control/stories/index.story.d.ts.map +1 -1
  122. package/build-types/animate/stories/index.story.d.ts +9 -9
  123. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  124. package/build-types/base-control/stories/index.story.d.ts +4 -4
  125. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  126. package/build-types/border-box-control/stories/index.story.d.ts +2 -2
  127. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  128. package/build-types/border-control/stories/index.story.d.ts +2 -2
  129. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  130. package/build-types/button/stories/e2e/index.story.d.ts +3 -3
  131. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  132. package/build-types/button/stories/index.story.d.ts +10 -9
  133. package/build-types/button/stories/index.story.d.ts.map +1 -1
  134. package/build-types/button-group/stories/index.story.d.ts +3 -3
  135. package/build-types/button-group/stories/index.story.d.ts.map +1 -1
  136. package/build-types/card/stories/index.story.d.ts +2 -2
  137. package/build-types/card/stories/index.story.d.ts.map +1 -1
  138. package/build-types/checkbox-control/stories/index.story.d.ts +4 -4
  139. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  140. package/build-types/circular-option-picker/stories/index.story.d.ts +2 -2
  141. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  142. package/build-types/color-indicator/stories/index.story.d.ts +3 -3
  143. package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
  144. package/build-types/color-palette/stories/index.story.d.ts +3 -3
  145. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  146. package/build-types/color-palette/styles.d.ts +1 -1
  147. package/build-types/color-picker/stories/index.story.d.ts +2 -2
  148. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  149. package/build-types/combobox-control/stories/index.story.d.ts +2 -2
  150. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  151. package/build-types/custom-gradient-picker/stories/index.story.d.ts +2 -2
  152. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  153. package/build-types/date-time/date/styles.d.ts +1 -1
  154. package/build-types/date-time/stories/date-time.story.d.ts +5 -5
  155. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  156. package/build-types/date-time/stories/date.story.d.ts +5 -5
  157. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  158. package/build-types/date-time/stories/time.story.d.ts +3 -3
  159. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  160. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  161. package/build-types/disabled/stories/index.story.d.ts +4 -4
  162. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  163. package/build-types/divider/stories/index.story.d.ts +5 -5
  164. package/build-types/divider/stories/index.story.d.ts.map +1 -1
  165. package/build-types/draggable/stories/index.story.d.ts +4 -4
  166. package/build-types/draggable/stories/index.story.d.ts.map +1 -1
  167. package/build-types/drop-zone/stories/index.story.d.ts +2 -2
  168. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  169. package/build-types/dropdown/stories/index.story.d.ts +6 -5
  170. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  171. package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
  172. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  173. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +2 -2
  174. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  175. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +2 -2
  176. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
  177. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +2 -2
  178. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
  179. package/build-types/elevation/stories/index.story.d.ts +5 -5
  180. package/build-types/elevation/stories/index.story.d.ts.map +1 -1
  181. package/build-types/external-link/stories/index.story.d.ts +3 -3
  182. package/build-types/external-link/stories/index.story.d.ts.map +1 -1
  183. package/build-types/flex/stories/index.story.d.ts +4 -4
  184. package/build-types/flex/stories/index.story.d.ts.map +1 -1
  185. package/build-types/focal-point-picker/stories/index.story.d.ts +2 -2
  186. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  187. package/build-types/font-size-picker/stories/e2e/index.story.d.ts +2 -2
  188. package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +1 -1
  189. package/build-types/font-size-picker/stories/index.story.d.ts +8 -8
  190. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  191. package/build-types/form-file-upload/stories/index.story.d.ts +2 -2
  192. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  193. package/build-types/form-toggle/stories/index.story.d.ts +3 -3
  194. package/build-types/form-toggle/stories/index.story.d.ts.map +1 -1
  195. package/build-types/form-token-field/stories/index.story.d.ts +7 -7
  196. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  197. package/build-types/gradient-picker/stories/index.story.d.ts +2 -2
  198. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  199. package/build-types/grid/stories/index.story.d.ts +3 -3
  200. package/build-types/grid/stories/index.story.d.ts.map +1 -1
  201. package/build-types/guide/stories/index.story.d.ts +2 -2
  202. package/build-types/guide/stories/index.story.d.ts.map +1 -1
  203. package/build-types/h-stack/stories/e2e/index.story.d.ts +3 -3
  204. package/build-types/h-stack/stories/e2e/index.story.d.ts.map +1 -1
  205. package/build-types/h-stack/stories/index.story.d.ts +3 -3
  206. package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
  207. package/build-types/heading/stories/index.story.d.ts +3 -3
  208. package/build-types/heading/stories/index.story.d.ts.map +1 -1
  209. package/build-types/icon/stories/index.story.d.ts +4 -4
  210. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  211. package/build-types/input-control/stories/index.story.d.ts +2 -2
  212. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  213. package/build-types/item-group/item/component.d.ts +0 -1
  214. package/build-types/item-group/item/component.d.ts.map +1 -1
  215. package/build-types/item-group/item-group/component.d.ts +0 -1
  216. package/build-types/item-group/item-group/component.d.ts.map +1 -1
  217. package/build-types/item-group/stories/index.story.d.ts +6 -6
  218. package/build-types/item-group/stories/index.story.d.ts.map +1 -1
  219. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +2 -2
  220. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  221. package/build-types/menu-group/stories/index.story.d.ts +3 -3
  222. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  223. package/build-types/menu-item/index.d.ts +5 -58
  224. package/build-types/menu-item/index.d.ts.map +1 -1
  225. package/build-types/menu-item/stories/index.story.d.ts +74 -0
  226. package/build-types/menu-item/stories/index.story.d.ts.map +1 -0
  227. package/build-types/menu-item/types.d.ts +3 -2
  228. package/build-types/menu-item/types.d.ts.map +1 -1
  229. package/build-types/menu-items-choice/stories/index.story.d.ts +3 -3
  230. package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
  231. package/build-types/modal/stories/index.story.d.ts +4 -4
  232. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  233. package/build-types/navigable-container/stories/navigable-menu.story.d.ts +3 -3
  234. package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
  235. package/build-types/navigable-container/stories/tabbable-container.story.d.ts +3 -3
  236. package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
  237. package/build-types/navigation/index.d.ts +0 -1
  238. package/build-types/navigation/index.d.ts.map +1 -1
  239. package/build-types/navigation/stories/index.story.d.ts +2 -2
  240. package/build-types/navigation/stories/index.story.d.ts.map +1 -1
  241. package/build-types/navigation/stories/utils/controlled-state.d.ts +2 -2
  242. package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -1
  243. package/build-types/navigation/stories/utils/default.d.ts +2 -2
  244. package/build-types/navigation/stories/utils/default.d.ts.map +1 -1
  245. package/build-types/navigation/stories/utils/group.d.ts +2 -2
  246. package/build-types/navigation/stories/utils/group.d.ts.map +1 -1
  247. package/build-types/navigation/stories/utils/hide-if-empty.d.ts +2 -2
  248. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -1
  249. package/build-types/navigation/stories/utils/more-examples.d.ts +2 -2
  250. package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -1
  251. package/build-types/navigation/stories/utils/search.d.ts +2 -2
  252. package/build-types/navigation/stories/utils/search.d.ts.map +1 -1
  253. package/build-types/navigation/styles/navigation-styles.d.ts +1 -1
  254. package/build-types/navigator/navigator-provider/component.d.ts +0 -1
  255. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  256. package/build-types/navigator/stories/index.story.d.ts +5 -5
  257. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  258. package/build-types/notice/stories/index.story.d.ts +3 -3
  259. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  260. package/build-types/number-control/stories/index.story.d.ts +2 -2
  261. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  262. package/build-types/palette-edit/stories/index.story.d.ts +2 -2
  263. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  264. package/build-types/palette-edit/styles.d.ts +1 -1
  265. package/build-types/palette-edit/styles.d.ts.map +1 -1
  266. package/build-types/panel/stories/index.story.d.ts +6 -6
  267. package/build-types/panel/stories/index.story.d.ts.map +1 -1
  268. package/build-types/placeholder/stories/index.story.d.ts +3 -3
  269. package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
  270. package/build-types/popover/index.d.ts.map +1 -1
  271. package/build-types/popover/overlay-middlewares.d.ts +2 -2
  272. package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
  273. package/build-types/popover/stories/index.story.d.ts +7 -7
  274. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  275. package/build-types/popover/types.d.ts +6 -0
  276. package/build-types/popover/types.d.ts.map +1 -1
  277. package/build-types/popover/utils.d.ts +1 -21
  278. package/build-types/popover/utils.d.ts.map +1 -1
  279. package/build-types/progress-bar/stories/index.story.d.ts +3 -3
  280. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  281. package/build-types/progress-bar/styles.d.ts.map +1 -1
  282. package/build-types/query-controls/stories/index.story.d.ts +4 -4
  283. package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
  284. package/build-types/radio-control/stories/index.story.d.ts +3 -3
  285. package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
  286. package/build-types/range-control/stories/index.story.d.ts +9 -9
  287. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  288. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  289. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  290. package/build-types/responsive-wrapper/stories/index.story.d.ts +3 -3
  291. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  292. package/build-types/sandbox/stories/index.story.d.ts +2 -2
  293. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  294. package/build-types/scroll-lock/stories/index.story.d.ts +3 -3
  295. package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
  296. package/build-types/scrollable/stories/index.story.d.ts +3 -3
  297. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  298. package/build-types/search-control/stories/index.story.d.ts +2 -2
  299. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  300. package/build-types/select-control/stories/index.story.d.ts +2 -2
  301. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  302. package/build-types/shortcut/index.d.ts +13 -0
  303. package/build-types/shortcut/index.d.ts.map +1 -1
  304. package/build-types/shortcut/stories/index.story.d.ts +13 -0
  305. package/build-types/shortcut/stories/index.story.d.ts.map +1 -0
  306. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts +1 -0
  307. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
  308. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -6
  309. package/build-types/slot-fill/index.d.ts +1 -1
  310. package/build-types/slot-fill/index.d.ts.map +1 -1
  311. package/build-types/snackbar/stories/index.story.d.ts +7 -7
  312. package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
  313. package/build-types/snackbar/stories/list.story.d.ts +3 -3
  314. package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
  315. package/build-types/spacer/stories/index.story.d.ts +3 -3
  316. package/build-types/spacer/stories/index.story.d.ts.map +1 -1
  317. package/build-types/spinner/index.d.ts +0 -1
  318. package/build-types/spinner/index.d.ts.map +1 -1
  319. package/build-types/spinner/stories/index.story.d.ts +4 -4
  320. package/build-types/spinner/stories/index.story.d.ts.map +1 -1
  321. package/build-types/surface/stories/index.story.d.ts +3 -3
  322. package/build-types/surface/stories/index.story.d.ts.map +1 -1
  323. package/build-types/tab-panel/stories/index.story.d.ts +2 -2
  324. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  325. package/build-types/text-control/stories/index.story.d.ts +4 -4
  326. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  327. package/build-types/text-highlight/stories/index.story.d.ts +3 -3
  328. package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
  329. package/build-types/textarea-control/stories/index.story.d.ts +3 -3
  330. package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
  331. package/build-types/theme/index.d.ts +0 -1
  332. package/build-types/theme/index.d.ts.map +1 -1
  333. package/build-types/theme/stories/index.story.d.ts +4 -4
  334. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  335. package/build-types/tip/stories/index.story.d.ts +3 -3
  336. package/build-types/tip/stories/index.story.d.ts.map +1 -1
  337. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  338. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  339. package/build-types/toggle-group-control/stories/index.story.d.ts +6 -6
  340. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  341. package/build-types/toolbar/stories/index.story.d.ts +2 -2
  342. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  343. package/build-types/tools-panel/stories/index.story.d.ts +8 -8
  344. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  345. package/build-types/tools-panel/tools-panel/component.d.ts +0 -1
  346. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  347. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  348. package/build-types/tree-grid/stories/index.story.d.ts +2 -2
  349. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  350. package/build-types/tree-select/index.d.ts +0 -1
  351. package/build-types/tree-select/index.d.ts.map +1 -1
  352. package/build-types/tree-select/stories/index.story.d.ts +2 -2
  353. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  354. package/build-types/truncate/stories/index.story.d.ts +4 -4
  355. package/build-types/truncate/stories/index.story.d.ts.map +1 -1
  356. package/build-types/unit-control/index.d.ts +0 -1
  357. package/build-types/unit-control/index.d.ts.map +1 -1
  358. package/build-types/unit-control/stories/index.story.d.ts +7 -7
  359. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  360. package/build-types/utils/hooks/use-cx.d.ts +2 -1
  361. package/build-types/utils/hooks/use-cx.d.ts.map +1 -1
  362. package/build-types/v-stack/stories/e2e/index.story.d.ts +3 -3
  363. package/build-types/v-stack/stories/e2e/index.story.d.ts.map +1 -1
  364. package/build-types/v-stack/stories/index.story.d.ts +2 -2
  365. package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
  366. package/build-types/view/component.d.ts +0 -1
  367. package/build-types/view/component.d.ts.map +1 -1
  368. package/build-types/view/stories/index.story.d.ts +3 -3
  369. package/build-types/view/stories/index.story.d.ts.map +1 -1
  370. package/build-types/visually-hidden/stories/index.story.d.ts +5 -5
  371. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
  372. package/build-types/z-stack/stories/index.story.d.ts +3 -3
  373. package/build-types/z-stack/stories/index.story.d.ts.map +1 -1
  374. package/package.json +20 -20
  375. package/src/alignment-matrix-control/stories/index.story.tsx +7 -3
  376. package/src/angle-picker-control/stories/index.story.tsx +3 -3
  377. package/src/animate/stories/index.story.tsx +12 -10
  378. package/src/base-control/stories/index.story.tsx +5 -9
  379. package/src/border-box-control/stories/index.story.tsx +5 -9
  380. package/src/border-control/stories/index.story.tsx +8 -14
  381. package/src/button/stories/e2e/index.story.tsx +3 -3
  382. package/src/button/stories/index.story.tsx +10 -10
  383. package/src/button-group/stories/index.story.tsx +4 -6
  384. package/src/card/stories/index.story.tsx +5 -5
  385. package/src/checkbox-control/stories/index.story.tsx +7 -6
  386. package/src/circular-option-picker/stories/index.story.tsx +16 -4
  387. package/src/color-indicator/stories/index.story.tsx +4 -6
  388. package/src/color-palette/stories/index.story.tsx +12 -21
  389. package/src/color-picker/hsv-color-picker.native.js +88 -0
  390. package/src/color-picker/hue-picker.native.js +194 -0
  391. package/src/color-picker/index.native.js +2 -1
  392. package/src/color-picker/saturation-picker.native.js +163 -0
  393. package/src/color-picker/stories/index.story.tsx +3 -3
  394. package/src/color-picker/style.native.scss +23 -0
  395. package/src/combobox-control/stories/index.story.tsx +3 -3
  396. package/src/custom-gradient-picker/stories/index.story.tsx +3 -3
  397. package/src/date-time/stories/date-time.story.tsx +8 -10
  398. package/src/date-time/stories/date.story.tsx +8 -9
  399. package/src/date-time/stories/time.story.tsx +4 -4
  400. package/src/dimension-control/stories/index.story.tsx +3 -3
  401. package/src/disabled/stories/index.story.tsx +4 -4
  402. package/src/divider/stories/index.story.tsx +6 -6
  403. package/src/draggable/stories/index.story.tsx +5 -7
  404. package/src/drop-zone/stories/index.story.tsx +3 -3
  405. package/src/dropdown/stories/index.story.tsx +8 -6
  406. package/src/dropdown-menu/stories/index.story.tsx +3 -3
  407. package/src/dropdown-menu-v2/stories/index.story.tsx +24 -10
  408. package/src/duotone-picker/stories/duotone-picker.story.tsx +3 -6
  409. package/src/duotone-picker/stories/duotone-swatch.story.tsx +3 -3
  410. package/src/elevation/stories/index.story.tsx +7 -7
  411. package/src/external-link/stories/index.story.tsx +4 -6
  412. package/src/flex/stories/index.story.tsx +6 -6
  413. package/src/focal-point-picker/stories/index.story.tsx +3 -3
  414. package/src/font-size-picker/stories/e2e/index.story.tsx +3 -3
  415. package/src/font-size-picker/stories/index.story.tsx +10 -10
  416. package/src/form-file-upload/stories/index.story.tsx +3 -3
  417. package/src/form-toggle/stories/index.story.tsx +4 -7
  418. package/src/form-token-field/stories/index.story.tsx +10 -11
  419. package/src/gradient-picker/stories/index.story.tsx +3 -3
  420. package/src/grid/stories/index.story.tsx +4 -4
  421. package/src/guide/stories/index.story.tsx +3 -3
  422. package/src/h-stack/stories/e2e/index.story.tsx +4 -4
  423. package/src/h-stack/stories/index.story.tsx +4 -4
  424. package/src/heading/stories/index.story.tsx +3 -3
  425. package/src/icon/stories/index.story.tsx +5 -5
  426. package/src/input-control/stories/index.story.tsx +5 -3
  427. package/src/item-group/item/component.tsx +0 -1
  428. package/src/item-group/item-group/component.tsx +0 -1
  429. package/src/item-group/stories/index.story.tsx +11 -12
  430. package/src/keyboard-shortcuts/stories/index.story.tsx +3 -3
  431. package/src/menu-group/stories/index.story.tsx +5 -5
  432. package/src/menu-item/README.md +1 -1
  433. package/src/menu-item/index.tsx +5 -2
  434. package/src/menu-item/stories/index.story.tsx +80 -0
  435. package/src/menu-item/types.ts +3 -2
  436. package/src/menu-items-choice/stories/index.story.tsx +4 -6
  437. package/src/mobile/link-settings/link-settings-navigation.native.js +1 -1
  438. package/src/modal/stories/index.story.tsx +5 -10
  439. package/src/navigable-container/stories/navigable-menu.story.tsx +3 -3
  440. package/src/navigable-container/stories/tabbable-container.story.tsx +3 -3
  441. package/src/navigation/index.tsx +0 -1
  442. package/src/navigation/stories/index.story.tsx +16 -2
  443. package/src/navigation/stories/utils/controlled-state.tsx +2 -2
  444. package/src/navigation/stories/utils/default.tsx +2 -2
  445. package/src/navigation/stories/utils/group.tsx +2 -2
  446. package/src/navigation/stories/utils/hide-if-empty.tsx +2 -2
  447. package/src/navigation/stories/utils/more-examples.tsx +2 -2
  448. package/src/navigation/stories/utils/search.tsx +2 -2
  449. package/src/navigator/navigator-provider/component.tsx +0 -1
  450. package/src/navigator/stories/index.story.tsx +9 -10
  451. package/src/notice/stories/index.story.tsx +6 -6
  452. package/src/number-control/stories/index.story.tsx +3 -3
  453. package/src/palette-edit/stories/index.story.tsx +3 -3
  454. package/src/palette-edit/styles.js +0 -1
  455. package/src/panel/stories/index.story.tsx +9 -11
  456. package/src/placeholder/stories/index.story.tsx +4 -6
  457. package/src/popover/README.md +2 -2
  458. package/src/popover/index.tsx +69 -103
  459. package/src/popover/overlay-middlewares.tsx +2 -2
  460. package/src/popover/stories/index.story.tsx +8 -10
  461. package/src/popover/test/index.tsx +15 -1
  462. package/src/popover/types.ts +6 -0
  463. package/src/popover/utils.ts +5 -56
  464. package/src/progress-bar/stories/index.story.tsx +4 -6
  465. package/src/progress-bar/styles.ts +4 -1
  466. package/src/query-controls/stories/index.story.tsx +5 -6
  467. package/src/radio-control/stories/index.story.tsx +4 -6
  468. package/src/radio-group/stories/index.story.js +1 -0
  469. package/src/range-control/stories/index.story.tsx +12 -18
  470. package/src/resizable-box/stories/index.story.tsx +3 -3
  471. package/src/responsive-wrapper/stories/index.story.tsx +4 -5
  472. package/src/sandbox/stories/index.story.tsx +3 -5
  473. package/src/scroll-lock/stories/index.story.tsx +3 -3
  474. package/src/scrollable/stories/index.story.tsx +4 -4
  475. package/src/search-control/index.native.js +39 -27
  476. package/src/search-control/stories/index.story.tsx +3 -3
  477. package/src/select-control/stories/index.story.tsx +3 -3
  478. package/src/shortcut/index.tsx +13 -0
  479. package/src/shortcut/stories/index.story.tsx +33 -0
  480. package/src/slot-fill/README.md +5 -5
  481. package/src/slot-fill/bubbles-virtually/slot-fill-context.js +3 -0
  482. package/src/slot-fill/bubbles-virtually/slot.js +17 -5
  483. package/src/slot-fill/index.js +6 -1
  484. package/src/slot-fill/stories/index.story.js +2 -0
  485. package/src/slot-fill/test/__snapshots__/slot.js.snap +12 -4
  486. package/src/snackbar/stories/index.story.tsx +10 -13
  487. package/src/snackbar/stories/list.story.tsx +3 -3
  488. package/src/spacer/stories/index.story.tsx +4 -4
  489. package/src/spinner/index.tsx +0 -1
  490. package/src/spinner/stories/index.story.tsx +5 -5
  491. package/src/surface/stories/index.story.tsx +4 -4
  492. package/src/tab-panel/stories/index.story.tsx +5 -13
  493. package/src/tab-panel/test/index.tsx +9 -25
  494. package/src/text-control/stories/index.story.tsx +7 -6
  495. package/src/text-highlight/stories/index.story.tsx +4 -6
  496. package/src/textarea-control/stories/index.story.tsx +4 -6
  497. package/src/theme/index.tsx +0 -1
  498. package/src/theme/stories/index.story.tsx +5 -5
  499. package/src/tip/stories/index.story.tsx +4 -4
  500. package/src/toggle-control/stories/index.story.tsx +3 -3
  501. package/src/toggle-group-control/stories/index.story.tsx +17 -11
  502. package/src/toolbar/stories/index.story.tsx +13 -3
  503. package/src/tools-panel/stories/index.story.tsx +17 -12
  504. package/src/tools-panel/tools-panel/component.tsx +0 -1
  505. package/src/tools-panel/tools-panel-header/component.tsx +3 -0
  506. package/src/tree-grid/stories/index.story.tsx +5 -3
  507. package/src/tree-select/index.tsx +0 -1
  508. package/src/tree-select/stories/index.story.tsx +3 -3
  509. package/src/truncate/stories/index.story.tsx +5 -7
  510. package/src/unit-control/index.tsx +0 -1
  511. package/src/unit-control/stories/index.story.tsx +10 -9
  512. package/src/utils/hooks/use-cx.ts +2 -1
  513. package/src/v-stack/stories/e2e/index.story.tsx +4 -4
  514. package/src/v-stack/stories/index.story.tsx +3 -3
  515. package/src/view/component.tsx +0 -1
  516. package/src/view/stories/index.story.tsx +4 -4
  517. package/src/visually-hidden/stories/index.story.tsx +7 -7
  518. package/src/z-stack/stories/index.story.tsx +4 -4
  519. package/tsconfig.tsbuildinfo +1 -1
  520. package/build/popover/limit-shift.js +0 -129
  521. package/build/popover/limit-shift.js.map +0 -1
  522. package/build-module/popover/limit-shift.js +0 -122
  523. package/build-module/popover/limit-shift.js.map +0 -1
  524. package/build-types/popover/limit-shift.d.ts +0 -87
  525. package/build-types/popover/limit-shift.d.ts.map +0 -1
  526. package/src/popover/limit-shift.ts +0 -205
@@ -40,7 +40,6 @@ const UnconnectedToolsPanel = (props, forwardedRef) => {
40
40
  * by a header. The header includes a dropdown menu which is automatically
41
41
  * generated from the panel's inner `ToolsPanelItems`.
42
42
  *
43
- * @example
44
43
  * ```jsx
45
44
  * import { __ } from '@wordpress/i18n';
46
45
  * import {
@@ -1 +1 @@
1
- {"version":3,"names":["ToolsPanelHeader","ToolsPanelContext","useToolsPanel","Grid","contextConnect","UnconnectedToolsPanel","props","forwardedRef","children","label","panelContext","resetAllItems","toggleItem","headingLevel","toolsPanelProps","createElement","columns","ref","Provider","value","resetAll","ToolsPanel"],"sources":["@wordpress/components/src/tools-panel/tools-panel/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ToolsPanelHeader from '../tools-panel-header';\nimport { ToolsPanelContext } from '../context';\nimport { useToolsPanel } from './hook';\nimport { Grid } from '../../grid';\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { contextConnect } from '../../ui/context';\nimport type { ToolsPanelProps } from '../types';\n\nconst UnconnectedToolsPanel = (\n\tprops: WordPressComponentProps< ToolsPanelProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tchildren,\n\t\tlabel,\n\t\tpanelContext,\n\t\tresetAllItems,\n\t\ttoggleItem,\n\t\theadingLevel,\n\t\t...toolsPanelProps\n\t} = useToolsPanel( props );\n\n\treturn (\n\t\t<Grid { ...toolsPanelProps } columns={ 2 } ref={ forwardedRef }>\n\t\t\t<ToolsPanelContext.Provider value={ panelContext }>\n\t\t\t\t<ToolsPanelHeader\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tresetAll={ resetAllItems }\n\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</ToolsPanelContext.Provider>\n\t\t</Grid>\n\t);\n};\n\n/**\n * The `ToolsPanel` is a container component that displays its children preceded\n * by a header. The header includes a dropdown menu which is automatically\n * generated from the panel's inner `ToolsPanelItems`.\n *\n * @example\n * ```jsx\n * import { __ } from '@wordpress/i18n';\n * import {\n * __experimentalToolsPanel as ToolsPanel,\n * __experimentalToolsPanelItem as ToolsPanelItem,\n * __experimentalUnitControl as UnitControl\n * } from '@wordpress/components';\n *\n * function Example() {\n * const [ height, setHeight ] = useState();\n * const [ width, setWidth ] = useState();\n *\n * const resetAll = () => {\n * setHeight();\n * setWidth();\n * }\n *\n * return (\n * <ToolsPanel label={ __( 'Dimensions' ) } resetAll={ resetAll }>\n * <ToolsPanelItem\n * hasValue={ () => !! height }\n * label={ __( 'Height' ) }\n * onDeselect={ () => setHeight() }\n * >\n * <UnitControl\n * label={ __( 'Height' ) }\n * onChange={ setHeight }\n * value={ height }\n * />\n * </ToolsPanelItem>\n * <ToolsPanelItem\n * hasValue={ () => !! width }\n * label={ __( 'Width' ) }\n * onDeselect={ () => setWidth() }\n * >\n * <UnitControl\n * label={ __( 'Width' ) }\n * onChange={ setWidth }\n * value={ width }\n * />\n * </ToolsPanelItem>\n * </ToolsPanel>\n * );\n * }\n * ```\n */\nexport const ToolsPanel = contextConnect( UnconnectedToolsPanel, 'ToolsPanel' );\n\nexport default ToolsPanel;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAOA,gBAAgB,MAAM,uBAAuB;AACpD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,aAAa,QAAQ,QAAQ;AACtC,SAASC,IAAI,QAAQ,YAAY;AAEjC,SAASC,cAAc,QAAQ,kBAAkB;AAGjD,MAAMC,qBAAqB,GAAGA,CAC7BC,KAAwD,EACxDC,YAAiC,KAC7B;EACJ,MAAM;IACLC,QAAQ;IACRC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC,UAAU;IACVC,YAAY;IACZ,GAAGC;EACJ,CAAC,GAAGZ,aAAa,CAAEI,KAAM,CAAC;EAE1B,OACCS,aAAA,CAACZ,IAAI;IAAA,GAAMW,eAAe;IAAGE,OAAO,EAAG,CAAG;IAACC,GAAG,EAAGV;EAAc,GAC9DQ,aAAA,CAACd,iBAAiB,CAACiB,QAAQ;IAACC,KAAK,EAAGT;EAAc,GACjDK,aAAA,CAACf,gBAAgB;IAChBS,KAAK,EAAGA,KAAO;IACfW,QAAQ,EAAGT,aAAe;IAC1BC,UAAU,EAAGA,UAAY;IACzBC,YAAY,EAAGA;EAAc,CAC7B,CAAC,EACAL,QACyB,CACvB,CAAC;AAET,CAAC;;AAED;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMa,UAAU,GAAGjB,cAAc,CAAEC,qBAAqB,EAAE,YAAa,CAAC;AAE/E,eAAegB,UAAU"}
1
+ {"version":3,"names":["ToolsPanelHeader","ToolsPanelContext","useToolsPanel","Grid","contextConnect","UnconnectedToolsPanel","props","forwardedRef","children","label","panelContext","resetAllItems","toggleItem","headingLevel","toolsPanelProps","createElement","columns","ref","Provider","value","resetAll","ToolsPanel"],"sources":["@wordpress/components/src/tools-panel/tools-panel/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ToolsPanelHeader from '../tools-panel-header';\nimport { ToolsPanelContext } from '../context';\nimport { useToolsPanel } from './hook';\nimport { Grid } from '../../grid';\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { contextConnect } from '../../ui/context';\nimport type { ToolsPanelProps } from '../types';\n\nconst UnconnectedToolsPanel = (\n\tprops: WordPressComponentProps< ToolsPanelProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tchildren,\n\t\tlabel,\n\t\tpanelContext,\n\t\tresetAllItems,\n\t\ttoggleItem,\n\t\theadingLevel,\n\t\t...toolsPanelProps\n\t} = useToolsPanel( props );\n\n\treturn (\n\t\t<Grid { ...toolsPanelProps } columns={ 2 } ref={ forwardedRef }>\n\t\t\t<ToolsPanelContext.Provider value={ panelContext }>\n\t\t\t\t<ToolsPanelHeader\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tresetAll={ resetAllItems }\n\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</ToolsPanelContext.Provider>\n\t\t</Grid>\n\t);\n};\n\n/**\n * The `ToolsPanel` is a container component that displays its children preceded\n * by a header. The header includes a dropdown menu which is automatically\n * generated from the panel's inner `ToolsPanelItems`.\n *\n * ```jsx\n * import { __ } from '@wordpress/i18n';\n * import {\n * __experimentalToolsPanel as ToolsPanel,\n * __experimentalToolsPanelItem as ToolsPanelItem,\n * __experimentalUnitControl as UnitControl\n * } from '@wordpress/components';\n *\n * function Example() {\n * const [ height, setHeight ] = useState();\n * const [ width, setWidth ] = useState();\n *\n * const resetAll = () => {\n * setHeight();\n * setWidth();\n * }\n *\n * return (\n * <ToolsPanel label={ __( 'Dimensions' ) } resetAll={ resetAll }>\n * <ToolsPanelItem\n * hasValue={ () => !! height }\n * label={ __( 'Height' ) }\n * onDeselect={ () => setHeight() }\n * >\n * <UnitControl\n * label={ __( 'Height' ) }\n * onChange={ setHeight }\n * value={ height }\n * />\n * </ToolsPanelItem>\n * <ToolsPanelItem\n * hasValue={ () => !! width }\n * label={ __( 'Width' ) }\n * onDeselect={ () => setWidth() }\n * >\n * <UnitControl\n * label={ __( 'Width' ) }\n * onChange={ setWidth }\n * value={ width }\n * />\n * </ToolsPanelItem>\n * </ToolsPanel>\n * );\n * }\n * ```\n */\nexport const ToolsPanel = contextConnect( UnconnectedToolsPanel, 'ToolsPanel' );\n\nexport default ToolsPanel;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAOA,gBAAgB,MAAM,uBAAuB;AACpD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,aAAa,QAAQ,QAAQ;AACtC,SAASC,IAAI,QAAQ,YAAY;AAEjC,SAASC,cAAc,QAAQ,kBAAkB;AAGjD,MAAMC,qBAAqB,GAAGA,CAC7BC,KAAwD,EACxDC,YAAiC,KAC7B;EACJ,MAAM;IACLC,QAAQ;IACRC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC,UAAU;IACVC,YAAY;IACZ,GAAGC;EACJ,CAAC,GAAGZ,aAAa,CAAEI,KAAM,CAAC;EAE1B,OACCS,aAAA,CAACZ,IAAI;IAAA,GAAMW,eAAe;IAAGE,OAAO,EAAG,CAAG;IAACC,GAAG,EAAGV;EAAc,GAC9DQ,aAAA,CAACd,iBAAiB,CAACiB,QAAQ;IAACC,KAAK,EAAGT;EAAc,GACjDK,aAAA,CAACf,gBAAgB;IAChBS,KAAK,EAAGA,KAAO;IACfW,QAAQ,EAAGT,aAAe;IAC1BC,UAAU,EAAGA,UAAY;IACzBC,YAAY,EAAGA;EAAc,CAC7B,CAAC,EACAL,QACyB,CACvB,CAAC;AAET,CAAC;;AAED;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMa,UAAU,GAAGjB,cAAc,CAAEC,qBAAqB,EAAE,YAAa,CAAC;AAE/E,eAAegB,UAAU"}
@@ -146,7 +146,11 @@ const ToolsPanelHeader = (props, forwardedRef) => {
146
146
  items: optionalItems,
147
147
  toggleItem: toggleItem
148
148
  }), createElement(MenuGroup, null, createElement(MenuItem, {
149
- "aria-disabled": !canResetAll,
149
+ "aria-disabled": !canResetAll
150
+ // @ts-expect-error - TODO: If this "tertiary" style is something we really want to allow on MenuItem,
151
+ // we should rename it and explicitly allow it as an official API. All the other Button variants
152
+ // don't make sense in a MenuItem context, and should be disallowed.
153
+ ,
150
154
  variant: 'tertiary',
151
155
  onClick: () => {
152
156
  if (canResetAll) {
@@ -1 +1 @@
1
- {"version":3,"names":["speak","check","moreVertical","plus","__","_x","sprintf","DropdownMenu","MenuGroup","MenuItem","HStack","Heading","useToolsPanelHeader","contextConnect","ResetLabel","DefaultControlsGroup","itemClassName","items","toggleItem","length","resetSuffix","createElement","label","map","hasValue","key","className","role","onClick","suffix","isSelected","OptionalControlsGroup","itemLabel","icon","ToolsPanelHeader","props","forwardedRef","areAllOptionalControlsHidden","defaultControlsItemClassName","dropdownMenuClassName","hasMenuItems","headingClassName","headingLevel","labelText","menuItems","resetAll","headerProps","defaultItems","Object","entries","default","optionalItems","optional","dropDownMenuIcon","dropDownMenuLabelText","dropdownMenuDescriptionText","undefined","canResetAll","some","ref","level","menuProps","toggleProps","isSmall","describedBy","Fragment","variant","ConnectedToolsPanelHeader"],"sources":["@wordpress/components/src/tools-panel/tools-panel-header/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { check, moreVertical, plus } from '@wordpress/icons';\nimport { __, _x, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DropdownMenu from '../../dropdown-menu';\nimport MenuGroup from '../../menu-group';\nimport MenuItem from '../../menu-item';\nimport { HStack } from '../../h-stack';\nimport { Heading } from '../../heading';\nimport { useToolsPanelHeader } from './hook';\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { contextConnect } from '../../ui/context';\nimport { ResetLabel } from '../styles';\nimport type {\n\tToolsPanelControlsGroupProps,\n\tToolsPanelHeaderProps,\n} from '../types';\n\nconst DefaultControlsGroup = ( {\n\titemClassName,\n\titems,\n\ttoggleItem,\n}: ToolsPanelControlsGroupProps ) => {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\tconst resetSuffix = <ResetLabel aria-hidden>{ __( 'Reset' ) }</ResetLabel>;\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Defaults' ) }>\n\t\t\t{ items.map( ( [ label, hasValue ] ) => {\n\t\t\t\tif ( hasValue ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\t\tclassName={ itemClassName }\n\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t__( 'Reset %s' ),\n\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\ttoggleItem( label );\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s reset to default' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsuffix={ resetSuffix }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\tclassName={ itemClassName }\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t\tisSelected\n\t\t\t\t\t\taria-disabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</MenuGroup>\n\t);\n};\n\nconst OptionalControlsGroup = ( {\n\titems,\n\ttoggleItem,\n}: ToolsPanelControlsGroupProps ) => {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t{ items.map( ( [ label, isSelected ] ) => {\n\t\t\t\tconst itemLabel = isSelected\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: The name of the control being hidden and reset e.g. \"Padding\".\n\t\t\t\t\t\t\t__( 'Hide and reset %s' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t// translators: %s: The name of the control to display e.g. \"Padding\".\n\t\t\t\t\t\t\t__( 'Show %s' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t );\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\ticon={ isSelected ? check : null }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tlabel={ itemLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( isSelected ) {\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s hidden and reset to default' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s is now visible' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttoggleItem( label );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</MenuGroup>\n\t);\n};\n\nconst ToolsPanelHeader = (\n\tprops: WordPressComponentProps< ToolsPanelHeaderProps, 'h2' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tareAllOptionalControlsHidden,\n\t\tdefaultControlsItemClassName,\n\t\tdropdownMenuClassName,\n\t\thasMenuItems,\n\t\theadingClassName,\n\t\theadingLevel = 2,\n\t\tlabel: labelText,\n\t\tmenuItems,\n\t\tresetAll,\n\t\ttoggleItem,\n\t\t...headerProps\n\t} = useToolsPanelHeader( props );\n\n\tif ( ! labelText ) {\n\t\treturn null;\n\t}\n\n\tconst defaultItems = Object.entries( menuItems?.default || {} );\n\tconst optionalItems = Object.entries( menuItems?.optional || {} );\n\tconst dropDownMenuIcon = areAllOptionalControlsHidden ? plus : moreVertical;\n\tconst dropDownMenuLabelText = sprintf(\n\t\t// translators: %s: The name of the tool e.g. \"Color\" or \"Typography\".\n\t\t_x( '%s options', 'Button label to reveal tool panel options' ),\n\t\tlabelText\n\t);\n\tconst dropdownMenuDescriptionText = areAllOptionalControlsHidden\n\t\t? __( 'All options are currently hidden' )\n\t\t: undefined;\n\n\tconst canResetAll = [ ...defaultItems, ...optionalItems ].some(\n\t\t( [ , isSelected ] ) => isSelected\n\t);\n\n\treturn (\n\t\t<HStack { ...headerProps } ref={ forwardedRef }>\n\t\t\t<Heading level={ headingLevel } className={ headingClassName }>\n\t\t\t\t{ labelText }\n\t\t\t</Heading>\n\t\t\t{ hasMenuItems && (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ticon={ dropDownMenuIcon }\n\t\t\t\t\tlabel={ dropDownMenuLabelText }\n\t\t\t\t\tmenuProps={ { className: dropdownMenuClassName } }\n\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\tdescribedBy: dropdownMenuDescriptionText,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ () => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<DefaultControlsGroup\n\t\t\t\t\t\t\t\titems={ defaultItems }\n\t\t\t\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\t\t\t\titemClassName={ defaultControlsItemClassName }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<OptionalControlsGroup\n\t\t\t\t\t\t\t\titems={ optionalItems }\n\t\t\t\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\taria-disabled={ ! canResetAll }\n\t\t\t\t\t\t\t\t\tvariant={ 'tertiary' }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tif ( canResetAll ) {\n\t\t\t\t\t\t\t\t\t\t\tresetAll();\n\t\t\t\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'All options reset' ),\n\t\t\t\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset all' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</DropdownMenu>\n\t\t\t) }\n\t\t</HStack>\n\t);\n};\n\nconst ConnectedToolsPanelHeader = contextConnect(\n\tToolsPanelHeader,\n\t'ToolsPanelHeader'\n);\n\nexport default ConnectedToolsPanelHeader;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,iBAAiB;AACvC,SAASC,KAAK,EAAEC,YAAY,EAAEC,IAAI,QAAQ,kBAAkB;AAC5D,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,qBAAqB;AAC9C,OAAOC,SAAS,MAAM,kBAAkB;AACxC,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,SAASC,MAAM,QAAQ,eAAe;AACtC,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,mBAAmB,QAAQ,QAAQ;AAE5C,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,UAAU,QAAQ,WAAW;AAMtC,MAAMC,oBAAoB,GAAGA,CAAE;EAC9BC,aAAa;EACbC,KAAK;EACLC;AAC6B,CAAC,KAAM;EACpC,IAAK,CAAED,KAAK,CAACE,MAAM,EAAG;IACrB,OAAO,IAAI;EACZ;EAEA,MAAMC,WAAW,GAAGC,aAAA,CAACP,UAAU;IAAC;EAAW,GAAGV,EAAE,CAAE,OAAQ,CAAe,CAAC;EAE1E,OACCiB,aAAA,CAACb,SAA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Y,CACT,CACA,CACV,CAEU,CAER,CAAC;AAEX,CAAC;AAED,MAAM+D,yBAAyB,GAAGtD,cAAc,CAC/CqB,gBAAgB,EAChB,kBACD,CAAC;AAED,eAAeiC,yBAAyB"}
1
+ {"version":3,"names":["speak","check","moreVertical","plus","__","_x","sprintf","DropdownMenu","MenuGroup","MenuItem","HStack","Heading","useToolsPanelHeader","contextConnect","ResetLabel","DefaultControlsGroup","itemClassName","items","toggleItem","length","resetSuffix","createElement","label","map","hasValue","key","className","role","onClick","suffix","isSelected","OptionalControlsGroup","itemLabel","icon","ToolsPanelHeader","props","forwardedRef","areAllOptionalControlsHidden","defaultControlsItemClassName","dropdownMenuClassName","hasMenuItems","headingClassName","headingLevel","labelText","menuItems","resetAll","headerProps","defaultItems","Object","entries","default","optionalItems","optional","dropDownMenuIcon","dropDownMenuLabelText","dropdownMenuDescriptionText","undefined","canResetAll","some","ref","level","menuProps","toggleProps","isSmall","describedBy","Fragment","variant","ConnectedToolsPanelHeader"],"sources":["@wordpress/components/src/tools-panel/tools-panel-header/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { check, moreVertical, plus } from '@wordpress/icons';\nimport { __, _x, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DropdownMenu from '../../dropdown-menu';\nimport MenuGroup from '../../menu-group';\nimport MenuItem from '../../menu-item';\nimport { HStack } from '../../h-stack';\nimport { Heading } from '../../heading';\nimport { useToolsPanelHeader } from './hook';\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { contextConnect } from '../../ui/context';\nimport { ResetLabel } from '../styles';\nimport type {\n\tToolsPanelControlsGroupProps,\n\tToolsPanelHeaderProps,\n} from '../types';\n\nconst DefaultControlsGroup = ( {\n\titemClassName,\n\titems,\n\ttoggleItem,\n}: ToolsPanelControlsGroupProps ) => {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\tconst resetSuffix = <ResetLabel aria-hidden>{ __( 'Reset' ) }</ResetLabel>;\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Defaults' ) }>\n\t\t\t{ items.map( ( [ label, hasValue ] ) => {\n\t\t\t\tif ( hasValue ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\t\tclassName={ itemClassName }\n\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t__( 'Reset %s' ),\n\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\ttoggleItem( label );\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s reset to default' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsuffix={ resetSuffix }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\tclassName={ itemClassName }\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t\tisSelected\n\t\t\t\t\t\taria-disabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</MenuGroup>\n\t);\n};\n\nconst OptionalControlsGroup = ( {\n\titems,\n\ttoggleItem,\n}: ToolsPanelControlsGroupProps ) => {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t{ items.map( ( [ label, isSelected ] ) => {\n\t\t\t\tconst itemLabel = isSelected\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: The name of the control being hidden and reset e.g. \"Padding\".\n\t\t\t\t\t\t\t__( 'Hide and reset %s' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t// translators: %s: The name of the control to display e.g. \"Padding\".\n\t\t\t\t\t\t\t__( 'Show %s' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t );\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\ticon={ isSelected ? check : null }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tlabel={ itemLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( isSelected ) {\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s hidden and reset to default' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The name of the control being reset e.g. \"Padding\".\n\t\t\t\t\t\t\t\t\t\t__( '%s is now visible' ),\n\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttoggleItem( label );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</MenuGroup>\n\t);\n};\n\nconst ToolsPanelHeader = (\n\tprops: WordPressComponentProps< ToolsPanelHeaderProps, 'h2' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tareAllOptionalControlsHidden,\n\t\tdefaultControlsItemClassName,\n\t\tdropdownMenuClassName,\n\t\thasMenuItems,\n\t\theadingClassName,\n\t\theadingLevel = 2,\n\t\tlabel: labelText,\n\t\tmenuItems,\n\t\tresetAll,\n\t\ttoggleItem,\n\t\t...headerProps\n\t} = useToolsPanelHeader( props );\n\n\tif ( ! labelText ) {\n\t\treturn null;\n\t}\n\n\tconst defaultItems = Object.entries( menuItems?.default || {} );\n\tconst optionalItems = Object.entries( menuItems?.optional || {} );\n\tconst dropDownMenuIcon = areAllOptionalControlsHidden ? plus : moreVertical;\n\tconst dropDownMenuLabelText = sprintf(\n\t\t// translators: %s: The name of the tool e.g. \"Color\" or \"Typography\".\n\t\t_x( '%s options', 'Button label to reveal tool panel options' ),\n\t\tlabelText\n\t);\n\tconst dropdownMenuDescriptionText = areAllOptionalControlsHidden\n\t\t? __( 'All options are currently hidden' )\n\t\t: undefined;\n\n\tconst canResetAll = [ ...defaultItems, ...optionalItems ].some(\n\t\t( [ , isSelected ] ) => isSelected\n\t);\n\n\treturn (\n\t\t<HStack { ...headerProps } ref={ forwardedRef }>\n\t\t\t<Heading level={ headingLevel } className={ headingClassName }>\n\t\t\t\t{ labelText }\n\t\t\t</Heading>\n\t\t\t{ hasMenuItems && (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ticon={ dropDownMenuIcon }\n\t\t\t\t\tlabel={ dropDownMenuLabelText }\n\t\t\t\t\tmenuProps={ { className: dropdownMenuClassName } }\n\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\tisSmall: true,\n\t\t\t\t\t\tdescribedBy: dropdownMenuDescriptionText,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ () => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<DefaultControlsGroup\n\t\t\t\t\t\t\t\titems={ defaultItems }\n\t\t\t\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\t\t\t\titemClassName={ defaultControlsItemClassName }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<OptionalControlsGroup\n\t\t\t\t\t\t\t\titems={ optionalItems }\n\t\t\t\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\taria-disabled={ ! canResetAll }\n\t\t\t\t\t\t\t\t\t// @ts-expect-error - TODO: If this \"tertiary\" style is something we really want to allow on MenuItem,\n\t\t\t\t\t\t\t\t\t// we should rename it and explicitly allow it as an official API. All the other Button variants\n\t\t\t\t\t\t\t\t\t// don't make sense in a MenuItem context, and should be disallowed.\n\t\t\t\t\t\t\t\t\tvariant={ 'tertiary' }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tif ( canResetAll ) {\n\t\t\t\t\t\t\t\t\t\t\tresetAll();\n\t\t\t\t\t\t\t\t\t\t\tspeak(\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'All options reset' ),\n\t\t\t\t\t\t\t\t\t\t\t\t'assertive'\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset all' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</DropdownMenu>\n\t\t\t) }\n\t\t</HStack>\n\t);\n};\n\nconst ConnectedToolsPanelHeader = contextConnect(\n\tToolsPanelHeader,\n\t'ToolsPanelHeader'\n);\n\nexport default ConnectedToolsPanelHeader;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,iBAAiB;AACvC,SAASC,KAAK,EAAEC,YAAY,EAAEC,IAAI,QAAQ,kBAAkB;AAC5D,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,qBAAqB;AAC9C,OAAOC,SAAS,MAAM,kBAAkB;AACxC,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,SAASC,MAAM,QAAQ,eAAe;AACtC,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,mBAAmB,QAAQ,QAAQ;AAE5C,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,UAAU,QAAQ,WAAW;AAMtC,MAAMC,oBAAoB,GAAGA,CAAE;EAC9BC,aAAa;EACbC,KAAK;EACLC;AAC6B,CAAC,KAAM;EACpC,IAAK,CAAED,KAAK,CAACE,MAAM,EAAG;IACrB,OAAO,IAAI;EACZ;EAEA,MAAMC,WAAW,GAAGC,aAAA,CAACP,UAAU;IAAC;EAAW,GAAGV,EAAE,CAAE,OAAQ,CAAe,CAAC;EAE1E,OACCiB,aAAA,CAACb,SAAS;IAACc,KAAK,EAAGlB,EAAE,CAAE,UAAW;EAAG,GAClCa,KAAK,CAACM,GAAG,CAAE,CAAE,CAAED,KAAK,EAAEE,QAAQ,CAAE,KAAM;IACvC,IAAKA,QAAQ,EAAG;MACf,OACCH,aAAA,CAACZ,QAAQ;QACRgB,GAAG,EAAGH,KAAO;QACbI,SAAS,EAAGV,aA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C7D,CAAE,GAAI5B,UAAU,CAAE,KAAMA,UACzB,CAAC;EAED,OACCT,aAAA,CAACX,MAAM;IAAA,GAAMoC,WAAW;IAAGa,GAAG,EAAGvB;EAAc,GAC9Cf,aAAA,CAACV,OAAO;IAACiD,KAAK,EAAGlB,YAAc;IAAChB,SAAS,EAAGe;EAAkB,GAC3DE,SACM,CAAC,EACRH,YAAY,IACbnB,aAAA,CAACd,YAAY;IACZ0B,IAAI,EAAGoB,gBAAkB;IACzB/B,KAAK,EAAGgC,qBAAuB;IAC/BO,SAAS,EAAG;MAAEnC,SAAS,EAAEa;IAAsB,CAAG;IAClDuB,WAAW,EAAG;MACbC,OAAO,EAAE,IAAI;MACbC,WAAW,EAAET;IACd;EAAG,GAED,MACDlC,aAAA,CAAA4C,QAAA,QACC5C,aAAA,CAACN,oBAAoB;IACpBE,KAAK,EAAG8B,YAAc;IACtB7B,UAAU,EAAGA,UAAY;IACzBF,aAAa,EAAGsB;EAA8B,CAC9C,CAAC,EACFjB,aAAA,CAACU,qBAAqB;IACrBd,KAAK,EAAGkC,aAAe;IACvBjC,UAAU,EAAGA;EAAY,CACzB,CAAC,EACFG,aAAA,CAACb,SAAS,QACTa,aAAA,CAACZ,QAAQ;IACR,iBAAgB,CAAEgD;IAClB;IACA;IACA;IAAA;IACAS,OAAO,EAAG,UAAY;IACtBtC,OAAO,EAAGA,CAAA,KAAM;MACf,IAAK6B,WAAW,EAAG;QAClBZ,QAAQ,CAAC,CAAC;QACV7C,KAAK,CACJI,EAAE,CAAE,mBAAoB,CAAC,EACzB,WACD,CAAC;MACF;IACD;EAAG,GAEDA,EAAE,CAAE,WAAY,CACT,CACA,CACV,CAEU,CAER,CAAC;AAEX,CAAC;AAED,MAAM+D,yBAAyB,GAAGtD,cAAc,CAC/CqB,gBAAgB,EAChB,kBACD,CAAC;AAED,eAAeiC,yBAAyB"}
@@ -19,7 +19,6 @@ function getSelectOptions(tree, level = 0) {
19
19
  /**
20
20
  * TreeSelect component is used to generate select input fields.
21
21
  *
22
- * @example
23
22
  * ```jsx
24
23
  * import { TreeSelect } from '@wordpress/components';
25
24
  * import { useState } from '@wordpress/element';
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","decodeEntities","SelectControl","getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options","filter","option","createElement"],"sources":["@wordpress/components/src/tree-select/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport type { TreeSelectProps, Tree, Truthy } from './types';\n\nfunction getSelectOptions(\n\ttree: Tree[],\n\tlevel = 0\n): NonNullable< TreeSelectProps[ 'options' ] > {\n\treturn tree.flatMap( ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\t'\\u00A0'.repeat( level * 3 ) + decodeEntities( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\n/**\n * TreeSelect component is used to generate select input fields.\n *\n * @example\n * ```jsx\n * import { TreeSelect } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTreeSelect = () => {\n * \tconst [ page, setPage ] = useState( 'p21' );\n *\n * \treturn (\n * \t\t<TreeSelect\n * \t\t\tlabel=\"Parent page\"\n * \t\t\tnoOptionLabel=\"No parent page\"\n * \t\t\tonChange={ ( newPage ) => setPage( newPage ) }\n * \t\t\tselectedId={ page }\n * \t\t\ttree={ [\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 1',\n * \t\t\t\t\tid: 'p1',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{ name: 'Descend 1 of page 1', id: 'p11' },\n * \t\t\t\t\t\t{ name: 'Descend 2 of page 1', id: 'p12' },\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 2',\n * \t\t\t\t\tid: 'p2',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tname: 'Descend 1 of page 2',\n * \t\t\t\t\t\t\tid: 'p21',\n * \t\t\t\t\t\t\tchildren: [\n * \t\t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\t\tname: 'Descend 1 of Descend 1 of page 2',\n * \t\t\t\t\t\t\t\t\tid: 'p211',\n * \t\t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t],\n * \t\t\t\t\t\t},\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\n\nexport function TreeSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tonChange,\n\tselectedId,\n\ttree = [],\n\t...props\n}: TreeSelectProps ) {\n\tconst options = useMemo( () => {\n\t\treturn [\n\t\t\tnoOptionLabel && { value: '', label: noOptionLabel },\n\t\t\t...getSelectOptions( tree ),\n\t\t].filter( < T, >( option: T ): option is Truthy< T > => !! option );\n\t}, [ noOptionLabel, tree ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t{ ...{ label, options, onChange } }\n\t\t\tvalue={ selectedId }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default TreeSelect;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,aAAa,QAAQ,mBAAmB;AAGjD,SAASC,gBAAgBA,CACxBC,IAAY,EACZC,KAAK,GAAG,CAAC,EACqC;EAC9C,OAAOD,IAAI,CAACE,OAAO,CAAIC,QAAQ,IAAM,CACpC;IACCC,KAAK,EAAED,QAAQ,CAACE,EAAE;IAClBC,KAAK,EACJ,QAAQ,CAACC,MAAM,CAAEN,KAAK,GAAG,CAAE,CAAC,GAAGJ,cAAc,CAAEM,QAAQ,CAACK,IAAK;EAC/D,CAAC,EACD,GAAGT,gBAAgB,CAAEI,QAAQ,CAACM,QAAQ,IAAI,EAAE,EAAER,KAAK,GAAG,CAAE,CAAC,CACxD,CAAC;AACJ;;AAEA;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;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASS,UAAUA,CAAE;EAC3BJ,KAAK;EACLK,aAAa;EACbC,QAAQ;EACRC,UAAU;EACVb,IAAI,GAAG,EAAE;EACT,GAAGc;AACa,CAAC,EAAG;EACpB,MAAMC,OAAO,GAAGnB,OAAO,CAAE,MAAM;IAC9B,OAAO,CACNe,aAAa,IAAI;MAAEP,KAAK,EAAE,EAAE;MAAEE,KAAK,EAAEK;IAAc,CAAC,EACpD,GAAGZ,gBAAgB,CAAEC,IAAK,CAAC,CAC3B,CAACgB,MAAM,CAAUC,MAAS,IAA6B,CAAC,CAAEA,MAAO,CAAC;EACpE,CAAC,EAAE,CAAEN,aAAa,EAAEX,IAAI,CAAG,CAAC;EAE5B,OACCkB,aAAA,CAACpB,aAAa;IACNQ,KAAK;IAAES,OAAO;IAAEH,QAAQ;IAC/BR,KAAK,EAAGS,UAAY;IAAA,GACfC;EAAK,CACV,CAAC;AAEJ;AAEA,eAAeJ,UAAU"}
1
+ {"version":3,"names":["useMemo","decodeEntities","SelectControl","getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options","filter","option","createElement"],"sources":["@wordpress/components/src/tree-select/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport type { TreeSelectProps, Tree, Truthy } from './types';\n\nfunction getSelectOptions(\n\ttree: Tree[],\n\tlevel = 0\n): NonNullable< TreeSelectProps[ 'options' ] > {\n\treturn tree.flatMap( ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\t'\\u00A0'.repeat( level * 3 ) + decodeEntities( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\n/**\n * TreeSelect component is used to generate select input fields.\n *\n * ```jsx\n * import { TreeSelect } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTreeSelect = () => {\n * \tconst [ page, setPage ] = useState( 'p21' );\n *\n * \treturn (\n * \t\t<TreeSelect\n * \t\t\tlabel=\"Parent page\"\n * \t\t\tnoOptionLabel=\"No parent page\"\n * \t\t\tonChange={ ( newPage ) => setPage( newPage ) }\n * \t\t\tselectedId={ page }\n * \t\t\ttree={ [\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 1',\n * \t\t\t\t\tid: 'p1',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{ name: 'Descend 1 of page 1', id: 'p11' },\n * \t\t\t\t\t\t{ name: 'Descend 2 of page 1', id: 'p12' },\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 2',\n * \t\t\t\t\tid: 'p2',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tname: 'Descend 1 of page 2',\n * \t\t\t\t\t\t\tid: 'p21',\n * \t\t\t\t\t\t\tchildren: [\n * \t\t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\t\tname: 'Descend 1 of Descend 1 of page 2',\n * \t\t\t\t\t\t\t\t\tid: 'p211',\n * \t\t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t],\n * \t\t\t\t\t\t},\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\n\nexport function TreeSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tonChange,\n\tselectedId,\n\ttree = [],\n\t...props\n}: TreeSelectProps ) {\n\tconst options = useMemo( () => {\n\t\treturn [\n\t\t\tnoOptionLabel && { value: '', label: noOptionLabel },\n\t\t\t...getSelectOptions( tree ),\n\t\t].filter( < T, >( option: T ): option is Truthy< T > => !! option );\n\t}, [ noOptionLabel, tree ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t{ ...{ label, options, onChange } }\n\t\t\tvalue={ selectedId }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default TreeSelect;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,aAAa,QAAQ,mBAAmB;AAGjD,SAASC,gBAAgBA,CACxBC,IAAY,EACZC,KAAK,GAAG,CAAC,EACqC;EAC9C,OAAOD,IAAI,CAACE,OAAO,CAAIC,QAAQ,IAAM,CACpC;IACCC,KAAK,EAAED,QAAQ,CAACE,EAAE;IAClBC,KAAK,EACJ,QAAQ,CAACC,MAAM,CAAEN,KAAK,GAAG,CAAE,CAAC,GAAGJ,cAAc,CAAEM,QAAQ,CAACK,IAAK;EAC/D,CAAC,EACD,GAAGT,gBAAgB,CAAEI,QAAQ,CAACM,QAAQ,IAAI,EAAE,EAAER,KAAK,GAAG,CAAE,CAAC,CACxD,CAAC;AACJ;;AAEA;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;AACA;AACA;AACA;;AAEA,OAAO,SAASS,UAAUA,CAAE;EAC3BJ,KAAK;EACLK,aAAa;EACbC,QAAQ;EACRC,UAAU;EACVb,IAAI,GAAG,EAAE;EACT,GAAGc;AACa,CAAC,EAAG;EACpB,MAAMC,OAAO,GAAGnB,OAAO,CAAE,MAAM;IAC9B,OAAO,CACNe,aAAa,IAAI;MAAEP,KAAK,EAAE,EAAE;MAAEE,KAAK,EAAEK;IAAc,CAAC,EACpD,GAAGZ,gBAAgB,CAAEC,IAAK,CAAC,CAC3B,CAACgB,MAAM,CAAUC,MAAS,IAA6B,CAAC,CAAEA,MAAO,CAAC;EACpE,CAAC,EAAE,CAAEN,aAAa,EAAEX,IAAI,CAAG,CAAC;EAE5B,OACCkB,aAAA,CAACpB,aAAa;IACNQ,KAAK;IAAES,OAAO;IAAEH,QAAQ;IAC/BR,KAAK,EAAGS,UAAY;IAAA,GACfC;EAAK,CACV,CAAC;AAEJ;AAEA,eAAeJ,UAAU"}
@@ -166,7 +166,6 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) {
166
166
  * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).
167
167
  *
168
168
  *
169
- * @example
170
169
  * ```jsx
171
170
  * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';
172
171
  * import { useState } from '@wordpress/element';
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","deprecated","forwardRef","useMemo","useRef","useEffect","__","ValueInput","UnitSelectControl","CSS_UNITS","getParsedQuantityAndUnit","getUnitsWithCurrentUnit","getValidParsedQuantityAndUnit","useControlledState","escapeRegExp","UnforwardedUnitControl","unitControlProps","forwardedRef","__unstableStateReducer","autoComplete","children","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","onChangeProp","onUnitChange","size","unit","unitProp","units","unitsProp","value","valueProp","onFocus","onFocusProp","props","since","hint","version","nonNullValueProp","undefined","reFirstCharacterOfUnits","list","firstUnitValue","rest","firstCharacters","reduce","carry","first","substring","includes","RegExp","parsedQuantity","parsedUnit","setUnit","length","initial","fallback","classes","handleOnQuantityChange","nextQuantityValue","changeProps","onChangeValue","join","handleOnUnitChange","nextUnitValue","data","nextValue","default","handleOnKeyDown","event","onKeyDown","metaKey","test","key","refInputSuffix","current","focus","inputSuffix","createElement","ref","onBlur","step","_activeUnit$step","activeUnit","find","option","spinControls","suffix","type","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits"],"sources":["@wordpress/components/src/unit-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { KeyboardEvent, ForwardedRef, SyntheticEvent } from 'react';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport { ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport {\n\tCSS_UNITS,\n\tgetParsedQuantityAndUnit,\n\tgetUnitsWithCurrentUnit,\n\tgetValidParsedQuantityAndUnit,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport { escapeRegExp } from '../utils/strings';\nimport type { UnitControlProps, UnitControlOnChangeCallback } from './types';\n\nfunction UnforwardedUnitControl(\n\tunitControlProps: WordPressComponentProps<\n\t\tUnitControlProps,\n\t\t'input',\n\t\tfalse\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer,\n\t\tautoComplete = 'off',\n\t\t// @ts-expect-error Ensure that children is omitted from restProps\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled = false,\n\t\tdisableUnits = false,\n\t\tisPressEnterToChange = false,\n\t\tisResetValueOnUnitChange = false,\n\t\tisUnitSelectTabbable = true,\n\t\tlabel,\n\t\tonChange: onChangeProp,\n\t\tonUnitChange,\n\t\tsize = 'default',\n\t\tunit: unitProp,\n\t\tunits: unitsProp = CSS_UNITS,\n\t\tvalue: valueProp,\n\t\tonFocus: onFocusProp,\n\t\t...props\n\t} = unitControlProps;\n\n\tif ( 'unit' in unitControlProps ) {\n\t\tdeprecated( 'UnitControl unit prop', {\n\t\t\tsince: '5.6',\n\t\t\thint: 'The unit should be provided within the `value` prop.',\n\t\t\tversion: '6.2',\n\t\t} );\n\t}\n\n\t// The `value` prop, in theory, should not be `null`, but the following line\n\t// ensures it fallback to `undefined` in case a consumer of `UnitControl`\n\t// still passes `null` as a `value`.\n\tconst nonNullValueProp = valueProp ?? undefined;\n\tconst [ units, reFirstCharacterOfUnits ] = useMemo( () => {\n\t\tconst list = getUnitsWithCurrentUnit(\n\t\t\tnonNullValueProp,\n\t\t\tunitProp,\n\t\t\tunitsProp\n\t\t);\n\t\tconst [ { value: firstUnitValue = '' } = {}, ...rest ] = list;\n\t\tconst firstCharacters = rest.reduce( ( carry, { value } ) => {\n\t\t\tconst first = escapeRegExp( value?.substring( 0, 1 ) || '' );\n\t\t\treturn carry.includes( first ) ? carry : `${ carry }|${ first }`;\n\t\t}, escapeRegExp( firstUnitValue.substring( 0, 1 ) ) );\n\t\treturn [ list, new RegExp( `^(?:${ firstCharacters })$`, 'i' ) ];\n\t}, [ nonNullValueProp, unitProp, unitsProp ] );\n\tconst [ parsedQuantity, parsedUnit ] = getParsedQuantityAndUnit(\n\t\tnonNullValueProp,\n\t\tunitProp,\n\t\tunits\n\t);\n\n\tconst [ unit, setUnit ] = useControlledState< string | undefined >(\n\t\tunits.length === 1 ? units[ 0 ].value : unitProp,\n\t\t{\n\t\t\tinitial: parsedUnit,\n\t\t\tfallback: '',\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tif ( parsedUnit !== undefined ) {\n\t\t\tsetUnit( parsedUnit );\n\t\t}\n\t}, [ parsedUnit, setUnit ] );\n\n\tconst classes = classnames(\n\t\t'components-unit-control',\n\t\t// This class is added for legacy purposes to maintain it on the outer\n\t\t// wrapper. See: https://github.com/WordPress/gutenberg/pull/45139\n\t\t'components-unit-control-wrapper',\n\t\tclassName\n\t);\n\n\tconst handleOnQuantityChange = (\n\t\tnextQuantityValue: number | string | undefined,\n\t\tchangeProps: {\n\t\t\tevent: SyntheticEvent;\n\t\t}\n\t) => {\n\t\tif (\n\t\t\tnextQuantityValue === '' ||\n\t\t\ttypeof nextQuantityValue === 'undefined' ||\n\t\t\tnextQuantityValue === null\n\t\t) {\n\t\t\tonChangeProp?.( '', changeProps );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Customizing the onChange callback.\n\t\t * This allows as to broadcast a combined value+unit to onChange.\n\t\t */\n\t\tconst onChangeValue = getValidParsedQuantityAndUnit(\n\t\t\tnextQuantityValue,\n\t\t\tunits,\n\t\t\tparsedQuantity,\n\t\t\tunit\n\t\t).join( '' );\n\n\t\tonChangeProp?.( onChangeValue, changeProps );\n\t};\n\n\tconst handleOnUnitChange: UnitControlOnChangeCallback = (\n\t\tnextUnitValue,\n\t\tchangeProps\n\t) => {\n\t\tconst { data } = changeProps;\n\n\t\tlet nextValue = `${ parsedQuantity ?? '' }${ nextUnitValue }`;\n\n\t\tif ( isResetValueOnUnitChange && data?.default !== undefined ) {\n\t\t\tnextValue = `${ data.default }${ nextUnitValue }`;\n\t\t}\n\n\t\tonChangeProp?.( nextValue, changeProps );\n\t\tonUnitChange?.( nextUnitValue, changeProps );\n\n\t\tsetUnit( nextUnitValue );\n\t};\n\n\tlet handleOnKeyDown;\n\tif ( ! disableUnits && isUnitSelectTabbable && units.length ) {\n\t\thandleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\t\tprops.onKeyDown?.( event );\n\t\t\t// Unless the meta key was pressed (to avoid interfering with\n\t\t\t// shortcuts, e.g. pastes), moves focus to the unit select if a key\n\t\t\t// matches the first character of a unit.\n\t\t\tif ( ! event.metaKey && reFirstCharacterOfUnits.test( event.key ) )\n\t\t\t\trefInputSuffix.current?.focus();\n\t\t};\n\t}\n\n\tconst refInputSuffix = useRef< HTMLSelectElement >( null );\n\tconst inputSuffix = ! disableUnits ? (\n\t\t<UnitSelectControl\n\t\t\tref={ refInputSuffix }\n\t\t\taria-label={ __( 'Select unit' ) }\n\t\t\tdisabled={ disabled }\n\t\t\tisUnitSelectTabbable={ isUnitSelectTabbable }\n\t\t\tonChange={ handleOnUnitChange }\n\t\t\tsize={ size }\n\t\t\tunit={ unit }\n\t\t\tunits={ units }\n\t\t\tonFocus={ onFocusProp }\n\t\t\tonBlur={ unitControlProps.onBlur }\n\t\t/>\n\t) : null;\n\n\tlet step = props.step;\n\n\t/*\n\t * If no step prop has been passed, lookup the active unit and\n\t * try to get step from `units`, or default to a value of `1`\n\t */\n\tif ( ! step && units ) {\n\t\tconst activeUnit = units.find( ( option ) => option.value === unit );\n\t\tstep = activeUnit?.step ?? 1;\n\t}\n\n\treturn (\n\t\t<ValueInput\n\t\t\t{ ...props }\n\t\t\tautoComplete={ autoComplete }\n\t\t\tclassName={ classes }\n\t\t\tdisabled={ disabled }\n\t\t\tspinControls=\"none\"\n\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\tlabel={ label }\n\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\tonChange={ handleOnQuantityChange }\n\t\t\tref={ forwardedRef }\n\t\t\tsize={ size }\n\t\t\tsuffix={ inputSuffix }\n\t\t\ttype={ isPressEnterToChange ? 'text' : 'number' }\n\t\t\tvalue={ parsedQuantity ?? '' }\n\t\t\tstep={ step }\n\t\t\tonFocus={ onFocusProp }\n\t\t\t__unstableStateReducer={ __unstableStateReducer }\n\t\t/>\n\t);\n}\n\n/**\n * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).\n *\n *\n * @example\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nexport const UnitControl = forwardRef( UnforwardedUnitControl );\n\nexport { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';\nexport default UnitControl;\n"],"mappings":";AAAA;AACA;AACA;;AAEA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,OAAO,EAAEC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AAC3E,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,SAASC,UAAU,QAAQ,8BAA8B;AACzD,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SACCC,SAAS,EACTC,wBAAwB,EACxBC,uBAAuB,EACvBC,6BAA6B,QACvB,SAAS;AAChB,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,SAASC,YAAY,QAAQ,kBAAkB;AAG/C,SAASC,sBAAsBA,CAC9BC,gBAIC,EACDC,YAAiC,EAChC;EACD,MAAM;IACLC,sBAAsB;IACtBC,YAAY,GAAG,KAAK;IACpB;IACAC,QAAQ;IACRC,SAAS;IACTC,QAAQ,GAAG,KAAK;IAChBC,YAAY,GAAG,KAAK;IACpBC,oBAAoB,GAAG,KAAK;IAC5BC,wBAAwB,GAAG,KAAK;IAChCC,oBAAoB,GAAG,IAAI;IAC3BC,KAAK;IACLC,QAAQ,EAAEC,YAAY;IACtBC,YAAY;IACZC,IAAI,GAAG,SAAS;IAChBC,IAAI,EAAEC,QAAQ;IACdC,KAAK,EAAEC,SAAS,GAAG1B,SAAS;IAC5B2B,KAAK,EAAEC,SAAS;IAChBC,OAAO,EAAEC,WAAW;IACpB,GAAGC;EACJ,CAAC,GAAGxB,gBAAgB;EAEpB,IAAK,MAAM,IAAIA,gBAAgB,EAAG;IACjCf,UAAU,CAAE,uBAAuB,EAAE;MACpCwC,KAAK,EAAE,KAAK;MACZC,IAAI,EAAE,sDAAsD;MAC5DC,OAAO,EAAE;IACV,CAAE,CAAC;EACJ;;EAEA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c;IAC7BE,SAAS,EAAG0C,OAAS;IACrBzC,QAAQ,EAAGA,QAAU;IACrBsE,YAAY,EAAC,MAAM;IACnBpE,oBAAoB,EAAGA,oBAAsB;IAC7CG,KAAK,EAAGA,KAAO;IACfiD,SAAS,EAAGF,eAAiB;IAC7B9C,QAAQ,EAAGoC,sBAAwB;IACnCqB,GAAG,EAAGpE,YAAc;IACpBc,IAAI,EAAGA,IAAM;IACb8D,MAAM,EAAGV,WAAa;IACtBW,IAAI,EAAGtE,oBAAoB,GAAG,MAAM,GAAG,QAAU;IACjDY,KAAK,EAAGqB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,EAAI;IAC9B8B,IAAI,EAAGA,IAAM;IACbjD,OAAO,EAAGC,WAAa;IACvBrB,sBAAsB,EAAGA;EAAwB,CACjD,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM6E,WAAW,GAAG7F,UAAU,CAAEa,sBAAuB,CAAC;AAE/D,SAASiF,gCAAgC,EAAEC,cAAc,QAAQ,SAAS;AAC1E,eAAeF,WAAW"}
1
+ {"version":3,"names":["classnames","deprecated","forwardRef","useMemo","useRef","useEffect","__","ValueInput","UnitSelectControl","CSS_UNITS","getParsedQuantityAndUnit","getUnitsWithCurrentUnit","getValidParsedQuantityAndUnit","useControlledState","escapeRegExp","UnforwardedUnitControl","unitControlProps","forwardedRef","__unstableStateReducer","autoComplete","children","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","onChangeProp","onUnitChange","size","unit","unitProp","units","unitsProp","value","valueProp","onFocus","onFocusProp","props","since","hint","version","nonNullValueProp","undefined","reFirstCharacterOfUnits","list","firstUnitValue","rest","firstCharacters","reduce","carry","first","substring","includes","RegExp","parsedQuantity","parsedUnit","setUnit","length","initial","fallback","classes","handleOnQuantityChange","nextQuantityValue","changeProps","onChangeValue","join","handleOnUnitChange","nextUnitValue","data","nextValue","default","handleOnKeyDown","event","onKeyDown","metaKey","test","key","refInputSuffix","current","focus","inputSuffix","createElement","ref","onBlur","step","_activeUnit$step","activeUnit","find","option","spinControls","suffix","type","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits"],"sources":["@wordpress/components/src/unit-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { KeyboardEvent, ForwardedRef, SyntheticEvent } from 'react';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport { ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport {\n\tCSS_UNITS,\n\tgetParsedQuantityAndUnit,\n\tgetUnitsWithCurrentUnit,\n\tgetValidParsedQuantityAndUnit,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport { escapeRegExp } from '../utils/strings';\nimport type { UnitControlProps, UnitControlOnChangeCallback } from './types';\n\nfunction UnforwardedUnitControl(\n\tunitControlProps: WordPressComponentProps<\n\t\tUnitControlProps,\n\t\t'input',\n\t\tfalse\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer,\n\t\tautoComplete = 'off',\n\t\t// @ts-expect-error Ensure that children is omitted from restProps\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled = false,\n\t\tdisableUnits = false,\n\t\tisPressEnterToChange = false,\n\t\tisResetValueOnUnitChange = false,\n\t\tisUnitSelectTabbable = true,\n\t\tlabel,\n\t\tonChange: onChangeProp,\n\t\tonUnitChange,\n\t\tsize = 'default',\n\t\tunit: unitProp,\n\t\tunits: unitsProp = CSS_UNITS,\n\t\tvalue: valueProp,\n\t\tonFocus: onFocusProp,\n\t\t...props\n\t} = unitControlProps;\n\n\tif ( 'unit' in unitControlProps ) {\n\t\tdeprecated( 'UnitControl unit prop', {\n\t\t\tsince: '5.6',\n\t\t\thint: 'The unit should be provided within the `value` prop.',\n\t\t\tversion: '6.2',\n\t\t} );\n\t}\n\n\t// The `value` prop, in theory, should not be `null`, but the following line\n\t// ensures it fallback to `undefined` in case a consumer of `UnitControl`\n\t// still passes `null` as a `value`.\n\tconst nonNullValueProp = valueProp ?? undefined;\n\tconst [ units, reFirstCharacterOfUnits ] = useMemo( () => {\n\t\tconst list = getUnitsWithCurrentUnit(\n\t\t\tnonNullValueProp,\n\t\t\tunitProp,\n\t\t\tunitsProp\n\t\t);\n\t\tconst [ { value: firstUnitValue = '' } = {}, ...rest ] = list;\n\t\tconst firstCharacters = rest.reduce( ( carry, { value } ) => {\n\t\t\tconst first = escapeRegExp( value?.substring( 0, 1 ) || '' );\n\t\t\treturn carry.includes( first ) ? carry : `${ carry }|${ first }`;\n\t\t}, escapeRegExp( firstUnitValue.substring( 0, 1 ) ) );\n\t\treturn [ list, new RegExp( `^(?:${ firstCharacters })$`, 'i' ) ];\n\t}, [ nonNullValueProp, unitProp, unitsProp ] );\n\tconst [ parsedQuantity, parsedUnit ] = getParsedQuantityAndUnit(\n\t\tnonNullValueProp,\n\t\tunitProp,\n\t\tunits\n\t);\n\n\tconst [ unit, setUnit ] = useControlledState< string | undefined >(\n\t\tunits.length === 1 ? units[ 0 ].value : unitProp,\n\t\t{\n\t\t\tinitial: parsedUnit,\n\t\t\tfallback: '',\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tif ( parsedUnit !== undefined ) {\n\t\t\tsetUnit( parsedUnit );\n\t\t}\n\t}, [ parsedUnit, setUnit ] );\n\n\tconst classes = classnames(\n\t\t'components-unit-control',\n\t\t// This class is added for legacy purposes to maintain it on the outer\n\t\t// wrapper. See: https://github.com/WordPress/gutenberg/pull/45139\n\t\t'components-unit-control-wrapper',\n\t\tclassName\n\t);\n\n\tconst handleOnQuantityChange = (\n\t\tnextQuantityValue: number | string | undefined,\n\t\tchangeProps: {\n\t\t\tevent: SyntheticEvent;\n\t\t}\n\t) => {\n\t\tif (\n\t\t\tnextQuantityValue === '' ||\n\t\t\ttypeof nextQuantityValue === 'undefined' ||\n\t\t\tnextQuantityValue === null\n\t\t) {\n\t\t\tonChangeProp?.( '', changeProps );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Customizing the onChange callback.\n\t\t * This allows as to broadcast a combined value+unit to onChange.\n\t\t */\n\t\tconst onChangeValue = getValidParsedQuantityAndUnit(\n\t\t\tnextQuantityValue,\n\t\t\tunits,\n\t\t\tparsedQuantity,\n\t\t\tunit\n\t\t).join( '' );\n\n\t\tonChangeProp?.( onChangeValue, changeProps );\n\t};\n\n\tconst handleOnUnitChange: UnitControlOnChangeCallback = (\n\t\tnextUnitValue,\n\t\tchangeProps\n\t) => {\n\t\tconst { data } = changeProps;\n\n\t\tlet nextValue = `${ parsedQuantity ?? '' }${ nextUnitValue }`;\n\n\t\tif ( isResetValueOnUnitChange && data?.default !== undefined ) {\n\t\t\tnextValue = `${ data.default }${ nextUnitValue }`;\n\t\t}\n\n\t\tonChangeProp?.( nextValue, changeProps );\n\t\tonUnitChange?.( nextUnitValue, changeProps );\n\n\t\tsetUnit( nextUnitValue );\n\t};\n\n\tlet handleOnKeyDown;\n\tif ( ! disableUnits && isUnitSelectTabbable && units.length ) {\n\t\thandleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\t\tprops.onKeyDown?.( event );\n\t\t\t// Unless the meta key was pressed (to avoid interfering with\n\t\t\t// shortcuts, e.g. pastes), moves focus to the unit select if a key\n\t\t\t// matches the first character of a unit.\n\t\t\tif ( ! event.metaKey && reFirstCharacterOfUnits.test( event.key ) )\n\t\t\t\trefInputSuffix.current?.focus();\n\t\t};\n\t}\n\n\tconst refInputSuffix = useRef< HTMLSelectElement >( null );\n\tconst inputSuffix = ! disableUnits ? (\n\t\t<UnitSelectControl\n\t\t\tref={ refInputSuffix }\n\t\t\taria-label={ __( 'Select unit' ) }\n\t\t\tdisabled={ disabled }\n\t\t\tisUnitSelectTabbable={ isUnitSelectTabbable }\n\t\t\tonChange={ handleOnUnitChange }\n\t\t\tsize={ size }\n\t\t\tunit={ unit }\n\t\t\tunits={ units }\n\t\t\tonFocus={ onFocusProp }\n\t\t\tonBlur={ unitControlProps.onBlur }\n\t\t/>\n\t) : null;\n\n\tlet step = props.step;\n\n\t/*\n\t * If no step prop has been passed, lookup the active unit and\n\t * try to get step from `units`, or default to a value of `1`\n\t */\n\tif ( ! step && units ) {\n\t\tconst activeUnit = units.find( ( option ) => option.value === unit );\n\t\tstep = activeUnit?.step ?? 1;\n\t}\n\n\treturn (\n\t\t<ValueInput\n\t\t\t{ ...props }\n\t\t\tautoComplete={ autoComplete }\n\t\t\tclassName={ classes }\n\t\t\tdisabled={ disabled }\n\t\t\tspinControls=\"none\"\n\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\tlabel={ label }\n\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\tonChange={ handleOnQuantityChange }\n\t\t\tref={ forwardedRef }\n\t\t\tsize={ size }\n\t\t\tsuffix={ inputSuffix }\n\t\t\ttype={ isPressEnterToChange ? 'text' : 'number' }\n\t\t\tvalue={ parsedQuantity ?? '' }\n\t\t\tstep={ step }\n\t\t\tonFocus={ onFocusProp }\n\t\t\t__unstableStateReducer={ __unstableStateReducer }\n\t\t/>\n\t);\n}\n\n/**\n * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).\n *\n *\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nexport const UnitControl = forwardRef( UnforwardedUnitControl );\n\nexport { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';\nexport default UnitControl;\n"],"mappings":";A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BAAoB,EAAGA,oBAAsB;IAC7CG,KAAK,EAAGA,KAAO;IACfiD,SAAS,EAAGF,eAAiB;IAC7B9C,QAAQ,EAAGoC,sBAAwB;IACnCqB,GAAG,EAAGpE,YAAc;IACpBc,IAAI,EAAGA,IAAM;IACb8D,MAAM,EAAGV,WAAa;IACtBW,IAAI,EAAGtE,oBAAoB,GAAG,MAAM,GAAG,QAAU;IACjDY,KAAK,EAAGqB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,EAAI;IAC9B8B,IAAI,EAAGA,IAAM;IACbjD,OAAO,EAAGC,WAAa;IACvBrB,sBAAsB,EAAGA;EAAwB,CACjD,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM6E,WAAW,GAAG7F,UAAU,CAAEa,sBAAuB,CAAC;AAE/D,SAASiF,gCAAgC,EAAEC,cAAc,QAAQ,SAAS;AAC1E,eAAeF,WAAW"}
@@ -20,7 +20,7 @@ const isSerializedStyles = o => typeof o !== 'undefined' && o !== null && ['name
20
20
  * `cx` normally knows how to handle. It also hooks into the Emotion
21
21
  * Cache, allowing `css` calls to work inside iframes.
22
22
  *
23
- * @example
23
+ * ```jsx
24
24
  * import { css } from '@emotion/react';
25
25
  *
26
26
  * const styles = css`
@@ -34,6 +34,7 @@ const isSerializedStyles = o => typeof o !== 'undefined' && o !== null && ['name
34
34
  *
35
35
  * return <span className={classes} {...props} />;
36
36
  * }
37
+ * ```
37
38
  */
38
39
  export const useCx = () => {
39
40
  const cache = useEmotionCache();
@@ -1 +1 @@
1
- {"version":3,"names":["__unsafe_useEmotionCache","useEmotionCache","insertStyles","cx","innerCx","useCallback","isSerializedStyles","o","every","p","useCx","cache","classNames","Error","map","arg","key","name"],"sources":["@wordpress/components/src/utils/hooks/use-cx.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { __unsafe_useEmotionCache as useEmotionCache } from '@emotion/react';\nimport type { SerializedStyles } from '@emotion/serialize';\nimport { insertStyles } from '@emotion/utils';\n// eslint-disable-next-line no-restricted-imports\nimport type { ClassNamesArg } from '@emotion/css';\n// eslint-disable-next-line no-restricted-imports\nimport { cx as innerCx } from '@emotion/css';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\n\nconst isSerializedStyles = ( o: any ): o is SerializedStyles =>\n\ttypeof o !== 'undefined' &&\n\to !== null &&\n\t[ 'name', 'styles' ].every( ( p ) => typeof o[ p ] !== 'undefined' );\n\n/**\n * Retrieve a `cx` function that knows how to handle `SerializedStyles`\n * returned by the `@emotion/react` `css` function in addition to what\n * `cx` normally knows how to handle. It also hooks into the Emotion\n * Cache, allowing `css` calls to work inside iframes.\n *\n * @example\n * import { css } from '@emotion/react';\n *\n * const styles = css`\n * \tcolor: red\n * `;\n *\n * function RedText( { className, ...props } ) {\n * \tconst cx = useCx();\n *\n * \tconst classes = cx(styles, className);\n *\n * \treturn <span className={classes} {...props} />;\n * }\n */\nexport const useCx = () => {\n\tconst cache = useEmotionCache();\n\n\tconst cx = useCallback(\n\t\t( ...classNames: ( ClassNamesArg | SerializedStyles )[] ) => {\n\t\t\tif ( cache === null ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'The `useCx` hook should be only used within a valid Emotion Cache Context'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn innerCx(\n\t\t\t\t...classNames.map( ( arg ) => {\n\t\t\t\t\tif ( isSerializedStyles( arg ) ) {\n\t\t\t\t\t\tinsertStyles( cache, arg, false );\n\t\t\t\t\t\treturn `${ cache.key }-${ arg.name }`;\n\t\t\t\t\t}\n\t\t\t\t\treturn arg;\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t\t[ cache ]\n\t);\n\n\treturn cx;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,wBAAwB,IAAIC,eAAe,QAAQ,gBAAgB;AAE5E,SAASC,YAAY,QAAQ,gBAAgB;AAC7C;;AAEA;AACA,SAASC,EAAE,IAAIC,OAAO,QAAQ,cAAc;;AAE5C;AACA;AACA;AACA,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,MAAMC,kBAAkB,GAAKC,CAAM,IAClC,OAAOA,CAAC,KAAK,WAAW,IACxBA,CAAC,KAAK,IAAI,IACV,CAAE,MAAM,EAAE,QAAQ,CAAE,CAACC,KAAK,CAAIC,CAAC,IAAM,OAAOF,CAAC,CAAEE,CAAC,CAAE,KAAK,WAAY,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGA,CAAA,KAAM;EAC1B,MAAMC,KAAK,GAAGV,eAAe,CAAC,CAAC;EAE/B,MAAME,EAAE,GAAGE,WAAW,CACrB,CAAE,GAAGO,UAAkD,KAAM;IAC5D,IAAKD,KAAK,KAAK,IAAI,EAAG;MACrB,MAAM,IAAIE,KAAK,CACd,2EACD,CAAC;IACF;IAEA,OAAOT,OAAO,CACb,GAAGQ,UAAU,CAACE,GAAG,CAAIC,GAAG,IAAM;MAC7B,IAAKT,kBAAkB,CAAES,GAAI,CAAC,EAAG;QAChCb,YAAY,CAAES,KAAK,EAAEI,GAAG,EAAE,KAAM,CAAC;QACjC,OAAQ,GAAGJ,KAAK,CAACK,GAAK,IAAID,GAAG,CAACE,IAAM,EAAC;MACtC;MACA,OAAOF,GAAG;IACX,CAAE,CACH,CAAC;EACF,CAAC,EACD,CAAEJ,KAAK,CACR,CAAC;EAED,OAAOR,EAAE;AACV,CAAC"}
1
+ {"version":3,"names":["__unsafe_useEmotionCache","useEmotionCache","insertStyles","cx","innerCx","useCallback","isSerializedStyles","o","every","p","useCx","cache","classNames","Error","map","arg","key","name"],"sources":["@wordpress/components/src/utils/hooks/use-cx.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { __unsafe_useEmotionCache as useEmotionCache } from '@emotion/react';\nimport type { SerializedStyles } from '@emotion/serialize';\nimport { insertStyles } from '@emotion/utils';\n// eslint-disable-next-line no-restricted-imports\nimport type { ClassNamesArg } from '@emotion/css';\n// eslint-disable-next-line no-restricted-imports\nimport { cx as innerCx } from '@emotion/css';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\n\nconst isSerializedStyles = ( o: any ): o is SerializedStyles =>\n\ttypeof o !== 'undefined' &&\n\to !== null &&\n\t[ 'name', 'styles' ].every( ( p ) => typeof o[ p ] !== 'undefined' );\n\n/**\n * Retrieve a `cx` function that knows how to handle `SerializedStyles`\n * returned by the `@emotion/react` `css` function in addition to what\n * `cx` normally knows how to handle. It also hooks into the Emotion\n * Cache, allowing `css` calls to work inside iframes.\n *\n * ```jsx\n * import { css } from '@emotion/react';\n *\n * const styles = css`\n * \tcolor: red\n * `;\n *\n * function RedText( { className, ...props } ) {\n * \tconst cx = useCx();\n *\n * \tconst classes = cx(styles, className);\n *\n * \treturn <span className={classes} {...props} />;\n * }\n * ```\n */\nexport const useCx = () => {\n\tconst cache = useEmotionCache();\n\n\tconst cx = useCallback(\n\t\t( ...classNames: ( ClassNamesArg | SerializedStyles )[] ) => {\n\t\t\tif ( cache === null ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'The `useCx` hook should be only used within a valid Emotion Cache Context'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn innerCx(\n\t\t\t\t...classNames.map( ( arg ) => {\n\t\t\t\t\tif ( isSerializedStyles( arg ) ) {\n\t\t\t\t\t\tinsertStyles( cache, arg, false );\n\t\t\t\t\t\treturn `${ cache.key }-${ arg.name }`;\n\t\t\t\t\t}\n\t\t\t\t\treturn arg;\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t\t[ cache ]\n\t);\n\n\treturn cx;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,wBAAwB,IAAIC,eAAe,QAAQ,gBAAgB;AAE5E,SAASC,YAAY,QAAQ,gBAAgB;AAC7C;;AAEA;AACA,SAASC,EAAE,IAAIC,OAAO,QAAQ,cAAc;;AAE5C;AACA;AACA;AACA,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,MAAMC,kBAAkB,GAAKC,CAAM,IAClC,OAAOA,CAAC,KAAK,WAAW,IACxBA,CAAC,KAAK,IAAI,IACV,CAAE,MAAM,EAAE,QAAQ,CAAE,CAACC,KAAK,CAAIC,CAAC,IAAM,OAAOF,CAAC,CAAEE,CAAC,CAAE,KAAK,WAAY,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGA,CAAA,KAAM;EAC1B,MAAMC,KAAK,GAAGV,eAAe,CAAC,CAAC;EAE/B,MAAME,EAAE,GAAGE,WAAW,CACrB,CAAE,GAAGO,UAAkD,KAAM;IAC5D,IAAKD,KAAK,KAAK,IAAI,EAAG;MACrB,MAAM,IAAIE,KAAK,CACd,2EACD,CAAC;IACF;IAEA,OAAOT,OAAO,CACb,GAAGQ,UAAU,CAACE,GAAG,CAAIC,GAAG,IAAM;MAC7B,IAAKT,kBAAkB,CAAES,GAAI,CAAC,EAAG;QAChCb,YAAY,CAAES,KAAK,EAAEI,GAAG,EAAE,KAAM,CAAC;QACjC,OAAQ,GAAGJ,KAAK,CAACK,GAAK,IAAID,GAAG,CAACE,IAAM,EAAC;MACtC;MACA,OAAOF,GAAG;IACX,CAAE,CACH,CAAC;EACF,CAAC,EACD,CAAEJ,KAAK,CACR,CAAC;EAED,OAAOR,EAAE;AACV,CAAC"}
@@ -7,7 +7,6 @@ import _styled from "@emotion/styled/base";
7
7
  * `View` is a core component that renders everything in the library.
8
8
  * It is the principle component in the entire library.
9
9
  *
10
- * @example
11
10
  * ```jsx
12
11
  * import { View } from `@wordpress/components`;
13
12
  *
@@ -25,7 +24,7 @@ export const View = _styled("div", process.env.NODE_ENV === "production" ? {
25
24
  } : {
26
25
  target: "e19lxcc00",
27
26
  label: "View"
28
- })(process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdmlldy9jb21wb25lbnQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlDYyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3ZpZXcvY29tcG9uZW50LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB0eXBlIHsgUmVmQXR0cmlidXRlcyB9IGZyb20gJ3JlYWN0JztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHR5cGUgeyBXb3JkUHJlc3NDb21wb25lbnQgfSBmcm9tICcuLi91aS9jb250ZXh0L3dvcmRwcmVzcy1jb21wb25lbnQnO1xuaW1wb3J0IHR5cGUgeyBWaWV3UHJvcHMgfSBmcm9tICcuL3R5cGVzJztcblxuLyoqXG4gKiBgVmlld2AgaXMgYSBjb3JlIGNvbXBvbmVudCB0aGF0IHJlbmRlcnMgZXZlcnl0aGluZyBpbiB0aGUgbGlicmFyeS5cbiAqIEl0IGlzIHRoZSBwcmluY2lwbGUgY29tcG9uZW50IGluIHRoZSBlbnRpcmUgbGlicmFyeS5cbiAqXG4gKiBAZXhhbXBsZVxuICogYGBganN4XG4gKiBpbXBvcnQgeyBWaWV3IH0gZnJvbSBgQHdvcmRwcmVzcy9jb21wb25lbnRzYDtcbiAqXG4gKiBmdW5jdGlvbiBFeGFtcGxlKCkge1xuICogXHRyZXR1cm4gKFxuICogXHRcdDxWaWV3PlxuICogXHRcdFx0IENvZGUgaXMgUG9ldHJ5XG4gKiBcdFx0PC9WaWV3PlxuICogXHQpO1xuICogfVxuICogYGBgXG4gKi9cbmV4cG9ydCBjb25zdCBWaWV3OiBXb3JkUHJlc3NDb21wb25lbnQ8XG5cdCdkaXYnLFxuXHRWaWV3UHJvcHMgJiBSZWZBdHRyaWJ1dGVzPCBhbnkgPixcblx0dHJ1ZVxuPiA9IHN0eWxlZC5kaXZgYDtcblxuVmlldy5zZWxlY3RvciA9ICcuY29tcG9uZW50cy12aWV3JztcblZpZXcuZGlzcGxheU5hbWUgPSAnVmlldyc7XG5cbmV4cG9ydCBkZWZhdWx0IFZpZXc7XG4iXX0= */");
27
+ })(process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdmlldy9jb21wb25lbnQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWdDYyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3ZpZXcvY29tcG9uZW50LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB0eXBlIHsgUmVmQXR0cmlidXRlcyB9IGZyb20gJ3JlYWN0JztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHR5cGUgeyBXb3JkUHJlc3NDb21wb25lbnQgfSBmcm9tICcuLi91aS9jb250ZXh0L3dvcmRwcmVzcy1jb21wb25lbnQnO1xuaW1wb3J0IHR5cGUgeyBWaWV3UHJvcHMgfSBmcm9tICcuL3R5cGVzJztcblxuLyoqXG4gKiBgVmlld2AgaXMgYSBjb3JlIGNvbXBvbmVudCB0aGF0IHJlbmRlcnMgZXZlcnl0aGluZyBpbiB0aGUgbGlicmFyeS5cbiAqIEl0IGlzIHRoZSBwcmluY2lwbGUgY29tcG9uZW50IGluIHRoZSBlbnRpcmUgbGlicmFyeS5cbiAqXG4gKiBgYGBqc3hcbiAqIGltcG9ydCB7IFZpZXcgfSBmcm9tIGBAd29yZHByZXNzL2NvbXBvbmVudHNgO1xuICpcbiAqIGZ1bmN0aW9uIEV4YW1wbGUoKSB7XG4gKiBcdHJldHVybiAoXG4gKiBcdFx0PFZpZXc+XG4gKiBcdFx0XHQgQ29kZSBpcyBQb2V0cnlcbiAqIFx0XHQ8L1ZpZXc+XG4gKiBcdCk7XG4gKiB9XG4gKiBgYGBcbiAqL1xuZXhwb3J0IGNvbnN0IFZpZXc6IFdvcmRQcmVzc0NvbXBvbmVudDxcblx0J2RpdicsXG5cdFZpZXdQcm9wcyAmIFJlZkF0dHJpYnV0ZXM8IGFueSA+LFxuXHR0cnVlXG4+ID0gc3R5bGVkLmRpdmBgO1xuXG5WaWV3LnNlbGVjdG9yID0gJy5jb21wb25lbnRzLXZpZXcnO1xuVmlldy5kaXNwbGF5TmFtZSA9ICdWaWV3JztcblxuZXhwb3J0IGRlZmF1bHQgVmlldztcbiJdfQ== */");
29
28
  View.selector = '.components-view';
30
29
  View.displayName = 'View';
31
30
  export default View;
@@ -1 +1 @@
1
- {"version":3,"names":["View","_styled","process","env","NODE_ENV","target","label","selector","displayName"],"sources":["@wordpress/components/src/view/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport type { RefAttributes } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponent } from '../ui/context/wordpress-component';\nimport type { ViewProps } from './types';\n\n/**\n * `View` is a core component that renders everything in the library.\n * It is the principle component in the entire library.\n *\n * @example\n * ```jsx\n * import { View } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<View>\n * \t\t\t Code is Poetry\n * \t\t</View>\n * \t);\n * }\n * ```\n */\nexport const View: WordPressComponent<\n\t'div',\n\tViewProps & RefAttributes< any >,\n\ttrue\n> = styled.div``;\n\nView.selector = '.components-view';\nView.displayName = 'View';\n\nexport default View;\n"],"mappings":";AAAA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,IAIZ,GAAAC,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,25CAAe;AAEhBJ,IAAI,CAACO,QAAQ,GAAG,kBAAkB;AAClCP,IAAI,CAACQ,WAAW,GAAG,MAAM;AAEzB,eAAeR,IAAI"}
1
+ {"version":3,"names":["View","_styled","process","env","NODE_ENV","target","label","selector","displayName"],"sources":["@wordpress/components/src/view/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\nimport type { RefAttributes } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponent } from '../ui/context/wordpress-component';\nimport type { ViewProps } from './types';\n\n/**\n * `View` is a core component that renders everything in the library.\n * It is the principle component in the entire library.\n *\n * ```jsx\n * import { View } from `@wordpress/components`;\n *\n * function Example() {\n * \treturn (\n * \t\t<View>\n * \t\t\t Code is Poetry\n * \t\t</View>\n * \t);\n * }\n * ```\n */\nexport const View: WordPressComponent<\n\t'div',\n\tViewProps & RefAttributes< any >,\n\ttrue\n> = styled.div``;\n\nView.selector = '.components-view';\nView.displayName = 'View';\n\nexport default View;\n"],"mappings":";AAAA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,IAIZ,GAAAC,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,24CAAe;AAEhBJ,IAAI,CAACO,QAAQ,GAAG,kBAAkB;AAClCP,IAAI,CAACQ,WAAW,GAAG,MAAM;AAEzB,eAAeR,IAAI"}
@@ -2,13 +2,13 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import type { ComponentMeta } from '@storybook/react';
5
+ import type { Meta } from '@storybook/react';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
9
  import AlignmentMatrixControl from '..';
10
10
  import type { AlignmentMatrixControlProps } from '../types';
11
- declare const meta: ComponentMeta<typeof AlignmentMatrixControl>;
11
+ declare const meta: Meta<typeof AlignmentMatrixControl>;
12
12
  export default meta;
13
13
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, AlignmentMatrixControlProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "children" | "as" | keyof AlignmentMatrixControlProps>>;
14
14
  export declare const IconSubcomponent: () => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/alignment-matrix-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAQtE;;GAEG;AACH,OAAO,sBAAsB,MAAM,IAAI,CAAC;AAExC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,sBAAsB,CAWvD,CAAC;AACF,eAAe,IAAI,CAAC;AA0BpB,eAAO,MAAM,OAAO,iWAAsB,CAAC;AAE3C,eAAO,MAAM,gBAAgB,mBAkB5B,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/alignment-matrix-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,sBAAsB,MAAM,IAAI,CAAC;AAExC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,sBAAsB,CAe9C,CAAC;AACF,eAAe,IAAI,CAAC;AA0BpB,eAAO,MAAM,OAAO,iWAAsB,CAAC;AAE3C,eAAO,MAAM,gBAAgB,mBAkB5B,CAAC"}
@@ -2,12 +2,12 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import type { ComponentMeta } from '@storybook/react';
5
+ import type { Meta } from '@storybook/react';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
9
  import { AnglePickerControl } from '..';
10
- declare const meta: ComponentMeta<typeof AnglePickerControl>;
10
+ declare const meta: Meta<typeof AnglePickerControl>;
11
11
  export default meta;
12
12
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnglePickerControlProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "children" | "as" | keyof import("../types").AnglePickerControlProps> & {
13
13
  as?: keyof JSX.IntrinsicElements | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/angle-picker-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAOtE;;GAEG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAExC,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,kBAAkB,CAcnD,CAAC;AAEF,eAAe,IAAI,CAAC;AAsBpB,eAAO,MAAM,OAAO;;uCAAkC,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/angle-picker-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAExC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,kBAAkB,CAc1C,CAAC;AAEF,eAAe,IAAI,CAAC;AAsBpB,eAAO,MAAM,OAAO;;uCAAkC,CAAC"}
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { ComponentMeta, Story } from '@storybook/react';
4
+ import type { Meta } from '@storybook/react';
5
5
  /**
6
6
  * Internal dependencies
7
7
  */
8
8
  import { Animate } from '..';
9
- declare const meta: ComponentMeta<typeof Animate>;
9
+ declare const meta: Meta<typeof Animate>;
10
10
  export default meta;
11
- export declare const Default: Story<typeof Animate>;
12
- export declare const AppearTopLeft: Story<typeof Animate>;
13
- export declare const AppearTopRight: Story<typeof Animate>;
14
- export declare const AppearBottomLeft: Story<typeof Animate>;
15
- export declare const AppearBottomRight: Story<typeof Animate>;
16
- export declare const Loading: Story<typeof Animate>;
17
- export declare const SlideIn: Story<typeof Animate>;
11
+ export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
12
+ export declare const AppearTopLeft: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
13
+ export declare const AppearTopRight: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
14
+ export declare const AppearBottomLeft: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
15
+ export declare const AppearBottomRight: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
16
+ export declare const Loading: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
17
+ export declare const SlideIn: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").AnimateProps>;
18
18
  //# sourceMappingURL=index.story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/animate/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAG7B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,OAAO,CAOxC,CAAC;AACF,eAAe,IAAI,CAAC;AAIpB,eAAO,MAAM,OAAO,EAAE,KAAK,CAAE,OAAO,OAAO,CAAwB,CAAC;AASpE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAE,OAAO,OAAO,CAAwB,CAAC;AAU1E,eAAO,MAAM,cAAc,EAAE,KAAK,CAAE,OAAO,OAAO,CAAwB,CAAC;AAU3E,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAE,OAAO,OAAO,CAAwB,CAAC;AAU7E,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAE,OAAO,OAAO,CAAwB,CAAC;AAW9E,eAAO,MAAM,OAAO,EAAE,KAAK,CAAE,OAAO,OAAO,CAAwB,CAAC;AAUpE,eAAO,MAAM,OAAO,EAAE,KAAK,CAAE,OAAO,OAAO,CAAwB,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/animate/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAG7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAO/B,CAAC;AACF,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO,gIAAsB,CAAC;AAS3C,eAAO,MAAM,aAAa,gIAAsB,CAAC;AAUjD,eAAO,MAAM,cAAc,gIAAsB,CAAC;AAUlD,eAAO,MAAM,gBAAgB,gIAAsB,CAAC;AAUpD,eAAO,MAAM,iBAAiB,gIAAsB,CAAC;AAWrD,eAAO,MAAM,OAAO,gIAAsB,CAAC;AAU3C,eAAO,MAAM,OAAO,gIAAsB,CAAC"}
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { ComponentMeta, ComponentStory } from '@storybook/react';
4
+ import type { Meta, StoryFn } from '@storybook/react';
5
5
  /**
6
6
  * Internal dependencies
7
7
  */
8
8
  import BaseControl from '..';
9
- declare const meta: ComponentMeta<typeof BaseControl>;
9
+ declare const meta: Meta<typeof BaseControl>;
10
10
  export default meta;
11
- export declare const Default: ComponentStory<typeof BaseControl>;
11
+ export declare const Default: StoryFn<typeof BaseControl>;
12
12
  export declare const WithHelpText: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").BaseControlProps>;
13
13
  /**
14
14
  * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.
@@ -17,5 +17,5 @@ export declare const WithHelpText: import("@storybook/types").AnnotatedStoryFn<i
17
17
  * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would
18
18
  * otherwise use if the `label` prop was passed.
19
19
  */
20
- export declare const WithVisualLabel: ComponentStory<typeof BaseControl>;
20
+ export declare const WithVisualLabel: StoryFn<typeof BaseControl>;
21
21
  //# sourceMappingURL=index.story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/base-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,OAAO,WAAoC,MAAM,IAAI,CAAC;AAGtD,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,WAAW,CAY5C,CAAC;AACF,eAAe,IAAI,CAAC;AAcpB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAE,OAAO,WAAW,CACrB,CAAC;AAMpC,eAAO,MAAM,YAAY,oIAAqC,CAAC;AAM/D;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,CAAE,OAAO,WAAW,CAc/D,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/base-control/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,OAAO,WAAoC,MAAM,IAAI,CAAC;AAGtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,WAAW,CAYnC,CAAC;AACF,eAAe,IAAI,CAAC;AAYpB,eAAO,MAAM,OAAO,EAAE,OAAO,CAAE,OAAO,WAAW,CACd,CAAC;AAMpC,eAAO,MAAM,YAAY,oIAAqC,CAAC;AAM/D;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,CAAE,OAAO,WAAW,CAYxD,CAAC"}
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import type { ComponentMeta } from '@storybook/react';
5
+ import type { Meta } from '@storybook/react';
6
6
  import { BorderBoxControl } from '../';
7
- declare const meta: ComponentMeta<typeof BorderBoxControl>;
7
+ declare const meta: Meta<typeof BorderBoxControl>;
8
8
  export default meta;
9
9
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, Pick<import("../../color-palette/types").ColorPaletteProps, "colors" | "enableAlpha" | "__experimentalIsRenderedInSidebar"> & {
10
10
  disableCustomColors?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAatE,OAAO,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAGvC,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,gBAAgB,CAWjD,CAAC;AACF,eAAe,IAAI,CAAC;AAsDpB,eAAO,MAAM,OAAO;;;;;;;2fAAsB,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/border-box-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAYtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,gBAAgB,CAWxC,CAAC;AACF,eAAe,IAAI,CAAC;AAoDpB,eAAO,MAAM,OAAO;;;;;;;2fAAsB,CAAC"}
@@ -2,13 +2,13 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import type { ComponentMeta } from '@storybook/react';
5
+ import type { Meta } from '@storybook/react';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
9
  import { BorderControl } from '..';
10
10
  import type { Border } from '../types';
11
- declare const meta: ComponentMeta<typeof BorderControl>;
11
+ declare const meta: Meta<typeof BorderControl>;
12
12
  export default meta;
13
13
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, Pick<import("../../color-palette/types").ColorPaletteProps, "colors" | "enableAlpha" | "__experimentalIsRenderedInSidebar"> & {
14
14
  disableCustomColors?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/border-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAQtE;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAGnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,aAAa,CAc9C,CAAC;AACF,eAAe,IAAI,CAAC;AA+DpB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;qkBAAsB,CAAC;AAM3C;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;qkBAAsB,CAAC;AAM9C;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;qkBAAsB,CAAC;AAQzD;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;qkBAAsB,CAAC;AAM7C;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;qkBAAsB,CAAC;AAMvD;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;qkBAAsB,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/border-control/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAQtD;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,aAAa,CAcrC,CAAC;AACF,eAAe,IAAI,CAAC;AA2DpB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;qkBAAsB,CAAC;AAM3C;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;qkBAAsB,CAAC;AAM9C;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;qkBAAsB,CAAC;AAQzD;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;qkBAAsB,CAAC;AAM7C;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;qkBAAsB,CAAC;AAMvD;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;qkBAAsB,CAAC"}
@@ -2,14 +2,14 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import type { Story, Meta } from '@storybook/react';
5
+ import type { StoryFn, Meta } from '@storybook/react';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
9
  import { Button } from '../..';
10
10
  declare const meta: Meta<typeof Button>;
11
11
  export default meta;
12
- export declare const VariantStates: Story<typeof Button>;
12
+ export declare const VariantStates: StoryFn<typeof Button>;
13
13
  export declare const Icon: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../../types").ButtonProps & import("react").RefAttributes<any>>;
14
- export declare const Dashicons: Story<typeof Button>;
14
+ export declare const Dashicons: StoryFn<typeof Button>;
15
15
  //# sourceMappingURL=index.story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../../src/button/stories/e2e/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAOpD;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,MAAM,CAG9B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,aAAa,EAAE,KAAK,CAAE,OAAO,MAAM,CA2B/C,CAAC;AAKF,eAAO,MAAM,IAAI,uKAA2B,CAAC;AAK7C,eAAO,MAAM,SAAS,EAAE,KAAK,CAAE,OAAO,MAAM,CAgB3C,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../../src/button/stories/e2e/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAOtD;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,MAAM,CAG9B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,aAAa,EAAE,OAAO,CAAE,OAAO,MAAM,CA2BjD,CAAC;AAKF,eAAO,MAAM,IAAI,uKAA2B,CAAC;AAK7C,eAAO,MAAM,SAAS,EAAE,OAAO,CAAE,OAAO,MAAM,CAgB7C,CAAC"}
@@ -1,7 +1,8 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * External dependencies
3
4
  */
4
- import type { Meta, Story } from '@storybook/react';
5
+ import type { Meta } from '@storybook/react';
5
6
  /**
6
7
  * Internal dependencies
7
8
  */
@@ -9,12 +10,12 @@ import './style.css';
9
10
  import Button from '..';
10
11
  declare const meta: Meta<typeof Button>;
11
12
  export default meta;
12
- export declare const Default: Story<typeof Button>;
13
- export declare const Primary: Story<typeof Button>;
14
- export declare const Secondary: Story<typeof Button>;
15
- export declare const Tertiary: Story<typeof Button>;
16
- export declare const Link: Story<typeof Button>;
17
- export declare const IsDestructive: Story<typeof Button>;
18
- export declare const Icon: Story<typeof Button>;
19
- export declare const GroupedIcons: Story<typeof Button>;
13
+ export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
14
+ export declare const Primary: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
15
+ export declare const Secondary: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
16
+ export declare const Tertiary: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
17
+ export declare const Link: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
18
+ export declare const IsDestructive: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
19
+ export declare const Icon: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../types").ButtonProps & import("react").RefAttributes<any>>;
20
+ export declare const GroupedIcons: () => JSX.Element;
20
21
  //# sourceMappingURL=index.story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/button/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAcpD;;GAEG;AACH,OAAO,aAAa,CAAC;AACrB,OAAO,MAAM,MAAM,IAAI,CAAC;AAExB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,MAAM,CAoB9B,CAAC;AACF,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO,EAAE,KAAK,CAAE,OAAO,MAAM,CAAwB,CAAC;AAKnE,eAAO,MAAM,OAAO,EAAE,KAAK,CAAE,OAAO,MAAM,CAAwB,CAAC;AAMnE,eAAO,MAAM,SAAS,EAAE,KAAK,CAAE,OAAO,MAAM,CAAwB,CAAC;AAMrE,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAE,OAAO,MAAM,CAAwB,CAAC;AAMpE,eAAO,MAAM,IAAI,EAAE,KAAK,CAAE,OAAO,MAAM,CAAwB,CAAC;AAMhE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAE,OAAO,MAAM,CAAwB,CAAC;AAMzE,eAAO,MAAM,IAAI,EAAE,KAAK,CAAE,OAAO,MAAM,CAAwB,CAAC;AAMhE,eAAO,MAAM,YAAY,EAAE,KAAK,CAAE,OAAO,MAAM,CAY9C,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/button/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AActD;;GAEG;AACH,OAAO,aAAa,CAAC;AACrB,OAAO,MAAM,MAAM,IAAI,CAAC;AAExB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,MAAM,CAoB9B,CAAC;AACF,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO,oKAAsB,CAAC;AAK3C,eAAO,MAAM,OAAO,oKAAsB,CAAC;AAM3C,eAAO,MAAM,SAAS,oKAAsB,CAAC;AAM7C,eAAO,MAAM,QAAQ,oKAAsB,CAAC;AAM5C,eAAO,MAAM,IAAI,oKAAsB,CAAC;AAMxC,eAAO,MAAM,aAAa,oKAAsB,CAAC;AAMjD,eAAO,MAAM,IAAI,oKAAsB,CAAC;AAMxC,eAAO,MAAM,YAAY,mBAYxB,CAAC"}
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { ComponentMeta, ComponentStory } from '@storybook/react';
4
+ import type { Meta, StoryFn } from '@storybook/react';
5
5
  /**
6
6
  * Internal dependencies
7
7
  */
8
8
  import ButtonGroup from '..';
9
- declare const meta: ComponentMeta<typeof ButtonGroup>;
9
+ declare const meta: Meta<typeof ButtonGroup>;
10
10
  export default meta;
11
- export declare const Default: ComponentStory<typeof ButtonGroup>;
11
+ export declare const Default: StoryFn<typeof ButtonGroup>;
12
12
  //# sourceMappingURL=index.story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/button-group/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,OAAO,WAAW,MAAM,IAAI,CAAC;AAG7B,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,WAAW,CAU5C,CAAC;AACF,eAAe,IAAI,CAAC;AAgBpB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAE,OAAO,WAAW,CAEvD,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/button-group/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,OAAO,WAAW,MAAM,IAAI,CAAC;AAG7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,WAAW,CAUnC,CAAC;AACF,eAAe,IAAI,CAAC;AAgBpB,eAAO,MAAM,OAAO,EAAE,OAAO,CAAE,OAAO,WAAW,CAAwB,CAAC"}
@@ -2,12 +2,12 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import type { ComponentMeta } from '@storybook/react';
5
+ import type { Meta } from '@storybook/react';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
9
  import { Card } from '..';
10
- declare const meta: ComponentMeta<typeof Card>;
10
+ declare const meta: Meta<typeof Card>;
11
11
  export default meta;
12
12
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../../surface/types").SurfaceProps & {
13
13
  size?: import("../types").SizeOptions | "extraSmall" | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/card/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,OAAO,EACN,IAAI,EAMJ,MAAM,IAAI,CAAC;AAKZ,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,IAAI,CAiBrC,CAAC;AAEF,eAAe,IAAI,CAAC;AAMpB,eAAO,MAAM,OAAO;;;;;;;;;EAAsB,CAAC;AA+B3C;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAAsB,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/card/stories/index.story.tsx"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,kBAAkB,CAAC;AAEtD;;GAEG;AACH,OAAO,EACN,IAAI,EAMJ,MAAM,IAAI,CAAC;AAKZ,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,IAAI,CAmB5B,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,eAAO,MAAM,OAAO;;;;;;;;;EAAsB,CAAC;AA+B3C;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAAsB,CAAC"}