@finhay-pro/leaf-design-system 0.2.1 → 0.2.3
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 +398 -207
- package/dist/cdn/leaf-0.2.3.min.css +8 -0
- package/dist/cdn/leaf-0.2.3.min.js +204 -0
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +17 -15
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +2 -2
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +41 -23
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +35 -0
- package/dist/components/Carousel/Carousel.d.ts.map +1 -0
- package/dist/components/Carousel/Carousel.js +193 -0
- package/dist/components/Carousel/Carousel.js.map +1 -0
- package/dist/components/Carousel/index.d.ts +2 -0
- package/dist/components/Carousel/index.d.ts.map +1 -0
- package/dist/components/Carousel/index.js +2 -0
- package/dist/components/Carousel/index.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +6 -3
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Date/Date.d.ts +26 -0
- package/dist/components/Date/Date.d.ts.map +1 -0
- package/dist/components/Date/Date.js +26 -0
- package/dist/components/Date/Date.js.map +1 -0
- package/dist/components/Date/index.d.ts +2 -0
- package/dist/components/Date/index.d.ts.map +1 -0
- package/dist/components/Date/index.js +2 -0
- package/dist/components/Date/index.js.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +1 -2
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +2 -3
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +24 -10
- package/dist/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.js +244 -37
- package/dist/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/Empty/Empty.d.ts +27 -0
- package/dist/components/Empty/Empty.d.ts.map +1 -0
- package/dist/components/Empty/Empty.js +22 -0
- package/dist/components/Empty/Empty.js.map +1 -0
- package/dist/components/Empty/index.d.ts +2 -0
- package/dist/components/Empty/index.d.ts.map +1 -0
- package/dist/components/Empty/index.js +2 -0
- package/dist/components/Empty/index.js.map +1 -0
- package/dist/components/FileViewer/FileViewer.d.ts +63 -0
- package/dist/components/FileViewer/FileViewer.d.ts.map +1 -0
- package/dist/components/FileViewer/FileViewer.js +73 -0
- package/dist/components/FileViewer/FileViewer.js.map +1 -0
- package/dist/components/FileViewer/FileViewerDialog.d.ts +27 -0
- package/dist/components/FileViewer/FileViewerDialog.d.ts.map +1 -0
- package/dist/components/FileViewer/FileViewerDialog.js +13 -0
- package/dist/components/FileViewer/FileViewerDialog.js.map +1 -0
- package/dist/components/FileViewer/index.d.ts +4 -0
- package/dist/components/FileViewer/index.d.ts.map +1 -0
- package/dist/components/FileViewer/index.js +4 -0
- package/dist/components/FileViewer/index.js.map +1 -0
- package/dist/components/Form/DynamicForm.d.ts +52 -0
- package/dist/components/Form/DynamicForm.d.ts.map +1 -0
- package/dist/components/Form/DynamicForm.js +135 -0
- package/dist/components/Form/DynamicForm.js.map +1 -0
- package/dist/components/Form/Form.d.ts +54 -0
- package/dist/components/Form/Form.d.ts.map +1 -0
- package/dist/components/Form/Form.js +127 -0
- package/dist/components/Form/Form.js.map +1 -0
- package/dist/components/Form/adapters.d.ts +66 -0
- package/dist/components/Form/adapters.d.ts.map +1 -0
- package/dist/components/Form/adapters.js +113 -0
- package/dist/components/Form/adapters.js.map +1 -0
- package/dist/components/Form/index.d.ts +24 -0
- package/dist/components/Form/index.d.ts.map +1 -0
- package/dist/components/Form/index.js +23 -0
- package/dist/components/Form/index.js.map +1 -0
- package/dist/components/Form/useForm.d.ts +25 -0
- package/dist/components/Form/useForm.d.ts.map +1 -0
- package/dist/components/Form/useForm.js +46 -0
- package/dist/components/Form/useForm.js.map +1 -0
- package/dist/components/Input/Input.d.ts +1 -2
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +3 -4
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/InputDate.d.ts +3 -4
- package/dist/components/Input/InputDate.d.ts.map +1 -1
- package/dist/components/Input/InputDate.js +13 -6
- package/dist/components/Input/InputDate.js.map +1 -1
- package/dist/components/Input/InputOtp.d.ts +2 -2
- package/dist/components/Input/InputOtp.d.ts.map +1 -1
- package/dist/components/Input/InputOtp.js +2 -3
- package/dist/components/Input/InputOtp.js.map +1 -1
- package/dist/components/Input/InputStepper.d.ts +3 -4
- package/dist/components/Input/InputStepper.d.ts.map +1 -1
- package/dist/components/Input/InputStepper.js +4 -5
- package/dist/components/Input/InputStepper.js.map +1 -1
- package/dist/components/Logo/Logo.d.ts +2 -2
- package/dist/components/Logo/Logo.d.ts.map +1 -1
- package/dist/components/Logo/Logo.js +3 -4
- package/dist/components/Logo/Logo.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +49 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -0
- package/dist/components/MultiSelect/MultiSelect.js +285 -0
- package/dist/components/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/components/MultiSelect/index.d.ts +2 -0
- package/dist/components/MultiSelect/index.d.ts.map +1 -0
- package/dist/components/MultiSelect/index.js +2 -0
- package/dist/components/MultiSelect/index.js.map +1 -0
- package/dist/components/Number/Number.d.ts +32 -0
- package/dist/components/Number/Number.d.ts.map +1 -0
- package/dist/components/Number/Number.js +43 -0
- package/dist/components/Number/Number.js.map +1 -0
- package/dist/components/Number/index.d.ts +2 -0
- package/dist/components/Number/index.d.ts.map +1 -0
- package/dist/components/Number/index.js +2 -0
- package/dist/components/Number/index.js.map +1 -0
- package/dist/components/QrCode/QrCode.d.ts +27 -0
- package/dist/components/QrCode/QrCode.d.ts.map +1 -0
- package/dist/components/QrCode/QrCode.js +44 -0
- package/dist/components/QrCode/QrCode.js.map +1 -0
- package/dist/components/QrCode/index.d.ts +3 -0
- package/dist/components/QrCode/index.d.ts.map +1 -0
- package/dist/components/QrCode/index.js +3 -0
- package/dist/components/QrCode/index.js.map +1 -0
- package/dist/components/Radio/Radio.d.ts +4 -4
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.js +4 -5
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +2 -2
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.js +2 -3
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Slider/Slider.d.ts +8 -6
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/Slider.js +12 -8
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Spinner/Spinner.d.ts +5 -2
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.js +5 -4
- package/dist/components/Spinner/Spinner.js.map +1 -1
- package/dist/components/Table/Table.d.ts +59 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/Table.js +274 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Table/TableHeader.d.ts +19 -0
- package/dist/components/Table/TableHeader.d.ts.map +1 -0
- package/dist/components/Table/TableHeader.js +16 -0
- package/dist/components/Table/TableHeader.js.map +1 -0
- package/dist/components/Table/TableRow.d.ts +27 -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/Tabs/Tabs.d.ts +2 -3
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +4 -5
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +18 -0
- package/dist/components/Textarea/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea/Textarea.js +41 -0
- package/dist/components/Textarea/Textarea.js.map +1 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Textarea/index.d.ts.map +1 -0
- package/dist/components/Textarea/index.js +2 -0
- package/dist/components/Textarea/index.js.map +1 -0
- package/dist/components/Toast/Toast.d.ts +4 -3
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +7 -6
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts +3 -3
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.js +5 -3
- package/dist/components/Toggle/Toggle.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +4 -5
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +10 -8
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Upload/Upload.d.ts +89 -0
- package/dist/components/Upload/Upload.d.ts.map +1 -0
- package/dist/components/Upload/Upload.js +196 -0
- package/dist/components/Upload/Upload.js.map +1 -0
- package/dist/components/Upload/index.d.ts +2 -0
- package/dist/components/Upload/index.d.ts.map +1 -0
- package/dist/components/Upload/index.js +2 -0
- package/dist/components/Upload/index.js.map +1 -0
- package/dist/core/calendar.d.ts +5 -0
- package/dist/core/calendar.d.ts.map +1 -1
- package/dist/core/calendar.js +11 -0
- package/dist/core/calendar.js.map +1 -1
- package/dist/core/carousel.d.ts +42 -0
- package/dist/core/carousel.d.ts.map +1 -0
- package/dist/core/carousel.js +126 -0
- package/dist/core/carousel.js.map +1 -0
- package/dist/core/date.d.ts +46 -0
- package/dist/core/date.d.ts.map +1 -0
- package/dist/core/date.js +117 -0
- package/dist/core/date.js.map +1 -0
- package/dist/core/dialog.d.ts.map +1 -1
- package/dist/core/dialog.js +28 -2
- package/dist/core/dialog.js.map +1 -1
- package/dist/core/dropdown.d.ts +15 -2
- package/dist/core/dropdown.d.ts.map +1 -1
- package/dist/core/dropdown.js +29 -4
- package/dist/core/dropdown.js.map +1 -1
- package/dist/core/file/csv.d.ts +42 -0
- package/dist/core/file/csv.d.ts.map +1 -0
- package/dist/core/file/csv.js +159 -0
- package/dist/core/file/csv.js.map +1 -0
- package/dist/core/file/detect.d.ts +38 -0
- package/dist/core/file/detect.d.ts.map +1 -0
- package/dist/core/file/detect.js +218 -0
- package/dist/core/file/detect.js.map +1 -0
- package/dist/core/file/docx-render.d.ts +14 -0
- package/dist/core/file/docx-render.d.ts.map +1 -0
- package/dist/core/file/docx-render.js +173 -0
- package/dist/core/file/docx-render.js.map +1 -0
- package/dist/core/file/docx.d.ts +110 -0
- package/dist/core/file/docx.d.ts.map +1 -0
- package/dist/core/file/docx.js +632 -0
- package/dist/core/file/docx.js.map +1 -0
- package/dist/core/file/dom.d.ts +18 -0
- package/dist/core/file/dom.d.ts.map +1 -0
- package/dist/core/file/dom.js +57 -0
- package/dist/core/file/dom.js.map +1 -0
- package/dist/core/file/download.d.ts +26 -0
- package/dist/core/file/download.d.ts.map +1 -0
- package/dist/core/file/download.js +57 -0
- package/dist/core/file/download.js.map +1 -0
- package/dist/core/file/error.d.ts +34 -0
- package/dist/core/file/error.d.ts.map +1 -0
- package/dist/core/file/error.js +19 -0
- package/dist/core/file/error.js.map +1 -0
- package/dist/core/file/mime.d.ts +11 -0
- package/dist/core/file/mime.d.ts.map +1 -0
- package/dist/core/file/mime.js +61 -0
- package/dist/core/file/mime.js.map +1 -0
- package/dist/core/file/render.d.ts +45 -0
- package/dist/core/file/render.d.ts.map +1 -0
- package/dist/core/file/render.js +133 -0
- package/dist/core/file/render.js.map +1 -0
- package/dist/core/file/sheet-render.d.ts +30 -0
- package/dist/core/file/sheet-render.d.ts.map +1 -0
- package/dist/core/file/sheet-render.js +152 -0
- package/dist/core/file/sheet-render.js.map +1 -0
- package/dist/core/file/source.d.ts +56 -0
- package/dist/core/file/source.d.ts.map +1 -0
- package/dist/core/file/source.js +188 -0
- package/dist/core/file/source.js.map +1 -0
- package/dist/core/file/text.d.ts +9 -0
- package/dist/core/file/text.d.ts.map +1 -0
- package/dist/core/file/text.js +21 -0
- package/dist/core/file/text.js.map +1 -0
- package/dist/core/file/viewer.d.ts +160 -0
- package/dist/core/file/viewer.d.ts.map +1 -0
- package/dist/core/file/viewer.js +623 -0
- package/dist/core/file/viewer.js.map +1 -0
- package/dist/core/file/xlsx-format.d.ts +55 -0
- package/dist/core/file/xlsx-format.d.ts.map +1 -0
- package/dist/core/file/xlsx-format.js +476 -0
- package/dist/core/file/xlsx-format.js.map +1 -0
- package/dist/core/file/xlsx-write.d.ts +48 -0
- package/dist/core/file/xlsx-write.d.ts.map +1 -0
- package/dist/core/file/xlsx-write.js +219 -0
- package/dist/core/file/xlsx-write.js.map +1 -0
- package/dist/core/file/xlsx.d.ts +115 -0
- package/dist/core/file/xlsx.d.ts.map +1 -0
- package/dist/core/file/xlsx.js +402 -0
- package/dist/core/file/xlsx.js.map +1 -0
- package/dist/core/file/xml.d.ts +34 -0
- package/dist/core/file/xml.d.ts.map +1 -0
- package/dist/core/file/xml.js +102 -0
- package/dist/core/file/xml.js.map +1 -0
- package/dist/core/file/zip-write.d.ts +24 -0
- package/dist/core/file/zip-write.d.ts.map +1 -0
- package/dist/core/file/zip-write.js +131 -0
- package/dist/core/file/zip-write.js.map +1 -0
- package/dist/core/file/zip.d.ts +37 -0
- package/dist/core/file/zip.d.ts.map +1 -0
- package/dist/core/file/zip.js +195 -0
- package/dist/core/file/zip.js.map +1 -0
- package/dist/core/form.d.ts +88 -0
- package/dist/core/form.d.ts.map +1 -0
- package/dist/core/form.js +353 -0
- package/dist/core/form.js.map +1 -0
- package/dist/core/icons.d.ts +16 -0
- package/dist/core/icons.d.ts.map +1 -1
- package/dist/core/icons.js +16 -0
- package/dist/core/icons.js.map +1 -1
- package/dist/core/number.d.ts +45 -0
- package/dist/core/number.d.ts.map +1 -0
- package/dist/core/number.js +74 -0
- package/dist/core/number.js.map +1 -0
- package/dist/core/qr-code.d.ts +18 -0
- package/dist/core/qr-code.d.ts.map +1 -0
- package/dist/core/qr-code.js +702 -0
- package/dist/core/qr-code.js.map +1 -0
- package/dist/core/stepper.d.ts +6 -2
- package/dist/core/stepper.d.ts.map +1 -1
- package/dist/core/stepper.js +12 -9
- package/dist/core/stepper.js.map +1 -1
- package/dist/core/table/attrs.d.ts +65 -0
- package/dist/core/table/attrs.d.ts.map +1 -0
- package/dist/core/table/attrs.js +202 -0
- package/dist/core/table/attrs.js.map +1 -0
- package/dist/core/table/columns.d.ts +156 -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/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 +10 -0
- package/dist/core/table/index.d.ts.map +1 -0
- package/dist/core/table/index.js +10 -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/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 +29 -0
- package/dist/core/table/virtual.d.ts.map +1 -0
- package/dist/core/table/virtual.js +24 -0
- package/dist/core/table/virtual.js.map +1 -0
- package/dist/core/upload.d.ts +51 -0
- package/dist/core/upload.d.ts.map +1 -0
- package/dist/core/upload.js +114 -0
- package/dist/core/upload.js.map +1 -0
- package/dist/engine/assets.json +1 -0
- package/dist/engine/chunk-X2H56OKG.js +4854 -0
- package/dist/engine/cli.js +8 -0
- package/dist/engine/postcss.d.ts +3 -0
- package/dist/engine/postcss.js +7 -0
- package/dist/engine/vite.d.ts +3 -0
- package/dist/engine/vite.js +7 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -1
- package/dist/{styles.css → leaf.css} +2146 -153
- package/dist/skill/leaf-design-system-0.2.3.zip +0 -0
- package/dist/utils/colorClass.d.ts +24 -0
- package/dist/utils/colorClass.d.ts.map +1 -0
- package/dist/utils/colorClass.js +107 -0
- package/dist/utils/colorClass.js.map +1 -0
- package/package.json +18 -29
- package/dist/button.css +0 -214
- package/dist/calendar.css +0 -336
- package/dist/cdn/leaf-0.2.1.min.css +0 -2
- package/dist/cdn/leaf-0.2.1.min.js +0 -9
- package/dist/checkbox.css +0 -132
- package/dist/classes.css +0 -3464
- package/dist/color.css +0 -260
- package/dist/dialog.css +0 -176
- package/dist/dropdown.css +0 -303
- package/dist/input-date.css +0 -49
- package/dist/input-otp.css +0 -76
- package/dist/input-stepper.css +0 -179
- package/dist/input.css +0 -218
- package/dist/logo-assets.css +0 -81
- package/dist/logo.css +0 -52
- package/dist/radio.css +0 -124
- package/dist/skeleton.css +0 -49
- package/dist/skill/leaf-design-system-0.2.1.zip +0 -0
- package/dist/slider.css +0 -249
- package/dist/spinner.css +0 -117
- package/dist/tabs.css +0 -253
- package/dist/toast.css +0 -236
- package/dist/toggle.css +0 -116
- package/dist/tokens.css +0 -264
- package/dist/tooltip.css +0 -213
- package/dist/typography.css +0 -150
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vai trò màu / typography — map 1:1 sang class trong `src/styles/color.css` và
|
|
3
|
+
* `typography.css`. Prop màu của component chỉ nhận các hậu tố này, không nhận
|
|
4
|
+
* chuỗi CSS / `var(--…)`.
|
|
5
|
+
*
|
|
6
|
+
* - `LeafTextColor` → class `text-${value}`
|
|
7
|
+
* - `LeafBgColor` → class `bg-${value}`
|
|
8
|
+
* - `LeafTypography` → class trùng tên (vd. `heading-1`, `body-3-highlight`)
|
|
9
|
+
*/
|
|
10
|
+
/** Hậu tố của class `text-*` trong color.css. */
|
|
11
|
+
export type LeafTextColor = "highlight" | "primary" | "secondary" | "tertiary" | "quaternary" | "blue" | "green" | "yellow" | "orange" | "red" | "purple" | "blue-secondary" | "green-secondary" | "yellow-secondary" | "orange-secondary" | "red-secondary" | "purple-secondary";
|
|
12
|
+
/** Hậu tố của class `bg-*` trong color.css. */
|
|
13
|
+
export type LeafBgColor = "highlight" | "primary" | "secondary" | "tertiary" | "quaternary" | "quinary" | "blue" | "green" | "yellow" | "orange" | "red" | "purple" | "blue-secondary" | "green-secondary" | "yellow-secondary" | "orange-secondary" | "red-secondary" | "purple-secondary";
|
|
14
|
+
/** Tên class typography trong typography.css. */
|
|
15
|
+
export type LeafTypography = "display-1" | "display-2" | "display-3" | "heading-1" | "heading-2" | "heading-3" | "body-1" | "body-1-highlight" | "body-2" | "body-2-highlight" | "body-3" | "body-3-highlight" | "body-4" | "body-4-highlight" | "body-5" | "body-5-highlight";
|
|
16
|
+
/** Runtime list — dùng cho test đối chiếu với CSS và rule `data-color` của Slider. */
|
|
17
|
+
export declare const LEAF_TEXT_COLORS: readonly ["highlight", "primary", "secondary", "tertiary", "quaternary", "blue", "green", "yellow", "orange", "red", "purple", "blue-secondary", "green-secondary", "yellow-secondary", "orange-secondary", "red-secondary", "purple-secondary"];
|
|
18
|
+
export declare const LEAF_BG_COLORS: readonly ["highlight", "primary", "secondary", "tertiary", "quaternary", "quinary", "blue", "green", "yellow", "orange", "red", "purple", "blue-secondary", "green-secondary", "yellow-secondary", "orange-secondary", "red-secondary", "purple-secondary"];
|
|
19
|
+
export declare const LEAF_TYPOGRAPHY: readonly ["display-1", "display-2", "display-3", "heading-1", "heading-2", "heading-3", "body-1", "body-1-highlight", "body-2", "body-2-highlight", "body-3", "body-3-highlight", "body-4", "body-4-highlight", "body-5", "body-5-highlight"];
|
|
20
|
+
/** Token CSS tương ứng hậu tố `text-*` (dùng cho biến nội bộ như `--leaf-slider-active`). */
|
|
21
|
+
export declare function textColorToken(color: LeafTextColor): string;
|
|
22
|
+
/** Token CSS tương ứng hậu tố `bg-*` (dùng cho biến nội bộ như `--leaf-table-col-bg`). */
|
|
23
|
+
export declare function bgColorToken(color: LeafBgColor): string;
|
|
24
|
+
//# sourceMappingURL=colorClass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorClass.d.ts","sourceRoot":"","sources":["../../src/utils/colorClass.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,iDAAiD;AACjD,MAAM,MAAM,aAAa,GACnB,WAAW,GACX,SAAS,GACT,WAAW,GACX,UAAU,GACV,YAAY,GACZ,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,eAAe,GACf,kBAAkB,CAAC;AAEzB,+CAA+C;AAC/C,MAAM,MAAM,WAAW,GACjB,WAAW,GACX,SAAS,GACT,WAAW,GACX,UAAU,GACV,YAAY,GACZ,SAAS,GACT,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,eAAe,GACf,kBAAkB,CAAC;AAEzB,iDAAiD;AACjD,MAAM,MAAM,cAAc,GACpB,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,QAAQ,GACR,kBAAkB,GAClB,QAAQ,GACR,kBAAkB,GAClB,QAAQ,GACR,kBAAkB,GAClB,QAAQ,GACR,kBAAkB,GAClB,QAAQ,GACR,kBAAkB,CAAC;AAEzB,sFAAsF;AACtF,eAAO,MAAM,gBAAgB,kPAkBgB,CAAC;AAE9C,eAAO,MAAM,cAAc,6PAmBgB,CAAC;AAE5C,eAAO,MAAM,eAAe,+OAiBkB,CAAC;AAE/C,6FAA6F;AAC7F,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAuB3D;AAUD,0FAA0F;AAC1F,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAKvD"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vai trò màu / typography — map 1:1 sang class trong `src/styles/color.css` và
|
|
3
|
+
* `typography.css`. Prop màu của component chỉ nhận các hậu tố này, không nhận
|
|
4
|
+
* chuỗi CSS / `var(--…)`.
|
|
5
|
+
*
|
|
6
|
+
* - `LeafTextColor` → class `text-${value}`
|
|
7
|
+
* - `LeafBgColor` → class `bg-${value}`
|
|
8
|
+
* - `LeafTypography` → class trùng tên (vd. `heading-1`, `body-3-highlight`)
|
|
9
|
+
*/
|
|
10
|
+
/** Runtime list — dùng cho test đối chiếu với CSS và rule `data-color` của Slider. */
|
|
11
|
+
export const LEAF_TEXT_COLORS = [
|
|
12
|
+
"highlight",
|
|
13
|
+
"primary",
|
|
14
|
+
"secondary",
|
|
15
|
+
"tertiary",
|
|
16
|
+
"quaternary",
|
|
17
|
+
"blue",
|
|
18
|
+
"green",
|
|
19
|
+
"yellow",
|
|
20
|
+
"orange",
|
|
21
|
+
"red",
|
|
22
|
+
"purple",
|
|
23
|
+
"blue-secondary",
|
|
24
|
+
"green-secondary",
|
|
25
|
+
"yellow-secondary",
|
|
26
|
+
"orange-secondary",
|
|
27
|
+
"red-secondary",
|
|
28
|
+
"purple-secondary",
|
|
29
|
+
];
|
|
30
|
+
export const LEAF_BG_COLORS = [
|
|
31
|
+
"highlight",
|
|
32
|
+
"primary",
|
|
33
|
+
"secondary",
|
|
34
|
+
"tertiary",
|
|
35
|
+
"quaternary",
|
|
36
|
+
"quinary",
|
|
37
|
+
"blue",
|
|
38
|
+
"green",
|
|
39
|
+
"yellow",
|
|
40
|
+
"orange",
|
|
41
|
+
"red",
|
|
42
|
+
"purple",
|
|
43
|
+
"blue-secondary",
|
|
44
|
+
"green-secondary",
|
|
45
|
+
"yellow-secondary",
|
|
46
|
+
"orange-secondary",
|
|
47
|
+
"red-secondary",
|
|
48
|
+
"purple-secondary",
|
|
49
|
+
];
|
|
50
|
+
export const LEAF_TYPOGRAPHY = [
|
|
51
|
+
"display-1",
|
|
52
|
+
"display-2",
|
|
53
|
+
"display-3",
|
|
54
|
+
"heading-1",
|
|
55
|
+
"heading-2",
|
|
56
|
+
"heading-3",
|
|
57
|
+
"body-1",
|
|
58
|
+
"body-1-highlight",
|
|
59
|
+
"body-2",
|
|
60
|
+
"body-2-highlight",
|
|
61
|
+
"body-3",
|
|
62
|
+
"body-3-highlight",
|
|
63
|
+
"body-4",
|
|
64
|
+
"body-4-highlight",
|
|
65
|
+
"body-5",
|
|
66
|
+
"body-5-highlight",
|
|
67
|
+
];
|
|
68
|
+
/** Token CSS tương ứng hậu tố `text-*` (dùng cho biến nội bộ như `--leaf-slider-active`). */
|
|
69
|
+
export function textColorToken(color) {
|
|
70
|
+
switch (color) {
|
|
71
|
+
case "highlight":
|
|
72
|
+
case "primary":
|
|
73
|
+
case "secondary":
|
|
74
|
+
case "tertiary":
|
|
75
|
+
case "quaternary":
|
|
76
|
+
return `var(--text-${color})`;
|
|
77
|
+
case "blue":
|
|
78
|
+
case "green":
|
|
79
|
+
case "yellow":
|
|
80
|
+
case "orange":
|
|
81
|
+
case "red":
|
|
82
|
+
case "purple":
|
|
83
|
+
return `var(--system-${color})`;
|
|
84
|
+
case "blue-secondary":
|
|
85
|
+
case "green-secondary":
|
|
86
|
+
case "yellow-secondary":
|
|
87
|
+
case "orange-secondary":
|
|
88
|
+
case "red-secondary":
|
|
89
|
+
case "purple-secondary":
|
|
90
|
+
return `var(--system-${color})`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const BASE_BG_COLORS = new Set([
|
|
94
|
+
"primary",
|
|
95
|
+
"secondary",
|
|
96
|
+
"tertiary",
|
|
97
|
+
"quaternary",
|
|
98
|
+
"quinary",
|
|
99
|
+
]);
|
|
100
|
+
/** Token CSS tương ứng hậu tố `bg-*` (dùng cho biến nội bộ như `--leaf-table-col-bg`). */
|
|
101
|
+
export function bgColorToken(color) {
|
|
102
|
+
if (color === "highlight") {
|
|
103
|
+
return "var(--text-highlight)";
|
|
104
|
+
}
|
|
105
|
+
return BASE_BG_COLORS.has(color) ? `var(--base-${color})` : `var(--system-${color})`;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=colorClass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorClass.js","sourceRoot":"","sources":["../../src/utils/colorClass.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA8DH,sFAAsF;AACtF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,WAAW;IACX,SAAS;IACT,WAAW;IACX,UAAU;IACV,YAAY;IACZ,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,gBAAgB;IAChB,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;CACuB,CAAC;AAE9C,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,WAAW;IACX,SAAS;IACT,WAAW;IACX,UAAU;IACV,YAAY;IACZ,SAAS;IACT,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,gBAAgB;IAChB,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;CACqB,CAAC;AAE5C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,QAAQ;IACR,kBAAkB;IAClB,QAAQ;IACR,kBAAkB;IAClB,QAAQ;IACR,kBAAkB;IAClB,QAAQ;IACR,kBAAkB;IAClB,QAAQ;IACR,kBAAkB;CACwB,CAAC;AAE/C,6FAA6F;AAC7F,MAAM,UAAU,cAAc,CAAC,KAAoB;IAC/C,QAAQ,KAAK,EAAE,CAAC;QACZ,KAAK,WAAW,CAAC;QACjB,KAAK,SAAS,CAAC;QACf,KAAK,WAAW,CAAC;QACjB,KAAK,UAAU,CAAC;QAChB,KAAK,YAAY;YACb,OAAO,cAAc,KAAK,GAAG,CAAC;QAClC,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ,CAAC;QACd,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ;YACT,OAAO,gBAAgB,KAAK,GAAG,CAAC;QACpC,KAAK,gBAAgB,CAAC;QACtB,KAAK,iBAAiB,CAAC;QACvB,KAAK,kBAAkB,CAAC;QACxB,KAAK,kBAAkB,CAAC;QACxB,KAAK,eAAe,CAAC;QACrB,KAAK,kBAAkB;YACnB,OAAO,gBAAgB,KAAK,GAAG,CAAC;IACxC,CAAC;AACL,CAAC;AAED,MAAM,cAAc,GAAG,IAAI,GAAG,CAAc;IACxC,SAAS;IACT,WAAW;IACX,UAAU;IACV,YAAY;IACZ,SAAS;CACZ,CAAC,CAAC;AAEH,0FAA0F;AAC1F,MAAM,UAAU,YAAY,CAAC,KAAkB;IAC3C,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;QACxB,OAAO,uBAAuB,CAAC;IACnC,CAAC;IACD,OAAO,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,KAAK,GAAG,CAAC,CAAC,CAAC,gBAAgB,KAAK,GAAG,CAAC;AACzF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finhay-pro/leaf-design-system",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "React component library của Finhay Leaf Design System",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -17,34 +17,22 @@
|
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"default": "./dist/index.js"
|
|
19
19
|
},
|
|
20
|
-
"./
|
|
21
|
-
"./
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"./
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"./spinner.css": "./dist/spinner.css",
|
|
30
|
-
"./toggle.css": "./dist/toggle.css",
|
|
31
|
-
"./slider.css": "./dist/slider.css",
|
|
32
|
-
"./tooltip.css": "./dist/tooltip.css",
|
|
33
|
-
"./radio.css": "./dist/radio.css",
|
|
34
|
-
"./checkbox.css": "./dist/checkbox.css",
|
|
35
|
-
"./input.css": "./dist/input.css",
|
|
36
|
-
"./input-otp.css": "./dist/input-otp.css",
|
|
37
|
-
"./input-date.css": "./dist/input-date.css",
|
|
38
|
-
"./input-stepper.css": "./dist/input-stepper.css",
|
|
39
|
-
"./calendar.css": "./dist/calendar.css",
|
|
40
|
-
"./toast.css": "./dist/toast.css",
|
|
41
|
-
"./dropdown.css": "./dist/dropdown.css",
|
|
42
|
-
"./classes.css": "./dist/classes.css",
|
|
43
|
-
"./styles.css": "./dist/styles.css",
|
|
20
|
+
"./css": "./dist/leaf.css",
|
|
21
|
+
"./vite": {
|
|
22
|
+
"types": "./dist/engine/vite.d.ts",
|
|
23
|
+
"default": "./dist/engine/vite.js"
|
|
24
|
+
},
|
|
25
|
+
"./postcss": {
|
|
26
|
+
"types": "./dist/engine/postcss.d.ts",
|
|
27
|
+
"default": "./dist/engine/postcss.js"
|
|
28
|
+
},
|
|
44
29
|
"./package.json": "./package.json"
|
|
45
30
|
},
|
|
46
31
|
"main": "./dist/index.js",
|
|
47
32
|
"types": "./dist/index.d.ts",
|
|
33
|
+
"bin": {
|
|
34
|
+
"leaf-css": "./dist/engine/cli.js"
|
|
35
|
+
},
|
|
48
36
|
"files": [
|
|
49
37
|
"dist"
|
|
50
38
|
],
|
|
@@ -58,14 +46,15 @@
|
|
|
58
46
|
"@testing-library/user-event": "^14.6.7",
|
|
59
47
|
"@types/react": "^19.1.6",
|
|
60
48
|
"@types/react-dom": "^19.2.4",
|
|
61
|
-
"@vitest/coverage-v8": "5.0.
|
|
49
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
62
50
|
"esbuild": "^0.28.2",
|
|
63
51
|
"fflate": "^0.8.3",
|
|
64
52
|
"jsdom": "^30.0.1",
|
|
65
53
|
"react": "^19.1.0",
|
|
66
54
|
"react-dom": "^19.1.0",
|
|
67
55
|
"typescript": "^5.8.3",
|
|
68
|
-
"vitest": "^5.0.
|
|
56
|
+
"vitest": "^5.0.5",
|
|
57
|
+
"@finhay/leaf-css": "0.0.0",
|
|
69
58
|
"@finhay/leaf-tokens": "0.0.0",
|
|
70
59
|
"@finhay/tsconfig": "0.0.0"
|
|
71
60
|
},
|
|
@@ -74,8 +63,8 @@
|
|
|
74
63
|
"access": "public"
|
|
75
64
|
},
|
|
76
65
|
"scripts": {
|
|
77
|
-
"build": "tsc -p tsconfig.build.json && node scripts/build-css.mjs && node scripts/build-cdn.mjs && node scripts/build-skill.mjs",
|
|
78
|
-
"dev": "node scripts/build-css.mjs && tsc -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
66
|
+
"build": "tsc -p tsconfig.build.json && node scripts/build-css.mjs && node scripts/build-engine.mjs && node scripts/build-cdn.mjs && node scripts/build-skill.mjs",
|
|
67
|
+
"dev": "node scripts/build-css.mjs && node scripts/build-engine.mjs && tsc -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
79
68
|
"clean": "rm -rf dist",
|
|
80
69
|
"typecheck": "tsc -p tsconfig.json",
|
|
81
70
|
"test": "vitest run --project unit",
|
package/dist/button.css
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
/* @finhay-pro/leaf-design-system — generated by scripts/build-css.mjs. Do not edit. */
|
|
2
|
-
@layer theme, base, components, utilities;
|
|
3
|
-
|
|
4
|
-
/* --- src/components/Button/button.css --- */
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Button — Figma 246:1135.
|
|
8
|
-
*
|
|
9
|
-
* Variant màu qua data-priority / data-status; size qua data-size; icon-only
|
|
10
|
-
* qua data-icon-only. Disabled dùng attribute native `:disabled` (và
|
|
11
|
-
* `aria-disabled`) nên không cần class riêng.
|
|
12
|
-
*
|
|
13
|
-
* Width / height override qua --leaf-button-width / --leaf-button-height
|
|
14
|
-
* (React gắn bằng prop; HTML tĩnh set style hoặc để mặc định theo size).
|
|
15
|
-
*
|
|
16
|
-
* Toàn bộ hình thức (kể cả typography của label) nằm ở đây — React chỉ gắn
|
|
17
|
-
* attribute, nên HTML tĩnh viết cùng markup là ra cùng kết quả. Thiếu attribute
|
|
18
|
-
* nào thì lấy mặc định giống prop của React: lg · primary · normal.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
@layer components {
|
|
22
|
-
.leaf-button {
|
|
23
|
-
/* Mặc định: size lg — Figma Large: h 56 · px XL · py S · gap L · icon 30 */
|
|
24
|
-
/* --leaf-button-width chỉ set khi prop width; không set → auto / icon-only = height */
|
|
25
|
-
--leaf-button-height: 56px;
|
|
26
|
-
--leaf-button-padding: 8px 24px;
|
|
27
|
-
--leaf-button-icon-only-padding: 8px;
|
|
28
|
-
--leaf-button-gap: 16px;
|
|
29
|
-
--leaf-button-icon-size: 30px;
|
|
30
|
-
--leaf-button-font-size: var(--body-1-size);
|
|
31
|
-
--leaf-button-line-height: var(--body-1-line-height);
|
|
32
|
-
--leaf-button-font-weight: var(--body-1-highlight-weight);
|
|
33
|
-
--leaf-button-letter-spacing: 0.5px;
|
|
34
|
-
|
|
35
|
-
/* Mặc định: priority primary, status normal */
|
|
36
|
-
--leaf-button-bg: var(--button-base-primary);
|
|
37
|
-
--leaf-button-fg: var(--button-content-primary);
|
|
38
|
-
|
|
39
|
-
display: inline-flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
justify-content: center;
|
|
42
|
-
box-sizing: border-box;
|
|
43
|
-
width: var(--leaf-button-width, auto);
|
|
44
|
-
height: var(--leaf-button-height);
|
|
45
|
-
gap: var(--leaf-button-gap);
|
|
46
|
-
border: none;
|
|
47
|
-
margin: 0;
|
|
48
|
-
padding: var(--leaf-button-padding);
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
border-radius: 1000px;
|
|
51
|
-
background-color: var(--leaf-button-bg);
|
|
52
|
-
color: var(--leaf-button-fg);
|
|
53
|
-
font: inherit;
|
|
54
|
-
font-family: var(--font-sans);
|
|
55
|
-
font-size: var(--leaf-button-font-size);
|
|
56
|
-
line-height: var(--leaf-button-line-height);
|
|
57
|
-
font-weight: var(--leaf-button-font-weight);
|
|
58
|
-
letter-spacing: var(--leaf-button-letter-spacing);
|
|
59
|
-
text-align: center;
|
|
60
|
-
white-space: nowrap;
|
|
61
|
-
vertical-align: middle;
|
|
62
|
-
text-decoration: none;
|
|
63
|
-
appearance: none;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.leaf-button__icon {
|
|
67
|
-
display: inline-flex;
|
|
68
|
-
flex-shrink: 0;
|
|
69
|
-
align-items: center;
|
|
70
|
-
justify-content: center;
|
|
71
|
-
width: var(--leaf-button-icon-size);
|
|
72
|
-
height: var(--leaf-button-icon-size);
|
|
73
|
-
font-size: var(--leaf-button-icon-size);
|
|
74
|
-
line-height: 1;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.leaf-button__icon > svg {
|
|
78
|
-
display: block;
|
|
79
|
-
width: 1em;
|
|
80
|
-
height: 1em;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/* `hidden` luôn ẩn — rule trên set display; selector `[hidden]` specificity cao hơn nên thắng. */
|
|
84
|
-
.leaf-button[hidden],
|
|
85
|
-
.leaf-button__icon[hidden] {
|
|
86
|
-
display: none;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/* ── Size — Figma Medium/Small dùng padding (không ép height trong auto-layout);
|
|
90
|
-
* vẫn set height mặc định khớp frame để icon-only / căn hàng ổn định.
|
|
91
|
-
* Truyền height="auto" (prop) → chiều cao theo padding + nội dung. */
|
|
92
|
-
|
|
93
|
-
.leaf-button[data-size="md"] {
|
|
94
|
-
/* Medium: px L · py S · gap M · icon 24 · frame 40 */
|
|
95
|
-
--leaf-button-height: 40px;
|
|
96
|
-
--leaf-button-padding: 8px 16px;
|
|
97
|
-
--leaf-button-gap: 12px;
|
|
98
|
-
--leaf-button-icon-size: 24px;
|
|
99
|
-
--leaf-button-font-size: var(--body-3-size);
|
|
100
|
-
--leaf-button-line-height: var(--body-3-line-height);
|
|
101
|
-
--leaf-button-font-weight: var(--body-3-highlight-weight);
|
|
102
|
-
--leaf-button-letter-spacing: 0;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.leaf-button[data-size="sm"] {
|
|
106
|
-
/* Small: px M · py XS · gap S · icon 20 · frame 28 */
|
|
107
|
-
--leaf-button-height: 28px;
|
|
108
|
-
--leaf-button-padding: 4px 12px;
|
|
109
|
-
--leaf-button-icon-only-padding: 4px;
|
|
110
|
-
--leaf-button-gap: 8px;
|
|
111
|
-
--leaf-button-icon-size: 20px;
|
|
112
|
-
--leaf-button-font-size: var(--body-4-size);
|
|
113
|
-
--leaf-button-line-height: var(--body-4-line-height);
|
|
114
|
-
--leaf-button-font-weight: var(--body-4-highlight-weight);
|
|
115
|
-
--leaf-button-letter-spacing: 0;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/* Icon-only: khung vuông (tròn nhờ border-radius). Width custom vẫn được tôn trọng. */
|
|
119
|
-
.leaf-button[data-icon-only="true"] {
|
|
120
|
-
width: var(--leaf-button-width, var(--leaf-button-height));
|
|
121
|
-
padding: var(--leaf-button-icon-only-padding);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/* Ghost text — không khung; icon-only ghost vẫn giữ hit-area theo size. */
|
|
125
|
-
.leaf-button[data-priority="ghost"]:not([data-icon-only="true"]) {
|
|
126
|
-
--leaf-button-height: auto;
|
|
127
|
-
--leaf-button-padding: 0;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.leaf-button[data-priority="ghost"][data-icon-only="true"] {
|
|
131
|
-
--leaf-button-bg: transparent;
|
|
132
|
-
--leaf-button-padding: 0;
|
|
133
|
-
--leaf-button-icon-only-padding: 0;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/* ── Priority × status ───────────────────────────────────────────────── */
|
|
137
|
-
|
|
138
|
-
.leaf-button[data-status="destruction"] {
|
|
139
|
-
--leaf-button-bg: var(--button-base-destruction);
|
|
140
|
-
--leaf-button-fg: var(--button-content-primary);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.leaf-button[data-priority="secondary"] {
|
|
144
|
-
--leaf-button-bg: var(--button-base-secondary);
|
|
145
|
-
--leaf-button-fg: var(--button-content-secondary);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.leaf-button[data-priority="secondary"][data-status="destruction"] {
|
|
149
|
-
--leaf-button-bg: var(--button-base-secondary-destruction);
|
|
150
|
-
--leaf-button-fg: var(--button-content-destruction);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.leaf-button[data-priority="tertiary"] {
|
|
154
|
-
--leaf-button-bg: var(--button-base-tertiary);
|
|
155
|
-
--leaf-button-fg: var(--button-content-secondary);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.leaf-button[data-priority="tertiary"][data-status="destruction"] {
|
|
159
|
-
--leaf-button-bg: var(--button-base-tertiary);
|
|
160
|
-
--leaf-button-fg: var(--button-content-destruction);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.leaf-button[data-priority="ghost"] {
|
|
164
|
-
--leaf-button-bg: transparent;
|
|
165
|
-
--leaf-button-fg: var(--button-content-secondary);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.leaf-button[data-priority="ghost"][data-status="destruction"] {
|
|
169
|
-
--leaf-button-bg: transparent;
|
|
170
|
-
--leaf-button-fg: var(--button-content-destruction);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/*
|
|
174
|
-
* Disabled — token --button-disabled-* (alias của --button-*-disable).
|
|
175
|
-
* Specificity (0,3,0) và đứng cuối để thắng mọi tổ hợp priority × status.
|
|
176
|
-
*/
|
|
177
|
-
.leaf-button:disabled:not([data-priority="ghost"]),
|
|
178
|
-
.leaf-button[aria-disabled="true"]:not([data-priority="ghost"]) {
|
|
179
|
-
--leaf-button-bg: var(--button-disabled-base);
|
|
180
|
-
--leaf-button-fg: var(--button-disabled-content);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.leaf-button[data-priority="ghost"]:disabled,
|
|
184
|
-
.leaf-button[data-priority="ghost"][aria-disabled="true"] {
|
|
185
|
-
--leaf-button-bg: transparent;
|
|
186
|
-
--leaf-button-fg: var(--button-disabled-content);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.leaf-button:disabled,
|
|
190
|
-
.leaf-button[aria-disabled="true"] {
|
|
191
|
-
cursor: not-allowed;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/*
|
|
195
|
-
* Loading — `data-loading="true"` (React: `loading` / onClick trả Promise; HTML tĩnh:
|
|
196
|
-
* `Leaf.button.setLoading`). Spinner thay leading icon, ăn --leaf-button-icon-size và
|
|
197
|
-
* màu chữ. Nút gắn `aria-disabled="true"` (không dùng `:disabled` để vẫn giữ focus) nên
|
|
198
|
-
* mang màu disabled như rule ở trên — có chủ đích: đang xử lý = tạm khoá.
|
|
199
|
-
*/
|
|
200
|
-
.leaf-button[data-loading="true"] {
|
|
201
|
-
cursor: progress;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.leaf-button__spinner > svg {
|
|
205
|
-
animation: leaf-spinner-spin var(--leaf-spinner-duration, 1.2s) linear infinite;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/* Trùng tên với spinner.css để button.css tự đủ khi import riêng. */
|
|
210
|
-
@keyframes leaf-spinner-spin {
|
|
211
|
-
to {
|
|
212
|
-
transform: rotate(360deg);
|
|
213
|
-
}
|
|
214
|
-
}
|