@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,94 +1,94 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Dot as
|
|
4
|
-
import { clsx as
|
|
5
|
-
const
|
|
6
|
-
reset:
|
|
7
|
-
root:
|
|
8
|
-
"theme-dark": "
|
|
9
|
-
"theme-light": "
|
|
10
|
-
item:
|
|
11
|
-
active:
|
|
12
|
-
hasNotification:
|
|
13
|
-
content:
|
|
1
|
+
import { jsx as n, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import b, { createElement as T } from "react";
|
|
3
|
+
import { Dot as k } from "../Dot/Dot.js";
|
|
4
|
+
import { clsx as d } from "../../utils/clsx.js";
|
|
5
|
+
const v = "cfxui__Tabular__reset__b1dbc", C = "cfxui__Tabular__root__0ff05", p = "cfxui__Tabular__item__98cc3", I = "cfxui__Tabular__active__1ae95", R = "cfxui__Tabular__hasNotification__c372f", g = "cfxui__Tabular__content__3a95a", e = {
|
|
6
|
+
reset: v,
|
|
7
|
+
root: C,
|
|
8
|
+
"theme-dark": "cfxui__Tabular__theme-dark__80b8c",
|
|
9
|
+
"theme-light": "cfxui__Tabular__theme-light__c05b9",
|
|
10
|
+
item: p,
|
|
11
|
+
active: I,
|
|
12
|
+
hasNotification: R,
|
|
13
|
+
content: g
|
|
14
14
|
};
|
|
15
|
-
function m
|
|
15
|
+
function _(m) {
|
|
16
16
|
const {
|
|
17
17
|
items: i,
|
|
18
18
|
activeItem: o,
|
|
19
|
-
onActivate:
|
|
19
|
+
onActivate: t,
|
|
20
20
|
itemClassName: c,
|
|
21
|
-
...
|
|
22
|
-
} =
|
|
23
|
-
|
|
24
|
-
}, [
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
21
|
+
...s
|
|
22
|
+
} = m, l = b.useCallback((a) => {
|
|
23
|
+
t && t(a);
|
|
24
|
+
}, [t]);
|
|
25
|
+
return /* @__PURE__ */ n(_.Root, { ...s, children: i.map((a) => /* @__PURE__ */ T(
|
|
26
|
+
_.Item,
|
|
27
27
|
{
|
|
28
|
-
...
|
|
28
|
+
...a,
|
|
29
29
|
className: c,
|
|
30
|
-
key:
|
|
31
|
-
active:
|
|
32
|
-
onClick:
|
|
30
|
+
key: a.id,
|
|
31
|
+
active: a.id === o,
|
|
32
|
+
onClick: l
|
|
33
33
|
}
|
|
34
34
|
)) });
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
_.Root = function(i) {
|
|
37
37
|
const {
|
|
38
38
|
children: o,
|
|
39
|
-
className:
|
|
39
|
+
className: t,
|
|
40
40
|
ariaLabel: c,
|
|
41
|
-
tabIndex:
|
|
42
|
-
theme:
|
|
43
|
-
role:
|
|
44
|
-
} = i,
|
|
45
|
-
return /* @__PURE__ */
|
|
41
|
+
tabIndex: s,
|
|
42
|
+
theme: l = "dark",
|
|
43
|
+
role: a = "tablist"
|
|
44
|
+
} = i, r = d(e.root, e[`theme-${l}`], t);
|
|
45
|
+
return /* @__PURE__ */ n(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
|
-
role:
|
|
48
|
+
role: a,
|
|
49
49
|
"aria-label": c,
|
|
50
|
-
tabIndex:
|
|
51
|
-
className:
|
|
50
|
+
tabIndex: s,
|
|
51
|
+
className: r,
|
|
52
52
|
children: o
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
_.Item = function(i) {
|
|
57
57
|
const {
|
|
58
58
|
id: o,
|
|
59
|
-
label:
|
|
59
|
+
label: t,
|
|
60
60
|
onClick: c,
|
|
61
|
-
ariaLabel:
|
|
62
|
-
ariaControls:
|
|
63
|
-
className:
|
|
64
|
-
active:
|
|
65
|
-
disabled:
|
|
66
|
-
hasNotification:
|
|
67
|
-
} = i,
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
[
|
|
71
|
-
[
|
|
61
|
+
ariaLabel: s,
|
|
62
|
+
ariaControls: l,
|
|
63
|
+
className: a,
|
|
64
|
+
active: r = !1,
|
|
65
|
+
disabled: f = !1,
|
|
66
|
+
hasNotification: u = !1
|
|
67
|
+
} = i, h = b.useCallback(() => {
|
|
68
|
+
f || c(o);
|
|
69
|
+
}, [f, c, o]), N = d(e.reset, e.item, a, {
|
|
70
|
+
[e.active]: r,
|
|
71
|
+
[e.hasNotification]: u
|
|
72
72
|
});
|
|
73
|
-
return /* @__PURE__ */
|
|
73
|
+
return /* @__PURE__ */ n(
|
|
74
74
|
"button",
|
|
75
75
|
{
|
|
76
|
-
disabled:
|
|
76
|
+
disabled: f,
|
|
77
77
|
type: "button",
|
|
78
78
|
role: "tab",
|
|
79
|
-
className:
|
|
80
|
-
onClick:
|
|
81
|
-
"aria-label":
|
|
82
|
-
"aria-controls":
|
|
83
|
-
"data-text":
|
|
84
|
-
"aria-selected":
|
|
85
|
-
children: /* @__PURE__ */ x("span", { className:
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
className: N,
|
|
80
|
+
onClick: h,
|
|
81
|
+
"aria-label": s,
|
|
82
|
+
"aria-controls": l,
|
|
83
|
+
"data-text": t,
|
|
84
|
+
"aria-selected": r,
|
|
85
|
+
children: /* @__PURE__ */ x("span", { className: e.content, children: [
|
|
86
|
+
t,
|
|
87
|
+
u && /* @__PURE__ */ n(k, { color: "green", className: e.notification })
|
|
88
88
|
] })
|
|
89
89
|
}
|
|
90
90
|
);
|
|
91
91
|
};
|
|
92
92
|
export {
|
|
93
|
-
|
|
93
|
+
_ as Tabular
|
|
94
94
|
};
|
|
@@ -3,7 +3,7 @@ import l from "react";
|
|
|
3
3
|
import { ui as C } from "../ui.js";
|
|
4
4
|
import { clsx as w } from "../../utils/clsx.js";
|
|
5
5
|
import { getColor as A } from "../../utils/color.js";
|
|
6
|
-
const O = "
|
|
6
|
+
const O = "cfxui__Text__root__2fe11", R = "cfxui__Text__centered__4d7bd", S = "cfxui__Text__underlined__5860e", $ = "cfxui__Text__truncated__417f4", E = "cfxui__Text__typographic__d8155", N = "cfxui__Text__block__cb1b6", o = {
|
|
7
7
|
root: O,
|
|
8
8
|
centered: R,
|
|
9
9
|
underlined: S,
|
|
@@ -28,39 +28,39 @@ const O = "_root_14isi_1", R = "_centered_14isi_4", S = "_underlined_14isi_7", $
|
|
|
28
28
|
return typeof e == "string" || typeof e == "number" ? e : t;
|
|
29
29
|
}, D = "primary", F = l.forwardRef(function(t, e) {
|
|
30
30
|
const {
|
|
31
|
-
family:
|
|
31
|
+
family: n,
|
|
32
32
|
size: a = "normal",
|
|
33
|
-
weight:
|
|
34
|
-
letterSpacing:
|
|
35
|
-
as:
|
|
36
|
-
centered:
|
|
37
|
-
truncated:
|
|
38
|
-
typographic:
|
|
39
|
-
uppercase:
|
|
40
|
-
userSelectable:
|
|
41
|
-
underlined:
|
|
42
|
-
children:
|
|
43
|
-
className:
|
|
44
|
-
} = t,
|
|
45
|
-
[o.block]:
|
|
46
|
-
[o.centered]:
|
|
47
|
-
[o.truncated]:
|
|
48
|
-
[o.underlined]:
|
|
49
|
-
[o.typographic]:
|
|
50
|
-
[C.cls.userSelectableText]:
|
|
51
|
-
}),
|
|
33
|
+
weight: _ = "normal",
|
|
34
|
+
letterSpacing: f = "normal",
|
|
35
|
+
as: c = "span",
|
|
36
|
+
centered: p = !1,
|
|
37
|
+
truncated: d = !1,
|
|
38
|
+
typographic: u = !1,
|
|
39
|
+
uppercase: m = !1,
|
|
40
|
+
userSelectable: x = !1,
|
|
41
|
+
underlined: h = !1,
|
|
42
|
+
children: y,
|
|
43
|
+
className: T
|
|
44
|
+
} = t, g = c === "div", b = w(o.root, T, {
|
|
45
|
+
[o.block]: g,
|
|
46
|
+
[o.centered]: p,
|
|
47
|
+
[o.truncated]: d,
|
|
48
|
+
[o.underlined]: h,
|
|
49
|
+
[o.typographic]: u,
|
|
50
|
+
[C.cls.userSelectableText]: x
|
|
51
|
+
}), v = A({
|
|
52
52
|
...t,
|
|
53
53
|
color: t.color || D,
|
|
54
54
|
opacity: P(t.opacity)
|
|
55
|
-
}), k = typeof
|
|
56
|
-
color:
|
|
55
|
+
}), k = typeof n == "string" ? n : B[c] || "primary", i = {
|
|
56
|
+
color: v,
|
|
57
57
|
fontFamily: `var(--font-family-${k})`,
|
|
58
58
|
fontSize: `var(--font-size-${a})`,
|
|
59
59
|
lineHeight: `var(--line-height-${a})`,
|
|
60
|
-
letterSpacing: `var(--letter-spacing-${
|
|
61
|
-
fontWeight: `var(--font-weight-${
|
|
60
|
+
letterSpacing: `var(--letter-spacing-${f})`,
|
|
61
|
+
fontWeight: `var(--font-weight-${_})`
|
|
62
62
|
};
|
|
63
|
-
return
|
|
63
|
+
return m && (i.textTransform = "uppercase"), /* @__PURE__ */ s(c, { ref: e, dir: "auto", className: b, style: i, children: y });
|
|
64
64
|
}), G = l.forwardRef(function(t, e) {
|
|
65
65
|
return /* @__PURE__ */ s(F, { ref: e, ...t, as: "div" });
|
|
66
66
|
});
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { jsx as o, jsxs as t, Fragment as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import p from "react";
|
|
3
3
|
import { Text as c } from "./Text.js";
|
|
4
4
|
import { Separator as d } from "../Separator/Separator.js";
|
|
5
|
-
const h = "
|
|
5
|
+
const h = "cfxui__TextShowcase__root__a3632", _ = {
|
|
6
6
|
root: h
|
|
7
|
-
},
|
|
7
|
+
}, f = "The quick brown fox jumps over the lazy dog.", T = "How vexingly quick daft zebras jump.";
|
|
8
8
|
function u() {
|
|
9
9
|
return /* @__PURE__ */ t(e, { children: [
|
|
10
|
-
|
|
10
|
+
f,
|
|
11
11
|
/* @__PURE__ */ o("br", {}),
|
|
12
|
-
|
|
12
|
+
T
|
|
13
13
|
] });
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const x = {
|
|
16
16
|
color: "secondary"
|
|
17
17
|
};
|
|
18
|
-
function
|
|
18
|
+
function m(a) {
|
|
19
19
|
const {
|
|
20
|
-
items:
|
|
21
|
-
} =
|
|
22
|
-
return /* @__PURE__ */ o("div", { className:
|
|
20
|
+
items: l
|
|
21
|
+
} = a;
|
|
22
|
+
return /* @__PURE__ */ o("div", { className: _.root, children: l.map((r) => /* @__PURE__ */ t(e, { children: [
|
|
23
23
|
/* @__PURE__ */ t("div", { children: [
|
|
24
24
|
/* @__PURE__ */ o(c, { ...r.textProps, children: r.title }),
|
|
25
25
|
/* @__PURE__ */ o("br", {}),
|
|
26
|
-
/* @__PURE__ */ t(c, { ...
|
|
27
|
-
r.descriptions.map((
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
/* @__PURE__ */ t(c, { ...x, children: [
|
|
27
|
+
r.descriptions.map((s, n) => /* @__PURE__ */ t(e, { children: [
|
|
28
|
+
s,
|
|
29
|
+
n < r.descriptions.length - 1 && /* @__PURE__ */ o("br", {})
|
|
30
30
|
] })),
|
|
31
|
-
Object.entries(r.textProps).map(([
|
|
31
|
+
Object.entries(r.textProps).map(([s, n], i) => /* @__PURE__ */ t(e, { children: [
|
|
32
32
|
r.descriptions.length > 0 && i === 0 && /* @__PURE__ */ o(d, { content: "props", offset: "large" }),
|
|
33
|
-
|
|
33
|
+
s,
|
|
34
34
|
": ",
|
|
35
|
-
|
|
35
|
+
n.toString(),
|
|
36
36
|
i < r.descriptions.length - 1 && /* @__PURE__ */ o("br", {})
|
|
37
37
|
] }))
|
|
38
38
|
] })
|
|
@@ -40,7 +40,7 @@ function x(l) {
|
|
|
40
40
|
/* @__PURE__ */ o(c, { ...r.textProps, children: /* @__PURE__ */ o(u, {}) })
|
|
41
41
|
] })) });
|
|
42
42
|
}
|
|
43
|
-
const
|
|
43
|
+
const E = p.memo(m);
|
|
44
44
|
export {
|
|
45
|
-
|
|
45
|
+
E as default
|
|
46
46
|
};
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { clsx as
|
|
4
|
-
const
|
|
5
|
-
root:
|
|
6
|
-
"full-width": "
|
|
1
|
+
import { jsx as l, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import s from "react";
|
|
3
|
+
import { clsx as p } from "../../utils/clsx.js";
|
|
4
|
+
const g = "cfxui__Textarea__root__688b1", k = "cfxui__Textarea__small__e7551", v = "cfxui__Textarea__large__09eeb", C = "cfxui__Textarea__error__932cb", N = "cfxui__Textarea__disabled__5d783", e = {
|
|
5
|
+
root: g,
|
|
6
|
+
"full-width": "cfxui__Textarea__full-width__975d6",
|
|
7
7
|
small: k,
|
|
8
8
|
large: v,
|
|
9
9
|
error: C,
|
|
10
10
|
disabled: N,
|
|
11
|
-
"resize-none": "
|
|
12
|
-
"resize-vertical": "
|
|
13
|
-
"resize-horizontal": "
|
|
14
|
-
"resize-both": "
|
|
15
|
-
"backdrop-blur": "
|
|
11
|
+
"resize-none": "cfxui__Textarea__resize-none__1130d",
|
|
12
|
+
"resize-vertical": "cfxui__Textarea__resize-vertical__f856e",
|
|
13
|
+
"resize-horizontal": "cfxui__Textarea__resize-horizontal__b4b8f",
|
|
14
|
+
"resize-both": "cfxui__Textarea__resize-both__004b8",
|
|
15
|
+
"backdrop-blur": "cfxui__Textarea__backdrop-blur__45372"
|
|
16
16
|
};
|
|
17
|
-
function I(
|
|
17
|
+
function I(c) {
|
|
18
18
|
const {
|
|
19
|
-
value:
|
|
19
|
+
value: i,
|
|
20
20
|
onChange: a,
|
|
21
21
|
label: r,
|
|
22
|
-
placeholder:
|
|
22
|
+
placeholder: n,
|
|
23
23
|
rows: d,
|
|
24
|
-
resize:
|
|
25
|
-
disabled:
|
|
26
|
-
autofocus:
|
|
27
|
-
className:
|
|
28
|
-
backdropBlur:
|
|
29
|
-
} =
|
|
30
|
-
(
|
|
31
|
-
a(
|
|
24
|
+
resize: x = "none",
|
|
25
|
+
disabled: _ = !1,
|
|
26
|
+
autofocus: u,
|
|
27
|
+
className: b,
|
|
28
|
+
backdropBlur: f = !1
|
|
29
|
+
} = c, h = s.useCallback(
|
|
30
|
+
(z) => {
|
|
31
|
+
a(z.target.value);
|
|
32
32
|
},
|
|
33
33
|
[a]
|
|
34
|
-
),
|
|
34
|
+
), o = s.useId(), t = /* @__PURE__ */ l(
|
|
35
35
|
"textarea",
|
|
36
36
|
{
|
|
37
|
-
autoFocus:
|
|
38
|
-
id:
|
|
39
|
-
className: e[`resize-${
|
|
37
|
+
autoFocus: u,
|
|
38
|
+
id: o,
|
|
39
|
+
className: e[`resize-${x}`],
|
|
40
40
|
rows: d,
|
|
41
|
-
value:
|
|
42
|
-
disabled:
|
|
43
|
-
onChange:
|
|
44
|
-
placeholder:
|
|
41
|
+
value: i,
|
|
42
|
+
disabled: _,
|
|
43
|
+
onChange: h,
|
|
44
|
+
placeholder: n
|
|
45
45
|
}
|
|
46
|
-
),
|
|
47
|
-
[e.disabled]:
|
|
48
|
-
[e["backdrop-blur"]]:
|
|
46
|
+
), m = p(e.root, b, {
|
|
47
|
+
[e.disabled]: _,
|
|
48
|
+
[e["backdrop-blur"]]: f
|
|
49
49
|
});
|
|
50
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ l("div", { className: m, children: r ? /* @__PURE__ */ T("label", { htmlFor: o, children: [
|
|
51
51
|
r,
|
|
52
|
-
|
|
53
|
-
] }) :
|
|
52
|
+
t
|
|
53
|
+
] }) : t });
|
|
54
54
|
}
|
|
55
55
|
export {
|
|
56
56
|
I as Textarea
|
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
import { jsx as h, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { clsx as
|
|
1
|
+
import { jsx as h, jsxs as k, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import s from "react";
|
|
3
|
+
import { clsx as w } from "../../utils/clsx.js";
|
|
4
4
|
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
5
5
|
import "../../utils/hooks/useKeyboardClose.js";
|
|
6
|
-
import { useOutlet as
|
|
6
|
+
import { useOutlet as y } from "../../utils/hooks/useOutlet.js";
|
|
7
7
|
import { mergeRefs as C } from "../../utils/mergeRefs.js";
|
|
8
|
-
const N = "
|
|
8
|
+
const N = "cfxui__Title__wrapper__ec63b", $ = "cfxui__Title__appearance__9b5a4", A = "cfxui__Title__animated__151a8", F = "cfxui__Title__root__0f286", I = "cfxui__Title__shortcut__85352", p = {
|
|
9
9
|
wrapper: N,
|
|
10
10
|
appearance: $,
|
|
11
11
|
animated: A,
|
|
12
|
-
"fixed-on-top": "
|
|
13
|
-
"fixed-on-top-left": "
|
|
14
|
-
"fixed-on-bottom": "
|
|
15
|
-
"fixed-on-bottom-left": "
|
|
16
|
-
"fixed-on-bottom-right": "
|
|
17
|
-
"fixed-on-left": "
|
|
18
|
-
"fixed-on-right": "
|
|
12
|
+
"fixed-on-top": "cfxui__Title__fixed-on-top__100f6",
|
|
13
|
+
"fixed-on-top-left": "cfxui__Title__fixed-on-top-left__ec383",
|
|
14
|
+
"fixed-on-bottom": "cfxui__Title__fixed-on-bottom__a00c2",
|
|
15
|
+
"fixed-on-bottom-left": "cfxui__Title__fixed-on-bottom-left__3bcbd",
|
|
16
|
+
"fixed-on-bottom-right": "cfxui__Title__fixed-on-bottom-right__58fb5",
|
|
17
|
+
"fixed-on-left": "cfxui__Title__fixed-on-left__01d9d",
|
|
18
|
+
"fixed-on-right": "cfxui__Title__fixed-on-right__2c799",
|
|
19
19
|
root: F,
|
|
20
20
|
shortcut: I
|
|
21
|
-
},
|
|
22
|
-
function j(u,
|
|
23
|
-
const n = u ? r : r - 20,
|
|
21
|
+
}, a = 10, S = "title-outlet";
|
|
22
|
+
function j(u, f, [e, r]) {
|
|
23
|
+
const n = u ? r : r - 20, i = u ? e : e + 16;
|
|
24
24
|
return {
|
|
25
25
|
top: `${n}px`,
|
|
26
|
-
left: `${
|
|
27
|
-
maxWidth: `calc(100vw - ${
|
|
28
|
-
animationDelay: `${
|
|
26
|
+
left: `${i}px`,
|
|
27
|
+
maxWidth: `calc(100vw - ${i}px - 10px)`,
|
|
28
|
+
animationDelay: `${f}ms`
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function D(u,
|
|
31
|
+
function D(u, f) {
|
|
32
32
|
const {
|
|
33
33
|
x: e,
|
|
34
34
|
y: r,
|
|
35
35
|
width: n,
|
|
36
|
-
height:
|
|
36
|
+
height: i
|
|
37
37
|
} = u.getBoundingClientRect();
|
|
38
38
|
let c = 0, t = 0;
|
|
39
|
-
switch (
|
|
39
|
+
switch (f) {
|
|
40
40
|
case "top":
|
|
41
|
-
c = e + n / 2, t = r -
|
|
41
|
+
c = e + n / 2, t = r - a;
|
|
42
42
|
break;
|
|
43
43
|
case "top-left":
|
|
44
|
-
c = e, t = r -
|
|
44
|
+
c = e, t = r - a;
|
|
45
45
|
break;
|
|
46
46
|
case "bottom":
|
|
47
|
-
c = e + n / 2, t = r +
|
|
47
|
+
c = e + n / 2, t = r + i + a;
|
|
48
48
|
break;
|
|
49
49
|
case "bottom-left":
|
|
50
|
-
c = e, t = r +
|
|
50
|
+
c = e, t = r + i + a;
|
|
51
51
|
break;
|
|
52
52
|
case "bottom-right":
|
|
53
|
-
c = e + n, t = r +
|
|
53
|
+
c = e + n, t = r + i + a;
|
|
54
54
|
break;
|
|
55
55
|
case "left":
|
|
56
|
-
c = e -
|
|
56
|
+
c = e - a, t = r + i / 2;
|
|
57
57
|
break;
|
|
58
58
|
case "right":
|
|
59
|
-
c = e + n +
|
|
59
|
+
c = e + n + a, t = r + i / 2;
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
62
62
|
return [c, t];
|
|
63
63
|
}
|
|
64
64
|
function G(u) {
|
|
65
65
|
const {
|
|
66
|
-
title:
|
|
66
|
+
title: f,
|
|
67
67
|
children: e,
|
|
68
68
|
animated: r = !0,
|
|
69
69
|
fixedOn: n = "bottom",
|
|
70
|
-
delay:
|
|
70
|
+
delay: i = 0,
|
|
71
71
|
className: c = "",
|
|
72
72
|
suppressMouseActivation: t = !1,
|
|
73
|
-
active:
|
|
74
|
-
rootClassName:
|
|
75
|
-
} = u,
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
t && x(
|
|
80
|
-
}, [
|
|
73
|
+
active: b = !1,
|
|
74
|
+
rootClassName: v = ""
|
|
75
|
+
} = u, l = s.useRef(n), m = s.useRef([0, 0]);
|
|
76
|
+
l.current = n;
|
|
77
|
+
const T = y(S), o = s.useRef(null), [E, x] = s.useState(!1);
|
|
78
|
+
s.useEffect(() => {
|
|
79
|
+
t && x(b);
|
|
80
|
+
}, [b, t]), s.useEffect(() => {
|
|
81
81
|
if (!o.current)
|
|
82
82
|
return;
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
},
|
|
83
|
+
const d = (_) => {
|
|
84
|
+
l.current && o.current ? m.current = D(o.current, l.current) : m.current = [_.clientX, _.clientY], t || x(!0);
|
|
85
|
+
}, g = () => {
|
|
86
86
|
t || x(!1);
|
|
87
|
-
},
|
|
88
|
-
|
|
87
|
+
}, L = (_) => {
|
|
88
|
+
l.current || (m.current = [_.clientX, _.clientY]);
|
|
89
89
|
};
|
|
90
|
-
return o.current.addEventListener("mouseenter",
|
|
91
|
-
o.current && (o.current.removeEventListener("mouseenter",
|
|
90
|
+
return o.current.addEventListener("mouseenter", d), o.current.addEventListener("mouseleave", g), o.current.addEventListener("mousemove", L), () => {
|
|
91
|
+
o.current && (o.current.removeEventListener("mouseenter", d), o.current.removeEventListener("mouseleave", g), o.current.removeEventListener("mousemove", L));
|
|
92
92
|
};
|
|
93
93
|
}, [t]);
|
|
94
|
-
const
|
|
95
|
-
if (!
|
|
94
|
+
const O = s.useMemo(() => {
|
|
95
|
+
if (!E || !f)
|
|
96
96
|
return null;
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
const d = w(
|
|
98
|
+
p.wrapper,
|
|
99
|
+
p[`fixed-on-${n}`],
|
|
100
100
|
{
|
|
101
|
-
[
|
|
101
|
+
[p.animated]: r
|
|
102
102
|
},
|
|
103
103
|
c
|
|
104
104
|
);
|
|
105
|
-
return /* @__PURE__ */ h(
|
|
106
|
-
}, [
|
|
107
|
-
() => typeof e == "function" ? e(o) :
|
|
105
|
+
return /* @__PURE__ */ h(T, { children: /* @__PURE__ */ h("div", { className: d, style: j(!!n, i, m.current), children: /* @__PURE__ */ h("div", { className: w(p.root, v), children: f }) }) });
|
|
106
|
+
}, [E, f, n, r, T, i, c, v]), R = s.useMemo(
|
|
107
|
+
() => typeof e == "function" ? e(o) : s.cloneElement(e, {
|
|
108
108
|
ref: C(o, e.props.ref)
|
|
109
109
|
}),
|
|
110
110
|
[e, o]
|
|
111
111
|
);
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
return /* @__PURE__ */ k(M, { children: [
|
|
113
|
+
R,
|
|
114
|
+
O
|
|
115
115
|
] });
|
|
116
116
|
}
|
|
117
117
|
export {
|