create-expo-updates-server 0.1.6 → 0.2.1

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 (143) hide show
  1. package/dist/template/.dockerignore +16 -0
  2. package/dist/template/Dockerfile +5 -0
  3. package/dist/template/README.md +51 -660
  4. package/dist/template/app/api/admin/device-targets/route.test.ts +43 -0
  5. package/dist/template/app/api/admin/device-targets/route.ts +91 -0
  6. package/dist/template/app/api/admin/devices/route.test.ts +41 -0
  7. package/dist/template/app/api/admin/devices/route.ts +15 -0
  8. package/dist/template/app/api/admin/updates/[encodedKey]/audience/route.ts +75 -0
  9. package/dist/template/app/api/device-heartbeat/route.ts +2 -0
  10. package/dist/template/app/globals.css +114 -15
  11. package/dist/template/app/layout.tsx +12 -4
  12. package/dist/template/app/login/page.tsx +22 -18
  13. package/dist/template/app/updates/[encodedKey]/page.tsx +112 -88
  14. package/dist/template/app/updates/devices/page.tsx +264 -0
  15. package/dist/template/app/updates/embedded/page.tsx +102 -68
  16. package/dist/template/app/updates/emergency-redirects/page.tsx +144 -111
  17. package/dist/template/app/updates/layout.tsx +6 -1
  18. package/dist/template/app/updates/page.tsx +262 -212
  19. package/dist/template/components/admin/admin-shell.tsx +196 -0
  20. package/dist/template/components/admin/language-switcher.tsx +25 -0
  21. package/dist/template/components/admin/theme-provider.tsx +15 -0
  22. package/dist/template/components/ui/alert.tsx +65 -0
  23. package/dist/template/components/ui/badge.tsx +47 -0
  24. package/dist/template/components/ui/button.tsx +63 -0
  25. package/dist/template/components/ui/card.tsx +91 -0
  26. package/dist/template/components/ui/chart.tsx +373 -0
  27. package/dist/template/components/ui/checkbox.tsx +31 -0
  28. package/dist/template/components/ui/dialog.tsx +158 -0
  29. package/dist/template/components/ui/dropdown-menu.tsx +256 -0
  30. package/dist/template/components/ui/input.tsx +20 -0
  31. package/dist/template/components/ui/label.tsx +23 -0
  32. package/dist/template/components/ui/native-select.tsx +61 -0
  33. package/dist/template/components/ui/popover.tsx +88 -0
  34. package/dist/template/components/ui/scroll-area.tsx +57 -0
  35. package/dist/template/components/ui/select.tsx +189 -0
  36. package/dist/template/components/ui/separator.tsx +27 -0
  37. package/dist/template/components/ui/sheet.tsx +142 -0
  38. package/dist/template/components/ui/sidebar.tsx +736 -0
  39. package/dist/template/components/ui/skeleton.tsx +13 -0
  40. package/dist/template/components/ui/switch.tsx +34 -0
  41. package/dist/template/components/ui/table.tsx +115 -0
  42. package/dist/template/components/ui/tabs.tsx +90 -0
  43. package/dist/template/components/ui/textarea.tsx +17 -0
  44. package/dist/template/components/ui/tooltip.tsx +56 -0
  45. package/dist/template/components.json +22 -0
  46. package/dist/template/docker/minio.Dockerfile +11 -0
  47. package/dist/template/docker-compose.yml +7 -9
  48. package/dist/template/docs/admin-ui.md +35 -0
  49. package/dist/template/docs/device-targeting.md +129 -0
  50. package/dist/template/docs/doctor.md +137 -0
  51. package/dist/template/docs/expo-app-setup.md +174 -47
  52. package/dist/template/docs/getting-started.md +109 -146
  53. package/dist/template/docs/getting-started.ru.md +110 -193
  54. package/dist/template/docs/index.md +14 -33
  55. package/dist/template/docs/installation-telemetry.md +233 -0
  56. package/dist/template/docs/migrations/2026-10-16-manifest-identity.sql +89 -0
  57. package/dist/template/docs/migrations/2026-10-19-device-heartbeat.sql +131 -0
  58. package/dist/template/docs/migrations/2026-10-22-device-analytics.sql +264 -0
  59. package/dist/template/docs/migrations/2026-10-22-device-targeting-activation.sql +108 -0
  60. package/dist/template/docs/migrations/2026-10-22-device-targeting.sql +130 -0
  61. package/dist/template/docs/migrations/2026-10-22-device-version-metadata.sql +154 -0
  62. package/dist/template/docs/migrations/schema.sql +868 -6
  63. package/dist/template/docs/npm-installer.md +15 -30
  64. package/dist/template/docs/operations-guide.md +87 -0
  65. package/dist/template/docs/ota-client-lifecycle.md +263 -0
  66. package/dist/template/docs/ota-update-policy.md +36 -2
  67. package/dist/template/docs/supabase-setup.md +4 -0
  68. package/dist/template/hooks/use-mobile.ts +21 -0
  69. package/dist/template/lib/utils.ts +6 -0
  70. package/dist/template/package-lock.json +2325 -101
  71. package/dist/template/package.json +13 -3
  72. package/dist/template/scripts/configure-expo-app.mjs +11 -15
  73. package/dist/template/scripts/doctor.mjs +51 -0
  74. package/dist/template/scripts/ensure-storage-bucket.mjs +25 -0
  75. package/dist/template/scripts/ensure-test-bucket.mjs +21 -0
  76. package/dist/template/scripts/lib/device-identity.test.ts +29 -0
  77. package/dist/template/scripts/lib/doctor-probes.mjs +139 -0
  78. package/dist/template/scripts/lib/doctor.mjs +208 -0
  79. package/dist/template/scripts/lib/doctor.test.mjs +262 -0
  80. package/dist/template/scripts/lib/expo-app-configurator.mjs +14 -9
  81. package/dist/template/scripts/lib/expo-app-configurator.test.ts +3 -2
  82. package/dist/template/scripts/lib/ota-client-configurator.mjs +69 -0
  83. package/dist/template/scripts/lib/ota-client-configurator.test.ts +88 -0
  84. package/dist/template/scripts/lib/ota-client.test.ts +55 -0
  85. package/dist/template/scripts/lib/ota-root-hook-patcher.mjs +173 -0
  86. package/dist/template/scripts/lib/ota-root-hook-patcher.test.ts +123 -0
  87. package/dist/template/scripts/lib/ota-update-controller.test.ts +231 -0
  88. package/dist/template/scripts/tests/device-analytics-migrations.mjs +80 -0
  89. package/dist/template/scripts/tests/device-analytics.mjs +126 -0
  90. package/dist/template/scripts/tests/device-heartbeat.mjs +86 -0
  91. package/dist/template/scripts/tests/device-targeting-activation.mjs +111 -0
  92. package/dist/template/scripts/tests/device-targeting.mjs +39 -0
  93. package/dist/template/scripts/tests/device-version-metadata.mjs +31 -0
  94. package/dist/template/scripts/tests/manifest-identity-concurrency.mjs +106 -0
  95. package/dist/template/scripts/tests/manifest-identity.sql +204 -0
  96. package/dist/template/src/client/admin-types.ts +1 -0
  97. package/dist/template/src/client/devices/analytics.tsx +429 -0
  98. package/dist/template/src/client/devices/device-name.tsx +82 -0
  99. package/dist/template/src/client/devices/registry.tsx +399 -0
  100. package/dist/template/src/client/devices/use-devices-report.ts +108 -0
  101. package/dist/template/src/client/devices/version-adoption-chart.tsx +269 -0
  102. package/dist/template/src/client/devices/version-groups.test.ts +57 -0
  103. package/dist/template/src/client/devices/version-groups.ts +101 -0
  104. package/dist/template/src/client/distribution-control.tsx +135 -81
  105. package/dist/template/src/client/guard-action-combobox.tsx +13 -24
  106. package/dist/template/src/client/i18n/en.json +286 -0
  107. package/dist/template/src/client/i18n/messages.test.ts +42 -0
  108. package/dist/template/src/client/i18n/messages.ts +31 -0
  109. package/dist/template/src/client/i18n/provider.tsx +55 -0
  110. package/dist/template/src/client/i18n/use-formatters.ts +38 -0
  111. package/dist/template/src/client/logout-button.tsx +3 -1
  112. package/dist/template/src/client/update-audience-editor.tsx +285 -0
  113. package/dist/template/src/client/update-policy-editor.tsx +53 -41
  114. package/dist/template/src/server/controllers/manifest.test.ts +250 -7
  115. package/dist/template/src/server/controllers/manifest.ts +39 -31
  116. package/dist/template/src/server/devices/audience.test.ts +48 -0
  117. package/dist/template/src/server/devices/audience.ts +86 -0
  118. package/dist/template/src/server/devices/heartbeat.test.ts +39 -0
  119. package/dist/template/src/server/devices/heartbeat.ts +75 -0
  120. package/dist/template/src/server/devices/report-types.ts +114 -0
  121. package/dist/template/src/server/devices/report.test.ts +29 -0
  122. package/dist/template/src/server/devices/report.ts +27 -0
  123. package/dist/template/src/server/lib/admin-audience-activation.test.ts +94 -0
  124. package/dist/template/src/server/lib/admin-updates.ts +32 -168
  125. package/dist/template/src/server/lib/supabase.js +10 -10
  126. package/dist/template/src/server/lib/supabase.test.ts +11 -0
  127. package/dist/template/src/server/manifest/manifest-identity.test.ts +30 -0
  128. package/dist/template/src/server/manifest/manifest-identity.ts +24 -0
  129. package/dist/template/src/server/manifest/manifest-repository.ts +31 -102
  130. package/dist/template/src/server/manifest/manifest-response.ts +1 -1
  131. package/dist/template/templates/expo-app/ota-client/README.md +59 -0
  132. package/dist/template/templates/expo-app/ota-client/controller.js +60 -0
  133. package/dist/template/templates/expo-app/ota-client/device-identity.js +26 -0
  134. package/dist/template/templates/expo-app/ota-client/docs/update-lifecycle.md +52 -0
  135. package/dist/template/templates/expo-app/ota-client/index.d.ts +47 -0
  136. package/dist/template/templates/expo-app/ota-client/index.js +3 -0
  137. package/dist/template/templates/expo-app/ota-client/model/hooks/useOtaUpdates.js +48 -0
  138. package/dist/template/templates/expo-app/ota-client/model/update-controller.js +182 -0
  139. package/dist/template/templates/expo-app/ota-client/runtime.js +112 -0
  140. package/dist/template/templates/expo-app/ota-client/ui/ota-update-gate.js +56 -0
  141. package/dist/template-manifest.json +592 -77
  142. package/lib/cli.mjs +4 -6
  143. package/package.json +1 -1
