shared-design-system 1.12.0 → 1.14.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 -2
- package/dist/src/components/Avatar.js +87 -40
- package/dist/src/components/Avatar.js.map +1 -1
- package/dist/src/components/Badge.d.ts +4 -2
- package/dist/src/components/Badge.js +67 -29
- 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 +3 -1
- package/dist/src/components/Card.js +86 -23
- 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/Divider.d.ts +4 -2
- package/dist/src/components/Divider.js +46 -19
- package/dist/src/components/Divider.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/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 +4 -0
- package/dist/src/components/ReadOnlyField.js +78 -25
- package/dist/src/components/ReadOnlyField.js.map +1 -1
- package/dist/src/components/Select.js +2 -2
- package/dist/src/components/Select.js.map +1 -1
- 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 +2 -0
- package/dist/src/components/Stack.js +21 -20
- 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 +3 -1
- package/dist/src/components/Tag.js +104 -26
- 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 +14 -1
- package/dist/src/components/Typography.js +108 -61
- package/dist/src/components/Typography.js.map +1 -1
- package/dist/src/index.d.ts +6 -6
- package/dist/src/index.js +3 -3
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,5 +7,7 @@ export interface StackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
8
8
|
divider?: boolean | React.ReactNode;
|
|
9
9
|
wrap?: boolean;
|
|
10
|
+
inline?: boolean;
|
|
11
|
+
fullWidth?: boolean;
|
|
10
12
|
}
|
|
11
13
|
export declare const Stack: React.FC<StackProps>;
|
|
@@ -2,40 +2,41 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { tokens } from '../tokens';
|
|
4
4
|
import { Divider } from './Divider';
|
|
5
|
-
|
|
5
|
+
const JUSTIFY_MAP = {
|
|
6
|
+
start: 'flex-start',
|
|
7
|
+
center: 'center',
|
|
8
|
+
end: 'flex-end',
|
|
9
|
+
between: 'space-between',
|
|
10
|
+
around: 'space-around',
|
|
11
|
+
evenly: 'space-evenly',
|
|
12
|
+
};
|
|
13
|
+
export const Stack = ({ direction = 'column', spacing = '4', align = 'stretch', justify = 'start', divider, wrap = false, inline = false, fullWidth = false, children, className = '', style = {}, ...props }) => {
|
|
6
14
|
const getSpacing = () => {
|
|
7
15
|
if (typeof spacing === 'number')
|
|
8
16
|
return `${spacing}px`;
|
|
9
|
-
return tokens.spacing[spacing] || tokens.spacing['4'];
|
|
10
|
-
};
|
|
11
|
-
const getJustify = () => {
|
|
12
|
-
if (justify === 'between')
|
|
13
|
-
return 'space-between';
|
|
14
|
-
if (justify === 'around')
|
|
15
|
-
return 'space-around';
|
|
16
|
-
if (justify === 'evenly')
|
|
17
|
-
return 'space-evenly';
|
|
18
|
-
return justify;
|
|
17
|
+
return (tokens.spacing[spacing]) || tokens.spacing['4'];
|
|
19
18
|
};
|
|
19
|
+
const isRow = direction === 'row' || direction === 'row-reverse';
|
|
20
20
|
const baseStyle = {
|
|
21
|
-
display: 'flex',
|
|
21
|
+
display: inline ? 'inline-flex' : 'flex',
|
|
22
22
|
flexDirection: direction,
|
|
23
23
|
gap: divider ? 0 : getSpacing(),
|
|
24
|
-
alignItems: align,
|
|
25
|
-
justifyContent:
|
|
24
|
+
alignItems: align === 'start' ? 'flex-start' : align === 'end' ? 'flex-end' : align,
|
|
25
|
+
justifyContent: JUSTIFY_MAP[justify] || 'flex-start',
|
|
26
26
|
flexWrap: wrap ? 'wrap' : 'nowrap',
|
|
27
|
-
|
|
27
|
+
width: fullWidth ? '100%' : undefined,
|
|
28
|
+
...style,
|
|
28
29
|
};
|
|
29
30
|
const renderChildren = () => {
|
|
30
31
|
if (!divider)
|
|
31
32
|
return children;
|
|
32
|
-
const arrayChildren = React.Children.toArray(children);
|
|
33
|
-
return arrayChildren.map((child, index) => (_jsxs(React.Fragment, { children: [child, index < arrayChildren.length - 1 && (typeof divider === 'boolean' ? (_jsx(Divider, { orientation:
|
|
34
|
-
margin:
|
|
33
|
+
const arrayChildren = React.Children.toArray(children).filter(Boolean);
|
|
34
|
+
return arrayChildren.map((child, index) => (_jsxs(React.Fragment, { children: [child, index < arrayChildren.length - 1 && (typeof divider === 'boolean' ? (_jsx(Divider, { orientation: isRow ? 'vertical' : 'horizontal', margin: "none", style: {
|
|
35
|
+
margin: isRow
|
|
35
36
|
? `0 ${getSpacing()}`
|
|
36
|
-
: `${getSpacing()} 0
|
|
37
|
+
: `${getSpacing()} 0`,
|
|
37
38
|
} })) : divider)] }, index)));
|
|
38
39
|
};
|
|
39
|
-
return (_jsx("div", { style: baseStyle, className: className
|
|
40
|
+
return (_jsx("div", { style: baseStyle, className: `ds-stack ${className}`, ...props, children: renderChildren() }));
|
|
40
41
|
};
|
|
41
42
|
//# sourceMappingURL=Stack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.js","sourceRoot":"","sources":["../../../src/components/Stack.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Stack.js","sourceRoot":"","sources":["../../../src/components/Stack.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,MAAM,WAAW,GAA2B;IAC1C,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,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SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;QACrC,GAAG,KAAK;KACT,CAAC;IAEF,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,IAAI,CAAC,OAAO;YAAE,OAAO,QAAQ,CAAC;QAE9B,MAAM,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvE,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACzC,MAAC,KAAK,CAAC,QAAQ,eACZ,KAAK,EACL,KAAK,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CACnC,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAC7B,KAAC,OAAO,IACN,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,EAC9C,MAAM,EAAC,MAAM,EACb,KAAK,EAAE;wBACL,MAAM,EAAE,KAAK;4BACX,CAAC,CAAC,KAAK,UAAU,EAAE,EAAE;4BACrB,CAAC,CAAC,GAAG,UAAU,EAAE,IAAI;qBACxB,GACD,CACH,CAAC,CAAC,CAAC,OAAO,CACZ,KAdkB,KAAK,CAeT,CAClB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,cAAK,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,SAAS,EAAE,KAAM,KAAK,YACjE,cAAc,EAAE,GACb,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export type StepStatus = 'finish' | 'process' | 'wait';
|
|
2
|
+
export type StepStatus = 'finish' | 'process' | 'wait' | 'error';
|
|
3
3
|
export interface StepItem {
|
|
4
4
|
title: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
icon?: React.ReactNode;
|
|
6
7
|
}
|
|
7
8
|
export interface StepsProps {
|
|
8
9
|
current?: number;
|
|
9
10
|
items?: StepItem[];
|
|
10
11
|
direction?: 'horizontal' | 'vertical';
|
|
12
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
13
|
className?: string;
|
|
12
14
|
style?: React.CSSProperties;
|
|
13
15
|
}
|
|
@@ -1,84 +1,109 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { tokens } from '../tokens';
|
|
4
|
-
export const Steps = ({ current = 0, items = [], direction = 'horizontal', className = '', style = {}, }) => {
|
|
5
|
-
const containerStyle = {
|
|
6
|
-
display: 'flex',
|
|
7
|
-
flexDirection: direction === 'vertical' ? 'column' : 'row',
|
|
8
|
-
gap: tokens.spacing['4'],
|
|
9
|
-
width: '100%',
|
|
10
|
-
...style,
|
|
11
|
-
};
|
|
12
|
-
return (_jsx("div", { style: containerStyle, className: className, children: items.map((item, index) => {
|
|
13
|
-
const status = index < current ? 'finish' : index === current ? 'process' : 'wait';
|
|
14
|
-
return (_jsx(React.Fragment, { children: _jsx(StepItemComponent, { index: index, status: status, title: item.title, description: item.description, direction: direction, isLast: index === items.length - 1 }) }, index));
|
|
15
|
-
}) }));
|
|
16
|
-
};
|
|
17
3
|
const getColors = (status) => {
|
|
18
4
|
switch (status) {
|
|
19
5
|
case 'finish':
|
|
20
|
-
return { main: tokens.color.primary, bg: tokens.color.primaryLight, text: tokens.color.primary };
|
|
6
|
+
return { main: tokens.color.primary, bg: tokens.color.primaryLight, text: tokens.color.primary, line: tokens.color.primary };
|
|
21
7
|
case 'process':
|
|
22
|
-
return { main: tokens.color.primary, bg: tokens.color.primary, text: '#ffffff' };
|
|
8
|
+
return { main: tokens.color.primary, bg: tokens.color.primary, text: '#ffffff', line: tokens.color.slate200 };
|
|
9
|
+
case 'error':
|
|
10
|
+
return { main: tokens.color.danger, bg: tokens.color.dangerBg, text: tokens.color.danger, line: tokens.color.slate200 };
|
|
23
11
|
case 'wait':
|
|
24
12
|
default:
|
|
25
|
-
return { main: tokens.color.
|
|
13
|
+
return { main: tokens.color.slate300, bg: tokens.color.slate50, text: tokens.color.slate400, line: tokens.color.slate200 };
|
|
26
14
|
}
|
|
27
15
|
};
|
|
28
|
-
const
|
|
16
|
+
const ICON_SIZE = { sm: '28px', md: '36px', lg: '44px' };
|
|
17
|
+
const FONT_SIZE = { sm: tokens.font.xs, md: tokens.font.sm, lg: tokens.font.base };
|
|
18
|
+
export const Steps = ({ current = 0, items = [], direction = 'horizontal', size = 'md', className = '', style = {}, }) => {
|
|
19
|
+
const isVertical = direction === 'vertical';
|
|
20
|
+
return (_jsx("div", { style: {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexDirection: isVertical ? 'column' : 'row',
|
|
23
|
+
gap: 0,
|
|
24
|
+
width: '100%',
|
|
25
|
+
...style,
|
|
26
|
+
}, className: `ds-steps ds-steps--${direction} ${className}`, children: items.map((item, index) => {
|
|
27
|
+
const status = index < current ? 'finish' : index === current ? 'process' : 'wait';
|
|
28
|
+
return (_jsx(StepItemComponent, { index: index, status: status, title: item.title, description: item.description, icon: item.icon, direction: direction, isLast: index === items.length - 1, size: size }, index));
|
|
29
|
+
}) }));
|
|
30
|
+
};
|
|
31
|
+
const StepItemComponent = ({ index, status, title, description, icon, direction, isLast, size, }) => {
|
|
29
32
|
const isHorizontal = direction === 'horizontal';
|
|
30
33
|
const c = getColors(status);
|
|
31
|
-
const
|
|
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
|
-
|
|
34
|
+
const iconSize = ICON_SIZE[size] || ICON_SIZE.md;
|
|
35
|
+
const iconSizePx = parseInt(iconSize);
|
|
36
|
+
const fontSize = FONT_SIZE[size] || tokens.font.sm;
|
|
37
|
+
const CheckIcon = () => (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polyline", { points: "20 6 9 17 4 12" }) }));
|
|
38
|
+
const ErrorIcon = () => (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "round", children: _jsx("path", { d: "M18 6L6 18M6 6l12 12" }) }));
|
|
39
|
+
return (_jsxs("div", { style: {
|
|
40
|
+
display: 'flex',
|
|
41
|
+
flexDirection: isHorizontal ? 'column' : 'row',
|
|
42
|
+
flex: isHorizontal ? (isLast ? 'none' : 1) : 'none',
|
|
43
|
+
alignItems: isHorizontal ? 'center' : 'flex-start',
|
|
44
|
+
position: 'relative',
|
|
45
|
+
}, children: [!isLast && (_jsx("div", { style: {
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
backgroundColor: 'transparent',
|
|
48
|
+
zIndex: 1,
|
|
49
|
+
...(isHorizontal
|
|
50
|
+
? {
|
|
51
|
+
height: '2px',
|
|
52
|
+
top: `${iconSizePx / 2}px`,
|
|
53
|
+
left: `calc(50% + ${iconSizePx / 2 + 4}px)`,
|
|
54
|
+
right: `calc(-50% + ${iconSizePx / 2 + 4}px)`,
|
|
55
|
+
background: status === 'finish'
|
|
56
|
+
? `linear-gradient(to right, ${tokens.color.primary}, ${tokens.color.primaryLight})`
|
|
57
|
+
: tokens.color.slate200,
|
|
58
|
+
}
|
|
59
|
+
: {
|
|
60
|
+
width: '2px',
|
|
61
|
+
left: `${iconSizePx / 2 - 1}px`,
|
|
62
|
+
top: `${iconSizePx + 6}px`,
|
|
63
|
+
height: '32px',
|
|
64
|
+
background: status === 'finish'
|
|
65
|
+
? `linear-gradient(to bottom, ${tokens.color.primary}, ${tokens.color.primaryLight})`
|
|
66
|
+
: tokens.color.slate200,
|
|
67
|
+
}),
|
|
68
|
+
} })), _jsx("div", { style: {
|
|
69
|
+
width: iconSize,
|
|
70
|
+
height: iconSize,
|
|
71
|
+
borderRadius: '50%',
|
|
72
|
+
display: 'flex',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
justifyContent: 'center',
|
|
75
|
+
border: `2px solid ${c.main}`,
|
|
76
|
+
backgroundColor: c.bg,
|
|
77
|
+
color: c.text,
|
|
78
|
+
fontSize,
|
|
79
|
+
fontWeight: tokens.font.weightBold,
|
|
80
|
+
zIndex: 2,
|
|
81
|
+
flexShrink: 0,
|
|
82
|
+
transition: tokens.transition.normal,
|
|
83
|
+
boxShadow: status === 'process'
|
|
84
|
+
? `0 0 0 4px ${tokens.color.primaryLight}`
|
|
85
|
+
: 'none',
|
|
86
|
+
marginBottom: isHorizontal ? tokens.spacing['2'] : 0,
|
|
87
|
+
marginRight: !isHorizontal ? tokens.spacing['3'] : 0,
|
|
88
|
+
}, children: icon ? icon : status === 'finish' ? _jsx(CheckIcon, {}) : status === 'error' ? _jsx(ErrorIcon, {}) : index + 1 }), _jsxs("div", { style: {
|
|
75
89
|
textAlign: isHorizontal ? 'center' : 'left',
|
|
76
|
-
|
|
77
|
-
|
|
90
|
+
paddingTop: !isHorizontal ? '6px' : 0,
|
|
91
|
+
paddingBottom: !isHorizontal && !isLast ? tokens.spacing['8'] : 0,
|
|
78
92
|
}, children: [_jsx("div", { style: {
|
|
79
|
-
fontSize
|
|
80
|
-
fontWeight: status === 'process' ? tokens.font.weightBold : tokens.font.
|
|
81
|
-
color: status === 'wait' ? tokens.color.
|
|
82
|
-
|
|
93
|
+
fontSize,
|
|
94
|
+
fontWeight: status === 'process' ? tokens.font.weightBold : tokens.font.weightSemibold,
|
|
95
|
+
color: status === 'wait' ? tokens.color.textDisabled :
|
|
96
|
+
status === 'error' ? tokens.color.danger :
|
|
97
|
+
status === 'process' ? tokens.color.primary :
|
|
98
|
+
tokens.color.text,
|
|
99
|
+
lineHeight: 1.35,
|
|
100
|
+
transition: tokens.transition.fast,
|
|
101
|
+
}, children: title }), description && (_jsx("div", { style: {
|
|
102
|
+
fontSize: tokens.font.xs,
|
|
103
|
+
color: tokens.color.textMuted,
|
|
104
|
+
marginTop: '3px',
|
|
105
|
+
fontWeight: tokens.font.weightMedium,
|
|
106
|
+
lineHeight: 1.4,
|
|
107
|
+
}, children: description }))] })] }));
|
|
83
108
|
};
|
|
84
109
|
//# sourceMappingURL=Steps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.js","sourceRoot":"","sources":["../../../src/components/Steps.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Steps.js","sourceRoot":"","sources":["../../../src/components/Steps.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAqBnC,MAAM,SAAS,GAAG,CAAC,MAAkB,EAAc,EAAE;IACnD,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAC/H,KAAK,SAAS;YACZ,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,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CAAC;wCAC7C,MAAM,CAAC,KAAK,CAAC,IAAI;4BACnB,UAAU,EAAE,IAAI;4BAChB,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI;yBACnC,YAEA,KAAK,GACF,EACL,WAAW,IAAI,CACd,cAAK,KAAK,EAAE;4BACV,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;4BACxB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS;4BAC7B,SAAS,EAAE,KAAK;4BAChB,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY;4BACpC,UAAU,EAAE,GAAG;yBAChB,YACE,WAAW,GACR,CACP,IACG,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export interface SwitchProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
-
label?:
|
|
2
|
+
export interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
3
|
+
label?: React.ReactNode;
|
|
4
|
+
labelPlacement?: 'start' | 'end';
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
color?: 'primary' | 'success' | 'warning' | 'danger';
|
|
7
|
+
description?: string;
|
|
4
8
|
}
|
|
5
9
|
export declare const Switch: React.FC<SwitchProps>;
|
|
@@ -1,39 +1,62 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tokens } from '../tokens';
|
|
3
|
-
|
|
3
|
+
const SIZE_CONFIG = {
|
|
4
|
+
sm: { trackW: '34px', trackH: '18px', thumbSize: '14px', thumbOn: '18px', thumbOff: '2px' },
|
|
5
|
+
md: { trackW: '44px', trackH: '24px', thumbSize: '20px', thumbOn: '22px', thumbOff: '2px' },
|
|
6
|
+
lg: { trackW: '54px', trackH: '30px', thumbSize: '26px', thumbOn: '26px', thumbOff: '2px' },
|
|
7
|
+
};
|
|
8
|
+
const COLOR_MAP = {
|
|
9
|
+
primary: tokens.color.primary,
|
|
10
|
+
success: tokens.color.success,
|
|
11
|
+
warning: tokens.color.warning,
|
|
12
|
+
danger: tokens.color.danger,
|
|
13
|
+
};
|
|
14
|
+
export const Switch = ({ checked, onChange, disabled = false, label, labelPlacement = 'end', size = 'md', color = 'primary', description, className = '', style = {}, ...props }) => {
|
|
15
|
+
const sc = SIZE_CONFIG[size] || SIZE_CONFIG.md;
|
|
16
|
+
const activeColor = COLOR_MAP[color] || tokens.color.primary;
|
|
4
17
|
const containerStyle = {
|
|
5
18
|
display: 'inline-flex',
|
|
6
|
-
alignItems: 'center',
|
|
19
|
+
alignItems: description ? 'flex-start' : 'center',
|
|
20
|
+
flexDirection: labelPlacement === 'start' ? 'row-reverse' : 'row',
|
|
7
21
|
gap: tokens.spacing[3],
|
|
8
22
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
9
|
-
opacity: disabled ? 0.
|
|
10
|
-
|
|
23
|
+
opacity: disabled ? 0.55 : 1,
|
|
24
|
+
userSelect: 'none',
|
|
25
|
+
...style,
|
|
11
26
|
};
|
|
12
27
|
const trackStyle = {
|
|
13
28
|
position: 'relative',
|
|
14
|
-
width:
|
|
15
|
-
height:
|
|
16
|
-
backgroundColor: checked ?
|
|
29
|
+
width: sc.trackW,
|
|
30
|
+
height: sc.trackH,
|
|
31
|
+
backgroundColor: checked ? activeColor : tokens.color.slate200,
|
|
17
32
|
borderRadius: tokens.radius.full,
|
|
18
|
-
transition:
|
|
19
|
-
flexShrink: 0
|
|
33
|
+
transition: 'background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
|
|
34
|
+
flexShrink: 0,
|
|
35
|
+
boxShadow: checked
|
|
36
|
+
? `0 0 0 3px ${activeColor}20`
|
|
37
|
+
: 'inset 0 1px 2px rgba(0,0,0,0.1)',
|
|
20
38
|
};
|
|
21
39
|
const thumbStyle = {
|
|
22
40
|
position: 'absolute',
|
|
23
|
-
top:
|
|
24
|
-
left: checked ?
|
|
25
|
-
width:
|
|
26
|
-
height:
|
|
27
|
-
backgroundColor: '
|
|
41
|
+
top: `calc(50% - ${sc.thumbSize} / 2)`,
|
|
42
|
+
left: checked ? sc.thumbOn : sc.thumbOff,
|
|
43
|
+
width: sc.thumbSize,
|
|
44
|
+
height: sc.thumbSize,
|
|
45
|
+
backgroundColor: '#ffffff',
|
|
28
46
|
borderRadius: '50%',
|
|
29
|
-
transition:
|
|
30
|
-
boxShadow: '0 1px
|
|
47
|
+
transition: 'left 0.2s cubic-bezier(0.34, 1.56, 0.64, 1)',
|
|
48
|
+
boxShadow: '0 1px 4px rgba(0,0,0,0.25), 0 0 0 0.5px rgba(0,0,0,0.06)',
|
|
31
49
|
};
|
|
32
|
-
return (_jsxs("label", { style: containerStyle, className: className
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
50
|
+
return (_jsxs("label", { style: containerStyle, className: `ds-switch ${className}`, children: [_jsxs("div", { style: { position: 'relative', flexShrink: 0 }, children: [_jsx("input", { type: "checkbox", checked: checked, onChange: onChange, disabled: disabled, style: { position: 'absolute', opacity: 0, width: 0, height: 0 }, ...props }), _jsx("div", { style: trackStyle, children: _jsx("div", { style: thumbStyle }) })] }), (label || description) && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '2px' }, children: [label && (_jsx("span", { style: {
|
|
51
|
+
fontSize: tokens.font.sm,
|
|
52
|
+
fontWeight: tokens.font.weightSemibold,
|
|
53
|
+
color: disabled ? tokens.color.textDisabled : tokens.color.text,
|
|
54
|
+
lineHeight: 1.4,
|
|
55
|
+
}, children: label })), description && (_jsx("span", { style: {
|
|
56
|
+
fontSize: '11px',
|
|
57
|
+
fontWeight: tokens.font.weightMedium,
|
|
58
|
+
color: tokens.color.textMuted,
|
|
59
|
+
lineHeight: 1.4,
|
|
60
|
+
}, children: description }))] }))] }));
|
|
38
61
|
};
|
|
39
62
|
//# sourceMappingURL=Switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/components/Switch.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/components/Switch.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAUnC,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;IAC3F,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;IAC3F,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;CAC5F,CAAC;AAEF,MAAM,SAAS,GAA2B;IACxC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;IAC7B,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;IAC7B,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;IAC7B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAC5C,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,cAAc,GAAG,KAAK,EACtB,IAAI,GAAG,IAAI,EACX,KAAK,GAAG,SAAS,EACjB,WAAW,EACX,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,EAAE,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EAAE,MAAM;4BAChB,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY;4BACpC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS;4BAC7B,UAAU,EAAE,GAAG;yBAChB,YACE,WAAW,GACP,CACR,IACG,CACP,IACK,CACT,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -3,7 +3,9 @@ export interface TableColumn<T = any> {
|
|
|
3
3
|
key: string | number;
|
|
4
4
|
label: React.ReactNode;
|
|
5
5
|
width?: string | number;
|
|
6
|
+
minWidth?: string;
|
|
6
7
|
align?: 'left' | 'center' | 'right';
|
|
8
|
+
sortable?: boolean;
|
|
7
9
|
render?: (value: any, record: T, index: number) => React.ReactNode;
|
|
8
10
|
headerStyle?: React.CSSProperties;
|
|
9
11
|
cellStyle?: React.CSSProperties;
|
|
@@ -17,10 +19,16 @@ export interface TableProps<T = any> {
|
|
|
17
19
|
headerStyle?: React.CSSProperties;
|
|
18
20
|
rowStyle?: React.CSSProperties | ((record: T, index: number) => React.CSSProperties);
|
|
19
21
|
emptyText?: React.ReactNode;
|
|
22
|
+
striped?: boolean;
|
|
23
|
+
bordered?: boolean;
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
rowKey?: string | ((record: T) => string | number);
|
|
26
|
+
activeKey?: string | number;
|
|
20
27
|
}
|
|
21
|
-
export declare const Table: <T extends Record<string, any>>({ columns, data, onRowClick, className, style, headerStyle, rowStyle, emptyText, }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const Table: <T extends Record<string, any>>({ columns, data, onRowClick, className, style, headerStyle, rowStyle, emptyText, striped, bordered, loading, rowKey, activeKey, }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
22
29
|
export interface TableContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
30
|
children: React.ReactNode;
|
|
31
|
+
bordered?: boolean;
|
|
24
32
|
}
|
|
25
33
|
export declare const TableContainer: React.FC<TableContainerProps>;
|
|
26
34
|
export interface THeadProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|