@nivaro/react 0.3.93 → 0.3.95

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,4 +1,4 @@
1
- import { jsxs as r, jsx as a, Fragment as k } from "react/jsx-runtime";
1
+ import { jsxs as s, jsx as a, Fragment as k } from "react/jsx-runtime";
2
2
  import { useQuery as y } from "@tanstack/react-query";
3
3
  import { ChevronDown as v, HelpCircle as L } from "lucide-react";
4
4
  import { useState as C } from "react";
@@ -8,8 +8,8 @@ import { cn as f } from "../../lib/utils.js";
8
8
  import { changeLines as $ } from "./changes-lines.js";
9
9
  import { describeDelivery as q } from "./DeliveryChips.js";
10
10
  import { WHY_KIND_LABELS as _, whyLines as S, whyChangeLinks as W, WHY_LAYER_LABELS as D } from "./why-lines.js";
11
- function E({ layer: t, role: i }) {
12
- return /* @__PURE__ */ r(
11
+ function E({ layer: t, role: d }) {
12
+ return /* @__PURE__ */ s(
13
13
  "span",
14
14
  {
15
15
  "data-why-layer": t,
@@ -21,26 +21,26 @@ function E({ layer: t, role: i }) {
21
21
  ),
22
22
  children: [
23
23
  D[t],
24
- t === "role" && i ? ` · ${i}` : ""
24
+ t === "role" && d ? ` · ${d}` : ""
25
25
  ]
26
26
  }
27
27
  );
28
28
  }
29
29
  function P({ c: t }) {
30
- return /* @__PURE__ */ r(
30
+ return /* @__PURE__ */ s(
31
31
  "li",
32
32
  {
33
33
  className: "flex flex-wrap items-baseline gap-x-1.5 text-[11px] leading-snug",
34
34
  "data-change-field": t.field,
35
35
  children: [
36
36
  /* @__PURE__ */ a("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: t.label }),
37
- t.diff ? /* @__PURE__ */ r("span", { className: "min-w-0 whitespace-pre-wrap break-words text-slate-600 dark:text-slate-300", children: [
37
+ t.diff ? /* @__PURE__ */ s("span", { className: "min-w-0 whitespace-pre-wrap break-words text-slate-600 dark:text-slate-300", children: [
38
38
  t.diff.lead,
39
39
  t.diff.removed && /* @__PURE__ */ a("span", { className: "rounded-sm bg-red-50 text-red-700 line-through decoration-red-300 dark:bg-red-500/15 dark:text-red-300", children: t.diff.removed }),
40
40
  t.diff.added && /* @__PURE__ */ a("span", { className: "rounded-sm bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300", children: t.diff.added }),
41
41
  t.diff.trail
42
- ] }) : /* @__PURE__ */ r(k, { children: [
43
- t.old !== "" && /* @__PURE__ */ r(k, { children: [
42
+ ] }) : /* @__PURE__ */ s(k, { children: [
43
+ t.old !== "" && /* @__PURE__ */ s(k, { children: [
44
44
  /* @__PURE__ */ a("span", { className: "text-slate-400 line-through decoration-slate-300", children: t.old }),
45
45
  /* @__PURE__ */ a("span", { className: "text-slate-300", children: "→" })
46
46
  ] }),
@@ -52,98 +52,98 @@ function P({ c: t }) {
52
52
  }
53
53
  function T({
54
54
  notificationId: t,
55
- className: i
55
+ className: d
56
56
  }) {
57
- const h = N(), { data: d, isLoading: x, isError: c } = y({
57
+ const h = N(), { data: i, isLoading: x, isError: c } = y({
58
58
  queryKey: ["notification-changes", t],
59
59
  staleTime: 6e4,
60
60
  retry: !1,
61
61
  queryFn: () => h.request(
62
62
  w(`/notifications/${t}/changes`)
63
- ).then((s) => s.data)
64
- }), m = $(d);
65
- return /* @__PURE__ */ r(
63
+ ).then((r) => r.data)
64
+ }), m = $(i);
65
+ return /* @__PURE__ */ s(
66
66
  "ul",
67
67
  {
68
68
  className: f(
69
69
  "mt-1 space-y-0.5 rounded-md border border-slate-100 bg-slate-50/70 px-2 py-1.5 dark:border-border/60 dark:bg-muted/40",
70
- i
70
+ d
71
71
  ),
72
72
  "data-notification-changes-list": !0,
73
73
  "data-changes-source": "reader",
74
74
  children: [
75
75
  x && /* @__PURE__ */ a("li", { className: "text-[10.5px] text-slate-400", children: "Loading what changed…" }),
76
76
  c && /* @__PURE__ */ a("li", { className: "text-[10.5px] text-slate-500 dark:text-slate-400", children: "You can't open this record now, so its changes are not shown." }),
77
- d && m.length === 0 && /* @__PURE__ */ a("li", { className: "text-[10.5px] text-slate-500 dark:text-slate-400", children: d.note ?? (d.first_revision ? "The record was created — there is no earlier version to compare." : "No changes to fields you can see.") }),
78
- m.map((s) => /* @__PURE__ */ a(P, { c: s }, s.field))
77
+ i && m.length === 0 && /* @__PURE__ */ a("li", { className: "text-[10.5px] text-slate-500 dark:text-slate-400", children: i.note ?? (i.first_revision ? "The record was created — there is no earlier version to compare." : "No changes to fields you can see.") }),
78
+ m.map((r) => /* @__PURE__ */ a(P, { c: r }, r.field))
79
79
  ]
80
80
  }
81
81
  );
82
82
  }
83
83
  function Y({
84
84
  notificationId: t,
85
- why: i,
85
+ why: d,
86
86
  delivery: h,
87
- subscriptionsPath: d,
87
+ subscriptionsPath: i,
88
88
  rulesPath: x,
89
89
  onNavigate: c
90
90
  }) {
91
- var u;
92
- const m = N(), { data: s, isLoading: b } = y({
91
+ var p;
92
+ const m = N(), { data: r, isLoading: b } = y({
93
93
  queryKey: ["notification-why", t],
94
94
  enabled: t != null,
95
95
  staleTime: 6e4,
96
96
  queryFn: () => m.request(w(`/notifications/${t}/why`)).then((e) => e.data)
97
- }), l = (s == null ? void 0 : s.reason) ?? null, o = (l == null ? void 0 : l.path) ?? (s == null ? void 0 : s.why) ?? i ?? null, n = (o == null ? void 0 : o.kind) ?? "rules", p = ((u = l == null ? void 0 : l.role) == null ? void 0 : u.name) ?? null;
98
- return /* @__PURE__ */ r(
97
+ }), l = (r == null ? void 0 : r.reason) ?? null, o = (l == null ? void 0 : l.path) ?? (r == null ? void 0 : r.why) ?? d ?? null, n = (o == null ? void 0 : o.kind) ?? "rules", u = ((p = l == null ? void 0 : l.role) == null ? void 0 : p.name) ?? null;
98
+ return /* @__PURE__ */ s(
99
99
  "div",
100
100
  {
101
101
  className: "mt-1 rounded-md border border-slate-100 bg-slate-50/70 px-2 py-1.5 text-[11px] leading-snug dark:border-border/60 dark:bg-muted/40",
102
102
  "data-notification-why-panel": !0,
103
- "data-why-recorded": s ? String(s.recorded) : void 0,
103
+ "data-why-recorded": r ? String(r.recorded) : void 0,
104
104
  children: [
105
- o && /* @__PURE__ */ r("p", { className: "text-slate-700 dark:text-slate-200", children: [
105
+ o && /* @__PURE__ */ s("p", { className: "text-slate-700 dark:text-slate-200", children: [
106
106
  /* @__PURE__ */ a("span", { className: "mr-1 rounded bg-slate-200/70 px-1 text-[9.5px] font-semibold uppercase tracking-wide text-slate-600 dark:bg-slate-700 dark:text-slate-300", children: _[n] ?? n }),
107
107
  o.text,
108
- o.label && n !== "watch" && n !== "role_default" && /* @__PURE__ */ r("span", { className: "text-slate-500 dark:text-slate-400", children: [
108
+ o.label && n !== "watch" && n !== "role_default" && /* @__PURE__ */ s("span", { className: "text-slate-500 dark:text-slate-400", children: [
109
109
  " · ",
110
110
  o.label
111
111
  ] })
112
112
  ] }),
113
113
  b && t != null && /* @__PURE__ */ a("p", { className: "mt-1 text-[10.5px] text-slate-400", children: "Looking up why…" }),
114
- s && !s.recorded && /* @__PURE__ */ a("p", { className: "mt-1 text-[10.5px] italic text-slate-500 dark:text-slate-400", "data-why-legacy": !0, children: "Sent before reasons were recorded." }),
115
- l ? /* @__PURE__ */ r(
114
+ r && !r.recorded && /* @__PURE__ */ a("p", { className: "mt-1 text-[10.5px] italic text-slate-500 dark:text-slate-400", "data-why-legacy": !0, children: "Sent before reasons were recorded." }),
115
+ l ? /* @__PURE__ */ s(
116
116
  "ul",
117
117
  {
118
118
  className: "mt-1 space-y-px text-[10.5px] text-slate-500 dark:text-slate-400",
119
119
  "data-why-rules": !0,
120
120
  children: [
121
- l.critical && /* @__PURE__ */ r("li", { children: [
121
+ l.critical && /* @__PURE__ */ s("li", { children: [
122
122
  /* @__PURE__ */ a("span", { className: "font-medium text-slate-600 dark:text-slate-300", children: "Critical:" }),
123
123
  " ",
124
124
  "mutes, quiet hours and your rules are bypassed."
125
125
  ] }),
126
- S(l).map((e) => /* @__PURE__ */ r("li", { "data-why-channel": e.key, children: [
127
- /* @__PURE__ */ r("span", { className: "font-medium text-slate-600 dark:text-slate-300", children: [
126
+ S(l).map((e) => /* @__PURE__ */ s("li", { "data-why-channel": e.key, children: [
127
+ /* @__PURE__ */ s("span", { className: "font-medium text-slate-600 dark:text-slate-300", children: [
128
128
  e.label,
129
129
  ":"
130
130
  ] }),
131
131
  " ",
132
132
  e.outcome,
133
133
  e.rule ? ` — ${e.rule}` : "",
134
- e.layer && /* @__PURE__ */ a(E, { layer: e.layer, role: p })
134
+ e.layer && /* @__PURE__ */ a(E, { layer: e.layer, role: u })
135
135
  ] }, e.key))
136
136
  ]
137
137
  }
138
- ) : /* @__PURE__ */ a("ul", { className: "mt-1 space-y-px text-[10.5px] text-slate-500 dark:text-slate-400", children: q((s == null ? void 0 : s.delivery) ?? h).map((e) => /* @__PURE__ */ r("li", { children: [
139
- /* @__PURE__ */ r("span", { className: "font-medium text-slate-600 dark:text-slate-300", children: [
138
+ ) : /* @__PURE__ */ a("ul", { className: "mt-1 space-y-px text-[10.5px] text-slate-500 dark:text-slate-400", children: q((r == null ? void 0 : r.delivery) ?? h).map((e) => /* @__PURE__ */ s("li", { children: [
139
+ /* @__PURE__ */ s("span", { className: "font-medium text-slate-600 dark:text-slate-300", children: [
140
140
  e.label,
141
141
  ":"
142
142
  ] }),
143
143
  " ",
144
144
  e.tip
145
145
  ] }, e.key)) }),
146
- /* @__PURE__ */ a("div", { className: "mt-1 flex flex-wrap gap-x-3", children: c && W(n, { subscriptionsPath: d, rulesPath: x }).map((e) => /* @__PURE__ */ a(
146
+ /* @__PURE__ */ a("div", { className: "mt-1 flex flex-wrap gap-x-3", children: c && W(n, { subscriptionsPath: i, rulesPath: x }).map((e) => /* @__PURE__ */ a(
147
147
  "button",
148
148
  {
149
149
  type: "button",
@@ -162,28 +162,28 @@ function Y({
162
162
  }
163
163
  function G({
164
164
  detail: t,
165
- why: i,
165
+ why: d,
166
166
  delivery: h,
167
- notificationId: d,
167
+ notificationId: i,
168
168
  recordChanges: x,
169
169
  subscriptionsPath: c,
170
170
  rulesPath: m,
171
- onNavigate: s,
171
+ onNavigate: r,
172
172
  className: b
173
173
  }) {
174
- const [l, o] = C(null), n = (t == null ? void 0 : t.changes) ?? [], p = !!x && d != null, u = (e) => o((g) => g === e ? null : e);
175
- return /* @__PURE__ */ r("div", { className: f("text-[10.5px]", b), "data-notification-bits": !0, children: [
176
- /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
177
- (n.length > 0 || p) && /* @__PURE__ */ r(
174
+ const [l, o] = C(null), n = (t == null ? void 0 : t.changes) ?? [], u = !!x && i != null, p = (e) => o((g) => g === e ? null : e);
175
+ return /* @__PURE__ */ s("div", { className: f("text-[10.5px]", b), "data-notification-bits": !0, children: [
176
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-1", children: [
177
+ (n.length > 0 || u) && /* @__PURE__ */ s(
178
178
  "button",
179
179
  {
180
180
  type: "button",
181
181
  onClick: (e) => {
182
- e.stopPropagation(), u("changes");
182
+ e.stopPropagation(), p("changes");
183
183
  },
184
184
  "aria-expanded": l === "changes",
185
185
  "data-notification-changes": !0,
186
- className: "inline-flex items-center gap-0.5 rounded px-1 py-px font-medium text-slate-500 hover:bg-slate-100 hover:text-slate-800 dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-100",
186
+ className: "-ml-1.5 inline-flex h-6 items-center gap-1 rounded-md px-1.5 font-medium text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-100",
187
187
  children: [
188
188
  n.length > 0 ? `${n.length} change${n.length === 1 ? "" : "s"}` : "What changed",
189
189
  /* @__PURE__ */ a(
@@ -195,37 +195,37 @@ function G({
195
195
  ]
196
196
  }
197
197
  ),
198
- (i || d != null) && /* @__PURE__ */ r(
198
+ (d || i != null) && /* @__PURE__ */ s(
199
199
  "button",
200
200
  {
201
201
  type: "button",
202
202
  onClick: (e) => {
203
- e.stopPropagation(), u("why");
203
+ e.stopPropagation(), p("why");
204
204
  },
205
205
  "aria-expanded": l === "why",
206
206
  "data-notification-why": !0,
207
- className: "inline-flex items-center gap-0.5 rounded px-1 py-px font-medium text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
207
+ className: "inline-flex h-6 items-center gap-1 rounded-md px-1.5 font-medium text-slate-500 transition-colors first:-ml-1.5 hover:bg-slate-100 hover:text-slate-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-100",
208
208
  children: [
209
- /* @__PURE__ */ a(L, { className: "h-3 w-3" }),
209
+ /* @__PURE__ */ a(L, { className: "h-3.5 w-3.5 shrink-0" }),
210
210
  "Why?"
211
211
  ]
212
212
  }
213
213
  )
214
214
  ] }),
215
- l === "changes" && p && d != null && /* @__PURE__ */ a(T, { notificationId: d }),
216
- l === "changes" && !p && /* @__PURE__ */ r(
215
+ l === "changes" && u && i != null && /* @__PURE__ */ a(T, { notificationId: i }),
216
+ l === "changes" && !u && /* @__PURE__ */ s(
217
217
  "ul",
218
218
  {
219
219
  className: "mt-1 space-y-0.5 rounded-md border border-slate-100 bg-slate-50/70 px-2 py-1.5 dark:border-border/60 dark:bg-muted/40",
220
220
  "data-notification-changes-list": !0,
221
221
  children: [
222
- n.slice(0, 20).map((e, g) => /* @__PURE__ */ r(
222
+ n.slice(0, 20).map((e, g) => /* @__PURE__ */ s(
223
223
  "li",
224
224
  {
225
225
  className: "flex flex-wrap items-baseline gap-x-1.5 text-[11px] leading-snug",
226
226
  children: [
227
227
  /* @__PURE__ */ a("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: e.label }),
228
- e.old !== "" && /* @__PURE__ */ r(k, { children: [
228
+ e.old !== "" && /* @__PURE__ */ s(k, { children: [
229
229
  /* @__PURE__ */ a("span", { className: "text-slate-400 line-through decoration-slate-300", children: e.old }),
230
230
  /* @__PURE__ */ a("span", { className: "text-slate-300", children: "→" })
231
231
  ] }),
@@ -234,7 +234,7 @@ function G({
234
234
  },
235
235
  `${e.field}-${g}`
236
236
  )),
237
- n.length > 20 && /* @__PURE__ */ r("li", { className: "text-[10.5px] text-slate-400", children: [
237
+ n.length > 20 && /* @__PURE__ */ s("li", { className: "text-[10.5px] text-slate-400", children: [
238
238
  "+",
239
239
  n.length - 20,
240
240
  " more"
@@ -245,12 +245,12 @@ function G({
245
245
  l === "why" && /* @__PURE__ */ a(
246
246
  Y,
247
247
  {
248
- notificationId: d,
249
- why: i,
248
+ notificationId: i,
249
+ why: d,
250
250
  delivery: h,
251
251
  subscriptionsPath: c,
252
252
  rulesPath: m,
253
- onNavigate: s
253
+ onNavigate: r
254
254
  }
255
255
  )
256
256
  ] });
@@ -1,127 +1,142 @@
1
- import { jsxs as o, jsx as s } from "react/jsx-runtime";
2
- import { useQuery as F, useMutation as L } from "@tanstack/react-query";
3
- import { MoveRight as O, Loader2 as T } from "lucide-react";
4
- import { useState as h, useEffect as U, useMemo as j } from "react";
5
- import { toast as z } from "sonner";
6
- import { useNivaroClient as W } from "../../context.js";
7
- import { get as B, post as K } from "../../lib/commands.js";
8
- import { toastError as Q } from "../../lib/error-toast.js";
9
- import { Button as C } from "../ui/button.js";
10
- import { SimpleSelect as V } from "../ui/SimpleSelect.js";
11
- import { Textarea as G } from "../ui/textarea.js";
12
- const $ = 5;
13
- function re({
1
+ import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
+ import { useQuery as O, useMutation as T } from "@tanstack/react-query";
3
+ import { MoveRight as C, AlertTriangle as U, Loader2 as _ } from "lucide-react";
4
+ import { useState as h, useEffect as j, useMemo as z } from "react";
5
+ import { toast as W } from "sonner";
6
+ import { useNivaroClient as B } from "../../context.js";
7
+ import { get as K, post as Q } from "../../lib/commands.js";
8
+ import { toastError as V } from "../../lib/error-toast.js";
9
+ import { Button as R } from "../ui/button.js";
10
+ import { Input as G } from "../ui/input.js";
11
+ import { SimpleSelect as H } from "../ui/SimpleSelect.js";
12
+ const I = 5;
13
+ function ne({
14
14
  collection: m,
15
15
  item: d,
16
16
  states: n,
17
- currentStateId: R,
18
- onMoved: E,
17
+ currentStateId: E,
18
+ onMoved: q,
19
19
  openSignal: x = 0,
20
20
  standalone: c = !1,
21
21
  onCancel: p
22
22
  }) {
23
- var M, w, S, P;
24
- const f = W(), [I, i] = h(c), [u, g] = h(""), [l, v] = h("");
25
- U(() => {
23
+ var M, S, P, $;
24
+ const f = B(), [A, i] = h(c), [u, b] = h(""), [l, v] = h("");
25
+ j(() => {
26
26
  x > 0 && i(!0);
27
27
  }, [x]);
28
- const { data: t, isLoading: b } = F({
28
+ const { data: s, isLoading: g } = O({
29
29
  queryKey: ["move-state-instance", m, String(d)],
30
30
  queryFn: () => f.request(
31
- B(`/pipelines/instance/${m}/${encodeURIComponent(String(d))}`)
31
+ K(`/pipelines/instance/${m}/${encodeURIComponent(String(d))}`)
32
32
  ),
33
33
  enabled: !n
34
- }), N = n ?? ((M = t == null ? void 0 : t.data) == null ? void 0 : M.states) ?? [], y = n ? R ?? null : ((S = (w = t == null ? void 0 : t.data) == null ? void 0 : w.instance) == null ? void 0 : S.current_state) ?? null, _ = !n && !b && !((P = t == null ? void 0 : t.data) != null && P.instance), q = j(
34
+ }), N = n ?? ((M = s == null ? void 0 : s.data) == null ? void 0 : M.states) ?? [], y = n ? E ?? null : ((P = (S = s == null ? void 0 : s.data) == null ? void 0 : S.instance) == null ? void 0 : P.current_state) ?? null, F = !n && !g && !(($ = s == null ? void 0 : s.data) != null && $.instance), L = z(
35
35
  () => [
36
36
  { value: "", label: "Pick a state" },
37
37
  ...N.filter((e) => String(e.id).toUpperCase() !== String(y ?? "").toUpperCase()).map((e) => ({ value: String(e.id), label: e.label }))
38
38
  ],
39
39
  [N, y]
40
- ), r = L({
40
+ ), o = T({
41
41
  mutationFn: () => f.request(
42
- K(`/pipelines/instance/${m}/${encodeURIComponent(String(d))}/move-state`, {
42
+ Q(`/pipelines/instance/${m}/${encodeURIComponent(String(d))}/move-state`, {
43
43
  to_state: u,
44
44
  reason: l.trim()
45
45
  })
46
46
  ),
47
47
  onSuccess: (e) => {
48
- const a = e == null ? void 0 : e.data;
49
- z.success(
50
- a != null && a.ended ? `Moved to ${a.to.label}, then an automatic rule took it to ${a.ended.label}` : `Moved to ${(a == null ? void 0 : a.to.label) ?? "the new state"}`
51
- ), c || i(!1), g(""), v(""), E();
48
+ const r = e == null ? void 0 : e.data;
49
+ W.success(
50
+ r != null && r.ended ? `Moved to ${r.to.label}, then an automatic rule took it to ${r.ended.label}` : `Moved to ${(r == null ? void 0 : r.to.label) ?? "the new state"}`
51
+ ), c || i(!1), b(""), v(""), q();
52
52
  },
53
- onError: (e) => Q(e, "Could not move it")
54
- }), k = l.trim().length >= $, A = !!u && k && !r.isPending;
55
- return I ? _ ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-500", "data-move-to-state-none": !0, children: "This record has no pipeline to move." }) : /* @__PURE__ */ o(
56
- "div",
53
+ onError: (e) => V(e, "Could not move it")
54
+ }), k = l.trim().length >= I, w = !!u && k && !o.isPending;
55
+ return A ? F ? /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-500", "data-move-to-state-none": !0, children: "This record has no pipeline to move." }) : /* @__PURE__ */ a(
56
+ "form",
57
57
  {
58
- className: "space-y-3 rounded-lg border border-amber-200 bg-amber-50/60 p-3 dark:border-amber-500/25 dark:bg-amber-500/[0.06]",
58
+ className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
59
59
  "data-move-to-state-form": !0,
60
+ onSubmit: (e) => {
61
+ e.preventDefault(), w && o.mutate();
62
+ },
60
63
  children: [
61
- /* @__PURE__ */ o("div", { className: "space-y-1", children: [
62
- /* @__PURE__ */ s("p", { className: "text-[12px] font-medium text-slate-800 dark:text-slate-200", children: "Move to state" }),
63
- /* @__PURE__ */ s("p", { className: "text-[11px] leading-relaxed text-slate-600 dark:text-slate-400", children: "Administrators only. Puts this record straight into the state you pick. No transition steps run: no Fusion or MWF pushes, emails or flows. Automatic rules are checked again afterwards, so it may move on by itself." })
64
+ /* @__PURE__ */ a("div", { className: "flex items-start gap-2.5 border-b border-slate-100 px-4 py-3 dark:border-border/60", children: [
65
+ /* @__PURE__ */ t(C, { className: "mt-0.5 h-4 w-4 shrink-0 text-slate-400" }),
66
+ /* @__PURE__ */ a("div", { className: "min-w-0 space-y-0.5", children: [
67
+ /* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-100", children: "Move to state" }),
68
+ /* @__PURE__ */ a("p", { className: "flex items-center gap-1.5 text-[12px] text-amber-700 dark:text-amber-300", children: [
69
+ /* @__PURE__ */ t(U, { className: "h-3.5 w-3.5 shrink-0" }),
70
+ "Skips the transition: no Fusion or MWF pushes, emails or flows run."
71
+ ] })
72
+ ] })
64
73
  ] }),
65
- /* @__PURE__ */ o("div", { className: "grid gap-2 sm:grid-cols-[minmax(0,220px)_1fr]", children: [
66
- /* @__PURE__ */ s(
67
- V,
68
- {
69
- value: u,
70
- onChange: g,
71
- options: q,
72
- ariaLabel: "New state",
73
- disabled: r.isPending || !n && b
74
- }
75
- ),
76
- /* @__PURE__ */ s(
77
- G,
78
- {
79
- value: l,
80
- onChange: (e) => v(e.target.value),
81
- placeholder: "Why? Saved in the history.",
82
- rows: 2,
83
- maxLength: 500,
84
- disabled: r.isPending,
85
- className: "min-h-[38px] text-[12px]",
86
- "aria-label": "Reason"
87
- }
88
- )
89
- ] }),
90
- /* @__PURE__ */ o("div", { className: "flex items-center justify-end gap-2", children: [
91
- !k && l.length > 0 && /* @__PURE__ */ o("span", { className: "mr-auto text-[11px] text-slate-500", children: [
92
- "A few more words, please (",
93
- $,
94
- " characters or more)."
74
+ /* @__PURE__ */ a("div", { className: "space-y-3 px-4 py-3.5", children: [
75
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-start gap-x-4 gap-y-3", children: [
76
+ /* @__PURE__ */ a("div", { className: "w-full space-y-1.5 sm:w-60", children: [
77
+ /* @__PURE__ */ t("span", { className: "block text-[12px] font-medium text-slate-600 dark:text-slate-300", children: "New state" }),
78
+ /* @__PURE__ */ t(
79
+ H,
80
+ {
81
+ value: u,
82
+ onChange: b,
83
+ options: L,
84
+ ariaLabel: "New state",
85
+ className: "h-8 text-[12.5px]",
86
+ disabled: o.isPending || !n && g
87
+ }
88
+ )
89
+ ] }),
90
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1 basis-72 space-y-1.5", children: [
91
+ /* @__PURE__ */ t("span", { className: "block text-[12px] font-medium text-slate-600 dark:text-slate-300", children: "Reason" }),
92
+ /* @__PURE__ */ t(
93
+ G,
94
+ {
95
+ value: l,
96
+ onChange: (e) => v(e.target.value),
97
+ placeholder: "Why it moves — saved in the history",
98
+ maxLength: 500,
99
+ disabled: o.isPending,
100
+ className: "h-8 text-[12.5px]",
101
+ "aria-label": "Reason",
102
+ "aria-describedby": "move-state-hint"
103
+ }
104
+ )
105
+ ] })
95
106
  ] }),
96
- /* @__PURE__ */ s(
97
- C,
98
- {
99
- size: "sm",
100
- variant: "ghost",
101
- className: "h-7 text-[12px]",
102
- onClick: () => c ? p == null ? void 0 : p() : i(!1),
103
- disabled: r.isPending,
104
- children: "Cancel"
105
- }
106
- ),
107
- /* @__PURE__ */ o(
108
- C,
109
- {
110
- size: "sm",
111
- className: "h-7 gap-1.5 bg-nvr-cyan text-[12px] text-white hover:bg-nvr-cyan/90",
112
- onClick: () => r.mutate(),
113
- disabled: !A,
114
- "data-move-to-state-submit": !0,
115
- children: [
116
- r.isPending && /* @__PURE__ */ s(T, { className: "h-3 w-3 animate-spin" }),
117
- "Move"
118
- ]
119
- }
120
- )
107
+ /* @__PURE__ */ t("p", { id: "move-state-hint", className: "text-[11.5px] text-slate-500 dark:text-slate-400", children: !k && l.length > 0 ? `A few more words, please (${I} characters or more).` : "Automatic rules are checked again afterwards, so the record may move on by itself." }),
108
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
109
+ /* @__PURE__ */ a(
110
+ R,
111
+ {
112
+ type: "submit",
113
+ size: "sm",
114
+ className: "h-8 gap-1.5 bg-nvr-cyan px-3.5 text-[12.5px] text-white hover:bg-nvr-cyan/90",
115
+ disabled: !w,
116
+ "data-move-to-state-submit": !0,
117
+ children: [
118
+ o.isPending && /* @__PURE__ */ t(_, { className: "h-3.5 w-3.5 animate-spin" }),
119
+ "Move"
120
+ ]
121
+ }
122
+ ),
123
+ /* @__PURE__ */ t(
124
+ R,
125
+ {
126
+ type: "button",
127
+ size: "sm",
128
+ variant: "ghost",
129
+ className: "h-8 text-[12.5px]",
130
+ onClick: () => c ? p == null ? void 0 : p() : i(!1),
131
+ disabled: o.isPending,
132
+ children: "Cancel"
133
+ }
134
+ )
135
+ ] })
121
136
  ] })
122
137
  ]
123
138
  }
124
- ) : /* @__PURE__ */ o(
139
+ ) : /* @__PURE__ */ a(
125
140
  "button",
126
141
  {
127
142
  type: "button",
@@ -129,13 +144,13 @@ function re({
129
144
  onClick: () => i(!0),
130
145
  "data-move-to-state-open": !0,
131
146
  children: [
132
- /* @__PURE__ */ s(O, { className: "h-3.5 w-3.5" }),
147
+ /* @__PURE__ */ t(C, { className: "h-3.5 w-3.5" }),
133
148
  "Move to state…"
134
149
  ]
135
150
  }
136
151
  );
137
152
  }
138
153
  export {
139
- $ as MOVE_REASON_MIN,
140
- re as MoveToStatePanel
154
+ I as MOVE_REASON_MIN,
155
+ ne as MoveToStatePanel
141
156
  };