@finhay-pro/leaf-design-system 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +342 -0
- package/dist/button.css +174 -0
- package/dist/cdn/leaf-0.1.1.min.css +2 -0
- package/dist/cdn/leaf-0.1.1.min.js +2 -0
- package/dist/classes.css +681 -0
- package/dist/color.css +191 -0
- package/dist/components/Button/Button.d.ts +33 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.js +26 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Button/index.js +2 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +37 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.js +44 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Tabs/index.js +2 -0
- package/dist/components/Tabs/index.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +914 -0
- package/dist/tabs.css +189 -0
- package/dist/tokens.css +234 -0
- package/dist/typography.css +130 -0
- package/dist/utils/joinClass.d.ts +3 -0
- package/dist/utils/joinClass.d.ts.map +1 -0
- package/dist/utils/joinClass.js +5 -0
- package/dist/utils/joinClass.js.map +1 -0
- package/package.json +55 -0
package/dist/tabs.css
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/* @finhay-pro/leaf-design-system — generated by scripts/build-css.mjs. Do not edit. */
|
|
2
|
+
|
|
3
|
+
/* --- src/components/Tabs/tabs.css --- */
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Tabs — Figma 712:6996 (Tabs Items).
|
|
7
|
+
*
|
|
8
|
+
* `variant` map type trong Figma: subcontent | title | functional | buy | sell.
|
|
9
|
+
* Size: xl | lg | md | sm (tuỳ variant — Title chỉ S, Functional chỉ M, Buy/Sell chỉ L).
|
|
10
|
+
*
|
|
11
|
+
* Variant / size đặt trên tablist (`.leaf-tabs[data-variant][data-size]`), từng
|
|
12
|
+
* `.leaf-tab` chỉ cần `aria-selected`. Toàn bộ hình thức (kể cả typography của
|
|
13
|
+
* label) nằm ở đây — React và `leaf.js` chỉ gắn attribute, nên HTML tĩnh viết
|
|
14
|
+
* cùng markup là ra cùng kết quả.
|
|
15
|
+
*
|
|
16
|
+
* Mặc định khi thiếu attribute: variant subcontent, size xl. Chỉ Subcontent đổi
|
|
17
|
+
* theo size; các variant khác có một size duy nhất nên không đọc `data-size`.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
@layer components {
|
|
21
|
+
.leaf-tabs {
|
|
22
|
+
/* Kích thước của Subcontent — mặc định xl, đổi theo data-size bên dưới. */
|
|
23
|
+
--leaf-tab-padding: 12px 16px;
|
|
24
|
+
--leaf-tab-gap: 8px;
|
|
25
|
+
--leaf-tab-font-size: var(--body-3-size);
|
|
26
|
+
--leaf-tab-line-height: var(--body-3-line-height);
|
|
27
|
+
--leaf-tab-font-weight: var(--body-3-highlight-weight);
|
|
28
|
+
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-wrap: wrap;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: 12px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.leaf-tabs[data-size="lg"] {
|
|
36
|
+
--leaf-tab-padding: 8px 16px;
|
|
37
|
+
--leaf-tab-gap: 8px;
|
|
38
|
+
--leaf-tab-font-size: var(--body-4-size);
|
|
39
|
+
--leaf-tab-line-height: var(--body-4-line-height);
|
|
40
|
+
--leaf-tab-font-weight: var(--body-4-highlight-weight);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.leaf-tabs[data-size="md"] {
|
|
44
|
+
--leaf-tab-padding: 4px 12px;
|
|
45
|
+
--leaf-tab-gap: normal;
|
|
46
|
+
--leaf-tab-font-size: var(--body-4-size);
|
|
47
|
+
--leaf-tab-line-height: var(--body-4-line-height);
|
|
48
|
+
--leaf-tab-font-weight: var(--body-4-weight);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.leaf-tabs[data-size="sm"] {
|
|
52
|
+
--leaf-tab-padding: 4px 12px;
|
|
53
|
+
--leaf-tab-gap: normal;
|
|
54
|
+
--leaf-tab-font-size: var(--body-5-size);
|
|
55
|
+
--leaf-tab-line-height: var(--body-5-line-height);
|
|
56
|
+
--leaf-tab-font-weight: var(--body-5-weight);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.leaf-tab {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
border: none;
|
|
64
|
+
margin: 0;
|
|
65
|
+
padding: 0;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
background-color: transparent;
|
|
68
|
+
color: inherit;
|
|
69
|
+
font: inherit;
|
|
70
|
+
text-align: center;
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.leaf-tab:disabled,
|
|
76
|
+
.leaf-tab[aria-disabled="true"] {
|
|
77
|
+
cursor: not-allowed;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* ── Subcontent (pill) — cũng là mặc định khi không có data-variant ──── */
|
|
81
|
+
|
|
82
|
+
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"]) .leaf-tab {
|
|
83
|
+
gap: var(--leaf-tab-gap);
|
|
84
|
+
padding: var(--leaf-tab-padding);
|
|
85
|
+
border-radius: 1000px;
|
|
86
|
+
background-color: var(--base-tertiary);
|
|
87
|
+
color: var(--text-secondary);
|
|
88
|
+
font-size: var(--leaf-tab-font-size);
|
|
89
|
+
line-height: var(--leaf-tab-line-height);
|
|
90
|
+
font-weight: var(--leaf-tab-font-weight);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.leaf-tabs:is(:not([data-variant]), [data-variant="subcontent"])
|
|
94
|
+
.leaf-tab[aria-selected="true"] {
|
|
95
|
+
background-color: var(--base-quinary);
|
|
96
|
+
color: var(--text-quaternary);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* ── Title (underline) ───────────────────────────────────────────────── */
|
|
100
|
+
|
|
101
|
+
.leaf-tabs[data-variant="title"] .leaf-tab {
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
gap: 4px;
|
|
104
|
+
min-width: 100px;
|
|
105
|
+
color: var(--text-secondary);
|
|
106
|
+
font-size: var(--body-4-size);
|
|
107
|
+
line-height: var(--body-4-line-height);
|
|
108
|
+
font-weight: var(--body-4-weight);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.leaf-tabs[data-variant="title"] .leaf-tab[aria-selected="true"] {
|
|
112
|
+
color: var(--text-primary);
|
|
113
|
+
font-weight: var(--body-4-highlight-weight);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.leaf-tabs[data-variant="title"] .leaf-tab::after {
|
|
117
|
+
content: "";
|
|
118
|
+
display: block;
|
|
119
|
+
width: 100%;
|
|
120
|
+
height: 2px;
|
|
121
|
+
background-color: var(--text-primary);
|
|
122
|
+
opacity: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.leaf-tabs[data-variant="title"] .leaf-tab[aria-selected="true"]::after {
|
|
126
|
+
opacity: 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* ── Functional ──────────────────────────────────────────────────────── */
|
|
130
|
+
|
|
131
|
+
.leaf-tabs[data-variant="functional"] .leaf-tab {
|
|
132
|
+
height: 24px;
|
|
133
|
+
min-width: 100px;
|
|
134
|
+
padding: 4px 24px;
|
|
135
|
+
border-radius: 100px;
|
|
136
|
+
background-color: var(--base-tertiary);
|
|
137
|
+
color: var(--button-content-disable);
|
|
138
|
+
font-size: var(--body-5-size);
|
|
139
|
+
line-height: var(--body-5-line-height);
|
|
140
|
+
font-weight: var(--body-5-weight);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.leaf-tabs[data-variant="functional"] .leaf-tab[aria-selected="true"] {
|
|
144
|
+
background-color: var(--button-base-primary);
|
|
145
|
+
color: var(--button-content-primary);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* ── Buy / Sell ──────────────────────────────────────────────────────── */
|
|
149
|
+
|
|
150
|
+
.leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab {
|
|
151
|
+
min-width: 100px;
|
|
152
|
+
width: auto;
|
|
153
|
+
gap: 4px;
|
|
154
|
+
padding: 6px 4px;
|
|
155
|
+
border-radius: 100px;
|
|
156
|
+
color: var(--text-primary);
|
|
157
|
+
font-size: var(--body-5-size);
|
|
158
|
+
line-height: var(--body-5-line-height);
|
|
159
|
+
font-weight: var(--body-5-weight);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.leaf-tabs:is([data-variant="buy"], [data-variant="sell"]) .leaf-tab[aria-selected="true"] {
|
|
163
|
+
font-weight: var(--body-5-highlight-weight);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.leaf-tabs[data-variant="buy"] .leaf-tab[aria-selected="true"] {
|
|
167
|
+
background-color: var(--button-base-secondary);
|
|
168
|
+
color: var(--text-highlight);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.leaf-tabs[data-variant="sell"] .leaf-tab[aria-selected="true"] {
|
|
172
|
+
background-color: var(--button-base-secondary-destruction);
|
|
173
|
+
color: var(--button-content-destruction);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.leaf-tab__label,
|
|
177
|
+
.leaf-tab__addon {
|
|
178
|
+
display: inline-flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
justify-content: center;
|
|
181
|
+
line-height: inherit;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.leaf-tab__addon > svg {
|
|
185
|
+
display: block;
|
|
186
|
+
width: 1em;
|
|
187
|
+
height: 1em;
|
|
188
|
+
}
|
|
189
|
+
}
|
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/* @finhay-pro/leaf-design-system — generated by scripts/build-css.mjs. Do not edit. */
|
|
2
|
+
|
|
3
|
+
/* --- ../tokens/src/primitive.css --- */
|
|
4
|
+
|
|
5
|
+
/* Primitive color tokens — internal source of truth (Figma 13:2181). Do not use directly in UI. */
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--neutral-white: #ffffff;
|
|
9
|
+
--neutral-100: #f8f8f8;
|
|
10
|
+
--neutral-200: #f0f0f0;
|
|
11
|
+
--neutral-300: #d9d9d9;
|
|
12
|
+
--neutral-400: #999999;
|
|
13
|
+
--neutral-500: #666666;
|
|
14
|
+
--neutral-600: #313235;
|
|
15
|
+
--neutral-700: #28292b;
|
|
16
|
+
--neutral-800: #171719;
|
|
17
|
+
--neutral-900: #0d0e10;
|
|
18
|
+
|
|
19
|
+
--brand-100: #dbf7d5;
|
|
20
|
+
--brand-200: #b6efac;
|
|
21
|
+
--brand-300: #92e882;
|
|
22
|
+
--brand-400: #6de059;
|
|
23
|
+
--brand-500: #49d82f;
|
|
24
|
+
--brand-600: #3aad26;
|
|
25
|
+
--brand-700: #2c821c;
|
|
26
|
+
--brand-800: #1d5613;
|
|
27
|
+
--brand-900: #0f2b09;
|
|
28
|
+
|
|
29
|
+
--purple-100: #f0ddf9;
|
|
30
|
+
--purple-200: #e1bbf4;
|
|
31
|
+
--purple-300: #d198ee;
|
|
32
|
+
--purple-400: #c276e9;
|
|
33
|
+
--purple-500: #b354e3;
|
|
34
|
+
--purple-600: #8f43b6;
|
|
35
|
+
--purple-700: #6b3288;
|
|
36
|
+
--purple-800: #48225b;
|
|
37
|
+
--purple-900: #24112d;
|
|
38
|
+
|
|
39
|
+
--red-100: #fbd9d7;
|
|
40
|
+
--red-200: #f7b4af;
|
|
41
|
+
--red-300: #f38e87;
|
|
42
|
+
--red-400: #ef695f;
|
|
43
|
+
--red-500: #eb4337;
|
|
44
|
+
--red-600: #bc362c;
|
|
45
|
+
--red-700: #8d2821;
|
|
46
|
+
--red-800: #5e1b16;
|
|
47
|
+
--red-900: #2f0d0b;
|
|
48
|
+
|
|
49
|
+
--orange-100: #fbe8cc;
|
|
50
|
+
--orange-200: #f6d299;
|
|
51
|
+
--orange-300: #f2bb66;
|
|
52
|
+
--orange-400: #eda533;
|
|
53
|
+
--orange-500: #e98e00;
|
|
54
|
+
--orange-600: #ba7200;
|
|
55
|
+
--orange-700: #8c5500;
|
|
56
|
+
--orange-800: #5d3900;
|
|
57
|
+
--orange-900: #2f1c00;
|
|
58
|
+
|
|
59
|
+
--yellow-100: #fbf5d7;
|
|
60
|
+
--yellow-200: #f6eaaf;
|
|
61
|
+
--yellow-300: #f2e086;
|
|
62
|
+
--yellow-400: #edd55e;
|
|
63
|
+
--yellow-500: #e9cb36;
|
|
64
|
+
--yellow-600: #baa22b;
|
|
65
|
+
--yellow-700: #8c7a20;
|
|
66
|
+
--yellow-800: #5d5116;
|
|
67
|
+
--yellow-900: #2f290b;
|
|
68
|
+
|
|
69
|
+
--green-100: #d8f3de;
|
|
70
|
+
--green-200: #b0e7be;
|
|
71
|
+
--green-300: #89dc9d;
|
|
72
|
+
--green-400: #61d07d;
|
|
73
|
+
--green-500: #3ac45c;
|
|
74
|
+
--green-600: #2e9d4a;
|
|
75
|
+
--green-700: #237637;
|
|
76
|
+
--green-800: #174e25;
|
|
77
|
+
--green-900: #0c2712;
|
|
78
|
+
|
|
79
|
+
--blue-100: #d4eaff;
|
|
80
|
+
--blue-200: #a9d4ff;
|
|
81
|
+
--blue-300: #7fbfff;
|
|
82
|
+
--blue-400: #54a9ff;
|
|
83
|
+
--blue-500: #2994ff;
|
|
84
|
+
--blue-600: #2176cc;
|
|
85
|
+
--blue-700: #195999;
|
|
86
|
+
--blue-800: #103b66;
|
|
87
|
+
--blue-900: #081e33;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* --- ../tokens/src/semantic.css --- */
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
* Semantic color tokens — Figma 699:3784. Map to primitives only. Dark = default.
|
|
94
|
+
*
|
|
95
|
+
* `[data-theme]` khai báo ở cả hai chiều nên attribute đặt được ở bất kỳ đâu:
|
|
96
|
+
* trên `<html>` để đổi cả trang, hoặc trên một khối để đảo theme riêng khối đó
|
|
97
|
+
* (vd. một card sáng nằm trong trang tối).
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
:root,
|
|
101
|
+
[data-theme="dark"] {
|
|
102
|
+
/* Base */
|
|
103
|
+
--base-primary: var(--neutral-900);
|
|
104
|
+
--base-secondary: var(--neutral-800);
|
|
105
|
+
--base-tertiary: var(--neutral-700);
|
|
106
|
+
--base-quaternary: var(--neutral-600);
|
|
107
|
+
--base-quinary: var(--neutral-white);
|
|
108
|
+
|
|
109
|
+
/* Content / Text */
|
|
110
|
+
--text-highlight: var(--brand-500);
|
|
111
|
+
--text-primary: var(--neutral-100);
|
|
112
|
+
--text-secondary: var(--neutral-300);
|
|
113
|
+
--text-tertiary: var(--neutral-500);
|
|
114
|
+
--text-quaternary: var(--neutral-900);
|
|
115
|
+
|
|
116
|
+
/* System */
|
|
117
|
+
--system-blue: var(--blue-500);
|
|
118
|
+
--system-green: var(--green-500);
|
|
119
|
+
--system-yellow: var(--yellow-500);
|
|
120
|
+
--system-orange: var(--orange-500);
|
|
121
|
+
--system-red: var(--red-500);
|
|
122
|
+
--system-purple: var(--purple-500);
|
|
123
|
+
|
|
124
|
+
/* Button — Figma 246:1135. Brand/red giữ nguyên qua theme. */
|
|
125
|
+
--button-base-primary: var(--brand-500);
|
|
126
|
+
--button-base-destruction: var(--red-500);
|
|
127
|
+
--button-base-disable: var(--neutral-600);
|
|
128
|
+
--button-base-secondary: var(--brand-800);
|
|
129
|
+
--button-base-secondary-destruction: var(--red-800);
|
|
130
|
+
--button-base-tertiary: var(--neutral-600);
|
|
131
|
+
--button-content-primary: var(--neutral-900);
|
|
132
|
+
--button-content-secondary: var(--brand-500);
|
|
133
|
+
--button-content-destruction: var(--red-500);
|
|
134
|
+
--button-content-disable: var(--neutral-500);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
[data-theme="light"] {
|
|
138
|
+
--base-primary: var(--neutral-white);
|
|
139
|
+
--base-secondary: var(--neutral-100);
|
|
140
|
+
--base-tertiary: var(--neutral-200);
|
|
141
|
+
--base-quaternary: var(--neutral-300);
|
|
142
|
+
--base-quinary: var(--neutral-900);
|
|
143
|
+
|
|
144
|
+
--text-highlight: var(--brand-500);
|
|
145
|
+
--text-primary: var(--neutral-900);
|
|
146
|
+
--text-secondary: var(--neutral-500);
|
|
147
|
+
/*
|
|
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).
|
|
151
|
+
*/
|
|
152
|
+
--text-tertiary: var(--neutral-400);
|
|
153
|
+
--text-quaternary: var(--neutral-white);
|
|
154
|
+
|
|
155
|
+
--system-blue: var(--blue-500);
|
|
156
|
+
--system-green: var(--green-500);
|
|
157
|
+
--system-yellow: var(--yellow-500);
|
|
158
|
+
--system-orange: var(--orange-500);
|
|
159
|
+
--system-red: var(--red-500);
|
|
160
|
+
--system-purple: var(--purple-500);
|
|
161
|
+
|
|
162
|
+
--button-base-primary: var(--brand-500);
|
|
163
|
+
--button-base-destruction: var(--red-500);
|
|
164
|
+
--button-base-disable: var(--neutral-300);
|
|
165
|
+
--button-base-secondary: var(--brand-100);
|
|
166
|
+
--button-base-secondary-destruction: var(--red-100);
|
|
167
|
+
--button-base-tertiary: var(--neutral-200);
|
|
168
|
+
--button-content-primary: var(--neutral-900);
|
|
169
|
+
--button-content-secondary: var(--brand-700);
|
|
170
|
+
--button-content-destruction: var(--red-600);
|
|
171
|
+
--button-content-disable: var(--neutral-400);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* --- ../tokens/src/typography.css --- */
|
|
175
|
+
|
|
176
|
+
/* Typography tokens — Desktop Figma 749:414. Inter; letter-spacing 0. */
|
|
177
|
+
|
|
178
|
+
:root {
|
|
179
|
+
/*
|
|
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.
|
|
183
|
+
*/
|
|
184
|
+
--font-sans: var(--font-inter, "Inter"), ui-sans-serif, system-ui, sans-serif;
|
|
185
|
+
|
|
186
|
+
--display-1-size: 122px;
|
|
187
|
+
--display-1-line-height: 134px;
|
|
188
|
+
--display-1-weight: 700;
|
|
189
|
+
|
|
190
|
+
--display-2-size: 76px;
|
|
191
|
+
--display-2-line-height: 88px;
|
|
192
|
+
--display-2-weight: 600;
|
|
193
|
+
|
|
194
|
+
--display-3-size: 60px;
|
|
195
|
+
--display-3-line-height: 72px;
|
|
196
|
+
--display-3-weight: 600;
|
|
197
|
+
|
|
198
|
+
--heading-1-size: 36px;
|
|
199
|
+
--heading-1-line-height: 48px;
|
|
200
|
+
--heading-1-weight: 600;
|
|
201
|
+
|
|
202
|
+
--heading-2-size: 28px;
|
|
203
|
+
--heading-2-line-height: 36px;
|
|
204
|
+
--heading-2-weight: 600;
|
|
205
|
+
|
|
206
|
+
--heading-3-size: 24px;
|
|
207
|
+
--heading-3-line-height: 32px;
|
|
208
|
+
--heading-3-weight: 600;
|
|
209
|
+
|
|
210
|
+
--body-1-size: 20px;
|
|
211
|
+
--body-1-line-height: 30px;
|
|
212
|
+
--body-1-weight: 400;
|
|
213
|
+
--body-1-highlight-weight: 600;
|
|
214
|
+
|
|
215
|
+
--body-2-size: 18px;
|
|
216
|
+
--body-2-line-height: 28px;
|
|
217
|
+
--body-2-weight: 400;
|
|
218
|
+
--body-2-highlight-weight: 600;
|
|
219
|
+
|
|
220
|
+
--body-3-size: 16px;
|
|
221
|
+
--body-3-line-height: 24px;
|
|
222
|
+
--body-3-weight: 400;
|
|
223
|
+
--body-3-highlight-weight: 600;
|
|
224
|
+
|
|
225
|
+
--body-4-size: 14px;
|
|
226
|
+
--body-4-line-height: 20px;
|
|
227
|
+
--body-4-weight: 400;
|
|
228
|
+
--body-4-highlight-weight: 600;
|
|
229
|
+
|
|
230
|
+
--body-5-size: 12px;
|
|
231
|
+
--body-5-line-height: 16px;
|
|
232
|
+
--body-5-weight: 400;
|
|
233
|
+
--body-5-highlight-weight: 600;
|
|
234
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/* @finhay-pro/leaf-design-system — generated by scripts/build-css.mjs. Do not edit. */
|
|
2
|
+
|
|
3
|
+
/* --- src/styles/typography.css --- */
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Typography classes — map 1:1 sang token trong @finhay/leaf-tokens.
|
|
7
|
+
*
|
|
8
|
+
* Tên class trùng đúng tên token trong Figma, không có prefix: đọc DOM là biết
|
|
9
|
+
* ngay style đang dùng, và không cần import gì trong JS để dùng được.
|
|
10
|
+
*
|
|
11
|
+
* Mỗi class chỉ set đúng 3 thuộc tính: font-size, line-height, font-weight.
|
|
12
|
+
* Font family, letter spacing, margin, màu chữ… không thuộc phạm vi của
|
|
13
|
+
* stylesheet này — app tự setup ở tầng global nếu cần.
|
|
14
|
+
*
|
|
15
|
+
* Toàn bộ nằm trong `@layer components` để utility của Tailwind (`@layer
|
|
16
|
+
* utilities`) luôn thắng: `class="heading-1 font-bold"` hay `class="body-3
|
|
17
|
+
* text-2xl"` đều override được mà không cần important modifier.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
@layer components {
|
|
21
|
+
/* Display */
|
|
22
|
+
|
|
23
|
+
.display-1 {
|
|
24
|
+
font-size: var(--display-1-size);
|
|
25
|
+
line-height: var(--display-1-line-height);
|
|
26
|
+
font-weight: var(--display-1-weight);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.display-2 {
|
|
30
|
+
font-size: var(--display-2-size);
|
|
31
|
+
line-height: var(--display-2-line-height);
|
|
32
|
+
font-weight: var(--display-2-weight);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.display-3 {
|
|
36
|
+
font-size: var(--display-3-size);
|
|
37
|
+
line-height: var(--display-3-line-height);
|
|
38
|
+
font-weight: var(--display-3-weight);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Heading */
|
|
42
|
+
|
|
43
|
+
.heading-1 {
|
|
44
|
+
font-size: var(--heading-1-size);
|
|
45
|
+
line-height: var(--heading-1-line-height);
|
|
46
|
+
font-weight: var(--heading-1-weight);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.heading-2 {
|
|
50
|
+
font-size: var(--heading-2-size);
|
|
51
|
+
line-height: var(--heading-2-line-height);
|
|
52
|
+
font-weight: var(--heading-2-weight);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.heading-3 {
|
|
56
|
+
font-size: var(--heading-3-size);
|
|
57
|
+
line-height: var(--heading-3-line-height);
|
|
58
|
+
font-weight: var(--heading-3-weight);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Body 1 */
|
|
62
|
+
|
|
63
|
+
.body-1 {
|
|
64
|
+
font-size: var(--body-1-size);
|
|
65
|
+
line-height: var(--body-1-line-height);
|
|
66
|
+
font-weight: var(--body-1-weight);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.body-1-highlight {
|
|
70
|
+
font-size: var(--body-1-size);
|
|
71
|
+
line-height: var(--body-1-line-height);
|
|
72
|
+
font-weight: var(--body-1-highlight-weight);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Body 2 */
|
|
76
|
+
|
|
77
|
+
.body-2 {
|
|
78
|
+
font-size: var(--body-2-size);
|
|
79
|
+
line-height: var(--body-2-line-height);
|
|
80
|
+
font-weight: var(--body-2-weight);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.body-2-highlight {
|
|
84
|
+
font-size: var(--body-2-size);
|
|
85
|
+
line-height: var(--body-2-line-height);
|
|
86
|
+
font-weight: var(--body-2-highlight-weight);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Body 3 */
|
|
90
|
+
|
|
91
|
+
.body-3 {
|
|
92
|
+
font-size: var(--body-3-size);
|
|
93
|
+
line-height: var(--body-3-line-height);
|
|
94
|
+
font-weight: var(--body-3-weight);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.body-3-highlight {
|
|
98
|
+
font-size: var(--body-3-size);
|
|
99
|
+
line-height: var(--body-3-line-height);
|
|
100
|
+
font-weight: var(--body-3-highlight-weight);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Body 4 */
|
|
104
|
+
|
|
105
|
+
.body-4 {
|
|
106
|
+
font-size: var(--body-4-size);
|
|
107
|
+
line-height: var(--body-4-line-height);
|
|
108
|
+
font-weight: var(--body-4-weight);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.body-4-highlight {
|
|
112
|
+
font-size: var(--body-4-size);
|
|
113
|
+
line-height: var(--body-4-line-height);
|
|
114
|
+
font-weight: var(--body-4-highlight-weight);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Body 5 */
|
|
118
|
+
|
|
119
|
+
.body-5 {
|
|
120
|
+
font-size: var(--body-5-size);
|
|
121
|
+
line-height: var(--body-5-line-height);
|
|
122
|
+
font-weight: var(--body-5-weight);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.body-5-highlight {
|
|
126
|
+
font-size: var(--body-5-size);
|
|
127
|
+
line-height: var(--body-5-line-height);
|
|
128
|
+
font-weight: var(--body-5-highlight-weight);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joinClass.d.ts","sourceRoot":"","sources":["../../src/utils/joinClass.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC,GAAG,MAAM,CAE7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joinClass.js","sourceRoot":"","sources":["../../src/utils/joinClass.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,MAAM,UAAU,SAAS,CAAC,GAAG,KAAwC;IACjE,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@finhay-pro/leaf-design-system",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "React component library của Finhay Leaf Design System",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"*.css"
|
|
9
|
+
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/finhay/leaf-design-system.git",
|
|
13
|
+
"directory": "packages/react"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./tokens.css": "./dist/tokens.css",
|
|
21
|
+
"./typography.css": "./dist/typography.css",
|
|
22
|
+
"./color.css": "./dist/color.css",
|
|
23
|
+
"./button.css": "./dist/button.css",
|
|
24
|
+
"./tabs.css": "./dist/tabs.css",
|
|
25
|
+
"./classes.css": "./dist/classes.css",
|
|
26
|
+
"./styles.css": "./dist/styles.css",
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": ">=19.0.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/react": "^19.1.6",
|
|
39
|
+
"esbuild": "^0.28.2",
|
|
40
|
+
"react": "^19.1.0",
|
|
41
|
+
"typescript": "^5.8.3",
|
|
42
|
+
"@finhay/leaf-tokens": "0.0.0",
|
|
43
|
+
"@finhay/tsconfig": "0.0.0"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"registry": "https://registry.npmjs.org",
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsc -p tsconfig.build.json && node scripts/build-css.mjs && node scripts/build-cdn.mjs",
|
|
51
|
+
"dev": "node scripts/build-css.mjs && tsc -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
52
|
+
"clean": "rm -rf dist",
|
|
53
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
54
|
+
}
|
|
55
|
+
}
|