@repobit/dex-system-design 0.5.0 → 0.6.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/CHANGELOG.md +9 -0
- package/package.json +4 -3
- package/src/assets/images/bd-header-img.jpg +0 -0
- package/src/assets/images/bd-header-us.jpg +0 -0
- package/src/components/Button/Button.js +115 -3
- package/src/components/Button/button.css.js +80 -43
- package/src/components/Button/button.stories.js +83 -7
- package/src/components/FAQ/faq.css.js +27 -16
- package/src/components/FAQ/faq.js +23 -114
- package/src/components/FAQ/faq.stories.js +41 -20
- package/src/components/Input/Input.js +2 -2
- package/src/components/Input/input.css.js +1 -1
- package/src/components/anchor/anchor-nav.css.js +92 -0
- package/src/components/anchor/anchor-nav.js +121 -0
- package/src/components/anchor/anchor.stories.js +134 -0
- package/src/components/badge/badge.css.js +27 -0
- package/src/components/badge/badge.js +30 -0
- package/src/components/badge/badge.stories.js +36 -0
- package/src/components/carousel/carousel.css.js +36 -19
- package/src/components/carousel/carousel.js +149 -99
- package/src/components/carousel/carousel.stories.js +202 -46
- package/src/components/checkbox/checkbox.css.js +132 -0
- package/src/components/checkbox/checkbox.js +130 -0
- package/src/components/checkbox/checkbox.stories.js +63 -0
- package/src/components/divider/divider-horizontal.js +29 -0
- package/src/components/divider/divider-vertical.js +32 -0
- package/src/components/divider/divider.css.js +0 -0
- package/src/components/divider/divider.stories.js +77 -0
- package/src/components/header/header.css.js +248 -0
- package/src/components/header/header.js +87 -0
- package/src/components/header/header.stories.js +57 -0
- package/src/components/highlight/highlight-s.css.js +88 -0
- package/src/components/highlight/highlight-s.js +35 -0
- package/src/components/highlight/highlight-s.stories.js +22 -0
- package/src/components/highlight/highlight.css.js +119 -0
- package/src/components/highlight/highlight.js +60 -0
- package/src/components/highlight/highlight.stories.js +53 -0
- package/src/components/light-carousel/light-carousel.css.js +18 -10
- package/src/components/light-carousel/light-carousel.js +29 -16
- package/src/components/light-carousel/light-carousel.stories.js +9 -7
- package/src/components/paragraph/paragraph.css.js +1 -1
- package/src/components/pricing-cards/pricing-card.css.js +138 -3
- package/src/components/pricing-cards/pricing-card.js +63 -82
- package/src/components/pricing-cards/pricing-card.stories.js +1 -0
- package/src/components/radio/radio.css.js +168 -0
- package/src/components/radio/radio.js +222 -0
- package/src/components/radio/radio.stories.js +103 -0
- package/src/components/tabs/tabs.css.js +26 -8
- package/src/components/tabs/tabs.js +19 -12
- package/src/components/termsOfUse/terms.css.js +7 -1
- package/src/tokens/fonts.stories.js +73 -0
- package/src/tokens/spacing.stories.js +56 -0
- package/src/tokens/tokens-grid.stories.js +83 -0
- package/src/tokens/tokens.css +116 -1
- package/src/tokens/tokens.stories.js +67 -0
- package/src/tokens/typography.stories.js +69 -0
- package/src/tokens/tokens.js +0 -206
- /package/src/assets/{icons → images}/tabs-img1.png +0 -0
- /package/src/assets/{icons → images}/tabs-img2.png +0 -0
- /package/src/assets/{icons → images}/tabs-img3.png +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Design Tokens/Colors',
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const colorGroups = {
|
|
8
|
+
blue: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', '950'],
|
|
9
|
+
red: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', '950'],
|
|
10
|
+
green: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', '950'],
|
|
11
|
+
yellow: ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', '950'],
|
|
12
|
+
neutral: ['0', '25', '50', '100', '200', '300', '400', '500', '600', '700', '800', '900', '950', '1000'],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Colors = () => html`
|
|
16
|
+
<style>
|
|
17
|
+
.color-group {
|
|
18
|
+
margin-bottom: 32px;
|
|
19
|
+
}
|
|
20
|
+
.color-group-title {
|
|
21
|
+
font-family: var(--font-family-sans);
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
font-size: var(--heading-medium);
|
|
24
|
+
margin-bottom: 16px;
|
|
25
|
+
text-transform: capitalize;
|
|
26
|
+
}
|
|
27
|
+
.color-swatch {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
width: 80px;
|
|
33
|
+
height: 80px;
|
|
34
|
+
margin: 6px;
|
|
35
|
+
border-radius: 8px;
|
|
36
|
+
box-shadow: 0 0 4px rgba(0,0,0,0.1);
|
|
37
|
+
color: white;
|
|
38
|
+
font-family: var(--font-family-mono);
|
|
39
|
+
font-size: 12px;
|
|
40
|
+
text-align: center;
|
|
41
|
+
user-select: none;
|
|
42
|
+
}
|
|
43
|
+
.color-label {
|
|
44
|
+
margin-top: 6px;
|
|
45
|
+
color: var(--color-neutral-900);
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
font-family: var(--font-family-sans);
|
|
48
|
+
font-size: 10px;
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
52
|
+
|
|
53
|
+
${Object.entries(colorGroups).map(([group, shades]) => html`
|
|
54
|
+
<section class="color-group">
|
|
55
|
+
<h3 class="color-group-title">${group}</h3>
|
|
56
|
+
${shades.map(shade => {
|
|
57
|
+
const varName = `--color-${group}-${shade}`;
|
|
58
|
+
return html`
|
|
59
|
+
<div class="color-swatch" style="background-color: var(${varName})">
|
|
60
|
+
<div>${shade}</div>
|
|
61
|
+
<div class="color-label">${varName}</div>
|
|
62
|
+
</div>
|
|
63
|
+
`;
|
|
64
|
+
})}
|
|
65
|
+
</section>
|
|
66
|
+
`)}
|
|
67
|
+
`;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Design Tokens/Typography',
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const typographyTokens = {
|
|
8
|
+
families: {
|
|
9
|
+
'Sans': 'var(--font-family-sans, "IBM Plex Sans", Arial, sans-serif)',
|
|
10
|
+
'Mono': 'var(--font-family-mono, "IBM Plex Mono", monospace)',
|
|
11
|
+
},
|
|
12
|
+
sizes: {
|
|
13
|
+
xs: 'var(--font-size-xs, 0.75rem)',
|
|
14
|
+
sm: 'var(--font-size-sm, 0.875rem)',
|
|
15
|
+
md: 'var(--font-size-md, 1rem)',
|
|
16
|
+
lg: 'var(--font-size-lg, 1.25rem)',
|
|
17
|
+
xl: 'var(--font-size-xl, 1.5rem)',
|
|
18
|
+
},
|
|
19
|
+
weights: {
|
|
20
|
+
regular: 'var(--font-weight-regular, 400)',
|
|
21
|
+
semibold: 'var(--font-weight-semibold, 600)',
|
|
22
|
+
bold: 'var(--font-weight-bold, 700)',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Typography = () => html`
|
|
27
|
+
<style>
|
|
28
|
+
h3 {
|
|
29
|
+
font-family: var(--font-family-sans);
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
font-size: var(--heading-medium);
|
|
32
|
+
margin-bottom: 16px;
|
|
33
|
+
text-transform: capitalize;
|
|
34
|
+
}
|
|
35
|
+
.typo-family-sample {
|
|
36
|
+
margin-bottom: 12px;
|
|
37
|
+
font-size: 1rem;
|
|
38
|
+
}
|
|
39
|
+
.typo-size-sample {
|
|
40
|
+
margin-bottom: 8px;
|
|
41
|
+
}
|
|
42
|
+
.typo-weight-sample {
|
|
43
|
+
margin-bottom: 8px;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
46
|
+
|
|
47
|
+
<section>
|
|
48
|
+
<h3>Font Families</h3>
|
|
49
|
+
${Object.entries(typographyTokens.families).map(([name, family]) => html`
|
|
50
|
+
<div class="typo-family-sample" style="font-family: ${family}">
|
|
51
|
+
This text uses <strong>${name}</strong> font family.
|
|
52
|
+
</div>
|
|
53
|
+
`)}
|
|
54
|
+
|
|
55
|
+
<h3>Font Sizes</h3>
|
|
56
|
+
${Object.entries(typographyTokens.sizes).map(([sizeName, sizeValue]) => html`
|
|
57
|
+
<div class="typo-size-sample" style="font-size: ${sizeValue}">
|
|
58
|
+
Font size <strong>${sizeName}</strong> (${sizeValue})
|
|
59
|
+
</div>
|
|
60
|
+
`)}
|
|
61
|
+
|
|
62
|
+
<h3>Font Weights</h3>
|
|
63
|
+
${Object.entries(typographyTokens.weights).map(([weightName, weightValue]) => html`
|
|
64
|
+
<div class="typo-weight-sample" style="font-weight: ${weightValue}">
|
|
65
|
+
Font weight <strong>${weightName}</strong> (${weightValue})
|
|
66
|
+
</div>
|
|
67
|
+
`)}
|
|
68
|
+
</section>
|
|
69
|
+
`;
|
package/src/tokens/tokens.js
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
export const tokens = {
|
|
2
|
-
colors: {
|
|
3
|
-
blue: {
|
|
4
|
-
50 : '#F0F7FF',
|
|
5
|
-
100: '#D6E8FF',
|
|
6
|
-
200: '#9EC8FF',
|
|
7
|
-
300: '#6BABFF',
|
|
8
|
-
400: '#338BFF',
|
|
9
|
-
500: '#006dff',
|
|
10
|
-
600: '#0059D6',
|
|
11
|
-
700: '#0045AD',
|
|
12
|
-
800: '#003385',
|
|
13
|
-
900: '#00225C',
|
|
14
|
-
950: '#001947'
|
|
15
|
-
},
|
|
16
|
-
red: {
|
|
17
|
-
50 : '#FFF0F0',
|
|
18
|
-
100: '#FFD6D6',
|
|
19
|
-
200: '#FF9E9E',
|
|
20
|
-
300: '#FF6B6B',
|
|
21
|
-
400: '#FF3333',
|
|
22
|
-
500: '#FF0000',
|
|
23
|
-
600: '#D60000',
|
|
24
|
-
700: '#AD0000',
|
|
25
|
-
800: '#850000',
|
|
26
|
-
900: '#5C0000',
|
|
27
|
-
950: '#470000'
|
|
28
|
-
},
|
|
29
|
-
green: {
|
|
30
|
-
50 : '#EDFDF1',
|
|
31
|
-
100: '#D1FADC',
|
|
32
|
-
200: '#9AF4B4',
|
|
33
|
-
300: '#63EE8D',
|
|
34
|
-
400: '#2CE767',
|
|
35
|
-
500: '#15C14F',
|
|
36
|
-
600: '#12A641',
|
|
37
|
-
700: '#0E8532',
|
|
38
|
-
800: '#0B6A26',
|
|
39
|
-
900: '#084A1A',
|
|
40
|
-
950: '#063C14'
|
|
41
|
-
},
|
|
42
|
-
yellow: {
|
|
43
|
-
50 : '#FFFBF0',
|
|
44
|
-
100: '#FFF5D6',
|
|
45
|
-
200: '#FFE89E',
|
|
46
|
-
300: '#FFDC6B',
|
|
47
|
-
400: '#FFCF33',
|
|
48
|
-
500: '#FFC400',
|
|
49
|
-
600: '#D6A000',
|
|
50
|
-
700: '#AD7F00',
|
|
51
|
-
800: '#855F00',
|
|
52
|
-
900: '#5C4000',
|
|
53
|
-
950: '#473100'
|
|
54
|
-
},
|
|
55
|
-
neutral: {
|
|
56
|
-
0 : '#FFFFFF',
|
|
57
|
-
25 : '#FAFAFA',
|
|
58
|
-
50 : '#f1f2f3',
|
|
59
|
-
100 : '#e1e3e5',
|
|
60
|
-
200 : '#c5c9ce',
|
|
61
|
-
300 : '#a6adb4',
|
|
62
|
-
400 : '#88909b',
|
|
63
|
-
500 : '#6c7580',
|
|
64
|
-
600 : '#565e66',
|
|
65
|
-
700 : '#41474d',
|
|
66
|
-
800 : '#2c3035',
|
|
67
|
-
900 : '#151719',
|
|
68
|
-
950 : '#0c0d0e',
|
|
69
|
-
1000: '#000000'
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
fontSize: {
|
|
74
|
-
display: {
|
|
75
|
-
default: {
|
|
76
|
-
xxsmall: '44px',
|
|
77
|
-
xsmall : '48px',
|
|
78
|
-
small : '52px',
|
|
79
|
-
medium : '56px',
|
|
80
|
-
large : '60px',
|
|
81
|
-
xlarge : '64px'
|
|
82
|
-
},
|
|
83
|
-
mobile: {
|
|
84
|
-
xxsmall: '34px',
|
|
85
|
-
xsmall : '36px',
|
|
86
|
-
small : '38px',
|
|
87
|
-
medium : '40px',
|
|
88
|
-
large : '44px',
|
|
89
|
-
xlarge : '48px'
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
heading: {
|
|
93
|
-
xxsmall: '18px',
|
|
94
|
-
xsmall : '20px',
|
|
95
|
-
small : '24px',
|
|
96
|
-
medium : '28px',
|
|
97
|
-
large : '32px',
|
|
98
|
-
xlarge : '36px',
|
|
99
|
-
xxlarge: '40px'
|
|
100
|
-
},
|
|
101
|
-
body: {
|
|
102
|
-
small : '13px',
|
|
103
|
-
medium: '14px',
|
|
104
|
-
large : '16px',
|
|
105
|
-
xlarge: '18px'
|
|
106
|
-
},
|
|
107
|
-
caption: {
|
|
108
|
-
small: '11px',
|
|
109
|
-
large: '12px'
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
spacing: {
|
|
114
|
-
0 : '0',
|
|
115
|
-
1 : '1px',
|
|
116
|
-
2 : '2px',
|
|
117
|
-
4 : '4px',
|
|
118
|
-
6 : '6px',
|
|
119
|
-
8 : '8px',
|
|
120
|
-
10 : '10px',
|
|
121
|
-
12 : '12px',
|
|
122
|
-
14 : '14px',
|
|
123
|
-
16 : '16px',
|
|
124
|
-
18 : '18px',
|
|
125
|
-
20 : '20px',
|
|
126
|
-
24 : '24px',
|
|
127
|
-
32 : '32px',
|
|
128
|
-
36 : '36px',
|
|
129
|
-
40 : '40px',
|
|
130
|
-
44 : '44px',
|
|
131
|
-
52 : '52px',
|
|
132
|
-
64 : '64px',
|
|
133
|
-
full: '99999999999999999999'
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
fonts: {
|
|
137
|
-
mono: {
|
|
138
|
-
family : "'IBM Plex Mono', monospace",
|
|
139
|
-
weights: {
|
|
140
|
-
light : 300,
|
|
141
|
-
regular : 400,
|
|
142
|
-
medium : 500,
|
|
143
|
-
semibold: 600,
|
|
144
|
-
bold : 700
|
|
145
|
-
},
|
|
146
|
-
styles: {
|
|
147
|
-
normal: 'normal',
|
|
148
|
-
italic: 'italic'
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
sans: {
|
|
152
|
-
family : "'IBM Plex Sans', sans-serif",
|
|
153
|
-
weights: {
|
|
154
|
-
light : 300,
|
|
155
|
-
regular : 400,
|
|
156
|
-
medium : 500,
|
|
157
|
-
semibold: 600,
|
|
158
|
-
bold : 700
|
|
159
|
-
},
|
|
160
|
-
styles: {
|
|
161
|
-
normal: 'normal',
|
|
162
|
-
italic: 'italic'
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
fontFiles: {
|
|
168
|
-
mono: {
|
|
169
|
-
bold : '/assets/fonts/IBMPlexMono-Bold.woff2',
|
|
170
|
-
boldItalic : '/assets/fonts/IBMPlexMono-BoldItalic.woff2',
|
|
171
|
-
italic : '/assets/fonts/IBMPlexMono-Italic.woff2',
|
|
172
|
-
light : '/assets/fonts/IBMPlexMono-Light.woff2',
|
|
173
|
-
lightItalic : '/assets/fonts/IBMPlexMono-LightItalic.woff2',
|
|
174
|
-
medium : '/assets/fonts/IBMPlexMono-Medium.woff2',
|
|
175
|
-
mediumItalic : '/assets/fonts/IBMPlexMono-MediumItalic.woff2',
|
|
176
|
-
regular : '/assets/fonts/IBMPlexMono-Regular.woff2',
|
|
177
|
-
semiBold : '/assets/fonts/IBMPlexMono-SemiBold.woff2',
|
|
178
|
-
semiBoldItalic: '/assets/fonts/IBMPlexMono-SemiBoldItalic.woff2'
|
|
179
|
-
},
|
|
180
|
-
sans: {
|
|
181
|
-
bold : '/assets/fonts/IBMPlexSans-Bold.woff2',
|
|
182
|
-
boldItalic : '/assets/fonts/IBMPlexSans-BoldItalic.woff2',
|
|
183
|
-
italic : '/assets/fonts/IBMPlexSans-Italic.woff2',
|
|
184
|
-
light : '/assets/fonts/IBMPlexSans-Light.woff2',
|
|
185
|
-
lightItalic : '/assets/fonts/IBMPlexSans-LightItalic.woff2',
|
|
186
|
-
medium : '/assets/fonts/IBMPlexSans-Medium.woff2',
|
|
187
|
-
mediumItalic : '/assets/fonts/IBMPlexSans-MediumItalic.woff2',
|
|
188
|
-
regular : '/assets/fonts/IBMPlexSans-Regular.woff2',
|
|
189
|
-
semiBold : '/assets/fonts/IBMPlexSans-SemiBold.woff2',
|
|
190
|
-
semiBoldItalic: '/assets/fonts/IBMPlexSans-SemiBoldItalic.woff2'
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
// Helper functions to access tokens
|
|
196
|
-
export const getColor = (color, shade) => tokens.colors[color]?.[shade];
|
|
197
|
-
export const getFontSize = (category, size, variant = 'default') => {
|
|
198
|
-
if (category === 'display' && variant !== 'default') {
|
|
199
|
-
return tokens.fontSize[category][variant]?.[size];
|
|
200
|
-
}
|
|
201
|
-
return tokens.fontSize[category]?.[size];
|
|
202
|
-
};
|
|
203
|
-
export const getSpacing = (size) => tokens.spacing[size];
|
|
204
|
-
export const getFont = (family) => tokens.fonts[family];
|
|
205
|
-
|
|
206
|
-
export default tokens;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|