@finhay-pro/leaf-design-system 0.1.7 → 0.1.9
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 +384 -212
- package/dist/button.css +21 -13
- package/dist/calendar.css +325 -0
- package/dist/cdn/leaf-0.1.9.min.css +2 -0
- package/dist/cdn/leaf-0.1.9.min.js +2 -0
- package/dist/checkbox.css +132 -0
- package/dist/classes.css +2272 -3155
- package/dist/color.css +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +49 -0
- package/dist/components/Calendar/Calendar.d.ts.map +1 -0
- package/dist/components/Calendar/Calendar.js +167 -0
- package/dist/components/Calendar/Calendar.js.map +1 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Calendar/index.d.ts.map +1 -0
- package/dist/components/Calendar/index.js +2 -0
- package/dist/components/Calendar/index.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +25 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +40 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/Checkbox/index.js +2 -0
- package/dist/components/Checkbox/index.js.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +62 -0
- package/dist/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/dist/components/Dropdown/Dropdown.js +199 -0
- package/dist/components/Dropdown/Dropdown.js.map +1 -0
- package/dist/components/Dropdown/LanguageDropdown.d.ts +15 -0
- package/dist/components/Dropdown/LanguageDropdown.d.ts.map +1 -0
- package/dist/components/Dropdown/LanguageDropdown.js +18 -0
- package/dist/components/Dropdown/LanguageDropdown.js.map +1 -0
- package/dist/components/Dropdown/index.d.ts +4 -0
- package/dist/components/Dropdown/index.d.ts.map +1 -0
- package/dist/components/Dropdown/index.js +5 -0
- package/dist/components/Dropdown/index.js.map +1 -0
- package/dist/components/Input/Input.d.ts +57 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/Input.js +78 -0
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Input/InputDate.d.ts +65 -0
- package/dist/components/Input/InputDate.d.ts.map +1 -0
- package/dist/components/Input/InputDate.js +129 -0
- package/dist/components/Input/InputDate.js.map +1 -0
- package/dist/components/Input/InputOtp.d.ts +33 -0
- package/dist/components/Input/InputOtp.d.ts.map +1 -0
- package/dist/components/Input/InputOtp.js +96 -0
- package/dist/components/Input/InputOtp.js.map +1 -0
- package/dist/components/Input/InputStepper.d.ts +42 -0
- package/dist/components/Input/InputStepper.d.ts.map +1 -0
- package/dist/components/Input/InputStepper.js +86 -0
- package/dist/components/Input/InputStepper.js.map +1 -0
- package/dist/components/Input/index.d.ts +5 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Input/index.js +5 -0
- package/dist/components/Input/index.js.map +1 -0
- package/dist/components/Logo/Logo.d.ts.map +1 -1
- package/dist/components/Logo/Logo.js +2 -2
- package/dist/components/Logo/Logo.js.map +1 -1
- package/dist/components/Radio/Radio.d.ts +39 -0
- package/dist/components/Radio/Radio.d.ts.map +1 -0
- package/dist/components/Radio/Radio.js +50 -0
- package/dist/components/Radio/Radio.js.map +1 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/index.d.ts.map +1 -0
- package/dist/components/Radio/index.js +2 -0
- package/dist/components/Radio/index.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Slider/Slider.d.ts +1 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/Slider.js +9 -6
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.js +2 -2
- package/dist/components/Spinner/Spinner.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +3 -3
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Toast/Toast.d.ts +66 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/Toast.js +77 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/index.js.map +1 -0
- package/dist/components/Toggle/Toggle.d.ts +2 -1
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.js +6 -3
- package/dist/components/Toggle/Toggle.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +13 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +2 -2
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/core/calendar.d.ts +36 -0
- package/dist/core/calendar.d.ts.map +1 -0
- package/dist/core/calendar.js +65 -0
- package/dist/core/calendar.js.map +1 -0
- package/dist/core/dropdown.d.ts +66 -0
- package/dist/core/dropdown.d.ts.map +1 -0
- package/dist/core/dropdown.js +131 -0
- package/dist/core/dropdown.js.map +1 -0
- package/dist/core/language.d.ts +25 -0
- package/dist/core/language.d.ts.map +1 -0
- package/dist/core/language.js +17 -0
- package/dist/core/language.js.map +1 -0
- package/dist/core/otp.d.ts +30 -0
- package/dist/core/otp.d.ts.map +1 -0
- package/dist/core/otp.js +65 -0
- package/dist/core/otp.js.map +1 -0
- package/dist/core/stepper.d.ts +39 -0
- package/dist/core/stepper.d.ts.map +1 -0
- package/dist/core/stepper.js +109 -0
- package/dist/core/stepper.js.map +1 -0
- package/dist/core/toast.d.ts +67 -0
- package/dist/core/toast.d.ts.map +1 -0
- package/dist/core/toast.js +102 -0
- package/dist/core/toast.js.map +1 -0
- package/dist/core/tooltip.d.ts +4 -0
- package/dist/core/tooltip.d.ts.map +1 -1
- package/dist/core/tooltip.js.map +1 -1
- package/dist/dialog.css +42 -4
- package/dist/dropdown.css +303 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/input-date.css +49 -0
- package/dist/input-otp.css +76 -0
- package/dist/input-stepper.css +179 -0
- package/dist/input.css +218 -0
- package/dist/logo.css +7 -2
- package/dist/radio.css +124 -0
- package/dist/skeleton.css +4 -0
- package/dist/slider.css +36 -6
- package/dist/spinner.css +16 -2
- package/dist/styles.css +2272 -3191
- package/dist/tabs.css +15 -3
- package/dist/toast.css +234 -0
- package/dist/toggle.css +21 -9
- package/dist/tokens.css +0 -36
- package/dist/tooltip.css +17 -3
- package/package.json +10 -9
- package/dist/border.css +0 -182
- package/dist/cdn/leaf-0.1.7.min.css +0 -2
- package/dist/cdn/leaf-0.1.7.min.js +0 -2
- package/dist/flex.css +0 -229
- package/dist/grid.css +0 -533
- package/dist/overflow.css +0 -72
- package/dist/position.css +0 -140
- package/dist/sizing.css +0 -377
- package/dist/spacing.css +0 -906
- package/dist/text-layout.css +0 -219
package/dist/tabs.css
CHANGED
|
@@ -28,7 +28,10 @@
|
|
|
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
|
-
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 12px;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
.leaf-tabs[data-size="lg"] {
|
|
@@ -56,6 +59,11 @@
|
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
.leaf-tab {
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
text-align: center;
|
|
66
|
+
white-space: nowrap;
|
|
59
67
|
border: none;
|
|
60
68
|
margin: 0;
|
|
61
69
|
padding: 0;
|
|
@@ -68,9 +76,10 @@
|
|
|
68
76
|
appearance: none;
|
|
69
77
|
}
|
|
70
78
|
|
|
71
|
-
/* `hidden` luôn ẩn —
|
|
79
|
+
/* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
72
80
|
.leaf-tabs[hidden],
|
|
73
|
-
.leaf-tab[hidden]
|
|
81
|
+
.leaf-tab[hidden],
|
|
82
|
+
.leaf-tab__label[hidden] {
|
|
74
83
|
display: none;
|
|
75
84
|
}
|
|
76
85
|
|
|
@@ -80,6 +89,9 @@
|
|
|
80
89
|
}
|
|
81
90
|
|
|
82
91
|
.leaf-tab__label {
|
|
92
|
+
display: inline-flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
83
95
|
line-height: inherit;
|
|
84
96
|
}
|
|
85
97
|
|
package/dist/toast.css
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/* @finhay-pro/leaf-design-system — generated by scripts/build-css.mjs. Do not edit. */
|
|
2
|
+
@layer theme, base, components, utilities;
|
|
3
|
+
|
|
4
|
+
/* --- src/components/Toast/toast.css --- */
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* Toast — thông báo ngắn góc màn hình.
|
|
8
|
+
*
|
|
9
|
+
* Status qua data-status: success (viền / icon / progress --text-highlight, nền
|
|
10
|
+
* --system-green-secondary) · error (--system-red / --system-red-secondary) · warning
|
|
11
|
+
* (--system-yellow / --system-yellow-secondary). Thiếu attribute → success.
|
|
12
|
+
*
|
|
13
|
+
* Nền thang 800 ở cả hai theme → toast gắn sẵn `data-theme="dark"` để chữ giữ màu sáng.
|
|
14
|
+
* Thời gian tự đóng = animation của thanh progress (--leaf-toast-duration), dừng khi
|
|
15
|
+
* hover / focus; hết animation thì JS đóng toast. data-state="closing" chạy hiệu ứng ra.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
@layer components {
|
|
19
|
+
.leaf-toaster {
|
|
20
|
+
--leaf-toast-enter-x: 24px;
|
|
21
|
+
--leaf-toast-enter-y: 0px;
|
|
22
|
+
|
|
23
|
+
position: fixed;
|
|
24
|
+
top: 16px;
|
|
25
|
+
right: 16px;
|
|
26
|
+
z-index: var(--leaf-z-toast, 120);
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
align-items: flex-end;
|
|
30
|
+
gap: 8px;
|
|
31
|
+
max-width: calc(100vw - 32px);
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.leaf-toaster[data-position="top-left"],
|
|
38
|
+
.leaf-toaster[data-position="bottom-left"] {
|
|
39
|
+
--leaf-toast-enter-x: -24px;
|
|
40
|
+
right: auto;
|
|
41
|
+
left: 16px;
|
|
42
|
+
align-items: flex-start;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.leaf-toaster[data-position="top-center"],
|
|
46
|
+
.leaf-toaster[data-position="bottom-center"] {
|
|
47
|
+
--leaf-toast-enter-x: 0px;
|
|
48
|
+
--leaf-toast-enter-y: -12px;
|
|
49
|
+
right: auto;
|
|
50
|
+
left: 50%;
|
|
51
|
+
align-items: center;
|
|
52
|
+
transform: translateX(-50%);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.leaf-toaster[data-position^="bottom"] {
|
|
56
|
+
top: auto;
|
|
57
|
+
bottom: 16px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.leaf-toaster[data-position="bottom-center"] {
|
|
61
|
+
--leaf-toast-enter-y: 12px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.leaf-toaster > .leaf-toast {
|
|
65
|
+
pointer-events: auto;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.leaf-toast {
|
|
69
|
+
--leaf-toast-accent: var(--text-highlight);
|
|
70
|
+
--leaf-toast-surface: var(--system-green-secondary);
|
|
71
|
+
|
|
72
|
+
position: relative;
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 8px;
|
|
76
|
+
width: 320px;
|
|
77
|
+
max-width: 100%;
|
|
78
|
+
margin: 0;
|
|
79
|
+
padding: 12px;
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
border: 1px solid var(--leaf-toast-accent);
|
|
83
|
+
border-radius: 12px;
|
|
84
|
+
background-color: var(--leaf-toast-surface);
|
|
85
|
+
box-shadow: 0 10px 15px -3px color-mix(in srgb, var(--overlay) 30%, transparent);
|
|
86
|
+
color: var(--text-primary);
|
|
87
|
+
font-family: var(--font-sans);
|
|
88
|
+
animation: leaf-toast-in 300ms ease-out;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.leaf-toast[data-status="error"] {
|
|
92
|
+
--leaf-toast-accent: var(--system-red);
|
|
93
|
+
--leaf-toast-surface: var(--system-red-secondary);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.leaf-toast[data-status="warning"] {
|
|
97
|
+
--leaf-toast-accent: var(--system-yellow);
|
|
98
|
+
--leaf-toast-surface: var(--system-yellow-secondary);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.leaf-toast[data-state="closing"] {
|
|
102
|
+
animation: leaf-toast-out 300ms ease-in forwards;
|
|
103
|
+
pointer-events: none;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.leaf-toaster[hidden],
|
|
107
|
+
.leaf-toast[hidden],
|
|
108
|
+
.leaf-toast__icon[hidden],
|
|
109
|
+
.leaf-toast__content[hidden],
|
|
110
|
+
.leaf-toast__close[hidden],
|
|
111
|
+
.leaf-toast__glyph[hidden],
|
|
112
|
+
.leaf-toast__progress[hidden],
|
|
113
|
+
.leaf-toast__progress-bar[hidden] {
|
|
114
|
+
display: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.leaf-toast__icon {
|
|
118
|
+
display: inline-flex;
|
|
119
|
+
flex-shrink: 0;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
padding: 6px;
|
|
123
|
+
border-radius: 9999px;
|
|
124
|
+
background-color: var(--leaf-toast-accent);
|
|
125
|
+
color: var(--text-primary);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.leaf-toast__glyph {
|
|
129
|
+
display: block;
|
|
130
|
+
width: 14px;
|
|
131
|
+
height: 14px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.leaf-toast__content {
|
|
135
|
+
display: flex;
|
|
136
|
+
flex: 1 1 auto;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
min-width: 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.leaf-toast__title,
|
|
142
|
+
.leaf-toast__description {
|
|
143
|
+
margin: 0;
|
|
144
|
+
color: var(--text-primary);
|
|
145
|
+
overflow-wrap: anywhere;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.leaf-toast__title {
|
|
149
|
+
font-size: var(--body-3-size);
|
|
150
|
+
line-height: var(--body-3-line-height);
|
|
151
|
+
font-weight: var(--body-3-highlight-weight);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.leaf-toast__description {
|
|
155
|
+
font-size: var(--body-4-size);
|
|
156
|
+
line-height: var(--body-4-line-height);
|
|
157
|
+
font-weight: var(--body-4-weight);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.leaf-toast__close {
|
|
161
|
+
display: inline-flex;
|
|
162
|
+
flex-shrink: 0;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
margin: 0;
|
|
166
|
+
padding: 0;
|
|
167
|
+
border: none;
|
|
168
|
+
border-radius: 4px;
|
|
169
|
+
background: transparent;
|
|
170
|
+
color: var(--text-primary);
|
|
171
|
+
font: inherit;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
appearance: none;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.leaf-toast__close:focus-visible {
|
|
177
|
+
outline: 2px solid var(--leaf-toast-accent);
|
|
178
|
+
outline-offset: 2px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.leaf-toast__progress {
|
|
182
|
+
position: absolute;
|
|
183
|
+
bottom: 0;
|
|
184
|
+
left: 0;
|
|
185
|
+
width: 100%;
|
|
186
|
+
height: 4px;
|
|
187
|
+
background-color: color-mix(in srgb, var(--text-primary) 10%, transparent);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.leaf-toast__progress-bar {
|
|
191
|
+
width: 100%;
|
|
192
|
+
height: 100%;
|
|
193
|
+
background-color: var(--leaf-toast-accent);
|
|
194
|
+
transform-origin: left center;
|
|
195
|
+
animation: leaf-toast-progress var(--leaf-toast-duration, 4000ms) linear forwards;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.leaf-toast:is(:hover, :focus-within) .leaf-toast__progress-bar,
|
|
199
|
+
.leaf-toast[data-state="closing"] .leaf-toast__progress-bar {
|
|
200
|
+
animation-play-state: paused;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@keyframes leaf-toast-in {
|
|
204
|
+
from {
|
|
205
|
+
opacity: 0;
|
|
206
|
+
transform: translate(var(--leaf-toast-enter-x, 24px), var(--leaf-toast-enter-y, 0px));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@keyframes leaf-toast-out {
|
|
211
|
+
to {
|
|
212
|
+
opacity: 0;
|
|
213
|
+
transform: translate(var(--leaf-toast-enter-x, 24px), var(--leaf-toast-enter-y, 0px));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@keyframes leaf-toast-progress {
|
|
218
|
+
from {
|
|
219
|
+
transform: scaleX(1);
|
|
220
|
+
}
|
|
221
|
+
to {
|
|
222
|
+
transform: scaleX(0);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* Giảm chuyển động: chỉ mờ dần, không trượt. Progress vẫn chạy vì nó là bộ đếm giờ. */
|
|
227
|
+
@media (prefers-reduced-motion: reduce) {
|
|
228
|
+
.leaf-toaster,
|
|
229
|
+
.leaf-toast {
|
|
230
|
+
--leaf-toast-enter-x: 0px;
|
|
231
|
+
--leaf-toast-enter-y: 0px;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
package/dist/toggle.css
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* Toggle — Figma 730:12438.
|
|
8
8
|
*
|
|
9
9
|
* Size M/S qua data-size; Status On/Off qua aria-checked; Active Off qua
|
|
10
|
-
* :disabled
|
|
10
|
+
* :disabled hoặc aria-disabled="true" (cả hai đều chặn click — React lẫn leaf.js).
|
|
11
|
+
* Thumb trượt bằng transform. Checkmark chỉ hiện ở size sm khi
|
|
11
12
|
* On + Active. Thiếu attribute → md · off · enabled.
|
|
12
13
|
*/
|
|
13
14
|
|
|
@@ -21,6 +22,11 @@
|
|
|
21
22
|
var(--leaf-toggle-width) - var(--leaf-toggle-padding) * 2 - var(--leaf-toggle-thumb)
|
|
22
23
|
);
|
|
23
24
|
|
|
25
|
+
position: relative;
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
flex-shrink: 0;
|
|
28
|
+
align-items: center;
|
|
29
|
+
vertical-align: middle;
|
|
24
30
|
box-sizing: border-box;
|
|
25
31
|
width: var(--leaf-toggle-width);
|
|
26
32
|
height: var(--leaf-toggle-height);
|
|
@@ -37,12 +43,16 @@
|
|
|
37
43
|
transition: background-color 0.2s ease;
|
|
38
44
|
}
|
|
39
45
|
|
|
40
|
-
/* `hidden` luôn ẩn —
|
|
41
|
-
.leaf-toggle[hidden]
|
|
46
|
+
/* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
47
|
+
.leaf-toggle[hidden],
|
|
48
|
+
.leaf-toggle__thumb[hidden] {
|
|
42
49
|
display: none;
|
|
43
50
|
}
|
|
44
51
|
|
|
45
52
|
.leaf-toggle__thumb {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
46
56
|
width: var(--leaf-toggle-thumb);
|
|
47
57
|
height: var(--leaf-toggle-thumb);
|
|
48
58
|
border-radius: 100px;
|
|
@@ -61,23 +71,24 @@
|
|
|
61
71
|
}
|
|
62
72
|
|
|
63
73
|
/* Status On + Active — track xanh, thumb trắng, trượt phải. */
|
|
64
|
-
.leaf-toggle[aria-checked="true"]:not(:disabled) {
|
|
74
|
+
.leaf-toggle[aria-checked="true"]:not(:disabled, [aria-disabled="true"]) {
|
|
65
75
|
background-color: var(--system-green);
|
|
66
76
|
}
|
|
67
77
|
|
|
68
|
-
.leaf-toggle[aria-checked="true"]:not(:disabled) .leaf-toggle__thumb {
|
|
78
|
+
.leaf-toggle[aria-checked="true"]:not(:disabled, [aria-disabled="true"]) .leaf-toggle__thumb {
|
|
69
79
|
background-color: var(--icon-on-color);
|
|
70
80
|
transform: translateX(var(--leaf-toggle-travel));
|
|
71
81
|
}
|
|
72
82
|
|
|
73
83
|
/* Status On + Active Off (disabled on) — track quaternary, thumb tertiary, vẫn bên phải. */
|
|
74
|
-
.leaf-toggle[aria-checked="true"]:disabled .leaf-toggle__thumb {
|
|
84
|
+
.leaf-toggle[aria-checked="true"]:is(:disabled, [aria-disabled="true"]) .leaf-toggle__thumb {
|
|
75
85
|
background-color: var(--text-tertiary);
|
|
76
86
|
transform: translateX(var(--leaf-toggle-travel));
|
|
77
87
|
}
|
|
78
88
|
|
|
79
89
|
/* Status Off + Active Off — thumb tertiary, bên trái. */
|
|
80
|
-
.leaf-toggle:disabled:not([aria-checked="true"])
|
|
90
|
+
.leaf-toggle:is(:disabled, [aria-disabled="true"]):not([aria-checked="true"])
|
|
91
|
+
.leaf-toggle__thumb {
|
|
81
92
|
background-color: var(--text-tertiary);
|
|
82
93
|
}
|
|
83
94
|
|
|
@@ -89,11 +100,12 @@
|
|
|
89
100
|
}
|
|
90
101
|
|
|
91
102
|
/* Checkmark chỉ ở S · On · Active. */
|
|
92
|
-
.leaf-toggle[data-size="sm"][aria-checked="true"]:not(:disabled
|
|
103
|
+
.leaf-toggle[data-size="sm"][aria-checked="true"]:not(:disabled, [aria-disabled="true"])
|
|
104
|
+
.leaf-toggle__check {
|
|
93
105
|
display: block;
|
|
94
106
|
}
|
|
95
107
|
|
|
96
|
-
.leaf-toggle:disabled {
|
|
108
|
+
.leaf-toggle:is(:disabled, [aria-disabled="true"]) {
|
|
97
109
|
cursor: not-allowed;
|
|
98
110
|
}
|
|
99
111
|
|
package/dist/tokens.css
CHANGED
|
@@ -262,39 +262,3 @@
|
|
|
262
262
|
--body-5-weight: 400;
|
|
263
263
|
--body-5-highlight-weight: 600;
|
|
264
264
|
}
|
|
265
|
-
|
|
266
|
-
/* --- ../tokens/src/spacing.css --- */
|
|
267
|
-
|
|
268
|
-
/* Spacing tokens — Figma 34:1034. Dùng cho margin, padding, gap. */
|
|
269
|
-
|
|
270
|
-
:root {
|
|
271
|
-
--spacing-0: 0px;
|
|
272
|
-
--spacing-2xs: 2px;
|
|
273
|
-
--spacing-xs: 4px;
|
|
274
|
-
--spacing-s: 8px;
|
|
275
|
-
--spacing-m: 12px;
|
|
276
|
-
--spacing-l: 16px;
|
|
277
|
-
--spacing-xl: 24px;
|
|
278
|
-
--spacing-2xl: 36px;
|
|
279
|
-
--spacing-3xl: 48px;
|
|
280
|
-
--spacing-4xl: 60px;
|
|
281
|
-
--spacing-5xl: 84px;
|
|
282
|
-
--spacing-6xl: 120px;
|
|
283
|
-
--spacing-7xl: 240px;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/* --- ../tokens/src/border.css --- */
|
|
287
|
-
|
|
288
|
-
/* Border tokens — độ dày viền + bo góc. */
|
|
289
|
-
|
|
290
|
-
:root {
|
|
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 */
|
|
300
|
-
}
|
package/dist/tooltip.css
CHANGED
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
/* Chiều rộng tam giác thật trong khung. */
|
|
29
29
|
--leaf-tooltip-caret-tip: 12px;
|
|
30
30
|
|
|
31
|
-
/* inline-flex — class Leaf; direction / align vẫn ở CSS (đổi theo data-position / data-align) */
|
|
32
31
|
display: inline-flex;
|
|
33
32
|
flex-direction: column;
|
|
34
33
|
align-items: center;
|
|
@@ -42,18 +41,30 @@
|
|
|
42
41
|
pointer-events: none;
|
|
43
42
|
}
|
|
44
43
|
|
|
44
|
+
.leaf-tooltip-trigger {
|
|
45
|
+
position: relative;
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
max-width: 100%;
|
|
48
|
+
vertical-align: middle;
|
|
49
|
+
}
|
|
50
|
+
|
|
45
51
|
.leaf-tooltip--portal {
|
|
46
52
|
position: fixed;
|
|
47
53
|
z-index: var(--leaf-z-tooltip, 110);
|
|
48
54
|
}
|
|
49
55
|
|
|
50
|
-
/* `hidden` luôn ẩn —
|
|
56
|
+
/* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
51
57
|
.leaf-tooltip-trigger[hidden],
|
|
52
|
-
.leaf-tooltip[hidden]
|
|
58
|
+
.leaf-tooltip[hidden],
|
|
59
|
+
.leaf-tooltip__caret[hidden] {
|
|
53
60
|
display: none;
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
.leaf-tooltip__body {
|
|
64
|
+
position: relative;
|
|
65
|
+
z-index: 10;
|
|
66
|
+
max-width: 100%;
|
|
67
|
+
text-align: left;
|
|
57
68
|
box-sizing: border-box;
|
|
58
69
|
padding: var(--leaf-tooltip-pad-y) var(--leaf-tooltip-pad-x);
|
|
59
70
|
border-radius: var(--leaf-tooltip-radius);
|
|
@@ -66,6 +77,9 @@
|
|
|
66
77
|
* Mặc định: mũi nhọn xuống (position=top — caret dưới body).
|
|
67
78
|
*/
|
|
68
79
|
.leaf-tooltip__caret {
|
|
80
|
+
position: relative;
|
|
81
|
+
display: block;
|
|
82
|
+
flex-shrink: 0;
|
|
69
83
|
width: var(--leaf-tooltip-caret-w);
|
|
70
84
|
height: var(--leaf-tooltip-caret-h);
|
|
71
85
|
background-color: transparent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finhay-pro/leaf-design-system",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "React component library của Finhay Leaf Design System",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -20,14 +20,6 @@
|
|
|
20
20
|
"./tokens.css": "./dist/tokens.css",
|
|
21
21
|
"./typography.css": "./dist/typography.css",
|
|
22
22
|
"./color.css": "./dist/color.css",
|
|
23
|
-
"./spacing.css": "./dist/spacing.css",
|
|
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",
|
|
31
23
|
"./button.css": "./dist/button.css",
|
|
32
24
|
"./tabs.css": "./dist/tabs.css",
|
|
33
25
|
"./dialog.css": "./dist/dialog.css",
|
|
@@ -38,6 +30,15 @@
|
|
|
38
30
|
"./toggle.css": "./dist/toggle.css",
|
|
39
31
|
"./slider.css": "./dist/slider.css",
|
|
40
32
|
"./tooltip.css": "./dist/tooltip.css",
|
|
33
|
+
"./radio.css": "./dist/radio.css",
|
|
34
|
+
"./checkbox.css": "./dist/checkbox.css",
|
|
35
|
+
"./input.css": "./dist/input.css",
|
|
36
|
+
"./input-otp.css": "./dist/input-otp.css",
|
|
37
|
+
"./input-date.css": "./dist/input-date.css",
|
|
38
|
+
"./input-stepper.css": "./dist/input-stepper.css",
|
|
39
|
+
"./calendar.css": "./dist/calendar.css",
|
|
40
|
+
"./toast.css": "./dist/toast.css",
|
|
41
|
+
"./dropdown.css": "./dist/dropdown.css",
|
|
41
42
|
"./classes.css": "./dist/classes.css",
|
|
42
43
|
"./styles.css": "./dist/styles.css",
|
|
43
44
|
"./package.json": "./package.json"
|
package/dist/border.css
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
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/border.css --- */
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Border classes — map 1:1 sang token trong @finhay/leaf-tokens.
|
|
8
|
-
*
|
|
9
|
-
* Width: `border-s|m|l|xl` (+ biến thể cạnh `border-top-s`…).
|
|
10
|
-
* Mỗi class set width + `border-style: solid` để một class là thấy viền
|
|
11
|
-
* (không trông vào CSS reset).
|
|
12
|
-
* Hậu tố width khác hậu tố màu (`border-primary`… chỉ set border-color).
|
|
13
|
-
* Không có bậc 0 — không viền thì không gắn class.
|
|
14
|
-
*
|
|
15
|
-
* Radius: `radius-*` → border-radius. Hậu tố: s (4) · m (8) · l (12) · full.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
@layer utilities {
|
|
19
|
-
/* Radius */
|
|
20
|
-
|
|
21
|
-
.radius-s {
|
|
22
|
-
border-radius: var(--radius-s);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.radius-m {
|
|
26
|
-
border-radius: var(--radius-m);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.radius-l {
|
|
30
|
-
border-radius: var(--radius-l);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.radius-full {
|
|
34
|
-
border-radius: var(--radius-full);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* All sides */
|
|
38
|
-
|
|
39
|
-
.border-s {
|
|
40
|
-
border-width: var(--border-width-s);
|
|
41
|
-
border-style: solid;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.border-m {
|
|
45
|
-
border-width: var(--border-width-m);
|
|
46
|
-
border-style: solid;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.border-l {
|
|
50
|
-
border-width: var(--border-width-l);
|
|
51
|
-
border-style: solid;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.border-xl {
|
|
55
|
-
border-width: var(--border-width-xl);
|
|
56
|
-
border-style: solid;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* Per side */
|
|
60
|
-
|
|
61
|
-
.border-top-s {
|
|
62
|
-
border-top-width: var(--border-width-s);
|
|
63
|
-
border-top-style: solid;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.border-top-m {
|
|
67
|
-
border-top-width: var(--border-width-m);
|
|
68
|
-
border-top-style: solid;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.border-top-l {
|
|
72
|
-
border-top-width: var(--border-width-l);
|
|
73
|
-
border-top-style: solid;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.border-top-xl {
|
|
77
|
-
border-top-width: var(--border-width-xl);
|
|
78
|
-
border-top-style: solid;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.border-right-s {
|
|
82
|
-
border-right-width: var(--border-width-s);
|
|
83
|
-
border-right-style: solid;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.border-right-m {
|
|
87
|
-
border-right-width: var(--border-width-m);
|
|
88
|
-
border-right-style: solid;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.border-right-l {
|
|
92
|
-
border-right-width: var(--border-width-l);
|
|
93
|
-
border-right-style: solid;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.border-right-xl {
|
|
97
|
-
border-right-width: var(--border-width-xl);
|
|
98
|
-
border-right-style: solid;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.border-bottom-s {
|
|
102
|
-
border-bottom-width: var(--border-width-s);
|
|
103
|
-
border-bottom-style: solid;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.border-bottom-m {
|
|
107
|
-
border-bottom-width: var(--border-width-m);
|
|
108
|
-
border-bottom-style: solid;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.border-bottom-l {
|
|
112
|
-
border-bottom-width: var(--border-width-l);
|
|
113
|
-
border-bottom-style: solid;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.border-bottom-xl {
|
|
117
|
-
border-bottom-width: var(--border-width-xl);
|
|
118
|
-
border-bottom-style: solid;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.border-left-s {
|
|
122
|
-
border-left-width: var(--border-width-s);
|
|
123
|
-
border-left-style: solid;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.border-left-m {
|
|
127
|
-
border-left-width: var(--border-width-m);
|
|
128
|
-
border-left-style: solid;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.border-left-l {
|
|
132
|
-
border-left-width: var(--border-width-l);
|
|
133
|
-
border-left-style: solid;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.border-left-xl {
|
|
137
|
-
border-left-width: var(--border-width-xl);
|
|
138
|
-
border-left-style: solid;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/* Logical */
|
|
142
|
-
|
|
143
|
-
.border-inline-s {
|
|
144
|
-
border-inline-width: var(--border-width-s);
|
|
145
|
-
border-inline-style: solid;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.border-inline-m {
|
|
149
|
-
border-inline-width: var(--border-width-m);
|
|
150
|
-
border-inline-style: solid;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.border-inline-l {
|
|
154
|
-
border-inline-width: var(--border-width-l);
|
|
155
|
-
border-inline-style: solid;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.border-inline-xl {
|
|
159
|
-
border-inline-width: var(--border-width-xl);
|
|
160
|
-
border-inline-style: solid;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.border-block-s {
|
|
164
|
-
border-block-width: var(--border-width-s);
|
|
165
|
-
border-block-style: solid;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.border-block-m {
|
|
169
|
-
border-block-width: var(--border-width-m);
|
|
170
|
-
border-block-style: solid;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.border-block-l {
|
|
174
|
-
border-block-width: var(--border-width-l);
|
|
175
|
-
border-block-style: solid;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.border-block-xl {
|
|
179
|
-
border-block-width: var(--border-width-xl);
|
|
180
|
-
border-block-style: solid;
|
|
181
|
-
}
|
|
182
|
-
}
|