@indielayer/ui 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/App.vue +19 -4
- package/docs/assets/css/tailwind.css +7 -1
- package/docs/components/Cookies.vue +3 -1
- package/docs/components/common/CodePreview.vue +1 -1
- package/docs/components/common/DocsCopyPage.vue +200 -0
- package/docs/components/common/DocumentPage.vue +76 -23
- package/docs/components/toolbar/ToolbarColorToggle.vue +29 -18
- package/docs/components/toolbar/ToolbarSearch.vue +4 -4
- package/docs/composables/useDocMeta.ts +63 -4
- package/docs/icons.ts +3 -0
- package/docs/main.ts +25 -26
- package/docs/pages/component/accordion/index.vue +2 -2
- package/docs/pages/component/alert/index.vue +2 -2
- package/docs/pages/component/avatar/index.vue +4 -4
- package/docs/pages/component/badge/index.vue +2 -2
- package/docs/pages/component/breadcrumbs/index.vue +2 -2
- package/docs/pages/component/button/button-group.vue +3 -3
- package/docs/pages/component/button/index.vue +14 -7
- package/docs/pages/component/button/tooltip.vue +10 -0
- package/docs/pages/component/card/index.vue +2 -2
- package/docs/pages/component/carousel/index.vue +2 -2
- package/docs/pages/component/checkbox/index.vue +5 -5
- package/docs/pages/component/container/index.vue +2 -2
- package/docs/pages/component/datepicker/index.vue +2 -2
- package/docs/pages/component/divider/index.vue +4 -4
- package/docs/pages/component/drawer/index.vue +2 -2
- package/docs/pages/component/empty/index.vue +3 -3
- package/docs/pages/component/form/index.vue +2 -2
- package/docs/pages/component/formGroup/index.vue +2 -2
- package/docs/pages/component/infiniteLoader/index.vue +3 -3
- package/docs/pages/component/input/index.vue +5 -5
- package/docs/pages/component/inputGroup/index.vue +3 -3
- package/docs/pages/component/inputGroup/validation.vue +6 -1
- package/docs/pages/component/link/index.vue +2 -2
- package/docs/pages/component/loader/index.vue +2 -2
- package/docs/pages/component/menu/index.vue +2 -2
- package/docs/pages/component/modal/index.vue +3 -3
- package/docs/pages/component/notifications/index.vue +2 -2
- package/docs/pages/component/pagination/index.vue +2 -2
- package/docs/pages/component/popover/index.vue +2 -2
- package/docs/pages/component/popover/usage.vue +14 -0
- package/docs/pages/component/progress/index.vue +3 -3
- package/docs/pages/component/qrCode/index.vue +2 -2
- package/docs/pages/component/radio/index.vue +3 -3
- package/docs/pages/component/scroll/index.vue +3 -3
- package/docs/pages/component/select/index.vue +5 -5
- package/docs/pages/component/skeleton/index.vue +2 -2
- package/docs/pages/component/slider/index.vue +2 -2
- package/docs/pages/component/spacer/index.vue +2 -2
- package/docs/pages/component/spinner/index.vue +3 -3
- package/docs/pages/component/table/index.vue +4 -4
- package/docs/pages/component/tabs/index.vue +2 -2
- package/docs/pages/component/tabs/usage.vue +26 -0
- package/docs/pages/component/tag/index.vue +2 -2
- package/docs/pages/component/textarea/index.vue +4 -4
- package/docs/pages/component/toggle/index.vue +4 -4
- package/docs/pages/component/upload/index.vue +2 -2
- package/docs/pages/component/upload/usage.vue +1 -0
- package/docs/pages/component/virtualGrid/index.vue +2 -2
- package/docs/pages/component/virtualList/index.vue +3 -3
- package/docs/pages/icons.vue +2 -2
- package/docs/router/index.ts +39 -44
- package/docs/search/components.json +1 -1
- package/docs/search/index.json +1 -1
- package/lib/common/buttonGroupRadius.d.ts +3 -0
- package/lib/common/buttonGroupRadius.js +6 -0
- package/lib/common/props.d.ts +1 -1
- package/lib/common/props.js +10 -9
- package/lib/components/accordion/Accordion.vue.d.ts +42 -9
- package/lib/components/accordion/Accordion.vue_vue_type_script_setup_true_lang.js +18 -6
- package/lib/components/accordion/AccordionItem.vue.d.ts +33 -6
- package/lib/components/accordion/AccordionItem.vue_vue_type_script_setup_true_lang.js +31 -6
- package/lib/components/alert/Alert.vue.d.ts +27 -6
- package/lib/components/alert/Alert.vue_vue_type_script_setup_true_lang.js +20 -6
- package/lib/components/avatar/Avatar.vue.d.ts +45 -9
- package/lib/components/avatar/Avatar.vue_vue_type_script_setup_true_lang.js +17 -6
- package/lib/components/badge/Badge.vue.d.ts +54 -9
- package/lib/components/badge/Badge.vue_vue_type_script_setup_true_lang.js +26 -9
- package/lib/components/breadcrumbs/Breadcrumbs.vue.d.ts +30 -6
- package/lib/components/breadcrumbs/Breadcrumbs.vue_vue_type_script_setup_true_lang.js +13 -5
- package/lib/components/button/Button.js +2 -2
- package/lib/components/button/Button.vue.d.ts +138 -28
- package/lib/components/button/Button.vue_vue_type_script_setup_true_lang.js +192 -70
- package/lib/components/button/ButtonGroup.js +4 -5
- package/lib/components/button/ButtonGroup.vue.d.ts +54 -10
- package/lib/components/button/ButtonGroup.vue_vue_type_script_setup_true_lang.js +30 -19
- package/lib/components/button/theme/Button.base.theme.js +6 -5
- package/lib/components/button/theme/Button.carbon.theme.js +6 -5
- package/lib/components/card/Card.vue.d.ts +3 -0
- package/lib/components/card/Card.vue_vue_type_script_setup_true_lang.js +4 -2
- package/lib/components/carousel/Carousel.vue.d.ts +21 -3
- package/lib/components/carousel/Carousel.vue_vue_type_script_setup_true_lang.js +23 -5
- package/lib/components/carousel/CarouselSlide.js +2 -2
- package/lib/components/carousel/CarouselSlide.vue.d.ts +3 -0
- package/lib/components/carousel/CarouselSlide.vue_vue_type_script_setup_true_lang.js +3 -1
- package/lib/components/carousel/{CarouselSlide.vue_vue_type_style_index_0_scoped_e90d2127_lang.module.js → CarouselSlide.vue_vue_type_style_index_0_scoped_4f559831_lang.module.js} +1 -1
- package/lib/components/checkbox/Checkbox.vue.d.ts +198 -45
- package/lib/components/checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +20 -3
- package/lib/components/container/Container.vue.d.ts +6 -0
- package/lib/components/container/Container.vue_vue_type_script_setup_true_lang.js +5 -2
- package/lib/components/datepicker/Datepicker.vue.d.ts +462 -36
- package/lib/components/datepicker/Datepicker.vue_vue_type_script_setup_true_lang.js +294 -153
- package/lib/components/divider/Divider.vue.d.ts +12 -3
- package/lib/components/divider/Divider.vue_vue_type_script_setup_true_lang.js +6 -2
- package/lib/components/drawer/Drawer.vue.d.ts +39 -6
- package/lib/components/drawer/Drawer.vue_vue_type_script_setup_true_lang.js +30 -7
- package/lib/components/empty/Empty.vue.d.ts +30 -6
- package/lib/components/empty/Empty.vue_vue_type_script_setup_true_lang.js +17 -4
- package/lib/components/form/Form.vue.d.ts +48 -9
- package/lib/components/form/Form.vue_vue_type_script_setup_true_lang.js +34 -7
- package/lib/components/formGroup/FormGroup.vue.d.ts +171 -39
- package/lib/components/formGroup/FormGroup.vue_vue_type_script_setup_true_lang.js +15 -9
- package/lib/components/icon/Icon.vue.d.ts +9 -0
- package/lib/components/icon/Icon.vue_vue_type_script_setup_true_lang.js +6 -3
- package/lib/components/image/Image.vue.d.ts +12 -3
- package/lib/components/image/Image.vue_vue_type_script_setup_true_lang.js +5 -1
- package/lib/components/index.js +18 -18
- package/lib/components/input/Input.vue.d.ts +291 -66
- package/lib/components/input/Input.vue_vue_type_script_setup_true_lang.js +53 -15
- package/lib/components/inputFooter/InputFooter.vue.d.ts +48 -12
- package/lib/components/inputFooter/InputFooter.vue_vue_type_script_setup_true_lang.js +18 -5
- package/lib/components/inputGroup/InputGroup.vue.d.ts +171 -39
- package/lib/components/inputGroup/InputGroup.vue_vue_type_script_setup_true_lang.js +6 -1
- package/lib/components/label/Label.vue.d.ts +78 -18
- package/lib/components/label/Label.vue_vue_type_script_setup_true_lang.js +28 -8
- package/lib/components/link/Link.js +2 -2
- package/lib/components/link/Link.vue.d.ts +18 -3
- package/lib/components/link/Link.vue_vue_type_script_setup_true_lang.js +10 -5
- package/lib/components/loader/Loader.vue.d.ts +30 -6
- package/lib/components/loader/Loader.vue_vue_type_script_setup_true_lang.js +11 -3
- package/lib/components/menu/Menu.vue.d.ts +51 -9
- package/lib/components/menu/Menu.vue_vue_type_script_setup_true_lang.js +24 -8
- package/lib/components/menu/MenuItem.js +2 -2
- package/lib/components/menu/MenuItem.vue.d.ts +198 -45
- package/lib/components/menu/MenuItem.vue_vue_type_script_setup_true_lang.js +84 -23
- package/lib/components/menu/{MenuItem.vue_vue_type_style_index_0_scoped_2a6b7341_lang.module.js → MenuItem.vue_vue_type_style_index_0_scoped_5aebaff3_lang.module.js} +1 -1
- package/lib/components/modal/Modal.vue.d.ts +177 -39
- package/lib/components/modal/Modal.vue_vue_type_script_setup_true_lang.js +104 -23
- package/lib/components/notifications/Notifications.vue.d.ts +24 -0
- package/lib/components/notifications/Notifications.vue_vue_type_script_setup_true_lang.js +39 -12
- package/lib/components/pagination/Pagination.vue.d.ts +12 -0
- package/lib/components/pagination/Pagination.vue_vue_type_script_setup_true_lang.js +8 -4
- package/lib/components/pagination/PaginationItem.vue.d.ts +18 -3
- package/lib/components/pagination/PaginationItem.vue_vue_type_script_setup_true_lang.js +8 -3
- package/lib/components/popover/Popover.vue.d.ts +204 -45
- package/lib/components/popover/Popover.vue_vue_type_script_setup_true_lang.js +157 -66
- package/lib/components/popover/PopoverContainer.vue.d.ts +3 -0
- package/lib/components/popover/PopoverContainer.vue_vue_type_script_setup_true_lang.js +3 -1
- package/lib/components/popover/PopoverContentBoundary.js +5 -0
- package/lib/components/popover/PopoverContentBoundary.vue.d.ts +9 -0
- package/lib/components/popover/PopoverContentBoundary.vue_vue_type_script_setup_true_lang.js +18 -0
- package/lib/components/popover/theme/PopoverContainer.base.theme.js +1 -1
- package/lib/components/progress/Progress.vue.d.ts +9 -0
- package/lib/components/progress/Progress.vue_vue_type_script_setup_true_lang.js +7 -4
- package/lib/components/qrCode/QrCode.vue.d.ts +24 -3
- package/lib/components/qrCode/QrCode.vue_vue_type_script_setup_true_lang.js +13 -5
- package/lib/components/radio/Radio.vue.d.ts +186 -42
- package/lib/components/radio/Radio.vue_vue_type_script_setup_true_lang.js +10 -2
- package/lib/components/radioButton/RadioButton.vue.d.ts +186 -42
- package/lib/components/radioButton/RadioButton.vue_vue_type_script_setup_true_lang.js +9 -1
- package/lib/components/scroll/Scroll.vue.d.ts +3 -0
- package/lib/components/scroll/Scroll.vue_vue_type_script_setup_true_lang.js +9 -4
- package/lib/components/select/Select.vue.d.ts +633 -144
- package/lib/components/select/Select.vue_vue_type_script_setup_true_lang.js +224 -189
- package/lib/components/skeleton/Skeleton.vue.d.ts +6 -0
- package/lib/components/skeleton/Skeleton.vue_vue_type_script_setup_true_lang.js +5 -2
- package/lib/components/slider/Slider.js +1 -1
- package/lib/components/slider/Slider.vue.d.ts +180 -39
- package/lib/components/slider/Slider.vue_vue_type_script_setup_true_lang.js +14 -3
- package/lib/components/spinner/Spinner.vue.d.ts +6 -0
- package/lib/components/spinner/Spinner.vue_vue_type_script_setup_true_lang.js +3 -1
- package/lib/components/stepper/Stepper.vue.d.ts +120 -24
- package/lib/components/stepper/Stepper.vue_vue_type_script_setup_true_lang.js +63 -15
- package/lib/components/tab/Tab.vue.d.ts +112 -31
- package/lib/components/tab/Tab.vue_vue_type_script_setup_true_lang.js +166 -95
- package/lib/components/tab/TabGroup.vue.d.ts +47 -12
- package/lib/components/tab/TabGroup.vue_vue_type_script_setup_true_lang.js +93 -49
- package/lib/components/tab/theme/Tab.base.theme.js +6 -6
- package/lib/components/tab/theme/Tab.carbon.theme.js +6 -6
- package/lib/components/tab/theme/TabGroup.base.theme.js +7 -7
- package/lib/components/tab/theme/TabGroup.carbon.theme.js +3 -3
- package/lib/components/table/Table.vue.d.ts +45 -9
- package/lib/components/table/Table.vue_vue_type_script_setup_true_lang.js +82 -27
- package/lib/components/table/TableCell.vue.d.ts +54 -12
- package/lib/components/table/TableCell.vue_vue_type_script_setup_true_lang.js +23 -8
- package/lib/components/table/TableHead.vue_vue_type_script_setup_true_lang.js +2 -1
- package/lib/components/table/TableHeader.vue.d.ts +18 -3
- package/lib/components/table/TableHeader.vue_vue_type_script_setup_true_lang.js +10 -4
- package/lib/components/table/TableRow.vue.d.ts +15 -3
- package/lib/components/table/TableRow.vue_vue_type_script_setup_true_lang.js +10 -5
- package/lib/components/tag/Tag.vue.d.ts +33 -6
- package/lib/components/tag/Tag.vue_vue_type_script_setup_true_lang.js +21 -7
- package/lib/components/textarea/Textarea.vue.d.ts +237 -54
- package/lib/components/textarea/Textarea.vue_vue_type_script_setup_true_lang.js +38 -13
- package/lib/components/themeProvider/ThemeProvider.vue.d.ts +10 -4
- package/lib/components/themeProvider/ThemeProvider.vue_vue_type_script_setup_true_lang.js +6 -1
- package/lib/components/toggle/Toggle.vue.d.ts +174 -39
- package/lib/components/toggle/Toggle.vue_vue_type_script_setup_true_lang.js +5 -1
- package/lib/components/tooltip/ToggleTip.vue.d.ts +24 -6
- package/lib/components/tooltip/ToggleTip.vue_vue_type_script_setup_true_lang.js +9 -2
- package/lib/components/tooltip/Tooltip.vue.d.ts +30 -6
- package/lib/components/tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +16 -4
- package/lib/components/upload/Upload.vue.d.ts +249 -57
- package/lib/components/upload/Upload.vue_vue_type_script_setup_true_lang.js +156 -125
- package/lib/components/upload/fileAccept.d.ts +6 -0
- package/lib/components/upload/fileAccept.js +17 -0
- package/lib/composables/useColors.d.ts +1 -0
- package/lib/composables/useColors.js +2 -1
- package/lib/composables/useCommon.d.ts +1 -0
- package/lib/composables/useCommon.js +2 -1
- package/lib/composables/useFocusTrap.js +1 -1
- package/lib/composables/useInputtable.d.ts +45 -10
- package/lib/composables/useInputtable.js +56 -14
- package/lib/composables/useInteractive.d.ts +13 -3
- package/lib/composables/useInteractive.js +14 -4
- package/lib/index.js +12 -12
- package/lib/index.umd.js +9 -10
- package/lib/themes/base/styles.d.ts +1 -1
- package/lib/themes/base/styles.js +1 -1
- package/lib/themes/carbon/styles.d.ts +1 -1
- package/lib/themes/carbon/styles.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/virtual/components/infiniteLoader/InfiniteLoader.vue.d.ts +27 -16
- package/lib/virtual/components/infiniteLoader/InfiniteLoader.vue_vue_type_script_setup_true_lang.js +25 -5
- package/lib/virtual/components/virtualGrid/VirtualGrid.vue.d.ts +108 -86
- package/lib/virtual/components/virtualGrid/VirtualGrid.vue_vue_type_script_setup_true_lang.js +91 -21
- package/lib/virtual/components/virtualList/VirtualList.vue.d.ts +62 -48
- package/lib/virtual/components/virtualList/VirtualList.vue_vue_type_script_setup_true_lang.js +64 -13
- package/lib/virtual/components/virtualList/useDynamicRowHeight.js +4 -3
- package/package.json +5 -3
- package/src/common/buttonGroupRadius.ts +16 -0
- package/src/common/props.ts +10 -9
- package/src/components/accordion/Accordion.vue +20 -4
- package/src/components/accordion/AccordionItem.vue +28 -3
- package/src/components/alert/Alert.vue +22 -6
- package/src/components/avatar/Avatar.vue +20 -5
- package/src/components/badge/Badge.vue +24 -5
- package/src/components/breadcrumbs/Breadcrumbs.vue +15 -5
- package/src/components/button/Button.vue +140 -5
- package/src/components/button/ButtonGroup.vue +41 -25
- package/src/components/button/__tests__/ Button.spec.ts +41 -0
- package/src/components/button/__tests__/ ButtonGroup.spec.ts +32 -0
- package/src/components/button/theme/Button.base.theme.ts +4 -1
- package/src/components/button/theme/Button.carbon.theme.ts +5 -4
- package/src/components/card/Card.vue +10 -2
- package/src/components/carousel/Carousel.vue +22 -2
- package/src/components/carousel/CarouselSlide.vue +6 -0
- package/src/components/checkbox/Checkbox.vue +22 -3
- package/src/components/container/Container.vue +10 -1
- package/src/components/datepicker/Datepicker.vue +466 -101
- package/src/components/datepicker/__tests__/Datepicker.spec.ts +31 -0
- package/src/components/divider/Divider.vue +9 -3
- package/src/components/drawer/Drawer.vue +27 -2
- package/src/components/empty/Empty.vue +18 -3
- package/src/components/form/Form.vue +32 -3
- package/src/components/formGroup/FormGroup.vue +12 -0
- package/src/components/icon/Icon.vue +4 -1
- package/src/components/image/Image.vue +8 -2
- package/src/components/input/Input.vue +54 -12
- package/src/components/inputFooter/InputFooter.vue +21 -6
- package/src/components/inputGroup/InputGroup.vue +12 -1
- package/src/components/label/Label.vue +31 -7
- package/src/components/link/Link.vue +16 -5
- package/src/components/loader/Loader.vue +10 -2
- package/src/components/menu/Menu.vue +23 -5
- package/src/components/menu/MenuItem.vue +78 -17
- package/src/components/modal/Modal.vue +90 -15
- package/src/components/notifications/Notifications.vue +23 -0
- package/src/components/notifications/__tests__/Notifications.spec.ts +44 -4
- package/src/components/pagination/Pagination.vue +9 -1
- package/src/components/pagination/PaginationItem.vue +11 -2
- package/src/components/popover/Popover.vue +113 -18
- package/src/components/popover/PopoverContainer.vue +9 -1
- package/src/components/popover/PopoverContentBoundary.vue +32 -0
- package/src/components/popover/__tests__/Popover.spec.ts +51 -0
- package/src/components/popover/theme/PopoverContainer.base.theme.ts +1 -1
- package/src/components/progress/Progress.vue +8 -3
- package/src/components/qrCode/QrCode.vue +9 -1
- package/src/components/radio/Radio.vue +16 -2
- package/src/components/radioButton/RadioButton.vue +15 -1
- package/src/components/scroll/Scroll.vue +15 -4
- package/src/components/select/Select.vue +53 -16
- package/src/components/skeleton/Skeleton.vue +3 -0
- package/src/components/slider/Slider.vue +15 -0
- package/src/components/spinner/Spinner.vue +2 -0
- package/src/components/stepper/Stepper.vue +57 -9
- package/src/components/tab/Tab.vue +153 -63
- package/src/components/tab/TabGroup.vue +110 -26
- package/src/components/tab/__tests__/Tab.spec.ts +53 -0
- package/src/components/tab/__tests__/TabGroup.spec.ts +113 -0
- package/src/components/tab/theme/Tab.base.theme.ts +24 -2
- package/src/components/tab/theme/Tab.carbon.theme.ts +30 -7
- package/src/components/tab/theme/TabGroup.base.theme.ts +12 -9
- package/src/components/tab/theme/TabGroup.carbon.theme.ts +6 -2
- package/src/components/table/Table.vue +76 -19
- package/src/components/table/TableCell.vue +25 -6
- package/src/components/table/TableHead.vue +9 -2
- package/src/components/table/TableHeader.vue +16 -3
- package/src/components/table/TableRow.vue +17 -5
- package/src/components/tag/Tag.vue +22 -6
- package/src/components/textarea/Textarea.vue +40 -11
- package/src/components/themeProvider/ThemeProvider.vue +22 -7
- package/src/components/toggle/Toggle.vue +9 -1
- package/src/components/tooltip/ToggleTip.vue +12 -3
- package/src/components/tooltip/Tooltip.vue +19 -3
- package/src/components/upload/Upload.vue +46 -16
- package/src/components/upload/__tests__/fileAccept.spec.ts +39 -0
- package/src/components/upload/fileAccept.ts +29 -0
- package/src/composables/useColors.ts +1 -0
- package/src/composables/useCommon.ts +1 -0
- package/src/composables/useFocusTrap.ts +3 -1
- package/src/composables/useInputtable.ts +66 -10
- package/src/composables/useInteractive.ts +13 -3
- package/src/themes/base/styles.ts +2 -3
- package/src/themes/carbon/styles.ts +2 -3
- package/src/version.ts +1 -1
- package/src/virtual/components/infiniteLoader/InfiniteLoader.vue +33 -1
- package/src/virtual/components/virtualGrid/VirtualGrid.vue +104 -10
- package/src/virtual/components/virtualList/VirtualList.vue +73 -8
- package/src/virtual/components/virtualList/useDynamicRowHeight.ts +9 -2
- package/volar.d.ts +3 -0
- package/docs/layouts/simple.vue +0 -5
- package/lib/components/button/ButtonGroup.vue_vue_type_style_index_0_lang.module.js +0 -7
- /package/lib/components/button/{Button.vue_vue_type_style_index_0_scoped_4402fde2_lang.module.js → Button.vue_vue_type_style_index_0_scoped_486cb9c0_lang.module.js} +0 -0
- /package/lib/components/link/{Link.vue_vue_type_style_index_0_scoped_8e0e4d08_lang.module.js → Link.vue_vue_type_style_index_0_scoped_3ee61e03_lang.module.js} +0 -0
package/docs/App.vue
CHANGED
|
@@ -3,17 +3,32 @@ import { provide, ref } from 'vue'
|
|
|
3
3
|
import { RouterView } from 'vue-router'
|
|
4
4
|
import { BaseTheme, CarbonTheme } from '@indielayer/ui'
|
|
5
5
|
|
|
6
|
-
const lastTheme = localStorage.getItem('THEME') || ''
|
|
7
|
-
|
|
8
6
|
const themes = [BaseTheme, CarbonTheme]
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
function readStoredTheme() {
|
|
9
|
+
if (import.meta.env.SSR || typeof localStorage === 'undefined') return ''
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
return localStorage.getItem('THEME') || ''
|
|
13
|
+
} catch {
|
|
14
|
+
return ''
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const theme = ref(themes.find((t) => t.name === readStoredTheme()) || BaseTheme)
|
|
10
19
|
|
|
11
20
|
provide('selectTheme', {
|
|
12
21
|
theme,
|
|
13
22
|
themes,
|
|
14
23
|
setTheme(key: string) {
|
|
15
24
|
theme.value = themes.find((t) => t.name === key) || BaseTheme
|
|
16
|
-
localStorage
|
|
25
|
+
if (import.meta.env.SSR || typeof localStorage === 'undefined') return
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
localStorage.setItem('THEME', theme.value.name)
|
|
29
|
+
} catch {
|
|
30
|
+
// ignore
|
|
31
|
+
}
|
|
17
32
|
},
|
|
18
33
|
})
|
|
19
34
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@import url("https://1.www.s81c.com/common/carbon/plex/sans.css");
|
|
3
3
|
@import url("https://1.www.s81c.com/common/carbon/plex/mono.css");
|
|
4
4
|
|
|
5
|
-
@import "tailwindcss";
|
|
5
|
+
@import "tailwindcss/index.css";
|
|
6
6
|
@import "../../../exports/tailwind.css";
|
|
7
7
|
|
|
8
8
|
@source "../../../index.html";
|
|
@@ -14,6 +14,12 @@ body {
|
|
|
14
14
|
height: 100%;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
html.dark,
|
|
18
|
+
html.dark body {
|
|
19
|
+
background-color: var(--color-gray-900, #111827);
|
|
20
|
+
color-scheme: dark;
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
@layer base {
|
|
18
24
|
.text-2xs {
|
|
19
25
|
font-size: 0.625rem;
|
|
@@ -72,7 +72,7 @@ async function copy(text?: string) {
|
|
|
72
72
|
<template #tooltip>{{ expandedSync ? 'Hide' : 'Show' }} code</template>
|
|
73
73
|
</x-tooltip>
|
|
74
74
|
</h2>
|
|
75
|
-
<p v-if="description" class="
|
|
75
|
+
<p v-if="description" class="text-secondary-500 dark:text-secondary-400 mb-4">{{ description }}</p>
|
|
76
76
|
<slot></slot>
|
|
77
77
|
<x-accordion-item ref="codeRef" :expanded="expanded" :show-icon="false">
|
|
78
78
|
<template #content>
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref } from 'vue'
|
|
3
|
+
import { useRoute } from 'vue-router'
|
|
4
|
+
import { useNotifications, type MenuArrayItem } from '@indielayer/ui'
|
|
5
|
+
|
|
6
|
+
const route = useRoute()
|
|
7
|
+
const notifications = useNotifications()
|
|
8
|
+
const mounted = ref(false)
|
|
9
|
+
const menuOpen = ref(false)
|
|
10
|
+
const copying = ref(false)
|
|
11
|
+
|
|
12
|
+
onMounted(() => {
|
|
13
|
+
mounted.value = true
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const SITE_URL = 'https://indielayer.com'
|
|
17
|
+
|
|
18
|
+
const componentSlug = computed(() => {
|
|
19
|
+
const path = route.path.replace(/\/$/, '')
|
|
20
|
+
|
|
21
|
+
if (!path.startsWith('/component/')) return null
|
|
22
|
+
|
|
23
|
+
return path.replace('/component/', '')
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const markdownUrl = computed(() => {
|
|
27
|
+
if (!componentSlug.value) return null
|
|
28
|
+
|
|
29
|
+
const origin = typeof window !== 'undefined' ? window.location.origin : SITE_URL
|
|
30
|
+
|
|
31
|
+
return `${origin}/md/component/${componentSlug.value}.md`
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const canonicalMarkdownUrl = computed(() => {
|
|
35
|
+
if (!componentSlug.value) return null
|
|
36
|
+
|
|
37
|
+
return `${SITE_URL}/md/component/${componentSlug.value}.md`
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
function aiPrompt(url: string) {
|
|
41
|
+
return `Read ${url} so I can ask questions about it.`
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const chatGptUrl = computed(() => {
|
|
45
|
+
if (!canonicalMarkdownUrl.value) return '#'
|
|
46
|
+
|
|
47
|
+
return `https://chatgpt.com/?hints=search&q=${encodeURIComponent(aiPrompt(canonicalMarkdownUrl.value))}`
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const claudeUrl = computed(() => {
|
|
51
|
+
if (!canonicalMarkdownUrl.value) return '#'
|
|
52
|
+
|
|
53
|
+
return `https://claude.ai/new?q=${encodeURIComponent(aiPrompt(canonicalMarkdownUrl.value))}`
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
async function copyText(text: string, message: string) {
|
|
57
|
+
try {
|
|
58
|
+
await navigator.clipboard.writeText(text)
|
|
59
|
+
} catch {
|
|
60
|
+
const el = document.createElement('textarea')
|
|
61
|
+
|
|
62
|
+
el.value = text
|
|
63
|
+
document.body.appendChild(el)
|
|
64
|
+
el.select()
|
|
65
|
+
document.execCommand('copy')
|
|
66
|
+
document.body.removeChild(el)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
notifications?.success(message)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function fetchMarkdown() {
|
|
73
|
+
if (!markdownUrl.value) throw new Error('No markdown URL')
|
|
74
|
+
|
|
75
|
+
const res = await fetch(markdownUrl.value)
|
|
76
|
+
|
|
77
|
+
if (!res.ok) throw new Error(`Failed to fetch markdown (${res.status})`)
|
|
78
|
+
|
|
79
|
+
return res.text()
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function copyPage() {
|
|
83
|
+
if (!markdownUrl.value || copying.value) return
|
|
84
|
+
|
|
85
|
+
copying.value = true
|
|
86
|
+
menuOpen.value = false
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
const markdown = await fetchMarkdown()
|
|
90
|
+
|
|
91
|
+
await copyText(markdown, 'Copied page as Markdown')
|
|
92
|
+
} catch {
|
|
93
|
+
notifications?.error('Could not copy page markdown')
|
|
94
|
+
} finally {
|
|
95
|
+
copying.value = false
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function copyMarkdownLink() {
|
|
100
|
+
if (!canonicalMarkdownUrl.value) return
|
|
101
|
+
|
|
102
|
+
await copyText(canonicalMarkdownUrl.value, 'Copied Markdown link')
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async function copyLlmsTxt() {
|
|
106
|
+
await copyText(`${SITE_URL}/llms.txt`, 'Copied llms.txt URL')
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function closeMenu() {
|
|
110
|
+
menuOpen.value = false
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const menuItems = computed<MenuArrayItem[]>(() => {
|
|
114
|
+
if (!markdownUrl.value || !canonicalMarkdownUrl.value) return []
|
|
115
|
+
|
|
116
|
+
return [
|
|
117
|
+
{
|
|
118
|
+
label: 'Copy Markdown link',
|
|
119
|
+
icon: 'link',
|
|
120
|
+
onClick: () => { void copyMarkdownLink() },
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: 'View as Markdown',
|
|
124
|
+
icon: 'code',
|
|
125
|
+
iconRight: 'external-link',
|
|
126
|
+
href: markdownUrl.value,
|
|
127
|
+
target: '_blank',
|
|
128
|
+
attrs: { rel: 'noopener noreferrer' },
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
label: 'Open in ChatGPT',
|
|
132
|
+
icon: 'sparkles',
|
|
133
|
+
iconRight: 'external-link',
|
|
134
|
+
href: chatGptUrl.value,
|
|
135
|
+
target: '_blank',
|
|
136
|
+
attrs: { rel: 'noopener noreferrer' },
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
label: 'Open in Claude',
|
|
140
|
+
icon: 'sparkles',
|
|
141
|
+
iconRight: 'external-link',
|
|
142
|
+
href: claudeUrl.value,
|
|
143
|
+
target: '_blank',
|
|
144
|
+
attrs: { rel: 'noopener noreferrer' },
|
|
145
|
+
},
|
|
146
|
+
{ divider: true },
|
|
147
|
+
{
|
|
148
|
+
label: 'Copy llms.txt URL',
|
|
149
|
+
icon: 'link',
|
|
150
|
+
onClick: () => { void copyLlmsTxt() },
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
label: 'View llms.txt',
|
|
154
|
+
icon: 'book',
|
|
155
|
+
iconRight: 'external-link',
|
|
156
|
+
href: `${SITE_URL}/llms.txt`,
|
|
157
|
+
target: '_blank',
|
|
158
|
+
attrs: { rel: 'noopener noreferrer' },
|
|
159
|
+
},
|
|
160
|
+
]
|
|
161
|
+
})
|
|
162
|
+
</script>
|
|
163
|
+
|
|
164
|
+
<template>
|
|
165
|
+
<div v-if="mounted && markdownUrl" class="docs-copy-page inline-flex shrink-0">
|
|
166
|
+
<x-button-group size="xs" outlined>
|
|
167
|
+
<x-button
|
|
168
|
+
icon-left="copy"
|
|
169
|
+
:loading="copying"
|
|
170
|
+
@click="copyPage"
|
|
171
|
+
>
|
|
172
|
+
Copy page
|
|
173
|
+
</x-button>
|
|
174
|
+
<x-popover
|
|
175
|
+
v-model:shown="menuOpen"
|
|
176
|
+
placement="bottom-end"
|
|
177
|
+
:distance="6"
|
|
178
|
+
>
|
|
179
|
+
<x-button
|
|
180
|
+
icon="chevron-down"
|
|
181
|
+
aria-label="More copy options"
|
|
182
|
+
/>
|
|
183
|
+
<template #content>
|
|
184
|
+
<x-popover-container class="w-64 p-1.5">
|
|
185
|
+
<x-menu
|
|
186
|
+
size="sm"
|
|
187
|
+
:items="menuItems"
|
|
188
|
+
@item-click="closeMenu"
|
|
189
|
+
/>
|
|
190
|
+
</x-popover-container>
|
|
191
|
+
</template>
|
|
192
|
+
</x-popover>
|
|
193
|
+
</x-button-group>
|
|
194
|
+
</div>
|
|
195
|
+
<div
|
|
196
|
+
v-else-if="!mounted && markdownUrl"
|
|
197
|
+
class="inline-flex h-8 w-[7.5rem] shrink-0 rounded-md border border-transparent"
|
|
198
|
+
aria-hidden="true"
|
|
199
|
+
></div>
|
|
200
|
+
</template>
|
|
@@ -29,6 +29,7 @@ useDocMeta({
|
|
|
29
29
|
|
|
30
30
|
const headers = [
|
|
31
31
|
{ text: 'Name', value: 'name' },
|
|
32
|
+
{ text: 'Description', value: 'description' },
|
|
32
33
|
{ text: 'Type', value: 'type' },
|
|
33
34
|
{ text: 'Default', value: 'default' },
|
|
34
35
|
{ text: 'Values', value: 'validator' },
|
|
@@ -40,10 +41,25 @@ const headersSimple = [
|
|
|
40
41
|
{ text: 'Description', value: 'description' },
|
|
41
42
|
]
|
|
42
43
|
|
|
44
|
+
function mapDocEntries(source: Record<string, unknown> | undefined) {
|
|
45
|
+
if (!source || typeof source !== 'object') return []
|
|
46
|
+
|
|
47
|
+
return Object.keys(source).map((name) => {
|
|
48
|
+
const value = source[name]
|
|
49
|
+
const description = typeof value === 'string'
|
|
50
|
+
? value
|
|
51
|
+
: (value && typeof value === 'object' && 'description' in value
|
|
52
|
+
? String((value as { description?: unknown; }).description || '')
|
|
53
|
+
: '')
|
|
54
|
+
|
|
55
|
+
return { name, description }
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
43
59
|
const componentsProperties = computed(() => {
|
|
44
60
|
if (!props.components) return null
|
|
45
61
|
const components = Array.isArray(props.components) ? props.components : [props.components]
|
|
46
|
-
const properties = {}
|
|
62
|
+
const properties: Record<string, Record<string, unknown[]>> = {}
|
|
47
63
|
|
|
48
64
|
components.forEach((comp: any) => {
|
|
49
65
|
const componentName = comp.name.slice(1)
|
|
@@ -71,37 +87,66 @@ const componentsProperties = computed(() => {
|
|
|
71
87
|
...comp.props,
|
|
72
88
|
}
|
|
73
89
|
|
|
90
|
+
properties[componentName] = properties[componentName] || {}
|
|
91
|
+
|
|
74
92
|
if (Object.keys(allProps).length > 0) {
|
|
75
93
|
const mappedProps = Object.keys(allProps).map((key) => {
|
|
76
|
-
const
|
|
77
|
-
|
|
94
|
+
const propDef = allProps[key]
|
|
95
|
+
const propFrom = propDef?.type ?? propDef
|
|
96
|
+
let propDefault = propDef?.default
|
|
78
97
|
let propType = []
|
|
79
98
|
|
|
80
99
|
if (Array.isArray(propFrom)) {
|
|
81
100
|
propType = propFrom.map((type) => type.name)
|
|
82
101
|
} else {
|
|
83
102
|
propType = [propFrom.name]
|
|
84
|
-
if (propFrom.name === 'Boolean' &&
|
|
103
|
+
if (propFrom.name === 'Boolean' && propDefault === undefined) propDefault = false
|
|
85
104
|
}
|
|
86
105
|
|
|
87
106
|
return {
|
|
88
107
|
name: key,
|
|
108
|
+
description: typeof propDef?.description === 'string' ? propDef.description : '',
|
|
89
109
|
default: propDefault,
|
|
90
|
-
required:
|
|
110
|
+
required: propDef?.required,
|
|
91
111
|
validator: allValidators[key],
|
|
92
112
|
type: propType,
|
|
93
113
|
}
|
|
94
114
|
})
|
|
95
115
|
|
|
96
|
-
properties[componentName] =
|
|
116
|
+
properties[componentName].props = mappedProps
|
|
97
117
|
}
|
|
98
118
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
119
|
+
const docs = comp.docs || {}
|
|
120
|
+
const slotDocs = mapDocEntries(docs.slots)
|
|
121
|
+
const methodDocs = mapDocEntries(docs.methods)
|
|
122
|
+
const emitDocs = docs.emits || {}
|
|
102
123
|
|
|
103
|
-
if (
|
|
104
|
-
|
|
124
|
+
if (slotDocs.length > 0) {
|
|
125
|
+
properties[componentName].slots = slotDocs
|
|
126
|
+
} else if (comp.slots) {
|
|
127
|
+
properties[componentName].slots = Object.keys(comp.slots).map((k) => ({ name: k, description: '' }))
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (comp.emits) {
|
|
131
|
+
const emitNames = Array.isArray(comp.emits) ? comp.emits : Object.keys(comp.emits)
|
|
132
|
+
|
|
133
|
+
properties[componentName].emits = emitNames.map((name: string) => ({
|
|
134
|
+
name,
|
|
135
|
+
description: typeof emitDocs[name] === 'string'
|
|
136
|
+
? emitDocs[name]
|
|
137
|
+
: (emitDocs[name]?.description || ''),
|
|
138
|
+
}))
|
|
139
|
+
} else if (Object.keys(emitDocs).length > 0) {
|
|
140
|
+
properties[componentName].emits = mapDocEntries(emitDocs)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (methodDocs.length > 0) {
|
|
144
|
+
properties[componentName].methods = methodDocs
|
|
145
|
+
} else if (comp.expose) {
|
|
146
|
+
properties[componentName].methods = comp.expose.map((k: string) => ({ name: k, description: '' }))
|
|
147
|
+
} else if (comp.methods) {
|
|
148
|
+
properties[componentName].methods = Object.keys(comp.methods).map((k) => ({ name: k, description: '' }))
|
|
149
|
+
}
|
|
105
150
|
})
|
|
106
151
|
|
|
107
152
|
return properties
|
|
@@ -112,19 +157,24 @@ const nextTo = computed(() => (props.next ? `/component/${props.next}` : null))
|
|
|
112
157
|
</script>
|
|
113
158
|
|
|
114
159
|
<template>
|
|
115
|
-
<div class="document-page w-full">
|
|
116
|
-
<div class="
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
<x-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
160
|
+
<div class="document-page docs-container w-full">
|
|
161
|
+
<div class="flex items-start justify-between gap-4">
|
|
162
|
+
<div class="min-w-0">
|
|
163
|
+
<h1 class="text-4xl font-semibold">
|
|
164
|
+
{{ title }}
|
|
165
|
+
<x-tooltip>
|
|
166
|
+
<x-link :href="`${github}/index.vue`" target="_blank" color="#94a3b8">
|
|
167
|
+
<x-icon icon="edit" size="sm" />
|
|
168
|
+
</x-link>
|
|
169
|
+
<template #tooltip>
|
|
170
|
+
Edit on <span class="text-gray-300">GitHub</span>
|
|
171
|
+
</template>
|
|
172
|
+
</x-tooltip>
|
|
173
|
+
</h1>
|
|
174
|
+
<div class="text-lg my-2 text-gray-500 dark:text-gray-400">{{ description }}</div>
|
|
175
|
+
</div>
|
|
176
|
+
<docs-copy-page class="mt-1"/>
|
|
126
177
|
</div>
|
|
127
|
-
<div class="text-lg my-2 text-gray-500 dark:text-gray-400">{{ description }}</div>
|
|
128
178
|
<div class="mt-6 space-y-12">
|
|
129
179
|
<slot></slot>
|
|
130
180
|
|
|
@@ -172,6 +222,9 @@ const nextTo = computed(() => (props.next ? `/component/${props.next}` : null))
|
|
|
172
222
|
<template #item-name="{ item }">
|
|
173
223
|
<div class="text-primary-500">{{ item.name }}</div>
|
|
174
224
|
</template>
|
|
225
|
+
<template #item-description="{ item }">
|
|
226
|
+
<div class="text-secondary-600 dark:text-secondary-400">{{ item.description }}</div>
|
|
227
|
+
</template>
|
|
175
228
|
<template #item-type="{ item }">
|
|
176
229
|
<div v-for="t in item.type" :key="t">{{ t }}</div>
|
|
177
230
|
</template>
|
|
@@ -1,41 +1,52 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue'
|
|
2
|
+
import { onMounted, ref } from 'vue'
|
|
3
3
|
|
|
4
4
|
const colorMode = ref('light')
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
function updateMode() {
|
|
7
|
+
if (typeof document === 'undefined') return
|
|
8
|
+
|
|
9
|
+
colorMode.value === 'light'
|
|
10
|
+
? document.querySelector('html')?.classList.remove('dark')
|
|
11
|
+
: document.querySelector('html')?.classList.add('dark')
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function readInitialMode() {
|
|
15
|
+
if (import.meta.env.SSR || typeof localStorage === 'undefined') return 'light'
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const storedMode = localStorage.getItem('color-mode')
|
|
19
|
+
|
|
20
|
+
if (storedMode) return storedMode
|
|
8
21
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} else {
|
|
12
|
-
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
13
|
-
colorMode.value = 'dark'
|
|
22
|
+
if (typeof window !== 'undefined' && window.matchMedia?.('(prefers-color-scheme: dark)').matches) {
|
|
23
|
+
return 'dark'
|
|
14
24
|
}
|
|
25
|
+
} catch {
|
|
26
|
+
// ignore
|
|
15
27
|
}
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
|
|
29
|
+
return 'light'
|
|
18
30
|
}
|
|
19
31
|
|
|
20
|
-
|
|
32
|
+
onMounted(() => {
|
|
33
|
+
colorMode.value = readInitialMode()
|
|
34
|
+
updateMode()
|
|
35
|
+
})
|
|
21
36
|
|
|
22
37
|
function toggle() {
|
|
23
38
|
colorMode.value = (colorMode.value === 'light') ? 'dark' : 'light'
|
|
24
39
|
|
|
25
40
|
updateMode()
|
|
26
41
|
|
|
42
|
+
if (import.meta.env.SSR || typeof localStorage === 'undefined') return
|
|
43
|
+
|
|
27
44
|
try {
|
|
28
45
|
localStorage.setItem('color-mode', colorMode.value)
|
|
29
|
-
} catch
|
|
46
|
+
} catch {
|
|
30
47
|
colorMode.value = 'light'
|
|
31
48
|
}
|
|
32
49
|
}
|
|
33
|
-
|
|
34
|
-
function updateMode() {
|
|
35
|
-
colorMode.value === 'light'
|
|
36
|
-
? document.querySelector('html')?.classList.remove('dark')
|
|
37
|
-
: document.querySelector('html')?.classList.add('dark')
|
|
38
|
-
}
|
|
39
50
|
</script>
|
|
40
51
|
|
|
41
52
|
<template>
|
|
@@ -133,7 +133,9 @@ function keydownInput(e: KeyboardEvent) {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
const { x: mouseX, y: mouseY } =
|
|
136
|
+
const { x: mouseX, y: mouseY } = import.meta.env.SSR
|
|
137
|
+
? { x: ref(0), y: ref(0) }
|
|
138
|
+
: useMouse({ type: 'page' })
|
|
137
139
|
|
|
138
140
|
function hoverResult(e: MouseEvent) {
|
|
139
141
|
if (mouseX.value !== e.x || mouseY.value !== e.y) {
|
|
@@ -169,16 +171,14 @@ const metaKey = ref('')
|
|
|
169
171
|
|
|
170
172
|
onMounted(() => {
|
|
171
173
|
metaKey.value = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? '⌘' : 'Ctrl'
|
|
172
|
-
})
|
|
173
174
|
|
|
174
|
-
if (document) {
|
|
175
175
|
useEventListener(document, 'keydown', (e: KeyboardEvent) => {
|
|
176
176
|
if (e.key === 'k' && (e.ctrlKey || e.metaKey)) {
|
|
177
177
|
e.preventDefault()
|
|
178
178
|
openSearch()
|
|
179
179
|
}
|
|
180
180
|
})
|
|
181
|
-
}
|
|
181
|
+
})
|
|
182
182
|
</script>
|
|
183
183
|
|
|
184
184
|
<template>
|
|
@@ -3,7 +3,7 @@ import { useHead } from '@unhead/vue'
|
|
|
3
3
|
const SITE_URL = 'https://indielayer.com'
|
|
4
4
|
const SITE_NAME = 'Indielayer'
|
|
5
5
|
const DEFAULT_OG_IMAGE = `${SITE_URL}/card.jpg`
|
|
6
|
-
const
|
|
6
|
+
const LLMS_TXT = `${SITE_URL}/llms.txt`
|
|
7
7
|
|
|
8
8
|
export function useDocMeta(options: {
|
|
9
9
|
title: string;
|
|
@@ -17,12 +17,67 @@ export function useDocMeta(options: {
|
|
|
17
17
|
const description = options.description
|
|
18
18
|
|| 'Vue 3 and Tailwind CSS UI components for fast web applications.'
|
|
19
19
|
const url = options.path ? `${SITE_URL}${options.path}` : SITE_URL
|
|
20
|
+
const isComponent = Boolean(options.path?.startsWith('/component/'))
|
|
21
|
+
const componentSlug = isComponent ? options.path!.replace('/component/', '') : null
|
|
22
|
+
const markdownUrl = componentSlug
|
|
23
|
+
? `${SITE_URL}/md/component/${componentSlug}.md`
|
|
24
|
+
: undefined
|
|
25
|
+
|
|
26
|
+
const breadcrumbItems = [
|
|
27
|
+
{
|
|
28
|
+
'@type': 'ListItem',
|
|
29
|
+
position: 1,
|
|
30
|
+
name: 'Docs',
|
|
31
|
+
item: `${SITE_URL}/getting-started`,
|
|
32
|
+
},
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
if (isComponent && options.title) {
|
|
36
|
+
breadcrumbItems.push({
|
|
37
|
+
'@type': 'ListItem',
|
|
38
|
+
position: 2,
|
|
39
|
+
name: options.title,
|
|
40
|
+
item: url,
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const schema = [
|
|
45
|
+
{
|
|
46
|
+
'@context': 'https://schema.org',
|
|
47
|
+
'@type': 'WebPage',
|
|
48
|
+
name: pageTitle,
|
|
49
|
+
description,
|
|
50
|
+
url,
|
|
51
|
+
isPartOf: {
|
|
52
|
+
'@type': 'WebSite',
|
|
53
|
+
name: SITE_NAME,
|
|
54
|
+
url: SITE_URL,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
'@context': 'https://schema.org',
|
|
59
|
+
'@type': 'BreadcrumbList',
|
|
60
|
+
itemListElement: breadcrumbItems,
|
|
61
|
+
},
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
const links: Array<Record<string, string>> = [
|
|
65
|
+
{ rel: 'canonical', href: url },
|
|
66
|
+
{ rel: 'describedby', href: LLMS_TXT },
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
if (markdownUrl) {
|
|
70
|
+
links.push({
|
|
71
|
+
rel: 'alternate',
|
|
72
|
+
type: 'text/markdown',
|
|
73
|
+
href: markdownUrl,
|
|
74
|
+
})
|
|
75
|
+
}
|
|
20
76
|
|
|
21
77
|
useHead({
|
|
22
78
|
title: pageTitle,
|
|
23
79
|
meta: [
|
|
24
80
|
{ name: 'description', content: description },
|
|
25
|
-
{ name: 'keywords', content: DEFAULT_KEYWORDS },
|
|
26
81
|
{ property: 'og:site_name', content: SITE_NAME },
|
|
27
82
|
{ property: 'og:title', content: pageTitle },
|
|
28
83
|
{ property: 'og:description', content: description },
|
|
@@ -40,8 +95,12 @@ export function useDocMeta(options: {
|
|
|
40
95
|
{ name: 'twitter:title', content: pageTitle },
|
|
41
96
|
{ name: 'twitter:description', content: description },
|
|
42
97
|
],
|
|
43
|
-
link:
|
|
44
|
-
|
|
98
|
+
link: links,
|
|
99
|
+
script: [
|
|
100
|
+
{
|
|
101
|
+
type: 'application/ld+json',
|
|
102
|
+
children: JSON.stringify(schema),
|
|
103
|
+
},
|
|
45
104
|
],
|
|
46
105
|
})
|
|
47
106
|
}
|
package/docs/icons.ts
CHANGED
|
@@ -78,6 +78,9 @@ export default {
|
|
|
78
78
|
'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>',
|
|
79
79
|
'arrow-right': '<line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline>',
|
|
80
80
|
'arrow-left': '<line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline>',
|
|
81
|
+
link: '<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>',
|
|
82
|
+
'external-link': '<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line>',
|
|
83
|
+
sparkles: '<path d="M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3z"/><path d="M19 14l.75 2.25L22 17l-2.25.75L19 20l-.75-2.25L16 17l2.25-.75L19 14z"/><path d="M5 15l.75 2.25L8 18l-2.25.75L5 21l-.75-2.25L2 18l2.25-.75L5 15z"/>',
|
|
81
84
|
'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" />',
|
|
82
85
|
|
|
83
86
|
/**
|