@finhay-pro/leaf-design-system 0.1.1 → 0.1.3

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 (142) hide show
  1. package/README.md +263 -92
  2. package/dist/border.css +44 -0
  3. package/dist/button.css +56 -25
  4. package/dist/cdn/leaf-0.1.3.min.css +2 -0
  5. package/dist/cdn/leaf-0.1.3.min.js +2 -0
  6. package/dist/classes.css +2168 -265
  7. package/dist/components/Button/Button.d.ts +20 -3
  8. package/dist/components/Button/Button.d.ts.map +1 -1
  9. package/dist/components/Button/Button.js +65 -2
  10. package/dist/components/Button/Button.js.map +1 -1
  11. package/dist/components/Dialog/Dialog.d.ts +62 -0
  12. package/dist/components/Dialog/Dialog.d.ts.map +1 -0
  13. package/dist/components/Dialog/Dialog.js +85 -0
  14. package/dist/components/Dialog/Dialog.js.map +1 -0
  15. package/dist/components/Dialog/index.d.ts +2 -0
  16. package/dist/components/Dialog/index.d.ts.map +1 -0
  17. package/dist/components/Dialog/index.js +2 -0
  18. package/dist/components/Dialog/index.js.map +1 -0
  19. package/dist/components/Logo/Logo.d.ts +29 -0
  20. package/dist/components/Logo/Logo.d.ts.map +1 -0
  21. package/dist/components/Logo/Logo.js +39 -0
  22. package/dist/components/Logo/Logo.js.map +1 -0
  23. package/dist/components/Logo/assets.d.ts +11 -0
  24. package/dist/components/Logo/assets.d.ts.map +1 -0
  25. package/dist/components/Logo/assets.js +35 -0
  26. package/dist/components/Logo/assets.js.map +1 -0
  27. package/dist/components/Logo/index.d.ts +2 -0
  28. package/dist/components/Logo/index.d.ts.map +1 -0
  29. package/dist/components/Logo/index.js +2 -0
  30. package/dist/components/Logo/index.js.map +1 -0
  31. package/dist/components/Skeleton/Skeleton.d.ts +16 -0
  32. package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
  33. package/dist/components/Skeleton/Skeleton.js +18 -0
  34. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  35. package/dist/components/Skeleton/index.d.ts +2 -0
  36. package/dist/components/Skeleton/index.d.ts.map +1 -0
  37. package/dist/components/Skeleton/index.js +2 -0
  38. package/dist/components/Skeleton/index.js.map +1 -0
  39. package/dist/components/Slider/Slider.d.ts +56 -0
  40. package/dist/components/Slider/Slider.d.ts.map +1 -0
  41. package/dist/components/Slider/Slider.js +184 -0
  42. package/dist/components/Slider/Slider.js.map +1 -0
  43. package/dist/components/Slider/index.d.ts +2 -0
  44. package/dist/components/Slider/index.d.ts.map +1 -0
  45. package/dist/components/Slider/index.js +2 -0
  46. package/dist/components/Slider/index.js.map +1 -0
  47. package/dist/components/Spinner/Spinner.d.ts +34 -0
  48. package/dist/components/Spinner/Spinner.d.ts.map +1 -0
  49. package/dist/components/Spinner/Spinner.js +37 -0
  50. package/dist/components/Spinner/Spinner.js.map +1 -0
  51. package/dist/components/Spinner/index.d.ts +2 -0
  52. package/dist/components/Spinner/index.d.ts.map +1 -0
  53. package/dist/components/Spinner/index.js +2 -0
  54. package/dist/components/Spinner/index.js.map +1 -0
  55. package/dist/components/Tabs/Tabs.d.ts +32 -20
  56. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  57. package/dist/components/Tabs/Tabs.js +53 -31
  58. package/dist/components/Tabs/Tabs.js.map +1 -1
  59. package/dist/components/Tabs/index.d.ts +1 -1
  60. package/dist/components/Tabs/index.d.ts.map +1 -1
  61. package/dist/components/Tabs/index.js +1 -1
  62. package/dist/components/Tabs/index.js.map +1 -1
  63. package/dist/components/Toggle/Toggle.d.ts +29 -0
  64. package/dist/components/Toggle/Toggle.d.ts.map +1 -0
  65. package/dist/components/Toggle/Toggle.js +29 -0
  66. package/dist/components/Toggle/Toggle.js.map +1 -0
  67. package/dist/components/Toggle/index.d.ts +2 -0
  68. package/dist/components/Toggle/index.d.ts.map +1 -0
  69. package/dist/components/Toggle/index.js +2 -0
  70. package/dist/components/Toggle/index.js.map +1 -0
  71. package/dist/components/Tooltip/Tooltip.d.ts +67 -0
  72. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
  73. package/dist/components/Tooltip/Tooltip.js +138 -0
  74. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  75. package/dist/components/Tooltip/index.d.ts +2 -0
  76. package/dist/components/Tooltip/index.d.ts.map +1 -0
  77. package/dist/components/Tooltip/index.js +2 -0
  78. package/dist/components/Tooltip/index.js.map +1 -0
  79. package/dist/core/dialog.d.ts +26 -0
  80. package/dist/core/dialog.d.ts.map +1 -0
  81. package/dist/core/dialog.js +124 -0
  82. package/dist/core/dialog.js.map +1 -0
  83. package/dist/core/focus.d.ts +8 -0
  84. package/dist/core/focus.d.ts.map +1 -0
  85. package/dist/core/focus.js +18 -0
  86. package/dist/core/focus.js.map +1 -0
  87. package/dist/core/slider.d.ts +35 -0
  88. package/dist/core/slider.d.ts.map +1 -0
  89. package/dist/core/slider.js +81 -0
  90. package/dist/core/slider.js.map +1 -0
  91. package/dist/core/spinner.d.ts +10 -0
  92. package/dist/core/spinner.d.ts.map +1 -0
  93. package/dist/core/spinner.js +13 -0
  94. package/dist/core/spinner.js.map +1 -0
  95. package/dist/core/tabs.d.ts +9 -0
  96. package/dist/core/tabs.d.ts.map +1 -0
  97. package/dist/core/tabs.js +30 -0
  98. package/dist/core/tabs.js.map +1 -0
  99. package/dist/core/tooltip.d.ts +33 -0
  100. package/dist/core/tooltip.d.ts.map +1 -0
  101. package/dist/core/tooltip.js +175 -0
  102. package/dist/core/tooltip.js.map +1 -0
  103. package/dist/dialog.css +157 -0
  104. package/dist/index.d.ts +9 -2
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +9 -2
  107. package/dist/index.js.map +1 -1
  108. package/dist/logo-assets.css +80 -0
  109. package/dist/logo.css +46 -0
  110. package/dist/skeleton.css +48 -0
  111. package/dist/slider.css +241 -0
  112. package/dist/spacing.css +838 -0
  113. package/dist/spinner.css +115 -0
  114. package/dist/styles.css +2220 -267
  115. package/dist/tabs.css +70 -15
  116. package/dist/toggle.css +106 -0
  117. package/dist/tokens.css +62 -12
  118. package/dist/tooltip.css +210 -0
  119. package/dist/typography.css +24 -3
  120. package/dist/utils/mergeRefs.d.ts +4 -0
  121. package/dist/utils/mergeRefs.d.ts.map +1 -0
  122. package/dist/utils/mergeRefs.js +14 -0
  123. package/dist/utils/mergeRefs.js.map +1 -0
  124. package/dist/utils/toCssSize.d.ts +4 -0
  125. package/dist/utils/toCssSize.d.ts.map +1 -0
  126. package/dist/utils/toCssSize.js +7 -0
  127. package/dist/utils/toCssSize.js.map +1 -0
  128. package/dist/utils/useControllableState.d.ts +13 -0
  129. package/dist/utils/useControllableState.d.ts.map +1 -0
  130. package/dist/utils/useControllableState.js +29 -0
  131. package/dist/utils/useControllableState.js.map +1 -0
  132. package/dist/utils/useInheritedTheme.d.ts +10 -0
  133. package/dist/utils/useInheritedTheme.d.ts.map +1 -0
  134. package/dist/utils/useInheritedTheme.js +22 -0
  135. package/dist/utils/useInheritedTheme.js.map +1 -0
  136. package/dist/utils/useMounted.d.ts +3 -0
  137. package/dist/utils/useMounted.d.ts.map +1 -0
  138. package/dist/utils/useMounted.js +11 -0
  139. package/dist/utils/useMounted.js.map +1 -0
  140. package/package.json +23 -3
  141. package/dist/cdn/leaf-0.1.1.min.css +0 -2
  142. package/dist/cdn/leaf-0.1.1.min.js +0 -2
package/dist/styles.css CHANGED
@@ -109,10 +109,13 @@
109
109
  /* Content / Text */
110
110
  --text-highlight: var(--brand-500);
111
111
  --text-primary: var(--neutral-100);
112
- --text-secondary: var(--neutral-300);
112
+ --text-secondary: var(--neutral-400);
113
113
  --text-tertiary: var(--neutral-500);
114
114
  --text-quaternary: var(--neutral-900);
115
115
 
116
+ /* Icon — Figma Icon/icon-on-color (Toggle thumb On…). */
117
+ --icon-on-color: var(--neutral-white);
118
+
116
119
  /* System */
117
120
  --system-blue: var(--blue-500);
118
121
  --system-green: var(--green-500);
@@ -124,14 +127,21 @@
124
127
  /* Button — Figma 246:1135. Brand/red giữ nguyên qua theme. */
125
128
  --button-base-primary: var(--brand-500);
126
129
  --button-base-destruction: var(--red-500);
127
- --button-base-disable: var(--neutral-600);
128
130
  --button-base-secondary: var(--brand-800);
129
131
  --button-base-secondary-destruction: var(--red-800);
130
132
  --button-base-tertiary: var(--neutral-600);
131
133
  --button-content-primary: var(--neutral-900);
132
134
  --button-content-secondary: var(--brand-500);
133
135
  --button-content-destruction: var(--red-500);
134
- --button-content-disable: var(--neutral-500);
136
+ /* Disabled — Figma Button/Base|Content/Disable */
137
+ --button-disabled-base: var(--neutral-600);
138
+ --button-disabled-content: var(--neutral-500);
139
+ /* Alias cũ (Disable) — giữ để không gãy consumer */
140
+ --button-base-disable: var(--button-disabled-base);
141
+ --button-content-disable: var(--button-disabled-content);
142
+
143
+ /* Overlay — Figma 995:6039 (Overlay/Overlay). */
144
+ --overlay: #171719cc;
135
145
  }
136
146
 
137
147
  [data-theme="light"] {
@@ -145,13 +155,15 @@
145
155
  --text-primary: var(--neutral-900);
146
156
  --text-secondary: var(--neutral-500);
147
157
  /*
148
- * Không map gương theo dark (neutral-300): trên nền sáng thì neutral-300
149
- * chỉ còn 1.41:1, gần như vô hình. neutral-400 cho 2.85:1 — ngang với
150
- * tertiary ở dark (3.36:1) — mà vẫn tách bậc khỏi secondary (neutral-500).
158
+ * Không map gương theo dark (neutral-500): trên nền sáng thì neutral-500
159
+ * trùng với secondary. neutral-400 cho 2.85:1 — ngang với tertiary ở dark
160
+ * (3.36:1) — mà vẫn tách bậc khỏi secondary (neutral-500).
151
161
  */
152
162
  --text-tertiary: var(--neutral-400);
153
163
  --text-quaternary: var(--neutral-white);
154
164
 
165
+ --icon-on-color: var(--neutral-white);
166
+
155
167
  --system-blue: var(--blue-500);
156
168
  --system-green: var(--green-500);
157
169
  --system-yellow: var(--yellow-500);
@@ -161,25 +173,30 @@
161
173
 
162
174
  --button-base-primary: var(--brand-500);
163
175
  --button-base-destruction: var(--red-500);
164
- --button-base-disable: var(--neutral-300);
165
176
  --button-base-secondary: var(--brand-100);
166
177
  --button-base-secondary-destruction: var(--red-100);
167
178
  --button-base-tertiary: var(--neutral-200);
168
179
  --button-content-primary: var(--neutral-900);
169
180
  --button-content-secondary: var(--brand-700);
170
181
  --button-content-destruction: var(--red-600);
171
- --button-content-disable: var(--neutral-400);
182
+ --button-disabled-base: var(--neutral-300);
183
+ --button-disabled-content: var(--neutral-400);
184
+ --button-base-disable: var(--button-disabled-base);
185
+ --button-content-disable: var(--button-disabled-content);
186
+
187
+ /* Overlay — cùng token Figma; phủ tối trên nền sáng. */
188
+ --overlay: #171719cc;
172
189
  }
173
190
 
174
191
  /* --- ../tokens/src/typography.css --- */
175
192
 
176
- /* Typography tokens — Desktop Figma 749:414. Inter; letter-spacing 0. */
193
+ /* Typography tokens — Desktop Figma 749:414. Inter only; weights 400 / 600 / 700. */
177
194
 
178
195
  :root {
179
196
  /*
180
- * `--font-inter` do next/font đặt trong app Next.js. Trang khác (HTML tĩnh) không có
181
- * biến này → phải có fallback, nếu không cả `--font-sans` thành invalid và rơi về font
182
- * mặc định của trình duyệt.
197
+ * `--font-inter` do next/font (hoặc @font-face) đặt trong app. HTML tĩnh /
198
+ * CDN không có biến này → fallback "Inter" rồi system stack.
199
+ * Weight chỉ dùng 400, 600, 700 — khớp Figma và bản font đã load.
183
200
  */
184
201
  --font-sans: var(--font-inter, "Inter"), ui-sans-serif, system-ui, sans-serif;
185
202
 
@@ -233,6 +250,39 @@
233
250
  --body-5-highlight-weight: 600;
234
251
  }
235
252
 
