@finhay-pro/leaf-design-system 0.2.2 → 0.2.4

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 (727) hide show
  1. package/README.md +372 -88
  2. package/dist/accordion.css +142 -0
  3. package/dist/avatar.css +168 -0
  4. package/dist/badge.css +193 -0
  5. package/dist/breadcrumb.css +105 -0
  6. package/dist/calendar.css +150 -0
  7. package/dist/carousel.css +17 -2
  8. package/dist/cdn/leaf-0.2.4.min.css +2 -0
  9. package/dist/cdn/leaf-0.2.4.min.js +177 -0
  10. package/dist/checkbox.css +8 -0
  11. package/dist/classes.css +5322 -2429
  12. package/dist/components/Accordion/Accordion.d.ts +43 -0
  13. package/dist/components/Accordion/Accordion.d.ts.map +1 -0
  14. package/dist/components/Accordion/Accordion.js +37 -0
  15. package/dist/components/Accordion/Accordion.js.map +1 -0
  16. package/dist/components/Accordion/index.d.ts +2 -0
  17. package/dist/components/Accordion/index.d.ts.map +1 -0
  18. package/dist/components/Accordion/index.js +2 -0
  19. package/dist/components/Accordion/index.js.map +1 -0
  20. package/dist/components/Avatar/Avatar.d.ts +32 -0
  21. package/dist/components/Avatar/Avatar.d.ts.map +1 -0
  22. package/dist/components/Avatar/Avatar.js +20 -0
  23. package/dist/components/Avatar/Avatar.js.map +1 -0
  24. package/dist/components/Avatar/index.d.ts +2 -0
  25. package/dist/components/Avatar/index.d.ts.map +1 -0
  26. package/dist/components/Avatar/index.js +2 -0
  27. package/dist/components/Avatar/index.js.map +1 -0
  28. package/dist/components/Badge/Badge.d.ts +44 -0
  29. package/dist/components/Badge/Badge.d.ts.map +1 -0
  30. package/dist/components/Badge/Badge.js +21 -0
  31. package/dist/components/Badge/Badge.js.map +1 -0
  32. package/dist/components/Badge/index.d.ts +2 -0
  33. package/dist/components/Badge/index.d.ts.map +1 -0
  34. package/dist/components/Badge/index.js +2 -0
  35. package/dist/components/Badge/index.js.map +1 -0
  36. package/dist/components/Breadcrumb/Breadcrumb.d.ts +33 -0
  37. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
  38. package/dist/components/Breadcrumb/Breadcrumb.js +60 -0
  39. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
  40. package/dist/components/Breadcrumb/index.d.ts +2 -0
  41. package/dist/components/Breadcrumb/index.d.ts.map +1 -0
  42. package/dist/components/Breadcrumb/index.js +2 -0
  43. package/dist/components/Breadcrumb/index.js.map +1 -0
  44. package/dist/components/Button/Button.js +1 -1
  45. package/dist/components/Calendar/Calendar.js +1 -1
  46. package/dist/components/CalendarRange/CalendarRange.d.ts +41 -0
  47. package/dist/components/CalendarRange/CalendarRange.d.ts.map +1 -0
  48. package/dist/components/CalendarRange/CalendarRange.js +74 -0
  49. package/dist/components/CalendarRange/CalendarRange.js.map +1 -0
  50. package/dist/components/CalendarRange/index.d.ts +2 -0
  51. package/dist/components/CalendarRange/index.d.ts.map +1 -0
  52. package/dist/components/CalendarRange/index.js +2 -0
  53. package/dist/components/CalendarRange/index.js.map +1 -0
  54. package/dist/components/Carousel/Carousel.d.ts +23 -3
  55. package/dist/components/Carousel/Carousel.d.ts.map +1 -1
  56. package/dist/components/Carousel/Carousel.js +33 -9
  57. package/dist/components/Carousel/Carousel.js.map +1 -1
  58. package/dist/components/Date/Date.d.ts +1 -1
  59. package/dist/components/Date/Date.d.ts.map +1 -1
  60. package/dist/components/Date/Date.js +2 -2
  61. package/dist/components/Date/Date.js.map +1 -1
  62. package/dist/components/Dialog/Dialog.d.ts +29 -3
  63. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  64. package/dist/components/Dialog/Dialog.js +40 -7
  65. package/dist/components/Dialog/Dialog.js.map +1 -1
  66. package/dist/components/Dialog/Drawer.d.ts +18 -0
  67. package/dist/components/Dialog/Drawer.d.ts.map +1 -0
  68. package/dist/components/Dialog/Drawer.js +12 -0
  69. package/dist/components/Dialog/Drawer.js.map +1 -0
  70. package/dist/components/Dialog/index.d.ts +2 -1
  71. package/dist/components/Dialog/index.d.ts.map +1 -1
  72. package/dist/components/Dialog/index.js +2 -1
  73. package/dist/components/Dialog/index.js.map +1 -1
  74. package/dist/components/Dropdown/Dropdown.d.ts +15 -1
  75. package/dist/components/Dropdown/Dropdown.d.ts.map +1 -1
  76. package/dist/components/Dropdown/Dropdown.js +106 -20
  77. package/dist/components/Dropdown/Dropdown.js.map +1 -1
  78. package/dist/components/Empty/Empty.d.ts.map +1 -1
  79. package/dist/components/Empty/Empty.js.map +1 -1
  80. package/dist/components/FileViewer/FileViewer.d.ts +3 -1
  81. package/dist/components/FileViewer/FileViewer.d.ts.map +1 -1
  82. package/dist/components/FileViewer/FileViewer.js +2 -1
  83. package/dist/components/FileViewer/FileViewer.js.map +1 -1
  84. package/dist/components/Form/DynamicForm.js +1 -1
  85. package/dist/components/Form/Form.js +1 -1
  86. package/dist/components/Form/adapters.d.ts.map +1 -1
  87. package/dist/components/Form/adapters.js +1 -1
  88. package/dist/components/Form/adapters.js.map +1 -1
  89. package/dist/components/Input/Input.d.ts.map +1 -1
  90. package/dist/components/Input/Input.js +3 -1
  91. package/dist/components/Input/Input.js.map +1 -1
  92. package/dist/components/Input/InputDate.d.ts +6 -1
  93. package/dist/components/Input/InputDate.d.ts.map +1 -1
  94. package/dist/components/Input/InputDate.js +36 -11
  95. package/dist/components/Input/InputDate.js.map +1 -1
  96. package/dist/components/Input/InputDateRange.d.ts +43 -0
  97. package/dist/components/Input/InputDateRange.d.ts.map +1 -0
  98. package/dist/components/Input/InputDateRange.js +86 -0
  99. package/dist/components/Input/InputDateRange.js.map +1 -0
  100. package/dist/components/Input/InputNumber.d.ts +28 -0
  101. package/dist/components/Input/InputNumber.d.ts.map +1 -0
  102. package/dist/components/Input/InputNumber.js +58 -0
  103. package/dist/components/Input/InputNumber.js.map +1 -0
  104. package/dist/components/Input/InputOtp.d.ts.map +1 -1
  105. package/dist/components/Input/InputOtp.js +2 -2
  106. package/dist/components/Input/InputOtp.js.map +1 -1
  107. package/dist/components/Input/InputStepper.d.ts +3 -1
  108. package/dist/components/Input/InputStepper.d.ts.map +1 -1
  109. package/dist/components/Input/InputStepper.js +32 -5
  110. package/dist/components/Input/InputStepper.js.map +1 -1
  111. package/dist/components/Input/index.d.ts +2 -0
  112. package/dist/components/Input/index.d.ts.map +1 -1
  113. package/dist/components/Input/index.js +2 -0
  114. package/dist/components/Input/index.js.map +1 -1
  115. package/dist/components/Menu/Menu.d.ts +69 -0
  116. package/dist/components/Menu/Menu.d.ts.map +1 -0
  117. package/dist/components/Menu/Menu.js +140 -0
  118. package/dist/components/Menu/Menu.js.map +1 -0
  119. package/dist/components/Menu/index.d.ts +2 -0
  120. package/dist/components/Menu/index.d.ts.map +1 -0
  121. package/dist/components/Menu/index.js +2 -0
  122. package/dist/components/Menu/index.js.map +1 -0
  123. package/dist/components/MultiSelect/MultiSelect.d.ts +6 -1
  124. package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
  125. package/dist/components/MultiSelect/MultiSelect.js +42 -23
  126. package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
  127. package/dist/components/Number/Number.d.ts +4 -2
  128. package/dist/components/Number/Number.d.ts.map +1 -1
  129. package/dist/components/Number/Number.js +3 -1
  130. package/dist/components/Number/Number.js.map +1 -1
  131. package/dist/components/Pagination/Pagination.d.ts +35 -0
  132. package/dist/components/Pagination/Pagination.d.ts.map +1 -0
  133. package/dist/components/Pagination/Pagination.js +40 -0
  134. package/dist/components/Pagination/Pagination.js.map +1 -0
  135. package/dist/components/Pagination/index.d.ts +2 -0
  136. package/dist/components/Pagination/index.d.ts.map +1 -0
  137. package/dist/components/Pagination/index.js +2 -0
  138. package/dist/components/Pagination/index.js.map +1 -0
  139. package/dist/components/Popover/Popover.d.ts +51 -0
  140. package/dist/components/Popover/Popover.d.ts.map +1 -0
  141. package/dist/components/Popover/Popover.js +83 -0
  142. package/dist/components/Popover/Popover.js.map +1 -0
  143. package/dist/components/Popover/index.d.ts +2 -0
  144. package/dist/components/Popover/index.d.ts.map +1 -0
  145. package/dist/components/Popover/index.js +2 -0
  146. package/dist/components/Popover/index.js.map +1 -0
  147. package/dist/components/Progress/Progress.d.ts +30 -0
  148. package/dist/components/Progress/Progress.d.ts.map +1 -0
  149. package/dist/components/Progress/Progress.js +17 -0
  150. package/dist/components/Progress/Progress.js.map +1 -0
  151. package/dist/components/Progress/index.d.ts +2 -0
  152. package/dist/components/Progress/index.d.ts.map +1 -0
  153. package/dist/components/Progress/index.js +2 -0
  154. package/dist/components/Progress/index.js.map +1 -0
  155. package/dist/components/QrCode/QrCode.d.ts.map +1 -1
  156. package/dist/components/QrCode/QrCode.js.map +1 -1
  157. package/dist/components/SafeHtml/SafeHtml.d.ts +326 -0
  158. package/dist/components/SafeHtml/SafeHtml.d.ts.map +1 -0
  159. package/dist/components/SafeHtml/SafeHtml.js +44 -0
  160. package/dist/components/SafeHtml/SafeHtml.js.map +1 -0
  161. package/dist/components/SafeHtml/index.d.ts +2 -0
  162. package/dist/components/SafeHtml/index.d.ts.map +1 -0
  163. package/dist/components/SafeHtml/index.js +2 -0
  164. package/dist/components/SafeHtml/index.js.map +1 -0
  165. package/dist/components/Sidebar/Sidebar.d.ts +50 -0
  166. package/dist/components/Sidebar/Sidebar.d.ts.map +1 -0
  167. package/dist/components/Sidebar/Sidebar.js +71 -0
  168. package/dist/components/Sidebar/Sidebar.js.map +1 -0
  169. package/dist/components/Sidebar/index.d.ts +2 -0
  170. package/dist/components/Sidebar/index.d.ts.map +1 -0
  171. package/dist/components/Sidebar/index.js +2 -0
  172. package/dist/components/Sidebar/index.js.map +1 -0
  173. package/dist/components/Slider/Slider.js +1 -4
  174. package/dist/components/Slider/Slider.js.map +1 -1
  175. package/dist/components/Spinner/Spinner.js +1 -1
  176. package/dist/components/Steps/Steps.d.ts +30 -0
  177. package/dist/components/Steps/Steps.d.ts.map +1 -0
  178. package/dist/components/Steps/Steps.js +26 -0
  179. package/dist/components/Steps/Steps.js.map +1 -0
  180. package/dist/components/Steps/index.d.ts +2 -0
  181. package/dist/components/Steps/index.d.ts.map +1 -0
  182. package/dist/components/Steps/index.js +2 -0
  183. package/dist/components/Steps/index.js.map +1 -0
  184. package/dist/components/Table/Table.d.ts +117 -0
  185. package/dist/components/Table/Table.d.ts.map +1 -0
  186. package/dist/components/Table/Table.js +417 -0
  187. package/dist/components/Table/Table.js.map +1 -0
  188. package/dist/components/Table/TableHeader.d.ts +24 -0
  189. package/dist/components/Table/TableHeader.d.ts.map +1 -0
  190. package/dist/components/Table/TableHeader.js +18 -0
  191. package/dist/components/Table/TableHeader.js.map +1 -0
  192. package/dist/components/Table/TableRow.d.ts +31 -0
  193. package/dist/components/Table/TableRow.d.ts.map +1 -0
  194. package/dist/components/Table/TableRow.js +30 -0
  195. package/dist/components/Table/TableRow.js.map +1 -0
  196. package/dist/components/Table/dom.d.ts +9 -0
  197. package/dist/components/Table/dom.d.ts.map +1 -0
  198. package/dist/components/Table/dom.js +17 -0
  199. package/dist/components/Table/dom.js.map +1 -0
  200. package/dist/components/Table/index.d.ts +2 -0
  201. package/dist/components/Table/index.d.ts.map +1 -0
  202. package/dist/components/Table/index.js +2 -0
  203. package/dist/components/Table/index.js.map +1 -0
  204. package/dist/components/Toast/Toast.d.ts +8 -4
  205. package/dist/components/Toast/Toast.d.ts.map +1 -1
  206. package/dist/components/Toast/Toast.js +15 -4
  207. package/dist/components/Toast/Toast.js.map +1 -1
  208. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  209. package/dist/components/Tooltip/Tooltip.js +5 -2
  210. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  211. package/dist/components/VirtualList/VirtualList.d.ts +39 -0
  212. package/dist/components/VirtualList/VirtualList.d.ts.map +1 -0
  213. package/dist/components/VirtualList/VirtualList.js +113 -0
  214. package/dist/components/VirtualList/VirtualList.js.map +1 -0
  215. package/dist/components/VirtualList/index.d.ts +2 -0
  216. package/dist/components/VirtualList/index.d.ts.map +1 -0
  217. package/dist/components/VirtualList/index.js +2 -0
  218. package/dist/components/VirtualList/index.js.map +1 -0
  219. package/dist/core/accordion.d.ts +15 -0
  220. package/dist/core/accordion.d.ts.map +1 -0
  221. package/dist/core/accordion.js +37 -0
  222. package/dist/core/accordion.js.map +1 -0
  223. package/dist/core/avatar.d.ts +4 -0
  224. package/dist/core/avatar.d.ts.map +1 -0
  225. package/dist/core/avatar.js +12 -0
  226. package/dist/core/avatar.js.map +1 -0
  227. package/dist/core/calendar.d.ts +1 -2
  228. package/dist/core/calendar.d.ts.map +1 -1
  229. package/dist/core/calendar.js +2 -10
  230. package/dist/core/calendar.js.map +1 -1
  231. package/dist/core/carousel.d.ts +8 -0
  232. package/dist/core/carousel.d.ts.map +1 -1
  233. package/dist/core/carousel.js +31 -3
  234. package/dist/core/carousel.js.map +1 -1
  235. package/dist/core/date-math.d.ts +39 -0
  236. package/dist/core/date-math.d.ts.map +1 -0
  237. package/dist/core/date-math.js +82 -0
  238. package/dist/core/date-math.js.map +1 -0
  239. package/dist/core/date-range.d.ts +44 -0
  240. package/dist/core/date-range.d.ts.map +1 -0
  241. package/dist/core/date-range.js +88 -0
  242. package/dist/core/date-range.js.map +1 -0
  243. package/dist/core/date.d.ts +23 -4
  244. package/dist/core/date.d.ts.map +1 -1
  245. package/dist/core/date.js +114 -4
  246. package/dist/core/date.js.map +1 -1
  247. package/dist/core/dialog.d.ts +43 -5
  248. package/dist/core/dialog.d.ts.map +1 -1
  249. package/dist/core/dialog.js +85 -8
  250. package/dist/core/dialog.js.map +1 -1
  251. package/dist/core/file/csv.d.ts +10 -0
  252. package/dist/core/file/csv.d.ts.map +1 -1
  253. package/dist/core/file/csv.js +26 -3
  254. package/dist/core/file/csv.js.map +1 -1
  255. package/dist/core/file/detect.js.map +1 -1
  256. package/dist/core/file/docx-render.js.map +1 -1
  257. package/dist/core/file/docx.js.map +1 -1
  258. package/dist/core/file/dom.d.ts +1 -1
  259. package/dist/core/file/dom.d.ts.map +1 -1
  260. package/dist/core/file/dom.js +3 -3
  261. package/dist/core/file/dom.js.map +1 -1
  262. package/dist/core/file/download.d.ts +5 -0
  263. package/dist/core/file/download.d.ts.map +1 -1
  264. package/dist/core/file/download.js +10 -3
  265. package/dist/core/file/download.js.map +1 -1
  266. package/dist/core/file/error.d.ts.map +1 -1
  267. package/dist/core/file/error.js.map +1 -1
  268. package/dist/core/file/source.d.ts +15 -1
  269. package/dist/core/file/source.d.ts.map +1 -1
  270. package/dist/core/file/source.js +99 -6
  271. package/dist/core/file/source.js.map +1 -1
  272. package/dist/core/file/text.js.map +1 -1
  273. package/dist/core/file/viewer.d.ts +2 -0
  274. package/dist/core/file/viewer.d.ts.map +1 -1
  275. package/dist/core/file/viewer.js +3 -2
  276. package/dist/core/file/viewer.js.map +1 -1
  277. package/dist/core/file/xlsx-format.js.map +1 -1
  278. package/dist/core/file/xlsx-write.js.map +1 -1
  279. package/dist/core/file/xlsx.d.ts.map +1 -1
  280. package/dist/core/file/xlsx.js +4 -3
  281. package/dist/core/file/xlsx.js.map +1 -1
  282. package/dist/core/file/xml.d.ts.map +1 -1
  283. package/dist/core/file/xml.js +5 -0
  284. package/dist/core/file/xml.js.map +1 -1
  285. package/dist/core/file/zip-write.js.map +1 -1
  286. package/dist/core/file/zip.js.map +1 -1
  287. package/dist/core/floating.d.ts +69 -0
  288. package/dist/core/floating.d.ts.map +1 -0
  289. package/dist/core/floating.js +185 -0
  290. package/dist/core/floating.js.map +1 -0
  291. package/dist/core/html/css.d.ts +32 -0
  292. package/dist/core/html/css.d.ts.map +1 -0
  293. package/dist/core/html/css.js +222 -0
  294. package/dist/core/html/css.js.map +1 -0
  295. package/dist/core/html/entities.d.ts +19 -0
  296. package/dist/core/html/entities.d.ts.map +1 -0
  297. package/dist/core/html/entities.js +167 -0
  298. package/dist/core/html/entities.js.map +1 -0
  299. package/dist/core/html/entity-data.d.ts +14 -0
  300. package/dist/core/html/entity-data.d.ts.map +1 -0
  301. package/dist/core/html/entity-data.js +14 -0
  302. package/dist/core/html/entity-data.js.map +1 -0
  303. package/dist/core/html/props.d.ts +9 -0
  304. package/dist/core/html/props.d.ts.map +1 -0
  305. package/dist/core/html/props.js +98 -0
  306. package/dist/core/html/props.js.map +1 -0
  307. package/dist/core/html/sanitize.d.ts +150 -0
  308. package/dist/core/html/sanitize.d.ts.map +1 -0
  309. package/dist/core/html/sanitize.js +800 -0
  310. package/dist/core/html/sanitize.js.map +1 -0
  311. package/dist/core/html/tokenizer.d.ts +33 -0
  312. package/dist/core/html/tokenizer.d.ts.map +1 -0
  313. package/dist/core/html/tokenizer.js +306 -0
  314. package/dist/core/html/tokenizer.js.map +1 -0
  315. package/dist/core/html/tree.d.ts +35 -0
  316. package/dist/core/html/tree.d.ts.map +1 -0
  317. package/dist/core/html/tree.js +253 -0
  318. package/dist/core/html/tree.js.map +1 -0
  319. package/dist/core/icons.d.ts +10 -3
  320. package/dist/core/icons.d.ts.map +1 -1
  321. package/dist/core/icons.js +22 -5
  322. package/dist/core/icons.js.map +1 -1
  323. package/dist/core/language.d.ts.map +1 -1
  324. package/dist/core/menu.d.ts +22 -0
  325. package/dist/core/menu.d.ts.map +1 -0
  326. package/dist/core/menu.js +69 -0
  327. package/dist/core/menu.js.map +1 -0
  328. package/dist/core/motion.d.ts +12 -0
  329. package/dist/core/motion.d.ts.map +1 -0
  330. package/dist/core/motion.js +17 -0
  331. package/dist/core/motion.js.map +1 -0
  332. package/dist/core/number-input.d.ts +29 -0
  333. package/dist/core/number-input.d.ts.map +1 -0
  334. package/dist/core/number-input.js +92 -0
  335. package/dist/core/number-input.js.map +1 -0
  336. package/dist/core/number.d.ts +14 -0
  337. package/dist/core/number.d.ts.map +1 -1
  338. package/dist/core/number.js +48 -2
  339. package/dist/core/number.js.map +1 -1
  340. package/dist/core/otp.d.ts +2 -0
  341. package/dist/core/otp.d.ts.map +1 -1
  342. package/dist/core/otp.js +4 -0
  343. package/dist/core/otp.js.map +1 -1
  344. package/dist/core/pacer.d.ts +63 -0
  345. package/dist/core/pacer.d.ts.map +1 -0
  346. package/dist/core/pacer.js +129 -0
  347. package/dist/core/pacer.js.map +1 -0
  348. package/dist/core/pagination.d.ts +44 -0
  349. package/dist/core/pagination.d.ts.map +1 -0
  350. package/dist/core/pagination.js +78 -0
  351. package/dist/core/pagination.js.map +1 -0
  352. package/dist/core/popover.d.ts +6 -0
  353. package/dist/core/popover.d.ts.map +1 -0
  354. package/dist/core/popover.js +6 -0
  355. package/dist/core/popover.js.map +1 -0
  356. package/dist/core/progress.d.ts +3 -0
  357. package/dist/core/progress.d.ts.map +1 -0
  358. package/dist/core/progress.js +8 -0
  359. package/dist/core/progress.js.map +1 -0
  360. package/dist/core/qr-code.d.ts +7 -0
  361. package/dist/core/qr-code.d.ts.map +1 -1
  362. package/dist/core/qr-code.js +15 -9
  363. package/dist/core/qr-code.js.map +1 -1
  364. package/dist/core/roving.d.ts +19 -0
  365. package/dist/core/roving.d.ts.map +1 -0
  366. package/dist/core/roving.js +54 -0
  367. package/dist/core/roving.js.map +1 -0
  368. package/dist/core/safe-url.d.ts +37 -0
  369. package/dist/core/safe-url.d.ts.map +1 -0
  370. package/dist/core/safe-url.js +68 -0
  371. package/dist/core/safe-url.js.map +1 -0
  372. package/dist/core/sheet.d.ts +19 -0
  373. package/dist/core/sheet.d.ts.map +1 -0
  374. package/dist/core/sheet.js +54 -0
  375. package/dist/core/sheet.js.map +1 -0
  376. package/dist/core/spinner.d.ts +2 -2
  377. package/dist/core/spinner.d.ts.map +1 -1
  378. package/dist/core/spinner.js +22 -4
  379. package/dist/core/spinner.js.map +1 -1
  380. package/dist/core/status.d.ts +20 -0
  381. package/dist/core/status.d.ts.map +1 -0
  382. package/dist/core/status.js +30 -0
  383. package/dist/core/status.js.map +1 -0
  384. package/dist/core/stepper.js.map +1 -1
  385. package/dist/core/table/attrs.d.ts +71 -0
  386. package/dist/core/table/attrs.d.ts.map +1 -0
  387. package/dist/core/table/attrs.js +211 -0
  388. package/dist/core/table/attrs.js.map +1 -0
  389. package/dist/core/table/columns.d.ts +168 -0
  390. package/dist/core/table/columns.d.ts.map +1 -0
  391. package/dist/core/table/columns.js +147 -0
  392. package/dist/core/table/columns.js.map +1 -0
  393. package/dist/core/table/features.d.ts +72 -0
  394. package/dist/core/table/features.d.ts.map +1 -0
  395. package/dist/core/table/features.js +198 -0
  396. package/dist/core/table/features.js.map +1 -0
  397. package/dist/core/table/flash.d.ts +26 -0
  398. package/dist/core/table/flash.d.ts.map +1 -0
  399. package/dist/core/table/flash.js +84 -0
  400. package/dist/core/table/flash.js.map +1 -0
  401. package/dist/core/table/index.d.ts +12 -0
  402. package/dist/core/table/index.d.ts.map +1 -0
  403. package/dist/core/table/index.js +12 -0
  404. package/dist/core/table/index.js.map +1 -0
  405. package/dist/core/table/measure.d.ts +23 -0
  406. package/dist/core/table/measure.d.ts.map +1 -0
  407. package/dist/core/table/measure.js +54 -0
  408. package/dist/core/table/measure.js.map +1 -0
  409. package/dist/core/table/reorder.d.ts +21 -0
  410. package/dist/core/table/reorder.d.ts.map +1 -0
  411. package/dist/core/table/reorder.js +70 -0
  412. package/dist/core/table/reorder.js.map +1 -0
  413. package/dist/core/table/resize.d.ts +13 -0
  414. package/dist/core/table/resize.d.ts.map +1 -0
  415. package/dist/core/table/resize.js +34 -0
  416. package/dist/core/table/resize.js.map +1 -0
  417. package/dist/core/table/sort.d.ts +23 -0
  418. package/dist/core/table/sort.d.ts.map +1 -0
  419. package/dist/core/table/sort.js +71 -0
  420. package/dist/core/table/sort.js.map +1 -0
  421. package/dist/core/table/span.d.ts +31 -0
  422. package/dist/core/table/span.d.ts.map +1 -0
  423. package/dist/core/table/span.js +84 -0
  424. package/dist/core/table/span.js.map +1 -0
  425. package/dist/core/table/virtual.d.ts +16 -0
  426. package/dist/core/table/virtual.d.ts.map +1 -0
  427. package/dist/core/table/virtual.js +13 -0
  428. package/dist/core/table/virtual.js.map +1 -0
  429. package/dist/core/tabs.d.ts.map +1 -1
  430. package/dist/core/tabs.js +2 -15
  431. package/dist/core/tabs.js.map +1 -1
  432. package/dist/core/toast.d.ts +15 -3
  433. package/dist/core/toast.d.ts.map +1 -1
  434. package/dist/core/toast.js +9 -6
  435. package/dist/core/toast.js.map +1 -1
  436. package/dist/core/tooltip.d.ts +8 -7
  437. package/dist/core/tooltip.d.ts.map +1 -1
  438. package/dist/core/tooltip.js +14 -119
  439. package/dist/core/tooltip.js.map +1 -1
  440. package/dist/core/upload.d.ts +1 -0
  441. package/dist/core/upload.d.ts.map +1 -1
  442. package/dist/core/upload.js +6 -0
  443. package/dist/core/upload.js.map +1 -1
  444. package/dist/core/virtual.d.ts +76 -0
  445. package/dist/core/virtual.d.ts.map +1 -0
  446. package/dist/core/virtual.js +214 -0
  447. package/dist/core/virtual.js.map +1 -0
  448. package/dist/dialog.css +232 -0
  449. package/dist/dropdown.css +94 -0
  450. package/dist/empty.css +8 -0
  451. package/dist/file-viewer.css +17 -0
  452. package/dist/fn/async.d.ts +39 -0
  453. package/dist/fn/async.d.ts.map +1 -0
  454. package/dist/fn/async.js +91 -0
  455. package/dist/fn/async.js.map +1 -0
  456. package/dist/fn/clipboard.d.ts +6 -0
  457. package/dist/fn/clipboard.d.ts.map +1 -0
  458. package/dist/fn/clipboard.js +35 -0
  459. package/dist/fn/clipboard.js.map +1 -0
  460. package/dist/fn/cookie.d.ts +7 -0
  461. package/dist/fn/cookie.d.ts.map +1 -0
  462. package/dist/fn/cookie.js +22 -0
  463. package/dist/fn/cookie.js.map +1 -0
  464. package/dist/fn/error.d.ts +24 -0
  465. package/dist/fn/error.d.ts.map +1 -0
  466. package/dist/fn/error.js +50 -0
  467. package/dist/fn/error.js.map +1 -0
  468. package/dist/fn/html.d.ts +34 -0
  469. package/dist/fn/html.d.ts.map +1 -0
  470. package/dist/fn/html.js +60 -0
  471. package/dist/fn/html.js.map +1 -0
  472. package/dist/fn/index.d.ts +39 -0
  473. package/dist/fn/index.d.ts.map +1 -0
  474. package/dist/fn/index.js +40 -0
  475. package/dist/fn/index.js.map +1 -0
  476. package/dist/fn/jwt.d.ts +12 -0
  477. package/dist/fn/jwt.d.ts.map +1 -0
  478. package/dist/fn/jwt.js +42 -0
  479. package/dist/fn/jwt.js.map +1 -0
  480. package/dist/fn/locale.d.ts +20 -0
  481. package/dist/fn/locale.d.ts.map +1 -0
  482. package/dist/fn/locale.js +33 -0
  483. package/dist/fn/locale.js.map +1 -0
  484. package/dist/fn/query.d.ts +11 -0
  485. package/dist/fn/query.d.ts.map +1 -0
  486. package/dist/fn/query.js +41 -0
  487. package/dist/fn/query.js.map +1 -0
  488. package/dist/fn/sanitize.d.ts +15 -0
  489. package/dist/fn/sanitize.d.ts.map +1 -0
  490. package/dist/fn/sanitize.js +15 -0
  491. package/dist/fn/sanitize.js.map +1 -0
  492. package/dist/fn/storage.d.ts +13 -0
  493. package/dist/fn/storage.d.ts.map +1 -0
  494. package/dist/fn/storage.js +69 -0
  495. package/dist/fn/storage.js.map +1 -0
  496. package/dist/fn/string.d.ts +13 -0
  497. package/dist/fn/string.d.ts.map +1 -0
  498. package/dist/fn/string.js +30 -0
  499. package/dist/fn/string.js.map +1 -0
  500. package/dist/fn/url.d.ts +27 -0
  501. package/dist/fn/url.d.ts.map +1 -0
  502. package/dist/fn/url.js +71 -0
  503. package/dist/fn/url.js.map +1 -0
  504. package/dist/fn/version.d.ts +5 -0
  505. package/dist/fn/version.d.ts.map +1 -0
  506. package/dist/fn/version.js +23 -0
  507. package/dist/fn/version.js.map +1 -0
  508. package/dist/hooks/index.d.ts +43 -0
  509. package/dist/hooks/index.d.ts.map +1 -0
  510. package/dist/hooks/index.js +43 -0
  511. package/dist/hooks/index.js.map +1 -0
  512. package/dist/hooks/useAsync.d.ts +17 -0
  513. package/dist/hooks/useAsync.d.ts.map +1 -0
  514. package/dist/hooks/useAsync.js +38 -0
  515. package/dist/hooks/useAsync.js.map +1 -0
  516. package/dist/hooks/useAsyncCallback.d.ts +26 -0
  517. package/dist/hooks/useAsyncCallback.d.ts.map +1 -0
  518. package/dist/hooks/useAsyncCallback.js +57 -0
  519. package/dist/hooks/useAsyncCallback.js.map +1 -0
  520. package/dist/hooks/useBatcher.d.ts +11 -0
  521. package/dist/hooks/useBatcher.d.ts.map +1 -0
  522. package/dist/hooks/useBatcher.js +16 -0
  523. package/dist/hooks/useBatcher.js.map +1 -0
  524. package/dist/hooks/useClickOutside.d.ts +12 -0
  525. package/dist/hooks/useClickOutside.d.ts.map +1 -0
  526. package/dist/hooks/useClickOutside.js +29 -0
  527. package/dist/hooks/useClickOutside.js.map +1 -0
  528. package/dist/hooks/useControllableState.d.ts +2 -0
  529. package/dist/hooks/useControllableState.d.ts.map +1 -0
  530. package/dist/hooks/useControllableState.js +3 -0
  531. package/dist/hooks/useControllableState.js.map +1 -0
  532. package/dist/hooks/useCopyToClipboard.d.ts +9 -0
  533. package/dist/hooks/useCopyToClipboard.d.ts.map +1 -0
  534. package/dist/hooks/useCopyToClipboard.js +23 -0
  535. package/dist/hooks/useCopyToClipboard.js.map +1 -0
  536. package/dist/hooks/useCountdown.d.ts +24 -0
  537. package/dist/hooks/useCountdown.d.ts.map +1 -0
  538. package/dist/hooks/useCountdown.js +59 -0
  539. package/dist/hooks/useCountdown.js.map +1 -0
  540. package/dist/hooks/useDebouncedCallback.d.ts +7 -0
  541. package/dist/hooks/useDebouncedCallback.d.ts.map +1 -0
  542. package/dist/hooks/useDebouncedCallback.js +15 -0
  543. package/dist/hooks/useDebouncedCallback.js.map +1 -0
  544. package/dist/hooks/useDebouncedValue.d.ts +4 -0
  545. package/dist/hooks/useDebouncedValue.d.ts.map +1 -0
  546. package/dist/hooks/useDebouncedValue.js +19 -0
  547. package/dist/hooks/useDebouncedValue.js.map +1 -0
  548. package/dist/hooks/useDisclosure.d.ts +21 -0
  549. package/dist/hooks/useDisclosure.d.ts.map +1 -0
  550. package/dist/hooks/useDisclosure.js +20 -0
  551. package/dist/hooks/useDisclosure.js.map +1 -0
  552. package/dist/hooks/useDocumentTitle.d.ts +8 -0
  553. package/dist/hooks/useDocumentTitle.d.ts.map +1 -0
  554. package/dist/hooks/useDocumentTitle.js +18 -0
  555. package/dist/hooks/useDocumentTitle.js.map +1 -0
  556. package/dist/hooks/useElementSize.d.ts +13 -0
  557. package/dist/hooks/useElementSize.d.ts.map +1 -0
  558. package/dist/hooks/useElementSize.js +28 -0
  559. package/dist/hooks/useElementSize.js.map +1 -0
  560. package/dist/hooks/useEventListener.d.ts +10 -0
  561. package/dist/hooks/useEventListener.d.ts.map +1 -0
  562. package/dist/hooks/useEventListener.js +30 -0
  563. package/dist/hooks/useEventListener.js.map +1 -0
  564. package/dist/hooks/useHotkeys.d.ts +24 -0
  565. package/dist/hooks/useHotkeys.d.ts.map +1 -0
  566. package/dist/hooks/useHotkeys.js +69 -0
  567. package/dist/hooks/useHotkeys.js.map +1 -0
  568. package/dist/hooks/useIdle.d.ts +16 -0
  569. package/dist/hooks/useIdle.d.ts.map +1 -0
  570. package/dist/hooks/useIdle.js +63 -0
  571. package/dist/hooks/useIdle.js.map +1 -0
  572. package/dist/hooks/useInView.d.ts +13 -0
  573. package/dist/hooks/useInView.d.ts.map +1 -0
  574. package/dist/hooks/useInView.js +32 -0
  575. package/dist/hooks/useInView.js.map +1 -0
  576. package/dist/hooks/useInfiniteScroll.d.ts +20 -0
  577. package/dist/hooks/useInfiniteScroll.d.ts.map +1 -0
  578. package/dist/hooks/useInfiniteScroll.js +38 -0
  579. package/dist/hooks/useInfiniteScroll.js.map +1 -0
  580. package/dist/hooks/useInterval.d.ts +3 -0
  581. package/dist/hooks/useInterval.d.ts.map +1 -0
  582. package/dist/hooks/useInterval.js +15 -0
  583. package/dist/hooks/useInterval.js.map +1 -0
  584. package/dist/hooks/useIsClient.d.ts +6 -0
  585. package/dist/hooks/useIsClient.d.ts.map +1 -0
  586. package/dist/hooks/useIsClient.js +11 -0
  587. package/dist/hooks/useIsClient.js.map +1 -0
  588. package/dist/hooks/useLatest.d.ts +7 -0
  589. package/dist/hooks/useLatest.d.ts.map +1 -0
  590. package/dist/hooks/useLatest.js +14 -0
  591. package/dist/hooks/useLatest.js.map +1 -0
  592. package/dist/hooks/useMediaQuery.d.ts +6 -0
  593. package/dist/hooks/useMediaQuery.d.ts.map +1 -0
  594. package/dist/hooks/useMediaQuery.js +20 -0
  595. package/dist/hooks/useMediaQuery.js.map +1 -0
  596. package/dist/hooks/useMergedRefs.d.ts +6 -0
  597. package/dist/hooks/useMergedRefs.d.ts.map +1 -0
  598. package/dist/hooks/useMergedRefs.js +9 -0
  599. package/dist/hooks/useMergedRefs.js.map +1 -0
  600. package/dist/hooks/useObjectUrl.d.ts +7 -0
  601. package/dist/hooks/useObjectUrl.d.ts.map +1 -0
  602. package/dist/hooks/useObjectUrl.js +21 -0
  603. package/dist/hooks/useObjectUrl.js.map +1 -0
  604. package/dist/hooks/useOnlineStatus.d.ts +3 -0
  605. package/dist/hooks/useOnlineStatus.d.ts.map +1 -0
  606. package/dist/hooks/useOnlineStatus.js +15 -0
  607. package/dist/hooks/useOnlineStatus.js.map +1 -0
  608. package/dist/hooks/usePageVisibility.d.ts +3 -0
  609. package/dist/hooks/usePageVisibility.d.ts.map +1 -0
  610. package/dist/hooks/usePageVisibility.js +11 -0
  611. package/dist/hooks/usePageVisibility.js.map +1 -0
  612. package/dist/hooks/usePolling.d.ts +17 -0
  613. package/dist/hooks/usePolling.d.ts.map +1 -0
  614. package/dist/hooks/usePolling.js +46 -0
  615. package/dist/hooks/usePolling.js.map +1 -0
  616. package/dist/hooks/usePrefersReducedMotion.d.ts +3 -0
  617. package/dist/hooks/usePrefersReducedMotion.d.ts.map +1 -0
  618. package/dist/hooks/usePrefersReducedMotion.js +7 -0
  619. package/dist/hooks/usePrefersReducedMotion.js.map +1 -0
  620. package/dist/hooks/usePresence.d.ts +2 -0
  621. package/dist/hooks/usePresence.d.ts.map +1 -0
  622. package/dist/hooks/usePresence.js +3 -0
  623. package/dist/hooks/usePresence.js.map +1 -0
  624. package/dist/hooks/usePrevious.d.ts +3 -0
  625. package/dist/hooks/usePrevious.d.ts.map +1 -0
  626. package/dist/hooks/usePrevious.js +15 -0
  627. package/dist/hooks/usePrevious.js.map +1 -0
  628. package/dist/hooks/useScroll.d.ts +22 -0
  629. package/dist/hooks/useScroll.d.ts.map +1 -0
  630. package/dist/hooks/useScroll.js +73 -0
  631. package/dist/hooks/useScroll.js.map +1 -0
  632. package/dist/hooks/useScrollLock.d.ts +6 -0
  633. package/dist/hooks/useScrollLock.d.ts.map +1 -0
  634. package/dist/hooks/useScrollLock.js +17 -0
  635. package/dist/hooks/useScrollLock.js.map +1 -0
  636. package/dist/hooks/useStorageState.d.ts +14 -0
  637. package/dist/hooks/useStorageState.d.ts.map +1 -0
  638. package/dist/hooks/useStorageState.js +62 -0
  639. package/dist/hooks/useStorageState.js.map +1 -0
  640. package/dist/hooks/useSyncedState.d.ts +6 -0
  641. package/dist/hooks/useSyncedState.d.ts.map +1 -0
  642. package/dist/hooks/useSyncedState.js +16 -0
  643. package/dist/hooks/useSyncedState.js.map +1 -0
  644. package/dist/hooks/useThrottledCallback.d.ts +4 -0
  645. package/dist/hooks/useThrottledCallback.d.ts.map +1 -0
  646. package/dist/hooks/useThrottledCallback.js +12 -0
  647. package/dist/hooks/useThrottledCallback.js.map +1 -0
  648. package/dist/hooks/useThrottledValue.d.ts +4 -0
  649. package/dist/hooks/useThrottledValue.d.ts.map +1 -0
  650. package/dist/hooks/useThrottledValue.js +19 -0
  651. package/dist/hooks/useThrottledValue.js.map +1 -0
  652. package/dist/hooks/useTimeout.d.ts +9 -0
  653. package/dist/hooks/useTimeout.d.ts.map +1 -0
  654. package/dist/hooks/useTimeout.js +23 -0
  655. package/dist/hooks/useTimeout.js.map +1 -0
  656. package/dist/hooks/useWindowSize.d.ts +12 -0
  657. package/dist/hooks/useWindowSize.d.ts.map +1 -0
  658. package/dist/hooks/useWindowSize.js +38 -0
  659. package/dist/hooks/useWindowSize.js.map +1 -0
  660. package/dist/index.d.ts +26 -5
  661. package/dist/index.d.ts.map +1 -1
  662. package/dist/index.js +26 -5
  663. package/dist/index.js.map +1 -1
  664. package/dist/input-date.css +51 -1
  665. package/dist/input.css +13 -0
  666. package/dist/logo.css +7 -0
  667. package/dist/menu.css +198 -0
  668. package/dist/pagination.css +140 -0
  669. package/dist/popover.css +106 -0
  670. package/dist/progress.css +187 -0
  671. package/dist/qr-code.css +7 -0
  672. package/dist/server/crypto.d.ts +26 -0
  673. package/dist/server/crypto.d.ts.map +1 -0
  674. package/dist/server/crypto.js +50 -0
  675. package/dist/server/crypto.js.map +1 -0
  676. package/dist/server/index.d.ts +9 -0
  677. package/dist/server/index.d.ts.map +1 -0
  678. package/dist/server/index.js +9 -0
  679. package/dist/server/index.js.map +1 -0
  680. package/dist/server/rate-limit.d.ts +20 -0
  681. package/dist/server/rate-limit.d.ts.map +1 -0
  682. package/dist/server/rate-limit.js +42 -0
  683. package/dist/server/rate-limit.js.map +1 -0
  684. package/dist/server/request.d.ts +42 -0
  685. package/dist/server/request.d.ts.map +1 -0
  686. package/dist/server/request.js +94 -0
  687. package/dist/server/request.js.map +1 -0
  688. package/dist/server/response.d.ts +19 -0
  689. package/dist/server/response.d.ts.map +1 -0
  690. package/dist/server/response.js +44 -0
  691. package/dist/server/response.js.map +1 -0
  692. package/dist/sidebar.css +271 -0
  693. package/dist/skill/leaf-design-system-0.2.4.zip +0 -0
  694. package/dist/slider.css +9 -0
  695. package/dist/spinner.css +7 -0
  696. package/dist/steps.css +211 -0
  697. package/dist/styles.css +5322 -2429
  698. package/dist/table.css +421 -0
  699. package/dist/toast.css +38 -2
  700. package/dist/toggle.css +7 -0
  701. package/dist/tooltip.css +46 -0
  702. package/dist/upload.css +9 -0
  703. package/dist/utils/RemixGlyph.d.ts +1 -1
  704. package/dist/utils/RemixGlyph.d.ts.map +1 -1
  705. package/dist/utils/RemixGlyph.js +1 -1
  706. package/dist/utils/RemixGlyph.js.map +1 -1
  707. package/dist/utils/colorClass.d.ts +2 -0
  708. package/dist/utils/colorClass.d.ts.map +1 -1
  709. package/dist/utils/colorClass.js +14 -0
  710. package/dist/utils/colorClass.js.map +1 -1
  711. package/dist/utils/useFloating.d.ts +11 -0
  712. package/dist/utils/useFloating.d.ts.map +1 -0
  713. package/dist/utils/useFloating.js +34 -0
  714. package/dist/utils/useFloating.js.map +1 -0
  715. package/dist/utils/useFloatingLayer.d.ts +40 -0
  716. package/dist/utils/useFloatingLayer.d.ts.map +1 -0
  717. package/dist/utils/useFloatingLayer.js +95 -0
  718. package/dist/utils/useFloatingLayer.js.map +1 -0
  719. package/dist/utils/usePresence.d.ts +9 -0
  720. package/dist/utils/usePresence.d.ts.map +1 -0
  721. package/dist/utils/usePresence.js +25 -0
  722. package/dist/utils/usePresence.js.map +1 -0
  723. package/dist/virtual-list.css +60 -0
  724. package/package.json +49 -10
  725. package/dist/cdn/leaf-0.2.2.min.css +0 -2
  726. package/dist/cdn/leaf-0.2.2.min.js +0 -165
  727. package/dist/skill/leaf-design-system-0.2.2.zip +0 -0
