@indielayer/ui 0.0.0-dev-20240125104319
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 +21 -0
- package/README.md +43 -0
- package/env.d.ts +1 -0
- package/exports/nuxt.mjs +33 -0
- package/exports/nuxt.plugin.js +8 -0
- package/exports/tailwind.preset.js +41 -0
- package/lib/_virtual/_plugin-vue_export-helper.js +9 -0
- package/lib/common/colors.d.ts +7 -0
- package/lib/common/colors.js +19 -0
- package/lib/common/icons.d.ts +17 -0
- package/lib/common/icons.js +19 -0
- package/lib/common/utils.d.ts +38 -0
- package/lib/common/utils.js +25 -0
- package/lib/components/accordion/Accordion.vue.d.ts +60 -0
- package/lib/components/accordion/Accordion.vue.js +40 -0
- package/lib/components/accordion/Accordion.vue2.js +4 -0
- package/lib/components/accordion/AccordionItem.vue.d.ts +88 -0
- package/lib/components/accordion/AccordionItem.vue.js +138 -0
- package/lib/components/accordion/AccordionItem.vue2.js +4 -0
- package/lib/components/accordion/__tests__/Accordion.spec.d.ts +1 -0
- package/lib/components/accordion/index.d.ts +4 -0
- package/lib/components/accordion/theme/Accordion.base.theme.d.ts +3 -0
- package/lib/components/accordion/theme/Accordion.base.theme.js +8 -0
- package/lib/components/accordion/theme/Accordion.carbon.theme.d.ts +3 -0
- package/lib/components/accordion/theme/Accordion.carbon.theme.js +8 -0
- package/lib/components/accordion/theme/AccordionItem.base.theme.d.ts +3 -0
- package/lib/components/accordion/theme/AccordionItem.base.theme.js +16 -0
- package/lib/components/accordion/theme/AccordionItem.carbon.theme.d.ts +3 -0
- package/lib/components/accordion/theme/AccordionItem.carbon.theme.js +16 -0
- package/lib/components/alert/Alert.vue.d.ts +61 -0
- package/lib/components/alert/Alert.vue.js +9 -0
- package/lib/components/alert/Alert.vue2.js +61 -0
- package/lib/components/alert/Alert.vue3.js +8 -0
- package/lib/components/alert/__tests__/Alert.spec.d.ts +1 -0
- package/lib/components/alert/index.d.ts +2 -0
- package/lib/components/alert/theme/Alert.base.theme.d.ts +3 -0
- package/lib/components/alert/theme/Alert.base.theme.js +41 -0
- package/lib/components/alert/theme/Alert.carbon.theme.d.ts +3 -0
- package/lib/components/alert/theme/Alert.carbon.theme.js +41 -0
- package/lib/components/avatar/Avatar.vue.d.ts +82 -0
- package/lib/components/avatar/Avatar.vue.js +9 -0
- package/lib/components/avatar/Avatar.vue2.js +75 -0
- package/lib/components/avatar/Avatar.vue3.js +7 -0
- package/lib/components/avatar/__tests__/Avatar.spec.d.ts +1 -0
- package/lib/components/avatar/index.d.ts +2 -0
- package/lib/components/avatar/theme/Avatar.base.theme.d.ts +3 -0
- package/lib/components/avatar/theme/Avatar.base.theme.js +25 -0
- package/lib/components/avatar/theme/Avatar.carbon.theme.d.ts +3 -0
- package/lib/components/avatar/theme/Avatar.carbon.theme.js +5 -0
- package/lib/components/badge/Badge.vue.d.ts +123 -0
- package/lib/components/badge/Badge.vue.js +93 -0
- package/lib/components/badge/Badge.vue2.js +4 -0
- package/lib/components/badge/__tests__/Badge.spec.d.ts +1 -0
- package/lib/components/badge/index.d.ts +2 -0
- package/lib/components/badge/theme/Badge.base.theme.d.ts +3 -0
- package/lib/components/badge/theme/Badge.base.theme.js +12 -0
- package/lib/components/badge/theme/Badge.carbon.theme.d.ts +3 -0
- package/lib/components/badge/theme/Badge.carbon.theme.js +5 -0
- package/lib/components/breadcrumbs/Breadcrumbs.vue.d.ts +62 -0
- package/lib/components/breadcrumbs/Breadcrumbs.vue.js +69 -0
- package/lib/components/breadcrumbs/Breadcrumbs.vue2.js +4 -0
- package/lib/components/breadcrumbs/__tests__/Breadcrumbs.spec.d.ts +1 -0
- package/lib/components/breadcrumbs/index.d.ts +2 -0
- package/lib/components/breadcrumbs/theme/Breadcrumbs.base.theme.d.ts +3 -0
- package/lib/components/breadcrumbs/theme/Breadcrumbs.base.theme.js +10 -0
- package/lib/components/breadcrumbs/theme/Breadcrumbs.carbon.theme.d.ts +3 -0
- package/lib/components/breadcrumbs/theme/Breadcrumbs.carbon.theme.js +10 -0
- package/lib/components/button/Button.vue.d.ts +145 -0
- package/lib/components/button/Button.vue.js +9 -0
- package/lib/components/button/Button.vue2.js +117 -0
- package/lib/components/button/Button.vue3.js +8 -0
- package/lib/components/button/ButtonGroup.vue.d.ts +113 -0
- package/lib/components/button/ButtonGroup.vue.js +9 -0
- package/lib/components/button/ButtonGroup.vue2.js +53 -0
- package/lib/components/button/ButtonGroup.vue3.js +7 -0
- package/lib/components/button/__tests__/ Button.spec.d.ts +1 -0
- package/lib/components/button/__tests__/ ButtonGroup.spec.d.ts +1 -0
- package/lib/components/button/index.d.ts +4 -0
- package/lib/components/button/theme/Button.base.theme.d.ts +3 -0
- package/lib/components/button/theme/Button.base.theme.js +138 -0
- package/lib/components/button/theme/Button.carbon.theme.d.ts +3 -0
- package/lib/components/button/theme/Button.carbon.theme.js +138 -0
- package/lib/components/button/theme/ButtonGroup.base.theme.d.ts +3 -0
- package/lib/components/button/theme/ButtonGroup.base.theme.js +8 -0
- package/lib/components/button/theme/ButtonGroup.carbon.theme.d.ts +3 -0
- package/lib/components/button/theme/ButtonGroup.carbon.theme.js +8 -0
- package/lib/components/card/Card.vue.d.ts +37 -0
- package/lib/components/card/Card.vue.js +30 -0
- package/lib/components/card/Card.vue2.js +4 -0
- package/lib/components/card/__tests__/Card.spec.d.ts +1 -0
- package/lib/components/card/index.d.ts +2 -0
- package/lib/components/card/theme/Card.base.theme.d.ts +3 -0
- package/lib/components/card/theme/Card.base.theme.js +8 -0
- package/lib/components/card/theme/Card.carbon.theme.d.ts +3 -0
- package/lib/components/card/theme/Card.carbon.theme.js +5 -0
- package/lib/components/carousel/Carousel.vue.d.ts +85 -0
- package/lib/components/carousel/Carousel.vue.js +94 -0
- package/lib/components/carousel/Carousel.vue2.js +4 -0
- package/lib/components/carousel/CarouselSlide.vue.d.ts +22 -0
- package/lib/components/carousel/CarouselSlide.vue.js +9 -0
- package/lib/components/carousel/CarouselSlide.vue2.js +25 -0
- package/lib/components/carousel/CarouselSlide.vue3.js +6 -0
- package/lib/components/carousel/__tests__/Carousel.spec.d.ts +1 -0
- package/lib/components/carousel/index.d.ts +4 -0
- package/lib/components/carousel/theme/Carousel.base.theme.d.ts +3 -0
- package/lib/components/carousel/theme/Carousel.base.theme.js +16 -0
- package/lib/components/carousel/theme/Carousel.carbon.theme.d.ts +3 -0
- package/lib/components/carousel/theme/Carousel.carbon.theme.js +5 -0
- package/lib/components/carousel/theme/CarouselSlide.base.theme.d.ts +3 -0
- package/lib/components/carousel/theme/CarouselSlide.base.theme.js +8 -0
- package/lib/components/carousel/theme/CarouselSlide.carbon.theme.d.ts +3 -0
- package/lib/components/carousel/theme/CarouselSlide.carbon.theme.js +5 -0
- package/lib/components/checkbox/Checkbox.vue.d.ts +155 -0
- package/lib/components/checkbox/Checkbox.vue.js +9 -0
- package/lib/components/checkbox/Checkbox.vue2.js +142 -0
- package/lib/components/checkbox/Checkbox.vue3.js +6 -0
- package/lib/components/checkbox/__tests__/Checkbox.spec.d.ts +1 -0
- package/lib/components/checkbox/index.d.ts +2 -0
- package/lib/components/checkbox/theme/Checkbox.base.theme.d.ts +3 -0
- package/lib/components/checkbox/theme/Checkbox.base.theme.js +59 -0
- package/lib/components/checkbox/theme/Checkbox.carbon.theme.d.ts +3 -0
- package/lib/components/checkbox/theme/Checkbox.carbon.theme.js +59 -0
- package/lib/components/container/Container.vue.d.ts +33 -0
- package/lib/components/container/Container.vue.js +29 -0
- package/lib/components/container/Container.vue2.js +4 -0
- package/lib/components/container/__tests__/Container.spec.d.ts +1 -0
- package/lib/components/container/index.d.ts +2 -0
- package/lib/components/container/theme/Container.base.theme.d.ts +3 -0
- package/lib/components/container/theme/Container.base.theme.js +8 -0
- package/lib/components/container/theme/Container.carbon.theme.d.ts +3 -0
- package/lib/components/container/theme/Container.carbon.theme.js +5 -0
- package/lib/components/divider/Divider.vue.d.ts +20 -0
- package/lib/components/divider/Divider.vue.js +52 -0
- package/lib/components/divider/Divider.vue2.js +4 -0
- package/lib/components/divider/__tests__/Divider.spec.d.ts +1 -0
- package/lib/components/divider/index.d.ts +2 -0
- package/lib/components/divider/theme/Divider.base.theme.d.ts +3 -0
- package/lib/components/divider/theme/Divider.base.theme.js +10 -0
- package/lib/components/divider/theme/Divider.carbon.theme.d.ts +3 -0
- package/lib/components/divider/theme/Divider.carbon.theme.js +5 -0
- package/lib/components/drawer/Drawer.vue.d.ts +101 -0
- package/lib/components/drawer/Drawer.vue.js +170 -0
- package/lib/components/drawer/Drawer.vue2.js +4 -0
- package/lib/components/drawer/__tests__/Drawer.spec.d.ts +1 -0
- package/lib/components/drawer/index.d.ts +2 -0
- package/lib/components/drawer/theme/Drawer.base.theme.d.ts +3 -0
- package/lib/components/drawer/theme/Drawer.base.theme.js +9 -0
- package/lib/components/drawer/theme/Drawer.carbon.theme.d.ts +3 -0
- package/lib/components/drawer/theme/Drawer.carbon.theme.js +5 -0
- package/lib/components/form/Form.vue.d.ts +103 -0
- package/lib/components/form/Form.vue.js +109 -0
- package/lib/components/form/Form.vue2.js +4 -0
- package/lib/components/form/__tests__/Form.spec.d.ts +1 -0
- package/lib/components/form/index.d.ts +2 -0
- package/lib/components/form/theme/Form.base.theme.d.ts +3 -0
- package/lib/components/form/theme/Form.base.theme.js +12 -0
- package/lib/components/form/theme/Form.carbon.theme.d.ts +3 -0
- package/lib/components/form/theme/Form.carbon.theme.js +12 -0
- package/lib/components/formGroup/FormGroup.vue.d.ts +132 -0
- package/lib/components/formGroup/FormGroup.vue.js +82 -0
- package/lib/components/formGroup/FormGroup.vue2.js +4 -0
- package/lib/components/formGroup/__tests__/FormGroup.spec.d.ts +1 -0
- package/lib/components/formGroup/index.d.ts +2 -0
- package/lib/components/formGroup/theme/FormGroup.base.theme.d.ts +3 -0
- package/lib/components/formGroup/theme/FormGroup.base.theme.js +11 -0
- package/lib/components/formGroup/theme/FormGroup.carbon.theme.d.ts +3 -0
- package/lib/components/formGroup/theme/FormGroup.carbon.theme.js +11 -0
- package/lib/components/icon/Icon.vue.d.ts +64 -0
- package/lib/components/icon/Icon.vue.js +73 -0
- package/lib/components/icon/Icon.vue2.js +4 -0
- package/lib/components/icon/__tests__/Icon.spec.d.ts +1 -0
- package/lib/components/icon/index.d.ts +2 -0
- package/lib/components/icon/theme/Icon.base.theme.d.ts +3 -0
- package/lib/components/icon/theme/Icon.base.theme.js +11 -0
- package/lib/components/icon/theme/Icon.carbon.theme.d.ts +3 -0
- package/lib/components/icon/theme/Icon.carbon.theme.js +8 -0
- package/lib/components/image/Image.vue.d.ts +15 -0
- package/lib/components/image/Image.vue.js +31 -0
- package/lib/components/image/Image.vue2.js +4 -0
- package/lib/components/image/__tests__/Image.spec.d.ts +1 -0
- package/lib/components/image/index.d.ts +2 -0
- package/lib/components/image/theme/Image.base.theme.d.ts +3 -0
- package/lib/components/image/theme/Image.base.theme.js +8 -0
- package/lib/components/image/theme/Image.carbon.theme.d.ts +3 -0
- package/lib/components/image/theme/Image.carbon.theme.js +5 -0
- package/lib/components/index.d.ts +42 -0
- package/lib/components/index.js +111 -0
- package/lib/components/input/Input.vue.d.ts +208 -0
- package/lib/components/input/Input.vue.js +147 -0
- package/lib/components/input/Input.vue2.js +4 -0
- package/lib/components/input/__tests__/Input.spec.d.ts +1 -0
- package/lib/components/input/index.d.ts +2 -0
- package/lib/components/input/theme/Input.base.theme.d.ts +3 -0
- package/lib/components/input/theme/Input.base.theme.js +17 -0
- package/lib/components/input/theme/Input.carbon.theme.d.ts +3 -0
- package/lib/components/input/theme/Input.carbon.theme.js +17 -0
- package/lib/components/inputFooter/InputFooter.vue.d.ts +18 -0
- package/lib/components/inputFooter/InputFooter.vue.js +27 -0
- package/lib/components/inputFooter/InputFooter.vue2.js +4 -0
- package/lib/components/inputFooter/__tests__/InputFooter.spec.d.ts +1 -0
- package/lib/components/inputFooter/index.d.ts +2 -0
- package/lib/components/inputFooter/theme/InputFooter.base.theme.d.ts +3 -0
- package/lib/components/inputFooter/theme/InputFooter.base.theme.js +10 -0
- package/lib/components/inputFooter/theme/InputFooter.carbon.theme.d.ts +3 -0
- package/lib/components/inputFooter/theme/InputFooter.carbon.theme.js +10 -0
- package/lib/components/label/Label.vue.d.ts +68 -0
- package/lib/components/label/Label.vue.js +48 -0
- package/lib/components/label/Label.vue2.js +4 -0
- package/lib/components/label/__tests__/Label.spec.d.ts +1 -0
- package/lib/components/label/index.d.ts +2 -0
- package/lib/components/label/theme/Label.base.theme.d.ts +3 -0
- package/lib/components/label/theme/Label.base.theme.js +15 -0
- package/lib/components/label/theme/Label.carbon.theme.d.ts +3 -0
- package/lib/components/label/theme/Label.carbon.theme.js +12 -0
- package/lib/components/link/Link.vue.d.ts +61 -0
- package/lib/components/link/Link.vue.js +9 -0
- package/lib/components/link/Link.vue2.js +47 -0
- package/lib/components/link/Link.vue3.js +8 -0
- package/lib/components/link/__tests__/Link.spec.d.ts +1 -0
- package/lib/components/link/index.d.ts +2 -0
- package/lib/components/link/theme/Link.base.theme.d.ts +3 -0
- package/lib/components/link/theme/Link.base.theme.js +25 -0
- package/lib/components/link/theme/Link.carbon.theme.d.ts +3 -0
- package/lib/components/link/theme/Link.carbon.theme.js +5 -0
- package/lib/components/loader/Loader.vue.d.ts +49 -0
- package/lib/components/loader/Loader.vue.js +54 -0
- package/lib/components/loader/Loader.vue2.js +4 -0
- package/lib/components/loader/__tests__/Loader.spec.d.ts +1 -0
- package/lib/components/loader/index.d.ts +2 -0
- package/lib/components/loader/theme/Loader.base.theme.d.ts +3 -0
- package/lib/components/loader/theme/Loader.base.theme.js +11 -0
- package/lib/components/loader/theme/Loader.carbon.theme.d.ts +3 -0
- package/lib/components/loader/theme/Loader.carbon.theme.js +11 -0
- package/lib/components/menu/Menu.vue.d.ts +123 -0
- package/lib/components/menu/Menu.vue.js +135 -0
- package/lib/components/menu/Menu.vue2.js +4 -0
- package/lib/components/menu/MenuItem.vue.d.ts +154 -0
- package/lib/components/menu/MenuItem.vue.js +9 -0
- package/lib/components/menu/MenuItem.vue2.js +142 -0
- package/lib/components/menu/MenuItem.vue3.js +7 -0
- package/lib/components/menu/__tests__/Menu.spec.d.ts +1 -0
- package/lib/components/menu/__tests__/MenuItem.spec.d.ts +1 -0
- package/lib/components/menu/index.d.ts +4 -0
- package/lib/components/menu/theme/Menu.base.theme.d.ts +3 -0
- package/lib/components/menu/theme/Menu.base.theme.js +8 -0
- package/lib/components/menu/theme/Menu.carbon.theme.d.ts +3 -0
- package/lib/components/menu/theme/Menu.carbon.theme.js +5 -0
- package/lib/components/menu/theme/MenuItem.base.theme.d.ts +3 -0
- package/lib/components/menu/theme/MenuItem.base.theme.js +86 -0
- package/lib/components/menu/theme/MenuItem.carbon.theme.d.ts +3 -0
- package/lib/components/menu/theme/MenuItem.carbon.theme.js +5 -0
- package/lib/components/modal/Modal.vue.d.ts +150 -0
- package/lib/components/modal/Modal.vue.js +179 -0
- package/lib/components/modal/Modal.vue2.js +4 -0
- package/lib/components/modal/__tests__/Modal.spec.d.ts +1 -0
- package/lib/components/modal/index.d.ts +2 -0
- package/lib/components/modal/theme/Modal.base.theme.d.ts +3 -0
- package/lib/components/modal/theme/Modal.base.theme.js +23 -0
- package/lib/components/modal/theme/Modal.carbon.theme.d.ts +3 -0
- package/lib/components/modal/theme/Modal.carbon.theme.js +29 -0
- package/lib/components/notifications/Notifications.vue.d.ts +143 -0
- package/lib/components/notifications/Notifications.vue.js +236 -0
- package/lib/components/notifications/Notifications.vue2.js +4 -0
- package/lib/components/notifications/__tests__/Notifications.spec.d.ts +1 -0
- package/lib/components/notifications/index.d.ts +2 -0
- package/lib/components/notifications/theme/Notifications.base.theme.d.ts +3 -0
- package/lib/components/notifications/theme/Notifications.base.theme.js +10 -0
- package/lib/components/notifications/theme/Notifications.carbon.theme.d.ts +3 -0
- package/lib/components/notifications/theme/Notifications.carbon.theme.js +10 -0
- package/lib/components/pagination/Pagination.vue.d.ts +76 -0
- package/lib/components/pagination/Pagination.vue.js +131 -0
- package/lib/components/pagination/Pagination.vue2.js +4 -0
- package/lib/components/pagination/PaginationItem.vue.d.ts +52 -0
- package/lib/components/pagination/PaginationItem.vue.js +47 -0
- package/lib/components/pagination/PaginationItem.vue2.js +4 -0
- package/lib/components/pagination/__tests__/Pagination.spec.d.ts +1 -0
- package/lib/components/pagination/__tests__/PaginationItem.spec.d.ts +1 -0
- package/lib/components/pagination/index.d.ts +4 -0
- package/lib/components/pagination/theme/Pagination.base.theme.d.ts +3 -0
- package/lib/components/pagination/theme/Pagination.base.theme.js +13 -0
- package/lib/components/pagination/theme/Pagination.carbon.theme.d.ts +3 -0
- package/lib/components/pagination/theme/Pagination.carbon.theme.js +5 -0
- package/lib/components/pagination/theme/PaginationItem.base.theme.d.ts +3 -0
- package/lib/components/pagination/theme/PaginationItem.base.theme.js +8 -0
- package/lib/components/pagination/theme/PaginationItem.carbon.theme.d.ts +3 -0
- package/lib/components/pagination/theme/PaginationItem.carbon.theme.js +5 -0
- package/lib/components/popover/Popover.vue.d.ts +211 -0
- package/lib/components/popover/Popover.vue.js +129 -0
- package/lib/components/popover/Popover.vue2.js +4 -0
- package/lib/components/popover/Popover.vue3.js +5 -0
- package/lib/components/popover/PopoverContainer.vue.d.ts +33 -0
- package/lib/components/popover/PopoverContainer.vue.js +29 -0
- package/lib/components/popover/PopoverContainer.vue2.js +4 -0
- package/lib/components/popover/__tests__/Popover.spec.d.ts +1 -0
- package/lib/components/popover/__tests__/PopoverContainer.spec.d.ts +1 -0
- package/lib/components/popover/index.d.ts +4 -0
- package/lib/components/popover/theme/Popover.base.theme.d.ts +3 -0
- package/lib/components/popover/theme/Popover.base.theme.js +9 -0
- package/lib/components/popover/theme/Popover.carbon.theme.d.ts +3 -0
- package/lib/components/popover/theme/Popover.carbon.theme.js +5 -0
- package/lib/components/popover/theme/PopoverContainer.base.theme.d.ts +3 -0
- package/lib/components/popover/theme/PopoverContainer.base.theme.js +8 -0
- package/lib/components/popover/theme/PopoverContainer.carbon.theme.d.ts +3 -0
- package/lib/components/popover/theme/PopoverContainer.carbon.theme.js +8 -0
- package/lib/components/progress/Progress.vue.d.ts +63 -0
- package/lib/components/progress/Progress.vue.js +50 -0
- package/lib/components/progress/Progress.vue2.js +4 -0
- package/lib/components/progress/__tests__/Progress.spec.d.ts +1 -0
- package/lib/components/progress/index.d.ts +2 -0
- package/lib/components/progress/theme/Progress.base.theme.d.ts +3 -0
- package/lib/components/progress/theme/Progress.base.theme.js +18 -0
- package/lib/components/progress/theme/Progress.carbon.theme.d.ts +3 -0
- package/lib/components/progress/theme/Progress.carbon.theme.js +5 -0
- package/lib/components/radio/Radio.vue.d.ts +149 -0
- package/lib/components/radio/Radio.vue.js +9 -0
- package/lib/components/radio/Radio.vue2.js +132 -0
- package/lib/components/radio/Radio.vue3.js +10 -0
- package/lib/components/radio/__tests__/Radio.spec.d.ts +1 -0
- package/lib/components/radio/index.d.ts +2 -0
- package/lib/components/radio/theme/Radio.base.theme.d.ts +3 -0
- package/lib/components/radio/theme/Radio.base.theme.js +70 -0
- package/lib/components/radio/theme/Radio.carbon.theme.d.ts +3 -0
- package/lib/components/radio/theme/Radio.carbon.theme.js +64 -0
- package/lib/components/scroll/Scroll.vue.d.ts +47 -0
- package/lib/components/scroll/Scroll.vue.js +9 -0
- package/lib/components/scroll/Scroll.vue2.js +63 -0
- package/lib/components/scroll/Scroll.vue3.js +17 -0
- package/lib/components/scroll/__tests__/Scroll.spec.d.ts +1 -0
- package/lib/components/scroll/index.d.ts +2 -0
- package/lib/components/scroll/theme/Scroll.base.theme.d.ts +3 -0
- package/lib/components/scroll/theme/Scroll.base.theme.js +8 -0
- package/lib/components/scroll/theme/Scroll.carbon.theme.d.ts +3 -0
- package/lib/components/scroll/theme/Scroll.carbon.theme.js +5 -0
- package/lib/components/select/Select.vue.d.ts +150 -0
- package/lib/components/select/Select.vue.js +346 -0
- package/lib/components/select/Select.vue2.js +4 -0
- package/lib/components/select/__tests__/Select.spec.d.ts +1 -0
- package/lib/components/select/index.d.ts +2 -0
- package/lib/components/select/theme/Select.base.theme.d.ts +3 -0
- package/lib/components/select/theme/Select.base.theme.js +22 -0
- package/lib/components/select/theme/Select.carbon.theme.d.ts +3 -0
- package/lib/components/select/theme/Select.carbon.theme.js +22 -0
- package/lib/components/skeleton/Skeleton.vue.d.ts +26 -0
- package/lib/components/skeleton/Skeleton.vue.js +29 -0
- package/lib/components/skeleton/Skeleton.vue2.js +4 -0
- package/lib/components/skeleton/__tests__/Skeleton.spec.d.ts +1 -0
- package/lib/components/skeleton/index.d.ts +2 -0
- package/lib/components/skeleton/theme/Skeleton.base.theme.d.ts +3 -0
- package/lib/components/skeleton/theme/Skeleton.base.theme.js +8 -0
- package/lib/components/skeleton/theme/Skeleton.carbon.theme.d.ts +3 -0
- package/lib/components/skeleton/theme/Skeleton.carbon.theme.js +5 -0
- package/lib/components/slider/Slider.vue.d.ts +165 -0
- package/lib/components/slider/Slider.vue.js +148 -0
- package/lib/components/slider/Slider.vue2.js +4 -0
- package/lib/components/slider/__tests__/Slider.spec.d.ts +1 -0
- package/lib/components/slider/index.d.ts +2 -0
- package/lib/components/slider/theme/Slider.base.theme.d.ts +3 -0
- package/lib/components/slider/theme/Slider.base.theme.js +16 -0
- package/lib/components/slider/theme/Slider.carbon.theme.d.ts +3 -0
- package/lib/components/slider/theme/Slider.carbon.theme.js +16 -0
- package/lib/components/spacer/Spacer.d.ts +2 -0
- package/lib/components/spacer/Spacer.js +12 -0
- package/lib/components/spacer/__tests__/Spacer.spec.d.ts +1 -0
- package/lib/components/spacer/index.d.ts +1 -0
- package/lib/components/spinner/Spinner.vue.d.ts +38 -0
- package/lib/components/spinner/Spinner.vue.js +27 -0
- package/lib/components/spinner/Spinner.vue2.js +4 -0
- package/lib/components/spinner/__tests__/Spinner.spec.d.ts +1 -0
- package/lib/components/spinner/index.d.ts +2 -0
- package/lib/components/stepper/Stepper.vue.d.ts +137 -0
- package/lib/components/stepper/Stepper.vue.js +128 -0
- package/lib/components/stepper/Stepper.vue2.js +4 -0
- package/lib/components/stepper/__tests__/Stepper.spec.d.ts +1 -0
- package/lib/components/stepper/index.d.ts +2 -0
- package/lib/components/stepper/theme/Stepper.base.theme.d.ts +3 -0
- package/lib/components/stepper/theme/Stepper.base.theme.js +20 -0
- package/lib/components/stepper/theme/Stepper.carbon.theme.d.ts +3 -0
- package/lib/components/stepper/theme/Stepper.carbon.theme.js +5 -0
- package/lib/components/tab/Tab.vue.d.ts +92 -0
- package/lib/components/tab/Tab.vue.js +148 -0
- package/lib/components/tab/Tab.vue2.js +4 -0
- package/lib/components/tab/TabGroup.vue.d.ts +126 -0
- package/lib/components/tab/TabGroup.vue.js +135 -0
- package/lib/components/tab/TabGroup.vue2.js +4 -0
- package/lib/components/tab/__tests__/Tab.spec.d.ts +1 -0
- package/lib/components/tab/__tests__/TabGroup.spec.d.ts +1 -0
- package/lib/components/tab/index.d.ts +4 -0
- package/lib/components/tab/theme/Tab.base.theme.d.ts +3 -0
- package/lib/components/tab/theme/Tab.base.theme.js +15 -0
- package/lib/components/tab/theme/Tab.carbon.theme.d.ts +3 -0
- package/lib/components/tab/theme/Tab.carbon.theme.js +18 -0
- package/lib/components/tab/theme/TabGroup.base.theme.d.ts +3 -0
- package/lib/components/tab/theme/TabGroup.base.theme.js +31 -0
- package/lib/components/tab/theme/TabGroup.carbon.theme.d.ts +3 -0
- package/lib/components/tab/theme/TabGroup.carbon.theme.js +31 -0
- package/lib/components/table/Table.vue.d.ts +284 -0
- package/lib/components/table/Table.vue.js +146 -0
- package/lib/components/table/Table.vue2.js +4 -0
- package/lib/components/table/TableBody.d.ts +2 -0
- package/lib/components/table/TableBody.js +15 -0
- package/lib/components/table/TableCell.vue.d.ts +66 -0
- package/lib/components/table/TableCell.vue.js +42 -0
- package/lib/components/table/TableCell.vue2.js +4 -0
- package/lib/components/table/TableHead.d.ts +2 -0
- package/lib/components/table/TableHead.js +19 -0
- package/lib/components/table/TableHeader.vue.d.ts +58 -0
- 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 +30 -0
- package/lib/components/table/TableRow.vue.js +32 -0
- package/lib/components/table/TableRow.vue2.js +4 -0
- package/lib/components/table/__tests__/Table.spec.d.ts +1 -0
- package/lib/components/table/index.d.ts +9 -0
- package/lib/components/table/theme/Table.base.theme.d.ts +3 -0
- package/lib/components/table/theme/Table.base.theme.js +12 -0
- package/lib/components/table/theme/Table.carbon.theme.d.ts +3 -0
- package/lib/components/table/theme/Table.carbon.theme.js +5 -0
- package/lib/components/table/theme/TableCell.base.theme.d.ts +3 -0
- package/lib/components/table/theme/TableCell.base.theme.js +11 -0
- package/lib/components/table/theme/TableCell.carbon.theme.d.ts +3 -0
- package/lib/components/table/theme/TableCell.carbon.theme.js +5 -0
- package/lib/components/tag/Tag.vue.d.ts +76 -0
- package/lib/components/tag/Tag.vue.js +60 -0
- package/lib/components/tag/Tag.vue2.js +4 -0
- package/lib/components/tag/__tests__/Tag.spec.d.ts +1 -0
- package/lib/components/tag/index.d.ts +2 -0
- package/lib/components/tag/theme/Tag.base.theme.d.ts +3 -0
- package/lib/components/tag/theme/Tag.base.theme.js +23 -0
- package/lib/components/tag/theme/Tag.carbon.theme.d.ts +3 -0
- package/lib/components/tag/theme/Tag.carbon.theme.js +24 -0
- package/lib/components/textarea/Textarea.vue.d.ts +173 -0
- package/lib/components/textarea/Textarea.vue.js +113 -0
- package/lib/components/textarea/Textarea.vue2.js +4 -0
- package/lib/components/textarea/__tests__/Textarea.spec.d.ts +1 -0
- package/lib/components/textarea/index.d.ts +2 -0
- package/lib/components/textarea/theme/Textarea.base.theme.d.ts +3 -0
- package/lib/components/textarea/theme/Textarea.base.theme.js +12 -0
- package/lib/components/textarea/theme/Textarea.carbon.theme.d.ts +3 -0
- package/lib/components/textarea/theme/Textarea.carbon.theme.js +12 -0
- package/lib/components/themeProvider/ThemeProvider.vue.d.ts +15 -0
- package/lib/components/themeProvider/ThemeProvider.vue.js +18 -0
- package/lib/components/themeProvider/ThemeProvider.vue2.js +4 -0
- package/lib/components/themeProvider/index.d.ts +1 -0
- package/lib/components/toggle/Toggle.vue.d.ts +134 -0
- package/lib/components/toggle/Toggle.vue.js +108 -0
- package/lib/components/toggle/Toggle.vue2.js +4 -0
- package/lib/components/toggle/__tests__/Toggle.spec.d.ts +1 -0
- package/lib/components/toggle/index.d.ts +2 -0
- package/lib/components/toggle/theme/Toggle.base.theme.d.ts +3 -0
- package/lib/components/toggle/theme/Toggle.base.theme.js +29 -0
- package/lib/components/toggle/theme/Toggle.carbon.theme.d.ts +3 -0
- package/lib/components/toggle/theme/Toggle.carbon.theme.js +5 -0
- package/lib/components/tooltip/Tooltip.vue.d.ts +13 -0
- package/lib/components/tooltip/Tooltip.vue.js +31 -0
- package/lib/components/tooltip/Tooltip.vue2.js +4 -0
- package/lib/components/tooltip/__tests__/Tooltip.spec.d.ts +1 -0
- package/lib/components/tooltip/index.d.ts +2 -0
- package/lib/composables/index.d.ts +7 -0
- package/lib/composables/keys.d.ts +19 -0
- package/lib/composables/keys.js +12 -0
- package/lib/composables/useCSS.d.ts +6 -0
- package/lib/composables/useCSS.js +26 -0
- package/lib/composables/useColors.d.ts +32 -0
- package/lib/composables/useColors.js +52 -0
- package/lib/composables/useCommon.d.ts +15 -0
- package/lib/composables/useCommon.js +17 -0
- package/lib/composables/useFocusTrap.d.ts +6 -0
- package/lib/composables/useFocusTrap.js +45 -0
- package/lib/composables/useInputtable.d.ts +50 -0
- package/lib/composables/useInputtable.js +110 -0
- package/lib/composables/useInteractive.d.ts +23 -0
- package/lib/composables/useInteractive.js +22 -0
- package/lib/composables/useNotifications.d.ts +2 -0
- package/lib/composables/useNotifications.js +9 -0
- package/lib/composables/useTheme.d.ts +29 -0
- package/lib/composables/useTheme.js +59 -0
- package/lib/create.d.ts +12 -0
- package/lib/create.js +21 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +145 -0
- package/lib/index.umd.js +166 -0
- package/lib/install.d.ts +4 -0
- package/lib/install.js +10 -0
- package/lib/node_modules/.pnpm/@floating-ui_core@1.5.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +497 -0
- package/lib/node_modules/.pnpm/@floating-ui_dom@1.1.1/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.js +217 -0
- package/lib/node_modules/.pnpm/@floating-ui_utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +116 -0
- package/lib/node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.3.9/node_modules/@vueuse/core/index.js +379 -0
- package/lib/node_modules/.pnpm/@vueuse_shared@10.2.0_vue@3.3.9/node_modules/@vueuse/shared/index.js +90 -0
- package/lib/node_modules/.pnpm/floating-vue@5.2.0_vue@3.3.9/node_modules/floating-vue/dist/floating-vue.js +1346 -0
- package/lib/nuxt.mjs +33 -0
- package/lib/nuxt.plugin.js +8 -0
- package/lib/tailwind.preset.js +41 -0
- package/lib/theme.d.ts +59 -0
- package/lib/theme.js +14 -0
- package/lib/themes/base/components.d.ts +46 -0
- package/lib/themes/base/components.js +94 -0
- package/lib/themes/base/index.d.ts +3 -0
- package/lib/themes/base/index.js +14 -0
- package/lib/themes/base/styles.css.js +87 -0
- package/lib/themes/carbon/components.d.ts +46 -0
- package/lib/themes/carbon/components.js +94 -0
- package/lib/themes/carbon/index.d.ts +3 -0
- package/lib/themes/carbon/index.js +14 -0
- package/lib/themes/carbon/styles.css.js +86 -0
- package/lib/themes/index.d.ts +2 -0
- package/lib/version.d.ts +2 -0
- package/lib/version.js +4 -0
- package/package.json +110 -0
- package/src/common/colors.ts +36 -0
- package/src/common/icons.ts +17 -0
- package/src/common/utils.ts +93 -0
- package/src/components/accordion/Accordion.vue +51 -0
- package/src/components/accordion/AccordionItem.vue +183 -0
- package/src/components/accordion/__tests__/Accordion.spec.ts +11 -0
- package/src/components/accordion/index.ts +4 -0
- package/src/components/accordion/theme/Accordion.base.theme.ts +9 -0
- package/src/components/accordion/theme/Accordion.carbon.theme.ts +9 -0
- package/src/components/accordion/theme/AccordionItem.base.theme.ts +35 -0
- package/src/components/accordion/theme/AccordionItem.carbon.theme.ts +35 -0
- package/src/components/alert/Alert.vue +101 -0
- package/src/components/alert/__tests__/Alert.spec.ts +11 -0
- package/src/components/alert/index.ts +2 -0
- package/src/components/alert/theme/Alert.base.theme.ts +58 -0
- package/src/components/alert/theme/Alert.carbon.theme.ts +59 -0
- package/src/components/avatar/Avatar.vue +108 -0
- package/src/components/avatar/__tests__/Avatar.spec.ts +11 -0
- package/src/components/avatar/index.ts +2 -0
- package/src/components/avatar/theme/Avatar.base.theme.ts +41 -0
- package/src/components/avatar/theme/Avatar.carbon.theme.ts +7 -0
- package/src/components/badge/Badge.vue +129 -0
- package/src/components/badge/__tests__/Badge.spec.ts +11 -0
- package/src/components/badge/index.ts +2 -0
- package/src/components/badge/theme/Badge.base.theme.ts +15 -0
- package/src/components/badge/theme/Badge.carbon.theme.ts +7 -0
- package/src/components/breadcrumbs/Breadcrumbs.vue +75 -0
- package/src/components/breadcrumbs/__tests__/Breadcrumbs.spec.ts +11 -0
- package/src/components/breadcrumbs/index.ts +2 -0
- package/src/components/breadcrumbs/theme/Breadcrumbs.base.theme.ts +11 -0
- package/src/components/breadcrumbs/theme/Breadcrumbs.carbon.theme.ts +12 -0
- package/src/components/button/Button.vue +191 -0
- package/src/components/button/ButtonGroup.vue +90 -0
- package/src/components/button/__tests__/ Button.spec.ts +11 -0
- package/src/components/button/__tests__/ ButtonGroup.spec.ts +11 -0
- package/src/components/button/index.ts +5 -0
- package/src/components/button/theme/Button.base.theme.ts +229 -0
- package/src/components/button/theme/Button.carbon.theme.ts +237 -0
- package/src/components/button/theme/ButtonGroup.base.theme.ts +9 -0
- package/src/components/button/theme/ButtonGroup.carbon.theme.ts +9 -0
- package/src/components/card/Card.vue +38 -0
- package/src/components/card/__tests__/Card.spec.ts +11 -0
- package/src/components/card/index.ts +2 -0
- package/src/components/card/theme/Card.base.theme.ts +9 -0
- package/src/components/card/theme/Card.carbon.theme.ts +7 -0
- package/src/components/carousel/Carousel.vue +138 -0
- package/src/components/carousel/CarouselSlide.vue +45 -0
- package/src/components/carousel/__tests__/Carousel.spec.ts +11 -0
- package/src/components/carousel/index.ts +4 -0
- package/src/components/carousel/theme/Carousel.base.theme.ts +25 -0
- package/src/components/carousel/theme/Carousel.carbon.theme.ts +7 -0
- package/src/components/carousel/theme/CarouselSlide.base.theme.ts +9 -0
- package/src/components/carousel/theme/CarouselSlide.carbon.theme.ts +7 -0
- package/src/components/checkbox/Checkbox.vue +178 -0
- package/src/components/checkbox/__tests__/Checkbox.spec.ts +11 -0
- package/src/components/checkbox/index.ts +2 -0
- package/src/components/checkbox/theme/Checkbox.base.theme.ts +108 -0
- package/src/components/checkbox/theme/Checkbox.carbon.theme.ts +108 -0
- package/src/components/container/Container.vue +37 -0
- package/src/components/container/__tests__/Container.spec.ts +11 -0
- package/src/components/container/index.ts +2 -0
- package/src/components/container/theme/Container.base.theme.ts +9 -0
- package/src/components/container/theme/Container.carbon.theme.ts +7 -0
- package/src/components/divider/Divider.vue +62 -0
- package/src/components/divider/__tests__/Divider.spec.ts +11 -0
- package/src/components/divider/index.ts +2 -0
- package/src/components/divider/theme/Divider.base.theme.ts +13 -0
- package/src/components/divider/theme/Divider.carbon.theme.ts +7 -0
- package/src/components/drawer/Drawer.vue +249 -0
- package/src/components/drawer/__tests__/Drawer.spec.ts +11 -0
- package/src/components/drawer/index.ts +2 -0
- package/src/components/drawer/theme/Drawer.base.theme.ts +11 -0
- package/src/components/drawer/theme/Drawer.carbon.theme.ts +7 -0
- package/src/components/form/Form.vue +159 -0
- package/src/components/form/__tests__/Form.spec.ts +11 -0
- package/src/components/form/index.ts +2 -0
- package/src/components/form/theme/Form.base.theme.ts +17 -0
- package/src/components/form/theme/Form.carbon.theme.ts +17 -0
- package/src/components/formGroup/FormGroup.vue +116 -0
- package/src/components/formGroup/__tests__/FormGroup.spec.ts +11 -0
- package/src/components/formGroup/index.ts +2 -0
- package/src/components/formGroup/theme/FormGroup.base.theme.ts +16 -0
- package/src/components/formGroup/theme/FormGroup.carbon.theme.ts +16 -0
- package/src/components/icon/Icon.vue +119 -0
- package/src/components/icon/__tests__/Icon.spec.ts +15 -0
- package/src/components/icon/index.ts +2 -0
- package/src/components/icon/theme/Icon.base.theme.ts +18 -0
- package/src/components/icon/theme/Icon.carbon.theme.ts +9 -0
- package/src/components/image/Image.vue +42 -0
- package/src/components/image/__tests__/Image.spec.ts +11 -0
- package/src/components/image/index.ts +2 -0
- package/src/components/image/theme/Image.base.theme.ts +9 -0
- package/src/components/image/theme/Image.carbon.theme.ts +7 -0
- package/src/components/index.ts +42 -0
- package/src/components/input/Input.vue +181 -0
- package/src/components/input/__tests__/Input.spec.ts +11 -0
- package/src/components/input/index.ts +2 -0
- package/src/components/input/theme/Input.base.theme.ts +35 -0
- package/src/components/input/theme/Input.carbon.theme.ts +37 -0
- package/src/components/inputFooter/InputFooter.vue +29 -0
- package/src/components/inputFooter/__tests__/InputFooter.spec.ts +11 -0
- package/src/components/inputFooter/index.ts +2 -0
- package/src/components/inputFooter/theme/InputFooter.base.theme.ts +11 -0
- package/src/components/inputFooter/theme/InputFooter.carbon.theme.ts +11 -0
- package/src/components/label/Label.vue +54 -0
- package/src/components/label/__tests__/Label.spec.ts +11 -0
- package/src/components/label/index.ts +2 -0
- package/src/components/label/theme/Label.base.theme.ts +27 -0
- package/src/components/label/theme/Label.carbon.theme.ts +20 -0
- package/src/components/link/Link.vue +94 -0
- package/src/components/link/__tests__/Link.spec.ts +11 -0
- package/src/components/link/index.ts +2 -0
- package/src/components/link/theme/Link.base.theme.ts +28 -0
- package/src/components/link/theme/Link.carbon.theme.ts +7 -0
- package/src/components/loader/Loader.vue +59 -0
- package/src/components/loader/__tests__/Loader.spec.ts +11 -0
- package/src/components/loader/index.ts +2 -0
- package/src/components/loader/theme/Loader.base.theme.ts +12 -0
- package/src/components/loader/theme/Loader.carbon.theme.ts +12 -0
- package/src/components/menu/Menu.vue +173 -0
- package/src/components/menu/MenuItem.vue +209 -0
- package/src/components/menu/__tests__/Menu.spec.ts +11 -0
- package/src/components/menu/__tests__/MenuItem.spec.ts +11 -0
- package/src/components/menu/index.ts +5 -0
- package/src/components/menu/theme/Menu.base.theme.ts +9 -0
- package/src/components/menu/theme/Menu.carbon.theme.ts +7 -0
- package/src/components/menu/theme/MenuItem.base.theme.ts +109 -0
- package/src/components/menu/theme/MenuItem.carbon.theme.ts +7 -0
- package/src/components/modal/Modal.vue +226 -0
- package/src/components/modal/__tests__/Modal.spec.ts +11 -0
- package/src/components/modal/index.ts +2 -0
- package/src/components/modal/theme/Modal.base.theme.ts +47 -0
- package/src/components/modal/theme/Modal.carbon.theme.ts +60 -0
- package/src/components/notifications/Notifications.vue +318 -0
- package/src/components/notifications/__tests__/Notifications.spec.ts +11 -0
- package/src/components/notifications/index.ts +9 -0
- package/src/components/notifications/theme/Notifications.base.theme.ts +13 -0
- package/src/components/notifications/theme/Notifications.carbon.theme.ts +17 -0
- package/src/components/pagination/Pagination.vue +172 -0
- package/src/components/pagination/PaginationItem.vue +57 -0
- package/src/components/pagination/__tests__/Pagination.spec.ts +11 -0
- package/src/components/pagination/__tests__/PaginationItem.spec.ts +11 -0
- package/src/components/pagination/index.ts +5 -0
- package/src/components/pagination/theme/Pagination.base.theme.ts +29 -0
- package/src/components/pagination/theme/Pagination.carbon.theme.ts +7 -0
- package/src/components/pagination/theme/PaginationItem.base.theme.ts +16 -0
- package/src/components/pagination/theme/PaginationItem.carbon.theme.ts +7 -0
- package/src/components/popover/Popover.vue +205 -0
- package/src/components/popover/PopoverContainer.vue +37 -0
- package/src/components/popover/__tests__/Popover.spec.ts +11 -0
- package/src/components/popover/__tests__/PopoverContainer.spec.ts +11 -0
- package/src/components/popover/index.ts +5 -0
- package/src/components/popover/theme/Popover.base.theme.ts +11 -0
- package/src/components/popover/theme/Popover.carbon.theme.ts +7 -0
- package/src/components/popover/theme/PopoverContainer.base.theme.ts +9 -0
- package/src/components/popover/theme/PopoverContainer.carbon.theme.ts +9 -0
- package/src/components/progress/Progress.vue +63 -0
- package/src/components/progress/__tests__/Progress.spec.ts +11 -0
- package/src/components/progress/index.ts +2 -0
- package/src/components/progress/theme/Progress.base.theme.ts +28 -0
- package/src/components/progress/theme/Progress.carbon.theme.ts +7 -0
- package/src/components/radio/Radio.vue +179 -0
- package/src/components/radio/__tests__/Radio.spec.ts +11 -0
- package/src/components/radio/index.ts +2 -0
- package/src/components/radio/theme/Radio.base.theme.ts +129 -0
- package/src/components/radio/theme/Radio.carbon.theme.ts +110 -0
- package/src/components/scroll/Scroll.vue +155 -0
- package/src/components/scroll/__tests__/Scroll.spec.ts +11 -0
- package/src/components/scroll/index.ts +2 -0
- package/src/components/scroll/theme/Scroll.base.theme.ts +9 -0
- package/src/components/scroll/theme/Scroll.carbon.theme.ts +7 -0
- package/src/components/select/Select.vue +452 -0
- package/src/components/select/__tests__/Select.spec.ts +11 -0
- package/src/components/select/index.ts +2 -0
- package/src/components/select/theme/Select.base.theme.ts +56 -0
- package/src/components/select/theme/Select.carbon.theme.ts +54 -0
- package/src/components/skeleton/Skeleton.vue +37 -0
- package/src/components/skeleton/__tests__/Skeleton.spec.ts +11 -0
- package/src/components/skeleton/index.ts +2 -0
- package/src/components/skeleton/theme/Skeleton.base.theme.ts +9 -0
- package/src/components/skeleton/theme/Skeleton.carbon.theme.ts +7 -0
- package/src/components/slider/Slider.vue +216 -0
- package/src/components/slider/__tests__/Slider.spec.ts +11 -0
- package/src/components/slider/index.ts +2 -0
- package/src/components/slider/theme/Slider.base.theme.ts +21 -0
- package/src/components/slider/theme/Slider.carbon.theme.ts +21 -0
- package/src/components/spacer/Spacer.tsx +8 -0
- package/src/components/spacer/__tests__/Spacer.spec.ts +11 -0
- package/src/components/spacer/index.ts +1 -0
- package/src/components/spinner/Spinner.vue +31 -0
- package/src/components/spinner/__tests__/Spinner.spec.ts +11 -0
- package/src/components/spinner/index.ts +2 -0
- package/src/components/stepper/Stepper.vue +153 -0
- package/src/components/stepper/__tests__/Stepper.spec.ts +11 -0
- package/src/components/stepper/index.ts +6 -0
- package/src/components/stepper/theme/Stepper.base.theme.ts +45 -0
- package/src/components/stepper/theme/Stepper.carbon.theme.ts +7 -0
- package/src/components/tab/Tab.vue +179 -0
- package/src/components/tab/TabGroup.vue +185 -0
- package/src/components/tab/__tests__/Tab.spec.ts +11 -0
- package/src/components/tab/__tests__/TabGroup.spec.ts +11 -0
- package/src/components/tab/index.ts +11 -0
- package/src/components/tab/theme/Tab.base.theme.ts +28 -0
- package/src/components/tab/theme/Tab.carbon.theme.ts +34 -0
- package/src/components/tab/theme/TabGroup.base.theme.ts +55 -0
- package/src/components/tab/theme/TabGroup.carbon.theme.ts +55 -0
- package/src/components/table/Table.vue +174 -0
- package/src/components/table/TableBody.tsx +8 -0
- package/src/components/table/TableCell.vue +57 -0
- package/src/components/table/TableHead.tsx +14 -0
- package/src/components/table/TableHeader.vue +95 -0
- package/src/components/table/TableRow.vue +46 -0
- package/src/components/table/__tests__/Table.spec.ts +11 -0
- package/src/components/table/index.ts +10 -0
- package/src/components/table/theme/Table.base.theme.ts +21 -0
- package/src/components/table/theme/Table.carbon.theme.ts +7 -0
- package/src/components/table/theme/TableCell.base.theme.ts +29 -0
- package/src/components/table/theme/TableCell.carbon.theme.ts +7 -0
- package/src/components/tag/Tag.vue +80 -0
- package/src/components/tag/__tests__/Tag.spec.ts +11 -0
- package/src/components/tag/index.ts +2 -0
- package/src/components/tag/theme/Tag.base.theme.ts +34 -0
- package/src/components/tag/theme/Tag.carbon.theme.ts +34 -0
- package/src/components/textarea/Textarea.vue +147 -0
- package/src/components/textarea/__tests__/Textarea.spec.ts +11 -0
- package/src/components/textarea/index.ts +2 -0
- package/src/components/textarea/theme/Textarea.base.theme.ts +27 -0
- package/src/components/textarea/theme/Textarea.carbon.theme.ts +29 -0
- package/src/components/themeProvider/ThemeProvider.vue +28 -0
- package/src/components/themeProvider/index.ts +1 -0
- package/src/components/toggle/Toggle.vue +122 -0
- package/src/components/toggle/__tests__/Toggle.spec.ts +11 -0
- package/src/components/toggle/index.ts +2 -0
- package/src/components/toggle/theme/Toggle.base.theme.ts +53 -0
- package/src/components/toggle/theme/Toggle.carbon.theme.ts +7 -0
- package/src/components/tooltip/Tooltip.vue +26 -0
- package/src/components/tooltip/__tests__/Tooltip.spec.ts +11 -0
- package/src/components/tooltip/index.ts +2 -0
- package/src/composables/index.ts +7 -0
- package/src/composables/keys.ts +20 -0
- package/src/composables/useCSS.ts +50 -0
- package/src/composables/useColors.ts +98 -0
- package/src/composables/useCommon.ts +21 -0
- package/src/composables/useFocusTrap.ts +106 -0
- package/src/composables/useInputtable.ts +172 -0
- package/src/composables/useInteractive.ts +28 -0
- package/src/composables/useNotifications.ts +11 -0
- package/src/composables/useTheme.ts +97 -0
- package/src/create.ts +43 -0
- package/src/index.ts +10 -0
- package/src/install.ts +8 -0
- package/src/shims-vue.d.ts +6 -0
- package/src/theme.ts +125 -0
- package/src/themes/base/components.ts +46 -0
- package/src/themes/base/index.ts +15 -0
- package/src/themes/base/styles.css +83 -0
- package/src/themes/carbon/components.ts +46 -0
- package/src/themes/carbon/index.ts +15 -0
- package/src/themes/carbon/styles.css +82 -0
- package/src/themes/index.ts +2 -0
- package/src/version.ts +1 -0
- package/volar.d.ts +60 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ModalTheme } from '../Modal.vue'
|
|
2
|
+
|
|
3
|
+
const theme: ModalTheme = {
|
|
4
|
+
classes: {
|
|
5
|
+
wrapper: 'fixed z-40 inset-0 overflow-y-auto transition-all',
|
|
6
|
+
|
|
7
|
+
backdrop: ({ data }) => {
|
|
8
|
+
const classes = ['fixed inset-0 bg-gray-500 dark:bg-black transition-opacity']
|
|
9
|
+
|
|
10
|
+
if (data.visible) classes.push('ease-out duration-200 opacity-70 dark:opacity-70')
|
|
11
|
+
else classes.push('ease-in duration-100 opacity-0')
|
|
12
|
+
|
|
13
|
+
return classes
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
modal: ({ props, data }) => {
|
|
17
|
+
const classes = ['relative flex flex-col z-10 bg-gray-200 dark:bg-gray-900 shadow-lg transform transition-all overflow-hidden max-h-full w-full']
|
|
18
|
+
|
|
19
|
+
if (data.visible) classes.push('ease-out duration-200 opacity-100 translate-y-0 sm:scale-100')
|
|
20
|
+
else classes.push('ease-in duration-200 opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95')
|
|
21
|
+
|
|
22
|
+
if (props.size === 'xs') classes.push('sm:max-w-xs')
|
|
23
|
+
else if (props.size === 'sm') classes.push('sm:max-w-sm')
|
|
24
|
+
else if (props.size === 'lg') classes.push('sm:max-w-xl')
|
|
25
|
+
else if (props.size === 'xl') classes.push('sm:max-w-3xl')
|
|
26
|
+
else classes.push('sm:max-w-lg')
|
|
27
|
+
|
|
28
|
+
return classes
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
closeIcon: '!absolute top-0 z-10 right-0',
|
|
32
|
+
|
|
33
|
+
header: 'text-lg pl-4 pt-4 pr-12',
|
|
34
|
+
|
|
35
|
+
content: ({ props }) => {
|
|
36
|
+
const classes = ['pb-8']
|
|
37
|
+
|
|
38
|
+
if (!props.fluid) classes.push('px-4')
|
|
39
|
+
|
|
40
|
+
return classes
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
actions: ({ props, slots }) => {
|
|
44
|
+
const classes = ['grid grid-flow-col gap-[1px]']
|
|
45
|
+
|
|
46
|
+
if (slots['tertiary-action'] || slots['cancel-action']) classes.push('grid-cols-4')
|
|
47
|
+
else classes.push('grid-cols-2')
|
|
48
|
+
|
|
49
|
+
return classes
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
label: 'text-xs text-gray-500 mb-1',
|
|
53
|
+
|
|
54
|
+
title: 'text-xl mb-4',
|
|
55
|
+
|
|
56
|
+
description: 'text-sm mb-4',
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default theme
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const notificationsProps = {
|
|
3
|
+
...useColors.props('primary'),
|
|
4
|
+
align: {
|
|
5
|
+
type: String as PropType<NotificationsAlign>,
|
|
6
|
+
default: 'right',
|
|
7
|
+
validator: (value: string) => validators.align.includes(value as NotificationsAlign),
|
|
8
|
+
},
|
|
9
|
+
position: {
|
|
10
|
+
type: String as PropType<NotificationsPosition>,
|
|
11
|
+
default: 'bottom',
|
|
12
|
+
validator: (value: string) => validators.position.includes(value as NotificationsPosition),
|
|
13
|
+
},
|
|
14
|
+
timeout: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 3500,
|
|
17
|
+
},
|
|
18
|
+
removable: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true,
|
|
21
|
+
},
|
|
22
|
+
injectKey: {
|
|
23
|
+
type: [Symbol, String],
|
|
24
|
+
default: injectNotificationKey,
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const validators = {
|
|
29
|
+
align: ['left', 'right'] as const,
|
|
30
|
+
position: ['bottom', 'top'] as const,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type NotificationsProps = ExtractPublicPropTypes<typeof notificationsProps>
|
|
34
|
+
|
|
35
|
+
export type NotificationsAlign = typeof validators.align[number]
|
|
36
|
+
export type NotificationsPosition = typeof validators.position[number]
|
|
37
|
+
export type NotificationsAction = {
|
|
38
|
+
onClick: () => void;
|
|
39
|
+
label: string;
|
|
40
|
+
color?: string;
|
|
41
|
+
}
|
|
42
|
+
export type NotificationEvent = {
|
|
43
|
+
id?: number;
|
|
44
|
+
icon?: string;
|
|
45
|
+
action?: NotificationsAction;
|
|
46
|
+
iconColor?: string;
|
|
47
|
+
title?: string;
|
|
48
|
+
style?: string;
|
|
49
|
+
message?: string;
|
|
50
|
+
timeout?: number;
|
|
51
|
+
removable?: boolean;
|
|
52
|
+
align?: NotificationsAlign;
|
|
53
|
+
position?: NotificationsPosition;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type NotificationInjection = {
|
|
57
|
+
log: (notification: NotificationEvent | string) => void;
|
|
58
|
+
info: (notification: NotificationEvent | string) => void;
|
|
59
|
+
warn: (notification: NotificationEvent | string) => void;
|
|
60
|
+
error: (notification: NotificationEvent | string) => void;
|
|
61
|
+
warning: (notification: NotificationEvent | string) => void;
|
|
62
|
+
success: (notification: NotificationEvent | string) => void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type InternalClasses = 'wrapper' | 'list' | 'item'
|
|
66
|
+
export interface NotificationsTheme extends ThemeComponent<NotificationsProps, InternalClasses> {}
|
|
67
|
+
|
|
68
|
+
export default {
|
|
69
|
+
name: 'XNotifications',
|
|
70
|
+
validators,
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<script setup lang="ts">
|
|
75
|
+
import { ref, provide, watch, type PropType, type ExtractPublicPropTypes } from 'vue'
|
|
76
|
+
import { injectNotificationKey } from '../../composables/keys'
|
|
77
|
+
import { useColors } from '../../composables/useColors'
|
|
78
|
+
import { useCSS } from '../../composables/useCSS'
|
|
79
|
+
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
80
|
+
import { closeIcon } from '../../common/icons'
|
|
81
|
+
|
|
82
|
+
import XIcon from '../../components/icon/Icon.vue'
|
|
83
|
+
import XSpacer from '../spacer/Spacer'
|
|
84
|
+
|
|
85
|
+
const props = defineProps(notificationsProps)
|
|
86
|
+
|
|
87
|
+
const internalAlign = ref(props.align)
|
|
88
|
+
const internalPosition = ref(props.position)
|
|
89
|
+
const notifications = ref<NotificationEvent []>([])
|
|
90
|
+
const listRef = ref<HTMLElement | null>(null)
|
|
91
|
+
const css = useCSS('notification')
|
|
92
|
+
const colors = useColors()
|
|
93
|
+
|
|
94
|
+
provide<NotificationInjection>(props.injectKey, {
|
|
95
|
+
log,
|
|
96
|
+
info,
|
|
97
|
+
warn,
|
|
98
|
+
error,
|
|
99
|
+
warning: warn,
|
|
100
|
+
success,
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
watch(() => props.align, (align) => { internalAlign.value = align })
|
|
104
|
+
watch(() => props.position, (position) => { internalPosition.value = position })
|
|
105
|
+
|
|
106
|
+
function log(notification: NotificationEvent | string) {
|
|
107
|
+
const isMessage = typeof notification === 'string'
|
|
108
|
+
const preset = {
|
|
109
|
+
message: isMessage ? notification : undefined,
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
add(isMessage ? preset : {
|
|
113
|
+
...preset,
|
|
114
|
+
...notification,
|
|
115
|
+
})
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function info(notification: NotificationEvent | string) {
|
|
119
|
+
const isMessage = typeof notification === 'string'
|
|
120
|
+
const preset = {
|
|
121
|
+
icon: '<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />',
|
|
122
|
+
iconColor: 'sky',
|
|
123
|
+
message: isMessage ? notification : undefined,
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
add(isMessage ? preset : {
|
|
127
|
+
...preset,
|
|
128
|
+
...notification,
|
|
129
|
+
})
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function success(notification: NotificationEvent | string) {
|
|
133
|
+
const isMessage = typeof notification === 'string'
|
|
134
|
+
const preset = {
|
|
135
|
+
icon: '<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />',
|
|
136
|
+
iconColor: 'success',
|
|
137
|
+
message: isMessage ? notification : undefined,
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
add(isMessage ? preset : {
|
|
141
|
+
...preset,
|
|
142
|
+
...notification,
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function warn(notification: NotificationEvent | string) {
|
|
147
|
+
const isMessage = typeof notification === 'string'
|
|
148
|
+
const preset = {
|
|
149
|
+
icon: '<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />',
|
|
150
|
+
iconColor: 'warning',
|
|
151
|
+
message: isMessage ? notification : undefined,
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
add(isMessage ? preset : {
|
|
155
|
+
...preset,
|
|
156
|
+
...notification,
|
|
157
|
+
})
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function error(notification: NotificationEvent | string) {
|
|
161
|
+
const isMessage = typeof notification === 'string'
|
|
162
|
+
const preset = {
|
|
163
|
+
icon: '<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />',
|
|
164
|
+
iconColor: 'error',
|
|
165
|
+
message: isMessage ? notification : undefined,
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
add(isMessage ? preset : {
|
|
169
|
+
...preset,
|
|
170
|
+
...notification,
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function add(notification: NotificationEvent) {
|
|
175
|
+
const mergeProps = {
|
|
176
|
+
id: Date.now(),
|
|
177
|
+
iconColor: props.color,
|
|
178
|
+
timeout: props.timeout,
|
|
179
|
+
align: internalAlign.value,
|
|
180
|
+
position: internalPosition.value,
|
|
181
|
+
removable: props.removable,
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const merged = {
|
|
185
|
+
...mergeProps,
|
|
186
|
+
...notification,
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
internalAlign.value = merged.align
|
|
190
|
+
internalPosition.value = merged.position
|
|
191
|
+
|
|
192
|
+
const color = colors.getPalette(merged.iconColor)
|
|
193
|
+
const colorAction = colors.getPalette(merged.action?.color || 'primary')
|
|
194
|
+
|
|
195
|
+
const cssVariables = css.variables({
|
|
196
|
+
icon: color[400],
|
|
197
|
+
action: colorAction[400],
|
|
198
|
+
hover: {
|
|
199
|
+
action: colorAction[500],
|
|
200
|
+
},
|
|
201
|
+
dark: {
|
|
202
|
+
icon: color[500],
|
|
203
|
+
action: colorAction[500],
|
|
204
|
+
hover: {
|
|
205
|
+
action: colorAction[600],
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
merged.style = Object.keys(cssVariables).map((key) => `${key}: ${cssVariables[key]}`).join(';')
|
|
211
|
+
|
|
212
|
+
notifications.value.push(merged)
|
|
213
|
+
|
|
214
|
+
listRef.value?.scrollTo({ top: 0, behavior: 'smooth' })
|
|
215
|
+
|
|
216
|
+
if (merged.timeout) setTimer(merged, merged.timeout)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function remove(event: NotificationEvent) {
|
|
220
|
+
notifications.value = notifications.value.filter((e) => e.id !== event.id)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function setTimer(notification: NotificationEvent, timeout: number) {
|
|
224
|
+
setTimeout(() => {
|
|
225
|
+
remove(notification)
|
|
226
|
+
}, timeout)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const { styles, classes, className } = useTheme('Notifications', {}, props)
|
|
230
|
+
|
|
231
|
+
defineExpose({ log, info, success, warn, warning: warn, error })
|
|
232
|
+
</script>
|
|
233
|
+
|
|
234
|
+
<template>
|
|
235
|
+
<slot></slot>
|
|
236
|
+
<teleport to="body">
|
|
237
|
+
<div
|
|
238
|
+
ref="listRef"
|
|
239
|
+
:style="styles"
|
|
240
|
+
:class="[
|
|
241
|
+
className,
|
|
242
|
+
classes.wrapper,
|
|
243
|
+
{
|
|
244
|
+
// align
|
|
245
|
+
'left-0': internalAlign === 'left',
|
|
246
|
+
'right-0': internalAlign === 'right',
|
|
247
|
+
// position
|
|
248
|
+
'top-0': internalPosition === 'top',
|
|
249
|
+
'bottom-0': internalPosition === 'bottom',
|
|
250
|
+
}]"
|
|
251
|
+
>
|
|
252
|
+
<transition-group
|
|
253
|
+
tag="ul"
|
|
254
|
+
:class="[
|
|
255
|
+
classes.list,
|
|
256
|
+
{ 'flex-col-reverse': internalPosition }
|
|
257
|
+
]"
|
|
258
|
+
enter-active-class="transition ease-out duration-200"
|
|
259
|
+
leave-active-class="transition ease-out duration-100"
|
|
260
|
+
enter-from-class="transform translate-y-2 opacity-0"
|
|
261
|
+
enter-to-class="transform translate-y-0 opacity-100"
|
|
262
|
+
leave-from-class="transform translate-y-0 opacity-100"
|
|
263
|
+
leave-to-class="transform translate-y-2 opacity-0"
|
|
264
|
+
move-class="ease-in-out duration-200"
|
|
265
|
+
>
|
|
266
|
+
<li
|
|
267
|
+
v-for="notification in notifications"
|
|
268
|
+
:key="notification.id"
|
|
269
|
+
:class="[
|
|
270
|
+
classes.item,
|
|
271
|
+
{
|
|
272
|
+
'mb-2': internalPosition === 'bottom',
|
|
273
|
+
'mt-2': internalPosition === 'top',
|
|
274
|
+
}]"
|
|
275
|
+
:style="notification.style"
|
|
276
|
+
>
|
|
277
|
+
<x-icon
|
|
278
|
+
v-if="notification.icon"
|
|
279
|
+
filled
|
|
280
|
+
:icon="notification.icon"
|
|
281
|
+
class="
|
|
282
|
+
mr-4
|
|
283
|
+
text-[color:var(--x-notification-icon)]
|
|
284
|
+
dark:text-[color:var(--x-notification-dark-icon)]
|
|
285
|
+
"
|
|
286
|
+
viewBox="0 0 20 20"
|
|
287
|
+
/>
|
|
288
|
+
<div class="flex items-center flex-wrap">
|
|
289
|
+
<span v-if="notification.title" class="font-medium mr-2">{{ notification.title }}</span>
|
|
290
|
+
<span>{{ notification.message }}</span>
|
|
291
|
+
</div>
|
|
292
|
+
<x-spacer/>
|
|
293
|
+
<button
|
|
294
|
+
v-if="notification.action"
|
|
295
|
+
class="
|
|
296
|
+
ml-3
|
|
297
|
+
font-medium
|
|
298
|
+
cursor-pointer
|
|
299
|
+
text-[color:var(--x-notification-action)]
|
|
300
|
+
hover:text-[color:var(--x-notification-action-hover)]
|
|
301
|
+
dark:text-[color:var(--x-notification-dark-action)]
|
|
302
|
+
dark:hover:text-[color:var(--x-notification-dark-action-hover)]
|
|
303
|
+
"
|
|
304
|
+
@click="() => { notification.action?.onClick(); remove(notification); }"
|
|
305
|
+
>
|
|
306
|
+
{{ notification.action.label }}
|
|
307
|
+
</button>
|
|
308
|
+
<x-icon
|
|
309
|
+
v-if="notification.removable"
|
|
310
|
+
:icon="closeIcon"
|
|
311
|
+
class="text-gray-400 hover:text-gray-500 ml-3 cursor-pointer"
|
|
312
|
+
@click="() => {remove(notification)}"
|
|
313
|
+
/>
|
|
314
|
+
</li>
|
|
315
|
+
</transition-group>
|
|
316
|
+
</div>
|
|
317
|
+
</teleport>
|
|
318
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import Notifications from '../Notifications.vue'
|
|
4
|
+
|
|
5
|
+
describe('Notifications', () => {
|
|
6
|
+
it('renders without errors', () => {
|
|
7
|
+
const wrapper = mount(Notifications)
|
|
8
|
+
|
|
9
|
+
expect(wrapper.vm).toBeTruthy()
|
|
10
|
+
})
|
|
11
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NotificationsTheme } from '../Notifications.vue'
|
|
2
|
+
|
|
3
|
+
const theme: NotificationsTheme = {
|
|
4
|
+
classes: {
|
|
5
|
+
wrapper: 'fixed z-50 w-full sm:w-auto overflow-y-auto max-h-screen',
|
|
6
|
+
|
|
7
|
+
list: 'flex flex-col items-end w-full sm:w-[520px] px-4',
|
|
8
|
+
|
|
9
|
+
item: 'w-full flex items-center rounded-md px-4 py-3 bg-gray-800 dark:bg-gray-50 text-white dark:text-gray-900 border border-gray-700 dark:border-gray-100',
|
|
10
|
+
},
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default theme
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NotificationsTheme } from '../Notifications.vue'
|
|
2
|
+
|
|
3
|
+
const theme: NotificationsTheme = {
|
|
4
|
+
classes: {
|
|
5
|
+
wrapper: 'fixed z-50 w-full sm:w-auto overflow-y-auto max-h-screen',
|
|
6
|
+
|
|
7
|
+
list: 'flex flex-col items-end w-full sm:w-[520px] px-4',
|
|
8
|
+
|
|
9
|
+
item: () => {
|
|
10
|
+
const classes = ['w-full flex items-center px-4 py-3 bg-gray-800 dark:bg-gray-50 text-white dark:text-gray-900 border-l-2 border-[color:var(--x-notification-icon)]']
|
|
11
|
+
|
|
12
|
+
return classes
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default theme
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const paginationVariant = ['simple', 'quick', 'dots'] as const
|
|
3
|
+
const paginationProps = {
|
|
4
|
+
...useCommon.props(),
|
|
5
|
+
links: Boolean,
|
|
6
|
+
totalPages: {
|
|
7
|
+
type: Number,
|
|
8
|
+
default: 1,
|
|
9
|
+
},
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 1,
|
|
13
|
+
},
|
|
14
|
+
variant: {
|
|
15
|
+
type: String as PropType<PaginationVariant>,
|
|
16
|
+
default: 'simple',
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type PaginationVariant = typeof paginationVariant[number]
|
|
21
|
+
export type PaginationProps = ExtractPublicPropTypes<typeof paginationProps>
|
|
22
|
+
|
|
23
|
+
type InternalClasses = 'wrapper' | 'dots'
|
|
24
|
+
export interface PaginationTheme extends ThemeComponent<PaginationProps, InternalClasses> {}
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: 'XPagination',
|
|
28
|
+
validators: {
|
|
29
|
+
...useCommon.validators(),
|
|
30
|
+
variant: paginationVariant,
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
import { computed, ref, watch, type PropType, type ExtractPublicPropTypes } from 'vue'
|
|
37
|
+
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
38
|
+
import { useCommon } from '../../composables/useCommon'
|
|
39
|
+
import { dotsIcon, prevIcon, nextIcon } from '../../common/icons'
|
|
40
|
+
|
|
41
|
+
import XIcon from '../../components/icon/Icon.vue'
|
|
42
|
+
import XInput from '../../components/input/Input.vue'
|
|
43
|
+
import XButton from '../button/Button.vue'
|
|
44
|
+
import XPaginationItem from './PaginationItem.vue'
|
|
45
|
+
|
|
46
|
+
const props = defineProps(paginationProps)
|
|
47
|
+
|
|
48
|
+
const emit = defineEmits(['update:modelValue'])
|
|
49
|
+
|
|
50
|
+
const pages = computed(() => {
|
|
51
|
+
if (props.totalPages === 3) return [2]
|
|
52
|
+
if (props.totalPages > 2) {
|
|
53
|
+
if (props.modelValue === 1 || props.modelValue === 2) return [2, 3]
|
|
54
|
+
if (props.modelValue === props.totalPages || props.modelValue === props.totalPages - 1) return [props.totalPages - 2, props.totalPages - 1]
|
|
55
|
+
|
|
56
|
+
return [props.modelValue - 1, props.modelValue, props.modelValue + 1]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return []
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const quickInput = ref<string>(props.modelValue + '')
|
|
63
|
+
|
|
64
|
+
function onQuickInput() {
|
|
65
|
+
const number = parseInt(quickInput.value)
|
|
66
|
+
|
|
67
|
+
if (number >= 0 && number <= props.totalPages) {
|
|
68
|
+
emit('update:modelValue', number)
|
|
69
|
+
} else {
|
|
70
|
+
quickInput.value = props.modelValue + ''
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
watch(() => props.modelValue, (value) => {
|
|
75
|
+
quickInput.value = props.modelValue + ''
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
function prevPage() {
|
|
79
|
+
if (props.modelValue > 1) emit('update:modelValue', props.modelValue - 1)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function nextPage() {
|
|
83
|
+
if (props.modelValue < props.totalPages) emit('update:modelValue', props.modelValue + 1)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const quickButtonSize = computed(() => {
|
|
87
|
+
if (props.size === 'xs') return 'xs'
|
|
88
|
+
else if (props.size === 'sm') return 'sm'
|
|
89
|
+
else if (props.size === 'lg') return 'md'
|
|
90
|
+
else if (props.size === 'xl') return 'lg'
|
|
91
|
+
|
|
92
|
+
return 'sm'
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
const { styles, classes, className } = useTheme('Pagination', {}, props)
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<template>
|
|
99
|
+
<ul
|
|
100
|
+
:style="styles"
|
|
101
|
+
:class="[
|
|
102
|
+
className,
|
|
103
|
+
classes.wrapper,
|
|
104
|
+
]"
|
|
105
|
+
>
|
|
106
|
+
<template v-if="variant === 'quick'">
|
|
107
|
+
<x-button
|
|
108
|
+
:icon-left="prevIcon"
|
|
109
|
+
:size="quickButtonSize"
|
|
110
|
+
:disabled="modelValue <= 1"
|
|
111
|
+
@click="prevPage"
|
|
112
|
+
/>
|
|
113
|
+
<div class="mx-9 flex items-center">
|
|
114
|
+
<span class="text-gray-600 mr-2">Page</span>
|
|
115
|
+
<x-input
|
|
116
|
+
v-model="quickInput"
|
|
117
|
+
:size="size"
|
|
118
|
+
class="text-center w-16"
|
|
119
|
+
hide-footer
|
|
120
|
+
@keydown.enter="onQuickInput"
|
|
121
|
+
/>
|
|
122
|
+
<span class="text-gray-600 ml-2">of {{ totalPages }}</span>
|
|
123
|
+
</div>
|
|
124
|
+
<x-button
|
|
125
|
+
:icon-left="nextIcon"
|
|
126
|
+
:size="quickButtonSize"
|
|
127
|
+
:disabled="modelValue >= totalPages"
|
|
128
|
+
@click="nextPage"
|
|
129
|
+
/>
|
|
130
|
+
</template>
|
|
131
|
+
<template v-else-if="variant === 'simple'">
|
|
132
|
+
<x-pagination-item
|
|
133
|
+
:value="1"
|
|
134
|
+
:links="links"
|
|
135
|
+
:size="size"
|
|
136
|
+
:selected="modelValue === 1"
|
|
137
|
+
@input="(value: Event) => $emit('update:modelValue', value)"
|
|
138
|
+
/>
|
|
139
|
+
<x-icon v-if="totalPages > 3 && modelValue > 3" class="mx-1" :icon="dotsIcon" :size="size"/>
|
|
140
|
+
<x-pagination-item
|
|
141
|
+
v-for="i in pages"
|
|
142
|
+
:key="i"
|
|
143
|
+
:value="i"
|
|
144
|
+
:links="links"
|
|
145
|
+
:size="size"
|
|
146
|
+
:selected="modelValue === i"
|
|
147
|
+
@input="(value: Event) => $emit('update:modelValue', value)"
|
|
148
|
+
/>
|
|
149
|
+
<x-icon v-if="totalPages > 3 && modelValue < totalPages - 2" class="mx-1" :icon="dotsIcon" :size="size"/>
|
|
150
|
+
<x-pagination-item
|
|
151
|
+
v-if="totalPages > 1"
|
|
152
|
+
:value="totalPages"
|
|
153
|
+
:links="links"
|
|
154
|
+
:size="size"
|
|
155
|
+
:selected="modelValue === totalPages"
|
|
156
|
+
@input="(value: Event) => $emit('update:modelValue', value)"
|
|
157
|
+
/>
|
|
158
|
+
</template>
|
|
159
|
+
<template v-else-if="variant === 'dots'">
|
|
160
|
+
<li
|
|
161
|
+
v-for="i in totalPages"
|
|
162
|
+
:key="i"
|
|
163
|
+
class="rounded-full cursor-pointer"
|
|
164
|
+
:class="[
|
|
165
|
+
classes.dots,
|
|
166
|
+
i === modelValue ? 'bg-[color:var(--x-pagination-bg)]': 'bg-gray-100 hover:bg-gray-200'
|
|
167
|
+
]"
|
|
168
|
+
@click="$emit('update:modelValue', i)"
|
|
169
|
+
></li>
|
|
170
|
+
</template>
|
|
171
|
+
</ul>
|
|
172
|
+
</template>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const paginationItemProps = {
|
|
3
|
+
...useCommon.props(),
|
|
4
|
+
value: {
|
|
5
|
+
type: Number,
|
|
6
|
+
default: 0,
|
|
7
|
+
},
|
|
8
|
+
selected: Boolean,
|
|
9
|
+
links: Boolean,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type PaginationItemProps = ExtractPublicPropTypes<typeof paginationItemProps>
|
|
13
|
+
|
|
14
|
+
type InternalClasses = 'wrapper'
|
|
15
|
+
export interface PaginationItemTheme extends ThemeComponent<PaginationItemProps, InternalClasses> {}
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'XPaginationItem',
|
|
19
|
+
validators: {
|
|
20
|
+
...useCommon.validators(),
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
27
|
+
import { useCommon } from '../../composables/useCommon'
|
|
28
|
+
|
|
29
|
+
import XButton from '../button/Button.vue'
|
|
30
|
+
|
|
31
|
+
import type { ExtractPublicPropTypes } from 'vue'
|
|
32
|
+
|
|
33
|
+
const props = defineProps(paginationItemProps)
|
|
34
|
+
|
|
35
|
+
defineEmits(['input'])
|
|
36
|
+
|
|
37
|
+
const { styles, classes, className } = useTheme('PaginationItem', {}, props)
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<li>
|
|
42
|
+
<x-button
|
|
43
|
+
:to="links ? `?page=${value}` : undefined"
|
|
44
|
+
:size="size"
|
|
45
|
+
:style="styles"
|
|
46
|
+
:class="[
|
|
47
|
+
className,
|
|
48
|
+
classes.wrapper
|
|
49
|
+
]"
|
|
50
|
+
:outlined="!selected"
|
|
51
|
+
:color="selected ? 'primary' : undefined"
|
|
52
|
+
@click="!selected ? $emit('input', value) : null"
|
|
53
|
+
>
|
|
54
|
+
{{ value }}
|
|
55
|
+
</x-button>
|
|
56
|
+
</li>
|
|
57
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import Pagination from '../Pagination.vue'
|
|
4
|
+
|
|
5
|
+
describe('Pagination', () => {
|
|
6
|
+
it('renders without errors', () => {
|
|
7
|
+
const wrapper = mount(Pagination)
|
|
8
|
+
|
|
9
|
+
expect(wrapper.vm).toBeTruthy()
|
|
10
|
+
})
|
|
11
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import PaginationItem from '../PaginationItem.vue'
|
|
4
|
+
|
|
5
|
+
describe('PaginationItem', () => {
|
|
6
|
+
it('renders without errors', () => {
|
|
7
|
+
const wrapper = mount(PaginationItem)
|
|
8
|
+
|
|
9
|
+
expect(wrapper.vm).toBeTruthy()
|
|
10
|
+
})
|
|
11
|
+
})
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as XPagination } from './Pagination.vue'
|
|
2
|
+
export type { PaginationProps, PaginationVariant, PaginationTheme } from './Pagination.vue'
|
|
3
|
+
|
|
4
|
+
export { default as XPaginationItem } from './PaginationItem.vue'
|
|
5
|
+
export type { PaginationItemProps, PaginationItemTheme } from './PaginationItem.vue'
|