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