package/README.md CHANGED
@@ -3,14 +3,15 @@
3
3
  Design system của Finhay: **2 bộ token — Color và Typography** (CSS variables trong
4
4
  [`@finhay/leaf-tokens`](../tokens)), **class typography / màu dùng sẵn** và **component** (React +
5
5
  HTML tĩnh dùng chung markup). Màu và chữ luôn đọc từ token; spacing / radius / độ dày viền không
6
- phải token của Leaf — component tự khai báo trong CSS của nó, app dùng Tailwind hoặc CSS của page.
6
+ phải token của Leaf — component tự khai báo trong CSS của nó, app dùng Tailwind.
7
7
 
8
- Leaf **không** có class layout / spacing / responsive. Phần đó thuộc về app, theo 2 cách dùng:
8
+ Leaf **không** có class layout / spacing / responsive. Phần đó luôn là **Tailwind CSS v4**, cho
9
+ cả 2 cách dùng:
9
10
 
10
- | Loại project | Leaf cung cấp | Layout · spacing · responsive · hover |
11
- | ------------------- | ------------------------------------------ | ------------------------------------- |
12
- | Next.js (có bundle) | Token + class typography / màu + component | **Tailwind CSS v4** |
13
- | Landing page tĩnh | Bản CDN (1 `<link>` + 1 `<script>`) | **CSS riêng của page** |
11
+ | Loại project | Leaf cung cấp | Layout · spacing · responsive · hover |
12
+ | ------------------------------ | ------------------------------------------ | ------------------------------------------------------------------- |
13
+ | React / Next.js (có bundle) | Token + class typography / màu + component | **Tailwind CSS v4** (`@tailwindcss/postcss` / `vite`) |
14
+ | Landing page / HTML tĩnh (CDN) | Bản CDN (1 `<link>` + 1 `<script>`) | **Tailwind CSS v4** (CLI cho production, Browser CDN để dựng nhanh) |
14
15
 
