@hirobius/design-system 0.19.1 → 0.21.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 (175) hide show
  1. package/AGENTS.md +123 -0
  2. package/CONSUMING.md +11 -6
  3. package/DESIGN.md +34 -21
  4. package/NOTICE.md +1 -1
  5. package/README.md +48 -13
  6. package/codemods/hds-prefix.mjs +231 -0
  7. package/codemods/jsx-fold.mjs +515 -0
  8. package/codemods/not-found-pattern.mjs +71 -0
  9. package/codemods/patterns-subpath.mjs +242 -81
  10. package/codemods/patterns-subpath.names.json +41 -15
  11. package/codemods/removed-0.20.json +194 -0
  12. package/codemods/tile-grid.mjs +283 -0
  13. package/codemods/unrewritable.mjs +291 -0
  14. package/dist/chunks/DemoStateContext-Cz5TmrYu.js +32 -0
  15. package/dist/chunks/empty-state-DNoThgfV.js +1227 -0
  16. package/dist/chunks/form-By82qZcC.js +66 -0
  17. package/dist/contexts.js +157 -78
  18. package/dist/fonts/geist-mono-400.woff2 +0 -0
  19. package/dist/fonts/satoshi-400.woff2 +0 -0
  20. package/dist/fonts/satoshi-500.woff2 +0 -0
  21. package/dist/fonts/satoshi-700.woff2 +0 -0
  22. package/dist/fonts.css +53 -0
  23. package/dist/form.js +1 -1
  24. package/dist/hirobius-ui.js +1600 -5354
  25. package/dist/manifest.js +12 -13
  26. package/dist/patterns.js +796 -510
  27. package/dist/styles.css +2 -2
  28. package/dist/tokens.css +1 -1
  29. package/dist/tokens.js +165 -65
  30. package/dist/types/src/app/components/alert-dialog.d.ts +5 -0
  31. package/dist/types/src/app/components/asset-img.d.ts +1 -0
  32. package/dist/types/src/app/components/avatar-group.d.ts +2 -2
  33. package/dist/types/src/app/components/badge.d.ts +8 -3
  34. package/dist/types/src/app/components/blockquote.d.ts +2 -2
  35. package/dist/types/src/app/components/box-sx.d.ts +110 -13
  36. package/dist/types/src/app/components/box.d.ts +6 -3
  37. package/dist/types/src/app/components/breadcrumb.d.ts +0 -5
  38. package/dist/types/src/app/components/button.d.ts +35 -4
  39. package/dist/types/src/app/components/card.d.ts +10 -10
  40. package/dist/types/src/app/components/combobox.d.ts +47 -11
  41. package/dist/types/src/app/components/container.d.ts +2 -2
  42. package/dist/types/src/app/components/data-table-section.d.ts +2 -1
  43. package/dist/types/src/app/components/destructive-section.d.ts +1 -0
  44. package/dist/types/src/app/components/dialog.d.ts +8 -1
  45. package/dist/types/src/app/components/disclosure.d.ts +1 -5
  46. package/dist/types/src/app/components/error-pattern.d.ts +6 -1
  47. package/dist/types/src/app/components/field.d.ts +1 -2
  48. package/dist/types/src/app/components/form-actions.d.ts +1 -0
  49. package/dist/types/src/app/components/form-control.d.ts +10 -0
  50. package/dist/types/src/app/components/grid.d.ts +15 -6
  51. package/dist/types/src/app/components/hds-tooltip.d.ts +12 -2
  52. package/dist/types/src/app/components/icon.d.ts +1 -0
  53. package/dist/types/src/app/components/inline-code.d.ts +1 -2
  54. package/dist/types/src/app/components/input.d.ts +8 -5
  55. package/dist/types/src/app/components/kbd.d.ts +2 -2
  56. package/dist/types/src/app/components/metadata-list.d.ts +2 -2
  57. package/dist/types/src/app/components/metric-tiles.d.ts +1 -0
  58. package/dist/types/src/app/components/page-header.d.ts +0 -2
  59. package/dist/types/src/app/components/popover.d.ts +8 -0
  60. package/dist/types/src/app/components/progress.d.ts +33 -6
  61. package/dist/types/src/app/components/segmented-control.d.ts +2 -26
  62. package/dist/types/src/app/components/select.d.ts +10 -1
  63. package/dist/types/src/app/components/skeleton.d.ts +3 -4
  64. package/dist/types/src/app/components/spinner.d.ts +1 -2
  65. package/dist/types/src/app/components/stack.d.ts +4 -1
  66. package/dist/types/src/app/components/stat.d.ts +5 -5
  67. package/dist/types/src/app/components/status-list-item.d.ts +1 -2
  68. package/dist/types/src/app/components/status-tile.d.ts +3 -2
  69. package/dist/types/src/app/components/surface.d.ts +2 -3
  70. package/dist/types/src/app/components/switcher.d.ts +1 -1
  71. package/dist/types/src/app/components/table.d.ts +6 -15
  72. package/dist/types/src/app/components/tag.d.ts +0 -6
  73. package/dist/types/src/app/components/text.d.ts +54 -8
  74. package/dist/types/src/app/components/textarea.d.ts +1 -2
  75. package/dist/types/src/app/components/timestamp.d.ts +1 -0
  76. package/dist/types/src/app/components/toast.d.ts +1 -2
  77. package/dist/types/src/app/components/tooltip.d.ts +1 -1
  78. package/dist/types/src/app/context/DemoStateContext.d.ts +1 -1
  79. package/dist/types/src/app/context/RouterContext.d.ts +5 -5
  80. package/dist/types/src/app/data/manifest-types.d.ts +10 -5
  81. package/dist/types/src/app/design-system/generated-token-refs.d.ts +45 -28
  82. package/dist/types/src/app/design-system/generated-token-values.d.ts +4 -0
  83. package/dist/types/src/app/design-system/tokens.d.ts +139 -18
  84. package/dist/types/src/icons.d.ts +1 -1
  85. package/dist/types/src/index.d.ts +76 -164
  86. package/dist/types/src/patterns.d.ts +20 -25
  87. package/dist/variables.css +47 -33
  88. package/docs/CONSUMING.md +80 -48
  89. package/hirobius.tokens.json +125 -88
  90. package/llms.txt +166 -59
  91. package/mcp/catalog.mjs +366 -0
  92. package/mcp/guide.mjs +315 -0
  93. package/mcp/hds-mcp.mjs +49 -0
  94. package/mcp/server.mjs +94 -0
  95. package/package.json +48 -27
  96. package/public/hds-manifest.json +2667 -6705
  97. package/public/llms/components.txt +45 -426
  98. package/public/llms/layout.txt +5 -5
  99. package/public/llms-full.txt +245 -506
  100. package/public/llms.txt +166 -59
  101. package/scripts/eslint-plugin-hds/index.d.mts +29 -0
  102. package/scripts/eslint-plugin-hds/index.mjs +55 -0
  103. package/scripts/eslint-plugin-hds/package.json +30 -0
  104. package/scripts/eslint-plugin-hds/rules/no-raw-controls.mjs +47 -0
  105. package/scripts/eslint-plugin-hds/rules/no-raw-hex.mjs +70 -0
  106. package/scripts/eslint-plugin-hds/rules/no-raw-px-spacing.mjs +125 -0
  107. package/scripts/eslint-plugin-hds/rules/prefer-hds-layout-primitive.mjs +54 -0
  108. package/scripts/eslint-plugin-hds/rules/sx-token-first.mjs +111 -0
  109. package/scripts/eslint-plugin-hds/rules/utils.mjs +66 -0
  110. package/src/app/data/component-api.json +1082 -2913
  111. package/dist/chunks/LanguageContext-BxdCwiFg.js +0 -95
  112. package/dist/chunks/TokenDisplayContext-DKYJMVWk.js +0 -26
  113. package/dist/chunks/activity-feed-BGQ6v3wc.js +0 -22040
  114. package/dist/chunks/form-COP3vK9_.js +0 -66
  115. package/dist/types/src/app/components/activity-feed.d.ts +0 -73
  116. package/dist/types/src/app/components/app-shell.d.ts +0 -40
  117. package/dist/types/src/app/components/aspect-ratio.d.ts +0 -25
  118. package/dist/types/src/app/components/bleed.d.ts +0 -39
  119. package/dist/types/src/app/components/button-group.d.ts +0 -22
  120. package/dist/types/src/app/components/calendar.d.ts +0 -22
  121. package/dist/types/src/app/components/carousel.d.ts +0 -26
  122. package/dist/types/src/app/components/center.d.ts +0 -36
  123. package/dist/types/src/app/components/cinematic-link.d.ts +0 -18
  124. package/dist/types/src/app/components/circular-progress.d.ts +0 -28
  125. package/dist/types/src/app/components/cluster.d.ts +0 -39
  126. package/dist/types/src/app/components/command-palette.d.ts +0 -46
  127. package/dist/types/src/app/components/component-instance-matrix.d.ts +0 -27
  128. package/dist/types/src/app/components/context-menu.d.ts +0 -78
  129. package/dist/types/src/app/components/cover.d.ts +0 -43
  130. package/dist/types/src/app/components/date-input.d.ts +0 -31
  131. package/dist/types/src/app/components/date-range-input.d.ts +0 -34
  132. package/dist/types/src/app/components/date-time-input.d.ts +0 -30
  133. package/dist/types/src/app/components/doc-link-card.d.ts +0 -32
  134. package/dist/types/src/app/components/error-boundary.d.ts +0 -25
  135. package/dist/types/src/app/components/file-input.d.ts +0 -30
  136. package/dist/types/src/app/components/foundation-swatch.d.ts +0 -45
  137. package/dist/types/src/app/components/frame.d.ts +0 -38
  138. package/dist/types/src/app/components/heading-stack.d.ts +0 -52
  139. package/dist/types/src/app/components/history-card.d.ts +0 -12
  140. package/dist/types/src/app/components/hover-card.d.ts +0 -46
  141. package/dist/types/src/app/components/icon-button.d.ts +0 -22
  142. package/dist/types/src/app/components/image-lightbox.d.ts +0 -14
  143. package/dist/types/src/app/components/input-group.d.ts +0 -23
  144. package/dist/types/src/app/components/multi-selector.d.ts +0 -40
  145. package/dist/types/src/app/components/nav-group.d.ts +0 -29
  146. package/dist/types/src/app/components/nav-item.d.ts +0 -33
  147. package/dist/types/src/app/components/not-found-pattern.d.ts +0 -1
  148. package/dist/types/src/app/components/overflow-list.d.ts +0 -21
  149. package/dist/types/src/app/components/selectable-card.d.ts +0 -29
  150. package/dist/types/src/app/components/side-nav.d.ts +0 -23
  151. package/dist/types/src/app/components/sketch.d.ts +0 -19
  152. package/dist/types/src/app/components/stacked-card-rail.d.ts +0 -32
  153. package/dist/types/src/app/components/status-dot.d.ts +0 -25
  154. package/dist/types/src/app/components/stepper-field.d.ts +0 -12
  155. package/dist/types/src/app/components/stepper.d.ts +0 -33
  156. package/dist/types/src/app/components/text-lockup.d.ts +0 -38
  157. package/dist/types/src/app/components/tile-grid.d.ts +0 -17
  158. package/dist/types/src/app/components/time-input.d.ts +0 -24
  159. package/dist/types/src/app/components/toggle-button.d.ts +0 -32
  160. package/dist/types/src/app/components/token.d.ts +0 -90
  161. package/dist/types/src/app/components/tokenUtils.d.ts +0 -38
  162. package/dist/types/src/app/components/tokenizer.d.ts +0 -24
  163. package/dist/types/src/app/components/toolbar.d.ts +0 -36
  164. package/dist/types/src/app/components/top-nav.d.ts +0 -23
  165. package/dist/types/src/app/components/tree-list.d.ts +0 -30
  166. package/dist/types/src/app/data/nav-model.d.ts +0 -39
  167. package/dist/types/src/app/hooks/useFocusVisible.d.ts +0 -9
  168. package/dist/types/src/app/layouts/CaseStudyLayout.d.ts +0 -20
  169. package/dist/types/src/app/layouts/DocLayout.d.ts +0 -14
  170. package/dist/types/src/app/layouts/EmbeddedDocLayoutContext.d.ts +0 -6
  171. package/dist/types/src/app/layouts/HdsDocsShell.d.ts +0 -72
  172. package/dist/types/src/app/layouts/HdsSystemDocLayout.d.ts +0 -14
  173. package/dist/types/src/app/lib/hds-search.d.ts +0 -45
  174. package/dist/types/src/app/lib/nav-active.d.ts +0 -16
  175. package/dist/types/src/app/lib/navLevels.d.ts +0 -4
@@ -0,0 +1,1227 @@
1
+ 'use client';
2
+ import h from "../tokens.js";
3
+ import * as g from "react";
4
+ import T, { useState as Q, useEffect as Z, forwardRef as me, useId as H } from "react";
5
+ import { jsx as s, jsxs as k, Fragment as fe } from "react/jsx-runtime";
6
+ import { Slot as pe } from "@radix-ui/react-slot";
7
+ import { cva as E } from "class-variance-authority";
8
+ import { Loader2 as ge, ArrowUp as he, ArrowDown as ye, ArrowUpDown as ve } from "lucide-react";
9
+ import { cn as y } from "../cn.js";
10
+ import * as A from "@radix-ui/react-alert-dialog";
11
+ import { createPortal as be } from "react-dom";
12
+ const ee = "(prefers-reduced-motion: reduce)";
13
+ function xe() {
14
+ return typeof window > "u" || !window.matchMedia ? !1 : window.matchMedia(ee).matches;
15
+ }
16
+ function we() {
17
+ const [t, e] = Q(xe);
18
+ return Z(() => {
19
+ if (typeof window > "u" || !window.matchMedia) return;
20
+ const r = window.matchMedia(ee), n = () => e(r.matches);
21
+ return r.addEventListener ? r.addEventListener("change", n) : r.addListener(n), () => {
22
+ r.removeEventListener ? r.removeEventListener("change", n) : r.removeListener(n);
23
+ };
24
+ }, []), t;
25
+ }
26
+ function Yt(t) {
27
+ const e = we(), r = h.motion[t];
28
+ return e ? { ...r, duration: 0 } : r;
29
+ }
30
+ const te = Symbol("hds.env.absent");
31
+ function Se() {
32
+ try {
33
+ return process.env.NODE_ENV;
34
+ } catch {
35
+ return te;
36
+ }
37
+ }
38
+ function re() {
39
+ const t = Se();
40
+ return t === "production" || t === te;
41
+ }
42
+ function L() {
43
+ return !re();
44
+ }
45
+ const ke = {
46
+ thin: 1,
47
+ light: 1.5,
48
+ regular: 2,
49
+ bold: 2.5,
50
+ fill: 2,
51
+ duotone: 2
52
+ }, Ce = /* @__PURE__ */ T.forwardRef(function({
53
+ icon: e,
54
+ size: r = "small",
55
+ color: n = "currentColor",
56
+ className: a = "",
57
+ style: o,
58
+ weight: c,
59
+ "aria-hidden": d = !0
60
+ }, l) {
61
+ if (L() && !e)
62
+ return console.warn("[Icon] icon prop is missing or undefined. Provide a Lucide icon component."), null;
63
+ const i = h.iconSize[r] || r, u = c ? ke[c] : void 0, p = {
64
+ width: i,
65
+ height: i,
66
+ minWidth: i,
67
+ minHeight: i,
68
+ display: "block",
69
+ flexShrink: 0,
70
+ aspectRatio: "1 / 1",
71
+ ...o && typeof o == "object" ? o : void 0
72
+ };
73
+ return /* @__PURE__ */ s(
74
+ e,
75
+ {
76
+ ref: l,
77
+ size: typeof i == "number" ? i : void 0,
78
+ color: n,
79
+ className: a,
80
+ style: p,
81
+ strokeWidth: u,
82
+ "aria-hidden": d,
83
+ "data-hds-icon": ""
84
+ }
85
+ );
86
+ }), K = /* @__PURE__ */ new Set();
87
+ function Ae(t, e) {
88
+ re() || K.has(t) || (K.add(t), console.warn(`[HDS deprecation] ${e} (${t})`));
89
+ }
90
+ const Ne = {
91
+ xs: 375,
92
+ sm: 640,
93
+ md: 768,
94
+ lg: 1024,
95
+ xl: 1280
96
+ }, ne = ["xs", "sm", "md", "lg", "xl"], Ee = /* @__PURE__ */ new Set([
97
+ "opacity",
98
+ "zIndex",
99
+ "fontWeight",
100
+ "lineHeight",
101
+ "flex",
102
+ "flexGrow",
103
+ "flexShrink",
104
+ "order",
105
+ "zoom",
106
+ "tabSize",
107
+ "aspectRatio"
108
+ ]), Re = /* @__PURE__ */ new Set([0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 16, 20, 24, 32]), R = {
109
+ xs: "var(--semantic-space-scale-xs)",
110
+ sm: "var(--semantic-space-scale-sm)",
111
+ md: "var(--semantic-space-scale-md)",
112
+ lg: "var(--semantic-space-scale-lg)",
113
+ xl: "var(--semantic-space-scale-xl)"
114
+ }, M = {
115
+ tight: R.sm,
116
+ normal: R.md,
117
+ inset: R.lg,
118
+ spacious: R.xl
119
+ }, De = {
120
+ names: { ...M, medium: "var(--semantic-space-component-medium)" },
121
+ closed: !0
122
+ }, Te = {
123
+ names: {
124
+ ...R,
125
+ tight: "var(--semantic-space-layout-tight)",
126
+ normal: "var(--semantic-space-layout-normal)",
127
+ inset: "var(--semantic-space-layout-inset)",
128
+ spacious: "var(--semantic-space-layout-spacious)"
129
+ },
130
+ numbers: "units"
131
+ }, j = (t, e) => Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0, _e = {
132
+ tight: "sm",
133
+ normal: "md",
134
+ inset: "lg",
135
+ spacious: "xl"
136
+ }, Pe = {
137
+ m: ["margin"],
138
+ mt: ["margin-top"],
139
+ mr: ["margin-right"],
140
+ mb: ["margin-bottom"],
141
+ ml: ["margin-left"],
142
+ mx: ["margin-left", "margin-right"],
143
+ my: ["margin-top", "margin-bottom"],
144
+ p: ["padding"],
145
+ pt: ["padding-top"],
146
+ pr: ["padding-right"],
147
+ pb: ["padding-bottom"],
148
+ pl: ["padding-left"],
149
+ px: ["padding-left", "padding-right"],
150
+ py: ["padding-top", "padding-bottom"],
151
+ gap: ["gap"],
152
+ rowGap: ["row-gap"],
153
+ columnGap: ["column-gap"]
154
+ };
155
+ function $(t, e) {
156
+ return "closed" in e ? typeof t == "string" ? j(e.names, t) : void 0 : typeof t == "number" ? e.numbers === "raw" ? t : Re.has(t) ? `var(--primitive-space-${t})` : `calc(var(--primitive-space-1) * ${t})` : j(e.names, t) ?? t;
157
+ }
158
+ const Oe = {
159
+ color: "color",
160
+ bgcolor: "background-color",
161
+ borderColor: "border-color",
162
+ fill: "fill",
163
+ stroke: "stroke"
164
+ }, $e = /* @__PURE__ */ new Set(["primary", "secondary", "disabled", "inverse", "accent"]), Ie = /* @__PURE__ */ new Set(["page", "raised", "overlay", "accent"]), Le = /* @__PURE__ */ new Set(["default", "subtle", "subdued", "strong", "accent"]), je = /* @__PURE__ */ new Set(["success", "warning", "error", "info"]), ze = /* @__PURE__ */ new Set(["hover", "pressed", "subtle", "content"]);
165
+ function Me(t) {
166
+ if (t === "accent") return "var(--semantic-accent-rest)";
167
+ const e = t.indexOf(".");
168
+ if (e === -1) return;
169
+ const r = t.slice(0, e), n = t.slice(e + 1);
170
+ if (r === "content" && $e.has(n)) return `var(--semantic-color-content-${n})`;
171
+ if (r === "surface" && Ie.has(n)) return `var(--semantic-color-surface-${n})`;
172
+ if (r === "border" && Le.has(n)) return `var(--semantic-color-border-${n})`;
173
+ if (r === "feedback" && je.has(n)) return `var(--semantic-color-feedback-${n})`;
174
+ if (r === "accent" && ze.has(n)) return `var(--semantic-accent-${n})`;
175
+ }
176
+ function Be(t) {
177
+ return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
178
+ }
179
+ function W(t, e) {
180
+ const r = Pe[t];
181
+ if (r) {
182
+ const c = typeof e == "string" ? j(_e, e) : void 0;
183
+ c && Ae(
184
+ `box-sx-spacing-${e}`,
185
+ `Box sx spacing name '${e}' is deprecated (hds#206) and is removed in 1.0.0. Use '${c}': same pixels at the default density, tighter under compact (MIGRATIONS.md).`
186
+ );
187
+ const d = $(e, Te);
188
+ return r.map((l) => `${l}:${d}`);
189
+ }
190
+ const n = Oe[t];
191
+ if (n) {
192
+ const c = typeof e == "string" ? Me(e) ?? e : String(e);
193
+ return [`${n}:${c}`];
194
+ }
195
+ const a = Be(t), o = typeof e == "number" ? Ee.has(t) ? String(e) : `${e}px` : e;
196
+ return [`${a}:${o}`];
197
+ }
198
+ function Ve(t) {
199
+ return typeof t != "object" || t === null || Array.isArray(t) ? !1 : Object.keys(t).every((e) => ne.includes(e));
200
+ }
201
+ function Ge(t, e) {
202
+ const r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), a = (i, u) => {
203
+ const p = r.get(i) ?? [];
204
+ p.push(...u), r.set(i, p);
205
+ }, o = (i, u, p) => {
206
+ let m = n.get(i);
207
+ m || (m = /* @__PURE__ */ new Map(), n.set(i, m));
208
+ const b = m.get(u) ?? [];
209
+ b.push(...p), m.set(u, b);
210
+ }, c = (i, u) => {
211
+ for (const [p, m] of Object.entries(i))
212
+ if (m != null) {
213
+ if (p.startsWith("&")) {
214
+ c(m, u + p.slice(1));
215
+ continue;
216
+ }
217
+ if (Ve(m)) {
218
+ for (const b of ne) {
219
+ const f = m[b];
220
+ f !== void 0 && o(Ne[b], u, W(p, f));
221
+ }
222
+ continue;
223
+ }
224
+ a(u, W(p, m));
225
+ }
226
+ };
227
+ c(t, "");
228
+ const d = [];
229
+ for (const [i, u] of r)
230
+ u.length !== 0 && d.push(`.${e}${i}{${u.join(";")}}`);
231
+ const l = [...n.entries()].sort((i, u) => i[0] - u[0]);
232
+ for (const [i, u] of l) {
233
+ let p = "";
234
+ for (const [m, b] of u)
235
+ b.length !== 0 && (p += `.${e}${m}{${b.join(";")}}`);
236
+ p && d.push(`@media (min-width:${i}px){${p}}`);
237
+ }
238
+ return d;
239
+ }
240
+ function z(t) {
241
+ return t === void 0 ? "undefined" : t === null || typeof t != "object" ? JSON.stringify(t) : Array.isArray(t) ? `[${t.map(z).join(",")}]` : `{${Object.keys(t).sort().map((r) => `${JSON.stringify(r)}:${z(t[r])}`).join(",")}}`;
242
+ }
243
+ function He(t) {
244
+ let e = 5381;
245
+ for (let r = 0; r < t.length; r += 1)
246
+ e = e * 33 ^ t.charCodeAt(r);
247
+ return (e >>> 0).toString(36);
248
+ }
249
+ function Ke(t) {
250
+ return `hds-sx-${He(z(t))}`;
251
+ }
252
+ const U = /* @__PURE__ */ new Set();
253
+ let D = null;
254
+ function We() {
255
+ if (typeof document > "u") return null;
256
+ if (D && D.isConnected) return D;
257
+ let t = document.querySelector("style[data-hds-sx]");
258
+ return t || (t = document.createElement("style"), t.setAttribute("data-hds-sx", ""), document.head.appendChild(t)), D = t, D;
259
+ }
260
+ function Xt(t) {
261
+ const e = Ke(t);
262
+ if (U.has(e)) return e;
263
+ const r = We();
264
+ if (!r) return e;
265
+ const n = r.sheet;
266
+ if (!n) return e;
267
+ U.add(e);
268
+ for (const a of Ge(t, e))
269
+ try {
270
+ n.insertRule(a, n.cssRules.length);
271
+ } catch {
272
+ }
273
+ return e;
274
+ }
275
+ const Ue = /* @__PURE__ */ E(
276
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md transition-[colors,filter] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:inset-shadow-[0_0_0_9999px] active:inset-shadow-pressed-overlay/5 [&_svg]:pointer-events-none [&_svg]:shrink-0",
277
+ {
278
+ variants: {
279
+ variant: {
280
+ primary: "bg-primary text-primary-foreground hover:bg-primary/90",
281
+ secondary: "border border-input bg-background text-foreground hover:bg-accent hover:border-ring",
282
+ tertiary: "text-foreground hover:bg-accent"
283
+ },
284
+ // Semantic action color. `neutral` (default) keeps the variant's own
285
+ // colors; the status tones apply a token-driven tonal fill (tinted
286
+ // surface + matching feedback text) that clears AA in BOTH light and dark
287
+ // because the fg/bg feedback token pair flips together per theme. Tone
288
+ // beats variant by tailwind-merge class-group replacement (ADR-030): cva
289
+ // emits tone classes after variant classes and the output is only ever
290
+ // rendered through `cn`, so each tone class replaces the variant class in
291
+ // its group. That holds only if a tone sets EVERY group a variant sets,
292
+ // hover fill and hover border included; a group the tone leaves out
293
+ // leaks the variant's class through (the reason the hover pair is here).
294
+ // A consumer `className` comes last and overrides tone the same way.
295
+ // Drives the destructive/status actions consumers previously kept on MUI.
296
+ tone: {
297
+ neutral: "",
298
+ danger: "border-transparent bg-feedback-bg-danger text-feedback-danger hover:bg-feedback-bg-danger hover:border-transparent hover:brightness-95 dark:hover:brightness-110",
299
+ success: "border-transparent bg-feedback-bg-success text-feedback-success hover:bg-feedback-bg-success hover:border-transparent hover:brightness-95 dark:hover:brightness-110",
300
+ warning: "border-transparent bg-feedback-bg-warning text-feedback-warning hover:bg-feedback-bg-warning hover:border-transparent hover:brightness-95 dark:hover:brightness-110",
301
+ info: "border-transparent bg-feedback-bg-info text-feedback-info hover:bg-feedback-bg-info hover:border-transparent hover:brightness-95 dark:hover:brightness-110"
302
+ },
303
+ size: {
304
+ sm: "h-8 px-3 hds-type-caption [&_svg]:size-3.5",
305
+ md: "h-10 px-4 py-2 hds-type-ui [&_svg]:size-4",
306
+ lg: "h-12 px-6 hds-type-ui [&_svg]:size-5"
307
+ },
308
+ iconOnly: {
309
+ true: "p-0",
310
+ false: ""
311
+ }
312
+ },
313
+ compoundVariants: [
314
+ { iconOnly: !0, size: "sm", className: "w-8" },
315
+ { iconOnly: !0, size: "md", className: "w-10" },
316
+ { iconOnly: !0, size: "lg", className: "w-12" }
317
+ ],
318
+ defaultVariants: {
319
+ variant: "secondary",
320
+ tone: "neutral",
321
+ size: "md",
322
+ iconOnly: !1
323
+ }
324
+ }
325
+ ), Ye = "data-[pressed=true]:border-transparent data-[pressed=true]:bg-primary data-[pressed=true]:text-primary-foreground data-[pressed=true]:hover:bg-primary/90";
326
+ let Y = !1, X = !1;
327
+ const Ft = /* @__PURE__ */ g.forwardRef(
328
+ function({
329
+ className: e,
330
+ variant: r,
331
+ tone: n,
332
+ size: a,
333
+ iconOnly: o = !1,
334
+ asChild: c = !1,
335
+ label: d,
336
+ loading: l = !1,
337
+ iconLeft: i,
338
+ iconRight: u,
339
+ disabled: p,
340
+ children: m,
341
+ type: b = "button",
342
+ pressed: f,
343
+ defaultPressed: x,
344
+ onPressedChange: v,
345
+ onClick: w,
346
+ ...C
347
+ }, _) {
348
+ const P = p || l, S = m ?? d, N = f !== void 0 || x !== void 0 || v !== void 0, [de, le] = g.useState(x ?? !1), O = f ?? de, B = N ? {
349
+ "aria-pressed": O,
350
+ "data-pressed": O ? "true" : "false",
351
+ onClick: (G) => {
352
+ w == null || w(G), !G.defaultPrevented && (f === void 0 && le(!O), v == null || v(!O));
353
+ }
354
+ } : { onClick: w }, ue = n != null && n !== "neutral", V = y(
355
+ Ue({ variant: r, tone: n, size: a, iconOnly: o }),
356
+ N && !ue && Ye,
357
+ e
358
+ );
359
+ return c ? /* @__PURE__ */ s(
360
+ pe,
361
+ {
362
+ ref: _,
363
+ className: V,
364
+ "aria-disabled": P || void 0,
365
+ "aria-busy": l || void 0,
366
+ "data-state": l ? "loading" : void 0,
367
+ "data-variant": r ?? void 0,
368
+ "data-tone": n ?? void 0,
369
+ "data-size": a ?? void 0,
370
+ ...B,
371
+ ...C,
372
+ children: m
373
+ }
374
+ ) : (o && !i && !l && !Y && L() && (Y = !0, console.warn(
375
+ "[Button] iconOnly renders only iconLeft; pass iconLeft (iconRight is hidden in iconOnly mode)."
376
+ )), o && !d && !C["aria-label"] && !C["aria-labelledby"] && !C.title && !X && L() && (X = !0, console.warn(
377
+ "[Button] iconOnly hides the label text, so the button has no accessible name; pass label (or aria-label / aria-labelledby)."
378
+ )), /* @__PURE__ */ k(
379
+ "button",
380
+ {
381
+ ref: _,
382
+ type: b,
383
+ disabled: P,
384
+ "aria-busy": l || void 0,
385
+ ...o && d ? { "aria-label": d } : {},
386
+ "data-state": l ? "loading" : void 0,
387
+ "data-variant": r ?? void 0,
388
+ "data-tone": n ?? void 0,
389
+ "data-size": a ?? void 0,
390
+ className: V,
391
+ ...B,
392
+ ...C,
393
+ children: [
394
+ l ? /* @__PURE__ */ s(ge, { className: "animate-spin", "aria-hidden": "true" }) : i,
395
+ !o && S,
396
+ !l && !o && u
397
+ ]
398
+ }
399
+ ));
400
+ }
401
+ ), Xe = /* @__PURE__ */ E("m-0 min-w-0", {
402
+ variants: {
403
+ variant: {
404
+ display: "hds-type-display",
405
+ title: "hds-type-title",
406
+ body: "hds-type-body max-w-[var(--semantic-typography-body-max-width)]",
407
+ ui: "hds-type-ui max-w-[var(--semantic-typography-ui-max-width)]",
408
+ caption: "hds-type-caption",
409
+ mono: "hds-type-mono max-w-[var(--semantic-typography-mono-max-width)]",
410
+ // Deprecated aliases, each the class string of the role it points at.
411
+ heading1: "hds-type-title",
412
+ heading2: "hds-type-title",
413
+ heading3: "hds-type-title",
414
+ technical: "hds-type-mono max-w-[var(--semantic-typography-mono-max-width)]",
415
+ eyebrow: "hds-type-caption",
416
+ badge: "hds-type-caption",
417
+ docLede: "hds-type-body max-w-[var(--semantic-typography-body-max-width)]",
418
+ docBody: "hds-type-body max-w-[var(--semantic-typography-body-max-width)]",
419
+ docSmall: "hds-type-ui max-w-[var(--semantic-typography-ui-max-width)]",
420
+ docCode: "hds-type-mono max-w-[var(--semantic-typography-mono-max-width)]"
421
+ }
422
+ }
423
+ }), Fe = {
424
+ display: "h1",
425
+ title: "h2",
426
+ body: "p",
427
+ ui: "p",
428
+ caption: "p",
429
+ mono: "span",
430
+ heading1: "h1",
431
+ heading2: "h2",
432
+ heading3: "h3",
433
+ technical: "p",
434
+ eyebrow: "p",
435
+ badge: "p",
436
+ docLede: "p",
437
+ docBody: "p",
438
+ docSmall: "p",
439
+ docCode: "span"
440
+ }, I = /* @__PURE__ */ me(function({ children: e, variant: r, as: n = Fe[r], className: a, style: o, ...c }, d) {
441
+ return /* @__PURE__ */ s(n, { ref: d, className: y(Xe({ variant: r }), a), style: o, ...c, children: e });
442
+ }), qe = {
443
+ component: "var(--semantic-space-surface-padding)",
444
+ item: "16px",
445
+ px16: "16px",
446
+ px24: "24px",
447
+ none: "0"
448
+ };
449
+ function Je(t) {
450
+ return qe[t] ?? "0";
451
+ }
452
+ const Qe = {
453
+ names: { ...h.space, ...M },
454
+ numbers: "raw"
455
+ }, Ze = /* @__PURE__ */ E("flex flex-col rounded-lg bg-card text-card-foreground", {
456
+ variants: {
457
+ variant: {
458
+ default: "border border-transparent",
459
+ // 1px transparent preserves the layout box
460
+ accent: "border-2 border-[var(--semantic-color-border-accent)]"
461
+ },
462
+ tone: {
463
+ neutral: "",
464
+ danger: "border border-[var(--semantic-color-feedback-error)]",
465
+ success: "border border-[var(--semantic-color-feedback-success)]",
466
+ warning: "border border-[var(--semantic-color-feedback-warning)]",
467
+ info: "border border-[var(--semantic-color-feedback-info)]"
468
+ },
469
+ bordered: {
470
+ true: "",
471
+ false: ""
472
+ }
473
+ },
474
+ compoundVariants: [
475
+ {
476
+ variant: "default",
477
+ tone: "neutral",
478
+ bordered: !0,
479
+ className: "border-[var(--semantic-color-border-default)]"
480
+ }
481
+ ],
482
+ defaultVariants: { variant: "default", tone: "neutral", bordered: !1 }
483
+ }), et = "cursor-pointer hds-focus data-[selected=true]:ring-2 data-[selected=true]:ring-inset data-[selected=true]:ring-ring", tt = 'a[href],button,input,select,textarea,label,summary,[contenteditable="true"],[tabindex],[role="button"],[role="link"],[role="checkbox"],[role="switch"],[role="option"],[role="menuitem"],[role="tab"]';
484
+ function rt(t) {
485
+ var r, n;
486
+ const e = (n = (r = t.target).closest) == null ? void 0 : n.call(r, tt);
487
+ return !!e && e !== t.currentTarget && t.currentTarget.contains(e);
488
+ }
489
+ const nt = /* @__PURE__ */ g.forwardRef(function({
490
+ className: e,
491
+ padding: r = "component",
492
+ gap: n = "tight",
493
+ noPadding: a = !1,
494
+ as: o,
495
+ style: c,
496
+ variant: d = "default",
497
+ tone: l = "neutral",
498
+ bordered: i = !1,
499
+ selectable: u = !1,
500
+ selected: p = !1,
501
+ onSelectedChange: m,
502
+ children: b,
503
+ ...f
504
+ }, x) {
505
+ const v = o ?? "div", w = a ? "none" : r, C = Je(w), _ = w === "none" ? "0" : $(n, Qe), P = u ? {
506
+ role: "checkbox",
507
+ "aria-checked": p,
508
+ tabIndex: 0,
509
+ "data-selected": p ? "true" : "false",
510
+ onClick: (S) => {
511
+ var N;
512
+ (N = f.onClick) == null || N.call(f, S), !S.defaultPrevented && !rt(S) && (m == null || m(!p));
513
+ },
514
+ onKeyDown: (S) => {
515
+ var N;
516
+ (N = f.onKeyDown) == null || N.call(f, S), !(S.defaultPrevented || S.key !== " " || S.target !== S.currentTarget) && (S.preventDefault(), m == null || m(!p));
517
+ }
518
+ } : {};
519
+ return /* @__PURE__ */ s(
520
+ v,
521
+ {
522
+ ref: x,
523
+ "data-padding": w,
524
+ "data-variant": d,
525
+ "data-tone": l,
526
+ "data-bordered": i ? "true" : "false",
527
+ className: y(
528
+ Ze({ variant: d, tone: l, bordered: i }),
529
+ u && et,
530
+ e
531
+ ),
532
+ style: {
533
+ padding: C,
534
+ gap: _,
535
+ ...c
536
+ },
537
+ ...f,
538
+ ...P,
539
+ children: b
540
+ }
541
+ );
542
+ }), at = /* @__PURE__ */ g.forwardRef(
543
+ function({ className: e, metadata: r, children: n, ...a }, o) {
544
+ return r !== void 0 ? /* @__PURE__ */ k("div", { ref: o, className: y("flex flex-col gap-3 p-6", e), ...a, children: [
545
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: r }),
546
+ /* @__PURE__ */ s("div", { className: "flex flex-col space-y-1.5 min-w-0", children: n })
547
+ ] }) : /* @__PURE__ */ s("div", { ref: o, className: y("flex flex-col space-y-1.5 p-6", e), ...a, children: n });
548
+ }
549
+ ), ot = /* @__PURE__ */ g.forwardRef(function({ className: e, children: r, ...n }, a) {
550
+ return /* @__PURE__ */ s(I, { ref: a, as: "h3", variant: "title", className: e, ...n, children: r });
551
+ }), st = /* @__PURE__ */ g.forwardRef(function({ className: e, children: r, ...n }, a) {
552
+ return /* @__PURE__ */ s(I, { ref: a, variant: "caption", className: y("text-muted-foreground", e), ...n, children: r });
553
+ }), it = /* @__PURE__ */ g.forwardRef(function({ className: e, ...r }, n) {
554
+ return /* @__PURE__ */ s("div", { ref: n, className: y("p-6 pt-0", e), ...r });
555
+ }), ct = /* @__PURE__ */ g.forwardRef(function({ className: e, ...r }, n) {
556
+ return /* @__PURE__ */ s("div", { ref: n, className: y("flex items-center p-6 pt-0", e), ...r });
557
+ }), dt = {
558
+ neutral: "var(--semantic-color-content-accent)",
559
+ info: "var(--semantic-color-feedback-info)",
560
+ success: "var(--semantic-color-feedback-success)",
561
+ warning: "var(--semantic-color-feedback-warning)",
562
+ danger: "var(--semantic-color-feedback-error)"
563
+ }, lt = /* @__PURE__ */ g.forwardRef(
564
+ function({ className: e, value: r, max: n = 100, label: a, tone: o = "neutral", style: c, ...d }, l) {
565
+ const i = Math.max(0, Math.min(r, n)), u = n > 0 ? i / n * 100 : 0;
566
+ return /* @__PURE__ */ k(
567
+ "div",
568
+ {
569
+ ref: l,
570
+ className: y("px-6 pb-2", e),
571
+ style: c,
572
+ ...d,
573
+ children: [
574
+ /* @__PURE__ */ s(
575
+ "div",
576
+ {
577
+ role: "progressbar",
578
+ "aria-valuemin": 0,
579
+ "aria-valuemax": n,
580
+ "aria-valuenow": i,
581
+ "aria-label": typeof a == "string" ? a : "Progress",
582
+ style: {
583
+ height: "4px",
584
+ background: "var(--semantic-color-border-default)",
585
+ borderRadius: h.borderRadius[2],
586
+ overflow: "hidden"
587
+ },
588
+ children: /* @__PURE__ */ s(
589
+ "div",
590
+ {
591
+ style: {
592
+ height: "100%",
593
+ width: "100%",
594
+ transform: `scaleX(${u / 100})`,
595
+ transformOrigin: "left",
596
+ background: dt[o],
597
+ borderRadius: h.borderRadius[2],
598
+ transition: `transform ${h.motion.expressive.duration}s ease-out`
599
+ }
600
+ }
601
+ )
602
+ }
603
+ ),
604
+ a !== void 0 && /* @__PURE__ */ s(
605
+ "p",
606
+ {
607
+ style: {
608
+ ...h.typeStyles.caption,
609
+ margin: "6px 0 0",
610
+ color: "var(--semantic-color-content-secondary)"
611
+ },
612
+ children: a
613
+ }
614
+ )
615
+ ]
616
+ }
617
+ );
618
+ }
619
+ ), ut = {
620
+ neutral: "var(--semantic-color-content-primary)",
621
+ info: "var(--semantic-color-feedback-info)",
622
+ success: "var(--semantic-color-feedback-success)",
623
+ warning: "var(--semantic-color-feedback-warning)",
624
+ danger: "var(--semantic-color-feedback-error)"
625
+ }, mt = /* @__PURE__ */ g.forwardRef(
626
+ function({ className: e, label: r, value: n, sub: a, tone: o = "neutral", style: c, ...d }, l) {
627
+ return /* @__PURE__ */ k("div", { ref: l, className: y("flex flex-col px-6", e), style: c, ...d, children: [
628
+ /* @__PURE__ */ s(
629
+ "p",
630
+ {
631
+ style: {
632
+ ...h.typeStyles.caption,
633
+ margin: "0 0 6px",
634
+ color: "var(--semantic-color-content-secondary)"
635
+ },
636
+ children: r
637
+ }
638
+ ),
639
+ /* @__PURE__ */ s(
640
+ "p",
641
+ {
642
+ style: {
643
+ ...h.typeStyles.title,
644
+ margin: 0,
645
+ color: ut[o]
646
+ },
647
+ children: n
648
+ }
649
+ ),
650
+ a !== void 0 && /* @__PURE__ */ s(
651
+ "p",
652
+ {
653
+ style: {
654
+ ...h.typeStyles.caption,
655
+ margin: "4px 0 0",
656
+ color: "var(--semantic-color-content-secondary)"
657
+ },
658
+ children: a
659
+ }
660
+ )
661
+ ] });
662
+ }
663
+ ), qt = /* @__PURE__ */ Object.assign(nt, {
664
+ Header: at,
665
+ Title: ot,
666
+ Description: st,
667
+ Body: it,
668
+ Footer: ct,
669
+ Progress: lt,
670
+ Metric: mt,
671
+ // Set here, not by a later `Card.displayName = …` write: a top-level
672
+ // property write is a side effect that keeps the module alive (hds#363).
673
+ displayName: "Card"
674
+ }), ft = {
675
+ content: "var(--semantic-layout-width-content)",
676
+ max: "var(--semantic-layout-width-max)"
677
+ };
678
+ function Jt({
679
+ children: t,
680
+ maxWidth: e = "max",
681
+ padding: r = "var(--semantic-space-surface-padding)",
682
+ style: n,
683
+ className: a
684
+ }) {
685
+ const o = {
686
+ marginLeft: "auto",
687
+ marginRight: "auto",
688
+ maxWidth: ft[e],
689
+ ...n
690
+ };
691
+ return /* @__PURE__ */ s("div", { className: a, style: o, children: t });
692
+ }
693
+ const ae = /* @__PURE__ */ g.createContext({}), oe = /* @__PURE__ */ g.createContext(null);
694
+ function pt() {
695
+ return g.useContext(oe);
696
+ }
697
+ function Qt() {
698
+ return g.useContext(ae);
699
+ }
700
+ function Zt({
701
+ theme: t,
702
+ density: e,
703
+ brand: r,
704
+ fontFamily: n,
705
+ fontFamilyMono: a,
706
+ as: o = "div",
707
+ className: c,
708
+ style: d,
709
+ children: l
710
+ }) {
711
+ const i = g.useMemo(
712
+ () => ({ theme: t, density: e, brand: r, fontFamily: n, fontFamilyMono: a }),
713
+ [t, e, r, n, a]
714
+ ), [u, p] = g.useState(null), m = {};
715
+ return n && (m["--hds-font-family"] = n), a && (m["--hds-font-family-mono"] = a), /* @__PURE__ */ s(ae.Provider, { value: i, children: /* @__PURE__ */ s(oe.Provider, { value: u, children: /* @__PURE__ */ s(
716
+ o,
717
+ {
718
+ ref: p,
719
+ "data-hds": "",
720
+ "data-theme": t === "dark" ? "dark" : void 0,
721
+ "data-density": e === "compact" ? "compact" : void 0,
722
+ "data-brand": r,
723
+ "data-tenant": r,
724
+ className: c,
725
+ style: { ...m, ...d },
726
+ children: l
727
+ }
728
+ ) }) });
729
+ }
730
+ const gt = typeof document > "u" ? g.useEffect : g.useLayoutEffect;
731
+ function F(t) {
732
+ return t === document.documentElement || t === document.body;
733
+ }
734
+ function ht(t) {
735
+ const e = pt(), r = g.useRef(null), [n, a] = g.useState(void 0), o = t === void 0 && e === null;
736
+ gt(() => {
737
+ var l;
738
+ if (!o) return;
739
+ const d = ((l = r.current) == null ? void 0 : l.closest("[data-hds]")) ?? null;
740
+ a(d && !F(d) ? d : null);
741
+ }, [o]);
742
+ const c = o ? /* @__PURE__ */ s("span", { ref: r, hidden: !0, "aria-hidden": "true", "data-hds-portal-anchor": "" }) : null;
743
+ return t !== void 0 ? { ready: !0, container: t ?? void 0, anchor: c } : e ? { ready: !0, container: F(e) ? void 0 : e, anchor: c } : n === void 0 ? { ready: !1, container: void 0, anchor: c } : { ready: !0, container: n ?? void 0, anchor: c };
744
+ }
745
+ function se(t) {
746
+ function e(r) {
747
+ const { ready: n, container: a, anchor: o } = ht(
748
+ r.container
749
+ );
750
+ return /* @__PURE__ */ k(fe, { children: [
751
+ o,
752
+ n && typeof document < "u" ? /* @__PURE__ */ s(t, { ...r, container: a }) : null
753
+ ] });
754
+ }
755
+ return e.displayName = `HdsPortal(${t.displayName ?? "Portal"})`, e;
756
+ }
757
+ const er = /* @__PURE__ */ se(function({
758
+ container: e,
759
+ children: r
760
+ }) {
761
+ return be(r, e ?? document.body);
762
+ }), yt = /* @__PURE__ */ T.forwardRef(function({ children: e, colSpan: r, colOffset: n, style: a, className: o, as: c = "div" }, d) {
763
+ const l = {
764
+ ...r !== void 0 && { gridColumn: `span min(var(--current-cols, 12), ${r})` },
765
+ ...n !== void 0 && { gridColumnStart: n },
766
+ minWidth: 0,
767
+ ...a
768
+ };
769
+ return /* @__PURE__ */ s(c, { ref: d, className: o, style: l, "data-hds-grid-item": "true", children: e });
770
+ }), vt = {
771
+ start: "start",
772
+ center: "center",
773
+ end: "end",
774
+ stretch: "stretch"
775
+ }, q = "280px";
776
+ function bt(t, e) {
777
+ return t <= h.breakpoints.sm ? Math.min(4, e) : t <= h.breakpoints.lg ? Math.min(8, e) : e;
778
+ }
779
+ const xt = /* @__PURE__ */ T.forwardRef(function({
780
+ children: e,
781
+ layout: r = "fixed",
782
+ minItemWidth: n,
783
+ columns: a = 12,
784
+ gap: o = "inset",
785
+ subgrid: c = !1,
786
+ style: d,
787
+ className: l,
788
+ align: i = "start",
789
+ as: u = "div",
790
+ ...p
791
+ }, m) {
792
+ const b = r === "fixed" && !c, [f, x] = Q(a);
793
+ Z(() => {
794
+ if (!b || typeof window > "u") return;
795
+ const C = () => {
796
+ x(bt(window.innerWidth, a));
797
+ };
798
+ return C(), window.addEventListener("resize", C), () => {
799
+ window.removeEventListener("resize", C);
800
+ };
801
+ }, [a, b]);
802
+ let v;
803
+ c ? v = "subgrid" : r === "auto-fit" && n === void 0 ? v = `repeat(auto-fit, minmax(${q}, 1fr))` : r === "auto-fit" || r === "auto-fill" ? v = `repeat(${r}, minmax(min(${n ?? q}, 100%), 1fr))` : v = `repeat(${f}, minmax(0, 1fr))`;
804
+ const w = {
805
+ display: "grid",
806
+ alignItems: vt[i],
807
+ ...v !== void 0 && { gridTemplateColumns: v },
808
+ ...b && {
809
+ "--current-cols": String(f)
810
+ },
811
+ gap: $(o, De),
812
+ ...d
813
+ };
814
+ return /* @__PURE__ */ s(
815
+ u,
816
+ {
817
+ ...p,
818
+ ref: m,
819
+ className: l,
820
+ style: w,
821
+ "data-hds-grid": "true",
822
+ "data-hds-component": "Grid",
823
+ "data-hds-metrics": `gap:${o}`,
824
+ children: e
825
+ }
826
+ );
827
+ }), tr = /* @__PURE__ */ Object.assign(xt, { Item: yt }), wt = {
828
+ start: "flex-start",
829
+ center: "center",
830
+ end: "flex-end",
831
+ stretch: "stretch"
832
+ }, St = {
833
+ start: "flex-start",
834
+ center: "center",
835
+ end: "flex-end",
836
+ "space-between": "space-between"
837
+ }, kt = {
838
+ names: {
839
+ ...h.space,
840
+ ...M,
841
+ gap: R.xs,
842
+ medium: "var(--semantic-space-component-medium)",
843
+ hairline: "var(--semantic-space-subgrid-hairline)",
844
+ xs: "var(--semantic-space-subgrid-xs)",
845
+ stack: "var(--semantic-space-section-stack)"
846
+ },
847
+ numbers: "raw"
848
+ }, rr = /* @__PURE__ */ T.forwardRef(function({
849
+ children: e,
850
+ direction: r = "column",
851
+ gap: n = "tight",
852
+ align: a,
853
+ justify: o,
854
+ wrap: c,
855
+ className: d,
856
+ style: l,
857
+ as: i = "div"
858
+ }, u) {
859
+ return /* @__PURE__ */ s(
860
+ i,
861
+ {
862
+ ref: u,
863
+ className: d,
864
+ "data-hds-component": "Stack",
865
+ "data-hds-metrics": `gap:${n}`,
866
+ style: {
867
+ display: "flex",
868
+ flexDirection: r,
869
+ gap: $(n, kt),
870
+ alignItems: a ? wt[a] : r === "row" ? "stretch" : void 0,
871
+ justifyContent: o ? St[o] : void 0,
872
+ flexWrap: c,
873
+ ...l
874
+ },
875
+ children: e
876
+ }
877
+ );
878
+ }), Ct = /* @__PURE__ */ E(
879
+ "box-border border-none rounded-lg bg-[color:var(--semantic-color-surface-raised)] text-[color:var(--semantic-color-content-primary)]",
880
+ {
881
+ variants: {
882
+ padding: {
883
+ component: "p-[var(--semantic-space-surface-padding)]",
884
+ // spacing-ok: 16px/24px are the surface's fixed inset contract (not layout spacing); kept as the legacy values these named options have always resolved to
885
+ item: "p-[16px]",
886
+ px16: "p-[16px]",
887
+ px24: "p-[24px]",
888
+ none: "p-0"
889
+ },
890
+ shadow: {
891
+ // ADR-007: bind to the elevation-role token (raised) instead of a magic
892
+ // RGBA value. Resolves to --semantic-shadow-subtle; theme-aware.
893
+ true: "shadow-[var(--semantic-elevation-raised-shadow)]",
894
+ false: ""
895
+ }
896
+ },
897
+ defaultVariants: { padding: "component", shadow: !1 }
898
+ }
899
+ ), At = /* @__PURE__ */ T.forwardRef(
900
+ function({
901
+ children: e,
902
+ padding: r = "component",
903
+ shadow: n = !1,
904
+ overflow: a,
905
+ theme: o,
906
+ style: c,
907
+ className: d,
908
+ as: l = "div",
909
+ ...i
910
+ }, u) {
911
+ const p = a !== void 0 || c ? { ...a !== void 0 && { overflow: a }, ...c } : void 0;
912
+ return /* @__PURE__ */ s(
913
+ l,
914
+ {
915
+ ref: u,
916
+ "data-theme": o,
917
+ className: y(Ct({ padding: r, shadow: n }), d),
918
+ style: p,
919
+ "data-hds-surface": "true",
920
+ "data-hds-component": "Surface",
921
+ "data-hds-metrics": `padding:${r}`,
922
+ ...i,
923
+ children: e
924
+ }
925
+ );
926
+ }
927
+ ), J = /* @__PURE__ */ E(
928
+ "flex items-center bg-[var(--semantic-color-surface-overlay)] px-[var(--semantic-space-surface-padding)]",
929
+ {
930
+ variants: {
931
+ align: {
932
+ left: "justify-start text-left",
933
+ center: "justify-center text-center",
934
+ right: "justify-end text-right"
935
+ },
936
+ density: {
937
+ follow: "min-h-[var(--semantic-size-row-comfortable)] py-[var(--semantic-space-component-medium)] [[data-density=compact]_&]:min-h-[var(--semantic-size-row-compact)] [[data-density=compact]_&]:py-[var(--semantic-space-scale-xs)]",
938
+ comfortable: "min-h-[var(--semantic-size-row-comfortable)] py-[var(--semantic-space-component-medium)]",
939
+ compact: "min-h-[var(--semantic-size-row-compact)] py-[var(--semantic-space-scale-xs)]"
940
+ },
941
+ sticky: {
942
+ true: "sticky top-0 z-[var(--semantic-zIndex-sticky)]",
943
+ false: ""
944
+ }
945
+ },
946
+ defaultVariants: { align: "left", sticky: !1 }
947
+ }
948
+ ), Nt = /* @__PURE__ */ E(
949
+ "flex w-full cursor-pointer items-center gap-[var(--semantic-space-scale-xs)] border-0 bg-transparent p-0 text-inherit [font:inherit] transition-colors duration-[var(--hds-motion-productive-duration)] ease-[var(--hds-motion-productive-easing)] hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
950
+ {
951
+ variants: {
952
+ align: {
953
+ left: "justify-start",
954
+ center: "justify-center",
955
+ right: "justify-end"
956
+ }
957
+ },
958
+ defaultVariants: { align: "left" }
959
+ }
960
+ ), Et = /* @__PURE__ */ E(
961
+ "flex items-start px-[var(--semantic-space-surface-padding)]",
962
+ {
963
+ variants: {
964
+ align: {
965
+ left: "justify-start text-left",
966
+ center: "justify-center text-center",
967
+ right: "justify-end text-right"
968
+ },
969
+ density: {
970
+ follow: "min-h-[var(--semantic-size-row-comfortable)] py-[var(--semantic-space-component-medium)] [[data-density=compact]_&]:min-h-[var(--semantic-size-row-compact)] [[data-density=compact]_&]:py-[var(--semantic-space-scale-xs)]",
971
+ comfortable: "min-h-[var(--semantic-size-row-comfortable)] py-[var(--semantic-space-component-medium)]",
972
+ compact: "min-h-[var(--semantic-size-row-compact)] py-[var(--semantic-space-scale-xs)]"
973
+ },
974
+ divider: {
975
+ true: "[border-bottom:var(--semantic-borderWidth-default)_solid_var(--semantic-color-border-subdued)]",
976
+ false: ""
977
+ }
978
+ },
979
+ defaultVariants: { align: "left", divider: !0 }
980
+ }
981
+ ), Rt = {
982
+ label: h.typeStyles.ui,
983
+ value: h.typeStyles.ui,
984
+ description: {
985
+ ...h.typeStyles.caption,
986
+ color: "var(--semantic-color-content-secondary)"
987
+ },
988
+ token: h.typeStyles.mono,
989
+ code: h.typeStyles.mono,
990
+ custom: h.typeStyles.ui,
991
+ icon: h.typeStyles.caption,
992
+ badge: h.typeStyles.caption,
993
+ action: h.typeStyles.ui
994
+ };
995
+ function nr({
996
+ columns: t,
997
+ rows: e,
998
+ caption: r,
999
+ captionAction: n,
1000
+ description: a,
1001
+ labelledBy: o,
1002
+ minWidth: c,
1003
+ density: d,
1004
+ flush: l = !0,
1005
+ stickyHeader: i = !1
1006
+ }) {
1007
+ const u = H(), p = H(), m = !!r, b = m ? u : o;
1008
+ return /* @__PURE__ */ k("div", { className: "min-w-0 max-w-full", children: [
1009
+ r || a ? /* @__PURE__ */ k("div", { children: [
1010
+ r ? /* @__PURE__ */ k("div", { className: "flex items-center justify-between", children: [
1011
+ /* @__PURE__ */ s(
1012
+ "div",
1013
+ {
1014
+ id: m ? u : void 0,
1015
+ className: "m-0 text-primary",
1016
+ style: h.typeStyles.ui,
1017
+ children: r
1018
+ }
1019
+ ),
1020
+ n ?? null
1021
+ ] }) : null,
1022
+ a ? /* @__PURE__ */ s("div", { className: "text-secondary", style: h.typeStyles.ui, children: a }) : null
1023
+ ] }) : null,
1024
+ /* @__PURE__ */ s(
1025
+ At,
1026
+ {
1027
+ padding: l ? "none" : "component",
1028
+ id: p,
1029
+ role: "region",
1030
+ tabIndex: 0,
1031
+ "aria-labelledby": m ? u : o ? `${o} ${p}` : void 0,
1032
+ "aria-label": m ? void 0 : "Scrollable table content",
1033
+ style: { overflowX: "auto", overflowY: "visible" },
1034
+ children: /* @__PURE__ */ k(
1035
+ "div",
1036
+ {
1037
+ role: "table",
1038
+ "aria-labelledby": b,
1039
+ className: "grid",
1040
+ style: {
1041
+ minWidth: c,
1042
+ gridTemplateColumns: t.map((f) => f.width ?? "minmax(0, 1fr)").join(" ")
1043
+ },
1044
+ children: [
1045
+ /* @__PURE__ */ s("div", { role: "row", style: { display: "contents" }, children: t.map((f) => {
1046
+ if (!f.sortable)
1047
+ return /* @__PURE__ */ s(
1048
+ "div",
1049
+ {
1050
+ role: "columnheader",
1051
+ className: y(
1052
+ J({
1053
+ align: f.align ?? "left",
1054
+ density: d ?? "follow",
1055
+ sticky: !!i
1056
+ })
1057
+ ),
1058
+ style: h.typeStyles.caption,
1059
+ children: f.label
1060
+ },
1061
+ f.key
1062
+ );
1063
+ const x = f.sortDirection ?? "none", v = x === "ascending" ? he : x === "descending" ? ye : ve;
1064
+ return /* @__PURE__ */ s(
1065
+ "div",
1066
+ {
1067
+ role: "columnheader",
1068
+ "aria-sort": x,
1069
+ className: y(
1070
+ J({
1071
+ align: f.align ?? "left",
1072
+ density: d ?? "follow",
1073
+ sticky: !!i
1074
+ })
1075
+ ),
1076
+ style: h.typeStyles.caption,
1077
+ children: /* @__PURE__ */ k(
1078
+ "button",
1079
+ {
1080
+ type: "button",
1081
+ onClick: f.onSort,
1082
+ className: y(Nt({ align: f.align ?? "left" })),
1083
+ children: [
1084
+ f.label,
1085
+ /* @__PURE__ */ s(Ce, { icon: v, size: "small", "aria-hidden": !0 })
1086
+ ]
1087
+ }
1088
+ )
1089
+ },
1090
+ f.key
1091
+ );
1092
+ }) }),
1093
+ e.map((f, x) => /* @__PURE__ */ s("div", { role: "row", style: { display: "contents" }, children: f.cells.map((v, w) => /* @__PURE__ */ s(
1094
+ "div",
1095
+ {
1096
+ role: "cell",
1097
+ className: y(
1098
+ Et({
1099
+ align: v.align ?? "left",
1100
+ density: d ?? "follow",
1101
+ divider: x < e.length - 1
1102
+ })
1103
+ ),
1104
+ style: Rt[v.slot],
1105
+ children: v.content
1106
+ },
1107
+ `${f.key ?? x}-${w}`
1108
+ )) }, f.key ?? x))
1109
+ ]
1110
+ }
1111
+ )
1112
+ }
1113
+ )
1114
+ ] });
1115
+ }
1116
+ function Dt(t) {
1117
+ return /* @__PURE__ */ s(A.Root, { ...t });
1118
+ }
1119
+ const Tt = A.Trigger, ie = /* @__PURE__ */ se(A.Portal), _t = A.Action, Pt = A.Cancel, ce = /* @__PURE__ */ g.forwardRef(function({ className: e, ...r }, n) {
1120
+ return /* @__PURE__ */ s(
1121
+ A.Overlay,
1122
+ {
1123
+ ref: n,
1124
+ className: y("fixed inset-0 z-50 bg-scrim/60 backdrop-blur-sm", e),
1125
+ ...r
1126
+ }
1127
+ );
1128
+ }), Ot = /* @__PURE__ */ g.forwardRef(function({ className: e, container: r, ...n }, a) {
1129
+ return /* @__PURE__ */ k(ie, { container: r, children: [
1130
+ /* @__PURE__ */ s(ce, {}),
1131
+ /* @__PURE__ */ s(
1132
+ A.Content,
1133
+ {
1134
+ ref: a,
1135
+ className: y(
1136
+ // 16px of page margin each side, so the panel never sits flush to a 390px viewport (hds#522)
1137
+ "fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2*var(--semantic-space-scale-sm))] max-h-[calc(100dvh-2*var(--semantic-space-scale-sm))] max-w-lg overflow-y-auto -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border border-border bg-popover p-6 text-popover-foreground shadow-overlay hds-focus",
1138
+ e
1139
+ ),
1140
+ ...n
1141
+ }
1142
+ )
1143
+ ] });
1144
+ }), $t = /* @__PURE__ */ g.forwardRef(function({ className: e, ...r }, n) {
1145
+ return /* @__PURE__ */ s("div", { ref: n, className: y("flex flex-col space-y-1.5 text-left", e), ...r });
1146
+ }), It = /* @__PURE__ */ g.forwardRef(function({ className: e, ...r }, n) {
1147
+ return /* @__PURE__ */ s(
1148
+ "div",
1149
+ {
1150
+ ref: n,
1151
+ className: y("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-2", e),
1152
+ ...r
1153
+ }
1154
+ );
1155
+ }), Lt = /* @__PURE__ */ g.forwardRef(function({ className: e, children: r, ...n }, a) {
1156
+ return /* @__PURE__ */ s(A.Title, { asChild: !0, children: /* @__PURE__ */ s(I, { ref: a, as: "h2", variant: "title", className: e, ...n, children: r }) });
1157
+ }), jt = /* @__PURE__ */ g.forwardRef(function({ className: e, children: r, ...n }, a) {
1158
+ return /* @__PURE__ */ s(A.Description, { asChild: !0, children: /* @__PURE__ */ s(
1159
+ I,
1160
+ {
1161
+ ref: a,
1162
+ as: "p",
1163
+ variant: "caption",
1164
+ className: y("text-muted-foreground", e),
1165
+ ...n,
1166
+ children: r
1167
+ }
1168
+ ) });
1169
+ }), ar = /* @__PURE__ */ Object.assign(Dt, {
1170
+ Trigger: Tt,
1171
+ Portal: ie,
1172
+ Overlay: ce,
1173
+ Content: Ot,
1174
+ Header: $t,
1175
+ Footer: It,
1176
+ Title: Lt,
1177
+ Description: jt,
1178
+ Action: _t,
1179
+ Cancel: Pt,
1180
+ // Set here, not by a later `AlertDialog.displayName = …` write: a top-level
1181
+ // property write is a side effect that keeps the module alive.
1182
+ displayName: "AlertDialog"
1183
+ }), or = /* @__PURE__ */ g.forwardRef(
1184
+ function({ title: e, description: r, className: n }, a) {
1185
+ return /* @__PURE__ */ k(
1186
+ "div",
1187
+ {
1188
+ ref: a,
1189
+ "data-hds-component": "EmptyState",
1190
+ className: y("flex flex-col gap-1 hds-type-ui italic text-muted-foreground", n),
1191
+ children: [
1192
+ /* @__PURE__ */ s("p", { className: "m-0", children: e }),
1193
+ r && /* @__PURE__ */ s("p", { className: "m-0 not-italic hds-type-caption", children: r })
1194
+ ]
1195
+ }
1196
+ );
1197
+ }
1198
+ );
1199
+ export {
1200
+ ar as A,
1201
+ Ft as B,
1202
+ Jt as C,
1203
+ or as E,
1204
+ tr as G,
1205
+ Zt as H,
1206
+ Ce as I,
1207
+ De as L,
1208
+ rr as S,
1209
+ I as T,
1210
+ At as a,
1211
+ qt as b,
1212
+ nr as c,
1213
+ Xt as d,
1214
+ it as e,
1215
+ st as f,
1216
+ ct as g,
1217
+ er as h,
1218
+ re as i,
1219
+ at as j,
1220
+ mt as k,
1221
+ lt as l,
1222
+ ot as m,
1223
+ Qt as n,
1224
+ $ as r,
1225
+ Yt as u,
1226
+ se as w
1227
+ };