@nivaro/react 0.3.62 → 0.3.64

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.
@@ -1,46 +1,55 @@
1
- import { jsxs as l, jsx as a, Fragment as O } from "react/jsx-runtime";
2
- import { useQueryClient as Y, useQuery as K, useMutation as Q } from "@tanstack/react-query";
1
+ import { jsxs as a, jsx as l, Fragment as O } from "react/jsx-runtime";
2
+ import { useQueryClient as Y, useQuery as K, useMutation as D } from "@tanstack/react-query";
3
3
  import { useState as s } from "react";
4
- import { useNivaroClient as W, useNavigation as Z } from "../context.js";
5
- import { get as L, post as V, patch as z, del as B } from "../lib/commands.js";
4
+ import { useNivaroClient as B, useNavigation as W } from "../context.js";
5
+ import { get as L, post as Q, patch as Z, del as z } from "../lib/commands.js";
6
6
  import { cn as x } from "../lib/utils.js";
7
- import { PickList as w } from "./imports/ServiceConfigBuilder.js";
7
+ import { PickList as S } from "./imports/ServiceConfigBuilder.js";
8
+ import { ConfirmButton as G } from "./profile/primitives.js";
8
9
  const U = [
9
10
  { value: "not_null", label: "Not null / not empty" },
10
11
  { value: "regex", label: "Regex match" },
11
12
  { value: "range", label: "Numeric range" },
12
13
  { value: "unique", label: "Unique values" },
13
14
  { value: "formula", label: "Formula (conditions)" }
14
- ], G = ["low", "medium", "high", "critical"], j = {
15
+ ], H = ["low", "medium", "high", "critical"], V = {
15
16
  low: "bg-slate-500/10 text-slate-500",
16
17
  medium: "bg-sky-500/10 text-sky-700 dark:text-sky-400",
17
18
  high: "bg-amber-500/10 text-amber-700 dark:text-amber-400",
18
19
  critical: "bg-red-500/10 text-red-700 dark:text-red-400"
19
20
  }, T = "h-8 w-full rounded-md border border-slate-200 bg-background px-2.5 text-[12.5px] text-slate-800 dark:border-border dark:text-foreground";
