@eslamdevui/ui 3.2.0 → 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.
Files changed (186) hide show
  1. package/.nuxt/ui/alert.ts +5 -0
  2. package/.nuxt/ui/auth-form.ts +20 -0
  3. package/.nuxt/ui/badge.ts +5 -0
  4. package/.nuxt/ui/banner.ts +105 -0
  5. package/.nuxt/ui/blog-post.ts +140 -0
  6. package/.nuxt/ui/blog-posts.ts +14 -0
  7. package/.nuxt/ui/button-group.ts +13 -0
  8. package/.nuxt/ui/button.ts +5 -0
  9. package/.nuxt/ui/carousel.ts +5 -0
  10. package/.nuxt/ui/changelog-version.ts +41 -0
  11. package/.nuxt/ui/changelog-versions.ts +8 -0
  12. package/.nuxt/ui/chat-palette.ts +8 -0
  13. package/.nuxt/ui/content/content-navigation.ts +341 -0
  14. package/.nuxt/ui/content/content-search-button.ts +6 -0
  15. package/.nuxt/ui/content/content-search.ts +6 -0
  16. package/.nuxt/ui/content/content-surround.ts +39 -0
  17. package/.nuxt/ui/content/content-toc.ts +150 -0
  18. package/.nuxt/ui/content/index.ts +5 -0
  19. package/.nuxt/ui/content-navigation.ts +6 -4
  20. package/.nuxt/ui/content-surround.ts +5 -0
  21. package/.nuxt/ui/dashboard-navbar.ts +5 -0
  22. package/.nuxt/ui/dashboard-sidebar-collapse.ts +5 -0
  23. package/.nuxt/ui/dashboard-sidebar-toggle.ts +5 -0
  24. package/.nuxt/ui/dashboard-sidebar.ts +10 -0
  25. package/.nuxt/ui/error.ts +9 -0
  26. package/.nuxt/ui/footer-columns.ts +28 -0
  27. package/.nuxt/ui/footer.ts +11 -0
  28. package/.nuxt/ui/header.ts +30 -0
  29. package/.nuxt/ui/index.ts +80 -2
  30. package/.nuxt/ui/input-menu.ts +9 -0
  31. package/.nuxt/ui/input-number.ts +5 -0
  32. package/.nuxt/ui/input-tags.ts +9 -0
  33. package/.nuxt/ui/input.ts +9 -0
  34. package/.nuxt/ui/main.ts +3 -0
  35. package/.nuxt/ui/page-accordion.ts +7 -0
  36. package/.nuxt/ui/page-anchors.ts +30 -0
  37. package/.nuxt/ui/page-aside.ts +10 -0
  38. package/.nuxt/ui/page-body.ts +3 -0
  39. package/.nuxt/ui/page-card.ts +276 -0
  40. package/.nuxt/ui/page-columns.ts +3 -0
  41. package/.nuxt/ui/page-cta.ts +72 -0
  42. package/.nuxt/ui/page-feature.ts +31 -0
  43. package/.nuxt/ui/page-grid.ts +3 -0
  44. package/.nuxt/ui/page-header.ts +18 -0
  45. package/.nuxt/ui/page-hero.ts +46 -0
  46. package/.nuxt/ui/page-links.ts +25 -0
  47. package/.nuxt/ui/page-list.ts +8 -0
  48. package/.nuxt/ui/page-logos.ts +15 -0
  49. package/.nuxt/ui/page-marquee.ts +66 -0
  50. package/.nuxt/ui/page-section.ts +88 -0
  51. package/.nuxt/ui/page.ts +32 -0
  52. package/.nuxt/ui/pricing-plan.ts +101 -0
  53. package/.nuxt/ui/pricing-plans.ts +27 -0
  54. package/.nuxt/ui/pricing-table.ts +51 -0
  55. package/.nuxt/ui/prose/a.ts +6 -0
  56. package/.nuxt/ui/prose/accordion-item.ts +3 -0
  57. package/.nuxt/ui/prose/accordion.ts +6 -0
  58. package/.nuxt/ui/prose/badge.ts +3 -0
  59. package/.nuxt/ui/prose/blockquote.ts +3 -0
  60. package/.nuxt/ui/prose/callout.ts +129 -0
  61. package/.nuxt/ui/prose/card-group.ts +3 -0
  62. package/.nuxt/ui/prose/card.ts +119 -0
  63. package/.nuxt/ui/prose/code-collapse.ts +19 -0
  64. package/.nuxt/ui/prose/code-group.ts +13 -0
  65. package/.nuxt/ui/prose/code-icon.ts +66 -0
  66. package/.nuxt/ui/prose/code-preview.ts +14 -0
  67. package/.nuxt/ui/prose/code-tree.ts +28 -0
  68. package/.nuxt/ui/prose/code.ts +27 -0
  69. package/.nuxt/ui/prose/collapsible.ts +12 -0
  70. package/.nuxt/ui/prose/em.ts +3 -0
  71. package/.nuxt/ui/prose/field-group.ts +3 -0
  72. package/.nuxt/ui/prose/field.ts +11 -0
  73. package/.nuxt/ui/prose/h1.ts +6 -0
  74. package/.nuxt/ui/prose/h2.ts +14 -0
  75. package/.nuxt/ui/prose/h3.ts +14 -0
  76. package/.nuxt/ui/prose/h4.ts +6 -0
  77. package/.nuxt/ui/prose/hr.ts +3 -0
  78. package/.nuxt/ui/prose/icon.ts +3 -0
  79. package/.nuxt/ui/prose/img.ts +3 -0
  80. package/.nuxt/ui/prose/index.ts +41 -0
  81. package/.nuxt/ui/prose/kbd.ts +3 -0
  82. package/.nuxt/ui/prose/li.ts +3 -0
  83. package/.nuxt/ui/prose/ol.ts +3 -0
  84. package/.nuxt/ui/prose/p.ts +3 -0
  85. package/.nuxt/ui/prose/pre.ts +17 -0
  86. package/.nuxt/ui/prose/steps.ts +19 -0
  87. package/.nuxt/ui/prose/strong.ts +3 -0
  88. package/.nuxt/ui/prose/table.ts +6 -0
  89. package/.nuxt/ui/prose/tabs-item.ts +3 -0
  90. package/.nuxt/ui/prose/tabs.ts +5 -0
  91. package/.nuxt/ui/prose/tbody.ts +3 -0
  92. package/.nuxt/ui/prose/td.ts +3 -0
  93. package/.nuxt/ui/prose/th.ts +3 -0
  94. package/.nuxt/ui/prose/thead.ts +3 -0
  95. package/.nuxt/ui/prose/tr.ts +3 -0
  96. package/.nuxt/ui/prose/ul.ts +3 -0
  97. package/.nuxt/ui/select-menu.ts +9 -0
  98. package/.nuxt/ui/select.ts +9 -0
  99. package/.nuxt/ui/textarea.ts +9 -0
  100. package/.nuxt/ui/toast.ts +5 -0
  101. package/.nuxt/ui/user.ts +106 -0
  102. package/dist/module.json +1 -1
  103. package/dist/module.mjs +2 -2
  104. package/dist/runtime/components/AuthForm.vue +195 -0
  105. package/dist/runtime/components/AuthForm.vue.d.ts +85 -0
  106. package/dist/runtime/components/Banner.vue +113 -0
  107. package/dist/runtime/components/Banner.vue.d.ts +68 -0
  108. package/dist/runtime/components/BlogPost.vue +141 -0
  109. package/dist/runtime/components/BlogPost.vue.d.ts +59 -0
  110. package/dist/runtime/components/BlogPosts.vue +33 -0
  111. package/dist/runtime/components/BlogPosts.vue.d.ts +30 -0
  112. package/dist/runtime/components/ChangelogVersion.vue +165 -0
  113. package/dist/runtime/components/ChangelogVersion.vue.d.ts +58 -0
  114. package/dist/runtime/components/ChangelogVersions.vue +54 -0
  115. package/dist/runtime/components/ChangelogVersions.vue.d.ts +74 -0
  116. package/dist/runtime/components/ChatPalette.vue +32 -0
  117. package/dist/runtime/components/ChatPalette.vue.d.ts +24 -0
  118. package/dist/runtime/components/ChatPrompt.vue.d.ts +1 -1
  119. package/dist/runtime/components/CommandPalette.vue.d.ts +3 -3
  120. package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
  121. package/dist/runtime/components/Error.vue.d.ts +1 -1
  122. package/dist/runtime/components/Footer.vue +44 -0
  123. package/dist/runtime/components/Footer.vue.d.ts +29 -0
  124. package/dist/runtime/components/FooterColumns.vue +68 -0
  125. package/dist/runtime/components/FooterColumns.vue.d.ts +52 -0
  126. package/dist/runtime/components/Header.vue +137 -0
  127. package/dist/runtime/components/Header.vue.d.ts +72 -0
  128. package/dist/runtime/components/InputMenu.vue.d.ts +3 -3
  129. package/dist/runtime/components/Main.vue +23 -0
  130. package/dist/runtime/components/Main.vue.d.ts +20 -0
  131. package/dist/runtime/components/Page.vue +37 -0
  132. package/dist/runtime/components/Page.vue.d.ts +25 -0
  133. package/dist/runtime/components/PageAccordion.vue +26 -0
  134. package/dist/runtime/components/PageAccordion.vue.d.ts +21 -0
  135. package/dist/runtime/components/PageAnchors.vue +50 -0
  136. package/dist/runtime/components/PageAnchors.vue.d.ts +42 -0
  137. package/dist/runtime/components/PageAside.vue +36 -0
  138. package/dist/runtime/components/PageAside.vue.d.ts +27 -0
  139. package/dist/runtime/components/PageBody.vue +23 -0
  140. package/dist/runtime/components/PageBody.vue.d.ts +18 -0
  141. package/dist/runtime/components/PageCTA.vue +58 -0
  142. package/dist/runtime/components/PageCTA.vue.d.ts +49 -0
  143. package/dist/runtime/components/PageCard.vue +121 -0
  144. package/dist/runtime/components/PageCard.vue.d.ts +71 -0
  145. package/dist/runtime/components/PageColumns.vue +23 -0
  146. package/dist/runtime/components/PageColumns.vue.d.ts +18 -0
  147. package/dist/runtime/components/PageFeature.vue +71 -0
  148. package/dist/runtime/components/PageFeature.vue.d.ts +43 -0
  149. package/dist/runtime/components/PageGrid.vue +23 -0
  150. package/dist/runtime/components/PageGrid.vue.d.ts +18 -0
  151. package/dist/runtime/components/PageHeader.vue +58 -0
  152. package/dist/runtime/components/PageHeader.vue.d.ts +35 -0
  153. package/dist/runtime/components/PageHero.vue +67 -0
  154. package/dist/runtime/components/PageHero.vue.d.ts +49 -0
  155. package/dist/runtime/components/PageLinks.vue +55 -0
  156. package/dist/runtime/components/PageLinks.vue.d.ts +44 -0
  157. package/dist/runtime/components/PageList.vue +24 -0
  158. package/dist/runtime/components/PageList.vue.d.ts +21 -0
  159. package/dist/runtime/components/PageLogos.vue +64 -0
  160. package/dist/runtime/components/PageLogos.vue.d.ts +32 -0
  161. package/dist/runtime/components/PageMarquee.vue +40 -0
  162. package/dist/runtime/components/PageMarquee.vue.d.ts +30 -0
  163. package/dist/runtime/components/PageSection.vue +88 -0
  164. package/dist/runtime/components/PageSection.vue.d.ts +64 -0
  165. package/dist/runtime/components/PricingPlan.vue +129 -0
  166. package/dist/runtime/components/PricingPlan.vue.d.ts +109 -0
  167. package/dist/runtime/components/PricingPlans.vue +45 -0
  168. package/dist/runtime/components/PricingPlans.vue.d.ts +41 -0
  169. package/dist/runtime/components/PricingTable.vue +235 -0
  170. package/dist/runtime/components/PricingTable.vue.d.ts +98 -0
  171. package/dist/runtime/components/SelectMenu.vue.d.ts +3 -3
  172. package/dist/runtime/components/Tabs.vue +1 -0
  173. package/dist/runtime/components/User.vue +69 -0
  174. package/dist/runtime/components/User.vue.d.ts +46 -0
  175. package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +57 -11
  176. package/dist/runtime/components/content/ContentSurround.vue +2 -2
  177. package/dist/runtime/components/content/ContentSurround.vue.d.ts +45 -52
  178. package/dist/runtime/components/content/ContentToc.vue +27 -15
  179. package/dist/runtime/components/content/ContentToc.vue.d.ts +79 -81
  180. package/dist/runtime/types/index.d.ts +33 -0
  181. package/dist/runtime/types/index.js +33 -0
  182. package/dist/shared/{ui.DQZ75GCP.mjs → ui.DErCA3YU.mjs} +1247 -50
  183. package/dist/unplugin.mjs +1 -1
  184. package/dist/vite.mjs +1 -1
  185. package/package.json +1 -1
  186. package/.nuxt/ui/prose.ts +0 -321
