@cfx-dev/ui-components 1.0.2 → 1.1.1
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/README.md +38 -38
- package/dist/Button.module-Cv-7p0xt.js +16 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Flex.css +1 -1
- package/dist/assets/Flyout.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/Island.css +1 -1
- package/dist/assets/Pad.css +1 -1
- package/dist/assets/Popover.css +1 -1
- package/dist/assets/RichInput.css +1 -1
- package/dist/assets/Spacer.css +1 -1
- package/dist/assets/Textarea.css +1 -1
- package/dist/assets/global.css +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/ButtonBar.js +1 -1
- package/dist/components/Flyout/Flyout.js +39 -39
- package/dist/components/Input/Input.d.ts +0 -1
- package/dist/components/Input/Input.js +58 -61
- package/dist/components/Input/RichInput.js +27 -27
- package/dist/components/InputDropzone/InputDropzone.js +122 -119
- package/dist/components/InputDropzone/ItemPreview.js +1 -1
- package/dist/components/Island/Island.js +23 -23
- package/dist/components/Layout/Flex/Flex.d.ts +1 -1
- package/dist/components/Layout/Flex/Flex.js +44 -43
- package/dist/components/Layout/Pad/Pad.d.ts +1 -1
- package/dist/components/Layout/Pad/Pad.js +30 -29
- package/dist/components/Modal/Modal.d.ts +2 -0
- package/dist/components/Modal/Modal.js +25 -23
- package/dist/components/Overlay/Overlay.js +13 -13
- package/dist/components/Popover/Popover.js +18 -18
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.js +239 -229
- package/dist/components/Spacer/Spacer.d.ts +1 -1
- package/dist/components/Spacer/Spacer.js +13 -12
- package/dist/components/Table/Table.js +41 -35
- package/dist/components/Text/Text.types.d.ts +1 -1
- package/dist/components/Textarea/Textarea.d.ts +0 -1
- package/dist/components/Textarea/Textarea.js +37 -40
- package/dist/iconBase-Bipuk9tK.js +112 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +112 -113
- package/dist/style-guide/Icons/IconDisplayGrid.js +3 -3
- package/dist/style-guide/Icons/Icons.d.ts +13 -13
- package/dist/style-guide/Icons/Icons.js +36 -8
- package/dist/styles-scss/_ui.scss +167 -195
- package/dist/styles-scss/assets/images/checkered_dark.svg +7 -7
- package/dist/styles-scss/assets/images/checkered_light.svg +7 -7
- package/dist/styles-scss/global.scss +73 -75
- package/dist/styles-scss/theme_dark.scss +24 -24
- package/dist/styles-scss/theme_light.scss +54 -54
- package/dist/styles-scss/themes.scss +2 -2
- package/dist/styles-scss/tokens.scss +272 -274
- package/dist/utils/string.d.ts +16 -1
- package/dist/utils/string.js +46 -39
- package/package.json +71 -72
- package/dist/Button.module-Z6njvP9Z.js +0 -17
- package/dist/Icons-NE1cibCU.js +0 -107
- package/dist/index.esm-BkynlSN6.js +0 -72
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
export type ButtonTheme = 'default' | '
|
|
3
|
+
export type ButtonTheme = 'default' | 'primary' | 'transparent';
|
|
4
4
|
export type ButtonSize = 'normal' | 'small' | 'large';
|
|
5
5
|
export interface ButtonProps {
|
|
6
6
|
text?: React.ReactNode;
|
|
@@ -2,7 +2,7 @@ import { jsx as c, jsxs as j, Fragment as w } from "react/jsx-runtime";
|
|
|
2
2
|
import b from "react";
|
|
3
3
|
import { clsx as z } from "../../utils/clsx.js";
|
|
4
4
|
import { noop as p } from "../../utils/functional.js";
|
|
5
|
-
import { s as t } from "../../Button.module-
|
|
5
|
+
import { s as t } from "../../Button.module-Cv-7p0xt.js";
|
|
6
6
|
function F(a) {
|
|
7
7
|
const {
|
|
8
8
|
text: e = null,
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import _ from "react";
|
|
3
|
-
import { F as
|
|
4
|
-
import { Button as
|
|
3
|
+
import { F as h } from "../../Combination-Dp_plIQU.js";
|
|
4
|
+
import { Button as y } from "../Button/Button.js";
|
|
5
5
|
import { Interactive as f } from "../Interactive/Interactive.js";
|
|
6
|
-
import {
|
|
6
|
+
import { Icons as u } from "../../style-guide/Icons/Icons.js";
|
|
7
7
|
import { clsx as l } from "../../utils/clsx.js";
|
|
8
|
-
import { noop as
|
|
9
|
-
import { useOutlet as
|
|
10
|
-
import '../../assets/Flyout.css';const
|
|
11
|
-
root:
|
|
12
|
-
"size-normal": "_size-
|
|
13
|
-
holder:
|
|
14
|
-
"size-small": "_size-
|
|
15
|
-
"size-xsmall": "_size-
|
|
16
|
-
active:
|
|
17
|
-
backdrop:
|
|
18
|
-
"backdrop-appearance": "_backdrop-
|
|
19
|
-
mask:
|
|
20
|
-
"holder-appearance": "_holder-
|
|
21
|
-
content:
|
|
22
|
-
header:
|
|
8
|
+
import { noop as x } from "../../utils/functional.js";
|
|
9
|
+
import { useOutlet as k, useKeyboardClose as v } from "../../utils/hooks.js";
|
|
10
|
+
import '../../assets/Flyout.css';const b = "_root_xny34_1", z = "_holder_xny34_6", N = "_active_xny34_15", C = "_backdrop_xny34_15", F = "_mask_xny34_28", L = "_content_xny34_83", I = "_header_xny34_88", O = "_title_xny34_94", e = {
|
|
11
|
+
root: b,
|
|
12
|
+
"size-normal": "_size-normal_xny34_6",
|
|
13
|
+
holder: z,
|
|
14
|
+
"size-small": "_size-small_xny34_9",
|
|
15
|
+
"size-xsmall": "_size-xsmall_xny34_12",
|
|
16
|
+
active: N,
|
|
17
|
+
backdrop: C,
|
|
18
|
+
"backdrop-appearance": "_backdrop-appearance_xny34_1",
|
|
19
|
+
mask: F,
|
|
20
|
+
"holder-appearance": "_holder-appearance_xny34_1",
|
|
21
|
+
content: L,
|
|
22
|
+
header: I,
|
|
23
23
|
title: O
|
|
24
24
|
}, E = "flyout-outlet";
|
|
25
25
|
function T(c) {
|
|
26
26
|
const {
|
|
27
|
-
disabled:
|
|
28
|
-
size:
|
|
29
|
-
onClose: r =
|
|
30
|
-
children:
|
|
27
|
+
disabled: t = !1,
|
|
28
|
+
size: n = "normal",
|
|
29
|
+
onClose: r = x,
|
|
30
|
+
children: a,
|
|
31
31
|
holderClassName: d
|
|
32
|
-
} = c, m =
|
|
32
|
+
} = c, m = k(E);
|
|
33
33
|
_.useEffect(() => {
|
|
34
|
-
if (
|
|
34
|
+
if (t)
|
|
35
35
|
return;
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
}, [
|
|
39
|
-
const
|
|
40
|
-
[e.active]: !
|
|
36
|
+
const s = document.getElementById("cfxui-root");
|
|
37
|
+
return s == null || s.classList.add("shrink"), () => s == null ? void 0 : s.classList.remove("shrink");
|
|
38
|
+
}, [t]), v(r);
|
|
39
|
+
const p = l(e.root, e[`size-${n}`], {
|
|
40
|
+
[e.active]: !t
|
|
41
41
|
});
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ i("div", { className: p, children: [
|
|
43
|
+
/* @__PURE__ */ o(f, { showPointer: !1, className: e.backdrop, onClick: r }),
|
|
44
|
+
/* @__PURE__ */ o("div", { className: e.mask, children: /* @__PURE__ */ o("div", { className: l(e.holder, d), children: /* @__PURE__ */ o(h, { disabled: !!t, className: e.content, children: a }) }) })
|
|
45
45
|
] }) });
|
|
46
46
|
}
|
|
47
|
-
T.Header = _.forwardRef(function(
|
|
47
|
+
T.Header = _.forwardRef(function(t, n) {
|
|
48
48
|
const {
|
|
49
49
|
onClose: r,
|
|
50
|
-
children:
|
|
51
|
-
} =
|
|
52
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
!!r && /* @__PURE__ */
|
|
50
|
+
children: a
|
|
51
|
+
} = t;
|
|
52
|
+
return /* @__PURE__ */ i("div", { ref: n, className: e.header, children: [
|
|
53
|
+
/* @__PURE__ */ o("div", { className: e.title, children: a }),
|
|
54
|
+
!!r && /* @__PURE__ */ o(y, { size: "large", icon: u.exit, onClick: r })
|
|
55
55
|
] });
|
|
56
56
|
});
|
|
57
57
|
export {
|
|
@@ -1,96 +1,93 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as n, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import r from "react";
|
|
3
3
|
import { Indicator as q } from "../Indicator/Indicator.js";
|
|
4
|
-
import { clsx as
|
|
5
|
-
import { getValue as
|
|
4
|
+
import { clsx as B } from "../../utils/clsx.js";
|
|
5
|
+
import { getValue as H } from "../../utils/getValue.js";
|
|
6
6
|
import { useDynamicRef as i } from "../../utils/hooks.js";
|
|
7
|
-
import '../../assets/Input.css';const O = "
|
|
8
|
-
root:
|
|
9
|
-
input:
|
|
10
|
-
small:
|
|
11
|
-
large:
|
|
12
|
-
"full-width": "_full-
|
|
13
|
-
decorator:
|
|
14
|
-
error:
|
|
15
|
-
disabled:
|
|
16
|
-
description:
|
|
17
|
-
|
|
18
|
-
}, ce = n.forwardRef(function(t, g) {
|
|
7
|
+
import '../../assets/Input.css';const J = "_root_1eaux_1", O = "_input_1eaux_1", P = "_small_1eaux_8", Q = "_large_1eaux_12", U = "_decorator_1eaux_60", Y = "_error_1eaux_68", Z = "_disabled_1eaux_72", $ = "_description_1eaux_106", e = {
|
|
8
|
+
root: J,
|
|
9
|
+
input: O,
|
|
10
|
+
small: P,
|
|
11
|
+
large: Q,
|
|
12
|
+
"full-width": "_full-width_1eaux_57",
|
|
13
|
+
decorator: U,
|
|
14
|
+
error: Y,
|
|
15
|
+
disabled: Z,
|
|
16
|
+
description: $
|
|
17
|
+
}, le = r.forwardRef(function(o, N) {
|
|
19
18
|
const {
|
|
20
|
-
label:
|
|
21
|
-
value:
|
|
22
|
-
onChange:
|
|
23
|
-
onSubmit:
|
|
24
|
-
onKeyDown:
|
|
19
|
+
label: u,
|
|
20
|
+
value: b,
|
|
21
|
+
onChange: C,
|
|
22
|
+
onSubmit: g,
|
|
23
|
+
onKeyDown: w = () => !1,
|
|
25
24
|
pattern: a,
|
|
26
|
-
tabIndex:
|
|
27
|
-
error:
|
|
28
|
-
fullWidth:
|
|
29
|
-
showLoader:
|
|
30
|
-
noSpellCheck:
|
|
31
|
-
autofocus:
|
|
25
|
+
tabIndex: y,
|
|
26
|
+
error: I = !1,
|
|
27
|
+
fullWidth: R = !1,
|
|
28
|
+
showLoader: d = !1,
|
|
29
|
+
noSpellCheck: v = !1,
|
|
30
|
+
autofocus: E = !1,
|
|
32
31
|
disabled: m = !1,
|
|
33
|
-
className:
|
|
32
|
+
className: k = "",
|
|
34
33
|
placeholder: D = "",
|
|
35
34
|
inputClassName: S = "",
|
|
36
35
|
inputRef: F,
|
|
37
36
|
description: _ = "",
|
|
38
37
|
type: K = "text",
|
|
39
38
|
size: A = "normal",
|
|
40
|
-
decorator:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(o) => {
|
|
39
|
+
decorator: s
|
|
40
|
+
} = o, j = o.type === "number" && (o.min ?? Number.MIN_SAFE_INTEGER) || void 0, G = o.type === "number" && (o.max ?? Number.MAX_SAFE_INTEGER) || void 0, f = r.useId(), p = i(C), M = i(w), h = i(g), T = r.useCallback(
|
|
41
|
+
(t) => {
|
|
44
42
|
const {
|
|
45
|
-
value:
|
|
46
|
-
} =
|
|
43
|
+
value: l
|
|
44
|
+
} = t.target;
|
|
47
45
|
if (a) {
|
|
48
|
-
a.test(
|
|
46
|
+
a.test(l) && p.current(l);
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
51
|
-
return p.current(
|
|
49
|
+
return p.current(l);
|
|
52
50
|
},
|
|
53
51
|
[a]
|
|
54
|
-
),
|
|
55
|
-
|
|
56
|
-
}, []),
|
|
57
|
-
!!
|
|
58
|
-
!!
|
|
59
|
-
] }) : null,
|
|
52
|
+
), V = r.useCallback((t) => {
|
|
53
|
+
M.current(t) || h.current && t.key === "Enter" && h.current();
|
|
54
|
+
}, []), z = d || s ? /* @__PURE__ */ n("div", { className: e.decorator, children: [
|
|
55
|
+
!!d && /* @__PURE__ */ c(q, {}),
|
|
56
|
+
!!s && H(s)
|
|
57
|
+
] }) : null, x = /* @__PURE__ */ n("div", { className: e.input, children: [
|
|
60
58
|
/* @__PURE__ */ c(
|
|
61
59
|
"input",
|
|
62
60
|
{
|
|
63
61
|
id: f,
|
|
64
62
|
ref: F,
|
|
65
63
|
type: K,
|
|
66
|
-
tabIndex:
|
|
67
|
-
autoFocus:
|
|
64
|
+
tabIndex: y,
|
|
65
|
+
autoFocus: E,
|
|
68
66
|
className: S,
|
|
69
|
-
value:
|
|
67
|
+
value: b,
|
|
70
68
|
placeholder: D,
|
|
71
69
|
disabled: m,
|
|
72
|
-
onChange:
|
|
73
|
-
onKeyDown:
|
|
74
|
-
spellCheck: !
|
|
75
|
-
min:
|
|
76
|
-
max:
|
|
70
|
+
onChange: T,
|
|
71
|
+
onKeyDown: V,
|
|
72
|
+
spellCheck: !v,
|
|
73
|
+
min: j,
|
|
74
|
+
max: G
|
|
77
75
|
}
|
|
78
76
|
),
|
|
79
|
-
|
|
80
|
-
] }), L = _ ? /* @__PURE__ */ c("div", { className: e.description, children: _ }) : null, W =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
] }) :
|
|
84
|
-
[e["full-width"]]:
|
|
85
|
-
[e.error]:
|
|
86
|
-
[e.disabled]: m
|
|
87
|
-
[e["backdrop-blur"]]: j
|
|
77
|
+
z
|
|
78
|
+
] }), L = _ ? /* @__PURE__ */ c("div", { className: e.description, children: _ }) : null, W = u ? /* @__PURE__ */ n("label", { htmlFor: f, children: [
|
|
79
|
+
u,
|
|
80
|
+
x
|
|
81
|
+
] }) : x, X = B(e.root, e[A], k, {
|
|
82
|
+
[e["full-width"]]: R,
|
|
83
|
+
[e.error]: I,
|
|
84
|
+
[e.disabled]: m
|
|
88
85
|
});
|
|
89
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ n("div", { ref: N, className: X, children: [
|
|
90
87
|
W,
|
|
91
88
|
L
|
|
92
89
|
] });
|
|
93
90
|
});
|
|
94
91
|
export {
|
|
95
|
-
|
|
92
|
+
le as Input
|
|
96
93
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Button as
|
|
4
|
-
import {
|
|
5
|
-
import { clsx as
|
|
1
|
+
import { jsxs as y, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import n from "react";
|
|
3
|
+
import { Button as B } from "../Button/Button.js";
|
|
4
|
+
import { Icons as D } from "../../style-guide/Icons/Icons.js";
|
|
5
|
+
import { clsx as F } from "../../utils/clsx.js";
|
|
6
6
|
import { useDynamicRef as i } from "../../utils/hooks.js";
|
|
7
|
-
import '../../assets/RichInput.css';const
|
|
8
|
-
root:
|
|
9
|
-
renderer:
|
|
7
|
+
import '../../assets/RichInput.css';const L = "_root_1n2jn_1", T = "_renderer_1n2jn_1", z = "_small_1n2jn_8", E = "_large_1n2jn_13", H = "_clear_1n2jn_88", o = {
|
|
8
|
+
root: L,
|
|
9
|
+
renderer: T,
|
|
10
10
|
small: z,
|
|
11
11
|
large: E,
|
|
12
12
|
clear: H
|
|
13
|
-
}, O =
|
|
13
|
+
}, O = n.forwardRef(function(f, m) {
|
|
14
14
|
const {
|
|
15
15
|
size: d = "normal",
|
|
16
16
|
value: c,
|
|
@@ -20,42 +20,42 @@ import '../../assets/RichInput.css';const T = "_root_16on4_1", j = "_renderer_16
|
|
|
20
20
|
onSelect: g,
|
|
21
21
|
onKeyDown: C,
|
|
22
22
|
className: R,
|
|
23
|
-
rendered:
|
|
24
|
-
placeholder:
|
|
25
|
-
autoFocus:
|
|
26
|
-
withClearButton:
|
|
27
|
-
} = f, s =
|
|
23
|
+
rendered: j,
|
|
24
|
+
placeholder: S,
|
|
25
|
+
autoFocus: x,
|
|
26
|
+
withClearButton: k = !1
|
|
27
|
+
} = f, s = n.useRef(null), r = n.useRef(null), a = i(p), u = i(g), N = n.useCallback((e) => {
|
|
28
28
|
a.current(e.target.value);
|
|
29
|
-
}, []), b =
|
|
29
|
+
}, []), b = n.useCallback(() => {
|
|
30
30
|
var e;
|
|
31
31
|
a.current(""), (e = s.current) == null || e.focus();
|
|
32
|
-
}, []),
|
|
32
|
+
}, []), I = n.useCallback((e) => {
|
|
33
33
|
if (!u.current || !(e.target instanceof HTMLInputElement))
|
|
34
34
|
return;
|
|
35
35
|
const l = e.target;
|
|
36
36
|
u.current(l.selectionStart, l.selectionEnd, l.selectionDirection);
|
|
37
|
-
}, []),
|
|
38
|
-
|
|
39
|
-
}, []),
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
37
|
+
}, []), v = n.useCallback((e) => {
|
|
38
|
+
r.current && (r.current.scrollTop = e.target.scrollTop, r.current.scrollLeft = e.target.scrollLeft);
|
|
39
|
+
}, []), w = F(o.root, R, o[d]);
|
|
40
|
+
return /* @__PURE__ */ y("div", { ref: m, className: w, children: [
|
|
41
|
+
/* @__PURE__ */ t(
|
|
42
42
|
"input",
|
|
43
43
|
{
|
|
44
44
|
ref: s,
|
|
45
|
-
autoFocus:
|
|
45
|
+
autoFocus: x,
|
|
46
46
|
type: "text",
|
|
47
47
|
value: c,
|
|
48
48
|
onChange: N,
|
|
49
|
-
placeholder:
|
|
49
|
+
placeholder: S,
|
|
50
50
|
onBlur: h,
|
|
51
51
|
onFocus: _,
|
|
52
|
-
onScroll:
|
|
53
|
-
onSelect:
|
|
52
|
+
onScroll: v,
|
|
53
|
+
onSelect: I,
|
|
54
54
|
onKeyDown: C
|
|
55
55
|
}
|
|
56
56
|
),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
57
|
+
/* @__PURE__ */ t("div", { ref: r, className: o.renderer, children: j }),
|
|
58
|
+
k && c && /* @__PURE__ */ t("div", { className: o.clear, children: /* @__PURE__ */ t(B, { size: "small", icon: D.exit, onClick: b }) })
|
|
59
59
|
] });
|
|
60
60
|
});
|
|
61
61
|
export {
|