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

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 (153) hide show
  1. package/README.md +291 -196
  2. package/dist/button.css +19 -12
  3. package/dist/calendar.css +325 -0
  4. package/dist/cdn/leaf-0.1.8.min.css +2 -0
  5. package/dist/cdn/leaf-0.1.8.min.js +2 -0
  6. package/dist/checkbox.css +132 -0
  7. package/dist/classes.css +2265 -3152
  8. package/dist/color.css +1 -1
  9. package/dist/components/Button/Button.d.ts.map +1 -1
  10. package/dist/components/Button/Button.js +3 -3
  11. package/dist/components/Button/Button.js.map +1 -1
  12. package/dist/components/Calendar/Calendar.d.ts +49 -0
  13. package/dist/components/Calendar/Calendar.d.ts.map +1 -0
  14. package/dist/components/Calendar/Calendar.js +167 -0
  15. package/dist/components/Calendar/Calendar.js.map +1 -0
  16. package/dist/components/Calendar/index.d.ts +2 -0
  17. package/dist/components/Calendar/index.d.ts.map +1 -0
  18. package/dist/components/Calendar/index.js +2 -0
  19. package/dist/components/Calendar/index.js.map +1 -0
  20. package/dist/components/Checkbox/Checkbox.d.ts +25 -0
  21. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
  22. package/dist/components/Checkbox/Checkbox.js +40 -0
  23. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  24. package/dist/components/Checkbox/index.d.ts +2 -0
  25. package/dist/components/Checkbox/index.d.ts.map +1 -0
  26. package/dist/components/Checkbox/index.js +2 -0
  27. package/dist/components/Checkbox/index.js.map +1 -0
  28. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  29. package/dist/components/Dialog/Dialog.js +1 -1
  30. package/dist/components/Dialog/Dialog.js.map +1 -1
  31. package/dist/components/Dropdown/Dropdown.d.ts +62 -0
  32. package/dist/components/Dropdown/Dropdown.d.ts.map +1 -0
  33. package/dist/components/Dropdown/Dropdown.js +197 -0
  34. package/dist/components/Dropdown/Dropdown.js.map +1 -0
  35. package/dist/components/Dropdown/LanguageDropdown.d.ts +15 -0
  36. package/dist/components/Dropdown/LanguageDropdown.d.ts.map +1 -0
  37. package/dist/components/Dropdown/LanguageDropdown.js +18 -0
  38. package/dist/components/Dropdown/LanguageDropdown.js.map +1 -0
  39. package/dist/components/Dropdown/index.d.ts +4 -0
  40. package/dist/components/Dropdown/index.d.ts.map +1 -0
  41. package/dist/components/Dropdown/index.js +5 -0
  42. package/dist/components/Dropdown/index.js.map +1 -0
  43. package/dist/components/Input/Input.d.ts +57 -0
  44. package/dist/components/Input/Input.d.ts.map +1 -0
  45. package/dist/components/Input/Input.js +78 -0
  46. package/dist/components/Input/Input.js.map +1 -0
  47. package/dist/components/Input/InputDate.d.ts +56 -0
  48. package/dist/components/Input/InputDate.d.ts.map +1 -0
  49. package/dist/components/Input/InputDate.js +119 -0
  50. package/dist/components/Input/InputDate.js.map +1 -0
  51. package/dist/components/Input/InputOtp.d.ts +33 -0
  52. package/dist/components/Input/InputOtp.d.ts.map +1 -0
  53. package/dist/components/Input/InputOtp.js +96 -0
  54. package/dist/components/Input/InputOtp.js.map +1 -0
  55. package/dist/components/Input/InputStepper.d.ts +42 -0
  56. package/dist/components/Input/InputStepper.d.ts.map +1 -0
  57. package/dist/components/Input/InputStepper.js +86 -0
  58. package/dist/components/Input/InputStepper.js.map +1 -0
  59. package/dist/components/Input/index.d.ts +5 -0
  60. package/dist/components/Input/index.d.ts.map +1 -0
  61. package/dist/components/Input/index.js +5 -0
  62. package/dist/components/Input/index.js.map +1 -0
  63. package/dist/components/Logo/Logo.d.ts.map +1 -1
  64. package/dist/components/Logo/Logo.js +2 -2
  65. package/dist/components/Logo/Logo.js.map +1 -1
  66. package/dist/components/Radio/Radio.d.ts +39 -0
  67. package/dist/components/Radio/Radio.d.ts.map +1 -0
  68. package/dist/components/Radio/Radio.js +50 -0
  69. package/dist/components/Radio/Radio.js.map +1 -0
  70. package/dist/components/Radio/index.d.ts +2 -0
  71. package/dist/components/Radio/index.d.ts.map +1 -0
  72. package/dist/components/Radio/index.js +2 -0
  73. package/dist/components/Radio/index.js.map +1 -0
  74. package/dist/components/Skeleton/Skeleton.js +1 -1
  75. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  76. package/dist/components/Slider/Slider.js +2 -2
  77. package/dist/components/Slider/Slider.js.map +1 -1
  78. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  79. package/dist/components/Spinner/Spinner.js +2 -2
  80. package/dist/components/Spinner/Spinner.js.map +1 -1
  81. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  82. package/dist/components/Tabs/Tabs.js +3 -3
  83. package/dist/components/Tabs/Tabs.js.map +1 -1
  84. package/dist/components/Toast/Toast.d.ts +66 -0
  85. package/dist/components/Toast/Toast.d.ts.map +1 -0
  86. package/dist/components/Toast/Toast.js +77 -0
  87. package/dist/components/Toast/Toast.js.map +1 -0
  88. package/dist/components/Toast/index.d.ts +2 -0
  89. package/dist/components/Toast/index.d.ts.map +1 -0
  90. package/dist/components/Toast/index.js +2 -0
  91. package/dist/components/Toast/index.js.map +1 -0
  92. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  93. package/dist/components/Toggle/Toggle.js +1 -1
  94. package/dist/components/Toggle/Toggle.js.map +1 -1
  95. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  96. package/dist/components/Tooltip/Tooltip.js +2 -2
  97. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  98. package/dist/core/calendar.d.ts +36 -0
  99. package/dist/core/calendar.d.ts.map +1 -0
  100. package/dist/core/calendar.js +65 -0
  101. package/dist/core/calendar.js.map +1 -0
  102. package/dist/core/dropdown.d.ts +66 -0
  103. package/dist/core/dropdown.d.ts.map +1 -0
  104. package/dist/core/dropdown.js +131 -0
  105. package/dist/core/dropdown.js.map +1 -0
  106. package/dist/core/language.d.ts +25 -0
  107. package/dist/core/language.d.ts.map +1 -0
  108. package/dist/core/language.js +17 -0
  109. package/dist/core/language.js.map +1 -0
  110. package/dist/core/otp.d.ts +30 -0
  111. package/dist/core/otp.d.ts.map +1 -0
  112. package/dist/core/otp.js +65 -0
  113. package/dist/core/otp.js.map +1 -0
  114. package/dist/core/stepper.d.ts +39 -0
  115. package/dist/core/stepper.d.ts.map +1 -0
  116. package/dist/core/stepper.js +109 -0
  117. package/dist/core/stepper.js.map +1 -0
  118. package/dist/core/toast.d.ts +67 -0
  119. package/dist/core/toast.d.ts.map +1 -0
  120. package/dist/core/toast.js +102 -0
  121. package/dist/core/toast.js.map +1 -0
  122. package/dist/dialog.css +42 -4
  123. package/dist/dropdown.css +303 -0
  124. package/dist/index.d.ts +6 -0
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.js +6 -0
  127. package/dist/index.js.map +1 -1
  128. package/dist/input-date.css +49 -0
  129. package/dist/input-otp.css +76 -0
  130. package/dist/input-stepper.css +179 -0
  131. package/dist/input.css +218 -0
  132. package/dist/logo.css +7 -2
  133. package/dist/radio.css +124 -0
  134. package/dist/skeleton.css +4 -0
  135. package/dist/slider.css +36 -6
  136. package/dist/spinner.css +16 -2
  137. package/dist/styles.css +2265 -3188
  138. package/dist/tabs.css +15 -3
  139. package/dist/toast.css +234 -0
  140. package/dist/toggle.css +11 -2
  141. package/dist/tokens.css +0 -36
  142. package/dist/tooltip.css +17 -3
  143. package/package.json +10 -9
  144. package/dist/border.css +0 -182
  145. package/dist/cdn/leaf-0.1.7.min.css +0 -2
  146. package/dist/cdn/leaf-0.1.7.min.js +0 -2
  147. package/dist/flex.css +0 -229
  148. package/dist/grid.css +0 -533
  149. package/dist/overflow.css +0 -72
  150. package/dist/position.css +0 -140
  151. package/dist/sizing.css +0 -377
  152. package/dist/spacing.css +0 -906
  153. package/dist/text-layout.css +0 -219
