@wealth-os/design-system 0.1.0 → 0.2.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.
package/dist/index.js CHANGED
@@ -1,39 +1,39 @@
1
1
  /* empty css */
2
- import { t as e } from "./utils-CX-Pz5p6.js";
3
- import { n as t, t as n } from "./button-MVZPcSXf.js";
4
- import { i as r, n as i, r as a, t as o } from "./form-D3G5306m.js";
5
- import { n as s, t as c } from "./notice-D5u9rkFU.js";
6
- import { C as l, S as u, _ as d, a as f, b as p, c as m, d as h, f as g, g as _, h as v, i as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, x as A, y as j } from "./data-display-BA7t1E4G.js";
7
- import * as M from "react";
8
- import { cva as N } from "class-variance-authority";
9
- import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
2
+ import { n as e, r as t, t as n } from "./button-yvMc7CT-.js";
3
+ import { t as r } from "./utils-CX-Pz5p6.js";
4
+ import { i, n as a, r as o, t as s } from "./form-Csxly6Es.js";
5
+ import { n as c, t as l } from "./notice-jbY9FQu_.js";
6
+ import { C as u, S as d, _ as f, a as p, b as m, c as h, d as g, f as _, g as v, h as y, i as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, u as k, v as A, x as j, y as M } from "./data-display-BA7t1E4G.js";
7
+ import * as N from "react";
8
+ import { cva as P } from "class-variance-authority";
9
+ import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
10
10
  //#region src/components/icon-button.tsx
