@finhay-pro/leaf-design-system 0.1.6 → 0.1.8
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/README.md +352 -163
- package/dist/button.css +12 -15
- package/dist/calendar.css +325 -0
- package/dist/cdn/leaf-0.1.8.min.css +2 -0
- package/dist/cdn/leaf-0.1.8.min.js +2 -0
- package/dist/checkbox.css +132 -0
- package/dist/classes.css +2256 -1513
- package/dist/color.css +27 -32
- package/dist/components/Calendar/Calendar.d.ts +49 -0
- package/dist/components/Calendar/Calendar.d.ts.map +1 -0
- package/dist/components/Calendar/Calendar.js +167 -0
- package/dist/components/Calendar/Calendar.js.map +1 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Calendar/index.d.ts.map +1 -0
- package/dist/components/Calendar/index.js +2 -0
- package/dist/components/Calendar/index.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +25 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +40 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/Checkbox/index.js +2 -0
- package/dist/components/Checkbox/index.js.map +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +62 -0
- package/dist/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/dist/components/Dropdown/Dropdown.js +197 -0
- package/dist/components/Dropdown/Dropdown.js.map +1 -0
- package/dist/components/Dropdown/LanguageDropdown.d.ts +15 -0
- package/dist/components/Dropdown/LanguageDropdown.d.ts.map +1 -0
- package/dist/components/Dropdown/LanguageDropdown.js +18 -0
- package/dist/components/Dropdown/LanguageDropdown.js.map +1 -0
- package/dist/components/Dropdown/index.d.ts +4 -0
- package/dist/components/Dropdown/index.d.ts.map +1 -0
- package/dist/components/Dropdown/index.js +5 -0
- package/dist/components/Dropdown/index.js.map +1 -0
- package/dist/components/Input/Input.d.ts +57 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/Input.js +78 -0
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Input/InputDate.d.ts +56 -0
- package/dist/components/Input/InputDate.d.ts.map +1 -0
- package/dist/components/Input/InputDate.js +119 -0
- package/dist/components/Input/InputDate.js.map +1 -0
- package/dist/components/Input/InputOtp.d.ts +33 -0
- package/dist/components/Input/InputOtp.d.ts.map +1 -0
- package/dist/components/Input/InputOtp.js +96 -0
- package/dist/components/Input/InputOtp.js.map +1 -0
- package/dist/components/Input/InputStepper.d.ts +42 -0
- package/dist/components/Input/InputStepper.d.ts.map +1 -0
- package/dist/components/Input/InputStepper.js +86 -0
- package/dist/components/Input/InputStepper.js.map +1 -0
- package/dist/components/Input/index.d.ts +5 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Input/index.js +5 -0
- package/dist/components/Input/index.js.map +1 -0
- package/dist/components/Radio/Radio.d.ts +39 -0
- package/dist/components/Radio/Radio.d.ts.map +1 -0
- package/dist/components/Radio/Radio.js +50 -0
- package/dist/components/Radio/Radio.js.map +1 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/index.d.ts.map +1 -0
- package/dist/components/Radio/index.js +2 -0
- package/dist/components/Radio/index.js.map +1 -0
- package/dist/components/Toast/Toast.d.ts +66 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/Toast.js +77 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/index.js.map +1 -0
- package/dist/core/calendar.d.ts +36 -0
- package/dist/core/calendar.d.ts.map +1 -0
- package/dist/core/calendar.js +65 -0
- package/dist/core/calendar.js.map +1 -0
- package/dist/core/dropdown.d.ts +66 -0
- package/dist/core/dropdown.d.ts.map +1 -0
- package/dist/core/dropdown.js +131 -0
- package/dist/core/dropdown.js.map +1 -0
- package/dist/core/language.d.ts +25 -0
- package/dist/core/language.d.ts.map +1 -0
- package/dist/core/language.js +17 -0
- package/dist/core/language.js.map +1 -0
- package/dist/core/otp.d.ts +30 -0
- package/dist/core/otp.d.ts.map +1 -0
- package/dist/core/otp.js +65 -0
- package/dist/core/otp.js.map +1 -0
- package/dist/core/stepper.d.ts +39 -0
- package/dist/core/stepper.d.ts.map +1 -0
- package/dist/core/stepper.js +109 -0
- package/dist/core/stepper.js.map +1 -0
- package/dist/core/toast.d.ts +67 -0
- package/dist/core/toast.d.ts.map +1 -0
- package/dist/core/toast.js +102 -0
- package/dist/core/toast.js.map +1 -0
- package/dist/dialog.css +15 -9
- package/dist/dropdown.css +303 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/input-date.css +49 -0
- package/dist/input-otp.css +76 -0
- package/dist/input-stepper.css +179 -0
- package/dist/input.css +218 -0
- package/dist/logo.css +2 -2
- package/dist/radio.css +124 -0
- package/dist/slider.css +16 -14
- package/dist/spinner.css +3 -3
- package/dist/styles.css +2255 -1545
- package/dist/tabs.css +5 -4
- package/dist/toast.css +234 -0
- package/dist/toggle.css +4 -3
- package/dist/tokens.css +0 -33
- package/dist/tooltip.css +13 -12
- package/dist/typography.css +1 -3
- package/package.json +10 -3
- package/dist/border.css +0 -45
- package/dist/cdn/leaf-0.1.6.min.css +0 -2
- package/dist/cdn/leaf-0.1.6.min.js +0 -2
- package/dist/spacing.css +0 -839
package/dist/classes.css
CHANGED
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
/* Mặc định: size lg — Figma Large: h 56 · px XL · py S · gap L · icon 30 */
|
|
24
24
|
/* --leaf-button-width chỉ set khi prop width; không set → auto / icon-only = height */
|
|
25
25
|
--leaf-button-height: 56px;
|
|
26
|
-
--leaf-button-padding:
|
|
27
|
-
--leaf-button-icon-only-padding:
|
|
28
|
-
--leaf-button-gap:
|
|
26
|
+
--leaf-button-padding: 8px 24px;
|
|
27
|
+
--leaf-button-icon-only-padding: 8px;
|
|
28
|
+
--leaf-button-gap: 16px;
|
|
29
29
|
--leaf-button-icon-size: 30px;
|
|
30
30
|
--leaf-button-font-size: var(--body-1-size);
|
|
31
31
|
--leaf-button-line-height: var(--body-1-line-height);
|
|
@@ -50,16 +50,16 @@
|
|
|
50
50
|
border-radius: 1000px;
|
|
51
51
|
background-color: var(--leaf-button-bg);
|
|
52
52
|
color: var(--leaf-button-fg);
|
|
53
|
-
text-align: center;
|
|
54
|
-
white-space: nowrap;
|
|
55
53
|
font: inherit;
|
|
56
54
|
font-family: var(--font-sans);
|
|
57
55
|
font-size: var(--leaf-button-font-size);
|
|
58
56
|
line-height: var(--leaf-button-line-height);
|
|
59
57
|
font-weight: var(--leaf-button-font-weight);
|
|
60
58
|
letter-spacing: var(--leaf-button-letter-spacing);
|
|
61
|
-
text-
|
|
59
|
+
text-align: center;
|
|
60
|
+
white-space: nowrap;
|
|
62
61
|
vertical-align: middle;
|
|
62
|
+
text-decoration: none;
|
|
63
63
|
appearance: none;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -80,10 +80,7 @@
|
|
|
80
80
|
height: 1em;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
/*
|
|
84
|
-
* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để `hidden` luôn ẩn
|
|
85
|
-
* (bản vanilla ẩn leading icon khi loading), không trông vào preflight của Tailwind.
|
|
86
|
-
*/
|
|
83
|
+
/* `hidden` luôn ẩn — rule trên set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
87
84
|
.leaf-button[hidden],
|
|
88
85
|
.leaf-button__icon[hidden] {
|
|
89
86
|
display: none;
|
|
@@ -96,8 +93,8 @@
|
|
|
96
93
|
.leaf-button[data-size="md"] {
|
|
97
94
|
/* Medium: px L · py S · gap M · icon 24 · frame 40 */
|
|
98
95
|
--leaf-button-height: 40px;
|
|
99
|
-
--leaf-button-padding:
|
|
100
|
-
--leaf-button-gap:
|
|
96
|
+
--leaf-button-padding: 8px 16px;
|
|
97
|
+
--leaf-button-gap: 12px;
|
|
101
98
|
--leaf-button-icon-size: 24px;
|
|
102
99
|
--leaf-button-font-size: var(--body-3-size);
|
|
103
100
|
--leaf-button-line-height: var(--body-3-line-height);
|
|
@@ -108,9 +105,9 @@
|
|
|
108
105
|
.leaf-button[data-size="sm"] {
|
|
109
106
|
/* Small: px M · py XS · gap S · icon 20 · frame 28 */
|
|
110
107
|
--leaf-button-height: 28px;
|
|
111
|
-
--leaf-button-padding:
|
|
112
|
-
--leaf-button-icon-only-padding:
|
|
113
|
-
--leaf-button-gap:
|
|
108
|
+
--leaf-button-padding: 4px 12px;
|
|
109
|
+
--leaf-button-icon-only-padding: 4px;
|
|
110
|
+
--leaf-button-gap: 8px;
|
|
114
111
|
--leaf-button-icon-size: 20px;
|
|
115
112
|
--leaf-button-font-size: var(--body-4-size);
|
|
116
113
|
--leaf-button-line-height: var(--body-4-line-height);
|
|
@@ -215,2341 +212,3089 @@
|
|
|
215
212
|
}
|
|
216
213
|
}
|
|
217
214
|
|
|
218
|
-
/* --- src/components/
|
|
215
|
+
/* --- src/components/Calendar/calendar.css --- */
|
|
219
216
|
|
|
220
217
|
/*
|
|
221
|
-
*
|
|
218
|
+
* Calendar — port từ vnsc Calendar (panel chọn ngày / giờ).
|
|
222
219
|
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
220
|
+
* Typography và màu tĩnh (nền, màu viền) là class Leaf trên markup. File này giữ khung
|
|
221
|
+
* (padding, radius, độ dày viền), layout, size cố định (panel 256, ô 28, select 64), hover,
|
|
222
|
+
* trạng thái ngày (data-selected / data-today / :disabled), vị trí dropdown
|
|
223
|
+
* (data-placement), bóng đổ, reset button. Footer là `Button` (cần button.css).
|
|
226
224
|
*/
|
|
227
225
|
|
|
228
226
|
@layer components {
|
|
229
|
-
.leaf-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
z-index: var(--leaf-z-dialog, 50);
|
|
233
|
-
display: flex;
|
|
234
|
-
align-items: center;
|
|
235
|
-
justify-content: center;
|
|
236
|
-
padding: 16px;
|
|
237
|
-
box-sizing: border-box;
|
|
238
|
-
/*
|
|
239
|
-
* Overlay — Figma 995:6039: Overlay/Overlay + blur nhẹ. Chỉ khai báo bản
|
|
240
|
-
* chuẩn: Safari 18+ hỗ trợ `backdrop-filter` không prefix, còn dòng
|
|
241
|
-
* `-webkit-` đặt sau từng ghi đè và làm blur không chạy.
|
|
242
|
-
*/
|
|
243
|
-
background-color: var(--overlay);
|
|
244
|
-
backdrop-filter: blur(5px);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để HTML tĩnh ẩn được. */
|
|
248
|
-
.leaf-dialog-backdrop[hidden] {
|
|
249
|
-
display: none;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.leaf-dialog {
|
|
253
|
-
--leaf-dialog-gap: 16px;
|
|
254
|
-
--leaf-dialog-padding: 16px;
|
|
255
|
-
--leaf-dialog-radius: 12px;
|
|
256
|
-
--leaf-dialog-back-size: 24px;
|
|
257
|
-
--leaf-dialog-close-size: 28px;
|
|
258
|
-
--leaf-dialog-close-icon: 20px;
|
|
227
|
+
.leaf-calendar {
|
|
228
|
+
--leaf-calendar-width: 256px;
|
|
229
|
+
--leaf-calendar-cell: 28px;
|
|
259
230
|
|
|
260
231
|
display: flex;
|
|
261
232
|
flex-direction: column;
|
|
262
|
-
gap:
|
|
263
|
-
/*
|
|
264
|
-
* Width: luôn 100% trong trần maxWidth (responsive).
|
|
265
|
-
* Height: cố định khi có --leaf-dialog-height (content động không giật panel);
|
|
266
|
-
* không có → auto theo nội dung. maxHeight luôn là trần viewport.
|
|
267
|
-
*/
|
|
268
|
-
width: 100%;
|
|
269
|
-
max-width: var(--leaf-dialog-max-width, 100%);
|
|
270
|
-
height: var(--leaf-dialog-height, auto);
|
|
271
|
-
max-height: var(--leaf-dialog-max-height, 100%);
|
|
272
|
-
margin: 0;
|
|
273
|
-
padding: var(--leaf-dialog-padding);
|
|
274
|
-
overflow: hidden;
|
|
233
|
+
gap: 8px;
|
|
275
234
|
box-sizing: border-box;
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
/* Panel nhận focus khi mở (tabindex="-1") — không phải control nên không vẽ outline. */
|
|
283
|
-
.leaf-dialog:focus {
|
|
284
|
-
outline: none;
|
|
235
|
+
width: var(--leaf-calendar-width);
|
|
236
|
+
max-width: 100%;
|
|
237
|
+
padding: 12px;
|
|
238
|
+
border-width: 1px;
|
|
239
|
+
border-style: solid;
|
|
240
|
+
border-radius: 12px;
|
|
285
241
|
}
|
|
286
242
|
|
|
287
|
-
.leaf-
|
|
243
|
+
.leaf-calendar__header {
|
|
244
|
+
position: relative;
|
|
288
245
|
display: flex;
|
|
289
|
-
flex-shrink: 0;
|
|
290
246
|
align-items: center;
|
|
291
247
|
justify-content: space-between;
|
|
292
|
-
gap: var(--leaf-dialog-gap);
|
|
293
|
-
width: 100%;
|
|
294
|
-
min-width: 0;
|
|
295
248
|
}
|
|
296
249
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
display: flex;
|
|
300
|
-
align-items: center;
|
|
301
|
-
gap: var(--leaf-dialog-gap);
|
|
302
|
-
min-width: 0;
|
|
303
|
-
flex: 1 1 auto;
|
|
250
|
+
.leaf-calendar[data-time-only="true"] {
|
|
251
|
+
--leaf-calendar-width: auto;
|
|
304
252
|
}
|
|
305
253
|
|
|
306
|
-
/*
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
254
|
+
/* Reset button của panel — không đụng footer `.leaf-button` (tự reset trong button.css). */
|
|
255
|
+
:is(
|
|
256
|
+
.leaf-calendar__nav,
|
|
257
|
+
.leaf-calendar__title,
|
|
258
|
+
.leaf-calendar__day,
|
|
259
|
+
.leaf-calendar__option,
|
|
260
|
+
.leaf-calendar__select
|
|
261
|
+
) {
|
|
311
262
|
margin: 0;
|
|
312
|
-
min-width: 0;
|
|
313
|
-
overflow: hidden;
|
|
314
|
-
text-overflow: ellipsis;
|
|
315
|
-
white-space: nowrap;
|
|
316
|
-
color: var(--text-primary);
|
|
317
263
|
font-family: var(--font-sans);
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
font-weight: var(--heading-3-weight);
|
|
264
|
+
appearance: none;
|
|
265
|
+
cursor: pointer;
|
|
321
266
|
}
|
|
322
267
|
|
|
323
|
-
.leaf-
|
|
324
|
-
.leaf-dialog__close {
|
|
268
|
+
.leaf-calendar__nav {
|
|
325
269
|
display: inline-flex;
|
|
326
|
-
flex-shrink: 0;
|
|
327
270
|
align-items: center;
|
|
328
271
|
justify-content: center;
|
|
329
|
-
|
|
272
|
+
border-radius: 8px;
|
|
273
|
+
width: var(--leaf-calendar-cell);
|
|
274
|
+
height: var(--leaf-calendar-cell);
|
|
330
275
|
padding: 0;
|
|
331
276
|
border: none;
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
appearance: none;
|
|
337
|
-
box-sizing: border-box;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.leaf-dialog__back {
|
|
341
|
-
width: var(--leaf-dialog-back-size);
|
|
342
|
-
height: var(--leaf-dialog-back-size);
|
|
277
|
+
background-color: var(--base-tertiary);
|
|
278
|
+
font-size: 16px;
|
|
279
|
+
line-height: 1;
|
|
280
|
+
transition: background-color 0.15s ease;
|
|
343
281
|
}
|
|
344
282
|
|
|
345
|
-
.leaf-
|
|
346
|
-
|
|
347
|
-
|
|
283
|
+
.leaf-calendar__nav[data-size="sm"] {
|
|
284
|
+
width: 24px;
|
|
285
|
+
height: 24px;
|
|
286
|
+
font-size: 14px;
|
|
348
287
|
}
|
|
349
288
|
|
|
350
|
-
.leaf-
|
|
351
|
-
|
|
352
|
-
outline: 2px solid var(--text-highlight);
|
|
353
|
-
outline-offset: 2px;
|
|
289
|
+
.leaf-calendar__nav:hover {
|
|
290
|
+
background-color: var(--base-quaternary);
|
|
354
291
|
}
|
|
355
292
|
|
|
356
|
-
.leaf-
|
|
293
|
+
.leaf-calendar__nav > svg,
|
|
294
|
+
.leaf-calendar__caret > svg {
|
|
357
295
|
display: block;
|
|
358
296
|
width: 1em;
|
|
359
297
|
height: 1em;
|
|
360
298
|
}
|
|
361
299
|
|
|
362
|
-
.leaf-
|
|
363
|
-
|
|
300
|
+
.leaf-calendar__title {
|
|
301
|
+
display: inline-flex;
|
|
302
|
+
align-items: center;
|
|
303
|
+
gap: 4px;
|
|
304
|
+
border-radius: 8px;
|
|
305
|
+
padding: 2px 8px;
|
|
306
|
+
border: none;
|
|
307
|
+
background-color: transparent;
|
|
308
|
+
transition: background-color 0.15s ease;
|
|
364
309
|
}
|
|
365
310
|
|
|
366
|
-
.leaf-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
padding: 4px 6px;
|
|
370
|
-
border-radius: 100px;
|
|
371
|
-
background-color: var(--base-secondary);
|
|
372
|
-
font-size: var(--leaf-dialog-close-icon);
|
|
311
|
+
.leaf-calendar__title:hover,
|
|
312
|
+
.leaf-calendar__title[aria-expanded="true"] {
|
|
313
|
+
background-color: var(--base-tertiary);
|
|
373
314
|
}
|
|
374
315
|
|
|
375
|
-
.leaf-
|
|
316
|
+
.leaf-calendar__heading {
|
|
376
317
|
display: flex;
|
|
377
|
-
flex: 1 1 auto;
|
|
378
318
|
flex-direction: column;
|
|
379
|
-
|
|
380
|
-
min-height: 0;
|
|
381
|
-
width: 100%;
|
|
382
|
-
overflow: auto;
|
|
319
|
+
align-items: center;
|
|
383
320
|
}
|
|
384
|
-
}
|
|
385
321
|
|
|
386
|
-
|
|
322
|
+
.leaf-calendar__caret {
|
|
323
|
+
display: inline-flex;
|
|
324
|
+
font-size: 12px;
|
|
325
|
+
color: var(--text-tertiary);
|
|
326
|
+
}
|
|
387
327
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
* HTML tĩnh: span.leaf-logo:empty + data-brand / data-mode / data-side — rule
|
|
393
|
-
* background-image nằm ở logo-assets.css (generated bởi scripts/embed-logo-assets.mjs,
|
|
394
|
-
* không gộp vào classes.css / styles.css; bản CDN đã gộp sẵn).
|
|
395
|
-
* Size (chiều cao) qua --leaf-logo-size.
|
|
396
|
-
*/
|
|
328
|
+
.leaf-calendar__months,
|
|
329
|
+
.leaf-calendar__list {
|
|
330
|
+
box-shadow: 0 16px 40px rgb(0 0 0 / 0.35);
|
|
331
|
+
}
|
|
397
332
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
333
|
+
.leaf-calendar__months {
|
|
334
|
+
position: absolute;
|
|
335
|
+
top: 100%;
|
|
336
|
+
right: 0;
|
|
337
|
+
left: 0;
|
|
338
|
+
z-index: 30;
|
|
339
|
+
display: flex;
|
|
340
|
+
flex-direction: column;
|
|
341
|
+
gap: 8px;
|
|
342
|
+
margin-top: 6px;
|
|
343
|
+
padding: 8px;
|
|
344
|
+
border-width: 1px;
|
|
345
|
+
border-style: solid;
|
|
346
|
+
border-radius: 12px;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.leaf-calendar__months-header {
|
|
350
|
+
display: flex;
|
|
402
351
|
align-items: center;
|
|
403
|
-
justify-content:
|
|
404
|
-
margin: 0;
|
|
405
|
-
padding: 0;
|
|
406
|
-
border: none;
|
|
407
|
-
background: transparent;
|
|
408
|
-
background-repeat: no-repeat;
|
|
409
|
-
background-position: center;
|
|
410
|
-
background-size: contain;
|
|
411
|
-
line-height: 0;
|
|
412
|
-
vertical-align: middle;
|
|
413
|
-
box-sizing: border-box;
|
|
352
|
+
justify-content: space-between;
|
|
414
353
|
}
|
|
415
354
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
width: calc(var(--leaf-logo-size, 40px) * var(--leaf-logo-aspect, 1));
|
|
355
|
+
.leaf-calendar__months-grid {
|
|
356
|
+
display: grid;
|
|
357
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
358
|
+
gap: 4px;
|
|
421
359
|
}
|
|
422
360
|
|
|
423
|
-
.leaf-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
361
|
+
.leaf-calendar__weekdays,
|
|
362
|
+
.leaf-calendar__days {
|
|
363
|
+
display: grid;
|
|
364
|
+
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
365
|
+
gap: 2px;
|
|
428
366
|
}
|
|
429
367
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
368
|
+
.leaf-calendar__weekday {
|
|
369
|
+
padding-block: 2px;
|
|
370
|
+
text-align: center;
|
|
433
371
|
}
|
|
434
|
-
}
|
|
435
372
|
|
|
436
|
-
|
|
373
|
+
.leaf-calendar__num,
|
|
374
|
+
.leaf-calendar__select,
|
|
375
|
+
.leaf-calendar__option--time {
|
|
376
|
+
font-variant-numeric: tabular-nums;
|
|
377
|
+
}
|
|
437
378
|
|
|
438
|
-
/*
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
379
|
+
/* Ô ngày / tháng / giờ — màu theo state nên nằm ở đây, không gắn class màu trên markup. */
|
|
380
|
+
.leaf-calendar__day,
|
|
381
|
+
.leaf-calendar__option {
|
|
382
|
+
display: inline-flex;
|
|
383
|
+
align-items: center;
|
|
384
|
+
justify-content: center;
|
|
385
|
+
border-radius: 8px;
|
|
386
|
+
height: var(--leaf-calendar-cell);
|
|
387
|
+
padding: 0;
|
|
388
|
+
border: 1px solid transparent;
|
|
389
|
+
background-color: transparent;
|
|
390
|
+
color: var(--text-primary);
|
|
391
|
+
transition:
|
|
392
|
+
background-color 0.15s ease,
|
|
393
|
+
color 0.15s ease;
|
|
394
|
+
}
|
|
445
395
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
--leaf-skeleton-radius: 12px;
|
|
396
|
+
.leaf-calendar__option--time {
|
|
397
|
+
flex-shrink: 0;
|
|
398
|
+
height: 24px;
|
|
399
|
+
}
|
|
451
400
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
box-sizing: border-box;
|
|
455
|
-
width: var(--leaf-skeleton-width);
|
|
456
|
-
height: var(--leaf-skeleton-height);
|
|
457
|
-
border-radius: var(--leaf-skeleton-radius);
|
|
401
|
+
.leaf-calendar__day:not(:disabled):not([data-selected="true"]):hover,
|
|
402
|
+
.leaf-calendar__option:not([data-selected="true"]):hover {
|
|
458
403
|
background-color: var(--base-tertiary);
|
|
459
404
|
}
|
|
460
405
|
|
|
461
|
-
.leaf-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
background: linear-gradient(
|
|
465
|
-
to right,
|
|
466
|
-
transparent,
|
|
467
|
-
color-mix(in srgb, var(--base-quinary) 10%, transparent),
|
|
468
|
-
transparent
|
|
469
|
-
);
|
|
470
|
-
animation: leaf-skeleton-shimmer 2s infinite ease-in-out;
|
|
406
|
+
.leaf-calendar__day[data-today="true"] {
|
|
407
|
+
border-color: var(--text-highlight);
|
|
408
|
+
color: var(--text-highlight);
|
|
471
409
|
}
|
|
472
|
-
}
|
|
473
410
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
411
|
+
.leaf-calendar__day[data-selected="true"],
|
|
412
|
+
.leaf-calendar__option[data-selected="true"] {
|
|
413
|
+
border-color: transparent;
|
|
414
|
+
background-color: var(--text-highlight);
|
|
415
|
+
color: var(--text-quaternary);
|
|
416
|
+
font-weight: var(--body-5-highlight-weight);
|
|
480
417
|
}
|
|
481
|
-
}
|
|
482
418
|
|
|
483
|
-
|
|
419
|
+
.leaf-calendar__day:disabled {
|
|
420
|
+
border-color: transparent;
|
|
421
|
+
background-color: transparent;
|
|
422
|
+
color: var(--text-tertiary);
|
|
423
|
+
opacity: 0.5;
|
|
424
|
+
cursor: not-allowed;
|
|
425
|
+
}
|
|
484
426
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
* Rail, mốc và thumb cùng nằm trong vùng lùi vào `--leaf-slider-inset` ở hai đầu
|
|
494
|
-
* (nửa thumb) — nhờ vậy `left: X%` của cả ba khớp nhau và thumb không tràn ra ngoài.
|
|
495
|
-
*/
|
|
427
|
+
.leaf-calendar__day:focus-visible,
|
|
428
|
+
.leaf-calendar__option:focus-visible,
|
|
429
|
+
.leaf-calendar__nav:focus-visible,
|
|
430
|
+
.leaf-calendar__title:focus-visible,
|
|
431
|
+
.leaf-calendar__select:focus-visible {
|
|
432
|
+
outline: 2px solid var(--text-highlight);
|
|
433
|
+
outline-offset: 1px;
|
|
434
|
+
}
|
|
496
435
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
--leaf-slider-fill: 0%;
|
|
501
|
-
--leaf-slider-mark: 6px;
|
|
502
|
-
--leaf-slider-mark-active: 10px;
|
|
503
|
-
--leaf-slider-rail-height: 2px;
|
|
504
|
-
--leaf-slider-inset: calc(var(--leaf-slider-mark-active) / 2);
|
|
505
|
-
--leaf-slider-control-height: max(
|
|
506
|
-
var(--leaf-slider-mark-active),
|
|
507
|
-
var(--leaf-slider-mark),
|
|
508
|
-
20px
|
|
509
|
-
);
|
|
436
|
+
.leaf-calendar__empty {
|
|
437
|
+
height: var(--leaf-calendar-cell);
|
|
438
|
+
}
|
|
510
439
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
/* Figma gap S (8) giữa Title/Unit và khối track+labels. */
|
|
514
|
-
gap: 8px;
|
|
515
|
-
width: 100%;
|
|
516
|
-
box-sizing: border-box;
|
|
517
|
-
font-family: var(--font-sans);
|
|
518
|
-
font-size: var(--body-5-size);
|
|
519
|
-
line-height: var(--body-5-line-height);
|
|
520
|
-
font-weight: var(--body-5-weight);
|
|
521
|
-
color: var(--text-primary);
|
|
522
|
-
user-select: none;
|
|
523
|
-
-webkit-user-select: none;
|
|
440
|
+
.leaf-calendar__divider {
|
|
441
|
+
height: 1px;
|
|
524
442
|
}
|
|
525
443
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
444
|
+
.leaf-calendar__time {
|
|
445
|
+
display: flex;
|
|
446
|
+
align-items: center;
|
|
447
|
+
justify-content: space-between;
|
|
448
|
+
gap: 8px;
|
|
529
449
|
}
|
|
530
450
|
|
|
531
|
-
|
|
532
|
-
.leaf-slider__body {
|
|
451
|
+
.leaf-calendar__time-group {
|
|
533
452
|
display: flex;
|
|
534
|
-
|
|
453
|
+
align-items: center;
|
|
535
454
|
gap: 4px;
|
|
536
|
-
width: 100%;
|
|
537
455
|
}
|
|
538
456
|
|
|
539
|
-
.leaf-
|
|
540
|
-
|
|
541
|
-
|
|
457
|
+
.leaf-calendar__select-wrap {
|
|
458
|
+
position: relative;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.leaf-calendar__select {
|
|
462
|
+
display: inline-flex;
|
|
463
|
+
align-items: center;
|
|
542
464
|
justify-content: space-between;
|
|
543
|
-
|
|
544
|
-
|
|
465
|
+
padding-inline: 8px;
|
|
466
|
+
border-radius: 8px;
|
|
467
|
+
box-sizing: border-box;
|
|
468
|
+
width: 64px;
|
|
469
|
+
height: var(--leaf-calendar-cell);
|
|
470
|
+
padding-block: 0;
|
|
471
|
+
border: 1px solid var(--base-quaternary);
|
|
472
|
+
background-color: var(--base-tertiary);
|
|
545
473
|
color: var(--text-primary);
|
|
546
|
-
white-space: nowrap;
|
|
547
|
-
user-select: text;
|
|
548
|
-
-webkit-user-select: text;
|
|
549
474
|
}
|
|
550
475
|
|
|
551
|
-
.leaf-
|
|
552
|
-
|
|
553
|
-
min-width: 0;
|
|
476
|
+
.leaf-calendar__select[aria-expanded="true"] {
|
|
477
|
+
border-color: var(--text-highlight);
|
|
554
478
|
}
|
|
555
479
|
|
|
556
|
-
.leaf-
|
|
557
|
-
|
|
480
|
+
.leaf-calendar__list {
|
|
481
|
+
position: absolute;
|
|
482
|
+
left: 0;
|
|
483
|
+
z-index: 20;
|
|
484
|
+
display: flex;
|
|
485
|
+
flex-direction: column;
|
|
486
|
+
gap: 2px;
|
|
487
|
+
padding: 4px;
|
|
488
|
+
border-width: 1px;
|
|
489
|
+
border-style: solid;
|
|
490
|
+
border-radius: 8px;
|
|
491
|
+
overflow-y: auto;
|
|
492
|
+
box-sizing: border-box;
|
|
493
|
+
width: 64px;
|
|
494
|
+
max-height: 160px;
|
|
558
495
|
}
|
|
559
496
|
|
|
560
|
-
.leaf-
|
|
561
|
-
|
|
497
|
+
.leaf-calendar__list[data-placement="bottom"] {
|
|
498
|
+
top: 100%;
|
|
499
|
+
margin-top: 4px;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.leaf-calendar__list[data-placement="top"] {
|
|
503
|
+
bottom: 100%;
|
|
504
|
+
margin-bottom: 4px;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.leaf-calendar__footer {
|
|
562
508
|
display: flex;
|
|
563
|
-
|
|
564
|
-
width: 100%;
|
|
565
|
-
height: var(--leaf-slider-control-height);
|
|
566
|
-
outline: none;
|
|
567
|
-
cursor: pointer;
|
|
568
|
-
/* Chỉ khoá gesture trên track — header / labels vẫn cho cuộn trang. */
|
|
569
|
-
touch-action: none;
|
|
509
|
+
gap: 8px;
|
|
570
510
|
}
|
|
571
511
|
|
|
572
|
-
.leaf-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
512
|
+
.leaf-calendar__footer > .leaf-button {
|
|
513
|
+
flex: 1;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.leaf-calendar[hidden],
|
|
517
|
+
.leaf-calendar__header[hidden],
|
|
518
|
+
.leaf-calendar__nav[hidden],
|
|
519
|
+
.leaf-calendar__title[hidden],
|
|
520
|
+
.leaf-calendar__heading[hidden],
|
|
521
|
+
.leaf-calendar__caret[hidden],
|
|
522
|
+
.leaf-calendar__months[hidden],
|
|
523
|
+
.leaf-calendar__months-header[hidden],
|
|
524
|
+
.leaf-calendar__months-grid[hidden],
|
|
525
|
+
.leaf-calendar__weekdays[hidden],
|
|
526
|
+
.leaf-calendar__days[hidden],
|
|
527
|
+
.leaf-calendar__time[hidden],
|
|
528
|
+
.leaf-calendar__time-group[hidden],
|
|
529
|
+
.leaf-calendar__select[hidden],
|
|
530
|
+
.leaf-calendar__footer[hidden],
|
|
531
|
+
.leaf-calendar__list[hidden],
|
|
532
|
+
.leaf-calendar__day[hidden],
|
|
533
|
+
.leaf-calendar__option[hidden] {
|
|
534
|
+
display: none;
|
|
576
535
|
}
|
|
536
|
+
}
|
|
577
537
|
|
|
578
|
-
|
|
579
|
-
|
|
538
|
+
/* --- src/components/Checkbox/checkbox.css --- */
|
|
539
|
+
|
|
540
|
+
/*
|
|
541
|
+
* Checkbox — Figma 891:10191.
|
|
542
|
+
*
|
|
543
|
+
* Selection Unchecked / Checked / Indeterminate qua `:checked` / `:indeterminate`
|
|
544
|
+
* của input native; State Disabled qua `:disabled`. Input phủ kín box (opacity 0)
|
|
545
|
+
* nên click / focus / FormData là của trình duyệt — HTML tĩnh chỉ cần CSS
|
|
546
|
+
* (indeterminate là property DOM, set bằng JS: `input.indeterminate = true`).
|
|
547
|
+
*/
|
|
548
|
+
|
|
549
|
+
@layer components {
|
|
550
|
+
.leaf-checkbox {
|
|
551
|
+
--leaf-checkbox-size: 20px;
|
|
552
|
+
|
|
553
|
+
display: inline-flex;
|
|
554
|
+
flex-direction: column;
|
|
555
|
+
align-items: flex-start;
|
|
556
|
+
gap: 8px;
|
|
557
|
+
vertical-align: top;
|
|
558
|
+
cursor: pointer;
|
|
580
559
|
}
|
|
581
560
|
|
|
582
|
-
.leaf-
|
|
583
|
-
position:
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
height: var(--leaf-slider-rail-height);
|
|
588
|
-
transform: translateY(-50%);
|
|
589
|
-
border-radius: 100px;
|
|
590
|
-
background-color: var(--text-tertiary);
|
|
591
|
-
pointer-events: none;
|
|
561
|
+
.leaf-checkbox__row {
|
|
562
|
+
position: relative;
|
|
563
|
+
display: inline-flex;
|
|
564
|
+
align-items: flex-start;
|
|
565
|
+
gap: 8px;
|
|
592
566
|
}
|
|
593
567
|
|
|
594
|
-
.leaf-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
border-radius: inherit;
|
|
599
|
-
background-color: var(--text-primary);
|
|
568
|
+
.leaf-checkbox[hidden],
|
|
569
|
+
.leaf-checkbox__row[hidden],
|
|
570
|
+
.leaf-checkbox__box[hidden] {
|
|
571
|
+
display: none;
|
|
600
572
|
}
|
|
601
573
|
|
|
602
|
-
|
|
603
|
-
.leaf-
|
|
604
|
-
|
|
605
|
-
z-index: 1;
|
|
606
|
-
left: var(--leaf-slider-inset);
|
|
607
|
-
right: var(--leaf-slider-inset);
|
|
608
|
-
top: 50%;
|
|
609
|
-
height: 0;
|
|
610
|
-
pointer-events: none;
|
|
574
|
+
.leaf-checkbox__label,
|
|
575
|
+
.leaf-checkbox__text {
|
|
576
|
+
color: var(--text-primary);
|
|
611
577
|
}
|
|
612
578
|
|
|
613
|
-
.leaf-
|
|
579
|
+
.leaf-checkbox__input {
|
|
614
580
|
position: absolute;
|
|
615
581
|
top: 0;
|
|
616
582
|
left: 0;
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
width: var(--leaf-slider-mark);
|
|
620
|
-
height: var(--leaf-slider-mark);
|
|
583
|
+
width: var(--leaf-checkbox-size);
|
|
584
|
+
height: var(--leaf-checkbox-size);
|
|
621
585
|
margin: 0;
|
|
622
586
|
padding: 0;
|
|
623
587
|
border: none;
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
cursor: pointer;
|
|
588
|
+
opacity: 0;
|
|
589
|
+
cursor: inherit;
|
|
627
590
|
appearance: none;
|
|
628
591
|
-webkit-appearance: none;
|
|
629
|
-
pointer-events: auto;
|
|
630
|
-
transform: translate(-50%, -50%);
|
|
631
|
-
transition: background-color 0.15s ease;
|
|
632
592
|
}
|
|
633
593
|
|
|
634
|
-
.leaf-
|
|
635
|
-
|
|
594
|
+
.leaf-checkbox__box {
|
|
595
|
+
display: inline-flex;
|
|
596
|
+
flex-shrink: 0;
|
|
597
|
+
align-items: center;
|
|
598
|
+
justify-content: center;
|
|
599
|
+
border-radius: 4px;
|
|
600
|
+
box-sizing: border-box;
|
|
601
|
+
width: var(--leaf-checkbox-size);
|
|
602
|
+
height: var(--leaf-checkbox-size);
|
|
603
|
+
border: 1.5px solid var(--text-secondary);
|
|
604
|
+
background-color: transparent;
|
|
605
|
+
color: var(--icon-on-color);
|
|
606
|
+
transition:
|
|
607
|
+
background-color 0.15s ease,
|
|
608
|
+
border-color 0.15s ease;
|
|
636
609
|
}
|
|
637
610
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
611
|
+
.leaf-checkbox__icon {
|
|
612
|
+
display: none;
|
|
613
|
+
width: 14px;
|
|
614
|
+
height: 14px;
|
|
641
615
|
}
|
|
642
616
|
|
|
643
|
-
|
|
644
|
-
|
|
617
|
+
/* Checked — nền highlight, check trắng. */
|
|
618
|
+
.leaf-checkbox__input:checked + .leaf-checkbox__box {
|
|
619
|
+
border-color: var(--text-highlight);
|
|
620
|
+
background-color: var(--text-highlight);
|
|
645
621
|
}
|
|
646
622
|
|
|
647
|
-
.leaf-
|
|
648
|
-
position: absolute;
|
|
649
|
-
top: 0;
|
|
650
|
-
left: var(--leaf-slider-fill);
|
|
623
|
+
.leaf-checkbox__input:checked:not(:indeterminate) + .leaf-checkbox__box .leaf-checkbox__check {
|
|
651
624
|
display: block;
|
|
652
|
-
box-sizing: border-box;
|
|
653
|
-
width: var(--leaf-slider-mark-active);
|
|
654
|
-
height: var(--leaf-slider-mark-active);
|
|
655
|
-
border-radius: 50%;
|
|
656
|
-
/* Figma Default (min): thumb trắng; Active (> min): highlight. */
|
|
657
|
-
background-color: var(--text-primary);
|
|
658
|
-
transform: translate(-50%, -50%);
|
|
659
|
-
pointer-events: none;
|
|
660
|
-
transition: background-color 0.15s ease;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
.leaf-slider:not([data-at-min="true"]) .leaf-slider__thumb {
|
|
664
|
-
background-color: var(--leaf-slider-active);
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
/* Label căn đúng dưới mốc: cùng vùng lùi với rail; nhãn hai đầu kéo ra sát mép. */
|
|
668
|
-
.leaf-slider__labels {
|
|
669
|
-
position: relative;
|
|
670
|
-
margin-inline: var(--leaf-slider-inset);
|
|
671
|
-
min-height: var(--body-5-line-height);
|
|
672
|
-
user-select: text;
|
|
673
|
-
-webkit-user-select: text;
|
|
674
625
|
}
|
|
675
626
|
|
|
676
|
-
.
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
padding: 0;
|
|
682
|
-
border: none;
|
|
683
|
-
background: none;
|
|
684
|
-
font: inherit;
|
|
685
|
-
color: var(--text-secondary);
|
|
686
|
-
white-space: nowrap;
|
|
687
|
-
transform: translateX(-50%);
|
|
688
|
-
text-align: center;
|
|
689
|
-
cursor: pointer;
|
|
690
|
-
appearance: none;
|
|
691
|
-
-webkit-appearance: none;
|
|
627
|
+
/* Indeterminate — nền primary, gạch ngang tối. */
|
|
628
|
+
.leaf-checkbox__input:indeterminate + .leaf-checkbox__box {
|
|
629
|
+
border-color: var(--text-primary);
|
|
630
|
+
background-color: var(--text-primary);
|
|
631
|
+
color: var(--text-quaternary);
|
|
692
632
|
}
|
|
693
633
|
|
|
694
|
-
.leaf-
|
|
695
|
-
|
|
696
|
-
text-align: left;
|
|
634
|
+
.leaf-checkbox__input:indeterminate + .leaf-checkbox__box .leaf-checkbox__dash {
|
|
635
|
+
display: block;
|
|
697
636
|
}
|
|
698
637
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
638
|
+
/* Disabled */
|
|
639
|
+
.leaf-checkbox__input:disabled + .leaf-checkbox__box {
|
|
640
|
+
border-color: var(--base-quaternary);
|
|
702
641
|
}
|
|
703
642
|
|
|
704
|
-
.leaf-
|
|
705
|
-
|
|
643
|
+
.leaf-checkbox__input:disabled:checked + .leaf-checkbox__box,
|
|
644
|
+
.leaf-checkbox__input:disabled:indeterminate + .leaf-checkbox__box {
|
|
645
|
+
border-color: var(--base-quaternary);
|
|
646
|
+
background-color: var(--base-quaternary);
|
|
647
|
+
color: var(--text-tertiary);
|
|
706
648
|
}
|
|
707
649
|
|
|
708
|
-
.leaf-
|
|
650
|
+
.leaf-checkbox:has(.leaf-checkbox__input:disabled) {
|
|
709
651
|
cursor: not-allowed;
|
|
710
652
|
}
|
|
711
653
|
|
|
712
|
-
.leaf-
|
|
713
|
-
|
|
714
|
-
pointer-events: none;
|
|
654
|
+
.leaf-checkbox:has(.leaf-checkbox__input:disabled) .leaf-checkbox__label {
|
|
655
|
+
color: var(--text-tertiary);
|
|
715
656
|
}
|
|
716
657
|
|
|
717
|
-
.leaf-
|
|
718
|
-
|
|
658
|
+
.leaf-checkbox__input:disabled ~ .leaf-checkbox__text {
|
|
659
|
+
color: var(--text-secondary);
|
|
719
660
|
}
|
|
720
661
|
|
|
721
|
-
.leaf-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
cursor: not-allowed;
|
|
662
|
+
.leaf-checkbox__input:focus-visible + .leaf-checkbox__box {
|
|
663
|
+
outline: 2px solid var(--text-highlight);
|
|
664
|
+
outline-offset: 2px;
|
|
725
665
|
}
|
|
726
666
|
}
|
|
727
667
|
|
|
728
|
-
/* --- src/components/
|
|
668
|
+
/* --- src/components/Dialog/dialog.css --- */
|
|
729
669
|
|
|
730
670
|
/*
|
|
731
|
-
*
|
|
671
|
+
* Dialog — Figma 994:4149.
|
|
732
672
|
*
|
|
733
|
-
*
|
|
734
|
-
* qua
|
|
735
|
-
*
|
|
673
|
+
* Backdrop phủ toàn màn hình + blur; panel căn giữa. Header (back · title · close)
|
|
674
|
+
* bật/tắt qua markup — React chỉ gắn/gỡ phần tử, không gắn class typography/màu
|
|
675
|
+
* theo prop. Thiếu phần header → chỉ còn body (children).
|
|
736
676
|
*/
|
|
737
677
|
|
|
738
678
|
@layer components {
|
|
739
|
-
.leaf-
|
|
740
|
-
--leaf-spinner-size: 24px;
|
|
741
|
-
--leaf-spinner-duration: 1.2s;
|
|
742
|
-
|
|
743
|
-
display: inline-flex;
|
|
744
|
-
flex-shrink: 0;
|
|
745
|
-
align-items: center;
|
|
746
|
-
justify-content: center;
|
|
747
|
-
width: var(--leaf-spinner-size);
|
|
748
|
-
height: var(--leaf-spinner-size);
|
|
749
|
-
color: var(--base-quinary);
|
|
750
|
-
vertical-align: middle;
|
|
751
|
-
line-height: 0;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
.leaf-spinner__icon {
|
|
755
|
-
display: block;
|
|
756
|
-
width: 100%;
|
|
757
|
-
height: 100%;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
/* Fullscreen overlay — pattern Spinner (portal + nền mờ). */
|
|
761
|
-
.leaf-spinner-overlay {
|
|
679
|
+
.leaf-dialog-backdrop {
|
|
762
680
|
position: fixed;
|
|
763
681
|
inset: 0;
|
|
764
|
-
z-index: var(--leaf-z-spinner-overlay, 100);
|
|
765
682
|
display: flex;
|
|
766
683
|
align-items: center;
|
|
767
684
|
justify-content: center;
|
|
685
|
+
z-index: var(--leaf-z-dialog, 50);
|
|
686
|
+
padding: 16px;
|
|
768
687
|
box-sizing: border-box;
|
|
688
|
+
/*
|
|
689
|
+
* Overlay — Figma 995:6039: Overlay/Overlay + blur nhẹ. Chỉ khai báo bản
|
|
690
|
+
* chuẩn: Safari 18+ hỗ trợ `backdrop-filter` không prefix, còn dòng
|
|
691
|
+
* `-webkit-` đặt sau từng ghi đè và làm blur không chạy.
|
|
692
|
+
*/
|
|
769
693
|
background-color: var(--overlay);
|
|
770
|
-
|
|
694
|
+
backdrop-filter: blur(5px);
|
|
771
695
|
}
|
|
772
696
|
|
|
773
|
-
/* `
|
|
774
|
-
.leaf-
|
|
775
|
-
.leaf-
|
|
697
|
+
/* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
698
|
+
.leaf-dialog-backdrop[hidden],
|
|
699
|
+
.leaf-dialog[hidden],
|
|
700
|
+
.leaf-dialog__header[hidden],
|
|
701
|
+
.leaf-dialog__start[hidden],
|
|
702
|
+
.leaf-dialog__back[hidden],
|
|
703
|
+
.leaf-dialog__close[hidden],
|
|
704
|
+
.leaf-dialog__body[hidden] {
|
|
776
705
|
display: none;
|
|
777
706
|
}
|
|
778
707
|
|
|
779
|
-
|
|
708
|
+
.leaf-dialog {
|
|
709
|
+
--leaf-dialog-gap: 16px;
|
|
710
|
+
--leaf-dialog-padding: 16px;
|
|
711
|
+
--leaf-dialog-radius: 12px;
|
|
712
|
+
--leaf-dialog-back-size: 24px;
|
|
713
|
+
--leaf-dialog-close-size: 28px;
|
|
714
|
+
--leaf-dialog-close-icon: 20px;
|
|
780
715
|
|
|
781
|
-
|
|
782
|
-
|
|
716
|
+
display: flex;
|
|
717
|
+
flex-direction: column;
|
|
718
|
+
gap: var(--leaf-dialog-gap);
|
|
719
|
+
overflow: hidden;
|
|
720
|
+
/*
|
|
721
|
+
* Width: luôn 100% trong trần maxWidth (responsive).
|
|
722
|
+
* Height: cố định khi có --leaf-dialog-height (content động không giật panel);
|
|
723
|
+
* không có → auto theo nội dung. maxHeight luôn là trần viewport.
|
|
724
|
+
*/
|
|
725
|
+
width: 100%;
|
|
726
|
+
max-width: var(--leaf-dialog-max-width, 100%);
|
|
727
|
+
height: var(--leaf-dialog-height, auto);
|
|
728
|
+
max-height: var(--leaf-dialog-max-height, 100%);
|
|
729
|
+
margin: 0;
|
|
730
|
+
padding: var(--leaf-dialog-padding);
|
|
731
|
+
box-sizing: border-box;
|
|
732
|
+
border-radius: var(--leaf-dialog-radius);
|
|
733
|
+
background-color: var(--base-primary);
|
|
734
|
+
color: var(--text-primary);
|
|
735
|
+
font-family: var(--font-sans);
|
|
783
736
|
}
|
|
784
737
|
|
|
785
|
-
|
|
786
|
-
|
|
738
|
+
/* Panel nhận focus khi mở (tabindex="-1") — không phải control nên không vẽ outline. */
|
|
739
|
+
.leaf-dialog:focus {
|
|
740
|
+
outline: none;
|
|
787
741
|
}
|
|
788
742
|
|
|
789
|
-
|
|
743
|
+
.leaf-dialog__header {
|
|
744
|
+
display: flex;
|
|
745
|
+
flex-shrink: 0;
|
|
746
|
+
align-items: center;
|
|
747
|
+
justify-content: space-between;
|
|
748
|
+
gap: var(--leaf-dialog-gap);
|
|
749
|
+
width: 100%;
|
|
750
|
+
min-width: 0;
|
|
751
|
+
}
|
|
790
752
|
|
|
791
|
-
/*
|
|
792
|
-
.leaf-
|
|
793
|
-
|
|
794
|
-
|
|
753
|
+
/* Cụm trái: back + title */
|
|
754
|
+
.leaf-dialog__start {
|
|
755
|
+
display: flex;
|
|
756
|
+
flex: auto;
|
|
757
|
+
align-items: center;
|
|
758
|
+
gap: var(--leaf-dialog-gap);
|
|
759
|
+
min-width: 0;
|
|
795
760
|
}
|
|
796
761
|
|
|
797
762
|
/*
|
|
798
|
-
*
|
|
763
|
+
* Title — heading-3 · --text-primary nằm ngay ở đây: markup không cần class typography /
|
|
764
|
+
* màu, nên utility trùng tên của app (vd. `text-primary`) không chen vào.
|
|
799
765
|
*/
|
|
800
|
-
.leaf-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
-
|
|
766
|
+
.leaf-dialog__start > :where(h2, p) {
|
|
767
|
+
min-width: 0;
|
|
768
|
+
overflow: hidden;
|
|
769
|
+
text-overflow: ellipsis;
|
|
770
|
+
white-space: nowrap;
|
|
771
|
+
margin: 0;
|
|
772
|
+
color: var(--text-primary);
|
|
773
|
+
font-family: var(--font-sans);
|
|
774
|
+
font-size: var(--heading-3-size);
|
|
775
|
+
line-height: var(--heading-3-line-height);
|
|
776
|
+
font-weight: var(--heading-3-weight);
|
|
804
777
|
}
|
|
805
778
|
|
|
806
|
-
|
|
807
|
-
.leaf-
|
|
808
|
-
|
|
779
|
+
.leaf-dialog__back,
|
|
780
|
+
.leaf-dialog__close {
|
|
781
|
+
display: inline-flex;
|
|
782
|
+
flex-shrink: 0;
|
|
783
|
+
align-items: center;
|
|
784
|
+
justify-content: center;
|
|
785
|
+
margin: 0;
|
|
786
|
+
padding: 0;
|
|
787
|
+
border: none;
|
|
788
|
+
cursor: pointer;
|
|
789
|
+
color: var(--text-primary);
|
|
790
|
+
background: transparent;
|
|
791
|
+
font: inherit;
|
|
792
|
+
appearance: none;
|
|
793
|
+
box-sizing: border-box;
|
|
809
794
|
}
|
|
810
795
|
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
796
|
+
.leaf-dialog__back {
|
|
797
|
+
width: var(--leaf-dialog-back-size);
|
|
798
|
+
height: var(--leaf-dialog-back-size);
|
|
814
799
|
}
|
|
815
|
-
}
|
|
816
800
|
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
801
|
+
.leaf-dialog__back:hover,
|
|
802
|
+
.leaf-dialog__close:hover {
|
|
803
|
+
color: var(--text-highlight);
|
|
820
804
|
}
|
|
821
|
-
}
|
|
822
805
|
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
806
|
+
.leaf-dialog__back:focus-visible,
|
|
807
|
+
.leaf-dialog__close:focus-visible {
|
|
808
|
+
outline: 2px solid var(--text-highlight);
|
|
809
|
+
outline-offset: 2px;
|
|
827
810
|
}
|
|
828
|
-
|
|
829
|
-
|
|
811
|
+
|
|
812
|
+
.leaf-dialog__icon {
|
|
813
|
+
display: block;
|
|
814
|
+
width: 1em;
|
|
815
|
+
height: 1em;
|
|
830
816
|
}
|
|
831
|
-
}
|
|
832
817
|
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
100% {
|
|
836
|
-
opacity: 0.35;
|
|
818
|
+
.leaf-dialog__back .leaf-dialog__icon {
|
|
819
|
+
font-size: var(--leaf-dialog-back-size);
|
|
837
820
|
}
|
|
838
|
-
|
|
839
|
-
|
|
821
|
+
|
|
822
|
+
.leaf-dialog__close {
|
|
823
|
+
width: var(--leaf-dialog-close-size);
|
|
824
|
+
min-height: var(--leaf-dialog-close-size);
|
|
825
|
+
padding: 4px 6px;
|
|
826
|
+
border-radius: 100px;
|
|
827
|
+
background-color: var(--base-secondary);
|
|
828
|
+
font-size: var(--leaf-dialog-close-icon);
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.leaf-dialog__body {
|
|
832
|
+
display: flex;
|
|
833
|
+
flex: auto;
|
|
834
|
+
flex-direction: column;
|
|
835
|
+
gap: var(--leaf-dialog-gap);
|
|
836
|
+
width: 100%;
|
|
837
|
+
min-height: 0;
|
|
838
|
+
overflow: auto;
|
|
840
839
|
}
|
|
841
840
|
}
|
|
842
841
|
|
|
843
|
-
/* --- src/components/
|
|
842
|
+
/* --- src/components/Dropdown/dropdown.css --- */
|
|
844
843
|
|
|
845
844
|
/*
|
|
846
|
-
*
|
|
845
|
+
* Dropdown — chọn một giá trị từ danh sách.
|
|
847
846
|
*
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
*
|
|
851
|
-
*
|
|
852
|
-
*
|
|
853
|
-
*
|
|
854
|
-
* label) nằm ở đây — React và `leaf.js` chỉ gắn attribute, nên HTML tĩnh viết
|
|
855
|
-
* cùng markup là ra cùng kết quả.
|
|
856
|
-
*
|
|
857
|
-
* Mặc định khi thiếu attribute: variant subcontent, size xl. Chỉ Subcontent đổi
|
|
858
|
-
* theo size; các variant khác có một size duy nhất nên không đọc `data-size`.
|
|
847
|
+
* data-variant: list (mặc định — panel --base-secondary viền --base-tertiary, mục chọn nền
|
|
848
|
+
* --base-tertiary) · radio (panel --base-quaternary, chấm radio --text-highlight bên phải).
|
|
849
|
+
* data-trigger: field (ô full width, data-appearance filled | outlined) · text (chữ +
|
|
850
|
+
* chevron, rộng theo nội dung). data-size: md (Body 4) · sm (Body 5). data-align: start |
|
|
851
|
+
* end. Mở / đóng = `hidden` trên listbox + data-open trên gốc.
|
|
852
|
+
* Thiếu attribute → list · field · filled · md · start.
|
|
859
853
|
*/
|
|
860
854
|
|
|
861
855
|
@layer components {
|
|
862
|
-
.leaf-
|
|
863
|
-
|
|
864
|
-
--leaf-
|
|
865
|
-
--leaf-
|
|
866
|
-
--leaf-
|
|
867
|
-
--leaf-
|
|
868
|
-
--leaf-
|
|
856
|
+
.leaf-dropdown {
|
|
857
|
+
--leaf-dropdown-font-size: var(--body-4-size);
|
|
858
|
+
--leaf-dropdown-line-height: var(--body-4-line-height);
|
|
859
|
+
--leaf-dropdown-weight: var(--body-4-weight);
|
|
860
|
+
--leaf-dropdown-weight-highlight: var(--body-4-highlight-weight);
|
|
861
|
+
--leaf-dropdown-trigger-weight: var(--leaf-dropdown-weight-highlight);
|
|
862
|
+
--leaf-dropdown-option-weight: var(--leaf-dropdown-weight-highlight);
|
|
863
|
+
--leaf-dropdown-chevron-size: 16px;
|
|
864
|
+
--leaf-dropdown-offset: 4px;
|
|
865
|
+
--leaf-dropdown-radius: 12px;
|
|
866
|
+
--leaf-dropdown-radio-size: 24px;
|
|
867
|
+
--leaf-dropdown-radio-ring: 2px;
|
|
869
868
|
|
|
869
|
+
position: relative;
|
|
870
870
|
display: flex;
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
871
|
+
width: 100%;
|
|
872
|
+
min-width: 0;
|
|
873
|
+
box-sizing: border-box;
|
|
874
|
+
font-family: var(--font-sans);
|
|
875
|
+
font-size: var(--leaf-dropdown-font-size);
|
|
876
|
+
line-height: var(--leaf-dropdown-line-height);
|
|
877
|
+
color: var(--text-primary);
|
|
874
878
|
}
|
|
875
879
|
|
|
876
|
-
.leaf-
|
|
877
|
-
--leaf-
|
|
878
|
-
--leaf-
|
|
879
|
-
--leaf-
|
|
880
|
-
--leaf-
|
|
881
|
-
--leaf-
|
|
880
|
+
.leaf-dropdown[data-size="sm"] {
|
|
881
|
+
--leaf-dropdown-font-size: var(--body-5-size);
|
|
882
|
+
--leaf-dropdown-line-height: var(--body-5-line-height);
|
|
883
|
+
--leaf-dropdown-weight: var(--body-5-weight);
|
|
884
|
+
--leaf-dropdown-weight-highlight: var(--body-5-highlight-weight);
|
|
885
|
+
--leaf-dropdown-option-weight: var(--leaf-dropdown-weight);
|
|
886
|
+
--leaf-dropdown-radio-size: 18px;
|
|
887
|
+
--leaf-dropdown-radio-ring: 1.5px;
|
|
882
888
|
}
|
|
883
889
|
|
|
884
|
-
.leaf-
|
|
885
|
-
--leaf-
|
|
886
|
-
--leaf-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
+
.leaf-dropdown[data-trigger="text"] {
|
|
891
|
+
--leaf-dropdown-trigger-weight: var(--leaf-dropdown-weight);
|
|
892
|
+
--leaf-dropdown-chevron-size: 14px;
|
|
893
|
+
display: inline-flex;
|
|
894
|
+
width: max-content;
|
|
895
|
+
max-width: 100%;
|
|
896
|
+
vertical-align: middle;
|
|
890
897
|
}
|
|
891
898
|
|
|
892
|
-
.leaf-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
899
|
+
.leaf-dropdown[hidden],
|
|
900
|
+
.leaf-dropdown__trigger[hidden],
|
|
901
|
+
.leaf-dropdown__value[hidden],
|
|
902
|
+
.leaf-dropdown__leading[hidden],
|
|
903
|
+
.leaf-dropdown__flag[hidden],
|
|
904
|
+
.leaf-dropdown__chevron[hidden],
|
|
905
|
+
.leaf-dropdown__list[hidden],
|
|
906
|
+
.leaf-dropdown__option[hidden],
|
|
907
|
+
.leaf-dropdown__radio[hidden] {
|
|
908
|
+
display: none;
|
|
898
909
|
}
|
|
899
910
|
|
|
900
|
-
|
|
901
|
-
|
|
911
|
+
/* ── Trigger ─────────────────────────────────────────────────────────── */
|
|
912
|
+
|
|
913
|
+
.leaf-dropdown__trigger {
|
|
914
|
+
display: flex;
|
|
902
915
|
align-items: center;
|
|
903
|
-
justify-content:
|
|
904
|
-
|
|
916
|
+
justify-content: space-between;
|
|
917
|
+
gap: 8px;
|
|
918
|
+
width: 100%;
|
|
919
|
+
min-width: 0;
|
|
905
920
|
margin: 0;
|
|
906
|
-
padding:
|
|
907
|
-
cursor: pointer;
|
|
908
|
-
background-color: transparent;
|
|
909
|
-
color: inherit;
|
|
910
|
-
font: inherit;
|
|
911
|
-
font-family: var(--font-sans);
|
|
912
|
-
text-align: center;
|
|
913
|
-
white-space: nowrap;
|
|
921
|
+
padding: 10px 12px;
|
|
914
922
|
box-sizing: border-box;
|
|
923
|
+
border: none;
|
|
924
|
+
border-radius: var(--leaf-dropdown-radius);
|
|
925
|
+
background-color: var(--base-secondary);
|
|
926
|
+
color: var(--text-primary);
|
|
927
|
+
font: inherit;
|
|
928
|
+
font-weight: var(--leaf-dropdown-trigger-weight);
|
|
929
|
+
text-align: left;
|
|
930
|
+
cursor: pointer;
|
|
931
|
+
user-select: none;
|
|
915
932
|
appearance: none;
|
|
916
933
|
}
|
|
917
934
|
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
935
|
+
.leaf-dropdown[data-appearance="outlined"] .leaf-dropdown__trigger {
|
|
936
|
+
padding: 8px 12px;
|
|
937
|
+
border: 1px solid var(--base-quaternary);
|
|
938
|
+
background-color: transparent;
|
|
922
939
|
}
|
|
923
940
|
|
|
924
|
-
.leaf-
|
|
925
|
-
|
|
926
|
-
|
|
941
|
+
.leaf-dropdown[data-trigger="text"] .leaf-dropdown__trigger {
|
|
942
|
+
justify-content: flex-start;
|
|
943
|
+
padding: 0;
|
|
944
|
+
border: none;
|
|
945
|
+
border-radius: 4px;
|
|
946
|
+
background-color: transparent;
|
|
927
947
|
}
|
|
928
948
|
|
|
929
|
-
.leaf-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
justify-content: center;
|
|
933
|
-
line-height: inherit;
|
|
949
|
+
.leaf-dropdown__trigger:focus-visible {
|
|
950
|
+
outline: 2px solid var(--text-highlight);
|
|
951
|
+
outline-offset: 2px;
|
|
934
952
|
}
|
|
935
953
|
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]) .leaf-tab {
|
|
940
|
-
gap: var(--leaf-tab-gap);
|
|
941
|
-
padding: var(--leaf-tab-padding);
|
|
942
|
-
border-radius: 1000px;
|
|
943
|
-
background-color: var(--base-tertiary);
|
|
944
|
-
color: var(--text-secondary);
|
|
945
|
-
font-size: var(--leaf-tab-font-size);
|
|
946
|
-
line-height: var(--leaf-tab-line-height);
|
|
947
|
-
font-weight: var(--leaf-tab-font-weight);
|
|
954
|
+
.leaf-dropdown__trigger[aria-readonly="true"] {
|
|
955
|
+
cursor: default;
|
|
948
956
|
}
|
|
949
957
|
|
|
950
|
-
.leaf-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
color: var(--text-quaternary);
|
|
958
|
+
.leaf-dropdown__trigger:disabled {
|
|
959
|
+
cursor: not-allowed;
|
|
960
|
+
color: var(--text-tertiary);
|
|
954
961
|
}
|
|
955
962
|
|
|
956
|
-
.leaf-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
963
|
+
.leaf-dropdown__value {
|
|
964
|
+
flex: 1 1 auto;
|
|
965
|
+
min-width: 0;
|
|
966
|
+
overflow: hidden;
|
|
967
|
+
text-overflow: ellipsis;
|
|
968
|
+
white-space: nowrap;
|
|
961
969
|
}
|
|
962
970
|
|
|
963
|
-
.leaf-
|
|
964
|
-
|
|
965
|
-
[data-size="sm"]
|
|
966
|
-
)
|
|
967
|
-
.leaf-tab {
|
|
968
|
-
background-color: transparent;
|
|
971
|
+
.leaf-dropdown[data-trigger="text"] .leaf-dropdown__value {
|
|
972
|
+
flex: 0 1 auto;
|
|
969
973
|
}
|
|
970
974
|
|
|
971
|
-
.leaf-
|
|
972
|
-
|
|
973
|
-
[data-size="sm"]
|
|
974
|
-
)
|
|
975
|
-
.leaf-tab[aria-selected="true"] {
|
|
976
|
-
background-color: var(--base-tertiary);
|
|
977
|
-
color: var(--text-primary);
|
|
975
|
+
.leaf-dropdown__value[data-placeholder] {
|
|
976
|
+
color: var(--text-secondary);
|
|
978
977
|
}
|
|
979
978
|
|
|
980
|
-
.leaf-
|
|
981
|
-
[data-size="md"],
|
|
982
|
-
[data-size="sm"]
|
|
983
|
-
)
|
|
984
|
-
.leaf-tab:disabled,
|
|
985
|
-
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
|
|
986
|
-
[data-size="md"],
|
|
987
|
-
[data-size="sm"]
|
|
988
|
-
)
|
|
989
|
-
.leaf-tab[aria-disabled="true"] {
|
|
990
|
-
background-color: transparent;
|
|
979
|
+
.leaf-dropdown__trigger:disabled .leaf-dropdown__value {
|
|
991
980
|
color: var(--text-tertiary);
|
|
992
981
|
}
|
|
993
982
|
|
|
994
|
-
|
|
983
|
+
.leaf-dropdown__leading {
|
|
984
|
+
display: inline-flex;
|
|
985
|
+
flex-shrink: 0;
|
|
986
|
+
align-items: center;
|
|
987
|
+
vertical-align: middle;
|
|
988
|
+
}
|
|
995
989
|
|
|
996
|
-
.leaf-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
font-size: var(--body-4-size);
|
|
1002
|
-
line-height: var(--body-4-line-height);
|
|
1003
|
-
font-weight: var(--body-4-weight);
|
|
990
|
+
.leaf-dropdown__flag {
|
|
991
|
+
display: block;
|
|
992
|
+
width: 20px;
|
|
993
|
+
height: 20px;
|
|
994
|
+
object-fit: contain;
|
|
1004
995
|
}
|
|
1005
996
|
|
|
1006
|
-
.leaf-
|
|
1007
|
-
|
|
1008
|
-
font-weight: var(--body-4-highlight-weight);
|
|
997
|
+
.leaf-dropdown__value > .leaf-dropdown__leading {
|
|
998
|
+
margin-right: 8px;
|
|
1009
999
|
}
|
|
1010
1000
|
|
|
1011
|
-
.leaf-
|
|
1012
|
-
content: "";
|
|
1001
|
+
.leaf-dropdown__chevron {
|
|
1013
1002
|
display: block;
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1003
|
+
flex-shrink: 0;
|
|
1004
|
+
width: var(--leaf-dropdown-chevron-size);
|
|
1005
|
+
height: var(--leaf-dropdown-chevron-size);
|
|
1006
|
+
color: var(--text-secondary);
|
|
1007
|
+
transition: transform 0.2s ease;
|
|
1018
1008
|
}
|
|
1019
1009
|
|
|
1020
|
-
.leaf-
|
|
1021
|
-
|
|
1010
|
+
.leaf-dropdown[data-open="true"] .leaf-dropdown__chevron {
|
|
1011
|
+
transform: rotate(180deg);
|
|
1022
1012
|
}
|
|
1023
1013
|
|
|
1024
|
-
.leaf-
|
|
1025
|
-
.leaf-tabs[data-variant="title"] .leaf-tab[aria-disabled="true"] {
|
|
1014
|
+
.leaf-dropdown__trigger:disabled .leaf-dropdown__chevron {
|
|
1026
1015
|
color: var(--text-tertiary);
|
|
1027
1016
|
}
|
|
1028
1017
|
|
|
1029
|
-
|
|
1030
|
-
.leaf-tabs[data-variant="title"] .leaf-tab[aria-disabled="true"]::after {
|
|
1031
|
-
opacity: 0;
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
/* ── Functional ──────────────────────────────────────────────────────── */
|
|
1018
|
+
/* ── Panel ───────────────────────────────────────────────────────────── */
|
|
1035
1019
|
|
|
1036
|
-
.leaf-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1020
|
+
.leaf-dropdown__list {
|
|
1021
|
+
position: absolute;
|
|
1022
|
+
top: calc(100% + var(--leaf-dropdown-offset));
|
|
1023
|
+
left: 0;
|
|
1024
|
+
z-index: var(--leaf-z-dropdown, 30);
|
|
1025
|
+
display: flex;
|
|
1026
|
+
flex-direction: column;
|
|
1027
|
+
width: 100%;
|
|
1028
|
+
max-height: var(--leaf-dropdown-max-height, none);
|
|
1029
|
+
margin: 0;
|
|
1030
|
+
padding: 0;
|
|
1031
|
+
box-sizing: border-box;
|
|
1032
|
+
overflow-y: auto;
|
|
1033
|
+
list-style: none;
|
|
1034
|
+
border: 1px solid var(--base-tertiary);
|
|
1035
|
+
border-radius: var(--leaf-dropdown-radius);
|
|
1036
|
+
background-color: var(--base-secondary);
|
|
1037
|
+
font-weight: var(--leaf-dropdown-option-weight);
|
|
1046
1038
|
}
|
|
1047
1039
|
|
|
1048
|
-
.leaf-
|
|
1049
|
-
|
|
1050
|
-
|
|
1040
|
+
.leaf-dropdown[data-trigger="text"] .leaf-dropdown__list {
|
|
1041
|
+
width: max-content;
|
|
1042
|
+
min-width: 100%;
|
|
1051
1043
|
}
|
|
1052
1044
|
|
|
1053
|
-
.leaf-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
color: var(--button-disabled-content);
|
|
1045
|
+
.leaf-dropdown[data-align="end"] .leaf-dropdown__list {
|
|
1046
|
+
right: 0;
|
|
1047
|
+
left: auto;
|
|
1057
1048
|
}
|
|
1058
1049
|
|
|
1059
|
-
|
|
1050
|
+
.leaf-dropdown__option {
|
|
1051
|
+
display: flex;
|
|
1052
|
+
align-items: center;
|
|
1053
|
+
gap: 8px;
|
|
1054
|
+
margin: 0;
|
|
1055
|
+
padding: 8px 12px;
|
|
1056
|
+
color: var(--text-secondary);
|
|
1057
|
+
cursor: pointer;
|
|
1058
|
+
transition:
|
|
1059
|
+
background-color 0.15s ease,
|
|
1060
|
+
color 0.15s ease;
|
|
1061
|
+
}
|
|
1060
1062
|
|
|
1061
|
-
.leaf-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
padding: 6px 4px;
|
|
1065
|
-
border-radius: 100px;
|
|
1063
|
+
.leaf-dropdown__option[data-active],
|
|
1064
|
+
.leaf-dropdown__option[aria-selected="true"] {
|
|
1065
|
+
background-color: var(--base-tertiary);
|
|
1066
1066
|
color: var(--text-primary);
|
|
1067
|
-
font-size: var(--body-5-size);
|
|
1068
|
-
line-height: var(--body-5-line-height);
|
|
1069
|
-
font-weight: var(--body-5-weight);
|
|
1070
1067
|
}
|
|
1071
1068
|
|
|
1072
|
-
.leaf-
|
|
1073
|
-
|
|
1069
|
+
.leaf-dropdown__option[aria-disabled="true"] {
|
|
1070
|
+
background-color: transparent;
|
|
1071
|
+
color: var(--text-tertiary);
|
|
1072
|
+
cursor: not-allowed;
|
|
1074
1073
|
}
|
|
1075
1074
|
|
|
1076
|
-
.leaf-
|
|
1077
|
-
|
|
1078
|
-
|
|
1075
|
+
.leaf-dropdown__label {
|
|
1076
|
+
flex: 1 1 auto;
|
|
1077
|
+
min-width: 0;
|
|
1078
|
+
overflow: hidden;
|
|
1079
|
+
text-overflow: ellipsis;
|
|
1080
|
+
white-space: nowrap;
|
|
1079
1081
|
}
|
|
1080
1082
|
|
|
1081
|
-
|
|
1082
|
-
background-color: var(--button-base-secondary-destruction);
|
|
1083
|
-
color: var(--button-base-destruction);
|
|
1084
|
-
}
|
|
1083
|
+
/* ── Variant radio ───────────────────────────────────────────────────── */
|
|
1085
1084
|
|
|
1086
|
-
.leaf-
|
|
1087
|
-
|
|
1088
|
-
color: var(--text-tertiary);
|
|
1089
|
-
background-color: transparent;
|
|
1085
|
+
.leaf-dropdown[data-variant="radio"] {
|
|
1086
|
+
--leaf-dropdown-offset: 8px;
|
|
1090
1087
|
}
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
/* --- src/components/Toggle/toggle.css --- */
|
|
1094
|
-
|
|
1095
|
-
/*
|
|
1096
|
-
* Toggle — Figma 730:12438.
|
|
1097
|
-
*
|
|
1098
|
-
* Size M/S qua data-size; Status On/Off qua aria-checked; Active Off qua
|
|
1099
|
-
* :disabled. Thumb trượt bằng transform. Checkmark chỉ hiện ở size sm khi
|
|
1100
|
-
* On + Active. Thiếu attribute → md · off · enabled.
|
|
1101
|
-
*/
|
|
1102
|
-
|
|
1103
|
-
@layer components {
|
|
1104
|
-
.leaf-toggle {
|
|
1105
|
-
--leaf-toggle-width: 48px;
|
|
1106
|
-
--leaf-toggle-height: 24px;
|
|
1107
|
-
--leaf-toggle-padding: 3px;
|
|
1108
|
-
--leaf-toggle-thumb: 18px;
|
|
1109
|
-
--leaf-toggle-travel: calc(
|
|
1110
|
-
var(--leaf-toggle-width) - var(--leaf-toggle-padding) * 2 - var(--leaf-toggle-thumb)
|
|
1111
|
-
);
|
|
1112
1088
|
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
align-items: center;
|
|
1117
|
-
box-sizing: border-box;
|
|
1118
|
-
width: var(--leaf-toggle-width);
|
|
1119
|
-
height: var(--leaf-toggle-height);
|
|
1120
|
-
margin: 0;
|
|
1121
|
-
padding: var(--leaf-toggle-padding);
|
|
1089
|
+
.leaf-dropdown[data-variant="radio"] .leaf-dropdown__list {
|
|
1090
|
+
gap: 16px;
|
|
1091
|
+
padding: 16px;
|
|
1122
1092
|
border: none;
|
|
1123
|
-
border-radius: 12px;
|
|
1124
1093
|
background-color: var(--base-quaternary);
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1094
|
+
font-weight: var(--leaf-dropdown-weight);
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
.leaf-dropdown[data-variant="radio"] .leaf-dropdown__option {
|
|
1098
|
+
justify-content: space-between;
|
|
1099
|
+
gap: 16px;
|
|
1100
|
+
padding: 0;
|
|
1101
|
+
background-color: transparent;
|
|
1102
|
+
color: var(--text-primary);
|
|
1132
1103
|
}
|
|
1133
1104
|
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
display: none;
|
|
1105
|
+
.leaf-dropdown[data-variant="radio"] .leaf-dropdown__option[aria-selected="true"] {
|
|
1106
|
+
font-weight: var(--leaf-dropdown-weight-highlight);
|
|
1137
1107
|
}
|
|
1138
1108
|
|
|
1139
|
-
.leaf-
|
|
1140
|
-
|
|
1109
|
+
.leaf-dropdown[data-variant="radio"] .leaf-dropdown__option[data-active] {
|
|
1110
|
+
color: var(--text-highlight);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
.leaf-dropdown[data-variant="radio"] .leaf-dropdown__option[aria-disabled="true"] {
|
|
1114
|
+
color: var(--text-tertiary);
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
.leaf-dropdown__radio {
|
|
1118
|
+
display: inline-flex;
|
|
1119
|
+
flex-shrink: 0;
|
|
1141
1120
|
align-items: center;
|
|
1142
1121
|
justify-content: center;
|
|
1143
|
-
width: var(--leaf-
|
|
1144
|
-
height: var(--leaf-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
transform 0.2s ease,
|
|
1150
|
-
background-color 0.2s ease;
|
|
1122
|
+
width: var(--leaf-dropdown-radio-size);
|
|
1123
|
+
height: var(--leaf-dropdown-radio-size);
|
|
1124
|
+
box-sizing: border-box;
|
|
1125
|
+
border: var(--leaf-dropdown-radio-ring) solid var(--text-highlight);
|
|
1126
|
+
border-radius: 9999px;
|
|
1127
|
+
opacity: 0;
|
|
1151
1128
|
}
|
|
1152
1129
|
|
|
1153
|
-
.leaf-
|
|
1154
|
-
display:
|
|
1155
|
-
width:
|
|
1156
|
-
height:
|
|
1157
|
-
|
|
1130
|
+
.leaf-dropdown__dot {
|
|
1131
|
+
display: block;
|
|
1132
|
+
width: 50%;
|
|
1133
|
+
height: 50%;
|
|
1134
|
+
border-radius: 9999px;
|
|
1135
|
+
background-color: var(--text-highlight);
|
|
1158
1136
|
}
|
|
1159
1137
|
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
background-color: var(--system-green);
|
|
1138
|
+
.leaf-dropdown__option[aria-selected="true"] .leaf-dropdown__radio {
|
|
1139
|
+
opacity: 1;
|
|
1163
1140
|
}
|
|
1141
|
+
}
|
|
1164
1142
|
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1143
|
+
/* --- src/components/Input/input-date.css --- */
|
|
1144
|
+
|
|
1145
|
+
/*
|
|
1146
|
+
* InputDate — Input trigger + popover Calendar.
|
|
1147
|
+
*
|
|
1148
|
+
* Popover neo theo khung trigger: dưới (data-placement="bottom", top = đáy khung qua
|
|
1149
|
+
* --leaf-input-date-offset do React đo) hoặc lật lên trên (data-placement="top"). data-align
|
|
1150
|
+
* căn trái / phải. data-open giữ viền + label highlight khi panel mở (invalid vẫn thắng).
|
|
1151
|
+
* Phụ thuộc input.css + calendar.css.
|
|
1152
|
+
*/
|
|
1153
|
+
|
|
1154
|
+
@layer components {
|
|
1155
|
+
.leaf-input-date {
|
|
1156
|
+
position: relative;
|
|
1168
1157
|
}
|
|
1169
1158
|
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
transform: translateX(var(--leaf-toggle-travel));
|
|
1159
|
+
.leaf-input-date__popover {
|
|
1160
|
+
position: absolute;
|
|
1161
|
+
z-index: var(--leaf-z-popover, 100);
|
|
1174
1162
|
}
|
|
1175
1163
|
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
background-color: var(--text-tertiary);
|
|
1164
|
+
.leaf-input-date__popover[data-placement="bottom"] {
|
|
1165
|
+
top: calc(var(--leaf-input-date-offset, 100%) + 8px);
|
|
1179
1166
|
}
|
|
1180
1167
|
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
--leaf-toggle-width: 32px;
|
|
1184
|
-
--leaf-toggle-height: 16px;
|
|
1185
|
-
--leaf-toggle-thumb: 10px;
|
|
1168
|
+
.leaf-input-date__popover[data-placement="top"] {
|
|
1169
|
+
bottom: calc(100% + 8px);
|
|
1186
1170
|
}
|
|
1187
1171
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
display: block;
|
|
1172
|
+
.leaf-input-date__popover[data-align="start"] {
|
|
1173
|
+
left: 0;
|
|
1191
1174
|
}
|
|
1192
1175
|
|
|
1193
|
-
.leaf-
|
|
1194
|
-
|
|
1176
|
+
.leaf-input-date__popover[data-align="end"] {
|
|
1177
|
+
right: 0;
|
|
1195
1178
|
}
|
|
1196
1179
|
|
|
1197
|
-
.leaf-
|
|
1198
|
-
|
|
1199
|
-
|
|
1180
|
+
.leaf-input-date[data-open="true"] .leaf-input:not([data-invalid="true"]) {
|
|
1181
|
+
--leaf-input-border: var(--text-highlight);
|
|
1182
|
+
--leaf-input-label: var(--text-highlight);
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
.leaf-input-date[hidden] {
|
|
1186
|
+
display: none;
|
|
1200
1187
|
}
|
|
1201
1188
|
}
|
|
1202
1189
|
|
|
1203
|
-
/* --- src/components/
|
|
1190
|
+
/* --- src/components/Input/input-otp.css --- */
|
|
1204
1191
|
|
|
1205
1192
|
/*
|
|
1206
|
-
*
|
|
1207
|
-
*
|
|
1208
|
-
* Size sm/md/lg; position top/bottom/left/right; align start/center/end.
|
|
1209
|
-
* Nền --base-quaternary; chữ --text-primary.
|
|
1193
|
+
* InputOtp — Figma 1146:2159 (PIN code).
|
|
1210
1194
|
*
|
|
1211
|
-
*
|
|
1212
|
-
*
|
|
1195
|
+
* Ô 48×56, nền base-tertiary, chữ số heading-3. Focus → viền highlight; data-invalid → viền
|
|
1196
|
+
* đỏ mọi ô + message đỏ; data-disabled / :disabled → chữ secondary. Typography
|
|
1197
|
+
* (heading-3, body-5) là class Leaf trên markup.
|
|
1198
|
+
* HTML tĩnh: hành vi nhảy ô / dán nằm trong leaf.js (`data-leaf-input-otp`).
|
|
1213
1199
|
*/
|
|
1214
1200
|
|
|
1215
1201
|
@layer components {
|
|
1216
|
-
.leaf-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1202
|
+
.leaf-input-otp {
|
|
1203
|
+
--leaf-input-otp-cell-width: 48px;
|
|
1204
|
+
--leaf-input-otp-cell-height: 56px;
|
|
1205
|
+
--leaf-input-otp-border: transparent;
|
|
1206
|
+
--leaf-input-otp-message: var(--text-secondary);
|
|
1207
|
+
|
|
1208
|
+
display: flex;
|
|
1209
|
+
flex-direction: column;
|
|
1210
|
+
gap: 8px;
|
|
1221
1211
|
}
|
|
1222
1212
|
|
|
1223
|
-
.leaf-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
--leaf-tooltip-max-width: 176px;
|
|
1228
|
-
--leaf-tooltip-font-size: var(--body-4-size);
|
|
1229
|
-
--leaf-tooltip-line-height: var(--body-4-line-height);
|
|
1230
|
-
--leaf-tooltip-font-weight: var(--body-4-weight);
|
|
1231
|
-
/* Khung caret dọc theo cạnh (top/bottom). */
|
|
1232
|
-
--leaf-tooltip-caret-w: 44px;
|
|
1233
|
-
--leaf-tooltip-caret-h: 6px;
|
|
1234
|
-
/* Chiều rộng tam giác thật trong khung. */
|
|
1235
|
-
--leaf-tooltip-caret-tip: 12px;
|
|
1213
|
+
.leaf-input-otp__cells {
|
|
1214
|
+
display: flex;
|
|
1215
|
+
gap: 4px;
|
|
1216
|
+
}
|
|
1236
1217
|
|
|
1237
|
-
|
|
1238
|
-
flex-direction: column;
|
|
1239
|
-
align-items: center;
|
|
1240
|
-
max-width: var(--leaf-tooltip-max-width);
|
|
1218
|
+
.leaf-input-otp__cell {
|
|
1241
1219
|
box-sizing: border-box;
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1220
|
+
width: var(--leaf-input-otp-cell-width);
|
|
1221
|
+
height: var(--leaf-input-otp-cell-height);
|
|
1222
|
+
margin: 0;
|
|
1223
|
+
padding: 0;
|
|
1224
|
+
border: 1px solid var(--leaf-input-otp-border);
|
|
1225
|
+
border-radius: 12px;
|
|
1226
|
+
outline: none;
|
|
1227
|
+
background-color: var(--base-tertiary);
|
|
1246
1228
|
color: var(--text-primary);
|
|
1247
|
-
|
|
1229
|
+
text-align: center;
|
|
1230
|
+
caret-color: var(--text-highlight);
|
|
1231
|
+
appearance: none;
|
|
1232
|
+
-webkit-appearance: none;
|
|
1233
|
+
transition: border-color 0.15s ease;
|
|
1248
1234
|
}
|
|
1249
1235
|
|
|
1250
|
-
.leaf-
|
|
1251
|
-
|
|
1252
|
-
z-index: var(--leaf-z-tooltip, 110);
|
|
1236
|
+
.leaf-input-otp__cell:focus {
|
|
1237
|
+
border-color: var(--text-highlight);
|
|
1253
1238
|
}
|
|
1254
1239
|
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1240
|
+
.leaf-input-otp[data-invalid="true"] .leaf-input-otp__cell {
|
|
1241
|
+
border-color: var(--system-red);
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
.leaf-input-otp__cell:disabled {
|
|
1245
|
+
color: var(--text-secondary);
|
|
1246
|
+
cursor: not-allowed;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
.leaf-input-otp__message {
|
|
1250
|
+
margin: 0;
|
|
1251
|
+
color: var(--leaf-input-otp-message);
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
.leaf-input-otp[data-invalid="true"] {
|
|
1255
|
+
--leaf-input-otp-message: var(--system-red);
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
.leaf-input-otp[hidden],
|
|
1259
|
+
.leaf-input-otp__cells[hidden] {
|
|
1258
1260
|
display: none;
|
|
1259
1261
|
}
|
|
1262
|
+
}
|
|
1260
1263
|
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1264
|
+
/* --- src/components/Input/input-stepper.css --- */
|
|
1265
|
+
|
|
1266
|
+
/*
|
|
1267
|
+
* InputStepper — Figma 1146:2159 (Buy / Sell).
|
|
1268
|
+
*
|
|
1269
|
+
* Tone qua data-tone (buy | sell — không có → base-tertiary); state qua :focus-within,
|
|
1270
|
+
* data-invalid, data-disabled, data-filled. Nền 280 × (py 4 · px 12), radius 12; icon −/+ 20px.
|
|
1271
|
+
* Label body-5 (secondary → primary khi focus), giá trị body-4-highlight (placeholder
|
|
1272
|
+
* secondary, đã nhập primary). Typography là class Leaf trên markup.
|
|
1273
|
+
* HTML tĩnh: −/+, mũi tên, format số nằm trong leaf.js (`data-leaf-input-stepper`).
|
|
1274
|
+
*/
|
|
1275
|
+
|
|
1276
|
+
@layer components {
|
|
1277
|
+
.leaf-input-stepper {
|
|
1278
|
+
--leaf-input-stepper-width: 280px;
|
|
1279
|
+
--leaf-input-stepper-bg: var(--base-tertiary);
|
|
1280
|
+
--leaf-input-stepper-focus: var(--text-highlight);
|
|
1281
|
+
--leaf-input-stepper-border: transparent;
|
|
1282
|
+
--leaf-input-stepper-label: var(--text-secondary);
|
|
1283
|
+
--leaf-input-stepper-fg: var(--text-primary);
|
|
1284
|
+
--leaf-input-stepper-icon: var(--text-primary);
|
|
1285
|
+
--leaf-input-stepper-message: var(--text-secondary);
|
|
1286
|
+
|
|
1287
|
+
display: flex;
|
|
1288
|
+
flex-direction: column;
|
|
1289
|
+
gap: 4px;
|
|
1290
|
+
width: var(--leaf-input-stepper-width);
|
|
1265
1291
|
max-width: 100%;
|
|
1266
|
-
padding: var(--leaf-tooltip-pad-y) var(--leaf-tooltip-pad-x);
|
|
1267
|
-
border-radius: var(--leaf-tooltip-radius);
|
|
1268
|
-
background-color: var(--base-quaternary);
|
|
1269
|
-
text-align: left;
|
|
1270
|
-
word-break: break-word;
|
|
1271
1292
|
}
|
|
1272
1293
|
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
* Mặc định: mũi nhọn xuống (position=top — caret dưới body).
|
|
1276
|
-
*/
|
|
1277
|
-
.leaf-tooltip__caret {
|
|
1278
|
-
position: relative;
|
|
1279
|
-
display: block;
|
|
1280
|
-
flex-shrink: 0;
|
|
1281
|
-
width: var(--leaf-tooltip-caret-w);
|
|
1282
|
-
height: var(--leaf-tooltip-caret-h);
|
|
1283
|
-
background-color: transparent;
|
|
1294
|
+
.leaf-input-stepper[data-tone="buy"] {
|
|
1295
|
+
--leaf-input-stepper-bg: var(--system-green-secondary);
|
|
1284
1296
|
}
|
|
1285
1297
|
|
|
1286
|
-
.leaf-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
top: 0;
|
|
1290
|
-
left: 50%;
|
|
1291
|
-
width: var(--leaf-tooltip-caret-tip);
|
|
1292
|
-
height: 100%;
|
|
1293
|
-
background-color: var(--base-quaternary);
|
|
1294
|
-
transform: translateX(-50%);
|
|
1295
|
-
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
1298
|
+
.leaf-input-stepper[data-tone="sell"] {
|
|
1299
|
+
--leaf-input-stepper-bg: var(--system-red-secondary);
|
|
1300
|
+
--leaf-input-stepper-focus: var(--system-red);
|
|
1296
1301
|
}
|
|
1297
1302
|
|
|
1298
|
-
|
|
1303
|
+
.leaf-input-stepper__shell {
|
|
1304
|
+
display: flex;
|
|
1305
|
+
align-items: center;
|
|
1306
|
+
gap: 8px;
|
|
1307
|
+
box-sizing: border-box;
|
|
1308
|
+
padding: 4px 12px;
|
|
1309
|
+
border: 1px solid var(--leaf-input-stepper-border);
|
|
1310
|
+
border-radius: 12px;
|
|
1311
|
+
background-color: var(--leaf-input-stepper-bg);
|
|
1312
|
+
cursor: text;
|
|
1313
|
+
transition: border-color 0.15s ease;
|
|
1314
|
+
}
|
|
1299
1315
|
|
|
1300
|
-
.leaf-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
--leaf-tooltip-caret-w: 40px;
|
|
1309
|
-
--leaf-tooltip-caret-h: 4px;
|
|
1310
|
-
--leaf-tooltip-caret-tip: 8px;
|
|
1311
|
-
min-width: 64px;
|
|
1316
|
+
.leaf-input-stepper__body {
|
|
1317
|
+
display: flex;
|
|
1318
|
+
flex: 1;
|
|
1319
|
+
flex-direction: column;
|
|
1320
|
+
align-items: center;
|
|
1321
|
+
justify-content: center;
|
|
1322
|
+
gap: 4px;
|
|
1323
|
+
min-width: 0;
|
|
1312
1324
|
}
|
|
1313
1325
|
|
|
1314
|
-
.leaf-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
--leaf-tooltip-line-height: var(--body-3-line-height);
|
|
1321
|
-
--leaf-tooltip-font-weight: var(--body-3-weight);
|
|
1322
|
-
--leaf-tooltip-caret-w: 44px;
|
|
1323
|
-
--leaf-tooltip-caret-h: 6px;
|
|
1324
|
-
--leaf-tooltip-caret-tip: 12px;
|
|
1326
|
+
.leaf-input-stepper__value {
|
|
1327
|
+
display: inline-flex;
|
|
1328
|
+
align-items: center;
|
|
1329
|
+
justify-content: center;
|
|
1330
|
+
gap: 2px;
|
|
1331
|
+
min-width: 0;
|
|
1325
1332
|
}
|
|
1326
1333
|
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1334
|
+
.leaf-input-stepper__label {
|
|
1335
|
+
overflow: hidden;
|
|
1336
|
+
text-overflow: ellipsis;
|
|
1337
|
+
white-space: nowrap;
|
|
1338
|
+
color: var(--leaf-input-stepper-label);
|
|
1339
|
+
cursor: inherit;
|
|
1340
|
+
transition: color 0.15s ease;
|
|
1331
1341
|
}
|
|
1332
1342
|
|
|
1333
|
-
|
|
1343
|
+
.leaf-input-stepper__input {
|
|
1344
|
+
box-sizing: border-box;
|
|
1345
|
+
min-width: 0;
|
|
1346
|
+
max-width: 100%;
|
|
1347
|
+
margin: 0;
|
|
1348
|
+
padding: 0;
|
|
1349
|
+
border: none;
|
|
1350
|
+
border-radius: 0;
|
|
1351
|
+
outline: none;
|
|
1352
|
+
background: transparent;
|
|
1353
|
+
color: var(--leaf-input-stepper-fg);
|
|
1354
|
+
text-align: center;
|
|
1355
|
+
letter-spacing: inherit;
|
|
1356
|
+
appearance: none;
|
|
1357
|
+
-webkit-appearance: none;
|
|
1358
|
+
}
|
|
1334
1359
|
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
* chỉ cần đổi data-position là caret sang phía đối diện.
|
|
1339
|
-
*/
|
|
1340
|
-
.leaf-tooltip:is(:not([data-position]), [data-position="top"], [data-position="left"])
|
|
1341
|
-
> .leaf-tooltip__caret {
|
|
1342
|
-
order: 1;
|
|
1360
|
+
.leaf-input-stepper__input::placeholder {
|
|
1361
|
+
color: var(--text-secondary);
|
|
1362
|
+
opacity: 1;
|
|
1343
1363
|
}
|
|
1344
1364
|
|
|
1345
|
-
.leaf-
|
|
1346
|
-
|
|
1365
|
+
.leaf-input-stepper__unit {
|
|
1366
|
+
color: var(--leaf-input-stepper-fg);
|
|
1347
1367
|
}
|
|
1348
1368
|
|
|
1349
|
-
.leaf-
|
|
1350
|
-
|
|
1369
|
+
.leaf-input-stepper__button {
|
|
1370
|
+
display: inline-flex;
|
|
1371
|
+
flex-shrink: 0;
|
|
1372
|
+
align-items: center;
|
|
1373
|
+
justify-content: center;
|
|
1374
|
+
width: 20px;
|
|
1375
|
+
height: 20px;
|
|
1376
|
+
margin: 0;
|
|
1377
|
+
padding: 0;
|
|
1378
|
+
border: none;
|
|
1379
|
+
background: transparent;
|
|
1380
|
+
color: var(--leaf-input-stepper-icon);
|
|
1381
|
+
font-size: 20px;
|
|
1382
|
+
line-height: 1;
|
|
1383
|
+
cursor: pointer;
|
|
1384
|
+
appearance: none;
|
|
1351
1385
|
}
|
|
1352
1386
|
|
|
1353
|
-
.leaf-
|
|
1354
|
-
|
|
1387
|
+
.leaf-input-stepper__button > svg {
|
|
1388
|
+
display: block;
|
|
1389
|
+
width: 1em;
|
|
1390
|
+
height: 1em;
|
|
1355
1391
|
}
|
|
1356
1392
|
|
|
1357
|
-
.leaf-
|
|
1358
|
-
|
|
1359
|
-
align-items: center;
|
|
1393
|
+
.leaf-input-stepper__button:disabled {
|
|
1394
|
+
cursor: not-allowed;
|
|
1360
1395
|
}
|
|
1361
1396
|
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1397
|
+
/* Chạm min / max (cả khối vẫn enabled) — mờ nút; disabled cả khối đã đổi màu icon. */
|
|
1398
|
+
.leaf-input-stepper:not([data-disabled="true"]) .leaf-input-stepper__button:disabled {
|
|
1399
|
+
opacity: 0.4;
|
|
1365
1400
|
}
|
|
1366
1401
|
|
|
1367
|
-
.leaf-
|
|
1368
|
-
|
|
1369
|
-
left:
|
|
1370
|
-
|
|
1371
|
-
height: var(--leaf-tooltip-caret-tip);
|
|
1372
|
-
transform: translateY(-50%);
|
|
1373
|
-
clip-path: polygon(0 0, 100% 50%, 0 100%);
|
|
1402
|
+
.leaf-input-stepper__message {
|
|
1403
|
+
margin: 0;
|
|
1404
|
+
padding-left: 4px;
|
|
1405
|
+
color: var(--leaf-input-stepper-message);
|
|
1374
1406
|
}
|
|
1375
1407
|
|
|
1376
|
-
.leaf-
|
|
1377
|
-
|
|
1378
|
-
|
|
1408
|
+
.leaf-input-stepper[hidden],
|
|
1409
|
+
.leaf-input-stepper__shell[hidden],
|
|
1410
|
+
.leaf-input-stepper__body[hidden],
|
|
1411
|
+
.leaf-input-stepper__value[hidden],
|
|
1412
|
+
.leaf-input-stepper__button[hidden] {
|
|
1413
|
+
display: none;
|
|
1379
1414
|
}
|
|
1380
1415
|
|
|
1381
|
-
|
|
1382
|
-
width: var(--leaf-tooltip-caret-h);
|
|
1383
|
-
height: var(--leaf-tooltip-caret-w);
|
|
1384
|
-
}
|
|
1416
|
+
/* ── State ───────────────────────────────────────────────────────────── */
|
|
1385
1417
|
|
|
1386
|
-
.leaf-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
width: 100%;
|
|
1390
|
-
height: var(--leaf-tooltip-caret-tip);
|
|
1391
|
-
transform: translateY(-50%);
|
|
1392
|
-
clip-path: polygon(100% 0, 0 50%, 100% 100%);
|
|
1418
|
+
.leaf-input-stepper:focus-within {
|
|
1419
|
+
--leaf-input-stepper-border: var(--leaf-input-stepper-focus);
|
|
1420
|
+
--leaf-input-stepper-label: var(--text-primary);
|
|
1393
1421
|
}
|
|
1394
1422
|
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
.leaf-tooltip[data-position="bottom"][data-align="start"] {
|
|
1399
|
-
align-items: flex-start;
|
|
1423
|
+
.leaf-input-stepper[data-invalid="true"] {
|
|
1424
|
+
--leaf-input-stepper-border: var(--system-red);
|
|
1425
|
+
--leaf-input-stepper-message: var(--system-red);
|
|
1400
1426
|
}
|
|
1401
1427
|
|
|
1402
|
-
.leaf-
|
|
1403
|
-
|
|
1404
|
-
|
|
1428
|
+
.leaf-input-stepper[data-disabled="true"] {
|
|
1429
|
+
--leaf-input-stepper-border: transparent;
|
|
1430
|
+
--leaf-input-stepper-label: var(--text-tertiary);
|
|
1431
|
+
--leaf-input-stepper-fg: var(--text-secondary);
|
|
1432
|
+
--leaf-input-stepper-icon: var(--text-secondary);
|
|
1405
1433
|
}
|
|
1406
1434
|
|
|
1407
|
-
.leaf-
|
|
1408
|
-
.leaf-
|
|
1409
|
-
|
|
1435
|
+
.leaf-input-stepper[data-disabled="true"] .leaf-input-stepper__shell,
|
|
1436
|
+
.leaf-input-stepper[data-disabled="true"] .leaf-input-stepper__input {
|
|
1437
|
+
cursor: not-allowed;
|
|
1410
1438
|
}
|
|
1411
1439
|
}
|
|
1412
1440
|
|
|
1413
|
-
/* --- src/
|
|
1441
|
+
/* --- src/components/Input/input.css --- */
|
|
1414
1442
|
|
|
1415
1443
|
/*
|
|
1416
|
-
*
|
|
1417
|
-
* (Figma 700:4390).
|
|
1444
|
+
* Input — Figma 1146:2159 (String / CTA) + search / date trigger.
|
|
1418
1445
|
*
|
|
1419
|
-
*
|
|
1420
|
-
*
|
|
1421
|
-
*
|
|
1422
|
-
*
|
|
1423
|
-
*
|
|
1446
|
+
* Variant qua data-variant (field | inline) + data-shape (pill, chỉ inline); state qua
|
|
1447
|
+
* :focus-within, data-invalid, data-disabled, data-filled trên root. Màu đổi theo state
|
|
1448
|
+
* nên nằm ở đây (class màu Leaf ở layer utilities sẽ đè state nếu gắn lên markup).
|
|
1449
|
+
* Typography (body-4, body-5-highlight) là class Leaf trên markup.
|
|
1450
|
+
* Thiếu attribute → field · default · enabled.
|
|
1424
1451
|
*/
|
|
1425
1452
|
|
|
1426
|
-
@layer
|
|
1427
|
-
.
|
|
1428
|
-
|
|
1453
|
+
@layer components {
|
|
1454
|
+
.leaf-input {
|
|
1455
|
+
--leaf-input-bg: var(--base-tertiary);
|
|
1456
|
+
--leaf-input-border: transparent;
|
|
1457
|
+
--leaf-input-radius: 12px;
|
|
1458
|
+
--leaf-input-min-height: 56px;
|
|
1459
|
+
--leaf-input-padding-y: 8px;
|
|
1460
|
+
--leaf-input-padding-x: 12px;
|
|
1461
|
+
--leaf-input-icon-size: 20px;
|
|
1462
|
+
--leaf-input-label: var(--text-tertiary);
|
|
1463
|
+
--leaf-input-fg: var(--text-primary);
|
|
1464
|
+
--leaf-input-icon: var(--text-primary);
|
|
1465
|
+
--leaf-input-placeholder: var(--text-tertiary);
|
|
1466
|
+
--leaf-input-message: var(--text-secondary);
|
|
1467
|
+
|
|
1468
|
+
display: flex;
|
|
1469
|
+
flex-direction: column;
|
|
1470
|
+
gap: 8px;
|
|
1471
|
+
min-width: 0;
|
|
1429
1472
|
}
|
|
1430
1473
|
|
|
1431
|
-
.
|
|
1432
|
-
|
|
1474
|
+
.leaf-input__shell {
|
|
1475
|
+
display: flex;
|
|
1476
|
+
align-items: center;
|
|
1477
|
+
gap: 8px;
|
|
1478
|
+
box-sizing: border-box;
|
|
1479
|
+
min-height: var(--leaf-input-min-height);
|
|
1480
|
+
padding: var(--leaf-input-padding-y) var(--leaf-input-padding-x);
|
|
1481
|
+
border: 1px solid var(--leaf-input-border);
|
|
1482
|
+
border-radius: var(--leaf-input-radius);
|
|
1483
|
+
background-color: var(--leaf-input-bg);
|
|
1484
|
+
cursor: text;
|
|
1485
|
+
transition: border-color 0.15s ease;
|
|
1433
1486
|
}
|
|
1434
1487
|
|
|
1435
|
-
.
|
|
1436
|
-
|
|
1488
|
+
.leaf-input__body {
|
|
1489
|
+
display: flex;
|
|
1490
|
+
flex: 1;
|
|
1491
|
+
flex-direction: column;
|
|
1492
|
+
gap: 4px;
|
|
1493
|
+
min-width: 0;
|
|
1437
1494
|
}
|
|
1438
1495
|
|
|
1439
|
-
.
|
|
1440
|
-
|
|
1496
|
+
.leaf-input__main {
|
|
1497
|
+
display: flex;
|
|
1498
|
+
align-items: center;
|
|
1499
|
+
gap: 8px;
|
|
1441
1500
|
}
|
|
1442
1501
|
|
|
1443
|
-
.
|
|
1444
|
-
|
|
1502
|
+
.leaf-input__label {
|
|
1503
|
+
overflow: hidden;
|
|
1504
|
+
text-overflow: ellipsis;
|
|
1505
|
+
white-space: nowrap;
|
|
1506
|
+
color: var(--leaf-input-label);
|
|
1507
|
+
cursor: inherit;
|
|
1508
|
+
transition: color 0.15s ease;
|
|
1445
1509
|
}
|
|
1446
1510
|
|
|
1447
|
-
.
|
|
1448
|
-
|
|
1511
|
+
.leaf-input__control {
|
|
1512
|
+
flex: 1;
|
|
1513
|
+
min-width: 0;
|
|
1514
|
+
box-sizing: border-box;
|
|
1515
|
+
margin: 0;
|
|
1516
|
+
padding: 0;
|
|
1517
|
+
border: none;
|
|
1518
|
+
border-radius: 0;
|
|
1519
|
+
outline: none;
|
|
1520
|
+
background: transparent;
|
|
1521
|
+
color: var(--leaf-input-fg);
|
|
1522
|
+
letter-spacing: inherit;
|
|
1523
|
+
appearance: none;
|
|
1524
|
+
-webkit-appearance: none;
|
|
1449
1525
|
}
|
|
1450
1526
|
|
|
1451
|
-
.
|
|
1452
|
-
|
|
1527
|
+
.leaf-input__control::placeholder,
|
|
1528
|
+
.leaf-input__placeholder {
|
|
1529
|
+
color: var(--leaf-input-placeholder);
|
|
1530
|
+
opacity: 1;
|
|
1453
1531
|
}
|
|
1454
|
-
}
|
|
1455
1532
|
|
|
1456
|
-
|
|
1533
|
+
button.leaf-input__control {
|
|
1534
|
+
overflow: hidden;
|
|
1535
|
+
text-overflow: ellipsis;
|
|
1536
|
+
white-space: nowrap;
|
|
1537
|
+
text-align: left;
|
|
1538
|
+
cursor: pointer;
|
|
1539
|
+
}
|
|
1457
1540
|
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
*
|
|
1463
|
-
* text-* → color (text-primary, text-red)
|
|
1464
|
-
* base-* → background-color (base-primary, base-red)
|
|
1465
|
-
* border-* → border-color (border-primary, border-red)
|
|
1466
|
-
*
|
|
1467
|
-
* Ba bộ dùng chung một hậu tố nên đọc là đoán được: `text-red` / `base-red` /
|
|
1468
|
-
* `border-red`, `text-primary` / `base-primary` / `border-primary`. Nhóm system
|
|
1469
|
-
* bỏ chữ `system` trong tên class (token vẫn là `--system-red`), còn `border-*`
|
|
1470
|
-
* lấy màu từ thang base vì viền luôn là màu bề mặt. Secondary của system giữ
|
|
1471
|
-
* hậu tố `-secondary` (vd. `text-red-secondary` ↔ `--system-red-secondary`).
|
|
1472
|
-
*
|
|
1473
|
-
* Mỗi class chỉ set đúng 1 thuộc tính (color / background-color / border-color)
|
|
1474
|
-
* — border-width và border-style do app tự lo. Class tự đổi giá trị theo
|
|
1475
|
-
* `[data-theme="light"]` vì nó trỏ vào var, không hard-code màu.
|
|
1476
|
-
*
|
|
1477
|
-
* Chỉ semantic token mới có class. Primitive (--neutral-500, --brand-300…) là
|
|
1478
|
-
* nguồn nội bộ, không dùng thẳng trong UI.
|
|
1479
|
-
*
|
|
1480
|
-
* ─ Vì sao `@layer utilities` ─────────────────────────────────────────────────
|
|
1481
|
-
*
|
|
1482
|
-
* Màu của Leaf là token gốc, trùng tên thì phải thắng. Đặt chung layer với
|
|
1483
|
-
* utility của Tailwind, và app import file này SAU `@import "tailwindcss"`, nên
|
|
1484
|
-
* khi app cũng khai báo `--color-primary` / `--color-red` trong `@theme` thì
|
|
1485
|
-
* `.text-primary` của Leaf (cùng specificity, đứng sau) là cái có hiệu lực.
|
|
1486
|
-
*
|
|
1487
|
-
* Biến thể trạng thái vẫn override được vì pseudo-class cộng thêm specificity:
|
|
1488
|
-
* `hover:text-[var(--text-highlight)]`, `focus:…` thắng bình thường. Riêng biến
|
|
1489
|
-
* thể responsive (`md:`, `lg:`) cùng specificity và được Tailwind ghi ra trước
|
|
1490
|
-
* file này nên phải thêm important modifier: `md:text-[var(--text-secondary)]!`.
|
|
1491
|
-
*/
|
|
1541
|
+
.leaf-input__control::-webkit-search-cancel-button,
|
|
1542
|
+
.leaf-input__control::-webkit-search-decoration {
|
|
1543
|
+
-webkit-appearance: none;
|
|
1544
|
+
}
|
|
1492
1545
|
|
|
1493
|
-
|
|
1494
|
-
|
|
1546
|
+
.leaf-input__icon,
|
|
1547
|
+
.leaf-input__reveal {
|
|
1548
|
+
display: inline-flex;
|
|
1549
|
+
flex-shrink: 0;
|
|
1550
|
+
align-items: center;
|
|
1551
|
+
justify-content: center;
|
|
1552
|
+
width: var(--leaf-input-icon-size);
|
|
1553
|
+
height: var(--leaf-input-icon-size);
|
|
1554
|
+
font-size: var(--leaf-input-icon-size);
|
|
1555
|
+
line-height: 1;
|
|
1556
|
+
color: var(--leaf-input-icon);
|
|
1557
|
+
}
|
|
1495
1558
|
|
|
1496
|
-
.
|
|
1497
|
-
|
|
1559
|
+
.leaf-input__icon > svg,
|
|
1560
|
+
.leaf-input__reveal > svg {
|
|
1561
|
+
display: block;
|
|
1562
|
+
width: 1em;
|
|
1563
|
+
height: 1em;
|
|
1498
1564
|
}
|
|
1499
1565
|
|
|
1500
|
-
.
|
|
1501
|
-
|
|
1566
|
+
.leaf-input__reveal {
|
|
1567
|
+
margin: 0;
|
|
1568
|
+
padding: 0;
|
|
1569
|
+
border: none;
|
|
1570
|
+
background: transparent;
|
|
1571
|
+
cursor: pointer;
|
|
1572
|
+
appearance: none;
|
|
1502
1573
|
}
|
|
1503
1574
|
|
|
1504
|
-
.
|
|
1505
|
-
|
|
1575
|
+
.leaf-input__reveal:focus-visible {
|
|
1576
|
+
outline: 2px solid var(--text-highlight);
|
|
1577
|
+
outline-offset: 2px;
|
|
1578
|
+
border-radius: 4px;
|
|
1506
1579
|
}
|
|
1507
1580
|
|
|
1508
|
-
.
|
|
1509
|
-
|
|
1581
|
+
.leaf-input__action {
|
|
1582
|
+
display: inline-flex;
|
|
1583
|
+
flex-shrink: 0;
|
|
1584
|
+
align-items: center;
|
|
1510
1585
|
}
|
|
1511
1586
|
|
|
1512
|
-
.
|
|
1513
|
-
|
|
1587
|
+
.leaf-input__message {
|
|
1588
|
+
margin: 0;
|
|
1589
|
+
padding-left: 12px;
|
|
1590
|
+
color: var(--leaf-input-message);
|
|
1514
1591
|
}
|
|
1515
1592
|
|
|
1516
|
-
|
|
1593
|
+
.leaf-input[hidden],
|
|
1594
|
+
.leaf-input__shell[hidden],
|
|
1595
|
+
.leaf-input__body[hidden],
|
|
1596
|
+
.leaf-input__main[hidden],
|
|
1597
|
+
.leaf-input__icon[hidden],
|
|
1598
|
+
.leaf-input__reveal[hidden],
|
|
1599
|
+
.leaf-input__action[hidden] {
|
|
1600
|
+
display: none;
|
|
1601
|
+
}
|
|
1517
1602
|
|
|
1518
|
-
|
|
1519
|
-
|
|
1603
|
+
/* ── State ───────────────────────────────────────────────────────────── */
|
|
1604
|
+
|
|
1605
|
+
.leaf-input[data-filled="true"] {
|
|
1606
|
+
--leaf-input-label: var(--text-primary);
|
|
1520
1607
|
}
|
|
1521
1608
|
|
|
1522
|
-
.
|
|
1523
|
-
|
|
1609
|
+
.leaf-input:focus-within {
|
|
1610
|
+
--leaf-input-border: var(--text-highlight);
|
|
1611
|
+
--leaf-input-label: var(--text-highlight);
|
|
1524
1612
|
}
|
|
1525
1613
|
|
|
1526
|
-
.
|
|
1527
|
-
|
|
1614
|
+
.leaf-input[data-invalid="true"] {
|
|
1615
|
+
--leaf-input-border: var(--system-red);
|
|
1616
|
+
--leaf-input-label: var(--system-red);
|
|
1617
|
+
--leaf-input-message: var(--system-red);
|
|
1528
1618
|
}
|
|
1529
1619
|
|
|
1530
|
-
.
|
|
1531
|
-
|
|
1620
|
+
.leaf-input[data-disabled="true"] {
|
|
1621
|
+
--leaf-input-border: transparent;
|
|
1622
|
+
--leaf-input-label: var(--text-tertiary);
|
|
1623
|
+
--leaf-input-fg: var(--text-secondary);
|
|
1624
|
+
--leaf-input-icon: var(--text-secondary);
|
|
1532
1625
|
}
|
|
1533
1626
|
|
|
1534
|
-
.
|
|
1535
|
-
|
|
1627
|
+
.leaf-input[data-disabled="true"] .leaf-input__shell,
|
|
1628
|
+
.leaf-input[data-disabled="true"] .leaf-input__control {
|
|
1629
|
+
cursor: not-allowed;
|
|
1536
1630
|
}
|
|
1537
1631
|
|
|
1538
|
-
|
|
1539
|
-
|
|
1632
|
+
/* ── Variant inline (search) ─────────────────────────────────────────── */
|
|
1633
|
+
|
|
1634
|
+
.leaf-input[data-variant="inline"] {
|
|
1635
|
+
--leaf-input-bg: var(--base-secondary);
|
|
1636
|
+
--leaf-input-border: var(--base-quaternary);
|
|
1637
|
+
--leaf-input-min-height: 36px;
|
|
1638
|
+
--leaf-input-padding-y: 6px;
|
|
1639
|
+
--leaf-input-icon-size: 16px;
|
|
1640
|
+
--leaf-input-placeholder: var(--text-secondary);
|
|
1540
1641
|
}
|
|
1541
1642
|
|
|
1542
|
-
.
|
|
1543
|
-
|
|
1643
|
+
.leaf-input[data-variant="inline"]:focus-within {
|
|
1644
|
+
--leaf-input-border: var(--text-highlight);
|
|
1544
1645
|
}
|
|
1545
1646
|
|
|
1546
|
-
.
|
|
1547
|
-
|
|
1647
|
+
.leaf-input[data-variant="inline"][data-invalid="true"] {
|
|
1648
|
+
--leaf-input-border: var(--system-red);
|
|
1548
1649
|
}
|
|
1549
1650
|
|
|
1550
|
-
.
|
|
1551
|
-
|
|
1651
|
+
.leaf-input[data-variant="inline"][data-shape="pill"] {
|
|
1652
|
+
--leaf-input-bg: transparent;
|
|
1653
|
+
--leaf-input-radius: 9999px;
|
|
1552
1654
|
}
|
|
1655
|
+
}
|
|
1553
1656
|
|
|
1554
|
-
|
|
1555
|
-
|
|
1657
|
+
/* --- src/components/Logo/logo.css --- */
|
|
1658
|
+
|
|
1659
|
+
/*
|
|
1660
|
+
* Logo — Figma 924:1074.
|
|
1661
|
+
*
|
|
1662
|
+
* React: chọn SVG trong assets.ts, render <img class="leaf-logo__img">.
|
|
1663
|
+
* HTML tĩnh: span.leaf-logo:empty + data-brand / data-mode / data-side — rule
|
|
1664
|
+
* background-image nằm ở logo-assets.css (generated bởi scripts/embed-logo-assets.mjs,
|
|
1665
|
+
* không gộp vào classes.css / styles.css; bản CDN đã gộp sẵn).
|
|
1666
|
+
* Size (chiều cao) qua --leaf-logo-size.
|
|
1667
|
+
*/
|
|
1668
|
+
|
|
1669
|
+
@layer components {
|
|
1670
|
+
.leaf-logo {
|
|
1671
|
+
display: inline-flex;
|
|
1672
|
+
flex-shrink: 0;
|
|
1673
|
+
align-items: center;
|
|
1674
|
+
justify-content: center;
|
|
1675
|
+
vertical-align: middle;
|
|
1676
|
+
margin: 0;
|
|
1677
|
+
padding: 0;
|
|
1678
|
+
border: none;
|
|
1679
|
+
background: transparent;
|
|
1680
|
+
background-repeat: no-repeat;
|
|
1681
|
+
background-position: center;
|
|
1682
|
+
background-size: contain;
|
|
1683
|
+
line-height: 0;
|
|
1684
|
+
box-sizing: border-box;
|
|
1556
1685
|
}
|
|
1557
1686
|
|
|
1558
|
-
|
|
1559
|
-
|
|
1687
|
+
/* HTML tĩnh — không có <img>, asset lấy từ data-* */
|
|
1688
|
+
.leaf-logo:empty {
|
|
1689
|
+
display: inline-block;
|
|
1690
|
+
height: var(--leaf-logo-size, 40px);
|
|
1691
|
+
width: calc(var(--leaf-logo-size, 40px) * var(--leaf-logo-aspect, 1));
|
|
1560
1692
|
}
|
|
1561
1693
|
|
|
1562
|
-
.
|
|
1563
|
-
|
|
1694
|
+
.leaf-logo__img {
|
|
1695
|
+
display: block;
|
|
1696
|
+
height: var(--leaf-logo-size, 40px);
|
|
1697
|
+
width: auto;
|
|
1698
|
+
max-width: 100%;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
/* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
1702
|
+
.leaf-logo[hidden] {
|
|
1703
|
+
display: none;
|
|
1564
1704
|
}
|
|
1705
|
+
}
|
|
1565
1706
|
|
|
1566
|
-
|
|
1707
|
+
/* --- src/components/Radio/radio.css --- */
|
|
1567
1708
|
|
|
1568
|
-
|
|
1569
|
-
|
|
1709
|
+
/*
|
|
1710
|
+
* Radio — Figma 1146:2081.
|
|
1711
|
+
*
|
|
1712
|
+
* Size S/M/L (18 · 24 · 30) qua data-size; Selected qua `:checked` của input
|
|
1713
|
+
* native; Disable qua `:disabled`. Input phủ kín vùng control (opacity 0) nên
|
|
1714
|
+
* click / focus / FormData đều là của trình duyệt — HTML tĩnh không cần JS.
|
|
1715
|
+
* Thiếu attribute → md · unchecked · enabled.
|
|
1716
|
+
*/
|
|
1717
|
+
|
|
1718
|
+
@layer components {
|
|
1719
|
+
.leaf-radio {
|
|
1720
|
+
--leaf-radio-size: 24px;
|
|
1721
|
+
--leaf-radio-ring: 1.5px;
|
|
1722
|
+
--leaf-radio-color: var(--text-primary);
|
|
1723
|
+
|
|
1724
|
+
position: relative;
|
|
1725
|
+
display: inline-flex;
|
|
1726
|
+
align-items: center;
|
|
1727
|
+
gap: 8px;
|
|
1728
|
+
vertical-align: middle;
|
|
1729
|
+
cursor: pointer;
|
|
1570
1730
|
}
|
|
1571
1731
|
|
|
1572
|
-
.
|
|
1573
|
-
|
|
1732
|
+
.leaf-radio[data-size="sm"] {
|
|
1733
|
+
--leaf-radio-size: 18px;
|
|
1574
1734
|
}
|
|
1575
1735
|
|
|
1576
|
-
.
|
|
1577
|
-
|
|
1736
|
+
.leaf-radio[data-size="lg"] {
|
|
1737
|
+
--leaf-radio-size: 30px;
|
|
1578
1738
|
}
|
|
1579
1739
|
|
|
1580
|
-
.
|
|
1581
|
-
|
|
1740
|
+
.leaf-radio[hidden],
|
|
1741
|
+
.leaf-radio__control[hidden] {
|
|
1742
|
+
display: none;
|
|
1582
1743
|
}
|
|
1583
1744
|
|
|
1584
|
-
.
|
|
1585
|
-
|
|
1745
|
+
.leaf-radio__input {
|
|
1746
|
+
position: absolute;
|
|
1747
|
+
top: 0;
|
|
1748
|
+
left: 0;
|
|
1749
|
+
width: var(--leaf-radio-size);
|
|
1750
|
+
height: var(--leaf-radio-size);
|
|
1751
|
+
margin: 0;
|
|
1752
|
+
padding: 0;
|
|
1753
|
+
border: none;
|
|
1754
|
+
opacity: 0;
|
|
1755
|
+
cursor: inherit;
|
|
1756
|
+
appearance: none;
|
|
1757
|
+
-webkit-appearance: none;
|
|
1586
1758
|
}
|
|
1587
1759
|
|
|
1588
|
-
.
|
|
1589
|
-
|
|
1760
|
+
.leaf-radio__control {
|
|
1761
|
+
display: inline-flex;
|
|
1762
|
+
flex-shrink: 0;
|
|
1763
|
+
align-items: center;
|
|
1764
|
+
justify-content: center;
|
|
1765
|
+
border-radius: 9999px;
|
|
1766
|
+
box-sizing: border-box;
|
|
1767
|
+
width: var(--leaf-radio-size);
|
|
1768
|
+
height: var(--leaf-radio-size);
|
|
1769
|
+
border: var(--leaf-radio-ring) solid var(--leaf-radio-color);
|
|
1770
|
+
transition: border-color 0.15s ease;
|
|
1590
1771
|
}
|
|
1591
1772
|
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1773
|
+
.leaf-radio__dot {
|
|
1774
|
+
border-radius: 9999px;
|
|
1775
|
+
width: 50%;
|
|
1776
|
+
height: 50%;
|
|
1777
|
+
background-color: var(--leaf-radio-color);
|
|
1778
|
+
transform: scale(0);
|
|
1779
|
+
transition: transform 0.15s ease;
|
|
1596
1780
|
}
|
|
1597
1781
|
|
|
1598
|
-
.
|
|
1599
|
-
|
|
1782
|
+
.leaf-radio__label {
|
|
1783
|
+
color: var(--text-primary);
|
|
1600
1784
|
}
|
|
1601
1785
|
|
|
1602
|
-
|
|
1603
|
-
|
|
1786
|
+
/* Selected */
|
|
1787
|
+
.leaf-radio__input:checked + .leaf-radio__control {
|
|
1788
|
+
--leaf-radio-color: var(--text-highlight);
|
|
1604
1789
|
}
|
|
1605
1790
|
|
|
1606
|
-
.
|
|
1607
|
-
|
|
1791
|
+
.leaf-radio__input:checked + .leaf-radio__control .leaf-radio__dot {
|
|
1792
|
+
transform: scale(1);
|
|
1608
1793
|
}
|
|
1609
1794
|
|
|
1610
|
-
.
|
|
1611
|
-
|
|
1795
|
+
/* Disable — ring / dot xám, label tertiary. */
|
|
1796
|
+
.leaf-radio__input:disabled + .leaf-radio__control {
|
|
1797
|
+
--leaf-radio-color: var(--base-quaternary);
|
|
1612
1798
|
}
|
|
1613
1799
|
|
|
1614
|
-
.
|
|
1615
|
-
|
|
1800
|
+
.leaf-radio__input:disabled ~ .leaf-radio__label {
|
|
1801
|
+
color: var(--text-tertiary);
|
|
1616
1802
|
}
|
|
1617
1803
|
|
|
1618
|
-
.
|
|
1619
|
-
|
|
1804
|
+
.leaf-radio:has(.leaf-radio__input:disabled) {
|
|
1805
|
+
cursor: not-allowed;
|
|
1620
1806
|
}
|
|
1621
1807
|
|
|
1622
|
-
.
|
|
1623
|
-
|
|
1808
|
+
.leaf-radio__input:focus-visible + .leaf-radio__control {
|
|
1809
|
+
outline: 2px solid var(--text-highlight);
|
|
1810
|
+
outline-offset: 2px;
|
|
1624
1811
|
}
|
|
1625
1812
|
|
|
1626
|
-
.
|
|
1627
|
-
|
|
1813
|
+
.leaf-radio-group {
|
|
1814
|
+
display: flex;
|
|
1815
|
+
flex-direction: column;
|
|
1816
|
+
gap: 12px;
|
|
1628
1817
|
}
|
|
1629
1818
|
|
|
1630
|
-
.
|
|
1631
|
-
|
|
1819
|
+
.leaf-radio-group[data-orientation="horizontal"] {
|
|
1820
|
+
flex-direction: row;
|
|
1821
|
+
flex-wrap: wrap;
|
|
1632
1822
|
}
|
|
1633
1823
|
|
|
1634
|
-
.
|
|
1635
|
-
|
|
1824
|
+
.leaf-radio-group[hidden] {
|
|
1825
|
+
display: none;
|
|
1636
1826
|
}
|
|
1827
|
+
}
|
|
1637
1828
|
|
|
1638
|
-
|
|
1639
|
-
background-color: var(--system-purple-secondary);
|
|
1640
|
-
}
|
|
1829
|
+
/* --- src/components/Skeleton/skeleton.css --- */
|
|
1641
1830
|
|
|
1642
|
-
|
|
1831
|
+
/*
|
|
1832
|
+
* Skeleton — placeholder shimmer.
|
|
1833
|
+
*
|
|
1834
|
+
* Nền `--base-tertiary` (dark: #28292B). Kích thước / radius qua custom property
|
|
1835
|
+
* từ React (hoặc style inline khi HTML tĩnh). Thiếu biến → full width/height,
|
|
1836
|
+
* radius 12px.
|
|
1837
|
+
*/
|
|
1643
1838
|
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1839
|
+
@layer components {
|
|
1840
|
+
.leaf-skeleton {
|
|
1841
|
+
--leaf-skeleton-width: 100%;
|
|
1842
|
+
--leaf-skeleton-height: 100%;
|
|
1843
|
+
--leaf-skeleton-radius: 12px;
|
|
1647
1844
|
|
|
1648
|
-
|
|
1649
|
-
|
|
1845
|
+
position: relative;
|
|
1846
|
+
overflow: hidden;
|
|
1847
|
+
box-sizing: border-box;
|
|
1848
|
+
width: var(--leaf-skeleton-width);
|
|
1849
|
+
height: var(--leaf-skeleton-height);
|
|
1850
|
+
border-radius: var(--leaf-skeleton-radius);
|
|
1851
|
+
background-color: var(--base-tertiary);
|
|
1650
1852
|
}
|
|
1651
1853
|
|
|
1652
|
-
.
|
|
1653
|
-
|
|
1854
|
+
.leaf-skeleton__shimmer {
|
|
1855
|
+
position: absolute;
|
|
1856
|
+
inset: 0;
|
|
1857
|
+
background: linear-gradient(
|
|
1858
|
+
to right,
|
|
1859
|
+
transparent,
|
|
1860
|
+
color-mix(in srgb, var(--base-quinary) 10%, transparent),
|
|
1861
|
+
transparent
|
|
1862
|
+
);
|
|
1863
|
+
animation: leaf-skeleton-shimmer 2s infinite ease-in-out;
|
|
1654
1864
|
}
|
|
1865
|
+
}
|
|
1655
1866
|
|
|
1656
|
-
|
|
1657
|
-
|
|
1867
|
+
@keyframes leaf-skeleton-shimmer {
|
|
1868
|
+
0% {
|
|
1869
|
+
transform: translateX(-100%);
|
|
1658
1870
|
}
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
border-color: var(--base-quaternary);
|
|
1871
|
+
100% {
|
|
1872
|
+
transform: translateX(100%);
|
|
1662
1873
|
}
|
|
1874
|
+
}
|
|
1663
1875
|
|
|
1664
|
-
|
|
1665
|
-
border-color: var(--base-quinary);
|
|
1666
|
-
}
|
|
1876
|
+
/* --- src/components/Slider/slider.css --- */
|
|
1667
1877
|
|
|
1668
|
-
|
|
1878
|
+
/*
|
|
1879
|
+
* Slider — Figma 730:12646.
|
|
1880
|
+
*
|
|
1881
|
+
* Giá trị liên tục trên rail (kéo / click chính xác tới từng step — như
|
|
1882
|
+
* TradeQuickSlider). Mốc chia đều đặt tuyệt đối theo `left: <%>`; thumb đặt ở
|
|
1883
|
+
* `--leaf-slider-fill`. Ở min thumb = `--text-primary`; khi > min =
|
|
1884
|
+
* `--leaf-slider-active` (mặc định `--text-highlight`).
|
|
1885
|
+
*
|
|
1886
|
+
* Rail, mốc và thumb cùng nằm trong vùng lùi vào `--leaf-slider-inset` ở hai đầu
|
|
1887
|
+
* (nửa thumb) — nhờ vậy `left: X%` của cả ba khớp nhau và thumb không tràn ra ngoài.
|
|
1888
|
+
*/
|
|
1669
1889
|
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1890
|
+
@layer components {
|
|
1891
|
+
.leaf-slider {
|
|
1892
|
+
--leaf-slider-active: var(--text-highlight);
|
|
1893
|
+
--leaf-slider-fill: 0%;
|
|
1894
|
+
--leaf-slider-mark: 6px;
|
|
1895
|
+
--leaf-slider-mark-active: 10px;
|
|
1896
|
+
--leaf-slider-rail-height: 2px;
|
|
1897
|
+
--leaf-slider-inset: calc(var(--leaf-slider-mark-active) / 2);
|
|
1898
|
+
--leaf-slider-control-height: max(
|
|
1899
|
+
var(--leaf-slider-mark-active),
|
|
1900
|
+
var(--leaf-slider-mark),
|
|
1901
|
+
20px
|
|
1902
|
+
);
|
|
1673
1903
|
|
|
1674
|
-
|
|
1675
|
-
|
|
1904
|
+
display: flex;
|
|
1905
|
+
flex-direction: column;
|
|
1906
|
+
gap: 8px;
|
|
1907
|
+
width: 100%;
|
|
1908
|
+
box-sizing: border-box;
|
|
1909
|
+
font-family: var(--font-sans);
|
|
1910
|
+
font-size: var(--body-5-size);
|
|
1911
|
+
line-height: var(--body-5-line-height);
|
|
1912
|
+
font-weight: var(--body-5-weight);
|
|
1913
|
+
color: var(--text-primary);
|
|
1914
|
+
user-select: none;
|
|
1915
|
+
-webkit-user-select: none;
|
|
1676
1916
|
}
|
|
1677
1917
|
|
|
1678
|
-
.
|
|
1679
|
-
|
|
1918
|
+
/* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
1919
|
+
.leaf-slider[hidden],
|
|
1920
|
+
.leaf-slider__header[hidden],
|
|
1921
|
+
.leaf-slider__body[hidden],
|
|
1922
|
+
.leaf-slider__control[hidden] {
|
|
1923
|
+
display: none;
|
|
1680
1924
|
}
|
|
1681
1925
|
|
|
1682
|
-
.
|
|
1683
|
-
|
|
1926
|
+
.leaf-slider__header {
|
|
1927
|
+
display: flex;
|
|
1928
|
+
align-items: flex-start;
|
|
1929
|
+
justify-content: space-between;
|
|
1930
|
+
gap: 8px;
|
|
1931
|
+
width: 100%;
|
|
1932
|
+
white-space: nowrap;
|
|
1933
|
+
color: var(--text-primary);
|
|
1934
|
+
user-select: text;
|
|
1935
|
+
-webkit-user-select: text;
|
|
1684
1936
|
}
|
|
1685
1937
|
|
|
1686
|
-
.
|
|
1687
|
-
|
|
1938
|
+
.leaf-slider__title {
|
|
1939
|
+
min-width: 0;
|
|
1688
1940
|
}
|
|
1689
1941
|
|
|
1690
|
-
.
|
|
1691
|
-
|
|
1942
|
+
.leaf-slider__unit {
|
|
1943
|
+
min-width: 0;
|
|
1944
|
+
text-align: right;
|
|
1692
1945
|
}
|
|
1693
1946
|
|
|
1694
|
-
.
|
|
1695
|
-
|
|
1947
|
+
/* Figma gap XS (4) giữa track và Value labels. */
|
|
1948
|
+
.leaf-slider__body {
|
|
1949
|
+
display: flex;
|
|
1950
|
+
flex-direction: column;
|
|
1951
|
+
gap: 4px;
|
|
1952
|
+
width: 100%;
|
|
1696
1953
|
}
|
|
1697
1954
|
|
|
1698
|
-
.
|
|
1699
|
-
|
|
1955
|
+
.leaf-slider__control {
|
|
1956
|
+
position: relative;
|
|
1957
|
+
display: flex;
|
|
1958
|
+
align-items: center;
|
|
1959
|
+
width: 100%;
|
|
1960
|
+
height: var(--leaf-slider-control-height);
|
|
1961
|
+
outline: none;
|
|
1962
|
+
cursor: pointer;
|
|
1963
|
+
/* Chỉ khoá gesture trên track — header / labels vẫn cho cuộn trang. */
|
|
1964
|
+
touch-action: none;
|
|
1700
1965
|
}
|
|
1701
1966
|
|
|
1702
|
-
.
|
|
1703
|
-
|
|
1967
|
+
.leaf-slider__control:focus-visible {
|
|
1968
|
+
outline: 2px solid var(--leaf-slider-active);
|
|
1969
|
+
outline-offset: 4px;
|
|
1970
|
+
border-radius: 4px;
|
|
1704
1971
|
}
|
|
1705
1972
|
|
|
1706
|
-
.
|
|
1707
|
-
|
|
1973
|
+
.leaf-slider[data-dragging="true"] .leaf-slider__control {
|
|
1974
|
+
cursor: grabbing;
|
|
1708
1975
|
}
|
|
1709
1976
|
|
|
1710
|
-
.
|
|
1711
|
-
|
|
1977
|
+
.leaf-slider__rail {
|
|
1978
|
+
position: absolute;
|
|
1979
|
+
left: var(--leaf-slider-inset);
|
|
1980
|
+
right: var(--leaf-slider-inset);
|
|
1981
|
+
top: 50%;
|
|
1982
|
+
height: var(--leaf-slider-rail-height);
|
|
1983
|
+
transform: translateY(-50%);
|
|
1984
|
+
border-radius: 100px;
|
|
1985
|
+
background-color: var(--text-tertiary);
|
|
1986
|
+
pointer-events: none;
|
|
1712
1987
|
}
|
|
1713
1988
|
|
|
1714
|
-
.
|
|
1715
|
-
|
|
1989
|
+
.leaf-slider__fill {
|
|
1990
|
+
display: block;
|
|
1991
|
+
height: 100%;
|
|
1992
|
+
width: var(--leaf-slider-fill);
|
|
1993
|
+
border-radius: inherit;
|
|
1994
|
+
background-color: var(--text-primary);
|
|
1716
1995
|
}
|
|
1717
|
-
}
|
|
1718
1996
|
|
|
1719
|
-
/*
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
* (import sau @import "tailwindcss"), giống color.css.
|
|
1730
|
-
*/
|
|
1997
|
+
/* Khung toạ độ cho mốc + thumb — trùng với rail, cao 0, nằm giữa control. */
|
|
1998
|
+
.leaf-slider__marks {
|
|
1999
|
+
position: absolute;
|
|
2000
|
+
z-index: 1;
|
|
2001
|
+
left: var(--leaf-slider-inset);
|
|
2002
|
+
right: var(--leaf-slider-inset);
|
|
2003
|
+
top: 50%;
|
|
2004
|
+
height: 0;
|
|
2005
|
+
pointer-events: none;
|
|
2006
|
+
}
|
|
1731
2007
|
|
|
1732
|
-
|
|
1733
|
-
|
|
2008
|
+
.leaf-slider__mark {
|
|
2009
|
+
position: absolute;
|
|
2010
|
+
top: 0;
|
|
2011
|
+
left: 0;
|
|
2012
|
+
display: block;
|
|
2013
|
+
box-sizing: border-box;
|
|
2014
|
+
width: var(--leaf-slider-mark);
|
|
2015
|
+
height: var(--leaf-slider-mark);
|
|
2016
|
+
margin: 0;
|
|
2017
|
+
padding: 0;
|
|
2018
|
+
border: none;
|
|
2019
|
+
border-radius: 50%;
|
|
2020
|
+
background-color: var(--text-tertiary);
|
|
2021
|
+
cursor: pointer;
|
|
2022
|
+
appearance: none;
|
|
2023
|
+
-webkit-appearance: none;
|
|
2024
|
+
pointer-events: auto;
|
|
2025
|
+
transform: translate(-50%, -50%);
|
|
2026
|
+
transition: background-color 0.15s ease;
|
|
2027
|
+
}
|
|
1734
2028
|
|
|
1735
|
-
.
|
|
1736
|
-
|
|
2029
|
+
.leaf-slider__mark[data-state="passed"] {
|
|
2030
|
+
background-color: var(--text-primary);
|
|
1737
2031
|
}
|
|
1738
2032
|
|
|
1739
|
-
.
|
|
1740
|
-
|
|
2033
|
+
/* Mốc trùng giá trị nằm dưới thumb — cùng màu để không lộ viền. */
|
|
2034
|
+
.leaf-slider__mark[data-state="active"] {
|
|
2035
|
+
background-color: var(--text-primary);
|
|
1741
2036
|
}
|
|
1742
2037
|
|
|
1743
|
-
.
|
|
1744
|
-
|
|
2038
|
+
.leaf-slider:not([data-at-min="true"]) .leaf-slider__mark[data-state="active"] {
|
|
2039
|
+
background-color: var(--leaf-slider-active);
|
|
1745
2040
|
}
|
|
1746
2041
|
|
|
1747
|
-
.
|
|
1748
|
-
|
|
2042
|
+
.leaf-slider__thumb {
|
|
2043
|
+
position: absolute;
|
|
2044
|
+
top: 0;
|
|
2045
|
+
left: var(--leaf-slider-fill);
|
|
2046
|
+
display: block;
|
|
2047
|
+
box-sizing: border-box;
|
|
2048
|
+
width: var(--leaf-slider-mark-active);
|
|
2049
|
+
height: var(--leaf-slider-mark-active);
|
|
2050
|
+
border-radius: 50%;
|
|
2051
|
+
/* Figma Default (min): thumb trắng; Active (> min): highlight. */
|
|
2052
|
+
background-color: var(--text-primary);
|
|
2053
|
+
transform: translate(-50%, -50%);
|
|
2054
|
+
pointer-events: none;
|
|
2055
|
+
transition: background-color 0.15s ease;
|
|
1749
2056
|
}
|
|
1750
2057
|
|
|
1751
|
-
.
|
|
1752
|
-
|
|
2058
|
+
.leaf-slider:not([data-at-min="true"]) .leaf-slider__thumb {
|
|
2059
|
+
background-color: var(--leaf-slider-active);
|
|
1753
2060
|
}
|
|
1754
2061
|
|
|
1755
|
-
.
|
|
1756
|
-
|
|
2062
|
+
/* Label căn đúng dưới mốc: cùng vùng lùi với rail; nhãn hai đầu kéo ra sát mép. */
|
|
2063
|
+
.leaf-slider__labels {
|
|
2064
|
+
position: relative;
|
|
2065
|
+
margin-inline: var(--leaf-slider-inset);
|
|
2066
|
+
min-height: var(--body-5-line-height);
|
|
2067
|
+
user-select: text;
|
|
2068
|
+
-webkit-user-select: text;
|
|
1757
2069
|
}
|
|
1758
2070
|
|
|
1759
|
-
.
|
|
1760
|
-
|
|
2071
|
+
.leaf-slider__label {
|
|
2072
|
+
position: absolute;
|
|
2073
|
+
top: 0;
|
|
2074
|
+
max-width: 40%;
|
|
2075
|
+
margin: 0;
|
|
2076
|
+
padding: 0;
|
|
2077
|
+
border: none;
|
|
2078
|
+
background: none;
|
|
2079
|
+
font: inherit;
|
|
2080
|
+
color: var(--text-secondary);
|
|
2081
|
+
white-space: nowrap;
|
|
2082
|
+
transform: translateX(-50%);
|
|
2083
|
+
text-align: center;
|
|
2084
|
+
cursor: pointer;
|
|
2085
|
+
appearance: none;
|
|
2086
|
+
-webkit-appearance: none;
|
|
1761
2087
|
}
|
|
1762
2088
|
|
|
1763
|
-
.
|
|
1764
|
-
|
|
2089
|
+
.leaf-slider__label[data-edge="start"] {
|
|
2090
|
+
transform: translateX(calc(-1 * var(--leaf-slider-inset)));
|
|
2091
|
+
text-align: left;
|
|
1765
2092
|
}
|
|
1766
2093
|
|
|
1767
|
-
.
|
|
1768
|
-
|
|
2094
|
+
.leaf-slider__label[data-edge="end"] {
|
|
2095
|
+
transform: translateX(calc(-100% + var(--leaf-slider-inset)));
|
|
2096
|
+
text-align: right;
|
|
1769
2097
|
}
|
|
1770
2098
|
|
|
1771
|
-
.
|
|
1772
|
-
|
|
2099
|
+
.leaf-slider__label[data-active="true"] {
|
|
2100
|
+
color: var(--text-primary);
|
|
1773
2101
|
}
|
|
1774
2102
|
|
|
1775
|
-
.
|
|
1776
|
-
|
|
2103
|
+
.leaf-slider__label:disabled {
|
|
2104
|
+
cursor: not-allowed;
|
|
1777
2105
|
}
|
|
1778
2106
|
|
|
1779
|
-
.
|
|
1780
|
-
|
|
2107
|
+
.leaf-slider[data-disabled="true"] {
|
|
2108
|
+
opacity: 0.5;
|
|
2109
|
+
pointer-events: none;
|
|
1781
2110
|
}
|
|
1782
2111
|
|
|
1783
|
-
.
|
|
1784
|
-
|
|
2112
|
+
.leaf-slider[data-disabled="true"] .leaf-slider__control {
|
|
2113
|
+
touch-action: auto;
|
|
1785
2114
|
}
|
|
1786
2115
|
|
|
1787
|
-
.
|
|
1788
|
-
|
|
2116
|
+
.leaf-slider[data-disabled="true"] .leaf-slider__control,
|
|
2117
|
+
.leaf-slider[data-disabled="true"] .leaf-slider__mark,
|
|
2118
|
+
.leaf-slider[data-disabled="true"] .leaf-slider__label {
|
|
2119
|
+
cursor: not-allowed;
|
|
1789
2120
|
}
|
|
2121
|
+
}
|
|
1790
2122
|
|
|
1791
|
-
|
|
1792
|
-
padding-inline: var(--spacing-s);
|
|
1793
|
-
}
|
|
2123
|
+
/* --- src/components/Spinner/spinner.css --- */
|
|
1794
2124
|
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
2125
|
+
/*
|
|
2126
|
+
* Spinner — SVG loader-line (Figma Button), viewBox 0 0 21 21.
|
|
2127
|
+
*
|
|
2128
|
+
* Variant animation qua data-animation; size qua data-size; overlay fullscreen
|
|
2129
|
+
* qua .leaf-spinner-overlay. Màu mặc định trắng (dark) / đen (light) qua --base-quinary —
|
|
2130
|
+
* không dùng highlight; override bằng class text-* khi cần. Thiếu attribute → md · spin.
|
|
2131
|
+
*/
|
|
1798
2132
|
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
2133
|
+
@layer components {
|
|
2134
|
+
.leaf-spinner {
|
|
2135
|
+
--leaf-spinner-size: 24px;
|
|
2136
|
+
--leaf-spinner-duration: 1.2s;
|
|
1802
2137
|
|
|
1803
|
-
|
|
1804
|
-
|
|
2138
|
+
display: inline-flex;
|
|
2139
|
+
flex-shrink: 0;
|
|
2140
|
+
align-items: center;
|
|
2141
|
+
justify-content: center;
|
|
2142
|
+
vertical-align: middle;
|
|
2143
|
+
width: var(--leaf-spinner-size);
|
|
2144
|
+
height: var(--leaf-spinner-size);
|
|
2145
|
+
color: var(--base-quinary);
|
|
2146
|
+
line-height: 0;
|
|
1805
2147
|
}
|
|
1806
2148
|
|
|
1807
|
-
.
|
|
1808
|
-
|
|
2149
|
+
.leaf-spinner__icon {
|
|
2150
|
+
display: block;
|
|
2151
|
+
width: 100%;
|
|
2152
|
+
height: 100%;
|
|
1809
2153
|
}
|
|
1810
2154
|
|
|
1811
|
-
.
|
|
1812
|
-
|
|
2155
|
+
/* Fullscreen overlay — pattern Spinner (portal + nền mờ). */
|
|
2156
|
+
.leaf-spinner-overlay {
|
|
2157
|
+
position: fixed;
|
|
2158
|
+
inset: 0;
|
|
2159
|
+
display: flex;
|
|
2160
|
+
align-items: center;
|
|
2161
|
+
justify-content: center;
|
|
2162
|
+
z-index: var(--leaf-z-spinner-overlay, 100);
|
|
2163
|
+
box-sizing: border-box;
|
|
2164
|
+
background-color: var(--overlay);
|
|
2165
|
+
color: var(--base-quinary);
|
|
1813
2166
|
}
|
|
1814
2167
|
|
|
1815
|
-
.
|
|
1816
|
-
|
|
2168
|
+
/* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
2169
|
+
.leaf-spinner[hidden],
|
|
2170
|
+
.leaf-spinner-overlay[hidden] {
|
|
2171
|
+
display: none;
|
|
1817
2172
|
}
|
|
1818
2173
|
|
|
1819
|
-
|
|
1820
|
-
padding-inline: var(--spacing-5xl);
|
|
1821
|
-
}
|
|
2174
|
+
/* ── Size ────────────────────────────────────────────────────────────── */
|
|
1822
2175
|
|
|
1823
|
-
.
|
|
1824
|
-
|
|
2176
|
+
.leaf-spinner[data-size="lg"] {
|
|
2177
|
+
--leaf-spinner-size: 30px;
|
|
1825
2178
|
}
|
|
1826
2179
|
|
|
1827
|
-
.
|
|
1828
|
-
|
|
2180
|
+
.leaf-spinner[data-size="sm"] {
|
|
2181
|
+
--leaf-spinner-size: 20px;
|
|
1829
2182
|
}
|
|
1830
2183
|
|
|
1831
|
-
|
|
1832
|
-
padding-block: var(--spacing-0);
|
|
1833
|
-
}
|
|
2184
|
+
/* ── Animations ──────────────────────────────────────────────────────── */
|
|
1834
2185
|
|
|
1835
|
-
.
|
|
1836
|
-
|
|
2186
|
+
/* spin — xoay cả icon (mặc định). */
|
|
2187
|
+
.leaf-spinner[data-animation="spin"] .leaf-spinner__icon,
|
|
2188
|
+
.leaf-spinner:not([data-animation]) .leaf-spinner__icon {
|
|
2189
|
+
animation: leaf-spinner-spin var(--leaf-spinner-duration) linear infinite;
|
|
1837
2190
|
}
|
|
1838
2191
|
|
|
1839
|
-
|
|
1840
|
-
|
|
2192
|
+
/*
|
|
2193
|
+
* fade — xoay + mask conic để tạo hiệu ứng đuôi mờ (kiểu iOS trên 1 path).
|
|
2194
|
+
*/
|
|
2195
|
+
.leaf-spinner[data-animation="fade"] .leaf-spinner__icon {
|
|
2196
|
+
animation: leaf-spinner-spin var(--leaf-spinner-duration) linear infinite;
|
|
2197
|
+
mask-image: conic-gradient(from 0deg, transparent 0%, #000 70%, #000 100%);
|
|
2198
|
+
-webkit-mask-image: conic-gradient(from 0deg, transparent 0%, #000 70%, #000 100%);
|
|
1841
2199
|
}
|
|
1842
2200
|
|
|
1843
|
-
.
|
|
1844
|
-
|
|
2201
|
+
/* pulse — scale nhịp. */
|
|
2202
|
+
.leaf-spinner[data-animation="pulse"] .leaf-spinner__icon {
|
|
2203
|
+
animation: leaf-spinner-pulse 1s ease-in-out infinite;
|
|
1845
2204
|
}
|
|
1846
2205
|
|
|
1847
|
-
.
|
|
1848
|
-
|
|
2206
|
+
/* breathe — mờ/đậm cả icon. */
|
|
2207
|
+
.leaf-spinner[data-animation="breathe"] .leaf-spinner__icon {
|
|
2208
|
+
animation: leaf-spinner-breathe 1.2s ease-in-out infinite;
|
|
1849
2209
|
}
|
|
2210
|
+
}
|
|
1850
2211
|
|
|
1851
|
-
|
|
1852
|
-
|
|
2212
|
+
@keyframes leaf-spinner-spin {
|
|
2213
|
+
to {
|
|
2214
|
+
transform: rotate(360deg);
|
|
1853
2215
|
}
|
|
2216
|
+
}
|
|
1854
2217
|
|
|
1855
|
-
|
|
1856
|
-
|
|
2218
|
+
@keyframes leaf-spinner-pulse {
|
|
2219
|
+
0%,
|
|
2220
|
+
100% {
|
|
2221
|
+
transform: scale(0.85);
|
|
1857
2222
|
}
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
padding-block: var(--spacing-3xl);
|
|
2223
|
+
50% {
|
|
2224
|
+
transform: scale(1);
|
|
1861
2225
|
}
|
|
2226
|
+
}
|
|
1862
2227
|
|
|
1863
|
-
|
|
1864
|
-
|
|
2228
|
+
@keyframes leaf-spinner-breathe {
|
|
2229
|
+
0%,
|
|
2230
|
+
100% {
|
|
2231
|
+
opacity: 0.35;
|
|
1865
2232
|
}
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
padding-block: var(--spacing-5xl);
|
|
2233
|
+
50% {
|
|
2234
|
+
opacity: 1;
|
|
1869
2235
|
}
|
|
2236
|
+
}
|
|
1870
2237
|
|
|
1871
|
-
|
|
1872
|
-
padding-block: var(--spacing-6xl);
|
|
1873
|
-
}
|
|
2238
|
+
/* --- src/components/Tabs/tabs.css --- */
|
|
1874
2239
|
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
2240
|
+
/*
|
|
2241
|
+
* Tabs — Figma 712:6996 (Tabs Items).
|
|
2242
|
+
*
|
|
2243
|
+
* `variant` map type trong Figma: subcontent | title | functional | buy | sell.
|
|
2244
|
+
* Size: xl | lg | md | sm (tuỳ variant — Title chỉ S, Functional chỉ M, Buy/Sell chỉ L).
|
|
2245
|
+
* Subcontent XL/LG selected = --base-quinary; MD/SM selected = --base-tertiary.
|
|
2246
|
+
*
|
|
2247
|
+
* Variant / size đặt trên tablist (`.leaf-tabs[data-variant][data-size]`), từng
|
|
2248
|
+
* `.leaf-tab` chỉ cần `aria-selected`. Toàn bộ hình thức (kể cả typography của
|
|
2249
|
+
* label) nằm ở đây — React và `leaf.js` chỉ gắn attribute, nên HTML tĩnh viết
|
|
2250
|
+
* cùng markup là ra cùng kết quả.
|
|
2251
|
+
*
|
|
2252
|
+
* Mặc định khi thiếu attribute: variant subcontent, size xl. Chỉ Subcontent đổi
|
|
2253
|
+
* theo size; các variant khác có một size duy nhất nên không đọc `data-size`.
|
|
2254
|
+
*/
|
|
1878
2255
|
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
2256
|
+
@layer components {
|
|
2257
|
+
.leaf-tabs {
|
|
2258
|
+
/* Kích thước của Subcontent — mặc định xl, đổi theo data-size bên dưới. */
|
|
2259
|
+
--leaf-tab-padding: 12px 16px;
|
|
2260
|
+
--leaf-tab-gap: 8px;
|
|
2261
|
+
--leaf-tab-font-size: var(--body-3-size);
|
|
2262
|
+
--leaf-tab-line-height: var(--body-3-line-height);
|
|
2263
|
+
--leaf-tab-font-weight: var(--body-3-highlight-weight);
|
|
1882
2264
|
|
|
1883
|
-
|
|
1884
|
-
|
|
2265
|
+
display: flex;
|
|
2266
|
+
flex-wrap: wrap;
|
|
2267
|
+
align-items: center;
|
|
2268
|
+
gap: 12px;
|
|
1885
2269
|
}
|
|
1886
2270
|
|
|
1887
|
-
.
|
|
1888
|
-
padding
|
|
2271
|
+
.leaf-tabs[data-size="lg"] {
|
|
2272
|
+
--leaf-tab-padding: 8px 16px;
|
|
2273
|
+
--leaf-tab-gap: 8px;
|
|
2274
|
+
--leaf-tab-font-size: var(--body-4-size);
|
|
2275
|
+
--leaf-tab-line-height: var(--body-4-line-height);
|
|
2276
|
+
--leaf-tab-font-weight: var(--body-4-highlight-weight);
|
|
1889
2277
|
}
|
|
1890
2278
|
|
|
1891
|
-
.
|
|
1892
|
-
padding
|
|
2279
|
+
.leaf-tabs[data-size="md"] {
|
|
2280
|
+
--leaf-tab-padding: 4px 12px;
|
|
2281
|
+
--leaf-tab-gap: normal;
|
|
2282
|
+
--leaf-tab-font-size: var(--body-4-size);
|
|
2283
|
+
--leaf-tab-line-height: var(--body-4-line-height);
|
|
2284
|
+
--leaf-tab-font-weight: var(--body-4-weight);
|
|
1893
2285
|
}
|
|
1894
2286
|
|
|
1895
|
-
.
|
|
1896
|
-
padding
|
|
2287
|
+
.leaf-tabs[data-size="sm"] {
|
|
2288
|
+
--leaf-tab-padding: 4px 12px;
|
|
2289
|
+
--leaf-tab-gap: normal;
|
|
2290
|
+
--leaf-tab-font-size: var(--body-5-size);
|
|
2291
|
+
--leaf-tab-line-height: var(--body-5-line-height);
|
|
2292
|
+
--leaf-tab-font-weight: var(--body-5-weight);
|
|
1897
2293
|
}
|
|
1898
2294
|
|
|
1899
|
-
.
|
|
1900
|
-
|
|
2295
|
+
.leaf-tab {
|
|
2296
|
+
display: inline-flex;
|
|
2297
|
+
align-items: center;
|
|
2298
|
+
justify-content: center;
|
|
2299
|
+
text-align: center;
|
|
2300
|
+
white-space: nowrap;
|
|
2301
|
+
border: none;
|
|
2302
|
+
margin: 0;
|
|
2303
|
+
padding: 0;
|
|
2304
|
+
cursor: pointer;
|
|
2305
|
+
background-color: transparent;
|
|
2306
|
+
color: inherit;
|
|
2307
|
+
font: inherit;
|
|
2308
|
+
font-family: var(--font-sans);
|
|
2309
|
+
box-sizing: border-box;
|
|
2310
|
+
appearance: none;
|
|
1901
2311
|
}
|
|
1902
2312
|
|
|
1903
|
-
.
|
|
1904
|
-
|
|
2313
|
+
/* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
2314
|
+
.leaf-tabs[hidden],
|
|
2315
|
+
.leaf-tab[hidden],
|
|
2316
|
+
.leaf-tab__label[hidden] {
|
|
2317
|
+
display: none;
|
|
1905
2318
|
}
|
|
1906
2319
|
|
|
1907
|
-
.
|
|
1908
|
-
|
|
2320
|
+
.leaf-tab:disabled,
|
|
2321
|
+
.leaf-tab[aria-disabled="true"] {
|
|
2322
|
+
cursor: not-allowed;
|
|
1909
2323
|
}
|
|
1910
2324
|
|
|
1911
|
-
.
|
|
1912
|
-
|
|
2325
|
+
.leaf-tab__label {
|
|
2326
|
+
display: inline-flex;
|
|
2327
|
+
align-items: center;
|
|
2328
|
+
justify-content: center;
|
|
2329
|
+
line-height: inherit;
|
|
1913
2330
|
}
|
|
1914
2331
|
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
}
|
|
2332
|
+
/* ── Subcontent (pill) — cũng là mặc định khi không có data-variant ──── */
|
|
2333
|
+
/* XL / LG: idle tertiary · selected quinary. MD / SM: idle trong suốt · selected tertiary. */
|
|
1918
2334
|
|
|
1919
|
-
.
|
|
1920
|
-
|
|
2335
|
+
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]) .leaf-tab {
|
|
2336
|
+
gap: var(--leaf-tab-gap);
|
|
2337
|
+
padding: var(--leaf-tab-padding);
|
|
2338
|
+
border-radius: 1000px;
|
|
2339
|
+
background-color: var(--base-tertiary);
|
|
2340
|
+
color: var(--text-secondary);
|
|
2341
|
+
font-size: var(--leaf-tab-font-size);
|
|
2342
|
+
line-height: var(--leaf-tab-line-height);
|
|
2343
|
+
font-weight: var(--leaf-tab-font-weight);
|
|
1921
2344
|
}
|
|
1922
2345
|
|
|
1923
|
-
.
|
|
1924
|
-
|
|
2346
|
+
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"])
|
|
2347
|
+
.leaf-tab[aria-selected="true"] {
|
|
2348
|
+
background-color: var(--base-quinary);
|
|
2349
|
+
color: var(--text-quaternary);
|
|
1925
2350
|
}
|
|
1926
2351
|
|
|
1927
|
-
.
|
|
1928
|
-
|
|
2352
|
+
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]) .leaf-tab:disabled,
|
|
2353
|
+
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"])
|
|
2354
|
+
.leaf-tab[aria-disabled="true"] {
|
|
2355
|
+
background-color: var(--base-tertiary);
|
|
2356
|
+
color: var(--text-tertiary);
|
|
1929
2357
|
}
|
|
1930
2358
|
|
|
1931
|
-
.
|
|
1932
|
-
|
|
2359
|
+
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
|
|
2360
|
+
[data-size="md"],
|
|
2361
|
+
[data-size="sm"]
|
|
2362
|
+
)
|
|
2363
|
+
.leaf-tab {
|
|
2364
|
+
background-color: transparent;
|
|
1933
2365
|
}
|
|
1934
2366
|
|
|
1935
|
-
.
|
|
1936
|
-
|
|
2367
|
+
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
|
|
2368
|
+
[data-size="md"],
|
|
2369
|
+
[data-size="sm"]
|
|
2370
|
+
)
|
|
2371
|
+
.leaf-tab[aria-selected="true"] {
|
|
2372
|
+
background-color: var(--base-tertiary);
|
|
2373
|
+
color: var(--text-primary);
|
|
1937
2374
|
}
|
|
1938
2375
|
|
|
1939
|
-
.
|
|
1940
|
-
|
|
2376
|
+
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
|
|
2377
|
+
[data-size="md"],
|
|
2378
|
+
[data-size="sm"]
|
|
2379
|
+
)
|
|
2380
|
+
.leaf-tab:disabled,
|
|
2381
|
+
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
|
|
2382
|
+
[data-size="md"],
|
|
2383
|
+
[data-size="sm"]
|
|
2384
|
+
)
|
|
2385
|
+
.leaf-tab[aria-disabled="true"] {
|
|
2386
|
+
background-color: transparent;
|
|
2387
|
+
color: var(--text-tertiary);
|
|
1941
2388
|
}
|
|
1942
2389
|
|
|
1943
|
-
|
|
1944
|
-
padding-right: var(--spacing-l);
|
|
1945
|
-
}
|
|
2390
|
+
/* ── Title (underline) ───────────────────────────────────────────────── */
|
|
1946
2391
|
|
|
1947
|
-
.
|
|
1948
|
-
|
|
2392
|
+
.leaf-tabs[data-variant="title"] .leaf-tab {
|
|
2393
|
+
flex-direction: column;
|
|
2394
|
+
gap: 4px;
|
|
2395
|
+
min-width: 100px;
|
|
2396
|
+
color: var(--text-secondary);
|
|
2397
|
+
font-size: var(--body-4-size);
|
|
2398
|
+
line-height: var(--body-4-line-height);
|
|
2399
|
+
font-weight: var(--body-4-weight);
|
|
1949
2400
|
}
|
|
1950
2401
|
|
|
1951
|
-
.
|
|
1952
|
-
|
|
2402
|
+
.leaf-tabs[data-variant="title"] .leaf-tab[aria-selected="true"] {
|
|
2403
|
+
color: var(--text-primary);
|
|
2404
|
+
font-weight: var(--body-4-highlight-weight);
|
|
1953
2405
|
}
|
|
1954
2406
|
|
|
1955
|
-
.
|
|
1956
|
-
|
|
2407
|
+
.leaf-tabs[data-variant="title"] .leaf-tab::after {
|
|
2408
|
+
content: "";
|
|
2409
|
+
display: block;
|
|
2410
|
+
width: 100%;
|
|
2411
|
+
height: 2px;
|
|
2412
|
+
background-color: var(--text-primary);
|
|
2413
|
+
opacity: 0;
|
|
1957
2414
|
}
|
|
1958
2415
|
|
|
1959
|
-
.
|
|
1960
|
-
|
|
2416
|
+
.leaf-tabs[data-variant="title"] .leaf-tab[aria-selected="true"]::after {
|
|
2417
|
+
opacity: 1;
|
|
1961
2418
|
}
|
|
1962
2419
|
|
|
1963
|
-
.
|
|
1964
|
-
|
|
2420
|
+
.leaf-tabs[data-variant="title"] .leaf-tab:disabled,
|
|
2421
|
+
.leaf-tabs[data-variant="title"] .leaf-tab[aria-disabled="true"] {
|
|
2422
|
+
color: var(--text-tertiary);
|
|
1965
2423
|
}
|
|
1966
2424
|
|
|
1967
|
-
.
|
|
1968
|
-
|
|
2425
|
+
.leaf-tabs[data-variant="title"] .leaf-tab:disabled::after,
|
|
2426
|
+
.leaf-tabs[data-variant="title"] .leaf-tab[aria-disabled="true"]::after {
|
|
2427
|
+
opacity: 0;
|
|
1969
2428
|
}
|
|
1970
2429
|
|
|
1971
|
-
|
|
1972
|
-
padding-right: var(--spacing-7xl);
|
|
1973
|
-
}
|
|
2430
|
+
/* ── Functional ──────────────────────────────────────────────────────── */
|
|
1974
2431
|
|
|
1975
|
-
.
|
|
1976
|
-
|
|
2432
|
+
.leaf-tabs[data-variant="functional"] .leaf-tab {
|
|
2433
|
+
height: 24px;
|
|
2434
|
+
min-width: 100px;
|
|
2435
|
+
padding: 4px 24px;
|
|
2436
|
+
border-radius: 100px;
|
|
2437
|
+
background-color: var(--base-tertiary);
|
|
2438
|
+
color: var(--button-disabled-content);
|
|
2439
|
+
font-size: var(--body-5-size);
|
|
2440
|
+
line-height: var(--body-5-line-height);
|
|
2441
|
+
font-weight: var(--body-5-weight);
|
|
1977
2442
|
}
|
|
1978
2443
|
|
|
1979
|
-
.
|
|
1980
|
-
|
|
2444
|
+
.leaf-tabs[data-variant="functional"] .leaf-tab[aria-selected="true"] {
|
|
2445
|
+
background-color: var(--button-base-primary);
|
|
2446
|
+
color: var(--button-content-primary);
|
|
1981
2447
|
}
|
|
1982
2448
|
|
|
1983
|
-
.
|
|
1984
|
-
|
|
2449
|
+
.leaf-tabs[data-variant="functional"] .leaf-tab:disabled,
|
|
2450
|
+
.leaf-tabs[data-variant="functional"] .leaf-tab[aria-disabled="true"] {
|
|
2451
|
+
background-color: var(--base-tertiary);
|
|
2452
|
+
color: var(--button-disabled-content);
|
|
1985
2453
|
}
|
|
1986
2454
|
|
|
1987
|
-
|
|
1988
|
-
padding-bottom: var(--spacing-m);
|
|
1989
|
-
}
|
|
2455
|
+
/* ── Buy / Sell ──────────────────────────────────────────────────────── */
|
|
1990
2456
|
|
|
1991
|
-
.
|
|
1992
|
-
|
|
2457
|
+
.leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab {
|
|
2458
|
+
min-width: 100px;
|
|
2459
|
+
width: auto;
|
|
2460
|
+
padding: 6px 4px;
|
|
2461
|
+
border-radius: 100px;
|
|
2462
|
+
color: var(--text-primary);
|
|
2463
|
+
font-size: var(--body-5-size);
|
|
2464
|
+
line-height: var(--body-5-line-height);
|
|
2465
|
+
font-weight: var(--body-5-weight);
|
|
1993
2466
|
}
|
|
1994
2467
|
|
|
1995
|
-
.
|
|
1996
|
-
|
|
2468
|
+
.leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab[aria-selected="true"] {
|
|
2469
|
+
font-weight: var(--body-5-highlight-weight);
|
|
1997
2470
|
}
|
|
1998
2471
|
|
|
1999
|
-
.
|
|
2000
|
-
|
|
2472
|
+
.leaf-tabs[data-variant="buy"] .leaf-tab[aria-selected="true"] {
|
|
2473
|
+
background-color: var(--button-base-secondary);
|
|
2474
|
+
color: var(--text-highlight);
|
|
2001
2475
|
}
|
|
2002
2476
|
|
|
2003
|
-
.
|
|
2004
|
-
|
|
2477
|
+
.leaf-tabs[data-variant="sell"] .leaf-tab[aria-selected="true"] {
|
|
2478
|
+
background-color: var(--button-base-secondary-destruction);
|
|
2479
|
+
color: var(--button-base-destruction);
|
|
2005
2480
|
}
|
|
2006
2481
|
|
|
2007
|
-
.
|
|
2008
|
-
|
|
2482
|
+
.leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab:disabled,
|
|
2483
|
+
.leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab[aria-disabled="true"] {
|
|
2484
|
+
color: var(--text-tertiary);
|
|
2485
|
+
background-color: transparent;
|
|
2009
2486
|
}
|
|
2487
|
+
}
|
|
2010
2488
|
|
|
2011
|
-
|
|
2012
|
-
padding-bottom: var(--spacing-5xl);
|
|
2013
|
-
}
|
|
2489
|
+
/* --- src/components/Toast/toast.css --- */
|
|
2014
2490
|
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2491
|
+
/*
|
|
2492
|
+
* Toast — thông báo ngắn góc màn hình.
|
|
2493
|
+
*
|
|
2494
|
+
* Status qua data-status: success (viền / icon / progress --text-highlight, nền
|
|
2495
|
+
* --system-green-secondary) · error (--system-red / --system-red-secondary) · warning
|
|
2496
|
+
* (--system-yellow / --system-yellow-secondary). Thiếu attribute → success.
|
|
2497
|
+
*
|
|
2498
|
+
* Nền thang 800 ở cả hai theme → toast gắn sẵn `data-theme="dark"` để chữ giữ màu sáng.
|
|
2499
|
+
* Thời gian tự đóng = animation của thanh progress (--leaf-toast-duration), dừng khi
|
|
2500
|
+
* hover / focus; hết animation thì JS đóng toast. data-state="closing" chạy hiệu ứng ra.
|
|
2501
|
+
*/
|
|
2018
2502
|
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2503
|
+
@layer components {
|
|
2504
|
+
.leaf-toaster {
|
|
2505
|
+
--leaf-toast-enter-x: 24px;
|
|
2506
|
+
--leaf-toast-enter-y: 0px;
|
|
2022
2507
|
|
|
2023
|
-
|
|
2024
|
-
|
|
2508
|
+
position: fixed;
|
|
2509
|
+
top: 16px;
|
|
2510
|
+
right: 16px;
|
|
2511
|
+
z-index: var(--leaf-z-toast, 120);
|
|
2512
|
+
display: flex;
|
|
2513
|
+
flex-direction: column;
|
|
2514
|
+
align-items: flex-end;
|
|
2515
|
+
gap: 8px;
|
|
2516
|
+
max-width: calc(100vw - 32px);
|
|
2517
|
+
margin: 0;
|
|
2518
|
+
padding: 0;
|
|
2519
|
+
pointer-events: none;
|
|
2025
2520
|
}
|
|
2026
2521
|
|
|
2027
|
-
.
|
|
2028
|
-
|
|
2522
|
+
.leaf-toaster[data-position="top-left"],
|
|
2523
|
+
.leaf-toaster[data-position="bottom-left"] {
|
|
2524
|
+
--leaf-toast-enter-x: -24px;
|
|
2525
|
+
right: auto;
|
|
2526
|
+
left: 16px;
|
|
2527
|
+
align-items: flex-start;
|
|
2029
2528
|
}
|
|
2030
2529
|
|
|
2031
|
-
.
|
|
2032
|
-
|
|
2530
|
+
.leaf-toaster[data-position="top-center"],
|
|
2531
|
+
.leaf-toaster[data-position="bottom-center"] {
|
|
2532
|
+
--leaf-toast-enter-x: 0px;
|
|
2533
|
+
--leaf-toast-enter-y: -12px;
|
|
2534
|
+
right: auto;
|
|
2535
|
+
left: 50%;
|
|
2536
|
+
align-items: center;
|
|
2537
|
+
transform: translateX(-50%);
|
|
2033
2538
|
}
|
|
2034
2539
|
|
|
2035
|
-
.
|
|
2036
|
-
|
|
2540
|
+
.leaf-toaster[data-position^="bottom"] {
|
|
2541
|
+
top: auto;
|
|
2542
|
+
bottom: 16px;
|
|
2037
2543
|
}
|
|
2038
2544
|
|
|
2039
|
-
.
|
|
2040
|
-
|
|
2545
|
+
.leaf-toaster[data-position="bottom-center"] {
|
|
2546
|
+
--leaf-toast-enter-y: 12px;
|
|
2041
2547
|
}
|
|
2042
2548
|
|
|
2043
|
-
.
|
|
2044
|
-
|
|
2549
|
+
.leaf-toaster > .leaf-toast {
|
|
2550
|
+
pointer-events: auto;
|
|
2045
2551
|
}
|
|
2046
2552
|
|
|
2047
|
-
.
|
|
2048
|
-
|
|
2049
|
-
|
|
2553
|
+
.leaf-toast {
|
|
2554
|
+
--leaf-toast-accent: var(--text-highlight);
|
|
2555
|
+
--leaf-toast-surface: var(--system-green-secondary);
|
|
2050
2556
|
|
|
2051
|
-
|
|
2052
|
-
|
|
2557
|
+
position: relative;
|
|
2558
|
+
display: flex;
|
|
2559
|
+
align-items: center;
|
|
2560
|
+
gap: 8px;
|
|
2561
|
+
width: 320px;
|
|
2562
|
+
max-width: 100%;
|
|
2563
|
+
margin: 0;
|
|
2564
|
+
padding: 12px;
|
|
2565
|
+
box-sizing: border-box;
|
|
2566
|
+
overflow: hidden;
|
|
2567
|
+
border: 1px solid var(--leaf-toast-accent);
|
|
2568
|
+
border-radius: 12px;
|
|
2569
|
+
background-color: var(--leaf-toast-surface);
|
|
2570
|
+
box-shadow: 0 10px 15px -3px color-mix(in srgb, var(--overlay) 30%, transparent);
|
|
2571
|
+
color: var(--text-primary);
|
|
2572
|
+
font-family: var(--font-sans);
|
|
2573
|
+
animation: leaf-toast-in 300ms ease-out;
|
|
2053
2574
|
}
|
|
2054
2575
|
|
|
2055
|
-
.
|
|
2056
|
-
|
|
2576
|
+
.leaf-toast[data-status="error"] {
|
|
2577
|
+
--leaf-toast-accent: var(--system-red);
|
|
2578
|
+
--leaf-toast-surface: var(--system-red-secondary);
|
|
2057
2579
|
}
|
|
2058
2580
|
|
|
2059
|
-
.
|
|
2060
|
-
|
|
2581
|
+
.leaf-toast[data-status="warning"] {
|
|
2582
|
+
--leaf-toast-accent: var(--system-yellow);
|
|
2583
|
+
--leaf-toast-surface: var(--system-yellow-secondary);
|
|
2061
2584
|
}
|
|
2062
2585
|
|
|
2063
|
-
.
|
|
2064
|
-
|
|
2586
|
+
.leaf-toast[data-state="closing"] {
|
|
2587
|
+
animation: leaf-toast-out 300ms ease-in forwards;
|
|
2588
|
+
pointer-events: none;
|
|
2065
2589
|
}
|
|
2066
2590
|
|
|
2067
|
-
.
|
|
2068
|
-
|
|
2591
|
+
.leaf-toaster[hidden],
|
|
2592
|
+
.leaf-toast[hidden],
|
|
2593
|
+
.leaf-toast__icon[hidden],
|
|
2594
|
+
.leaf-toast__content[hidden],
|
|
2595
|
+
.leaf-toast__close[hidden],
|
|
2596
|
+
.leaf-toast__glyph[hidden],
|
|
2597
|
+
.leaf-toast__progress[hidden],
|
|
2598
|
+
.leaf-toast__progress-bar[hidden] {
|
|
2599
|
+
display: none;
|
|
2069
2600
|
}
|
|
2070
2601
|
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2602
|
+
.leaf-toast__icon {
|
|
2603
|
+
display: inline-flex;
|
|
2604
|
+
flex-shrink: 0;
|
|
2605
|
+
align-items: center;
|
|
2606
|
+
justify-content: center;
|
|
2607
|
+
padding: 6px;
|
|
2608
|
+
border-radius: 9999px;
|
|
2609
|
+
background-color: var(--leaf-toast-accent);
|
|
2610
|
+
color: var(--text-primary);
|
|
2075
2611
|
}
|
|
2076
2612
|
|
|
2077
|
-
.
|
|
2078
|
-
|
|
2613
|
+
.leaf-toast__glyph {
|
|
2614
|
+
display: block;
|
|
2615
|
+
width: 14px;
|
|
2616
|
+
height: 14px;
|
|
2079
2617
|
}
|
|
2080
2618
|
|
|
2081
|
-
.
|
|
2082
|
-
|
|
2619
|
+
.leaf-toast__content {
|
|
2620
|
+
display: flex;
|
|
2621
|
+
flex: 1 1 auto;
|
|
2622
|
+
flex-direction: column;
|
|
2623
|
+
min-width: 0;
|
|
2083
2624
|
}
|
|
2084
2625
|
|
|
2085
|
-
.
|
|
2086
|
-
|
|
2626
|
+
.leaf-toast__title,
|
|
2627
|
+
.leaf-toast__description {
|
|
2628
|
+
margin: 0;
|
|
2629
|
+
color: var(--text-primary);
|
|
2630
|
+
overflow-wrap: anywhere;
|
|
2087
2631
|
}
|
|
2088
2632
|
|
|
2089
|
-
.
|
|
2090
|
-
|
|
2633
|
+
.leaf-toast__title {
|
|
2634
|
+
font-size: var(--body-3-size);
|
|
2635
|
+
line-height: var(--body-3-line-height);
|
|
2636
|
+
font-weight: var(--body-3-highlight-weight);
|
|
2091
2637
|
}
|
|
2092
2638
|
|
|
2093
|
-
.
|
|
2094
|
-
|
|
2639
|
+
.leaf-toast__description {
|
|
2640
|
+
font-size: var(--body-4-size);
|
|
2641
|
+
line-height: var(--body-4-line-height);
|
|
2642
|
+
font-weight: var(--body-4-weight);
|
|
2095
2643
|
}
|
|
2096
2644
|
|
|
2097
|
-
.
|
|
2098
|
-
|
|
2645
|
+
.leaf-toast__close {
|
|
2646
|
+
display: inline-flex;
|
|
2647
|
+
flex-shrink: 0;
|
|
2648
|
+
align-items: center;
|
|
2649
|
+
justify-content: center;
|
|
2650
|
+
margin: 0;
|
|
2651
|
+
padding: 0;
|
|
2652
|
+
border: none;
|
|
2653
|
+
border-radius: 4px;
|
|
2654
|
+
background: transparent;
|
|
2655
|
+
color: var(--text-primary);
|
|
2656
|
+
font: inherit;
|
|
2657
|
+
cursor: pointer;
|
|
2658
|
+
appearance: none;
|
|
2099
2659
|
}
|
|
2100
2660
|
|
|
2101
|
-
.
|
|
2102
|
-
|
|
2661
|
+
.leaf-toast__close:focus-visible {
|
|
2662
|
+
outline: 2px solid var(--leaf-toast-accent);
|
|
2663
|
+
outline-offset: 2px;
|
|
2103
2664
|
}
|
|
2104
2665
|
|
|
2105
|
-
.
|
|
2106
|
-
|
|
2666
|
+
.leaf-toast__progress {
|
|
2667
|
+
position: absolute;
|
|
2668
|
+
bottom: 0;
|
|
2669
|
+
left: 0;
|
|
2670
|
+
width: 100%;
|
|
2671
|
+
height: 4px;
|
|
2672
|
+
background-color: color-mix(in srgb, var(--text-primary) 10%, transparent);
|
|
2107
2673
|
}
|
|
2108
2674
|
|
|
2109
|
-
.
|
|
2110
|
-
|
|
2675
|
+
.leaf-toast__progress-bar {
|
|
2676
|
+
width: 100%;
|
|
2677
|
+
height: 100%;
|
|
2678
|
+
background-color: var(--leaf-toast-accent);
|
|
2679
|
+
transform-origin: left center;
|
|
2680
|
+
animation: leaf-toast-progress var(--leaf-toast-duration, 4000ms) linear forwards;
|
|
2111
2681
|
}
|
|
2112
2682
|
|
|
2113
|
-
.
|
|
2114
|
-
|
|
2683
|
+
.leaf-toast:is(:hover, :focus-within) .leaf-toast__progress-bar,
|
|
2684
|
+
.leaf-toast[data-state="closing"] .leaf-toast__progress-bar {
|
|
2685
|
+
animation-play-state: paused;
|
|
2115
2686
|
}
|
|
2116
2687
|
|
|
2117
|
-
|
|
2118
|
-
|
|
2688
|
+
@keyframes leaf-toast-in {
|
|
2689
|
+
from {
|
|
2690
|
+
opacity: 0;
|
|
2691
|
+
transform: translate(var(--leaf-toast-enter-x, 24px), var(--leaf-toast-enter-y, 0px));
|
|
2692
|
+
}
|
|
2119
2693
|
}
|
|
2120
2694
|
|
|
2121
|
-
|
|
2122
|
-
|
|
2695
|
+
@keyframes leaf-toast-out {
|
|
2696
|
+
to {
|
|
2697
|
+
opacity: 0;
|
|
2698
|
+
transform: translate(var(--leaf-toast-enter-x, 24px), var(--leaf-toast-enter-y, 0px));
|
|
2699
|
+
}
|
|
2123
2700
|
}
|
|
2124
2701
|
|
|
2125
|
-
|
|
2126
|
-
|
|
2702
|
+
@keyframes leaf-toast-progress {
|
|
2703
|
+
from {
|
|
2704
|
+
transform: scaleX(1);
|
|
2705
|
+
}
|
|
2706
|
+
to {
|
|
2707
|
+
transform: scaleX(0);
|
|
2708
|
+
}
|
|
2127
2709
|
}
|
|
2128
2710
|
|
|
2129
|
-
.
|
|
2130
|
-
|
|
2711
|
+
/* Giảm chuyển động: chỉ mờ dần, không trượt. Progress vẫn chạy vì nó là bộ đếm giờ. */
|
|
2712
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2713
|
+
.leaf-toaster,
|
|
2714
|
+
.leaf-toast {
|
|
2715
|
+
--leaf-toast-enter-x: 0px;
|
|
2716
|
+
--leaf-toast-enter-y: 0px;
|
|
2717
|
+
}
|
|
2131
2718
|
}
|
|
2719
|
+
}
|
|
2132
2720
|
|
|
2133
|
-
|
|
2134
|
-
margin-inline: var(--spacing-m);
|
|
2135
|
-
}
|
|
2721
|
+
/* --- src/components/Toggle/toggle.css --- */
|
|
2136
2722
|
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2723
|
+
/*
|
|
2724
|
+
* Toggle — Figma 730:12438.
|
|
2725
|
+
*
|
|
2726
|
+
* Size M/S qua data-size; Status On/Off qua aria-checked; Active Off qua
|
|
2727
|
+
* :disabled. Thumb trượt bằng transform. Checkmark chỉ hiện ở size sm khi
|
|
2728
|
+
* On + Active. Thiếu attribute → md · off · enabled.
|
|
2729
|
+
*/
|
|
2140
2730
|
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2731
|
+
@layer components {
|
|
2732
|
+
.leaf-toggle {
|
|
2733
|
+
--leaf-toggle-width: 48px;
|
|
2734
|
+
--leaf-toggle-height: 24px;
|
|
2735
|
+
--leaf-toggle-padding: 3px;
|
|
2736
|
+
--leaf-toggle-thumb: 18px;
|
|
2737
|
+
--leaf-toggle-travel: calc(
|
|
2738
|
+
var(--leaf-toggle-width) - var(--leaf-toggle-padding) * 2 - var(--leaf-toggle-thumb)
|
|
2739
|
+
);
|
|
2144
2740
|
|
|
2145
|
-
|
|
2146
|
-
|
|
2741
|
+
position: relative;
|
|
2742
|
+
display: inline-flex;
|
|
2743
|
+
flex-shrink: 0;
|
|
2744
|
+
align-items: center;
|
|
2745
|
+
vertical-align: middle;
|
|
2746
|
+
box-sizing: border-box;
|
|
2747
|
+
width: var(--leaf-toggle-width);
|
|
2748
|
+
height: var(--leaf-toggle-height);
|
|
2749
|
+
margin: 0;
|
|
2750
|
+
padding: var(--leaf-toggle-padding);
|
|
2751
|
+
border: none;
|
|
2752
|
+
border-radius: 12px;
|
|
2753
|
+
background-color: var(--base-quaternary);
|
|
2754
|
+
cursor: pointer;
|
|
2755
|
+
appearance: none;
|
|
2756
|
+
-webkit-appearance: none;
|
|
2757
|
+
font: inherit;
|
|
2758
|
+
color: inherit;
|
|
2759
|
+
transition: background-color 0.2s ease;
|
|
2147
2760
|
}
|
|
2148
2761
|
|
|
2149
|
-
.
|
|
2150
|
-
|
|
2762
|
+
/* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
2763
|
+
.leaf-toggle[hidden],
|
|
2764
|
+
.leaf-toggle__thumb[hidden] {
|
|
2765
|
+
display: none;
|
|
2151
2766
|
}
|
|
2152
2767
|
|
|
2153
|
-
.
|
|
2154
|
-
|
|
2768
|
+
.leaf-toggle__thumb {
|
|
2769
|
+
display: flex;
|
|
2770
|
+
align-items: center;
|
|
2771
|
+
justify-content: center;
|
|
2772
|
+
width: var(--leaf-toggle-thumb);
|
|
2773
|
+
height: var(--leaf-toggle-thumb);
|
|
2774
|
+
border-radius: 100px;
|
|
2775
|
+
background-color: var(--text-secondary);
|
|
2776
|
+
transform: translateX(0);
|
|
2777
|
+
transition:
|
|
2778
|
+
transform 0.2s ease,
|
|
2779
|
+
background-color 0.2s ease;
|
|
2155
2780
|
}
|
|
2156
2781
|
|
|
2157
|
-
.
|
|
2158
|
-
|
|
2782
|
+
.leaf-toggle__check {
|
|
2783
|
+
display: none;
|
|
2784
|
+
width: 60%;
|
|
2785
|
+
height: 60%;
|
|
2786
|
+
color: var(--system-green);
|
|
2159
2787
|
}
|
|
2160
2788
|
|
|
2161
|
-
.
|
|
2162
|
-
|
|
2789
|
+
/* Status On + Active — track xanh, thumb trắng, trượt phải. */
|
|
2790
|
+
.leaf-toggle[aria-checked="true"]:not(:disabled) {
|
|
2791
|
+
background-color: var(--system-green);
|
|
2163
2792
|
}
|
|
2164
2793
|
|
|
2165
|
-
.
|
|
2166
|
-
|
|
2794
|
+
.leaf-toggle[aria-checked="true"]:not(:disabled) .leaf-toggle__thumb {
|
|
2795
|
+
background-color: var(--icon-on-color);
|
|
2796
|
+
transform: translateX(var(--leaf-toggle-travel));
|
|
2167
2797
|
}
|
|
2168
2798
|
|
|
2169
|
-
.
|
|
2170
|
-
|
|
2799
|
+
/* Status On + Active Off (disabled on) — track quaternary, thumb tertiary, vẫn bên phải. */
|
|
2800
|
+
.leaf-toggle[aria-checked="true"]:disabled .leaf-toggle__thumb {
|
|
2801
|
+
background-color: var(--text-tertiary);
|
|
2802
|
+
transform: translateX(var(--leaf-toggle-travel));
|
|
2171
2803
|
}
|
|
2172
2804
|
|
|
2173
|
-
.
|
|
2174
|
-
|
|
2805
|
+
/* Status Off + Active Off — thumb tertiary, bên trái. */
|
|
2806
|
+
.leaf-toggle:disabled:not([aria-checked="true"]) .leaf-toggle__thumb {
|
|
2807
|
+
background-color: var(--text-tertiary);
|
|
2175
2808
|
}
|
|
2176
2809
|
|
|
2177
|
-
|
|
2178
|
-
|
|
2810
|
+
/* Size S */
|
|
2811
|
+
.leaf-toggle[data-size="sm"] {
|
|
2812
|
+
--leaf-toggle-width: 32px;
|
|
2813
|
+
--leaf-toggle-height: 16px;
|
|
2814
|
+
--leaf-toggle-thumb: 10px;
|
|
2179
2815
|
}
|
|
2180
2816
|
|
|
2181
|
-
.
|
|
2182
|
-
|
|
2817
|
+
/* Checkmark chỉ ở S · On · Active. */
|
|
2818
|
+
.leaf-toggle[data-size="sm"][aria-checked="true"]:not(:disabled) .leaf-toggle__check {
|
|
2819
|
+
display: block;
|
|
2183
2820
|
}
|
|
2184
2821
|
|
|
2185
|
-
.
|
|
2186
|
-
|
|
2822
|
+
.leaf-toggle:disabled {
|
|
2823
|
+
cursor: not-allowed;
|
|
2187
2824
|
}
|
|
2188
2825
|
|
|
2189
|
-
.
|
|
2190
|
-
|
|
2826
|
+
.leaf-toggle:focus-visible {
|
|
2827
|
+
outline: 2px solid var(--system-green);
|
|
2828
|
+
outline-offset: 2px;
|
|
2191
2829
|
}
|
|
2830
|
+
}
|
|
2192
2831
|
|
|
2193
|
-
|
|
2194
|
-
margin-block: var(--spacing-2xl);
|
|
2195
|
-
}
|
|
2832
|
+
/* --- src/components/Tooltip/tooltip.css --- */
|
|
2196
2833
|
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2834
|
+
/*
|
|
2835
|
+
* Tooltip — Figma 891:4983.
|
|
2836
|
+
*
|
|
2837
|
+
* Size sm/md/lg; position top/bottom/left/right; align start/center/end.
|
|
2838
|
+
* Nền --base-quaternary; chữ --text-primary.
|
|
2839
|
+
*
|
|
2840
|
+
* Caret Figma: khung hit-area rộng (40×4 / 44×6 / 16×4) nhưng tam giác thật
|
|
2841
|
+
* chỉ 8×4 (sm) hoặc 12×6 (md/lg) nằm giữa khung — không vẽ full-width.
|
|
2842
|
+
*/
|
|
2200
2843
|
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2844
|
+
@layer components {
|
|
2845
|
+
.leaf-tooltip {
|
|
2846
|
+
--leaf-tooltip-pad-y: 8px;
|
|
2847
|
+
--leaf-tooltip-pad-x: 16px;
|
|
2848
|
+
--leaf-tooltip-radius: 8px;
|
|
2849
|
+
--leaf-tooltip-max-width: 176px;
|
|
2850
|
+
--leaf-tooltip-font-size: var(--body-4-size);
|
|
2851
|
+
--leaf-tooltip-line-height: var(--body-4-line-height);
|
|
2852
|
+
--leaf-tooltip-font-weight: var(--body-4-weight);
|
|
2853
|
+
/* Khung caret dọc theo cạnh (top/bottom). */
|
|
2854
|
+
--leaf-tooltip-caret-w: 44px;
|
|
2855
|
+
--leaf-tooltip-caret-h: 6px;
|
|
2856
|
+
/* Chiều rộng tam giác thật trong khung. */
|
|
2857
|
+
--leaf-tooltip-caret-tip: 12px;
|
|
2204
2858
|
|
|
2205
|
-
|
|
2206
|
-
|
|
2859
|
+
display: inline-flex;
|
|
2860
|
+
flex-direction: column;
|
|
2861
|
+
align-items: center;
|
|
2862
|
+
max-width: var(--leaf-tooltip-max-width);
|
|
2863
|
+
box-sizing: border-box;
|
|
2864
|
+
font-family: var(--font-sans);
|
|
2865
|
+
font-size: var(--leaf-tooltip-font-size);
|
|
2866
|
+
line-height: var(--leaf-tooltip-line-height);
|
|
2867
|
+
font-weight: var(--leaf-tooltip-font-weight);
|
|
2868
|
+
color: var(--text-primary);
|
|
2869
|
+
pointer-events: none;
|
|
2207
2870
|
}
|
|
2208
2871
|
|
|
2209
|
-
.
|
|
2210
|
-
|
|
2872
|
+
.leaf-tooltip-trigger {
|
|
2873
|
+
position: relative;
|
|
2874
|
+
display: inline-flex;
|
|
2875
|
+
max-width: 100%;
|
|
2876
|
+
vertical-align: middle;
|
|
2211
2877
|
}
|
|
2212
2878
|
|
|
2213
|
-
.
|
|
2214
|
-
|
|
2879
|
+
.leaf-tooltip--portal {
|
|
2880
|
+
position: fixed;
|
|
2881
|
+
z-index: var(--leaf-z-tooltip, 110);
|
|
2215
2882
|
}
|
|
2216
2883
|
|
|
2217
|
-
.
|
|
2218
|
-
|
|
2884
|
+
/* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
2885
|
+
.leaf-tooltip-trigger[hidden],
|
|
2886
|
+
.leaf-tooltip[hidden],
|
|
2887
|
+
.leaf-tooltip__caret[hidden] {
|
|
2888
|
+
display: none;
|
|
2219
2889
|
}
|
|
2220
2890
|
|
|
2221
|
-
.
|
|
2222
|
-
|
|
2891
|
+
.leaf-tooltip__body {
|
|
2892
|
+
position: relative;
|
|
2893
|
+
z-index: 10;
|
|
2894
|
+
max-width: 100%;
|
|
2895
|
+
text-align: left;
|
|
2896
|
+
box-sizing: border-box;
|
|
2897
|
+
padding: var(--leaf-tooltip-pad-y) var(--leaf-tooltip-pad-x);
|
|
2898
|
+
border-radius: var(--leaf-tooltip-radius);
|
|
2899
|
+
background-color: var(--base-quaternary);
|
|
2900
|
+
word-break: break-word;
|
|
2223
2901
|
}
|
|
2224
2902
|
|
|
2225
|
-
|
|
2226
|
-
|
|
2903
|
+
/*
|
|
2904
|
+
* Caret = khung trong suốt + ::before là tam giác nhỏ ở giữa (đúng SVG Figma).
|
|
2905
|
+
* Mặc định: mũi nhọn xuống (position=top — caret dưới body).
|
|
2906
|
+
*/
|
|
2907
|
+
.leaf-tooltip__caret {
|
|
2908
|
+
position: relative;
|
|
2909
|
+
display: block;
|
|
2910
|
+
flex-shrink: 0;
|
|
2911
|
+
width: var(--leaf-tooltip-caret-w);
|
|
2912
|
+
height: var(--leaf-tooltip-caret-h);
|
|
2913
|
+
background-color: transparent;
|
|
2227
2914
|
}
|
|
2228
2915
|
|
|
2229
|
-
.
|
|
2230
|
-
|
|
2916
|
+
.leaf-tooltip__caret::before {
|
|
2917
|
+
content: "";
|
|
2918
|
+
position: absolute;
|
|
2919
|
+
top: 0;
|
|
2920
|
+
left: 50%;
|
|
2921
|
+
width: var(--leaf-tooltip-caret-tip);
|
|
2922
|
+
height: 100%;
|
|
2923
|
+
background-color: var(--base-quaternary);
|
|
2924
|
+
transform: translateX(-50%);
|
|
2925
|
+
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
2231
2926
|
}
|
|
2232
2927
|
|
|
2233
|
-
|
|
2234
|
-
margin-top: var(--spacing-l);
|
|
2235
|
-
}
|
|
2928
|
+
/* ── Size ────────────────────────────────────────────────────────────── */
|
|
2236
2929
|
|
|
2237
|
-
.
|
|
2238
|
-
|
|
2930
|
+
.leaf-tooltip[data-size="sm"] {
|
|
2931
|
+
--leaf-tooltip-pad-y: 2px;
|
|
2932
|
+
--leaf-tooltip-pad-x: 16px;
|
|
2933
|
+
--leaf-tooltip-radius: 4px;
|
|
2934
|
+
--leaf-tooltip-max-width: 208px;
|
|
2935
|
+
--leaf-tooltip-font-size: var(--body-5-size);
|
|
2936
|
+
--leaf-tooltip-line-height: var(--body-5-line-height);
|
|
2937
|
+
--leaf-tooltip-font-weight: var(--body-5-weight);
|
|
2938
|
+
--leaf-tooltip-caret-w: 40px;
|
|
2939
|
+
--leaf-tooltip-caret-h: 4px;
|
|
2940
|
+
--leaf-tooltip-caret-tip: 8px;
|
|
2941
|
+
min-width: 64px;
|
|
2239
2942
|
}
|
|
2240
2943
|
|
|
2241
|
-
.
|
|
2242
|
-
|
|
2944
|
+
.leaf-tooltip[data-size="lg"] {
|
|
2945
|
+
--leaf-tooltip-pad-y: 16px;
|
|
2946
|
+
--leaf-tooltip-pad-x: 16px;
|
|
2947
|
+
--leaf-tooltip-radius: 12px;
|
|
2948
|
+
--leaf-tooltip-max-width: 288px;
|
|
2949
|
+
--leaf-tooltip-font-size: var(--body-3-size);
|
|
2950
|
+
--leaf-tooltip-line-height: var(--body-3-line-height);
|
|
2951
|
+
--leaf-tooltip-font-weight: var(--body-3-weight);
|
|
2952
|
+
--leaf-tooltip-caret-w: 44px;
|
|
2953
|
+
--leaf-tooltip-caret-h: 6px;
|
|
2954
|
+
--leaf-tooltip-caret-tip: 12px;
|
|
2243
2955
|
}
|
|
2244
2956
|
|
|
2245
|
-
.
|
|
2246
|
-
|
|
2957
|
+
/* Sm left/right: khung caret 16×4 (Figma), không dùng 40×4 của top/bottom. */
|
|
2958
|
+
.leaf-tooltip[data-size="sm"][data-position="left"],
|
|
2959
|
+
.leaf-tooltip[data-size="sm"][data-position="right"] {
|
|
2960
|
+
--leaf-tooltip-caret-w: 16px;
|
|
2247
2961
|
}
|
|
2248
2962
|
|
|
2249
|
-
|
|
2250
|
-
margin-top: var(--spacing-4xl);
|
|
2251
|
-
}
|
|
2963
|
+
/* ── Position ────────────────────────────────────────────────────────── */
|
|
2252
2964
|
|
|
2253
|
-
|
|
2254
|
-
|
|
2965
|
+
/*
|
|
2966
|
+
* Vị trí caret theo data-position (không theo thứ tự DOM): markup vẫn đặt caret
|
|
2967
|
+
* đúng phía nên kết quả không đổi, nhưng khi bubble tự lật phía (thiếu chỗ) thì
|
|
2968
|
+
* chỉ cần đổi data-position là caret sang phía đối diện.
|
|
2969
|
+
*/
|
|
2970
|
+
.leaf-tooltip:is(:not([data-position]), [data-position="top"], [data-position="left"])
|
|
2971
|
+
> .leaf-tooltip__caret {
|
|
2972
|
+
order: 1;
|
|
2255
2973
|
}
|
|
2256
2974
|
|
|
2257
|
-
.
|
|
2258
|
-
|
|
2975
|
+
.leaf-tooltip:is([data-position="bottom"], [data-position="right"]) > .leaf-tooltip__caret {
|
|
2976
|
+
order: -1;
|
|
2259
2977
|
}
|
|
2260
2978
|
|
|
2261
|
-
.
|
|
2262
|
-
|
|
2979
|
+
.leaf-tooltip[data-position="bottom"] {
|
|
2980
|
+
flex-direction: column;
|
|
2263
2981
|
}
|
|
2264
2982
|
|
|
2265
|
-
.
|
|
2266
|
-
|
|
2983
|
+
.leaf-tooltip[data-position="bottom"] .leaf-tooltip__caret::before {
|
|
2984
|
+
clip-path: polygon(50% 0, 0 100%, 100% 100%);
|
|
2267
2985
|
}
|
|
2268
2986
|
|
|
2269
|
-
.
|
|
2270
|
-
|
|
2987
|
+
.leaf-tooltip[data-position="left"] {
|
|
2988
|
+
flex-direction: row;
|
|
2989
|
+
align-items: center;
|
|
2271
2990
|
}
|
|
2272
2991
|
|
|
2273
|
-
.
|
|
2274
|
-
|
|
2992
|
+
.leaf-tooltip[data-position="left"] .leaf-tooltip__caret {
|
|
2993
|
+
width: var(--leaf-tooltip-caret-h);
|
|
2994
|
+
height: var(--leaf-tooltip-caret-w);
|
|
2275
2995
|
}
|
|
2276
2996
|
|
|
2277
|
-
.
|
|
2278
|
-
|
|
2997
|
+
.leaf-tooltip[data-position="left"] .leaf-tooltip__caret::before {
|
|
2998
|
+
top: 50%;
|
|
2999
|
+
left: 0;
|
|
3000
|
+
width: 100%;
|
|
3001
|
+
height: var(--leaf-tooltip-caret-tip);
|
|
3002
|
+
transform: translateY(-50%);
|
|
3003
|
+
clip-path: polygon(0 0, 100% 50%, 0 100%);
|
|
2279
3004
|
}
|
|
2280
3005
|
|
|
2281
|
-
.
|
|
2282
|
-
|
|
3006
|
+
.leaf-tooltip[data-position="right"] {
|
|
3007
|
+
flex-direction: row;
|
|
3008
|
+
align-items: center;
|
|
2283
3009
|
}
|
|
2284
3010
|
|
|
2285
|
-
.
|
|
2286
|
-
|
|
3011
|
+
.leaf-tooltip[data-position="right"] .leaf-tooltip__caret {
|
|
3012
|
+
width: var(--leaf-tooltip-caret-h);
|
|
3013
|
+
height: var(--leaf-tooltip-caret-w);
|
|
2287
3014
|
}
|
|
2288
3015
|
|
|
2289
|
-
.
|
|
2290
|
-
|
|
3016
|
+
.leaf-tooltip[data-position="right"] .leaf-tooltip__caret::before {
|
|
3017
|
+
top: 50%;
|
|
3018
|
+
left: 0;
|
|
3019
|
+
width: 100%;
|
|
3020
|
+
height: var(--leaf-tooltip-caret-tip);
|
|
3021
|
+
transform: translateY(-50%);
|
|
3022
|
+
clip-path: polygon(100% 0, 0 50%, 100% 100%);
|
|
2291
3023
|
}
|
|
2292
3024
|
|
|
2293
|
-
|
|
2294
|
-
margin-right: var(--spacing-3xl);
|
|
2295
|
-
}
|
|
3025
|
+
/* ── Align (caret trên Top/Bottom) ───────────────────────────────────── */
|
|
2296
3026
|
|
|
2297
|
-
.
|
|
2298
|
-
|
|
3027
|
+
.leaf-tooltip[data-position="top"][data-align="start"],
|
|
3028
|
+
.leaf-tooltip[data-position="bottom"][data-align="start"] {
|
|
3029
|
+
align-items: flex-start;
|
|
2299
3030
|
}
|
|
2300
3031
|
|
|
2301
|
-
.
|
|
2302
|
-
|
|
3032
|
+
.leaf-tooltip[data-position="top"][data-align="end"],
|
|
3033
|
+
.leaf-tooltip[data-position="bottom"][data-align="end"] {
|
|
3034
|
+
align-items: flex-end;
|
|
2303
3035
|
}
|
|
2304
3036
|
|
|
2305
|
-
.
|
|
2306
|
-
|
|
3037
|
+
.leaf-tooltip[data-position="top"][data-align="center"],
|
|
3038
|
+
.leaf-tooltip[data-position="bottom"][data-align="center"] {
|
|
3039
|
+
align-items: center;
|
|
2307
3040
|
}
|
|
3041
|
+
}
|
|
2308
3042
|
|
|
2309
|
-
|
|
2310
|
-
margin-right: var(--spacing-7xl);
|
|
2311
|
-
}
|
|
3043
|
+
/* --- src/styles/color.css --- */
|
|
2312
3044
|
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
3045
|
+
/*
|
|
3046
|
+
* Color classes — map 1:1 sang semantic token trong @finhay/leaf-tokens.
|
|
3047
|
+
*
|
|
3048
|
+
* Quy tắc tên: **tiền tố nói thuộc tính, phần sau nói vai trò của token**.
|
|
3049
|
+
*
|
|
3050
|
+
* text-* → color (text-primary, text-red)
|
|
3051
|
+
* bg-* → background-color (bg-primary, bg-red) — token vẫn là --base-*
|
|
3052
|
+
* border-* → border-color (border-primary, border-red)
|
|
3053
|
+
*
|
|
3054
|
+
* Ba bộ dùng chung một hậu tố nên đọc là đoán được: `text-red` / `bg-red` /
|
|
3055
|
+
* `border-red`, `text-primary` / `bg-primary` / `border-primary`. Nhóm system
|
|
3056
|
+
* bỏ chữ `system` trong tên class (token vẫn là `--system-red`), còn `border-*`
|
|
3057
|
+
* lấy màu từ thang base vì viền luôn là màu bề mặt. Secondary của system giữ
|
|
3058
|
+
* hậu tố `-secondary` (vd. `text-red-secondary` ↔ `--system-red-secondary`).
|
|
3059
|
+
*
|
|
3060
|
+
* Mỗi class chỉ set đúng 1 thuộc tính (color / background-color / border-color)
|
|
3061
|
+
* — độ dày / style viền do app khai báo (Tailwind `border`, hoặc CSS của page).
|
|
3062
|
+
* Class tự đổi giá trị theo `[data-theme="light"]` vì nó trỏ vào var, không hard-code màu.
|
|
3063
|
+
*
|
|
3064
|
+
* Chỉ semantic token mới có class. Primitive (--neutral-500, --brand-300…) là
|
|
3065
|
+
* nguồn nội bộ, không dùng thẳng trong UI.
|
|
3066
|
+
*
|
|
3067
|
+
* ─ Vì sao `@layer utilities` ─────────────────────────────────────────────────
|
|
3068
|
+
*
|
|
3069
|
+
* Màu của Leaf là token gốc, trùng tên thì phải thắng. Đặt ở layer cao nhất
|
|
3070
|
+
* nên `.text-primary` của Leaf luôn có hiệu lực khi trùng tên.
|
|
3071
|
+
*
|
|
3072
|
+
* Biến thể trạng thái vẫn override được vì pseudo-class cộng thêm specificity.
|
|
3073
|
+
*/
|
|
2316
3074
|
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
}
|
|
3075
|
+
@layer utilities {
|
|
3076
|
+
/* Text color — content */
|
|
2320
3077
|
|
|
2321
|
-
.
|
|
2322
|
-
|
|
3078
|
+
.text-highlight {
|
|
3079
|
+
color: var(--text-highlight);
|
|
2323
3080
|
}
|
|
2324
3081
|
|
|
2325
|
-
.
|
|
2326
|
-
|
|
3082
|
+
.text-primary {
|
|
3083
|
+
color: var(--text-primary);
|
|
2327
3084
|
}
|
|
2328
3085
|
|
|
2329
|
-
.
|
|
2330
|
-
|
|
3086
|
+
.text-secondary {
|
|
3087
|
+
color: var(--text-secondary);
|
|
2331
3088
|
}
|
|
2332
3089
|
|
|
2333
|
-
.
|
|
2334
|
-
|
|
3090
|
+
.text-tertiary {
|
|
3091
|
+
color: var(--text-tertiary);
|
|
2335
3092
|
}
|
|
2336
3093
|
|
|
2337
|
-
.
|
|
2338
|
-
|
|
3094
|
+
.text-quaternary {
|
|
3095
|
+
color: var(--text-quaternary);
|
|
2339
3096
|
}
|
|
2340
3097
|
|
|
2341
|
-
|
|
2342
|
-
margin-bottom: var(--spacing-3xl);
|
|
2343
|
-
}
|
|
3098
|
+
/* Text color — system */
|
|
2344
3099
|
|
|
2345
|
-
.
|
|
2346
|
-
|
|
3100
|
+
.text-blue {
|
|
3101
|
+
color: var(--system-blue);
|
|
2347
3102
|
}
|
|
2348
3103
|
|
|
2349
|
-
.
|
|
2350
|
-
|
|
3104
|
+
.text-green {
|
|
3105
|
+
color: var(--system-green);
|
|
2351
3106
|
}
|
|
2352
3107
|
|
|
2353
|
-
.
|
|
2354
|
-
|
|
3108
|
+
.text-yellow {
|
|
3109
|
+
color: var(--system-yellow);
|
|
2355
3110
|
}
|
|
2356
3111
|
|
|
2357
|
-
.
|
|
2358
|
-
|
|
3112
|
+
.text-orange {
|
|
3113
|
+
color: var(--system-orange);
|
|
2359
3114
|
}
|
|
2360
3115
|
|
|
2361
|
-
.
|
|
2362
|
-
|
|
3116
|
+
.text-red {
|
|
3117
|
+
color: var(--system-red);
|
|
2363
3118
|
}
|
|
2364
3119
|
|
|
2365
|
-
.
|
|
2366
|
-
|
|
3120
|
+
.text-purple {
|
|
3121
|
+
color: var(--system-purple);
|
|
2367
3122
|
}
|
|
2368
3123
|
|
|
2369
|
-
.
|
|
2370
|
-
|
|
3124
|
+
.text-blue-secondary {
|
|
3125
|
+
color: var(--system-blue-secondary);
|
|
2371
3126
|
}
|
|
2372
3127
|
|
|
2373
|
-
.
|
|
2374
|
-
|
|
3128
|
+
.text-green-secondary {
|
|
3129
|
+
color: var(--system-green-secondary);
|
|
2375
3130
|
}
|
|
2376
3131
|
|
|
2377
|
-
.
|
|
2378
|
-
|
|
3132
|
+
.text-yellow-secondary {
|
|
3133
|
+
color: var(--system-yellow-secondary);
|
|
2379
3134
|
}
|
|
2380
3135
|
|
|
2381
|
-
.
|
|
2382
|
-
|
|
3136
|
+
.text-orange-secondary {
|
|
3137
|
+
color: var(--system-orange-secondary);
|
|
2383
3138
|
}
|
|
2384
3139
|
|
|
2385
|
-
.
|
|
2386
|
-
|
|
3140
|
+
.text-red-secondary {
|
|
3141
|
+
color: var(--system-red-secondary);
|
|
2387
3142
|
}
|
|
2388
3143
|
|
|
2389
|
-
.
|
|
2390
|
-
|
|
3144
|
+
.text-purple-secondary {
|
|
3145
|
+
color: var(--system-purple-secondary);
|
|
2391
3146
|
}
|
|
2392
3147
|
|
|
2393
|
-
|
|
2394
|
-
margin-left: var(--spacing-4xl);
|
|
2395
|
-
}
|
|
3148
|
+
/* Background — surface (--base-*) + system */
|
|
2396
3149
|
|
|
2397
|
-
.
|
|
2398
|
-
|
|
3150
|
+
.bg-highlight {
|
|
3151
|
+
background-color: var(--text-highlight);
|
|
2399
3152
|
}
|
|
2400
3153
|
|
|
2401
|
-
.
|
|
2402
|
-
|
|
3154
|
+
.bg-primary {
|
|
3155
|
+
background-color: var(--base-primary);
|
|
2403
3156
|
}
|
|
2404
3157
|
|
|
2405
|
-
.
|
|
2406
|
-
|
|
3158
|
+
.bg-secondary {
|
|
3159
|
+
background-color: var(--base-secondary);
|
|
2407
3160
|
}
|
|
2408
3161
|
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
.gap-0 {
|
|
2412
|
-
gap: var(--spacing-0);
|
|
3162
|
+
.bg-tertiary {
|
|
3163
|
+
background-color: var(--base-tertiary);
|
|
2413
3164
|
}
|
|
2414
3165
|
|
|
2415
|
-
.
|
|
2416
|
-
|
|
3166
|
+
.bg-quaternary {
|
|
3167
|
+
background-color: var(--base-quaternary);
|
|
2417
3168
|
}
|
|
2418
3169
|
|
|
2419
|
-
.
|
|
2420
|
-
|
|
3170
|
+
.bg-quinary {
|
|
3171
|
+
background-color: var(--base-quinary);
|
|
2421
3172
|
}
|
|
2422
3173
|
|
|
2423
|
-
|
|
2424
|
-
gap: var(--spacing-m);
|
|
2425
|
-
}
|
|
3174
|
+
/* Background — system */
|
|
2426
3175
|
|
|
2427
|
-
.
|
|
2428
|
-
|
|
3176
|
+
.bg-blue {
|
|
3177
|
+
background-color: var(--system-blue);
|
|
2429
3178
|
}
|
|
2430
3179
|
|
|
2431
|
-
.
|
|
2432
|
-
|
|
3180
|
+
.bg-green {
|
|
3181
|
+
background-color: var(--system-green);
|
|
2433
3182
|
}
|
|
2434
3183
|
|
|
2435
|
-
.
|
|
2436
|
-
|
|
3184
|
+
.bg-yellow {
|
|
3185
|
+
background-color: var(--system-yellow);
|
|
2437
3186
|
}
|
|
2438
3187
|
|
|
2439
|
-
.
|
|
2440
|
-
|
|
3188
|
+
.bg-orange {
|
|
3189
|
+
background-color: var(--system-orange);
|
|
2441
3190
|
}
|
|
2442
3191
|
|
|
2443
|
-
.
|
|
2444
|
-
|
|
3192
|
+
.bg-red {
|
|
3193
|
+
background-color: var(--system-red);
|
|
2445
3194
|
}
|
|
2446
3195
|
|
|
2447
|
-
.
|
|
2448
|
-
|
|
3196
|
+
.bg-purple {
|
|
3197
|
+
background-color: var(--system-purple);
|
|
2449
3198
|
}
|
|
2450
3199
|
|
|
2451
|
-
.
|
|
2452
|
-
|
|
3200
|
+
.bg-blue-secondary {
|
|
3201
|
+
background-color: var(--system-blue-secondary);
|
|
2453
3202
|
}
|
|
2454
3203
|
|
|
2455
|
-
.
|
|
2456
|
-
|
|
3204
|
+
.bg-green-secondary {
|
|
3205
|
+
background-color: var(--system-green-secondary);
|
|
2457
3206
|
}
|
|
2458
3207
|
|
|
2459
|
-
.
|
|
2460
|
-
|
|
3208
|
+
.bg-yellow-secondary {
|
|
3209
|
+
background-color: var(--system-yellow-secondary);
|
|
2461
3210
|
}
|
|
2462
3211
|
|
|
2463
|
-
.
|
|
2464
|
-
|
|
3212
|
+
.bg-orange-secondary {
|
|
3213
|
+
background-color: var(--system-orange-secondary);
|
|
2465
3214
|
}
|
|
2466
3215
|
|
|
2467
|
-
.
|
|
2468
|
-
|
|
3216
|
+
.bg-red-secondary {
|
|
3217
|
+
background-color: var(--system-red-secondary);
|
|
2469
3218
|
}
|
|
2470
3219
|
|
|
2471
|
-
.
|
|
2472
|
-
|
|
3220
|
+
.bg-purple-secondary {
|
|
3221
|
+
background-color: var(--system-purple-secondary);
|
|
2473
3222
|
}
|
|
2474
3223
|
|
|
2475
|
-
|
|
2476
|
-
column-gap: var(--spacing-l);
|
|
2477
|
-
}
|
|
3224
|
+
/* Border color — base */
|
|
2478
3225
|
|
|
2479
|
-
.
|
|
2480
|
-
|
|
3226
|
+
.border-highlight {
|
|
3227
|
+
border-color: var(--text-highlight);
|
|
2481
3228
|
}
|
|
2482
3229
|
|
|
2483
|
-
.
|
|
2484
|
-
|
|
3230
|
+
.border-primary {
|
|
3231
|
+
border-color: var(--base-primary);
|
|
2485
3232
|
}
|
|
2486
3233
|
|
|
2487
|
-
.
|
|
2488
|
-
|
|
3234
|
+
.border-secondary {
|
|
3235
|
+
border-color: var(--base-secondary);
|
|
2489
3236
|
}
|
|
2490
3237
|
|
|
2491
|
-
.
|
|
2492
|
-
|
|
3238
|
+
.border-tertiary {
|
|
3239
|
+
border-color: var(--base-tertiary);
|
|
2493
3240
|
}
|
|
2494
3241
|
|
|
2495
|
-
.
|
|
2496
|
-
|
|
3242
|
+
.border-quaternary {
|
|
3243
|
+
border-color: var(--base-quaternary);
|
|
2497
3244
|
}
|
|
2498
3245
|
|
|
2499
|
-
.
|
|
2500
|
-
|
|
3246
|
+
.border-quinary {
|
|
3247
|
+
border-color: var(--base-quinary);
|
|
2501
3248
|
}
|
|
2502
3249
|
|
|
2503
|
-
|
|
2504
|
-
column-gap: var(--spacing-7xl);
|
|
2505
|
-
}
|
|
3250
|
+
/* Border color — system */
|
|
2506
3251
|
|
|
2507
|
-
.
|
|
2508
|
-
|
|
3252
|
+
.border-blue {
|
|
3253
|
+
border-color: var(--system-blue);
|
|
2509
3254
|
}
|
|
2510
3255
|
|
|
2511
|
-
.
|
|
2512
|
-
|
|
3256
|
+
.border-green {
|
|
3257
|
+
border-color: var(--system-green);
|
|
2513
3258
|
}
|
|
2514
3259
|
|
|
2515
|
-
.
|
|
2516
|
-
|
|
3260
|
+
.border-yellow {
|
|
3261
|
+
border-color: var(--system-yellow);
|
|
2517
3262
|
}
|
|
2518
3263
|
|
|
2519
|
-
.
|
|
2520
|
-
|
|
3264
|
+
.border-orange {
|
|
3265
|
+
border-color: var(--system-orange);
|
|
2521
3266
|
}
|
|
2522
3267
|
|
|
2523
|
-
.
|
|
2524
|
-
|
|
3268
|
+
.border-red {
|
|
3269
|
+
border-color: var(--system-red);
|
|
2525
3270
|
}
|
|
2526
3271
|
|
|
2527
|
-
.
|
|
2528
|
-
|
|
3272
|
+
.border-purple {
|
|
3273
|
+
border-color: var(--system-purple);
|
|
2529
3274
|
}
|
|
2530
3275
|
|
|
2531
|
-
.
|
|
2532
|
-
|
|
3276
|
+
.border-blue-secondary {
|
|
3277
|
+
border-color: var(--system-blue-secondary);
|
|
2533
3278
|
}
|
|
2534
3279
|
|
|
2535
|
-
.
|
|
2536
|
-
|
|
3280
|
+
.border-green-secondary {
|
|
3281
|
+
border-color: var(--system-green-secondary);
|
|
2537
3282
|
}
|
|
2538
3283
|
|
|
2539
|
-
.
|
|
2540
|
-
|
|
3284
|
+
.border-yellow-secondary {
|
|
3285
|
+
border-color: var(--system-yellow-secondary);
|
|
2541
3286
|
}
|
|
2542
3287
|
|
|
2543
|
-
.
|
|
2544
|
-
|
|
3288
|
+
.border-orange-secondary {
|
|
3289
|
+
border-color: var(--system-orange-secondary);
|
|
2545
3290
|
}
|
|
2546
3291
|
|
|
2547
|
-
.
|
|
2548
|
-
|
|
3292
|
+
.border-red-secondary {
|
|
3293
|
+
border-color: var(--system-red-secondary);
|
|
2549
3294
|
}
|
|
2550
3295
|
|
|
2551
|
-
.
|
|
2552
|
-
|
|
3296
|
+
.border-purple-secondary {
|
|
3297
|
+
border-color: var(--system-purple-secondary);
|
|
2553
3298
|
}
|
|
2554
3299
|
}
|
|
2555
3300
|
|
|
@@ -2565,9 +3310,7 @@
|
|
|
2565
3310
|
* weight (400 / 600 / 700 theo token). Letter spacing, margin, màu chữ không
|
|
2566
3311
|
* thuộc stylesheet này — màu dùng class text-* riêng.
|
|
2567
3312
|
*
|
|
2568
|
-
* Toàn bộ nằm trong `@layer components`
|
|
2569
|
-
* utilities`) luôn thắng: `class="heading-1 font-bold"` hay `class="body-3
|
|
2570
|
-
* text-2xl"` đều override được mà không cần important modifier.
|
|
3313
|
+
* Toàn bộ nằm trong `@layer components` — SCSS module (ngoài layer) override được.
|
|
2571
3314
|
*/
|
|
2572
3315
|
|
|
2573
3316
|
@layer components {
|