@@ -0,0 +1,179 @@
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/Input/input-stepper.css --- */
5
+
6
+ /*
7
+ * InputStepper — Figma 1146:2159 (Buy / Sell).
8
+ *
9
+ * Tone qua data-tone (buy | sell — không có → base-tertiary); state qua :focus-within,
10
+ * data-invalid, data-disabled, data-filled. Nền 280 × (py 4 · px 12), radius 12; icon −/+ 20px.
11
+ * Label body-5 (secondary → primary khi focus), giá trị body-4-highlight (placeholder
12
+ * secondary, đã nhập primary). Typography là class Leaf trên markup.
13
+ * HTML tĩnh: −/+, mũi tên, format số nằm trong leaf.js (`data-leaf-input-stepper`).
14
+ */
15
+
16
+ @layer components {
17
+ .leaf-input-stepper {
18
+ --leaf-input-stepper-width: 280px;
19
+ --leaf-input-stepper-bg: var(--base-tertiary);
20
+ --leaf-input-stepper-focus: var(--text-highlight);
21
+ --leaf-input-stepper-border: transparent;
22
+ --leaf-input-stepper-label: var(--text-secondary);
23
+ --leaf-input-stepper-fg: var(--text-primary);
24
+ --leaf-input-stepper-icon: var(--text-primary);
25
+ --leaf-input-stepper-message: var(--text-secondary);
26
+
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 4px;
30
+ width: var(--leaf-input-stepper-width);
31
+ max-width: 100%;
32
+ }
33
+
34
+ .leaf-input-stepper[data-tone="buy"] {
35
+ --leaf-input-stepper-bg: var(--system-green-secondary);
36
+ }
37
+
38
+ .leaf-input-stepper[data-tone="sell"] {
39
+ --leaf-input-stepper-bg: var(--system-red-secondary);
40
+ --leaf-input-stepper-focus: var(--system-red);
41
+ }
42
+
43
+ .leaf-input-stepper__shell {
44
+ display: flex;
45
+ align-items: center;
46
+ gap: 8px;
47
+ box-sizing: border-box;
48
+ padding: 4px 12px;
49
+ border: 1px solid var(--leaf-input-stepper-border);
50
+ border-radius: 12px;
51
+ background-color: var(--leaf-input-stepper-bg);
52
+ cursor: text;
53
+ transition: border-color 0.15s ease;
54
+ }
55
+
56
+ .leaf-input-stepper__body {
57
+ display: flex;
58
+ flex: 1;
59
+ flex-direction: column;
60
+ align-items: center;
61
+ justify-content: center;
62
+ gap: 4px;
63
+ min-width: 0;
64
+ }
65
+
66
+ .leaf-input-stepper__value {
67
+ display: inline-flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ gap: 2px;
71
+ min-width: 0;
72
+ }
73
+
74
+ .leaf-input-stepper__label {
75
+ overflow: hidden;
76
+ text-overflow: ellipsis;
77
+ white-space: nowrap;
78
+ color: var(--leaf-input-stepper-label);
79
+ cursor: inherit;
80
+ transition: color 0.15s ease;
81
+ }
82
+
83
+ .leaf-input-stepper__input {
84
+ box-sizing: border-box;
85
+ min-width: 0;
86
+ max-width: 100%;
87
+ margin: 0;
88
+ padding: 0;
89
+ border: none;
90
+ border-radius: 0;
91
+ outline: none;
92
+ background: transparent;
93
+ color: var(--leaf-input-stepper-fg);
94
+ text-align: center;
95
+ letter-spacing: inherit;
96
+ appearance: none;
97
+ -webkit-appearance: none;
98
+ }
99
+
100
+ .leaf-input-stepper__input::placeholder {
101
+ color: var(--text-secondary);
102
+ opacity: 1;
103
+ }
104
+
105
+ .leaf-input-stepper__unit {
106
+ color: var(--leaf-input-stepper-fg);
107
+ }
108
+
109
+ .leaf-input-stepper__button {
110
+ display: inline-flex;
111
+ flex-shrink: 0;
112
+ align-items: center;
113
+ justify-content: center;
114
+ width: 20px;
115
+ height: 20px;
116
+ margin: 0;
117
+ padding: 0;
118
+ border: none;
119
+ background: transparent;
120
+ color: var(--leaf-input-stepper-icon);
121
+ font-size: 20px;
122
+ line-height: 1;
123
+ cursor: pointer;
124
+ appearance: none;
125
+ }
126
+
127
+ .leaf-input-stepper__button > svg {
128
+ display: block;
129
+ width: 1em;
130
+ height: 1em;
131
+ }
132
+
133
+ .leaf-input-stepper__button:disabled {
134
+ cursor: not-allowed;
135
+ }
136
+
137
+ /* Chạm min / max (cả khối vẫn enabled) — mờ nút; disabled cả khối đã đổi màu icon. */
138
+ .leaf-input-stepper:not([data-disabled="true"]) .leaf-input-stepper__button:disabled {
139
+ opacity: 0.4;
140
+ }
141
+
142
+ .leaf-input-stepper__message {
143
+ margin: 0;
144
+ padding-left: 4px;
145
+ color: var(--leaf-input-stepper-message);
146
+ }
147
+
148
+ .leaf-input-stepper[hidden],
149
+ .leaf-input-stepper__shell[hidden],
150
+ .leaf-input-stepper__body[hidden],
151
+ .leaf-input-stepper__value[hidden],
152
+ .leaf-input-stepper__button[hidden] {
153
+ display: none;
154
+ }
155
+
156
+ /* ── State ───────────────────────────────────────────────────────────── */
157
+
158
+ .leaf-input-stepper:focus-within {
159
+ --leaf-input-stepper-border: var(--leaf-input-stepper-focus);
160
+ --leaf-input-stepper-label: var(--text-primary);
161
+ }
162
+
163
+ .leaf-input-stepper[data-invalid="true"] {
164
+ --leaf-input-stepper-border: var(--system-red);
165
+ --leaf-input-stepper-message: var(--system-red);
166
+ }
167
+
168
+ .leaf-input-stepper[data-disabled="true"] {
169
+ --leaf-input-stepper-border: transparent;
170
+ --leaf-input-stepper-label: var(--text-tertiary);
171
+ --leaf-input-stepper-fg: var(--text-secondary);
172
+ --leaf-input-stepper-icon: var(--text-secondary);
173
+ }
174
+
175
+ .leaf-input-stepper[data-disabled="true"] .leaf-input-stepper__shell,
176
+ .leaf-input-stepper[data-disabled="true"] .leaf-input-stepper__input {
177
+ cursor: not-allowed;
178
+ }
179
+ }
package/dist/input.css ADDED
@@ -0,0 +1,218 @@
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/Input/input.css --- */
5
+
6
+ /*
7
+ * Input — Figma 1146:2159 (String / CTA) + search / date trigger.
8
+ *
9
+ * Variant qua data-variant (field | inline) + data-shape (pill, chỉ inline); state qua
10
+ * :focus-within, data-invalid, data-disabled, data-filled trên root. Màu đổi theo state
11
+ * nên nằm ở đây (class màu Leaf ở layer utilities sẽ đè state nếu gắn lên markup).
12
+ * Typography (body-4, body-5-highlight) là class Leaf trên markup.
13
+ * Thiếu attribute → field · default · enabled.
14
+ */
15
+
16
+ @layer components {
17
+ .leaf-input {
18
+ --leaf-input-bg: var(--base-tertiary);
19
+ --leaf-input-border: transparent;
20
+ --leaf-input-radius: 12px;
21
+ --leaf-input-min-height: 56px;
22
+ --leaf-input-padding-y: 8px;
23
+ --leaf-input-padding-x: 12px;
24
+ --leaf-input-icon-size: 20px;
25
+ --leaf-input-label: var(--text-tertiary);
26
+ --leaf-input-fg: var(--text-primary);
27
+ --leaf-input-icon: var(--text-primary);
28
+ --leaf-input-placeholder: var(--text-tertiary);
29
+ --leaf-input-message: var(--text-secondary);
30
+
31
+ display: flex;
32
+ flex-direction: column;
33
+ gap: 8px;
34
+ min-width: 0;
35
+ }
36
+
37
+ .leaf-input__shell {
38
+ display: flex;
39
+ align-items: center;
40
+ gap: 8px;
41
+ box-sizing: border-box;
42
+ min-height: var(--leaf-input-min-height);
43
+ padding: var(--leaf-input-padding-y) var(--leaf-input-padding-x);
44
+ border: 1px solid var(--leaf-input-border);
45
+ border-radius: var(--leaf-input-radius);
46
+ background-color: var(--leaf-input-bg);
47
+ cursor: text;
48
+ transition: border-color 0.15s ease;
49
+ }
50
+
51
+ .leaf-input__body {
52
+ display: flex;
53
+ flex: 1;
54
+ flex-direction: column;
55
+ gap: 4px;
56
+ min-width: 0;
57
+ }
58
+
59
+ .leaf-input__main {
60
+ display: flex;
61
+ align-items: center;
62
+ gap: 8px;
63
+ }
64
+
65
+ .leaf-input__label {
66
+ overflow: hidden;
67
+ text-overflow: ellipsis;
68
+ white-space: nowrap;
69
+ color: var(--leaf-input-label);
70
+ cursor: inherit;
71
+ transition: color 0.15s ease;
72
+ }
73
+
74
+ .leaf-input__control {
75
+ flex: 1;
76
+ min-width: 0;
77
+ box-sizing: border-box;
78
+ margin: 0;
79
+ padding: 0;
80
+ border: none;
81
+ border-radius: 0;
82
+ outline: none;
83
+ background: transparent;
84
+ color: var(--leaf-input-fg);
85
+ letter-spacing: inherit;
86
+ appearance: none;
87
+ -webkit-appearance: none;
88
+ }
89
+
90
+ .leaf-input__control::placeholder,
91
+ .leaf-input__placeholder {
92
+ color: var(--leaf-input-placeholder);
93
+ opacity: 1;
94
+ }
95
+
96
+ button.leaf-input__control {
97
+ overflow: hidden;
98
+ text-overflow: ellipsis;
99
+ white-space: nowrap;
100
+ text-align: left;
101
+ cursor: pointer;
102
+ }
103
+
104
+ .leaf-input__control::-webkit-search-cancel-button,
105
+ .leaf-input__control::-webkit-search-decoration {
106
+ -webkit-appearance: none;
107
+ }
108
+
109
+ .leaf-input__icon,
110
+ .leaf-input__reveal {
111
+ display: inline-flex;
112
+ flex-shrink: 0;
113
+ align-items: center;
114
+ justify-content: center;
115
+ width: var(--leaf-input-icon-size);
116
+ height: var(--leaf-input-icon-size);
117
+ font-size: var(--leaf-input-icon-size);
118
+ line-height: 1;
119
+ color: var(--leaf-input-icon);
120
+ }
121
+
122
+ .leaf-input__icon > svg,
123
+ .leaf-input__reveal > svg {
124
+ display: block;
125
+ width: 1em;
126
+ height: 1em;
127
+ }
128
+
129
+ .leaf-input__reveal {
130
+ margin: 0;
131
+ padding: 0;
132
+ border: none;
133
+ background: transparent;
134
+ cursor: pointer;
135
+ appearance: none;
136
+ }
137
+
138
+ .leaf-input__reveal:focus-visible {
139
+ outline: 2px solid var(--text-highlight);
140
+ outline-offset: 2px;
141
+ border-radius: 4px;
142
+ }
143
+
144
+ .leaf-input__action {
145
+ display: inline-flex;
146
+ flex-shrink: 0;
147
+ align-items: center;
148
+ }
149
+
150
+ .leaf-input__message {
151
+ margin: 0;
152
+ padding-left: 12px;
153
+ color: var(--leaf-input-message);
154
+ }
155
+
156
+ .leaf-input[hidden],
157
+ .leaf-input__shell[hidden],
158
+ .leaf-input__body[hidden],
159
+ .leaf-input__main[hidden],
160
+ .leaf-input__icon[hidden],
161
+ .leaf-input__reveal[hidden],
162
+ .leaf-input__action[hidden] {
163
+ display: none;
164
+ }
165
+
166
+ /* ── State ───────────────────────────────────────────────────────────── */
167
+
168
+ .leaf-input[data-filled="true"] {
169
+ --leaf-input-label: var(--text-primary);
170
+ }
171
+
172
+ .leaf-input:focus-within {
173
+ --leaf-input-border: var(--text-highlight);
174
+ --leaf-input-label: var(--text-highlight);
175
+ }
176
+
177
+ .leaf-input[data-invalid="true"] {
178
+ --leaf-input-border: var(--system-red);
179
+ --leaf-input-label: var(--system-red);
180
+ --leaf-input-message: var(--system-red);
181
+ }
182
+
183
+ .leaf-input[data-disabled="true"] {
184
+ --leaf-input-border: transparent;
185
+ --leaf-input-label: var(--text-tertiary);
186
+ --leaf-input-fg: var(--text-secondary);
187
+ --leaf-input-icon: var(--text-secondary);
188
+ }
189
+
190
+ .leaf-input[data-disabled="true"] .leaf-input__shell,
191
+ .leaf-input[data-disabled="true"] .leaf-input__control {
192
+ cursor: not-allowed;
193
+ }
194
+
195
+ /* ── Variant inline (search) ─────────────────────────────────────────── */
196
+
197
+ .leaf-input[data-variant="inline"] {
198
+ --leaf-input-bg: var(--base-secondary);
199
+ --leaf-input-border: var(--base-quaternary);
200
+ --leaf-input-min-height: 36px;
201
+ --leaf-input-padding-y: 6px;
202
+ --leaf-input-icon-size: 16px;
203
+ --leaf-input-placeholder: var(--text-secondary);
204
+ }
205
+
206
+ .leaf-input[data-variant="inline"]:focus-within {
207
+ --leaf-input-border: var(--text-highlight);
208
+ }
209
+
210
+ .leaf-input[data-variant="inline"][data-invalid="true"] {
211
+ --leaf-input-border: var(--system-red);
212
+ }
213
+
214
+ .leaf-input[data-variant="inline"][data-shape="pill"] {
215
+ --leaf-input-bg: transparent;
216
+ --leaf-input-radius: 9999px;
217
+ }
218
+ }
package/dist/logo.css CHANGED
@@ -15,6 +15,11 @@
15
15
 
