prometeo-design-system 7.7.4 → 7.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Avatar.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { j as m } from "./jsx-runtime-GkKLlHH4.js";
2
- import { A as u } from "./AvatarAndSubavatar-BuZi4MrC.js";
3
- import { A as d } from "./AvatarBase-DiSd8Z2B.js";
2
+ import { A as u } from "./AvatarAndSubavatar-06yOUIKk.js";
3
+ import { A as d } from "./AvatarBase-Yi_3zqle.js";
4
4
  const g = "[Pyrion Avatar]", o = /* @__PURE__ */ new Set(), e = (a, r) => {
5
5
  o.has(a) || (o.add(a), console.warn(`${g} ${r}`));
6
6
  }, f = {
@@ -1,9 +1,9 @@
1
1
  import { j as r } from "./jsx-runtime-GkKLlHH4.js";
2
2
  import { c as m } from "./index-BOQuZ0gG.js";
3
3
  import { memo as l, useState as d, useEffect as n } from "react";
4
- import { A as x } from "./AvatarBase-DiSd8Z2B.js";
4
+ import { A as x } from "./AvatarBase-Yi_3zqle.js";
5
5
  const c = m(
6
- "bg-brand-secondary-default border-neutral-default-default border-1 rounded-full text-brand-secondary-default grid place-items-center overflow-hidden object-cover object-center absolute ",
6
+ "bg-brand-secondary-default border-neutral-default-default border rounded-full text-brand-secondary-default grid place-items-center overflow-hidden object-cover object-center absolute ",
7
7
  {
8
8
  variants: {
9
9
  size: {
@@ -1,11 +1,11 @@
1
1
  import { j as e } from "./jsx-runtime-GkKLlHH4.js";
2
2
  import { c as t } from "./cn-B6yFEsav.js";
3
3
  import { c } from "./index-BOQuZ0gG.js";
4
- import { useState as u, useEffect as g } from "react";
5
- import h from "./Skeleton.es.js";
6
- import { UserAvatar as b } from "./Icon-UserAvatar.es.js";
4
+ import { useState as x, useEffect as b } from "react";
5
+ import g from "./Skeleton.es.js";
6
+ import { UserAvatar as h } from "./Icon-UserAvatar.es.js";
7
7
  const o = c(
8
- "bg-brand-secondary-default rounded-full text-brand-secondary-default grid place-items-center overflow-hidden object-cover object-center select-none shrink-0",
8
+ "bg-brand-secondary-default rounded-full text-brand-secondary-default grid place-items-center overflow-hidden object-cover object-center select-none shrink-0 border border-neutral-default-default",
9
9
  {
10
10
  variants: {
11
11
  size: {
@@ -39,19 +39,19 @@ function I({
39
39
  name: n,
40
40
  fallbackType: d = "initials"
41
41
  }) {
42
- const [f, i] = u(!1);
43
- if (g(() => {
42
+ const [f, i] = x(!1);
43
+ if (b(() => {
44
44
  i(!1);
45
45
  }, [a]), m)
46
46
  return /* @__PURE__ */ e.jsx("div", { ref: r, className: t("inline-flex", l), children: /* @__PURE__ */ e.jsx(
47
- h,
47
+ g,
48
48
  {
49
49
  shape: "circle",
50
50
  className: t(o({ size: s }), "border-0")
51
51
  }
52
52
  ) });
53
- const p = d === "initials" && n, x = !!a && !f;
54
- return /* @__PURE__ */ e.jsx("div", { ref: r, className: t(o({ size: s }), l), children: x ? /* @__PURE__ */ e.jsx(
53
+ const u = d === "initials" && n, p = !!a && !f;
54
+ return /* @__PURE__ */ e.jsx("div", { ref: r, className: t(o({ size: s }), l), children: p ? /* @__PURE__ */ e.jsx(
55
55
  "img",
56
56
  {
57
57
  src: a,
@@ -60,7 +60,7 @@ function I({
60
60
  draggable: !1,
61
61
  onError: () => i(!0)
62
62
  }
63
- ) : p ? /* @__PURE__ */ e.jsx("p", { className: j({ size: s }), children: v(n) }) : /* @__PURE__ */ e.jsx(b, { className: "size-full rounded-full" }) });
63
+ ) : u ? /* @__PURE__ */ e.jsx("p", { className: j({ size: s }), children: v(n) }) : /* @__PURE__ */ e.jsx(h, { className: "size-full rounded-full" }) });
64
64
  }
65
65
  export {
66
66
  I as A
package/dist/Chip.es.js CHANGED
@@ -4,7 +4,7 @@ import { c as m } from "./index-BOQuZ0gG.js";
4
4
  import { c as h } from "./cn-B6yFEsav.js";
5
5
  import { i as V } from "./iconUtils-rTOfKDxE.js";
6
6
  import { Close as q } from "./Icon-Close.es.js";
7
- import { A as Q } from "./AvatarBase-DiSd8Z2B.js";
7
+ import { A as Q } from "./AvatarBase-Yi_3zqle.js";
8
8
  const Z = {
9
9
  small: "h-5 px-2 text-xs prometeo-fonts-body-small",
10
10
  medium: "h-8 px-3 text-sm prometeo-fonts-body-medium",
package/dist/Input.es.js CHANGED
@@ -81,13 +81,13 @@ const me = c("relative w-full bg-inherit flex flex-col gap-1", {
81
81
  { size: "small", className: "border py-1" },
82
82
  { size: "medium", className: "border py-2" },
83
83
  { size: "large", className: "border-b border-t-0! border-x-0! py-2 outline-none has-focus:border-b-2 has-focus:pb-[7px]" },
84
- { disabled: !1, state: "default", className: "border-neutral-primary-default hover:border-brand-secondary-default outline-(--border-brand-secondary-default) has-focus:border-brand-secondary-default focus-active:bg-red-400!" },
84
+ { disabled: !1, state: "default", className: "border-neutral-primary-default hover:border-brand-secondary-default outline-(--border-brand-secondary-default) has-focus:border-brand-secondary-default focus-active:bg-red-400! [&:has(:is(:autofill,:-webkit-autofill))]:border-brand-secondary-default [&:has(:is(:autofill,:-webkit-autofill))]:bg-brand-overlay-default" },
85
85
  { disabled: !1, state: "success", className: "border-success-onneutral-default hover:border-success-onneutral-hover outline-(--border-success-onneutral-hover) active:border-success-onneutral-hover has-focus:border-success-onneutral-hover" },
86
86
  { disabled: !1, state: "error", className: "border-error-onneutral-default hover:border-error-onneutral-hover outline-(--border-error-onneutral-hover) active:border-error-onneutral-hover has-focus:border-error-onneutral-hover" },
87
87
  { disabled: !1, state: "warning", className: "border-warning-onneutral-default hover:border-warning-onneutral-hover outline-(--border-warning-onneutral-hover) active:border-warning-onneutral-hover has-focus:border-warning-onneutral-hover" }
88
88
  ]
89
89
  }), he = c(
90
- "w-full flex-1 min-h-0 bg-transparent appearance-none transition-all duration-200 ease-in-out focus:outline-none text-neutral-primary-default placeholder:text-neutral-tertiary-default",
90
+ "w-full flex-1 min-h-0 bg-transparent appearance-none transition-all duration-200 ease-in-out focus:outline-none text-neutral-primary-default placeholder:text-neutral-tertiary-default [&:is(:autofill,:-webkit-autofill)]:[-webkit-text-fill-color:var(--text-brand-overlay-default)] [&:is(:autofill,:-webkit-autofill)]:[transition:background-color_5000s]",
91
91
  {
92
92
  variants: {
93
93
  size: {
@@ -164,27 +164,27 @@ const me = c("relative w-full bg-inherit flex flex-col gap-1", {
164
164
  required: g = !1,
165
165
  label: N,
166
166
  supportingText: x,
167
- showSupportingText: q,
167
+ showSupportingText: _,
168
168
  leadingIcon: f,
169
169
  renderValue: u,
170
170
  slotActions: m,
171
- hideClearButton: _ = !1,
172
- onClear: y,
171
+ hideClearButton: q = !1,
172
+ onClear: w,
173
173
  flexibleHeight: V = !1,
174
174
  cardBackground: j,
175
175
  onFocus: G,
176
176
  onBlur: J,
177
177
  onKeyDown: Q,
178
178
  onKeyUp: W,
179
- defaultValue: T,
180
- ...k
181
- } = B, w = ne(null), S = I(
179
+ defaultValue: k,
180
+ ...T
181
+ } = B, y = ne(null), S = I(
182
182
  (a) => {
183
- w.current = a, typeof e == "function" ? e(a) : e && (e.current = a);
183
+ y.current = a, typeof e == "function" ? e(a) : e && (e.current = a);
184
184
  },
185
185
  [e]
186
186
  ), i = H, o = L, C = O ?? b, l = h !== void 0, [X, E] = re(
187
- () => T ?? ""
187
+ () => k ?? ""
188
188
  ), p = l ? h : X, U = d(
189
189
  he({
190
190
  size: i,
@@ -197,17 +197,17 @@ const me = c("relative w-full bg-inherit flex flex-col gap-1", {
197
197
  },
198
198
  [l, z]
199
199
  ), A = I(() => {
200
- if (y) {
201
- y();
200
+ if (w) {
201
+ w();
202
202
  return;
203
203
  }
204
- const a = w.current;
204
+ const a = y.current;
205
205
  if (!a) return;
206
206
  Object.getOwnPropertyDescriptor(
207
207
  window.HTMLInputElement.prototype,
208
208
  "value"
209
209
  )?.set?.call(a, ""), a.dispatchEvent(new Event("input", { bubbles: !0 })), a.dispatchEvent(new Event("change", { bubbles: !0 })), l || E(""), a.focus();
210
- }, [y, l]), Y = !_ && !r && p !== void 0 && p !== "", Z = {
210
+ }, [w, l]), Y = !q && !r && p !== void 0 && p !== "", Z = {
211
211
  state: o,
212
212
  disabled: !!r,
213
213
  size: i,
@@ -257,7 +257,7 @@ const me = c("relative w-full bg-inherit flex flex-col gap-1", {
257
257
  V && (i === "medium" || i === "large") && "h-auto min-h-12"
258
258
  ),
259
259
  onClick: () => {
260
- u || w.current?.focus();
260
+ u || y.current?.focus();
261
261
  },
262
262
  children: [
263
263
  j && /* @__PURE__ */ n.jsx(
@@ -289,7 +289,7 @@ const me = c("relative w-full bg-inherit flex flex-col gap-1", {
289
289
  disabled: r,
290
290
  readOnly: v,
291
291
  onChange: F,
292
- ...k
292
+ ...T
293
293
  }
294
294
  ),
295
295
  /* @__PURE__ */ n.jsx(
@@ -316,11 +316,10 @@ const me = c("relative w-full bg-inherit flex flex-col gap-1", {
316
316
  name: b,
317
317
  type: R,
318
318
  value: l ? h : void 0,
319
- defaultValue: l ? void 0 : T,
319
+ defaultValue: l ? void 0 : k,
320
320
  placeholder: D,
321
321
  className: d(
322
322
  U,
323
- "prometeo-input-autofill",
324
323
  f && "pl-0"
325
324
  ),
326
325
  disabled: r,
@@ -332,7 +331,7 @@ const me = c("relative w-full bg-inherit flex flex-col gap-1", {
332
331
  onKeyDown: Q,
333
332
  onKeyUp: W,
334
333
  "data-state": o,
335
- ...k
334
+ ...T
336
335
  }
337
336
  ),
338
337
  /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-0.5", children: [
@@ -358,13 +357,13 @@ const me = c("relative w-full bg-inherit flex flex-col gap-1", {
358
357
  ]
359
358
  }
360
359
  ),
361
- q && /* @__PURE__ */ n.jsx(de, { variant: o, disabled: r, className: "min-h-4", children: typeof x == "function" ? x() : x })
360
+ _ && /* @__PURE__ */ n.jsx(de, { variant: o, disabled: r, className: "min-h-4", children: typeof x == "function" ? x() : x })
362
361
  ]
363
362
  }
364
363
  );
365
364
  }
366
- ), ye = te(xe);
367
- ye.displayName = "Input";
365
+ ), we = te(xe);
366
+ we.displayName = "Input";
368
367
  export {
369
- ye as default
368
+ we as default
370
369
  };
@@ -8,7 +8,7 @@ import M from "./Divider.es.js";
8
8
  import Z from "./RadioButton.es.js";
9
9
  import q from "./Check.es.js";
10
10
  import { ChevronDown as G } from "./Icon-ChevronDown.es.js";
11
- import { A as H } from "./AvatarBase-DiSd8Z2B.js";
11
+ import { A as H } from "./AvatarBase-Yi_3zqle.js";
12
12
  const J = {
13
13
  size: "small",
14
14
  name: "A B"
@@ -1,8 +1,9 @@
1
- import { j as r } from "./jsx-runtime-GkKLlHH4.js";
2
- import { c as u } from "./cn-B6yFEsav.js";
3
- import { c as V } from "./index-BOQuZ0gG.js";
4
- import L, { useRef as M, useState as R, useLayoutEffect as H, useEffect as T, useMemo as J } from "react";
5
- const Q = {
1
+ import { j as n } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { c as m } from "./cn-B6yFEsav.js";
3
+ import { c as B } from "./index-BOQuZ0gG.js";
4
+ import _, { useRef as O, useState as V, useLayoutEffect as le, useEffect as K, useMemo as T } from "react";
5
+ import re from "./PlainTooltip.es.js";
6
+ const se = {
6
7
  default: "brand",
7
8
  danger: "error"
8
9
  }, a = {
@@ -10,39 +11,45 @@ const Q = {
10
11
  pill: "bg-brand-secondary-default text-neutral-onbrandsecondary-default",
11
12
  container: "border-neutral-default-default",
12
13
  option: "text-neutral-secondary-default",
13
- icon: "icon-neutral-onbrandsecondary-default"
14
+ icon: "icon-neutral-onbrandsecondary-default",
15
+ optionIcon: "icon-neutral-secondary-default"
14
16
  },
15
17
  neutral: {
16
18
  pill: "bg-neutral-tertiary-default text-neutral-default-default",
17
19
  container: "border-neutral-default-default",
18
20
  option: "text-neutral-secondary-default",
19
- icon: "icon-neutral-default-default"
21
+ icon: "icon-neutral-default-default",
22
+ optionIcon: "icon-neutral-secondary-default"
20
23
  },
21
24
  error: {
22
25
  pill: "bg-error-secondary-default text-semantic-error-secondary-default",
23
26
  container: "border-neutral-default-default",
24
27
  option: "text-neutral-secondary-default",
25
- icon: "icon-semantic-error-secondary-default"
28
+ icon: "icon-semantic-error-secondary-default",
29
+ optionIcon: "icon-neutral-secondary-default"
26
30
  },
27
31
  success: {
28
32
  pill: "bg-success-secondary-default text-semantic-success-secondary-default",
29
33
  container: "border-neutral-default-default",
30
34
  option: "text-neutral-secondary-default",
31
- icon: "icon-semantic-success-secondary-default"
35
+ icon: "icon-semantic-success-secondary-default",
36
+ optionIcon: "icon-neutral-secondary-default"
32
37
  },
33
38
  warning: {
34
39
  pill: "bg-warning-secondary-default text-semantic-warning-secondary-default",
35
40
  container: "border-neutral-default-default",
36
41
  option: "text-neutral-secondary-default",
37
- icon: "icon-semantic-warning-secondary-default"
42
+ icon: "icon-semantic-warning-secondary-default",
43
+ optionIcon: "icon-neutral-secondary-default"
38
44
  },
39
45
  disabled: {
40
46
  pill: "bg-disabled-default text-disabled-ondisabled",
41
47
  container: "border-neutral-default-default opacity-80",
42
48
  option: "text-disabled-default",
43
- icon: "icon-disabled-ondisabled"
49
+ icon: "icon-disabled-ondisabled",
50
+ optionIcon: "icon-disabled-default"
44
51
  }
45
- }, o = {
52
+ }, f = {
46
53
  small: {
47
54
  container: "py-[3px] px-[3px] radius-medium",
48
55
  pill: "px-3 py-1 gap-0.5 radius-small pyrion-fonts-label-medium",
@@ -58,23 +65,39 @@ const Q = {
58
65
  pill: "px-4 py-2.5 gap-0.5 radius-medium pyrion-fonts-label-large",
59
66
  option: "px-4 py-2 gap-[2px] pyrion-fonts-body-medium"
60
67
  }
61
- }, j = 20, A = (f, i) => {
62
- const b = f.reduce((x, c) => x + c, 0);
63
- if (b <= 0) return f;
64
- let n = i;
65
- return f.map((x, c) => {
66
- if (c === f.length - 1) return n;
67
- const h = Math.round(x * i / b);
68
- return n -= h, h;
68
+ }, I = 20, Z = (i, c) => i ? typeof i == "function" ? _.createElement(i, {
69
+ size: I,
70
+ className: m(c, "shrink-0!")
71
+ }) : _.cloneElement(
72
+ i,
73
+ {
74
+ size: I,
75
+ className: m(c, "shrink-0!")
76
+ }
77
+ ) : /* @__PURE__ */ n.jsx(
78
+ "span",
79
+ {
80
+ className: "inline-block shrink-0",
81
+ style: { width: 0, height: I },
82
+ "aria-hidden": !0
83
+ }
84
+ ), D = (i, c) => {
85
+ const w = i.reduce((v, h) => v + h, 0);
86
+ if (w <= 0) return i;
87
+ let l = c;
88
+ return i.map((v, h) => {
89
+ if (h === i.length - 1) return l;
90
+ const N = Math.round(v * c / w);
91
+ return l -= N, N;
69
92
  });
70
- }, U = V(
93
+ }, oe = B(
71
94
  "relative border inline-flex bg-neutral-default-default border-neutral-default-default radius-large w-max max-w-full ",
72
95
  {
73
96
  variants: {
74
97
  size: {
75
- small: o.small.container,
76
- medium: o.medium.container,
77
- large: o.large.container
98
+ small: f.small.container,
99
+ medium: f.medium.container,
100
+ large: f.large.container
78
101
  },
79
102
  color: {
80
103
  brand: "",
@@ -98,12 +121,12 @@ const Q = {
98
121
  color: "brand"
99
122
  }
100
123
  }
101
- ), X = "transition-[left] duration-300 ease-[cubic-bezier(0.175,0.885,0.32,1.075)]", Y = "transition-[width] duration-500 ease-out", $ = V("absolute top-1/2 -translate-y-1/2 h-max z-30 flex items-center justify-center", {
124
+ ), ie = "transition-[left,right] duration-300 ease-[cubic-bezier(0.175,0.885,0.32,1.075)]", ce = "transition-[width] duration-500 ease-out", de = B("absolute top-1/2 -translate-y-1/2 h-max z-30 flex items-center justify-center", {
102
125
  variants: {
103
126
  size: {
104
- small: o.small.pill,
105
- medium: o.medium.pill,
106
- large: o.large.pill
127
+ small: f.small.pill,
128
+ medium: f.medium.pill,
129
+ large: f.large.pill
107
130
  },
108
131
  color: {
109
132
  brand: "",
@@ -126,14 +149,14 @@ const Q = {
126
149
  size: "medium",
127
150
  color: "brand"
128
151
  }
129
- }), ee = V(
152
+ }), ue = B(
130
153
  "z-20 h-full min-h-5 flex items-center justify-center select-none text-nowrap shrink-0",
131
154
  {
132
155
  variants: {
133
156
  size: {
134
- small: o.small.option,
135
- medium: o.medium.option,
136
- large: o.large.option
157
+ small: f.small.option,
158
+ medium: f.medium.option,
159
+ large: f.large.option
137
160
  },
138
161
  color: {
139
162
  brand: "",
@@ -157,133 +180,162 @@ const Q = {
157
180
  color: "brand"
158
181
  }
159
182
  }
160
- ), re = (f) => {
183
+ ), xe = (i) => {
161
184
  const {
162
- size: i = "medium",
163
- color: b = "default",
164
- options: n,
165
- value: x,
166
- name: c,
167
- onChange: h,
168
- icon: y,
169
- allowExpand: E,
170
- equalWidth: B,
171
- disabled: g = !1
172
- } = f, N = M([]), q = M(null), k = M(null), [d, F] = R(!1), [W, P] = R(!1), [w, O] = R([]), C = B ?? (E === !0 ? !1 : E === !1 ? !0 : void 0), s = C === "fill", z = C === !0, m = g ? "disabled" : Q[b] ?? b, p = Math.max(n.findIndex((e) => e.value === x), 0), K = n[p] ?? n[0], _ = n.map((e) => e.label).join("\0"), S = !!y;
173
- H(() => {
174
- const e = n.map((t, v) => {
175
- const I = N.current[v];
176
- return Math.ceil(I?.getBoundingClientRect().width ?? 0);
185
+ size: c = "medium",
186
+ color: w = "default",
187
+ options: l,
188
+ value: v,
189
+ name: h,
190
+ onChange: N,
191
+ icon: F,
192
+ allowExpand: L,
193
+ equalWidth: G,
194
+ disabled: j = !1,
195
+ className: H,
196
+ pillClassName: J,
197
+ iconClassName: Q,
198
+ optionClassName: M,
199
+ optionIconClassName: U
200
+ } = i, x = O([]), X = O(null), R = O(null), [d, Y] = V(!1), [z, ee] = V(!1), [u, S] = V([]), A = G ?? (L === !0 ? !1 : L === !1 ? !0 : void 0), o = A === "fill", C = A === !0, y = j ? "disabled" : se[w] ?? w, b = Math.max(l.findIndex((e) => e.value === v), 0), E = l[b] ?? l[0], q = l.map((e) => `${e.label ?? ""}${e.icon ? "1" : "0"}`).join("\0"), P = !!F || l.some((e) => !!e.icon), te = E?.icon ?? F;
201
+ le(() => {
202
+ const e = l.map((r, p) => {
203
+ const t = x.current[p];
204
+ return Math.ceil(t?.getBoundingClientRect().width ?? 0);
177
205
  });
178
- if (e.some((t) => t <= 0)) return;
179
- let l;
180
- if (s) {
181
- const t = k.current?.offsetWidth ?? 0;
182
- if (t <= 0) return;
183
- l = A(e, t);
184
- } else z ? l = n.map(() => Math.max(...e)) : l = e;
185
- O(l), F(!0);
186
- }, [n.length, _, i, S, g, s, z, m]), T(() => {
206
+ if (e.some((r) => r <= 0)) return;
207
+ let s;
208
+ if (o) {
209
+ const r = R.current?.offsetWidth ?? 0;
210
+ if (r <= 0) return;
211
+ s = D(e, r);
212
+ } else C ? s = l.map(() => Math.max(...e)) : s = e;
213
+ S(s), Y(!0);
214
+ }, [l.length, q, c, P, j, o, C, y, M]), K(() => {
187
215
  document.fonts.status !== "loaded" && document.fonts.ready.then(() => {
188
- N.current.forEach((t) => {
216
+ const e = x.current.map(
217
+ (t) => t ? {
218
+ width: t.style.width,
219
+ minWidth: t.style.minWidth,
220
+ maxWidth: t.style.maxWidth
221
+ } : null
222
+ ), s = () => {
223
+ x.current.forEach((t, W) => {
224
+ const g = e[W];
225
+ !t || !g || (t.style.width = g.width, t.style.minWidth = g.minWidth, t.style.maxWidth = g.maxWidth);
226
+ });
227
+ };
228
+ x.current.forEach((t) => {
189
229
  t && (t.style.width = "", t.style.minWidth = "", t.style.maxWidth = "");
190
230
  });
191
- const e = n.map((t, v) => {
192
- const I = N.current[v];
193
- return Math.ceil(I?.getBoundingClientRect().width ?? 0);
231
+ const r = l.map((t, W) => {
232
+ const g = x.current[W];
233
+ return Math.ceil(g?.getBoundingClientRect().width ?? 0);
194
234
  });
195
- if (e.some((t) => t <= 0)) return;
196
- let l;
197
- if (z)
198
- l = n.map(() => Math.max(...e));
199
- else if (s) {
200
- const t = k.current?.offsetWidth ?? 0;
201
- l = t > 0 ? A(e, t) : e;
235
+ if (r.some((t) => t <= 0)) {
236
+ s();
237
+ return;
238
+ }
239
+ let p;
240
+ if (C)
241
+ p = l.map(() => Math.max(...r));
242
+ else if (o) {
243
+ const t = R.current?.offsetWidth ?? 0;
244
+ p = t > 0 ? D(r, t) : r;
202
245
  } else
203
- l = e;
204
- O(l);
246
+ p = r;
247
+ s(), S(p);
205
248
  });
206
- }, [n.length, _, i, S, s, z]), T(() => {
207
- d && !W && P(!0);
208
- }, [d, W]);
209
- const Z = J(() => !d || w.length === 0 ? 0 : w.slice(0, p).reduce((e, l) => e + l, 0), [d, w, p]), D = () => {
210
- const e = p === n.length - 1 ? n[0] : n[p + 1];
211
- h?.(c, e.value);
212
- }, G = () => y ? typeof y == "function" ? L.createElement(y, {
213
- size: j,
214
- className: u(a[m].icon, "shrink-0!")
215
- }) : L.cloneElement(
216
- y,
217
- {
218
- size: j,
219
- className: u(a[m].icon, "shrink-0!")
220
- }
221
- ) : /* @__PURE__ */ r.jsx("span", { className: "inline-block shrink-0", style: { width: 0, height: j }, "aria-hidden": !0 });
222
- return /* @__PURE__ */ r.jsx(
249
+ }, [l.length, q, c, P, o, C, M]), K(() => {
250
+ d && !z && ee(!0);
251
+ }, [d, z]);
252
+ const k = T(() => !d || u.length === 0 ? 0 : u.slice(0, b).reduce((e, s) => e + s, 0), [d, u, b]), $ = T(
253
+ () => u.reduce((e, s) => e + s, 0),
254
+ [u]
255
+ ), ne = T(() => !d || u.length === 0 ? 0 : $ - k - (u[b] ?? 0), [d, u, $, k, b]), ae = () => {
256
+ const e = b === l.length - 1 ? l[0] : l[b + 1];
257
+ N?.(h, e.value);
258
+ };
259
+ return /* @__PURE__ */ n.jsx(
223
260
  "button",
224
261
  {
225
- ref: q,
226
- name: c,
262
+ ref: X,
263
+ name: h,
227
264
  type: "button",
228
- disabled: g,
229
- className: u(
230
- U({ size: i, color: m }),
231
- s && "w-full",
232
- !g && "cursor-pointer"
265
+ disabled: j,
266
+ className: m(
267
+ oe({ size: c, color: y }),
268
+ o && "w-full",
269
+ !j && "cursor-pointer",
270
+ H
233
271
  ),
234
- children: /* @__PURE__ */ r.jsxs("div", { ref: k, className: u("flex items-center relative w-max max-w-full", s && "w-full"), children: [
235
- /* @__PURE__ */ r.jsxs(
272
+ children: /* @__PURE__ */ n.jsxs("div", { ref: R, className: m("flex items-center relative w-max max-w-full", o && "w-full"), children: [
273
+ /* @__PURE__ */ n.jsxs(
236
274
  "div",
237
275
  {
238
- style: { left: Z, width: w[p] },
239
- className: u(
240
- $({ size: i, color: m }),
241
- W && X,
276
+ style: d ? { left: k, right: ne } : { left: k },
277
+ className: m(
278
+ de({ size: c, color: y }),
279
+ z && ie,
242
280
  "overflow-hidden",
243
- s && "justify-center"
281
+ o && "justify-center",
282
+ J
244
283
  ),
245
- onClick: D,
284
+ onClick: ae,
246
285
  children: [
247
- G(),
248
- /* @__PURE__ */ r.jsx("span", { className: u("select-none", s ? "truncate min-w-0" : "text-nowrap"), children: K.label })
286
+ Z(te, m(a[y].icon, Q)),
287
+ E.label != null && /* @__PURE__ */ n.jsx("span", { className: m("select-none", o ? "truncate min-w-0" : "text-nowrap"), children: E.label })
249
288
  ]
250
289
  }
251
290
  ),
252
- n.map((e, l) => {
253
- const t = w[l];
254
- return /* @__PURE__ */ r.jsxs(
291
+ l.map((e, s) => {
292
+ const r = u[s], p = !!e.icon, t = /* @__PURE__ */ n.jsx(
255
293
  "span",
256
294
  {
257
- ref: (v) => {
258
- N.current[l] = v;
295
+ ref: (W) => {
296
+ x.current[s] = W;
259
297
  },
260
- onClick: () => h?.(c, e.value),
261
- style: d ? { width: t, minWidth: t, maxWidth: t } : void 0,
262
- className: u(
263
- ee({ size: i, color: m }),
264
- s ? "min-w-0 shrink-0" : "w-max shrink",
265
- W && Y,
266
- !g && "cursor-pointer",
298
+ onClick: () => N?.(h, e.value),
299
+ style: d ? { width: r, minWidth: r, maxWidth: r } : void 0,
300
+ className: m(
301
+ ue({ size: c, color: y }),
302
+ o ? "min-w-0 shrink-0" : "w-max shrink",
303
+ z && ce,
304
+ !j && "cursor-pointer",
267
305
  "flex gap-0.5 relative",
268
- s && d && "justify-center overflow-hidden"
306
+ o && d && "justify-center overflow-hidden",
307
+ M
269
308
  ),
270
- "aria-label": e.label,
271
- children: [
272
- /* @__PURE__ */ r.jsx("span", { className: "inline-block shrink-0", style: { width: j, height: j }, "aria-hidden": !0 }),
273
- s && d ? /* @__PURE__ */ r.jsx("span", { className: "truncate min-w-0", children: e.label }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
274
- /* @__PURE__ */ r.jsx("p", { className: "invisible", children: e.label }),
275
- /* @__PURE__ */ r.jsx("p", { className: "absolute left-1/2 -translate-x-1/2 truncate!", children: e.label })
309
+ "aria-label": e.ariaLabel ?? e.label,
310
+ children: p ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
311
+ Z(
312
+ e.icon,
313
+ m(a[y].optionIcon, U)
314
+ ),
315
+ e.label != null && (o && d ? /* @__PURE__ */ n.jsx("span", { className: "truncate min-w-0", children: e.label }) : /* @__PURE__ */ n.jsx("span", { className: "text-nowrap", children: e.label }))
316
+ ] }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
317
+ /* @__PURE__ */ n.jsx(
318
+ "span",
319
+ {
320
+ className: "inline-block shrink-0",
321
+ style: { width: I, height: I },
322
+ "aria-hidden": !0
323
+ }
324
+ ),
325
+ o && d ? /* @__PURE__ */ n.jsx("span", { className: "truncate min-w-0", children: e.label }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
326
+ /* @__PURE__ */ n.jsx("p", { className: "invisible", children: e.label }),
327
+ /* @__PURE__ */ n.jsx("p", { className: "absolute left-1/2 -translate-x-1/2 truncate!", children: e.label })
276
328
  ] })
277
- ]
278
- },
279
- e.value
329
+ ] })
330
+ }
280
331
  );
332
+ return e.tooltipText ? /* @__PURE__ */ n.jsx(re, { title: e.tooltipText, asChild: !0, children: t }, e.value) : /* @__PURE__ */ n.jsx(_.Fragment, { children: t }, e.value);
281
333
  })
282
334
  ] })
283
335
  }
284
336
  );
285
337
  };
286
338
  export {
287
- re as SegmentedButton,
288
- re as default
339
+ xe as SegmentedButton,
340
+ xe as default
289
341
  };
@@ -286,7 +286,7 @@ const pe = (e, t) => e.path === t || e.relatedPaths?.some((n) => n === "/" ? t =
286
286
  open: !g,
287
287
  onOpenChange: (f) => S(!f),
288
288
  disabled: A,
289
- children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col gap-2", id: l, children: [
289
+ children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col gap-0", id: l, children: [
290
290
  _,
291
291
  /* @__PURE__ */ i.jsx("div", { className: A || p ? "hidden" : "contents", children: T() })
292
292
  ] })