20
- function D({
21
+ function j({
21
22
  rule: d,
22
23
  fields: c,
23
24
  onSave: y,
24
25
  onCancel: M,
25
26
  saving: n
26
27
  }) {
27
- const g = (d == null ? void 0 : d.config) ?? {}, [N, b] = s((d == null ? void 0 : d.name) ?? ""), [o, v] = s((d == null ? void 0 : d.rule_type) ?? "not_null"), [S, F] = s((d == null ? void 0 : d.field) ?? ""), [P, R] = s((d == null ? void 0 : d.severity) ?? "medium"), [k, q] = s(String(g.pattern ?? "")), [h, I] = s(String(g.min ?? "")), [C, A] = s(String(g.max ?? "")), [$, u] = s(
28
+ const g = (d == null ? void 0 : d.config) ?? {}, [N, b] = s((d == null ? void 0 : d.name) ?? ""), [o, v] = s((d == null ? void 0 : d.rule_type) ?? "not_null"), [w, F] = s((d == null ? void 0 : d.field) ?? ""), [P, R] = s((d == null ? void 0 : d.severity) ?? "medium"), [k, q] = s(String(g.pattern ?? "")), [f, I] = s(String(g.min ?? "")), [C, A] = s(String(g.max ?? "")), [$, u] = s(
28
29
  Array.isArray(g.conditions) ? g.conditions : [{ field: "", op: "eq", value: "" }]
29
- ), i = o !== "formula", e = N.trim().length > 0 && (!i || S.length > 0) && (o !== "regex" || k.trim().length > 0), f = () => {
30
+ ), i = o !== "formula", e = N.trim().length > 0 && (!i || w.length > 0) && (o !== "regex" || k.trim().length > 0), h = () => {
30
31
  let t = null;
31
- o === "regex" && (t = { pattern: k }), o === "range" && (t = {}, h.trim() !== "" && (t.min = Number(h)), C.trim() !== "" && (t.max = Number(C))), o === "formula" && (t = { conditions: $.filter((m) => m.field) }), y({
32
+ o === "regex" && (t = { pattern: k }), o === "range" && (t = {}, f.trim() !== "" && (t.min = Number(f)), C.trim() !== "" && (t.max = Number(C))), o === "formula" && (t = { conditions: $.filter((m) => m.field) }), y({
32
33
  name: N.trim(),
33
34
  rule_type: o,
34
- field: i ? S : null,
35
+ field: i ? w : null,
35
36
  severity: P,
36
37
  config: t
37
38
  });
38
39
  };
39
- return /* @__PURE__ */ l("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
40
- /* @__PURE__ */ l("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
41
- /* @__PURE__ */ a("input", { value: N, onChange: (t) => b(t.target.value), placeholder: "Rule name", className: T }),
42
- /* @__PURE__ */ a(
43
- w,
40
+ return /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
41
+ /* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
42
+ /* @__PURE__ */ l(
43
+ "input",
44
+ {
45
+ value: N,
46
+ onChange: (t) => b(t.target.value),
47
+ placeholder: "Rule name",
48
+ className: T
49
+ }
50
+ ),
51
+ /* @__PURE__ */ l(
52
+ S,
44
53
  {
45
54
  value: o,
46
55
  onChange: (t) => v(t),
@@ -48,25 +57,25 @@ function D({
48
57
  placeholder: "Rule type"
49
58
  }
50
59
  ),
51
- i && /* @__PURE__ */ a(
52
- w,
60
+ i && /* @__PURE__ */ l(
61
+ S,
53
62
  {
54
- value: S,
63
+ value: w,
55
64
  onChange: F,
56
65
  options: c.map((t) => ({ value: t.field, label: t.field })),
57
66
  placeholder: "Field…"
58
67
  }
59
68
  ),
60
- /* @__PURE__ */ a(
61
- w,
69
+ /* @__PURE__ */ l(
70
+ S,
62
71
  {
63
72
  value: P,
64
73
  onChange: (t) => R(t),
65
- options: G.map((t) => ({ value: t, label: t })),
74
+ options: H.map((t) => ({ value: t, label: t })),
66
75
  placeholder: "Severity"
67
76
  }
68
77
  ),
69
- o === "regex" && /* @__PURE__ */ a(
78
+ o === "regex" && /* @__PURE__ */ l(
70
79
  "input",
71
80
  {
72
81
  value: k,
@@ -75,16 +84,34 @@ function D({
75
84
  className: x(T, "col-span-full font-mono")
76
85
  }
77
86
  ),
78
- o === "range" && /* @__PURE__ */ l(O, { children: [
79
- /* @__PURE__ */ a("input", { value: h, onChange: (t) => I(t.target.value), type: "number", placeholder: "Min (optional)", className: T }),
80
- /* @__PURE__ */ a("input", { value: C, onChange: (t) => A(t.target.value), type: "number", placeholder: "Max (optional)", className: T })
87
+ o === "range" && /* @__PURE__ */ a(O, { children: [
88
+ /* @__PURE__ */ l(
89
+ "input",
90
+ {
91
+ value: f,
92
+ onChange: (t) => I(t.target.value),
93
+ type: "number",
94
+ placeholder: "Min (optional)",
95
+ className: T
96
+ }
97
+ ),
98
+ /* @__PURE__ */ l(
99
+ "input",
100
+ {
101
+ value: C,
102
+ onChange: (t) => A(t.target.value),
103
+ type: "number",
104
+ placeholder: "Max (optional)",
105
+ className: T
106
+ }
107
+ )
81
108
  ] })
82
109
  ] }),
83
- o === "formula" && /* @__PURE__ */ l("div", { className: "mt-2 space-y-1.5", children: [
84
- /* @__PURE__ */ a("p", { className: "text-[11px] text-slate-400", children: "A record FAILS when every condition matches (flag rows where amount > 0 AND status is null, say)." }),
85
- $.map((t, m) => /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
86
- /* @__PURE__ */ a("div", { className: "w-[180px]", children: /* @__PURE__ */ a(
87
- w,
110
+ o === "formula" && /* @__PURE__ */ a("div", { className: "mt-2 space-y-1.5", children: [
111
+ /* @__PURE__ */ l("p", { className: "text-[11px] text-slate-400", children: "A record FAILS when every condition matches (flag rows where amount > 0 AND status is null, say)." }),
112
+ $.map((t, m) => /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
113
+ /* @__PURE__ */ l("div", { className: "w-[180px]", children: /* @__PURE__ */ l(
114
+ S,
88
115
  {
89
116
  value: t.field,
90
117
  onChange: (r) => u((_) => _.map((p, E) => E === m ? { ...p, field: r } : p)),
@@ -92,8 +119,8 @@ function D({
92
119
  placeholder: "Field…"
93
120
  }
94
121
  ) }),
95
- /* @__PURE__ */ a("div", { className: "w-[120px]", children: /* @__PURE__ */ a(
96
- w,
122
+ /* @__PURE__ */ l("div", { className: "w-[120px]", children: /* @__PURE__ */ l(
123
+ S,
97
124
  {
98
125
  value: t.op,
99
126
  onChange: (r) => u((_) => _.map((p, E) => E === m ? { ...p, op: r } : p)),
@@ -111,16 +138,18 @@ function D({
111
138
  placeholder: "Op"
112
139
  }
113
140
  ) }),
114
- t.op !== "null" && t.op !== "nnull" && /* @__PURE__ */ a(
141
+ t.op !== "null" && t.op !== "nnull" && /* @__PURE__ */ l(
115
142
  "input",
116
143
  {
117
144
  value: t.value,
118
- onChange: (r) => u((_) => _.map((p, E) => E === m ? { ...p, value: r.target.value } : p)),
145
+ onChange: (r) => u(
146
+ (_) => _.map((p, E) => E === m ? { ...p, value: r.target.value } : p)
147
+ ),
119
148
  placeholder: "Value",
120
149
  className: x(T, "flex-1")
121
150
  }
122
151
  ),
123
- /* @__PURE__ */ a(
152
+ /* @__PURE__ */ l(
124
153
  "button",
125
154
  {
126
155
  type: "button",
@@ -130,7 +159,7 @@ function D({
130
159
  }
131
160
  )
132
161
  ] }, m)),
133
- /* @__PURE__ */ a(
162
+ /* @__PURE__ */ l(
134
163
  "button",
135
164
  {
136
165
  type: "button",
@@ -140,23 +169,31 @@ function D({
140
169
  }
141
170
  )
142
171
  ] }),
143
- /* @__PURE__ */ l("div", { className: "mt-2.5 flex items-center gap-2", children: [
144
- /* @__PURE__ */ a(
172
+ /* @__PURE__ */ a("div", { className: "mt-2.5 flex items-center gap-2", children: [
173
+ /* @__PURE__ */ l(
145
174
  "button",
146
175
  {
147
176
  type: "button",
148
177
  disabled: !e || n,
149
- onClick: f,
178
+ onClick: h,
150
179
  className: "h-7 rounded-md bg-nvr-cyan px-3 text-[12px] font-medium text-white disabled:opacity-50",
151
180
  children: n ? "Saving…" : d ? "Save rule" : "Create rule"
152
181
  }
153
182
  ),
154
- /* @__PURE__ */ a("button", { type: "button", onClick: M, className: "text-[12px] text-slate-400 hover:text-slate-600", children: "Cancel" })
183
+ /* @__PURE__ */ l(
184
+ "button",
185
+ {
186
+ type: "button",
187
+ onClick: M,
188
+ className: "text-[12px] text-slate-400 hover:text-slate-600",
189
+ children: "Cancel"
190
+ }
191
+ )
155
192
  ] })
156
193
  ] });
157
194
  }
158
- function ne({ className: d }) {
159
- const c = W(), y = Z(), M = Y(), [n, g] = s(""), [N, b] = s(!1), [o, v] = s(null), [S, F] = s(null), { data: P = [] } = K({
195
+ function ie({ className: d }) {
196
+ const c = B(), y = W(), M = Y(), [n, g] = s(""), [N, b] = s(!1), [o, v] = s(null), [w, F] = s(null), { data: P = [] } = K({
160
197
  queryKey: ["dqv-collections"],
161
198
  queryFn: () => c.request(L("/collections")).then((e) => e.data ?? []),
162
199
  staleTime: 6e4
@@ -169,35 +206,35 @@ function ne({ className: d }) {
169
206
  queryKey: ["dqv-rules", n],
170
207
  queryFn: () => c.request(L("/data-quality/rules", { collection: n })).then((e) => e.data ?? []),
171
208
  enabled: !!n
172
- }), { data: h = [] } = K({
209
+ }), { data: f = [] } = K({
173
210
  queryKey: ["dqv-runs", n],
174
211
  queryFn: () => c.request(L("/data-quality/runs", { collection: n })).then((e) => e.data ?? []),
175
212
  enabled: !!n
176
- }), I = () => void M.invalidateQueries({ queryKey: ["dqv-rules", n] }), C = Q({
177
- mutationFn: (e) => c.request(V("/data-quality/rules", { ...e, collection: n })),
213
+ }), I = () => void M.invalidateQueries({ queryKey: ["dqv-rules", n] }), C = D({
214
+ mutationFn: (e) => c.request(Q("/data-quality/rules", { ...e, collection: n })),
178
215
  onSuccess: () => {
179
216
  b(!1), I();
180
217
  }
181
- }), A = Q({
182
- mutationFn: ({ id: e, body: f }) => c.request(z(`/data-quality/rules/${e}`, f)),
218
+ }), A = D({
219
+ mutationFn: ({ id: e, body: h }) => c.request(Z(`/data-quality/rules/${e}`, h)),
183
220
  onSuccess: () => {
184
221
  v(null), I();
185
222
  }
186
- }), $ = Q({
187
- mutationFn: (e) => c.request(B(`/data-quality/rules/${e}`)),
223
+ }), $ = D({
224
+ mutationFn: (e) => c.request(z(`/data-quality/rules/${e}`)),
188
225
  onSuccess: I
189
- }), u = Q({
190
- mutationFn: () => c.request(V(`/data-quality/run/${n}`, {})),
226
+ }), u = D({
227
+ mutationFn: () => c.request(Q(`/data-quality/run/${n}`, {})),
191
228
  onSuccess: (e) => {
192
229
  F(e.data.id), M.invalidateQueries({ queryKey: ["dqv-runs", n] });
193
230
  }
194
- }), i = h.find((e) => e.id === S) ?? h[0] ?? null;
195
- return /* @__PURE__ */ l("div", { className: x("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-6", d), children: [
196
- /* @__PURE__ */ l("div", { className: "flex flex-wrap items-end gap-3", children: [
197
- /* @__PURE__ */ l("div", { className: "w-[280px]", children: [
198
- /* @__PURE__ */ a("p", { className: "mb-1 text-[11.5px] font-medium text-slate-600 dark:text-muted-foreground", children: "Collection" }),
199
- /* @__PURE__ */ a(
200
- w,
231
+ }), i = f.find((e) => e.id === w) ?? f[0] ?? null;
232
+ return /* @__PURE__ */ a("div", { className: x("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-6", d), children: [
233
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-end gap-3", children: [
234
+ /* @__PURE__ */ a("div", { className: "w-[280px]", children: [
235
+ /* @__PURE__ */ l("p", { className: "mb-1 text-[11.5px] font-medium text-slate-600 dark:text-muted-foreground", children: "Collection" }),
236
+ /* @__PURE__ */ l(
237
+ S,
201
238
  {
202
239
  value: n,
203
240
  onChange: (e) => {
@@ -208,7 +245,7 @@ function ne({ className: d }) {
208
245
  }
209
246
  )
210
247
  ] }),
211
- n && /* @__PURE__ */ a(
248
+ n && /* @__PURE__ */ l(
212
249
  "button",
213
250
  {
214
251
  type: "button",
@@ -218,18 +255,18 @@ function ne({ className: d }) {
218
255
  children: u.isPending ? "Inspecting…" : "Run inspection"
219
256
  }
220
257
  ),
221
- u.isError && /* @__PURE__ */ a("span", { className: "text-[12px] text-red-600 dark:text-red-400", children: "Inspection failed." })
258
+ u.isError && /* @__PURE__ */ l("span", { className: "text-[12px] text-red-600 dark:text-red-400", children: "Inspection failed." })
222
259
  ] }),
223
- !n && /* @__PURE__ */ a("p", { className: "text-[12.5px] text-slate-400", children: "Pick a collection to manage its quality rules — not-null, regex, range, unique, and formula checks with run history." }),
224
- n && /* @__PURE__ */ l("div", { className: "grid grid-cols-1 gap-4 lg:grid-cols-2", children: [
225
- /* @__PURE__ */ l("div", { className: "space-y-2", children: [
226
- /* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
227
- /* @__PURE__ */ l("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: [
260
+ !n && /* @__PURE__ */ l("p", { className: "text-[12.5px] text-slate-400", children: "Pick a collection to manage its quality rules — not-null, regex, range, unique, and formula checks with run history." }),
261
+ n && /* @__PURE__ */ a("div", { className: "grid grid-cols-1 gap-4 lg:grid-cols-2", children: [
262
+ /* @__PURE__ */ a("div", { className: "space-y-2", children: [
263
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
264
+ /* @__PURE__ */ a("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: [
228
265
  "Rules (",
229
266
  q.length,
230
267
  ")"
231
268
  ] }),
232
- /* @__PURE__ */ a(
269
+ /* @__PURE__ */ l(
233
270
  "button",
234
271
  {
235
272
  type: "button",
@@ -241,8 +278,8 @@ function ne({ className: d }) {
241
278
  }
242
279
  )
243
280
  ] }),
244
- N && /* @__PURE__ */ a(
245
- D,
281
+ N && /* @__PURE__ */ l(
282
+ j,
246
283
  {
247
284
  rule: null,
248
285
  fields: k,
@@ -253,9 +290,9 @@ function ne({ className: d }) {
253
290
  ),
254
291
  q.map(
255
292
  (e) => {
256
- var f;
257
- return o === e.id ? /* @__PURE__ */ a(
258
- D,
293
+ var h;
294
+ return o === e.id ? /* @__PURE__ */ l(
295
+ j,
259
296
  {
260
297
  rule: e,
261
298
  fields: k,
@@ -264,7 +301,7 @@ function ne({ className: d }) {
264
301
  onCancel: () => v(null)
265
302
  },
266
303
  e.id
267
- ) : /* @__PURE__ */ l(
304
+ ) : /* @__PURE__ */ a(
268
305
  "div",
269
306
  {
270
307
  className: x(
@@ -272,20 +309,29 @@ function ne({ className: d }) {
272
309
  !e.is_active && "opacity-60"
273
310
  ),
274
311
  children: [
275
- /* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
276
- /* @__PURE__ */ l("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-foreground", children: [
312
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
313
+ /* @__PURE__ */ a("p", { className: "text-[12.5px] font-medium text-slate-700 dark:text-foreground", children: [
277
314
  e.name,
278
- /* @__PURE__ */ a("span", { className: x("ml-2 rounded px-1.5 py-px text-[10px] font-medium uppercase", j[e.severity]), children: e.severity })
315
+ /* @__PURE__ */ l(
316
+ "span",
317
+ {
318
+ className: x(
319
+ "ml-2 rounded px-1.5 py-px text-[10px] font-medium uppercase",
320
+ V[e.severity]
321
+ ),
322
+ children: e.severity
323
+ }
324
+ )
279
325
  ] }),
280
- /* @__PURE__ */ l("p", { className: "text-[11px] text-slate-400", children: [
281
- ((f = U.find((t) => t.value === e.rule_type)) == null ? void 0 : f.label) ?? e.rule_type,
282
- e.field && /* @__PURE__ */ l("span", { className: "font-mono", children: [
326
+ /* @__PURE__ */ a("p", { className: "text-[11px] text-slate-400", children: [
327
+ ((h = U.find((t) => t.value === e.rule_type)) == null ? void 0 : h.label) ?? e.rule_type,
328
+ e.field && /* @__PURE__ */ a("span", { className: "font-mono", children: [
283
329
  " · ",
284
330
  e.field
285
331
  ] })
286
332
  ] })
287
333
  ] }),
288
- /* @__PURE__ */ a(
334
+ /* @__PURE__ */ l(
289
335
  "button",
290
336
  {
291
337
  type: "button",
@@ -297,7 +343,7 @@ function ne({ className: d }) {
297
343
  children: e.is_active ? "Active" : "Off"
298
344
  }
299
345
  ),
300
- /* @__PURE__ */ a(
346
+ /* @__PURE__ */ l(
301
347
  "button",
302
348
  {
303
349
  type: "button",
@@ -308,14 +354,15 @@ function ne({ className: d }) {
308
354
  children: "Edit"
309
355
  }
310
356
  ),
311
- /* @__PURE__ */ a(
312
- "button",
357
+ /* @__PURE__ */ l(
358
+ G,
313
359
  {
314
- type: "button",
315
- onClick: () => {
316
- window.confirm(`Delete rule "${e.name}"?`) && $.mutate(e.id);
317
- },
360
+ onConfirm: () => $.mutate(e.id),
361
+ title: "Delete rule",
362
+ confirmLabel: "Delete?",
363
+ confirmTitle: `Delete rule "${e.name}"?`,
318
364
  className: "text-[13px] text-slate-300 hover:text-red-500",
365
+ armedClassName: "rounded bg-red-50 px-1.5 text-[11px] font-semibold text-red-700 hover:text-red-700 dark:bg-red-500/10 dark:text-red-400",
319
366
  children: "✕"
320
367
  }
321
368
  )
@@ -325,12 +372,12 @@ function ne({ className: d }) {
325
372
  );
326
373
  }
327
374
  ),
328
- q.length === 0 && !N && /* @__PURE__ */ a("p", { className: "text-[12px] text-slate-400", children: "No rules yet for this collection." })
375
+ q.length === 0 && !N && /* @__PURE__ */ l("p", { className: "text-[12px] text-slate-400", children: "No rules yet for this collection." })
329
376
  ] }),
330
- /* @__PURE__ */ l("div", { className: "space-y-2", children: [
331
- /* @__PURE__ */ a("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "Run history" }),
332
- h.length === 0 && /* @__PURE__ */ a("p", { className: "text-[12px] text-slate-400", children: "No inspections yet." }),
333
- h.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1.5", children: h.slice(0, 12).map((e) => /* @__PURE__ */ l(
377
+ /* @__PURE__ */ a("div", { className: "space-y-2", children: [
378
+ /* @__PURE__ */ l("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "Run history" }),
379
+ f.length === 0 && /* @__PURE__ */ l("p", { className: "text-[12px] text-slate-400", children: "No inspections yet." }),
380
+ f.length > 0 && /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1.5", children: f.slice(0, 12).map((e) => /* @__PURE__ */ a(
334
381
  "button",
335
382
  {
336
383
  type: "button",
@@ -341,60 +388,87 @@ function ne({ className: d }) {
341
388
  ),
342
389
  children: [
343
390
  new Date(e.started_at).toLocaleString(),
344
- (e.failed_records ?? 0) > 0 && /* @__PURE__ */ a("span", { className: "ml-1 font-medium text-red-600 dark:text-red-400", children: e.failed_records })
391
+ (e.failed_records ?? 0) > 0 && /* @__PURE__ */ l("span", { className: "ml-1 font-medium text-red-600 dark:text-red-400", children: e.failed_records })
345
392
  ]
346
393
  },
347
394
  e.id
348
395
  )) }),
349
- i && /* @__PURE__ */ l("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
350
- /* @__PURE__ */ l("p", { className: "text-[12px] text-slate-600 dark:text-muted-foreground", children: [
396
+ i && /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
397
+ /* @__PURE__ */ a("p", { className: "text-[12px] text-slate-600 dark:text-muted-foreground", children: [
351
398
  i.total_records ?? "?",
352
399
  " records checked ·",
353
400
  " ",
354
- /* @__PURE__ */ l("span", { className: x((i.failed_records ?? 0) > 0 && "font-medium text-red-600 dark:text-red-400"), children: [
355
- i.failed_records ?? 0,
356
- " failing"
357
- ] })
401
+ /* @__PURE__ */ a(
402
+ "span",
403
+ {
404
+ className: x(
405
+ (i.failed_records ?? 0) > 0 && "font-medium text-red-600 dark:text-red-400"
406
+ ),
407
+ children: [
408
+ i.failed_records ?? 0,
409
+ " failing"
410
+ ]
411
+ }
412
+ )
358
413
  ] }),
359
- /* @__PURE__ */ a("div", { className: "mt-2 space-y-1.5", children: (i.results ?? []).map((e) => {
360
- var f;
361
- return /* @__PURE__ */ l("div", { className: "rounded-md border border-slate-100 px-2.5 py-1.5 dark:border-border", children: [
362
- /* @__PURE__ */ l("p", { className: "text-[12px] text-slate-700 dark:text-foreground", children: [
363
- e.name,
364
- /* @__PURE__ */ a("span", { className: x("ml-2 rounded px-1.5 py-px text-[10px] font-medium uppercase", j[e.severity] ?? ""), children: e.severity }),
365
- /* @__PURE__ */ a(
366
- "span",
367
- {
368
- className: x(
369
- "ml-2 text-[11.5px]",
370
- e.failed_count > 0 ? "font-medium text-red-600 dark:text-red-400" : "text-emerald-600 dark:text-emerald-400"
414
+ /* @__PURE__ */ l("div", { className: "mt-2 space-y-1.5", children: (i.results ?? []).map((e) => {
415
+ var h;
416
+ return /* @__PURE__ */ a(
417
+ "div",
418
+ {
419
+ className: "rounded-md border border-slate-100 px-2.5 py-1.5 dark:border-border",
420
+ children: [
421
+ /* @__PURE__ */ a("p", { className: "text-[12px] text-slate-700 dark:text-foreground", children: [
422
+ e.name,
423
+ /* @__PURE__ */ l(
424
+ "span",
425
+ {
426
+ className: x(
427
+ "ml-2 rounded px-1.5 py-px text-[10px] font-medium uppercase",
428
+ V[e.severity] ?? ""
429
+ ),
430
+ children: e.severity
431
+ }
371
432
  ),
372
- children: e.error ? `error: ${e.error}` : e.failed_count > 0 ? `${e.failed_count} failing` : "pass"
373
- }
374
- )
375
- ] }),
376
- ((f = e.sample_ids) == null ? void 0 : f.length) > 0 && /* @__PURE__ */ l("p", { className: "mt-0.5 flex flex-wrap gap-1 text-[11px]", children: [
377
- e.sample_ids.slice(0, 10).map((t) => /* @__PURE__ */ a(
378
- "button",
379
- {
380
- type: "button",
381
- onClick: () => {
382
- var r;
383
- const m = (r = y.itemUrl) == null ? void 0 : r.call(y, { collection: i.collection, itemId: String(t) });
384
- m && y.navigate(m);
385
- },
386
- className: "rounded bg-slate-500/10 px-1.5 py-px font-mono text-slate-600 underline decoration-dotted underline-offset-2 hover:text-slate-800 dark:text-muted-foreground",
387
- children: String(t)
388
- },
389
- String(t)
390
- )),
391
- e.failed_count > 10 && /* @__PURE__ */ l("span", { className: "text-slate-400", children: [
392
- "+",
393
- e.failed_count - 10,
394
- " more"
395
- ] })
396
- ] })
397
- ] }, e.rule_id);
433
+ /* @__PURE__ */ l(
434
+ "span",
435
+ {
436
+ className: x(
437
+ "ml-2 text-[11.5px]",
438
+ e.failed_count > 0 ? "font-medium text-red-600 dark:text-red-400" : "text-emerald-600 dark:text-emerald-400"
439
+ ),
440
+ children: e.error ? `error: ${e.error}` : e.failed_count > 0 ? `${e.failed_count} failing` : "pass"
441
+ }
442
+ )
443
+ ] }),
444
+ ((h = e.sample_ids) == null ? void 0 : h.length) > 0 && /* @__PURE__ */ a("p", { className: "mt-0.5 flex flex-wrap gap-1 text-[11px]", children: [
445
+ e.sample_ids.slice(0, 10).map((t) => /* @__PURE__ */ l(
446
+ "button",
447
+ {
448
+ type: "button",
449
+ onClick: () => {
450
+ var r;
451
+ const m = (r = y.itemUrl) == null ? void 0 : r.call(y, {
452
+ collection: i.collection,
453
+ itemId: String(t)
454
+ });
455
+ m && y.navigate(m);
456
+ },
457
+ className: "rounded bg-slate-500/10 px-1.5 py-px font-mono text-slate-600 underline decoration-dotted underline-offset-2 hover:text-slate-800 dark:text-muted-foreground",
458
+ children: String(t)
459
+ },
460
+ String(t)
461
+ )),
462
+ e.failed_count > 10 && /* @__PURE__ */ a("span", { className: "text-slate-400", children: [
463
+ "+",
464
+ e.failed_count - 10,
465
+ " more"
466
+ ] })
467
+ ] })
468
+ ]
469
+ },
470
+ e.rule_id
471
+ );
398
472
  }) })
399
473
  ] })
400
474
  ] })
@@ -402,5 +476,5 @@ function ne({ className: d }) {
402
476
  ] });
403
477
  }
404
478
  export {
405
- ne as QualityRulesView
479
+ ie as QualityRulesView
406
480
  };