16
16
  @layer components {
17
17
  .leaf-logo {
18
+ display: inline-flex;
19
+ flex-shrink: 0;
20
+ align-items: center;
21
+ justify-content: center;
22
+ vertical-align: middle;
18
23
  margin: 0;
19
24
  padding: 0;
20
25
  border: none;
@@ -37,10 +42,10 @@
37
42
  display: block;
38
43
  height: var(--leaf-logo-size, 40px);
39
44
  width: auto;
40
- /* max-w-full — class Leaf trên markup (React img) */
45
+ max-width: 100%;
41
46
  }
42
47
 
43
- /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
48
+ /* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
44
49
  .leaf-logo[hidden] {
45
50
  display: none;
46
51
  }
package/dist/radio.css ADDED
@@ -0,0 +1,124 @@
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/Radio/radio.css --- */
5
+
6
+ /*
7
+ * Radio — Figma 1146:2081.
8
+ *
9
+ * Size S/M/L (18 · 24 · 30) qua data-size; Selected qua `:checked` của input
10
+ * native; Disable qua `:disabled`. Input phủ kín vùng control (opacity 0) nên
11
+ * click / focus / FormData đều là của trình duyệt — HTML tĩnh không cần JS.
12
+ * Thiếu attribute → md · unchecked · enabled.
13
+ */
14
+
15
+ @layer components {
16
+ .leaf-radio {
17
+ --leaf-radio-size: 24px;
18
+ --leaf-radio-ring: 1.5px;
19
+ --leaf-radio-color: var(--text-primary);
20
+
21
+ position: relative;
22
+ display: inline-flex;
23
+ align-items: center;
24
+ gap: 8px;
25
+ vertical-align: middle;
26
+ cursor: pointer;
27
+ }
28
+
29
+ .leaf-radio[data-size="sm"] {
30
+ --leaf-radio-size: 18px;
31
+ }
32
+
33
+ .leaf-radio[data-size="lg"] {
34
+ --leaf-radio-size: 30px;
35
+ }
36
+
37
+ .leaf-radio[hidden],
38
+ .leaf-radio__control[hidden] {
39
+ display: none;
40
+ }
41
+
42
+ .leaf-radio__input {
43
+ position: absolute;
44
+ top: 0;
45
+ left: 0;
46
+ width: var(--leaf-radio-size);
47
+ height: var(--leaf-radio-size);
48
+ margin: 0;
49
+ padding: 0;
50
+ border: none;
51
+ opacity: 0;
52
+ cursor: inherit;
53
+ appearance: none;
54
+ -webkit-appearance: none;
55
+ }
56
+
57
+ .leaf-radio__control {
58
+ display: inline-flex;
59
+ flex-shrink: 0;
60
+ align-items: center;
61
+ justify-content: center;
62
+ border-radius: 9999px;
63
+ box-sizing: border-box;
64
+ width: var(--leaf-radio-size);
65
+ height: var(--leaf-radio-size);
66
+ border: var(--leaf-radio-ring) solid var(--leaf-radio-color);
67
+ transition: border-color 0.15s ease;
68
+ }
69
+
70
+ .leaf-radio__dot {
71
+ border-radius: 9999px;
72
+ width: 50%;
73
+ height: 50%;
74
+ background-color: var(--leaf-radio-color);
75
+ transform: scale(0);
76
+ transition: transform 0.15s ease;
77
+ }
78
+
79
+ .leaf-radio__label {
80
+ color: var(--text-primary);
81
+ }
82
+
83
+ /* Selected */
84
+ .leaf-radio__input:checked + .leaf-radio__control {
85
+ --leaf-radio-color: var(--text-highlight);
86
+ }
87
+
88
+ .leaf-radio__input:checked + .leaf-radio__control .leaf-radio__dot {
89
+ transform: scale(1);
90
+ }
91
+
92
+ /* Disable — ring / dot xám, label tertiary. */
93
+ .leaf-radio__input:disabled + .leaf-radio__control {
94
+ --leaf-radio-color: var(--base-quaternary);
95
+ }
96
+
97
+ .leaf-radio__input:disabled ~ .leaf-radio__label {
98
+ color: var(--text-tertiary);
99
+ }
100
+
101
+ .leaf-radio:has(.leaf-radio__input:disabled) {
102
+ cursor: not-allowed;
103
+ }
104
+
105
+ .leaf-radio__input:focus-visible + .leaf-radio__control {
106
+ outline: 2px solid var(--text-highlight);
107
+ outline-offset: 2px;
108
+ }
109
+
110
+ .leaf-radio-group {
111
+ display: flex;
112
+ flex-direction: column;
113
+ gap: 12px;
114
+ }
115
+
116
+ .leaf-radio-group[data-orientation="horizontal"] {
117
+ flex-direction: row;
118
+ flex-wrap: wrap;
119
+ }
120
+
121
+ .leaf-radio-group[hidden] {
122
+ display: none;
123
+ }
124
+ }
package/dist/skeleton.css CHANGED
@@ -17,6 +17,8 @@
17
17
  --leaf-skeleton-height: 100%;
18
18
  --leaf-skeleton-radius: 12px;
19
19
 
20
+ position: relative;
21
+ overflow: hidden;
20
22
  box-sizing: border-box;
21
23
  width: var(--leaf-skeleton-width);
22
24
  height: var(--leaf-skeleton-height);
@@ -25,6 +27,8 @@
25
27
  }