@@ -1,4 +1,12 @@
1
1
  "use client";
2
+ import { useI18n } from "@/src/client/i18n/provider";
3
+
4
+ import { Textarea } from "@/components/ui/textarea";
5
+
6
+ import { Button } from "@/components/ui/button";
7
+ import { Badge } from "@/components/ui/badge";
8
+ import { Card } from "@/components/ui/card";
9
+ import { ShieldCheck, ShieldAlert, ChevronDown, RefreshCw } from "lucide-react";
2
10
 
3
11
  import {
4
12
  AdminApiError,
@@ -9,6 +17,7 @@ import type { DistributionControlResponse } from "./admin-types";
9
17
  import { useCallback, useEffect, useState } from "react";
10
18
 
11
19
  export function useDistributionControlState() {
20
+ const { t } = useI18n();
12
21
  const [state, setState] = useState<DistributionControlResponse | null>(null);
13
22
  const [loading, setLoading] = useState(true);
14
23
  const [error, setError] = useState("");
@@ -37,7 +46,7 @@ export function useDistributionControlState() {
37
46
  return () => window.clearTimeout(timeoutId);
38
47
  }, [refresh]);
39
48
 
40
- return { state, setState, loading, error, setError, refresh };
49
+ return { state, setState, loading, error: t(error), setError, refresh };
41
50
  }
