shared-design-system 1.19.0 → 1.23.0
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/src/components/Alert.d.ts +1 -1
- package/dist/src/components/Alert.js +34 -20
- package/dist/src/components/Alert.js.map +1 -1
- package/dist/src/components/Avatar.d.ts +7 -2
- package/dist/src/components/Avatar.js +15 -12
- package/dist/src/components/Avatar.js.map +1 -1
- package/dist/src/components/Badge.d.ts +1 -1
- package/dist/src/components/Badge.js +113 -89
- package/dist/src/components/Badge.js.map +1 -1
- package/dist/src/components/Breadcrumbs.d.ts +1 -1
- package/dist/src/components/Breadcrumbs.js +7 -9
- package/dist/src/components/Breadcrumbs.js.map +1 -1
- package/dist/src/components/Button.d.ts +1 -1
- package/dist/src/components/Button.js +6 -4
- package/dist/src/components/Button.js.map +1 -1
- package/dist/src/components/ConfigProvider.d.ts +17 -0
- package/dist/src/components/ConfigProvider.js +54 -0
- package/dist/src/components/ConfigProvider.js.map +1 -0
- package/dist/src/components/ConfirmModal.d.ts +1 -1
- package/dist/src/components/ConfirmModal.js +82 -72
- package/dist/src/components/ConfirmModal.js.map +1 -1
- package/dist/src/components/DatePicker.d.ts +1 -1
- package/dist/src/components/DatePicker.js +33 -10
- package/dist/src/components/DatePicker.js.map +1 -1
- package/dist/src/components/Descriptions.d.ts +15 -0
- package/dist/src/components/Descriptions.js +44 -0
- package/dist/src/components/Descriptions.js.map +1 -0
- package/dist/src/components/Divider.d.ts +1 -1
- package/dist/src/components/Divider.js +21 -16
- package/dist/src/components/Divider.js.map +1 -1
- package/dist/src/components/Drawer.d.ts +1 -1
- package/dist/src/components/Drawer.js +81 -68
- package/dist/src/components/Drawer.js.map +1 -1
- package/dist/src/components/Dropdown.d.ts +17 -0
- package/dist/src/components/Dropdown.js +129 -0
- package/dist/src/components/Dropdown.js.map +1 -0
- package/dist/src/components/Empty.d.ts +9 -0
- package/dist/src/components/Empty.js +15 -0
- package/dist/src/components/Empty.js.map +1 -0
- package/dist/src/components/Form.d.ts +35 -0
- package/dist/src/components/Form.js +54 -0
- package/dist/src/components/Form.js.map +1 -0
- package/dist/src/components/InputComponents.d.ts +4 -4
- package/dist/src/components/InputComponents.js +57 -26
- package/dist/src/components/InputComponents.js.map +1 -1
- package/dist/src/components/ListComponents.d.ts +4 -2
- package/dist/src/components/ListComponents.js +36 -15
- package/dist/src/components/ListComponents.js.map +1 -1
- package/dist/src/components/Message.d.ts +20 -0
- package/dist/src/components/Message.js +69 -0
- package/dist/src/components/Message.js.map +1 -0
- package/dist/src/components/Modal.d.ts +1 -1
- package/dist/src/components/Modal.js +90 -77
- package/dist/src/components/Modal.js.map +1 -1
- package/dist/src/components/MultiSelect.d.ts +1 -1
- package/dist/src/components/MultiSelect.js +65 -20
- package/dist/src/components/MultiSelect.js.map +1 -1
- package/dist/src/components/Popconfirm.d.ts +12 -0
- package/dist/src/components/Popconfirm.js +24 -0
- package/dist/src/components/Popconfirm.js.map +1 -0
- package/dist/src/components/Popover.d.ts +10 -0
- package/dist/src/components/Popover.js +108 -0
- package/dist/src/components/Popover.js.map +1 -0
- package/dist/src/components/Portal.d.ts +11 -0
- package/dist/src/components/Portal.js +30 -0
- package/dist/src/components/Portal.js.map +1 -0
- package/dist/src/components/Radio.d.ts +5 -2
- package/dist/src/components/Radio.js +10 -6
- package/dist/src/components/Radio.js.map +1 -1
- package/dist/src/components/Result.d.ts +9 -0
- package/dist/src/components/Result.js +52 -0
- package/dist/src/components/Result.js.map +1 -0
- package/dist/src/components/Select.d.ts +1 -1
- package/dist/src/components/Select.js +70 -19
- package/dist/src/components/Select.js.map +1 -1
- package/dist/src/components/Skeleton.d.ts +1 -1
- package/dist/src/components/Skeleton.js +10 -7
- package/dist/src/components/Skeleton.js.map +1 -1
- package/dist/src/components/Steps.d.ts +1 -1
- package/dist/src/components/Steps.js +17 -14
- package/dist/src/components/Steps.js.map +1 -1
- package/dist/src/components/Switch.d.ts +1 -1
- package/dist/src/components/Switch.js +6 -6
- package/dist/src/components/Switch.js.map +1 -1
- package/dist/src/components/Table.d.ts +20 -7
- package/dist/src/components/Table.js +140 -113
- package/dist/src/components/Table.js.map +1 -1
- package/dist/src/components/Tabs.d.ts +4 -2
- package/dist/src/components/Tabs.js +15 -10
- package/dist/src/components/Tabs.js.map +1 -1
- package/dist/src/components/Tag.d.ts +1 -1
- package/dist/src/components/Tag.js +17 -8
- package/dist/src/components/Tag.js.map +1 -1
- package/dist/src/components/Timeline.d.ts +13 -0
- package/dist/src/components/Timeline.js +35 -0
- package/dist/src/components/Timeline.js.map +1 -0
- package/dist/src/components/Tooltip.d.ts +1 -1
- package/dist/src/components/Tooltip.js +17 -10
- package/dist/src/components/Tooltip.js.map +1 -1
- package/dist/src/components/Typography.d.ts +5 -5
- package/dist/src/components/Typography.js +38 -23
- package/dist/src/components/Typography.js.map +1 -1
- package/dist/src/index.d.ts +25 -4
- package/dist/src/index.js +15 -5
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { tokens } from '../tokens';
|
|
3
|
-
export const Divider = ({ orientation = 'horizontal', type = 'solid', label, margin = 'md', color, thickness = 1, className = '', style = {}, }) => {
|
|
4
|
+
export const Divider = React.forwardRef(({ orientation = 'horizontal', type = 'solid', label, margin = 'md', color, thickness = 1, className = '', style = {}, ...props }, ref) => {
|
|
4
5
|
const getMargin = () => {
|
|
5
6
|
switch (margin) {
|
|
6
|
-
case 'none':
|
|
7
|
-
|
|
8
|
-
case '
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
case 'none':
|
|
8
|
+
return '0';
|
|
9
|
+
case 'xs':
|
|
10
|
+
return tokens.spacing[1];
|
|
11
|
+
case 'sm':
|
|
12
|
+
return tokens.spacing[2];
|
|
13
|
+
case 'lg':
|
|
14
|
+
return tokens.spacing[8];
|
|
15
|
+
default:
|
|
16
|
+
return tokens.spacing[4];
|
|
11
17
|
}
|
|
12
18
|
};
|
|
13
19
|
const isVertical = orientation === 'vertical';
|
|
@@ -23,9 +29,7 @@ export const Divider = ({ orientation = 'horizontal', type = 'solid', label, mar
|
|
|
23
29
|
}
|
|
24
30
|
: {
|
|
25
31
|
backgroundColor: isDashed ? 'transparent' : defaultColor,
|
|
26
|
-
border: isDashed
|
|
27
|
-
? `${thickness}px dashed ${defaultColor}`
|
|
28
|
-
: 'none',
|
|
32
|
+
border: isDashed ? `${thickness}px dashed ${defaultColor}` : 'none',
|
|
29
33
|
};
|
|
30
34
|
const baseLineStyle = {
|
|
31
35
|
...lineStyle,
|
|
@@ -35,23 +39,23 @@ export const Divider = ({ orientation = 'horizontal', type = 'solid', label, mar
|
|
|
35
39
|
...(!isDashed && !isGradient ? { backgroundColor: defaultColor } : {}),
|
|
36
40
|
};
|
|
37
41
|
if (isVertical) {
|
|
38
|
-
return (_jsx("div", { style: {
|
|
42
|
+
return (_jsx("div", { ref: ref, role: "separator", "aria-orientation": "vertical", style: {
|
|
39
43
|
...baseLineStyle,
|
|
40
44
|
margin: `0 ${getMargin()}`,
|
|
41
45
|
display: 'inline-block',
|
|
42
46
|
alignSelf: 'stretch',
|
|
43
47
|
...style,
|
|
44
|
-
}, className: `ds-divider ds-divider--vertical ${className}
|
|
48
|
+
}, className: `ds-divider ds-divider--vertical ${className}`, ...props }));
|
|
45
49
|
}
|
|
46
50
|
if (label) {
|
|
47
|
-
return (_jsxs("div", { style: {
|
|
51
|
+
return (_jsxs("div", { ref: ref, role: "separator", "aria-orientation": "horizontal", style: {
|
|
48
52
|
display: 'flex',
|
|
49
53
|
alignItems: 'center',
|
|
50
54
|
width: '100%',
|
|
51
55
|
margin: `${getMargin()} 0`,
|
|
52
56
|
gap: tokens.spacing[3],
|
|
53
57
|
...style,
|
|
54
|
-
}, className: `ds-divider ds-divider--labeled ${className}`, children: [_jsx("div", { style: { ...baseLineStyle, flex: 1 } }), _jsx("span", { style: {
|
|
58
|
+
}, className: `ds-divider ds-divider--labeled ${className}`, ...props, children: [_jsx("div", { style: { ...baseLineStyle, flex: 1 } }), _jsx("span", { style: {
|
|
55
59
|
fontSize: '11px',
|
|
56
60
|
fontWeight: tokens.font.weightSemibold,
|
|
57
61
|
color: tokens.color.slate400,
|
|
@@ -61,10 +65,11 @@ export const Divider = ({ orientation = 'horizontal', type = 'solid', label, mar
|
|
|
61
65
|
padding: `0 ${tokens.spacing[1]}`,
|
|
62
66
|
}, children: label }), _jsx("div", { style: { ...baseLineStyle, flex: 1 } })] }));
|
|
63
67
|
}
|
|
64
|
-
return (_jsx("hr", { style: {
|
|
68
|
+
return (_jsx("hr", { ref: ref, style: {
|
|
65
69
|
...baseLineStyle,
|
|
66
70
|
margin: `${getMargin()} 0`,
|
|
67
71
|
...style,
|
|
68
|
-
}, className: `ds-divider ${className}
|
|
69
|
-
};
|
|
72
|
+
}, className: `ds-divider ${className}`, ...props }));
|
|
73
|
+
});
|
|
74
|
+
Divider.displayName = 'Divider';
|
|
70
75
|
//# sourceMappingURL=Divider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../../src/components/Divider.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../../src/components/Divider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAWnC,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CACrC,CACE,EACE,WAAW,GAAG,YAAY,EAC1B,IAAI,GAAG,OAAO,EACd,KAAK,EACL,MAAM,GAAG,IAAI,EACb,KAAK,EACL,SAAS,GAAG,CAAC,EACb,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,EAAE,EACV,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAA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CAAC,CAAC,EAAE;qBAClC,YAEA,KAAK,GACD,EACP,cAAK,KAAK,EAAE,EAAE,GAAG,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,GAAI,IACzC,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,aACE,GAAG,EAAE,GAA+B,EACpC,KAAK,EAAE;YACL,GAAG,aAAa;YAChB,MAAM,EAAE,GAAG,SAAS,EAAE,IAAI;YAC1B,GAAG,KAAK;SACT,EACD,SAAS,EAAE,cAAc,SAAS,EAAE,KAC/B,KAAa,GAClB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AACF,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from 'react';
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
3
|
import { tokens } from '../tokens';
|
|
4
4
|
import { Heading } from './Typography';
|
|
5
|
-
|
|
5
|
+
import { Portal } from './Portal';
|
|
6
|
+
export const Drawer = React.forwardRef(({ isOpen, onClose, title, children, footer, width = 400, placement = 'right' }, ref) => {
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
if (isOpen) {
|
|
8
9
|
document.body.style.overflow = 'hidden';
|
|
@@ -14,73 +15,85 @@ export const Drawer = ({ isOpen, onClose, title, children, footer, width = 400,
|
|
|
14
15
|
document.body.style.overflow = 'unset';
|
|
15
16
|
};
|
|
16
17
|
}, [isOpen]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const handleEscape = (e) => {
|
|
20
|
+
if (e.key === 'Escape' && isOpen) {
|
|
21
|
+
onClose();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
if (isOpen) {
|
|
25
|
+
document.addEventListener('keydown', handleEscape);
|
|
26
|
+
}
|
|
27
|
+
return () => document.removeEventListener('keydown', handleEscape);
|
|
28
|
+
}, [isOpen, onClose]);
|
|
17
29
|
if (!isOpen)
|
|
18
30
|
return null;
|
|
19
31
|
const isRight = placement === 'right';
|
|
20
|
-
return (_jsxs("div", { style: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
};
|
|
32
|
+
return (_jsx(Portal, { children: _jsxs("div", { ref: ref, role: "dialog", "aria-modal": "true", "aria-labelledby": title ? 'ds-drawer-title' : undefined, style: {
|
|
33
|
+
position: 'fixed',
|
|
34
|
+
inset: 0,
|
|
35
|
+
zIndex: 1000,
|
|
36
|
+
display: 'flex',
|
|
37
|
+
justifyContent: isRight ? 'flex-end' : 'flex-start',
|
|
38
|
+
}, children: [_jsx("div", { onClick: onClose, style: {
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
inset: 0,
|
|
41
|
+
backgroundColor: 'rgba(15, 23, 42, 0.4)',
|
|
42
|
+
backdropFilter: 'blur(2px)',
|
|
43
|
+
animation: 'ds-fade-in 0.3s ease-out',
|
|
44
|
+
} }), _jsxs("div", { style: {
|
|
45
|
+
position: 'relative',
|
|
46
|
+
backgroundColor: tokens.color.white,
|
|
47
|
+
width: '100%',
|
|
48
|
+
maxWidth: typeof width === 'number' ? `${width}px` : width,
|
|
49
|
+
height: '100%',
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexDirection: 'column',
|
|
52
|
+
boxShadow: tokens.shadow.xl,
|
|
53
|
+
animation: `ds-drawer-slide-${placement} 0.3s cubic-bezier(0.2, 0.8, 0.2, 1)`,
|
|
54
|
+
zIndex: 1,
|
|
55
|
+
}, children: [_jsxs("div", { style: {
|
|
56
|
+
padding: `${tokens.spacing[6]} ${tokens.spacing[6]}`,
|
|
57
|
+
borderBottom: `1px solid ${tokens.color.slate100}`,
|
|
58
|
+
display: 'flex',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
justifyContent: 'space-between',
|
|
61
|
+
}, children: [title ? (_jsx(Heading, { id: "ds-drawer-title", level: 4, style: { margin: 0 }, children: title })) : (_jsx("div", {})), _jsx("button", { onClick: onClose, "aria-label": "Close drawer", style: {
|
|
62
|
+
padding: '8px',
|
|
63
|
+
borderRadius: '50%',
|
|
64
|
+
border: 'none',
|
|
65
|
+
backgroundColor: 'transparent',
|
|
66
|
+
color: tokens.color.slate400,
|
|
67
|
+
cursor: 'pointer',
|
|
68
|
+
display: 'flex',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
justifyContent: 'center',
|
|
71
|
+
transition: tokens.transition.fast,
|
|
72
|
+
}, children: _jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), _jsx("div", { style: {
|
|
73
|
+
padding: tokens.spacing[6],
|
|
74
|
+
overflowY: 'auto',
|
|
75
|
+
flex: 1,
|
|
76
|
+
}, children: children }), footer && (_jsx("div", { style: {
|
|
77
|
+
padding: `${tokens.spacing[4]} ${tokens.spacing[6]}`,
|
|
78
|
+
borderTop: `1px solid ${tokens.color.slate100}`,
|
|
79
|
+
backgroundColor: tokens.color.white,
|
|
80
|
+
display: 'flex',
|
|
81
|
+
justifyContent: 'flex-end',
|
|
82
|
+
gap: tokens.spacing[3],
|
|
83
|
+
}, children: footer }))] }), _jsx("style", { children: `
|
|
84
|
+
@keyframes ds-fade-in {
|
|
85
|
+
from { opacity: 0; }
|
|
86
|
+
to { opacity: 1; }
|
|
87
|
+
}
|
|
88
|
+
@keyframes ds-drawer-slide-right {
|
|
89
|
+
from { transform: translateX(100%); }
|
|
90
|
+
to { transform: translateX(0); }
|
|
91
|
+
}
|
|
92
|
+
@keyframes ds-drawer-slide-left {
|
|
93
|
+
from { transform: translateX(-100%); }
|
|
94
|
+
to { transform: translateX(0); }
|
|
95
|
+
}
|
|
96
|
+
` })] }) }));
|
|
97
|
+
});
|
|
98
|
+
Drawer.displayName = 'Drawer';
|
|
86
99
|
//# sourceMappingURL=Drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/Drawer.tsx"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/Drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAYlC,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CACpC,CAAC,EAA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AE,MAAM,CAAC,KAAK,CAAC,KAAK;gCACnC,OAAO,EAAE,MAAM;gCACf,cAAc,EAAE,UAAU;gCAC1B,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;6BACvB,YAEA,MAAM,GACH,CACP,IACG,EAEN,0BAAQ;;;;;;;;;;;;;SAaT,GAAS,IACJ,GACC,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AACF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DropdownProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
menu: React.ReactNode;
|
|
5
|
+
trigger?: 'click' | 'hover';
|
|
6
|
+
placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const Dropdown: any;
|
|
10
|
+
export interface MenuItemProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
danger?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
active?: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
3
|
+
import { tokens } from '../tokens';
|
|
4
|
+
import { Portal } from './Portal';
|
|
5
|
+
export const Dropdown = React.forwardRef(({ children, menu, trigger = 'click', placement = 'bottomLeft', disabled = false }, ref) => {
|
|
6
|
+
const [visible, setVisible] = useState(false);
|
|
7
|
+
const [coords, setCoords] = useState({ top: 0, left: 0, width: 0 });
|
|
8
|
+
const triggerRef = useRef(null);
|
|
9
|
+
const menuRef = useRef(null);
|
|
10
|
+
const updateCoords = useCallback(() => {
|
|
11
|
+
if (triggerRef.current) {
|
|
12
|
+
const rect = triggerRef.current.getBoundingClientRect();
|
|
13
|
+
setCoords({
|
|
14
|
+
top: rect.top + window.scrollY,
|
|
15
|
+
left: rect.left + window.scrollX,
|
|
16
|
+
width: rect.width,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}, []);
|
|
20
|
+
const toggle = () => !disabled && setVisible(!visible);
|
|
21
|
+
const show = () => !disabled && setVisible(true);
|
|
22
|
+
const hide = () => setVisible(false);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (visible) {
|
|
25
|
+
updateCoords();
|
|
26
|
+
window.addEventListener('resize', updateCoords);
|
|
27
|
+
window.addEventListener('scroll', updateCoords, true);
|
|
28
|
+
const handleClickOutside = (e) => {
|
|
29
|
+
if (triggerRef.current &&
|
|
30
|
+
!triggerRef.current.contains(e.target) &&
|
|
31
|
+
menuRef.current &&
|
|
32
|
+
!menuRef.current.contains(e.target)) {
|
|
33
|
+
hide();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
37
|
+
return () => {
|
|
38
|
+
window.removeEventListener('resize', updateCoords);
|
|
39
|
+
window.removeEventListener('scroll', updateCoords, true);
|
|
40
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}, [visible, updateCoords]);
|
|
44
|
+
const triggerProps = trigger === 'click'
|
|
45
|
+
? { onClick: toggle }
|
|
46
|
+
: { onMouseEnter: show, onMouseLeave: hide };
|
|
47
|
+
const getMenuStyles = () => {
|
|
48
|
+
var _a, _b, _c, _d;
|
|
49
|
+
const spacing = 4;
|
|
50
|
+
const styles = {
|
|
51
|
+
position: 'absolute',
|
|
52
|
+
zIndex: 1100,
|
|
53
|
+
minWidth: '160px',
|
|
54
|
+
};
|
|
55
|
+
if (placement === 'bottomLeft') {
|
|
56
|
+
styles.top = coords.top + triggerRef.current.offsetHeight + spacing;
|
|
57
|
+
styles.left = coords.left;
|
|
58
|
+
}
|
|
59
|
+
else if (placement === 'bottomRight') {
|
|
60
|
+
styles.top = coords.top + triggerRef.current.offsetHeight + spacing;
|
|
61
|
+
styles.left = coords.left + coords.width - (((_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0);
|
|
62
|
+
}
|
|
63
|
+
else if (placement === 'topLeft') {
|
|
64
|
+
styles.top = coords.top - (((_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0) - spacing;
|
|
65
|
+
styles.left = coords.left;
|
|
66
|
+
}
|
|
67
|
+
else if (placement === 'topRight') {
|
|
68
|
+
styles.top = coords.top - (((_c = menuRef.current) === null || _c === void 0 ? void 0 : _c.offsetHeight) || 0) - spacing;
|
|
69
|
+
styles.left = coords.left + coords.width - (((_d = menuRef.current) === null || _d === void 0 ? void 0 : _d.offsetWidth) || 0);
|
|
70
|
+
}
|
|
71
|
+
return styles;
|
|
72
|
+
};
|
|
73
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: (node) => {
|
|
74
|
+
triggerRef.current = node;
|
|
75
|
+
if (typeof ref === 'function')
|
|
76
|
+
ref(node);
|
|
77
|
+
else if (ref)
|
|
78
|
+
ref.current = node;
|
|
79
|
+
}, style: { display: 'inline-flex' }, className: "ds-dropdown-trigger", ...triggerProps, children: children }), visible && (_jsxs(Portal, { children: [_jsx("div", { ref: menuRef, style: getMenuStyles(), className: "ds-dropdown-menu-container", onMouseEnter: trigger === 'hover' ? show : undefined, onMouseLeave: trigger === 'hover' ? hide : undefined, children: _jsx("div", { style: {
|
|
80
|
+
backgroundColor: tokens.color.white,
|
|
81
|
+
borderRadius: tokens.radius.lg,
|
|
82
|
+
boxShadow: tokens.shadow.xl,
|
|
83
|
+
border: `1px solid ${tokens.color.slate100}`,
|
|
84
|
+
padding: tokens.spacing[1],
|
|
85
|
+
overflow: 'hidden',
|
|
86
|
+
animation: 'ds-dropdown-in 0.2s cubic-bezier(0, 0, 0.2, 1)',
|
|
87
|
+
}, children: menu }) }), _jsx("style", { children: `
|
|
88
|
+
@keyframes ds-dropdown-in {
|
|
89
|
+
from { opacity: 0; transform: scale(0.95) translateY(-4px); }
|
|
90
|
+
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
91
|
+
}
|
|
92
|
+
` })] }))] }));
|
|
93
|
+
});
|
|
94
|
+
Dropdown.displayName = 'Dropdown';
|
|
95
|
+
const MenuItem = ({ children, onClick, icon, danger, disabled, active, }) => {
|
|
96
|
+
const [hovered, setHovered] = useState(false);
|
|
97
|
+
return (_jsxs("div", { onClick: disabled ? undefined : onClick, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), style: {
|
|
98
|
+
display: 'flex',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
gap: tokens.spacing[3],
|
|
101
|
+
padding: `${tokens.spacing[2]} ${tokens.spacing[4]}`,
|
|
102
|
+
fontSize: tokens.font.sm,
|
|
103
|
+
fontWeight: tokens.font.weightMedium,
|
|
104
|
+
color: disabled
|
|
105
|
+
? tokens.color.textDisabled
|
|
106
|
+
: danger
|
|
107
|
+
? tokens.color.danger
|
|
108
|
+
: active
|
|
109
|
+
? tokens.color.primary
|
|
110
|
+
: tokens.color.slate700,
|
|
111
|
+
backgroundColor: active
|
|
112
|
+
? tokens.color.primaryLight
|
|
113
|
+
: hovered && !disabled
|
|
114
|
+
? tokens.color.slate50
|
|
115
|
+
: 'transparent',
|
|
116
|
+
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
117
|
+
borderRadius: tokens.radius.md,
|
|
118
|
+
transition: tokens.transition.fast,
|
|
119
|
+
userSelect: 'none',
|
|
120
|
+
}, children: [icon && (_jsx("span", { style: { display: 'flex', fontSize: '1.1em', opacity: hovered ? 1 : 0.7 }, children: icon })), _jsx("span", { style: { flex: 1 }, children: children })] }));
|
|
121
|
+
};
|
|
122
|
+
const MenuDivider = () => (_jsx("div", { style: {
|
|
123
|
+
height: '1px',
|
|
124
|
+
backgroundColor: tokens.color.slate100,
|
|
125
|
+
margin: `${tokens.spacing[1]} 0`,
|
|
126
|
+
} }));
|
|
127
|
+
Dropdown.Item = MenuItem;
|
|
128
|
+
Dropdown.Divider = MenuDivider;
|
|
129
|
+
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../src/components/Dropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAUlC,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CACtC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,SAAS,GAAG,YAAY,EAAE,QAAQ,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACzF,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IACpE,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE7C,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;YACvB,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;YACxD,SAAS,CAAC;gBACR,GAAG,EAAE,IAAI,CAAC,GAAG,GAAG,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tokens';
|
|
3
|
+
import { Text } from './Typography';
|
|
4
|
+
export const Empty = ({ description = 'Dữ liệu trống', image, extra, style = {}, className = '', }) => {
|
|
5
|
+
return (_jsxs("div", { className: `ds-empty ${className}`, style: {
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'column',
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
justifyContent: 'center',
|
|
10
|
+
padding: '60px 40px',
|
|
11
|
+
textAlign: 'center',
|
|
12
|
+
...style,
|
|
13
|
+
}, children: [_jsx("div", { style: { marginBottom: tokens.spacing[4], color: tokens.color.slate200 }, children: image || (_jsxs("svg", { width: "64", height: "64", viewBox: "0 0 64 64", fill: "none", children: [_jsx("path", { d: "M32 12V52M12 32H52", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }), _jsx("rect", { x: "8", y: "8", width: "48", height: "48", rx: "8", stroke: "currentColor", strokeWidth: "2" }), _jsx("circle", { cx: "32", cy: "32", r: "4", fill: "currentColor" })] })) }), _jsx(Text, { color: "muted", size: "sm", children: description }), extra && _jsx("div", { style: { marginTop: tokens.spacing[4] }, children: extra })] }));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=Empty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Empty.js","sourceRoot":"","sources":["../../../src/components/Empty.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAUpC,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,EAC1C,WAAW,GAAG,eAAe,EAC7B,KAAK,EACL,KAAK,EACL,KAAK,GAAG,EAAE,EACV,SAAS,GAAG,EAAE,GACf,EAAE,EAAE;IACH,OAAO,CACL,eACE,SAAS,EAAE,YAAY,SAAS,EAAE,EAClC,KAAK,EAAE;YACL,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,QAAQ;YACvB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,QAAQ;YACnB,GAAG,KAAK;SACT,aAED,cAAK,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,YAC1E,KAAK,IAAI,CACR,eAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,aACzD,eAAM,CAAC,EAAC,oBAAoB,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,EAAC,aAAa,EAAC,OAAO,GAAG,EAC3F,eAAM,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,GAAG,EACxF,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,cAAc,GAAG,IAChD,CACP,GACG,EACN,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,YAC1B,WAAW,GACP,EACN,KAAK,IAAI,cAAK,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,YAAG,KAAK,GAAO,IACjE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FormProps extends React.FormHTMLAttributes<HTMLFormElement> {
|
|
3
|
+
layout?: 'horizontal' | 'vertical' | 'inline';
|
|
4
|
+
labelCol?: {
|
|
5
|
+
span?: number;
|
|
6
|
+
offset?: number;
|
|
7
|
+
};
|
|
8
|
+
wrapperCol?: {
|
|
9
|
+
span?: number;
|
|
10
|
+
offset?: number;
|
|
11
|
+
};
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const Form: React.FC<FormProps>;
|
|
15
|
+
export interface FormItemProps {
|
|
16
|
+
label?: React.ReactNode;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
error?: string;
|
|
19
|
+
help?: string;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const FormItem: React.FC<FormItemProps>;
|
|
25
|
+
export interface SpaceProps {
|
|
26
|
+
size?: number | 'small' | 'middle' | 'large';
|
|
27
|
+
direction?: 'horizontal' | 'vertical';
|
|
28
|
+
align?: 'start' | 'end' | 'center' | 'baseline';
|
|
29
|
+
wrap?: boolean;
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
style?: React.CSSProperties;
|
|
32
|
+
className?: string;
|
|
33
|
+
fullWidth?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare const Space: React.FC<SpaceProps>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { tokens } from '../tokens';
|
|
4
|
+
import { Row, Col } from './Grid';
|
|
5
|
+
const FormContext = React.createContext({ layout: 'vertical' });
|
|
6
|
+
export const Form = ({ layout = 'vertical', labelCol, wrapperCol, children, ...props }) => {
|
|
7
|
+
return (_jsx(FormContext.Provider, { value: { layout, labelCol, wrapperCol }, children: _jsx("form", { ...props, style: { width: '100%', ...props.style }, children: children }) }));
|
|
8
|
+
};
|
|
9
|
+
export const FormItem = ({ label, required, error, help, children, style = {}, className = '', }) => {
|
|
10
|
+
var _a;
|
|
11
|
+
const { layout, labelCol, wrapperCol } = React.useContext(FormContext);
|
|
12
|
+
const isHorizontal = layout === 'horizontal';
|
|
13
|
+
const labelContent = label && (_jsx("div", { style: {
|
|
14
|
+
marginBottom: isHorizontal ? 0 : '8px',
|
|
15
|
+
paddingRight: isHorizontal ? '16px' : 0,
|
|
16
|
+
textAlign: isHorizontal ? 'right' : 'left',
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
justifyContent: isHorizontal ? 'flex-end' : 'flex-start',
|
|
20
|
+
height: isHorizontal ? '40px' : 'auto', // Match input height
|
|
21
|
+
}, children: _jsxs("label", { style: {
|
|
22
|
+
fontSize: tokens.font.sm,
|
|
23
|
+
fontWeight: tokens.font.weightBold,
|
|
24
|
+
color: tokens.color.slate700,
|
|
25
|
+
display: 'inline-flex',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
}, children: [label, required && _jsx("span", { style: { color: tokens.color.danger, marginLeft: '4px' }, children: "*" })] }) }));
|
|
28
|
+
const innerContent = (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [React.cloneElement(children, {
|
|
29
|
+
// Pass down error to input components if they support it
|
|
30
|
+
error: error || ((_a = children.props) === null || _a === void 0 ? void 0 : _a.error),
|
|
31
|
+
}), error && (_jsx("div", { style: { fontSize: '11px', color: tokens.color.danger, fontWeight: tokens.font.weightMedium }, children: error })), help && !error && (_jsx("div", { style: { fontSize: '11px', color: tokens.color.slate400 }, children: help }))] }));
|
|
32
|
+
return (_jsx("div", { className: `ds-form-item ${className}`, style: {
|
|
33
|
+
marginBottom: tokens.spacing[4],
|
|
34
|
+
...style,
|
|
35
|
+
}, children: isHorizontal ? (_jsxs(Row, { align: "top", children: [_jsx(Col, { ...(labelCol || { span: 6 }), children: labelContent }), _jsx(Col, { ...(wrapperCol || { span: 18 }), children: innerContent })] })) : (_jsxs(_Fragment, { children: [labelContent, innerContent] })) }));
|
|
36
|
+
};
|
|
37
|
+
const SIZE_MAP = {
|
|
38
|
+
small: 8,
|
|
39
|
+
middle: 16,
|
|
40
|
+
large: 24,
|
|
41
|
+
};
|
|
42
|
+
export const Space = ({ size = 'small', direction = 'horizontal', align, wrap = false, children, style = {}, className = '', fullWidth = false, }) => {
|
|
43
|
+
const gap = typeof size === 'number' ? size : SIZE_MAP[size];
|
|
44
|
+
return (_jsx("div", { className: `ds-space ${className}`, style: {
|
|
45
|
+
display: direction === 'horizontal' ? (fullWidth ? 'flex' : 'inline-flex') : 'flex',
|
|
46
|
+
flexDirection: direction === 'vertical' ? 'column' : 'row',
|
|
47
|
+
flexWrap: wrap ? 'wrap' : 'nowrap',
|
|
48
|
+
gap: `${gap}px`,
|
|
49
|
+
alignItems: align,
|
|
50
|
+
width: fullWidth ? '100%' : undefined,
|
|
51
|
+
...style,
|
|
52
|
+
}, children: children }));
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=Form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.js","sourceRoot":"","sources":["../../../src/components/Form.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAWlC,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAIpC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,MAAM,GAAG,UAAU,EACnB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,OAAO,CACL,KAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,YAC3D,kBAAU,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,YACtD,QAAQ,GACJ,GACc,CACxB,CAAC;AAC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EAAE;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,EAC1C,IAAI,GAAG,OAAO,EACd,SAAS,GAAG,YAAY,EACxB,KAAK,EACL,IAAI,GAAG,KAAK,EACZ,QAAQ,EACR,KAAK,GAAG,EAAE,EACV,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,KAAK,GAClB,EAAE,EAAE;IACH,MAAM,GAAG,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7D,OAAO,CACL,cACE,SAAS,EAAE,YAAY,SAAS,EAAE,EAClC,KAAK,EAAE;YACL,OAAO,EAAE,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,MAAM;YACnF,aAAa,EAAE,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK;YAC1D,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;YAClC,GAAG,EAAE,GAAG,GAAG,IAAI;YACf,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YACrC,GAAG,KAAK;SACT,YAEA,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -5,21 +5,21 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
|
|
|
5
5
|
error?: string;
|
|
6
6
|
leadingIcon?: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const Input: React.
|
|
8
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
9
9
|
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
10
10
|
label?: string;
|
|
11
11
|
required?: boolean;
|
|
12
12
|
error?: string;
|
|
13
13
|
}
|
|
14
|
-
export declare const Textarea: React.
|
|
14
|
+
export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
15
15
|
export interface NativeSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
|
16
16
|
label?: string;
|
|
17
17
|
required?: boolean;
|
|
18
18
|
error?: string;
|
|
19
19
|
leadingIcon?: React.ReactNode;
|
|
20
20
|
}
|
|
21
|
-
export declare const NativeSelect: React.
|
|
21
|
+
export declare const NativeSelect: React.ForwardRefExoticComponent<NativeSelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
22
22
|
export interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
23
23
|
label?: string;
|
|
24
24
|
}
|
|
25
|
-
export declare const Checkbox: React.
|
|
25
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|