@burdenoff/microfe-support 2026.520.1 → 2026.521.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.
Files changed (82) hide show
  1. package/dist/generated/global-operations.js +16 -48
  2. package/dist/generated/global-operations.js.map +1 -1
  3. package/dist/index.js +8 -7
  4. package/dist/node_modules/marked/lib/marked.esm.js +1 -1
  5. package/dist/support/SupportAdminRoot.js +35 -26
  6. package/dist/support/SupportAdminRoot.js.map +1 -1
  7. package/dist/support/SupportUserRoot.js +29 -20
  8. package/dist/support/SupportUserRoot.js.map +1 -1
  9. package/dist/support/components/NotificationToast.js +1 -1
  10. package/dist/support/components/NotificationToast.js.map +1 -1
  11. package/dist/support/components/analytics/CategoryBreakdown.js +22 -37
  12. package/dist/support/components/analytics/CategoryBreakdown.js.map +1 -1
  13. package/dist/support/components/analytics/PriorityBreakdown.js +28 -33
  14. package/dist/support/components/analytics/PriorityBreakdown.js.map +1 -1
  15. package/dist/support/components/analytics/TopAgents.js +35 -42
  16. package/dist/support/components/analytics/TopAgents.js.map +1 -1
  17. package/dist/support/components/kb/ArticleForm.js +26 -13
  18. package/dist/support/components/kb/ArticleForm.js.map +1 -1
  19. package/dist/support/components/settings/CannedResponsesSettings.js +9 -7
  20. package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -1
  21. package/dist/support/components/settings/SLAPoliciesSettings.js +10 -8
  22. package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -1
  23. package/dist/support/components/settings/TicketCategoriesSettings.js +169 -168
  24. package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
  25. package/dist/support/components/tickets/MessageComposer.js +4 -3
  26. package/dist/support/components/tickets/MessageComposer.js.map +1 -1
  27. package/dist/support/components/tickets/MessageThread.js +1 -1
  28. package/dist/support/components/tickets/MessageThread.js.map +1 -1
  29. package/dist/support/components/tickets/TicketDetailHeader.js +41 -52
  30. package/dist/support/components/tickets/TicketDetailHeader.js.map +1 -1
  31. package/dist/support/components/tickets/TicketHeader.js +70 -80
  32. package/dist/support/components/tickets/TicketHeader.js.map +1 -1
  33. package/dist/support/components/tickets/TicketSidebar.js +77 -82
  34. package/dist/support/components/tickets/TicketSidebar.js.map +1 -1
  35. package/dist/support/events/rybbit.js +35 -0
  36. package/dist/support/events/rybbit.js.map +1 -0
  37. package/dist/support/hooks/useAnalyticsOperations.js +41 -41
  38. package/dist/support/hooks/useAnalyticsOperations.js.map +1 -1
  39. package/dist/support/hooks/useKnowledgeBaseOperations.js +50 -52
  40. package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -1
  41. package/dist/support/hooks/useTicketListOperations.js +51 -0
  42. package/dist/support/hooks/useTicketListOperations.js.map +1 -0
  43. package/dist/support/hooks/useTicketOperations.js +74 -109
  44. package/dist/support/hooks/useTicketOperations.js.map +1 -1
  45. package/dist/support/index.js +2 -1
  46. package/dist/support/pages/ArticleDetailAdminPage.js +148 -151
  47. package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
  48. package/dist/support/pages/ArticleDetailUserPage.js +67 -72
  49. package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
  50. package/dist/support/pages/ContactInquiriesPage.js +11 -11
  51. package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
  52. package/dist/support/pages/ContactInquiryDetailPage.js +200 -195
  53. package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
  54. package/dist/support/pages/CreateArticlePage.js +42 -42
  55. package/dist/support/pages/CreateArticlePage.js.map +1 -1
  56. package/dist/support/pages/CreateTicketPage.js +20 -11
  57. package/dist/support/pages/CreateTicketPage.js.map +1 -1
  58. package/dist/support/pages/EditArticlePage.js +66 -64
  59. package/dist/support/pages/EditArticlePage.js.map +1 -1
  60. package/dist/support/pages/KnowledgeBaseAdminPage.js +80 -85
  61. package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
  62. package/dist/support/pages/KnowledgeBaseUserPage.js +73 -78
  63. package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
  64. package/dist/support/pages/SettingsPage.js +3 -3
  65. package/dist/support/pages/SettingsPage.js.map +1 -1
  66. package/dist/support/pages/TicketDetailAdminPage.js +28 -21
  67. package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
  68. package/dist/support/pages/TicketDetailUserPage.js +121 -111
  69. package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
  70. package/dist/support/pages/TicketListPage.js +170 -196
  71. package/dist/support/pages/TicketListPage.js.map +1 -1
  72. package/dist/support/store/supportStore.js +43 -34
  73. package/dist/support/store/supportStore.js.map +1 -1
  74. package/dist/support/utils/categoryColors.js +64 -0
  75. package/dist/support/utils/categoryColors.js.map +1 -0
  76. package/dist/support/utils/index.js +21 -12
  77. package/dist/support/utils/index.js.map +1 -1
  78. package/dist/support/utils/ticketFilters.js +43 -0
  79. package/dist/support/utils/ticketFilters.js.map +1 -0
  80. package/dist/support/utils/uiTokens.js +44 -0
  81. package/dist/support/utils/uiTokens.js.map +1 -0
  82. package/package.json +1 -1
