@wordpress/ui 0.4.0 → 0.5.1-next.06ee73755.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 (349) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +18 -0
  4. package/build/badge/badge.cjs +95 -0
  5. package/build/badge/badge.cjs.map +7 -0
  6. package/build/{lock-unlock.js → badge/index.cjs} +8 -14
  7. package/build/badge/index.cjs.map +7 -0
  8. package/build/badge/types.cjs +19 -0
  9. package/build/badge/types.cjs.map +7 -0
  10. package/build/box/{box.js → box.cjs} +7 -6
  11. package/build/box/box.cjs.map +7 -0
  12. package/build/box/{index.js → index.cjs} +2 -2
  13. package/build/box/{types.js → types.cjs} +1 -1
  14. package/build/box/types.cjs.map +7 -0
  15. package/build/button/button.cjs +433 -0
  16. package/build/button/button.cjs.map +7 -0
  17. package/build/{utils/element.js → button/icon.cjs} +22 -20
  18. package/build/button/icon.cjs.map +7 -0
  19. package/build/button/index.cjs +39 -0
  20. package/build/button/index.cjs.map +7 -0
  21. package/build/button/types.cjs +19 -0
  22. package/build/button/types.cjs.map +7 -0
  23. package/build/form/primitives/field/control.cjs +38 -0
  24. package/build/form/primitives/field/control.cjs.map +7 -0
  25. package/build/form/primitives/field/description.cjs +92 -0
  26. package/build/form/primitives/field/description.cjs.map +7 -0
  27. package/build/form/primitives/field/details.cjs +99 -0
  28. package/build/form/primitives/field/details.cjs.map +7 -0
  29. package/build/form/primitives/field/index.cjs +46 -0
  30. package/build/form/primitives/field/index.cjs.map +7 -0
  31. package/build/form/primitives/field/item.cjs +36 -0
  32. package/build/form/primitives/field/item.cjs.map +7 -0
  33. package/build/form/primitives/field/label.cjs +98 -0
  34. package/build/form/primitives/field/label.cjs.map +7 -0
  35. package/build/form/primitives/field/root.cjs +79 -0
  36. package/build/form/primitives/field/root.cjs.map +7 -0
  37. package/build/form/primitives/field/types.cjs +19 -0
  38. package/build/form/primitives/field/types.cjs.map +7 -0
  39. package/build/form/primitives/fieldset/context.cjs +40 -0
  40. package/build/form/primitives/fieldset/context.cjs.map +7 -0
  41. package/build/form/primitives/fieldset/description.cjs +101 -0
  42. package/build/form/primitives/fieldset/description.cjs.map +7 -0
  43. package/build/form/primitives/fieldset/details.cjs +103 -0
  44. package/build/form/primitives/fieldset/details.cjs.map +7 -0
  45. package/build/form/primitives/fieldset/index.cjs +40 -0
  46. package/build/form/primitives/fieldset/index.cjs.map +7 -0
  47. package/build/form/primitives/fieldset/legend.cjs +94 -0
  48. package/build/form/primitives/fieldset/legend.cjs.map +7 -0
  49. package/build/form/primitives/fieldset/root.cjs +86 -0
  50. package/build/form/primitives/fieldset/root.cjs.map +7 -0
  51. package/build/form/primitives/fieldset/types.cjs +19 -0
  52. package/build/form/primitives/fieldset/types.cjs.map +7 -0
  53. package/build/form/primitives/index.cjs +44 -0
  54. package/build/form/primitives/index.cjs.map +7 -0
  55. package/build/icon/icon.cjs +46 -0
  56. package/build/icon/icon.cjs.map +7 -0
  57. package/build/{index.js → icon/index.cjs} +13 -7
  58. package/build/icon/index.cjs.map +7 -0
  59. package/build/icon/types.cjs +19 -0
  60. package/build/icon/types.cjs.map +7 -0
  61. package/build/index.cjs +37 -0
  62. package/build/index.cjs.map +7 -0
  63. package/build/stack/{index.js → index.cjs} +2 -2
  64. package/build/stack/index.cjs.map +7 -0
  65. package/build/stack/{stack.js → stack.cjs} +6 -18
  66. package/build/stack/stack.cjs.map +7 -0
  67. package/build/stack/{types.js → types.cjs} +1 -1
  68. package/build/stack/types.cjs.map +7 -0
  69. package/build/types/css-modules.d.cjs +2 -0
  70. package/build/types/css-modules.d.cjs.map +7 -0
  71. package/build/types/{react.d.js → react.d.cjs} +1 -1
  72. package/build/utils/{types.js → types.cjs} +1 -1
  73. package/build/visually-hidden/index.cjs +31 -0
  74. package/build/visually-hidden/index.cjs.map +7 -0
  75. package/build/visually-hidden/types.cjs +19 -0
  76. package/build/visually-hidden/types.cjs.map +7 -0
  77. package/build/visually-hidden/visually-hidden.cjs +69 -0
  78. package/build/visually-hidden/visually-hidden.cjs.map +7 -0
  79. package/build-module/badge/badge.mjs +70 -0
  80. package/build-module/badge/badge.mjs.map +7 -0
  81. package/build-module/badge/index.mjs +6 -0
  82. package/build-module/badge/index.mjs.map +7 -0
  83. package/build-module/badge/types.mjs +1 -0
  84. package/build-module/box/{box.js → box.mjs} +7 -6
  85. package/build-module/box/box.mjs.map +7 -0
  86. package/build-module/box/index.mjs +6 -0
  87. package/build-module/box/types.mjs +1 -0
  88. package/build-module/button/button.mjs +398 -0
  89. package/build-module/button/button.mjs.map +7 -0
  90. package/build-module/button/icon.mjs +22 -0
  91. package/build-module/button/icon.mjs.map +7 -0
  92. package/build-module/button/index.mjs +14 -0
  93. package/build-module/button/index.mjs.map +7 -0
  94. package/build-module/button/types.mjs +1 -0
  95. package/build-module/form/primitives/field/control.mjs +13 -0
  96. package/build-module/form/primitives/field/control.mjs.map +7 -0
  97. package/build-module/form/primitives/field/description.mjs +57 -0
  98. package/build-module/form/primitives/field/description.mjs.map +7 -0
  99. package/build-module/form/primitives/field/details.mjs +64 -0
  100. package/build-module/form/primitives/field/details.mjs.map +7 -0
  101. package/build-module/form/primitives/field/index.mjs +16 -0
  102. package/build-module/form/primitives/field/index.mjs.map +7 -0
  103. package/build-module/form/primitives/field/item.mjs +11 -0
  104. package/build-module/form/primitives/field/item.mjs.map +7 -0
  105. package/build-module/form/primitives/field/label.mjs +63 -0
  106. package/build-module/form/primitives/field/label.mjs.map +7 -0
  107. package/build-module/form/primitives/field/root.mjs +44 -0
  108. package/build-module/form/primitives/field/root.mjs.map +7 -0
  109. package/build-module/form/primitives/field/types.mjs +1 -0
  110. package/build-module/form/primitives/fieldset/context.mjs +14 -0
  111. package/build-module/form/primitives/fieldset/context.mjs.map +7 -0
  112. package/build-module/form/primitives/fieldset/description.mjs +66 -0
  113. package/build-module/form/primitives/fieldset/description.mjs.map +7 -0
  114. package/build-module/form/primitives/fieldset/details.mjs +68 -0
  115. package/build-module/form/primitives/fieldset/details.mjs.map +7 -0
  116. package/build-module/form/primitives/fieldset/index.mjs +12 -0
  117. package/build-module/form/primitives/fieldset/index.mjs.map +7 -0
  118. package/build-module/form/primitives/fieldset/legend.mjs +59 -0
  119. package/build-module/form/primitives/fieldset/legend.mjs.map +7 -0
  120. package/build-module/form/primitives/fieldset/root.mjs +51 -0
  121. package/build-module/form/primitives/fieldset/root.mjs.map +7 -0
  122. package/build-module/form/primitives/fieldset/types.mjs +1 -0
  123. package/build-module/form/primitives/index.mjs +8 -0
  124. package/build-module/form/primitives/index.mjs.map +7 -0
  125. package/build-module/icon/icon.mjs +21 -0
  126. package/build-module/icon/icon.mjs.map +7 -0
  127. package/build-module/icon/index.mjs +6 -0
  128. package/build-module/icon/index.mjs.map +7 -0
  129. package/build-module/icon/types.mjs +1 -0
  130. package/build-module/icon/types.mjs.map +7 -0
  131. package/build-module/index.mjs +9 -0
  132. package/build-module/index.mjs.map +7 -0
  133. package/build-module/stack/index.mjs +6 -0
  134. package/build-module/stack/index.mjs.map +7 -0
  135. package/build-module/stack/{stack.js → stack.mjs} +6 -8
  136. package/build-module/stack/stack.mjs.map +7 -0
  137. package/build-module/stack/types.mjs +1 -0
  138. package/build-module/stack/types.mjs.map +7 -0
  139. package/build-module/types/css-modules.d.mjs +1 -0
  140. package/build-module/types/css-modules.d.mjs.map +7 -0
  141. package/build-module/types/{react.d.js → react.d.mjs} +1 -1
  142. package/build-module/utils/types.mjs +1 -0
  143. package/build-module/utils/types.mjs.map +7 -0
  144. package/build-module/visually-hidden/index.mjs +6 -0
  145. package/build-module/visually-hidden/index.mjs.map +7 -0
  146. package/build-module/visually-hidden/types.mjs +1 -0
  147. package/build-module/visually-hidden/types.mjs.map +7 -0
  148. package/build-module/visually-hidden/visually-hidden.mjs +44 -0
  149. package/build-module/visually-hidden/visually-hidden.mjs.map +7 -0
  150. package/build-types/badge/badge.d.ts +7 -0
  151. package/build-types/badge/badge.d.ts.map +1 -0
  152. package/build-types/badge/index.d.ts +2 -0
  153. package/build-types/badge/index.d.ts.map +1 -0
  154. package/build-types/badge/stories/index.story.d.ts +15 -0
  155. package/build-types/badge/stories/index.story.d.ts.map +1 -0
  156. package/build-types/badge/types.d.ts +14 -0
  157. package/build-types/badge/types.d.ts.map +1 -0
  158. package/build-types/box/box.d.ts +0 -3
  159. package/build-types/box/box.d.ts.map +1 -1
  160. package/build-types/box/stories/index.story.d.ts +1 -11
  161. package/build-types/box/stories/index.story.d.ts.map +1 -1
  162. package/build-types/box/types.d.ts +8 -15
  163. package/build-types/box/types.d.ts.map +1 -1
  164. package/build-types/button/button.d.ts +3 -0
  165. package/build-types/button/button.d.ts.map +1 -0
  166. package/build-types/button/icon.d.ts +10 -0
  167. package/build-types/button/icon.d.ts.map +1 -0
  168. package/build-types/button/index.d.ts +10 -0
  169. package/build-types/button/index.d.ts.map +1 -0
  170. package/build-types/button/stories/index.story.d.ts +27 -0
  171. package/build-types/button/stories/index.story.d.ts.map +1 -0
  172. package/build-types/button/test/button.test.d.ts +2 -0
  173. package/build-types/button/test/button.test.d.ts.map +1 -0
  174. package/build-types/button/test/icon.test.d.ts +2 -0
  175. package/build-types/button/test/icon.test.d.ts.map +1 -0
  176. package/build-types/button/types.d.ts +61 -0
  177. package/build-types/button/types.d.ts.map +1 -0
  178. package/build-types/form/primitives/field/control.d.ts +6 -0
  179. package/build-types/form/primitives/field/control.d.ts.map +1 -0
  180. package/build-types/form/primitives/field/description.d.ts +9 -0
  181. package/build-types/form/primitives/field/description.d.ts.map +1 -0
  182. package/build-types/form/primitives/field/details.d.ts +21 -0
  183. package/build-types/form/primitives/field/details.d.ts.map +1 -0
  184. package/build-types/form/primitives/field/index.d.ts +8 -0
  185. package/build-types/form/primitives/field/index.d.ts.map +1 -0
  186. package/build-types/form/primitives/field/item.d.ts +3 -0
  187. package/build-types/form/primitives/field/item.d.ts.map +1 -0
  188. package/build-types/form/primitives/field/label.d.ts +11 -0
  189. package/build-types/form/primitives/field/label.d.ts.map +1 -0
  190. package/build-types/form/primitives/field/root.d.ts +15 -0
  191. package/build-types/form/primitives/field/root.d.ts.map +1 -0
  192. package/build-types/form/primitives/field/stories/index.story.d.ts +39 -0
  193. package/build-types/form/primitives/field/stories/index.story.d.ts.map +1 -0
  194. package/build-types/form/primitives/field/test/index.test.d.ts +2 -0
  195. package/build-types/form/primitives/field/test/index.test.d.ts.map +1 -0
  196. package/build-types/form/primitives/field/types.d.ts +62 -0
  197. package/build-types/form/primitives/field/types.d.ts.map +1 -0
  198. package/build-types/form/primitives/fieldset/context.d.ts +8 -0
  199. package/build-types/form/primitives/fieldset/context.d.ts.map +1 -0
  200. package/build-types/form/primitives/fieldset/description.d.ts +9 -0
  201. package/build-types/form/primitives/fieldset/description.d.ts.map +1 -0
  202. package/build-types/form/primitives/fieldset/details.d.ts +21 -0
  203. package/build-types/form/primitives/fieldset/details.d.ts.map +1 -0
  204. package/build-types/form/primitives/fieldset/index.d.ts +6 -0
  205. package/build-types/form/primitives/fieldset/index.d.ts.map +1 -0
  206. package/build-types/form/primitives/fieldset/legend.d.ts +9 -0
  207. package/build-types/form/primitives/fieldset/legend.d.ts.map +1 -0
  208. package/build-types/form/primitives/fieldset/root.d.ts +15 -0
  209. package/build-types/form/primitives/fieldset/root.d.ts.map +1 -0
  210. package/build-types/form/primitives/fieldset/stories/index.story.d.ts +18 -0
  211. package/build-types/form/primitives/fieldset/stories/index.story.d.ts.map +1 -0
  212. package/build-types/form/primitives/fieldset/test/index.test.d.ts +2 -0
  213. package/build-types/form/primitives/fieldset/test/index.test.d.ts.map +1 -0
  214. package/build-types/form/primitives/fieldset/types.d.ts +32 -0
  215. package/build-types/form/primitives/fieldset/types.d.ts.map +1 -0
  216. package/build-types/form/primitives/index.d.ts +3 -0
  217. package/build-types/form/primitives/index.d.ts.map +1 -0
  218. package/build-types/icon/icon.d.ts +14 -0
  219. package/build-types/icon/icon.d.ts.map +1 -0
  220. package/build-types/icon/index.d.ts +2 -0
  221. package/build-types/icon/index.d.ts.map +1 -0
  222. package/build-types/icon/stories/index.story.d.ts +11 -0
  223. package/build-types/icon/stories/index.story.d.ts.map +1 -0
  224. package/build-types/icon/test/icon.test.d.ts +2 -0
  225. package/build-types/icon/test/icon.test.d.ts.map +1 -0
  226. package/build-types/icon/types.d.ts +15 -0
  227. package/build-types/icon/types.d.ts.map +1 -0
  228. package/build-types/index.d.ts +6 -0
  229. package/build-types/index.d.ts.map +1 -1
  230. package/build-types/stack/index.d.ts +0 -3
  231. package/build-types/stack/index.d.ts.map +1 -1
  232. package/build-types/stack/stack.d.ts.map +1 -1
  233. package/build-types/stack/stories/index.story.d.ts +1 -11
  234. package/build-types/stack/stories/index.story.d.ts.map +1 -1
  235. package/build-types/stack/types.d.ts +2 -5
  236. package/build-types/stack/types.d.ts.map +1 -1
  237. package/build-types/test/index.test.d.ts +2 -0
  238. package/build-types/test/index.test.d.ts.map +1 -0
  239. package/build-types/visually-hidden/index.d.ts +2 -0
  240. package/build-types/visually-hidden/index.d.ts.map +1 -0
  241. package/build-types/visually-hidden/stories/index.story.d.ts +7 -0
  242. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -0
  243. package/build-types/visually-hidden/test/visually-hidden.test.d.ts +2 -0
  244. package/build-types/visually-hidden/test/visually-hidden.test.d.ts.map +1 -0
  245. package/build-types/visually-hidden/types.d.ts +8 -0
  246. package/build-types/visually-hidden/types.d.ts.map +1 -0
  247. package/build-types/visually-hidden/visually-hidden.d.ts +7 -0
  248. package/build-types/visually-hidden/visually-hidden.d.ts.map +1 -0
  249. package/package.json +26 -9
  250. package/src/badge/badge.tsx +88 -0
  251. package/src/badge/index.ts +1 -0
  252. package/src/badge/stories/choosing-intent.mdx +112 -0
  253. package/src/badge/stories/index.story.tsx +122 -0
  254. package/src/badge/types.ts +22 -0
  255. package/src/box/box.tsx +11 -23
  256. package/src/box/stories/index.story.tsx +3 -14
  257. package/src/box/types.ts +16 -59
  258. package/src/button/button.tsx +57 -0
  259. package/src/button/icon.tsx +24 -0
  260. package/src/button/index.ts +16 -0
  261. package/src/button/stories/index.story.tsx +218 -0
  262. package/src/button/style.module.css +263 -0
  263. package/src/button/test/button.test.tsx +101 -0
  264. package/src/button/test/icon.test.tsx +13 -0
  265. package/src/button/types.ts +70 -0
  266. package/src/form/primitives/field/control.tsx +9 -0
  267. package/src/form/primitives/field/description.tsx +18 -0
  268. package/src/form/primitives/field/details.tsx +36 -0
  269. package/src/form/primitives/field/index.ts +8 -0
  270. package/src/form/primitives/field/item.tsx +9 -0
  271. package/src/form/primitives/field/label.tsx +21 -0
  272. package/src/form/primitives/field/root.tsx +33 -0
  273. package/src/form/primitives/field/stories/index.story.tsx +132 -0
  274. package/src/form/primitives/field/test/index.test.tsx +36 -0
  275. package/src/form/primitives/field/types.ts +82 -0
  276. package/src/form/primitives/fieldset/context.tsx +13 -0
  277. package/src/form/primitives/fieldset/description.tsx +36 -0
  278. package/src/form/primitives/fieldset/details.tsx +46 -0
  279. package/src/form/primitives/fieldset/index.ts +6 -0
  280. package/src/form/primitives/fieldset/legend.tsx +17 -0
  281. package/src/form/primitives/fieldset/root.tsx +42 -0
  282. package/src/form/primitives/fieldset/stories/index.story.tsx +67 -0
  283. package/src/form/primitives/fieldset/style.module.css +12 -0
  284. package/src/form/primitives/fieldset/test/index.test.tsx +135 -0
  285. package/src/form/primitives/fieldset/types.ts +35 -0
  286. package/src/form/primitives/index.ts +2 -0
  287. package/src/icon/icon.tsx +30 -0
  288. package/src/icon/index.ts +1 -0
  289. package/src/icon/stories/index.story.tsx +47 -0
  290. package/src/icon/test/icon.test.tsx +13 -0
  291. package/src/icon/types.ts +14 -0
  292. package/src/index.ts +6 -0
  293. package/src/stack/index.ts +0 -3
  294. package/src/stack/stack.tsx +5 -18
  295. package/src/stack/stories/index.story.tsx +1 -13
  296. package/src/stack/test/stack.test.tsx +22 -12
  297. package/src/stack/types.ts +2 -6
  298. package/src/test/index.test.ts +22 -0
  299. package/src/utils/css/field.module.css +27 -0
  300. package/src/utils/css/focus.module.css +31 -0
  301. package/src/utils/css/resets.module.css +13 -0
  302. package/src/visually-hidden/index.ts +1 -0
  303. package/src/visually-hidden/stories/index.story.tsx +22 -0
  304. package/src/visually-hidden/style.module.css +15 -0
  305. package/src/visually-hidden/test/visually-hidden.test.tsx +59 -0
  306. package/src/visually-hidden/types.ts +8 -0
  307. package/src/visually-hidden/visually-hidden.tsx +23 -0
  308. package/build/box/box.js.map +0 -7
  309. package/build/box/types.js.map +0 -7
  310. package/build/index.js.map +0 -7
  311. package/build/lock-unlock.js.map +0 -7
  312. package/build/stack/index.js.map +0 -7
  313. package/build/stack/stack.js.map +0 -7
  314. package/build/stack/types.js.map +0 -7
  315. package/build/types/css-modules.d.js +0 -2
  316. package/build/utils/element.js.map +0 -7
  317. package/build-module/box/box.js.map +0 -7
  318. package/build-module/box/index.js +0 -6
  319. package/build-module/box/types.js +0 -1
  320. package/build-module/index.js +0 -3
  321. package/build-module/index.js.map +0 -7
  322. package/build-module/lock-unlock.js +0 -11
  323. package/build-module/lock-unlock.js.map +0 -7
  324. package/build-module/stack/index.js +0 -6
  325. package/build-module/stack/index.js.map +0 -7
  326. package/build-module/stack/stack.js.map +0 -7
  327. package/build-module/stack/types.js +0 -1
  328. package/build-module/types/css-modules.d.js +0 -1
  329. package/build-module/utils/element.js +0 -20
  330. package/build-module/utils/element.js.map +0 -7
  331. package/build-module/utils/types.js +0 -1
  332. package/build-types/lock-unlock.d.ts +0 -2
  333. package/build-types/lock-unlock.d.ts.map +0 -1
  334. package/build-types/utils/element.d.ts +0 -25
  335. package/build-types/utils/element.d.ts.map +0 -1
  336. package/src/lock-unlock.ts +0 -10
  337. package/src/utils/element.ts +0 -51
  338. package/tsconfig.json +0 -13
  339. package/tsconfig.tsbuildinfo +0 -1
  340. /package/build/box/{index.js.map → index.cjs.map} +0 -0
  341. /package/build/types/{react.d.js.map → react.d.cjs.map} +0 -0
  342. /package/build/utils/{types.js.map → types.cjs.map} +0 -0
  343. /package/build-module/{box/types.js.map → badge/types.mjs.map} +0 -0
  344. /package/build-module/box/{index.js.map → index.mjs.map} +0 -0
  345. /package/build-module/{stack/types.js.map → box/types.mjs.map} +0 -0
  346. /package/build-module/{types/css-modules.d.js.map → button/types.mjs.map} +0 -0
  347. /package/build-module/{utils/types.js.map → form/primitives/field/types.mjs.map} +0 -0
  348. /package/{build/types/css-modules.d.js.map → build-module/form/primitives/fieldset/types.mjs.map} +0 -0
  349. /package/build-module/types/{react.d.js.map → react.d.mjs.map} +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ <!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.5.0-next.0 (2026-01-12)
