@cfx-dev/ui-components 3.0.2 → 3.0.4
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 +27 -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,24 +1,24 @@
|
|
|
1
1
|
import { default as o } from "./cfx-icons/Close.js";
|
|
2
|
-
import { default as
|
|
2
|
+
import { default as a } from "./cfx-icons/Controller.js";
|
|
3
3
|
import { default as l } from "./cfx-icons/Copy.js";
|
|
4
4
|
import { default as p } from "./cfx-icons/DownArrow.js";
|
|
5
|
-
import { default as
|
|
5
|
+
import { default as d } from "./cfx-icons/DownChevron.js";
|
|
6
6
|
import { default as m } from "./cfx-icons/Download.js";
|
|
7
7
|
import { default as i } from "./cfx-icons/Expand.js";
|
|
8
8
|
import { default as C } from "./cfx-icons/ExternalLink.js";
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
9
|
+
import { default as w } from "./cfx-icons/Heart.js";
|
|
10
|
+
import { default as c } from "./cfx-icons/HeartFilled.js";
|
|
11
|
+
import { default as S } from "./cfx-icons/Help.js";
|
|
12
|
+
import { default as y } from "./cfx-icons/LeftArrow.js";
|
|
13
|
+
import { default as R } from "./cfx-icons/LeftChevron.js";
|
|
14
|
+
import { default as D } from "./cfx-icons/Map.js";
|
|
15
|
+
import { default as L } from "./cfx-icons/Menu.js";
|
|
16
16
|
import { default as T } from "./cfx-icons/Minus.js";
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
17
|
+
import { default as b } from "./cfx-icons/More.js";
|
|
18
|
+
import { default as E } from "./cfx-icons/MoreInfo.js";
|
|
19
|
+
import { default as F } from "./cfx-icons/Pencil.js";
|
|
20
|
+
import { default as O } from "./cfx-icons/Play.js";
|
|
21
|
+
import { default as j } from "./cfx-icons/Plus.js";
|
|
22
22
|
import { default as G } from "./cfx-icons/Refresh.js";
|
|
23
23
|
import { default as K } from "./cfx-icons/RightArrow.js";
|
|
24
24
|
import { default as Q } from "./cfx-icons/RightChevron.js";
|
|
@@ -26,40 +26,46 @@ import { default as Y } from "./cfx-icons/Search.js";
|
|
|
26
26
|
import { default as _ } from "./cfx-icons/Sort.js";
|
|
27
27
|
import { default as rr } from "./cfx-icons/Square.js";
|
|
28
28
|
import { default as or } from "./cfx-icons/SquareCheck.js";
|
|
29
|
-
import { default as
|
|
29
|
+
import { default as ar } from "./cfx-icons/Stop.js";
|
|
30
30
|
import { default as lr } from "./cfx-icons/Tick.js";
|
|
31
31
|
import { default as pr } from "./cfx-icons/Transfer.js";
|
|
32
|
-
import { default as
|
|
32
|
+
import { default as dr } from "./cfx-icons/Trash.js";
|
|
33
33
|
import { default as mr } from "./cfx-icons/Undo.js";
|
|
34
34
|
import { default as ir } from "./cfx-icons/UpArrow.js";
|
|
35
35
|
import { default as Cr } from "./cfx-icons/UpChevron.js";
|
|
36
|
-
import { default as
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
40
|
-
import { default as
|
|
36
|
+
import { default as wr } from "./cfx-icons/Upload.js";
|
|
37
|
+
import { default as cr } from "./cfx-icons/Users.js";
|
|
38
|
+
import { default as Sr } from "./cfx-icons/Visibility.js";
|
|
39
|
+
import { default as yr } from "./cfx-icons/VisibilityOff.js";
|
|
40
|
+
import { default as Rr } from "./cfx-icons/Warning.js";
|
|
41
|
+
import { default as Dr } from "./cfx-icons/Cart.js";
|
|
42
|
+
import { default as Lr } from "./cfx-icons/User.js";
|
|
43
|
+
import { default as Tr } from "./cfx-icons/Verified.js";
|
|
44
|
+
import { default as br } from "./cfx-icons/UpvotesBurst.js";
|
|
45
|
+
import { default as Er } from "./cfx-icons/UpvotesRecurring.js";
|
|
41
46
|
export {
|
|
47
|
+
Dr as Cart,
|
|
42
48
|
o as Close,
|
|
43
|
-
|
|
49
|
+
a as Controller,
|
|
44
50
|
l as Copy,
|
|
45
51
|
p as DownArrow,
|
|
46
|
-
|
|
52
|
+
d as DownChevron,
|
|
47
53
|
m as Download,
|
|
48
54
|
i as Expand,
|
|
49
55
|
C as ExternalLink,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
w as Heart,
|
|
57
|
+
c as HeartFilled,
|
|
58
|
+
S as Help,
|
|
59
|
+
y as LeftArrow,
|
|
60
|
+
R as LeftChevron,
|
|
61
|
+
D as Map,
|
|
62
|
+
L as Menu,
|
|
57
63
|
T as Minus,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
b as More,
|
|
65
|
+
E as MoreInfo,
|
|
66
|
+
F as Pencil,
|
|
67
|
+
O as Play,
|
|
68
|
+
j as Plus,
|
|
63
69
|
G as Refresh,
|
|
64
70
|
K as RightArrow,
|
|
65
71
|
Q as RightChevron,
|
|
@@ -67,16 +73,20 @@ export {
|
|
|
67
73
|
_ as Sort,
|
|
68
74
|
rr as Square,
|
|
69
75
|
or as SquareCheck,
|
|
70
|
-
|
|
76
|
+
ar as Stop,
|
|
71
77
|
lr as Tick,
|
|
72
78
|
pr as Transfer,
|
|
73
|
-
|
|
79
|
+
dr as Trash,
|
|
74
80
|
mr as Undo,
|
|
75
81
|
ir as UpArrow,
|
|
76
82
|
Cr as UpChevron,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
wr as Upload,
|
|
84
|
+
br as UpvotesBurst,
|
|
85
|
+
Er as UpvotesRecurring,
|
|
86
|
+
Lr as User,
|
|
87
|
+
cr as Users,
|
|
88
|
+
Tr as Verified,
|
|
89
|
+
Sr as Visibility,
|
|
90
|
+
yr as VisibilityOff,
|
|
91
|
+
Rr as Warning
|
|
82
92
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { clsx as
|
|
4
|
-
const
|
|
5
|
-
root:
|
|
6
|
-
indicator:
|
|
7
|
-
},
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import a from "react";
|
|
3
|
+
import { clsx as n } from "../../utils/clsx.js";
|
|
4
|
+
const c = "cfxui__Indicator__root__71ac4", s = "cfxui__Indicator__indicator__9d908", r = {
|
|
5
|
+
root: c,
|
|
6
|
+
indicator: s
|
|
7
|
+
}, d = { animationDelay: "0ms" }, e = { animationDelay: "50ms" }, m = { animationDelay: "100ms" }, l = { animationDelay: "150ms" }, u = a.memo(function({
|
|
8
8
|
className: t
|
|
9
9
|
}) {
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */ o("div", { style: c }),
|
|
12
|
-
/* @__PURE__ */ o("div", { style: m }),
|
|
10
|
+
return /* @__PURE__ */ i("div", { className: n(r.root, t), children: [
|
|
13
11
|
/* @__PURE__ */ o("div", { style: d }),
|
|
12
|
+
/* @__PURE__ */ o("div", { style: e }),
|
|
13
|
+
/* @__PURE__ */ o("div", { style: m }),
|
|
14
14
|
/* @__PURE__ */ o("div", { style: l })
|
|
15
15
|
] });
|
|
16
16
|
});
|
|
17
17
|
export {
|
|
18
|
-
|
|
18
|
+
u as Indicator
|
|
19
19
|
};
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import u from "react";
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { clsx as
|
|
5
|
-
const
|
|
6
|
-
rootUnset:
|
|
7
|
-
root:
|
|
8
|
-
interactive:
|
|
9
|
-
interactiveIcon:
|
|
10
|
-
"type-neutral": "
|
|
11
|
-
"type-error": "
|
|
12
|
-
"type-success": "
|
|
13
|
-
"type-warning": "
|
|
14
|
-
"size-small": "
|
|
15
|
-
"size-large": "
|
|
16
|
-
icon:
|
|
17
|
-
content:
|
|
3
|
+
import { Icon as _ } from "../Icon/Icon.js";
|
|
4
|
+
import { clsx as x } from "../../utils/clsx.js";
|
|
5
|
+
const I = "cfxui__InfoPanel__rootUnset__7ca3f", p = "cfxui__InfoPanel__root__a19ad", P = "cfxui__InfoPanel__interactive__1b051", v = "cfxui__InfoPanel__interactiveIcon__03510", y = "cfxui__InfoPanel__icon__b2fca", d = "cfxui__InfoPanel__content__43082", n = {
|
|
6
|
+
rootUnset: I,
|
|
7
|
+
root: p,
|
|
8
|
+
interactive: P,
|
|
9
|
+
interactiveIcon: v,
|
|
10
|
+
"type-neutral": "cfxui__InfoPanel__type-neutral__c4653",
|
|
11
|
+
"type-error": "cfxui__InfoPanel__type-error__bdfbf",
|
|
12
|
+
"type-success": "cfxui__InfoPanel__type-success__e3f02",
|
|
13
|
+
"type-warning": "cfxui__InfoPanel__type-warning__053e4",
|
|
14
|
+
"size-small": "cfxui__InfoPanel__size-small__815a3",
|
|
15
|
+
"size-large": "cfxui__InfoPanel__size-large__20a20",
|
|
16
|
+
icon: y,
|
|
17
|
+
content: d
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function b(a) {
|
|
20
20
|
const {
|
|
21
21
|
type: c = "neutral",
|
|
22
|
-
size:
|
|
23
|
-
className:
|
|
22
|
+
size: i = "normal",
|
|
23
|
+
className: s,
|
|
24
24
|
onClick: e,
|
|
25
|
-
ariaLabel:
|
|
26
|
-
icon:
|
|
27
|
-
children:
|
|
28
|
-
} =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
ariaLabel: r,
|
|
26
|
+
icon: t,
|
|
27
|
+
children: l
|
|
28
|
+
} = a, f = x(
|
|
29
|
+
n.rootUnset,
|
|
30
|
+
n.root,
|
|
31
|
+
s,
|
|
32
|
+
n[`type-${c}`],
|
|
33
|
+
n[`size-${i}`],
|
|
34
34
|
{
|
|
35
|
-
[
|
|
35
|
+
[n.interactive]: !!e
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ m(
|
|
39
39
|
e ? "button" : "div",
|
|
40
40
|
{
|
|
41
41
|
type: e ? "button" : void 0,
|
|
42
|
-
className:
|
|
42
|
+
className: f,
|
|
43
43
|
onClick: e,
|
|
44
|
-
"aria-label":
|
|
44
|
+
"aria-label": r,
|
|
45
45
|
children: [
|
|
46
|
-
|
|
47
|
-
/* @__PURE__ */ o("div", { className:
|
|
48
|
-
e && /* @__PURE__ */ o(
|
|
46
|
+
t && /* @__PURE__ */ o(_, { size: "xxsmall", name: t, className: n.icon }),
|
|
47
|
+
/* @__PURE__ */ o("div", { className: n.content, children: l }),
|
|
48
|
+
e && /* @__PURE__ */ o(_, { size: "xxsmall", name: "LeftArrow", className: n.interactiveIcon })
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const w = u.memo(b);
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
w as default
|
|
56
56
|
};
|
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
import { jsxs as G, jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as G, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import l from "react";
|
|
3
3
|
import { Icon as T } from "../Icon/Icon.js";
|
|
4
4
|
import W from "../IconButton/IconButton.js";
|
|
5
5
|
import { Indicator as X } from "../Indicator/Indicator.js";
|
|
6
6
|
import { clsx as $ } from "../../utils/clsx.js";
|
|
7
7
|
import { getValue as q } from "../../utils/getValue.js";
|
|
8
|
-
const H = "
|
|
8
|
+
const H = "cfxui__Input__root__6392b", J = "cfxui__Input__input__07830", L = "cfxui__Input__small__c1513", O = "cfxui__Input__large__92d72", P = "cfxui__Input__placeholderIcon__4d079", Q = "cfxui__Input__empty__3b36a", U = "cfxui__Input__decorator__3b81f", Y = "cfxui__Input__onlight__7d0b7", e = {
|
|
9
9
|
root: H,
|
|
10
10
|
input: J,
|
|
11
11
|
small: L,
|
|
12
12
|
large: O,
|
|
13
13
|
placeholderIcon: P,
|
|
14
|
-
"full-width": "
|
|
14
|
+
"full-width": "cfxui__Input__full-width__587b3",
|
|
15
15
|
empty: Q,
|
|
16
16
|
decorator: U,
|
|
17
17
|
onlight: Y,
|
|
18
|
-
"backdrop-blur": "
|
|
18
|
+
"backdrop-blur": "cfxui__Input__backdrop-blur__6922f"
|
|
19
19
|
};
|
|
20
|
-
function Z(
|
|
20
|
+
function Z(b) {
|
|
21
21
|
const {
|
|
22
|
-
decorator:
|
|
23
|
-
loading:
|
|
24
|
-
type:
|
|
25
|
-
hasValue:
|
|
26
|
-
onCleare:
|
|
27
|
-
} =
|
|
28
|
-
return
|
|
22
|
+
decorator: t,
|
|
23
|
+
loading: s,
|
|
24
|
+
type: i,
|
|
25
|
+
hasValue: _,
|
|
26
|
+
onCleare: n
|
|
27
|
+
} = b;
|
|
28
|
+
return s ? /* @__PURE__ */ o("div", { className: e.decorator, children: /* @__PURE__ */ o(X, {}) }) : t ? /* @__PURE__ */ o("div", { className: e.decorator, children: q(t) }) : i === "search" && _ ? /* @__PURE__ */ o("div", { className: e.decorator, children: /* @__PURE__ */ o(W, { size: "xsmall", areaSize: "large", name: "Close", onClick: n }) }) : null;
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const ce = l.forwardRef(function(t, s) {
|
|
31
31
|
const {
|
|
32
|
-
id:
|
|
33
|
-
fullWidth:
|
|
34
|
-
value:
|
|
35
|
-
onChange:
|
|
32
|
+
id: i,
|
|
33
|
+
fullWidth: _ = !1,
|
|
34
|
+
value: n,
|
|
35
|
+
onChange: d,
|
|
36
36
|
onSubmit: f,
|
|
37
|
-
onKeyDown:
|
|
37
|
+
onKeyDown: m,
|
|
38
38
|
pattern: p,
|
|
39
|
-
tabIndex:
|
|
40
|
-
loading:
|
|
41
|
-
spellCheck:
|
|
42
|
-
autofocus:
|
|
43
|
-
disabled:
|
|
39
|
+
tabIndex: y,
|
|
40
|
+
loading: C = !1,
|
|
41
|
+
spellCheck: N = !0,
|
|
42
|
+
autofocus: k = !1,
|
|
43
|
+
disabled: w = !1,
|
|
44
44
|
className: v = "",
|
|
45
|
-
placeholder:
|
|
46
|
-
placeholderIcon:
|
|
47
|
-
type:
|
|
45
|
+
placeholder: c = "",
|
|
46
|
+
placeholderIcon: u,
|
|
47
|
+
type: x = "text",
|
|
48
48
|
size: E = "normal",
|
|
49
49
|
theme: R = "default",
|
|
50
50
|
decorator: V,
|
|
51
51
|
backdropBlur: S = !1
|
|
52
|
-
} =
|
|
53
|
-
D(
|
|
54
|
-
}, [
|
|
55
|
-
(
|
|
52
|
+
} = t, [h, D] = l.useState(n), g = typeof h < "u" && h !== "" && h !== null || typeof n < "u" && n !== "" && n !== null, z = t.type === "number" && (t.min ?? Number.MIN_SAFE_INTEGER) || void 0, A = t.type === "number" && (t.max ?? Number.MAX_SAFE_INTEGER) || void 0, r = l.useCallback((a) => {
|
|
53
|
+
D(a), d && d(a);
|
|
54
|
+
}, [d]), F = l.useCallback(
|
|
55
|
+
(a) => {
|
|
56
56
|
const {
|
|
57
|
-
value:
|
|
58
|
-
} =
|
|
57
|
+
value: I
|
|
58
|
+
} = a.target;
|
|
59
59
|
if (p) {
|
|
60
|
-
p.test(
|
|
60
|
+
p.test(I) && r(I);
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
r(I);
|
|
64
64
|
},
|
|
65
|
-
[
|
|
66
|
-
), K =
|
|
67
|
-
|
|
68
|
-
}, [
|
|
69
|
-
|
|
70
|
-
}, [
|
|
71
|
-
[e["full-width"]]:
|
|
65
|
+
[r, p]
|
|
66
|
+
), K = l.useCallback((a) => {
|
|
67
|
+
m && m(a), f && a.key === "Enter" && f();
|
|
68
|
+
}, [m, f]), M = l.useCallback(() => {
|
|
69
|
+
r("");
|
|
70
|
+
}, [r]), j = $(e.root, e[E], e[R], v, {
|
|
71
|
+
[e["full-width"]]: _,
|
|
72
72
|
[e["backdrop-blur"]]: S,
|
|
73
|
-
[e.empty]: !
|
|
74
|
-
}), B =
|
|
73
|
+
[e.empty]: !g
|
|
74
|
+
}), B = l.useMemo(() => c ? u ? ` ${c.trim()}` : c.trim() : "", [c, u]);
|
|
75
75
|
return /* @__PURE__ */ G("div", { className: j, children: [
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ o(
|
|
77
77
|
"input",
|
|
78
78
|
{
|
|
79
|
-
id:
|
|
80
|
-
ref:
|
|
81
|
-
type:
|
|
82
|
-
tabIndex:
|
|
83
|
-
autoFocus:
|
|
79
|
+
id: i,
|
|
80
|
+
ref: s,
|
|
81
|
+
type: x,
|
|
82
|
+
tabIndex: y,
|
|
83
|
+
autoFocus: k,
|
|
84
84
|
className: e.input,
|
|
85
|
-
value:
|
|
85
|
+
value: n,
|
|
86
86
|
placeholder: B,
|
|
87
|
-
disabled:
|
|
87
|
+
disabled: w,
|
|
88
88
|
onChange: F,
|
|
89
89
|
onKeyDown: K,
|
|
90
|
-
spellCheck:
|
|
90
|
+
spellCheck: N,
|
|
91
91
|
min: z,
|
|
92
92
|
max: A
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
|
-
|
|
96
|
-
/* @__PURE__ */
|
|
95
|
+
u && /* @__PURE__ */ o(T, { name: u, className: e.placeholderIcon }),
|
|
96
|
+
/* @__PURE__ */ o(
|
|
97
97
|
Z,
|
|
98
98
|
{
|
|
99
99
|
decorator: V,
|
|
100
|
-
loading:
|
|
101
|
-
type:
|
|
102
|
-
hasValue:
|
|
100
|
+
loading: C,
|
|
101
|
+
type: x,
|
|
102
|
+
hasValue: g,
|
|
103
103
|
onCleare: M
|
|
104
104
|
}
|
|
105
105
|
)
|
|
106
106
|
] });
|
|
107
107
|
});
|
|
108
108
|
export {
|
|
109
|
-
|
|
109
|
+
ce as default
|
|
110
110
|
};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as B, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import { Button as
|
|
4
|
-
import { clsx as
|
|
3
|
+
import { Button as D } from "../Button/Button.js";
|
|
4
|
+
import { clsx as F } from "../../utils/clsx.js";
|
|
5
5
|
import { useDynamicRef as i } from "../../utils/hooks/useDynamicRef.js";
|
|
6
6
|
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
7
7
|
import "../../utils/hooks/useKeyboardClose.js";
|
|
8
8
|
import "../../index-2hJuj4UN.js";
|
|
9
|
-
const L = "
|
|
9
|
+
const L = "cfxui__RichInput__root__57e6e", T = "cfxui__RichInput__renderer__8b298", j = "cfxui__RichInput__small__cd3d1", E = "cfxui__RichInput__large__74aed", z = "cfxui__RichInput__clear__5538b", c = {
|
|
10
10
|
root: L,
|
|
11
11
|
renderer: T,
|
|
12
12
|
small: j,
|
|
13
13
|
large: E,
|
|
14
14
|
clear: z
|
|
15
|
-
}, P = r.forwardRef(function(f,
|
|
15
|
+
}, P = r.forwardRef(function(f, _) {
|
|
16
16
|
const {
|
|
17
|
-
size:
|
|
18
|
-
value:
|
|
19
|
-
onChange:
|
|
20
|
-
onFocus:
|
|
17
|
+
size: d = "normal",
|
|
18
|
+
value: l,
|
|
19
|
+
onChange: m,
|
|
20
|
+
onFocus: p,
|
|
21
21
|
onBlur: h,
|
|
22
|
-
onSelect:
|
|
23
|
-
onKeyDown:
|
|
24
|
-
className:
|
|
25
|
-
rendered:
|
|
26
|
-
placeholder:
|
|
27
|
-
autoFocus:
|
|
28
|
-
withClearButton:
|
|
29
|
-
} = f,
|
|
30
|
-
|
|
31
|
-
}, []),
|
|
22
|
+
onSelect: R,
|
|
23
|
+
onKeyDown: C,
|
|
24
|
+
className: g,
|
|
25
|
+
rendered: x,
|
|
26
|
+
placeholder: I,
|
|
27
|
+
autoFocus: S,
|
|
28
|
+
withClearButton: b = !1
|
|
29
|
+
} = f, a = r.useRef(null), t = r.useRef(null), s = i(m), u = i(R), k = r.useCallback((e) => {
|
|
30
|
+
s.current(e.target.value);
|
|
31
|
+
}, []), N = r.useCallback(() => {
|
|
32
32
|
var e;
|
|
33
|
-
|
|
34
|
-
}, []),
|
|
33
|
+
s.current(""), (e = a.current) == null || e.focus();
|
|
34
|
+
}, []), v = r.useCallback((e) => {
|
|
35
35
|
if (!u.current || !(e.target instanceof HTMLInputElement))
|
|
36
36
|
return;
|
|
37
|
-
const
|
|
38
|
-
u.current(
|
|
39
|
-
}, []),
|
|
40
|
-
|
|
41
|
-
}, []),
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
37
|
+
const o = e.target;
|
|
38
|
+
u.current(o.selectionStart, o.selectionEnd, o.selectionDirection);
|
|
39
|
+
}, []), w = r.useCallback((e) => {
|
|
40
|
+
t.current && (t.current.scrollTop = e.target.scrollTop, t.current.scrollLeft = e.target.scrollLeft);
|
|
41
|
+
}, []), y = F(c.root, g, c[d]);
|
|
42
|
+
return /* @__PURE__ */ B("div", { ref: _, className: y, children: [
|
|
43
|
+
/* @__PURE__ */ n(
|
|
44
44
|
"input",
|
|
45
45
|
{
|
|
46
|
-
ref:
|
|
47
|
-
autoFocus:
|
|
46
|
+
ref: a,
|
|
47
|
+
autoFocus: S,
|
|
48
48
|
type: "text",
|
|
49
|
-
value:
|
|
50
|
-
onChange:
|
|
51
|
-
placeholder:
|
|
49
|
+
value: l,
|
|
50
|
+
onChange: k,
|
|
51
|
+
placeholder: I,
|
|
52
52
|
onBlur: h,
|
|
53
|
-
onFocus:
|
|
54
|
-
onScroll:
|
|
55
|
-
onSelect:
|
|
56
|
-
onKeyDown:
|
|
53
|
+
onFocus: p,
|
|
54
|
+
onScroll: w,
|
|
55
|
+
onSelect: v,
|
|
56
|
+
onKeyDown: C
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
59
|
+
/* @__PURE__ */ n("div", { ref: t, className: c.renderer, children: x }),
|
|
60
|
+
b && l && /* @__PURE__ */ n("div", { className: c.clear, children: /* @__PURE__ */ n(D, { icon: "Close", onClick: N }) })
|
|
61
61
|
] });
|
|
62
62
|
});
|
|
63
63
|
export {
|