@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.
Files changed (122) hide show
  1. package/README.md +352 -163
  2. package/dist/button.css +12 -15
  3. package/dist/calendar.css +325 -0
  4. package/dist/cdn/leaf-0.1.8.min.css +2 -0
  5. package/dist/cdn/leaf-0.1.8.min.js +2 -0
  6. package/dist/checkbox.css +132 -0
  7. package/dist/classes.css +2256 -1513
  8. package/dist/color.css +27 -32
  9. package/dist/components/Calendar/Calendar.d.ts +49 -0
  10. package/dist/components/Calendar/Calendar.d.ts.map +1 -0
  11. package/dist/components/Calendar/Calendar.js +167 -0
  12. package/dist/components/Calendar/Calendar.js.map +1 -0
  13. package/dist/components/Calendar/index.d.ts +2 -0
  14. package/dist/components/Calendar/index.d.ts.map +1 -0
  15. package/dist/components/Calendar/index.js +2 -0
  16. package/dist/components/Calendar/index.js.map +1 -0
  17. package/dist/components/Checkbox/Checkbox.d.ts +25 -0
  18. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
  19. package/dist/components/Checkbox/Checkbox.js +40 -0
  20. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  21. package/dist/components/Checkbox/index.d.ts +2 -0
  22. package/dist/components/Checkbox/index.d.ts.map +1 -0
  23. package/dist/components/Checkbox/index.js +2 -0
  24. package/dist/components/Checkbox/index.js.map +1 -0
  25. package/dist/components/Dropdown/Dropdown.d.ts +62 -0
  26. package/dist/components/Dropdown/Dropdown.d.ts.map +1 -0
  27. package/dist/components/Dropdown/Dropdown.js +197 -0
  28. package/dist/components/Dropdown/Dropdown.js.map +1 -0
  29. package/dist/components/Dropdown/LanguageDropdown.d.ts +15 -0
  30. package/dist/components/Dropdown/LanguageDropdown.d.ts.map +1 -0
  31. package/dist/components/Dropdown/LanguageDropdown.js +18 -0
  32. package/dist/components/Dropdown/LanguageDropdown.js.map +1 -0
  33. package/dist/components/Dropdown/index.d.ts +4 -0
  34. package/dist/components/Dropdown/index.d.ts.map +1 -0
  35. package/dist/components/Dropdown/index.js +5 -0
  36. package/dist/components/Dropdown/index.js.map +1 -0
  37. package/dist/components/Input/Input.d.ts +57 -0
  38. package/dist/components/Input/Input.d.ts.map +1 -0
  39. package/dist/components/Input/Input.js +78 -0
  40. package/dist/components/Input/Input.js.map +1 -0
  41. package/dist/components/Input/InputDate.d.ts +56 -0
  42. package/dist/components/Input/InputDate.d.ts.map +1 -0
  43. package/dist/components/Input/InputDate.js +119 -0
  44. package/dist/components/Input/InputDate.js.map +1 -0
  45. package/dist/components/Input/InputOtp.d.ts +33 -0
  46. package/dist/components/Input/InputOtp.d.ts.map +1 -0
  47. package/dist/components/Input/InputOtp.js +96 -0
  48. package/dist/components/Input/InputOtp.js.map +1 -0
  49. package/dist/components/Input/InputStepper.d.ts +42 -0
  50. package/dist/components/Input/InputStepper.d.ts.map +1 -0
  51. package/dist/components/Input/InputStepper.js +86 -0
  52. package/dist/components/Input/InputStepper.js.map +1 -0
  53. package/dist/components/Input/index.d.ts +5 -0
  54. package/dist/components/Input/index.d.ts.map +1 -0
  55. package/dist/components/Input/index.js +5 -0
  56. package/dist/components/Input/index.js.map +1 -0
  57. package/dist/components/Radio/Radio.d.ts +39 -0
  58. package/dist/components/Radio/Radio.d.ts.map +1 -0
  59. package/dist/components/Radio/Radio.js +50 -0
  60. package/dist/components/Radio/Radio.js.map +1 -0
  61. package/dist/components/Radio/index.d.ts +2 -0
  62. package/dist/components/Radio/index.d.ts.map +1 -0
  63. package/dist/components/Radio/index.js +2 -0
  64. package/dist/components/Radio/index.js.map +1 -0
  65. package/dist/components/Toast/Toast.d.ts +66 -0
  66. package/dist/components/Toast/Toast.d.ts.map +1 -0
  67. package/dist/components/Toast/Toast.js +77 -0
  68. package/dist/components/Toast/Toast.js.map +1 -0
  69. package/dist/components/Toast/index.d.ts +2 -0
  70. package/dist/components/Toast/index.d.ts.map +1 -0
  71. package/dist/components/Toast/index.js +2 -0
  72. package/dist/components/Toast/index.js.map +1 -0
  73. package/dist/core/calendar.d.ts +36 -0
  74. package/dist/core/calendar.d.ts.map +1 -0
  75. package/dist/core/calendar.js +65 -0
  76. package/dist/core/calendar.js.map +1 -0
  77. package/dist/core/dropdown.d.ts +66 -0
  78. package/dist/core/dropdown.d.ts.map +1 -0
  79. package/dist/core/dropdown.js +131 -0
  80. package/dist/core/dropdown.js.map +1 -0
  81. package/dist/core/language.d.ts +25 -0
  82. package/dist/core/language.d.ts.map +1 -0
  83. package/dist/core/language.js +17 -0
  84. package/dist/core/language.js.map +1 -0
  85. package/dist/core/otp.d.ts +30 -0
  86. package/dist/core/otp.d.ts.map +1 -0
  87. package/dist/core/otp.js +65 -0
  88. package/dist/core/otp.js.map +1 -0
  89. package/dist/core/stepper.d.ts +39 -0
  90. package/dist/core/stepper.d.ts.map +1 -0
  91. package/dist/core/stepper.js +109 -0
  92. package/dist/core/stepper.js.map +1 -0
  93. package/dist/core/toast.d.ts +67 -0
  94. package/dist/core/toast.d.ts.map +1 -0
  95. package/dist/core/toast.js +102 -0
  96. package/dist/core/toast.js.map +1 -0
  97. package/dist/dialog.css +15 -9
  98. package/dist/dropdown.css +303 -0
  99. package/dist/index.d.ts +6 -0
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +6 -0
  102. package/dist/index.js.map +1 -1
  103. package/dist/input-date.css +49 -0
  104. package/dist/input-otp.css +76 -0
  105. package/dist/input-stepper.css +179 -0
  106. package/dist/input.css +218 -0
  107. package/dist/logo.css +2 -2
  108. package/dist/radio.css +124 -0
  109. package/dist/slider.css +16 -14
  110. package/dist/spinner.css +3 -3
  111. package/dist/styles.css +2255 -1545
  112. package/dist/tabs.css +5 -4
  113. package/dist/toast.css +234 -0
  114. package/dist/toggle.css +4 -3
  115. package/dist/tokens.css +0 -33
  116. package/dist/tooltip.css +13 -12
  117. package/dist/typography.css +1 -3
  118. package/package.json +10 -3
  119. package/dist/border.css +0 -45
  120. package/dist/cdn/leaf-0.1.6.min.css +0 -2
  121. package/dist/cdn/leaf-0.1.6.min.js +0 -2
  122. 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: var(--spacing-s) var(--spacing-xl);
27
- --leaf-button-icon-only-padding: var(--spacing-s);
28
- --leaf-button-gap: var(--spacing-l);
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-decoration: none;
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: var(--spacing-s) var(--spacing-l);
100
- --leaf-button-gap: var(--spacing-m);
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: var(--spacing-xs) var(--spacing-m);
112
- --leaf-button-icon-only-padding: var(--spacing-xs);
113
- --leaf-button-gap: var(--spacing-s);
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/Dialog/dialog.css --- */
215
+ /* --- src/components/Calendar/calendar.css --- */
219
216
 
