@tetrascience-npm/tetrascience-react-ui 0.5.0-beta.71.1 → 0.5.0-beta.72.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.
@@ -1,422 +1,341 @@
1
- import { jsxs as d, jsx as l, Fragment as le } from "react/jsx-runtime";
1
+ import { jsxs as v, jsx as a } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
- import { plateOptionsFromCsvTriage as yt } from "./csvPlateTriage.js";
4
- import { PlateMapActionsMenu as St } from "./PlateMapActionsMenu.js";
5
- import { PlateMapPlateSelector as Nt } from "./PlateMapPlateSelector.js";
6
- import { PlatePaintGrid as wt } from "./PlatePaintGrid.js";
7
- import { allPositions as Et, resolveDimensions as At } from "./wellGrid.js";
8
- import { WellManifestTable as Mt } from "./WellManifestTable.js";
9
- import { WellMetadataForm as Ct } from "./WellMetadataForm.js";
10
- import { Badge as kt } from "../../ui/badge.js";
11
- import { Card as j, CardContent as D, CardHeader as te, CardTitle as ne, CardAction as Wt } from "../../ui/card.js";
12
- import { Separator as ae } from "../../ui/separator.js";
13
- import { cn as re } from "../../../lib/utils.js";
14
- const oe = "::", zt = "plateBarcode", Ft = "Plate Barcode";
15
- function Tt(n, r) {
16
- return `${n}${oe}${r}`;
3
+ import { plateOptionsFromCsvTriage as ut } from "./csvPlateTriage.js";
4
+ import { PlateMapActionsMenu as mt } from "./PlateMapActionsMenu.js";
5
+ import { PlateMapForm as pt } from "./PlateMapForm.js";
6
+ import { PlateMapGrid as ht } from "./PlateMapGrid.js";
7
+ import { PlateMapManifest as xt } from "./PlateMapManifest.js";
8
+ import { PlateMapPlateSelector as vt } from "./PlateMapPlateSelector.js";
9
+ import { Badge as Pt } from "../../ui/badge.js";
10
+ import { Card as F, CardContent as _, CardHeader as X, CardTitle as Z, CardAction as gt } from "../../ui/card.js";
11
+ import { cn as Mt } from "../../../lib/utils.js";
12
+ const ee = "::", St = "plateBarcode", Et = "Plate Barcode";
13
+ function bt(t, n) {
14
+ return `${t}${ee}${n}`;
17
15
  }
18
- function se(n, r) {
19
- const s = `${n}${oe}`;
20
- return r.startsWith(s) ? r.slice(s.length) : void 0;
16
+ function te(t, n) {
17
+ const l = `${t}${ee}`;
18
+ return n.startsWith(l) ? n.slice(l.length) : void 0;
21
19
  }
22
- function Bt(n, r) {
23
- return { ...n ?? {}, ...r };
20
+ function wt(t, n) {
21
+ return { ...t ?? {}, ...n };
24
22
  }
25
- function Lt(n, r) {
26
- const s = /* @__PURE__ */ new Map();
27
- return n.forEach((i) => s.set(i.id, i)), (r ?? []).forEach((i) => s.set(i.id, i)), [...s.values()];
23
+ function Ct(t, n) {
24
+ const l = /* @__PURE__ */ new Map();
25
+ return t.forEach((s) => l.set(s.id, s)), (n ?? []).forEach((s) => l.set(s.id, s)), [...l.values()];
28
26
  }
29
- function _t(n, r) {
30
- const s = n.find((i) => i.id === r);
31
- return s || (r ? void 0 : n[0]);
27
+ function At(t, n) {
28
+ const l = t.find((s) => s.id === n);
29
+ return l || (n ? void 0 : t[0]);
32
30
  }
33
- function jt(n, r) {
34
- if (!r) return n;
35
- const s = /* @__PURE__ */ new Map();
36
- return n.forEach((i, p) => {
37
- const u = se(r, p);
38
- u && s.set(u, i);
39
- }), s;
31
+ function Nt(t, n) {
32
+ if (!n) return t;
33
+ const l = /* @__PURE__ */ new Map();
34
+ return t.forEach((s, m) => {
35
+ const c = te(n, m);
36
+ c && l.set(c, s);
37
+ }), l;
40
38
  }
41
- function Dt({
42
- importedPlates: n,
43
- selectedPlateId: r,
44
- isControlled: s,
45
- providedPlateCount: i
39
+ function Wt({
40
+ importedPlates: t,
41
+ selectedPlateId: n,
42
+ isControlled: l,
43
+ providedPlateCount: s
46
44
  }) {
47
- const p = n[0]?.id;
48
- return p ? n.some((u) => u.id === r) ? void 0 : p : !s && i === 0 ? null : void 0;
45
+ const m = t[0]?.id;
46
+ return m ? t.some((c) => c.id === n) ? void 0 : m : !l && s === 0 ? null : void 0;
49
47
  }
50
- function Rt(n, r) {
51
- return n > 0 || !!r;
48
+ function kt(t, n) {
49
+ return t > 0 || !!n;
52
50
  }
53
- function It(n, r) {
54
- return !n || !!r;
51
+ function yt(t, n) {
52
+ return !t || !!n;
55
53
  }
56
- function Ht({ title: n, badges: r }) {
57
- return !n && !r ? null : /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
58
- n ? /* @__PURE__ */ l("h2", { className: "text-lg font-semibold", children: n }) : /* @__PURE__ */ l("span", {}),
59
- r ? /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: r }) : null
54
+ function zt({ title: t, badges: n }) {
55
+ return !t && !n ? null : /* @__PURE__ */ v("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
56
+ t ? /* @__PURE__ */ a("h2", { className: "text-lg font-semibold", children: t }) : /* @__PURE__ */ a("span", {}),
57
+ n ? /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: n }) : null
60
58
  ] });
61
59
  }
62
- function Kt({ legend: n }) {
63
- return n ? /* @__PURE__ */ d(le, { children: [
64
- /* @__PURE__ */ l(ae, {}),
65
- n
66
- ] }) : null;
67
- }
68
- function tn({
69
- format: n,
70
- rows: r,
71
- columns: s,
72
- values: i,
73
- onChange: p,
74
- selection: u,
75
- onSelectionChange: P,
76
- fields: y,
60
+ function $t({
61
+ format: t,
62
+ rows: n,
63
+ columns: l,
64
+ values: s,
65
+ onChange: m,
66
+ selection: c,
67
+ onSelectionChange: C,
68
+ fields: M,
77
69
  tableColumns: S,
78
- colorForWell: ie,
79
- emptyEntry: C,
80
- mergeOnApply: ce,
81
- isPopulated: de,
82
- cycleFieldOnWellDoubleClick: F,
83
- title: ue,
84
- badges: fe,
85
- banner: me,
86
- legend: pe,
87
- formExtras: xe,
88
- formSlot: he,
89
- footer: R,
90
- plateTitle: ve = "Plate",
91
- plateToolbar: be,
92
- plates: k,
93
- activePlateId: I,
94
- onPlateChange: N,
95
- onAddPlate: H,
96
- onRemovePlate: Pe,
97
- addPlateLabel: ge,
98
- removePlateLabel: ye,
99
- plateSelectorLabel: Se,
100
- plateSelectorVariant: Ne,
101
- plateBarcodeField: we,
102
- plateBarcodeColumnHeader: K = Ft,
103
- hidePlateBarcodeColumn: $ = !1,
104
- groups: T,
105
- activeGroupId: Ee,
106
- onGroupClick: Ae,
107
- renderHoverSummary: Me,
108
- cellSize: Ce,
109
- emptyWellFillColor: ke,
110
- wellShape: We,
111
- framedPlate: ze,
112
- wrapWell: Fe,
113
- highlightedWellIds: Te,
114
- onHoveredWellChange: Be,
115
- manifestFilterable: Le,
116
- manifestGroupable: _e,
117
- autoScaleGrid: je,
118
- minCellSize: De,
119
- maxCellSize: Re,
120
- className: Ie,
121
- templates: He,
122
- templateId: Ke,
123
- onTemplateChange: $e,
124
- onClearTemplate: Oe,
125
- onImportCsv: B,
126
- onExportCsv: Ue,
127
- onImportTemplate: Ve,
128
- onExportTemplate: Ge,
129
- csvAccept: Ye,
130
- templateAccept: qe,
131
- label: Je,
132
- align: Qe,
133
- side: Xe,
134
- importTemplateLabel: Ze,
135
- exportTemplateLabel: et,
136
- importCsvLabel: tt,
137
- exportCsvLabel: nt,
138
- clearLabel: rt
70
+ colorForWell: ne,
71
+ emptyEntry: A,
72
+ mergeOnApply: re,
73
+ isPopulated: ae,
74
+ cycleFieldOnWellDoubleClick: y,
75
+ title: oe,
76
+ badges: se,
77
+ banner: le,
78
+ legend: ie,
79
+ formExtras: ce,
80
+ formSlot: de,
81
+ footer: L,
82
+ plateTitle: fe = "Plate",
83
+ plateToolbar: ue,
84
+ plates: N,
85
+ activePlateId: R,
86
+ onPlateChange: E,
87
+ onAddPlate: I,
88
+ onRemovePlate: me,
89
+ addPlateLabel: pe,
90
+ removePlateLabel: he,
91
+ plateSelectorLabel: xe,
92
+ plateSelectorVariant: ve,
93
+ plateBarcodeField: Pe,
94
+ plateBarcodeColumnHeader: D = Et,
95
+ hidePlateBarcodeColumn: H = !1,
96
+ groups: ge,
97
+ activeGroupId: Me,
98
+ onGroupClick: Se,
99
+ renderHoverSummary: Ee,
100
+ cellSize: be,
101
+ emptyWellFillColor: we,
102
+ wellShape: Ce,
103
+ framedPlate: Ae,
104
+ wrapWell: Ne,
105
+ highlightedWellIds: We,
106
+ onHoveredWellChange: ke,
107
+ manifestFilterable: ye,
108
+ manifestGroupable: ze,
109
+ autoScaleGrid: Te,
110
+ minCellSize: Be,
111
+ maxCellSize: Fe,
112
+ className: _e,
113
+ templates: Le,
114
+ templateId: Re,
115
+ onTemplateChange: Ie,
116
+ onClearTemplate: De,
117
+ onImportCsv: z,
118
+ onExportCsv: He,
119
+ onImportTemplate: Ke,
120
+ onExportTemplate: $e,
121
+ csvAccept: je,
122
+ templateAccept: Oe,
123
+ label: Ue,
124
+ align: Ve,
125
+ side: Ge,
126
+ importTemplateLabel: Ye,
127
+ exportTemplateLabel: qe,
128
+ importCsvLabel: Je,
129
+ exportCsvLabel: Qe,
130
+ clearLabel: Xe
139
131
  }) {
140
- const lt = At(n, r, s), [O, U] = o.useState({}), [w, V] = o.useState(null), [G, Y] = o.useState(), [q, at] = o.useState([]), [ot, J] = o.useState(), st = ce ?? Bt, W = o.useMemo(() => Lt(q, k), [q, k]), g = I !== void 0, z = I ?? ot, Q = o.useMemo(
141
- () => _t(W, z),
142
- [W, z]
143
- ), h = Q?.barcode, f = h, x = !!f, v = we ?? zt, X = o.useRef(f), b = o.useMemo(() => jt(i, f), [f, i]), Z = o.useCallback(
144
- (e) => !x || !f ? e : Tt(f, e),
145
- [f, x]
146
- ), it = o.useCallback(
132
+ const [K, $] = o.useState({}), [Ze, j] = o.useState(null), [O, U] = o.useState(), [V, et] = o.useState([]), [tt, G] = o.useState(), nt = re ?? wt, W = o.useMemo(() => Ct(V, N), [V, N]), P = R !== void 0, k = R ?? tt, Y = o.useMemo(
133
+ () => At(W, k),
134
+ [W, k]
135
+ ), h = Y?.barcode, d = h, p = !!d, x = Pe ?? St, q = o.useRef(d), g = o.useMemo(() => Nt(s, d), [d, s]), J = o.useCallback(
136
+ (e) => !p || !d ? e : bt(d, e),
137
+ [d, p]
138
+ ), rt = o.useCallback(
147
139
  (e) => {
148
- g || J(e), N?.(e);
140
+ P || G(e), E?.(e);
149
141
  },
150
- [g, N]
151
- ), ct = o.useCallback(
152
- async (e, t) => {
153
- if (t) {
154
- const a = yt(t);
155
- at(a);
156
- const c = Dt({
157
- importedPlates: a,
158
- selectedPlateId: z,
159
- isControlled: g,
160
- providedPlateCount: k?.length ?? 0
142
+ [P, E]
143
+ ), at = o.useCallback(
144
+ async (e, r) => {
145
+ if (r) {
146
+ const i = ut(r);
147
+ et(i);
148
+ const f = Wt({
149
+ importedPlates: i,
150
+ selectedPlateId: k,
151
+ isControlled: P,
152
+ providedPlateCount: N?.length ?? 0
161
153
  });
162
- c !== void 0 && (g || J(c ?? void 0), c && N?.(c));
154
+ f !== void 0 && (P || G(f ?? void 0), f && E?.(f));
163
155
  }
164
- await B?.(e, t);
156
+ await z?.(e, r);
165
157
  },
166
- [g, B, N, k, z]
167
- ), E = o.useCallback(
168
- (e) => !x || !h ? e : { ...e, [v]: h },
169
- [h, v, x]
170
- ), A = o.useCallback(
158
+ [P, z, E, N, k]
159
+ ), b = o.useCallback(
160
+ (e) => !p || !h ? e : { ...e, [x]: h },
161
+ [h, x, p]
162
+ ), w = o.useCallback(
171
163
  (e) => {
172
- if (!x || !f) {
173
- p(e);
164
+ if (!p || !d) {
165
+ m(e);
174
166
  return;
175
167
  }
176
- const t = new Map(i);
177
- [...t.keys()].forEach((a) => {
178
- se(f, a) && t.delete(a);
179
- }), e.forEach((a, c) => {
180
- t.set(Z(c), E(a));
181
- }), p(t);
168
+ const r = new Map(s);
169
+ [...r.keys()].forEach((i) => {
170
+ te(d, i) && r.delete(i);
171
+ }), e.forEach((i, f) => {
172
+ r.set(J(f), b(i));
173
+ }), m(r);
182
174
  },
183
- [f, x, p, E, Z, i]
175
+ [d, p, m, b, J, s]
184
176
  );
185
177
  o.useEffect(() => {
186
- X.current !== f && (X.current = f, U({}), V(null), Y(void 0), u.size > 0 && P(/* @__PURE__ */ new Set()));
187
- }, [f, P, u.size]);
188
- const m = o.useMemo(() => {
189
- if (!F) return;
190
- const e = y.find((t) => t.key === F);
178
+ q.current !== d && (q.current = d, $({}), j(null), U(void 0), c.size > 0 && C(/* @__PURE__ */ new Set()));
179
+ }, [d, C, c.size]);
180
+ const u = o.useMemo(() => {
181
+ if (!y) return;
182
+ const e = M.find((r) => r.key === y);
191
183
  if (!(e?.kind !== "select" || !e.options?.length))
192
184
  return e;
193
- }, [F, y]), dt = () => {
194
- if (u.size === 0) return;
195
- const e = new Map(b);
196
- u.forEach((t) => {
197
- const c = e.get(t) ?? C(t), M = E(st(c, O, t));
198
- e.set(t, M);
199
- }), A(e);
200
- }, ut = () => {
201
- if (u.size === 0) return;
202
- const e = new Map(b);
203
- u.forEach((t) => e.delete(t)), A(e);
204
- }, ft = o.useCallback(
185
+ }, [y, M]), ot = () => {
186
+ if (c.size === 0) return;
187
+ const e = new Map(g);
188
+ c.forEach((r) => {
189
+ const f = e.get(r) ?? A(r), T = b(nt(f, K, r));
190
+ e.set(r, T);
191
+ }), w(e);
192
+ }, st = () => {
193
+ if (c.size === 0) return;
194
+ const e = new Map(g);
195
+ c.forEach((r) => e.delete(r)), w(e);
196
+ }, lt = o.useCallback(
205
197
  (e) => {
206
- if (!m?.options?.length) return;
207
- const t = new Map(b), a = t.get(e), c = a?.[m.key], M = m.options.findIndex((_) => _.value === c), ee = m.options[(M + 1) % m.options.length];
208
- if (!ee) return;
209
- const gt = a ?? C(e);
210
- t.set(e, E({ ...gt, [m.key]: ee.value })), A(t), Y((_) => ({ wellId: e, key: (_?.key ?? 0) + 1 }));
198
+ if (!u?.options?.length) return;
199
+ const r = new Map(g), i = r.get(e), f = i?.[u.key], T = u.options.findIndex((B) => B.value === f), Q = u.options[(T + 1) % u.options.length];
200
+ if (!Q) return;
201
+ const ft = i ?? A(e);
202
+ r.set(e, b({ ...ft, [u.key]: Q.value })), w(r), U((B) => ({ wellId: e, key: (B?.key ?? 0) + 1 }));
211
203
  },
212
- [A, m, C, b, E]
213
- ), mt = () => {
214
- P(new Set(Et(lt)));
215
- }, pt = () => P(/* @__PURE__ */ new Set()), L = w ? b.get(w) : void 0, xt = L ? y.map((e) => {
216
- const t = L[e.key];
217
- if (t == null || t === "") return null;
218
- if (e.kind === "select")
219
- return (e.options ?? []).find((c) => c.value === t)?.label ?? String(t);
220
- if (e.kind === "multiselect") {
221
- const a = Array.isArray(t) ? t : [];
222
- return a.length === 0 ? null : a.map((c) => (e.options ?? []).find((M) => M.value === c)?.label ?? c).join(", ");
223
- }
224
- return e.kind === "boolean" ? t ? e.label : null : String(t);
225
- }).filter(Boolean) : [], ht = w ? Me?.(L, w) ?? [w, ...xt].join(" • ") : " ", vt = o.useMemo(() => !x || !h || $ || S.some(
226
- (a) => a.field === v || a.id === v
204
+ [w, u, A, g, b]
205
+ ), it = o.useMemo(() => !p || !h || H || S.some(
206
+ (i) => i.field === x || i.id === x
227
207
  ) ? S : [{
228
- id: v,
229
- header: K,
208
+ id: x,
209
+ header: D,
230
210
  minWidth: 150,
231
- render: ({ row: a }) => {
232
- const c = a[v] ?? h;
233
- return /* @__PURE__ */ l(kt, { variant: "outline", children: String(c) });
211
+ render: ({ row: i }) => {
212
+ const f = i[x] ?? h;
213
+ return /* @__PURE__ */ a(Pt, { variant: "outline", children: String(f) });
234
214
  }
235
- }, ...S], [h, v, $, x, K, S]), bt = Rt(W.length, H), Pt = It(g, N);
236
- return /* @__PURE__ */ d("div", { "data-slot": "plate-map-editor", className: re("flex flex-col gap-4", Ie), children: [
237
- /* @__PURE__ */ l(Ht, { title: ue, badges: fe }),
238
- me,
239
- /* @__PURE__ */ d("div", { className: "flex flex-wrap gap-3 md:flex-nowrap", children: [
240
- /* @__PURE__ */ l(j, { className: "flex w-full max-w-[360px] min-w-[300px] basis-[360px] flex-col", size: "sm", children: /* @__PURE__ */ d(D, { className: "flex h-full flex-1 flex-col gap-3", children: [
241
- he ?? /* @__PURE__ */ l(
242
- Ct,
243
- {
244
- fields: y,
245
- value: O,
246
- onChange: U,
247
- selectionSize: u.size,
248
- onApply: dt,
249
- onClear: ut,
250
- extras: xe
251
- }
252
- ),
253
- /* @__PURE__ */ l(Kt, { legend: pe })
254
- ] }) }),
255
- /* @__PURE__ */ d(j, { className: "flex min-w-[360px] flex-1 flex-col", size: "sm", children: [
256
- /* @__PURE__ */ d(te, { className: "border-b", children: [
257
- /* @__PURE__ */ d("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
258
- /* @__PURE__ */ l(ne, { className: "min-w-0", children: ve }),
259
- bt ? /* @__PURE__ */ l(
260
- Nt,
215
+ }, ...S], [h, x, H, p, D, S]), ct = kt(W.length, I), dt = yt(P, E);
216
+ return /* @__PURE__ */ v("div", { "data-slot": "plate-map-editor", className: Mt("flex flex-col gap-4", _e), children: [
217
+ /* @__PURE__ */ a(zt, { title: oe, badges: se }),
218
+ le,
219
+ /* @__PURE__ */ v("div", { className: "flex flex-wrap gap-3 md:flex-nowrap", children: [
220
+ /* @__PURE__ */ a(F, { className: "flex w-full max-w-[360px] min-w-[300px] basis-[360px] flex-col", size: "sm", children: /* @__PURE__ */ a(_, { className: "flex h-full flex-1 flex-col gap-3", children: /* @__PURE__ */ a(
221
+ pt,
222
+ {
223
+ fields: M,
224
+ value: K,
225
+ onChange: $,
226
+ selectionSize: c.size,
227
+ onApply: ot,
228
+ onClear: st,
229
+ extras: ce,
230
+ legend: ie,
231
+ formSlot: de
232
+ }
233
+ ) }) }),
234
+ /* @__PURE__ */ v(F, { className: "flex min-w-[360px] flex-1 flex-col", size: "sm", children: [
235
+ /* @__PURE__ */ v(X, { className: "border-b", children: [
236
+ /* @__PURE__ */ v("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
237
+ /* @__PURE__ */ a(Z, { className: "min-w-0", children: fe }),
238
+ ct ? /* @__PURE__ */ a(
239
+ vt,
261
240
  {
262
241
  plates: W,
263
- activePlateId: Q?.id,
264
- onPlateChange: Pt ? it : void 0,
265
- onAddPlate: H,
266
- onRemovePlate: Pe,
267
- addPlateLabel: ge,
268
- removePlateLabel: ye,
269
- label: Se,
270
- variant: Ne
242
+ activePlateId: Y?.id,
243
+ onPlateChange: dt ? rt : void 0,
244
+ onAddPlate: I,
245
+ onRemovePlate: me,
246
+ addPlateLabel: pe,
247
+ removePlateLabel: he,
248
+ label: xe,
249
+ variant: ve
271
250
  }
272
251
  ) : null
273
252
  ] }),
274
- /* @__PURE__ */ l(Wt, { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ l(
275
- St,
253
+ /* @__PURE__ */ a(gt, { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ a(
254
+ mt,
276
255
  {
277
- templates: He,
278
- templateId: Ke,
279
- onTemplateChange: $e,
280
- onClearTemplate: Oe,
281
- hasEntries: i.size > 0,
282
- onImportCsv: B ? ct : void 0,
283
- onExportCsv: Ue,
284
- onImportTemplate: Ve,
285
- onExportTemplate: Ge,
286
- csvAccept: Ye,
287
- templateAccept: qe,
288
- label: Je,
289
- align: Qe,
290
- side: Xe,
291
- importTemplateLabel: Ze,
292
- exportTemplateLabel: et,
293
- importCsvLabel: tt,
294
- exportCsvLabel: nt,
295
- clearLabel: rt
256
+ templates: Le,
257
+ templateId: Re,
258
+ onTemplateChange: Ie,
259
+ onClearTemplate: De,
260
+ hasEntries: s.size > 0,
261
+ onImportCsv: z ? at : void 0,
262
+ onExportCsv: He,
263
+ onImportTemplate: Ke,
264
+ onExportTemplate: $e,
265
+ csvAccept: je,
266
+ templateAccept: Oe,
267
+ label: Ue,
268
+ align: Ve,
269
+ side: Ge,
270
+ importTemplateLabel: Ye,
271
+ exportTemplateLabel: qe,
272
+ importCsvLabel: Je,
273
+ exportCsvLabel: Qe,
274
+ clearLabel: Xe
296
275
  }
297
276
  ) })
298
277
  ] }),
299
- /* @__PURE__ */ d(D, { className: "flex flex-col gap-1.5", children: [
300
- /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center justify-start gap-3", children: [
301
- be,
302
- /* @__PURE__ */ d("div", { className: "flex items-center gap-2 text-xs", children: [
303
- /* @__PURE__ */ l(
304
- "button",
305
- {
306
- type: "button",
307
- className: "font-medium text-primary underline-offset-2 hover:text-primary/80 hover:underline",
308
- onClick: mt,
309
- children: "Select all"
310
- }
311
- ),
312
- /* @__PURE__ */ l("span", { className: "text-muted-foreground/60", children: "·" }),
313
- /* @__PURE__ */ l(
314
- "button",
315
- {
316
- type: "button",
317
- className: "font-medium text-primary underline-offset-2 hover:text-primary/80 hover:underline",
318
- onClick: pt,
319
- children: "Deselect all"
320
- }
321
- )
322
- ] })
323
- ] }),
324
- /* @__PURE__ */ l("div", { className: "h-5 text-xs text-muted-foreground", children: ht }),
325
- /* @__PURE__ */ l(
326
- wt,
327
- {
328
- format: n,
329
- rows: r,
330
- columns: s,
331
- values: b,
332
- selection: u,
333
- onSelectionChange: P,
334
- colorForWell: ie,
335
- emptyWellFillColor: ke,
336
- wellShape: We,
337
- framed: ze,
338
- wrapWell: Fe,
339
- highlightedWellIds: Te,
340
- onWellHover: (e) => {
341
- V(e), Be?.(e);
342
- },
343
- onWellDoubleClick: m ? ft : void 0,
344
- selectionFillMode: m ? "well" : "selection",
345
- flashWellId: G?.wellId,
346
- flashWellKey: G?.key,
347
- cellSize: Ce,
348
- autoScale: je,
349
- minCellSize: De,
350
- maxCellSize: Re
351
- }
352
- ),
353
- T && T.length > 0 ? /* @__PURE__ */ d(le, { children: [
354
- /* @__PURE__ */ l(ae, { className: "mt-2" }),
355
- /* @__PURE__ */ l("div", { className: "flex max-h-28 flex-wrap gap-3 overflow-y-auto pt-1", children: T.map((e) => {
356
- const t = e.id === Ee, a = e.count ?? e.wellIds?.length;
357
- return /* @__PURE__ */ d(
358
- "button",
359
- {
360
- type: "button",
361
- disabled: e.disabled,
362
- onClick: () => Ae?.(e),
363
- className: re(
364
- "flex w-16 flex-col items-center gap-1 rounded-md px-1 py-1 text-center text-xs transition-colors",
365
- "text-muted-foreground hover:bg-muted/60",
366
- t && "bg-muted text-foreground ring-1 ring-primary/40",
367
- e.disabled && "pointer-events-none opacity-50"
368
- ),
369
- title: e.label,
370
- children: [
371
- /* @__PURE__ */ l(
372
- "span",
373
- {
374
- className: "size-7 rounded-full border",
375
- style: {
376
- backgroundColor: e.color,
377
- borderColor: e.borderColor
378
- },
379
- "aria-hidden": !0
380
- }
381
- ),
382
- /* @__PURE__ */ l("span", { className: "w-full truncate text-foreground", children: e.label }),
383
- a === void 0 ? null : /* @__PURE__ */ d("span", { className: "text-[0.7rem] leading-none text-muted-foreground", children: [
384
- a,
385
- " wells"
386
- ] })
387
- ]
388
- },
389
- e.id
390
- );
391
- }) })
392
- ] }) : null
393
- ] })
278
+ /* @__PURE__ */ a(_, { children: /* @__PURE__ */ a(
279
+ ht,
280
+ {
281
+ format: t,
282
+ rows: n,
283
+ columns: l,
284
+ values: g,
285
+ selection: c,
286
+ onSelectionChange: C,
287
+ colorForWell: ne,
288
+ fields: M,
289
+ renderHoverSummary: Ee,
290
+ hoveredWellId: Ze,
291
+ onHoveredWellChange: (e) => {
292
+ j(e), ke?.(e);
293
+ },
294
+ toolbar: ue,
295
+ emptyWellFillColor: we,
296
+ wellShape: Ce,
297
+ framed: Ae,
298
+ wrapWell: Ne,
299
+ highlightedWellIds: We,
300
+ onWellDoubleClick: u ? lt : void 0,
301
+ selectionFillMode: u ? "well" : "selection",
302
+ flashWellId: O?.wellId,
303
+ flashWellKey: O?.key,
304
+ cellSize: be,
305
+ autoScale: Te,
306
+ minCellSize: Be,
307
+ maxCellSize: Fe,
308
+ groups: ge,
309
+ activeGroupId: Me,
310
+ onGroupClick: Se
311
+ }
312
+ ) })
394
313
  ] })
395
314
  ] }),
396
- /* @__PURE__ */ d(j, { size: "sm", children: [
397
- /* @__PURE__ */ l(te, { className: "border-b", children: /* @__PURE__ */ l(ne, { children: "Sample manifest" }) }),
398
- /* @__PURE__ */ l(D, { children: /* @__PURE__ */ l(
399
- Mt,
315
+ /* @__PURE__ */ v(F, { size: "sm", children: [
316
+ /* @__PURE__ */ a(X, { className: "border-b", children: /* @__PURE__ */ a(Z, { children: "Sample manifest" }) }),
317
+ /* @__PURE__ */ a(_, { children: /* @__PURE__ */ a(
318
+ xt,
400
319
  {
401
- values: b,
402
- onChange: A,
403
- columns: vt,
404
- fields: y,
405
- selection: u,
406
- onSelectionChange: P,
407
- emptyEntry: C,
408
- isPopulated: de,
409
- filterable: Le,
410
- groupable: _e
320
+ values: g,
321
+ onChange: w,
322
+ columns: it,
323
+ fields: M,
324
+ selection: c,
325
+ onSelectionChange: C,
326
+ emptyEntry: A,
327
+ isPopulated: ae,
328
+ filterable: ye,
329
+ groupable: ze
411
330
  }
412
331
  ) })
413
332
  ] }),
414
- R ? /* @__PURE__ */ l("div", { className: "flex justify-end gap-2 pt-2", children: R }) : null
333
+ L ? /* @__PURE__ */ a("div", { className: "flex justify-end gap-2 pt-2", children: L }) : null
415
334
  ] });
416
335
  }
417
336
  export {
418
- kt as PlateBadge,
419
- tn as PlateMapEditor,
420
- Tt as getPlateMapScopedWellId
337
+ Pt as PlateBadge,
338
+ $t as PlateMapEditor,
339
+ bt as getPlateMapScopedWellId
421
340
  };
422
341
  //# sourceMappingURL=PlateMapEditor.js.map