@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.
Files changed (160) hide show
  1. package/README.md +384 -212
  2. package/dist/button.css +21 -13
  3. package/dist/calendar.css +325 -0
  4. package/dist/cdn/leaf-0.1.9.min.css +2 -0
  5. package/dist/cdn/leaf-0.1.9.min.js +2 -0
  6. package/dist/checkbox.css +132 -0
  7. package/dist/classes.css +2272 -3155
  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 +199 -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 +65 -0
  48. package/dist/components/Input/InputDate.d.ts.map +1 -0
  49. package/dist/components/Input/InputDate.js +129 -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.d.ts +1 -1
  77. package/dist/components/Slider/Slider.d.ts.map +1 -1
  78. package/dist/components/Slider/Slider.js +9 -6
  79. package/dist/components/Slider/Slider.js.map +1 -1
  80. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  81. package/dist/components/Spinner/Spinner.js +2 -2
  82. package/dist/components/Spinner/Spinner.js.map +1 -1
  83. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  84. package/dist/components/Tabs/Tabs.js +3 -3
  85. package/dist/components/Tabs/Tabs.js.map +1 -1
  86. package/dist/components/Toast/Toast.d.ts +66 -0
  87. package/dist/components/Toast/Toast.d.ts.map +1 -0
  88. package/dist/components/Toast/Toast.js +77 -0
  89. package/dist/components/Toast/Toast.js.map +1 -0
  90. package/dist/components/Toast/index.d.ts +2 -0
  91. package/dist/components/Toast/index.d.ts.map +1 -0
  92. package/dist/components/Toast/index.js +2 -0
  93. package/dist/components/Toast/index.js.map +1 -0
  94. package/dist/components/Toggle/Toggle.d.ts +2 -1
  95. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  96. package/dist/components/Toggle/Toggle.js +6 -3
  97. package/dist/components/Toggle/Toggle.js.map +1 -1
  98. package/dist/components/Tooltip/Tooltip.d.ts +13 -1
  99. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  100. package/dist/components/Tooltip/Tooltip.js +2 -2
  101. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  102. package/dist/core/calendar.d.ts +36 -0
  103. package/dist/core/calendar.d.ts.map +1 -0
  104. package/dist/core/calendar.js +65 -0
  105. package/dist/core/calendar.js.map +1 -0
  106. package/dist/core/dropdown.d.ts +66 -0
  107. package/dist/core/dropdown.d.ts.map +1 -0
  108. package/dist/core/dropdown.js +131 -0
  109. package/dist/core/dropdown.js.map +1 -0
  110. package/dist/core/language.d.ts +25 -0
  111. package/dist/core/language.d.ts.map +1 -0
  112. package/dist/core/language.js +17 -0
  113. package/dist/core/language.js.map +1 -0
  114. package/dist/core/otp.d.ts +30 -0
  115. package/dist/core/otp.d.ts.map +1 -0
  116. package/dist/core/otp.js +65 -0
  117. package/dist/core/otp.js.map +1 -0
  118. package/dist/core/stepper.d.ts +39 -0
  119. package/dist/core/stepper.d.ts.map +1 -0
  120. package/dist/core/stepper.js +109 -0
  121. package/dist/core/stepper.js.map +1 -0
  122. package/dist/core/toast.d.ts +67 -0
  123. package/dist/core/toast.d.ts.map +1 -0
  124. package/dist/core/toast.js +102 -0
  125. package/dist/core/toast.js.map +1 -0
  126. package/dist/core/tooltip.d.ts +4 -0
  127. package/dist/core/tooltip.d.ts.map +1 -1
  128. package/dist/core/tooltip.js.map +1 -1
  129. package/dist/dialog.css +42 -4
  130. package/dist/dropdown.css +303 -0
  131. package/dist/index.d.ts +6 -0
  132. package/dist/index.d.ts.map +1 -1
  133. package/dist/index.js +6 -0
  134. package/dist/index.js.map +1 -1
  135. package/dist/input-date.css +49 -0
  136. package/dist/input-otp.css +76 -0
  137. package/dist/input-stepper.css +179 -0
  138. package/dist/input.css +218 -0
  139. package/dist/logo.css +7 -2
  140. package/dist/radio.css +124 -0
  141. package/dist/skeleton.css +4 -0
  142. package/dist/slider.css +36 -6
  143. package/dist/spinner.css +16 -2
  144. package/dist/styles.css +2272 -3191
  145. package/dist/tabs.css +15 -3
  146. package/dist/toast.css +234 -0
  147. package/dist/toggle.css +21 -9
  148. package/dist/tokens.css +0 -36
  149. package/dist/tooltip.css +17 -3
  150. package/package.json +10 -9
  151. package/dist/border.css +0 -182
  152. package/dist/cdn/leaf-0.1.7.min.css +0 -2
  153. package/dist/cdn/leaf-0.1.7.min.js +0 -2
  154. package/dist/flex.css +0 -229
  155. package/dist/grid.css +0 -533
  156. package/dist/overflow.css +0 -72
  157. package/dist/position.css +0 -140
  158. package/dist/sizing.css +0 -377
  159. package/dist/spacing.css +0 -906
  160. package/dist/text-layout.css +0 -219
