shared-design-system 1.11.0 → 1.13.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 +2 -1
- package/dist/src/components/Alert.js +80 -38
- package/dist/src/components/Alert.js.map +1 -1
- package/dist/src/components/Avatar.d.ts +11 -1
- package/dist/src/components/Avatar.js +96 -31
- package/dist/src/components/Avatar.js.map +1 -1
- package/dist/src/components/Badge.d.ts +5 -2
- package/dist/src/components/Badge.js +94 -30
- package/dist/src/components/Badge.js.map +1 -1
- package/dist/src/components/Breadcrumbs.d.ts +4 -1
- package/dist/src/components/Breadcrumbs.js +56 -27
- package/dist/src/components/Breadcrumbs.js.map +1 -1
- package/dist/src/components/Button.d.ts +4 -2
- package/dist/src/components/Button.js +99 -95
- package/dist/src/components/Button.js.map +1 -1
- package/dist/src/components/Card.d.ts +6 -1
- package/dist/src/components/Card.js +109 -21
- package/dist/src/components/Card.js.map +1 -1
- package/dist/src/components/ConfirmModal.d.ts +5 -2
- package/dist/src/components/ConfirmModal.js +99 -47
- package/dist/src/components/ConfirmModal.js.map +1 -1
- package/dist/src/components/DatePicker.js +55 -8
- package/dist/src/components/DatePicker.js.map +1 -1
- package/dist/src/components/Divider.d.ts +5 -1
- package/dist/src/components/Divider.js +53 -18
- package/dist/src/components/Divider.js.map +1 -1
- package/dist/src/components/InputComponents.d.ts +2 -4
- package/dist/src/components/InputComponents.js +89 -132
- package/dist/src/components/InputComponents.js.map +1 -1
- package/dist/src/components/ListComponents.d.ts +7 -4
- package/dist/src/components/ListComponents.js +70 -35
- package/dist/src/components/ListComponents.js.map +1 -1
- package/dist/src/components/LoadingSpinner.d.ts +9 -2
- package/dist/src/components/LoadingSpinner.js +59 -17
- package/dist/src/components/LoadingSpinner.js.map +1 -1
- package/dist/src/components/MultiSelect.d.ts +14 -0
- package/dist/src/components/MultiSelect.js +142 -0
- package/dist/src/components/MultiSelect.js.map +1 -0
- package/dist/src/components/Progress.d.ts +5 -1
- package/dist/src/components/Progress.js +58 -26
- package/dist/src/components/Progress.js.map +1 -1
- package/dist/src/components/Radio.d.ts +4 -0
- package/dist/src/components/Radio.js +50 -24
- package/dist/src/components/Radio.js.map +1 -1
- package/dist/src/components/ReadOnlyField.d.ts +6 -1
- package/dist/src/components/ReadOnlyField.js +78 -18
- package/dist/src/components/ReadOnlyField.js.map +1 -1
- package/dist/src/components/Select.d.ts +19 -0
- package/dist/src/components/Select.js +110 -0
- package/dist/src/components/Select.js.map +1 -0
- package/dist/src/components/Skeleton.d.ts +3 -1
- package/dist/src/components/Skeleton.js +52 -22
- package/dist/src/components/Skeleton.js.map +1 -1
- package/dist/src/components/Stack.d.ts +4 -0
- package/dist/src/components/Stack.js +32 -18
- package/dist/src/components/Stack.js.map +1 -1
- package/dist/src/components/Steps.d.ts +3 -1
- package/dist/src/components/Steps.js +93 -68
- package/dist/src/components/Steps.js.map +1 -1
- package/dist/src/components/Switch.d.ts +6 -2
- package/dist/src/components/Switch.js +45 -22
- package/dist/src/components/Switch.js.map +1 -1
- package/dist/src/components/Table.d.ts +9 -1
- package/dist/src/components/Table.js +102 -37
- package/dist/src/components/Table.js.map +1 -1
- package/dist/src/components/Tabs.d.ts +9 -5
- package/dist/src/components/Tabs.js +88 -88
- package/dist/src/components/Tabs.js.map +1 -1
- package/dist/src/components/Tag.d.ts +5 -2
- package/dist/src/components/Tag.js +106 -28
- package/dist/src/components/Tag.js.map +1 -1
- package/dist/src/components/Tooltip.d.ts +3 -0
- package/dist/src/components/Tooltip.js +89 -38
- package/dist/src/components/Tooltip.js.map +1 -1
- package/dist/src/components/Typography.d.ts +15 -2
- package/dist/src/components/Typography.js +108 -53
- package/dist/src/components/Typography.js.map +1 -1
- package/dist/src/index.d.ts +12 -8
- package/dist/src/index.js +6 -4
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,167 +1,124 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { tokens } from '../tokens';
|
|
4
|
-
const
|
|
5
|
-
display: 'block',
|
|
6
|
-
fontSize: tokens.font.xs,
|
|
7
|
-
fontWeight: tokens.font.weightMedium,
|
|
8
|
-
color: tokens.color.textMuted,
|
|
9
|
-
marginBottom: tokens.spacing[1],
|
|
10
|
-
};
|
|
11
|
-
const filterLabelStyle = {
|
|
4
|
+
const floatingLabelStyle = {
|
|
12
5
|
position: 'absolute',
|
|
13
6
|
top: '-10px',
|
|
14
|
-
left: '
|
|
7
|
+
left: '14px',
|
|
15
8
|
backgroundColor: 'white',
|
|
16
9
|
padding: '0 6px',
|
|
17
|
-
fontSize: '
|
|
18
|
-
fontWeight: tokens.font.
|
|
10
|
+
fontSize: '10px',
|
|
11
|
+
fontWeight: tokens.font.weightBold,
|
|
19
12
|
color: tokens.color.slate400,
|
|
20
13
|
textTransform: 'uppercase',
|
|
21
|
-
letterSpacing: '0.
|
|
14
|
+
letterSpacing: '0.1em',
|
|
22
15
|
zIndex: 1,
|
|
16
|
+
transition: tokens.transition.fast,
|
|
23
17
|
};
|
|
24
|
-
const
|
|
18
|
+
const inputContainerStyle = (isFocused, hasError) => ({
|
|
19
|
+
position: 'relative',
|
|
25
20
|
width: '100%',
|
|
26
|
-
padding: `${tokens.spacing[3]} ${tokens.spacing[4]}`,
|
|
27
|
-
fontSize: tokens.font.sm,
|
|
28
|
-
borderRadius: tokens.radius.md,
|
|
29
|
-
border: `1px solid ${tokens.color.slate200}`,
|
|
30
21
|
backgroundColor: tokens.color.white,
|
|
31
|
-
color: tokens.color.
|
|
32
|
-
|
|
22
|
+
border: `1px solid ${hasError ? tokens.color.danger : (isFocused ? tokens.color.borderFocus : tokens.color.slate200)}`,
|
|
23
|
+
borderRadius: tokens.radius.lg,
|
|
24
|
+
padding: '12px 16px',
|
|
33
25
|
transition: tokens.transition.fast,
|
|
26
|
+
boxShadow: isFocused ? '0 0 0 3px rgba(245, 158, 11, 0.1)' : tokens.shadow.sm,
|
|
27
|
+
});
|
|
28
|
+
const inputFieldBaseStyle = {
|
|
29
|
+
width: '100%',
|
|
30
|
+
border: 'none',
|
|
31
|
+
outline: 'none',
|
|
32
|
+
backgroundColor: 'transparent',
|
|
33
|
+
fontSize: tokens.font.sm,
|
|
34
34
|
fontFamily: tokens.font.family,
|
|
35
|
-
fontWeight: tokens.font.
|
|
36
|
-
|
|
35
|
+
fontWeight: tokens.font.weightSemibold,
|
|
36
|
+
color: tokens.color.slate800,
|
|
37
|
+
padding: '4px 0 0 0',
|
|
37
38
|
};
|
|
38
|
-
export const Input = ({ label, required, error,
|
|
39
|
+
export const Input = ({ label, required, error, className = '', style = {}, onFocus, onBlur, leadingIcon, ...props }) => {
|
|
39
40
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
alignItems: 'center',
|
|
46
|
-
...(isFilter && {
|
|
47
|
-
border: `1px solid ${isFocused ? tokens.color.borderFocus : tokens.color.slate200}`,
|
|
48
|
-
borderRadius: tokens.radius.md,
|
|
49
|
-
padding: '8px 12px',
|
|
50
|
-
backgroundColor: tokens.color.white,
|
|
51
|
-
transition: tokens.transition.fast,
|
|
52
|
-
boxShadow: tokens.shadow.sm,
|
|
53
|
-
})
|
|
54
|
-
};
|
|
55
|
-
const fieldStyle = {
|
|
56
|
-
...inputBaseStyle,
|
|
57
|
-
...(leadingIcon && { paddingLeft: tokens.spacing[10] }),
|
|
58
|
-
...(isFilter && {
|
|
59
|
-
border: 'none',
|
|
60
|
-
padding: '4px 0 0 0',
|
|
61
|
-
backgroundColor: 'transparent',
|
|
62
|
-
boxShadow: 'none',
|
|
63
|
-
}),
|
|
64
|
-
...(isFocused && !isFilter && {
|
|
65
|
-
borderColor: tokens.color.borderFocus,
|
|
66
|
-
boxShadow: `0 0 0 3px ${tokens.color.borderFocus}22`,
|
|
67
|
-
}),
|
|
68
|
-
...(error && { borderColor: tokens.color.danger }),
|
|
69
|
-
...style
|
|
70
|
-
};
|
|
71
|
-
return (_jsxs("div", { className: className, style: { width: '100%', position: 'relative' }, children: [label && !isFilter && (_jsxs("label", { style: labelStyle, children: [label, " ", required && _jsx("span", { style: { color: tokens.color.danger }, children: "*" })] })), _jsxs("div", { style: containerStyle, children: [label && isFilter && (_jsx("label", { style: { ...filterLabelStyle, color: isFocused ? tokens.color.borderFocus : tokens.color.slate400 }, children: label })), leadingIcon && (_jsx("div", { style: {
|
|
41
|
+
return (_jsxs("div", { className: className, style: { width: '100%', position: 'relative', ...style }, children: [label && (_jsxs("label", { style: {
|
|
42
|
+
...floatingLabelStyle,
|
|
43
|
+
color: isFocused ? tokens.color.borderFocus : (error ? tokens.color.danger : tokens.color.slate400),
|
|
44
|
+
left: leadingIcon ? '40px' : '14px'
|
|
45
|
+
}, children: [label, " ", required && _jsx("span", { style: { color: tokens.color.danger }, children: "*" })] })), _jsxs("div", { style: inputContainerStyle(isFocused, !!error), children: [leadingIcon && (_jsx("div", { style: {
|
|
72
46
|
position: 'absolute',
|
|
73
|
-
left:
|
|
74
|
-
|
|
47
|
+
left: '16px',
|
|
48
|
+
top: '50%',
|
|
49
|
+
transform: 'translateY(-50%)',
|
|
50
|
+
color: isFocused ? tokens.color.primary : tokens.color.slate300,
|
|
75
51
|
display: 'flex',
|
|
76
52
|
alignItems: 'center',
|
|
77
53
|
zIndex: 1,
|
|
78
54
|
pointerEvents: 'none',
|
|
79
|
-
|
|
55
|
+
marginTop: '2px'
|
|
56
|
+
}, children: leadingIcon })), _jsx("input", { style: {
|
|
57
|
+
...inputFieldBaseStyle,
|
|
58
|
+
...(leadingIcon && { paddingLeft: '28px' }),
|
|
59
|
+
}, onFocus: (e) => {
|
|
80
60
|
setIsFocused(true);
|
|
81
61
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
82
62
|
}, onBlur: (e) => {
|
|
83
63
|
setIsFocused(false);
|
|
84
64
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
85
|
-
}, ...props })] }), error && _jsx("p", { style: { fontSize: '11px', color: tokens.color.danger, marginTop: '
|
|
65
|
+
}, ...props })] }), error && _jsx("p", { style: { fontSize: '11px', color: tokens.color.danger, marginTop: '6px', fontWeight: tokens.font.weightMedium }, children: error })] }));
|
|
86
66
|
};
|
|
87
67
|
export const Textarea = ({ label, required, error, className = '', style = {}, onFocus, onBlur, ...props }) => {
|
|
88
68
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
89
|
-
return (_jsxs("div", { className: className, style: { width: '100%'
|
|
90
|
-
...
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
setIsFocused(false);
|
|
104
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
105
|
-
}, ...props }), error && _jsx("p", { style: { fontSize: '11px', color: tokens.color.danger, marginTop: '4px' }, children: error })] }));
|
|
69
|
+
return (_jsxs("div", { className: className, style: { width: '100%', position: 'relative', ...style }, children: [label && (_jsxs("label", { style: {
|
|
70
|
+
...floatingLabelStyle,
|
|
71
|
+
color: isFocused ? tokens.color.borderFocus : (error ? tokens.color.danger : tokens.color.slate400)
|
|
72
|
+
}, children: [label, " ", required && _jsx("span", { style: { color: tokens.color.danger }, children: "*" })] })), _jsx("div", { style: inputContainerStyle(isFocused, !!error), children: _jsx("textarea", { style: {
|
|
73
|
+
...inputFieldBaseStyle,
|
|
74
|
+
minHeight: '100px',
|
|
75
|
+
resize: 'none',
|
|
76
|
+
}, onFocus: (e) => {
|
|
77
|
+
setIsFocused(true);
|
|
78
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
79
|
+
}, onBlur: (e) => {
|
|
80
|
+
setIsFocused(false);
|
|
81
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
82
|
+
}, ...props }) }), error && _jsx("p", { style: { fontSize: '11px', color: tokens.color.danger, marginTop: '6px', fontWeight: tokens.font.weightMedium }, children: error })] }));
|
|
106
83
|
};
|
|
107
|
-
export const
|
|
84
|
+
export const NativeSelect = ({ label, required, children, error, className = '', style = {}, onFocus, onBlur, leadingIcon, ...props }) => {
|
|
108
85
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
alignItems: 'center',
|
|
146
|
-
zIndex: 1,
|
|
147
|
-
pointerEvents: 'none'
|
|
148
|
-
}, children: leadingIcon })), _jsx("select", { style: fieldStyle, onFocus: (e) => {
|
|
149
|
-
setIsFocused(true);
|
|
150
|
-
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
151
|
-
}, onBlur: (e) => {
|
|
152
|
-
setIsFocused(false);
|
|
153
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
154
|
-
}, ...props, children: children }), _jsx("div", { style: {
|
|
155
|
-
position: 'absolute',
|
|
156
|
-
right: isFilter ? '0' : tokens.spacing[3],
|
|
157
|
-
top: '50%',
|
|
158
|
-
transform: 'translateY(-50%)',
|
|
159
|
-
pointerEvents: 'none',
|
|
160
|
-
color: isFocused ? tokens.color.primary : tokens.color.slate400,
|
|
161
|
-
display: 'flex',
|
|
162
|
-
alignItems: 'center',
|
|
163
|
-
marginTop: isFilter ? '2px' : '0'
|
|
164
|
-
}, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polyline", { points: "6 9 12 15 18 9" }) }) })] })] }), error && _jsx("p", { style: { fontSize: '11px', color: tokens.color.danger, marginTop: '4px' }, children: error })] }));
|
|
86
|
+
return (_jsxs("div", { className: className, style: { width: '100%', position: 'relative', ...style }, children: [label && (_jsxs("label", { style: {
|
|
87
|
+
...floatingLabelStyle,
|
|
88
|
+
color: isFocused ? tokens.color.borderFocus : (error ? tokens.color.danger : tokens.color.slate400),
|
|
89
|
+
left: leadingIcon ? '40px' : '14px'
|
|
90
|
+
}, children: [label, " ", required && _jsx("span", { style: { color: tokens.color.danger }, children: "*" })] })), _jsx("div", { style: inputContainerStyle(isFocused, !!error), children: _jsxs("div", { style: { position: 'relative', display: 'flex', alignItems: 'center' }, children: [leadingIcon && (_jsx("div", { style: {
|
|
91
|
+
position: 'absolute',
|
|
92
|
+
left: '0',
|
|
93
|
+
color: isFocused ? tokens.color.primary : tokens.color.slate300,
|
|
94
|
+
display: 'flex',
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
zIndex: 1,
|
|
97
|
+
pointerEvents: 'none',
|
|
98
|
+
marginTop: '2px'
|
|
99
|
+
}, children: leadingIcon })), _jsx("select", { style: {
|
|
100
|
+
...inputFieldBaseStyle,
|
|
101
|
+
appearance: 'none',
|
|
102
|
+
paddingRight: '32px',
|
|
103
|
+
...(leadingIcon && { paddingLeft: '28px' }),
|
|
104
|
+
cursor: 'pointer',
|
|
105
|
+
}, onFocus: (e) => {
|
|
106
|
+
setIsFocused(true);
|
|
107
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
108
|
+
}, onBlur: (e) => {
|
|
109
|
+
setIsFocused(false);
|
|
110
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
111
|
+
}, ...props, children: children }), _jsx("div", { style: {
|
|
112
|
+
position: 'absolute',
|
|
113
|
+
right: '0',
|
|
114
|
+
top: '50%',
|
|
115
|
+
transform: 'translateY(-50%)',
|
|
116
|
+
pointerEvents: 'none',
|
|
117
|
+
color: isFocused ? tokens.color.borderFocus : tokens.color.slate300,
|
|
118
|
+
display: 'flex',
|
|
119
|
+
alignItems: 'center',
|
|
120
|
+
marginTop: '2px'
|
|
121
|
+
}, children: _jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polyline", { points: "6 9 12 15 18 9" }) }) })] }) }), error && _jsx("p", { style: { fontSize: '11px', color: tokens.color.danger, marginTop: '6px', fontWeight: tokens.font.weightMedium }, children: error })] }));
|
|
165
122
|
};
|
|
166
123
|
export const Checkbox = ({ label, checked, className = '', style = {}, ...props }) => {
|
|
167
124
|
return (_jsxs("label", { className: className, style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputComponents.js","sourceRoot":"","sources":["../../../src/components/InputComponents.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,
|
|
1
|
+
{"version":3,"file":"InputComponents.js","sourceRoot":"","sources":["../../../src/components/InputComponents.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,kBAAkB,GAAwB;IAC9C,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,OAAO;IACZ,IAAI,EAAE,MAAM;IACZ,eAAe,EAAE,OAAO;IACxB,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,MA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eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa;4BAC/D,MAAM,EAAE,SAAS;4BACjB,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI;4BAClC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,MAAM;yBACpE,KACG,KAAK,GACT,EACD,OAAO,IAAI,CACV,cAAK,KAAK,EAAE;4BACV,QAAQ,EAAE,UAAU;4BACpB,IAAI,EAAE,KAAK;4BACX,GAAG,EAAE,KAAK;4BACV,KAAK,EAAE,MAAM;4BACb,MAAM,EAAE,MAAM;4BACd,KAAK,EAAE,OAAO;4BACd,aAAa,EAAE,MAAM;yBACtB,EAAE,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,YACnH,mBAAU,MAAM,EAAC,gBAAgB,GAAY,GACzC,CACP,IACG,EACL,KAAK,IACA,CACT,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -3,16 +3,19 @@ export interface ListProps<T = any> extends Omit<React.HTMLAttributes<HTMLUListE
|
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
items?: T[];
|
|
5
5
|
renderItem?: (item: T, index: number) => React.ReactNode;
|
|
6
|
-
variant?: 'default' | 'sidebar' | 'ghost';
|
|
7
|
-
spacing?: '
|
|
6
|
+
variant?: 'default' | 'sidebar' | 'ghost' | 'card';
|
|
7
|
+
spacing?: 'none' | 'xs' | 'sm' | 'md';
|
|
8
|
+
divider?: boolean;
|
|
8
9
|
}
|
|
9
|
-
export declare const List: <T extends any>({ children, items, renderItem, className, style, variant, spacing, ...props }: ListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const List: <T extends any>({ children, items, renderItem, className, style, variant, spacing, divider, ...props }: ListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
11
12
|
children: React.ReactNode;
|
|
12
13
|
icon?: React.ReactNode;
|
|
13
14
|
action?: React.ReactNode;
|
|
15
|
+
badge?: React.ReactNode;
|
|
14
16
|
divider?: boolean;
|
|
15
17
|
active?: boolean;
|
|
16
|
-
variant?: 'default' | 'sidebar' | 'ghost';
|
|
18
|
+
variant?: 'default' | 'sidebar' | 'ghost' | 'card';
|
|
19
|
+
description?: string;
|
|
17
20
|
}
|
|
18
21
|
export declare const ListItem: React.FC<ListItemProps>;
|
|
@@ -1,63 +1,98 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { tokens } from '../tokens';
|
|
4
|
-
export const List = ({ children, items, renderItem, className = '', style = {}, variant = 'default', spacing = '
|
|
4
|
+
export const List = ({ children, items, renderItem, className = '', style = {}, variant = 'default', spacing = 'xs', divider = false, ...props }) => {
|
|
5
|
+
const isCard = variant === 'card';
|
|
6
|
+
const isSidebarOrGhost = variant === 'sidebar' || variant === 'ghost';
|
|
5
7
|
const getSpacing = () => {
|
|
6
8
|
switch (spacing) {
|
|
7
|
-
case '
|
|
8
|
-
case '
|
|
9
|
-
case '
|
|
9
|
+
case 'none': return '0';
|
|
10
|
+
case 'xs': return '2px';
|
|
11
|
+
case 'md': return tokens.spacing[2];
|
|
10
12
|
default: return '4px';
|
|
11
13
|
}
|
|
12
14
|
};
|
|
13
15
|
const containerStyle = {
|
|
14
16
|
listStyle: 'none',
|
|
15
|
-
padding: 0,
|
|
17
|
+
padding: isCard ? tokens.spacing[3] : 0,
|
|
16
18
|
margin: 0,
|
|
17
19
|
display: 'flex',
|
|
18
20
|
flexDirection: 'column',
|
|
19
|
-
gap:
|
|
20
|
-
border: variant === 'default' ? `1px solid ${tokens.color.slate100}` : 'none',
|
|
21
|
-
borderRadius: variant === 'default' ? tokens.radius.
|
|
21
|
+
gap: isSidebarOrGhost || isCard ? getSpacing() : '0',
|
|
22
|
+
border: variant === 'default' ? `1px solid ${tokens.color.slate100}` : isCard ? `1px solid ${tokens.color.slate100}` : 'none',
|
|
23
|
+
borderRadius: variant === 'default' ? tokens.radius.xl : isCard ? tokens.radius['2xl'] : '0',
|
|
22
24
|
overflow: 'hidden',
|
|
23
|
-
backgroundColor: variant === 'default' ? tokens.color.white : 'transparent',
|
|
24
|
-
|
|
25
|
+
backgroundColor: variant === 'default' ? tokens.color.white : isCard ? tokens.color.white : 'transparent',
|
|
26
|
+
boxShadow: isCard ? tokens.shadow.sm : 'none',
|
|
27
|
+
...style,
|
|
25
28
|
};
|
|
26
|
-
return (_jsx("ul", { style: containerStyle, className: className
|
|
29
|
+
return (_jsx("ul", { style: containerStyle, className: `ds-list ds-list--${variant} ${className}`, ...props, children: items && renderItem
|
|
30
|
+
? items.map((item, index) => (_jsxs(React.Fragment, { children: [renderItem(item, index), divider && index < items.length - 1 && (_jsx("li", { "aria-hidden": true, style: { height: '1px', backgroundColor: tokens.color.slate100, margin: '0 -0px' } }))] }, index)))
|
|
31
|
+
: children }));
|
|
27
32
|
};
|
|
28
|
-
export const ListItem = ({ children, icon, action, onClick, className = '', style = {}, divider = false, active = false, variant = 'sidebar', ...props }) => {
|
|
29
|
-
const
|
|
33
|
+
export const ListItem = ({ children, icon, action, badge, onClick, className = '', style = {}, divider = false, active = false, variant = 'sidebar', description, ...props }) => {
|
|
34
|
+
const [hovered, setHovered] = React.useState(false);
|
|
35
|
+
const isSidebar = variant === 'sidebar' || variant === 'card';
|
|
36
|
+
const isClickable = !!onClick;
|
|
37
|
+
const showHover = isClickable && hovered && !active;
|
|
38
|
+
const getActiveStyles = () => {
|
|
39
|
+
if (active)
|
|
40
|
+
return {
|
|
41
|
+
backgroundColor: tokens.color.primaryLight,
|
|
42
|
+
color: tokens.color.primary,
|
|
43
|
+
borderColor: 'rgba(37, 99, 235, 0.2)',
|
|
44
|
+
};
|
|
45
|
+
if (showHover)
|
|
46
|
+
return {
|
|
47
|
+
backgroundColor: tokens.color.slate50,
|
|
48
|
+
color: tokens.color.slate700,
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
backgroundColor: 'transparent',
|
|
52
|
+
color: tokens.color.slate600,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
30
55
|
const itemStyle = {
|
|
31
56
|
display: 'flex',
|
|
32
|
-
alignItems: 'center',
|
|
33
|
-
padding: isSidebar ?
|
|
57
|
+
alignItems: description ? 'flex-start' : 'center',
|
|
58
|
+
padding: isSidebar ? `${tokens.spacing[3]} ${tokens.spacing[4]}` : `${tokens.spacing[4]} ${tokens.spacing[4]}`,
|
|
34
59
|
gap: tokens.spacing[3],
|
|
35
|
-
cursor:
|
|
36
|
-
borderRadius: isSidebar ? tokens.radius.
|
|
60
|
+
cursor: isClickable ? 'pointer' : 'default',
|
|
61
|
+
borderRadius: isSidebar ? tokens.radius.lg : '0',
|
|
37
62
|
transition: tokens.transition.fast,
|
|
38
|
-
border: isSidebar ? `1px solid ${active ?
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
63
|
+
border: isSidebar ? `1px solid ${active ? 'rgba(37, 99, 235, 0.15)' : 'transparent'}` : 'none',
|
|
64
|
+
borderBottom: !isSidebar && (divider || variant === 'default')
|
|
65
|
+
? `1px solid ${tokens.color.slate100}`
|
|
66
|
+
: 'none',
|
|
42
67
|
fontWeight: active ? tokens.font.weightSemibold : tokens.font.weightMedium,
|
|
43
|
-
|
|
68
|
+
outline: 'none',
|
|
69
|
+
...getActiveStyles(),
|
|
70
|
+
...style,
|
|
44
71
|
};
|
|
45
|
-
const
|
|
72
|
+
const iconWrapStyle = {
|
|
46
73
|
display: 'flex',
|
|
47
74
|
flexShrink: 0,
|
|
48
|
-
color: active ? tokens.color.
|
|
75
|
+
color: active ? tokens.color.primary : showHover ? tokens.color.slate500 : tokens.color.slate400,
|
|
49
76
|
transition: tokens.transition.fast,
|
|
77
|
+
marginTop: description ? '2px' : '0',
|
|
50
78
|
};
|
|
51
|
-
return (_jsxs("li", { style: itemStyle, className: className
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
79
|
+
return (_jsxs("li", { style: itemStyle, className: `ds-list-item ${className}`, onClick: onClick, onMouseEnter: () => isClickable && setHovered(true), onMouseLeave: () => isClickable && setHovered(false), role: isClickable ? 'button' : undefined, tabIndex: isClickable ? 0 : undefined, ...props, children: [icon && _jsx("div", { style: iconWrapStyle, children: icon }), _jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [_jsx("div", { style: {
|
|
80
|
+
fontSize: tokens.font.sm,
|
|
81
|
+
lineHeight: 1.4,
|
|
82
|
+
whiteSpace: 'nowrap',
|
|
83
|
+
overflow: 'hidden',
|
|
84
|
+
textOverflow: 'ellipsis',
|
|
85
|
+
}, children: children }), description && (_jsx("div", { style: {
|
|
86
|
+
fontSize: '11px',
|
|
87
|
+
color: tokens.color.textMuted,
|
|
88
|
+
marginTop: '2px',
|
|
89
|
+
fontWeight: tokens.font.weightMedium,
|
|
90
|
+
lineHeight: 1.4,
|
|
91
|
+
}, children: description }))] }), badge && (_jsx("div", { style: { flexShrink: 0, marginLeft: tokens.spacing[1] }, children: badge })), action && (_jsx("div", { style: { flexShrink: 0 }, children: action })), isSidebar && isClickable && !action && (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round", style: {
|
|
92
|
+
flexShrink: 0,
|
|
93
|
+
opacity: active ? 0.7 : 0.3,
|
|
94
|
+
transition: tokens.transition.fast,
|
|
95
|
+
marginLeft: 'auto',
|
|
96
|
+
}, children: _jsx("polyline", { points: "9 18 15 12 9 6" }) }))] }));
|
|
62
97
|
};
|
|
63
98
|
//# sourceMappingURL=ListComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListComponents.js","sourceRoot":"","sources":["../../../src/components/ListComponents.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ListComponents.js","sourceRoot":"","sources":["../../../src/components/ListComponents.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAWnC,MAAM,CAAC,MAAM,IAAI,GAAG,CAAgB,EAClC,QAAQ,EACR,KAAK,EACL,UAAU,EACV,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,EAAE,EACV,OAAO,GAAG,SAAS,EACnB,OAAO,GAAG,IAAI,EACd,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EACK,EAAE,EAAE;IACjB,MAAM,MAAM,GAAG,OAAO,KAAK,MAAM,CAAC;IAClC,MAAM,gBAAgB,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,OAAO,CAAC;IAEtE,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,QAAQ,OAAO,EAAE,CAAC;YAChB,KAAK,MAAM,CAAC,CAAC,OAAO,GAAG,CAAC;YACxB,KAAK,IAAI,CAAC,CAAG,OAAO,KAAK,CAAC;YAC1B,KAAK,IAAI,CAAC,CAAG,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACtC,OAAO,CAAC,CAAK,OAAO,KAAK,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,cAAc,GAAwB;QAC1C,SAAS,EAAE,MAAM;QACjB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAA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ChB,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY;4BACpC,UAAU,EAAE,GAAG;yBAChB,YACE,WAAW,GACR,CACP,IACG,EAEL,KAAK,IAAI,CACR,cAAK,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,YAAG,KAAK,GAAO,CAC5E,EACA,MAAM,IAAI,CACT,cAAK,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,YAAG,MAAM,GAAO,CAC9C,EAGA,SAAS,IAAI,WAAW,IAAI,CAAC,MAAM,IAAI,CACtC,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,GAAG,EAChB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,KAAK,EAAE;oBACL,UAAU,EAAE,CAAC;oBACb,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;oBAC3B,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI;oBAClC,UAAU,EAAE,MAAM;iBACnB,YAED,mBAAU,MAAM,EAAC,gBAAgB,GAAG,GAChC,CACP,IACE,CACN,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface LoadingSpinnerProps {
|
|
3
|
-
size?: 'sm' | 'md' | 'lg';
|
|
4
|
-
color?: 'primary' | 'white';
|
|
3
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
color?: 'primary' | 'white' | 'success' | 'warning' | 'danger' | 'info' | 'slate';
|
|
5
|
+
label?: string;
|
|
5
6
|
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
6
8
|
}
|
|
7
9
|
export declare const LoadingSpinner: React.FC<LoadingSpinnerProps>;
|
|
10
|
+
export interface LoadingOverlayProps {
|
|
11
|
+
visible?: boolean;
|
|
12
|
+
label?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const LoadingOverlay: React.FC<LoadingOverlayProps>;
|