26
28
 
27
29
  .leaf-skeleton__shimmer {
30
+ position: absolute;
31
+ inset: 0;
28
32
  background: linear-gradient(
29
33
  to right,
30
34
  transparent,
package/dist/slider.css CHANGED
@@ -29,7 +29,10 @@
29
29
  20px
30
30
  );
31
31
 
32
- /* flex / flex-col / w-full / gap-s — class Leaf trên markup */
32
+ display: flex;
33
+ flex-direction: column;
34
+ gap: 8px;
35
+ width: 100%;
33
36
  box-sizing: border-box;
34
37
  font-family: var(--font-sans);
35
38
  font-size: var(--body-5-size);
@@ -40,21 +43,48 @@
40
43
  -webkit-user-select: none;
41
44
  }
42
45
 
43
- /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
44
- .leaf-slider[hidden] {
46
+ /* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
47
+ .leaf-slider[hidden],
48
+ .leaf-slider__header[hidden],
49
+ .leaf-slider__body[hidden],
50
+ .leaf-slider__control[hidden] {
45
51
  display: none;
46
52
  }
47
53
 
48
- /* Figma gap XS (4) giữa track và Value labels. */
49
- /* body — layout từ class Leaf trên markup */
50
-
51
54
  .leaf-slider__header {
55
+ display: flex;
56
+ align-items: flex-start;
57
+ justify-content: space-between;
58
+ gap: 8px;
59
+ width: 100%;
60
+ white-space: nowrap;
52
61
  color: var(--text-primary);
53
62
  user-select: text;
54
63
  -webkit-user-select: text;
55
64
  }
56
65
 
66
+ .leaf-slider__title {
67
+ min-width: 0;
68
+ }
69
+
70
+ .leaf-slider__unit {
71
+ min-width: 0;
72
+ text-align: right;
73
+ }
74
+
75
+ /* Figma gap XS (4) giữa track và Value labels. */
76
+ .leaf-slider__body {
77
+ display: flex;
78
+ flex-direction: column;
79
+ gap: 4px;
80
+ width: 100%;
81
+ }
82
+
57
83
  .leaf-slider__control {
84
+ position: relative;
85
+ display: flex;
86
+ align-items: center;
87
+ width: 100%;
58
88
  height: var(--leaf-slider-control-height);
59
89
  outline: none;
60
90
  cursor: pointer;
package/dist/spinner.css CHANGED
@@ -16,23 +16,37 @@
16
16
  --leaf-spinner-size: 24px;
17
17
  --leaf-spinner-duration: 1.2s;
18
18
 
19
+ display: inline-flex;
20
+ flex-shrink: 0;
21
+ align-items: center;
22
+ justify-content: center;
23
+ vertical-align: middle;
19
24
  width: var(--leaf-spinner-size);
20
25
  height: var(--leaf-spinner-size);
21
26
  color: var(--base-quinary);
22
27
  line-height: 0;
23
28
  }
24
29
 
25
- /* icon: block size-full — class Leaf trên markup */
30
+ .leaf-spinner__icon {
31
+ display: block;
32
+ width: 100%;
33
+ height: 100%;
34
+ }
26
35
 
27
36
  /* Fullscreen overlay — pattern Spinner (portal + nền mờ). */
28
37
  .leaf-spinner-overlay {
38
+ position: fixed;
39
+ inset: 0;
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
29
43
  z-index: var(--leaf-z-spinner-overlay, 100);
30
44
  box-sizing: border-box;
31
45
  background-color: var(--overlay);
32
46
  color: var(--base-quinary);
33
47
  }
34
48
 
35
- /* `hidden` luôn ẩn — display đến từ class layout; selector `[hidden]` specificity cao hơn nên thắng. */
49
+ /* `hidden` luôn ẩn — rule gốc set display; selector `[hidden]` specificity cao hơn nên thắng. */
36
50
  .leaf-spinner[hidden],
37
51
  .leaf-spinner-overlay[hidden] {
38
52
  display: none;