prometeo-design-system 9.3.0 → 9.4.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/dist/FormField.d.ts +6 -0
- package/dist/FormField.es.js +62 -0
- package/dist/FormFieldContext-H8_osEEP.js +11 -0
- package/dist/HelperComponent.es.js +20 -20
- package/dist/SegmentedButton.es.js +153 -147
- package/dist/components/FormField/FormField.d.ts +4 -0
- package/dist/components/FormField/FormFieldContext.d.ts +22 -0
- package/dist/components/FormField/types.d.ts +23 -0
- package/dist/components/SegmentedButton/SegmentedButton.d.ts +9 -0
- package/dist/components/Shared/HelperComponent.d.ts +1 -0
- package/dist/exports/FormField.d.ts +4 -0
- package/dist/index.d.ts +3 -0
- package/dist/prometeo-design-system.es.js +149 -145
- package/package.json +5 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-CqQglQKg.js";
|
|
2
|
+
import { c as p } from "./cn-B6yFEsav.js";
|
|
3
|
+
import { memo as b, useId as j } from "react";
|
|
4
|
+
import I from "./HelperComponent.es.js";
|
|
5
|
+
import { f as g } from "./fieldVariants-Ci6QYhCb.js";
|
|
6
|
+
import { F as N } from "./FormFieldContext-H8_osEEP.js";
|
|
7
|
+
import { u as E } from "./FormFieldContext-H8_osEEP.js";
|
|
8
|
+
const y = b(function(f) {
|
|
9
|
+
const {
|
|
10
|
+
label: l,
|
|
11
|
+
supportingText: o,
|
|
12
|
+
showSupportingText: u,
|
|
13
|
+
state: r = "default",
|
|
14
|
+
disabled: t = !1,
|
|
15
|
+
required: d = !1,
|
|
16
|
+
htmlFor: m,
|
|
17
|
+
children: x,
|
|
18
|
+
className: h
|
|
19
|
+
} = f, s = j(), a = l ? `${s}-label` : void 0, i = `${s}-helper`, F = m ?? `${s}-control`, c = typeof o == "function" ? o() : o, n = u ?? c != null, v = {
|
|
20
|
+
labelId: a,
|
|
21
|
+
helperId: n ? i : void 0,
|
|
22
|
+
labelledBy: a,
|
|
23
|
+
describedBy: n ? i : void 0,
|
|
24
|
+
controlId: F,
|
|
25
|
+
state: r,
|
|
26
|
+
disabled: t,
|
|
27
|
+
required: d
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ e.jsx(N.Provider, { value: v, children: /* @__PURE__ */ e.jsxs("div", { className: p("relative flex w-full flex-col gap-1", h), children: [
|
|
30
|
+
l ? /* @__PURE__ */ e.jsx(
|
|
31
|
+
"label",
|
|
32
|
+
{
|
|
33
|
+
id: a,
|
|
34
|
+
htmlFor: m,
|
|
35
|
+
className: p(
|
|
36
|
+
g({ state: r, disabled: t }),
|
|
37
|
+
"relative z-10",
|
|
38
|
+
d && "after:ml-0.5 after:content-['*']"
|
|
39
|
+
),
|
|
40
|
+
children: l
|
|
41
|
+
}
|
|
42
|
+
) : null,
|
|
43
|
+
x,
|
|
44
|
+
n ? /* @__PURE__ */ e.jsx(
|
|
45
|
+
I,
|
|
46
|
+
{
|
|
47
|
+
id: i,
|
|
48
|
+
variant: r,
|
|
49
|
+
disabled: t,
|
|
50
|
+
className: "min-h-4",
|
|
51
|
+
children: c
|
|
52
|
+
}
|
|
53
|
+
) : null
|
|
54
|
+
] }) });
|
|
55
|
+
});
|
|
56
|
+
y.displayName = "FormField";
|
|
57
|
+
export {
|
|
58
|
+
y as FormField,
|
|
59
|
+
N as FormFieldContext,
|
|
60
|
+
y as default,
|
|
61
|
+
E as useFormField
|
|
62
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-CqQglQKg.js";
|
|
2
2
|
import { c as r } from "./cn-B6yFEsav.js";
|
|
3
3
|
import { c as i } from "./index-BOQuZ0gG.js";
|
|
4
|
-
import { memo as
|
|
5
|
-
import { Warning as
|
|
6
|
-
import { CheckCircle as
|
|
7
|
-
import { Error as
|
|
8
|
-
import { Info as
|
|
9
|
-
const
|
|
4
|
+
import { memo as c } from "react";
|
|
5
|
+
import { Warning as o } from "./Icon-Warning.es.js";
|
|
6
|
+
import { CheckCircle as u } from "./Icon-CheckCircle.es.js";
|
|
7
|
+
import { Error as f } from "./Icon-Error.es.js";
|
|
8
|
+
import { Info as m } from "./Icon-Info.es.js";
|
|
9
|
+
const b = i("truncate", {
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
default: "text-neutral-tertiary-default",
|
|
@@ -23,7 +23,7 @@ const m = i("truncate", {
|
|
|
23
23
|
variant: "default",
|
|
24
24
|
disabled: !1
|
|
25
25
|
}
|
|
26
|
-
}),
|
|
26
|
+
}), v = i("min-h-4 shrink-0", {
|
|
27
27
|
variants: {
|
|
28
28
|
variant: {
|
|
29
29
|
default: "",
|
|
@@ -50,23 +50,23 @@ const m = i("truncate", {
|
|
|
50
50
|
variant: "default",
|
|
51
51
|
disabled: !1
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), x = (a, t) => {
|
|
54
54
|
const e = {
|
|
55
|
-
default:
|
|
56
|
-
error:
|
|
57
|
-
success:
|
|
58
|
-
warning:
|
|
55
|
+
default: m,
|
|
56
|
+
error: f,
|
|
57
|
+
success: u,
|
|
58
|
+
warning: o
|
|
59
59
|
}[a];
|
|
60
|
-
return /* @__PURE__ */ s.jsx(e, { size: 16, className: r(
|
|
61
|
-
},
|
|
62
|
-
const { variant: t, className: n, disabled: e } = a;
|
|
63
|
-
return /* @__PURE__ */ s.jsxs("div", { ref: a.ref, className: r("flex gap-0.5 px-3 items-center prometeo-fonts-body-small", e &&
|
|
64
|
-
a.children &&
|
|
65
|
-
typeof a.children == "string" ? /* @__PURE__ */ s.jsx("p", { title: a.children, className: r(" prometeo-fonts-body-small",
|
|
60
|
+
return /* @__PURE__ */ s.jsx(e, { size: 16, className: r(v({ variant: a, disabled: t })) });
|
|
61
|
+
}, p = "*:text-disabled-default *:icon-disabled-default", l = (a) => {
|
|
62
|
+
const { variant: t, className: n, disabled: e, id: d } = a;
|
|
63
|
+
return /* @__PURE__ */ s.jsxs("div", { id: d, ref: a.ref, className: r("flex gap-0.5 px-3 items-center prometeo-fonts-body-small", e && p, n), children: [
|
|
64
|
+
a.children && x(t, e ?? !1),
|
|
65
|
+
typeof a.children == "string" ? /* @__PURE__ */ s.jsx("p", { title: a.children, className: r(" prometeo-fonts-body-small", b({ variant: t, disabled: e })), children: a.children }) : a.children
|
|
66
66
|
] });
|
|
67
67
|
};
|
|
68
68
|
l.displayName = "HelperText";
|
|
69
|
-
const
|
|
69
|
+
const H = c(l);
|
|
70
70
|
export {
|
|
71
|
-
|
|
71
|
+
H as default
|
|
72
72
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as u } from "./jsx-runtime-CqQglQKg.js";
|
|
2
2
|
import { c as m } from "./cn-B6yFEsav.js";
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
5
|
-
import { useDragScroll as
|
|
6
|
-
import {
|
|
7
|
-
|
|
3
|
+
import { c as H } from "./index-BOQuZ0gG.js";
|
|
4
|
+
import X, { useSyncExternalStore as it, useId as st, useRef as f, useState as O, useLayoutEffect as V, useEffect as S } from "react";
|
|
5
|
+
import { useDragScroll as ct } from "./useDragScroll.es.js";
|
|
6
|
+
import { u as dt } from "./FormFieldContext-H8_osEEP.js";
|
|
7
|
+
import { PlainTooltip as ut } from "./PlainTooltip.es.js";
|
|
8
|
+
const Ie = "(prefers-reduced-motion: reduce)", ft = () => !1, mt = () => typeof window > "u" ? !1 : window.matchMedia(Ie).matches, pt = (a) => {
|
|
8
9
|
if (typeof window > "u") return () => {
|
|
9
10
|
};
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
},
|
|
11
|
+
const o = window.matchMedia(Ie);
|
|
12
|
+
return o.addEventListener("change", a), () => o.removeEventListener("change", a);
|
|
13
|
+
}, bt = () => it(pt, mt, ft), gt = (a, o, v) => v ? { commit: null, pending: o } : a && a.left === o.left && a.right === o.right ? { commit: null, pending: null } : { commit: o, pending: null }, ht = {
|
|
13
14
|
default: "brand",
|
|
14
15
|
danger: "error"
|
|
15
16
|
}, n = {
|
|
@@ -68,29 +69,29 @@ const Te = "(prefers-reduced-motion: reduce)", lt = () => !1, at = () => typeof
|
|
|
68
69
|
option: "px-3 py-1 min-h-7 pyrion-fonts-body-small"
|
|
69
70
|
},
|
|
70
71
|
medium: {
|
|
71
|
-
container: "py-[3px] px-[3px]",
|
|
72
|
+
container: "py-[3px] px-[3px] radius-large",
|
|
72
73
|
pill: "py-2 min-h-[34px] radius-medium",
|
|
73
74
|
option: "px-3 py-2 min-h-[34px] pyrion-fonts-body-medium"
|
|
74
75
|
},
|
|
75
76
|
large: {
|
|
76
|
-
container: "py-[3px] px-[3px]",
|
|
77
|
+
container: "py-[3px] px-[3px] radius-large",
|
|
77
78
|
pill: "py-2.5 radius-medium",
|
|
78
79
|
option: "px-4 py-2 min-h-10 pyrion-fonts-body-medium"
|
|
79
80
|
}
|
|
80
|
-
}, D = 20,
|
|
81
|
+
}, D = 20, we = 4, ve = 8, xt = { small: 280, medium: 320, large: 360 }, yt = 300, N = "cubic-bezier(0.2,0,0,1)", wt = "cubic-bezier(0.34,1.4,0.64,1)", vt = "cubic-bezier(0.3,0,0.2,1)", Te = {
|
|
81
82
|
natural: "auto-cols-[minmax(0,max-content)]",
|
|
82
83
|
equal: "auto-cols-[minmax(0,1fr)]"
|
|
83
|
-
},
|
|
84
|
+
}, Tt = "[transition:var(--sb-motion)] motion-reduce:transition-none", Rt = "[transition:var(--sb-motion-text)] motion-reduce:transition-none", It = "[transition:var(--sb-motion-weight)] motion-reduce:transition-none", Nt = "[transition:var(--sb-motion-slot)] motion-reduce:transition-none", Re = (a, o, v) => Math.min(v, Math.max(o, a)), Et = (a, o) => typeof a == "function" ? X.createElement(a, {
|
|
84
85
|
size: D,
|
|
85
|
-
className: m(
|
|
86
|
-
}) :
|
|
86
|
+
className: m(o, "shrink-0!")
|
|
87
|
+
}) : X.cloneElement(
|
|
87
88
|
a,
|
|
88
89
|
{
|
|
89
90
|
size: D,
|
|
90
|
-
className: m(
|
|
91
|
+
className: m(o, "shrink-0!")
|
|
91
92
|
}
|
|
92
|
-
),
|
|
93
|
-
"relative border inline-flex bg-neutral-default-default border-neutral-default-default
|
|
93
|
+
), Ct = H(
|
|
94
|
+
"relative border inline-flex bg-neutral-default-default border-neutral-default-default shadow-[var(--dropshadow-inset-100)]",
|
|
94
95
|
{
|
|
95
96
|
variants: {
|
|
96
97
|
size: {
|
|
@@ -120,7 +121,7 @@ const Te = "(prefers-reduced-motion: reduce)", lt = () => !1, at = () => typeof
|
|
|
120
121
|
color: "brand"
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
|
-
),
|
|
124
|
+
), Mt = H(
|
|
124
125
|
"absolute top-0 bottom-0 z-10",
|
|
125
126
|
{
|
|
126
127
|
variants: {
|
|
@@ -151,7 +152,7 @@ const Te = "(prefers-reduced-motion: reduce)", lt = () => !1, at = () => typeof
|
|
|
151
152
|
color: "brand"
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
|
-
),
|
|
155
|
+
), Bt = H("relative flex items-center justify-center", {
|
|
155
156
|
variants: {
|
|
156
157
|
size: {
|
|
157
158
|
small: h.small.option,
|
|
@@ -179,217 +180,222 @@ const Te = "(prefers-reduced-motion: reduce)", lt = () => !1, at = () => typeof
|
|
|
179
180
|
size: "medium",
|
|
180
181
|
color: "brand"
|
|
181
182
|
}
|
|
182
|
-
}),
|
|
183
|
+
}), kt = (a) => {
|
|
183
184
|
const {
|
|
184
|
-
size:
|
|
185
|
-
color:
|
|
185
|
+
size: o = "medium",
|
|
186
|
+
color: v = "default",
|
|
186
187
|
options: E,
|
|
187
|
-
value:
|
|
188
|
-
name:
|
|
189
|
-
ariaLabel:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
value: Ne,
|
|
189
|
+
name: Q,
|
|
190
|
+
ariaLabel: Ee,
|
|
191
|
+
ariaLabelledBy: Ce,
|
|
192
|
+
ariaDescribedBy: Me,
|
|
193
|
+
onChange: Be,
|
|
194
|
+
icon: F,
|
|
195
|
+
allowExpand: Y,
|
|
196
|
+
equalWidth: Le,
|
|
194
197
|
overflow: C = "truncate",
|
|
195
|
-
collapseAt:
|
|
196
|
-
disableAnimation:
|
|
197
|
-
animationDuration:
|
|
198
|
-
animationIntensity:
|
|
199
|
-
disabled:
|
|
200
|
-
className:
|
|
201
|
-
pillClassName:
|
|
202
|
-
iconClassName:
|
|
203
|
-
optionClassName:
|
|
204
|
-
optionIconClassName:
|
|
205
|
-
} = a,
|
|
206
|
-
|
|
198
|
+
collapseAt: Oe,
|
|
199
|
+
disableAnimation: Se = !1,
|
|
200
|
+
animationDuration: ze,
|
|
201
|
+
animationIntensity: $e,
|
|
202
|
+
disabled: z = !1,
|
|
203
|
+
className: _e,
|
|
204
|
+
pillClassName: je,
|
|
205
|
+
iconClassName: ke,
|
|
206
|
+
optionClassName: Ae,
|
|
207
|
+
optionIconClassName: Ve
|
|
208
|
+
} = a, De = `segmented-${st()}`, P = dt(), Z = Ce ?? P?.labelledBy, Fe = Me ?? P?.describedBy, Pe = P?.required || void 0, J = f(null), ee = f(null), te = f(null), ne = f(null), $ = f([]), [q, qe] = O(null), re = f(null), T = f(!1), M = f(null), U = f(!1), [b, Ue] = O(!1), [oe, We] = O(null), [W, le] = O(!1), [K, ae] = O(!1), ie = f(0), B = f(null), Ke = bt(), s = Se || Ke, c = s ? 0 : Re(ze ?? yt, 0, 2e3), R = s ? 0 : Re($e ?? 1, 0, 2), se = Le ?? (Y === !0 ? !1 : Y === !1 ? !0 : void 0), y = se === "fill", _ = se === !0, I = C === "scroll" && !y, L = C === "collapse", Ge = C === "truncate" || C === "scroll" && y, ce = E.every((e) => !!(e.icon ?? F)), Xe = Oe ?? xt[o], G = L && ce && oe !== null && oe < Xe, w = z ? "disabled" : ht[v] ?? v, l = Math.max(E.findIndex((e) => e.value === Ne), 0), He = y ? "w-full" : "w-max max-w-full", Qe = I ? "overflow-x-auto overscroll-x-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" : "", Ye = I && !_ ? "auto-cols-max" : y || _ ? Te.equal : Te.natural, Ze = s ? "none" : `color ${c}ms ${N}`, Je = s ? "none" : `font-weight ${c}ms ${N}`, et = s ? "none" : `width ${c}ms ${N}, opacity ${c}ms ${N}`, de = K ? Math.round(c * 0.4) : c, tt = s ? "none" : `left ${de}ms ${N}, right ${de}ms ${N}, transform ${Math.round(W ? c * 0.4 : c * 0.9)}ms ${W ? vt : wt}`, nt = ie.current * 10 * R, rt = W && R > 0 ? `translateX(${nt}px) scaleX(${1 + 0.05 * R}) scaleY(${1 - 0.05 * R})` : void 0, ue = (e) => {
|
|
209
|
+
re.current = e, qe(
|
|
207
210
|
(t) => t && t.left === e.left && t.right === e.right ? t : e
|
|
208
211
|
);
|
|
209
|
-
},
|
|
212
|
+
}, fe = () => {
|
|
210
213
|
if (!T.current) return;
|
|
211
214
|
T.current = !1;
|
|
212
215
|
const e = M.current;
|
|
213
|
-
M.current = null, e && (
|
|
216
|
+
M.current = null, e && (ae(!0), ue(e));
|
|
214
217
|
};
|
|
215
218
|
V(() => {
|
|
216
|
-
const e =
|
|
219
|
+
const e = te.current;
|
|
217
220
|
if (!L || !e) return;
|
|
218
221
|
const t = () => {
|
|
219
|
-
const
|
|
220
|
-
|
|
222
|
+
const i = e.getBoundingClientRect().width;
|
|
223
|
+
We((p) => p === i ? p : i);
|
|
221
224
|
};
|
|
222
225
|
t();
|
|
223
|
-
const
|
|
224
|
-
return
|
|
226
|
+
const r = new ResizeObserver(t);
|
|
227
|
+
return r.observe(e), () => r.disconnect();
|
|
225
228
|
}, [L]), V(() => {
|
|
226
|
-
if (
|
|
227
|
-
|
|
229
|
+
if (B.current === null) {
|
|
230
|
+
B.current = l;
|
|
228
231
|
return;
|
|
229
232
|
}
|
|
230
|
-
|
|
231
|
-
}, [l,
|
|
232
|
-
const
|
|
233
|
+
B.current !== l && (ie.current = l > B.current ? 1 : -1, B.current = l, M.current = null, T.current = !1, U.current = !s);
|
|
234
|
+
}, [l, s]);
|
|
235
|
+
const me = f(null), { bind: ot, ref: lt } = ct({
|
|
233
236
|
axis: "x",
|
|
234
237
|
cursor: { idle: "default", dragging: "grabbing" },
|
|
235
238
|
disabled: !I
|
|
236
|
-
}),
|
|
239
|
+
}), pe = (e, t) => e.icon ?? (t ? F : void 0) ? D + (e.label != null && !G ? we : 0) : 0;
|
|
237
240
|
V(() => {
|
|
238
|
-
const e =
|
|
241
|
+
const e = ee.current, t = $.current[l];
|
|
239
242
|
if (!e || !t) return;
|
|
240
|
-
const
|
|
241
|
-
(
|
|
242
|
-
) : null, p = (
|
|
243
|
+
const r = me.current, i = !y && !_ && r !== null && r !== l ? E.map(
|
|
244
|
+
(d, x) => pe(d, x === l) - pe(d, x === r)
|
|
245
|
+
) : null, p = (d = !1) => {
|
|
243
246
|
const x = e.getBoundingClientRect(), j = t.getBoundingClientRect();
|
|
244
247
|
let k = {
|
|
245
248
|
left: j.left - x.left,
|
|
246
249
|
right: x.right - j.right
|
|
247
250
|
};
|
|
248
|
-
if (
|
|
249
|
-
let
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}), k = { left: k.left +
|
|
251
|
+
if (d && i) {
|
|
252
|
+
let ge = 0, he = 0;
|
|
253
|
+
i.forEach((xe, ye) => {
|
|
254
|
+
ye < l ? ge += xe : ye > l && (he += xe);
|
|
255
|
+
}), k = { left: k.left + ge, right: k.right + he };
|
|
253
256
|
}
|
|
254
|
-
const A =
|
|
255
|
-
|
|
257
|
+
const A = gt(
|
|
258
|
+
re.current,
|
|
256
259
|
k,
|
|
257
260
|
T.current
|
|
258
261
|
);
|
|
259
|
-
A.pending && (M.current = A.pending), A.commit &&
|
|
262
|
+
A.pending && (M.current = A.pending), A.commit && ue(A.commit);
|
|
260
263
|
};
|
|
261
|
-
p(!0),
|
|
264
|
+
p(!0), me.current = l;
|
|
262
265
|
const g = new ResizeObserver(() => p());
|
|
263
|
-
return g.observe(e),
|
|
264
|
-
|
|
266
|
+
return g.observe(e), $.current.forEach((d) => {
|
|
267
|
+
d && g.observe(d);
|
|
265
268
|
}), () => g.disconnect();
|
|
266
269
|
}, [
|
|
267
270
|
l,
|
|
268
271
|
E.length,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
+
o,
|
|
273
|
+
y,
|
|
274
|
+
_,
|
|
272
275
|
C,
|
|
273
|
-
|
|
276
|
+
G
|
|
274
277
|
]), V(() => {
|
|
275
|
-
|
|
276
|
-
}, [l,
|
|
277
|
-
|
|
278
|
-
}, [
|
|
279
|
-
if (!
|
|
278
|
+
U.current && (U.current = !1, T.current = !0);
|
|
279
|
+
}, [l, s]), S(() => {
|
|
280
|
+
q && !b && Ue(!0);
|
|
281
|
+
}, [q, b]), S(() => {
|
|
282
|
+
if (!K) return;
|
|
280
283
|
const e = window.setTimeout(
|
|
281
|
-
() =>
|
|
284
|
+
() => ae(!1),
|
|
282
285
|
Math.max(80, Math.round(c * 0.4))
|
|
283
286
|
);
|
|
284
287
|
return () => window.clearTimeout(e);
|
|
285
|
-
}, [
|
|
286
|
-
const e =
|
|
288
|
+
}, [K, c]), S(() => {
|
|
289
|
+
const e = ne.current;
|
|
287
290
|
if (!e) return;
|
|
288
|
-
const t = (
|
|
289
|
-
|
|
291
|
+
const t = (r) => {
|
|
292
|
+
r.propertyName !== "left" && r.propertyName !== "right" || fe();
|
|
290
293
|
};
|
|
291
294
|
return e.addEventListener("transitionend", t), () => e.removeEventListener("transitionend", t);
|
|
292
|
-
}),
|
|
293
|
-
if (
|
|
295
|
+
}), S(() => {
|
|
296
|
+
if (s || !T.current) return;
|
|
294
297
|
let e, t;
|
|
295
|
-
return R > 0 && (
|
|
296
|
-
() =>
|
|
298
|
+
return R > 0 && (le(!0), e = window.setTimeout(
|
|
299
|
+
() => le(!1),
|
|
297
300
|
Math.max(80, Math.round(c * 0.45))
|
|
298
|
-
)), t = window.setTimeout(
|
|
301
|
+
)), t = window.setTimeout(fe, c + 80), () => {
|
|
299
302
|
e !== void 0 && window.clearTimeout(e), t !== void 0 && window.clearTimeout(t), M.current = null;
|
|
300
303
|
};
|
|
301
|
-
}, [l,
|
|
304
|
+
}, [l, s, c, R]), S(() => {
|
|
302
305
|
if (!I) return;
|
|
303
|
-
const e =
|
|
306
|
+
const e = J.current, t = $.current[l];
|
|
304
307
|
if (!e || !t) return;
|
|
305
|
-
const
|
|
306
|
-
g > 0 ? e.scrollBy({ left: g, behavior: p }) :
|
|
307
|
-
}, [I, l, b,
|
|
308
|
-
const
|
|
309
|
-
"--sb-motion": b ?
|
|
310
|
-
"--sb-motion-text": b ?
|
|
311
|
-
"--sb-motion-weight": b ?
|
|
312
|
-
"--sb-motion-slot": b ?
|
|
313
|
-
},
|
|
308
|
+
const r = e.getBoundingClientRect(), i = t.getBoundingClientRect(), p = b && !s ? "smooth" : "auto", g = i.right - r.right + ve, d = r.left - i.left + ve;
|
|
309
|
+
g > 0 ? e.scrollBy({ left: g, behavior: p }) : d > 0 && e.scrollBy({ left: -d, behavior: p });
|
|
310
|
+
}, [I, l, b, s]);
|
|
311
|
+
const at = {
|
|
312
|
+
"--sb-motion": b ? tt : "none",
|
|
313
|
+
"--sb-motion-text": b ? Ze : "none",
|
|
314
|
+
"--sb-motion-weight": b ? Je : "none",
|
|
315
|
+
"--sb-motion-slot": b ? et : "none"
|
|
316
|
+
}, be = /* @__PURE__ */ u.jsx(
|
|
314
317
|
"div",
|
|
315
318
|
{
|
|
316
319
|
ref: (e) => {
|
|
317
|
-
|
|
320
|
+
J.current = e, lt.current = e;
|
|
318
321
|
},
|
|
319
322
|
role: "radiogroup",
|
|
320
|
-
"aria-
|
|
321
|
-
"aria-
|
|
323
|
+
"aria-labelledby": Z,
|
|
324
|
+
"aria-label": Z ? void 0 : Ee ?? Q,
|
|
325
|
+
"aria-describedby": Fe,
|
|
326
|
+
"aria-required": Pe,
|
|
327
|
+
"aria-disabled": z || void 0,
|
|
322
328
|
className: m(
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
329
|
+
Ct({ size: o, color: w }),
|
|
330
|
+
He,
|
|
331
|
+
Qe,
|
|
332
|
+
_e
|
|
327
333
|
),
|
|
328
|
-
style:
|
|
329
|
-
...
|
|
330
|
-
children: /* @__PURE__ */
|
|
334
|
+
style: at,
|
|
335
|
+
...ot,
|
|
336
|
+
children: /* @__PURE__ */ u.jsxs(
|
|
331
337
|
"div",
|
|
332
338
|
{
|
|
333
|
-
ref:
|
|
339
|
+
ref: ee,
|
|
334
340
|
className: m(
|
|
335
341
|
"relative grid grid-flow-col items-stretch",
|
|
336
|
-
|
|
337
|
-
|
|
342
|
+
Ye,
|
|
343
|
+
y && "w-full",
|
|
338
344
|
I && "w-max"
|
|
339
345
|
),
|
|
340
346
|
children: [
|
|
341
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ u.jsx(
|
|
342
348
|
"div",
|
|
343
349
|
{
|
|
344
|
-
ref:
|
|
350
|
+
ref: ne,
|
|
345
351
|
"aria-hidden": !0,
|
|
346
352
|
className: m(
|
|
347
|
-
|
|
353
|
+
Mt({ size: o, color: w }),
|
|
348
354
|
"pointer-events-none",
|
|
349
|
-
b &&
|
|
350
|
-
|
|
355
|
+
b && Tt,
|
|
356
|
+
je
|
|
351
357
|
),
|
|
352
358
|
style: {
|
|
353
|
-
...
|
|
354
|
-
transform:
|
|
359
|
+
...q ?? {},
|
|
360
|
+
transform: rt
|
|
355
361
|
}
|
|
356
362
|
}
|
|
357
363
|
),
|
|
358
364
|
E.map((e, t) => {
|
|
359
|
-
const
|
|
365
|
+
const r = t === l, i = e.icon ?? (r ? F : void 0), p = e.label != null && !G, g = Ge || L && !ce ? "truncate" : "text-nowrap", d = r ? m(n[w].icon, ke) : m(n[w].optionIcon, Ve), x = /* @__PURE__ */ u.jsxs(
|
|
360
366
|
"label",
|
|
361
367
|
{
|
|
362
368
|
ref: (j) => {
|
|
363
|
-
|
|
369
|
+
$.current[t] = j;
|
|
364
370
|
},
|
|
365
371
|
title: e.tooltipText ? void 0 : e.label ?? e.ariaLabel,
|
|
366
372
|
className: m(
|
|
367
|
-
|
|
373
|
+
Bt({ size: o, color: w }),
|
|
368
374
|
"relative z-20 min-w-0 select-none",
|
|
369
|
-
|
|
370
|
-
|
|
375
|
+
Rt,
|
|
376
|
+
r ? n[w].pillText : n[w].option,
|
|
371
377
|
"has-[input:focus-visible]:outline-2 has-[input:focus-visible]:-outline-offset-2 has-[input:focus-visible]:outline-[color:var(--border-brand-onneutral-default)]",
|
|
372
|
-
|
|
378
|
+
Ae
|
|
373
379
|
),
|
|
374
380
|
children: [
|
|
375
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ u.jsx(
|
|
376
382
|
"span",
|
|
377
383
|
{
|
|
378
|
-
"aria-hidden": !
|
|
379
|
-
className: m("flex items-center overflow-hidden shrink-0",
|
|
384
|
+
"aria-hidden": !i,
|
|
385
|
+
className: m("flex items-center overflow-hidden shrink-0", Nt),
|
|
380
386
|
style: {
|
|
381
|
-
width:
|
|
382
|
-
opacity:
|
|
387
|
+
width: i ? D + (p ? we : 0) : 0,
|
|
388
|
+
opacity: i ? 1 : 0
|
|
383
389
|
},
|
|
384
|
-
children:
|
|
390
|
+
children: i ? Et(i, d) : null
|
|
385
391
|
}
|
|
386
392
|
),
|
|
387
|
-
p && /* @__PURE__ */
|
|
393
|
+
p && /* @__PURE__ */ u.jsxs(
|
|
388
394
|
"span",
|
|
389
395
|
{
|
|
390
396
|
className: "grid grid-cols-[minmax(0,1fr)] min-w-0",
|
|
391
397
|
children: [
|
|
392
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ u.jsx(
|
|
393
399
|
"span",
|
|
394
400
|
{
|
|
395
401
|
"aria-hidden": !0,
|
|
@@ -400,7 +406,7 @@ const Te = "(prefers-reduced-motion: reduce)", lt = () => !1, at = () => typeof
|
|
|
400
406
|
children: e.label
|
|
401
407
|
}
|
|
402
408
|
),
|
|
403
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ u.jsx(
|
|
404
410
|
"span",
|
|
405
411
|
{
|
|
406
412
|
className: m(
|
|
@@ -409,8 +415,8 @@ const Te = "(prefers-reduced-motion: reduce)", lt = () => !1, at = () => typeof
|
|
|
409
415
|
// `text-center` keeps the shorter regular weight centered
|
|
410
416
|
// inside the semibold reserve.
|
|
411
417
|
"col-start-1 row-start-1 min-w-0 text-center",
|
|
412
|
-
|
|
413
|
-
|
|
418
|
+
It,
|
|
419
|
+
r ? "font-semibold" : "font-normal",
|
|
414
420
|
g
|
|
415
421
|
),
|
|
416
422
|
children: e.label
|
|
@@ -419,35 +425,35 @@ const Te = "(prefers-reduced-motion: reduce)", lt = () => !1, at = () => typeof
|
|
|
419
425
|
]
|
|
420
426
|
}
|
|
421
427
|
),
|
|
422
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ u.jsx(
|
|
423
429
|
"input",
|
|
424
430
|
{
|
|
425
431
|
type: "radio",
|
|
426
|
-
name:
|
|
432
|
+
name: De,
|
|
427
433
|
value: String(e.value),
|
|
428
|
-
checked:
|
|
429
|
-
disabled:
|
|
430
|
-
onChange: () =>
|
|
434
|
+
checked: r,
|
|
435
|
+
disabled: z,
|
|
436
|
+
onChange: () => Be?.(Q, e.value),
|
|
431
437
|
"aria-label": e.ariaLabel ?? e.label,
|
|
432
438
|
className: m(
|
|
433
439
|
"absolute inset-0 z-30 m-0 h-full w-full opacity-0",
|
|
434
|
-
|
|
440
|
+
z ? "cursor-default" : "cursor-pointer"
|
|
435
441
|
)
|
|
436
442
|
}
|
|
437
443
|
)
|
|
438
444
|
]
|
|
439
445
|
}
|
|
440
446
|
);
|
|
441
|
-
return e.tooltipText ? /* @__PURE__ */
|
|
447
|
+
return e.tooltipText ? /* @__PURE__ */ u.jsx(ut, { title: e.tooltipText, asChild: !0, children: x }, e.value) : /* @__PURE__ */ u.jsx(X.Fragment, { children: x }, e.value);
|
|
442
448
|
})
|
|
443
449
|
]
|
|
444
450
|
}
|
|
445
451
|
)
|
|
446
452
|
}
|
|
447
453
|
);
|
|
448
|
-
return L ? /* @__PURE__ */
|
|
454
|
+
return L ? /* @__PURE__ */ u.jsx("div", { ref: te, className: "w-full min-w-0", children: be }) : be;
|
|
449
455
|
};
|
|
450
456
|
export {
|
|
451
|
-
|
|
452
|
-
|
|
457
|
+
kt as SegmentedButton,
|
|
458
|
+
kt as default
|
|
453
459
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FormFieldState } from './types';
|
|
2
|
+
export interface FormFieldContextValue {
|
|
3
|
+
/** id of the visible label node — use with aria-labelledby */
|
|
4
|
+
labelId: string | undefined;
|
|
5
|
+
/** id of the supporting-text / HelperComponent node — use with aria-describedby */
|
|
6
|
+
helperId: string | undefined;
|
|
7
|
+
/** Convenience: labelId when a label is rendered */
|
|
8
|
+
labelledBy: string | undefined;
|
|
9
|
+
/** Convenience: helperId when supporting text is shown */
|
|
10
|
+
describedBy: string | undefined;
|
|
11
|
+
/** id for a native control (htmlFor / control id) */
|
|
12
|
+
controlId: string;
|
|
13
|
+
state: FormFieldState;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
required: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const FormFieldContext: import('react').Context<FormFieldContextValue | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Optional FormField context. Returns `null` outside a FormField.
|
|
20
|
+
* Controls (e.g. SegmentedButton) should fall back to their own a11y props.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useFormField(): FormFieldContextValue | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type FormFieldState = "default" | "error" | "success" | "warning";
|
|
3
|
+
export interface FormFieldProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
supportingText?: ReactNode | (() => ReactNode);
|
|
6
|
+
/**
|
|
7
|
+
* When true, reserves space and renders HelperComponent.
|
|
8
|
+
* Defaults to true when `supportingText` is provided.
|
|
9
|
+
*/
|
|
10
|
+
showSupportingText?: boolean;
|
|
11
|
+
/** Validation / feedback state for label + helper. Independent of child visual variants. */
|
|
12
|
+
state?: FormFieldState;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Associates the label with a native control via `htmlFor`.
|
|
17
|
+
* If omitted, a stable id is generated and exposed on context as `controlId`
|
|
18
|
+
* (for inputs that opt in). Radiogroups should use `labelledBy` instead.
|
|
19
|
+
*/
|
|
20
|
+
htmlFor?: string;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
@@ -20,8 +20,17 @@ export interface SegmentedButtonProps {
|
|
|
20
20
|
/**
|
|
21
21
|
* Accessible name for the radio group. Falls back to `name`.
|
|
22
22
|
* Prefer a human-readable label — `name` is often a form key like `"n"`.
|
|
23
|
+
* Ignored when `ariaLabelledBy` (or FormField context `labelledBy`) is set.
|
|
23
24
|
*/
|
|
24
25
|
ariaLabel?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Overrides FormField context `labelledBy`. When set, `aria-label` is omitted.
|
|
28
|
+
*/
|
|
29
|
+
ariaLabelledBy?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Overrides FormField context `describedBy` (supporting text).
|
|
32
|
+
*/
|
|
33
|
+
ariaDescribedBy?: string;
|
|
25
34
|
size?: "small" | "medium" | "large";
|
|
26
35
|
/**
|
|
27
36
|
* Visual color variant.
|
|
@@ -2,6 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { ComponentVariant } from './types';
|
|
3
3
|
export interface HelperTextProps {
|
|
4
4
|
ref?: React.RefObject<HTMLDivElement | null>;
|
|
5
|
+
id?: string;
|
|
5
6
|
children: React.ReactNode | string;
|
|
6
7
|
variant: ComponentVariant;
|
|
7
8
|
className?: string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default } from '../components/FormField/FormField';
|
|
2
|
+
export { default as FormField } from '../components/FormField/FormField';
|
|
3
|
+
export type { FormFieldProps, FormFieldState } from '../components/FormField/types';
|
|
4
|
+
export { useFormField, FormFieldContext, type FormFieldContextValue, } from '../components/FormField/FormFieldContext';
|
package/dist/index.d.ts
CHANGED
|
@@ -92,6 +92,8 @@ export { default as Popover } from './exports/Popover';
|
|
|
92
92
|
export { default as Skeleton } from './exports/Skeleton';
|
|
93
93
|
export { resolveSkeletonTextLength } from './exports/Skeleton';
|
|
94
94
|
export { default as SegmentedButton } from './exports/SegmentedButton';
|
|
95
|
+
export { default as FormField } from './exports/FormField';
|
|
96
|
+
export { useFormField } from './exports/FormField';
|
|
95
97
|
export { default as ImageGallery } from './exports/ImageGallery';
|
|
96
98
|
export { default as Image } from './exports/Image';
|
|
97
99
|
export { default as Toast } from './exports/Toast';
|
|
@@ -184,6 +186,7 @@ export type { ToggleProps } from './exports/Toggle';
|
|
|
184
186
|
export type { SwitchProps } from './exports/Toggle';
|
|
185
187
|
export type { SkeletonProps, SkeletonTextLength } from './exports/Skeleton';
|
|
186
188
|
export type { SegmentedButtonProps, SegmentedButtonOption, SegmentedButtonColor } from './exports/SegmentedButton';
|
|
189
|
+
export type { FormFieldProps, FormFieldState, FormFieldContextValue, } from './exports/FormField';
|
|
187
190
|
export type { DatePickerProps } from './exports/DatePicker';
|
|
188
191
|
export type { DatePickerPillProps } from './exports/DatePickerPill';
|
|
189
192
|
export type { CalendarChangeResult, CalendarDateInput, CalendarEvent, CalendarEventChange, CalendarEventColor, CalendarEventColorValue, CalendarEventRenderContext, CalendarProps, CalendarRange, CalendarRangeSelection, CalendarSnapMinutes, CalendarView, ResolvedCalendarEvent, } from './exports/Calendar';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { u as Le, a as Ie, b as Ne, c as De } from "./useDrawerControl-B3mYMhai.js";
|
|
2
2
|
import q from "./HelperComponent.es.js";
|
|
3
|
-
import { DEFAULT_PAGE_SIZE_OPTIONS as Ve, DEFAULT_ROW_INTERACTION as Re, HeadRow as Oe, HeaderCell as Pe, RowCell as ke, Table as Me, TableBody as _e, LegacyTableBody as je, LegacyTableCaption as Be, LegacyTableCell as
|
|
3
|
+
import { DEFAULT_PAGE_SIZE_OPTIONS as Ve, DEFAULT_ROW_INTERACTION as Re, HeadRow as Oe, HeaderCell as Pe, RowCell as ke, Table as Me, TableBody as _e, LegacyTableBody as je, LegacyTableCaption as Be, LegacyTableCell as Fe, TableFooter as He, LegacyTableFooter as Ee, LegacyTableHead as ze, TableHeader as Ue, LegacyTableHeader as Ge, LegacyTable as We, TableRow as Ze, LegacyTableRow as $e } from "./Table.es.js";
|
|
4
4
|
import { Tab as qe, TabLinkItem as Je, TabLinks as Ke, default as Xe } from "./Tabs.es.js";
|
|
5
5
|
import { j as o } from "./jsx-runtime-CqQglQKg.js";
|
|
6
6
|
import { g as A } from "./utils-X4-h3cum.js";
|
|
@@ -27,71 +27,73 @@ import { CodeInput as Vt, CodeInput as Rt } from "./CodeInput.es.js";
|
|
|
27
27
|
import { default as Pt } from "./ColorPicker.es.js";
|
|
28
28
|
import { D as Mt } from "./DatePicker-CoRJVBwy.js";
|
|
29
29
|
import { default as jt } from "./DatePickerPill.es.js";
|
|
30
|
-
import { D as
|
|
30
|
+
import { D as Ft, D as Ht, u as Et, a as zt } from "./useModalControl-BAUI_Hwx.js";
|
|
31
31
|
import { Dialog as Gt, useDialogControl as Wt, useDialogState as Zt } from "./Dialog.es.js";
|
|
32
32
|
import { default as Qt } from "./Divider.es.js";
|
|
33
33
|
import { default as Jt, default as Kt } from "./Drawer.es.js";
|
|
34
34
|
import { D as Yt } from "./DrawerMobile-D4m9ndx0.js";
|
|
35
35
|
import { default as tr } from "./FAButton.es.js";
|
|
36
|
-
import {
|
|
37
|
-
import { default as nr } from "./
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import { default as cr } from "./
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import { default as br } from "./
|
|
44
|
-
import { default as vr } from "./
|
|
45
|
-
import { default as yr } from "./
|
|
46
|
-
import { default as Sr } from "./
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import { default as Gr } from "./
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import { default as Oa } from "./
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import { default as Za } from "./
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
|
|
36
|
+
import { FormField as ar } from "./FormField.es.js";
|
|
37
|
+
import { default as nr } from "./Header.es.js";
|
|
38
|
+
import { default as sr } from "./Image.es.js";
|
|
39
|
+
import { I as ur } from "./ImageGallery-COXs6hwn.js";
|
|
40
|
+
import { default as cr } from "./Input.es.js";
|
|
41
|
+
import { default as mr } from "./InputLegacy.es.js";
|
|
42
|
+
import { InputMultiple as hr } from "./InputMultiple.es.js";
|
|
43
|
+
import { default as br } from "./InputPassword.es.js";
|
|
44
|
+
import { default as vr } from "./InputSearch.es.js";
|
|
45
|
+
import { default as yr } from "./Link.es.js";
|
|
46
|
+
import { default as Sr } from "./ListItem.es.js";
|
|
47
|
+
import { default as Lr } from "./Logo.es.js";
|
|
48
|
+
import { Menu as Nr, useMenuControl as Dr, useMenuState as Ar } from "./Menu.es.js";
|
|
49
|
+
import { MenuList as Rr } from "./MenuList.es.js";
|
|
50
|
+
import { default as Pr } from "./Modal.es.js";
|
|
51
|
+
import { ModuleItem as Mr } from "./ModuleItem.es.js";
|
|
52
|
+
import { NavigationRail as jr } from "./NavigationRail.es.js";
|
|
53
|
+
import { default as Fr } from "./Pagination.es.js";
|
|
54
|
+
import { PlainTooltip as Er, PlainTooltip as zr } from "./PlainTooltip.es.js";
|
|
55
|
+
import { default as Gr } from "./Popover.es.js";
|
|
56
|
+
import { default as Zr } from "./PriorityChip.es.js";
|
|
57
|
+
import { DEFAULT_WARNING_THRESHOLD as Qr, ProgressBar as qr, useDateProgress as Jr, useQuantityProgress as Kr } from "./ProgressBar.es.js";
|
|
58
|
+
import { RecurrentDatePicker as Yr } from "./RecurrentDatePicker.es.js";
|
|
59
|
+
import { DEFAULT_PREVIEW_COUNT as ta, RecurrentDatePickerRRule as ra } from "./RecurrentDatePickerRRule.es.js";
|
|
60
|
+
import { SearchBar as oa } from "./SearchBar.es.js";
|
|
61
|
+
import { SegmentedButton as la } from "./SegmentedButton.es.js";
|
|
62
|
+
import { default as ia } from "./SelectSearch.es.js";
|
|
63
|
+
import { Sidebar as da } from "./Sidebar.es.js";
|
|
64
|
+
import { SidebarItem as fa } from "./SidebarItem.es.js";
|
|
65
|
+
import { default as pa } from "./Spinner.es.js";
|
|
66
|
+
import { S as xa } from "./Star-DKhRZoa9.js";
|
|
67
|
+
import { Steps as ga } from "./Steps.es.js";
|
|
68
|
+
import { Subtitle as Ca } from "./Subtitle.es.js";
|
|
69
|
+
import { T as wa } from "./usePyrionLayout-N9l4oGVr.js";
|
|
70
|
+
import { TertiaryLevelSidebar as Ta } from "./TertiaryLevelSidebar.es.js";
|
|
71
|
+
import { TextArea as Ia, TextArea as Na } from "./TextArea.es.js";
|
|
72
|
+
import { Title as Aa } from "./Title.es.js";
|
|
73
|
+
import { default as Ra, toastpyrion as Oa } from "./Toast.es.js";
|
|
74
|
+
import { default as ka } from "./ToastProvider.es.js";
|
|
75
|
+
import { UserSidebarItem as _a } from "./UserSidebarItem.es.js";
|
|
76
|
+
import { AttachInput as Ba } from "./AttachInput.es.js";
|
|
77
|
+
import { A as Ha } from "./AvatarBase-BM6Doe0z.js";
|
|
78
|
+
import { default as za } from "./Button.es.js";
|
|
79
|
+
import { CardProfile as Ga } from "./CardProfile.es.js";
|
|
80
|
+
import { default as Za } from "./Check.es.js";
|
|
81
|
+
import { default as Qa } from "./CheckBox.es.js";
|
|
82
|
+
import { Collapsible as Ja } from "./Collapsible.es.js";
|
|
83
|
+
import { DATAVIZ as Xa } from "./Dataviz.es.js";
|
|
84
|
+
import { default as eo } from "./IconButton.es.js";
|
|
85
|
+
import { ProfilePictureUpload as ro } from "./ProfilePictureUpload.es.js";
|
|
86
|
+
import { RadioButton as oo } from "./RadioButton.es.js";
|
|
87
|
+
import { S as lo } from "./Skeleton-C8OCBBLq.js";
|
|
88
|
+
import { SplitButton as io } from "./SplitButton.es.js";
|
|
89
|
+
import { StarRating as co } from "./StarRating.es.js";
|
|
90
|
+
import { Switch as mo, Switch as po } from "./Switch.es.js";
|
|
91
|
+
import { resolveSkeletonTextLength as xo } from "./Skeleton.es.js";
|
|
92
|
+
import { useDragScroll as go } from "./useDragScroll.es.js";
|
|
93
|
+
import { u as Co } from "./useDrawerCollapsed-CJOXf2Fw.js";
|
|
94
|
+
import { u as wo } from "./FormFieldContext-H8_osEEP.js";
|
|
95
|
+
import { useScrollable as To } from "./useScrollable.es.js";
|
|
96
|
+
const F = ({
|
|
95
97
|
secondaryActionsSlot: e,
|
|
96
98
|
primaryActionsSlot: r,
|
|
97
99
|
className: a
|
|
@@ -99,12 +101,12 @@ const H = ({
|
|
|
99
101
|
/* @__PURE__ */ o.jsx("div", { className: "flex items-center gap-1 flex-1", children: e }),
|
|
100
102
|
/* @__PURE__ */ o.jsx("div", { className: "flex items-center gap-1 min-h-full overflow-x-scroll prometeo-scrollbar-none max-w-full", children: r })
|
|
101
103
|
] });
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
+
F.displayName = "ActionInput.Footer";
|
|
105
|
+
const H = ({
|
|
104
106
|
children: e,
|
|
105
107
|
className: r
|
|
106
108
|
}) => /* @__PURE__ */ o.jsx("div", { className: h("shrink-0 p-3 pb-0 z-10 prometeo-scrollbar-thin-weak overflow-auto", r), children: e });
|
|
107
|
-
|
|
109
|
+
H.displayName = "ActionInput.AttachFields";
|
|
108
110
|
const ae = $(
|
|
109
111
|
"transition-all duration-300 ease-in-out border radius-large flex flex-col relative overflow-hidden relative *:z-10",
|
|
110
112
|
{
|
|
@@ -136,11 +138,11 @@ function ne(e) {
|
|
|
136
138
|
let n = null, i = null;
|
|
137
139
|
for (const l of a)
|
|
138
140
|
if (ee(l)) {
|
|
139
|
-
if (l.type ===
|
|
141
|
+
if (l.type === H && !n) {
|
|
140
142
|
n = l;
|
|
141
143
|
continue;
|
|
142
144
|
}
|
|
143
|
-
l.type ===
|
|
145
|
+
l.type === F && !i && (i = l);
|
|
144
146
|
}
|
|
145
147
|
return { attachFields: n, footer: i };
|
|
146
148
|
}
|
|
@@ -168,7 +170,7 @@ const Q = K(
|
|
|
168
170
|
cardBackground: S,
|
|
169
171
|
textArea: P,
|
|
170
172
|
...k
|
|
171
|
-
} = e, T = x !== void 0, [L,
|
|
173
|
+
} = e, T = x !== void 0, [L, E] = X(
|
|
172
174
|
() => y ?? ""
|
|
173
175
|
), z = T ? x : L, M = J.useRef(null), U = j(
|
|
174
176
|
(t) => {
|
|
@@ -187,7 +189,7 @@ const Q = K(
|
|
|
187
189
|
}
|
|
188
190
|
t.style.height = `${b}px`, b > s + 12 && (t.style.alignContent = "start");
|
|
189
191
|
}, [n, l, d, m]), I = (t) => {
|
|
190
|
-
T ||
|
|
192
|
+
T || E(t.target.value), f?.(t), v();
|
|
191
193
|
};
|
|
192
194
|
V(() => {
|
|
193
195
|
v();
|
|
@@ -244,8 +246,8 @@ const Q = K(
|
|
|
244
246
|
);
|
|
245
247
|
Q.displayName = "ActionInput";
|
|
246
248
|
const be = Object.assign(Q, {
|
|
247
|
-
Footer:
|
|
248
|
-
AttachFields:
|
|
249
|
+
Footer: F,
|
|
250
|
+
AttachFields: H
|
|
249
251
|
}), ge = (e) => {
|
|
250
252
|
const r = B(void 0), { asyncMode: a = "fetch_in_open" } = e, n = (t, p, s) => {
|
|
251
253
|
const C = {
|
|
@@ -307,7 +309,7 @@ const be = Object.assign(Q, {
|
|
|
307
309
|
return b && s.push(b), s;
|
|
308
310
|
}, []);
|
|
309
311
|
R(p);
|
|
310
|
-
}, { displayMode: k = e.multiple ? "chips" : "compact", dropdownOptions: T, overflow: L = "scroll", onChange:
|
|
312
|
+
}, { displayMode: k = e.multiple ? "chips" : "compact", dropdownOptions: T, overflow: L = "scroll", onChange: E, onClear: z, groupSelection: M, value: U, defaultValue: v, ...I } = e.selectComponentProps || {}, N = {
|
|
311
313
|
controledSearchValue: i,
|
|
312
314
|
onSearchValueChange: a === "fetch_on_type" ? l : void 0,
|
|
313
315
|
onSearchClear: a === "fetch_on_type" ? () => {
|
|
@@ -449,105 +451,106 @@ const be = Object.assign(Q, {
|
|
|
449
451
|
};
|
|
450
452
|
export {
|
|
451
453
|
be as ActionInput,
|
|
452
|
-
|
|
454
|
+
Ba as AttachInput,
|
|
453
455
|
ot as Avatar,
|
|
454
456
|
nt as AvatarAndSubavatar,
|
|
455
|
-
|
|
457
|
+
Ha as AvatarBase,
|
|
456
458
|
st as Badge,
|
|
457
459
|
ve as BadgeLegacy,
|
|
458
460
|
ut as BreadcrumbItem,
|
|
459
461
|
dt as Breadcrumbs,
|
|
460
|
-
|
|
462
|
+
za as Button,
|
|
461
463
|
ft as Calendar,
|
|
462
464
|
pt as Card,
|
|
463
465
|
ht as CardContent,
|
|
464
466
|
xt as CardFooter,
|
|
465
467
|
bt as CardHeader,
|
|
466
|
-
|
|
468
|
+
Ga as CardProfile,
|
|
467
469
|
vt as Chat,
|
|
468
470
|
Tt as ChatCard,
|
|
469
471
|
Ct as ChatViewport,
|
|
470
|
-
|
|
471
|
-
|
|
472
|
+
Za as Check,
|
|
473
|
+
Qa as CheckBox,
|
|
472
474
|
It as Chip,
|
|
473
475
|
Dt as ChipSelect,
|
|
474
476
|
Vt as CodeInput,
|
|
475
|
-
|
|
477
|
+
Ja as Collapsible,
|
|
476
478
|
Pt as ColorPicker,
|
|
477
|
-
|
|
479
|
+
Xa as DATAVIZ,
|
|
478
480
|
Ve as DEFAULT_PAGE_SIZE_OPTIONS,
|
|
479
|
-
|
|
481
|
+
ta as DEFAULT_PREVIEW_COUNT,
|
|
480
482
|
Re as DEFAULT_ROW_INTERACTION,
|
|
481
|
-
|
|
483
|
+
Qr as DEFAULT_WARNING_THRESHOLD,
|
|
482
484
|
Mt as DatePicker,
|
|
483
485
|
jt as DatePickerPill,
|
|
484
|
-
|
|
486
|
+
Ft as DesktopModal,
|
|
485
487
|
Gt as Dialog,
|
|
486
|
-
|
|
488
|
+
Ht as DialogModal,
|
|
487
489
|
Qt as Divider,
|
|
488
490
|
Jt as Drawer,
|
|
489
491
|
Kt as DrawerDesktop,
|
|
490
492
|
Yt as DrawerMobile,
|
|
491
493
|
rt as DropZone,
|
|
492
494
|
tr as FAButton,
|
|
495
|
+
ar as FormField,
|
|
493
496
|
Oe as HeadRow,
|
|
494
|
-
|
|
497
|
+
nr as Header,
|
|
495
498
|
Pe as HeaderCell,
|
|
496
499
|
q as HelperComponent,
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
500
|
+
eo as IconButton,
|
|
501
|
+
sr as Image,
|
|
502
|
+
ur as ImageGallery,
|
|
503
|
+
cr as Input,
|
|
504
|
+
mr as InputLegacy,
|
|
505
|
+
hr as InputMultiple,
|
|
506
|
+
br as InputPassword,
|
|
507
|
+
vr as InputSearch,
|
|
508
|
+
yr as Link,
|
|
509
|
+
Sr as ListItem,
|
|
510
|
+
Lr as Logo,
|
|
511
|
+
Nr as Menu,
|
|
512
|
+
Rr as MenuList,
|
|
513
|
+
Pr as Modal,
|
|
514
|
+
Mr as ModuleItem,
|
|
512
515
|
Ce as NavbarCollapseButton,
|
|
513
|
-
|
|
516
|
+
jr as NavigationRail,
|
|
514
517
|
Rt as OtpInput,
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
518
|
+
Fr as Pagination,
|
|
519
|
+
Er as PlainTooltip,
|
|
520
|
+
Gr as Popover,
|
|
521
|
+
Zr as PriorityChip,
|
|
522
|
+
ro as ProfilePictureUpload,
|
|
523
|
+
qr as ProgressBar,
|
|
524
|
+
oo as RadioButton,
|
|
525
|
+
Yr as RecurrentDatePicker,
|
|
526
|
+
ra as RecurrentDatePickerRRule,
|
|
524
527
|
ke as RowCell,
|
|
525
|
-
|
|
526
|
-
|
|
528
|
+
oa as SearchBar,
|
|
529
|
+
la as SegmentedButton,
|
|
527
530
|
G as Select,
|
|
528
|
-
|
|
531
|
+
ia as SelectSearch,
|
|
529
532
|
ge as SelectSearchLegacy,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
533
|
+
da as Sidebar,
|
|
534
|
+
fa as SidebarItem,
|
|
535
|
+
lo as Skeleton,
|
|
536
|
+
pa as Spinner,
|
|
537
|
+
io as SplitButton,
|
|
538
|
+
xa as Star,
|
|
539
|
+
co as StarRating,
|
|
540
|
+
ga as Steps,
|
|
541
|
+
Ca as Subtitle,
|
|
542
|
+
mo as Switch,
|
|
540
543
|
qe as Tab,
|
|
541
544
|
Je as TabLinkItem,
|
|
542
545
|
Ke as TabLinks,
|
|
543
|
-
|
|
546
|
+
wa as TabSwitch,
|
|
544
547
|
Me as Table,
|
|
545
548
|
_e as TableBody,
|
|
546
549
|
je as TableBodyLegacy,
|
|
547
550
|
Be as TableCaption,
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
+
Fe as TableCell,
|
|
552
|
+
He as TableFooter,
|
|
553
|
+
Ee as TableFooterLegacy,
|
|
551
554
|
ze as TableHeadLegacy,
|
|
552
555
|
Ue as TableHeader,
|
|
553
556
|
Ge as TableHeaderLegacy,
|
|
@@ -555,35 +558,36 @@ export {
|
|
|
555
558
|
Ze as TableRow,
|
|
556
559
|
$e as TableRowLegacy,
|
|
557
560
|
Xe as Tabs,
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
561
|
+
Ta as TertiaryLevelSidebar,
|
|
562
|
+
Ia as TextArea,
|
|
563
|
+
Na as TextareaInput,
|
|
564
|
+
Aa as Title,
|
|
565
|
+
Ra as Toast,
|
|
566
|
+
ka as ToastProvider,
|
|
567
|
+
po as Toggle,
|
|
568
|
+
zr as Tooltip,
|
|
569
|
+
_a as UserSidebarItem,
|
|
567
570
|
yt as groupMessagesBySender,
|
|
568
|
-
|
|
569
|
-
|
|
571
|
+
xo as resolveSkeletonTextLength,
|
|
572
|
+
Oa as toastpyrion,
|
|
570
573
|
wt as useChatBursts,
|
|
571
574
|
ye as useClickOutside,
|
|
572
|
-
|
|
575
|
+
Jr as useDateProgress,
|
|
573
576
|
Wt as useDialogControl,
|
|
574
577
|
Zt as useDialogState,
|
|
575
|
-
|
|
576
|
-
|
|
578
|
+
go as useDragScroll,
|
|
579
|
+
Co as useDrawerCollapsed,
|
|
577
580
|
Le as useDrawerControl,
|
|
578
581
|
Ie as useDrawerDesktop,
|
|
579
582
|
Ne as useDrawerMobile,
|
|
580
583
|
De as useDrawerState,
|
|
584
|
+
wo as useFormField,
|
|
581
585
|
et as useIsMobile,
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
586
|
+
Dr as useMenuControl,
|
|
587
|
+
Ar as useMenuState,
|
|
588
|
+
Et as useModalControl,
|
|
585
589
|
zt as useModalState,
|
|
586
590
|
we as usePopover,
|
|
587
|
-
|
|
588
|
-
|
|
591
|
+
Kr as useQuantityProgress,
|
|
592
|
+
To as useScrollable
|
|
589
593
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prometeo-design-system",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.4.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "design kit system",
|
|
7
7
|
"main": "dist/prometeo-design-system.umd.js",
|
|
@@ -286,6 +286,10 @@
|
|
|
286
286
|
"types": "./dist/SegmentedButton.d.ts",
|
|
287
287
|
"import": "./dist/SegmentedButton.es.js"
|
|
288
288
|
},
|
|
289
|
+
"./FormField": {
|
|
290
|
+
"types": "./dist/FormField.d.ts",
|
|
291
|
+
"import": "./dist/FormField.es.js"
|
|
292
|
+
},
|
|
289
293
|
"./DatePicker": {
|
|
290
294
|
"types": "./dist/DatePicker.d.ts",
|
|
291
295
|
"import": "./dist/DatePicker.es.js"
|