@wordpress/global-styles-ui 1.1.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 (701) hide show
  1. package/LICENSE.md +788 -0
  2. package/README.md +48 -0
  3. package/build/background-panel.js +62 -0
  4. package/build/background-panel.js.map +7 -0
  5. package/build/block-preview-panel.js +90 -0
  6. package/build/block-preview-panel.js.map +7 -0
  7. package/build/color-indicator-wrapper.js +55 -0
  8. package/build/color-indicator-wrapper.js.map +7 -0
  9. package/build/color-palette-panel.js +123 -0
  10. package/build/color-palette-panel.js.map +7 -0
  11. package/build/color-preview.js +94 -0
  12. package/build/color-preview.js.map +7 -0
  13. package/build/color-variations.js +41 -0
  14. package/build/color-variations.js.map +7 -0
  15. package/build/confirm-reset-shadow-dialog.js +55 -0
  16. package/build/confirm-reset-shadow-dialog.js.map +7 -0
  17. package/build/context.js +37 -0
  18. package/build/context.js.map +7 -0
  19. package/build/dimensions-panel.js +89 -0
  20. package/build/dimensions-panel.js.map +7 -0
  21. package/build/font-families.js +114 -0
  22. package/build/font-families.js.map +7 -0
  23. package/build/font-family-item.js +48 -0
  24. package/build/font-family-item.js.map +7 -0
  25. package/build/font-library-modal/collection-font-variant.js +75 -0
  26. package/build/font-library-modal/collection-font-variant.js.map +7 -0
  27. package/build/font-library-modal/context.js +386 -0
  28. package/build/font-library-modal/context.js.map +7 -0
  29. package/build/font-library-modal/font-card.js +81 -0
  30. package/build/font-library-modal/font-card.js.map +7 -0
  31. package/build/font-library-modal/font-collection.js +510 -0
  32. package/build/font-library-modal/font-collection.js.map +7 -0
  33. package/build/font-library-modal/font-demo.js +111 -0
  34. package/build/font-library-modal/font-demo.js.map +7 -0
  35. package/build/font-library-modal/google-fonts-confirm-dialog.js +58 -0
  36. package/build/font-library-modal/google-fonts-confirm-dialog.js.map +7 -0
  37. package/build/font-library-modal/index.js +110 -0
  38. package/build/font-library-modal/index.js.map +7 -0
  39. package/build/font-library-modal/installed-fonts.js +453 -0
  40. package/build/font-library-modal/installed-fonts.js.map +7 -0
  41. package/build/font-library-modal/lib/inflate.js +2628 -0
  42. package/build/font-library-modal/lib/inflate.js.map +7 -0
  43. package/build/font-library-modal/lib/lib-font.browser.d.js +33 -0
  44. package/build/font-library-modal/lib/lib-font.browser.d.js.map +7 -0
  45. package/build/font-library-modal/lib/lib-font.browser.js +3788 -0
  46. package/build/font-library-modal/lib/lib-font.browser.js.map +7 -0
  47. package/build/font-library-modal/lib/unbrotli.js +3678 -0
  48. package/build/font-library-modal/lib/unbrotli.js.map +7 -0
  49. package/build/font-library-modal/library-font-details.js +63 -0
  50. package/build/font-library-modal/library-font-details.js.map +7 -0
  51. package/build/font-library-modal/library-font-variant.js +81 -0
  52. package/build/font-library-modal/library-font-variant.js.map +7 -0
  53. package/build/font-library-modal/resolvers.js +115 -0
  54. package/build/font-library-modal/resolvers.js.map +7 -0
  55. package/build/font-library-modal/types.js +17 -0
  56. package/build/font-library-modal/types.js.map +7 -0
  57. package/build/font-library-modal/upload-fonts.js +207 -0
  58. package/build/font-library-modal/upload-fonts.js.map +7 -0
  59. package/build/font-library-modal/utils/constants.js +49 -0
  60. package/build/font-library-modal/utils/constants.js.map +7 -0
  61. package/build/font-library-modal/utils/filter-fonts.js +39 -0
  62. package/build/font-library-modal/utils/filter-fonts.js.map +7 -0
  63. package/build/font-library-modal/utils/fonts-outline.js +51 -0
  64. package/build/font-library-modal/utils/fonts-outline.js.map +7 -0
  65. package/build/font-library-modal/utils/index.js +274 -0
  66. package/build/font-library-modal/utils/index.js.map +7 -0
  67. package/build/font-library-modal/utils/make-families-from-faces.js +45 -0
  68. package/build/font-library-modal/utils/make-families-from-faces.js.map +7 -0
  69. package/build/font-library-modal/utils/preview-styles.js +119 -0
  70. package/build/font-library-modal/utils/preview-styles.js.map +7 -0
  71. package/build/font-library-modal/utils/set-immutably.js +40 -0
  72. package/build/font-library-modal/utils/set-immutably.js.map +7 -0
  73. package/build/font-library-modal/utils/sort-font-faces.js +59 -0
  74. package/build/font-library-modal/utils/sort-font-faces.js.map +7 -0
  75. package/build/font-library-modal/utils/toggleFont.js +67 -0
  76. package/build/font-library-modal/utils/toggleFont.js.map +7 -0
  77. package/build/font-sizes/confirm-delete-font-size-dialog.js +60 -0
  78. package/build/font-sizes/confirm-delete-font-size-dialog.js.map +7 -0
  79. package/build/font-sizes/confirm-reset-font-sizes-dialog.js +55 -0
  80. package/build/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -0
  81. package/build/font-sizes/font-size-preview.js +50 -0
  82. package/build/font-sizes/font-size-preview.js.map +7 -0
  83. package/build/font-sizes/font-size.js +261 -0
  84. package/build/font-sizes/font-size.js.map +7 -0
  85. package/build/font-sizes/font-sizes-count.js +40 -0
  86. package/build/font-sizes/font-sizes-count.js.map +7 -0
  87. package/build/font-sizes/font-sizes.js +215 -0
  88. package/build/font-sizes/font-sizes.js.map +7 -0
  89. package/build/font-sizes/rename-font-size-dialog.js +96 -0
  90. package/build/font-sizes/rename-font-size-dialog.js.map +7 -0
  91. package/build/global-styles-ui.js +213 -0
  92. package/build/global-styles-ui.js.map +7 -0
  93. package/build/gradients-palette-panel.js +133 -0
  94. package/build/gradients-palette-panel.js.map +7 -0
  95. package/build/highlighted-colors.js +57 -0
  96. package/build/highlighted-colors.js.map +7 -0
  97. package/build/hooks.js +176 -0
  98. package/build/hooks.js.map +7 -0
  99. package/build/icon-with-current-color.js +56 -0
  100. package/build/icon-with-current-color.js.map +7 -0
  101. package/build/index.js +51 -0
  102. package/build/index.js.map +7 -0
  103. package/build/lock-unlock.js +35 -0
  104. package/build/lock-unlock.js.map +7 -0
  105. package/build/navigation-button.js +52 -0
  106. package/build/navigation-button.js.map +7 -0
  107. package/build/pagination/index.js +133 -0
  108. package/build/pagination/index.js.map +7 -0
  109. package/build/palette.js +93 -0
  110. package/build/palette.js.map +7 -0
  111. package/build/preset-colors.js +40 -0
  112. package/build/preset-colors.js.map +7 -0
  113. package/build/preview-colors.js +86 -0
  114. package/build/preview-colors.js.map +7 -0
  115. package/build/preview-hooks.js +60 -0
  116. package/build/preview-hooks.js.map +7 -0
  117. package/build/preview-styles.js +219 -0
  118. package/build/preview-styles.js.map +7 -0
  119. package/build/preview-typography.js +72 -0
  120. package/build/preview-typography.js.map +7 -0
  121. package/build/preview-wrapper.js +102 -0
  122. package/build/preview-wrapper.js.map +7 -0
  123. package/build/provider.js +54 -0
  124. package/build/provider.js.map +7 -0
  125. package/build/root-menu.js +72 -0
  126. package/build/root-menu.js.map +7 -0
  127. package/build/screen-background.js +58 -0
  128. package/build/screen-background.js.map +7 -0
  129. package/build/screen-block-list.js +160 -0
  130. package/build/screen-block-list.js.map +7 -0
  131. package/build/screen-block.js +316 -0
  132. package/build/screen-block.js.map +7 -0
  133. package/build/screen-color-palette.js +64 -0
  134. package/build/screen-color-palette.js.map +7 -0
  135. package/build/screen-colors.js +85 -0
  136. package/build/screen-colors.js.map +7 -0
  137. package/build/screen-css.js +68 -0
  138. package/build/screen-css.js.map +7 -0
  139. package/build/screen-header.js +61 -0
  140. package/build/screen-header.js.map +7 -0
  141. package/build/screen-layout.js +54 -0
  142. package/build/screen-layout.js.map +7 -0
  143. package/build/screen-revisions/index.js +147 -0
  144. package/build/screen-revisions/index.js.map +7 -0
  145. package/build/screen-revisions/revisions-buttons.js +198 -0
  146. package/build/screen-revisions/revisions-buttons.js.map +7 -0
  147. package/build/screen-revisions/types.js +17 -0
  148. package/build/screen-revisions/types.js.map +7 -0
  149. package/build/screen-revisions/use-global-styles-revisions.js +163 -0
  150. package/build/screen-revisions/use-global-styles-revisions.js.map +7 -0
  151. package/build/screen-root.js +134 -0
  152. package/build/screen-root.js.map +7 -0
  153. package/build/screen-shadows.js +49 -0
  154. package/build/screen-shadows.js.map +7 -0
  155. package/build/screen-style-variations.js +52 -0
  156. package/build/screen-style-variations.js.map +7 -0
  157. package/build/screen-typography-element.js +167 -0
  158. package/build/screen-typography-element.js.map +7 -0
  159. package/build/screen-typography.js +65 -0
  160. package/build/screen-typography.js.map +7 -0
  161. package/build/shadow-utils.js +125 -0
  162. package/build/shadow-utils.js.map +7 -0
  163. package/build/shadows-edit-panel.js +503 -0
  164. package/build/shadows-edit-panel.js.map +7 -0
  165. package/build/shadows-panel.js +203 -0
  166. package/build/shadows-panel.js.map +7 -0
  167. package/build/size-control/index.js +86 -0
  168. package/build/size-control/index.js.map +7 -0
  169. package/build/style-variations-container.js +130 -0
  170. package/build/style-variations-container.js.map +7 -0
  171. package/build/style-variations-content.js +52 -0
  172. package/build/style-variations-content.js.map +7 -0
  173. package/build/style-variations.js +41 -0
  174. package/build/style-variations.js.map +7 -0
  175. package/build/subtitle.js +33 -0
  176. package/build/subtitle.js.map +7 -0
  177. package/build/typography-elements.js +117 -0
  178. package/build/typography-elements.js.map +7 -0
  179. package/build/typography-example.js +79 -0
  180. package/build/typography-example.js.map +7 -0
  181. package/build/typography-panel.js +64 -0
  182. package/build/typography-panel.js.map +7 -0
  183. package/build/typography-preview.js +70 -0
  184. package/build/typography-preview.js.map +7 -0
  185. package/build/typography-variations.js +41 -0
  186. package/build/typography-variations.js.map +7 -0
  187. package/build/utils.js +210 -0
  188. package/build/utils.js.map +7 -0
  189. package/build/variations/variation.js +116 -0
  190. package/build/variations/variation.js.map +7 -0
  191. package/build/variations/variations-color.js +64 -0
  192. package/build/variations/variations-color.js.map +7 -0
  193. package/build/variations/variations-panel.js +69 -0
  194. package/build/variations/variations-panel.js.map +7 -0
  195. package/build/variations/variations-typography.js +80 -0
  196. package/build/variations/variations-typography.js.map +7 -0
  197. package/build/with-global-styles-provider.js +48 -0
  198. package/build/with-global-styles-provider.js.map +7 -0
  199. package/build-module/background-panel.js +38 -0
  200. package/build-module/background-panel.js.map +7 -0
  201. package/build-module/block-preview-panel.js +70 -0
  202. package/build-module/block-preview-panel.js.map +7 -0
  203. package/build-module/color-indicator-wrapper.js +25 -0
  204. package/build-module/color-indicator-wrapper.js.map +7 -0
  205. package/build-module/color-palette-panel.js +97 -0
  206. package/build-module/color-palette-panel.js.map +7 -0
  207. package/build-module/color-preview.js +70 -0
  208. package/build-module/color-preview.js.map +7 -0
  209. package/build-module/color-variations.js +7 -0
  210. package/build-module/color-variations.js.map +7 -0
  211. package/build-module/confirm-reset-shadow-dialog.js +35 -0
  212. package/build-module/confirm-reset-shadow-dialog.js.map +7 -0
  213. package/build-module/context.js +13 -0
  214. package/build-module/context.js.map +7 -0
  215. package/build-module/dimensions-panel.js +69 -0
  216. package/build-module/dimensions-panel.js.map +7 -0
  217. package/build-module/font-families.js +92 -0
  218. package/build-module/font-families.js.map +7 -0
  219. package/build-module/font-family-item.js +32 -0
  220. package/build-module/font-family-item.js.map +7 -0
  221. package/build-module/font-library-modal/collection-font-variant.js +45 -0
  222. package/build-module/font-library-modal/collection-font-variant.js.map +7 -0
  223. package/build-module/font-library-modal/context.js +382 -0
  224. package/build-module/font-library-modal/context.js.map +7 -0
  225. package/build-module/font-library-modal/font-card.js +57 -0
  226. package/build-module/font-library-modal/font-card.js.map +7 -0
  227. package/build-module/font-library-modal/font-collection.js +510 -0
  228. package/build-module/font-library-modal/font-collection.js.map +7 -0
  229. package/build-module/font-library-modal/font-demo.js +94 -0
  230. package/build-module/font-library-modal/font-demo.js.map +7 -0
  231. package/build-module/font-library-modal/google-fonts-confirm-dialog.js +45 -0
  232. package/build-module/font-library-modal/google-fonts-confirm-dialog.js.map +7 -0
  233. package/build-module/font-library-modal/index.js +83 -0
  234. package/build-module/font-library-modal/index.js.map +7 -0
  235. package/build-module/font-library-modal/installed-fonts.js +442 -0
  236. package/build-module/font-library-modal/installed-fonts.js.map +7 -0
  237. package/build-module/font-library-modal/lib/inflate.js +2636 -0
  238. package/build-module/font-library-modal/lib/inflate.js.map +7 -0
  239. package/build-module/font-library-modal/lib/lib-font.browser.d.js +9 -0
  240. package/build-module/font-library-modal/lib/lib-font.browser.d.js.map +7 -0
  241. package/build-module/font-library-modal/lib/lib-font.browser.js +3754 -0
  242. package/build-module/font-library-modal/lib/lib-font.browser.js.map +7 -0
  243. package/build-module/font-library-modal/lib/unbrotli.js +3686 -0
  244. package/build-module/font-library-modal/lib/unbrotli.js.map +7 -0
  245. package/build-module/font-library-modal/library-font-details.js +36 -0
  246. package/build-module/font-library-modal/library-font-details.js.map +7 -0
  247. package/build-module/font-library-modal/library-font-variant.js +51 -0
  248. package/build-module/font-library-modal/library-font-variant.js.map +7 -0
  249. package/build-module/font-library-modal/resolvers.js +76 -0
  250. package/build-module/font-library-modal/resolvers.js.map +7 -0
  251. package/build-module/font-library-modal/types.js +1 -0
  252. package/build-module/font-library-modal/types.js.map +7 -0
  253. package/build-module/font-library-modal/upload-fonts.js +187 -0
  254. package/build-module/font-library-modal/upload-fonts.js.map +7 -0
  255. package/build-module/font-library-modal/utils/constants.js +23 -0
  256. package/build-module/font-library-modal/utils/constants.js.map +7 -0
  257. package/build-module/font-library-modal/utils/filter-fonts.js +19 -0
  258. package/build-module/font-library-modal/utils/filter-fonts.js.map +7 -0
  259. package/build-module/font-library-modal/utils/fonts-outline.js +26 -0
  260. package/build-module/font-library-modal/utils/fonts-outline.js.map +7 -0
  261. package/build-module/font-library-modal/utils/index.js +238 -0
  262. package/build-module/font-library-modal/utils/index.js.map +7 -0
  263. package/build-module/font-library-modal/utils/make-families-from-faces.js +25 -0
  264. package/build-module/font-library-modal/utils/make-families-from-faces.js.map +7 -0
  265. package/build-module/font-library-modal/utils/preview-styles.js +92 -0
  266. package/build-module/font-library-modal/utils/preview-styles.js.map +7 -0
  267. package/build-module/font-library-modal/utils/set-immutably.js +16 -0
  268. package/build-module/font-library-modal/utils/set-immutably.js.map +7 -0
  269. package/build-module/font-library-modal/utils/sort-font-faces.js +35 -0
  270. package/build-module/font-library-modal/utils/sort-font-faces.js.map +7 -0
  271. package/build-module/font-library-modal/utils/toggleFont.js +43 -0
  272. package/build-module/font-library-modal/utils/toggleFont.js.map +7 -0
  273. package/build-module/font-sizes/confirm-delete-font-size-dialog.js +40 -0
  274. package/build-module/font-sizes/confirm-delete-font-size-dialog.js.map +7 -0
  275. package/build-module/font-sizes/confirm-reset-font-sizes-dialog.js +35 -0
  276. package/build-module/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -0
  277. package/build-module/font-sizes/font-size-preview.js +30 -0
  278. package/build-module/font-sizes/font-size-preview.js.map +7 -0
  279. package/build-module/font-sizes/font-size.js +241 -0
  280. package/build-module/font-sizes/font-size.js.map +7 -0
  281. package/build-module/font-sizes/font-sizes-count.js +25 -0
  282. package/build-module/font-sizes/font-sizes-count.js.map +7 -0
  283. package/build-module/font-sizes/font-sizes.js +200 -0
  284. package/build-module/font-sizes/font-sizes.js.map +7 -0
  285. package/build-module/font-sizes/rename-font-size-dialog.js +82 -0
  286. package/build-module/font-sizes/rename-font-size-dialog.js.map +7 -0
  287. package/build-module/global-styles-ui.js +182 -0
  288. package/build-module/global-styles-ui.js.map +7 -0
  289. package/build-module/gradients-palette-panel.js +118 -0
  290. package/build-module/gradients-palette-panel.js.map +7 -0
  291. package/build-module/highlighted-colors.js +37 -0
  292. package/build-module/highlighted-colors.js.map +7 -0
  293. package/build-module/hooks.js +144 -0
  294. package/build-module/hooks.js.map +7 -0
  295. package/build-module/icon-with-current-color.js +22 -0
  296. package/build-module/icon-with-current-color.js.map +7 -0
  297. package/build-module/index.js +13 -0
  298. package/build-module/index.js.map +7 -0
  299. package/build-module/lock-unlock.js +10 -0
  300. package/build-module/lock-unlock.js.map +7 -0
  301. package/build-module/navigation-button.js +32 -0
  302. package/build-module/navigation-button.js.map +7 -0
  303. package/build-module/pagination/index.js +107 -0
  304. package/build-module/pagination/index.js.map +7 -0
  305. package/build-module/palette.js +70 -0
  306. package/build-module/palette.js.map +7 -0
  307. package/build-module/preset-colors.js +20 -0
  308. package/build-module/preset-colors.js.map +7 -0
  309. package/build-module/preview-colors.js +59 -0
  310. package/build-module/preview-colors.js.map +7 -0
  311. package/build-module/preview-hooks.js +36 -0
  312. package/build-module/preview-hooks.js.map +7 -0
  313. package/build-module/preview-styles.js +193 -0
  314. package/build-module/preview-styles.js.map +7 -0
  315. package/build-module/preview-typography.js +42 -0
  316. package/build-module/preview-typography.js.map +7 -0
  317. package/build-module/preview-wrapper.js +86 -0
  318. package/build-module/preview-wrapper.js.map +7 -0
  319. package/build-module/provider.js +30 -0
  320. package/build-module/provider.js.map +7 -0
  321. package/build-module/root-menu.js +58 -0
  322. package/build-module/root-menu.js.map +7 -0
  323. package/build-module/screen-background.js +28 -0
  324. package/build-module/screen-background.js.map +7 -0
  325. package/build-module/screen-block-list.js +150 -0
  326. package/build-module/screen-block-list.js.map +7 -0
  327. package/build-module/screen-block.js +293 -0
  328. package/build-module/screen-block.js.map +7 -0
  329. package/build-module/screen-color-palette.js +34 -0
  330. package/build-module/screen-color-palette.js.map +7 -0
  331. package/build-module/screen-colors.js +55 -0
  332. package/build-module/screen-colors.js.map +7 -0
  333. package/build-module/screen-css.js +48 -0
  334. package/build-module/screen-css.js.map +7 -0
  335. package/build-module/screen-header.js +44 -0
  336. package/build-module/screen-header.js.map +7 -0
  337. package/build-module/screen-layout.js +24 -0
  338. package/build-module/screen-layout.js.map +7 -0
  339. package/build-module/screen-revisions/index.js +121 -0
  340. package/build-module/screen-revisions/index.js.map +7 -0
  341. package/build-module/screen-revisions/revisions-buttons.js +178 -0
  342. package/build-module/screen-revisions/revisions-buttons.js.map +7 -0
  343. package/build-module/screen-revisions/types.js +1 -0
  344. package/build-module/screen-revisions/types.js.map +7 -0
  345. package/build-module/screen-revisions/use-global-styles-revisions.js +145 -0
  346. package/build-module/screen-revisions/use-global-styles-revisions.js.map +7 -0
  347. package/build-module/screen-root.js +114 -0
  348. package/build-module/screen-root.js.map +7 -0
  349. package/build-module/screen-shadows.js +14 -0
  350. package/build-module/screen-shadows.js.map +7 -0
  351. package/build-module/screen-style-variations.js +32 -0
  352. package/build-module/screen-style-variations.js.map +7 -0
  353. package/build-module/screen-typography-element.js +141 -0
  354. package/build-module/screen-typography-element.js.map +7 -0
  355. package/build-module/screen-typography.js +35 -0
  356. package/build-module/screen-typography.js.map +7 -0
  357. package/build-module/shadow-utils.js +98 -0
  358. package/build-module/shadow-utils.js.map +7 -0
  359. package/build-module/shadows-edit-panel.js +502 -0
  360. package/build-module/shadows-edit-panel.js.map +7 -0
  361. package/build-module/shadows-panel.js +182 -0
  362. package/build-module/shadows-panel.js.map +7 -0
  363. package/build-module/size-control/index.js +72 -0
  364. package/build-module/size-control/index.js.map +7 -0
  365. package/build-module/style-variations-container.js +100 -0
  366. package/build-module/style-variations-container.js.map +7 -0
  367. package/build-module/style-variations-content.js +18 -0
  368. package/build-module/style-variations-content.js.map +7 -0
  369. package/build-module/style-variations.js +7 -0
  370. package/build-module/style-variations.js.map +7 -0
  371. package/build-module/subtitle.js +9 -0
  372. package/build-module/subtitle.js.map +7 -0
  373. package/build-module/typography-elements.js +102 -0
  374. package/build-module/typography-elements.js.map +7 -0
  375. package/build-module/typography-example.js +59 -0
  376. package/build-module/typography-example.js.map +7 -0
  377. package/build-module/typography-panel.js +44 -0
  378. package/build-module/typography-panel.js.map +7 -0
  379. package/build-module/typography-preview.js +50 -0
  380. package/build-module/typography-preview.js.map +7 -0
  381. package/build-module/typography-variations.js +7 -0
  382. package/build-module/typography-variations.js.map +7 -0
  383. package/build-module/utils.js +179 -0
  384. package/build-module/utils.js.map +7 -0
  385. package/build-module/variations/variation.js +86 -0
  386. package/build-module/variations/variation.js.map +7 -0
  387. package/build-module/variations/variations-color.js +37 -0
  388. package/build-module/variations/variations-color.js.map +7 -0
  389. package/build-module/variations/variations-panel.js +44 -0
  390. package/build-module/variations/variations-panel.js.map +7 -0
  391. package/build-module/variations/variations-typography.js +53 -0
  392. package/build-module/variations/variations-typography.js.map +7 -0
  393. package/build-module/with-global-styles-provider.js +24 -0
  394. package/build-module/with-global-styles-provider.js.map +7 -0
  395. package/build-style/style-rtl.css +717 -0
  396. package/build-style/style.css +718 -0
  397. package/build-types/background-panel.d.ts +10 -0
  398. package/build-types/background-panel.d.ts.map +1 -0
  399. package/build-types/block-preview-panel.d.ts +7 -0
  400. package/build-types/block-preview-panel.d.ts.map +1 -0
  401. package/build-types/color-indicator-wrapper.d.ts +7 -0
  402. package/build-types/color-indicator-wrapper.d.ts.map +1 -0
  403. package/build-types/color-palette-panel.d.ts +6 -0
  404. package/build-types/color-palette-panel.d.ts.map +1 -0
  405. package/build-types/color-preview.d.ts +2 -0
  406. package/build-types/color-preview.d.ts.map +1 -0
  407. package/build-types/color-variations.d.ts +27 -0
  408. package/build-types/color-variations.d.ts.map +1 -0
  409. package/build-types/confirm-reset-shadow-dialog.d.ts +10 -0
  410. package/build-types/confirm-reset-shadow-dialog.d.ts.map +1 -0
  411. package/build-types/context.d.ts +10 -0
  412. package/build-types/context.d.ts.map +1 -0
  413. package/build-types/dimensions-panel.d.ts +2 -0
  414. package/build-types/dimensions-panel.d.ts.map +1 -0
  415. package/build-types/font-families.d.ts +4 -0
  416. package/build-types/font-families.d.ts.map +1 -0
  417. package/build-types/font-family-item.d.ts +7 -0
  418. package/build-types/font-family-item.d.ts.map +1 -0
  419. package/build-types/font-library-modal/collection-font-variant.d.ts +4 -0
  420. package/build-types/font-library-modal/collection-font-variant.d.ts.map +1 -0
  421. package/build-types/font-library-modal/context.d.ts +7 -0
  422. package/build-types/font-library-modal/context.d.ts.map +1 -0
  423. package/build-types/font-library-modal/font-card.d.ts +9 -0
  424. package/build-types/font-library-modal/font-card.d.ts.map +1 -0
  425. package/build-types/font-library-modal/font-collection.d.ts +5 -0
  426. package/build-types/font-library-modal/font-collection.d.ts.map +1 -0
  427. package/build-types/font-library-modal/font-demo.d.ts +4 -0
  428. package/build-types/font-library-modal/font-demo.d.ts.map +1 -0
  429. package/build-types/font-library-modal/google-fonts-confirm-dialog.d.ts +3 -0
  430. package/build-types/font-library-modal/google-fonts-confirm-dialog.d.ts.map +1 -0
  431. package/build-types/font-library-modal/index.d.ts +6 -0
  432. package/build-types/font-library-modal/index.d.ts.map +1 -0
  433. package/build-types/font-library-modal/installed-fonts.d.ts +3 -0
  434. package/build-types/font-library-modal/installed-fonts.d.ts.map +1 -0
  435. package/build-types/font-library-modal/library-font-details.d.ts +6 -0
  436. package/build-types/font-library-modal/library-font-details.d.ts.map +1 -0
  437. package/build-types/font-library-modal/library-font-variant.d.ts +7 -0
  438. package/build-types/font-library-modal/library-font-variant.d.ts.map +1 -0
  439. package/build-types/font-library-modal/resolvers.d.ts +43 -0
  440. package/build-types/font-library-modal/resolvers.d.ts.map +1 -0
  441. package/build-types/font-library-modal/types.d.ts +133 -0
  442. package/build-types/font-library-modal/types.d.ts.map +1 -0
  443. package/build-types/font-library-modal/upload-fonts.d.ts +3 -0
  444. package/build-types/font-library-modal/upload-fonts.d.ts.map +1 -0
  445. package/build-types/font-library-modal/utils/constants.d.ts +4 -0
  446. package/build-types/font-library-modal/utils/constants.d.ts.map +1 -0
  447. package/build-types/font-library-modal/utils/filter-fonts.d.ts +25 -0
  448. package/build-types/font-library-modal/utils/filter-fonts.d.ts.map +1 -0
  449. package/build-types/font-library-modal/utils/fonts-outline.d.ts +7 -0
  450. package/build-types/font-library-modal/utils/fonts-outline.d.ts.map +1 -0
  451. package/build-types/font-library-modal/utils/index.d.ts +21 -0
  452. package/build-types/font-library-modal/utils/index.d.ts.map +1 -0
  453. package/build-types/font-library-modal/utils/make-families-from-faces.d.ts +6 -0
  454. package/build-types/font-library-modal/utils/make-families-from-faces.d.ts.map +1 -0
  455. package/build-types/font-library-modal/utils/preview-styles.d.ts +13 -0
  456. package/build-types/font-library-modal/utils/preview-styles.d.ts.map +1 -0
  457. package/build-types/font-library-modal/utils/set-immutably.d.ts +13 -0
  458. package/build-types/font-library-modal/utils/set-immutably.d.ts.map +1 -0
  459. package/build-types/font-library-modal/utils/sort-font-faces.d.ts +6 -0
  460. package/build-types/font-library-modal/utils/sort-font-faces.d.ts.map +1 -0
  461. package/build-types/font-library-modal/utils/toggleFont.d.ts +38 -0
  462. package/build-types/font-library-modal/utils/toggleFont.d.ts.map +1 -0
  463. package/build-types/font-sizes/confirm-delete-font-size-dialog.d.ts +10 -0
  464. package/build-types/font-sizes/confirm-delete-font-size-dialog.d.ts.map +1 -0
  465. package/build-types/font-sizes/confirm-reset-font-sizes-dialog.d.ts +10 -0
  466. package/build-types/font-sizes/confirm-reset-font-sizes-dialog.d.ts.map +1 -0
  467. package/build-types/font-sizes/font-size-preview.d.ts +7 -0
  468. package/build-types/font-sizes/font-size-preview.d.ts.map +1 -0
  469. package/build-types/font-sizes/font-size.d.ts +4 -0
  470. package/build-types/font-sizes/font-size.d.ts.map +1 -0
  471. package/build-types/font-sizes/font-sizes-count.d.ts +3 -0
  472. package/build-types/font-sizes/font-sizes-count.d.ts.map +1 -0
  473. package/build-types/font-sizes/font-sizes.d.ts +3 -0
  474. package/build-types/font-sizes/font-sizes.d.ts.map +1 -0
  475. package/build-types/font-sizes/rename-font-size-dialog.d.ts +9 -0
  476. package/build-types/font-sizes/rename-font-size-dialog.d.ts.map +1 -0
  477. package/build-types/global-styles-ui.d.ts +26 -0
  478. package/build-types/global-styles-ui.d.ts.map +1 -0
  479. package/build-types/gradients-palette-panel.d.ts +6 -0
  480. package/build-types/gradients-palette-panel.d.ts.map +1 -0
  481. package/build-types/highlighted-colors.d.ts +7 -0
  482. package/build-types/highlighted-colors.d.ts.map +1 -0
  483. package/build-types/hooks.d.ts +46 -0
  484. package/build-types/hooks.d.ts.map +1 -0
  485. package/build-types/icon-with-current-color.d.ts +9 -0
  486. package/build-types/icon-with-current-color.d.ts.map +1 -0
  487. package/build-types/index.d.ts +6 -0
  488. package/build-types/index.d.ts.map +1 -0
  489. package/build-types/lock-unlock.d.ts +2 -0
  490. package/build-types/lock-unlock.d.ts.map +1 -0
  491. package/build-types/navigation-button.d.ts +10 -0
  492. package/build-types/navigation-button.d.ts.map +1 -0
  493. package/build-types/pagination/index.d.ts +13 -0
  494. package/build-types/pagination/index.d.ts.map +1 -0
  495. package/build-types/palette.d.ts +6 -0
  496. package/build-types/palette.d.ts.map +1 -0
  497. package/build-types/preset-colors.d.ts +2 -0
  498. package/build-types/preset-colors.d.ts.map +1 -0
  499. package/build-types/preview-colors.d.ts +8 -0
  500. package/build-types/preview-colors.d.ts.map +1 -0
  501. package/build-types/preview-hooks.d.ts +9 -0
  502. package/build-types/preview-hooks.d.ts.map +1 -0
  503. package/build-types/preview-styles.d.ts +9 -0
  504. package/build-types/preview-styles.d.ts.map +1 -0
  505. package/build-types/preview-typography.d.ts +8 -0
  506. package/build-types/preview-typography.d.ts.map +1 -0
  507. package/build-types/preview-wrapper.d.ts +15 -0
  508. package/build-types/preview-wrapper.d.ts.map +1 -0
  509. package/build-types/provider.d.ts +15 -0
  510. package/build-types/provider.d.ts.map +1 -0
  511. package/build-types/root-menu.d.ts +3 -0
  512. package/build-types/root-menu.d.ts.map +1 -0
  513. package/build-types/screen-background.d.ts +3 -0
  514. package/build-types/screen-background.d.ts.map +1 -0
  515. package/build-types/screen-block-list.d.ts +4 -0
  516. package/build-types/screen-block-list.d.ts.map +1 -0
  517. package/build-types/screen-block.d.ts +7 -0
  518. package/build-types/screen-block.d.ts.map +1 -0
  519. package/build-types/screen-color-palette.d.ts +5 -0
  520. package/build-types/screen-color-palette.d.ts.map +1 -0
  521. package/build-types/screen-colors.d.ts +3 -0
  522. package/build-types/screen-colors.d.ts.map +1 -0
  523. package/build-types/screen-css.d.ts +3 -0
  524. package/build-types/screen-css.d.ts.map +1 -0
  525. package/build-types/screen-header.d.ts +8 -0
  526. package/build-types/screen-header.d.ts.map +1 -0
  527. package/build-types/screen-layout.d.ts +3 -0
  528. package/build-types/screen-layout.d.ts.map +1 -0
  529. package/build-types/screen-revisions/index.d.ts +6 -0
  530. package/build-types/screen-revisions/index.d.ts.map +1 -0
  531. package/build-types/screen-revisions/revisions-buttons.d.ts +23 -0
  532. package/build-types/screen-revisions/revisions-buttons.d.ts.map +1 -0
  533. package/build-types/screen-revisions/types.d.ts +17 -0
  534. package/build-types/screen-revisions/types.d.ts.map +1 -0
  535. package/build-types/screen-revisions/use-global-styles-revisions.d.ts +17 -0
  536. package/build-types/screen-revisions/use-global-styles-revisions.d.ts.map +1 -0
  537. package/build-types/screen-root.d.ts +3 -0
  538. package/build-types/screen-root.d.ts.map +1 -0
  539. package/build-types/screen-shadows.d.ts +3 -0
  540. package/build-types/screen-shadows.d.ts.map +1 -0
  541. package/build-types/screen-style-variations.d.ts +3 -0
  542. package/build-types/screen-style-variations.d.ts.map +1 -0
  543. package/build-types/screen-typography-element.d.ts +28 -0
  544. package/build-types/screen-typography-element.d.ts.map +1 -0
  545. package/build-types/screen-typography.d.ts +3 -0
  546. package/build-types/screen-typography.d.ts.map +1 -0
  547. package/build-types/shadow-utils.d.ts +126 -0
  548. package/build-types/shadow-utils.d.ts.map +1 -0
  549. package/build-types/shadows-edit-panel.d.ts +2 -0
  550. package/build-types/shadows-edit-panel.d.ts.map +1 -0
  551. package/build-types/shadows-panel.d.ts +3 -0
  552. package/build-types/shadows-panel.d.ts.map +1 -0
  553. package/build-types/size-control/index.d.ts +11 -0
  554. package/build-types/size-control/index.d.ts.map +1 -0
  555. package/build-types/stories/index.story.d.ts +6 -0
  556. package/build-types/stories/index.story.d.ts.map +1 -0
  557. package/build-types/style-variations-container.d.ts +6 -0
  558. package/build-types/style-variations-container.d.ts.map +1 -0
  559. package/build-types/style-variations-content.d.ts +2 -0
  560. package/build-types/style-variations-content.d.ts.map +1 -0
  561. package/build-types/style-variations.d.ts +25 -0
  562. package/build-types/style-variations.d.ts.map +1 -0
  563. package/build-types/subtitle.d.ts +7 -0
  564. package/build-types/subtitle.d.ts.map +1 -0
  565. package/build-types/test/shadow-utils.spec.d.ts +2 -0
  566. package/build-types/test/shadow-utils.spec.d.ts.map +1 -0
  567. package/build-types/test/utils.spec.d.ts +2 -0
  568. package/build-types/test/utils.spec.d.ts.map +1 -0
  569. package/build-types/typography-elements.d.ts +3 -0
  570. package/build-types/typography-elements.d.ts.map +1 -0
  571. package/build-types/typography-example.d.ts +7 -0
  572. package/build-types/typography-example.d.ts.map +1 -0
  573. package/build-types/typography-panel.d.ts +7 -0
  574. package/build-types/typography-panel.d.ts.map +1 -0
  575. package/build-types/typography-preview.d.ts +8 -0
  576. package/build-types/typography-preview.d.ts.map +1 -0
  577. package/build-types/typography-variations.d.ts +27 -0
  578. package/build-types/typography-variations.d.ts.map +1 -0
  579. package/build-types/utils.d.ts +63 -0
  580. package/build-types/utils.d.ts.map +1 -0
  581. package/build-types/variations/variation.d.ts +10 -0
  582. package/build-types/variations/variation.d.ts.map +1 -0
  583. package/build-types/variations/variations-color.d.ts +7 -0
  584. package/build-types/variations/variations-color.d.ts.map +1 -0
  585. package/build-types/variations/variations-panel.d.ts +13 -0
  586. package/build-types/variations/variations-panel.d.ts.map +1 -0
  587. package/build-types/variations/variations-typography.d.ts +7 -0
  588. package/build-types/variations/variations-typography.d.ts.map +1 -0
  589. package/build-types/with-global-styles-provider.d.ts +20 -0
  590. package/build-types/with-global-styles-provider.d.ts.map +1 -0
  591. package/package.json +67 -0
  592. package/src/README.md +99 -0
  593. package/src/background-panel.tsx +56 -0
  594. package/src/block-preview-panel.tsx +91 -0
  595. package/src/color-indicator-wrapper.tsx +34 -0
  596. package/src/color-palette-panel.tsx +111 -0
  597. package/src/color-preview.tsx +78 -0
  598. package/src/color-variations.tsx +35 -0
  599. package/src/confirm-reset-shadow-dialog.tsx +45 -0
  600. package/src/context.ts +21 -0
  601. package/src/dimensions-panel.tsx +85 -0
  602. package/src/font-families.tsx +127 -0
  603. package/src/font-family-item.tsx +52 -0
  604. package/src/font-library-modal/collection-font-variant.tsx +52 -0
  605. package/src/font-library-modal/context.tsx +591 -0
  606. package/src/font-library-modal/font-card.tsx +77 -0
  607. package/src/font-library-modal/font-collection.tsx +592 -0
  608. package/src/font-library-modal/font-demo.tsx +123 -0
  609. package/src/font-library-modal/google-fonts-confirm-dialog.tsx +57 -0
  610. package/src/font-library-modal/index.tsx +110 -0
  611. package/src/font-library-modal/installed-fonts.tsx +547 -0
  612. package/src/font-library-modal/lib/inflate.js +4112 -0
  613. package/src/font-library-modal/lib/lib-font.browser.d.ts +11 -0
  614. package/src/font-library-modal/lib/lib-font.browser.js +3861 -0
  615. package/src/font-library-modal/lib/unbrotli.js +2706 -0
  616. package/src/font-library-modal/library-font-details.tsx +46 -0
  617. package/src/font-library-modal/library-font-variant.tsx +67 -0
  618. package/src/font-library-modal/resolvers.tsx +100 -0
  619. package/src/font-library-modal/style.scss +222 -0
  620. package/src/font-library-modal/types.ts +176 -0
  621. package/src/font-library-modal/upload-fonts.tsx +269 -0
  622. package/src/font-library-modal/utils/constants.ts +23 -0
  623. package/src/font-library-modal/utils/filter-fonts.ts +47 -0
  624. package/src/font-library-modal/utils/fonts-outline.ts +33 -0
  625. package/src/font-library-modal/utils/index.ts +368 -0
  626. package/src/font-library-modal/utils/make-families-from-faces.ts +34 -0
  627. package/src/font-library-modal/utils/preview-styles.ts +167 -0
  628. package/src/font-library-modal/utils/set-immutably.ts +37 -0
  629. package/src/font-library-modal/utils/sort-font-faces.ts +46 -0
  630. package/src/font-library-modal/utils/toggleFont.ts +109 -0
  631. package/src/font-sizes/confirm-delete-font-size-dialog.tsx +51 -0
  632. package/src/font-sizes/confirm-reset-font-sizes-dialog.tsx +45 -0
  633. package/src/font-sizes/font-size-preview.tsx +47 -0
  634. package/src/font-sizes/font-size.tsx +289 -0
  635. package/src/font-sizes/font-sizes-count.tsx +37 -0
  636. package/src/font-sizes/font-sizes.tsx +265 -0
  637. package/src/font-sizes/rename-font-size-dialog.tsx +83 -0
  638. package/src/global-styles-ui.tsx +292 -0
  639. package/src/gradients-palette-panel.tsx +126 -0
  640. package/src/highlighted-colors.tsx +44 -0
  641. package/src/hooks.ts +251 -0
  642. package/src/icon-with-current-color.tsx +31 -0
  643. package/src/index.ts +7 -0
  644. package/src/lock-unlock.ts +10 -0
  645. package/src/navigation-button.tsx +53 -0
  646. package/src/pagination/index.tsx +107 -0
  647. package/src/pagination/style.scss +7 -0
  648. package/src/palette.tsx +101 -0
  649. package/src/preset-colors.tsx +18 -0
  650. package/src/preview-colors.tsx +68 -0
  651. package/src/preview-hooks.tsx +58 -0
  652. package/src/preview-styles.tsx +196 -0
  653. package/src/preview-typography.tsx +49 -0
  654. package/src/preview-wrapper.tsx +137 -0
  655. package/src/provider.tsx +54 -0
  656. package/src/root-menu.tsx +87 -0
  657. package/src/screen-background.tsx +37 -0
  658. package/src/screen-block-list.tsx +198 -0
  659. package/src/screen-block.tsx +370 -0
  660. package/src/screen-color-palette.tsx +47 -0
  661. package/src/screen-colors.tsx +67 -0
  662. package/src/screen-css.tsx +56 -0
  663. package/src/screen-header.tsx +56 -0
  664. package/src/screen-layout.tsx +34 -0
  665. package/src/screen-revisions/index.tsx +158 -0
  666. package/src/screen-revisions/revisions-buttons.tsx +259 -0
  667. package/src/screen-revisions/style.scss +194 -0
  668. package/src/screen-revisions/types.ts +18 -0
  669. package/src/screen-revisions/use-global-styles-revisions.tsx +204 -0
  670. package/src/screen-root.tsx +146 -0
  671. package/src/screen-shadows.tsx +13 -0
  672. package/src/screen-style-variations.tsx +36 -0
  673. package/src/screen-typography-element.tsx +127 -0
  674. package/src/screen-typography.tsx +41 -0
  675. package/src/shadow-utils.ts +167 -0
  676. package/src/shadows-edit-panel.tsx +559 -0
  677. package/src/shadows-panel.tsx +207 -0
  678. package/src/size-control/index.tsx +97 -0
  679. package/src/size-control/style.scss +7 -0
  680. package/src/stories/index.story.js +410 -0
  681. package/src/style-variations-container.tsx +153 -0
  682. package/src/style-variations-content.tsx +24 -0
  683. package/src/style-variations.tsx +33 -0
  684. package/src/style.scss +287 -0
  685. package/src/subtitle.tsx +17 -0
  686. package/src/test/shadow-utils.spec.js +251 -0
  687. package/src/test/utils.spec.js +59 -0
  688. package/src/typography-elements.tsx +113 -0
  689. package/src/typography-example.tsx +78 -0
  690. package/src/typography-panel.tsx +56 -0
  691. package/src/typography-preview.tsx +61 -0
  692. package/src/typography-variations.tsx +35 -0
  693. package/src/utils.ts +301 -0
  694. package/src/variations/style.scss +43 -0
  695. package/src/variations/variation.tsx +113 -0
  696. package/src/variations/variations-color.tsx +54 -0
  697. package/src/variations/variations-panel.tsx +79 -0
  698. package/src/variations/variations-typography.tsx +65 -0
  699. package/src/with-global-styles-provider.tsx +44 -0
  700. package/tsconfig.json +26 -0
  701. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var shadows_panel_exports = {};
