@deriv-web-design/ui 0.0.1
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/index.css +1304 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +231 -0
- package/dist/index.d.ts +231 -0
- package/dist/index.js +1000 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +963 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +42 -0
- package/tokens.css +348 -0
package/tokens.css
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
CORE TOKENS
|
|
3
|
+
Source of truth — never use these directly in components.
|
|
4
|
+
Use semantic tokens instead.
|
|
5
|
+
============================================================ */
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
/* Color — Slate */
|
|
9
|
+
--color-slate-50: #ffffff;
|
|
10
|
+
--color-slate-75: #f6f7f8;
|
|
11
|
+
--color-slate-100: #eceeef;
|
|
12
|
+
--color-slate-200: #e0e3e5;
|
|
13
|
+
--color-slate-300: #cfd4d8;
|
|
14
|
+
--color-slate-400: #bfc6cc;
|
|
15
|
+
--color-slate-500: #7b8a96;
|
|
16
|
+
--color-slate-600: #5c6770;
|
|
17
|
+
--color-slate-700: #414c52;
|
|
18
|
+
--color-slate-800: #353c44;
|
|
19
|
+
--color-slate-900: #30354f;
|
|
20
|
+
--color-slate-1000: #232c3a;
|
|
21
|
+
--color-slate-1100: #202a2f;
|
|
22
|
+
--color-slate-1200: #1f1c25;
|
|
23
|
+
--color-slate-1300: #14141c;
|
|
24
|
+
--color-slate-1400: #000000;
|
|
25
|
+
|
|
26
|
+
/* Color — Coral */
|
|
27
|
+
--color-coral-500: #ff444f;
|
|
28
|
+
--color-coral-600: #e73c36;
|
|
29
|
+
--color-coral-700: #dc1f28;
|
|
30
|
+
|
|
31
|
+
/* Color — Emerald */
|
|
32
|
+
--color-emerald-500: #4cd6c0;
|
|
33
|
+
--color-emerald-600: #00b39a;
|
|
34
|
+
--color-emerald-700: #00a286;
|
|
35
|
+
|
|
36
|
+
/* Color — Yellow */
|
|
37
|
+
--color-yellow-500: #ffb84d;
|
|
38
|
+
--color-yellow-600: #e4a700;
|
|
39
|
+
|
|
40
|
+
/* Color — Blue */
|
|
41
|
+
--color-blue-500: #4da6ff;
|
|
42
|
+
--color-blue-600: #2f77ff;
|
|
43
|
+
|
|
44
|
+
/* Color — Cherry */
|
|
45
|
+
--color-cherry-700: #dc0000;
|
|
46
|
+
--color-cherry-800: #f50032;
|
|
47
|
+
--color-cherry-900: #dc002c;
|
|
48
|
+
|
|
49
|
+
/* Color — Green (field success) */
|
|
50
|
+
--color-green-600: #007a22;
|
|
51
|
+
|
|
52
|
+
/* Color — Red (field error) */
|
|
53
|
+
--color-red-600: #c40000;
|
|
54
|
+
|
|
55
|
+
/* Color — Opacity / Green */
|
|
56
|
+
--color-opacity-green-8: rgba(0, 136, 50, 0.08);
|
|
57
|
+
--color-opacity-green-16: rgba(0, 136, 50, 0.16);
|
|
58
|
+
--color-opacity-green-72: rgba(0, 136, 50, 0.72);
|
|
59
|
+
--color-opacity-green-88: rgba(0, 136, 50, 0.88);
|
|
60
|
+
|
|
61
|
+
/* Color — Opacity / Red */
|
|
62
|
+
--color-opacity-red-8: rgba(230, 25, 14, 0.08);
|
|
63
|
+
--color-opacity-red-16: rgba(230, 25, 14, 0.16);
|
|
64
|
+
--color-opacity-red-72: rgba(230, 25, 14, 0.72);
|
|
65
|
+
--color-opacity-red-88: rgba(230, 25, 14, 0.88);
|
|
66
|
+
|
|
67
|
+
/* Color — Opacity / Slate */
|
|
68
|
+
--color-opacity-slate-4: rgba(24, 28, 37, 0.04);
|
|
69
|
+
--color-opacity-slate-8: rgba(24, 28, 37, 0.08);
|
|
70
|
+
--color-opacity-slate-16: rgba(24, 28, 37, 0.16);
|
|
71
|
+
--color-opacity-slate-24: rgba(24, 28, 37, 0.24);
|
|
72
|
+
--color-opacity-slate-48: rgba(24, 28, 37, 0.48);
|
|
73
|
+
--color-opacity-slate-72: rgba(24, 28, 37, 0.72);
|
|
74
|
+
--color-opacity-slate-88: rgba(24, 28, 37, 0.88);
|
|
75
|
+
|
|
76
|
+
/* Color — Opacity / White */
|
|
77
|
+
--color-opacity-white-4: rgba(255, 255, 255, 0.04);
|
|
78
|
+
--color-opacity-white-8: rgba(255, 255, 255, 0.08);
|
|
79
|
+
--color-opacity-white-16: rgba(255, 255, 255, 0.16);
|
|
80
|
+
--color-opacity-white-24: rgba(255, 255, 255, 0.24);
|
|
81
|
+
--color-opacity-white-48: rgba(255, 255, 255, 0.48);
|
|
82
|
+
--color-opacity-white-72: rgba(255, 255, 255, 0.72);
|
|
83
|
+
--color-opacity-white-88: rgba(255, 255, 255, 0.88);
|
|
84
|
+
|
|
85
|
+
/* Spacing */
|
|
86
|
+
--spacing-0: 0rem;
|
|
87
|
+
--spacing-2: 0.125rem;
|
|
88
|
+
--spacing-4: 0.25rem;
|
|
89
|
+
--spacing-8: 0.5rem;
|
|
90
|
+
--spacing-12: 0.75rem;
|
|
91
|
+
--spacing-16: 1rem;
|
|
92
|
+
--spacing-24: 1.5rem;
|
|
93
|
+
--spacing-32: 2rem;
|
|
94
|
+
--spacing-40: 2.5rem;
|
|
95
|
+
--spacing-48: 3rem;
|
|
96
|
+
--spacing-56: 3.5rem;
|
|
97
|
+
--spacing-64: 4rem;
|
|
98
|
+
--spacing-72: 4.5rem;
|
|
99
|
+
--spacing-80: 5rem;
|
|
100
|
+
--spacing-88: 5.5rem;
|
|
101
|
+
--spacing-96: 6rem;
|
|
102
|
+
--spacing-112: 7rem;
|
|
103
|
+
|
|
104
|
+
/* Font Family */
|
|
105
|
+
--font-family-base: Inter, sans-serif;
|
|
106
|
+
|
|
107
|
+
/* Font Size — mobile (default)
|
|
108
|
+
xs–lg are identical across viewports; xl–5xl scale up at tablet/desktop */
|
|
109
|
+
--font-size-xs: 0.75rem;
|
|
110
|
+
--font-size-sm: 0.875rem;
|
|
111
|
+
--font-size-md: 1rem;
|
|
112
|
+
--font-size-lg: 1.125rem;
|
|
113
|
+
--font-size-xl: 1.25rem; /* mobile.xl */
|
|
114
|
+
--font-size-2xl: 1.5rem; /* mobile.2xl */
|
|
115
|
+
--font-size-3xl: 2rem; /* mobile.3xl */
|
|
116
|
+
--font-size-4xl: 2.5rem; /* mobile.4xl */
|
|
117
|
+
--font-size-5xl: 3rem; /* mobile.5xl */
|
|
118
|
+
|
|
119
|
+
/* Font Weight */
|
|
120
|
+
--font-weight-regular: 400;
|
|
121
|
+
--font-weight-medium: 500;
|
|
122
|
+
--font-weight-semi-bold: 600;
|
|
123
|
+
--font-weight-extra-bold: 800;
|
|
124
|
+
|
|
125
|
+
/* Line Height — ratio utilities (used for body/label text) */
|
|
126
|
+
--line-height-tight: 1.2;
|
|
127
|
+
--line-height-snug: 1.3;
|
|
128
|
+
--line-height-normal: 1.5;
|
|
129
|
+
--line-height-relaxed: 1.75;
|
|
130
|
+
|
|
131
|
+
/* Line Height — absolute, mobile (default)
|
|
132
|
+
xs–lg are identical across viewports; xl–5xl scale up at tablet/desktop */
|
|
133
|
+
--line-height-xs: 1.25rem;
|
|
134
|
+
--line-height-sm: 1.5rem;
|
|
135
|
+
--line-height-md: 1.5rem;
|
|
136
|
+
--line-height-lg: 1.75rem;
|
|
137
|
+
--line-height-xl: 1.75rem; /* mobile.xl */
|
|
138
|
+
--line-height-2xl: 2rem; /* mobile.2xl */
|
|
139
|
+
--line-height-3xl: 2.5rem; /* mobile.3xl */
|
|
140
|
+
--line-height-4xl: 3rem; /* mobile.4xl */
|
|
141
|
+
--line-height-5xl: 3.5rem; /* mobile.5xl */
|
|
142
|
+
|
|
143
|
+
/* Border Radius */
|
|
144
|
+
--radius-none: 0;
|
|
145
|
+
--radius-xs: 0.125rem;
|
|
146
|
+
--radius-sm: 0.25rem;
|
|
147
|
+
--radius-md: 0.5rem;
|
|
148
|
+
--radius-lg: 0.75rem;
|
|
149
|
+
--radius-xl: 1rem;
|
|
150
|
+
--radius-2xl: 1.5rem;
|
|
151
|
+
--radius-full: 9999px;
|
|
152
|
+
|
|
153
|
+
/* Shadow */
|
|
154
|
+
--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
155
|
+
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
156
|
+
--shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
|
|
157
|
+
--shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.16);
|
|
158
|
+
--shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.2);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
/* ============================================================
|
|
163
|
+
CORE TOKENS — responsive overrides
|
|
164
|
+
font-size and line-height xl–5xl scale up at tablet/desktop
|
|
165
|
+
============================================================ */
|
|
166
|
+
|
|
167
|
+
@media (min-width: 768px) {
|
|
168
|
+
:root {
|
|
169
|
+
--font-size-xl: 1.5rem; /* tablet.xl */
|
|
170
|
+
--font-size-2xl: 2rem; /* tablet.2xl */
|
|
171
|
+
--font-size-3xl: 2.5rem; /* tablet.3xl */
|
|
172
|
+
--font-size-4xl: 3rem; /* tablet.4xl */
|
|
173
|
+
--font-size-5xl: 4rem; /* tablet.5xl */
|
|
174
|
+
|
|
175
|
+
--line-height-xl: 2rem; /* tablet.xl */
|
|
176
|
+
--line-height-2xl: 2.5rem; /* tablet.2xl */
|
|
177
|
+
--line-height-3xl: 3rem; /* tablet.3xl */
|
|
178
|
+
--line-height-4xl: 3.5rem; /* tablet.4xl */
|
|
179
|
+
--line-height-5xl: 4rem; /* tablet.5xl */
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@media (min-width: 992px) {
|
|
184
|
+
:root {
|
|
185
|
+
--font-size-xl: 1.75rem; /* desktop.xl */
|
|
186
|
+
--font-size-2xl: 2.5rem; /* desktop.2xl */
|
|
187
|
+
--font-size-3xl: 3rem; /* desktop.3xl */
|
|
188
|
+
--font-size-4xl: 3.5rem; /* desktop.4xl */
|
|
189
|
+
--font-size-5xl: 5rem; /* desktop.5xl */
|
|
190
|
+
|
|
191
|
+
--line-height-xl: 2.25rem; /* desktop.xl */
|
|
192
|
+
--line-height-2xl: 3rem; /* desktop.2xl */
|
|
193
|
+
--line-height-3xl: 3.5rem; /* desktop.3xl */
|
|
194
|
+
--line-height-4xl: 4rem; /* desktop.4xl */
|
|
195
|
+
--line-height-5xl: 5.5rem; /* desktop.5xl */
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* ============================================================
|
|
200
|
+
SEMANTIC TOKENS
|
|
201
|
+
Use these in components. They map intent → core values.
|
|
202
|
+
============================================================ */
|
|
203
|
+
|
|
204
|
+
:root {
|
|
205
|
+
/* Button — Primary */
|
|
206
|
+
--button-primary-background: var(--color-coral-700);
|
|
207
|
+
--button-primary-background-hover: var(--color-coral-600);
|
|
208
|
+
--button-primary-background-active: var(--color-coral-500);
|
|
209
|
+
--button-primary-text: var(--color-slate-50);
|
|
210
|
+
--button-primary-border: var(--color-coral-700);
|
|
211
|
+
|
|
212
|
+
/* Button — Secondary */
|
|
213
|
+
--button-secondary-background: var(--color-slate-50);
|
|
214
|
+
--button-secondary-background-hover: var(--color-slate-75);
|
|
215
|
+
--button-secondary-background-active: var(--color-slate-100);
|
|
216
|
+
--button-secondary-text: var(--color-slate-1200);
|
|
217
|
+
--button-secondary-border: var(--color-slate-300);
|
|
218
|
+
|
|
219
|
+
/* Button — Ghost */
|
|
220
|
+
--button-ghost-background: var(--color-opacity-white-4);
|
|
221
|
+
--button-ghost-background-hover: var(--color-opacity-white-8);
|
|
222
|
+
--button-ghost-background-active: var(--color-opacity-white-16);
|
|
223
|
+
--button-ghost-text: var(--color-slate-1200);
|
|
224
|
+
--button-ghost-border: var(--color-opacity-white-4);
|
|
225
|
+
|
|
226
|
+
/* Button — Danger */
|
|
227
|
+
--button-danger-background: var(--color-cherry-700);
|
|
228
|
+
--button-danger-background-hover: var(--color-cherry-800);
|
|
229
|
+
--button-danger-background-active: var(--color-cherry-900);
|
|
230
|
+
--button-danger-text: var(--color-slate-50);
|
|
231
|
+
--button-danger-border: var(--color-cherry-700);
|
|
232
|
+
|
|
233
|
+
/* Button — Disabled */
|
|
234
|
+
--button-disabled-background: var(--color-slate-200);
|
|
235
|
+
--button-disabled-text: var(--color-slate-500);
|
|
236
|
+
--button-disabled-border: var(--color-slate-200);
|
|
237
|
+
|
|
238
|
+
/* Link — Coral scheme */
|
|
239
|
+
--link-coral-color: var(--color-coral-500);
|
|
240
|
+
|
|
241
|
+
/* Link — Black scheme */
|
|
242
|
+
--link-black-color: var(--color-slate-1300);
|
|
243
|
+
|
|
244
|
+
/* Link — White scheme */
|
|
245
|
+
--link-white-color: var(--color-slate-50);
|
|
246
|
+
|
|
247
|
+
/* Link — Shared */
|
|
248
|
+
--link-disabled-opacity: 0.24;
|
|
249
|
+
|
|
250
|
+
/* Tag */
|
|
251
|
+
--tag-fill-background: var(--color-opacity-slate-4);
|
|
252
|
+
--tag-outline-border: var(--color-opacity-slate-8);
|
|
253
|
+
--tag-text-color: var(--color-opacity-slate-72);
|
|
254
|
+
|
|
255
|
+
/* Chip */
|
|
256
|
+
--chip-border-color: var(--color-opacity-slate-8);
|
|
257
|
+
--chip-text-color: var(--color-opacity-slate-72);
|
|
258
|
+
--chip-hover-background: var(--color-opacity-slate-8);
|
|
259
|
+
--chip-active-background: var(--color-opacity-slate-16);
|
|
260
|
+
--chip-selected-background: var(--color-slate-1200);
|
|
261
|
+
--chip-selected-text: var(--color-slate-50);
|
|
262
|
+
--chip-disabled-text: var(--color-opacity-slate-24);
|
|
263
|
+
--chip-focus-ring-color: var(--color-blue-600);
|
|
264
|
+
|
|
265
|
+
/* Accordion */
|
|
266
|
+
--accordion-divider-color: var(--color-opacity-slate-8);
|
|
267
|
+
--accordion-title-color: var(--color-slate-1200);
|
|
268
|
+
--accordion-body-color: var(--color-slate-1200);
|
|
269
|
+
--accordion-chevron-color: var(--color-opacity-slate-72);
|
|
270
|
+
--accordion-focus-ring-color: var(--color-blue-600);
|
|
271
|
+
|
|
272
|
+
/* TextField — Surface */
|
|
273
|
+
--field-surface-outline: var(--color-slate-50);
|
|
274
|
+
--field-surface-fill: var(--color-opacity-slate-4);
|
|
275
|
+
--field-surface-fill-hover: var(--color-opacity-slate-8);
|
|
276
|
+
--field-surface-fail: var(--color-opacity-red-8);
|
|
277
|
+
--field-surface-fail-hover: var(--color-opacity-red-16);
|
|
278
|
+
--field-surface-success: var(--color-opacity-green-8);
|
|
279
|
+
--field-surface-success-hover: var(--color-opacity-green-16);
|
|
280
|
+
|
|
281
|
+
/* TextField — Border */
|
|
282
|
+
--field-border-default: var(--color-opacity-slate-8);
|
|
283
|
+
--field-border-hover: var(--color-opacity-slate-16);
|
|
284
|
+
--field-border-focus: var(--color-slate-1300);
|
|
285
|
+
--field-border-fail-default: var(--color-opacity-red-72);
|
|
286
|
+
--field-border-fail-hover: var(--color-opacity-red-88);
|
|
287
|
+
--field-border-fail-focus: var(--color-red-600);
|
|
288
|
+
--field-border-success-default: var(--color-opacity-green-72);
|
|
289
|
+
--field-border-success-hover: var(--color-opacity-green-88);
|
|
290
|
+
--field-border-success-focus: var(--color-green-600);
|
|
291
|
+
|
|
292
|
+
/* TextField — Text */
|
|
293
|
+
--field-text-default: var(--color-opacity-slate-72);
|
|
294
|
+
--field-text-focus: var(--color-slate-1300);
|
|
295
|
+
--field-text-placeholder: var(--color-opacity-slate-24);
|
|
296
|
+
--field-text-disabled: var(--color-opacity-slate-24);
|
|
297
|
+
--field-text-subtle: var(--color-opacity-slate-48);
|
|
298
|
+
--field-text-fail: var(--color-red-600);
|
|
299
|
+
--field-text-success: var(--color-green-600);
|
|
300
|
+
|
|
301
|
+
/* TextField — Icon */
|
|
302
|
+
--field-icon-default: var(--color-opacity-slate-72);
|
|
303
|
+
--field-icon-disabled: var(--color-opacity-slate-24);
|
|
304
|
+
--field-icon-subtle: var(--color-opacity-slate-48);
|
|
305
|
+
|
|
306
|
+
/* Breadcrumb */
|
|
307
|
+
--breadcrumb-text-color: var(--color-opacity-slate-72);
|
|
308
|
+
--breadcrumb-text-current-color: var(--color-opacity-slate-48);
|
|
309
|
+
--breadcrumb-separator-color: var(--color-opacity-slate-48);
|
|
310
|
+
--breadcrumb-focus-ring-color: var(--color-blue-600);
|
|
311
|
+
|
|
312
|
+
/* Chip Dropdown — List panel */
|
|
313
|
+
--chip-dropdown-list-bg: var(--color-slate-50);
|
|
314
|
+
--chip-dropdown-list-border: var(--color-opacity-slate-4);
|
|
315
|
+
--chip-dropdown-list-shadow: 0 16px 24px rgba(0, 0, 0, 0.04), 0 16px 24px rgba(0, 0, 0, 0.02);
|
|
316
|
+
|
|
317
|
+
/* Chip Dropdown — List item */
|
|
318
|
+
--chip-dropdown-item-text: var(--color-opacity-slate-72);
|
|
319
|
+
--chip-dropdown-item-hover-bg: var(--color-opacity-slate-8);
|
|
320
|
+
--chip-dropdown-item-active-bg: var(--color-opacity-slate-16);
|
|
321
|
+
--chip-dropdown-item-selected-check: var(--color-opacity-slate-72);
|
|
322
|
+
|
|
323
|
+
/* Typography — H5
|
|
324
|
+
font-size and line-height are responsive because --font-size-xl
|
|
325
|
+
and --line-height-xl override at each breakpoint in the core section above */
|
|
326
|
+
--typography-h5-font-family: var(--font-family-base);
|
|
327
|
+
--typography-h5-font-size: var(--font-size-xl); /* mobile: 1.25rem → tablet: 1.5rem → desktop: 1.75rem */
|
|
328
|
+
--typography-h5-font-weight: var(--font-weight-extra-bold); /* 800 — all viewports */
|
|
329
|
+
--typography-h5-line-height: var(--line-height-xl); /* mobile: 1.75rem → tablet: 2rem → desktop: 2.25rem */
|
|
330
|
+
|
|
331
|
+
/* Typography — body-md (semantic/typography.json → body-md)
|
|
332
|
+
md is identical across all viewports — no responsive overrides needed */
|
|
333
|
+
--typography-body-md-font-family: var(--font-family-base);
|
|
334
|
+
--typography-body-md-font-size: var(--font-size-md); /* {font-size.*.md} = 1rem */
|
|
335
|
+
--typography-body-md-font-weight: var(--font-weight-regular); /* 400 */
|
|
336
|
+
--typography-body-md-line-height: var(--line-height-md); /* {line-height.*.md} = 1.5rem */
|
|
337
|
+
|
|
338
|
+
/* Pagination — Page */
|
|
339
|
+
--pagination-page-radius: var(--radius-full);
|
|
340
|
+
--pagination-page-text: var(--color-opacity-slate-72);
|
|
341
|
+
--pagination-page-selected-bg: var(--color-slate-1400);
|
|
342
|
+
--pagination-page-selected-text: var(--color-slate-50);
|
|
343
|
+
--pagination-page-ellipsis-text: var(--color-opacity-slate-24);
|
|
344
|
+
|
|
345
|
+
/* Pagination — Nav */
|
|
346
|
+
--pagination-nav-icon: var(--color-slate-1400);
|
|
347
|
+
--pagination-nav-icon-disabled: var(--color-opacity-slate-24);
|
|
348
|
+
}
|