@@ -0,0 +1,141 @@
1
+ <script>
2
+ import theme from "#build/ui/blog-post";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { Primitive, useDateFormatter } from "reka-ui";
8
+ import ImageComponent from "#build/ui-image-component";
9
+ import { useLocale, useAppConfig } from "#imports";
10
+ import { getSlotChildrenText } from "../utils";
11
+ import { tv } from "../utils/tv";
12
+ import UUser from "./User.vue";
13
+ defineOptions({ inheritAttrs: false });
14
+ const props = defineProps({
15
+ as: { type: null, required: false, default: "article" },
16
+ title: { type: String, required: false },
17
+ description: { type: String, required: false },
18
+ date: { type: [String, Date], required: false },
19
+ badge: { type: [String, Object], required: false },
20
+ authors: { type: Array, required: false },
21
+ image: { type: [String, Object], required: false },
22
+ orientation: { type: null, required: false, default: "vertical" },
23
+ variant: { type: null, required: false },
24
+ to: { type: null, required: false },
25
+ target: { type: [String, Object, null], required: false },
26
+ onClick: { type: Function, required: false },
27
+ class: { type: null, required: false },
28
+ ui: { type: null, required: false }
29
+ });
30
+ const slots = defineSlots();
31
+ const { locale } = useLocale();
32
+ const appConfig = useAppConfig();
33
+ const formatter = useDateFormatter(locale.value.code);
34
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.blogPost || {} })({
35
+ orientation: props.orientation,
36
+ variant: props.variant,
37
+ image: !!props.image,
38
+ to: !!props.to || !!props.onClick
39
+ }));
40
+ const date = computed(() => {
41
+ if (!props.date) {
42
+ return;
43
+ }
44
+ try {
45
+ return formatter.custom(new Date(props.date), { dateStyle: "medium" });
46
+ } catch {
47
+ return props.date;
48
+ }
49
+ });
50
+ const datetime = computed(() => {
51
+ if (!props.date) {
52
+ return;
53
+ }
54
+ try {
55
+ return new Date(props.date)?.toISOString();
56
+ } catch {
57
+ return void 0;
58
+ }
59
+ });
60
+ const ariaLabel = computed(() => {
61
+ const slotText = slots.title && getSlotChildrenText(slots.title());
62
+ return (slotText || props.title || "Post link").trim();
63
+ });
64
+ </script>
65
+
66
+ <template>
67
+ <Primitive :as="as" :data-orientation="orientation" :class="ui.root({ class: [props.ui?.root, props.class] })" @click="onClick">
68
+ <div v-if="image || !!slots.header" :class="ui.header({ class: props.ui?.header })">
69
+ <slot name="header">
70
+ <component
71
+ :is="ImageComponent"
72
+ v-bind="typeof image === 'string' ? { src: image, alt: title } : { alt: title, ...image }"
73
+ :class="ui.image({ class: props.ui?.image, to: !!to })"
74
+ />
75
+ </slot>
76
+ </div>
77
+
78
+ <div :class="ui.body({ class: props.ui?.body })">
79
+ <ULink
80
+ v-if="to"
81
+ :aria-label="ariaLabel"
82
+ v-bind="{ to, target, ...$attrs }"
83
+ class="focus:outline-none peer"
84
+ tabindex="-1"
85
+ raw
86
+ >
87
+ <span class="absolute inset-0" aria-hidden="true" />
88
+ </ULink>
89
+
90
+ <slot name="body">
91
+ <div v-if="date || !!slots.date || (badge || !!slots.badge)" :class="ui.meta({ class: props.ui?.meta })">
92
+ <slot name="badge">
93
+ <UBadge v-if="badge" color="neutral" variant="subtle" v-bind="typeof badge === 'string' ? { label: badge } : badge" :class="ui.badge({ class: props.ui?.badge })" />
94
+ </slot>
95
+
96
+ <time v-if="date" :datetime="datetime" :class="ui.date({ class: props.ui?.date })">
97
+ <slot name="date">
98
+ {{ date }}
99
+ </slot>
100
+ </time>
101
+ </div>
102
+
103
+ <h2 v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">
104
+ <slot name="title">
105
+ {{ title }}
106
+ </slot>
107
+ </h2>
108
+
109
+ <div v-if="description || !!slots.description" :class="ui.description({ class: props.ui?.description })">
110
+ <slot name="description">
111
+ {{ description }}
112
+ </slot>
113
+ </div>
114
+
115
+ <div v-if="authors?.length || !!slots.authors" :class="ui.authors({ class: props.ui?.authors })">
116
+ <slot name="authors">
117
+ <template v-if="authors?.length">
118
+ <UAvatarGroup v-if="authors.length > 1">
119
+ <ULink
120
+ v-for="(author, index) in authors"
121
+ :key="index"
122
+ :to="author.to"
123
+ :target="author.target"
124
+ :class="ui.avatar({ class: props.ui?.avatar, to: !!author.to })"
125
+ raw
126
+ >
127
+ <UAvatar v-bind="author.avatar" />
128
+ </ULink>
129
+ </UAvatarGroup>
130
+ <UUser v-else v-bind="authors[0]" />
131
+ </template>
132
+ </slot>
133
+ </div>
134
+ </slot>
135
+ </div>
136
+
137
+ <div v-if="!!slots.footer" :class="ui.footer({ class: props.ui?.footer })">
138
+ <slot name="footer" />
139
+ </div>
140
+ </Primitive>
141
+ </template>
@@ -0,0 +1,59 @@
1
+ import theme from '#build/ui/blog-post';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import type { BadgeProps, LinkProps, ComponentConfig, UserProps } from '../types';
4
+ type BlogPost = ComponentConfig<typeof theme, AppConfig, 'blogPost'>;
5
+ export interface BlogPostProps {
6
+ /**
7
+ * The element or component this component should render as.
8
+ * @defaultValue 'article'
9
+ */
10
+ as?: any;
11
+ title?: string;
12
+ description?: string;
13
+ /** The date of the blog post. Can be a string or a Date object. */
14
+ date?: string | Date;
15
+ /**
16
+ * Display a badge on the blog post.
17
+ * Can be a string or an object.
18
+ * `{ color: 'neutral', variant: 'subtle' }`{lang="ts-type"}
19
+ */
20
+ badge?: string | BadgeProps;
21
+ /** The authors of the blog post. */
22
+ authors?: UserProps[];
23
+ /** The image of the blog post. Can be a string or an object. */
24
+ image?: string | Partial<HTMLImageElement>;
25
+ /**
26
+ * The orientation of the blog post.
27
+ * @defaultValue 'vertical'
28
+ */
29
+ orientation?: BlogPost['variants']['orientation'];
30
+ /**
31
+ * @defaultValue 'outline'
32
+ */
33
+ variant?: BlogPost['variants']['variant'];
34
+ to?: LinkProps['to'];
35
+ target?: LinkProps['target'];
36
+ onClick?: (event: MouseEvent) => void | Promise<void>;
37
+ class?: any;
38
+ ui?: BlogPost['slots'];
39
+ }
40
+ export interface BlogPostSlots {
41
+ date(props?: {}): any;
42
+ badge(props?: {}): any;
43
+ title(props?: {}): any;
44
+ description(props?: {}): any;
45
+ authors(props?: {}): any;
46
+ header(props?: {}): any;
47
+ body(props?: {}): any;
48
+ footer(props?: {}): any;
49
+ }
50
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<BlogPostProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlogPostProps> & Readonly<{}>, {
51
+ as: any;
52
+ orientation: BlogPost["variants"]["orientation"];
53
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, BlogPostSlots>;
54
+ export default _default;
55
+ type __VLS_WithSlots<T, S> = T & {
56
+ new (): {
57
+ $slots: S;
58
+ };
59
+ };
@@ -0,0 +1,33 @@
1
+ <script>
2
+ import theme from "#build/ui/blog-posts";
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
+ import UBlogPost from "./BlogPost.vue";
11
+ const props = defineProps({
12
+ as: { type: null, required: false },
13
+ posts: { type: Array, required: false },
14
+ orientation: { type: null, required: false, default: "horizontal" },
15
+ class: { type: null, required: false }
16
+ });
17
+ defineSlots();
18
+ const appConfig = useAppConfig();
19
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.blogPosts || {} }));
20
+ </script>
21
+
22
+ <template>
23
+ <Primitive :as="as" :data-orientation="orientation" :class="ui({ orientation, class: props.class })">
24
+ <slot>
25
+ <UBlogPost
26
+ v-for="(post, index) in posts"
27
+ :key="index"
28
+ :orientation="orientation === 'vertical' ? 'horizontal' : 'vertical'"
29
+ v-bind="post"
30
+ />
31
+ </slot>
32
+ </Primitive>
33
+ </template>
@@ -0,0 +1,30 @@
1
+ import theme from '#build/ui/blog-posts';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import type { ComponentConfig, BlogPostProps } from '../types';
4
+ type BlogPosts = ComponentConfig<typeof theme, AppConfig, 'blogPosts'>;
5
+ export interface BlogPostsProps {
6
+ /**
7
+ * The element or component this component should render as.
8
+ * @defaultValue 'div'
9
+ */
10
+ as?: any;
11
+ posts?: BlogPostProps[];
12
+ /**
13
+ * The orientation of the blog posts.
14
+ * @defaultValue 'horizontal'
15
+ */
16
+ orientation?: BlogPosts['variants']['orientation'];
17
+ class?: any;
18
+ }
19
+ export interface BlogPostsSlots {
20
+ default(props?: {}): any;
21
+ }
22
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<BlogPostsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlogPostsProps> & Readonly<{}>, {
23
+ orientation: BlogPosts["variants"]["orientation"];
24
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, BlogPostsSlots>;
25
+ export default _default;
26
+ type __VLS_WithSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
@@ -0,0 +1,165 @@
1
+ <script>
2
+ import theme from "#build/ui/changelog-version";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { Primitive, useDateFormatter } from "reka-ui";
8
+ import { createReusableTemplate } from "@vueuse/core";
9
+ import ImageComponent from "#build/ui-image-component";
10
+ import { useLocale, useAppConfig } from "#imports";
11
+ import { getSlotChildrenText } from "../utils";
12
+ import { tv } from "../utils/tv";
13
+ import UUser from "./User.vue";
14
+ defineOptions({ inheritAttrs: false });
15
+ const props = defineProps({
16
+ as: { type: null, required: false, default: "article" },
17
+ title: { type: String, required: false },
18
+ description: { type: String, required: false },
19
+ date: { type: [String, Date], required: false },
20
+ badge: { type: [String, Object], required: false },
21
+ authors: { type: Array, required: false },
22
+ image: { type: [String, Object], required: false },
23
+ indicator: { type: Boolean, required: false, default: true },
24
+ to: { type: null, required: false },
25
+ target: { type: [String, Object, null], required: false },
26
+ onClick: { type: Function, required: false },
27
+ class: { type: null, required: false },
28
+ ui: { type: null, required: false }
29
+ });
30
+ const slots = defineSlots();
31
+ const { locale } = useLocale();
32
+ const appConfig = useAppConfig();
33
+ const formatter = useDateFormatter(locale.value.code);
34
+ const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate();
35
+ const [DefineDateTemplate, ReuseDateTemplate] = createReusableTemplate({
36
+ props: {
37
+ hidden: {
38
+ type: Boolean,
39
+ default: false
40
+ }
41
+ }
42
+ });
43
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.changelogVersion || {} })({
44
+ to: !!props.to || !!props.onClick
45
+ }));
46
+ const date = computed(() => {
47
+ if (!props.date) {
48
+ return;
49
+ }
50
+ try {
51
+ return formatter.custom(new Date(props.date), { dateStyle: "medium" });
52
+ } catch {
53
+ return props.date;
54
+ }
55
+ });
56
+ const datetime = computed(() => {
57
+ if (!props.date) {
58
+ return;
59
+ }
60
+ try {
61
+ return new Date(props.date)?.toISOString();
62
+ } catch {
63
+ return void 0;
64
+ }
65
+ });
66
+ const ariaLabel = computed(() => {
67
+ const slotText = slots.title && getSlotChildrenText(slots.title());
68
+ return (slotText || props.title || "Version link").trim();
69
+ });
70
+ </script>
71
+
72
+ <template>
73
+ <DefineLinkTemplate>
74
+ <ULink
75
+ v-if="to"
76
+ :aria-label="ariaLabel"
77
+ v-bind="{ to, target, ...$attrs }"
78
+ class="focus:outline-none peer"
79
+ tabindex="-1"
80
+ raw
81
+ >
82
+ <span class="absolute inset-0" aria-hidden="true" />
83
+ </ULink>
84
+ </DefineLinkTemplate>
85
+
86
+ <DefineDateTemplate v-slot="{ hidden }">
87
+ <time v-if="date" :datetime="datetime" :class="ui.date({ class: props.ui?.date, hidden })">
88
+ <slot name="date">
89
+ {{ date }}
90
+ </slot>
91
+ </time>
92
+ </DefineDateTemplate>
93
+
94
+ <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })" @click="onClick">
95
+ <div v-if="!!props.indicator || !!slots.indicator" :class="ui.indicator({ class: props.ui?.indicator })">
96
+ <slot name="indicator">
97
+ <!-- <ReuseDateTemplate :hidden="false" /> when used inside the indicator slot -->
98
+ <ReuseDateTemplate :hidden="!!props.indicator" /> <!-- when used elsewhere -->
99
+
100
+ <div :class="ui.dot({ class: props.ui?.dot })">
101
+ <div :class="ui.dotInner({ class: props.ui?.dotInner })" />
102
+ </div>
103
+ </slot>
104
+ </div>
105
+
106
+ <div :class="ui.container({ class: props.ui?.container })">
107
+ <div v-if="!!slots.header || (date || !!slots.date) || (badge || !!slots.badge) || (title || !!slots.title) || (description || !!slots.description) || (image || !!slots.image)" :class="ui.header({ class: props.ui?.header })">
108
+ <slot name="header">
109
+ <div v-if="date || !!slots.date || (badge || !!slots.badge)" :class="ui.meta({ class: props.ui?.meta, badge: !!badge || !!slots.badge || !props.indicator })">
110
+ <slot name="badge">
111
+ <UBadge v-if="badge" color="neutral" variant="solid" v-bind="typeof badge === 'string' ? { label: badge } : badge" :class="ui.badge({ class: props.ui?.badge })" />
112
+ </slot>
113
+
114
+ <ReuseDateTemplate :hidden="!!props.indicator" />
115
+ </div>
116
+
117
+ <h2 v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">
118
+ <ReuseLinkTemplate />
119
+
120
+ <slot name="title">
121
+ {{ title }}
122
+ </slot>
123
+ </h2>
124
+
125
+ <div v-if="description || !!slots.description" :class="ui.description({ class: props.ui?.description })">
126
+ <slot name="description">
127
+ {{ description }}
128
+ </slot>
129
+ </div>
130
+
131
+ <div v-if="image || !!slots.image" :class="ui.imageWrapper({ class: props.ui?.imageWrapper })">
132
+ <slot name="image">
133
+ <component
134
+ :is="ImageComponent"
135
+ v-if="image"
136
+ v-bind="typeof image === 'string' ? { src: image, alt: title } : { alt: title, ...image }"
137
+ :class="ui.image({ class: props.ui?.image, to: !!to })"
138
+ />
139
+ </slot>
140
+
141
+ <ReuseLinkTemplate />
142
+ </div>
143
+ </slot>
144
+ </div>
145
+
146
+ <slot name="body" />
147
+
148
+ <div v-if="!!slots.footer || (authors?.length || !!slots.authors) || !!slots.actions" :class="ui.footer({ class: props.ui?.footer, body: !!slots.body })">
149
+ <slot name="footer">
150
+ <div v-if="authors?.length || !!slots.authors" :class="ui.authors({ class: props.ui?.authors })">
151
+ <slot name="authors">
152
+ <UUser
153
+ v-for="(author, index) in authors"
154
+ :key="index"
155
+ v-bind="author"
156
+ />
157
+ </slot>
158
+ </div>
159
+
160
+ <slot name="actions" />
161
+ </slot>
162
+ </div>
163
+ </div>
164
+ </Primitive>
165
+ </template>
@@ -0,0 +1,58 @@
1
+ import theme from '#build/ui/changelog-version';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import type { BadgeProps, LinkProps, ComponentConfig, UserProps } from '../types';
4
+ type ChangelogVersion = ComponentConfig<typeof theme, AppConfig, 'changelogVersion'>;
5
+ export interface ChangelogVersionProps {
6
+ /**
7
+ * The element or component this component should render as.
8
+ * @defaultValue 'article'
9
+ */
10
+ as?: any;
11
+ title?: string;
12
+ description?: string;
13
+ /** The date of the changelog version. Can be a string or a Date object. */
14
+ date?: string | Date;
15
+ /**
16
+ * Display a badge on the changelog version.
17
+ * Can be a string or an object.
18
+ * `{ color: 'neutral', variant: 'solid' }`{lang="ts-type"}
19
+ */
20
+ badge?: string | BadgeProps;
21
+ /** The authors of the changelog version. */
22
+ authors?: UserProps[];
23
+ /** The image of the changelog version. Can be a string or an object. */
24
+ image?: string | Partial<HTMLImageElement>;
25
+ /**
26
+ * Display an indicator dot on the left.
27
+ * @defaultValue true
28
+ */
29
+ indicator?: boolean;
30
+ to?: LinkProps['to'];
31
+ target?: LinkProps['target'];
32
+ onClick?: (event: MouseEvent) => void | Promise<void>;
33
+ class?: any;
34
+ ui?: ChangelogVersion['slots'];
35
+ }
36
+ export interface ChangelogVersionSlots {
37
+ header(props?: {}): any;
38
+ badge(props?: {}): any;
39
+ date(props?: {}): any;
40
+ title(props?: {}): any;
41
+ description(props?: {}): any;
42
+ image(props?: {}): any;
43
+ body(props?: {}): any;
44
+ footer(props?: {}): any;
45
+ authors(props?: {}): any;
46
+ actions(props?: {}): any;
47
+ indicator(props?: {}): any;
48
+ }
49
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ChangelogVersionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ChangelogVersionProps> & Readonly<{}>, {
50
+ as: any;
51
+ indicator: boolean;
52
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChangelogVersionSlots>;
53
+ export default _default;
54
+ type __VLS_WithSlots<T, S> = T & {
55
+ new (): {
56
+ $slots: S;
57
+ };
58
+ };
@@ -0,0 +1,54 @@
1
+ <script>
2
+ import theme from "#build/ui/changelog-versions";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { Primitive } from "reka-ui";
8
+ import { Motion, useScroll, useSpring } from "motion-v";
9
+ import { defu } from "defu";
10
+ import { omit } from "../utils";
11
+ import { useAppConfig } from "#imports";
12
+ import { tv } from "../utils/tv";
13
+ import UChangelogVersion from "./ChangelogVersion.vue";
14
+ const props = defineProps({
15
+ as: { type: null, required: false },
16
+ versions: { type: Array, required: false },
17
+ indicator: { type: Boolean, required: false, default: true },
18
+ indicatorMotion: { type: [Boolean, Object], required: false, default: true },
19
+ class: { type: null, required: false },
20
+ ui: { type: null, required: false }
21
+ });
22
+ const slots = defineSlots();
23
+ const proxySlots = omit(slots, ["default", "indicator"]);
24
+ const appConfig = useAppConfig();
25
+ const springOptions = computed(() => defu(typeof props.indicatorMotion === "object" ? props.indicatorMotion : {}, { damping: 30, restDelta: 1e-3 }));
26
+ const { scrollY } = useScroll();
27
+ const height = useSpring(scrollY, springOptions);
28
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.changelogVersions || {} })());
29
+ </script>
30
+
31
+ <template>
32
+ <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
33
+ <div v-if="!!props.indicator || !!slots.indicator" :class="ui.indicator({ class: props.ui?.indicator })">
34
+ <slot name="indicator">
35
+ <Motion v-if="!!props.indicatorMotion" :class="ui.beam({ class: props.ui?.beam })" :style="{ height }" />
36
+ </slot>
37
+ </div>
38
+
39
+ <div v-if="versions?.length || !!slots.default" :class="ui.container({ class: props.ui?.container })">
40
+ <slot>
41
+ <UChangelogVersion
42
+ v-for="(version, index) in versions"
43
+ :key="index"
44
+ :indicator="!!props.indicator"
45
+ v-bind="version"
46
+ >
47
+ <template v-for="(_, name) in proxySlots" #[name]>
48
+ <slot :name="name" v-bind="{ version }" />
49
+ </template>
50
+ </UChangelogVersion>
51
+ </slot>
52
+ </div>
53
+ </Primitive>
54
+ </template>
@@ -0,0 +1,74 @@
1
+ import theme from '#build/ui/changelog-versions';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import type { ComponentConfig, ChangelogVersionProps } from '../types';
4
+ import type { SpringOptions } from 'motion-v';
5
+ type ChangelogVersions = ComponentConfig<typeof theme, AppConfig, 'changelogVersions'>;
6
+ export interface ChangelogVersionsProps<T extends ChangelogVersionProps = ChangelogVersionProps> {
7
+ /**
8
+ * The element or component this component should render as.
9
+ * @defaultValue 'div'
10
+ */
11
+ as?: any;
12
+ versions?: T[];
13
+ /**
14
+ * Display an indicator bar on the left.
15
+ * @defaultValue true
16
+ */
17
+ indicator?: boolean;
18
+ /**
19
+ * Enable scrolling motion effect on the indicator bar.
20
+ * `{ damping: 30, restDelta: 0.001 }`{lang="ts-type"}
21
+ * @defaultValue true
22
+ * @see https://motion.dev/docs/vue-transitions#spring
23
+ */
24
+ indicatorMotion?: boolean | SpringOptions;
25
+ class?: any;
26
+ ui?: ChangelogVersions['slots'];
27
+ }
28
+ export interface ChangelogVersionsSlots<T extends ChangelogVersionProps = ChangelogVersionProps> {
29
+ default(props?: {}): any;
30
+ indicator(props?: {}): any;
31
+ header(props: {
32
+ version: T;
33
+ }): any;
34
+ badge(props: {
35
+ version: T;
36
+ }): any;
37
+ date(props: {
38
+ version: T;
39
+ }): any;
40
+ title(props: {
41
+ version: T;
42
+ }): any;
43
+ description(props: {
44
+ version: T;
45
+ }): any;
46
+ image(props: {
47
+ version: T;
48
+ }): any;
49
+ body(props: {
50
+ version: T;
51
+ }): any;
52
+ footer(props: {
53
+ version: T;
54
+ }): any;
55
+ authors(props: {
56
+ version: T;
57
+ }): any;
58
+ actions(props: {
59
+ version: T;
60
+ }): any;
61
+ indicator(props: {
62
+ version: T;
63
+ }): any;
64
+ }
65
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ChangelogVersionsProps<ChangelogVersionProps>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ChangelogVersionsProps<ChangelogVersionProps>> & Readonly<{}>, {
66
+ indicator: boolean;
67
+ indicatorMotion: boolean | SpringOptions;
68
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChangelogVersionsSlots<ChangelogVersionProps>>;
69
+ export default _default;
70
+ type __VLS_WithSlots<T, S> = T & {
71
+ new (): {
72
+ $slots: S;
73
+ };
74
+ };
@@ -0,0 +1,32 @@
1
+ <script>
2
+ import theme from "#build/ui/chat-palette";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { Primitive, Slot } from "reka-ui";
8
+ import { useAppConfig } from "#imports";
9
+ import { tv } from "../utils/tv";
10
+ const props = defineProps({
11
+ as: { type: null, required: false },
12
+ class: { type: null, required: false },
13
+ ui: { type: null, required: false }
14
+ });
15
+ const slots = defineSlots();
16
+ const appConfig = useAppConfig();
17
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.chatPalette || {} })());
18
+ </script>
19
+
20
+ <template>
21
+ <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
22
+ <div :class="ui.content({ class: props.ui?.content })">
23
+ <Slot compact>
24
+ <slot />
25
+ </Slot>
26
+ </div>
27
+
28
+ <Slot v-if="!!slots.prompt" :class="ui.prompt({ class: props.ui?.prompt })">
29
+ <slot name="prompt" />
30
+ </Slot>
31
+ </Primitive>
32
+ </template>
@@ -0,0 +1,24 @@
1
+ import theme from '#build/ui/chat-palette';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import type { ComponentConfig } from '../types';
4
+ type ChatPalette = ComponentConfig<typeof theme, AppConfig, 'chatPalette'>;
5
+ export interface ChatPaletteProps {
6
+ /**
7
+ * The element or component this component should render as.
8
+ * @defaultValue 'div'
9
+ */
10
+ as?: any;
11
+ class?: any;
12
+ ui?: ChatPalette['slots'];
13
+ }
14
+ export interface ChatPaletteSlots {
15
+ default(props?: {}): any;
16
+ prompt(props?: {}): any;
17
+ }
18
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ChatPaletteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ChatPaletteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChatPaletteSlots>;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };