@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.
Files changed (264) hide show
  1. package/.nuxt/ui/auth-form.ts +20 -0
  2. package/.nuxt/ui/banner.ts +105 -0
  3. package/.nuxt/ui/blog-post.ts +140 -0
  4. package/.nuxt/ui/blog-posts.ts +14 -0
  5. package/.nuxt/ui/changelog-version.ts +41 -0
  6. package/.nuxt/ui/changelog-versions.ts +8 -0
  7. package/.nuxt/ui/chat-palette.ts +8 -0
  8. package/.nuxt/ui/content/content-navigation.ts +6 -4
  9. package/.nuxt/ui/content-navigation.ts +6 -4
  10. package/.nuxt/ui/footer-columns.ts +28 -0
  11. package/.nuxt/ui/footer.ts +11 -0
  12. package/.nuxt/ui/header.ts +30 -0
  13. package/.nuxt/ui/index.ts +32 -1
  14. package/.nuxt/ui/main.ts +3 -0
  15. package/.nuxt/ui/page-accordion.ts +7 -0
  16. package/.nuxt/ui/page-anchors.ts +30 -0
  17. package/.nuxt/ui/page-aside.ts +10 -0
  18. package/.nuxt/ui/page-body.ts +3 -0
  19. package/.nuxt/ui/page-card.ts +276 -0
  20. package/.nuxt/ui/page-columns.ts +3 -0
  21. package/.nuxt/ui/page-cta.ts +72 -0
  22. package/.nuxt/ui/page-feature.ts +31 -0
  23. package/.nuxt/ui/page-grid.ts +3 -0
  24. package/.nuxt/ui/page-header.ts +18 -0
  25. package/.nuxt/ui/page-hero.ts +46 -0
  26. package/.nuxt/ui/page-links.ts +25 -0
  27. package/.nuxt/ui/page-list.ts +8 -0
  28. package/.nuxt/ui/page-logos.ts +15 -0
  29. package/.nuxt/ui/page-marquee.ts +66 -0
  30. package/.nuxt/ui/page-section.ts +88 -0
  31. package/.nuxt/ui/page.ts +32 -0
  32. package/.nuxt/ui/pricing-plan.ts +101 -0
  33. package/.nuxt/ui/pricing-plans.ts +27 -0
  34. package/.nuxt/ui/pricing-table.ts +51 -0
  35. package/.nuxt/ui/user.ts +106 -0
  36. package/LICENSE.md +9 -9
  37. package/README.md +147 -147
  38. package/cli/commands/make/component.mjs +95 -95
  39. package/cli/commands/make/index.mjs +14 -14
  40. package/cli/commands/make/locale.mjs +64 -64
  41. package/cli/index.mjs +15 -15
  42. package/cli/package.json +13 -13
  43. package/cli/templates.mjs +236 -236
  44. package/cli/utils.mjs +31 -31
  45. package/dist/module.json +1 -1
  46. package/dist/module.mjs +2 -2
  47. package/dist/runtime/components/Accordion.vue +36 -36
  48. package/dist/runtime/components/Alert.vue +46 -46
  49. package/dist/runtime/components/App.vue +10 -10
  50. package/dist/runtime/components/AuthForm.vue +195 -0
  51. package/dist/runtime/components/AuthForm.vue.d.ts +85 -0
  52. package/dist/runtime/components/Avatar.vue +27 -27
  53. package/dist/runtime/components/AvatarGroup.vue +4 -4
  54. package/dist/runtime/components/Badge.vue +16 -16
  55. package/dist/runtime/components/Banner.vue +113 -0
  56. package/dist/runtime/components/Banner.vue.d.ts +68 -0
  57. package/dist/runtime/components/BlogPost.vue +141 -0
  58. package/dist/runtime/components/BlogPost.vue.d.ts +59 -0
  59. package/dist/runtime/components/BlogPosts.vue +33 -0
  60. package/dist/runtime/components/BlogPosts.vue.d.ts +30 -0
  61. package/dist/runtime/components/Breadcrumb.vue +32 -32
  62. package/dist/runtime/components/Button.vue +28 -28
  63. package/dist/runtime/components/ButtonGroup.vue +3 -3
  64. package/dist/runtime/components/Calendar.vue +74 -74
  65. package/dist/runtime/components/Card.vue +13 -13
  66. package/dist/runtime/components/Carousel.vue +58 -58
  67. package/dist/runtime/components/ChangelogVersion.vue +165 -0
  68. package/dist/runtime/components/ChangelogVersion.vue.d.ts +58 -0
  69. package/dist/runtime/components/ChangelogVersions.vue +54 -0
  70. package/dist/runtime/components/ChangelogVersions.vue.d.ts +74 -0
  71. package/dist/runtime/components/ChatMessage.vue +35 -35
  72. package/dist/runtime/components/ChatMessages.vue +55 -55
  73. package/dist/runtime/components/ChatPalette.vue +32 -0
  74. package/dist/runtime/components/ChatPalette.vue.d.ts +24 -0
  75. package/dist/runtime/components/ChatPrompt.vue +26 -26
  76. package/dist/runtime/components/ChatPrompt.vue.d.ts +1 -1
  77. package/dist/runtime/components/ChatPromptSubmit.vue +10 -10
  78. package/dist/runtime/components/Checkbox.vue +33 -33
  79. package/dist/runtime/components/CheckboxGroup.vue +32 -32
  80. package/dist/runtime/components/Chip.vue +11 -11
  81. package/dist/runtime/components/Collapsible.vue +9 -9
  82. package/dist/runtime/components/ColorPicker.vue +30 -30
  83. package/dist/runtime/components/CommandPalette.vue +117 -117
  84. package/dist/runtime/components/CommandPalette.vue.d.ts +3 -3
  85. package/dist/runtime/components/Container.vue +3 -3
  86. package/dist/runtime/components/ContextMenu.vue +22 -22
  87. package/dist/runtime/components/ContextMenuContent.vue +105 -105
  88. package/dist/runtime/components/DashboardGroup.vue +3 -3
  89. package/dist/runtime/components/DashboardNavbar.vue +40 -40
  90. package/dist/runtime/components/DashboardPanel.vue +27 -27
  91. package/dist/runtime/components/DashboardResizeHandle.vue +7 -7
  92. package/dist/runtime/components/DashboardSearch.vue +20 -20
  93. package/dist/runtime/components/DashboardSearchButton.vue +43 -43
  94. package/dist/runtime/components/DashboardSidebar.vue +74 -74
  95. package/dist/runtime/components/DashboardSidebarCollapse.vue +7 -7
  96. package/dist/runtime/components/DashboardSidebarToggle.vue +7 -7
  97. package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
  98. package/dist/runtime/components/Drawer.vue +55 -55
  99. package/dist/runtime/components/DropdownMenu.vue +24 -24
  100. package/dist/runtime/components/DropdownMenuContent.vue +107 -107
  101. package/dist/runtime/components/Error.vue +22 -22
  102. package/dist/runtime/components/Error.vue.d.ts +1 -1
  103. package/dist/runtime/components/Footer.vue +44 -0
  104. package/dist/runtime/components/Footer.vue.d.ts +29 -0
  105. package/dist/runtime/components/FooterColumns.vue +68 -0
  106. package/dist/runtime/components/FooterColumns.vue.d.ts +52 -0
  107. package/dist/runtime/components/Form.vue +8 -8
  108. package/dist/runtime/components/FormField.vue +37 -37
  109. package/dist/runtime/components/Header.vue +137 -0
  110. package/dist/runtime/components/Header.vue.d.ts +72 -0
  111. package/dist/runtime/components/Icon.vue +1 -1
  112. package/dist/runtime/components/Input.vue +34 -34
  113. package/dist/runtime/components/InputMenu.vue +163 -163
  114. package/dist/runtime/components/InputMenu.vue.d.ts +3 -3
  115. package/dist/runtime/components/InputNumber.vue +49 -49
  116. package/dist/runtime/components/InputTags.vue +55 -55
  117. package/dist/runtime/components/Kbd.vue +5 -5
  118. package/dist/runtime/components/Link.vue +14 -14
  119. package/dist/runtime/components/LinkBase.vue +8 -8
  120. package/dist/runtime/components/Main.vue +23 -0
  121. package/dist/runtime/components/Main.vue.d.ts +20 -0
  122. package/dist/runtime/components/Modal.vue +69 -69
  123. package/dist/runtime/components/NavigationMenu.vue +166 -166
  124. package/dist/runtime/components/OverlayProvider.vue +9 -9
  125. package/dist/runtime/components/Page.vue +37 -0
  126. package/dist/runtime/components/Page.vue.d.ts +25 -0
  127. package/dist/runtime/components/PageAccordion.vue +26 -0
  128. package/dist/runtime/components/PageAccordion.vue.d.ts +21 -0
  129. package/dist/runtime/components/PageAnchors.vue +50 -0
  130. package/dist/runtime/components/PageAnchors.vue.d.ts +42 -0
  131. package/dist/runtime/components/PageAside.vue +36 -0
  132. package/dist/runtime/components/PageAside.vue.d.ts +27 -0
  133. package/dist/runtime/components/PageBody.vue +23 -0
  134. package/dist/runtime/components/PageBody.vue.d.ts +18 -0
  135. package/dist/runtime/components/PageCTA.vue +58 -0
  136. package/dist/runtime/components/PageCTA.vue.d.ts +49 -0
  137. package/dist/runtime/components/PageCard.vue +121 -0
  138. package/dist/runtime/components/PageCard.vue.d.ts +71 -0
  139. package/dist/runtime/components/PageColumns.vue +23 -0
  140. package/dist/runtime/components/PageColumns.vue.d.ts +18 -0
  141. package/dist/runtime/components/PageFeature.vue +71 -0
  142. package/dist/runtime/components/PageFeature.vue.d.ts +43 -0
  143. package/dist/runtime/components/PageGrid.vue +23 -0
  144. package/dist/runtime/components/PageGrid.vue.d.ts +18 -0
  145. package/dist/runtime/components/PageHeader.vue +58 -0
  146. package/dist/runtime/components/PageHeader.vue.d.ts +35 -0
  147. package/dist/runtime/components/PageHero.vue +67 -0
  148. package/dist/runtime/components/PageHero.vue.d.ts +49 -0
  149. package/dist/runtime/components/PageLinks.vue +55 -0
  150. package/dist/runtime/components/PageLinks.vue.d.ts +44 -0
  151. package/dist/runtime/components/PageList.vue +24 -0
  152. package/dist/runtime/components/PageList.vue.d.ts +21 -0
  153. package/dist/runtime/components/PageLogos.vue +64 -0
  154. package/dist/runtime/components/PageLogos.vue.d.ts +32 -0
  155. package/dist/runtime/components/PageMarquee.vue +40 -0
  156. package/dist/runtime/components/PageMarquee.vue.d.ts +30 -0
  157. package/dist/runtime/components/PageSection.vue +88 -0
  158. package/dist/runtime/components/PageSection.vue.d.ts +64 -0
  159. package/dist/runtime/components/Pagination.vue +47 -47
  160. package/dist/runtime/components/PinInput.vue +20 -20
  161. package/dist/runtime/components/Popover.vue +17 -17
  162. package/dist/runtime/components/PricingPlan.vue +129 -0
  163. package/dist/runtime/components/PricingPlan.vue.d.ts +109 -0
  164. package/dist/runtime/components/PricingPlans.vue +45 -0
  165. package/dist/runtime/components/PricingPlans.vue.d.ts +41 -0
  166. package/dist/runtime/components/PricingTable.vue +235 -0
  167. package/dist/runtime/components/PricingTable.vue.d.ts +98 -0
  168. package/dist/runtime/components/Progress.vue +19 -19
  169. package/dist/runtime/components/RadioGroup.vue +43 -43
  170. package/dist/runtime/components/Select.vue +96 -96
  171. package/dist/runtime/components/SelectMenu.vue +130 -130
  172. package/dist/runtime/components/SelectMenu.vue.d.ts +3 -3
  173. package/dist/runtime/components/Separator.vue +15 -15
  174. package/dist/runtime/components/Skeleton.vue +10 -10
  175. package/dist/runtime/components/Slideover.vue +76 -76
  176. package/dist/runtime/components/Slider.vue +27 -27
  177. package/dist/runtime/components/Stepper.vue +51 -51
  178. package/dist/runtime/components/Switch.vue +33 -33
  179. package/dist/runtime/components/Table.vue +77 -77
  180. package/dist/runtime/components/Tabs.vue +38 -37
  181. package/dist/runtime/components/Textarea.vue +33 -33
  182. package/dist/runtime/components/Timeline.vue +38 -38
  183. package/dist/runtime/components/Toast.vue +69 -69
  184. package/dist/runtime/components/Toaster.vue +28 -28
  185. package/dist/runtime/components/Tooltip.vue +19 -19
  186. package/dist/runtime/components/Tree.vue +60 -60
  187. package/dist/runtime/components/User.vue +69 -0
  188. package/dist/runtime/components/User.vue.d.ts +46 -0
  189. package/dist/runtime/components/color-mode/ColorModeAvatar.vue +2 -2
  190. package/dist/runtime/components/color-mode/ColorModeButton.vue +16 -16
  191. package/dist/runtime/components/color-mode/ColorModeImage.vue +2 -2
  192. package/dist/runtime/components/color-mode/ColorModeSelect.vue +19 -19
  193. package/dist/runtime/components/color-mode/ColorModeSwitch.vue +19 -19
  194. package/dist/runtime/components/content/ContentNavigation.vue +109 -109
  195. package/dist/runtime/components/content/ContentSearch.vue +25 -25
  196. package/dist/runtime/components/content/ContentSearchButton.vue +38 -38
  197. package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +58 -12
  198. package/dist/runtime/components/content/ContentSurround.vue +31 -31
  199. package/dist/runtime/components/content/ContentSurround.vue.d.ts +52 -59
  200. package/dist/runtime/components/content/ContentToc.vue +88 -76
  201. package/dist/runtime/components/content/ContentToc.vue.d.ts +86 -88
  202. package/dist/runtime/components/locale/LocaleSelect.vue +20 -20
  203. package/dist/runtime/components/prose/A.vue +3 -3
  204. package/dist/runtime/components/prose/Accordion.vue +5 -5
  205. package/dist/runtime/components/prose/AccordionItem.vue +5 -5
  206. package/dist/runtime/components/prose/Badge.vue +3 -3
  207. package/dist/runtime/components/prose/Blockquote.vue +3 -3
  208. package/dist/runtime/components/prose/Callout.vue +27 -27
  209. package/dist/runtime/components/prose/Card.vue +43 -43
  210. package/dist/runtime/components/prose/CardGroup.vue +3 -3
  211. package/dist/runtime/components/prose/Code.vue +3 -3
  212. package/dist/runtime/components/prose/CodeCollapse.vue +16 -16
  213. package/dist/runtime/components/prose/CodeGroup.vue +15 -15
  214. package/dist/runtime/components/prose/CodeIcon.vue +1 -1
  215. package/dist/runtime/components/prose/CodePreview.vue +9 -9
  216. package/dist/runtime/components/prose/CodeTree.vue +61 -61
  217. package/dist/runtime/components/prose/Collapsible.vue +15 -15
  218. package/dist/runtime/components/prose/Em.vue +1 -1
  219. package/dist/runtime/components/prose/Field.vue +23 -23
  220. package/dist/runtime/components/prose/FieldGroup.vue +3 -3
  221. package/dist/runtime/components/prose/H1.vue +6 -6
  222. package/dist/runtime/components/prose/H2.vue +10 -10
  223. package/dist/runtime/components/prose/H3.vue +10 -10
  224. package/dist/runtime/components/prose/H4.vue +6 -6
  225. package/dist/runtime/components/prose/Hr.vue +1 -1
  226. package/dist/runtime/components/prose/Icon.vue +1 -1
  227. package/dist/runtime/components/prose/Img.vue +8 -8
  228. package/dist/runtime/components/prose/Kbd.vue +1 -1
  229. package/dist/runtime/components/prose/Li.vue +3 -3
  230. package/dist/runtime/components/prose/Ol.vue +3 -3
  231. package/dist/runtime/components/prose/P.vue +3 -3
  232. package/dist/runtime/components/prose/Pre.vue +20 -20
  233. package/dist/runtime/components/prose/Script.vue +3 -3
  234. package/dist/runtime/components/prose/Steps.vue +3 -3
  235. package/dist/runtime/components/prose/Strong.vue +3 -3
  236. package/dist/runtime/components/prose/Table.vue +5 -5
  237. package/dist/runtime/components/prose/Tabs.vue +14 -14
  238. package/dist/runtime/components/prose/TabsItem.vue +5 -5
  239. package/dist/runtime/components/prose/Tbody.vue +3 -3
  240. package/dist/runtime/components/prose/Td.vue +3 -3
  241. package/dist/runtime/components/prose/Th.vue +3 -3
  242. package/dist/runtime/components/prose/Thead.vue +3 -3
  243. package/dist/runtime/components/prose/Tr.vue +3 -3
  244. package/dist/runtime/components/prose/Ul.vue +3 -3
  245. package/dist/runtime/components/prose/callout/Caution.vue +3 -3
  246. package/dist/runtime/components/prose/callout/Note.vue +3 -3
  247. package/dist/runtime/components/prose/callout/Tip.vue +3 -3
  248. package/dist/runtime/components/prose/callout/Warning.vue +3 -3
  249. package/dist/runtime/inertia/components/Link.vue +12 -12
  250. package/dist/runtime/inertia/components/LinkBase.vue +15 -15
  251. package/dist/runtime/types/app.config.d.ts +6 -6
  252. package/dist/runtime/types/index.d.ts +33 -0
  253. package/dist/runtime/types/index.js +33 -0
  254. package/dist/runtime/vue/components/Icon.vue +1 -1
  255. package/dist/runtime/vue/components/Link.vue +31 -31
  256. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +7 -7
  257. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +7 -7
  258. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +7 -7
  259. package/dist/shared/{ui.DQZ75GCP.mjs → ui.DErCA3YU.mjs} +1247 -50
  260. package/dist/unplugin.mjs +1 -1
  261. package/dist/vite.mjs +1 -1
  262. package/package.json +1 -1
  263. package/vue-plugin.d.ts +5 -5
  264. package/.nuxt/ui/prose.ts +0 -321