253
+ /* --- ../tokens/src/spacing.css --- */
254
+
255
+ /* Spacing tokens — Figma 34:1034. Dùng cho margin, padding, gap. */
256
+
257
+ :root {
258
+ --spacing-0: 0px;
259
+ --spacing-xs: 4px;
260
+ --spacing-s: 8px;
261
+ --spacing-m: 12px;
262
+ --spacing-l: 16px;
263
+ --spacing-xl: 24px;
264
+ --spacing-2xl: 36px;
265
+ --spacing-3xl: 48px;
266
+ --spacing-4xl: 60px;
267
+ --spacing-5xl: 84px;
268
+ --spacing-6xl: 120px;
269
+ --spacing-7xl: 240px;
270
+ }
271
+
272
+ /* --- ../tokens/src/border.css --- */
273
+
274
+ /* Border radius tokens — Figma 700:4390. Map sang spacing cùng bậc. */
275
+
276
+ :root {
277
+ --radius-0: var(--spacing-0);
278
+ --radius-xs: var(--spacing-xs);
279
+ --radius-s: var(--spacing-s);
280
+ --radius-m: var(--spacing-m);
281
+ --radius-l: var(--spacing-l);
282
+ --radius-xl: var(--spacing-xl);
283
+ --radius-2xl: var(--spacing-2xl);
284
+ }
285
+
236
286
  /* --- src/components/Button/button.css --- */
237
287
 
238
288
  /*
@@ -242,25 +292,27 @@
242
292
  * qua data-icon-only. Disabled dùng attribute native `:disabled` (và
243
293
  * `aria-disabled`) nên không cần class riêng.
244
294
  *
295
+ * Width / height override qua --leaf-button-width / --leaf-button-height
296
+ * (React gắn bằng prop; HTML tĩnh set style hoặc để mặc định theo size).
297
+ *
245
298
  * Toàn bộ hình thức (kể cả typography của label) nằm ở đây — React chỉ gắn
246
299
  * attribute, nên HTML tĩnh viết cùng markup là ra cùng kết quả. Thiếu attribute
247
300
  * nào thì lấy mặc định giống prop của React: lg · primary · normal.
248
- *
249
- * Variant chỉ đổi custom property `--leaf-button-*`; thuộc tính thật chỉ khai
250
- * báo một lần ở `.leaf-button`.
251
301
  */
252
302
 
253
303
  @layer components {
254
304
  .leaf-button {
255
- /* Mặc định: size lg */
305
+ /* Mặc định: size lg — Figma Large: h 56 · px XL · py S · gap L · icon 30 */
306
+ /* --leaf-button-width chỉ set khi prop width; không set → auto / icon-only = height */
256
307
  --leaf-button-height: 56px;
257
- --leaf-button-padding: 8px 24px;
258
- --leaf-button-icon-only-padding: 8px;
259
- --leaf-button-gap: 16px;
308
+ --leaf-button-padding: var(--spacing-s) var(--spacing-xl);
309
+ --leaf-button-icon-only-padding: var(--spacing-s);
310
+ --leaf-button-gap: var(--spacing-l);
260
311
  --leaf-button-icon-size: 30px;
261
312
  --leaf-button-font-size: var(--body-1-size);
262
313
  --leaf-button-line-height: var(--body-1-line-height);
263
314
  --leaf-button-font-weight: var(--body-1-highlight-weight);
315
+ --leaf-button-letter-spacing: 0.5px;
264
316
 
265
317
  /* Mặc định: priority primary, status normal */
266
318
  --leaf-button-bg: var(--button-base-primary);
@@ -269,6 +321,8 @@
269
321
  display: inline-flex;
270
322
  align-items: center;
271
323
  justify-content: center;
324
+ box-sizing: border-box;
325
+ width: var(--leaf-button-width, auto);
272
326
  height: var(--leaf-button-height);
273
327
  gap: var(--leaf-button-gap);
274
328
  border: none;
@@ -281,11 +335,12 @@
281
335
  text-align: center;
282
336
  white-space: nowrap;
283
337
  font: inherit;
338
+ font-family: var(--font-sans);
284
339
  font-size: var(--leaf-button-font-size);
285
340
  line-height: var(--leaf-button-line-height);
286
341
  font-weight: var(--leaf-button-font-weight);
342
+ letter-spacing: var(--leaf-button-letter-spacing);
287
343
  text-decoration: none;
288
- box-sizing: border-box;
289
344
  vertical-align: middle;
290
345
  }
291
346
 
@@ -306,49 +361,55 @@
306
361
  height: 1em;
307
362
  }
308
363
 
309
- /* ── Size ────────────────────────────────────────────────────────────── */
364
+ /* ── Size — Figma Medium/Small dùng padding (không ép height trong auto-layout);
365
+ * vẫn set height mặc định khớp frame để icon-only / căn hàng ổn định.
366
+ * Truyền height="auto" (prop) → chiều cao theo padding + nội dung. */
310
367
 
311
368
  .leaf-button[data-size="md"] {
369
+ /* Medium: px L · py S · gap M · icon 24 · frame 40 */
312
370
  --leaf-button-height: 40px;
313
- --leaf-button-padding: 8px 16px;
314
- --leaf-button-gap: 8px;
371
+ --leaf-button-padding: var(--spacing-s) var(--spacing-l);
372
+ --leaf-button-gap: var(--spacing-m);
315
373
  --leaf-button-icon-size: 24px;
316
374
  --leaf-button-font-size: var(--body-3-size);
317
375
  --leaf-button-line-height: var(--body-3-line-height);
318
376
  --leaf-button-font-weight: var(--body-3-highlight-weight);
377
+ --leaf-button-letter-spacing: 0;
319
378
  }
320
379
 
321
380
  .leaf-button[data-size="sm"] {
381
+ /* Small: px M · py XS · gap S · icon 20 · frame 28 */
322
382
  --leaf-button-height: 28px;
323
- --leaf-button-padding: 4px 8px;
324
- --leaf-button-icon-only-padding: 4px;
325
- --leaf-button-gap: 4px;
383
+ --leaf-button-padding: var(--spacing-xs) var(--spacing-m);
384
+ --leaf-button-icon-only-padding: var(--spacing-xs);
385
+ --leaf-button-gap: var(--spacing-s);
326
386
  --leaf-button-icon-size: 20px;
327
387
  --leaf-button-font-size: var(--body-4-size);
328
388
  --leaf-button-line-height: var(--body-4-line-height);
329
389
  --leaf-button-font-weight: var(--body-4-highlight-weight);
390
+ --leaf-button-letter-spacing: 0;
330
391
  }
331
392
 
332
- /* Icon-only: khung vuông (tròn nhờ border-radius) cạnh = height. */
393
+ /* Icon-only: khung vuông (tròn nhờ border-radius). Width custom vẫn được tôn trọng. */
333
394
  .leaf-button[data-icon-only="true"] {
334
- width: var(--leaf-button-height);
395
+ width: var(--leaf-button-width, var(--leaf-button-height));
335
396
  padding: var(--leaf-button-icon-only-padding);
336
397
  }
337
398
 
338
- /* Ghost không có khung — bỏ height/padding cố định. Đứng sau size để thắng. */
339
- .leaf-button[data-priority="ghost"] {
399
+ /* Ghost text — không khung; icon-only ghost vẫn giữ hit-area theo size. */
400
+ .leaf-button[data-priority="ghost"]:not([data-icon-only="true"]) {
340
401
  --leaf-button-height: auto;
341
402
  --leaf-button-padding: 0;
342
- --leaf-button-icon-only-padding: 0;
343
403
  }
344
404
 
345
405
  .leaf-button[data-priority="ghost"][data-icon-only="true"] {
346
- border-radius: 0;
406
+ --leaf-button-bg: transparent;
407
+ --leaf-button-padding: 0;
408
+ --leaf-button-icon-only-padding: 0;
347
409
  }
348
410
 
349
411
  /* ── Priority × status ───────────────────────────────────────────────── */
350
412
 
351
- /* Không có data-priority = primary. */
352
413
  .leaf-button[data-status="destruction"] {
353
414
  --leaf-button-bg: var(--button-base-destruction);
354
415
  --leaf-button-fg: var(--button-content-primary);
@@ -385,402 +446,2273 @@
385
446
  }
386
447
 
387
448
  /*
388
- * Disabled — Primary / Ghost có trong Figma; Secondary/Tertiary dùng cùng token.
449
+ * Disabled — token --button-disabled-* (alias của --button-*-disable).
389
450
  * Specificity (0,3,0) và đứng cuối để thắng mọi tổ hợp priority × status.
390
451
  */
391
452
  .leaf-button:disabled:not([data-priority="ghost"]),
392
453
  .leaf-button[aria-disabled="true"]:not([data-priority="ghost"]) {
393
- --leaf-button-bg: var(--button-base-disable);
394
- --leaf-button-fg: var(--button-content-disable);
454
+ --leaf-button-bg: var(--button-disabled-base);
455
+ --leaf-button-fg: var(--button-disabled-content);
395
456
  }
396
457
 
397
458
  .leaf-button[data-priority="ghost"]:disabled,
398
459
  .leaf-button[data-priority="ghost"][aria-disabled="true"] {
399
460
  --leaf-button-bg: transparent;
400
- --leaf-button-fg: var(--button-content-disable);
461
+ --leaf-button-fg: var(--button-disabled-content);
401
462
  }
402
463
 
403
464
  .leaf-button:disabled,
404
465
  .leaf-button[aria-disabled="true"] {
405
466
  cursor: not-allowed;
406
467
  }
468
+
469
+ /*
470
+ * Loading — `data-loading="true"` (React: `loading` / onClick trả Promise; HTML tĩnh:
471
+ * `Leaf.button.setLoading`). Spinner thay leading icon, ăn --leaf-button-icon-size và
472
+ * màu chữ; màu nút giữ nguyên priority — không dùng `:disabled`.
473
+ */
474
+ .leaf-button[data-loading="true"] {
475
+ cursor: progress;
476
+ }
477
+
478
+ .leaf-button__spinner > svg {
479
+ animation: leaf-spinner-spin var(--leaf-spinner-duration, 1.2s) linear infinite;
480
+ }
407
481
  }
408
482
 
409
- /* --- src/components/Tabs/tabs.css --- */
483
+ /* Trùng tên với spinner.css để button.css tự đủ khi import riêng. */
484
+ @keyframes leaf-spinner-spin {
485
+ to {
486
+ transform: rotate(360deg);
487
+ }
488
+ }
489
+
490
+ /* --- src/components/Dialog/dialog.css --- */
410
491
 
411
492
  /*
412
- * Tabs — Figma 712:6996 (Tabs Items).
413
- *
414
- * `variant` map type trong Figma: subcontent | title | functional | buy | sell.
415
- * Size: xl | lg | md | sm (tuỳ variant — Title chỉ S, Functional chỉ M, Buy/Sell chỉ L).
416
- *
417
- * Variant / size đặt trên tablist (`.leaf-tabs[data-variant][data-size]`), từng
418
- * `.leaf-tab` chỉ cần `aria-selected`. Toàn bộ hình thức (kể cả typography của
419
- * label) nằm ở đây — React và `leaf.js` chỉ gắn attribute, nên HTML tĩnh viết
420
- * cùng markup là ra cùng kết quả.
493
+ * Dialog — Figma 994:4149.
421
494
  *
422
- * Mặc định khi thiếu attribute: variant subcontent, size xl. Chỉ Subcontent đổi
423
- * theo size; các variant khác có một size duy nhất nên không đọc `data-size`.
495
+ * Backdrop phủ toàn màn hình + blur; panel căn giữa. Header (back · title · close)
496
+ * bật/tắt qua markup — React chỉ gắn/gỡ phần tử, không gắn class typography/màu
497
+ * theo prop. Thiếu phần header → chỉ còn body (children).
424
498
  */
425
499
 
