@deriv-web-design/ui 0.0.7 → 0.0.9
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 +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +4 -4
- package/tokens.css +213 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deriv-web-design/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@lottiefiles/dotlottie-react": "^0.6.5"
|
|
31
|
-
"framer-motion": "^12.38.0"
|
|
30
|
+
"@lottiefiles/dotlottie-react": "^0.6.5"
|
|
32
31
|
},
|
|
33
32
|
"peerDependencies": {
|
|
34
33
|
"react": "^18 || ^19",
|
|
35
|
-
"react-dom": "^18 || ^19"
|
|
34
|
+
"react-dom": "^18 || ^19",
|
|
35
|
+
"framer-motion": "^11 || ^12"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@storybook/react": "^10.2.17",
|
package/tokens.css
CHANGED
|
@@ -46,6 +46,24 @@
|
|
|
46
46
|
--color-cherry-800: #f50032;
|
|
47
47
|
--color-cherry-900: #dc002c;
|
|
48
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
|
+
|
|
49
67
|
/* Color — Opacity / Slate */
|
|
50
68
|
--color-opacity-slate-4: rgba(24, 28, 37, 0.04);
|
|
51
69
|
--color-opacity-slate-8: rgba(24, 28, 37, 0.08);
|
|
@@ -86,19 +104,17 @@
|
|
|
86
104
|
/* Font Family */
|
|
87
105
|
--font-family-base: Inter, sans-serif;
|
|
88
106
|
|
|
89
|
-
/* Font Size
|
|
90
|
-
|
|
91
|
-
--font-size-
|
|
92
|
-
--font-size-
|
|
93
|
-
--font-size-
|
|
94
|
-
--font-size-
|
|
95
|
-
--font-size-
|
|
96
|
-
--font-size-
|
|
97
|
-
--font-size-
|
|
98
|
-
--font-size-
|
|
99
|
-
--font-size-
|
|
100
|
-
--font-size-7xl: 3.5rem;
|
|
101
|
-
--font-size-8xl: 4rem;
|
|
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 */
|
|
102
118
|
|
|
103
119
|
/* Font Weight */
|
|
104
120
|
--font-weight-regular: 400;
|
|
@@ -106,12 +122,24 @@
|
|
|
106
122
|
--font-weight-semi-bold: 600;
|
|
107
123
|
--font-weight-extra-bold: 800;
|
|
108
124
|
|
|
109
|
-
/* Line Height */
|
|
110
|
-
--line-height-tight:
|
|
111
|
-
--line-height-snug:
|
|
112
|
-
--line-height-normal:
|
|
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;
|
|
113
129
|
--line-height-relaxed: 1.75;
|
|
114
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
|
+
|
|
115
143
|
/* Border Radius */
|
|
116
144
|
--radius-none: 0;
|
|
117
145
|
--radius-xs: 0.125rem;
|
|
@@ -131,6 +159,43 @@
|
|
|
131
159
|
}
|
|
132
160
|
|
|
133
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
|
+
|
|
134
199
|
/* ============================================================
|
|
135
200
|
SEMANTIC TOKENS
|
|
136
201
|
Use these in components. They map intent → core values.
|
|
@@ -169,4 +234,135 @@
|
|
|
169
234
|
--button-disabled-background: var(--color-slate-200);
|
|
170
235
|
--button-disabled-text: var(--color-slate-500);
|
|
171
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
|
+
|
|
349
|
+
/* Bottom Sheet */
|
|
350
|
+
--bottom-sheet-overlay-bg: var(--color-opacity-slate-72);
|
|
351
|
+
--bottom-sheet-bg: var(--color-slate-50);
|
|
352
|
+
--bottom-sheet-handle-color: var(--color-opacity-slate-24);
|
|
353
|
+
--bottom-sheet-title-color: var(--color-slate-1200);
|
|
354
|
+
--bottom-sheet-close-icon-color: var(--color-slate-1200);
|
|
355
|
+
--bottom-sheet-close-hover-bg: var(--color-opacity-slate-8);
|
|
356
|
+
--bottom-sheet-close-active-bg: var(--color-opacity-slate-16);
|
|
357
|
+
--bottom-sheet-focus-ring-color: var(--color-blue-600);
|
|
358
|
+
--bottom-sheet-shadow: var(--shadow-lg);
|
|
359
|
+
--bottom-sheet-action-primary-bg: var(--color-slate-1200);
|
|
360
|
+
--bottom-sheet-action-primary-bg-hover: var(--color-slate-1100);
|
|
361
|
+
--bottom-sheet-action-primary-bg-active: var(--color-slate-1000);
|
|
362
|
+
--bottom-sheet-action-primary-text: var(--color-slate-50);
|
|
363
|
+
--bottom-sheet-action-secondary-border: var(--color-slate-1200);
|
|
364
|
+
--bottom-sheet-action-secondary-text: var(--color-slate-1200);
|
|
365
|
+
--bottom-sheet-action-secondary-hover-bg: var(--color-opacity-slate-8);
|
|
366
|
+
--bottom-sheet-action-secondary-active-bg:var(--color-opacity-slate-16);
|
|
367
|
+
--bottom-sheet-list-item-border: var(--color-opacity-slate-8);
|
|
172
368
|
}
|