@facto-to/design-system 0.1.0-beta.1
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/LICENSE +204 -0
- package/README.md +144 -0
- package/dist/fonts/OFL.txt +93 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts.css +23 -0
- package/dist/index.d.ts +213 -0
- package/dist/index.js +716 -0
- package/dist/styles.css +1 -0
- package/dist/tokens.css +143 -0
- package/package.json +63 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,716 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import * as P from "@radix-ui/react-tooltip";
|
|
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";
|
|
7
|
+
import * as u from "@radix-ui/react-dialog";
|
|
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) {
|
|
14
|
+
const e = Array.from(t.ownerDocument.body.children).filter(
|
|
15
|
+
(n) => n instanceof HTMLElement && !n.hasAttribute("data-radix-focus-guard") && !n.contains(t)
|
|
16
|
+
);
|
|
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);
|
|
20
|
+
}
|
|
21
|
+
let o = !0;
|
|
22
|
+
return () => {
|
|
23
|
+
if (o) {
|
|
24
|
+
o = !1;
|
|
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)));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const s = (...t) => t.filter(Boolean).join(" "), w = (...t) => t.filter(Boolean).join(" ") || void 0, v = K({}), J = (t) => Object.fromEntries(
|
|
33
|
+
Object.entries(t ?? {}).filter(([e, o]) => e.startsWith("--facto-") && o !== void 0 && o !== null)
|
|
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) }) });
|
|
38
|
+
}
|
|
39
|
+
const tt = M(
|
|
40
|
+
function({
|
|
41
|
+
variant: e = "primary",
|
|
42
|
+
size: o = "md",
|
|
43
|
+
fullWidth: n,
|
|
44
|
+
loading: c,
|
|
45
|
+
className: i,
|
|
46
|
+
children: r,
|
|
47
|
+
disabled: f,
|
|
48
|
+
type: l = "button",
|
|
49
|
+
...m
|
|
50
|
+
}, y) {
|
|
51
|
+
return /* @__PURE__ */ d(
|
|
52
|
+
"button",
|
|
53
|
+
{
|
|
54
|
+
...m,
|
|
55
|
+
ref: y,
|
|
56
|
+
type: l,
|
|
57
|
+
disabled: f || c,
|
|
58
|
+
"aria-busy": c || void 0,
|
|
59
|
+
className: s(
|
|
60
|
+
"facto-button",
|
|
61
|
+
`facto-button--${e}`,
|
|
62
|
+
`facto-button--${o}`,
|
|
63
|
+
n && "facto-button--full",
|
|
64
|
+
i
|
|
65
|
+
),
|
|
66
|
+
children: [
|
|
67
|
+
c && /* @__PURE__ */ a("span", { className: "facto-button__spinner", "aria-hidden": "true" }),
|
|
68
|
+
r
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
), et = M(
|
|
74
|
+
function({ ariaLabel: e, size: o = "md", className: n, title: c, type: i = "button", ...r }, f) {
|
|
75
|
+
return /* @__PURE__ */ a(
|
|
76
|
+
"button",
|
|
77
|
+
{
|
|
78
|
+
...r,
|
|
79
|
+
ref: f,
|
|
80
|
+
type: i,
|
|
81
|
+
"aria-label": e,
|
|
82
|
+
title: c ?? e,
|
|
83
|
+
className: s(
|
|
84
|
+
"facto-icon-button",
|
|
85
|
+
`facto-icon-button--${o}`,
|
|
86
|
+
n
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
function H({ padding: t = "lg", className: e, ...o }) {
|
|
93
|
+
return /* @__PURE__ */ a(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
...o,
|
|
97
|
+
className: s(
|
|
98
|
+
"facto-surface",
|
|
99
|
+
`facto-surface--padding-${t}`,
|
|
100
|
+
e
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function at(t) {
|
|
106
|
+
return /* @__PURE__ */ a(H, { ...t });
|
|
107
|
+
}
|
|
108
|
+
function ot({ span: t = 1, className: e, ...o }) {
|
|
109
|
+
return /* @__PURE__ */ a(
|
|
110
|
+
H,
|
|
111
|
+
{
|
|
112
|
+
...o,
|
|
113
|
+
padding: "md",
|
|
114
|
+
className: s(
|
|
115
|
+
"facto-widget",
|
|
116
|
+
t === 2 && "facto-widget--span-2",
|
|
117
|
+
e
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
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 }) });
|
|
124
|
+
}
|
|
125
|
+
function ct({ withAction: t, className: e, ...o }) {
|
|
126
|
+
return /* @__PURE__ */ a(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
...o,
|
|
130
|
+
className: s("facto-widget-head", t && "facto-widget-head--with-action", e)
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
function it({ className: t, ...e }) {
|
|
135
|
+
return /* @__PURE__ */ a("div", { ...e, className: s("facto-widget-list", t) });
|
|
136
|
+
}
|
|
137
|
+
function st({ className: t, ...e }) {
|
|
138
|
+
return /* @__PURE__ */ a("div", { ...e, className: s("facto-widget-kv", t) });
|
|
139
|
+
}
|
|
140
|
+
function rt({ className: t, ...e }) {
|
|
141
|
+
return /* @__PURE__ */ a("div", { ...e, className: s("facto-widget-amount", t) });
|
|
142
|
+
}
|
|
143
|
+
function lt(t) {
|
|
144
|
+
const e = s("facto-widget-action", t.dark && "facto-widget-action--dark", t.className);
|
|
145
|
+
if (typeof t.href == "string") {
|
|
146
|
+
const { dark: r, className: f, ...l } = t;
|
|
147
|
+
return /* @__PURE__ */ a("a", { ...l, className: e });
|
|
148
|
+
}
|
|
149
|
+
const { dark: o, className: n, type: c = "button", ...i } = t;
|
|
150
|
+
return /* @__PURE__ */ a("button", { ...i, type: c, className: e });
|
|
151
|
+
}
|
|
152
|
+
function dt({
|
|
153
|
+
className: t,
|
|
154
|
+
type: e = "button",
|
|
155
|
+
...o
|
|
156
|
+
}) {
|
|
157
|
+
return /* @__PURE__ */ a(
|
|
158
|
+
"button",
|
|
159
|
+
{
|
|
160
|
+
...o,
|
|
161
|
+
type: e,
|
|
162
|
+
className: s("facto-widget-row", t)
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
function Q({
|
|
167
|
+
label: t,
|
|
168
|
+
helperText: e,
|
|
169
|
+
error: o,
|
|
170
|
+
id: n,
|
|
171
|
+
containerClassName: c,
|
|
172
|
+
className: i,
|
|
173
|
+
...r
|
|
174
|
+
}) {
|
|
175
|
+
const f = I(), l = n ?? f, m = o || e ? `${l}-description` : void 0;
|
|
176
|
+
return /* @__PURE__ */ d("div", { className: s("facto-field", c), children: [
|
|
177
|
+
t && /* @__PURE__ */ a("label", { className: "facto-field__label", htmlFor: l, children: t }),
|
|
178
|
+
/* @__PURE__ */ a(
|
|
179
|
+
"input",
|
|
180
|
+
{
|
|
181
|
+
...r,
|
|
182
|
+
id: l,
|
|
183
|
+
"aria-invalid": !!o || r["aria-invalid"],
|
|
184
|
+
"aria-describedby": w(r["aria-describedby"], m),
|
|
185
|
+
className: s(
|
|
186
|
+
"facto-input",
|
|
187
|
+
!!o && "facto-input--error",
|
|
188
|
+
i
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
(o || e) && /* @__PURE__ */ a(
|
|
193
|
+
"span",
|
|
194
|
+
{
|
|
195
|
+
id: m,
|
|
196
|
+
className: s(
|
|
197
|
+
"facto-field__message",
|
|
198
|
+
!!o && "facto-field__message--error"
|
|
199
|
+
),
|
|
200
|
+
children: o ?? e
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
] });
|
|
204
|
+
}
|
|
205
|
+
function ft({
|
|
206
|
+
label: t,
|
|
207
|
+
helperText: e,
|
|
208
|
+
error: o,
|
|
209
|
+
id: n,
|
|
210
|
+
containerClassName: c,
|
|
211
|
+
className: i,
|
|
212
|
+
...r
|
|
213
|
+
}) {
|
|
214
|
+
const f = I(), l = n ?? f, m = o || e ? `${l}-description` : void 0;
|
|
215
|
+
return /* @__PURE__ */ d("div", { className: s("facto-field", c), children: [
|
|
216
|
+
t && /* @__PURE__ */ a("label", { className: "facto-field__label", htmlFor: l, children: t }),
|
|
217
|
+
/* @__PURE__ */ a(
|
|
218
|
+
"textarea",
|
|
219
|
+
{
|
|
220
|
+
...r,
|
|
221
|
+
id: l,
|
|
222
|
+
"aria-invalid": !!o || r["aria-invalid"],
|
|
223
|
+
"aria-describedby": w(r["aria-describedby"], m),
|
|
224
|
+
className: s(
|
|
225
|
+
"facto-textarea",
|
|
226
|
+
!!o && "facto-input--error",
|
|
227
|
+
i
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
(o || e) && /* @__PURE__ */ a(
|
|
232
|
+
"span",
|
|
233
|
+
{
|
|
234
|
+
id: m,
|
|
235
|
+
className: s(
|
|
236
|
+
"facto-field__message",
|
|
237
|
+
!!o && "facto-field__message--error"
|
|
238
|
+
),
|
|
239
|
+
children: o ?? e
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
] });
|
|
243
|
+
}
|
|
244
|
+
function ut({ tone: t = "neutral", className: e, ...o }) {
|
|
245
|
+
return /* @__PURE__ */ a(
|
|
246
|
+
"span",
|
|
247
|
+
{
|
|
248
|
+
...o,
|
|
249
|
+
className: s("facto-badge", `facto-badge--${t}`, e)
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
function mt({
|
|
254
|
+
options: t,
|
|
255
|
+
value: e,
|
|
256
|
+
defaultValue: o,
|
|
257
|
+
onValueChange: n,
|
|
258
|
+
placeholder: c = "Select an option",
|
|
259
|
+
label: i,
|
|
260
|
+
error: r,
|
|
261
|
+
disabled: f,
|
|
262
|
+
name: l,
|
|
263
|
+
id: m,
|
|
264
|
+
ariaLabel: y,
|
|
265
|
+
"aria-describedby": $,
|
|
266
|
+
className: C
|
|
267
|
+
}) {
|
|
268
|
+
const F = _(v), B = I(), k = m ?? B, D = r ? `${k}-description` : void 0, T = V(null), b = L(() => {
|
|
269
|
+
T.current?.(), T.current = null;
|
|
270
|
+
}, []), S = L(
|
|
271
|
+
(h) => {
|
|
272
|
+
b(), h && (T.current = z(h));
|
|
273
|
+
},
|
|
274
|
+
[b]
|
|
275
|
+
);
|
|
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 }),
|
|
278
|
+
/* @__PURE__ */ d(
|
|
279
|
+
g.Root,
|
|
280
|
+
{
|
|
281
|
+
value: e,
|
|
282
|
+
defaultValue: o,
|
|
283
|
+
onValueChange: n,
|
|
284
|
+
disabled: f,
|
|
285
|
+
name: l,
|
|
286
|
+
children: [
|
|
287
|
+
/* @__PURE__ */ d(
|
|
288
|
+
g.Trigger,
|
|
289
|
+
{
|
|
290
|
+
id: k,
|
|
291
|
+
className: s("facto-select", !!r && "facto-input--error"),
|
|
292
|
+
"aria-label": y,
|
|
293
|
+
"aria-describedby": w($, D),
|
|
294
|
+
"aria-invalid": !!r,
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ a(g.Value, { placeholder: c }),
|
|
297
|
+
/* @__PURE__ */ a(g.Icon, { className: "facto-select__chevron", children: "⌄" })
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
),
|
|
301
|
+
/* @__PURE__ */ a(g.Portal, { children: /* @__PURE__ */ a(
|
|
302
|
+
g.Content,
|
|
303
|
+
{
|
|
304
|
+
ref: S,
|
|
305
|
+
className: "facto-theme facto-select-content",
|
|
306
|
+
style: F,
|
|
307
|
+
position: "popper",
|
|
308
|
+
onCloseAutoFocus: b,
|
|
309
|
+
children: /* @__PURE__ */ a(g.Viewport, { children: t.map((h) => /* @__PURE__ */ d(
|
|
310
|
+
g.Item,
|
|
311
|
+
{
|
|
312
|
+
value: h.value,
|
|
313
|
+
disabled: h.disabled,
|
|
314
|
+
className: "facto-select-item",
|
|
315
|
+
children: [
|
|
316
|
+
/* @__PURE__ */ a(g.ItemText, { children: h.label }),
|
|
317
|
+
/* @__PURE__ */ a(g.ItemIndicator, { children: "✓" })
|
|
318
|
+
]
|
|
319
|
+
},
|
|
320
|
+
h.value
|
|
321
|
+
)) })
|
|
322
|
+
}
|
|
323
|
+
) })
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
),
|
|
327
|
+
r && /* @__PURE__ */ a(
|
|
328
|
+
"span",
|
|
329
|
+
{
|
|
330
|
+
id: D,
|
|
331
|
+
className: "facto-field__message facto-field__message--error",
|
|
332
|
+
children: r
|
|
333
|
+
}
|
|
334
|
+
)
|
|
335
|
+
] });
|
|
336
|
+
}
|
|
337
|
+
function ht({
|
|
338
|
+
label: t,
|
|
339
|
+
description: e,
|
|
340
|
+
className: o,
|
|
341
|
+
id: n,
|
|
342
|
+
...c
|
|
343
|
+
}) {
|
|
344
|
+
const i = I(), r = n ?? i, f = e ? `${r}-description` : void 0, l = /* @__PURE__ */ a(
|
|
345
|
+
E.Root,
|
|
346
|
+
{
|
|
347
|
+
...c,
|
|
348
|
+
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" })
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
return t ? /* @__PURE__ */ d("div", { className: "facto-check-field", children: [
|
|
355
|
+
l,
|
|
356
|
+
/* @__PURE__ */ d("span", { children: [
|
|
357
|
+
/* @__PURE__ */ a("label", { htmlFor: r, children: /* @__PURE__ */ a("strong", { children: t }) }),
|
|
358
|
+
e && /* @__PURE__ */ a("small", { id: f, children: e })
|
|
359
|
+
] })
|
|
360
|
+
] }) : l;
|
|
361
|
+
}
|
|
362
|
+
function gt({
|
|
363
|
+
label: t,
|
|
364
|
+
description: e,
|
|
365
|
+
className: o,
|
|
366
|
+
id: n,
|
|
367
|
+
...c
|
|
368
|
+
}) {
|
|
369
|
+
const i = I(), r = n ?? i, f = e ? `${r}-description` : void 0, l = /* @__PURE__ */ a(
|
|
370
|
+
A.Root,
|
|
371
|
+
{
|
|
372
|
+
...c,
|
|
373
|
+
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: "✓" })
|
|
377
|
+
}
|
|
378
|
+
);
|
|
379
|
+
return t ? /* @__PURE__ */ d("div", { className: "facto-check-field", children: [
|
|
380
|
+
l,
|
|
381
|
+
/* @__PURE__ */ d("span", { children: [
|
|
382
|
+
/* @__PURE__ */ a("label", { htmlFor: r, children: /* @__PURE__ */ a("strong", { children: t }) }),
|
|
383
|
+
e && /* @__PURE__ */ a("small", { id: f, children: e })
|
|
384
|
+
] })
|
|
385
|
+
] }) : l;
|
|
386
|
+
}
|
|
387
|
+
const bt = R.Root;
|
|
388
|
+
function Nt({
|
|
389
|
+
className: t,
|
|
390
|
+
...e
|
|
391
|
+
}) {
|
|
392
|
+
return /* @__PURE__ */ a(
|
|
393
|
+
R.List,
|
|
394
|
+
{
|
|
395
|
+
...e,
|
|
396
|
+
className: s("facto-tabs-list", t)
|
|
397
|
+
}
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
function vt({
|
|
401
|
+
className: t,
|
|
402
|
+
...e
|
|
403
|
+
}) {
|
|
404
|
+
return /* @__PURE__ */ a(
|
|
405
|
+
R.Trigger,
|
|
406
|
+
{
|
|
407
|
+
...e,
|
|
408
|
+
className: s("facto-tabs-trigger", t)
|
|
409
|
+
}
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
function pt({
|
|
413
|
+
className: t,
|
|
414
|
+
...e
|
|
415
|
+
}) {
|
|
416
|
+
return /* @__PURE__ */ a(
|
|
417
|
+
R.Content,
|
|
418
|
+
{
|
|
419
|
+
...e,
|
|
420
|
+
className: s("facto-tabs-content", t)
|
|
421
|
+
}
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
const _t = u.Root, yt = u.Trigger, kt = u.Close, Tt = u.Title, It = u.Description;
|
|
425
|
+
function wt({
|
|
426
|
+
size: t = "md",
|
|
427
|
+
className: e,
|
|
428
|
+
style: o,
|
|
429
|
+
children: n,
|
|
430
|
+
...c
|
|
431
|
+
}) {
|
|
432
|
+
const i = _(v);
|
|
433
|
+
return /* @__PURE__ */ d(u.Portal, { children: [
|
|
434
|
+
/* @__PURE__ */ a(u.Overlay, { className: "facto-dialog-overlay", style: i }),
|
|
435
|
+
/* @__PURE__ */ a(
|
|
436
|
+
u.Content,
|
|
437
|
+
{
|
|
438
|
+
...c,
|
|
439
|
+
style: { ...i, ...o },
|
|
440
|
+
className: s(
|
|
441
|
+
"facto-theme",
|
|
442
|
+
"facto-dialog",
|
|
443
|
+
`facto-dialog--${t}`,
|
|
444
|
+
e
|
|
445
|
+
),
|
|
446
|
+
children: n
|
|
447
|
+
}
|
|
448
|
+
)
|
|
449
|
+
] });
|
|
450
|
+
}
|
|
451
|
+
const Ct = u.Root, Bt = u.Trigger, St = u.Close, Pt = u.Title, $t = u.Description;
|
|
452
|
+
function Dt({
|
|
453
|
+
side: t = "center",
|
|
454
|
+
className: e,
|
|
455
|
+
style: o,
|
|
456
|
+
children: n,
|
|
457
|
+
...c
|
|
458
|
+
}) {
|
|
459
|
+
const i = _(v);
|
|
460
|
+
return /* @__PURE__ */ d(u.Portal, { children: [
|
|
461
|
+
/* @__PURE__ */ a(u.Overlay, { className: "facto-dialog-overlay", style: i }),
|
|
462
|
+
/* @__PURE__ */ a(
|
|
463
|
+
u.Content,
|
|
464
|
+
{
|
|
465
|
+
...c,
|
|
466
|
+
style: { ...i, ...o },
|
|
467
|
+
className: s(
|
|
468
|
+
"facto-theme",
|
|
469
|
+
"facto-sheet",
|
|
470
|
+
`facto-sheet--${t}`,
|
|
471
|
+
e
|
|
472
|
+
),
|
|
473
|
+
children: n
|
|
474
|
+
}
|
|
475
|
+
)
|
|
476
|
+
] });
|
|
477
|
+
}
|
|
478
|
+
function xt({
|
|
479
|
+
width: t,
|
|
480
|
+
height: e,
|
|
481
|
+
circle: o,
|
|
482
|
+
className: n,
|
|
483
|
+
style: c,
|
|
484
|
+
...i
|
|
485
|
+
}) {
|
|
486
|
+
return /* @__PURE__ */ a(
|
|
487
|
+
"span",
|
|
488
|
+
{
|
|
489
|
+
...i,
|
|
490
|
+
"aria-hidden": "true",
|
|
491
|
+
className: s(
|
|
492
|
+
"facto-skeleton",
|
|
493
|
+
o && "facto-skeleton--circle",
|
|
494
|
+
n
|
|
495
|
+
),
|
|
496
|
+
style: { ...c, width: t, height: e }
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
function Rt({
|
|
501
|
+
title: t,
|
|
502
|
+
description: e,
|
|
503
|
+
action: o,
|
|
504
|
+
icon: n,
|
|
505
|
+
className: c,
|
|
506
|
+
...i
|
|
507
|
+
}) {
|
|
508
|
+
return /* @__PURE__ */ d("div", { ...i, className: s("facto-empty-state", c), children: [
|
|
509
|
+
n && /* @__PURE__ */ a("div", { className: "facto-empty-state__icon", "aria-hidden": "true", children: n }),
|
|
510
|
+
/* @__PURE__ */ a("strong", { children: t }),
|
|
511
|
+
e && /* @__PURE__ */ a("p", { children: e }),
|
|
512
|
+
o && /* @__PURE__ */ a("div", { children: o })
|
|
513
|
+
] });
|
|
514
|
+
}
|
|
515
|
+
function Ft({
|
|
516
|
+
tone: t = "info",
|
|
517
|
+
title: e,
|
|
518
|
+
description: o,
|
|
519
|
+
action: n,
|
|
520
|
+
className: c,
|
|
521
|
+
...i
|
|
522
|
+
}) {
|
|
523
|
+
return /* @__PURE__ */ d(
|
|
524
|
+
"div",
|
|
525
|
+
{
|
|
526
|
+
...i,
|
|
527
|
+
role: t === "danger" ? "alert" : "status",
|
|
528
|
+
className: s("facto-notice", `facto-notice--${t}`, c),
|
|
529
|
+
children: [
|
|
530
|
+
/* @__PURE__ */ d("div", { children: [
|
|
531
|
+
/* @__PURE__ */ a("strong", { children: e }),
|
|
532
|
+
o && /* @__PURE__ */ a("span", { children: o })
|
|
533
|
+
] }),
|
|
534
|
+
n
|
|
535
|
+
]
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
function Wt({
|
|
540
|
+
gap: t = 3,
|
|
541
|
+
direction: e = "vertical",
|
|
542
|
+
align: o = "stretch",
|
|
543
|
+
justify: n = "start",
|
|
544
|
+
className: c,
|
|
545
|
+
...i
|
|
546
|
+
}) {
|
|
547
|
+
return /* @__PURE__ */ a(
|
|
548
|
+
"div",
|
|
549
|
+
{
|
|
550
|
+
...i,
|
|
551
|
+
className: s(
|
|
552
|
+
"facto-stack",
|
|
553
|
+
`facto-stack--${e}`,
|
|
554
|
+
`facto-stack--gap-${t}`,
|
|
555
|
+
`facto-stack--align-${o}`,
|
|
556
|
+
`facto-stack--justify-${n}`,
|
|
557
|
+
c
|
|
558
|
+
)
|
|
559
|
+
}
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
function jt({ delayDuration: t = 300, ...e }) {
|
|
563
|
+
return /* @__PURE__ */ a(P.Provider, { ...e, delayDuration: t });
|
|
564
|
+
}
|
|
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);
|
|
568
|
+
return /* @__PURE__ */ a(P.Portal, { children: /* @__PURE__ */ a(
|
|
569
|
+
P.Content,
|
|
570
|
+
{
|
|
571
|
+
...i,
|
|
572
|
+
sideOffset: n,
|
|
573
|
+
className: s("facto-theme", "facto-tooltip", t === "content" && "facto-tooltip--content", e),
|
|
574
|
+
style: { ...r, ...o },
|
|
575
|
+
children: c
|
|
576
|
+
}
|
|
577
|
+
) });
|
|
578
|
+
}
|
|
579
|
+
function Mt({ duration: t = 2600, ...e }) {
|
|
580
|
+
return /* @__PURE__ */ a(p.Provider, { ...e, duration: t });
|
|
581
|
+
}
|
|
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" ? "×" : "✓" }),
|
|
586
|
+
/* @__PURE__ */ a("div", { className: "facto-toast__copy", children: n })
|
|
587
|
+
] });
|
|
588
|
+
}
|
|
589
|
+
function Vt({ className: t, ...e }) {
|
|
590
|
+
return /* @__PURE__ */ a(p.Title, { ...e, className: s("facto-toast__title", t) });
|
|
591
|
+
}
|
|
592
|
+
function Ht({ className: t, ...e }) {
|
|
593
|
+
return /* @__PURE__ */ a(p.Description, { ...e, className: s("facto-toast__description", t) });
|
|
594
|
+
}
|
|
595
|
+
function qt({ className: t, ...e }) {
|
|
596
|
+
return /* @__PURE__ */ a(p.Action, { ...e, className: s("facto-button", "facto-button--secondary", "facto-button--sm", t) });
|
|
597
|
+
}
|
|
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 });
|
|
600
|
+
}
|
|
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;
|
|
604
|
+
}
|
|
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) => {
|
|
611
|
+
queueMicrotask(() => {
|
|
612
|
+
q.defaultPrevented || (T(e), o?.(e));
|
|
613
|
+
});
|
|
614
|
+
};
|
|
615
|
+
return N.addEventListener("reset", j), () => N.removeEventListener("reset", j);
|
|
616
|
+
}, [e, t, o]);
|
|
617
|
+
const h = (N) => {
|
|
618
|
+
t === void 0 && T(N), o?.(N);
|
|
619
|
+
};
|
|
620
|
+
return /* @__PURE__ */ d("div", { className: s("facto-field", l), children: [
|
|
621
|
+
c && /* @__PURE__ */ a("label", { className: "facto-field__label", htmlFor: B, children: c }),
|
|
622
|
+
/* @__PURE__ */ d("div", { className: "facto-search", children: [
|
|
623
|
+
/* @__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
|
+
/* @__PURE__ */ a("circle", { cx: "10.5", cy: "10.5", r: "6.5" }),
|
|
625
|
+
/* @__PURE__ */ a("path", { d: "m16 16 5 5" })
|
|
626
|
+
] }),
|
|
627
|
+
/* @__PURE__ */ a(
|
|
628
|
+
"input",
|
|
629
|
+
{
|
|
630
|
+
...C,
|
|
631
|
+
ref: S,
|
|
632
|
+
id: B,
|
|
633
|
+
type: "search",
|
|
634
|
+
disabled: y,
|
|
635
|
+
readOnly: $,
|
|
636
|
+
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)
|
|
641
|
+
}
|
|
642
|
+
),
|
|
643
|
+
b && !$ && /* @__PURE__ */ a(
|
|
644
|
+
"button",
|
|
645
|
+
{
|
|
646
|
+
type: "button",
|
|
647
|
+
className: "facto-search__clear",
|
|
648
|
+
disabled: y,
|
|
649
|
+
"aria-label": n,
|
|
650
|
+
onClick: () => {
|
|
651
|
+
h(""), S.current?.focus();
|
|
652
|
+
},
|
|
653
|
+
children: "×"
|
|
654
|
+
}
|
|
655
|
+
)
|
|
656
|
+
] }),
|
|
657
|
+
(r || i) && /* @__PURE__ */ a("span", { id: k, className: s("facto-field__message", !!r && "facto-field__message--error"), children: r ?? i })
|
|
658
|
+
] });
|
|
659
|
+
}
|
|
660
|
+
function Jt({ className: t, ...e }) {
|
|
661
|
+
return /* @__PURE__ */ a(Q, { ...e, type: "search", className: s("facto-search-field", t) });
|
|
662
|
+
}
|
|
663
|
+
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
|
|
716
|
+
};
|