@eslamdevui/ui 3.2.0-beta.2 → 3.2.1
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/auth-form.ts +20 -0
- package/.nuxt/ui/banner.ts +105 -0
- package/.nuxt/ui/blog-post.ts +140 -0
- package/.nuxt/ui/blog-posts.ts +14 -0
- package/.nuxt/ui/changelog-version.ts +41 -0
- package/.nuxt/ui/changelog-versions.ts +8 -0
- package/.nuxt/ui/chat-palette.ts +8 -0
- package/.nuxt/ui/content/content-navigation.ts +6 -4
- package/.nuxt/ui/content-navigation.ts +6 -4
- package/.nuxt/ui/footer-columns.ts +28 -0
- package/.nuxt/ui/footer.ts +11 -0
- package/.nuxt/ui/header.ts +30 -0
- package/.nuxt/ui/index.ts +32 -1
- package/.nuxt/ui/main.ts +3 -0
- package/.nuxt/ui/page-accordion.ts +7 -0
- package/.nuxt/ui/page-anchors.ts +30 -0
- package/.nuxt/ui/page-aside.ts +10 -0
- package/.nuxt/ui/page-body.ts +3 -0
- package/.nuxt/ui/page-card.ts +276 -0
- package/.nuxt/ui/page-columns.ts +3 -0
- package/.nuxt/ui/page-cta.ts +72 -0
- package/.nuxt/ui/page-feature.ts +31 -0
- package/.nuxt/ui/page-grid.ts +3 -0
- package/.nuxt/ui/page-header.ts +18 -0
- package/.nuxt/ui/page-hero.ts +46 -0
- package/.nuxt/ui/page-links.ts +25 -0
- package/.nuxt/ui/page-list.ts +8 -0
- package/.nuxt/ui/page-logos.ts +15 -0
- package/.nuxt/ui/page-marquee.ts +66 -0
- package/.nuxt/ui/page-section.ts +88 -0
- package/.nuxt/ui/page.ts +32 -0
- package/.nuxt/ui/pricing-plan.ts +101 -0
- package/.nuxt/ui/pricing-plans.ts +27 -0
- package/.nuxt/ui/pricing-table.ts +51 -0
- package/.nuxt/ui/user.ts +106 -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 -236
- package/cli/utils.mjs +31 -31
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- 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/AuthForm.vue +195 -0
- package/dist/runtime/components/AuthForm.vue.d.ts +85 -0
- 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/Banner.vue +113 -0
- package/dist/runtime/components/Banner.vue.d.ts +68 -0
- package/dist/runtime/components/BlogPost.vue +141 -0
- package/dist/runtime/components/BlogPost.vue.d.ts +59 -0
- package/dist/runtime/components/BlogPosts.vue +33 -0
- package/dist/runtime/components/BlogPosts.vue.d.ts +30 -0
- 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/ChangelogVersion.vue +165 -0
- package/dist/runtime/components/ChangelogVersion.vue.d.ts +58 -0
- package/dist/runtime/components/ChangelogVersions.vue +54 -0
- package/dist/runtime/components/ChangelogVersions.vue.d.ts +74 -0
- package/dist/runtime/components/ChatMessage.vue +35 -35
- package/dist/runtime/components/ChatMessages.vue +55 -55
- package/dist/runtime/components/ChatPalette.vue +32 -0
- package/dist/runtime/components/ChatPalette.vue.d.ts +24 -0
- package/dist/runtime/components/ChatPrompt.vue +26 -26
- package/dist/runtime/components/ChatPrompt.vue.d.ts +1 -1
- 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/CommandPalette.vue.d.ts +3 -3
- 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 +40 -40
- package/dist/runtime/components/DashboardPanel.vue +27 -27
- package/dist/runtime/components/DashboardResizeHandle.vue +7 -7
- package/dist/runtime/components/DashboardSearch.vue +20 -20
- package/dist/runtime/components/DashboardSearchButton.vue +43 -43
- package/dist/runtime/components/DashboardSidebar.vue +74 -74
- package/dist/runtime/components/DashboardSidebarCollapse.vue +7 -7
- package/dist/runtime/components/DashboardSidebarToggle.vue +7 -7
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
- 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 +22 -22
- package/dist/runtime/components/Error.vue.d.ts +1 -1
- package/dist/runtime/components/Footer.vue +44 -0
- package/dist/runtime/components/Footer.vue.d.ts +29 -0
- package/dist/runtime/components/FooterColumns.vue +68 -0
- package/dist/runtime/components/FooterColumns.vue.d.ts +52 -0
- package/dist/runtime/components/Form.vue +8 -8
- package/dist/runtime/components/FormField.vue +37 -37
- package/dist/runtime/components/Header.vue +137 -0
- package/dist/runtime/components/Header.vue.d.ts +72 -0
- 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/InputMenu.vue.d.ts +3 -3
- 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/Main.vue +23 -0
- package/dist/runtime/components/Main.vue.d.ts +20 -0
- 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/Page.vue +37 -0
- package/dist/runtime/components/Page.vue.d.ts +25 -0
- package/dist/runtime/components/PageAccordion.vue +26 -0
- package/dist/runtime/components/PageAccordion.vue.d.ts +21 -0
- package/dist/runtime/components/PageAnchors.vue +50 -0
- package/dist/runtime/components/PageAnchors.vue.d.ts +42 -0
- package/dist/runtime/components/PageAside.vue +36 -0
- package/dist/runtime/components/PageAside.vue.d.ts +27 -0
- package/dist/runtime/components/PageBody.vue +23 -0
- package/dist/runtime/components/PageBody.vue.d.ts +18 -0
- package/dist/runtime/components/PageCTA.vue +58 -0
- package/dist/runtime/components/PageCTA.vue.d.ts +49 -0
- package/dist/runtime/components/PageCard.vue +121 -0
- package/dist/runtime/components/PageCard.vue.d.ts +71 -0
- package/dist/runtime/components/PageColumns.vue +23 -0
- package/dist/runtime/components/PageColumns.vue.d.ts +18 -0
- package/dist/runtime/components/PageFeature.vue +71 -0
- package/dist/runtime/components/PageFeature.vue.d.ts +43 -0
- package/dist/runtime/components/PageGrid.vue +23 -0
- package/dist/runtime/components/PageGrid.vue.d.ts +18 -0
- package/dist/runtime/components/PageHeader.vue +58 -0
- package/dist/runtime/components/PageHeader.vue.d.ts +35 -0
- package/dist/runtime/components/PageHero.vue +67 -0
- package/dist/runtime/components/PageHero.vue.d.ts +49 -0
- package/dist/runtime/components/PageLinks.vue +55 -0
- package/dist/runtime/components/PageLinks.vue.d.ts +44 -0
- package/dist/runtime/components/PageList.vue +24 -0
- package/dist/runtime/components/PageList.vue.d.ts +21 -0
- package/dist/runtime/components/PageLogos.vue +64 -0
- package/dist/runtime/components/PageLogos.vue.d.ts +32 -0
- package/dist/runtime/components/PageMarquee.vue +40 -0
- package/dist/runtime/components/PageMarquee.vue.d.ts +30 -0
- package/dist/runtime/components/PageSection.vue +88 -0
- package/dist/runtime/components/PageSection.vue.d.ts +64 -0
- 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/PricingPlan.vue +129 -0
- package/dist/runtime/components/PricingPlan.vue.d.ts +109 -0
- package/dist/runtime/components/PricingPlans.vue +45 -0
- package/dist/runtime/components/PricingPlans.vue.d.ts +41 -0
- package/dist/runtime/components/PricingTable.vue +235 -0
- package/dist/runtime/components/PricingTable.vue.d.ts +98 -0
- 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/SelectMenu.vue.d.ts +3 -3
- 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 +38 -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/User.vue +69 -0
- package/dist/runtime/components/User.vue.d.ts +46 -0
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeButton.vue +16 -16
- 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/ColorModeSwitch.vue +19 -19
- package/dist/runtime/components/content/ContentNavigation.vue +109 -109
- package/dist/runtime/components/content/ContentSearch.vue +25 -25
- package/dist/runtime/components/content/ContentSearchButton.vue +38 -38
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +58 -12
- package/dist/runtime/components/content/ContentSurround.vue +31 -31
- package/dist/runtime/components/content/ContentSurround.vue.d.ts +52 -59
- package/dist/runtime/components/content/ContentToc.vue +88 -76
- package/dist/runtime/components/content/ContentToc.vue.d.ts +86 -88
- package/dist/runtime/components/locale/LocaleSelect.vue +20 -20
- package/dist/runtime/components/prose/A.vue +3 -3
- package/dist/runtime/components/prose/Accordion.vue +5 -5
- package/dist/runtime/components/prose/AccordionItem.vue +5 -5
- package/dist/runtime/components/prose/Badge.vue +3 -3
- package/dist/runtime/components/prose/Blockquote.vue +3 -3
- package/dist/runtime/components/prose/Callout.vue +27 -27
- package/dist/runtime/components/prose/Card.vue +43 -43
- package/dist/runtime/components/prose/CardGroup.vue +3 -3
- package/dist/runtime/components/prose/Code.vue +3 -3
- package/dist/runtime/components/prose/CodeCollapse.vue +16 -16
- package/dist/runtime/components/prose/CodeGroup.vue +15 -15
- package/dist/runtime/components/prose/CodeIcon.vue +1 -1
- package/dist/runtime/components/prose/CodePreview.vue +9 -9
- package/dist/runtime/components/prose/CodeTree.vue +61 -61
- package/dist/runtime/components/prose/Collapsible.vue +15 -15
- package/dist/runtime/components/prose/Em.vue +1 -1
- package/dist/runtime/components/prose/Field.vue +23 -23
- package/dist/runtime/components/prose/FieldGroup.vue +3 -3
- package/dist/runtime/components/prose/H1.vue +6 -6
- package/dist/runtime/components/prose/H2.vue +10 -10
- package/dist/runtime/components/prose/H3.vue +10 -10
- package/dist/runtime/components/prose/H4.vue +6 -6
- package/dist/runtime/components/prose/Hr.vue +1 -1
- package/dist/runtime/components/prose/Icon.vue +1 -1
- package/dist/runtime/components/prose/Img.vue +8 -8
- package/dist/runtime/components/prose/Kbd.vue +1 -1
- package/dist/runtime/components/prose/Li.vue +3 -3
- package/dist/runtime/components/prose/Ol.vue +3 -3
- package/dist/runtime/components/prose/P.vue +3 -3
- package/dist/runtime/components/prose/Pre.vue +20 -20
- package/dist/runtime/components/prose/Script.vue +3 -3
- package/dist/runtime/components/prose/Steps.vue +3 -3
- package/dist/runtime/components/prose/Strong.vue +3 -3
- package/dist/runtime/components/prose/Table.vue +5 -5
- package/dist/runtime/components/prose/Tabs.vue +14 -14
- package/dist/runtime/components/prose/TabsItem.vue +5 -5
- package/dist/runtime/components/prose/Tbody.vue +3 -3
- package/dist/runtime/components/prose/Td.vue +3 -3
- package/dist/runtime/components/prose/Th.vue +3 -3
- package/dist/runtime/components/prose/Thead.vue +3 -3
- package/dist/runtime/components/prose/Tr.vue +3 -3
- package/dist/runtime/components/prose/Ul.vue +3 -3
- package/dist/runtime/components/prose/callout/Caution.vue +3 -3
- package/dist/runtime/components/prose/callout/Note.vue +3 -3
- package/dist/runtime/components/prose/callout/Tip.vue +3 -3
- package/dist/runtime/components/prose/callout/Warning.vue +3 -3
- 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/index.d.ts +33 -0
- package/dist/runtime/types/index.js +33 -0
- 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.DQZ75GCP.mjs → ui.DErCA3YU.mjs} +1247 -50
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
- package/vue-plugin.d.ts +5 -5
- package/.nuxt/ui/prose.ts +0 -321
|
@@ -1,12 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import theme from '#build/ui/content/content-search-button';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import type { ButtonProps, ButtonSlots, KbdProps, ComponentConfig, TooltipProps } from '../../types';
|
|
4
|
+
type ContentSearchButton = ComponentConfig<typeof theme, AppConfig, 'contentSearchButton'>;
|
|
5
|
+
export interface ContentSearchButtonProps {
|
|
6
|
+
/**
|
|
7
|
+
* The icon displayed in the button.
|
|
8
|
+
* @defaultValue appConfig.ui.icons.search
|
|
9
|
+
* @IconifyIcon
|
|
10
|
+
*/
|
|
11
|
+
icon?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The label displayed in the button.
|
|
14
|
+
* @defaultValue t('contentSearchButton.label')
|
|
15
|
+
*/
|
|
16
|
+
label?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The color of the button.
|
|
19
|
+
* @defaultValue 'neutral'
|
|
20
|
+
*/
|
|
21
|
+
color?: ButtonProps['color'];
|
|
22
|
+
/**
|
|
23
|
+
* The variant of the button.
|
|
24
|
+
* Defaults to 'outline' when not collapsed, 'ghost' when collapsed.
|
|
25
|
+
*/
|
|
26
|
+
variant?: ButtonProps['variant'];
|
|
27
|
+
size?: ButtonProps['size'];
|
|
28
|
+
/**
|
|
29
|
+
* Whether the button is collapsed.
|
|
30
|
+
* @defaultValue true
|
|
31
|
+
*/
|
|
32
|
+
collapsed?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Display a tooltip on the button when is collapsed with the button label.
|
|
35
|
+
* This has priority over the global `tooltip` prop.
|
|
36
|
+
*/
|
|
37
|
+
tooltip?: boolean | TooltipProps;
|
|
38
|
+
/**
|
|
39
|
+
* The keyboard keys to display in the button.
|
|
40
|
+
* `{ variant: 'subtle' }`{lang="ts-type"}
|
|
41
|
+
* @defaultValue ['meta', 'k']
|
|
42
|
+
*/
|
|
43
|
+
kbds?: KbdProps['value'][] | KbdProps[];
|
|
44
|
+
ui?: ContentSearchButton['slots'] & ButtonProps['ui'];
|
|
45
|
+
class?: any;
|
|
46
|
+
}
|
|
47
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ContentSearchButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ContentSearchButtonProps> & Readonly<{}>, {
|
|
48
|
+
color: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
|
|
49
|
+
tooltip: boolean | TooltipProps;
|
|
50
|
+
kbds: KbdProps["value"][] | KbdProps[];
|
|
51
|
+
collapsed: boolean;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ButtonSlots>;
|
|
53
|
+
export default _default;
|
|
54
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
55
|
+
new (): {
|
|
56
|
+
$slots: S;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import theme from "#build/ui
|
|
2
|
+
import theme from "#build/ui/content/content-surround";
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
@@ -25,37 +25,37 @@ const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate({
|
|
|
25
25
|
direction: String
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.
|
|
28
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.contentSurround || {} })());
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
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>
|
|
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
61
|
</template>
|
|
@@ -1,59 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
} & {}
|
|
1
|
+
import theme from '#build/ui/content/content-surround';
|
|
2
|
+
import type { ContentNavigationItem } from '@nuxt/content';
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
4
|
+
import type { ComponentConfig } from '../../types';
|
|
5
|
+
type ContentSurround = ComponentConfig<typeof theme, AppConfig, 'contentSurround'>;
|
|
6
|
+
export interface ContentSurroundLink extends ContentNavigationItem {
|
|
7
|
+
description?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @IconifyIcon
|
|
10
|
+
*/
|
|
11
|
+
icon?: string;
|
|
12
|
+
class?: any;
|
|
13
|
+
ui?: Pick<ContentSurround['slots'], 'link' | 'linkLeading' | 'linkLeadingIcon' | 'linkTitle' | 'linkDescription'>;
|
|
14
|
+
}
|
|
15
|
+
export interface ContentSurroundProps<T extends ContentSurroundLink = ContentSurroundLink> {
|
|
16
|
+
/**
|
|
17
|
+
* The element or component this component should render as.
|
|
18
|
+
* @defaultValue 'div'
|
|
19
|
+
*/
|
|
20
|
+
as?: any;
|
|
21
|
+
/**
|
|
22
|
+
* The icon displayed in the prev link.
|
|
23
|
+
* @defaultValue appConfig.ui.icons.arrowLeft
|
|
24
|
+
* @IconifyIcon
|
|
25
|
+
*/
|
|
26
|
+
prevIcon?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The icon displayed in the next link.
|
|
29
|
+
* @defaultValue appConfig.ui.icons.arrowRight
|
|
30
|
+
* @IconifyIcon
|
|
31
|
+
*/
|
|
32
|
+
nextIcon?: string;
|
|
33
|
+
surround?: T[];
|
|
34
|
+
class?: any;
|
|
35
|
+
ui?: ContentSurround['slots'];
|
|
36
|
+
}
|
|
37
|
+
type SlotProps<T> = (props: {
|
|
38
|
+
link: T;
|
|
39
|
+
}) => any;
|
|
40
|
+
export interface ContentSurroundSlots<T extends ContentSurroundLink = ContentSurroundLink> {
|
|
41
|
+
'link': SlotProps<T>;
|
|
42
|
+
'link-leading': SlotProps<T>;
|
|
43
|
+
'link-title': SlotProps<T>;
|
|
44
|
+
'link-description': SlotProps<T>;
|
|
45
|
+
}
|
|
46
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ContentSurroundProps<ContentSurroundLink>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ContentSurroundProps<ContentSurroundLink>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ContentSurroundSlots<ContentSurroundLink>>;
|
|
47
|
+
export default _default;
|
|
48
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
49
|
+
new (): {
|
|
50
|
+
$slots: S;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import theme from "#build/ui
|
|
2
|
+
import theme from "#build/ui/content/content-toc";
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
@@ -30,14 +30,9 @@ const { t } = useLocalePro();
|
|
|
30
30
|
const router = useRouter();
|
|
31
31
|
const appConfig = useAppConfig();
|
|
32
32
|
const { activeHeadings, updateHeadings } = useScrollspy();
|
|
33
|
-
const [DefineListTemplate, ReuseListTemplate] = createReusableTemplate(
|
|
34
|
-
props: {
|
|
35
|
-
links: Array,
|
|
36
|
-
level: Number
|
|
37
|
-
}
|
|
38
|
-
});
|
|
33
|
+
const [DefineListTemplate, ReuseListTemplate] = createReusableTemplate();
|
|
39
34
|
const [DefineTriggerTemplate, ReuseTriggerTemplate] = createReusableTemplate();
|
|
40
|
-
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.
|
|
35
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.contentToc || {} })({
|
|
41
36
|
color: props.color,
|
|
42
37
|
highlight: props.highlight,
|
|
43
38
|
highlightColor: props.highlightColor || props.color
|
|
@@ -75,72 +70,89 @@ nuxtApp.hooks.hook("page:transition:finish", () => {
|
|
|
75
70
|
</script>
|
|
76
71
|
|
|
77
72
|
<template>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
73
|
+
<DefineListTemplate v-slot="{ links, level }">
|
|
74
|
+
<ul
|
|
75
|
+
:class="level > 0 ? ui.listWithChildren({ class: props.ui?.listWithChildren }) : ui.list({ class: props.ui?.list })"
|
|
76
|
+
>
|
|
77
|
+
<li
|
|
78
|
+
v-for="(link, index) in links"
|
|
79
|
+
:key="index"
|
|
80
|
+
: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] })"
|
|
81
|
+
>
|
|
82
|
+
<a
|
|
83
|
+
:href="`#${link.id}`"
|
|
84
|
+
:class="ui.link({ class: [props.ui?.link, link.ui?.link, link.class], active: activeHeadings.includes(link.id) })"
|
|
85
|
+
@click.prevent="scrollToHeading(link.id)"
|
|
86
|
+
>
|
|
87
|
+
<slot name="link" :link="link">
|
|
88
|
+
<span :class="ui.linkText({ class: [props.ui?.linkText, link.ui?.linkText] })">
|
|
89
|
+
{{ link.text }}
|
|
90
|
+
</span>
|
|
91
|
+
</slot>
|
|
92
|
+
</a>
|
|
93
|
+
|
|
94
|
+
<ReuseListTemplate v-if="link.children?.length" :links="link.children" :level="level + 1" />
|
|
95
|
+
</li>
|
|
96
|
+
</ul>
|
|
97
|
+
</DefineListTemplate>
|
|
98
|
+
|
|
99
|
+
<DefineTriggerTemplate v-slot="{ open }">
|
|
100
|
+
<slot name="leading" :open="open" />
|
|
101
|
+
|
|
102
|
+
<span :class="ui.title({ class: props.ui?.title })">
|
|
103
|
+
<slot :open="open">{{ title || t("contentToc.title") }}</slot>
|
|
104
|
+
</span>
|
|
105
|
+
|
|
106
|
+
<span :class="ui.trailing({ class: props.ui?.trailing })">
|
|
107
|
+
<slot name="trailing" :open="open">
|
|
108
|
+
<UIcon
|
|
109
|
+
:name="trailingIcon || appConfig.ui.icons.chevronDown"
|
|
110
|
+
:class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
|
|
111
|
+
/>
|
|
112
|
+
</slot>
|
|
113
|
+
</span>
|
|
114
|
+
</DefineTriggerTemplate>
|
|
115
|
+
|
|
116
|
+
<CollapsibleRoot
|
|
117
|
+
v-slot="{ open }"
|
|
118
|
+
v-bind="rootProps"
|
|
119
|
+
:default-open="defaultOpen"
|
|
120
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
121
|
+
>
|
|
122
|
+
<div :class="ui.container({ class: props.ui?.container })">
|
|
123
|
+
<div v-if="!!slots.top" :class="ui.top({ class: props.ui?.top })">
|
|
124
|
+
<slot name="top" :links="links" />
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<template v-if="links?.length">
|
|
128
|
+
<CollapsibleTrigger :class="ui.trigger({ class: 'lg:hidden' })">
|
|
129
|
+
<ReuseTriggerTemplate :open="open" />
|
|
130
|
+
</CollapsibleTrigger>
|
|
131
|
+
|
|
132
|
+
<CollapsibleContent :class="ui.content({ class: [props.ui?.content, 'lg:hidden'] })">
|
|
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
|
+
</CollapsibleContent>
|
|
139
|
+
|
|
140
|
+
<p :class="ui.trigger({ class: 'hidden lg:flex' })">
|
|
141
|
+
<ReuseTriggerTemplate :open="open" />
|
|
142
|
+
</p>
|
|
143
|
+
|
|
144
|
+
<div :class="ui.content({ class: [props.ui?.content, 'hidden lg:flex'] })">
|
|
145
|
+
<div v-if="highlight" :class="ui.indicator({ class: props.ui?.indicator })" :style="indicatorStyle" />
|
|
146
|
+
|
|
147
|
+
<slot name="content" :links="links">
|
|
148
|
+
<ReuseListTemplate :links="links" :level="0" />
|
|
149
|
+
</slot>
|
|
150
|
+
</div>
|
|
151
|
+
</template>
|
|
152
|
+
|
|
153
|
+
<div v-if="!!slots.bottom" :class="ui.bottom({ class: props.ui?.bottom })">
|
|
154
|
+
<slot name="bottom" :links="links" />
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</CollapsibleRoot>
|
|
146
158
|
</template>
|
|
@@ -1,88 +1,86 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
[K in keyof T]: T[K];
|
|
88
|
-
} & {}
|
|
1
|
+
import theme from '#build/ui/content/content-toc';
|
|
2
|
+
import type { CollapsibleRootProps, CollapsibleRootEmits } from 'reka-ui';
|
|
3
|
+
import type { TocLink } from '@nuxt/content';
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
5
|
+
import type { ComponentConfig } from '../../types';
|
|
6
|
+
type ContentToc = ComponentConfig<typeof theme, AppConfig, 'contentToc'>;
|
|
7
|
+
export type ContentTocLink = TocLink & {
|
|
8
|
+
class?: any;
|
|
9
|
+
ui?: Pick<ContentToc['slots'], 'item' | 'itemWithChildren' | 'link' | 'linkText'>;
|
|
10
|
+
};
|
|
11
|
+
export interface ContentTocProps<T extends ContentTocLink = ContentTocLink> extends Pick<CollapsibleRootProps, 'defaultOpen' | 'open'> {
|
|
12
|
+
/**
|
|
13
|
+
* The element or component this component should render as.
|
|
14
|
+
* @defaultValue 'nav'
|
|
15
|
+
*/
|
|
16
|
+
as?: any;
|
|
17
|
+
/**
|
|
18
|
+
* The icon displayed to collapse the content.
|
|
19
|
+
* @defaultValue appConfig.ui.icons.chevronDown
|
|
20
|
+
* @IconifyIcon
|
|
21
|
+
*/
|
|
22
|
+
trailingIcon?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The title of the table of contents.
|
|
25
|
+
* @defaultValue t('contentToc.title')
|
|
26
|
+
*/
|
|
27
|
+
title?: string;
|
|
28
|
+
/**
|
|
29
|
+
* @defaultValue 'primary'
|
|
30
|
+
*/
|
|
31
|
+
color?: ContentToc['variants']['color'];
|
|
32
|
+
/**
|
|
33
|
+
* Display a line next to the active link.
|
|
34
|
+
* @defaultValue false
|
|
35
|
+
*/
|
|
36
|
+
highlight?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @defaultValue 'primary'
|
|
39
|
+
*/
|
|
40
|
+
highlightColor?: ContentToc['variants']['highlightColor'];
|
|
41
|
+
links?: T[];
|
|
42
|
+
class?: any;
|
|
43
|
+
ui?: ContentToc['slots'];
|
|
44
|
+
}
|
|
45
|
+
export type ContentTocEmits = CollapsibleRootEmits & {
|
|
46
|
+
move: [id: string];
|
|
47
|
+
};
|
|
48
|
+
type SlotProps<T> = (props: {
|
|
49
|
+
link: T;
|
|
50
|
+
}) => any;
|
|
51
|
+
export interface ContentTocSlots<T extends ContentTocLink = ContentTocLink> {
|
|
52
|
+
leading(props: {
|
|
53
|
+
open: boolean;
|
|
54
|
+
}): any;
|
|
55
|
+
default(props: {
|
|
56
|
+
open: boolean;
|
|
57
|
+
}): any;
|
|
58
|
+
trailing(props: {
|
|
59
|
+
open: boolean;
|
|
60
|
+
}): any;
|
|
61
|
+
content(props: {
|
|
62
|
+
links: T[];
|
|
63
|
+
}): any;
|
|
64
|
+
link: SlotProps<T>;
|
|
65
|
+
top(props: {
|
|
66
|
+
links?: T[];
|
|
67
|
+
}): any;
|
|
68
|
+
bottom(props: {
|
|
69
|
+
links?: T[];
|
|
70
|
+
}): any;
|
|
71
|
+
}
|
|
72
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ContentTocProps<ContentTocLink>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
73
|
+
"update:open": (value: boolean) => any;
|
|
74
|
+
move: (id: string) => any;
|
|
75
|
+
}, string, import("vue").PublicProps, Readonly<ContentTocProps<ContentTocLink>> & Readonly<{
|
|
76
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
77
|
+
onMove?: ((id: string) => any) | undefined;
|
|
78
|
+
}>, {
|
|
79
|
+
as: any;
|
|
80
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ContentTocSlots<ContentTocLink>>;
|
|
81
|
+
export default _default;
|
|
82
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
83
|
+
new (): {
|
|
84
|
+
$slots: S;
|
|
85
|
+
};
|
|
86
|
+
};
|