@cfx-dev/ui-components 3.0.2 → 3.0.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/Rail-DcVowhML.js +81 -0
- package/dist/assets/css/Accordion.css +1 -1
- package/dist/assets/css/Avatar.css +1 -1
- package/dist/assets/css/Badge.css +1 -1
- package/dist/assets/css/Box.css +1 -1
- package/dist/assets/css/Button.css +1 -1
- package/dist/assets/css/ButtonBar.css +1 -1
- package/dist/assets/css/Center.css +1 -1
- package/dist/assets/css/Checkbox.css +1 -1
- package/dist/assets/css/ClipboardButton.css +1 -1
- package/dist/assets/css/ControlBox.css +1 -1
- package/dist/assets/css/CountryFlag.css +1 -1
- package/dist/assets/css/Decorate.css +1 -1
- package/dist/assets/css/Dot.css +1 -1
- package/dist/assets/css/Flex.css +1 -1
- package/dist/assets/css/FlexRestricter.css +1 -1
- package/dist/assets/css/FlexShowcase.css +1 -1
- package/dist/assets/css/Flyout.css +1 -1
- package/dist/assets/css/Icon.css +1 -1
- package/dist/assets/css/IconBig.css +1 -1
- package/dist/assets/css/IconButton.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/Interactive.css +1 -1
- package/dist/assets/css/Island.css +1 -1
- package/dist/assets/css/ItemPreview.css +1 -1
- package/dist/assets/css/Link.css +1 -1
- package/dist/assets/css/Loaf.css +1 -1
- package/dist/assets/css/Modal.css +1 -1
- package/dist/assets/css/NavList.css +1 -1
- package/dist/assets/css/Overlay.css +1 -1
- package/dist/assets/css/Pad.css +1 -1
- package/dist/assets/css/Page.css +1 -1
- package/dist/assets/css/Popover.css +1 -1
- package/dist/assets/css/PopoverShowcase.css +1 -1
- package/dist/assets/css/PremiumBadge.css +1 -1
- package/dist/assets/css/Prose.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/Shroud.css +1 -1
- package/dist/assets/css/Skeleton.css +1 -1
- package/dist/assets/css/Spacer.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/TextShowcase.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/cfxIcons-BNd1WgpX.js +96 -0
- package/dist/components/Accordion/Accordion.js +69 -69
- package/dist/components/Avatar/Avatar.js +18 -18
- package/dist/components/Badge/Badge.js +23 -23
- package/dist/components/Button/Button.js +76 -76
- package/dist/components/Button/ButtonBar.js +6 -6
- package/dist/components/Checkbox/Checkbox.js +90 -85
- package/dist/components/ClipboardButton/ClipboardButton.js +17 -17
- package/dist/components/ControlBox/ControlBox.js +11 -11
- package/dist/components/CountryFlag/CountryFlag.js +9 -9
- package/dist/components/Decorate/Decorate.js +12 -12
- package/dist/components/Dot/Dot.js +17 -17
- package/dist/components/Flyout/Flyout.js +44 -44
- package/dist/components/Icon/Icon.js +14 -14
- package/dist/components/IconBig/IconBig.js +23 -18
- package/dist/components/IconButton/IconButton.js +25 -25
- package/dist/components/Icons/IconsShowcase.js +1 -1
- package/dist/components/Icons/cfx-icons/Cart.d.ts +5 -0
- package/dist/components/Icons/cfx-icons/Cart.js +42 -0
- package/dist/components/Icons/cfx-icons/UpvotesBurst.d.ts +5 -0
- package/dist/components/Icons/cfx-icons/UpvotesBurst.js +26 -0
- package/dist/components/Icons/cfx-icons/UpvotesRecurring.d.ts +5 -0
- package/dist/components/Icons/cfx-icons/UpvotesRecurring.js +26 -0
- package/dist/components/Icons/cfx-icons/User.d.ts +5 -0
- package/dist/components/Icons/cfx-icons/User.js +31 -0
- package/dist/components/Icons/cfx-icons/Verified.d.ts +5 -0
- package/dist/components/Icons/cfx-icons/Verified.js +23 -0
- package/dist/components/Icons/cfxIcons.d.ts +5 -0
- package/dist/components/Icons/cfxIcons.js +52 -42
- package/dist/components/Icons/index.js +1 -1
- package/dist/components/Indicator/Indicator.js +11 -11
- package/dist/components/InfoPanel/InfoPanel.js +37 -37
- package/dist/components/Input/Input.js +59 -59
- package/dist/components/Input/RichInput.js +39 -39
- package/dist/components/InputDropzone/InputDropzone.js +87 -87
- package/dist/components/InputDropzone/ItemPreview.js +17 -17
- package/dist/components/Interactive/Interactive.js +6 -6
- package/dist/components/Island/Island.js +20 -20
- package/dist/components/Layout/Box/Box.js +81 -81
- package/dist/components/Layout/Center/Center.js +14 -14
- package/dist/components/Layout/Flex/Flex.js +67 -67
- package/dist/components/Layout/Flex/FlexRestricter.js +14 -14
- package/dist/components/Layout/Flex/FlexShowcase.js +4 -4
- package/dist/components/Layout/Pad/Pad.js +34 -34
- package/dist/components/Layout/Page/Page.js +11 -11
- package/dist/components/Layout/Scrollable/Rail.js +1 -1
- package/dist/components/Layout/Scrollable/Scrollable.js +1 -1
- package/dist/components/Layout/Scrollable/VirtualScrollable.js +1 -1
- package/dist/components/Layout/Scrollable/index.js +1 -1
- package/dist/components/Link/ButtonLink.js +7 -6
- package/dist/components/Link/Link.js +36 -27
- package/dist/components/Loaf/Loaf.js +20 -20
- package/dist/components/Modal/Modal.js +51 -51
- package/dist/components/NavList/NavList.js +23 -23
- package/dist/components/Overlay/Overlay.js +17 -17
- package/dist/components/Popover/Popover.js +29 -29
- package/dist/components/Popover/PopoverShowcase.js +9 -9
- package/dist/components/PremiumBadge/PremiumBadge.js +8 -8
- package/dist/components/Prose/Prose.js +6 -6
- package/dist/components/Radio/Radio.js +32 -32
- package/dist/components/Select/Select.js +157 -157
- package/dist/components/Separator/Separator.js +31 -31
- package/dist/components/Shroud/Shroud.js +14 -14
- package/dist/components/Skeleton/Skeleton.js +10 -10
- package/dist/components/Spacer/Spacer.js +25 -25
- package/dist/components/Switch/Switch.js +43 -43
- package/dist/components/Table/Table.js +82 -82
- package/dist/components/Tabular/Tabular.js +60 -60
- package/dist/components/Text/Text.js +26 -26
- package/dist/components/Text/TextShowcase.js +19 -19
- package/dist/components/Textarea/Textarea.js +36 -36
- package/dist/components/Title/Title.js +57 -57
- package/dist/components/ToggleGroup/ToggleGroup.js +40 -40
- package/dist/main.js +2 -2
- package/dist/styles-scss/_ui.scss +22 -0
- package/dist/styles-scss/global.scss +5 -0
- package/dist/styles-scss/tokens.scss +5 -25
- package/package.json +2 -2
- package/dist/Rail-XT5PwAlx.js +0 -81
- package/dist/cfxIcons-BlbKR-zU.js +0 -86
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { clsx as
|
|
3
|
-
const
|
|
4
|
-
root:
|
|
5
|
-
"separator-offset-none": "
|
|
6
|
-
"separator-offset-hairthin": "
|
|
7
|
-
"separator-offset-thin": "
|
|
8
|
-
"separator-offset-xxsmall": "
|
|
9
|
-
"separator-offset-xsmall": "
|
|
10
|
-
"separator-offset-small": "
|
|
11
|
-
"separator-offset-normal": "
|
|
12
|
-
"separator-offset-medium": "
|
|
13
|
-
"separator-offset-large": "
|
|
14
|
-
"separator-offset-xlarge": "
|
|
15
|
-
"separator-offset-safezone": "
|
|
16
|
-
separator:
|
|
17
|
-
content:
|
|
18
|
-
thin:
|
|
1
|
+
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as c } from "../../utils/clsx.js";
|
|
3
|
+
const i = "cfxui__Separator__root__3aea3", n = "cfxui__Separator__separator__5dbbd", l = "cfxui__Separator__content__7ade9", x = "cfxui__Separator__thin__628fd", m = "cfxui__Separator__vertical__8bd90", d = "cfxui__Separator__text__d02da", a = {
|
|
4
|
+
root: i,
|
|
5
|
+
"separator-offset-none": "cfxui__Separator__separator-offset-none__f2b70",
|
|
6
|
+
"separator-offset-hairthin": "cfxui__Separator__separator-offset-hairthin__56e9d",
|
|
7
|
+
"separator-offset-thin": "cfxui__Separator__separator-offset-thin__36d86",
|
|
8
|
+
"separator-offset-xxsmall": "cfxui__Separator__separator-offset-xxsmall__84364",
|
|
9
|
+
"separator-offset-xsmall": "cfxui__Separator__separator-offset-xsmall__6dba9",
|
|
10
|
+
"separator-offset-small": "cfxui__Separator__separator-offset-small__872f2",
|
|
11
|
+
"separator-offset-normal": "cfxui__Separator__separator-offset-normal__60e53",
|
|
12
|
+
"separator-offset-medium": "cfxui__Separator__separator-offset-medium__032b1",
|
|
13
|
+
"separator-offset-large": "cfxui__Separator__separator-offset-large__918a2",
|
|
14
|
+
"separator-offset-xlarge": "cfxui__Separator__separator-offset-xlarge__01c53",
|
|
15
|
+
"separator-offset-safezone": "cfxui__Separator__separator-offset-safezone__d28af",
|
|
16
|
+
separator: n,
|
|
17
|
+
content: l,
|
|
18
|
+
thin: x,
|
|
19
19
|
vertical: m,
|
|
20
|
-
text:
|
|
20
|
+
text: d
|
|
21
21
|
};
|
|
22
22
|
function h(o) {
|
|
23
23
|
const {
|
|
24
|
-
content:
|
|
25
|
-
thin:
|
|
26
|
-
vertical:
|
|
24
|
+
content: t,
|
|
25
|
+
thin: _ = !1,
|
|
26
|
+
vertical: s = !1,
|
|
27
27
|
offset: f = "none"
|
|
28
|
-
} = o, e =
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
28
|
+
} = o, e = c(a.root, a[`separator-offset-${f}`], {
|
|
29
|
+
[a.text]: !!t,
|
|
30
|
+
[a.thin]: _,
|
|
31
|
+
[a.vertical]: s
|
|
32
32
|
});
|
|
33
|
-
return
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
] }) : /* @__PURE__ */
|
|
33
|
+
return t ? /* @__PURE__ */ p("div", { className: e, children: [
|
|
34
|
+
/* @__PURE__ */ r("div", { className: a.separator }),
|
|
35
|
+
/* @__PURE__ */ r("div", { className: a.content, children: t }),
|
|
36
|
+
/* @__PURE__ */ r("div", { className: a.separator })
|
|
37
|
+
] }) : /* @__PURE__ */ r("div", { className: e, children: /* @__PURE__ */ r("div", { className: a.separator }) });
|
|
38
38
|
}
|
|
39
39
|
export {
|
|
40
40
|
h as Separator
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as t, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import { TITLE_OUTLET_ID as
|
|
4
|
-
import { ui as
|
|
3
|
+
import { TITLE_OUTLET_ID as _ } from "../Title/Title.js";
|
|
4
|
+
import { ui as p } from "../ui.js";
|
|
5
5
|
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
6
6
|
import "../../utils/hooks/useKeyboardClose.js";
|
|
7
|
-
import { useWindowResize as
|
|
7
|
+
import { useWindowResize as b } from "../../utils/hooks/useWindowResize.js";
|
|
8
8
|
import { useOutlet as x } from "../../utils/hooks/useOutlet.js";
|
|
9
|
-
const
|
|
10
|
-
root:
|
|
11
|
-
tile:
|
|
12
|
-
}, P = r.forwardRef(function(
|
|
9
|
+
const g = "cfxui__Shroud__root__99944", v = "cfxui__Shroud__tile__db55f", e = {
|
|
10
|
+
root: g,
|
|
11
|
+
tile: v
|
|
12
|
+
}, P = r.forwardRef(function(l, n) {
|
|
13
13
|
const {
|
|
14
14
|
forRef: s
|
|
15
|
-
} =
|
|
15
|
+
} = l, [u, d] = r.useState({}), f = x(_, "before"), i = r.useCallback(() => {
|
|
16
16
|
if (!s.current)
|
|
17
17
|
return;
|
|
18
|
-
const o = s.current.getBoundingClientRect(),
|
|
18
|
+
const o = s.current.getBoundingClientRect(), m = {
|
|
19
19
|
x: o.x,
|
|
20
20
|
y: o.y,
|
|
21
21
|
w: o.width,
|
|
@@ -23,16 +23,16 @@ const b = "_root_7v6x1_1", g = "_tile_7v6x1_6", e = {
|
|
|
23
23
|
sw: globalThis.screen.availWidth,
|
|
24
24
|
sh: globalThis.screen.availHeight
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
d(
|
|
27
27
|
Object.fromEntries(
|
|
28
|
-
Object.entries(
|
|
29
|
-
[`--${a}`,
|
|
30
|
-
[`--${a}-raw`,
|
|
28
|
+
Object.entries(m).flatMap(([a, c]) => [
|
|
29
|
+
[`--${a}`, p.px(c)],
|
|
30
|
+
[`--${a}-raw`, c]
|
|
31
31
|
])
|
|
32
32
|
)
|
|
33
33
|
);
|
|
34
34
|
}, []);
|
|
35
|
-
return r.useEffect(i, []),
|
|
35
|
+
return r.useEffect(i, []), b(i), /* @__PURE__ */ t(f, { children: /* @__PURE__ */ h("div", { ref: n, className: e.root, style: u, children: [
|
|
36
36
|
/* @__PURE__ */ t("div", { className: e.tile, "data-top": !0 }),
|
|
37
37
|
/* @__PURE__ */ t("div", { className: e.tile, "data-left": !0 }),
|
|
38
38
|
/* @__PURE__ */ t("div", { className: e.tile, "data-right": !0 }),
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import m from "react";
|
|
3
3
|
import { TextSizeEnum as l } from "../Text/Text.types.js";
|
|
4
|
-
const
|
|
5
|
-
skeleton:
|
|
6
|
-
shimmer:
|
|
4
|
+
const i = "cfxui__Skeleton__skeleton__d700e", _ = "cfxui__Skeleton__shimmer__d72f5", r = {
|
|
5
|
+
skeleton: i,
|
|
6
|
+
shimmer: _
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function f({
|
|
9
9
|
width: o = "100%",
|
|
10
10
|
height: e = "20px",
|
|
11
11
|
borderRadius: s = "4px"
|
|
12
12
|
}) {
|
|
13
13
|
let t = e;
|
|
14
|
-
return e in l && (t = `var(--font-size-${e})`), /* @__PURE__ */
|
|
14
|
+
return e in l && (t = `var(--font-size-${e})`), /* @__PURE__ */ n(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
|
-
className:
|
|
17
|
+
className: r.skeleton,
|
|
18
18
|
style: {
|
|
19
19
|
width: o,
|
|
20
20
|
height: t,
|
|
@@ -23,7 +23,7 @@ function a({
|
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const u = m.memo(f);
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
u as default
|
|
29
29
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { clsx as
|
|
3
|
-
const
|
|
4
|
-
root:
|
|
5
|
-
horizontal:
|
|
6
|
-
"size-none": "
|
|
7
|
-
"size-hairthin": "
|
|
8
|
-
"size-thin": "
|
|
9
|
-
"size-xxsmall": "
|
|
10
|
-
"size-xsmall": "
|
|
11
|
-
"size-small": "
|
|
12
|
-
"size-normal": "
|
|
13
|
-
"size-medium": "
|
|
14
|
-
"size-large": "
|
|
15
|
-
"size-xlarge": "
|
|
16
|
-
"size-safezone": "
|
|
17
|
-
vertical:
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as r } from "../../utils/clsx.js";
|
|
3
|
+
const o = "cfxui__Spacer__root__118fe", l = "cfxui__Spacer__horizontal__feb96", z = "cfxui__Spacer__vertical__5263f", _ = {
|
|
4
|
+
root: o,
|
|
5
|
+
horizontal: l,
|
|
6
|
+
"size-none": "cfxui__Spacer__size-none__64e4c",
|
|
7
|
+
"size-hairthin": "cfxui__Spacer__size-hairthin__9e4e3",
|
|
8
|
+
"size-thin": "cfxui__Spacer__size-thin__e1486",
|
|
9
|
+
"size-xxsmall": "cfxui__Spacer__size-xxsmall__703d4",
|
|
10
|
+
"size-xsmall": "cfxui__Spacer__size-xsmall__01aac",
|
|
11
|
+
"size-small": "cfxui__Spacer__size-small__6fa49",
|
|
12
|
+
"size-normal": "cfxui__Spacer__size-normal__5fe08",
|
|
13
|
+
"size-medium": "cfxui__Spacer__size-medium__be07e",
|
|
14
|
+
"size-large": "cfxui__Spacer__size-large__f8138",
|
|
15
|
+
"size-xlarge": "cfxui__Spacer__size-xlarge__88c98",
|
|
16
|
+
"size-safezone": "cfxui__Spacer__size-safezone__912d3",
|
|
17
|
+
vertical: z
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function n(i) {
|
|
20
20
|
const {
|
|
21
|
-
size:
|
|
22
|
-
vertical:
|
|
23
|
-
} =
|
|
24
|
-
[
|
|
25
|
-
[
|
|
21
|
+
size: a = "normal",
|
|
22
|
+
vertical: e = !1
|
|
23
|
+
} = i, c = r(_.root, _[`size-${a}`], {
|
|
24
|
+
[_.horizontal]: !e,
|
|
25
|
+
[_.vertical]: e
|
|
26
26
|
});
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ s("div", { className: c });
|
|
28
28
|
}
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
n as Spacer
|
|
31
31
|
};
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import { jsxs as N, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
3
|
import U from "react";
|
|
4
|
-
import { c as B, u as H, a as I, P as
|
|
5
|
-
import { clsx as
|
|
4
|
+
import { c as B, u as H, a as I, P as C, b as M, d as j, e as q } from "../../index-CjWRnNpt.js";
|
|
5
|
+
import { clsx as k } from "../../utils/clsx.js";
|
|
6
6
|
var S = "Switch", [z, Y] = B(S), [A, O] = z(S), P = a.forwardRef(
|
|
7
|
-
(t,
|
|
7
|
+
(t, o) => {
|
|
8
8
|
const {
|
|
9
9
|
__scopeSwitch: e,
|
|
10
|
-
name:
|
|
11
|
-
checked:
|
|
10
|
+
name: c,
|
|
11
|
+
checked: s,
|
|
12
12
|
defaultChecked: d,
|
|
13
13
|
required: u,
|
|
14
|
-
disabled:
|
|
14
|
+
disabled: r,
|
|
15
15
|
value: h = "on",
|
|
16
|
-
onCheckedChange:
|
|
17
|
-
...
|
|
18
|
-
} = t, [
|
|
19
|
-
prop:
|
|
16
|
+
onCheckedChange: f,
|
|
17
|
+
..._
|
|
18
|
+
} = t, [n, m] = a.useState(null), T = H(o, (p) => m(p)), w = a.useRef(!1), v = n ? !!n.closest("form") : !0, [l = !1, g] = I({
|
|
19
|
+
prop: s,
|
|
20
20
|
defaultProp: d,
|
|
21
|
-
onChange:
|
|
21
|
+
onChange: f
|
|
22
22
|
});
|
|
23
|
-
return /* @__PURE__ */ N(A, { scope: e, checked: l, disabled:
|
|
23
|
+
return /* @__PURE__ */ N(A, { scope: e, checked: l, disabled: r, children: [
|
|
24
24
|
/* @__PURE__ */ i(
|
|
25
|
-
|
|
25
|
+
C.button,
|
|
26
26
|
{
|
|
27
27
|
type: "button",
|
|
28
28
|
role: "switch",
|
|
29
29
|
"aria-checked": l,
|
|
30
30
|
"aria-required": u,
|
|
31
31
|
"data-state": y(l),
|
|
32
|
-
"data-disabled":
|
|
33
|
-
disabled:
|
|
32
|
+
"data-disabled": r ? "" : void 0,
|
|
33
|
+
disabled: r,
|
|
34
34
|
value: h,
|
|
35
|
-
...
|
|
35
|
+
..._,
|
|
36
36
|
ref: T,
|
|
37
37
|
onClick: M(t.onClick, (p) => {
|
|
38
|
-
|
|
38
|
+
g((E) => !E), v && (w.current = p.isPropagationStopped(), w.current || p.stopPropagation());
|
|
39
39
|
})
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
|
-
|
|
42
|
+
v && /* @__PURE__ */ i(
|
|
43
43
|
$,
|
|
44
44
|
{
|
|
45
|
-
control:
|
|
45
|
+
control: n,
|
|
46
46
|
bubbles: !w.current,
|
|
47
|
-
name:
|
|
47
|
+
name: c,
|
|
48
48
|
value: h,
|
|
49
49
|
checked: l,
|
|
50
50
|
required: u,
|
|
51
|
-
disabled:
|
|
51
|
+
disabled: r,
|
|
52
52
|
style: { transform: "translateX(-100%)" }
|
|
53
53
|
}
|
|
54
54
|
)
|
|
@@ -56,41 +56,41 @@ var S = "Switch", [z, Y] = B(S), [A, O] = z(S), P = a.forwardRef(
|
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
P.displayName = S;
|
|
59
|
-
var R = "SwitchThumb",
|
|
60
|
-
(t,
|
|
61
|
-
const { __scopeSwitch: e, ...
|
|
59
|
+
var R = "SwitchThumb", x = a.forwardRef(
|
|
60
|
+
(t, o) => {
|
|
61
|
+
const { __scopeSwitch: e, ...c } = t, s = O(R, e);
|
|
62
62
|
return /* @__PURE__ */ i(
|
|
63
|
-
|
|
63
|
+
C.span,
|
|
64
64
|
{
|
|
65
|
-
"data-state": y(
|
|
66
|
-
"data-disabled":
|
|
67
|
-
...
|
|
68
|
-
ref:
|
|
65
|
+
"data-state": y(s.checked),
|
|
66
|
+
"data-disabled": s.disabled ? "" : void 0,
|
|
67
|
+
...c,
|
|
68
|
+
ref: o
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
|
-
|
|
73
|
+
x.displayName = R;
|
|
74
74
|
var $ = (t) => {
|
|
75
|
-
const { control:
|
|
75
|
+
const { control: o, checked: e, bubbles: c = !0, ...s } = t, d = a.useRef(null), u = j(e), r = q(o);
|
|
76
76
|
return a.useEffect(() => {
|
|
77
|
-
const h = d.current,
|
|
78
|
-
if (u !== e &&
|
|
79
|
-
const
|
|
80
|
-
|
|
77
|
+
const h = d.current, f = window.HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(f, "checked").set;
|
|
78
|
+
if (u !== e && n) {
|
|
79
|
+
const m = new Event("click", { bubbles: c });
|
|
80
|
+
n.call(h, e), h.dispatchEvent(m);
|
|
81
81
|
}
|
|
82
|
-
}, [u, e,
|
|
82
|
+
}, [u, e, c]), /* @__PURE__ */ i(
|
|
83
83
|
"input",
|
|
84
84
|
{
|
|
85
85
|
type: "checkbox",
|
|
86
86
|
"aria-hidden": !0,
|
|
87
87
|
defaultChecked: e,
|
|
88
|
-
...
|
|
88
|
+
...s,
|
|
89
89
|
tabIndex: -1,
|
|
90
90
|
ref: d,
|
|
91
91
|
style: {
|
|
92
92
|
...t.style,
|
|
93
|
-
...
|
|
93
|
+
...r,
|
|
94
94
|
position: "absolute",
|
|
95
95
|
pointerEvents: "none",
|
|
96
96
|
opacity: 0,
|
|
@@ -102,19 +102,19 @@ var $ = (t) => {
|
|
|
102
102
|
function y(t) {
|
|
103
103
|
return t ? "checked" : "unchecked";
|
|
104
104
|
}
|
|
105
|
-
var D = P, F =
|
|
106
|
-
const L = "
|
|
105
|
+
var D = P, F = x;
|
|
106
|
+
const L = "cfxui__Switch__switchUnset__c8b03", W = "cfxui__Switch__switchRoot__f2911", X = "cfxui__Switch__switchThumb__9cbf5", b = {
|
|
107
107
|
switchUnset: L,
|
|
108
108
|
switchRoot: W,
|
|
109
109
|
switchThumb: X
|
|
110
110
|
};
|
|
111
111
|
function G(t) {
|
|
112
112
|
const {
|
|
113
|
-
classNameRoot:
|
|
113
|
+
classNameRoot: o,
|
|
114
114
|
classNameThumb: e,
|
|
115
|
-
...
|
|
115
|
+
...c
|
|
116
116
|
} = t;
|
|
117
|
-
return /* @__PURE__ */ i(D, { ...
|
|
117
|
+
return /* @__PURE__ */ i(D, { ...c, className: k(b.switchRoot, b.switchUnset, o), children: /* @__PURE__ */ i(F, { className: k(b.switchThumb, e) }) });
|
|
118
118
|
}
|
|
119
119
|
const Z = U.memo(G);
|
|
120
120
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as t, jsxs as C } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Text as
|
|
6
|
-
import { clsx as
|
|
7
|
-
const
|
|
8
|
-
tableIcon:
|
|
2
|
+
import l, { useState as k } from "react";
|
|
3
|
+
import I from "../Checkbox/Checkbox.js";
|
|
4
|
+
import $ from "../IconButton/IconButton.js";
|
|
5
|
+
import { Text as S } from "../Text/Text.js";
|
|
6
|
+
import { clsx as u } from "../../utils/clsx.js";
|
|
7
|
+
const j = "cfxui__Table__tableIcon__f8e96", z = "cfxui__Table__iconButton__ac6da", A = "cfxui__Table__root__591ed", E = "cfxui__Table__radio__70dd7", O = "cfxui__Table__radioContent__35cef", g = "cfxui__Table__pointer__7b6a4", F = "cfxui__Table__selectedRow__f7130", H = "cfxui__Table__headerText__02722", V = "cfxui__Table__headerContent__f0e66", q = "cfxui__Table__hidden__e4ac6", c = {
|
|
8
|
+
tableIcon: j,
|
|
9
9
|
iconButton: z,
|
|
10
10
|
root: A,
|
|
11
11
|
radio: E,
|
|
@@ -16,33 +16,33 @@ const S = "_tableIcon_jm0lw_1", z = "_iconButton_jm0lw_1", A = "_root_jm0lw_21",
|
|
|
16
16
|
headerContent: V,
|
|
17
17
|
hidden: q
|
|
18
18
|
};
|
|
19
|
-
function D(
|
|
19
|
+
function D(i) {
|
|
20
20
|
const {
|
|
21
21
|
className: e,
|
|
22
|
-
color:
|
|
23
|
-
} =
|
|
24
|
-
return /* @__PURE__ */ t(
|
|
22
|
+
color: o = "inherit"
|
|
23
|
+
} = i, r = u(c.tableIcon, c.iconButton, e);
|
|
24
|
+
return /* @__PURE__ */ t($, { ...i, className: r, color: o });
|
|
25
25
|
}
|
|
26
|
-
function G(
|
|
26
|
+
function G(i) {
|
|
27
27
|
const {
|
|
28
28
|
item: e,
|
|
29
|
-
onSortClick:
|
|
30
|
-
} =
|
|
31
|
-
|
|
32
|
-
}, [e.sortKey, e.text,
|
|
33
|
-
[
|
|
34
|
-
[
|
|
29
|
+
onSortClick: o
|
|
30
|
+
} = i, r = l.useCallback(() => {
|
|
31
|
+
o && o(e.sortKey || e.text);
|
|
32
|
+
}, [e.sortKey, e.text, o]), s = u(c.headerContent, {
|
|
33
|
+
[c.sortable]: e.sortable,
|
|
34
|
+
[c.empty]: !e.text
|
|
35
35
|
});
|
|
36
36
|
return /* @__PURE__ */ t(
|
|
37
37
|
"th",
|
|
38
38
|
{
|
|
39
|
-
className: e.sortable ?
|
|
40
|
-
onClick: e.sortable ?
|
|
41
|
-
children: /* @__PURE__ */ C("div", { className:
|
|
39
|
+
className: e.sortable ? c.pointer : void 0,
|
|
40
|
+
onClick: e.sortable ? r : void 0,
|
|
41
|
+
children: /* @__PURE__ */ C("div", { className: s, children: [
|
|
42
42
|
/* @__PURE__ */ t(
|
|
43
|
-
|
|
43
|
+
S,
|
|
44
44
|
{
|
|
45
|
-
className:
|
|
45
|
+
className: c.headerText,
|
|
46
46
|
color: "secondary",
|
|
47
47
|
letterSpacing: "large",
|
|
48
48
|
weight: "bold",
|
|
@@ -55,50 +55,50 @@ function G(r) {
|
|
|
55
55
|
D,
|
|
56
56
|
{
|
|
57
57
|
name: "Sort",
|
|
58
|
-
onClick:
|
|
58
|
+
onClick: r
|
|
59
59
|
}
|
|
60
60
|
)
|
|
61
61
|
] })
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
|
-
function J(
|
|
65
|
+
function J(i) {
|
|
66
66
|
const {
|
|
67
67
|
index: e,
|
|
68
|
-
includeRadio:
|
|
69
|
-
loading:
|
|
70
|
-
selectedRow:
|
|
71
|
-
item:
|
|
72
|
-
dataContainer:
|
|
68
|
+
includeRadio: o = !1,
|
|
69
|
+
loading: r,
|
|
70
|
+
selectedRow: s,
|
|
71
|
+
item: T,
|
|
72
|
+
dataContainer: m,
|
|
73
73
|
onSelectChange: d
|
|
74
|
-
} =
|
|
74
|
+
} = i, h = l.useCallback((n) => {
|
|
75
75
|
d(
|
|
76
|
-
|
|
76
|
+
n ? e : null
|
|
77
77
|
);
|
|
78
|
-
}, [d, e]), b =
|
|
78
|
+
}, [d, e]), b = l.useCallback(() => {
|
|
79
79
|
d(e);
|
|
80
|
-
}, [d, e]),
|
|
81
|
-
[
|
|
82
|
-
[
|
|
80
|
+
}, [d, e]), p = u({
|
|
81
|
+
[c.selectedRow]: s === e,
|
|
82
|
+
[c.pointer]: o
|
|
83
83
|
});
|
|
84
84
|
return /* @__PURE__ */ C(
|
|
85
85
|
"tr",
|
|
86
86
|
{
|
|
87
|
-
className:
|
|
88
|
-
onClick:
|
|
87
|
+
className: p,
|
|
88
|
+
onClick: o ? b : void 0,
|
|
89
89
|
children: [
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
o && /* @__PURE__ */ t("td", { className: u(c.radio, { [c.hidden]: r }), children: /* @__PURE__ */ t("div", { className: c.radioContent, children: /* @__PURE__ */ t(
|
|
91
|
+
I,
|
|
92
92
|
{
|
|
93
93
|
size: "small",
|
|
94
|
-
onCheckedChange:
|
|
94
|
+
onCheckedChange: h,
|
|
95
95
|
"aria-label": `${e}`,
|
|
96
|
-
checked:
|
|
96
|
+
checked: s === e
|
|
97
97
|
}
|
|
98
98
|
) }) }),
|
|
99
|
-
|
|
100
|
-
let
|
|
101
|
-
return
|
|
99
|
+
T.map((n, x) => {
|
|
100
|
+
let f;
|
|
101
|
+
return l.isValidElement(n) ? f = n : m ? f = l.createElement(m, { item: n }) : f = String(n), /* @__PURE__ */ t("td", { children: f }, `item-${x}`);
|
|
102
102
|
})
|
|
103
103
|
]
|
|
104
104
|
},
|
|
@@ -106,58 +106,58 @@ function J(r) {
|
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
108
|
function W({
|
|
109
|
-
headers:
|
|
109
|
+
headers: i = [],
|
|
110
110
|
data: e = [],
|
|
111
|
-
includeRadio:
|
|
112
|
-
loading:
|
|
113
|
-
onSelectChange:
|
|
114
|
-
dataContainer:
|
|
115
|
-
selectedRow:
|
|
111
|
+
includeRadio: o = !1,
|
|
112
|
+
loading: r = !1,
|
|
113
|
+
onSelectChange: s,
|
|
114
|
+
dataContainer: T,
|
|
115
|
+
selectedRow: m = null,
|
|
116
116
|
sortBy: d,
|
|
117
|
-
sortOrder:
|
|
117
|
+
sortOrder: h = "asc",
|
|
118
118
|
onSortChange: b,
|
|
119
|
-
className:
|
|
119
|
+
className: p
|
|
120
120
|
}) {
|
|
121
|
-
const [
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
}, [b,
|
|
125
|
-
(
|
|
126
|
-
const
|
|
127
|
-
|
|
121
|
+
const [n, x] = k(m), [f, w] = k(d), [N, R] = k(h), v = l.useCallback((a) => {
|
|
122
|
+
const B = f === a && N === "asc" ? "desc" : "asc";
|
|
123
|
+
w(a), R(B), b == null || b(a, B);
|
|
124
|
+
}, [b, f, N]), y = l.useCallback(
|
|
125
|
+
(a) => {
|
|
126
|
+
const _ = a === n ? null : a;
|
|
127
|
+
x(_), s == null || s(_);
|
|
128
128
|
},
|
|
129
|
-
[
|
|
129
|
+
[s, n]
|
|
130
130
|
);
|
|
131
|
-
return
|
|
132
|
-
|
|
133
|
-
}, [
|
|
134
|
-
|
|
135
|
-
}, [d]),
|
|
136
|
-
R(
|
|
137
|
-
}, [
|
|
131
|
+
return l.useEffect(() => {
|
|
132
|
+
x(m);
|
|
133
|
+
}, [m]), l.useEffect(() => {
|
|
134
|
+
w(d);
|
|
135
|
+
}, [d]), l.useEffect(() => {
|
|
136
|
+
R(h);
|
|
137
|
+
}, [h]), /* @__PURE__ */ t("div", { className: u(c.root, p), children: /* @__PURE__ */ C("table", { children: [
|
|
138
138
|
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ C("tr", { children: [
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
o && /* @__PURE__ */ t("th", { "aria-label": "Select Row" }),
|
|
140
|
+
i.map((a, _) => /* @__PURE__ */ t(
|
|
141
141
|
G,
|
|
142
142
|
{
|
|
143
|
-
item:
|
|
144
|
-
onSortClick:
|
|
143
|
+
item: a,
|
|
144
|
+
onSortClick: v
|
|
145
145
|
},
|
|
146
|
-
`header-${
|
|
146
|
+
`header-${_}`
|
|
147
147
|
))
|
|
148
148
|
] }) }),
|
|
149
|
-
/* @__PURE__ */ t("tbody", { children: e.map((
|
|
149
|
+
/* @__PURE__ */ t("tbody", { children: e.map((a, _) => /* @__PURE__ */ t(
|
|
150
150
|
J,
|
|
151
151
|
{
|
|
152
|
-
index:
|
|
153
|
-
item:
|
|
154
|
-
includeRadio:
|
|
155
|
-
loading:
|
|
156
|
-
selectedRow:
|
|
157
|
-
onSelectChange:
|
|
158
|
-
dataContainer:
|
|
152
|
+
index: _,
|
|
153
|
+
item: a,
|
|
154
|
+
includeRadio: o,
|
|
155
|
+
loading: r,
|
|
156
|
+
selectedRow: n,
|
|
157
|
+
onSelectChange: y,
|
|
158
|
+
dataContainer: T
|
|
159
159
|
},
|
|
160
|
-
`row-${
|
|
160
|
+
`row-${_}`
|
|
161
161
|
)) })
|
|
162
162
|
] }) });
|
|
163
163
|
}
|