@repobit/dex-system-design 0.4.0 → 0.5.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 +2 -2
- package/src/components/Button/button.css.js +34 -33
- package/src/tokens/tokens.js +206 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.5.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@0.4.0...@repobit/dex-system-design@0.5.0) (2025-06-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **DEX-23636:** refactor button styles to use design tokens for consistency ([411c6bb](https://github.com/bitdefender/dex-core/commit/411c6bbc8d3fa63eb16d7059711929e8cca09f07))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [0.4.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@0.3.0...@repobit/dex-system-design@0.4.0) (2025-06-24)
|
|
7
16
|
|
|
8
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repobit/dex-system-design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Design system based on Web Components.",
|
|
5
5
|
"author": "Iordache Matei Cezar <miordache@bitdefender.com>",
|
|
6
6
|
"homepage": "https://github.com/bitdefender/dex-core#readme",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"volta": {
|
|
54
54
|
"node": "22.14.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "87d473fc4b0d18e8b3526ffb88d0c2c8f88a1eda"
|
|
57
57
|
}
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { css } from 'lit';
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
import { tokens } from '../../tokens/tokens.js';
|
|
2
3
|
|
|
3
4
|
export default css`
|
|
4
5
|
:host {
|
|
5
|
-
--button-background-primary:
|
|
6
|
-
--button-background-primary-hover:
|
|
7
|
-
--button-background-primary-focus:
|
|
6
|
+
--button-background-primary: ${unsafeCSS(tokens.colors.blue[500])};
|
|
7
|
+
--button-background-primary-hover: ${unsafeCSS(tokens.colors.blue[600])};
|
|
8
|
+
--button-background-primary-focus: ${unsafeCSS(tokens.colors.blue[700])};
|
|
8
9
|
|
|
9
|
-
--button-background-secondary:
|
|
10
|
-
--button-background-secondary-hover:
|
|
11
|
-
--button-background-secondary-focus:
|
|
10
|
+
--button-background-secondary: ${unsafeCSS(tokens.colors.neutral[950])};
|
|
11
|
+
--button-background-secondary-hover: ${unsafeCSS(tokens.colors.neutral[900])};
|
|
12
|
+
--button-background-secondary-focus: ${unsafeCSS(tokens.colors.neutral[800])};
|
|
12
13
|
|
|
13
|
-
--button-background-danger:
|
|
14
|
-
--button-background-danger-hover:
|
|
15
|
-
--button-background-danger-focus:
|
|
14
|
+
--button-background-danger: ${unsafeCSS(tokens.colors.red[600])};
|
|
15
|
+
--button-background-danger-hover: ${unsafeCSS(tokens.colors.red[700])};
|
|
16
|
+
--button-background-danger-focus: ${unsafeCSS(tokens.colors.red[800])};
|
|
16
17
|
|
|
17
|
-
--color-button-background-outline:
|
|
18
|
-
--border-button-background-outline:
|
|
19
|
-
--button-background-outline-hover:
|
|
20
|
-
--border-button-background-outline-hover:
|
|
21
|
-
--button-background-outline-focus:
|
|
18
|
+
--color-button-background-outline: ${unsafeCSS(tokens.colors.neutral[950])};
|
|
19
|
+
--border-button-background-outline: ${unsafeCSS(tokens.colors.neutral[950])};
|
|
20
|
+
--button-background-outline-hover: ${unsafeCSS(tokens.colors.neutral[50])};
|
|
21
|
+
--border-button-background-outline-hover: ${unsafeCSS(tokens.colors.neutral[950])};
|
|
22
|
+
--button-background-outline-focus: ${unsafeCSS(tokens.colors.neutral[800])};
|
|
22
23
|
|
|
23
|
-
--color-button-background-primary-outline:
|
|
24
|
-
--border-button-background-primary-outline:
|
|
25
|
-
--button-background-primary-outline-hover:
|
|
26
|
-
--border-button-background-primary-outline-hover:
|
|
27
|
-
--button-background-primary-outline-focus:
|
|
24
|
+
--color-button-background-primary-outline: ${unsafeCSS(tokens.colors.blue[500])};
|
|
25
|
+
--border-button-background-primary-outline: ${unsafeCSS(tokens.colors.blue[500])};
|
|
26
|
+
--button-background-primary-outline-hover: ${unsafeCSS(tokens.colors.blue[50])};
|
|
27
|
+
--border-button-background-primary-outline-hover: ${unsafeCSS(tokens.colors.blue[500])};
|
|
28
|
+
--button-background-primary-outline-focus: ${unsafeCSS(tokens.colors.blue[500])};
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
.href-button {
|
|
@@ -106,30 +107,30 @@ export default css`
|
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
.button--small {
|
|
109
|
-
padding:
|
|
110
|
-
font-size:
|
|
111
|
-
font-weight:
|
|
112
|
-
font-family:
|
|
110
|
+
padding: ${unsafeCSS(tokens.spacing[8])} ${unsafeCSS(tokens.spacing[16])};
|
|
111
|
+
font-size: ${unsafeCSS(tokens.fontSize.body.medium)};
|
|
112
|
+
font-weight: ${unsafeCSS(tokens.fonts.sans.weights.regular)};
|
|
113
|
+
font-family: ${unsafeCSS(tokens.fonts.sans.family)};
|
|
113
114
|
border-radius: 6px;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
.button--medium {
|
|
117
|
-
padding:
|
|
118
|
-
font-size:
|
|
119
|
-
font-weight:
|
|
120
|
-
font-family:
|
|
118
|
+
padding: ${unsafeCSS(tokens.spacing[12])} ${unsafeCSS(tokens.spacing[20])};
|
|
119
|
+
font-size: ${unsafeCSS(tokens.fontSize.body.large)};
|
|
120
|
+
font-weight: ${unsafeCSS(tokens.fonts.sans.weights.regular)};
|
|
121
|
+
font-family: ${unsafeCSS(tokens.fonts.sans.family)};
|
|
121
122
|
border-radius: 8px;
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
.button--large {
|
|
125
|
-
padding:
|
|
126
|
-
font-size:
|
|
127
|
-
font-weight:
|
|
128
|
-
font-family:
|
|
126
|
+
padding: ${unsafeCSS(tokens.spacing[16])} ${unsafeCSS(tokens.spacing[24])};
|
|
127
|
+
font-size: ${unsafeCSS(tokens.fontSize.body.xlarge)};
|
|
128
|
+
font-weight: ${unsafeCSS(tokens.fonts.sans.weights.regular)};
|
|
129
|
+
font-family: ${unsafeCSS(tokens.fonts.sans.family)};
|
|
129
130
|
border-radius: 8px;
|
|
130
131
|
}
|
|
131
132
|
.button--bold {
|
|
132
|
-
font-weight:
|
|
133
|
+
font-weight: ${unsafeCSS(tokens.fonts.sans.weights.semibold)};
|
|
133
134
|
}
|
|
134
135
|
.max--width {
|
|
135
136
|
width: 100%;
|
|
@@ -0,0 +1,206 @@
|
|
|
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;
|