6
+
7
+ ### Breaking Changes
8
+
9
+ - Remove numeric multiplier option for spacing tokens from `Stack` and `Box` components ([#73852](https://github.com/WordPress/gutenberg/pull/73852), [#74008](https://github.com/WordPress/gutenberg/pull/74008)).
10
+
11
+ ### New Features
12
+
13
+ - Add `Stack` component ([#73928](https://github.com/WordPress/gutenberg/pull/73928)).
14
+ - Add `VisuallyHidden` component ([#74189](https://github.com/WordPress/gutenberg/pull/74189)).
15
+ - Add `Field` primitives ([#74190](https://github.com/WordPress/gutenberg/pull/74190)).
16
+ - Add `Fieldset` primitives ([#74296](https://github.com/WordPress/gutenberg/pull/74296)).
17
+ - Add `Icon` component ([#74311](https://github.com/WordPress/gutenberg/pull/74311)).
18
+ - Add `Button` component ([#74415](https://github.com/WordPress/gutenberg/pull/74415)).
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Gutenberg
2
2
 
3
- Copyright 2016-2025 by the contributors
3
+ Copyright 2016-2026 by the contributors
4
4
 
5
5
  **License for Contributions (on and after April 15, 2021)**
6
6
 
package/README.md CHANGED
@@ -16,6 +16,24 @@ This is a companion to the `@wordpress/theme` package that provides:
16
16
  - **Design Tokens**: A comprehensive system of design tokens for colors, spacing, typography, and more
17
17
  - **Theme System**: A flexible theming provider for consistent theming across applications
18
18
 
19
+ ## Installation
20
+
21
+ Install using NPM:
22
+
23
+ ```
24
+ npm install @wordpress/ui
25
+ ```
26
+
27
+ As an implementation of the design system and companion to the `@wordpress/theme` package, these components depend on CSS custom properties defined by the theme package. This is managed on your behalf in a WordPress admin page context, but you will need to install and include the base theme stylesheet yourself if you're using the components in an application outside WordPress:
28
+
29
+ ```
30
+ npm install @wordpress/theme
31
+ ```
32
+
33
+ ```tsx
34
+ import '@wordpress/theme/design-tokens.css';
35
+ ```
36
+
19
37
  ## Usage
20
38
 
21
39
  ### Basic Component Usage
@@ -0,0 +1,95 @@
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
+
20
+ // packages/ui/src/badge/badge.tsx
21
+ var badge_exports = {};
22
+ __export(badge_exports, {
23
+ Badge: () => Badge
24
+ });
25
+ module.exports = __toCommonJS(badge_exports);
26
+ var import_element = require("@wordpress/element");
27
+ var import_box = require("../box/index.cjs");
28
+ var import_jsx_runtime = require("react/jsx-runtime");
29
+ var DEFAULT_RENDER = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ...props });
30
+ var getIntentStyles = (intent) => {
31
+ switch (intent) {
32
+ case "high":
33
+ return {
34
+ backgroundColor: "error",
35
+ color: "error"
36
+ };
37
+ case "medium":
38
+ return {
39
+ backgroundColor: "warning",
40
+ color: "warning"
41
+ };
42
+ case "low":
43
+ return {
44
+ backgroundColor: "caution",
45
+ color: "caution"
46
+ };
47
+ case "stable":
48
+ return {
49
+ backgroundColor: "success",
50
+ color: "success"
51
+ };
52
+ case "informational":
53
+ return {
54
+ backgroundColor: "info",
55
+ color: "info"
56
+ };
57
+ case "draft":
58
+ return {
59
+ backgroundColor: "neutral-weak",
60
+ color: "neutral"
61
+ };
62
+ case "none":
63
+ default:
64
+ return {
65
+ backgroundColor: "neutral",
66
+ color: "neutral-weak"
67
+ };
68
+ }
69
+ };
70
+ var Badge = (0, import_element.forwardRef)(function Badge2({ children, intent = "none", render = DEFAULT_RENDER, ...props }, ref) {
71
+ const intentStyles = getIntentStyles(intent);
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
+ import_box.Box,
74
+ {
75
+ ...intentStyles,
76
+ padding: { inline: "xs", block: "2xs" },
77
+ borderRadius: "lg",
78
+ render,
79
+ style: {
80
+ fontFamily: "var(--wpds-font-family-body)",
81
+ fontSize: "var(--wpds-font-size-sm)",
82
+ fontWeight: "var(--wpds-font-weight-regular)",
83
+ lineHeight: "var(--wpds-font-line-height-xs)",
84
+ ...props.style
85
+ },
86
+ ref,
87
+ children
88
+ }
89
+ );
90
+ });
91
+ // Annotate the CommonJS export names for ESM import in node:
92
+ 0 && (module.exports = {
93
+ Badge
94
+ });
95
+ //# sourceMappingURL=badge.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/badge/badge.tsx"],
4
+ "sourcesContent": ["import { forwardRef } from '@wordpress/element';\nimport { Box } from '../box';\nimport { type BoxProps } from '../box/types';\nimport { type BadgeProps } from './types';\n\n/**\n * Default render function that renders a span element with the given props.\n */\nconst DEFAULT_RENDER = ( props: React.ComponentPropsWithoutRef< 'span' > ) => (\n\t<span { ...props } />\n);\n\n/**\n * Maps intent values to Box backgroundColor and color props.\n * Uses strong emphasis styles (as emphasis prop has been removed).\n */\nconst getIntentStyles = (\n\tintent: BadgeProps[ 'intent' ]\n): Partial< BoxProps > => {\n\tswitch ( intent ) {\n\t\tcase 'high':\n\t\t\treturn {\n\t\t\t\tbackgroundColor: 'error',\n\t\t\t\tcolor: 'error',\n\t\t\t};\n\t\tcase 'medium':\n\t\t\treturn {\n\t\t\t\tbackgroundColor: 'warning',\n\t\t\t\tcolor: 'warning',\n\t\t\t};\n\t\tcase 'low':\n\t\t\treturn {\n\t\t\t\tbackgroundColor: 'caution',\n\t\t\t\tcolor: 'caution',\n\t\t\t};\n\t\tcase 'stable':\n\t\t\treturn {\n\t\t\t\tbackgroundColor: 'success',\n\t\t\t\tcolor: 'success',\n\t\t\t};\n\t\tcase 'informational':\n\t\t\treturn {\n\t\t\t\tbackgroundColor: 'info',\n\t\t\t\tcolor: 'info',\n\t\t\t};\n\t\tcase 'draft':\n\t\t\treturn {\n\t\t\t\tbackgroundColor: 'neutral-weak',\n\t\t\t\tcolor: 'neutral',\n\t\t\t};\n\t\tcase 'none':\n\t\tdefault:\n\t\t\treturn {\n\t\t\t\tbackgroundColor: 'neutral',\n\t\t\t\tcolor: 'neutral-weak',\n\t\t\t};\n\t}\n};\n\n/**\n * A badge component for displaying labels with semantic intent.\n * Built on the Box primitive for consistent theming and accessibility.\n */\nexport const Badge = forwardRef< HTMLDivElement, BadgeProps >( function Badge(\n\t{ children, intent = 'none', render = DEFAULT_RENDER, ...props },\n\tref\n) {\n\tconst intentStyles = getIntentStyles( intent );\n\n\treturn (\n\t\t<Box\n\t\t\t{ ...intentStyles }\n\t\t\tpadding={ { inline: 'xs', block: '2xs' } }\n\t\t\tborderRadius=\"lg\"\n\t\t\trender={ render }\n\t\t\tstyle={ {\n\t\t\t\tfontFamily: 'var(--wpds-font-family-body)',\n\t\t\t\tfontSize: 'var(--wpds-font-size-sm)',\n\t\t\t\tfontWeight: 'var(--wpds-font-weight-regular)',\n\t\t\t\tlineHeight: 'var(--wpds-font-line-height-xs)',\n\t\t\t\t...props.style,\n\t\t\t} }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ children }\n\t\t</Box>\n\t);\n} );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA2B;AAC3B,iBAAoB;AAQnB;AADD,IAAM,iBAAiB,CAAE,UACxB,4CAAC,UAAO,GAAG,OAAQ;AAOpB,IAAM,kBAAkB,CACvB,WACyB;AACzB,UAAS,QAAS;AAAA,IACjB,KAAK;AACJ,aAAO;AAAA,QACN,iBAAiB;AAAA,QACjB,OAAO;AAAA,MACR;AAAA,IACD,KAAK;AACJ,aAAO;AAAA,QACN,iBAAiB;AAAA,QACjB,OAAO;AAAA,MACR;AAAA,IACD,KAAK;AACJ,aAAO;AAAA,QACN,iBAAiB;AAAA,QACjB,OAAO;AAAA,MACR;AAAA,IACD,KAAK;AACJ,aAAO;AAAA,QACN,iBAAiB;AAAA,QACjB,OAAO;AAAA,MACR;AAAA,IACD,KAAK;AACJ,aAAO;AAAA,QACN,iBAAiB;AAAA,QACjB,OAAO;AAAA,MACR;AAAA,IACD,KAAK;AACJ,aAAO;AAAA,QACN,iBAAiB;AAAA,QACjB,OAAO;AAAA,MACR;AAAA,IACD,KAAK;AAAA,IACL;AACC,aAAO;AAAA,QACN,iBAAiB;AAAA,QACjB,OAAO;AAAA,MACR;AAAA,EACF;AACD;AAMO,IAAM,YAAQ,2BAA0C,SAASA,OACvE,EAAE,UAAU,SAAS,QAAQ,SAAS,gBAAgB,GAAG,MAAM,GAC/D,KACC;AACD,QAAM,eAAe,gBAAiB,MAAO;AAE7C,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,SAAU,EAAE,QAAQ,MAAM,OAAO,MAAM;AAAA,MACvC,cAAa;AAAA,MACb;AAAA,MACA,OAAQ;AAAA,QACP,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,GAAG,MAAM;AAAA,MACV;AAAA,MACA;AAAA,MAEE;AAAA;AAAA,EACH;AAEF,CAAE;",
6
+ "names": ["Badge"]
7
+ }
@@ -17,21 +17,15 @@ var __copyProps = (to, from, except, desc) => {
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
- // packages/ui/src/lock-unlock.ts
21
- var lock_unlock_exports = {};
22
- __export(lock_unlock_exports, {
23
- lock: () => lock,
24
- unlock: () => unlock
20
+ // packages/ui/src/badge/index.ts
21
+ var badge_exports = {};
22
+ __export(badge_exports, {
23
+ Badge: () => import_badge.Badge
25
24
  });
26
- module.exports = __toCommonJS(lock_unlock_exports);
27
- var import_private_apis = require("@wordpress/private-apis");
28
- var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
29
- "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
30
- "@wordpress/dataviews"
31
- );
25
+ module.exports = __toCommonJS(badge_exports);
26
+ var import_badge = require("./badge.cjs");
32
27
  // Annotate the CommonJS export names for ESM import in node:
33
28
  0 && (module.exports = {
34
- lock,
35
- unlock
29
+ Badge
36
30
  });
37
- //# sourceMappingURL=lock-unlock.js.map
31
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/badge/index.ts"],
4
+ "sourcesContent": ["export { Badge } from './badge';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
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 __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // packages/ui/src/badge/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/badge/types.ts"],
4
+ "sourcesContent": ["import { type ComponentProps } from '../utils/types';\n\nexport interface BadgeProps extends ComponentProps< 'span' > {\n\t/**\n\t * The text to display in the badge.\n\t */\n\tchildren: string;\n\n\t/**\n\t * The semantic intent of the badge, communicating its meaning through color.\n\t *\n\t * @default \"none\"\n\t */\n\tintent?:\n\t\t| 'high'\n\t\t| 'medium'\n\t\t| 'low'\n\t\t| 'stable'\n\t\t| 'informational'\n\t\t| 'draft'\n\t\t| 'none';\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -23,12 +23,12 @@ __export(box_exports, {
23
23
  Box: () => Box
24
24
  });
25
25
  module.exports = __toCommonJS(box_exports);
26
+ var import_react = require("@base-ui/react");
26
27
  var import_element = require("@wordpress/element");
27
- var import_element2 = require("../utils/element");
28
28
  var import_jsx_runtime = require("react/jsx-runtime");
29
29
  var DEFAULT_RENDER = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props });
30
30
  var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
31
- var getSpacingValue = (property, target, value) => typeof value === "number" ? `calc(var(--wpds-dimension-base) * ${value})` : `var(--wpds-dimension-${property}-${target}-${value}, var(--wpds-dimension-${property}-surface-${value}))`;
31
+ var getSpacingValue = (property, target, value) => `var(--wpds-dimension-${property}-${target}-${value}, var(--wpds-dimension-${property}-surface-${value}))`;
32
32
  var getDimensionVariantStyles = (property, target, value) => typeof value !== "object" ? { [property]: getSpacingValue(property, target, value) } : Object.keys(value).reduce(
33
33
  (result, key) => ({
34
34
  ...result,
@@ -51,7 +51,7 @@ var Box = (0, import_element.forwardRef)(function Box2({
51
51
  render = DEFAULT_RENDER,
52
52
  ...props
53
53
  }, ref) {
54
- const style = { ...props.style };
54
+ const style = {};
55
55
  if (backgroundColor) {
56
56
  style.backgroundColor = `var(--wpds-color-bg-${target}-${backgroundColor}, var(--wpds-color-bg-surface-${backgroundColor}))`;
57
57
  }
@@ -74,14 +74,15 @@ var Box = (0, import_element.forwardRef)(function Box2({
74
74
  if (borderColor) {
75
75
  style.borderColor = `var(--wpds-color-stroke-${target}-${borderColor}, var(--wpds-color-stroke-surface-${borderColor}))`;
76
76
  }
77
- return (0, import_element2.renderElement)({
77
+ const element = (0, import_react.useRender)({
78
78
  render,
79
79
  ref,
80
- props: { ...props, style }
80
+ props: (0, import_react.mergeProps)(props, { style })
81
81
  });
82
+ return element;
82
83
  });
83
84
  // Annotate the CommonJS export names for ESM import in node:
84
85
  0 && (module.exports = {
85
86
  Box
86
87
  });
87
- //# sourceMappingURL=box.js.map
88
+ //# sourceMappingURL=box.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/box/box.tsx"],
4
+ "sourcesContent": ["import { useRender, mergeProps } from '@base-ui/react';\nimport { forwardRef } from '@wordpress/element';\nimport { type BoxProps } from './types';\n\n/**\n * Default render function that renders a div element with the given props.\n */\nconst DEFAULT_RENDER = ( props: React.ComponentPropsWithoutRef< 'div' > ) => (\n\t<div { ...props } />\n);\n\n/**\n * Capitalizes the first character of a string.\n */\nconst capitalize = ( str: string ): string =>\n\tstr.charAt( 0 ).toUpperCase() + str.slice( 1 );\n\n/**\n * Converts a size token name to a CSS design token property reference (with\n * fallback).\n *\n * @param property The CSS property name.\n * @param target The design system token target.\n * @param value The size token name.\n * @return A CSS value string with variable references.\n */\nconst getSpacingValue = (\n\tproperty: string,\n\ttarget: string,\n\tvalue: string\n): string =>\n\t`var(--wpds-dimension-${ property }-${ target }-${ value }, var(--wpds-dimension-${ property }-surface-${ value }))`;\n\n/**\n * Generates CSS styles for properties with optionally directional values,\n * normalizing single values and objects with directional keys for logical\n * properties.\n *\n * @param property The CSS property name from BoxProps.\n * @param target The design system token target.\n * @param value The property value (single or object with directional keys).\n * @return A CSSProperties object with the computed styles.\n */\nconst getDimensionVariantStyles = < T extends keyof BoxProps >(\n\tproperty: T,\n\ttarget: string,\n\tvalue: NonNullable< BoxProps[ T ] >\n): React.CSSProperties =>\n\ttypeof value !== 'object'\n\t\t? { [ property ]: getSpacingValue( property, target, value ) }\n\t\t: Object.keys( value ).reduce(\n\t\t\t\t( result, key ) => ( {\n\t\t\t\t\t...result,\n\t\t\t\t\t[ property + capitalize( key ) ]: getSpacingValue(\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\ttarget,\n\t\t\t\t\t\tvalue[ key ]\n\t\t\t\t\t),\n\t\t\t\t} ),\n\t\t\t\t{} as Record< string, string >\n\t\t );\n\n/**\n * A low-level visual primitive that provides an interface for applying design\n * token-based customization for background, text, padding, and more.\n */\nexport const Box = forwardRef< HTMLDivElement, BoxProps >( function Box(\n\t{\n\t\ttarget = 'surface',\n\t\tbackgroundColor,\n\t\tcolor,\n\t\tpadding,\n\t\tborderRadius,\n\t\tborderWidth,\n\t\tborderColor,\n\t\trender = DEFAULT_RENDER,\n\t\t...props\n\t},\n\tref\n) {\n\tconst style: React.CSSProperties = {};\n\n\tif ( backgroundColor ) {\n\t\tstyle.backgroundColor = `var(--wpds-color-bg-${ target }-${ backgroundColor }, var(--wpds-color-bg-surface-${ backgroundColor }))`;\n\t}\n\n\tif ( color ) {\n\t\tstyle.color = `var(--wpds-color-fg-${ target }-${ color }, var(--wpds-color-fg-content-${ color }))`;\n\t}\n\n\tif ( padding ) {\n\t\tObject.assign(\n\t\t\tstyle,\n\t\t\tgetDimensionVariantStyles( 'padding', target, padding )\n\t\t);\n\t}\n\n\tif ( borderRadius ) {\n\t\tstyle.borderRadius = `var(--wpds-border-radius-${ target }-${ borderRadius }, var(--wpds-border-radius-surface-${ borderRadius }))`;\n\t}\n\n\tif ( borderWidth ) {\n\t\tstyle.borderWidth = `var(--wpds-border-width-${ target }-${ borderWidth }, var(--wpds-border-width-surface-${ borderWidth }))`;\n\t\tstyle.borderStyle = 'solid';\n\t}\n\n\tif ( borderColor ) {\n\t\tstyle.borderColor = `var(--wpds-color-stroke-${ target }-${ borderColor }, var(--wpds-color-stroke-surface-${ borderColor }))`;\n\t}\n\n\tconst element = useRender( {\n\t\trender,\n\t\tref,\n\t\tprops: mergeProps< 'div' >( props, { style } ),\n\t} );\n\n\treturn element;\n} );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsC;AACtC,qBAA2B;AAO1B;AADD,IAAM,iBAAiB,CAAE,UACxB,4CAAC,SAAM,GAAG,OAAQ;AAMnB,IAAM,aAAa,CAAE,QACpB,IAAI,OAAQ,CAAE,EAAE,YAAY,IAAI,IAAI,MAAO,CAAE;AAW9C,IAAM,kBAAkB,CACvB,UACA,QACA,UAEA,wBAAyB,QAAS,IAAK,MAAO,IAAK,KAAM,0BAA2B,QAAS,YAAa,KAAM;AAYjH,IAAM,4BAA4B,CACjC,UACA,QACA,UAEA,OAAO,UAAU,WACd,EAAE,CAAE,QAAS,GAAG,gBAAiB,UAAU,QAAQ,KAAM,EAAE,IAC3D,OAAO,KAAM,KAAM,EAAE;AAAA,EACrB,CAAE,QAAQ,SAAW;AAAA,IACpB,GAAG;AAAA,IACH,CAAE,WAAW,WAAY,GAAI,CAAE,GAAG;AAAA,MACjC;AAAA,MACA;AAAA,MACA,MAAO,GAAI;AAAA,IACZ;AAAA,EACD;AAAA,EACA,CAAC;AACD;AAMG,IAAM,UAAM,2BAAwC,SAASA,KACnE;AAAA,EACC,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,GAAG;AACJ,GACA,KACC;AACD,QAAM,QAA6B,CAAC;AAEpC,MAAK,iBAAkB;AACtB,UAAM,kBAAkB,uBAAwB,MAAO,IAAK,eAAgB,iCAAkC,eAAgB;AAAA,EAC/H;AAEA,MAAK,OAAQ;AACZ,UAAM,QAAQ,uBAAwB,MAAO,IAAK,KAAM,iCAAkC,KAAM;AAAA,EACjG;AAEA,MAAK,SAAU;AACd,WAAO;AAAA,MACN;AAAA,MACA,0BAA2B,WAAW,QAAQ,OAAQ;AAAA,IACvD;AAAA,EACD;AAEA,MAAK,cAAe;AACnB,UAAM,eAAe,4BAA6B,MAAO,IAAK,YAAa,sCAAuC,YAAa;AAAA,EAChI;AAEA,MAAK,aAAc;AAClB,UAAM,cAAc,2BAA4B,MAAO,IAAK,WAAY,qCAAsC,WAAY;AAC1H,UAAM,cAAc;AAAA,EACrB;AAEA,MAAK,aAAc;AAClB,UAAM,cAAc,2BAA4B,MAAO,IAAK,WAAY,qCAAsC,WAAY;AAAA,EAC3H;AAEA,QAAM,cAAU,wBAAW;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,WAAO,yBAAqB,OAAO,EAAE,MAAM,CAAE;AAAA,EAC9C,CAAE;AAEF,SAAO;AACR,CAAE;",
6
+ "names": ["Box"]
7
+ }
@@ -23,9 +23,9 @@ __export(box_exports, {
23
23
  Box: () => import_box.Box
24
24
  });
25
25
  module.exports = __toCommonJS(box_exports);
26
- var import_box = require("./box");
26
+ var import_box = require("./box.cjs");
27
27
  // Annotate the CommonJS export names for ESM import in node:
28
28
  0 && (module.exports = {
29
29
  Box
30
30
  });
31
- //# sourceMappingURL=index.js.map
31
+ //# sourceMappingURL=index.cjs.map
@@ -16,4 +16,4 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
16
16
  // packages/ui/src/box/types.ts
17
17
  var types_exports = {};
18
18
  module.exports = __toCommonJS(types_exports);
19
- //# sourceMappingURL=types.js.map
19
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/box/types.ts"],
4
+ "sourcesContent": ["import {\n\ttype PaddingSize,\n\ttype BorderRadiusSize,\n\ttype BorderWidthSize,\n\ttype Target,\n\ttype SurfaceBackgroundColor,\n\ttype ContentForegroundColor,\n\ttype SurfaceStrokeColor,\n} from '@wordpress/theme';\nimport { type ComponentProps } from '../utils/types';\n\ntype DimensionVariant< T > = {\n\tblock?: T;\n\tblockStart?: T;\n\tblockEnd?: T;\n\tinline?: T;\n\tinlineStart?: T;\n\tinlineEnd?: T;\n};\n\nexport interface BoxProps extends ComponentProps< 'div' > {\n\t/**\n\t * The target rendering element design token grouping to use for the box.\n\t */\n\ttarget?: Target;\n\n\t/**\n\t * The surface background design token for box background color.\n\t */\n\tbackgroundColor?: SurfaceBackgroundColor;\n\n\t/**\n\t * The surface foreground design token for box text color.\n\t */\n\tcolor?: ContentForegroundColor;\n\n\t/**\n\t * The surface spacing design token or base unit multiplier for box padding.\n\t */\n\tpadding?: PaddingSize | DimensionVariant< PaddingSize >;\n\n\t/**\n\t * The surface border radius design token.\n\t */\n\tborderRadius?: BorderRadiusSize;\n\n\t/**\n\t * The surface border width design token.\n\t */\n\tborderWidth?: BorderWidthSize;\n\n\t/**\n\t * The surface border stroke color design token.\n\t */\n\tborderColor?: SurfaceStrokeColor;\n\n\t/**\n\t * The content to be rendered inside the component.\n\t */\n\tchildren?: React.ReactNode;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }