@vellira-ui/react 2.98.4 → 2.98.6

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/index.js CHANGED
@@ -55,8 +55,8 @@ function ce({ children: e, disabled: t = !1, contentId: n, expanded: r = !1, onA
55
55
  }
56
56
  //#endregion
57
57
  //#region src/components/Accordion/Root/AccordionRoot.tsx
58
- function le({ children: t, type: r = "single", value: i, defaultValue: s, onValueChange: c, collapsible: u = !1, disabled: f = !1 }) {
59
- let m = l(), h = i !== void 0, [_, v] = p(s ?? (r === "multiple" ? [] : "")), y = d(() => {
58
+ function le(t) {
59
+ let { children: r, value: i, defaultValue: s, disabled: c = !1 } = t, u = t.type ?? "single", f = t.type === "multiple" ? !1 : t.collapsible ?? !1, m = l(), h = i !== void 0, [_, v] = p(s ?? (u === "multiple" ? [] : "")), y = d(() => {
60
60
  let e = (h ? i : _) ?? [];
61
61
  return Array.isArray(e) ? e : e ? [e] : [];
62
62
  }, [
@@ -64,25 +64,29 @@ function le({ children: t, type: r = "single", value: i, defaultValue: s, onValu
64
64
  _,
65
65
  i
66
66
  ]), b = o((e) => {
67
- if (f) return;
68
- let t = y.includes(e), n;
69
- n = r === "multiple" ? t ? y.filter((t) => t !== e) : [...y, e] : t ? u ? [] : y : [e];
70
- let i = r === "multiple" ? n : n[0] ?? "";
71
- h || v(i), c?.(i);
67
+ if (c) return;
68
+ let n = y.includes(e);
69
+ if (t.type === "multiple") {
70
+ let r = n ? y.filter((t) => t !== e) : [...y, e];
71
+ h || v(r), t.onValueChange?.(r);
72
+ return;
73
+ }
74
+ let r = (n ? f ? [] : y : [e])[0] ?? "";
75
+ h || v(r), t.onValueChange?.(r);
72
76
  }, [
73
- u,
74
77
  f,
78
+ c,
75
79
  y,
76
80
  h,
77
- c,
78
- r
81
+ t.onValueChange,
82
+ t.type
79
83
  ]);
80
84
  return /* @__PURE__ */ g("div", {
81
85
  className: ae.root,
82
- "data-disabled": f || void 0,
83
- children: e.map(t, (t) => {
86
+ "data-disabled": c || void 0,
87
+ children: e.map(r, (t) => {
84
88
  if (!a(t) || t.type !== se) return t;
85
- let r = t, i = f || !!r.props.disabled, o = y.includes(r.props.value), s = `${m}-accordion-content-${r.props.value}`, c = e.map(r.props.children, (e) => a(e) ? e.type === ce ? n(e, {
89
+ let r = t, i = c || !!r.props.disabled, o = y.includes(r.props.value), s = `${m}-accordion-content-${r.props.value}`, l = e.map(r.props.children, (e) => a(e) ? e.type === ce ? n(e, {
86
90
  contentId: s,
87
91
  disabled: i,
88
92
  expanded: o,
@@ -93,7 +97,7 @@ function le({ children: t, type: r = "single", value: i, defaultValue: s, onValu
93
97
  }) : e : e);
94
98
  return n(r, {
95
99
  className: `${ae.item} ${o ? ae.expanded : ""}`,
96
- children: c
100
+ children: l
97
101
  });
98
102
  })
99
103
  });
@@ -2322,28 +2326,28 @@ function Gn() {
2322
2326
  return s(Un);
2323
2327
  }
2324
2328
  var Kn = {
2325
- root: "_root_7yrws_1",
2326
- invalid: "_invalid_7yrws_34",
2327
- control: "_control_7yrws_34",
2328
- label: "_label_7yrws_37",
2329
- wrapper: "_wrapper_7yrws_40",
2330
- input: "_input_7yrws_41",
2331
- disabled: "_disabled_7yrws_44",
2332
- description: "_description_7yrws_52",
2333
- colorPrimary: "_colorPrimary_7yrws_56",
2334
- colorNeutral: "_colorNeutral_7yrws_72",
2335
- colorSuccess: "_colorSuccess_7yrws_88",
2336
- colorWarning: "_colorWarning_7yrws_104",
2337
- colorDanger: "_colorDanger_7yrws_120",
2338
- sm: "_sm_7yrws_136",
2339
- md: "_md_7yrws_145",
2340
- lg: "_lg_7yrws_154",
2341
- indicator: "_indicator_7yrws_209",
2342
- customIcon: "_customIcon_7yrws_223",
2343
- "radio-pop": "_radio-pop_7yrws_1",
2344
- "radio-indicator-in": "_radio-indicator-in_7yrws_1",
2345
- content: "_content_7yrws_346",
2346
- error: "_error_7yrws_363"
2329
+ root: "_root_goond_1",
2330
+ invalid: "_invalid_goond_34",
2331
+ control: "_control_goond_34",
2332
+ label: "_label_goond_37",
2333
+ wrapper: "_wrapper_goond_40",
2334
+ input: "_input_goond_41",
2335
+ disabled: "_disabled_goond_44",
2336
+ description: "_description_goond_52",
2337
+ colorPrimary: "_colorPrimary_goond_56",
2338
+ colorNeutral: "_colorNeutral_goond_72",
2339
+ colorSuccess: "_colorSuccess_goond_88",
2340
+ colorWarning: "_colorWarning_goond_104",
2341
+ colorDanger: "_colorDanger_goond_120",
2342
+ sm: "_sm_goond_136",
2343
+ md: "_md_goond_145",
2344
+ lg: "_lg_goond_154",
2345
+ indicator: "_indicator_goond_209",
2346
+ customIcon: "_customIcon_goond_223",
2347
+ "radio-pop": "_radio-pop_goond_1",
2348
+ "radio-indicator-in": "_radio-indicator-in_goond_1",
2349
+ content: "_content_goond_346",
2350
+ error: "_error_goond_363"
2347
2351
  }, qn = {
2348
2352
  primary: Kn.colorPrimary,
2349
2353
  neutral: Kn.colorNeutral,
@@ -4287,8 +4291,8 @@ function Di() {
4287
4291
  return s(Ci);
4288
4292
  }
4289
4293
  var Oi = {
4290
- tooltip: "_tooltip_raj0t_1",
4291
- arrow: "_arrow_raj0t_25"
4294
+ tooltip: "_tooltip_god78_1",
4295
+ arrow: "_arrow_god78_25"
4292
4296
  }, ki = i(({ children: e, forceMount: t = !1, withArrow: n = !1, className: r, style: i, ...a }, o) => {
4293
4297
  let s = Ei();
4294
4298
  if (!t && !s.open) return null;
@@ -4312,19 +4316,20 @@ var Oi = {
4312
4316
  });
4313
4317
  ki.displayName = "Tooltip.Content";
4314
4318
  function Ai() {
4315
- let e = Ei(), t = {
4319
+ let e = Ei(), t = e.placement.split("-")[0], n = {
4316
4320
  top: "bottom",
4317
4321
  right: "left",
4318
4322
  bottom: "top",
4319
4323
  left: "right"
4320
- }[e.placement.split("-")[0]];
4324
+ }[t];
4321
4325
  return /* @__PURE__ */ g("div", {
4322
4326
  ref: e.arrowRef,
4323
4327
  className: Oi.arrow,
4328
+ "data-side": t,
4324
4329
  style: {
4325
4330
  left: e.arrowX == null ? void 0 : `${e.arrowX}px`,
4326
4331
  top: e.arrowY == null ? void 0 : `${e.arrowY}px`,
4327
- [t]: "calc(var(--tooltip-arrow-size) / -2)"
4332
+ [n]: "calc(var(--tooltip-arrow-size) / -2)"
4328
4333
  }
4329
4334
  });
4330
4335
  }