package/dist/index.js CHANGED
@@ -12,5 +12,11 @@ export { Skeleton } from "./components/Skeleton";
12
12
  export { Spinner, } from "./components/Spinner";
13
13
  export { Toggle } from "./components/Toggle";
14
14
  export { Slider } from "./components/Slider";
15
+ export { Radio, RadioGroup, } from "./components/Radio";
16
+ export { Checkbox } from "./components/Checkbox";
17
+ export { Calendar, } from "./components/Calendar";
18
+ export { Input, InputOtp, InputDate, InputStepper, } from "./components/Input";
15
19
  export { Tooltip, TooltipContent, } from "./components/Tooltip";
20
+ export { Toaster, ToastContent, toast, } from "./components/Toast";
21
+ export { Dropdown, LanguageDropdown, LEAF_DEFAULT_LANGUAGE, LEAF_LANGUAGES, isLeafLanguageCode, } from "./components/Dropdown";
16
22
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACH,MAAM,GAKT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,IAAI,GAKP,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,MAAM,EAA4C,MAAM,qBAAqB,CAAC;AAEvF,OAAO,EACH,IAAI,GAKP,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAsB,MAAM,uBAAuB,CAAC;AAErE,OAAO,EACH,OAAO,GAIV,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAqC,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAoB,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EACH,OAAO,EACP,cAAc,GAOjB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACH,MAAM,GAKT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,IAAI,GAKP,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,MAAM,EAA4C,MAAM,qBAAqB,CAAC;AAEvF,OAAO,EACH,IAAI,GAKP,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAsB,MAAM,uBAAuB,CAAC;AAErE,OAAO,EACH,OAAO,GAIV,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAqC,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAoB,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EACH,KAAK,EACL,UAAU,GAKb,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAA4C,MAAM,uBAAuB,CAAC;AAE3F,OAAO,EACH,QAAQ,GAIX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACH,KAAK,EAML,QAAQ,EAER,SAAS,EAET,YAAY,GAGf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,OAAO,EACP,cAAc,GAOjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,OAAO,EACP,YAAY,EACZ,KAAK,GAKR,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,QAAQ,EASR,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,GAIrB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,49 @@
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-date.css --- */
5
+
6
+ /*
7
+ * InputDate — Input trigger + popover Calendar.
8
+ *
9
+ * Popover neo theo khung trigger: dưới (data-placement="bottom", top = đáy khung qua
10
+ * --leaf-input-date-offset do React đo) hoặc lật lên trên (data-placement="top"). data-align
11
+ * căn trái / phải. data-open giữ viền + label highlight khi panel mở (invalid vẫn thắng).
12
+ * Phụ thuộc input.css + calendar.css.
13
+ */
14
+
15
+ @layer components {
16
+ .leaf-input-date {
17
+ position: relative;
18
+ }
19
+
20
+ .leaf-input-date__popover {
21
+ position: absolute;
22
+ z-index: var(--leaf-z-popover, 100);
23
+ }
24
+
25
+ .leaf-input-date__popover[data-placement="bottom"] {
26
+ top: calc(var(--leaf-input-date-offset, 100%) + 8px);
27
+ }
28
+
29
+ .leaf-input-date__popover[data-placement="top"] {
30
+ bottom: calc(100% + 8px);
31
+ }
32
+
33
+ .leaf-input-date__popover[data-align="start"] {
34
+ left: 0;
35
+ }
36
+
37
+ .leaf-input-date__popover[data-align="end"] {
38
+ right: 0;
39
+ }
40
+
41
+ .leaf-input-date[data-open="true"] .leaf-input:not([data-invalid="true"]) {
42
+ --leaf-input-border: var(--text-highlight);
43
+ --leaf-input-label: var(--text-highlight);
44
+ }
45
+
46
+ .leaf-input-date[hidden] {
47
+ display: none;
48
+ }
49
+ }
@@ -0,0 +1,76 @@
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-otp.css --- */
5
+
6
+ /*
7
+ * InputOtp — Figma 1146:2159 (PIN code).
8
+ *
9
+ * Ô 48×56, nền base-tertiary, chữ số heading-3. Focus → viền highlight; data-invalid → viền
10
+ * đỏ mọi ô + message đỏ; data-disabled / :disabled → chữ secondary. Typography
11
+ * (heading-3, body-5) là class Leaf trên markup.
12
+ * HTML tĩnh: hành vi nhảy ô / dán nằm trong leaf.js (`data-leaf-input-otp`).
13
+ */
14
+
15
+ @layer components {
16
+ .leaf-input-otp {
17
+ --leaf-input-otp-cell-width: 48px;
18
+ --leaf-input-otp-cell-height: 56px;
19
+ --leaf-input-otp-border: transparent;
20
+ --leaf-input-otp-message: var(--text-secondary);
21
+
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: 8px;
25
+ }
26
+
27
+ .leaf-input-otp__cells {
28
+ display: flex;
29
+ gap: 4px;
30
+ }
31
+
32
+ .leaf-input-otp__cell {
33
+ box-sizing: border-box;
34
+ width: var(--leaf-input-otp-cell-width);
35
+ height: var(--leaf-input-otp-cell-height);
36
+ margin: 0;
37
+ padding: 0;
38
+ border: 1px solid var(--leaf-input-otp-border);
39
+ border-radius: 12px;
40
+ outline: none;
41
+ background-color: var(--base-tertiary);
42
+ color: var(--text-primary);
43
+ text-align: center;
44
+ caret-color: var(--text-highlight);
45
+ appearance: none;
46
+ -webkit-appearance: none;
47
+ transition: border-color 0.15s ease;
48
+ }
49
+
50
+ .leaf-input-otp__cell:focus {
51
+ border-color: var(--text-highlight);
52
+ }
53
+
54
+ .leaf-input-otp[data-invalid="true"] .leaf-input-otp__cell {
55
+ border-color: var(--system-red);
56
+ }
57
+
58
+ .leaf-input-otp__cell:disabled {
59
+ color: var(--text-secondary);
60
+ cursor: not-allowed;
61
+ }
62
+
63
+ .leaf-input-otp__message {
64
+ margin: 0;
65
+ color: var(--leaf-input-otp-message);
66
+ }
67
+
68
+ .leaf-input-otp[data-invalid="true"] {
69
+ --leaf-input-otp-message: var(--system-red);
70
+ }
71
+
72
+ .leaf-input-otp[hidden],
73
+ .leaf-input-otp__cells[hidden] {
74
+ display: none;
75
+ }
76
+ }
@@ -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
+ }