@cfx-dev/ui-components 2.0.4 → 2.0.5
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/assets/Button.css +1 -1
- package/dist/assets/InfoPanel.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/InputDropzone.css +1 -1
- package/dist/assets/NavList.css +1 -1
- package/dist/assets/Radio.css +1 -1
- package/dist/assets/RichInput.css +1 -1
- package/dist/assets/Select.css +1 -1
- package/dist/assets/Switch.css +1 -1
- package/dist/assets/Tabular.css +1 -1
- package/dist/assets/Textarea.css +1 -1
- package/dist/assets/ToggleGroup.css +1 -1
- package/dist/assets/global.css +1 -1
- package/dist/components/Button/Button.d.ts +3 -3
- package/dist/components/Button/Button.js +70 -68
- package/dist/components/Button/ButtonShowcase.js +43 -21
- package/dist/components/InfoPanel/InfoPanel.js +32 -32
- package/dist/components/Input/Input.js +46 -46
- package/dist/components/Input/RichInput.js +21 -21
- package/dist/components/InputDropzone/InputDropzone.js +1 -1
- package/dist/components/NavList/NavList.js +14 -14
- package/dist/components/Radio/Radio.js +20 -20
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Switch/Switch.js +21 -21
- package/dist/components/Tabular/Tabular.js +44 -44
- package/dist/components/Textarea/Textarea.js +25 -25
- package/dist/components/ToggleGroup/ToggleGroup.js +28 -28
- package/dist/styles-scss/_ui.scss +10 -1
- package/dist/styles-scss/tokens.scss +38 -24
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IconName } from '../Icon';
|
|
3
3
|
|
|
4
|
-
export type ButtonTheme = 'primary' | 'secondary' | 'on-light' | 'default';
|
|
4
|
+
export type ButtonTheme = 'primary' | 'secondary' | 'on-light' | 'default' | 'quicklink';
|
|
5
5
|
export interface ButtonProps {
|
|
6
6
|
text?: React.ReactNode;
|
|
7
7
|
title?: string;
|
|
8
8
|
type?: HTMLButtonElement['type'];
|
|
9
9
|
icon?: IconName;
|
|
10
10
|
theme?: ButtonTheme;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
autofocus?: boolean;
|
|
13
11
|
tabIndex?: number;
|
|
14
12
|
className?: string;
|
|
15
13
|
ariaLabel?: string;
|
|
16
14
|
fullWidth?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
autofocus?: boolean;
|
|
17
17
|
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
18
18
|
onMouseDown?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
19
19
|
onMouseUp?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
@@ -1,105 +1,107 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { clsx as
|
|
5
|
-
import { noop as
|
|
6
|
-
import '../../assets/Button.css';const j = "
|
|
7
|
-
root:
|
|
8
|
-
fullWidth:
|
|
9
|
-
primary:
|
|
10
|
-
secondary:
|
|
11
|
-
"on-light": "_on-
|
|
1
|
+
import { jsx as r, jsxs as W, Fragment as g } from "react/jsx-runtime";
|
|
2
|
+
import m from "react";
|
|
3
|
+
import { Icon as B } from "../Icon/Icon.js";
|
|
4
|
+
import { clsx as I } from "../../utils/clsx.js";
|
|
5
|
+
import { noop as q } from "../../utils/functional.js";
|
|
6
|
+
import '../../assets/Button.css';const M = "_root_1qqs9_1", j = "_fullWidth_1qqs9_35", w = "_primary_1qqs9_55", F = "_secondary_1qqs9_76", R = "_quicklink_1qqs9_118", v = "_icon_1qqs9_125", D = "_icononly_1qqs9_150", L = "_decorator_1qqs9_155", o = {
|
|
7
|
+
root: M,
|
|
8
|
+
fullWidth: j,
|
|
9
|
+
primary: w,
|
|
10
|
+
secondary: F,
|
|
11
|
+
"on-light": "_on-light_1qqs9_97",
|
|
12
|
+
quicklink: R,
|
|
12
13
|
icon: v,
|
|
13
|
-
|
|
14
|
+
icononly: D,
|
|
15
|
+
decorator: L
|
|
14
16
|
};
|
|
15
|
-
function
|
|
17
|
+
function U(s) {
|
|
16
18
|
const {
|
|
17
|
-
text:
|
|
19
|
+
text: t = null,
|
|
18
20
|
icon: e,
|
|
19
21
|
decorator: n = null
|
|
20
|
-
} =
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
|
|
23
|
-
!!e && /* @__PURE__ */
|
|
24
|
-
!!n && /* @__PURE__ */
|
|
22
|
+
} = s;
|
|
23
|
+
return /* @__PURE__ */ W(g, { children: [
|
|
24
|
+
t,
|
|
25
|
+
!!e && /* @__PURE__ */ r(B, { name: e, className: o.icon }),
|
|
26
|
+
!!n && /* @__PURE__ */ r("div", { className: o.decorator, children: n })
|
|
25
27
|
] });
|
|
26
28
|
}
|
|
27
|
-
function
|
|
29
|
+
function z(s) {
|
|
28
30
|
const {
|
|
29
|
-
text:
|
|
31
|
+
text: t = null,
|
|
30
32
|
icon: e,
|
|
31
33
|
theme: n = "default",
|
|
32
|
-
disabled:
|
|
34
|
+
disabled: c = !1,
|
|
33
35
|
className: u = "",
|
|
34
36
|
autofocus: d = !1,
|
|
35
|
-
fullWidth:
|
|
36
|
-
tabIndex:
|
|
37
|
-
} =
|
|
38
|
-
return
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
37
|
+
fullWidth: a = !1,
|
|
38
|
+
tabIndex: i
|
|
39
|
+
} = s;
|
|
40
|
+
return I(o.root, o[n], u, {
|
|
41
|
+
[o.disabled]: c,
|
|
42
|
+
[o.icononly]: !!e && (t === null || typeof t > "u"),
|
|
43
|
+
[o.text]: !!t,
|
|
44
|
+
[o.autofocus]: d || typeof i < "u",
|
|
45
|
+
[o.fullWidth]: a
|
|
44
46
|
});
|
|
45
47
|
}
|
|
46
|
-
const
|
|
48
|
+
const K = m.forwardRef(function(t, e) {
|
|
47
49
|
const {
|
|
48
50
|
text: n = null,
|
|
49
|
-
icon:
|
|
51
|
+
icon: c,
|
|
50
52
|
title: u = "",
|
|
51
53
|
type: d = "button",
|
|
52
|
-
className:
|
|
53
|
-
theme:
|
|
54
|
-
disabled:
|
|
55
|
-
onClick:
|
|
56
|
-
onMouseDown:
|
|
57
|
-
onMouseUp:
|
|
54
|
+
className: a = "",
|
|
55
|
+
theme: i = "default",
|
|
56
|
+
disabled: l = !1,
|
|
57
|
+
onClick: h = q,
|
|
58
|
+
onMouseDown: p = q,
|
|
59
|
+
onMouseUp: b = q,
|
|
58
60
|
autofocus: f = !1,
|
|
59
|
-
tabIndex:
|
|
60
|
-
fullWidth:
|
|
61
|
-
ariaLabel:
|
|
62
|
-
} =
|
|
61
|
+
tabIndex: _,
|
|
62
|
+
fullWidth: y = !1,
|
|
63
|
+
ariaLabel: k = ""
|
|
64
|
+
} = t, x = m.useMemo(() => z({
|
|
63
65
|
text: n,
|
|
64
|
-
icon:
|
|
65
|
-
theme:
|
|
66
|
-
disabled:
|
|
67
|
-
className:
|
|
66
|
+
icon: c,
|
|
67
|
+
theme: i,
|
|
68
|
+
disabled: l,
|
|
69
|
+
className: a,
|
|
68
70
|
autofocus: f,
|
|
69
|
-
fullWidth:
|
|
70
|
-
tabIndex:
|
|
71
|
+
fullWidth: y,
|
|
72
|
+
tabIndex: _
|
|
71
73
|
}), [
|
|
72
74
|
f,
|
|
73
|
-
r,
|
|
74
|
-
g,
|
|
75
75
|
a,
|
|
76
|
+
y,
|
|
76
77
|
l,
|
|
77
|
-
|
|
78
|
+
c,
|
|
79
|
+
_,
|
|
78
80
|
n,
|
|
79
|
-
|
|
80
|
-
]),
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
return /* @__PURE__ */
|
|
81
|
+
i
|
|
82
|
+
]), C = m.useCallback((N) => {
|
|
83
|
+
l || h(N);
|
|
84
|
+
}, [l, h]);
|
|
85
|
+
return /* @__PURE__ */ r(
|
|
84
86
|
"button",
|
|
85
87
|
{
|
|
86
88
|
ref: e,
|
|
87
|
-
disabled:
|
|
88
|
-
className:
|
|
89
|
-
onClick:
|
|
90
|
-
onMouseDown:
|
|
91
|
-
onMouseUp:
|
|
89
|
+
disabled: l,
|
|
90
|
+
className: x,
|
|
91
|
+
onClick: C,
|
|
92
|
+
onMouseDown: p,
|
|
93
|
+
onMouseUp: b,
|
|
92
94
|
autoFocus: f,
|
|
93
|
-
tabIndex:
|
|
95
|
+
tabIndex: _,
|
|
94
96
|
title: u,
|
|
95
97
|
type: d,
|
|
96
|
-
"aria-label":
|
|
97
|
-
children: /* @__PURE__ */
|
|
98
|
+
"aria-label": k,
|
|
99
|
+
children: /* @__PURE__ */ r(U, { ...t })
|
|
98
100
|
}
|
|
99
101
|
);
|
|
100
102
|
});
|
|
101
103
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
K as Button,
|
|
105
|
+
U as ButtonContent,
|
|
106
|
+
z as getButtonClassName
|
|
105
107
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import l from "react";
|
|
3
3
|
import { Flex as i } from "../Layout/Flex/Flex.js";
|
|
4
4
|
import { Text as n } from "../Text/Text.js";
|
|
5
|
-
import { Button as
|
|
5
|
+
import { Button as t } from "./Button.js";
|
|
6
6
|
import { ButtonBar as c } from "./ButtonBar.js";
|
|
7
7
|
function o() {
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ r(i, { gap: "large", vertical: !0, children: [
|
|
9
|
+
/* @__PURE__ */ r(i, { gap: "normal", vertical: !0, children: [
|
|
10
10
|
/* @__PURE__ */ e(n, { children: "Default" }),
|
|
11
11
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
12
|
-
|
|
12
|
+
t,
|
|
13
13
|
{
|
|
14
14
|
text: "Sign In",
|
|
15
15
|
theme: "default",
|
|
@@ -17,10 +17,10 @@ function o() {
|
|
|
17
17
|
}
|
|
18
18
|
) })
|
|
19
19
|
] }),
|
|
20
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ r(i, { gap: "normal", vertical: !0, children: [
|
|
21
21
|
/* @__PURE__ */ e(n, { children: "Primary" }),
|
|
22
22
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
23
|
-
|
|
23
|
+
t,
|
|
24
24
|
{
|
|
25
25
|
text: "Sign In",
|
|
26
26
|
theme: "primary",
|
|
@@ -28,10 +28,10 @@ function o() {
|
|
|
28
28
|
}
|
|
29
29
|
) })
|
|
30
30
|
] }),
|
|
31
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ r(i, { gap: "normal", vertical: !0, children: [
|
|
32
32
|
/* @__PURE__ */ e(n, { children: "Secondary" }),
|
|
33
33
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
34
|
-
|
|
34
|
+
t,
|
|
35
35
|
{
|
|
36
36
|
text: "Sign In",
|
|
37
37
|
theme: "secondary",
|
|
@@ -39,10 +39,10 @@ function o() {
|
|
|
39
39
|
}
|
|
40
40
|
) })
|
|
41
41
|
] }),
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ r(i, { gap: "normal", vertical: !0, children: [
|
|
43
43
|
/* @__PURE__ */ e(n, { children: "On Light" }),
|
|
44
44
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
45
|
-
|
|
45
|
+
t,
|
|
46
46
|
{
|
|
47
47
|
text: "Sign In",
|
|
48
48
|
theme: "on-light",
|
|
@@ -50,20 +50,31 @@ function o() {
|
|
|
50
50
|
}
|
|
51
51
|
) })
|
|
52
52
|
] }),
|
|
53
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ r(i, { gap: "normal", vertical: !0, children: [
|
|
54
|
+
/* @__PURE__ */ e(n, { children: "Quick Link" }),
|
|
55
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
56
|
+
t,
|
|
57
|
+
{
|
|
58
|
+
text: "Sign In",
|
|
59
|
+
theme: "quicklink",
|
|
60
|
+
icon: "LeftArrow"
|
|
61
|
+
}
|
|
62
|
+
) })
|
|
63
|
+
] }),
|
|
64
|
+
/* @__PURE__ */ r(i, { gap: "normal", vertical: !0, children: [
|
|
54
65
|
/* @__PURE__ */ e(n, { children: "No Icon" }),
|
|
55
66
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
56
|
-
|
|
67
|
+
t,
|
|
57
68
|
{
|
|
58
69
|
text: "Sign In",
|
|
59
70
|
theme: "default"
|
|
60
71
|
}
|
|
61
72
|
) })
|
|
62
73
|
] }),
|
|
63
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ r(i, { gap: "normal", vertical: !0, children: [
|
|
64
75
|
/* @__PURE__ */ e(n, { children: "Full Width" }),
|
|
65
76
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
66
|
-
|
|
77
|
+
t,
|
|
67
78
|
{
|
|
68
79
|
text: "Sign In",
|
|
69
80
|
theme: "default",
|
|
@@ -72,14 +83,25 @@ function o() {
|
|
|
72
83
|
}
|
|
73
84
|
) })
|
|
74
85
|
] }),
|
|
75
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ r(i, { gap: "normal", vertical: !0, children: [
|
|
76
87
|
/* @__PURE__ */ e(n, { children: "Button Bar" }),
|
|
77
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */ e(
|
|
79
|
-
/* @__PURE__ */ e(
|
|
80
|
-
/* @__PURE__ */ e(
|
|
81
|
-
/* @__PURE__ */ e(
|
|
88
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ r(c, { children: [
|
|
89
|
+
/* @__PURE__ */ e(t, { text: "Sign In", theme: "primary", icon: "Users" }),
|
|
90
|
+
/* @__PURE__ */ e(t, { text: "Register", theme: "secondary", icon: "Users" }),
|
|
91
|
+
/* @__PURE__ */ e(t, { text: "Sign Out", theme: "on-light", icon: "Users" }),
|
|
92
|
+
/* @__PURE__ */ e(t, { text: "Create Account", theme: "default", icon: "Users" })
|
|
82
93
|
] }) })
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ r(i, { gap: "normal", vertical: !0, children: [
|
|
96
|
+
/* @__PURE__ */ e(n, { children: "Long text" }),
|
|
97
|
+
/* @__PURE__ */ e("div", { style: { maxWidth: "300px" }, children: /* @__PURE__ */ e(
|
|
98
|
+
t,
|
|
99
|
+
{
|
|
100
|
+
text: "Long text that should wrap around",
|
|
101
|
+
theme: "default",
|
|
102
|
+
icon: "Users"
|
|
103
|
+
}
|
|
104
|
+
) })
|
|
83
105
|
] })
|
|
84
106
|
] });
|
|
85
107
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { clsx as
|
|
5
|
-
import '../../assets/InfoPanel.css';const
|
|
6
|
-
rootUnset:
|
|
7
|
-
root:
|
|
8
|
-
interactive:
|
|
9
|
-
interactiveIcon:
|
|
10
|
-
"type-neutral": "_type-
|
|
11
|
-
"type-error": "_type-
|
|
12
|
-
"type-success": "_type-
|
|
13
|
-
"type-warning": "_type-
|
|
14
|
-
"size-small": "_size-
|
|
15
|
-
"size-large": "_size-
|
|
16
|
-
icon:
|
|
17
|
-
content:
|
|
2
|
+
import h from "react";
|
|
3
|
+
import { Icon as s } from "../Icon/Icon.js";
|
|
4
|
+
import { clsx as k } from "../../utils/clsx.js";
|
|
5
|
+
import '../../assets/InfoPanel.css';const u = "_rootUnset_1kt7h_1", v = "_root_1kt7h_1", y = "_interactive_1kt7h_19", f = "_interactiveIcon_1kt7h_22", x = "_icon_1kt7h_69", z = "_content_1kt7h_73", t = {
|
|
6
|
+
rootUnset: u,
|
|
7
|
+
root: v,
|
|
8
|
+
interactive: y,
|
|
9
|
+
interactiveIcon: f,
|
|
10
|
+
"type-neutral": "_type-neutral_1kt7h_34",
|
|
11
|
+
"type-error": "_type-error_1kt7h_41",
|
|
12
|
+
"type-success": "_type-success_1kt7h_48",
|
|
13
|
+
"type-warning": "_type-warning_1kt7h_55",
|
|
14
|
+
"size-small": "_size-small_1kt7h_62",
|
|
15
|
+
"size-large": "_size-large_1kt7h_65",
|
|
16
|
+
icon: x,
|
|
17
|
+
content: z
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function d(c) {
|
|
20
20
|
const {
|
|
21
|
-
type:
|
|
22
|
-
size:
|
|
23
|
-
className:
|
|
21
|
+
type: r = "neutral",
|
|
22
|
+
size: a = "normal",
|
|
23
|
+
className: i,
|
|
24
24
|
onClick: e,
|
|
25
|
-
ariaLabel:
|
|
25
|
+
ariaLabel: _,
|
|
26
26
|
icon: n,
|
|
27
|
-
children:
|
|
28
|
-
} =
|
|
27
|
+
children: l
|
|
28
|
+
} = c, m = k(
|
|
29
29
|
t.rootUnset,
|
|
30
30
|
t.root,
|
|
31
|
-
|
|
32
|
-
t[`type-${
|
|
33
|
-
t[`size-${
|
|
31
|
+
i,
|
|
32
|
+
t[`type-${r}`],
|
|
33
|
+
t[`size-${a}`],
|
|
34
34
|
{
|
|
35
35
|
[t.interactive]: !!e
|
|
36
36
|
}
|
|
@@ -41,16 +41,16 @@ function N(s) {
|
|
|
41
41
|
type: e ? "button" : void 0,
|
|
42
42
|
className: m,
|
|
43
43
|
onClick: e,
|
|
44
|
-
"aria-label":
|
|
44
|
+
"aria-label": _,
|
|
45
45
|
children: [
|
|
46
|
-
n && /* @__PURE__ */ o(
|
|
47
|
-
/* @__PURE__ */ o("div", { className: t.content, children:
|
|
48
|
-
e && /* @__PURE__ */ o(
|
|
46
|
+
n && /* @__PURE__ */ o(s, { size: "xxsmall", name: n, className: t.icon }),
|
|
47
|
+
/* @__PURE__ */ o("div", { className: t.content, children: l }),
|
|
48
|
+
e && /* @__PURE__ */ o(s, { size: "xxsmall", name: "LeftArrow", className: t.interactiveIcon })
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const U = h.memo(d);
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
U as default
|
|
56
56
|
};
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as b, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import o from "react";
|
|
3
3
|
import { Icon as j } from "../Icon/Icon.js";
|
|
4
4
|
import { Indicator as G } from "../Indicator/Indicator.js";
|
|
5
5
|
import { clsx as T } from "../../utils/clsx.js";
|
|
6
|
-
import { getValue as
|
|
7
|
-
import '../../assets/Input.css';const
|
|
8
|
-
root:
|
|
9
|
-
input:
|
|
10
|
-
small:
|
|
11
|
-
large:
|
|
6
|
+
import { getValue as B } from "../../utils/getValue.js";
|
|
7
|
+
import '../../assets/Input.css';const W = "_root_1truz_1", X = "_input_1truz_1", $ = "_small_1truz_5", q = "_large_1truz_9", H = "_placeholderIcon_1truz_75", J = "_empty_1truz_151", L = "_decorator_1truz_156", e = {
|
|
8
|
+
root: W,
|
|
9
|
+
input: X,
|
|
10
|
+
small: $,
|
|
11
|
+
large: q,
|
|
12
12
|
placeholderIcon: H,
|
|
13
|
-
"full-width": "_full-
|
|
13
|
+
"full-width": "_full-width_1truz_145",
|
|
14
14
|
empty: J,
|
|
15
15
|
decorator: L,
|
|
16
|
-
"backdrop-blur": "_backdrop-
|
|
17
|
-
},
|
|
16
|
+
"backdrop-blur": "_backdrop-blur_1truz_173"
|
|
17
|
+
}, te = o.forwardRef(function(a, y) {
|
|
18
18
|
const {
|
|
19
19
|
id: I,
|
|
20
20
|
fullWidth: N = !1,
|
|
21
|
-
value:
|
|
22
|
-
onChange:
|
|
23
|
-
onSubmit:
|
|
24
|
-
onKeyDown:
|
|
21
|
+
value: r,
|
|
22
|
+
onChange: c,
|
|
23
|
+
onSubmit: u,
|
|
24
|
+
onKeyDown: s,
|
|
25
25
|
pattern: d,
|
|
26
|
-
tabIndex:
|
|
27
|
-
loading:
|
|
28
|
-
spellCheck:
|
|
29
|
-
autofocus:
|
|
26
|
+
tabIndex: z,
|
|
27
|
+
loading: h = !1,
|
|
28
|
+
spellCheck: g = !0,
|
|
29
|
+
autofocus: k = !1,
|
|
30
30
|
disabled: w = !1,
|
|
31
31
|
className: x = "",
|
|
32
|
-
placeholder:
|
|
33
|
-
placeholderIcon:
|
|
32
|
+
placeholder: l = "",
|
|
33
|
+
placeholderIcon: n,
|
|
34
34
|
type: C = "text",
|
|
35
35
|
size: E = "normal",
|
|
36
36
|
decorator: i,
|
|
37
37
|
backdropBlur: v = !1
|
|
38
|
-
} = a, [m, R] =
|
|
39
|
-
R(
|
|
40
|
-
}, [
|
|
41
|
-
(
|
|
38
|
+
} = a, [m, R] = o.useState(r), V = typeof m < "u" && m !== "" && m !== null || typeof r < "u" && r !== "" && r !== null, S = a.type === "number" && (a.min ?? Number.MIN_SAFE_INTEGER) || void 0, A = a.type === "number" && (a.max ?? Number.MAX_SAFE_INTEGER) || void 0, _ = o.useCallback((t) => {
|
|
39
|
+
R(t), c && c(t);
|
|
40
|
+
}, [c]), D = o.useCallback(
|
|
41
|
+
(t) => {
|
|
42
42
|
const {
|
|
43
|
-
value:
|
|
44
|
-
} =
|
|
43
|
+
value: f
|
|
44
|
+
} = t.target;
|
|
45
45
|
if (d) {
|
|
46
|
-
d.test(
|
|
46
|
+
d.test(f) && _(f);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
_(f);
|
|
50
50
|
},
|
|
51
|
-
[
|
|
52
|
-
), F =
|
|
53
|
-
|
|
54
|
-
}, [
|
|
51
|
+
[_, d]
|
|
52
|
+
), F = o.useCallback((t) => {
|
|
53
|
+
s && s(t), u && t.key === "Enter" && u();
|
|
54
|
+
}, [s, u]), K = T(e.root, e[E], x, {
|
|
55
55
|
[e["full-width"]]: N,
|
|
56
56
|
[e["backdrop-blur"]]: v,
|
|
57
57
|
[e.empty]: !V
|
|
58
|
-
}), M =
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
58
|
+
}), M = o.useMemo(() => l ? n ? ` ${l.trim()}` : l.trim() : "", [l, n]);
|
|
59
|
+
return /* @__PURE__ */ b("div", { className: K, children: [
|
|
60
|
+
/* @__PURE__ */ p(
|
|
61
61
|
"input",
|
|
62
62
|
{
|
|
63
63
|
id: I,
|
|
64
|
-
ref:
|
|
64
|
+
ref: y,
|
|
65
65
|
type: C,
|
|
66
|
-
tabIndex:
|
|
67
|
-
autoFocus:
|
|
66
|
+
tabIndex: z,
|
|
67
|
+
autoFocus: k,
|
|
68
68
|
className: e.input,
|
|
69
|
-
value:
|
|
69
|
+
value: r,
|
|
70
70
|
placeholder: M,
|
|
71
71
|
disabled: w,
|
|
72
72
|
onChange: D,
|
|
73
73
|
onKeyDown: F,
|
|
74
|
-
spellCheck:
|
|
74
|
+
spellCheck: g,
|
|
75
75
|
min: S,
|
|
76
76
|
max: A
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
|
-
|
|
80
|
-
(
|
|
81
|
-
!!
|
|
82
|
-
!!i &&
|
|
79
|
+
n && /* @__PURE__ */ p(j, { name: n, className: e.placeholderIcon }),
|
|
80
|
+
(h || !!i) && /* @__PURE__ */ b("div", { className: e.decorator, children: [
|
|
81
|
+
!!h && /* @__PURE__ */ p(G, {}),
|
|
82
|
+
!!i && B(i)
|
|
83
83
|
] })
|
|
84
84
|
] });
|
|
85
85
|
});
|
|
86
86
|
export {
|
|
87
|
-
|
|
87
|
+
te as default
|
|
88
88
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Button as
|
|
4
|
-
import { clsx as
|
|
1
|
+
import { jsxs as B, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import r from "react";
|
|
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
|
-
import '../../assets/RichInput.css';const
|
|
10
|
-
root:
|
|
11
|
-
renderer:
|
|
12
|
-
small:
|
|
9
|
+
import '../../assets/RichInput.css';const I = "_root_1w3oj_1", L = "_renderer_1w3oj_1", T = "_small_1w3oj_5", E = "_large_1w3oj_10", z = "_clear_1w3oj_144", n = {
|
|
10
|
+
root: I,
|
|
11
|
+
renderer: L,
|
|
12
|
+
small: T,
|
|
13
13
|
large: E,
|
|
14
14
|
clear: z
|
|
15
|
-
}, P =
|
|
15
|
+
}, P = r.forwardRef(function(f, m) {
|
|
16
16
|
const {
|
|
17
17
|
size: d = "normal",
|
|
18
18
|
value: c,
|
|
@@ -23,24 +23,24 @@ import '../../assets/RichInput.css';const L = "_root_ttyw6_1", T = "_renderer_tt
|
|
|
23
23
|
onKeyDown: g,
|
|
24
24
|
className: R,
|
|
25
25
|
rendered: w,
|
|
26
|
-
placeholder:
|
|
26
|
+
placeholder: j,
|
|
27
27
|
autoFocus: S,
|
|
28
28
|
withClearButton: k = !1
|
|
29
|
-
} = f, s =
|
|
29
|
+
} = f, s = r.useRef(null), t = r.useRef(null), a = i(p), u = i(C), x = r.useCallback((e) => {
|
|
30
30
|
a.current(e.target.value);
|
|
31
|
-
}, []), N =
|
|
31
|
+
}, []), N = r.useCallback(() => {
|
|
32
32
|
var e;
|
|
33
33
|
a.current(""), (e = s.current) == null || e.focus();
|
|
34
|
-
}, []), b =
|
|
34
|
+
}, []), b = r.useCallback((e) => {
|
|
35
35
|
if (!u.current || !(e.target instanceof HTMLInputElement))
|
|
36
36
|
return;
|
|
37
37
|
const l = e.target;
|
|
38
38
|
u.current(l.selectionStart, l.selectionEnd, l.selectionDirection);
|
|
39
|
-
}, []), v =
|
|
40
|
-
|
|
41
|
-
}, []),
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
39
|
+
}, []), v = r.useCallback((e) => {
|
|
40
|
+
t.current && (t.current.scrollTop = e.target.scrollTop, t.current.scrollLeft = e.target.scrollLeft);
|
|
41
|
+
}, []), y = F(n.root, R, n[d]);
|
|
42
|
+
return /* @__PURE__ */ B("div", { ref: m, className: y, children: [
|
|
43
|
+
/* @__PURE__ */ o(
|
|
44
44
|
"input",
|
|
45
45
|
{
|
|
46
46
|
ref: s,
|
|
@@ -48,7 +48,7 @@ import '../../assets/RichInput.css';const L = "_root_ttyw6_1", T = "_renderer_tt
|
|
|
48
48
|
type: "text",
|
|
49
49
|
value: c,
|
|
50
50
|
onChange: x,
|
|
51
|
-
placeholder:
|
|
51
|
+
placeholder: j,
|
|
52
52
|
onBlur: h,
|
|
53
53
|
onFocus: _,
|
|
54
54
|
onScroll: v,
|
|
@@ -56,8 +56,8 @@ import '../../assets/RichInput.css';const L = "_root_ttyw6_1", T = "_renderer_tt
|
|
|
56
56
|
onKeyDown: g
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
k && c && /* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ o("div", { ref: t, className: n.renderer, children: w }),
|
|
60
|
+
k && c && /* @__PURE__ */ o("div", { className: n.clear, children: /* @__PURE__ */ o(D, { icon: "Close", onClick: N }) })
|
|
61
61
|
] });
|
|
62
62
|
});
|
|
63
63
|
export {
|
|
@@ -1023,7 +1023,7 @@ function bt(e, r) {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
function rr() {
|
|
1025
1025
|
}
|
|
1026
|
-
const ht = "
|
|
1026
|
+
const ht = "_dropzone_6f6kw_1", Dt = "_text_6f6kw_19", At = "_disabled_6f6kw_25", wt = "_focused_6f6kw_39", Ot = "_dragActive_6f6kw_39", F = {
|
|
1027
1027
|
dropzone: ht,
|
|
1028
1028
|
text: Dt,
|
|
1029
1029
|
disabled: At,
|