15
16
  Xem [Dùng với Next.js + Tailwind](#dùng-với-nextjs--tailwind) và [HTML tĩnh (CDN)](#html-tĩnh-cdn).
16
17
 
@@ -53,6 +54,25 @@ chọn phần class cần dùng.
53
54
  | `@finhay-pro/leaf-design-system/toast.css` | Style của `Toaster` / `ToastContent`. |
54
55
  | `@finhay-pro/leaf-design-system/dropdown.css` | Style của component `Dropdown`. |
55
56
  | `@finhay-pro/leaf-design-system/file-viewer.css` | Style của `FileViewer` (kèm `button.css` + `spinner.css` + `empty.css`). |
57
+ | `@finhay-pro/leaf-design-system/number.css` | Style của `Number`. |
58
+ | `@finhay-pro/leaf-design-system/date.css` | Style của `Date`. |
59
+ | `@finhay-pro/leaf-design-system/focus.css` | Tắt outline khi focus bằng chuột cho component Leaf. |
60
+ | `@finhay-pro/leaf-design-system/textarea.css` | Style của `Textarea`. |
61
+ | `@finhay-pro/leaf-design-system/upload.css` | Style của `Upload`. |
62
+ | `@finhay-pro/leaf-design-system/multiselect.css` | Style của `MultiSelect` (kèm `dropdown.css`). |
63
+ | `@finhay-pro/leaf-design-system/form.css` | Layout của `Form`. |
64
+ | `@finhay-pro/leaf-design-system/table.css` | Style của `Table` (kèm `checkbox.css` khi `selectable`, `skeleton.css` khi loading). |
65
+ | `@finhay-pro/leaf-design-system/popover.css` | `Popover` + khung nổi `.leaf-floating`. |
66
+ | `@finhay-pro/leaf-design-system/menu.css` | `Menu` + khung nổi `.leaf-floating`. |
67
+ | `@finhay-pro/leaf-design-system/pagination.css` | `Pagination` (kèm `dropdown.css` khi có `pageSizeOptions`). |
68
+ | `@finhay-pro/leaf-design-system/virtual-list.css` | `VirtualList`. |
69
+ | `@finhay-pro/leaf-design-system/badge.css` | `Badge` / `Tag`. |
70
+ | `@finhay-pro/leaf-design-system/progress.css` | `Progress`. |
71
+ | `@finhay-pro/leaf-design-system/accordion.css` | `Accordion` / `Collapsible`. |
72
+ | `@finhay-pro/leaf-design-system/breadcrumb.css` | `Breadcrumb` (kèm `menu.css` khi `maxItems`). |
73
+ | `@finhay-pro/leaf-design-system/avatar.css` | `Avatar` / `AvatarGroup`. |
74
+ | `@finhay-pro/leaf-design-system/steps.css` | `Steps`. |
75
+ | `@finhay-pro/leaf-design-system/sidebar.css` | `Sidebar` (kèm `tooltip.css` khi thu gọn). |
56
76
  | `@finhay-pro/leaf-design-system/classes.css` | Tất cả class + component, không token. |
57
77
  | `@finhay-pro/leaf-design-system/styles.css` | Token + tất cả class + component. Một dòng là đủ. |
58
78
 
@@ -89,6 +109,25 @@ Import bằng CSS:
89
109
  @import "@finhay-pro/leaf-design-system/toast.css";
90
110
  @import "@finhay-pro/leaf-design-system/dropdown.css";
91
111
  @import "@finhay-pro/leaf-design-system/file-viewer.css";
112
+ @import "@finhay-pro/leaf-design-system/number.css";
113
+ @import "@finhay-pro/leaf-design-system/date.css";
114
+ @import "@finhay-pro/leaf-design-system/focus.css";
115
+ @import "@finhay-pro/leaf-design-system/textarea.css";
116
+ @import "@finhay-pro/leaf-design-system/upload.css";
117
+ @import "@finhay-pro/leaf-design-system/multiselect.css";
118
+ @import "@finhay-pro/leaf-design-system/form.css";
119
+ @import "@finhay-pro/leaf-design-system/table.css";
120
+ @import "@finhay-pro/leaf-design-system/popover.css";
121
+ @import "@finhay-pro/leaf-design-system/menu.css";
122
+ @import "@finhay-pro/leaf-design-system/pagination.css";
123
+ @import "@finhay-pro/leaf-design-system/virtual-list.css";
124
+ @import "@finhay-pro/leaf-design-system/badge.css";
125
+ @import "@finhay-pro/leaf-design-system/progress.css";
126
+ @import "@finhay-pro/leaf-design-system/accordion.css";
127
+ @import "@finhay-pro/leaf-design-system/breadcrumb.css";
128
+ @import "@finhay-pro/leaf-design-system/avatar.css";
129
+ @import "@finhay-pro/leaf-design-system/steps.css";
130
+ @import "@finhay-pro/leaf-design-system/sidebar.css";
92
131
  ```
93
132
 
94
133
  Muốn gọn thì một dòng `@import "@finhay-pro/leaf-design-system/styles.css";` thay cho cả khối trên.
@@ -119,7 +158,7 @@ viền, responsive và state (`hover:`, `md:`…). Cấu hình mẫu trong `glob
119
158
  ```
120
159
 
121
160
  ```tsx
122
- import { Button } from "@finhay-pro/leaf-design-system";
161
+ import { Button } from "@finhay-pro/leaf-design-system/components";
123
162
 
124
163
  <section className="bg-secondary border-quaternary flex flex-col gap-3 rounded-xl border p-4 md:p-6">
125
164
  <h3 className="heading-3 text-primary">Tích luỹ</h3>
@@ -217,8 +256,8 @@ viết thêm gì cho light mode.
217
256
  | System (đủ 3 bộ) | `text-*`, `bg-*`, `border-*` với `red`, `green`, `yellow`, `orange`, `blue`, `purple` (+ `-secondary`) |
218
257
 
219
258
  ```html
220
- <!-- Viền: class màu chỉ set border-color — độ dày / padding do app (Tailwind hoặc CSS của page) -->
221
- <div class="bg-secondary border-quaternary card">
259
+ <!-- Viền: class màu chỉ set border-color — độ dày / padding / radius do Tailwind -->
260
+ <div class="bg-secondary border-quaternary rounded-xl border p-4">
222
261
  <h3 class="heading-3 text-primary">Tích luỹ</h3>
223
262
  <p class="body-4 text-secondary">Lợi nhuận kỳ vọng 8.5%/năm</p>
224
263
  <p class="body-4 text-red">Số dư không đủ</p>
@@ -240,7 +279,7 @@ pnpm add @remixicon/react
240
279
  ```
241
280
 
242
281
  ```tsx
243
- import { Button } from "@finhay-pro/leaf-design-system";
282
+ import { Button } from "@finhay-pro/leaf-design-system/components";
244
283
  import { RiAddLine, RiHomeLine } from "@remixicon/react";
245
284
 
246
285
  <RiHomeLine size={24} />
@@ -250,7 +289,12 @@ import { RiAddLine, RiHomeLine } from "@remixicon/react";
250
289
 
251
290
  ```html
252
291
  <!-- HTML tĩnh: font CSS của Remix, size theo font-size, màu theo color -->
253
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/remixicon@4.9.1/fonts/remixicon.css" />
292
+ <link
293
+ rel="stylesheet"
294
+ href="https://cdn.jsdelivr.net/npm/remixicon@4.9.1/fonts/remixicon.css"
295
+ integrity="sha384-K8MyQheOpUlTMhpk/Rxz4Rtn4VxtjdRLpEhsT/cdBJZeu9Q+2PxLoSpvgvkSwrR2"
296
+ crossorigin="anonymous"
297
+ />
254
298
  <i class="ri-home-line text-secondary"></i>
255
299
  ```
256
300
 
@@ -259,12 +303,17 @@ Không dùng thư viện icon khác hay tự vẽ SVG icon. Icons by [Remix Icon
259
303
 
260
304
  ## Cần biết
261
305
 
306
+ - **CSP tối thiểu.** Component không cần `'unsafe-eval'` và không dùng HTML string nên hợp với
307
+ `require-trusted-types-for 'script'`. Cần thêm tuỳ tính năng dùng:
308
+ `style-src 'unsafe-inline'` (style động, runtime leaf.js) · File Viewer: `frame-src blob:`,
309
+ `img-src blob:`, `media-src blob:`, `connect-src <origin file>` · `<Empty image="">`,
310
+ `LanguageDropdown`: `img-src https://cdn1.finhay.com.vn`.
262
311
  - **Class typography chỉ set đúng 3 thuộc tính** (`font-size`, `line-height`, `font-weight`);
263
312
  **class color chỉ set đúng 1** (`color` / `background-color` / `border-color`). Font family,
264
313
  letter spacing… nằm ngoài phạm vi — app tự setup ở tầng global
265
- (`body { font-family: var(--font-sans) }`, CSS reset…).
266
- - **Leaf không có class layout / spacing / radius / border width / responsive.** Next.js dùng
267
- Tailwind, landing page dùng CSS của page. Leaf cũng **không** có token spacing / radius / độ dày
314
+ (`body { font-family: var(--font-sans) }`; CSS reset là preflight của Tailwind).
315
+ - **Leaf không có class layout / spacing / radius / border width / responsive.** Mọi app (React,
316
+ Next.js, HTML tĩnh) dùng Tailwind. Leaf cũng **không** có token spacing / radius / độ dày
268
317
  viền — chỉ có token màu và typography.
269
318
  - **Typography và CSS component nằm trong `@layer components`**; **class màu nằm trong
270
319
  `@layer utilities`** (đè được CSS component, vd. `leaf-spinner text-highlight`). Utility của app
@@ -274,7 +323,7 @@ Không dùng thư viện icon khác hay tự vẽ SVG icon. Icons by [Remix Icon
274
323
  Tailwind v4, nên import file theo thứ tự nào thì class màu vẫn đứng trên CSS component. Component
275
324
  không trông vào CSS reset: tự reset `button`, tự xử lý `[hidden]`.
276
325
  - **Class không có biến thể `hover:` / `focus:` / opacity** — nó là CSS thuần. Cần state thì dùng
277
- Tailwind (`hover:text-(color:--text-highlight)`) hoặc CSS của page với cùng token.
326
+ Tailwind với token (`hover:text-(color:--text-highlight)`).
278
327
  - **Chỉ semantic token mới có class màu.** Primitive (`--neutral-500`, `--brand-300`…) là nguồn nội
279
328
  bộ, dùng thẳng trong UI là mất khả năng đổi theme. Spacing / border-width / radius là thang kích
280
329
  thước cố định, không đổi theo theme.
@@ -323,29 +372,43 @@ vào bản CDN, không vào bản npm.
323
372
 
324
373
  ## Components
325
374
 
326
- | Export | Mô tả |
327
- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
328
- | `Button` | Khung icon · label · icon — bật/tắt từng phần; `width` / `height`; `onClick` trả Promise → tự loading (spinner thay leading icon, khoá click), `loading` controlled |
329
- | `Tabs` | Tabs Items — `items[]` (`value` · `label: ReactNode` · `disabled`); phím ← → Home End |
330
- | `Dialog` | Panel + backdrop blur — `open` (controlled), `title` / `onBack` / `onClose(reason)`, `dismissible`, `closeLabel` / `backLabel`, `theme`, `maxWidth` / `height` / `maxHeight` |
331
- | `Logo` | Wordmark FHSC · Finhay · FHC — `brand` / `mode` / `side` / `size` |
332
- | `Skeleton` | Placeholder shimmer — `width` / `height` / `border` (radius), nền `--base-tertiary` |
333
- | `Empty` | Trạng thái không có dữ liệu — `image` (string URL; không truyền = ẩn, `""` = CDN mặc định) · `size` sm/md · `description` (mặc định “Không có dữ liệu”) |
334
- | `Spinner` | Indicator 8 nan — `animation` (`spin` · `fade` · `pulse` · `breathe`), `size` |
335
- | `Toggle` | Công tắc On/Off — `size` md/sm, `checked`, `disabled` (Figma Active Off); `name` / `value` → input ẩn cho form |
336
- | `Slider` | Kéo từng `step` trong `min`–`max` (mặc định 0–100, bước 1) · mốc `steps` · `labels`; `name` → input ẩn |
337
- | `Tooltip` | Hover/focus/Escape — `size`, `position`, `align`, `onOpenChange`; `trigger="click"`, `openDelay` / `closeDelay`, tự lật phía khi thiếu chỗ, `theme`; kèm `TooltipContent` |
338
- | `Radio` / `RadioGroup` | Radio đơn + nhóm — `value` / `defaultValue` / `onValueChange`, `name` cho form, `disabled`, `orientation` |
339
- | `Checkbox` | Checkbox — `checked` / `defaultChecked` / `onCheckedChange` (`checked="indeterminate"` cho trạng thái lưng chừng), `label`, `disabled`; input native nên đi thẳng vào `FormData` |
340
- | `Input` | Input dynamic — `variant` field/inline, `shape` default/pill, slot `label` · `leadingIcon` · `trailingIcon` · `action` · `message`, `invalid`, `revealPassword`; `as="button"` làm trigger |
341
- | `InputOtp` | Ô OTP — `length`, `mask`, dán cả mã, `onComplete`; `name` → input ẩn |
342
- | `InputStepper` | Nhập số với −/+ — `tone` buy/sell, `step` / `min` / `max` / `precision`, `locale`, `unit`; phím ↑ ↓, chốt khi blur/Enter |
343
- | `Calendar` | Lịch tháng (port từ vnsc) — chọn ngày / giờ / tháng (`showTime`, `timeOnly`, `monthOnly`), `minDate` / `maxDate` / `disablePast` / `disableFuture` / `disableDate`, luật giờ (`minHour` / `maxHour` / `minuteStep`…), `weekStartsOn`, `labels`; dùng độc lập được |
344
- | `InputDate` | `Input` trigger + popover `Calendar` — `value` chốt khi bấm "Chọn" (hoặc `confirmOnSelect`), `formatDisplay`, `align`, `monthOnly` (MM/YYYY); `name` → input ẩn ISO |
345
- | `Toaster` / `toast` | Toast success / error / warning — `toast.success(title, { description, duration })`, `duration: -1` không tự đóng, dừng khi hover / focus, `toast.dismiss(id)`; `<Toaster position closeLabel theme />` đặt một lần; kèm `ToastContent` |
346
- | `Dropdown` | Chọn một giá trị — `variant` list / radio, `trigger` field / text, `appearance` filled / outlined, `size` md / sm, `openOn` click / hover, `align`, `readOnly`, `maxHeight`; option `leading` / `disabled`; phím ↑ ↓ Home End + typeahead |
347
- | `FileViewer` | Xem file (PDF native, XLSX / CSV, DOCX, ảnh, video / audio, text) không thư viện ngoài — `source` URL (+`fetchInit`) / Blob / base64, toolbar, `ref`; kèm `FileViewerDialog` |
348
- | `LanguageDropdown` | Chọn ngôn ngữ Tiếng Việt / English kèm cờ (CDN Finhay) — danh sách ở `LEAF_LANGUAGES`, `value` kiểu `LeafLanguageCode`; mặc định `size="sm"`, `openOn="hover"`, `align="end"` |
375
+ | Export | Mô tả |
376
+ | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
377
+ | `Button` | Khung icon · label · icon — bật/tắt từng phần; `width` / `height`; `onClick` trả Promise → tự loading (spinner thay leading icon, khoá click), `loading` controlled |
378
+ | `Tabs` | Tabs Items — `items[]` (`value` · `label: ReactNode` · `disabled`); phím ← → Home End |
379
+ | `Dialog` | Panel + backdrop blur — `open` (controlled), `title` / `onBack` / `onClose(reason)`, `dismissible`, `closeLabel` / `backLabel`, `theme`, `maxWidth` / `height` / `maxHeight` |
380
+ | `Logo` | Wordmark FHSC · Finhay · FHC — `brand` / `mode` / `side` / `size` |
381
+ | `Skeleton` | Placeholder shimmer — `width` / `height` / `border` (radius), nền `--base-tertiary` |
382
+ | `Empty` | Trạng thái không có dữ liệu — `image` (string URL; không truyền = ẩn, `""` = CDN mặc định) · `size` sm/md · `description` (mặc định “Không có dữ liệu”) |
383
+ | `Spinner` | Indicator 8 nan — `animation` (`spin` · `fade` · `pulse` · `breathe`), `size` |
384
+ | `Toggle` | Công tắc On/Off — `size` md/sm, `checked`, `disabled` (Figma Active Off); `name` / `value` → input ẩn cho form |
385
+ | `Slider` | Kéo từng `step` trong `min`–`max` (mặc định 0–100, bước 1) · mốc `steps` · `labels`; `name` → input ẩn |
386
+ | `Tooltip` | Hover/focus/Escape — `size`, `position`, `align`, `onOpenChange`; `trigger="click"`, `openDelay` / `closeDelay`, tự lật phía khi thiếu chỗ, `theme`; kèm `TooltipContent` |
387
+ | `Radio` / `RadioGroup` | Radio đơn + nhóm — `value` / `defaultValue` / `onValueChange`, `name` cho form, `disabled`, `orientation` |
388
+ | `Checkbox` | Checkbox — `checked` / `defaultChecked` / `onCheckedChange` (`checked="indeterminate"` cho trạng thái lưng chừng), `label`, `disabled`; input native nên đi thẳng vào `FormData` |
389
+ | `Input` | Input dynamic — `variant` field/inline, `shape` default/pill, slot `label` · `leadingIcon` · `trailingIcon` · `action` · `message`, `invalid`, `revealPassword`; `as="button"` làm trigger |
390
+ | `InputOtp` | Ô OTP — `length`, `mask`, dán cả mã, `onComplete`; `name` → input ẩn |
391
+ | `InputStepper` | Nhập số với −/+ — `tone` buy/sell, `step` / `min` / `max` / `precision`, `locale`, `unit`; phím ↑ ↓, chốt khi blur/Enter |
392
+ | `Calendar` | Lịch tháng (port từ vnsc) — chọn ngày / giờ / tháng (`showTime`, `timeOnly`, `monthOnly`), `minDate` / `maxDate` / `disablePast` / `disableFuture` / `disableDate`, luật giờ (`minHour` / `maxHour` / `minuteStep`…), `weekStartsOn`, `labels`; dùng độc lập được |
393
+ | `InputDate` | `Input` trigger + popover `Calendar` — `value` chốt khi bấm "Chọn" (hoặc `confirmOnSelect`), `formatDisplay`, `align`, `monthOnly` (MM/YYYY); `name` → input ẩn ISO |
394
+ | `Toaster` / `toast` | Toast info / success / error / warning — `toast.success(title, { description, duration, action })`, `duration: -1` không tự đóng, dừng khi hover / focus, `toast.dismiss(id)`; `<Toaster position closeLabel theme />` đặt một lần; kèm `ToastContent` |
395
+ | `Popover` / `PopoverContent` | Panel nổi non-modal neo trigger (bộ lọc nhanh, chi tiết) — portal, tự lật, `openOn` click / hover |
396
+ | `Menu` / `MenuContent` | Menu hành động (nút “…”, context menu chuột phải / giữ lâu) — `items`, `onSelect`, bàn phím đầy đủ |
397
+ | `Drawer` | Side panel / bottom sheet (kéo xuống để đóng) — `Dialog` với `placement`; Dialog có thêm `mobileLayout` `fullscreen` / `sheet` |
398
+ | `Pagination` | Thanh phân trang — dải trang có “…”, trước / sau, `pageSizeOptions`, `variant="simple"` cho mobile; ghép `Table pageSize page` |
399
+ | `VirtualList` | Danh sách dài chỉ render vùng nhìn (JS thuần) — `itemHeight` hoặc đo thật, `scrollSource`, `onEndReached`, `loadingMore`; thay `@tanstack/react-virtual` |
400
+ | `InputDateRange` / `CalendarRange` | Chọn khoảng ngày từ – đến trong một panel — preset, `maxRangeDays`, popover portal |
401
+ | `InputNumber` | Ô số có phân cách nghìn khi gõ (giữ con trỏ), `decimals`, `allowNegative`, `min` / `max` khi blur; `InputStepper formatOnType` |
402
+ | `Badge` / `Tag` | Nhãn trạng thái (`status` dùng chung bảng màu Toast), badge số, chip xoá được |
403
+ | `Progress` | Thanh / vòng tiến độ, indeterminate — chỉ CSS |
404
+ | `Accordion` / `Collapsible` | Nhóm mục mở / đóng (single / multiple), bàn phím ↑ ↓ Home End |
405
+ | `Breadcrumb` | Đường dẫn phân cấp, `maxItems` dồn vào Menu "…", `renderLink` |
406
+ | `Avatar` / `AvatarGroup` | Ảnh / chữ cái đầu / icon, chấm trạng thái, nhóm +N |
407
+ | `Steps` | Các bước của luồng (complete / current / upcoming / error), quay lại bước đã xong, gọn trên mobile |
408
+ | `Sidebar` | Điều hướng trái của app: nhóm con, badge, thu gọn còn icon (Tooltip), `renderLink` |
409
+ | `Dropdown` | Chọn một giá trị — `variant` list / radio, `trigger` field / text, `appearance` filled / outlined, `size` md / sm, `openOn` click / hover, `align`, `readOnly`, `maxHeight`; option `leading` / `disabled`; phím ↑ ↓ Home End + typeahead |
410
+ | `FileViewer` | Xem file (PDF native, XLSX / CSV, DOCX, ảnh, video / audio, text) không thư viện ngoài — `source` URL (+`fetchInit`) / Blob / base64, toolbar, `ref`; kèm `FileViewerDialog` |
411
+ | `LanguageDropdown` | Chọn ngôn ngữ Tiếng Việt / English kèm cờ (CDN Finhay) — danh sách ở `LEAF_LANGUAGES`, `value` kiểu `LeafLanguageCode`; mặc định `size="sm"`, `openOn="hover"`, `align="end"` |
349
412
 
350
413
  ```css
351
414
  /* Ngoài tokens.css + typography.css, mỗi component cần CSS riêng của nó
@@ -384,7 +447,7 @@ import {
384
447
  LanguageDropdown,
385
448
  Toaster,
386
449
  toast,
387
- } from "@finhay-pro/leaf-design-system";
450
+ } from "@finhay-pro/leaf-design-system/components";
388
451
  import { RiAddLine, RiArrowRightLine } from "@remixicon/react";
389
452
 
390
453
  <Button priority="primary" size="md" leadingIcon={<RiAddLine />} trailingIcon={<RiArrowRightLine />}>
@@ -417,6 +480,54 @@ import { RiAddLine, RiArrowRightLine } from "@remixicon/react";
417
480
  toast.success("Đặt lệnh thành công", { description: "Mua 100 AAA" });
418
481
  ```
419
482
 
483
+ ## Hooks, utils & server (import riêng)
484
+
485
+ UI component, hook và hàm thuần là **ba import khác nhau** (thêm một entry cho server). Entry UI
486
+ không re-export hook / util; mỗi hook / hàm là một module riêng nên import gì tải nấy
487
+ (`test/build/tree-shaking.test.ts` bundle thử bằng esbuild: `debounce` ≈ 0,5 KB, `useDebouncedValue`
488
+ ≈ 1 KB, `jsonResponse` ≈ 0,2 KB — không kéo component).
489
+
490
+ | Import | Chứa | Môi trường |
491
+ | ------------------------------------------- | -------------------------------------------------------------------------------------- | ----------------------- |
492
+ | `@finhay-pro/leaf-design-system/components` | UI component (entry gốc `@finhay-pro/leaf-design-system` chỉ là alias tương thích) | client |
493
+ | `@finhay-pro/leaf-design-system/hooks` | 39 hook: gọi API, pacer, timer, DOM / trình duyệt, state | client (`"use client"`) |
494
+ | `@finhay-pro/leaf-design-system/utils` | hàm thuần: retry / timeout, pacer, chuỗi tiếng Việt, URL an toàn, sanitize, định dạng… | server + client |
495
+ | `@finhay-pro/leaf-design-system/server` | route handler: `jsonResponse`, `readBody`, `createRateLimiter`, `timingSafeEqual`… | server |
496
+
497
+ ```tsx
498
+ import { Button } from "@finhay-pro/leaf-design-system/components";
499
+ import { useDebouncedValue } from "@finhay-pro/leaf-design-system/hooks";
500
+ import { formatNumber, isSafeRelativePath } from "@finhay-pro/leaf-design-system/utils";
501
+ import { jsonResponse } from "@finhay-pro/leaf-design-system/server";
502
+ ```
503
+
504
+ - **Tiêu chí:** chỉ ship khái niệm mọi app đều cần (gọi API, hẹn giờ, event, layout, storage, an
505
+ toàn URL / HTML) với API ổn định khi logic app đổi. **Không** ship hàm kiểu lodash (`pick`,
506
+ `get`, `groupBy`, `clamp`, `cx`, id…) — dùng JS native (bảng đổi ở `references/utils.md`).
507
+ - **Peer React 19:** app còn React 18 (`vnsc-backoffice-ui`, `finhay-fe-nextjs`, `vnsc-webview`)
508
+ nâng React trước khi dùng các entry này.
509
+ - **Thay `@tanstack/react-pacer`:** `useDebouncer(fn, { wait }).maybeExecute()` →
510
+ `const run = useDebouncedCallback(fn, wait); run()`; `useThrottler` → `useThrottledCallback`;
511
+ `useBatcher` giữ tên. Hàm thuần `debounce` / `throttle` / `createBatcher` ở `/utils`.
512
+ - **Hàm định dạng** (`formatDate`, `formatNumber`, helper ngày, file…) nên import từ `/utils` (chạy
513
+ trong Server Component không đi qua entry UI). Entry chính vẫn giữ để không phá app đang dùng.
514
+ - **Import sâu (tuỳ chọn):** `@finhay-pro/leaf-design-system/hooks/useCountdown`,
515
+ `@finhay-pro/leaf-design-system/utils/url`. Next.js nên khai báo
516
+ `experimental.optimizePackageImports` cho cả ba entry.
517
+ - HTML không tin cậy (CMS, API): `sanitizeHtml` / `parseSafeHtml` / `createSanitizer` (`/utils`)
518
+ và `<SafeHtml>` (`/components`). Sanitizer thuần TS, không cần DOM — server và client ra cùng
519
+ kết quả, thay DOMPurify / isomorphic-dompurify / sanitize-html. Preset `SANITIZE_PRESETS.text |
520
+ inline | rich | embed`; khối `<style>` bài cũ qua `styleBlocks` / `sanitizeCss`; JSON-LD tách
521
+ bằng `jsonLd: "extract"`. Render bằng `<SafeHtml>`, không dùng prop HTML thô của React. Chuỗi
522
+ từ `sanitizeHtml` chỉ đặt trong ngữ cảnh flow (`div`…), không ghép vào `script` / `style` /
523
+ `textarea` / thuộc tính, không decode / sửa sau khi lọc.
524
+ - `decodeEntities` giải mã đúng spec HTML (2.231 entity, giống `he.decode`); kết quả là text.
525
+ - Bản CDN: `window.Leaf.utils` (`debounce`, `throttle`, `createBatcher`, `copyText`, `sanitizeHtml`,
526
+ `escapeHtml`, `normalizeSearch`, `includesText`, `isSafeHttpUrl`, `isSafeRelativePath`,
527
+ `storage.{get, set, remove, getJson, setJson}`).
528
+
529
+ Danh mục đầy đủ: docs nhóm **Function**, skill `references/hooks.md`, `references/utils.md`.
530
+
420
531
  ## Đọc & ghi file (không UI)
421
532
 
422
533
  Đọc / ghi Excel / CSV / text ngay trên trình duyệt, **không thư viện ngoài** (ZIP giải bằng
@@ -439,7 +550,11 @@ gửi header đăng nhập), `Blob` / `File`, `ArrayBuffer` / typed array, hoặ
439
550
  | `FileReadError` | Lỗi có `code`: `invalid-source` · `fetch-failed` · `too-large` · `corrupt` · `encrypted` · `unsupported` · `legacy-format` · `unsupported-browser` · `aborted` |
440
551
 
441
552
  ```ts
442
- import { readSpreadsheet, spreadsheetToCsv, FileReadError } from "@finhay-pro/leaf-design-system";
553
+ import {
554
+ readSpreadsheet,
555
+ spreadsheetToCsv,
556
+ FileReadError,
557
+ } from "@finhay-pro/leaf-design-system/utils";
443
558
 
444
559
  try {
445
560
  const { sheets } = await readSpreadsheet(file); // File từ <Upload> / <input type="file">
@@ -482,52 +597,79 @@ Mở tab mới / Tải xuống).
482
597
 
483
598
  ## HTML tĩnh (CDN)
484
599
 
485
- Cho landing page / trang dựng tay không có bundler: **Leaf CDN + CSS riêng của page**. 1 `<link>` +
600
+ Cho landing page / trang dựng tay không có bundler: **Leaf CDN + Tailwind CSS v4**. 1 `<link>` +
486
601
  1 `<script>` là dùng được toàn bộ class typography, color và mọi component (CSS). Script chỉ cần
487
602
  khi dùng hành vi Button loading · Tabs · Toggle · Dialog · Slider · Tooltip · InputOtp · InputStepper · Toast · Dropdown · Carousel · QrCode · Upload · Calendar · InputDate · MultiSelect · Form (`data-leaf-*` / `window.Leaf`).
488
- Layout, spacing, responsive của page viết trong CSS của page, dùng token Leaf.
603
+ Layout, spacing, responsive, hover dùng Tailwind giống app React.
489
604
 
490
605
  ```html
491
- <link rel="stylesheet" href="https://<cdn>/leaf-0.2.2.min.css" />
492
- <script src="https://<cdn>/leaf-0.2.2.min.js" defer></script>
606
+ <link
607
+ rel="stylesheet"
608
+ href="https://<cdn>/leaf-0.2.4.min.css"
609
+ integrity="sha384-cNx3KlySoGIvdPeUckbxadJRHEsRDiWjfoVxgJFicBHnzpq731mN6UuwdWHvdByA"
610
+ crossorigin="anonymous"
611
+ />
612
+ <script
613
+ src="https://<cdn>/leaf-0.2.4.min.js"
614
+ integrity="sha384-ypImqpMbo8OFY9IT5C9bxaBRhShzoZbO9pUft1u8T0KSaU+V3BnQu29U40bRhssI"
615
+ crossorigin="anonymous"
616
+ defer
617
+ ></script>
493
618
  <!-- Icon: Remix Icon (xem mục Icon) -->
494
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/remixicon@4.9.1/fonts/remixicon.css" />
495
-
496
- <style>
497
- /* CSS của page — bọc trong @layer để không đè nhầm CSS component (xem "Cần biết") */
498
- @layer base {
499
- body {
500
- margin: 0;
501
- font-family: var(--font-sans);
502
- background: var(--base-primary);
503
- }
504
- }
619
+ <link
620
+ rel="stylesheet"
621
+ href="https://cdn.jsdelivr.net/npm/remixicon@4.9.1/fonts/remixicon.css"
622
+ integrity="sha384-K8MyQheOpUlTMhpk/Rxz4Rtn4VxtjdRLpEhsT/cdBJZeu9Q+2PxLoSpvgvkSwrR2"
623
+ crossorigin="anonymous"
624
+ />
505
625
 
506
- @layer page {
507
- .hero {
508
- display: flex;
509
- flex-direction: column;
510
- gap: 16px;
511
- padding: 48px 16px;
512
- }
513
-
514
- @media (min-width: 768px) {
515
- .hero {
516
- flex-direction: row;
517
- }
518
- }
626
+ <!-- Tailwind — dựng nhanh: Browser CDN ghim version + integrity.
627
+ Production: thay script + style dưới bằng <link> tới CSS build bằng Tailwind CLI. -->
628
+ <script
629
+ src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4.3.4/dist/index.global.js"
630
+ integrity="sha384-LhJn7QKq7hHz9EqN//RkaYS9p1ZU3MqAxjeV0JI95iQ5Gol1uz/cQQ+pesz0xum7"
631
+ crossorigin="anonymous"
632
+ ></script>
633
+ <style type="text/tailwindcss">
634
+ /* Màu và cỡ chữ chỉ lấy từ Leaf — tắt palette và thang font-size của Tailwind */
635
+ @theme {
636
+ --color-*: initial;
637
+ --text-*: initial;
519
638
  }
639
+ @custom-variant light (&:where([data-theme="light"], [data-theme="light"] *));
520
640
  </style>
521
641
 
522
- <section class="hero">
523
- <h1 class="display-3 text-primary">Finhay</h1>
524
- <button class="leaf-button" data-size="md">Mở tài khoản</button>
525
- </section>
642
+ <body class="bg-primary text-primary font-(family-name:--font-sans)">
643
+ <section class="flex flex-col gap-4 px-4 py-12 md:flex-row md:items-center">
644
+ <h1 class="display-3 text-primary">Finhay</h1>
645
+ <button class="leaf-button" data-size="md">Mở tài khoản</button>
646
+ </section>
647
+ </body>
526
648
  ```
527
649
 
528
- | File | Nội dung |
529
- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
530
- | `leaf-<version>.min.css` | `styles.css` đã minify: token + typography + color + CSS của mọi component. |
650
+ Production — build sẵn CSS của Tailwind bằng CLI rồi `<link>` sau link Leaf:
651
+
652
+ ```bash
653
+ npm i -D tailwindcss @tailwindcss/cli
654
+ npx @tailwindcss/cli -i ./src/tailwind.css -o ./assets/tailwind.css --minify # --watch khi dev
655
+ ```
656
+
657
+ ```css
658
+ /* src/tailwind.css */
659
+ @layer theme, base, components, utilities;
660
+ @import "tailwindcss";
661
+ @source "../**/*.html";
662
+
663
+ @theme {
664
+ --color-*: initial;
665
+ --text-*: initial;
666
+ }
667
+ @custom-variant light (&:where([data-theme="light"], [data-theme="light"] *));
668
+ ```
669
+
670
+ | File | Nội dung |
671
+ | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
672
+ | `leaf-<version>.min.css` | `styles.css` đã minify: token + typography + color + CSS của mọi component. |
531
673
  | `leaf-<version>.min.js` | Hành vi Button loading · Tabs · Toggle · Dialog · Slider · Tooltip · InputOtp · InputStepper · Toast · Dropdown · Carousel · QrCode · Upload · Calendar · InputDate · MultiSelect · Form → `window.Leaf`. Trang CSS-only có thể bỏ. |
532
674
 
533
675
  Bản CDN nằm trong package npm (`dist/cdn/`), nên jsDelivr phục vụ trực tiếp theo version:
@@ -633,7 +775,7 @@ Có `input[type=hidden]` trong markup thì leaf.js ghi mã vào đó.
633
775
 
634
776
  ### Toast
635
777
 
636
- `Leaf.toast.success | error | warning(title, { description, duration, id })` (hoặc
778
+ `Leaf.toast.info | success | error | warning(title, { description, duration, id, action })` (hoặc
637
779
  `Leaf.toast.show({ status, title, … })`) trả id; `Leaf.toast.dismiss(id?)` đóng (không truyền → đóng
638
780
  hết); `Leaf.toast.configure({ position, closeLabel, label, theme })`. Vùng chứa
639
781
  `.leaf-toaster[data-leaf-toaster]` có sẵn trong trang thì dùng, không thì leaf.js tự tạo. Toast viết
@@ -680,20 +822,27 @@ overlay = `.leaf-spinner-overlay` (app tự `hidden`/mount).
680
822
 
681
823
  ### Cần biết
682
824
 
825
+ - **CSP tối thiểu.** Component không cần `'unsafe-eval'` và không dùng HTML string nên hợp với
826
+ `require-trusted-types-for 'script'`. Cần thêm tuỳ tính năng dùng:
827
+ `style-src 'unsafe-inline'` (style động, runtime leaf.js) · File Viewer: `frame-src blob:`,
828
+ `img-src blob:`, `media-src blob:`, `connect-src <origin file>` · `<Empty image="">`,
829
+ `LanguageDropdown`: `img-src https://cdn1.finhay.com.vn`.
683
830
  - **Link gắn theo version.** Mỗi bản phát hành là một link mới; trang cũ giữ link cũ nên không tự
684
831
  vỡ. Muốn lên bản mới thì đổi cả link CSS lẫn JS cùng một version, đọc [Changelog](#changelog)
685
832
  trước.
686
- - **Không kèm font và CSS reset.** Tự load Inter (Google Fonts hoặc self-host) và set
687
- `body { font-family: var(--font-sans) }`.
688
- - **CSS của trang phải nằm trong `@layer` nếu đụng vào element của component.** Style component
689
- nằm trong `@layer components`, mà CSS không layer luôn thắng CSS có layer bất kể specificity —
690
- reset kiểu `* { padding: 0 }` hay `button { background: none }` đặt trần sẽ xoá padding / nền
691
- của `.leaf-button`. Bọc reset trong `@layer base { … }`, layout của page trong một layer riêng
692
- (vd. `@layer page`, khai báo sau `utilities` nếu muốn đè cả class màu).
693
- - **Leaf không có class layout / spacing** (`flex`, `gap-*`, `p-*`… đã bỏ từ 0.1.8). Markup component
694
- chỉ cần class `leaf-*` (+ typography / màu); markup cũ còn class layout vẫn hiển thị y hệt — các
695
- class đó giờ không có tác dụng.
696
- - **Trình duyệt tối thiểu** (CSS dùng `@layer`): Chrome / Edge 99+, Safari 15.4+, Firefox 97+.
833
+ - **Không kèm font.** Tự load Inter (Google Fonts hoặc self-host) và set font cho body
834
+ (`font-(family-name:--font-sans)`). CSS reset là preflight của Tailwind (`@layer base`).
835
+ - **Layout dùng Tailwind** (`flex`, `gap-4`, `p-6`, `md:`…) — Leaf không có class layout / spacing
836
+ (`flex`, `gap-*`, `p-*` của Leaf đã bỏ từ 0.1.8). Không gắn utility lên phần tử con của component
837
+ (`.leaf-button__label`…); bọc component trong `div` để xếp layout.
838
+ - **Tailwind Browser CDN chỉ để dựng nhanh** — Tailwind không khuyến nghị cho production. Nếu dùng,
839
+ ghim version kèm `integrity` (không dùng link trôi `@tailwindcss/browser@4`); landing thật build
840
+ CSS bằng Tailwind CLI.
841
+ - **CSS tự viết của trang phải nằm trong `@layer`** (keyframes, background phức tạp…): CSS không
842
+ layer luôn thắng CSS có layer bất kể specificity — `* { padding: 0 }` hay
843
+ `button { background: none }` đặt trần sẽ xoá padding / nền của `.leaf-button`.
844
+ - **Trình duyệt tối thiểu**: Leaf (CSS dùng `@layer`) Chrome / Edge 99+, Safari 15.4+, Firefox 97+;
845
+ Tailwind v4 cần Chrome 111+, Safari 16.4+, Firefox 128+.
697
846
  - Dark là mặc định; `data-theme="light"` trên `<html>` để chuyển light.
698
847
  - z-index của lớp phủ đọc `--leaf-z-dropdown` (30) / `--leaf-z-dialog` (50) /
699
848
  `--leaf-z-spinner-overlay` (100) / `--leaf-z-tooltip` (110) / `--leaf-z-toast` (120) — override trên `:root` để chèn lớp của trang vào giữa.
@@ -711,6 +860,141 @@ overlay = `.leaf-spinner-overlay` (app tự `hidden`/mount).
711
860
 
712
861
  ## Changelog
713
862
 
863
+ ### 0.2.4
864
+
865
+ - **Hook / utils / server:** 3 entry mới `/hooks`, `/utils`, `/server` (xem "Hooks, utils & server"),
866
+ thay `@tanstack/react-pacer`, hook / helper tự viết; `window.Leaf.utils` cho bản CDN. Không có
867
+ hàm kiểu lodash (dùng JS native).
868
+
869
+ > ⚠️ **Breaking** — gỡ engine sinh utility layout của 0.2.3, quay lại **Leaf + Tailwind CSS v4**
870
+ > như 0.2.2. Component, token, class typography / màu không đổi. Xem **Nâng cấp từ 0.2.3** bên dưới.
871
+
872
+ **Gỡ engine CSS (`@finhay/leaf-css`)**
873
+
874
+ - Bỏ export `./css`, `./vite`, `./postcss`, bin `leaf-css` và `dist/engine`. Trả lại các file CSS
875
+ như 0.2.2: `styles.css` (token + mọi class), `tokens.css`, `classes.css`, `typography.css`,
876
+ `color.css`, CSS lẻ từng component (`button.css`, `table.css`…).
877
+ - Layout, spacing, sizing, responsive, state (`hover:`, `md:`…) dùng lại Tailwind CSS v4 với thang và
878
+ breakpoint mặc định của Tailwind. Leaf không còn tự thêm CSS reset — dùng preflight của Tailwind.
879
+ - `leaf-<ver>.min.js` chỉ còn hành vi component (`window.Leaf`), không sinh utility từ class trên
880
+ DOM. HTML tĩnh cũng dùng Tailwind cho layout: Tailwind CLI (production) hoặc Tailwind Browser
881
+ CDN ghim version + SRI (dựng nhanh) — xem mục **HTML tĩnh (CDN)**.
882
+
883
+ **Nâng cấp từ 0.2.3**
884
+
885
+ | 0.2.3 | Bản này |
886
+ | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
887
+ | `@import "@finhay-pro/leaf-design-system/css";` + plugin Vite / PostCSS | `@import "@finhay-pro/leaf-design-system/styles.css";` + `@import "tailwindcss";` + `@tailwindcss/vite` / `postcss` |
888
+ | `leaf()` trong `vite.config`, CLI `leaf-css` | `tailwindcss()` từ `@tailwindcss/vite`, CLI `@tailwindcss/cli` |
889
+ | `p-[16px]`, `gap-[24px]`, `w-[160px]`, `max-w-[448px]` | Giữ nguyên được (Tailwind nhận giá trị tuỳ ý) hoặc đổi sang thang: `p-4`, `gap-6`, `w-40`, `max-w-md` |
890
+ | `sm:` 768 · `md:` 1024 · `lg:` 1280 · `xl:` 1600 · `xs:` ≤ 767 | `md:` 768 · `lg:` 1024 · `xl:` 1280 · `2xl:` 1536 · `max-md:` ≤ 767 (đổi điểm gãy khi migrate) |
891
+ | `hover:bg-tertiary`, `bg-primary/50`, `md:heading-1` | `hover:bg-(--base-tertiary)`, `bg-(--base-primary)/50`; class typo Leaf không nhận variant |
892
+ | Token trong `@layer theme`, reset trong `@layer base` | Token như 0.2.2; reset = preflight Tailwind |
893
+
894
+ **Bảo mật — có thay đổi hành vi**
895
+
896
+ - `csvBlob` / `downloadCsv` với mảng dòng: mặc định thêm `'` trước chuỗi có thể chạy như công thức
897
+ khi mở bằng Excel / Sheets (`=`, `+`, `-`, `@`, tab, CR). Số và chuỗi dạng số giữ nguyên; tắt bằng
898
+ `formulaGuard: false`. `content` dạng text giữ nguyên, app tự chịu trách nhiệm.
899
+ - `readFileSource` / `FileViewer`: chỉ tải `http(s)`, `blob`, `data`. URL khác origin trang không nhận
900
+ `headers` / `credentials` của `fetchInit`, trừ khi origin nằm trong `allowedOrigins` (leaf.js:
901
+ `data-allowed-origins`). Có `allowedOrigins` thì URL và redirect ra ngoài danh sách bị từ chối.
902
+ **App gọi API khác origin kèm token phải khai báo `allowedOrigins`.**
903
+ - `maxSize` có hiệu lực cả khi server không gửi `Content-Length` (đọc theo stream, vượt là dừng).
904
+ - Thông báo lỗi tải file không còn chứa query string, hash, thông tin đăng nhập trong URL.
905
+ - Cột `__proto__` trong CSV / XLSX là dữ liệu thường, không đổi prototype của record.
906
+ - XML trong XLSX / DOCX có `DOCTYPE` bị từ chối (`corrupt`).
907
+ - leaf.js: `data-tooltip` chỉ nhận `<template>`, clone DOM thay vì `innerHTML`; phần tử khác bị bỏ qua.
908
+ - Snippet CDN trong docs và skill có `integrity` (SRI) + `crossorigin`.
909
+ - Thư viện không còn dùng `innerHTML` / `insertAdjacentHTML`, tương thích
910
+ `require-trusted-types-for 'script'`. Thêm mục CSP tối thiểu ở phần "Cần biết".
911
+ - `accept="image/*"` của Upload không còn nhận SVG; cần SVG thì khai báo rõ `.svg` hoặc
912
+ `image/svg+xml`. Backend vẫn phải tự kiểm tra file.
913
+ - `Input type="password"` tắt spellcheck, autocorrect, autocapitalize (kể cả khi đang hiện mật khẩu).
914
+ - `InputOtp` có `mask` (PIN) dùng `autocomplete="off"` thay vì `one-time-code`; leaf.js cũng đặt
915
+ `autocomplete` cho từng ô như React.
916
+
917
+ ### 0.2.3
918
+
919
+ > ⚠️ **Breaking** — Leaf tự sinh utility layout, không còn dùng Tailwind. Xem **Nâng cấp từ 0.2.2**
920
+ > bên dưới trước khi nâng.
921
+
922
+ **Engine CSS của Leaf thay Tailwind (không third party)**
923
+
924
+ - Một dòng `@import "@finhay-pro/leaf-design-system/css";` + plugin `@finhay-pro/leaf-design-system/vite`
925
+ hoặc `/postcss`; HTML tĩnh có build dùng CLI `npx --no-install leaf-css -i input.css -o leaf.css [--watch]
926
+ [--minify]`. Engine bundle trong `dist/engine`, chỉ import `node:*`; package không có
927
+ `dependencies`.
928
+ - Thứ tự output: token (`@layer theme`) + reset (`@layer base`) → **CSS của component đang dùng**
929
+ (nhận qua named import, kể cả phụ thuộc bắc cầu, hoặc class `leaf-*` trong markup) → class typo /
930
+ màu Leaf → **utility có trong source** (tree-shaking, quét gốc project theo `.gitignore`).
931
+ - Utility cú pháp kiểu Tailwind v4: layout, flex / grid, spacing, sizing, background (trừ màu),
932
+ border (trừ màu), effect, filter, transform, transition, interactivity…; variant state,
933
+ `group-*` / `peer-*` / `has-*` / `not-*`, `aria-*` / `data-*`, arbitrary `[&>svg]:`, `!`, container
934
+ query. Class màu / typo Leaf nhận variant và opacity (`md:heading-1`, `hover:bg-tertiary`,
935
+ `bg-primary/50`).
936
+ - Luật Leaf: chỉ px (từ chối `rem` / `em`); spacing / size / inset không có thang số
937
+ (`p-[16px]`, không `p-4`); không font / cỡ chữ / `leading-*` / palette / màu tuỳ ý / `dark:`;
938
+ không cấu hình (`@theme`, `@utility`, `@apply`, `@source`, `@import "tailwindcss"`… → lỗi
939
+ build). Class bị từ chối có cảnh báo kèm gợi ý.
940
+ - Breakpoint mới: `xs` ≤ 767 · `sm` ≥ 768 · `md` ≥ 1024 · `lg` ≥ 1280 · `xl` ≥ 1600 · `2xl` ≥ 1920;
941
+ thêm `max-*`, `min-[..]`, `max-[..]`.
942
+ - CDN: `leaf-<ver>.min.js` kèm runtime sinh utility từ class trên DOM (thay `@tailwindcss/browser`);
943
+ `leaf-<ver>.min.css` minify bằng minifier của engine.
944
+ - Hiệu năng (docs, 276 file): build lần đầu ~37ms, HMR ~2ms, runtime CDN ~0,6ms / 500 class.
945
+
946
+ **Table — bảng dữ liệu (React + leaf.js)**
947
+
948
+ - `Table` + `Leaf.table.create(root, options)` (data mode) và `data-leaf-table` (static mode: sort +
949
+ resize trên markup render sẵn) — cùng markup, logic dùng chung `core/table/`.
950
+ - Header luôn sticky, group header nhiều tầng (`children`); pin cột (`stickyColumns`,
951
+ `pin: "left" | "right"`), mép vùng pin có đường kẻ; nền theo cột `background` (`LeafBgColor`).
952
+ - Sort 3 trạng thái (none → asc → desc), `sortDescFirst`, `sortFn`, `manualSort`; width / `minWidth`
953
+ / `maxWidth` / `grow`, resize bằng kéo (Pointer Events), phím ← → (Shift ×5), double-click về mặc
954
+ định; text không bao giờ bị cắt.
955
+ - Rowspan / colspan (`span`, `mergeRows`), virtual theo hàng (`rowHeight`, `overscan`), realtime
956
+ `column.flash` (một timer cho cả bảng, dòng memo), `bordered`, `striped`, `size`, loading, rỗng,
957
+ `onRowClick`; ref `TableHandle` (`scrollToRow`, `scrollToTop`).
958
+ - Bảng quản trị: lọc (`filters`, `filterFn`, `manualFilter`), sort nhiều cột (`multiSort`,
959
+ Shift + click), phân trang (`pageSize` / `page`, `manualPagination` + `totalRows`, ghép
960
+ `<Pagination>`), chọn dòng (`selectable`, cột checkbox ghim trái), kéo đổi vị trí cột
961
+ (`reorderable`, Pointer + Alt ← →), `headerExtra` (nút lọc / menu trong header).
962
+ - Virtual / load thêm: `scrollSource` (`self` · `window` · `parent`), `onEndReached`,
963
+ `loadingMore` — thuật toán JS thuần trong `core/virtual.ts`.
964
+ - leaf.js: `setOptions`, `setRows`, `update({ [rowId]: patch })` (gộp theo frame), `getSort` /
965
+ `setSort`, `getSortList` / `setSortList`, `getFilters` / `setFilters`, `getPage` / `setPage`,
966
+ `getSelectedRowIds` / `setSelectedRowIds`, `getColumnOrder` / `setColumnOrder`,
967
+ `getColumnWidths` / `setColumnWidths`, `scrollToRow`, `destroy`; event
968
+ `leaf:table-sort-change`, `leaf:table-resize`, `leaf:table-selection-change`,
969
+ `leaf:table-column-order-change`, `leaf:table-end-reached`.
970
+ - Icon mới `arrow-up-line` / `arrow-down-line`; `bgColorToken` trong `utils/colorClass.ts`.
971
+
972
+ **Bảo mật**
973
+
974
+ - leaf.js MultiSelect: chip dựng bằng DOM API (`createElement` / `textContent`), `leading` dùng
975
+ `cloneNode` — label chứa HTML (kể cả đã escape từ server) không còn thành thẻ thật. DOM output
976
+ không đổi.
977
+ - Ghi rõ `data-tooltip` (Tooltip) và mẫu `renderTabs` chỉ nhận markup tin cậy.
978
+ - Dev / CI (không vào bản publish): vitest 5.0.5 (vá `@vitest/mocker`), override `undici` ^8.12.2,
979
+ GitHub Actions chạy Node 24, CI chạy `format:check`; site docs thêm header bảo mật nginx.
980
+
981
+ **Nâng cấp từ 0.2.2**
982
+
983
+ | 0.2.2 | 0.2.3 |
984
+ | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
985
+ | `@import ".../styles.css"` / `tokens.css` / `typography.css` / `color.css` / `classes.css` | `@import "@finhay-pro/leaf-design-system/css";` + plugin Vite / PostCSS |
986
+ | CSS lẻ từng component (`button.css`, `tabs.css`, `logo-assets.css`…) | Đã xoá — engine tự lấy CSS của component đang dùng |
987
+ | `tailwindcss`, `@tailwindcss/vite` / `postcss` / `browser` | `leaf()` / plugin PostCSS / CLI `leaf-css` / JS CDN — gỡ Tailwind khỏi app |
988
+ | `p-4`, `gap-6`, `w-40`, `max-w-md` | `p-[16px]`, `gap-[24px]`, `w-[160px]`, `max-w-[448px]` |
989
+ | `sm:` 640 · `md:` 768 · `lg:` 1024 · `xl:` 1280 | `sm:` 768 · `md:` 1024 · `lg:` 1280 · `xl:` 1600 (`xs:` ≤ 767) |
990
+ | `bg-(--base-tertiary)`, `text-(color:--x)` | `bg-tertiary`, `text-*` (có variant: `hover:bg-tertiary`) |
991
+ | `font-*`, `text-[24px]`, `leading-*`, `rem` / `em` | class typo Leaf (`md:heading-1`), px |
992
+ | Token không layer | Token trong `@layer theme` — CSS không layer của app luôn đè được |
993
+
994
+ `exports` chỉ còn `.`, `./css`, `./vite`, `./postcss`; thêm bin `leaf-css`. Giữ nguyên điểm gãy
995
+ cũ khi migrate: `md:` → `sm:`, `lg:` → `md:`, `sm:` → `min-[640px]:`. API React / `window.Leaf`
996
+ của component có sẵn không đổi.
997
+
714
998
  ### 0.2.2
715
999
 
716
1000
  **Đọc file — không thư viện ngoài**
@@ -904,7 +1188,7 @@ formats, dropLabel, onReject }`.
904
1188
 
905
1189
  **Mới**
906
1190
 
907
- - `Toaster` / `toast` / `ToastContent` — toast success · error · warning (port từ vnsc). Màu từ
1191
+ - `Toaster` / `toast` / `ToastContent` — toast info · success · error · warning + nút hành động (port từ vnsc). Màu từ
908
1192
  token có sẵn: nền `--system-green|red|yellow-secondary`, viền / icon / progress
909
1193
  `--text-highlight` · `--system-red` · `--system-yellow`. Toast gắn `data-theme="dark"` mặc định
910
1194
  (nền thang 800 ở cả hai theme). Tự đóng sau `duration` (mặc định 4000ms, `-1` không tự đóng), dừng