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.
@@ -0,0 +1,6 @@
1
+ export * from './exports/FormField'
2
+ export {}
3
+ import PrometeoDesignSystem from './exports/FormField'
4
+ export default PrometeoDesignSystem
5
+ export * from './exports/FormField'
6
+ export {}
@@ -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
+ };
@@ -0,0 +1,11 @@
1
+ import { createContext as t, useContext as e } from "react";
2
+ const o = t(
3
+ null
4
+ );
5
+ function r() {
6
+ return e(o);
7
+ }
8
+ export {
9
+ o as F,
10
+ r as u
11
+ };
@@ -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 d } from "react";
5
- import { Warning as c } from "./Icon-Warning.es.js";
6
- import { CheckCircle as o } from "./Icon-CheckCircle.es.js";
7
- import { Error as u } from "./Icon-Error.es.js";
8
- import { Info as f } from "./Icon-Info.es.js";
9
- const m = i("truncate", {
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
- }), b = i("min-h-4 shrink-0", {
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
- }), v = (a, t) => {
53
+ }), x = (a, t) => {
54
54
  const e = {
55
- default: f,
56
- error: u,
57
- success: o,
58
- warning: c
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(b({ variant: a, disabled: t })) });
61
- }, x = "*:text-disabled-default *:icon-disabled-default", l = (a) => {
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 && x, n), children: [
64
- a.children && v(t, e ?? !1),
65
- typeof a.children == "string" ? /* @__PURE__ */ s.jsx("p", { title: a.children, className: r(" prometeo-fonts-body-small", m({ variant: t, disabled: e })), children: a.children }) : a.children
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 V = d(l);
69
+ const H = c(l);
70
70
  export {
71
- V as default
71
+ H as default
72
72
  };
@@ -1,15 +1,16 @@
1
- import { j as d } from "./jsx-runtime-CqQglQKg.js";
1
+ import { j as u } from "./jsx-runtime-CqQglQKg.js";
2
2
  import { c as m } from "./cn-B6yFEsav.js";
3
- import { c as X } from "./index-BOQuZ0gG.js";
4
- import G, { useSyncExternalStore as tt, useId as nt, useRef as f, useState as S, useLayoutEffect as V, useEffect as z } from "react";
5
- import { useDragScroll as ot } from "./useDragScroll.es.js";
6
- import { PlainTooltip as rt } from "./PlainTooltip.es.js";
7
- const Te = "(prefers-reduced-motion: reduce)", lt = () => !1, at = () => typeof window > "u" ? !1 : window.matchMedia(Te).matches, st = (a) => {
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 r = window.matchMedia(Te);
11
- return r.addEventListener("change", a), () => r.removeEventListener("change", a);
12
- }, it = () => tt(st, at, lt), ct = (a, r, y) => y ? { commit: null, pending: r } : a && a.left === r.left && a.right === r.right ? { commit: null, pending: null } : { commit: r, pending: null }, ut = {
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, xe = 4, we = 8, dt = { small: 280, medium: 320, large: 360 }, ft = 300, N = "cubic-bezier(0.2,0,0,1)", mt = "cubic-bezier(0.34,1.4,0.64,1)", pt = "cubic-bezier(0.3,0,0.2,1)", ve = {
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
- }, bt = "[transition:var(--sb-motion)] motion-reduce:transition-none", gt = "[transition:var(--sb-motion-text)] motion-reduce:transition-none", ht = "[transition:var(--sb-motion-weight)] motion-reduce:transition-none", xt = "[transition:var(--sb-motion-slot)] motion-reduce:transition-none", ye = (a, r, y) => Math.min(y, Math.max(r, a)), wt = (a, r) => typeof a == "function" ? G.createElement(a, {
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(r, "shrink-0!")
86
- }) : G.cloneElement(
86
+ className: m(o, "shrink-0!")
87
+ }) : X.cloneElement(
87
88
  a,
88
89
  {
89
90
  size: D,
90
- className: m(r, "shrink-0!")
91
+ className: m(o, "shrink-0!")
91
92
  }
92
- ), vt = X(
93
- "relative border inline-flex bg-neutral-default-default border-neutral-default-default radius-large shadow-[var(--dropshadow-inset-100)]",
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
- ), yt = X(
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
- ), Tt = X("relative flex items-center justify-center", {
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
- }), Ot = (a) => {
183
+ }), kt = (a) => {
183
184
  const {
184
- size: r = "medium",
185
- color: y = "default",
185
+ size: o = "medium",
186
+ color: v = "default",
186
187
  options: E,
187
- value: Re,
188
- name: H,
189
- ariaLabel: Ie,
190
- onChange: Ne,
191
- icon: P,
192
- allowExpand: Q,
193
- equalWidth: Ee,
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: Ce,
196
- disableAnimation: Me = !1,
197
- animationDuration: Oe,
198
- animationIntensity: Le,
199
- disabled: $ = !1,
200
- className: Se,
201
- pillClassName: ze,
202
- iconClassName: $e,
203
- optionClassName: _e,
204
- optionIconClassName: Be
205
- } = a, je = `segmented-${nt()}`, Y = f(null), Z = f(null), J = f(null), ee = f(null), _ = f([]), [U, ke] = S(null), te = f(null), T = f(!1), M = f(null), W = f(!1), [b, Ae] = S(!1), [ne, Ve] = S(null), [F, oe] = S(!1), [q, re] = S(!1), le = f(0), O = f(null), De = it(), i = Me || De, c = i ? 0 : ye(Oe ?? ft, 0, 2e3), R = i ? 0 : ye(Le ?? 1, 0, 2), ae = Ee ?? (Q === !0 ? !1 : Q === !1 ? !0 : void 0), w = ae === "fill", B = ae === !0, I = C === "scroll" && !w, L = C === "collapse", Pe = C === "truncate" || C === "scroll" && w, se = E.every((e) => !!(e.icon ?? P)), Ue = Ce ?? dt[r], K = L && se && ne !== null && ne < Ue, v = $ ? "disabled" : ut[y] ?? y, l = Math.max(E.findIndex((e) => e.value === Re), 0), We = w ? "w-full" : "w-max max-w-full", Fe = I ? "overflow-x-auto overscroll-x-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" : "", qe = I && !B ? "auto-cols-max" : w || B ? ve.equal : ve.natural, Ke = i ? "none" : `color ${c}ms ${N}`, Ge = i ? "none" : `font-weight ${c}ms ${N}`, Xe = i ? "none" : `width ${c}ms ${N}, opacity ${c}ms ${N}`, ie = q ? Math.round(c * 0.4) : c, He = i ? "none" : `left ${ie}ms ${N}, right ${ie}ms ${N}, transform ${Math.round(F ? c * 0.4 : c * 0.9)}ms ${F ? pt : mt}`, Qe = le.current * 10 * R, Ye = F && R > 0 ? `translateX(${Qe}px) scaleX(${1 + 0.05 * R}) scaleY(${1 - 0.05 * R})` : void 0, ce = (e) => {
206
- te.current = e, ke(
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
- }, ue = () => {
212
+ }, fe = () => {
210
213
  if (!T.current) return;
211
214
  T.current = !1;
212
215
  const e = M.current;
213
- M.current = null, e && (re(!0), ce(e));
216
+ M.current = null, e && (ae(!0), ue(e));
214
217
  };
215
218
  V(() => {
216
- const e = J.current;
219
+ const e = te.current;
217
220
  if (!L || !e) return;
218
221
  const t = () => {
219
- const s = e.getBoundingClientRect().width;
220
- Ve((p) => p === s ? p : s);
222
+ const i = e.getBoundingClientRect().width;
223
+ We((p) => p === i ? p : i);
221
224
  };
222
225
  t();
223
- const o = new ResizeObserver(t);
224
- return o.observe(e), () => o.disconnect();
226
+ const r = new ResizeObserver(t);
227
+ return r.observe(e), () => r.disconnect();
225
228
  }, [L]), V(() => {
226
- if (O.current === null) {
227
- O.current = l;
229
+ if (B.current === null) {
230
+ B.current = l;
228
231
  return;
229
232
  }
230
- O.current !== l && (le.current = l > O.current ? 1 : -1, O.current = l, M.current = null, T.current = !1, W.current = !i);
231
- }, [l, i]);
232
- const de = f(null), { bind: Ze, ref: Je } = ot({
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
- }), fe = (e, t) => e.icon ?? (t ? P : void 0) ? D + (e.label != null && !K ? xe : 0) : 0;
239
+ }), pe = (e, t) => e.icon ?? (t ? F : void 0) ? D + (e.label != null && !G ? we : 0) : 0;
237
240
  V(() => {
238
- const e = Z.current, t = _.current[l];
241
+ const e = ee.current, t = $.current[l];
239
242
  if (!e || !t) return;
240
- const o = de.current, s = !w && !B && o !== null && o !== l ? E.map(
241
- (u, x) => fe(u, x === l) - fe(u, x === o)
242
- ) : null, p = (u = !1) => {
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 (u && s) {
249
- let pe = 0, be = 0;
250
- s.forEach((ge, he) => {
251
- he < l ? pe += ge : he > l && (be += ge);
252
- }), k = { left: k.left + pe, right: k.right + be };
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 = ct(
255
- te.current,
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 && ce(A.commit);
262
+ A.pending && (M.current = A.pending), A.commit && ue(A.commit);
260
263
  };
261
- p(!0), de.current = l;
264
+ p(!0), me.current = l;
262
265
  const g = new ResizeObserver(() => p());
263
- return g.observe(e), _.current.forEach((u) => {
264
- u && g.observe(u);
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
- r,
270
- w,
271
- B,
272
+ o,
273
+ y,
274
+ _,
272
275
  C,
273
- K
276
+ G
274
277
  ]), V(() => {
275
- W.current && (W.current = !1, T.current = !0);
276
- }, [l, i]), z(() => {
277
- U && !b && Ae(!0);
278
- }, [U, b]), z(() => {
279
- if (!q) return;
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
- () => re(!1),
284
+ () => ae(!1),
282
285
  Math.max(80, Math.round(c * 0.4))
283
286
  );
284
287
  return () => window.clearTimeout(e);
285
- }, [q, c]), z(() => {
286
- const e = ee.current;
288
+ }, [K, c]), S(() => {
289
+ const e = ne.current;
287
290
  if (!e) return;
288
- const t = (o) => {
289
- o.propertyName !== "left" && o.propertyName !== "right" || ue();
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
- }), z(() => {
293
- if (i || !T.current) return;
295
+ }), S(() => {
296
+ if (s || !T.current) return;
294
297
  let e, t;
295
- return R > 0 && (oe(!0), e = window.setTimeout(
296
- () => oe(!1),
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(ue, c + 80), () => {
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, i, c, R]), z(() => {
304
+ }, [l, s, c, R]), S(() => {
302
305
  if (!I) return;
303
- const e = Y.current, t = _.current[l];
306
+ const e = J.current, t = $.current[l];
304
307
  if (!e || !t) return;
305
- const o = e.getBoundingClientRect(), s = t.getBoundingClientRect(), p = b && !i ? "smooth" : "auto", g = s.right - o.right + we, u = o.left - s.left + we;
306
- g > 0 ? e.scrollBy({ left: g, behavior: p }) : u > 0 && e.scrollBy({ left: -u, behavior: p });
307
- }, [I, l, b, i]);
308
- const et = {
309
- "--sb-motion": b ? He : "none",
310
- "--sb-motion-text": b ? Ke : "none",
311
- "--sb-motion-weight": b ? Ge : "none",
312
- "--sb-motion-slot": b ? Xe : "none"
313
- }, me = /* @__PURE__ */ d.jsx(
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
- Y.current = e, Je.current = e;
320
+ J.current = e, lt.current = e;
318
321
  },
319
322
  role: "radiogroup",
320
- "aria-label": Ie ?? H,
321
- "aria-disabled": $ || void 0,
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
- vt({ size: r, color: v }),
324
- We,
325
- Fe,
326
- Se
329
+ Ct({ size: o, color: w }),
330
+ He,
331
+ Qe,
332
+ _e
327
333
  ),
328
- style: et,
329
- ...Ze,
330
- children: /* @__PURE__ */ d.jsxs(
334
+ style: at,
335
+ ...ot,
336
+ children: /* @__PURE__ */ u.jsxs(
331
337
  "div",
332
338
  {
333
- ref: Z,
339
+ ref: ee,
334
340
  className: m(
335
341
  "relative grid grid-flow-col items-stretch",
336
- qe,
337
- w && "w-full",
342
+ Ye,
343
+ y && "w-full",
338
344
  I && "w-max"
339
345
  ),
340
346
  children: [
341
- /* @__PURE__ */ d.jsx(
347
+ /* @__PURE__ */ u.jsx(
342
348
  "div",
343
349
  {
344
- ref: ee,
350
+ ref: ne,
345
351
  "aria-hidden": !0,
346
352
  className: m(
347
- yt({ size: r, color: v }),
353
+ Mt({ size: o, color: w }),
348
354
  "pointer-events-none",
349
- b && bt,
350
- ze
355
+ b && Tt,
356
+ je
351
357
  ),
352
358
  style: {
353
- ...U ?? {},
354
- transform: Ye
359
+ ...q ?? {},
360
+ transform: rt
355
361
  }
356
362
  }
357
363
  ),
358
364
  E.map((e, t) => {
359
- const o = t === l, s = e.icon ?? (o ? P : void 0), p = e.label != null && !K, g = Pe || L && !se ? "truncate" : "text-nowrap", u = o ? m(n[v].icon, $e) : m(n[v].optionIcon, Be), x = /* @__PURE__ */ d.jsxs(
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
- _.current[t] = j;
369
+ $.current[t] = j;
364
370
  },
365
371
  title: e.tooltipText ? void 0 : e.label ?? e.ariaLabel,
366
372
  className: m(
367
- Tt({ size: r, color: v }),
373
+ Bt({ size: o, color: w }),
368
374
  "relative z-20 min-w-0 select-none",
369
- gt,
370
- o ? n[v].pillText : n[v].option,
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
- _e
378
+ Ae
373
379
  ),
374
380
  children: [
375
- /* @__PURE__ */ d.jsx(
381
+ /* @__PURE__ */ u.jsx(
376
382
  "span",
377
383
  {
378
- "aria-hidden": !s,
379
- className: m("flex items-center overflow-hidden shrink-0", xt),
384
+ "aria-hidden": !i,
385
+ className: m("flex items-center overflow-hidden shrink-0", Nt),
380
386
  style: {
381
- width: s ? D + (p ? xe : 0) : 0,
382
- opacity: s ? 1 : 0
387
+ width: i ? D + (p ? we : 0) : 0,
388
+ opacity: i ? 1 : 0
383
389
  },
384
- children: s ? wt(s, u) : null
390
+ children: i ? Et(i, d) : null
385
391
  }
386
392
  ),
387
- p && /* @__PURE__ */ d.jsxs(
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__ */ d.jsx(
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__ */ d.jsx(
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
- ht,
413
- o ? "font-semibold" : "font-normal",
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__ */ d.jsx(
428
+ /* @__PURE__ */ u.jsx(
423
429
  "input",
424
430
  {
425
431
  type: "radio",
426
- name: je,
432
+ name: De,
427
433
  value: String(e.value),
428
- checked: o,
429
- disabled: $,
430
- onChange: () => Ne?.(H, e.value),
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
- $ ? "cursor-default" : "cursor-pointer"
440
+ z ? "cursor-default" : "cursor-pointer"
435
441
  )
436
442
  }
437
443
  )
438
444
  ]
439
445
  }
440
446
  );
441
- return e.tooltipText ? /* @__PURE__ */ d.jsx(rt, { title: e.tooltipText, asChild: !0, children: x }, e.value) : /* @__PURE__ */ d.jsx(G.Fragment, { children: x }, e.value);
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__ */ d.jsx("div", { ref: J, className: "w-full min-w-0", children: me }) : me;
454
+ return L ? /* @__PURE__ */ u.jsx("div", { ref: te, className: "w-full min-w-0", children: be }) : be;
449
455
  };
450
456
  export {
451
- Ot as SegmentedButton,
452
- Ot as default
457
+ kt as SegmentedButton,
458
+ kt as default
453
459
  };
@@ -0,0 +1,4 @@
1
+ import { FormFieldProps } from './types';
2
+ declare const FormField: import('react').NamedExoticComponent<FormFieldProps>;
3
+ export default FormField;
4
+ export type { FormFieldProps } from './types';
@@ -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 He, TableFooter as Ee, LegacyTableFooter as Fe, LegacyTableHead as ze, TableHeader as Ue, LegacyTableHeader as Ge, LegacyTable as We, TableRow as Ze, LegacyTableRow as $e } from "./Table.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 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 Ht, D as Et, u as Ft, a as zt } from "./useModalControl-BAUI_Hwx.js";
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 { default as ar } from "./Header.es.js";
37
- import { default as nr } from "./Image.es.js";
38
- import { I as sr } from "./ImageGallery-COXs6hwn.js";
39
- import { default as ur } from "./Input.es.js";
40
- import { default as cr } from "./InputLegacy.es.js";
41
- import { InputMultiple as mr } from "./InputMultiple.es.js";
42
- import { default as hr } from "./InputPassword.es.js";
43
- import { default as br } from "./InputSearch.es.js";
44
- import { default as vr } from "./Link.es.js";
45
- import { default as yr } from "./ListItem.es.js";
46
- import { default as Sr } from "./Logo.es.js";
47
- import { Menu as Lr, useMenuControl as Ir, useMenuState as Nr } from "./Menu.es.js";
48
- import { MenuList as Ar } from "./MenuList.es.js";
49
- import { default as Rr } from "./Modal.es.js";
50
- import { ModuleItem as Pr } from "./ModuleItem.es.js";
51
- import { NavigationRail as Mr } from "./NavigationRail.es.js";
52
- import { default as jr } from "./Pagination.es.js";
53
- import { PlainTooltip as Hr, PlainTooltip as Er } from "./PlainTooltip.es.js";
54
- import { default as zr } from "./Popover.es.js";
55
- import { default as Gr } from "./PriorityChip.es.js";
56
- import { DEFAULT_WARNING_THRESHOLD as Zr, ProgressBar as $r, useDateProgress as Qr, useQuantityProgress as qr } from "./ProgressBar.es.js";
57
- import { RecurrentDatePicker as Kr } from "./RecurrentDatePicker.es.js";
58
- import { DEFAULT_PREVIEW_COUNT as Yr, RecurrentDatePickerRRule as ea } from "./RecurrentDatePickerRRule.es.js";
59
- import { SearchBar as ra } from "./SearchBar.es.js";
60
- import { SegmentedButton as oa } from "./SegmentedButton.es.js";
61
- import { default as la } from "./SelectSearch.es.js";
62
- import { Sidebar as ia } from "./Sidebar.es.js";
63
- import { SidebarItem as da } from "./SidebarItem.es.js";
64
- import { default as fa } from "./Spinner.es.js";
65
- import { S as pa } from "./Star-DKhRZoa9.js";
66
- import { Steps as xa } from "./Steps.es.js";
67
- import { Subtitle as ga } from "./Subtitle.es.js";
68
- import { T as Ca } from "./usePyrionLayout-N9l4oGVr.js";
69
- import { TertiaryLevelSidebar as wa } from "./TertiaryLevelSidebar.es.js";
70
- import { TextArea as Ta, TextArea as La } from "./TextArea.es.js";
71
- import { Title as Na } from "./Title.es.js";
72
- import { default as Aa, toastpyrion as Va } from "./Toast.es.js";
73
- import { default as Oa } from "./ToastProvider.es.js";
74
- import { UserSidebarItem as ka } from "./UserSidebarItem.es.js";
75
- import { AttachInput as _a } from "./AttachInput.es.js";
76
- import { A as Ba } from "./AvatarBase-BM6Doe0z.js";
77
- import { default as Ea } from "./Button.es.js";
78
- import { CardProfile as za } from "./CardProfile.es.js";
79
- import { default as Ga } from "./Check.es.js";
80
- import { default as Za } from "./CheckBox.es.js";
81
- import { Collapsible as Qa } from "./Collapsible.es.js";
82
- import { DATAVIZ as Ja } from "./Dataviz.es.js";
83
- import { default as Xa } from "./IconButton.es.js";
84
- import { ProfilePictureUpload as eo } from "./ProfilePictureUpload.es.js";
85
- import { RadioButton as ro } from "./RadioButton.es.js";
86
- import { S as oo } from "./Skeleton-C8OCBBLq.js";
87
- import { SplitButton as lo } from "./SplitButton.es.js";
88
- import { StarRating as io } from "./StarRating.es.js";
89
- import { Switch as co, Switch as fo } from "./Switch.es.js";
90
- import { resolveSkeletonTextLength as po } from "./Skeleton.es.js";
91
- import { useDragScroll as xo } from "./useDragScroll.es.js";
92
- import { u as go } from "./useDrawerCollapsed-CJOXf2Fw.js";
93
- import { useScrollable as Co } from "./useScrollable.es.js";
94
- const H = ({
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
- H.displayName = "ActionInput.Footer";
103
- const E = ({
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
- E.displayName = "ActionInput.AttachFields";
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 === E && !n) {
141
+ if (l.type === H && !n) {
140
142
  n = l;
141
143
  continue;
142
144
  }
143
- l.type === H && !i && (i = l);
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, F] = X(
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 || F(t.target.value), f?.(t), v();
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: H,
248
- AttachFields: E
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: F, onClear: z, groupSelection: M, value: U, defaultValue: v, ...I } = e.selectComponentProps || {}, N = {
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
- _a as AttachInput,
454
+ Ba as AttachInput,
453
455
  ot as Avatar,
454
456
  nt as AvatarAndSubavatar,
455
- Ba as AvatarBase,
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
- Ea as Button,
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
- za as CardProfile,
468
+ Ga as CardProfile,
467
469
  vt as Chat,
468
470
  Tt as ChatCard,
469
471
  Ct as ChatViewport,
470
- Ga as Check,
471
- Za as CheckBox,
472
+ Za as Check,
473
+ Qa as CheckBox,
472
474
  It as Chip,
473
475
  Dt as ChipSelect,
474
476
  Vt as CodeInput,
475
- Qa as Collapsible,
477
+ Ja as Collapsible,
476
478
  Pt as ColorPicker,
477
- Ja as DATAVIZ,
479
+ Xa as DATAVIZ,
478
480
  Ve as DEFAULT_PAGE_SIZE_OPTIONS,
479
- Yr as DEFAULT_PREVIEW_COUNT,
481
+ ta as DEFAULT_PREVIEW_COUNT,
480
482
  Re as DEFAULT_ROW_INTERACTION,
481
- Zr as DEFAULT_WARNING_THRESHOLD,
483
+ Qr as DEFAULT_WARNING_THRESHOLD,
482
484
  Mt as DatePicker,
483
485
  jt as DatePickerPill,
484
- Ht as DesktopModal,
486
+ Ft as DesktopModal,
485
487
  Gt as Dialog,
486
- Et as DialogModal,
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
- ar as Header,
497
+ nr as Header,
495
498
  Pe as HeaderCell,
496
499
  q as HelperComponent,
497
- Xa as IconButton,
498
- nr as Image,
499
- sr as ImageGallery,
500
- ur as Input,
501
- cr as InputLegacy,
502
- mr as InputMultiple,
503
- hr as InputPassword,
504
- br as InputSearch,
505
- vr as Link,
506
- yr as ListItem,
507
- Sr as Logo,
508
- Lr as Menu,
509
- Ar as MenuList,
510
- Rr as Modal,
511
- Pr as ModuleItem,
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
- Mr as NavigationRail,
516
+ jr as NavigationRail,
514
517
  Rt as OtpInput,
515
- jr as Pagination,
516
- Hr as PlainTooltip,
517
- zr as Popover,
518
- Gr as PriorityChip,
519
- eo as ProfilePictureUpload,
520
- $r as ProgressBar,
521
- ro as RadioButton,
522
- Kr as RecurrentDatePicker,
523
- ea as RecurrentDatePickerRRule,
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
- ra as SearchBar,
526
- oa as SegmentedButton,
528
+ oa as SearchBar,
529
+ la as SegmentedButton,
527
530
  G as Select,
528
- la as SelectSearch,
531
+ ia as SelectSearch,
529
532
  ge as SelectSearchLegacy,
530
- ia as Sidebar,
531
- da as SidebarItem,
532
- oo as Skeleton,
533
- fa as Spinner,
534
- lo as SplitButton,
535
- pa as Star,
536
- io as StarRating,
537
- xa as Steps,
538
- ga as Subtitle,
539
- co as Switch,
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
- Ca as TabSwitch,
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
- He as TableCell,
549
- Ee as TableFooter,
550
- Fe as TableFooterLegacy,
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
- wa as TertiaryLevelSidebar,
559
- Ta as TextArea,
560
- La as TextareaInput,
561
- Na as Title,
562
- Aa as Toast,
563
- Oa as ToastProvider,
564
- fo as Toggle,
565
- Er as Tooltip,
566
- ka as UserSidebarItem,
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
- po as resolveSkeletonTextLength,
569
- Va as toastpyrion,
571
+ xo as resolveSkeletonTextLength,
572
+ Oa as toastpyrion,
570
573
  wt as useChatBursts,
571
574
  ye as useClickOutside,
572
- Qr as useDateProgress,
575
+ Jr as useDateProgress,
573
576
  Wt as useDialogControl,
574
577
  Zt as useDialogState,
575
- xo as useDragScroll,
576
- go as useDrawerCollapsed,
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
- Ir as useMenuControl,
583
- Nr as useMenuState,
584
- Ft as useModalControl,
586
+ Dr as useMenuControl,
587
+ Ar as useMenuState,
588
+ Et as useModalControl,
585
589
  zt as useModalState,
586
590
  we as usePopover,
587
- qr as useQuantityProgress,
588
- Co as useScrollable
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.3.0",
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"