11
- var L = M.forwardRef(({ label: e, icon: t, size: r = "md", ...i }, a) => /* @__PURE__ */ F(n, {
11
+ var R = N.forwardRef(({ label: e, icon: t, size: r = "md", ...i }, a) => /* @__PURE__ */ I(n, {
12
12
  ...i,
13
13
  ref: a,
14
14
  size: r === "sm" ? "icon-sm" : r === "lg" ? "icon-lg" : "icon",
15
15
  "aria-label": e,
16
- children: /* @__PURE__ */ F("span", {
16
+ children: /* @__PURE__ */ I("span", {
17
17
  "aria-hidden": "true",
18
18
  className: "inline-flex items-center justify-center",
19
19
  children: t
20
20
  })
21
21
  }));
22
- L.displayName = "IconButton";
22
+ R.displayName = "IconButton";
23
23
  //#endregion
24
24
  //#region src/components/button-group.tsx
25
- var R = M.forwardRef(({ orientation: t = "horizontal", className: n, children: r, ...i }, a) => /* @__PURE__ */ F("div", {
25
+ var z = N.forwardRef(({ orientation: e = "horizontal", className: t, children: n, ...i }, a) => /* @__PURE__ */ I("div", {
26
26
  ...i,
27
27
  ref: a,
28
28
  role: "group",
29
- "data-orientation": t,
30
- className: e("inline-flex gap-2", t === "horizontal" ? "flex-row flex-wrap items-center" : "flex-col items-stretch", n),
31
- children: r
29
+ "data-orientation": e,
30
+ className: r("inline-flex gap-2", e === "horizontal" ? "flex-row flex-wrap items-center" : "flex-col items-stretch", t),
31
+ children: n
32
32
  }));
33
- R.displayName = "ButtonGroup";
33
+ z.displayName = "ButtonGroup";
34
34
  //#endregion
35
35
  //#region src/components/icons.tsx
36
- function z({ name: e, size: t = 16, strokeWidth: n = 1.75, className: r }) {
36
+ function B({ name: e, size: t = 16, strokeWidth: n = 1.75, className: r }) {
37
37
  let i = {
38
38
  fill: "none",
39
39
  stroke: "currentColor",
@@ -41,43 +41,43 @@ function z({ name: e, size: t = 16, strokeWidth: n = 1.75, className: r }) {
41
41
  strokeLinecap: "round",
42
42
  strokeLinejoin: "round"
43
43
  }, a = {
44
- check: /* @__PURE__ */ F("path", {
44
+ check: /* @__PURE__ */ I("path", {
45
45
  ...i,
46
46
  d: "M12.5 4 6.5 10 3.5 7"
47
47
  }),
48
- "chevron-down": /* @__PURE__ */ F("path", {
48
+ "chevron-down": /* @__PURE__ */ I("path", {
49
49
  ...i,
50
50
  d: "m4 6 4 4 4-4"
51
51
  }),
52
- "chevron-left": /* @__PURE__ */ F("path", {
52
+ "chevron-left": /* @__PURE__ */ I("path", {
53
53
  ...i,
54
54
  d: "m9 4-4 4 4 4"
55
55
  }),
56
- "chevron-right": /* @__PURE__ */ F("path", {
56
+ "chevron-right": /* @__PURE__ */ I("path", {
57
57
  ...i,
58
58
  d: "m7 4 4 4-4 4"
59
59
  }),
60
- "chevrons-left": /* @__PURE__ */ F("path", {
60
+ "chevrons-left": /* @__PURE__ */ I("path", {
61
61
  ...i,
62
62
  d: "m10 4-4 4 4 4M6 4 2 8l4 4"
63
63
  }),
64
- "chevrons-right": /* @__PURE__ */ F("path", {
64
+ "chevrons-right": /* @__PURE__ */ I("path", {
65
65
  ...i,
66
66
  d: "m6 4 4 4-4 4m4-8 4 4-4 4"
67
67
  }),
68
- calendar: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("rect", {
68
+ calendar: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("rect", {
69
69
  ...i,
70
70
  x: "2",
71
71
  y: "3",
72
72
  width: "12",
73
73
  height: "11",
74
74
  rx: "2"
75
- }), /* @__PURE__ */ F("path", {
75
+ }), /* @__PURE__ */ I("path", {
76
76
  ...i,
77
77
  d: "M5 1.5v3M11 1.5v3M2 6.5h12"
78
78
  })] })
79
79
  };
80
- return /* @__PURE__ */ F("svg", {
80
+ return /* @__PURE__ */ I("svg", {
81
81
  "aria-hidden": "true",
82
82
  className: r,
83
83
  width: t,
@@ -88,69 +88,71 @@ function z({ name: e, size: t = 16, strokeWidth: n = 1.75, className: r }) {
88
88
  }
89
89
  //#endregion
90
90
  //#region src/components/text-input.tsx
91
- var B = M.forwardRef(({ className: t, type: n = "text", invalid: r, "aria-invalid": i, ...a }, o) => /* @__PURE__ */ F("input", {
91
+ var V = N.forwardRef(({ className: e, type: n = "text", invalid: i, density: a, "aria-invalid": o, ...s }, c) => /* @__PURE__ */ I("input", {
92
92
  type: n,
93
- className: e("wos-field block", t),
94
- "aria-invalid": r || i || void 0,
95
- ref: o,
96
- ...a
93
+ "data-density": a,
94
+ className: r("wos-field block", t(a), e),
95
+ "aria-invalid": i || o || void 0,
96
+ ref: c,
97
+ ...s
97
98
  }));
98
- B.displayName = "TextInput";
99
+ V.displayName = "TextInput";
99
100
  //#endregion
100
101
  //#region src/components/number-input.tsx
101
- var V = M.forwardRef(({ label: t, value: n, onChange: r, help: i, error: o, invalid: s, disabled: c, placeholder: l, inputMode: u = "decimal", prefix: d, suffix: f, format: p, className: m, inputClassName: h, id: g, name: _, inputRef: v, onBlur: y, "aria-describedby": b, ...x }, S) => {
102
- let C = M.useId(), w = g ?? C, T = [
103
- b,
104
- i ? `${w}-help` : void 0,
105
- o ? `${w}-error` : void 0
106
- ].filter(Boolean).join(" ") || void 0, E = (e) => {
107
- re(S, e), re(v, e);
102
+ var H = N.forwardRef(({ label: e, value: n, onChange: i, density: a, help: s, error: c, invalid: l, disabled: u, placeholder: d, inputMode: f = "decimal", prefix: p, suffix: m, format: h, className: g, inputClassName: _, id: v, name: y, inputRef: b, onBlur: x, "aria-describedby": S, ...C }, w) => {
103
+ let T = N.useId(), E = v ?? T, D = [
104
+ S,
105
+ s ? `${E}-help` : void 0,
106
+ c ? `${E}-error` : void 0
107
+ ].filter(Boolean).join(" ") || void 0, O = (e) => {
108
+ re(w, e), re(b, e);
108
109
  };
109
- return /* @__PURE__ */ F(a, {
110
- label: t,
111
- help: i,
112
- error: o,
113
- htmlFor: w,
114
- className: m,
115
- children: /* @__PURE__ */ I("div", {
116
- className: "relative",
110
+ return /* @__PURE__ */ I(o, {
111
+ label: e,
112
+ help: s,
113
+ error: c,
114
+ htmlFor: E,
115
+ className: g,
116
+ children: /* @__PURE__ */ L("div", {
117
+ className: r("relative", t(a)),
117
118
  "data-field-container": "true",
118
119
  children: [
119
- d != null && d !== "" && /* @__PURE__ */ F("span", {
120
+ p != null && p !== "" && /* @__PURE__ */ I("span", {
120
121
  "aria-hidden": "true",
121
- className: "pointer-events-none absolute inset-y-0 left-2.5 flex items-center text-[length:var(--type-size-control)] text-muted-foreground",
122
- children: d
122
+ className: "pointer-events-none absolute inset-y-0 left-2.5 flex items-center text-[length:var(--wos-control-font-size,var(--type-size-control))] text-muted-foreground",
123
+ children: p
123
124
  }),
124
- /* @__PURE__ */ F(B, {
125
- ...x,
126
- ref: E,
127
- id: w,
128
- name: _,
125
+ /* @__PURE__ */ I(V, {
126
+ ...C,
127
+ density: a,
128
+ ref: O,
129
+ id: E,
130
+ name: y,
129
131
  type: "text",
130
- inputMode: u,
132
+ inputMode: f,
131
133
  value: n,
132
- placeholder: l,
133
- disabled: c,
134
- invalid: s || !!o,
135
- "aria-describedby": T,
136
- "aria-errormessage": o ? `${w}-error` : void 0,
137
- className: e(d ? "pl-6" : void 0, f ? "pr-14" : void 0, "tabular", h),
138
- onChange: (e) => r(e.currentTarget.value),
134
+ placeholder: d,
135
+ disabled: u,
136
+ invalid: l || !!c,
137
+ "aria-describedby": D,
138
+ "aria-errormessage": c ? `${E}-error` : void 0,
139
+ className: r(p ? "pl-6" : void 0, m ? "pr-14" : void 0, "tabular", _),
140
+ onChange: (e) => i(e.currentTarget.value),
139
141
  onBlur: (e) => {
140
- p && r(ne(e.currentTarget.value, p)), y?.(e);
142
+ h && i(ne(e.currentTarget.value, h)), x?.(e);
141
143
  }
142
144
  }),
143
- f != null && f !== "" && /* @__PURE__ */ F("span", {
145
+ m != null && m !== "" && /* @__PURE__ */ I("span", {
144
146
  "aria-hidden": "true",
145
147
  className: "pointer-events-none absolute inset-y-0 right-2.5 flex items-center text-[13px] text-muted-foreground",
146
- children: f
148
+ children: m
147
149
  })
148
150
  ]
149
151
  })
150
152
  });
151
153
  });
152
- V.displayName = "NumberInput";
153
- var ee = M.forwardRef(({ prefix: e = "$", ...t }, n) => /* @__PURE__ */ F(V, {
154
+ H.displayName = "NumberInput";
155
+ var ee = N.forwardRef(({ prefix: e = "$", ...t }, n) => /* @__PURE__ */ I(H, {
154
156
  ...t,
155
157
  ref: n,
156
158
  prefix: e,
@@ -158,7 +160,7 @@ var ee = M.forwardRef(({ prefix: e = "$", ...t }, n) => /* @__PURE__ */ F(V, {
158
160
  format: "money"
159
161
  }));
160
162
  ee.displayName = "MoneyInput";
161
- var te = M.forwardRef(({ prefix: e, ...t }, n) => /* @__PURE__ */ F(V, {
163
+ var te = N.forwardRef(({ prefix: e, ...t }, n) => /* @__PURE__ */ I(H, {
162
164
  ...t,
163
165
  ref: n,
164
166
  prefix: e,
@@ -180,138 +182,141 @@ function re(e, t) {
180
182
  }
181
183
  //#endregion
182
184
  //#region src/components/select-menu.tsx
183
- function H({ id: t, value: n, onChange: r, options: i, placeholder: a, ariaLabel: o, className: s = "", compact: c = !1, tone: l, disabled: u, "aria-describedby": d, "aria-invalid": f }) {
184
- let p = M.useId(), m = t ?? p, h = `${m}-list`, [g, _] = M.useState(!1), [v, y] = M.useState(-1), [b, x] = M.useState(!1), S = M.useRef(null), C = M.useRef(null), w = M.useRef({
185
+ function U({ id: e, value: n, onChange: i, options: a, placeholder: o, ariaLabel: s, className: c = "", compact: l = !1, density: u, tone: d, disabled: f, "aria-describedby": p, "aria-invalid": m }) {
186
+ let h = N.useId(), g = e ?? h, _ = `${g}-list`, [v, y] = N.useState(!1), [b, x] = N.useState(-1), [S, C] = N.useState(!1), w = N.useRef(null), T = N.useRef(null), E = N.useRef({
185
187
  text: "",
186
188
  at: 0
187
- }), T = i.findIndex((e) => e.value === n), E = T >= 0 ? i[T] : null, D = (e) => e >= 0 && e < i.length && !i[e].disabled, O = (e = T) => {
188
- y(D(e) ? e : i.findIndex((e) => !e.disabled)), _(!0);
189
- }, k = (e = !0) => {
190
- _(!1), e && S.current?.querySelector("button")?.focus();
191
- }, A = (e) => {
192
- D(e) && (i[e].value !== n && r(i[e].value), k());
193
- }, j = (e, t) => {
194
- for (let n = e + t; n >= 0 && n < i.length; n += t) if (!i[n].disabled) return n;
189
+ }), D = a.findIndex((e) => e.value === n), O = D >= 0 ? a[D] : null, k = (e) => e >= 0 && e < a.length && !a[e].disabled, A = (e = D) => {
190
+ x(k(e) ? e : a.findIndex((e) => !e.disabled)), y(!0);
191
+ }, j = (e = !0) => {
192
+ y(!1), e && w.current?.querySelector("button")?.focus();
193
+ }, M = (e) => {
194
+ k(e) && (a[e].value !== n && i(a[e].value), j());
195
+ }, P = (e, t) => {
196
+ for (let n = e + t; n >= 0 && n < a.length; n += t) if (!a[n].disabled) return n;
195
197
  return e;
196
198
  };
197
- return M.useEffect(() => {
198
- if (!g) return;
199
+ return N.useEffect(() => {
200
+ if (!v) return;
199
201
  let e = (e) => {
200
- S.current?.contains(e.target) || _(!1);
202
+ w.current?.contains(e.target) || y(!1);
201
203
  };
202
204
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
203
- }, [g]), M.useLayoutEffect(() => {
204
- if (!g || !S.current) return;
205
- let e = S.current.getBoundingClientRect();
206
- x(window.innerHeight - e.bottom < 260 && e.top > window.innerHeight - e.bottom);
207
- }, [g]), M.useEffect(() => {
208
- g && v >= 0 && (C.current?.children[v])?.scrollIntoView?.({ block: "nearest" });
209
- }, [g, v]), /* @__PURE__ */ I("div", {
210
- ref: S,
211
- className: e("relative", s.includes("w-") ? void 0 : "w-full", s),
212
- children: [/* @__PURE__ */ I("button", {
213
- id: m,
205
+ }, [v]), N.useLayoutEffect(() => {
206
+ if (!v || !w.current) return;
207
+ let e = w.current.getBoundingClientRect();
208
+ C(window.innerHeight - e.bottom < 260 && e.top > window.innerHeight - e.bottom);
209
+ }, [v]), N.useEffect(() => {
210
+ v && b >= 0 && (T.current?.children[b])?.scrollIntoView?.({ block: "nearest" });
211
+ }, [v, b]), /* @__PURE__ */ L("div", {
212
+ ref: w,
213
+ className: r("relative", t(u), c.includes("w-") ? void 0 : "w-full", c),
214
+ children: [/* @__PURE__ */ L("button", {
215
+ id: g,
216
+ "data-density": u,
214
217
  type: "button",
215
218
  role: "combobox",
216
219
  "aria-haspopup": "listbox",
217
- "aria-expanded": g,
218
- "aria-controls": h,
219
- "aria-label": o,
220
- "aria-activedescendant": g && v >= 0 ? `${h}-${v}` : void 0,
221
- "aria-describedby": d,
222
- "aria-invalid": f,
223
- disabled: u,
224
- className: e("wos-field flex items-center justify-between gap-2 text-left", c ? "h-8" : "h-9", l),
225
- onClick: () => g ? k(!1) : O(),
220
+ "aria-expanded": v,
221
+ "aria-controls": _,
222
+ "aria-label": s,
223
+ "aria-activedescendant": v && b >= 0 ? `${_}-${b}` : void 0,
224
+ "aria-describedby": p,
225
+ "aria-invalid": m,
226
+ disabled: f,
227
+ className: r("wos-field flex items-center justify-between gap-2 text-left", u ? "h-[var(--wos-control-height)]" : l ? "h-8" : "h-9", d),
228
+ onClick: () => v ? j(!1) : A(),
226
229
  onKeyDown: (e) => {
227
230
  let t = e.key;
228
- if (!g) [
231
+ if (!v) [
229
232
  "ArrowDown",
230
233
  "ArrowUp",
231
234
  "Enter",
232
235
  " "
233
- ].includes(t) && (e.preventDefault(), O());
234
- else if (t === "Escape") e.preventDefault(), k();
235
- else if (t === "Tab") _(!1);
236
- else if (t === "ArrowDown") e.preventDefault(), y((e) => j(e, 1));
237
- else if (t === "ArrowUp") e.preventDefault(), y((e) => j(e, -1));
238
- else if (t === "Home") e.preventDefault(), y(j(-1, 1));
239
- else if (t === "End") e.preventDefault(), y(j(i.length, -1));
240
- else if (t === "Enter" || t === " ") e.preventDefault(), A(v);
236
+ ].includes(t) && (e.preventDefault(), A());
237
+ else if (t === "Escape") e.preventDefault(), j();
238
+ else if (t === "Tab") y(!1);
239
+ else if (t === "ArrowDown") e.preventDefault(), x((e) => P(e, 1));
240
+ else if (t === "ArrowUp") e.preventDefault(), x((e) => P(e, -1));
241
+ else if (t === "Home") e.preventDefault(), x(P(-1, 1));
242
+ else if (t === "End") e.preventDefault(), x(P(a.length, -1));
243
+ else if (t === "Enter" || t === " ") e.preventDefault(), M(b);
241
244
  else if (t.length === 1 && /\S/.test(t)) {
242
- let e = Date.now(), n = e - w.current.at < 500 ? w.current.text + t.toLowerCase() : t.toLowerCase();
243
- w.current = {
245
+ let e = Date.now(), n = e - E.current.at < 500 ? E.current.text + t.toLowerCase() : t.toLowerCase();
246
+ E.current = {
244
247
  text: n,
245
248
  at: e
246
249
  };
247
- let r = n.length === 1 ? v + 1 : v, a = [...i.keys()].map((e) => (r + e) % i.length).find((e) => D(e) && i[e].label.toLowerCase().startsWith(n));
248
- a !== void 0 && y(a);
250
+ let r = n.length === 1 ? b + 1 : b, i = [...a.keys()].map((e) => (r + e) % a.length).find((e) => k(e) && a[e].label.toLowerCase().startsWith(n));
251
+ i !== void 0 && x(i);
249
252
  }
250
253
  },
251
- children: [/* @__PURE__ */ F("span", {
252
- className: e("truncate", E ? void 0 : "text-muted-foreground"),
253
- children: E?.label ?? a ?? "Choose"
254
- }), /* @__PURE__ */ F(z, {
254
+ children: [/* @__PURE__ */ I("span", {
255
+ className: r("truncate", O ? void 0 : "text-muted-foreground"),
256
+ children: O?.label ?? o ?? "Choose"
257
+ }), /* @__PURE__ */ I(B, {
255
258
  name: "chevron-down",
256
- className: e("shrink-0 text-muted-foreground transition-transform", g && "rotate-180")
259
+ className: r("shrink-0 text-muted-foreground transition-transform", v && "rotate-180")
257
260
  })]
258
- }), g && /* @__PURE__ */ F("ul", {
259
- ref: C,
260
- id: h,
261
+ }), v && /* @__PURE__ */ I("ul", {
262
+ ref: T,
263
+ id: _,
261
264
  role: "listbox",
262
- "aria-labelledby": o ? void 0 : m,
263
- "aria-label": o,
264
- className: e("absolute left-0 z-50 max-h-[280px] min-w-full overflow-y-auto rounded-[6px] border border-border bg-surface py-1 shadow-working", b ? "bottom-full mb-1" : "top-full mt-1"),
265
- children: i.map((t, n) => /* @__PURE__ */ I("li", {
266
- id: `${h}-${n}`,
265
+ "aria-labelledby": s ? void 0 : g,
266
+ "aria-label": s,
267
+ className: r("absolute left-0 z-50 max-h-[280px] min-w-full overflow-y-auto rounded-[var(--control-radius)] border border-border bg-surface py-1 shadow-working", S ? "bottom-full mb-1" : "top-full mt-1"),
268
+ children: a.map((e, t) => /* @__PURE__ */ L("li", {
269
+ id: `${_}-${t}`,
267
270
  role: "option",
268
- "aria-selected": n === T,
269
- "aria-disabled": t.disabled || void 0,
270
- className: e("flex h-9 cursor-pointer items-center gap-2 whitespace-nowrap px-3 text-[length:var(--type-size-control)]", t.disabled ? "cursor-default text-muted-foreground" : n === v ? "bg-surface-subtle text-foreground" : "text-secondary-foreground"),
271
- onPointerEnter: () => !t.disabled && y(n),
271
+ "data-active": t === b || void 0,
272
+ "aria-selected": t === D,
273
+ "aria-disabled": e.disabled || void 0,
274
+ className: r("wos-option flex cursor-pointer items-center gap-2 whitespace-nowrap px-3 text-[length:var(--wos-control-font-size,var(--type-size-control))]", u ? "h-[var(--wos-control-height)]" : "h-9", e.disabled ? "cursor-default text-muted-foreground" : t === b ? "bg-surface-subtle text-foreground" : "text-secondary-foreground"),
275
+ onPointerEnter: () => !e.disabled && x(t),
272
276
  onPointerDown: (e) => e.preventDefault(),
273
- onClick: () => A(n),
274
- children: [/* @__PURE__ */ F("span", {
277
+ onClick: () => M(t),
278
+ children: [/* @__PURE__ */ I("span", {
275
279
  className: "w-4 shrink-0",
276
- children: n === T && /* @__PURE__ */ F(z, {
280
+ children: t === D && /* @__PURE__ */ I(B, {
277
281
  name: "check",
278
282
  size: 14,
279
- className: "text-primary"
283
+ className: "text-selected"
280
284
  })
281
- }), /* @__PURE__ */ F("span", {
282
- className: n === T ? "font-medium text-foreground" : void 0,
283
- children: t.label
285
+ }), /* @__PURE__ */ I("span", {
286
+ className: t === D ? "font-medium text-foreground" : void 0,
287
+ children: e.label
284
288
  })]
285
- }, t.value || `empty-${n}`))
289
+ }, e.value || `empty-${t}`))
286
290
  })]
287
291
  });
288
292
  }
289
- H.displayName = "SelectMenu", H.fieldControl = !0;
293
+ U.displayName = "SelectMenu", U.fieldControl = !0;
290
294
  //#endregion
291
295
  //#region src/components/select.tsx
292
- function ie({ label: e, value: t, onChange: n, options: r, help: i, error: o, placeholder: s, compact: c, disabled: l, className: u, menuClassName: d, id: f }) {
293
- return /* @__PURE__ */ F(a, {
296
+ function ie({ label: e, value: t, onChange: n, options: r, help: i, error: a, placeholder: s, compact: c, density: l, disabled: u, className: d, menuClassName: f, id: p }) {
297
+ return /* @__PURE__ */ I(o, {
294
298
  label: e,
295
299
  help: i,
296
- error: o,
297
- htmlFor: f,
298
- className: u,
299
- children: /* @__PURE__ */ F(H, {
300
- id: f,
300
+ error: a,
301
+ htmlFor: p,
302
+ className: d,
303
+ children: /* @__PURE__ */ I(U, {
304
+ id: p,
301
305
  value: t,
302
306
  onChange: n,
303
307
  options: r,
304
308
  placeholder: s,
305
309
  compact: c,
306
- disabled: l,
307
- className: d
310
+ density: l,
311
+ disabled: u,
312
+ className: f
308
313
  })
309
314
  });
310
315
  }
311
316
  ie.displayName = "Select";
312
317
  //#endregion
313
318
  //#region src/components/date-input.tsx
314
- var U = [
319
+ var W = [
315
320
  "January",
316
321
  "February",
317
322
  "March",
@@ -353,26 +358,26 @@ var U = [
353
358
  "Thursday",
354
359
  "Friday",
355
360
  "Saturday"
356
- ], W = /^\d{4}-\d{2}-\d{2}$/, G = (e) => String(e).padStart(2, "0"), K = (e, t, n) => {
361
+ ], G = /^\d{4}-\d{2}-\d{2}$/, K = (e) => String(e).padStart(2, "0"), q = (e, t, n) => {
357
362
  let r = new Date(Date.UTC(e, t, n));
358
- return `${r.getUTCFullYear()}-${G(r.getUTCMonth() + 1)}-${G(r.getUTCDate())}`;
359
- }, q = (e) => ({
363
+ return `${r.getUTCFullYear()}-${K(r.getUTCMonth() + 1)}-${K(r.getUTCDate())}`;
364
+ }, J = (e) => ({
360
365
  year: Number(e.slice(0, 4)),
361
366
  month: Number(e.slice(5, 7)) - 1,
362
367
  day: Number(e.slice(8, 10))
363
- }), J = (e, t) => {
364
- let { year: n, month: r, day: i } = q(e);
365
- return K(n, r, i + t);
366
- }, Y = (e, t) => {
367
- let { year: n, month: r, day: i } = q(e), a = new Date(Date.UTC(n, r + t + 1, 0)).getUTCDate();
368
- return K(n, r + t, Math.min(i, a));
369
- }, X = (e) => {
370
- let { year: t, month: n, day: r } = q(e);
368
+ }), Y = (e, t) => {
369
+ let { year: n, month: r, day: i } = J(e);
370
+ return q(n, r, i + t);
371
+ }, X = (e, t) => {
372
+ let { year: n, month: r, day: i } = J(e), a = new Date(Date.UTC(n, r + t + 1, 0)).getUTCDate();
373
+ return q(n, r + t, Math.min(i, a));
374
+ }, Z = (e) => {
375
+ let { year: t, month: n, day: r } = J(e);
371
376
  return new Date(Date.UTC(t, n, r)).getUTCDay();
372
377
  }, ce = () => {
373
378
  let e = /* @__PURE__ */ new Date();
374
- return `${e.getFullYear()}-${G(e.getMonth() + 1)}-${G(e.getDate())}`;
375
- }, Z = (e) => W.test(e) ? `${e.slice(5, 7)}/${e.slice(8, 10)}/${e.slice(0, 4)}` : "", Q = (e) => {
379
+ return `${e.getFullYear()}-${K(e.getMonth() + 1)}-${K(e.getDate())}`;
380
+ }, le = (e) => G.test(e) ? `${e.slice(5, 7)}/${e.slice(8, 10)}/${e.slice(0, 4)}` : "", Q = (e) => {
376
381
  let t = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(e.trim());
377
382
  if (!t) return null;
378
383
  let [n, r, i] = [
@@ -380,167 +385,168 @@ var U = [
380
385
  Number(t[2]),
381
386
  Number(t[3])
382
387
  ], a = new Date(Date.UTC(i, n - 1, r));
383
- return a.getUTCFullYear() !== i || a.getUTCMonth() !== n - 1 || a.getUTCDate() !== r ? null : `${i}-${G(n)}-${G(r)}`;
388
+ return a.getUTCFullYear() !== i || a.getUTCMonth() !== n - 1 || a.getUTCDate() !== r ? null : `${i}-${K(n)}-${K(r)}`;
384
389
  };
385
- function le(e) {
390
+ function ue(e) {
386
391
  let t = e.replace(/[^\d]/g, "").slice(0, 8);
387
392
  return e.includes("/") ? e.replace(/[^\d/]/g, "").slice(0, 10) : t.length > 4 ? `${t.slice(0, 2)}/${t.slice(2, 4)}/${t.slice(4)}` : t.length > 2 ? `${t.slice(0, 2)}/${t.slice(2)}` : t;
388
393
  }
389
- function $({ id: t, value: n, onChange: r, ariaLabel: i, min: a, max: o, disabled: s, required: c, invalid: l, compact: u, longDisplay: d, className: f = "", "aria-describedby": p, "aria-errormessage": m, "aria-invalid": h }) {
390
- let g = M.useId(), _ = t ?? g, [v, y] = M.useState(Z(n)), [b, x] = M.useState(!1), [S, C] = M.useState(!1), w = !!d && !S && W.test(n) && Q(v) === n, T = M.useRef(null), E = M.useRef(null);
391
- M.useEffect(() => {
392
- Q(v) !== n && (n !== "" || v === "" || Q(v) !== null) && y(Z(n));
393
- }, [n]), M.useEffect(() => {
394
- if (!b) return;
394
+ function $({ id: e, value: n, onChange: i, ariaLabel: a, min: o, max: s, disabled: c, required: l, invalid: u, compact: d, density: f, longDisplay: p, className: m = "", "aria-describedby": h, "aria-errormessage": g, "aria-invalid": _ }) {
395
+ let v = N.useId(), y = e ?? v, [b, x] = N.useState(le(n)), [S, C] = N.useState(!1), [w, T] = N.useState(!1), E = !!p && !w && G.test(n) && Q(b) === n, D = N.useRef(null), O = N.useRef(null);
396
+ N.useEffect(() => {
397
+ Q(b) !== n && (n !== "" || b === "" || Q(b) !== null) && x(le(n));
398
+ }, [n]), N.useEffect(() => {
399
+ if (!S) return;
395
400
  let e = (e) => {
396
- T.current?.contains(e.target) || x(!1);
401
+ D.current?.contains(e.target) || C(!1);
397
402
  };
398
403
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
399
- }, [b]);
400
- let D = (e) => {
401
- let t = le(e);
402
- y(t), r(Q(t) ?? "");
404
+ }, [S]);
405
+ let k = (e) => {
406
+ let t = ue(e);
407
+ x(t), i(Q(t) ?? "");
403
408
  };
404
- return /* @__PURE__ */ I("div", {
405
- ref: T,
406
- className: e("relative", f),
409
+ return /* @__PURE__ */ L("div", {
410
+ ref: D,
411
+ className: r("relative", t(f), m),
407
412
  children: [
408
- /* @__PURE__ */ F("input", {
409
- id: _,
410
- className: e("wos-field pr-9 tabular disabled:cursor-not-allowed", u && "h-8", w && "text-transparent"),
413
+ /* @__PURE__ */ I("input", {
414
+ id: y,
415
+ "data-density": f,
416
+ className: r("wos-field pr-9 tabular disabled:cursor-not-allowed", !f && d && "h-8", E && "text-transparent"),
411
417
  inputMode: "numeric",
412
418
  placeholder: "MM/DD/YYYY",
413
419
  autoComplete: "off",
414
- required: c,
415
- value: v,
416
- onFocus: () => C(!0),
417
- onBlur: () => C(!1),
418
- disabled: s,
419
- "aria-label": i,
420
- "aria-invalid": l || h || void 0,
421
- "aria-describedby": p,
422
- "aria-errormessage": m,
423
- onChange: (e) => D(e.currentTarget.value)
420
+ required: l,
421
+ value: b,
422
+ onFocus: () => T(!0),
423
+ onBlur: () => T(!1),
424
+ disabled: c,
425
+ "aria-label": a,
426
+ "aria-invalid": u || _ || void 0,
427
+ "aria-describedby": h,
428
+ "aria-errormessage": g,
429
+ onChange: (e) => k(e.currentTarget.value)
424
430
  }),
425
- w && /* @__PURE__ */ F("span", {
431
+ E && /* @__PURE__ */ I("span", {
426
432
  "aria-hidden": "true",
427
- className: "pointer-events-none absolute inset-y-0 left-3 flex items-center text-[14px] tabular",
433
+ className: "pointer-events-none absolute inset-y-0 left-3 flex items-center text-[length:var(--wos-control-font-size,var(--type-size-control))] tabular",
428
434
  "data-testid": "date-long",
429
- children: de(n)
435
+ children: fe(n)
430
436
  }),
431
- /* @__PURE__ */ F("button", {
432
- ref: E,
437
+ /* @__PURE__ */ I("button", {
438
+ ref: O,
433
439
  type: "button",
434
- disabled: s,
435
- className: e("absolute inset-y-0 right-0.5 my-auto grid place-items-center rounded-[4px] text-muted-foreground hover:bg-surface-subtle hover:text-foreground disabled:pointer-events-none", u ? "h-7 w-7" : "h-8 w-8"),
436
- "aria-label": `Choose ${i ? i.toLowerCase() : "date"} from a calendar`,
440
+ disabled: c,
441
+ className: r("absolute inset-y-0 right-0.5 my-auto grid place-items-center rounded-[var(--control-radius-inner)] text-muted-foreground hover:bg-interaction-hover hover:text-foreground disabled:pointer-events-none", f ? "h-[calc(var(--wos-control-height)-4px)] w-[calc(var(--wos-control-height)-4px)]" : d ? "h-7 w-7" : "h-8 w-8"),
442
+ "aria-label": `Choose ${a ? a.toLowerCase() : "date"} from a calendar`,
437
443
  "aria-haspopup": "dialog",
438
- "aria-expanded": b,
439
- onClick: () => x(!b),
440
- children: /* @__PURE__ */ F(z, { name: "calendar" })
444
+ "aria-expanded": S,
445
+ onClick: () => C(!S),
446
+ children: /* @__PURE__ */ I(B, { name: "calendar" })
441
447
  }),
442
- b && /* @__PURE__ */ F(fe, {
443
- value: W.test(n) ? n : null,
444
- min: a,
445
- max: o,
448
+ S && /* @__PURE__ */ I(pe, {
449
+ value: G.test(n) ? n : null,
450
+ min: o,
451
+ max: s,
446
452
  onPick: (e) => {
447
- y(Z(e)), r(e), x(!1), E.current?.focus();
453
+ x(le(e)), i(e), C(!1), O.current?.focus();
448
454
  },
449
455
  onClose: () => {
450
- x(!1), E.current?.focus();
456
+ C(!1), O.current?.focus();
451
457
  },
452
- anchor: T
458
+ anchor: D
453
459
  })
454
460
  ]
455
461
  });
456
462
  }
457
463
  $.displayName = "DateInput", $.fieldControl = !0;
458
- function ue({ label: e, help: t, error: n, confirm: r, ...i }) {
459
- return /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(a, {
464
+ function de({ label: e, help: t, error: n, confirm: r, ...i }) {
465
+ return /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I(o, {
460
466
  label: e,
461
467
  help: t,
462
468
  error: n,
463
469
  htmlFor: i.id,
464
- children: /* @__PURE__ */ F($, {
470
+ children: /* @__PURE__ */ I($, {
465
471
  ...i,
466
472
  ariaLabel: typeof e == "string" ? e : void 0,
467
473
  invalid: i.invalid || !!n
468
474
  })
469
- }), !n && r && /* @__PURE__ */ F("p", {
475
+ }), !n && r && /* @__PURE__ */ I("p", {
470
476
  className: "mt-1 text-[length:var(--type-size-metadata)] text-secondary-foreground",
471
477
  children: r
472
478
  })] });
473
479
  }
474
- ue.displayName = "UsDateInput";
475
- function de(e) {
476
- let { year: t, month: n, day: r } = q(e);
480
+ de.displayName = "UsDateInput";
481
+ function fe(e) {
482
+ let { year: t, month: n, day: r } = J(e);
477
483
  return `${ae[n]} ${r}, ${t}`;
478
484
  }
479
- function fe({ value: t, min: n, max: r, onPick: i, onClose: a, anchor: o }) {
480
- let s = ce(), c = (e) => n && e < n ? n : r && e > r ? r : e, [l, u] = M.useState(() => c(t ?? s)), [d, f] = M.useState(!1), p = M.useRef(null), { year: m, month: h } = q(l), g = (e) => (!n || e >= n) && (!r || e <= r);
481
- M.useLayoutEffect(() => {
485
+ function pe({ value: e, min: t, max: n, onPick: i, onClose: a, anchor: o }) {
486
+ let s = ce(), c = (e) => t && e < t ? t : n && e > n ? n : e, [l, u] = N.useState(() => c(e ?? s)), [d, f] = N.useState(!1), p = N.useRef(null), { year: m, month: h } = J(l), g = (e) => (!t || e >= t) && (!n || e <= n);
487
+ N.useLayoutEffect(() => {
482
488
  let e = o.current?.getBoundingClientRect();
483
489
  e && f(window.innerHeight - e.bottom < 360 && e.top > window.innerHeight - e.bottom);
484
- }, [o]), M.useEffect(() => {
490
+ }, [o]), N.useEffect(() => {
485
491
  p.current?.querySelector(`[data-day="${l}"]`)?.focus();
486
492
  }, [l]);
487
- let _ = K(m, h, 1), v = J(_, -X(_)), y = Array.from({ length: 42 }, (e, t) => J(v, t)), b = (e) => u(c(e)), x = (e) => {
493
+ let _ = q(m, h, 1), v = Y(_, -Z(_)), y = Array.from({ length: 42 }, (e, t) => Y(v, t)), b = (e) => u(c(e)), x = (e) => {
488
494
  let t = {
489
- ArrowLeft: () => J(l, -1),
490
- ArrowRight: () => J(l, 1),
491
- ArrowUp: () => J(l, -7),
492
- ArrowDown: () => J(l, 7),
493
- Home: () => J(l, -X(l)),
494
- End: () => J(l, 6 - X(l)),
495
- PageUp: () => Y(l, e.shiftKey ? -12 : -1),
496
- PageDown: () => Y(l, e.shiftKey ? 12 : 1)
495
+ ArrowLeft: () => Y(l, -1),
496
+ ArrowRight: () => Y(l, 1),
497
+ ArrowUp: () => Y(l, -7),
498
+ ArrowDown: () => Y(l, 7),
499
+ Home: () => Y(l, -Z(l)),
500
+ End: () => Y(l, 6 - Z(l)),
501
+ PageUp: () => X(l, e.shiftKey ? -12 : -1),
502
+ PageDown: () => X(l, e.shiftKey ? 12 : 1)
497
503
  };
498
504
  t[e.key] ? (e.preventDefault(), b(t[e.key]())) : e.key === "Escape" && (e.preventDefault(), a());
499
- }, S = (e, t, n) => /* @__PURE__ */ F("button", {
505
+ }, S = (e, t, n) => /* @__PURE__ */ I("button", {
500
506
  type: "button",
501
- className: "grid h-8 w-8 place-items-center rounded-[4px] text-secondary-foreground hover:bg-surface-subtle",
507
+ className: "grid h-8 w-8 place-items-center rounded-[var(--control-radius-inner)] text-secondary-foreground hover:bg-interaction-hover",
502
508
  "aria-label": e,
503
509
  onClick: () => b(n),
504
510
  children: t
505
511
  });
506
- return /* @__PURE__ */ I("div", {
512
+ return /* @__PURE__ */ L("div", {
507
513
  role: "dialog",
508
514
  "aria-modal": "false",
509
515
  "aria-label": "Choose a date",
510
- className: e("absolute right-0 z-50 w-[300px] rounded-[8px] border border-border bg-surface p-3 shadow-working", d ? "bottom-full mb-1" : "top-full mt-1"),
516
+ className: r("absolute right-0 z-50 w-[300px] rounded-[var(--surface-radius)] border border-border bg-surface p-3 shadow-working", d ? "bottom-full mb-1" : "top-full mt-1"),
511
517
  onKeyDown: x,
512
518
  children: [
513
- /* @__PURE__ */ I("div", {
519
+ /* @__PURE__ */ L("div", {
514
520
  className: "flex items-center justify-between",
515
521
  children: [
516
- /* @__PURE__ */ I("div", {
522
+ /* @__PURE__ */ L("div", {
517
523
  className: "flex",
518
- children: [S("Previous year", /* @__PURE__ */ F(z, { name: "chevrons-left" }), Y(l, -12)), S("Previous month", /* @__PURE__ */ F(z, { name: "chevron-left" }), Y(l, -1))]
524
+ children: [S("Previous year", /* @__PURE__ */ I(B, { name: "chevrons-left" }), X(l, -12)), S("Previous month", /* @__PURE__ */ I(B, { name: "chevron-left" }), X(l, -1))]
519
525
  }),
520
- /* @__PURE__ */ I("p", {
521
- className: "text-[14px] font-semibold text-foreground",
526
+ /* @__PURE__ */ L("p", {
527
+ className: "text-[length:var(--type-size-control)] font-semibold text-foreground",
522
528
  "aria-live": "polite",
523
529
  children: [
524
- U[h],
530
+ W[h],
525
531
  " ",
526
532
  m
527
533
  ]
528
534
  }),
529
- /* @__PURE__ */ I("div", {
535
+ /* @__PURE__ */ L("div", {
530
536
  className: "flex",
531
- children: [S("Next month", /* @__PURE__ */ F(z, { name: "chevron-right" }), Y(l, 1)), S("Next year", /* @__PURE__ */ F(z, { name: "chevrons-right" }), Y(l, 12))]
537
+ children: [S("Next month", /* @__PURE__ */ I(B, { name: "chevron-right" }), X(l, 1)), S("Next year", /* @__PURE__ */ I(B, { name: "chevrons-right" }), X(l, 12))]
532
538
  })
533
539
  ]
534
540
  }),
535
- /* @__PURE__ */ I("div", {
541
+ /* @__PURE__ */ L("div", {
536
542
  ref: p,
537
543
  role: "grid",
538
- "aria-label": `${U[h]} ${m}`,
544
+ "aria-label": `${W[h]} ${m}`,
539
545
  className: "mt-2",
540
- children: [/* @__PURE__ */ F("div", {
546
+ children: [/* @__PURE__ */ I("div", {
541
547
  role: "row",
542
548
  className: "grid grid-cols-7",
543
- children: oe.map((e) => /* @__PURE__ */ F("span", {
549
+ children: oe.map((e) => /* @__PURE__ */ I("span", {
544
550
  role: "columnheader",
545
551
  className: "grid h-8 place-items-center text-[12px] font-medium text-muted-foreground",
546
552
  children: e
@@ -552,40 +558,40 @@ function fe({ value: t, min: n, max: r, onPick: i, onClose: a, anchor: o }) {
552
558
  3,
553
559
  4,
554
560
  5
555
- ].map((n) => /* @__PURE__ */ F("div", {
561
+ ].map((t) => /* @__PURE__ */ I("div", {
556
562
  role: "row",
557
563
  className: "grid grid-cols-7",
558
- children: y.slice(n * 7, n * 7 + 7).map((n) => {
559
- let r = q(n).month === h, a = n === t, o = g(n);
560
- return /* @__PURE__ */ F("span", {
564
+ children: y.slice(t * 7, t * 7 + 7).map((t) => {
565
+ let n = J(t).month === h, a = t === e, o = g(t);
566
+ return /* @__PURE__ */ I("span", {
561
567
  role: "gridcell",
562
- children: /* @__PURE__ */ F("button", {
568
+ children: /* @__PURE__ */ I("button", {
563
569
  type: "button",
564
- "data-day": n,
565
- tabIndex: n === l ? 0 : -1,
570
+ "data-day": t,
571
+ tabIndex: t === l ? 0 : -1,
566
572
  disabled: !o,
567
573
  "aria-selected": a,
568
- "aria-current": n === s ? "date" : void 0,
569
- "aria-label": pe(n),
570
- className: e("tabular grid h-9 w-full place-items-center rounded-[4px] text-[14px] outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)] disabled:cursor-not-allowed disabled:opacity-30", a ? "bg-primary font-semibold text-primary-foreground" : n === s ? "font-semibold text-primary hover:bg-surface-subtle" : r ? "text-foreground hover:bg-surface-subtle" : "text-muted-foreground hover:bg-surface-subtle"),
571
- onClick: () => i(n),
572
- children: q(n).day
574
+ "aria-current": t === s ? "date" : void 0,
575
+ "aria-label": me(t),
576
+ className: r("tabular grid h-9 w-full place-items-center rounded-[var(--control-radius-inner)] text-[length:var(--type-size-control)] outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-color)] disabled:cursor-not-allowed disabled:opacity-[var(--state-disabled-opacity)]", a ? "bg-selection-indicator font-semibold text-selection-indicator-foreground" : t === s ? "font-semibold text-link hover:bg-interaction-hover" : n ? "text-foreground hover:bg-interaction-hover" : "text-muted-foreground hover:bg-interaction-hover"),
577
+ onClick: () => i(t),
578
+ children: J(t).day
573
579
  })
574
- }, n);
580
+ }, t);
575
581
  })
576
- }, n))]
582
+ }, t))]
577
583
  }),
578
- /* @__PURE__ */ I("div", {
584
+ /* @__PURE__ */ L("div", {
579
585
  className: "mt-2 flex items-center justify-between border-t border-border-subtle pt-2",
580
- children: [/* @__PURE__ */ F("button", {
586
+ children: [/* @__PURE__ */ I("button", {
581
587
  type: "button",
582
- className: "rounded-[4px] px-2 py-1 text-[13px] font-medium text-primary hover:bg-surface-subtle disabled:text-muted-foreground",
588
+ className: "rounded-[var(--control-radius-inner)] px-2 py-1 text-[13px] font-medium text-link hover:bg-interaction-hover disabled:text-muted-foreground",
583
589
  disabled: !g(s),
584
590
  onClick: () => i(s),
585
591
  children: "Today"
586
- }), /* @__PURE__ */ F("button", {
592
+ }), /* @__PURE__ */ I("button", {
587
593
  type: "button",
588
- className: "rounded-[4px] px-2 py-1 text-[13px] text-secondary-foreground hover:bg-surface-subtle",
594
+ className: "rounded-[var(--control-radius-inner)] px-2 py-1 text-[13px] text-secondary-foreground hover:bg-interaction-hover",
589
595
  onClick: a,
590
596
  children: "Close"
591
597
  })]
@@ -593,212 +599,216 @@ function fe({ value: t, min: n, max: r, onPick: i, onClose: a, anchor: o }) {
593
599
  ]
594
600
  });
595
601
  }
596
- function pe(e) {
597
- let { year: t, month: n, day: r } = q(e);
598
- return `${se[X(e)]}, ${U[n]} ${r}, ${t}`;
602
+ function me(e) {
603
+ let { year: t, month: n, day: r } = J(e);
604
+ return `${se[Z(e)]}, ${W[n]} ${r}, ${t}`;
599
605
  }
600
606
  //#endregion
601
607
  //#region src/components/date-range-picker.tsx
602
- function me({ label: e, value: t, onChange: n, help: r, error: i, min: a, max: o, disabled: s, required: c, className: l, id: u }) {
603
- let d = M.useId(), f = typeof e == "string" || typeof e == "number" ? String(e) : "Date range", p = !he(t, a, o), m = t.start && t.end && t.start > t.end ? "End date must be on or after the start date." : a && t.start && t.start < a ? `Start date must be on or after ${a}.` : o && t.end && t.end > o ? `End date must be on or before ${o}.` : void 0, h = i ?? (p ? m : void 0), g = [r ? `${u ?? d}-help` : void 0, h ? `${u ?? d}-error` : void 0].filter(Boolean).join(" ") || void 0, _ = t.end && (!o || t.end < o) ? t.end : o, v = t.start && (!a || t.start > a) ? t.start : a;
604
- return /* @__PURE__ */ I("fieldset", {
605
- className: l,
608
+ function he({ label: e, value: t, onChange: n, help: r, error: i, min: a, max: o, disabled: s, required: c, density: l, className: u, id: d }) {
609
+ let f = N.useId(), p = typeof e == "string" || typeof e == "number" ? String(e) : "Date range", m = !ge(t, a, o), h = t.start && t.end && t.start > t.end ? "End date must be on or after the start date." : a && t.start && t.start < a ? `Start date must be on or after ${a}.` : o && t.end && t.end > o ? `End date must be on or before ${o}.` : void 0, g = i ?? (m ? h : void 0), _ = [r ? `${d ?? f}-help` : void 0, g ? `${d ?? f}-error` : void 0].filter(Boolean).join(" ") || void 0, v = t.end && (!o || t.end < o) ? t.end : o, y = t.start && (!a || t.start > a) ? t.start : a;
610
+ return /* @__PURE__ */ L("fieldset", {
611
+ className: u,
606
612
  children: [
607
- /* @__PURE__ */ I("legend", {
608
- className: "mb-2 type-label font-semibold text-secondary-foreground",
609
- children: [e, c && /* @__PURE__ */ F("span", {
613
+ /* @__PURE__ */ L("legend", {
614
+ className: "mb-2 type-label text-secondary-foreground",
615
+ children: [e, c && /* @__PURE__ */ I("span", {
610
616
  className: "ml-1 font-normal text-muted-foreground",
611
617
  children: "Required"
612
618
  })]
613
619
  }),
614
- /* @__PURE__ */ I("div", {
620
+ /* @__PURE__ */ L("div", {
615
621
  className: "grid min-w-0 gap-3 sm:grid-cols-2",
616
- children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("span", {
622
+ children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("span", {
617
623
  className: "mb-1 block type-caption text-muted-foreground",
618
624
  children: "Start date"
619
- }), /* @__PURE__ */ F($, {
620
- id: `${u ?? d}-start`,
625
+ }), /* @__PURE__ */ I($, {
626
+ density: l,
627
+ id: `${d ?? f}-start`,
621
628
  value: t.start,
622
629
  onChange: (e) => n({
623
630
  start: e,
624
631
  end: t.end
625
632
  }),
626
- ariaLabel: `${f} start date`,
633
+ ariaLabel: `${p} start date`,
627
634
  min: a,
628
- max: _,
635
+ max: v,
629
636
  disabled: s,
630
637
  required: c,
631
- invalid: !!h,
632
- "aria-describedby": g
633
- })] }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("span", {
638
+ invalid: !!g,
639
+ "aria-describedby": _
640
+ })] }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("span", {
634
641
  className: "mb-1 block type-caption text-muted-foreground",
635
642
  children: "End date"
636
- }), /* @__PURE__ */ F($, {
637
- id: `${u ?? d}-end`,
643
+ }), /* @__PURE__ */ I($, {
644
+ density: l,
645
+ id: `${d ?? f}-end`,
638
646
  value: t.end,
639
647
  onChange: (e) => n({
640
648
  start: t.start,
641
649
  end: e
642
650
  }),
643
- ariaLabel: `${f} end date`,
644
- min: v,
651
+ ariaLabel: `${p} end date`,
652
+ min: y,
645
653
  max: o,
646
654
  disabled: s,
647
655
  required: c,
648
- invalid: !!h,
649
- "aria-describedby": g
656
+ invalid: !!g,
657
+ "aria-describedby": _
650
658
  })] })]
651
659
  }),
652
- r && /* @__PURE__ */ F("p", {
653
- id: `${u ?? d}-help`,
660
+ r && /* @__PURE__ */ I("p", {
661
+ id: `${d ?? f}-help`,
654
662
  className: "mt-1 type-caption text-muted-foreground",
655
663
  children: r
656
664
  }),
657
- h && /* @__PURE__ */ F("p", {
658
- id: `${u ?? d}-error`,
665
+ g && /* @__PURE__ */ I("p", {
666
+ id: `${d ?? f}-error`,
659
667
  className: "mt-1 type-caption text-destructive",
660
- children: h
668
+ children: g
661
669
  })
662
670
  ]
663
671
  });
664
672
  }
665
- function he(e, t, n) {
673
+ function ge(e, t, n) {
666
674
  return (!e.start || !e.end || e.start <= e.end) && (!t || !e.start || e.start >= t) && (!n || !e.end || e.end <= n);
667
675
  }
668
676
  //#endregion
669
677
  //#region src/components/advanced-controls.tsx
670
- var ge = (e, t) => typeof e == "string" || typeof e == "number" ? String(e) : t;
671
- function _e({ label: t, value: n, onChange: r, options: i, help: o, error: s, placeholder: c = "Search options", emptyMessage: l = "No results found.", disabled: u, required: d, clearable: f = !0, loading: p, className: m, id: h, allowCustomValue: g, onValueSubmit: _, name: v }) {
672
- let y = M.useId(), b = h ?? y, x = `${b}-options`, [S, C] = M.useState(!1), [w, T] = M.useState(""), [E, D] = M.useState(0), O = M.useRef(null), k = M.useRef(null), A = M.useRef(null), j = i.find((e) => e.value === n), N = i.filter((e) => e.label.toLocaleLowerCase().includes(w.toLocaleLowerCase())), P = (e = 0) => {
673
- for (let t = e; t < N.length; t++) if (!N[t].disabled) return t;
678
+ var _e = (e, t) => typeof e == "string" || typeof e == "number" ? String(e) : t;
679
+ function ve({ label: e, value: n, onChange: i, options: a, help: s, error: c, placeholder: l = "Search options", emptyMessage: u = "No results found.", disabled: d, required: f, clearable: p = !0, loading: m, className: h, id: g, allowCustomValue: _, onValueSubmit: v, name: y, density: b }) {
680
+ let x = N.useId(), S = g ?? x, C = `${S}-options`, [w, T] = N.useState(!1), [E, D] = N.useState(""), [O, k] = N.useState(0), A = N.useRef(null), j = N.useRef(null), M = N.useRef(null), P = a.find((e) => e.value === n), F = a.filter((e) => e.label.toLocaleLowerCase().includes(E.toLocaleLowerCase())), R = (e = 0) => {
681
+ for (let t = e; t < F.length; t++) if (!F[t].disabled) return t;
674
682
  return -1;
675
- }, L = () => {
676
- for (let e = N.length - 1; e >= 0; e--) if (!N[e].disabled) return e;
683
+ }, z = () => {
684
+ for (let e = F.length - 1; e >= 0; e--) if (!F[e].disabled) return e;
677
685
  return -1;
678
686
  };
679
- M.useEffect(() => {
680
- if (!S) return;
687
+ N.useEffect(() => {
688
+ if (!w) return;
681
689
  let e = (e) => {
682
- O.current?.contains(e.target) || C(!1);
690
+ A.current?.contains(e.target) || T(!1);
683
691
  };
684
692
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
685
- }, [S]), M.useEffect(() => {
686
- S && (A.current?.querySelector(`[data-index="${E}"]`))?.scrollIntoView?.({ block: "nearest" });
687
- }, [S, E]);
688
- let R = (e) => {
689
- e.disabled || (r(e.value), T(""), C(!1), k.current?.focus());
693
+ }, [w]), N.useEffect(() => {
694
+ w && (M.current?.querySelector(`[data-index="${O}"]`))?.scrollIntoView?.({ block: "nearest" });
695
+ }, [w, O]);
696
+ let H = (e) => {
697
+ e.disabled || (i(e.value), D(""), T(!1), j.current?.focus());
690
698
  };
691
- return /* @__PURE__ */ F(a, {
692
- label: t,
693
- help: o,
694
- error: s,
695
- htmlFor: b,
696
- required: d,
697
- className: m,
698
- children: /* @__PURE__ */ I("div", {
699
- ref: O,
700
- className: "relative",
699
+ return /* @__PURE__ */ I(o, {
700
+ label: e,
701
+ help: s,
702
+ error: c,
703
+ htmlFor: S,
704
+ required: f,
705
+ className: h,
706
+ children: /* @__PURE__ */ L("div", {
707
+ ref: A,
708
+ className: r("relative", t(b)),
701
709
  "data-field-container": "true",
702
710
  children: [
703
- /* @__PURE__ */ F(B, {
704
- ref: k,
705
- id: b,
706
- name: g ? v : void 0,
711
+ /* @__PURE__ */ I(V, {
712
+ density: b,
713
+ ref: j,
714
+ id: S,
715
+ name: _ ? y : void 0,
707
716
  role: "combobox",
708
717
  "aria-autocomplete": "list",
709
- "aria-expanded": S,
710
- "aria-controls": x,
711
- "aria-activedescendant": S && E >= 0 ? `${x}-${E}` : void 0,
712
- "aria-describedby": [o && `${b}-help`, s && `${b}-error`].filter(Boolean).join(" ") || void 0,
713
- required: d,
714
- placeholder: j && !S ? j.label : c,
715
- value: S ? w : j?.label ?? (g ? n : ""),
716
- disabled: u,
717
- invalid: !!s,
718
+ "aria-expanded": w,
719
+ "aria-controls": C,
720
+ "aria-activedescendant": w && O >= 0 ? `${C}-${O}` : void 0,
721
+ "aria-describedby": [s && `${S}-help`, c && `${S}-error`].filter(Boolean).join(" ") || void 0,
722
+ required: f,
723
+ placeholder: P && !w ? P.label : l,
724
+ value: w ? E : P?.label ?? (_ ? n : ""),
725
+ disabled: d,
726
+ invalid: !!c,
718
727
  onFocus: () => {
719
- C(!0), T(g ? n : ""), D(-1);
728
+ T(!0), D(_ ? n : ""), k(-1);
720
729
  },
721
730
  onChange: (e) => {
722
- T(e.currentTarget.value), g && r(e.currentTarget.value), D(P()), C(!0);
731
+ D(e.currentTarget.value), _ && i(e.currentTarget.value), k(R()), T(!0);
723
732
  },
724
733
  onKeyDown: (e) => {
725
- if (e.key === "ArrowDown") e.preventDefault(), S || C(!0), D((e) => {
726
- for (let t = Math.max(e + 1, 0); t < N.length; t++) if (!N[t].disabled) return t;
727
- return P();
734
+ if (e.key === "ArrowDown") e.preventDefault(), w || T(!0), k((e) => {
735
+ for (let t = Math.max(e + 1, 0); t < F.length; t++) if (!F[t].disabled) return t;
736
+ return R();
728
737
  });
729
- else if (e.key === "ArrowUp" && S) e.preventDefault(), D((e) => {
730
- if (e < 0) return L();
731
- for (let t = e - 1; t >= 0; t--) if (!N[t].disabled) return t;
738
+ else if (e.key === "ArrowUp" && w) e.preventDefault(), k((e) => {
739
+ if (e < 0) return z();
740
+ for (let t = e - 1; t >= 0; t--) if (!F[t].disabled) return t;
732
741
  return e;
733
742
  });
734
- else if (e.key === "Home" && S) e.preventDefault(), D(P());
735
- else if (e.key === "End" && S) e.preventDefault(), D(L());
736
- else if (e.key === "Enter" && S) {
743
+ else if (e.key === "Home" && w) e.preventDefault(), k(R());
744
+ else if (e.key === "End" && w) e.preventDefault(), k(z());
745
+ else if (e.key === "Enter" && w) {
737
746
  e.preventDefault();
738
- let t = N[E];
739
- t && !t.disabled ? R(t) : g && _?.();
740
- } else e.key === "Escape" && S ? (e.preventDefault(), C(!1), T("")) : e.key === "Tab" && C(!1);
747
+ let t = F[O];
748
+ t && !t.disabled ? H(t) : _ && v?.();
749
+ } else e.key === "Escape" && w ? (e.preventDefault(), T(!1), D("")) : e.key === "Tab" && T(!1);
741
750
  },
742
751
  autoComplete: "off"
743
752
  }),
744
- v && !g && /* @__PURE__ */ F("input", {
753
+ y && !_ && /* @__PURE__ */ I("input", {
745
754
  type: "hidden",
746
- name: v,
755
+ name: y,
747
756
  value: n,
748
- disabled: u
757
+ disabled: d
749
758
  }),
750
- /* @__PURE__ */ I("div", {
759
+ /* @__PURE__ */ L("div", {
751
760
  className: "absolute inset-y-0 right-1 flex items-center gap-0.5",
752
- children: [f && n !== "" && /* @__PURE__ */ F("button", {
761
+ children: [p && n !== "" && /* @__PURE__ */ I("button", {
753
762
  type: "button",
754
763
  "aria-label": "Clear selection",
755
- disabled: u,
756
- className: "grid h-7 w-7 place-items-center rounded text-muted-foreground hover:bg-surface-subtle disabled:cursor-not-allowed disabled:opacity-50",
764
+ disabled: d,
765
+ className: "grid h-7 w-7 place-items-center rounded-[var(--control-radius-inner)] text-muted-foreground hover:bg-interaction-hover disabled:cursor-not-allowed disabled:opacity-[var(--state-disabled-opacity)]",
757
766
  onClick: () => {
758
- r(""), T(""), D(-1), C(!0), k.current?.focus();
767
+ i(""), D(""), k(-1), T(!0), j.current?.focus();
759
768
  },
760
769
  children: "×"
761
- }), /* @__PURE__ */ F(z, {
770
+ }), /* @__PURE__ */ I(B, {
762
771
  name: "chevron-down",
763
- className: e("text-muted-foreground transition-transform", S && "rotate-180")
772
+ className: r("text-muted-foreground transition-transform", w && "rotate-180")
764
773
  })]
765
774
  }),
766
- S && (p || N.length === 0 ? /* @__PURE__ */ F("div", {
767
- id: x,
775
+ w && (m || F.length === 0 ? /* @__PURE__ */ I("div", {
776
+ id: C,
768
777
  role: "status",
769
778
  className: "absolute left-0 right-0 top-full z-50 mt-1 rounded-[var(--control-radius)] border border-border bg-surface px-3 py-2 type-caption text-muted-foreground shadow-working",
770
- children: p ? "Loading…" : l
771
- }) : /* @__PURE__ */ F("ul", {
772
- id: x,
773
- ref: A,
779
+ children: m ? "Loading…" : u
780
+ }) : /* @__PURE__ */ I("ul", {
781
+ id: C,
782
+ ref: M,
774
783
  role: "listbox",
775
- "aria-label": `${ge(t, "Search")} options`,
784
+ "aria-label": `${_e(e, "Search")} options`,
776
785
  className: "absolute left-0 right-0 top-full z-50 mt-1 max-h-64 overflow-auto rounded-[var(--control-radius)] border border-border bg-surface py-1 shadow-working",
777
- children: N.map((t, r) => /* @__PURE__ */ I("li", {
778
- id: `${x}-${r}`,
779
- "data-index": r,
786
+ children: F.map((e, t) => /* @__PURE__ */ L("li", {
787
+ id: `${C}-${t}`,
788
+ "data-index": t,
780
789
  role: "option",
781
- "aria-selected": t.value === n,
782
- "aria-disabled": t.disabled || void 0,
783
- className: e("cursor-pointer px-3 py-2 text-[length:var(--type-size-control)]", t.disabled ? "cursor-not-allowed text-muted-foreground opacity-60" : r === E ? "bg-surface-subtle" : "text-secondary-foreground"),
784
- onPointerEnter: () => !t.disabled && D(r),
790
+ "data-active": t === O || void 0,
791
+ "aria-selected": e.value === n,
792
+ "aria-disabled": e.disabled || void 0,
793
+ className: r("wos-option cursor-pointer px-3 py-2 text-[length:var(--wos-control-font-size,var(--type-size-control))]", b && "min-h-[var(--wos-control-height)]", e.disabled ? "cursor-not-allowed text-muted-foreground opacity-[var(--state-disabled-opacity)]" : t === O ? "bg-surface-subtle" : "text-secondary-foreground"),
794
+ onPointerEnter: () => !e.disabled && k(t),
785
795
  onPointerDown: (e) => e.preventDefault(),
786
- onClick: () => R(t),
787
- children: [/* @__PURE__ */ F("span", { children: t.label }), t.description && /* @__PURE__ */ F("span", {
796
+ onClick: () => H(e),
797
+ children: [/* @__PURE__ */ I("span", { children: e.label }), e.description && /* @__PURE__ */ I("span", {
788
798
  className: "block type-caption text-muted-foreground",
789
- children: t.description
799
+ children: e.description
790
800
  })]
791
- }, t.value))
801
+ }, e.value))
792
802
  }))
793
803
  ]
794
804
  })
795
805
  });
796
806
  }
797
- function ve(e) {
798
- return /* @__PURE__ */ F(_e, { ...e });
807
+ function ye(e) {
808
+ return /* @__PURE__ */ I(ve, { ...e });
799
809
  }
800
- function ye({ label: e, value: t, onChange: n, onSubmit: r, options: i = [], ...a }) {
801
- return /* @__PURE__ */ F(_e, {
810
+ function be({ label: e, value: t, onChange: n, onSubmit: r, options: i = [], ...a }) {
811
+ return /* @__PURE__ */ I(ve, {
802
812
  ...a,
803
813
  label: e,
804
814
  value: t,
@@ -809,280 +819,289 @@ function ye({ label: e, value: t, onChange: n, onSubmit: r, options: i = [], ...
809
819
  clearable: !0
810
820
  });
811
821
  }
812
- function be({ label: t, value: n, onChange: r, options: i, help: o, error: s, placeholder: c = "Search options", emptyMessage: l = "No results found.", disabled: u, required: d, name: f, className: p, id: m }) {
813
- let h = M.useId(), g = m ?? h, [_, v] = M.useState(""), [y, b] = M.useState(!1), [x, S] = M.useState(0), C = M.useRef(null), w = M.useRef(null), T = `${g}-list`, E = i.filter((e) => e.label.toLowerCase().includes(_.toLowerCase())), D = M.useRef(null), O = (e, t) => {
814
- for (let n = e; n >= 0 && n < E.length; n += t) if (!E[n].disabled) return n;
822
+ function xe({ label: e, value: n, onChange: i, options: a, help: s, error: c, placeholder: l = "Search options", emptyMessage: u = "No results found.", disabled: d, required: f, name: p, className: m, id: h, density: g }) {
823
+ let _ = N.useId(), v = h ?? _, [y, b] = N.useState(""), [x, S] = N.useState(!1), [C, w] = N.useState(0), T = N.useRef(null), E = N.useRef(null), D = `${v}-list`, O = a.filter((e) => e.label.toLowerCase().includes(y.toLowerCase())), k = N.useRef(null), A = (e, t) => {
824
+ for (let n = e; n >= 0 && n < O.length; n += t) if (!O[n].disabled) return n;
815
825
  return -1;
816
826
  };
817
- M.useEffect(() => {
818
- if (!y) return;
827
+ N.useEffect(() => {
828
+ if (!x) return;
819
829
  let e = (e) => {
820
- C.current?.contains(e.target) || b(!1);
830
+ T.current?.contains(e.target) || S(!1);
821
831
  };
822
832
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
823
- }, [y]), M.useEffect(() => {
824
- y && x >= 0 && document.getElementById(`${T}-${x}`)?.scrollIntoView?.({ block: "nearest" });
833
+ }, [x]), N.useEffect(() => {
834
+ x && C >= 0 && document.getElementById(`${D}-${C}`)?.scrollIntoView?.({ block: "nearest" });
825
835
  }, [
826
- y,
827
836
  x,
828
- T
837
+ C,
838
+ D
829
839
  ]);
830
- let k = (e) => {
831
- e.disabled || (r(n.includes(e.value) ? n.filter((t) => t !== e.value) : [...n, e.value]), v(""), S(-1), b(!0), w.current?.focus());
840
+ let j = (e) => {
841
+ e.disabled || (i(n.includes(e.value) ? n.filter((t) => t !== e.value) : [...n, e.value]), b(""), w(-1), S(!0), E.current?.focus());
832
842
  };
833
- return /* @__PURE__ */ F(a, {
834
- label: t,
835
- help: o,
836
- error: s,
837
- htmlFor: g,
838
- required: d,
839
- className: p,
840
- children: /* @__PURE__ */ I("div", {
843
+ return /* @__PURE__ */ I(o, {
844
+ label: e,
845
+ help: s,
846
+ error: c,
847
+ htmlFor: v,
848
+ required: f,
849
+ className: m,
850
+ children: /* @__PURE__ */ L("div", {
841
851
  "data-field-container": "true",
842
- ref: C,
843
- className: "relative rounded-[var(--control-radius)] border border-input bg-surface px-2 py-1.5 focus-within:ring-2 focus-within:ring-primary",
852
+ ref: T,
853
+ "data-invalid": !!c || void 0,
854
+ "data-disabled": d || void 0,
855
+ className: r("wos-multiselect relative rounded-[var(--control-radius)] border border-input bg-surface px-2 py-1.5 focus-within:ring-2 focus-within:ring-ring", t(g)),
844
856
  children: [
845
- f && n.map((e) => /* @__PURE__ */ F("input", {
857
+ p && n.map((e) => /* @__PURE__ */ I("input", {
846
858
  type: "hidden",
847
- name: f,
859
+ name: p,
848
860
  value: e,
849
- disabled: u
861
+ disabled: d
850
862
  }, e)),
851
- /* @__PURE__ */ I("div", {
863
+ /* @__PURE__ */ L("div", {
852
864
  className: "flex min-h-7 flex-wrap items-center gap-1.5",
853
865
  children: [n.map((e) => {
854
- let t = i.find((t) => t.value === e);
855
- return /* @__PURE__ */ I("span", {
856
- className: "inline-flex items-center gap-1 rounded bg-accent px-2 py-1 type-caption text-accent-foreground",
857
- children: [t?.label ?? e, /* @__PURE__ */ F("button", {
866
+ let t = a.find((t) => t.value === e);
867
+ return /* @__PURE__ */ L("span", {
868
+ className: "inline-flex items-center gap-1 rounded-[var(--control-radius-inner)] bg-selected-subtle px-2 py-1 type-caption text-selected",
869
+ children: [t?.label ?? e, /* @__PURE__ */ I("button", {
858
870
  type: "button",
859
- disabled: u,
871
+ disabled: d,
860
872
  "aria-label": `Remove ${t?.label ?? e}`,
861
873
  onClick: () => {
862
- r(n.filter((t) => t !== e)), w.current?.focus();
874
+ i(n.filter((t) => t !== e)), E.current?.focus();
863
875
  },
864
- className: "min-h-8 min-w-8 rounded hover:text-foreground disabled:cursor-not-allowed",
876
+ className: "min-h-8 min-w-8 rounded-[var(--control-radius-inner)] hover:text-foreground disabled:cursor-not-allowed",
865
877
  children: "×"
866
878
  })]
867
879
  }, e);
868
- }), /* @__PURE__ */ F("input", {
869
- ref: w,
870
- id: g,
880
+ }), /* @__PURE__ */ I("input", {
881
+ "data-density": g,
882
+ ref: E,
883
+ id: v,
871
884
  role: "combobox",
872
- "aria-expanded": y,
873
- "aria-controls": T,
874
- "aria-activedescendant": y && x >= 0 ? `${T}-${x}` : void 0,
885
+ "aria-expanded": x,
886
+ "aria-controls": D,
887
+ "aria-activedescendant": x && C >= 0 ? `${D}-${C}` : void 0,
875
888
  "aria-autocomplete": "list",
876
- "aria-invalid": !!s || void 0,
877
- "aria-describedby": [o && `${g}-help`, s && `${g}-error`].filter(Boolean).join(" ") || void 0,
878
- disabled: u,
879
- required: d && n.length === 0,
880
- className: "min-w-28 flex-1 border-0 bg-transparent px-1 py-1 text-[length:var(--type-size-control)] outline-none placeholder:text-muted-foreground",
881
- placeholder: n.length ? "Add another" : c,
882
- value: _,
889
+ "aria-invalid": !!c || void 0,
890
+ "aria-describedby": [s && `${v}-help`, c && `${v}-error`].filter(Boolean).join(" ") || void 0,
891
+ disabled: d,
892
+ required: f && n.length === 0,
893
+ className: "min-w-28 flex-1 border-0 bg-transparent px-1 py-1 text-[length:var(--wos-control-font-size,var(--type-size-control))] outline-none placeholder:text-muted-foreground",
894
+ placeholder: n.length ? "Add another" : l,
895
+ value: y,
883
896
  onFocus: () => {
884
- b(!0), S(-1);
897
+ S(!0), w(-1);
885
898
  },
886
899
  onChange: (e) => {
887
- v(e.currentTarget.value), S(O(0, 1)), b(!0);
900
+ b(e.currentTarget.value), w(A(0, 1)), S(!0);
888
901
  },
889
902
  onKeyDown: (e) => {
890
- e.key === "ArrowDown" ? (e.preventDefault(), b(!0), S((e) => {
891
- let t = O(e < 0 ? 0 : e + 1, 1);
892
- return t < 0 ? O(0, 1) : t;
893
- })) : e.key === "ArrowUp" ? (e.preventDefault(), S((e) => {
894
- let t = O(e < 0 ? E.length - 1 : e - 1, -1);
895
- return t < 0 ? O(E.length - 1, -1) : t;
896
- })) : e.key === "Home" && y ? (e.preventDefault(), S(O(0, 1))) : e.key === "End" && y ? (e.preventDefault(), S(O(E.length - 1, -1))) : e.key === "Enter" && y && E[x] && !E[x].disabled ? (e.preventDefault(), k(E[x])) : e.key === "Escape" ? b(!1) : e.key === "Backspace" && !_ && n.length ? r(n.slice(0, -1)) : e.key === "Tab" && b(!1);
903
+ e.key === "ArrowDown" ? (e.preventDefault(), S(!0), w((e) => {
904
+ let t = A(e < 0 ? 0 : e + 1, 1);
905
+ return t < 0 ? A(0, 1) : t;
906
+ })) : e.key === "ArrowUp" ? (e.preventDefault(), w((e) => {
907
+ let t = A(e < 0 ? O.length - 1 : e - 1, -1);
908
+ return t < 0 ? A(O.length - 1, -1) : t;
909
+ })) : e.key === "Home" && x ? (e.preventDefault(), w(A(0, 1))) : e.key === "End" && x ? (e.preventDefault(), w(A(O.length - 1, -1))) : e.key === "Enter" && x && O[C] && !O[C].disabled ? (e.preventDefault(), j(O[C])) : e.key === "Escape" ? S(!1) : e.key === "Backspace" && !y && n.length ? i(n.slice(0, -1)) : e.key === "Tab" && S(!1);
897
910
  }
898
911
  })]
899
912
  }),
900
- y && (E.length ? /* @__PURE__ */ F("ul", {
901
- id: T,
902
- ref: D,
913
+ x && (O.length ? /* @__PURE__ */ I("ul", {
914
+ id: D,
915
+ ref: k,
903
916
  role: "listbox",
904
917
  "aria-multiselectable": "true",
905
- "aria-label": `${ge(t, "Selection")} options`,
918
+ "aria-label": `${_e(e, "Selection")} options`,
906
919
  className: "absolute left-0 right-0 top-full z-50 mt-1 max-h-64 overflow-auto rounded-[var(--control-radius)] border border-border bg-surface py-1 shadow-working",
907
- children: E.map((t, r) => /* @__PURE__ */ I("li", {
908
- id: `${T}-${r}`,
909
- "data-index": r,
920
+ children: O.map((e, t) => /* @__PURE__ */ L("li", {
921
+ id: `${D}-${t}`,
922
+ "data-index": t,
910
923
  role: "option",
911
- "aria-selected": n.includes(t.value),
912
- "aria-disabled": t.disabled || void 0,
913
- className: e("cursor-pointer px-3 py-2 text-[length:var(--type-size-control)]", t.disabled && "opacity-50", r === x && "bg-surface-subtle"),
924
+ "data-active": t === C || void 0,
925
+ "aria-selected": n.includes(e.value),
926
+ "aria-disabled": e.disabled || void 0,
927
+ className: r("wos-option cursor-pointer px-3 py-2 text-[length:var(--wos-control-font-size,var(--type-size-control))]", g && "min-h-[var(--wos-control-height)]", e.disabled && "opacity-[var(--state-disabled-opacity)]", t === C && "bg-surface-subtle"),
914
928
  onPointerDown: (e) => e.preventDefault(),
915
- onPointerEnter: () => !t.disabled && S(r),
916
- onClick: () => k(t),
917
- children: [t.label, n.includes(t.value) && /* @__PURE__ */ F("span", {
929
+ onPointerEnter: () => !e.disabled && w(t),
930
+ onClick: () => j(e),
931
+ children: [e.label, n.includes(e.value) && /* @__PURE__ */ I("span", {
918
932
  className: "float-right",
919
933
  children: "✓"
920
934
  })]
921
- }, t.value))
922
- }) : /* @__PURE__ */ F("div", {
923
- id: T,
935
+ }, e.value))
936
+ }) : /* @__PURE__ */ I("div", {
937
+ id: D,
924
938
  role: "status",
925
939
  className: "absolute left-0 right-0 top-full z-50 mt-1 rounded-[var(--control-radius)] border border-border bg-surface px-3 py-2 type-caption text-muted-foreground shadow-working",
926
- children: l
940
+ children: u
927
941
  }))
928
942
  ]
929
943
  })
930
944
  });
931
945
  }
932
- function xe({ label: t, help: n, error: r, className: i, onChange: a, ...o }) {
933
- let s = M.useId(), c = o.id ?? s, l = n ? `${c}-help` : void 0, u = r ? `${c}-error` : void 0;
934
- return /* @__PURE__ */ I("label", {
935
- className: e("flex min-h-11 cursor-pointer items-start gap-2.5 py-1.5", o.disabled && "cursor-not-allowed opacity-60", i),
936
- children: [/* @__PURE__ */ F("input", {
937
- ...o,
938
- id: c,
946
+ function Se({ label: e, help: n, error: i, className: a, onChange: o, density: s, ...c }) {
947
+ let l = N.useId(), u = c.id ?? l, d = n ? `${u}-help` : void 0, f = i ? `${u}-error` : void 0;
948
+ return /* @__PURE__ */ L("label", {
949
+ "data-disabled": c.disabled || void 0,
950
+ "data-density": s,
951
+ className: r("wos-choice-label flex min-h-11 cursor-pointer items-start gap-2.5 py-1.5 rounded-[var(--control-radius)] hover:bg-interaction-hover", t(s), s && "min-h-[var(--wos-control-height)]", c.disabled && "cursor-not-allowed opacity-[var(--state-disabled-opacity)]", a),
952
+ children: [/* @__PURE__ */ I("input", {
953
+ ...c,
954
+ id: u,
939
955
  type: "checkbox",
940
- "aria-invalid": !!r || o["aria-invalid"] || void 0,
956
+ "aria-invalid": !!i || c["aria-invalid"] || void 0,
941
957
  "aria-describedby": [
942
- o["aria-describedby"],
943
- l,
944
- u
958
+ c["aria-describedby"],
959
+ d,
960
+ f
945
961
  ].filter(Boolean).join(" ") || void 0,
946
- className: "mt-0.5 h-4 w-4 accent-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",
947
- onChange: (e) => a?.(e.currentTarget.checked, e)
948
- }), /* @__PURE__ */ I("span", {
962
+ className: "wos-choice-input mt-0.5 h-4 w-4 accent-selection-indicator focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
963
+ onChange: (e) => o?.(e.currentTarget.checked, e)
964
+ }), /* @__PURE__ */ L("span", {
949
965
  className: "min-w-0",
950
966
  children: [
951
- /* @__PURE__ */ I("span", {
967
+ /* @__PURE__ */ L("span", {
952
968
  className: "block type-label text-secondary-foreground",
953
- children: [t, o.required && /* @__PURE__ */ F("span", {
969
+ children: [e, c.required && /* @__PURE__ */ I("span", {
954
970
  className: "ml-1 text-muted-foreground",
955
971
  children: "Required"
956
972
  })]
957
973
  }),
958
- n && /* @__PURE__ */ F("span", {
959
- id: l,
974
+ n && /* @__PURE__ */ I("span", {
975
+ id: d,
960
976
  className: "block type-caption text-muted-foreground",
961
977
  children: n
962
978
  }),
963
- r && /* @__PURE__ */ F("span", {
964
- id: u,
979
+ i && /* @__PURE__ */ I("span", {
980
+ id: f,
965
981
  className: "block type-caption text-destructive",
966
- children: r
982
+ children: i
967
983
  })
968
984
  ]
969
985
  })]
970
986
  });
971
987
  }
972
- function Se({ label: t, value: n, onChange: r, options: i, help: a, error: o, disabled: s, required: c, orientation: l = "vertical", name: u, className: d }) {
973
- let f = M.useId(), p = u ?? f;
974
- return /* @__PURE__ */ I("fieldset", {
975
- className: e("min-w-0", d),
976
- disabled: s,
977
- "aria-describedby": [a && `${f}-help`, o && `${f}-error`].filter(Boolean).join(" ") || void 0,
988
+ function Ce({ label: e, value: n, onChange: i, options: a, help: o, error: s, disabled: c, required: l, orientation: u = "vertical", name: d, className: f, density: p }) {
989
+ let m = N.useId(), h = d ?? m;
990
+ return /* @__PURE__ */ L("fieldset", {
991
+ className: r("min-w-0", t(p), f),
992
+ disabled: c,
993
+ "aria-describedby": [o && `${m}-help`, s && `${m}-error`].filter(Boolean).join(" ") || void 0,
978
994
  children: [
979
- /* @__PURE__ */ I("legend", {
980
- className: "mb-2 type-label font-semibold text-secondary-foreground",
981
- children: [t, c && /* @__PURE__ */ F("span", {
995
+ /* @__PURE__ */ L("legend", {
996
+ className: "mb-2 type-label text-secondary-foreground",
997
+ children: [e, l && /* @__PURE__ */ I("span", {
982
998
  className: "ml-1 font-normal text-muted-foreground",
983
999
  children: "Required"
984
1000
  })]
985
1001
  }),
986
- /* @__PURE__ */ F("div", {
987
- className: e("flex gap-x-5 gap-y-2", l === "vertical" ? "flex-col" : "flex-wrap"),
1002
+ /* @__PURE__ */ I("div", {
1003
+ className: r("flex gap-x-5 gap-y-2", u === "vertical" ? "flex-col" : "flex-wrap"),
988
1004
  role: "radiogroup",
989
- "aria-required": c || void 0,
990
- "aria-invalid": !!o || void 0,
991
- children: i.map((t) => /* @__PURE__ */ I("label", {
992
- className: e("flex min-h-11 cursor-pointer items-center gap-2", (s || t.disabled) && "cursor-not-allowed opacity-60"),
993
- children: [/* @__PURE__ */ F("input", {
1005
+ "aria-required": l || void 0,
1006
+ "aria-invalid": !!s || void 0,
1007
+ children: a.map((e) => /* @__PURE__ */ L("label", {
1008
+ "data-disabled": c || e.disabled || void 0,
1009
+ "data-density": p,
1010
+ className: r("wos-choice-label flex min-h-11 cursor-pointer items-center gap-2 rounded-[var(--control-radius)] hover:bg-interaction-hover", p && "min-h-[var(--wos-control-height)]", (c || e.disabled) && "cursor-not-allowed opacity-[var(--state-disabled-opacity)]"),
1011
+ children: [/* @__PURE__ */ I("input", {
1012
+ "aria-invalid": !!s || void 0,
994
1013
  type: "radio",
995
- name: p,
996
- value: t.value,
997
- checked: n === t.value,
998
- disabled: s || t.disabled,
999
- required: c,
1000
- onChange: () => r(t.value),
1001
- className: "h-4 w-4 accent-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
1002
- }), /* @__PURE__ */ F("span", {
1014
+ name: h,
1015
+ value: e.value,
1016
+ checked: n === e.value,
1017
+ disabled: c || e.disabled,
1018
+ required: l,
1019
+ onChange: () => i(e.value),
1020
+ className: "wos-choice-input h-4 w-4 accent-selection-indicator focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
1021
+ }), /* @__PURE__ */ I("span", {
1003
1022
  className: "type-supporting text-secondary-foreground",
1004
- children: t.label
1023
+ children: e.label
1005
1024
  })]
1006
- }, t.value))
1025
+ }, e.value))
1007
1026
  }),
1008
- a && /* @__PURE__ */ F("p", {
1009
- id: `${f}-help`,
1027
+ o && /* @__PURE__ */ I("p", {
1028
+ id: `${m}-help`,
1010
1029
  className: "mt-1 type-caption text-muted-foreground",
1011
- children: a
1030
+ children: o
1012
1031
  }),
1013
- o && /* @__PURE__ */ F("p", {
1014
- id: `${f}-error`,
1032
+ s && /* @__PURE__ */ I("p", {
1033
+ id: `${m}-error`,
1015
1034
  className: "mt-1 type-caption text-destructive",
1016
- children: o
1035
+ children: s
1017
1036
  })
1018
1037
  ]
1019
1038
  });
1020
1039
  }
1021
- function Ce({ label: t, description: n, error: r, className: i, onChange: a, ...o }) {
1022
- let s = M.useId(), c = r ? `${o.id ?? s}-error` : void 0;
1023
- return /* @__PURE__ */ I("div", {
1024
- className: e("space-y-1", i),
1025
- children: [/* @__PURE__ */ I("label", {
1026
- className: e("flex min-h-11 cursor-pointer items-center justify-between gap-4", o.disabled && "cursor-not-allowed opacity-60"),
1040
+ function we({ label: e, description: t, error: n, className: i, onChange: a, ...o }) {
1041
+ let s = N.useId(), c = n ? `${o.id ?? s}-error` : void 0;
1042
+ return /* @__PURE__ */ L("div", {
1043
+ className: r("space-y-1", i),
1044
+ children: [/* @__PURE__ */ L("label", {
1045
+ className: r("flex min-h-11 cursor-pointer items-center justify-between gap-4", o.disabled && "cursor-not-allowed opacity-[var(--state-disabled-opacity)]"),
1027
1046
  children: [
1028
- /* @__PURE__ */ I("span", { children: [/* @__PURE__ */ I("span", {
1047
+ /* @__PURE__ */ L("span", { children: [/* @__PURE__ */ L("span", {
1029
1048
  className: "block type-label text-secondary-foreground",
1030
- children: [t, o.required && /* @__PURE__ */ F("span", {
1049
+ children: [e, o.required && /* @__PURE__ */ I("span", {
1031
1050
  className: "ml-1 text-muted-foreground",
1032
1051
  children: "Required"
1033
1052
  })]
1034
- }), n && /* @__PURE__ */ F("span", {
1053
+ }), t && /* @__PURE__ */ I("span", {
1035
1054
  id: s,
1036
1055
  className: "block type-caption text-muted-foreground",
1037
- children: n
1056
+ children: t
1038
1057
  })] }),
1039
- /* @__PURE__ */ F("input", {
1058
+ /* @__PURE__ */ I("input", {
1040
1059
  ...o,
1041
1060
  type: "checkbox",
1042
1061
  role: "switch",
1043
- "aria-invalid": !!r || o["aria-invalid"] || void 0,
1062
+ "aria-invalid": !!n || o["aria-invalid"] || void 0,
1044
1063
  "aria-describedby": [
1045
- n && s,
1064
+ t && s,
1046
1065
  c,
1047
1066
  o["aria-describedby"]
1048
1067
  ].filter(Boolean).join(" ") || void 0,
1049
1068
  className: "peer sr-only",
1050
1069
  onChange: (e) => a?.(e.currentTarget.checked)
1051
1070
  }),
1052
- /* @__PURE__ */ F("span", {
1071
+ /* @__PURE__ */ I("span", {
1053
1072
  "aria-hidden": "true",
1054
- className: "relative h-6 w-11 shrink-0 rounded-full bg-border transition-colors duration-[var(--motion-duration-fast)] after:absolute after:left-0.5 after:top-0.5 after:h-5 after:w-5 after:rounded-full after:bg-white after:shadow-sm after:transition-transform after:duration-[var(--motion-duration-fast)] peer-checked:bg-primary peer-checked:after:translate-x-5 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-primary peer-disabled:opacity-60"
1073
+ className: "relative h-6 w-11 shrink-0 rounded-full bg-border transition-colors duration-[var(--motion-duration-fast)] after:absolute after:left-0.5 after:top-0.5 after:h-5 after:w-5 after:rounded-full after:bg-surface after:shadow-sm after:transition-transform after:duration-[var(--motion-duration-fast)] peer-checked:bg-selection-indicator peer-checked:after:translate-x-5 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-ring peer-disabled:opacity-[var(--state-disabled-opacity)] peer-aria-[invalid=true]:ring-1 peer-aria-[invalid=true]:ring-destructive"
1055
1074
  })
1056
1075
  ]
1057
- }), r && /* @__PURE__ */ F("p", {
1076
+ }), n && /* @__PURE__ */ I("p", {
1058
1077
  id: c,
1059
1078
  className: "type-caption text-destructive",
1060
- children: r
1079
+ children: n
1061
1080
  })]
1062
1081
  });
1063
1082
  }
1064
- function we({ label: e, value: t, onChange: n, help: r, error: i, className: o, ...s }) {
1065
- let c = s.id ?? M.useId();
1066
- return /* @__PURE__ */ F(a, {
1083
+ function Te({ label: e, value: t, onChange: n, help: r, error: i, className: a, ...s }) {
1084
+ let c = s.id ?? N.useId();
1085
+ return /* @__PURE__ */ I(o, {
1067
1086
  label: e,
1068
1087
  help: r,
1069
1088
  error: i,
1070
1089
  htmlFor: c,
1071
1090
  required: s.required,
1072
- className: o,
1073
- children: /* @__PURE__ */ I("div", {
1091
+ className: a,
1092
+ children: /* @__PURE__ */ L("div", {
1074
1093
  "data-field-container": "true",
1075
1094
  className: "flex items-center gap-3",
1076
- children: [/* @__PURE__ */ F("input", {
1095
+ children: [/* @__PURE__ */ I("input", {
1077
1096
  ...s,
1078
1097
  id: c,
1079
1098
  type: "range",
1080
1099
  value: t,
1081
1100
  "aria-describedby": [r && `${c}-help`, i && `${c}-error`].filter(Boolean).join(" ") || void 0,
1082
1101
  "aria-invalid": !!i || void 0,
1083
- className: "w-full accent-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",
1102
+ className: "w-full accent-selection-indicator focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
1084
1103
  onChange: (e) => n(Number(e.currentTarget.value))
1085
- }), /* @__PURE__ */ F("output", {
1104
+ }), /* @__PURE__ */ I("output", {
1086
1105
  htmlFor: c,
1087
1106
  className: "min-w-10 text-right type-caption tabular",
1088
1107
  children: t
@@ -1090,88 +1109,90 @@ function we({ label: e, value: t, onChange: n, help: r, error: i, className: o,
1090
1109
  })
1091
1110
  });
1092
1111
  }
1093
- function Te({ pressed: t, onPressedChange: n, className: r, children: i, ...a }) {
1094
- return /* @__PURE__ */ F("button", {
1095
- ...a,
1112
+ function Ee({ pressed: e, onPressedChange: n, className: i, children: a, density: o, ...s }) {
1113
+ return /* @__PURE__ */ I("button", {
1114
+ ...s,
1115
+ "data-density": o,
1096
1116
  type: "button",
1097
- "aria-pressed": t,
1098
- className: e("inline-flex min-h-9 items-center justify-center rounded-[var(--control-radius)] border px-3 type-control transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:cursor-not-allowed disabled:opacity-60", t ? "border-primary bg-accent text-accent-foreground" : "border-border bg-surface text-secondary-foreground hover:bg-surface-subtle", r),
1099
- onClick: () => !a.disabled && n(!t),
1100
- children: i
1117
+ "aria-pressed": e,
1118
+ className: r("wos-state-control inline-flex min-h-9 items-center justify-center rounded-[var(--control-radius)] border px-3 type-control transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:cursor-not-allowed disabled:opacity-[var(--state-disabled-opacity)]", t(o), o && "min-h-[var(--wos-control-height)] text-[length:var(--wos-control-font-size)]", e ? "border-selection-indicator bg-selected-subtle text-selected" : "border-border bg-surface text-secondary-foreground hover:bg-interaction-hover", i),
1119
+ onClick: () => !s.disabled && n(!e),
1120
+ children: a
1101
1121
  });
1102
1122
  }
1103
- function Ee({ label: t, value: n, onChange: r, options: i, type: a = "single", disabled: o, className: s }) {
1104
- let c = Array.isArray(n) ? n : n ? [n] : [], l = (e) => {
1105
- a === "multiple" ? r(c.includes(e) ? c.filter((t) => t !== e) : [...c, e]) : c[0] !== e && r(e);
1106
- }, u = i.map((e, t) => !e.disabled && !o ? t : -1).filter((e) => e >= 0), d = i.findIndex((e) => c.includes(e.value) && !e.disabled), f = u.includes(d) ? d : u[0] ?? -1, p = (e, t) => {
1123
+ function De({ label: e, value: n, onChange: i, options: a, type: o = "single", disabled: s, className: c, density: l }) {
1124
+ let u = Array.isArray(n) ? n : n ? [n] : [], d = (e) => {
1125
+ o === "multiple" ? i(u.includes(e) ? u.filter((t) => t !== e) : [...u, e]) : u[0] !== e && i(e);
1126
+ }, f = a.map((e, t) => !e.disabled && !s ? t : -1).filter((e) => e >= 0), p = a.findIndex((e) => u.includes(e.value) && !e.disabled), m = f.includes(p) ? p : f[0] ?? -1, h = (e, t) => {
1107
1127
  let n = ["ArrowRight", "ArrowDown"].includes(e.key) ? 1 : ["ArrowLeft", "ArrowUp"].includes(e.key) ? -1 : 0;
1108
- if (!n || a !== "single" || !u.length) return;
1128
+ if (!n || o !== "single" || !f.length) return;
1109
1129
  e.preventDefault();
1110
- let r = u.indexOf(t), o = u[(r + n + u.length) % u.length];
1111
- (e.currentTarget.parentElement?.children[o])?.focus(), l(i[o].value);
1130
+ let r = f.indexOf(t), i = f[(r + n + f.length) % f.length];
1131
+ (e.currentTarget.parentElement?.children[i])?.focus(), d(a[i].value);
1112
1132
  };
1113
- return /* @__PURE__ */ F("div", {
1114
- role: a === "single" ? "radiogroup" : "group",
1115
- "aria-label": t,
1116
- className: e("inline-flex max-w-full flex-wrap rounded-[var(--control-radius)] border border-border bg-surface p-0.5", s),
1117
- children: i.map((t, n) => /* @__PURE__ */ F("button", {
1133
+ return /* @__PURE__ */ I("div", {
1134
+ "data-density": l,
1135
+ role: o === "single" ? "radiogroup" : "group",
1136
+ "aria-label": e,
1137
+ className: r("inline-flex max-w-full flex-wrap rounded-[var(--control-radius)] border border-border bg-surface p-0.5", t(l), c),
1138
+ children: a.map((e, t) => /* @__PURE__ */ I("button", {
1118
1139
  type: "button",
1119
- role: a === "single" ? "radio" : "button",
1120
- "aria-checked": c.includes(t.value),
1121
- tabIndex: a === "single" ? n === f ? 0 : -1 : void 0,
1122
- disabled: o || t.disabled,
1123
- className: e("min-h-8 rounded-[3px] px-3 type-control text-secondary-foreground focus-visible:outline-2 focus-visible:outline-primary disabled:opacity-50", c.includes(t.value) && "bg-accent font-medium text-accent-foreground"),
1124
- onKeyDown: (e) => p(e, n),
1125
- onClick: () => l(t.value),
1126
- children: t.label
1127
- }, t.value))
1140
+ role: o === "single" ? "radio" : "button",
1141
+ "aria-checked": u.includes(e.value),
1142
+ tabIndex: o === "single" ? t === m ? 0 : -1 : void 0,
1143
+ disabled: s || e.disabled,
1144
+ className: r("min-h-8 rounded-[var(--control-radius)] px-3 type-control hover:bg-interaction-hover text-secondary-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-[var(--state-disabled-opacity)]", l && "min-h-[var(--wos-control-height)] text-[length:var(--wos-control-font-size)]", u.includes(e.value) && "bg-selected-subtle font-medium text-selected"),
1145
+ onKeyDown: (e) => h(e, t),
1146
+ onClick: () => d(e.value),
1147
+ children: e.label
1148
+ }, e.value))
1128
1149
  });
1129
1150
  }
1130
- var De = Ee;
1131
- function Oe({ label: t, value: n, onChange: r, length: i = 6, error: a, help: o, disabled: s, required: c, name: l, className: u }) {
1132
- let d = M.useId(), f = M.useRef([]), p = Array.from({ length: i }, (e, t) => n[t] ?? ""), m = (e, t) => {
1133
- let n = t.replace(/\D/g, "");
1134
- if (!n) {
1151
+ var Oe = De;
1152
+ function ke({ label: e, value: t, onChange: n, length: i = 6, error: a, help: o, disabled: s, required: c, name: l, className: u }) {
1153
+ let d = N.useId(), f = N.useRef([]), p = Array.from({ length: i }, (e, n) => t[n] ?? ""), m = (e, t) => {
1154
+ let r = t.replace(/\D/g, "");
1155
+ if (!r) {
1135
1156
  let t = [...p];
1136
- t[e] = "", r(t.join(""));
1157
+ t[e] = "", n(t.join(""));
1137
1158
  return;
1138
1159
  }
1139
- let a = n.slice(0, i - e), o = [...p];
1160
+ let a = r.slice(0, i - e), o = [...p];
1140
1161
  a.split("").forEach((t, n) => {
1141
1162
  o[e + n] = t;
1142
- }), r(o.join("")), f.current[Math.min(e + a.length, i - 1)]?.focus();
1163
+ }), n(o.join("")), f.current[Math.min(e + a.length, i - 1)]?.focus();
1143
1164
  };
1144
- return /* @__PURE__ */ I("fieldset", {
1145
- className: e("min-w-0", u),
1165
+ return /* @__PURE__ */ L("fieldset", {
1166
+ className: r("min-w-0", u),
1146
1167
  children: [
1147
- /* @__PURE__ */ I("legend", {
1148
- className: "mb-2 type-label font-semibold text-secondary-foreground",
1149
- children: [t, c && /* @__PURE__ */ F("span", {
1168
+ /* @__PURE__ */ L("legend", {
1169
+ className: "mb-2 type-label text-secondary-foreground",
1170
+ children: [e, c && /* @__PURE__ */ I("span", {
1150
1171
  className: "ml-1 font-normal text-muted-foreground",
1151
1172
  children: "Required"
1152
1173
  })]
1153
1174
  }),
1154
- /* @__PURE__ */ F("div", {
1175
+ /* @__PURE__ */ I("div", {
1155
1176
  className: "flex flex-wrap gap-2",
1156
1177
  role: "group",
1157
- "aria-label": String(t),
1158
- children: p.map((e, n) => /* @__PURE__ */ F("input", {
1178
+ "aria-label": String(e),
1179
+ children: p.map((t, n) => /* @__PURE__ */ I("input", {
1159
1180
  ref: (e) => {
1160
1181
  f.current[n] = e;
1161
1182
  },
1162
1183
  id: `${d}-${n}`,
1163
1184
  name: n === 0 ? l : void 0,
1164
- "aria-label": `${String(t)} digit ${n + 1} of ${i}`,
1185
+ "aria-label": `${String(e)} digit ${n + 1} of ${i}`,
1165
1186
  "aria-invalid": !!a || void 0,
1166
1187
  "aria-describedby": a ? `${d}-error` : o ? `${d}-help` : void 0,
1167
1188
  type: "text",
1168
1189
  inputMode: "numeric",
1169
1190
  autoComplete: n === 0 ? "one-time-code" : "off",
1170
1191
  maxLength: i,
1171
- value: e,
1192
+ value: t,
1172
1193
  required: c,
1173
1194
  disabled: s,
1174
- className: "w-10 h-11 rounded-[var(--control-radius)] border border-input bg-surface text-center text-lg tabular focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:opacity-60",
1195
+ className: "wos-choice-input w-10 h-11 rounded-[var(--control-radius)] border border-input bg-surface text-center text-lg tabular focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:opacity-[var(--state-disabled-opacity)]",
1175
1196
  onChange: (e) => m(n, e.currentTarget.value),
1176
1197
  onKeyDown: (e) => {
1177
1198
  e.key === "Backspace" && !p[n] && n > 0 && f.current[n - 1]?.focus(), e.key === "ArrowLeft" && n > 0 && (e.preventDefault(), f.current[n - 1]?.focus()), e.key === "ArrowRight" && n < i - 1 && (e.preventDefault(), f.current[n + 1]?.focus());
@@ -1182,12 +1203,12 @@ function Oe({ label: t, value: n, onChange: r, length: i = 6, error: a, help: o,
1182
1203
  }
1183
1204
  }, n))
1184
1205
  }),
1185
- o && /* @__PURE__ */ F("p", {
1206
+ o && /* @__PURE__ */ I("p", {
1186
1207
  id: `${d}-help`,
1187
1208
  className: "mt-1 type-caption text-muted-foreground",
1188
1209
  children: o
1189
1210
  }),
1190
- a && /* @__PURE__ */ F("p", {
1211
+ a && /* @__PURE__ */ I("p", {
1191
1212
  id: `${d}-error`,
1192
1213
  className: "mt-1 type-caption text-destructive",
1193
1214
  children: a
@@ -1195,29 +1216,29 @@ function Oe({ label: t, value: n, onChange: r, length: i = 6, error: a, help: o,
1195
1216
  ]
1196
1217
  });
1197
1218
  }
1198
- function ke({ label: t, files: n, onFilesChange: r, accept: i, multiple: a, maxSizeBytes: o, help: s, disabled: c, required: l, className: u }) {
1199
- let d = M.useId(), [f, p] = M.useState(!1), [m, h] = M.useState(""), g = s ? `${d}-help` : void 0, _ = m ? `${d}-error` : void 0, v = (e) => {
1200
- let t = Array.from(e), s = o ? t.find((e) => e.size > o) : void 0;
1219
+ function Ae({ label: e, files: t, onFilesChange: n, accept: i, multiple: a, maxSizeBytes: o, help: s, disabled: c, required: l, className: u }) {
1220
+ let d = N.useId(), [f, p] = N.useState(!1), [m, h] = N.useState(""), g = s ? `${d}-help` : void 0, _ = m ? `${d}-error` : void 0, v = (e) => {
1221
+ let r = Array.from(e), s = o ? r.find((e) => e.size > o) : void 0;
1201
1222
  if (s) {
1202
1223
  let e = o >= 1048576 ? `${(o / 1024 / 1024).toFixed(1)} MB` : `${Math.round(o / 1024)} KB`;
1203
1224
  h(`${s.name} exceeds the ${e} limit.`);
1204
1225
  return;
1205
1226
  }
1206
- let c = i?.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), l = c?.length ? t.find((e) => !c.some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type === t)) : void 0;
1207
- l ? h(`${l.name} is not an accepted file type (${i}).`) : (h(""), r(a ? [...n, ...t] : t.slice(0, 1)));
1227
+ let c = i?.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean), l = c?.length ? r.find((e) => !c.some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type === t)) : void 0;
1228
+ l ? h(`${l.name} is not an accepted file type (${i}).`) : (h(""), n(a ? [...t, ...r] : r.slice(0, 1)));
1208
1229
  };
1209
- return /* @__PURE__ */ I("div", {
1210
- className: e("space-y-1.5", u),
1230
+ return /* @__PURE__ */ L("div", {
1231
+ className: r("space-y-1.5", u),
1211
1232
  children: [
1212
- /* @__PURE__ */ I("label", {
1233
+ /* @__PURE__ */ L("label", {
1213
1234
  htmlFor: d,
1214
- className: "block type-label font-semibold text-secondary-foreground",
1215
- children: [t, l && /* @__PURE__ */ F("span", {
1235
+ className: "block type-label text-secondary-foreground",
1236
+ children: [e, l && /* @__PURE__ */ I("span", {
1216
1237
  className: "ml-1 font-normal text-muted-foreground",
1217
1238
  children: "Required"
1218
1239
  })]
1219
1240
  }),
1220
- /* @__PURE__ */ I("div", {
1241
+ /* @__PURE__ */ L("div", {
1221
1242
  onDragOver: (e) => {
1222
1243
  e.preventDefault(), c || p(!0);
1223
1244
  },
@@ -1225,9 +1246,9 @@ function ke({ label: t, files: n, onFilesChange: r, accept: i, multiple: a, maxS
1225
1246
  onDrop: (e) => {
1226
1247
  e.preventDefault(), p(!1), c || v(e.dataTransfer.files);
1227
1248
  },
1228
- className: e("rounded-[var(--surface-radius)] border border-dashed p-4 text-center", f ? "border-primary bg-accent" : "border-border", c && "opacity-60"),
1249
+ className: r("rounded-[var(--surface-radius)] border border-dashed p-4 text-center", f ? "border-selection-indicator bg-selected-subtle" : "border-border", c && "opacity-[var(--state-disabled-opacity)]"),
1229
1250
  children: [
1230
- /* @__PURE__ */ F("input", {
1251
+ /* @__PURE__ */ I("input", {
1231
1252
  id: d,
1232
1253
  type: "file",
1233
1254
  accept: i,
@@ -1241,12 +1262,12 @@ function ke({ label: t, files: n, onFilesChange: r, accept: i, multiple: a, maxS
1241
1262
  e.currentTarget.files && v(e.currentTarget.files), e.currentTarget.value = "";
1242
1263
  }
1243
1264
  }),
1244
- /* @__PURE__ */ I("label", {
1265
+ /* @__PURE__ */ L("label", {
1245
1266
  htmlFor: d,
1246
- className: e("inline-flex min-h-11 cursor-pointer items-center rounded-[var(--control-radius)] border border-border bg-surface px-3 type-control hover:bg-surface-subtle peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-primary", c && "cursor-not-allowed"),
1267
+ className: r("inline-flex min-h-11 cursor-pointer items-center rounded-[var(--control-radius)] border border-border bg-surface px-3 type-control hover:bg-interaction-hover peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-ring", c && "cursor-not-allowed"),
1247
1268
  children: ["Choose file", a ? "s" : ""]
1248
1269
  }),
1249
- /* @__PURE__ */ I("p", {
1270
+ /* @__PURE__ */ L("p", {
1250
1271
  className: "mt-2 type-caption text-muted-foreground",
1251
1272
  children: [
1252
1273
  "or drop ",
@@ -1255,57 +1276,63 @@ function ke({ label: t, files: n, onFilesChange: r, accept: i, multiple: a, maxS
1255
1276
  i ? ` · ${i}` : ""
1256
1277
  ]
1257
1278
  }),
1258
- s && /* @__PURE__ */ F("p", {
1279
+ s && /* @__PURE__ */ I("p", {
1259
1280
  id: g,
1260
1281
  className: "mt-1 type-caption text-muted-foreground",
1261
1282
  children: s
1262
1283
  })
1263
1284
  ]
1264
1285
  }),
1265
- m && /* @__PURE__ */ F("p", {
1286
+ m && /* @__PURE__ */ I("p", {
1266
1287
  id: _,
1267
1288
  role: "alert",
1268
1289
  className: "type-caption text-destructive",
1269
1290
  children: m
1270
1291
  }),
1271
- n.length > 0 && /* @__PURE__ */ F("ul", {
1292
+ t.length > 0 && /* @__PURE__ */ I("ul", {
1272
1293
  "aria-label": "Selected files",
1273
1294
  className: "space-y-1",
1274
- children: n.map((e, t) => /* @__PURE__ */ I("li", {
1295
+ children: t.map((e, r) => /* @__PURE__ */ L("li", {
1275
1296
  className: "flex items-center justify-between gap-2 type-caption",
1276
- children: [/* @__PURE__ */ F("span", {
1297
+ children: [/* @__PURE__ */ I("span", {
1277
1298
  className: "truncate",
1278
1299
  children: e.name
1279
- }), /* @__PURE__ */ F("button", {
1300
+ }), /* @__PURE__ */ I("button", {
1280
1301
  type: "button",
1281
1302
  "aria-label": `Remove ${e.name}`,
1282
1303
  disabled: c,
1283
1304
  className: "min-h-11 px-2 text-muted-foreground hover:text-foreground",
1284
- onClick: () => r(n.filter((e, n) => n !== t)),
1305
+ onClick: () => n(t.filter((e, t) => t !== r)),
1285
1306
  children: "Remove"
1286
1307
  })]
1287
- }, `${e.name}-${t}`))
1308
+ }, `${e.name}-${r}`))
1288
1309
  })
1289
1310
  ]
1290
1311
  });
1291
1312
  }
1292
1313
  //#endregion
1293
1314
  //#region src/components/textarea.tsx
1294
- var Ae = M.forwardRef(({ className: t, invalid: n, "aria-invalid": r, ...i }, a) => /* @__PURE__ */ F("textarea", {
1295
- className: e("wos-textarea placeholder:text-muted-foreground aria-[invalid=true]:border-destructive", t),
1296
- "aria-invalid": n || r || void 0,
1297
- ref: a,
1298
- ...i
1315
+ var je = N.forwardRef(({ className: e, invalid: n, density: i, "aria-invalid": a, ...o }, s) => /* @__PURE__ */ I("textarea", {
1316
+ "data-density": i,
1317
+ className: r("wos-textarea placeholder:text-muted-foreground aria-[invalid=true]:border-destructive", t(i), e),
1318
+ "aria-invalid": n || a || void 0,
1319
+ ref: s,
1320
+ ...o
1299
1321
  }));
1300
- Ae.displayName = "Textarea";
1322
+ je.displayName = "Textarea";
1301
1323
  //#endregion
1302
1324
  //#region src/components/surface.tsx
1303
- var je = N("rounded-[var(--surface-radius)]", {
1325
+ var Me = P("", {
1304
1326
  variants: {
1305
1327
  variant: {
1306
1328
  working: "wos-surface",
1307
- quiet: "border border-border-subtle bg-surface",
1308
- raised: "border border-border bg-surface-raised shadow-working"
1329
+ quiet: "border border-surface-border bg-surface",
1330
+ raised: "border border-surface-border bg-surface-raised shadow-working"
1331
+ },
1332
+ radius: {
1333
+ default: "rounded-[var(--surface-radius)]",
1334
+ lg: "rounded-[var(--surface-radius-large)]",
1335
+ xl: "rounded-[var(--surface-radius-presentation)]"
1309
1336
  },
1310
1337
  padding: {
1311
1338
  none: "p-0",
@@ -1316,67 +1343,69 @@ var je = N("rounded-[var(--surface-radius)]", {
1316
1343
  },
1317
1344
  defaultVariants: {
1318
1345
  variant: "working",
1319
- padding: "md"
1346
+ padding: "md",
1347
+ radius: "default"
1320
1348
  }
1321
- }), Me = M.forwardRef(({ className: t, variant: n, padding: r, ...i }, a) => /* @__PURE__ */ F("div", {
1322
- ref: a,
1323
- className: e(je({
1324
- variant: n,
1325
- padding: r
1326
- }), t),
1327
- ...i
1349
+ }), Ne = N.forwardRef(({ className: e, variant: t, padding: n, radius: i, ...a }, o) => /* @__PURE__ */ I("div", {
1350
+ ref: o,
1351
+ className: r(Me({
1352
+ variant: t,
1353
+ padding: n,
1354
+ radius: i
1355
+ }), e),
1356
+ ...a
1328
1357
  }));
1329
- Me.displayName = "Surface";
1330
- var Ne = M.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ F(Me, {
1358
+ Ne.displayName = "Surface";
1359
+ var Pe = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ I(Ne, {
1331
1360
  ref: n,
1332
1361
  className: e,
1333
1362
  ...t
1334
1363
  }));
1335
- Ne.displayName = "Card";
1336
- var Pe = M.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ F("div", {
1337
- ref: r,
1338
- className: e("flex flex-col gap-1.5", t),
1339
- ...n
1364
+ Pe.displayName = "Card";
1365
+ var Fe = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ I("div", {
1366
+ ref: n,
1367
+ className: r("flex flex-col gap-1.5", e),
1368
+ ...t
1340
1369
  }));
1341
- Pe.displayName = "CardHeader";
1342
- var Fe = M.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ F("h3", {
1343
- ref: r,
1344
- className: e("type-subsection text-foreground", t),
1345
- ...n
1370
+ Fe.displayName = "CardHeader";
1371
+ var Ie = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ I("h3", {
1372
+ ref: n,
1373
+ className: r("type-subsection text-foreground", e),
1374
+ ...t
1346
1375
  }));
1347
- Fe.displayName = "CardTitle";
1348
- var Ie = M.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ F("p", {
1349
- ref: r,
1350
- className: e("type-supporting text-muted-foreground", t),
1351
- ...n
1376
+ Ie.displayName = "CardTitle";
1377
+ var Le = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ I("p", {
1378
+ ref: n,
1379
+ className: r("type-supporting text-muted-foreground", e),
1380
+ ...t
1352
1381
  }));
1353
- Ie.displayName = "CardDescription";
1354
- var Le = M.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ F("div", {
1355
- ref: r,
1356
- className: e(t),
1357
- ...n
1382
+ Le.displayName = "CardDescription";
1383
+ var Re = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ I("div", {
1384
+ ref: n,
1385
+ className: r(e),
1386
+ ...t
1358
1387
  }));
1359
- Le.displayName = "CardContent";
1360
- var Re = M.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ F("div", {
1361
- ref: r,
1362
- className: e("flex items-center", t),
1363
- ...n
1388
+ Re.displayName = "CardContent";
1389
+ var ze = N.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ I("div", {
1390
+ ref: n,
1391
+ className: r("flex items-center", e),
1392
+ ...t
1364
1393
  }));
1365
- Re.displayName = "CardFooter";
1394
+ ze.displayName = "CardFooter";
1366
1395
  //#endregion
1367
1396
  //#region src/components/badge.tsx
1368
- var ze = N("wos-badge inline-flex items-center font-normal", {
1397
+ var Be = P("wos-badge inline-flex items-center font-normal", {
1369
1398
  variants: { variant: {
1370
1399
  default: "",
1371
1400
  secondary: "border-transparent bg-surface-subtle text-secondary-foreground",
1372
1401
  outline: "bg-transparent"
1373
1402
  } },
1374
1403
  defaultVariants: { variant: "default" }
1375
- }), Be = M.forwardRef(({ className: t, variant: n, ...r }, i) => /* @__PURE__ */ F("span", {
1404
+ }), Ve = N.forwardRef(({ className: e, variant: t, ...n }, i) => /* @__PURE__ */ I("span", {
1376
1405
  ref: i,
1377
- className: e(ze({ variant: n }), t),
1378
- ...r
1406
+ className: r(Be({ variant: t }), e),
1407
+ ...n
1379
1408
  }));
1380
- Be.displayName = "Badge";
1409
+ Ve.displayName = "Badge";
1381
1410
  //#endregion
1382
- export { D as AspectRatio, ve as Autocomplete, S as Avatar, T as AvatarGroup, Be as Badge, n as Button, R as ButtonGroup, Ne as Card, Le as CardContent, Ie as CardDescription, Re as CardFooter, Pe as CardHeader, Fe as CardTitle, xe as Checkbox, y as CircularProgress, _e as Combobox, f as DataList, $ as DateInput, me as DateRangePicker, C as DescriptionList, E as EmptyState, a as Field, ke as FileUpload, o as Form, i as FormField, L as IconButton, Oe as InputOTP, m as KeyValue, b as MetricCard, ee as MoneyInput, be as MultiSelect, c as Notice, V as NumberInput, O as Progress, te as QuantityInput, Se as RadioGroup, h as ScrollArea, ye as SearchInput, De as SegmentedControl, ie as Select, H as SelectMenu, g as Separator, w as Skeleton, we as Slider, x as Stat, s as StatusBadge, Me as Surface, Ce as Switch, v as Table, _ as TableBody, d as TableCaption, k as TableCell, j as TableFooter, p as TableHead, A as TableHeader, u as TableRow, B as TextInput, Ae as Textarea, l as Timeline, Te as Toggle, Ee as ToggleGroup, ue as UsDateInput, r as ValidationMessage, z as WealthIcon, ze as badgeVariants, t as buttonVariants, e as cn, he as isDateRangeValid, je as surfaceVariants };
1411
+ export { O as AspectRatio, ye as Autocomplete, C as Avatar, E as AvatarGroup, Ve as Badge, n as Button, z as ButtonGroup, Pe as Card, Re as CardContent, Le as CardDescription, ze as CardFooter, Fe as CardHeader, Ie as CardTitle, Se as Checkbox, b as CircularProgress, ve as Combobox, p as DataList, $ as DateInput, he as DateRangePicker, w as DescriptionList, D as EmptyState, o as Field, Ae as FileUpload, s as Form, a as FormField, R as IconButton, ke as InputOTP, h as KeyValue, x as MetricCard, ee as MoneyInput, xe as MultiSelect, l as Notice, H as NumberInput, k as Progress, te as QuantityInput, Ce as RadioGroup, g as ScrollArea, be as SearchInput, Oe as SegmentedControl, ie as Select, U as SelectMenu, _ as Separator, T as Skeleton, Te as Slider, S as Stat, c as StatusBadge, Ne as Surface, we as Switch, y as Table, v as TableBody, f as TableCaption, A as TableCell, M as TableFooter, m as TableHead, j as TableHeader, d as TableRow, V as TextInput, je as Textarea, u as Timeline, Ee as Toggle, De as ToggleGroup, de as UsDateInput, i as ValidationMessage, B as WealthIcon, Be as badgeVariants, e as buttonVariants, r as cn, ge as isDateRangeValid, Me as surfaceVariants };