@facto-to/design-system 0.1.0-beta.2 → 0.1.0-beta.4

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,67 +1,89 @@
1
1
  "use client";
2
- import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
+ import { jsxs as d, jsx as a, Fragment as A } from "react/jsx-runtime";
3
3
  import * as P from "@radix-ui/react-tooltip";
4
4
  import * as p from "@radix-ui/react-toast";
5
- import { createPortal as G } from "react-dom";
6
- import * as A from "@radix-ui/react-checkbox";
5
+ import { createPortal as K } from "react-dom";
6
+ import * as E from "@radix-ui/react-checkbox";
7
7
  import * as u from "@radix-ui/react-dialog";
8
8
  import * as g from "@radix-ui/react-select";
9
- import * as E from "@radix-ui/react-switch";
10
- import * as R from "@radix-ui/react-tabs";
11
- import { createContext as K, forwardRef as M, useId as I, useContext as _, useState as O, useRef as V, useEffect as W, useCallback as L } from "react";
12
- const x = /* @__PURE__ */ new WeakMap();
13
- function z(t) {
9
+ import * as H from "@radix-ui/react-switch";
10
+ import * as M from "@radix-ui/react-tabs";
11
+ import { createContext as Z, forwardRef as R, useId as I, useContext as _, useState as O, useRef as V, useEffect as L, useCallback as z } from "react";
12
+ const F = /* @__PURE__ */ new WeakMap();
13
+ function J(t) {
14
14
  const e = Array.from(t.ownerDocument.body.children).filter(
15
15
  (n) => n instanceof HTMLElement && !n.hasAttribute("data-radix-focus-guard") && !n.contains(t)
16
16
  );
17
17
  for (const n of e) {
18
- const c = x.get(n);
19
- c ? c.count += 1 : (x.set(n, { count: 1, wasInert: n.inert }), n.inert = !0);
18
+ const c = F.get(n);
19
+ c ? c.count += 1 : (F.set(n, { count: 1, wasInert: n.inert }), n.inert = !0);
20
20
  }
21
21
  let o = !0;
22
22
  return () => {
23
23
  if (o) {
24
24
  o = !1;
25
25
  for (const n of e) {
26
- const c = x.get(n);
27
- c && (c.count -= 1, c.count === 0 && (c.wasInert || (n.inert = !1), x.delete(n)));
26
+ const c = F.get(n);
27
+ c && (c.count -= 1, c.count === 0 && (c.wasInert || (n.inert = !1), F.delete(n)));
28
28
  }
29
29
  }
30
30
  };
31
31
  }
32
- const s = (...t) => t.filter(Boolean).join(" "), w = (...t) => t.filter(Boolean).join(" ") || void 0, v = K({}), J = (t) => Object.fromEntries(
32
+ const i = (...t) => t.filter(Boolean).join(" "), C = (...t) => t.filter(Boolean).join(" ") || void 0, N = Z({}), Q = (t) => Object.fromEntries(
33
33
  Object.entries(t ?? {}).filter(([e, o]) => e.startsWith("--facto-") && o !== void 0 && o !== null)
34
34
  );
35
- function Z({ className: t, tokens: e, style: o, ...n }) {
36
- const c = _(v), i = { ...e, ...o }, r = { ...c, ...J(i) };
37
- return /* @__PURE__ */ a(v.Provider, { value: r, children: /* @__PURE__ */ a("div", { ...n, style: i, className: s("facto-theme", t) }) });
35
+ function ot({ className: t, tokens: e, style: o, ...n }) {
36
+ const c = _(N), s = { ...e, ...o }, r = { ...c, ...Q(s) };
37
+ return /* @__PURE__ */ a(N.Provider, { value: r, children: /* @__PURE__ */ a("div", { ...n, style: s, className: i("facto-theme", t) }) });
38
+ }
39
+ function w({ name: t, size: e = 20, ...o }) {
40
+ return /* @__PURE__ */ a("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", ...o, children: {
41
+ close: /* @__PURE__ */ a("path", { d: "m6 6 12 12M18 6 6 18" }),
42
+ arrowLeft: /* @__PURE__ */ a("path", { d: "m12 5-7 7 7 7M5 12h14" }),
43
+ check: /* @__PURE__ */ a("path", { d: "m5 12 4 4L19 6" }),
44
+ chevronDown: /* @__PURE__ */ a("path", { d: "m6 9 6 6 6-6" }),
45
+ info: /* @__PURE__ */ d(A, { children: [
46
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "9" }),
47
+ /* @__PURE__ */ a("path", { d: "M12 11v6M12 7v1" })
48
+ ] }),
49
+ warning: /* @__PURE__ */ d(A, { children: [
50
+ /* @__PURE__ */ a("path", { d: "m12 3 10 18H2L12 3Z" }),
51
+ /* @__PURE__ */ a("path", { d: "M12 9v5M12 17v1" })
52
+ ] })
53
+ }[t] });
54
+ }
55
+ function nt({ className: t, ...e }) {
56
+ return /* @__PURE__ */ a("div", { ...e, className: i("facto-modal-header", t) });
38
57
  }