42
51
 
43
52
  function formatChangedBy(state: DistributionControlResponse): string {
@@ -54,20 +63,22 @@ export function DistributionControlBanner({
54
63
  loading: boolean;
55
64
  error: string;
56
65
  }) {
66
+ const { t, formatLocale } = useI18n();
57
67
  if (loading) {
58
68
  return (
59
- <section className="rounded-xl border border-zinc-300 bg-zinc-100 p-4 text-sm dark:border-zinc-700 dark:bg-zinc-900">
60
- Проверка глобального статуса OTA…
69
+ <section className="rounded-lg border bg-muted/30 p-4 text-sm text-muted-foreground">
70
+ {t("Проверка глобального статуса OTA…")}
61
71
  </section>
62
72
  );
63
73
  }
64
74
 
65
75
  if (error || !state) {
66
76
  return (
67
- <section className="rounded-xl border border-red-400 bg-red-50 p-4 text-sm text-red-900 dark:border-red-700 dark:bg-red-950/40 dark:text-red-200">
68
- ⚠️ Глобальный статус OTA недоступен. Распространяющие действия
69
- отключены до восстановления связи.
70
- {error ? <p className="mt-1 text-xs">{error}</p> : null}
77
+ <section className="rounded-lg border border-destructive/25 bg-destructive/5 p-4 text-sm text-destructive">
78
+ {t(
79
+ "Глобальный статус OTA недоступен. Распространяющие действия отключены до восстановления связи.",
80
+ )}
81
+ {error ? <p className="mt-1 text-xs">{t(error)}</p> : null}
71
82
  </section>
72
83
  );
73
84
  }
@@ -77,11 +88,11 @@ export function DistributionControlBanner({
77
88
  }
78
89
 
79
90
  return (
80
- <section className="rounded-xl border-2 border-red-500 bg-red-50 p-4 text-red-950 dark:bg-red-950/50 dark:text-red-100">
81
- <p className="font-semibold">⛔ OTA DISTRIBUTION BLOCKED</p>
91
+ <section className="rounded-lg border border-destructive/25 bg-destructive/5 p-4 text-destructive">
92
+ <p className="font-semibold">{t("Распространение OTA остановлено")}</p>
82
93
  <p className="mt-1 text-sm">{state.reason}</p>
83
94
  <p className="mt-2 text-xs">
84
- {new Date(state.changedAt).toLocaleString("uk-UA")} ·{" "}
95
+ {new Date(state.changedAt).toLocaleString(formatLocale)} ·{" "}
85
96
  {formatChangedBy(state)}
86
97
  </p>
87
98
  </section>
@@ -89,11 +100,13 @@ export function DistributionControlBanner({
89
100
  }
90
101
 
91
102
  export default function DistributionControl() {
103
+ const { t, formatLocale } = useI18n();
92
104
  const { state, setState, loading, error, setError, refresh } =
93
105
  useDistributionControlState();
94
106
  const [reason, setReason] = useState("");
95
107
  const [saving, setSaving] = useState(false);
96
108
  const [message, setMessage] = useState("");
109
+ const [expanded, setExpanded] = useState(false);
97
110
 
98
111
  const changeState = async (blocked: boolean) => {
99
112
  if (!state) {
@@ -108,8 +121,10 @@ export default function DistributionControl() {
108
121
 
109
122
  const confirmed = window.confirm(
110
123
  blocked
111
- ? "Немедленно остановить выдачу manifest и всех OTA assets для всех клиентов?"
112
- : "Возобновить глобальное OTA-распространение?",
124
+ ? t(
125
+ "Немедленно остановить выдачу manifest и всех OTA assets для всех клиентов?",
126
+ )
127
+ : t("Возобновить глобальное OTA-распространение?"),
113
128
  );
114
129
  if (!confirmed) {
115
130
  return;
@@ -128,8 +143,8 @@ export default function DistributionControl() {
128
143
  setReason("");
129
144
  setMessage(
130
145
  blocked
131
- ? "OTA-распространение остановлено."
132
- : "OTA-распространение возобновлено.",
146
+ ? t("OTA-распространение остановлено.")
147
+ : t("OTA-распространение возобновлено."),
133
148
  );
134
149
  } catch (saveError: unknown) {
135
150
  if (saveError instanceof AdminApiError && saveError.status === 409) {
@@ -150,82 +165,121 @@ export default function DistributionControl() {
150
165
  };
151
166
 
152
167
  return (
153
- <section
154
- className={`rounded-xl border-2 p-4 ${
155
- state?.blocked
156
- ? "border-red-500 bg-red-50 dark:bg-red-950/50"
157
- : "border-emerald-400 bg-emerald-50 dark:bg-emerald-950/30"
158
- }`}
159
- >
160
- <div className="flex flex-col gap-3 md:flex-row md:items-start md:justify-between">
161
- <div>
162
- <p className="text-xs font-semibold uppercase tracking-wider">
163
- Global OTA emergency switch
164
- </p>
165
- <h2 className="mt-1 text-xl font-bold">
166
- {loading ? "LOADING…" : state?.blocked ? "BLOCKED" : "ACTIVE"}
167
- </h2>
168
- {state ? (
169
- <div className="mt-2 space-y-1 text-sm">
170
- <p>
171
- {state.blocked
172
- ? state.reason
173
- : "Manifest и assets выдаются в обычном режиме."}
174
- </p>
175
- <p className="text-xs opacity-75">
176
- Изменено: {new Date(state.changedAt).toLocaleString("uk-UA")} ·{" "}
177
- {formatChangedBy(state)} · version {state.version}
178
- </p>
168
+ <Card className="gap-0 overflow-hidden py-0 shadow-none">
169
+ <div className="flex flex-wrap items-center justify-between gap-4 p-4">
170
+ <div className="flex items-start gap-3">
171
+ <div
172
+ className={`flex size-9 shrink-0 items-center justify-center rounded-lg ${state?.blocked || error ? "bg-destructive/10 text-destructive" : "bg-muted text-muted-foreground"}`}
173
+ >
174
+ {loading ? (
175
+ <RefreshCw className="size-4 animate-spin" />
176
+ ) : state?.blocked || error ? (
177
+ <ShieldAlert className="size-4" />
178
+ ) : (
179
+ <ShieldCheck className="size-4" />
180
+ )}
181
+ </div>
182
+ <div>
183
+ <div className="flex flex-wrap items-center gap-2">
184
+ <h2 className="text-sm font-semibold">
185
+ {t("Распространение OTA")}
186
+ </h2>
187
+ <Badge
188
+ variant="secondary"
189
+ className={
190
+ state?.blocked || error
191
+ ? "bg-destructive/10 text-destructive"
192
+ : ""
193
+ }
194
+ >
195
+ {loading
196
+ ? t("Проверка…")
197
+ : error || !state
198
+ ? t("Недоступно")
199
+ : state.blocked
200
+ ? t("Остановлено")
201
+ : t("Работает")}
202
+ </Badge>
179
203
  </div>
180
- ) : null}
204
+ <p className="mt-1 text-xs text-muted-foreground">
205
+ {state?.blocked
206
+ ? state.reason
207
+ : t("Глобальное управление выдачей manifest и assets.")}
208
+ </p>
209
+ </div>
181
210
  </div>
182
-
183
211
  {state?.canWrite ? (
184
- <div className="w-full max-w-xl">
185
- {!state.blocked ? (
186
- <textarea
212
+ <Button
213
+ variant="outline"
214
+ size="sm"
215
+ onClick={() => setExpanded((value) => !value)}
216
+ aria-expanded={expanded}
217
+ aria-controls="distribution-controls"
218
+ >
219
+ {t("Управление")}
220
+ <ChevronDown
221
+ className={`transition-transform ${expanded ? "rotate-180" : ""}`}
222
+ />
223
+ </Button>
224
+ ) : state ? (
225
+ <Badge variant="outline">Read only · updates:write</Badge>
226
+ ) : null}
227
+ </div>
228
+ {expanded && state?.canWrite && (
229
+ <div
230
+ id="distribution-controls"
231
+ className="space-y-3 border-t bg-muted/20 p-4"
232
+ >
233
+ <p className="text-xs text-muted-foreground">
234
+ {t("Изменено: ")}
235
+ {new Date(state.changedAt).toLocaleString(formatLocale)} ·{" "}
236
+ {formatChangedBy(state)} · version {state.version}
237
+ </p>
238
+ {!state.blocked && (
239
+ <label className="block space-y-2 text-sm font-medium">
240
+ {t("Причина остановки")}
241
+ <Textarea
187
242
  value={reason}
188
243
  onChange={(event) => setReason(event.target.value)}
189
244
  maxLength={500}
190
- aria-label="Причина аварийной блокировки OTA"
191
- placeholder="Обязательная причина остановки (до 500 символов)"
192
- className="min-h-20 w-full rounded-md border border-red-300 bg-white p-2 text-sm text-zinc-950 dark:border-red-800 dark:bg-zinc-950 dark:text-zinc-100"
245
+ aria-label={t("Причина аварийной блокировки OTA")}
246
+ placeholder={t(
247
+ "Обязательная причина остановки (до 500 символов)",
248
+ )}
249
+ className="block min-h-20 w-full max-w-2xl rounded-md border border-input bg-background p-3 text-sm font-normal outline-none focus-visible:ring-2 focus-visible:ring-ring"
193
250
  />
194
- ) : null}
195
- <button
196
- type="button"
197
- disabled={saving || loading}
198
- onClick={() => void changeState(!state.blocked)}
199
- className={`mt-2 rounded-md px-4 py-3 text-sm font-semibold text-white disabled:cursor-not-allowed disabled:opacity-60 ${
200
- state.blocked
201
- ? "bg-emerald-700 hover:bg-emerald-800"
202
- : "bg-red-700 hover:bg-red-800"
203
- }`}
204
- >
205
- {saving
206
- ? "Сохранение…"
207
- : state.blocked
208
- ? "Возобновить OTA"
209
- : "Остановить все OTA"}
210
- </button>
211
- </div>
212
- ) : state ? (
213
- <p className="rounded-md border border-zinc-300 px-3 py-2 text-xs dark:border-zinc-700">
214
- Read-only: требуется updates:write
215
- </p>
216
- ) : null}
217
- </div>
218
-
219
- {error ? (
220
- <p className="mt-3 rounded-md bg-red-100 p-2 text-sm text-red-900 dark:bg-red-950 dark:text-red-200">
221
- {error}
251
+ </label>
252
+ )}
253
+ <Button
254
+ variant={state.blocked ? "default" : "destructive"}
255
+ size="sm"
256
+ disabled={saving || loading}
257
+ onClick={() => void changeState(!state.blocked)}
258
+ >
259
+ {saving
260
+ ? t("Сохранение…")
261
+ : state.blocked
262
+ ? t("Возобновить OTA")
263
+ : t("Остановить все OTA")}
264
+ </Button>
265
+ </div>
266
+ )}
267
+ {error && (
268
+ <p
269
+ role="alert"
270
+ className="border-t bg-destructive/5 px-4 py-3 text-sm text-destructive"
271
+ >
272
+ {t(error)}
222
273
  </p>
223
- ) : null}
224
- {message ? (
225
- <p className="mt-3 rounded-md bg-emerald-100 p-2 text-sm text-emerald-900 dark:bg-emerald-950 dark:text-emerald-200">
274
+ )}
275
+ {message && (
276
+ <p
277
+ role="status"
278
+ className="border-t px-4 py-3 text-sm text-emerald-700 dark:text-emerald-400"
279
+ >
226
280
  {message}
227
281
  </p>
228
- ) : null}
229
- </section>
282
+ )}
283
+ </Card>
230
284
  );
231
285
  }
@@ -1,16 +1,13 @@
1
1
  "use client";
2
2
 
3
+ import { Input } from "@/components/ui/input";
4
+
3
5
  import {
4
6
  filterGuardActionOptions,
5
7
  GuardActionOption,
6
8
  normalizeCreatableGuardAction,
7
9
  } from "./guard-action-options";
8
- import {
9
- KeyboardEvent,
10
- useId,
11
- useRef,
12
- useState,
13
- } from "react";
10
+ import { KeyboardEvent, useId, useRef, useState } from "react";
14
11
 
15
12
  type Props = {
16
13
  value: string;
@@ -141,7 +138,7 @@ export default function GuardActionCombobox({
141
138
  }
142
139
  }}
143
140
  >
144
- <input
141
+ <Input
145
142
  value={inputValue}
146
143
  maxLength={100}
147
144
  readOnly={selectionDisabled}
@@ -152,9 +149,7 @@ export default function GuardActionCombobox({
152
149
  aria-haspopup="dialog"
153
150
  aria-expanded={open}
154
151
  aria-controls={popupId}
155
- aria-describedby={
156
- inputError || mutationError ? errorId : undefined
157
- }
152
+ aria-describedby={inputError || mutationError ? errorId : undefined}
158
153
  onFocus={() => setOpen(true)}
159
154
  onChange={(event) => {
160
155
  setDraftValue(event.target.value);
@@ -163,7 +158,7 @@ export default function GuardActionCombobox({
163
158
  setActiveIndex(-1);
164
159
  }}
165
160
  onKeyDown={handleKeyDown}
166
- className="w-full rounded border border-zinc-300 bg-transparent p-2 text-sm dark:border-zinc-700"
161
+ className="w-full"
167
162
  placeholder="Action (required)"
168
163
  />
169
164
  {open ? (
@@ -171,24 +166,20 @@ export default function GuardActionCombobox({
171
166
  id={popupId}
172
167
  role="dialog"
173
168
  aria-label="Guard action catalog"
174
- className="absolute z-20 mt-1 max-h-60 w-full overflow-auto rounded-md border border-zinc-300 bg-white p-1 shadow-lg dark:border-zinc-700 dark:bg-zinc-900"
169
+ className="absolute z-20 mt-1 max-h-60 w-full overflow-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-md"
175
170
  >
176
171
  {filteredOptions.map((option, index) => (
177
172
  <div
178
173
  key={`${option.id || "policy"}:${option.actionKey}`}
179
174
  className={`flex items-center rounded ${
180
- activeIndex === index
181
- ? "bg-blue-50 dark:bg-blue-950"
182
- : ""
175
+ activeIndex === index ? "bg-accent" : ""
183
176
  }`}
184
177
  >
185
178
  <button
186
179
  type="button"
187
180
  tabIndex={-1}
188
181
  disabled={selectionDisabled}
189
- aria-current={
190
- option.actionKey === value ? "true" : undefined
191
- }
182
+ aria-current={option.actionKey === value ? "true" : undefined}
192
183
  onMouseDown={(event) => event.preventDefault()}
193
184
  onClick={() => chooseOption(option)}
194
185
  className="min-w-0 flex-1 truncate px-3 py-2 text-left text-sm disabled:cursor-default"
@@ -206,7 +197,7 @@ export default function GuardActionCombobox({
206
197
  event.stopPropagation();
207
198
  void onDelete(option);
208
199
  }}
209
- className="m-1 rounded p-2 text-red-600 hover:bg-red-50 dark:hover:bg-red-950"
200
+ className="m-1 rounded p-2 text-destructive hover:bg-destructive/10"
210
201
  >
211
202
  <svg
212
203
  viewBox="0 0 24 24"
@@ -228,17 +219,15 @@ export default function GuardActionCombobox({
228
219
  type="button"
229
220
  onMouseDown={(event) => event.preventDefault()}
230
221
  onClick={() => void create()}
231
- className={`w-full rounded px-3 py-2 text-left text-sm font-medium text-blue-700 dark:text-blue-300 ${
232
- activeIndex === filteredOptions.length
233
- ? "bg-blue-50 dark:bg-blue-950"
234
- : ""
222
+ className={`w-full rounded px-3 py-2 text-left text-sm font-medium text-primary ${
223
+ activeIndex === filteredOptions.length ? "bg-accent" : ""
235
224
  }`}
236
225
  >
237
226
  Create “{creatableValue}”
238
227
  </button>
239
228
  ) : null}
240
229
  {filteredOptions.length === 0 && !showCreate ? (
241
- <p className="px-3 py-2 text-sm text-zinc-500">
230
+ <p className="px-3 py-2 text-sm text-muted-foreground">
242
231
  No matching actions
243
232
  </p>
244
233
  ) : null}