@indielayer/ui 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +4 -4
- package/docs/App.vue +25 -0
- package/docs/assets/css/hljs.css +302 -0
- package/docs/assets/css/tailwind.css +46 -0
- package/docs/assets/images/error.svg +1 -0
- package/docs/assets/images/logo.png +0 -0
- package/docs/assets/images/logo_mini.svg +10 -0
- package/docs/assets/images/logo_white.png +0 -0
- package/docs/assets/images/logo_word.svg +12 -0
- package/docs/assets/images/logo_word_dark.svg +12 -0
- package/docs/assets/images/photo1.jpeg +0 -0
- package/docs/assets/images/photo2.jpeg +0 -0
- package/docs/components/Cookies.vue +42 -0
- package/docs/components/common/CodePreview.vue +80 -0
- package/docs/components/common/CodeSnippet.vue +49 -0
- package/docs/components/common/CopyButton.vue +50 -0
- package/docs/components/common/DocumentPage.vue +289 -0
- package/docs/components/common/Indielayer-theme.json +702 -0
- package/docs/components/common/MultiSnippet.vue +26 -0
- package/docs/components/menu/DocsMenu.vue +143 -0
- package/docs/components/toolbar/PreToolbar.vue +18 -0
- package/docs/components/toolbar/Toolbar.vue +63 -0
- package/docs/components/toolbar/ToolbarColorToggle.vue +49 -0
- package/docs/icons.ts +61 -0
- package/docs/layouts/default.vue +29 -0
- package/docs/layouts/simple.vue +3 -0
- package/docs/main.ts +33 -0
- package/docs/pages/colors.vue +125 -0
- package/docs/pages/component/accordion/index.vue +29 -0
- package/docs/pages/component/accordion/usage.vue +30 -0
- package/docs/pages/component/alert/index.vue +29 -0
- package/docs/pages/component/alert/usage.vue +18 -0
- package/docs/pages/component/avatar/index.vue +43 -0
- package/docs/pages/component/avatar/size.vue +9 -0
- package/docs/pages/component/avatar/usage.vue +9 -0
- package/docs/pages/component/avatar/variants.vue +8 -0
- package/docs/pages/component/badge/index.vue +29 -0
- package/docs/pages/component/badge/usage.vue +50 -0
- package/docs/pages/component/breadcrumbs/index.vue +29 -0
- package/docs/pages/component/breadcrumbs/usage.vue +19 -0
- package/docs/pages/component/button/button-group.vue +18 -0
- package/docs/pages/component/button/icons.vue +9 -0
- package/docs/pages/component/button/index.vue +64 -0
- package/docs/pages/component/button/size.vue +9 -0
- package/docs/pages/component/button/states.vue +6 -0
- package/docs/pages/component/button/usage.vue +12 -0
- package/docs/pages/component/button/variants.vue +7 -0
- package/docs/pages/component/card/index.vue +29 -0
- package/docs/pages/component/card/usage.vue +6 -0
- package/docs/pages/component/carousel/index.vue +29 -0
- package/docs/pages/component/carousel/usage.vue +10 -0
- package/docs/pages/component/checkbox/index.vue +50 -0
- package/docs/pages/component/checkbox/size.vue +9 -0
- package/docs/pages/component/checkbox/states.vue +9 -0
- package/docs/pages/component/checkbox/usage.vue +15 -0
- package/docs/pages/component/checkbox/variants.vue +8 -0
- package/docs/pages/component/container/index.vue +29 -0
- package/docs/pages/component/container/usage.vue +3 -0
- package/docs/pages/component/divider/index.vue +43 -0
- package/docs/pages/component/divider/label.vue +12 -0
- package/docs/pages/component/divider/usage.vue +7 -0
- package/docs/pages/component/divider/vertical.vue +7 -0
- package/docs/pages/component/drawer/index.vue +29 -0
- package/docs/pages/component/drawer/usage.vue +56 -0
- package/docs/pages/component/form/index.vue +29 -0
- package/docs/pages/component/form/usage.vue +96 -0
- package/docs/pages/component/formGroup/index.vue +29 -0
- package/docs/pages/component/formGroup/usage.vue +46 -0
- package/docs/pages/component/icon/index.vue +36 -0
- package/docs/pages/component/icon/usage.vue +6 -0
- package/docs/pages/component/icon/variants.vue +14 -0
- package/docs/pages/component/image/index.vue +29 -0
- package/docs/pages/component/image/usage.vue +8 -0
- package/docs/pages/component/input/index.vue +50 -0
- package/docs/pages/component/input/size.vue +13 -0
- package/docs/pages/component/input/states.vue +12 -0
- package/docs/pages/component/input/usage.vue +15 -0
- package/docs/pages/component/input/variants.vue +18 -0
- package/docs/pages/component/link/index.vue +29 -0
- package/docs/pages/component/link/usage.vue +12 -0
- package/docs/pages/component/loader/index.vue +29 -0
- package/docs/pages/component/loader/usage.vue +7 -0
- package/docs/pages/component/menu/index.vue +29 -0
- package/docs/pages/component/menu/usage.vue +69 -0
- package/docs/pages/component/modal/composed.vue +70 -0
- package/docs/pages/component/modal/index.vue +36 -0
- package/docs/pages/component/modal/usage.vue +61 -0
- package/docs/pages/component/notifications/index.vue +29 -0
- package/docs/pages/component/notifications/usage.vue +56 -0
- package/docs/pages/component/pagination/index.vue +29 -0
- package/docs/pages/component/pagination/usage.vue +17 -0
- package/docs/pages/component/popover/index.vue +29 -0
- package/docs/pages/component/popover/usage.vue +21 -0
- package/docs/pages/component/progress/index.vue +36 -0
- package/docs/pages/component/progress/usage.vue +7 -0
- package/docs/pages/component/progress/variants.vue +18 -0
- package/docs/pages/component/radio/index.vue +50 -0
- package/docs/pages/component/radio/size.vue +15 -0
- package/docs/pages/component/radio/states.vue +13 -0
- package/docs/pages/component/radio/usage.vue +14 -0
- package/docs/pages/component/radio/variants.vue +39 -0
- package/docs/pages/component/scroll/horizontal.vue +14 -0
- package/docs/pages/component/scroll/index.vue +36 -0
- package/docs/pages/component/scroll/usage.vue +5 -0
- package/docs/pages/component/select/index.vue +43 -0
- package/docs/pages/component/select/states.vue +22 -0
- package/docs/pages/component/select/usage.vue +45 -0
- package/docs/pages/component/select/variants.vue +23 -0
- package/docs/pages/component/skeleton/index.vue +29 -0
- package/docs/pages/component/skeleton/usage.vue +10 -0
- package/docs/pages/component/slider/index.vue +29 -0
- package/docs/pages/component/slider/usage.vue +15 -0
- package/docs/pages/component/spacer/index.vue +29 -0
- package/docs/pages/component/spacer/usage.vue +8 -0
- package/docs/pages/component/spinner/index.vue +36 -0
- package/docs/pages/component/spinner/usage.vue +3 -0
- package/docs/pages/component/spinner/variants.vue +9 -0
- package/docs/pages/component/stepper/index.vue +29 -0
- package/docs/pages/component/stepper/usage.vue +21 -0
- package/docs/pages/component/table/index.vue +36 -0
- package/docs/pages/component/table/states.vue +28 -0
- package/docs/pages/component/table/usage.vue +107 -0
- package/docs/pages/component/tabs/index.vue +29 -0
- package/docs/pages/component/tabs/usage.vue +137 -0
- package/docs/pages/component/tag/index.vue +29 -0
- package/docs/pages/component/tag/usage.vue +27 -0
- package/docs/pages/component/textarea/index.vue +43 -0
- package/docs/pages/component/textarea/states.vue +13 -0
- package/docs/pages/component/textarea/usage.vue +22 -0
- package/docs/pages/component/textarea/variants.vue +15 -0
- package/docs/pages/component/toggle/index.vue +43 -0
- package/docs/pages/component/toggle/states.vue +13 -0
- package/docs/pages/component/toggle/usage.vue +14 -0
- package/docs/pages/component/toggle/variants.vue +15 -0
- package/docs/pages/component/tooltip/index.vue +29 -0
- package/docs/pages/component/tooltip/usage.vue +16 -0
- package/docs/pages/error.vue +6 -0
- package/docs/pages/icons.vue +105 -0
- package/docs/pages/index.vue +157 -0
- package/docs/pages/play.vue +19 -0
- package/docs/pages/typography.vue +95 -0
- package/docs/router/index.ts +75 -0
- package/exports/tailwind.preset.js +1 -0
- package/lib/common/icons.d.ts +4 -1
- package/lib/common/icons.js +14 -11
- package/lib/components/accordion/Accordion.vue.d.ts +63 -0
- package/lib/components/accordion/Accordion.vue.js +40 -0
- package/lib/components/accordion/Accordion.vue2.js +4 -0
- package/lib/components/{collapse/Collapse.vue.d.ts → accordion/AccordionItem.vue.d.ts} +33 -18
- package/lib/components/accordion/AccordionItem.vue.js +140 -0
- package/lib/components/accordion/AccordionItem.vue2.js +4 -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 +5 -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 +5 -0
- package/lib/components/alert/theme/Alert.carbon.theme.js +39 -3
- package/lib/components/avatar/Avatar.vue.d.ts +2 -2
- package/lib/components/badge/Badge.vue.d.ts +2 -2
- package/lib/components/button/Button.vue.d.ts +3 -3
- package/lib/components/button/ButtonGroup.vue.d.ts +3 -3
- package/lib/components/button/theme/Button.carbon.theme.js +1 -1
- package/lib/components/carousel/CarouselSlide.vue.d.ts +19 -8
- package/lib/components/carousel/CarouselSlide.vue.js +2 -2
- package/lib/components/carousel/CarouselSlide.vue2.js +25 -18
- package/lib/components/checkbox/Checkbox.vue.d.ts +22 -10
- package/lib/components/checkbox/Checkbox.vue2.js +106 -72
- package/lib/components/checkbox/theme/Checkbox.base.theme.js +38 -31
- package/lib/components/checkbox/theme/Checkbox.carbon.theme.js +38 -31
- package/lib/components/container/Container.vue.d.ts +13 -0
- package/lib/components/container/Container.vue.js +15 -11
- package/lib/components/container/theme/Container.base.theme.js +7 -4
- package/lib/components/drawer/Drawer.vue.d.ts +4 -4
- package/lib/components/form/Form.vue.d.ts +25 -2
- package/lib/components/form/Form.vue.js +67 -36
- package/lib/components/form/theme/Form.base.theme.js +8 -4
- package/lib/components/form/theme/Form.carbon.theme.js +10 -3
- 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/theme/Icon.base.theme.js +1 -1
- package/lib/components/icon/theme/Icon.carbon.theme.js +4 -4
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +106 -100
- package/lib/components/input/Input.vue.d.ts +12 -9
- package/lib/components/input/Input.vue.js +39 -39
- package/lib/components/input/theme/Input.carbon.theme.js +1 -1
- package/lib/components/inputFooter/theme/InputFooter.base.theme.js +1 -1
- package/lib/components/inputFooter/theme/InputFooter.carbon.theme.js +1 -1
- package/lib/components/label/Label.vue.d.ts +3 -3
- package/lib/components/label/theme/Label.carbon.theme.js +7 -6
- package/lib/components/link/Link.vue.d.ts +1 -1
- package/lib/components/link/Link.vue.js +2 -2
- package/lib/components/link/Link.vue2.js +1 -1
- package/lib/components/link/theme/Link.base.theme.js +4 -4
- package/lib/components/link/theme/Link.carbon.theme.js +23 -3
- package/lib/components/loader/theme/Loader.carbon.theme.js +1 -1
- package/lib/components/menu/Menu.vue.d.ts +6 -5
- package/lib/components/menu/Menu.vue.js +43 -40
- package/lib/components/menu/MenuItem.vue.d.ts +4 -4
- package/lib/components/menu/MenuItem.vue.js +2 -2
- package/lib/components/menu/MenuItem.vue2.js +1 -1
- package/lib/components/menu/theme/MenuItem.base.theme.js +3 -3
- package/lib/components/modal/Modal.vue.d.ts +98 -3
- package/lib/components/modal/Modal.vue.js +153 -100
- package/lib/components/modal/theme/Modal.base.theme.js +15 -9
- package/lib/components/modal/theme/Modal.carbon.theme.js +27 -3
- package/lib/components/notifications/Notifications.vue.js +56 -53
- package/lib/components/notifications/theme/Notifications.base.theme.js +1 -1
- package/lib/components/notifications/theme/Notifications.carbon.theme.js +8 -3
- package/lib/components/popover/Popover.vue.d.ts +3 -3
- package/lib/components/radio/Radio.vue.d.ts +17 -12
- package/lib/components/radio/Radio.vue2.js +81 -66
- package/lib/components/radio/theme/Radio.base.theme.js +19 -16
- package/lib/components/radio/theme/Radio.carbon.theme.js +32 -29
- package/lib/components/select/Select.vue.d.ts +13 -10
- package/lib/components/select/Select.vue.js +115 -116
- package/lib/components/select/theme/Select.base.theme.js +10 -10
- package/lib/components/select/theme/Select.carbon.theme.js +5 -5
- package/lib/components/skeleton/Skeleton.vue.d.ts +19 -1
- package/lib/components/skeleton/Skeleton.vue.js +25 -15
- package/lib/components/skeleton/theme/Skeleton.base.theme.js +7 -4
- package/lib/components/slider/Slider.vue.d.ts +12 -6
- package/lib/components/slider/Slider.vue.js +3 -4
- package/lib/components/slider/theme/Slider.carbon.theme.js +4 -4
- package/lib/components/spinner/Spinner.vue.d.ts +1 -1
- package/lib/components/spinner/Spinner.vue.js +16 -17
- 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/{collapse/theme/Collapse.carbon.theme.js → stepper/theme/Stepper.carbon.theme.js} +1 -1
- package/lib/components/tab/Tab.vue.d.ts +11 -5
- package/lib/components/tab/Tab.vue.js +65 -50
- package/lib/components/tab/TabGroup.vue.d.ts +1 -1
- package/lib/components/tab/TabGroup.vue.js +5 -5
- package/lib/components/tab/theme/Tab.base.theme.js +2 -1
- package/lib/components/tab/theme/Tab.carbon.theme.js +6 -5
- package/lib/components/tab/theme/TabGroup.carbon.theme.js +28 -2
- package/lib/components/table/Table.vue.d.ts +115 -9
- package/lib/components/table/Table.vue.js +209 -98
- package/lib/components/table/TableCell.vue.d.ts +4 -5
- package/lib/components/table/TableCell.vue.js +21 -22
- package/lib/components/table/TableHead.vue.d.ts +16 -0
- package/lib/components/table/TableHead.vue.js +21 -0
- package/lib/components/table/TableHead.vue2.js +4 -0
- package/lib/components/table/TableHeader.vue.d.ts +4 -0
- package/lib/components/table/TableHeader.vue.js +45 -54
- package/lib/components/table/TableRow.vue.d.ts +15 -1
- package/lib/components/table/TableRow.vue.js +21 -25
- package/lib/components/table/index.d.ts +4 -2
- package/lib/components/table/theme/Table.base.theme.js +7 -6
- package/lib/components/table/theme/Table.carbon.theme.js +11 -3
- package/lib/components/table/theme/TableCell.base.theme.js +3 -3
- package/lib/components/table/theme/TableCell.carbon.theme.js +9 -3
- package/lib/components/table/theme/TableHead.base.theme.d.ts +3 -0
- package/lib/components/table/theme/TableHead.base.theme.js +9 -0
- package/lib/components/table/theme/TableHead.carbon.theme.d.ts +3 -0
- package/lib/components/table/theme/TableHead.carbon.theme.js +9 -0
- package/lib/components/table/theme/TableHeader.base.theme.d.ts +3 -0
- package/lib/components/table/theme/TableHeader.base.theme.js +12 -0
- package/lib/components/table/theme/TableHeader.carbon.theme.d.ts +3 -0
- package/lib/components/table/theme/TableHeader.carbon.theme.js +12 -0
- package/lib/components/table/theme/TableRow.base.theme.d.ts +3 -0
- package/lib/components/table/theme/TableRow.base.theme.js +11 -0
- package/lib/components/table/theme/TableRow.carbon.theme.d.ts +3 -0
- package/lib/components/table/theme/TableRow.carbon.theme.js +11 -0
- package/lib/components/tag/Tag.vue.d.ts +3 -3
- package/lib/components/tag/Tag.vue.js +17 -17
- package/lib/components/tag/theme/Tag.base.theme.js +14 -13
- package/lib/components/tag/theme/Tag.carbon.theme.js +14 -14
- package/lib/components/textarea/Textarea.vue.d.ts +11 -8
- package/lib/components/textarea/Textarea.vue.js +34 -34
- package/lib/components/textarea/theme/Textarea.carbon.theme.js +1 -1
- package/lib/components/toggle/Toggle.vue.d.ts +12 -12
- package/lib/components/toggle/Toggle.vue.js +37 -39
- package/lib/composables/keys.d.ts +5 -1
- package/lib/composables/keys.js +8 -6
- package/lib/composables/useFocusTrap.d.ts +6 -0
- package/lib/composables/useFocusTrap.js +45 -0
- package/lib/composables/useInputtable.d.ts +6 -0
- package/lib/composables/useInputtable.js +59 -42
- package/lib/index.js +137 -129
- package/lib/index.umd.js +3 -3
- 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 +8 -2
- package/lib/themes/base/components.d.ts +7 -1
- package/lib/themes/base/components.js +98 -86
- package/lib/themes/carbon/components.d.ts +7 -1
- package/lib/themes/carbon/components.js +98 -86
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +7 -2
- package/src/common/icons.ts +4 -1
- package/src/components/accordion/Accordion.vue +55 -0
- package/src/components/{collapse/Collapse.vue → accordion/AccordionItem.vue} +51 -32
- 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 +7 -0
- package/src/components/accordion/theme/AccordionItem.base.theme.ts +38 -0
- package/src/components/accordion/theme/AccordionItem.carbon.theme.ts +7 -0
- package/src/components/alert/theme/Alert.carbon.theme.ts +54 -2
- package/src/components/button/theme/Button.carbon.theme.ts +1 -1
- package/src/components/carousel/CarouselSlide.vue +9 -4
- package/src/components/checkbox/Checkbox.vue +69 -20
- package/src/components/checkbox/theme/Checkbox.base.theme.ts +15 -1
- package/src/components/checkbox/theme/Checkbox.carbon.theme.ts +17 -3
- package/src/components/container/Container.vue +4 -0
- package/src/components/container/theme/Container.base.theme.ts +7 -1
- package/src/components/form/Form.vue +26 -5
- package/src/components/form/theme/Form.base.theme.ts +9 -1
- package/src/components/form/theme/Form.carbon.theme.ts +12 -2
- 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/theme/Icon.base.theme.ts +1 -1
- package/src/components/icon/theme/Icon.carbon.theme.ts +3 -4
- package/src/components/index.ts +3 -1
- package/src/components/input/Input.vue +3 -3
- package/src/components/input/theme/Input.carbon.theme.ts +1 -1
- package/src/components/inputFooter/theme/InputFooter.base.theme.ts +1 -1
- package/src/components/inputFooter/theme/InputFooter.carbon.theme.ts +1 -1
- package/src/components/label/theme/Label.carbon.theme.ts +8 -3
- package/src/components/link/Link.vue +1 -1
- package/src/components/link/theme/Link.carbon.theme.ts +23 -2
- package/src/components/loader/theme/Loader.carbon.theme.ts +1 -1
- package/src/components/menu/Menu.vue +8 -5
- package/src/components/menu/MenuItem.vue +1 -1
- package/src/components/menu/theme/MenuItem.base.theme.ts +3 -3
- package/src/components/modal/Modal.vue +110 -50
- package/src/components/modal/theme/Modal.base.theme.ts +28 -12
- package/src/components/modal/theme/Modal.carbon.theme.ts +55 -2
- package/src/components/notifications/Notifications.vue +5 -5
- package/src/components/notifications/theme/Notifications.base.theme.ts +1 -1
- package/src/components/notifications/theme/Notifications.carbon.theme.ts +12 -2
- package/src/components/radio/Radio.vue +39 -15
- package/src/components/radio/theme/Radio.base.theme.ts +7 -1
- package/src/components/radio/theme/Radio.carbon.theme.ts +13 -7
- package/src/components/select/Select.vue +10 -11
- package/src/components/select/theme/Select.base.theme.ts +1 -1
- package/src/components/select/theme/Select.carbon.theme.ts +2 -2
- package/src/components/skeleton/Skeleton.vue +18 -2
- package/src/components/skeleton/theme/Skeleton.base.theme.ts +8 -1
- package/src/components/slider/Slider.vue +1 -2
- package/src/components/slider/theme/Slider.carbon.theme.ts +1 -1
- package/src/components/spinner/Spinner.vue +2 -2
- package/src/components/stepper/Stepper.vue +153 -0
- package/src/components/{collapse/__tests__/Collapse.spec.ts → stepper/__tests__/Stepper.spec.ts} +3 -3
- 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 +20 -6
- package/src/components/tab/TabGroup.vue +2 -2
- package/src/components/tab/theme/Tab.base.theme.ts +2 -0
- package/src/components/tab/theme/Tab.carbon.theme.ts +4 -2
- package/src/components/tab/theme/TabGroup.carbon.theme.ts +50 -2
- package/src/components/table/Table.vue +123 -27
- package/src/components/table/TableCell.vue +5 -6
- package/src/components/table/TableHead.vue +25 -0
- package/src/components/table/TableHeader.vue +35 -56
- package/src/components/table/TableRow.vue +19 -17
- package/src/components/table/index.ts +4 -2
- package/src/components/table/theme/Table.base.theme.ts +9 -7
- package/src/components/table/theme/Table.carbon.theme.ts +18 -2
- package/src/components/table/theme/TableCell.base.theme.ts +1 -1
- package/src/components/table/theme/TableCell.carbon.theme.ts +24 -2
- package/src/components/table/theme/TableHead.base.theme.ts +10 -0
- package/src/components/table/theme/TableHead.carbon.theme.ts +10 -0
- package/src/components/table/theme/TableHeader.base.theme.ts +28 -0
- package/src/components/table/theme/TableHeader.carbon.theme.ts +28 -0
- package/src/components/table/theme/TableRow.base.theme.ts +21 -0
- package/src/components/table/theme/TableRow.carbon.theme.ts +21 -0
- package/src/components/tag/Tag.vue +4 -4
- package/src/components/tag/theme/Tag.base.theme.ts +4 -4
- package/src/components/tag/theme/Tag.carbon.theme.ts +5 -6
- package/src/components/textarea/Textarea.vue +3 -3
- package/src/components/textarea/theme/Textarea.carbon.theme.ts +1 -1
- package/src/components/toggle/Toggle.vue +2 -4
- package/src/composables/keys.ts +5 -1
- package/src/composables/useFocusTrap.ts +106 -0
- package/src/composables/useInputtable.ts +31 -3
- package/src/theme.ts +14 -2
- package/src/themes/base/components.ts +7 -1
- package/src/themes/carbon/components.ts +7 -1
- package/src/version.ts +1 -1
- package/volar.d.ts +5 -1
- package/lib/components/collapse/Collapse.vue.js +0 -131
- package/lib/components/collapse/Collapse.vue2.js +0 -4
- package/lib/components/collapse/index.d.ts +0 -2
- package/lib/components/collapse/theme/Collapse.base.theme.d.ts +0 -3
- package/lib/components/collapse/theme/Collapse.base.theme.js +0 -10
- package/lib/components/collapse/theme/Collapse.carbon.theme.d.ts +0 -3
- package/lib/components/table/TableHead.d.ts +0 -2
- package/lib/components/table/TableHead.js +0 -19
- package/src/components/collapse/index.ts +0 -2
- package/src/components/collapse/theme/Collapse.base.theme.ts +0 -13
- package/src/components/collapse/theme/Collapse.carbon.theme.ts +0 -7
- package/src/components/table/TableHead.tsx +0 -14
- /package/lib/components/{collapse/__tests__/Collapse.spec.d.ts → accordion/__tests__/Accordion.spec.d.ts} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pt-1">
|
|
3
|
+
<x-tab-group v-model="selected" class="mb-2">
|
|
4
|
+
<x-tab v-for="(snippet, index) in snippets" :key="index" :value="index" :label="snippet.label"/>
|
|
5
|
+
</x-tab-group>
|
|
6
|
+
<div v-for="(snippet, index) in snippets" :key="index">
|
|
7
|
+
<code-snippet v-if="selected === index" class="!pl-0" :code="snippet.code" :lang="snippet.lang" />
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
export default {
|
|
14
|
+
props: {
|
|
15
|
+
snippets: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => {},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
selected: 0,
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
setup() {
|
|
4
|
+
return {
|
|
5
|
+
docsMenu: [
|
|
6
|
+
{ to: '/getting-started', label: 'Getting Started', icon: 'book' },
|
|
7
|
+
{ to: '/typography', label: 'Typography', icon: 'type' },
|
|
8
|
+
{ to: '/colors', label: 'Colors', icon: 'palette' },
|
|
9
|
+
{ to: '/icons', label: 'Icons', icon: 'star' },
|
|
10
|
+
],
|
|
11
|
+
components: [
|
|
12
|
+
{
|
|
13
|
+
label: 'Form',
|
|
14
|
+
icon: 'edit',
|
|
15
|
+
collapseIcon: 'chevron-down',
|
|
16
|
+
expanded: true,
|
|
17
|
+
items: [
|
|
18
|
+
{ to: '/component/button', label: 'Button' },
|
|
19
|
+
{ to: '/component/checkbox', label: 'Checkbox' },
|
|
20
|
+
{ to: '/component/form', label: 'Form' },
|
|
21
|
+
{ to: '/component/formGroup', label: 'Form Group' },
|
|
22
|
+
{ to: '/component/input', label: 'Input' },
|
|
23
|
+
{ to: '/component/radio', label: 'Radio' },
|
|
24
|
+
{ to: '/component/select', label: 'Select' },
|
|
25
|
+
{ to: '/component/slider', label: 'Slider' },
|
|
26
|
+
{ to: '/component/textarea', label: 'Textarea' },
|
|
27
|
+
{ to: '/component/toggle', label: 'Toggle' },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'UI',
|
|
32
|
+
icon: 'cube',
|
|
33
|
+
collapseIcon: 'chevron-down',
|
|
34
|
+
expanded: true,
|
|
35
|
+
items: [
|
|
36
|
+
{ to: '/component/accordion', label: 'Accordion' },
|
|
37
|
+
{ to: '/component/alert', label: 'Alert' },
|
|
38
|
+
{ to: '/component/avatar', label: 'Avatar' },
|
|
39
|
+
{ to: '/component/badge', label: 'Badge' },
|
|
40
|
+
{ to: '/component/breadcrumbs', label: 'Breadcrumbs' },
|
|
41
|
+
{ to: '/component/card', label: 'Card' },
|
|
42
|
+
{ to: '/component/carousel', label: 'Carousel' },
|
|
43
|
+
{ to: '/component/container', label: 'Container' },
|
|
44
|
+
{ to: '/component/divider', label: 'Divider' },
|
|
45
|
+
{ to: '/component/drawer', label: 'Drawer' },
|
|
46
|
+
{ to: '/component/icon', label: 'Icon' },
|
|
47
|
+
{ to: '/component/image', label: 'Image' },
|
|
48
|
+
{ to: '/component/loader', label: 'Loader' },
|
|
49
|
+
{ to: '/component/link', label: 'Link' },
|
|
50
|
+
{ to: '/component/menu', label: 'Menu' },
|
|
51
|
+
{ to: '/component/modal', label: 'Modal' },
|
|
52
|
+
{ to: '/component/notifications', label: 'Notifications' },
|
|
53
|
+
{ to: '/component/pagination', label: 'Pagination' },
|
|
54
|
+
{ to: '/component/popover', label: 'Popover' },
|
|
55
|
+
{ to: '/component/progress', label: 'Progress' },
|
|
56
|
+
{ to: '/component/skeleton', label: 'Skeleton' },
|
|
57
|
+
{ to: '/component/spinner', label: 'Spinner' },
|
|
58
|
+
{ to: '/component/stepper', label: 'Stepper' },
|
|
59
|
+
{ to: '/component/table', label: 'Table' },
|
|
60
|
+
{ to: '/component/tabs', label: 'Tabs' },
|
|
61
|
+
{ to: '/component/tag', label: 'Tag' },
|
|
62
|
+
{ to: '/component/tooltip', label: 'Tooltip' },
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: 'Helpers',
|
|
67
|
+
icon: 'wrench',
|
|
68
|
+
collapseIcon: 'chevron-down',
|
|
69
|
+
expanded: true,
|
|
70
|
+
items: [
|
|
71
|
+
{ to: '/component/scroll', label: 'Scroll' },
|
|
72
|
+
{ to: '/component/spacer', label: 'Spacer' },
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<template>
|
|
82
|
+
<div style="min-width: 240px;" class="pb-4">
|
|
83
|
+
<div class="title text-overline text-xs font-light ml-6 mt-6 mb-4">Documentation</div>
|
|
84
|
+
<x-menu
|
|
85
|
+
:items="docsMenu"
|
|
86
|
+
class="m-4"
|
|
87
|
+
color="primary"
|
|
88
|
+
filled
|
|
89
|
+
@item-click="$emit('close')"
|
|
90
|
+
/>
|
|
91
|
+
<x-divider class="px-4"/>
|
|
92
|
+
<div class="title text-overline text-xs font-light ml-6 mt-8 mb-4">Components</div>
|
|
93
|
+
<x-menu
|
|
94
|
+
:items="components"
|
|
95
|
+
class="m-4"
|
|
96
|
+
color="primary"
|
|
97
|
+
filled
|
|
98
|
+
@item-click="$emit('close')"
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
</template>
|
|
102
|
+
|
|
103
|
+
<style lang="postcss" scoped>
|
|
104
|
+
ul {
|
|
105
|
+
a {
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
padding: 6px 21px;
|
|
109
|
+
|
|
110
|
+
&:hover {
|
|
111
|
+
@apply bg-secondary-200;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.router-link-exact-active {
|
|
115
|
+
@apply bg-secondary-300;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&.inner {
|
|
120
|
+
a {
|
|
121
|
+
padding: 8px 32px;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.menu :deep(a) {
|
|
127
|
+
padding: 8px 32px !important;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.dark {
|
|
131
|
+
ul {
|
|
132
|
+
a {
|
|
133
|
+
&:hover {
|
|
134
|
+
@apply bg-secondary-600;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&.router-link-exact-active {
|
|
138
|
+
@apply bg-secondary-500;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import ToolbarColorToggle from './ToolbarColorToggle.vue'
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="bg-gray-900 dark border-b">
|
|
7
|
+
<x-container fluid>
|
|
8
|
+
<div class="flex justify-items-center items-center py-2 text-slate-500 dark:text-slate-300 h-10 text-sm">
|
|
9
|
+
<toolbar-color-toggle />
|
|
10
|
+
<p class="text-secondary-300 font-semibold ml-2 truncate">
|
|
11
|
+
Indielayer UI - Vue.js 3 / Nuxt.js 3 UI Library with Tailwind CSS 3. ⚡️ Build and prototype fast web applications.
|
|
12
|
+
</p>
|
|
13
|
+
<x-spacer/>
|
|
14
|
+
<a target="_blank" href="https://github.com/indielayer"><x-icon size="sm" icon="github"/></a>
|
|
15
|
+
</div>
|
|
16
|
+
</x-container>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject, ref, unref, watch } from 'vue'
|
|
3
|
+
import { version, type UITheme } from '@indielayer/ui'
|
|
4
|
+
|
|
5
|
+
const selectTheme = inject('selectTheme', {
|
|
6
|
+
theme: {} as UITheme,
|
|
7
|
+
themes: [],
|
|
8
|
+
setTheme(key: string) {},
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const selected = ref(unref(selectTheme.theme).name)
|
|
12
|
+
|
|
13
|
+
const options = selectTheme.themes.map((t: any) => ({
|
|
14
|
+
value: t.name, label: t.name,
|
|
15
|
+
}))
|
|
16
|
+
|
|
17
|
+
watch(selected, (val) => {
|
|
18
|
+
if (val) {
|
|
19
|
+
selectTheme.setTheme(val)
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<div class="bg-white dark:bg-gray-800 border-b px-4">
|
|
26
|
+
<div class="flex justify-items-center items-center h-[70px]">
|
|
27
|
+
<a href="/" class="flex items-center md:ml-4">
|
|
28
|
+
<img src="@/assets/images/logo_mini.svg" width="26" alt="Indielayer"/>
|
|
29
|
+
<x-divider vertical class="h-[40px] mx-3"/>
|
|
30
|
+
<img class="logo-dark" src="@/assets/images/logo_word.svg" width="120" alt="Indielayer UI"/>
|
|
31
|
+
<img class="logo-white" src="@/assets/images/logo_word_dark.svg" width="120" alt="Indielayer UI"/>
|
|
32
|
+
|
|
33
|
+
<div class="flex items-center text-xs tracking-widest">
|
|
34
|
+
<div class="pl-2 font-bold text-primary-500">UI</div>
|
|
35
|
+
</div>
|
|
36
|
+
</a>
|
|
37
|
+
|
|
38
|
+
<x-spacer/>
|
|
39
|
+
|
|
40
|
+
<div class="flex items-center font-semibold text-sm">
|
|
41
|
+
<x-select v-model="selected" :options="options" hide-footer size="sm"/>
|
|
42
|
+
<x-divider vertical style="height: 10px;" class="px-2"/>
|
|
43
|
+
<div class="tracking-wide text-xs">v{{ version }}</div>
|
|
44
|
+
<x-divider vertical style="height: 10px;" class="px-2 hidden sm:block"/>
|
|
45
|
+
<x-link href="https://github.com/indielayer/ui" target="_blank" external class="hidden sm:block">Github</x-link>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<style lang="postcss">
|
|
52
|
+
.logo-white {
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
html.dark .logo-white {
|
|
57
|
+
display: block;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
html.dark .logo-dark {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const colorMode = ref('light')
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
const storedMode = localStorage.getItem('color-mode')
|
|
8
|
+
|
|
9
|
+
if (storedMode) {
|
|
10
|
+
colorMode.value = storedMode
|
|
11
|
+
} else {
|
|
12
|
+
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
13
|
+
colorMode.value = 'dark'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
} catch (e) {
|
|
17
|
+
colorMode.value = 'light'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
updateMode()
|
|
21
|
+
|
|
22
|
+
function toggle() {
|
|
23
|
+
colorMode.value = (colorMode.value === 'light') ? 'dark' : 'light'
|
|
24
|
+
|
|
25
|
+
updateMode()
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
localStorage.setItem('color-mode', colorMode.value)
|
|
29
|
+
} catch (e) {
|
|
30
|
+
colorMode.value = 'light'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function updateMode() {
|
|
35
|
+
colorMode.value === 'light'
|
|
36
|
+
? document.querySelector('html')?.classList.remove('dark')
|
|
37
|
+
: document.querySelector('html')?.classList.add('dark')
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<x-button
|
|
43
|
+
ghost
|
|
44
|
+
size="sm"
|
|
45
|
+
class="-ml-2"
|
|
46
|
+
:icon-left="colorMode === 'light' ? 'sun' : 'moon'"
|
|
47
|
+
@click="toggle"
|
|
48
|
+
/>
|
|
49
|
+
</template>
|
package/docs/icons.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'cube': '<path d="M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9" />',
|
|
3
|
+
code: '<polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline>',
|
|
4
|
+
'fullsvg': '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>',
|
|
5
|
+
'align-justify': '<line x1="21" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="21" y1="18" x2="3" y2="18"></line>',
|
|
6
|
+
'align-left': '<line x1="17" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="17" y1="18" x2="3" y2="18"></line>',
|
|
7
|
+
'align-right': '<line x1="21" y1="10" x2="7" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="21" y1="18" x2="7" y2="18"></line>',
|
|
8
|
+
palette: '<path d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01" />',
|
|
9
|
+
smile: '<circle cx="12" cy="12" r="10"></circle><path d="M8 14s1.5 2 4 2 4-2 4-2"></path><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line>',
|
|
10
|
+
check: '<polyline points="20 6 9 17 4 12"></polyline>',
|
|
11
|
+
type: '<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><line x1="4" y1="20" x2="7" y2="20"></line><line x1="14" y1="20" x2="21" y2="20"></line><line x1="6.9" y1="15" x2="13.8" y2="15"></line><line x1="10.2" y1="6.3" x2="16" y2="20"></line><polyline points="5 20 11 4 13 4 20 20"></polyline>',
|
|
12
|
+
copy: '<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>',
|
|
13
|
+
book: '<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>',
|
|
14
|
+
github: '<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path>',
|
|
15
|
+
twitter: '<path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path>',
|
|
16
|
+
'activity': '<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline>',
|
|
17
|
+
'trending-up': '<polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline><polyline points="17 6 23 6 23 12"></polyline>',
|
|
18
|
+
mail: '<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline>',
|
|
19
|
+
'chevron-left': '<polyline points="15 18 9 12 15 6"></polyline>',
|
|
20
|
+
'chevron-right': '<polyline points="9 18 15 12 9 6"></polyline>',
|
|
21
|
+
'chevron-up': '<polyline points="18 15 12 9 6 15"></polyline>',
|
|
22
|
+
'chevron-down': '<path d="M19 9l-7 7-7-7" />',
|
|
23
|
+
plus: '<line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line>',
|
|
24
|
+
'check-circle': '<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline>',
|
|
25
|
+
'x-circle': '<circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line>',
|
|
26
|
+
x: '<line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line>',
|
|
27
|
+
sun: '<circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>',
|
|
28
|
+
moon: '<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>',
|
|
29
|
+
upload: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line>',
|
|
30
|
+
menu: '<line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line>',
|
|
31
|
+
bold: '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 5h6a3.5 3.5 0 0 1 0 7h-6z" /><path d="M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" />',
|
|
32
|
+
italic: '<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><line x1="11" y1="5" x2="17" y2="5"></line><line x1="7" y1="19" x2="13" y2="19"></line><line x1="14" y1="5" x2="10" y2="19"></line>',
|
|
33
|
+
'edit': '<path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path>',
|
|
34
|
+
'more-horizontal': '<circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle>',
|
|
35
|
+
'image': '<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline>',
|
|
36
|
+
'search': '<circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line>',
|
|
37
|
+
|
|
38
|
+
// admin
|
|
39
|
+
'rotate-ccw': '<polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path>',
|
|
40
|
+
shield: '<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>',
|
|
41
|
+
'x-octagon': '<polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"></polygon><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line>',
|
|
42
|
+
trash: '<polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>',
|
|
43
|
+
users: '<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path>',
|
|
44
|
+
'map-pin': '<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle>',
|
|
45
|
+
list: '<line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line>',
|
|
46
|
+
truck: '<rect x="1" y="3" width="15" height="13"></rect><polygon points="16 8 20 8 23 11 23 16 16 16 16 8"></polygon><circle cx="5.5" cy="18.5" r="2.5"></circle><circle cx="18.5" cy="18.5" r="2.5"></circle>',
|
|
47
|
+
rss: '<path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle>',
|
|
48
|
+
heart: '<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>',
|
|
49
|
+
'bar-chart-2': '<line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></line>',
|
|
50
|
+
'refresh-cw':'<polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path>',
|
|
51
|
+
'arrow-right': '<line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline>',
|
|
52
|
+
'arrow-left': '<line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline>',
|
|
53
|
+
'wrench': '<path d="M21.75 6.75a4.5 4.5 0 01-4.884 4.484c-1.076-.091-2.264.071-2.95.904l-7.152 8.684a2.548 2.548 0 11-3.586-3.586l8.684-7.152c.833-.686.995-1.874.904-2.95a4.5 4.5 0 016.336-4.486l-3.276 3.276a3.004 3.004 0 002.25 2.25l3.276-3.276c.256.565.398 1.192.398 1.852z" /><path d="M4.867 19.125h.008v.008h-.008v-.008z" />',
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* TABLER ICONS
|
|
57
|
+
* https://tabler-icons.io/
|
|
58
|
+
*/
|
|
59
|
+
star: '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z" />',
|
|
60
|
+
'star-half': '<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253z" />',
|
|
61
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import PreToolbar from '../components/toolbar/PreToolbar.vue'
|
|
4
|
+
import Toolbar from '../components/toolbar/Toolbar.vue'
|
|
5
|
+
import DocsMenu from '../components/menu/DocsMenu.vue'
|
|
6
|
+
|
|
7
|
+
const drawer = ref(false)
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<pre-toolbar />
|
|
12
|
+
<toolbar class="border-y z-10" @open-drawer="drawer = true" />
|
|
13
|
+
<div class="lg:hidden border-b p-2">
|
|
14
|
+
<x-button
|
|
15
|
+
icon-left="menu"
|
|
16
|
+
size="sm"
|
|
17
|
+
ghost
|
|
18
|
+
@click="drawer = true"
|
|
19
|
+
>Menu</x-button>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="flex-1 flex overflow-hidden">
|
|
22
|
+
<x-drawer v-model="drawer" breakpoint="lg" width="260" class="border-r flex">
|
|
23
|
+
<docs-menu class="flex-1" @close="drawer = false" />
|
|
24
|
+
</x-drawer>
|
|
25
|
+
<x-notifications inject-key="notifica">
|
|
26
|
+
<router-view class="flex-1 overflow-y-scroll" />
|
|
27
|
+
</x-notifications>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
package/docs/main.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createApp } from 'vue'
|
|
2
|
+
import UI, { BaseTheme } from '@indielayer/ui'
|
|
3
|
+
import App from './App.vue'
|
|
4
|
+
import router from './router'
|
|
5
|
+
import icons from './icons'
|
|
6
|
+
|
|
7
|
+
// global components
|
|
8
|
+
import CopyButton from './components/common/CopyButton.vue'
|
|
9
|
+
import CodeSnippet from './components/common/CodeSnippet.vue'
|
|
10
|
+
import MultiSnippet from './components/common/MultiSnippet.vue'
|
|
11
|
+
import CodePreview from './components/common/CodePreview.vue'
|
|
12
|
+
import DocumentPage from './components/common/DocumentPage.vue'
|
|
13
|
+
|
|
14
|
+
// css
|
|
15
|
+
import './assets/css/tailwind.css'
|
|
16
|
+
|
|
17
|
+
const app = createApp(App)
|
|
18
|
+
|
|
19
|
+
app.use(UI, {
|
|
20
|
+
prefix: 'X',
|
|
21
|
+
icons,
|
|
22
|
+
theme: BaseTheme,
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
app.use(router)
|
|
26
|
+
|
|
27
|
+
app.component('CopyButton', CopyButton)
|
|
28
|
+
app.component('CodeSnippet', CodeSnippet)
|
|
29
|
+
app.component('MultiSnippet', MultiSnippet)
|
|
30
|
+
app.component('CodePreview', CodePreview)
|
|
31
|
+
app.component('DocumentPage', DocumentPage)
|
|
32
|
+
|
|
33
|
+
app.mount('#app')
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref } from 'vue'
|
|
3
|
+
import { useColors, useNotifications, colors as TailwindColors } from '@indielayer/ui'
|
|
4
|
+
|
|
5
|
+
const notifications = useNotifications('notifica')
|
|
6
|
+
const { getPalette } = useColors()
|
|
7
|
+
|
|
8
|
+
const color500 = ref('#10B981')
|
|
9
|
+
|
|
10
|
+
const palette = computed(() => getPalette(color500.value))
|
|
11
|
+
|
|
12
|
+
function copyPalette(val: any) {
|
|
13
|
+
const el = document.createElement('textarea')
|
|
14
|
+
|
|
15
|
+
el.value = JSON.stringify(val, null, 2)
|
|
16
|
+
document.body.appendChild(el)
|
|
17
|
+
el.select()
|
|
18
|
+
document.execCommand('copy')
|
|
19
|
+
document.body.removeChild(el)
|
|
20
|
+
|
|
21
|
+
notifications.success('Copied to clipboard!')
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div>
|
|
27
|
+
<section class="p-4 lg:p-8 max-w-4xl xl:max-w-7xl mx-auto">
|
|
28
|
+
<h1 class="text-4xl font-semibold">Colors</h1>
|
|
29
|
+
<h2 class="text-lg my-2 text-gray-500 dark:text-gray-400">Generate your own palettes, use Tailwind's or use color prop to generate at runtime</h2>
|
|
30
|
+
<x-divider class="mt-4 mb-8"/>
|
|
31
|
+
|
|
32
|
+
<h2 class="text-2xl mb-2">Generate your own palettes</h2>
|
|
33
|
+
<p class="mb-8 text-gray-500 dark:text-gray-400">Generate your own color palette like Tailwind. With the same properties as Tailwind color palettes.</p>
|
|
34
|
+
<p class="font-medium"></p>
|
|
35
|
+
<div class="mt-4">
|
|
36
|
+
<x-input v-model="color500" label="Change here the middle value (500) to generate a new palette"/>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="grid grid-cols-11 my-4 text-sm">
|
|
39
|
+
<div v-for="shade in Object.keys(palette)" :key="shade" class="h-32 flex items-center justify-center" :style="`background-color: ${palette[shade]}`">{{ shade }}</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<x-button icon-left="copy" :color="color500" block @click="copyPalette(palette)">Copy Palette</x-button>
|
|
43
|
+
|
|
44
|
+
<p class="text-gray-500 dark:text-gray-400 mt-4">This is the generated palette when you use the color directly on the color prop like <x-button <b>color="#10B981"</b>>Hello</x-button></p>
|
|
45
|
+
|
|
46
|
+
<x-divider class="mt-4 mb-8"/>
|
|
47
|
+
|
|
48
|
+
<h2 class="text-2xl mb-2">Theme colors</h2>
|
|
49
|
+
<p class="mb-8 text-gray-500 dark:text-gray-400">Default theme color names and how to customize them.</p>
|
|
50
|
+
|
|
51
|
+
<p>The default theme color names are
|
|
52
|
+
<b class="text-sky-500">primary</b>,
|
|
53
|
+
<b class="text-secondary-500">secondary</b>,
|
|
54
|
+
<b class="text-success-500">success</b>,
|
|
55
|
+
<b class="text-warning-500">warning</b> and
|
|
56
|
+
<b class="text-error-500">error</b>.
|
|
57
|
+
You can customize them or even add your own.
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
<p class="my-4"></p>
|
|
61
|
+
|
|
62
|
+
<p class="my-2">Customize the color prop, e.g. <b>color="primary"</b> on the UI initialization.</p>
|
|
63
|
+
<code-snippet
|
|
64
|
+
lang="js"
|
|
65
|
+
:code="`import { createApp } from 'vue'
|
|
66
|
+
import UI, { colors } from '@indielayer/ui'
|
|
67
|
+
|
|
68
|
+
const app = createApp(App)
|
|
69
|
+
|
|
70
|
+
app.use(UI, {
|
|
71
|
+
theme: {
|
|
72
|
+
colors: {
|
|
73
|
+
primary: ${JSON.stringify(palette, null, 2)},
|
|
74
|
+
secondary: colors.slate,
|
|
75
|
+
success: colors.green,
|
|
76
|
+
warning: colors.yellow,
|
|
77
|
+
error: colors.red,
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
})`"
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<p class="my-4">Allow you to use the Tailwind classes like <b>text-primary-500</b>, <b>bg-primary-500</b>, etc:</p>
|
|
84
|
+
|
|
85
|
+
<div>
|
|
86
|
+
<code-snippet
|
|
87
|
+
lang="js"
|
|
88
|
+
:code="`// tailwind.config.js
|
|
89
|
+
//...
|
|
90
|
+
const colors = require('tailwindcss/colors')
|
|
91
|
+
|
|
92
|
+
module.exports = {
|
|
93
|
+
//...
|
|
94
|
+
theme: {
|
|
95
|
+
extend: {
|
|
96
|
+
colors: {
|
|
97
|
+
primary: colors.emerald,
|
|
98
|
+
secondary: colors.slate,
|
|
99
|
+
success: colors.green,
|
|
100
|
+
warning: colors.yellow,
|
|
101
|
+
error: colors.red,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
}`"
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<x-divider class="mt-4 mb-8"/>
|
|
110
|
+
|
|
111
|
+
<h2 class="text-2xl mb-2">Tailwind Colors</h2>
|
|
112
|
+
<p class="mb-8 text-gray-500 dark:text-gray-400">Default tailwind color palettes.</p>
|
|
113
|
+
|
|
114
|
+
<div class="grid gap-6 grid-cols-1 md:grid-cols-2 text-xs">
|
|
115
|
+
<div v-for="(pal, key) in TailwindColors" :key="key">
|
|
116
|
+
<div class="text-overline mb-2">{{ key }}</div>
|
|
117
|
+
<div class="grid grid-cols-11">
|
|
118
|
+
<div v-for="(color, palKey) in pal" :key="palKey" class="h-32 flex items-center justify-center" :style="`background-color: ${color}`">{{ palKey }}</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</section>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { XAccordion, XAccordionItem } from '@indielayer/ui'
|
|
3
|
+
import UsageDemoCode from './usage.vue?raw'
|
|
4
|
+
import UsageDemo from './usage.vue'
|
|
5
|
+
|
|
6
|
+
const title = 'Accordion'
|
|
7
|
+
const description = 'Accordion'
|
|
8
|
+
const components = [XAccordion, XAccordionItem]
|
|
9
|
+
const demos = [{
|
|
10
|
+
name: 'Usage',
|
|
11
|
+
description: '',
|
|
12
|
+
code: UsageDemoCode,
|
|
13
|
+
component: UsageDemo,
|
|
14
|
+
}]
|
|
15
|
+
const back = 'toggle'
|
|
16
|
+
const next = 'alert'
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<document-page
|
|
21
|
+
github="https://github.com/indielayer/ui/blob/main/packages/ui/docs/pages/component/Accordion"
|
|
22
|
+
:title="title"
|
|
23
|
+
:description="description"
|
|
24
|
+
:components="components"
|
|
25
|
+
:demos="demos"
|
|
26
|
+
:back="back"
|
|
27
|
+
:next="next"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="space-y-8">
|
|
3
|
+
<x-accordion>
|
|
4
|
+
<x-accordion-item>
|
|
5
|
+
Hey
|
|
6
|
+
<template #content>
|
|
7
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti veritatis unde natus esse minima, quibusdam nesciunt atque id assumenda inventore numquam vel consectetur est illum ratione perferendis optio architecto sapiente fuga et commodi harum ea? Error doloribus illum tempora obcaecati quam voluptatum cumque magnam nemo, perspiciatis quas mollitia. Aliquid nulla corrupti sit mollitia dolor sequi nobis eveniet cumque cupiditate perspiciatis magnam laudantium in ducimus fuga quaerat, ipsam assumenda consequatur obcaecati atque? Sint asperiores labore quidem minima modi odio autem rerum eligendi, quisquam incidunt quae enim eos vitae dolores praesentium debitis, consequatur fuga hic nostrum, dolorem dicta quod ea assumenda. Expedita.
|
|
8
|
+
</template>
|
|
9
|
+
</x-accordion-item>
|
|
10
|
+
|
|
11
|
+
<x-accordion-item expanded>
|
|
12
|
+
<template #default="{ collapsed }">
|
|
13
|
+
This is collapsed: {{ collapsed }} (click me to {{ collapsed ? 'expand' : 'collapse' }})
|
|
14
|
+
</template>
|
|
15
|
+
<template #content>
|
|
16
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti veritatis unde natus esse minima, quibusdam nesciunt atque id assumenda inventore numquam vel consectetur est illum ratione perferendis optio architecto sapiente fuga et commodi harum ea? Error doloribus illum tempora obcaecati quam voluptatum cumque magnam nemo, perspiciatis quas mollitia. Aliquid nulla corrupti sit mollitia dolor sequi nobis eveniet cumque cupiditate perspiciatis magnam laudantium in ducimus fuga quaerat, ipsam assumenda consequatur obcaecati atque? Sint asperiores labore quidem minima modi odio autem rerum eligendi, quisquam incidunt quae enim eos vitae dolores praesentium debitis, consequatur fuga hic nostrum, dolorem dicta quod ea assumenda. Expedita.
|
|
17
|
+
</template>
|
|
18
|
+
</x-accordion-item>
|
|
19
|
+
</x-accordion>
|
|
20
|
+
|
|
21
|
+
<x-accordion icon-align="left">
|
|
22
|
+
<x-accordion-item>
|
|
23
|
+
Left side icon
|
|
24
|
+
<template #content>
|
|
25
|
+
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Est, rem.
|
|
26
|
+
</template>
|
|
27
|
+
</x-accordion-item>
|
|
28
|
+
</x-accordion>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|