@@ -0,0 +1,68 @@
1
+ import theme from '#build/ui/banner';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import type { ButtonProps, LinkProps, ComponentConfig } from '../types';
4
+ type Banner = ComponentConfig<typeof theme, AppConfig, 'banner'>;
5
+ export interface BannerProps {
6
+ /**
7
+ * The element or component this component should render as.
8
+ * @defaultValue 'div'
9
+ */
10
+ as?: any;
11
+ /**
12
+ * A unique id saved to local storage to remember if the banner has been dismissed.
13
+ * Change this value to show the banner again.
14
+ * @defaultValue '1'
15
+ */
16
+ id?: string;
17
+ /**
18
+ * The icon displayed next to the title.
19
+ * @IconifyIcon
20
+ */
21
+ icon?: string;
22
+ title?: string;
23
+ /**
24
+ * Display a list of actions next to the title.
25
+ * `{ color: 'neutral', size: 'xs' }`{lang="ts-type"}
26
+ */
27
+ actions?: ButtonProps[];
28
+ to?: LinkProps['to'];
29
+ target?: LinkProps['target'];
30
+ /**
31
+ * @defaultValue 'primary'
32
+ */
33
+ color?: Banner['variants']['color'];
34
+ /**
35
+ * Display a close button to dismiss the banner.
36
+ * `{ size: 'md', color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
37
+ * @emits `close`
38
+ * @defaultValue false
39
+ */
40
+ close?: boolean | Partial<ButtonProps>;
41
+ /**
42
+ * The icon displayed in the close button.
43
+ * @defaultValue appConfig.ui.icons.close
44
+ * @IconifyIcon
45
+ */
46
+ closeIcon?: string;
47
+ class?: any;
48
+ ui?: Banner['slots'];
49
+ }
50
+ export interface BannerSlots {
51
+ leading(props?: {}): any;
52
+ title(props?: {}): any;
53
+ actions(props?: {}): any;
54
+ close(props: {
55
+ ui: any;
56
+ }): any;
57
+ }
58
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<BannerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
59
+ close: (...args: any[]) => void;
60
+ }, string, import("vue").PublicProps, Readonly<BannerProps> & Readonly<{
61
+ onClose?: ((...args: any[]) => any) | undefined;
62
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, BannerSlots>;
63
+ export default _default;
64
+ type __VLS_WithSlots<T, S> = T & {
65
+ new (): {
66
+ $slots: S;
67
+ };
68
+ };
@@ -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
+ };
@@ -30,36 +30,36 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.breadcrumb ||
30
30
  </script>
