@eslamdevui/ui 3.2.0-beta.2 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/ui/auth-form.ts +20 -0
- package/.nuxt/ui/banner.ts +105 -0
- package/.nuxt/ui/blog-post.ts +140 -0
- package/.nuxt/ui/blog-posts.ts +14 -0
- package/.nuxt/ui/changelog-version.ts +41 -0
- package/.nuxt/ui/changelog-versions.ts +8 -0
- package/.nuxt/ui/chat-palette.ts +8 -0
- package/.nuxt/ui/content/content-navigation.ts +6 -4
- package/.nuxt/ui/content-navigation.ts +6 -4
- package/.nuxt/ui/footer-columns.ts +28 -0
- package/.nuxt/ui/footer.ts +11 -0
- package/.nuxt/ui/header.ts +30 -0
- package/.nuxt/ui/index.ts +32 -1
- package/.nuxt/ui/main.ts +3 -0
- package/.nuxt/ui/page-accordion.ts +7 -0
- package/.nuxt/ui/page-anchors.ts +30 -0
- package/.nuxt/ui/page-aside.ts +10 -0
- package/.nuxt/ui/page-body.ts +3 -0
- package/.nuxt/ui/page-card.ts +276 -0
- package/.nuxt/ui/page-columns.ts +3 -0
- package/.nuxt/ui/page-cta.ts +72 -0
- package/.nuxt/ui/page-feature.ts +31 -0
- package/.nuxt/ui/page-grid.ts +3 -0
- package/.nuxt/ui/page-header.ts +18 -0
- package/.nuxt/ui/page-hero.ts +46 -0
- package/.nuxt/ui/page-links.ts +25 -0
- package/.nuxt/ui/page-list.ts +8 -0
- package/.nuxt/ui/page-logos.ts +15 -0
- package/.nuxt/ui/page-marquee.ts +66 -0
- package/.nuxt/ui/page-section.ts +88 -0
- package/.nuxt/ui/page.ts +32 -0
- package/.nuxt/ui/pricing-plan.ts +101 -0
- package/.nuxt/ui/pricing-plans.ts +27 -0
- package/.nuxt/ui/pricing-table.ts +51 -0
- package/.nuxt/ui/user.ts +106 -0
- package/LICENSE.md +9 -9
- package/README.md +147 -147
- package/cli/commands/make/component.mjs +95 -95
- package/cli/commands/make/index.mjs +14 -14
- package/cli/commands/make/locale.mjs +64 -64
- package/cli/index.mjs +15 -15
- package/cli/package.json +13 -13
- package/cli/templates.mjs +236 -236
- package/cli/utils.mjs +31 -31
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Accordion.vue +36 -36
- package/dist/runtime/components/Alert.vue +46 -46
- package/dist/runtime/components/App.vue +10 -10
- package/dist/runtime/components/AuthForm.vue +195 -0
- package/dist/runtime/components/AuthForm.vue.d.ts +85 -0
- package/dist/runtime/components/Avatar.vue +27 -27
- package/dist/runtime/components/AvatarGroup.vue +4 -4
- package/dist/runtime/components/Badge.vue +16 -16
- package/dist/runtime/components/Banner.vue +113 -0
- package/dist/runtime/components/Banner.vue.d.ts +68 -0
- package/dist/runtime/components/BlogPost.vue +141 -0
- package/dist/runtime/components/BlogPost.vue.d.ts +59 -0
- package/dist/runtime/components/BlogPosts.vue +33 -0
- package/dist/runtime/components/BlogPosts.vue.d.ts +30 -0
- package/dist/runtime/components/Breadcrumb.vue +32 -32
- package/dist/runtime/components/Button.vue +28 -28
- package/dist/runtime/components/ButtonGroup.vue +3 -3
- package/dist/runtime/components/Calendar.vue +74 -74
- package/dist/runtime/components/Card.vue +13 -13
- package/dist/runtime/components/Carousel.vue +58 -58
- package/dist/runtime/components/ChangelogVersion.vue +165 -0
- package/dist/runtime/components/ChangelogVersion.vue.d.ts +58 -0
- package/dist/runtime/components/ChangelogVersions.vue +54 -0
- package/dist/runtime/components/ChangelogVersions.vue.d.ts +74 -0
- package/dist/runtime/components/ChatMessage.vue +35 -35
- package/dist/runtime/components/ChatMessages.vue +55 -55
- package/dist/runtime/components/ChatPalette.vue +32 -0
- package/dist/runtime/components/ChatPalette.vue.d.ts +24 -0
- package/dist/runtime/components/ChatPrompt.vue +26 -26
- package/dist/runtime/components/ChatPrompt.vue.d.ts +1 -1
- package/dist/runtime/components/ChatPromptSubmit.vue +10 -10
- package/dist/runtime/components/Checkbox.vue +33 -33
- package/dist/runtime/components/CheckboxGroup.vue +32 -32
- package/dist/runtime/components/Chip.vue +11 -11
- package/dist/runtime/components/Collapsible.vue +9 -9
- package/dist/runtime/components/ColorPicker.vue +30 -30
- package/dist/runtime/components/CommandPalette.vue +117 -117
- package/dist/runtime/components/CommandPalette.vue.d.ts +3 -3
- package/dist/runtime/components/Container.vue +3 -3
- package/dist/runtime/components/ContextMenu.vue +22 -22
- package/dist/runtime/components/ContextMenuContent.vue +105 -105
- package/dist/runtime/components/DashboardGroup.vue +3 -3
- package/dist/runtime/components/DashboardNavbar.vue +40 -40
- package/dist/runtime/components/DashboardPanel.vue +27 -27
- package/dist/runtime/components/DashboardResizeHandle.vue +7 -7
- package/dist/runtime/components/DashboardSearch.vue +20 -20
- package/dist/runtime/components/DashboardSearchButton.vue +43 -43
- package/dist/runtime/components/DashboardSidebar.vue +74 -74
- package/dist/runtime/components/DashboardSidebarCollapse.vue +7 -7
- package/dist/runtime/components/DashboardSidebarToggle.vue +7 -7
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
- package/dist/runtime/components/Drawer.vue +55 -55
- package/dist/runtime/components/DropdownMenu.vue +24 -24
- package/dist/runtime/components/DropdownMenuContent.vue +107 -107
- package/dist/runtime/components/Error.vue +22 -22
- package/dist/runtime/components/Error.vue.d.ts +1 -1
- package/dist/runtime/components/Footer.vue +44 -0
- package/dist/runtime/components/Footer.vue.d.ts +29 -0
- package/dist/runtime/components/FooterColumns.vue +68 -0
- package/dist/runtime/components/FooterColumns.vue.d.ts +52 -0
- package/dist/runtime/components/Form.vue +8 -8
- package/dist/runtime/components/FormField.vue +37 -37
- package/dist/runtime/components/Header.vue +137 -0
- package/dist/runtime/components/Header.vue.d.ts +72 -0
- package/dist/runtime/components/Icon.vue +1 -1
- package/dist/runtime/components/Input.vue +34 -34
- package/dist/runtime/components/InputMenu.vue +163 -163
- package/dist/runtime/components/InputMenu.vue.d.ts +3 -3
- package/dist/runtime/components/InputNumber.vue +49 -49
- package/dist/runtime/components/InputTags.vue +55 -55
- package/dist/runtime/components/Kbd.vue +5 -5
- package/dist/runtime/components/Link.vue +14 -14
- package/dist/runtime/components/LinkBase.vue +8 -8
- package/dist/runtime/components/Main.vue +23 -0
- package/dist/runtime/components/Main.vue.d.ts +20 -0
- package/dist/runtime/components/Modal.vue +69 -69
- package/dist/runtime/components/NavigationMenu.vue +166 -166
- package/dist/runtime/components/OverlayProvider.vue +9 -9
- package/dist/runtime/components/Page.vue +37 -0
- package/dist/runtime/components/Page.vue.d.ts +25 -0
- package/dist/runtime/components/PageAccordion.vue +26 -0
- package/dist/runtime/components/PageAccordion.vue.d.ts +21 -0
- package/dist/runtime/components/PageAnchors.vue +50 -0
- package/dist/runtime/components/PageAnchors.vue.d.ts +42 -0
- package/dist/runtime/components/PageAside.vue +36 -0
- package/dist/runtime/components/PageAside.vue.d.ts +27 -0
- package/dist/runtime/components/PageBody.vue +23 -0
- package/dist/runtime/components/PageBody.vue.d.ts +18 -0
- package/dist/runtime/components/PageCTA.vue +58 -0
- package/dist/runtime/components/PageCTA.vue.d.ts +49 -0
- package/dist/runtime/components/PageCard.vue +121 -0
- package/dist/runtime/components/PageCard.vue.d.ts +71 -0
- package/dist/runtime/components/PageColumns.vue +23 -0
- package/dist/runtime/components/PageColumns.vue.d.ts +18 -0
- package/dist/runtime/components/PageFeature.vue +71 -0
- package/dist/runtime/components/PageFeature.vue.d.ts +43 -0
- package/dist/runtime/components/PageGrid.vue +23 -0
- package/dist/runtime/components/PageGrid.vue.d.ts +18 -0
- package/dist/runtime/components/PageHeader.vue +58 -0
- package/dist/runtime/components/PageHeader.vue.d.ts +35 -0
- package/dist/runtime/components/PageHero.vue +67 -0
- package/dist/runtime/components/PageHero.vue.d.ts +49 -0
- package/dist/runtime/components/PageLinks.vue +55 -0
- package/dist/runtime/components/PageLinks.vue.d.ts +44 -0
- package/dist/runtime/components/PageList.vue +24 -0
- package/dist/runtime/components/PageList.vue.d.ts +21 -0
- package/dist/runtime/components/PageLogos.vue +64 -0
- package/dist/runtime/components/PageLogos.vue.d.ts +32 -0
- package/dist/runtime/components/PageMarquee.vue +40 -0
- package/dist/runtime/components/PageMarquee.vue.d.ts +30 -0
- package/dist/runtime/components/PageSection.vue +88 -0
- package/dist/runtime/components/PageSection.vue.d.ts +64 -0
- package/dist/runtime/components/Pagination.vue +47 -47
- package/dist/runtime/components/PinInput.vue +20 -20
- package/dist/runtime/components/Popover.vue +17 -17
- package/dist/runtime/components/PricingPlan.vue +129 -0
- package/dist/runtime/components/PricingPlan.vue.d.ts +109 -0
- package/dist/runtime/components/PricingPlans.vue +45 -0
- package/dist/runtime/components/PricingPlans.vue.d.ts +41 -0
- package/dist/runtime/components/PricingTable.vue +235 -0
- package/dist/runtime/components/PricingTable.vue.d.ts +98 -0
- package/dist/runtime/components/Progress.vue +19 -19
- package/dist/runtime/components/RadioGroup.vue +43 -43
- package/dist/runtime/components/Select.vue +96 -96
- package/dist/runtime/components/SelectMenu.vue +130 -130
- package/dist/runtime/components/SelectMenu.vue.d.ts +3 -3
- package/dist/runtime/components/Separator.vue +15 -15
- package/dist/runtime/components/Skeleton.vue +10 -10
- package/dist/runtime/components/Slideover.vue +76 -76
- package/dist/runtime/components/Slider.vue +27 -27
- package/dist/runtime/components/Stepper.vue +51 -51
- package/dist/runtime/components/Switch.vue +33 -33
- package/dist/runtime/components/Table.vue +77 -77
- package/dist/runtime/components/Tabs.vue +38 -37
- package/dist/runtime/components/Textarea.vue +33 -33
- package/dist/runtime/components/Timeline.vue +38 -38
- package/dist/runtime/components/Toast.vue +69 -69
- package/dist/runtime/components/Toaster.vue +28 -28
- package/dist/runtime/components/Tooltip.vue +19 -19
- package/dist/runtime/components/Tree.vue +60 -60
- package/dist/runtime/components/User.vue +69 -0
- package/dist/runtime/components/User.vue.d.ts +46 -0
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeButton.vue +16 -16
- package/dist/runtime/components/color-mode/ColorModeImage.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeSelect.vue +19 -19
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +19 -19
- package/dist/runtime/components/content/ContentNavigation.vue +109 -109
- package/dist/runtime/components/content/ContentSearch.vue +25 -25
- package/dist/runtime/components/content/ContentSearchButton.vue +38 -38
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +58 -12
- package/dist/runtime/components/content/ContentSurround.vue +31 -31
- package/dist/runtime/components/content/ContentSurround.vue.d.ts +52 -59
- package/dist/runtime/components/content/ContentToc.vue +88 -76
- package/dist/runtime/components/content/ContentToc.vue.d.ts +86 -88
- package/dist/runtime/components/locale/LocaleSelect.vue +20 -20
- package/dist/runtime/components/prose/A.vue +3 -3
- package/dist/runtime/components/prose/Accordion.vue +5 -5
- package/dist/runtime/components/prose/AccordionItem.vue +5 -5
- package/dist/runtime/components/prose/Badge.vue +3 -3
- package/dist/runtime/components/prose/Blockquote.vue +3 -3
- package/dist/runtime/components/prose/Callout.vue +27 -27
- package/dist/runtime/components/prose/Card.vue +43 -43
- package/dist/runtime/components/prose/CardGroup.vue +3 -3
- package/dist/runtime/components/prose/Code.vue +3 -3
- package/dist/runtime/components/prose/CodeCollapse.vue +16 -16
- package/dist/runtime/components/prose/CodeGroup.vue +15 -15
- package/dist/runtime/components/prose/CodeIcon.vue +1 -1
- package/dist/runtime/components/prose/CodePreview.vue +9 -9
- package/dist/runtime/components/prose/CodeTree.vue +61 -61
- package/dist/runtime/components/prose/Collapsible.vue +15 -15
- package/dist/runtime/components/prose/Em.vue +1 -1
- package/dist/runtime/components/prose/Field.vue +23 -23
- package/dist/runtime/components/prose/FieldGroup.vue +3 -3
- package/dist/runtime/components/prose/H1.vue +6 -6
- package/dist/runtime/components/prose/H2.vue +10 -10
- package/dist/runtime/components/prose/H3.vue +10 -10
- package/dist/runtime/components/prose/H4.vue +6 -6
- package/dist/runtime/components/prose/Hr.vue +1 -1
- package/dist/runtime/components/prose/Icon.vue +1 -1
- package/dist/runtime/components/prose/Img.vue +8 -8
- package/dist/runtime/components/prose/Kbd.vue +1 -1
- package/dist/runtime/components/prose/Li.vue +3 -3
- package/dist/runtime/components/prose/Ol.vue +3 -3
- package/dist/runtime/components/prose/P.vue +3 -3
- package/dist/runtime/components/prose/Pre.vue +20 -20
- package/dist/runtime/components/prose/Script.vue +3 -3
- package/dist/runtime/components/prose/Steps.vue +3 -3
- package/dist/runtime/components/prose/Strong.vue +3 -3
- package/dist/runtime/components/prose/Table.vue +5 -5
- package/dist/runtime/components/prose/Tabs.vue +14 -14
- package/dist/runtime/components/prose/TabsItem.vue +5 -5
- package/dist/runtime/components/prose/Tbody.vue +3 -3
- package/dist/runtime/components/prose/Td.vue +3 -3
- package/dist/runtime/components/prose/Th.vue +3 -3
- package/dist/runtime/components/prose/Thead.vue +3 -3
- package/dist/runtime/components/prose/Tr.vue +3 -3
- package/dist/runtime/components/prose/Ul.vue +3 -3
- package/dist/runtime/components/prose/callout/Caution.vue +3 -3
- package/dist/runtime/components/prose/callout/Note.vue +3 -3
- package/dist/runtime/components/prose/callout/Tip.vue +3 -3
- package/dist/runtime/components/prose/callout/Warning.vue +3 -3
- package/dist/runtime/inertia/components/Link.vue +12 -12
- package/dist/runtime/inertia/components/LinkBase.vue +15 -15
- package/dist/runtime/types/app.config.d.ts +6 -6
- package/dist/runtime/types/index.d.ts +33 -0
- package/dist/runtime/types/index.js +33 -0
- package/dist/runtime/vue/components/Icon.vue +1 -1
- package/dist/runtime/vue/components/Link.vue +31 -31
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +7 -7
- package/dist/shared/{ui.DQZ75GCP.mjs → ui.DErCA3YU.mjs} +1247 -50
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
- package/vue-plugin.d.ts +5 -5
- package/.nuxt/ui/prose.ts +0 -321
|
@@ -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>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import theme from '#build/ui/pricing-table';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import type { ComponentConfig, PricingPlanProps } from '../types';
|
|
4
|
+
type PricingTable = ComponentConfig<typeof theme, AppConfig, 'pricingTable'>;
|
|
5
|
+
type DynamicSlots<T extends {
|
|
6
|
+
id: string;
|
|
7
|
+
}, S extends string | undefined = undefined> = {
|
|
8
|
+
[K in T['id'] as K extends string ? S extends string ? (K | `${K}-${S}`) : K : never]?: (props: {
|
|
9
|
+
tier: Extract<T, {
|
|
10
|
+
id: K extends `${infer Base}-${S}` ? Base : K;
|
|
11
|
+
}>;
|
|
12
|
+
}) => any;
|
|
13
|
+
};
|
|
14
|
+
type FeatureDynamicSlots<T extends PricingTableSectionFeature, S extends string | undefined = undefined> = {
|
|
15
|
+
[K in (T['id'] extends string ? T['id'] : string) as K extends string ? S extends string ? (`feature-${K}` | `feature-${K}-${S}`) : `feature-${K}` : never]?: (props: {
|
|
16
|
+
feature: T;
|
|
17
|
+
tier: PricingTableTier;
|
|
18
|
+
section: PricingTableSection;
|
|
19
|
+
}) => any;
|
|
20
|
+
};
|
|
21
|
+
type SectionDynamicSlots<T extends PricingTableSection, S extends string | undefined = undefined> = {
|
|
22
|
+
[K in (T['id'] extends string ? T['id'] : string) as K extends string ? S extends string ? (`section-${K}` | `section-${K}-${S}`) : `section-${K}` : never]?: (props: {
|
|
23
|
+
section: T;
|
|
24
|
+
}) => any;
|
|
25
|
+
};
|
|
26
|
+
export type PricingTableTier = Pick<PricingPlanProps, 'title' | 'description' | 'badge' | 'billingCycle' | 'billingPeriod' | 'price' | 'discount' | 'button' | 'highlight'> & {
|
|
27
|
+
id: string;
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
};
|
|
30
|
+
export type PricingTableSectionFeature<T extends PricingTableTier = PricingTableTier> = {
|
|
31
|
+
id?: string;
|
|
32
|
+
title: string;
|
|
33
|
+
tiers?: {
|
|
34
|
+
[K in Extract<T['id'], string>]: boolean | number | string;
|
|
35
|
+
} & Record<string, boolean | number | string>;
|
|
36
|
+
};
|
|
37
|
+
export interface PricingTableSection<T extends PricingTableTier = PricingTableTier> {
|
|
38
|
+
id?: string;
|
|
39
|
+
title: string;
|
|
40
|
+
features: PricingTableSectionFeature<T>[];
|
|
41
|
+
}
|
|
42
|
+
export interface PricingTableProps<T extends PricingTableTier = PricingTableTier> {
|
|
43
|
+
/**
|
|
44
|
+
* The element or component this component should render as.
|
|
45
|
+
* @defaultValue 'div'
|
|
46
|
+
*/
|
|
47
|
+
as?: any;
|
|
48
|
+
/**
|
|
49
|
+
* The caption to display above the table.
|
|
50
|
+
* @defeaultValue t('pricingTable.caption')
|
|
51
|
+
*/
|
|
52
|
+
caption?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The pricing tiers to display in the table.
|
|
55
|
+
* Each tier represents a pricing plan with its own title, description, price, and features.
|
|
56
|
+
*/
|
|
57
|
+
tiers: T[];
|
|
58
|
+
/**
|
|
59
|
+
* The sections of features to display in the table.
|
|
60
|
+
* Each section contains a title and a list of features with their availability in each tier.
|
|
61
|
+
*/
|
|
62
|
+
sections: PricingTableSection<T>[];
|
|
63
|
+
class?: any;
|
|
64
|
+
ui?: PricingTable['slots'];
|
|
65
|
+
}
|
|
66
|
+
type SlotProps<T extends PricingTableTier> = (props: {
|
|
67
|
+
tier: T;
|
|
68
|
+
}) => any;
|
|
69
|
+
export type PricingTableSlots<T extends PricingTableTier = PricingTableTier> = {
|
|
70
|
+
'caption': (props?: {}) => any;
|
|
71
|
+
'tier': SlotProps<T>;
|
|
72
|
+
'tier-title': SlotProps<T>;
|
|
73
|
+
'tier-description': SlotProps<T>;
|
|
74
|
+
'tier-badge': SlotProps<T>;
|
|
75
|
+
'tier-button': SlotProps<T>;
|
|
76
|
+
'tier-billing': SlotProps<T>;
|
|
77
|
+
'tier-discount': SlotProps<T>;
|
|
78
|
+
'tier-price': SlotProps<T>;
|
|
79
|
+
'section-title': (props: {
|
|
80
|
+
section: PricingTableSection<T>;
|
|
81
|
+
}) => any;
|
|
82
|
+
'feature-title': (props: {
|
|
83
|
+
feature: PricingTableSectionFeature<T>;
|
|
84
|
+
section: PricingTableSection<T>;
|
|
85
|
+
}) => any;
|
|
86
|
+
'feature-value': (props: {
|
|
87
|
+
feature: PricingTableSectionFeature<T>;
|
|
88
|
+
tier: T;
|
|
89
|
+
section: PricingTableSection<T>;
|
|
90
|
+
}) => any;
|
|
91
|
+
} & DynamicSlots<T, 'title' | 'description' | 'badge' | 'button' | 'billing' | 'discount' | 'price'> & FeatureDynamicSlots<PricingTableSectionFeature<T>, 'title' | 'value'> & SectionDynamicSlots<PricingTableSection<T>, 'title'>;
|
|
92
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PricingTableProps<PricingTableTier>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PricingTableProps<PricingTableTier>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PricingTableSlots<PricingTableTier>>;
|
|
93
|
+
export default _default;
|
|
94
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
95
|
+
new (): {
|
|
96
|
+
$slots: S;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
@@ -110,23 +110,23 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.progress || {
|
|
|
110
110
|
</script>
|
|
111
111
|
|
|
112
112
|
<template>
|
|
113
|
-
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
114
|
-
<div v-if="!isIndeterminate && (status || !!slots.status)" :class="ui.status({ class: props.ui?.status })" :style="statusStyle">
|
|
115
|
-
<slot name="status" :percent="percent">
|
|
116
|
-
{{ percent }}%
|
|
117
|
-
</slot>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
<ProgressRoot v-bind="rootProps" :max="realMax" :class="ui.base({ class: props.ui?.base })" style="transform: translateZ(0)">
|
|
121
|
-
<ProgressIndicator :class="ui.indicator({ class: props.ui?.indicator })" :style="indicatorStyle" />
|
|
122
|
-
</ProgressRoot>
|
|
123
|
-
|
|
124
|
-
<div v-if="hasSteps" :class="ui.steps({ class: props.ui?.steps })">
|
|
125
|
-
<div v-for="(step, index) in max" :key="index" :class="ui.step({ class: props.ui?.step, step: stepVariant(index) })">
|
|
126
|
-
<slot :name="`step-${index}`" :step="step">
|
|
127
|
-
{{ step }}
|
|
128
|
-
</slot>
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
</Primitive>
|
|
113
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
114
|
+
<div v-if="!isIndeterminate && (status || !!slots.status)" :class="ui.status({ class: props.ui?.status })" :style="statusStyle">
|
|
115
|
+
<slot name="status" :percent="percent">
|
|
116
|
+
{{ percent }}%
|
|
117
|
+
</slot>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<ProgressRoot v-bind="rootProps" :max="realMax" :class="ui.base({ class: props.ui?.base })" style="transform: translateZ(0)">
|
|
121
|
+
<ProgressIndicator :class="ui.indicator({ class: props.ui?.indicator })" :style="indicatorStyle" />
|
|
122
|
+
</ProgressRoot>
|
|
123
|
+
|
|
124
|
+
<div v-if="hasSteps" :class="ui.steps({ class: props.ui?.steps })">
|
|
125
|
+
<div v-for="(step, index) in max" :key="index" :class="ui.step({ class: props.ui?.step, step: stepVariant(index) })">
|
|
126
|
+
<slot :name="`step-${index}`" :step="step">
|
|
127
|
+
{{ step }}
|
|
128
|
+
</slot>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</Primitive>
|
|
132
132
|
</template>
|
|
@@ -87,47 +87,47 @@ function onUpdate(value) {
|
|
|
87
87
|
</script>
|
|
88
88
|
|
|
89
89
|
<template>
|
|
90
|
-
<RadioGroupRoot
|
|
91
|
-
:id="id"
|
|
92
|
-
v-slot="{ modelValue }"
|
|
93
|
-
v-bind="rootProps"
|
|
94
|
-
:name="name"
|
|
95
|
-
:disabled="disabled"
|
|
96
|
-
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
97
|
-
@update:model-value="onUpdate"
|
|
98
|
-
>
|
|
99
|
-
<fieldset :class="ui.fieldset({ class: props.ui?.fieldset })" v-bind="ariaAttrs">
|
|
100
|
-
<legend v-if="legend || !!slots.legend" :class="ui.legend({ class: props.ui?.legend })">
|
|
101
|
-
<slot name="legend">
|
|
102
|
-
{{ legend }}
|
|
103
|
-
</slot>
|
|
104
|
-
</legend>
|
|
105
|
-
|
|
106
|
-
<component :is="!variant || variant === 'list' ? 'div' : Label" v-for="item in normalizedItems" :key="item.value" :class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })">
|
|
107
|
-
<div :class="ui.container({ class: [props.ui?.container, item.ui?.container] })">
|
|
108
|
-
<RadioGroupItem
|
|
109
|
-
:id="item.id"
|
|
110
|
-
:value="item.value"
|
|
111
|
-
:disabled="item.disabled"
|
|
112
|
-
:class="ui.base({ class: [props.ui?.base, item.ui?.base], disabled: item.disabled })"
|
|
113
|
-
>
|
|
114
|
-
<RadioGroupIndicator :class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })" />
|
|
115
|
-
</RadioGroupItem>
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<div v-if="item.label || !!slots.label || (item.description || !!slots.description)" :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })">
|
|
119
|
-
<component :is="!variant || variant === 'list' ? Label : 'p'" v-if="item.label || !!slots.label" :for="item.id" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
|
|
120
|
-
<slot name="label" :item="item" :model-value="modelValue">
|
|
121
|
-
{{ item.label }}
|
|
122
|
-
</slot>
|
|
123
|
-
</component>
|
|
124
|
-
<p v-if="item.description || !!slots.description" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })">
|
|
125
|
-
<slot name="description" :item="item" :model-value="modelValue">
|
|
126
|
-
{{ item.description }}
|
|
127
|
-
</slot>
|
|
128
|
-
</p>
|
|
129
|
-
</div>
|
|
130
|
-
</component>
|
|
131
|
-
</fieldset>
|
|
132
|
-
</RadioGroupRoot>
|
|
90
|
+
<RadioGroupRoot
|
|
91
|
+
:id="id"
|
|
92
|
+
v-slot="{ modelValue }"
|
|
93
|
+
v-bind="rootProps"
|
|
94
|
+
:name="name"
|
|
95
|
+
:disabled="disabled"
|
|
96
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
97
|
+
@update:model-value="onUpdate"
|
|
98
|
+
>
|
|
99
|
+
<fieldset :class="ui.fieldset({ class: props.ui?.fieldset })" v-bind="ariaAttrs">
|
|
100
|
+
<legend v-if="legend || !!slots.legend" :class="ui.legend({ class: props.ui?.legend })">
|
|
101
|
+
<slot name="legend">
|
|
102
|
+
{{ legend }}
|
|
103
|
+
</slot>
|
|
104
|
+
</legend>
|
|
105
|
+
|
|
106
|
+
<component :is="!variant || variant === 'list' ? 'div' : Label" v-for="item in normalizedItems" :key="item.value" :class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })">
|
|
107
|
+
<div :class="ui.container({ class: [props.ui?.container, item.ui?.container] })">
|
|
108
|
+
<RadioGroupItem
|
|
109
|
+
:id="item.id"
|
|
110
|
+
:value="item.value"
|
|
111
|
+
:disabled="item.disabled"
|
|
112
|
+
:class="ui.base({ class: [props.ui?.base, item.ui?.base], disabled: item.disabled })"
|
|
113
|
+
>
|
|
114
|
+
<RadioGroupIndicator :class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })" />
|
|
115
|
+
</RadioGroupItem>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<div v-if="item.label || !!slots.label || (item.description || !!slots.description)" :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })">
|
|
119
|
+
<component :is="!variant || variant === 'list' ? Label : 'p'" v-if="item.label || !!slots.label" :for="item.id" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
|
|
120
|
+
<slot name="label" :item="item" :model-value="modelValue">
|
|
121
|
+
{{ item.label }}
|
|
122
|
+
</slot>
|
|
123
|
+
</component>
|
|
124
|
+
<p v-if="item.description || !!slots.description" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })">
|
|
125
|
+
<slot name="description" :item="item" :model-value="modelValue">
|
|
126
|
+
{{ item.description }}
|
|
127
|
+
</slot>
|
|
128
|
+
</p>
|
|
129
|
+
</div>
|
|
130
|
+
</component>
|
|
131
|
+
</fieldset>
|
|
132
|
+
</RadioGroupRoot>
|
|
133
133
|
</template>
|