@wordpress/ui 0.4.0 → 0.4.1-next.76cff8c98.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 (227) hide show
  1. package/CHANGELOG.md +15 -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/{index.js → badge/index.cjs} +13 -7
  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/{utils/element.js → form/primitives/field/control.cjs} +13 -20
  16. package/build/form/primitives/field/control.cjs.map +7 -0
  17. package/build/form/primitives/field/description.cjs +92 -0
  18. package/build/form/primitives/field/description.cjs.map +7 -0
  19. package/build/form/primitives/field/details.cjs +99 -0
  20. package/build/form/primitives/field/details.cjs.map +7 -0
  21. package/build/form/primitives/field/index.cjs +46 -0
  22. package/build/form/primitives/field/index.cjs.map +7 -0
  23. package/build/{lock-unlock.js → form/primitives/field/item.cjs} +13 -14
  24. package/build/form/primitives/field/item.cjs.map +7 -0
  25. package/build/form/primitives/field/label.cjs +98 -0
  26. package/build/form/primitives/field/label.cjs.map +7 -0
  27. package/build/form/primitives/field/root.cjs +79 -0
  28. package/build/form/primitives/field/root.cjs.map +7 -0
  29. package/build/form/primitives/field/types.cjs +19 -0
  30. package/build/form/primitives/field/types.cjs.map +7 -0
  31. package/build/form/primitives/index.cjs +41 -0
  32. package/build/form/primitives/index.cjs.map +7 -0
  33. package/build/index.cjs +33 -0
  34. package/build/index.cjs.map +7 -0
  35. package/build/stack/{index.js → index.cjs} +2 -2
  36. package/build/stack/index.cjs.map +7 -0
  37. package/build/stack/{stack.js → stack.cjs} +6 -18
  38. package/build/stack/stack.cjs.map +7 -0
  39. package/build/stack/{types.js → types.cjs} +1 -1
  40. package/build/stack/types.cjs.map +7 -0
  41. package/build/types/css-modules.d.cjs +2 -0
  42. package/build/types/css-modules.d.cjs.map +7 -0
  43. package/build/types/{react.d.js → react.d.cjs} +1 -1
  44. package/build/utils/{types.js → types.cjs} +1 -1
  45. package/build/visually-hidden/index.cjs +31 -0
  46. package/build/visually-hidden/index.cjs.map +7 -0
  47. package/build/visually-hidden/types.cjs +19 -0
  48. package/build/visually-hidden/types.cjs.map +7 -0
  49. package/build/visually-hidden/visually-hidden.cjs +69 -0
  50. package/build/visually-hidden/visually-hidden.cjs.map +7 -0
  51. package/build-module/badge/badge.mjs +70 -0
  52. package/build-module/badge/badge.mjs.map +7 -0
  53. package/build-module/badge/index.mjs +6 -0
  54. package/build-module/badge/index.mjs.map +7 -0
  55. package/build-module/badge/types.mjs +1 -0
  56. package/build-module/box/{box.js → box.mjs} +7 -6
  57. package/build-module/box/box.mjs.map +7 -0
  58. package/build-module/box/index.mjs +6 -0
  59. package/build-module/box/types.mjs +1 -0
  60. package/build-module/form/primitives/field/control.mjs +13 -0
  61. package/build-module/form/primitives/field/control.mjs.map +7 -0
  62. package/build-module/form/primitives/field/description.mjs +57 -0
  63. package/build-module/form/primitives/field/description.mjs.map +7 -0
  64. package/build-module/form/primitives/field/details.mjs +64 -0
  65. package/build-module/form/primitives/field/details.mjs.map +7 -0
  66. package/build-module/form/primitives/field/index.mjs +16 -0
  67. package/build-module/form/primitives/field/index.mjs.map +7 -0
  68. package/build-module/form/primitives/field/item.mjs +11 -0
  69. package/build-module/form/primitives/field/item.mjs.map +7 -0
  70. package/build-module/form/primitives/field/label.mjs +63 -0
  71. package/build-module/form/primitives/field/label.mjs.map +7 -0
  72. package/build-module/form/primitives/field/root.mjs +44 -0
  73. package/build-module/form/primitives/field/root.mjs.map +7 -0
  74. package/build-module/form/primitives/field/types.mjs +1 -0
  75. package/build-module/form/primitives/index.mjs +6 -0
  76. package/build-module/form/primitives/index.mjs.map +7 -0
  77. package/build-module/index.mjs +7 -0
  78. package/build-module/index.mjs.map +7 -0
  79. package/build-module/stack/index.mjs +6 -0
  80. package/build-module/stack/index.mjs.map +7 -0
  81. package/build-module/stack/{stack.js → stack.mjs} +6 -8
  82. package/build-module/stack/stack.mjs.map +7 -0
  83. package/build-module/stack/types.mjs +1 -0
  84. package/build-module/types/css-modules.d.mjs +1 -0
  85. package/build-module/types/{react.d.js → react.d.mjs} +1 -1
  86. package/build-module/utils/types.mjs +1 -0
  87. package/build-module/utils/types.mjs.map +7 -0
  88. package/build-module/visually-hidden/index.mjs +6 -0
  89. package/build-module/visually-hidden/index.mjs.map +7 -0
  90. package/build-module/visually-hidden/types.mjs +1 -0
  91. package/build-module/visually-hidden/types.mjs.map +7 -0
  92. package/build-module/visually-hidden/visually-hidden.mjs +44 -0
  93. package/build-module/visually-hidden/visually-hidden.mjs.map +7 -0
  94. package/build-types/badge/badge.d.ts +7 -0
  95. package/build-types/badge/badge.d.ts.map +1 -0
  96. package/build-types/badge/index.d.ts +2 -0
  97. package/build-types/badge/index.d.ts.map +1 -0
  98. package/build-types/badge/stories/index.story.d.ts +21 -0
  99. package/build-types/badge/stories/index.story.d.ts.map +1 -0
  100. package/build-types/badge/types.d.ts +17 -0
  101. package/build-types/badge/types.d.ts.map +1 -0
  102. package/build-types/box/box.d.ts +0 -3
  103. package/build-types/box/box.d.ts.map +1 -1
  104. package/build-types/box/stories/index.story.d.ts +1 -11
  105. package/build-types/box/stories/index.story.d.ts.map +1 -1
  106. package/build-types/box/types.d.ts +8 -15
  107. package/build-types/box/types.d.ts.map +1 -1
  108. package/build-types/form/primitives/field/control.d.ts +6 -0
  109. package/build-types/form/primitives/field/control.d.ts.map +1 -0
  110. package/build-types/form/primitives/field/description.d.ts +9 -0
  111. package/build-types/form/primitives/field/description.d.ts.map +1 -0
  112. package/build-types/form/primitives/field/details.d.ts +21 -0
  113. package/build-types/form/primitives/field/details.d.ts.map +1 -0
  114. package/build-types/form/primitives/field/index.d.ts +8 -0
  115. package/build-types/form/primitives/field/index.d.ts.map +1 -0
  116. package/build-types/form/primitives/field/item.d.ts +3 -0
  117. package/build-types/form/primitives/field/item.d.ts.map +1 -0
  118. package/build-types/form/primitives/field/label.d.ts +11 -0
  119. package/build-types/form/primitives/field/label.d.ts.map +1 -0
  120. package/build-types/form/primitives/field/root.d.ts +13 -0
  121. package/build-types/form/primitives/field/root.d.ts.map +1 -0
  122. package/build-types/form/primitives/field/stories/index.story.d.ts +39 -0
  123. package/build-types/form/primitives/field/stories/index.story.d.ts.map +1 -0
  124. package/build-types/form/primitives/field/test/index.test.d.ts +2 -0
  125. package/build-types/form/primitives/field/test/index.test.d.ts.map +1 -0
  126. package/build-types/form/primitives/field/types.d.ts +62 -0
  127. package/build-types/form/primitives/field/types.d.ts.map +1 -0
  128. package/build-types/form/primitives/index.d.ts +2 -0
  129. package/build-types/form/primitives/index.d.ts.map +1 -0
  130. package/build-types/index.d.ts +4 -0
  131. package/build-types/index.d.ts.map +1 -1
  132. package/build-types/stack/index.d.ts +0 -3
  133. package/build-types/stack/index.d.ts.map +1 -1
  134. package/build-types/stack/stack.d.ts.map +1 -1
  135. package/build-types/stack/stories/index.story.d.ts +1 -11
  136. package/build-types/stack/stories/index.story.d.ts.map +1 -1
  137. package/build-types/stack/types.d.ts +2 -5
  138. package/build-types/stack/types.d.ts.map +1 -1
  139. package/build-types/test/index.test.d.ts +2 -0
  140. package/build-types/test/index.test.d.ts.map +1 -0
  141. package/build-types/visually-hidden/index.d.ts +2 -0
  142. package/build-types/visually-hidden/index.d.ts.map +1 -0
  143. package/build-types/visually-hidden/stories/index.story.d.ts +7 -0
  144. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -0
  145. package/build-types/visually-hidden/test/visually-hidden.test.d.ts +2 -0
  146. package/build-types/visually-hidden/test/visually-hidden.test.d.ts.map +1 -0
  147. package/build-types/visually-hidden/types.d.ts +8 -0
  148. package/build-types/visually-hidden/types.d.ts.map +1 -0
  149. package/build-types/visually-hidden/visually-hidden.d.ts +7 -0
  150. package/build-types/visually-hidden/visually-hidden.d.ts.map +1 -0
  151. package/package.json +17 -9
  152. package/src/badge/badge.tsx +95 -0
  153. package/src/badge/index.ts +1 -0
  154. package/src/badge/stories/choosing-intent.mdx +112 -0
  155. package/src/badge/stories/index.story.tsx +133 -0
  156. package/src/badge/types.ts +25 -0
  157. package/src/box/box.tsx +11 -23
  158. package/src/box/stories/index.story.tsx +3 -14
  159. package/src/box/types.ts +16 -59
  160. package/src/form/primitives/field/control.tsx +9 -0
  161. package/src/form/primitives/field/description.tsx +18 -0
  162. package/src/form/primitives/field/details.tsx +36 -0
  163. package/src/form/primitives/field/index.ts +8 -0
  164. package/src/form/primitives/field/item.tsx +9 -0
  165. package/src/form/primitives/field/label.tsx +21 -0
  166. package/src/form/primitives/field/root.tsx +31 -0
  167. package/src/form/primitives/field/stories/index.story.tsx +132 -0
  168. package/src/form/primitives/field/test/index.test.tsx +36 -0
  169. package/src/form/primitives/field/types.ts +82 -0
  170. package/src/form/primitives/index.ts +1 -0
  171. package/src/index.ts +4 -0
  172. package/src/stack/index.ts +0 -3
  173. package/src/stack/stack.tsx +5 -18
  174. package/src/stack/stories/index.story.tsx +1 -13
  175. package/src/stack/test/stack.test.tsx +22 -12
  176. package/src/stack/types.ts +2 -6
  177. package/src/test/index.test.ts +22 -0
  178. package/src/utils/css/field.module.css +27 -0
  179. package/src/utils/css/resets.module.css +13 -0
  180. package/src/visually-hidden/index.ts +1 -0
  181. package/src/visually-hidden/stories/index.story.tsx +22 -0
  182. package/src/visually-hidden/style.module.css +15 -0
  183. package/src/visually-hidden/test/visually-hidden.test.tsx +59 -0
  184. package/src/visually-hidden/types.ts +8 -0
  185. package/src/visually-hidden/visually-hidden.tsx +23 -0
  186. package/build/box/box.js.map +0 -7
  187. package/build/box/types.js.map +0 -7
  188. package/build/index.js.map +0 -7
  189. package/build/lock-unlock.js.map +0 -7
  190. package/build/stack/index.js.map +0 -7
  191. package/build/stack/stack.js.map +0 -7
  192. package/build/stack/types.js.map +0 -7
  193. package/build/types/css-modules.d.js +0 -2
  194. package/build/utils/element.js.map +0 -7
  195. package/build-module/box/box.js.map +0 -7
  196. package/build-module/box/index.js +0 -6
  197. package/build-module/box/types.js +0 -1
  198. package/build-module/index.js +0 -3
  199. package/build-module/index.js.map +0 -7
  200. package/build-module/lock-unlock.js +0 -11
  201. package/build-module/lock-unlock.js.map +0 -7
  202. package/build-module/stack/index.js +0 -6
  203. package/build-module/stack/index.js.map +0 -7
  204. package/build-module/stack/stack.js.map +0 -7
  205. package/build-module/stack/types.js +0 -1
  206. package/build-module/types/css-modules.d.js +0 -1
  207. package/build-module/utils/element.js +0 -20
  208. package/build-module/utils/element.js.map +0 -7
  209. package/build-module/utils/types.js +0 -1
  210. package/build-types/lock-unlock.d.ts +0 -2
  211. package/build-types/lock-unlock.d.ts.map +0 -1
  212. package/build-types/utils/element.d.ts +0 -25
  213. package/build-types/utils/element.d.ts.map +0 -1
  214. package/src/lock-unlock.ts +0 -10
  215. package/src/utils/element.ts +0 -51
  216. package/tsconfig.json +0 -13
  217. package/tsconfig.tsbuildinfo +0 -1
  218. /package/build/box/{index.js.map → index.cjs.map} +0 -0
  219. /package/build/types/{react.d.js.map → react.d.cjs.map} +0 -0
  220. /package/build/utils/{types.js.map → types.cjs.map} +0 -0
  221. /package/build-module/{box/types.js.map → badge/types.mjs.map} +0 -0
  222. /package/build-module/box/{index.js.map → index.mjs.map} +0 -0
  223. /package/build-module/{stack/types.js.map → box/types.mjs.map} +0 -0
  224. /package/build-module/{types/css-modules.d.js.map → form/primitives/field/types.mjs.map} +0 -0
  225. /package/build-module/{utils/types.js.map → stack/types.mjs.map} +0 -0
  226. /package/{build/types/css-modules.d.js.map → build-module/types/css-modules.d.mjs.map} +0 -0
  227. /package/build-module/types/{react.d.js.map → react.d.mjs.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["export * from './badge';\nexport * from './box';\nexport * from './form/primitives';\nexport * from './stack';\nexport * from './visually-hidden';\n"],
5
+ "mappings": ";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ // packages/ui/src/stack/index.ts
2
+ import { Stack } from "./stack.mjs";
3
+ export {
4
+ Stack
5
+ };
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/stack/index.ts"],
4
+ "sourcesContent": ["export { Stack } from './stack';\n"],
5
+ "mappings": ";AAAA,SAAS,aAAa;",
6
+ "names": []
7
+ }
@@ -1,7 +1,6 @@
1
1
  // packages/ui/src/stack/stack.tsx
