@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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputSize, InputTheme } from '../Input/Input.types';
|
|
3
|
+
import { ResponsiveValueType } from '../../utils/ui';
|
|
4
|
+
|
|
5
|
+
export interface StyledInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
6
|
+
className?: string;
|
|
7
|
+
size?: ResponsiveValueType<InputSize>;
|
|
8
|
+
theme?: InputTheme;
|
|
9
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
10
|
+
}
|
|
11
|
+
declare function StyledInput(props: StyledInputProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default StyledInput;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as m } from "../../utils/clsx.js";
|
|
3
|
+
import { ui as p } from "../../utils/ui/ui.js";
|
|
4
|
+
const s = "cfxui__StyledInput__root__37064", S = "cfxui__StyledInput__small__0f240", r = "cfxui__StyledInput__large__a3ad2", d = "cfxui__StyledInput__onlight__dcd8f", l = {
|
|
5
|
+
root: s,
|
|
6
|
+
small: S,
|
|
7
|
+
large: r,
|
|
8
|
+
onlight: d,
|
|
9
|
+
"inputSizeinitial-large": "cfxui__StyledInput__inputSizeinitial-large__a31e6",
|
|
10
|
+
"inputSizeinitial-small": "cfxui__StyledInput__inputSizeinitial-small__77433",
|
|
11
|
+
"inputSizesmall-large": "cfxui__StyledInput__inputSizesmall-large__eb62a",
|
|
12
|
+
"inputSizesmall-small": "cfxui__StyledInput__inputSizesmall-small__d5e87",
|
|
13
|
+
"inputSizesmall-medium-large": "cfxui__StyledInput__inputSizesmall-medium-large__b13be",
|
|
14
|
+
"inputSizesmall-medium-small": "cfxui__StyledInput__inputSizesmall-medium-small__a9d00",
|
|
15
|
+
"inputSizemedium-large": "cfxui__StyledInput__inputSizemedium-large__75764",
|
|
16
|
+
"inputSizemedium-small": "cfxui__StyledInput__inputSizemedium-small__43151",
|
|
17
|
+
"inputSizemedium-large-large": "cfxui__StyledInput__inputSizemedium-large-large__3f450",
|
|
18
|
+
"inputSizemedium-large-small": "cfxui__StyledInput__inputSizemedium-large-small__eba0f",
|
|
19
|
+
"inputSizelarge-large": "cfxui__StyledInput__inputSizelarge-large__19572",
|
|
20
|
+
"inputSizelarge-small": "cfxui__StyledInput__inputSizelarge-small__3ecc3",
|
|
21
|
+
"inputSizexlarge-large": "cfxui__StyledInput__inputSizexlarge-large__06e9b",
|
|
22
|
+
"inputSizexlarge-small": "cfxui__StyledInput__inputSizexlarge-small__b318f"
|
|
23
|
+
};
|
|
24
|
+
function f(e) {
|
|
25
|
+
const {
|
|
26
|
+
className: i,
|
|
27
|
+
size: _ = "normal",
|
|
28
|
+
theme: t = "default",
|
|
29
|
+
...u
|
|
30
|
+
} = e;
|
|
31
|
+
return /* @__PURE__ */ n(
|
|
32
|
+
"input",
|
|
33
|
+
{
|
|
34
|
+
className: m(
|
|
35
|
+
i,
|
|
36
|
+
l.root,
|
|
37
|
+
l[t],
|
|
38
|
+
p.getResponsiveFlatClassnames("input-size", _).map((a) => l[a])
|
|
39
|
+
),
|
|
40
|
+
...u
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
f as default
|
|
46
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type TextareaResizeType = 'none' | 'vertical' | 'horizontal' | 'both';
|
|
4
|
+
export interface StyledTextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
5
|
+
className?: string;
|
|
6
|
+
resize?: TextareaResizeType;
|
|
7
|
+
ref?: React.Ref<HTMLTextAreaElement>;
|
|
8
|
+
}
|
|
9
|
+
declare function StyledTextarea(props: StyledTextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default StyledTextarea;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as i } from "../../utils/clsx.js";
|
|
3
|
+
const c = "cfxui__StyledTextarea__root__8c3b9", e = {
|
|
4
|
+
root: c,
|
|
5
|
+
"resize-none": "cfxui__StyledTextarea__resize-none__e5b55",
|
|
6
|
+
"resize-vertical": "cfxui__StyledTextarea__resize-vertical__717ec",
|
|
7
|
+
"resize-horizontal": "cfxui__StyledTextarea__resize-horizontal__4f44b",
|
|
8
|
+
"resize-both": "cfxui__StyledTextarea__resize-both__c451f"
|
|
9
|
+
};
|
|
10
|
+
function n(r) {
|
|
11
|
+
const {
|
|
12
|
+
className: t,
|
|
13
|
+
resize: _ = "none",
|
|
14
|
+
ref: o,
|
|
15
|
+
...a
|
|
16
|
+
} = r;
|
|
17
|
+
return /* @__PURE__ */ s(
|
|
18
|
+
"textarea",
|
|
19
|
+
{
|
|
20
|
+
className: i(
|
|
21
|
+
e.root,
|
|
22
|
+
t,
|
|
23
|
+
e[`resize-${_}`]
|
|
24
|
+
),
|
|
25
|
+
ref: o,
|
|
26
|
+
...a
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
n as default
|
|
32
|
+
};
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as P, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
3
|
import M from "react";
|
|
4
|
-
import { u as
|
|
4
|
+
import { u as x, d as H, c as j, P as y, e as A, f as q } from "../../index-DCuJlMqr.js";
|
|
5
5
|
import { u as z } from "../../index-BZPx6jYI.js";
|
|
6
|
-
import { clsx as
|
|
7
|
-
var
|
|
6
|
+
import { clsx as k } from "../../utils/clsx.js";
|
|
7
|
+
var w = "Switch", [L, et] = j(w), [O, $] = L(w), T = r.forwardRef(
|
|
8
8
|
(e, s) => {
|
|
9
9
|
const {
|
|
10
10
|
__scopeSwitch: t,
|
|
11
11
|
name: o,
|
|
12
12
|
checked: c,
|
|
13
|
-
defaultChecked:
|
|
14
|
-
required:
|
|
15
|
-
disabled:
|
|
16
|
-
value:
|
|
13
|
+
defaultChecked: u,
|
|
14
|
+
required: h,
|
|
15
|
+
disabled: n,
|
|
16
|
+
value: d = "on",
|
|
17
17
|
onCheckedChange: _,
|
|
18
|
-
form:
|
|
18
|
+
form: a,
|
|
19
19
|
...S
|
|
20
|
-
} = e, [
|
|
20
|
+
} = e, [p, l] = r.useState(null), b = x(s, (m) => l(m)), v = r.useRef(!1), R = p ? a || !!p.closest("form") : !0, [f, U] = H({
|
|
21
21
|
prop: c,
|
|
22
|
-
defaultProp:
|
|
22
|
+
defaultProp: u ?? !1,
|
|
23
23
|
onChange: _,
|
|
24
|
-
caller:
|
|
24
|
+
caller: w
|
|
25
25
|
});
|
|
26
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ P(O, { scope: t, checked: f, disabled: n, children: [
|
|
27
27
|
/* @__PURE__ */ i(
|
|
28
|
-
|
|
28
|
+
y.button,
|
|
29
29
|
{
|
|
30
30
|
type: "button",
|
|
31
31
|
role: "switch",
|
|
32
|
-
"aria-checked":
|
|
33
|
-
"aria-required":
|
|
34
|
-
"data-state":
|
|
35
|
-
"data-disabled":
|
|
36
|
-
disabled:
|
|
37
|
-
value:
|
|
32
|
+
"aria-checked": f,
|
|
33
|
+
"aria-required": h,
|
|
34
|
+
"data-state": B(f),
|
|
35
|
+
"data-disabled": n ? "" : void 0,
|
|
36
|
+
disabled: n,
|
|
37
|
+
value: d,
|
|
38
38
|
...S,
|
|
39
39
|
ref: b,
|
|
40
|
-
onClick: A(e.onClick, (
|
|
41
|
-
|
|
40
|
+
onClick: A(e.onClick, (m) => {
|
|
41
|
+
U((I) => !I), R && (v.current = m.isPropagationStopped(), v.current || m.stopPropagation());
|
|
42
42
|
})
|
|
43
43
|
}
|
|
44
44
|
),
|
|
45
45
|
R && /* @__PURE__ */ i(
|
|
46
|
-
|
|
46
|
+
g,
|
|
47
47
|
{
|
|
48
|
-
control:
|
|
48
|
+
control: p,
|
|
49
49
|
bubbles: !v.current,
|
|
50
50
|
name: o,
|
|
51
|
-
value:
|
|
52
|
-
checked:
|
|
53
|
-
required:
|
|
54
|
-
disabled:
|
|
55
|
-
form:
|
|
51
|
+
value: d,
|
|
52
|
+
checked: f,
|
|
53
|
+
required: h,
|
|
54
|
+
disabled: n,
|
|
55
|
+
form: a,
|
|
56
56
|
style: { transform: "translateX(-100%)" }
|
|
57
57
|
}
|
|
58
58
|
)
|
|
59
59
|
] });
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
|
-
|
|
63
|
-
var
|
|
62
|
+
T.displayName = w;
|
|
63
|
+
var N = "SwitchThumb", E = r.forwardRef(
|
|
64
64
|
(e, s) => {
|
|
65
|
-
const { __scopeSwitch: t, ...o } = e, c = $(
|
|
65
|
+
const { __scopeSwitch: t, ...o } = e, c = $(N, t);
|
|
66
66
|
return /* @__PURE__ */ i(
|
|
67
|
-
|
|
67
|
+
y.span,
|
|
68
68
|
{
|
|
69
|
-
"data-state":
|
|
69
|
+
"data-state": B(c.checked),
|
|
70
70
|
"data-disabled": c.disabled ? "" : void 0,
|
|
71
71
|
...o,
|
|
72
72
|
ref: s
|
|
@@ -74,28 +74,28 @@ var T = "SwitchThumb", N = r.forwardRef(
|
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
|
|
78
|
-
var D = "SwitchBubbleInput",
|
|
77
|
+
E.displayName = N;
|
|
78
|
+
var D = "SwitchBubbleInput", g = r.forwardRef(
|
|
79
79
|
({
|
|
80
80
|
__scopeSwitch: e,
|
|
81
81
|
control: s,
|
|
82
82
|
checked: t,
|
|
83
83
|
bubbles: o = !0,
|
|
84
84
|
...c
|
|
85
|
-
},
|
|
86
|
-
const
|
|
85
|
+
}, u) => {
|
|
86
|
+
const h = r.useRef(null), n = x(h, u), d = z(t), _ = q(s);
|
|
87
87
|
return r.useEffect(() => {
|
|
88
|
-
const
|
|
89
|
-
if (!
|
|
88
|
+
const a = h.current;
|
|
89
|
+
if (!a) return;
|
|
90
90
|
const S = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(
|
|
91
91
|
S,
|
|
92
92
|
"checked"
|
|
93
93
|
).set;
|
|
94
|
-
if (
|
|
94
|
+
if (d !== t && l) {
|
|
95
95
|
const b = new Event("click", { bubbles: o });
|
|
96
|
-
l.call(
|
|
96
|
+
l.call(a, t), a.dispatchEvent(b);
|
|
97
97
|
}
|
|
98
|
-
}, [
|
|
98
|
+
}, [d, t, o]), /* @__PURE__ */ i(
|
|
99
99
|
"input",
|
|
100
100
|
{
|
|
101
101
|
type: "checkbox",
|
|
@@ -103,7 +103,7 @@ var D = "SwitchBubbleInput", E = r.forwardRef(
|
|
|
103
103
|
defaultChecked: t,
|
|
104
104
|
...c,
|
|
105
105
|
tabIndex: -1,
|
|
106
|
-
ref:
|
|
106
|
+
ref: n,
|
|
107
107
|
style: {
|
|
108
108
|
...c.style,
|
|
109
109
|
..._,
|
|
@@ -116,11 +116,11 @@ var D = "SwitchBubbleInput", E = r.forwardRef(
|
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
118
|
);
|
|
119
|
-
|
|
120
|
-
function
|
|
119
|
+
g.displayName = D;
|
|
120
|
+
function B(e) {
|
|
121
121
|
return e ? "checked" : "unchecked";
|
|
122
122
|
}
|
|
123
|
-
var F =
|
|
123
|
+
var F = T, W = E;
|
|
124
124
|
const X = "cfxui__Switch__switchUnset__c8b03", G = "cfxui__Switch__switchRoot__f2911", J = "cfxui__Switch__switchThumb__9cbf5", C = {
|
|
125
125
|
switchUnset: X,
|
|
126
126
|
switchRoot: G,
|
|
@@ -130,9 +130,21 @@ function K(e) {
|
|
|
130
130
|
const {
|
|
131
131
|
classNameRoot: s,
|
|
132
132
|
classNameThumb: t,
|
|
133
|
-
|
|
133
|
+
name: o,
|
|
134
|
+
checked: c,
|
|
135
|
+
...u
|
|
134
136
|
} = e;
|
|
135
|
-
return /* @__PURE__ */
|
|
137
|
+
return /* @__PURE__ */ P(F, { ...u, className: k(C.switchRoot, C.switchUnset, s), children: [
|
|
138
|
+
o && /* @__PURE__ */ i(
|
|
139
|
+
"input",
|
|
140
|
+
{
|
|
141
|
+
type: "hidden",
|
|
142
|
+
name: o,
|
|
143
|
+
value: c ? "on" : ""
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
/* @__PURE__ */ i(W, { className: k(C.switchThumb, t) })
|
|
147
|
+
] });
|
|
136
148
|
}
|
|
137
149
|
const ot = M.memo(K);
|
|
138
150
|
export {
|
|
@@ -32,9 +32,21 @@ export declare namespace Tabular {
|
|
|
32
32
|
export interface TabularRootProps extends React.PropsWithChildren, Pick<TabularProps, 'className' | 'ariaLabel' | 'tabIndex' | 'theme' | 'role' | 'size'> {
|
|
33
33
|
style?: React.CSSProperties;
|
|
34
34
|
}
|
|
35
|
+
export interface TabularItemComponentProps {
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
type: HTMLButtonElement['type'];
|
|
38
|
+
role: HTMLButtonElement['role'];
|
|
39
|
+
className?: string;
|
|
40
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
41
|
+
'aria-label'?: string;
|
|
42
|
+
'aria-controls'?: string;
|
|
43
|
+
'data-text'?: React.ReactNode;
|
|
44
|
+
'aria-selected'?: boolean;
|
|
45
|
+
}
|
|
35
46
|
export interface TabularItemProps extends TabularItem {
|
|
36
47
|
active: boolean;
|
|
37
48
|
onClick: (id: string) => void;
|
|
38
49
|
className?: string;
|
|
39
50
|
size?: ResponsiveValueType<TabularSize>;
|
|
51
|
+
Component?: React.ElementType<TabularItemComponentProps>;
|
|
40
52
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
2
|
-
import d, { createElement as
|
|
3
|
-
import { Dot as
|
|
1
|
+
import { jsx as m, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import d, { createElement as p } from "react";
|
|
3
|
+
import { Dot as C } from "../Dot/Dot.js";
|
|
4
4
|
import { clsx as n } from "../../utils/clsx.js";
|
|
5
|
-
import { ui as
|
|
6
|
-
const
|
|
7
|
-
reset:
|
|
5
|
+
import { ui as v } from "../../utils/ui/ui.js";
|
|
6
|
+
const k = "cfxui__Tabular__reset__b1dbc", R = "cfxui__Tabular__item__98cc3", I = "cfxui__Tabular__root__0ff05", y = "cfxui__Tabular__active__1ae95", j = "cfxui__Tabular__hasNotification__c372f", A = "cfxui__Tabular__content__3a95a", e = {
|
|
7
|
+
reset: k,
|
|
8
8
|
"tabular-size-initial-large": "cfxui__Tabular__tabular-size-initial-large__9451f",
|
|
9
|
-
item:
|
|
9
|
+
item: R,
|
|
10
10
|
"tabular-size-initial-small": "cfxui__Tabular__tabular-size-initial-small__4dad8",
|
|
11
11
|
"tabular-size-small-large": "cfxui__Tabular__tabular-size-small-large__1390c",
|
|
12
12
|
"tabular-size-small-small": "cfxui__Tabular__tabular-size-small-small__cc6e3",
|
|
@@ -23,25 +23,25 @@ const v = "cfxui__Tabular__reset__b1dbc", k = "cfxui__Tabular__item__98cc3", I =
|
|
|
23
23
|
root: I,
|
|
24
24
|
"theme-dark": "cfxui__Tabular__theme-dark__80b8c",
|
|
25
25
|
"theme-light": "cfxui__Tabular__theme-light__c05b9",
|
|
26
|
-
active:
|
|
27
|
-
hasNotification:
|
|
28
|
-
content:
|
|
26
|
+
active: y,
|
|
27
|
+
hasNotification: j,
|
|
28
|
+
content: A
|
|
29
29
|
};
|
|
30
30
|
function o(b) {
|
|
31
31
|
const {
|
|
32
32
|
items: s,
|
|
33
33
|
activeItem: t,
|
|
34
|
-
onActivate:
|
|
34
|
+
onActivate: l,
|
|
35
35
|
itemClassName: i,
|
|
36
36
|
size: u = "medium",
|
|
37
37
|
..._
|
|
38
38
|
} = b, c = d.useCallback((a) => {
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
|
|
39
|
+
l && l(a);
|
|
40
|
+
}, [l]), r = n(
|
|
41
|
+
e.root,
|
|
42
42
|
_.className
|
|
43
43
|
);
|
|
44
|
-
return /* @__PURE__ */ m(o.Root, { ..._, className: r, children: s.map((a) => /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ m(o.Root, { ..._, className: r, children: s.map((a) => /* @__PURE__ */ p(
|
|
45
45
|
o.Item,
|
|
46
46
|
{
|
|
47
47
|
...a,
|
|
@@ -56,13 +56,13 @@ function o(b) {
|
|
|
56
56
|
o.Root = function(s) {
|
|
57
57
|
const {
|
|
58
58
|
children: t,
|
|
59
|
-
className:
|
|
59
|
+
className: l,
|
|
60
60
|
ariaLabel: i,
|
|
61
61
|
tabIndex: u,
|
|
62
62
|
theme: _ = "dark",
|
|
63
63
|
role: c = "tablist",
|
|
64
64
|
style: r
|
|
65
|
-
} = s, a = n(
|
|
65
|
+
} = s, a = n(e.root, e[`theme-${_}`], l);
|
|
66
66
|
return /* @__PURE__ */ m(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
@@ -78,7 +78,7 @@ o.Root = function(s) {
|
|
|
78
78
|
o.Item = function(s) {
|
|
79
79
|
const {
|
|
80
80
|
id: t,
|
|
81
|
-
label:
|
|
81
|
+
label: l,
|
|
82
82
|
onClick: i,
|
|
83
83
|
ariaLabel: u,
|
|
84
84
|
ariaControls: _,
|
|
@@ -86,34 +86,35 @@ o.Item = function(s) {
|
|
|
86
86
|
active: r = !1,
|
|
87
87
|
disabled: a = !1,
|
|
88
88
|
hasNotification: f = !1,
|
|
89
|
-
size: x
|
|
90
|
-
|
|
89
|
+
size: x,
|
|
90
|
+
Component: z
|
|
91
|
+
} = s, g = d.useCallback(() => {
|
|
91
92
|
a || i(t);
|
|
92
|
-
}, [a, i, t]),
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
}, [a, i, t]), T = n(
|
|
94
|
+
e.reset,
|
|
95
|
+
e.item,
|
|
95
96
|
c,
|
|
96
|
-
|
|
97
|
+
v.getResponsiveFlatClassnames("tabular-size", x).map((h) => e[h]),
|
|
97
98
|
{
|
|
98
|
-
[
|
|
99
|
-
[
|
|
99
|
+
[e.active]: r,
|
|
100
|
+
[e.hasNotification]: f
|
|
100
101
|
}
|
|
101
102
|
);
|
|
102
103
|
return /* @__PURE__ */ m(
|
|
103
|
-
"button",
|
|
104
|
+
z || "button",
|
|
104
105
|
{
|
|
105
106
|
disabled: a,
|
|
106
107
|
type: "button",
|
|
107
108
|
role: "tab",
|
|
108
|
-
className:
|
|
109
|
-
onClick:
|
|
109
|
+
className: T,
|
|
110
|
+
onClick: g,
|
|
110
111
|
"aria-label": u,
|
|
111
112
|
"aria-controls": _,
|
|
112
|
-
"data-text":
|
|
113
|
+
"data-text": l,
|
|
113
114
|
"aria-selected": r,
|
|
114
|
-
children: /* @__PURE__ */
|
|
115
|
-
|
|
116
|
-
f && /* @__PURE__ */ m(
|
|
115
|
+
children: /* @__PURE__ */ N("span", { className: e.content, children: [
|
|
116
|
+
l,
|
|
117
|
+
f && /* @__PURE__ */ m(C, { color: "green", className: e.notification })
|
|
117
118
|
] })
|
|
118
119
|
}
|
|
119
120
|
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Tabular } from './Tabular';
|
|
2
|
-
export type { TabularProps, TabularItem, TabularRootProps, } from './Tabular';
|
|
2
|
+
export type { TabularProps, TabularItem, TabularRootProps, TabularItemComponentProps, } from './Tabular';
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { TextareaResizeType } from '../StyledTextarea';
|
|
2
3
|
|
|
3
4
|
export interface TextareaProps {
|
|
4
|
-
value
|
|
5
|
-
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onChange?: (value: string) => void;
|
|
6
8
|
label?: React.ReactNode;
|
|
7
9
|
placeholder?: string;
|
|
8
10
|
rows?: number;
|
|
9
11
|
disabled?: boolean;
|
|
10
|
-
resize?:
|
|
12
|
+
resize?: TextareaResizeType;
|
|
11
13
|
autofocus?: boolean;
|
|
12
14
|
className?: string;
|
|
13
15
|
backdropBlur?: boolean;
|
|
16
|
+
name?: string;
|
|
17
|
+
ref?: React.Ref<HTMLTextAreaElement>;
|
|
14
18
|
}
|
|
15
19
|
export declare function Textarea(props: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,55 +1,58 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"resize-both": "cfxui__Textarea__resize-both__004b8",
|
|
11
|
-
disabled: B,
|
|
12
|
-
error: C,
|
|
13
|
-
backdropBlur: N
|
|
1
|
+
import { jsx as s, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import c from "react";
|
|
3
|
+
import N from "../StyledTextarea/StyledTextarea.js";
|
|
4
|
+
import { clsx as g } from "../../utils/clsx.js";
|
|
5
|
+
const v = "cfxui__Textarea__root__688b1", j = "cfxui__Textarea__textarea__8ab29", F = "cfxui__Textarea__disabled__5d783", I = "cfxui__Textarea__backdropBlur__15cb2", a = {
|
|
6
|
+
root: v,
|
|
7
|
+
textarea: j,
|
|
8
|
+
disabled: F,
|
|
9
|
+
backdropBlur: I
|
|
14
10
|
};
|
|
15
|
-
function
|
|
11
|
+
function S(d) {
|
|
16
12
|
const {
|
|
17
|
-
value:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
value: n,
|
|
14
|
+
defaultValue: _,
|
|
15
|
+
onChange: e,
|
|
16
|
+
label: t,
|
|
17
|
+
placeholder: u,
|
|
18
|
+
rows: i,
|
|
19
|
+
resize: x = "none",
|
|
23
20
|
disabled: o = !1,
|
|
24
|
-
autofocus:
|
|
21
|
+
autofocus: b,
|
|
25
22
|
className: f,
|
|
26
|
-
backdropBlur:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
backdropBlur: m = !1,
|
|
24
|
+
name: p,
|
|
25
|
+
ref: h
|
|
26
|
+
} = d, k = c.useCallback(
|
|
27
|
+
(B) => {
|
|
28
|
+
e && e(B.target.value);
|
|
30
29
|
},
|
|
31
|
-
[
|
|
32
|
-
),
|
|
33
|
-
|
|
30
|
+
[e]
|
|
31
|
+
), r = c.useId(), l = /* @__PURE__ */ s(
|
|
32
|
+
N,
|
|
34
33
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
id: r,
|
|
35
|
+
className: a.textarea,
|
|
36
|
+
rows: i,
|
|
37
|
+
value: n,
|
|
38
|
+
defaultValue: _,
|
|
40
39
|
disabled: o,
|
|
41
|
-
onChange:
|
|
42
|
-
placeholder:
|
|
40
|
+
onChange: k,
|
|
41
|
+
placeholder: u,
|
|
42
|
+
name: p,
|
|
43
|
+
ref: h,
|
|
44
|
+
resize: x,
|
|
45
|
+
autoFocus: b
|
|
43
46
|
}
|
|
44
|
-
),
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
+
), T = g(a.root, f, {
|
|
48
|
+
[a.disabled]: o,
|
|
49
|
+
[a.backdropBlur]: m
|
|
47
50
|
});
|
|
48
|
-
return /* @__PURE__ */ s("div", { className:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
] }) :
|
|
51
|
+
return /* @__PURE__ */ s("div", { className: T, children: t ? /* @__PURE__ */ C("label", { htmlFor: r, children: [
|
|
52
|
+
t,
|
|
53
|
+
l
|
|
54
|
+
] }) : l });
|
|
52
55
|
}
|
|
53
56
|
export {
|
|
54
|
-
|
|
57
|
+
S as Textarea
|
|
55
58
|
};
|