@veristone/nuxt-v-app 0.1.0
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/README.md +42 -0
- package/app/app.vue +7 -0
- package/app/assets/css/v-app.css +313 -0
- package/app/components/V/A/Badge.vue +75 -0
- package/app/components/V/A/Btn/Add.vue +17 -0
- package/app/components/V/A/Btn/Back.vue +25 -0
- package/app/components/V/A/Btn/ConfirmDelete.vue +45 -0
- package/app/components/V/A/Btn/Edit.vue +35 -0
- package/app/components/V/A/Btn/Export.vue +28 -0
- package/app/components/V/A/Btn/Refresh.vue +21 -0
- package/app/components/V/A/Btn/Submit.vue +45 -0
- package/app/components/V/A/Btn/View.vue +23 -0
- package/app/components/V/A/Card.legacy.vue +291 -0
- package/app/components/V/A/Card.vue +108 -0
- package/app/components/V/A/CompanyMenu.vue +83 -0
- package/app/components/V/A/Data/KeyValue.vue +98 -0
- package/app/components/V/A/Data/StatusBadge.vue +44 -0
- package/app/components/V/A/DataField.vue +140 -0
- package/app/components/V/A/DataGrid.vue +43 -0
- package/app/components/V/A/DataTable.vue +144 -0
- package/app/components/V/A/EmptyState.vue +154 -0
- package/app/components/V/A/Fmt/Currency.vue +36 -0
- package/app/components/V/A/Fmt/DateTime.vue +34 -0
- package/app/components/V/A/Fmt/Percent.vue +47 -0
- package/app/components/V/A/LoadingState.vue +140 -0
- package/app/components/V/A/MetricCard.vue +129 -0
- package/app/components/V/A/Modal/Base.vue +195 -0
- package/app/components/V/A/Modal/Confirm.vue +92 -0
- package/app/components/V/A/Modal/Form.vue +105 -0
- package/app/components/V/A/Navigation.vue +110 -0
- package/app/components/V/A/QuickActions.vue +169 -0
- package/app/components/V/A/Slide.vue +109 -0
- package/app/components/V/A/Slideover.vue +259 -0
- package/app/components/V/A/State/Empty.vue +20 -0
- package/app/components/V/A/State/Error.vue +34 -0
- package/app/components/V/A/State/Loading.vue +33 -0
- package/app/components/V/A/StatsCard.vue +215 -0
- package/app/components/V/A/StatusBadge.vue +215 -0
- package/app/components/V/A/Table.vue +674 -0
- package/app/components/V/A/UserMenu.vue +127 -0
- package/app/components/V/A/WelcomeHeader.vue +96 -0
- package/app/components/V/Modal.vue +36 -0
- package/app/components/Va/Blocks/VaBlockGridCharts.vue +32 -0
- package/app/components/Va/Blocks/VaBlockGridKPI.vue +32 -0
- package/app/components/Va/Blocks/VaBlockGridTables.vue +23 -0
- package/app/components/Va/Blocks/VaBlockKpiGrid.vue +8 -0
- package/app/components/Va/Blocks/VaBlockSessionFilterBar.vue +8 -0
- package/app/components/Va/Cards/VaCardDonutChart.vue +59 -0
- package/app/components/Va/Cards/VaCardHeader.vue +10 -0
- package/app/components/Va/Cards/VaCardKpi.vue +17 -0
- package/app/components/Va/Cards/VaCardKpi2.vue +55 -0
- package/app/components/Va/Cards/VaCardLatestOrders.vue +82 -0
- package/app/components/Va/Cards/VaCardPopularProducts.vue +88 -0
- package/app/components/Va/Cards/VaCardRevenueBarChart.vue +49 -0
- package/app/components/Va/Cards/VaCardSubtitle.vue +5 -0
- package/app/components/Va/Cards/VaCardTitle.vue +5 -0
- package/app/components/Va/Cards/VaCardWithActiveUsers.vue +41 -0
- package/app/components/Va/Cards/VaCardWithChart.vue +135 -0
- package/app/components/Va/Cards/VaCardWithChartBlock.vue +26 -0
- package/app/components/Va/Cards/VaCardWithIndicator.vue +39 -0
- package/app/components/Va/Cards/VaCardWithProgressCircle.vue +34 -0
- package/app/components/Va/Cards/types.ts +11 -0
- package/app/components/Va/Charts/VaChartAppPerformanceBar.vue +118 -0
- package/app/components/Va/Charts/VaChartAppPerformanceBarChart.vue +118 -0
- package/app/components/Va/Charts/VaChartAreaMini.vue +127 -0
- package/app/components/Va/Charts/VaChartBarMini.vue +68 -0
- package/app/components/Va/Charts/VaChartCardinalMulti.vue +108 -0
- package/app/components/Va/Charts/VaChartColorBarChart.vue +78 -0
- package/app/components/Va/Charts/VaChartDonutHalf.vue +35 -0
- package/app/components/Va/Charts/VaChartDonutMini.vue +77 -0
- package/app/components/Va/Charts/VaChartExpensesBar.vue +58 -0
- package/app/components/Va/Charts/VaChartFinanceSummary.vue +96 -0
- package/app/components/Va/Charts/VaChartGoogleSearchConsole.vue +90 -0
- package/app/components/Va/Charts/VaChartIncomeBar.vue +82 -0
- package/app/components/Va/Charts/VaChartLegend.vue +25 -0
- package/app/components/Va/Charts/VaChartLineMini.vue +205 -0
- package/app/components/Va/Charts/VaChartRealtimeTraffic.vue +182 -0
- package/app/components/Va/Charts/VaChartRevenue.vue +43 -0
- package/app/components/Va/Charts/VaChartRevenueLine.vue +42 -0
- package/app/components/Va/Charts/VaChartRevenuevsCost.vue +84 -0
- package/app/components/Va/Charts/VaChartSearchIntent.vue +179 -0
- package/app/components/Va/Charts/VaChartSpendingTrend.vue +127 -0
- package/app/components/Va/Charts/VaChartStackedHorizontal.vue +64 -0
- package/app/components/Va/Charts/VaChartStepMinimal.vue +109 -0
- package/app/components/Va/Charts/VaChartStockComparisonLine.vue +86 -0
- package/app/components/Va/Charts/VaChartStocksPortfolioLine.vue +161 -0
- package/app/components/Va/Charts/VaChartStocksSectorLine.vue +223 -0
- package/app/components/Va/Charts/VaChartTasksCategories.vue +96 -0
- package/app/components/Va/Charts/VaChartTasksProgress.vue +130 -0
- package/app/components/Va/Charts/VaChartTrafficOverview.vue +112 -0
- package/app/components/Va/Charts/VaChartWebPerformanceLineChart.vue +114 -0
- package/app/components/Va/Charts/VaChartWinLostBar.vue +110 -0
- package/app/components/Va/Charts/VaChartWinLostDonut.vue +107 -0
- package/app/components/Va/Charts/VaChartWinLostLine.vue +111 -0
- package/app/components/Va/Charts/types.ts +10 -0
- package/app/components/Va/Dashboard/Navigation/types.ts +8 -0
- package/app/components/Va/Dashboard/VaDashboardKPICard.vue +31 -0
- package/app/components/Va/Dashboard/VaDashboardNavigation.vue +50 -0
- package/app/components/Va/Dashboard/VaDashboardPricePlan.vue +102 -0
- package/app/components/Va/Dashboard/VaDashboardUsageChart.vue +84 -0
- package/app/components/Va/Dashboard/VaDashboardUsageRequestChart.vue +46 -0
- package/app/components/Va/Layout/NotificationsSlideover.vue +169 -0
- package/app/components/Va/Layout/SideNav/types.ts +5 -0
- package/app/components/Va/Layout/SideNav.vue +108 -0
- package/app/components/Va/Layout/TeamsMenu.vue +57 -0
- package/app/components/Va/Layout/UserMenu.vue +57 -0
- package/app/composables/useDashboard.ts +25 -0
- package/app/composables/useVAAnimation.ts +324 -0
- package/app/composables/useVAUtils.ts +118 -0
- package/app/composables/useVCrud.ts +647 -0
- package/app/composables/useVFetch.ts +46 -0
- package/app/composables/useVFileUpload.ts +45 -0
- package/app/composables/useVToast.ts +73 -0
- package/app/composables/useXATableColumns.ts +456 -0
- package/app/data/BillingStats.ts +65 -0
- package/app/data/SearchData.ts +58 -0
- package/app/data/TasksData.ts +101 -0
- package/app/data/dashboardData.ts +113 -0
- package/app/layouts/default.vue +171 -0
- package/app/layouts/legacy.vue +61 -0
- package/app/pages/playground/base.vue +498 -0
- package/app/pages/playground/blocks.vue +108 -0
- package/app/pages/playground/buttons.vue +237 -0
- package/app/pages/playground/cards.vue +326 -0
- package/app/pages/playground/charts.vue +338 -0
- package/app/pages/playground/dashboard.vue +315 -0
- package/app/pages/playground/formatters.vue +329 -0
- package/app/pages/playground/index.vue +109 -0
- package/app/pages/playground/layout.vue +159 -0
- package/app/pages/playground/modals.vue +606 -0
- package/app/pages/playground/states.vue +282 -0
- package/app/pages/playground/tables.vue +618 -0
- package/app/pages/test-layout.vue +10 -0
- package/nuxt.config.ts +12 -0
- package/package.json +71 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
definePageMeta({
|
|
3
|
+
title: 'Button Components'
|
|
4
|
+
})
|
|
5
|
+
|
|
6
|
+
const isRefreshing = ref(false)
|
|
7
|
+
|
|
8
|
+
const handleRefresh = () => {
|
|
9
|
+
isRefreshing.value = true
|
|
10
|
+
setTimeout(() => {
|
|
11
|
+
isRefreshing.value = false
|
|
12
|
+
}, 1500)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const handleExport = (format: string) => {
|
|
16
|
+
console.log('Exporting as:', format)
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<UDashboardPanel grow>
|
|
22
|
+
<UContainer>
|
|
23
|
+
<div class="py-8">
|
|
24
|
+
<h1 class="text-3xl font-bold mb-4">Button Components Showcase</h1>
|
|
25
|
+
<p class="text-gray-600 dark:text-gray-400 mb-8">
|
|
26
|
+
Action buttons for common CRUD operations, navigation, and data export.
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
<!-- VABtnAdd Section -->
|
|
30
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VABtnAdd</h2>
|
|
31
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Primary action button for creating new items.</p>
|
|
32
|
+
<div class="mb-8">
|
|
33
|
+
<UCard>
|
|
34
|
+
<template #header>
|
|
35
|
+
<h3 class="font-semibold">Add Button Variations</h3>
|
|
36
|
+
</template>
|
|
37
|
+
<div class="flex flex-wrap gap-4">
|
|
38
|
+
<ClientOnly>
|
|
39
|
+
<VABtnAdd />
|
|
40
|
+
</ClientOnly>
|
|
41
|
+
<ClientOnly>
|
|
42
|
+
<VABtnAdd label="Add User" icon="i-lucide-user-plus" />
|
|
43
|
+
</ClientOnly>
|
|
44
|
+
<ClientOnly>
|
|
45
|
+
<VABtnAdd label="Create Project" icon="i-lucide-folder-plus" />
|
|
46
|
+
</ClientOnly>
|
|
47
|
+
</div>
|
|
48
|
+
</UCard>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<!-- VABtnEdit Section -->
|
|
52
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VABtnEdit</h2>
|
|
53
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Edit button that opens a form modal for editing records.</p>
|
|
54
|
+
<div class="mb-8">
|
|
55
|
+
<UCard>
|
|
56
|
+
<template #header>
|
|
57
|
+
<h3 class="font-semibold">Edit Button Variations</h3>
|
|
58
|
+
</template>
|
|
59
|
+
<div class="flex flex-wrap items-center gap-4">
|
|
60
|
+
<ClientOnly>
|
|
61
|
+
<VABtnEdit title="Edit User">
|
|
62
|
+
<div class="space-y-4">
|
|
63
|
+
<UFormField label="Name">
|
|
64
|
+
<UInput placeholder="Enter name" />
|
|
65
|
+
</UFormField>
|
|
66
|
+
<UFormField label="Email">
|
|
67
|
+
<UInput type="email" placeholder="Enter email" />
|
|
68
|
+
</UFormField>
|
|
69
|
+
</div>
|
|
70
|
+
</VABtnEdit>
|
|
71
|
+
</ClientOnly>
|
|
72
|
+
<span class="text-sm text-gray-500">Click the pencil icon to open edit modal</span>
|
|
73
|
+
</div>
|
|
74
|
+
</UCard>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<!-- VABtnView Section -->
|
|
78
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VABtnView</h2>
|
|
79
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">View button for navigating to detail pages.</p>
|
|
80
|
+
<div class="mb-8">
|
|
81
|
+
<UCard>
|
|
82
|
+
<template #header>
|
|
83
|
+
<h3 class="font-semibold">View Button Variations</h3>
|
|
84
|
+
</template>
|
|
85
|
+
<div class="flex flex-wrap items-center gap-4">
|
|
86
|
+
<ClientOnly>
|
|
87
|
+
<VABtnView to="/playground/buttons" />
|
|
88
|
+
</ClientOnly>
|
|
89
|
+
<ClientOnly>
|
|
90
|
+
<VABtnView to="/playground/buttons" trigger-color="primary" trigger-variant="soft" />
|
|
91
|
+
</ClientOnly>
|
|
92
|
+
<span class="text-sm text-gray-500">Links to detail pages</span>
|
|
93
|
+
</div>
|
|
94
|
+
</UCard>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<!-- VABtnSubmit Section -->
|
|
98
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VABtnSubmit</h2>
|
|
99
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Form submission button with optional cancel action.</p>
|
|
100
|
+
<div class="mb-8">
|
|
101
|
+
<UCard>
|
|
102
|
+
<template #header>
|
|
103
|
+
<h3 class="font-semibold">Submit Button Variations</h3>
|
|
104
|
+
</template>
|
|
105
|
+
<div class="space-y-6">
|
|
106
|
+
<ClientOnly>
|
|
107
|
+
<VABtnSubmit />
|
|
108
|
+
</ClientOnly>
|
|
109
|
+
<ClientOnly>
|
|
110
|
+
<VABtnSubmit label="Submit" :show-cancel="true" align="left" />
|
|
111
|
+
</ClientOnly>
|
|
112
|
+
<ClientOnly>
|
|
113
|
+
<VABtnSubmit label="Create Account" icon="i-lucide-plus" color="green" />
|
|
114
|
+
</ClientOnly>
|
|
115
|
+
<ClientOnly>
|
|
116
|
+
<VABtnSubmit label="Processing..." :loading="true" />
|
|
117
|
+
</ClientOnly>
|
|
118
|
+
</div>
|
|
119
|
+
</UCard>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<!-- VABtnBack Section -->
|
|
123
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VABtnBack</h2>
|
|
124
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Navigation button for going back in history or to a specific route.</p>
|
|
125
|
+
<div class="mb-8">
|
|
126
|
+
<UCard>
|
|
127
|
+
<template #header>
|
|
128
|
+
<h3 class="font-semibold">Back Button Variations</h3>
|
|
129
|
+
</template>
|
|
130
|
+
<div class="flex flex-wrap gap-4">
|
|
131
|
+
<ClientOnly>
|
|
132
|
+
<VABtnBack />
|
|
133
|
+
</ClientOnly>
|
|
134
|
+
<ClientOnly>
|
|
135
|
+
<VABtnBack label="Return to List" to="/playground" />
|
|
136
|
+
</ClientOnly>
|
|
137
|
+
<ClientOnly>
|
|
138
|
+
<VABtnBack label="Home" icon="i-lucide-home" to="/" />
|
|
139
|
+
</ClientOnly>
|
|
140
|
+
</div>
|
|
141
|
+
</UCard>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<!-- VABtnRefresh Section -->
|
|
145
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VABtnRefresh</h2>
|
|
146
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Refresh button with loading state animation.</p>
|
|
147
|
+
<div class="mb-8">
|
|
148
|
+
<UCard>
|
|
149
|
+
<template #header>
|
|
150
|
+
<h3 class="font-semibold">Refresh Button Variations</h3>
|
|
151
|
+
</template>
|
|
152
|
+
<div class="flex flex-wrap items-center gap-4">
|
|
153
|
+
<ClientOnly>
|
|
154
|
+
<VABtnRefresh @refresh="handleRefresh" :loading="isRefreshing" />
|
|
155
|
+
</ClientOnly>
|
|
156
|
+
<ClientOnly>
|
|
157
|
+
<VABtnRefresh label="Refresh Data" @refresh="handleRefresh" :loading="isRefreshing" />
|
|
158
|
+
</ClientOnly>
|
|
159
|
+
<span class="text-sm text-gray-500">Click to see loading animation</span>
|
|
160
|
+
</div>
|
|
161
|
+
</UCard>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<!-- VABtnConfirmDelete Section -->
|
|
165
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VABtnConfirmDelete</h2>
|
|
166
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Delete button with confirmation modal. Requires endpoint and ID for CRUD operations.</p>
|
|
167
|
+
<div class="mb-8">
|
|
168
|
+
<UCard>
|
|
169
|
+
<template #header>
|
|
170
|
+
<h3 class="font-semibold">Delete Button Variations</h3>
|
|
171
|
+
</template>
|
|
172
|
+
<div class="flex flex-wrap items-center gap-4">
|
|
173
|
+
<ClientOnly>
|
|
174
|
+
<VABtnConfirmDelete endpoint="users" :id="1" item-name="user" />
|
|
175
|
+
</ClientOnly>
|
|
176
|
+
<span class="text-sm text-gray-500">Click to open delete confirmation modal</span>
|
|
177
|
+
</div>
|
|
178
|
+
</UCard>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
<!-- VABtnExport Section -->
|
|
182
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VABtnExport</h2>
|
|
183
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Export dropdown with format options.</p>
|
|
184
|
+
<div class="mb-8">
|
|
185
|
+
<UCard>
|
|
186
|
+
<template #header>
|
|
187
|
+
<h3 class="font-semibold">Export Button Variations</h3>
|
|
188
|
+
</template>
|
|
189
|
+
<div class="flex flex-wrap items-center gap-4">
|
|
190
|
+
<ClientOnly>
|
|
191
|
+
<VABtnExport @export="handleExport" />
|
|
192
|
+
</ClientOnly>
|
|
193
|
+
<ClientOnly>
|
|
194
|
+
<VABtnExport :formats="['csv', 'excel']" @export="handleExport" />
|
|
195
|
+
</ClientOnly>
|
|
196
|
+
<span class="text-sm text-gray-500">Click to see format options</span>
|
|
197
|
+
</div>
|
|
198
|
+
</UCard>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<!-- Combined Actions Example -->
|
|
202
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">Combined Actions Example</h2>
|
|
203
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Common pattern: action buttons in a table row context.</p>
|
|
204
|
+
<div class="mb-8">
|
|
205
|
+
<UCard>
|
|
206
|
+
<template #header>
|
|
207
|
+
<h3 class="font-semibold">Table Row Actions</h3>
|
|
208
|
+
</template>
|
|
209
|
+
<div class="flex items-center justify-between p-4 bg-gray-50 dark:bg-gray-800 rounded-lg">
|
|
210
|
+
<div>
|
|
211
|
+
<p class="font-semibold text-gray-900 dark:text-white">John Doe</p>
|
|
212
|
+
<p class="text-sm text-gray-500">john@example.com</p>
|
|
213
|
+
</div>
|
|
214
|
+
<div class="flex items-center gap-2">
|
|
215
|
+
<ClientOnly>
|
|
216
|
+
<VABtnView to="/playground/buttons" />
|
|
217
|
+
</ClientOnly>
|
|
218
|
+
<ClientOnly>
|
|
219
|
+
<VABtnEdit title="Edit User">
|
|
220
|
+
<div class="space-y-4">
|
|
221
|
+
<UFormField label="Name">
|
|
222
|
+
<UInput model-value="John Doe" />
|
|
223
|
+
</UFormField>
|
|
224
|
+
</div>
|
|
225
|
+
</VABtnEdit>
|
|
226
|
+
</ClientOnly>
|
|
227
|
+
<ClientOnly>
|
|
228
|
+
<VABtnConfirmDelete endpoint="users" :id="1" item-name="user" />
|
|
229
|
+
</ClientOnly>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
</UCard>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
</UContainer>
|
|
236
|
+
</UDashboardPanel>
|
|
237
|
+
</template>
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
definePageMeta({
|
|
3
|
+
title: 'Card Components'
|
|
4
|
+
})
|
|
5
|
+
|
|
6
|
+
// Mock data for chart-based cards
|
|
7
|
+
const chartData = [
|
|
8
|
+
{ date: 'Jan 23', users: 234, sessions: 1432, churn: 5.2 },
|
|
9
|
+
{ date: 'Feb 23', users: 431, sessions: 1032, churn: 4.3 },
|
|
10
|
+
{ date: 'Mar 23', users: 543, sessions: 1089, churn: 5.1 },
|
|
11
|
+
{ date: 'Apr 23', users: 489, sessions: 988, churn: 5.4 },
|
|
12
|
+
{ date: 'May 23', users: 391, sessions: 642, churn: 5.5 },
|
|
13
|
+
{ date: 'Jun 23', users: 582, sessions: 786, churn: 4.8 },
|
|
14
|
+
{ date: 'Jul 23', users: 482, sessions: 673, churn: 4.5 },
|
|
15
|
+
{ date: 'Aug 23', users: 389, sessions: 761, churn: 0 },
|
|
16
|
+
{ date: 'Sep 23', users: 521, sessions: 793, churn: 0 },
|
|
17
|
+
{ date: 'Oct 23', users: 434, sessions: 543, churn: 0 },
|
|
18
|
+
{ date: 'Nov 23', users: 332, sessions: 678, churn: 0 },
|
|
19
|
+
{ date: 'Dec 23', users: 275, sessions: 873, churn: 0 }
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
const donutChartData = [
|
|
23
|
+
{ name: 'Direct', value: 35, color: '#3b82f6' },
|
|
24
|
+
{ name: 'Organic', value: 45, color: '#10b981' },
|
|
25
|
+
{ name: 'Referral', value: 20, color: '#f59e0b' }
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
const revenueData = [
|
|
29
|
+
{ month: 'Jan', revenue: 45000, expenses: 32000 },
|
|
30
|
+
{ month: 'Feb', revenue: 52000, expenses: 38000 },
|
|
31
|
+
{ month: 'Mar', revenue: 48000, expenses: 35000 },
|
|
32
|
+
{ month: 'Apr', revenue: 61000, expenses: 42000 },
|
|
33
|
+
{ month: 'May', revenue: 55000, expenses: 40000 },
|
|
34
|
+
{ month: 'Jun', revenue: 67000, expenses: 45000 }
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
const revenueCategories = {
|
|
38
|
+
revenue: { name: 'Revenue', color: '#3b82f6' },
|
|
39
|
+
expenses: { name: 'Expenses', color: '#ef4444' }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const orders = [
|
|
43
|
+
{ id: 1001, customer: 'John Doe', date: '2024-01-15T10:30:00', total: 250, status: 'Paid' as const },
|
|
44
|
+
{ id: 1002, customer: 'Jane Smith', date: '2024-01-14T14:20:00', total: 180, status: 'Pending' as const },
|
|
45
|
+
{ id: 1003, customer: 'Bob Johnson', date: '2024-01-13T09:15:00', total: 320, status: 'Paid' as const },
|
|
46
|
+
{ id: 1004, customer: 'Alice Brown', date: '2024-01-12T16:45:00', total: 150, status: 'Failed' as const }
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
const products = [
|
|
50
|
+
{ id: 1, name: 'Laptop Pro', category: 'Electronics', stock: 15, image: '' },
|
|
51
|
+
{ id: 2, name: 'Wireless Mouse', category: 'Accessories', stock: 45, image: '' },
|
|
52
|
+
{ id: 3, name: 'USB-C Cable', category: 'Cables', stock: 0, image: '' },
|
|
53
|
+
{ id: 4, name: 'Monitor 4K', category: 'Electronics', stock: 8, image: '' }
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
const activeUsers = [
|
|
57
|
+
{ metric: 'Total Users', current: 12450, percentChange: 8.5 },
|
|
58
|
+
{ metric: 'Active Sessions', current: 3421, percentChange: -2.3 },
|
|
59
|
+
{ metric: 'New Signups', current: 542, percentChange: 15.2 }
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
const handleClick = () => {
|
|
63
|
+
console.log('Card clicked!')
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<UDashboardPanel grow>
|
|
69
|
+
<UContainer>
|
|
70
|
+
<div class="py-8">
|
|
71
|
+
<h1 class="text-3xl font-bold mb-4">Card Components Showcase</h1>
|
|
72
|
+
<p class="text-gray-600 dark:text-gray-400 mb-8">
|
|
73
|
+
Complete showcase of all card components with standardized UCard format.
|
|
74
|
+
</p>
|
|
75
|
+
|
|
76
|
+
<!-- VaCardHeader Section -->
|
|
77
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardHeader</h2>
|
|
78
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Card header component with title, subtitle, and action slot.</p>
|
|
79
|
+
<div class="mb-8">
|
|
80
|
+
<UCard>
|
|
81
|
+
<template #header>
|
|
82
|
+
<h3 class="font-semibold">Header Example</h3>
|
|
83
|
+
</template>
|
|
84
|
+
<ClientOnly>
|
|
85
|
+
<VaCardHeader
|
|
86
|
+
title="Card Header"
|
|
87
|
+
subtitle="With subtitle text"
|
|
88
|
+
icon="i-heroicons-chart-bar"
|
|
89
|
+
/>
|
|
90
|
+
</ClientOnly>
|
|
91
|
+
</UCard>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<!-- VaCardTitle Section -->
|
|
95
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardTitle</h2>
|
|
96
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Large title component for card content.</p>
|
|
97
|
+
<div class="mb-8">
|
|
98
|
+
<UCard>
|
|
99
|
+
<template #header>
|
|
100
|
+
<h3 class="font-semibold">Title Example</h3>
|
|
101
|
+
</template>
|
|
102
|
+
<ClientOnly>
|
|
103
|
+
<VaCardTitle title="Card Title Component" />
|
|
104
|
+
</ClientOnly>
|
|
105
|
+
</UCard>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<!-- VaCardSubtitle Section -->
|
|
109
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardSubtitle</h2>
|
|
110
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Subtitle component for secondary text in cards.</p>
|
|
111
|
+
<div class="mb-8">
|
|
112
|
+
<UCard>
|
|
113
|
+
<template #header>
|
|
114
|
+
<h3 class="font-semibold">Subtitle Example</h3>
|
|
115
|
+
</template>
|
|
116
|
+
<ClientOnly>
|
|
117
|
+
<VaCardSubtitle subtitle="This is a card subtitle component" />
|
|
118
|
+
</ClientOnly>
|
|
119
|
+
</UCard>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<!-- VaCardKpi Section -->
|
|
123
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardKpi</h2>
|
|
124
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">KPI card with value and trend indicator.</p>
|
|
125
|
+
<div class="mb-8">
|
|
126
|
+
<UCard>
|
|
127
|
+
<template #header>
|
|
128
|
+
<h3 class="font-semibold">KPI Example</h3>
|
|
129
|
+
</template>
|
|
130
|
+
<ClientOnly>
|
|
131
|
+
<VaCardKpi
|
|
132
|
+
title="Total Revenue"
|
|
133
|
+
:value="45231"
|
|
134
|
+
:change="12.5"
|
|
135
|
+
trend="up"
|
|
136
|
+
icon="i-heroicons-currency-dollar"
|
|
137
|
+
/>
|
|
138
|
+
</ClientOnly>
|
|
139
|
+
</UCard>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<!-- VaCardKpi2 Section -->
|
|
143
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardKpi2</h2>
|
|
144
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Alternative KPI card with percentage change display.</p>
|
|
145
|
+
<div class="mb-8">
|
|
146
|
+
<UCard>
|
|
147
|
+
<template #header>
|
|
148
|
+
<h3 class="font-semibold">KPI2 Example</h3>
|
|
149
|
+
</template>
|
|
150
|
+
<ClientOnly>
|
|
151
|
+
<VaCardKpi2
|
|
152
|
+
title="Active Users"
|
|
153
|
+
:value="8432"
|
|
154
|
+
:change="-3.2"
|
|
155
|
+
trend="down"
|
|
156
|
+
icon="i-heroicons-users"
|
|
157
|
+
/>
|
|
158
|
+
</ClientOnly>
|
|
159
|
+
</UCard>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<!-- VaCardWithIndicator Section -->
|
|
163
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardWithIndicator</h2>
|
|
164
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Card with status indicator dot.</p>
|
|
165
|
+
<div class="mb-8">
|
|
166
|
+
<UCard>
|
|
167
|
+
<template #header>
|
|
168
|
+
<h3 class="font-semibold">Indicator Example</h3>
|
|
169
|
+
</template>
|
|
170
|
+
<ClientOnly>
|
|
171
|
+
<VaCardWithIndicator
|
|
172
|
+
title="Status"
|
|
173
|
+
value="Active"
|
|
174
|
+
indicator="success"
|
|
175
|
+
/>
|
|
176
|
+
</ClientOnly>
|
|
177
|
+
</UCard>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<!-- VaCardWithProgressCircle Section -->
|
|
181
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardWithProgressCircle</h2>
|
|
182
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Card with circular progress indicator.</p>
|
|
183
|
+
<div class="mb-8">
|
|
184
|
+
<UCard>
|
|
185
|
+
<template #header>
|
|
186
|
+
<h3 class="font-semibold">Progress Circle Example</h3>
|
|
187
|
+
</template>
|
|
188
|
+
<ClientOnly>
|
|
189
|
+
<VaCardWithProgressCircle
|
|
190
|
+
title="Completion"
|
|
191
|
+
:progress="75"
|
|
192
|
+
:total="100"
|
|
193
|
+
/>
|
|
194
|
+
</ClientOnly>
|
|
195
|
+
</UCard>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<!-- VaCardWithChart Section -->
|
|
199
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardWithChart</h2>
|
|
200
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Card with embedded area chart showing trends over time.</p>
|
|
201
|
+
<div class="mb-8">
|
|
202
|
+
<UCard>
|
|
203
|
+
<template #header>
|
|
204
|
+
<h3 class="font-semibold">Chart Example</h3>
|
|
205
|
+
</template>
|
|
206
|
+
<ClientOnly>
|
|
207
|
+
<VaCardWithChart
|
|
208
|
+
name="User Growth"
|
|
209
|
+
value="582"
|
|
210
|
+
/>
|
|
211
|
+
</ClientOnly>
|
|
212
|
+
</UCard>
|
|
213
|
+
</div>
|
|
214
|
+
|
|
215
|
+
<!-- VaCardWithChartBlock Section -->
|
|
216
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardWithChartBlock</h2>
|
|
217
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Card with chart block layout and title overlay.</p>
|
|
218
|
+
<div class="mb-8">
|
|
219
|
+
<UCard>
|
|
220
|
+
<template #header>
|
|
221
|
+
<h3 class="font-semibold">Chart Block Example</h3>
|
|
222
|
+
</template>
|
|
223
|
+
<ClientOnly>
|
|
224
|
+
<VaCardWithChartBlock
|
|
225
|
+
title="Performance Metrics"
|
|
226
|
+
text="Last 30 days"
|
|
227
|
+
>
|
|
228
|
+
<div class="h-32 bg-gradient-to-r from-blue-400 to-blue-600 rounded flex items-center justify-center">
|
|
229
|
+
<span class="text-white font-semibold">Chart Visualization</span>
|
|
230
|
+
</div>
|
|
231
|
+
</VaCardWithChartBlock>
|
|
232
|
+
</ClientOnly>
|
|
233
|
+
</UCard>
|
|
234
|
+
</div>
|
|
235
|
+
|
|
236
|
+
<!-- VaCardWithActiveUsers Section -->
|
|
237
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardWithActiveUsers</h2>
|
|
238
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Card displaying active user metrics with percentage changes.</p>
|
|
239
|
+
<div class="mb-8">
|
|
240
|
+
<UCard>
|
|
241
|
+
<template #header>
|
|
242
|
+
<h3 class="font-semibold">Active Users Examples</h3>
|
|
243
|
+
</template>
|
|
244
|
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
245
|
+
<ClientOnly v-for="user in activeUsers" :key="user.metric">
|
|
246
|
+
<VaCardWithActiveUsers
|
|
247
|
+
:metric="user.metric"
|
|
248
|
+
:current="user.current"
|
|
249
|
+
:percent-change="user.percentChange"
|
|
250
|
+
/>
|
|
251
|
+
</ClientOnly>
|
|
252
|
+
</div>
|
|
253
|
+
</UCard>
|
|
254
|
+
</div>
|
|
255
|
+
|
|
256
|
+
<!-- VaCardDonutChart Section -->
|
|
257
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardDonutChart</h2>
|
|
258
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Card with donut chart and category breakdown.</p>
|
|
259
|
+
<div class="mb-8">
|
|
260
|
+
<UCard>
|
|
261
|
+
<template #header>
|
|
262
|
+
<h3 class="font-semibold">Donut Chart Example</h3>
|
|
263
|
+
</template>
|
|
264
|
+
<ClientOnly>
|
|
265
|
+
<VaCardDonutChart
|
|
266
|
+
:data="donutChartData"
|
|
267
|
+
title="Traffic Sources"
|
|
268
|
+
total-value="100%"
|
|
269
|
+
/>
|
|
270
|
+
</ClientOnly>
|
|
271
|
+
</UCard>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
<!-- VaCardLatestOrders Section -->
|
|
275
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardLatestOrders</h2>
|
|
276
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Card displaying recent orders in a table format.</p>
|
|
277
|
+
<div class="mb-8">
|
|
278
|
+
<UCard>
|
|
279
|
+
<template #header>
|
|
280
|
+
<h3 class="font-semibold">Orders Table Example</h3>
|
|
281
|
+
</template>
|
|
282
|
+
<ClientOnly>
|
|
283
|
+
<VaCardLatestOrders :orders="orders" />
|
|
284
|
+
</ClientOnly>
|
|
285
|
+
</UCard>
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
<!-- VaCardPopularProducts Section -->
|
|
289
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardPopularProducts</h2>
|
|
290
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Card showing popular products with stock status.</p>
|
|
291
|
+
<div class="mb-8">
|
|
292
|
+
<UCard>
|
|
293
|
+
<template #header>
|
|
294
|
+
<h3 class="font-semibold">Products Table Example</h3>
|
|
295
|
+
</template>
|
|
296
|
+
<ClientOnly>
|
|
297
|
+
<VaCardPopularProducts :products="products" />
|
|
298
|
+
</ClientOnly>
|
|
299
|
+
</UCard>
|
|
300
|
+
</div>
|
|
301
|
+
|
|
302
|
+
<!-- VaCardRevenueBarChart Section -->
|
|
303
|
+
<h2 class="text-2xl font-semibold mb-4 mt-8">VaCardRevenueBarChart</h2>
|
|
304
|
+
<p class="text-gray-600 dark:text-gray-400 mb-4">Card with bar chart comparing revenue and expenses.</p>
|
|
305
|
+
<div class="mb-8">
|
|
306
|
+
<UCard>
|
|
307
|
+
<template #header>
|
|
308
|
+
<h3 class="font-semibold">Revenue Bar Chart Example</h3>
|
|
309
|
+
</template>
|
|
310
|
+
<ClientOnly>
|
|
311
|
+
<VaCardRevenueBarChart
|
|
312
|
+
title="Revenue vs Expenses"
|
|
313
|
+
total-value="$328,000"
|
|
314
|
+
:data="revenueData"
|
|
315
|
+
:categories="revenueCategories"
|
|
316
|
+
:y-axis="['revenue', 'expenses']"
|
|
317
|
+
:x-formatter="(i: number) => revenueData[i]?.month || ''"
|
|
318
|
+
:y-formatter="() => ''"
|
|
319
|
+
/>
|
|
320
|
+
</ClientOnly>
|
|
321
|
+
</UCard>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
</UContainer>
|
|
325
|
+
</UDashboardPanel>
|
|
326
|
+
</template>
|