@escalated-dev/escalated 0.7.0 → 0.8.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/LICENSE +21 -21
- package/README.md +36 -1
- package/package.json +16 -7
- package/src/components/ActiveChatsPanel.vue +246 -0
- package/src/components/ActivityTimeline.stories.js +55 -55
- package/src/components/ActivityTimeline.vue +83 -83
- package/src/components/AdminDashboard.stories.js +1423 -1095
- package/src/components/AgentLoadIndicator.stories.js +37 -37
- package/src/components/AgentLoadIndicator.vue +49 -49
- package/src/components/AgentPerformanceCard.vue +44 -44
- package/src/components/ArticleEditor.vue +82 -82
- package/src/components/AssigneeSelect.vue +37 -37
- package/src/components/AttachmentList.vue +13 -1
- package/src/components/AuditLogEntry.vue +95 -95
- package/src/components/BulkActionBar.vue +166 -166
- package/src/components/CategoryTree.vue +89 -89
- package/src/components/ChartWidget.vue +46 -46
- package/src/components/ChatActionBar.vue +226 -0
- package/src/components/ChatBubble.vue +162 -0
- package/src/components/ChatComposer.vue +308 -0
- package/src/components/ChatQueue.vue +222 -0
- package/src/components/ChatThread.vue +197 -0
- package/src/components/CollisionWarning.stories.js +30 -30
- package/src/components/CollisionWarning.vue +68 -68
- package/src/components/ConditionalFieldRules.vue +135 -135
- package/src/components/ContextPanel.vue +66 -66
- package/src/components/ContextPanelSection.vue +65 -65
- package/src/components/CustomFieldRenderer.vue +159 -159
- package/src/components/EscalatedLayout.vue +35 -6
- package/src/components/FileDropzone.vue +57 -57
- package/src/components/FollowButton.stories.js +30 -30
- package/src/components/FollowButton.vue +88 -88
- package/src/components/KeyboardShortcutHelp.vue +213 -213
- package/src/components/KnowledgePanel.vue +122 -122
- package/src/components/KpiCard.stories.js +32 -32
- package/src/components/KpiCard.vue +88 -88
- package/src/components/MacroDropdown.vue +150 -150
- package/src/components/MentionDropdown.vue +154 -0
- package/src/components/MetricComparison.vue +89 -0
- package/src/components/PercentileChart.vue +67 -0
- package/src/components/PeriodSelector.vue +98 -0
- package/src/components/PermissionMatrix.vue +107 -107
- package/src/components/PinnedNotes.vue +129 -129
- package/src/components/PluginSlot.vue +68 -62
- package/src/components/PresenceIndicator.vue +46 -2
- package/src/components/PriorityBadge.stories.js +33 -33
- package/src/components/PriorityBadge.vue +46 -46
- package/src/components/ReplyComposer.vue +81 -18
- package/src/components/ReplyThread.vue +40 -2
- package/src/components/ReportChart.vue +395 -0
- package/src/components/ReportExportButton.vue +108 -0
- package/src/components/SatisfactionRating.vue +180 -180
- package/src/components/SaveViewDialog.vue +172 -0
- package/src/components/SavedViewSidebar.vue +208 -0
- package/src/components/ScheduleEditor.vue +104 -104
- package/src/components/SideConversation.vue +165 -165
- package/src/components/SideConversationList.vue +147 -147
- package/src/components/SkillTagManager.vue +83 -79
- package/src/components/SlaComplianceChart.vue +46 -53
- package/src/components/SlaTimer.stories.js +35 -35
- package/src/components/SlaTimer.vue +62 -62
- package/src/components/SnoozeButton.vue +247 -0
- package/src/components/StatsCard.stories.js +24 -24
- package/src/components/StatsCard.vue +58 -58
- package/src/components/StatusBadge.stories.js +53 -53
- package/src/components/StatusBadge.vue +78 -78
- package/src/components/TagSelect.vue +84 -84
- package/src/components/TicketFilters.vue +270 -225
- package/src/components/TicketLinkPanel.vue +193 -193
- package/src/components/TicketList.vue +655 -594
- package/src/components/TicketMergeDialog.vue +157 -157
- package/src/components/TicketSplitDialog.vue +98 -0
- package/src/components/TotpInput.stories.js +9 -9
- package/src/components/TotpInput.vue +81 -81
- package/src/components/TwoFactorSetup.vue +113 -113
- package/src/components/VariableTokenInput.vue +111 -0
- package/src/components/WorkflowActionConfig.vue +287 -0
- package/src/components/WorkflowActionList.vue +350 -0
- package/src/components/WorkflowConditionBuilder.vue +265 -0
- package/src/components/WorkflowTriggerSelector.vue +125 -0
- package/src/composables/useChat.js +187 -0
- package/src/composables/useI18n.js +30 -8
- package/src/composables/useKeyboardShortcuts.js +46 -46
- package/src/composables/useMentions.js +134 -0
- package/src/composables/usePluginExtensions.js +159 -159
- package/src/composables/usePluginHooks.js +65 -65
- package/src/composables/useRealtime.js +182 -0
- package/src/defineEscalatedPlugin.js +76 -76
- package/src/index.js +84 -72
- package/src/locales/README.md +13 -0
- package/src/locales/ar.json +727 -0
- package/src/locales/de.json +678 -430
- package/src/locales/en.json +717 -455
- package/src/locales/es.json +679 -430
- package/src/locales/fr.json +680 -431
- package/src/locales/index.js +12 -2
- package/src/locales/it.json +727 -0
- package/src/locales/ja.json +727 -0
- package/src/locales/ko.json +727 -0
- package/src/locales/nl.json +727 -0
- package/src/locales/pl.json +727 -0
- package/src/locales/pt-BR.json +727 -0
- package/src/locales/ru.json +727 -0
- package/src/locales/tr.json +727 -0
- package/src/locales/zh-CN.json +727 -0
- package/src/pages/Admin/ApiTokens/Index.vue +381 -381
- package/src/pages/Admin/AuditLog/Index.vue +154 -154
- package/src/pages/Admin/BusinessHours/Form.vue +172 -172
- package/src/pages/Admin/BusinessHours/Index.vue +113 -113
- package/src/pages/Admin/CannedResponses/Index.vue +127 -127
- package/src/pages/Admin/Capacity/Index.vue +134 -134
- package/src/pages/Admin/CustomFields/Form.vue +195 -195
- package/src/pages/Admin/CustomFields/Index.vue +134 -134
- package/src/pages/Admin/CustomObjects/Form.vue +202 -202
- package/src/pages/Admin/CustomObjects/Index.vue +127 -127
- package/src/pages/Admin/CustomObjects/Records.vue +228 -228
- package/src/pages/Admin/Departments/Form.vue +75 -75
- package/src/pages/Admin/Departments/Index.vue +110 -109
- package/src/pages/Admin/EscalationRules/Form.vue +157 -157
- package/src/pages/Admin/EscalationRules/Index.vue +178 -178
- package/src/pages/Admin/Import/Connect.vue +0 -1
- package/src/pages/Admin/Import/Index.vue +1 -1
- package/src/pages/Admin/Import/Progress.vue +1 -1
- package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -142
- package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -195
- package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -193
- package/src/pages/Admin/Macros/Index.vue +448 -448
- package/src/pages/Admin/Plugins/Index.vue +327 -327
- package/src/pages/Admin/Reports/AgentDetail.vue +132 -0
- package/src/pages/Admin/Reports/AgentMetrics.vue +115 -115
- package/src/pages/Admin/Reports/AgentRanking.vue +246 -0
- package/src/pages/Admin/Reports/Cohorts.vue +180 -0
- package/src/pages/Admin/Reports/Comparison.vue +141 -0
- package/src/pages/Admin/Reports/CsatReport.vue +127 -127
- package/src/pages/Admin/Reports/Dashboard.vue +36 -21
- package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -0
- package/src/pages/Admin/Reports/ResponseTimes.vue +164 -0
- package/src/pages/Admin/Reports/SlaReport.vue +162 -166
- package/src/pages/Admin/Reports/SlaTrends.vue +183 -0
- package/src/pages/Admin/Reports.vue +206 -206
- package/src/pages/Admin/Roles/Form.vue +71 -71
- package/src/pages/Admin/Roles/Index.vue +122 -122
- package/src/pages/Admin/Settings/CsatSettings.vue +165 -165
- package/src/pages/Admin/Settings/DataRetention.vue +182 -182
- package/src/pages/Admin/Settings/EmailSettings.vue +243 -243
- package/src/pages/Admin/Settings/Sandbox.vue +135 -135
- package/src/pages/Admin/Settings/SsoSettings.vue +218 -218
- package/src/pages/Admin/Settings/TwoFactor.vue +110 -110
- package/src/pages/Admin/Settings.vue +1008 -468
- package/src/pages/Admin/Skills/Form.vue +193 -53
- package/src/pages/Admin/Skills/Index.vue +105 -94
- package/src/pages/Admin/SlaPolicies/Form.vue +118 -118
- package/src/pages/Admin/SlaPolicies/Index.vue +121 -120
- package/src/pages/Admin/Statuses/Form.vue +114 -114
- package/src/pages/Admin/Statuses/Index.vue +153 -153
- package/src/pages/Admin/Tags/Index.vue +191 -191
- package/src/pages/Admin/Tickets/Index.vue +126 -91
- package/src/pages/Admin/Tickets/Show.vue +29 -0
- package/src/pages/Admin/Users/Index.vue +145 -0
- package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -120
- package/src/pages/Admin/Webhooks/Form.vue +110 -110
- package/src/pages/Admin/Webhooks/Index.vue +136 -136
- package/src/pages/Admin/Workflows/Builder.vue +207 -0
- package/src/pages/Admin/Workflows/Index.vue +235 -0
- package/src/pages/Admin/Workflows/Logs.vue +286 -0
- package/src/pages/Agent/TicketIndex.vue +112 -88
- package/src/pages/Agent/TicketShow.vue +192 -60
- package/src/pages/Customer/Create.vue +1 -1
- package/src/pages/Customer/Index.vue +26 -1
- package/src/pages/Customer/KnowledgeBase/Article.vue +4 -2
- package/src/pages/Customer/KnowledgeBase/Index.vue +151 -151
- package/src/pages/Customer/Show.vue +69 -63
- package/src/pages/Guest/Create.vue +40 -15
- package/src/pages/Guest/Show.vue +124 -93
- package/src/plugin.js +26 -1
- package/src/utils/mentionHighlight.js +24 -0
- package/src/utils/sanitizeHtml.js +78 -64
- package/src/widget/EscalatedWidget.vue +804 -0
- package/src/widget/index.js +254 -0
- package/src/pages/Admin/Automations/Form.vue +0 -184
- package/src/pages/Admin/Automations/Index.vue +0 -129
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { inject, computed, ref } from 'vue';
|
|
3
|
+
import { router, useForm } from '@inertiajs/vue3';
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
ticket: { type: Object, required: true },
|
|
7
|
+
routePrefix: { type: String, default: 'escalated.admin' },
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const escDark = inject(
|
|
11
|
+
'esc-dark',
|
|
12
|
+
computed(() => false),
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const showMenu = ref(false);
|
|
16
|
+
const showCustom = ref(false);
|
|
17
|
+
const customDatetime = ref('');
|
|
18
|
+
|
|
19
|
+
const snoozeForm = useForm({ snoozed_until: '' });
|
|
20
|
+
|
|
21
|
+
function snoozeUntil(datetime) {
|
|
22
|
+
snoozeForm.snoozed_until = datetime;
|
|
23
|
+
snoozeForm.post(route(`${props.routePrefix}.tickets.snooze`, props.ticket.reference), {
|
|
24
|
+
preserveScroll: true,
|
|
25
|
+
onSuccess: () => {
|
|
26
|
+
showMenu.value = false;
|
|
27
|
+
showCustom.value = false;
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function snoozePreset(hours) {
|
|
33
|
+
const dt = new Date(Date.now() + hours * 3600 * 1000);
|
|
34
|
+
snoozeUntil(dt.toISOString());
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function snoozeTomorrow9am() {
|
|
38
|
+
const dt = new Date();
|
|
39
|
+
dt.setDate(dt.getDate() + 1);
|
|
40
|
+
dt.setHours(9, 0, 0, 0);
|
|
41
|
+
snoozeUntil(dt.toISOString());
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function snoozeNextMonday9am() {
|
|
45
|
+
const dt = new Date();
|
|
46
|
+
const day = dt.getDay();
|
|
47
|
+
const daysUntilMonday = day === 0 ? 1 : 8 - day;
|
|
48
|
+
dt.setDate(dt.getDate() + daysUntilMonday);
|
|
49
|
+
dt.setHours(9, 0, 0, 0);
|
|
50
|
+
snoozeUntil(dt.toISOString());
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function snoozeCustom() {
|
|
54
|
+
if (customDatetime.value) {
|
|
55
|
+
snoozeUntil(new Date(customDatetime.value).toISOString());
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function unsnooze() {
|
|
60
|
+
router.post(route(`${props.routePrefix}.tickets.unsnooze`, props.ticket.reference), {}, { preserveScroll: true });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function formatSnoozedUntil(dateStr) {
|
|
64
|
+
if (!dateStr) return '';
|
|
65
|
+
const dt = new Date(dateStr);
|
|
66
|
+
return dt.toLocaleString(undefined, {
|
|
67
|
+
month: 'short',
|
|
68
|
+
day: 'numeric',
|
|
69
|
+
year: 'numeric',
|
|
70
|
+
hour: 'numeric',
|
|
71
|
+
minute: '2-digit',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Close menu on outside click
|
|
76
|
+
function onClickOutside(e) {
|
|
77
|
+
if (!e.target.closest('[data-snooze-menu]')) {
|
|
78
|
+
showMenu.value = false;
|
|
79
|
+
showCustom.value = false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
import { watch } from 'vue';
|
|
84
|
+
watch(showMenu, (val) => {
|
|
85
|
+
if (val) {
|
|
86
|
+
document.addEventListener('click', onClickOutside, true);
|
|
87
|
+
} else {
|
|
88
|
+
document.removeEventListener('click', onClickOutside, true);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<template>
|
|
94
|
+
<!-- Snoozed banner -->
|
|
95
|
+
<div
|
|
96
|
+
v-if="ticket.is_snoozed || (ticket.snoozed_until && new Date(ticket.snoozed_until) > new Date())"
|
|
97
|
+
:class="[
|
|
98
|
+
'flex items-center gap-3 rounded-lg px-4 py-2.5 text-sm font-medium',
|
|
99
|
+
escDark
|
|
100
|
+
? 'border border-amber-500/20 bg-amber-500/10 text-amber-300'
|
|
101
|
+
: 'border border-amber-200 bg-amber-50 text-amber-800',
|
|
102
|
+
]"
|
|
103
|
+
>
|
|
104
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" viewBox="0 0 20 20" fill="currentColor">
|
|
105
|
+
<path
|
|
106
|
+
fill-rule="evenodd"
|
|
107
|
+
d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.828a1 1 0 101.415-1.414L11 9.586V6z"
|
|
108
|
+
clip-rule="evenodd"
|
|
109
|
+
/>
|
|
110
|
+
</svg>
|
|
111
|
+
<span>Snoozed until {{ formatSnoozedUntil(ticket.snoozed_until) }}</span>
|
|
112
|
+
<button
|
|
113
|
+
:class="[
|
|
114
|
+
'ml-auto rounded-md px-3 py-1 text-xs font-semibold transition-colors',
|
|
115
|
+
escDark
|
|
116
|
+
? 'bg-amber-500/20 text-amber-300 hover:bg-amber-500/30'
|
|
117
|
+
: 'bg-amber-200 text-amber-900 hover:bg-amber-300',
|
|
118
|
+
]"
|
|
119
|
+
@click="unsnooze"
|
|
120
|
+
>
|
|
121
|
+
Unsnooze
|
|
122
|
+
</button>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<!-- Snooze button with dropdown -->
|
|
126
|
+
<div
|
|
127
|
+
v-if="!ticket.is_snoozed && !(ticket.snoozed_until && new Date(ticket.snoozed_until) > new Date())"
|
|
128
|
+
class="relative"
|
|
129
|
+
data-snooze-menu
|
|
130
|
+
>
|
|
131
|
+
<button
|
|
132
|
+
:class="[
|
|
133
|
+
'inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium transition-colors',
|
|
134
|
+
escDark
|
|
135
|
+
? 'border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] text-[var(--esc-panel-text-secondary)] hover:bg-[var(--esc-panel-surface)]'
|
|
136
|
+
: 'border border-gray-300 bg-white text-gray-700 hover:bg-gray-50',
|
|
137
|
+
]"
|
|
138
|
+
@click.stop="showMenu = !showMenu"
|
|
139
|
+
>
|
|
140
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor">
|
|
141
|
+
<path
|
|
142
|
+
fill-rule="evenodd"
|
|
143
|
+
d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.828a1 1 0 101.415-1.414L11 9.586V6z"
|
|
144
|
+
clip-rule="evenodd"
|
|
145
|
+
/>
|
|
146
|
+
</svg>
|
|
147
|
+
Snooze
|
|
148
|
+
</button>
|
|
149
|
+
<div
|
|
150
|
+
v-if="showMenu"
|
|
151
|
+
:class="[
|
|
152
|
+
'absolute right-0 top-full z-50 mt-1 w-56 rounded-lg border py-1 shadow-xl',
|
|
153
|
+
escDark ? 'border-white/[0.08] bg-neutral-800' : 'border-gray-200 bg-white',
|
|
154
|
+
]"
|
|
155
|
+
>
|
|
156
|
+
<button
|
|
157
|
+
v-if="!showCustom"
|
|
158
|
+
:class="[
|
|
159
|
+
'flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors',
|
|
160
|
+
escDark ? 'text-neutral-300 hover:bg-white/[0.06]' : 'text-gray-700 hover:bg-gray-50',
|
|
161
|
+
]"
|
|
162
|
+
@click="snoozePreset(1)"
|
|
163
|
+
>
|
|
164
|
+
1 hour
|
|
165
|
+
</button>
|
|
166
|
+
<button
|
|
167
|
+
v-if="!showCustom"
|
|
168
|
+
:class="[
|
|
169
|
+
'flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors',
|
|
170
|
+
escDark ? 'text-neutral-300 hover:bg-white/[0.06]' : 'text-gray-700 hover:bg-gray-50',
|
|
171
|
+
]"
|
|
172
|
+
@click="snoozePreset(4)"
|
|
173
|
+
>
|
|
174
|
+
4 hours
|
|
175
|
+
</button>
|
|
176
|
+
<button
|
|
177
|
+
v-if="!showCustom"
|
|
178
|
+
:class="[
|
|
179
|
+
'flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors',
|
|
180
|
+
escDark ? 'text-neutral-300 hover:bg-white/[0.06]' : 'text-gray-700 hover:bg-gray-50',
|
|
181
|
+
]"
|
|
182
|
+
@click="snoozeTomorrow9am"
|
|
183
|
+
>
|
|
184
|
+
Tomorrow 9am
|
|
185
|
+
</button>
|
|
186
|
+
<button
|
|
187
|
+
v-if="!showCustom"
|
|
188
|
+
:class="[
|
|
189
|
+
'flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors',
|
|
190
|
+
escDark ? 'text-neutral-300 hover:bg-white/[0.06]' : 'text-gray-700 hover:bg-gray-50',
|
|
191
|
+
]"
|
|
192
|
+
@click="snoozeNextMonday9am"
|
|
193
|
+
>
|
|
194
|
+
Next Monday 9am
|
|
195
|
+
</button>
|
|
196
|
+
<div
|
|
197
|
+
v-if="!showCustom"
|
|
198
|
+
:class="['my-1 border-t', escDark ? 'border-white/[0.06]' : 'border-gray-100']"
|
|
199
|
+
></div>
|
|
200
|
+
<button
|
|
201
|
+
v-if="!showCustom"
|
|
202
|
+
:class="[
|
|
203
|
+
'flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors',
|
|
204
|
+
escDark ? 'text-neutral-300 hover:bg-white/[0.06]' : 'text-gray-700 hover:bg-gray-50',
|
|
205
|
+
]"
|
|
206
|
+
@click.stop="showCustom = true"
|
|
207
|
+
>
|
|
208
|
+
Custom date/time...
|
|
209
|
+
</button>
|
|
210
|
+
<div v-if="showCustom" class="px-3 py-2 space-y-2">
|
|
211
|
+
<input
|
|
212
|
+
v-model="customDatetime"
|
|
213
|
+
type="datetime-local"
|
|
214
|
+
:class="[
|
|
215
|
+
'w-full rounded-md border px-2 py-1.5 text-sm',
|
|
216
|
+
escDark
|
|
217
|
+
? 'border-white/10 bg-neutral-900 text-neutral-200'
|
|
218
|
+
: 'border-gray-300 bg-white text-gray-900',
|
|
219
|
+
]"
|
|
220
|
+
/>
|
|
221
|
+
<div class="flex gap-2">
|
|
222
|
+
<button
|
|
223
|
+
:class="[
|
|
224
|
+
'flex-1 rounded-md px-2 py-1 text-xs font-medium transition-colors',
|
|
225
|
+
escDark
|
|
226
|
+
? 'bg-white/[0.06] text-neutral-300 hover:bg-white/[0.1]'
|
|
227
|
+
: 'bg-gray-100 text-gray-600 hover:bg-gray-200',
|
|
228
|
+
]"
|
|
229
|
+
@click.stop="showCustom = false"
|
|
230
|
+
>
|
|
231
|
+
Back
|
|
232
|
+
</button>
|
|
233
|
+
<button
|
|
234
|
+
:class="[
|
|
235
|
+
'flex-1 rounded-md px-2 py-1 text-xs font-medium text-white transition-colors',
|
|
236
|
+
escDark ? 'bg-cyan-600 hover:bg-cyan-500' : 'bg-indigo-600 hover:bg-indigo-500',
|
|
237
|
+
]"
|
|
238
|
+
:disabled="!customDatetime"
|
|
239
|
+
@click="snoozeCustom"
|
|
240
|
+
>
|
|
241
|
+
Snooze
|
|
242
|
+
</button>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
</template>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import StatsCard from './StatsCard.vue';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/StatsCard',
|
|
5
|
-
component: StatsCard,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const Basic = { args: { label: 'Open Tickets', value: 142 } };
|
|
9
|
-
export const WithTrend = { args: { label: 'Resolved Today', value: 38, trend: '+12% this week' } };
|
|
10
|
-
export const WithColor = { args: { label: 'SLA Breaches', value: 3, trend: '-25% vs last week', color: 'red' } };
|
|
11
|
-
|
|
12
|
-
export const DashboardGrid = {
|
|
13
|
-
render: () => ({
|
|
14
|
-
components: { StatsCard },
|
|
15
|
-
template: `
|
|
16
|
-
<div class="grid grid-cols-2 gap-4" style="max-width: 600px;">
|
|
17
|
-
<StatsCard label="Open Tickets" :value="142" trend="+8% this week" color="blue" />
|
|
18
|
-
<StatsCard label="Resolved Today" :value="38" trend="+12% vs yesterday" color="green" />
|
|
19
|
-
<StatsCard label="Avg Response" value="2h 14m" trend="-18% improvement" color="cyan" />
|
|
20
|
-
<StatsCard label="SLA Breaches" :value="3" trend="-25% vs last week" color="red" />
|
|
21
|
-
</div>
|
|
22
|
-
`,
|
|
23
|
-
}),
|
|
24
|
-
};
|
|
1
|
+
import StatsCard from './StatsCard.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/StatsCard',
|
|
5
|
+
component: StatsCard,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Basic = { args: { label: 'Open Tickets', value: 142 } };
|
|
9
|
+
export const WithTrend = { args: { label: 'Resolved Today', value: 38, trend: '+12% this week' } };
|
|
10
|
+
export const WithColor = { args: { label: 'SLA Breaches', value: 3, trend: '-25% vs last week', color: 'red' } };
|
|
11
|
+
|
|
12
|
+
export const DashboardGrid = {
|
|
13
|
+
render: () => ({
|
|
14
|
+
components: { StatsCard },
|
|
15
|
+
template: `
|
|
16
|
+
<div class="grid grid-cols-2 gap-4" style="max-width: 600px;">
|
|
17
|
+
<StatsCard label="Open Tickets" :value="142" trend="+8% this week" color="blue" />
|
|
18
|
+
<StatsCard label="Resolved Today" :value="38" trend="+12% vs yesterday" color="green" />
|
|
19
|
+
<StatsCard label="Avg Response" value="2h 14m" trend="-18% improvement" color="cyan" />
|
|
20
|
+
<StatsCard label="SLA Breaches" :value="3" trend="-25% vs last week" color="red" />
|
|
21
|
+
</div>
|
|
22
|
+
`,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { inject, computed } from 'vue';
|
|
3
|
-
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
label: { type: String, default: '' },
|
|
6
|
-
title: { type: String, default: '' },
|
|
7
|
-
value: { type: [Number, String], required: true },
|
|
8
|
-
trend: { type: String, default: null },
|
|
9
|
-
color: { type: String, default: 'blue' },
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const escDark = inject(
|
|
13
|
-
'esc-dark',
|
|
14
|
-
computed(() => false),
|
|
15
|
-
);
|
|
16
|
-
const displayLabel = computed(() => props.label || props.title || '');
|
|
17
|
-
|
|
18
|
-
const lightColorMap = {
|
|
19
|
-
blue: 'bg-blue-50 text-blue-700',
|
|
20
|
-
indigo: 'bg-indigo-50 text-indigo-700',
|
|
21
|
-
green: 'bg-green-50 text-green-700',
|
|
22
|
-
red: 'bg-red-50 text-red-700',
|
|
23
|
-
yellow: 'bg-yellow-50 text-yellow-700',
|
|
24
|
-
gray: 'bg-gray-50 text-gray-700',
|
|
25
|
-
cyan: 'bg-cyan-50 text-cyan-700',
|
|
26
|
-
violet: 'bg-violet-50 text-violet-700',
|
|
27
|
-
amber: 'bg-amber-50 text-amber-700',
|
|
28
|
-
};
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<template>
|
|
32
|
-
<!-- Dark mode -->
|
|
33
|
-
<div v-if="escDark" class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-5">
|
|
34
|
-
<div class="text-[13px] font-medium text-[var(--esc-panel-text-muted)]">{{ displayLabel }}</div>
|
|
35
|
-
<div class="mt-2 text-2xl font-bold tracking-tight text-[var(--esc-panel-text)]">{{ value }}</div>
|
|
36
|
-
<div
|
|
37
|
-
v-if="trend"
|
|
38
|
-
class="mt-2 inline-flex items-center rounded-full bg-[var(--esc-panel-hover)] px-2 py-0.5 text-xs font-medium text-[var(--esc-panel-text-tertiary)]"
|
|
39
|
-
>
|
|
40
|
-
{{ trend }}
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<!-- Light mode -->
|
|
45
|
-
<div v-else class="rounded-lg border border-gray-200 bg-white p-4">
|
|
46
|
-
<div class="text-sm text-gray-500">{{ displayLabel }}</div>
|
|
47
|
-
<div class="mt-1 text-2xl font-bold text-gray-900">{{ value }}</div>
|
|
48
|
-
<div
|
|
49
|
-
v-if="trend"
|
|
50
|
-
:class="[
|
|
51
|
-
'mt-1 inline-block rounded-full px-2 py-0.5 text-xs font-medium',
|
|
52
|
-
lightColorMap[color] || lightColorMap.blue,
|
|
53
|
-
]"
|
|
54
|
-
>
|
|
55
|
-
{{ trend }}
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { inject, computed } from 'vue';
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
label: { type: String, default: '' },
|
|
6
|
+
title: { type: String, default: '' },
|
|
7
|
+
value: { type: [Number, String], required: true },
|
|
8
|
+
trend: { type: String, default: null },
|
|
9
|
+
color: { type: String, default: 'blue' },
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const escDark = inject(
|
|
13
|
+
'esc-dark',
|
|
14
|
+
computed(() => false),
|
|
15
|
+
);
|
|
16
|
+
const displayLabel = computed(() => props.label || props.title || '');
|
|
17
|
+
|
|
18
|
+
const lightColorMap = {
|
|
19
|
+
blue: 'bg-blue-50 text-blue-700',
|
|
20
|
+
indigo: 'bg-indigo-50 text-indigo-700',
|
|
21
|
+
green: 'bg-green-50 text-green-700',
|
|
22
|
+
red: 'bg-red-50 text-red-700',
|
|
23
|
+
yellow: 'bg-yellow-50 text-yellow-700',
|
|
24
|
+
gray: 'bg-gray-50 text-gray-700',
|
|
25
|
+
cyan: 'bg-cyan-50 text-cyan-700',
|
|
26
|
+
violet: 'bg-violet-50 text-violet-700',
|
|
27
|
+
amber: 'bg-amber-50 text-amber-700',
|
|
28
|
+
};
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<!-- Dark mode -->
|
|
33
|
+
<div v-if="escDark" class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-5">
|
|
34
|
+
<div class="text-[13px] font-medium text-[var(--esc-panel-text-muted)]">{{ displayLabel }}</div>
|
|
35
|
+
<div class="mt-2 text-2xl font-bold tracking-tight text-[var(--esc-panel-text)]">{{ value }}</div>
|
|
36
|
+
<div
|
|
37
|
+
v-if="trend"
|
|
38
|
+
class="mt-2 inline-flex items-center rounded-full bg-[var(--esc-panel-hover)] px-2 py-0.5 text-xs font-medium text-[var(--esc-panel-text-tertiary)]"
|
|
39
|
+
>
|
|
40
|
+
{{ trend }}
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<!-- Light mode -->
|
|
45
|
+
<div v-else class="rounded-lg border border-gray-200 bg-white p-4">
|
|
46
|
+
<div class="text-sm text-gray-500">{{ displayLabel }}</div>
|
|
47
|
+
<div class="mt-1 text-2xl font-bold text-gray-900">{{ value }}</div>
|
|
48
|
+
<div
|
|
49
|
+
v-if="trend"
|
|
50
|
+
:class="[
|
|
51
|
+
'mt-1 inline-block rounded-full px-2 py-0.5 text-xs font-medium',
|
|
52
|
+
lightColorMap[color] || lightColorMap.blue,
|
|
53
|
+
]"
|
|
54
|
+
>
|
|
55
|
+
{{ trend }}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import StatusBadge from './StatusBadge.vue';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/StatusBadge',
|
|
5
|
-
component: StatusBadge,
|
|
6
|
-
argTypes: {
|
|
7
|
-
status: {
|
|
8
|
-
control: 'select',
|
|
9
|
-
options: [
|
|
10
|
-
'open',
|
|
11
|
-
'in_progress',
|
|
12
|
-
'waiting_on_customer',
|
|
13
|
-
'waiting_on_agent',
|
|
14
|
-
'escalated',
|
|
15
|
-
'resolved',
|
|
16
|
-
'closed',
|
|
17
|
-
'reopened',
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Open = { args: { status: 'open' } };
|
|
24
|
-
export const InProgress = { args: { status: 'in_progress' } };
|
|
25
|
-
export const WaitingOnCustomer = { args: { status: 'waiting_on_customer' } };
|
|
26
|
-
export const Escalated = { args: { status: 'escalated' } };
|
|
27
|
-
export const Resolved = { args: { status: 'resolved' } };
|
|
28
|
-
export const Closed = { args: { status: 'closed' } };
|
|
29
|
-
|
|
30
|
-
export const AllStatuses = {
|
|
31
|
-
render: () => ({
|
|
32
|
-
components: { StatusBadge },
|
|
33
|
-
template: `
|
|
34
|
-
<div class="flex flex-wrap items-center gap-2">
|
|
35
|
-
<StatusBadge status="open" />
|
|
36
|
-
<StatusBadge status="in_progress" />
|
|
37
|
-
<StatusBadge status="waiting_on_customer" />
|
|
38
|
-
<StatusBadge status="waiting_on_agent" />
|
|
39
|
-
<StatusBadge status="escalated" />
|
|
40
|
-
<StatusBadge status="resolved" />
|
|
41
|
-
<StatusBadge status="closed" />
|
|
42
|
-
<StatusBadge status="reopened" />
|
|
43
|
-
</div>
|
|
44
|
-
`,
|
|
45
|
-
}),
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const CustomStatus = {
|
|
49
|
-
args: {
|
|
50
|
-
status: 'custom_pending_review',
|
|
51
|
-
customStatus: { label: 'Pending Review', color: '#8b5cf6' },
|
|
52
|
-
},
|
|
53
|
-
};
|
|
1
|
+
import StatusBadge from './StatusBadge.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/StatusBadge',
|
|
5
|
+
component: StatusBadge,
|
|
6
|
+
argTypes: {
|
|
7
|
+
status: {
|
|
8
|
+
control: 'select',
|
|
9
|
+
options: [
|
|
10
|
+
'open',
|
|
11
|
+
'in_progress',
|
|
12
|
+
'waiting_on_customer',
|
|
13
|
+
'waiting_on_agent',
|
|
14
|
+
'escalated',
|
|
15
|
+
'resolved',
|
|
16
|
+
'closed',
|
|
17
|
+
'reopened',
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Open = { args: { status: 'open' } };
|
|
24
|
+
export const InProgress = { args: { status: 'in_progress' } };
|
|
25
|
+
export const WaitingOnCustomer = { args: { status: 'waiting_on_customer' } };
|
|
26
|
+
export const Escalated = { args: { status: 'escalated' } };
|
|
27
|
+
export const Resolved = { args: { status: 'resolved' } };
|
|
28
|
+
export const Closed = { args: { status: 'closed' } };
|
|
29
|
+
|
|
30
|
+
export const AllStatuses = {
|
|
31
|
+
render: () => ({
|
|
32
|
+
components: { StatusBadge },
|
|
33
|
+
template: `
|
|
34
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
35
|
+
<StatusBadge status="open" />
|
|
36
|
+
<StatusBadge status="in_progress" />
|
|
37
|
+
<StatusBadge status="waiting_on_customer" />
|
|
38
|
+
<StatusBadge status="waiting_on_agent" />
|
|
39
|
+
<StatusBadge status="escalated" />
|
|
40
|
+
<StatusBadge status="resolved" />
|
|
41
|
+
<StatusBadge status="closed" />
|
|
42
|
+
<StatusBadge status="reopened" />
|
|
43
|
+
</div>
|
|
44
|
+
`,
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const CustomStatus = {
|
|
49
|
+
args: {
|
|
50
|
+
status: 'custom_pending_review',
|
|
51
|
+
customStatus: { label: 'Pending Review', color: '#8b5cf6' },
|
|
52
|
+
},
|
|
53
|
+
};
|