@@ -1,242 +1,241 @@
1
- import { useState as e } from "react";
2
- import { AlertCircle as t, CheckCircle as n, Edit2 as r, FolderOpen as i, GripVertical as a, Loader2 as o, Plus as s, ToggleLeft as c, ToggleRight as l, Trash2 as u, X as d } from "lucide-react";
3
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
1
+ import { CATEGORY_COLOR_OPTIONS as e, getCategoryColorOption as t, getCategorySwatchClass as n } from "../../utils/categoryColors.js";
2
+ import { useEffect as r, useRef as i, useState as a } from "react";
3
+ import { AlertCircle as o, CheckCircle as s, Edit2 as c, FolderOpen as l, GripVertical as u, Loader2 as d, Plus as f, ToggleLeft as p, ToggleRight as m, Trash2 as h, X as g } from "lucide-react";
4
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
4
5
  //#region src/support/components/settings/TicketCategoriesSettings.tsx
5
- var h = [
6
- "#ef4444",
7
- "#f97316",
8
- "#eab308",
9
- "#22c55e",
10
- "#14b8a6",
11
- "#3b82f6",
12
- "#8b5cf6",
13
- "#ec4899",
14
- "#6b7280"
15
- ], g = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, ""), _ = {
6
+ var b = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, ""), x = {
16
7
  name: "",
17
8
  slug: "",
18
9
  description: "",
19
- color: "#3b82f6",
10
+ color: e[0].value,
20
11
  icon: "",
21
12
  isActive: !0
22
13
  };
