@cfx-dev/ui-components 4.5.0 → 4.5.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/assets/all_css.css +2 -0
- package/dist/assets/css/Input.css +1 -1
- package/dist/assets/css/StyledInput.css +1 -0
- package/dist/assets/css/StyledTextarea.css +1 -0
- package/dist/assets/css/Textarea.css +1 -1
- package/dist/assets/general/global.css +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.js +139 -129
- package/dist/components/DropdownSelect/DropdownSelect.d.ts +2 -1
- package/dist/components/DropdownSelect/DropdownSelect.js +53 -44
- package/dist/components/DropdownSelect/DropdownSelectShowcase.js +13 -12
- package/dist/components/Input/Input.d.ts +3 -2
- package/dist/components/Input/Input.js +94 -89
- package/dist/components/Input/Input.types.d.ts +2 -0
- package/dist/components/Input/Input.types.js +1 -0
- package/dist/components/Input/RichInput.d.ts +1 -1
- package/dist/components/Input/index.d.ts +2 -1
- package/dist/components/InputDropzone/InputDropzone.d.ts +1 -0
- package/dist/components/InputDropzone/InputDropzone.js +135 -134
- package/dist/components/InputDropzone/InputDropzoneShowcase.js +6 -5
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/Radio/Radio.js +21 -19
- package/dist/components/StyledInput/StyledInput.d.ts +12 -0
- package/dist/components/StyledInput/StyledInput.js +46 -0
- package/dist/components/StyledInput/index.d.ts +2 -0
- package/dist/components/StyledInput/index.js +4 -0
- package/dist/components/StyledTextarea/StyledTextarea.d.ts +10 -0
- package/dist/components/StyledTextarea/StyledTextarea.js +32 -0
- package/dist/components/StyledTextarea/index.d.ts +2 -0
- package/dist/components/StyledTextarea/index.js +4 -0
- package/dist/components/Switch/Switch.js +61 -49
- package/dist/components/Tabular/Tabular.d.ts +12 -0
- package/dist/components/Tabular/Tabular.js +34 -33
- package/dist/components/Tabular/index.d.ts +1 -1
- package/dist/components/Textarea/Textarea.d.ts +7 -3
- package/dist/components/Textarea/Textarea.js +46 -43
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +57 -47
- package/dist/main.d.ts +5 -1
- package/dist/main.js +126 -122
- package/dist/rsc.d.ts +4 -0
- package/dist/rsc.js +12 -8
- package/dist/styles-scss/_ui.scss +4 -2
- package/dist/styles-scss/global.scss +1 -1
- package/dist/styles-scss/tokens.scss +19 -20
- package/package.json +1 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as q, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import i from "react";
|
|
3
|
-
import { Icon as
|
|
4
|
-
import
|
|
5
|
-
import { Indicator as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
empty:
|
|
14
|
-
placeholderIcon:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
import { Icon as H } from "../Icon/Icon.js";
|
|
4
|
+
import J from "../IconButton/IconButton.js";
|
|
5
|
+
import { Indicator as L } from "../Indicator/Indicator.js";
|
|
6
|
+
import O from "../StyledInput/StyledInput.js";
|
|
7
|
+
import { clsx as k } from "../../utils/clsx.js";
|
|
8
|
+
import { getValue as P } from "../../utils/getValue.js";
|
|
9
|
+
import { ui as Q } from "../../utils/ui/ui.js";
|
|
10
|
+
const U = "cfxui__Input__root__6392b", Y = "cfxui__Input__fullWidth__5a033", Z = "cfxui__Input__empty__3b36a", ee = "cfxui__Input__placeholderIcon__4d079", le = "cfxui__Input__input__07830", te = "cfxui__Input__decorator__3b81f", ae = "cfxui__Input__small__c1513", ie = "cfxui__Input__large__92d72", ne = "cfxui__Input__onlight__7d0b7", ue = "cfxui__Input__backdropBlur__fdde1", l = {
|
|
11
|
+
root: U,
|
|
12
|
+
fullWidth: Y,
|
|
13
|
+
empty: Z,
|
|
14
|
+
placeholderIcon: ee,
|
|
15
|
+
input: le,
|
|
16
|
+
decorator: te,
|
|
17
|
+
small: ae,
|
|
18
|
+
large: ie,
|
|
19
|
+
onlight: ne,
|
|
20
|
+
backdropBlur: ue,
|
|
20
21
|
"inputSizeinitial-large": "cfxui__Input__inputSizeinitial-large__12afb",
|
|
21
22
|
"inputSizeinitial-small": "cfxui__Input__inputSizeinitial-small__33905",
|
|
22
23
|
"inputSizesmall-large": "cfxui__Input__inputSizesmall-large__e2689",
|
|
@@ -32,115 +33,119 @@ const P = "cfxui__Input__root__6392b", Q = "cfxui__Input__fullWidth__5a033", U =
|
|
|
32
33
|
"inputSizexlarge-large": "cfxui__Input__inputSizexlarge-large__1ef2c",
|
|
33
34
|
"inputSizexlarge-small": "cfxui__Input__inputSizexlarge-small__7f6ab"
|
|
34
35
|
};
|
|
35
|
-
function
|
|
36
|
+
function _e(n) {
|
|
36
37
|
const {
|
|
37
|
-
decorator:
|
|
38
|
+
decorator: r,
|
|
38
39
|
loading: m,
|
|
39
40
|
type: p,
|
|
40
41
|
hasValue: a,
|
|
41
|
-
onCleare:
|
|
42
|
+
onCleare: o
|
|
42
43
|
} = n;
|
|
43
|
-
return m ? /* @__PURE__ */ t("div", { className: l.decorator, children: /* @__PURE__ */ t(
|
|
44
|
+
return m ? /* @__PURE__ */ t("div", { className: l.decorator, children: /* @__PURE__ */ t(L, {}) }) : r ? /* @__PURE__ */ t("div", { className: l.decorator, children: P(r) }) : p === "search" && a ? /* @__PURE__ */ t("div", { className: l.decorator, children: /* @__PURE__ */ t(J, { size: "xsmall", areaSize: "large", name: "Close", onClick: o }) }) : null;
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
+
function Ie(n) {
|
|
46
47
|
const {
|
|
47
|
-
id:
|
|
48
|
+
id: r,
|
|
48
49
|
name: m,
|
|
49
50
|
fullWidth: p = !1,
|
|
50
51
|
value: a,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
defaultValue: o,
|
|
53
|
+
onChange: d,
|
|
54
|
+
onSubmit: f,
|
|
55
|
+
onKeyDown: g,
|
|
56
|
+
pattern: I,
|
|
57
|
+
tabIndex: R,
|
|
58
|
+
loading: w = !1,
|
|
59
|
+
spellCheck: v = !0,
|
|
60
|
+
autofocus: E = !1,
|
|
61
|
+
disabled: V = !1,
|
|
62
|
+
className: B,
|
|
63
|
+
containerClassName: W,
|
|
62
64
|
placeholder: c = "",
|
|
63
65
|
placeholderIcon: s,
|
|
64
|
-
type:
|
|
65
|
-
size:
|
|
66
|
-
theme:
|
|
67
|
-
decorator:
|
|
68
|
-
backdropBlur:
|
|
69
|
-
ref:
|
|
70
|
-
} = n, [x,
|
|
71
|
-
let
|
|
66
|
+
type: S = "text",
|
|
67
|
+
size: z = "normal",
|
|
68
|
+
theme: h = "default",
|
|
69
|
+
decorator: D,
|
|
70
|
+
backdropBlur: F = !1,
|
|
71
|
+
ref: A
|
|
72
|
+
} = n, [x, K] = i.useState(a || o), b = typeof x < "u" && x !== "" && x !== null || typeof a < "u" && a !== "" && a !== null;
|
|
73
|
+
let C, y, N;
|
|
72
74
|
if (n.type === "number") {
|
|
73
75
|
const {
|
|
74
76
|
min: e,
|
|
75
|
-
max:
|
|
76
|
-
step:
|
|
77
|
+
max: _,
|
|
78
|
+
step: $
|
|
77
79
|
} = n;
|
|
78
|
-
|
|
80
|
+
N = $ ?? 1, C = e ?? Number.MIN_SAFE_INTEGER, y = _ ?? Number.MAX_SAFE_INTEGER;
|
|
79
81
|
}
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
}, [
|
|
82
|
+
const u = i.useCallback((e) => {
|
|
83
|
+
K(e), d && d(e);
|
|
84
|
+
}, [d]), M = i.useCallback(
|
|
83
85
|
(e) => {
|
|
84
86
|
const {
|
|
85
|
-
value:
|
|
87
|
+
value: _
|
|
86
88
|
} = e.target;
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
+
if (I) {
|
|
90
|
+
I.test(_) && u(_);
|
|
89
91
|
return;
|
|
90
92
|
}
|
|
91
|
-
_
|
|
93
|
+
u(_);
|
|
92
94
|
},
|
|
93
|
-
[
|
|
94
|
-
),
|
|
95
|
-
|
|
96
|
-
}, [
|
|
97
|
-
|
|
98
|
-
}, [
|
|
95
|
+
[u, I]
|
|
96
|
+
), j = i.useCallback((e) => {
|
|
97
|
+
g && g(e), f && e.key === "Enter" && f();
|
|
98
|
+
}, [g, f]), G = i.useCallback(() => {
|
|
99
|
+
u("");
|
|
100
|
+
}, [u]), T = k(
|
|
99
101
|
l.root,
|
|
100
|
-
l[
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
l[h],
|
|
103
|
+
W,
|
|
104
|
+
Q.getResponsiveFlatClassnames("input-size", z).map((e) => l[e]),
|
|
103
105
|
{
|
|
104
106
|
[l.fullWidth]: p,
|
|
105
|
-
[l.backdropBlur]:
|
|
106
|
-
[l.empty]: !
|
|
107
|
+
[l.backdropBlur]: F,
|
|
108
|
+
[l.empty]: !b
|
|
107
109
|
}
|
|
108
|
-
),
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
+
), X = i.useMemo(() => c ? s ? ` ${c.trim()}` : c.trim() : "", [c, s]);
|
|
111
|
+
return /* @__PURE__ */ q("div", { className: T, children: [
|
|
110
112
|
/* @__PURE__ */ t(
|
|
111
|
-
|
|
113
|
+
O,
|
|
112
114
|
{
|
|
113
|
-
|
|
115
|
+
size: z,
|
|
116
|
+
theme: h,
|
|
117
|
+
id: r,
|
|
114
118
|
name: m,
|
|
115
|
-
ref:
|
|
116
|
-
type:
|
|
117
|
-
tabIndex:
|
|
118
|
-
|
|
119
|
-
className: C(l.input, v),
|
|
119
|
+
ref: A,
|
|
120
|
+
type: S,
|
|
121
|
+
tabIndex: R,
|
|
122
|
+
className: k(l.input, B),
|
|
120
123
|
value: a,
|
|
121
|
-
placeholder:
|
|
122
|
-
disabled:
|
|
123
|
-
onChange:
|
|
124
|
-
onKeyDown:
|
|
125
|
-
spellCheck:
|
|
126
|
-
min:
|
|
127
|
-
max:
|
|
128
|
-
step:
|
|
124
|
+
placeholder: X,
|
|
125
|
+
disabled: V,
|
|
126
|
+
onChange: M,
|
|
127
|
+
onKeyDown: j,
|
|
128
|
+
spellCheck: v,
|
|
129
|
+
min: C,
|
|
130
|
+
max: y,
|
|
131
|
+
step: N,
|
|
132
|
+
defaultValue: o,
|
|
133
|
+
autoFocus: E
|
|
129
134
|
}
|
|
130
135
|
),
|
|
131
|
-
s && /* @__PURE__ */ t(
|
|
136
|
+
s && /* @__PURE__ */ t(H, { name: s, className: l.placeholderIcon }),
|
|
132
137
|
/* @__PURE__ */ t(
|
|
133
|
-
|
|
138
|
+
_e,
|
|
134
139
|
{
|
|
135
|
-
decorator:
|
|
136
|
-
loading:
|
|
137
|
-
type:
|
|
138
|
-
hasValue:
|
|
139
|
-
onCleare:
|
|
140
|
+
decorator: D,
|
|
141
|
+
loading: w,
|
|
142
|
+
type: S,
|
|
143
|
+
hasValue: b,
|
|
144
|
+
onCleare: G
|
|
140
145
|
}
|
|
141
146
|
)
|
|
142
147
|
] });
|
|
143
148
|
}
|
|
144
149
|
export {
|
|
145
|
-
|
|
150
|
+
Ie as default
|
|
146
151
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Input } from './Input';
|
|
2
2
|
export { default as RichInput } from './RichInput';
|
|
3
|
-
export type {
|
|
3
|
+
export type { InputProps } from './Input';
|
|
4
|
+
export type { InputSize, InputTheme } from './Input.types';
|
|
4
5
|
export type { RichInputProps } from './RichInput';
|
|
@@ -19,6 +19,7 @@ export interface InputDropzoneProps extends DropzoneOptions {
|
|
|
19
19
|
rootAriaLabel?: string;
|
|
20
20
|
dropzoneClassName?: string;
|
|
21
21
|
dropzoneItemClassName?: string;
|
|
22
|
+
name?: string;
|
|
22
23
|
}
|
|
23
24
|
declare function InputDropzone(props: InputDropzoneProps): import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
declare const _default: React.MemoExoticComponent<typeof InputDropzone>;
|