@cfx-dev/ui-components 2.1.12 → 2.1.14
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/Badge.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/InputDropzone.css +1 -1
- package/dist/assets/ItemPreview.css +1 -1
- package/dist/assets/Modal.css +1 -1
- package/dist/assets/RichInput.css +1 -1
- package/dist/assets/Select.css +1 -1
- package/dist/assets/Table.css +1 -1
- package/dist/assets/Tabular.css +1 -1
- package/dist/assets/global.css +1 -1
- package/dist/components/Badge/Badge.d.ts +2 -0
- package/dist/components/Badge/Badge.js +23 -21
- package/dist/components/Badge/BadgeShowcase.js +44 -22
- package/dist/components/IconButton/IconButton.d.ts +2 -0
- package/dist/components/IconButton/IconButton.js +27 -24
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.js +94 -72
- package/dist/components/Input/InputShowcase.js +24 -10
- package/dist/components/Input/RichInput.js +28 -28
- package/dist/components/InputDropzone/InputDropzone.d.ts +9 -1
- package/dist/components/InputDropzone/InputDropzone.js +316 -300
- package/dist/components/InputDropzone/InputDropzoneShowcase.js +28 -18
- package/dist/components/InputDropzone/ItemPreview.d.ts +2 -1
- package/dist/components/InputDropzone/ItemPreview.js +20 -18
- package/dist/components/Modal/Modal.js +39 -39
- package/dist/components/Modal/ModalShowcase.js +18 -14
- package/dist/components/Select/Select.js +53 -53
- package/dist/components/Table/Table.d.ts +2 -0
- package/dist/components/Table/Table.js +87 -82
- package/dist/components/Tabular/Tabular.js +46 -46
- package/dist/main.d.ts +1 -1
- package/dist/main.js +43 -42
- package/dist/styles-scss/tokens.scss +5 -0
- package/package.json +1 -1
|
@@ -2,8 +2,10 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { IconName } from '../Icon';
|
|
3
3
|
|
|
4
4
|
export type BadgeColor = 'success' | 'neutral' | 'warning' | 'error';
|
|
5
|
+
export type BadgeSize = 'small' | 'normal';
|
|
5
6
|
export interface BadgeProps {
|
|
6
7
|
color?: BadgeColor;
|
|
8
|
+
size?: BadgeSize;
|
|
7
9
|
icon?: IconName;
|
|
8
10
|
children?: React.ReactNode;
|
|
9
11
|
className?: string;
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { clsx as
|
|
5
|
-
import '../../assets/Badge.css';const
|
|
6
|
-
root:
|
|
7
|
-
success:
|
|
8
|
-
hoverable:
|
|
9
|
-
neutral:
|
|
1
|
+
import { jsxs as i, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import h from "react";
|
|
3
|
+
import { Icon as v } from "../Icon/Icon.js";
|
|
4
|
+
import { clsx as u } from "../../utils/clsx.js";
|
|
5
|
+
import '../../assets/Badge.css';const f = "_root_5qhvc_1", q = "_success_5qhvc_12", d = "_hoverable_5qhvc_16", x = "_neutral_5qhvc_19", b = "_warning_5qhvc_23", g = "_error_5qhvc_30", p = "_small_5qhvc_37", w = "_icon_5qhvc_41", o = {
|
|
6
|
+
root: f,
|
|
7
|
+
success: q,
|
|
8
|
+
hoverable: d,
|
|
9
|
+
neutral: x,
|
|
10
10
|
warning: b,
|
|
11
11
|
error: g,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
small: p,
|
|
13
|
+
icon: w
|
|
14
|
+
}, C = h.forwardRef(function(c, r) {
|
|
14
15
|
const {
|
|
15
|
-
color:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
color: e = "success",
|
|
17
|
+
size: n = "normal",
|
|
18
|
+
children: a,
|
|
19
|
+
icon: s,
|
|
20
|
+
className: t,
|
|
21
|
+
hoverable: l = !1
|
|
22
|
+
} = c, _ = u(o.root, t, o[e], o[n], { [o.hoverable]: l });
|
|
23
|
+
return /* @__PURE__ */ i("div", { ref: r, className: _, children: [
|
|
24
|
+
a,
|
|
25
|
+
!!s && /* @__PURE__ */ m(v, { size: "xxsmall", name: s, className: o.icon })
|
|
24
26
|
] });
|
|
25
27
|
});
|
|
26
28
|
export {
|
|
27
|
-
|
|
29
|
+
C as Badge
|
|
28
30
|
};
|
|
@@ -1,56 +1,78 @@
|
|
|
1
1
|
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import n from "react";
|
|
3
|
-
import { Flex as
|
|
4
|
-
import { Text as
|
|
5
|
-
import { Badge as
|
|
3
|
+
import { Flex as l } from "../Layout/Flex/Flex.js";
|
|
4
|
+
import { Text as i } from "../Text/Text.js";
|
|
5
|
+
import { Badge as c } from "./Badge.js";
|
|
6
6
|
function o() {
|
|
7
|
-
return /* @__PURE__ */ e(
|
|
8
|
-
/* @__PURE__ */ e(
|
|
9
|
-
/* @__PURE__ */ r(
|
|
7
|
+
return /* @__PURE__ */ e(l, { gap: "large", vertical: !0, children: [
|
|
8
|
+
/* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
|
|
9
|
+
/* @__PURE__ */ r(i, { children: "Success" }),
|
|
10
10
|
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
11
|
-
|
|
11
|
+
c,
|
|
12
12
|
{
|
|
13
13
|
color: "success",
|
|
14
|
-
children:
|
|
14
|
+
children: "success"
|
|
15
15
|
}
|
|
16
16
|
) })
|
|
17
17
|
] }),
|
|
18
|
-
/* @__PURE__ */ e(
|
|
19
|
-
/* @__PURE__ */ r(
|
|
18
|
+
/* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
|
|
19
|
+
/* @__PURE__ */ r(i, { children: "Neutral" }),
|
|
20
20
|
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
21
|
-
|
|
21
|
+
c,
|
|
22
22
|
{
|
|
23
23
|
color: "neutral",
|
|
24
|
-
children:
|
|
24
|
+
children: "neutral"
|
|
25
25
|
}
|
|
26
26
|
) })
|
|
27
27
|
] }),
|
|
28
|
-
/* @__PURE__ */ e(
|
|
29
|
-
/* @__PURE__ */ r(
|
|
28
|
+
/* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
|
|
29
|
+
/* @__PURE__ */ r(i, { children: "Warning with hoverable" }),
|
|
30
30
|
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
31
|
-
|
|
31
|
+
c,
|
|
32
32
|
{
|
|
33
33
|
color: "warning",
|
|
34
34
|
icon: "MoreInfo",
|
|
35
35
|
hoverable: !0,
|
|
36
|
-
children:
|
|
36
|
+
children: "warning"
|
|
37
37
|
}
|
|
38
38
|
) })
|
|
39
39
|
] }),
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
/* @__PURE__ */ r(
|
|
40
|
+
/* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
|
|
41
|
+
/* @__PURE__ */ r(i, { children: "Error" }),
|
|
42
42
|
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
43
|
-
|
|
43
|
+
c,
|
|
44
44
|
{
|
|
45
45
|
color: "error",
|
|
46
|
+
icon: "Sort",
|
|
47
|
+
children: "error"
|
|
48
|
+
}
|
|
49
|
+
) })
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
|
|
52
|
+
/* @__PURE__ */ r(i, { children: "Small" }),
|
|
53
|
+
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
54
|
+
c,
|
|
55
|
+
{
|
|
56
|
+
size: "small",
|
|
57
|
+
children: "Small"
|
|
58
|
+
}
|
|
59
|
+
) })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
|
|
62
|
+
/* @__PURE__ */ r(i, { children: "Small Error" }),
|
|
63
|
+
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
64
|
+
c,
|
|
65
|
+
{
|
|
66
|
+
color: "error",
|
|
67
|
+
size: "small",
|
|
46
68
|
icon: "MoreInfo",
|
|
47
|
-
children:
|
|
69
|
+
children: "Small Error"
|
|
48
70
|
}
|
|
49
71
|
) })
|
|
50
72
|
] })
|
|
51
73
|
] });
|
|
52
74
|
}
|
|
53
|
-
const
|
|
75
|
+
const s = n.memo(o);
|
|
54
76
|
export {
|
|
55
|
-
|
|
77
|
+
s as default
|
|
56
78
|
};
|
|
@@ -3,9 +3,11 @@ import { IconSize } from '../Icon';
|
|
|
3
3
|
import { IconName } from '../Icons';
|
|
4
4
|
import { TextColorProps } from '../Text';
|
|
5
5
|
|
|
6
|
+
type IconButtonAreaSize = 'small' | 'medium' | 'large';
|
|
6
7
|
export interface IconButtonProps extends TextColorProps {
|
|
7
8
|
name: IconName;
|
|
8
9
|
size?: IconSize;
|
|
10
|
+
areaSize?: IconButtonAreaSize;
|
|
9
11
|
onClick?: () => void;
|
|
10
12
|
className?: string;
|
|
11
13
|
disabled?: boolean;
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import _ from "react";
|
|
3
3
|
import { Icon as p } from "../Icon/Icon.js";
|
|
4
|
-
import { clsx as
|
|
5
|
-
import '../../assets/IconButton.css';const f = "
|
|
6
|
-
unset:
|
|
7
|
-
root:
|
|
4
|
+
import { clsx as x } from "../../utils/clsx.js";
|
|
5
|
+
import '../../assets/IconButton.css';const d = "_unset_1l0x5_1", f = "_root_1l0x5_5", b = "_medium_1l0x5_19", g = "_large_1l0x5_22", o = {
|
|
6
|
+
unset: d,
|
|
7
|
+
root: f,
|
|
8
|
+
medium: b,
|
|
9
|
+
large: g
|
|
8
10
|
};
|
|
9
|
-
function
|
|
11
|
+
function y(e) {
|
|
10
12
|
const {
|
|
11
|
-
name:
|
|
12
|
-
onClick:
|
|
13
|
-
className:
|
|
14
|
-
disabled:
|
|
15
|
-
ariaLabel:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
name: r,
|
|
14
|
+
onClick: s,
|
|
15
|
+
className: a,
|
|
16
|
+
disabled: l,
|
|
17
|
+
ariaLabel: n,
|
|
18
|
+
areaSize: m = "small",
|
|
19
|
+
size: c = "xxsmall",
|
|
20
|
+
color: i = "primary",
|
|
21
|
+
...u
|
|
22
|
+
} = e;
|
|
23
|
+
return /* @__PURE__ */ t(
|
|
21
24
|
"button",
|
|
22
25
|
{
|
|
23
26
|
type: "button",
|
|
24
|
-
className:
|
|
25
|
-
onClick:
|
|
26
|
-
disabled:
|
|
27
|
-
"aria-label":
|
|
28
|
-
children: /* @__PURE__ */
|
|
27
|
+
className: x(o.unset, o.root, a, o[m]),
|
|
28
|
+
onClick: s,
|
|
29
|
+
disabled: l,
|
|
30
|
+
"aria-label": n,
|
|
31
|
+
children: /* @__PURE__ */ t(p, { as: "span", name: r, ...u, color: i, size: c })
|
|
29
32
|
}
|
|
30
33
|
);
|
|
31
34
|
}
|
|
32
|
-
const
|
|
35
|
+
const h = _.memo(y);
|
|
33
36
|
export {
|
|
34
|
-
|
|
37
|
+
h as default
|
|
35
38
|
};
|
|
@@ -2,6 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { IconName } from '../Icon';
|
|
3
3
|
|
|
4
4
|
export type InputSize = 'small' | 'normal' | 'large';
|
|
5
|
+
export type InputTheme = 'default' | 'onlight';
|
|
5
6
|
type InputTypeSpecificProps = {
|
|
6
7
|
type?: 'text' | 'password' | 'search';
|
|
7
8
|
value?: string;
|
|
@@ -14,6 +15,7 @@ type InputTypeSpecificProps = {
|
|
|
14
15
|
export type InputProps = InputTypeSpecificProps & {
|
|
15
16
|
id?: string;
|
|
16
17
|
size?: InputSize;
|
|
18
|
+
theme?: InputTheme;
|
|
17
19
|
tabIndex?: number;
|
|
18
20
|
autofocus?: boolean;
|
|
19
21
|
pattern?: RegExp;
|
|
@@ -1,88 +1,110 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Icon as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsxs as G, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import r from "react";
|
|
3
|
+
import { Icon as T } from "../Icon/Icon.js";
|
|
4
|
+
import W from "../IconButton/IconButton.js";
|
|
5
|
+
import { Indicator as X } from "../Indicator/Indicator.js";
|
|
6
|
+
import { clsx as $ } from "../../utils/clsx.js";
|
|
7
|
+
import { getValue as q } from "../../utils/getValue.js";
|
|
8
|
+
import '../../assets/Input.css';const H = "_root_e1sis_1", J = "_input_e1sis_1", L = "_small_e1sis_5", O = "_large_e1sis_9", P = "_placeholderIcon_e1sis_72", Q = "_empty_e1sis_164", U = "_decorator_e1sis_169", Y = "_onlight_e1sis_186", e = {
|
|
9
|
+
root: H,
|
|
10
|
+
input: J,
|
|
11
|
+
small: L,
|
|
12
|
+
large: O,
|
|
13
|
+
placeholderIcon: P,
|
|
14
|
+
"full-width": "_full-width_e1sis_158",
|
|
15
|
+
empty: Q,
|
|
16
|
+
decorator: U,
|
|
17
|
+
onlight: Y,
|
|
18
|
+
"backdrop-blur": "_backdrop-blur_e1sis_240"
|
|
19
|
+
};
|
|
20
|
+
function Z(I) {
|
|
21
|
+
const {
|
|
22
|
+
decorator: o,
|
|
23
|
+
loading: i,
|
|
24
|
+
type: u,
|
|
25
|
+
hasValue: d,
|
|
26
|
+
onCleare: a
|
|
27
|
+
} = I;
|
|
28
|
+
return i ? /* @__PURE__ */ t("div", { className: e.decorator, children: /* @__PURE__ */ t(X, {}) }) : o ? /* @__PURE__ */ t("div", { className: e.decorator, children: q(o) }) : u === "search" && d ? /* @__PURE__ */ t("div", { className: e.decorator, children: /* @__PURE__ */ t(W, { size: "xsmall", areaSize: "large", name: "Close", onClick: a }) }) : null;
|
|
29
|
+
}
|
|
30
|
+
const se = r.forwardRef(function(o, i) {
|
|
18
31
|
const {
|
|
19
|
-
id:
|
|
20
|
-
fullWidth:
|
|
21
|
-
value:
|
|
22
|
-
onChange:
|
|
23
|
-
onSubmit:
|
|
24
|
-
onKeyDown:
|
|
25
|
-
pattern:
|
|
26
|
-
tabIndex:
|
|
27
|
-
loading:
|
|
28
|
-
spellCheck:
|
|
29
|
-
autofocus:
|
|
30
|
-
disabled:
|
|
31
|
-
className:
|
|
32
|
-
placeholder:
|
|
33
|
-
placeholderIcon:
|
|
34
|
-
type:
|
|
32
|
+
id: u,
|
|
33
|
+
fullWidth: d = !1,
|
|
34
|
+
value: a,
|
|
35
|
+
onChange: m,
|
|
36
|
+
onSubmit: f,
|
|
37
|
+
onKeyDown: _,
|
|
38
|
+
pattern: p,
|
|
39
|
+
tabIndex: C,
|
|
40
|
+
loading: N = !1,
|
|
41
|
+
spellCheck: k = !0,
|
|
42
|
+
autofocus: w = !1,
|
|
43
|
+
disabled: x = !1,
|
|
44
|
+
className: v = "",
|
|
45
|
+
placeholder: s = "",
|
|
46
|
+
placeholderIcon: c,
|
|
47
|
+
type: g = "text",
|
|
35
48
|
size: E = "normal",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
theme: R = "default",
|
|
50
|
+
decorator: V,
|
|
51
|
+
backdropBlur: S = !1
|
|
52
|
+
} = o, [h, D] = r.useState(a), y = typeof h < "u" && h !== "" && h !== null || typeof a < "u" && a !== "" && a !== null, z = o.type === "number" && (o.min ?? Number.MIN_SAFE_INTEGER) || void 0, A = o.type === "number" && (o.max ?? Number.MAX_SAFE_INTEGER) || void 0, n = r.useCallback((l) => {
|
|
53
|
+
D(l), m && m(l);
|
|
54
|
+
}, [m]), F = r.useCallback(
|
|
55
|
+
(l) => {
|
|
42
56
|
const {
|
|
43
|
-
value:
|
|
44
|
-
} =
|
|
45
|
-
if (
|
|
46
|
-
|
|
57
|
+
value: b
|
|
58
|
+
} = l.target;
|
|
59
|
+
if (p) {
|
|
60
|
+
p.test(b) && n(b);
|
|
47
61
|
return;
|
|
48
62
|
}
|
|
49
|
-
|
|
63
|
+
n(b);
|
|
50
64
|
},
|
|
51
|
-
[
|
|
52
|
-
),
|
|
53
|
-
|
|
54
|
-
}, [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
[e
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
[n, p]
|
|
66
|
+
), K = r.useCallback((l) => {
|
|
67
|
+
_ && _(l), f && l.key === "Enter" && f();
|
|
68
|
+
}, [_, f]), M = r.useCallback(() => {
|
|
69
|
+
n("");
|
|
70
|
+
}, [n]), j = $(e.root, e[E], e[R], v, {
|
|
71
|
+
[e["full-width"]]: d,
|
|
72
|
+
[e["backdrop-blur"]]: S,
|
|
73
|
+
[e.empty]: !y
|
|
74
|
+
}), B = r.useMemo(() => s ? c ? ` ${s.trim()}` : s.trim() : "", [s, c]);
|
|
75
|
+
return /* @__PURE__ */ G("div", { className: j, children: [
|
|
76
|
+
/* @__PURE__ */ t(
|
|
61
77
|
"input",
|
|
62
78
|
{
|
|
63
|
-
id:
|
|
64
|
-
ref:
|
|
65
|
-
type:
|
|
66
|
-
tabIndex:
|
|
67
|
-
autoFocus:
|
|
79
|
+
id: u,
|
|
80
|
+
ref: i,
|
|
81
|
+
type: g,
|
|
82
|
+
tabIndex: C,
|
|
83
|
+
autoFocus: w,
|
|
68
84
|
className: e.input,
|
|
69
|
-
value:
|
|
70
|
-
placeholder:
|
|
71
|
-
disabled:
|
|
72
|
-
onChange:
|
|
73
|
-
onKeyDown:
|
|
74
|
-
spellCheck:
|
|
75
|
-
min:
|
|
85
|
+
value: a,
|
|
86
|
+
placeholder: B,
|
|
87
|
+
disabled: x,
|
|
88
|
+
onChange: F,
|
|
89
|
+
onKeyDown: K,
|
|
90
|
+
spellCheck: k,
|
|
91
|
+
min: z,
|
|
76
92
|
max: A
|
|
77
93
|
}
|
|
78
94
|
),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
95
|
+
c && /* @__PURE__ */ t(T, { name: c, className: e.placeholderIcon }),
|
|
96
|
+
/* @__PURE__ */ t(
|
|
97
|
+
Z,
|
|
98
|
+
{
|
|
99
|
+
decorator: V,
|
|
100
|
+
loading: N,
|
|
101
|
+
type: g,
|
|
102
|
+
hasValue: y,
|
|
103
|
+
onCleare: M
|
|
104
|
+
}
|
|
105
|
+
)
|
|
84
106
|
] });
|
|
85
107
|
});
|
|
86
108
|
export {
|
|
87
|
-
|
|
109
|
+
se as default
|
|
88
110
|
};
|
|
@@ -3,9 +3,9 @@ import i from "react";
|
|
|
3
3
|
import { Flex as r } from "../Layout/Flex/Flex.js";
|
|
4
4
|
import { Text as a } from "../Text/Text.js";
|
|
5
5
|
import c from "./Input.js";
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
const [d,
|
|
6
|
+
const m = /^\+?[0-9]*$/;
|
|
7
|
+
function s() {
|
|
8
|
+
const [d, h] = i.useState(""), [o, n] = i.useState(0), [t, p] = i.useState("");
|
|
9
9
|
return /* @__PURE__ */ l(r, { gap: "large", vertical: !0, children: [
|
|
10
10
|
/* @__PURE__ */ l(r, { gap: "normal", vertical: !0, children: [
|
|
11
11
|
/* @__PURE__ */ e(a, { children: "Small" }),
|
|
@@ -45,12 +45,12 @@ function u() {
|
|
|
45
45
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
46
46
|
c,
|
|
47
47
|
{
|
|
48
|
-
pattern:
|
|
48
|
+
pattern: m,
|
|
49
49
|
placeholder: "Placeholder",
|
|
50
50
|
size: "large",
|
|
51
51
|
placeholderIcon: "Tick",
|
|
52
52
|
value: d,
|
|
53
|
-
onChange:
|
|
53
|
+
onChange: h
|
|
54
54
|
}
|
|
55
55
|
) })
|
|
56
56
|
] }),
|
|
@@ -67,7 +67,7 @@ function u() {
|
|
|
67
67
|
) })
|
|
68
68
|
] }),
|
|
69
69
|
/* @__PURE__ */ l(r, { gap: "normal", vertical: !0, children: [
|
|
70
|
-
/* @__PURE__ */ e(a, { children: "Number input with min=1 max=100" }),
|
|
70
|
+
/* @__PURE__ */ e(a, { children: "Type Number input with min=1 max=100" }),
|
|
71
71
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
72
72
|
c,
|
|
73
73
|
{
|
|
@@ -77,14 +77,28 @@ function u() {
|
|
|
77
77
|
type: "number",
|
|
78
78
|
min: 1,
|
|
79
79
|
max: 100,
|
|
80
|
-
value:
|
|
81
|
-
onChange: (
|
|
80
|
+
value: o,
|
|
81
|
+
onChange: (u) => n(Number(u))
|
|
82
|
+
}
|
|
83
|
+
) })
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ l(r, { gap: "normal", vertical: !0, children: [
|
|
86
|
+
/* @__PURE__ */ e(a, { children: "Type search" }),
|
|
87
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
88
|
+
c,
|
|
89
|
+
{
|
|
90
|
+
placeholder: "Placeholder",
|
|
91
|
+
size: "large",
|
|
92
|
+
placeholderIcon: "Search",
|
|
93
|
+
type: "search",
|
|
94
|
+
value: t,
|
|
95
|
+
onChange: p
|
|
82
96
|
}
|
|
83
97
|
) })
|
|
84
98
|
] })
|
|
85
99
|
] });
|
|
86
100
|
}
|
|
87
|
-
const
|
|
101
|
+
const x = i.memo(s);
|
|
88
102
|
export {
|
|
89
|
-
|
|
103
|
+
x as default
|
|
90
104
|
};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as D, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import { Button as
|
|
4
|
-
import { clsx as
|
|
3
|
+
import { Button as F } from "../Button/Button.js";
|
|
4
|
+
import { clsx as I } 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 L = "_root_1vnop_1", T = "_renderer_1vnop_1", j = "_small_1vnop_5", E = "_large_1vnop_10", z = "_clear_1vnop_157", o = {
|
|
10
|
+
root: L,
|
|
11
|
+
renderer: T,
|
|
12
|
+
small: j,
|
|
13
13
|
large: E,
|
|
14
14
|
clear: z
|
|
15
15
|
}, P = r.forwardRef(function(f, m) {
|
|
16
16
|
const {
|
|
17
|
-
size:
|
|
17
|
+
size: p = "normal",
|
|
18
18
|
value: c,
|
|
19
|
-
onChange:
|
|
19
|
+
onChange: d,
|
|
20
20
|
onFocus: _,
|
|
21
21
|
onBlur: h,
|
|
22
22
|
onSelect: C,
|
|
23
23
|
onKeyDown: g,
|
|
24
24
|
className: R,
|
|
25
|
-
rendered:
|
|
26
|
-
placeholder:
|
|
27
|
-
autoFocus:
|
|
28
|
-
withClearButton:
|
|
29
|
-
} = f, s = r.useRef(null),
|
|
25
|
+
rendered: v,
|
|
26
|
+
placeholder: S,
|
|
27
|
+
autoFocus: k,
|
|
28
|
+
withClearButton: x = !1
|
|
29
|
+
} = f, s = r.useRef(null), n = r.useRef(null), a = i(d), u = i(C), N = r.useCallback((e) => {
|
|
30
30
|
a.current(e.target.value);
|
|
31
|
-
}, []),
|
|
31
|
+
}, []), b = r.useCallback(() => {
|
|
32
32
|
var e;
|
|
33
33
|
a.current(""), (e = s.current) == null || e.focus();
|
|
34
|
-
}, []),
|
|
34
|
+
}, []), w = 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
|
-
}, []),
|
|
40
|
-
|
|
41
|
-
}, []),
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
39
|
+
}, []), y = r.useCallback((e) => {
|
|
40
|
+
n.current && (n.current.scrollTop = e.target.scrollTop, n.current.scrollLeft = e.target.scrollLeft);
|
|
41
|
+
}, []), B = I(o.root, R, o[p]);
|
|
42
|
+
return /* @__PURE__ */ D("div", { ref: m, className: B, children: [
|
|
43
|
+
/* @__PURE__ */ t(
|
|
44
44
|
"input",
|
|
45
45
|
{
|
|
46
46
|
ref: s,
|
|
47
|
-
autoFocus:
|
|
47
|
+
autoFocus: k,
|
|
48
48
|
type: "text",
|
|
49
49
|
value: c,
|
|
50
|
-
onChange:
|
|
51
|
-
placeholder:
|
|
50
|
+
onChange: N,
|
|
51
|
+
placeholder: S,
|
|
52
52
|
onBlur: h,
|
|
53
53
|
onFocus: _,
|
|
54
|
-
onScroll:
|
|
55
|
-
onSelect:
|
|
54
|
+
onScroll: y,
|
|
55
|
+
onSelect: w,
|
|
56
56
|
onKeyDown: g
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
59
|
+
/* @__PURE__ */ t("div", { ref: n, className: o.renderer, children: v }),
|
|
60
|
+
x && c && /* @__PURE__ */ t("div", { className: o.clear, children: /* @__PURE__ */ t(F, { icon: "Close", onClick: b }) })
|
|
61
61
|
] });
|
|
62
62
|
});
|
|
63
63
|
export {
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { DropzoneOptions, FileWithPath as DropzoneFileWithPath } from 'react-dropzone';
|
|
2
|
+
import { DropzoneOptions, FileWithPath as DropzoneFileWithPath, FileError as DropzoneFileError, ErrorCode as DropzoneErrorCode } from 'react-dropzone';
|
|
3
3
|
|
|
4
4
|
export type FileWithPath = DropzoneFileWithPath;
|
|
5
|
+
export type FileError = DropzoneFileError;
|
|
6
|
+
export type ErrorCode = DropzoneErrorCode;
|
|
7
|
+
export interface FileRejection {
|
|
8
|
+
file: FileWithPath;
|
|
9
|
+
errors: FileError[];
|
|
10
|
+
}
|
|
5
11
|
export interface InputDropzoneProps extends DropzoneOptions {
|
|
6
12
|
value?: FileWithPath[];
|
|
13
|
+
rejections?: FileRejection[];
|
|
7
14
|
onRemoveFile?: (file: FileWithPath) => void;
|
|
15
|
+
onRemoveRejection?: (file: FileWithPath) => void;
|
|
8
16
|
text?: string;
|
|
9
17
|
linkText?: string;
|
|
10
18
|
removeItemAriaLabel?: string;
|