@indielayer/ui 1.0.9 → 1.1.0
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/LICENSE +1 -1
- package/README.md +2 -2
- package/{src/exports/nuxt.js → exports/nuxt.mjs} +1 -1
- package/{lib → exports}/nuxt.plugin.js +1 -1
- package/lib/_virtual/_plugin-vue_export-helper.js +9 -0
- package/lib/common/icons.js +18 -0
- package/lib/common/utils.d.ts +4 -0
- package/lib/common/utils.js +25 -0
- package/lib/components/alert/Alert.theme.d.ts +10 -8
- package/lib/components/alert/Alert.theme.js +41 -0
- package/lib/components/alert/Alert.vue.d.ts +33 -7
- package/lib/components/alert/Alert.vue.js +9 -0
- package/lib/components/alert/Alert.vue2.js +62 -0
- package/lib/components/alert/Alert.vue3.js +8 -0
- package/lib/components/alert/index.d.ts +3 -0
- package/lib/components/avatar/Avatar.theme.d.ts +13 -7
- package/lib/components/avatar/Avatar.theme.js +25 -0
- package/lib/components/avatar/Avatar.vue.d.ts +32 -3
- package/lib/components/avatar/Avatar.vue.js +9 -0
- package/lib/components/avatar/Avatar.vue2.js +76 -0
- package/lib/components/avatar/Avatar.vue3.js +7 -0
- package/lib/components/avatar/index.d.ts +3 -0
- package/lib/components/badge/Badge.theme.d.ts +10 -8
- package/lib/components/badge/Badge.theme.js +12 -0
- package/lib/components/badge/Badge.vue.d.ts +54 -9
- package/lib/components/badge/Badge.vue.js +94 -0
- package/lib/components/badge/Badge.vue2.js +4 -0
- package/lib/components/badge/index.d.ts +3 -0
- package/lib/components/breadcrumbs/Breadcrumbs.theme.d.ts +10 -8
- package/lib/components/breadcrumbs/Breadcrumbs.theme.js +10 -0
- package/lib/components/breadcrumbs/Breadcrumbs.vue.d.ts +20 -6
- package/lib/components/breadcrumbs/Breadcrumbs.vue.js +79 -0
- package/lib/components/breadcrumbs/Breadcrumbs.vue2.js +4 -0
- package/lib/components/breadcrumbs/index.d.ts +3 -0
- package/lib/components/button/Button.theme.d.ts +12 -9
- package/lib/components/button/Button.theme.js +138 -0
- package/lib/components/button/Button.vue.d.ts +49 -8
- package/lib/components/button/Button.vue.js +9 -0
- package/lib/components/button/Button.vue2.js +115 -0
- package/lib/components/button/Button.vue3.js +8 -0
- package/lib/components/button/ButtonGroup.theme.d.ts +12 -5
- package/lib/components/button/ButtonGroup.theme.js +8 -0
- package/lib/components/button/ButtonGroup.vue.d.ts +44 -6
- package/lib/components/button/ButtonGroup.vue.js +9 -0
- package/lib/components/button/ButtonGroup.vue2.js +54 -0
- package/lib/components/button/ButtonGroup.vue3.js +7 -0
- package/lib/components/button/index.d.ts +6 -0
- package/lib/components/card/Card.theme.d.ts +10 -7
- package/lib/components/card/Card.theme.js +8 -0
- package/lib/components/card/Card.vue.d.ts +17 -1
- package/lib/components/card/Card.vue.js +31 -0
- package/lib/components/card/Card.vue2.js +4 -0
- package/lib/components/card/index.d.ts +3 -0
- package/lib/components/checkbox/Checkbox.theme.d.ts +13 -10
- package/lib/components/checkbox/Checkbox.theme.js +52 -0
- package/lib/components/checkbox/Checkbox.vue.d.ts +46 -7
- package/lib/components/checkbox/Checkbox.vue.js +9 -0
- package/lib/components/checkbox/Checkbox.vue2.js +108 -0
- package/lib/components/checkbox/Checkbox.vue3.js +6 -0
- package/lib/components/checkbox/index.d.ts +3 -0
- package/lib/components/collapse/Collapse.theme.d.ts +10 -9
- package/lib/components/collapse/Collapse.theme.js +10 -0
- package/lib/components/collapse/Collapse.vue.d.ts +32 -2
- package/lib/components/collapse/Collapse.vue.js +132 -0
- package/lib/components/collapse/Collapse.vue2.js +4 -0
- package/lib/components/collapse/index.d.ts +3 -0
- package/lib/components/container/Container.theme.d.ts +10 -6
- package/lib/components/container/Container.theme.js +8 -0
- package/lib/components/container/Container.vue.d.ts +16 -1
- package/lib/components/container/Container.vue.js +30 -0
- package/lib/components/container/Container.vue2.js +4 -0
- package/lib/components/container/index.d.ts +3 -0
- package/lib/components/divider/Divider.theme.d.ts +10 -9
- package/lib/components/divider/Divider.theme.js +10 -0
- package/lib/components/divider/Divider.vue.d.ts +7 -1
- package/lib/components/divider/Divider.vue.js +53 -0
- package/lib/components/divider/Divider.vue2.js +4 -0
- package/lib/components/divider/index.d.ts +3 -0
- package/lib/components/drawer/Drawer.theme.d.ts +10 -7
- package/lib/components/drawer/Drawer.theme.js +9 -0
- package/lib/components/drawer/Drawer.vue.d.ts +50 -14
- package/lib/components/drawer/Drawer.vue.js +171 -0
- package/lib/components/drawer/Drawer.vue2.js +4 -0
- package/lib/components/drawer/index.d.ts +3 -0
- package/lib/components/form/Form.theme.d.ts +10 -6
- package/lib/components/form/Form.theme.js +8 -0
- package/lib/components/form/Form.vue.d.ts +34 -6
- package/lib/components/form/Form.vue.js +79 -0
- package/lib/components/form/Form.vue2.js +4 -0
- package/lib/components/form/index.d.ts +3 -0
- package/lib/components/helpers/InputError.d.ts +2 -2
- package/lib/components/helpers/InputError.js +18 -0
- package/lib/components/icon/Icon.theme.d.ts +10 -7
- package/lib/components/icon/Icon.theme.js +11 -0
- package/lib/components/icon/Icon.vue.d.ts +22 -4
- package/lib/components/icon/Icon.vue.js +74 -0
- package/lib/components/icon/Icon.vue2.js +4 -0
- package/lib/components/icon/index.d.ts +3 -0
- package/lib/components/image/Image.theme.d.ts +10 -6
- package/lib/components/image/Image.theme.js +8 -0
- package/lib/components/image/Image.vue.d.ts +6 -1
- package/lib/components/image/Image.vue.js +32 -0
- package/lib/components/image/Image.vue2.js +4 -0
- package/lib/components/image/index.d.ts +3 -0
- package/lib/components/index.d.ts +35 -45
- package/lib/components/index.js +92 -0
- package/lib/components/input/Input.theme.d.ts +12 -10
- package/lib/components/input/Input.theme.js +21 -0
- package/lib/components/input/Input.vue.d.ts +73 -22
- package/lib/components/input/Input.vue.js +140 -0
- package/lib/components/input/Input.vue2.js +4 -0
- package/lib/components/input/index.d.ts +3 -0
- package/lib/components/link/Link.theme.d.ts +10 -8
- package/lib/components/link/Link.theme.js +25 -0
- package/lib/components/link/Link.vue.d.ts +25 -2
- package/lib/components/link/Link.vue.js +9 -0
- package/lib/components/link/Link.vue2.js +48 -0
- package/lib/components/link/Link.vue3.js +8 -0
- package/lib/components/link/index.d.ts +3 -0
- package/lib/components/menu/Menu.theme.d.ts +10 -6
- package/lib/components/menu/Menu.theme.js +8 -0
- package/lib/components/menu/Menu.vue.d.ts +62 -9
- package/lib/components/menu/Menu.vue.js +133 -0
- package/lib/components/menu/Menu.vue2.js +4 -0
- package/lib/components/menu/MenuItem.theme.d.ts +13 -7
- package/lib/components/menu/MenuItem.theme.js +86 -0
- package/lib/components/menu/MenuItem.vue.d.ts +63 -14
- package/lib/components/menu/MenuItem.vue.js +9 -0
- package/lib/components/menu/MenuItem.vue2.js +143 -0
- package/lib/components/menu/MenuItem.vue3.js +7 -0
- package/lib/components/menu/index.d.ts +6 -0
- package/lib/components/modal/Modal.theme.d.ts +10 -13
- package/lib/components/modal/Modal.theme.js +17 -0
- package/lib/components/modal/Modal.vue.d.ts +24 -2
- package/lib/components/modal/Modal.vue.js +127 -0
- package/lib/components/modal/Modal.vue2.js +4 -0
- package/lib/components/modal/index.d.ts +3 -0
- package/lib/components/notifications/Notifications.theme.d.ts +10 -8
- package/lib/components/notifications/Notifications.theme.js +10 -0
- package/lib/components/notifications/Notifications.vue.d.ts +56 -16
- package/lib/components/notifications/Notifications.vue.js +234 -0
- package/lib/components/notifications/Notifications.vue2.js +4 -0
- package/lib/components/notifications/index.d.ts +3 -0
- package/lib/components/pagination/Pagination.theme.d.ts +10 -9
- package/lib/components/pagination/Pagination.theme.js +13 -0
- package/lib/components/pagination/Pagination.vue.d.ts +28 -5
- package/lib/components/pagination/Pagination.vue.js +131 -0
- package/lib/components/pagination/Pagination.vue2.js +4 -0
- package/lib/components/pagination/PaginationItem.theme.d.ts +10 -7
- package/lib/components/pagination/PaginationItem.theme.js +8 -0
- package/lib/components/pagination/PaginationItem.vue.d.ts +17 -2
- package/lib/components/pagination/PaginationItem.vue.js +48 -0
- package/lib/components/pagination/PaginationItem.vue2.js +4 -0
- package/lib/components/pagination/index.d.ts +6 -0
- package/lib/components/popover/Popover.theme.d.ts +10 -7
- package/lib/components/popover/Popover.theme.js +9 -0
- package/lib/components/popover/Popover.vue.d.ts +48 -10
- package/lib/components/popover/Popover.vue.js +9 -0
- package/lib/components/popover/Popover.vue2.js +106 -0
- package/lib/components/popover/Popover.vue3.js +15 -0
- package/lib/components/popover/PopoverContainer.theme.d.ts +10 -6
- package/lib/components/popover/PopoverContainer.theme.js +8 -0
- package/lib/components/popover/PopoverContainer.vue.d.ts +16 -1
- package/lib/components/popover/PopoverContainer.vue.js +30 -0
- package/lib/components/popover/PopoverContainer.vue2.js +4 -0
- package/lib/components/popover/index.d.ts +6 -0
- package/lib/components/progress/Progress.theme.d.ts +10 -10
- package/lib/components/progress/Progress.theme.js +18 -0
- package/lib/components/progress/Progress.vue.d.ts +21 -2
- package/lib/components/progress/Progress.vue.js +51 -0
- package/lib/components/progress/Progress.vue2.js +4 -0
- package/lib/components/progress/index.d.ts +3 -0
- package/lib/components/radio/Radio.theme.d.ts +13 -11
- package/lib/components/radio/Radio.theme.js +67 -0
- package/lib/components/radio/Radio.vue.d.ts +48 -9
- package/lib/components/radio/Radio.vue.js +9 -0
- package/lib/components/radio/Radio.vue2.js +117 -0
- package/lib/components/radio/Radio.vue3.js +10 -0
- package/lib/components/radio/index.d.ts +3 -0
- package/lib/components/scroll/Scroll.theme.d.ts +10 -6
- package/lib/components/scroll/Scroll.theme.js +8 -0
- package/lib/components/scroll/Scroll.vue.d.ts +20 -2
- package/lib/components/scroll/Scroll.vue.js +9 -0
- package/lib/components/scroll/Scroll.vue2.js +64 -0
- package/lib/components/scroll/Scroll.vue3.js +17 -0
- package/lib/components/scroll/index.d.ts +3 -0
- package/lib/components/select/Select.theme.d.ts +13 -12
- package/lib/components/select/Select.theme.js +23 -0
- package/lib/components/select/Select.vue.d.ts +44 -8
- package/lib/components/select/Select.vue.js +269 -0
- package/lib/components/select/Select.vue2.js +4 -0
- package/lib/components/select/index.d.ts +3 -0
- package/lib/components/skeleton/Skeleton.theme.d.ts +10 -6
- package/lib/components/skeleton/Skeleton.theme.js +8 -0
- package/lib/components/skeleton/Skeleton.vue.d.ts +9 -1
- package/lib/components/skeleton/Skeleton.vue.js +30 -0
- package/lib/components/skeleton/Skeleton.vue2.js +4 -0
- package/lib/components/skeleton/index.d.ts +3 -0
- package/lib/components/slider/Slider.theme.d.ts +10 -10
- package/lib/components/slider/Slider.theme.js +20 -0
- package/lib/components/slider/Slider.vue.d.ts +55 -7
- package/lib/components/slider/Slider.vue.js +148 -0
- package/lib/components/slider/Slider.vue2.js +4 -0
- package/lib/components/slider/index.d.ts +2 -0
- package/lib/components/spacer/Spacer.d.ts +1 -1
- package/lib/components/spacer/Spacer.js +12 -0
- package/lib/components/spacer/index.d.ts +1 -0
- package/lib/components/spinner/Spinner.vue.d.ts +14 -1
- package/lib/components/spinner/Spinner.vue.js +28 -0
- package/lib/components/spinner/Spinner.vue2.js +4 -0
- package/lib/components/spinner/index.d.ts +2 -0
- package/lib/components/tab/Tab.theme.d.ts +12 -9
- package/lib/components/tab/Tab.theme.js +13 -0
- package/lib/components/tab/Tab.vue.d.ts +44 -9
- package/lib/components/tab/Tab.vue.js +129 -0
- package/lib/components/tab/Tab.vue2.js +4 -0
- package/lib/components/tab/TabGroup.theme.d.ts +10 -10
- package/lib/components/tab/TabGroup.theme.js +27 -0
- package/lib/components/tab/TabGroup.vue.d.ts +61 -9
- package/lib/components/tab/TabGroup.vue.js +133 -0
- package/lib/components/tab/TabGroup.vue2.js +4 -0
- package/lib/components/tab/index.d.ts +4 -0
- package/lib/components/table/Table.theme.d.ts +10 -8
- package/lib/components/table/Table.theme.js +12 -0
- package/lib/components/table/Table.vue.d.ts +269 -51
- package/lib/components/table/Table.vue.js +147 -0
- package/lib/components/table/Table.vue2.js +4 -0
- package/lib/components/table/TableBody.d.ts +1 -1
- package/lib/components/table/TableBody.js +15 -0
- package/lib/components/table/TableCell.theme.d.ts +10 -7
- package/lib/components/table/TableCell.theme.js +11 -0
- package/lib/components/table/TableCell.vue.d.ts +35 -6
- package/lib/components/table/TableCell.vue.js +43 -0
- package/lib/components/table/TableCell.vue2.js +4 -0
- package/lib/components/table/TableHead.d.ts +1 -1
- package/lib/components/table/TableHead.js +19 -0
- package/lib/components/table/TableHeader.vue.d.ts +34 -9
- package/lib/components/table/TableHeader.vue.js +78 -0
- package/lib/components/table/TableHeader.vue2.js +4 -0
- package/lib/components/table/TableRow.vue.d.ts +8 -1
- package/lib/components/table/TableRow.vue.js +32 -0
- package/lib/components/table/TableRow.vue2.js +4 -0
- package/lib/components/table/index.d.ts +9 -0
- package/lib/components/tag/Tag.theme.d.ts +10 -9
- package/lib/components/tag/Tag.theme.js +23 -0
- package/lib/components/tag/Tag.vue.d.ts +31 -4
- package/lib/components/tag/Tag.vue.js +61 -0
- package/lib/components/tag/Tag.vue2.js +4 -0
- package/lib/components/tag/index.d.ts +2 -0
- package/lib/components/textarea/Textarea.theme.d.ts +13 -9
- package/lib/components/textarea/Textarea.theme.js +16 -0
- package/lib/components/textarea/Textarea.vue.d.ts +59 -17
- package/lib/components/textarea/Textarea.vue.js +110 -0
- package/lib/components/textarea/Textarea.vue2.js +4 -0
- package/lib/components/textarea/index.d.ts +2 -0
- package/lib/components/toggle/Toggle.theme.d.ts +10 -11
- package/lib/components/toggle/Toggle.theme.js +29 -0
- package/lib/components/toggle/Toggle.vue.d.ts +39 -7
- package/lib/components/toggle/Toggle.vue.js +110 -0
- package/lib/components/toggle/Toggle.vue2.js +4 -0
- package/lib/components/toggle/index.d.ts +2 -0
- package/lib/components/tooltip/Tooltip.vue.d.ts +12 -1
- package/lib/components/tooltip/Tooltip.vue.js +27 -0
- package/lib/components/tooltip/Tooltip.vue2.js +4 -0
- package/lib/components/tooltip/index.d.ts +2 -0
- package/lib/composables/colors-utils.js +19 -0
- package/lib/composables/colors.d.ts +6 -4
- package/lib/composables/colors.js +52 -0
- package/lib/composables/common.d.ts +1 -1
- package/lib/composables/common.js +17 -0
- package/lib/composables/css.d.ts +1 -1
- package/lib/composables/css.js +26 -0
- package/lib/composables/inputtable.d.ts +4 -4
- package/lib/composables/inputtable.js +78 -0
- package/lib/composables/interactive.js +17 -0
- package/lib/composables/keys.d.ts +6 -3
- package/lib/composables/keys.js +10 -0
- package/lib/composables/notifications.d.ts +1 -1
- package/lib/composables/notifications.js +9 -0
- package/lib/composables/theme.d.ts +13 -7
- package/lib/composables/theme.js +59 -0
- package/lib/create.d.ts +1 -1
- package/lib/create.js +19 -0
- package/lib/index.js +121 -0
- package/lib/index.umd.js +1 -0
- package/lib/install.js +10 -0
- package/lib/node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.3.4/node_modules/@vueuse/core/index.js +379 -0
- package/lib/node_modules/.pnpm/@vueuse_shared@10.2.0_vue@3.3.4/node_modules/@vueuse/shared/index.js +90 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +4 -0
- package/package.json +54 -54
- package/src/common/utils.ts +25 -2
- package/src/components/alert/Alert.theme.ts +15 -6
- package/src/components/alert/Alert.vue +26 -13
- package/src/components/alert/index.ts +3 -0
- package/src/components/avatar/Avatar.theme.ts +16 -4
- package/src/components/avatar/Avatar.vue +20 -15
- package/src/components/avatar/index.ts +3 -0
- package/src/components/badge/Badge.theme.ts +13 -3
- package/src/components/badge/Badge.vue +30 -15
- package/src/components/badge/index.ts +3 -0
- package/src/components/breadcrumbs/Breadcrumbs.theme.ts +12 -2
- package/src/components/breadcrumbs/Breadcrumbs.vue +24 -21
- package/src/components/breadcrumbs/index.ts +3 -0
- package/src/components/button/Button.theme.ts +23 -19
- package/src/components/button/Button.vue +30 -19
- package/src/components/button/ButtonGroup.theme.ts +14 -1
- package/src/components/button/ButtonGroup.vue +33 -19
- package/src/components/button/index.ts +7 -0
- package/src/components/card/Card.theme.ts +13 -3
- package/src/components/card/Card.vue +12 -7
- package/src/components/card/index.ts +3 -0
- package/src/components/checkbox/Checkbox.theme.ts +19 -7
- package/src/components/checkbox/Checkbox.vue +21 -12
- package/src/components/checkbox/index.ts +3 -0
- package/src/components/collapse/Collapse.theme.ts +13 -3
- package/src/components/collapse/Collapse.vue +28 -24
- package/src/components/collapse/index.ts +3 -0
- package/src/components/container/Container.theme.ts +12 -2
- package/src/components/container/Container.vue +11 -6
- package/src/components/container/index.ts +3 -0
- package/src/components/divider/Divider.theme.ts +13 -3
- package/src/components/divider/Divider.vue +9 -4
- package/src/components/divider/index.ts +3 -0
- package/src/components/drawer/Drawer.theme.ts +12 -2
- package/src/components/drawer/Drawer.vue +50 -41
- package/src/components/drawer/index.ts +3 -0
- package/src/components/form/Form.theme.ts +12 -2
- package/src/components/form/Form.vue +40 -31
- package/src/components/form/index.ts +3 -0
- package/src/components/helpers/InputError.tsx +2 -2
- package/src/components/icon/Icon.theme.ts +13 -3
- package/src/components/icon/Icon.vue +24 -15
- package/src/components/icon/__tests__/Icon.spec.ts +5 -1
- package/src/components/icon/index.ts +3 -0
- package/src/components/image/Image.theme.ts +12 -2
- package/src/components/image/Image.vue +8 -4
- package/src/components/image/index.ts +3 -0
- package/src/components/index.ts +35 -45
- package/src/components/input/Input.theme.ts +17 -6
- package/src/components/input/Input.vue +33 -22
- package/src/components/input/index.ts +3 -0
- package/src/components/link/Link.theme.ts +13 -3
- package/src/components/link/Link.vue +20 -12
- package/src/components/link/index.ts +3 -0
- package/src/components/menu/Menu.theme.ts +12 -2
- package/src/components/menu/Menu.vue +59 -23
- package/src/components/menu/MenuItem.theme.ts +17 -5
- package/src/components/menu/MenuItem.vue +65 -52
- package/src/components/menu/index.ts +7 -0
- package/src/components/modal/Modal.theme.ts +13 -3
- package/src/components/modal/Modal.vue +23 -12
- package/src/components/modal/index.ts +3 -0
- package/src/components/notifications/Notifications.theme.ts +12 -2
- package/src/components/notifications/Notifications.vue +53 -49
- package/src/components/notifications/index.ts +9 -0
- package/src/components/pagination/Pagination.theme.ts +15 -5
- package/src/components/pagination/Pagination.vue +24 -18
- package/src/components/pagination/PaginationItem.theme.ts +13 -3
- package/src/components/pagination/PaginationItem.vue +14 -10
- package/src/components/pagination/index.ts +7 -0
- package/src/components/popover/Popover.theme.ts +12 -2
- package/src/components/popover/Popover.vue +56 -46
- package/src/components/popover/PopoverContainer.theme.ts +12 -2
- package/src/components/popover/PopoverContainer.vue +11 -6
- package/src/components/popover/index.ts +7 -0
- package/src/components/progress/Progress.theme.ts +14 -4
- package/src/components/progress/Progress.vue +16 -16
- package/src/components/progress/index.ts +3 -0
- package/src/components/radio/Radio.theme.ts +19 -7
- package/src/components/radio/Radio.vue +24 -14
- package/src/components/radio/index.ts +3 -0
- package/src/components/scroll/Scroll.theme.ts +12 -2
- package/src/components/scroll/Scroll.vue +37 -26
- package/src/components/scroll/index.ts +3 -0
- package/src/components/select/Select.theme.ts +20 -6
- package/src/components/select/Select.vue +28 -20
- package/src/components/select/index.ts +3 -0
- package/src/components/skeleton/Skeleton.theme.ts +12 -2
- package/src/components/skeleton/Skeleton.vue +11 -6
- package/src/components/skeleton/index.ts +3 -0
- package/src/components/slider/Slider.theme.ts +14 -4
- package/src/components/slider/Slider.vue +24 -16
- package/src/components/slider/index.ts +2 -0
- package/src/components/spacer/index.ts +1 -0
- package/src/components/spinner/Spinner.vue +18 -8
- package/src/components/spinner/index.ts +2 -0
- package/src/components/tab/Tab.theme.ts +15 -3
- package/src/components/tab/Tab.vue +85 -68
- package/src/components/tab/TabGroup.theme.ts +15 -5
- package/src/components/tab/TabGroup.vue +67 -22
- package/src/components/tab/index.ts +5 -0
- package/src/components/table/Table.theme.ts +14 -4
- package/src/components/table/Table.vue +41 -31
- package/src/components/table/TableCell.theme.ts +13 -3
- package/src/components/table/TableCell.vue +22 -16
- package/src/components/table/TableHeader.vue +20 -17
- package/src/components/table/TableRow.vue +1 -1
- package/src/components/table/index.ts +10 -0
- package/src/components/tag/Tag.theme.ts +14 -4
- package/src/components/tag/Tag.vue +22 -13
- package/src/components/tag/index.ts +2 -0
- package/src/components/textarea/Textarea.theme.ts +18 -30
- package/src/components/textarea/Textarea.vue +28 -19
- package/src/components/textarea/index.ts +2 -0
- package/src/components/toggle/Toggle.theme.ts +16 -6
- package/src/components/toggle/Toggle.vue +21 -12
- package/src/components/toggle/index.ts +2 -0
- package/src/components/tooltip/Tooltip.vue +5 -0
- package/src/components/tooltip/index.ts +2 -0
- package/src/composables/colors-utils.ts +4 -346
- package/src/composables/colors.ts +21 -17
- package/src/composables/common.ts +1 -1
- package/src/composables/css.ts +4 -4
- package/src/composables/inputtable.ts +8 -8
- package/src/composables/interactive.ts +2 -2
- package/src/composables/keys.ts +6 -3
- package/src/composables/theme.ts +30 -27
- package/src/create.ts +6 -7
- package/src/version.ts +1 -1
- package/volar.d.ts +0 -2
- package/lib/components/tooltip/Tooltip.theme.d.ts +0 -11
- package/lib/index.cjs.js +0 -1
- package/lib/index.es.js +0 -7184
- package/lib/nuxt.js +0 -33
- package/src/components/tooltip/Tooltip.theme.ts +0 -51
- package/src/exports/nuxt.plugin.js +0 -8
- package/src/exports/tailwind.preset.js +0 -55
- /package/{lib → exports}/tailwind.preset.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tone, ColorLibrary
|
|
1
|
+
import type { Tone, ColorLibrary } from './colors'
|
|
2
2
|
|
|
3
3
|
const isHex = (hex: string) => /^#(?:[A-Fa-f0-9]{3}){1,2}$/.test(hex)
|
|
4
4
|
const isRGB = (rgb: string) => /^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/.test(rgb)
|
|
@@ -9,7 +9,7 @@ const hexToRGB = (hex: string) => hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i
|
|
|
9
9
|
?.map((x) => parseInt(x, 16))
|
|
10
10
|
|
|
11
11
|
export const setOpacity = (color: string, opacity: number) => {
|
|
12
|
-
const [r, g, b] = (isHex(color) ? hexToRGB(color) : parseRGB(color)) ?? [0,0,0]
|
|
12
|
+
const [r, g, b] = (isHex(color) ? hexToRGB(color) : parseRGB(color)) ?? [0, 0, 0]
|
|
13
13
|
|
|
14
14
|
return 'rgba' + '(' + r + ',' + g + ',' + b + ',' + opacity + ')'
|
|
15
15
|
}
|
|
@@ -22,7 +22,7 @@ export const colorShade = (color: string, percentage: number) => {
|
|
|
22
22
|
const shade = lighten ? 0 : percentage * 255 ** 2
|
|
23
23
|
const calcPrimary = (p: string | number) => Math.round((base * Math.floor(Number(p)) ** 2 + shade) ** 0.5)
|
|
24
24
|
|
|
25
|
-
const [r, g, b, a] = (isHex(color) ? hexToRGB(color) : parseRGB(color)) ?? [0,0,0]
|
|
25
|
+
const [r, g, b, a] = (isHex(color) ? hexToRGB(color) : parseRGB(color)) ?? [0, 0, 0]
|
|
26
26
|
const red = calcPrimary(r)
|
|
27
27
|
const green = calcPrimary(g)
|
|
28
28
|
const blue = calcPrimary(b)
|
|
@@ -33,346 +33,4 @@ export const colorShade = (color: string, percentage: number) => {
|
|
|
33
33
|
export const shades: Tone[] = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900']
|
|
34
34
|
export const indielayerColors = ['primary', 'secondary', 'success', 'warning', 'error']
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
// export function calculateColors(): ColorLibrary {
|
|
38
|
-
// const cc = computedColors
|
|
39
|
-
// const customColors: ColorLibrary = {}
|
|
40
|
-
// const e = document.createElement('div')
|
|
41
|
-
|
|
42
|
-
// document.body.appendChild(e)
|
|
43
|
-
|
|
44
|
-
// indielayerColors.forEach((color) => {
|
|
45
|
-
// const c: ColorPalette = { ...tailwindColors.gray }
|
|
46
|
-
|
|
47
|
-
// shades.forEach((shade) => {
|
|
48
|
-
// e.className = `bg-${color}-${shade}`
|
|
49
|
-
// c[shade] = window.getComputedStyle(e ,null).getPropertyValue('background-color')
|
|
50
|
-
// })
|
|
51
|
-
|
|
52
|
-
// customColors[color] = c
|
|
53
|
-
// })
|
|
54
|
-
|
|
55
|
-
// e.remove()
|
|
56
|
-
|
|
57
|
-
// return customColors
|
|
58
|
-
// }
|
|
59
|
-
|
|
60
|
-
// const computedColors = Object.freeze([
|
|
61
|
-
// 'bg-primary-50',
|
|
62
|
-
// 'bg-primary-100',
|
|
63
|
-
// 'bg-primary-200',
|
|
64
|
-
// 'bg-primary-300',
|
|
65
|
-
// 'bg-primary-400',
|
|
66
|
-
// 'bg-primary-500',
|
|
67
|
-
// 'bg-primary-600',
|
|
68
|
-
// 'bg-primary-700',
|
|
69
|
-
// 'bg-primary-800',
|
|
70
|
-
// 'bg-primary-900',
|
|
71
|
-
// 'bg-secondary-50',
|
|
72
|
-
// 'bg-secondary-100',
|
|
73
|
-
// 'bg-secondary-200',
|
|
74
|
-
// 'bg-secondary-300',
|
|
75
|
-
// 'bg-secondary-400',
|
|
76
|
-
// 'bg-secondary-500',
|
|
77
|
-
// 'bg-secondary-600',
|
|
78
|
-
// 'bg-secondary-700',
|
|
79
|
-
// 'bg-secondary-800',
|
|
80
|
-
// 'bg-secondary-900',
|
|
81
|
-
// 'bg-error-50',
|
|
82
|
-
// 'bg-error-100',
|
|
83
|
-
// 'bg-error-200',
|
|
84
|
-
// 'bg-error-300',
|
|
85
|
-
// 'bg-error-400',
|
|
86
|
-
// 'bg-error-500',
|
|
87
|
-
// 'bg-error-600',
|
|
88
|
-
// 'bg-error-700',
|
|
89
|
-
// 'bg-error-800',
|
|
90
|
-
// 'bg-error-900',
|
|
91
|
-
// 'bg-warning-50',
|
|
92
|
-
// 'bg-warning-100',
|
|
93
|
-
// 'bg-warning-200',
|
|
94
|
-
// 'bg-warning-300',
|
|
95
|
-
// 'bg-warning-400',
|
|
96
|
-
// 'bg-warning-500',
|
|
97
|
-
// 'bg-warning-600',
|
|
98
|
-
// 'bg-warning-700',
|
|
99
|
-
// 'bg-warning-800',
|
|
100
|
-
// 'bg-warning-900',
|
|
101
|
-
// 'bg-success-50',
|
|
102
|
-
// 'bg-success-100',
|
|
103
|
-
// 'bg-success-200',
|
|
104
|
-
// 'bg-success-300',
|
|
105
|
-
// 'bg-success-400',
|
|
106
|
-
// 'bg-success-500',
|
|
107
|
-
// 'bg-success-600',
|
|
108
|
-
// 'bg-success-700',
|
|
109
|
-
// 'bg-success-800',
|
|
110
|
-
// 'bg-success-900',
|
|
111
|
-
// ])
|
|
112
|
-
|
|
113
|
-
export const tailwindColors: ColorLibrary = Object.freeze({
|
|
114
|
-
slate: {
|
|
115
|
-
50: '#f8fafc',
|
|
116
|
-
100: '#f1f5f9',
|
|
117
|
-
200: '#e2e8f0',
|
|
118
|
-
300: '#cbd5e1',
|
|
119
|
-
400: '#94a3b8',
|
|
120
|
-
500: '#64748b',
|
|
121
|
-
600: '#475569',
|
|
122
|
-
700: '#334155',
|
|
123
|
-
800: '#1e293b',
|
|
124
|
-
900: '#0f172a',
|
|
125
|
-
},
|
|
126
|
-
gray: {
|
|
127
|
-
50: '#f9fafb',
|
|
128
|
-
100: '#f3f4f6',
|
|
129
|
-
200: '#e5e7eb',
|
|
130
|
-
300: '#d1d5db',
|
|
131
|
-
400: '#9ca3af',
|
|
132
|
-
500: '#6b7280',
|
|
133
|
-
600: '#4b5563',
|
|
134
|
-
700: '#374151',
|
|
135
|
-
800: '#1f2937',
|
|
136
|
-
900: '#111827',
|
|
137
|
-
},
|
|
138
|
-
zinc: {
|
|
139
|
-
50: '#fafafa',
|
|
140
|
-
100: '#f4f4f5',
|
|
141
|
-
200: '#e4e4e7',
|
|
142
|
-
300: '#d4d4d8',
|
|
143
|
-
400: '#a1a1aa',
|
|
144
|
-
500: '#71717a',
|
|
145
|
-
600: '#52525b',
|
|
146
|
-
700: '#3f3f46',
|
|
147
|
-
800: '#27272a',
|
|
148
|
-
900: '#18181b',
|
|
149
|
-
},
|
|
150
|
-
neutral: {
|
|
151
|
-
50: '#fafafa',
|
|
152
|
-
100: '#f5f5f5',
|
|
153
|
-
200: '#e5e5e5',
|
|
154
|
-
300: '#d4d4d4',
|
|
155
|
-
400: '#a3a3a3',
|
|
156
|
-
500: '#737373',
|
|
157
|
-
600: '#525252',
|
|
158
|
-
700: '#404040',
|
|
159
|
-
800: '#262626',
|
|
160
|
-
900: '#171717',
|
|
161
|
-
},
|
|
162
|
-
stone: {
|
|
163
|
-
50: '#fafaf9',
|
|
164
|
-
100: '#f5f5f4',
|
|
165
|
-
200: '#e7e5e4',
|
|
166
|
-
300: '#d6d3d1',
|
|
167
|
-
400: '#a8a29e',
|
|
168
|
-
500: '#78716c',
|
|
169
|
-
600: '#57534e',
|
|
170
|
-
700: '#44403c',
|
|
171
|
-
800: '#292524',
|
|
172
|
-
900: '#1c1917',
|
|
173
|
-
},
|
|
174
|
-
red: {
|
|
175
|
-
50: '#fef2f2',
|
|
176
|
-
100: '#fee2e2',
|
|
177
|
-
200: '#fecaca',
|
|
178
|
-
300: '#fca5a5',
|
|
179
|
-
400: '#f87171',
|
|
180
|
-
500: '#ef4444',
|
|
181
|
-
600: '#dc2626',
|
|
182
|
-
700: '#b91c1c',
|
|
183
|
-
800: '#991b1b',
|
|
184
|
-
900: '#7f1d1d',
|
|
185
|
-
},
|
|
186
|
-
orange: {
|
|
187
|
-
50: '#fff7ed',
|
|
188
|
-
100: '#ffedd5',
|
|
189
|
-
200: '#fed7aa',
|
|
190
|
-
300: '#fdba74',
|
|
191
|
-
400: '#fb923c',
|
|
192
|
-
500: '#f97316',
|
|
193
|
-
600: '#ea580c',
|
|
194
|
-
700: '#c2410c',
|
|
195
|
-
800: '#9a3412',
|
|
196
|
-
900: '#7c2d12',
|
|
197
|
-
},
|
|
198
|
-
amber: {
|
|
199
|
-
50: '#fffbeb',
|
|
200
|
-
100: '#fef3c7',
|
|
201
|
-
200: '#fde68a',
|
|
202
|
-
300: '#fcd34d',
|
|
203
|
-
400: '#fbbf24',
|
|
204
|
-
500: '#f59e0b',
|
|
205
|
-
600: '#d97706',
|
|
206
|
-
700: '#b45309',
|
|
207
|
-
800: '#92400e',
|
|
208
|
-
900: '#78350f',
|
|
209
|
-
},
|
|
210
|
-
yellow: {
|
|
211
|
-
50: '#fefce8',
|
|
212
|
-
100: '#fef9c3',
|
|
213
|
-
200: '#fef08a',
|
|
214
|
-
300: '#fde047',
|
|
215
|
-
400: '#facc15',
|
|
216
|
-
500: '#eab308',
|
|
217
|
-
600: '#ca8a04',
|
|
218
|
-
700: '#a16207',
|
|
219
|
-
800: '#854d0e',
|
|
220
|
-
900: '#713f12',
|
|
221
|
-
},
|
|
222
|
-
lime: {
|
|
223
|
-
50: '#f7fee7',
|
|
224
|
-
100: '#ecfccb',
|
|
225
|
-
200: '#d9f99d',
|
|
226
|
-
300: '#bef264',
|
|
227
|
-
400: '#a3e635',
|
|
228
|
-
500: '#84cc16',
|
|
229
|
-
600: '#65a30d',
|
|
230
|
-
700: '#4d7c0f',
|
|
231
|
-
800: '#3f6212',
|
|
232
|
-
900: '#365314',
|
|
233
|
-
},
|
|
234
|
-
green: {
|
|
235
|
-
50: '#f0fdf4',
|
|
236
|
-
100: '#dcfce7',
|
|
237
|
-
200: '#bbf7d0',
|
|
238
|
-
300: '#86efac',
|
|
239
|
-
400: '#4ade80',
|
|
240
|
-
500: '#22c55e',
|
|
241
|
-
600: '#16a34a',
|
|
242
|
-
700: '#15803d',
|
|
243
|
-
800: '#166534',
|
|
244
|
-
900: '#14532d',
|
|
245
|
-
},
|
|
246
|
-
emerald: {
|
|
247
|
-
50: '#ecfdf5',
|
|
248
|
-
100: '#d1fae5',
|
|
249
|
-
200: '#a7f3d0',
|
|
250
|
-
300: '#6ee7b7',
|
|
251
|
-
400: '#34d399',
|
|
252
|
-
500: '#10b981',
|
|
253
|
-
600: '#059669',
|
|
254
|
-
700: '#047857',
|
|
255
|
-
800: '#065f46',
|
|
256
|
-
900: '#064e3b',
|
|
257
|
-
},
|
|
258
|
-
teal: {
|
|
259
|
-
50: '#f0fdfa',
|
|
260
|
-
100: '#ccfbf1',
|
|
261
|
-
200: '#99f6e4',
|
|
262
|
-
300: '#5eead4',
|
|
263
|
-
400: '#2dd4bf',
|
|
264
|
-
500: '#14b8a6',
|
|
265
|
-
600: '#0d9488',
|
|
266
|
-
700: '#0f766e',
|
|
267
|
-
800: '#115e59',
|
|
268
|
-
900: '#134e4a',
|
|
269
|
-
},
|
|
270
|
-
cyan: {
|
|
271
|
-
50: '#ecfeff',
|
|
272
|
-
100: '#cffafe',
|
|
273
|
-
200: '#a5f3fc',
|
|
274
|
-
300: '#67e8f9',
|
|
275
|
-
400: '#22d3ee',
|
|
276
|
-
500: '#06b6d4',
|
|
277
|
-
600: '#0891b2',
|
|
278
|
-
700: '#0e7490',
|
|
279
|
-
800: '#155e75',
|
|
280
|
-
900: '#164e63',
|
|
281
|
-
},
|
|
282
|
-
sky: {
|
|
283
|
-
50: '#f0f9ff',
|
|
284
|
-
100: '#e0f2fe',
|
|
285
|
-
200: '#bae6fd',
|
|
286
|
-
300: '#7dd3fc',
|
|
287
|
-
400: '#38bdf8',
|
|
288
|
-
500: '#0ea5e9',
|
|
289
|
-
600: '#0284c7',
|
|
290
|
-
700: '#0369a1',
|
|
291
|
-
800: '#075985',
|
|
292
|
-
900: '#0c4a6e',
|
|
293
|
-
},
|
|
294
|
-
blue: {
|
|
295
|
-
50: '#eff6ff',
|
|
296
|
-
100: '#dbeafe',
|
|
297
|
-
200: '#bfdbfe',
|
|
298
|
-
300: '#93c5fd',
|
|
299
|
-
400: '#60a5fa',
|
|
300
|
-
500: '#3b82f6',
|
|
301
|
-
600: '#2563eb',
|
|
302
|
-
700: '#1d4ed8',
|
|
303
|
-
800: '#1e40af',
|
|
304
|
-
900: '#1e3a8a',
|
|
305
|
-
},
|
|
306
|
-
indigo: {
|
|
307
|
-
50: '#eef2ff',
|
|
308
|
-
100: '#e0e7ff',
|
|
309
|
-
200: '#c7d2fe',
|
|
310
|
-
300: '#a5b4fc',
|
|
311
|
-
400: '#818cf8',
|
|
312
|
-
500: '#6366f1',
|
|
313
|
-
600: '#4f46e5',
|
|
314
|
-
700: '#4338ca',
|
|
315
|
-
800: '#3730a3',
|
|
316
|
-
900: '#312e81',
|
|
317
|
-
},
|
|
318
|
-
violet: {
|
|
319
|
-
50: '#f5f3ff',
|
|
320
|
-
100: '#ede9fe',
|
|
321
|
-
200: '#ddd6fe',
|
|
322
|
-
300: '#c4b5fd',
|
|
323
|
-
400: '#a78bfa',
|
|
324
|
-
500: '#8b5cf6',
|
|
325
|
-
600: '#7c3aed',
|
|
326
|
-
700: '#6d28d9',
|
|
327
|
-
800: '#5b21b6',
|
|
328
|
-
900: '#4c1d95',
|
|
329
|
-
},
|
|
330
|
-
purple: {
|
|
331
|
-
50: '#faf5ff',
|
|
332
|
-
100: '#f3e8ff',
|
|
333
|
-
200: '#e9d5ff',
|
|
334
|
-
300: '#d8b4fe',
|
|
335
|
-
400: '#c084fc',
|
|
336
|
-
500: '#a855f7',
|
|
337
|
-
600: '#9333ea',
|
|
338
|
-
700: '#7e22ce',
|
|
339
|
-
800: '#6b21a8',
|
|
340
|
-
900: '#581c87',
|
|
341
|
-
},
|
|
342
|
-
fuchsia: {
|
|
343
|
-
50: '#fdf4ff',
|
|
344
|
-
100: '#fae8ff',
|
|
345
|
-
200: '#f5d0fe',
|
|
346
|
-
300: '#f0abfc',
|
|
347
|
-
400: '#e879f9',
|
|
348
|
-
500: '#d946ef',
|
|
349
|
-
600: '#c026d3',
|
|
350
|
-
700: '#a21caf',
|
|
351
|
-
800: '#86198f',
|
|
352
|
-
900: '#701a75',
|
|
353
|
-
},
|
|
354
|
-
pink: {
|
|
355
|
-
50: '#fdf2f8',
|
|
356
|
-
100: '#fce7f3',
|
|
357
|
-
200: '#fbcfe8',
|
|
358
|
-
300: '#f9a8d4',
|
|
359
|
-
400: '#f472b6',
|
|
360
|
-
500: '#ec4899',
|
|
361
|
-
600: '#db2777',
|
|
362
|
-
700: '#be185d',
|
|
363
|
-
800: '#9d174d',
|
|
364
|
-
900: '#831843',
|
|
365
|
-
},
|
|
366
|
-
rose: {
|
|
367
|
-
50: '#fff1f2',
|
|
368
|
-
100: '#ffe4e6',
|
|
369
|
-
200: '#fecdd3',
|
|
370
|
-
300: '#fda4af',
|
|
371
|
-
400: '#fb7185',
|
|
372
|
-
500: '#f43f5e',
|
|
373
|
-
600: '#e11d48',
|
|
374
|
-
700: '#be123c',
|
|
375
|
-
800: '#9f1239',
|
|
376
|
-
900: '#881337',
|
|
377
|
-
},
|
|
378
|
-
})
|
|
36
|
+
export const tailwindColors: ColorLibrary = Object.freeze({ 'slate': { '50': '#f8fafc', '100': '#f1f5f9', '200': '#e2e8f0', '300': '#cbd5e1', '400': '#94a3b8', '500': '#64748b', '600': '#475569', '700': '#334155', '800': '#1e293b', '900': '#0f172a', '950': '#020617' }, 'gray': { '50': '#f9fafb', '100': '#f3f4f6', '200': '#e5e7eb', '300': '#d1d5db', '400': '#9ca3af', '500': '#6b7280', '600': '#4b5563', '700': '#374151', '800': '#1f2937', '900': '#111827', '950': '#030712' }, 'zinc': { '50': '#fafafa', '100': '#f4f4f5', '200': '#e4e4e7', '300': '#d4d4d8', '400': '#a1a1aa', '500': '#71717a', '600': '#52525b', '700': '#3f3f46', '800': '#27272a', '900': '#18181b', '950': '#09090b' }, 'neutral': { '50': '#fafafa', '100': '#f5f5f5', '200': '#e5e5e5', '300': '#d4d4d4', '400': '#a3a3a3', '500': '#737373', '600': '#525252', '700': '#404040', '800': '#262626', '900': '#171717', '950': '#0a0a0a' }, 'stone': { '50': '#fafaf9', '100': '#f5f5f4', '200': '#e7e5e4', '300': '#d6d3d1', '400': '#a8a29e', '500': '#78716c', '600': '#57534e', '700': '#44403c', '800': '#292524', '900': '#1c1917', '950': '#0c0a09' }, 'red': { '50': '#fef2f2', '100': '#fee2e2', '200': '#fecaca', '300': '#fca5a5', '400': '#f87171', '500': '#ef4444', '600': '#dc2626', '700': '#b91c1c', '800': '#991b1b', '900': '#7f1d1d', '950': '#450a0a' }, 'orange': { '50': '#fff7ed', '100': '#ffedd5', '200': '#fed7aa', '300': '#fdba74', '400': '#fb923c', '500': '#f97316', '600': '#ea580c', '700': '#c2410c', '800': '#9a3412', '900': '#7c2d12', '950': '#431407' }, 'amber': { '50': '#fffbeb', '100': '#fef3c7', '200': '#fde68a', '300': '#fcd34d', '400': '#fbbf24', '500': '#f59e0b', '600': '#d97706', '700': '#b45309', '800': '#92400e', '900': '#78350f', '950': '#451a03' }, 'yellow': { '50': '#fefce8', '100': '#fef9c3', '200': '#fef08a', '300': '#fde047', '400': '#facc15', '500': '#eab308', '600': '#ca8a04', '700': '#a16207', '800': '#854d0e', '900': '#713f12', '950': '#422006' }, 'lime': { '50': '#f7fee7', '100': '#ecfccb', '200': '#d9f99d', '300': '#bef264', '400': '#a3e635', '500': '#84cc16', '600': '#65a30d', '700': '#4d7c0f', '800': '#3f6212', '900': '#365314', '950': '#1a2e05' }, 'green': { '50': '#f0fdf4', '100': '#dcfce7', '200': '#bbf7d0', '300': '#86efac', '400': '#4ade80', '500': '#22c55e', '600': '#16a34a', '700': '#15803d', '800': '#166534', '900': '#14532d', '950': '#052e16' }, 'emerald': { '50': '#ecfdf5', '100': '#d1fae5', '200': '#a7f3d0', '300': '#6ee7b7', '400': '#34d399', '500': '#10b981', '600': '#059669', '700': '#047857', '800': '#065f46', '900': '#064e3b', '950': '#022c22' }, 'teal': { '50': '#f0fdfa', '100': '#ccfbf1', '200': '#99f6e4', '300': '#5eead4', '400': '#2dd4bf', '500': '#14b8a6', '600': '#0d9488', '700': '#0f766e', '800': '#115e59', '900': '#134e4a', '950': '#042f2e' }, 'cyan': { '50': '#ecfeff', '100': '#cffafe', '200': '#a5f3fc', '300': '#67e8f9', '400': '#22d3ee', '500': '#06b6d4', '600': '#0891b2', '700': '#0e7490', '800': '#155e75', '900': '#164e63', '950': '#083344' }, 'sky': { '50': '#f0f9ff', '100': '#e0f2fe', '200': '#bae6fd', '300': '#7dd3fc', '400': '#38bdf8', '500': '#0ea5e9', '600': '#0284c7', '700': '#0369a1', '800': '#075985', '900': '#0c4a6e', '950': '#082f49' }, 'blue': { '50': '#eff6ff', '100': '#dbeafe', '200': '#bfdbfe', '300': '#93c5fd', '400': '#60a5fa', '500': '#3b82f6', '600': '#2563eb', '700': '#1d4ed8', '800': '#1e40af', '900': '#1e3a8a', '950': '#172554' }, 'indigo': { '50': '#eef2ff', '100': '#e0e7ff', '200': '#c7d2fe', '300': '#a5b4fc', '400': '#818cf8', '500': '#6366f1', '600': '#4f46e5', '700': '#4338ca', '800': '#3730a3', '900': '#312e81', '950': '#1e1b4b' }, 'violet': { '50': '#f5f3ff', '100': '#ede9fe', '200': '#ddd6fe', '300': '#c4b5fd', '400': '#a78bfa', '500': '#8b5cf6', '600': '#7c3aed', '700': '#6d28d9', '800': '#5b21b6', '900': '#4c1d95', '950': '#2e1065' }, 'purple': { '50': '#faf5ff', '100': '#f3e8ff', '200': '#e9d5ff', '300': '#d8b4fe', '400': '#c084fc', '500': '#a855f7', '600': '#9333ea', '700': '#7e22ce', '800': '#6b21a8', '900': '#581c87', '950': '#3b0764' }, 'fuchsia': { '50': '#fdf4ff', '100': '#fae8ff', '200': '#f5d0fe', '300': '#f0abfc', '400': '#e879f9', '500': '#d946ef', '600': '#c026d3', '700': '#a21caf', '800': '#86198f', '900': '#701a75', '950': '#4a044e' }, 'pink': { '50': '#fdf2f8', '100': '#fce7f3', '200': '#fbcfe8', '300': '#f9a8d4', '400': '#f472b6', '500': '#ec4899', '600': '#db2777', '700': '#be185d', '800': '#9d174d', '900': '#831843', '950': '#500724' }, 'rose': { '50': '#fff1f2', '100': '#ffe4e6', '200': '#fecdd3', '300': '#fda4af', '400': '#fb7185', '500': '#f43f5e', '600': '#e11d48', '700': '#be123c', '800': '#9f1239', '900': '#881337', '950': '#4c0519' }, 'lightBlue': { '50': '#f0f9ff', '100': '#e0f2fe', '200': '#bae6fd', '300': '#7dd3fc', '400': '#38bdf8', '500': '#0ea5e9', '600': '#0284c7', '700': '#0369a1', '800': '#075985', '900': '#0c4a6e', '950': '#082f49' }, 'warmGray': { '50': '#fafaf9', '100': '#f5f5f4', '200': '#e7e5e4', '300': '#d6d3d1', '400': '#a8a29e', '500': '#78716c', '600': '#57534e', '700': '#44403c', '800': '#292524', '900': '#1c1917', '950': '#0c0a09' }, 'trueGray': { '50': '#fafafa', '100': '#f5f5f5', '200': '#e5e5e5', '300': '#d4d4d4', '400': '#a3a3a3', '500': '#737373', '600': '#525252', '700': '#404040', '800': '#262626', '900': '#171717', '950': '#0a0a0a' }, 'coolGray': { '50': '#f9fafb', '100': '#f3f4f6', '200': '#e5e7eb', '300': '#d1d5db', '400': '#9ca3af', '500': '#6b7280', '600': '#4b5563', '700': '#374151', '800': '#1f2937', '900': '#111827', '950': '#030712' }, 'blueGray': { '50': '#f8fafc', '100': '#f1f5f9', '200': '#e2e8f0', '300': '#cbd5e1', '400': '#94a3b8', '500': '#64748b', '600': '#475569', '700': '#334155', '800': '#1e293b', '900': '#0f172a', '950': '#020617' } })
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import * as R from 'ramda'
|
|
2
1
|
import { computed, inject, unref } from 'vue'
|
|
3
2
|
import { injectThemeKey } from './keys'
|
|
4
3
|
import { isValidColor, tailwindColors, colorShade, setOpacity } from './colors-utils'
|
|
4
|
+
import { mergeRightDeep } from '../common/utils'
|
|
5
5
|
|
|
6
|
-
export type Tone = '50' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'
|
|
6
|
+
export type Tone = '50' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | '950'
|
|
7
7
|
|
|
8
8
|
export interface ColorPalette {
|
|
9
|
-
50: string
|
|
10
|
-
100: string
|
|
11
|
-
200: string
|
|
12
|
-
300: string
|
|
13
|
-
400: string
|
|
14
|
-
500: string
|
|
15
|
-
600: string
|
|
16
|
-
700: string
|
|
17
|
-
800: string
|
|
18
|
-
900: string
|
|
9
|
+
50: string;
|
|
10
|
+
100: string;
|
|
11
|
+
200: string;
|
|
12
|
+
300: string;
|
|
13
|
+
400: string;
|
|
14
|
+
500: string;
|
|
15
|
+
600: string;
|
|
16
|
+
700: string;
|
|
17
|
+
800: string;
|
|
18
|
+
900: string;
|
|
19
|
+
950: string;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export type ColorLibrary = Record<string, ColorPalette>
|
|
22
23
|
|
|
23
24
|
export interface ColorsProps {
|
|
24
|
-
color?: string
|
|
25
|
+
color?: string;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export interface ColorComposition {
|
|
28
|
-
getPalette: (color
|
|
29
|
-
getColorOpacity: (color: string, opacity: number)=> string
|
|
29
|
+
getPalette: (color?: string) => ColorPalette;
|
|
30
|
+
getColorOpacity: (color: string, opacity: number) => string;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
const colorCache: ColorLibrary = {}
|
|
@@ -41,13 +42,13 @@ const defaultColors = {
|
|
|
41
42
|
|
|
42
43
|
export const useColors = (): ColorComposition => {
|
|
43
44
|
const globalTheme = inject(injectThemeKey, {})
|
|
44
|
-
const customColors = computed(() =>
|
|
45
|
+
const customColors = computed(() => mergeRightDeep(defaultColors, unref(globalTheme).colors || {}))
|
|
45
46
|
|
|
46
47
|
const getTailwindColor = (color: string) => tailwindColors[color]
|
|
47
48
|
|
|
48
49
|
const getColorOpacity = (color: string, opacity: number) => setOpacity(color, opacity)
|
|
49
50
|
|
|
50
|
-
const getPalette = (color
|
|
51
|
+
const getPalette = (color?: string): ColorPalette => {
|
|
51
52
|
if (!color) return getTailwindColor('gray')
|
|
52
53
|
|
|
53
54
|
const twColor = getTailwindColor(color)
|
|
@@ -73,6 +74,7 @@ export const useColors = (): ColorComposition => {
|
|
|
73
74
|
700: colorShade(color, -0.25),
|
|
74
75
|
800: colorShade(color, -0.58),
|
|
75
76
|
900: colorShade(color, -0.7),
|
|
77
|
+
950: colorShade(color, -0.8),
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
colorCache[color] = palette
|
|
@@ -86,6 +88,8 @@ export const useColors = (): ColorComposition => {
|
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
|
|
91
|
+
export type UseColorsProps = ReturnType<typeof useColors.props>
|
|
92
|
+
|
|
89
93
|
useColors.props = (defaultColor?: string) => ({
|
|
90
94
|
color: {
|
|
91
95
|
type: String,
|
package/src/composables/css.ts
CHANGED
|
@@ -5,13 +5,13 @@ const isTheme = (theme: string) => themes.includes(theme)
|
|
|
5
5
|
const isModifier = (modifier: string) => modifiers.includes(modifier)
|
|
6
6
|
|
|
7
7
|
export interface CSSComposition {
|
|
8
|
-
get: (name: string, value: string, theme?: string, modifier?: string)=> string
|
|
9
|
-
variable: (name: string, theme?: string, modifier?: string)=> string
|
|
10
|
-
variables: (object: Record<string, string | object>, theme?: string, modifier?: string)=> Record<string, string
|
|
8
|
+
get: (name: string, value: string, theme?: string, modifier?: string) => string;
|
|
9
|
+
variable: (name: string, theme?: string, modifier?: string) => string;
|
|
10
|
+
variables: (object: Record<string, string | object>, theme?: string, modifier?: string) => Record<string, string>;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const useCSS = (namespace?: string): CSSComposition => {
|
|
14
|
-
const get = (name: string, value: string, theme?: string, modifier?: string) => `${variable(name,theme,modifier)}: ${value}`
|
|
14
|
+
const get = (name: string, value: string, theme?: string, modifier?: string) => `${variable(name, theme, modifier)}: ${value}`
|
|
15
15
|
|
|
16
16
|
const variable = (name: string, theme?: string, modifier?: string) =>
|
|
17
17
|
`--x${namespace ? `-${namespace}` : ''}${theme ? `-${theme}` : ''}-${name}${modifier ? `-${modifier}` : ''}`
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropType } from 'vue'
|
|
2
2
|
import { ref, computed, inject, watch, onMounted, onUnmounted } from 'vue'
|
|
3
3
|
import { injectFormKey } from './keys'
|
|
4
4
|
|
|
5
5
|
export interface XFormInputMethods {
|
|
6
|
-
focus: ()=> void
|
|
7
|
-
validate: (val: any)=> boolean
|
|
8
|
-
setError: (val: string)=> void
|
|
6
|
+
focus: () => void;
|
|
7
|
+
validate: (val: any) => boolean;
|
|
8
|
+
setError: (val: string) => void;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const useInputtable = (props: any, { focus, emit, withListeners = true }: { focus: ()=> void
|
|
11
|
+
export const useInputtable = (props: any, { focus, emit, withListeners = true }: { focus: () => void; emit: any; withListeners?: boolean; }) => {
|
|
12
12
|
const isFirstValidation = ref(true)
|
|
13
13
|
const errorInternal = ref(props.error)
|
|
14
14
|
|
|
@@ -19,8 +19,8 @@ export const useInputtable = (props: any, { focus, emit, withListeners = true }:
|
|
|
19
19
|
watch(() => props.name, (val) => { if (val) nameInternal.value = val })
|
|
20
20
|
|
|
21
21
|
const form = inject(injectFormKey, {
|
|
22
|
-
registerInput: (
|
|
23
|
-
unregisterInput: (
|
|
22
|
+
registerInput: () => {},
|
|
23
|
+
unregisterInput: () => {},
|
|
24
24
|
isInsideForm: false,
|
|
25
25
|
})
|
|
26
26
|
|
|
@@ -34,7 +34,7 @@ export const useInputtable = (props: any, { focus, emit, withListeners = true }:
|
|
|
34
34
|
errorInternal.value = val
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const validate = (val
|
|
37
|
+
const validate = (val?: any): boolean => {
|
|
38
38
|
val = val || props.modelValue
|
|
39
39
|
|
|
40
40
|
isFirstValidation.value = false
|
package/src/composables/keys.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { InjectionKey } from 'vue'
|
|
2
|
+
import type { FormInjection } from '../components/form/Form.vue'
|
|
3
|
+
import type { TabGroupInjection } from '../components/tab/TabGroup.vue'
|
|
4
|
+
import type { ButtonGroupInjection } from '../components/button/ButtonGroup.vue'
|
|
2
5
|
|
|
3
|
-
export const injectTabKey = Symbol() as InjectionKey<
|
|
4
|
-
export const injectFormKey = Symbol() as InjectionKey<
|
|
6
|
+
export const injectTabKey = Symbol() as InjectionKey<TabGroupInjection>
|
|
7
|
+
export const injectFormKey = Symbol() as InjectionKey<FormInjection>
|
|
5
8
|
export const injectThemeKey = Symbol() as InjectionKey<any>
|
|
6
9
|
export const injectIconsKey = Symbol() as InjectionKey<any>
|
|
7
10
|
export const injectColorsKey = Symbol() as InjectionKey<any>
|
|
8
|
-
export const injectButtonGroupKey = Symbol() as InjectionKey<
|
|
11
|
+
export const injectButtonGroupKey = Symbol() as InjectionKey<ButtonGroupInjection>
|
|
9
12
|
export const injectNotificationKey = Symbol() as InjectionKey<any>
|
package/src/composables/theme.ts
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import { computed, inject, unref, useSlots, type StyleValue } from 'vue'
|
|
1
|
+
import { computed, inject, unref, useSlots, type StyleValue, type Slots, type UnwrapNestedRefs, type UnwrapRef, type MaybeRef } from 'vue'
|
|
2
2
|
import { injectThemeKey } from './keys'
|
|
3
3
|
import { useColors, type ColorComposition } from './colors'
|
|
4
4
|
import { useCSS, type CSSComposition } from './css'
|
|
5
|
-
import
|
|
6
|
-
import { smartUnref } from '../common/utils'
|
|
5
|
+
import { isFunction, isObject, mergeRightDeep, smartUnref } from '../common/utils'
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
export type ThemeVueClass = string | Record<string, boolean> | (string | Record<string, boolean>)[]
|
|
8
|
+
export type ThemeClasses<P, K extends string = string, D = undefined> = Record<K, string | ((params: ThemeParams<P, D>) => ThemeVueClass)>
|
|
9
|
+
export type ThemeStyles<P, D> = StyleValue | ((params: ThemeParams<P, D>) => StyleValue);
|
|
10
|
+
export interface ThemeComponent<P = object, K extends string = string, D = object> {
|
|
11
|
+
classes?: ThemeClasses<P, K, D>;
|
|
12
|
+
styles?: ThemeStyles<P, D>;
|
|
13
|
+
}
|
|
14
|
+
export type ThemeParams<P = Record<string, any>, D = Record<string, any>> = {
|
|
15
|
+
props: UnwrapRef<P>;
|
|
16
|
+
slots: Slots;
|
|
17
|
+
colors: ColorComposition;
|
|
18
|
+
css: CSSComposition;
|
|
19
|
+
rtl?: boolean;
|
|
20
|
+
data: UnwrapNestedRefs<D>;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
export const useTheme = (namespace: string, defaultTheme:
|
|
23
|
+
export const useTheme = <P extends object = object, K extends string = string, D extends object = object>(namespace: string, defaultTheme: ThemeComponent<P, K, D> = {}, props: MaybeRef<P> = {} as P, data: D = {} as D) => {
|
|
20
24
|
const userTheme = inject(injectThemeKey, false)
|
|
21
25
|
|
|
22
26
|
const rawClasses = computed(() => {
|
|
23
|
-
if (unref(userTheme)?.[namespace]) return
|
|
27
|
+
if (unref(userTheme)?.[namespace]) return mergeRightDeep(defaultTheme.classes, unref(userTheme)[namespace].classes || {})
|
|
24
28
|
|
|
25
29
|
return defaultTheme.classes
|
|
26
30
|
})
|
|
@@ -34,8 +38,7 @@ export const useTheme = (namespace: string, defaultTheme: any = {}, props: any,
|
|
|
34
38
|
const slots = useSlots()
|
|
35
39
|
const colors = useColors()
|
|
36
40
|
const css = useCSS(namespace)
|
|
37
|
-
|
|
38
|
-
const classes = computed(() => getClasses(rawClasses.value, {
|
|
41
|
+
const classes = computed<Record<K, ThemeVueClass>>(() => getClasses(rawClasses.value, {
|
|
39
42
|
props: unref(props),
|
|
40
43
|
slots,
|
|
41
44
|
data: smartUnref(data),
|
|
@@ -71,18 +74,18 @@ export const useTheme = (namespace: string, defaultTheme: any = {}, props: any,
|
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
function getClasses(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
function getClasses(classes: any, params: ThemeParams): any {
|
|
78
|
+
const parsedClasses: Record<string, string> = {}
|
|
79
|
+
|
|
80
|
+
Object.keys(classes).forEach((key) => {
|
|
81
|
+
const x = classes[key]
|
|
82
|
+
|
|
83
|
+
parsedClasses[key] = isFunction(x) ? x(params) : (isObject(x) ? getClasses(x, params) : x)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
return parsedClasses
|
|
80
87
|
}
|
|
81
88
|
|
|
82
89
|
function getStyles(styles: any, params: ThemeParams) {
|
|
83
|
-
return
|
|
84
|
-
? styles(params) || {}
|
|
85
|
-
: R.is(Object, styles)
|
|
86
|
-
? styles
|
|
87
|
-
: {}
|
|
90
|
+
return isFunction(styles) ? (styles(params) || {}) : (isObject(styles) ? styles : {})
|
|
88
91
|
}
|