@burdenoff/microfe-support 2026.608.1 → 2026.624.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/dist/support/components/NotificationToast.js +1 -1
- package/dist/support/components/NotificationToast.js.map +1 -1
- package/dist/support/components/PageLayout.js +10 -10
- package/dist/support/components/PageLayout.js.map +1 -1
- package/dist/support/components/analytics/CategoryBreakdown.js +3 -3
- package/dist/support/components/analytics/CategoryBreakdown.js.map +1 -1
- package/dist/support/components/analytics/MetricCard.js +1 -1
- package/dist/support/components/analytics/MetricCard.js.map +1 -1
- package/dist/support/components/analytics/PriorityBreakdown.js +3 -3
- package/dist/support/components/analytics/PriorityBreakdown.js.map +1 -1
- package/dist/support/components/analytics/SLAReport.js +7 -7
- package/dist/support/components/analytics/SLAReport.js.map +1 -1
- package/dist/support/components/analytics/SatisfactionDistribution.js +9 -9
- package/dist/support/components/analytics/SatisfactionDistribution.js.map +1 -1
- package/dist/support/components/analytics/TopAgents.js +3 -3
- package/dist/support/components/analytics/TopAgents.js.map +1 -1
- package/dist/support/components/analytics/TrendChart.js +2 -2
- package/dist/support/components/analytics/TrendChart.js.map +1 -1
- package/dist/support/components/kb/ArticleForm.js +23 -23
- package/dist/support/components/kb/ArticleForm.js.map +1 -1
- package/dist/support/components/settings/CannedResponsesSettings.js +12 -12
- package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -1
- package/dist/support/components/settings/SLAPoliciesSettings.js +12 -12
- package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -1
- package/dist/support/components/settings/TicketCategoriesSettings.js +186 -185
- package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
- package/dist/support/components/tickets/AttachmentList.js +4 -4
- package/dist/support/components/tickets/AttachmentList.js.map +1 -1
- package/dist/support/components/tickets/MessageComposer.js +12 -12
- package/dist/support/components/tickets/MessageComposer.js.map +1 -1
- package/dist/support/components/tickets/MessageThread.js +6 -6
- package/dist/support/components/tickets/MessageThread.js.map +1 -1
- package/dist/support/components/tickets/TicketDetailHeader.js +4 -4
- package/dist/support/components/tickets/TicketDetailHeader.js.map +1 -1
- package/dist/support/components/tickets/TicketHeader.js +6 -6
- package/dist/support/components/tickets/TicketHeader.js.map +1 -1
- package/dist/support/components/tickets/TicketSidebar.js +44 -44
- package/dist/support/components/tickets/TicketSidebar.js.map +1 -1
- package/dist/support/pages/AnalyticsPage.js +2 -2
- package/dist/support/pages/AnalyticsPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailAdminPage.js +175 -181
- package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailUserPage.js +7 -7
- package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
- package/dist/support/pages/ContactInquiriesPage.js +5 -5
- package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
- package/dist/support/pages/ContactInquiryDetailPage.js +4 -4
- package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
- package/dist/support/pages/CreateArticlePage.js +5 -5
- package/dist/support/pages/CreateArticlePage.js.map +1 -1
- package/dist/support/pages/CreateTicketPage.js +18 -18
- package/dist/support/pages/CreateTicketPage.js.map +1 -1
- package/dist/support/pages/EditArticlePage.js +6 -6
- package/dist/support/pages/EditArticlePage.js.map +1 -1
- package/dist/support/pages/JobApplicationDetailPage.js +3 -3
- package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +5 -5
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseAdminPage.js +16 -16
- package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseUserPage.js +15 -15
- package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
- package/dist/support/pages/SettingsPage.js +3 -3
- package/dist/support/pages/SettingsPage.js.map +1 -1
- package/dist/support/pages/TicketDetailAdminPage.js +8 -8
- package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
- package/dist/support/pages/TicketDetailUserPage.js +17 -17
- package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
- package/dist/support/pages/TicketListPage.js +18 -18
- package/dist/support/pages/TicketListPage.js.map +1 -1
- package/dist/support/utils/categoryColors.js +1 -1
- package/dist/support/utils/categoryColors.js.map +1 -1
- package/dist/support/utils/uiTokens.js +1 -1
- package/dist/support/utils/uiTokens.js.map +1 -1
- package/package.json +1 -1
|
@@ -52,13 +52,13 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
52
52
|
onSubmit: M,
|
|
53
53
|
className: "space-y-6",
|
|
54
54
|
children: [/* @__PURE__ */ p("div", {
|
|
55
|
-
className: "p-6 rounded-xl border bg-
|
|
55
|
+
className: "p-6 rounded-xl border bg-bg-surface space-y-6",
|
|
56
56
|
children: [
|
|
57
57
|
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
|
|
58
58
|
htmlFor: "support-article-title",
|
|
59
|
-
className: "mb-2 block text-sm font-medium text-
|
|
59
|
+
className: "mb-2 block text-sm font-medium text-text-primary",
|
|
60
60
|
children: ["Title ", /* @__PURE__ */ f("span", {
|
|
61
|
-
className: "text-
|
|
61
|
+
className: "text-status-error-text",
|
|
62
62
|
children: "*"
|
|
63
63
|
})]
|
|
64
64
|
}), /* @__PURE__ */ f(t, {
|
|
@@ -72,16 +72,16 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
72
72
|
/* @__PURE__ */ p("div", { children: [
|
|
73
73
|
/* @__PURE__ */ p("label", {
|
|
74
74
|
htmlFor: "support-article-slug",
|
|
75
|
-
className: "mb-2 block text-sm font-medium text-
|
|
75
|
+
className: "mb-2 block text-sm font-medium text-text-primary",
|
|
76
76
|
children: ["URL Slug ", /* @__PURE__ */ f("span", {
|
|
77
|
-
className: "text-
|
|
77
|
+
className: "text-status-error-text",
|
|
78
78
|
children: "*"
|
|
79
79
|
})]
|
|
80
80
|
}),
|
|
81
81
|
/* @__PURE__ */ p("div", {
|
|
82
82
|
className: "flex flex-col gap-2 sm:flex-row sm:items-center",
|
|
83
83
|
children: [/* @__PURE__ */ f("span", {
|
|
84
|
-
className: "text-sm text-
|
|
84
|
+
className: "text-sm text-text-secondary",
|
|
85
85
|
children: "/kb/articles/"
|
|
86
86
|
}), /* @__PURE__ */ f(t, {
|
|
87
87
|
id: "support-article-slug",
|
|
@@ -94,13 +94,13 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
94
94
|
})]
|
|
95
95
|
}),
|
|
96
96
|
/* @__PURE__ */ f("p", {
|
|
97
|
-
className: "text-xs text-
|
|
97
|
+
className: "text-xs text-text-secondary mt-1",
|
|
98
98
|
children: "Auto-generated from title. Edit to customize."
|
|
99
99
|
})
|
|
100
100
|
] }),
|
|
101
101
|
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
102
102
|
htmlFor: "support-article-excerpt",
|
|
103
|
-
className: "mb-2 block text-sm font-medium text-
|
|
103
|
+
className: "mb-2 block text-sm font-medium text-text-primary",
|
|
104
104
|
children: "Excerpt"
|
|
105
105
|
}), /* @__PURE__ */ f("textarea", {
|
|
106
106
|
id: "support-article-excerpt",
|
|
@@ -111,7 +111,7 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
111
111
|
...x,
|
|
112
112
|
excerpt: e.target.value
|
|
113
113
|
}),
|
|
114
|
-
className: "w-full px-4 py-3 rounded-lg border bg-
|
|
114
|
+
className: "w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors",
|
|
115
115
|
placeholder: "Brief summary of the article (displayed in search results)"
|
|
116
116
|
})] }),
|
|
117
117
|
/* @__PURE__ */ p("div", { children: [
|
|
@@ -119,9 +119,9 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
119
119
|
className: "flex items-center justify-between mb-2",
|
|
120
120
|
children: [/* @__PURE__ */ p("label", {
|
|
121
121
|
htmlFor: "support-article-content",
|
|
122
|
-
className: "text-sm font-medium text-
|
|
122
|
+
className: "text-sm font-medium text-text-primary",
|
|
123
123
|
children: ["Content ", /* @__PURE__ */ f("span", {
|
|
124
|
-
className: "text-
|
|
124
|
+
className: "text-status-error-text",
|
|
125
125
|
children: "*"
|
|
126
126
|
})]
|
|
127
127
|
}), /* @__PURE__ */ f(e, {
|
|
@@ -134,10 +134,10 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
134
134
|
})]
|
|
135
135
|
}),
|
|
136
136
|
E ? /* @__PURE__ */ f("div", {
|
|
137
|
-
className: "w-full min-h-[400px] px-4 py-3 rounded-lg border bg-
|
|
137
|
+
className: "w-full min-h-[400px] px-4 py-3 rounded-lg border bg-bg-surface overflow-auto",
|
|
138
138
|
children: /* @__PURE__ */ f("div", {
|
|
139
139
|
className: "prose prose-sm max-w-none dark:prose-invert",
|
|
140
|
-
dangerouslySetInnerHTML: { __html: O || "<p class=\"text-
|
|
140
|
+
dangerouslySetInnerHTML: { __html: O || "<p class=\"text-text-secondary\">Nothing to preview</p>" }
|
|
141
141
|
})
|
|
142
142
|
}) : /* @__PURE__ */ f("textarea", {
|
|
143
143
|
id: "support-article-content",
|
|
@@ -149,17 +149,17 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
149
149
|
...x,
|
|
150
150
|
content: e.target.value
|
|
151
151
|
}),
|
|
152
|
-
className: "w-full px-4 py-3 rounded-lg border bg-
|
|
152
|
+
className: "w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors font-mono text-sm",
|
|
153
153
|
placeholder: "Article content (supports Markdown)"
|
|
154
154
|
}),
|
|
155
155
|
/* @__PURE__ */ f("p", {
|
|
156
|
-
className: "text-xs text-
|
|
156
|
+
className: "text-xs text-text-secondary mt-1",
|
|
157
157
|
children: "Supports Markdown: **bold**, *italic*, # headings, - lists, [links](url), ```code```"
|
|
158
158
|
})
|
|
159
159
|
] }),
|
|
160
160
|
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
161
161
|
htmlFor: "support-article-category",
|
|
162
|
-
className: "mb-2 block text-sm font-medium text-
|
|
162
|
+
className: "mb-2 block text-sm font-medium text-text-primary",
|
|
163
163
|
children: "Category"
|
|
164
164
|
}), /* @__PURE__ */ p("select", {
|
|
165
165
|
id: "support-article-category",
|
|
@@ -168,7 +168,7 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
168
168
|
...x,
|
|
169
169
|
categoryId: e.target.value
|
|
170
170
|
}),
|
|
171
|
-
className: "w-full px-4 py-3 rounded-lg border bg-
|
|
171
|
+
className: "w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors",
|
|
172
172
|
children: [/* @__PURE__ */ f("option", {
|
|
173
173
|
value: "",
|
|
174
174
|
children: "Select a category"
|
|
@@ -180,7 +180,7 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
180
180
|
/* @__PURE__ */ p("div", { children: [
|
|
181
181
|
/* @__PURE__ */ f("label", {
|
|
182
182
|
htmlFor: "support-article-tags",
|
|
183
|
-
className: "mb-2 block text-sm font-medium text-
|
|
183
|
+
className: "mb-2 block text-sm font-medium text-text-primary",
|
|
184
184
|
children: "Tags"
|
|
185
185
|
}),
|
|
186
186
|
/* @__PURE__ */ f(t, {
|
|
@@ -193,14 +193,14 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
193
193
|
x.tags.length > 0 && /* @__PURE__ */ f("div", {
|
|
194
194
|
className: "flex flex-wrap gap-2 mt-2",
|
|
195
195
|
children: x.tags.map((e) => /* @__PURE__ */ f("span", {
|
|
196
|
-
className: "px-2 py-1 text-xs rounded-full bg-primary/10 text-primary",
|
|
196
|
+
className: "px-2 py-1 text-xs rounded-full bg-action-primary-bg/10 text-primary",
|
|
197
197
|
children: e
|
|
198
198
|
}, e))
|
|
199
199
|
})
|
|
200
200
|
] }),
|
|
201
201
|
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
202
202
|
htmlFor: "support-article-meta-description",
|
|
203
|
-
className: "mb-2 block text-sm font-medium text-
|
|
203
|
+
className: "mb-2 block text-sm font-medium text-text-primary",
|
|
204
204
|
children: "Meta Description"
|
|
205
205
|
}), /* @__PURE__ */ f("textarea", {
|
|
206
206
|
id: "support-article-meta-description",
|
|
@@ -211,12 +211,12 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
211
211
|
...x,
|
|
212
212
|
metaDescription: e.target.value
|
|
213
213
|
}),
|
|
214
|
-
className: "w-full px-4 py-3 rounded-lg border bg-
|
|
214
|
+
className: "w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors",
|
|
215
215
|
placeholder: "SEO meta description (optional)"
|
|
216
216
|
})] }),
|
|
217
217
|
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
218
218
|
htmlFor: "support-article-status",
|
|
219
|
-
className: "mb-2 block text-sm font-medium text-
|
|
219
|
+
className: "mb-2 block text-sm font-medium text-text-primary",
|
|
220
220
|
children: "Status"
|
|
221
221
|
}), /* @__PURE__ */ p("select", {
|
|
222
222
|
id: "support-article-status",
|
|
@@ -225,7 +225,7 @@ function h({ initialData: h, categories: g, onSubmit: _, onCancel: v, isSubmitti
|
|
|
225
225
|
...x,
|
|
226
226
|
status: e.target.value
|
|
227
227
|
}),
|
|
228
|
-
className: "w-full px-4 py-3 rounded-lg border bg-
|
|
228
|
+
className: "w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors",
|
|
229
229
|
children: [/* @__PURE__ */ f("option", {
|
|
230
230
|
value: "DRAFT",
|
|
231
231
|
children: "Draft - Not visible to users"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleForm.js","names":[],"sources":["../../../../src/support/components/kb/ArticleForm.tsx"],"sourcesContent":["import { useState, useMemo, useRef } from 'react';\nimport { Loader2, Save, X, Eye, Edit } from 'lucide-react';\nimport { Button, Input } from '../ui';\nimport { renderSupportMarkdown } from '../../utils/markdown';\n\nexport interface ArticleFormData {\n title: string;\n slug: string;\n content: string;\n excerpt: string;\n categoryId: string;\n tags: string[];\n metaDescription: string;\n status: 'DRAFT' | 'PUBLISHED';\n}\n\ninterface Category {\n id: string;\n name: string;\n color?: string;\n}\n\ninterface ArticleFormProps {\n initialData?: Partial<ArticleFormData>;\n categories: Category[];\n onSubmit: (data: ArticleFormData) => Promise<void>;\n onCancel: () => void;\n isSubmitting: boolean;\n submitLabel?: string;\n}\n\n// Generate URL-friendly slug from title\nfunction generateSlug(title: string): string {\n return title\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .substring(0, 100);\n}\n\nexport function ArticleForm({\n initialData,\n categories,\n onSubmit,\n onCancel,\n isSubmitting,\n submitLabel = 'Save Article',\n}: ArticleFormProps) {\n const [formData, setFormData] = useState<ArticleFormData>({\n title: initialData?.title || '',\n slug: initialData?.slug || '',\n content: initialData?.content || '',\n excerpt: initialData?.excerpt || '',\n categoryId: initialData?.categoryId || '',\n tags: initialData?.tags || [],\n metaDescription: initialData?.metaDescription || '',\n status: initialData?.status || 'DRAFT',\n });\n\n const [tagsInput, setTagsInput] = useState(initialData?.tags?.join(', ') || '');\n const slugManuallyEditedRef = useRef(false);\n const [showPreview, setShowPreview] = useState(false);\n\n // Parse markdown content for preview\n const parsedContent = useMemo(() => {\n if (!formData.content) return '';\n try {\n return renderSupportMarkdown(formData.content);\n } catch {\n return formData.content;\n }\n }, [formData.content]);\n\n // Handle title change with auto-slug generation\n const handleTitleChange = (title: string) => {\n if (!slugManuallyEditedRef.current) {\n setFormData((prev) => ({\n ...prev,\n title,\n slug: generateSlug(title),\n }));\n } else {\n setFormData((prev) => ({ ...prev, title }));\n }\n };\n\n // Parse tags from comma-separated input\n const handleTagsChange = (value: string) => {\n setTagsInput(value);\n const tags = value\n .split(',')\n .map((tag) => tag.trim())\n .filter((tag) => tag.length > 0);\n setFormData((prev) => ({ ...prev, tags }));\n };\n\n const handleSlugChange = (value: string) => {\n slugManuallyEditedRef.current = true;\n setFormData((prev) => ({ ...prev, slug: value }));\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n await onSubmit(formData);\n };\n\n const isValid = formData.title.trim() && formData.slug.trim() && formData.content.trim();\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-6\">\n <div className=\"p-6 rounded-xl border bg-card space-y-6\">\n {/* Title */}\n <div>\n <label\n htmlFor=\"support-article-title\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Title <span className=\"text-destructive\">*</span>\n </label>\n <Input\n id=\"support-article-title\"\n type=\"text\"\n required\n value={formData.title}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleTitleChange(e.target.value)}\n placeholder=\"Article title\"\n />\n </div>\n\n {/* Slug */}\n <div>\n <label\n htmlFor=\"support-article-slug\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n URL Slug <span className=\"text-destructive\">*</span>\n </label>\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center\">\n <span className=\"text-sm text-muted-foreground\">/kb/articles/</span>\n <Input\n id=\"support-article-slug\"\n type=\"text\"\n required\n value={formData.slug}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n handleSlugChange(e.target.value)\n }\n placeholder=\"article-url-slug\"\n className=\"flex-1\"\n />\n </div>\n <p className=\"text-xs text-muted-foreground mt-1\">\n Auto-generated from title. Edit to customize.\n </p>\n </div>\n\n {/* Excerpt */}\n <div>\n <label\n htmlFor=\"support-article-excerpt\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Excerpt\n </label>\n <textarea\n id=\"support-article-excerpt\"\n aria-label=\"Excerpt\"\n rows={3}\n value={formData.excerpt}\n onChange={(e) => setFormData({ ...formData, excerpt: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n placeholder=\"Brief summary of the article (displayed in search results)\"\n />\n </div>\n\n {/* Content */}\n <div>\n <div className=\"flex items-center justify-between mb-2\">\n <label\n htmlFor=\"support-article-content\"\n className=\"text-sm font-medium text-foreground\"\n >\n Content <span className=\"text-destructive\">*</span>\n </label>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => setShowPreview(!showPreview)}\n className=\"text-xs\"\n >\n {showPreview ? (\n <>\n <Edit size={14} />\n Edit\n </>\n ) : (\n <>\n <Eye size={14} />\n Preview\n </>\n )}\n </Button>\n </div>\n\n {showPreview ? (\n <div className=\"w-full min-h-[400px] px-4 py-3 rounded-lg border bg-background overflow-auto\">\n <div\n className=\"prose prose-sm max-w-none dark:prose-invert\"\n dangerouslySetInnerHTML={{\n __html:\n parsedContent || '<p class=\"text-muted-foreground\">Nothing to preview</p>',\n }}\n />\n </div>\n ) : (\n <textarea\n id=\"support-article-content\"\n aria-label=\"Article content\"\n required\n rows={20}\n value={formData.content}\n onChange={(e) => setFormData({ ...formData, content: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors font-mono text-sm\"\n placeholder=\"Article content (supports Markdown)\"\n />\n )}\n <p className=\"text-xs text-muted-foreground mt-1\">\n Supports Markdown: **bold**, *italic*, # headings, - lists, [links](url), ```code```\n </p>\n </div>\n\n {/* Category */}\n <div>\n <label\n htmlFor=\"support-article-category\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Category\n </label>\n <select\n id=\"support-article-category\"\n value={formData.categoryId}\n onChange={(e) => setFormData({ ...formData, categoryId: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"\">Select a category</option>\n {categories.map((cat) => (\n <option key={cat.id} value={cat.id}>\n {cat.name}\n </option>\n ))}\n </select>\n </div>\n\n {/* Tags */}\n <div>\n <label\n htmlFor=\"support-article-tags\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Tags\n </label>\n <Input\n id=\"support-article-tags\"\n type=\"text\"\n value={tagsInput}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleTagsChange(e.target.value)}\n placeholder=\"Enter tags separated by commas (e.g., billing, account, setup)\"\n />\n {formData.tags.length > 0 && (\n <div className=\"flex flex-wrap gap-2 mt-2\">\n {formData.tags.map((tag) => (\n <span\n key={tag}\n className=\"px-2 py-1 text-xs rounded-full bg-primary/10 text-primary\"\n >\n {tag}\n </span>\n ))}\n </div>\n )}\n </div>\n\n {/* Meta Description */}\n <div>\n <label\n htmlFor=\"support-article-meta-description\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Meta Description\n </label>\n <textarea\n id=\"support-article-meta-description\"\n aria-label=\"Meta Description\"\n rows={2}\n value={formData.metaDescription}\n onChange={(e) => setFormData({ ...formData, metaDescription: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n placeholder=\"SEO meta description (optional)\"\n />\n </div>\n\n {/* Status */}\n <div>\n <label\n htmlFor=\"support-article-status\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Status\n </label>\n <select\n id=\"support-article-status\"\n value={formData.status}\n onChange={(e) =>\n setFormData({ ...formData, status: e.target.value as 'DRAFT' | 'PUBLISHED' })\n }\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"DRAFT\">Draft - Not visible to users</option>\n <option value=\"PUBLISHED\">Published - Visible to all users</option>\n </select>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex gap-3\">\n <Button type=\"submit\" disabled={isSubmitting || !isValid} className=\"flex-1\">\n {isSubmitting ? (\n <>\n <Loader2 size={18} className=\"animate-spin\" />\n Saving…\n </>\n ) : (\n <>\n <Save size={18} />\n {submitLabel}\n </>\n )}\n </Button>\n <Button type=\"button\" variant=\"outline\" onClick={onCancel}>\n <X size={18} />\n Cancel\n </Button>\n </div>\n </form>\n );\n}\n"],"mappings":";;;;;;AAgCA,SAAS,EAAa,GAAuB;AAC3C,QAAO,EACJ,aAAa,CACb,QAAQ,eAAe,IAAI,CAC3B,QAAQ,YAAY,GAAG,CACvB,UAAU,GAAG,IAAI;;AAGtB,SAAgB,EAAY,EAC1B,gBACA,eACA,aACA,aACA,iBACA,iBAAc,kBACK;CACnB,IAAM,CAAC,GAAU,KAAe,EAA0B;EACxD,OAAO,GAAa,SAAS;EAC7B,MAAM,GAAa,QAAQ;EAC3B,SAAS,GAAa,WAAW;EACjC,SAAS,GAAa,WAAW;EACjC,YAAY,GAAa,cAAc;EACvC,MAAM,GAAa,QAAQ,EAAE;EAC7B,iBAAiB,GAAa,mBAAmB;EACjD,QAAQ,GAAa,UAAU;EAChC,CAAC,EAEI,CAAC,GAAW,KAAgB,EAAS,GAAa,MAAM,KAAK,KAAK,IAAI,GAAG,EACzE,IAAwB,EAAO,GAAM,EACrC,CAAC,GAAa,KAAkB,EAAS,GAAM,EAG/C,IAAgB,QAAc;AAClC,MAAI,CAAC,EAAS,QAAS,QAAO;AAC9B,MAAI;A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E,OAAO;MAAO,CAAC;KAC9E,WAAU;KACV,aAAY;KACZ,CAAA,CACE,EAAA,CAAA;IAGN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;KACE,SAAQ;KACR,WAAU;eACX;KAEO,CAAA,EACR,kBAAC,UAAD;KACE,IAAG;KACH,OAAO,EAAS;KAChB,WAAW,MACT,EAAY;MAAE,GAAG;MAAU,QAAQ,EAAE,OAAO;MAAgC,CAAC;KAE/E,WAAU;eANZ,CAQE,kBAAC,UAAD;MAAQ,OAAM;gBAAQ;MAAqC,CAAA,EAC3D,kBAAC,UAAD;MAAQ,OAAM;gBAAY;MAAyC,CAAA,CAC5D;OACL,EAAA,CAAA;IACF;MAGN,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,GAAD;IAAQ,MAAK;IAAS,UAAU,KAAgB,CAAC;IAAS,WAAU;cACjE,IACC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;KAAS,MAAM;KAAI,WAAU;KAAiB,CAAA,EAAA,UAE7C,EAAA,CAAA,GAEH,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EACjB,EACA,EAAA,CAAA;IAEE,CAAA,EACT,kBAAC,GAAD;IAAQ,MAAK;IAAS,SAAQ;IAAU,SAAS;cAAjD,CACE,kBAAC,GAAD,EAAG,MAAM,IAAM,CAAA,EAAA,SAER;MACL;KACD"}
|
|
1
|
+
{"version":3,"file":"ArticleForm.js","names":[],"sources":["../../../../src/support/components/kb/ArticleForm.tsx"],"sourcesContent":["import { useState, useMemo, useRef } from 'react';\nimport { Loader2, Save, X, Eye, Edit } from 'lucide-react';\nimport { Button, Input } from '../ui';\nimport { renderSupportMarkdown } from '../../utils/markdown';\n\nexport interface ArticleFormData {\n title: string;\n slug: string;\n content: string;\n excerpt: string;\n categoryId: string;\n tags: string[];\n metaDescription: string;\n status: 'DRAFT' | 'PUBLISHED';\n}\n\ninterface Category {\n id: string;\n name: string;\n color?: string;\n}\n\ninterface ArticleFormProps {\n initialData?: Partial<ArticleFormData>;\n categories: Category[];\n onSubmit: (data: ArticleFormData) => Promise<void>;\n onCancel: () => void;\n isSubmitting: boolean;\n submitLabel?: string;\n}\n\n// Generate URL-friendly slug from title\nfunction generateSlug(title: string): string {\n return title\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .substring(0, 100);\n}\n\nexport function ArticleForm({\n initialData,\n categories,\n onSubmit,\n onCancel,\n isSubmitting,\n submitLabel = 'Save Article',\n}: ArticleFormProps) {\n const [formData, setFormData] = useState<ArticleFormData>({\n title: initialData?.title || '',\n slug: initialData?.slug || '',\n content: initialData?.content || '',\n excerpt: initialData?.excerpt || '',\n categoryId: initialData?.categoryId || '',\n tags: initialData?.tags || [],\n metaDescription: initialData?.metaDescription || '',\n status: initialData?.status || 'DRAFT',\n });\n\n const [tagsInput, setTagsInput] = useState(initialData?.tags?.join(', ') || '');\n const slugManuallyEditedRef = useRef(false);\n const [showPreview, setShowPreview] = useState(false);\n\n // Parse markdown content for preview\n const parsedContent = useMemo(() => {\n if (!formData.content) return '';\n try {\n return renderSupportMarkdown(formData.content);\n } catch {\n return formData.content;\n }\n }, [formData.content]);\n\n // Handle title change with auto-slug generation\n const handleTitleChange = (title: string) => {\n if (!slugManuallyEditedRef.current) {\n setFormData((prev) => ({\n ...prev,\n title,\n slug: generateSlug(title),\n }));\n } else {\n setFormData((prev) => ({ ...prev, title }));\n }\n };\n\n // Parse tags from comma-separated input\n const handleTagsChange = (value: string) => {\n setTagsInput(value);\n const tags = value\n .split(',')\n .map((tag) => tag.trim())\n .filter((tag) => tag.length > 0);\n setFormData((prev) => ({ ...prev, tags }));\n };\n\n const handleSlugChange = (value: string) => {\n slugManuallyEditedRef.current = true;\n setFormData((prev) => ({ ...prev, slug: value }));\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n await onSubmit(formData);\n };\n\n const isValid = formData.title.trim() && formData.slug.trim() && formData.content.trim();\n\n return (\n <form onSubmit={handleSubmit} className=\"space-y-6\">\n <div className=\"p-6 rounded-xl border bg-bg-surface space-y-6\">\n {/* Title */}\n <div>\n <label\n htmlFor=\"support-article-title\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n Title <span className=\"text-status-error-text\">*</span>\n </label>\n <Input\n id=\"support-article-title\"\n type=\"text\"\n required\n value={formData.title}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleTitleChange(e.target.value)}\n placeholder=\"Article title\"\n />\n </div>\n\n {/* Slug */}\n <div>\n <label\n htmlFor=\"support-article-slug\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n URL Slug <span className=\"text-status-error-text\">*</span>\n </label>\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center\">\n <span className=\"text-sm text-text-secondary\">/kb/articles/</span>\n <Input\n id=\"support-article-slug\"\n type=\"text\"\n required\n value={formData.slug}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n handleSlugChange(e.target.value)\n }\n placeholder=\"article-url-slug\"\n className=\"flex-1\"\n />\n </div>\n <p className=\"text-xs text-text-secondary mt-1\">\n Auto-generated from title. Edit to customize.\n </p>\n </div>\n\n {/* Excerpt */}\n <div>\n <label\n htmlFor=\"support-article-excerpt\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n Excerpt\n </label>\n <textarea\n id=\"support-article-excerpt\"\n aria-label=\"Excerpt\"\n rows={3}\n value={formData.excerpt}\n onChange={(e) => setFormData({ ...formData, excerpt: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n placeholder=\"Brief summary of the article (displayed in search results)\"\n />\n </div>\n\n {/* Content */}\n <div>\n <div className=\"flex items-center justify-between mb-2\">\n <label\n htmlFor=\"support-article-content\"\n className=\"text-sm font-medium text-text-primary\"\n >\n Content <span className=\"text-status-error-text\">*</span>\n </label>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => setShowPreview(!showPreview)}\n className=\"text-xs\"\n >\n {showPreview ? (\n <>\n <Edit size={14} />\n Edit\n </>\n ) : (\n <>\n <Eye size={14} />\n Preview\n </>\n )}\n </Button>\n </div>\n\n {showPreview ? (\n <div className=\"w-full min-h-[400px] px-4 py-3 rounded-lg border bg-bg-surface overflow-auto\">\n <div\n className=\"prose prose-sm max-w-none dark:prose-invert\"\n dangerouslySetInnerHTML={{\n __html:\n parsedContent || '<p class=\"text-text-secondary\">Nothing to preview</p>',\n }}\n />\n </div>\n ) : (\n <textarea\n id=\"support-article-content\"\n aria-label=\"Article content\"\n required\n rows={20}\n value={formData.content}\n onChange={(e) => setFormData({ ...formData, content: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors font-mono text-sm\"\n placeholder=\"Article content (supports Markdown)\"\n />\n )}\n <p className=\"text-xs text-text-secondary mt-1\">\n Supports Markdown: **bold**, *italic*, # headings, - lists, [links](url), ```code```\n </p>\n </div>\n\n {/* Category */}\n <div>\n <label\n htmlFor=\"support-article-category\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n Category\n </label>\n <select\n id=\"support-article-category\"\n value={formData.categoryId}\n onChange={(e) => setFormData({ ...formData, categoryId: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"\">Select a category</option>\n {categories.map((cat) => (\n <option key={cat.id} value={cat.id}>\n {cat.name}\n </option>\n ))}\n </select>\n </div>\n\n {/* Tags */}\n <div>\n <label\n htmlFor=\"support-article-tags\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n Tags\n </label>\n <Input\n id=\"support-article-tags\"\n type=\"text\"\n value={tagsInput}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleTagsChange(e.target.value)}\n placeholder=\"Enter tags separated by commas (e.g., billing, account, setup)\"\n />\n {formData.tags.length > 0 && (\n <div className=\"flex flex-wrap gap-2 mt-2\">\n {formData.tags.map((tag) => (\n <span\n key={tag}\n className=\"px-2 py-1 text-xs rounded-full bg-action-primary-bg/10 text-primary\"\n >\n {tag}\n </span>\n ))}\n </div>\n )}\n </div>\n\n {/* Meta Description */}\n <div>\n <label\n htmlFor=\"support-article-meta-description\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n Meta Description\n </label>\n <textarea\n id=\"support-article-meta-description\"\n aria-label=\"Meta Description\"\n rows={2}\n value={formData.metaDescription}\n onChange={(e) => setFormData({ ...formData, metaDescription: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n placeholder=\"SEO meta description (optional)\"\n />\n </div>\n\n {/* Status */}\n <div>\n <label\n htmlFor=\"support-article-status\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n Status\n </label>\n <select\n id=\"support-article-status\"\n value={formData.status}\n onChange={(e) =>\n setFormData({ ...formData, status: e.target.value as 'DRAFT' | 'PUBLISHED' })\n }\n className=\"w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"DRAFT\">Draft - Not visible to users</option>\n <option value=\"PUBLISHED\">Published - Visible to all users</option>\n </select>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"flex gap-3\">\n <Button type=\"submit\" disabled={isSubmitting || !isValid} className=\"flex-1\">\n {isSubmitting ? (\n <>\n <Loader2 size={18} className=\"animate-spin\" />\n Saving…\n </>\n ) : (\n <>\n <Save size={18} />\n {submitLabel}\n </>\n )}\n </Button>\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BAAC,GAAD;IAAQ,MAAK;IAAS,UAAU,KAAgB,CAAC;IAAS,WAAU;cACjE,IACC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;KAAS,MAAM;KAAI,WAAU;KAAiB,CAAA,EAAA,UAE7C,EAAA,CAAA,GAEH,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EACjB,EACA,EAAA,CAAA;IAEE,CAAA,EACT,kBAAC,GAAD;IAAQ,MAAK;IAAS,SAAQ;IAAU,SAAS;cAAjD,CACE,kBAAC,GAAD,EAAG,MAAM,IAAM,CAAA,EAAA,SAER;MACL;KACD"}
|
|
@@ -59,7 +59,7 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
return /* @__PURE__ */ l("div", {
|
|
62
|
-
className: "space-y-6 animate-in fade-in-0 slide-in-from-bottom-2 duration-
|
|
62
|
+
className: "space-y-6 animate-in fade-in-0 slide-in-from-bottom-2 duration-200",
|
|
63
63
|
children: [
|
|
64
64
|
/* @__PURE__ */ l("div", {
|
|
65
65
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
@@ -72,7 +72,7 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
72
72
|
})] }), /* @__PURE__ */ l("button", {
|
|
73
73
|
type: "button",
|
|
74
74
|
onClick: E,
|
|
75
|
-
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all duration-200 bg-primary text-primary-
|
|
75
|
+
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all duration-200 bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90",
|
|
76
76
|
children: [/* @__PURE__ */ c(i, { size: 20 }), "New Response"]
|
|
77
77
|
})]
|
|
78
78
|
}),
|
|
@@ -100,7 +100,7 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
100
100
|
...b,
|
|
101
101
|
title: e.target.value
|
|
102
102
|
}),
|
|
103
|
-
className: "w-full px-3 py-2 rounded-lg border border-border bg-
|
|
103
|
+
className: "w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
104
104
|
placeholder: "e.g., Troubleshooting next steps"
|
|
105
105
|
})] }),
|
|
106
106
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
@@ -116,7 +116,7 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
116
116
|
content: e.target.value
|
|
117
117
|
}),
|
|
118
118
|
rows: 5,
|
|
119
|
-
className: "w-full px-3 py-2 rounded-lg border border-border bg-
|
|
119
|
+
className: "w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
120
120
|
placeholder: "Write the saved reply agents can reuse."
|
|
121
121
|
})] }),
|
|
122
122
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
@@ -132,7 +132,7 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
132
132
|
...b,
|
|
133
133
|
tags: e.target.value
|
|
134
134
|
}),
|
|
135
|
-
className: "w-full px-3 py-2 rounded-lg border border-border bg-
|
|
135
|
+
className: "w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
136
136
|
placeholder: "billing, onboarding, bug"
|
|
137
137
|
})] }),
|
|
138
138
|
w && /* @__PURE__ */ c("p", {
|
|
@@ -142,16 +142,16 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
142
142
|
]
|
|
143
143
|
}),
|
|
144
144
|
/* @__PURE__ */ l("div", {
|
|
145
|
-
className: "flex flex-col gap-2 mt-5 pt-4 border-t border-border sm:flex-row sm:items-center sm:justify-end",
|
|
145
|
+
className: "flex flex-col gap-2 mt-5 pt-4 border-t border-border-subtle sm:flex-row sm:items-center sm:justify-end",
|
|
146
146
|
children: [/* @__PURE__ */ l("button", {
|
|
147
147
|
type: "button",
|
|
148
148
|
onClick: O,
|
|
149
|
-
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-border bg-
|
|
149
|
+
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary transition-colors hover:bg-bg-sunken",
|
|
150
150
|
children: [/* @__PURE__ */ c(s, { size: 16 }), "Cancel"]
|
|
151
151
|
}), /* @__PURE__ */ l("button", {
|
|
152
152
|
type: "submit",
|
|
153
153
|
disabled: S || !b.title.trim() || !b.content.trim(),
|
|
154
|
-
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-
|
|
154
|
+
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
155
155
|
children: [/* @__PURE__ */ c(t, { size: 16 }), S ? "Saving..." : v ? "Update Response" : "Create Response"]
|
|
156
156
|
})]
|
|
157
157
|
})
|
|
@@ -167,7 +167,7 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
167
167
|
children: [/* @__PURE__ */ l("div", {
|
|
168
168
|
className: "flex items-start gap-3",
|
|
169
169
|
children: [/* @__PURE__ */ c("div", {
|
|
170
|
-
className: "size-8 rounded-full flex items-center justify-center flex-shrink-0 bg-primary/10",
|
|
170
|
+
className: "size-8 rounded-full flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10",
|
|
171
171
|
children: /* @__PURE__ */ c(r, {
|
|
172
172
|
size: 16,
|
|
173
173
|
className: "text-primary"
|
|
@@ -184,7 +184,7 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
184
184
|
children: [/* @__PURE__ */ c("button", {
|
|
185
185
|
type: "button",
|
|
186
186
|
onClick: () => D(e),
|
|
187
|
-
className: "min-h-11 min-w-11 p-1.5 rounded transition-colors duration-200 text-secondary hover:bg-
|
|
187
|
+
className: "min-h-11 min-w-11 p-1.5 rounded transition-colors duration-200 text-secondary hover:bg-bg-sunken",
|
|
188
188
|
"aria-label": "Edit canned response",
|
|
189
189
|
children: /* @__PURE__ */ c(n, { size: 16 })
|
|
190
190
|
}), /* @__PURE__ */ c("button", {
|
|
@@ -206,13 +206,13 @@ function f({ responses: f, onCreate: p, onUpdate: m, onDelete: h }) {
|
|
|
206
206
|
size: 12,
|
|
207
207
|
className: "text-tertiary"
|
|
208
208
|
}), e.tags.map((e) => /* @__PURE__ */ c("span", {
|
|
209
|
-
className: "text-xs px-2 py-0.5 rounded bg-
|
|
209
|
+
className: "text-xs px-2 py-0.5 rounded bg-bg-sunken text-secondary",
|
|
210
210
|
children: e
|
|
211
211
|
}, e))]
|
|
212
212
|
})
|
|
213
213
|
]
|
|
214
214
|
}, e.id)), f.length === 0 && !g && /* @__PURE__ */ l("div", {
|
|
215
|
-
className: "col-span-2 text-center py-12 animate-in fade-in-0 duration-
|
|
215
|
+
className: "col-span-2 text-center py-12 animate-in fade-in-0 duration-200",
|
|
216
216
|
children: [/* @__PURE__ */ c(r, {
|
|
217
217
|
size: 48,
|
|
218
218
|
className: "text-tertiary mx-auto"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CannedResponsesSettings.js","names":[],"sources":["../../../../src/support/components/settings/CannedResponsesSettings.tsx"],"sourcesContent":["import { useState, type FormEvent } from 'react';\nimport { MessageCircle, Plus, Edit2, Trash2, Tag, X, Check } from 'lucide-react';\n\ninterface CannedResponse {\n id: string;\n title: string;\n content: string;\n tags?: string[];\n isActive?: boolean;\n}\n\ninterface CannedResponseInput {\n title: string;\n content: string;\n tags?: string[];\n isActive?: boolean;\n}\n\ninterface CannedResponsesSettingsProps {\n responses: CannedResponse[];\n onCreate: (input: CannedResponseInput) => Promise<CannedResponse>;\n onUpdate: (id: string, input: Partial<CannedResponseInput>) => Promise<CannedResponse>;\n onDelete: (id: string) => Promise<void>;\n}\n\nconst emptyForm = {\n title: '',\n content: '',\n tags: '',\n};\n\nfunction parseTags(value: string): string[] {\n return value.split(',').flatMap((tag) => {\n const trimmed = tag.trim();\n return trimmed ? [trimmed] : [];\n });\n}\n\nexport function CannedResponsesSettings({\n responses,\n onCreate,\n onUpdate,\n onDelete,\n}: CannedResponsesSettingsProps) {\n const [showForm, setShowForm] = useState(false);\n const [editingId, setEditingId] = useState<string | null>(null);\n const [form, setForm] = useState(emptyForm);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleNew = () => {\n setEditingId(null);\n setForm(emptyForm);\n setError(null);\n setShowForm(true);\n };\n\n const handleEdit = (response: CannedResponse) => {\n setEditingId(response.id);\n setForm({\n title: response.title,\n content: response.content,\n tags: response.tags?.join(', ') ?? '',\n });\n setError(null);\n setShowForm(true);\n };\n\n const handleCancel = () => {\n setShowForm(false);\n setEditingId(null);\n setForm(emptyForm);\n setError(null);\n };\n\n const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!form.title.trim() || !form.content.trim()) return;\n\n setSaving(true);\n setError(null);\n try {\n const input = {\n title: form.title.trim(),\n content: form.content.trim(),\n tags: parseTags(form.tags),\n };\n\n if (editingId) {\n const existingResponse = responses.find((response) => response.id === editingId);\n await onUpdate(editingId, {\n ...input,\n isActive: existingResponse?.isActive ?? true,\n });\n } else {\n await onCreate({ ...input, isActive: true });\n }\n\n handleCancel();\n } catch (submitError) {\n setError(submitError instanceof Error ? submitError.message : 'Failed to save response.');\n } finally {\n setSaving(false);\n }\n };\n\n const handleDelete = async (id: string) => {\n setError(null);\n try {\n await onDelete(id);\n } catch (deleteError) {\n setError(deleteError instanceof Error ? deleteError.message : 'Failed to delete response.');\n }\n };\n\n return (\n <div className=\"space-y-6 animate-in fade-in-0 slide-in-from-bottom-2 duration-300\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h2 className=\"text-xl font-semibold mb-2 text-primary\">Canned Responses</h2>\n <p className=\"text-sm text-secondary\">\n Pre-written responses for common customer inquiries\n </p>\n </div>\n <button\n type=\"button\"\n onClick={handleNew}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all duration-200 bg-primary text-primary-foreground hover:bg-primary/90\"\n >\n <Plus size={20} />\n New Response\n </button>\n </div>\n\n {showForm && (\n <form\n onSubmit={handleSubmit}\n className=\"p-5 rounded-lg border-2 border-primary/30 bg-surface animate-in fade-in-0 slide-in-from-top-2 duration-200\"\n >\n <h3 className=\"font-semibold mb-4 text-primary\">\n {editingId ? 'Edit Response' : 'Create New Response'}\n </h3>\n\n <div className=\"space-y-4\">\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"cannedresponsessettings-title-0\"\n >\n Title *\n </label>\n <input\n id=\"cannedresponsessettings-title-0\"\n type=\"text\"\n aria-label=\"Title\"\n value={form.title}\n onChange={(event) => setForm({ ...form, title: event.target.value })}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"e.g., Troubleshooting next steps\"\n />\n </div>\n\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"cannedresponsessettings-response-2\"\n >\n Response *\n </label>\n <textarea\n id=\"cannedresponsessettings-response-2\"\n aria-label=\"Response\"\n value={form.content}\n onChange={(event) => setForm({ ...form, content: event.target.value })}\n rows={5}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"Write the saved reply agents can reuse.\"\n />\n </div>\n\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"cannedresponsessettings-tags-4\"\n >\n Tags\n </label>\n <input\n id=\"cannedresponsessettings-tags-4\"\n type=\"text\"\n aria-label=\"Tags\"\n value={form.tags}\n onChange={(event) => setForm({ ...form, tags: event.target.value })}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"billing, onboarding, bug\"\n />\n </div>\n\n {error && <p className=\"text-sm text-error\">{error}</p>}\n </div>\n\n <div className=\"flex flex-col gap-2 mt-5 pt-4 border-t border-border sm:flex-row sm:items-center sm:justify-end\">\n <button\n type=\"button\"\n onClick={handleCancel}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-border bg-background text-foreground transition-colors hover:bg-muted\"\n >\n <X size={16} />\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={saving || !form.title.trim() || !form.content.trim()}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50\"\n >\n <Check size={16} />\n {saving ? 'Saving...' : editingId ? 'Update Response' : 'Create Response'}\n </button>\n </div>\n </form>\n )}\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {responses.map((response) => (\n <div\n key={response.id}\n className=\"p-4 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm hover:border-primary/30\"\n >\n <div className=\"flex items-start justify-between mb-3\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-8 rounded-full flex items-center justify-center flex-shrink-0 bg-primary/10\">\n <MessageCircle size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-semibold truncate text-primary\">{response.title}</h3>\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => handleEdit(response)}\n className=\"min-h-11 min-w-11 p-1.5 rounded transition-colors duration-200 text-secondary hover:bg-muted\"\n aria-label=\"Edit canned response\"\n >\n <Edit2 size={16} />\n </button>\n <button\n type=\"button\"\n className=\"min-h-11 min-w-11 p-1.5 rounded transition-colors duration-200 text-error hover:bg-error/10\"\n onClick={() => void handleDelete(response.id)}\n aria-label=\"Delete canned response\"\n >\n <Trash2 size={16} />\n </button>\n </div>\n </div>\n\n <p className=\"text-sm line-clamp-2 mb-3 text-secondary\">{response.content}</p>\n\n {response.tags && response.tags.length > 0 && (\n <div className=\"flex items-center gap-2 flex-wrap\">\n <Tag size={12} className=\"text-tertiary\" />\n {response.tags.map((tag: string) => (\n <span key={tag} className=\"text-xs px-2 py-0.5 rounded bg-muted text-secondary\">\n {tag}\n </span>\n ))}\n </div>\n )}\n </div>\n ))}\n\n {responses.length === 0 && !showForm && (\n <div className=\"col-span-2 text-center py-12 animate-in fade-in-0 duration-300\">\n <MessageCircle size={48} className=\"text-tertiary mx-auto\" />\n <p className=\"mt-4 text-secondary\">No canned responses configured</p>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;AAyBA,IAAM,IAAY;CAChB,OAAO;CACP,SAAS;CACT,MAAM;CACP;AAED,SAAS,EAAU,GAAyB;AAC1C,QAAO,EAAM,MAAM,IAAI,CAAC,SAAS,MAAQ;EACvC,IAAM,IAAU,EAAI,MAAM;AAC1B,SAAO,IAAU,CAAC,EAAQ,GAAG,EAAE;GAC/B;;AAGJ,SAAgB,EAAwB,EACtC,cACA,aACA,aACA,eAC+B;CAC/B,IAAM,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAW,KAAgB,EAAwB,KAAK,EACzD,CAAC,GAAM,KAAW,EAAS,EAAU,EACrC,CAAC,GAAQ,KAAa,EAAS,GAAM,EACrC,CAAC,GAAO,KAAY,EAAwB,KAAK,EAEjD,UAAkB;AAItB,EAHA,EAAa,KAAK,EAClB,EAAQ,EAAU,EAClB,EAAS,KAAK,EACd,EAAY,GAAK;IAGb,KAAc,MAA6B;AAQ/C,EAP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AFI,EAEJ,CACP,CACE;;MAEJ;OA5CC,EAAS,GA4CV,CACN,EAED,EAAU,WAAW,KAAK,CAAC,KAC1B,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD;MAAe,MAAM;MAAI,WAAU;MAA0B,CAAA,EAC7D,kBAAC,KAAD;MAAG,WAAU;gBAAsB;MAAkC,CAAA,CACjE;OAEJ;;GACF"}
|
|
1
|
+
{"version":3,"file":"CannedResponsesSettings.js","names":[],"sources":["../../../../src/support/components/settings/CannedResponsesSettings.tsx"],"sourcesContent":["import { useState, type FormEvent } from 'react';\nimport { MessageCircle, Plus, Edit2, Trash2, Tag, X, Check } from 'lucide-react';\n\ninterface CannedResponse {\n id: string;\n title: string;\n content: string;\n tags?: string[];\n isActive?: boolean;\n}\n\ninterface CannedResponseInput {\n title: string;\n content: string;\n tags?: string[];\n isActive?: boolean;\n}\n\ninterface CannedResponsesSettingsProps {\n responses: CannedResponse[];\n onCreate: (input: CannedResponseInput) => Promise<CannedResponse>;\n onUpdate: (id: string, input: Partial<CannedResponseInput>) => Promise<CannedResponse>;\n onDelete: (id: string) => Promise<void>;\n}\n\nconst emptyForm = {\n title: '',\n content: '',\n tags: '',\n};\n\nfunction parseTags(value: string): string[] {\n return value.split(',').flatMap((tag) => {\n const trimmed = tag.trim();\n return trimmed ? [trimmed] : [];\n });\n}\n\nexport function CannedResponsesSettings({\n responses,\n onCreate,\n onUpdate,\n onDelete,\n}: CannedResponsesSettingsProps) {\n const [showForm, setShowForm] = useState(false);\n const [editingId, setEditingId] = useState<string | null>(null);\n const [form, setForm] = useState(emptyForm);\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const handleNew = () => {\n setEditingId(null);\n setForm(emptyForm);\n setError(null);\n setShowForm(true);\n };\n\n const handleEdit = (response: CannedResponse) => {\n setEditingId(response.id);\n setForm({\n title: response.title,\n content: response.content,\n tags: response.tags?.join(', ') ?? '',\n });\n setError(null);\n setShowForm(true);\n };\n\n const handleCancel = () => {\n setShowForm(false);\n setEditingId(null);\n setForm(emptyForm);\n setError(null);\n };\n\n const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!form.title.trim() || !form.content.trim()) return;\n\n setSaving(true);\n setError(null);\n try {\n const input = {\n title: form.title.trim(),\n content: form.content.trim(),\n tags: parseTags(form.tags),\n };\n\n if (editingId) {\n const existingResponse = responses.find((response) => response.id === editingId);\n await onUpdate(editingId, {\n ...input,\n isActive: existingResponse?.isActive ?? true,\n });\n } else {\n await onCreate({ ...input, isActive: true });\n }\n\n handleCancel();\n } catch (submitError) {\n setError(submitError instanceof Error ? submitError.message : 'Failed to save response.');\n } finally {\n setSaving(false);\n }\n };\n\n const handleDelete = async (id: string) => {\n setError(null);\n try {\n await onDelete(id);\n } catch (deleteError) {\n setError(deleteError instanceof Error ? deleteError.message : 'Failed to delete response.');\n }\n };\n\n return (\n <div className=\"space-y-6 animate-in fade-in-0 slide-in-from-bottom-2 duration-200\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h2 className=\"text-xl font-semibold mb-2 text-primary\">Canned Responses</h2>\n <p className=\"text-sm text-secondary\">\n Pre-written responses for common customer inquiries\n </p>\n </div>\n <button\n type=\"button\"\n onClick={handleNew}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all duration-200 bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90\"\n >\n <Plus size={20} />\n New Response\n </button>\n </div>\n\n {showForm && (\n <form\n onSubmit={handleSubmit}\n className=\"p-5 rounded-lg border-2 border-primary/30 bg-surface animate-in fade-in-0 slide-in-from-top-2 duration-200\"\n >\n <h3 className=\"font-semibold mb-4 text-primary\">\n {editingId ? 'Edit Response' : 'Create New Response'}\n </h3>\n\n <div className=\"space-y-4\">\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"cannedresponsessettings-title-0\"\n >\n Title *\n </label>\n <input\n id=\"cannedresponsessettings-title-0\"\n type=\"text\"\n aria-label=\"Title\"\n value={form.title}\n onChange={(event) => setForm({ ...form, title: event.target.value })}\n className=\"w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"e.g., Troubleshooting next steps\"\n />\n </div>\n\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"cannedresponsessettings-response-2\"\n >\n Response *\n </label>\n <textarea\n id=\"cannedresponsessettings-response-2\"\n aria-label=\"Response\"\n value={form.content}\n onChange={(event) => setForm({ ...form, content: event.target.value })}\n rows={5}\n className=\"w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"Write the saved reply agents can reuse.\"\n />\n </div>\n\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"cannedresponsessettings-tags-4\"\n >\n Tags\n </label>\n <input\n id=\"cannedresponsessettings-tags-4\"\n type=\"text\"\n aria-label=\"Tags\"\n value={form.tags}\n onChange={(event) => setForm({ ...form, tags: event.target.value })}\n className=\"w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"billing, onboarding, bug\"\n />\n </div>\n\n {error && <p className=\"text-sm text-error\">{error}</p>}\n </div>\n\n <div className=\"flex flex-col gap-2 mt-5 pt-4 border-t border-border-subtle sm:flex-row sm:items-center sm:justify-end\">\n <button\n type=\"button\"\n onClick={handleCancel}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n <X size={16} />\n Cancel\n </button>\n <button\n type=\"submit\"\n disabled={saving || !form.title.trim() || !form.content.trim()}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50\"\n >\n <Check size={16} />\n {saving ? 'Saving...' : editingId ? 'Update Response' : 'Create Response'}\n </button>\n </div>\n </form>\n )}\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {responses.map((response) => (\n <div\n key={response.id}\n className=\"p-4 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm hover:border-primary/30\"\n >\n <div className=\"flex items-start justify-between mb-3\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-8 rounded-full flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10\">\n <MessageCircle size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-semibold truncate text-primary\">{response.title}</h3>\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => handleEdit(response)}\n className=\"min-h-11 min-w-11 p-1.5 rounded transition-colors duration-200 text-secondary hover:bg-bg-sunken\"\n aria-label=\"Edit canned response\"\n >\n <Edit2 size={16} />\n </button>\n <button\n type=\"button\"\n className=\"min-h-11 min-w-11 p-1.5 rounded transition-colors duration-200 text-error hover:bg-error/10\"\n onClick={() => void handleDelete(response.id)}\n aria-label=\"Delete canned response\"\n >\n <Trash2 size={16} />\n </button>\n </div>\n </div>\n\n <p className=\"text-sm line-clamp-2 mb-3 text-secondary\">{response.content}</p>\n\n {response.tags && response.tags.length > 0 && (\n <div className=\"flex items-center gap-2 flex-wrap\">\n <Tag size={12} className=\"text-tertiary\" />\n {response.tags.map((tag: string) => (\n <span key={tag} className=\"text-xs px-2 py-0.5 rounded bg-bg-sunken text-secondary\">\n {tag}\n </span>\n ))}\n </div>\n )}\n </div>\n ))}\n\n {responses.length === 0 && !showForm && (\n <div className=\"col-span-2 text-center py-12 animate-in fade-in-0 duration-200\">\n <MessageCircle size={48} className=\"text-tertiary mx-auto\" />\n <p className=\"mt-4 text-secondary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;UAAI,WAAU;oBAAuC,EAAS;UAAW,CAAA;SACrE,CAAA,CACF;WACN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,EAAW,EAAS;SACnC,WAAU;SACV,cAAW;mBAEX,kBAAC,GAAD,EAAO,MAAM,IAAM,CAAA;SACZ,CAAA,EACT,kBAAC,UAAD;SACE,MAAK;SACL,WAAU;SACV,eAAe,KAAK,EAAa,EAAS,GAAG;SAC7C,cAAW;mBAEX,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;SACb,CAAA,CACL;UACF;;MAEN,kBAAC,KAAD;OAAG,WAAU;iBAA4C,EAAS;OAAY,CAAA;MAE7E,EAAS,QAAQ,EAAS,KAAK,SAAS,KACvC,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,GAAD;QAAK,MAAM;QAAI,WAAU;QAAkB,CAAA,EAC1C,EAAS,KAAK,KAAK,MAClB,kBAAC,QAAD;QAAgB,WAAU;kBACvB;QACI,EAFI,EAEJ,CACP,CACE;;MAEJ;OA5CC,EAAS,GA4CV,CACN,EAED,EAAU,WAAW,KAAK,CAAC,KAC1B,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD;MAAe,MAAM;MAAI,WAAU;MAA0B,CAAA,EAC7D,kBAAC,KAAD;MAAG,WAAU;gBAAsB;MAAkC,CAAA,CACjE;OAEJ;;GACF"}
|
|
@@ -26,7 +26,7 @@ function d({ policies: d, defaultPolicyId: f, onCreate: p, onUpdate: m, onDelete
|
|
|
26
26
|
_(!1), y(null), x(u);
|
|
27
27
|
};
|
|
28
28
|
return /* @__PURE__ */ l("div", {
|
|
29
|
-
className: "space-y-6 animate-in fade-in-0 slide-in-from-bottom-2 duration-
|
|
29
|
+
className: "space-y-6 animate-in fade-in-0 slide-in-from-bottom-2 duration-200",
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ l("div", {
|
|
32
32
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
@@ -39,7 +39,7 @@ function d({ policies: d, defaultPolicyId: f, onCreate: p, onUpdate: m, onDelete
|
|
|
39
39
|
})] }), /* @__PURE__ */ l("button", {
|
|
40
40
|
type: "button",
|
|
41
41
|
onClick: w,
|
|
42
|
-
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all duration-200 bg-primary text-primary-
|
|
42
|
+
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all duration-200 bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90",
|
|
43
43
|
children: [/* @__PURE__ */ c(r, { size: 20 }), "New Policy"]
|
|
44
44
|
})]
|
|
45
45
|
}),
|
|
@@ -67,7 +67,7 @@ function d({ policies: d, defaultPolicyId: f, onCreate: p, onUpdate: m, onDelete
|
|
|
67
67
|
name: e.target.value
|
|
68
68
|
}),
|
|
69
69
|
placeholder: "e.g., Critical Response SLA",
|
|
70
|
-
className: "w-full px-3 py-2 rounded-lg border border-border bg-
|
|
70
|
+
className: "w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
71
71
|
})] }),
|
|
72
72
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
73
73
|
className: "block text-sm font-medium mb-1 text-secondary",
|
|
@@ -81,7 +81,7 @@ function d({ policies: d, defaultPolicyId: f, onCreate: p, onUpdate: m, onDelete
|
|
|
81
81
|
...b,
|
|
82
82
|
priority: e.target.value
|
|
83
83
|
}),
|
|
84
|
-
className: "w-full px-3 py-2 rounded-lg border border-border bg-
|
|
84
|
+
className: "w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary",
|
|
85
85
|
children: [
|
|
86
86
|
/* @__PURE__ */ c("option", {
|
|
87
87
|
value: "LOW",
|
|
@@ -115,7 +115,7 @@ function d({ policies: d, defaultPolicyId: f, onCreate: p, onUpdate: m, onDelete
|
|
|
115
115
|
firstResponseTimeMinutes: parseInt(e.target.value) || 0
|
|
116
116
|
}),
|
|
117
117
|
min: 1,
|
|
118
|
-
className: "w-full px-3 py-2 rounded-lg border border-border bg-
|
|
118
|
+
className: "w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
119
119
|
})] }),
|
|
120
120
|
/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
|
|
121
121
|
className: "block text-sm font-medium mb-1 text-secondary",
|
|
@@ -131,7 +131,7 @@ function d({ policies: d, defaultPolicyId: f, onCreate: p, onUpdate: m, onDelete
|
|
|
131
131
|
resolutionTimeMinutes: parseInt(e.target.value) || 0
|
|
132
132
|
}),
|
|
133
133
|
min: 1,
|
|
134
|
-
className: "w-full px-3 py-2 rounded-lg border border-border bg-
|
|
134
|
+
className: "w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
135
135
|
})] })
|
|
136
136
|
]
|
|
137
137
|
}),
|
|
@@ -152,11 +152,11 @@ function d({ policies: d, defaultPolicyId: f, onCreate: p, onUpdate: m, onDelete
|
|
|
152
152
|
})
|
|
153
153
|
}),
|
|
154
154
|
/* @__PURE__ */ l("div", {
|
|
155
|
-
className: "flex flex-col gap-2 mt-5 pt-4 border-t border-border sm:flex-row sm:items-center sm:justify-end",
|
|
155
|
+
className: "flex flex-col gap-2 mt-5 pt-4 border-t border-border-subtle sm:flex-row sm:items-center sm:justify-end",
|
|
156
156
|
children: [/* @__PURE__ */ l("button", {
|
|
157
157
|
type: "button",
|
|
158
158
|
onClick: E,
|
|
159
|
-
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-border bg-
|
|
159
|
+
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary transition-colors hover:bg-bg-sunken",
|
|
160
160
|
children: [/* @__PURE__ */ c(s, { size: 16 }), "Cancel"]
|
|
161
161
|
}), /* @__PURE__ */ l("button", {
|
|
162
162
|
type: "button",
|
|
@@ -177,7 +177,7 @@ function d({ policies: d, defaultPolicyId: f, onCreate: p, onUpdate: m, onDelete
|
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
179
|
disabled: S || !b.name.trim(),
|
|
180
|
-
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-
|
|
180
|
+
className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
181
181
|
children: [/* @__PURE__ */ c(t, { size: 16 }), S ? "Saving..." : v ? "Update Policy" : "Create Policy"]
|
|
182
182
|
})]
|
|
183
183
|
})
|
|
@@ -192,7 +192,7 @@ function d({ policies: d, defaultPolicyId: f, onCreate: p, onUpdate: m, onDelete
|
|
|
192
192
|
children: [/* @__PURE__ */ l("div", {
|
|
193
193
|
className: "flex items-start gap-3",
|
|
194
194
|
children: [/* @__PURE__ */ c("div", {
|
|
195
|
-
className: "size-10 rounded-full flex items-center justify-center flex-shrink-0 bg-primary/10",
|
|
195
|
+
className: "size-10 rounded-full flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10",
|
|
196
196
|
children: /* @__PURE__ */ c(i, {
|
|
197
197
|
size: 20,
|
|
198
198
|
className: "text-primary"
|
|
@@ -236,7 +236,7 @@ function d({ policies: d, defaultPolicyId: f, onCreate: p, onUpdate: m, onDelete
|
|
|
236
236
|
className: "flex items-center gap-2",
|
|
237
237
|
children: [/* @__PURE__ */ c("button", {
|
|
238
238
|
type: "button",
|
|
239
|
-
className: "min-h-11 min-w-11 p-2 rounded transition-colors duration-200 text-secondary hover:bg-
|
|
239
|
+
className: "min-h-11 min-w-11 p-2 rounded transition-colors duration-200 text-secondary hover:bg-bg-sunken",
|
|
240
240
|
onClick: () => T(e),
|
|
241
241
|
"aria-label": "Edit SLA policy",
|
|
242
242
|
children: /* @__PURE__ */ c(n, { size: 18 })
|
|
@@ -250,7 +250,7 @@ function d({ policies: d, defaultPolicyId: f, onCreate: p, onUpdate: m, onDelete
|
|
|
250
250
|
})]
|
|
251
251
|
})
|
|
252
252
|
}, e.id)), d.length === 0 && !g && /* @__PURE__ */ l("div", {
|
|
253
|
-
className: "text-center py-12 animate-in fade-in-0 duration-
|
|
253
|
+
className: "text-center py-12 animate-in fade-in-0 duration-200",
|
|
254
254
|
children: [/* @__PURE__ */ c(i, {
|
|
255
255
|
size: 48,
|
|
256
256
|
className: "text-tertiary mx-auto"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SLAPoliciesSettings.js","names":[],"sources":["../../../../src/support/components/settings/SLAPoliciesSettings.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Shield, Plus, Edit2, Trash2, Star, X, Check } from 'lucide-react';\n\ninterface SLAPolicy {\n id: string;\n name: string;\n priority: string;\n firstResponseTimeMinutes: number;\n resolutionTimeMinutes: number;\n businessHoursOnly: boolean;\n active: boolean;\n}\n\ninterface SLAPoliciesSettingsProps {\n policies: SLAPolicy[];\n defaultPolicyId?: string;\n onCreate: (input: SLAPolicy) => Promise<SLAPolicy>;\n onUpdate: (id: string, input: SLAPolicy) => Promise<SLAPolicy>;\n onDelete: (id: string) => Promise<void>;\n}\n\nconst emptyPolicy: Omit<SLAPolicy, 'id'> = {\n name: '',\n priority: 'NORMAL',\n firstResponseTimeMinutes: 60,\n resolutionTimeMinutes: 480,\n businessHoursOnly: false,\n active: true,\n};\n\nexport function SLAPoliciesSettings({\n policies,\n defaultPolicyId,\n onCreate,\n onUpdate,\n onDelete,\n}: SLAPoliciesSettingsProps) {\n const [showForm, setShowForm] = useState(false);\n const [editingId, setEditingId] = useState<string | null>(null);\n const [form, setForm] = useState(emptyPolicy);\n const [saving, setSaving] = useState(false);\n\n const handleNew = () => {\n setEditingId(null);\n setForm(emptyPolicy);\n setShowForm(true);\n };\n\n const handleEdit = (policy: SLAPolicy) => {\n setEditingId(policy.id);\n setForm({\n name: policy.name,\n priority: policy.priority,\n firstResponseTimeMinutes: policy.firstResponseTimeMinutes,\n resolutionTimeMinutes: policy.resolutionTimeMinutes,\n businessHoursOnly: policy.businessHoursOnly,\n active: policy.active,\n });\n setShowForm(true);\n };\n\n const handleCancel = () => {\n setShowForm(false);\n setEditingId(null);\n setForm(emptyPolicy);\n };\n\n const handleSave = async () => {\n if (!form.name.trim()) return;\n setSaving(true);\n try {\n if (editingId) {\n await onUpdate(editingId, { ...form, id: editingId } as SLAPolicy);\n } else {\n await onCreate({ ...form, id: '' } as SLAPolicy);\n }\n handleCancel();\n } finally {\n setSaving(false);\n }\n };\n\n return (\n <div className=\"space-y-6 animate-in fade-in-0 slide-in-from-bottom-2 duration-300\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h2 className=\"text-xl font-semibold mb-2 text-primary\">SLA Policies</h2>\n <p className=\"text-sm text-secondary\">\n Manage service level agreement policies for different priority levels\n </p>\n </div>\n <button\n type=\"button\"\n onClick={handleNew}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all duration-200 bg-primary text-primary-foreground hover:bg-primary/90\"\n >\n <Plus size={20} />\n New Policy\n </button>\n </div>\n\n {/* Create/Edit Form */}\n {showForm && (\n <div className=\"p-5 rounded-lg border-2 border-primary/30 bg-surface animate-in fade-in-0 slide-in-from-top-2 duration-200\">\n <h3 className=\"font-semibold mb-4 text-primary\">\n {editingId ? 'Edit Policy' : 'Create New Policy'}\n </h3>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"slapoliciessettings-policy-name-0\"\n >\n Policy Name *\n </label>\n <input\n id=\"slapoliciessettings-policy-name-0\"\n type=\"text\"\n aria-label=\"Policy Name\"\n value={form.name}\n onChange={(e) => setForm({ ...form, name: e.target.value })}\n placeholder=\"e.g., Critical Response SLA\"\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n />\n </div>\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"slapoliciessettings-priority-2\"\n >\n Priority\n </label>\n <select\n id=\"slapoliciessettings-priority-2\"\n aria-label=\"Priority\"\n value={form.priority}\n onChange={(e) => setForm({ ...form, priority: e.target.value })}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground\"\n >\n <option value=\"LOW\">Low</option>\n <option value=\"NORMAL\">Normal</option>\n <option value=\"HIGH\">High</option>\n <option value=\"CRITICAL\">Critical</option>\n </select>\n </div>\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"slapoliciessettings-first-response-minutes-4\"\n >\n First Response (minutes)\n </label>\n <input\n id=\"slapoliciessettings-first-response-minutes-4\"\n type=\"number\"\n aria-label=\"First Response (minutes)\"\n value={form.firstResponseTimeMinutes}\n onChange={(e) =>\n setForm({ ...form, firstResponseTimeMinutes: parseInt(e.target.value) || 0 })\n }\n min={1}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n />\n </div>\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"slapoliciessettings-resolution-time-minutes-6\"\n >\n Resolution Time (minutes)\n </label>\n <input\n id=\"slapoliciessettings-resolution-time-minutes-6\"\n type=\"number\"\n aria-label=\"Resolution Time (minutes)\"\n value={form.resolutionTimeMinutes}\n onChange={(e) =>\n setForm({ ...form, resolutionTimeMinutes: parseInt(e.target.value) || 0 })\n }\n min={1}\n className=\"w-full px-3 py-2 rounded-lg border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20\"\n />\n </div>\n </div>\n <div className=\"flex items-center gap-3 mt-4\">\n <label className=\"flex items-center gap-2 text-sm text-secondary cursor-pointer\">\n <input\n type=\"checkbox\"\n aria-label=\"Business hours only\"\n checked={form.businessHoursOnly}\n onChange={(e) => setForm({ ...form, businessHoursOnly: e.target.checked })}\n className=\"rounded\"\n />\n Business hours only\n </label>\n </div>\n <div className=\"flex flex-col gap-2 mt-5 pt-4 border-t border-border sm:flex-row sm:items-center sm:justify-end\">\n <button\n type=\"button\"\n onClick={handleCancel}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-border bg-background text-foreground transition-colors hover:bg-muted\"\n >\n <X size={16} />\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={saving || !form.name.trim()}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50\"\n >\n <Check size={16} />\n {saving ? 'Saving...' : editingId ? 'Update Policy' : 'Create Policy'}\n </button>\n </div>\n </div>\n )}\n\n <div className=\"space-y-3\">\n {policies.map((policy) => (\n <div\n key={policy.id}\n className=\"p-4 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm hover:border-primary/30\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-10 rounded-full flex items-center justify-center flex-shrink-0 bg-primary/10\">\n <Shield size={20} className=\"text-primary\" />\n </div>\n <div>\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold text-primary\">{policy.name}</h3>\n {policy.id === defaultPolicyId && (\n <Star size={14} className=\"text-warning fill-warning\" />\n )}\n {!policy.active && (\n <span className=\"text-xs px-2 py-0.5 rounded bg-warning/10 text-warning\">\n Inactive\n </span>\n )}\n </div>\n <p className=\"text-sm mt-1 text-secondary\">\n Priority: {policy.priority} • First Response: {policy.firstResponseTimeMinutes}m\n • Resolution: {policy.resolutionTimeMinutes}m\n </p>\n <p className=\"text-xs mt-1 text-tertiary\">\n {policy.businessHoursOnly ? 'Business hours only' : '24/7'}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n className=\"min-h-11 min-w-11 p-2 rounded transition-colors duration-200 text-secondary hover:bg-muted\"\n onClick={() => handleEdit(policy)}\n aria-label=\"Edit SLA policy\"\n >\n <Edit2 size={18} />\n </button>\n <button\n type=\"button\"\n className=\"min-h-11 min-w-11 p-2 rounded transition-colors duration-200 text-error hover:bg-error/10\"\n onClick={() => onDelete(policy.id)}\n aria-label=\"Delete SLA policy\"\n >\n <Trash2 size={18} />\n </button>\n </div>\n </div>\n </div>\n ))}\n\n {policies.length === 0 && !showForm && (\n <div className=\"text-center py-12 animate-in fade-in-0 duration-300\">\n <Shield size={48} className=\"text-tertiary mx-auto\" />\n <p className=\"mt-4 text-secondary\">No SLA policies configured</p>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;AAqBA,IAAM,IAAqC;CACzC,MAAM;CACN,UAAU;CACV,0BAA0B;CAC1B,uBAAuB;CACvB,mBAAmB;CACnB,QAAQ;CACT;AAED,SAAgB,EAAoB,EAClC,aACA,oBACA,aACA,aACA,eAC2B;CAC3B,IAAM,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAW,KAAgB,EAAwB,KAAK,EACzD,CAAC,GAAM,KAAW,EAAS,EAAY,EACvC,CAAC,GAAQ,KAAa,EAAS,GAAM,EAErC,UAAkB;AAGtB,EAFA,EAAa,KAAK,EAClB,EAAQ,EAAY,EACpB,EAAY,GAAK;IAGb,KAAc,MAAsB;AAUxC,EATA,EAAa,EAAO,GAAG,EACvB,EAAQ;GACN,MAAM,EAAO;GACb,UAAU,EAAO;GACjB,0BAA0B,EAAO;GACjC,uBAAuB,EAAO;GAC9B,mBAAmB,EAAO;GAC1B,QAAQ,EAAO;GAChB,CAAC,EACF,EAAY,GAAK;IAGb,UAAqB;AA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EAAS,EAAO,GAAG;QAClC,cAAW;kBAEX,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;QACb,CAAA,CACL;SACF;;KACF,EAhDC,EAAO,GAgDR,CACN,EAED,EAAS,WAAW,KAAK,CAAC,KACzB,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD;MAAQ,MAAM;MAAI,WAAU;MAA0B,CAAA,EACtD,kBAAC,KAAD;MAAG,WAAU;gBAAsB;MAA8B,CAAA,CAC7D;OAEJ;;GACF"}
|
|
1
|
+
{"version":3,"file":"SLAPoliciesSettings.js","names":[],"sources":["../../../../src/support/components/settings/SLAPoliciesSettings.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Shield, Plus, Edit2, Trash2, Star, X, Check } from 'lucide-react';\n\ninterface SLAPolicy {\n id: string;\n name: string;\n priority: string;\n firstResponseTimeMinutes: number;\n resolutionTimeMinutes: number;\n businessHoursOnly: boolean;\n active: boolean;\n}\n\ninterface SLAPoliciesSettingsProps {\n policies: SLAPolicy[];\n defaultPolicyId?: string;\n onCreate: (input: SLAPolicy) => Promise<SLAPolicy>;\n onUpdate: (id: string, input: SLAPolicy) => Promise<SLAPolicy>;\n onDelete: (id: string) => Promise<void>;\n}\n\nconst emptyPolicy: Omit<SLAPolicy, 'id'> = {\n name: '',\n priority: 'NORMAL',\n firstResponseTimeMinutes: 60,\n resolutionTimeMinutes: 480,\n businessHoursOnly: false,\n active: true,\n};\n\nexport function SLAPoliciesSettings({\n policies,\n defaultPolicyId,\n onCreate,\n onUpdate,\n onDelete,\n}: SLAPoliciesSettingsProps) {\n const [showForm, setShowForm] = useState(false);\n const [editingId, setEditingId] = useState<string | null>(null);\n const [form, setForm] = useState(emptyPolicy);\n const [saving, setSaving] = useState(false);\n\n const handleNew = () => {\n setEditingId(null);\n setForm(emptyPolicy);\n setShowForm(true);\n };\n\n const handleEdit = (policy: SLAPolicy) => {\n setEditingId(policy.id);\n setForm({\n name: policy.name,\n priority: policy.priority,\n firstResponseTimeMinutes: policy.firstResponseTimeMinutes,\n resolutionTimeMinutes: policy.resolutionTimeMinutes,\n businessHoursOnly: policy.businessHoursOnly,\n active: policy.active,\n });\n setShowForm(true);\n };\n\n const handleCancel = () => {\n setShowForm(false);\n setEditingId(null);\n setForm(emptyPolicy);\n };\n\n const handleSave = async () => {\n if (!form.name.trim()) return;\n setSaving(true);\n try {\n if (editingId) {\n await onUpdate(editingId, { ...form, id: editingId } as SLAPolicy);\n } else {\n await onCreate({ ...form, id: '' } as SLAPolicy);\n }\n handleCancel();\n } finally {\n setSaving(false);\n }\n };\n\n return (\n <div className=\"space-y-6 animate-in fade-in-0 slide-in-from-bottom-2 duration-200\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h2 className=\"text-xl font-semibold mb-2 text-primary\">SLA Policies</h2>\n <p className=\"text-sm text-secondary\">\n Manage service level agreement policies for different priority levels\n </p>\n </div>\n <button\n type=\"button\"\n onClick={handleNew}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all duration-200 bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90\"\n >\n <Plus size={20} />\n New Policy\n </button>\n </div>\n\n {/* Create/Edit Form */}\n {showForm && (\n <div className=\"p-5 rounded-lg border-2 border-primary/30 bg-surface animate-in fade-in-0 slide-in-from-top-2 duration-200\">\n <h3 className=\"font-semibold mb-4 text-primary\">\n {editingId ? 'Edit Policy' : 'Create New Policy'}\n </h3>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"slapoliciessettings-policy-name-0\"\n >\n Policy Name *\n </label>\n <input\n id=\"slapoliciessettings-policy-name-0\"\n type=\"text\"\n aria-label=\"Policy Name\"\n value={form.name}\n onChange={(e) => setForm({ ...form, name: e.target.value })}\n placeholder=\"e.g., Critical Response SLA\"\n className=\"w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n />\n </div>\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"slapoliciessettings-priority-2\"\n >\n Priority\n </label>\n <select\n id=\"slapoliciessettings-priority-2\"\n aria-label=\"Priority\"\n value={form.priority}\n onChange={(e) => setForm({ ...form, priority: e.target.value })}\n className=\"w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary\"\n >\n <option value=\"LOW\">Low</option>\n <option value=\"NORMAL\">Normal</option>\n <option value=\"HIGH\">High</option>\n <option value=\"CRITICAL\">Critical</option>\n </select>\n </div>\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"slapoliciessettings-first-response-minutes-4\"\n >\n First Response (minutes)\n </label>\n <input\n id=\"slapoliciessettings-first-response-minutes-4\"\n type=\"number\"\n aria-label=\"First Response (minutes)\"\n value={form.firstResponseTimeMinutes}\n onChange={(e) =>\n setForm({ ...form, firstResponseTimeMinutes: parseInt(e.target.value) || 0 })\n }\n min={1}\n className=\"w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n />\n </div>\n <div>\n <label\n className=\"block text-sm font-medium mb-1 text-secondary\"\n htmlFor=\"slapoliciessettings-resolution-time-minutes-6\"\n >\n Resolution Time (minutes)\n </label>\n <input\n id=\"slapoliciessettings-resolution-time-minutes-6\"\n type=\"number\"\n aria-label=\"Resolution Time (minutes)\"\n value={form.resolutionTimeMinutes}\n onChange={(e) =>\n setForm({ ...form, resolutionTimeMinutes: parseInt(e.target.value) || 0 })\n }\n min={1}\n className=\"w-full px-3 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n />\n </div>\n </div>\n <div className=\"flex items-center gap-3 mt-4\">\n <label className=\"flex items-center gap-2 text-sm text-secondary cursor-pointer\">\n <input\n type=\"checkbox\"\n aria-label=\"Business hours only\"\n checked={form.businessHoursOnly}\n onChange={(e) => setForm({ ...form, businessHoursOnly: e.target.checked })}\n className=\"rounded\"\n />\n Business hours only\n </label>\n </div>\n <div className=\"flex flex-col gap-2 mt-5 pt-4 border-t border-border-subtle sm:flex-row sm:items-center sm:justify-end\">\n <button\n type=\"button\"\n onClick={handleCancel}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-border-subtle bg-bg-surface text-text-primary transition-colors hover:bg-bg-sunken\"\n >\n <X size={16} />\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={saving || !form.name.trim()}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50\"\n >\n <Check size={16} />\n {saving ? 'Saving...' : editingId ? 'Update Policy' : 'Create Policy'}\n </button>\n </div>\n </div>\n )}\n\n <div className=\"space-y-3\">\n {policies.map((policy) => (\n <div\n key={policy.id}\n className=\"p-4 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm hover:border-primary/30\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-10 rounded-full flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10\">\n <Shield size={20} className=\"text-primary\" />\n </div>\n <div>\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold text-primary\">{policy.name}</h3>\n {policy.id === defaultPolicyId && (\n <Star size={14} className=\"text-warning fill-warning\" />\n )}\n {!policy.active && (\n <span className=\"text-xs px-2 py-0.5 rounded bg-warning/10 text-warning\">\n Inactive\n </span>\n )}\n </div>\n <p className=\"text-sm mt-1 text-secondary\">\n Priority: {policy.priority} • First Response: {policy.firstResponseTimeMinutes}m\n • Resolution: {policy.resolutionTimeMinutes}m\n </p>\n <p className=\"text-xs mt-1 text-tertiary\">\n {policy.businessHoursOnly ? 'Business hours only' : '24/7'}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n className=\"min-h-11 min-w-11 p-2 rounded transition-colors duration-200 text-secondary hover:bg-bg-sunken\"\n onClick={() => handleEdit(policy)}\n aria-label=\"Edit SLA policy\"\n >\n <Edit2 size={18} />\n </button>\n <button\n type=\"button\"\n className=\"min-h-11 min-w-11 p-2 rounded transition-colors duration-200 text-error hover:bg-error/10\"\n onClick={() => onDelete(policy.id)}\n aria-label=\"Delete SLA policy\"\n >\n <Trash2 size={18} />\n </button>\n </div>\n </div>\n </div>\n ))}\n\n {policies.length === 0 && !showForm && (\n <div className=\"text-center py-12 animate-in fade-in-0 duration-200\">\n <Shield size={48} className=\"text-tertiary mx-auto\" />\n <p className=\"mt-4 text-secondary\">No SLA policies configured</p>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;AAqBA,IAAM,IAAqC;CACzC,MAAM;CACN,UAAU;CACV,0BAA0B;CAC1B,uBAAuB;CACvB,mBAAmB;CACnB,QAAQ;CACT;AAED,SAAgB,EAAoB,EAClC,aACA,oBACA,aACA,aACA,eAC2B;CAC3B,IAAM,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAW,KAAgB,EAAwB,KAAK,EACzD,CAAC,GAAM,KAAW,EAAS,EAAY,EACvC,CAAC,GAAQ,KAAa,EAAS,GAAM,EAErC,UAAkB;AAGtB,EAFA,EAAa,KAAK,EAClB,EAAQ,EAAY,EACpB,EAAY,GAAK;IAGb,KAAc,MAAsB;AAUxC,EATA,EAAa,EAAO,GAAG,EACvB,EAAQ;GACN,MAAM,EAAO;GACb,UAAU,EAAO;GACjB,0BAA0B,EAAO;GACjC,uBAAuB,EAAO;GAC9B,mBAAmB,EAAO;GAC1B,QAAQ,EAAO;GAChB,CAAC,EACF,EAAY,GAAK;IAGb,UAAqB;AAGzB,EAFA,EAAY,GAAM,EAClB,EAA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