@eslamdevui/ui 3.2.0 → 3.2.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/auth-form.ts +20 -0
- package/.nuxt/ui/badge.ts +5 -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/button-group.ts +13 -0
- package/.nuxt/ui/button.ts +5 -0
- package/.nuxt/ui/carousel.ts +5 -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 +341 -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-navigation.ts +6 -4
- package/.nuxt/ui/content-surround.ts +5 -0
- 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/footer-columns.ts +28 -0
- package/.nuxt/ui/footer.ts +11 -0
- package/.nuxt/ui/header.ts +30 -0
- package/.nuxt/ui/index.ts +80 -2
- 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/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/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/.nuxt/ui/user.ts +106 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/AuthForm.vue +195 -0
- package/dist/runtime/components/AuthForm.vue.d.ts +85 -0
- 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/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/ChatPalette.vue +32 -0
- package/dist/runtime/components/ChatPalette.vue.d.ts +24 -0
- package/dist/runtime/components/ChatPrompt.vue.d.ts +1 -1
- package/dist/runtime/components/CommandPalette.vue.d.ts +3 -3
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
- 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/Header.vue +137 -0
- package/dist/runtime/components/Header.vue.d.ts +72 -0
- package/dist/runtime/components/InputMenu.vue.d.ts +3 -3
- package/dist/runtime/components/Main.vue +23 -0
- package/dist/runtime/components/Main.vue.d.ts +20 -0
- 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 +32 -0
- package/dist/runtime/components/PageSection.vue +88 -0
- package/dist/runtime/components/PageSection.vue.d.ts +64 -0
- 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/SelectMenu.vue.d.ts +3 -3
- package/dist/runtime/components/Tabs.vue +1 -0
- package/dist/runtime/components/User.vue +69 -0
- package/dist/runtime/components/User.vue.d.ts +46 -0
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +57 -11
- package/dist/runtime/components/content/ContentSurround.vue +2 -2
- package/dist/runtime/components/content/ContentSurround.vue.d.ts +45 -52
- package/dist/runtime/components/content/ContentToc.vue +27 -15
- package/dist/runtime/components/content/ContentToc.vue.d.ts +79 -81
- package/dist/runtime/types/index.d.ts +33 -0
- package/dist/runtime/types/index.js +33 -0
- 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/.nuxt/ui/prose.ts +0 -321
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import theme from '#build/ui/pricing-table';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import type { ComponentConfig, PricingPlanProps } from '../types';
|
|
4
|
+
type PricingTable = ComponentConfig<typeof theme, AppConfig, 'pricingTable'>;
|
|
5
|
+
type DynamicSlots<T extends {
|
|
6
|
+
id: string;
|
|
7
|
+
}, S extends string | undefined = undefined> = {
|
|
8
|
+
[K in T['id'] as K extends string ? S extends string ? (K | `${K}-${S}`) : K : never]?: (props: {
|
|
9
|
+
tier: Extract<T, {
|
|
10
|
+
id: K extends `${infer Base}-${S}` ? Base : K;
|
|
11
|
+
}>;
|
|
12
|
+
}) => any;
|
|
13
|
+
};
|
|
14
|
+
type FeatureDynamicSlots<T extends PricingTableSectionFeature, S extends string | undefined = undefined> = {
|
|
15
|
+
[K in (T['id'] extends string ? T['id'] : string) as K extends string ? S extends string ? (`feature-${K}` | `feature-${K}-${S}`) : `feature-${K}` : never]?: (props: {
|
|
16
|
+
feature: T;
|
|
17
|
+
tier: PricingTableTier;
|
|
18
|
+
section: PricingTableSection;
|
|
19
|
+
}) => any;
|
|
20
|
+
};
|
|
21
|
+
type SectionDynamicSlots<T extends PricingTableSection, S extends string | undefined = undefined> = {
|
|
22
|
+
[K in (T['id'] extends string ? T['id'] : string) as K extends string ? S extends string ? (`section-${K}` | `section-${K}-${S}`) : `section-${K}` : never]?: (props: {
|
|
23
|
+
section: T;
|
|
24
|
+
}) => any;
|
|
25
|
+
};
|
|
26
|
+
export type PricingTableTier = Pick<PricingPlanProps, 'title' | 'description' | 'badge' | 'billingCycle' | 'billingPeriod' | 'price' | 'discount' | 'button' | 'highlight'> & {
|
|
27
|
+
id: string;
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
};
|
|
30
|
+
export type PricingTableSectionFeature<T extends PricingTableTier = PricingTableTier> = {
|
|
31
|
+
id?: string;
|
|
32
|
+
title: string;
|
|
33
|
+
tiers?: {
|
|
34
|
+
[K in Extract<T['id'], string>]: boolean | number | string;
|
|
35
|
+
} & Record<string, boolean | number | string>;
|
|
36
|
+
};
|
|
37
|
+
export interface PricingTableSection<T extends PricingTableTier = PricingTableTier> {
|
|
38
|
+
id?: string;
|
|
39
|
+
title: string;
|
|
40
|
+
features: PricingTableSectionFeature<T>[];
|
|
41
|
+
}
|
|
42
|
+
export interface PricingTableProps<T extends PricingTableTier = PricingTableTier> {
|
|
43
|
+
/**
|
|
44
|
+
* The element or component this component should render as.
|
|
45
|
+
* @defaultValue 'div'
|
|
46
|
+
*/
|
|
47
|
+
as?: any;
|
|
48
|
+
/**
|
|
49
|
+
* The caption to display above the table.
|
|
50
|
+
* @defeaultValue t('pricingTable.caption')
|
|
51
|
+
*/
|
|
52
|
+
caption?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The pricing tiers to display in the table.
|
|
55
|
+
* Each tier represents a pricing plan with its own title, description, price, and features.
|
|
56
|
+
*/
|
|
57
|
+
tiers: T[];
|
|
58
|
+
/**
|
|
59
|
+
* The sections of features to display in the table.
|
|
60
|
+
* Each section contains a title and a list of features with their availability in each tier.
|
|
61
|
+
*/
|
|
62
|
+
sections: PricingTableSection<T>[];
|
|
63
|
+
class?: any;
|
|
64
|
+
ui?: PricingTable['slots'];
|
|
65
|
+
}
|
|
66
|
+
type SlotProps<T extends PricingTableTier> = (props: {
|
|
67
|
+
tier: T;
|
|
68
|
+
}) => any;
|
|
69
|
+
export type PricingTableSlots<T extends PricingTableTier = PricingTableTier> = {
|
|
70
|
+
'caption': (props?: {}) => any;
|
|
71
|
+
'tier': SlotProps<T>;
|
|
72
|
+
'tier-title': SlotProps<T>;
|
|
73
|
+
'tier-description': SlotProps<T>;
|
|
74
|
+
'tier-badge': SlotProps<T>;
|
|
75
|
+
'tier-button': SlotProps<T>;
|
|
76
|
+
'tier-billing': SlotProps<T>;
|
|
77
|
+
'tier-discount': SlotProps<T>;
|
|
78
|
+
'tier-price': SlotProps<T>;
|
|
79
|
+
'section-title': (props: {
|
|
80
|
+
section: PricingTableSection<T>;
|
|
81
|
+
}) => any;
|
|
82
|
+
'feature-title': (props: {
|
|
83
|
+
feature: PricingTableSectionFeature<T>;
|
|
84
|
+
section: PricingTableSection<T>;
|
|
85
|
+
}) => any;
|
|
86
|
+
'feature-value': (props: {
|
|
87
|
+
feature: PricingTableSectionFeature<T>;
|
|
88
|
+
tier: T;
|
|
89
|
+
section: PricingTableSection<T>;
|
|
90
|
+
}) => any;
|
|
91
|
+
} & DynamicSlots<T, 'title' | 'description' | 'badge' | 'button' | 'billing' | 'discount' | 'price'> & FeatureDynamicSlots<PricingTableSectionFeature<T>, 'title' | 'value'> & SectionDynamicSlots<PricingTableSection<T>, 'title'>;
|
|
92
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PricingTableProps<PricingTableTier>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PricingTableProps<PricingTableTier>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PricingTableSlots<PricingTableTier>>;
|
|
93
|
+
export default _default;
|
|
94
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
95
|
+
new (): {
|
|
96
|
+
$slots: S;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
@@ -175,11 +175,11 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
|
|
|
175
175
|
readonly onFocus?: ((payload: FocusEvent) => any) | undefined;
|
|
176
176
|
readonly onCreate?: ((item: string) => any) | undefined;
|
|
177
177
|
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
178
|
-
readonly "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
|
|
179
178
|
readonly onHighlight?: ((payload: {
|
|
180
179
|
ref: HTMLElement;
|
|
181
180
|
value: GetModelValue<T, VK, M>;
|
|
182
181
|
} | undefined) => any) | undefined;
|
|
182
|
+
readonly "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
|
|
183
183
|
readonly "onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
184
184
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onUpdate:open" | "onUpdate:modelValue" | "onHighlight" | "onUpdate:searchTerm" | "onCreate"> & (SelectMenuProps<T, VK, M> & {
|
|
185
185
|
searchTerm?: string;
|
|
@@ -289,10 +289,10 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
|
|
|
289
289
|
}>): void;
|
|
290
290
|
attrs: any;
|
|
291
291
|
slots: SelectMenuSlots<T, VK, M, NestedItem<T>>;
|
|
292
|
-
emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "
|
|
292
|
+
emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "highlight", payload: {
|
|
293
293
|
ref: HTMLElement;
|
|
294
294
|
value: GetModelValue<T, VK, M>;
|
|
295
|
-
} | undefined) => void)) & ((evt: "update:searchTerm", value: string) => void);
|
|
295
|
+
} | undefined) => void) & ((evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void)) & ((evt: "update:searchTerm", value: string) => void);
|
|
296
296
|
}>) => import("vue").VNode & {
|
|
297
297
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
298
298
|
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/user";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { Primitive } from "reka-ui";
|
|
8
|
+
import { useAppConfig } from "#imports";
|
|
9
|
+
import { tv } from "../utils/tv";
|
|
10
|
+
defineOptions({ inheritAttrs: false });
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
as: { type: null, required: false },
|
|
13
|
+
name: { type: String, required: false },
|
|
14
|
+
description: { type: String, required: false },
|
|
15
|
+
avatar: { type: Object, required: false },
|
|
16
|
+
chip: { type: [Boolean, Object], required: false },
|
|
17
|
+
size: { type: null, required: false },
|
|
18
|
+
orientation: { type: null, required: false, default: "horizontal" },
|
|
19
|
+
to: { type: null, required: false },
|
|
20
|
+
target: { type: [String, Object, null], required: false },
|
|
21
|
+
onClick: { type: Function, required: false },
|
|
22
|
+
class: { type: null, required: false },
|
|
23
|
+
ui: { type: null, required: false }
|
|
24
|
+
});
|
|
25
|
+
const slots = defineSlots();
|
|
26
|
+
const appConfig = useAppConfig();
|
|
27
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.user || {} })({
|
|
28
|
+
size: props.size,
|
|
29
|
+
orientation: props.orientation,
|
|
30
|
+
to: !!props.to || !!props.onClick
|
|
31
|
+
}));
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<Primitive :as="as" :data-orientation="orientation" :class="ui.root({ class: [props.ui?.root, props.class] })" @click="onClick">
|
|
36
|
+
<slot name="avatar">
|
|
37
|
+
<UChip v-if="chip && avatar" inset v-bind="typeof chip === 'object' ? chip : {}" :size="size">
|
|
38
|
+
<UAvatar :alt="name" v-bind="avatar" :size="size" :class="ui.avatar({ class: props.ui?.avatar })" />
|
|
39
|
+
</UChip>
|
|
40
|
+
<UAvatar v-else-if="avatar" :alt="name" v-bind="avatar" :size="size" :class="ui.avatar({ class: props.ui?.avatar })" />
|
|
41
|
+
</slot>
|
|
42
|
+
|
|
43
|
+
<div :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
44
|
+
<ULink
|
|
45
|
+
v-if="to"
|
|
46
|
+
:aria-label="name"
|
|
47
|
+
v-bind="{ to, target, ...$attrs }"
|
|
48
|
+
class="focus:outline-none peer"
|
|
49
|
+
tabindex="-1"
|
|
50
|
+
raw
|
|
51
|
+
>
|
|
52
|
+
<span class="absolute inset-0" aria-hidden="true" />
|
|
53
|
+
</ULink>
|
|
54
|
+
|
|
55
|
+
<slot>
|
|
56
|
+
<p v-if="name || !!slots.name" :class="ui.name({ class: props.ui?.name })">
|
|
57
|
+
<slot name="name">
|
|
58
|
+
{{ name }}
|
|
59
|
+
</slot>
|
|
60
|
+
</p>
|
|
61
|
+
<p v-if="description || !!slots.description" :class="ui.description({ class: props.ui?.description })">
|
|
62
|
+
<slot name="description">
|
|
63
|
+
{{ description }}
|
|
64
|
+
</slot>
|
|
65
|
+
</p>
|
|
66
|
+
</slot>
|
|
67
|
+
</div>
|
|
68
|
+
</Primitive>
|
|
69
|
+
</template>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import theme from '#build/ui/user';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import type { AvatarProps, ChipProps, LinkProps, ComponentConfig } from '../types';
|
|
4
|
+
type User = ComponentConfig<typeof theme, AppConfig, 'user'>;
|
|
5
|
+
export interface UserProps {
|
|
6
|
+
/**
|
|
7
|
+
* The element or component this component should render as.
|
|
8
|
+
* @defaultValue 'div'
|
|
9
|
+
*/
|
|
10
|
+
as?: any;
|
|
11
|
+
name?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
avatar?: Omit<AvatarProps, 'size'> & {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
chip?: boolean | Omit<ChipProps, 'size' | 'inset'>;
|
|
17
|
+
/**
|
|
18
|
+
* @defaultValue 'md'
|
|
19
|
+
*/
|
|
20
|
+
size?: User['variants']['size'];
|
|
21
|
+
/**
|
|
22
|
+
* The orientation of the user.
|
|
23
|
+
* @defaultValue 'horizontal'
|
|
24
|
+
*/
|
|
25
|
+
orientation?: User['variants']['orientation'];
|
|
26
|
+
to?: LinkProps['to'];
|
|
27
|
+
target?: LinkProps['target'];
|
|
28
|
+
onClick?: (event: MouseEvent) => void | Promise<void>;
|
|
29
|
+
class?: any;
|
|
30
|
+
ui?: User['slots'];
|
|
31
|
+
}
|
|
32
|
+
export interface UserSlots {
|
|
33
|
+
avatar(props?: {}): any;
|
|
34
|
+
name(props?: {}): any;
|
|
35
|
+
description(props?: {}): any;
|
|
36
|
+
default(props?: {}): any;
|
|
37
|
+
}
|
|
38
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<UserProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<UserProps> & Readonly<{}>, {
|
|
39
|
+
orientation: User["variants"]["orientation"];
|
|
40
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, UserSlots>;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -1,12 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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;
|
|
12
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,7 +25,7 @@ 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>
|
|
@@ -1,59 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type
|
|
5
|
-
|
|
6
|
-
type ContentSurround = ComponentConfig<typeof theme, AppConfig, 'contentSurround', 'uiPro'>
|
|
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'>;
|
|
7
6
|
export interface ContentSurroundLink extends ContentNavigationItem {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
description?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @IconifyIcon
|
|
10
|
+
*/
|
|
11
|
+
icon?: string;
|
|
12
|
+
class?: any;
|
|
13
|
+
ui?: Pick<ContentSurround['slots'], 'link' | 'linkLeading' | 'linkLeadingIcon' | 'linkTitle' | 'linkDescription'>;
|
|
15
14
|
}
|
|
16
15
|
export interface ContentSurroundProps<T extends ContentSurroundLink = ContentSurroundLink> {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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'];
|
|
37
36
|
}
|
|
38
37
|
type SlotProps<T> = (props: {
|
|
39
|
-
|
|
40
|
-
}) => any
|
|
38
|
+
link: T;
|
|
39
|
+
}) => any;
|
|
41
40
|
export interface ContentSurroundSlots<T extends ContentSurroundLink = ContentSurroundLink> {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
'link': SlotProps<T>;
|
|
42
|
+
'link-leading': SlotProps<T>;
|
|
43
|
+
'link-title': SlotProps<T>;
|
|
44
|
+
'link-description': SlotProps<T>;
|
|
46
45
|
}
|
|
47
|
-
declare const _default: <
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
__ctx?: Awaited<typeof __VLS_setup>
|
|
55
|
-
}
|
|
56
|
-
export default _default
|
|
57
|
-
type __VLS_PrettifyLocal<T> = {
|
|
58
|
-
[K in keyof T]: T[K];
|
|
59
|
-
} & {}
|
|
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,11 +70,20 @@ nuxtApp.hooks.hook("page:transition:finish", () => {
|
|
|
75
70
|
</script>
|
|
76
71
|
|
|
77
72
|
<template>
|
|
78
|
-
<!-- eslint-disable-next-line vue/no-template-shadow -->
|
|
79
73
|
<DefineListTemplate v-slot="{ links, level }">
|
|
80
|
-
<ul
|
|
81
|
-
|
|
82
|
-
|
|
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
|
+
>
|
|
83
87
|
<slot name="link" :link="link">
|
|
84
88
|
<span :class="ui.linkText({ class: [props.ui?.linkText, link.ui?.linkText] })">
|
|
85
89
|
{{ link.text }}
|
|
@@ -101,12 +105,20 @@ nuxtApp.hooks.hook("page:transition:finish", () => {
|
|
|
101
105
|
|
|
102
106
|
<span :class="ui.trailing({ class: props.ui?.trailing })">
|
|
103
107
|
<slot name="trailing" :open="open">
|
|
104
|
-
<UIcon
|
|
108
|
+
<UIcon
|
|
109
|
+
:name="trailingIcon || appConfig.ui.icons.chevronDown"
|
|
110
|
+
:class="ui.trailingIcon({ class: props.ui?.trailingIcon })"
|
|
111
|
+
/>
|
|
105
112
|
</slot>
|
|
106
113
|
</span>
|
|
107
114
|
</DefineTriggerTemplate>
|
|
108
115
|
|
|
109
|
-
<CollapsibleRoot
|
|
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
|
+
>
|
|
110
122
|
<div :class="ui.container({ class: props.ui?.container })">
|
|
111
123
|
<div v-if="!!slots.top" :class="ui.top({ class: props.ui?.top })">
|
|
112
124
|
<slot name="top" :links="links" />
|
|
@@ -138,7 +150,7 @@ nuxtApp.hooks.hook("page:transition:finish", () => {
|
|
|
138
150
|
</div>
|
|
139
151
|
</template>
|
|
140
152
|
|
|
141
|
-
<div v-if="!!slots.bottom" :class="ui.bottom({ class: props.ui?.bottom
|
|
153
|
+
<div v-if="!!slots.bottom" :class="ui.bottom({ class: props.ui?.bottom })">
|
|
142
154
|
<slot name="bottom" :links="links" />
|
|
143
155
|
</div>
|
|
144
156
|
</div>
|