@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.
Files changed (181) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +36 -1
  3. package/package.json +16 -7
  4. package/src/components/ActiveChatsPanel.vue +246 -0
  5. package/src/components/ActivityTimeline.stories.js +55 -55
  6. package/src/components/ActivityTimeline.vue +83 -83
  7. package/src/components/AdminDashboard.stories.js +1423 -1095
  8. package/src/components/AgentLoadIndicator.stories.js +37 -37
  9. package/src/components/AgentLoadIndicator.vue +49 -49
  10. package/src/components/AgentPerformanceCard.vue +44 -44
  11. package/src/components/ArticleEditor.vue +82 -82
  12. package/src/components/AssigneeSelect.vue +37 -37
  13. package/src/components/AttachmentList.vue +13 -1
  14. package/src/components/AuditLogEntry.vue +95 -95
  15. package/src/components/BulkActionBar.vue +166 -166
  16. package/src/components/CategoryTree.vue +89 -89
  17. package/src/components/ChartWidget.vue +46 -46
  18. package/src/components/ChatActionBar.vue +226 -0
  19. package/src/components/ChatBubble.vue +162 -0
  20. package/src/components/ChatComposer.vue +308 -0
  21. package/src/components/ChatQueue.vue +222 -0
  22. package/src/components/ChatThread.vue +197 -0
  23. package/src/components/CollisionWarning.stories.js +30 -30
  24. package/src/components/CollisionWarning.vue +68 -68
  25. package/src/components/ConditionalFieldRules.vue +135 -135
  26. package/src/components/ContextPanel.vue +66 -66
  27. package/src/components/ContextPanelSection.vue +65 -65
  28. package/src/components/CustomFieldRenderer.vue +159 -159
  29. package/src/components/EscalatedLayout.vue +35 -6
  30. package/src/components/FileDropzone.vue +57 -57
  31. package/src/components/FollowButton.stories.js +30 -30
  32. package/src/components/FollowButton.vue +88 -88
  33. package/src/components/KeyboardShortcutHelp.vue +213 -213
  34. package/src/components/KnowledgePanel.vue +122 -122
  35. package/src/components/KpiCard.stories.js +32 -32
  36. package/src/components/KpiCard.vue +88 -88
  37. package/src/components/MacroDropdown.vue +150 -150
  38. package/src/components/MentionDropdown.vue +154 -0
  39. package/src/components/MetricComparison.vue +89 -0
  40. package/src/components/PercentileChart.vue +67 -0
  41. package/src/components/PeriodSelector.vue +98 -0
  42. package/src/components/PermissionMatrix.vue +107 -107
  43. package/src/components/PinnedNotes.vue +129 -129
  44. package/src/components/PluginSlot.vue +68 -62
  45. package/src/components/PresenceIndicator.vue +46 -2
  46. package/src/components/PriorityBadge.stories.js +33 -33
  47. package/src/components/PriorityBadge.vue +46 -46
  48. package/src/components/ReplyComposer.vue +81 -18
  49. package/src/components/ReplyThread.vue +40 -2
  50. package/src/components/ReportChart.vue +395 -0
  51. package/src/components/ReportExportButton.vue +108 -0
  52. package/src/components/SatisfactionRating.vue +180 -180
  53. package/src/components/SaveViewDialog.vue +172 -0
  54. package/src/components/SavedViewSidebar.vue +208 -0
  55. package/src/components/ScheduleEditor.vue +104 -104
  56. package/src/components/SideConversation.vue +165 -165
  57. package/src/components/SideConversationList.vue +147 -147
  58. package/src/components/SkillTagManager.vue +83 -79
  59. package/src/components/SlaComplianceChart.vue +46 -53
  60. package/src/components/SlaTimer.stories.js +35 -35
  61. package/src/components/SlaTimer.vue +62 -62
  62. package/src/components/SnoozeButton.vue +247 -0
  63. package/src/components/StatsCard.stories.js +24 -24
  64. package/src/components/StatsCard.vue +58 -58
  65. package/src/components/StatusBadge.stories.js +53 -53
  66. package/src/components/StatusBadge.vue +78 -78
  67. package/src/components/TagSelect.vue +84 -84
  68. package/src/components/TicketFilters.vue +270 -225
  69. package/src/components/TicketLinkPanel.vue +193 -193
  70. package/src/components/TicketList.vue +655 -594
  71. package/src/components/TicketMergeDialog.vue +157 -157
  72. package/src/components/TicketSplitDialog.vue +98 -0
  73. package/src/components/TotpInput.stories.js +9 -9
  74. package/src/components/TotpInput.vue +81 -81
  75. package/src/components/TwoFactorSetup.vue +113 -113
  76. package/src/components/VariableTokenInput.vue +111 -0
  77. package/src/components/WorkflowActionConfig.vue +287 -0
  78. package/src/components/WorkflowActionList.vue +350 -0
  79. package/src/components/WorkflowConditionBuilder.vue +265 -0
  80. package/src/components/WorkflowTriggerSelector.vue +125 -0
  81. package/src/composables/useChat.js +187 -0
  82. package/src/composables/useI18n.js +30 -8
  83. package/src/composables/useKeyboardShortcuts.js +46 -46
  84. package/src/composables/useMentions.js +134 -0
  85. package/src/composables/usePluginExtensions.js +159 -159
  86. package/src/composables/usePluginHooks.js +65 -65
  87. package/src/composables/useRealtime.js +182 -0
  88. package/src/defineEscalatedPlugin.js +76 -76
  89. package/src/index.js +84 -72
  90. package/src/locales/README.md +13 -0
  91. package/src/locales/ar.json +727 -0
  92. package/src/locales/de.json +678 -430
  93. package/src/locales/en.json +717 -455
  94. package/src/locales/es.json +679 -430
  95. package/src/locales/fr.json +680 -431
  96. package/src/locales/index.js +12 -2
  97. package/src/locales/it.json +727 -0
  98. package/src/locales/ja.json +727 -0
  99. package/src/locales/ko.json +727 -0
  100. package/src/locales/nl.json +727 -0
  101. package/src/locales/pl.json +727 -0
  102. package/src/locales/pt-BR.json +727 -0
  103. package/src/locales/ru.json +727 -0
  104. package/src/locales/tr.json +727 -0
  105. package/src/locales/zh-CN.json +727 -0
  106. package/src/pages/Admin/ApiTokens/Index.vue +381 -381
  107. package/src/pages/Admin/AuditLog/Index.vue +154 -154
  108. package/src/pages/Admin/BusinessHours/Form.vue +172 -172
  109. package/src/pages/Admin/BusinessHours/Index.vue +113 -113
  110. package/src/pages/Admin/CannedResponses/Index.vue +127 -127
  111. package/src/pages/Admin/Capacity/Index.vue +134 -134
  112. package/src/pages/Admin/CustomFields/Form.vue +195 -195
  113. package/src/pages/Admin/CustomFields/Index.vue +134 -134
  114. package/src/pages/Admin/CustomObjects/Form.vue +202 -202
  115. package/src/pages/Admin/CustomObjects/Index.vue +127 -127
  116. package/src/pages/Admin/CustomObjects/Records.vue +228 -228
  117. package/src/pages/Admin/Departments/Form.vue +75 -75
  118. package/src/pages/Admin/Departments/Index.vue +110 -109
  119. package/src/pages/Admin/EscalationRules/Form.vue +157 -157
  120. package/src/pages/Admin/EscalationRules/Index.vue +178 -178
  121. package/src/pages/Admin/Import/Connect.vue +0 -1
  122. package/src/pages/Admin/Import/Index.vue +1 -1
  123. package/src/pages/Admin/Import/Progress.vue +1 -1
  124. package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -142
  125. package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -195
  126. package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -193
  127. package/src/pages/Admin/Macros/Index.vue +448 -448
  128. package/src/pages/Admin/Plugins/Index.vue +327 -327
  129. package/src/pages/Admin/Reports/AgentDetail.vue +132 -0
  130. package/src/pages/Admin/Reports/AgentMetrics.vue +115 -115
  131. package/src/pages/Admin/Reports/AgentRanking.vue +246 -0
  132. package/src/pages/Admin/Reports/Cohorts.vue +180 -0
  133. package/src/pages/Admin/Reports/Comparison.vue +141 -0
  134. package/src/pages/Admin/Reports/CsatReport.vue +127 -127
  135. package/src/pages/Admin/Reports/Dashboard.vue +36 -21
  136. package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -0
  137. package/src/pages/Admin/Reports/ResponseTimes.vue +164 -0
  138. package/src/pages/Admin/Reports/SlaReport.vue +162 -166
  139. package/src/pages/Admin/Reports/SlaTrends.vue +183 -0
  140. package/src/pages/Admin/Reports.vue +206 -206
  141. package/src/pages/Admin/Roles/Form.vue +71 -71
  142. package/src/pages/Admin/Roles/Index.vue +122 -122
  143. package/src/pages/Admin/Settings/CsatSettings.vue +165 -165
  144. package/src/pages/Admin/Settings/DataRetention.vue +182 -182
  145. package/src/pages/Admin/Settings/EmailSettings.vue +243 -243
  146. package/src/pages/Admin/Settings/Sandbox.vue +135 -135
  147. package/src/pages/Admin/Settings/SsoSettings.vue +218 -218
  148. package/src/pages/Admin/Settings/TwoFactor.vue +110 -110
  149. package/src/pages/Admin/Settings.vue +1008 -468
  150. package/src/pages/Admin/Skills/Form.vue +193 -53
  151. package/src/pages/Admin/Skills/Index.vue +105 -94
  152. package/src/pages/Admin/SlaPolicies/Form.vue +118 -118
  153. package/src/pages/Admin/SlaPolicies/Index.vue +121 -120
  154. package/src/pages/Admin/Statuses/Form.vue +114 -114
  155. package/src/pages/Admin/Statuses/Index.vue +153 -153
  156. package/src/pages/Admin/Tags/Index.vue +191 -191
  157. package/src/pages/Admin/Tickets/Index.vue +126 -91
  158. package/src/pages/Admin/Tickets/Show.vue +29 -0
  159. package/src/pages/Admin/Users/Index.vue +145 -0
  160. package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -120
  161. package/src/pages/Admin/Webhooks/Form.vue +110 -110
  162. package/src/pages/Admin/Webhooks/Index.vue +136 -136
  163. package/src/pages/Admin/Workflows/Builder.vue +207 -0
  164. package/src/pages/Admin/Workflows/Index.vue +235 -0
  165. package/src/pages/Admin/Workflows/Logs.vue +286 -0
  166. package/src/pages/Agent/TicketIndex.vue +112 -88
  167. package/src/pages/Agent/TicketShow.vue +192 -60
  168. package/src/pages/Customer/Create.vue +1 -1
  169. package/src/pages/Customer/Index.vue +26 -1
  170. package/src/pages/Customer/KnowledgeBase/Article.vue +4 -2
  171. package/src/pages/Customer/KnowledgeBase/Index.vue +151 -151
  172. package/src/pages/Customer/Show.vue +69 -63
  173. package/src/pages/Guest/Create.vue +40 -15
  174. package/src/pages/Guest/Show.vue +124 -93
  175. package/src/plugin.js +26 -1
  176. package/src/utils/mentionHighlight.js +24 -0
  177. package/src/utils/sanitizeHtml.js +78 -64
  178. package/src/widget/EscalatedWidget.vue +804 -0
  179. package/src/widget/index.js +254 -0
  180. package/src/pages/Admin/Automations/Form.vue +0 -184
  181. package/src/pages/Admin/Automations/Index.vue +0 -129
