shared-design-system 1.79.0 → 1.81.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/Button.d.ts +4 -3
- package/dist/src/components/Button.js +71 -41
- package/dist/src/components/Button.js.map +1 -1
- package/dist/src/components/Timeline.d.ts +3 -3
- package/dist/src/components/Timeline.js +33 -24
- package/dist/src/components/Timeline.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
-
variant?:
|
|
4
|
-
size?:
|
|
3
|
+
variant?: "primary" | "secondary" | "danger" | "ghost" | "amber" | "success" | "outline";
|
|
4
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
5
5
|
isActive?: boolean;
|
|
6
6
|
startIcon?: React.ReactNode;
|
|
7
7
|
endIcon?: React.ReactNode;
|
|
8
8
|
icon?: React.ReactNode;
|
|
9
9
|
loading?: boolean;
|
|
10
10
|
fullWidth?: boolean;
|
|
11
|
+
isIconButton?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from
|
|
3
|
-
import { tokens } from
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { tokens } from "../tokens";
|
|
4
4
|
// Brand red = #BE1128 → rgba(190,17,40,...)
|
|
5
5
|
// Brand yellow = #FFC20E → rgba(255,194,14,...)
|
|
6
6
|
const VARIANT_STYLES = {
|
|
7
7
|
primary: {
|
|
8
8
|
bg: tokens.color.primary,
|
|
9
|
-
color:
|
|
9
|
+
color: "#ffffff",
|
|
10
10
|
border: `1px solid ${tokens.color.primary}`,
|
|
11
11
|
shadow: tokens.shadow.sm,
|
|
12
12
|
hoverBg: tokens.color.primaryDark,
|
|
13
|
-
hoverColor:
|
|
13
|
+
hoverColor: "#ffffff",
|
|
14
14
|
hoverBorder: `1px solid ${tokens.color.primaryDark}`,
|
|
15
15
|
hoverShadow: tokens.shadow.md,
|
|
16
16
|
},
|
|
@@ -18,7 +18,7 @@ const VARIANT_STYLES = {
|
|
|
18
18
|
bg: tokens.color.white,
|
|
19
19
|
color: tokens.color.slate700,
|
|
20
20
|
border: `1px solid ${tokens.color.slate300}`,
|
|
21
|
-
shadow:
|
|
21
|
+
shadow: "none",
|
|
22
22
|
hoverBg: tokens.color.slate50,
|
|
23
23
|
hoverColor: tokens.color.slate900,
|
|
24
24
|
hoverBorder: `1px solid ${tokens.color.slate400}`,
|
|
@@ -26,7 +26,7 @@ const VARIANT_STYLES = {
|
|
|
26
26
|
},
|
|
27
27
|
danger: {
|
|
28
28
|
bg: tokens.color.danger,
|
|
29
|
-
color:
|
|
29
|
+
color: "#ffffff",
|
|
30
30
|
border: `1px solid ${tokens.color.danger}`,
|
|
31
31
|
shadow: tokens.shadow.sm,
|
|
32
32
|
hoverBg: tokens.color.dangerBg,
|
|
@@ -36,7 +36,7 @@ const VARIANT_STYLES = {
|
|
|
36
36
|
},
|
|
37
37
|
success: {
|
|
38
38
|
bg: tokens.color.success,
|
|
39
|
-
color:
|
|
39
|
+
color: "#ffffff",
|
|
40
40
|
border: `1px solid ${tokens.color.success}`,
|
|
41
41
|
shadow: tokens.shadow.sm,
|
|
42
42
|
hoverBg: tokens.color.successBg,
|
|
@@ -46,43 +46,63 @@ const VARIANT_STYLES = {
|
|
|
46
46
|
},
|
|
47
47
|
amber: {
|
|
48
48
|
bg: tokens.color.accent,
|
|
49
|
-
color:
|
|
49
|
+
color: "#212B36",
|
|
50
50
|
border: `1px solid ${tokens.color.accent}`,
|
|
51
51
|
shadow: tokens.shadow.sm,
|
|
52
52
|
hoverBg: tokens.color.accentDark,
|
|
53
|
-
hoverColor:
|
|
53
|
+
hoverColor: "#212B36",
|
|
54
54
|
hoverBorder: `1px solid ${tokens.color.accentDark}`,
|
|
55
55
|
hoverShadow: tokens.shadow.md,
|
|
56
56
|
},
|
|
57
57
|
ghost: {
|
|
58
|
-
bg:
|
|
58
|
+
bg: "transparent",
|
|
59
59
|
color: tokens.color.textMuted,
|
|
60
|
-
border:
|
|
61
|
-
shadow:
|
|
62
|
-
hoverBg:
|
|
60
|
+
border: "1px solid transparent",
|
|
61
|
+
shadow: "none",
|
|
62
|
+
hoverBg: "rgba(0, 0, 0, 0.04)",
|
|
63
63
|
hoverColor: tokens.color.text,
|
|
64
|
-
hoverBorder:
|
|
65
|
-
hoverShadow:
|
|
64
|
+
hoverBorder: "1px solid transparent",
|
|
65
|
+
hoverShadow: "none",
|
|
66
66
|
},
|
|
67
67
|
outline: {
|
|
68
|
-
bg:
|
|
68
|
+
bg: "transparent",
|
|
69
69
|
color: tokens.color.primary,
|
|
70
70
|
border: `1px solid ${tokens.color.primary}`,
|
|
71
|
-
shadow:
|
|
72
|
-
hoverBg:
|
|
71
|
+
shadow: "none",
|
|
72
|
+
hoverBg: "rgba(232, 83, 10, 0.04)",
|
|
73
73
|
hoverColor: tokens.color.primary,
|
|
74
74
|
hoverBorder: `1px solid ${tokens.color.primary}`,
|
|
75
|
-
hoverShadow:
|
|
75
|
+
hoverShadow: "none",
|
|
76
76
|
},
|
|
77
77
|
};
|
|
78
78
|
const SIZE_STYLES = {
|
|
79
|
-
xs: {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
xs: {
|
|
80
|
+
padding: "2px 10px",
|
|
81
|
+
fontSize: "11px",
|
|
82
|
+
height: "26px",
|
|
83
|
+
borderRadius: tokens.radius.md,
|
|
84
|
+
},
|
|
85
|
+
sm: {
|
|
86
|
+
padding: `4px ${tokens.spacing[4]}`,
|
|
87
|
+
fontSize: "12px",
|
|
88
|
+
height: "32px",
|
|
89
|
+
borderRadius: tokens.radius.md,
|
|
90
|
+
},
|
|
91
|
+
md: {
|
|
92
|
+
padding: `${tokens.spacing[2]} ${tokens.spacing[6]}`,
|
|
93
|
+
fontSize: tokens.font.sm,
|
|
94
|
+
height: "40px",
|
|
95
|
+
borderRadius: tokens.radius.lg,
|
|
96
|
+
},
|
|
97
|
+
lg: {
|
|
98
|
+
padding: `${tokens.spacing[3]} ${tokens.spacing[8]}`,
|
|
99
|
+
fontSize: tokens.font.md,
|
|
100
|
+
height: "48px",
|
|
101
|
+
borderRadius: tokens.radius.xl,
|
|
102
|
+
},
|
|
83
103
|
};
|
|
84
|
-
const SpinnerInline = ({ color }) => (_jsxs("svg", { width: "14", height: "14", viewBox: "0 0 50 50", style: { animation:
|
|
85
|
-
export const Button = React.forwardRef(({ children, variant =
|
|
104
|
+
const SpinnerInline = ({ color }) => (_jsxs("svg", { width: "14", height: "14", viewBox: "0 0 50 50", style: { animation: "ds-spin 0.7s linear infinite", flexShrink: 0 }, children: [_jsx("circle", { cx: "25", cy: "25", r: "20", fill: "none", stroke: color, strokeWidth: "5", strokeDasharray: "80,150", strokeLinecap: "round" }), _jsx("style", { children: `@keyframes ds-spin { to { transform: rotate(360deg); }}` })] }));
|
|
105
|
+
export const Button = React.forwardRef(({ children, variant = "primary", size = "md", disabled = false, loading = false, fullWidth = false, onClick, style = {}, className = "", isActive = false, startIcon, endIcon, icon, isIconButton = false, ...props }, ref) => {
|
|
86
106
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
87
107
|
const vs = VARIANT_STYLES[variant] || VARIANT_STYLES.primary;
|
|
88
108
|
const ss = SIZE_STYLES[size] || SIZE_STYLES.md;
|
|
@@ -92,27 +112,37 @@ export const Button = React.forwardRef(({ children, variant = 'primary', size =
|
|
|
92
112
|
fontFamily: tokens.font.family,
|
|
93
113
|
fontWeight: tokens.font.weightSemibold,
|
|
94
114
|
...ss,
|
|
95
|
-
cursor: isEffectivelyDisabled ?
|
|
96
|
-
transition:
|
|
97
|
-
display: fullWidth ?
|
|
98
|
-
width: fullWidth ?
|
|
99
|
-
alignItems:
|
|
100
|
-
justifyContent:
|
|
101
|
-
gap: tokens.spacing[2],
|
|
102
|
-
outline:
|
|
103
|
-
userSelect:
|
|
115
|
+
cursor: isEffectivelyDisabled ? "not-allowed" : "pointer",
|
|
116
|
+
transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
117
|
+
display: fullWidth || isIconButton ? "flex" : "inline-flex",
|
|
118
|
+
width: fullWidth || isIconButton ? "100%" : undefined,
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
justifyContent: "center",
|
|
121
|
+
gap: isIconButton ? 0 : tokens.spacing[2],
|
|
122
|
+
outline: "none",
|
|
123
|
+
userSelect: "none",
|
|
104
124
|
opacity: isEffectivelyDisabled ? 0.5 : 1,
|
|
105
125
|
backgroundColor: showHover ? vs.hoverBg : vs.bg,
|
|
106
126
|
color: showHover ? vs.hoverColor : vs.color,
|
|
107
127
|
border: showHover ? vs.hoverBorder : vs.border,
|
|
108
|
-
boxShadow:
|
|
109
|
-
transform:
|
|
110
|
-
whiteSpace:
|
|
111
|
-
letterSpacing:
|
|
112
|
-
position:
|
|
128
|
+
boxShadow: "none",
|
|
129
|
+
transform: "none",
|
|
130
|
+
whiteSpace: "nowrap",
|
|
131
|
+
letterSpacing: "0.01em",
|
|
132
|
+
position: "relative",
|
|
113
133
|
...style,
|
|
114
134
|
};
|
|
115
|
-
|
|
135
|
+
if (isIconButton) {
|
|
136
|
+
baseStyle.width = ss.height;
|
|
137
|
+
baseStyle.padding = "0";
|
|
138
|
+
baseStyle.flexShrink = 0;
|
|
139
|
+
}
|
|
140
|
+
return (_jsxs("button", { ref: ref, style: baseStyle, className: `ds-button ds-button--${variant} ds-button--${size} ${className} ${isIconButton ? "ds-button--icon" : ""}`, disabled: isEffectivelyDisabled, onClick: isEffectivelyDisabled ? undefined : onClick, onMouseEnter: () => !isEffectivelyDisabled && setIsHovered(true), onMouseLeave: () => !isEffectivelyDisabled && setIsHovered(false), "aria-busy": loading, "aria-disabled": isEffectivelyDisabled, ...props, children: [loading ? (_jsx(SpinnerInline, { color: showHover ? vs.hoverColor : vs.color })) : ((startIcon || icon) && (_jsx("span", { style: { display: "flex", alignItems: "center", flexShrink: 0 }, children: startIcon || icon }))), !isIconButton && (_jsx("span", { style: {
|
|
141
|
+
opacity: loading ? 0 : 1,
|
|
142
|
+
display: "inline-flex",
|
|
143
|
+
alignItems: "center",
|
|
144
|
+
gap: tokens.spacing[2],
|
|
145
|
+
}, children: children })), !loading && endIcon && !isIconButton && (_jsx("span", { style: { display: "flex", alignItems: "center", flexShrink: 0 }, children: endIcon }))] }));
|
|
116
146
|
});
|
|
117
|
-
Button.displayName =
|
|
147
|
+
Button.displayName = "Button";
|
|
118
148
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAiCnC,4CAA4C;AAC5C,gDAAgD;AAChD,MAAM,cAAc,GAAiC;IACnD,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;QACxB,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,aAAa,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE;QAC3C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE;QACxB,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW;QACjC,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,aAAa,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE;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eACtD,OAAO,mBACH,qBAAqB,KAChC,KAAK,aAER,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,aAAa,IAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,GAAI,CAC/D,CAAC,CAAC,CAAC,CACF,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,CACrB,eACE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,EAAE,YAE9D,SAAS,IAAI,IAAI,GACb,CACR,CACF,EACA,CAAC,YAAY,IAAI,CAChB,eACE,KAAK,EAAE;oBACL,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACxB,OAAO,EAAE,aAAa;oBACtB,UAAU,EAAE,QAAQ;oBACpB,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;iBACvB,YAEA,QAAQ,GACJ,CACR,EACA,CAAC,OAAO,IAAI,OAAO,IAAI,CAAC,YAAY,IAAI,CACvC,eACE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,EAAE,YAE9D,OAAO,GACH,CACR,IACM,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
export interface TimelineItem {
|
|
3
3
|
label?: React.ReactNode;
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
dot?: React.ReactNode;
|
|
6
|
-
color?:
|
|
6
|
+
color?: "primary" | "success" | "warning" | "danger" | "info" | "gray";
|
|
7
7
|
}
|
|
8
8
|
export interface TimelineProps {
|
|
9
9
|
items: TimelineItem[];
|
|
10
|
-
mode?:
|
|
10
|
+
mode?: "left" | "alternate";
|
|
11
11
|
}
|
|
12
12
|
export declare const Timeline: any;
|
|
13
13
|
export declare const TimelineItem: React.FC<TimelineItem>;
|
|
@@ -1,35 +1,44 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React from
|
|
3
|
-
import { tokens } from
|
|
4
|
-
export const Timeline = React.forwardRef(({ items, mode =
|
|
5
|
-
return (_jsx("div", { ref: ref, style: { display:
|
|
6
|
-
display:
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { tokens } from "../tokens";
|
|
4
|
+
export const Timeline = React.forwardRef(({ items, mode = "left" }, ref) => {
|
|
5
|
+
return (_jsx("div", { ref: ref, style: { display: "flex", flexDirection: "column" }, className: "ds-timeline", children: items.map((item, index) => (_jsxs("div", { style: {
|
|
6
|
+
display: "flex",
|
|
7
7
|
gap: tokens.spacing[4],
|
|
8
|
-
position:
|
|
9
|
-
paddingBottom: index === items.length - 1 ? 0 : tokens.spacing[8],
|
|
8
|
+
position: "relative",
|
|
9
|
+
// paddingBottom: index === items.length - 1 ? 0 : tokens.spacing[8],
|
|
10
10
|
}, children: [item.label && (_jsx("div", { style: {
|
|
11
|
-
width:
|
|
12
|
-
textAlign:
|
|
13
|
-
fontSize:
|
|
11
|
+
width: "100px",
|
|
12
|
+
textAlign: "right",
|
|
13
|
+
fontSize: "12px",
|
|
14
14
|
color: tokens.color.slate400,
|
|
15
|
-
paddingTop:
|
|
16
|
-
}, children: item.label })), _jsxs("div", { style: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
paddingTop: "2px",
|
|
16
|
+
}, children: item.label })), _jsxs("div", { style: {
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
position: "relative",
|
|
21
|
+
}, children: [_jsx("div", { style: {
|
|
22
|
+
width: "12px",
|
|
23
|
+
height: "12px",
|
|
24
|
+
borderRadius: "50%",
|
|
25
|
+
border: `2px solid ${tokens.color[item.color || "primary"] ||
|
|
26
|
+
tokens.color.primary}`,
|
|
21
27
|
backgroundColor: tokens.color.white,
|
|
22
28
|
zIndex: 1,
|
|
23
|
-
marginTop:
|
|
29
|
+
marginTop: "4px",
|
|
24
30
|
}, children: item.dot }), index < items.length - 1 && (_jsx("div", { style: {
|
|
25
|
-
position:
|
|
26
|
-
top:
|
|
27
|
-
bottom:
|
|
28
|
-
width:
|
|
31
|
+
position: "absolute",
|
|
32
|
+
top: "16px",
|
|
33
|
+
bottom: "-2px",
|
|
34
|
+
width: "2px",
|
|
29
35
|
backgroundColor: tokens.color.slate100,
|
|
30
|
-
} }))] }), _jsx("div", { style: { flex: 1, paddingTop:
|
|
36
|
+
} }))] }), _jsx("div", { style: { flex: 1, paddingTop: "1px" }, children: _jsx("div", { style: {
|
|
37
|
+
fontSize: tokens.font.sm,
|
|
38
|
+
color: tokens.color.slate700,
|
|
39
|
+
}, children: item.children }) })] }, index))) }));
|
|
31
40
|
});
|
|
32
|
-
Timeline.displayName =
|
|
33
|
-
export const TimelineItem = ({ children }) => _jsx(_Fragment, { children: children });
|
|
41
|
+
Timeline.displayName = "Timeline";
|
|
42
|
+
export const TimelineItem = ({ children }) => (_jsx(_Fragment, { children: children }));
|
|
34
43
|
Timeline.Item = TimelineItem;
|
|
35
44
|
//# sourceMappingURL=Timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.js","sourceRoot":"","sources":["../../../src/components/Timeline.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAcnC,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CACtC,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE;IAChC,OAA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