@vellira-ui/react 2.94.0 → 2.95.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +22 -15
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,13 +7,13 @@ import { createPortal as N } from "react-dom";
|
|
|
7
7
|
import { FloatingArrow as P, arrow as F, autoUpdate as I, flip as L, offset as R, shift as z, size as B, useFloating as V, useFocus as H, useHover as U, useInteractions as W } from "@floating-ui/react";
|
|
8
8
|
import { controlSizes as ee, lightTheme as te } from "@vellira-ui/tokens";
|
|
9
9
|
var ne = {
|
|
10
|
-
root: "
|
|
11
|
-
item: "
|
|
12
|
-
trigger: "
|
|
13
|
-
indicator: "
|
|
14
|
-
expanded: "
|
|
15
|
-
content: "
|
|
16
|
-
contentInner: "
|
|
10
|
+
root: "_root_n1iaz_1",
|
|
11
|
+
item: "_item_n1iaz_11",
|
|
12
|
+
trigger: "_trigger_n1iaz_15",
|
|
13
|
+
indicator: "_indicator_n1iaz_57",
|
|
14
|
+
expanded: "_expanded_n1iaz_69",
|
|
15
|
+
content: "_content_n1iaz_73",
|
|
16
|
+
contentInner: "_contentInner_n1iaz_79"
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/components/Accordion/Content/AccordionContent.tsx
|
|
@@ -55,27 +55,34 @@ function ie({ 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 ae({ children: t, type: r = "single", value: i, defaultValue: s, onValueChange: c, collapsible: u = !1, disabled:
|
|
59
|
-
let
|
|
60
|
-
|
|
58
|
+
function ae({ 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(() => {
|
|
60
|
+
let e = (h ? i : _) ?? [];
|
|
61
|
+
return Array.isArray(e) ? e : e ? [e] : [];
|
|
62
|
+
}, [
|
|
63
|
+
h,
|
|
64
|
+
_,
|
|
65
|
+
i
|
|
66
|
+
]), b = o((e) => {
|
|
67
|
+
if (f) return;
|
|
61
68
|
let t = y.includes(e), n;
|
|
62
69
|
n = r === "multiple" ? t ? y.filter((t) => t !== e) : [...y, e] : t ? u ? [] : y : [e];
|
|
63
70
|
let i = r === "multiple" ? n : n[0] ?? "";
|
|
64
|
-
|
|
71
|
+
h || v(i), c?.(i);
|
|
65
72
|
}, [
|
|
66
73
|
u,
|
|
67
|
-
|
|
74
|
+
f,
|
|
68
75
|
y,
|
|
69
|
-
|
|
76
|
+
h,
|
|
70
77
|
c,
|
|
71
78
|
r
|
|
72
79
|
]);
|
|
73
80
|
return /* @__PURE__ */ g("div", {
|
|
74
81
|
className: ne.root,
|
|
75
|
-
"data-disabled":
|
|
82
|
+
"data-disabled": f || void 0,
|
|
76
83
|
children: e.map(t, (t) => {
|
|
77
84
|
if (!a(t) || t.type !== G) return t;
|
|
78
|
-
let r = t, i =
|
|
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 === ie ? n(e, {
|
|
79
86
|
contentId: s,
|
|
80
87
|
disabled: i,
|
|
81
88
|
expanded: o,
|