@@ -1,122 +1,122 @@
1
- <script setup>
2
- import { ref } from 'vue';
3
-
4
- defineProps({
5
- ticketReference: { type: String, required: true },
6
- });
7
-
8
- const emit = defineEmits(['insert-link', 'quote']);
9
- const searchTerm = ref('');
10
- const expanded = ref(true);
11
-
12
- // Placeholder results for knowledge base integration
13
- const results = ref([]);
14
- const loading = ref(false);
15
- let debounceTimer = null;
16
-
17
- function onSearch(val) {
18
- window.clearTimeout(debounceTimer);
19
- if (!val || val.length < 2) {
20
- results.value = [];
21
- return;
22
- }
23
- debounceTimer = window.setTimeout(() => search(val), 300);
24
- }
25
-
26
- function search(term) {
27
- loading.value = true;
28
- // Placeholder: in production, this would call a knowledge base API
29
- results.value = [
30
- {
31
- id: 1,
32
- title: `How to resolve "${term}" issues`,
33
- excerpt: `This article explains common solutions for ${term}-related problems that customers frequently encounter.`,
34
- url: '#',
35
- },
36
- {
37
- id: 2,
38
- title: `${term} - FAQ`,
39
- excerpt: `Frequently asked questions about ${term} and related features.`,
40
- url: '#',
41
- },
42
- {
43
- id: 3,
44
- title: `Troubleshooting ${term}`,
45
- excerpt: `Step-by-step troubleshooting guide for ${term} problems.`,
46
- url: '#',
47
- },
48
- ];
49
- loading.value = false;
50
- }
51
-
52
- function insertLink(article) {
53
- emit('insert-link', article);
54
- }
55
-
56
- function quoteArticle(article) {
57
- emit('quote', article);
58
- }
59
- </script>
60
-
61
- <template>
62
- <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-4">
63
- <button
64
- class="flex w-full items-center justify-between text-sm font-semibold text-neutral-200"
65
- @click="expanded = !expanded"
66
- >
67
- <span>Knowledge Base</span>
68
- <svg
69
- :class="['h-4 w-4 text-neutral-500 transition-transform', expanded && 'rotate-180']"
70
- fill="none"
71
- stroke="currentColor"
72
- stroke-width="1.5"
73
- viewBox="0 0 24 24"
74
- >
75
- <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5" />
76
- </svg>
77
- </button>
78
-
79
- <div v-if="expanded" class="mt-3 space-y-3">
80
- <input
81
- v-model="searchTerm"
82
- type="text"
83
- placeholder="Search knowledge base..."
84
- class="w-full rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 placeholder-neutral-500 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10"
85
- @input="onSearch(searchTerm)"
86
- />
87
-
88
- <div v-if="loading" class="text-xs text-neutral-500">Searching...</div>
89
-
90
- <div v-else-if="results.length" class="space-y-2">
91
- <div
92
- v-for="article in results"
93
- :key="article.id"
94
- class="rounded-lg border border-white/[0.04] bg-white/[0.02] p-3"
95
- >
96
- <h4 class="text-sm font-medium text-neutral-200">{{ article.title }}</h4>
97
- <p class="mt-1 text-xs text-neutral-400 line-clamp-2">{{ article.excerpt }}</p>
98
- <div class="mt-2 flex gap-2">
99
- <button
100
- class="rounded px-2 py-0.5 text-[10px] font-medium text-cyan-400 ring-1 ring-cyan-500/20 transition-colors hover:bg-cyan-500/10"
101
- @click="insertLink(article)"
102
- >
103
- Insert Link
104
- </button>
105
- <button
106
- class="rounded px-2 py-0.5 text-[10px] font-medium text-violet-400 ring-1 ring-violet-500/20 transition-colors hover:bg-violet-500/10"
107
- @click="quoteArticle(article)"
108
- >
109
- Quote
110
- </button>
111
- </div>
112
- </div>
113
- </div>
114
-
115
- <div v-else-if="searchTerm.length >= 2 && !loading" class="text-xs text-neutral-500">
116
- No articles found.
117
- </div>
118
-
119
- <div v-else class="text-xs text-neutral-500">Search for articles to help resolve this ticket.</div>
120
- </div>
121
- </div>
122
- </template>
1
+ <script setup>
2
+ import { ref } from 'vue';
3
+
4
+ defineProps({
5
+ ticketReference: { type: String, required: true },
6
+ });
7
+
8
+ const emit = defineEmits(['insert-link', 'quote']);
9
+ const searchTerm = ref('');
10
+ const expanded = ref(true);
11
+
12
+ // Placeholder results for knowledge base integration
13
+ const results = ref([]);
14
+ const loading = ref(false);
15
+ let debounceTimer = null;
16
+
17
+ function onSearch(val) {
18
+ window.clearTimeout(debounceTimer);
19
+ if (!val || val.length < 2) {
20
+ results.value = [];
21
+ return;
22
+ }
23
+ debounceTimer = window.setTimeout(() => search(val), 300);
24
+ }
25
+
26
+ function search(term) {
27
+ loading.value = true;
28
+ // Placeholder: in production, this would call a knowledge base API
29
+ results.value = [
30
+ {
31
+ id: 1,
32
+ title: `How to resolve "${term}" issues`,
33
+ excerpt: `This article explains common solutions for ${term}-related problems that customers frequently encounter.`,
34
+ url: '#',
35
+ },
36
+ {
37
+ id: 2,
38
+ title: `${term} - FAQ`,
39
+ excerpt: `Frequently asked questions about ${term} and related features.`,
40
+ url: '#',
41
+ },
42
+ {
43
+ id: 3,
44
+ title: `Troubleshooting ${term}`,
45
+ excerpt: `Step-by-step troubleshooting guide for ${term} problems.`,
46
+ url: '#',
47
+ },
48
+ ];
49
+ loading.value = false;
50
+ }
51
+
52
+ function insertLink(article) {
53
+ emit('insert-link', article);
54
+ }
55
+
56
+ function quoteArticle(article) {
57
+ emit('quote', article);
58
+ }
59
+ </script>
60
+
61
+ <template>
62
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-4">
63
+ <button
64
+ class="flex w-full items-center justify-between text-sm font-semibold text-neutral-200"
65
+ @click="expanded = !expanded"
66
+ >
67
+ <span>Knowledge Base</span>
68
+ <svg
69
+ :class="['h-4 w-4 text-neutral-500 transition-transform', expanded && 'rotate-180']"
70
+ fill="none"
71
+ stroke="currentColor"
72
+ stroke-width="1.5"
73
+ viewBox="0 0 24 24"
74
+ >
75
+ <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5" />
76
+ </svg>
77
+ </button>
78
+
79
+ <div v-if="expanded" class="mt-3 space-y-3">
80
+ <input
81
+ v-model="searchTerm"
82
+ type="text"
83
+ placeholder="Search knowledge base..."
84
+ class="w-full rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 placeholder-neutral-500 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10"
85
+ @input="onSearch(searchTerm)"
86
+ />
87
+
88
+ <div v-if="loading" class="text-xs text-neutral-500">Searching...</div>
89
+
90
+ <div v-else-if="results.length" class="space-y-2">
91
+ <div
92
+ v-for="article in results"
93
+ :key="article.id"
94
+ class="rounded-lg border border-white/[0.04] bg-white/[0.02] p-3"
95
+ >
96
+ <h4 class="text-sm font-medium text-neutral-200">{{ article.title }}</h4>
97
+ <p class="mt-1 text-xs text-neutral-400 line-clamp-2">{{ article.excerpt }}</p>
98
+ <div class="mt-2 flex gap-2">
99
+ <button
100
+ class="rounded px-2 py-0.5 text-[10px] font-medium text-cyan-400 ring-1 ring-cyan-500/20 transition-colors hover:bg-cyan-500/10"
101
+ @click="insertLink(article)"
102
+ >
103
+ Insert Link
104
+ </button>
105
+ <button
106
+ class="rounded px-2 py-0.5 text-[10px] font-medium text-violet-400 ring-1 ring-violet-500/20 transition-colors hover:bg-violet-500/10"
107
+ @click="quoteArticle(article)"
108
+ >
109
+ Quote
110
+ </button>
111
+ </div>
112
+ </div>
113
+ </div>
114
+
115
+ <div v-else-if="searchTerm.length >= 2 && !loading" class="text-xs text-neutral-500">
116
+ No articles found.
117
+ </div>
118
+
119
+ <div v-else class="text-xs text-neutral-500">Search for articles to help resolve this ticket.</div>
120
+ </div>
121
+ </div>
122
+ </template>
@@ -1,32 +1,32 @@
1
- import KpiCard from './KpiCard.vue';
2
-
3
- export default {
4
- title: 'Components/KpiCard',
5
- component: KpiCard,
6
- };
7
-
8
- export const Basic = { args: { label: 'Total Tickets', value: 1284 } };
9
- export const WithPositiveTrend = { args: { label: 'Resolved', value: 892, trend: 12 } };
10
- export const WithNegativeTrend = { args: { label: 'SLA Breaches', value: 7, trend: -34 } };
11
-
12
- export const WithIcon = {
13
- args: {
14
- label: 'Active Agents',
15
- value: 24,
16
- trend: 8,
17
- icon: 'M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z',
18
- },
19
- };
20
-
21
- export const DashboardRow = {
22
- render: () => ({
23
- components: { KpiCard },
24
- template: `
25
- <div class="grid grid-cols-3 gap-4" style="max-width: 800px;">
26
- <KpiCard label="Total Tickets" :value="1284" :trend="5" icon="M2.25 13.5h3.86a2.25 2.25 0 012.012 1.244l.256.512a2.25 2.25 0 002.013 1.244h3.218a2.25 2.25 0 002.013-1.244l.256-.512a2.25 2.25 0 012.013-1.244h3.859" />
27
- <KpiCard label="Avg Response Time" value="1h 42m" :trend="-18" icon="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" />
28
- <KpiCard label="CSAT Score" value="94%" :trend="3" icon="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" />
29
- </div>
30
- `,
31
- }),
32
- };
1
+ import KpiCard from './KpiCard.vue';
2
+
3
+ export default {
4
+ title: 'Components/KpiCard',
5
+ component: KpiCard,
6
+ };
7
+
8
+ export const Basic = { args: { label: 'Total Tickets', value: 1284 } };
9
+ export const WithPositiveTrend = { args: { label: 'Resolved', value: 892, trend: 12 } };
10
+ export const WithNegativeTrend = { args: { label: 'SLA Breaches', value: 7, trend: -34 } };
11
+
12
+ export const WithIcon = {
13
+ args: {
14
+ label: 'Active Agents',
15
+ value: 24,
16
+ trend: 8,
17
+ icon: 'M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z',
18
+ },
19
+ };
20
+
21
+ export const DashboardRow = {
22
+ render: () => ({
23
+ components: { KpiCard },
24
+ template: `
25
+ <div class="grid grid-cols-3 gap-4" style="max-width: 800px;">
26
+ <KpiCard label="Total Tickets" :value="1284" :trend="5" icon="M2.25 13.5h3.86a2.25 2.25 0 012.012 1.244l.256.512a2.25 2.25 0 002.013 1.244h3.218a2.25 2.25 0 002.013-1.244l.256-.512a2.25 2.25 0 012.013-1.244h3.859" />
27
+ <KpiCard label="Avg Response Time" value="1h 42m" :trend="-18" icon="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" />
28
+ <KpiCard label="CSAT Score" value="94%" :trend="3" icon="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" />
29
+ </div>
30
+ `,
31
+ }),
32
+ };
@@ -1,88 +1,88 @@
1
- <script setup>
2
- import { inject, computed } from 'vue';
3
-
4
- defineProps({
5
- label: { type: String, required: true },
6
- value: { type: [Number, String], required: true },
7
- trend: { type: Number, default: null },
8
- icon: { type: String, default: null },
9
- });
10
-
11
- const escDark = inject(
12
- 'esc-dark',
13
- computed(() => false),
14
- );
15
- </script>
16
-
17
- <template>
18
- <div
19
- :class="[
20
- 'rounded-xl border p-5',
21
- escDark ? 'border-white/[0.06] bg-neutral-900/60' : 'border-gray-200 bg-white',
22
- ]"
23
- >
24
- <div class="flex items-start justify-between">
25
- <div>
26
- <div :class="['text-[13px] font-medium', escDark ? 'text-neutral-500' : 'text-gray-500']">
27
- {{ label }}
28
- </div>
29
- <div :class="['mt-2 text-2xl font-bold tracking-tight', escDark ? 'text-white' : 'text-gray-900']">
30
- {{ value }}
31
- </div>
32
- </div>
33
- <div
34
- v-if="icon"
35
- :class="[
36
- 'flex h-10 w-10 items-center justify-center rounded-lg',
37
- escDark ? 'bg-white/[0.04]' : 'bg-gray-100',
38
- ]"
39
- >
40
- <svg
41
- :class="['h-5 w-5', escDark ? 'text-neutral-500' : 'text-gray-400']"
42
- fill="none"
43
- stroke="currentColor"
44
- stroke-width="1.5"
45
- viewBox="0 0 24 24"
46
- >
47
- <path stroke-linecap="round" stroke-linejoin="round" :d="icon" />
48
- </svg>
49
- </div>
50
- </div>
51
- <div v-if="trend !== null && trend !== 0" class="mt-3 flex items-center gap-1">
52
- <svg
53
- v-if="trend > 0"
54
- :class="['h-4 w-4', escDark ? 'text-emerald-400' : 'text-emerald-500']"
55
- fill="none"
56
- stroke="currentColor"
57
- stroke-width="2"
58
- viewBox="0 0 24 24"
59
- >
60
- <path stroke-linecap="round" stroke-linejoin="round" d="M4.5 19.5l15-15m0 0H8.25m11.25 0v11.25" />
61
- </svg>
62
- <svg
63
- v-else
64
- :class="['h-4 w-4', escDark ? 'text-red-400' : 'text-red-500']"
65
- fill="none"
66
- stroke="currentColor"
67
- stroke-width="2"
68
- viewBox="0 0 24 24"
69
- >
70
- <path stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5l15 15m0 0V8.25m0 11.25H8.25" />
71
- </svg>
72
- <span
73
- :class="[
74
- 'text-xs font-medium',
75
- trend > 0
76
- ? escDark
77
- ? 'text-emerald-400'
78
- : 'text-emerald-600'
79
- : escDark
80
- ? 'text-red-400'
81
- : 'text-red-600',
82
- ]"
83
- >
84
- {{ Math.abs(trend) }}%
85
- </span>
86
- </div>
87
- </div>
88
- </template>
1
+ <script setup>
2
+ import { inject, computed } from 'vue';
3
+
4
+ defineProps({
5
+ label: { type: String, required: true },
6
+ value: { type: [Number, String], required: true },
7
+ trend: { type: Number, default: null },
8
+ icon: { type: String, default: null },
9
+ });
10
+
11
+ const escDark = inject(
12
+ 'esc-dark',
13
+ computed(() => false),
14
+ );
15
+ </script>
16
+
17
+ <template>
18
+ <div
19
+ :class="[
20
+ 'rounded-xl border p-5',
21
+ escDark ? 'border-white/[0.06] bg-neutral-900/60' : 'border-gray-200 bg-white',
22
+ ]"
23
+ >
24
+ <div class="flex items-start justify-between">
25
+ <div>
26
+ <div :class="['text-[13px] font-medium', escDark ? 'text-neutral-500' : 'text-gray-500']">
27
+ {{ label }}
28
+ </div>
29
+ <div :class="['mt-2 text-2xl font-bold tracking-tight', escDark ? 'text-white' : 'text-gray-900']">
30
+ {{ value }}
31
+ </div>
32
+ </div>
33
+ <div
34
+ v-if="icon"
35
+ :class="[
36
+ 'flex h-10 w-10 items-center justify-center rounded-lg',
37
+ escDark ? 'bg-white/[0.04]' : 'bg-gray-100',
38
+ ]"
39
+ >
40
+ <svg
41
+ :class="['h-5 w-5', escDark ? 'text-neutral-500' : 'text-gray-400']"
42
+ fill="none"
43
+ stroke="currentColor"
44
+ stroke-width="1.5"
45
+ viewBox="0 0 24 24"
46
+ >
47
+ <path stroke-linecap="round" stroke-linejoin="round" :d="icon" />
48
+ </svg>
49
+ </div>
50
+ </div>
51
+ <div v-if="trend !== null && trend !== 0" class="mt-3 flex items-center gap-1">
52
+ <svg
53
+ v-if="trend > 0"
54
+ :class="['h-4 w-4', escDark ? 'text-emerald-400' : 'text-emerald-500']"
55
+ fill="none"
56
+ stroke="currentColor"
57
+ stroke-width="2"
58
+ viewBox="0 0 24 24"
59
+ >
60
+ <path stroke-linecap="round" stroke-linejoin="round" d="M4.5 19.5l15-15m0 0H8.25m11.25 0v11.25" />
61
+ </svg>
62
+ <svg
63
+ v-else
64
+ :class="['h-4 w-4', escDark ? 'text-red-400' : 'text-red-500']"
65
+ fill="none"
66
+ stroke="currentColor"
67
+ stroke-width="2"
68
+ viewBox="0 0 24 24"
69
+ >
70
+ <path stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5l15 15m0 0V8.25m0 11.25H8.25" />
71
+ </svg>
72
+ <span
73
+ :class="[
74
+ 'text-xs font-medium',
75
+ trend > 0
76
+ ? escDark
77
+ ? 'text-emerald-400'
78
+ : 'text-emerald-600'
79
+ : escDark
80
+ ? 'text-red-400'
81
+ : 'text-red-600',
82
+ ]"
83
+ >
84
+ {{ Math.abs(trend) }}%
85
+ </span>
86
+ </div>
87
+ </div>
88
+ </template>