31
31
 
32
32
  <template>
33
- <Primitive :as="as" aria-label="breadcrumb" :class="ui.root({ class: [props.ui?.root, props.class] })">
34
- <ol :class="ui.list({ class: props.ui?.list })">
35
- <template v-for="(item, index) in items" :key="index">
36
- <li :class="ui.item({ class: [props.ui?.item, item.ui?.item] })">
37
- <ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
38
- <ULinkBase v-bind="slotProps" as="span" :aria-current="active && index === items.length - 1 ? 'page' : void 0" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: index === items.length - 1, disabled: !!item.disabled, to: !!item.to })">
39
- <slot :name="item.slot || 'item'" :item="item" :index="index">
40
- <slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="index === items.length - 1" :index="index">
41
- <UIcon v-if="item.icon" :name="item.icon" :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon], active: index === items.length - 1 })" />
42
- <UAvatar v-else-if="item.avatar" :size="props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()" v-bind="item.avatar" :class="ui.linkLeadingAvatar({ class: [props.ui?.linkLeadingAvatar, item.ui?.linkLeadingAvatar], active: index === items.length - 1 })" />
43
- </slot>
44
-
45
- <span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })">
46
- <slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="index === items.length - 1" :index="index">
47
- {{ get(item, props.labelKey) }}
48
- </slot>
49
- </span>
50
-
51
- <slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="index === items.length - 1" :index="index" />
52
- </slot>
53
- </ULinkBase>
54
- </ULink>
55
- </li>
56
-
57
- <li v-if="index < items.length - 1" role="presentation" aria-hidden="true" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })">
58
- <slot name="separator">
59
- <UIcon :name="separatorIcon" :class="ui.separatorIcon({ class: [props.ui?.separatorIcon, item.ui?.separatorIcon] })" />
60
- </slot>
61
- </li>
62
- </template>
63
- </ol>
64
- </Primitive>
33
+ <Primitive :as="as" aria-label="breadcrumb" :class="ui.root({ class: [props.ui?.root, props.class] })">
34
+ <ol :class="ui.list({ class: props.ui?.list })">
35
+ <template v-for="(item, index) in items" :key="index">
36
+ <li :class="ui.item({ class: [props.ui?.item, item.ui?.item] })">
37
+ <ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
38
+ <ULinkBase v-bind="slotProps" as="span" :aria-current="active && index === items.length - 1 ? 'page' : void 0" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: index === items.length - 1, disabled: !!item.disabled, to: !!item.to })">
39
+ <slot :name="item.slot || 'item'" :item="item" :index="index">
40
+ <slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="index === items.length - 1" :index="index">
41
+ <UIcon v-if="item.icon" :name="item.icon" :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon], active: index === items.length - 1 })" />
42
+ <UAvatar v-else-if="item.avatar" :size="props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()" v-bind="item.avatar" :class="ui.linkLeadingAvatar({ class: [props.ui?.linkLeadingAvatar, item.ui?.linkLeadingAvatar], active: index === items.length - 1 })" />
43
+ </slot>
44
+
45
+ <span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })">
46
+ <slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="index === items.length - 1" :index="index">
47
+ {{ get(item, props.labelKey) }}
48
+ </slot>
49
+ </span>
50
+
51
+ <slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="index === items.length - 1" :index="index" />
52
+ </slot>
53
+ </ULinkBase>
54
+ </ULink>
55
+ </li>
56
+
57
+ <li v-if="index < items.length - 1" role="presentation" aria-hidden="true" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })">
58
+ <slot name="separator">
59
+ <UIcon :name="separatorIcon" :class="ui.separatorIcon({ class: [props.ui?.separatorIcon, item.ui?.separatorIcon] })" />
60
+ </slot>
61
+ </li>
62
+ </template>
63
+ </ol>
64
+ </Primitive>
65
65
  </template>
