@vincisys/eyeson 0.4.10 → 0.4.11

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.
@@ -2,7 +2,7 @@ import { type LucideIcon } from 'lucide-react';
2
2
  import { type ChangeEvent, type ComponentProps } from 'react';
3
3
  import { type FieldLabelVariant, type FieldSize } from '../../lib/field-styles';
4
4
  export type InputState = 'default' | 'valid' | 'loading' | 'invalid';
5
- export type InputFormat = 'cep' | 'cpf' | 'cnpj' | 'cpfOrCnpj' | 'phone';
5
+ export type InputFormat = 'cep' | 'cpf' | 'cnpj' | 'cpfOrCnpj' | 'phone' | 'currency';
6
6
  export type InputSize = FieldSize;
7
7
  /** @deprecated Use `FieldLabelVariant` from the shared field styles. */
8
8
  export type InputLabelVariant = FieldLabelVariant;
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAmB,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAQ/E,OAAO,EAWN,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,MAAM,wBAAwB,CAAC;AAGhC,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;AACzE,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAClC,wEAAwE;AACxE,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAWlD,MAAM,MAAM,UAAU,GAAG,IAAI,CAC5B,cAAc,CAAC,OAAO,CAAC,EACvB,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CACvD,GAAG;IACH,SAAS,C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,OAAc,EACd,WAAkB,EAClB,cAAqB,EACrB,cAAmB,EACnB,IAAY,EACZ,YAAY,EACZ,aAAa,EACb,mBAA2B,EAC3B,SAAiB,EACjB,mBAA2B,EAC3B,IAAI,EAAE,IAAI,EACV,YAAY,EACZ,KAAK,EACL,EAAE,EACF,IAAI,EACJ,MAAM,EACN,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACR,EAAE,UAAU,+BAyNZ"}
package/dist/index.js CHANGED
@@ -3049,25 +3049,39 @@ var $n = /\D/g, er = function(e) {
3049
3049
  return ir(e) ? rr(e) : nr(e);
3050
3050
  }, or = function(e) {
3051
3051
  return er(e).replace(/(\d{1,2})/, "($1").replace(/(\(\d{2})(\d{1,4})/, "$1) $2").replace(/( \d{4})(\d{1,4})/, "$1-$2").replace(/( \d{4})(?:-)(\d{1})(\d{4})/, "$1$2-$3");
3052
- }, sr = {
3052
+ };
3053
+ //#endregion
3054
+ //#region src/components/Input/Input.tsx
3055
+ function sr(e, t = !1) {
3056
+ let n = e.trim();
3057
+ if (!n) return "";
3058
+ let r = n.startsWith("-"), i = n.replace(/[^\d,]/g, "");
3059
+ if (!i) return r ? "-" : "";
3060
+ let a = i.indexOf(","), o, s;
3061
+ a === -1 ? o = i : (o = i.slice(0, a) || "0", s = i.slice(a + 1).replace(/,/g, "").slice(0, 2)), o = o.replace(/^0+(?=\d)/, "");
3062
+ let c = o.replace(/\B(?=(\d{3})+(?!\d))/g, "."), l = r ? "-" : "";
3063
+ return t ? `${l}${c},${(s ?? "").padEnd(2, "0").slice(0, 2)}` : a === -1 ? `${l}${c}` : `${l}${c},${s ?? ""}`;
3064
+ }
3065
+ var cr = {
3053
3066
  default: "",
3054
3067
  valid: "not-focus-within:border-[color-mix(in_srgb,var(--color-eds-green-main)_55%,var(--color-eds-outline-border))]",
3055
3068
  invalid: "not-focus-within:border-[color-mix(in_srgb,var(--color-eds-red-main)_55%,var(--color-eds-outline-border))]",
3056
3069
  loading: "not-focus-within:border-[color-mix(in_srgb,var(--color-eds-blue-main)_45%,var(--color-eds-outline-border))]"
3057
3070
  };
3058
- function cr({ className: e, label: t = "Label", disabled: n = !1, state: r = "default", size: i = "md", inputType: a = "text", required: o = !1, placeholder: l = "Digite algo...", errorMessage: u = "Campo obrigatório", fluid: d = !1, format: f, tooltip: h = null, linkText: g = null, linkUrl: _ = null, supportLink: v = null, supportLinkUrl: y = null, supportingText: b = "", lazy: S = !1, labelVariant: C, floatingLabel: w, disableAutocomplete: T = !1, isLoading: E = !1, loadingIconPosition: D = "end", icon: O, defaultValue: k, value: A, id: j, name: N, onBlur: P, onFocus: F, onKeyDown: I, onClick: L, onChange: R, ...z }) {
3059
- let ne = ee(), re = j ?? ne, [B, ie] = x(() => k?.toString() ?? ""), V = A !== void 0, ae = (V ? A : B)?.toString() ?? "", H = v ?? g, U = y ?? _, W = Jt(C, w), G = W === "floating", oe = (e) => {
3071
+ function lr({ className: e, label: t = "Label", disabled: n = !1, state: r = "default", size: i = "md", inputType: a = "text", required: o = !1, placeholder: l = "Digite algo...", errorMessage: u = "Campo obrigatório", fluid: d = !1, format: f, tooltip: h = null, linkText: g = null, linkUrl: _ = null, supportLink: v = null, supportLinkUrl: y = null, supportingText: b = "", lazy: S = !1, labelVariant: C, floatingLabel: w, disableAutocomplete: T = !1, isLoading: E = !1, loadingIconPosition: D = "end", icon: O, defaultValue: k, value: A, id: j, name: N, onBlur: P, onFocus: F, onKeyDown: I, onClick: L, onChange: R, ...z }) {
3072
+ let ne = ee(), re = j ?? ne, [B, ie] = x(() => k?.toString() ?? ""), V = A !== void 0, ae = (V ? A : B)?.toString() ?? "", H = v ?? g, U = y ?? _, W = Jt(C, w), G = W === "floating", oe = (e, t = !1) => {
3060
3073
  switch (f) {
3061
3074
  case "cep": return tr(e);
3062
3075
  case "cpf": return rr(e);
3063
3076
  case "cnpj": return nr(e);
3064
3077
  case "cpfOrCnpj": return ar(e);
3065
3078
  case "phone": return or(e);
3079
+ case "currency": return sr(e, t);
3066
3080
  default: return e;
3067
3081
  }
3068
- }, K = (e, t) => {
3069
- let n = oe(e);
3070
- V || ie(n), R?.(n, t);
3082
+ }, K = (e, t, n = !1) => {
3083
+ let r = oe(e, n);
3084
+ V || ie(r), R?.(r, t);
3071
3085
  }, q = r === "invalid", J = n || E, se = Yt[i], ce = E ? /* @__PURE__ */ p("span", {
3072
3086
  className: "inline-flex shrink-0 items-center justify-center text-eds-blue-main",
3073
3087
  "data-position": D,
@@ -3117,7 +3131,7 @@ function cr({ className: e, label: t = "Label", disabled: n = !1, state: r = "de
3117
3131
  })]
3118
3132
  }),
3119
3133
  /* @__PURE__ */ m("div", {
3120
- className: M("group relative inline-flex w-full items-center gap-2 rounded-eds-xs border border-eds-outline-border bg-white", se.control, sr[r], "focus-within:border-[color-mix(in_srgb,var(--color-eds-neutral-elements)_35%,var(--color-eds-outline-border))] focus-within:shadow-[0_0_0_3px_var(--color-eds-outline-focus-ring)]", "data-disabled:cursor-not-allowed data-disabled:border-eds-outline-border data-disabled:bg-eds-neutral-background data-disabled:opacity-70"),
3134
+ className: M("group relative inline-flex w-full items-center gap-2 rounded-eds-xs border border-eds-outline-border bg-white", se.control, cr[r], "focus-within:border-[color-mix(in_srgb,var(--color-eds-neutral-elements)_35%,var(--color-eds-outline-border))] focus-within:shadow-[0_0_0_3px_var(--color-eds-outline-focus-ring)]", "data-disabled:cursor-not-allowed data-disabled:border-eds-outline-border data-disabled:bg-eds-neutral-background data-disabled:opacity-70"),
3121
3135
  "data-disabled": J || void 0,
3122
3136
  "data-state": r,
3123
3137
  "data-size": i,
@@ -3151,16 +3165,20 @@ function cr({ className: e, label: t = "Label", disabled: n = !1, state: r = "de
3151
3165
  "aria-invalid": q || void 0,
3152
3166
  "aria-describedby": q ? `${re}-desc` : void 0,
3153
3167
  "aria-busy": E || void 0,
3154
- value: V ? A : void 0,
3155
- defaultValue: V ? void 0 : k,
3168
+ value: V || f ? ae : void 0,
3169
+ defaultValue: !V && !f ? k : void 0,
3156
3170
  onClick: L,
3157
3171
  onKeyDown: I,
3158
3172
  onFocus: F,
3159
3173
  onBlur: (e) => {
3160
- P?.(e), S && K(e.currentTarget.value, e);
3174
+ f === "currency" ? K(e.currentTarget.value, e, !0) : S && K(e.currentTarget.value, e), P?.(e);
3161
3175
  },
3162
3176
  onChange: (e) => {
3163
- S || K(e.currentTarget.value, e);
3177
+ if (S) {
3178
+ f && !V && ie(oe(e.currentTarget.value));
3179
+ return;
3180
+ }
3181
+ K(e.currentTarget.value, e);
3164
3182
  }
3165
3183
  }),
3166
3184
  D === "end" && ce
@@ -3177,16 +3195,16 @@ function cr({ className: e, label: t = "Label", disabled: n = !1, state: r = "de
3177
3195
  }
3178
3196
  //#endregion
3179
3197
  //#region src/components/Textarea/Textarea.tsx
3180
- var lr = {
3198
+ var ur = {
3181
3199
  default: "",
3182
3200
  valid: "not-focus-within:border-[color-mix(in_srgb,var(--color-eds-green-main)_55%,var(--color-eds-outline-border))]",
3183
3201
  invalid: "not-focus-within:border-[color-mix(in_srgb,var(--color-eds-red-main)_55%,var(--color-eds-outline-border))]"
3184
- }, ur = {
3202
+ }, dr = {
3185
3203
  sm: "min-h-20",
3186
3204
  md: "min-h-24",
3187
3205
  lg: "min-h-32"
3188
3206
  };
3189
- function dr({ className: e, label: t = "Label", disabled: n = !1, state: r = "default", size: i = "md", required: a = !1, placeholder: o = "Digite algo...", errorMessage: c = "Campo obrigatório", fluid: l = !1, tooltip: u = null, supportLink: d = null, supportLinkUrl: f = null, supportingText: h = "", labelVariant: g, floatingLabel: _, rows: v = 4, defaultValue: y, value: b, id: S, name: C, onBlur: w, onFocus: T, onKeyDown: E, onClick: D, onChange: O, ...k }) {
3207
+ function fr({ className: e, label: t = "Label", disabled: n = !1, state: r = "default", size: i = "md", required: a = !1, placeholder: o = "Digite algo...", errorMessage: c = "Campo obrigatório", fluid: l = !1, tooltip: u = null, supportLink: d = null, supportLinkUrl: f = null, supportingText: h = "", labelVariant: g, floatingLabel: _, rows: v = 4, defaultValue: y, value: b, id: S, name: C, onBlur: w, onFocus: T, onKeyDown: E, onClick: D, onChange: O, ...k }) {
3190
3208
  let te = ee(), A = S ?? te, [j, N] = x(() => y?.toString() ?? ""), P = b !== void 0, F = (P ? b : j)?.toString() ?? "", I = Jt(g, _), L = I === "floating", R = r === "invalid", z = Yt[i];
3191
3209
  return /* @__PURE__ */ m("div", {
3192
3210
  className: M(Xt, e),
@@ -3228,7 +3246,7 @@ function dr({ className: e, label: t = "Label", disabled: n = !1, state: r = "de
3228
3246
  })]
3229
3247
  }),
3230
3248
  /* @__PURE__ */ m("div", {
3231
- className: M("group relative flex w-full flex-col rounded-eds-xs border border-eds-outline-border !bg-white", z.paddingX, "py-2.5", ur[i], lr[r], "focus-within:border-[color-mix(in_srgb,var(--color-eds-neutral-elements)_35%,var(--color-eds-outline-border))] focus-within:shadow-[0_0_0_3px_var(--color-eds-outline-focus-ring)]", "data-disabled:cursor-not-allowed data-disabled:border-eds-outline-border data-disabled:!bg-eds-neutral-background data-disabled:opacity-70"),
3249
+ className: M("group relative flex w-full flex-col rounded-eds-xs border border-eds-outline-border !bg-white", z.paddingX, "py-2.5", dr[i], ur[r], "focus-within:border-[color-mix(in_srgb,var(--color-eds-neutral-elements)_35%,var(--color-eds-outline-border))] focus-within:shadow-[0_0_0_3px_var(--color-eds-outline-focus-ring)]", "data-disabled:cursor-not-allowed data-disabled:border-eds-outline-border data-disabled:!bg-eds-neutral-background data-disabled:opacity-70"),
3232
3250
  "data-disabled": n || void 0,
3233
3251
  "data-state": r,
3234
3252
  "data-size": i,
@@ -3274,12 +3292,12 @@ function dr({ className: e, label: t = "Label", disabled: n = !1, state: r = "de
3274
3292
  }
3275
3293
  //#endregion
3276
3294
  //#region src/components/Select/Select.tsx
3277
- var fr = {
3295
+ var pr = {
3278
3296
  default: "",
3279
3297
  valid: "not-focus-visible:border-[color-mix(in_srgb,var(--color-eds-green-main)_55%,var(--color-eds-outline-border))]",
3280
3298
  invalid: "not-focus-visible:border-[color-mix(in_srgb,var(--color-eds-red-main)_55%,var(--color-eds-outline-border))]"
3281
3299
  };
3282
- function pr({ label: e = "Label", labelVariant: t, floatingLabel: n, items: a, placeholder: o = "Selecione uma opção", disabled: s = !1, required: c = !1, fluid: l = !1, state: u = "default", size: d = "md", supportingText: f = "", errorMessage: h = "Selecione uma opção válida", id: g, name: _, value: v = void 0, defaultValue: y = void 0, onValueChange: b = void 0, renderItem: x = void 0, className: S }) {
3300
+ function mr({ label: e = "Label", labelVariant: t, floatingLabel: n, items: a, placeholder: o = "Selecione uma opção", disabled: s = !1, required: c = !1, fluid: l = !1, state: u = "default", size: d = "md", supportingText: f = "", errorMessage: h = "Selecione uma opção válida", id: g, name: _, value: v = void 0, defaultValue: y = void 0, onValueChange: b = void 0, renderItem: x = void 0, className: S }) {
3283
3301
  let C = ee(), w = g ?? C, T = u === "invalid", E = T || f, D = Yt[d], O = Jt(t, n), k = O === "floating";
3284
3302
  return /* @__PURE__ */ m("div", {
3285
3303
  className: M(Xt, S),
@@ -3307,7 +3325,7 @@ function pr({ label: e = "Label", labelVariant: t, floatingLabel: n, items: a, p
3307
3325
  defaultValue: y,
3308
3326
  value: v,
3309
3327
  children: [/* @__PURE__ */ m(A.Trigger, {
3310
- className: M("group relative box-border inline-flex w-full cursor-pointer items-center gap-2 rounded-eds-xs border border-eds-outline-border bg-white py-0", D.trigger, fr[u], "focus-visible:border-[color-mix(in_srgb,var(--color-eds-neutral-elements)_35%,var(--color-eds-outline-border))] focus-visible:shadow-[0_0_0_3px_var(--color-eds-outline-focus-ring)] focus-visible:outline-none", "data-disabled:cursor-not-allowed data-disabled:border-eds-outline-border data-disabled:bg-eds-neutral-background data-disabled:opacity-70"),
3328
+ className: M("group relative box-border inline-flex w-full cursor-pointer items-center gap-2 rounded-eds-xs border border-eds-outline-border bg-white py-0", D.trigger, pr[u], "focus-visible:border-[color-mix(in_srgb,var(--color-eds-neutral-elements)_35%,var(--color-eds-outline-border))] focus-visible:shadow-[0_0_0_3px_var(--color-eds-outline-focus-ring)] focus-visible:outline-none", "data-disabled:cursor-not-allowed data-disabled:border-eds-outline-border data-disabled:bg-eds-neutral-background data-disabled:opacity-70"),
3311
3329
  "data-state": u,
3312
3330
  "data-size": d,
3313
3331
  "data-disabled": s || void 0,
@@ -3372,7 +3390,7 @@ function pr({ label: e = "Label", labelVariant: t, floatingLabel: n, items: a, p
3372
3390
  }
3373
3391
  //#endregion
3374
3392
  //#region src/components/Text/Text.tsx
3375
- var mr = {
3393
+ var hr = {
3376
3394
  variant: {
3377
3395
  heading1: {
3378
3396
  classes: "text-3xl font-semibold",
@@ -3429,20 +3447,20 @@ var mr = {
3429
3447
  description: "Large text"
3430
3448
  }
3431
3449
  }
3432
- }, hr = {
3450
+ }, gr = {
3433
3451
  variant: "body",
3434
3452
  size: "md"
3435
- }, gr = /* @__PURE__ */ new Set([
3453
+ }, _r = /* @__PURE__ */ new Set([
3436
3454
  "heading1",
3437
3455
  "heading2",
3438
3456
  "heading3"
3439
- ]), _r = /* @__PURE__ */ new Set(["mono", "mono-secondary"]);
3440
- function vr({ variant: e = "body", bold: t = !1, size: n = "md", truncate: r = !1, children: i, className: a, as: o, ...s }, c) {
3441
- let l = _r.has(e), u = gr.has(e), d = y(() => o || (l || u ? "span" : "p"), [
3457
+ ]), vr = /* @__PURE__ */ new Set(["mono", "mono-secondary"]);
3458
+ function yr({ variant: e = "body", bold: t = !1, size: n = "md", truncate: r = !1, children: i, className: a, as: o, ...s }, c) {
3459
+ let l = vr.has(e), u = _r.has(e), d = y(() => o || (l || u ? "span" : "p"), [
3442
3460
  o,
3443
3461
  l,
3444
3462
  u
3445
- ]), f = N(mr.variant, e, hr.variant), m = N(mr.size, n ?? "md", hr.size);
3463
+ ]), f = N(hr.variant, e, gr.variant), m = N(hr.size, n ?? "md", gr.size);
3446
3464
  return /* @__PURE__ */ p(d, {
3447
3465
  ref: c,
3448
3466
  "data-eds-component": "Text",
@@ -3451,7 +3469,7 @@ function vr({ variant: e = "body", bold: t = !1, size: n = "md", truncate: r = !
3451
3469
  children: i
3452
3470
  });
3453
3471
  }
3454
- var yr = g(vr), br = {
3472
+ var br = g(yr), xr = {
3455
3473
  layout: {
3456
3474
  auto: {
3457
3475
  classes: "",
@@ -3482,14 +3500,14 @@ var yr = g(vr), br = {
3482
3500
  description: "Pin column to the right edge of the scroll container"
3483
3501
  }
3484
3502
  }
3485
- }, xr = (e, t) => {
3486
- let n = N(br.sticky, e, "left").classes, r = t === "head" ? "z-2" : "z-1", i = e === "right" ? "before:-left-6" : "before:-right-6", a = "before:pointer-events-none before:absolute before:inset-y-0 before:w-6";
3503
+ }, Sr = (e, t) => {
3504
+ let n = N(xr.sticky, e, "left").classes, r = t === "head" ? "z-2" : "z-1", i = e === "right" ? "before:-left-6" : "before:-right-6", a = "before:pointer-events-none before:absolute before:inset-y-0 before:w-6";
3487
3505
  return t === "cell" ? M(n, r, "bg-white", a, i, e === "right" ? "before:bg-gradient-to-r before:from-transparent before:to-white" : "before:bg-gradient-to-l before:from-transparent before:to-white") : M(n, r, "bg-white group-data-[compact]/header:bg-eds-neutral-background", a, i, e === "right" ? "before:bg-gradient-to-r before:from-transparent before:to-white group-data-[compact]/header:before:to-eds-neutral-background" : "before:bg-gradient-to-l before:from-transparent before:to-white group-data-[compact]/header:before:to-eds-neutral-background");
3488
- }, Sr = {
3506
+ }, Cr = {
3489
3507
  layout: "auto",
3490
3508
  variant: "default"
3491
- }, Cr = g(({ layout: e = "auto", className: t, containerClassName: n, ...r }, i) => {
3492
- let a = M("isolate w-full", N(br.layout, e, Sr.layout).classes, "[&_td]:border-b [&_td]:border-eds-neutral-disabled [&_tr:last-child_td]:border-b-0", "[&_td]:p-3", "[&_th]:border-b [&_th]:border-eds-neutral-disabled [&_th]:p-3 [&_th]:font-semibold [&_th]:text-base", "[&_th]:bg-white", "text-base text-left text-eds-neutral-main", t);
3509
+ }, wr = g(({ layout: e = "auto", className: t, containerClassName: n, ...r }, i) => {
3510
+ let a = M("isolate w-full", N(xr.layout, e, Cr.layout).classes, "[&_td]:border-b [&_td]:border-eds-neutral-disabled [&_tr:last-child_td]:border-b-0", "[&_td]:p-3", "[&_th]:border-b [&_th]:border-eds-neutral-disabled [&_th]:p-3 [&_th]:font-semibold [&_th]:text-base", "[&_th]:bg-white", "text-base text-left text-eds-neutral-main", t);
3493
3511
  return /* @__PURE__ */ p("div", {
3494
3512
  className: M("w-full overflow-x-auto rounded-eds-xs border border-eds-outline-border bg-white", n),
3495
3513
  children: /* @__PURE__ */ p("table", {
@@ -3499,7 +3517,7 @@ var yr = g(vr), br = {
3499
3517
  className: a
3500
3518
  })
3501
3519
  });
3502
- }), wr = g(({ variant: e = "default", sticky: t, ...n }, r) => {
3520
+ }), Tr = g(({ variant: e = "default", sticky: t, ...n }, r) => {
3503
3521
  let i = e === "compact", a = M("group/header", i && "[&_th]:bg-eds-neutral-background [&_th]:py-2 text-xs text-eds-neutral-elements", t && "[&_th]:sticky [&_th]:top-0 [&_th]:z-1", n.className);
3504
3522
  return /* @__PURE__ */ p("thead", {
3505
3523
  ref: r,
@@ -3507,41 +3525,41 @@ var yr = g(vr), br = {
3507
3525
  className: a,
3508
3526
  ...i && { "data-compact": "" }
3509
3527
  });
3510
- }), Tr = g(({ sticky: e, ...t }, n) => {
3511
- let r = M("group relative", e && xr(e, "head"), t.className);
3528
+ }), Er = g(({ sticky: e, ...t }, n) => {
3529
+ let r = M("group relative", e && Sr(e, "head"), t.className);
3512
3530
  return /* @__PURE__ */ p("th", {
3513
3531
  ref: n,
3514
3532
  ...t,
3515
3533
  className: r
3516
3534
  });
3517
- }), Er = g(({ variant: e = Sr.variant, ...t }, n) => {
3518
- let r = M(N(br.variant, e, Sr.variant).classes, t.className);
3535
+ }), Dr = g(({ variant: e = Cr.variant, ...t }, n) => {
3536
+ let r = M(N(xr.variant, e, Cr.variant).classes, t.className);
3519
3537
  return /* @__PURE__ */ p("tr", {
3520
3538
  ref: n,
3521
3539
  ...t,
3522
3540
  className: r
3523
3541
  });
3524
- }), Dr = g((e, t) => /* @__PURE__ */ p("tbody", {
3542
+ }), Or = g((e, t) => /* @__PURE__ */ p("tbody", {
3525
3543
  ref: t,
3526
3544
  ...e
3527
- })), Or = g(({ sticky: e, ...t }, n) => {
3528
- let r = M(e && xr(e, "cell"), t.className);
3545
+ })), kr = g(({ sticky: e, ...t }, n) => {
3546
+ let r = M(e && Sr(e, "cell"), t.className);
3529
3547
  return /* @__PURE__ */ p("td", {
3530
3548
  ref: n,
3531
3549
  ...t,
3532
3550
  className: r
3533
3551
  });
3534
- }), kr = g((e, t) => /* @__PURE__ */ p("tfoot", {
3552
+ }), Ar = g((e, t) => /* @__PURE__ */ p("tfoot", {
3535
3553
  ref: t,
3536
3554
  ...e
3537
- })), Ar = g((e, t) => /* @__PURE__ */ p("button", {
3555
+ })), jr = g((e, t) => /* @__PURE__ */ p("button", {
3538
3556
  ref: t,
3539
3557
  ...e,
3540
3558
  type: "button",
3541
3559
  "aria-label": "Redimensionar coluna",
3542
3560
  className: M("opacity-0 h-full group-hover:opacity-100 focus-visible:opacity-100", "w-[10px]", "flex items-center justify-center", "cursor-col-resize touch-none select-none", "absolute top-0 right-0", "m-0 bg-white p-0", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-eds-blue-main", e.className),
3543
3561
  children: /* @__PURE__ */ p("span", { className: "h-5 w-[2px] rounded bg-eds-neutral-disabled" })
3544
- })), jr = g(({ checked: e, indeterminate: t, onCheckedChange: n, label: r, disabled: i, ...a }, o) => /* @__PURE__ */ p(Or, {
3562
+ })), Mr = g(({ checked: e, indeterminate: t, onCheckedChange: n, label: r, disabled: i, ...a }, o) => /* @__PURE__ */ p(kr, {
3545
3563
  ref: o,
3546
3564
  ...a,
3547
3565
  className: M("w-10 leading-none", a.className),
@@ -3553,7 +3571,7 @@ var yr = g(vr), br = {
3553
3571
  disabled: i,
3554
3572
  className: "relative before:absolute before:-inset-3 before:content-['']"
3555
3573
  })
3556
- })), Mr = g(({ checked: e, indeterminate: t, onCheckedChange: n, label: r, disabled: i, ...a }, o) => /* @__PURE__ */ p(Tr, {
3574
+ })), Nr = g(({ checked: e, indeterminate: t, onCheckedChange: n, label: r, disabled: i, ...a }, o) => /* @__PURE__ */ p(Er, {
3557
3575
  ref: o,
3558
3576
  ...a,
3559
3577
  className: M("w-10 leading-none", a.className),
@@ -3566,23 +3584,23 @@ var yr = g(vr), br = {
3566
3584
  className: "relative before:absolute before:-inset-3 before:content-['']"
3567
3585
  })
3568
3586
  }));
3569
- Cr.displayName = "Table", Dr.displayName = "Table.Body", Tr.displayName = "Table.Head", Er.displayName = "Table.Row", Or.displayName = "Table.Cell", kr.displayName = "Table.Footer", wr.displayName = "Table.Header", Ar.displayName = "Table.ResizeHandle", jr.displayName = "Table.CheckCell", Mr.displayName = "Table.CheckHead";
3570
- var Nr = Object.assign(Cr, {
3571
- Header: wr,
3572
- Head: Tr,
3573
- Row: Er,
3574
- Body: Dr,
3575
- Cell: Or,
3576
- CheckCell: jr,
3577
- CheckHead: Mr,
3578
- Footer: kr,
3579
- ResizeHandle: Ar
3580
- }), Pr = {
3587
+ wr.displayName = "Table", Or.displayName = "Table.Body", Er.displayName = "Table.Head", Dr.displayName = "Table.Row", kr.displayName = "Table.Cell", Ar.displayName = "Table.Footer", Tr.displayName = "Table.Header", jr.displayName = "Table.ResizeHandle", Mr.displayName = "Table.CheckCell", Nr.displayName = "Table.CheckHead";
3588
+ var Pr = Object.assign(wr, {
3589
+ Header: Tr,
3590
+ Head: Er,
3591
+ Row: Dr,
3592
+ Body: Or,
3593
+ Cell: kr,
3594
+ CheckCell: Mr,
3595
+ CheckHead: Nr,
3596
+ Footer: Ar,
3597
+ ResizeHandle: jr
3598
+ }), Fr = {
3581
3599
  variant: "segmented",
3582
3600
  size: "md"
3583
3601
  };
3584
- function Fr({ tabs: e, value: t, selectedValue: n, onValueChange: r, activateOnFocus: i, className: a, listClassName: o, indicatorClassName: s, variant: c = Pr.variant, size: l = Pr.size }) {
3585
- let u = e ?? [], d = c === "segmented", f = c === "underline", h = l === "sm", { ref: g, isOverflowing: _ } = Lr(d), v = Ir(g, _);
3602
+ function Ir({ tabs: e, value: t, selectedValue: n, onValueChange: r, activateOnFocus: i, className: a, listClassName: o, indicatorClassName: s, variant: c = Fr.variant, size: l = Fr.size }) {
3603
+ let u = e ?? [], d = c === "segmented", f = c === "underline", h = l === "sm", { ref: g, isOverflowing: _ } = Rr(d), v = Lr(g, _);
3586
3604
  if (u.length === 0) return null;
3587
3605
  let ee = u[0]?.value, y = t !== void 0, b = {
3588
3606
  value: y ? t : void 0,
@@ -3620,7 +3638,7 @@ function Fr({ tabs: e, value: t, selectedValue: n, onValueChange: r, activateOnF
3620
3638
  })]
3621
3639
  });
3622
3640
  }
3623
- function Ir(e, t) {
3641
+ function Lr(e, t) {
3624
3642
  let n = b(null), r = b(!1);
3625
3643
  return () => ({
3626
3644
  onPointerDownCapture: (i) => {
@@ -3657,7 +3675,7 @@ function Ir(e, t) {
3657
3675
  }
3658
3676
  });
3659
3677
  }
3660
- function Lr(e) {
3678
+ function Rr(e) {
3661
3679
  let t = b(null), [n, r] = x(!1);
3662
3680
  return v(() => {
3663
3681
  if (!e) return;
@@ -3671,4 +3689,4 @@ function Lr(e) {
3671
3689
  };
3672
3690
  }
3673
3691
  //#endregion
3674
- export { Wt as Attachment, Vt as AttachmentAction, Bt as AttachmentActions, Lt as AttachmentContent, zt as AttachmentDescription, Ut as AttachmentGroup, It as AttachmentMedia, Rt as AttachmentTitle, Ht as AttachmentTrigger, z as Button, ne as COLORS, wt as Calendar, Mt as Card, qt as Checkbox, mn as Combobox, yn as DatePicker, Dn as DateTimePicker, Vn as Dialog, Qn as Empty, Yn as FormDialog, xt as IconButton, cr as Input, pr as Select, Nr as Table, Fr as Tabs, yr as Text, dr as Textarea };
3692
+ export { Wt as Attachment, Vt as AttachmentAction, Bt as AttachmentActions, Lt as AttachmentContent, zt as AttachmentDescription, Ut as AttachmentGroup, It as AttachmentMedia, Rt as AttachmentTitle, Ht as AttachmentTrigger, z as Button, ne as COLORS, wt as Calendar, Mt as Card, qt as Checkbox, mn as Combobox, yn as DatePicker, Dn as DateTimePicker, Vn as Dialog, Qn as Empty, Yn as FormDialog, xt as IconButton, lr as Input, mr as Select, Pr as Table, Ir as Tabs, br as Text, fr as Textarea };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vincisys/eyeson",
3
3
  "private": false,
4
- "version": "0.4.10",
4
+ "version": "0.4.11",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"