39
- const tt = M(
58
+ function ct({ className: t, ...e }) {
59
+ return /* @__PURE__ */ a("div", { ...e, className: i("facto-modal-footer", t) });
60
+ }
61
+ const it = R(
40
62
  function({
41
63
  variant: e = "primary",
42
64
  size: o = "md",
43
65
  fullWidth: n,
44
66
  loading: c,
45
- className: i,
67
+ className: s,
46
68
  children: r,
47
69
  disabled: f,
48
70
  type: l = "button",
49
71
  ...m
50
- }, y) {
72
+ }, k) {
51
73
  return /* @__PURE__ */ d(
52
74
  "button",
53
75
  {
54
76
  ...m,
55
- ref: y,
77
+ ref: k,
56
78
  type: l,
57
79
  disabled: f || c,
58
80
  "aria-busy": c || void 0,
59
- className: s(
81
+ className: i(
60
82
  "facto-button",
61
83
  `facto-button--${e}`,
62
84
  `facto-button--${o}`,
63
85
  n && "facto-button--full",
64
- i
86
+ s
65
87
  ),
66
88
  children: [
67
89
  c && /* @__PURE__ */ a("span", { className: "facto-button__spinner", "aria-hidden": "true" }),
@@ -70,31 +92,32 @@ const tt = M(
70
92
  }
71
93
  );
72
94
  }
73
- ), et = M(
74
- function({ ariaLabel: e, size: o = "md", className: n, title: c, type: i = "button", ...r }, f) {
95
+ ), st = R(
96
+ function({ ariaLabel: e, size: o = "md", className: n, title: c, type: s = "button", children: r, ...f }, l) {
75
97
  return /* @__PURE__ */ a(
76
98
  "button",
77
99
  {
78
- ...r,
79
- ref: f,
80
- type: i,
100
+ ...f,
101
+ ref: l,
102
+ type: s,
81
103
  "aria-label": e,
82
104
  title: c ?? e,
83
- className: s(
105
+ className: i(
84
106
  "facto-icon-button",
85
107
  `facto-icon-button--${o}`,
86
108
  n
87
- )
109
+ ),
110
+ children: /* @__PURE__ */ a("span", { className: "facto-icon-button__visual", children: r })
88
111
  }
89
112
  );
90
113
  }
91
114
  );
92
- function H({ padding: t = "lg", className: e, ...o }) {
115
+ function q({ padding: t = "lg", className: e, ...o }) {
93
116
  return /* @__PURE__ */ a(
94
117
  "div",
95
118
  {
96
119
  ...o,
97
- className: s(
120
+ className: i(
98
121
  "facto-surface",
99
122
  `facto-surface--padding-${t}`,
100
123
  e
@@ -102,16 +125,16 @@ function H({ padding: t = "lg", className: e, ...o }) {
102
125
  }
103
126
  );
104
127
  }
105
- function at(t) {
106
- return /* @__PURE__ */ a(H, { ...t });
128
+ function rt(t) {
129
+ return /* @__PURE__ */ a(q, { ...t });
107
130
  }
108
- function ot({ span: t = 1, className: e, ...o }) {
131
+ function lt({ span: t = 1, className: e, ...o }) {
109
132
  return /* @__PURE__ */ a(
110
- H,
133
+ q,
111
134
  {
112
135
  ...o,
113
136
  padding: "md",
114
- className: s(
137
+ className: i(
115
138
  "facto-widget",
116
139
  t === 2 && "facto-widget--span-2",
117
140
  e
@@ -119,37 +142,37 @@ function ot({ span: t = 1, className: e, ...o }) {
119
142
  }
120
143
  );
121
144
  }
122
- function nt({ className: t, children: e, ...o }) {
123
- return /* @__PURE__ */ a("div", { ...o, className: s("facto-dashboard-container", t), children: /* @__PURE__ */ a("div", { className: "facto-dashboard-grid", children: e }) });
145
+ function dt({ className: t, children: e, ...o }) {
146
+ return /* @__PURE__ */ a("div", { ...o, className: i("facto-dashboard-container", t), children: /* @__PURE__ */ a("div", { className: "facto-dashboard-grid", children: e }) });
124
147
  }
125
- function ct({ withAction: t, className: e, ...o }) {
148
+ function ft({ withAction: t, className: e, ...o }) {
126
149
  return /* @__PURE__ */ a(
127
150
  "div",
128
151
  {
129
152
  ...o,
130
- className: s("facto-widget-head", t && "facto-widget-head--with-action", e)
153
+ className: i("facto-widget-head", t && "facto-widget-head--with-action", e)
131
154
  }
132
155
  );
133
156
  }
134
- function it({ className: t, ...e }) {
135
- return /* @__PURE__ */ a("div", { ...e, className: s("facto-widget-list", t) });
157
+ function ut({ className: t, ...e }) {
158
+ return /* @__PURE__ */ a("div", { ...e, className: i("facto-widget-list", t) });
136
159
  }
137
- function st({ className: t, ...e }) {
138
- return /* @__PURE__ */ a("div", { ...e, className: s("facto-widget-kv", t) });
160
+ function mt({ className: t, ...e }) {
161
+ return /* @__PURE__ */ a("div", { ...e, className: i("facto-widget-kv", t) });
139
162
  }
140
- function rt({ className: t, ...e }) {
141
- return /* @__PURE__ */ a("div", { ...e, className: s("facto-widget-amount", t) });
163
+ function ht({ className: t, ...e }) {
164
+ return /* @__PURE__ */ a("div", { ...e, className: i("facto-widget-amount", t) });
142
165
  }
143
- function lt(t) {
144
- const e = s("facto-widget-action", t.dark && "facto-widget-action--dark", t.className);
166
+ function gt(t) {
167
+ const e = i("facto-widget-action", t.dark && "facto-widget-action--dark", t.className);
145
168
  if (typeof t.href == "string") {
146
169
  const { dark: r, className: f, ...l } = t;
147
170
  return /* @__PURE__ */ a("a", { ...l, className: e });
148
171
  }
149
- const { dark: o, className: n, type: c = "button", ...i } = t;
150
- return /* @__PURE__ */ a("button", { ...i, type: c, className: e });
172
+ const { dark: o, className: n, type: c = "button", ...s } = t;
173
+ return /* @__PURE__ */ a("button", { ...s, type: c, className: e });
151
174
  }
152
- function dt({
175
+ function bt({
153
176
  className: t,
154
177
  type: e = "button",
155
178
  ...o
@@ -159,21 +182,21 @@ function dt({
159
182
  {
160
183
  ...o,
161
184
  type: e,
162
- className: s("facto-widget-row", t)
185
+ className: i("facto-widget-row", t)
163
186
  }
164
187
  );
165
188
  }
166
- function Q({
189
+ function U({
167
190
  label: t,
168
191
  helperText: e,
169
192
  error: o,
170
193
  id: n,
171
194
  containerClassName: c,
172
- className: i,
195
+ className: s,
173
196
  ...r
174
197
  }) {
175
198
  const f = I(), l = n ?? f, m = o || e ? `${l}-description` : void 0;
176
- return /* @__PURE__ */ d("div", { className: s("facto-field", c), children: [
199
+ return /* @__PURE__ */ d("div", { className: i("facto-field", c), children: [
177
200
  t && /* @__PURE__ */ a("label", { className: "facto-field__label", htmlFor: l, children: t }),
178
201
  /* @__PURE__ */ a(
179
202
  "input",
@@ -181,11 +204,11 @@ function Q({
181
204
  ...r,
182
205
  id: l,
183
206
  "aria-invalid": !!o || r["aria-invalid"],
184
- "aria-describedby": w(r["aria-describedby"], m),
185
- className: s(
207
+ "aria-describedby": C(r["aria-describedby"], m),
208
+ className: i(
186
209
  "facto-input",
187
210
  !!o && "facto-input--error",
188
- i
211
+ s
189
212
  )
190
213
  }
191
214
  ),
@@ -193,7 +216,7 @@ function Q({
193
216
  "span",
194
217
  {
195
218
  id: m,
196
- className: s(
219
+ className: i(
197
220
  "facto-field__message",
198
221
  !!o && "facto-field__message--error"
199
222
  ),
@@ -202,17 +225,17 @@ function Q({
202
225
  )
203
226
  ] });
204
227
  }
205
- function ft({
228
+ function vt({
206
229
  label: t,
207
230
  helperText: e,
208
231
  error: o,
209
232
  id: n,
210
233
  containerClassName: c,
211
- className: i,
234
+ className: s,
212
235
  ...r
213
236
  }) {
214
237
  const f = I(), l = n ?? f, m = o || e ? `${l}-description` : void 0;
215
- return /* @__PURE__ */ d("div", { className: s("facto-field", c), children: [
238
+ return /* @__PURE__ */ d("div", { className: i("facto-field", c), children: [
216
239
  t && /* @__PURE__ */ a("label", { className: "facto-field__label", htmlFor: l, children: t }),
217
240
  /* @__PURE__ */ a(
218
241
  "textarea",
@@ -220,11 +243,11 @@ function ft({
220
243
  ...r,
221
244
  id: l,
222
245
  "aria-invalid": !!o || r["aria-invalid"],
223
- "aria-describedby": w(r["aria-describedby"], m),
224
- className: s(
246
+ "aria-describedby": C(r["aria-describedby"], m),
247
+ className: i(
225
248
  "facto-textarea",
226
249
  !!o && "facto-input--error",
227
- i
250
+ s
228
251
  )
229
252
  }
230
253
  ),
@@ -232,7 +255,7 @@ function ft({
232
255
  "span",
233
256
  {
234
257
  id: m,
235
- className: s(
258
+ className: i(
236
259
  "facto-field__message",
237
260
  !!o && "facto-field__message--error"
238
261
  ),
@@ -241,40 +264,40 @@ function ft({
241
264
  )
242
265
  ] });
243
266
  }
244
- function ut({ tone: t = "neutral", className: e, ...o }) {
267
+ function Nt({ tone: t = "neutral", className: e, ...o }) {
245
268
  return /* @__PURE__ */ a(
246
269
  "span",
247
270
  {
248
271
  ...o,
249
- className: s("facto-badge", `facto-badge--${t}`, e)
272
+ className: i("facto-badge", `facto-badge--${t}`, e)
250
273
  }
251
274
  );
252
275
  }
253
- function mt({
276
+ function pt({
254
277
  options: t,
255
278
  value: e,
256
279
  defaultValue: o,
257
280
  onValueChange: n,
258
281
  placeholder: c = "Select an option",
259
- label: i,
282
+ label: s,
260
283
  error: r,
261
284
  disabled: f,
262
285
  name: l,
263
286
  id: m,
264
- ariaLabel: y,
287
+ ariaLabel: k,
265
288
  "aria-describedby": $,
266
- className: C
289
+ className: B
267
290
  }) {
268
- const F = _(v), B = I(), k = m ?? B, D = r ? `${k}-description` : void 0, T = V(null), b = L(() => {
291
+ const W = _(N), S = I(), y = m ?? S, x = r ? `${y}-description` : void 0, T = V(null), b = z(() => {
269
292
  T.current?.(), T.current = null;
270
- }, []), S = L(
293
+ }, []), D = z(
271
294
  (h) => {
272
- b(), h && (T.current = z(h));
295
+ b(), h && (T.current = J(h));
273
296
  },
274
297
  [b]
275
298
  );
276
- return W(() => b, [b]), /* @__PURE__ */ d("div", { className: s("facto-field", C), children: [
277
- i && /* @__PURE__ */ a("label", { className: "facto-field__label", htmlFor: k, children: i }),
299
+ return L(() => b, [b]), /* @__PURE__ */ d("div", { className: i("facto-field", B), children: [
300
+ s && /* @__PURE__ */ a("label", { className: "facto-field__label", htmlFor: y, children: s }),
278
301
  /* @__PURE__ */ d(
279
302
  g.Root,
280
303
  {
@@ -287,23 +310,23 @@ function mt({
287
310
  /* @__PURE__ */ d(
288
311
  g.Trigger,
289
312
  {
290
- id: k,
291
- className: s("facto-select", !!r && "facto-input--error"),
292
- "aria-label": y,
293
- "aria-describedby": w($, D),
313
+ id: y,
314
+ className: i("facto-select", !!r && "facto-input--error"),
315
+ "aria-label": k,
316
+ "aria-describedby": C($, x),
294
317
  "aria-invalid": !!r,
295
318
  children: [
296
319
  /* @__PURE__ */ a(g.Value, { placeholder: c }),
297
- /* @__PURE__ */ a(g.Icon, { className: "facto-select__chevron", children: "⌄" })
320
+ /* @__PURE__ */ a(g.Icon, { className: "facto-select__chevron", children: /* @__PURE__ */ a(w, { name: "chevronDown", size: 16 }) })
298
321
  ]
299
322
  }
300
323
  ),
301
324
  /* @__PURE__ */ a(g.Portal, { children: /* @__PURE__ */ a(
302
325
  g.Content,
303
326
  {
304
- ref: S,
327
+ ref: D,
305
328
  className: "facto-theme facto-select-content",
306
- style: F,
329
+ style: W,
307
330
  position: "popper",
308
331
  onCloseAutoFocus: b,
309
332
  children: /* @__PURE__ */ a(g.Viewport, { children: t.map((h) => /* @__PURE__ */ d(
@@ -314,7 +337,7 @@ function mt({
314
337
  className: "facto-select-item",
315
338
  children: [
316
339
  /* @__PURE__ */ a(g.ItemText, { children: h.label }),
317
- /* @__PURE__ */ a(g.ItemIndicator, { children: "✓" })
340
+ /* @__PURE__ */ a(g.ItemIndicator, { children: /* @__PURE__ */ a(w, { name: "check", size: 16 }) })
318
341
  ]
319
342
  },
320
343
  h.value
@@ -327,28 +350,28 @@ function mt({
327
350
  r && /* @__PURE__ */ a(
328
351
  "span",
329
352
  {
330
- id: D,
353
+ id: x,
331
354
  className: "facto-field__message facto-field__message--error",
332
355
  children: r
333
356
  }
334
357
  )
335
358
  ] });
336
359
  }
337
- function ht({
360
+ function _t({
338
361
  label: t,
339
362
  description: e,
340
363
  className: o,
341
364
  id: n,
342
365
  ...c
343
366
  }) {
344
- const i = I(), r = n ?? i, f = e ? `${r}-description` : void 0, l = /* @__PURE__ */ a(
345
- E.Root,
367
+ const s = I(), r = n ?? s, f = e ? `${r}-description` : void 0, l = /* @__PURE__ */ a(
368
+ H.Root,
346
369
  {
347
370
  ...c,
348
371
  id: r,
349
- "aria-describedby": w(c["aria-describedby"], f),
350
- className: s("facto-switch", o),
351
- children: /* @__PURE__ */ a(E.Thumb, { className: "facto-switch__thumb" })
372
+ "aria-describedby": C(c["aria-describedby"], f),
373
+ className: i("facto-switch", o),
374
+ children: /* @__PURE__ */ a("span", { className: "facto-switch__track", "aria-hidden": "true", children: /* @__PURE__ */ a(H.Thumb, { className: "facto-switch__thumb" }) })
352
375
  }
353
376
  );
354
377
  return t ? /* @__PURE__ */ d("div", { className: "facto-check-field", children: [
@@ -359,21 +382,21 @@ function ht({
359
382
  ] })
360
383
  ] }) : l;
361
384
  }
362
- function gt({
385
+ function kt({
363
386
  label: t,
364
387
  description: e,
365
388
  className: o,
366
389
  id: n,
367
390
  ...c
368
391
  }) {
369
- const i = I(), r = n ?? i, f = e ? `${r}-description` : void 0, l = /* @__PURE__ */ a(
370
- A.Root,
392
+ const s = I(), r = n ?? s, f = e ? `${r}-description` : void 0, l = /* @__PURE__ */ a(
393
+ E.Root,
371
394
  {
372
395
  ...c,
373
396
  id: r,
374
- "aria-describedby": w(c["aria-describedby"], f),
375
- className: s("facto-checkbox", o),
376
- children: /* @__PURE__ */ a(A.Indicator, { className: "facto-checkbox__indicator", children: "✓" })
397
+ "aria-describedby": C(c["aria-describedby"], f),
398
+ className: i("facto-checkbox", o),
399
+ children: /* @__PURE__ */ a("span", { className: "facto-checkbox__visual", "aria-hidden": "true", children: /* @__PURE__ */ a(E.Indicator, { className: "facto-checkbox__indicator", children: /* @__PURE__ */ a(w, { name: "check", size: 16 }) }) })
377
400
  }
378
401
  );
379
402
  return t ? /* @__PURE__ */ d("div", { className: "facto-check-field", children: [
@@ -384,60 +407,64 @@ function gt({
384
407
  ] })
385
408
  ] }) : l;
386
409
  }
387
- const bt = R.Root;
388
- function Nt({
410
+ const yt = M.Root;
411
+ function Tt({
389
412
  className: t,
390
413
  ...e
391
414
  }) {
392
415
  return /* @__PURE__ */ a(
393
- R.List,
416
+ M.List,
394
417
  {
395
418
  ...e,
396
- className: s("facto-tabs-list", t)
419
+ className: i("facto-tabs-list", t)
397
420
  }
398
421
  );
399
422
  }
400
- function vt({
423
+ function wt({
401
424
  className: t,
402
425
  ...e
403
426
  }) {
404
427
  return /* @__PURE__ */ a(
405
- R.Trigger,
428
+ M.Trigger,
406
429
  {
407
430
  ...e,
408
- className: s("facto-tabs-trigger", t)
431
+ className: i("facto-tabs-trigger", t)
409
432
  }
410
433
  );
411
434
  }
412
- function pt({
435
+ function It({
413
436
  className: t,
414
437
  ...e
415
438
  }) {
416
439
  return /* @__PURE__ */ a(
417
- R.Content,
440
+ M.Content,
418
441
  {
419
442
  ...e,
420
- className: s("facto-tabs-content", t)
443
+ className: i("facto-tabs-content", t)
421
444
  }
422
445
  );
423
446
  }
424
- const _t = u.Root, yt = u.Trigger, kt = u.Close, Tt = u.Title, It = u.Description;
425
- function wt({
426
- size: t = "md",
447
+ const Ct = u.Root, Bt = u.Trigger, St = u.Close, X = R(function({ className: e, ...o }, n) {
448
+ return /* @__PURE__ */ a(u.Title, { ...o, ref: n, className: i("facto-modal-title", e) });
449
+ }), Y = R(function({ className: e, ...o }, n) {
450
+ return /* @__PURE__ */ a(u.Description, { ...o, ref: n, className: i("facto-modal-description", e) });
451
+ });
452
+ function Dt({
453
+ size: t = "sm",
427
454
  className: e,
428
455
  style: o,
429
456
  children: n,
430
457
  ...c
431
458
  }) {
432
- const i = _(v);
459
+ const s = _(N);
433
460
  return /* @__PURE__ */ d(u.Portal, { children: [
434
- /* @__PURE__ */ a(u.Overlay, { className: "facto-dialog-overlay", style: i }),
461
+ /* @__PURE__ */ a(u.Overlay, { className: "facto-dialog-overlay", style: s }),
435
462
  /* @__PURE__ */ a(
436
463
  u.Content,
437
464
  {
438
465
  ...c,
439
- style: { ...i, ...o },
440
- className: s(
466
+ style: { ...s, ...o },
467
+ className: i(
441
468
  "facto-theme",
442
469
  "facto-dialog",
443
470
  `facto-dialog--${t}`,
@@ -448,23 +475,23 @@ function wt({
448
475
  )
449
476
  ] });
450
477
  }
451
- const Ct = u.Root, Bt = u.Trigger, St = u.Close, Pt = u.Title, $t = u.Description;
452
- function Dt({
478
+ const Pt = u.Root, $t = u.Trigger, xt = u.Close, Ft = X, Mt = Y;
479
+ function Rt({
453
480
  side: t = "center",
454
481
  className: e,
455
482
  style: o,
456
483
  children: n,
457
484
  ...c
458
485
  }) {
459
- const i = _(v);
486
+ const s = _(N);
460
487
  return /* @__PURE__ */ d(u.Portal, { children: [
461
- /* @__PURE__ */ a(u.Overlay, { className: "facto-dialog-overlay", style: i }),
488
+ /* @__PURE__ */ a(u.Overlay, { className: "facto-dialog-overlay", style: s }),
462
489
  /* @__PURE__ */ a(
463
490
  u.Content,
464
491
  {
465
492
  ...c,
466
- style: { ...i, ...o },
467
- className: s(
493
+ style: { ...s, ...o },
494
+ className: i(
468
495
  "facto-theme",
469
496
  "facto-sheet",
470
497
  `facto-sheet--${t}`,
@@ -475,20 +502,20 @@ function Dt({
475
502
  )
476
503
  ] });
477
504
  }
478
- function xt({
505
+ function Wt({
479
506
  width: t,
480
507
  height: e,
481
508
  circle: o,
482
509
  className: n,
483
510
  style: c,
484
- ...i
511
+ ...s
485
512
  }) {
486
513
  return /* @__PURE__ */ a(
487
514
  "span",
488
515
  {
489
- ...i,
516
+ ...s,
490
517
  "aria-hidden": "true",
491
- className: s(
518
+ className: i(
492
519
  "facto-skeleton",
493
520
  o && "facto-skeleton--circle",
494
521
  n
@@ -497,35 +524,35 @@ function xt({
497
524
  }
498
525
  );
499
526
  }
500
- function Rt({
527
+ function Lt({
501
528
  title: t,
502
529
  description: e,
503
530
  action: o,
504
531
  icon: n,
505
532
  className: c,
506
- ...i
533
+ ...s
507
534
  }) {
508
- return /* @__PURE__ */ d("div", { ...i, className: s("facto-empty-state", c), children: [
535
+ return /* @__PURE__ */ d("div", { ...s, className: i("facto-empty-state", c), children: [
509
536
  n && /* @__PURE__ */ a("div", { className: "facto-empty-state__icon", "aria-hidden": "true", children: n }),
510
537
  /* @__PURE__ */ a("strong", { children: t }),
511
538
  e && /* @__PURE__ */ a("p", { children: e }),
512
539
  o && /* @__PURE__ */ a("div", { children: o })
513
540
  ] });
514
541
  }
515
- function Ft({
542
+ function jt({
516
543
  tone: t = "info",
517
544
  title: e,
518
545
  description: o,
519
546
  action: n,
520
547
  className: c,
521
- ...i
548
+ ...s
522
549
  }) {
523
550
  return /* @__PURE__ */ d(
524
551
  "div",
525
552
  {
526
- ...i,
553
+ ...s,
527
554
  role: t === "danger" ? "alert" : "status",
528
- className: s("facto-notice", `facto-notice--${t}`, c),
555
+ className: i("facto-notice", `facto-notice--${t}`, c),
529
556
  children: [
530
557
  /* @__PURE__ */ d("div", { children: [
531
558
  /* @__PURE__ */ a("strong", { children: e }),
@@ -536,19 +563,19 @@ function Ft({
536
563
  }
537
564
  );
538
565
  }
539
- function Wt({
566
+ function At({
540
567
  gap: t = 3,
541
568
  direction: e = "vertical",
542
569
  align: o = "stretch",
543
570
  justify: n = "start",
544
571
  className: c,
545
- ...i
572
+ ...s
546
573
  }) {
547
574
  return /* @__PURE__ */ a(
548
575
  "div",
549
576
  {
550
- ...i,
551
- className: s(
577
+ ...s,
578
+ className: i(
552
579
  "facto-stack",
553
580
  `facto-stack--${e}`,
554
581
  `facto-stack--gap-${t}`,
@@ -559,66 +586,66 @@ function Wt({
559
586
  }
560
587
  );
561
588
  }
562
- function jt({ delayDuration: t = 300, ...e }) {
589
+ function Et({ delayDuration: t = 300, ...e }) {
563
590
  return /* @__PURE__ */ a(P.Provider, { ...e, delayDuration: t });
564
591
  }
565
- const At = P.Root, Et = P.Trigger;
566
- function Lt({ variant: t = "default", className: e, style: o, sideOffset: n = 6, children: c, ...i }) {
567
- const r = _(v);
592
+ const Ht = P.Root, zt = P.Trigger;
593
+ function Ot({ variant: t = "default", className: e, style: o, sideOffset: n = 6, children: c, ...s }) {
594
+ const r = _(N);
568
595
  return /* @__PURE__ */ a(P.Portal, { children: /* @__PURE__ */ a(
569
596
  P.Content,
570
597
  {
571
- ...i,
598
+ ...s,
572
599
  sideOffset: n,
573
- className: s("facto-theme", "facto-tooltip", t === "content" && "facto-tooltip--content", e),
600
+ className: i("facto-theme", "facto-tooltip", t === "content" && "facto-tooltip--content", e),
574
601
  style: { ...r, ...o },
575
602
  children: c
576
603
  }
577
604
  ) });
578
605
  }
579
- function Mt({ duration: t = 2600, ...e }) {
606
+ function Vt({ duration: t = 2600, ...e }) {
580
607
  return /* @__PURE__ */ a(p.Provider, { ...e, duration: t });
581
608
  }
582
- function Ot({ tone: t = "success", className: e, style: o, children: n, ...c }) {
583
- const i = _(v);
584
- return /* @__PURE__ */ d(p.Root, { ...c, className: s("facto-theme", "facto-toast", `facto-toast--${t}`, e), style: { ...i, ...o }, children: [
585
- /* @__PURE__ */ a("span", { className: "facto-toast__icon", "aria-hidden": "true", children: t === "danger" ? "×" : "✓" }),
609
+ function qt({ tone: t = "success", className: e, style: o, children: n, ...c }) {
610
+ const s = _(N);
611
+ return /* @__PURE__ */ d(p.Root, { ...c, className: i("facto-theme", "facto-toast", `facto-toast--${t}`, e), style: { ...s, ...o }, children: [
612
+ /* @__PURE__ */ a("span", { className: "facto-toast__icon", "aria-hidden": "true", children: /* @__PURE__ */ a(w, { name: t === "danger" ? "close" : t === "warning" ? "warning" : t === "info" ? "info" : "check" }) }),
586
613
  /* @__PURE__ */ a("div", { className: "facto-toast__copy", children: n })
587
614
  ] });
588
615
  }
589
- function Vt({ className: t, ...e }) {
590
- return /* @__PURE__ */ a(p.Title, { ...e, className: s("facto-toast__title", t) });
616
+ function Gt({ className: t, ...e }) {
617
+ return /* @__PURE__ */ a(p.Title, { ...e, className: i("facto-toast__title", t) });
591
618
  }
592
- function Ht({ className: t, ...e }) {
593
- return /* @__PURE__ */ a(p.Description, { ...e, className: s("facto-toast__description", t) });
619
+ function Kt({ className: t, ...e }) {
620
+ return /* @__PURE__ */ a(p.Description, { ...e, className: i("facto-toast__description", t) });
594
621
  }
595
- function qt({ className: t, ...e }) {
596
- return /* @__PURE__ */ a(p.Action, { ...e, className: s("facto-button", "facto-button--secondary", "facto-button--sm", t) });
622
+ function Zt({ className: t, ...e }) {
623
+ return /* @__PURE__ */ a(p.Action, { ...e, className: i("facto-button", "facto-button--secondary", "facto-button--sm", t) });
597
624
  }
598
- function Gt({ className: t, children: e = "×", "aria-label": o = "Dismiss notification", ...n }) {
599
- return /* @__PURE__ */ a(p.Close, { ...n, "aria-label": o, className: s("facto-toast__close", t), children: e });
625
+ function Jt({ className: t, children: e = /* @__PURE__ */ a(w, { name: "close" }), "aria-label": o = "Dismiss notification", ...n }) {
626
+ return /* @__PURE__ */ a(p.Close, { ...n, "aria-label": o, className: i("facto-toast__close", t), children: e });
600
627
  }
601
- function Kt({ className: t, style: e, ...o }) {
602
- const n = _(v), [c, i] = O(!1);
603
- return W(() => i(!0), []), c ? G(/* @__PURE__ */ a(p.Viewport, { ...o, className: s("facto-toast-viewport", t), style: { ...n, ...e } }), document.body) : null;
628
+ function Qt({ className: t, style: e, ...o }) {
629
+ const n = _(N), [c, s] = O(!1);
630
+ return L(() => s(!0), []), c ? K(/* @__PURE__ */ a(p.Viewport, { ...o, className: i("facto-toast-viewport", t), style: { ...n, ...e } }), document.body) : null;
604
631
  }
605
- function zt({ value: t, defaultValue: e = "", onValueChange: o, clearLabel: n = "Clear search", label: c = "Search", helperText: i, error: r, id: f, containerClassName: l, className: m, disabled: y, readOnly: $, ...C }) {
606
- const F = I(), B = f ?? F, k = r || i ? `${B}-description` : void 0, [D, T] = O(e), b = t ?? D, S = V(null);
607
- W(() => {
608
- const N = S.current?.form;
609
- if (!N || t !== void 0) return;
610
- const j = (q) => {
632
+ function Ut({ value: t, defaultValue: e = "", onValueChange: o, clearLabel: n = "Clear search", label: c = "Search", helperText: s, error: r, id: f, containerClassName: l, className: m, disabled: k, readOnly: $, ...B }) {
633
+ const W = I(), S = f ?? W, y = r || s ? `${S}-description` : void 0, [x, T] = O(e), b = t ?? x, D = V(null);
634
+ L(() => {
635
+ const v = D.current?.form;
636
+ if (!v || t !== void 0) return;
637
+ const j = (G) => {
611
638
  queueMicrotask(() => {
612
- q.defaultPrevented || (T(e), o?.(e));
639
+ G.defaultPrevented || (T(e), o?.(e));
613
640
  });
614
641
  };
615
- return N.addEventListener("reset", j), () => N.removeEventListener("reset", j);
642
+ return v.addEventListener("reset", j), () => v.removeEventListener("reset", j);
616
643
  }, [e, t, o]);
617
- const h = (N) => {
618
- t === void 0 && T(N), o?.(N);
644
+ const h = (v) => {
645
+ t === void 0 && T(v), o?.(v);
619
646
  };
620
- return /* @__PURE__ */ d("div", { className: s("facto-field", l), children: [
621
- c && /* @__PURE__ */ a("label", { className: "facto-field__label", htmlFor: B, children: c }),
647
+ return /* @__PURE__ */ d("div", { className: i("facto-field", l), children: [
648
+ c && /* @__PURE__ */ a("label", { className: "facto-field__label", htmlFor: S, children: c }),
622
649
  /* @__PURE__ */ d("div", { className: "facto-search", children: [
623
650
  /* @__PURE__ */ d("svg", { className: "facto-search__icon", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: [
624
651
  /* @__PURE__ */ a("circle", { cx: "10.5", cy: "10.5", r: "6.5" }),
@@ -627,17 +654,17 @@ function zt({ value: t, defaultValue: e = "", onValueChange: o, clearLabel: n =
627
654
  /* @__PURE__ */ a(
628
655
  "input",
629
656
  {
630
- ...C,
631
- ref: S,
632
- id: B,
657
+ ...B,
658
+ ref: D,
659
+ id: S,
633
660
  type: "search",
634
- disabled: y,
661
+ disabled: k,
635
662
  readOnly: $,
636
663
  value: b,
637
- onChange: (N) => h(N.target.value),
638
- "aria-invalid": !!r || C["aria-invalid"],
639
- "aria-describedby": w(C["aria-describedby"], k),
640
- className: s("facto-input", "facto-search__input", !!r && "facto-input--error", m)
664
+ onChange: (v) => h(v.target.value),
665
+ "aria-invalid": !!r || B["aria-invalid"],
666
+ "aria-describedby": C(B["aria-describedby"], y),
667
+ className: i("facto-input", "facto-search__input", !!r && "facto-input--error", m)
641
668
  }
642
669
  ),
643
670
  b && !$ && /* @__PURE__ */ a(
@@ -645,72 +672,75 @@ function zt({ value: t, defaultValue: e = "", onValueChange: o, clearLabel: n =
645
672
  {
646
673
  type: "button",
647
674
  className: "facto-search__clear",
648
- disabled: y,
675
+ disabled: k,
649
676
  "aria-label": n,
650
677
  onClick: () => {
651
- h(""), S.current?.focus();
678
+ h(""), D.current?.focus();
652
679
  },
653
- children: "×"
680
+ children: /* @__PURE__ */ a(w, { name: "close", size: 16 })
654
681
  }
655
682
  )
656
683
  ] }),
657
- (r || i) && /* @__PURE__ */ a("span", { id: k, className: s("facto-field__message", !!r && "facto-field__message--error"), children: r ?? i })
684
+ (r || s) && /* @__PURE__ */ a("span", { id: y, className: i("facto-field__message", !!r && "facto-field__message--error"), children: r ?? s })
658
685
  ] });
659
686
  }
660
- function Jt({ className: t, ...e }) {
661
- return /* @__PURE__ */ a(Q, { ...e, type: "search", className: s("facto-search-field", t) });
687
+ function Xt({ className: t, ...e }) {
688
+ return /* @__PURE__ */ a(U, { ...e, type: "search", className: i("facto-search-field", t) });
662
689
  }
663
690
  export {
664
- ut as Badge,
665
- tt as Button,
666
- at as Card,
667
- gt as Checkbox,
668
- nt as DashboardGrid,
669
- _t as Dialog,
670
- kt as DialogClose,
671
- wt as DialogContent,
672
- It as DialogDescription,
673
- Tt as DialogTitle,
674
- yt as DialogTrigger,
675
- Rt as EmptyState,
676
- zt as EnhancedSearchField,
677
- Z as FactoTheme,
678
- et as IconButton,
679
- Ft as Notice,
680
- Jt as SearchField,
681
- mt as Select,
682
- Ct as Sheet,
683
- St as SheetClose,
684
- Dt as SheetContent,
685
- $t as SheetDescription,
686
- Pt as SheetTitle,
687
- Bt as SheetTrigger,
688
- xt as Skeleton,
689
- Wt as Stack,
690
- H as Surface,
691
- ht as Switch,
692
- bt as Tabs,
693
- pt as TabsContent,
694
- Nt as TabsList,
695
- vt as TabsTrigger,
696
- Q as TextField,
697
- ft as Textarea,
698
- Ot as Toast,
699
- qt as ToastAction,
700
- Gt as ToastClose,
701
- Ht as ToastDescription,
702
- Mt as ToastProvider,
703
- Vt as ToastTitle,
704
- Kt as ToastViewport,
705
- At as Tooltip,
706
- Lt as TooltipContent,
707
- jt as TooltipProvider,
708
- Et as TooltipTrigger,
709
- ot as Widget,
710
- lt as WidgetAction,
711
- rt as WidgetAmount,
712
- ct as WidgetHeader,
713
- st as WidgetKeyValue,
714
- it as WidgetList,
715
- dt as WidgetRow
691
+ Nt as Badge,
692
+ it as Button,
693
+ rt as Card,
694
+ kt as Checkbox,
695
+ dt as DashboardGrid,
696
+ Ct as Dialog,
697
+ St as DialogClose,
698
+ Dt as DialogContent,
699
+ Y as DialogDescription,
700
+ X as DialogTitle,
701
+ Bt as DialogTrigger,
702
+ Lt as EmptyState,
703
+ Ut as EnhancedSearchField,
704
+ ot as FactoTheme,
705
+ w as Icon,
706
+ st as IconButton,
707
+ ct as ModalFooter,
708
+ nt as ModalHeader,
709
+ jt as Notice,
710
+ Xt as SearchField,
711
+ pt as Select,
712
+ Pt as Sheet,
713
+ xt as SheetClose,
714
+ Rt as SheetContent,
715
+ Mt as SheetDescription,
716
+ Ft as SheetTitle,
717
+ $t as SheetTrigger,
718
+ Wt as Skeleton,
719
+ At as Stack,
720
+ q as Surface,
721
+ _t as Switch,
722
+ yt as Tabs,
723
+ It as TabsContent,
724
+ Tt as TabsList,
725
+ wt as TabsTrigger,
726
+ U as TextField,
727
+ vt as Textarea,
728
+ qt as Toast,
729
+ Zt as ToastAction,
730
+ Jt as ToastClose,
731
+ Kt as ToastDescription,
732
+ Vt as ToastProvider,
733
+ Gt as ToastTitle,
734
+ Qt as ToastViewport,
735
+ Ht as Tooltip,
736
+ Ot as TooltipContent,
737
+ Et as TooltipProvider,
738
+ zt as TooltipTrigger,
739
+ lt as Widget,
740
+ gt as WidgetAction,
741
+ ht as WidgetAmount,
742
+ ft as WidgetHeader,
743
+ mt as WidgetKeyValue,
744
+ ut as WidgetList,
745
+ bt as WidgetRow
716
746
  };