@finhay-pro/leaf-design-system 0.1.6 → 0.1.7

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 (53) hide show
  1. package/README.md +175 -81
  2. package/dist/border.css +154 -17
  3. package/dist/button.css +2 -12
  4. package/dist/cdn/leaf-0.1.7.min.css +2 -0
  5. package/dist/cdn/leaf-0.1.7.min.js +2 -0
  6. package/dist/classes.css +1898 -268
  7. package/dist/color.css +27 -32
  8. package/dist/components/Button/Button.d.ts.map +1 -1
  9. package/dist/components/Button/Button.js +3 -3
  10. package/dist/components/Button/Button.js.map +1 -1
  11. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  12. package/dist/components/Dialog/Dialog.js +1 -1
  13. package/dist/components/Dialog/Dialog.js.map +1 -1
  14. package/dist/components/Logo/Logo.d.ts.map +1 -1
  15. package/dist/components/Logo/Logo.js +2 -2
  16. package/dist/components/Logo/Logo.js.map +1 -1
  17. package/dist/components/Skeleton/Skeleton.js +1 -1
  18. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  19. package/dist/components/Slider/Slider.js +2 -2
  20. package/dist/components/Slider/Slider.js.map +1 -1
  21. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  22. package/dist/components/Spinner/Spinner.js +2 -2
  23. package/dist/components/Spinner/Spinner.js.map +1 -1
  24. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  25. package/dist/components/Tabs/Tabs.js +3 -3
  26. package/dist/components/Tabs/Tabs.js.map +1 -1
  27. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  28. package/dist/components/Toggle/Toggle.js +1 -1
  29. package/dist/components/Toggle/Toggle.js.map +1 -1
  30. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  31. package/dist/components/Tooltip/Tooltip.js +2 -2
  32. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  33. package/dist/dialog.css +4 -36
  34. package/dist/flex.css +229 -0
  35. package/dist/grid.css +533 -0
  36. package/dist/logo.css +2 -7
  37. package/dist/overflow.css +72 -0
  38. package/dist/position.css +140 -0
  39. package/dist/sizing.css +377 -0
  40. package/dist/skeleton.css +0 -4
  41. package/dist/slider.css +3 -31
  42. package/dist/spacing.css +71 -4
  43. package/dist/spinner.css +2 -16
  44. package/dist/styles.css +1909 -276
  45. package/dist/tabs.css +2 -13
  46. package/dist/text-layout.css +219 -0
  47. package/dist/toggle.css +1 -9
  48. package/dist/tokens.css +11 -8
  49. package/dist/tooltip.css +2 -15
  50. package/dist/typography.css +1 -3
  51. package/package.json +7 -1
  52. package/dist/cdn/leaf-0.1.6.min.css +0 -2
  53. package/dist/cdn/leaf-0.1.6.min.js +0 -2
package/dist/tabs.css CHANGED
@@ -28,10 +28,7 @@
28
28
  --leaf-tab-line-height: var(--body-3-line-height);
29
29
  --leaf-tab-font-weight: var(--body-3-highlight-weight);
30
30
 
31
- display: flex;
32
- flex-wrap: wrap;
33
- align-items: center;
34
- gap: 12px;
31
+ /* flex / wrap / items / gap-m — class Leaf trên markup */
35
32
  }
36
33
 
37
34
  .leaf-tabs[data-size="lg"] {
@@ -59,9 +56,6 @@
59
56
  }
60
57
 
61
58
  .leaf-tab {
62
- display: inline-flex;
63
- align-items: center;
64
- justify-content: center;
65
59
  border: none;
66
60
  margin: 0;
67
61
  padding: 0;
@@ -70,13 +64,11 @@
70
64
  color: inherit;
71
65
  font: inherit;
72
66
  font-family: var(--font-sans);
73
- text-align: center;
74
- white-space: nowrap;
75
67
  box-sizing: border-box;
76
68
  appearance: none;
77
69
  }
78
70
 
79
- /* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để `hidden` luôn ẩn. */
71
+ /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
80
72
  .leaf-tabs[hidden],
81
73
  .leaf-tab[hidden] {
82
74
  display: none;
@@ -88,9 +80,6 @@
88
80
  }
89
81
 
90
82
  .leaf-tab__label {
91
- display: inline-flex;
92
- align-items: center;
93
- justify-content: center;
94
83
  line-height: inherit;
95
84
  }
96
85
 
@@ -0,0 +1,219 @@
1
+ /* @finhay-pro/leaf-design-system — generated by scripts/build-css.mjs. Do not edit. */
2
+ @layer theme, base, components, utilities;
3
+
4
+ /* --- src/styles/text-layout.css --- */
5
+
6
+ /*
7
+ * Text layout classes — căn chữ, whitespace, truncate, line-clamp, transform,
8
+ * decoration, vertical-align.
9
+ *
10
+ * Tên file `text-layout.css` để tránh lẫn với class màu `text-*` và typography.css.
11
+ * Không gồm wrap-break-*, italic, tabular-nums, cursor.
12
+ *
13
+ * Nằm trong @layer components (cùng lý do với flex.css).
14
+ */
15
+
16
+ @layer components {
17
+ .text-left {
18
+ text-align: left;
19
+ }
20
+
21
+ .text-center {
22
+ text-align: center;
23
+ }
24
+
25
+ .text-right {
26
+ text-align: right;
27
+ }
28
+
29
+ .text-justify {
30
+ text-align: justify;
31
+ }
32
+
33
+ .text-start {
34
+ text-align: start;
35
+ }
36
+
37
+ .text-end {
38
+ text-align: end;
39
+ }
40
+
41
+ .whitespace-normal {
42
+ white-space: normal;
43
+ }
44
+
45
+ .whitespace-nowrap {
46
+ white-space: nowrap;
47
+ }
48
+
49
+ .whitespace-pre {
50
+ white-space: pre;
51
+ }
52
+
53
+ .whitespace-pre-line {
54
+ white-space: pre-line;
55
+ }
56
+
57
+ .whitespace-pre-wrap {
58
+ white-space: pre-wrap;
59
+ }
60
+
61
+ .whitespace-break-spaces {
62
+ white-space: break-spaces;
63
+ }
64
+
65
+ .truncate {
66
+ overflow: hidden;
67
+ text-overflow: ellipsis;
68
+ white-space: nowrap;
69
+ }
70
+
71
+ .text-ellipsis {
72
+ text-overflow: ellipsis;
73
+ }
74
+
75
+ .text-clip {
76
+ text-overflow: clip;
77
+ }
78
+
79
+ .text-wrap {
80
+ text-wrap: wrap;
81
+ }
82
+
83
+ .text-nowrap {
84
+ text-wrap: nowrap;
85
+ }
86
+
87
+ .text-balance {
88
+ text-wrap: balance;
89
+ }
90
+
91
+ .text-pretty {
92
+ text-wrap: pretty;
93
+ }
94
+
95
+ .break-normal {
96
+ overflow-wrap: normal;
97
+ word-break: normal;
98
+ }
99
+
100
+ .break-all {
101
+ word-break: break-all;
102
+ }
103
+
104
+ .break-keep {
105
+ word-break: keep-all;
106
+ }
107
+
108
+ .line-clamp-1 {
109
+ overflow: hidden;
110
+ display: -webkit-box;
111
+ -webkit-box-orient: vertical;
112
+ -webkit-line-clamp: 1;
113
+ }
114
+
115
+ .line-clamp-2 {
116
+ overflow: hidden;
117
+ display: -webkit-box;
118
+ -webkit-box-orient: vertical;
119
+ -webkit-line-clamp: 2;
120
+ }
121
+
122
+ .line-clamp-3 {
123
+ overflow: hidden;
124
+ display: -webkit-box;
125
+ -webkit-box-orient: vertical;
126
+ -webkit-line-clamp: 3;
127
+ }
128
+
129
+ .line-clamp-4 {
130
+ overflow: hidden;
131
+ display: -webkit-box;
132
+ -webkit-box-orient: vertical;
133
+ -webkit-line-clamp: 4;
134
+ }
135
+
136
+ .line-clamp-5 {
137
+ overflow: hidden;
138
+ display: -webkit-box;
139
+ -webkit-box-orient: vertical;
140
+ -webkit-line-clamp: 5;
141
+ }
142
+
143
+ .line-clamp-6 {
144
+ overflow: hidden;
145
+ display: -webkit-box;
146
+ -webkit-box-orient: vertical;
147
+ -webkit-line-clamp: 6;
148
+ }
149
+
150
+ .line-clamp-none {
151
+ overflow: visible;
152
+ display: block;
153
+ -webkit-box-orient: horizontal;
154
+ -webkit-line-clamp: unset;
155
+ }
156
+
157
+ /* line-clamp set display — `hidden` vẫn phải ẩn (cùng lý do với flex.css). */
158
+ .line-clamp-1[hidden],
159
+ .line-clamp-2[hidden],
160
+ .line-clamp-3[hidden],
161
+ .line-clamp-4[hidden],
162
+ .line-clamp-5[hidden],
163
+ .line-clamp-6[hidden],
164
+ .line-clamp-none[hidden] {
165
+ display: none;
166
+ }
167
+
168
+ .uppercase {
169
+ text-transform: uppercase;
170
+ }
171
+
172
+ .lowercase {
173
+ text-transform: lowercase;
174
+ }
175
+
176
+ .capitalize {
177
+ text-transform: capitalize;
178
+ }
179
+
180
+ .normal-case {
181
+ text-transform: none;
182
+ }
183
+
184
+ .underline {
185
+ text-decoration-line: underline;
186
+ }
187
+
188
+ .line-through {
189
+ text-decoration-line: line-through;
190
+ }
191
+
192
+ .no-underline {
193
+ text-decoration-line: none;
194
+ }
195
+
196
+ .align-top {
197
+ vertical-align: top;
198
+ }
199
+
200
+ .align-middle {
201
+ vertical-align: middle;
202
+ }
203
+
204
+ .align-bottom {
205
+ vertical-align: bottom;
206
+ }
207
+
208
+ .align-baseline {
209
+ vertical-align: baseline;
210
+ }
211
+
212
+ .align-text-top {
213
+ vertical-align: text-top;
214
+ }
215
+
216
+ .align-text-bottom {
217
+ vertical-align: text-bottom;
218
+ }
219
+ }
package/dist/toggle.css CHANGED
@@ -21,10 +21,6 @@
21
21
  var(--leaf-toggle-width) - var(--leaf-toggle-padding) * 2 - var(--leaf-toggle-thumb)
