@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,249 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const drawerPosition = ['left', 'right', 'top', 'bottom'] as const
|
|
3
|
+
const drawerProps = {
|
|
4
|
+
modelValue: Boolean,
|
|
5
|
+
position: {
|
|
6
|
+
type: String as PropType<DrawerPosition>,
|
|
7
|
+
default: 'left',
|
|
8
|
+
},
|
|
9
|
+
teleportTo: {
|
|
10
|
+
type: [String, Object] as PropType<string | HTMLElement>,
|
|
11
|
+
default: 'body',
|
|
12
|
+
},
|
|
13
|
+
width: {
|
|
14
|
+
type: [String, Number],
|
|
15
|
+
default: 320,
|
|
16
|
+
},
|
|
17
|
+
height: {
|
|
18
|
+
type: [String, Number],
|
|
19
|
+
default: 320,
|
|
20
|
+
},
|
|
21
|
+
breakpoint: [String, Number],
|
|
22
|
+
backdrop: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true,
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type DrawerPosition = typeof drawerPosition[number]
|
|
29
|
+
export type DrawerProps = ExtractPublicPropTypes<typeof drawerProps>
|
|
30
|
+
|
|
31
|
+
type InternalClasses = 'wrapper' | 'backdrop'
|
|
32
|
+
export interface DrawerTheme extends ThemeComponent<DrawerProps, InternalClasses> {}
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
name: 'XDrawer',
|
|
36
|
+
inheritAttrs: false,
|
|
37
|
+
validators: {
|
|
38
|
+
position: drawerPosition,
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import { computed, onMounted, ref, watch, watchEffect, type PropType, type ExtractPublicPropTypes } from 'vue'
|
|
45
|
+
import { breakpointsTailwind, useBreakpoints, useEventListener, useSwipe, type Breakpoints, type UseSwipeDirection } from '@vueuse/core'
|
|
46
|
+
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
47
|
+
|
|
48
|
+
import XScroll from '../../components/scroll/Scroll.vue'
|
|
49
|
+
|
|
50
|
+
const props = defineProps(drawerProps)
|
|
51
|
+
|
|
52
|
+
const emit = defineEmits(['update:modelValue'])
|
|
53
|
+
|
|
54
|
+
const detached = ref<boolean>(true)
|
|
55
|
+
const value = ref<boolean>(props.modelValue)
|
|
56
|
+
const backdropRef = ref<HTMLElement | null>(null)
|
|
57
|
+
const drawerRef = ref<HTMLElement | null>(null)
|
|
58
|
+
|
|
59
|
+
const deferShow = ref<boolean>(false)
|
|
60
|
+
|
|
61
|
+
const isTailwindBreakpoint = typeof props.breakpoint === 'string'
|
|
62
|
+
const breakpoints = useBreakpoints(isTailwindBreakpoint ? breakpointsTailwind : { md: props.breakpoint || 768 } as Breakpoints)
|
|
63
|
+
const point = breakpoints.smaller(isTailwindBreakpoint ? props.breakpoint : 'md')
|
|
64
|
+
|
|
65
|
+
watchEffect(() => {
|
|
66
|
+
if (props.breakpoint) {
|
|
67
|
+
if (point.value) {
|
|
68
|
+
detached.value = true
|
|
69
|
+
close()
|
|
70
|
+
} else {
|
|
71
|
+
detached.value = false
|
|
72
|
+
open()
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
useEventListener(backdropRef, 'pointerdown', close)
|
|
78
|
+
|
|
79
|
+
watch(() => props.modelValue, (val) => {
|
|
80
|
+
value.value = val
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
if (typeof window !== 'undefined') useEventListener(document, 'keydown', onKeyDown)
|
|
84
|
+
|
|
85
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
86
|
+
if (event.key === 'Escape' && value.value) close()
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const { lengthX, lengthY } = useSwipe(drawerRef, {
|
|
90
|
+
// passive: false,
|
|
91
|
+
// onSwipe(e: TouchEvent) {
|
|
92
|
+
// if (lengthX.value < 0) {
|
|
93
|
+
// const length = Math.abs(lengthX.value)
|
|
94
|
+
// left.value = `${length}px`
|
|
95
|
+
// } else {
|
|
96
|
+
// left.value = '0'
|
|
97
|
+
// }
|
|
98
|
+
// },
|
|
99
|
+
// onSwipeEnd(e: TouchEvent, direction: UseSwipeDirection) {
|
|
100
|
+
// if (lengthX.value < 0 && props.width && (Math.abs(lengthX.value) / props.width) >= 0.5) {
|
|
101
|
+
// left.value = '100%'
|
|
102
|
+
// } else {
|
|
103
|
+
// left.value = '0'
|
|
104
|
+
// }
|
|
105
|
+
// },
|
|
106
|
+
onSwipeEnd(e: TouchEvent, direction: UseSwipeDirection) {
|
|
107
|
+
if (detached.value) {
|
|
108
|
+
if (
|
|
109
|
+
(props.position === 'left' && direction === 'left') ||
|
|
110
|
+
(props.position === 'right' && direction === 'right') ||
|
|
111
|
+
(props.position === 'top' && direction === 'up') ||
|
|
112
|
+
(props.position === 'bottom' && direction === 'down')
|
|
113
|
+
) close()
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
const autoStyles = computed(() => {
|
|
119
|
+
const s: Record<string, string> = {}
|
|
120
|
+
|
|
121
|
+
if (props.position === 'left' || props.position === 'right') s['width'] = `${props.width}px`
|
|
122
|
+
else if (props.position === 'top' || props.position === 'bottom') s['height'] = `${props.height}px`
|
|
123
|
+
|
|
124
|
+
return s
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
const autoClasses = computed(() => {
|
|
128
|
+
const c = []
|
|
129
|
+
|
|
130
|
+
if (detached.value) {
|
|
131
|
+
c.push('absolute shadow-lg')
|
|
132
|
+
|
|
133
|
+
if (props.position === 'top') c.push('top-0 inset-x-0')
|
|
134
|
+
else if (props.position === 'bottom') c.push('bottom-0 inset-x-0')
|
|
135
|
+
else if (props.position === 'left') c.push('left-0 inset-y-0')
|
|
136
|
+
else if (props.position === 'right') c.push('right-0 inset-y-0')
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return c
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
function onBeforeEnter(el: Element) {
|
|
143
|
+
el.classList.add('inset-0')
|
|
144
|
+
if (props.position === 'top') (el as HTMLElement).style.top = `-${props.height}px`
|
|
145
|
+
else if (props.position === 'bottom') (el as HTMLElement).style.bottom = `-${props.height}px`
|
|
146
|
+
else if (props.position === 'left') (el as HTMLElement).style.left = `-${props.width}px`
|
|
147
|
+
else if (props.position === 'right') (el as HTMLElement).style.right = `-${props.width}px`
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function onEnter(el: Element, done: () => void) {
|
|
151
|
+
if (!detached.value) {
|
|
152
|
+
done()
|
|
153
|
+
|
|
154
|
+
return
|
|
155
|
+
}
|
|
156
|
+
el.addEventListener('transitionend', done)
|
|
157
|
+
setTimeout(() => {
|
|
158
|
+
if (props.backdrop) el.classList.add('bg-gray-500/30')
|
|
159
|
+
if (props.position === 'top') (el as HTMLElement).style.top = '0'
|
|
160
|
+
else if (props.position === 'bottom') (el as HTMLElement).style.bottom = '0'
|
|
161
|
+
else if (props.position === 'left') (el as HTMLElement).style.left = '0'
|
|
162
|
+
else if (props.position === 'right') (el as HTMLElement).style.right = '0'
|
|
163
|
+
}, 1)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function onBeforeLeave(el: Element) {}
|
|
167
|
+
|
|
168
|
+
function onLeave(el: Element, done: () => void) {
|
|
169
|
+
el.addEventListener('transitionend', done)
|
|
170
|
+
setTimeout(() => {
|
|
171
|
+
if (props.backdrop) el.classList.remove('bg-gray-500/30')
|
|
172
|
+
if (props.position === 'top') (el as HTMLElement).style.top = `-${props.height}px`
|
|
173
|
+
else if (props.position === 'bottom') (el as HTMLElement).style.bottom = `-${props.height}px`
|
|
174
|
+
else if (props.position === 'left') (el as HTMLElement).style.left = `-${props.width}px`
|
|
175
|
+
else if (props.position === 'right') (el as HTMLElement).style.right = `-${props.width}px`
|
|
176
|
+
}, 1)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function onAfterLeave(el: Element) {
|
|
180
|
+
el.classList.remove('inset-0')
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function close(e?: PointerEvent) {
|
|
184
|
+
if (e && e.target !== backdropRef.value) return
|
|
185
|
+
value.value = false
|
|
186
|
+
emit('update:modelValue', false)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function open() {
|
|
190
|
+
value.value = true
|
|
191
|
+
emit('update:modelValue', true)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
onMounted(() => {
|
|
195
|
+
deferShow.value = true
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
const { styles, classes, className } = useTheme('Drawer', {}, props)
|
|
199
|
+
|
|
200
|
+
defineExpose({ open, close })
|
|
201
|
+
</script>
|
|
202
|
+
|
|
203
|
+
<template>
|
|
204
|
+
<teleport v-if="deferShow" :to="teleportTo" :disabled="!detached">
|
|
205
|
+
<transition
|
|
206
|
+
:css="false"
|
|
207
|
+
@before-enter="onBeforeEnter"
|
|
208
|
+
@enter="onEnter"
|
|
209
|
+
@before-leave="onBeforeLeave"
|
|
210
|
+
@leave="onLeave"
|
|
211
|
+
@after-leave="onAfterLeave"
|
|
212
|
+
>
|
|
213
|
+
<div
|
|
214
|
+
v-show="breakpoint ? (value && point || !point) : value"
|
|
215
|
+
ref="backdropRef"
|
|
216
|
+
:class="[
|
|
217
|
+
$attrs.class,
|
|
218
|
+
classes.backdrop,
|
|
219
|
+
detached || !breakpoint ? 'absolute z-40' : '',
|
|
220
|
+
]"
|
|
221
|
+
>
|
|
222
|
+
<div
|
|
223
|
+
v-if="detached && value"
|
|
224
|
+
ref="swipeRef"
|
|
225
|
+
class="flex flex-col max-h-full"
|
|
226
|
+
></div>
|
|
227
|
+
<div
|
|
228
|
+
ref="drawerRef"
|
|
229
|
+
:class="[
|
|
230
|
+
className,
|
|
231
|
+
autoClasses,
|
|
232
|
+
classes.wrapper
|
|
233
|
+
]"
|
|
234
|
+
:style="[autoStyles, styles]"
|
|
235
|
+
>
|
|
236
|
+
<slot name="header"></slot>
|
|
237
|
+
<x-scroll
|
|
238
|
+
:scrollbar="false"
|
|
239
|
+
vertical
|
|
240
|
+
class="flex-1"
|
|
241
|
+
>
|
|
242
|
+
<slot></slot>
|
|
243
|
+
</x-scroll>
|
|
244
|
+
<slot name="footer"></slot>
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
</transition>
|
|
248
|
+
</teleport>
|
|
249
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import Drawer from '../Drawer.vue'
|
|
4
|
+
|
|
5
|
+
describe('Drawer', () => {
|
|
6
|
+
it('renders without errors', () => {
|
|
7
|
+
const wrapper = mount(Drawer)
|
|
8
|
+
|
|
9
|
+
expect(wrapper.vm).toBeTruthy()
|
|
10
|
+
})
|
|
11
|
+
})
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const formProps = {
|
|
3
|
+
autoValidate: {
|
|
4
|
+
type: Boolean,
|
|
5
|
+
default: true,
|
|
6
|
+
},
|
|
7
|
+
autoFocus: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: true,
|
|
10
|
+
},
|
|
11
|
+
disabled: Boolean,
|
|
12
|
+
errors: {
|
|
13
|
+
type: [Array, Object] as PropType<[FormError[], FormError]>,
|
|
14
|
+
default: () => ([]),
|
|
15
|
+
},
|
|
16
|
+
title: String,
|
|
17
|
+
description: String,
|
|
18
|
+
hasFooter: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true,
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type FormProps = ExtractPublicPropTypes<typeof formProps>
|
|
25
|
+
|
|
26
|
+
export type FormInjection = {
|
|
27
|
+
registerInput: (name: string, focus: () => void, validate: () => boolean, setError: (val: string) => void) => void;
|
|
28
|
+
unregisterInput: (name: string) => void;
|
|
29
|
+
isInsideForm: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type FormError = {
|
|
33
|
+
field: string;
|
|
34
|
+
msg: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type FormInput = {
|
|
38
|
+
name: string;
|
|
39
|
+
focus: () => void;
|
|
40
|
+
validate: (val?: any) => boolean;
|
|
41
|
+
setError: (val: string) => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type InternalClasses = 'wrapper' | 'content' | 'title' | 'description' | 'footer'
|
|
45
|
+
export interface FormTheme extends ThemeComponent<FormProps, InternalClasses> {}
|
|
46
|
+
|
|
47
|
+
export default {
|
|
48
|
+
name: 'XForm',
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<script setup lang="ts">
|
|
53
|
+
import { provide, onMounted, watch, nextTick, type PropType, type ExtractPublicPropTypes } from 'vue'
|
|
54
|
+
import { injectFormKey } from '../../composables/keys'
|
|
55
|
+
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
56
|
+
|
|
57
|
+
const props = defineProps(formProps)
|
|
58
|
+
|
|
59
|
+
const emit = defineEmits(['submit'])
|
|
60
|
+
|
|
61
|
+
const inputs: FormInput[] = []
|
|
62
|
+
|
|
63
|
+
provide(injectFormKey, {
|
|
64
|
+
registerInput: (name: string, focus: () => void, validate: (val: any) => boolean, setError: (val: string) => void) => {
|
|
65
|
+
const exists = inputs.find((i) => i.name === name)
|
|
66
|
+
|
|
67
|
+
if (exists) {
|
|
68
|
+
exists.focus = focus
|
|
69
|
+
exists.validate = validate
|
|
70
|
+
exists.setError = setError
|
|
71
|
+
} else inputs.push({ name, focus, validate, setError })
|
|
72
|
+
},
|
|
73
|
+
unregisterInput: (name: string) => {
|
|
74
|
+
const index = inputs.findIndex((i) => i.name === name)
|
|
75
|
+
|
|
76
|
+
inputs.splice(index, 1)
|
|
77
|
+
},
|
|
78
|
+
isInsideForm: true,
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
onMounted(async () => {
|
|
82
|
+
if (props.autoFocus && inputs && inputs.length > 0) {
|
|
83
|
+
setTimeout(inputs[0].focus, 50)
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
watch(() => props.errors, (errors) => {
|
|
88
|
+
if (errors) nextTick(() => {
|
|
89
|
+
if (Array.isArray(errors)) errors.forEach((error: any) => {
|
|
90
|
+
const input = inputs.find((i) => i.name === error.field)
|
|
91
|
+
|
|
92
|
+
if (input) input.setError(error.msg)
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
else {
|
|
96
|
+
const input = inputs.find((i) => i.name === (errors as FormError).field)
|
|
97
|
+
|
|
98
|
+
if (input) input.setError((errors as FormError).msg)
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
const validate = () => {
|
|
104
|
+
let isFormValid = true
|
|
105
|
+
|
|
106
|
+
inputs.forEach((input) => {
|
|
107
|
+
const isInputValid = input.validate()
|
|
108
|
+
|
|
109
|
+
if (!isInputValid && isFormValid) {
|
|
110
|
+
isFormValid = false
|
|
111
|
+
|
|
112
|
+
// focus on input error
|
|
113
|
+
if (input.focus) input.focus()
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
return isFormValid
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const submit = (e: Event) => {
|
|
121
|
+
e.preventDefault()
|
|
122
|
+
e.stopPropagation()
|
|
123
|
+
|
|
124
|
+
const isFormValid = props.autoValidate ? validate() : true
|
|
125
|
+
|
|
126
|
+
emit('submit', isFormValid)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const { styles, classes, className } = useTheme('Form', {}, props)
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<template>
|
|
133
|
+
<form
|
|
134
|
+
:style="styles"
|
|
135
|
+
:class="[
|
|
136
|
+
className,
|
|
137
|
+
classes.wrapper
|
|
138
|
+
]"
|
|
139
|
+
@submit="submit"
|
|
140
|
+
>
|
|
141
|
+
<slot name="header">
|
|
142
|
+
<div v-if="title || description" class="mb-10">
|
|
143
|
+
<p v-if="title" :class="classes.title">{{ title }}</p>
|
|
144
|
+
<p v-if="description" :class="classes.description">{{ description }}</p>
|
|
145
|
+
</div>
|
|
146
|
+
</slot>
|
|
147
|
+
|
|
148
|
+
<fieldset :disabled="disabled" :class="classes.content">
|
|
149
|
+
<slot></slot>
|
|
150
|
+
</fieldset>
|
|
151
|
+
|
|
152
|
+
<slot v-if="hasFooter" name="footer">
|
|
153
|
+
<div :class="classes.footer">
|
|
154
|
+
<slot name="primary-action"></slot>
|
|
155
|
+
<slot name="secondary-action"></slot>
|
|
156
|
+
</div>
|
|
157
|
+
</slot>
|
|
158
|
+
</form>
|
|
159
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import Form from '../Form.vue'
|
|
4
|
+
|
|
5
|
+
describe('Form', () => {
|
|
6
|
+
it('renders without errors', () => {
|
|
7
|
+
const wrapper = mount(Form)
|
|
8
|
+
|
|
9
|
+
expect(wrapper.vm).toBeTruthy()
|
|
10
|
+
})
|
|
11
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FormTheme } from '../Form.vue'
|
|
2
|
+
|
|
3
|
+
const theme: FormTheme = {
|
|
4
|
+
classes: {
|
|
5
|
+
wrapper: 'relative',
|
|
6
|
+
|
|
7
|
+
content: 'grid gap-4',
|
|
8
|
+
|
|
9
|
+
title: 'text-xl mb-1',
|
|
10
|
+
|
|
11
|
+
description: 'text-gray-500',
|
|
12
|
+
|
|
13
|
+
footer: 'space-x-4 mt-4',
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default theme
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FormTheme } from '../Form.vue'
|
|
2
|
+
|
|
3
|
+
const theme: FormTheme = {
|
|
4
|
+
classes: {
|
|
5
|
+
wrapper: 'relative',
|
|
6
|
+
|
|
7
|
+
content: 'grid',
|
|
8
|
+
|
|
9
|
+
title: 'text-xl mb-1',
|
|
10
|
+
|
|
11
|
+
description: 'text-gray-500',
|
|
12
|
+
|
|
13
|
+
footer: 'grid grid-cols-2 gap-4 lg:flex mt-8',
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default theme
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const formGroupProps = {
|
|
3
|
+
...useInteractive.props(),
|
|
4
|
+
...useInputtable.props(),
|
|
5
|
+
vertical: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: false,
|
|
8
|
+
},
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type FormGroupProps = ExtractPublicPropTypes<typeof formGroupProps>
|
|
12
|
+
|
|
13
|
+
export type FormGroupInjection = {
|
|
14
|
+
registerInputGroup: (name: string, focus: () => void) => void;
|
|
15
|
+
unregisterInputGroup: (name: string) => void;
|
|
16
|
+
setValue: (val: string | number | string[] | number[]) => void;
|
|
17
|
+
value: MaybeRef<string | number | string[] | number[] | null | undefined>;
|
|
18
|
+
isInsideFormGroup: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type FormGroupInput = {
|
|
22
|
+
name: string;
|
|
23
|
+
focus: () => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type InternalClasses = 'wrapper'
|
|
27
|
+
export interface FormGroupTheme extends ThemeComponent<FormGroupProps, InternalClasses> {}
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
name: 'XFormGroup',
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { provide, computed, type ExtractPublicPropTypes, type MaybeRef } from 'vue'
|
|
36
|
+
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
37
|
+
import { useInteractive } from '../../composables/useInteractive'
|
|
38
|
+
import { useInputtable } from '../../composables/useInputtable'
|
|
39
|
+
import { injectFormGroupKey } from '../../composables/keys'
|
|
40
|
+
|
|
41
|
+
import XLabel from '../label/Label.vue'
|
|
42
|
+
import XInputFooter from '../inputFooter/InputFooter.vue'
|
|
43
|
+
|
|
44
|
+
const props = defineProps(formGroupProps)
|
|
45
|
+
|
|
46
|
+
const inputs: FormGroupInput[] = []
|
|
47
|
+
|
|
48
|
+
const value = computed<string | number | string[] | number[]>(() => {
|
|
49
|
+
if (typeof props.modelValue === 'string') return props.modelValue
|
|
50
|
+
if (typeof props.modelValue === 'number') return props.modelValue
|
|
51
|
+
if (Array.isArray(props.modelValue)) return props.modelValue
|
|
52
|
+
|
|
53
|
+
return ''
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
provide(injectFormGroupKey, {
|
|
57
|
+
registerInputGroup: (name: string, focus: () => void) => {
|
|
58
|
+
inputs.push({ name, focus })
|
|
59
|
+
},
|
|
60
|
+
unregisterInputGroup: (name: string) => {
|
|
61
|
+
const index = inputs.findIndex((i) => i.name === name)
|
|
62
|
+
|
|
63
|
+
inputs.splice(index, 1)
|
|
64
|
+
},
|
|
65
|
+
setValue: (val) => {
|
|
66
|
+
emit('update:modelValue', val)
|
|
67
|
+
},
|
|
68
|
+
isInsideFormGroup: true,
|
|
69
|
+
value,
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
function focus() {
|
|
73
|
+
inputs[0]?.focus()
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const emit = defineEmits(useInputtable.emits())
|
|
77
|
+
|
|
78
|
+
const {
|
|
79
|
+
errorInternal,
|
|
80
|
+
isInsideForm,
|
|
81
|
+
isFirstValidation,
|
|
82
|
+
reset,
|
|
83
|
+
validate,
|
|
84
|
+
setError,
|
|
85
|
+
} = useInputtable(props, { focus, emit })
|
|
86
|
+
|
|
87
|
+
const listeners = {
|
|
88
|
+
change: (event: Event) => {
|
|
89
|
+
if (props.validateOnInput && !isFirstValidation.value) validate(props.modelValue)
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const { styles, classes, className } = useTheme('FormGroup', {}, props, { errorInternal })
|
|
94
|
+
|
|
95
|
+
defineExpose({ focus, blur, reset, validate, setError })
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<template>
|
|
99
|
+
<x-label
|
|
100
|
+
tag="fieldset"
|
|
101
|
+
:style="styles"
|
|
102
|
+
:disabled="disabled"
|
|
103
|
+
:required="required"
|
|
104
|
+
:is-inside-form="isInsideForm"
|
|
105
|
+
:label="label"
|
|
106
|
+
:class="[
|
|
107
|
+
className,
|
|
108
|
+
]"
|
|
109
|
+
v-on="listeners"
|
|
110
|
+
>
|
|
111
|
+
<div :class="classes.wrapper">
|
|
112
|
+
<slot></slot>
|
|
113
|
+
</div>
|
|
114
|
+
<x-input-footer v-if="!hideFooter" :error="errorInternal" :helper="helper"/>
|
|
115
|
+
</x-label>
|
|
116
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import FormGroup from '../FormGroup.vue'
|
|
4
|
+
|
|
5
|
+
describe('FormGroup', () => {
|
|
6
|
+
it('renders without errors', () => {
|
|
7
|
+
const wrapper = mount(FormGroup)
|
|
8
|
+
|
|
9
|
+
expect(wrapper.vm).toBeTruthy()
|
|
10
|
+
})
|
|
11
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FormGroupTheme } from '../FormGroup.vue'
|
|
2
|
+
|
|
3
|
+
const theme: FormGroupTheme = {
|
|
4
|
+
classes: {
|
|
5
|
+
wrapper: ({ props }) => {
|
|
6
|
+
const classes = ['']
|
|
7
|
+
|
|
8
|
+
if (!props.vertical) classes.push('flex gap-2')
|
|
9
|
+
else classes.push('grid gap-1')
|
|
10
|
+
|
|
11
|
+
return classes
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default theme
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FormGroupTheme } from '../FormGroup.vue'
|
|
2
|
+
|
|
3
|
+
const theme: FormGroupTheme = {
|
|
4
|
+
classes: {
|
|
5
|
+
wrapper: ({ props }) => {
|
|
6
|
+
const classes = ['']
|
|
7
|
+
|
|
8
|
+
if (!props.vertical) classes.push('flex gap-4')
|
|
9
|
+
else classes.push('grid gap-3')
|
|
10
|
+
|
|
11
|
+
return classes
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default theme
|