@@ -111,37 +111,37 @@ const ui = computed(() => tv({
111
111
  </script>
112
112
 
113
113
  <template>
114
- <ULink
115
- v-slot="{ active, ...slotProps }"
116
- :type="type"
117
- :disabled="disabled || isLoading"
118
- v-bind="omit(linkProps, ['type', 'disabled', 'onClick'])"
119
- custom
120
- >
121
- <ULinkBase
122
- v-bind="slotProps"
114
+ <ULink
115
+ v-slot="{ active, ...slotProps }"
116
+ :type="type"
117
+ :disabled="disabled || isLoading"
118
+ v-bind="omit(linkProps, ['type', 'disabled', 'onClick'])"
119
+ custom
120
+ >
121
+ <ULinkBase
122
+ v-bind="slotProps"
123
123
  :class="ui.base({
124
124
  class: [props.ui?.base, props.class],
125
125
  active,
126
126
  ...active && activeVariant ? { variant: activeVariant } : {},
127
127
  ...active && activeColor ? { color: activeColor } : {}
128
- })"
129
- @click="onClickWrapper"
130
- >
131
- <slot name="leading">
132
- <UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon, active })" />
133
- <UAvatar v-else-if="!!avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar, active })" />
134
- </slot>
135
-
136
- <slot>
137
- <span v-if="label !== void 0 && label !== null" :class="ui.label({ class: props.ui?.label, active })">
138
- {{ label }}
139
- </span>
140
- </slot>
141
-
142
- <slot name="trailing">
143
- <UIcon v-if="isTrailing && trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon, active })" />
144
- </slot>
145
- </ULinkBase>
146
- </ULink>
128
+ })"
129
+ @click="onClickWrapper"
130
+ >
131
+ <slot name="leading">
132
+ <UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon, active })" />
133
+ <UAvatar v-else-if="!!avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar, active })" />
134
+ </slot>
135
+
136
+ <slot>
137
+ <span v-if="label !== void 0 && label !== null" :class="ui.label({ class: props.ui?.label, active })">
138
+ {{ label }}
139
+ </span>
140
+ </slot>
141
+
142
+ <slot name="trailing">
143
+ <UIcon v-if="isTrailing && trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon, active })" />
144
+ </slot>
145
+ </ULinkBase>
146
+ </ULink>
147
147
  </template>
