@eslamdevui/ui 3.2.0-beta.1 → 3.2.0-beta.2
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/.nuxt/ui/alert.ts +5 -0
- package/.nuxt/ui/badge.ts +5 -0
- package/.nuxt/ui/button-group.ts +13 -0
- package/.nuxt/ui/button.ts +5 -0
- package/.nuxt/ui/carousel.ts +5 -0
- package/.nuxt/ui/content/content-navigation.ts +339 -0
- package/.nuxt/ui/content/content-search-button.ts +6 -0
- package/.nuxt/ui/content/content-search.ts +6 -0
- package/.nuxt/ui/content/content-surround.ts +39 -0
- package/.nuxt/ui/content/content-toc.ts +150 -0
- package/.nuxt/ui/content/index.ts +5 -0
- package/.nuxt/ui/content-surround.ts +5 -0
- package/.nuxt/ui/content-toc.ts +6 -6
- package/.nuxt/ui/dashboard-navbar.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar-collapse.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar-toggle.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar.ts +10 -0
- package/.nuxt/ui/error.ts +9 -0
- package/.nuxt/ui/index.ts +48 -1
- package/.nuxt/ui/input-menu.ts +9 -0
- package/.nuxt/ui/input-number.ts +5 -0
- package/.nuxt/ui/input-tags.ts +9 -0
- package/.nuxt/ui/input.ts +9 -0
- package/.nuxt/ui/prose/a.ts +6 -0
- package/.nuxt/ui/prose/accordion-item.ts +3 -0
- package/.nuxt/ui/prose/accordion.ts +6 -0
- package/.nuxt/ui/prose/badge.ts +3 -0
- package/.nuxt/ui/prose/blockquote.ts +3 -0
- package/.nuxt/ui/prose/callout.ts +129 -0
- package/.nuxt/ui/prose/card-group.ts +3 -0
- package/.nuxt/ui/prose/card.ts +119 -0
- package/.nuxt/ui/prose/code-collapse.ts +19 -0
- package/.nuxt/ui/prose/code-group.ts +13 -0
- package/.nuxt/ui/prose/code-icon.ts +66 -0
- package/.nuxt/ui/prose/code-preview.ts +14 -0
- package/.nuxt/ui/prose/code-tree.ts +28 -0
- package/.nuxt/ui/prose/code.ts +27 -0
- package/.nuxt/ui/prose/collapsible.ts +12 -0
- package/.nuxt/ui/prose/em.ts +3 -0
- package/.nuxt/ui/prose/field-group.ts +3 -0
- package/.nuxt/ui/prose/field.ts +11 -0
- package/.nuxt/ui/prose/h1.ts +6 -0
- package/.nuxt/ui/prose/h2.ts +14 -0
- package/.nuxt/ui/prose/h3.ts +14 -0
- package/.nuxt/ui/prose/h4.ts +6 -0
- package/.nuxt/ui/prose/hr.ts +3 -0
- package/.nuxt/ui/prose/icon.ts +3 -0
- package/.nuxt/ui/prose/img.ts +3 -0
- package/.nuxt/ui/prose/index.ts +41 -0
- package/.nuxt/ui/prose/kbd.ts +3 -0
- package/.nuxt/ui/prose/li.ts +3 -0
- package/.nuxt/ui/prose/ol.ts +3 -0
- package/.nuxt/ui/prose/p.ts +3 -0
- package/.nuxt/ui/prose/pre.ts +17 -0
- package/.nuxt/ui/prose/steps.ts +19 -0
- package/.nuxt/ui/prose/strong.ts +3 -0
- package/.nuxt/ui/prose/table.ts +6 -0
- package/.nuxt/ui/prose/tabs-item.ts +3 -0
- package/.nuxt/ui/prose/tabs.ts +5 -0
- package/.nuxt/ui/prose/tbody.ts +3 -0
- package/.nuxt/ui/prose/td.ts +3 -0
- package/.nuxt/ui/prose/th.ts +3 -0
- package/.nuxt/ui/prose/thead.ts +3 -0
- package/.nuxt/ui/prose/tr.ts +3 -0
- package/.nuxt/ui/prose/ul.ts +3 -0
- package/.nuxt/ui/select-menu.ts +9 -0
- package/.nuxt/ui/select.ts +9 -0
- package/.nuxt/ui/textarea.ts +9 -0
- package/.nuxt/ui/toast.ts +5 -0
- package/LICENSE.md +9 -9
- package/README.md +147 -147
- package/cli/commands/make/component.mjs +95 -95
- package/cli/commands/make/index.mjs +14 -14
- package/cli/commands/make/locale.mjs +64 -64
- package/cli/index.mjs +15 -15
- package/cli/package.json +13 -13
- package/cli/templates.mjs +236 -228
- package/cli/utils.mjs +31 -31
- package/dist/module.json +1 -1
- package/dist/module.mjs +18 -13
- package/dist/runtime/components/Accordion.vue +36 -36
- package/dist/runtime/components/Alert.vue +46 -46
- package/dist/runtime/components/App.vue +10 -10
- package/dist/runtime/components/Avatar.vue +27 -27
- package/dist/runtime/components/AvatarGroup.vue +4 -4
- package/dist/runtime/components/Badge.vue +16 -16
- package/dist/runtime/components/Breadcrumb.vue +32 -32
- package/dist/runtime/components/Button.vue +28 -28
- package/dist/runtime/components/ButtonGroup.vue +3 -3
- package/dist/runtime/components/Calendar.vue +74 -74
- package/dist/runtime/components/Card.vue +13 -13
- package/dist/runtime/components/Carousel.vue +58 -58
- package/dist/runtime/components/ChatMessage.vue +35 -35
- package/dist/runtime/components/ChatMessages.vue +71 -71
- package/dist/runtime/components/ChatMessages.vue.d.ts +1 -2
- package/dist/runtime/components/ChatPrompt.vue +30 -31
- package/dist/runtime/components/ChatPrompt.vue.d.ts +4 -4
- package/dist/runtime/components/ChatPromptSubmit.vue +10 -10
- package/dist/runtime/components/Checkbox.vue +33 -33
- package/dist/runtime/components/CheckboxGroup.vue +32 -32
- package/dist/runtime/components/Chip.vue +11 -11
- package/dist/runtime/components/Collapsible.vue +9 -9
- package/dist/runtime/components/ColorPicker.vue +30 -30
- package/dist/runtime/components/CommandPalette.vue +117 -117
- package/dist/runtime/components/Container.vue +3 -3
- package/dist/runtime/components/ContextMenu.vue +22 -22
- package/dist/runtime/components/ContextMenuContent.vue +105 -105
- package/dist/runtime/components/DashboardGroup.vue +3 -3
- package/dist/runtime/components/DashboardNavbar.vue +41 -41
- package/dist/runtime/components/DashboardNavbar.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardPanel.vue +29 -29
- package/dist/runtime/components/DashboardPanel.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardResizeHandle.vue +7 -7
- package/dist/runtime/components/DashboardSearch.vue +24 -25
- package/dist/runtime/components/DashboardSearch.vue.d.ts +3 -3
- package/dist/runtime/components/DashboardSearchButton.vue +63 -41
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +7 -1
- package/dist/runtime/components/DashboardSidebar.vue +77 -77
- package/dist/runtime/components/DashboardSidebarCollapse.vue +7 -7
- package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.vue +14 -17
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +4 -6
- package/dist/runtime/components/Drawer.vue +55 -55
- package/dist/runtime/components/DropdownMenu.vue +24 -24
- package/dist/runtime/components/DropdownMenuContent.vue +107 -107
- package/dist/runtime/components/Error.vue +57 -0
- package/dist/runtime/components/Error.vue.d.ts +52 -0
- package/dist/runtime/components/Form.vue +8 -8
- package/dist/runtime/components/Form.vue.d.ts +1 -1
- package/dist/runtime/components/FormField.vue +37 -37
- package/dist/runtime/components/Icon.vue +1 -1
- package/dist/runtime/components/Input.vue +34 -34
- package/dist/runtime/components/InputMenu.vue +163 -163
- package/dist/runtime/components/InputNumber.vue +49 -49
- package/dist/runtime/components/InputTags.vue +55 -55
- package/dist/runtime/components/Kbd.vue +5 -5
- package/dist/runtime/components/Link.vue +14 -14
- package/dist/runtime/components/LinkBase.vue +8 -8
- package/dist/runtime/components/Modal.vue +69 -69
- package/dist/runtime/components/NavigationMenu.vue +166 -166
- package/dist/runtime/components/OverlayProvider.vue +9 -9
- package/dist/runtime/components/Pagination.vue +47 -47
- package/dist/runtime/components/PinInput.vue +20 -20
- package/dist/runtime/components/Popover.vue +17 -17
- package/dist/runtime/components/Progress.vue +19 -19
- package/dist/runtime/components/RadioGroup.vue +43 -43
- package/dist/runtime/components/Select.vue +96 -96
- package/dist/runtime/components/SelectMenu.vue +130 -130
- package/dist/runtime/components/Separator.vue +15 -15
- package/dist/runtime/components/Skeleton.vue +10 -10
- package/dist/runtime/components/Slideover.vue +76 -76
- package/dist/runtime/components/Slider.vue +27 -27
- package/dist/runtime/components/Stepper.vue +51 -51
- package/dist/runtime/components/Switch.vue +33 -33
- package/dist/runtime/components/Table.vue +77 -77
- package/dist/runtime/components/Tabs.vue +37 -37
- package/dist/runtime/components/Textarea.vue +33 -33
- package/dist/runtime/components/Timeline.vue +38 -38
- package/dist/runtime/components/Toast.vue +69 -69
- package/dist/runtime/components/Toaster.vue +28 -28
- package/dist/runtime/components/Tooltip.vue +19 -19
- package/dist/runtime/components/Tree.vue +60 -60
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +2 -2
- package/dist/runtime/components/color-mode/ColorModeButton.vue +16 -16
- package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +3 -3
- package/dist/runtime/components/color-mode/ColorModeImage.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeSelect.vue +19 -19
- package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +19 -19
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
- package/dist/runtime/components/content/ContentNavigation.vue +175 -0
- package/dist/runtime/components/content/ContentNavigation.vue.d.ts +53 -0
- package/dist/runtime/components/content/ContentSearch.vue +184 -0
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +111 -0
- package/dist/runtime/components/content/ContentSearchButton.vue +95 -0
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +12 -0
- package/dist/runtime/components/content/ContentSurround.vue +61 -0
- package/dist/runtime/components/content/ContentSurround.vue.d.ts +59 -0
- package/dist/runtime/components/content/ContentToc.vue +146 -0
- package/dist/runtime/components/content/ContentToc.vue.d.ts +88 -0
- package/dist/runtime/components/locale/LocaleSelect.vue +20 -20
- package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +1 -1
- package/dist/runtime/components/prose/A.vue +24 -0
- package/dist/runtime/components/prose/A.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Accordion.vue +43 -0
- package/dist/runtime/components/prose/Accordion.vue.d.ts +16 -0
- package/dist/runtime/components/prose/AccordionItem.vue +25 -0
- package/dist/runtime/components/prose/AccordionItem.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Badge.vue +21 -0
- package/dist/runtime/components/prose/Badge.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Blockquote.vue +21 -0
- package/dist/runtime/components/prose/Blockquote.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Callout.vue +60 -0
- package/dist/runtime/components/prose/Callout.vue.d.ts +26 -0
- package/dist/runtime/components/prose/Card.vue +83 -0
- package/dist/runtime/components/prose/Card.vue.d.ts +30 -0
- package/dist/runtime/components/prose/CardGroup.vue +21 -0
- package/dist/runtime/components/prose/CardGroup.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Code.vue +23 -0
- package/dist/runtime/components/prose/Code.vue.d.ts +22 -0
- package/dist/runtime/components/prose/CodeCollapse.vue +44 -0
- package/dist/runtime/components/prose/CodeCollapse.vue.d.ts +46 -0
- package/dist/runtime/components/prose/CodeGroup.vue +70 -0
- package/dist/runtime/components/prose/CodeGroup.vue.d.ts +37 -0
- package/dist/runtime/components/prose/CodeIcon.vue +28 -0
- package/dist/runtime/components/prose/CodeIcon.vue.d.ts +24 -0
- package/dist/runtime/components/prose/CodePreview.vue +28 -0
- package/dist/runtime/components/prose/CodePreview.vue.d.ts +19 -0
- package/dist/runtime/components/prose/CodeTree.vue +160 -0
- package/dist/runtime/components/prose/CodeTree.vue.d.ts +30 -0
- package/dist/runtime/components/prose/Collapsible.vue +41 -0
- package/dist/runtime/components/prose/Collapsible.vue.d.ts +38 -0
- package/dist/runtime/components/prose/Em.vue +19 -0
- package/dist/runtime/components/prose/Em.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Field.vue +48 -0
- package/dist/runtime/components/prose/Field.vue.d.ts +39 -0
- package/dist/runtime/components/prose/FieldGroup.vue +23 -0
- package/dist/runtime/components/prose/FieldGroup.vue.d.ts +18 -0
- package/dist/runtime/components/prose/H1.vue +28 -0
- package/dist/runtime/components/prose/H1.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H2.vue +32 -0
- package/dist/runtime/components/prose/H2.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H3.vue +32 -0
- package/dist/runtime/components/prose/H3.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H4.vue +28 -0
- package/dist/runtime/components/prose/H4.vue.d.ts +19 -0
- package/dist/runtime/components/prose/Hr.vue +18 -0
- package/dist/runtime/components/prose/Hr.vue.d.ts +5 -0
- package/dist/runtime/components/prose/Icon.vue +19 -0
- package/dist/runtime/components/prose/Icon.vue.d.ts +6 -0
- package/dist/runtime/components/prose/Img.vue +40 -0
- package/dist/runtime/components/prose/Img.vue.d.ts +9 -0
- package/dist/runtime/components/prose/Kbd.vue +19 -0
- package/dist/runtime/components/prose/Kbd.vue.d.ts +6 -0
- package/dist/runtime/components/prose/Li.vue +21 -0
- package/dist/runtime/components/prose/Li.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Ol.vue +21 -0
- package/dist/runtime/components/prose/Ol.vue.d.ts +13 -0
- package/dist/runtime/components/prose/P.vue +21 -0
- package/dist/runtime/components/prose/P.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Pre.vue +63 -0
- package/dist/runtime/components/prose/Pre.vue.d.ts +25 -0
- package/dist/runtime/components/prose/Script.vue +12 -0
- package/dist/runtime/components/prose/Script.vue.d.ts +12 -0
- package/dist/runtime/components/prose/Steps.vue +22 -0
- package/dist/runtime/components/prose/Steps.vue.d.ts +22 -0
- package/dist/runtime/components/prose/Strong.vue +21 -0
- package/dist/runtime/components/prose/Strong.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Table.vue +24 -0
- package/dist/runtime/components/prose/Table.vue.d.ts +18 -0
- package/dist/runtime/components/prose/Tabs.vue +78 -0
- package/dist/runtime/components/prose/Tabs.vue.d.ts +36 -0
- package/dist/runtime/components/prose/TabsItem.vue +25 -0
- package/dist/runtime/components/prose/TabsItem.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Tbody.vue +21 -0
- package/dist/runtime/components/prose/Tbody.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Td.vue +21 -0
- package/dist/runtime/components/prose/Td.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Th.vue +21 -0
- package/dist/runtime/components/prose/Th.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Thead.vue +21 -0
- package/dist/runtime/components/prose/Thead.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Tr.vue +21 -0
- package/dist/runtime/components/prose/Tr.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Ul.vue +21 -0
- package/dist/runtime/components/prose/Ul.vue.d.ts +13 -0
- package/dist/runtime/components/prose/callout/Caution.vue +11 -0
- package/dist/runtime/components/prose/callout/Caution.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Note.vue +11 -0
- package/dist/runtime/components/prose/callout/Note.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Tip.vue +11 -0
- package/dist/runtime/components/prose/callout/Tip.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Warning.vue +11 -0
- package/dist/runtime/components/prose/callout/Warning.vue.d.ts +14 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +2 -2
- package/dist/runtime/composables/usePortal.d.ts +1 -1
- package/dist/runtime/composables/useResizable.d.ts +1 -1
- package/dist/runtime/inertia/components/Link.vue +12 -12
- package/dist/runtime/inertia/components/LinkBase.vue +15 -15
- package/dist/runtime/types/app.config.d.ts +6 -6
- package/dist/runtime/types/content.d.ts +4 -1
- package/dist/runtime/types/content.js +4 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/prose.d.ts +42 -1
- package/dist/runtime/types/prose.js +42 -0
- package/dist/runtime/types/tv.d.ts +2 -2
- package/dist/runtime/utils/index.d.ts +1 -1
- package/dist/runtime/utils/index.js +13 -4
- package/dist/runtime/vue/components/Icon.vue +1 -1
- package/dist/runtime/vue/components/Link.vue +31 -31
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +7 -7
- package/dist/shared/{ui.BcVNrqyb.mjs → ui.DQZ75GCP.mjs} +183 -180
- package/dist/unplugin.mjs +9 -9
- package/dist/vite.mjs +1 -1
- package/package.json +8 -9
- package/vue-plugin.d.ts +5 -5
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui-pro/content/content-surround";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { Primitive } from "reka-ui";
|
|
8
|
+
import { createReusableTemplate } from "@vueuse/core";
|
|
9
|
+
import { useAppConfig } from "#imports";
|
|
10
|
+
import { tv } from "../../utils/tv";
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
as: { type: null, required: false },
|
|
13
|
+
prevIcon: { type: String, required: false },
|
|
14
|
+
nextIcon: { type: String, required: false },
|
|
15
|
+
surround: { type: Array, required: false },
|
|
16
|
+
class: { type: null, required: false },
|
|
17
|
+
ui: { type: null, required: false }
|
|
18
|
+
});
|
|
19
|
+
defineSlots();
|
|
20
|
+
const appConfig = useAppConfig();
|
|
21
|
+
const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate({
|
|
22
|
+
props: {
|
|
23
|
+
link: Object,
|
|
24
|
+
icon: String,
|
|
25
|
+
direction: String
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.uiPro?.contentSurround || {} })());
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<DefineLinkTemplate v-slot="{ link, icon, direction }">
|
|
33
|
+
<ULink v-if="link" :to="link.path" raw :class="ui.link({ class: [props.ui?.link, link.ui?.link, link.class], direction })">
|
|
34
|
+
<slot name="link" :link="link">
|
|
35
|
+
<div :class="ui.linkLeading({ class: [props.ui?.linkLeading, link.ui?.linkLeading] })">
|
|
36
|
+
<slot name="link-leading" :link="link">
|
|
37
|
+
<UIcon :name="link.icon || icon" :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, link.ui?.linkLeadingIcon], direction })" />
|
|
38
|
+
</slot>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<p :class="ui.linkTitle({ class: [props.ui?.linkTitle, link.ui?.linkTitle] })">
|
|
42
|
+
<slot name="link-title" :link="link">
|
|
43
|
+
{{ link.title }}
|
|
44
|
+
</slot>
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
<p :class="ui.linkDescription({ class: [props.ui?.linkDescription, link.ui?.linkDescription] })">
|
|
48
|
+
<slot name="link-description" :link="link">
|
|
49
|
+
{{ link.description }}
|
|
50
|
+
</slot>
|
|
51
|
+
</p>
|
|
52
|
+
</slot>
|
|
53
|
+
</ULink>
|
|
54
|
+
<span v-else class="hidden lg:block"> </span>
|
|
55
|
+
</DefineLinkTemplate>
|
|
56
|
+
|
|
57
|
+
<Primitive v-if="surround" :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
58
|
+
<ReuseLinkTemplate :link="surround[0]" :icon="prevIcon || appConfig.ui.icons.arrowLeft" direction="left" />
|
|
59
|
+
<ReuseLinkTemplate :link="surround[1]" :icon="nextIcon || appConfig.ui.icons.arrowRight" direction="right" />
|
|
60
|
+
</Primitive>
|
|
61
|
+
</template>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ContentNavigationItem } from '@nuxt/content'
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
3
|
+
import type { ComponentConfig } from '@nuxt/ui'
|
|
4
|
+
import type theme from '#build/ui-pro/content/content-surround'
|
|
5
|
+
|
|
6
|
+
type ContentSurround = ComponentConfig<typeof theme, AppConfig, 'contentSurround', 'uiPro'>
|
|
7
|
+
export interface ContentSurroundLink extends ContentNavigationItem {
|
|
8
|
+
description?: string
|
|
9
|
+
/**
|
|
10
|
+
* @IconifyIcon
|
|
11
|
+
*/
|
|
12
|
+
icon?: string
|
|
13
|
+
class?: any
|
|
14
|
+
ui?: Pick<ContentSurround['slots'], 'link' | 'linkLeading' | 'linkLeadingIcon' | 'linkTitle' | 'linkDescription'>
|
|
15
|
+
}
|
|
16
|
+
export interface ContentSurroundProps<T extends ContentSurroundLink = ContentSurroundLink> {
|
|
17
|
+
/**
|
|
18
|
+
* The element or component this component should render as.
|
|
19
|
+
* @defaultValue 'div'
|
|
20
|
+
*/
|
|
21
|
+
as?: any
|
|
22
|
+
/**
|
|
23
|
+
* The icon displayed in the prev link.
|
|
24
|
+
* @defaultValue appConfig.ui.icons.arrowLeft
|
|
25
|
+
* @IconifyIcon
|
|
26
|
+
*/
|
|
27
|
+
prevIcon?: string
|
|
28
|
+
/**
|
|
29
|
+
* The icon displayed in the next link.
|
|
30
|
+
* @defaultValue appConfig.ui.icons.arrowRight
|
|
31
|
+
* @IconifyIcon
|
|
32
|
+
*/
|
|
33
|
+
nextIcon?: string
|
|
34
|
+
surround?: T[]
|
|
35
|
+
class?: any
|
|
36
|
+
ui?: ContentSurround['slots']
|
|
37
|
+
}
|
|
38
|
+
type SlotProps<T> = (props: {
|
|
39
|
+
link: T
|
|
40
|
+
}) => any
|
|
41
|
+
export interface ContentSurroundSlots<T extends ContentSurroundLink = ContentSurroundLink> {
|
|
42
|
+
'link': SlotProps<T>
|
|
43
|
+
'link-leading': SlotProps<T>
|
|
44
|
+
'link-title': SlotProps<T>
|
|
45
|
+
'link-description': SlotProps<T>
|
|
46
|
+
}
|
|
47
|
+
declare const _default: <T extends ContentSurroundLink>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, 'attrs' | 'emit' | 'slots'>>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
48
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & ContentSurroundProps<T> & Partial<{}>> & import('vue').PublicProps
|
|
49
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void
|
|
50
|
+
attrs: any
|
|
51
|
+
slots: ContentSurroundSlots<T>
|
|
52
|
+
emit: {}
|
|
53
|
+
}>) => import('vue').VNode & {
|
|
54
|
+
__ctx?: Awaited<typeof __VLS_setup>
|
|
55
|
+
}
|
|
56
|
+
export default _default
|
|
57
|
+
type __VLS_PrettifyLocal<T> = {
|
|
58
|
+
[K in keyof T]: T[K];
|
|
59
|
+
} & {}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui-pro/content/content-toc";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { CollapsibleRoot, CollapsibleTrigger, CollapsibleContent, useForwardPropsEmits } from "reka-ui";
|
|
8
|
+
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
9
|
+
import { useRouter, useAppConfig, useNuxtApp } from "#imports";
|
|
10
|
+
import { useScrollspy } from "../../composables/useScrollspy";
|
|
11
|
+
import { useLocalePro } from "../../composables/useLocalePro";
|
|
12
|
+
import { tv } from "../../utils/tv";
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
as: { type: null, required: false, default: "nav" },
|
|
15
|
+
trailingIcon: { type: String, required: false },
|
|
16
|
+
title: { type: String, required: false },
|
|
17
|
+
color: { type: null, required: false },
|
|
18
|
+
highlight: { type: Boolean, required: false },
|
|
19
|
+
highlightColor: { type: null, required: false },
|
|
20
|
+
links: { type: Array, required: false },
|
|
21
|
+
class: { type: null, required: false },
|
|
22
|
+
ui: { type: null, required: false },
|
|
23
|
+
defaultOpen: { type: Boolean, required: false },
|
|
24
|
+
open: { type: Boolean, required: false }
|
|
25
|
+
});
|
|
26
|
+
const emits = defineEmits(["update:open", "move"]);
|
|
27
|
+
const slots = defineSlots();
|
|
28
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "open", "defaultOpen"), emits);
|
|
29
|
+
const { t } = useLocalePro();
|
|
30
|
+
const router = useRouter();
|
|
31
|
+
const appConfig = useAppConfig();
|
|
32
|
+
const { activeHeadings, updateHeadings } = useScrollspy();
|
|
33
|
+
const [DefineListTemplate, ReuseListTemplate] = createReusableTemplate({
|
|
34
|
+
props: {
|
|
35
|
+
links: Array,
|
|
36
|
+
level: Number
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const [DefineTriggerTemplate, ReuseTriggerTemplate] = createReusableTemplate();
|
|
40
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.uiPro?.contentToc || {} })({
|
|
41
|
+
color: props.color,
|
|
42
|
+
highlight: props.highlight,
|
|
43
|
+
highlightColor: props.highlightColor || props.color
|
|
44
|
+
}));
|
|
45
|
+
function scrollToHeading(id) {
|
|
46
|
+
const encodedId = encodeURIComponent(id);
|
|
47
|
+
router.push(`#${encodedId}`);
|
|
48
|
+
emits("move", id);
|
|
49
|
+
}
|
|
50
|
+
function flattenLinks(links) {
|
|
51
|
+
return links.flatMap((link) => [link, ...link.children ? flattenLinks(link.children) : []]);
|
|
52
|
+
}
|
|
53
|
+
const indicatorStyle = computed(() => {
|
|
54
|
+
if (!activeHeadings.value?.length) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const flatLinks = flattenLinks(props.links || []);
|
|
58
|
+
const activeIndex = flatLinks.findIndex((link) => activeHeadings.value.includes(link.id));
|
|
59
|
+
const linkHeight = 28;
|
|
60
|
+
const gapSize = 0;
|
|
61
|
+
return {
|
|
62
|
+
"--indicator-size": `${linkHeight * activeHeadings.value.length + gapSize * (activeHeadings.value.length - 1)}px`,
|
|
63
|
+
"--indicator-position": activeIndex >= 0 ? `${activeIndex * (linkHeight + gapSize)}px` : "0px"
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
const nuxtApp = useNuxtApp();
|
|
67
|
+
nuxtApp.hooks.hook("page:loading:end", () => {
|
|
68
|
+
const headings = Array.from(document.querySelectorAll("h2, h3"));
|
|
69
|
+
updateHeadings(headings);
|
|
70
|
+
});
|
|
71
|
+
nuxtApp.hooks.hook("page:transition:finish", () => {
|
|
72
|
+
const headings = Array.from(document.querySelectorAll("h2, h3"));
|
|
73
|
+
updateHeadings(headings);
|
|
74
|
+
});
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<template>
|
|
78
|
+
<!-- eslint-disable-next-line vue/no-template-shadow -->
|
|
79
|
+
<DefineListTemplate v-slot="{ links, level }">
|
|
80
|
+
<ul :class="level > 0 ? ui.listWithChildren({ class: props.ui?.listWithChildren }) : ui.list({ class: props.ui?.list })">
|
|
81
|
+
<li v-for="(link, index) in links" :key="index" :class="link.children && link.children.length > 0 ? ui.itemWithChildren({ class: [props.ui?.itemWithChildren, link.ui?.itemWithChildren] }) : ui.item({ class: [props.ui?.item, link.ui?.item] })">
|
|
82
|
+
<a :href="`#${link.id}`" :class="ui.link({ class: [props.ui?.link, link.ui?.link, link.class], active: activeHeadings.includes(link.id) })" @click.prevent="scrollToHeading(link.id)">
|
|
83
|
+
<slot name="link" :link="link">
|
|
84
|
+
<span :class="ui.linkText({ class: [props.ui?.linkText, link.ui?.linkText] })">
|
|
85
|
+
{{ link.text }}
|
|
86
|
+
</span>
|
|
87
|
+
</slot>
|
|
88
|
+
</a>
|
|
89
|
+
|
|
90
|
+
<ReuseListTemplate v-if="link.children?.length" :links="link.children" :level="level + 1" />
|
|
91
|
+
</li>
|
|
92
|
+
</ul>
|
|
93
|
+
</DefineListTemplate>
|
|
94
|
+
|
|
95
|
+
<DefineTriggerTemplate v-slot="{ open }">
|
|
96
|
+
<slot name="leading" :open="open" />
|
|
97
|
+
|
|
98
|
+
<span :class="ui.title({ class: props.ui?.title })">
|
|
99
|
+
<slot :open="open">{{ title || t("contentToc.title") }}</slot>
|
|
100
|
+
</span>
|
|
101
|
+
|
|
102
|
+
<span :class="ui.trailing({ class: props.ui?.trailing })">
|
|
103
|
+
<slot name="trailing" :open="open">
|
|
104
|
+
<UIcon :name="trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
105
|
+
</slot>
|
|
106
|
+
</span>
|
|
107
|
+
</DefineTriggerTemplate>
|
|
108
|
+
|
|
109
|
+
<CollapsibleRoot v-slot="{ open }" v-bind="rootProps" :default-open="defaultOpen" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
110
|
+
<div :class="ui.container({ class: props.ui?.container })">
|
|
111
|
+
<div v-if="!!slots.top" :class="ui.top({ class: props.ui?.top })">
|
|
112
|
+
<slot name="top" :links="links" />
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<template v-if="links?.length">
|
|
116
|
+
<CollapsibleTrigger :class="ui.trigger({ class: 'lg:hidden' })">
|
|
117
|
+
<ReuseTriggerTemplate :open="open" />
|
|
118
|
+
</CollapsibleTrigger>
|
|
119
|
+
|
|
120
|
+
<CollapsibleContent :class="ui.content({ class: [props.ui?.content, 'lg:hidden'] })">
|
|
121
|
+
<div v-if="highlight" :class="ui.indicator({ class: props.ui?.indicator })" :style="indicatorStyle" />
|
|
122
|
+
|
|
123
|
+
<slot name="content" :links="links">
|
|
124
|
+
<ReuseListTemplate :links="links" :level="0" />
|
|
125
|
+
</slot>
|
|
126
|
+
</CollapsibleContent>
|
|
127
|
+
|
|
128
|
+
<p :class="ui.trigger({ class: 'hidden lg:flex' })">
|
|
129
|
+
<ReuseTriggerTemplate :open="open" />
|
|
130
|
+
</p>
|
|
131
|
+
|
|
132
|
+
<div :class="ui.content({ class: [props.ui?.content, 'hidden lg:flex'] })">
|
|
133
|
+
<div v-if="highlight" :class="ui.indicator({ class: props.ui?.indicator })" :style="indicatorStyle" />
|
|
134
|
+
|
|
135
|
+
<slot name="content" :links="links">
|
|
136
|
+
<ReuseListTemplate :links="links" :level="0" />
|
|
137
|
+
</slot>
|
|
138
|
+
</div>
|
|
139
|
+
</template>
|
|
140
|
+
|
|
141
|
+
<div v-if="!!slots.bottom" :class="ui.bottom({ class: props.ui?.bottom, body: !!slots.top || !!links?.length })">
|
|
142
|
+
<slot name="bottom" :links="links" />
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</CollapsibleRoot>
|
|
146
|
+
</template>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { CollapsibleRootProps, CollapsibleRootEmits } from 'reka-ui'
|
|
2
|
+
import type { TocLink } from '@nuxt/content'
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
4
|
+
import type { ComponentConfig } from '@nuxt/ui'
|
|
5
|
+
import type theme from '#build/ui-pro/content/content-toc'
|
|
6
|
+
|
|
7
|
+
type ContentToc = ComponentConfig<typeof theme, AppConfig, 'contentToc', 'uiPro'>
|
|
8
|
+
export type ContentTocLink = TocLink & {
|
|
9
|
+
class?: any
|
|
10
|
+
ui?: Pick<ContentToc['slots'], 'item' | 'itemWithChildren' | 'link' | 'linkText'>
|
|
11
|
+
}
|
|
12
|
+
export interface ContentTocProps<T extends ContentTocLink = ContentTocLink> extends Pick<CollapsibleRootProps, 'defaultOpen' | 'open'> {
|
|
13
|
+
/**
|
|
14
|
+
* The element or component this component should render as.
|
|
15
|
+
* @defaultValue 'nav'
|
|
16
|
+
*/
|
|
17
|
+
as?: any
|
|
18
|
+
/**
|
|
19
|
+
* The icon displayed to collapse the content.
|
|
20
|
+
* @defaultValue appConfig.ui.icons.chevronDown
|
|
21
|
+
* @IconifyIcon
|
|
22
|
+
*/
|
|
23
|
+
trailingIcon?: string
|
|
24
|
+
/**
|
|
25
|
+
* The title of the table of contents.
|
|
26
|
+
* @defaultValue t('contentToc.title')
|
|
27
|
+
*/
|
|
28
|
+
title?: string
|
|
29
|
+
/**
|
|
30
|
+
* @defaultValue 'primary'
|
|
31
|
+
*/
|
|
32
|
+
color?: ContentToc['variants']['color']
|
|
33
|
+
/**
|
|
34
|
+
* Display a line next to the active link.
|
|
35
|
+
* @defaultValue false
|
|
36
|
+
*/
|
|
37
|
+
highlight?: boolean
|
|
38
|
+
/**
|
|
39
|
+
* @defaultValue 'primary'
|
|
40
|
+
*/
|
|
41
|
+
highlightColor?: ContentToc['variants']['highlightColor']
|
|
42
|
+
links?: T[]
|
|
43
|
+
class?: any
|
|
44
|
+
ui?: ContentToc['slots']
|
|
45
|
+
}
|
|
46
|
+
export type ContentTocEmits = CollapsibleRootEmits & {
|
|
47
|
+
move: [id: string]
|
|
48
|
+
}
|
|
49
|
+
type SlotProps<T> = (props: {
|
|
50
|
+
link: T
|
|
51
|
+
}) => any
|
|
52
|
+
export interface ContentTocSlots<T extends ContentTocLink = ContentTocLink> {
|
|
53
|
+
leading(props: {
|
|
54
|
+
open: boolean
|
|
55
|
+
}): any
|
|
56
|
+
default(props: {
|
|
57
|
+
open: boolean
|
|
58
|
+
}): any
|
|
59
|
+
trailing(props: {
|
|
60
|
+
open: boolean
|
|
61
|
+
}): any
|
|
62
|
+
content(props: {
|
|
63
|
+
links: T[]
|
|
64
|
+
}): any
|
|
65
|
+
link: SlotProps<T>
|
|
66
|
+
top(props: {
|
|
67
|
+
links?: T[]
|
|
68
|
+
}): any
|
|
69
|
+
bottom(props: {
|
|
70
|
+
links?: T[]
|
|
71
|
+
}): any
|
|
72
|
+
}
|
|
73
|
+
declare const _default: <T extends ContentTocLink>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, 'attrs' | 'emit' | 'slots'>>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
74
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
75
|
+
readonly 'onUpdate:open'?: ((value: boolean) => any) | undefined
|
|
76
|
+
readonly 'onMove'?: ((id: string) => any) | undefined
|
|
77
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, 'onUpdate:open' | 'onMove'> & ContentTocProps<T> & Partial<{}>> & import('vue').PublicProps
|
|
78
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void
|
|
79
|
+
attrs: any
|
|
80
|
+
slots: ContentTocSlots<T>
|
|
81
|
+
emit: ((evt: 'update:open', value: boolean) => void) & ((evt: 'move', id: string) => void)
|
|
82
|
+
}>) => import('vue').VNode & {
|
|
83
|
+
__ctx?: Awaited<typeof __VLS_setup>
|
|
84
|
+
}
|
|
85
|
+
export default _default
|
|
86
|
+
type __VLS_PrettifyLocal<T> = {
|
|
87
|
+
[K in keyof T]: T[K];
|
|
88
|
+
} & {}
|
|
@@ -38,24 +38,24 @@ function getEmojiFlag(locale) {
|
|
|
38
38
|
</script>
|
|
39
39
|
|
|
40
40
|
<template>
|
|
41
|
-
<USelectMenu
|
|
42
|
-
v-model="modelValue"
|
|
43
|
-
:search-input="false"
|
|
44
|
-
value-key="code"
|
|
45
|
-
label-key="name"
|
|
46
|
-
:items="props.locales"
|
|
47
|
-
v-bind="$attrs"
|
|
48
|
-
>
|
|
49
|
-
<template #leading>
|
|
50
|
-
<span v-if="modelValue" class="size-5 text-center">
|
|
51
|
-
{{ getEmojiFlag(modelValue) }}
|
|
52
|
-
</span>
|
|
53
|
-
</template>
|
|
54
|
-
|
|
55
|
-
<template #item-leading="{ item }">
|
|
56
|
-
<span class="size-5 text-center">
|
|
57
|
-
{{ getEmojiFlag(item.code) }}
|
|
58
|
-
</span>
|
|
59
|
-
</template>
|
|
60
|
-
</USelectMenu>
|
|
41
|
+
<USelectMenu
|
|
42
|
+
v-model="modelValue"
|
|
43
|
+
:search-input="false"
|
|
44
|
+
value-key="code"
|
|
45
|
+
label-key="name"
|
|
46
|
+
:items="props.locales"
|
|
47
|
+
v-bind="$attrs"
|
|
48
|
+
>
|
|
49
|
+
<template #leading>
|
|
50
|
+
<span v-if="modelValue" class="size-5 text-center">
|
|
51
|
+
{{ getEmojiFlag(modelValue) }}
|
|
52
|
+
</span>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<template #item-leading="{ item }">
|
|
56
|
+
<span class="size-5 text-center">
|
|
57
|
+
{{ getEmojiFlag(item.code) }}
|
|
58
|
+
</span>
|
|
59
|
+
</template>
|
|
60
|
+
</USelectMenu>
|
|
61
61
|
</template>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SelectMenuProps, Locale } from '
|
|
1
|
+
import type { SelectMenuProps, Locale } from '../../types';
|
|
2
2
|
export interface LocaleSelectProps extends
|
|
3
3
|
/** @vue-ignore */
|
|
4
4
|
Pick<SelectMenuProps<any>, 'color' | 'variant' | 'size' | 'trailingIcon' | 'selectedIcon' | 'content' | 'arrow' | 'portal' | 'disabled' | 'ui'> {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/a";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
import ULink from "../Link.vue";
|
|
10
|
+
const appConfig = useAppConfig();
|
|
11
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.a || {} }));
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
href: { type: String, required: false },
|
|
14
|
+
target: { type: null, required: false },
|
|
15
|
+
class: { type: null, required: false }
|
|
16
|
+
});
|
|
17
|
+
defineSlots();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<ULink :href="href" :target="target" :class="ui({ class: props.class })" raw>
|
|
22
|
+
<slot />
|
|
23
|
+
</ULink>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ProseAProps {
|
|
2
|
+
href?: string;
|
|
3
|
+
target?: '_blank' | '_parent' | '_self' | '_top' | (string & object) | null | undefined;
|
|
4
|
+
class?: any;
|
|
5
|
+
}
|
|
6
|
+
export interface ProseASlots {
|
|
7
|
+
default(props?: {}): any;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseAProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseAProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseASlots>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/accordion";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed, ref, onBeforeUpdate } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { transformUI } from "../../utils";
|
|
9
|
+
import { tv } from "../../utils/tv";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
type: { type: String, required: false, default: "multiple" },
|
|
12
|
+
class: { type: null, required: false }
|
|
13
|
+
});
|
|
14
|
+
const slots = defineSlots();
|
|
15
|
+
const appConfig = useAppConfig();
|
|
16
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.accordion || {} }));
|
|
17
|
+
const rerenderCount = ref(1);
|
|
18
|
+
const items = computed(() => {
|
|
19
|
+
const _ = rerenderCount.value;
|
|
20
|
+
return slots.default?.()?.flatMap(transformSlot).filter(Boolean) || [];
|
|
21
|
+
});
|
|
22
|
+
function transformSlot(slot, index) {
|
|
23
|
+
if (typeof slot.type === "symbol") {
|
|
24
|
+
return slot.children?.map(transformSlot);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
index,
|
|
28
|
+
label: slot.props?.label || `${index}`,
|
|
29
|
+
description: slot.props?.description,
|
|
30
|
+
icon: slot.props?.icon,
|
|
31
|
+
component: slot
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
onBeforeUpdate(() => rerenderCount.value++);
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<UAccordion :type="type" :items="items" :unmount-on-hide="false" :class="props.class" :ui="transformUI(ui())">
|
|
39
|
+
<template #content="{ item }">
|
|
40
|
+
<component :is="item.component" />
|
|
41
|
+
</template>
|
|
42
|
+
</UAccordion>
|
|
43
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ProseAccordionProps {
|
|
2
|
+
type?: 'single' | 'multiple';
|
|
3
|
+
class?: any;
|
|
4
|
+
}
|
|
5
|
+
export interface ProseAccordionSlots {
|
|
6
|
+
default(props?: {}): any;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseAccordionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseAccordionProps> & Readonly<{}>, {
|
|
9
|
+
type: "single" | "multiple";
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseAccordionSlots>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/accordion-item";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
label: { type: String, required: true },
|
|
11
|
+
description: { type: String, required: false },
|
|
12
|
+
class: { type: null, required: false }
|
|
13
|
+
});
|
|
14
|
+
defineSlots();
|
|
15
|
+
const appConfig = useAppConfig();
|
|
16
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.accordionItem || {} }));
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div :class="ui({ class: props.class })">
|
|
21
|
+
<slot>
|
|
22
|
+
{{ description }}
|
|
23
|
+
</slot>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ProseAccordionItemProps {
|
|
2
|
+
label: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
class?: any;
|
|
5
|
+
}
|
|
6
|
+
export interface ProseAccordionItemSlots {
|
|
7
|
+
default(props?: {}): any;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseAccordionItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseAccordionItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseAccordionItemSlots>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/badge";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
class: { type: null, required: false }
|
|
11
|
+
});
|
|
12
|
+
defineSlots();
|
|
13
|
+
const appConfig = useAppConfig();
|
|
14
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.badge || {} }));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<UBadge color="primary" variant="subtle" :class="ui({ class: props.class })">
|
|
19
|
+
<slot mdc-unwrap="p" />
|
|
20
|
+
</UBadge>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ProseBadgeProps {
|
|
2
|
+
class?: any;
|
|
3
|
+
}
|
|
4
|
+
export interface ProseBadgeSlots {
|
|
5
|
+
default(props?: {}): any;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseBadgeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseBadgeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseBadgeSlots>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/blockquote";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
class: { type: null, required: false }
|
|
11
|
+
});
|
|
12
|
+
defineSlots();
|
|
13
|
+
const appConfig = useAppConfig();
|
|
14
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.blockquote || {} }));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<blockquote :class="ui({ class: props.class })">
|
|
19
|
+
<slot />
|
|
20
|
+
</blockquote>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ProseBlockquoteProps {
|
|
2
|
+
class?: any;
|
|
3
|
+
}
|
|
4
|
+
export interface ProseBlockquoteSlots {
|
|
5
|
+
default(props?: {}): any;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseBlockquoteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseBlockquoteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseBlockquoteSlots>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|