30
+ __export(shadows_panel_exports, {
31
+ default: () => ShadowsPanel,
32
+ defaultShadow: () => defaultShadow
33
+ });
34
+ module.exports = __toCommonJS(shadows_panel_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_components = require("@wordpress/components");
37
+ var import_i18n = require("@wordpress/i18n");
38
+ var import_icons = require("@wordpress/icons");
39
+ var import_element = require("@wordpress/element");
40
+ var import_subtitle = require("./subtitle");
41
+ var import_navigation_button = require("./navigation-button");
42
+ var import_screen_header = require("./screen-header");
43
+ var import_utils = require("./utils");
44
+ var import_confirm_reset_shadow_dialog = __toESM(require("./confirm-reset-shadow-dialog"));
45
+ var import_hooks = require("./hooks");
46
+ var import_lock_unlock = require("./lock-unlock");
47
+ const { Menu } = (0, import_lock_unlock.unlock)(import_components.privateApis);
48
+ const defaultShadow = "6px 6px 9px rgba(0, 0, 0, 0.2)";
49
+ function ShadowsPanel() {
50
+ const [defaultShadows] = (0, import_hooks.useSetting)("shadow.presets.default");
51
+ const [defaultShadowsEnabled] = (0, import_hooks.useSetting)("shadow.defaultPresets");
52
+ const [themeShadows] = (0, import_hooks.useSetting)("shadow.presets.theme");
53
+ const [customShadows, setCustomShadows] = (0, import_hooks.useSetting)(
54
+ "shadow.presets.custom"
55
+ );
56
+ const onCreateShadow = (shadow) => {
57
+ setCustomShadows([...customShadows || [], shadow]);
58
+ };
59
+ const handleResetShadows = () => {
60
+ setCustomShadows([]);
61
+ };
62
+ const [isResetDialogOpen, setIsResetDialogOpen] = (0, import_element.useState)(false);
63
+ const toggleResetDialog = () => setIsResetDialogOpen(!isResetDialogOpen);
64
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
65
+ isResetDialogOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
+ import_confirm_reset_shadow_dialog.default,
67
+ {
68
+ text: (0, import_i18n.__)(
69
+ "Are you sure you want to remove all custom shadows?"
70
+ ),
71
+ confirmButtonText: (0, import_i18n.__)("Remove"),
72
+ isOpen: isResetDialogOpen,
73
+ toggleOpen: toggleResetDialog,
74
+ onConfirm: handleResetShadows
75
+ }
76
+ ),
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
78
+ import_screen_header.ScreenHeader,
79
+ {
80
+ title: (0, import_i18n.__)("Shadows"),
81
+ description: (0, import_i18n.__)(
82
+ "Manage and create shadow styles for use across the site."
83
+ )
84
+ }
85
+ ),
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "global-styles-ui-screen", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
87
+ import_components.__experimentalVStack,
88
+ {
89
+ className: "global-styles-ui__shadows-panel",
90
+ spacing: 7,
91
+ children: [
92
+ defaultShadowsEnabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
93
+ ShadowList,
94
+ {
95
+ label: (0, import_i18n.__)("Default"),
96
+ shadows: defaultShadows || [],
97
+ category: "default"
98
+ }
99
+ ),
100
+ themeShadows && themeShadows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
101
+ ShadowList,
102
+ {
103
+ label: (0, import_i18n.__)("Theme"),
104
+ shadows: themeShadows || [],
105
+ category: "theme"
106
+ }
107
+ ),
108
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
109
+ ShadowList,
110
+ {
111
+ label: (0, import_i18n.__)("Custom"),
112
+ shadows: customShadows || [],
113
+ category: "custom",
114
+ canCreate: true,
115
+ onCreate: onCreateShadow,
116
+ onReset: toggleResetDialog
117
+ }
118
+ )
119
+ ]
120
+ }
121
+ ) })
122
+ ] });
123
+ }
124
+ function ShadowList({
125
+ label,
126
+ shadows,
127
+ category,
128
+ canCreate,
129
+ onCreate,
130
+ onReset
131
+ }) {
132
+ const handleAddShadow = () => {
133
+ const newIndex = (0, import_utils.getNewIndexFromPresets)(shadows, "shadow-");
134
+ onCreate?.({
135
+ name: (0, import_i18n.sprintf)(
136
+ /* translators: %d: is an index for a preset */
137
+ (0, import_i18n.__)("Shadow %d"),
138
+ newIndex
139
+ ),
140
+ shadow: defaultShadow,
141
+ slug: `shadow-${newIndex}`
142
+ });
143
+ };
144
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 2, children: [
145
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", children: [
146
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_subtitle.Subtitle, { level: 3, children: label }),
147
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.FlexItem, { className: "global-styles-ui__shadows-panel__options-container", children: [
148
+ canCreate && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
+ import_components.Button,
150
+ {
151
+ size: "small",
152
+ icon: import_icons.plus,
153
+ label: (0, import_i18n.__)("Add shadow"),
154
+ onClick: () => {
155
+ handleAddShadow();
156
+ }
157
+ }
158
+ ),
159
+ !!shadows?.length && category === "custom" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Menu, { children: [
160
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
161
+ Menu.TriggerButton,
162
+ {
163
+ render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
164
+ import_components.Button,
165
+ {
166
+ size: "small",
167
+ icon: import_icons.moreVertical,
168
+ label: (0, import_i18n.__)("Shadow options")
169
+ }
170
+ )
171
+ }
172
+ ),
173
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Menu.Popover, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Menu.Item, { onClick: onReset, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Menu.ItemLabel, { children: (0, import_i18n.__)("Remove all custom shadows") }) }) })
174
+ ] })
175
+ ] })
176
+ ] }),
177
+ shadows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: shadows.map((shadow) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
178
+ ShadowItem,
179
+ {
180
+ shadow,
181
+ category
182
+ },
183
+ shadow.slug
184
+ )) })
185
+ ] });
186
+ }
187
+ function ShadowItem({ shadow, category }) {
188
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
189
+ import_navigation_button.NavigationButtonAsItem,
190
+ {
191
+ path: `/shadows/edit/${category}/${shadow.slug}`,
192
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { children: [
193
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: shadow.name }),
194
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, { icon: (0, import_i18n.isRTL)() ? import_icons.chevronLeft : import_icons.chevronRight })
195
+ ] })
196
+ }
197
+ );
198
+ }
199
+ // Annotate the CommonJS export names for ESM import in node:
200
+ 0 && (module.exports = {
201
+ defaultShadow
202
+ });
203
+ //# sourceMappingURL=shadows-panel.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/shadows-panel.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalItemGroup as ItemGroup,\n\tButton,\n\tFlexItem,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport {\n\tplus,\n\tIcon,\n\tchevronLeft,\n\tchevronRight,\n\tmoreVertical,\n} from '@wordpress/icons';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Subtitle } from './subtitle';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { ScreenHeader } from './screen-header';\nimport { getNewIndexFromPresets } from './utils';\nimport ConfirmResetShadowDialog from './confirm-reset-shadow-dialog';\nimport { useSetting } from './hooks';\nimport { unlock } from './lock-unlock';\n\nconst { Menu } = unlock( componentsPrivateApis );\n\nexport const defaultShadow = '6px 6px 9px rgba(0, 0, 0, 0.2)';\n\nexport default function ShadowsPanel() {\n\tconst [ defaultShadows ] = useSetting( 'shadow.presets.default' );\n\tconst [ defaultShadowsEnabled ] = useSetting( 'shadow.defaultPresets' );\n\tconst [ themeShadows ] = useSetting( 'shadow.presets.theme' );\n\tconst [ customShadows, setCustomShadows ] = useSetting(\n\t\t'shadow.presets.custom'\n\t);\n\n\tconst onCreateShadow = ( shadow: any ) => {\n\t\tsetCustomShadows( [ ...( customShadows || [] ), shadow ] );\n\t};\n\n\tconst handleResetShadows = () => {\n\t\tsetCustomShadows( [] );\n\t};\n\n\tconst [ isResetDialogOpen, setIsResetDialogOpen ] = useState( false );\n\n\tconst toggleResetDialog = () => setIsResetDialogOpen( ! isResetDialogOpen );\n\n\treturn (\n\t\t<>\n\t\t\t{ isResetDialogOpen && (\n\t\t\t\t<ConfirmResetShadowDialog\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Are you sure you want to remove all custom shadows?'\n\t\t\t\t\t) }\n\t\t\t\t\tconfirmButtonText={ __( 'Remove' ) }\n\t\t\t\t\tisOpen={ isResetDialogOpen }\n\t\t\t\t\ttoggleOpen={ toggleResetDialog }\n\t\t\t\t\tonConfirm={ handleResetShadows }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Shadows' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage and create shadow styles for use across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<div className=\"global-styles-ui-screen\">\n\t\t\t\t<VStack\n\t\t\t\t\tclassName=\"global-styles-ui__shadows-panel\"\n\t\t\t\t\tspacing={ 7 }\n\t\t\t\t>\n\t\t\t\t\t{ defaultShadowsEnabled && (\n\t\t\t\t\t\t<ShadowList\n\t\t\t\t\t\t\tlabel={ __( 'Default' ) }\n\t\t\t\t\t\t\tshadows={ defaultShadows || [] }\n\t\t\t\t\t\t\tcategory=\"default\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ themeShadows && themeShadows.length > 0 && (\n\t\t\t\t\t\t<ShadowList\n\t\t\t\t\t\t\tlabel={ __( 'Theme' ) }\n\t\t\t\t\t\t\tshadows={ themeShadows || [] }\n\t\t\t\t\t\t\tcategory=\"theme\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<ShadowList\n\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\tshadows={ customShadows || [] }\n\t\t\t\t\t\tcategory=\"custom\"\n\t\t\t\t\t\tcanCreate\n\t\t\t\t\t\tonCreate={ onCreateShadow }\n\t\t\t\t\t\tonReset={ toggleResetDialog }\n\t\t\t\t\t/>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\ninterface ShadowListProps {\n\tlabel: string;\n\tshadows: any[];\n\tcategory: string;\n\tcanCreate?: boolean;\n\tonCreate?: ( shadow: any ) => void;\n\tonReset?: () => void;\n}\n\nfunction ShadowList( {\n\tlabel,\n\tshadows,\n\tcategory,\n\tcanCreate,\n\tonCreate,\n\tonReset,\n}: ShadowListProps ) {\n\tconst handleAddShadow = () => {\n\t\tconst newIndex = getNewIndexFromPresets( shadows, 'shadow-' );\n\t\tonCreate?.( {\n\t\t\tname: sprintf(\n\t\t\t\t/* translators: %d: is an index for a preset */\n\t\t\t\t__( 'Shadow %d' ),\n\t\t\t\tnewIndex\n\t\t\t),\n\t\t\tshadow: defaultShadow,\n\t\t\tslug: `shadow-${ newIndex }`,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t<Subtitle level={ 3 }>{ label }</Subtitle>\n\t\t\t\t<FlexItem className=\"global-styles-ui__shadows-panel__options-container\">\n\t\t\t\t\t{ canCreate && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\tlabel={ __( 'Add shadow' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thandleAddShadow();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! shadows?.length && category === 'custom' && (\n\t\t\t\t\t\t<Menu>\n\t\t\t\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Shadow options' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Menu.Popover>\n\t\t\t\t\t\t\t\t<Menu.Item onClick={ onReset }>\n\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Remove all custom shadows' ) }\n\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t</Menu.Item>\n\t\t\t\t\t\t\t</Menu.Popover>\n\t\t\t\t\t\t</Menu>\n\t\t\t\t\t) }\n\t\t\t\t</FlexItem>\n\t\t\t</HStack>\n\t\t\t{ shadows.length > 0 && (\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t{ shadows.map( ( shadow ) => (\n\t\t\t\t\t\t<ShadowItem\n\t\t\t\t\t\t\tkey={ shadow.slug }\n\t\t\t\t\t\t\tshadow={ shadow }\n\t\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t</ItemGroup>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\ninterface ShadowItemProps {\n\tshadow: any;\n\tcategory: string;\n}\n\nfunction ShadowItem( { shadow, category }: ShadowItemProps ) {\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ `/shadows/edit/${ category }/${ shadow.slug }` }\n\t\t>\n\t\t\t<HStack>\n\t\t\t\t<FlexItem>{ shadow.name }</FlexItem>\n\t\t\t\t<Icon icon={ isRTL() ? chevronLeft : chevronRight } />\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["componentsPrivateApis", "ConfirmResetShadowDialog", "VStack", "HStack", "ItemGroup"]
7
+ }
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var size_control_exports = {};
20
+ __export(size_control_exports, {
21
+ SizeControl: () => SizeControl
22
+ });
23
+ module.exports = __toCommonJS(size_control_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_components = require("@wordpress/components");
26
+ const DEFAULT_UNITS = ["px", "em", "rem", "vw", "vh"];
27
+ function SizeControl({
28
+ // Do not allow manipulation of margin bottom
29
+ __nextHasNoMarginBottom,
30
+ ...props
31
+ }) {
32
+ const { baseControlProps } = (0, import_components.useBaseControlProps)(props);
33
+ const { value, onChange, fallbackValue, disabled, label } = props;
34
+ const units = (0, import_components.__experimentalUseCustomUnits)({
35
+ availableUnits: DEFAULT_UNITS
36
+ });
37
+ const [valueQuantity, valueUnit = "px"] = (0, import_components.__experimentalParseQuantityAndUnitFromRawValue)(value, units);
38
+ const isValueUnitRelative = !!valueUnit && ["em", "rem", "vw", "vh"].includes(valueUnit);
39
+ const handleUnitControlChange = (newValue) => {
40
+ onChange?.(newValue);
41
+ };
42
+ const handleRangeControlChange = (newValue) => {
43
+ if (newValue !== void 0) {
44
+ onChange?.(newValue + valueUnit);
45
+ } else {
46
+ onChange?.(void 0);
47
+ }
48
+ };
49
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.BaseControl, { ...baseControlProps, __nextHasNoMarginBottom: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.Flex, { children: [
50
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
+ import_components.__experimentalUnitControl,
52
+ {
53
+ __next40pxDefaultSize: true,
54
+ label,
55
+ hideLabelFromVision: true,
56
+ value,
57
+ onChange: handleUnitControlChange,
58
+ units,
59
+ min: 0,
60
+ disabled
61
+ }
62
+ ) }),
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalSpacer, { marginX: 2, marginBottom: 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
64
+ import_components.RangeControl,
65
+ {
66
+ __next40pxDefaultSize: true,
67
+ __nextHasNoMarginBottom: true,
68
+ label,
69
+ hideLabelFromVision: true,
70
+ value: valueQuantity,
71
+ initialPosition: fallbackValue,
72
+ withInputField: false,
73
+ onChange: handleRangeControlChange,
74
+ min: 0,
75
+ max: isValueUnitRelative ? 10 : 100,
76
+ step: isValueUnitRelative ? 0.1 : 1,
77
+ disabled
78
+ }
79
+ ) }) })
80
+ ] }) });
81
+ }
82
+ // Annotate the CommonJS export names for ESM import in node:
83
+ 0 && (module.exports = {
84
+ SizeControl
85
+ });
86
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/size-control/index.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tRangeControl,\n\tFlex,\n\tFlexItem,\n\tuseBaseControlProps,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\n\nconst DEFAULT_UNITS = [ 'px', 'em', 'rem', 'vw', 'vh' ];\n\ninterface SizeControlProps {\n\tvalue?: string;\n\tonChange?: ( value: string | undefined ) => void;\n\tfallbackValue?: number;\n\tdisabled?: boolean;\n\tlabel?: string;\n\t__nextHasNoMarginBottom?: boolean;\n}\n\nfunction SizeControl( {\n\t// Do not allow manipulation of margin bottom\n\t__nextHasNoMarginBottom,\n\t...props\n}: SizeControlProps ) {\n\tconst { baseControlProps } = useBaseControlProps( props );\n\tconst { value, onChange, fallbackValue, disabled, label } = props;\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: DEFAULT_UNITS,\n\t} );\n\n\tconst [ valueQuantity, valueUnit = 'px' ] =\n\t\tparseQuantityAndUnitFromRawValue( value, units );\n\n\tconst isValueUnitRelative =\n\t\t!! valueUnit && [ 'em', 'rem', 'vw', 'vh' ].includes( valueUnit );\n\n\t// Receives the new value from the UnitControl component as a string containing the value and unit.\n\tconst handleUnitControlChange = ( newValue: string | undefined ) => {\n\t\tonChange?.( newValue );\n\t};\n\n\t// Receives the new value from the RangeControl component as a number.\n\tconst handleRangeControlChange = ( newValue: number | undefined ) => {\n\t\tif ( newValue !== undefined ) {\n\t\t\tonChange?.( newValue + valueUnit );\n\t\t} else {\n\t\t\tonChange?.( undefined );\n\t\t}\n\t};\n\n\treturn (\n\t\t<BaseControl { ...baseControlProps } __nextHasNoMarginBottom>\n\t\t\t<Flex>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ handleUnitControlChange }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<Spacer marginX={ 2 } marginBottom={ 0 }>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tvalue={ valueQuantity }\n\t\t\t\t\t\t\tinitialPosition={ fallbackValue }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\tonChange={ handleRangeControlChange }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ isValueUnitRelative ? 10 : 100 }\n\t\t\t\t\t\t\tstep={ isValueUnitRelative ? 0.1 : 1 }\n\t\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Spacer>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</BaseControl>\n\t);\n}\n\nexport { SizeControl };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4DG;AAzDH,wBAUO;AAEP,MAAM,gBAAgB,CAAE,MAAM,MAAM,OAAO,MAAM,IAAK;AAWtD,SAAS,YAAa;AAAA;AAAA,EAErB;AAAA,EACA,GAAG;AACJ,GAAsB;AACrB,QAAM,EAAE,iBAAiB,QAAI,uCAAqB,KAAM;AACxD,QAAM,EAAE,OAAO,UAAU,eAAe,UAAU,MAAM,IAAI;AAE5D,QAAM,YAAQ,kBAAAA,8BAAgB;AAAA,IAC7B,gBAAgB;AAAA,EACjB,CAAE;AAEF,QAAM,CAAE,eAAe,YAAY,IAAK,QACvC,kBAAAC,gDAAkC,OAAO,KAAM;AAEhD,QAAM,sBACL,CAAC,CAAE,aAAa,CAAE,MAAM,OAAO,MAAM,IAAK,EAAE,SAAU,SAAU;AAGjE,QAAM,0BAA0B,CAAE,aAAkC;AACnE,eAAY,QAAS;AAAA,EACtB;AAGA,QAAM,2BAA2B,CAAE,aAAkC;AACpE,QAAK,aAAa,QAAY;AAC7B,iBAAY,WAAW,SAAU;AAAA,IAClC,OAAO;AACN,iBAAY,MAAU;AAAA,IACvB;AAAA,EACD;AAEA,SACC,4CAAC,iCAAc,GAAG,kBAAmB,yBAAuB,MAC3D,uDAAC,0BACA;AAAA,gDAAC,8BAAS,SAAO,MAChB;AAAA,MAAC,kBAAAC;AAAA,MAAA;AAAA,QACA,uBAAqB;AAAA,QACrB;AAAA,QACA,qBAAmB;AAAA,QACnB;AAAA,QACA,UAAW;AAAA,QACX;AAAA,QACA,KAAM;AAAA,QACN;AAAA;AAAA,IACD,GACD;AAAA,IACA,4CAAC,8BAAS,SAAO,MAChB,sDAAC,kBAAAC,sBAAA,EAAO,SAAU,GAAI,cAAe,GACpC;AAAA,MAAC;AAAA;AAAA,QACA,uBAAqB;AAAA,QACrB,yBAAuB;AAAA,QACvB;AAAA,QACA,qBAAmB;AAAA,QACnB,OAAQ;AAAA,QACR,iBAAkB;AAAA,QAClB,gBAAiB;AAAA,QACjB,UAAW;AAAA,QACX,KAAM;AAAA,QACN,KAAM,sBAAsB,KAAK;AAAA,QACjC,MAAO,sBAAsB,MAAM;AAAA,QACnC;AAAA;AAAA,IACD,GACD,GACD;AAAA,KACD,GACD;AAEF;",
6
+ "names": ["useCustomUnits", "parseQuantityAndUnitFromRawValue", "UnitControl", "Spacer"]
7
+ }
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var style_variations_container_exports = {};
30
+ __export(style_variations_container_exports, {
31
+ default: () => style_variations_container_default
32
+ });
33
+ module.exports = __toCommonJS(style_variations_container_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var import_core_data = require("@wordpress/core-data");
36
+ var import_data = require("@wordpress/data");
37
+ var import_element = require("@wordpress/element");
38
+ var import_components = require("@wordpress/components");
39
+ var import_i18n = require("@wordpress/i18n");
40
+ var import_preview_styles = __toESM(require("./preview-styles"));
41
+ var import_variation = __toESM(require("./variations/variation"));
42
+ var import_context = require("./context");
43
+ var import_utils = require("./utils");
44
+ function StyleVariationsContainer({
45
+ gap = 2
46
+ }) {
47
+ const { user } = (0, import_element.useContext)(import_context.GlobalStylesContext);
48
+ const userStyles = user?.styles;
49
+ const variations = (0, import_data.useSelect)((select) => {
50
+ const result = select(
51
+ import_core_data.store
52
+ ).__experimentalGetCurrentThemeGlobalStylesVariations();
53
+ return Array.isArray(result) ? result : void 0;
54
+ }, []);
55
+ const fullStyleVariations = variations?.filter(
56
+ (variation) => {
57
+ return !(0, import_utils.isVariationWithProperties)(variation, ["color"]) && !(0, import_utils.isVariationWithProperties)(variation, [
58
+ "typography",
59
+ "spacing"
60
+ ]);
61
+ }
62
+ );
63
+ const themeVariations = (0, import_element.useMemo)(() => {
64
+ const withEmptyVariation = [
65
+ {
66
+ title: (0, import_i18n.__)("Default"),
67
+ settings: {},
68
+ styles: {}
69
+ },
70
+ ...fullStyleVariations ?? []
71
+ ];
72
+ return [
73
+ ...withEmptyVariation.map((variation) => {
74
+ const blockStyles = variation?.styles?.blocks ? { ...variation.styles.blocks } : {};
75
+ if (userStyles?.blocks) {
76
+ Object.keys(userStyles.blocks).forEach((blockName) => {
77
+ if (userStyles.blocks?.[blockName]?.css) {
78
+ const variationBlockStyles = blockStyles[blockName] || {};
79
+ const customCSS = {
80
+ css: `${blockStyles[blockName]?.css || ""} ${userStyles.blocks?.[blockName]?.css?.trim() || ""}`
81
+ };
82
+ blockStyles[blockName] = {
83
+ ...variationBlockStyles,
84
+ ...customCSS
85
+ };
86
+ }
87
+ });
88
+ }
89
+ const css = userStyles?.css || variation.styles?.css ? {
90
+ css: `${variation.styles?.css || ""} ${userStyles?.css || ""}`
91
+ } : {};
92
+ const blocks = Object.keys(blockStyles).length > 0 ? { blocks: blockStyles } : {};
93
+ const styles = {
94
+ ...variation.styles,
95
+ ...css,
96
+ ...blocks
97
+ };
98
+ return {
99
+ ...variation,
100
+ settings: variation.settings ?? {},
101
+ styles
102
+ };
103
+ })
104
+ ];
105
+ }, [fullStyleVariations, userStyles?.blocks, userStyles?.css]);
106
+ if (!fullStyleVariations || fullStyleVariations.length < 1) {
107
+ return null;
108
+ }
109
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
110
+ import_components.__experimentalGrid,
111
+ {
112
+ columns: 2,
113
+ className: "global-styles-ui-style-variations-container",
114
+ gap,
115
+ children: themeVariations.map(
116
+ (variation, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_variation.default, { variation, children: (isFocused) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
117
+ import_preview_styles.default,
118
+ {
119
+ label: variation?.title,
120
+ withHoverView: true,
121
+ isFocused,
122
+ variation
123
+ }
124
+ ) }, index)
125
+ )
126
+ }
127
+ );
128
+ }
129
+ var style_variations_container_default = StyleVariationsContainer;
130
+ //# sourceMappingURL=style-variations-container.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/style-variations-container.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport type {\n\tGlobalStylesConfig,\n\tStyleVariation,\n} from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport PreviewStyles from './preview-styles';\nimport Variation from './variations/variation';\nimport { GlobalStylesContext } from './context';\nimport { isVariationWithProperties } from './utils';\n\ninterface StyleVariationsContainerProps {\n\tgap?: number;\n}\n\nfunction StyleVariationsContainer( {\n\tgap = 2,\n}: StyleVariationsContainerProps ) {\n\tconst { user } = useContext( GlobalStylesContext );\n\tconst userStyles = user?.styles;\n\n\tconst variations = useSelect( ( select ) => {\n\t\tconst result =\n\t\t\tselect(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\t\t// The API might return null or an array\n\t\treturn Array.isArray( result )\n\t\t\t? ( result as GlobalStylesConfig[] )\n\t\t\t: undefined;\n\t}, [] );\n\n\t// Filter out variations that are color or typography variations.\n\tconst fullStyleVariations = variations?.filter(\n\t\t( variation: GlobalStylesConfig ) => {\n\t\t\treturn (\n\t\t\t\t! isVariationWithProperties( variation, [ 'color' ] ) &&\n\t\t\t\t! isVariationWithProperties( variation, [\n\t\t\t\t\t'typography',\n\t\t\t\t\t'spacing',\n\t\t\t\t] )\n\t\t\t);\n\t\t}\n\t);\n\n\tconst themeVariations = useMemo( () => {\n\t\tconst withEmptyVariation: StyleVariation[] = [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...( fullStyleVariations ?? [] ),\n\t\t];\n\t\treturn [\n\t\t\t...withEmptyVariation.map( ( variation: StyleVariation ) => {\n\t\t\t\tconst blockStyles = variation?.styles?.blocks\n\t\t\t\t\t? { ...variation.styles.blocks }\n\t\t\t\t\t: {};\n\n\t\t\t\t// We need to copy any user custom CSS to the variation to prevent it being lost\n\t\t\t\t// when switching variations.\n\t\t\t\tif ( userStyles?.blocks ) {\n\t\t\t\t\tObject.keys( userStyles.blocks ).forEach( ( blockName ) => {\n\t\t\t\t\t\t// First get any block specific custom CSS from the current user styles and merge with any custom CSS for\n\t\t\t\t\t\t// that block in the variation.\n\t\t\t\t\t\tif ( userStyles.blocks?.[ blockName ]?.css ) {\n\t\t\t\t\t\t\tconst variationBlockStyles =\n\t\t\t\t\t\t\t\tblockStyles[ blockName ] || {};\n\t\t\t\t\t\t\tconst customCSS = {\n\t\t\t\t\t\t\t\tcss: `${\n\t\t\t\t\t\t\t\t\tblockStyles[ blockName ]?.css || ''\n\t\t\t\t\t\t\t\t} ${\n\t\t\t\t\t\t\t\t\tuserStyles.blocks?.[\n\t\t\t\t\t\t\t\t\t\tblockName\n\t\t\t\t\t\t\t\t\t]?.css?.trim() || ''\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tblockStyles[ blockName ] = {\n\t\t\t\t\t\t\t\t...variationBlockStyles,\n\t\t\t\t\t\t\t\t...customCSS,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\t// Now merge any global custom CSS from current user styles with global custom CSS in the variation.\n\t\t\t\tconst css =\n\t\t\t\t\tuserStyles?.css || variation.styles?.css\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tcss: `${ variation.styles?.css || '' } ${\n\t\t\t\t\t\t\t\t\tuserStyles?.css || ''\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: {};\n\n\t\t\t\tconst blocks =\n\t\t\t\t\tObject.keys( blockStyles ).length > 0\n\t\t\t\t\t\t? { blocks: blockStyles }\n\t\t\t\t\t\t: {};\n\n\t\t\t\tconst styles = {\n\t\t\t\t\t...variation.styles,\n\t\t\t\t\t...css,\n\t\t\t\t\t...blocks,\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\t...variation,\n\t\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\t\tstyles,\n\t\t\t\t};\n\t\t\t} ),\n\t\t];\n\t}, [ fullStyleVariations, userStyles?.blocks, userStyles?.css ] );\n\n\tif ( ! fullStyleVariations || fullStyleVariations.length < 1 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Grid\n\t\t\tcolumns={ 2 }\n\t\t\tclassName=\"global-styles-ui-style-variations-container\"\n\t\t\tgap={ gap }\n\t\t>\n\t\t\t{ themeVariations.map(\n\t\t\t\t( variation: StyleVariation, index: number ) => (\n\t\t\t\t\t<Variation key={ index } variation={ variation }>\n\t\t\t\t\t\t{ ( isFocused: boolean ) => (\n\t\t\t\t\t\t\t<PreviewStyles\n\t\t\t\t\t\t\t\tlabel={ variation?.title }\n\t\t\t\t\t\t\t\twithHoverView\n\t\t\t\t\t\t\t\tisFocused={ isFocused }\n\t\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Variation>\n\t\t\t\t)\n\t\t\t) }\n\t\t</Grid>\n\t);\n}\n\nexport default StyleVariationsContainer;\n"],
5
+ "mappings": "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",
6
+ "names": ["coreStore", "Grid", "Variation", "PreviewStyles"]
7
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var style_variations_content_exports = {};
30
+ __export(style_variations_content_exports, {
31
+ StyleVariationsContent: () => StyleVariationsContent
32
+ });
33
+ module.exports = __toCommonJS(style_variations_content_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var import_i18n = require("@wordpress/i18n");
36
+ var import_components = require("@wordpress/components");
37
+ var import_style_variations_container = __toESM(require("./style-variations-container"));
38
+ var import_variations_typography = __toESM(require("./variations/variations-typography"));
39
+ var import_variations_color = __toESM(require("./variations/variations-color"));
40
+ function StyleVariationsContent() {
41
+ const gap = 3;
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 10, className: "global-styles-ui-variation-container", children: [
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_style_variations_container.default, { gap }),
44
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_variations_color.default, { title: (0, import_i18n.__)("Color Variations"), gap }),
45
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_variations_typography.default, { title: (0, import_i18n.__)("Typography"), gap })
46
+ ] });
47
+ }
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ StyleVariationsContent
51
+ });
52
+ //# sourceMappingURL=style-variations-content.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/style-variations-content.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport StyleVariationsContainer from './style-variations-container';\nimport TypographyVariations from './variations/variations-typography';\nimport ColorVariations from './variations/variations-color';\n\nexport function StyleVariationsContent() {\n\tconst gap = 3;\n\n\treturn (\n\t\t<VStack spacing={ 10 } className=\"global-styles-ui-variation-container\">\n\t\t\t<StyleVariationsContainer gap={ gap } />\n\t\t\t<ColorVariations title={ __( 'Color Variations' ) } gap={ gap } />\n\t\t\t<TypographyVariations title={ __( 'Typography' ) } gap={ gap } />\n\t\t</VStack>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBE;AAdF,kBAAmB;AACnB,wBAA+C;AAK/C,wCAAqC;AACrC,mCAAiC;AACjC,8BAA4B;AAErB,SAAS,yBAAyB;AACxC,QAAM,MAAM;AAEZ,SACC,6CAAC,kBAAAA,sBAAA,EAAO,SAAU,IAAK,WAAU,wCAChC;AAAA,gDAAC,kCAAAC,SAAA,EAAyB,KAAY;AAAA,IACtC,4CAAC,wBAAAC,SAAA,EAAgB,WAAQ,gBAAI,kBAAmB,GAAI,KAAY;AAAA,IAChE,4CAAC,6BAAAC,SAAA,EAAqB,WAAQ,gBAAI,YAAa,GAAI,KAAY;AAAA,KAChE;AAEF;",
6
+ "names": ["VStack", "StyleVariationsContainer", "ColorVariations", "TypographyVariations"]
7
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var style_variations_exports = {};
30
+ __export(style_variations_exports, {
31
+ StyleVariations: () => StyleVariations
32
+ });
33
+ module.exports = __toCommonJS(style_variations_exports);
34
+ var import_style_variations_container = __toESM(require("./style-variations-container"));
35
+ var import_with_global_styles_provider = require("./with-global-styles-provider");
36
+ const StyleVariations = (0, import_with_global_styles_provider.withGlobalStylesProvider)(import_style_variations_container.default);
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ StyleVariations
40
+ });
41
+ //# sourceMappingURL=style-variations.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/style-variations.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { GlobalStylesConfig } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport StyleVariationsContainer from './style-variations-container';\nimport { withGlobalStylesProvider } from './with-global-styles-provider';\n\nexport interface StyleVariationsProps {\n\tvalue: GlobalStylesConfig;\n\tbaseValue: GlobalStylesConfig;\n\tonChange: ( config: GlobalStylesConfig ) => void;\n\tgap?: number;\n}\n\n/**\n * Render Style Variations.\n *\n * @example\n * ```tsx\n * <StyleVariations\n * value={userConfig}\n * baseValue={baseConfig}\n * onChange={setUserConfig}\n * gap={3}\n * />\n * ```\n */\nexport const StyleVariations: React.ComponentType< StyleVariationsProps > =\n\twithGlobalStylesProvider( StyleVariationsContainer );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,wCAAqC;AACrC,yCAAyC;AAsBlC,MAAM,sBACZ,6DAA0B,kCAAAA,OAAyB;",
6
+ "names": ["StyleVariationsContainer"]
7
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var subtitle_exports = {};
20
+ __export(subtitle_exports, {
21
+ Subtitle: () => Subtitle
22
+ });
23
+ module.exports = __toCommonJS(subtitle_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_components = require("@wordpress/components");
26
+ function Subtitle({ children, level = 2 }) {
27
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalHeading, { className: "global-styles-ui-subtitle", level, children });
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ Subtitle
32
+ });
33
+ //# sourceMappingURL=subtitle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/subtitle.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\ninterface SubtitleProps {\n\tchildren: React.ReactNode;\n\tlevel?: 1 | 2 | 3 | 4 | 5 | 6;\n}\n\nexport function Subtitle( { children, level = 2 }: SubtitleProps ) {\n\treturn (\n\t\t<Heading className=\"global-styles-ui-subtitle\" level={ level }>\n\t\t\t{ children }\n\t\t</Heading>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYE;AATF,wBAAiD;AAO1C,SAAS,SAAU,EAAE,UAAU,QAAQ,EAAE,GAAmB;AAClE,SACC,4CAAC,kBAAAA,uBAAA,EAAQ,WAAU,6BAA4B,OAC5C,UACH;AAEF;",
6
+ "names": ["Heading"]
7
+ }