426
500
  @layer components {
427
- .leaf-tabs {
428
- /* Kích thước của Subcontent — mặc định xl, đổi theo data-size bên dưới. */
429
- --leaf-tab-padding: 12px 16px;
430
- --leaf-tab-gap: 8px;
431
- --leaf-tab-font-size: var(--body-3-size);
432
- --leaf-tab-line-height: var(--body-3-line-height);
433
- --leaf-tab-font-weight: var(--body-3-highlight-weight);
434
-
501
+ .leaf-dialog-backdrop {
502
+ position: fixed;
503
+ inset: 0;
504
+ z-index: var(--leaf-z-dialog, 50);
435
505
  display: flex;
436
- flex-wrap: wrap;
437
506
  align-items: center;
438
- gap: 12px;
507
+ justify-content: center;
508
+ padding: 16px;
509
+ box-sizing: border-box;
510
+ /*
511
+ * Overlay — Figma 995:6039: Overlay/Overlay + blur nhẹ. Chỉ khai báo bản
512
+ * chuẩn: Safari 18+ hỗ trợ `backdrop-filter` không prefix, còn dòng
513
+ * `-webkit-` đặt sau từng ghi đè và làm blur không chạy.
514
+ */
515
+ background-color: var(--overlay);
516
+ backdrop-filter: blur(5px);
439
517
  }
440
518
 
441
- .leaf-tabs[data-size="lg"] {
442
- --leaf-tab-padding: 8px 16px;
443
- --leaf-tab-gap: 8px;
444
- --leaf-tab-font-size: var(--body-4-size);
445
- --leaf-tab-line-height: var(--body-4-line-height);
446
- --leaf-tab-font-weight: var(--body-4-highlight-weight);
519
+ /* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để HTML tĩnh ẩn được. */
520
+ .leaf-dialog-backdrop[hidden] {
521
+ display: none;
447
522
  }
448
523
 
449
- .leaf-tabs[data-size="md"] {
450
- --leaf-tab-padding: 4px 12px;
451
- --leaf-tab-gap: normal;
452
- --leaf-tab-font-size: var(--body-4-size);
453
- --leaf-tab-line-height: var(--body-4-line-height);
454
- --leaf-tab-font-weight: var(--body-4-weight);
524
+ .leaf-dialog {
525
+ --leaf-dialog-gap: 16px;
526
+ --leaf-dialog-padding: 16px;
527
+ --leaf-dialog-radius: 12px;
528
+ --leaf-dialog-back-size: 24px;
529
+ --leaf-dialog-close-size: 28px;
530
+ --leaf-dialog-close-icon: 20px;
531
+
532
+ display: flex;
533
+ flex-direction: column;
534
+ gap: var(--leaf-dialog-gap);
535
+ /* Luôn co theo viewport; maxWidth/maxHeight chỉ là trần — mobile không bị tràn. */
536
+ width: 100%;
537
+ height: auto;
538
+ max-width: var(--leaf-dialog-max-width, 100%);
539
+ max-height: var(--leaf-dialog-max-height, 100%);
540
+ margin: 0;
541
+ padding: var(--leaf-dialog-padding);
542
+ overflow: hidden;
543
+ box-sizing: border-box;
544
+ border-radius: var(--leaf-dialog-radius);
545
+ background-color: var(--base-primary);
546
+ color: var(--text-primary);
547
+ font-family: var(--font-sans);
455
548
  }
456
549
 
457
- .leaf-tabs[data-size="sm"] {
458
- --leaf-tab-padding: 4px 12px;
459
- --leaf-tab-gap: normal;
460
- --leaf-tab-font-size: var(--body-5-size);
461
- --leaf-tab-line-height: var(--body-5-line-height);
462
- --leaf-tab-font-weight: var(--body-5-weight);
550
+ /* Panel nhận focus khi mở (tabindex="-1") — không phải control nên không vẽ outline. */
551
+ .leaf-dialog:focus {
552
+ outline: none;
463
553
  }
464
554
 
465
- .leaf-tab {
555
+ .leaf-dialog__header {
556
+ display: flex;
557
+ flex-shrink: 0;
558
+ align-items: center;
559
+ justify-content: space-between;
560
+ gap: var(--leaf-dialog-gap);
561
+ width: 100%;
562
+ min-width: 0;
563
+ }
564
+
565
+ /* Cụm trái: back + title */
566
+ .leaf-dialog__start {
567
+ display: flex;
568
+ align-items: center;
569
+ gap: var(--leaf-dialog-gap);
570
+ min-width: 0;
571
+ flex: 1 1 auto;
572
+ }
573
+
574
+ /* Chỉ truncate layout — font/màu dùng class heading-3 text-primary trên markup. */
575
+ .leaf-dialog__start > :where(h2, p) {
576
+ margin: 0;
577
+ min-width: 0;
578
+ overflow: hidden;
579
+ text-overflow: ellipsis;
580
+ white-space: nowrap;
581
+ }
582
+
583
+ .leaf-dialog__back,
584
+ .leaf-dialog__close {
466
585
  display: inline-flex;
586
+ flex-shrink: 0;
467
587
  align-items: center;
468
588
  justify-content: center;
469
- border: none;
470
589
  margin: 0;
471
590
  padding: 0;
591
+ border: none;
472
592
  cursor: pointer;
473
- background-color: transparent;
474
- color: inherit;
593
+ color: var(--text-primary);
594
+ background: transparent;
475
595
  font: inherit;
476
- text-align: center;
477
- white-space: nowrap;
596
+ appearance: none;
478
597
  box-sizing: border-box;
479
598
  }
480
599
 
481
- .leaf-tab:disabled,
482
- .leaf-tab[aria-disabled="true"] {
483
- cursor: not-allowed;
600
+ .leaf-dialog__back {
601
+ width: var(--leaf-dialog-back-size);
602
+ height: var(--leaf-dialog-back-size);
484
603
  }
485
604
 
486
- /* ── Subcontent (pill) — cũng là mặc định khi không có data-variant ──── */
605
+ .leaf-dialog__back:hover,
606
+ .leaf-dialog__close:hover {
607
+ color: var(--text-highlight);
608
+ }
487
609
 
488
- .leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]) .leaf-tab {
489
- gap: var(--leaf-tab-gap);
490
- padding: var(--leaf-tab-padding);
491
- border-radius: 1000px;
492
- background-color: var(--base-tertiary);
493
- color: var(--text-secondary);
494
- font-size: var(--leaf-tab-font-size);
495
- line-height: var(--leaf-tab-line-height);
496
- font-weight: var(--leaf-tab-font-weight);
610
+ .leaf-dialog__back:focus-visible,
611
+ .leaf-dialog__close:focus-visible {
612
+ outline: 2px solid var(--text-highlight);
613
+ outline-offset: 2px;
497
614
  }
498
615
 
499
- .leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"])
500
- .leaf-tab[aria-selected="true"] {
501
- background-color: var(--base-quinary);
502
- color: var(--text-quaternary);
616
+ .leaf-dialog__icon {
617
+ display: block;
618
+ width: 1em;
619
+ height: 1em;
503
620
  }
504
621
 
505
- /* ── Title (underline) ───────────────────────────────────────────────── */
622
+ .leaf-dialog__back .leaf-dialog__icon {
623
+ font-size: var(--leaf-dialog-back-size);
624
+ }
506
625
 
507
- .leaf-tabs[data-variant="title"] .leaf-tab {
626
+ .leaf-dialog__close {
627
+ width: var(--leaf-dialog-close-size);
628
+ min-height: var(--leaf-dialog-close-size);
629
+ padding: 4px 6px;
630
+ border-radius: 100px;
631
+ background-color: var(--base-secondary);
632
+ font-size: var(--leaf-dialog-close-icon);
633
+ }
634
+
635
+ .leaf-dialog__body {
636
+ display: flex;
637
+ flex: 1 1 auto;
508
638
  flex-direction: column;
509
- gap: 4px;
510
- min-width: 100px;
511
- color: var(--text-secondary);
512
- font-size: var(--body-4-size);
513
- line-height: var(--body-4-line-height);
514
- font-weight: var(--body-4-weight);
639
+ gap: var(--leaf-dialog-gap);
640
+ min-height: 0;
641
+ width: 100%;
642
+ overflow: auto;
515
643
  }
644
+ }
516
645
 
517
- .leaf-tabs[data-variant="title"] .leaf-tab[aria-selected="true"] {
518
- color: var(--text-primary);
519
- font-weight: var(--body-4-highlight-weight);
646
+ /* --- src/components/Logo/logo.css --- */
647
+
648
+ /*
649
+ * Logo — Figma 924:1074.
650
+ *
651
+ * React: chọn SVG trong assets.ts, render <img class="leaf-logo__img">.
652
+ * HTML tĩnh: span.leaf-logo:empty + data-brand / data-mode / data-side — rule
653
+ * background-image nằm ở logo-assets.css (generated bởi scripts/embed-logo-assets.mjs,
654
+ * không gộp vào classes.css / styles.css; bản CDN đã gộp sẵn).
655
+ * Size (chiều cao) qua --leaf-logo-size.
656
+ */
657
+
658
+ @layer components {
659
+ .leaf-logo {
660
+ display: inline-flex;
661
+ flex-shrink: 0;
662
+ align-items: center;
663
+ justify-content: center;
664
+ margin: 0;
665
+ padding: 0;
666
+ border: none;
667
+ background: transparent;
668
+ background-repeat: no-repeat;
669
+ background-position: center;
670
+ background-size: contain;
671
+ line-height: 0;
672
+ vertical-align: middle;
673
+ box-sizing: border-box;
520
674
  }
521
675
 
522
- .leaf-tabs[data-variant="title"] .leaf-tab::after {
523
- content: "";
524
- display: block;
525
- width: 100%;
526
- height: 2px;
527
- background-color: var(--text-primary);
528
- opacity: 0;
676
+ /* HTML tĩnh — không có <img>, asset lấy từ data-* */
677
+ .leaf-logo:empty {
678
+ display: inline-block;
679
+ height: var(--leaf-logo-size, 40px);
680
+ width: calc(var(--leaf-logo-size, 40px) * var(--leaf-logo-aspect, 1));
529
681
  }
530
682
 
531
- .leaf-tabs[data-variant="title"] .leaf-tab[aria-selected="true"]::after {
532
- opacity: 1;
683
+ .leaf-logo__img {
684
+ display: block;
685
+ height: var(--leaf-logo-size, 40px);
686
+ width: auto;
687
+ max-width: 100%;
533
688
  }
689
+ }
534
690
 
535
- /* ── Functional ──────────────────────────────────────────────────────── */
691
+ /* --- src/components/Skeleton/skeleton.css --- */
536
692
 
537
- .leaf-tabs[data-variant="functional"] .leaf-tab {
538
- height: 24px;
539
- min-width: 100px;
540
- padding: 4px 24px;
541
- border-radius: 100px;
693
+ /*
694
+ * Skeleton — placeholder shimmer.
695
+ *
696
+ * Nền `--base-tertiary` (dark: #28292B). Kích thước / radius qua custom property
697
+ * từ React (hoặc style inline khi HTML tĩnh). Thiếu biến → full width/height,
698
+ * radius 12px.
699
+ */
700
+
701
+ @layer components {
702
+ .leaf-skeleton {
703
+ --leaf-skeleton-width: 100%;
704
+ --leaf-skeleton-height: 100%;
705
+ --leaf-skeleton-radius: 12px;
706
+
707
+ position: relative;
708
+ overflow: hidden;
709
+ box-sizing: border-box;
710
+ width: var(--leaf-skeleton-width);
711
+ height: var(--leaf-skeleton-height);
712
+ border-radius: var(--leaf-skeleton-radius);
542
713
  background-color: var(--base-tertiary);
543
- color: var(--button-content-disable);
544
- font-size: var(--body-5-size);
545
- line-height: var(--body-5-line-height);
546
- font-weight: var(--body-5-weight);
547
714
  }
548
715
 
549
- .leaf-tabs[data-variant="functional"] .leaf-tab[aria-selected="true"] {
550
- background-color: var(--button-base-primary);
551
- color: var(--button-content-primary);
716
+ .leaf-skeleton__shimmer {
717
+ position: absolute;
718
+ inset: 0;
719
+ background: linear-gradient(
720
+ to right,
721
+ transparent,
722
+ color-mix(in srgb, var(--base-quinary) 10%, transparent),
723
+ transparent
724
+ );
725
+ animation: leaf-skeleton-shimmer 2s infinite ease-in-out;
552
726
  }
727
+ }
553
728
 
554
- /* ── Buy / Sell ──────────────────────────────────────────────────────── */
729
+ @keyframes leaf-skeleton-shimmer {
730
+ 0% {
731
+ transform: translateX(-100%);
732
+ }
733
+ 100% {
734
+ transform: translateX(100%);
735
+ }
736
+ }
555
737
 
556
- .leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab {
557
- min-width: 100px;
558
- width: auto;
559
- gap: 4px;
560
- padding: 6px 4px;
561
- border-radius: 100px;
562
- color: var(--text-primary);
738
+ /* --- src/components/Slider/slider.css --- */
739
+
740
+ /*
741
+ * Slider — Figma 730:12646.
742
+ *
743
+ * Giá trị liên tục trên rail (kéo / click chính xác tới từng step — như
744
+ * TradeQuickSlider). Mốc chia đều đặt tuyệt đối theo `left: <%>`; thumb đặt ở
745
+ * `--leaf-slider-fill`. Ở min thumb = `--text-primary`; khi > min =
746
+ * `--leaf-slider-active` (mặc định `--text-highlight`).
747
+ *
748
+ * Rail, mốc và thumb cùng nằm trong vùng lùi vào `--leaf-slider-inset` ở hai đầu
749
+ * (nửa thumb) — nhờ vậy `left: X%` của cả ba khớp nhau và thumb không tràn ra ngoài.
750
+ */
751
+
752
+ @layer components {
753
+ .leaf-slider {
754
+ --leaf-slider-active: var(--text-highlight);
755
+ --leaf-slider-fill: 0%;
756
+ --leaf-slider-mark: 6px;
757
+ --leaf-slider-mark-active: 10px;
758
+ --leaf-slider-rail-height: 2px;
759
+ --leaf-slider-inset: calc(var(--leaf-slider-mark-active) / 2);
760
+ --leaf-slider-control-height: max(
761
+ var(--leaf-slider-mark-active),
762
+ var(--leaf-slider-mark),
763
+ 20px
764
+ );
765
+
766
+ display: flex;
767
+ flex-direction: column;
768
+ /* Figma gap S (8) giữa Title/Unit và khối track+labels. */
769
+ gap: 8px;
770
+ width: 100%;
771
+ box-sizing: border-box;
772
+ font-family: var(--font-sans);
563
773
  font-size: var(--body-5-size);
564
774
  line-height: var(--body-5-line-height);
565
775
  font-weight: var(--body-5-weight);
776
+ color: var(--text-primary);
777
+ user-select: none;
778
+ -webkit-user-select: none;
566
779
  }
567
780
 
568
- .leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab[aria-selected="true"] {
569
- font-weight: var(--body-5-highlight-weight);
781
+ /* Figma gap XS (4) giữa track và Value labels. */
782
+ .leaf-slider__body {
783
+ display: flex;
784
+ flex-direction: column;
785
+ gap: 4px;
786
+ width: 100%;
570
787
  }
571
788
 
572
- .leaf-tabs[data-variant="buy"] .leaf-tab[aria-selected="true"] {
573
- background-color: var(--button-base-secondary);
574
- color: var(--text-highlight);
789
+ .leaf-slider__header {
790
+ display: flex;
791
+ align-items: flex-start;
792
+ justify-content: space-between;
793
+ gap: 8px;
794
+ width: 100%;
795
+ color: var(--text-primary);
796
+ white-space: nowrap;
797
+ user-select: text;
798
+ -webkit-user-select: text;
575
799
  }
576
800
 
577
- .leaf-tabs[data-variant="sell"] .leaf-tab[aria-selected="true"] {
578
- background-color: var(--button-base-secondary-destruction);
579
- color: var(--button-content-destruction);
801
+ .leaf-slider__title,
802
+ .leaf-slider__unit {
803
+ min-width: 0;
580
804
  }
581
805
 
582
- .leaf-tab__label,
583
- .leaf-tab__addon {
584
- display: inline-flex;
806
+ .leaf-slider__unit {
807
+ text-align: right;
808
+ }
809
+
810
+ .leaf-slider__control {
811
+ position: relative;
812
+ display: flex;
585
813
  align-items: center;
586
- justify-content: center;
587
- line-height: inherit;
814
+ width: 100%;
815
+ height: var(--leaf-slider-control-height);
816
+ outline: none;
817
+ cursor: pointer;
818
+ /* Chỉ khoá gesture trên track — header / labels vẫn cho cuộn trang. */
819
+ touch-action: none;
588
820
  }
589
821
 
590
- .leaf-tab__addon > svg {
822
+ .leaf-slider__control:focus-visible {
823
+ outline: 2px solid var(--leaf-slider-active);
824
+ outline-offset: 4px;
825
+ border-radius: 4px;
826
+ }
827
+
828
+ .leaf-slider[data-dragging="true"] .leaf-slider__control {
829
+ cursor: grabbing;
830
+ }
831
+
832
+ .leaf-slider__rail {
833
+ position: absolute;
834
+ left: var(--leaf-slider-inset);
835
+ right: var(--leaf-slider-inset);
836
+ top: 50%;
837
+ height: var(--leaf-slider-rail-height);
838
+ transform: translateY(-50%);
839
+ border-radius: 100px;
840
+ background-color: var(--text-tertiary);
841
+ pointer-events: none;
842
+ }
843
+
844
+ .leaf-slider__fill {
591
845
  display: block;
592
- width: 1em;
593
- height: 1em;
846
+ height: 100%;
847
+ width: var(--leaf-slider-fill);
848
+ border-radius: inherit;
849
+ background-color: var(--text-primary);
594
850
  }
595
- }
596
851
 
597
- /* --- src/styles/color.css --- */
852
+ /* Khung toạ độ cho mốc + thumb — trùng với rail, cao 0, nằm giữa control. */
853
+ .leaf-slider__marks {
854
+ position: absolute;
855
+ z-index: 1;
856
+ left: var(--leaf-slider-inset);
857
+ right: var(--leaf-slider-inset);
858
+ top: 50%;
859
+ height: 0;
860
+ pointer-events: none;
861
+ }
598
862
 
599
- /*
600
- * Color classes — map 1:1 sang semantic token trong @finhay/leaf-tokens.
601
- *
602
- * Quy tắc tên: **tiền tố nói thuộc tính, phần sau nói vai trò của token**.
603
- *
604
- * text-* → color (text-primary, text-red)
605
- * base-* → background-color (base-primary, base-red)
606
- * border-* → border-color (border-primary, border-red)
607
- *
608
- * Ba bộ dùng chung một hậu tố nên đọc là đoán được: `text-red` / `base-red` /
609
- * `border-red`, `text-primary` / `base-primary` / `border-primary`. Nhóm system
610
- * bỏ chữ `system` trong tên class (token vẫn là `--system-red`), còn `border-*`
611
- * lấy màu từ thang base vì viền luôn là màu bề mặt.
612
- *
613
- * Mỗi class chỉ set đúng 1 thuộc tính (color / background-color / border-color)
614
- * — border-width và border-style do app tự lo. Class tự đổi giá trị theo
615
- * `[data-theme="light"]` vì nó trỏ vào var, không hard-code màu.
863
+ .leaf-slider__mark {
864
+ position: absolute;
865
+ top: 0;
866
+ left: 0;
867
+ display: block;
868
+ box-sizing: border-box;
869
+ width: var(--leaf-slider-mark);
870
+ height: var(--leaf-slider-mark);
871
+ margin: 0;
872
+ padding: 0;
873
+ border: none;
874
+ border-radius: 50%;
875
+ background-color: var(--text-tertiary);
876
+ cursor: pointer;
877
+ appearance: none;
878
+ -webkit-appearance: none;
879
+ pointer-events: auto;
880
+ transform: translate(-50%, -50%);
881
+ transition: background-color 0.15s ease;
882
+ }
883
+
884
+ .leaf-slider__mark[data-state="passed"] {
885
+ background-color: var(--text-primary);
886
+ }
887
+
888
+ /* Mốc trùng giá trị nằm dưới thumb — cùng màu để không lộ viền. */
889
+ .leaf-slider__mark[data-state="active"] {
890
+ background-color: var(--text-primary);
891
+ }
892
+
893
+ .leaf-slider:not([data-at-min="true"]) .leaf-slider__mark[data-state="active"] {
894
+ background-color: var(--leaf-slider-active);
895
+ }
896
+
897
+ .leaf-slider__thumb {
898
+ position: absolute;
899
+ top: 0;
900
+ left: var(--leaf-slider-fill);
901
+ display: block;
902
+ box-sizing: border-box;
903
+ width: var(--leaf-slider-mark-active);
904
+ height: var(--leaf-slider-mark-active);
905
+ border-radius: 50%;
906
+ /* Figma Default (min): thumb trắng; Active (> min): highlight. */
907
+ background-color: var(--text-primary);
908
+ transform: translate(-50%, -50%);
909
+ pointer-events: none;
910
+ transition: background-color 0.15s ease;
911
+ }
912
+
913
+ .leaf-slider:not([data-at-min="true"]) .leaf-slider__thumb {
914
+ background-color: var(--leaf-slider-active);
915
+ }
916
+
917
+ /* 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. */
918
+ .leaf-slider__labels {
919
+ position: relative;
920
+ margin-inline: var(--leaf-slider-inset);
921
+ min-height: var(--body-5-line-height);
922
+ user-select: text;
923
+ -webkit-user-select: text;
924
+ }
925
+
926
+ .leaf-slider__label {
927
+ position: absolute;
928
+ top: 0;
929
+ max-width: 40%;
930
+ margin: 0;
931
+ padding: 0;
932
+ border: none;
933
+ background: none;
934
+ font: inherit;
935
+ color: var(--text-secondary);
936
+ white-space: nowrap;
937
+ transform: translateX(-50%);
938
+ text-align: center;
939
+ cursor: pointer;
940
+ appearance: none;
941
+ -webkit-appearance: none;
942
+ }
943
+
944
+ .leaf-slider__label[data-edge="start"] {
945
+ transform: translateX(calc(-1 * var(--leaf-slider-inset)));
946
+ text-align: left;
947
+ }
948
+
949
+ .leaf-slider__label[data-edge="end"] {
950
+ transform: translateX(calc(-100% + var(--leaf-slider-inset)));
951
+ text-align: right;
952
+ }
953
+
954
+ .leaf-slider__label[data-active="true"] {
955
+ color: var(--text-primary);
956
+ }
957
+
958
+ .leaf-slider__label:disabled {
959
+ cursor: not-allowed;
960
+ }
961
+
962
+ .leaf-slider[data-disabled="true"] {
963
+ opacity: 0.5;
964
+ pointer-events: none;
965
+ }
966
+
967
+ .leaf-slider[data-disabled="true"] .leaf-slider__control {
968
+ touch-action: auto;
969
+ }
970
+
971
+ .leaf-slider[data-disabled="true"] .leaf-slider__control,
972
+ .leaf-slider[data-disabled="true"] .leaf-slider__mark,
973
+ .leaf-slider[data-disabled="true"] .leaf-slider__label {
974
+ cursor: not-allowed;
975
+ }
976
+ }
977
+
978
+ /* --- src/components/Spinner/spinner.css --- */
979
+
980
+ /*
981
+ * Spinner — SVG loader-line (Figma Button), viewBox 0 0 21 21.
616
982
  *
617
- * Chỉ semantic token mới có class. Primitive (--neutral-500, --brand-300…) là
618
- * nguồn nội bộ, không dùng thẳng trong UI.
983
+ * Variant animation qua data-animation; size qua data-size; overlay fullscreen
984
+ * qua .leaf-spinner-overlay. Màu mặc định trắng (dark) / đen (light) qua --base-quinary —
985
+ * không dùng highlight; override bằng class text-* khi cần. Thiếu attribute → md · spin.
986
+ */
987
+
988
+ @layer components {
989
+ .leaf-spinner {
990
+ --leaf-spinner-size: 24px;
991
+ --leaf-spinner-duration: 1.2s;
992
+
993
+ display: inline-flex;
994
+ flex-shrink: 0;
995
+ align-items: center;
996
+ justify-content: center;
997
+ width: var(--leaf-spinner-size);
998
+ height: var(--leaf-spinner-size);
999
+ color: var(--base-quinary);
1000
+ vertical-align: middle;
1001
+ line-height: 0;
1002
+ }
1003
+
1004
+ .leaf-spinner__icon {
1005
+ display: block;
1006
+ width: 100%;
1007
+ height: 100%;
1008
+ }
1009
+
1010
+ /* Fullscreen overlay — pattern Spinner (portal + nền mờ). */
1011
+ .leaf-spinner-overlay {
1012
+ position: fixed;
1013
+ inset: 0;
1014
+ z-index: var(--leaf-z-spinner-overlay, 100);
1015
+ display: flex;
1016
+ align-items: center;
1017
+ justify-content: center;
1018
+ box-sizing: border-box;
1019
+ background-color: var(--overlay);
1020
+ color: var(--base-quinary);
1021
+ }
1022
+
1023
+ /* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để HTML tĩnh ẩn được. */
1024
+ .leaf-spinner-overlay[hidden] {
1025
+ display: none;
1026
+ }
1027
+
1028
+ /* ── Size ────────────────────────────────────────────────────────────── */
1029
+
1030
+ .leaf-spinner[data-size="lg"] {
1031
+ --leaf-spinner-size: 30px;
1032
+ }
1033
+
1034
+ .leaf-spinner[data-size="sm"] {
1035
+ --leaf-spinner-size: 20px;
1036
+ }
1037
+
1038
+ /* ── Animations ──────────────────────────────────────────────────────── */
1039
+
1040
+ /* spin — xoay cả icon (mặc định). */
1041
+ .leaf-spinner[data-animation="spin"] .leaf-spinner__icon,
1042
+ .leaf-spinner:not([data-animation]) .leaf-spinner__icon {
1043
+ animation: leaf-spinner-spin var(--leaf-spinner-duration) linear infinite;
1044
+ }
1045
+
1046
+ /*
1047
+ * fade — xoay + mask conic để tạo hiệu ứng đuôi mờ (kiểu iOS trên 1 path).
1048
+ */
1049
+ .leaf-spinner[data-animation="fade"] .leaf-spinner__icon {
1050
+ animation: leaf-spinner-spin var(--leaf-spinner-duration) linear infinite;
1051
+ mask-image: conic-gradient(from 0deg, transparent 0%, #000 70%, #000 100%);
1052
+ -webkit-mask-image: conic-gradient(from 0deg, transparent 0%, #000 70%, #000 100%);
1053
+ }
1054
+
1055
+ /* pulse — scale nhịp. */
1056
+ .leaf-spinner[data-animation="pulse"] .leaf-spinner__icon {
1057
+ animation: leaf-spinner-pulse 1s ease-in-out infinite;
1058
+ }
1059
+
1060
+ /* breathe — mờ/đậm cả icon. */
1061
+ .leaf-spinner[data-animation="breathe"] .leaf-spinner__icon {
1062
+ animation: leaf-spinner-breathe 1.2s ease-in-out infinite;
1063
+ }
1064
+ }
1065
+
1066
+ @keyframes leaf-spinner-spin {
1067
+ to {
1068
+ transform: rotate(360deg);
1069
+ }
1070
+ }
1071
+
1072
+ @keyframes leaf-spinner-pulse {
1073
+ 0%,
1074
+ 100% {
1075
+ transform: scale(0.85);
1076
+ }
1077
+ 50% {
1078
+ transform: scale(1);
1079
+ }
1080
+ }
1081
+
1082
+ @keyframes leaf-spinner-breathe {
1083
+ 0%,
1084
+ 100% {
1085
+ opacity: 0.35;
1086
+ }
1087
+ 50% {
1088
+ opacity: 1;
1089
+ }
1090
+ }
1091
+
1092
+ /* --- src/components/Tabs/tabs.css --- */
1093
+
1094
+ /*
1095
+ * Tabs — Figma 712:6996 (Tabs Items).
619
1096
  *
620
- * ─ Vì sao `@layer utilities` ─────────────────────────────────────────────────
1097
+ * `variant` map type trong Figma: subcontent | title | functional | buy | sell.
1098
+ * Size: xl | lg | md | sm (tuỳ variant — Title chỉ S, Functional chỉ M, Buy/Sell chỉ L).
1099
+ * Subcontent XL/LG selected = --base-quinary; MD/SM selected = --base-tertiary.
621
1100
  *
622
- * Màu của Leaf là token gốc, trùng tên thì phải thắng. Đặt chung layer với
623
- * utility của Tailwind, và app import file này SAU `@import "tailwindcss"`, nên
624
- * khi app cũng khai báo `--color-primary` / `--color-red` trong `@theme` thì
625
- * `.text-primary` của Leaf (cùng specificity, đứng sau) là cái có hiệu lực.
1101
+ * Variant / size đặt trên tablist (`.leaf-tabs[data-variant][data-size]`), từng
1102
+ * `.leaf-tab` chỉ cần `aria-selected`. Toàn bộ hình thức (kể cả typography của
1103
+ * label) nằm ở đây — React và `leaf.js` chỉ gắn attribute, nên HTML tĩnh viết
1104
+ * cùng markup là ra cùng kết quả.
626
1105
  *
627
- * Biến thể trạng thái vẫn override được vì pseudo-class cộng thêm specificity:
628
- * `hover:text-[var(--text-highlight)]`, `focus:…` thắng bình thường. Riêng biến
629
- * thể responsive (`md:`, `lg:`) cùng specificity và được Tailwind ghi ra trước
630
- * file này nên phải thêm important modifier: `md:text-[var(--text-secondary)]!`.
1106
+ * Mặc định khi thiếu attribute: variant subcontent, size xl. Chỉ Subcontent đổi
1107
+ * theo size; các variant khác có một size duy nhất nên không đọc `data-size`.
631
1108
  */
632
1109
 
633
- @layer utilities {
634
- /* Text color — content */
1110
+ @layer components {
1111
+ .leaf-tabs {
1112
+ /* Kích thước của Subcontent — mặc định xl, đổi theo data-size bên dưới. */
1113
+ --leaf-tab-padding: 12px 16px;
1114
+ --leaf-tab-gap: 8px;
1115
+ --leaf-tab-font-size: var(--body-3-size);
1116
+ --leaf-tab-line-height: var(--body-3-line-height);
1117
+ --leaf-tab-font-weight: var(--body-3-highlight-weight);
1118
+
1119
+ display: flex;
1120
+ flex-wrap: wrap;
1121
+ align-items: center;
1122
+ gap: 12px;
1123
+ }
1124
+
1125
+ .leaf-tabs[data-size="lg"] {
1126
+ --leaf-tab-padding: 8px 16px;
1127
+ --leaf-tab-gap: 8px;
1128
+ --leaf-tab-font-size: var(--body-4-size);
1129
+ --leaf-tab-line-height: var(--body-4-line-height);
1130
+ --leaf-tab-font-weight: var(--body-4-highlight-weight);
1131
+ }
1132
+
1133
+ .leaf-tabs[data-size="md"] {
1134
+ --leaf-tab-padding: 4px 12px;
1135
+ --leaf-tab-gap: normal;
1136
+ --leaf-tab-font-size: var(--body-4-size);
1137
+ --leaf-tab-line-height: var(--body-4-line-height);
1138
+ --leaf-tab-font-weight: var(--body-4-weight);
1139
+ }
1140
+
1141
+ .leaf-tabs[data-size="sm"] {
1142
+ --leaf-tab-padding: 4px 12px;
1143
+ --leaf-tab-gap: normal;
1144
+ --leaf-tab-font-size: var(--body-5-size);
1145
+ --leaf-tab-line-height: var(--body-5-line-height);
1146
+ --leaf-tab-font-weight: var(--body-5-weight);
1147
+ }
1148
+
1149
+ .leaf-tab {
1150
+ display: inline-flex;
1151
+ align-items: center;
1152
+ justify-content: center;
1153
+ border: none;
1154
+ margin: 0;
1155
+ padding: 0;
1156
+ cursor: pointer;
1157
+ background-color: transparent;
1158
+ color: inherit;
1159
+ font: inherit;
1160
+ font-family: var(--font-sans);
1161
+ text-align: center;
1162
+ white-space: nowrap;
1163
+ box-sizing: border-box;
1164
+ }
1165
+
1166
+ .leaf-tab:disabled,
1167
+ .leaf-tab[aria-disabled="true"] {
1168
+ cursor: not-allowed;
1169
+ }
1170
+
1171
+ .leaf-tab__label {
1172
+ display: inline-flex;
1173
+ align-items: center;
1174
+ justify-content: center;
1175
+ line-height: inherit;
1176
+ }
1177
+
1178
+ /* ── Subcontent (pill) — cũng là mặc định khi không có data-variant ──── */
1179
+ /* XL / LG: idle tertiary · selected quinary. MD / SM: idle trong suốt · selected tertiary. */
1180
+
1181
+ .leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]) .leaf-tab {
1182
+ gap: var(--leaf-tab-gap);
1183
+ padding: var(--leaf-tab-padding);
1184
+ border-radius: 1000px;
1185
+ background-color: var(--base-tertiary);
1186
+ color: var(--text-secondary);
1187
+ font-size: var(--leaf-tab-font-size);
1188
+ line-height: var(--leaf-tab-line-height);
1189
+ font-weight: var(--leaf-tab-font-weight);
1190
+ }
1191
+
1192
+ .leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"])
1193
+ .leaf-tab[aria-selected="true"] {
1194
+ background-color: var(--base-quinary);
1195
+ color: var(--text-quaternary);
1196
+ }
1197
+
1198
+ .leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]) .leaf-tab:disabled,
1199
+ .leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"])
1200
+ .leaf-tab[aria-disabled="true"] {
1201
+ background-color: var(--base-tertiary);
1202
+ color: var(--text-tertiary);
1203
+ }
1204
+
1205
+ .leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
1206
+ [data-size="md"],
1207
+ [data-size="sm"]
1208
+ )
1209
+ .leaf-tab {
1210
+ background-color: transparent;
1211
+ }
1212
+
1213
+ .leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
1214
+ [data-size="md"],
1215
+ [data-size="sm"]
1216
+ )
1217
+ .leaf-tab[aria-selected="true"] {
1218
+ background-color: var(--base-tertiary);
1219
+ color: var(--text-primary);
1220
+ }
1221
+
1222
+ .leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
1223
+ [data-size="md"],
1224
+ [data-size="sm"]
1225
+ )
1226
+ .leaf-tab:disabled,
1227
+ .leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]):is(
1228
+ [data-size="md"],
1229
+ [data-size="sm"]
1230
+ )
1231
+ .leaf-tab[aria-disabled="true"] {
1232
+ background-color: transparent;
1233
+ color: var(--text-tertiary);
1234
+ }
1235
+
1236
+ /* ── Title (underline) ───────────────────────────────────────────────── */
1237
+
1238
+ .leaf-tabs[data-variant="title"] .leaf-tab {
1239
+ flex-direction: column;
1240
+ gap: 4px;
1241
+ min-width: 100px;
1242
+ color: var(--text-secondary);
1243
+ font-size: var(--body-4-size);
1244
+ line-height: var(--body-4-line-height);
1245
+ font-weight: var(--body-4-weight);
1246
+ }
1247
+
1248
+ .leaf-tabs[data-variant="title"] .leaf-tab[aria-selected="true"] {
1249
+ color: var(--text-primary);
1250
+ font-weight: var(--body-4-highlight-weight);
1251
+ }
1252
+
1253
+ .leaf-tabs[data-variant="title"] .leaf-tab::after {
1254
+ content: "";
1255
+ display: block;
1256
+ width: 100%;
1257
+ height: 2px;
1258
+ background-color: var(--text-primary);
1259
+ opacity: 0;
1260
+ }
1261
+
1262
+ .leaf-tabs[data-variant="title"] .leaf-tab[aria-selected="true"]::after {
1263
+ opacity: 1;
1264
+ }
1265
+
1266
+ .leaf-tabs[data-variant="title"] .leaf-tab:disabled,
1267
+ .leaf-tabs[data-variant="title"] .leaf-tab[aria-disabled="true"] {
1268
+ color: var(--text-tertiary);
1269
+ }
1270
+
1271
+ .leaf-tabs[data-variant="title"] .leaf-tab:disabled::after,
1272
+ .leaf-tabs[data-variant="title"] .leaf-tab[aria-disabled="true"]::after {
1273
+ opacity: 0;
1274
+ }
1275
+
1276
+ /* ── Functional ──────────────────────────────────────────────────────── */
1277
+
1278
+ .leaf-tabs[data-variant="functional"] .leaf-tab {
1279
+ height: 24px;
1280
+ min-width: 100px;
1281
+ padding: 4px 24px;
1282
+ border-radius: 100px;
1283
+ background-color: var(--base-tertiary);
1284
+ color: var(--button-disabled-content);
1285
+ font-size: var(--body-5-size);
1286
+ line-height: var(--body-5-line-height);
1287
+ font-weight: var(--body-5-weight);
1288
+ }
1289
+
1290
+ .leaf-tabs[data-variant="functional"] .leaf-tab[aria-selected="true"] {
1291
+ background-color: var(--button-base-primary);
1292
+ color: var(--button-content-primary);
1293
+ }
1294
+
1295
+ .leaf-tabs[data-variant="functional"] .leaf-tab:disabled,
1296
+ .leaf-tabs[data-variant="functional"] .leaf-tab[aria-disabled="true"] {
1297
+ background-color: var(--base-tertiary);
1298
+ color: var(--button-disabled-content);
1299
+ }
1300
+
1301
+ /* ── Buy / Sell ──────────────────────────────────────────────────────── */
1302
+
1303
+ .leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab {
1304
+ min-width: 100px;
1305
+ width: auto;
1306
+ padding: 6px 4px;
1307
+ border-radius: 100px;
1308
+ color: var(--text-primary);
1309
+ font-size: var(--body-5-size);
1310
+ line-height: var(--body-5-line-height);
1311
+ font-weight: var(--body-5-weight);
1312
+ }
1313
+
1314
+ .leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab[aria-selected="true"] {
1315
+ font-weight: var(--body-5-highlight-weight);
1316
+ }
1317
+
1318
+ .leaf-tabs[data-variant="buy"] .leaf-tab[aria-selected="true"] {
1319
+ background-color: var(--button-base-secondary);
1320
+ color: var(--text-highlight);
1321
+ }
1322
+
1323
+ .leaf-tabs[data-variant="sell"] .leaf-tab[aria-selected="true"] {
1324
+ background-color: var(--button-base-secondary-destruction);
1325
+ color: var(--button-base-destruction);
1326
+ }
1327
+
1328
+ .leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab:disabled,
1329
+ .leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab[aria-disabled="true"] {
1330
+ color: var(--text-tertiary);
1331
+ background-color: transparent;
1332
+ }
1333
+ }
1334
+
1335
+ /* --- src/components/Toggle/toggle.css --- */
1336
+
1337
+ /*
1338
+ * Toggle — Figma 730:12438.
1339
+ *
1340
+ * Size M/S qua data-size; Status On/Off qua aria-checked; Active Off qua
1341
+ * :disabled. Thumb trượt bằng transform. Checkmark chỉ hiện ở size sm khi
1342
+ * On + Active. Thiếu attribute → md · off · enabled.
1343
+ */
1344
+
1345
+ @layer components {
1346
+ .leaf-toggle {
1347
+ --leaf-toggle-width: 48px;
1348
+ --leaf-toggle-height: 24px;
1349
+ --leaf-toggle-padding: 3px;
1350
+ --leaf-toggle-thumb: 18px;
1351
+ --leaf-toggle-travel: calc(
1352
+ var(--leaf-toggle-width) - var(--leaf-toggle-padding) * 2 - var(--leaf-toggle-thumb)
1353
+ );
1354
+
1355
+ position: relative;
1356
+ display: inline-flex;
1357
+ flex-shrink: 0;
1358
+ align-items: center;
1359
+ box-sizing: border-box;
1360
+ width: var(--leaf-toggle-width);
1361
+ height: var(--leaf-toggle-height);
1362
+ margin: 0;
1363
+ padding: var(--leaf-toggle-padding);
1364
+ border: none;
1365
+ border-radius: 12px;
1366
+ background-color: var(--base-quaternary);
1367
+ cursor: pointer;
1368
+ vertical-align: middle;
1369
+ appearance: none;
1370
+ -webkit-appearance: none;
1371
+ font: inherit;
1372
+ color: inherit;
1373
+ transition: background-color 0.2s ease;
1374
+ }
1375
+
1376
+ .leaf-toggle__thumb {
1377
+ display: flex;
1378
+ align-items: center;
1379
+ justify-content: center;
1380
+ width: var(--leaf-toggle-thumb);
1381
+ height: var(--leaf-toggle-thumb);
1382
+ border-radius: 100px;
1383
+ background-color: var(--text-secondary);
1384
+ transform: translateX(0);
1385
+ transition:
1386
+ transform 0.2s ease,
1387
+ background-color 0.2s ease;
1388
+ }
1389
+
1390
+ .leaf-toggle__check {
1391
+ display: none;
1392
+ width: 60%;
1393
+ height: 60%;
1394
+ color: var(--system-green);
1395
+ }
1396
+
1397
+ /* Status On + Active — track xanh, thumb trắng, trượt phải. */
1398
+ .leaf-toggle[aria-checked="true"]:not(:disabled) {
1399
+ background-color: var(--system-green);
1400
+ }
1401
+
1402
+ .leaf-toggle[aria-checked="true"]:not(:disabled) .leaf-toggle__thumb {
1403
+ background-color: var(--icon-on-color);
1404
+ transform: translateX(var(--leaf-toggle-travel));
1405
+ }
1406
+
1407
+ /* Status On + Active Off (disabled on) — track quaternary, thumb tertiary, vẫn bên phải. */
1408
+ .leaf-toggle[aria-checked="true"]:disabled .leaf-toggle__thumb {
1409
+ background-color: var(--text-tertiary);
1410
+ transform: translateX(var(--leaf-toggle-travel));
1411
+ }
1412
+
1413
+ /* Status Off + Active Off — thumb tertiary, bên trái. */
1414
+ .leaf-toggle:disabled:not([aria-checked="true"]) .leaf-toggle__thumb {
1415
+ background-color: var(--text-tertiary);
1416
+ }
1417
+
1418
+ /* Size S */
1419
+ .leaf-toggle[data-size="sm"] {
1420
+ --leaf-toggle-width: 32px;
1421
+ --leaf-toggle-height: 16px;
1422
+ --leaf-toggle-thumb: 10px;
1423
+ }
1424
+
1425
+ /* Checkmark chỉ ở S · On · Active. */
1426
+ .leaf-toggle[data-size="sm"][aria-checked="true"]:not(:disabled) .leaf-toggle__check {
1427
+ display: block;
1428
+ }
1429
+
1430
+ .leaf-toggle:disabled {
1431
+ cursor: not-allowed;
1432
+ }
1433
+
1434
+ .leaf-toggle:focus-visible {
1435
+ outline: 2px solid var(--system-green);
1436
+ outline-offset: 2px;
1437
+ }
1438
+ }
1439
+
1440
+ /* --- src/components/Tooltip/tooltip.css --- */
1441
+
1442
+ /*
1443
+ * Tooltip — Figma 891:4983.
1444
+ *
1445
+ * Size sm/md/lg; position top/bottom/left/right; align start/center/end.
1446
+ * Nền --base-quaternary; chữ --text-primary.
1447
+ *
1448
+ * Caret Figma: khung hit-area rộng (40×4 / 44×6 / 16×4) nhưng tam giác thật
1449
+ * chỉ 8×4 (sm) hoặc 12×6 (md/lg) nằm giữa khung — không vẽ full-width.
1450
+ */
1451
+
1452
+ @layer components {
1453
+ .leaf-tooltip-trigger {
1454
+ position: relative;
1455
+ display: inline-flex;
1456
+ max-width: 100%;
1457
+ vertical-align: middle;
1458
+ }
1459
+
1460
+ .leaf-tooltip {
1461
+ --leaf-tooltip-pad-y: 8px;
1462
+ --leaf-tooltip-pad-x: 16px;
1463
+ --leaf-tooltip-radius: 8px;
1464
+ --leaf-tooltip-max-width: 176px;
1465
+ --leaf-tooltip-font-size: var(--body-4-size);
1466
+ --leaf-tooltip-line-height: var(--body-4-line-height);
1467
+ --leaf-tooltip-font-weight: var(--body-4-weight);
1468
+ /* Khung caret dọc theo cạnh (top/bottom). */
1469
+ --leaf-tooltip-caret-w: 44px;
1470
+ --leaf-tooltip-caret-h: 6px;
1471
+ /* Chiều rộng tam giác thật trong khung. */
1472
+ --leaf-tooltip-caret-tip: 12px;
1473
+
1474
+ display: inline-flex;
1475
+ flex-direction: column;
1476
+ align-items: center;
1477
+ max-width: var(--leaf-tooltip-max-width);
1478
+ box-sizing: border-box;
1479
+ font-family: var(--font-sans);
1480
+ font-size: var(--leaf-tooltip-font-size);
1481
+ line-height: var(--leaf-tooltip-line-height);
1482
+ font-weight: var(--leaf-tooltip-font-weight);
1483
+ color: var(--text-primary);
1484
+ pointer-events: none;
1485
+ }
1486
+
1487
+ .leaf-tooltip--portal {
1488
+ position: fixed;
1489
+ z-index: var(--leaf-z-tooltip, 110);
1490
+ }
1491
+
1492
+ /* `display` của .leaf-tooltip thắng `[hidden]` của trình duyệt — bản vanilla ẩn bubble bằng hidden. */
1493
+ .leaf-tooltip[hidden] {
1494
+ display: none;
1495
+ }
1496
+
1497
+ .leaf-tooltip__body {
1498
+ position: relative;
1499
+ z-index: 1;
1500
+ box-sizing: border-box;
1501
+ max-width: 100%;
1502
+ padding: var(--leaf-tooltip-pad-y) var(--leaf-tooltip-pad-x);
1503
+ border-radius: var(--leaf-tooltip-radius);
1504
+ background-color: var(--base-quaternary);
1505
+ text-align: left;
1506
+ word-break: break-word;
1507
+ }
1508
+
1509
+ /*
1510
+ * Caret = khung trong suốt + ::before là tam giác nhỏ ở giữa (đúng SVG Figma).
1511
+ * Mặc định: mũi nhọn xuống (position=top — caret dưới body).
1512
+ */
1513
+ .leaf-tooltip__caret {
1514
+ position: relative;
1515
+ display: block;
1516
+ flex-shrink: 0;
1517
+ width: var(--leaf-tooltip-caret-w);
1518
+ height: var(--leaf-tooltip-caret-h);
1519
+ background-color: transparent;
1520
+ }
1521
+
1522
+ .leaf-tooltip__caret::before {
1523
+ content: "";
1524
+ position: absolute;
1525
+ top: 0;
1526
+ left: 50%;
1527
+ width: var(--leaf-tooltip-caret-tip);
1528
+ height: 100%;
1529
+ background-color: var(--base-quaternary);
1530
+ transform: translateX(-50%);
1531
+ clip-path: polygon(0 0, 100% 0, 50% 100%);
1532
+ }
1533
+
1534
+ /* ── Size ────────────────────────────────────────────────────────────── */
1535
+
1536
+ .leaf-tooltip[data-size="sm"] {
1537
+ --leaf-tooltip-pad-y: 2px;
1538
+ --leaf-tooltip-pad-x: 16px;
1539
+ --leaf-tooltip-radius: 4px;
1540
+ --leaf-tooltip-max-width: 208px;
1541
+ --leaf-tooltip-font-size: var(--body-5-size);
1542
+ --leaf-tooltip-line-height: var(--body-5-line-height);
1543
+ --leaf-tooltip-font-weight: var(--body-5-weight);
1544
+ --leaf-tooltip-caret-w: 40px;
1545
+ --leaf-tooltip-caret-h: 4px;
1546
+ --leaf-tooltip-caret-tip: 8px;
1547
+ min-width: 64px;
1548
+ }
1549
+
1550
+ .leaf-tooltip[data-size="lg"] {
1551
+ --leaf-tooltip-pad-y: 16px;
1552
+ --leaf-tooltip-pad-x: 16px;
1553
+ --leaf-tooltip-radius: 12px;
1554
+ --leaf-tooltip-max-width: 288px;
1555
+ --leaf-tooltip-font-size: var(--body-3-size);
1556
+ --leaf-tooltip-line-height: var(--body-3-line-height);
1557
+ --leaf-tooltip-font-weight: var(--body-3-weight);
1558
+ --leaf-tooltip-caret-w: 44px;
1559
+ --leaf-tooltip-caret-h: 6px;
1560
+ --leaf-tooltip-caret-tip: 12px;
1561
+ }
1562
+
1563
+ /* Sm left/right: khung caret 16×4 (Figma), không dùng 40×4 của top/bottom. */
1564
+ .leaf-tooltip[data-size="sm"][data-position="left"],
1565
+ .leaf-tooltip[data-size="sm"][data-position="right"] {
1566
+ --leaf-tooltip-caret-w: 16px;
1567
+ }
1568
+
1569
+ /* ── Position ────────────────────────────────────────────────────────── */
1570
+
1571
+ /*
1572
+ * Vị trí caret theo data-position (không theo thứ tự DOM): markup vẫn đặt caret
1573
+ * đúng phía nên kết quả không đổi, nhưng khi bubble tự lật phía (thiếu chỗ) thì
1574
+ * chỉ cần đổi data-position là caret sang phía đối diện.
1575
+ */
1576
+ .leaf-tooltip:is(:not([data-position]), [data-position="top"], [data-position="left"])
1577
+ > .leaf-tooltip__caret {
1578
+ order: 1;
1579
+ }
1580
+
1581
+ .leaf-tooltip:is([data-position="bottom"], [data-position="right"]) > .leaf-tooltip__caret {
1582
+ order: -1;
1583
+ }
1584
+
1585
+ .leaf-tooltip[data-position="bottom"] {
1586
+ flex-direction: column;
1587
+ }
1588
+
1589
+ .leaf-tooltip[data-position="bottom"] .leaf-tooltip__caret::before {
1590
+ clip-path: polygon(50% 0, 0 100%, 100% 100%);
1591
+ }
1592
+
1593
+ .leaf-tooltip[data-position="left"] {
1594
+ flex-direction: row;
1595
+ align-items: center;
1596
+ }
1597
+
1598
+ .leaf-tooltip[data-position="left"] .leaf-tooltip__caret {
1599
+ width: var(--leaf-tooltip-caret-h);
1600
+ height: var(--leaf-tooltip-caret-w);
1601
+ }
1602
+
1603
+ .leaf-tooltip[data-position="left"] .leaf-tooltip__caret::before {
1604
+ top: 50%;
1605
+ left: 0;
1606
+ width: 100%;
1607
+ height: var(--leaf-tooltip-caret-tip);
1608
+ transform: translateY(-50%);
1609
+ clip-path: polygon(0 0, 100% 50%, 0 100%);
1610
+ }
1611
+
1612
+ .leaf-tooltip[data-position="right"] {
1613
+ flex-direction: row;
1614
+ align-items: center;
1615
+ }
1616
+
1617
+ .leaf-tooltip[data-position="right"] .leaf-tooltip__caret {
1618
+ width: var(--leaf-tooltip-caret-h);
1619
+ height: var(--leaf-tooltip-caret-w);
1620
+ }
1621
+
1622
+ .leaf-tooltip[data-position="right"] .leaf-tooltip__caret::before {
1623
+ top: 50%;
1624
+ left: 0;
1625
+ width: 100%;
1626
+ height: var(--leaf-tooltip-caret-tip);
1627
+ transform: translateY(-50%);
1628
+ clip-path: polygon(100% 0, 0 50%, 100% 100%);
1629
+ }
1630
+
1631
+ /* ── Align (caret trên Top/Bottom) ───────────────────────────────────── */
1632
+
1633
+ .leaf-tooltip[data-position="top"][data-align="start"],
1634
+ .leaf-tooltip[data-position="bottom"][data-align="start"] {
1635
+ align-items: flex-start;
1636
+ }
1637
+
1638
+ .leaf-tooltip[data-position="top"][data-align="end"],
1639
+ .leaf-tooltip[data-position="bottom"][data-align="end"] {
1640
+ align-items: flex-end;
1641
+ }
1642
+
1643
+ .leaf-tooltip[data-position="top"][data-align="center"],
1644
+ .leaf-tooltip[data-position="bottom"][data-align="center"] {
1645
+ align-items: center;
1646
+ }
1647
+ }
1648
+
1649
+ /* --- src/styles/border.css --- */
1650
+
1651
+ /*
1652
+ * Border radius classes — map 1:1 sang --radius-* trong @finhay/leaf-tokens
1653
+ * (Figma 700:4390).
1654
+ *
1655
+ * Tên class `radius-*` (không dùng `rounded-*`) để không đụng utility bo góc mặc
1656
+ * định của Tailwind (`rounded-xl`…). `border-*` đã dành cho màu viền.
1657
+ *
1658
+ * Hậu tố = bậc token: 0 · xs · s · m · l · xl · 2xl.
1659
+ * Chỉ set border-radius — width / style / color do app tự lo.
1660
+ */
1661
+
1662
+ @layer utilities {
1663
+ .radius-0 {
1664
+ border-radius: var(--radius-0);
1665
+ }
1666
+
1667
+ .radius-xs {
1668
+ border-radius: var(--radius-xs);
1669
+ }
1670
+
1671
+ .radius-s {
1672
+ border-radius: var(--radius-s);
1673
+ }
1674
+
1675
+ .radius-m {
1676
+ border-radius: var(--radius-m);
1677
+ }
1678
+
1679
+ .radius-l {
1680
+ border-radius: var(--radius-l);
1681
+ }
1682
+
1683
+ .radius-xl {
1684
+ border-radius: var(--radius-xl);
1685
+ }
1686
+
1687
+ .radius-2xl {
1688
+ border-radius: var(--radius-2xl);
1689
+ }
1690
+ }
1691
+
1692
+ /* --- src/styles/color.css --- */
1693
+
1694
+ /*
1695
+ * Color classes — map 1:1 sang semantic token trong @finhay/leaf-tokens.
1696
+ *
1697
+ * Quy tắc tên: **tiền tố nói thuộc tính, phần sau nói vai trò của token**.
1698
+ *
1699
+ * text-* → color (text-primary, text-red)
1700
+ * base-* → background-color (base-primary, base-red)
1701
+ * border-* → border-color (border-primary, border-red)
1702
+ *
1703
+ * Ba bộ dùng chung một hậu tố nên đọc là đoán được: `text-red` / `base-red` /
1704
+ * `border-red`, `text-primary` / `base-primary` / `border-primary`. Nhóm system
1705
+ * bỏ chữ `system` trong tên class (token vẫn là `--system-red`), còn `border-*`
1706
+ * lấy màu từ thang base vì viền luôn là màu bề mặt.
1707
+ *
1708
+ * Mỗi class chỉ set đúng 1 thuộc tính (color / background-color / border-color)
1709
+ * — border-width và border-style do app tự lo. Class tự đổi giá trị theo
1710
+ * `[data-theme="light"]` vì nó trỏ vào var, không hard-code màu.
1711
+ *
1712
+ * Chỉ semantic token mới có class. Primitive (--neutral-500, --brand-300…) là
1713
+ * nguồn nội bộ, không dùng thẳng trong UI.
1714
+ *
1715
+ * ─ Vì sao `@layer utilities` ─────────────────────────────────────────────────
1716
+ *
1717
+ * Màu của Leaf là token gốc, trùng tên thì phải thắng. Đặt chung layer với
1718
+ * utility của Tailwind, và app import file này SAU `@import "tailwindcss"`, nên
1719
+ * khi app cũng khai báo `--color-primary` / `--color-red` trong `@theme` thì
1720
+ * `.text-primary` của Leaf (cùng specificity, đứng sau) là cái có hiệu lực.
1721
+ *
1722
+ * Biến thể trạng thái vẫn override được vì pseudo-class cộng thêm specificity:
1723
+ * `hover:text-[var(--text-highlight)]`, `focus:…` thắng bình thường. Riêng biến
1724
+ * thể responsive (`md:`, `lg:`) cùng specificity và được Tailwind ghi ra trước
1725
+ * file này nên phải thêm important modifier: `md:text-[var(--text-secondary)]!`.
1726
+ */
1727
+
1728
+ @layer utilities {
1729
+ /* Text color — content */
1730
+
1731
+ .text-highlight {
1732
+ color: var(--text-highlight);
1733
+ }
1734
+
1735
+ .text-primary {
1736
+ color: var(--text-primary);
1737
+ }
1738
+
1739
+ .text-secondary {
1740
+ color: var(--text-secondary);
1741
+ }
1742
+
1743
+ .text-tertiary {
1744
+ color: var(--text-tertiary);
1745
+ }
1746
+
1747
+ .text-quaternary {
1748
+ color: var(--text-quaternary);
1749
+ }
1750
+
1751
+ /* Text color — system */
1752
+
1753
+ .text-blue {
1754
+ color: var(--system-blue);
1755
+ }
1756
+
1757
+ .text-green {
1758
+ color: var(--system-green);
1759
+ }
1760
+
1761
+ .text-yellow {
1762
+ color: var(--system-yellow);
1763
+ }
1764
+
1765
+ .text-orange {
1766
+ color: var(--system-orange);
1767
+ }
1768
+
1769
+ .text-red {
1770
+ color: var(--system-red);
1771
+ }
1772
+
1773
+ .text-purple {
1774
+ color: var(--system-purple);
1775
+ }
1776
+
1777
+ /* Background — base */
1778
+
1779
+ .base-highlight {
1780
+ background-color: var(--text-highlight);
1781
+ }
1782
+
1783
+ .base-primary {
1784
+ background-color: var(--base-primary);
1785
+ }
1786
+
1787
+ .base-secondary {
1788
+ background-color: var(--base-secondary);
1789
+ }
1790
+
1791
+ .base-tertiary {
1792
+ background-color: var(--base-tertiary);
1793
+ }
1794
+
1795
+ .base-quaternary {
1796
+ background-color: var(--base-quaternary);
1797
+ }
1798
+
1799
+ .base-quinary {
1800
+ background-color: var(--base-quinary);
1801
+ }
1802
+
1803
+ /* Background — system */
1804
+
1805
+ .base-blue {
1806
+ background-color: var(--system-blue);
1807
+ }
1808
+
1809
+ .base-green {
1810
+ background-color: var(--system-green);
1811
+ }
1812
+
1813
+ .base-yellow {
1814
+ background-color: var(--system-yellow);
1815
+ }
1816
+
1817
+ .base-orange {
1818
+ background-color: var(--system-orange);
1819
+ }
1820
+
1821
+ .base-red {
1822
+ background-color: var(--system-red);
1823
+ }
1824
+
1825
+ .base-purple {
1826
+ background-color: var(--system-purple);
1827
+ }
1828
+
1829
+ /* Border color — base */
1830
+
1831
+ .border-highlight {
1832
+ border-color: var(--text-highlight);
1833
+ }
1834
+
1835
+ .border-primary {
1836
+ border-color: var(--base-primary);
1837
+ }
1838
+
1839
+ .border-secondary {
1840
+ border-color: var(--base-secondary);
1841
+ }
1842
+
1843
+ .border-tertiary {
1844
+ border-color: var(--base-tertiary);
1845
+ }
1846
+
1847
+ .border-quaternary {
1848
+ border-color: var(--base-quaternary);
1849
+ }
1850
+
1851
+ .border-quinary {
1852
+ border-color: var(--base-quinary);
1853
+ }
1854
+
1855
+ /* Border color — system */
1856
+
1857
+ .border-blue {
1858
+ border-color: var(--system-blue);
1859
+ }
1860
+
1861
+ .border-green {
1862
+ border-color: var(--system-green);
1863
+ }
1864
+
1865
+ .border-yellow {
1866
+ border-color: var(--system-yellow);
1867
+ }
1868
+
1869
+ .border-orange {
1870
+ border-color: var(--system-orange);
1871
+ }
1872
+
1873
+ .border-red {
1874
+ border-color: var(--system-red);
1875
+ }
1876
+
1877
+ .border-purple {
1878
+ border-color: var(--system-purple);
1879
+ }
1880
+ }
1881
+
1882
+ /* --- src/styles/spacing.css --- */
1883
+
1884
+ /*
1885
+ * Spacing classes — map 1:1 sang --spacing-* trong @finhay/leaf-tokens (Figma 34:1034).
1886
+ *
1887
+ * Tiền tố = thuộc tính (giống color): p-* / m-* / gap-* (+ biến thể hướng).
1888
+ * Hậu tố = bậc token: 0 · xs · s · m · l · xl · 2xl … 7xl.
1889
+ *
1890
+ * Chỉ set đúng 1 thuộc tính spacing — không đụng width/height/radius.
1891
+ * Nằm trong @layer utilities để Leaf thắng khi trùng tên với utility Tailwind
1892
+ * (import sau @import "tailwindcss"), giống color.css.
1893
+ */
1894
+
1895
+ @layer utilities {
1896
+ /* Padding */
1897
+
1898
+ .p-0 {
1899
+ padding: var(--spacing-0);
1900
+ }
1901
+
1902
+ .p-xs {
1903
+ padding: var(--spacing-xs);
1904
+ }
1905
+
1906
+ .p-s {
1907
+ padding: var(--spacing-s);
1908
+ }
1909
+
1910
+ .p-m {
1911
+ padding: var(--spacing-m);
1912
+ }
1913
+
1914
+ .p-l {
1915
+ padding: var(--spacing-l);
1916
+ }
1917
+
1918
+ .p-xl {
1919
+ padding: var(--spacing-xl);
1920
+ }
1921
+
1922
+ .p-2xl {
1923
+ padding: var(--spacing-2xl);
1924
+ }
1925
+
1926
+ .p-3xl {
1927
+ padding: var(--spacing-3xl);
1928
+ }
1929
+
1930
+ .p-4xl {
1931
+ padding: var(--spacing-4xl);
1932
+ }
1933
+
1934
+ .p-5xl {
1935
+ padding: var(--spacing-5xl);
1936
+ }
1937
+
1938
+ .p-6xl {
1939
+ padding: var(--spacing-6xl);
1940
+ }
1941
+
1942
+ .p-7xl {
1943
+ padding: var(--spacing-7xl);
1944
+ }
1945
+
1946
+ .px-0 {
1947
+ padding-inline: var(--spacing-0);
1948
+ }
1949
+
1950
+ .px-xs {
1951
+ padding-inline: var(--spacing-xs);
1952
+ }
1953
+
1954
+ .px-s {
1955
+ padding-inline: var(--spacing-s);
1956
+ }
1957
+
1958
+ .px-m {
1959
+ padding-inline: var(--spacing-m);
1960
+ }
1961
+
1962
+ .px-l {
1963
+ padding-inline: var(--spacing-l);
1964
+ }
1965
+
1966
+ .px-xl {
1967
+ padding-inline: var(--spacing-xl);
1968
+ }
1969
+
1970
+ .px-2xl {
1971
+ padding-inline: var(--spacing-2xl);
1972
+ }
1973
+
1974
+ .px-3xl {
1975
+ padding-inline: var(--spacing-3xl);
1976
+ }
1977
+
1978
+ .px-4xl {
1979
+ padding-inline: var(--spacing-4xl);
1980
+ }
1981
+
1982
+ .px-5xl {
1983
+ padding-inline: var(--spacing-5xl);
1984
+ }
1985
+
1986
+ .px-6xl {
1987
+ padding-inline: var(--spacing-6xl);
1988
+ }
1989
+
1990
+ .px-7xl {
1991
+ padding-inline: var(--spacing-7xl);
1992
+ }
1993
+
1994
+ .py-0 {
1995
+ padding-block: var(--spacing-0);
1996
+ }
1997
+
1998
+ .py-xs {
1999
+ padding-block: var(--spacing-xs);
2000
+ }
2001
+
2002
+ .py-s {
2003
+ padding-block: var(--spacing-s);
2004
+ }
2005
+
2006
+ .py-m {
2007
+ padding-block: var(--spacing-m);
2008
+ }
2009
+
2010
+ .py-l {
2011
+ padding-block: var(--spacing-l);
2012
+ }
2013
+
2014
+ .py-xl {
2015
+ padding-block: var(--spacing-xl);
2016
+ }
2017
+
2018
+ .py-2xl {
2019
+ padding-block: var(--spacing-2xl);
2020
+ }
2021
+
2022
+ .py-3xl {
2023
+ padding-block: var(--spacing-3xl);
2024
+ }
2025
+
2026
+ .py-4xl {
2027
+ padding-block: var(--spacing-4xl);
2028
+ }
2029
+
2030
+ .py-5xl {
2031
+ padding-block: var(--spacing-5xl);
2032
+ }
2033
+
2034
+ .py-6xl {
2035
+ padding-block: var(--spacing-6xl);
2036
+ }
2037
+
2038
+ .py-7xl {
2039
+ padding-block: var(--spacing-7xl);
2040
+ }
2041
+
2042
+ .pt-0 {
2043
+ padding-top: var(--spacing-0);
2044
+ }
2045
+
2046
+ .pt-xs {
2047
+ padding-top: var(--spacing-xs);
2048
+ }
2049
+
2050
+ .pt-s {
2051
+ padding-top: var(--spacing-s);
2052
+ }
2053
+
2054
+ .pt-m {
2055
+ padding-top: var(--spacing-m);
2056
+ }
2057
+
2058
+ .pt-l {
2059
+ padding-top: var(--spacing-l);
2060
+ }
2061
+
2062
+ .pt-xl {
2063
+ padding-top: var(--spacing-xl);
2064
+ }
2065
+
2066
+ .pt-2xl {
2067
+ padding-top: var(--spacing-2xl);
2068
+ }
2069
+
2070
+ .pt-3xl {
2071
+ padding-top: var(--spacing-3xl);
2072
+ }
2073
+
2074
+ .pt-4xl {
2075
+ padding-top: var(--spacing-4xl);
2076
+ }
2077
+
2078
+ .pt-5xl {
2079
+ padding-top: var(--spacing-5xl);
2080
+ }
2081
+
2082
+ .pt-6xl {
2083
+ padding-top: var(--spacing-6xl);
2084
+ }
2085
+
2086
+ .pt-7xl {
2087
+ padding-top: var(--spacing-7xl);
2088
+ }
2089
+
2090
+ .pr-0 {
2091
+ padding-right: var(--spacing-0);
2092
+ }
2093
+
2094
+ .pr-xs {
2095
+ padding-right: var(--spacing-xs);
2096
+ }
2097
+
2098
+ .pr-s {
2099
+ padding-right: var(--spacing-s);
2100
+ }
2101
+
2102
+ .pr-m {
2103
+ padding-right: var(--spacing-m);
2104
+ }
2105
+
2106
+ .pr-l {
2107
+ padding-right: var(--spacing-l);
2108
+ }
2109
+
2110
+ .pr-xl {
2111
+ padding-right: var(--spacing-xl);
2112
+ }
2113
+
2114
+ .pr-2xl {
2115
+ padding-right: var(--spacing-2xl);
2116
+ }
2117
+
2118
+ .pr-3xl {
2119
+ padding-right: var(--spacing-3xl);
2120
+ }
2121
+
2122
+ .pr-4xl {
2123
+ padding-right: var(--spacing-4xl);
2124
+ }
2125
+
2126
+ .pr-5xl {
2127
+ padding-right: var(--spacing-5xl);
2128
+ }
2129
+
2130
+ .pr-6xl {
2131
+ padding-right: var(--spacing-6xl);
2132
+ }
2133
+
2134
+ .pr-7xl {
2135
+ padding-right: var(--spacing-7xl);
2136
+ }
2137
+
2138
+ .pb-0 {
2139
+ padding-bottom: var(--spacing-0);
2140
+ }
2141
+
2142
+ .pb-xs {
2143
+ padding-bottom: var(--spacing-xs);
2144
+ }
2145
+
2146
+ .pb-s {
2147
+ padding-bottom: var(--spacing-s);
2148
+ }
2149
+
2150
+ .pb-m {
2151
+ padding-bottom: var(--spacing-m);
2152
+ }
2153
+
2154
+ .pb-l {
2155
+ padding-bottom: var(--spacing-l);
2156
+ }
2157
+
2158
+ .pb-xl {
2159
+ padding-bottom: var(--spacing-xl);
2160
+ }
2161
+
2162
+ .pb-2xl {
2163
+ padding-bottom: var(--spacing-2xl);
2164
+ }
2165
+
2166
+ .pb-3xl {
2167
+ padding-bottom: var(--spacing-3xl);
2168
+ }
2169
+
2170
+ .pb-4xl {
2171
+ padding-bottom: var(--spacing-4xl);
2172
+ }
2173
+
2174
+ .pb-5xl {
2175
+ padding-bottom: var(--spacing-5xl);
2176
+ }
2177
+
2178
+ .pb-6xl {
2179
+ padding-bottom: var(--spacing-6xl);
2180
+ }
2181
+
2182
+ .pb-7xl {
2183
+ padding-bottom: var(--spacing-7xl);
2184
+ }
2185
+
2186
+ .pl-0 {
2187
+ padding-left: var(--spacing-0);
2188
+ }
2189
+
2190
+ .pl-xs {
2191
+ padding-left: var(--spacing-xs);
2192
+ }
2193
+
2194
+ .pl-s {
2195
+ padding-left: var(--spacing-s);
2196
+ }
2197
+
2198
+ .pl-m {
2199
+ padding-left: var(--spacing-m);
2200
+ }
2201
+
2202
+ .pl-l {
2203
+ padding-left: var(--spacing-l);
2204
+ }
2205
+
2206
+ .pl-xl {
2207
+ padding-left: var(--spacing-xl);
2208
+ }
2209
+
2210
+ .pl-2xl {
2211
+ padding-left: var(--spacing-2xl);
2212
+ }
2213
+
2214
+ .pl-3xl {
2215
+ padding-left: var(--spacing-3xl);
2216
+ }
635
2217
 
636
- .text-highlight {
637
- color: var(--text-highlight);
2218
+ .pl-4xl {
2219
+ padding-left: var(--spacing-4xl);
638
2220
  }
639
2221
 
640
- .text-primary {
641
- color: var(--text-primary);
2222
+ .pl-5xl {
2223
+ padding-left: var(--spacing-5xl);
642
2224
  }
643
2225
 
644
- .text-secondary {
645
- color: var(--text-secondary);
2226
+ .pl-6xl {
2227
+ padding-left: var(--spacing-6xl);
646
2228
  }
647
2229
 
648
- .text-tertiary {
649
- color: var(--text-tertiary);
2230
+ .pl-7xl {
2231
+ padding-left: var(--spacing-7xl);
650
2232
  }
651
2233
 
652
- .text-quaternary {
653
- color: var(--text-quaternary);
2234
+ /* Margin */
2235
+
2236
+ .m-0 {
2237
+ margin: var(--spacing-0);
654
2238
  }
655
2239
 
656
- /* Text color — system */
2240
+ .m-xs {
2241
+ margin: var(--spacing-xs);
2242
+ }
657
2243
 
658
- .text-blue {
659
- color: var(--system-blue);
2244
+ .m-s {
2245
+ margin: var(--spacing-s);
660
2246
  }
661
2247
 
662
- .text-green {
663
- color: var(--system-green);
2248
+ .m-m {
2249
+ margin: var(--spacing-m);
664
2250
  }
665
2251
 
666
- .text-yellow {
667
- color: var(--system-yellow);
2252
+ .m-l {
2253
+ margin: var(--spacing-l);
668
2254
  }
669
2255
 
670
- .text-orange {
671
- color: var(--system-orange);
2256
+ .m-xl {
2257
+ margin: var(--spacing-xl);
672
2258
  }
673
2259
 
674
- .text-red {
675
- color: var(--system-red);
2260
+ .m-2xl {
2261
+ margin: var(--spacing-2xl);
676
2262
  }
677
2263
 
678
- .text-purple {
679
- color: var(--system-purple);
2264
+ .m-3xl {
2265
+ margin: var(--spacing-3xl);
680
2266
  }
681
2267
 
682
- /* Background — base */
2268
+ .m-4xl {
2269
+ margin: var(--spacing-4xl);
2270
+ }
683
2271
 
684
- .base-highlight {
685
- background-color: var(--text-highlight);
2272
+ .m-5xl {
2273
+ margin: var(--spacing-5xl);
686
2274
  }
687
2275
 
688
- .base-primary {
689
- background-color: var(--base-primary);
2276
+ .m-6xl {
2277
+ margin: var(--spacing-6xl);
690
2278
  }
691
2279
 
692
- .base-secondary {
693
- background-color: var(--base-secondary);
2280
+ .m-7xl {
2281
+ margin: var(--spacing-7xl);
694
2282
  }
695
2283
 
696
- .base-tertiary {
697
- background-color: var(--base-tertiary);
2284
+ .mx-0 {
2285
+ margin-inline: var(--spacing-0);
698
2286
  }
699
2287
 
700
- .base-quaternary {
701
- background-color: var(--base-quaternary);
2288
+ .mx-xs {
2289
+ margin-inline: var(--spacing-xs);
702
2290
  }
703
2291
 
704
- .base-quinary {
705
- background-color: var(--base-quinary);
2292
+ .mx-s {
2293
+ margin-inline: var(--spacing-s);
706
2294
  }
707
2295
 
708
- /* Background — system */
2296
+ .mx-m {
2297
+ margin-inline: var(--spacing-m);
2298
+ }
709
2299
 
710
- .base-blue {
711
- background-color: var(--system-blue);
2300
+ .mx-l {
2301
+ margin-inline: var(--spacing-l);
712
2302
  }
713
2303
 
714
- .base-green {
715
- background-color: var(--system-green);
2304
+ .mx-xl {
2305
+ margin-inline: var(--spacing-xl);
716
2306
  }
717
2307
 
718
- .base-yellow {
719
- background-color: var(--system-yellow);
2308
+ .mx-2xl {
2309
+ margin-inline: var(--spacing-2xl);
720
2310
  }
721
2311
 
722
- .base-orange {
723
- background-color: var(--system-orange);
2312
+ .mx-3xl {
2313
+ margin-inline: var(--spacing-3xl);
724
2314
  }
725
2315
 
726
- .base-red {
727
- background-color: var(--system-red);
2316
+ .mx-4xl {
2317
+ margin-inline: var(--spacing-4xl);
728
2318
  }
729
2319
 
730
- .base-purple {
731
- background-color: var(--system-purple);
2320
+ .mx-5xl {
2321
+ margin-inline: var(--spacing-5xl);
732
2322
  }
733
2323
 
734
- /* Border color — base */
2324
+ .mx-6xl {
2325
+ margin-inline: var(--spacing-6xl);
2326
+ }
735
2327
 
736
- .border-highlight {
737
- border-color: var(--text-highlight);
2328
+ .mx-7xl {
2329
+ margin-inline: var(--spacing-7xl);
738
2330
  }
739
2331
 
740
- .border-primary {
741
- border-color: var(--base-primary);
2332
+ .my-0 {
2333
+ margin-block: var(--spacing-0);
742
2334
  }
743
2335
 
744
- .border-secondary {
745
- border-color: var(--base-secondary);
2336
+ .my-xs {
2337
+ margin-block: var(--spacing-xs);
746
2338
  }
747
2339
 
748
- .border-tertiary {
749
- border-color: var(--base-tertiary);
2340
+ .my-s {
2341
+ margin-block: var(--spacing-s);
750
2342
  }
751
2343
 
752
- .border-quaternary {
753
- border-color: var(--base-quaternary);
2344
+ .my-m {
2345
+ margin-block: var(--spacing-m);
754
2346
  }
755
2347
 
756
- .border-quinary {
757
- border-color: var(--base-quinary);
2348
+ .my-l {
2349
+ margin-block: var(--spacing-l);
758
2350
  }
759
2351
 
760
- /* Border color — system */
2352
+ .my-xl {
2353
+ margin-block: var(--spacing-xl);
2354
+ }
761
2355
 
762
- .border-blue {
763
- border-color: var(--system-blue);
2356
+ .my-2xl {
2357
+ margin-block: var(--spacing-2xl);
764
2358
  }
765
2359
 
766
- .border-green {
767
- border-color: var(--system-green);
2360
+ .my-3xl {
2361
+ margin-block: var(--spacing-3xl);
768
2362
  }
769
2363
 
770
- .border-yellow {
771
- border-color: var(--system-yellow);
2364
+ .my-4xl {
2365
+ margin-block: var(--spacing-4xl);
772
2366
  }
773
2367
 
774
- .border-orange {
775
- border-color: var(--system-orange);
2368
+ .my-5xl {
2369
+ margin-block: var(--spacing-5xl);
776
2370
  }
777
2371
 
778
- .border-red {
779
- border-color: var(--system-red);
2372
+ .my-6xl {
2373
+ margin-block: var(--spacing-6xl);
780
2374
  }
781
2375
 
782
- .border-purple {
783
- border-color: var(--system-purple);
2376
+ .my-7xl {
2377
+ margin-block: var(--spacing-7xl);
2378
+ }
2379
+
2380
+ .mt-0 {
2381
+ margin-top: var(--spacing-0);
2382
+ }
2383
+
2384
+ .mt-xs {
2385
+ margin-top: var(--spacing-xs);
2386
+ }
2387
+
2388
+ .mt-s {
2389
+ margin-top: var(--spacing-s);
2390
+ }
2391
+
2392
+ .mt-m {
2393
+ margin-top: var(--spacing-m);
2394
+ }
2395
+
2396
+ .mt-l {
2397
+ margin-top: var(--spacing-l);
2398
+ }
2399
+
2400
+ .mt-xl {
2401
+ margin-top: var(--spacing-xl);
2402
+ }
2403
+
2404
+ .mt-2xl {
2405
+ margin-top: var(--spacing-2xl);
2406
+ }
2407
+
2408
+ .mt-3xl {
2409
+ margin-top: var(--spacing-3xl);
2410
+ }
2411
+
2412
+ .mt-4xl {
2413
+ margin-top: var(--spacing-4xl);
2414
+ }
2415
+
2416
+ .mt-5xl {
2417
+ margin-top: var(--spacing-5xl);
2418
+ }
2419
+
2420
+ .mt-6xl {
2421
+ margin-top: var(--spacing-6xl);
2422
+ }
2423
+
2424
+ .mt-7xl {
2425
+ margin-top: var(--spacing-7xl);
2426
+ }
2427
+
2428
+ .mr-0 {
2429
+ margin-right: var(--spacing-0);
2430
+ }
2431
+
2432
+ .mr-xs {
2433
+ margin-right: var(--spacing-xs);
2434
+ }
2435
+
2436
+ .mr-s {
2437
+ margin-right: var(--spacing-s);
2438
+ }
2439
+
2440
+ .mr-m {
2441
+ margin-right: var(--spacing-m);
2442
+ }
2443
+
2444
+ .mr-l {
2445
+ margin-right: var(--spacing-l);
2446
+ }
2447
+
2448
+ .mr-xl {
2449
+ margin-right: var(--spacing-xl);
2450
+ }
2451
+
2452
+ .mr-2xl {
2453
+ margin-right: var(--spacing-2xl);
2454
+ }
2455
+
2456
+ .mr-3xl {
2457
+ margin-right: var(--spacing-3xl);
2458
+ }
2459
+
2460
+ .mr-4xl {
2461
+ margin-right: var(--spacing-4xl);
2462
+ }
2463
+
2464
+ .mr-5xl {
2465
+ margin-right: var(--spacing-5xl);
2466
+ }
2467
+
2468
+ .mr-6xl {
2469
+ margin-right: var(--spacing-6xl);
2470
+ }
2471
+
2472
+ .mr-7xl {
2473
+ margin-right: var(--spacing-7xl);
2474
+ }
2475
+
2476
+ .mb-0 {
2477
+ margin-bottom: var(--spacing-0);
2478
+ }
2479
+
2480
+ .mb-xs {
2481
+ margin-bottom: var(--spacing-xs);
2482
+ }
2483
+
2484
+ .mb-s {
2485
+ margin-bottom: var(--spacing-s);
2486
+ }
2487
+
2488
+ .mb-m {
2489
+ margin-bottom: var(--spacing-m);
2490
+ }
2491
+
2492
+ .mb-l {
2493
+ margin-bottom: var(--spacing-l);
2494
+ }
2495
+
2496
+ .mb-xl {
2497
+ margin-bottom: var(--spacing-xl);
2498
+ }
2499
+
2500
+ .mb-2xl {
2501
+ margin-bottom: var(--spacing-2xl);
2502
+ }
2503
+
2504
+ .mb-3xl {
2505
+ margin-bottom: var(--spacing-3xl);
2506
+ }
2507
+
2508
+ .mb-4xl {
2509
+ margin-bottom: var(--spacing-4xl);
2510
+ }
2511
+
2512
+ .mb-5xl {
2513
+ margin-bottom: var(--spacing-5xl);
2514
+ }
2515
+
2516
+ .mb-6xl {
2517
+ margin-bottom: var(--spacing-6xl);
2518
+ }
2519
+
2520
+ .mb-7xl {
2521
+ margin-bottom: var(--spacing-7xl);
2522
+ }
2523
+
2524
+ .ml-0 {
2525
+ margin-left: var(--spacing-0);
2526
+ }
2527
+
2528
+ .ml-xs {
2529
+ margin-left: var(--spacing-xs);
2530
+ }
2531
+
2532
+ .ml-s {
2533
+ margin-left: var(--spacing-s);
2534
+ }
2535
+
2536
+ .ml-m {
2537
+ margin-left: var(--spacing-m);
2538
+ }
2539
+
2540
+ .ml-l {
2541
+ margin-left: var(--spacing-l);
2542
+ }
2543
+
2544
+ .ml-xl {
2545
+ margin-left: var(--spacing-xl);
2546
+ }
2547
+
2548
+ .ml-2xl {
2549
+ margin-left: var(--spacing-2xl);
2550
+ }
2551
+
2552
+ .ml-3xl {
2553
+ margin-left: var(--spacing-3xl);
2554
+ }
2555
+
2556
+ .ml-4xl {
2557
+ margin-left: var(--spacing-4xl);
2558
+ }
2559
+
2560
+ .ml-5xl {
2561
+ margin-left: var(--spacing-5xl);
2562
+ }
2563
+
2564
+ .ml-6xl {
2565
+ margin-left: var(--spacing-6xl);
2566
+ }
2567
+
2568
+ .ml-7xl {
2569
+ margin-left: var(--spacing-7xl);
2570
+ }
2571
+
2572
+ /* Gap */
2573
+
2574
+ .gap-0 {
2575
+ gap: var(--spacing-0);
2576
+ }
2577
+
2578
+ .gap-xs {
2579
+ gap: var(--spacing-xs);
2580
+ }
2581
+
2582
+ .gap-s {
2583
+ gap: var(--spacing-s);
2584
+ }
2585
+
2586
+ .gap-m {
2587
+ gap: var(--spacing-m);
2588
+ }
2589
+
2590
+ .gap-l {
2591
+ gap: var(--spacing-l);
2592
+ }
2593
+
2594
+ .gap-xl {
2595
+ gap: var(--spacing-xl);
2596
+ }
2597
+
2598
+ .gap-2xl {
2599
+ gap: var(--spacing-2xl);
2600
+ }
2601
+
2602
+ .gap-3xl {
2603
+ gap: var(--spacing-3xl);
2604
+ }
2605
+
2606
+ .gap-4xl {
2607
+ gap: var(--spacing-4xl);
2608
+ }
2609
+
2610
+ .gap-5xl {
2611
+ gap: var(--spacing-5xl);
2612
+ }
2613
+
2614
+ .gap-6xl {
2615
+ gap: var(--spacing-6xl);
2616
+ }
2617
+
2618
+ .gap-7xl {
2619
+ gap: var(--spacing-7xl);
2620
+ }
2621
+
2622
+ .gap-x-0 {
2623
+ column-gap: var(--spacing-0);
2624
+ }
2625
+
2626
+ .gap-x-xs {
2627
+ column-gap: var(--spacing-xs);
2628
+ }
2629
+
2630
+ .gap-x-s {
2631
+ column-gap: var(--spacing-s);
2632
+ }
2633
+
2634
+ .gap-x-m {
2635
+ column-gap: var(--spacing-m);
2636
+ }
2637
+
2638
+ .gap-x-l {
2639
+ column-gap: var(--spacing-l);
2640
+ }
2641
+
2642
+ .gap-x-xl {
2643
+ column-gap: var(--spacing-xl);
2644
+ }
2645
+
2646
+ .gap-x-2xl {
2647
+ column-gap: var(--spacing-2xl);
2648
+ }
2649
+
2650
+ .gap-x-3xl {
2651
+ column-gap: var(--spacing-3xl);
2652
+ }
2653
+
2654
+ .gap-x-4xl {
2655
+ column-gap: var(--spacing-4xl);
2656
+ }
2657
+
2658
+ .gap-x-5xl {
2659
+ column-gap: var(--spacing-5xl);
2660
+ }
2661
+
2662
+ .gap-x-6xl {
2663
+ column-gap: var(--spacing-6xl);
2664
+ }
2665
+
2666
+ .gap-x-7xl {
2667
+ column-gap: var(--spacing-7xl);
2668
+ }
2669
+
2670
+ .gap-y-0 {
2671
+ row-gap: var(--spacing-0);
2672
+ }
2673
+
2674
+ .gap-y-xs {
2675
+ row-gap: var(--spacing-xs);
2676
+ }
2677
+
2678
+ .gap-y-s {
2679
+ row-gap: var(--spacing-s);
2680
+ }
2681
+
2682
+ .gap-y-m {
2683
+ row-gap: var(--spacing-m);
2684
+ }
2685
+
2686
+ .gap-y-l {
2687
+ row-gap: var(--spacing-l);
2688
+ }
2689
+
2690
+ .gap-y-xl {
2691
+ row-gap: var(--spacing-xl);
2692
+ }
2693
+
2694
+ .gap-y-2xl {
2695
+ row-gap: var(--spacing-2xl);
2696
+ }
2697
+
2698
+ .gap-y-3xl {
2699
+ row-gap: var(--spacing-3xl);
2700
+ }
2701
+
2702
+ .gap-y-4xl {
2703
+ row-gap: var(--spacing-4xl);
2704
+ }
2705
+
2706
+ .gap-y-5xl {
2707
+ row-gap: var(--spacing-5xl);
2708
+ }
2709
+
2710
+ .gap-y-6xl {
2711
+ row-gap: var(--spacing-6xl);
2712
+ }
2713
+
2714
+ .gap-y-7xl {
2715
+ row-gap: var(--spacing-7xl);
784
2716
  }
785
2717
  }
786
2718
 
@@ -792,9 +2724,9 @@
792
2724
  * Tên class trùng đúng tên token trong Figma, không có prefix: đọc DOM là biết
793
2725
  * ngay style đang dùng, và không cần import gì trong JS để dùng được.
794
2726
  *
795
- * Mỗi class chỉ set đúng 3 thuộc tính: font-size, line-height, font-weight.
796
- * Font family, letter spacing, margin, màu chữ… không thuộc phạm vi của
797
- * stylesheet này — app tự setup ở tầng global nếu cần.
2727
+ * Mỗi class set: font-family (Inter qua --font-sans) + size + line-height +
2728
+ * weight (400 / 600 / 700 theo token). Letter spacing, margin, màu chữ không
2729
+ * thuộc stylesheet này — màu dùng class text-* riêng.
798
2730
  *
799
2731
  * Toàn bộ nằm trong `@layer components` để utility của Tailwind (`@layer
800
2732
  * utilities`) luôn thắng: `class="heading-1 font-bold"` hay `class="body-3
@@ -802,6 +2734,27 @@
802
2734
  */
803
2735
 
804
2736
  @layer components {
2737
+ :is(
2738
+ .display-1,
2739
+ .display-2,
2740
+ .display-3,
2741
+ .heading-1,
2742
+ .heading-2,
2743
+ .heading-3,
2744
+ .body-1,
2745
+ .body-1-highlight,
2746
+ .body-2,
2747
+ .body-2-highlight,
2748
+ .body-3,
2749
+ .body-3-highlight,
2750
+ .body-4,
2751
+ .body-4-highlight,
2752
+ .body-5,
2753
+ .body-5-highlight
2754
+ ) {
2755
+ font-family: var(--font-sans);
2756
+ }
2757
+
805
2758
  /* Display */
806
2759
 
807
2760
  .display-1 {