23
- function v({ categories: v, onCreate: y, onUpdate: b, onDelete: x }) {
24
- let [S, C] = e(!1), [w, T] = e(null), [E, D] = e(_), [O, k] = e(!1), [A, j] = e(null), [M, N] = e(null), P = (e, t) => {
25
- N({
14
+ function S({ categories: S, onCreate: C, onUpdate: w, onDelete: T }) {
15
+ let [E, D] = a(!1), [O, k] = a(null), [A, j] = a(x), [M, N] = a(!1), [P, F] = a(null), [I, L] = a(null), R = i(null);
16
+ r(() => () => {
17
+ R.current && clearTimeout(R.current);
18
+ }, []);
19
+ let z = (e, t) => {
20
+ L({
26
21
  type: e,
27
22
  message: t
28
- }), setTimeout(() => N(null), 3e3);
29
- }, F = () => {
30
- T(null), D(_), C(!0);
31
- }, I = (e) => {
32
- T(e), D({
23
+ }), R.current && clearTimeout(R.current), R.current = setTimeout(() => L(null), 3e3);
24
+ }, B = () => {
25
+ k(null), j(x), D(!0);
26
+ }, V = (e) => {
27
+ k(e), j({
33
28
  name: e.name,
34
29
  slug: e.slug,
35
30
  description: e.description || "",
36
- color: e.color || "#3b82f6",
31
+ color: t(e.color).value,
37
32
  icon: e.icon || "",
38
33
  isActive: e.isActive ?? !0,
39
34
  parentId: e.parentId
40
- }), C(!0);
41
- }, L = () => {
42
- C(!1), T(null), D(_);
43
- }, R = (e) => {
44
- D({
45
- ...E,
35
+ }), D(!0);
36
+ }, H = () => {
37
+ D(!1), k(null), j(x);
38
+ }, U = (e) => {
39
+ j({
40
+ ...A,
46
41
  name: e,
47
- slug: w ? E.slug : g(e)
42
+ slug: O ? A.slug : b(e)
48
43
  });
49
- }, z = async (e) => {
50
- if (e.preventDefault(), !(!E.name.trim() || !E.slug.trim())) {
51
- k(!0);
44
+ }, W = async (e) => {
45
+ if (e.preventDefault(), !(!A.name.trim() || !A.slug.trim())) {
46
+ N(!0);
52
47
  try {
53
- w?.id ? (await b(w.id, E), P("success", "Category updated successfully!")) : (await y(E), P("success", "Category created successfully!")), L();
48
+ O?.id ? (await w(O.id, A), z("success", "Category updated successfully!")) : (await C(A), z("success", "Category created successfully!")), H();
54
49
  } catch {
55
- P("error", `Failed to ${w ? "update" : "create"} category.`);
50
+ z("error", `Failed to ${O ? "update" : "create"} category.`);
56
51
  } finally {
57
- k(!1);
52
+ N(!1);
58
53
  }
59
54
  }
60
- }, B = async (e, t) => {
55
+ }, G = async (e, t) => {
61
56
  if (t > 0) {
62
- P("error", `Cannot delete category with ${t} articles. Move articles first.`);
57
+ z("error", `Cannot delete category with ${t} articles. Move articles first.`);
63
58
  return;
64
59
  }
65
60
  if (confirm("Are you sure you want to delete this category?")) {
66
- j(e);
61
+ F(e);
67
62
  try {
68
- await x(e), P("success", "Category deleted successfully!");
63
+ await T(e), z("success", "Category deleted successfully!");
69
64
  } catch {
70
- P("error", "Failed to delete category.");
65
+ z("error", "Failed to delete category.");
71
66
  } finally {
72
- j(null);
67
+ F(null);
73
68
  }
74
69
  }
75
- }, V = async (e) => {
70
+ }, K = async (e) => {
76
71
  if (e.id) try {
77
- await b(e.id, { isActive: !e.isActive }), P("success", `Category ${e.isActive ? "deactivated" : "activated"} successfully!`);
72
+ await w(e.id, { isActive: !e.isActive }), z("success", `Category ${e.isActive ? "deactivated" : "activated"} successfully!`);
78
73
  } catch {
79
- P("error", "Failed to update category status.");
74
+ z("error", "Failed to update category status.");
80
75
  }
81
- }, H = [...v].sort((e, t) => (e.displayOrder ?? 0) - (t.displayOrder ?? 0));
82
- return /* @__PURE__ */ m("div", {
76
+ }, q = [...S].sort((e, t) => (e.displayOrder ?? 0) - (t.displayOrder ?? 0));
77
+ return /* @__PURE__ */ y("div", {
83
78
  className: "space-y-6",
84
79
  children: [
85
- M && /* @__PURE__ */ m("div", {
86
- className: `fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-300 ${M.type === "success" ? "bg-status-success-bg-subtle text-status-success-text border-border-subtle" : "bg-status-error-bg-subtle text-status-error-text border-border-subtle"}`,
87
- children: [M.type === "success" ? /* @__PURE__ */ p(n, {
80
+ I && /* @__PURE__ */ y("div", {
81
+ className: `fixed right-4 top-[calc(var(--header-height,4rem)+1rem)] z-[200] flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-300 ${I.type === "success" ? "bg-status-success-bg-subtle text-status-success-text border-border-subtle" : "bg-status-error-bg-subtle text-status-error-text border-border-subtle"}`,
82
+ children: [I.type === "success" ? /* @__PURE__ */ v(s, {
88
83
  size: 20,
89
84
  className: "text-status-success-text"
90
- }) : /* @__PURE__ */ p(t, {
85
+ }) : /* @__PURE__ */ v(o, {
91
86
  size: 20,
92
87
  className: "text-destructive"
93
- }), /* @__PURE__ */ p("span", {
88
+ }), /* @__PURE__ */ v("span", {
94
89
  className: "font-medium",
95
- children: M.message
90
+ children: I.message
96
91
  })]
97
92
  }),
98
- S && /* @__PURE__ */ p("div", {
93
+ E && /* @__PURE__ */ v("div", {
99
94
  className: "fixed inset-0 z-50 flex items-center justify-center bg-overlay",
100
95
  role: "dialog",
101
96
  "aria-modal": "true",
102
97
  "aria-labelledby": "ticket-category-modal-title",
103
- children: /* @__PURE__ */ m("div", {
98
+ children: /* @__PURE__ */ y("div", {
104
99
  className: "bg-background rounded-xl p-6 w-full max-w-lg mx-4 shadow-2xl border max-h-[90vh] overflow-y-auto",
105
- children: [/* @__PURE__ */ m("div", {
100
+ children: [/* @__PURE__ */ y("div", {
106
101
  className: "flex items-center justify-between mb-6",
107
- children: [/* @__PURE__ */ p("h3", {
102
+ children: [/* @__PURE__ */ v("h3", {
108
103
  id: "ticket-category-modal-title",
109
104
  className: "text-xl font-semibold text-foreground",
110
- children: w ? "Edit Category" : "Create Category"
111
- }), /* @__PURE__ */ p("button", {
112
- onClick: L,
113
- className: "p-2 rounded-lg hover:bg-muted text-muted-foreground",
114
- children: /* @__PURE__ */ p(d, { size: 20 })
105
+ children: O ? "Edit Category" : "Create Category"
106
+ }), /* @__PURE__ */ v("button", {
107
+ onClick: H,
108
+ className: "min-h-11 min-w-11 p-2 rounded-lg hover:bg-muted text-muted-foreground",
109
+ "aria-label": "Close category dialog",
110
+ children: /* @__PURE__ */ v(g, { size: 20 })
115
111
  })]
116
- }), /* @__PURE__ */ m("form", {
117
- onSubmit: z,
112
+ }), /* @__PURE__ */ y("form", {
113
+ onSubmit: W,
118
114
  className: "space-y-5",
119
115
  children: [
120
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
116
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
121
117
  className: "block text-sm font-medium text-foreground mb-2",
122
- children: ["Category Name ", /* @__PURE__ */ p("span", {
118
+ children: ["Category Name ", /* @__PURE__ */ v("span", {
123
119
  className: "text-destructive",
124
120
  children: "*"
125
121
  })]
126
- }), /* @__PURE__ */ p("input", {
122
+ }), /* @__PURE__ */ v("input", {
127
123
  type: "text",
128
- value: E.name,
129
- onChange: (e) => R(e.target.value),
124
+ value: A.name,
125
+ onChange: (e) => U(e.target.value),
130
126
  placeholder: "e.g., Technical Support",
131
127
  className: "w-full px-4 py-2.5 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
132
128
  required: !0
133
129
  })] }),
134
- /* @__PURE__ */ m("div", { children: [
135
- /* @__PURE__ */ m("label", {
130
+ /* @__PURE__ */ y("div", { children: [
131
+ /* @__PURE__ */ y("label", {
136
132
  className: "block text-sm font-medium text-foreground mb-2",
137
- children: ["Slug ", /* @__PURE__ */ p("span", {
133
+ children: ["Slug ", /* @__PURE__ */ v("span", {
138
134
  className: "text-destructive",
139
135
  children: "*"
140
136
  })]
141
137
  }),
142
- /* @__PURE__ */ p("input", {
138
+ /* @__PURE__ */ v("input", {
143
139
  type: "text",
144
- value: E.slug,
145
- onChange: (e) => D({
146
- ...E,
140
+ value: A.slug,
141
+ onChange: (e) => j({
142
+ ...A,
147
143
  slug: e.target.value
148
144
  }),
149
145
  placeholder: "technical-support",
150
146
  className: "w-full px-4 py-2.5 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
151
147
  required: !0
152
148
  }),
153
- /* @__PURE__ */ p("p", {
149
+ /* @__PURE__ */ v("p", {
154
150
  className: "text-xs text-muted-foreground mt-1",
155
151
  children: "URL-friendly identifier (auto-generated from name)"
156
152
  })
157
153
  ] }),
158
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
154
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
159
155
  className: "block text-sm font-medium text-foreground mb-2",
160
156
  children: "Description"
161
- }), /* @__PURE__ */ p("textarea", {
162
- value: E.description,
163
- onChange: (e) => D({
164
- ...E,
157
+ }), /* @__PURE__ */ v("textarea", {
158
+ value: A.description,
159
+ onChange: (e) => j({
160
+ ...A,
165
161
  description: e.target.value
166
162
  }),
167
163
  placeholder: "Brief description of this category...",
168
164
  rows: 3,
169
165
  className: "w-full px-4 py-2.5 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary resize-none"
170
166
  })] }),
171
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
167
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
172
168
  className: "block text-sm font-medium text-foreground mb-2",
173
169
  children: "Color"
174
- }), /* @__PURE__ */ m("div", {
175
- className: "flex items-center gap-3",
176
- children: [/* @__PURE__ */ p("div", {
177
- className: "flex gap-2",
178
- children: h.map((e) => /* @__PURE__ */ p("button", {
170
+ }), /* @__PURE__ */ y("div", {
171
+ className: "flex flex-col gap-3 sm:flex-row sm:items-center",
172
+ children: [/* @__PURE__ */ v("div", {
173
+ className: "flex flex-wrap gap-2",
174
+ children: e.map((e) => /* @__PURE__ */ v("button", {
179
175
  type: "button",
180
- onClick: () => D({
181
- ...E,
182
- color: e
176
+ onClick: () => j({
177
+ ...A,
178
+ color: e.value
183
179
  }),
184
- className: `w-8 h-8 rounded-full border-2 transition-all ${E.color === e ? "border-foreground scale-110" : "border-transparent hover:scale-105"}`,
185
- style: { backgroundColor: e }
186
- }, e))
187
- }), /* @__PURE__ */ p("input", {
188
- type: "color",
189
- value: E.color,
190
- onChange: (e) => D({
191
- ...E,
180
+ className: `min-h-11 min-w-11 rounded-full border-2 transition-all ${e.swatchClass} ${A.color === e.value ? "border-foreground scale-110" : "border-transparent hover:scale-105"}`,
181
+ "aria-label": `Use ${e.label} category color`
182
+ }, e.value))
183
+ }), /* @__PURE__ */ v("select", {
184
+ value: A.color,
185
+ onChange: (e) => j({
186
+ ...A,
192
187
  color: e.target.value
193
188
  }),
194
- className: "w-10 h-10 rounded cursor-pointer border-0"
189
+ className: "min-h-11 rounded-lg border border-input bg-background px-3 text-sm text-foreground",
190
+ children: e.map((e) => /* @__PURE__ */ v("option", {
191
+ value: e.value,
192
+ children: e.label
193
+ }, e.value))
195
194
  })]
196
195
  })] }),
197
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
196
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
198
197
  className: "block text-sm font-medium text-foreground mb-2",
199
198
  children: "Icon (emoji)"
200
- }), /* @__PURE__ */ p("input", {
199
+ }), /* @__PURE__ */ v("input", {
201
200
  type: "text",
202
- value: E.icon,
203
- onChange: (e) => D({
204
- ...E,
201
+ value: A.icon,
202
+ onChange: (e) => j({
203
+ ...A,
205
204
  icon: e.target.value
206
205
  }),
207
206
  placeholder: "e.g., 🛠️",
208
207
  className: "w-full px-4 py-2.5 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
209
208
  maxLength: 4
210
209
  })] }),
211
- /* @__PURE__ */ m("label", {
210
+ /* @__PURE__ */ y("label", {
212
211
  className: "flex items-center gap-3 cursor-pointer",
213
- children: [/* @__PURE__ */ p("input", {
212
+ children: [/* @__PURE__ */ v("input", {
214
213
  type: "checkbox",
215
- checked: E.isActive,
216
- onChange: (e) => D({
217
- ...E,
214
+ checked: A.isActive,
215
+ onChange: (e) => j({
216
+ ...A,
218
217
  isActive: e.target.checked
219
218
  }),
220
219
  className: "w-4 h-4 rounded border-input text-primary focus:ring-primary"
221
- }), /* @__PURE__ */ p("span", {
220
+ }), /* @__PURE__ */ v("span", {
222
221
  className: "text-sm text-foreground",
223
222
  children: "Active"
224
223
  })]
225
224
  }),
226
- /* @__PURE__ */ m("div", {
227
- className: "flex gap-3 pt-4",
228
- children: [/* @__PURE__ */ p("button", {
225
+ /* @__PURE__ */ y("div", {
226
+ className: "flex flex-col gap-3 pt-4 sm:flex-row",
227
+ children: [/* @__PURE__ */ v("button", {
229
228
  type: "submit",
230
- disabled: O || !E.name.trim() || !E.slug.trim(),
231
- className: "flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
232
- children: O ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(o, {
229
+ disabled: M || !A.name.trim() || !A.slug.trim(),
230
+ className: "min-h-11 flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
231
+ children: M ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(d, {
233
232
  size: 18,
234
233
  className: "animate-spin"
235
- }), w ? "Updating..." : "Creating..."] }) : /* @__PURE__ */ p(f, { children: w ? "Update Category" : "Create Category" })
236
- }), /* @__PURE__ */ p("button", {
234
+ }), O ? "Updating..." : "Creating..."] }) : /* @__PURE__ */ v(_, { children: O ? "Update Category" : "Create Category" })
235
+ }), /* @__PURE__ */ v("button", {
237
236
  type: "button",
238
- onClick: L,
239
- className: "px-4 py-2.5 rounded-lg border border-input hover:bg-muted transition-colors",
237
+ onClick: H,
238
+ className: "min-h-11 px-4 py-2.5 rounded-lg border border-input hover:bg-muted transition-colors",
240
239
  children: "Cancel"
241
240
  })]
242
241
  })
@@ -244,48 +243,47 @@ function v({ categories: v, onCreate: y, onUpdate: b, onDelete: x }) {
244
243
  })]
245
244
  })
246
245
  }),
247
- /* @__PURE__ */ m("div", {
248
- className: "flex items-center justify-between",
249
- children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
246
+ /* @__PURE__ */ y("div", {
247
+ className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
248
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h2", {
250
249
  className: "text-xl font-semibold mb-2 text-foreground",
251
250
  children: "Ticket Categories"
252
- }), /* @__PURE__ */ p("p", {
251
+ }), /* @__PURE__ */ v("p", {
253
252
  className: "text-sm text-muted-foreground",
254
253
  children: "Organize tickets and knowledge base articles by category"
255
- })] }), /* @__PURE__ */ m("button", {
256
- onClick: F,
257
- className: "flex items-center gap-2 px-4 py-2 rounded-lg transition-colors bg-primary text-primary-foreground hover:bg-primary/90",
258
- children: [/* @__PURE__ */ p(s, { size: 20 }), "New Category"]
254
+ })] }), /* @__PURE__ */ y("button", {
255
+ onClick: B,
256
+ className: "min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-colors bg-primary text-primary-foreground hover:bg-primary/90",
257
+ children: [/* @__PURE__ */ v(f, { size: 20 }), "New Category"]
259
258
  })]
260
259
  }),
261
- /* @__PURE__ */ m("div", {
260
+ /* @__PURE__ */ y("div", {
262
261
  className: "space-y-2",
263
- children: [H.map((e) => /* @__PURE__ */ m("div", {
264
- className: `p-4 rounded-lg border bg-background flex items-center gap-4 ${e.isActive === !1 ? "border-border/50 opacity-60" : "border-border"}`,
262
+ children: [q.map((e) => /* @__PURE__ */ y("div", {
263
+ className: `p-4 rounded-lg border bg-background flex flex-col gap-4 sm:flex-row sm:items-center ${e.isActive === !1 ? "border-border/50 opacity-60" : "border-border"}`,
265
264
  children: [
266
- /* @__PURE__ */ p("div", {
265
+ /* @__PURE__ */ v("div", {
267
266
  className: "text-muted-foreground cursor-grab",
268
- children: /* @__PURE__ */ p(a, { size: 20 })
267
+ children: /* @__PURE__ */ v(u, { size: 20 })
269
268
  }),
270
- /* @__PURE__ */ p("div", {
271
- className: "w-10 h-10 rounded-lg flex items-center justify-center text-on-accent text-xl flex-shrink-0" + (e.color ? "" : " bg-muted text-muted-foreground"),
272
- style: e.color ? { backgroundColor: e.color } : void 0,
273
- children: e.icon || /* @__PURE__ */ p(i, { size: 20 })
269
+ /* @__PURE__ */ v("div", {
270
+ className: `w-10 h-10 rounded-lg flex items-center justify-center text-on-accent text-xl flex-shrink-0 ${n(e.color)}`,
271
+ children: e.icon || /* @__PURE__ */ v(l, { size: 20 })
274
272
  }),
275
- /* @__PURE__ */ m("div", {
273
+ /* @__PURE__ */ y("div", {
276
274
  className: "flex-1 min-w-0",
277
275
  children: [
278
- /* @__PURE__ */ m("div", {
276
+ /* @__PURE__ */ y("div", {
279
277
  className: "flex items-center gap-2",
280
- children: [/* @__PURE__ */ p("h3", {
278
+ children: [/* @__PURE__ */ v("h3", {
281
279
  className: "font-semibold text-foreground",
282
280
  children: e.name
283
- }), e.isActive === !1 && /* @__PURE__ */ p("span", {
281
+ }), e.isActive === !1 && /* @__PURE__ */ v("span", {
284
282
  className: "text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground",
285
283
  children: "Inactive"
286
284
  })]
287
285
  }),
288
- /* @__PURE__ */ m("p", {
286
+ /* @__PURE__ */ y("p", {
289
287
  className: "text-sm text-muted-foreground",
290
288
  children: [
291
289
  "/",
@@ -295,56 +293,59 @@ function v({ categories: v, onCreate: y, onUpdate: b, onDelete: x }) {
295
293
  " articles"
296
294
  ]
297
295
  }),
298
- e.description && /* @__PURE__ */ p("p", {
296
+ e.description && /* @__PURE__ */ v("p", {
299
297
  className: "text-xs text-muted-foreground mt-1 line-clamp-1",
300
298
  children: e.description
301
299
  })
302
300
  ]
303
301
  }),
304
- /* @__PURE__ */ m("div", {
305
- className: "flex items-center gap-1",
302
+ /* @__PURE__ */ y("div", {
303
+ className: "flex w-full items-center justify-end gap-1 sm:w-auto",
306
304
  children: [
307
- /* @__PURE__ */ p("button", {
308
- onClick: () => V(e),
309
- className: "p-2 rounded hover:bg-muted text-muted-foreground transition-colors",
305
+ /* @__PURE__ */ v("button", {
306
+ onClick: () => K(e),
307
+ className: "min-h-11 min-w-11 p-2 rounded hover:bg-muted text-muted-foreground transition-colors",
310
308
  title: e.isActive ? "Deactivate" : "Activate",
311
- children: e.isActive ? /* @__PURE__ */ p(l, {
309
+ "aria-label": e.isActive ? "Deactivate category" : "Activate category",
310
+ children: e.isActive ? /* @__PURE__ */ v(m, {
312
311
  size: 20,
313
312
  className: "text-status-success-text"
314
- }) : /* @__PURE__ */ p(c, { size: 20 })
313
+ }) : /* @__PURE__ */ v(p, { size: 20 })
315
314
  }),
316
- /* @__PURE__ */ p("button", {
317
- onClick: () => I(e),
318
- className: "p-2 rounded hover:bg-muted text-muted-foreground transition-colors",
315
+ /* @__PURE__ */ v("button", {
316
+ onClick: () => V(e),
317
+ className: "min-h-11 min-w-11 p-2 rounded hover:bg-muted text-muted-foreground transition-colors",
319
318
  title: "Edit category",
320
- children: /* @__PURE__ */ p(r, { size: 18 })
319
+ "aria-label": "Edit category",
320
+ children: /* @__PURE__ */ v(c, { size: 18 })
321
321
  }),
322
- /* @__PURE__ */ p("button", {
323
- onClick: () => e.id && B(e.id, e.articleCount ?? 0),
324
- disabled: A === e.id,
325
- className: "p-2 rounded hover:bg-muted text-status-error-text transition-colors disabled:opacity-50",
322
+ /* @__PURE__ */ v("button", {
323
+ onClick: () => e.id && G(e.id, e.articleCount ?? 0),
324
+ disabled: P === e.id,
325
+ className: "min-h-11 min-w-11 p-2 rounded hover:bg-muted text-status-error-text transition-colors disabled:opacity-50",
326
326
  title: "Delete category",
327
- children: A === e.id ? /* @__PURE__ */ p(o, {
327
+ "aria-label": "Delete category",
328
+ children: P === e.id ? /* @__PURE__ */ v(d, {
328
329
  size: 18,
329
330
  className: "animate-spin"
330
- }) : /* @__PURE__ */ p(u, { size: 18 })
331
+ }) : /* @__PURE__ */ v(h, { size: 18 })
331
332
  })
332
333
  ]
333
334
  })
334
335
  ]
335
- }, e.id)), v.length === 0 && /* @__PURE__ */ m("div", {
336
+ }, e.id)), S.length === 0 && /* @__PURE__ */ y("div", {
336
337
  className: "text-center py-12 border border-dashed border-border rounded-lg",
337
338
  children: [
338
- /* @__PURE__ */ p(i, {
339
+ /* @__PURE__ */ v(l, {
339
340
  size: 48,
340
341
  className: "text-muted-foreground mx-auto"
341
342
  }),
342
- /* @__PURE__ */ p("p", {
343
+ /* @__PURE__ */ v("p", {
343
344
  className: "mt-4 text-muted-foreground",
344
345
  children: "No categories configured"
345
346
  }),
346
- /* @__PURE__ */ p("button", {
347
- onClick: F,
347
+ /* @__PURE__ */ v("button", {
348
+ onClick: B,
348
349
  className: "mt-4 text-primary hover:underline",
349
350
  children: "Create your first category"
350
351
  })
@@ -355,6 +356,6 @@ function v({ categories: v, onCreate: y, onUpdate: b, onDelete: x }) {
355
356
  });
356
357
  }
357
358
  //#endregion
358
- export { v as TicketCategoriesSettings };
359
+ export { S as TicketCategoriesSettings };
359
360
 
360
361
  //# sourceMappingURL=TicketCategoriesSettings.js.map