@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.
- package/README.md +372 -88
- package/dist/accordion.css +142 -0
- package/dist/avatar.css +168 -0
- package/dist/badge.css +193 -0
- package/dist/breadcrumb.css +105 -0
- package/dist/calendar.css +150 -0
- package/dist/carousel.css +17 -2
- package/dist/cdn/leaf-0.2.4.min.css +2 -0
- package/dist/cdn/leaf-0.2.4.min.js +177 -0
- package/dist/checkbox.css +8 -0
- package/dist/classes.css +5322 -2429
- package/dist/components/Accordion/Accordion.d.ts +43 -0
- package/dist/components/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion/Accordion.js +37 -0
- package/dist/components/Accordion/Accordion.js.map +1 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Accordion/index.d.ts.map +1 -0
- package/dist/components/Accordion/index.js +2 -0
- package/dist/components/Accordion/index.js.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts +32 -0
- package/dist/components/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.js +20 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Avatar/index.d.ts.map +1 -0
- package/dist/components/Avatar/index.js +2 -0
- package/dist/components/Avatar/index.js.map +1 -0
- package/dist/components/Badge/Badge.d.ts +44 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/Badge.js +21 -0
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Badge/index.js +2 -0
- package/dist/components/Badge/index.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +33 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +60 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Breadcrumb/index.d.ts +2 -0
- package/dist/components/Breadcrumb/index.d.ts.map +1 -0
- package/dist/components/Breadcrumb/index.js +2 -0
- package/dist/components/Breadcrumb/index.js.map +1 -0
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Calendar/Calendar.js +1 -1
- package/dist/components/CalendarRange/CalendarRange.d.ts +41 -0
- package/dist/components/CalendarRange/CalendarRange.d.ts.map +1 -0
- package/dist/components/CalendarRange/CalendarRange.js +74 -0
- package/dist/components/CalendarRange/CalendarRange.js.map +1 -0
- package/dist/components/CalendarRange/index.d.ts +2 -0
- package/dist/components/CalendarRange/index.d.ts.map +1 -0
- package/dist/components/CalendarRange/index.js +2 -0
- package/dist/components/CalendarRange/index.js.map +1 -0
- package/dist/components/Carousel/Carousel.d.ts +23 -3
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.js +33 -9
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Date/Date.d.ts +1 -1
- package/dist/components/Date/Date.d.ts.map +1 -1
- package/dist/components/Date/Date.js +2 -2
- package/dist/components/Date/Date.js.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +29 -3
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +40 -7
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dialog/Drawer.d.ts +18 -0
- package/dist/components/Dialog/Drawer.d.ts.map +1 -0
- package/dist/components/Dialog/Drawer.js +12 -0
- package/dist/components/Dialog/Drawer.js.map +1 -0
- package/dist/components/Dialog/index.d.ts +2 -1
- package/dist/components/Dialog/index.d.ts.map +1 -1
- package/dist/components/Dialog/index.js +2 -1
- package/dist/components/Dialog/index.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +15 -1
- package/dist/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.js +106 -20
- package/dist/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/Empty/Empty.d.ts.map +1 -1
- package/dist/components/Empty/Empty.js.map +1 -1
- package/dist/components/FileViewer/FileViewer.d.ts +3 -1
- package/dist/components/FileViewer/FileViewer.d.ts.map +1 -1
- package/dist/components/FileViewer/FileViewer.js +2 -1
- package/dist/components/FileViewer/FileViewer.js.map +1 -1
- package/dist/components/Form/DynamicForm.js +1 -1
- package/dist/components/Form/Form.js +1 -1
- package/dist/components/Form/adapters.d.ts.map +1 -1
- package/dist/components/Form/adapters.js +1 -1
- package/dist/components/Form/adapters.js.map +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +3 -1
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/InputDate.d.ts +6 -1
- package/dist/components/Input/InputDate.d.ts.map +1 -1
- package/dist/components/Input/InputDate.js +36 -11
- package/dist/components/Input/InputDate.js.map +1 -1
- package/dist/components/Input/InputDateRange.d.ts +43 -0
- package/dist/components/Input/InputDateRange.d.ts.map +1 -0
- package/dist/components/Input/InputDateRange.js +86 -0
- package/dist/components/Input/InputDateRange.js.map +1 -0
- package/dist/components/Input/InputNumber.d.ts +28 -0
- package/dist/components/Input/InputNumber.d.ts.map +1 -0
- package/dist/components/Input/InputNumber.js +58 -0
- package/dist/components/Input/InputNumber.js.map +1 -0
- package/dist/components/Input/InputOtp.d.ts.map +1 -1
- package/dist/components/Input/InputOtp.js +2 -2
- package/dist/components/Input/InputOtp.js.map +1 -1
- package/dist/components/Input/InputStepper.d.ts +3 -1
- package/dist/components/Input/InputStepper.d.ts.map +1 -1
- package/dist/components/Input/InputStepper.js +32 -5
- package/dist/components/Input/InputStepper.js.map +1 -1
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +2 -0
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Menu/Menu.d.ts +69 -0
- package/dist/components/Menu/Menu.d.ts.map +1 -0
- package/dist/components/Menu/Menu.js +140 -0
- package/dist/components/Menu/Menu.js.map +1 -0
- package/dist/components/Menu/index.d.ts +2 -0
- package/dist/components/Menu/index.d.ts.map +1 -0
- package/dist/components/Menu/index.js +2 -0
- package/dist/components/Menu/index.js.map +1 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +6 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +42 -23
- package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/components/Number/Number.d.ts +4 -2
- package/dist/components/Number/Number.d.ts.map +1 -1
- package/dist/components/Number/Number.js +3 -1
- package/dist/components/Number/Number.js.map +1 -1
- package/dist/components/Pagination/Pagination.d.ts +35 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.js +40 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Pagination/index.d.ts.map +1 -0
- package/dist/components/Pagination/index.js +2 -0
- package/dist/components/Pagination/index.js.map +1 -0
- package/dist/components/Popover/Popover.d.ts +51 -0
- package/dist/components/Popover/Popover.d.ts.map +1 -0
- package/dist/components/Popover/Popover.js +83 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Popover/index.d.ts.map +1 -0
- package/dist/components/Popover/index.js +2 -0
- package/dist/components/Popover/index.js.map +1 -0
- package/dist/components/Progress/Progress.d.ts +30 -0
- package/dist/components/Progress/Progress.d.ts.map +1 -0
- package/dist/components/Progress/Progress.js +17 -0
- package/dist/components/Progress/Progress.js.map +1 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/index.d.ts.map +1 -0
- package/dist/components/Progress/index.js +2 -0
- package/dist/components/Progress/index.js.map +1 -0
- package/dist/components/QrCode/QrCode.d.ts.map +1 -1
- package/dist/components/QrCode/QrCode.js.map +1 -1
- package/dist/components/SafeHtml/SafeHtml.d.ts +326 -0
- package/dist/components/SafeHtml/SafeHtml.d.ts.map +1 -0
- package/dist/components/SafeHtml/SafeHtml.js +44 -0
- package/dist/components/SafeHtml/SafeHtml.js.map +1 -0
- package/dist/components/SafeHtml/index.d.ts +2 -0
- package/dist/components/SafeHtml/index.d.ts.map +1 -0
- package/dist/components/SafeHtml/index.js +2 -0
- package/dist/components/SafeHtml/index.js.map +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +50 -0
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar/Sidebar.js +71 -0
- package/dist/components/Sidebar/Sidebar.js.map +1 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Sidebar/index.d.ts.map +1 -0
- package/dist/components/Sidebar/index.js +2 -0
- package/dist/components/Sidebar/index.js.map +1 -0
- package/dist/components/Slider/Slider.js +1 -4
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Steps/Steps.d.ts +30 -0
- package/dist/components/Steps/Steps.d.ts.map +1 -0
- package/dist/components/Steps/Steps.js +26 -0
- package/dist/components/Steps/Steps.js.map +1 -0
- package/dist/components/Steps/index.d.ts +2 -0
- package/dist/components/Steps/index.d.ts.map +1 -0
- package/dist/components/Steps/index.js +2 -0
- package/dist/components/Steps/index.js.map +1 -0
- package/dist/components/Table/Table.d.ts +117 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/Table.js +417 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Table/TableHeader.d.ts +24 -0
- package/dist/components/Table/TableHeader.d.ts.map +1 -0
- package/dist/components/Table/TableHeader.js +18 -0
- package/dist/components/Table/TableHeader.js.map +1 -0
- package/dist/components/Table/TableRow.d.ts +31 -0
- package/dist/components/Table/TableRow.d.ts.map +1 -0
- package/dist/components/Table/TableRow.js +30 -0
- package/dist/components/Table/TableRow.js.map +1 -0
- package/dist/components/Table/dom.d.ts +9 -0
- package/dist/components/Table/dom.d.ts.map +1 -0
- package/dist/components/Table/dom.js +17 -0
- package/dist/components/Table/dom.js.map +1 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/Table/index.js +2 -0
- package/dist/components/Table/index.js.map +1 -0
- package/dist/components/Toast/Toast.d.ts +8 -4
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +15 -4
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +5 -2
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/VirtualList/VirtualList.d.ts +39 -0
- package/dist/components/VirtualList/VirtualList.d.ts.map +1 -0
- package/dist/components/VirtualList/VirtualList.js +113 -0
- package/dist/components/VirtualList/VirtualList.js.map +1 -0
- package/dist/components/VirtualList/index.d.ts +2 -0
- package/dist/components/VirtualList/index.d.ts.map +1 -0
- package/dist/components/VirtualList/index.js +2 -0
- package/dist/components/VirtualList/index.js.map +1 -0
- package/dist/core/accordion.d.ts +15 -0
- package/dist/core/accordion.d.ts.map +1 -0
- package/dist/core/accordion.js +37 -0
- package/dist/core/accordion.js.map +1 -0
- package/dist/core/avatar.d.ts +4 -0
- package/dist/core/avatar.d.ts.map +1 -0
- package/dist/core/avatar.js +12 -0
- package/dist/core/avatar.js.map +1 -0
- package/dist/core/calendar.d.ts +1 -2
- package/dist/core/calendar.d.ts.map +1 -1
- package/dist/core/calendar.js +2 -10
- package/dist/core/calendar.js.map +1 -1
- package/dist/core/carousel.d.ts +8 -0
- package/dist/core/carousel.d.ts.map +1 -1
- package/dist/core/carousel.js +31 -3
- package/dist/core/carousel.js.map +1 -1
- package/dist/core/date-math.d.ts +39 -0
- package/dist/core/date-math.d.ts.map +1 -0
- package/dist/core/date-math.js +82 -0
- package/dist/core/date-math.js.map +1 -0
- package/dist/core/date-range.d.ts +44 -0
- package/dist/core/date-range.d.ts.map +1 -0
- package/dist/core/date-range.js +88 -0
- package/dist/core/date-range.js.map +1 -0
- package/dist/core/date.d.ts +23 -4
- package/dist/core/date.d.ts.map +1 -1
- package/dist/core/date.js +114 -4
- package/dist/core/date.js.map +1 -1
- package/dist/core/dialog.d.ts +43 -5
- package/dist/core/dialog.d.ts.map +1 -1
- package/dist/core/dialog.js +85 -8
- package/dist/core/dialog.js.map +1 -1
- package/dist/core/file/csv.d.ts +10 -0
- package/dist/core/file/csv.d.ts.map +1 -1
- package/dist/core/file/csv.js +26 -3
- package/dist/core/file/csv.js.map +1 -1
- package/dist/core/file/detect.js.map +1 -1
- package/dist/core/file/docx-render.js.map +1 -1
- package/dist/core/file/docx.js.map +1 -1
- package/dist/core/file/dom.d.ts +1 -1
- package/dist/core/file/dom.d.ts.map +1 -1
- package/dist/core/file/dom.js +3 -3
- package/dist/core/file/dom.js.map +1 -1
- package/dist/core/file/download.d.ts +5 -0
- package/dist/core/file/download.d.ts.map +1 -1
- package/dist/core/file/download.js +10 -3
- package/dist/core/file/download.js.map +1 -1
- package/dist/core/file/error.d.ts.map +1 -1
- package/dist/core/file/error.js.map +1 -1
- package/dist/core/file/source.d.ts +15 -1
- package/dist/core/file/source.d.ts.map +1 -1
- package/dist/core/file/source.js +99 -6
- package/dist/core/file/source.js.map +1 -1
- package/dist/core/file/text.js.map +1 -1
- package/dist/core/file/viewer.d.ts +2 -0
- package/dist/core/file/viewer.d.ts.map +1 -1
- package/dist/core/file/viewer.js +3 -2
- package/dist/core/file/viewer.js.map +1 -1
- package/dist/core/file/xlsx-format.js.map +1 -1
- package/dist/core/file/xlsx-write.js.map +1 -1
- package/dist/core/file/xlsx.d.ts.map +1 -1
- package/dist/core/file/xlsx.js +4 -3
- package/dist/core/file/xlsx.js.map +1 -1
- package/dist/core/file/xml.d.ts.map +1 -1
- package/dist/core/file/xml.js +5 -0
- package/dist/core/file/xml.js.map +1 -1
- package/dist/core/file/zip-write.js.map +1 -1
- package/dist/core/file/zip.js.map +1 -1
- package/dist/core/floating.d.ts +69 -0
- package/dist/core/floating.d.ts.map +1 -0
- package/dist/core/floating.js +185 -0
- package/dist/core/floating.js.map +1 -0
- package/dist/core/html/css.d.ts +32 -0
- package/dist/core/html/css.d.ts.map +1 -0
- package/dist/core/html/css.js +222 -0
- package/dist/core/html/css.js.map +1 -0
- package/dist/core/html/entities.d.ts +19 -0
- package/dist/core/html/entities.d.ts.map +1 -0
- package/dist/core/html/entities.js +167 -0
- package/dist/core/html/entities.js.map +1 -0
- package/dist/core/html/entity-data.d.ts +14 -0
- package/dist/core/html/entity-data.d.ts.map +1 -0
- package/dist/core/html/entity-data.js +14 -0
- package/dist/core/html/entity-data.js.map +1 -0
- package/dist/core/html/props.d.ts +9 -0
- package/dist/core/html/props.d.ts.map +1 -0
- package/dist/core/html/props.js +98 -0
- package/dist/core/html/props.js.map +1 -0
- package/dist/core/html/sanitize.d.ts +150 -0
- package/dist/core/html/sanitize.d.ts.map +1 -0
- package/dist/core/html/sanitize.js +800 -0
- package/dist/core/html/sanitize.js.map +1 -0
- package/dist/core/html/tokenizer.d.ts +33 -0
- package/dist/core/html/tokenizer.d.ts.map +1 -0
- package/dist/core/html/tokenizer.js +306 -0
- package/dist/core/html/tokenizer.js.map +1 -0
- package/dist/core/html/tree.d.ts +35 -0
- package/dist/core/html/tree.d.ts.map +1 -0
- package/dist/core/html/tree.js +253 -0
- package/dist/core/html/tree.js.map +1 -0
- package/dist/core/icons.d.ts +10 -3
- package/dist/core/icons.d.ts.map +1 -1
- package/dist/core/icons.js +22 -5
- package/dist/core/icons.js.map +1 -1
- package/dist/core/language.d.ts.map +1 -1
- package/dist/core/menu.d.ts +22 -0
- package/dist/core/menu.d.ts.map +1 -0
- package/dist/core/menu.js +69 -0
- package/dist/core/menu.js.map +1 -0
- package/dist/core/motion.d.ts +12 -0
- package/dist/core/motion.d.ts.map +1 -0
- package/dist/core/motion.js +17 -0
- package/dist/core/motion.js.map +1 -0
- package/dist/core/number-input.d.ts +29 -0
- package/dist/core/number-input.d.ts.map +1 -0
- package/dist/core/number-input.js +92 -0
- package/dist/core/number-input.js.map +1 -0
- package/dist/core/number.d.ts +14 -0
- package/dist/core/number.d.ts.map +1 -1
- package/dist/core/number.js +48 -2
- package/dist/core/number.js.map +1 -1
- package/dist/core/otp.d.ts +2 -0
- package/dist/core/otp.d.ts.map +1 -1
- package/dist/core/otp.js +4 -0
- package/dist/core/otp.js.map +1 -1
- package/dist/core/pacer.d.ts +63 -0
- package/dist/core/pacer.d.ts.map +1 -0
- package/dist/core/pacer.js +129 -0
- package/dist/core/pacer.js.map +1 -0
- package/dist/core/pagination.d.ts +44 -0
- package/dist/core/pagination.d.ts.map +1 -0
- package/dist/core/pagination.js +78 -0
- package/dist/core/pagination.js.map +1 -0
- package/dist/core/popover.d.ts +6 -0
- package/dist/core/popover.d.ts.map +1 -0
- package/dist/core/popover.js +6 -0
- package/dist/core/popover.js.map +1 -0
- package/dist/core/progress.d.ts +3 -0
- package/dist/core/progress.d.ts.map +1 -0
- package/dist/core/progress.js +8 -0
- package/dist/core/progress.js.map +1 -0
- package/dist/core/qr-code.d.ts +7 -0
- package/dist/core/qr-code.d.ts.map +1 -1
- package/dist/core/qr-code.js +15 -9
- package/dist/core/qr-code.js.map +1 -1
- package/dist/core/roving.d.ts +19 -0
- package/dist/core/roving.d.ts.map +1 -0
- package/dist/core/roving.js +54 -0
- package/dist/core/roving.js.map +1 -0
- package/dist/core/safe-url.d.ts +37 -0
- package/dist/core/safe-url.d.ts.map +1 -0
- package/dist/core/safe-url.js +68 -0
- package/dist/core/safe-url.js.map +1 -0
- package/dist/core/sheet.d.ts +19 -0
- package/dist/core/sheet.d.ts.map +1 -0
- package/dist/core/sheet.js +54 -0
- package/dist/core/sheet.js.map +1 -0
- package/dist/core/spinner.d.ts +2 -2
- package/dist/core/spinner.d.ts.map +1 -1
- package/dist/core/spinner.js +22 -4
- package/dist/core/spinner.js.map +1 -1
- package/dist/core/status.d.ts +20 -0
- package/dist/core/status.d.ts.map +1 -0
- package/dist/core/status.js +30 -0
- package/dist/core/status.js.map +1 -0
- package/dist/core/stepper.js.map +1 -1
- package/dist/core/table/attrs.d.ts +71 -0
- package/dist/core/table/attrs.d.ts.map +1 -0
- package/dist/core/table/attrs.js +211 -0
- package/dist/core/table/attrs.js.map +1 -0
- package/dist/core/table/columns.d.ts +168 -0
- package/dist/core/table/columns.d.ts.map +1 -0
- package/dist/core/table/columns.js +147 -0
- package/dist/core/table/columns.js.map +1 -0
- package/dist/core/table/features.d.ts +72 -0
- package/dist/core/table/features.d.ts.map +1 -0
- package/dist/core/table/features.js +198 -0
- package/dist/core/table/features.js.map +1 -0
- package/dist/core/table/flash.d.ts +26 -0
- package/dist/core/table/flash.d.ts.map +1 -0
- package/dist/core/table/flash.js +84 -0
- package/dist/core/table/flash.js.map +1 -0
- package/dist/core/table/index.d.ts +12 -0
- package/dist/core/table/index.d.ts.map +1 -0
- package/dist/core/table/index.js +12 -0
- package/dist/core/table/index.js.map +1 -0
- package/dist/core/table/measure.d.ts +23 -0
- package/dist/core/table/measure.d.ts.map +1 -0
- package/dist/core/table/measure.js +54 -0
- package/dist/core/table/measure.js.map +1 -0
- package/dist/core/table/reorder.d.ts +21 -0
- package/dist/core/table/reorder.d.ts.map +1 -0
- package/dist/core/table/reorder.js +70 -0
- package/dist/core/table/reorder.js.map +1 -0
- package/dist/core/table/resize.d.ts +13 -0
- package/dist/core/table/resize.d.ts.map +1 -0
- package/dist/core/table/resize.js +34 -0
- package/dist/core/table/resize.js.map +1 -0
- package/dist/core/table/sort.d.ts +23 -0
- package/dist/core/table/sort.d.ts.map +1 -0
- package/dist/core/table/sort.js +71 -0
- package/dist/core/table/sort.js.map +1 -0
- package/dist/core/table/span.d.ts +31 -0
- package/dist/core/table/span.d.ts.map +1 -0
- package/dist/core/table/span.js +84 -0
- package/dist/core/table/span.js.map +1 -0
- package/dist/core/table/virtual.d.ts +16 -0
- package/dist/core/table/virtual.d.ts.map +1 -0
- package/dist/core/table/virtual.js +13 -0
- package/dist/core/table/virtual.js.map +1 -0
- package/dist/core/tabs.d.ts.map +1 -1
- package/dist/core/tabs.js +2 -15
- package/dist/core/tabs.js.map +1 -1
- package/dist/core/toast.d.ts +15 -3
- package/dist/core/toast.d.ts.map +1 -1
- package/dist/core/toast.js +9 -6
- package/dist/core/toast.js.map +1 -1
- package/dist/core/tooltip.d.ts +8 -7
- package/dist/core/tooltip.d.ts.map +1 -1
- package/dist/core/tooltip.js +14 -119
- package/dist/core/tooltip.js.map +1 -1
- package/dist/core/upload.d.ts +1 -0
- package/dist/core/upload.d.ts.map +1 -1
- package/dist/core/upload.js +6 -0
- package/dist/core/upload.js.map +1 -1
- package/dist/core/virtual.d.ts +76 -0
- package/dist/core/virtual.d.ts.map +1 -0
- package/dist/core/virtual.js +214 -0
- package/dist/core/virtual.js.map +1 -0
- package/dist/dialog.css +232 -0
- package/dist/dropdown.css +94 -0
- package/dist/empty.css +8 -0
- package/dist/file-viewer.css +17 -0
- package/dist/fn/async.d.ts +39 -0
- package/dist/fn/async.d.ts.map +1 -0
- package/dist/fn/async.js +91 -0
- package/dist/fn/async.js.map +1 -0
- package/dist/fn/clipboard.d.ts +6 -0
- package/dist/fn/clipboard.d.ts.map +1 -0
- package/dist/fn/clipboard.js +35 -0
- package/dist/fn/clipboard.js.map +1 -0
- package/dist/fn/cookie.d.ts +7 -0
- package/dist/fn/cookie.d.ts.map +1 -0
- package/dist/fn/cookie.js +22 -0
- package/dist/fn/cookie.js.map +1 -0
- package/dist/fn/error.d.ts +24 -0
- package/dist/fn/error.d.ts.map +1 -0
- package/dist/fn/error.js +50 -0
- package/dist/fn/error.js.map +1 -0
- package/dist/fn/html.d.ts +34 -0
- package/dist/fn/html.d.ts.map +1 -0
- package/dist/fn/html.js +60 -0
- package/dist/fn/html.js.map +1 -0
- package/dist/fn/index.d.ts +39 -0
- package/dist/fn/index.d.ts.map +1 -0
- package/dist/fn/index.js +40 -0
- package/dist/fn/index.js.map +1 -0
- package/dist/fn/jwt.d.ts +12 -0
- package/dist/fn/jwt.d.ts.map +1 -0
- package/dist/fn/jwt.js +42 -0
- package/dist/fn/jwt.js.map +1 -0
- package/dist/fn/locale.d.ts +20 -0
- package/dist/fn/locale.d.ts.map +1 -0
- package/dist/fn/locale.js +33 -0
- package/dist/fn/locale.js.map +1 -0
- package/dist/fn/query.d.ts +11 -0
- package/dist/fn/query.d.ts.map +1 -0
- package/dist/fn/query.js +41 -0
- package/dist/fn/query.js.map +1 -0
- package/dist/fn/sanitize.d.ts +15 -0
- package/dist/fn/sanitize.d.ts.map +1 -0
- package/dist/fn/sanitize.js +15 -0
- package/dist/fn/sanitize.js.map +1 -0
- package/dist/fn/storage.d.ts +13 -0
- package/dist/fn/storage.d.ts.map +1 -0
- package/dist/fn/storage.js +69 -0
- package/dist/fn/storage.js.map +1 -0
- package/dist/fn/string.d.ts +13 -0
- package/dist/fn/string.d.ts.map +1 -0
- package/dist/fn/string.js +30 -0
- package/dist/fn/string.js.map +1 -0
- package/dist/fn/url.d.ts +27 -0
- package/dist/fn/url.d.ts.map +1 -0
- package/dist/fn/url.js +71 -0
- package/dist/fn/url.js.map +1 -0
- package/dist/fn/version.d.ts +5 -0
- package/dist/fn/version.d.ts.map +1 -0
- package/dist/fn/version.js +23 -0
- package/dist/fn/version.js.map +1 -0
- package/dist/hooks/index.d.ts +43 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +43 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useAsync.d.ts +17 -0
- package/dist/hooks/useAsync.d.ts.map +1 -0
- package/dist/hooks/useAsync.js +38 -0
- package/dist/hooks/useAsync.js.map +1 -0
- package/dist/hooks/useAsyncCallback.d.ts +26 -0
- package/dist/hooks/useAsyncCallback.d.ts.map +1 -0
- package/dist/hooks/useAsyncCallback.js +57 -0
- package/dist/hooks/useAsyncCallback.js.map +1 -0
- package/dist/hooks/useBatcher.d.ts +11 -0
- package/dist/hooks/useBatcher.d.ts.map +1 -0
- package/dist/hooks/useBatcher.js +16 -0
- package/dist/hooks/useBatcher.js.map +1 -0
- package/dist/hooks/useClickOutside.d.ts +12 -0
- package/dist/hooks/useClickOutside.d.ts.map +1 -0
- package/dist/hooks/useClickOutside.js +29 -0
- package/dist/hooks/useClickOutside.js.map +1 -0
- package/dist/hooks/useControllableState.d.ts +2 -0
- package/dist/hooks/useControllableState.d.ts.map +1 -0
- package/dist/hooks/useControllableState.js +3 -0
- package/dist/hooks/useControllableState.js.map +1 -0
- package/dist/hooks/useCopyToClipboard.d.ts +9 -0
- package/dist/hooks/useCopyToClipboard.d.ts.map +1 -0
- package/dist/hooks/useCopyToClipboard.js +23 -0
- package/dist/hooks/useCopyToClipboard.js.map +1 -0
- package/dist/hooks/useCountdown.d.ts +24 -0
- package/dist/hooks/useCountdown.d.ts.map +1 -0
- package/dist/hooks/useCountdown.js +59 -0
- package/dist/hooks/useCountdown.js.map +1 -0
- package/dist/hooks/useDebouncedCallback.d.ts +7 -0
- package/dist/hooks/useDebouncedCallback.d.ts.map +1 -0
- package/dist/hooks/useDebouncedCallback.js +15 -0
- package/dist/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/hooks/useDebouncedValue.d.ts +4 -0
- package/dist/hooks/useDebouncedValue.d.ts.map +1 -0
- package/dist/hooks/useDebouncedValue.js +19 -0
- package/dist/hooks/useDebouncedValue.js.map +1 -0
- package/dist/hooks/useDisclosure.d.ts +21 -0
- package/dist/hooks/useDisclosure.d.ts.map +1 -0
- package/dist/hooks/useDisclosure.js +20 -0
- package/dist/hooks/useDisclosure.js.map +1 -0
- package/dist/hooks/useDocumentTitle.d.ts +8 -0
- package/dist/hooks/useDocumentTitle.d.ts.map +1 -0
- package/dist/hooks/useDocumentTitle.js +18 -0
- package/dist/hooks/useDocumentTitle.js.map +1 -0
- package/dist/hooks/useElementSize.d.ts +13 -0
- package/dist/hooks/useElementSize.d.ts.map +1 -0
- package/dist/hooks/useElementSize.js +28 -0
- package/dist/hooks/useElementSize.js.map +1 -0
- package/dist/hooks/useEventListener.d.ts +10 -0
- package/dist/hooks/useEventListener.d.ts.map +1 -0
- package/dist/hooks/useEventListener.js +30 -0
- package/dist/hooks/useEventListener.js.map +1 -0
- package/dist/hooks/useHotkeys.d.ts +24 -0
- package/dist/hooks/useHotkeys.d.ts.map +1 -0
- package/dist/hooks/useHotkeys.js +69 -0
- package/dist/hooks/useHotkeys.js.map +1 -0
- package/dist/hooks/useIdle.d.ts +16 -0
- package/dist/hooks/useIdle.d.ts.map +1 -0
- package/dist/hooks/useIdle.js +63 -0
- package/dist/hooks/useIdle.js.map +1 -0
- package/dist/hooks/useInView.d.ts +13 -0
- package/dist/hooks/useInView.d.ts.map +1 -0
- package/dist/hooks/useInView.js +32 -0
- package/dist/hooks/useInView.js.map +1 -0
- package/dist/hooks/useInfiniteScroll.d.ts +20 -0
- package/dist/hooks/useInfiniteScroll.d.ts.map +1 -0
- package/dist/hooks/useInfiniteScroll.js +38 -0
- package/dist/hooks/useInfiniteScroll.js.map +1 -0
- package/dist/hooks/useInterval.d.ts +3 -0
- package/dist/hooks/useInterval.d.ts.map +1 -0
- package/dist/hooks/useInterval.js +15 -0
- package/dist/hooks/useInterval.js.map +1 -0
- package/dist/hooks/useIsClient.d.ts +6 -0
- package/dist/hooks/useIsClient.d.ts.map +1 -0
- package/dist/hooks/useIsClient.js +11 -0
- package/dist/hooks/useIsClient.js.map +1 -0
- package/dist/hooks/useLatest.d.ts +7 -0
- package/dist/hooks/useLatest.d.ts.map +1 -0
- package/dist/hooks/useLatest.js +14 -0
- package/dist/hooks/useLatest.js.map +1 -0
- package/dist/hooks/useMediaQuery.d.ts +6 -0
- package/dist/hooks/useMediaQuery.d.ts.map +1 -0
- package/dist/hooks/useMediaQuery.js +20 -0
- package/dist/hooks/useMediaQuery.js.map +1 -0
- package/dist/hooks/useMergedRefs.d.ts +6 -0
- package/dist/hooks/useMergedRefs.d.ts.map +1 -0
- package/dist/hooks/useMergedRefs.js +9 -0
- package/dist/hooks/useMergedRefs.js.map +1 -0
- package/dist/hooks/useObjectUrl.d.ts +7 -0
- package/dist/hooks/useObjectUrl.d.ts.map +1 -0
- package/dist/hooks/useObjectUrl.js +21 -0
- package/dist/hooks/useObjectUrl.js.map +1 -0
- package/dist/hooks/useOnlineStatus.d.ts +3 -0
- package/dist/hooks/useOnlineStatus.d.ts.map +1 -0
- package/dist/hooks/useOnlineStatus.js +15 -0
- package/dist/hooks/useOnlineStatus.js.map +1 -0
- package/dist/hooks/usePageVisibility.d.ts +3 -0
- package/dist/hooks/usePageVisibility.d.ts.map +1 -0
- package/dist/hooks/usePageVisibility.js +11 -0
- package/dist/hooks/usePageVisibility.js.map +1 -0
- package/dist/hooks/usePolling.d.ts +17 -0
- package/dist/hooks/usePolling.d.ts.map +1 -0
- package/dist/hooks/usePolling.js +46 -0
- package/dist/hooks/usePolling.js.map +1 -0
- package/dist/hooks/usePrefersReducedMotion.d.ts +3 -0
- package/dist/hooks/usePrefersReducedMotion.d.ts.map +1 -0
- package/dist/hooks/usePrefersReducedMotion.js +7 -0
- package/dist/hooks/usePrefersReducedMotion.js.map +1 -0
- package/dist/hooks/usePresence.d.ts +2 -0
- package/dist/hooks/usePresence.d.ts.map +1 -0
- package/dist/hooks/usePresence.js +3 -0
- package/dist/hooks/usePresence.js.map +1 -0
- package/dist/hooks/usePrevious.d.ts +3 -0
- package/dist/hooks/usePrevious.d.ts.map +1 -0
- package/dist/hooks/usePrevious.js +15 -0
- package/dist/hooks/usePrevious.js.map +1 -0
- package/dist/hooks/useScroll.d.ts +22 -0
- package/dist/hooks/useScroll.d.ts.map +1 -0
- package/dist/hooks/useScroll.js +73 -0
- package/dist/hooks/useScroll.js.map +1 -0
- package/dist/hooks/useScrollLock.d.ts +6 -0
- package/dist/hooks/useScrollLock.d.ts.map +1 -0
- package/dist/hooks/useScrollLock.js +17 -0
- package/dist/hooks/useScrollLock.js.map +1 -0
- package/dist/hooks/useStorageState.d.ts +14 -0
- package/dist/hooks/useStorageState.d.ts.map +1 -0
- package/dist/hooks/useStorageState.js +62 -0
- package/dist/hooks/useStorageState.js.map +1 -0
- package/dist/hooks/useSyncedState.d.ts +6 -0
- package/dist/hooks/useSyncedState.d.ts.map +1 -0
- package/dist/hooks/useSyncedState.js +16 -0
- package/dist/hooks/useSyncedState.js.map +1 -0
- package/dist/hooks/useThrottledCallback.d.ts +4 -0
- package/dist/hooks/useThrottledCallback.d.ts.map +1 -0
- package/dist/hooks/useThrottledCallback.js +12 -0
- package/dist/hooks/useThrottledCallback.js.map +1 -0
- package/dist/hooks/useThrottledValue.d.ts +4 -0
- package/dist/hooks/useThrottledValue.d.ts.map +1 -0
- package/dist/hooks/useThrottledValue.js +19 -0
- package/dist/hooks/useThrottledValue.js.map +1 -0
- package/dist/hooks/useTimeout.d.ts +9 -0
- package/dist/hooks/useTimeout.d.ts.map +1 -0
- package/dist/hooks/useTimeout.js +23 -0
- package/dist/hooks/useTimeout.js.map +1 -0
- package/dist/hooks/useWindowSize.d.ts +12 -0
- package/dist/hooks/useWindowSize.d.ts.map +1 -0
- package/dist/hooks/useWindowSize.js +38 -0
- package/dist/hooks/useWindowSize.js.map +1 -0
- package/dist/index.d.ts +26 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -5
- package/dist/index.js.map +1 -1
- package/dist/input-date.css +51 -1
- package/dist/input.css +13 -0
- package/dist/logo.css +7 -0
- package/dist/menu.css +198 -0
- package/dist/pagination.css +140 -0
- package/dist/popover.css +106 -0
- package/dist/progress.css +187 -0
- package/dist/qr-code.css +7 -0
- package/dist/server/crypto.d.ts +26 -0
- package/dist/server/crypto.d.ts.map +1 -0
- package/dist/server/crypto.js +50 -0
- package/dist/server/crypto.js.map +1 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +9 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/rate-limit.d.ts +20 -0
- package/dist/server/rate-limit.d.ts.map +1 -0
- package/dist/server/rate-limit.js +42 -0
- package/dist/server/rate-limit.js.map +1 -0
- package/dist/server/request.d.ts +42 -0
- package/dist/server/request.d.ts.map +1 -0
- package/dist/server/request.js +94 -0
- package/dist/server/request.js.map +1 -0
- package/dist/server/response.d.ts +19 -0
- package/dist/server/response.d.ts.map +1 -0
- package/dist/server/response.js +44 -0
- package/dist/server/response.js.map +1 -0
- package/dist/sidebar.css +271 -0
- package/dist/skill/leaf-design-system-0.2.4.zip +0 -0
- package/dist/slider.css +9 -0
- package/dist/spinner.css +7 -0
- package/dist/steps.css +211 -0
- package/dist/styles.css +5322 -2429
- package/dist/table.css +421 -0
- package/dist/toast.css +38 -2
- package/dist/toggle.css +7 -0
- package/dist/tooltip.css +46 -0
- package/dist/upload.css +9 -0
- package/dist/utils/RemixGlyph.d.ts +1 -1
- package/dist/utils/RemixGlyph.d.ts.map +1 -1
- package/dist/utils/RemixGlyph.js +1 -1
- package/dist/utils/RemixGlyph.js.map +1 -1
- package/dist/utils/colorClass.d.ts +2 -0
- package/dist/utils/colorClass.d.ts.map +1 -1
- package/dist/utils/colorClass.js +14 -0
- package/dist/utils/colorClass.js.map +1 -1
- package/dist/utils/useFloating.d.ts +11 -0
- package/dist/utils/useFloating.d.ts.map +1 -0
- package/dist/utils/useFloating.js +34 -0
- package/dist/utils/useFloating.js.map +1 -0
- package/dist/utils/useFloatingLayer.d.ts +40 -0
- package/dist/utils/useFloatingLayer.d.ts.map +1 -0
- package/dist/utils/useFloatingLayer.js +95 -0
- package/dist/utils/useFloatingLayer.js.map +1 -0
- package/dist/utils/usePresence.d.ts +9 -0
- package/dist/utils/usePresence.d.ts.map +1 -0
- package/dist/utils/usePresence.js +25 -0
- package/dist/utils/usePresence.js.map +1 -0
- package/dist/virtual-list.css +60 -0
- package/package.json +49 -10
- package/dist/cdn/leaf-0.2.2.min.css +0 -2
- package/dist/cdn/leaf-0.2.2.min.js +0 -165
- 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
|
|
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 đó
|
|
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
|
|
11
|
-
|
|
|
12
|
-
| Next.js (có bundle)
|
|
13
|
-
| Landing page tĩnh
|
|
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
|
|
221
|
-
<div class="bg-secondary border-quaternary
|
|
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
|
|
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) }
|
|
266
|
-
- **Leaf không có class layout / spacing / radius / border width / responsive.**
|
|
267
|
-
|
|
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)`)
|
|
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
|
|
327
|
-
|
|
|
328
|
-
| `Button`
|
|
329
|
-
| `Tabs`
|
|
330
|
-
| `Dialog`
|
|
331
|
-
| `Logo`
|
|
332
|
-
| `Skeleton`
|
|
333
|
-
| `Empty`
|
|
334
|
-
| `Spinner`
|
|
335
|
-
| `Toggle`
|
|
336
|
-
| `Slider`
|
|
337
|
-
| `Tooltip`
|
|
338
|
-
| `Radio` / `RadioGroup`
|
|
339
|
-
| `Checkbox`
|
|
340
|
-
| `Input`
|
|
341
|
-
| `InputOtp`
|
|
342
|
-
| `InputStepper`
|
|
343
|
-
| `Calendar`
|
|
344
|
-
| `InputDate`
|
|
345
|
-
| `Toaster` / `toast`
|
|
346
|
-
| `
|
|
347
|
-
| `
|
|
348
|
-
| `
|
|
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 {
|
|
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
|
|
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
|
|
603
|
+
Layout, spacing, responsive, hover dùng Tailwind giống app React.
|
|
489
604
|
|
|
490
605
|
```html
|
|
491
|
-
<link
|
|
492
|
-
|
|
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
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
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
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
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
|
-
<
|
|
523
|
-
<
|
|
524
|
-
|
|
525
|
-
</
|
|
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
|
-
|
|
529
|
-
|
|
530
|
-
|
|
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
|
|
687
|
-
`
|
|
688
|
-
- **
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
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
|