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

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