22
22
  );
23
23
 
24
- position: relative;
25
- display: inline-flex;
26
- flex-shrink: 0;
27
- align-items: center;
28
24
  box-sizing: border-box;
29
25
  width: var(--leaf-toggle-width);
30
26
  height: var(--leaf-toggle-height);
@@ -34,7 +30,6 @@
34
30
  border-radius: 12px;
35
31
  background-color: var(--base-quaternary);
36
32
  cursor: pointer;
37
- vertical-align: middle;
38
33
  appearance: none;
39
34
  -webkit-appearance: none;
40
35
  font: inherit;
@@ -42,15 +37,12 @@
42
37
  transition: background-color 0.2s ease;
43
38
  }
44
39
 
45
- /* `display` ở trên thắng `[hidden]` của trình duyệt — khai báo lại để `hidden` luôn ẩn. */
40
+ /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
46
41
  .leaf-toggle[hidden] {
47
42
  display: none;
48
43
  }
49
44
 
50
45
  .leaf-toggle__thumb {
51
- display: flex;
52
- align-items: center;
53
- justify-content: center;
54
46
  width: var(--leaf-toggle-thumb);
55
47
  height: var(--leaf-toggle-thumb);
56
48
  border-radius: 100px;
package/dist/tokens.css CHANGED
@@ -269,6 +269,7 @@
269
269
 
270
270
  :root {
271
271
  --spacing-0: 0px;
272
+ --spacing-2xs: 2px;
272
273
  --spacing-xs: 4px;
273
274
  --spacing-s: 8px;
274
275
  --spacing-m: 12px;
@@ -284,14 +285,16 @@
284
285
 
285
286
  /* --- ../tokens/src/border.css --- */
286
287
 
287
- /* Border radius tokens — Figma 700:4390. Map sang spacing cùng bậc. */
288
+ /* Border tokens — độ dày viền + bo góc. */
288
289
 
289
290
  :root {
290
- --radius-0: var(--spacing-0);
291
- --radius-xs: var(--spacing-xs);
292
- --radius-s: var(--spacing-s);
293
- --radius-m: var(--spacing-m);
294
- --radius-l: var(--spacing-l);
295
- --radius-xl: var(--spacing-xl);
296
- --radius-2xl: var(--spacing-2xl);
291
+ --border-width-s: 0.5px;
292
+ --border-width-m: 1px;
293
+ --border-width-l: 1.5px;
294
+ --border-width-xl: 2px;
295
+
296
+ --radius-s: 4px;
297
+ --radius-m: 8px;
298
+ --radius-l: 12px;
299
+ --radius-full: 9999px; /* pill / circle */
297
300
  }
package/dist/tooltip.css CHANGED
@@ -14,13 +14,6 @@
14
14
  */
15
15
 
16
16
  @layer components {
17
- .leaf-tooltip-trigger {
18
- position: relative;
19
- display: inline-flex;
20
- max-width: 100%;
21
- vertical-align: middle;
22
- }
23
-
24
17
  .leaf-tooltip {
25
18
  --leaf-tooltip-pad-y: 8px;
26
19
  --leaf-tooltip-pad-x: 16px;
@@ -35,6 +28,7 @@
35
28
  /* Chiều rộng tam giác thật trong khung. */
36
29
  --leaf-tooltip-caret-tip: 12px;
37
30
 
31
+ /* inline-flex — class Leaf; direction / align vẫn ở CSS (đổi theo data-position / data-align) */
38
32
  display: inline-flex;
39
33
  flex-direction: column;
40
34
  align-items: center;
@@ -53,21 +47,17 @@
53
47
  z-index: var(--leaf-z-tooltip, 110);
54
48
  }
55
49
 
56
- /* `display` của .leaf-tooltip thắng `[hidden]` của trình duyệt — bản vanilla ẩn bubble bằng hidden. */
50
+ /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
57
51
  .leaf-tooltip-trigger[hidden],
58
52
  .leaf-tooltip[hidden] {
59
53
  display: none;
60
54
  }
61
55
 
62
56
  .leaf-tooltip__body {
63
- position: relative;
64
- z-index: 1;
65
57
  box-sizing: border-box;
66
- max-width: 100%;
67
58
  padding: var(--leaf-tooltip-pad-y) var(--leaf-tooltip-pad-x);
68
59
  border-radius: var(--leaf-tooltip-radius);
69
60
  background-color: var(--base-quaternary);
70
- text-align: left;
71
61
  word-break: break-word;
72
62
  }
73
63
 
@@ -76,9 +66,6 @@
76
66
  * Mặc định: mũi nhọn xuống (position=top — caret dưới body).
77
67
  */
78
68
  .leaf-tooltip__caret {
79
- position: relative;
80
- display: block;
81
- flex-shrink: 0;
82
69
  width: var(--leaf-tooltip-caret-w);
83
70
  height: var(--leaf-tooltip-caret-h);
84
71
  background-color: transparent;
@@ -13,9 +13,7 @@
13
13
  * weight (400 / 600 / 700 theo token). Letter spacing, margin, màu chữ không
14
14
  * thuộc stylesheet này — màu dùng class text-* riêng.
15
15
  *
16
- * Toàn bộ nằm trong `@layer components` để utility của Tailwind (`@layer
17
- * utilities`) luôn thắng: `class="heading-1 font-bold"` hay `class="body-3
18
- * text-2xl"` đều override được mà không cần important modifier.
16
+ * Toàn bộ nằm trong `@layer components` — SCSS module (ngoài layer) override được.
19
17
  */
20
18
 
21
19
  @layer components {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finhay-pro/leaf-design-system",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "React component library của Finhay Leaf Design System",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -22,6 +22,12 @@
22
22
  "./color.css": "./dist/color.css",
23
23
  "./spacing.css": "./dist/spacing.css",
24
24
  "./border.css": "./dist/border.css",
25
+ "./flex.css": "./dist/flex.css",
26
+ "./grid.css": "./dist/grid.css",
27
+ "./sizing.css": "./dist/sizing.css",
28
+ "./overflow.css": "./dist/overflow.css",
29
+ "./position.css": "./dist/position.css",
30
+ "./text-layout.css": "./dist/text-layout.css",
25
31
  "./button.css": "./dist/button.css",
26
32
  "./tabs.css": "./dist/tabs.css",
27
33
  "./dialog.css": "./dist/dialog.css",