220
217
  /*
221
- * Dialog — Figma 994:4149.
218
+ * Calendar — port từ vnsc Calendar (panel chọn ngày / giờ).
222
219
  *
223
- * Backdrop phủ toàn màn hình + blur; panel căn giữa. Header (back · title · close)
224
- * bật/tắt qua markup — React chỉ gắn/gỡ phần tử, không gắn class typography/màu
225
- * theo prop. Thiếu phần header → chỉ còn body (children).
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-dialog-backdrop {
230
- position: fixed;
231
- inset: 0;
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: var(--leaf-dialog-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
- border-radius: var(--leaf-dialog-radius);
277
- background-color: var(--base-primary);
278
- color: var(--text-primary);
279
- font-family: var(--font-sans);
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-dialog__header {
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
- /* Cụm trái: back + title */
298
- .leaf-dialog__start {
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
- * Title — heading-3 · --text-primary nằm ngay ở đây: markup không cần class typography /
308
- * màu, nên utility trùng tên của app (vd. `text-primary` sinh từ `@theme`) không chen vào.
309
- */
310
- .leaf-dialog__start > :where(h2, p) {
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
- font-size: var(--heading-3-size);
319
- line-height: var(--heading-3-line-height);
320
- font-weight: var(--heading-3-weight);
264
+ appearance: none;
265
+ cursor: pointer;
321
266
  }
322
267
 
323
- .leaf-dialog__back,
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
- margin: 0;
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
- cursor: pointer;
333
- color: var(--text-primary);
334
- background: transparent;
335
- font: inherit;
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-dialog__back:hover,
346
- .leaf-dialog__close:hover {
347
- color: var(--text-highlight);
283
+ .leaf-calendar__nav[data-size="sm"] {
284
+ width: 24px;
285
+ height: 24px;
286
+ font-size: 14px;
348
287
  }
349
288
 
350
- .leaf-dialog__back:focus-visible,
351
- .leaf-dialog__close:focus-visible {
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-dialog__icon {
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-dialog__back .leaf-dialog__icon {
363
- font-size: var(--leaf-dialog-back-size);
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-dialog__close {
367
- width: var(--leaf-dialog-close-size);
368
- min-height: var(--leaf-dialog-close-size);
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-dialog__body {
316
+ .leaf-calendar__heading {
376
317
  display: flex;
377
- flex: 1 1 auto;
378
318
  flex-direction: column;
379
- gap: var(--leaf-dialog-gap);
380
- min-height: 0;
381
- width: 100%;
382
- overflow: auto;
319
+ align-items: center;
383
320
  }
384
- }
385
321
 
386
- /* --- src/components/Logo/logo.css --- */
322
+ .leaf-calendar__caret {
323
+ display: inline-flex;
324
+ font-size: 12px;
325
+ color: var(--text-tertiary);
326
+ }
387
327
 
388
- /*
389
- * Logo — Figma 924:1074.
390
- *
391
- * React: chọn SVG trong assets.ts, render <img class="leaf-logo__img">.
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
- @layer components {
399
- .leaf-logo {
400
- display: inline-flex;
401
- flex-shrink: 0;
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: center;
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
- /* HTML tĩnh — không có <img>, asset lấy từ data-* */
417
- .leaf-logo:empty {
418
- display: inline-block;
419
- height: var(--leaf-logo-size, 40px);
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-logo__img {
424
- display: block;
425
- height: var(--leaf-logo-size, 40px);
426
- width: auto;
427
- max-width: 100%;
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
- /* `display` ở trên (kể cả `:empty`) thắng `[hidden]` của trình duyệt — khai báo lại, đứng sau. */
431
- .leaf-logo[hidden] {
432
- display: none;
368
+ .leaf-calendar__weekday {
369
+ padding-block: 2px;
370
+ text-align: center;
433
371
  }
434
- }
435
372
 
436
- /* --- src/components/Skeleton/skeleton.css --- */
373
+ .leaf-calendar__num,
374
+ .leaf-calendar__select,
375
+ .leaf-calendar__option--time {
376
+ font-variant-numeric: tabular-nums;
377
+ }
437
378
 
438
- /*
439
- * Skeleton — placeholder shimmer.
440
- *
441
- * Nền `--base-tertiary` (dark: #28292B). Kích thước / radius qua custom property
442
- * từ React (hoặc style inline khi HTML tĩnh). Thiếu biến → full width/height,
443
- * radius 12px.
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
- @layer components {
447
- .leaf-skeleton {
448
- --leaf-skeleton-width: 100%;
449
- --leaf-skeleton-height: 100%;
450
- --leaf-skeleton-radius: 12px;
396
+ .leaf-calendar__option--time {
397
+ flex-shrink: 0;
398
+ height: 24px;
399
+ }
451
400
 
452
- position: relative;
453
- overflow: hidden;
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-skeleton__shimmer {
462
- position: absolute;
463
- inset: 0;
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
- @keyframes leaf-skeleton-shimmer {
475
- 0% {
476
- transform: translateX(-100%);
477
- }
478
- 100% {
479
- transform: translateX(100%);
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
- /* --- src/components/Slider/slider.css --- */
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
- * Slider — Figma 730:12646.
487
- *
488
- * Giá trị liên tục trên rail (kéo / click chính xác tới từng step — như
489
- * TradeQuickSlider). Mốc chia đều đặt tuyệt đối theo `left: <%>`; thumb đặt ở
490
- * `--leaf-slider-fill`. Ở min thumb = `--text-primary`; khi > min =
491
- * `--leaf-slider-active` (mặc định `--text-highlight`).
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
- @layer components {
498
- .leaf-slider {
499
- --leaf-slider-active: var(--text-highlight);
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
- display: flex;
512
- flex-direction: column;
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
- /* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để `hidden` luôn ẩn. */
527
- .leaf-slider[hidden] {
528
- display: none;
444
+ .leaf-calendar__time {
445
+ display: flex;
446
+ align-items: center;
447
+ justify-content: space-between;
448
+ gap: 8px;
529
449
  }
530
450
 
531
- /* Figma gap XS (4) giữa track và Value labels. */
532
- .leaf-slider__body {
451
+ .leaf-calendar__time-group {
533
452
  display: flex;
534
- flex-direction: column;
453
+ align-items: center;
535
454
  gap: 4px;
536
- width: 100%;
537
455
  }
538
456
 
539
- .leaf-slider__header {
540
- display: flex;
541
- align-items: flex-start;
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
- gap: 8px;
544
- width: 100%;
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-slider__title,
552
- .leaf-slider__unit {
553
- min-width: 0;
476
+ .leaf-calendar__select[aria-expanded="true"] {
477
+ border-color: var(--text-highlight);
554
478
  }
555
479
 
556
- .leaf-slider__unit {
557
- text-align: right;
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-slider__control {
561
- position: relative;
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
- align-items: center;
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-slider__control:focus-visible {
573
- outline: 2px solid var(--leaf-slider-active);
574
- outline-offset: 4px;
575
- border-radius: 4px;
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
- .leaf-slider[data-dragging="true"] .leaf-slider__control {
579
- cursor: grabbing;
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-slider__rail {
583
- position: absolute;
584
- left: var(--leaf-slider-inset);
585
- right: var(--leaf-slider-inset);
586
- top: 50%;
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-slider__fill {
595
- display: block;
596
- height: 100%;
597
- width: var(--leaf-slider-fill);
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
- /* Khung toạ độ cho mốc + thumb — trùng với rail, cao 0, nằm giữa control. */
603
- .leaf-slider__marks {
604
- position: absolute;
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-slider__mark {
579
+ .leaf-checkbox__input {
614
580
  position: absolute;
615
581
  top: 0;
616
582
  left: 0;
617
- display: block;
618
- box-sizing: border-box;
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
- border-radius: 50%;
625
- background-color: var(--text-tertiary);
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-slider__mark[data-state="passed"] {
635
- background-color: var(--text-primary);
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
- /* Mốc trùng giá trị nằm dưới thumb — cùng màu để không lộ viền. */
639
- .leaf-slider__mark[data-state="active"] {
640
- background-color: var(--text-primary);
611
+ .leaf-checkbox__icon {
612
+ display: none;
613
+ width: 14px;
614
+ height: 14px;
641
615
  }
642
616
 
643
- .leaf-slider:not([data-at-min="true"]) .leaf-slider__mark[data-state="active"] {
644
- background-color: var(--leaf-slider-active);
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-slider__thumb {
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
- .leaf-slider__label {
677
- position: absolute;
678
- top: 0;
679
- max-width: 40%;
680
- margin: 0;
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-slider__label[data-edge="start"] {
695
- transform: translateX(calc(-1 * var(--leaf-slider-inset)));
696
- text-align: left;
634
+ .leaf-checkbox__input:indeterminate + .leaf-checkbox__box .leaf-checkbox__dash {
635
+ display: block;
697
636
  }
698
637
 
699
- .leaf-slider__label[data-edge="end"] {
700
- transform: translateX(calc(-100% + var(--leaf-slider-inset)));
701
- text-align: right;
638
+ /* Disabled */
639
+ .leaf-checkbox__input:disabled + .leaf-checkbox__box {
640
+ border-color: var(--base-quaternary);
702
641
  }
703
642
 
704
- .leaf-slider__label[data-active="true"] {
705
- color: var(--text-primary);
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-slider__label:disabled {
650
+ .leaf-checkbox:has(.leaf-checkbox__input:disabled) {
709
651
  cursor: not-allowed;
710
652
  }
711
653
 
712
- .leaf-slider[data-disabled="true"] {
713
- opacity: 0.5;
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-slider[data-disabled="true"] .leaf-slider__control {
718
- touch-action: auto;
658
+ .leaf-checkbox__input:disabled ~ .leaf-checkbox__text {
659
+ color: var(--text-secondary);
719
660
  }
720
661
 
721
- .leaf-slider[data-disabled="true"] .leaf-slider__control,
722
- .leaf-slider[data-disabled="true"] .leaf-slider__mark,
723
- .leaf-slider[data-disabled="true"] .leaf-slider__label {
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/Spinner/spinner.css --- */
668
+ /* --- src/components/Dialog/dialog.css --- */
729
669
 
730
670
  /*
731
- * Spinner — SVG loader-line (Figma Button), viewBox 0 0 21 21.
671
+ * Dialog — Figma 994:4149.
732
672
  *
733
- * Variant animation qua data-animation; size qua data-size; overlay fullscreen
734
- * qua .leaf-spinner-overlay. Màu mặc định trắng (dark) / đen (light) qua --base-quinary —
735
- * không dùng highlight; override bằng class text-* khi cần. Thiếu attribute → md · spin.
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-spinner {
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
- color: var(--base-quinary);
694
+ backdrop-filter: blur(5px);
771
695
  }
772
696
 
773
- /* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để HTML tĩnh ẩn được. */
774
- .leaf-spinner[hidden],
775
- .leaf-spinner-overlay[hidden] {
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
- /* ── Size ────────────────────────────────────────────────────────────── */
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
- .leaf-spinner[data-size="lg"] {
782
- --leaf-spinner-size: 30px;
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
- .leaf-spinner[data-size="sm"] {
786
- --leaf-spinner-size: 20px;
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
- /* ── Animations ──────────────────────────────────────────────────────── */
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
- /* spin — xoay cả icon (mặc định). */
792
- .leaf-spinner[data-animation="spin"] .leaf-spinner__icon,
793
- .leaf-spinner:not([data-animation]) .leaf-spinner__icon {
794
- animation: leaf-spinner-spin var(--leaf-spinner-duration) linear infinite;
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
- * fade — xoay + mask conic để tạo hiệu ứng đuôi mờ (kiểu iOS trên 1 path).
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-spinner[data-animation="fade"] .leaf-spinner__icon {
801
- animation: leaf-spinner-spin var(--leaf-spinner-duration) linear infinite;
802
- mask-image: conic-gradient(from 0deg, transparent 0%, #000 70%, #000 100%);
803
- -webkit-mask-image: conic-gradient(from 0deg, transparent 0%, #000 70%, #000 100%);
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
- /* pulse — scale nhịp. */
807
- .leaf-spinner[data-animation="pulse"] .leaf-spinner__icon {
808
- animation: leaf-spinner-pulse 1s ease-in-out infinite;
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
- /* breathe — mờ/đậm cả icon. */
812
- .leaf-spinner[data-animation="breathe"] .leaf-spinner__icon {
813
- animation: leaf-spinner-breathe 1.2s ease-in-out infinite;
796
+ .leaf-dialog__back {
797
+ width: var(--leaf-dialog-back-size);
798
+ height: var(--leaf-dialog-back-size);
814
799
  }
815
- }
816
800
 
817
- @keyframes leaf-spinner-spin {
818
- to {
819
- transform: rotate(360deg);
801
+ .leaf-dialog__back:hover,
802
+ .leaf-dialog__close:hover {
803
+ color: var(--text-highlight);
820
804
  }
821
- }
822
805
 
823
- @keyframes leaf-spinner-pulse {
824
- 0%,
825
- 100% {
826
- transform: scale(0.85);
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
- 50% {
829
- transform: scale(1);
811
+
812
+ .leaf-dialog__icon {
813
+ display: block;
814
+ width: 1em;
815
+ height: 1em;
830
816
  }
831
- }
832
817
 
833
- @keyframes leaf-spinner-breathe {
834
- 0%,
835
- 100% {
836
- opacity: 0.35;
818
+ .leaf-dialog__back .leaf-dialog__icon {
819
+ font-size: var(--leaf-dialog-back-size);
837
820
  }
838
- 50% {
839
- opacity: 1;
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/Tabs/tabs.css --- */
842
+ /* --- src/components/Dropdown/dropdown.css --- */
844
843
 
845
844
  /*
846
- * Tabs — Figma 712:6996 (Tabs Items).
845
+ * Dropdown — chọn một giá trị từ danh sách.
847
846
  *
848
- * `variant` map type trong Figma: subcontent | title | functional | buy | sell.
849
- * Size: xl | lg | md | sm (tuỳ variant — Title chỉ S, Functional chỉ M, Buy/Sell chỉ L).
850
- * Subcontent XL/LG selected = --base-quinary; MD/SM selected = --base-tertiary.
851
- *
852
- * Variant / size đặt trên tablist (`.leaf-tabs[data-variant][data-size]`), từng
853
- * `.leaf-tab` chỉ cần `aria-selected`. Toàn bộ hình thức (kể cả typography của
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-tabs {
863
- /* Kích thước của Subcontent — mặc định xl, đổi theo data-size bên dưới. */
864
- --leaf-tab-padding: 12px 16px;
865
- --leaf-tab-gap: 8px;
866
- --leaf-tab-font-size: var(--body-3-size);
867
- --leaf-tab-line-height: var(--body-3-line-height);
868
- --leaf-tab-font-weight: var(--body-3-highlight-weight);
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
- flex-wrap: wrap;
872
- align-items: center;
873
- gap: 12px;
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-tabs[data-size="lg"] {
877
- --leaf-tab-padding: 8px 16px;
878
- --leaf-tab-gap: 8px;
879
- --leaf-tab-font-size: var(--body-4-size);
880
- --leaf-tab-line-height: var(--body-4-line-height);
881
- --leaf-tab-font-weight: var(--body-4-highlight-weight);
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-tabs[data-size="md"] {
885
- --leaf-tab-padding: 4px 12px;
886
- --leaf-tab-gap: normal;
887
- --leaf-tab-font-size: var(--body-4-size);
888
- --leaf-tab-line-height: var(--body-4-line-height);
889
- --leaf-tab-font-weight: var(--body-4-weight);
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-tabs[data-size="sm"] {
893
- --leaf-tab-padding: 4px 12px;
894
- --leaf-tab-gap: normal;
895
- --leaf-tab-font-size: var(--body-5-size);
896
- --leaf-tab-line-height: var(--body-5-line-height);
897
- --leaf-tab-font-weight: var(--body-5-weight);
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
- .leaf-tab {
901
- display: inline-flex;
911
+ /* ── Trigger ─────────────────────────────────────────────────────────── */
912
+
913
+ .leaf-dropdown__trigger {
914
+ display: flex;
902
915
  align-items: center;
903
- justify-content: center;
904
- border: none;
916
+ justify-content: space-between;
917
+ gap: 8px;
918
+ width: 100%;
919
+ min-width: 0;
905
920
  margin: 0;
906
- padding: 0;
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
- /* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để `hidden` luôn ẩn. */
919
- .leaf-tabs[hidden],
920
- .leaf-tab[hidden] {
921
- display: none;
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-tab:disabled,
925
- .leaf-tab[aria-disabled="true"] {
926
- cursor: not-allowed;
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-tab__label {
930
- display: inline-flex;
931
- align-items: center;
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
- /* ── Subcontent (pill) — cũng là mặc định khi không có data-variant ──── */
937
- /* XL / LG: idle tertiary · selected quinary. MD / SM: idle trong suốt · selected tertiary. */
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-tabs:is(:not([data-variant]), [data-variant="subcontent"])
951
- .leaf-tab[aria-selected="true"] {
952
- background-color: var(--base-quinary);
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-tabs:is(:not([data-variant]), [data-variant="subcontent"]) .leaf-tab:disabled,
957
- .leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"])
958
- .leaf-tab[aria-disabled="true"] {
959
- background-color: var(--base-tertiary);
960
- color: var(--text-tertiary);
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-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
964
- [data-size="md"],
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-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
972
- [data-size="md"],
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-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
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
- /* ── Title (underline) ───────────────────────────────────────────────── */
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-tabs[data-variant="title"] .leaf-tab {
997
- flex-direction: column;
998
- gap: 4px;
999
- min-width: 100px;
1000
- color: var(--text-secondary);
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-tabs[data-variant="title"] .leaf-tab[aria-selected="true"] {
1007
- color: var(--text-primary);
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-tabs[data-variant="title"] .leaf-tab::after {
1012
- content: "";
1001
+ .leaf-dropdown__chevron {
1013
1002
  display: block;
1014
- width: 100%;
1015
- height: 2px;
1016
- background-color: var(--text-primary);
1017
- opacity: 0;
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-tabs[data-variant="title"] .leaf-tab[aria-selected="true"]::after {
1021
- opacity: 1;
1010
+ .leaf-dropdown[data-open="true"] .leaf-dropdown__chevron {
1011
+ transform: rotate(180deg);
1022
1012
  }
1023
1013
 
1024
- .leaf-tabs[data-variant="title"] .leaf-tab:disabled,
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
- .leaf-tabs[data-variant="title"] .leaf-tab:disabled::after,
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-tabs[data-variant="functional"] .leaf-tab {
1037
- height: 24px;
1038
- min-width: 100px;
1039
- padding: 4px 24px;
1040
- border-radius: 100px;
1041
- background-color: var(--base-tertiary);
1042
- color: var(--button-disabled-content);
1043
- font-size: var(--body-5-size);
1044
- line-height: var(--body-5-line-height);
1045
- font-weight: var(--body-5-weight);
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-tabs[data-variant="functional"] .leaf-tab[aria-selected="true"] {
1049
- background-color: var(--button-base-primary);
1050
- color: var(--button-content-primary);
1040
+ .leaf-dropdown[data-trigger="text"] .leaf-dropdown__list {
1041
+ width: max-content;
1042
+ min-width: 100%;
1051
1043
  }
1052
1044
 
1053
- .leaf-tabs[data-variant="functional"] .leaf-tab:disabled,
1054
- .leaf-tabs[data-variant="functional"] .leaf-tab[aria-disabled="true"] {
1055
- background-color: var(--base-tertiary);
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
- /* ── Buy / Sell ──────────────────────────────────────────────────────── */
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-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab {
1062
- min-width: 100px;
1063
- width: auto;
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-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab[aria-selected="true"] {
1073
- font-weight: var(--body-5-highlight-weight);
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-tabs[data-variant="buy"] .leaf-tab[aria-selected="true"] {
1077
- background-color: var(--button-base-secondary);
1078
- color: var(--text-highlight);
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
- .leaf-tabs[data-variant="sell"] .leaf-tab[aria-selected="true"] {
1082
- background-color: var(--button-base-secondary-destruction);
1083
- color: var(--button-base-destruction);
1084
- }
1083
+ /* ── Variant radio ───────────────────────────────────────────────────── */
1085
1084
 
1086
- .leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab:disabled,
1087
- .leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab[aria-disabled="true"] {
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
- position: relative;
1114
- display: inline-flex;
1115
- flex-shrink: 0;
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
- cursor: pointer;
1126
- vertical-align: middle;
1127
- appearance: none;
1128
- -webkit-appearance: none;
1129
- font: inherit;
1130
- color: inherit;
1131
- transition: background-color 0.2s ease;
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
- /* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để `hidden` luôn ẩn. */
1135
- .leaf-toggle[hidden] {
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-toggle__thumb {
1140
- display: flex;
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-toggle-thumb);
1144
- height: var(--leaf-toggle-thumb);
1145
- border-radius: 100px;
1146
- background-color: var(--text-secondary);
1147
- transform: translateX(0);
1148
- transition:
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-toggle__check {
1154
- display: none;
1155
- width: 60%;
1156
- height: 60%;
1157
- color: var(--system-green);
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
- /* Status On + Active — track xanh, thumb trắng, trượt phải. */
1161
- .leaf-toggle[aria-checked="true"]:not(:disabled) {
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
- .leaf-toggle[aria-checked="true"]:not(:disabled) .leaf-toggle__thumb {
1166
- background-color: var(--icon-on-color);
1167
- transform: translateX(var(--leaf-toggle-travel));
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
- /* Status On + Active Off (disabled on) — track quaternary, thumb tertiary, vẫn bên phải. */
1171
- .leaf-toggle[aria-checked="true"]:disabled .leaf-toggle__thumb {
1172
- background-color: var(--text-tertiary);
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
- /* Status Off + Active Off — thumb tertiary, bên trái. */
1177
- .leaf-toggle:disabled:not([aria-checked="true"]) .leaf-toggle__thumb {
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
- /* Size S */
1182
- .leaf-toggle[data-size="sm"] {
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
- /* Checkmark chỉ ở S · On · Active. */
1189
- .leaf-toggle[data-size="sm"][aria-checked="true"]:not(:disabled) .leaf-toggle__check {
1190
- display: block;
1172
+ .leaf-input-date__popover[data-align="start"] {
1173
+ left: 0;
1191
1174
  }
1192
1175
 
1193
- .leaf-toggle:disabled {
1194
- cursor: not-allowed;
1176
+ .leaf-input-date__popover[data-align="end"] {
1177
+ right: 0;
1195
1178
  }
1196
1179
 
1197
- .leaf-toggle:focus-visible {
1198
- outline: 2px solid var(--system-green);
1199
- outline-offset: 2px;
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/Tooltip/tooltip.css --- */
1190
+ /* --- src/components/Input/input-otp.css --- */
1204
1191
 
1205
1192
  /*
1206
- * Tooltip — Figma 891:4983.
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
- * Caret Figma: khung hit-area rộng (40×4 / 44×6 / 16×4) nhưng tam giác thật
1212
- * chỉ 8×4 (sm) hoặc 12×6 (md/lg) nằm giữa khung — không vẽ full-width.
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-tooltip-trigger {
1217
- position: relative;
1218
- display: inline-flex;
1219
- max-width: 100%;
1220
- vertical-align: middle;
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-tooltip {
1224
- --leaf-tooltip-pad-y: 8px;
1225
- --leaf-tooltip-pad-x: 16px;
1226
- --leaf-tooltip-radius: 8px;
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
- display: inline-flex;
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
- font-family: var(--font-sans);
1243
- font-size: var(--leaf-tooltip-font-size);
1244
- line-height: var(--leaf-tooltip-line-height);
1245
- font-weight: var(--leaf-tooltip-font-weight);
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
- pointer-events: none;
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-tooltip--portal {
1251
- position: fixed;
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
- /* `display` của .leaf-tooltip thắng `[hidden]` của trình duyệt — bản vanilla ẩn bubble bằng hidden. */
1256
- .leaf-tooltip-trigger[hidden],
1257
- .leaf-tooltip[hidden] {
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
- .leaf-tooltip__body {
1262
- position: relative;
1263
- z-index: 1;
1264
- box-sizing: border-box;
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
- * Caret = khung trong suốt + ::before là tam giác nhỏ ở giữa (đúng SVG Figma).
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-tooltip__caret::before {
1287
- content: "";
1288
- position: absolute;
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
- /* ── Size ────────────────────────────────────────────────────────────── */
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-tooltip[data-size="sm"] {
1301
- --leaf-tooltip-pad-y: 2px;
1302
- --leaf-tooltip-pad-x: 16px;
1303
- --leaf-tooltip-radius: 4px;
1304
- --leaf-tooltip-max-width: 208px;
1305
- --leaf-tooltip-font-size: var(--body-5-size);
1306
- --leaf-tooltip-line-height: var(--body-5-line-height);
1307
- --leaf-tooltip-font-weight: var(--body-5-weight);
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-tooltip[data-size="lg"] {
1315
- --leaf-tooltip-pad-y: 16px;
1316
- --leaf-tooltip-pad-x: 16px;
1317
- --leaf-tooltip-radius: 12px;
1318
- --leaf-tooltip-max-width: 288px;
1319
- --leaf-tooltip-font-size: var(--body-3-size);
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
- /* Sm left/right: khung caret 16×4 (Figma), không dùng 40×4 của top/bottom. */
1328
- .leaf-tooltip[data-size="sm"][data-position="left"],
1329
- .leaf-tooltip[data-size="sm"][data-position="right"] {
1330
- --leaf-tooltip-caret-w: 16px;
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
- /* ── Position ────────────────────────────────────────────────────────── */
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
- * Vị trí caret theo data-position (không theo thứ tự DOM): markup vẫn đặt caret
1337
- * đúng phía nên kết quả không đổi, nhưng khi bubble tự lật phía (thiếu chỗ) thì
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-tooltip:is([data-position="bottom"], [data-position="right"]) > .leaf-tooltip__caret {
1346
- order: -1;
1365
+ .leaf-input-stepper__unit {
1366
+ color: var(--leaf-input-stepper-fg);
1347
1367
  }
1348
1368
 
1349
- .leaf-tooltip[data-position="bottom"] {
1350
- flex-direction: column;
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-tooltip[data-position="bottom"] .leaf-tooltip__caret::before {
1354
- clip-path: polygon(50% 0, 0 100%, 100% 100%);
1387
+ .leaf-input-stepper__button > svg {
1388
+ display: block;
1389
+ width: 1em;
1390
+ height: 1em;
1355
1391
  }
1356
1392
 
1357
- .leaf-tooltip[data-position="left"] {
1358
- flex-direction: row;
1359
- align-items: center;
1393
+ .leaf-input-stepper__button:disabled {
1394
+ cursor: not-allowed;
1360
1395
  }
1361
1396
 
1362
- .leaf-tooltip[data-position="left"] .leaf-tooltip__caret {
1363
- width: var(--leaf-tooltip-caret-h);
1364
- height: var(--leaf-tooltip-caret-w);
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-tooltip[data-position="left"] .leaf-tooltip__caret::before {
1368
- top: 50%;
1369
- left: 0;
1370
- width: 100%;
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-tooltip[data-position="right"] {
1377
- flex-direction: row;
1378
- align-items: center;
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
- .leaf-tooltip[data-position="right"] .leaf-tooltip__caret {
1382
- width: var(--leaf-tooltip-caret-h);
1383
- height: var(--leaf-tooltip-caret-w);
1384
- }
1416
+ /* ── State ───────────────────────────────────────────────────────────── */
1385
1417
 
1386
- .leaf-tooltip[data-position="right"] .leaf-tooltip__caret::before {
1387
- top: 50%;
1388
- left: 0;
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
- /* ── Align (caret trên Top/Bottom) ───────────────────────────────────── */
1396
-
1397
- .leaf-tooltip[data-position="top"][data-align="start"],
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-tooltip[data-position="top"][data-align="end"],
1403
- .leaf-tooltip[data-position="bottom"][data-align="end"] {
1404
- align-items: flex-end;
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-tooltip[data-position="top"][data-align="center"],
1408
- .leaf-tooltip[data-position="bottom"][data-align="center"] {
1409
- align-items: center;
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/styles/border.css --- */
1441
+ /* --- src/components/Input/input.css --- */
1414
1442
 
1415
1443
  /*
1416
- * Border radius classes — map 1:1 sang --radius-* trong @finhay/leaf-tokens
1417
- * (Figma 700:4390).
1444
+ * Input — Figma 1146:2159 (String / CTA) + search / date trigger.
1418
1445
  *
1419
- * Tên class `radius-*` (không dùng `rounded-*`) để không đụng utility bo góc mặc
1420
- * định của Tailwind (`rounded-xl`…). `border-*` đã dành cho màu viền.
1421
- *
1422
- * Hậu tố = bậc token: 0 · xs · s · m · l · xl · 2xl.
1423
- * Chỉ set border-radius — width / style / color do app tự lo.
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 utilities {
1427
- .radius-0 {
1428
- border-radius: var(--radius-0);
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
- .radius-xs {
1432
- border-radius: var(--radius-xs);
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
- .radius-s {
1436
- border-radius: var(--radius-s);
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
- .radius-m {
1440
- border-radius: var(--radius-m);
1496
+ .leaf-input__main {
1497
+ display: flex;
1498
+ align-items: center;
1499
+ gap: 8px;
1441
1500
  }
1442
1501
 
1443
- .radius-l {
1444
- border-radius: var(--radius-l);
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
- .radius-xl {
1448
- border-radius: var(--radius-xl);
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
- .radius-2xl {
1452
- border-radius: var(--radius-2xl);
1527
+ .leaf-input__control::placeholder,
1528
+ .leaf-input__placeholder {
1529
+ color: var(--leaf-input-placeholder);
1530
+ opacity: 1;
1453
1531
  }
1454
- }
1455
1532
 
1456
- /* --- src/styles/color.css --- */
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
- * Color classes — map 1:1 sang semantic token trong @finhay/leaf-tokens.
1460
- *
1461
- * Quy tắc tên: **tiền tố nói thuộc tính, phần sau nói vai trò của token**.
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
- @layer utilities {
1494
- /* Text color — content */
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
- .text-highlight {
1497
- color: var(--text-highlight);
1559
+ .leaf-input__icon > svg,
1560
+ .leaf-input__reveal > svg {
1561
+ display: block;
1562
+ width: 1em;
1563
+ height: 1em;
1498
1564
  }
1499
1565
 
1500
- .text-primary {
1501
- color: var(--text-primary);
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
- .text-secondary {
1505
- color: var(--text-secondary);
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
- .text-tertiary {
1509
- color: var(--text-tertiary);
1581
+ .leaf-input__action {
1582
+ display: inline-flex;
1583
+ flex-shrink: 0;
1584
+ align-items: center;
1510
1585
  }
1511
1586
 
1512
- .text-quaternary {
1513
- color: var(--text-quaternary);
1587
+ .leaf-input__message {
1588
+ margin: 0;
1589
+ padding-left: 12px;
1590
+ color: var(--leaf-input-message);
1514
1591
  }
1515
1592
 
1516
- /* Text color — system */
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
- .text-blue {
1519
- color: var(--system-blue);
1603
+ /* ── State ───────────────────────────────────────────────────────────── */
1604
+
1605
+ .leaf-input[data-filled="true"] {
1606
+ --leaf-input-label: var(--text-primary);
1520
1607
  }
1521
1608
 
1522
- .text-green {
1523
- color: var(--system-green);
1609
+ .leaf-input:focus-within {
1610
+ --leaf-input-border: var(--text-highlight);
1611
+ --leaf-input-label: var(--text-highlight);
1524
1612
  }
1525
1613
 
1526
- .text-yellow {
1527
- color: var(--system-yellow);
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
- .text-orange {
1531
- color: var(--system-orange);
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
- .text-red {
1535
- color: var(--system-red);
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
- .text-purple {
1539
- color: var(--system-purple);
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
- .text-blue-secondary {
1543
- color: var(--system-blue-secondary);
1643
+ .leaf-input[data-variant="inline"]:focus-within {
1644
+ --leaf-input-border: var(--text-highlight);
1544
1645
  }
1545
1646
 
1546
- .text-green-secondary {
1547
- color: var(--system-green-secondary);
1647
+ .leaf-input[data-variant="inline"][data-invalid="true"] {
1648
+ --leaf-input-border: var(--system-red);
1548
1649
  }
1549
1650
 
1550
- .text-yellow-secondary {
1551
- color: var(--system-yellow-secondary);
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
- .text-orange-secondary {
1555
- color: var(--system-orange-secondary);
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
- .text-red-secondary {
1559
- color: var(--system-red-secondary);
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
- .text-purple-secondary {
1563
- color: var(--system-purple-secondary);
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
- /* Background — base */
1707
+ /* --- src/components/Radio/radio.css --- */
1567
1708
 
1568
- .base-highlight {
1569
- background-color: var(--text-highlight);
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
- .base-primary {
1573
- background-color: var(--base-primary);
1732
+ .leaf-radio[data-size="sm"] {
1733
+ --leaf-radio-size: 18px;
1574
1734
  }
1575
1735
 
1576
- .base-secondary {
1577
- background-color: var(--base-secondary);
1736
+ .leaf-radio[data-size="lg"] {
1737
+ --leaf-radio-size: 30px;
1578
1738
  }
1579
1739
 
1580
- .base-tertiary {
1581
- background-color: var(--base-tertiary);
1740
+ .leaf-radio[hidden],
1741
+ .leaf-radio__control[hidden] {
1742
+ display: none;
1582
1743
  }
1583
1744
 
1584
- .base-quaternary {
1585
- background-color: var(--base-quaternary);
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
- .base-quinary {
1589
- background-color: var(--base-quinary);
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
- /* Background — system */
1593
-
1594
- .base-blue {
1595
- background-color: var(--system-blue);
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
- .base-green {
1599
- background-color: var(--system-green);
1782
+ .leaf-radio__label {
1783
+ color: var(--text-primary);
1600
1784
  }
1601
1785
 
1602
- .base-yellow {
1603
- background-color: var(--system-yellow);
1786
+ /* Selected */
1787
+ .leaf-radio__input:checked + .leaf-radio__control {
1788
+ --leaf-radio-color: var(--text-highlight);
1604
1789
  }
1605
1790
 
1606
- .base-orange {
1607
- background-color: var(--system-orange);
1791
+ .leaf-radio__input:checked + .leaf-radio__control .leaf-radio__dot {
1792
+ transform: scale(1);
1608
1793
  }
1609
1794
 
1610
- .base-red {
1611
- background-color: var(--system-red);
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
- .base-purple {
1615
- background-color: var(--system-purple);
1800
+ .leaf-radio__input:disabled ~ .leaf-radio__label {
1801
+ color: var(--text-tertiary);
1616
1802
  }
1617
1803
 
1618
- .base-blue-secondary {
1619
- background-color: var(--system-blue-secondary);
1804
+ .leaf-radio:has(.leaf-radio__input:disabled) {
1805
+ cursor: not-allowed;
1620
1806
  }
1621
1807
 
1622
- .base-green-secondary {
1623
- background-color: var(--system-green-secondary);
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
- .base-yellow-secondary {
1627
- background-color: var(--system-yellow-secondary);
1813
+ .leaf-radio-group {
1814
+ display: flex;
1815
+ flex-direction: column;
1816
+ gap: 12px;
1628
1817
  }
1629
1818
 
1630
- .base-orange-secondary {
1631
- background-color: var(--system-orange-secondary);
1819
+ .leaf-radio-group[data-orientation="horizontal"] {
1820
+ flex-direction: row;
1821
+ flex-wrap: wrap;
1632
1822
  }
1633
1823
 
1634
- .base-red-secondary {
1635
- background-color: var(--system-red-secondary);
1824
+ .leaf-radio-group[hidden] {
1825
+ display: none;
1636
1826
  }
1827
+ }
1637
1828
 
1638
- .base-purple-secondary {
1639
- background-color: var(--system-purple-secondary);
1640
- }
1829
+ /* --- src/components/Skeleton/skeleton.css --- */
1641
1830
 
1642
- /* Border color — base */
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
- .border-highlight {
1645
- border-color: var(--text-highlight);
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
- .border-primary {
1649
- border-color: var(--base-primary);
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
- .border-secondary {
1653
- border-color: var(--base-secondary);
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
- .border-tertiary {
1657
- border-color: var(--base-tertiary);
1867
+ @keyframes leaf-skeleton-shimmer {
1868
+ 0% {
1869
+ transform: translateX(-100%);
1658
1870
  }
1659
-
1660
- .border-quaternary {
1661
- border-color: var(--base-quaternary);
1871
+ 100% {
1872
+ transform: translateX(100%);
1662
1873
  }
1874
+ }
1663
1875
 
1664
- .border-quinary {
1665
- border-color: var(--base-quinary);
1666
- }
1876
+ /* --- src/components/Slider/slider.css --- */
1667
1877
 
1668
- /* Border color — system */
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
- .border-blue {
1671
- border-color: var(--system-blue);
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
- .border-green {
1675
- border-color: var(--system-green);
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
- .border-yellow {
1679
- border-color: var(--system-yellow);
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
- .border-orange {
1683
- border-color: var(--system-orange);
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
- .border-red {
1687
- border-color: var(--system-red);
1938
+ .leaf-slider__title {
1939
+ min-width: 0;
1688
1940
  }
1689
1941
 
1690
- .border-purple {
1691
- border-color: var(--system-purple);
1942
+ .leaf-slider__unit {
1943
+ min-width: 0;
1944
+ text-align: right;
1692
1945
  }
1693
1946
 
1694
- .border-blue-secondary {
1695
- border-color: var(--system-blue-secondary);
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
- .border-green-secondary {
1699
- border-color: var(--system-green-secondary);
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
- .border-yellow-secondary {
1703
- border-color: var(--system-yellow-secondary);
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
- .border-orange-secondary {
1707
- border-color: var(--system-orange-secondary);
1973
+ .leaf-slider[data-dragging="true"] .leaf-slider__control {
1974
+ cursor: grabbing;
1708
1975
  }
1709
1976
 
1710
- .border-red-secondary {
1711
- border-color: var(--system-red-secondary);
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
- .border-purple-secondary {
1715
- border-color: var(--system-purple-secondary);
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
- /* --- src/styles/spacing.css --- */
1720
-
1721
- /*
1722
- * Spacing classes — map 1:1 sang --spacing-* trong @finhay/leaf-tokens (Figma 34:1034).
1723
- *
1724
- * Tiền tố = thuộc tính (giống color): p-* / m-* / gap-* (+ biến thể hướng).
1725
- * Hậu tố = bậc token: 0 · xs · s · m · l · xl · 2xl … 7xl.
1726
- *
1727
- * Chỉ set đúng 1 thuộc tính spacing — không đụng width/height/radius.
1728
- * Nằm trong @layer utilities để Leaf thắng khi trùng tên với utility Tailwind
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
- @layer utilities {
1733
- /* Padding */
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
- .p-0 {
1736
- padding: var(--spacing-0);
2029
+ .leaf-slider__mark[data-state="passed"] {
2030
+ background-color: var(--text-primary);
1737
2031
  }
1738
2032
 
1739
- .p-xs {
1740
- padding: var(--spacing-xs);
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
- .p-s {
1744
- padding: var(--spacing-s);
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
- .p-m {
1748
- padding: var(--spacing-m);
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
- .p-l {
1752
- padding: var(--spacing-l);
2058
+ .leaf-slider:not([data-at-min="true"]) .leaf-slider__thumb {
2059
+ background-color: var(--leaf-slider-active);
1753
2060
  }
1754
2061
 
1755
- .p-xl {
1756
- padding: var(--spacing-xl);
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
- .p-2xl {
1760
- padding: var(--spacing-2xl);
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
- .p-3xl {
1764
- padding: var(--spacing-3xl);
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
- .p-4xl {
1768
- padding: var(--spacing-4xl);
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
- .p-5xl {
1772
- padding: var(--spacing-5xl);
2099
+ .leaf-slider__label[data-active="true"] {
2100
+ color: var(--text-primary);
1773
2101
  }
1774
2102
 
1775
- .p-6xl {
1776
- padding: var(--spacing-6xl);
2103
+ .leaf-slider__label:disabled {
2104
+ cursor: not-allowed;
1777
2105
  }
1778
2106
 
1779
- .p-7xl {
1780
- padding: var(--spacing-7xl);
2107
+ .leaf-slider[data-disabled="true"] {
2108
+ opacity: 0.5;
2109
+ pointer-events: none;
1781
2110
  }
1782
2111
 
1783
- .px-0 {
1784
- padding-inline: var(--spacing-0);
2112
+ .leaf-slider[data-disabled="true"] .leaf-slider__control {
2113
+ touch-action: auto;
1785
2114
  }
1786
2115
 
1787
- .px-xs {
1788
- padding-inline: var(--spacing-xs);
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
- .px-s {
1792
- padding-inline: var(--spacing-s);
1793
- }
2123
+ /* --- src/components/Spinner/spinner.css --- */
1794
2124
 
1795
- .px-m {
1796
- padding-inline: var(--spacing-m);
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
- .px-l {
1800
- padding-inline: var(--spacing-l);
1801
- }
2133
+ @layer components {
2134
+ .leaf-spinner {
2135
+ --leaf-spinner-size: 24px;
2136
+ --leaf-spinner-duration: 1.2s;
1802
2137
 
1803
- .px-xl {
1804
- padding-inline: var(--spacing-xl);
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
- .px-2xl {
1808
- padding-inline: var(--spacing-2xl);
2149
+ .leaf-spinner__icon {
2150
+ display: block;
2151
+ width: 100%;
2152
+ height: 100%;
1809
2153
  }
1810
2154
 
1811
- .px-3xl {
1812
- padding-inline: var(--spacing-3xl);
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
- .px-4xl {
1816
- padding-inline: var(--spacing-4xl);
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
- .px-5xl {
1820
- padding-inline: var(--spacing-5xl);
1821
- }
2174
+ /* ── Size ────────────────────────────────────────────────────────────── */
1822
2175
 
1823
- .px-6xl {
1824
- padding-inline: var(--spacing-6xl);
2176
+ .leaf-spinner[data-size="lg"] {
2177
+ --leaf-spinner-size: 30px;
1825
2178
  }
1826
2179
 
1827
- .px-7xl {
1828
- padding-inline: var(--spacing-7xl);
2180
+ .leaf-spinner[data-size="sm"] {
2181
+ --leaf-spinner-size: 20px;
1829
2182
  }
1830
2183
 
1831
- .py-0 {
1832
- padding-block: var(--spacing-0);
1833
- }
2184
+ /* ── Animations ──────────────────────────────────────────────────────── */
1834
2185
 
1835
- .py-xs {
1836
- padding-block: var(--spacing-xs);
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
- .py-s {
1840
- padding-block: var(--spacing-s);
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
- .py-m {
1844
- padding-block: var(--spacing-m);
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
- .py-l {
1848
- padding-block: var(--spacing-l);
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
- .py-xl {
1852
- padding-block: var(--spacing-xl);
2212
+ @keyframes leaf-spinner-spin {
2213
+ to {
2214
+ transform: rotate(360deg);
1853
2215
  }
2216
+ }
1854
2217
 
1855
- .py-2xl {
1856
- padding-block: var(--spacing-2xl);
2218
+ @keyframes leaf-spinner-pulse {
2219
+ 0%,
2220
+ 100% {
2221
+ transform: scale(0.85);
1857
2222
  }
1858
-
1859
- .py-3xl {
1860
- padding-block: var(--spacing-3xl);
2223
+ 50% {
2224
+ transform: scale(1);
1861
2225
  }
2226
+ }
1862
2227
 
1863
- .py-4xl {
1864
- padding-block: var(--spacing-4xl);
2228
+ @keyframes leaf-spinner-breathe {
2229
+ 0%,
2230
+ 100% {
2231
+ opacity: 0.35;
1865
2232
  }
1866
-
1867
- .py-5xl {
1868
- padding-block: var(--spacing-5xl);
2233
+ 50% {
2234
+ opacity: 1;
1869
2235
  }
2236
+ }
1870
2237
 
1871
- .py-6xl {
1872
- padding-block: var(--spacing-6xl);
1873
- }
2238
+ /* --- src/components/Tabs/tabs.css --- */
1874
2239
 
1875
- .py-7xl {
1876
- padding-block: var(--spacing-7xl);
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
- .pt-0 {
1880
- padding-top: var(--spacing-0);
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
- .pt-xs {
1884
- padding-top: var(--spacing-xs);
2265
+ display: flex;
2266
+ flex-wrap: wrap;
2267
+ align-items: center;
2268
+ gap: 12px;
1885
2269
  }
1886
2270
 
1887
- .pt-s {
1888
- padding-top: var(--spacing-s);
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
- .pt-m {
1892
- padding-top: var(--spacing-m);
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
- .pt-l {
1896
- padding-top: var(--spacing-l);
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
- .pt-xl {
1900
- padding-top: var(--spacing-xl);
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
- .pt-2xl {
1904
- padding-top: var(--spacing-2xl);
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
- .pt-3xl {
1908
- padding-top: var(--spacing-3xl);
2320
+ .leaf-tab:disabled,
2321
+ .leaf-tab[aria-disabled="true"] {
2322
+ cursor: not-allowed;
1909
2323
  }
1910
2324
 
1911
- .pt-4xl {
1912
- padding-top: var(--spacing-4xl);
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
- .pt-5xl {
1916
- padding-top: var(--spacing-5xl);
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
- .pt-6xl {
1920
- padding-top: var(--spacing-6xl);
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
- .pt-7xl {
1924
- padding-top: var(--spacing-7xl);
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
- .pr-0 {
1928
- padding-right: var(--spacing-0);
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
- .pr-xs {
1932
- padding-right: var(--spacing-xs);
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
- .pr-s {
1936
- padding-right: var(--spacing-s);
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
- .pr-m {
1940
- padding-right: var(--spacing-m);
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
- .pr-l {
1944
- padding-right: var(--spacing-l);
1945
- }
2390
+ /* ── Title (underline) ───────────────────────────────────────────────── */
1946
2391
 
1947
- .pr-xl {
1948
- padding-right: var(--spacing-xl);
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
- .pr-2xl {
1952
- padding-right: var(--spacing-2xl);
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
- .pr-3xl {
1956
- padding-right: var(--spacing-3xl);
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
- .pr-4xl {
1960
- padding-right: var(--spacing-4xl);
2416
+ .leaf-tabs[data-variant="title"] .leaf-tab[aria-selected="true"]::after {
2417
+ opacity: 1;
1961
2418
  }
1962
2419
 
1963
- .pr-5xl {
1964
- padding-right: var(--spacing-5xl);
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
- .pr-6xl {
1968
- padding-right: var(--spacing-6xl);
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
- .pr-7xl {
1972
- padding-right: var(--spacing-7xl);
1973
- }
2430
+ /* ── Functional ──────────────────────────────────────────────────────── */
1974
2431
 
1975
- .pb-0 {
1976
- padding-bottom: var(--spacing-0);
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
- .pb-xs {
1980
- padding-bottom: var(--spacing-xs);
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
- .pb-s {
1984
- padding-bottom: var(--spacing-s);
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
- .pb-m {
1988
- padding-bottom: var(--spacing-m);
1989
- }
2455
+ /* ── Buy / Sell ──────────────────────────────────────────────────────── */
1990
2456
 
1991
- .pb-l {
1992
- padding-bottom: var(--spacing-l);
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
- .pb-xl {
1996
- padding-bottom: var(--spacing-xl);
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
- .pb-2xl {
2000
- padding-bottom: var(--spacing-2xl);
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
- .pb-3xl {
2004
- padding-bottom: var(--spacing-3xl);
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
- .pb-4xl {
2008
- padding-bottom: var(--spacing-4xl);
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
- .pb-5xl {
2012
- padding-bottom: var(--spacing-5xl);
2013
- }
2489
+ /* --- src/components/Toast/toast.css --- */
2014
2490
 
2015
- .pb-6xl {
2016
- padding-bottom: var(--spacing-6xl);
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
- .pb-7xl {
2020
- padding-bottom: var(--spacing-7xl);
2021
- }
2503
+ @layer components {
2504
+ .leaf-toaster {
2505
+ --leaf-toast-enter-x: 24px;
2506
+ --leaf-toast-enter-y: 0px;
2022
2507
 
2023
- .pl-0 {
2024
- padding-left: var(--spacing-0);
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
- .pl-xs {
2028
- padding-left: var(--spacing-xs);
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
- .pl-s {
2032
- padding-left: var(--spacing-s);
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
- .pl-m {
2036
- padding-left: var(--spacing-m);
2540
+ .leaf-toaster[data-position^="bottom"] {
2541
+ top: auto;
2542
+ bottom: 16px;
2037
2543
  }
2038
2544
 
2039
- .pl-l {
2040
- padding-left: var(--spacing-l);
2545
+ .leaf-toaster[data-position="bottom-center"] {
2546
+ --leaf-toast-enter-y: 12px;
2041
2547
  }
2042
2548
 
2043
- .pl-xl {
2044
- padding-left: var(--spacing-xl);
2549
+ .leaf-toaster > .leaf-toast {
2550
+ pointer-events: auto;
2045
2551
  }
2046
2552
 
2047
- .pl-2xl {
2048
- padding-left: var(--spacing-2xl);
2049
- }
2553
+ .leaf-toast {
2554
+ --leaf-toast-accent: var(--text-highlight);
2555
+ --leaf-toast-surface: var(--system-green-secondary);
2050
2556
 
2051
- .pl-3xl {
2052
- padding-left: var(--spacing-3xl);
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
- .pl-4xl {
2056
- padding-left: var(--spacing-4xl);
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
- .pl-5xl {
2060
- padding-left: var(--spacing-5xl);
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
- .pl-6xl {
2064
- padding-left: var(--spacing-6xl);
2586
+ .leaf-toast[data-state="closing"] {
2587
+ animation: leaf-toast-out 300ms ease-in forwards;
2588
+ pointer-events: none;
2065
2589
  }
2066
2590
 
2067
- .pl-7xl {
2068
- padding-left: var(--spacing-7xl);
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
- /* Margin */
2072
-
2073
- .m-0 {
2074
- margin: var(--spacing-0);
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
- .m-xs {
2078
- margin: var(--spacing-xs);
2613
+ .leaf-toast__glyph {
2614
+ display: block;
2615
+ width: 14px;
2616
+ height: 14px;
2079
2617
  }
2080
2618
 
2081
- .m-s {
2082
- margin: var(--spacing-s);
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
- .m-m {
2086
- margin: var(--spacing-m);
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
- .m-l {
2090
- margin: var(--spacing-l);
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
- .m-xl {
2094
- margin: var(--spacing-xl);
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
- .m-2xl {
2098
- margin: var(--spacing-2xl);
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
- .m-3xl {
2102
- margin: var(--spacing-3xl);
2661
+ .leaf-toast__close:focus-visible {
2662
+ outline: 2px solid var(--leaf-toast-accent);
2663
+ outline-offset: 2px;
2103
2664
  }
2104
2665
 
2105
- .m-4xl {
2106
- margin: var(--spacing-4xl);
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
- .m-5xl {
2110
- margin: var(--spacing-5xl);
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
- .m-6xl {
2114
- margin: var(--spacing-6xl);
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
- .m-7xl {
2118
- margin: var(--spacing-7xl);
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
- .mx-0 {
2122
- margin-inline: var(--spacing-0);
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
- .mx-xs {
2126
- margin-inline: var(--spacing-xs);
2702
+ @keyframes leaf-toast-progress {
2703
+ from {
2704
+ transform: scaleX(1);
2705
+ }
2706
+ to {
2707
+ transform: scaleX(0);
2708
+ }
2127
2709
  }
2128
2710
 
2129
- .mx-s {
2130
- margin-inline: var(--spacing-s);
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
- .mx-m {
2134
- margin-inline: var(--spacing-m);
2135
- }
2721
+ /* --- src/components/Toggle/toggle.css --- */
2136
2722
 
2137
- .mx-l {
2138
- margin-inline: var(--spacing-l);
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
- .mx-xl {
2142
- margin-inline: var(--spacing-xl);
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
- .mx-2xl {
2146
- margin-inline: var(--spacing-2xl);
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
- .mx-3xl {
2150
- margin-inline: var(--spacing-3xl);
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
- .mx-4xl {
2154
- margin-inline: var(--spacing-4xl);
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
- .mx-5xl {
2158
- margin-inline: var(--spacing-5xl);
2782
+ .leaf-toggle__check {
2783
+ display: none;
2784
+ width: 60%;
2785
+ height: 60%;
2786
+ color: var(--system-green);
2159
2787
  }
2160
2788
 
2161
- .mx-6xl {
2162
- margin-inline: var(--spacing-6xl);
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
- .mx-7xl {
2166
- margin-inline: var(--spacing-7xl);
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
- .my-0 {
2170
- margin-block: var(--spacing-0);
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
- .my-xs {
2174
- margin-block: var(--spacing-xs);
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
- .my-s {
2178
- margin-block: var(--spacing-s);
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
- .my-m {
2182
- margin-block: var(--spacing-m);
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
- .my-l {
2186
- margin-block: var(--spacing-l);
2822
+ .leaf-toggle:disabled {
2823
+ cursor: not-allowed;
2187
2824
  }
2188
2825
 
2189
- .my-xl {
2190
- margin-block: var(--spacing-xl);
2826
+ .leaf-toggle:focus-visible {
2827
+ outline: 2px solid var(--system-green);
2828
+ outline-offset: 2px;
2191
2829
  }
2830
+ }
2192
2831
 
2193
- .my-2xl {
2194
- margin-block: var(--spacing-2xl);
2195
- }
2832
+ /* --- src/components/Tooltip/tooltip.css --- */
2196
2833
 
2197
- .my-3xl {
2198
- margin-block: var(--spacing-3xl);
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
- .my-4xl {
2202
- margin-block: var(--spacing-4xl);
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
- .my-5xl {
2206
- margin-block: var(--spacing-5xl);
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
- .my-6xl {
2210
- margin-block: var(--spacing-6xl);
2872
+ .leaf-tooltip-trigger {
2873
+ position: relative;
2874
+ display: inline-flex;
2875
+ max-width: 100%;
2876
+ vertical-align: middle;
2211
2877
  }
2212
2878
 
2213
- .my-7xl {
2214
- margin-block: var(--spacing-7xl);
2879
+ .leaf-tooltip--portal {
2880
+ position: fixed;
2881
+ z-index: var(--leaf-z-tooltip, 110);
2215
2882
  }
2216
2883
 
2217
- .mt-0 {
2218
- margin-top: var(--spacing-0);
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
- .mt-xs {
2222
- margin-top: var(--spacing-xs);
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
- .mt-s {
2226
- margin-top: var(--spacing-s);
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
- .mt-m {
2230
- margin-top: var(--spacing-m);
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
- .mt-l {
2234
- margin-top: var(--spacing-l);
2235
- }
2928
+ /* ── Size ────────────────────────────────────────────────────────────── */
2236
2929
 
2237
- .mt-xl {
2238
- margin-top: var(--spacing-xl);
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
- .mt-2xl {
2242
- margin-top: var(--spacing-2xl);
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
- .mt-3xl {
2246
- margin-top: var(--spacing-3xl);
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
- .mt-4xl {
2250
- margin-top: var(--spacing-4xl);
2251
- }
2963
+ /* ── Position ────────────────────────────────────────────────────────── */
2252
2964
 
2253
- .mt-5xl {
2254
- margin-top: var(--spacing-5xl);
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
- .mt-6xl {
2258
- margin-top: var(--spacing-6xl);
2975
+ .leaf-tooltip:is([data-position="bottom"], [data-position="right"]) > .leaf-tooltip__caret {
2976
+ order: -1;
2259
2977
  }
2260
2978
 
2261
- .mt-7xl {
2262
- margin-top: var(--spacing-7xl);
2979
+ .leaf-tooltip[data-position="bottom"] {
2980
+ flex-direction: column;
2263
2981
  }
2264
2982
 
2265
- .mr-0 {
2266
- margin-right: var(--spacing-0);
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
- .mr-xs {
2270
- margin-right: var(--spacing-xs);
2987
+ .leaf-tooltip[data-position="left"] {
2988
+ flex-direction: row;
2989
+ align-items: center;
2271
2990
  }
2272
2991
 
2273
- .mr-s {
2274
- margin-right: var(--spacing-s);
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
- .mr-m {
2278
- margin-right: var(--spacing-m);
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
- .mr-l {
2282
- margin-right: var(--spacing-l);
3006
+ .leaf-tooltip[data-position="right"] {
3007
+ flex-direction: row;
3008
+ align-items: center;
2283
3009
  }
2284
3010
 
2285
- .mr-xl {
2286
- margin-right: var(--spacing-xl);
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
- .mr-2xl {
2290
- margin-right: var(--spacing-2xl);
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
- .mr-3xl {
2294
- margin-right: var(--spacing-3xl);
2295
- }
3025
+ /* ── Align (caret trên Top/Bottom) ───────────────────────────────────── */
2296
3026
 
2297
- .mr-4xl {
2298
- margin-right: var(--spacing-4xl);
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
- .mr-5xl {
2302
- margin-right: var(--spacing-5xl);
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
- .mr-6xl {
2306
- margin-right: var(--spacing-6xl);
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
- .mr-7xl {
2310
- margin-right: var(--spacing-7xl);
2311
- }
3043
+ /* --- src/styles/color.css --- */
2312
3044
 
2313
- .mb-0 {
2314
- margin-bottom: var(--spacing-0);
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
- .mb-xs {
2318
- margin-bottom: var(--spacing-xs);
2319
- }
3075
+ @layer utilities {
3076
+ /* Text color — content */
2320
3077
 
2321
- .mb-s {
2322
- margin-bottom: var(--spacing-s);
3078
+ .text-highlight {
3079
+ color: var(--text-highlight);
2323
3080
  }
2324
3081
 
2325
- .mb-m {
2326
- margin-bottom: var(--spacing-m);
3082
+ .text-primary {
3083
+ color: var(--text-primary);
2327
3084
  }
2328
3085
 
2329
- .mb-l {
2330
- margin-bottom: var(--spacing-l);
3086
+ .text-secondary {
3087
+ color: var(--text-secondary);
2331
3088
  }
2332
3089
 
2333
- .mb-xl {
2334
- margin-bottom: var(--spacing-xl);
3090
+ .text-tertiary {
3091
+ color: var(--text-tertiary);
2335
3092
  }
2336
3093
 
2337
- .mb-2xl {
2338
- margin-bottom: var(--spacing-2xl);
3094
+ .text-quaternary {
3095
+ color: var(--text-quaternary);
2339
3096
  }
2340
3097
 
2341
- .mb-3xl {
2342
- margin-bottom: var(--spacing-3xl);
2343
- }
3098
+ /* Text color — system */
2344
3099
 
2345
- .mb-4xl {
2346
- margin-bottom: var(--spacing-4xl);
3100
+ .text-blue {
3101
+ color: var(--system-blue);
2347
3102
  }
2348
3103
 
2349
- .mb-5xl {
2350
- margin-bottom: var(--spacing-5xl);
3104
+ .text-green {
3105
+ color: var(--system-green);
2351
3106
  }
2352
3107
 
2353
- .mb-6xl {
2354
- margin-bottom: var(--spacing-6xl);
3108
+ .text-yellow {
3109
+ color: var(--system-yellow);
2355
3110
  }
2356
3111
 
2357
- .mb-7xl {
2358
- margin-bottom: var(--spacing-7xl);
3112
+ .text-orange {
3113
+ color: var(--system-orange);
2359
3114
  }
2360
3115
 
2361
- .ml-0 {
2362
- margin-left: var(--spacing-0);
3116
+ .text-red {
3117
+ color: var(--system-red);
2363
3118
  }
2364
3119
 
2365
- .ml-xs {
2366
- margin-left: var(--spacing-xs);
3120
+ .text-purple {
3121
+ color: var(--system-purple);
2367
3122
  }
2368
3123
 
2369
- .ml-s {
2370
- margin-left: var(--spacing-s);
3124
+ .text-blue-secondary {
3125
+ color: var(--system-blue-secondary);
2371
3126
  }
2372
3127
 
2373
- .ml-m {
2374
- margin-left: var(--spacing-m);
3128
+ .text-green-secondary {
3129
+ color: var(--system-green-secondary);
2375
3130
  }
2376
3131
 
2377
- .ml-l {
2378
- margin-left: var(--spacing-l);
3132
+ .text-yellow-secondary {
3133
+ color: var(--system-yellow-secondary);
2379
3134
  }
2380
3135
 
2381
- .ml-xl {
2382
- margin-left: var(--spacing-xl);
3136
+ .text-orange-secondary {
3137
+ color: var(--system-orange-secondary);
2383
3138
  }
2384
3139
 
2385
- .ml-2xl {
2386
- margin-left: var(--spacing-2xl);
3140
+ .text-red-secondary {
3141
+ color: var(--system-red-secondary);
2387
3142
  }
2388
3143
 
2389
- .ml-3xl {
2390
- margin-left: var(--spacing-3xl);
3144
+ .text-purple-secondary {
3145
+ color: var(--system-purple-secondary);
2391
3146
  }
2392
3147
 
2393
- .ml-4xl {
2394
- margin-left: var(--spacing-4xl);
2395
- }
3148
+ /* Background — surface (--base-*) + system */
2396
3149
 
2397
- .ml-5xl {
2398
- margin-left: var(--spacing-5xl);
3150
+ .bg-highlight {
3151
+ background-color: var(--text-highlight);
2399
3152
  }
2400
3153
 
2401
- .ml-6xl {
2402
- margin-left: var(--spacing-6xl);
3154
+ .bg-primary {
3155
+ background-color: var(--base-primary);
2403
3156
  }
2404
3157
 
2405
- .ml-7xl {
2406
- margin-left: var(--spacing-7xl);
3158
+ .bg-secondary {
3159
+ background-color: var(--base-secondary);
2407
3160
  }
2408
3161
 
2409
- /* Gap */
2410
-
2411
- .gap-0 {
2412
- gap: var(--spacing-0);
3162
+ .bg-tertiary {
3163
+ background-color: var(--base-tertiary);
2413
3164
  }
2414
3165
 
2415
- .gap-xs {
2416
- gap: var(--spacing-xs);
3166
+ .bg-quaternary {
3167
+ background-color: var(--base-quaternary);
2417
3168
  }
2418
3169
 
2419
- .gap-s {
2420
- gap: var(--spacing-s);
3170
+ .bg-quinary {
3171
+ background-color: var(--base-quinary);
2421
3172
  }
2422
3173
 
2423
- .gap-m {
2424
- gap: var(--spacing-m);
2425
- }
3174
+ /* Background — system */
2426
3175
 
2427
- .gap-l {
2428
- gap: var(--spacing-l);
3176
+ .bg-blue {
3177
+ background-color: var(--system-blue);
2429
3178
  }
2430
3179
 
2431
- .gap-xl {
2432
- gap: var(--spacing-xl);
3180
+ .bg-green {
3181
+ background-color: var(--system-green);
2433
3182
  }
2434
3183
 
2435
- .gap-2xl {
2436
- gap: var(--spacing-2xl);
3184
+ .bg-yellow {
3185
+ background-color: var(--system-yellow);
2437
3186
  }
2438
3187
 
2439
- .gap-3xl {
2440
- gap: var(--spacing-3xl);
3188
+ .bg-orange {
3189
+ background-color: var(--system-orange);
2441
3190
  }
2442
3191
 
2443
- .gap-4xl {
2444
- gap: var(--spacing-4xl);
3192
+ .bg-red {
3193
+ background-color: var(--system-red);
2445
3194
  }
2446
3195
 
2447
- .gap-5xl {
2448
- gap: var(--spacing-5xl);
3196
+ .bg-purple {
3197
+ background-color: var(--system-purple);
2449
3198
  }
2450
3199
 
2451
- .gap-6xl {
2452
- gap: var(--spacing-6xl);
3200
+ .bg-blue-secondary {
3201
+ background-color: var(--system-blue-secondary);
2453
3202
  }
2454
3203
 
2455
- .gap-7xl {
2456
- gap: var(--spacing-7xl);
3204
+ .bg-green-secondary {
3205
+ background-color: var(--system-green-secondary);
2457
3206
  }
2458
3207
 
2459
- .gap-x-0 {
2460
- column-gap: var(--spacing-0);
3208
+ .bg-yellow-secondary {
3209
+ background-color: var(--system-yellow-secondary);
2461
3210
  }
2462
3211
 
2463
- .gap-x-xs {
2464
- column-gap: var(--spacing-xs);
3212
+ .bg-orange-secondary {
3213
+ background-color: var(--system-orange-secondary);
2465
3214
  }
2466
3215
 
2467
- .gap-x-s {
2468
- column-gap: var(--spacing-s);
3216
+ .bg-red-secondary {
3217
+ background-color: var(--system-red-secondary);
2469
3218
  }
2470
3219
 
2471
- .gap-x-m {
2472
- column-gap: var(--spacing-m);
3220
+ .bg-purple-secondary {
3221
+ background-color: var(--system-purple-secondary);
2473
3222
  }
2474
3223
 
2475
- .gap-x-l {
2476
- column-gap: var(--spacing-l);
2477
- }
3224
+ /* Border color — base */
2478
3225
 
2479
- .gap-x-xl {
2480
- column-gap: var(--spacing-xl);
3226
+ .border-highlight {
3227
+ border-color: var(--text-highlight);
2481
3228
  }
2482
3229
 
2483
- .gap-x-2xl {
2484
- column-gap: var(--spacing-2xl);
3230
+ .border-primary {
3231
+ border-color: var(--base-primary);
2485
3232
  }
2486
3233
 
2487
- .gap-x-3xl {
2488
- column-gap: var(--spacing-3xl);
3234
+ .border-secondary {
3235
+ border-color: var(--base-secondary);
2489
3236
  }
2490
3237
 
2491
- .gap-x-4xl {
2492
- column-gap: var(--spacing-4xl);
3238
+ .border-tertiary {
3239
+ border-color: var(--base-tertiary);
2493
3240
  }
2494
3241
 
2495
- .gap-x-5xl {
2496
- column-gap: var(--spacing-5xl);
3242
+ .border-quaternary {
3243
+ border-color: var(--base-quaternary);
2497
3244
  }
2498
3245
 
2499
- .gap-x-6xl {
2500
- column-gap: var(--spacing-6xl);
3246
+ .border-quinary {
3247
+ border-color: var(--base-quinary);
2501
3248
  }
2502
3249
 
2503
- .gap-x-7xl {
2504
- column-gap: var(--spacing-7xl);
2505
- }
3250
+ /* Border color — system */
2506
3251
 
2507
- .gap-y-0 {
2508
- row-gap: var(--spacing-0);
3252
+ .border-blue {
3253
+ border-color: var(--system-blue);
2509
3254
  }
2510
3255
 
2511
- .gap-y-xs {
2512
- row-gap: var(--spacing-xs);
3256
+ .border-green {
3257
+ border-color: var(--system-green);
2513
3258
  }
2514
3259
 
2515
- .gap-y-s {
2516
- row-gap: var(--spacing-s);
3260
+ .border-yellow {
3261
+ border-color: var(--system-yellow);
2517
3262
  }
2518
3263
 
2519
- .gap-y-m {
2520
- row-gap: var(--spacing-m);
3264
+ .border-orange {
3265
+ border-color: var(--system-orange);
2521
3266
  }
2522
3267
 
2523
- .gap-y-l {
2524
- row-gap: var(--spacing-l);
3268
+ .border-red {
3269
+ border-color: var(--system-red);
2525
3270
  }
2526
3271
 
2527
- .gap-y-xl {
2528
- row-gap: var(--spacing-xl);
3272
+ .border-purple {
3273
+ border-color: var(--system-purple);
2529
3274
  }
2530
3275
 
2531
- .gap-y-2xl {
2532
- row-gap: var(--spacing-2xl);
3276
+ .border-blue-secondary {
3277
+ border-color: var(--system-blue-secondary);
2533
3278
  }
2534
3279
 
2535
- .gap-y-3xl {
2536
- row-gap: var(--spacing-3xl);
3280
+ .border-green-secondary {
3281
+ border-color: var(--system-green-secondary);
2537
3282
  }
2538
3283
 
2539
- .gap-y-4xl {
2540
- row-gap: var(--spacing-4xl);
3284
+ .border-yellow-secondary {
3285
+ border-color: var(--system-yellow-secondary);
2541
3286
  }
2542
3287
 
2543
- .gap-y-5xl {
2544
- row-gap: var(--spacing-5xl);
3288
+ .border-orange-secondary {
3289
+ border-color: var(--system-orange-secondary);
2545
3290
  }
2546
3291
 
2547
- .gap-y-6xl {
2548
- row-gap: var(--spacing-6xl);
3292
+ .border-red-secondary {
3293
+ border-color: var(--system-red-secondary);
2549
3294
  }
2550
3295
 
2551
- .gap-y-7xl {
2552
- row-gap: var(--spacing-7xl);
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` để utility của Tailwind (`@layer
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 {