2
- import clsx from "clsx";
2
+ import { useRender, mergeProps } from "@base-ui/react";
3
3
  import { forwardRef } from "@wordpress/element";
4
- import { renderElement } from "../utils/element";
5
4
 
6
5
  // packages/ui/src/stack/style.module.css
7
6
  var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
@@ -19,22 +18,21 @@ var style_default = {
19
18
 
20
19
  // packages/ui/src/stack/stack.tsx
21
20
  var Stack = forwardRef(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
22
- const className = clsx(props.className, style_default.stack);
23
21
  const style = {
24
22
  gap: gap && `var(--wpds-dimension-gap-${gap})`,
25
23
  alignItems: align,
26
24
  justifyContent: justify,
27
25
  flexDirection: direction,
28
- flexWrap: wrap,
29
- ...props.style
26
+ flexWrap: wrap
30
27
  };
31
- return renderElement({
28
+ const element = useRender({
32
29
  render,
33
30
  ref,
34
- props: { ...props, style, className }
31
+ props: mergeProps(props, { style, className: style_default.stack })
35
32
  });
33
+ return element;
36
34
  });
37
35
  export {
38
36
  Stack
39
37
  };
40
- //# sourceMappingURL=stack.js.map
38
+ //# sourceMappingURL=stack.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/stack/stack.tsx", "../../src/stack/style.module.css"],
4
+ "sourcesContent": ["import { useRender, mergeProps } from '@base-ui/react';\nimport { forwardRef } from '@wordpress/element';\nimport { type StackProps } from './types';\nimport styles from './style.module.css';\n\n/**\n * A flexible layout component using CSS Flexbox for consistent spacing and alignment.\n * Built on design tokens for predictable spacing values.\n */\nexport const Stack = forwardRef< HTMLDivElement, StackProps >( function Stack(\n\t{ direction, gap, align, justify, wrap, render, ...props },\n\tref\n) {\n\tconst style: React.CSSProperties = {\n\t\tgap: gap && `var(--wpds-dimension-gap-${ gap })`,\n\t\talignItems: align,\n\t\tjustifyContent: justify,\n\t\tflexDirection: direction,\n\t\tflexWrap: wrap,\n\t};\n\n\tconst element = useRender( {\n\t\trender,\n\t\tref,\n\t\tprops: mergeProps< 'div' >( props, { style, className: styles.stack } ),\n\t} );\n\n\treturn element;\n} );\n", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-components {\n\t.style-module__stack__Gc4EG {\n\t\tdisplay: flex;\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"stack\": \"style-module__stack__Gc4EG\"\n};"],
5
+ "mappings": ";AAAA,SAAS,WAAW,kBAAkB;AACtC,SAAS,kBAAkB;;;ACD3B,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,gBAAQ;AAAA,EACb,SAAS;AACX;;;ADLO,IAAM,QAAQ,WAA0C,SAASA,OACvE,EAAE,WAAW,KAAK,OAAO,SAAS,MAAM,QAAQ,GAAG,MAAM,GACzD,KACC;AACD,QAAM,QAA6B;AAAA,IAClC,KAAK,OAAO,4BAA6B,GAAI;AAAA,IAC7C,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,UAAU;AAAA,EACX;AAEA,QAAM,UAAU,UAAW;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,OAAO,WAAqB,OAAO,EAAE,OAAO,WAAW,cAAO,MAAM,CAAE;AAAA,EACvE,CAAE;AAEF,SAAO;AACR,CAAE;",
6
+ "names": ["Stack"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=css-modules.d.mjs.map
@@ -1,3 +1,3 @@
1
1
  // packages/ui/src/types/react.d.ts
2
2
  import "react";
3
- //# sourceMappingURL=react.d.js.map
3
+ //# sourceMappingURL=react.d.mjs.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ // packages/ui/src/visually-hidden/index.ts
2
+ import { VisuallyHidden } from "./visually-hidden.mjs";
3
+ export {
4
+ VisuallyHidden
5
+ };
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/visually-hidden/index.ts"],
4
+ "sourcesContent": ["export { VisuallyHidden } from './visually-hidden';\n"],
5
+ "mappings": ";AAAA,SAAS,sBAAsB;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,44 @@
1
+ // packages/ui/src/visually-hidden/visually-hidden.tsx
2
+ import { mergeProps, useRender } from "@base-ui/react";
3
+ import { forwardRef } from "@wordpress/element";
4
+
5
+ // packages/ui/src/visually-hidden/style.module.css
6
+ var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
7
+
8
+ @layer wp-ui-components {
9
+ .style-module__visually-hidden__83ueL {
10
+ border: 0;
11
+ clip-path: inset(50%);
12
+ height: 1px;
13
+ margin: -1px;
14
+ overflow: hidden;
15
+ padding: 0;
16
+ position: absolute;
17
+ width: 1px;
18
+ word-wrap: normal;
19
+ }
20
+ }
21
+ `;
22
+ document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
23
+ var style_default = {
24
+ "visually-hidden": "style-module__visually-hidden__83ueL"
25
+ };
26
+
27
+ // packages/ui/src/visually-hidden/visually-hidden.tsx
28
+ var VisuallyHidden = forwardRef(
29
+ function VisuallyHidden2({ render, ...restProps }, ref) {
30
+ const element = useRender({
31
+ render,
32
+ ref,
33
+ props: mergeProps(
34
+ { className: style_default["visually-hidden"] },
35
+ restProps
36
+ )
37
+ });
38
+ return element;
39
+ }
40
+ );
41
+ export {
42
+ VisuallyHidden
43
+ };
44
+ //# sourceMappingURL=visually-hidden.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/visually-hidden/visually-hidden.tsx", "../../src/visually-hidden/style.module.css"],
4
+ "sourcesContent": ["import { mergeProps, useRender } from '@base-ui/react';\nimport { forwardRef } from '@wordpress/element';\nimport type { VisuallyHiddenProps } from './types';\nimport styles from './style.module.css';\n\n/**\n * Visually hides content while keeping it accessible to screen readers.\n * Useful when providing context that's only meaningful to assistive technology.\n */\nexport const VisuallyHidden = forwardRef< HTMLDivElement, VisuallyHiddenProps >(\n\tfunction VisuallyHidden( { render, ...restProps }, ref ) {\n\t\tconst element = useRender( {\n\t\t\trender,\n\t\t\tref,\n\t\t\tprops: mergeProps< 'div' >(\n\t\t\t\t{ className: styles[ 'visually-hidden' ] },\n\t\t\t\trestProps\n\t\t\t),\n\t\t} );\n\n\t\treturn element;\n\t}\n);\n", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-components {\n\t.style-module__visually-hidden__83ueL {\n\t\tborder: 0;\n\t\tclip-path: inset(50%);\n\t\theight: 1px;\n\t\tmargin: -1px;\n\t\toverflow: hidden;\n\t\tpadding: 0;\n\t\tposition: absolute;\n\t\twidth: 1px;\n\t\tword-wrap: normal;\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"visually-hidden\": \"style-module__visually-hidden__83ueL\"\n};"],
5
+ "mappings": ";AAAA,SAAS,YAAY,iBAAiB;AACtC,SAAS,kBAAkB;;;ACD3B,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,gBAAQ;AAAA,EACb,mBAAmB;AACrB;;;ADbO,IAAM,iBAAiB;AAAA,EAC7B,SAASA,gBAAgB,EAAE,QAAQ,GAAG,UAAU,GAAG,KAAM;AACxD,UAAM,UAAU,UAAW;AAAA,MAC1B;AAAA,MACA;AAAA,MACA,OAAO;AAAA,QACN,EAAE,WAAW,cAAQ,iBAAkB,EAAE;AAAA,QACzC;AAAA,MACD;AAAA,IACD,CAAE;AAEF,WAAO;AAAA,EACR;AACD;",
6
+ "names": ["VisuallyHidden"]
7
+ }
@@ -0,0 +1,7 @@
1
+ import { type BadgeProps } from './types';
2
+ /**
3
+ * A badge component for displaying labels with semantic intent.
4
+ * Built on the Box primitive for consistent theming and accessibility.
5
+ */
6
+ export declare const Badge: import("react").ForwardRefExoticComponent<BadgeProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ //# sourceMappingURL=badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/badge/badge.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAwD1C;;;GAGG;AACH,eAAO,MAAM,KAAK,uGAwBf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Badge } from './badge';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import { Badge } from '../index';
9
+ declare const meta: Meta<typeof Badge>;
10
+ export default meta;
11
+ type Story = StoryObj<typeof Badge>;
12
+ export declare const Default: Story;
13
+ export declare const High: Story;
14
+ export declare const Medium: Story;
15
+ export declare const Low: Story;
16
+ export declare const Stable: Story;
17
+ export declare const Informational: Story;
18
+ export declare const Draft: Story;
19
+ export declare const None: Story;
20
+ export declare const AllIntents: Story;
21
+ //# sourceMappingURL=index.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/badge/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAOhE;;GAEG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,KAAK,CAI7B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,KAAK,CAAE,CAAC;AAEtC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,KAMjB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KA8CxB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { type ComponentProps } from '../utils/types';
5
+ export interface BadgeProps extends ComponentProps<'span'> {
6
+ /**
7
+ * The text to display in the badge.
8
+ */
9
+ children: string;
10
+ /**
11
+ * The semantic intent of the badge, communicating its meaning through color.
12
+ *
13
+ * @default "none"
14
+ */
15
+ intent?: 'high' | 'medium' | 'low' | 'stable' | 'informational' | 'draft' | 'none';
16
+ }
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/badge/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAE,MAAM,CAAE;IAC3D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,MAAM,CAAC,EACJ,MAAM,GACN,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,eAAe,GACf,OAAO,GACP,MAAM,CAAC;CACV"}
@@ -1,6 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  import { type BoxProps } from './types';
5
2
  /**
6
3
  * A low-level visual primitive that provides an interface for applying design
@@ -1 +1 @@
1
- {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../src/box/box.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAoExC;;;GAGG;AACH,eAAO,MAAM,GAAG,qGAiDb,CAAC"}
1
+ {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../src/box/box.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AA4DxC;;;GAGG;AACH,eAAO,MAAM,GAAG,qGAmDb,CAAC"}
@@ -1,14 +1,4 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { type Meta, type StoryObj } from '@storybook/react';
5
- /**
6
- * WordPress dependencies
7
- */
8
- import '@wordpress/theme/design-tokens.css';
9
- /**
10
- * Internal dependencies
11
- */
1
+ import { type Meta, type StoryObj } from '@storybook/react-webpack5';
12
2
  import { Box } from '../box';
13
3
  declare const meta: Meta<typeof Box>;
14
4
  export default meta;
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/box/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;GAEG;AACH,OAAO,oCAAoC,CAAC;AAE5C;;GAEG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,GAAG,CAI3B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,GAAG,CAAE,CAAC;AAEpC,eAAO,MAAM,OAAO,EAAE,KAgBrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAUhC,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/box/stories/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,GAAG,CAI3B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,GAAG,CAAE,CAAC;AAEpC,eAAO,MAAM,OAAO,EAAE,KAgBrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAUhC,CAAC"}
@@ -1,12 +1,5 @@
1
- /**
2
- * Internal dependencies
3
- */
1
+ import { type PaddingSize, type BorderRadiusSize, type BorderWidthSize, type Target, type SurfaceBackgroundColor, type ContentForegroundColor, type SurfaceStrokeColor } from '@wordpress/theme';
4
2
  import { type ComponentProps } from '../utils/types';
5
- type SizeToken = '2xs' | 'xs' | 'sm' | 'md' | 'lg';
6
- type Size = number | SizeToken;
7
- type BackgroundColor = 'neutral' | 'neutral-strong' | 'neutral-weak' | 'brand' | 'success' | 'success-weak' | 'info' | 'info-weak' | 'warning' | 'warning-weak' | 'caution' | 'caution-weak' | 'error' | 'error-weak';
8
- type ForegroundColor = 'neutral' | 'neutral-weak' | 'success' | 'success-weak' | 'info' | 'info-weak' | 'warning' | 'warning-weak' | 'caution' | 'caution-weak' | 'error' | 'error-weak';
9
- type StrokeColor = 'brand' | 'brand-strong' | 'error' | 'error-strong' | 'info' | 'info-strong' | 'neutral' | 'neutral-strong' | 'neutral-weak' | 'success' | 'success-strong' | 'warning' | 'warning-strong';
10
3
  type DimensionVariant<T> = {
11
4
  block?: T;
12
5
  blockStart?: T;
@@ -19,31 +12,31 @@ export interface BoxProps extends ComponentProps<'div'> {
19
12
  /**
20
13
  * The target rendering element design token grouping to use for the box.
21
14
  */
22
- target?: string;
15
+ target?: Target;
23
16
  /**
24
17
  * The surface background design token for box background color.
25
18
  */
26
- backgroundColor?: BackgroundColor;
19
+ backgroundColor?: SurfaceBackgroundColor;
27
20
  /**
28
21
  * The surface foreground design token for box text color.
29
22
  */
30
- color?: ForegroundColor;
23
+ color?: ContentForegroundColor;
31
24
  /**
32
25
  * The surface spacing design token or base unit multiplier for box padding.
33
26
  */
34
- padding?: Size | DimensionVariant<Size>;
27
+ padding?: PaddingSize | DimensionVariant<PaddingSize>;
35
28
  /**
36
29
  * The surface border radius design token.
37
30
  */
38
- borderRadius?: Exclude<SizeToken, '2xs'>;
31
+ borderRadius?: BorderRadiusSize;
39
32
  /**
40
33
  * The surface border width design token.
41
34
  */
42
- borderWidth?: Exclude<SizeToken, '2xs'>;
35
+ borderWidth?: BorderWidthSize;
43
36
  /**
44
37
  * The surface border stroke color design token.
45
38
  */
46
- borderColor?: StrokeColor;
39
+ borderColor?: SurfaceStrokeColor;
47
40
  /**
48
41
  * The content to be rendered inside the component.
49
42
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/box/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,KAAK,SAAS,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,KAAK,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;AAE/B,KAAK,eAAe,GACjB,SAAS,GACT,gBAAgB,GAChB,cAAc,GACd,OAAO,GACP,SAAS,GACT,cAAc,GACd,MAAM,GACN,WAAW,GACX,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,OAAO,GACP,YAAY,CAAC;AAEhB,KAAK,eAAe,GACjB,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,MAAM,GACN,WAAW,GACX,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,OAAO,GACP,YAAY,CAAC;AAEhB,KAAK,WAAW,GACb,OAAO,GACP,cAAc,GACd,OAAO,GACP,cAAc,GACd,MAAM,GACN,aAAa,GACb,SAAS,GACT,gBAAgB,GAChB,cAAc,GACd,SAAS,GACT,gBAAgB,GAChB,SAAS,GACT,gBAAgB,CAAC;AAEpB,KAAK,gBAAgB,CAAE,CAAC,IAAK;IAC5B,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,UAAU,CAAC,EAAE,CAAC,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB,SAAS,CAAC,EAAE,CAAC,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,QAAS,SAAQ,cAAc,CAAE,KAAK,CAAE;IACxD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;;OAEG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,gBAAgB,CAAE,IAAI,CAAE,CAAC;IAE1C;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAE,SAAS,EAAE,KAAK,CAAE,CAAC;IAE3C;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAE,SAAS,EAAE,KAAK,CAAE,CAAC;IAE1C;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/box/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,KAAK,gBAAgB,CAAE,CAAC,IAAK;IAC5B,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,UAAU,CAAC,EAAE,CAAC,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB,SAAS,CAAC,EAAE,CAAC,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,QAAS,SAAQ,cAAc,CAAE,KAAK,CAAE;IACxD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,eAAe,CAAC,EAAE,sBAAsB,CAAC;IAEzC;;OAEG;IACH,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAE/B;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,gBAAgB,CAAE,WAAW,CAAE,CAAC;IAExD;;OAEG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAEhC;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAE9B;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B"}
@@ -0,0 +1,6 @@
1
+ import { Field as _Field } from '@base-ui/react/field';
2
+ export declare const Control: import("react").ForwardRefExoticComponent<Omit<import("../../../utils/types").ComponentProps<import("react").ForwardRefExoticComponent<import("@base-ui/react/field").FieldControlProps & import("react").RefAttributes<HTMLInputElement>>>, "defaultValue"> & {
3
+ children?: _Field.Control.Props["children"];
4
+ defaultValue?: _Field.Control.Props["defaultValue"];
5
+ } & import("react").RefAttributes<HTMLInputElement>>;
6
+ //# sourceMappingURL=control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../../../src/form/primitives/field/control.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAIvD,eAAO,MAAM,OAAO;;;oDAInB,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const Description: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/field").FieldDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref">, "className" | "children" | "render"> & {
2
+ className?: string;
3
+ render?: ((props: import("react").HTMLAttributes<any> & {
4
+ ref?: import("react").Ref<any> | undefined;
5
+ }) => React.ReactElement<unknown>) | React.ReactElement<Record<string, unknown>>;
6
+ } & {
7
+ children?: string;
8
+ } & import("react").RefAttributes<HTMLParagraphElement>>;
9
+ //# sourceMappingURL=description.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"description.d.ts","sourceRoot":"","sources":["../../../../src/form/primitives/field/description.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW;;;;;;;wDAWrB,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A component for showing additional information about the field,
3
+ * styled similarly to a normal `Field.Description`.
4
+ * Unlike a normal description, it can include links and other semantic elements.
5
+ *
6
+ * Although this content is not associated with the field using direct semantics,
7
+ * it is made discoverable to screen reader users via a visually hidden description,
8
+ * alerting them to the presence of additional information below.
9
+ *
10
+ * If the content only includes plain text, use `Field.Description` instead,
11
+ * so the readout is not unnecessarily verbose for screen reader users.
12
+ */
13
+ export declare const Details: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className" | "children" | "render"> & {
14
+ className?: string;
15
+ render?: ((props: import("react").HTMLAttributes<any> & {
16
+ ref?: import("react").Ref<any> | undefined;
17
+ }) => React.ReactElement<unknown>) | React.ReactElement<Record<string, unknown>>;
18
+ } & {
19
+ children?: React.ReactNode;
20
+ } & import("react").RefAttributes<HTMLDivElement>>;
21
+ //# sourceMappingURL=details.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"details.d.ts","sourceRoot":"","sources":["../../../../src/form/primitives/field/details.tsx"],"names":[],"mappings":"AAQA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO;;;;;;;kDAenB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Root } from './root';
2
+ import { Item } from './item';
3
+ import { Label } from './label';
4
+ import { Description } from './description';
5
+ import { Details } from './details';
6
+ import { Control } from './control';
7
+ export { Root, Item, Label, Description, Details, Control };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/form/primitives/field/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { FieldItemProps } from './types';
2
+ export declare const Item: React.ForwardRefExoticComponent<FieldItemProps & React.RefAttributes<HTMLDivElement>>;
3
+ //# sourceMappingURL=item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/form/primitives/field/item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,yBAAyB,CACjD,cAAc,GAAG,KAAK,CAAC,aAAa,CAAE,cAAc,CAAE,CAGpD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Field as _Field } from '@base-ui/react/field';
2
+ export declare const Label: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react/field").FieldLabelProps & import("react").RefAttributes<any>, "ref">, "className" | "children" | "render"> & {
3
+ className?: string;
4
+ render?: ((props: import("react").HTMLAttributes<any> & {
5
+ ref?: import("react").Ref<any> | undefined;
6
+ }) => React.ReactElement<unknown>) | React.ReactElement<Record<string, unknown>>;
7
+ } & {
8
+ children?: _Field.Label.Props["children"];
9
+ variant?: "default" | "plain";
10
+ } & import("react").RefAttributes<HTMLLabelElement>>;
11
+ //# sourceMappingURL=label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../../src/form/primitives/field/label.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAKvD,eAAO,MAAM,KAAK;;;;;;;;oDAcjB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Field as _Field } from '@base-ui/react/field';
2
+ /**
3
+ * A low-level component that associates an accessible label and description
4
+ * with a single form control element.
5
+ *
6
+ * Simply wrapping a control with this component does not guarantee
7
+ * accessible labeling. See examples for how to associate the label in different cases.
8
+ */
9
+ export declare const Root: import("react").ForwardRefExoticComponent<Omit<import("../../../utils/types").ComponentProps<import("react").ForwardRefExoticComponent<import("@base-ui/react/field").FieldRootProps & import("react").RefAttributes<HTMLDivElement>>>, "disabled" | "validate" | "validationMode" | "validationDebounceTime" | "invalid" | "dirty" | "touched"> & {
10
+ children?: _Field.Root.Props["children"];
11
+ disabled?: _Field.Root.Props["disabled"];
12
+ } & import("react").RefAttributes<HTMLDivElement>>;
13
+ //# sourceMappingURL=root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../../../src/form/primitives/field/root.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAUvD;;;;;;GAMG;AACH,eAAO,MAAM,IAAI;;;kDAYd,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import '@wordpress/theme/design-tokens.css';
3
+ import { Field } from '../../../..';
4
+ declare const meta: Meta<typeof Field.Root>;
5
+ export default meta;
6
+ /**
7
+ * If your control component forwards refs, as well as the `aria-labelledby` and `aria-describedby` props
8
+ * to the actual underlying HTML element to be labeled,
9
+ * you can simply place your control in the `render` prop of `Field.Control`.
10
+ */
11
+ export declare const Default: StoryObj<typeof Field.Root>;
12
+ /**
13
+ * If your control component does not forward refs, but does forward the `id` prop
14
+ * to the actual underlying HTML element to be labeled, use the `htmlFor` prop
15
+ * of the `Field.Label` component to associate the label with the control.
16
+ *
17
+ * This is preferred over `aria-labelledby` because it allows users to click the
18
+ * label to focus the control.
19
+ */
20
+ export declare const UsingHtmlFor: StoryObj<typeof Field.Root>;
21
+ /**
22
+ * If your control component does not forward refs nor the `id` prop, but does
23
+ * forward the `aria-labelledby` prop to the actual underlying HTML element to be
24
+ * labeled, use the `id` prop of the `Field.Label` component to associate the
25
+ * label with the control.
26
+ */
27
+ export declare const UsingAriaLabelledby: StoryObj<typeof Field.Root>;
28
+ /**
29
+ * To add rich content (such as links) to the description, use `Field.Details`.
30
+ *
31
+ * Although this content is not associated with the field using direct semantics,
32
+ * it is made discoverable to screen reader users via a visually hidden description,
33
+ * alerting them to the presence of additional information below.
34
+ *
35
+ * If the content only includes plain text, use `Field.Description` instead,
36
+ * so the readout is not unnecessarily verbose for screen reader users.
37
+ */
38
+ export declare const WithDetails: StoryObj<typeof Field.Root>;
39
+ //# sourceMappingURL=index.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../../../src/form/primitives/field/stories/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,oCAAoC,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,KAAK,CAAC,IAAI,CAUlC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAE,OAAO,KAAK,CAAC,IAAI,CAchD,CAAC;AAQF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAE,OAAO,KAAK,CAAC,IAAI,CAoBrD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAE,OAAO,KAAK,CAAC,IAAI,CAoB5D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAE,OAAO,KAAK,CAAC,IAAI,CAkBpD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../../src/form/primitives/field/test/index.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,62 @@
1
+ import type { Field } from '@base-ui/react/field';
2
+ import type { ComponentProps } from '../../../utils/types';
3
+ export type FieldRootProps = Omit<ComponentProps<typeof Field.Root>, 'disabled' | 'dirty' | 'invalid' | 'touched' | 'validate' | 'validationDebounceTime' | 'validationMode'> & {
4
+ children?: Field.Root.Props['children'];
5
+ /**
6
+ * Whether the field is disabled.
7
+ *
8
+ * @default false
9
+ */
10
+ disabled?: Field.Root.Props['disabled'];
11
+ };
12
+ export type FieldItemProps = ComponentProps<typeof Field.Item> & {
13
+ children?: React.ReactNode;
14
+ };
15
+ export type FieldLabelProps = ComponentProps<typeof Field.Label> & {
16
+ /**
17
+ * The label string, or the string and the element to associate it with.
18
+ *
19
+ * To keep things accessible, do not include other interactive
20
+ * elements such as links or buttons.
21
+ */
22
+ children?: Field.Label.Props['children'];
23
+ /**
24
+ * The visual variant of the label.
25
+ *
26
+ * Use 'plain' for controls like checkboxes and radio buttons.
27
+ *
28
+ * @default 'default'
29
+ */
30
+ variant?: 'default' | 'plain';
31
+ };
32
+ export type FieldControlProps = Omit<ComponentProps<typeof Field.Control>, 'defaultValue'> & {
33
+ children?: Field.Control.Props['children'];
34
+ /**
35
+ * The default value to use in uncontrolled mode.
36
+ */
37
+ defaultValue?: Field.Control.Props['defaultValue'];
38
+ };
39
+ export type FieldDescriptionProps = ComponentProps<typeof Field.Description> & {
40
+ /**
41
+ * The accessible description, associated using `aria-describedby`.
42
+ *
43
+ * For screen reader accessibility, this should only contain plain text,
44
+ * and no semantics such as links.
45
+ */
46
+ children?: string;
47
+ };
48
+ export type FieldDetailsProps = ComponentProps<'div'> & {
49
+ /**
50
+ * Additional information about the field, which unlike a normal description,
51
+ * can include links and other semantic elements.
52
+ *
53
+ * Although this content is not associated with the field using direct semantics,
54
+ * it is made discoverable to screen reader users via a visually hidden description,
55
+ * alerting them to the presence of additional information below.
56
+ *
57
+ * Do not use this component when the details content is only plain text,
58
+ * as it makes the readout unnecessarily verbose for screen reader users.
59
+ */
60
+ children?: React.ReactNode;
61
+ };
62
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/primitives/field/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,MAAM,cAAc,GAAG,IAAI,CAChC,cAAc,CAAE,OAAO,KAAK,CAAC,IAAI,CAAE,EACjC,UAAU,GAEV,OAAO,GACP,SAAS,GACT,SAAS,GACT,UAAU,GACV,wBAAwB,GACxB,gBAAgB,CAClB,GAAG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAE,UAAU,CAAE,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAE,UAAU,CAAE,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,cAAc,CAAE,OAAO,KAAK,CAAC,IAAI,CAAE,GAAG;IAClE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAE,OAAO,KAAK,CAAC,KAAK,CAAE,GAAG;IACpE;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAE,UAAU,CAAE,CAAC;IAC3C;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CACnC,cAAc,CAAE,OAAO,KAAK,CAAC,OAAO,CAAE,EACtC,cAAc,CACd,GAAG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAE,UAAU,CAAE,CAAC;IAC7C;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAE,cAAc,CAAE,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CACjD,OAAO,KAAK,CAAC,WAAW,CACxB,GAAG;IACH;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAE,KAAK,CAAE,GAAG;IACzD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * as Field from './field';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
@@ -1,2 +1,6 @@
1
+ export * from './badge';
1
2
  export * from './box';
3
+ export * from './form/primitives';
4
+ export * from './stack';
5
+ export * from './visually-hidden';
2
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC"}
@@ -1,5 +1,2 @@
1
- /**
2
- * Internal dependencies
3
- */
4
1
  export { Stack } from './stack';
5
2
  //# sourceMappingURL=index.d.ts.map