@primevue/mcp 4.5.5 → 5.0.0-rc.2
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/LICENSE.md +45 -21
- package/README.md +48 -250
- package/data/components.json +47269 -0
- package/data/llms/components/accordion.md +629 -0
- package/data/llms/components/animateonscroll.md +165 -0
- package/data/llms/components/autocomplete.md +995 -0
- package/data/llms/components/avatar.md +264 -0
- package/data/llms/components/badge.md +200 -0
- package/data/llms/components/blockui.md +99 -0
- package/data/llms/components/breadcrumb.md +269 -0
- package/data/llms/components/button.md +902 -0
- package/data/llms/components/card.md +209 -0
- package/data/llms/components/carousel.md +506 -0
- package/data/llms/components/cascadeselect.md +1207 -0
- package/data/llms/components/chart.md +1022 -0
- package/data/llms/components/checkbox.md +401 -0
- package/data/llms/components/chip.md +206 -0
- package/data/llms/components/colorpicker.md +213 -0
- package/data/llms/components/commandmenu.md +660 -0
- package/data/llms/components/compare.md +407 -0
- package/data/llms/components/confirmdialog.md +343 -0
- package/data/llms/components/confirmpopup.md +252 -0
- package/data/llms/components/contextmenu.md +522 -0
- package/data/llms/components/datatable.md +5266 -0
- package/data/llms/components/dataview.md +569 -0
- package/data/llms/components/datepicker.md +964 -0
- package/data/llms/components/deferredcontent.md +96 -0
- package/data/llms/components/dialog.md +702 -0
- package/data/llms/components/divider.md +152 -0
- package/data/llms/components/dock.md +488 -0
- package/data/llms/components/drawer.md +469 -0
- package/data/llms/components/dynamicdialog.md +214 -0
- package/data/llms/components/editor.md +205 -0
- package/data/llms/components/fieldset.md +253 -0
- package/data/llms/components/fileupload.md +459 -0
- package/data/llms/components/floatlabel.md +144 -0
- package/data/llms/components/fluid.md +104 -0
- package/data/llms/components/focustrap.md +59 -0
- package/data/llms/components/forms.md +344 -0
- package/data/llms/components/galleria.md +1119 -0
- package/data/llms/components/gallery.md +1003 -0
- package/data/llms/components/iconfield.md +283 -0
- package/data/llms/components/iftalabel.md +96 -0
- package/data/llms/components/image.md +179 -0
- package/data/llms/components/imagecompare.md +108 -0
- package/data/llms/components/inplace.md +183 -0
- package/data/llms/components/inputcolor.md +869 -0
- package/data/llms/components/inputgroup.md +419 -0
- package/data/llms/components/inputmask.md +345 -0
- package/data/llms/components/inputnumber.md +551 -0
- package/data/llms/components/inputotp.md +345 -0
- package/data/llms/components/inputpassword.md +738 -0
- package/data/llms/components/inputtags.md +432 -0
- package/data/llms/components/inputtext.md +569 -0
- package/data/llms/components/installation.md +1 -0
- package/data/llms/components/keyfilter.md +116 -0
- package/data/llms/components/knob.md +318 -0
- package/data/llms/components/label.md +151 -0
- package/data/llms/components/laravel.md +53 -0
- package/data/llms/components/listbox.md +636 -0
- package/data/llms/components/mask.md +203 -0
- package/data/llms/components/mcp.md +39 -0
- package/data/llms/components/megamenu.md +563 -0
- package/data/llms/components/menu.md +651 -0
- package/data/llms/components/menubar.md +446 -0
- package/data/llms/components/message.md +497 -0
- package/data/llms/components/metergroup.md +281 -0
- package/data/llms/components/multiselect.md +752 -0
- package/data/llms/components/orderlist.md +224 -0
- package/data/llms/components/organizationchart.md +418 -0
- package/data/llms/components/paginator.md +221 -0
- package/data/llms/components/panel.md +321 -0
- package/data/llms/components/panelmenu.md +703 -0
- package/data/llms/components/password.md +657 -0
- package/data/llms/components/picklist.md +286 -0
- package/data/llms/components/popover.md +145 -0
- package/data/llms/components/progressbar.md +242 -0
- package/data/llms/components/progressspinner.md +104 -0
- package/data/llms/components/radiobutton.md +427 -0
- package/data/llms/components/rating.md +312 -0
- package/data/llms/components/ripple.md +91 -0
- package/data/llms/components/scrollarea.md +700 -0
- package/data/llms/components/scrollpanel.md +131 -0
- package/data/llms/components/scrolltop.md +87 -0
- package/data/llms/components/select.md +1251 -0
- package/data/llms/components/selectbutton.md +268 -0
- package/data/llms/components/sidebar.md +2232 -0
- package/data/llms/components/skeleton.md +302 -0
- package/data/llms/components/slider.md +416 -0
- package/data/llms/components/speeddial.md +402 -0
- package/data/llms/components/splitbutton.md +840 -0
- package/data/llms/components/splitter.md +447 -0
- package/data/llms/components/stepper.md +551 -0
- package/data/llms/components/styleclass.md +226 -0
- package/data/llms/components/tabs.md +609 -0
- package/data/llms/components/tag.md +178 -0
- package/data/llms/components/terminal.md +123 -0
- package/data/llms/components/textarea.md +519 -0
- package/data/llms/components/tieredmenu.md +578 -0
- package/data/llms/components/timeline.md +494 -0
- package/data/llms/components/toast.md +472 -0
- package/data/llms/components/togglebutton.md +276 -0
- package/data/llms/components/toggleswitch.md +271 -0
- package/data/llms/components/toolbar.md +140 -0
- package/data/llms/components/tooltip.md +160 -0
- package/data/llms/components/tree.md +1076 -0
- package/data/llms/components/treeselect.md +660 -0
- package/data/llms/components/treetable.md +2493 -0
- package/data/llms/components/virtualscroller.md +265 -0
- package/data/llms/guides/autoimport.md +28 -0
- package/data/llms/guides/cdn.md +72 -0
- package/data/llms/guides/configuration.md +158 -0
- package/data/llms/guides/customicons.md +67 -0
- package/data/llms/guides/guides/accessibility.md +27 -0
- package/data/llms/guides/guides/animations.md +119 -0
- package/data/llms/guides/guides/rtl.md +7 -0
- package/data/llms/guides/icons.md +136 -0
- package/data/llms/guides/installation.md +3 -0
- package/data/llms/guides/laravel.md +66 -0
- package/data/llms/guides/llms.md +15 -0
- package/data/llms/guides/mcp.md +104 -0
- package/data/llms/guides/migration/v4.md +15 -0
- package/data/llms/guides/migration/v5.md +15 -0
- package/data/llms/guides/nuxt.md +141 -0
- package/data/llms/guides/passthrough.md +137 -0
- package/data/llms/guides/primeclt.md +43 -0
- package/data/llms/guides/tailwind.md +151 -0
- package/data/llms/guides/theming/styled.md +497 -0
- package/data/llms/guides/theming/unstyled.md +57 -0
- package/data/llms/guides/uikit.md +3 -0
- package/data/llms/guides/vite.md +90 -0
- package/data/llms/llms-full.txt +54465 -0
- package/data/llms/llms.txt +132 -0
- package/data/llms/pages/accessibility.md +27 -0
- package/data/llms/pages/animations.md +119 -0
- package/data/llms/pages/autoimport.md +28 -0
- package/data/llms/pages/cdn.md +72 -0
- package/data/llms/pages/configuration.md +158 -0
- package/data/llms/pages/contribution.md +31 -0
- package/data/llms/pages/customicons.md +67 -0
- package/data/llms/pages/designer.md +79 -0
- package/data/llms/pages/dynamicimports.md +7 -0
- package/data/llms/pages/forms.md +63 -0
- package/data/llms/pages/guides/accessibility.md +27 -0
- package/data/llms/pages/guides/animations.md +119 -0
- package/data/llms/pages/guides/rtl.md +7 -0
- package/data/llms/pages/icons.md +136 -0
- package/data/llms/pages/installation.md +3 -0
- package/data/llms/pages/introduction.md +23 -0
- package/data/llms/pages/laravel.md +66 -0
- package/data/llms/pages/llms.md +15 -0
- package/data/llms/pages/mcp.md +104 -0
- package/data/llms/pages/migration/v4.md +15 -0
- package/data/llms/pages/migration/v5.md +15 -0
- package/data/llms/pages/nuxt.md +141 -0
- package/data/llms/pages/passthrough.md +137 -0
- package/data/llms/pages/primeclt.md +43 -0
- package/data/llms/pages/rtl.md +7 -0
- package/data/llms/pages/setup.md +3 -0
- package/data/llms/pages/styled.md +497 -0
- package/data/llms/pages/tailwind.md +151 -0
- package/data/llms/pages/theming/styled.md +497 -0
- package/data/llms/pages/theming/unstyled.md +57 -0
- package/data/llms/pages/uikit.md +3 -0
- package/data/llms/pages/unstyled.md +57 -0
- package/data/llms/pages/v4.md +15 -0
- package/data/llms/pages/v5.md +15 -0
- package/data/llms/pages/vite.md +90 -0
- package/data/manifest.json +11117 -0
- package/data/mcp-data.json +55940 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.js +66066 -72541
- package/package.json +10 -12
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
# Timeline
|
|
2
|
+
|
|
3
|
+
Timeline visualizes a series of chained events.
|
|
4
|
+
|
|
5
|
+
## Basic
|
|
6
|
+
|
|
7
|
+
Timeline receives the events with the value property as a collection of arbitrary objects. In addition, content template is required to display the representation of an event. Example below is a sample events array that is used throughout the documentation.
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<template>
|
|
11
|
+
<Timeline :value="events">
|
|
12
|
+
<template #content="slotProps">
|
|
13
|
+
<div class="text-sm leading-4">
|
|
14
|
+
{{ slotProps.item.status }}
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
</Timeline>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { ref } from 'vue';
|
|
22
|
+
|
|
23
|
+
const events = ref([{ status: 'Ordered' }, { status: 'Processing' }, { status: 'Shipped' }, { status: 'Delivered' }]);
|
|
24
|
+
<\/script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Alignment
|
|
28
|
+
|
|
29
|
+
Content location relative the line is defined with the align property.
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<template>
|
|
33
|
+
<div class="flex flex-wrap gap-12">
|
|
34
|
+
<Timeline :value="events" class="w-full md:w-80">
|
|
35
|
+
<template #content="slotProps">
|
|
36
|
+
<div class="text-sm leading-4">
|
|
37
|
+
{{ slotProps.item.status }}
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
</Timeline>
|
|
41
|
+
|
|
42
|
+
<Timeline :value="events" align="right" class="w-full md:w-80">
|
|
43
|
+
<template #content="slotProps">
|
|
44
|
+
<div class="text-sm leading-4">
|
|
45
|
+
{{ slotProps.item.status }}
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
</Timeline>
|
|
49
|
+
|
|
50
|
+
<Timeline :value="events" align="alternate" class="w-full md:w-80">
|
|
51
|
+
<template #content="slotProps">
|
|
52
|
+
<div class="text-sm leading-4">
|
|
53
|
+
{{ slotProps.item.status }}
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
</Timeline>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup>
|
|
61
|
+
import { ref } from 'vue';
|
|
62
|
+
|
|
63
|
+
const events = ref([{ status: 'Ordered' }, { status: 'Processing' }, { status: 'Shipped' }, { status: 'Delivered' }]);
|
|
64
|
+
<\/script>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Opposite
|
|
68
|
+
|
|
69
|
+
Additional content at the other side of the line can be provided with the opposite property.
|
|
70
|
+
|
|
71
|
+
```vue
|
|
72
|
+
<template>
|
|
73
|
+
<Timeline :value="events">
|
|
74
|
+
<template #opposite="slotProps">
|
|
75
|
+
<div class="text-xs leading-4 text-surface-500 dark:text-surface-400">{{ slotProps.item.date }}</div>
|
|
76
|
+
</template>
|
|
77
|
+
<template #content="slotProps">
|
|
78
|
+
<div class="text-sm leading-4">
|
|
79
|
+
{{ slotProps.item.status }}
|
|
80
|
+
</div>
|
|
81
|
+
</template>
|
|
82
|
+
</Timeline>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<script setup>
|
|
86
|
+
import { ref } from 'vue';
|
|
87
|
+
|
|
88
|
+
const events = ref([
|
|
89
|
+
{ status: 'Ordered', date: '15/10/2026 10:30' },
|
|
90
|
+
{ status: 'Processing', date: '15/10/2026 14:00' },
|
|
91
|
+
{ status: 'Shipped', date: '15/10/2026 16:15' },
|
|
92
|
+
{ status: 'Delivered', date: '16/10/2026 10:00' }
|
|
93
|
+
]);
|
|
94
|
+
<\/script>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Horizontal
|
|
98
|
+
|
|
99
|
+
TimeLine orientation is controlled with the layout property, default is vertical having horizontal as the alternative.
|
|
100
|
+
|
|
101
|
+
```vue
|
|
102
|
+
<template>
|
|
103
|
+
<div class="flex flex-col gap-4">
|
|
104
|
+
<Timeline :value="events" layout="horizontal" align="top">
|
|
105
|
+
<template #content="slotProps">
|
|
106
|
+
<span class="text-sm">
|
|
107
|
+
{{ slotProps.item }}
|
|
108
|
+
</span>
|
|
109
|
+
</template>
|
|
110
|
+
</Timeline>
|
|
111
|
+
|
|
112
|
+
<Timeline :value="events" layout="horizontal" align="bottom">
|
|
113
|
+
<template #content="slotProps">
|
|
114
|
+
<span class="text-sm">
|
|
115
|
+
{{ slotProps.item }}
|
|
116
|
+
</span>
|
|
117
|
+
</template>
|
|
118
|
+
</Timeline>
|
|
119
|
+
|
|
120
|
+
<Timeline :value="events" layout="horizontal" align="alternate">
|
|
121
|
+
<template #opposite> </template>
|
|
122
|
+
<template #content="slotProps">
|
|
123
|
+
<span class="text-sm">
|
|
124
|
+
{{ slotProps.item }}
|
|
125
|
+
</span>
|
|
126
|
+
</template>
|
|
127
|
+
</Timeline>
|
|
128
|
+
</div>
|
|
129
|
+
</template>
|
|
130
|
+
|
|
131
|
+
<script setup>
|
|
132
|
+
import { ref } from 'vue';
|
|
133
|
+
|
|
134
|
+
const events = ref(['2026', '2027', '2028', '2029']);
|
|
135
|
+
<\/script>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Custom
|
|
139
|
+
|
|
140
|
+
Sample implementation with custom content, styled markers, and rich event cards.
|
|
141
|
+
|
|
142
|
+
```vue
|
|
143
|
+
<template>
|
|
144
|
+
<Timeline :value="events" align="alternate" class="w-full @container" :pt="{ event: { class: '@max-[480px]:flex-row!' }, eventOpposite: { class: '@max-[480px]:hidden' }, eventContent: { class: '@max-[480px]:text-left!' }, eventConnector: { class: 'mb-4' } }">
|
|
145
|
+
<template #opposite="slotProps">
|
|
146
|
+
<div class="font-medium text-surface-700 dark:text-surface-200">{{ slotProps.item.date }}</div>
|
|
147
|
+
<div class="text-sm text-surface-500 dark:text-surface-400">{{ slotProps.item.time }}</div>
|
|
148
|
+
</template>
|
|
149
|
+
<template #marker="slotProps">
|
|
150
|
+
<span :class="'flex items-center justify-center w-12 h-12 rounded-full text-white shadow-lg ' + slotProps.item.color">
|
|
151
|
+
<component :is="slotProps.icon" class="w-4.5! h-4.5!" />
|
|
152
|
+
</span>
|
|
153
|
+
</template>
|
|
154
|
+
<template #content="slotProps">
|
|
155
|
+
<div class="p-5 rounded-xl bg-surface-0 dark:bg-surface-800 border border-surface-200 dark:border-surface-700 shadow-sm mb-4 text-left">
|
|
156
|
+
<div class="hidden @max-[480px]:block mb-2 text-sm text-surface-500 dark:text-surface-400">{{ slotProps.item.date }} · {{ slotProps.item.time }}</div>
|
|
157
|
+
<div class="flex items-center gap-3 mb-3">
|
|
158
|
+
<Avatar :label="slotProps.item.user" shape="circle" class="bg-primary/10! text-primary! font-semibold!" />
|
|
159
|
+
<span class="font-bold text-surface-900 dark:text-surface-0">{{ slotProps.item.status }}</span>
|
|
160
|
+
</div>
|
|
161
|
+
<span class="text-surface-600 dark:text-surface-300 text-sm leading-relaxed">{{ slotProps.item.description }}</span>
|
|
162
|
+
<ul v-if="slotProps.item.details" class="mt-3 space-y-1">
|
|
163
|
+
<li v-for="detail in slotProps.item.details" :key="detail" class="text-sm text-surface-500 dark:text-surface-400 flex items-center gap-2">
|
|
164
|
+
<Box :size="12" />
|
|
165
|
+
{{ detail }}
|
|
166
|
+
</li>
|
|
167
|
+
</ul>
|
|
168
|
+
<div v-if="slotProps.item.tracking" class="mt-4 p-3 rounded-lg bg-surface-100 dark:bg-surface-700 flex items-center justify-between">
|
|
169
|
+
<span class="text-sm text-surface-600 dark:text-surface-300 flex items-center">
|
|
170
|
+
<MapMarker class="mr-2 shrink-0" />
|
|
171
|
+
Tracking: {{ slotProps.item.tracking }}
|
|
172
|
+
</span>
|
|
173
|
+
<Button variant="text" size="small">Track</Button>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</template>
|
|
177
|
+
</Timeline>
|
|
178
|
+
</template>
|
|
179
|
+
|
|
180
|
+
<script setup>
|
|
181
|
+
import { ref } from 'vue';
|
|
182
|
+
import Box from '@primeicons/vue/box';
|
|
183
|
+
import CheckCircle from '@primeicons/vue/check-circle';
|
|
184
|
+
import CreditCard from '@primeicons/vue/credit-card';
|
|
185
|
+
import MapMarker from '@primeicons/vue/map-marker';
|
|
186
|
+
import ShoppingCart from '@primeicons/vue/shopping-cart';
|
|
187
|
+
import Truck from '@primeicons/vue/truck';
|
|
188
|
+
|
|
189
|
+
const events = ref([
|
|
190
|
+
{
|
|
191
|
+
status: 'Order Placed',
|
|
192
|
+
date: 'Oct 15, 2026',
|
|
193
|
+
time: '10:30 AM',
|
|
194
|
+
icon: ShoppingCart,
|
|
195
|
+
color: 'bg-blue-500',
|
|
196
|
+
user: 'JD',
|
|
197
|
+
description: 'Your order #12345 has been confirmed and is being prepared for processing.',
|
|
198
|
+
details: ['2x Wireless Headphones', '1x Phone Case', '1x USB-C Cable']
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
status: 'Payment Confirmed',
|
|
202
|
+
date: 'Oct 15, 2026',
|
|
203
|
+
time: '10:32 AM',
|
|
204
|
+
icon: CreditCard,
|
|
205
|
+
color: 'bg-green-500',
|
|
206
|
+
user: 'SY',
|
|
207
|
+
description: 'Payment of $149.99 was successfully processed via Credit Card ending in 4242.'
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
status: 'Shipped',
|
|
211
|
+
date: 'Oct 16, 2026',
|
|
212
|
+
time: '02:15 PM',
|
|
213
|
+
icon: Truck,
|
|
214
|
+
color: 'bg-orange-500',
|
|
215
|
+
user: 'MK',
|
|
216
|
+
description: 'Package has been handed to the carrier and is on its way.',
|
|
217
|
+
tracking: 'TRK-892374651'
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
status: 'Delivered',
|
|
221
|
+
date: 'Oct 18, 2026',
|
|
222
|
+
time: '11:20 AM',
|
|
223
|
+
icon: CheckCircle,
|
|
224
|
+
color: 'bg-lime-500',
|
|
225
|
+
user: 'JD',
|
|
226
|
+
description: 'Package was delivered and signed for at the front door.'
|
|
227
|
+
}
|
|
228
|
+
]);
|
|
229
|
+
<\/script>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Interactive
|
|
233
|
+
|
|
234
|
+
Build interactive step-based workflows with progress tracking and state management.
|
|
235
|
+
|
|
236
|
+
```vue
|
|
237
|
+
<template>
|
|
238
|
+
<div class="flex flex-col gap-6">
|
|
239
|
+
<div class="flex items-center justify-between">
|
|
240
|
+
<div>
|
|
241
|
+
<h3 class="text-lg font-semibold m-0">Onboarding Progress</h3>
|
|
242
|
+
<p class="text-surface-500 text-sm mt-1 mb-0">{{ completedSteps.length }} of {{ allSteps.length }} steps completed</p>
|
|
243
|
+
</div>
|
|
244
|
+
<Button variant="outlined" size="small" @click="handleReset()">
|
|
245
|
+
<Refresh />
|
|
246
|
+
Reset
|
|
247
|
+
</Button>
|
|
248
|
+
</div>
|
|
249
|
+
<div class="w-full bg-surface-200 dark:bg-surface-700 rounded-full h-2">
|
|
250
|
+
<div class="bg-primary rounded-full h-2 transition-all duration-500" :style="{ width: (completedSteps.length / allSteps.length) * 100 + '%' }"></div>
|
|
251
|
+
</div>
|
|
252
|
+
<Timeline :value="allSteps">
|
|
253
|
+
<template #marker="slotProps">
|
|
254
|
+
<button
|
|
255
|
+
type="button"
|
|
256
|
+
:class="
|
|
257
|
+
'w-10 h-10 rounded-full flex items-center justify-center border-none transition-all duration-300 ' +
|
|
258
|
+
(getStepStatus(slotProps.item.id) === 'completed'
|
|
259
|
+
? 'bg-green-500 text-white cursor-default'
|
|
260
|
+
: getStepStatus(slotProps.item.id) === 'current'
|
|
261
|
+
? 'bg-primary text-primary-contrast cursor-pointer hover:scale-110 animate-pulse'
|
|
262
|
+
: 'bg-surface-200 dark:bg-surface-700 text-surface-400 cursor-not-allowed')
|
|
263
|
+
"
|
|
264
|
+
:disabled="getStepStatus(slotProps.item.id) !== 'current'"
|
|
265
|
+
@click="handleComplete(slotProps.item.id)"
|
|
266
|
+
>
|
|
267
|
+
<Check v-if="getStepStatus(slotProps.item.id) === 'completed'" />
|
|
268
|
+
<component :is="slotProps.icon" v-else />
|
|
269
|
+
</button>
|
|
270
|
+
</template>
|
|
271
|
+
<template #content="slotProps">
|
|
272
|
+
<div :class="'p-3 rounded-lg transition-all duration-300 ' + (getStepStatus(slotProps.item.id) === 'completed' ? 'bg-green-50 dark:bg-green-900/20' : getStepStatus(slotProps.item.id) === 'current' ? 'bg-primary/10' : 'opacity-50')">
|
|
273
|
+
<p :class="'m-0 font-medium ' + (getStepStatus(slotProps.item.id) === 'completed' ? 'text-green-700 dark:text-green-400 line-through' : getStepStatus(slotProps.item.id) === 'current' ? 'text-primary' : 'text-surface-500')">
|
|
274
|
+
{{ slotProps.item.label }}
|
|
275
|
+
</p>
|
|
276
|
+
<p v-if="getStepStatus(slotProps.item.id) === 'current'" class="text-xs text-surface-500 mt-1 mb-0">Click the marker to complete</p>
|
|
277
|
+
</div>
|
|
278
|
+
</template>
|
|
279
|
+
</Timeline>
|
|
280
|
+
<div v-if="completedSteps.length === allSteps.length"
|
|
281
|
+
class="p-4 rounded-lg bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 flex flex-col items-center gap-2">
|
|
282
|
+
<CheckCircle size="24" class="text-green-500" />
|
|
283
|
+
<div class="font-semibold text-green-700 dark:text-green-400">Onboarding Complete!</div>
|
|
284
|
+
<span class="text-sm text-green-600 dark:text-green-500 leading-none">You've completed all the steps.</span>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
</template>
|
|
288
|
+
|
|
289
|
+
<script setup>
|
|
290
|
+
import { ref } from 'vue';
|
|
291
|
+
import Check from '@primeicons/vue/check';
|
|
292
|
+
import CheckCircle from '@primeicons/vue/check-circle';
|
|
293
|
+
import Envelope from '@primeicons/vue/envelope';
|
|
294
|
+
import IdCard from '@primeicons/vue/id-card';
|
|
295
|
+
import Refresh from '@primeicons/vue/refresh';
|
|
296
|
+
import ShoppingBag from '@primeicons/vue/shopping-bag';
|
|
297
|
+
import Star from '@primeicons/vue/star';
|
|
298
|
+
import UserPlus from '@primeicons/vue/user-plus';
|
|
299
|
+
|
|
300
|
+
const allSteps = ref([
|
|
301
|
+
{ id: 1, label: 'Account Created', icon: UserPlus },
|
|
302
|
+
{ id: 2, label: 'Email Verified', icon: Envelope },
|
|
303
|
+
{ id: 3, label: 'Profile Completed', icon: IdCard },
|
|
304
|
+
{ id: 4, label: 'First Purchase', icon: ShoppingBag },
|
|
305
|
+
{ id: 5, label: 'Review Posted', icon: Star }
|
|
306
|
+
]);
|
|
307
|
+
|
|
308
|
+
const completedSteps = ref([1]);
|
|
309
|
+
const currentStep = ref(2);
|
|
310
|
+
|
|
311
|
+
const handleComplete = (stepId) => {
|
|
312
|
+
if (stepId === currentStep.value) {
|
|
313
|
+
completedSteps.value = [...completedSteps.value, stepId];
|
|
314
|
+
currentStep.value++;
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
const handleReset = () => {
|
|
319
|
+
completedSteps.value = [1];
|
|
320
|
+
currentStep.value = 2;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
const getStepStatus = (stepId) => {
|
|
324
|
+
if (completedSteps.value.includes(stepId)) {
|
|
325
|
+
return 'completed';
|
|
326
|
+
}
|
|
327
|
+
if (stepId === currentStep.value) {
|
|
328
|
+
return 'current';
|
|
329
|
+
}
|
|
330
|
+
return 'pending';
|
|
331
|
+
};
|
|
332
|
+
<\/script>
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Activity Feed
|
|
336
|
+
|
|
337
|
+
Display real-time activity streams with user avatars and contextual information.
|
|
338
|
+
|
|
339
|
+
```vue
|
|
340
|
+
<template>
|
|
341
|
+
<div class="max-w-2xl">
|
|
342
|
+
<div class="flex items-center gap-3 mb-6">
|
|
343
|
+
<History :size="16" class="text-surface-500" />
|
|
344
|
+
<span class="text-lg font-semibold text-surface-900 dark:text-surface-0">Recent Activity</span>
|
|
345
|
+
</div>
|
|
346
|
+
<Timeline :value="activities">
|
|
347
|
+
<template #opposite="slotProps">
|
|
348
|
+
<span class="text-xs text-surface-400 dark:text-surface-500 whitespace-nowrap">{{ slotProps.item.time }}</span>
|
|
349
|
+
</template>
|
|
350
|
+
<template #marker="slotProps">
|
|
351
|
+
<Avatar :label="slotProps.item.user.avatar" shape="circle" :class="slotProps.item.user.color + ' text-white! text-xs font-semibold'" />
|
|
352
|
+
</template>
|
|
353
|
+
<template #content="slotProps">
|
|
354
|
+
<div class="pb-6">
|
|
355
|
+
<div class="flex items-center gap-2 flex-wrap">
|
|
356
|
+
<span class="font-medium text-surface-900 dark:text-surface-0">{{ slotProps.item.user.name }}</span>
|
|
357
|
+
<span class="text-surface-500 dark:text-surface-400">{{ slotProps.item.action }}</span>
|
|
358
|
+
<span class="font-medium text-primary">{{ slotProps.item.target }}</span>
|
|
359
|
+
<template v-if="slotProps.item.repo">
|
|
360
|
+
<span class="text-surface-500 dark:text-surface-400">to</span>
|
|
361
|
+
<code class="px-2 py-0.5 rounded bg-surface-100 dark:bg-surface-800 text-sm font-mono text-surface-700 dark:text-surface-300">{{ slotProps.item.repo }}</code>
|
|
362
|
+
</template>
|
|
363
|
+
</div>
|
|
364
|
+
<p v-if="slotProps.item.description" class="mt-2 text-sm text-surface-600 dark:text-surface-400">{{ slotProps.item.description }}</p>
|
|
365
|
+
<div v-if="slotProps.item.details" class="mt-3 p-3 rounded-lg bg-surface-50 dark:bg-surface-800 border border-surface-200 dark:border-surface-700">
|
|
366
|
+
<ul class="space-y-1">
|
|
367
|
+
<li v-for="detail in slotProps.item.details" :key="detail" class="text-sm text-surface-600 dark:text-surface-400 font-mono flex items-start gap-2">
|
|
368
|
+
<Minus class="text-xs mt-1.5 text-surface-400" />
|
|
369
|
+
{{ detail }}
|
|
370
|
+
</li>
|
|
371
|
+
</ul>
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
</template>
|
|
375
|
+
</Timeline>
|
|
376
|
+
</div>
|
|
377
|
+
</template>
|
|
378
|
+
|
|
379
|
+
<script setup>
|
|
380
|
+
import { ref } from 'vue';
|
|
381
|
+
import History from '@primeicons/vue/history';
|
|
382
|
+
import Minus from '@primeicons/vue/minus';
|
|
383
|
+
|
|
384
|
+
const activities = ref([
|
|
385
|
+
{
|
|
386
|
+
id: 1,
|
|
387
|
+
user: { name: 'Sarah Chen', avatar: 'SC', color: 'bg-violet-500!' },
|
|
388
|
+
action: 'pushed',
|
|
389
|
+
target: '3 commits',
|
|
390
|
+
repo: 'main',
|
|
391
|
+
time: '2 minutes ago',
|
|
392
|
+
details: ['fix: resolve memory leak in useEffect', 'feat: add dark mode toggle', 'chore: update dependencies']
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
id: 2,
|
|
396
|
+
user: { name: 'Alex Kumar', avatar: 'AK', color: 'bg-blue-500!' },
|
|
397
|
+
action: 'opened',
|
|
398
|
+
target: 'pull request #142',
|
|
399
|
+
repo: 'feature/auth',
|
|
400
|
+
time: '15 minutes ago',
|
|
401
|
+
description: 'Implement OAuth2 authentication flow'
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
id: 3,
|
|
405
|
+
user: { name: 'Maya Johnson', avatar: 'MJ', color: 'bg-emerald-500!' },
|
|
406
|
+
action: 'commented on',
|
|
407
|
+
target: 'issue #89',
|
|
408
|
+
time: '1 hour ago',
|
|
409
|
+
description: "I've investigated this bug and found the root cause. Working on a fix now."
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
id: 4,
|
|
413
|
+
user: { name: 'David Park', avatar: 'DP', color: 'bg-amber-500!' },
|
|
414
|
+
action: 'merged',
|
|
415
|
+
target: 'pull request #138',
|
|
416
|
+
repo: 'main',
|
|
417
|
+
time: '3 hours ago'
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
id: 5,
|
|
421
|
+
user: { name: 'Emma Wilson', avatar: 'EW', color: 'bg-rose-500!' },
|
|
422
|
+
action: 'created',
|
|
423
|
+
target: 'release v2.4.0',
|
|
424
|
+
time: '5 hours ago',
|
|
425
|
+
description: 'Performance improvements and bug fixes'
|
|
426
|
+
}
|
|
427
|
+
]);
|
|
428
|
+
<\/script>
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
## Accessibility
|
|
432
|
+
|
|
433
|
+
Screen Reader Timeline uses a semantic ordered list element to list the events. No specific role is enforced, still you may use any aria role and attributes as any valid attribute is passed to the list element. Keyboard Support Component does not include any interactive elements.
|
|
434
|
+
|
|
435
|
+
## Timeline API
|
|
436
|
+
|
|
437
|
+
### Props
|
|
438
|
+
|
|
439
|
+
| Name |Type |Default |Description |
|
|
440
|
+
| --- | --- | --- | --- |
|
|
441
|
+
| value | any[] | - | An array of events to display. |
|
|
442
|
+
| align | HintedString<"left" \| "right" \| "top" \| "bottom" \| "alternate"> | left | Position of the timeline bar relative to the content. |
|
|
443
|
+
| layout | HintedString<"horizontal" \| "vertical"> | horizontal | Orientation of the timeline. |
|
|
444
|
+
| dataKey | string | - | Name of the field that uniquely identifies the a record in the data. |
|
|
445
|
+
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
|
|
446
|
+
| pt | PassThrough<TimelinePassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
|
|
447
|
+
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
|
|
448
|
+
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
|
|
449
|
+
|
|
450
|
+
### Pass Through Options
|
|
451
|
+
|
|
452
|
+
| Name |Type |Description |
|
|
453
|
+
| --- | --- | --- |
|
|
454
|
+
| root | TimelinePassThroughOptionType | Used to pass attributes to the root's DOM element. |
|
|
455
|
+
| event | TimelinePassThroughOptionType | Used to pass attributes to the event's DOM element. |
|
|
456
|
+
| eventOpposite | TimelinePassThroughOptionType | Used to pass attributes to the event opposite's DOM element. |
|
|
457
|
+
| eventSeparator | TimelinePassThroughOptionType | Used to pass attributes to the event separator's DOM element. |
|
|
458
|
+
| eventMarker | TimelinePassThroughOptionType | Used to pass attributes to the event marker's DOM element. |
|
|
459
|
+
| eventConnector | TimelinePassThroughOptionType | Used to pass attributes to the event connector's DOM element. |
|
|
460
|
+
| eventContent | TimelinePassThroughOptionType | Used to pass attributes to the event content's DOM element. |
|
|
461
|
+
| hooks | any | Used to manage all lifecycle hooks. |
|
|
462
|
+
|
|
463
|
+
### Theming
|
|
464
|
+
|
|
465
|
+
### CSS Classes
|
|
466
|
+
|
|
467
|
+
| Class |Description |
|
|
468
|
+
| --- | --- |
|
|
469
|
+
| p-timeline | Class name of the root element |
|
|
470
|
+
| p-timeline-event | Class name of the event element |
|
|
471
|
+
| p-timeline-event-opposite | Class name of the event opposite element |
|
|
472
|
+
| p-timeline-event-separator | Class name of the event separator element |
|
|
473
|
+
| p-timeline-event-marker | Class name of the event marker element |
|
|
474
|
+
| p-timeline-event-connector | Class name of the event connector element |
|
|
475
|
+
| p-timeline-event-content | Class name of the event content element |
|
|
476
|
+
|
|
477
|
+
### Design Tokens
|
|
478
|
+
|
|
479
|
+
| Token |CSS Variable |Description |
|
|
480
|
+
| --- | --- | --- |
|
|
481
|
+
| timeline.event.min.height | --p-timeline-event-min-height | Min height of event |
|
|
482
|
+
| timeline.horizontal.event.content.padding | --p-timeline-horizontal-event-content-padding | Event content padding of horizontal |
|
|
483
|
+
| timeline.vertical.event.content.padding | --p-timeline-vertical-event-content-padding | Event content padding of vertical |
|
|
484
|
+
| timeline.event.marker.size | --p-timeline-event-marker-size | Size of event marker |
|
|
485
|
+
| timeline.event.marker.border.radius | --p-timeline-event-marker-border-radius | Border radius of event marker |
|
|
486
|
+
| timeline.event.marker.border.width | --p-timeline-event-marker-border-width | Border width of event marker |
|
|
487
|
+
| timeline.event.marker.background | --p-timeline-event-marker-background | Background of event marker |
|
|
488
|
+
| timeline.event.marker.border.color | --p-timeline-event-marker-border-color | Border color of event marker |
|
|
489
|
+
| timeline.event.marker.content.border.radius | --p-timeline-event-marker-content-border-radius | Content border radius of event marker |
|
|
490
|
+
| timeline.event.marker.content.size | --p-timeline-event-marker-content-size | Content size of event marker |
|
|
491
|
+
| timeline.event.marker.content.background | --p-timeline-event-marker-content-background | Content background of event marker |
|
|
492
|
+
| timeline.event.marker.content.inset.shadow | --p-timeline-event-marker-content-inset-shadow | Content inset shadow of event marker |
|
|
493
|
+
| timeline.event.connector.color | --p-timeline-event-connector-color | Color of event connector |
|
|
494
|
+
| timeline.event.connector.size | --p-timeline-event-connector-size | Size of event connector |
|