@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,64 @@
1
+ import theme from '#build/ui/page-section';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import type { ButtonProps, ComponentConfig, PageFeatureProps } from '../types';
4
+ type PageSection = ComponentConfig<typeof theme, AppConfig, 'pageSection'>;
5
+ export interface PageSectionProps {
6
+ /**
7
+ * The element or component this component should render as.
8
+ * @defaultValue 'section'
9
+ */
10
+ as?: any;
11
+ /**
12
+ * The headline displayed above the title.
13
+ */
14
+ headline?: string;
15
+ /**
16
+ * The icon displayed above the title.
17
+ * @IconifyIcon
18
+ */
19
+ icon?: string;
20
+ title?: string;
21
+ description?: string;
22
+ /**
23
+ * Display a list of Button under the description.
24
+ * `{ size: 'lg' }`{lang="ts-type"}
25
+ */
26
+ links?: ButtonProps[];
27
+ /**
28
+ * Display a list of PageFeature under the description.
29
+ */
30
+ features?: PageFeatureProps[];
31
+ /**
32
+ * The orientation of the section.
33
+ * @defaultValue 'vertical'
34
+ */
35
+ orientation?: PageSection['variants']['orientation'];
36
+ /**
37
+ * Reverse the order of the default slot.
38
+ * @defaultValue false
39
+ */
40
+ reverse?: boolean;
41
+ class?: any;
42
+ ui?: PageSection['slots'];
43
+ }
44
+ export interface PageSectionSlots {
45
+ default(props?: {}): any;
46
+ top(props?: {}): any;
47
+ bottom(props?: {}): any;
48
+ headline(props?: {}): any;
49
+ leading(props?: {}): any;
50
+ title(props?: {}): any;
51
+ description(props?: {}): any;
52
+ links(props?: {}): any;
53
+ features(props?: {}): any;
54
+ }
55
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PageSectionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageSectionProps> & Readonly<{}>, {
56
+ as: any;
57
+ orientation: PageSection["variants"]["orientation"];
58
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PageSectionSlots>;
59
+ export default _default;
60
+ type __VLS_WithSlots<T, S> = T & {
61
+ new (): {
62
+ $slots: S;
63
+ };
64
+ };
@@ -0,0 +1,129 @@
1
+ <script>
2
+ import theme from "#build/ui/pricing-plan";
3
+ import { tv } from "../utils/tv";
4
+ </script>
5
+
6
+ <script setup>
7
+ import { computed } from "vue";
8
+ import { Primitive } from "reka-ui";
9
+ import { createReusableTemplate } from "@vueuse/core";
10
+ import { useAppConfig } from "#imports";
11
+ const props = defineProps({
12
+ as: { type: null, required: false },
13
+ title: { type: String, required: false },
14
+ description: { type: String, required: false },
15
+ badge: { type: [String, Object], required: false },
16
+ billingCycle: { type: String, required: false },
17
+ billingPeriod: { type: String, required: false },
18
+ price: { type: String, required: false },
19
+ discount: { type: String, required: false },
20
+ features: { type: Array, required: false },
21
+ button: { type: Object, required: false },
22
+ tagline: { type: String, required: false },
23
+ terms: { type: String, required: false },
24
+ orientation: { type: null, required: false, default: "vertical" },
25
+ variant: { type: null, required: false },
26
+ highlight: { type: Boolean, required: false },
27
+ scale: { type: Boolean, required: false },
28
+ class: { type: null, required: false },
29
+ ui: { type: null, required: false }
30
+ });
31
+ const slots = defineSlots();
32
+ const appConfig = useAppConfig();
33
+ const [DefinePriceTemplate, ReusePriceTemplate] = createReusableTemplate();
34
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.pricingPlan || {} })({
35
+ orientation: props.orientation,
36
+ variant: props.variant,
37
+ highlight: props.highlight,
38
+ scale: props.scale
39
+ }));
40
+ const features = computed(() => props.features?.map((feature) => typeof feature === "string" ? { title: feature } : feature));
41
+ </script>
42
+
43
+ <template>
44
+ <DefinePriceTemplate>
45
+ <div v-if="discount || price || !!slots.discount || !!slots.price || billingCycle || billingPeriod || !!slots.billing" :class="ui.priceWrapper({ class: props.ui?.priceWrapper })">
46
+ <div v-if="discount && price || !!slots.discount" :class="ui.discount({ class: props.ui?.discount })">
47
+ <slot name="discount">
48
+ {{ price }}
49
+ </slot>
50
+ </div>
51
+
52
+ <div v-if="discount || price || !!slots.price" :class="ui.price({ class: props.ui?.price })">
53
+ <slot name="price">
54
+ {{ discount || price }}
55
+ </slot>
56
+ </div>
57
+
58
+ <div v-if="billingCycle || billingPeriod || !!slots.billing" :class="ui.billing({ class: props.ui?.billing })">
59
+ <slot name="billing">
60
+ <span :class="ui.billingPeriod({ class: props.ui?.billingPeriod })">
61
+ {{ billingPeriod || "\xA0" }}
62
+ </span>
63
+
64
+ <span v-if="billingCycle" :class="ui.billingCycle({ class: props.ui?.billingCycle })">
65
+ {{ billingCycle }}
66
+ </span>
67
+ </slot>
68
+ </div>
69
+ </div>
70
+ </DefinePriceTemplate>
71
+
72
+ <Primitive :as="as" :data-orientation="orientation" :class="ui.root({ class: [props.ui?.root, props.class] })">
73
+ <div v-if="!!slots.header && orientation === 'vertical'" :class="ui.header({ class: props.ui?.header })">
74
+ <slot name="header" />
75
+ </div>
76
+
77
+ <div :class="ui.body({ class: props.ui?.body })">
78
+ <slot name="body">
79
+ <div :class="ui.titleWrapper({ class: props.ui?.titleWrapper })">
80
+ <div v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">
81
+ <slot name="title">
82
+ {{ title }}
83
+ </slot>
84
+ </div>
85
+
86
+ <slot name="badge">
87
+ <UBadge v-if="badge" color="primary" variant="subtle" v-bind="typeof badge === 'string' ? { label: badge } : badge" :class="ui.badge({ class: props.ui?.badge })" />
88
+ </slot>
89
+ </div>
90
+
91
+ <div v-if="description || !!slots.description" :class="ui.description({ class: props.ui?.description })">
92
+ <slot name="description">
93
+ {{ description }}
94
+ </slot>
95
+ </div>
96
+
97
+ <ReusePriceTemplate v-if="orientation === 'vertical'" />
98
+
99
+ <ul v-if="features?.length || !!slots.features" :class="ui.features({ class: props.ui?.features })">
100
+ <slot name="features">
101
+ <li v-for="(feature, index) in features" :key="index" :class="ui.feature({ class: props.ui?.feature })">
102
+ <UIcon :name="feature.icon || appConfig.ui.icons.success" :class="ui.featureIcon({ class: props.ui?.featureIcon })" />
103
+
104
+ <span :class="ui.featureTitle({ class: props.ui?.featureTitle })">{{ feature.title }}</span>
105
+ </li>
106
+ </slot>
107
+ </ul>
108
+ </slot>
109
+ </div>
110
+
111
+ <div v-if="terms || (button || !!slots.button) || orientation === 'horizontal' || tagline || !!slots.footer" :class="ui.footer({ class: props.ui?.footer })">
112
+ <slot name="footer">
113
+ <p v-if="tagline" :class="ui.tagline({ class: props.ui?.tagline })">
114
+ {{ tagline }}
115
+ </p>
116
+
117
+ <ReusePriceTemplate v-if="orientation === 'horizontal'" />
118
+
119
+ <slot name="button">
120
+ <UButton v-if="button" v-bind="{ block: true, size: 'lg', ...button }" :class="ui.button({ class: props.ui?.button })" @click="button?.onClick" />
121
+ </slot>
122
+
123
+ <p v-if="terms" :class="ui.terms({ class: props.ui?.terms })">
124
+ {{ terms }}
125
+ </p>
126
+ </slot>
127
+ </div>
128
+ </Primitive>
129
+ </template>
@@ -0,0 +1,109 @@
1
+ import theme from '#build/ui/pricing-plan';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import type { BadgeProps, ButtonProps, ComponentConfig } from '../types';
4
+ type PricingPlan = ComponentConfig<typeof theme, AppConfig, 'pricingPlan'>;
5
+ type PricingPlanFeature = {
6
+ title: string;
7
+ /**
8
+ * @defaultValue appConfig.ui.icons.success
9
+ * @IconifyIcon
10
+ */
11
+ icon?: string;
12
+ };
13
+ export interface PricingPlanProps {
14
+ /**
15
+ * The element or component this component should render as.
16
+ * @defaultValue 'div'
17
+ */
18
+ as?: any;
19
+ title?: string;
20
+ description?: string;
21
+ /**
22
+ * Display a badge next to the title.
23
+ * Can be a string or an object.
24
+ * `{ color: 'primary', variant: 'subtle' }`{lang="ts-type"}
25
+ */
26
+ badge?: string | BadgeProps;
27
+ /**
28
+ * The unit price period that appears next to the price.
29
+ * Typically used to show the recurring interval.
30
+ * @example "/month", "/year", "/seat/month"
31
+ */
32
+ billingCycle?: string;
33
+ /**
34
+ * Additional billing context that appears above the billing cycle.
35
+ * Typically used to show the actual billing frequency.
36
+ * @example "billed annually", "billed monthly", "per user, billed annually"
37
+ */
38
+ billingPeriod?: string;
39
+ /**
40
+ * The current price of the plan.
41
+ * When used with `discount`, this becomes the original price.
42
+ * @example "$99", "€99", "Free"
43
+ */
44
+ price?: string;
45
+ /**
46
+ * The discounted price of the plan.
47
+ * When provided, the `price` prop will be displayed as strikethrough.
48
+ * @example "$79", "€79"
49
+ */
50
+ discount?: string;
51
+ /**
52
+ * Display a list of features under the price.
53
+ * Can be an array of strings or an array of objects.
54
+ */
55
+ features?: string[] | PricingPlanFeature[];
56
+ /**
57
+ * Display a buy button at the bottom.
58
+ * `{ size: 'lg', block: true }`{lang="ts-type"}
59
+ * Use the `onClick` field to add a click handler.
60
+ */
61
+ button?: ButtonProps;
62
+ /**
63
+ * Display a tagline highlighting the pricing value proposition.
64
+ * @example 'Pay once, own it forever'
65
+ */
66
+ tagline?: string;
67
+ /**
68
+ * Display terms at the bottom.
69
+ * @example '14-day free trial'
70
+ */
71
+ terms?: string;
72
+ /**
73
+ * The orientation of the pricing plan.
74
+ * @defaultValue 'vertical'
75
+ */
76
+ orientation?: PricingPlan['variants']['orientation'];
77
+ /**
78
+ * @defaultValue 'outline'
79
+ */
80
+ variant?: PricingPlan['variants']['variant'];
81
+ /** Display a ring around the pricing plan to highlight it. */
82
+ highlight?: boolean;
83
+ /** Enlarge the plan to make it more prominent. */
84
+ scale?: boolean;
85
+ class?: any;
86
+ ui?: PricingPlan['slots'];
87
+ }
88
+ export interface PricingPlanSlots {
89
+ badge(props?: {}): any;
90
+ title(props?: {}): any;
91
+ description(props?: {}): any;
92
+ price(props?: {}): any;
93
+ discount(props?: {}): any;
94
+ billing(props?: {}): any;
95
+ features(props?: {}): any;
96
+ button(props?: {}): any;
97
+ header(props?: {}): any;
98
+ body(props?: {}): any;
99
+ footer(props?: {}): any;
100
+ }
101
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PricingPlanProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PricingPlanProps> & Readonly<{}>, {
102
+ orientation: PricingPlan["variants"]["orientation"];
103
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PricingPlanSlots>;
104
+ export default _default;
105
+ type __VLS_WithSlots<T, S> = T & {
106
+ new (): {
107
+ $slots: S;
108
+ };
109
+ };
@@ -0,0 +1,45 @@
1
+ <script>
2
+ import theme from "#build/ui/pricing-plans";
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 UPricingPlan from "./PricingPlan.vue";
11
+ const props = defineProps({
12
+ as: { type: null, required: false },
13
+ plans: { type: Array, required: false },
14
+ orientation: { type: null, required: false, default: "horizontal" },
15
+ compact: { type: Boolean, required: false },
16
+ scale: { type: Boolean, required: false },
17
+ class: { type: null, required: false }
18
+ });
19
+ const slots = defineSlots();
20
+ const appConfig = useAppConfig();
21
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.pricingPlans || {} }));
22
+ const count = computed(() => props.plans?.length || slots.default?.()?.flatMap(mapSlot).filter(Boolean)?.length || 3);
23
+ function mapSlot(slot) {
24
+ if (typeof slot.type === "symbol") {
25
+ if (slot.children && Array.isArray(slot.children)) {
26
+ return slot.children.map(mapSlot);
27
+ }
28
+ return;
29
+ }
30
+ return slot;
31
+ }
32
+ </script>
33
+
34
+ <template>
35
+ <Primitive :as="as" :data-orientation="orientation" :class="ui({ class: props.class, compact, scale, orientation })" :style="{ '--count': count }">
36
+ <slot>
37
+ <UPricingPlan
38
+ v-for="(plan, index) in plans"
39
+ :key="index"
40
+ :orientation="orientation === 'vertical' ? 'horizontal' : 'vertical'"
41
+ v-bind="plan"
42
+ />
43
+ </slot>
44
+ </Primitive>
45
+ </template>
@@ -0,0 +1,41 @@
1
+ import theme from '#build/ui/pricing-plans';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import type { ComponentConfig, PricingPlanProps } from '../types';
4
+ type PricingPlans = ComponentConfig<typeof theme, AppConfig, 'pricingPlans'>;
5
+ export interface PricingPlansProps {
6
+ /**
7
+ * The element or component this component should render as.
8
+ * @defaultValue 'div'
9
+ */
10
+ as?: any;
11
+ plans?: PricingPlanProps[];
12
+ /**
13
+ * The orientation of the pricing plans.
14
+ * @defaultValue 'horizontal'
15
+ */
16
+ orientation?: PricingPlans['variants']['orientation'];
17
+ /**
18
+ * When `true`, the plans will be displayed without gap.
19
+ * @defaultValue false
20
+ */
21
+ compact?: boolean;
22
+ /**
23
+ * When `true`, the plans will be displayed with a larger gap.
24
+ * Useful when one plan is scaled. Doesn't work with `compact`.
25
+ * @defaultValue false
26
+ */
27
+ scale?: boolean;
28
+ class?: any;
29
+ }
30
+ export interface PricingPlansSlots {
31
+ default(props?: {}): any;
32
+ }
33
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PricingPlansProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PricingPlansProps> & Readonly<{}>, {
34
+ orientation: PricingPlans["variants"]["orientation"];
35
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PricingPlansSlots>;
36
+ export default _default;
37
+ type __VLS_WithSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
@@ -0,0 +1,235 @@
1
+ <script>
2
+ import theme from "#build/ui/pricing-table";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { Primitive } from "reka-ui";
8
+ import { createReusableTemplate } from "@vueuse/core";
9
+ import { useAppConfig } from "#imports";
10
+ import { useLocalePro } from "../composables/useLocalePro";
11
+ import { tv } from "../utils/tv";
12
+ const props = defineProps({
13
+ as: { type: null, required: false },
14
+ caption: { type: String, required: false },
15
+ tiers: { type: Array, required: true },
16
+ sections: { type: Array, required: true },
17
+ class: { type: null, required: false },
18
+ ui: { type: null, required: false }
19
+ });
20
+ const slots = defineSlots();
21
+ const { t } = useLocalePro();
22
+ const appConfig = useAppConfig();
23
+ const formatSlotName = (item) => {
24
+ if (item.id) return item.id;
25
+ return item.title.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
26
+ };
27
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.pricingTable || {} })());
28
+ const [DefineTierTemplate, ReuseTierTemplate] = createReusableTemplate({
29
+ props: {
30
+ tier: Object
31
+ }
32
+ });
33
+ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
34
+ props: {
35
+ tier: Object,
36
+ feature: Object
37
+ }
38
+ });
39
+ </script>
40
+
41
+ <template>
42
+ <DefineTierTemplate v-slot="{ tier }">
43
+ <slot :name="tier.id" :tier="tier">
44
+ <slot name="tier" :tier="tier">
45
+ <div :class="ui.tierTitleWrapper({ class: props.ui?.tierTitleWrapper })">
46
+ <div :class="ui.tierTitle({ class: props.ui?.tierTitle })">
47
+ <slot :name="`${tier.id}-title`" :tier="tier">
48
+ <slot name="tier-title" :tier="tier">
49
+ {{ tier.title }}
50
+ </slot>
51
+ </slot>
52
+ </div>
53
+
54
+ <slot :name="`${tier.id}-badge`" :tier="tier">
55
+ <slot name="tier-badge" :tier="tier">
56
+ <UBadge
57
+ v-if="tier.badge"
58
+ color="primary"
59
+ variant="subtle"
60
+ v-bind="typeof tier.badge === 'string' ? { label: tier.badge } : tier.badge"
61
+ :class="ui.tierBadge({ class: props.ui?.tierBadge })"
62
+ />
63
+ </slot>
64
+ </slot>
65
+ </div>
66
+
67
+ <div v-if="tier.description || !!slots['tier-description'] || !!slots[`${tier.id}-description`]" :class="ui.tierDescription({ class: props.ui?.tierDescription })">
68
+ <slot :name="`${tier.id}-description`" :tier="tier">
69
+ <slot name="tier-description" :tier="tier">
70
+ {{ tier.description }}
71
+ </slot>
72
+ </slot>
73
+ </div>
74
+
75
+ <div v-if="tier.discount || tier.price || !!slots['tier-discount'] || !!slots[`${tier.id}-discount`] || !!slots['tier-price'] || !!slots[`${tier.id}-price`] || tier.billingCycle || tier.billingPeriod || !!slots['tier-billing'] || !!slots[`${tier.id}-billing`]" :class="ui.tierPriceWrapper({ class: props.ui?.tierPriceWrapper })">
76
+ <div v-if="tier.discount && tier.price || !!slots[`${tier.id}-discount`] || !!slots['tier-discount']" :class="ui.tierDiscount({ class: props.ui?.tierDiscount })">
77
+ <slot :name="`${tier.id}-discount`" :tier="tier">
78
+ <slot name="tier-discount" :tier="tier">
79
+ {{ tier.price }}
80
+ </slot>
81
+ </slot>
82
+ </div>
83
+
84
+ <div v-if="tier.discount || tier.price || !!slots[`${tier.id}-price`] || !!slots['tier-price']" :class="ui.tierPrice({ class: props.ui?.tierPrice })">
85
+ <slot :name="`${tier.id}-price`" :tier="tier">
86
+ <slot name="tier-price" :tier="tier">
87
+ {{ tier.discount || tier.price }}
88
+ </slot>
89
+ </slot>
90
+ </div>
91
+
92
+ <div v-if="tier.billingCycle || tier.billingPeriod || !!slots[`${tier.id}-billing`] || !!slots['tier-billing']" :class="ui.tierBilling({ class: props.ui?.tierBilling })">
93
+ <slot :name="`${tier.id}-billing`" :tier="tier">
94
+ <slot name="tier-billing" :tier="tier">
95
+ <span :class="ui.tierBillingPeriod({ class: props.ui?.tierBillingPeriod })">
96
+ {{ tier.billingPeriod || "\xA0" }}
97
+ </span>
98
+
99
+ <span v-if="tier.billingCycle" :class="ui.tierBillingCycle({ class: props.ui?.tierBillingCycle })">
100
+ {{ tier.billingCycle }}
101
+ </span>
102
+ </slot>
103
+ </slot>
104
+ </div>
105
+ </div>
106
+
107
+ <div v-if="!!slots[`${tier.id}-button`] || !!slots['tier-button'] || tier.button" :class="ui.tierButton({ class: props.ui?.tierButton })">
108
+ <slot :name="`${tier.id}-button`" :tier="tier">
109
+ <slot name="tier-button" :tier="tier">
110
+ <UButton v-if="tier.button" block size="lg" v-bind="tier.button" />
111
+ </slot>
112
+ </slot>
113
+ </div>
114
+ </slot>
115
+ </slot>
116
+ </DefineTierTemplate>
117
+
118
+ <DefineFeatureTemplate v-slot="{ feature, tier }">
119
+ <template v-if="feature.tiers?.[tier.id]">
120
+ <UIcon v-if="typeof feature.tiers[tier.id] === 'boolean'" :name="appConfig.ui.icons.success" :class="ui.tierFeatureIcon({ class: props.ui?.tierFeatureIcon, active: true })" />
121
+ <template v-else>
122
+ {{ feature.tiers[tier.id] }}
123
+ </template>
124
+ </template>
125
+
126
+ <UIcon v-else :name="appConfig.ui.icons.minus" :class="ui.tierFeatureIcon({ class: props.ui?.tierFeatureIcon })" />
127
+ </DefineFeatureTemplate>
128
+
129
+ <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
130
+ <table :class="ui.table({ class: props.ui?.table })">
131
+ <caption v-if="caption || !!slots.caption" :class="ui.caption({ class: [props.ui?.caption] })">
132
+ <slot name="caption">
133
+ {{ caption || t("pricingTable.caption") }}
134
+ </slot>
135
+ </caption>
136
+
137
+ <thead :class="ui.thead({ class: props.ui?.thead })">
138
+ <tr :class="ui.tr({ class: props.ui?.tr })">
139
+ <td />
140
+
141
+ <th
142
+ v-for="(tier, index) in tiers"
143
+ :key="index"
144
+ scope="col"
145
+ :class="ui.tier({ class: props.ui?.tier, highlight: tier.highlight })"
146
+ >
147
+ <ReuseTierTemplate :tier="tier" />
148
+ </th>
149
+ </tr>
150
+ </thead>
151
+
152
+ <tbody :class="ui.tbody({ class: props.ui?.tbody })">
153
+ <template v-for="(section, sectionIndex) in sections" :key="sectionIndex">
154
+ <tr :class="ui.tr({ class: props.ui?.tr, section: sectionIndex > 0 })">
155
+ <th scope="row" :class="ui.th({ class: props.ui?.th })">
156
+ <div v-if="section.title || !!slots['section-title'] || !!slots[`section-${formatSlotName(section)}-title`]" :class="ui.sectionTitle({ class: props.ui?.sectionTitle })">
157
+ <slot :name="`section-${formatSlotName(section)}-title`" :section="section">
158
+ <slot name="section-title" :section="section">
159
+ {{ section.title }}
160
+ </slot>
161
+ </slot>
162
+ </div>
163
+ </th>
164
+
165
+ <td
166
+ v-for="(tier, index) in tiers"
167
+ :key="`${sectionIndex}-tier-${index}`"
168
+ :class="ui.td({ class: props.ui?.td, highlight: tier.highlight })"
169
+ />
170
+ </tr>
171
+
172
+ <tr v-for="(feature, featureIndex) in section.features" :key="`${sectionIndex}-feature-${featureIndex}`">
173
+ <th scope="row" :class="ui.th({ class: props.ui?.th })">
174
+ <div :class="ui.featureTitle({ class: props.ui?.featureTitle })">
175
+ <slot :name="`feature-${formatSlotName(feature)}-title`" :feature="feature" :section="section">
176
+ <slot name="feature-title" :feature="feature" :section="section">
177
+ {{ feature.title }}
178
+ </slot>
179
+ </slot>
180
+ </div>
181
+ </th>
182
+
183
+ <td
184
+ v-for="(tier, index) in tiers"
185
+ :key="`${sectionIndex}-feature-${featureIndex}-tier-${index}`"
186
+ :class="ui.td({ class: props.ui?.td, highlight: tier.highlight })"
187
+ >
188
+ <div :class="ui.featureValue({ class: props.ui?.featureValue })">
189
+ <slot :name="`feature-${formatSlotName(feature)}-value`" :feature="feature" :tier="tier" :section="section">
190
+ <slot name="feature-value" :feature="feature" :tier="tier" :section="section">
191
+ <ReuseFeatureTemplate :tier="tier" :feature="feature" />
192
+ </slot>
193
+ </slot>
194
+ </div>
195
+ </td>
196
+ </tr>
197
+ </template>
198
+ </tbody>
199
+ </table>
200
+
201
+ <ul :class="ui.list({ class: props.ui?.list })">
202
+ <li v-for="(tier, index) in tiers" :key="index" :class="ui.item({ class: props.ui?.item, highlight: tier.highlight })">
203
+ <ReuseTierTemplate :tier="tier" />
204
+
205
+ <div v-for="(section, sectionIndex) in sections" :key="`section-${sectionIndex}`" :class="ui.section({ class: props.ui?.section })">
206
+ <div v-if="section.title" :class="ui.sectionTitle({ class: props.ui?.sectionTitle })">
207
+ <slot :name="`section-${formatSlotName(section)}-title`" :section="section">
208
+ <slot name="section-title" :section="section">
209
+ {{ section.title }}
210
+ </slot>
211
+ </slot>
212
+ </div>
213
+
214
+ <div v-for="(feature, featureIndex) in section.features" :key="`section-${sectionIndex}-feature-${featureIndex}`" :class="ui.feature({ class: props.ui?.feature })">
215
+ <div :class="ui.featureTitle({ class: props.ui?.featureTitle })">
216
+ <slot :name="`feature-${formatSlotName(feature)}-title`" :feature="feature" :section="section">
217
+ <slot name="feature-title" :feature="feature" :section="section">
218
+ {{ feature.title }}
219
+ </slot>
220
+ </slot>
221
+ </div>
222
+
223
+ <div :class="ui.featureValue({ class: props.ui?.featureValue })">
224
+ <slot :name="`feature-${formatSlotName(feature)}-value`" :feature="feature" :tier="tier" :section="section">
225
+ <slot name="feature-value" :feature="feature" :tier="tier" :section="section">
226
+ <ReuseFeatureTemplate :tier="tier" :feature="feature" />
227
+ </slot>
228
+ </slot>
229
+ </div>
230
+ </div>
231
+ </div>
232
+ </li>
233
+ </ul>
234
+ </Primitive>
235
+ </template>