@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/AI.md +2 -0
- package/README.md +11 -5
- package/dist/ai/references/api.d.ts +14 -4
- package/dist/ai/references/catalog.json +20 -1
- package/dist/ai/references/components.md +3 -3
- package/dist/ai/references/design.md +47 -30
- package/dist/ai/references/integration.md +1 -1
- package/dist/ai/references/tokens.css +77 -62
- package/dist/ai/references/version.json +3 -3
- package/dist/index.d.ts +14 -4
- package/dist/index.js +266 -236
- package/dist/styles.css +1 -1
- package/dist/tokens.css +77 -62
- package/package.json +1 -1
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
|
|
6
|
-
import * as
|
|
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
|
|
10
|
-
import * as
|
|
11
|
-
import { createContext as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
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 =
|
|
19
|
-
c ? c.count += 1 : (
|
|
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 =
|
|
27
|
-
c && (c.count -= 1, c.count === 0 && (c.wasInert || (n.inert = !1),
|
|
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
|
|
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
|
|
36
|
-
const c = _(
|
|
37
|
-
return /* @__PURE__ */ a(
|
|
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
|
-
|
|
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:
|
|
67
|
+
className: s,
|
|
46
68
|
children: r,
|
|
47
69
|
disabled: f,
|
|
48
70
|
type: l = "button",
|
|
49
71
|
...m
|
|
50
|
-
},
|
|
72
|
+
}, k) {
|
|
51
73
|
return /* @__PURE__ */ d(
|
|
52
74
|
"button",
|
|
53
75
|
{
|
|
54
76
|
...m,
|
|
55
|
-
ref:
|
|
77
|
+
ref: k,
|
|
56
78
|
type: l,
|
|
57
79
|
disabled: f || c,
|
|
58
80
|
"aria-busy": c || void 0,
|
|
59
|
-
className:
|
|
81
|
+
className: i(
|
|
60
82
|
"facto-button",
|
|
61
83
|
`facto-button--${e}`,
|
|
62
84
|
`facto-button--${o}`,
|
|
63
85
|
n && "facto-button--full",
|
|
64
|
-
|
|
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
|
-
),
|
|
74
|
-
function({ ariaLabel: e, size: o = "md", className: n, title: c, type:
|
|
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
|
-
...
|
|
79
|
-
ref:
|
|
80
|
-
type:
|
|
100
|
+
...f,
|
|
101
|
+
ref: l,
|
|
102
|
+
type: s,
|
|
81
103
|
"aria-label": e,
|
|
82
104
|
title: c ?? e,
|
|
83
|
-
className:
|
|
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
|
|
115
|
+
function q({ padding: t = "lg", className: e, ...o }) {
|
|
93
116
|
return /* @__PURE__ */ a(
|
|
94
117
|
"div",
|
|
95
118
|
{
|
|
96
119
|
...o,
|
|
97
|
-
className:
|
|
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
|
|
106
|
-
return /* @__PURE__ */ a(
|
|
128
|
+
function rt(t) {
|
|
129
|
+
return /* @__PURE__ */ a(q, { ...t });
|
|
107
130
|
}
|
|
108
|
-
function
|
|
131
|
+
function lt({ span: t = 1, className: e, ...o }) {
|
|
109
132
|
return /* @__PURE__ */ a(
|
|
110
|
-
|
|
133
|
+
q,
|
|
111
134
|
{
|
|
112
135
|
...o,
|
|
113
136
|
padding: "md",
|
|
114
|
-
className:
|
|
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
|
|
123
|
-
return /* @__PURE__ */ a("div", { ...o, className:
|
|
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
|
|
148
|
+
function ft({ withAction: t, className: e, ...o }) {
|
|
126
149
|
return /* @__PURE__ */ a(
|
|
127
150
|
"div",
|
|
128
151
|
{
|
|
129
152
|
...o,
|
|
130
|
-
className:
|
|
153
|
+
className: i("facto-widget-head", t && "facto-widget-head--with-action", e)
|
|
131
154
|
}
|
|
132
155
|
);
|
|
133
156
|
}
|
|
134
|
-
function
|
|
135
|
-
return /* @__PURE__ */ a("div", { ...e, className:
|
|
157
|
+
function ut({ className: t, ...e }) {
|
|
158
|
+
return /* @__PURE__ */ a("div", { ...e, className: i("facto-widget-list", t) });
|
|
136
159
|
}
|
|
137
|
-
function
|
|
138
|
-
return /* @__PURE__ */ a("div", { ...e, className:
|
|
160
|
+
function mt({ className: t, ...e }) {
|
|
161
|
+
return /* @__PURE__ */ a("div", { ...e, className: i("facto-widget-kv", t) });
|
|
139
162
|
}
|
|
140
|
-
function
|
|
141
|
-
return /* @__PURE__ */ a("div", { ...e, className:
|
|
163
|
+
function ht({ className: t, ...e }) {
|
|
164
|
+
return /* @__PURE__ */ a("div", { ...e, className: i("facto-widget-amount", t) });
|
|
142
165
|
}
|
|
143
|
-
function
|
|
144
|
-
const e =
|
|
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", ...
|
|
150
|
-
return /* @__PURE__ */ a("button", { ...
|
|
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
|
|
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:
|
|
185
|
+
className: i("facto-widget-row", t)
|
|
163
186
|
}
|
|
164
187
|
);
|
|
165
188
|
}
|
|
166
|
-
function
|
|
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:
|
|
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:
|
|
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":
|
|
185
|
-
className:
|
|
207
|
+
"aria-describedby": C(r["aria-describedby"], m),
|
|
208
|
+
className: i(
|
|
186
209
|
"facto-input",
|
|
187
210
|
!!o && "facto-input--error",
|
|
188
|
-
|
|
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:
|
|
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
|
|
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:
|
|
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:
|
|
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":
|
|
224
|
-
className:
|
|
246
|
+
"aria-describedby": C(r["aria-describedby"], m),
|
|
247
|
+
className: i(
|
|
225
248
|
"facto-textarea",
|
|
226
249
|
!!o && "facto-input--error",
|
|
227
|
-
|
|
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:
|
|
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
|
|
267
|
+
function Nt({ tone: t = "neutral", className: e, ...o }) {
|
|
245
268
|
return /* @__PURE__ */ a(
|
|
246
269
|
"span",
|
|
247
270
|
{
|
|
248
271
|
...o,
|
|
249
|
-
className:
|
|
272
|
+
className: i("facto-badge", `facto-badge--${t}`, e)
|
|
250
273
|
}
|
|
251
274
|
);
|
|
252
275
|
}
|
|
253
|
-
function
|
|
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:
|
|
282
|
+
label: s,
|
|
260
283
|
error: r,
|
|
261
284
|
disabled: f,
|
|
262
285
|
name: l,
|
|
263
286
|
id: m,
|
|
264
|
-
ariaLabel:
|
|
287
|
+
ariaLabel: k,
|
|
265
288
|
"aria-describedby": $,
|
|
266
|
-
className:
|
|
289
|
+
className: B
|
|
267
290
|
}) {
|
|
268
|
-
const
|
|
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
|
-
}, []),
|
|
293
|
+
}, []), D = z(
|
|
271
294
|
(h) => {
|
|
272
|
-
b(), h && (T.current =
|
|
295
|
+
b(), h && (T.current = J(h));
|
|
273
296
|
},
|
|
274
297
|
[b]
|
|
275
298
|
);
|
|
276
|
-
return
|
|
277
|
-
|
|
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:
|
|
291
|
-
className:
|
|
292
|
-
"aria-label":
|
|
293
|
-
"aria-describedby":
|
|
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:
|
|
327
|
+
ref: D,
|
|
305
328
|
className: "facto-theme facto-select-content",
|
|
306
|
-
style:
|
|
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:
|
|
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
|
|
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
|
|
345
|
-
|
|
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":
|
|
350
|
-
className:
|
|
351
|
-
children: /* @__PURE__ */ a(
|
|
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
|
|
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
|
|
370
|
-
|
|
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":
|
|
375
|
-
className:
|
|
376
|
-
children: /* @__PURE__ */ a(
|
|
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
|
|
388
|
-
function
|
|
410
|
+
const yt = M.Root;
|
|
411
|
+
function Tt({
|
|
389
412
|
className: t,
|
|
390
413
|
...e
|
|
391
414
|
}) {
|
|
392
415
|
return /* @__PURE__ */ a(
|
|
393
|
-
|
|
416
|
+
M.List,
|
|
394
417
|
{
|
|
395
418
|
...e,
|
|
396
|
-
className:
|
|
419
|
+
className: i("facto-tabs-list", t)
|
|
397
420
|
}
|
|
398
421
|
);
|
|
399
422
|
}
|
|
400
|
-
function
|
|
423
|
+
function wt({
|
|
401
424
|
className: t,
|
|
402
425
|
...e
|
|
403
426
|
}) {
|
|
404
427
|
return /* @__PURE__ */ a(
|
|
405
|
-
|
|
428
|
+
M.Trigger,
|
|
406
429
|
{
|
|
407
430
|
...e,
|
|
408
|
-
className:
|
|
431
|
+
className: i("facto-tabs-trigger", t)
|
|
409
432
|
}
|
|
410
433
|
);
|
|
411
434
|
}
|
|
412
|
-
function
|
|
435
|
+
function It({
|
|
413
436
|
className: t,
|
|
414
437
|
...e
|
|
415
438
|
}) {
|
|
416
439
|
return /* @__PURE__ */ a(
|
|
417
|
-
|
|
440
|
+
M.Content,
|
|
418
441
|
{
|
|
419
442
|
...e,
|
|
420
|
-
className:
|
|
443
|
+
className: i("facto-tabs-content", t)
|
|
421
444
|
}
|
|
422
445
|
);
|
|
423
446
|
}
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
|
|
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
|
|
459
|
+
const s = _(N);
|
|
433
460
|
return /* @__PURE__ */ d(u.Portal, { children: [
|
|
434
|
-
/* @__PURE__ */ a(u.Overlay, { className: "facto-dialog-overlay", style:
|
|
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: { ...
|
|
440
|
-
className:
|
|
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
|
|
452
|
-
function
|
|
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
|
|
486
|
+
const s = _(N);
|
|
460
487
|
return /* @__PURE__ */ d(u.Portal, { children: [
|
|
461
|
-
/* @__PURE__ */ a(u.Overlay, { className: "facto-dialog-overlay", style:
|
|
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: { ...
|
|
467
|
-
className:
|
|
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
|
|
505
|
+
function Wt({
|
|
479
506
|
width: t,
|
|
480
507
|
height: e,
|
|
481
508
|
circle: o,
|
|
482
509
|
className: n,
|
|
483
510
|
style: c,
|
|
484
|
-
...
|
|
511
|
+
...s
|
|
485
512
|
}) {
|
|
486
513
|
return /* @__PURE__ */ a(
|
|
487
514
|
"span",
|
|
488
515
|
{
|
|
489
|
-
...
|
|
516
|
+
...s,
|
|
490
517
|
"aria-hidden": "true",
|
|
491
|
-
className:
|
|
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
|
|
527
|
+
function Lt({
|
|
501
528
|
title: t,
|
|
502
529
|
description: e,
|
|
503
530
|
action: o,
|
|
504
531
|
icon: n,
|
|
505
532
|
className: c,
|
|
506
|
-
...
|
|
533
|
+
...s
|
|
507
534
|
}) {
|
|
508
|
-
return /* @__PURE__ */ d("div", { ...
|
|
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
|
|
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
|
-
...
|
|
548
|
+
...s
|
|
522
549
|
}) {
|
|
523
550
|
return /* @__PURE__ */ d(
|
|
524
551
|
"div",
|
|
525
552
|
{
|
|
526
|
-
...
|
|
553
|
+
...s,
|
|
527
554
|
role: t === "danger" ? "alert" : "status",
|
|
528
|
-
className:
|
|
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
|
|
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
|
-
...
|
|
572
|
+
...s
|
|
546
573
|
}) {
|
|
547
574
|
return /* @__PURE__ */ a(
|
|
548
575
|
"div",
|
|
549
576
|
{
|
|
550
|
-
...
|
|
551
|
-
className:
|
|
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
|
|
589
|
+
function Et({ delayDuration: t = 300, ...e }) {
|
|
563
590
|
return /* @__PURE__ */ a(P.Provider, { ...e, delayDuration: t });
|
|
564
591
|
}
|
|
565
|
-
const
|
|
566
|
-
function
|
|
567
|
-
const r = _(
|
|
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
|
-
...
|
|
598
|
+
...s,
|
|
572
599
|
sideOffset: n,
|
|
573
|
-
className:
|
|
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
|
|
606
|
+
function Vt({ duration: t = 2600, ...e }) {
|
|
580
607
|
return /* @__PURE__ */ a(p.Provider, { ...e, duration: t });
|
|
581
608
|
}
|
|
582
|
-
function
|
|
583
|
-
const
|
|
584
|
-
return /* @__PURE__ */ d(p.Root, { ...c, className:
|
|
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
|
|
590
|
-
return /* @__PURE__ */ a(p.Title, { ...e, className:
|
|
616
|
+
function Gt({ className: t, ...e }) {
|
|
617
|
+
return /* @__PURE__ */ a(p.Title, { ...e, className: i("facto-toast__title", t) });
|
|
591
618
|
}
|
|
592
|
-
function
|
|
593
|
-
return /* @__PURE__ */ a(p.Description, { ...e, className:
|
|
619
|
+
function Kt({ className: t, ...e }) {
|
|
620
|
+
return /* @__PURE__ */ a(p.Description, { ...e, className: i("facto-toast__description", t) });
|
|
594
621
|
}
|
|
595
|
-
function
|
|
596
|
-
return /* @__PURE__ */ a(p.Action, { ...e, className:
|
|
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
|
|
599
|
-
return /* @__PURE__ */ a(p.Close, { ...n, "aria-label": o, className:
|
|
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
|
|
602
|
-
const n = _(
|
|
603
|
-
return
|
|
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
|
|
606
|
-
const
|
|
607
|
-
|
|
608
|
-
const
|
|
609
|
-
if (!
|
|
610
|
-
const j = (
|
|
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
|
-
|
|
639
|
+
G.defaultPrevented || (T(e), o?.(e));
|
|
613
640
|
});
|
|
614
641
|
};
|
|
615
|
-
return
|
|
642
|
+
return v.addEventListener("reset", j), () => v.removeEventListener("reset", j);
|
|
616
643
|
}, [e, t, o]);
|
|
617
|
-
const h = (
|
|
618
|
-
t === void 0 && T(
|
|
644
|
+
const h = (v) => {
|
|
645
|
+
t === void 0 && T(v), o?.(v);
|
|
619
646
|
};
|
|
620
|
-
return /* @__PURE__ */ d("div", { className:
|
|
621
|
-
c && /* @__PURE__ */ a("label", { className: "facto-field__label", htmlFor:
|
|
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
|
-
...
|
|
631
|
-
ref:
|
|
632
|
-
id:
|
|
657
|
+
...B,
|
|
658
|
+
ref: D,
|
|
659
|
+
id: S,
|
|
633
660
|
type: "search",
|
|
634
|
-
disabled:
|
|
661
|
+
disabled: k,
|
|
635
662
|
readOnly: $,
|
|
636
663
|
value: b,
|
|
637
|
-
onChange: (
|
|
638
|
-
"aria-invalid": !!r ||
|
|
639
|
-
"aria-describedby":
|
|
640
|
-
className:
|
|
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:
|
|
675
|
+
disabled: k,
|
|
649
676
|
"aria-label": n,
|
|
650
677
|
onClick: () => {
|
|
651
|
-
h(""),
|
|
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 ||
|
|
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
|
|
661
|
-
return /* @__PURE__ */ a(
|
|
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
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
Kt as
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
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
|
};
|