@@ -25,7 +25,7 @@ provide(buttonGroupInjectionKey, computed(() => ({
25
25
  </script>
26
26
 
27
27
  <template>
28
- <Primitive :as="as" :class="ui({ orientation, class: props.class })">
29
- <slot />
30
- </Primitive>
28
+ <Primitive :as="as" :class="ui({ orientation, class: props.class })">
29
+ <slot />
30
+ </Primitive>
31
31
  </template>
@@ -77,78 +77,78 @@ const Calendar = computed(() => props.range ? RangeCalendar : SingleCalendar);
77
77
  </script>
78
78
 
79
79
  <template>
80
- <Calendar.Root
81
- v-slot="{ weekDays, grid }"
82
- v-bind="rootProps"
83
- :model-value="modelValue"
84
- :default-value="defaultValue"
85
- :locale="locale"
86
- :dir="dir"
87
- :class="ui.root({ class: [props.ui?.root, props.class] })"
88
- >
89
- <Calendar.Header :class="ui.header({ class: props.ui?.header })">
90
- <Calendar.Prev v-if="props.yearControls" :prev-page="(date) => paginateYear(date, -1)" :aria-label="t('calendar.prevYear')" as-child>
91
- <UButton :icon="prevYearIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.prevYear" />
92
- </Calendar.Prev>
93
- <Calendar.Prev v-if="props.monthControls" :aria-label="t('calendar.prevMonth')" as-child>
94
- <UButton :icon="prevMonthIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.prevMonth" />
95
- </Calendar.Prev>
96
- <Calendar.Heading v-slot="{ headingValue }" :class="ui.heading({ class: props.ui?.heading })">
97
- <slot name="heading" :value="headingValue">
98
- {{ headingValue }}
99
- </slot>
100
- </Calendar.Heading>
101
- <Calendar.Next v-if="props.monthControls" :aria-label="t('calendar.nextMonth')" as-child>
102
- <UButton :icon="nextMonthIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.nextMonth" />
103
- </Calendar.Next>
104
- <Calendar.Next v-if="props.yearControls" :next-page="(date) => paginateYear(date, 1)" :aria-label="t('calendar.nextYear')" as-child>
105
- <UButton :icon="nextYearIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.nextYear" />
106
- </Calendar.Next>
107
- </Calendar.Header>
108
- <div :class="ui.body({ class: props.ui?.body })">
109
- <Calendar.Grid
110
- v-for="month in grid"
111
- :key="month.value.toString()"
112
- :class="ui.grid({ class: props.ui?.grid })"
113
- >
114
- <Calendar.GridHead>
115
- <Calendar.GridRow :class="ui.gridWeekDaysRow({ class: props.ui?.gridWeekDaysRow })">
116
- <Calendar.HeadCell
117
- v-for="day in weekDays"
118
- :key="day"
119
- :class="ui.headCell({ class: props.ui?.headCell })"
120
- >
121
- <slot name="week-day" :day="day">
122
- {{ day }}
123
- </slot>
124
- </Calendar.HeadCell>
125
- </Calendar.GridRow>
126
- </Calendar.GridHead>
127
- <Calendar.GridBody :class="ui.gridBody({ class: props.ui?.gridBody })">
128
- <Calendar.GridRow
129
- v-for="(weekDates, index) in month.rows"
130
- :key="`weekDate-${index}`"
131
- :class="ui.gridRow({ class: props.ui?.gridRow })"
132
- >
133
- <Calendar.Cell
134
- v-for="weekDate in weekDates"
135
- :key="weekDate.toString()"
136
- :date="weekDate"
137
- :class="ui.cell({ class: props.ui?.cell })"
138
- >
139
- <Calendar.CellTrigger
140
- :day="weekDate"
141
- :month="month.value"
142
- :class="ui.cellTrigger({ class: props.ui?.cellTrigger })"
143
- >
144
- <slot name="day" :day="weekDate">
145
- {{ weekDate.day }}
146
- </slot>
147
- </Calendar.CellTrigger>
148
- </Calendar.Cell>
149
- </Calendar.GridRow>
150
- </Calendar.GridBody>
151
- </Calendar.Grid>
152
- </div>
153
- </Calendar.Root>
80
+ <Calendar.Root
81
+ v-slot="{ weekDays, grid }"
82
+ v-bind="rootProps"
83
+ :model-value="modelValue"
84
+ :default-value="defaultValue"
85
+ :locale="locale"
86
+ :dir="dir"
87
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
88
+ >
89
+ <Calendar.Header :class="ui.header({ class: props.ui?.header })">
90
+ <Calendar.Prev v-if="props.yearControls" :prev-page="(date) => paginateYear(date, -1)" :aria-label="t('calendar.prevYear')" as-child>
91
+ <UButton :icon="prevYearIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.prevYear" />
92
+ </Calendar.Prev>
93
+ <Calendar.Prev v-if="props.monthControls" :aria-label="t('calendar.prevMonth')" as-child>
94
+ <UButton :icon="prevMonthIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.prevMonth" />
95
+ </Calendar.Prev>
96
+ <Calendar.Heading v-slot="{ headingValue }" :class="ui.heading({ class: props.ui?.heading })">
97
+ <slot name="heading" :value="headingValue">
98
+ {{ headingValue }}
99
+ </slot>
100
+ </Calendar.Heading>
101
+ <Calendar.Next v-if="props.monthControls" :aria-label="t('calendar.nextMonth')" as-child>
102
+ <UButton :icon="nextMonthIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.nextMonth" />
103
+ </Calendar.Next>
104
+ <Calendar.Next v-if="props.yearControls" :next-page="(date) => paginateYear(date, 1)" :aria-label="t('calendar.nextYear')" as-child>
105
+ <UButton :icon="nextYearIcon" :size="props.size" color="neutral" variant="ghost" v-bind="props.nextYear" />
106
+ </Calendar.Next>
107
+ </Calendar.Header>
108
+ <div :class="ui.body({ class: props.ui?.body })">
109
+ <Calendar.Grid
110
+ v-for="month in grid"
111
+ :key="month.value.toString()"
112
+ :class="ui.grid({ class: props.ui?.grid })"
113
+ >
114
+ <Calendar.GridHead>
115
+ <Calendar.GridRow :class="ui.gridWeekDaysRow({ class: props.ui?.gridWeekDaysRow })">
116
+ <Calendar.HeadCell
117
+ v-for="day in weekDays"
118
+ :key="day"
119
+ :class="ui.headCell({ class: props.ui?.headCell })"
120
+ >
121
+ <slot name="week-day" :day="day">
122
+ {{ day }}
123
+ </slot>
124
+ </Calendar.HeadCell>
125
+ </Calendar.GridRow>
126
+ </Calendar.GridHead>
127
+ <Calendar.GridBody :class="ui.gridBody({ class: props.ui?.gridBody })">
128
+ <Calendar.GridRow
129
+ v-for="(weekDates, index) in month.rows"
130
+ :key="`weekDate-${index}`"
131
+ :class="ui.gridRow({ class: props.ui?.gridRow })"
132
+ >
133
+ <Calendar.Cell
134
+ v-for="weekDate in weekDates"
135
+ :key="weekDate.toString()"
136
+ :date="weekDate"
137
+ :class="ui.cell({ class: props.ui?.cell })"
138
+ >
139
+ <Calendar.CellTrigger
140
+ :day="weekDate"
141
+ :month="month.value"
142
+ :class="ui.cellTrigger({ class: props.ui?.cellTrigger })"
143
+ >
144
+ <slot name="day" :day="weekDate">
145
+ {{ weekDate.day }}
146
+ </slot>
147
+ </Calendar.CellTrigger>
148
+ </Calendar.Cell>
149
+ </Calendar.GridRow>
150
+ </Calendar.GridBody>
151
+ </Calendar.Grid>
152
+ </div>
153
+ </Calendar.Root>
154
154
  </template>