@indielayer/ui 1.0.10 → 1.2.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/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 +22 -5
- 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 +24 -2
- 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 +45 -8
- 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 +19 -5
- 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 +41 -7
- 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 +36 -5
- 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 +9 -0
- 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 +35 -4
- 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 +17 -1
- 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 +8 -0
- 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 +6 -0
- 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 +39 -12
- 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 +25 -4
- 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.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 +21 -3
- 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 +5 -0
- 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 +70 -19
- 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 +17 -1
- 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 +61 -8
- 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 +55 -15
- 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 +13 -1
- 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 +46 -13
- 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 +27 -4
- 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 +16 -1
- 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 +40 -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 +8 -0
- 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 -12
- package/lib/components/progress/Progress.theme.js +18 -0
- package/lib/components/progress/Progress.vue.d.ts +19 -0
- 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 +38 -6
- 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 +12 -1
- 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 +33 -4
- 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 +8 -0
- 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 +40 -4
- 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.js +12 -0
- package/lib/components/spacer/index.d.ts +1 -0
- package/lib/components/spinner/Spinner.vue.d.ts +13 -0
- 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 +31 -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 +53 -8
- 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 +268 -57
- package/lib/components/table/Table.vue.js +147 -0
- package/lib/components/table/Table.vue2.js +4 -0
- 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 +27 -5
- package/lib/components/table/TableCell.vue.js +43 -0
- package/lib/components/table/TableCell.vue2.js +4 -0
- package/lib/components/table/TableHead.js +19 -0
- package/lib/components/table/TableHeader.vue.d.ts +26 -8
- package/lib/components/table/TableHeader.vue.js +78 -0
- package/lib/components/table/TableHeader.vue2.js +4 -0
- 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 +23 -3
- 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 +56 -14
- 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 +36 -4
- 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 +3 -0
- 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 +2 -1
- 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.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.js +9 -0
- package/lib/composables/theme.d.ts +13 -7
- package/lib/composables/theme.js +59 -0
- 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 +10 -9
- package/src/common/utils.ts +25 -2
- package/src/components/alert/Alert.theme.ts +15 -6
- package/src/components/alert/Alert.vue +24 -12
- package/src/components/alert/index.ts +3 -0
- package/src/components/avatar/Avatar.theme.ts +16 -4
- package/src/components/avatar/Avatar.vue +18 -14
- 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 +18 -8
- package/src/components/button/Button.vue +28 -18
- package/src/components/button/ButtonGroup.theme.ts +14 -1
- package/src/components/button/ButtonGroup.vue +29 -15
- 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 +20 -11
- package/src/components/checkbox/index.ts +3 -0
- package/src/components/collapse/Collapse.theme.ts +13 -3
- package/src/components/collapse/Collapse.vue +16 -12
- 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 +27 -18
- package/src/components/drawer/index.ts +3 -0
- package/src/components/form/Form.theme.ts +12 -2
- package/src/components/form/Form.vue +38 -28
- 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 +31 -20
- package/src/components/input/index.ts +3 -0
- package/src/components/link/Link.theme.ts +13 -3
- package/src/components/link/Link.vue +16 -11
- 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 +56 -48
- package/src/components/menu/index.ts +7 -0
- package/src/components/modal/Modal.theme.ts +13 -3
- package/src/components/modal/Modal.vue +22 -11
- 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 +27 -21
- 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 +21 -12
- package/src/components/radio/index.ts +3 -0
- package/src/components/scroll/Scroll.theme.ts +12 -2
- package/src/components/scroll/Scroll.vue +14 -10
- package/src/components/scroll/index.ts +3 -0
- package/src/components/select/Select.theme.ts +20 -6
- package/src/components/select/Select.vue +28 -19
- 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/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 +1 -78
- package/src/composables/colors.ts +6 -4
- package/src/composables/common.ts +1 -1
- package/src/composables/inputtable.ts +4 -4
- package/src/composables/keys.ts +6 -3
- package/src/composables/theme.ts +26 -23
- package/src/create.ts +1 -2
- package/src/version.ts +1 -1
- package/volar.d.ts +1 -1
- package/lib/components/tooltip/Tooltip.theme.d.ts +0 -11
- package/lib/index.cjs.js +0 -1
- package/lib/index.es.js +0 -5187
- package/src/components/tooltip/Tooltip.theme.ts +0 -51
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
classes: {
|
|
3
|
+
wrapper: "",
|
|
4
|
+
label: ({ props: t }) => {
|
|
5
|
+
const e = "font-medium text-gray-800 dark:text-gray-200";
|
|
6
|
+
return t.size === "xs" ? e + " text-xs" : t.size === "sm" ? e + " text-sm" : t.size === "lg" ? e + " text-lg" : t.size === "xl" ? e + " text-xl" : e + " text-sm";
|
|
7
|
+
},
|
|
8
|
+
buttonWrapper: ({ props: t }) => {
|
|
9
|
+
let e = "relative shrink-0";
|
|
10
|
+
return t.size === "sm" || t.size === "xs" ? e += " w-6" : t.size === "lg" ? e += " w-10" : t.size === "xl" ? e += " w-12" : e += " w-8", e;
|
|
11
|
+
},
|
|
12
|
+
button: ({ props: t }) => {
|
|
13
|
+
let e = "rounded-full shadow transform transition duration-150 shrink-0";
|
|
14
|
+
return t.size === "sm" || t.size === "xs" ? e += " h-3 w-3" : t.size === "lg" ? e += " h-5 w-5" : t.size === "xl" ? e += " h-6 w-6" : e += " h-4 w-4", e;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
styles: ({ colors: t, props: e, css: l }) => {
|
|
18
|
+
const s = t.getPalette(e.color);
|
|
19
|
+
return l.variables({
|
|
20
|
+
bg: s[500],
|
|
21
|
+
dark: {
|
|
22
|
+
bg: s[600]
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}, r = i;
|
|
27
|
+
export {
|
|
28
|
+
r as default
|
|
29
|
+
};
|
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
import { type ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
declare const toggleProps: {
|
|
3
|
+
id: StringConstructor;
|
|
4
|
+
label: StringConstructor;
|
|
5
|
+
helper: StringConstructor;
|
|
6
|
+
glow: BooleanConstructor;
|
|
7
|
+
modelValue: import("vue").PropType<string | number | boolean | object | any[] | undefined>;
|
|
8
|
+
name: StringConstructor;
|
|
9
|
+
readonly: BooleanConstructor;
|
|
10
|
+
required: BooleanConstructor;
|
|
11
|
+
validateOnInput: {
|
|
12
|
+
readonly type: BooleanConstructor;
|
|
13
|
+
readonly default: true;
|
|
14
|
+
};
|
|
15
|
+
error: StringConstructor;
|
|
16
|
+
rules: {
|
|
17
|
+
readonly type: ArrayConstructor;
|
|
18
|
+
readonly default: () => never[];
|
|
19
|
+
};
|
|
20
|
+
disabled: BooleanConstructor;
|
|
21
|
+
loading: BooleanConstructor;
|
|
22
|
+
color: {
|
|
23
|
+
readonly type: StringConstructor;
|
|
24
|
+
readonly default: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
size: {
|
|
27
|
+
readonly type: import("vue").PropType<import("../../composables/common").Size>;
|
|
28
|
+
readonly default: "md";
|
|
29
|
+
readonly validator: (value: string) => boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export type ToggleProps = ExtractPublicPropTypes<typeof toggleProps>;
|
|
1
33
|
declare const _default: import("vue").DefineComponent<{
|
|
2
34
|
id: StringConstructor;
|
|
3
35
|
label: StringConstructor;
|
|
@@ -31,7 +63,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
31
63
|
focus: () => void | undefined;
|
|
32
64
|
blur: () => void | undefined;
|
|
33
65
|
reset: () => void;
|
|
34
|
-
validate: (val
|
|
66
|
+
validate: (val?: any) => boolean;
|
|
35
67
|
setError: (val: string) => void;
|
|
36
68
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
69
|
id: StringConstructor;
|
|
@@ -65,12 +97,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
97
|
}>> & {
|
|
66
98
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
67
99
|
}, {
|
|
100
|
+
disabled: boolean;
|
|
101
|
+
color: string;
|
|
68
102
|
size: import("../../composables/common").Size;
|
|
69
103
|
required: boolean;
|
|
70
|
-
color: string;
|
|
71
|
-
glow: boolean;
|
|
72
|
-
disabled: boolean;
|
|
73
104
|
loading: boolean;
|
|
105
|
+
glow: boolean;
|
|
74
106
|
readonly: boolean;
|
|
75
107
|
validateOnInput: boolean;
|
|
76
108
|
rules: unknown[];
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { defineComponent as E, ref as I, computed as N, openBlock as d, createElementBlock as g, normalizeClass as o, unref as r, createElementVNode as a, normalizeStyle as q, withDirectives as D, vModelCheckbox as R, toDisplayString as T, createCommentVNode as b, createBlock as X, createVNode as $ } from "vue";
|
|
2
|
+
import { useTheme as L } from "../../composables/theme.js";
|
|
3
|
+
import { useCommon as c } from "../../composables/common.js";
|
|
4
|
+
import { useColors as M } from "../../composables/colors.js";
|
|
5
|
+
import { useInputtable as i } from "../../composables/inputtable.js";
|
|
6
|
+
import { useInteractive as f } from "../../composables/interactive.js";
|
|
7
|
+
import P from "../spinner/Spinner.vue.js";
|
|
8
|
+
import U from "../helpers/InputError.js";
|
|
9
|
+
import W from "./Toggle.theme.js";
|
|
10
|
+
const j = { class: "flex items-center" }, A = ["id", "aria-checked", "aria-disabled", "disabled", "name", "required", "value"], F = ["textContent"], G = {
|
|
11
|
+
...c.props(),
|
|
12
|
+
...M.props("primary"),
|
|
13
|
+
...f.props(),
|
|
14
|
+
...i.props(),
|
|
15
|
+
id: String,
|
|
16
|
+
label: String,
|
|
17
|
+
helper: String,
|
|
18
|
+
glow: Boolean
|
|
19
|
+
}, H = {
|
|
20
|
+
name: "XToggle",
|
|
21
|
+
validators: {
|
|
22
|
+
...c.validators()
|
|
23
|
+
}
|
|
24
|
+
}, re = /* @__PURE__ */ E({
|
|
25
|
+
...H,
|
|
26
|
+
props: G,
|
|
27
|
+
emits: i.emits(!1),
|
|
28
|
+
setup(h, { expose: v, emit: n }) {
|
|
29
|
+
const t = h, u = I(null), l = N({
|
|
30
|
+
get() {
|
|
31
|
+
return !!t.modelValue;
|
|
32
|
+
},
|
|
33
|
+
set(e) {
|
|
34
|
+
n("update:modelValue", e);
|
|
35
|
+
}
|
|
36
|
+
}), { focus: m, blur: k } = f(u), {
|
|
37
|
+
errorInternal: y,
|
|
38
|
+
reset: w,
|
|
39
|
+
validate: C,
|
|
40
|
+
setError: V
|
|
41
|
+
} = i(t, { focus: m, emit: n, withListeners: !1 }), { styles: z, classes: s, className: S } = L("toggle", W, t);
|
|
42
|
+
return v({ focus: m, blur: k, reset: w, validate: C, setError: V }), (e, p) => (d(), g("label", {
|
|
43
|
+
class: o(["inline-block", [
|
|
44
|
+
r(S),
|
|
45
|
+
r(s).wrapper,
|
|
46
|
+
e.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
47
|
+
]])
|
|
48
|
+
}, [
|
|
49
|
+
a("div", j, [
|
|
50
|
+
a("div", {
|
|
51
|
+
class: o(["flex items-center rounded-full transition-colors duration-300 border-[3px] shrink-0 border-transparent", {
|
|
52
|
+
[`shadow-lg shadow-${e.color}-500/50`]: e.glow && e.modelValue,
|
|
53
|
+
"bg-gray-300 dark:bg-gray-500": !e.disabled && !l.value && !e.loading,
|
|
54
|
+
"bg-gray-100 dark:bg-gray-700": e.disabled || e.loading,
|
|
55
|
+
"bg-[color:var(--x-toggle-bg)] dark:bg-[color:var(--x-toggle-dark-bg)]": !e.disabled && l.value
|
|
56
|
+
}]),
|
|
57
|
+
style: q(r(z))
|
|
58
|
+
}, [
|
|
59
|
+
a("div", {
|
|
60
|
+
class: o(r(s).buttonWrapper)
|
|
61
|
+
}, [
|
|
62
|
+
D(a("input", {
|
|
63
|
+
id: e.id,
|
|
64
|
+
ref_key: "elRef",
|
|
65
|
+
ref: u,
|
|
66
|
+
"onUpdate:modelValue": p[0] || (p[0] = (B) => l.value = B),
|
|
67
|
+
"aria-checked": l.value ? "true" : "false",
|
|
68
|
+
"aria-disabled": e.disabled ? "true" : void 0,
|
|
69
|
+
type: "checkbox",
|
|
70
|
+
class: "hidden",
|
|
71
|
+
disabled: e.disabled || e.loading,
|
|
72
|
+
name: e.name,
|
|
73
|
+
required: e.required,
|
|
74
|
+
value: e.modelValue
|
|
75
|
+
}, null, 8, A), [
|
|
76
|
+
[R, l.value]
|
|
77
|
+
]),
|
|
78
|
+
a("div", {
|
|
79
|
+
class: o([
|
|
80
|
+
r(s).button,
|
|
81
|
+
{
|
|
82
|
+
"translate-x-full": l.value,
|
|
83
|
+
shadow: !e.disabled
|
|
84
|
+
},
|
|
85
|
+
e.disabled ? "bg-gray-50 dark:bg-gray-800" : "bg-white dark:bg-gray-800"
|
|
86
|
+
])
|
|
87
|
+
}, null, 2)
|
|
88
|
+
], 2)
|
|
89
|
+
], 6),
|
|
90
|
+
e.label ? (d(), g("span", {
|
|
91
|
+
key: 0,
|
|
92
|
+
class: o(["ml-2", r(s).label]),
|
|
93
|
+
textContent: T(e.label)
|
|
94
|
+
}, null, 10, F)) : b("", !0),
|
|
95
|
+
e.loading ? (d(), X(P, {
|
|
96
|
+
key: 1,
|
|
97
|
+
size: e.size,
|
|
98
|
+
class: "ml-1"
|
|
99
|
+
}, null, 8, ["size"])) : b("", !0)
|
|
100
|
+
]),
|
|
101
|
+
$(r(U), {
|
|
102
|
+
error: r(y),
|
|
103
|
+
helper: e.helper
|
|
104
|
+
}, null, 8, ["error", "helper"])
|
|
105
|
+
], 2));
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
export {
|
|
109
|
+
re as default
|
|
110
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
declare const tooltipProps: {};
|
|
3
|
+
export type TooltipProps = ExtractPublicPropTypes<typeof tooltipProps>;
|
|
1
4
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
|
|
2
5
|
default?(_: {}): any;
|
|
3
6
|
tooltip?(_: {}): any;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent as r, openBlock as s, createBlock as a, withCtx as t, createElementVNode as n, createVNode as l, renderSlot as o } from "vue";
|
|
2
|
+
import c from "../popover/Popover.vue.js";
|
|
3
|
+
import m from "../popover/PopoverContainer.vue.js";
|
|
4
|
+
const _ = { class: "dark" }, p = { name: "XTooltip" }, h = /* @__PURE__ */ r({
|
|
5
|
+
...p,
|
|
6
|
+
setup(d) {
|
|
7
|
+
return (e, i) => (s(), a(c, { hover: "" }, {
|
|
8
|
+
content: t(() => [
|
|
9
|
+
n("div", _, [
|
|
10
|
+
l(m, { class: "p-2 text-white text-sm w-max max-w-xs" }, {
|
|
11
|
+
default: t(() => [
|
|
12
|
+
o(e.$slots, "tooltip")
|
|
13
|
+
]),
|
|
14
|
+
_: 3
|
|
15
|
+
})
|
|
16
|
+
])
|
|
17
|
+
]),
|
|
18
|
+
default: t(() => [
|
|
19
|
+
o(e.$slots, "default")
|
|
20
|
+
]),
|
|
21
|
+
_: 3
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
h as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const t = (f) => /^#(?:[A-Fa-f0-9]{3}){1,2}$/.test(f), y = (f) => /^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(f), G = (f) => /^^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1(?:\.0*)?)\s*[)]$/.test(f), n = (f) => {
|
|
2
|
+
var e;
|
|
3
|
+
return (e = f.match(/\((.*?)\)/)) == null ? void 0 : e[1].split(",");
|
|
4
|
+
}, r = (f) => {
|
|
5
|
+
var e;
|
|
6
|
+
return (e = f.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (a, d, c, b) => "#" + d + d + c + c + b + b).substring(1).match(/.{2}/g)) == null ? void 0 : e.map((a) => parseInt(a, 16));
|
|
7
|
+
}, p = (f, e) => {
|
|
8
|
+
const [a, d, c] = (t(f) ? r(f) : n(f)) ?? [0, 0, 0];
|
|
9
|
+
return "rgba(" + a + "," + d + "," + c + "," + e + ")";
|
|
10
|
+
}, B = (f) => t(f) || y(f) || G(f), R = (f, e) => {
|
|
11
|
+
const a = e < 0, d = a ? 1 + e : 1 - e, c = a ? 0 : e * 255 ** 2, b = (m) => Math.round((d * Math.floor(Number(m)) ** 2 + c) ** 0.5), [o, i, l, s] = (t(f) ? r(f) : n(f)) ?? [0, 0, 0], u = b(o), g = b(i), h = b(l);
|
|
12
|
+
return "rgb" + (s ? "a(" : "(") + u + "," + g + "," + h + (s ? "," + s : ")");
|
|
13
|
+
}, $ = 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" } });
|
|
14
|
+
export {
|
|
15
|
+
R as colorShade,
|
|
16
|
+
B as isValidColor,
|
|
17
|
+
p as setOpacity,
|
|
18
|
+
$ as tailwindColors
|
|
19
|
+
};
|
|
@@ -17,7 +17,7 @@ export interface ColorsProps {
|
|
|
17
17
|
color?: string;
|
|
18
18
|
}
|
|
19
19
|
export interface ColorComposition {
|
|
20
|
-
getPalette: (color
|
|
20
|
+
getPalette: (color?: string) => ColorPalette;
|
|
21
21
|
getColorOpacity: (color: string, opacity: number) => string;
|
|
22
22
|
}
|
|
23
23
|
export declare const useColors: {
|
|
@@ -29,3 +29,4 @@ export declare const useColors: {
|
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
+
export type UseColorsProps = ReturnType<typeof useColors.props>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { inject as p, computed as m, unref as g } from "vue";
|
|
2
|
+
import { injectThemeKey as f } from "./keys.js";
|
|
3
|
+
import { tailwindColors as r, setOpacity as l, isValidColor as y, colorShade as t } from "./colors-utils.js";
|
|
4
|
+
import { mergeRightDeep as d } from "../common/utils.js";
|
|
5
|
+
const a = {}, C = {
|
|
6
|
+
primary: r.sky,
|
|
7
|
+
secondary: r.slate,
|
|
8
|
+
success: r.green,
|
|
9
|
+
warning: r.yellow,
|
|
10
|
+
error: r.red
|
|
11
|
+
}, c = () => {
|
|
12
|
+
const s = p(f, {}), o = m(() => d(C, g(s).colors || {})), i = (e) => r[e];
|
|
13
|
+
return {
|
|
14
|
+
getPalette: (e) => {
|
|
15
|
+
if (!e)
|
|
16
|
+
return i("gray");
|
|
17
|
+
const n = i(e);
|
|
18
|
+
if (n)
|
|
19
|
+
return n;
|
|
20
|
+
if (a[e])
|
|
21
|
+
return a[e];
|
|
22
|
+
if (o.value[e])
|
|
23
|
+
return o.value[e];
|
|
24
|
+
if (!y(e))
|
|
25
|
+
return console.warn(`Invalid color: ${e}`), i("gray");
|
|
26
|
+
const u = {
|
|
27
|
+
50: t(e, 0.9),
|
|
28
|
+
100: t(e, 0.8),
|
|
29
|
+
200: t(e, 0.6),
|
|
30
|
+
300: t(e, 0.4),
|
|
31
|
+
400: t(e, 0.1),
|
|
32
|
+
500: e,
|
|
33
|
+
600: t(e, -0.1),
|
|
34
|
+
700: t(e, -0.25),
|
|
35
|
+
800: t(e, -0.58),
|
|
36
|
+
900: t(e, -0.7),
|
|
37
|
+
950: t(e, -0.8)
|
|
38
|
+
};
|
|
39
|
+
return a[e] = u, u;
|
|
40
|
+
},
|
|
41
|
+
getColorOpacity: (e, n) => l(e, n)
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
c.props = (s) => ({
|
|
45
|
+
color: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: s
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
c as useColors
|
|
52
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const e = () => {
|
|
2
|
+
}, s = Object.freeze({
|
|
3
|
+
size: ["xs", "sm", "md", "lg", "xl"]
|
|
4
|
+
});
|
|
5
|
+
e.props = () => ({
|
|
6
|
+
size: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: "md",
|
|
9
|
+
validator: (t) => s.size.includes(t)
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
e.validators = () => ({
|
|
13
|
+
...s
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
e as useCommon
|
|
17
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const u = ["dark"], a = ["hover", "active", "focus", "visited"], f = (n) => u.includes(n), v = (n) => a.includes(n), d = (n) => {
|
|
2
|
+
const $ = (i, e, t, s) => `${r(i, t, s)}: ${e}`, r = (i, e, t) => `--x${n ? `-${n}` : ""}${e ? `-${e}` : ""}-${i}${t ? `-${t}` : ""}`, l = (i, e, t) => {
|
|
3
|
+
let s = {};
|
|
4
|
+
for (const o in i) {
|
|
5
|
+
const c = i[o];
|
|
6
|
+
if (!c)
|
|
7
|
+
break;
|
|
8
|
+
f(o) ? s = {
|
|
9
|
+
...s,
|
|
10
|
+
...l(c, o, t)
|
|
11
|
+
} : v(o) ? s = {
|
|
12
|
+
...s,
|
|
13
|
+
...l(c, e, o)
|
|
14
|
+
} : s[r(o, e, t)] = c;
|
|
15
|
+
}
|
|
16
|
+
return s;
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
get: $,
|
|
20
|
+
variable: r,
|
|
21
|
+
variables: l
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
d as useCSS
|
|
26
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
2
|
export interface XFormInputMethods {
|
|
3
3
|
focus: () => void;
|
|
4
4
|
validate: (val: any) => boolean;
|
|
@@ -10,12 +10,12 @@ export declare const useInputtable: {
|
|
|
10
10
|
emit: any;
|
|
11
11
|
withListeners?: boolean | undefined;
|
|
12
12
|
}): {
|
|
13
|
-
isFirstValidation: Ref<boolean>;
|
|
13
|
+
isFirstValidation: import("vue").Ref<boolean>;
|
|
14
14
|
errorInternal: any;
|
|
15
|
-
isInsideForm:
|
|
15
|
+
isInsideForm: boolean;
|
|
16
16
|
inputListeners: {};
|
|
17
17
|
reset: () => void;
|
|
18
|
-
validate: (val
|
|
18
|
+
validate: (val?: any) => boolean;
|
|
19
19
|
setError: (val: string) => void;
|
|
20
20
|
};
|
|
21
21
|
emits(withListeners?: boolean): string[];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ref as f, watch as I, inject as F, computed as A, onMounted as B, onUnmounted as S } from "vue";
|
|
2
|
+
import { injectFormKey as j } from "./keys.js";
|
|
3
|
+
const v = (t, { focus: p, emit: u, withListeners: y = !0 }) => {
|
|
4
|
+
const o = f(!0), n = f(t.error), V = t.name ? t.name : (Math.random() + 1).toString(36).substring(7), s = f(V);
|
|
5
|
+
I(() => t.error, (e) => {
|
|
6
|
+
n.value = e;
|
|
7
|
+
}), I(() => t.name, (e) => {
|
|
8
|
+
e && (s.value = e);
|
|
9
|
+
});
|
|
10
|
+
const i = F(j, {
|
|
11
|
+
registerInput: () => {
|
|
12
|
+
},
|
|
13
|
+
unregisterInput: () => {
|
|
14
|
+
},
|
|
15
|
+
isInsideForm: !1
|
|
16
|
+
}), b = () => {
|
|
17
|
+
n.value = "", o.value = !0, u("update:modelValue", "");
|
|
18
|
+
}, g = (e) => {
|
|
19
|
+
n.value = e;
|
|
20
|
+
}, c = (e) => {
|
|
21
|
+
e = e || t.modelValue, o.value = !1;
|
|
22
|
+
for (let d = 0; d < t.rules.length; d++) {
|
|
23
|
+
const r = t.rules[d];
|
|
24
|
+
let a = !0;
|
|
25
|
+
if (typeof r == "function")
|
|
26
|
+
a = r(e);
|
|
27
|
+
else if (Array.isArray(r) && r.length === 2) {
|
|
28
|
+
const { 0: l, 1: m } = r;
|
|
29
|
+
a = l(e, m);
|
|
30
|
+
} else {
|
|
31
|
+
const l = r.fn, { options: m } = r;
|
|
32
|
+
a = l(e, m);
|
|
33
|
+
}
|
|
34
|
+
if (a !== !0)
|
|
35
|
+
return n.value = a, !1;
|
|
36
|
+
}
|
|
37
|
+
return n.value = "", !0;
|
|
38
|
+
}, h = y ? A(() => ({
|
|
39
|
+
blur: (e) => u("blur", e),
|
|
40
|
+
focus: (e) => u("focus", e),
|
|
41
|
+
input: (e) => {
|
|
42
|
+
t.validateOnInput && !o.value && c(e.target.value), u("update:modelValue", e.target.value);
|
|
43
|
+
},
|
|
44
|
+
change: (e) => u("change", e)
|
|
45
|
+
})) : {};
|
|
46
|
+
return B(() => {
|
|
47
|
+
i.registerInput(s.value, p, c, g);
|
|
48
|
+
}), S(() => {
|
|
49
|
+
i.unregisterInput(s.value);
|
|
50
|
+
}), {
|
|
51
|
+
isFirstValidation: o,
|
|
52
|
+
errorInternal: n,
|
|
53
|
+
isInsideForm: i.isInsideForm,
|
|
54
|
+
inputListeners: h,
|
|
55
|
+
reset: b,
|
|
56
|
+
validate: c,
|
|
57
|
+
setError: g
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
v.emits = (t = !0) => t ? ["update:modelValue", "blur", "focus", "input", "change"] : ["update:modelValue"];
|
|
61
|
+
v.props = () => ({
|
|
62
|
+
modelValue: [String, Number, Boolean, Object, Array],
|
|
63
|
+
name: String,
|
|
64
|
+
readonly: Boolean,
|
|
65
|
+
required: Boolean,
|
|
66
|
+
validateOnInput: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: !0
|
|
69
|
+
},
|
|
70
|
+
error: String,
|
|
71
|
+
rules: {
|
|
72
|
+
type: Array,
|
|
73
|
+
default: () => []
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export {
|
|
77
|
+
v as useInputtable
|
|
78
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const a = (u) => ({
|
|
2
|
+
focus: () => {
|
|
3
|
+
var o, e;
|
|
4
|
+
return (e = (o = u.value) == null ? void 0 : o.focus) == null ? void 0 : e.call(o);
|
|
5
|
+
},
|
|
6
|
+
blur: () => {
|
|
7
|
+
var o, e;
|
|
8
|
+
return (e = (o = u.value) == null ? void 0 : o.blur) == null ? void 0 : e.call(o);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
a.props = () => ({
|
|
12
|
+
disabled: Boolean,
|
|
13
|
+
loading: Boolean
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
a as useInteractive
|
|
17
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { InjectionKey } from 'vue';
|
|
2
|
-
|
|
3
|
-
|
|
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';
|
|
5
|
+
export declare const injectTabKey: InjectionKey<TabGroupInjection>;
|
|
6
|
+
export declare const injectFormKey: InjectionKey<FormInjection>;
|
|
4
7
|
export declare const injectThemeKey: InjectionKey<any>;
|
|
5
8
|
export declare const injectIconsKey: InjectionKey<any>;
|
|
6
9
|
export declare const injectColorsKey: InjectionKey<any>;
|
|
7
|
-
export declare const injectButtonGroupKey: InjectionKey<
|
|
10
|
+
export declare const injectButtonGroupKey: InjectionKey<ButtonGroupInjection>;
|
|
8
11
|
export declare const injectNotificationKey: InjectionKey<any>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const o = Symbol(), t = Symbol(), e = Symbol(), n = Symbol(), c = Symbol(), y = Symbol(), i = Symbol();
|
|
2
|
+
export {
|
|
3
|
+
y as injectButtonGroupKey,
|
|
4
|
+
c as injectColorsKey,
|
|
5
|
+
t as injectFormKey,
|
|
6
|
+
n as injectIconsKey,
|
|
7
|
+
i as injectNotificationKey,
|
|
8
|
+
o as injectTabKey,
|
|
9
|
+
e as injectThemeKey
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { inject as o } from "vue";
|
|
2
|
+
import { injectNotificationKey as n } from "./keys.js";
|
|
3
|
+
const a = (i) => {
|
|
4
|
+
const t = o(i || n);
|
|
5
|
+
return t || console.warn("useNotifications must have a parent wrapped with Notifications component"), t;
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
a as useNotifications
|
|
9
|
+
};
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import { type StyleValue } from 'vue';
|
|
1
|
+
import { type StyleValue, type Slots, type UnwrapNestedRefs, type UnwrapRef, type MaybeRef } from 'vue';
|
|
2
2
|
import { type ColorComposition } from './colors';
|
|
3
3
|
import { type CSSComposition } from './css';
|
|
4
|
-
|
|
5
|
-
export type
|
|
6
|
-
|
|
4
|
+
export type ThemeVueClass = string | Record<string, boolean> | (string | Record<string, boolean>)[];
|
|
5
|
+
export type ThemeClasses<P, K extends string = string, D = undefined> = Record<K, string | ((params: ThemeParams<P, D>) => ThemeVueClass)>;
|
|
6
|
+
export type ThemeStyles<P, D> = StyleValue | ((params: ThemeParams<P, D>) => StyleValue);
|
|
7
|
+
export interface ThemeComponent<P = object, K extends string = string, D = object> {
|
|
8
|
+
classes?: ThemeClasses<P, K, D>;
|
|
9
|
+
styles?: ThemeStyles<P, D>;
|
|
10
|
+
}
|
|
11
|
+
export type ThemeParams<P = Record<string, any>, D = Record<string, any>> = {
|
|
12
|
+
props: UnwrapRef<P>;
|
|
7
13
|
slots: Slots;
|
|
8
14
|
colors: ColorComposition;
|
|
9
15
|
css: CSSComposition;
|
|
10
16
|
rtl?: boolean;
|
|
11
|
-
data
|
|
17
|
+
data: UnwrapNestedRefs<D>;
|
|
12
18
|
};
|
|
13
|
-
export declare const useTheme: (namespace: string, defaultTheme
|
|
19
|
+
export declare const useTheme: <P extends object = object, K extends string = string, D extends object = object>(namespace: string, defaultTheme?: ThemeComponent<P, K, D>, props?: MaybeRef<P>, data?: D) => {
|
|
14
20
|
classPrefix: import("vue").ComputedRef<any>;
|
|
15
21
|
className: import("vue").ComputedRef<string>;
|
|
16
22
|
colors: ColorComposition;
|
|
17
|
-
classes: import("vue").ComputedRef<
|
|
23
|
+
classes: import("vue").ComputedRef<Record<K, ThemeVueClass>>;
|
|
18
24
|
styles: import("vue").ComputedRef<StyleValue>;
|
|
19
25
|
css: CSSComposition;
|
|
20
26
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { inject as P, computed as c, unref as r, useSlots as T } from "vue";
|
|
2
|
+
import { injectThemeKey as $ } from "./keys.js";
|
|
3
|
+
import { useColors as d } from "./colors.js";
|
|
4
|
+
import { useCSS as w } from "./css.js";
|
|
5
|
+
import { mergeRightDeep as D, smartUnref as C, isFunction as h, isObject as j } from "../common/utils.js";
|
|
6
|
+
const U = (s, e = {}, n = {}, l = {}) => {
|
|
7
|
+
const t = P($, !1), b = c(() => {
|
|
8
|
+
var o;
|
|
9
|
+
return (o = r(t)) != null && o[s] ? D(e.classes, r(t)[s].classes || {}) : e.classes;
|
|
10
|
+
}), f = c(() => {
|
|
11
|
+
var o;
|
|
12
|
+
return ((o = r(t)) == null ? void 0 : o.classPrefix) ?? "x-";
|
|
13
|
+
}), v = c(() => `${f.value}${s}`), m = c(() => {
|
|
14
|
+
var o;
|
|
15
|
+
return ((o = r(t)) == null ? void 0 : o.rtl) ?? !1;
|
|
16
|
+
}), a = T(), i = d(), u = w(s), y = c(() => S(b.value, {
|
|
17
|
+
props: r(n),
|
|
18
|
+
slots: a,
|
|
19
|
+
data: C(l),
|
|
20
|
+
colors: i,
|
|
21
|
+
css: u,
|
|
22
|
+
rtl: r(m)
|
|
23
|
+
})), O = c(() => {
|
|
24
|
+
var x;
|
|
25
|
+
const o = ((x = r(t)) == null ? void 0 : x[s]) || {}, p = {
|
|
26
|
+
props: r(n),
|
|
27
|
+
slots: a,
|
|
28
|
+
data: C(l),
|
|
29
|
+
colors: i,
|
|
30
|
+
css: u,
|
|
31
|
+
rtl: r(m)
|
|
32
|
+
};
|
|
33
|
+
return [
|
|
34
|
+
g(e.styles, p),
|
|
35
|
+
g(o.styles, p)
|
|
36
|
+
];
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
classPrefix: f,
|
|
40
|
+
className: v,
|
|
41
|
+
colors: i,
|
|
42
|
+
classes: y,
|
|
43
|
+
styles: O,
|
|
44
|
+
css: u
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
function S(s, e) {
|
|
48
|
+
const n = {};
|
|
49
|
+
return Object.keys(s).forEach((l) => {
|
|
50
|
+
const t = s[l];
|
|
51
|
+
n[l] = h(t) ? t(e) : j(t) ? S(t, e) : t;
|
|
52
|
+
}), n;
|
|
53
|
+
}
|
|
54
|
+
function g(s, e) {
|
|
55
|
+
return h(s) ? s(e) || {} : j(s) ? s : {};
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
U as useTheme
|
|
59
|
+
};
|