@cfx-dev/ui-components 4.3.1 → 4.3.3
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/{Combination-CSgOhzm-.js → Combination-BGYCZNoJ.js} +375 -367
- package/dist/Rail-CHFAf3wJ.js +81 -0
- package/dist/Table.module-DffST69u.js +17 -0
- package/dist/assets/css/Accordion.css +1 -1
- package/dist/assets/css/Box.css +1 -1
- package/dist/assets/css/Button.css +1 -1
- package/dist/assets/css/DataTable.css +1 -1
- package/dist/assets/css/DropdownSelect.css +1 -1
- package/dist/assets/css/Flex.css +1 -1
- package/dist/assets/css/Flyout.css +1 -1
- package/dist/assets/css/Indicator.css +1 -1
- package/dist/assets/css/InfoPanel.css +1 -1
- package/dist/assets/css/Input.css +1 -1
- package/dist/assets/css/InputDropzone.css +1 -1
- package/dist/assets/css/Island.css +1 -1
- package/dist/assets/css/Link.css +1 -1
- package/dist/assets/css/Modal.css +1 -1
- package/dist/assets/css/Overlay.css +1 -1
- package/dist/assets/css/Pad.css +1 -1
- package/dist/assets/css/Popover.css +1 -1
- package/dist/assets/css/Radio.css +1 -1
- package/dist/assets/css/Rail.css +1 -1
- package/dist/assets/css/RichInput.css +1 -1
- package/dist/assets/css/Select.css +1 -1
- package/dist/assets/css/Separator.css +1 -1
- package/dist/assets/css/Switch.css +1 -1
- package/dist/assets/css/Table.css +1 -1
- package/dist/assets/css/Tabular.css +1 -1
- package/dist/assets/css/Text.css +1 -1
- package/dist/assets/css/Textarea.css +1 -1
- package/dist/assets/css/Title.css +1 -1
- package/dist/assets/css/ToggleGroup.css +1 -1
- package/dist/assets/general/global.css +1 -1
- package/dist/assets/general/themes.css +1 -1
- package/dist/components/Accordion/Accordion.js +5 -5
- package/dist/components/Accordion/AccordionShowcase.js +1 -1
- package/dist/components/Avatar/AvatarShowcase.js +1 -1
- package/dist/components/Badge/BadgeShowcase.js +1 -1
- package/dist/components/Box/Box.d.ts +6 -0
- package/dist/components/Box/Box.js +23 -0
- package/dist/components/Box/index.d.ts +3 -0
- package/dist/components/Box/index.js +6 -0
- package/dist/components/BurgerMenu/BurgerMenu.js +7 -7
- package/dist/components/BurgerMenu/BurgerMenuButton.js +2 -2
- package/dist/components/BurgerMenu/BurgerMenuShowcase.js +1 -1
- package/dist/components/Button/ButtonShowcase.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +252 -157
- package/dist/components/DataTable/DataTable.js +2 -2
- package/dist/components/DataTable/DataTableShowcase.js +2 -2
- package/dist/components/DropdownSelect/DropdownSelect.js +13 -13
- package/dist/components/DropdownSelect/DropdownSelectShowcase.js +1 -1
- package/dist/components/Flex/Flex.d.ts +7 -0
- package/dist/components/Flex/Flex.js +23 -0
- package/dist/components/Flex/index.d.ts +6 -0
- package/dist/components/{Layout/Flex → Flex}/index.js +2 -2
- package/dist/components/Flyout/Flyout.js +6 -6
- package/dist/components/InfoPanel/InfoPanel.js +3 -3
- package/dist/components/InfoPanel/InfoPanelShowcase.js +1 -1
- package/dist/components/Input/Input.js +87 -87
- package/dist/components/Input/InputShowcase.js +1 -1
- package/dist/components/Input/RichInput.js +42 -42
- package/dist/components/Island/Island.js +27 -27
- package/dist/components/Layout/Pad/Pad.js +20 -20
- package/dist/components/Link/LinkShowcase.js +1 -1
- package/dist/components/Logos/LogosShowcase.js +1 -1
- package/dist/components/Modal/ModalShowcase.js +4 -4
- package/dist/components/OnScreenSensor.js +13 -13
- package/dist/components/Popover/Popover.js +5 -5
- package/dist/components/Popover/PopoverShowcase.js +1 -1
- package/dist/components/{Layout → RSC}/Box/Box.d.ts +3 -2
- package/dist/components/RSC/Box/Box.js +101 -0
- package/dist/components/RSC/Box/index.d.ts +2 -0
- package/dist/components/RSC/Box/index.js +7 -0
- package/dist/components/{Layout → RSC}/Flex/Flex.d.ts +4 -2
- package/dist/components/RSC/Flex/Flex.js +119 -0
- package/dist/components/{Layout → RSC}/Flex/index.d.ts +1 -1
- package/dist/components/RSC/Flex/index.js +15 -0
- package/dist/components/Scrollable/Rail.js +9 -0
- package/dist/components/Scrollable/Scrollable.js +88 -0
- package/dist/components/{Layout/Scrollable → Scrollable}/ScrollableShowcase.js +3 -3
- package/dist/components/{Layout/Scrollable → Scrollable}/VirtualScrollable.js +3 -3
- package/dist/components/{Layout/Scrollable → Scrollable}/index.js +1 -1
- package/dist/components/Select/Select.js +3 -3
- package/dist/components/Select/SelectShowcase.js +1 -1
- package/dist/components/Separator/Separator.js +3 -3
- package/dist/components/Shroud/Shroud.js +7 -7
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.js +5 -5
- package/dist/components/Skeleton/SkeletonShowcase.js +1 -1
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Slider/SliderShowcase.js +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/TableBody.js +1 -1
- package/dist/components/Table/TableCell.d.ts +1 -1
- package/dist/components/Table/TableCell.js +13 -12
- package/dist/components/Table/TableCellCheckbox.js +1 -1
- package/dist/components/Table/TableHeader.js +1 -1
- package/dist/components/Table/TableIconButton.js +1 -1
- package/dist/components/Table/TableRoot.js +1 -1
- package/dist/components/Table/TableRow.js +1 -1
- package/dist/components/Tabular/TabularShowcase.js +1 -1
- package/dist/components/Text/TextShowcase.js +2 -2
- package/dist/components/Textarea/Textarea.js +32 -34
- package/dist/components/Title/Title.js +62 -62
- package/dist/components/Title/TitleShowcase.js +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.js +7 -7
- package/dist/components/ToggleGroup/ToggleGroupShowcase.js +1 -1
- package/dist/index-ByKwkZKY.js +239 -0
- package/dist/{index-HDl8nGsm.js → index-CriGVLlo.js} +1 -1
- package/dist/{index-DZEAOJqB.js → index-DlJ4qUbZ.js} +1 -1
- package/dist/main.d.ts +6 -6
- package/dist/main.js +94 -93
- package/dist/rsc.d.ts +4 -0
- package/dist/rsc.js +16 -0
- package/dist/styles-scss/_colors.scss +41 -32
- package/dist/styles-scss/_typography.scss +5 -5
- package/dist/styles-scss/_ui.scss +36 -20
- package/dist/styles-scss/global.scss +24 -13
- package/dist/styles-scss/themes/theme_cfx.scss +3 -5
- package/dist/styles-scss/themes/theme_fivem.scss +5 -7
- package/dist/styles-scss/themes/theme_redm.scss +4 -6
- package/dist/styles-scss/themes/theme_wireframe.scss +5 -7
- package/dist/styles-scss/themes.scss +4 -4
- package/dist/styles-scss/tokens.scss +2 -56
- package/dist/utils/hooks/useGlobalKeyboardEvent.js +3 -3
- package/dist/utils/hooks/useWindowResize.js +5 -5
- package/dist/utils/string.d.ts +1 -0
- package/dist/utils/string.js +23 -19
- package/package.json +10 -5
- package/dist/Rail-DcVowhML.js +0 -81
- package/dist/Table.module-DHI1mXN2.js +0 -17
- package/dist/components/Layout/Box/Box.js +0 -72
- package/dist/components/Layout/Box/index.d.ts +0 -2
- package/dist/components/Layout/Box/index.js +0 -5
- package/dist/components/Layout/Flex/Flex.js +0 -84
- package/dist/components/Layout/Scrollable/Rail.js +0 -9
- package/dist/components/Layout/Scrollable/Scrollable.js +0 -91
- package/dist/index-BHuChyf5.js +0 -238
- /package/dist/components/{Layout/Flex → Flex}/FlexShowcase.d.ts +0 -0
- /package/dist/components/{Layout/Flex → Flex}/FlexShowcase.js +0 -0
- /package/dist/components/{Layout → RSC}/Box/Box.types.d.ts +0 -0
- /package/dist/components/{Layout → RSC}/Box/Box.types.js +0 -0
- /package/dist/components/{Layout → RSC}/Flex/Flex.types.d.ts +0 -0
- /package/dist/components/{Layout → RSC}/Flex/Flex.types.js +0 -0
- /package/dist/components/{Layout → RSC}/Flex/FlexRestricter.d.ts +0 -0
- /package/dist/components/{Layout → RSC}/Flex/FlexRestricter.js +0 -0
- /package/dist/components/{Layout/Scrollable → Scrollable}/Rail.d.ts +0 -0
- /package/dist/components/{Layout/Scrollable → Scrollable}/Scrollable.d.ts +0 -0
- /package/dist/components/{Layout/Scrollable → Scrollable}/ScrollableShowcase.d.ts +0 -0
- /package/dist/components/{Layout/Scrollable → Scrollable}/VirtualScrollable.d.ts +0 -0
- /package/dist/components/{Layout/Scrollable → Scrollable}/index.d.ts +0 -0
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
-
import l from "react";
|
|
3
|
-
import h from "../Box/Box.js";
|
|
4
|
-
import { clsx as y } from "../../../utils/clsx.js";
|
|
5
|
-
import { ui as s } from "../../../utils/ui/ui.js";
|
|
6
|
-
const w = "cfxui__Flex__root__d860a", C = "cfxui__Flex__centered__e911c", S = "cfxui__Flex__vertical__552db", j = "cfxui__Flex__stretch__5c1ce", z = "cfxui__Flex__horizontal__d64f7", e = {
|
|
7
|
-
root: w,
|
|
8
|
-
centered: C,
|
|
9
|
-
"centered-axis": "cfxui__Flex__centered-axis__8458f",
|
|
10
|
-
"centered-cross-axis": "cfxui__Flex__centered-cross-axis__f7db7",
|
|
11
|
-
"baseline-axis": "cfxui__Flex__baseline-axis__9ac0d",
|
|
12
|
-
"baseline-cross-axis": "cfxui__Flex__baseline-cross-axis__b4492",
|
|
13
|
-
"reverse-order": "cfxui__Flex__reverse-order__65a69",
|
|
14
|
-
vertical: S,
|
|
15
|
-
"align-to-end": "cfxui__Flex__align-to-end__4b5ea",
|
|
16
|
-
"align-to-end-axis": "cfxui__Flex__align-to-end-axis__db8aa",
|
|
17
|
-
"space-between": "cfxui__Flex__space-between__98493",
|
|
18
|
-
stretch: j,
|
|
19
|
-
horizontal: z
|
|
20
|
-
};
|
|
21
|
-
function N(t) {
|
|
22
|
-
return t == null ? "" : typeof t == "boolean" ? t ? "wrap" : "nowrap" : t.toString();
|
|
23
|
-
}
|
|
24
|
-
function B(t) {
|
|
25
|
-
const {
|
|
26
|
-
centered: i = !1,
|
|
27
|
-
vertical: c = !1,
|
|
28
|
-
reverseOrder: x = !1,
|
|
29
|
-
stretch: f = !1,
|
|
30
|
-
spaceBetween: d = !1,
|
|
31
|
-
alignToEnd: p = !1,
|
|
32
|
-
alignToEndAxis: u = !1,
|
|
33
|
-
children: g,
|
|
34
|
-
className: m,
|
|
35
|
-
gap: n,
|
|
36
|
-
direction: a,
|
|
37
|
-
alignItems: r,
|
|
38
|
-
justifyContent: o,
|
|
39
|
-
wrap: _,
|
|
40
|
-
...b
|
|
41
|
-
} = t, v = y(
|
|
42
|
-
e.root,
|
|
43
|
-
m,
|
|
44
|
-
s.getResponsiveClassnames("gap", n),
|
|
45
|
-
s.getResponsiveClassnames("flex-direction", a),
|
|
46
|
-
s.getResponsiveClassnames("align-items", r),
|
|
47
|
-
s.getResponsiveClassnames("justify-content", o),
|
|
48
|
-
s.getResponsiveClassnames("flex-wrap", _),
|
|
49
|
-
{
|
|
50
|
-
[e.centered]: i === !0,
|
|
51
|
-
[e["centered-axis"]]: i === "axis",
|
|
52
|
-
[e["centered-cross-axis"]]: i === "cross-axis",
|
|
53
|
-
[e["baseline-axis"]]: i === "baseline-axis",
|
|
54
|
-
[e["baseline-cross-axis"]]: i === "baseline-cross-axis",
|
|
55
|
-
[e.vertical]: c,
|
|
56
|
-
[e.horizontal]: !c,
|
|
57
|
-
[e.stretch]: f,
|
|
58
|
-
[e["align-to-end"]]: p,
|
|
59
|
-
[e["align-to-end-axis"]]: u,
|
|
60
|
-
[e["space-between"]]: d,
|
|
61
|
-
[e["reverse-order"]]: x
|
|
62
|
-
}
|
|
63
|
-
), F = l.useMemo(() => ({
|
|
64
|
-
...s.getOffsetStyles("gap", n),
|
|
65
|
-
...s.getResponsiveStyles("flex-direction", a),
|
|
66
|
-
...s.getResponsiveStyles("align-items", r),
|
|
67
|
-
...s.getResponsiveStyles("justify-content", o),
|
|
68
|
-
...s.getResponsiveStyles("flex-wrap", _, N)
|
|
69
|
-
}), [n, a, r, o, _]);
|
|
70
|
-
return /* @__PURE__ */ R(
|
|
71
|
-
h,
|
|
72
|
-
{
|
|
73
|
-
className: v,
|
|
74
|
-
style: F,
|
|
75
|
-
...b,
|
|
76
|
-
children: g
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
const M = l.memo(B);
|
|
81
|
-
export {
|
|
82
|
-
M as default,
|
|
83
|
-
N as flexWrapResponsiveFormatter
|
|
84
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { jsxs as W, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import r from "react";
|
|
3
|
-
import { clsx as x } from "../../../utils/clsx.js";
|
|
4
|
-
import { mergeRefs as k } from "../../../utils/mergeRefs.js";
|
|
5
|
-
import { s as o, R as N } from "../../../Rail-DcVowhML.js";
|
|
6
|
-
const P = {
|
|
7
|
-
size: 0,
|
|
8
|
-
scrollPos: 0,
|
|
9
|
-
scrollSize: 0
|
|
10
|
-
};
|
|
11
|
-
function G(b) {
|
|
12
|
-
const {
|
|
13
|
-
children: w,
|
|
14
|
-
className: A,
|
|
15
|
-
onScroll: l,
|
|
16
|
-
minThumbSize: u = 20,
|
|
17
|
-
verticalAsHorizontal: f = !1,
|
|
18
|
-
ref: L,
|
|
19
|
-
scrollerRef: E
|
|
20
|
-
} = b, e = r.useRef(null), a = r.useRef(null), [T, S] = r.useState(!1), [c, y] = r.useState(P), [g, I] = r.useState(0), [n, X] = r.useState(P), [Y, _] = r.useState(0), C = x(o.root, A, {
|
|
21
|
-
[o.active]: T
|
|
22
|
-
});
|
|
23
|
-
r.useLayoutEffect(() => {
|
|
24
|
-
if (!a.current)
|
|
25
|
-
throw new Error("No scrollable content ref");
|
|
26
|
-
const s = new ResizeObserver(() => {
|
|
27
|
-
var t, R, d, h, v, p;
|
|
28
|
-
X({
|
|
29
|
-
size: ((t = e.current) == null ? void 0 : t.clientHeight) || 0,
|
|
30
|
-
scrollPos: ((R = e.current) == null ? void 0 : R.scrollTop) || 0,
|
|
31
|
-
scrollSize: ((d = e.current) == null ? void 0 : d.scrollHeight) || 0
|
|
32
|
-
}), y({
|
|
33
|
-
size: ((h = e.current) == null ? void 0 : h.clientWidth) || 0,
|
|
34
|
-
scrollPos: ((v = e.current) == null ? void 0 : v.scrollLeft) || 0,
|
|
35
|
-
scrollSize: ((p = e.current) == null ? void 0 : p.scrollWidth) || 0
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
return s.observe(a.current), () => s.disconnect();
|
|
39
|
-
}, []);
|
|
40
|
-
const H = r.useCallback(
|
|
41
|
-
(s) => {
|
|
42
|
-
e.current && (l == null || l(s), _(e.current.scrollTop), I(e.current.scrollLeft));
|
|
43
|
-
},
|
|
44
|
-
[l]
|
|
45
|
-
);
|
|
46
|
-
r.useEffect(() => {
|
|
47
|
-
if (!f || !e.current)
|
|
48
|
-
return;
|
|
49
|
-
const s = (t) => {
|
|
50
|
-
t.preventDefault(), t.stopPropagation(), e.current && (e.current.scrollLeft += t.deltaY);
|
|
51
|
-
};
|
|
52
|
-
return e.current.addEventListener("wheel", s), () => {
|
|
53
|
-
var t;
|
|
54
|
-
return (t = e.current) == null ? void 0 : t.removeEventListener("wheel", s);
|
|
55
|
-
};
|
|
56
|
-
}, [f]);
|
|
57
|
-
const z = c.scrollSize - c.size > 1, m = n.scrollSize - n.size > 1, j = x(o.scroller, {
|
|
58
|
-
[o["no-x-scroll"]]: !z,
|
|
59
|
-
[o["no-y-scroll"]]: !m
|
|
60
|
-
});
|
|
61
|
-
return /* @__PURE__ */ W("div", { ref: L, className: C, children: [
|
|
62
|
-
/* @__PURE__ */ i("div", { ref: k(e, E), className: j, onScroll: H, children: /* @__PURE__ */ i("div", { ref: a, className: o.content, children: w }) }),
|
|
63
|
-
m && /* @__PURE__ */ i(
|
|
64
|
-
N,
|
|
65
|
-
{
|
|
66
|
-
rootRef: e,
|
|
67
|
-
axis: "y",
|
|
68
|
-
size: n.size,
|
|
69
|
-
pos: Y,
|
|
70
|
-
scrollSize: n.scrollSize,
|
|
71
|
-
setRootActive: S,
|
|
72
|
-
minThumbSize: u
|
|
73
|
-
}
|
|
74
|
-
),
|
|
75
|
-
z && /* @__PURE__ */ i(
|
|
76
|
-
N,
|
|
77
|
-
{
|
|
78
|
-
rootRef: e,
|
|
79
|
-
axis: "x",
|
|
80
|
-
size: c.size,
|
|
81
|
-
pos: g,
|
|
82
|
-
scrollSize: c.scrollSize,
|
|
83
|
-
setRootActive: S,
|
|
84
|
-
minThumbSize: u
|
|
85
|
-
}
|
|
86
|
-
)
|
|
87
|
-
] });
|
|
88
|
-
}
|
|
89
|
-
export {
|
|
90
|
-
G as Scrollable
|
|
91
|
-
};
|
package/dist/index-BHuChyf5.js
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import * as c from "react";
|
|
2
|
-
import { jsx as y } from "react/jsx-runtime";
|
|
3
|
-
import { r as w } from "./index-Cl_RnsqN.js";
|
|
4
|
-
function v(e, n) {
|
|
5
|
-
if (typeof e == "function")
|
|
6
|
-
return e(n);
|
|
7
|
-
e != null && (e.current = n);
|
|
8
|
-
}
|
|
9
|
-
function C(...e) {
|
|
10
|
-
return (n) => {
|
|
11
|
-
let o = !1;
|
|
12
|
-
const r = e.map((t) => {
|
|
13
|
-
const s = v(t, n);
|
|
14
|
-
return !o && typeof s == "function" && (o = !0), s;
|
|
15
|
-
});
|
|
16
|
-
if (o)
|
|
17
|
-
return () => {
|
|
18
|
-
for (let t = 0; t < r.length; t++) {
|
|
19
|
-
const s = r[t];
|
|
20
|
-
typeof s == "function" ? s() : v(e[t], null);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function j(...e) {
|
|
26
|
-
return c.useCallback(C(...e), e);
|
|
27
|
-
}
|
|
28
|
-
function B(e, n = []) {
|
|
29
|
-
let o = [];
|
|
30
|
-
function r(s, u) {
|
|
31
|
-
const i = c.createContext(u), l = o.length;
|
|
32
|
-
o = [...o, u];
|
|
33
|
-
const f = (a) => {
|
|
34
|
-
var b;
|
|
35
|
-
const { scope: p, children: h, ...m } = a, S = ((b = p == null ? void 0 : p[e]) == null ? void 0 : b[l]) || i, g = c.useMemo(() => m, Object.values(m));
|
|
36
|
-
return /* @__PURE__ */ y(S.Provider, { value: g, children: h });
|
|
37
|
-
};
|
|
38
|
-
f.displayName = s + "Provider";
|
|
39
|
-
function d(a, p) {
|
|
40
|
-
var S;
|
|
41
|
-
const h = ((S = p == null ? void 0 : p[e]) == null ? void 0 : S[l]) || i, m = c.useContext(h);
|
|
42
|
-
if (m) return m;
|
|
43
|
-
if (u !== void 0) return u;
|
|
44
|
-
throw new Error(`\`${a}\` must be used within \`${s}\``);
|
|
45
|
-
}
|
|
46
|
-
return [f, d];
|
|
47
|
-
}
|
|
48
|
-
const t = () => {
|
|
49
|
-
const s = o.map((u) => c.createContext(u));
|
|
50
|
-
return function(i) {
|
|
51
|
-
const l = (i == null ? void 0 : i[e]) || s;
|
|
52
|
-
return c.useMemo(
|
|
53
|
-
() => ({ [`__scope${e}`]: { ...i, [e]: l } }),
|
|
54
|
-
[i, l]
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
return t.scopeName = e, [r, P(t, ...n)];
|
|
59
|
-
}
|
|
60
|
-
function P(...e) {
|
|
61
|
-
const n = e[0];
|
|
62
|
-
if (e.length === 1) return n;
|
|
63
|
-
const o = () => {
|
|
64
|
-
const r = e.map((t) => ({
|
|
65
|
-
useScope: t(),
|
|
66
|
-
scopeName: t.scopeName
|
|
67
|
-
}));
|
|
68
|
-
return function(s) {
|
|
69
|
-
const u = r.reduce((i, { useScope: l, scopeName: f }) => {
|
|
70
|
-
const a = l(s)[`__scope${f}`];
|
|
71
|
-
return { ...i, ...a };
|
|
72
|
-
}, {});
|
|
73
|
-
return c.useMemo(() => ({ [`__scope${n.scopeName}`]: u }), [u]);
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
return o.scopeName = n.scopeName, o;
|
|
77
|
-
}
|
|
78
|
-
function k(e, n, { checkForDefaultPrevented: o = !0 } = {}) {
|
|
79
|
-
return function(t) {
|
|
80
|
-
if (e == null || e(t), o === !1 || !t.defaultPrevented)
|
|
81
|
-
return n == null ? void 0 : n(t);
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
var x = globalThis != null && globalThis.document ? c.useLayoutEffect : () => {
|
|
85
|
-
}, E = c[" useInsertionEffect ".trim().toString()] || x;
|
|
86
|
-
function L({
|
|
87
|
-
prop: e,
|
|
88
|
-
defaultProp: n,
|
|
89
|
-
onChange: o = () => {
|
|
90
|
-
},
|
|
91
|
-
caller: r
|
|
92
|
-
}) {
|
|
93
|
-
const [t, s, u] = R({
|
|
94
|
-
defaultProp: n,
|
|
95
|
-
onChange: o
|
|
96
|
-
}), i = e !== void 0, l = i ? e : t;
|
|
97
|
-
{
|
|
98
|
-
const d = c.useRef(e !== void 0);
|
|
99
|
-
c.useEffect(() => {
|
|
100
|
-
const a = d.current;
|
|
101
|
-
a !== i && console.warn(
|
|
102
|
-
`${r} is changing from ${a ? "controlled" : "uncontrolled"} to ${i ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
103
|
-
), d.current = i;
|
|
104
|
-
}, [i, r]);
|
|
105
|
-
}
|
|
106
|
-
const f = c.useCallback(
|
|
107
|
-
(d) => {
|
|
108
|
-
var a;
|
|
109
|
-
if (i) {
|
|
110
|
-
const p = $(d) ? d(e) : d;
|
|
111
|
-
p !== e && ((a = u.current) == null || a.call(u, p));
|
|
112
|
-
} else
|
|
113
|
-
s(d);
|
|
114
|
-
},
|
|
115
|
-
[i, e, s, u]
|
|
116
|
-
);
|
|
117
|
-
return [l, f];
|
|
118
|
-
}
|
|
119
|
-
function R({
|
|
120
|
-
defaultProp: e,
|
|
121
|
-
onChange: n
|
|
122
|
-
}) {
|
|
123
|
-
const [o, r] = c.useState(e), t = c.useRef(o), s = c.useRef(n);
|
|
124
|
-
return E(() => {
|
|
125
|
-
s.current = n;
|
|
126
|
-
}, [n]), c.useEffect(() => {
|
|
127
|
-
var u;
|
|
128
|
-
t.current !== o && ((u = s.current) == null || u.call(s, o), t.current = o);
|
|
129
|
-
}, [o, t]), [o, r, s];
|
|
130
|
-
}
|
|
131
|
-
function $(e) {
|
|
132
|
-
return typeof e == "function";
|
|
133
|
-
}
|
|
134
|
-
function T(e) {
|
|
135
|
-
const [n, o] = c.useState(void 0);
|
|
136
|
-
return x(() => {
|
|
137
|
-
if (e) {
|
|
138
|
-
o({ width: e.offsetWidth, height: e.offsetHeight });
|
|
139
|
-
const r = new ResizeObserver((t) => {
|
|
140
|
-
if (!Array.isArray(t) || !t.length)
|
|
141
|
-
return;
|
|
142
|
-
const s = t[0];
|
|
143
|
-
let u, i;
|
|
144
|
-
if ("borderBoxSize" in s) {
|
|
145
|
-
const l = s.borderBoxSize, f = Array.isArray(l) ? l[0] : l;
|
|
146
|
-
u = f.inlineSize, i = f.blockSize;
|
|
147
|
-
} else
|
|
148
|
-
u = e.offsetWidth, i = e.offsetHeight;
|
|
149
|
-
o({ width: u, height: i });
|
|
150
|
-
});
|
|
151
|
-
return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
|
|
152
|
-
} else
|
|
153
|
-
o(void 0);
|
|
154
|
-
}, [e]), n;
|
|
155
|
-
}
|
|
156
|
-
// @__NO_SIDE_EFFECTS__
|
|
157
|
-
function z(e) {
|
|
158
|
-
const n = /* @__PURE__ */ _(e), o = c.forwardRef((r, t) => {
|
|
159
|
-
const { children: s, ...u } = r, i = c.Children.toArray(s), l = i.find(A);
|
|
160
|
-
if (l) {
|
|
161
|
-
const f = l.props.children, d = i.map((a) => a === l ? c.Children.count(f) > 1 ? c.Children.only(null) : c.isValidElement(f) ? f.props.children : null : a);
|
|
162
|
-
return /* @__PURE__ */ y(n, { ...u, ref: t, children: c.isValidElement(f) ? c.cloneElement(f, void 0, d) : null });
|
|
163
|
-
}
|
|
164
|
-
return /* @__PURE__ */ y(n, { ...u, ref: t, children: s });
|
|
165
|
-
});
|
|
166
|
-
return o.displayName = `${e}.Slot`, o;
|
|
167
|
-
}
|
|
168
|
-
// @__NO_SIDE_EFFECTS__
|
|
169
|
-
function _(e) {
|
|
170
|
-
const n = c.forwardRef((o, r) => {
|
|
171
|
-
const { children: t, ...s } = o;
|
|
172
|
-
if (c.isValidElement(t)) {
|
|
173
|
-
const u = D(t), i = N(s, t.props);
|
|
174
|
-
return t.type !== c.Fragment && (i.ref = r ? C(r, u) : u), c.cloneElement(t, i);
|
|
175
|
-
}
|
|
176
|
-
return c.Children.count(t) > 1 ? c.Children.only(null) : null;
|
|
177
|
-
});
|
|
178
|
-
return n.displayName = `${e}.SlotClone`, n;
|
|
179
|
-
}
|
|
180
|
-
var O = Symbol("radix.slottable");
|
|
181
|
-
function A(e) {
|
|
182
|
-
return c.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === O;
|
|
183
|
-
}
|
|
184
|
-
function N(e, n) {
|
|
185
|
-
const o = { ...n };
|
|
186
|
-
for (const r in n) {
|
|
187
|
-
const t = e[r], s = n[r];
|
|
188
|
-
/^on[A-Z]/.test(r) ? t && s ? o[r] = (...i) => {
|
|
189
|
-
s(...i), t(...i);
|
|
190
|
-
} : t && (o[r] = t) : r === "style" ? o[r] = { ...t, ...s } : r === "className" && (o[r] = [t, s].filter(Boolean).join(" "));
|
|
191
|
-
}
|
|
192
|
-
return { ...e, ...o };
|
|
193
|
-
}
|
|
194
|
-
function D(e) {
|
|
195
|
-
var r, t;
|
|
196
|
-
let n = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, o = n && "isReactWarning" in n && n.isReactWarning;
|
|
197
|
-
return o ? e.ref : (n = (t = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : t.get, o = n && "isReactWarning" in n && n.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
|
|
198
|
-
}
|
|
199
|
-
var I = [
|
|
200
|
-
"a",
|
|
201
|
-
"button",
|
|
202
|
-
"div",
|
|
203
|
-
"form",
|
|
204
|
-
"h2",
|
|
205
|
-
"h3",
|
|
206
|
-
"img",
|
|
207
|
-
"input",
|
|
208
|
-
"label",
|
|
209
|
-
"li",
|
|
210
|
-
"nav",
|
|
211
|
-
"ol",
|
|
212
|
-
"p",
|
|
213
|
-
"select",
|
|
214
|
-
"span",
|
|
215
|
-
"svg",
|
|
216
|
-
"ul"
|
|
217
|
-
], F = I.reduce((e, n) => {
|
|
218
|
-
const o = /* @__PURE__ */ z(`Primitive.${n}`), r = c.forwardRef((t, s) => {
|
|
219
|
-
const { asChild: u, ...i } = t, l = u ? o : n;
|
|
220
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ y(l, { ...i, ref: s });
|
|
221
|
-
});
|
|
222
|
-
return r.displayName = `Primitive.${n}`, { ...e, [n]: r };
|
|
223
|
-
}, {});
|
|
224
|
-
function M(e, n) {
|
|
225
|
-
e && w.flushSync(() => e.dispatchEvent(n));
|
|
226
|
-
}
|
|
227
|
-
export {
|
|
228
|
-
F as P,
|
|
229
|
-
x as a,
|
|
230
|
-
z as b,
|
|
231
|
-
B as c,
|
|
232
|
-
L as d,
|
|
233
|
-
k as e,
|
|
234
|
-
T as f,
|
|
235
|
-
M as g,
|
|
236
|
-
C as h,
|
|
237
|
-
j as u
|
|
238
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|