@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,69 @@
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/visually-hidden/visually-hidden.tsx
21
+ var visually_hidden_exports = {};
22
+ __export(visually_hidden_exports, {
23
+ VisuallyHidden: () => VisuallyHidden
24
+ });
25
+ module.exports = __toCommonJS(visually_hidden_exports);
26
+ var import_react = require("@base-ui/react");
27
+ var import_element = require("@wordpress/element");
28
+
29
+ // packages/ui/src/visually-hidden/style.module.css
30
+ var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
31
+
32
+ @layer wp-ui-components {
33
+ .style-module__visually-hidden__83ueL {
34
+ border: 0;
35
+ clip-path: inset(50%);
36
+ height: 1px;
37
+ margin: -1px;
38
+ overflow: hidden;
39
+ padding: 0;
40
+ position: absolute;
41
+ width: 1px;
42
+ word-wrap: normal;
43
+ }
44
+ }
45
+ `;
46
+ document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
47
+ var style_default = {
48
+ "visually-hidden": "style-module__visually-hidden__83ueL"
49
+ };
50
+
51
+ // packages/ui/src/visually-hidden/visually-hidden.tsx
52
+ var VisuallyHidden = (0, import_element.forwardRef)(
53
+ function VisuallyHidden2({ render, ...restProps }, ref) {
54
+ const element = (0, import_react.useRender)({
55
+ render,
56
+ ref,
57
+ props: (0, import_react.mergeProps)(
58
+ { className: style_default["visually-hidden"] },
59
+ restProps
60
+ )
61
+ });
62
+ return element;
63
+ }
64
+ );
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ VisuallyHidden
68
+ });
69
+ //# sourceMappingURL=visually-hidden.cjs.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;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsC;AACtC,qBAA2B;;;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,qBAAiB;AAAA,EAC7B,SAASA,gBAAgB,EAAE,QAAQ,GAAG,UAAU,GAAG,KAAM;AACxD,UAAM,cAAU,wBAAW;AAAA,MAC1B;AAAA,MACA;AAAA,MACA,WAAO;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,70 @@
1
+ // packages/ui/src/badge/badge.tsx
2
+ import { forwardRef } from "@wordpress/element";
3
+ import { Box } from "../box/index.mjs";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var DEFAULT_RENDER = (props) => /* @__PURE__ */ jsx("span", { ...props });
6
+ var getIntentStyles = (intent) => {
7
+ switch (intent) {
8
+ case "high":
9
+ return {
10
+ backgroundColor: "error",
11
+ color: "error"
12
+ };
13
+ case "medium":
14
+ return {
15
+ backgroundColor: "warning",
16
+ color: "warning"
17
+ };
18
+ case "low":
19
+ return {
20
+ backgroundColor: "caution",
21
+ color: "caution"
22
+ };
23
+ case "stable":
24
+ return {
25
+ backgroundColor: "success",
26
+ color: "success"
27
+ };
28
+ case "informational":
29
+ return {
30
+ backgroundColor: "info",
31
+ color: "info"
32
+ };
33
+ case "draft":
34
+ return {
35
+ backgroundColor: "neutral-weak",
36
+ color: "neutral"
37
+ };
38
+ case "none":
39
+ default:
40
+ return {
41
+ backgroundColor: "neutral",
42
+ color: "neutral-weak"
43
+ };
44
+ }
45
+ };
46
+ var Badge = forwardRef(function Badge2({ children, intent = "none", render = DEFAULT_RENDER, ...props }, ref) {
47
+ const intentStyles = getIntentStyles(intent);
48
+ return /* @__PURE__ */ jsx(
49
+ Box,
50
+ {
51
+ ...intentStyles,
52
+ padding: { inline: "xs", block: "2xs" },
53
+ borderRadius: "lg",
54
+ render,
55
+ style: {
56
+ fontFamily: "var(--wpds-font-family-body)",
57
+ fontSize: "var(--wpds-font-size-sm)",
58
+ fontWeight: "var(--wpds-font-weight-regular)",
59
+ lineHeight: "var(--wpds-font-line-height-xs)",
60
+ ...props.style
61
+ },
62
+ ref,
63
+ children
64
+ }
65
+ );
66
+ });
67
+ export {
68
+ Badge
69
+ };
70
+ //# sourceMappingURL=badge.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/badge/badge.tsx"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\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": ";AAGA,SAAS,kBAAkB;AAK3B,SAAS,WAAW;AAQnB;AADD,IAAM,iBAAiB,CAAE,UACxB,oBAAC,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,QAAQ,WAA0C,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
+ }
@@ -0,0 +1,6 @@
1
+ // packages/ui/src/badge/index.ts
2
+ import { Badge } from "./badge.mjs";
3
+ export {
4
+ Badge
5
+ };
6
+ //# sourceMappingURL=index.mjs.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,SAAS,aAAa;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -1,10 +1,10 @@
1
1
  // packages/ui/src/box/box.tsx
2
+ import { useRender, mergeProps } from "@base-ui/react";
2
3
  import { forwardRef } from "@wordpress/element";
3
- import { renderElement } from "../utils/element";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  var DEFAULT_RENDER = (props) => /* @__PURE__ */ jsx("div", { ...props });
6
6
  var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
7
- 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}))`;
7
+ var getSpacingValue = (property, target, value) => `var(--wpds-dimension-${property}-${target}-${value}, var(--wpds-dimension-${property}-surface-${value}))`;
8
8
  var getDimensionVariantStyles = (property, target, value) => typeof value !== "object" ? { [property]: getSpacingValue(property, target, value) } : Object.keys(value).reduce(
9
9
  (result, key) => ({
10
10
  ...result,
@@ -27,7 +27,7 @@ var Box = forwardRef(function Box2({
27
27
  render = DEFAULT_RENDER,
28
28
  ...props
29
29
  }, ref) {
30
- const style = { ...props.style };
30
+ const style = {};
31
31
  if (backgroundColor) {
32
32
  style.backgroundColor = `var(--wpds-color-bg-${target}-${backgroundColor}, var(--wpds-color-bg-surface-${backgroundColor}))`;
33
33
  }
@@ -50,13 +50,14 @@ var Box = forwardRef(function Box2({
50
50
  if (borderColor) {
51
51
  style.borderColor = `var(--wpds-color-stroke-${target}-${borderColor}, var(--wpds-color-stroke-surface-${borderColor}))`;
52
52
  }
53
- return renderElement({
53
+ const element = useRender({
54
54
  render,
55
55
  ref,
56
- props: { ...props, style }
56
+ props: mergeProps(props, { style })
57
57
  });
58
+ return element;
58
59
  });
59
60
  export {
60
61
  Box
61
62
  };
62
- //# sourceMappingURL=box.js.map
63
+ //# sourceMappingURL=box.mjs.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,SAAS,WAAW,kBAAkB;AACtC,SAAS,kBAAkB;AAO1B;AADD,IAAM,iBAAiB,CAAE,UACxB,oBAAC,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,MAAM,WAAwC,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,UAAU,UAAW;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,OAAO,WAAqB,OAAO,EAAE,MAAM,CAAE;AAAA,EAC9C,CAAE;AAEF,SAAO;AACR,CAAE;",
6
+ "names": ["Box"]
7
+ }
@@ -0,0 +1,6 @@
1
+ // packages/ui/src/box/index.ts
2
+ import { Box } from "./box.mjs";
3
+ export {
4
+ Box
5
+ };
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1,13 @@
1
+ // packages/ui/src/form/primitives/field/control.tsx
2
+ import { Field as _Field } from "@base-ui/react/field";
3
+ import { forwardRef } from "@wordpress/element";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var Control = forwardRef(
6
+ function Control2(props, ref) {
7
+ return /* @__PURE__ */ jsx(_Field.Control, { ref, ...props });
8
+ }
9
+ );
10
+ export {
11
+ Control
12
+ };
13
+ //# sourceMappingURL=control.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/form/primitives/field/control.tsx"],
4
+ "sourcesContent": ["import { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport type { FieldControlProps } from './types';\n\nexport const Control = forwardRef< HTMLInputElement, FieldControlProps >(\n\tfunction Control( props, ref ) {\n\t\treturn <_Field.Control ref={ ref } { ...props } />;\n\t}\n);\n"],
5
+ "mappings": ";AAAA,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;AAKlB;AAFF,IAAM,UAAU;AAAA,EACtB,SAASA,SAAS,OAAO,KAAM;AAC9B,WAAO,oBAAC,OAAO,SAAP,EAAe,KAAc,GAAG,OAAQ;AAAA,EACjD;AACD;",
6
+ "names": ["Control"]
7
+ }
@@ -0,0 +1,57 @@
1
+ // packages/ui/src/form/primitives/field/description.tsx
2
+ import clsx from "clsx";
3
+ import { Field as _Field } from "@base-ui/react/field";
4
+ import { forwardRef } from "@wordpress/element";
5
+
6
+ // packages/ui/src/utils/css/field.module.css
7
+ var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
8
+
9
+ @layer wp-ui-utilities {
10
+ .field-module__label__LVrYU {
11
+ --wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);
12
+
13
+ font-family: var(--wpds-font-family-body);
14
+ font-size: var(--wpds-font-size-xs);
15
+ line-height: var(--wp-ui-field-label-line-height);
16
+ font-weight: var(--wpds-font-weight-medium);
17
+ text-transform: uppercase;
18
+ color: var(--wpds-color-fg-content-neutral);
19
+
20
+ &.field-module__is-plain__F8QhR {
21
+ font-size: var(--wpds-font-size-md);
22
+ text-transform: none;
23
+ }
24
+ }
25
+
26
+ .field-module__description__CKN1B {
27
+ margin: 0;
28
+ font-family: var(--wpds-font-family-body);
29
+ font-size: var(--wpds-font-size-sm);
30
+ line-height: var(--wpds-font-line-height-xs);
31
+ color: var(--wpds-color-fg-content-neutral-weak);
32
+ }
33
+ }
34
+ `;
35
+ document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
36
+ var field_default = {
37
+ "label": "field-module__label__LVrYU",
38
+ "is-plain": "field-module__is-plain__F8QhR",
39
+ "description": "field-module__description__CKN1B"
40
+ };
41
+
42
+ // packages/ui/src/form/primitives/field/description.tsx
43
+ import { jsx } from "react/jsx-runtime";
44
+ var Description = forwardRef(function Description2({ className, ...restProps }, ref) {
45
+ return /* @__PURE__ */ jsx(
46
+ _Field.Description,
47
+ {
48
+ ref,
49
+ className: clsx(field_default.description, className),
50
+ ...restProps
51
+ }
52
+ );
53
+ });
54
+ export {
55
+ Description
56
+ };
57
+ //# sourceMappingURL=description.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/form/primitives/field/description.tsx", "../../../../src/utils/css/field.module.css"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport fieldStyles from '../../../utils/css/field.module.css';\nimport type { FieldDescriptionProps } from './types';\n\nexport const Description = forwardRef<\n\tHTMLParagraphElement,\n\tFieldDescriptionProps\n>( function Description( { className, ...restProps }, ref ) {\n\treturn (\n\t\t<_Field.Description\n\t\t\tref={ ref }\n\t\t\tclassName={ clsx( fieldStyles.description, className ) }\n\t\t\t{ ...restProps }\n\t\t/>\n\t);\n} );\n", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-utilities {\n\t.field-module__label__LVrYU {\n\t\t--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);\n\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-xs);\n\t\tline-height: var(--wp-ui-field-label-line-height);\n\t\tfont-weight: var(--wpds-font-weight-medium);\n\t\ttext-transform: uppercase;\n\t\tcolor: var(--wpds-color-fg-content-neutral);\n\n\t\t&.field-module__is-plain__F8QhR {\n\t\t\tfont-size: var(--wpds-font-size-md);\n\t\t\ttext-transform: none;\n\t\t}\n\t}\n\n\t.field-module__description__CKN1B {\n\t\tmargin: 0;\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-sm);\n\t\tline-height: var(--wpds-font-line-height-xs);\n\t\tcolor: var(--wpds-color-fg-content-neutral-weak);\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"label\": \"field-module__label__LVrYU\",\n \"is-plain\": \"field-module__is-plain__F8QhR\",\n \"description\": \"field-module__description__CKN1B\"\n};"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;;;ACF3B,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,gBAAQ;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,eAAe;AACjB;;;ADzBE;AALK,IAAM,cAAc,WAGxB,SAASA,aAAa,EAAE,WAAW,GAAG,UAAU,GAAG,KAAM;AAC3D,SACC;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACA;AAAA,MACA,WAAY,KAAM,cAAY,aAAa,SAAU;AAAA,MACnD,GAAG;AAAA;AAAA,EACN;AAEF,CAAE;",
6
+ "names": ["Description"]
7
+ }
@@ -0,0 +1,64 @@
1
+ // packages/ui/src/form/primitives/field/details.tsx
2
+ import clsx from "clsx";
3
+ import { Field as _Field } from "@base-ui/react/field";
4
+ import { forwardRef } from "@wordpress/element";
5
+ import { __ } from "@wordpress/i18n";
6
+
7
+ // packages/ui/src/utils/css/field.module.css
8
+ var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
9
+
10
+ @layer wp-ui-utilities {
11
+ .field-module__label__LVrYU {
12
+ --wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);
13
+
14
+ font-family: var(--wpds-font-family-body);
15
+ font-size: var(--wpds-font-size-xs);
16
+ line-height: var(--wp-ui-field-label-line-height);
17
+ font-weight: var(--wpds-font-weight-medium);
18
+ text-transform: uppercase;
19
+ color: var(--wpds-color-fg-content-neutral);
20
+
21
+ &.field-module__is-plain__F8QhR {
22
+ font-size: var(--wpds-font-size-md);
23
+ text-transform: none;
24
+ }
25
+ }
26
+
27
+ .field-module__description__CKN1B {
28
+ margin: 0;
29
+ font-family: var(--wpds-font-family-body);
30
+ font-size: var(--wpds-font-size-sm);
31
+ line-height: var(--wpds-font-line-height-xs);
32
+ color: var(--wpds-color-fg-content-neutral-weak);
33
+ }
34
+ }
35
+ `;
36
+ document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
37
+ var field_default = {
38
+ "label": "field-module__label__LVrYU",
39
+ "is-plain": "field-module__is-plain__F8QhR",
40
+ "description": "field-module__description__CKN1B"
41
+ };
42
+
43
+ // packages/ui/src/form/primitives/field/details.tsx
44
+ import { VisuallyHidden } from "../../../visually-hidden/index.mjs";
45
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
46
+ var Details = forwardRef(
47
+ function Details2({ className, ...restProps }, ref) {
48
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
49
+ /* @__PURE__ */ jsx(_Field.Description, { render: /* @__PURE__ */ jsx(VisuallyHidden, {}), children: __("More details follow the field.") }),
50
+ /* @__PURE__ */ jsx(
51
+ "div",
52
+ {
53
+ ref,
54
+ className: clsx(field_default.description, className),
55
+ ...restProps
56
+ }
57
+ )
58
+ ] });
59
+ }
60
+ );
61
+ export {
62
+ Details
63
+ };
64
+ //# sourceMappingURL=details.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/form/primitives/field/details.tsx", "../../../../src/utils/css/field.module.css"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport fieldStyles from '../../../utils/css/field.module.css';\nimport type { FieldDetailsProps } from './types';\nimport { VisuallyHidden } from '../../../visually-hidden';\n\n/**\n * A component for showing additional information about the field,\n * styled similarly to a normal `Field.Description`.\n * Unlike a normal description, it can include links and other semantic elements.\n *\n * Although this content is not associated with the field using direct semantics,\n * it is made discoverable to screen reader users via a visually hidden description,\n * alerting them to the presence of additional information below.\n *\n * If the content only includes plain text, use `Field.Description` instead,\n * so the readout is not unnecessarily verbose for screen reader users.\n */\nexport const Details = forwardRef< HTMLDivElement, FieldDetailsProps >(\n\tfunction Details( { className, ...restProps }, ref ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<_Field.Description render={ <VisuallyHidden /> }>\n\t\t\t\t\t{ __( 'More details follow the field.' ) }\n\t\t\t\t</_Field.Description>\n\t\t\t\t<div\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ clsx( fieldStyles.description, className ) }\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t></div>\n\t\t\t</>\n\t\t);\n\t}\n);\n", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-utilities {\n\t.field-module__label__LVrYU {\n\t\t--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);\n\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-xs);\n\t\tline-height: var(--wp-ui-field-label-line-height);\n\t\tfont-weight: var(--wpds-font-weight-medium);\n\t\ttext-transform: uppercase;\n\t\tcolor: var(--wpds-color-fg-content-neutral);\n\n\t\t&.field-module__is-plain__F8QhR {\n\t\t\tfont-size: var(--wpds-font-size-md);\n\t\t\ttext-transform: none;\n\t\t}\n\t}\n\n\t.field-module__description__CKN1B {\n\t\tmargin: 0;\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-sm);\n\t\tline-height: var(--wpds-font-line-height-xs);\n\t\tcolor: var(--wpds-color-fg-content-neutral-weak);\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"label\": \"field-module__label__LVrYU\",\n \"is-plain\": \"field-module__is-plain__F8QhR\",\n \"description\": \"field-module__description__CKN1B\"\n};"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;AAC3B,SAAS,UAAU;;;ACHnB,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,gBAAQ;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,eAAe;AACjB;;;AD9BA,SAAS,sBAAsB;AAiB5B,mBAC8B,KAD9B;AAHI,IAAM,UAAU;AAAA,EACtB,SAASA,SAAS,EAAE,WAAW,GAAG,UAAU,GAAG,KAAM;AACpD,WACC,iCACC;AAAA,0BAAC,OAAO,aAAP,EAAmB,QAAS,oBAAC,kBAAe,GAC1C,aAAI,gCAAiC,GACxC;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA,WAAY,KAAM,cAAY,aAAa,SAAU;AAAA,UACnD,GAAG;AAAA;AAAA,MACL;AAAA,OACF;AAAA,EAEF;AACD;",
6
+ "names": ["Details"]
7
+ }
@@ -0,0 +1,16 @@
1
+ // packages/ui/src/form/primitives/field/index.ts
2
+ import { Root } from "./root.mjs";
3
+ import { Item } from "./item.mjs";
4
+ import { Label } from "./label.mjs";
5
+ import { Description } from "./description.mjs";
6
+ import { Details } from "./details.mjs";
7
+ import { Control } from "./control.mjs";
8
+ export {
9
+ Control,
10
+ Description,
11
+ Details,
12
+ Item,
13
+ Label,
14
+ Root
15
+ };
16
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/form/primitives/field/index.ts"],
4
+ "sourcesContent": ["import { Root } from './root';\nimport { Item } from './item';\nimport { Label } from './label';\nimport { Description } from './description';\nimport { Details } from './details';\nimport { Control } from './control';\n\nexport { Root, Item, Label, Description, Details, Control };\n"],
5
+ "mappings": ";AAAA,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,eAAe;",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ // packages/ui/src/form/primitives/field/item.tsx
2
+ import { Field as _Field } from "@base-ui/react/field";
3
+ import { forwardRef } from "@wordpress/element";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var Item = forwardRef(function Item2(props, ref) {
6
+ return /* @__PURE__ */ jsx(_Field.Item, { ref, ...props });
7
+ });
8
+ export {
9
+ Item
10
+ };
11
+ //# sourceMappingURL=item.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/form/primitives/field/item.tsx"],
4
+ "sourcesContent": ["import { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport type { FieldItemProps } from './types';\n\nexport const Item: React.ForwardRefExoticComponent<\n\tFieldItemProps & React.RefAttributes< HTMLDivElement >\n> = forwardRef( function Item( props, ref ) {\n\treturn <_Field.Item ref={ ref } { ...props } />;\n} );\n"],
5
+ "mappings": ";AAAA,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;AAMnB;AAHD,IAAM,OAET,WAAY,SAASA,MAAM,OAAO,KAAM;AAC3C,SAAO,oBAAC,OAAO,MAAP,EAAY,KAAc,GAAG,OAAQ;AAC9C,CAAE;",
6
+ "names": ["Item"]
7
+ }
@@ -0,0 +1,63 @@
1
+ // packages/ui/src/form/primitives/field/label.tsx
2
+ import clsx from "clsx";
3
+ import { Field as _Field } from "@base-ui/react/field";
4
+ import { forwardRef } from "@wordpress/element";
5
+
6
+ // packages/ui/src/utils/css/field.module.css
7
+ var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
8
+
9
+ @layer wp-ui-utilities {
10
+ .field-module__label__LVrYU {
11
+ --wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);
12
+
13
+ font-family: var(--wpds-font-family-body);
14
+ font-size: var(--wpds-font-size-xs);
15
+ line-height: var(--wp-ui-field-label-line-height);
16
+ font-weight: var(--wpds-font-weight-medium);
17
+ text-transform: uppercase;
18
+ color: var(--wpds-color-fg-content-neutral);
19
+
20
+ &.field-module__is-plain__F8QhR {
21
+ font-size: var(--wpds-font-size-md);
22
+ text-transform: none;
23
+ }
24
+ }
25
+
26
+ .field-module__description__CKN1B {
27
+ margin: 0;
28
+ font-family: var(--wpds-font-family-body);
29
+ font-size: var(--wpds-font-size-sm);
30
+ line-height: var(--wpds-font-line-height-xs);
31
+ color: var(--wpds-color-fg-content-neutral-weak);
32
+ }
33
+ }
34
+ `;
35
+ document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
36
+ var field_default = {
37
+ "label": "field-module__label__LVrYU",
38
+ "is-plain": "field-module__is-plain__F8QhR",
39
+ "description": "field-module__description__CKN1B"
40
+ };
41
+
42
+ // packages/ui/src/form/primitives/field/label.tsx
43
+ import { jsx } from "react/jsx-runtime";
44
+ var Label = forwardRef(
45
+ function Label2({ className, variant, ...restProps }, ref) {
46
+ return /* @__PURE__ */ jsx(
47
+ _Field.Label,
48
+ {
49
+ ref,
50
+ className: clsx(
51
+ field_default.label,
52
+ variant && field_default[`is-${variant}`],
53
+ className
54
+ ),
55
+ ...restProps
56
+ }
57
+ );
58
+ }
59
+ );
60
+ export {
61
+ Label
62
+ };
63
+ //# sourceMappingURL=label.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/form/primitives/field/label.tsx", "../../../../src/utils/css/field.module.css"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport fieldStyles from '../../../utils/css/field.module.css';\nimport type { FieldLabelProps } from './types';\n\nexport const Label = forwardRef< HTMLLabelElement, FieldLabelProps >(\n\tfunction Label( { className, variant, ...restProps }, ref ) {\n\t\treturn (\n\t\t\t<_Field.Label\n\t\t\t\tref={ ref }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tfieldStyles.label,\n\t\t\t\t\tvariant && fieldStyles[ `is-${ variant }` ],\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\t{ ...restProps }\n\t\t\t/>\n\t\t);\n\t}\n);\n", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-utilities {\n\t.field-module__label__LVrYU {\n\t\t--wp-ui-field-label-line-height: var(--wpds-font-line-height-xs);\n\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-xs);\n\t\tline-height: var(--wp-ui-field-label-line-height);\n\t\tfont-weight: var(--wpds-font-weight-medium);\n\t\ttext-transform: uppercase;\n\t\tcolor: var(--wpds-color-fg-content-neutral);\n\n\t\t&.field-module__is-plain__F8QhR {\n\t\t\tfont-size: var(--wpds-font-size-md);\n\t\t\ttext-transform: none;\n\t\t}\n\t}\n\n\t.field-module__description__CKN1B {\n\t\tmargin: 0;\n\t\tfont-family: var(--wpds-font-family-body);\n\t\tfont-size: var(--wpds-font-size-sm);\n\t\tline-height: var(--wpds-font-line-height-xs);\n\t\tcolor: var(--wpds-color-fg-content-neutral-weak);\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"label\": \"field-module__label__LVrYU\",\n \"is-plain\": \"field-module__is-plain__F8QhR\",\n \"description\": \"field-module__description__CKN1B\"\n};"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;;;ACF3B,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,gBAAQ;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,eAAe;AACjB;;;AD3BG;AAHI,IAAM,QAAQ;AAAA,EACpB,SAASA,OAAO,EAAE,WAAW,SAAS,GAAG,UAAU,GAAG,KAAM;AAC3D,WACC;AAAA,MAAC,OAAO;AAAA,MAAP;AAAA,QACA;AAAA,QACA,WAAY;AAAA,UACX,cAAY;AAAA,UACZ,WAAW,cAAa,MAAO,OAAQ,EAAG;AAAA,UAC1C;AAAA,QACD;AAAA,QACE,GAAG;AAAA;AAAA,IACN;AAAA,EAEF;AACD;",
6
+ "names": ["Label"]
7
+ }
@@ -0,0 +1,44 @@
1
+ // packages/ui/src/form/primitives/field/root.tsx
2
+ import clsx from "clsx";
3
+ import { Field as _Field } from "@base-ui/react/field";
4
+ import { forwardRef } from "@wordpress/element";
5
+
6
+ // packages/ui/src/utils/css/resets.module.css
7
+ var css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;
8
+
9
+ @layer wp-ui-utilities {
10
+ .resets-module__box-sizing__M2zT5 {
11
+ box-sizing: border-box;
12
+
13
+ *,
14
+ *::before,
15
+ *::after {
16
+ box-sizing: inherit;
17
+ }
18
+ }
19
+ }
20
+ `;
21
+ document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
22
+ var resets_default = {
23
+ "box-sizing": "resets-module__box-sizing__M2zT5"
24
+ };
25
+
26
+ // packages/ui/src/form/primitives/field/root.tsx
27
+ import { Stack } from "../../../stack/index.mjs";
28
+ import { jsx } from "react/jsx-runtime";
29
+ var DEFAULT_RENDER = (props) => /* @__PURE__ */ jsx(Stack, { ...props, direction: "column", gap: "xs" });
30
+ var Root = forwardRef(function Root2({ className, render = DEFAULT_RENDER, ...restProps }, ref) {
31
+ return /* @__PURE__ */ jsx(
32
+ _Field.Root,
33
+ {
34
+ ref,
35
+ className: clsx(resets_default["box-sizing"], className),
36
+ render,
37
+ ...restProps
38
+ }
39
+ );
40
+ });
41
+ export {
42
+ Root
43
+ };
44
+ //# sourceMappingURL=root.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/form/primitives/field/root.tsx", "../../../../src/utils/css/resets.module.css"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport { Field as _Field } from '@base-ui/react/field';\nimport { forwardRef } from '@wordpress/element';\nimport resetStyles from '../../../utils/css/resets.module.css';\nimport type { FieldRootProps } from './types';\nimport { Stack } from '../../../stack';\n\nconst DEFAULT_RENDER = ( props: React.ComponentProps< typeof Stack > ) => (\n\t<Stack { ...props } direction=\"column\" gap=\"xs\" />\n);\n\n/**\n * A low-level component that associates an accessible label and description\n * with a single form control element.\n *\n * Simply wrapping a control with this component does not guarantee\n * accessible labeling. See examples for how to associate the label in different cases.\n */\nexport const Root = forwardRef< HTMLDivElement, FieldRootProps >( function Root(\n\t{ className, render = DEFAULT_RENDER, ...restProps },\n\tref\n) {\n\treturn (\n\t\t<_Field.Root\n\t\t\tref={ ref }\n\t\t\tclassName={ clsx( resetStyles[ 'box-sizing' ], className ) }\n\t\t\trender={ render }\n\t\t\t{ ...restProps }\n\t\t/>\n\t);\n} );\n", "const css = `@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;\n\n@layer wp-ui-utilities {\n\t.resets-module__box-sizing__M2zT5 {\n\t\tbox-sizing: border-box;\n\n\t\t*,\n\t\t*::before,\n\t\t*::after {\n\t\t\tbox-sizing: inherit;\n\t\t}\n\t}\n}\n`;\ndocument.head\n .appendChild(document.createElement(\"style\"))\n .appendChild(document.createTextNode(css));\nexport {css};\nexport default {\n \"box-sizing\": \"resets-module__box-sizing__M2zT5\"\n};"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;;;ACF3B,IAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcZ,SAAS,KACJ,YAAY,SAAS,cAAc,OAAO,CAAC,EAC3C,YAAY,SAAS,eAAe,GAAG,CAAC;AAE7C,IAAO,iBAAQ;AAAA,EACb,cAAc;AAChB;;;ADfA,SAAS,aAAa;AAGrB;AADD,IAAM,iBAAiB,CAAE,UACxB,oBAAC,SAAQ,GAAG,OAAQ,WAAU,UAAS,KAAI,MAAK;AAU1C,IAAM,OAAO,WAA8C,SAASA,MAC1E,EAAE,WAAW,SAAS,gBAAgB,GAAG,UAAU,GACnD,KACC;AACD,SACC;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACA;AAAA,MACA,WAAY,KAAM,eAAa,YAAa,GAAG,SAAU;AAAA,MACzD;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF,CAAE;",
6
+ "names": ["Root"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1,6 @@
1
+ // packages/ui/src/form/primitives/index.ts
2
+ import * as Field from "./field/index.mjs";
3
+ export {
4
+ Field
5
+ };
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/form/primitives/index.ts"],
4
+ "sourcesContent": ["export * as Field from './field';\n"],
5
+ "mappings": ";AAAA,YAAY,WAAW;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ // packages/ui/src/index.ts
2
+ export * from "./badge/index.mjs";
3
+ export * from "./box/index.mjs";
4
+ export * from "./form/primitives/index.mjs";
5
+ export * from "./stack/index.mjs";
6
+ export * from "./visually-hidden/index.mjs";
7
+ //# sourceMappingURL=index.mjs.map