shared-design-system 1.12.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 -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/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
|
@@ -1,43 +1,121 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { tokens } from '../tokens';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
const COLOR_SCHEMES = {
|
|
4
|
+
primary: {
|
|
5
|
+
bg: tokens.color.primary,
|
|
6
|
+
text: '#fff',
|
|
7
|
+
lightBg: tokens.color.primaryLight,
|
|
8
|
+
lightText: tokens.color.primary,
|
|
9
|
+
border: 'rgba(37, 99, 235, 0.2)',
|
|
10
|
+
},
|
|
11
|
+
success: {
|
|
12
|
+
bg: tokens.color.success,
|
|
13
|
+
text: '#fff',
|
|
14
|
+
lightBg: tokens.color.successBg,
|
|
15
|
+
lightText: tokens.color.success,
|
|
16
|
+
border: 'rgba(5, 150, 105, 0.2)',
|
|
17
|
+
},
|
|
18
|
+
warning: {
|
|
19
|
+
bg: tokens.color.warning,
|
|
20
|
+
text: '#fff',
|
|
21
|
+
lightBg: tokens.color.warningBg,
|
|
22
|
+
lightText: '#b45309',
|
|
23
|
+
border: 'rgba(245, 158, 11, 0.2)',
|
|
24
|
+
},
|
|
25
|
+
danger: {
|
|
26
|
+
bg: tokens.color.danger,
|
|
27
|
+
text: '#fff',
|
|
28
|
+
lightBg: tokens.color.dangerBg,
|
|
29
|
+
lightText: tokens.color.danger,
|
|
30
|
+
border: 'rgba(220, 38, 38, 0.2)',
|
|
31
|
+
},
|
|
32
|
+
info: {
|
|
33
|
+
bg: tokens.color.info,
|
|
34
|
+
text: '#fff',
|
|
35
|
+
lightBg: tokens.color.infoBg,
|
|
36
|
+
lightText: tokens.color.info,
|
|
37
|
+
border: 'rgba(59, 130, 246, 0.2)',
|
|
38
|
+
},
|
|
39
|
+
premium: {
|
|
40
|
+
bg: '#7c3aed',
|
|
41
|
+
text: '#fff',
|
|
42
|
+
lightBg: '#f5f3ff',
|
|
43
|
+
lightText: '#7c3aed',
|
|
44
|
+
border: '#ede9fe',
|
|
45
|
+
},
|
|
46
|
+
gold: {
|
|
47
|
+
bg: '#b45309',
|
|
48
|
+
text: '#fff',
|
|
49
|
+
lightBg: '#fffbeb',
|
|
50
|
+
lightText: '#92400e',
|
|
51
|
+
border: '#fde68a',
|
|
52
|
+
},
|
|
53
|
+
slate: {
|
|
54
|
+
bg: tokens.color.slate700,
|
|
55
|
+
text: '#fff',
|
|
56
|
+
lightBg: tokens.color.slate100,
|
|
57
|
+
lightText: tokens.color.slate600,
|
|
58
|
+
border: tokens.color.slate200,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export const Tag = ({ children, color = 'slate', variant = 'subtle', size = 'md', className = '', style = {}, onClose, icon, clickable = false, onClick, ...props }) => {
|
|
62
|
+
const c = COLOR_SCHEMES[color] || COLOR_SCHEMES.slate;
|
|
63
|
+
const isGradient = variant === 'gradient';
|
|
64
|
+
const backgroundStyle = () => {
|
|
65
|
+
if (isGradient && color === 'premium') {
|
|
66
|
+
return { background: 'linear-gradient(135deg, #7c3aed 0%, #db2777 100%)', color: '#fff' };
|
|
67
|
+
}
|
|
68
|
+
if (isGradient && color === 'gold') {
|
|
69
|
+
return { background: 'linear-gradient(135deg, #f59e0b 0%, #ef4444 100%)', color: '#fff' };
|
|
70
|
+
}
|
|
71
|
+
if (variant === 'solid' || isGradient) {
|
|
72
|
+
return { backgroundColor: c.bg, color: c.text };
|
|
73
|
+
}
|
|
74
|
+
if (variant === 'outline') {
|
|
75
|
+
return { backgroundColor: 'transparent', color: c.lightText };
|
|
14
76
|
}
|
|
77
|
+
return { backgroundColor: c.lightBg, color: c.lightText };
|
|
15
78
|
};
|
|
16
|
-
const
|
|
79
|
+
const borderColor = variant === 'outline' ? c.lightText :
|
|
80
|
+
variant === 'subtle' ? c.border :
|
|
81
|
+
'transparent';
|
|
82
|
+
const sizeStyles = size === 'sm'
|
|
83
|
+
? { padding: '1px 8px', fontSize: '10px', gap: '4px' }
|
|
84
|
+
: { padding: '3px 10px', fontSize: '11px', gap: '5px' };
|
|
17
85
|
const baseStyle = {
|
|
18
86
|
display: 'inline-flex',
|
|
19
87
|
alignItems: 'center',
|
|
20
|
-
gap: tokens.spacing[1.5],
|
|
21
|
-
padding: size === 'sm' ? '1px 8px' : `3px ${tokens.spacing[3]}`,
|
|
22
88
|
borderRadius: tokens.radius.md,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
border: `1px solid ${variant === 'outline' ? c.lightText : (variant === 'subtle' ? c.border : 'transparent')}`,
|
|
89
|
+
fontWeight: tokens.font.weightSemibold,
|
|
90
|
+
letterSpacing: '0.02em',
|
|
91
|
+
lineHeight: 1.5,
|
|
92
|
+
border: `1px solid ${borderColor}`,
|
|
28
93
|
transition: tokens.transition.fast,
|
|
29
94
|
userSelect: 'none',
|
|
30
95
|
whiteSpace: 'nowrap',
|
|
31
|
-
|
|
96
|
+
cursor: clickable || onClick ? 'pointer' : 'default',
|
|
97
|
+
...sizeStyles,
|
|
98
|
+
...backgroundStyle(),
|
|
99
|
+
...style,
|
|
32
100
|
};
|
|
33
|
-
return (_jsxs("span", { style: baseStyle, className: className, ...props, children: [children, onClose && (_jsx("span", { onClick: (e) => { e.stopPropagation(); onClose(); }, style: {
|
|
101
|
+
return (_jsxs("span", { style: baseStyle, className: `ds-tag ${className}`, onClick: onClick, ...props, children: [icon && (_jsx("span", { style: { display: 'inline-flex', alignItems: 'center', flexShrink: 0 }, children: icon })), children, onClose && (_jsx("span", { onClick: (e) => { e.stopPropagation(); onClose(); }, style: {
|
|
34
102
|
cursor: 'pointer',
|
|
35
|
-
marginLeft: '4px',
|
|
36
103
|
display: 'inline-flex',
|
|
37
|
-
|
|
38
|
-
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
justifyContent: 'center',
|
|
106
|
+
marginLeft: '2px',
|
|
107
|
+
width: size === 'sm' ? '14px' : '16px',
|
|
108
|
+
height: size === 'sm' ? '14px' : '16px',
|
|
39
109
|
borderRadius: '50%',
|
|
40
|
-
|
|
41
|
-
|
|
110
|
+
opacity: 0.7,
|
|
111
|
+
transition: 'opacity 0.15s, background-color 0.15s',
|
|
112
|
+
flexShrink: 0,
|
|
113
|
+
}, onMouseEnter: (e) => {
|
|
114
|
+
e.currentTarget.style.opacity = '1';
|
|
115
|
+
e.currentTarget.style.backgroundColor = 'rgba(0,0,0,0.1)';
|
|
116
|
+
}, onMouseLeave: (e) => {
|
|
117
|
+
e.currentTarget.style.opacity = '0.7';
|
|
118
|
+
e.currentTarget.style.backgroundColor = 'transparent';
|
|
119
|
+
}, children: _jsx("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", children: _jsx("path", { d: "M18 6L6 18M6 6l12 12" }) }) }))] }));
|
|
42
120
|
};
|
|
43
121
|
//# sourceMappingURL=Tag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../../src/components/Tag.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../../src/components/Tag.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAmBnC,MAAM,aAAa,GAAgC;IACjD,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;QACxB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,YAAY;QAClC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;QAC/B,MAAM,EAAE,wBAAwB;KACjC;IACD,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;QACxB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS;QAC/B,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;QAC/B,MAAM,EAAE,wBAAwB;KACjC;IACD,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;QACxB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS;QAC/B,SAAS,EAAE,SAAS;QACpB,MAAM,EAAE,yBAAyB;KAClC;IACD,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;QACvB,I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AAY,EAAE,KAAK;oBACnB,OAAO,EAAE,GAAG;oBACZ,UAAU,EAAE,uCAAuC;oBACnD,UAAU,EAAE,CAAC;iBACd,EACD,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE;oBACjB,CAAC,CAAC,aAA6B,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;oBACpD,CAAC,CAAC,aAA6B,CAAC,KAAK,CAAC,eAAe,GAAG,iBAAiB,CAAC;gBAC7E,CAAC,EACD,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE;oBACjB,CAAC,CAAC,aAA6B,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;oBACtD,CAAC,CAAC,aAA6B,CAAC,KAAK,CAAC,eAAe,GAAG,aAAa,CAAC;gBACzE,CAAC,YAED,cAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,YAC/F,eAAM,CAAC,EAAC,sBAAsB,GAAG,GAC7B,GACD,CACR,IACI,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -2,5 +2,8 @@ import React from 'react';
|
|
|
2
2
|
export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
3
3
|
title: React.ReactNode;
|
|
4
4
|
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
5
|
+
delay?: number;
|
|
6
|
+
maxWidth?: string;
|
|
7
|
+
arrow?: boolean;
|
|
5
8
|
}
|
|
6
9
|
export declare const Tooltip: React.FC<TooltipProps>;
|
|
@@ -1,43 +1,94 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
3
|
import { tokens } from '../tokens';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
const ARROW_STYLES = {
|
|
5
|
+
top: {
|
|
6
|
+
bottom: '-5px',
|
|
7
|
+
left: '50%',
|
|
8
|
+
transform: 'translateX(-50%)',
|
|
9
|
+
borderLeft: '5px solid transparent',
|
|
10
|
+
borderRight: '5px solid transparent',
|
|
11
|
+
borderTop: `5px solid ${tokens.color.slate800}`,
|
|
12
|
+
},
|
|
13
|
+
bottom: {
|
|
14
|
+
top: '-5px',
|
|
15
|
+
left: '50%',
|
|
16
|
+
transform: 'translateX(-50%)',
|
|
17
|
+
borderLeft: '5px solid transparent',
|
|
18
|
+
borderRight: '5px solid transparent',
|
|
19
|
+
borderBottom: `5px solid ${tokens.color.slate800}`,
|
|
20
|
+
},
|
|
21
|
+
left: {
|
|
22
|
+
top: '50%',
|
|
23
|
+
right: '-5px',
|
|
24
|
+
transform: 'translateY(-50%)',
|
|
25
|
+
borderTop: '5px solid transparent',
|
|
26
|
+
borderBottom: '5px solid transparent',
|
|
27
|
+
borderLeft: `5px solid ${tokens.color.slate800}`,
|
|
28
|
+
},
|
|
29
|
+
right: {
|
|
30
|
+
top: '50%',
|
|
31
|
+
left: '-5px',
|
|
32
|
+
transform: 'translateY(-50%)',
|
|
33
|
+
borderTop: '5px solid transparent',
|
|
34
|
+
borderBottom: '5px solid transparent',
|
|
35
|
+
borderRight: `5px solid ${tokens.color.slate800}`,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
const POSITION_STYLES = {
|
|
39
|
+
top: { bottom: 'calc(100% + 8px)', left: '50%', transform: 'translateX(-50%)' },
|
|
40
|
+
bottom: { top: 'calc(100% + 8px)', left: '50%', transform: 'translateX(-50%)' },
|
|
41
|
+
left: { top: '50%', right: 'calc(100% + 8px)', transform: 'translateY(-50%)' },
|
|
42
|
+
right: { top: '50%', left: 'calc(100% + 8px)', transform: 'translateY(-50%)' },
|
|
43
|
+
};
|
|
44
|
+
export const Tooltip = ({ children, title, position = 'top', delay = 120, maxWidth = '240px', arrow = true, className = '', style = {}, ...props }) => {
|
|
45
|
+
const [visible, setVisible] = useState(false);
|
|
46
|
+
const timerRef = useRef(null);
|
|
47
|
+
const show = () => {
|
|
48
|
+
timerRef.current = setTimeout(() => setVisible(true), delay);
|
|
23
49
|
};
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
padding: `${tokens.spacing[1]} ${tokens.spacing[3]}`,
|
|
29
|
-
borderRadius: tokens.radius.sm,
|
|
30
|
-
fontSize: '11px',
|
|
31
|
-
fontWeight: tokens.font.weightMedium,
|
|
32
|
-
whiteSpace: 'nowrap',
|
|
33
|
-
pointerEvents: 'none',
|
|
34
|
-
opacity: isVisible ? 1 : 0,
|
|
35
|
-
visibility: isVisible ? 'visible' : 'hidden',
|
|
36
|
-
transition: tokens.transition.fast,
|
|
37
|
-
zIndex: 1000,
|
|
38
|
-
boxShadow: tokens.shadow.md,
|
|
39
|
-
...getPositionStyles()
|
|
50
|
+
const hide = () => {
|
|
51
|
+
if (timerRef.current)
|
|
52
|
+
clearTimeout(timerRef.current);
|
|
53
|
+
setVisible(false);
|
|
40
54
|
};
|
|
41
|
-
|
|
55
|
+
useEffect(() => () => {
|
|
56
|
+
if (timerRef.current)
|
|
57
|
+
clearTimeout(timerRef.current);
|
|
58
|
+
}, []);
|
|
59
|
+
if (!title)
|
|
60
|
+
return _jsx(_Fragment, { children: children });
|
|
61
|
+
return (_jsxs("div", { style: { position: 'relative', display: 'inline-flex', ...style }, className: `ds-tooltip-wrapper ${className}`, onMouseEnter: show, onMouseLeave: hide, onFocus: show, onBlur: hide, ...props, children: [children, _jsxs("div", { role: "tooltip", style: {
|
|
62
|
+
position: 'absolute',
|
|
63
|
+
...POSITION_STYLES[position],
|
|
64
|
+
backgroundColor: tokens.color.slate800,
|
|
65
|
+
color: '#fff',
|
|
66
|
+
padding: `${tokens.spacing[1]} ${tokens.spacing[3]}`,
|
|
67
|
+
borderRadius: tokens.radius.md,
|
|
68
|
+
fontSize: '11.5px',
|
|
69
|
+
fontWeight: tokens.font.weightMedium,
|
|
70
|
+
fontFamily: tokens.font.family,
|
|
71
|
+
letterSpacing: '0.01em',
|
|
72
|
+
lineHeight: 1.5,
|
|
73
|
+
whiteSpace: 'pre-wrap',
|
|
74
|
+
maxWidth,
|
|
75
|
+
pointerEvents: 'none',
|
|
76
|
+
zIndex: 9999,
|
|
77
|
+
opacity: visible ? 1 : 0,
|
|
78
|
+
visibility: visible ? 'visible' : 'hidden',
|
|
79
|
+
transform: `${POSITION_STYLES[position].transform || ''} ${!visible
|
|
80
|
+
? position === 'top' ? 'translateY(4px)' :
|
|
81
|
+
position === 'bottom' ? 'translateY(-4px)' :
|
|
82
|
+
position === 'left' ? 'translateX(4px)' : 'translateX(-4px)'
|
|
83
|
+
: ''}`,
|
|
84
|
+
transition: 'opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease',
|
|
85
|
+
boxShadow: `${tokens.shadow.lg}, 0 0 0 1px rgba(0,0,0,0.05)`,
|
|
86
|
+
willChange: 'opacity, transform',
|
|
87
|
+
}, children: [title, arrow && (_jsx("div", { style: {
|
|
88
|
+
position: 'absolute',
|
|
89
|
+
width: 0,
|
|
90
|
+
height: 0,
|
|
91
|
+
...ARROW_STYLES[position],
|
|
92
|
+
} }))] })] }));
|
|
42
93
|
};
|
|
43
94
|
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/Tooltip.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QA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CAAC;4BACxC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;gCAC5C,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,kBAAkB;wBAC9D,CAAC,CAAC,EACN,EAAE;oBACF,UAAU,EAAE,iEAAiE;oBAC7E,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,8BAA8B;oBAC5D,UAAU,EAAE,oBAAoB;iBACjC,aAEA,KAAK,EACL,KAAK,IAAI,CACR,cAAK,KAAK,EAAE;4BACV,QAAQ,EAAE,UAAU;4BACpB,KAAK,EAAE,CAAC;4BACR,MAAM,EAAE,CAAC;4BACT,GAAG,YAAY,CAAC,QAAQ,CAAC;yBAC1B,GAAI,CACN,IACG,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -2,15 +2,28 @@ import React from 'react';
|
|
|
2
2
|
import { tokens } from '../tokens';
|
|
3
3
|
export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
4
4
|
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
|
+
gradient?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare const Heading: React.FC<HeadingProps>;
|
|
8
|
+
type TextColor = keyof typeof tokens.color | 'default' | 'muted' | 'disabled' | 'primary' | 'danger' | 'success' | 'warning' | 'info';
|
|
7
9
|
export interface TextProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
8
10
|
size?: keyof typeof tokens.font;
|
|
9
11
|
weight?: 'normal' | 'medium' | 'semibold' | 'bold';
|
|
10
|
-
color?:
|
|
12
|
+
color?: TextColor;
|
|
13
|
+
truncate?: boolean;
|
|
14
|
+
as?: 'p' | 'span' | 'div' | 'li';
|
|
11
15
|
}
|
|
12
16
|
export declare const Text: React.FC<TextProps>;
|
|
17
|
+
export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
18
|
+
required?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const Label: React.FC<LabelProps>;
|
|
21
|
+
export interface CaptionProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
22
|
+
}
|
|
23
|
+
export declare const Caption: React.FC<CaptionProps>;
|
|
13
24
|
export interface SectionHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
14
25
|
title: string;
|
|
26
|
+
description?: string;
|
|
15
27
|
}
|
|
16
28
|
export declare const SectionHeader: React.FC<SectionHeaderProps>;
|
|
29
|
+
export {};
|
|
@@ -1,78 +1,125 @@
|
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
const HEADING_SIZES = {
|
|
5
|
+
1: tokens.font['2xl'],
|
|
6
|
+
2: tokens.font.xl,
|
|
7
|
+
3: tokens.font.lg,
|
|
8
|
+
4: tokens.font.md,
|
|
9
|
+
5: tokens.font.base,
|
|
10
|
+
6: tokens.font.sm,
|
|
11
|
+
};
|
|
12
|
+
const HEADING_LINE_HEIGHTS = {
|
|
13
|
+
1: 1.15,
|
|
14
|
+
2: 1.2,
|
|
15
|
+
3: 1.25,
|
|
16
|
+
4: 1.3,
|
|
17
|
+
5: 1.35,
|
|
18
|
+
6: 1.4,
|
|
19
|
+
};
|
|
20
|
+
const HEADING_LETTER_SPACING = {
|
|
21
|
+
1: '-0.03em',
|
|
22
|
+
2: '-0.025em',
|
|
23
|
+
3: '-0.02em',
|
|
24
|
+
4: '-0.015em',
|
|
25
|
+
5: '-0.01em',
|
|
26
|
+
6: '0',
|
|
27
|
+
};
|
|
28
|
+
export const Heading = ({ level = 2, children, className = '', style = {}, gradient = false, ...props }) => {
|
|
16
29
|
const baseStyle = {
|
|
17
30
|
fontFamily: tokens.font.family,
|
|
18
31
|
fontWeight: tokens.font.weightBold,
|
|
19
32
|
color: tokens.color.text,
|
|
20
|
-
fontSize:
|
|
33
|
+
fontSize: HEADING_SIZES[level] || tokens.font.base,
|
|
21
34
|
margin: 0,
|
|
22
|
-
lineHeight: 1.25,
|
|
23
|
-
letterSpacing: '-0.02em',
|
|
24
|
-
...
|
|
35
|
+
lineHeight: HEADING_LINE_HEIGHTS[level] || 1.25,
|
|
36
|
+
letterSpacing: HEADING_LETTER_SPACING[level] || '-0.02em',
|
|
37
|
+
...(gradient ? {
|
|
38
|
+
background: `linear-gradient(135deg, ${tokens.color.slate800} 0%, ${tokens.color.slate600} 100%)`,
|
|
39
|
+
WebkitBackgroundClip: 'text',
|
|
40
|
+
WebkitTextFillColor: 'transparent',
|
|
41
|
+
backgroundClip: 'text',
|
|
42
|
+
} : {}),
|
|
43
|
+
...style,
|
|
25
44
|
};
|
|
26
45
|
const tag = `h${level}`;
|
|
27
|
-
return React.createElement(tag, { style: baseStyle, className
|
|
46
|
+
return React.createElement(tag, { style: baseStyle, className: `ds-heading ${className}`, ...props }, children);
|
|
28
47
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (color === 'danger')
|
|
50
|
-
return tokens.color.danger;
|
|
51
|
-
if (color === 'success')
|
|
52
|
-
return tokens.color.success;
|
|
53
|
-
if (color === 'warning')
|
|
54
|
-
return tokens.color.warning;
|
|
55
|
-
if (color === 'info')
|
|
56
|
-
return tokens.color.info;
|
|
57
|
-
return tokens.color.text;
|
|
58
|
-
};
|
|
48
|
+
const COLOR_MAP = {
|
|
49
|
+
muted: tokens.color.textMuted,
|
|
50
|
+
disabled: tokens.color.textDisabled,
|
|
51
|
+
primary: tokens.color.primary,
|
|
52
|
+
danger: tokens.color.danger,
|
|
53
|
+
success: tokens.color.success,
|
|
54
|
+
warning: tokens.color.warning,
|
|
55
|
+
info: tokens.color.info,
|
|
56
|
+
default: tokens.color.text,
|
|
57
|
+
};
|
|
58
|
+
const WEIGHT_MAP = {
|
|
59
|
+
normal: tokens.font.weightNormal,
|
|
60
|
+
medium: tokens.font.weightMedium,
|
|
61
|
+
semibold: tokens.font.weightSemibold,
|
|
62
|
+
bold: tokens.font.weightBold,
|
|
63
|
+
};
|
|
64
|
+
export const Text = ({ size = 'base', weight = 'normal', color = 'default', truncate = false, as: Tag = 'p', children, className = '', style = {}, ...props }) => {
|
|
65
|
+
const resolvedColor = COLOR_MAP[color] ||
|
|
66
|
+
tokens.color[color] ||
|
|
67
|
+
tokens.color.text;
|
|
59
68
|
const baseStyle = {
|
|
60
69
|
fontFamily: tokens.font.family,
|
|
61
|
-
fontSize:
|
|
62
|
-
fontWeight:
|
|
63
|
-
color:
|
|
70
|
+
fontSize: tokens.font[size] || tokens.font.base,
|
|
71
|
+
fontWeight: WEIGHT_MAP[weight] || tokens.font.weightNormal,
|
|
72
|
+
color: resolvedColor,
|
|
64
73
|
margin: 0,
|
|
65
|
-
lineHeight: 1.
|
|
66
|
-
...
|
|
74
|
+
lineHeight: 1.65,
|
|
75
|
+
...(truncate ? {
|
|
76
|
+
whiteSpace: 'nowrap',
|
|
77
|
+
overflow: 'hidden',
|
|
78
|
+
textOverflow: 'ellipsis',
|
|
79
|
+
} : {}),
|
|
80
|
+
...style,
|
|
67
81
|
};
|
|
68
|
-
return
|
|
82
|
+
return React.createElement(Tag, { style: baseStyle, className: `ds-text ${className}`, ...props }, children);
|
|
69
83
|
};
|
|
70
|
-
export const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
export const Label = ({ children, required, className = '', style = {}, ...props }) => (_jsxs("label", { style: {
|
|
85
|
+
display: 'inline-flex',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
gap: '3px',
|
|
88
|
+
fontSize: tokens.font.xs,
|
|
89
|
+
fontWeight: tokens.font.weightSemibold,
|
|
90
|
+
color: tokens.color.slate600,
|
|
91
|
+
letterSpacing: '0.02em',
|
|
92
|
+
...style,
|
|
93
|
+
}, className: `ds-label ${className}`, ...props, children: [children, required && (_jsx("span", { style: { color: tokens.color.danger, lineHeight: 1 }, children: "*" }))] }));
|
|
94
|
+
export const Caption = ({ children, className = '', style = {}, ...props }) => (_jsx("span", { style: {
|
|
95
|
+
fontSize: '11px',
|
|
96
|
+
fontWeight: tokens.font.weightMedium,
|
|
97
|
+
color: tokens.color.textMuted,
|
|
98
|
+
lineHeight: 1.5,
|
|
99
|
+
...style,
|
|
100
|
+
}, className: `ds-caption ${className}`, ...props, children: children }));
|
|
101
|
+
export const SectionHeader = ({ title, description, className = '', style = {}, }) => (_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: tokens.spacing[4], margin: `${tokens.spacing[6]} 0`, ...style }, className: `ds-section-header ${className}`, children: [_jsx("div", { style: {
|
|
102
|
+
width: '3px',
|
|
103
|
+
height: '16px',
|
|
104
|
+
background: `linear-gradient(to bottom, ${tokens.color.primary}, ${tokens.color.info})`,
|
|
105
|
+
borderRadius: tokens.radius.full,
|
|
106
|
+
flexShrink: 0,
|
|
107
|
+
} }), _jsxs("div", { style: { flex: 1 }, children: [_jsx("h4", { style: {
|
|
108
|
+
fontSize: tokens.font.xs,
|
|
109
|
+
fontWeight: tokens.font.weightBold,
|
|
110
|
+
color: tokens.color.slate700,
|
|
111
|
+
textTransform: 'uppercase',
|
|
112
|
+
letterSpacing: '0.1em',
|
|
113
|
+
margin: 0,
|
|
114
|
+
lineHeight: 1.4,
|
|
115
|
+
}, children: title }), description && (_jsx("p", { style: {
|
|
116
|
+
fontSize: '11px',
|
|
117
|
+
color: tokens.color.textMuted,
|
|
118
|
+
margin: '2px 0 0 0',
|
|
119
|
+
fontWeight: tokens.font.weightMedium,
|
|
120
|
+
}, children: description }))] }), _jsx("div", { style: {
|
|
121
|
+
flex: 1,
|
|
122
|
+
height: '1px',
|
|
123
|
+
background: `linear-gradient(to right, ${tokens.color.slate200}, transparent)`,
|
|
124
|
+
} })] }));
|
|
78
125
|
//# sourceMappingURL=Typography.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/components/Typography.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../src/components/Typography.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAQnC,MAAM,aAAa,GAA2B;IAC5C,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;IACrB,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;IACjB,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;IACjB,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;IACjB,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI;IACnB,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;CAClB,CAAC;AAEF,MAAM,oBAAoB,GAA2B;IACnD,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,GAAG;CACP,CAAC;AAEF,MAAM,sBAAsB,GAA2B;IACrD,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,UAAU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wBACtB,MAAM,EAAE,CAAC;wBACT,UAAU,EAAE,GAAG;qBAChB,YACE,KAAK,GACH,EACJ,WAAW,IAAI,CACd,YAAG,KAAK,EAAE;wBACR,QAAQ,EAAE,MAAM;wBAChB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS;wBAC7B,MAAM,EAAE,WAAW;wBACnB,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY;qBACrC,YACE,WAAW,GACV,CACL,IACG,EACN,cAAK,KAAK,EAAE;gBACV,IAAI,EAAE,CAAC;gBACP,MAAM,EAAE,KAAK;gBACb,UAAU,EAAE,6BAA6B,MAAM,CAAC,KAAK,CAAC,QAAQ,gBAAgB;aAC/E,GAAI,IACD,CACP,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -13,14 +13,14 @@ export { Select } from './components/Select';
|
|
|
13
13
|
export type { InputProps, TextareaProps, CheckboxProps, NativeSelectProps } from './components/InputComponents';
|
|
14
14
|
export type { MultiSelectProps } from './components/MultiSelect';
|
|
15
15
|
export type { SelectProps, SelectOption } from './components/Select';
|
|
16
|
-
export { Heading, Text, SectionHeader } from './components/Typography';
|
|
17
|
-
export type { HeadingProps, TextProps, SectionHeaderProps } from './components/Typography';
|
|
18
|
-
export { LoadingSpinner } from './components/LoadingSpinner';
|
|
19
|
-
export type { LoadingSpinnerProps } from './components/LoadingSpinner';
|
|
16
|
+
export { Heading, Text, SectionHeader, Label, Caption } from './components/Typography';
|
|
17
|
+
export type { HeadingProps, TextProps, SectionHeaderProps, LabelProps, CaptionProps } from './components/Typography';
|
|
18
|
+
export { LoadingSpinner, LoadingOverlay } from './components/LoadingSpinner';
|
|
19
|
+
export type { LoadingSpinnerProps, LoadingOverlayProps } from './components/LoadingSpinner';
|
|
20
20
|
export { ReadOnlyField } from './components/ReadOnlyField';
|
|
21
21
|
export type { ReadOnlyFieldProps } from './components/ReadOnlyField';
|
|
22
|
-
export { Avatar } from './components/Avatar';
|
|
23
|
-
export type { AvatarProps } from './components/Avatar';
|
|
22
|
+
export { Avatar, AvatarGroup } from './components/Avatar';
|
|
23
|
+
export type { AvatarProps, AvatarGroupProps } from './components/Avatar';
|
|
24
24
|
export { Switch } from './components/Switch';
|
|
25
25
|
export type { SwitchProps } from './components/Switch';
|
|
26
26
|
export { Tabs, Tab } from './components/Tabs';
|