@nice2dev/ui-erp 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,31 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const be = require("react");
5
- const se = {
6
- radius: "md",
7
- shadow: "md",
8
- fill: "solid",
9
- buttonStyle: "flat",
10
- inputStyle: "bordered",
11
- cardStyle: "elevated",
12
- badgeStyle: "solid",
13
- tabStyle: "underline",
14
- toggleStyle: "default",
15
- tooltipStyle: "dark",
16
- modalStyle: "default",
17
- tableStyle: "default",
18
- menuStyle: "default",
19
- animation: "normal",
20
- density: "normal"
21
- };
22
- be.createContext({
23
- displayStyle: "default",
24
- variantConfig: se,
25
- setDisplayStyle: () => {
26
- }
27
- });
28
- const er = {
4
+ const ve = require("react");
5
+ const a = (e, t) => t, c = /* @__PURE__ */ ve.createContext(a), i = /* @__PURE__ */ ve.createContext("en");
6
+ function v() {
7
+ const e = ve.useContext(c), t = ve.useContext(i);
8
+ return { t: e, lang: t };
9
+ }
10
+ const tr = {
29
11
  // Navigation
30
12
  "chevron-down": "M6 9l6 6 6-6",
31
13
  "chevron-up": "M18 15l-6-6-6 6",
@@ -75,6 +57,8 @@ const er = {
75
57
  link: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",
76
58
  mail: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",
77
59
  phone: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",
60
+ // the device, as `phone` is the handset
61
+ smartphone: "M7 2h10a2 2 0 012 2v16a2 2 0 01-2 2H7a2 2 0 01-2-2V4a2 2 0 012-2z M11 18h2",
78
62
  user: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",
79
63
  users: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",
80
64
  home: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",
@@ -221,22 +205,42 @@ const er = {
221
205
  keyboard: "M4 6h16a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V8a2 2 0 012-2z M6 10h.01 M10 10h.01 M14 10h.01 M18 10h.01 M8 14h8",
222
206
  "page-break": "M6 3v5h12V3 M6 21v-5h12v5 M2 12h3 M8 12h3 M13 12h3 M19 12h3",
223
207
  shield: "M12 2l8 3v6c0 5-3.4 9.4-8 11-4.6-1.6-8-6-8-11V5z",
224
- repeat: "M17 2l4 4-4 4 M3 11V9a4 4 0 014-4h14 M7 22l-4-4 4-4 M21 13v2a4 4 0 01-4 4H3"
225
- }, ca = {
208
+ repeat: "M17 2l4 4-4 4 M3 11V9a4 4 0 014-4h14 M7 22l-4-4 4-4 M21 13v2a4 4 0 01-4 4H3",
209
+ // 1.2.1: for the controls that drew these as inline <svg>
210
+ pin: "M12 17v5 M5 17h14l-1.5-3V8a2 2 0 00-2-2h-7a2 2 0 00-2 2v6z",
211
+ "mic-off": "M1 1l22 22 M9 9v3a3 3 0 005.12 2.12 M15 9.34V4a3 3 0 00-5.94-.6 M17 16.95A7 7 0 015 12v-2 M19 10v2a7 7 0 01-.11 1.23 M12 19v4 M8 23h8",
212
+ "log-out": "M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4 M16 17l5-5-5-5 M21 12H9",
213
+ "chevrons-left": "M11 17l-5-5 5-5 M18 17l-5-5 5-5",
214
+ "chevrons-right": "M13 17l5-5-5-5 M6 17l5-5-5-5",
215
+ "zoom-in": "M11 4a7 7 0 100 14 7 7 0 000-14z M21 21l-4.35-4.35 M11 8v6 M8 11h6",
216
+ "zoom-out": "M11 4a7 7 0 100 14 7 7 0 000-14z M21 21l-4.35-4.35 M8 11h6",
217
+ navigation: "M12 2l7 19-7-4-7 4z",
218
+ "refresh-ccw": "M1 4v6h6 M23 20v-6h-6 M20.49 9A9 9 0 005.64 5.64L1 10 M3.51 15a9 9 0 0014.85 3.36L23 14",
219
+ minimize: "M4 14h6v6 M20 10h-6V4 M14 10l7-7 M3 21l7-7",
220
+ // 1.2.2: geometry tools and object grouping, drawn as glyphs before (Ntd* of the same names in icons)
221
+ point: "M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z M12 12h.01",
222
+ segment: "M6.5 17.5L17.5 6.5 M3 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0 M17 5a2 2 0 1 0 4 0a2 2 0 1 0-4 0",
223
+ perpendicular: "M3 20h18 M12 20V4 M12 15h5v5",
224
+ parallel: "M4 16L14 6 M10 20L20 10",
225
+ midpoint: "M3 12h6 M15 12h6 M3 9v6 M21 9v6 M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6z",
226
+ "angle-bisector": "M4 20h17 M4 20L16 5 M4 20l14.4-6.9 M10 20a6 6 0 0 0-2.25-4.68",
227
+ group: "M3 7V3h4 M17 3h4v4 M21 17v4h-4 M7 21H3v-4 M7 7h5v5H7z M12 12h5v5h-5z",
228
+ ungroup: "M3 3h8v8H3z M13 13h8v8h-8z"
229
+ }, la = {
226
230
  xs: 12,
227
231
  sm: 16,
228
232
  md: 20,
229
233
  lg: 24,
230
234
  xl: 32
231
- }, gt = be.createContext({});
232
- function la({
235
+ }, gt = /* @__PURE__ */ ve.createContext({});
236
+ function da({
233
237
  path: e,
234
238
  size: t,
235
239
  className: r,
236
- style: a,
240
+ style: a2,
237
241
  color: n,
238
242
  title: o,
239
- onClick: i
243
+ onClick: i2
240
244
  }) {
241
245
  return /* @__PURE__ */ jsxRuntime.jsxs(
242
246
  "svg",
@@ -251,11 +255,11 @@ function la({
251
255
  strokeLinecap: "round",
252
256
  strokeLinejoin: "round",
253
257
  className: `nice-icon ${r || ""}`,
254
- style: a,
258
+ style: a2,
255
259
  role: o ? "img" : "presentation",
256
260
  "aria-label": o,
257
261
  "aria-hidden": !o,
258
- onClick: i,
262
+ onClick: i2,
259
263
  children: [
260
264
  o && /* @__PURE__ */ jsxRuntime.jsx("title", { children: o }),
261
265
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: e })
@@ -263,1726 +267,51 @@ function la({
263
267
  }
264
268
  );
265
269
  }
266
- const Ae = ({
270
+ const ae = ({
267
271
  name: e,
268
272
  size: t = "md",
269
273
  className: r,
270
- style: a,
274
+ style: a2,
271
275
  color: n,
272
276
  title: o,
273
- onClick: i
277
+ onClick: i2
274
278
  }) => {
275
- const { resolver: s } = be.useContext(gt), c = typeof t == "number" ? t : ca[t];
279
+ const { resolver: s } = ve.useContext(gt), c2 = typeof t == "number" ? t : la[t];
276
280
  if (s) {
277
- const d = s(e, c);
281
+ const d = s(e, c2);
278
282
  if (d)
279
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `nice-icon-wrap ${r || ""}`, style: a, onClick: i, children: d });
283
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `nice-icon-wrap ${r || ""}`, style: a2, onClick: i2, children: d });
280
284
  }
281
- const l = er[e];
285
+ const l = tr[e];
282
286
  return l ? /* @__PURE__ */ jsxRuntime.jsx(
283
- la,
287
+ da,
284
288
  {
285
289
  path: l,
286
- size: c,
290
+ size: c2,
287
291
  className: r,
288
- style: a,
292
+ style: a2,
289
293
  color: n,
290
294
  title: o,
291
- onClick: i
295
+ onClick: i2
292
296
  }
293
297
  ) : null;
294
298
  };
295
- be.createContext({
296
- direction: "ltr",
297
- isRTL: false,
298
- flip: (e) => e,
299
- flipStyle: (e, t) => ({ [e]: t })
300
- });
301
- be.createContext({
302
- permissions: {},
303
- getAccessMode: () => "full"
304
- });
305
- be.createContext(null);
306
- be.createContext(null);
307
- const Ce = {
308
- space1: "4px",
309
- space2: "8px",
310
- space3: "12px",
311
- space4: "16px",
312
- space5: "20px",
313
- space6: "24px",
314
- space8: "32px"
315
- }, Le = {
316
- fontFamily: "'Inter', system-ui, -apple-system, sans-serif",
317
- fontSizeXs: "0.75rem",
318
- fontSizeSm: "0.8125rem",
319
- fontSizeMd: "0.875rem",
320
- fontSizeLg: "1rem",
321
- fontSizeXl: "1.125rem",
322
- fontWeightNormal: 400,
323
- fontWeightMedium: 500,
324
- fontWeightSemibold: 600,
325
- fontWeightBold: 700,
326
- lineHeight: 1.5
327
- }, Ne = { fast: "120ms ease", normal: "200ms ease", slow: "300ms ease" }, bt = (e) => ({
328
- color: e,
329
- radiusSm: "4px",
330
- radiusMd: "6px",
331
- radiusLg: "8px",
332
- radiusXl: "12px",
333
- radiusFull: "9999px"
334
- }), fr = {
335
- sm: "0 1px 2px rgba(0,0,0,0.05)",
336
- md: "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",
337
- lg: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
338
- xl: "0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"
339
- }, _a = {
340
- sm: "0 1px 2px rgba(0,0,0,0.3)",
341
- md: "0 4px 6px -1px rgba(0,0,0,0.4)",
342
- lg: "0 10px 15px -3px rgba(0,0,0,0.4)",
343
- xl: "0 20px 25px -5px rgba(0,0,0,0.4)"
344
- };
345
- function $(e, t, r, a, n) {
346
- return {
347
- name: e,
348
- darkMode: "light",
349
- colors: {
350
- ...t,
351
- surface: t.surface ?? r.primary,
352
- surfaceHover: t.surfaceHover ?? r.secondary
353
- },
354
- backgrounds: {
355
- ...r,
356
- elevated: r.elevated ?? r.primary,
357
- inset: r.inset ?? r.tertiary,
358
- canvas: r.canvas ?? r.primary
359
- },
360
- text: { ...a, inverse: a.inverse ?? "#ffffff" },
361
- borders: bt(n),
362
- shadows: fr,
363
- spacing: Ce,
364
- typography: Le,
365
- transitions: Ne
366
- };
367
- }
368
- function j(e, t, r, a, n) {
369
- return {
370
- name: e,
371
- darkMode: "dark",
372
- colors: {
373
- ...t,
374
- surface: t.surface ?? r.secondary,
375
- surfaceHover: t.surfaceHover ?? r.tertiary
376
- },
377
- backgrounds: {
378
- ...r,
379
- elevated: r.elevated ?? r.secondary,
380
- inset: r.inset ?? r.primary,
381
- canvas: r.canvas ?? r.primary
382
- },
383
- text: { ...a, inverse: a.inverse ?? "#0f172a" },
384
- borders: bt(n),
385
- shadows: _a,
386
- spacing: Ce,
387
- typography: Le,
388
- transitions: Ne
389
- };
390
- }
391
- $(
392
- "Slate",
393
- {
394
- primary: "#64748b",
395
- primaryHover: "#475569",
396
- success: "#10b981",
397
- warning: "#f59e0b",
398
- error: "#ef4444",
399
- info: "#06b6d4"
400
- },
401
- { primary: "#f8fafc", secondary: "#f1f5f9", tertiary: "#e2e8f0", hover: "#e2e8f0" },
402
- { primary: "#1e293b", secondary: "#475569", muted: "#94a3b8" },
403
- "#cbd5e1"
404
- );
405
- $(
406
- "Zinc",
407
- {
408
- primary: "#71717a",
409
- primaryHover: "#52525b",
410
- success: "#22c55e",
411
- warning: "#eab308",
412
- error: "#ef4444",
413
- info: "#06b6d4"
414
- },
415
- { primary: "#fafafa", secondary: "#f4f4f5", tertiary: "#e4e4e7", hover: "#e4e4e7" },
416
- { primary: "#18181b", secondary: "#3f3f46", muted: "#a1a1aa" },
417
- "#d4d4d8"
418
- );
419
- $(
420
- "Stone",
421
- {
422
- primary: "#78716c",
423
- primaryHover: "#57534e",
424
- success: "#16a34a",
425
- warning: "#ca8a04",
426
- error: "#dc2626",
427
- info: "#0891b2"
428
- },
429
- { primary: "#fafaf9", secondary: "#f5f5f4", tertiary: "#e7e5e4", hover: "#e7e5e4" },
430
- { primary: "#1c1917", secondary: "#44403c", muted: "#a8a29e" },
431
- "#d6d3d1"
432
- );
433
- $(
434
- "Cool Gray",
435
- {
436
- primary: "#6b7280",
437
- primaryHover: "#4b5563",
438
- success: "#10b981",
439
- warning: "#f59e0b",
440
- error: "#ef4444",
441
- info: "#3b82f6"
442
- },
443
- { primary: "#f9fafb", secondary: "#f3f4f6", tertiary: "#e5e7eb", hover: "#e5e7eb" },
444
- { primary: "#111827", secondary: "#374151", muted: "#9ca3af" },
445
- "#d1d5db"
446
- );
447
- $(
448
- "Warm Gray",
449
- {
450
- primary: "#7c7568",
451
- primaryHover: "#5c564c",
452
- success: "#4d7c0f",
453
- warning: "#a16207",
454
- error: "#b91c1c",
455
- info: "#0e7490"
456
- },
457
- { primary: "#faf9f7", secondary: "#f5f4f0", tertiary: "#e8e6e1", hover: "#e8e6e1" },
458
- { primary: "#1f1d19", secondary: "#4a463d", muted: "#a09888" },
459
- "#d4d0c8"
460
- );
461
- $(
462
- "Silver",
463
- {
464
- primary: "#94a3b8",
465
- primaryHover: "#64748b",
466
- success: "#10b981",
467
- warning: "#f59e0b",
468
- error: "#ef4444",
469
- info: "#38bdf8"
470
- },
471
- { primary: "#f8fafc", secondary: "#f1f5f9", tertiary: "#e2e8f0", hover: "#e2e8f0" },
472
- { primary: "#334155", secondary: "#64748b", muted: "#94a3b8" },
473
- "#cbd5e1"
474
- );
475
- $(
476
- "Charcoal",
477
- {
478
- primary: "#374151",
479
- primaryHover: "#1f2937",
480
- success: "#059669",
481
- warning: "#d97706",
482
- error: "#dc2626",
483
- info: "#0284c7"
484
- },
485
- { primary: "#f9fafb", secondary: "#f3f4f6", tertiary: "#e5e7eb", hover: "#e5e7eb" },
486
- { primary: "#111827", secondary: "#374151", muted: "#6b7280" },
487
- "#d1d5db"
488
- );
489
- $(
490
- "Ivory",
491
- {
492
- primary: "#92876d",
493
- primaryHover: "#7a6f55",
494
- success: "#4d7c0f",
495
- warning: "#a16207",
496
- error: "#b91c1c",
497
- info: "#0e7490"
498
- },
499
- { primary: "#fffef7", secondary: "#faf6eb", tertiary: "#f0ead6", hover: "#f0ead6" },
500
- { primary: "#2b2517", secondary: "#5c5340", muted: "#9c9280" },
501
- "#ddd8c4"
502
- );
503
- $(
504
- "Rose",
505
- {
506
- primary: "#e11d48",
507
- primaryHover: "#be123c",
508
- success: "#16a34a",
509
- warning: "#ea580c",
510
- error: "#dc2626",
511
- info: "#0891b2"
512
- },
513
- { primary: "#fff1f2", secondary: "#ffe4e6", tertiary: "#fecdd3", hover: "#ffe4e6" },
514
- { primary: "#4c0519", secondary: "#881337", muted: "#f43f5e" },
515
- "#fda4af"
516
- );
517
- $(
518
- "Emerald",
519
- {
520
- primary: "#059669",
521
- primaryHover: "#047857",
522
- success: "#16a34a",
523
- warning: "#d97706",
524
- error: "#dc2626",
525
- info: "#0891b2"
526
- },
527
- { primary: "#ecfdf5", secondary: "#d1fae5", tertiary: "#a7f3d0", hover: "#d1fae5" },
528
- { primary: "#064e3b", secondary: "#065f46", muted: "#34d399" },
529
- "#6ee7b7"
530
- );
531
- $(
532
- "Amber",
533
- {
534
- primary: "#d97706",
535
- primaryHover: "#b45309",
536
- success: "#16a34a",
537
- warning: "#ca8a04",
538
- error: "#dc2626",
539
- info: "#0284c7"
540
- },
541
- { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
542
- { primary: "#451a03", secondary: "#78350f", muted: "#f59e0b" },
543
- "#fcd34d"
544
- );
545
- $(
546
- "Violet",
547
- {
548
- primary: "#7c3aed",
549
- primaryHover: "#6d28d9",
550
- success: "#10b981",
551
- warning: "#f59e0b",
552
- error: "#ef4444",
553
- info: "#06b6d4"
554
- },
555
- { primary: "#f5f3ff", secondary: "#ede9fe", tertiary: "#ddd6fe", hover: "#ede9fe" },
556
- { primary: "#2e1065", secondary: "#4c1d95", muted: "#a78bfa" },
557
- "#c4b5fd"
558
- );
559
- $(
560
- "Teal",
561
- {
562
- primary: "#0d9488",
563
- primaryHover: "#0f766e",
564
- success: "#16a34a",
565
- warning: "#d97706",
566
- error: "#dc2626",
567
- info: "#0284c7"
568
- },
569
- { primary: "#f0fdfa", secondary: "#ccfbf1", tertiary: "#99f6e4", hover: "#ccfbf1" },
570
- { primary: "#134e4a", secondary: "#115e59", muted: "#2dd4bf" },
571
- "#5eead4"
572
- );
573
- $(
574
- "Indigo",
575
- {
576
- primary: "#4f46e5",
577
- primaryHover: "#4338ca",
578
- success: "#10b981",
579
- warning: "#f59e0b",
580
- error: "#ef4444",
581
- info: "#06b6d4"
582
- },
583
- { primary: "#eef2ff", secondary: "#e0e7ff", tertiary: "#c7d2fe", hover: "#e0e7ff" },
584
- { primary: "#1e1b4b", secondary: "#312e81", muted: "#818cf8" },
585
- "#a5b4fc"
586
- );
587
- $(
588
- "Cyan",
589
- {
590
- primary: "#0891b2",
591
- primaryHover: "#0e7490",
592
- success: "#10b981",
593
- warning: "#f59e0b",
594
- error: "#ef4444",
595
- info: "#0284c7"
596
- },
597
- { primary: "#ecfeff", secondary: "#cffafe", tertiary: "#a5f3fc", hover: "#cffafe" },
598
- { primary: "#164e63", secondary: "#155e75", muted: "#22d3ee" },
599
- "#67e8f9"
600
- );
601
- $(
602
- "Lime",
603
- {
604
- primary: "#65a30d",
605
- primaryHover: "#4d7c0f",
606
- success: "#16a34a",
607
- warning: "#ca8a04",
608
- error: "#dc2626",
609
- info: "#0891b2"
610
- },
611
- { primary: "#f7fee7", secondary: "#ecfccb", tertiary: "#d9f99d", hover: "#ecfccb" },
612
- { primary: "#1a2e05", secondary: "#365314", muted: "#84cc16" },
613
- "#bef264"
614
- );
615
- $(
616
- "Pink",
617
- {
618
- primary: "#db2777",
619
- primaryHover: "#be185d",
620
- success: "#10b981",
621
- warning: "#f59e0b",
622
- error: "#dc2626",
623
- info: "#06b6d4"
624
- },
625
- { primary: "#fdf2f8", secondary: "#fce7f3", tertiary: "#fbcfe8", hover: "#fce7f3" },
626
- { primary: "#500724", secondary: "#831843", muted: "#f472b6" },
627
- "#f9a8d4"
628
- );
629
- $(
630
- "Orange",
631
- {
632
- primary: "#ea580c",
633
- primaryHover: "#c2410c",
634
- success: "#16a34a",
635
- warning: "#ca8a04",
636
- error: "#dc2626",
637
- info: "#0891b2"
638
- },
639
- { primary: "#fff7ed", secondary: "#ffedd5", tertiary: "#fed7aa", hover: "#ffedd5" },
640
- { primary: "#431407", secondary: "#7c2d12", muted: "#fb923c" },
641
- "#fdba74"
642
- );
643
- $(
644
- "Fuchsia",
645
- {
646
- primary: "#c026d3",
647
- primaryHover: "#a21caf",
648
- success: "#10b981",
649
- warning: "#eab308",
650
- error: "#ef4444",
651
- info: "#06b6d4"
652
- },
653
- { primary: "#fdf4ff", secondary: "#fae8ff", tertiary: "#f5d0fe", hover: "#fae8ff" },
654
- { primary: "#4a044e", secondary: "#701a75", muted: "#d946ef" },
655
- "#e879f9"
656
- );
657
- $(
658
- "Sky",
659
- {
660
- primary: "#0284c7",
661
- primaryHover: "#0369a1",
662
- success: "#10b981",
663
- warning: "#f59e0b",
664
- error: "#ef4444",
665
- info: "#06b6d4"
666
- },
667
- { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
668
- { primary: "#0c4a6e", secondary: "#075985", muted: "#38bdf8" },
669
- "#7dd3fc"
670
- );
671
- $(
672
- "Ruby",
673
- {
674
- primary: "#be123c",
675
- primaryHover: "#9f1239",
676
- success: "#059669",
677
- warning: "#d97706",
678
- error: "#dc2626",
679
- info: "#0284c7"
680
- },
681
- { primary: "#fff1f2", secondary: "#ffe4e6", tertiary: "#fecdd3", hover: "#ffe4e6" },
682
- { primary: "#4c0519", secondary: "#881337", muted: "#fb7185" },
683
- "#fda4af"
684
- );
685
- $(
686
- "Coral",
687
- {
688
- primary: "#f97316",
689
- primaryHover: "#ea580c",
690
- success: "#10b981",
691
- warning: "#eab308",
692
- error: "#ef4444",
693
- info: "#06b6d4"
694
- },
695
- { primary: "#fff7ed", secondary: "#ffedd5", tertiary: "#fed7aa", hover: "#ffedd5" },
696
- { primary: "#431407", secondary: "#9a3412", muted: "#fb923c" },
697
- "#fdba74"
698
- );
699
- j(
700
- "Midnight",
701
- {
702
- primary: "#818cf8",
703
- primaryHover: "#6366f1",
704
- success: "#34d399",
705
- warning: "#fbbf24",
706
- error: "#f87171",
707
- info: "#22d3ee"
708
- },
709
- { primary: "#020617", secondary: "#0f172a", tertiary: "#1e293b", hover: "#1e293b" },
710
- { primary: "#f1f5f9", secondary: "#94a3b8", muted: "#475569" },
711
- "#1e293b"
712
- );
713
- j(
714
- "Obsidian",
715
- {
716
- primary: "#a78bfa",
717
- primaryHover: "#8b5cf6",
718
- success: "#4ade80",
719
- warning: "#facc15",
720
- error: "#fb7185",
721
- info: "#38bdf8"
722
- },
723
- { primary: "#09090b", secondary: "#18181b", tertiary: "#27272a", hover: "#27272a" },
724
- { primary: "#fafafa", secondary: "#a1a1aa", muted: "#52525b" },
725
- "#3f3f46"
726
- );
727
- j(
728
- "Eclipse",
729
- {
730
- primary: "#c084fc",
731
- primaryHover: "#a855f7",
732
- success: "#34d399",
733
- warning: "#fbbf24",
734
- error: "#f87171",
735
- info: "#67e8f9"
736
- },
737
- { primary: "#0c0a1d", secondary: "#1a1533", tertiary: "#2a2248", hover: "#2a2248" },
738
- { primary: "#f5f3ff", secondary: "#a78bfa", muted: "#6d5eac" },
739
- "#3b3266"
740
- );
741
- j(
742
- "Onyx",
743
- {
744
- primary: "#60a5fa",
745
- primaryHover: "#3b82f6",
746
- success: "#4ade80",
747
- warning: "#fbbf24",
748
- error: "#f87171",
749
- info: "#22d3ee"
750
- },
751
- { primary: "#000000", secondary: "#0a0a0a", tertiary: "#171717", hover: "#171717" },
752
- { primary: "#ffffff", secondary: "#a3a3a3", muted: "#525252" },
753
- "#262626"
754
- );
755
- j(
756
- "Carbon",
757
- {
758
- primary: "#38bdf8",
759
- primaryHover: "#0ea5e9",
760
- success: "#4ade80",
761
- warning: "#facc15",
762
- error: "#f87171",
763
- info: "#67e8f9"
764
- },
765
- { primary: "#161616", secondary: "#262626", tertiary: "#393939", hover: "#393939" },
766
- { primary: "#f4f4f4", secondary: "#c6c6c6", muted: "#6f6f6f" },
767
- "#525252"
768
- );
769
- j(
770
- "Cosmos",
771
- {
772
- primary: "#6366f1",
773
- primaryHover: "#4f46e5",
774
- success: "#34d399",
775
- warning: "#fbbf24",
776
- error: "#f87171",
777
- info: "#22d3ee"
778
- },
779
- { primary: "#030712", secondary: "#111827", tertiary: "#1f2937", hover: "#1f2937" },
780
- // indigo-500 is a dark fill: white on it reads better than the dark default of dark themes
781
- { primary: "#e5e7eb", secondary: "#9ca3af", muted: "#4b5563", onPrimary: "#ffffff" },
782
- "#374151"
783
- );
784
- j(
785
- "Nebula",
786
- {
787
- primary: "#e879f9",
788
- primaryHover: "#d946ef",
789
- success: "#4ade80",
790
- warning: "#fbbf24",
791
- error: "#fb7185",
792
- info: "#67e8f9"
793
- },
794
- { primary: "#0d0117", secondary: "#1a0533", tertiary: "#2d0a52", hover: "#2d0a52" },
795
- { primary: "#fae8ff", secondary: "#d8b4fe", muted: "#7c3aed" },
796
- "#581c87"
797
- );
798
- j(
799
- "Abyss",
800
- {
801
- primary: "#22d3ee",
802
- primaryHover: "#06b6d4",
803
- success: "#34d399",
804
- warning: "#fbbf24",
805
- error: "#f87171",
806
- info: "#38bdf8"
807
- },
808
- { primary: "#001219", secondary: "#002a3a", tertiary: "#003e54", hover: "#003e54" },
809
- { primary: "#e0f2fe", secondary: "#7dd3fc", muted: "#0369a1" },
810
- "#075985"
811
- );
812
- j(
813
- "Shadow",
814
- {
815
- primary: "#a3a3a3",
816
- primaryHover: "#737373",
817
- success: "#4ade80",
818
- warning: "#facc15",
819
- error: "#f87171",
820
- info: "#38bdf8"
821
- },
822
- { primary: "#171717", secondary: "#1f1f1f", tertiary: "#2a2a2a", hover: "#2a2a2a" },
823
- { primary: "#e5e5e5", secondary: "#a3a3a3", muted: "#525252" },
824
- "#404040"
825
- );
826
- j(
827
- "Emerald Dark",
828
- {
829
- primary: "#34d399",
830
- primaryHover: "#10b981",
831
- success: "#4ade80",
832
- warning: "#fbbf24",
833
- error: "#f87171",
834
- info: "#22d3ee"
835
- },
836
- { primary: "#022c22", secondary: "#064e3b", tertiary: "#065f46", hover: "#065f46" },
837
- { primary: "#ecfdf5", secondary: "#6ee7b7", muted: "#047857" },
838
- "#047857"
839
- );
840
- $(
841
- "Forest",
842
- {
843
- primary: "#166534",
844
- primaryHover: "#14532d",
845
- success: "#22c55e",
846
- warning: "#ca8a04",
847
- error: "#dc2626",
848
- info: "#0891b2"
849
- },
850
- { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
851
- { primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
852
- "#86efac"
853
- );
854
- $(
855
- "Ocean",
856
- {
857
- primary: "#0369a1",
858
- primaryHover: "#075985",
859
- success: "#059669",
860
- warning: "#d97706",
861
- error: "#dc2626",
862
- info: "#0284c7"
863
- },
864
- { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
865
- { primary: "#0c4a6e", secondary: "#0369a1", muted: "#38bdf8" },
866
- "#7dd3fc"
867
- );
868
- $(
869
- "Desert",
870
- {
871
- primary: "#b45309",
872
- primaryHover: "#92400e",
873
- success: "#4d7c0f",
874
- warning: "#a16207",
875
- error: "#b91c1c",
876
- info: "#0e7490"
877
- },
878
- { primary: "#fefce8", secondary: "#fef9c3", tertiary: "#fef08a", hover: "#fef9c3" },
879
- { primary: "#422006", secondary: "#713f12", muted: "#ca8a04" },
880
- "#fde047"
881
- );
882
- $(
883
- "Sunset",
884
- {
885
- primary: "#ea580c",
886
- primaryHover: "#c2410c",
887
- success: "#16a34a",
888
- warning: "#d97706",
889
- error: "#dc2626",
890
- info: "#0891b2"
891
- },
892
- { primary: "#fff7ed", secondary: "#ffedd5", tertiary: "#fed7aa", hover: "#ffedd5" },
893
- { primary: "#431407", secondary: "#9a3412", muted: "#f97316" },
894
- "#fdba74"
895
- );
896
- $(
897
- "Aurora",
898
- {
899
- primary: "#0d9488",
900
- primaryHover: "#0f766e",
901
- success: "#22c55e",
902
- warning: "#eab308",
903
- error: "#ef4444",
904
- info: "#06b6d4"
905
- },
906
- { primary: "#f0fdfa", secondary: "#ccfbf1", tertiary: "#99f6e4", hover: "#ccfbf1" },
907
- { primary: "#134e4a", secondary: "#115e59", muted: "#2dd4bf" },
908
- "#5eead4"
909
- );
910
- $(
911
- "Lavender",
912
- {
913
- primary: "#7e22ce",
914
- primaryHover: "#6b21a8",
915
- success: "#16a34a",
916
- warning: "#d97706",
917
- error: "#dc2626",
918
- info: "#0891b2"
919
- },
920
- { primary: "#faf5ff", secondary: "#f3e8ff", tertiary: "#e9d5ff", hover: "#f3e8ff" },
921
- { primary: "#3b0764", secondary: "#581c87", muted: "#a855f7" },
922
- "#d8b4fe"
923
- );
924
- $(
925
- "Autumn",
926
- {
927
- primary: "#c2410c",
928
- primaryHover: "#9a3412",
929
- success: "#4d7c0f",
930
- warning: "#a16207",
931
- error: "#b91c1c",
932
- info: "#0e7490"
933
- },
934
- { primary: "#fef2f2", secondary: "#fee2e2", tertiary: "#fecaca", hover: "#fee2e2" },
935
- { primary: "#450a0a", secondary: "#7f1d1d", muted: "#f87171" },
936
- "#fca5a5"
937
- );
938
- $(
939
- "Spring",
940
- {
941
- primary: "#16a34a",
942
- primaryHover: "#15803d",
943
- success: "#22c55e",
944
- warning: "#eab308",
945
- error: "#ef4444",
946
- info: "#06b6d4"
947
- },
948
- { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
949
- { primary: "#14532d", secondary: "#166534", muted: "#4ade80" },
950
- "#86efac"
951
- );
952
- $(
953
- "Arctic",
954
- {
955
- primary: "#0ea5e9",
956
- primaryHover: "#0284c7",
957
- success: "#10b981",
958
- warning: "#f59e0b",
959
- error: "#ef4444",
960
- info: "#06b6d4"
961
- },
962
- { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
963
- { primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
964
- "#bae6fd"
965
- );
966
- $(
967
- "Tropical",
968
- {
969
- primary: "#0d9488",
970
- primaryHover: "#0f766e",
971
- success: "#16a34a",
972
- warning: "#f59e0b",
973
- error: "#ef4444",
974
- info: "#06b6d4"
975
- },
976
- { primary: "#ecfdf5", secondary: "#d1fae5", tertiary: "#a7f3d0", hover: "#d1fae5" },
977
- { primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
978
- "#a7f3d0"
979
- );
980
- $(
981
- "Pastel Rose",
982
- {
983
- primary: "#f472b6",
984
- primaryHover: "#ec4899",
985
- success: "#4ade80",
986
- warning: "#fcd34d",
987
- error: "#fb7185",
988
- info: "#67e8f9"
989
- },
990
- { primary: "#fdf2f8", secondary: "#fce7f3", tertiary: "#fbcfe8", hover: "#fce7f3" },
991
- { primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
992
- "#f9a8d4"
993
- );
994
- $(
995
- "Pastel Sky",
996
- {
997
- primary: "#38bdf8",
998
- primaryHover: "#0ea5e9",
999
- success: "#4ade80",
1000
- warning: "#fcd34d",
1001
- error: "#fb7185",
1002
- info: "#67e8f9"
1003
- },
1004
- { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
1005
- { primary: "#075985", secondary: "#0369a1", muted: "#7dd3fc" },
1006
- "#bae6fd"
1007
- );
1008
- $(
1009
- "Pastel Mint",
1010
- {
1011
- primary: "#34d399",
1012
- primaryHover: "#10b981",
1013
- success: "#4ade80",
1014
- warning: "#fcd34d",
1015
- error: "#fb7185",
1016
- info: "#67e8f9"
1017
- },
1018
- { primary: "#ecfdf5", secondary: "#d1fae5", tertiary: "#a7f3d0", hover: "#d1fae5" },
1019
- { primary: "#065f46", secondary: "#047857", muted: "#6ee7b7" },
1020
- "#a7f3d0"
1021
- );
1022
- $(
1023
- "Pastel Peach",
1024
- {
1025
- primary: "#fb923c",
1026
- primaryHover: "#f97316",
1027
- success: "#4ade80",
1028
- warning: "#fcd34d",
1029
- error: "#fb7185",
1030
- info: "#67e8f9"
1031
- },
1032
- { primary: "#fff7ed", secondary: "#ffedd5", tertiary: "#fed7aa", hover: "#ffedd5" },
1033
- { primary: "#7c2d12", secondary: "#9a3412", muted: "#fdba74" },
1034
- "#fed7aa"
1035
- );
1036
- $(
1037
- "Pastel Lavender",
1038
- {
1039
- primary: "#a78bfa",
1040
- primaryHover: "#8b5cf6",
1041
- success: "#4ade80",
1042
- warning: "#fcd34d",
1043
- error: "#fb7185",
1044
- info: "#67e8f9"
1045
- },
1046
- { primary: "#f5f3ff", secondary: "#ede9fe", tertiary: "#ddd6fe", hover: "#ede9fe" },
1047
- { primary: "#4c1d95", secondary: "#5b21b6", muted: "#c4b5fd" },
1048
- "#ddd6fe"
1049
- );
1050
- $(
1051
- "Pastel Lemon",
1052
- {
1053
- primary: "#facc15",
1054
- primaryHover: "#eab308",
1055
- success: "#4ade80",
1056
- warning: "#fcd34d",
1057
- error: "#fb7185",
1058
- info: "#67e8f9"
1059
- },
1060
- { primary: "#fefce8", secondary: "#fef9c3", tertiary: "#fef08a", hover: "#fef9c3" },
1061
- { primary: "#713f12", secondary: "#854d0e", muted: "#fde047" },
1062
- "#fef08a"
1063
- );
1064
- $(
1065
- "Pastel Sage",
1066
- {
1067
- primary: "#86efac",
1068
- primaryHover: "#4ade80",
1069
- success: "#22c55e",
1070
- warning: "#fcd34d",
1071
- error: "#fb7185",
1072
- info: "#67e8f9"
1073
- },
1074
- { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
1075
- { primary: "#166534", secondary: "#15803d", muted: "#86efac" },
1076
- "#bbf7d0"
1077
- );
1078
- $(
1079
- "Pastel Coral",
1080
- {
1081
- primary: "#fb7185",
1082
- primaryHover: "#f43f5e",
1083
- success: "#4ade80",
1084
- warning: "#fcd34d",
1085
- error: "#ef4444",
1086
- info: "#67e8f9"
1087
- },
1088
- { primary: "#fff1f2", secondary: "#ffe4e6", tertiary: "#fecdd3", hover: "#ffe4e6" },
1089
- { primary: "#881337", secondary: "#9f1239", muted: "#fda4af" },
1090
- "#fecdd3"
1091
- );
1092
- $(
1093
- "Banking",
1094
- {
1095
- primary: "#1e3a5f",
1096
- primaryHover: "#152c4a",
1097
- success: "#059669",
1098
- warning: "#d97706",
1099
- error: "#dc2626",
1100
- info: "#0891b2"
1101
- },
1102
- { primary: "#f8fafc", secondary: "#f1f5f9", tertiary: "#e2e8f0", hover: "#e2e8f0" },
1103
- { primary: "#0f172a", secondary: "#334155", muted: "#94a3b8" },
1104
- "#cbd5e1"
1105
- );
1106
- $(
1107
- "Healthcare",
1108
- {
1109
- primary: "#0891b2",
1110
- primaryHover: "#0e7490",
1111
- success: "#059669",
1112
- warning: "#d97706",
1113
- error: "#dc2626",
1114
- info: "#0284c7"
1115
- },
1116
- { primary: "#f0fdfa", secondary: "#e0f7fa", tertiary: "#b2ebf2", hover: "#e0f7fa" },
1117
- { primary: "#134e4a", secondary: "#1a6b6a", muted: "#80cbc4" },
1118
- "#b2dfdb"
1119
- );
1120
- $(
1121
- "Legal",
1122
- {
1123
- primary: "#1e293b",
1124
- primaryHover: "#0f172a",
1125
- success: "#059669",
1126
- warning: "#d97706",
1127
- error: "#dc2626",
1128
- info: "#0284c7"
1129
- },
1130
- { primary: "#fafaf9", secondary: "#f5f5f4", tertiary: "#e7e5e4", hover: "#e7e5e4" },
1131
- { primary: "#0f172a", secondary: "#44403c", muted: "#a8a29e" },
1132
- "#d6d3d1"
1133
- );
1134
- $(
1135
- "Tech Startup",
1136
- {
1137
- primary: "#7c3aed",
1138
- primaryHover: "#6d28d9",
1139
- success: "#10b981",
1140
- warning: "#f59e0b",
1141
- error: "#ef4444",
1142
- info: "#06b6d4"
1143
- },
1144
- { primary: "#faf5ff", secondary: "#f3e8ff", tertiary: "#e9d5ff", hover: "#f3e8ff" },
1145
- { primary: "#1e1b4b", secondary: "#4c1d95", muted: "#a78bfa" },
1146
- "#c4b5fd"
1147
- );
1148
- $(
1149
- "Enterprise",
1150
- {
1151
- primary: "#1e40af",
1152
- primaryHover: "#1e3a8a",
1153
- success: "#059669",
1154
- warning: "#d97706",
1155
- error: "#dc2626",
1156
- info: "#0891b2"
1157
- },
1158
- { primary: "#eff6ff", secondary: "#dbeafe", tertiary: "#bfdbfe", hover: "#dbeafe" },
1159
- { primary: "#1e3a5f", secondary: "#1e40af", muted: "#60a5fa" },
1160
- "#93c5fd"
1161
- );
1162
- $(
1163
- "Government",
1164
- {
1165
- primary: "#1d4ed8",
1166
- primaryHover: "#1e40af",
1167
- success: "#059669",
1168
- warning: "#d97706",
1169
- error: "#dc2626",
1170
- info: "#0891b2"
1171
- },
1172
- { primary: "#f8fafc", secondary: "#f1f5f9", tertiary: "#e2e8f0", hover: "#e2e8f0" },
1173
- { primary: "#0f172a", secondary: "#1e293b", muted: "#64748b" },
1174
- "#cbd5e1"
1175
- );
1176
- $(
1177
- "Education",
1178
- {
1179
- primary: "#059669",
1180
- primaryHover: "#047857",
1181
- success: "#16a34a",
1182
- warning: "#f59e0b",
1183
- error: "#ef4444",
1184
- info: "#0891b2"
1185
- },
1186
- { primary: "#f0fdf9", secondary: "#d1fae5", tertiary: "#a7f3d0", hover: "#d1fae5" },
1187
- { primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
1188
- "#a7f3d0"
1189
- );
1190
- $(
1191
- "Real Estate",
1192
- {
1193
- primary: "#92400e",
1194
- primaryHover: "#78350f",
1195
- success: "#059669",
1196
- warning: "#b45309",
1197
- error: "#dc2626",
1198
- info: "#0891b2"
1199
- },
1200
- { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1201
- { primary: "#422006", secondary: "#713f12", muted: "#d97706" },
1202
- "#fcd34d"
1203
- );
1204
- $(
1205
- "Nord",
1206
- {
1207
- primary: "#5e81ac",
1208
- primaryHover: "#4c6b90",
1209
- success: "#a3be8c",
1210
- warning: "#ebcb8b",
1211
- error: "#bf616a",
1212
- info: "#88c0d0"
1213
- },
1214
- { primary: "#eceff4", secondary: "#e5e9f0", tertiary: "#d8dee9", hover: "#d8dee9" },
1215
- { primary: "#2e3440", secondary: "#3b4252", muted: "#4c566a" },
1216
- "#d8dee9"
1217
- );
1218
- j(
1219
- "Dracula",
1220
- {
1221
- primary: "#bd93f9",
1222
- primaryHover: "#9d79d9",
1223
- success: "#50fa7b",
1224
- warning: "#f1fa8c",
1225
- error: "#ff5555",
1226
- info: "#8be9fd"
1227
- },
1228
- { primary: "#282a36", secondary: "#343746", tertiary: "#44475a", hover: "#44475a" },
1229
- { primary: "#f8f8f2", secondary: "#c0c0c0", muted: "#6272a4" },
1230
- "#44475a"
1231
- );
1232
- $(
1233
- "Solarized Light",
1234
- {
1235
- primary: "#268bd2",
1236
- primaryHover: "#1a6da0",
1237
- success: "#859900",
1238
- warning: "#b58900",
1239
- error: "#dc322f",
1240
- info: "#2aa198"
1241
- },
1242
- { primary: "#fdf6e3", secondary: "#eee8d5", tertiary: "#e0dbc7", hover: "#eee8d5" },
1243
- { primary: "#073642", secondary: "#586e75", muted: "#93a1a1" },
1244
- "#eee8d5"
1245
- );
1246
- j(
1247
- "Solarized Dark",
1248
- {
1249
- primary: "#268bd2",
1250
- primaryHover: "#3d98db",
1251
- success: "#859900",
1252
- warning: "#b58900",
1253
- error: "#dc322f",
1254
- info: "#2aa198"
1255
- },
1256
- { primary: "#002b36", secondary: "#073642", tertiary: "#0a4858", hover: "#073642" },
1257
- // Solarized red is a dark fill: white on it is 4.63 : 1, the dark default 3.86
1258
- { primary: "#eee8d5", secondary: "#93a1a1", muted: "#586e75", onError: "#ffffff" },
1259
- "#073642"
1260
- );
1261
- j(
1262
- "Monokai",
1263
- {
1264
- primary: "#66d9ef",
1265
- primaryHover: "#45c0d6",
1266
- success: "#a6e22e",
1267
- warning: "#e6db74",
1268
- error: "#f92672",
1269
- info: "#66d9ef"
1270
- },
1271
- { primary: "#272822", secondary: "#34352e", tertiary: "#3e3d32", hover: "#3e3d32" },
1272
- { primary: "#f8f8f2", secondary: "#cfcfc2", muted: "#75715e" },
1273
- "#3e3d32"
1274
- );
1275
- j(
1276
- "One Dark",
1277
- {
1278
- primary: "#61afef",
1279
- primaryHover: "#4b9ee0",
1280
- success: "#98c379",
1281
- warning: "#e5c07b",
1282
- error: "#e06c75",
1283
- info: "#56b6c2"
1284
- },
1285
- { primary: "#282c34", secondary: "#2c313a", tertiary: "#353b45", hover: "#353b45" },
1286
- { primary: "#abb2bf", secondary: "#828997", muted: "#545862" },
1287
- "#3e4452"
1288
- );
1289
- j(
1290
- "Synthwave",
1291
- {
1292
- primary: "#ff7edb",
1293
- primaryHover: "#e660c2",
1294
- success: "#72f1b8",
1295
- warning: "#fede5d",
1296
- error: "#fe4450",
1297
- info: "#36f9f6"
1298
- },
1299
- { primary: "#241b2f", secondary: "#2d2140", tertiary: "#362a50", hover: "#362a50" },
1300
- { primary: "#f0e4fc", secondary: "#b4a0cc", muted: "#6c5c84" },
1301
- "#4a3866"
1302
- );
1303
- $(
1304
- "Vaporwave",
1305
- {
1306
- primary: "#ff71ce",
1307
- primaryHover: "#e655b5",
1308
- success: "#78dcca",
1309
- warning: "#ffb86c",
1310
- error: "#ff5555",
1311
- info: "#76e8fc"
1312
- },
1313
- { primary: "#fce4f7", secondary: "#e8d0f4", tertiary: "#d4bcf0", hover: "#e8d0f4" },
1314
- { primary: "#4a1a4e", secondary: "#7b3f7d", muted: "#c080c0" },
1315
- "#d8a8e8"
1316
- );
1317
- j(
1318
- "Terminal Green",
1319
- {
1320
- primary: "#00ff41",
1321
- primaryHover: "#00cc34",
1322
- success: "#00ff41",
1323
- warning: "#ffff00",
1324
- error: "#ff0000",
1325
- info: "#00ffff"
1326
- },
1327
- { primary: "#0a0a0a", secondary: "#0d1a0d", tertiary: "#1a2e1a", hover: "#1a2e1a" },
1328
- { primary: "#00ff41", secondary: "#00cc33", muted: "#008822" },
1329
- "#003300"
1330
- );
1331
- $(
1332
- "Sepia",
1333
- {
1334
- primary: "#8b6914",
1335
- primaryHover: "#704f10",
1336
- success: "#6b8e23",
1337
- warning: "#cd853f",
1338
- error: "#b22222",
1339
- info: "#5f9ea0"
1340
- },
1341
- { primary: "#faf0e6", secondary: "#f5e6d3", tertiary: "#eddcc7", hover: "#f5e6d3" },
1342
- { primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
1343
- "#d7ccc8"
1344
- );
1345
- $(
1346
- "Vintage",
1347
- {
1348
- primary: "#8d6e63",
1349
- primaryHover: "#6d4c41",
1350
- success: "#66bb6a",
1351
- warning: "#ffb300",
1352
- error: "#e53935",
1353
- info: "#29b6f6"
1354
- },
1355
- { primary: "#efebe9", secondary: "#d7ccc8", tertiary: "#bcaaa4", hover: "#d7ccc8" },
1356
- { primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
1357
- "#bcaaa4"
1358
- );
1359
- j(
1360
- "Cyberpunk",
1361
- {
1362
- primary: "#00f0ff",
1363
- primaryHover: "#00c8d4",
1364
- success: "#39ff14",
1365
- warning: "#ffff00",
1366
- error: "#ff003c",
1367
- info: "#bf00ff"
1368
- },
1369
- { primary: "#0a0e17", secondary: "#131824", tertiary: "#1c2333", hover: "#1c2333" },
1370
- // the purple info fill is dark: white on it is 4.51 : 1, the dark default 3.96
1371
- { primary: "#e0fbfc", secondary: "#80d4dd", muted: "#3a6b72", onInfo: "#ffffff" },
1372
- "#1c3a44"
1373
- );
1374
- j(
1375
- "Neon",
1376
- {
1377
- primary: "#ff00ff",
1378
- primaryHover: "#cc00cc",
1379
- success: "#00ff00",
1380
- warning: "#ffff00",
1381
- error: "#ff0000",
1382
- info: "#00ffff"
1383
- },
1384
- { primary: "#0d0d0d", secondary: "#1a1a1a", tertiary: "#262626", hover: "#262626" },
1385
- { primary: "#ffffff", secondary: "#cccccc", muted: "#666666" },
1386
- "#333333"
1387
- );
1388
- j(
1389
- "Retrowave",
1390
- {
1391
- primary: "#f77fbe",
1392
- primaryHover: "#e462a3",
1393
- success: "#72f1b8",
1394
- warning: "#ffe261",
1395
- error: "#ff4444",
1396
- info: "#79e8fb"
1397
- },
1398
- { primary: "#1b0a2e", secondary: "#261440", tertiary: "#321e52", hover: "#321e52" },
1399
- { primary: "#ffe6f7", secondary: "#c9a0c9", muted: "#6b4c7a" },
1400
- "#4a2d66"
1401
- );
1402
- $(
1403
- "Christmas",
1404
- {
1405
- primary: "#c41e3a",
1406
- primaryHover: "#a01830",
1407
- success: "#228b22",
1408
- warning: "#ffd700",
1409
- error: "#dc2626",
1410
- info: "#0891b2"
1411
- },
1412
- { primary: "#fef2f2", secondary: "#fde8e8", tertiary: "#f8d0d0", hover: "#fde8e8" },
1413
- { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
1414
- "#e8a0a0"
1415
- );
1416
- j(
1417
- "Halloween",
1418
- {
1419
- primary: "#ff6600",
1420
- primaryHover: "#e05500",
1421
- success: "#4ade80",
1422
- warning: "#fbbf24",
1423
- error: "#ff0000",
1424
- info: "#9333ea"
1425
- },
1426
- { primary: "#1a0a00", secondary: "#2d1500", tertiary: "#402000", hover: "#402000" },
1427
- // purple-600 info is a dark fill: white on it is 5.38 : 1, the dark default 3.32
1428
- { primary: "#ffedd5", secondary: "#fdba74", muted: "#9a5c28", onInfo: "#ffffff" },
1429
- "#5c3400"
1430
- );
1431
- $(
1432
- "Valentine",
1433
- {
1434
- primary: "#e11d48",
1435
- primaryHover: "#be123c",
1436
- success: "#10b981",
1437
- warning: "#f59e0b",
1438
- error: "#dc2626",
1439
- info: "#ec4899"
1440
- },
1441
- { primary: "#fff1f2", secondary: "#ffe4e6", tertiary: "#fecdd3", hover: "#ffe4e6" },
1442
- { primary: "#4c0519", secondary: "#881337", muted: "#f9a8d4" },
1443
- "#fda4af"
1444
- );
1445
- $(
1446
- "Easter",
1447
- {
1448
- primary: "#a78bfa",
1449
- primaryHover: "#8b5cf6",
1450
- success: "#4ade80",
1451
- warning: "#fcd34d",
1452
- error: "#fb7185",
1453
- info: "#67e8f9"
1454
- },
1455
- { primary: "#fef9ff", secondary: "#f3e8ff", tertiary: "#e8d5ff", hover: "#f3e8ff" },
1456
- { primary: "#581c87", secondary: "#6d28d9", muted: "#c4b5fd" },
1457
- "#ddd6fe"
1458
- );
1459
- $(
1460
- "Summer Beach",
1461
- {
1462
- primary: "#0ea5e9",
1463
- primaryHover: "#0284c7",
1464
- success: "#10b981",
1465
- warning: "#f59e0b",
1466
- error: "#ef4444",
1467
- info: "#06b6d4"
1468
- },
1469
- { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1470
- { primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
1471
- "#fcd34d"
1472
- );
1473
- $(
1474
- "Winter Frost",
1475
- {
1476
- primary: "#3b82f6",
1477
- primaryHover: "#2563eb",
1478
- success: "#10b981",
1479
- warning: "#f59e0b",
1480
- error: "#ef4444",
1481
- info: "#06b6d4"
1482
- },
1483
- { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
1484
- { primary: "#1e3a5f", secondary: "#1e40af", muted: "#93c5fd" },
1485
- "#bfdbfe"
1486
- );
1487
- $(
1488
- "Cherry Blossom",
1489
- {
1490
- primary: "#ec4899",
1491
- primaryHover: "#db2777",
1492
- success: "#10b981",
1493
- warning: "#f59e0b",
1494
- error: "#ef4444",
1495
- info: "#06b6d4"
1496
- },
1497
- { primary: "#fdf2f8", secondary: "#fce7f3", tertiary: "#fbcfe8", hover: "#fce7f3" },
1498
- { primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
1499
- "#fbcfe8"
1500
- );
1501
- $(
1502
- "Harvest",
1503
- {
1504
- primary: "#b45309",
1505
- primaryHover: "#92400e",
1506
- success: "#4d7c0f",
1507
- warning: "#a16207",
1508
- error: "#b91c1c",
1509
- info: "#0e7490"
1510
- },
1511
- { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1512
- { primary: "#451a03", secondary: "#78350f", muted: "#d97706" },
1513
- "#fcd34d"
1514
- );
1515
- $(
1516
- "Japanese Zen",
1517
- {
1518
- primary: "#6b7280",
1519
- primaryHover: "#4b5563",
1520
- success: "#6b8e23",
1521
- warning: "#d4a017",
1522
- error: "#c0392b",
1523
- info: "#5f9ea0"
1524
- },
1525
- { primary: "#faf9f6", secondary: "#f0ece3", tertiary: "#e6e0d4", hover: "#f0ece3" },
1526
- { primary: "#2c2c2c", secondary: "#5c5c5c", muted: "#a0998a" },
1527
- "#d5cec0"
1528
- );
1529
- $(
1530
- "Moroccan",
1531
- {
1532
- primary: "#c2410c",
1533
- primaryHover: "#9a3412",
1534
- success: "#15803d",
1535
- warning: "#ca8a04",
1536
- error: "#b91c1c",
1537
- info: "#0e7490"
1538
- },
1539
- { primary: "#fffbf0", secondary: "#fef3e0", tertiary: "#fde6c4", hover: "#fef3e0" },
1540
- { primary: "#3a1a00", secondary: "#7c2d12", muted: "#d97706" },
1541
- "#f5d0a0"
1542
- );
1543
- $(
1544
- "Scandinavian",
1545
- {
1546
- primary: "#4b5563",
1547
- primaryHover: "#374151",
1548
- success: "#059669",
1549
- warning: "#d97706",
1550
- error: "#dc2626",
1551
- info: "#0891b2"
1552
- },
1553
- { primary: "#ffffff", secondary: "#f9fafb", tertiary: "#f3f4f6", hover: "#f3f4f6" },
1554
- { primary: "#111827", secondary: "#374151", muted: "#9ca3af" },
1555
- "#e5e7eb"
1556
- );
1557
- $(
1558
- "Mediterranean",
1559
- {
1560
- primary: "#1e40af",
1561
- primaryHover: "#1e3a8a",
1562
- success: "#059669",
1563
- warning: "#d97706",
1564
- error: "#dc2626",
1565
- info: "#0891b2"
1566
- },
1567
- { primary: "#eff6ff", secondary: "#dbeafe", tertiary: "#bfdbfe", hover: "#dbeafe" },
1568
- { primary: "#1e3a5f", secondary: "#2563eb", muted: "#93c5fd" },
1569
- "#bfdbfe"
1570
- );
1571
- $(
1572
- "Chinese New Year",
1573
- {
1574
- primary: "#dc2626",
1575
- primaryHover: "#b91c1c",
1576
- success: "#16a34a",
1577
- warning: "#d4a017",
1578
- error: "#ef4444",
1579
- info: "#0891b2"
1580
- },
1581
- { primary: "#fef2f2", secondary: "#fee2e2", tertiary: "#fecaca", hover: "#fee2e2" },
1582
- { primary: "#450a0a", secondary: "#991b1b", muted: "#f87171" },
1583
- "#fca5a5"
1584
- );
1585
- $(
1586
- "Indian Festive",
1587
- {
1588
- primary: "#d97706",
1589
- primaryHover: "#b45309",
1590
- success: "#16a34a",
1591
- warning: "#ca8a04",
1592
- error: "#dc2626",
1593
- info: "#7c3aed"
1594
- },
1595
- { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1596
- { primary: "#451a03", secondary: "#92400e", muted: "#f59e0b" },
1597
- "#fcd34d"
1598
- );
1599
- $(
1600
- "Brazilian Carnival",
1601
- {
1602
- primary: "#16a34a",
1603
- primaryHover: "#15803d",
1604
- success: "#22c55e",
1605
- warning: "#facc15",
1606
- error: "#ef4444",
1607
- info: "#0ea5e9"
1608
- },
1609
- { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
1610
- { primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
1611
- "#86efac"
1612
- );
1613
- $(
1614
- "African Earth",
1615
- {
1616
- primary: "#92400e",
1617
- primaryHover: "#78350f",
1618
- success: "#4d7c0f",
1619
- warning: "#a16207",
1620
- error: "#b91c1c",
1621
- info: "#0e7490"
1622
- },
1623
- { primary: "#faf5f0", secondary: "#f0e6d6", tertiary: "#e6d5bb", hover: "#f0e6d6" },
1624
- { primary: "#2b1a0e", secondary: "#5c3d1e", muted: "#a08060" },
1625
- "#d4b896"
1626
- );
1627
- j(
1628
- "High Contrast Dark",
1629
- {
1630
- primary: "#ffff00",
1631
- primaryHover: "#cccc00",
1632
- success: "#00ff00",
1633
- warning: "#ff8c00",
1634
- error: "#ff0000",
1635
- info: "#00ffff"
1636
- },
1637
- { primary: "#000000", secondary: "#1a1a1a", tertiary: "#333333", hover: "#333333" },
1638
- { primary: "#ffffff", secondary: "#ffffff", muted: "#cccccc" },
1639
- "#ffffff"
1640
- );
1641
- $(
1642
- "Monochrome",
1643
- {
1644
- primary: "#404040",
1645
- primaryHover: "#262626",
1646
- success: "#4d7c0f",
1647
- warning: "#a16207",
1648
- error: "#b91c1c",
1649
- info: "#0e7490"
1650
- },
1651
- { primary: "#fafafa", secondary: "#f0f0f0", tertiary: "#e0e0e0", hover: "#e0e0e0" },
1652
- { primary: "#1a1a1a", secondary: "#404040", muted: "#808080" },
1653
- "#c0c0c0"
1654
- );
1655
- $(
1656
- "Enhanced Contrast",
1657
- {
1658
- primary: "#0050b3",
1659
- primaryHover: "#003d8c",
1660
- success: "#006400",
1661
- warning: "#cc7000",
1662
- error: "#cc0000",
1663
- info: "#006680"
1664
- },
1665
- { primary: "#ffffff", secondary: "#f5f5f5", tertiary: "#ebebeb", hover: "#ebebeb" },
1666
- { primary: "#000000", secondary: "#1a1a1a", muted: "#595959" },
1667
- "#8c8c8c"
1668
- );
1669
- $(
1670
- "Minimalist",
1671
- {
1672
- primary: "#18181b",
1673
- primaryHover: "#27272a",
1674
- success: "#22c55e",
1675
- warning: "#eab308",
1676
- error: "#ef4444",
1677
- info: "#3b82f6"
1678
- },
1679
- { primary: "#ffffff", secondary: "#fafafa", tertiary: "#f5f5f5", hover: "#f5f5f5" },
1680
- { primary: "#0a0a0a", secondary: "#404040", muted: "#a3a3a3" },
1681
- "#e5e5e5"
1682
- );
1683
- j(
1684
- "Warm Dark",
1685
- {
1686
- primary: "#f59e0b",
1687
- primaryHover: "#d97706",
1688
- success: "#10b981",
1689
- warning: "#fbbf24",
1690
- error: "#f87171",
1691
- info: "#38bdf8"
1692
- },
1693
- { primary: "#1c1917", secondary: "#292524", tertiary: "#44403c", hover: "#44403c" },
1694
- { primary: "#fafaf9", secondary: "#d6d3d1", muted: "#78716c" },
1695
- "#57534e"
1696
- );
1697
- j(
1698
- "Soft Dark",
1699
- {
1700
- primary: "#a78bfa",
1701
- primaryHover: "#8b5cf6",
1702
- success: "#34d399",
1703
- warning: "#fcd34d",
1704
- error: "#fb7185",
1705
- info: "#67e8f9"
1706
- },
1707
- { primary: "#1e1e2e", secondary: "#262637", tertiary: "#313147", hover: "#313147" },
1708
- { primary: "#e8e8f0", secondary: "#a0a0b8", muted: "#5c5c74" },
1709
- "#3e3e58"
1710
- );
1711
- $(
1712
- "Coffee",
1713
- {
1714
- primary: "#6f4e37",
1715
- primaryHover: "#5c3d28",
1716
- success: "#4d7c0f",
1717
- warning: "#a16207",
1718
- error: "#b91c1c",
1719
- info: "#0e7490"
1720
- },
1721
- { primary: "#faf6f1", secondary: "#f0e8dc", tertiary: "#e6d8c6", hover: "#f0e8dc" },
1722
- { primary: "#2c1a0e", secondary: "#5c3d28", muted: "#a08868" },
1723
- "#d4c4a8"
1724
- );
1725
- $(
1726
- "Wine",
1727
- {
1728
- primary: "#7f1d1d",
1729
- primaryHover: "#641717",
1730
- success: "#059669",
1731
- warning: "#d97706",
1732
- error: "#dc2626",
1733
- info: "#0891b2"
1734
- },
1735
- { primary: "#fef2f2", secondary: "#fde8e8", tertiary: "#f8d0d0", hover: "#fde8e8" },
1736
- { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
1737
- "#e8a0a0"
1738
- );
1739
- const gr = process.env.NODE_ENV === "development";
1740
- let V = {
1741
- enabled: gr,
1742
- slowRenderThreshold: 16
1743
- };
1744
- const We = [], te = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
1745
- function yr() {
1746
- We.length = 0, te.clear(), _e.clear();
1747
- }
1748
- function hr(e) {
1749
- const t = V.slowRenderThreshold;
1750
- return We.filter((r) => r.actualDuration > t);
1751
- }
1752
- function ee(e) {
1753
- return e < 1 ? `${(e * 1e3).toFixed(0)}μs` : e < 1e3 ? `${e.toFixed(2)}ms` : `${(e / 1e3).toFixed(2)}s`;
1754
- }
1755
- function ei() {
1756
- const e = Array.from(te.values()), t = hr(), r = e.reduce((o, i) => o + i.renderCount, 0), a = e.length > 0 ? e.reduce((o, i) => o + i.avgRenderTime, 0) / e.length : 0, n = Array.from(_e.values());
1757
- return { stats: e, slowRenders: t, totalRenders: r, avgRenderTime: a, marks: n };
1758
- }
1759
- function br() {
1760
- const e = ei();
1761
- console.group(
1762
- "%c[Nice2Dev Performance Report]",
1763
- "color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"
1764
- ), console.log(`Total renders: ${e.totalRenders}`), console.log(`Average render time: ${ee(e.avgRenderTime)}`), console.log(`Slow renders: ${e.slowRenders.length}`), console.group("Component Stats"), console.table(
1765
- e.stats.sort((t, r) => r.totalRenderTime - t.totalRenderTime).map((t) => ({
1766
- Name: t.componentName,
1767
- Renders: t.renderCount,
1768
- "Avg Time": ee(t.avgRenderTime),
1769
- "Max Time": ee(t.maxRenderTime),
1770
- "Total Time": ee(t.totalRenderTime),
1771
- "Slow Renders": t.slowRenderCount
1772
- }))
1773
- ), console.groupEnd(), e.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
1774
- e.slowRenders.slice(-10).map((t) => ({
1775
- Component: t.componentName,
1776
- Phase: t.phase,
1777
- Duration: ee(t.actualDuration),
1778
- Time: new Date(t.timestamp).toLocaleTimeString()
1779
- }))
1780
- ), console.groupEnd()), e.marks.length > 0 && (console.group("Custom Marks"), console.table(
1781
- e.marks.filter((t) => t.duration).map((t) => ({
1782
- Name: t.name,
1783
- Duration: ee(t.duration)
1784
- }))
1785
- ), console.groupEnd()), console.groupEnd();
1786
- }
1787
- const ai = be.memo(
1788
- ({ position: e = "bottom-right", defaultCollapsed: t = true }) => {
1789
- const [r, a] = be.useState(t), [n, o] = be.useState([]), [i, s] = be.useState({ used: 0, total: 0 });
1790
- if (be.useEffect(() => {
1791
- const l = () => {
1792
- const u = Array.from(te.values());
1793
- o(u.sort((y, f) => f.totalRenderTime - y.totalRenderTime).slice(0, 10));
1794
- const m = window.performance;
1795
- m.memory && s({
1796
- used: m.memory.usedJSHeapSize / 1024 / 1024,
1797
- total: m.memory.totalJSHeapSize / 1024 / 1024
1798
- });
1799
- };
1800
- l();
1801
- const d = setInterval(l, 2e3);
1802
- return () => clearInterval(d);
1803
- }, []), !V.enabled)
1804
- return null;
1805
- const c = {
1806
- position: "fixed",
1807
- zIndex: 99999,
1808
- ...e.includes("top") ? { top: 8 } : { bottom: 8 },
1809
- ...e.includes("left") ? { left: 8 } : { right: 8 }
1810
- };
1811
- return /* @__PURE__ */ jsxRuntime.jsxs(
1812
- "div",
1813
- {
1814
- style: {
1815
- ...c,
1816
- background: "var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",
1817
- color: "var(--nice-color-white, #fff)",
1818
- borderRadius: 8,
1819
- fontSize: 11,
1820
- fontFamily: "Monaco, Consolas, monospace",
1821
- padding: r ? "4px 8px" : 8,
1822
- maxWidth: r ? "auto" : 300,
1823
- maxHeight: r ? "auto" : 400,
1824
- overflow: "auto"
1825
- },
1826
- children: [
1827
- /* @__PURE__ */ jsxRuntime.jsxs(
1828
- "div",
1829
- {
1830
- style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 8 },
1831
- onClick: () => a((l) => !l),
1832
- children: [
1833
- /* @__PURE__ */ jsxRuntime.jsx(
1834
- "span",
1835
- {
1836
- "aria-hidden": "true",
1837
- style: {
1838
- width: 8,
1839
- height: 8,
1840
- borderRadius: "50%",
1841
- background: "var(--nice-color-success, #22c55e)"
1842
- }
1843
- }
1844
- ),
1845
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Profiler" }),
1846
- i.used > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
1847
- "span",
1848
- {
1849
- style: {
1850
- color: i.used > 100 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-text-muted, #64748b)"
1851
- },
1852
- children: [
1853
- i.used.toFixed(0),
1854
- "MB"
1855
- ]
1856
- }
1857
- ),
1858
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { marginLeft: "auto", opacity: 0.5, display: "inline-flex" }, children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: r ? "chevron-down" : "chevron-up", size: 12 }) })
1859
- ]
1860
- }
1861
- ),
1862
- !r && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginTop: 8 }, children: [
1863
- /* @__PURE__ */ jsxRuntime.jsx(
1864
- "div",
1865
- {
1866
- style: {
1867
- borderBottom: "1px solid var(--nice-border-color, #333)",
1868
- paddingBottom: 4,
1869
- marginBottom: 8
1870
- },
1871
- children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Top Components" })
1872
- }
1873
- ),
1874
- n.map((l) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: 4, display: "flex", gap: 8 }, children: [
1875
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: l.componentName }),
1876
- /* @__PURE__ */ jsxRuntime.jsx(
1877
- "span",
1878
- {
1879
- style: {
1880
- color: l.avgRenderTime > 16 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-color-success, #22c55e)"
1881
- },
1882
- children: ee(l.avgRenderTime)
1883
- }
1884
- ),
1885
- /* @__PURE__ */ jsxRuntime.jsxs(
1886
- "span",
1887
- {
1888
- style: {
1889
- color: "var(--nice-text-muted, #64748b)",
1890
- minWidth: 30,
1891
- textAlign: "right"
1892
- },
1893
- children: [
1894
- "x",
1895
- l.renderCount
1896
- ]
1897
- }
1898
- )
1899
- ] }, l.componentName)),
1900
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginTop: 8, display: "flex", gap: 8 }, children: [
1901
- /* @__PURE__ */ jsxRuntime.jsx(
1902
- "button",
1903
- {
1904
- onClick: br,
1905
- style: {
1906
- flex: 1,
1907
- padding: "4px 8px",
1908
- background: "var(--nice-bg-tertiary, #333)",
1909
- border: "none",
1910
- borderRadius: 4,
1911
- color: "var(--nice-text-primary, #fff)",
1912
- cursor: "pointer",
1913
- fontSize: 10
1914
- },
1915
- children: "Print Report"
1916
- }
1917
- ),
1918
- /* @__PURE__ */ jsxRuntime.jsx(
1919
- "button",
1920
- {
1921
- onClick: yr,
1922
- style: {
1923
- flex: 1,
1924
- padding: "4px 8px",
1925
- background: "var(--nice-bg-tertiary, #333)",
1926
- border: "none",
1927
- borderRadius: 4,
1928
- color: "var(--nice-text-primary, #fff)",
1929
- cursor: "pointer",
1930
- fontSize: 10
1931
- },
1932
- children: "Clear"
1933
- }
1934
- )
1935
- ] })
1936
- ] })
1937
- ]
1938
- }
1939
- );
1940
- }
1941
- );
1942
- ai.displayName = "ProfilerOverlay";
299
+ process.env.NODE_ENV !== "production" && "NiceRTLProvider";
300
+ process.env.NODE_ENV !== "production" && "NiceAccessControl";
301
+ process.env.NODE_ENV !== "production" && "NiceA11yProvider";
302
+ process.env.NODE_ENV !== "production" && "NiceVisuallyHidden";
303
+ process.env.NODE_ENV !== "production" && "NiceSkipLink";
304
+ process.env.NODE_ENV !== "production" && "NiceKeyboardHint";
305
+ process.env.NODE_ENV !== "production" && "NiceThemeProvider";
306
+ process.env.NODE_ENV !== "production" && "NiceTestWrapper";
1943
307
  process.env.NODE_ENV === "development";
1944
- be.createContext(null);
1945
- be.createContext({
1946
- enabled: true,
1947
- active: false,
1948
- run: () => {
1949
- }
1950
- });
1951
- const Dt = "nice-tutorial-button-styles";
1952
- if (typeof document < "u" && !document.getElementById(Dt)) {
1953
- const e = document.createElement("style");
1954
- e.id = Dt, e.textContent = `
1955
- .nice-tutorial-button {
1956
- display: inline-flex;
1957
- align-items: center;
1958
- justify-content: center;
1959
- border: 1px solid var(--nice-border, #cbd5e1);
1960
- background: var(--nice-bg, #fff);
1961
- color: var(--nice-text-secondary, #475569);
1962
- border-radius: var(--nice-radius-full, 9999px);
1963
- cursor: help;
1964
- font-weight: 700;
1965
- line-height: 1;
1966
- padding: 0;
1967
- transition: background var(--nice-transition, 200ms ease), color var(--nice-transition, 200ms ease), border-color var(--nice-transition, 200ms ease);
1968
- }
1969
- .nice-tutorial-button:hover {
1970
- background: var(--nice-primary, #2563eb);
1971
- border-color: var(--nice-primary, #2563eb);
1972
- color: var(--nice-text-inverse, #fff);
1973
- }
1974
- .nice-tutorial-button:focus-visible {
1975
- outline: none;
1976
- box-shadow: 0 0 0 2px var(--nice-bg, #fff), 0 0 0 4px var(--nice-primary, #2563eb);
1977
- }
1978
- .nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
1979
- .nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
1980
- `, document.head.appendChild(e);
1981
- }
1982
- be.createContext(null);
1983
- be.createContext(null);
1984
- be.createContext(null);
1985
- be.createContext(null);
308
+ process.env.NODE_ENV === "development";
309
+ process.env.NODE_ENV !== "production" && "NiceHelpProvider";
310
+ process.env.NODE_ENV !== "production" && "NiceInlineHelp";
311
+ process.env.NODE_ENV !== "production" && "NiceQuickHelp";
312
+ process.env.NODE_ENV !== "production" && "NiceHelpIcon";
313
+ const EMPTY_RESOURCES = [];
314
+ const EMPTY_ALLOCATIONS = [];
1986
315
  const DEFAULT_VIEW_CONFIG$1 = {
1987
316
  timeUnit: "day",
1988
317
  showUtilization: true,
@@ -1999,8 +328,8 @@ const TIME_INCREMENTS = {
1999
328
  year: 365 * 24 * 60 * 60 * 1e3
2000
329
  };
2001
330
  const NiceCapacityPlanner = ({
2002
- resources,
2003
- allocations,
331
+ resources = EMPTY_RESOURCES,
332
+ allocations = EMPTY_ALLOCATIONS,
2004
333
  dateRange,
2005
334
  viewConfig: externalConfig,
2006
335
  onAllocationCreate,
@@ -2010,17 +339,18 @@ const NiceCapacityPlanner = ({
2010
339
  readOnly = false,
2011
340
  className = ""
2012
341
  }) => {
2013
- var _a2, _b;
342
+ var _a, _b;
343
+ const { t } = v();
2014
344
  const config = { ...DEFAULT_VIEW_CONFIG$1, ...externalConfig };
2015
- const [selectedAllocation, setSelectedAllocation] = be.useState(null);
2016
- const [hoveredCell, setHoveredCell] = be.useState(null);
2017
- const [timeUnit, setTimeUnit] = be.useState(config.timeUnit);
2018
- const [expandedResources, setExpandedResources] = be.useState(
345
+ const [selectedAllocation, setSelectedAllocation] = ve.useState(null);
346
+ const [hoveredCell, setHoveredCell] = ve.useState(null);
347
+ const [timeUnit, setTimeUnit] = ve.useState(config.timeUnit);
348
+ const [expandedResources, setExpandedResources] = ve.useState(
2019
349
  new Set(resources.map((r) => r.id))
2020
350
  );
2021
- const [showAllocationModal, setShowAllocationModal] = be.useState(false);
2022
- const [newAllocation, setNewAllocation] = be.useState({});
2023
- const timePeriods = be.useMemo(() => {
351
+ const [showAllocationModal, setShowAllocationModal] = ve.useState(false);
352
+ const [newAllocation, setNewAllocation] = ve.useState({});
353
+ const timePeriods = ve.useMemo(() => {
2024
354
  const periods = [];
2025
355
  const increment = TIME_INCREMENTS[timeUnit];
2026
356
  let current = new Date(dateRange.start);
@@ -2030,22 +360,22 @@ const NiceCapacityPlanner = ({
2030
360
  }
2031
361
  return periods;
2032
362
  }, [dateRange.start, dateRange.end, timeUnit]);
2033
- const utilizationMap = be.useMemo(() => {
363
+ const utilizationMap = ve.useMemo(() => {
2034
364
  const map = /* @__PURE__ */ new Map();
2035
365
  resources.forEach((resource) => {
2036
366
  const resourceMap = /* @__PURE__ */ new Map();
2037
367
  timePeriods.forEach((period) => {
2038
368
  const periodStart = period.getTime();
2039
369
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2040
- const periodAllocations = allocations.filter((a) => {
2041
- if (a.resourceId !== resource.id) {
370
+ const periodAllocations = allocations.filter((a2) => {
371
+ if (a2.resourceId !== resource.id) {
2042
372
  return false;
2043
373
  }
2044
- const allocStart = a.start.getTime();
2045
- const allocEnd = a.end.getTime();
374
+ const allocStart = a2.start.getTime();
375
+ const allocEnd = a2.end.getTime();
2046
376
  return allocStart < periodEnd && allocEnd > periodStart;
2047
377
  });
2048
- const allocatedHours = periodAllocations.reduce((sum, a) => sum + a.hoursPerDay, 0);
378
+ const allocatedHours = periodAllocations.reduce((sum, a2) => sum + a2.hoursPerDay, 0);
2049
379
  const availableHours = resource.maxCapacity;
2050
380
  const utilizationPercent = availableHours > 0 ? allocatedHours / availableHours * 100 : 0;
2051
381
  resourceMap.set(periodStart, {
@@ -2061,7 +391,7 @@ const NiceCapacityPlanner = ({
2061
391
  });
2062
392
  return map;
2063
393
  }, [resources, allocations, timePeriods, timeUnit]);
2064
- const conflicts = be.useMemo(() => {
394
+ const conflicts = ve.useMemo(() => {
2065
395
  const conflictList = [];
2066
396
  utilizationMap.forEach((resourceMap, resourceId) => {
2067
397
  const resource = resources.find((r) => r.id === resourceId);
@@ -2069,12 +399,12 @@ const NiceCapacityPlanner = ({
2069
399
  if (util.overallocated) {
2070
400
  const period = new Date(periodStart);
2071
401
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2072
- const conflictAllocations = allocations.filter((a) => {
2073
- if (a.resourceId !== resourceId) {
402
+ const conflictAllocations = allocations.filter((a2) => {
403
+ if (a2.resourceId !== resourceId) {
2074
404
  return false;
2075
405
  }
2076
- const allocStart = a.start.getTime();
2077
- const allocEnd = a.end.getTime();
406
+ const allocStart = a2.start.getTime();
407
+ const allocEnd = a2.end.getTime();
2078
408
  return allocStart < periodEnd && allocEnd > periodStart;
2079
409
  });
2080
410
  conflictList.push({
@@ -2089,24 +419,24 @@ const NiceCapacityPlanner = ({
2089
419
  });
2090
420
  return conflictList;
2091
421
  }, [utilizationMap, allocations, resources, timeUnit]);
2092
- const getCellAllocations = be.useCallback(
422
+ const getCellAllocations = ve.useCallback(
2093
423
  (resourceId, date) => {
2094
424
  const periodStart = date.getTime();
2095
425
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2096
- return allocations.filter((a) => {
2097
- if (a.resourceId !== resourceId) {
426
+ return allocations.filter((a2) => {
427
+ if (a2.resourceId !== resourceId) {
2098
428
  return false;
2099
429
  }
2100
- const allocStart = a.start.getTime();
2101
- const allocEnd = a.end.getTime();
430
+ const allocStart = a2.start.getTime();
431
+ const allocEnd = a2.end.getTime();
2102
432
  return allocStart < periodEnd && allocEnd > periodStart;
2103
433
  });
2104
434
  },
2105
435
  [allocations, timeUnit]
2106
436
  );
2107
437
  const getCellColor = (resourceId, date) => {
2108
- var _a3;
2109
- const util = (_a3 = utilizationMap.get(resourceId)) == null ? void 0 : _a3.get(date.getTime());
438
+ var _a2;
439
+ const util = (_a2 = utilizationMap.get(resourceId)) == null ? void 0 : _a2.get(date.getTime());
2110
440
  if (!util) {
2111
441
  return "transparent";
2112
442
  }
@@ -2136,7 +466,7 @@ const NiceCapacityPlanner = ({
2136
466
  }
2137
467
  };
2138
468
  const handleCellClick = (resourceId, date) => {
2139
- var _a3;
469
+ var _a2;
2140
470
  if (readOnly) {
2141
471
  return;
2142
472
  }
@@ -2144,7 +474,7 @@ const NiceCapacityPlanner = ({
2144
474
  resourceId,
2145
475
  start: date,
2146
476
  end: new Date(date.getTime() + TIME_INCREMENTS[timeUnit]),
2147
- hoursPerDay: ((_a3 = resources.find((r) => r.id === resourceId)) == null ? void 0 : _a3.maxCapacity) || 8,
477
+ hoursPerDay: ((_a2 = resources.find((r) => r.id === resourceId)) == null ? void 0 : _a2.maxCapacity) || 8,
2148
478
  status: "tentative"
2149
479
  });
2150
480
  setShowAllocationModal(true);
@@ -2191,122 +521,124 @@ const NiceCapacityPlanner = ({
2191
521
  }
2192
522
  };
2193
523
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-resource-allocation ${className}`, children: [
2194
- /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "allocation__toolbar", children: [
2195
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "toolbar__left", children: [
2196
- /* @__PURE__ */ jsxRuntime.jsx("h2", { children: "Resource Allocation" }),
2197
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "date-range", children: [
524
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "nice-resource-allocation__toolbar", children: [
525
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__toolbar-left", children: [
526
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { children: t("capacityPlanner.resourceAllocation", "Resource Allocation") }),
527
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-resource-allocation__date-range", children: [
2198
528
  dateRange.start.toLocaleDateString(),
2199
529
  " - ",
2200
530
  dateRange.end.toLocaleDateString()
2201
531
  ] })
2202
532
  ] }),
2203
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "toolbar__center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "time-unit-selector", children: ["day", "week", "month"].map((unit) => /* @__PURE__ */ jsxRuntime.jsx(
533
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-resource-allocation__toolbar-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-resource-allocation__time-unit-selector", children: ["day", "week", "month"].map((unit) => /* @__PURE__ */ jsxRuntime.jsx(
2204
534
  "button",
2205
535
  {
2206
- className: `unit-button ${timeUnit === unit ? "unit-button--active" : ""}`,
536
+ className: `nice-resource-allocation__unit-button ${timeUnit === unit ? "nice-resource-allocation__unit-button--active" : ""}`,
2207
537
  onClick: () => setTimeUnit(unit),
2208
538
  children: unit.charAt(0).toUpperCase() + unit.slice(1)
2209
539
  },
2210
540
  unit
2211
541
  )) }) }),
2212
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "toolbar__right", children: config.showConflicts && conflicts.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "conflicts-badge", children: [
2213
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "badge-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "warning", size: 14 }) }),
2214
- conflicts.length,
2215
- " Conflict",
2216
- conflicts.length !== 1 ? "s" : ""
542
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-resource-allocation__toolbar-right", children: config.showConflicts && conflicts.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__conflicts-badge", children: [
543
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-resource-allocation__badge-icon", children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "warning", size: 14 }) }),
544
+ (conflicts.length === 1 ? t("capacityPlanner.oneConflict", "1 Conflict") : t("capacityPlanner.conflicts", "{count} Conflicts")).replace("{count}", String(conflicts.length))
2217
545
  ] }) })
2218
546
  ] }),
2219
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "allocation__legend", children: [
2220
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "legend-item", children: [
547
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__legend", children: [
548
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__legend-item", children: [
2221
549
  /* @__PURE__ */ jsxRuntime.jsx(
2222
550
  "span",
2223
551
  {
2224
- className: "legend-color",
552
+ className: "nice-resource-allocation__legend-color",
2225
553
  style: { backgroundColor: "var(--nice-success-tint-20, rgba(34, 197, 94, 0.2))" }
2226
554
  }
2227
555
  ),
2228
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Allocated" })
556
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("capacityPlanner.allocated", "Allocated") })
2229
557
  ] }),
2230
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "legend-item", children: [
558
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__legend-item", children: [
2231
559
  /* @__PURE__ */ jsxRuntime.jsx(
2232
560
  "span",
2233
561
  {
2234
- className: "legend-color",
562
+ className: "nice-resource-allocation__legend-color",
2235
563
  style: { backgroundColor: "var(--nice-warning-tint-30, rgba(245, 158, 11, 0.3))" }
2236
564
  }
2237
565
  ),
2238
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2239
- "High Utilization (",
2240
- ">",
2241
- "=",
2242
- config.utilizationThreshold,
2243
- "%)"
2244
- ] })
566
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t(
567
+ "capacityPlanner.highUtilization",
568
+ "High Utilization (>={utilizationThreshold}%)"
569
+ ).replace("{utilizationThreshold}", String(config.utilizationThreshold)) })
2245
570
  ] }),
2246
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "legend-item", children: [
571
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__legend-item", children: [
2247
572
  /* @__PURE__ */ jsxRuntime.jsx(
2248
573
  "span",
2249
574
  {
2250
- className: "legend-color",
575
+ className: "nice-resource-allocation__legend-color",
2251
576
  style: { backgroundColor: "var(--nice-danger-tint-40, rgba(239, 68, 68, 0.4))" }
2252
577
  }
2253
578
  ),
2254
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Overallocated" })
579
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("capacityPlanner.overallocated", "Overallocated") })
2255
580
  ] })
2256
581
  ] }),
2257
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "allocation__grid", children: [
2258
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid__header", children: [
2259
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "resource-header", children: "Resource" }),
2260
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "time-headers", children: timePeriods.map((period, idx) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "time-header", children: formatDate(period) }, idx)) })
582
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__grid", children: [
583
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__grid-header", children: [
584
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-resource-allocation__resource-header", children: t("capacityPlanner.resource", "Resource") }),
585
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-resource-allocation__time-headers", children: timePeriods.map((period, idx) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-resource-allocation__time-header", children: formatDate(period) }, idx)) })
2261
586
  ] }),
2262
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid__body", children: resources.map((resource) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "resource-row", children: [
2263
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "resource-cell", onClick: () => onResourceClick == null ? void 0 : onResourceClick(resource), children: [
2264
- /* @__PURE__ */ jsxRuntime.jsx(
2265
- "button",
2266
- {
2267
- className: "expand-button",
2268
- onClick: (e) => {
2269
- e.stopPropagation();
2270
- toggleResource(resource.id);
2271
- },
2272
- children: /* @__PURE__ */ jsxRuntime.jsx(
2273
- Ae,
587
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-resource-allocation__grid-body", children: resources.map((resource) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__resource-row", children: [
588
+ /* @__PURE__ */ jsxRuntime.jsxs(
589
+ "div",
590
+ {
591
+ className: "nice-resource-allocation__resource-cell",
592
+ onClick: () => onResourceClick == null ? void 0 : onResourceClick(resource),
593
+ children: [
594
+ /* @__PURE__ */ jsxRuntime.jsx(
595
+ "button",
2274
596
  {
2275
- name: expandedResources.has(resource.id) ? "chevron-down" : "chevron-right",
2276
- size: 14
597
+ className: "nice-resource-allocation__expand-button",
598
+ onClick: (e) => {
599
+ e.stopPropagation();
600
+ toggleResource(resource.id);
601
+ },
602
+ children: /* @__PURE__ */ jsxRuntime.jsx(
603
+ ae,
604
+ {
605
+ name: expandedResources.has(resource.id) ? "chevron-down" : "chevron-right",
606
+ size: 14
607
+ }
608
+ )
2277
609
  }
2278
- )
2279
- }
2280
- ),
2281
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "resource-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: getResourceTypeIcon(resource.type), size: 16 }) }),
2282
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "resource-info", children: [
2283
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "resource-name", children: resource.name }),
2284
- resource.department && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "resource-dept", children: resource.department })
2285
- ] }),
2286
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "resource-capacity", children: [
2287
- resource.maxCapacity,
2288
- "h/day"
2289
- ] })
2290
- ] }),
2291
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "time-cells", children: timePeriods.map((period, idx) => {
2292
- var _a3;
610
+ ),
611
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-resource-allocation__resource-icon", children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: getResourceTypeIcon(resource.type), size: 16 }) }),
612
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__resource-info", children: [
613
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-resource-allocation__resource-name", children: resource.name }),
614
+ resource.department && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-resource-allocation__resource-dept", children: resource.department })
615
+ ] }),
616
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-resource-allocation__resource-capacity", children: t("capacityPlanner.hDay", "{maxCapacity}h/day").replace(
617
+ "{maxCapacity}",
618
+ String(resource.maxCapacity)
619
+ ) })
620
+ ]
621
+ }
622
+ ),
623
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-resource-allocation__time-cells", children: timePeriods.map((period, idx) => {
624
+ var _a2;
2293
625
  const cellAllocations = getCellAllocations(resource.id, period);
2294
- const util = (_a3 = utilizationMap.get(resource.id)) == null ? void 0 : _a3.get(period.getTime());
626
+ const util = (_a2 = utilizationMap.get(resource.id)) == null ? void 0 : _a2.get(period.getTime());
2295
627
  const isHovered = (hoveredCell == null ? void 0 : hoveredCell.resourceId) === resource.id && (hoveredCell == null ? void 0 : hoveredCell.date.getTime()) === period.getTime();
2296
628
  return /* @__PURE__ */ jsxRuntime.jsxs(
2297
629
  "div",
2298
630
  {
2299
- className: `time-cell ${isHovered ? "time-cell--hovered" : ""}`,
631
+ className: `nice-resource-allocation__time-cell ${isHovered ? "nice-resource-allocation__time-cell--hovered" : ""}`,
2300
632
  style: { backgroundColor: getCellColor(resource.id, period) },
2301
633
  onClick: () => handleCellClick(resource.id, period),
2302
634
  onMouseEnter: () => setHoveredCell({ resourceId: resource.id, date: period }),
2303
635
  onMouseLeave: () => setHoveredCell(null),
2304
636
  children: [
2305
- cellAllocations.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "allocation-indicators", children: [
637
+ cellAllocations.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__allocation-indicators", children: [
2306
638
  cellAllocations.slice(0, 2).map((alloc) => /* @__PURE__ */ jsxRuntime.jsx(
2307
639
  "div",
2308
640
  {
2309
- className: `allocation-dot ${alloc.status}`,
641
+ className: `nice-resource-allocation__allocation-dot nice-resource-allocation__allocation-dot--${alloc.status}`,
2310
642
  onClick: (e) => {
2311
643
  e.stopPropagation();
2312
644
  setSelectedAllocation(alloc.id);
@@ -2314,12 +646,12 @@ const NiceCapacityPlanner = ({
2314
646
  },
2315
647
  alloc.id
2316
648
  )),
2317
- cellAllocations.length > 2 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "more-indicator", children: [
649
+ cellAllocations.length > 2 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-resource-allocation__more-indicator", children: [
2318
650
  "+",
2319
651
  cellAllocations.length - 2
2320
652
  ] })
2321
653
  ] }),
2322
- config.showUtilization && util && util.allocatedHours > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "utilization-label", children: [
654
+ config.showUtilization && util && util.allocatedHours > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-resource-allocation__utilization-label", children: [
2323
655
  util.allocatedHours.toFixed(1),
2324
656
  "h"
2325
657
  ] })
@@ -2328,7 +660,7 @@ const NiceCapacityPlanner = ({
2328
660
  idx
2329
661
  );
2330
662
  }) }),
2331
- expandedResources.has(resource.id) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "expanded-allocations", children: allocations.filter((a) => a.resourceId === resource.id).map((allocation) => {
663
+ expandedResources.has(resource.id) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-resource-allocation__expanded-allocations", children: allocations.filter((a2) => a2.resourceId === resource.id).map((allocation) => {
2332
664
  const startIdx = timePeriods.findIndex(
2333
665
  (p) => p.getTime() <= allocation.start.getTime()
2334
666
  );
@@ -2344,26 +676,27 @@ const NiceCapacityPlanner = ({
2344
676
  return /* @__PURE__ */ jsxRuntime.jsxs(
2345
677
  "div",
2346
678
  {
2347
- className: `allocation-bar ${allocation.status} ${selectedAllocation === allocation.id ? "selected" : ""}`,
679
+ className: `nice-resource-allocation__allocation-bar nice-resource-allocation__allocation-bar--${allocation.status} ${selectedAllocation === allocation.id ? "nice-resource-allocation__allocation-bar--selected" : ""}`,
2348
680
  style: {
2349
681
  left: `${leftPercent}%`,
2350
682
  width: `${widthPercent}%`
2351
683
  },
2352
684
  onClick: () => setSelectedAllocation(allocation.id),
2353
685
  children: [
2354
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "allocation-label", children: [
2355
- allocation.hoursPerDay,
2356
- "h/day"
2357
- ] }),
686
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-resource-allocation__allocation-label", children: t("capacityPlanner.hDay2", "{hoursPerDay}h/day").replace(
687
+ "{hoursPerDay}",
688
+ String(allocation.hoursPerDay)
689
+ ) }),
2358
690
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
2359
691
  "button",
2360
692
  {
2361
- className: "delete-allocation",
693
+ "aria-label": t("capacityPlanner.close", "Close"),
694
+ className: "nice-resource-allocation__delete-allocation",
2362
695
  onClick: (e) => {
2363
696
  e.stopPropagation();
2364
697
  onAllocationDelete == null ? void 0 : onAllocationDelete(allocation.id);
2365
698
  },
2366
- children: "×"
699
+ children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "close", size: 14 })
2367
700
  }
2368
701
  )
2369
702
  ]
@@ -2373,98 +706,127 @@ const NiceCapacityPlanner = ({
2373
706
  }) })
2374
707
  ] }, resource.id)) })
2375
708
  ] }),
2376
- showAllocationModal && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-overlay", onClick: () => setShowAllocationModal(false), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "allocation-modal", onClick: (e) => e.stopPropagation(), children: [
2377
- /* @__PURE__ */ jsxRuntime.jsx("h3", { children: "Create Allocation" }),
2378
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-form", children: [
2379
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2380
- "Resource",
2381
- /* @__PURE__ */ jsxRuntime.jsxs(
2382
- "select",
2383
- {
2384
- value: newAllocation.resourceId || "",
2385
- onChange: (e) => setNewAllocation((prev) => ({ ...prev, resourceId: e.target.value })),
2386
- children: [
2387
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "Select resource..." }),
2388
- resources.map((r) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: r.id, children: r.name }, r.id))
2389
- ]
2390
- }
2391
- )
2392
- ] }),
2393
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2394
- "Start Date",
2395
- /* @__PURE__ */ jsxRuntime.jsx(
2396
- "input",
2397
- {
2398
- type: "date",
2399
- value: ((_a2 = newAllocation.start) == null ? void 0 : _a2.toISOString().split("T")[0]) || "",
2400
- onChange: (e) => setNewAllocation((prev) => ({ ...prev, start: new Date(e.target.value) }))
2401
- }
2402
- )
2403
- ] }),
2404
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2405
- "End Date",
2406
- /* @__PURE__ */ jsxRuntime.jsx(
2407
- "input",
2408
- {
2409
- type: "date",
2410
- value: ((_b = newAllocation.end) == null ? void 0 : _b.toISOString().split("T")[0]) || "",
2411
- onChange: (e) => setNewAllocation((prev) => ({ ...prev, end: new Date(e.target.value) }))
2412
- }
2413
- )
2414
- ] }),
2415
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2416
- "Hours per Day",
2417
- /* @__PURE__ */ jsxRuntime.jsx(
2418
- "input",
2419
- {
2420
- type: "number",
2421
- min: "0.5",
2422
- max: "24",
2423
- step: "0.5",
2424
- value: newAllocation.hoursPerDay || 8,
2425
- onChange: (e) => setNewAllocation((prev) => ({
2426
- ...prev,
2427
- hoursPerDay: parseFloat(e.target.value)
2428
- }))
2429
- }
2430
- )
2431
- ] }),
2432
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2433
- "Status",
2434
- /* @__PURE__ */ jsxRuntime.jsxs(
2435
- "select",
2436
- {
2437
- value: newAllocation.status || "tentative",
2438
- onChange: (e) => setNewAllocation((prev) => ({
2439
- ...prev,
2440
- status: e.target.value
2441
- })),
2442
- children: [
2443
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "tentative", children: "Tentative" }),
2444
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "confirmed", children: "Confirmed" })
2445
- ]
2446
- }
2447
- )
2448
- ] }),
2449
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2450
- "Notes",
2451
- /* @__PURE__ */ jsxRuntime.jsx(
2452
- "textarea",
2453
- {
2454
- value: newAllocation.notes || "",
2455
- onChange: (e) => setNewAllocation((prev) => ({ ...prev, notes: e.target.value })),
2456
- placeholder: "Optional notes..."
2457
- }
2458
- )
2459
- ] })
2460
- ] }),
2461
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-actions", children: [
2462
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "cancel-button", onClick: () => setShowAllocationModal(false), children: "Cancel" }),
2463
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "create-button", onClick: handleCreateAllocation, children: "Create Allocation" })
2464
- ] })
2465
- ] }) })
709
+ showAllocationModal && /* @__PURE__ */ jsxRuntime.jsx(
710
+ "div",
711
+ {
712
+ className: "nice-resource-allocation__modal-overlay",
713
+ onClick: () => setShowAllocationModal(false),
714
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
715
+ "div",
716
+ {
717
+ className: "nice-resource-allocation__allocation-modal",
718
+ onClick: (e) => e.stopPropagation(),
719
+ children: [
720
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { children: t("capacityPlanner.createAllocation", "Create Allocation") }),
721
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__modal-form", children: [
722
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
723
+ t("capacityPlanner.resource", "Resource"),
724
+ /* @__PURE__ */ jsxRuntime.jsxs(
725
+ "select",
726
+ {
727
+ value: newAllocation.resourceId || "",
728
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, resourceId: e.target.value })),
729
+ children: [
730
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("capacityPlanner.selectResource", "Select resource...") }),
731
+ resources.map((r) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: r.id, children: r.name }, r.id))
732
+ ]
733
+ }
734
+ )
735
+ ] }),
736
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
737
+ t("capacityPlanner.startDate", "Start Date"),
738
+ /* @__PURE__ */ jsxRuntime.jsx(
739
+ "input",
740
+ {
741
+ type: "date",
742
+ value: ((_a = newAllocation.start) == null ? void 0 : _a.toISOString().split("T")[0]) || "",
743
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, start: new Date(e.target.value) }))
744
+ }
745
+ )
746
+ ] }),
747
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
748
+ t("capacityPlanner.endDate", "End Date"),
749
+ /* @__PURE__ */ jsxRuntime.jsx(
750
+ "input",
751
+ {
752
+ type: "date",
753
+ value: ((_b = newAllocation.end) == null ? void 0 : _b.toISOString().split("T")[0]) || "",
754
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, end: new Date(e.target.value) }))
755
+ }
756
+ )
757
+ ] }),
758
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
759
+ t("capacityPlanner.hoursPerDay", "Hours per Day"),
760
+ /* @__PURE__ */ jsxRuntime.jsx(
761
+ "input",
762
+ {
763
+ type: "number",
764
+ min: "0.5",
765
+ max: "24",
766
+ step: "0.5",
767
+ value: newAllocation.hoursPerDay || 8,
768
+ onChange: (e) => setNewAllocation((prev) => ({
769
+ ...prev,
770
+ hoursPerDay: parseFloat(e.target.value)
771
+ }))
772
+ }
773
+ )
774
+ ] }),
775
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
776
+ t("capacityPlanner.status", "Status"),
777
+ /* @__PURE__ */ jsxRuntime.jsxs(
778
+ "select",
779
+ {
780
+ value: newAllocation.status || "tentative",
781
+ onChange: (e) => setNewAllocation((prev) => ({
782
+ ...prev,
783
+ status: e.target.value
784
+ })),
785
+ children: [
786
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "tentative", children: t("capacityPlanner.tentative", "Tentative") }),
787
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "confirmed", children: t("capacityPlanner.confirmed", "Confirmed") })
788
+ ]
789
+ }
790
+ )
791
+ ] }),
792
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
793
+ t("capacityPlanner.notes", "Notes"),
794
+ /* @__PURE__ */ jsxRuntime.jsx(
795
+ "textarea",
796
+ {
797
+ value: newAllocation.notes || "",
798
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, notes: e.target.value })),
799
+ placeholder: t("capacityPlanner.optionalNotes", "Optional notes...")
800
+ }
801
+ )
802
+ ] })
803
+ ] }),
804
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__modal-actions", children: [
805
+ /* @__PURE__ */ jsxRuntime.jsx(
806
+ "button",
807
+ {
808
+ className: "nice-resource-allocation__cancel-button",
809
+ onClick: () => setShowAllocationModal(false),
810
+ children: t("capacityPlanner.cancel", "Cancel")
811
+ }
812
+ ),
813
+ /* @__PURE__ */ jsxRuntime.jsx(
814
+ "button",
815
+ {
816
+ className: "nice-resource-allocation__create-button",
817
+ onClick: handleCreateAllocation,
818
+ children: t("capacityPlanner.createAllocation", "Create Allocation")
819
+ }
820
+ )
821
+ ] })
822
+ ]
823
+ }
824
+ )
825
+ }
826
+ )
2466
827
  ] });
2467
828
  };
829
+ const EMPTY_ITEMS = [];
2468
830
  const DEFAULT_VIEW_CONFIG = {
2469
831
  view: "grid",
2470
832
  sortBy: "name",
@@ -2473,7 +835,7 @@ const DEFAULT_VIEW_CONFIG = {
2473
835
  pageSize: 24
2474
836
  };
2475
837
  const NiceInventoryManager = ({
2476
- items,
838
+ items = EMPTY_ITEMS,
2477
839
  transactions = [],
2478
840
  viewConfig: externalConfig,
2479
841
  onItemCreate,
@@ -2482,38 +844,40 @@ const NiceInventoryManager = ({
2482
844
  onTransactionCreate,
2483
845
  onStockCount,
2484
846
  onItemClick,
847
+ onCreatePurchaseOrder,
2485
848
  readOnly = false,
2486
849
  className = ""
2487
850
  }) => {
2488
- var _a2, _b;
851
+ var _a, _b;
852
+ const { t } = v();
2489
853
  const config = { ...DEFAULT_VIEW_CONFIG, ...externalConfig };
2490
- const [filters, setFilters] = be.useState({});
2491
- const [view, setView] = be.useState(config.view);
2492
- const [sortBy, setSortBy] = be.useState(config.sortBy);
2493
- const [sortOrder, setSortOrder] = be.useState(config.sortOrder);
2494
- const [page, setPage] = be.useState(1);
2495
- const [selectedItems, setSelectedItems] = be.useState(/* @__PURE__ */ new Set());
2496
- const [showItemModal, setShowItemModal] = be.useState(false);
2497
- const [showTransactionModal, setShowTransactionModal] = be.useState(false);
2498
- const [editingItem, setEditingItem] = be.useState(null);
2499
- const [newTransaction, setNewTransaction] = be.useState({});
2500
- const [activeTab, setActiveTab] = be.useState("inventory");
2501
- const categories = be.useMemo(() => {
854
+ const [filters, setFilters] = ve.useState({});
855
+ const [view, setView] = ve.useState(config.view);
856
+ const [sortBy, setSortBy] = ve.useState(config.sortBy);
857
+ const [sortOrder, setSortOrder] = ve.useState(config.sortOrder);
858
+ const [page, setPage] = ve.useState(1);
859
+ const [selectedItems, setSelectedItems] = ve.useState(/* @__PURE__ */ new Set());
860
+ const [showItemModal, setShowItemModal] = ve.useState(false);
861
+ const [showTransactionModal, setShowTransactionModal] = ve.useState(false);
862
+ const [editingItem, setEditingItem] = ve.useState(null);
863
+ const [newTransaction, setNewTransaction] = ve.useState({});
864
+ const [activeTab, setActiveTab] = ve.useState("inventory");
865
+ const categories = ve.useMemo(() => {
2502
866
  return Array.from(new Set(items.map((item) => item.category))).sort();
2503
867
  }, [items]);
2504
- const filteredItems = be.useMemo(() => {
2505
- var _a3, _b2;
868
+ const filteredItems = ve.useMemo(() => {
869
+ var _a2, _b2;
2506
870
  let result = [...items];
2507
871
  if (filters.searchQuery) {
2508
872
  const query = filters.searchQuery.toLowerCase();
2509
873
  result = result.filter(
2510
874
  (item) => {
2511
- var _a4;
2512
- return item.name.toLowerCase().includes(query) || item.sku.toLowerCase().includes(query) || ((_a4 = item.description) == null ? void 0 : _a4.toLowerCase().includes(query));
875
+ var _a3;
876
+ return item.name.toLowerCase().includes(query) || item.sku.toLowerCase().includes(query) || ((_a3 = item.description) == null ? void 0 : _a3.toLowerCase().includes(query));
2513
877
  }
2514
878
  );
2515
879
  }
2516
- if ((_a3 = filters.categories) == null ? void 0 : _a3.length) {
880
+ if ((_a2 = filters.categories) == null ? void 0 : _a2.length) {
2517
881
  result = result.filter((item) => filters.categories.includes(item.category));
2518
882
  }
2519
883
  if ((_b2 = filters.statuses) == null ? void 0 : _b2.length) {
@@ -2522,42 +886,42 @@ const NiceInventoryManager = ({
2522
886
  if (filters.lowStockOnly) {
2523
887
  result = result.filter((item) => item.quantity <= item.reorderLevel);
2524
888
  }
2525
- result.sort((a, b) => {
2526
- var _a4, _b3;
889
+ result.sort((a2, b) => {
890
+ var _a3, _b3;
2527
891
  let comparison = 0;
2528
892
  switch (sortBy) {
2529
893
  case "name":
2530
- comparison = a.name.localeCompare(b.name);
894
+ comparison = a2.name.localeCompare(b.name);
2531
895
  break;
2532
896
  case "sku":
2533
- comparison = a.sku.localeCompare(b.sku);
897
+ comparison = a2.sku.localeCompare(b.sku);
2534
898
  break;
2535
899
  case "quantity":
2536
- comparison = a.quantity - b.quantity;
900
+ comparison = a2.quantity - b.quantity;
2537
901
  break;
2538
902
  case "value":
2539
- comparison = a.quantity * a.cost.amount - b.quantity * b.cost.amount;
903
+ comparison = a2.quantity * a2.cost.amount - b.quantity * b.cost.amount;
2540
904
  break;
2541
905
  case "lastUpdated":
2542
- comparison = (((_a4 = a.lastCountDate) == null ? void 0 : _a4.getTime()) || 0) - (((_b3 = b.lastCountDate) == null ? void 0 : _b3.getTime()) || 0);
906
+ comparison = (((_a3 = a2.lastCountDate) == null ? void 0 : _a3.getTime()) || 0) - (((_b3 = b.lastCountDate) == null ? void 0 : _b3.getTime()) || 0);
2543
907
  break;
2544
908
  }
2545
909
  return sortOrder === "asc" ? comparison : -comparison;
2546
910
  });
2547
911
  return result;
2548
912
  }, [items, filters, sortBy, sortOrder]);
2549
- const paginatedItems = be.useMemo(() => {
913
+ const paginatedItems = ve.useMemo(() => {
2550
914
  const start = (page - 1) * config.pageSize;
2551
915
  return filteredItems.slice(start, start + config.pageSize);
2552
916
  }, [filteredItems, page, config.pageSize]);
2553
917
  const totalPages = Math.ceil(filteredItems.length / config.pageSize);
2554
- const reorderItems = be.useMemo(() => {
918
+ const reorderItems = ve.useMemo(() => {
2555
919
  return items.filter((item) => item.quantity <= item.reorderLevel);
2556
920
  }, [items]);
2557
- const recentTransactions = be.useMemo(() => {
2558
- return [...transactions].sort((a, b) => b.date.getTime() - a.date.getTime()).slice(0, 50);
921
+ const recentTransactions = ve.useMemo(() => {
922
+ return [...transactions].sort((a2, b) => b.date.getTime() - a2.date.getTime()).slice(0, 50);
2559
923
  }, [transactions]);
2560
- const kanbanGroups = be.useMemo(() => {
924
+ const kanbanGroups = ve.useMemo(() => {
2561
925
  if (view !== "kanban") {
2562
926
  return null;
2563
927
  }
@@ -2571,8 +935,8 @@ const NiceInventoryManager = ({
2571
935
  ];
2572
936
  statuses.forEach((status) => groups.set(status, []));
2573
937
  filteredItems.forEach((item) => {
2574
- var _a3;
2575
- (_a3 = groups.get(item.status)) == null ? void 0 : _a3.push(item);
938
+ var _a2;
939
+ (_a2 = groups.get(item.status)) == null ? void 0 : _a2.push(item);
2576
940
  });
2577
941
  return groups;
2578
942
  }, [filteredItems, view]);
@@ -2653,35 +1017,35 @@ const NiceInventoryManager = ({
2653
1017
  });
2654
1018
  };
2655
1019
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-inventory-manager ${className}`, children: [
2656
- /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "inventory__toolbar", children: [
2657
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "toolbar__left", children: [
2658
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "search-box", children: [
1020
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "nice-inventory-manager__toolbar", children: [
1021
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__toolbar-left", children: [
1022
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__search-box", children: [
2659
1023
  /* @__PURE__ */ jsxRuntime.jsx(
2660
1024
  "input",
2661
1025
  {
2662
1026
  type: "text",
2663
- placeholder: "Search items...",
1027
+ placeholder: t("inventoryManager.searchItems", "Search items..."),
2664
1028
  value: filters.searchQuery || "",
2665
1029
  onChange: (e) => setFilters((prev) => ({ ...prev, searchQuery: e.target.value }))
2666
1030
  }
2667
1031
  ),
2668
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "search-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "search", size: 14 }) })
1032
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__search-icon", children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "search", size: 14 }) })
2669
1033
  ] }),
2670
1034
  /* @__PURE__ */ jsxRuntime.jsxs(
2671
1035
  "select",
2672
1036
  {
2673
- value: ((_a2 = filters.categories) == null ? void 0 : _a2[0]) || "",
1037
+ value: ((_a = filters.categories) == null ? void 0 : _a[0]) || "",
2674
1038
  onChange: (e) => setFilters((prev) => ({
2675
1039
  ...prev,
2676
1040
  categories: e.target.value ? [e.target.value] : void 0
2677
1041
  })),
2678
1042
  children: [
2679
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "All Categories" }),
1043
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("inventoryManager.allCategories", "All Categories") }),
2680
1044
  categories.map((cat) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: cat, children: cat }, cat))
2681
1045
  ]
2682
1046
  }
2683
1047
  ),
2684
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "filter-checkbox", children: [
1048
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "nice-inventory-manager__filter-checkbox", children: [
2685
1049
  /* @__PURE__ */ jsxRuntime.jsx(
2686
1050
  "input",
2687
1051
  {
@@ -2690,29 +1054,29 @@ const NiceInventoryManager = ({
2690
1054
  onChange: (e) => setFilters((prev) => ({ ...prev, lowStockOnly: e.target.checked }))
2691
1055
  }
2692
1056
  ),
2693
- "Low Stock Only"
1057
+ t("inventoryManager.lowStockOnly", "Low Stock Only")
2694
1058
  ] })
2695
1059
  ] }),
2696
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "toolbar__right", children: [
2697
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "view-selector", children: ["grid", "list", "kanban"].map((v) => /* @__PURE__ */ jsxRuntime.jsx(
1060
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__toolbar-right", children: [
1061
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__view-selector", children: ["grid", "list", "kanban"].map((v2) => /* @__PURE__ */ jsxRuntime.jsx(
2698
1062
  "button",
2699
1063
  {
2700
- className: `view-button ${view === v ? "view-button--active" : ""}`,
2701
- onClick: () => setView(v),
1064
+ className: `nice-inventory-manager__view-button ${view === v2 ? "nice-inventory-manager__view-button--active" : ""}`,
1065
+ onClick: () => setView(v2),
2702
1066
  children: /* @__PURE__ */ jsxRuntime.jsx(
2703
- Ae,
1067
+ ae,
2704
1068
  {
2705
- name: v === "grid" ? "grid" : v === "list" ? "list" : "table",
1069
+ name: v2 === "grid" ? "grid" : v2 === "list" ? "list" : "table",
2706
1070
  size: 14
2707
1071
  }
2708
1072
  )
2709
1073
  },
2710
- v
1074
+ v2
2711
1075
  )) }),
2712
1076
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
2713
1077
  "button",
2714
1078
  {
2715
- className: "add-button",
1079
+ className: "nice-inventory-manager__add-button",
2716
1080
  onClick: () => {
2717
1081
  setEditingItem({
2718
1082
  category: categories[0],
@@ -2725,100 +1089,99 @@ const NiceInventoryManager = ({
2725
1089
  });
2726
1090
  setShowItemModal(true);
2727
1091
  },
2728
- children: "+ Add Item"
1092
+ children: t("inventoryManager.addItem", "+ Add Item")
2729
1093
  }
2730
1094
  )
2731
1095
  ] })
2732
1096
  ] }),
2733
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inventory__tabs", children: [
2734
- /* @__PURE__ */ jsxRuntime.jsxs(
1097
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__tabs", children: [
1098
+ /* @__PURE__ */ jsxRuntime.jsx(
2735
1099
  "button",
2736
1100
  {
2737
- className: `tab ${activeTab === "inventory" ? "tab--active" : ""}`,
1101
+ className: `nice-inventory-manager__tab ${activeTab === "inventory" ? "nice-inventory-manager__tab--active" : ""}`,
2738
1102
  onClick: () => setActiveTab("inventory"),
2739
- children: [
2740
- "Inventory (",
2741
- items.length,
2742
- ")"
2743
- ]
1103
+ children: t("inventoryManager.inventory", "Inventory ({items})").replace(
1104
+ "{items}",
1105
+ String(items.length)
1106
+ )
2744
1107
  }
2745
1108
  ),
2746
- /* @__PURE__ */ jsxRuntime.jsxs(
1109
+ /* @__PURE__ */ jsxRuntime.jsx(
2747
1110
  "button",
2748
1111
  {
2749
- className: `tab ${activeTab === "transactions" ? "tab--active" : ""}`,
1112
+ className: `nice-inventory-manager__tab ${activeTab === "transactions" ? "nice-inventory-manager__tab--active" : ""}`,
2750
1113
  onClick: () => setActiveTab("transactions"),
2751
- children: [
2752
- "Transactions (",
2753
- transactions.length,
2754
- ")"
2755
- ]
1114
+ children: t("inventoryManager.transactions", "Transactions ({transactions})").replace(
1115
+ "{transactions}",
1116
+ String(transactions.length)
1117
+ )
2756
1118
  }
2757
1119
  ),
2758
1120
  /* @__PURE__ */ jsxRuntime.jsxs(
2759
1121
  "button",
2760
1122
  {
2761
- className: `tab ${activeTab === "reorder" ? "tab--active" : ""}`,
1123
+ className: `nice-inventory-manager__tab ${activeTab === "reorder" ? "nice-inventory-manager__tab--active" : ""}`,
2762
1124
  onClick: () => setActiveTab("reorder"),
2763
1125
  children: [
2764
- "Reorder Alerts",
2765
- reorderItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "alert-badge", children: reorderItems.length })
1126
+ t("inventoryManager.reorderAlerts", "Reorder Alerts"),
1127
+ reorderItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__alert-badge", children: reorderItems.length })
2766
1128
  ]
2767
1129
  }
2768
1130
  )
2769
1131
  ] }),
2770
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inventory__content", children: [
1132
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__content", children: [
2771
1133
  activeTab === "inventory" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2772
- view === "grid" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "items-grid", children: paginatedItems.map((item) => {
2773
- var _a3;
1134
+ view === "grid" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__items-grid", children: paginatedItems.map((item) => {
1135
+ var _a2;
2774
1136
  return /* @__PURE__ */ jsxRuntime.jsxs(
2775
1137
  "div",
2776
1138
  {
2777
- className: `item-card ${selectedItems.has(item.id) ? "item-card--selected" : ""}`,
1139
+ className: `nice-inventory-manager__item-card ${selectedItems.has(item.id) ? "nice-inventory-manager__item-card--selected" : ""}`,
2778
1140
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2779
1141
  children: [
2780
1142
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
2781
1143
  "input",
2782
1144
  {
2783
1145
  type: "checkbox",
2784
- className: "item-checkbox",
1146
+ className: "nice-inventory-manager__item-checkbox",
2785
1147
  checked: selectedItems.has(item.id),
2786
1148
  onChange: () => toggleItemSelection(item.id),
2787
1149
  onClick: (e) => e.stopPropagation()
2788
1150
  }
2789
1151
  ),
2790
- config.showImages && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "item-image", children: ((_a3 = item.images) == null ? void 0 : _a3[0]) ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: item.images[0], alt: item.name }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "placeholder-image", children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "box", size: 32 }) }) }),
2791
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "item-info", children: [
2792
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "item-sku", children: item.sku }),
2793
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "item-name", children: item.name }),
2794
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "item-category", children: item.category })
1152
+ config.showImages && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__item-image", children: ((_a2 = item.images) == null ? void 0 : _a2[0]) ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: item.images[0], alt: item.name }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__placeholder-image", children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "box", size: 32 }) }) }),
1153
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__item-info", children: [
1154
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__item-sku", children: item.sku }),
1155
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "nice-inventory-manager__item-name", children: item.name }),
1156
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__item-category", children: item.category })
2795
1157
  ] }),
2796
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "item-stock", children: [
1158
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__item-stock", children: [
2797
1159
  /* @__PURE__ */ jsxRuntime.jsx(
2798
1160
  "span",
2799
1161
  {
2800
- className: "status-badge",
1162
+ className: "nice-inventory-manager__status-badge",
2801
1163
  style: { backgroundColor: getStatusColor(item.status) },
2802
1164
  children: item.status.replace("-", " ")
2803
1165
  }
2804
1166
  ),
2805
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "quantity", children: [
1167
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__quantity", children: [
2806
1168
  item.quantity,
2807
1169
  " ",
2808
1170
  item.unit
2809
1171
  ] }),
2810
- item.quantity <= item.reorderLevel && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "reorder-alert", children: [
2811
- /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "warning", size: 12 }),
2812
- " Low Stock"
1172
+ item.quantity <= item.reorderLevel && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__reorder-alert", children: [
1173
+ /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "warning", size: 12 }),
1174
+ " ",
1175
+ t("inventoryManager.lowStock", "Low Stock")
2813
1176
  ] })
2814
1177
  ] }),
2815
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "item-value", children: formatCurrency(item.quantity * item.cost.amount, item.cost.currency.symbol) })
1178
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__item-value", children: formatCurrency(item.quantity * item.cost.amount, item.cost.currency.symbol) })
2816
1179
  ]
2817
1180
  },
2818
1181
  item.id
2819
1182
  );
2820
1183
  }) }),
2821
- view === "list" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "items-table", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { children: [
1184
+ view === "list" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__items-table", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { children: [
2822
1185
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2823
1186
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx("th", {}),
2824
1187
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2829,8 +1192,15 @@ const NiceInventoryManager = ({
2829
1192
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2830
1193
  },
2831
1194
  children: [
2832
- "SKU ",
2833
- sortBy === "sku" && (sortOrder === "asc" ? "↑" : "↓")
1195
+ t("inventoryManager.sku", "SKU"),
1196
+ " ",
1197
+ sortBy === "sku" && /* @__PURE__ */ jsxRuntime.jsx(
1198
+ ae,
1199
+ {
1200
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1201
+ size: 12
1202
+ }
1203
+ )
2834
1204
  ]
2835
1205
  }
2836
1206
  ),
@@ -2842,12 +1212,19 @@ const NiceInventoryManager = ({
2842
1212
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2843
1213
  },
2844
1214
  children: [
2845
- "Name ",
2846
- sortBy === "name" && (sortOrder === "asc" ? "↑" : "↓")
1215
+ t("inventoryManager.name", "Name"),
1216
+ " ",
1217
+ sortBy === "name" && /* @__PURE__ */ jsxRuntime.jsx(
1218
+ ae,
1219
+ {
1220
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1221
+ size: 12
1222
+ }
1223
+ )
2847
1224
  ]
2848
1225
  }
2849
1226
  ),
2850
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Category" }),
1227
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: t("inventoryManager.category", "Category") }),
2851
1228
  /* @__PURE__ */ jsxRuntime.jsxs(
2852
1229
  "th",
2853
1230
  {
@@ -2856,13 +1233,20 @@ const NiceInventoryManager = ({
2856
1233
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2857
1234
  },
2858
1235
  children: [
2859
- "Qty ",
2860
- sortBy === "quantity" && (sortOrder === "asc" ? "↑" : "↓")
1236
+ t("inventoryManager.qty", "Qty"),
1237
+ " ",
1238
+ sortBy === "quantity" && /* @__PURE__ */ jsxRuntime.jsx(
1239
+ ae,
1240
+ {
1241
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1242
+ size: 12
1243
+ }
1244
+ )
2861
1245
  ]
2862
1246
  }
2863
1247
  ),
2864
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Status" }),
2865
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Location" }),
1248
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: t("inventoryManager.status", "Status") }),
1249
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: t("inventoryManager.location", "Location") }),
2866
1250
  /* @__PURE__ */ jsxRuntime.jsxs(
2867
1251
  "th",
2868
1252
  {
@@ -2871,17 +1255,24 @@ const NiceInventoryManager = ({
2871
1255
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2872
1256
  },
2873
1257
  children: [
2874
- "Value ",
2875
- sortBy === "value" && (sortOrder === "asc" ? "↑" : "↓")
1258
+ t("inventoryManager.value", "Value"),
1259
+ " ",
1260
+ sortBy === "value" && /* @__PURE__ */ jsxRuntime.jsx(
1261
+ ae,
1262
+ {
1263
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1264
+ size: 12
1265
+ }
1266
+ )
2876
1267
  ]
2877
1268
  }
2878
1269
  ),
2879
- !readOnly && /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Actions" })
1270
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsx("th", { children: t("inventoryManager.actions", "Actions") })
2880
1271
  ] }) }),
2881
1272
  /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: paginatedItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
2882
1273
  "tr",
2883
1274
  {
2884
- className: selectedItems.has(item.id) ? "row--selected" : "",
1275
+ className: `nice-inventory-manager__row ${selectedItems.has(item.id) ? "nice-inventory-manager__row--selected" : ""}`,
2885
1276
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2886
1277
  children: [
2887
1278
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -2893,18 +1284,24 @@ const NiceInventoryManager = ({
2893
1284
  onClick: (e) => e.stopPropagation()
2894
1285
  }
2895
1286
  ) }),
2896
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "sku-cell", children: item.sku }),
1287
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-inventory-manager__sku-cell", children: item.sku }),
2897
1288
  /* @__PURE__ */ jsxRuntime.jsx("td", { children: item.name }),
2898
1289
  /* @__PURE__ */ jsxRuntime.jsx("td", { children: item.category }),
2899
- /* @__PURE__ */ jsxRuntime.jsxs("td", { className: item.quantity <= item.reorderLevel ? "low-stock" : "", children: [
2900
- item.quantity,
2901
- " ",
2902
- item.unit
2903
- ] }),
1290
+ /* @__PURE__ */ jsxRuntime.jsxs(
1291
+ "td",
1292
+ {
1293
+ className: `nice-inventory-manager__qty-cell ${item.quantity <= item.reorderLevel ? "nice-inventory-manager__qty-cell--low-stock" : ""}`,
1294
+ children: [
1295
+ item.quantity,
1296
+ " ",
1297
+ item.unit
1298
+ ]
1299
+ }
1300
+ ),
2904
1301
  /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx(
2905
1302
  "span",
2906
1303
  {
2907
- className: "status-badge",
1304
+ className: "nice-inventory-manager__status-badge",
2908
1305
  style: { backgroundColor: getStatusColor(item.status) },
2909
1306
  children: item.status.replace("-", " ")
2910
1307
  }
@@ -2914,40 +1311,40 @@ const NiceInventoryManager = ({
2914
1311
  item.quantity * item.cost.amount,
2915
1312
  item.cost.currency.symbol
2916
1313
  ) }),
2917
- !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "actions-cell", children: [
1314
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "nice-inventory-manager__actions-cell", children: [
2918
1315
  /* @__PURE__ */ jsxRuntime.jsx(
2919
1316
  "button",
2920
1317
  {
2921
- className: "action-btn",
1318
+ className: "nice-inventory-manager__action-btn",
2922
1319
  onClick: (e) => {
2923
1320
  e.stopPropagation();
2924
1321
  setEditingItem(item);
2925
1322
  setShowItemModal(true);
2926
1323
  },
2927
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "edit", size: 14 })
1324
+ children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "edit", size: 14 })
2928
1325
  }
2929
1326
  ),
2930
1327
  /* @__PURE__ */ jsxRuntime.jsx(
2931
1328
  "button",
2932
1329
  {
2933
- className: "action-btn",
1330
+ className: "nice-inventory-manager__action-btn",
2934
1331
  onClick: (e) => {
2935
1332
  e.stopPropagation();
2936
1333
  setNewTransaction({ itemId: item.id });
2937
1334
  setShowTransactionModal(true);
2938
1335
  },
2939
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "clipboard", size: 14 })
1336
+ children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "clipboard", size: 14 })
2940
1337
  }
2941
1338
  ),
2942
1339
  /* @__PURE__ */ jsxRuntime.jsx(
2943
1340
  "button",
2944
1341
  {
2945
- className: "action-btn action-btn--danger",
1342
+ className: "nice-inventory-manager__action-btn nice-inventory-manager__action-btn--danger",
2946
1343
  onClick: (e) => {
2947
1344
  e.stopPropagation();
2948
1345
  onItemDelete == null ? void 0 : onItemDelete(item.id);
2949
1346
  },
2950
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "trash", size: 14 })
1347
+ children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "trash", size: 14 })
2951
1348
  }
2952
1349
  )
2953
1350
  ] })
@@ -2956,27 +1353,34 @@ const NiceInventoryManager = ({
2956
1353
  item.id
2957
1354
  )) })
2958
1355
  ] }) }),
2959
- view === "kanban" && kanbanGroups && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "items-kanban", children: Array.from(kanbanGroups.entries()).map(([status, statusItems]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "kanban-column", children: [
2960
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "column-header", style: { borderColor: getStatusColor(status) }, children: [
2961
- /* @__PURE__ */ jsxRuntime.jsx(
2962
- "span",
2963
- {
2964
- className: "status-dot",
2965
- style: { backgroundColor: getStatusColor(status) }
2966
- }
2967
- ),
2968
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "column-title", children: status.replace("-", " ") }),
2969
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "column-count", children: statusItems.length })
2970
- ] }),
2971
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "column-items", children: statusItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
1356
+ view === "kanban" && kanbanGroups && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__items-kanban", children: Array.from(kanbanGroups.entries()).map(([status, statusItems]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__kanban-column", children: [
1357
+ /* @__PURE__ */ jsxRuntime.jsxs(
1358
+ "div",
1359
+ {
1360
+ className: "nice-inventory-manager__column-header",
1361
+ style: { borderColor: getStatusColor(status) },
1362
+ children: [
1363
+ /* @__PURE__ */ jsxRuntime.jsx(
1364
+ "span",
1365
+ {
1366
+ className: "nice-inventory-manager__status-dot",
1367
+ style: { backgroundColor: getStatusColor(status) }
1368
+ }
1369
+ ),
1370
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__column-title", children: status.replace("-", " ") }),
1371
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__column-count", children: statusItems.length })
1372
+ ]
1373
+ }
1374
+ ),
1375
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__column-items", children: statusItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
2972
1376
  "div",
2973
1377
  {
2974
- className: "kanban-card",
1378
+ className: "nice-inventory-manager__kanban-card",
2975
1379
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2976
1380
  children: [
2977
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "card-sku", children: item.sku }),
2978
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "card-name", children: item.name }),
2979
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "card-qty", children: [
1381
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__card-sku", children: item.sku }),
1382
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__card-name", children: item.name }),
1383
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__card-qty", children: [
2980
1384
  item.quantity,
2981
1385
  " ",
2982
1386
  item.unit
@@ -2986,298 +1390,334 @@ const NiceInventoryManager = ({
2986
1390
  item.id
2987
1391
  )) })
2988
1392
  ] }, status)) }),
2989
- totalPages > 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pagination", children: [
2990
- /* @__PURE__ */ jsxRuntime.jsx("button", { disabled: page === 1, onClick: () => setPage((p) => p - 1), children: "Previous" }),
2991
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2992
- "Page ",
2993
- page,
2994
- " of ",
2995
- totalPages
2996
- ] }),
2997
- /* @__PURE__ */ jsxRuntime.jsx("button", { disabled: page === totalPages, onClick: () => setPage((p) => p + 1), children: "Next" })
1393
+ totalPages > 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__pagination", children: [
1394
+ /* @__PURE__ */ jsxRuntime.jsx("button", { disabled: page === 1, onClick: () => setPage((p) => p - 1), children: t("inventoryManager.previous", "Previous") }),
1395
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("inventoryManager.pageOf", "Page {page} of {totalPages}").replace("{page}", String(page)).replace("{totalPages}", String(totalPages)) }),
1396
+ /* @__PURE__ */ jsxRuntime.jsx("button", { disabled: page === totalPages, onClick: () => setPage((p) => p + 1), children: t("inventoryManager.next", "Next") })
2998
1397
  ] })
2999
1398
  ] }),
3000
- activeTab === "transactions" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "transactions-tab", children: [
1399
+ activeTab === "transactions" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__transactions-tab", children: [
3001
1400
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
3002
1401
  "button",
3003
1402
  {
3004
- className: "add-transaction-button",
1403
+ className: "nice-inventory-manager__add-transaction-button",
3005
1404
  onClick: () => setShowTransactionModal(true),
3006
- children: "+ New Transaction"
1405
+ children: t("inventoryManager.newTransaction", "+ New Transaction")
3007
1406
  }
3008
1407
  ),
3009
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "transactions-list", children: recentTransactions.map((tx) => {
3010
- const item = items.find((i) => i.id === tx.itemId);
3011
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "transaction-item", children: [
3012
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tx-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: getTransactionIcon(tx.type), size: 16 }) }),
3013
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tx-info", children: [
3014
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tx-type", children: tx.type }),
3015
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tx-item", children: (item == null ? void 0 : item.name) || tx.itemId })
1408
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__transactions-list", children: recentTransactions.map((tx) => {
1409
+ const item = items.find((i2) => i2.id === tx.itemId);
1410
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__transaction-item", children: [
1411
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__tx-icon", children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: getTransactionIcon(tx.type), size: 16 }) }),
1412
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__tx-info", children: [
1413
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__tx-type", children: tx.type }),
1414
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__tx-item", children: (item == null ? void 0 : item.name) || tx.itemId })
3016
1415
  ] }),
3017
1416
  /* @__PURE__ */ jsxRuntime.jsxs(
3018
1417
  "span",
3019
1418
  {
3020
- className: `tx-qty ${tx.type === "receipt" || tx.type === "return" ? "positive" : "negative"}`,
1419
+ className: `nice-inventory-manager__tx-qty ${tx.type === "receipt" || tx.type === "return" ? "nice-inventory-manager__tx-qty--positive" : "nice-inventory-manager__tx-qty--negative"}`,
3021
1420
  children: [
3022
1421
  tx.type === "receipt" || tx.type === "return" ? "+" : "-",
3023
1422
  tx.quantity
3024
1423
  ]
3025
1424
  }
3026
1425
  ),
3027
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tx-date", children: tx.date.toLocaleString() }),
3028
- tx.reference && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tx-ref", children: [
3029
- "Ref: ",
3030
- tx.reference
3031
- ] })
1426
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__tx-date", children: tx.date.toLocaleString() }),
1427
+ tx.reference && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__tx-ref", children: t("inventoryManager.ref", "Ref: {reference}").replace(
1428
+ "{reference}",
1429
+ String(tx.reference)
1430
+ ) })
3032
1431
  ] }, tx.id);
3033
1432
  }) })
3034
1433
  ] }),
3035
- activeTab === "reorder" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "reorder-tab", children: reorderItems.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "empty-state", children: [
3036
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "empty-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "success", size: 32 }) }),
3037
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "All items are sufficiently stocked" })
3038
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "reorder-list", children: reorderItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "reorder-item", children: [
3039
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "reorder-info", children: [
3040
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "reorder-sku", children: item.sku }),
3041
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "reorder-name", children: item.name })
1434
+ activeTab === "reorder" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__reorder-tab", children: reorderItems.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__empty-state", children: [
1435
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__empty-icon", children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "success", size: 32 }) }),
1436
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: t(
1437
+ "inventoryManager.allItemsAreSufficientlyStocked",
1438
+ "All items are sufficiently stocked"
1439
+ ) })
1440
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__reorder-list", children: reorderItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__reorder-item", children: [
1441
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__reorder-info", children: [
1442
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__reorder-sku", children: item.sku }),
1443
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__reorder-name", children: item.name })
3042
1444
  ] }),
3043
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "reorder-stock", children: [
3044
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "current-qty", children: [
3045
- "Current: ",
3046
- item.quantity,
3047
- " ",
3048
- item.unit
3049
- ] }),
3050
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "reorder-level", children: [
3051
- "Reorder at: ",
3052
- item.reorderLevel
3053
- ] }),
3054
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "reorder-qty", children: [
3055
- "Order qty: ",
3056
- item.reorderQuantity
3057
- ] })
1445
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__reorder-stock", children: [
1446
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__current-qty", children: t("inventoryManager.current", "Current: {quantity} {unit}").replace("{quantity}", String(item.quantity)).replace("{unit}", String(item.unit)) }),
1447
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__reorder-level", children: t("inventoryManager.reorderAt", "Reorder at: {reorderLevel}").replace(
1448
+ "{reorderLevel}",
1449
+ String(item.reorderLevel)
1450
+ ) }),
1451
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__reorder-qty", children: t("inventoryManager.orderQty", "Order qty: {reorderQuantity}").replace(
1452
+ "{reorderQuantity}",
1453
+ String(item.reorderQuantity)
1454
+ ) })
3058
1455
  ] }),
3059
- item.supplier && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "supplier-name", children: item.supplier.name }),
3060
- !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
1456
+ item.supplier && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__supplier-name", children: item.supplier.name }),
1457
+ !readOnly && onCreatePurchaseOrder && /* @__PURE__ */ jsxRuntime.jsx(
3061
1458
  "button",
3062
1459
  {
3063
- className: "create-po-button",
3064
- onClick: () => console.log("Create PO for", item.id),
3065
- children: "Create PO"
1460
+ type: "button",
1461
+ className: "nice-inventory-manager__create-po-button",
1462
+ onClick: () => onCreatePurchaseOrder(item),
1463
+ children: t("inventoryManager.createPo", "Create PO")
3066
1464
  }
3067
1465
  )
3068
1466
  ] }, item.id)) }) })
3069
1467
  ] }),
3070
- showItemModal && editingItem && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-overlay", onClick: () => setShowItemModal(false), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "item-modal", onClick: (e) => e.stopPropagation(), children: [
3071
- /* @__PURE__ */ jsxRuntime.jsx("h3", { children: editingItem.id ? "Edit Item" : "Add New Item" }),
3072
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-form", children: [
3073
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "form-row", children: [
3074
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3075
- "SKU",
3076
- /* @__PURE__ */ jsxRuntime.jsx(
3077
- "input",
3078
- {
3079
- type: "text",
3080
- value: editingItem.sku || "",
3081
- onChange: (e) => setEditingItem((prev) => ({ ...prev, sku: e.target.value }))
3082
- }
3083
- )
3084
- ] }),
3085
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3086
- "Name",
3087
- /* @__PURE__ */ jsxRuntime.jsx(
3088
- "input",
3089
- {
3090
- type: "text",
3091
- value: editingItem.name || "",
3092
- onChange: (e) => setEditingItem((prev) => ({ ...prev, name: e.target.value }))
3093
- }
3094
- )
3095
- ] })
3096
- ] }),
3097
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3098
- "Description",
3099
- /* @__PURE__ */ jsxRuntime.jsx(
3100
- "textarea",
3101
- {
3102
- value: editingItem.description || "",
3103
- onChange: (e) => setEditingItem((prev) => ({ ...prev, description: e.target.value }))
3104
- }
3105
- )
3106
- ] }),
3107
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "form-row", children: [
3108
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3109
- "Category",
3110
- /* @__PURE__ */ jsxRuntime.jsx(
3111
- "input",
3112
- {
3113
- type: "text",
3114
- value: editingItem.category || "",
3115
- onChange: (e) => setEditingItem((prev) => ({ ...prev, category: e.target.value })),
3116
- list: "categories"
3117
- }
3118
- ),
3119
- /* @__PURE__ */ jsxRuntime.jsx("datalist", { id: "categories", children: categories.map((c) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: c }, c)) })
3120
- ] }),
3121
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3122
- "Unit",
3123
- /* @__PURE__ */ jsxRuntime.jsx(
3124
- "input",
3125
- {
3126
- type: "text",
3127
- value: editingItem.unit || "",
3128
- onChange: (e) => setEditingItem((prev) => ({ ...prev, unit: e.target.value }))
3129
- }
3130
- )
3131
- ] })
3132
- ] }),
3133
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "form-row", children: [
3134
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3135
- "Quantity",
3136
- /* @__PURE__ */ jsxRuntime.jsx(
3137
- "input",
3138
- {
3139
- type: "number",
3140
- value: editingItem.quantity || 0,
3141
- onChange: (e) => setEditingItem((prev) => ({ ...prev, quantity: parseInt(e.target.value) }))
3142
- }
3143
- )
3144
- ] }),
3145
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3146
- "Reorder Level",
3147
- /* @__PURE__ */ jsxRuntime.jsx(
3148
- "input",
3149
- {
3150
- type: "number",
3151
- value: editingItem.reorderLevel || 0,
3152
- onChange: (e) => setEditingItem((prev) => ({
3153
- ...prev,
3154
- reorderLevel: parseInt(e.target.value)
3155
- }))
3156
- }
3157
- )
3158
- ] }),
3159
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3160
- "Reorder Qty",
3161
- /* @__PURE__ */ jsxRuntime.jsx(
3162
- "input",
3163
- {
3164
- type: "number",
3165
- value: editingItem.reorderQuantity || 0,
3166
- onChange: (e) => setEditingItem((prev) => ({
3167
- ...prev,
3168
- reorderQuantity: parseInt(e.target.value)
3169
- }))
3170
- }
3171
- )
3172
- ] })
3173
- ] }),
3174
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3175
- "Unit Cost",
3176
- /* @__PURE__ */ jsxRuntime.jsx(
3177
- "input",
3178
- {
3179
- type: "number",
3180
- step: "0.01",
3181
- value: ((_b = editingItem.cost) == null ? void 0 : _b.amount) || 0,
3182
- onChange: (e) => setEditingItem((prev) => ({
3183
- ...prev,
3184
- cost: {
3185
- ...prev.cost,
3186
- amount: parseFloat(e.target.value)
1468
+ showItemModal && editingItem && /* @__PURE__ */ jsxRuntime.jsx(
1469
+ "div",
1470
+ {
1471
+ className: "nice-inventory-manager__modal-overlay",
1472
+ onClick: () => setShowItemModal(false),
1473
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__item-modal", onClick: (e) => e.stopPropagation(), children: [
1474
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { children: editingItem.id ? t("inventoryManager.editItem", "Edit Item") : t("inventoryManager.addNewItem", "Add New Item") }),
1475
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__modal-form", children: [
1476
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__form-row", children: [
1477
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1478
+ "SKU",
1479
+ /* @__PURE__ */ jsxRuntime.jsx(
1480
+ "input",
1481
+ {
1482
+ type: "text",
1483
+ value: editingItem.sku || "",
1484
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, sku: e.target.value }))
1485
+ }
1486
+ )
1487
+ ] }),
1488
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1489
+ t("inventoryManager.name", "Name"),
1490
+ /* @__PURE__ */ jsxRuntime.jsx(
1491
+ "input",
1492
+ {
1493
+ type: "text",
1494
+ value: editingItem.name || "",
1495
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, name: e.target.value }))
1496
+ }
1497
+ )
1498
+ ] })
1499
+ ] }),
1500
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1501
+ t("inventoryManager.description", "Description"),
1502
+ /* @__PURE__ */ jsxRuntime.jsx(
1503
+ "textarea",
1504
+ {
1505
+ value: editingItem.description || "",
1506
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, description: e.target.value }))
3187
1507
  }
3188
- }))
3189
- }
3190
- )
3191
- ] })
3192
- ] }),
3193
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-actions", children: [
3194
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "cancel-button", onClick: () => setShowItemModal(false), children: "Cancel" }),
3195
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "save-button", onClick: handleItemSubmit, children: editingItem.id ? "Save Changes" : "Create Item" })
3196
- ] })
3197
- ] }) }),
3198
- showTransactionModal && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-overlay", onClick: () => setShowTransactionModal(false), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "transaction-modal", onClick: (e) => e.stopPropagation(), children: [
3199
- /* @__PURE__ */ jsxRuntime.jsx("h3", { children: "Create Transaction" }),
3200
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-form", children: [
3201
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3202
- "Item",
3203
- /* @__PURE__ */ jsxRuntime.jsxs(
3204
- "select",
3205
- {
3206
- value: newTransaction.itemId || "",
3207
- onChange: (e) => setNewTransaction((prev) => ({ ...prev, itemId: e.target.value })),
3208
- children: [
3209
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "Select item..." }),
3210
- items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: item.id, children: [
3211
- item.sku,
3212
- " - ",
3213
- item.name
3214
- ] }, item.id))
3215
- ]
3216
- }
3217
- )
3218
- ] }),
3219
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3220
- "Type",
3221
- /* @__PURE__ */ jsxRuntime.jsxs(
3222
- "select",
3223
- {
3224
- value: newTransaction.type || "",
3225
- onChange: (e) => setNewTransaction((prev) => ({
3226
- ...prev,
3227
- type: e.target.value
3228
- })),
3229
- children: [
3230
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "Select type..." }),
3231
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "receipt", children: "Receipt" }),
3232
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "issue", children: "Issue" }),
3233
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "transfer", children: "Transfer" }),
3234
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "adjustment", children: "Adjustment" }),
3235
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "return", children: "Return" }),
3236
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "write-off", children: "Write-off" })
3237
- ]
3238
- }
3239
- )
3240
- ] }),
3241
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3242
- "Quantity",
3243
- /* @__PURE__ */ jsxRuntime.jsx(
3244
- "input",
3245
- {
3246
- type: "number",
3247
- min: "1",
3248
- value: newTransaction.quantity || "",
3249
- onChange: (e) => setNewTransaction((prev) => ({ ...prev, quantity: parseInt(e.target.value) }))
3250
- }
3251
- )
3252
- ] }),
3253
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3254
- "Reference",
3255
- /* @__PURE__ */ jsxRuntime.jsx(
3256
- "input",
3257
- {
3258
- type: "text",
3259
- value: newTransaction.reference || "",
3260
- onChange: (e) => setNewTransaction((prev) => ({ ...prev, reference: e.target.value })),
3261
- placeholder: "PO number, invoice, etc."
3262
- }
3263
- )
3264
- ] }),
3265
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3266
- "Notes",
3267
- /* @__PURE__ */ jsxRuntime.jsx(
3268
- "textarea",
3269
- {
3270
- value: newTransaction.notes || "",
3271
- onChange: (e) => setNewTransaction((prev) => ({ ...prev, notes: e.target.value }))
3272
- }
3273
- )
1508
+ )
1509
+ ] }),
1510
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__form-row", children: [
1511
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1512
+ t("inventoryManager.category", "Category"),
1513
+ /* @__PURE__ */ jsxRuntime.jsx(
1514
+ "input",
1515
+ {
1516
+ type: "text",
1517
+ value: editingItem.category || "",
1518
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, category: e.target.value })),
1519
+ list: "categories"
1520
+ }
1521
+ ),
1522
+ /* @__PURE__ */ jsxRuntime.jsx("datalist", { id: "categories", children: categories.map((c2) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: c2 }, c2)) })
1523
+ ] }),
1524
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1525
+ t("inventoryManager.unit", "Unit"),
1526
+ /* @__PURE__ */ jsxRuntime.jsx(
1527
+ "input",
1528
+ {
1529
+ type: "text",
1530
+ value: editingItem.unit || "",
1531
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, unit: e.target.value }))
1532
+ }
1533
+ )
1534
+ ] })
1535
+ ] }),
1536
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__form-row", children: [
1537
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1538
+ t("inventoryManager.quantity", "Quantity"),
1539
+ /* @__PURE__ */ jsxRuntime.jsx(
1540
+ "input",
1541
+ {
1542
+ type: "number",
1543
+ value: editingItem.quantity || 0,
1544
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, quantity: parseInt(e.target.value) }))
1545
+ }
1546
+ )
1547
+ ] }),
1548
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1549
+ t("inventoryManager.reorderLevel", "Reorder Level"),
1550
+ /* @__PURE__ */ jsxRuntime.jsx(
1551
+ "input",
1552
+ {
1553
+ type: "number",
1554
+ value: editingItem.reorderLevel || 0,
1555
+ onChange: (e) => setEditingItem((prev) => ({
1556
+ ...prev,
1557
+ reorderLevel: parseInt(e.target.value)
1558
+ }))
1559
+ }
1560
+ )
1561
+ ] }),
1562
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1563
+ t("inventoryManager.reorderQty", "Reorder Qty"),
1564
+ /* @__PURE__ */ jsxRuntime.jsx(
1565
+ "input",
1566
+ {
1567
+ type: "number",
1568
+ value: editingItem.reorderQuantity || 0,
1569
+ onChange: (e) => setEditingItem((prev) => ({
1570
+ ...prev,
1571
+ reorderQuantity: parseInt(e.target.value)
1572
+ }))
1573
+ }
1574
+ )
1575
+ ] })
1576
+ ] }),
1577
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1578
+ t("inventoryManager.unitCost", "Unit Cost"),
1579
+ /* @__PURE__ */ jsxRuntime.jsx(
1580
+ "input",
1581
+ {
1582
+ type: "number",
1583
+ step: "0.01",
1584
+ value: ((_b = editingItem.cost) == null ? void 0 : _b.amount) || 0,
1585
+ onChange: (e) => setEditingItem((prev) => ({
1586
+ ...prev,
1587
+ cost: {
1588
+ ...prev.cost,
1589
+ amount: parseFloat(e.target.value)
1590
+ }
1591
+ }))
1592
+ }
1593
+ )
1594
+ ] })
1595
+ ] }),
1596
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__modal-actions", children: [
1597
+ /* @__PURE__ */ jsxRuntime.jsx(
1598
+ "button",
1599
+ {
1600
+ className: "nice-inventory-manager__cancel-button",
1601
+ onClick: () => setShowItemModal(false),
1602
+ children: t("inventoryManager.cancel", "Cancel")
1603
+ }
1604
+ ),
1605
+ /* @__PURE__ */ jsxRuntime.jsx("button", { className: "nice-inventory-manager__save-button", onClick: handleItemSubmit, children: editingItem.id ? t("inventoryManager.saveChanges", "Save Changes") : t("inventoryManager.createItem", "Create Item") })
1606
+ ] })
3274
1607
  ] })
3275
- ] }),
3276
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-actions", children: [
3277
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "cancel-button", onClick: () => setShowTransactionModal(false), children: "Cancel" }),
3278
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "save-button", onClick: handleTransactionSubmit, children: "Create Transaction" })
3279
- ] })
3280
- ] }) })
1608
+ }
1609
+ ),
1610
+ showTransactionModal && /* @__PURE__ */ jsxRuntime.jsx(
1611
+ "div",
1612
+ {
1613
+ className: "nice-inventory-manager__modal-overlay",
1614
+ onClick: () => setShowTransactionModal(false),
1615
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1616
+ "div",
1617
+ {
1618
+ className: "nice-inventory-manager__transaction-modal",
1619
+ onClick: (e) => e.stopPropagation(),
1620
+ children: [
1621
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { children: t("inventoryManager.createTransaction", "Create Transaction") }),
1622
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__modal-form", children: [
1623
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1624
+ t("inventoryManager.item", "Item"),
1625
+ /* @__PURE__ */ jsxRuntime.jsxs(
1626
+ "select",
1627
+ {
1628
+ value: newTransaction.itemId || "",
1629
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, itemId: e.target.value })),
1630
+ children: [
1631
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("inventoryManager.selectItem", "Select item...") }),
1632
+ items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: item.id, children: [
1633
+ item.sku,
1634
+ " - ",
1635
+ item.name
1636
+ ] }, item.id))
1637
+ ]
1638
+ }
1639
+ )
1640
+ ] }),
1641
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1642
+ t("inventoryManager.type", "Type"),
1643
+ /* @__PURE__ */ jsxRuntime.jsxs(
1644
+ "select",
1645
+ {
1646
+ value: newTransaction.type || "",
1647
+ onChange: (e) => setNewTransaction((prev) => ({
1648
+ ...prev,
1649
+ type: e.target.value
1650
+ })),
1651
+ children: [
1652
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("inventoryManager.selectType", "Select type...") }),
1653
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "receipt", children: t("inventoryManager.receipt", "Receipt") }),
1654
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "issue", children: t("inventoryManager.issue", "Issue") }),
1655
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "transfer", children: t("inventoryManager.transfer", "Transfer") }),
1656
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "adjustment", children: t("inventoryManager.adjustment", "Adjustment") }),
1657
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "return", children: t("inventoryManager.return", "Return") }),
1658
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "write-off", children: t("inventoryManager.writeOff", "Write-off") })
1659
+ ]
1660
+ }
1661
+ )
1662
+ ] }),
1663
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1664
+ t("inventoryManager.quantity", "Quantity"),
1665
+ /* @__PURE__ */ jsxRuntime.jsx(
1666
+ "input",
1667
+ {
1668
+ type: "number",
1669
+ min: "1",
1670
+ value: newTransaction.quantity || "",
1671
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, quantity: parseInt(e.target.value) }))
1672
+ }
1673
+ )
1674
+ ] }),
1675
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1676
+ t("inventoryManager.reference", "Reference"),
1677
+ /* @__PURE__ */ jsxRuntime.jsx(
1678
+ "input",
1679
+ {
1680
+ type: "text",
1681
+ value: newTransaction.reference || "",
1682
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, reference: e.target.value })),
1683
+ placeholder: t("inventoryManager.poNumberInvoiceEtc", "PO number, invoice, etc.")
1684
+ }
1685
+ )
1686
+ ] }),
1687
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1688
+ t("inventoryManager.notes", "Notes"),
1689
+ /* @__PURE__ */ jsxRuntime.jsx(
1690
+ "textarea",
1691
+ {
1692
+ value: newTransaction.notes || "",
1693
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, notes: e.target.value }))
1694
+ }
1695
+ )
1696
+ ] })
1697
+ ] }),
1698
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__modal-actions", children: [
1699
+ /* @__PURE__ */ jsxRuntime.jsx(
1700
+ "button",
1701
+ {
1702
+ className: "nice-inventory-manager__cancel-button",
1703
+ onClick: () => setShowTransactionModal(false),
1704
+ children: t("inventoryManager.cancel", "Cancel")
1705
+ }
1706
+ ),
1707
+ /* @__PURE__ */ jsxRuntime.jsx(
1708
+ "button",
1709
+ {
1710
+ className: "nice-inventory-manager__save-button",
1711
+ onClick: handleTransactionSubmit,
1712
+ children: t("inventoryManager.createTransaction", "Create Transaction")
1713
+ }
1714
+ )
1715
+ ] })
1716
+ ]
1717
+ }
1718
+ )
1719
+ }
1720
+ )
3281
1721
  ] });
3282
1722
  };
3283
1723
  const STATUS_COLOR = {
@@ -3308,7 +1748,7 @@ function fmtDate$1(d, locale) {
3308
1748
  const dt = d instanceof Date ? d : new Date(d);
3309
1749
  return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
3310
1750
  }
3311
- const NiceInvoiceView = be.forwardRef(
1751
+ const NiceInvoiceView = /* @__PURE__ */ ve.forwardRef(
3312
1752
  function NiceInvoiceView2({
3313
1753
  invoice,
3314
1754
  locale,
@@ -3322,15 +1762,16 @@ const NiceInvoiceView = be.forwardRef(
3322
1762
  style,
3323
1763
  id
3324
1764
  }, ref) {
3325
- var _a2;
3326
- const cur = currency ?? invoice.currency ?? ((_a2 = invoice.lines[0]) == null ? void 0 : _a2.unitPrice.currency) ?? "EUR";
1765
+ var _a;
1766
+ const { t } = v();
1767
+ const cur = currency ?? invoice.currency ?? ((_a = invoice.lines[0]) == null ? void 0 : _a.unitPrice.currency) ?? "EUR";
3327
1768
  const L = {
3328
1769
  invoiceNumber: "Invoice",
3329
1770
  issueDate: "Issue date",
3330
1771
  dueDate: "Due date",
3331
1772
  seller: "Seller",
3332
1773
  buyer: "Buyer",
3333
- description: "Description",
1774
+ description: t("invoiceView.description", "Description"),
3334
1775
  qty: "Qty",
3335
1776
  unitPrice: "Unit price",
3336
1777
  vat: "VAT",
@@ -3345,18 +1786,18 @@ const NiceInvoiceView = be.forwardRef(
3345
1786
  vatId: "VAT ID",
3346
1787
  ...labels
3347
1788
  };
3348
- const totals = be.useMemo(() => {
1789
+ const totals = ve.useMemo(() => {
3349
1790
  let net = 0;
3350
1791
  let vat = 0;
3351
1792
  const byRate = /* @__PURE__ */ new Map();
3352
1793
  for (const ln of invoice.lines) {
3353
1794
  const n = lineNet(ln);
3354
- const v = lineVat(ln);
1795
+ const v2 = lineVat(ln);
3355
1796
  net += n;
3356
- vat += v;
1797
+ vat += v2;
3357
1798
  const cell = byRate.get(ln.vatRate) ?? { net: 0, vat: 0 };
3358
1799
  cell.net += n;
3359
- cell.vat += v;
1800
+ cell.vat += v2;
3360
1801
  byRate.set(ln.vatRate, cell);
3361
1802
  }
3362
1803
  return { net, vat, gross: net + vat, byRate };
@@ -3396,34 +1837,31 @@ const NiceInvoiceView = be.forwardRef(
3396
1837
  className: "nice-invoice-view__status",
3397
1838
  style: { color: STATUS_COLOR[invoice.status] },
3398
1839
  children: [
3399
- /* @__PURE__ */ jsxRuntime.jsx(
3400
- "span",
3401
- {
3402
- "aria-hidden": true,
3403
- style: {
3404
- display: "inline-block",
3405
- width: 8,
3406
- height: 8,
3407
- borderRadius: "50%",
3408
- background: "currentColor"
3409
- }
3410
- }
3411
- ),
1840
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "nice-invoice-view__dot" }),
3412
1841
  " ",
3413
1842
  invoice.status
3414
1843
  ]
3415
1844
  }
3416
1845
  ),
3417
1846
  showActions && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-invoice-view__actions", children: [
3418
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => onAction == null ? void 0 : onAction("download"), children: "↓" }),
1847
+ /* @__PURE__ */ jsxRuntime.jsx(
1848
+ "button",
1849
+ {
1850
+ type: "button",
1851
+ onClick: () => onAction == null ? void 0 : onAction("download"),
1852
+ "aria-label": t("invoiceView.download", "Download"),
1853
+ title: t("invoiceView.download", "Download"),
1854
+ children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "arrow-down", size: 12 })
1855
+ }
1856
+ ),
3419
1857
  /* @__PURE__ */ jsxRuntime.jsx(
3420
1858
  "button",
3421
1859
  {
3422
1860
  type: "button",
3423
1861
  onClick: () => onAction == null ? void 0 : onAction("print"),
3424
- "aria-label": "Print",
3425
- title: "Print",
3426
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "printer", size: 14 })
1862
+ "aria-label": t("invoiceView.print", "Print"),
1863
+ title: t("invoiceView.print", "Print"),
1864
+ children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "printer", size: 14 })
3427
1865
  }
3428
1866
  ),
3429
1867
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3431,9 +1869,9 @@ const NiceInvoiceView = be.forwardRef(
3431
1869
  {
3432
1870
  type: "button",
3433
1871
  onClick: () => onAction == null ? void 0 : onAction("send"),
3434
- "aria-label": "Send",
3435
- title: "Send",
3436
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "mail", size: 14 })
1872
+ "aria-label": t("invoiceView.send", "Send"),
1873
+ title: t("invoiceView.send", "Send"),
1874
+ children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "mail", size: 14 })
3437
1875
  }
3438
1876
  )
3439
1877
  ] })
@@ -3469,7 +1907,7 @@ const NiceInvoiceView = be.forwardRef(
3469
1907
  ] }) }),
3470
1908
  /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: invoice.lines.map((ln) => {
3471
1909
  const n = lineNet(ln);
3472
- const v = lineVat(ln);
1910
+ const v2 = lineVat(ln);
3473
1911
  return /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3474
1912
  /* @__PURE__ */ jsxRuntime.jsx("td", { children: ln.description }),
3475
1913
  /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "nice-num", children: [
@@ -3482,7 +1920,7 @@ const NiceInvoiceView = be.forwardRef(
3482
1920
  "%"
3483
1921
  ] }),
3484
1922
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(n, cur, locale) }),
3485
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(n + v, cur, locale) })
1923
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(n + v2, cur, locale) })
3486
1924
  ] }, ln.id);
3487
1925
  }) })
3488
1926
  ] }),
@@ -3495,14 +1933,14 @@ const NiceInvoiceView = be.forwardRef(
3495
1933
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.vat }),
3496
1934
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.gross })
3497
1935
  ] }) }),
3498
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: [...totals.byRate.entries()].sort((a, b) => b[0] - a[0]).map(([rate, c]) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
1936
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: [...totals.byRate.entries()].sort((a2, b) => b[0] - a2[0]).map(([rate, c2]) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3499
1937
  /* @__PURE__ */ jsxRuntime.jsxs("td", { children: [
3500
1938
  (rate * 100).toFixed(0),
3501
1939
  "%"
3502
1940
  ] }),
3503
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(c.net, cur, locale) }),
3504
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(c.vat, cur, locale) }),
3505
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(c.net + c.vat, cur, locale) })
1941
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(c2.net, cur, locale) }),
1942
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(c2.vat, cur, locale) }),
1943
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(c2.net + c2.vat, cur, locale) })
3506
1944
  ] }, rate)) })
3507
1945
  ] })
3508
1946
  ] }),
@@ -3522,7 +1960,7 @@ const NiceInvoiceView = be.forwardRef(
3522
1960
  ] }),
3523
1961
  !(hideSections == null ? void 0 : hideSections.timeline) && invoice.history && invoice.history.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "nice-invoice-view__timeline", children: [
3524
1962
  /* @__PURE__ */ jsxRuntime.jsx("h4", { children: L.timeline }),
3525
- /* @__PURE__ */ jsxRuntime.jsx("ol", { children: invoice.history.map((h, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
1963
+ /* @__PURE__ */ jsxRuntime.jsx("ol", { children: invoice.history.map((h, i2) => /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
3526
1964
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-invoice-view__t-date", children: fmtDate$1(h.at, locale) }),
3527
1965
  /* @__PURE__ */ jsxRuntime.jsx(
3528
1966
  "span",
@@ -3536,7 +1974,7 @@ const NiceInvoiceView = be.forwardRef(
3536
1974
  " — ",
3537
1975
  h.note
3538
1976
  ] })
3539
- ] }, i)) })
1977
+ ] }, i2)) })
3540
1978
  ] }),
3541
1979
  !(hideSections == null ? void 0 : hideSections.notes) && invoice.notes && /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "nice-invoice-view__notes", children: [
3542
1980
  /* @__PURE__ */ jsxRuntime.jsx("h4", { children: L.notes }),
@@ -3547,6 +1985,7 @@ const NiceInvoiceView = be.forwardRef(
3547
1985
  );
3548
1986
  }
3549
1987
  );
1988
+ const EMPTY_CELLS = [];
3550
1989
  function colorFor(occ, colors) {
3551
1990
  if (occ <= 0.01) {
3552
1991
  return colors.low;
@@ -3559,11 +1998,15 @@ function colorFor(occ, colors) {
3559
1998
  }
3560
1999
  return colors.high;
3561
2000
  }
3562
- const NiceWarehouseView = be.forwardRef(
2001
+ const NiceWarehouseView = /* @__PURE__ */ ve.forwardRef(
3563
2002
  function NiceWarehouseView2({
3564
2003
  warehouseName,
3565
- cells,
3566
- colors = { low: "#dcfce7", mid: "#fde68a", high: "#fecaca" },
2004
+ cells = EMPTY_CELLS,
2005
+ colors = {
2006
+ low: "var(--nice-success-bg, #dcfce7)",
2007
+ mid: "var(--nice-warning-bg, #fde68a)",
2008
+ high: "var(--nice-danger-bg, #fecaca)"
2009
+ },
3567
2010
  onCellClick,
3568
2011
  showLegend = true,
3569
2012
  cellSize = 48,
@@ -3572,36 +2015,47 @@ const NiceWarehouseView = be.forwardRef(
3572
2015
  style,
3573
2016
  id
3574
2017
  }, ref) {
3575
- const [hovered, setHovered] = be.useState(null);
3576
- const grid = be.useMemo(() => {
2018
+ const { t } = v();
2019
+ const [hovered, setHovered] = ve.useState(null);
2020
+ const grid = ve.useMemo(() => {
3577
2021
  const rows = /* @__PURE__ */ new Map();
3578
- for (const c of cells) {
3579
- const rowKey = c.row !== void 0 ? `r${c.row}` : c.location.rack ?? c.location.aisle ?? "0";
2022
+ for (const c2 of cells) {
2023
+ const rowKey = c2.row !== void 0 ? `r${c2.row}` : c2.location.rack ?? c2.location.aisle ?? "0";
3580
2024
  let arr = rows.get(rowKey);
3581
2025
  if (!arr) {
3582
2026
  arr = [];
3583
2027
  rows.set(rowKey, arr);
3584
2028
  }
3585
- arr.push(c);
2029
+ arr.push(c2);
3586
2030
  }
3587
2031
  return [...rows.entries()].map(([rowKey, arr]) => ({ rowKey, cells: arr }));
3588
2032
  }, [cells]);
3589
2033
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, id, className: `nice-warehouse-view ${className ?? ""}`, style, children: [
3590
2034
  /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "nice-warehouse-view__header", children: [
3591
2035
  /* @__PURE__ */ jsxRuntime.jsx("h3", { children: warehouseName }),
3592
- showLegend && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-warehouse-view__legend", "aria-label": "Occupancy legend", children: [
3593
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.low } }),
3594
- " low",
3595
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.mid } }),
3596
- " mid",
3597
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.high } }),
3598
- " high"
3599
- ] })
2036
+ showLegend && /* @__PURE__ */ jsxRuntime.jsxs(
2037
+ "div",
2038
+ {
2039
+ className: "nice-warehouse-view__legend",
2040
+ "aria-label": t("warehouseView.occupancyLegend", "Occupancy legend"),
2041
+ children: [
2042
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.low } }),
2043
+ " ",
2044
+ t("warehouseView.low", "low"),
2045
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.mid } }),
2046
+ " ",
2047
+ t("warehouseView.mid", "mid"),
2048
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.high } }),
2049
+ " ",
2050
+ t("warehouseView.high", "high")
2051
+ ]
2052
+ }
2053
+ )
3600
2054
  ] }),
3601
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-warehouse-view__grid", role: "grid", "aria-label": warehouseName, children: grid.map(({ rowKey, cells: row }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-warehouse-view__row", role: "row", children: row.map((c, idx) => {
3602
- const key = [c.location.rack, c.location.aisle, c.location.shelf, c.location.bin].filter(Boolean).join("-") || String(idx);
2055
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-warehouse-view__grid", role: "grid", "aria-label": warehouseName, children: grid.map(({ rowKey, cells: row }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-warehouse-view__row", role: "row", children: row.map((c2, idx) => {
2056
+ const key = [c2.location.rack, c2.location.aisle, c2.location.shelf, c2.location.bin].filter(Boolean).join("-") || String(idx);
3603
2057
  const aisleBreak = aisleEvery > 0 && idx > 0 && idx % aisleEvery === 0;
3604
- return /* @__PURE__ */ jsxRuntime.jsxs(be.Fragment, { children: [
2058
+ return /* @__PURE__ */ jsxRuntime.jsxs(ve.Fragment, { children: [
3605
2059
  aisleBreak && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-warehouse-view__aisle", "aria-hidden": true }),
3606
2060
  /* @__PURE__ */ jsxRuntime.jsx(
3607
2061
  "button",
@@ -3612,13 +2066,13 @@ const NiceWarehouseView = be.forwardRef(
3612
2066
  style: {
3613
2067
  width: cellSize,
3614
2068
  height: cellSize,
3615
- background: colorFor(c.occupancy, colors)
2069
+ background: colorFor(c2.occupancy, colors)
3616
2070
  },
3617
- title: `${key} — ${(c.occupancy * 100).toFixed(0)}% (${c.items.length} items)`,
3618
- onClick: () => onCellClick == null ? void 0 : onCellClick(c),
3619
- onMouseEnter: () => setHovered(c),
2071
+ title: t("warehouseView.items", "{key} — {occupancy}% ({items} items)").replace("{key}", String(key)).replace("{occupancy}", String((c2.occupancy * 100).toFixed(0))).replace("{items}", String(c2.items.length)),
2072
+ onClick: () => onCellClick == null ? void 0 : onCellClick(c2),
2073
+ onMouseEnter: () => setHovered(c2),
3620
2074
  onMouseLeave: () => setHovered(null),
3621
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-warehouse-view__bin", children: c.location.bin ?? c.location.shelf ?? "" })
2075
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-warehouse-view__bin", children: c2.location.bin ?? c2.location.shelf ?? "" })
3622
2076
  }
3623
2077
  )
3624
2078
  ] }, key);
@@ -3631,12 +2085,7 @@ const NiceWarehouseView = be.forwardRef(
3631
2085
  "/",
3632
2086
  hovered.location.bin
3633
2087
  ] }),
3634
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3635
- hovered.items.length,
3636
- " items · ",
3637
- (hovered.occupancy * 100).toFixed(0),
3638
- "% full"
3639
- ] }),
2088
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: t("warehouseView.itemsFull", "{items} items · {occupancy}% full").replace("{items}", String(hovered.items.length)).replace("{occupancy}", String((hovered.occupancy * 100).toFixed(0))) }),
3640
2089
  /* @__PURE__ */ jsxRuntime.jsxs("ul", { children: [
3641
2090
  hovered.items.slice(0, 5).map((it) => /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
3642
2091
  it.sku,
@@ -3652,14 +2101,15 @@ const NiceWarehouseView = be.forwardRef(
3652
2101
  ] });
3653
2102
  }
3654
2103
  );
2104
+ const EMPTY_ORDERS = [];
3655
2105
  const STATUS_TINT = {
3656
- draft: "#6b7280",
3657
- "pending-approval": "#ca8a04",
3658
- approved: "#2563eb",
3659
- ordered: "#0891b2",
3660
- "partially-received": "#9333ea",
3661
- received: "#16a34a",
3662
- cancelled: "#dc2626"
2106
+ draft: "var(--nice-text-muted, #6b7280)",
2107
+ "pending-approval": "var(--nice-color-warning, #ca8a04)",
2108
+ approved: "var(--nice-color-primary, #2563eb)",
2109
+ ordered: "var(--nice-color-info, #0891b2)",
2110
+ "partially-received": "var(--nice-color-accent, #9333ea)",
2111
+ received: "var(--nice-color-success, #16a34a)",
2112
+ cancelled: "var(--nice-color-error, #dc2626)"
3663
2113
  };
3664
2114
  function fmtMoney(amount, currency, locale) {
3665
2115
  const code = typeof currency === "string" ? currency : currency.code;
@@ -3675,168 +2125,156 @@ function fmtDate(d, locale) {
3675
2125
  const dt = d instanceof Date ? d : new Date(d);
3676
2126
  return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
3677
2127
  }
3678
- const NicePurchaseOrder = be.forwardRef(
3679
- function NicePurchaseOrder2({
3680
- orders,
3681
- selectable = true,
3682
- initialSelectedId,
3683
- locale,
3684
- labels,
3685
- readOnly,
3686
- onOrderApprove,
3687
- onReceiveItems,
3688
- onOrderUpdate,
3689
- className,
3690
- style,
3691
- id
3692
- }, ref) {
3693
- var _a2;
3694
- const [selectedId, setSelectedId] = be.useState(
3695
- initialSelectedId ?? ((_a2 = orders[0]) == null ? void 0 : _a2.id)
3696
- );
3697
- const L = {
3698
- orderNumber: "PO #",
3699
- supplier: "Supplier",
3700
- status: "Status",
3701
- orderDate: "Ordered",
3702
- expected: "Expected",
3703
- total: "Total",
3704
- sku: "SKU",
3705
- name: "Item",
3706
- qty: "Qty",
3707
- received: "Recv",
3708
- unitPrice: "Unit",
3709
- lineTotal: "Subtotal",
3710
- notes: "Notes",
3711
- approve: "Approve",
3712
- receive: "Receive all",
3713
- ...labels
3714
- };
3715
- const selected = be.useMemo(
3716
- () => orders.find((o) => o.id === selectedId),
3717
- [orders, selectedId]
3718
- );
3719
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, id, className: `nice-purchase-order ${className ?? ""}`, style, children: [
3720
- /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "nice-purchase-order__list", children: [
3721
- /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3722
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.orderNumber }),
3723
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.supplier }),
3724
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.status }),
3725
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.orderDate }),
3726
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.expected }),
3727
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.total })
3728
- ] }) }),
3729
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: orders.map((o) => /* @__PURE__ */ jsxRuntime.jsxs(
3730
- "tr",
3731
- {
3732
- "aria-selected": o.id === selectedId,
3733
- className: o.id === selectedId ? "is-selected" : void 0,
3734
- onClick: () => selectable && setSelectedId(o.id),
3735
- children: [
3736
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: o.orderNumber }),
3737
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: o.supplier.name }),
3738
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { color: STATUS_TINT[o.status] }, children: [
3739
- /* @__PURE__ */ jsxRuntime.jsx(
3740
- "span",
3741
- {
3742
- "aria-hidden": true,
3743
- style: {
3744
- display: "inline-block",
3745
- width: 8,
3746
- height: 8,
3747
- borderRadius: "50%",
3748
- background: "currentColor"
3749
- }
3750
- }
3751
- ),
3752
- " ",
3753
- o.status
3754
- ] }) }),
3755
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: fmtDate(o.orderDate, locale) }),
3756
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: fmtDate(o.expectedDelivery, locale) }),
3757
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(o.total.amount, o.total.currency, locale) })
3758
- ]
3759
- },
3760
- o.id
3761
- )) })
3762
- ] }),
3763
- selectable && selected && /* @__PURE__ */ jsxRuntime.jsxs(
3764
- "section",
2128
+ const NicePurchaseOrder = /* @__PURE__ */ ve.forwardRef(function NicePurchaseOrder2({
2129
+ orders = EMPTY_ORDERS,
2130
+ selectable = true,
2131
+ initialSelectedId,
2132
+ locale,
2133
+ labels,
2134
+ readOnly,
2135
+ onOrderApprove,
2136
+ onReceiveItems,
2137
+ onOrderUpdate,
2138
+ className,
2139
+ style,
2140
+ id
2141
+ }, ref) {
2142
+ var _a;
2143
+ const { t } = v();
2144
+ const [selectedId, setSelectedId] = ve.useState(
2145
+ initialSelectedId ?? ((_a = orders[0]) == null ? void 0 : _a.id)
2146
+ );
2147
+ const L = {
2148
+ orderNumber: "PO #",
2149
+ supplier: "Supplier",
2150
+ status: "Status",
2151
+ orderDate: "Ordered",
2152
+ expected: "Expected",
2153
+ total: "Total",
2154
+ sku: "SKU",
2155
+ name: "Item",
2156
+ qty: "Qty",
2157
+ received: "Recv",
2158
+ unitPrice: "Unit",
2159
+ lineTotal: "Subtotal",
2160
+ notes: "Notes",
2161
+ approve: "Approve",
2162
+ receive: "Receive all",
2163
+ ...labels
2164
+ };
2165
+ const selected = ve.useMemo(
2166
+ () => orders.find((o) => o.id === selectedId),
2167
+ [orders, selectedId]
2168
+ );
2169
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, id, className: `nice-purchase-order ${className ?? ""}`, style, children: [
2170
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "nice-purchase-order__list", children: [
2171
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2172
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.orderNumber }),
2173
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.supplier }),
2174
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.status }),
2175
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.orderDate }),
2176
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.expected }),
2177
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.total })
2178
+ ] }) }),
2179
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: orders.map((o) => /* @__PURE__ */ jsxRuntime.jsxs(
2180
+ "tr",
3765
2181
  {
3766
- className: "nice-purchase-order__detail",
3767
- "aria-label": `${L.orderNumber} ${selected.orderNumber}`,
2182
+ "aria-selected": o.id === selectedId,
2183
+ className: o.id === selectedId ? "is-selected" : void 0,
2184
+ onClick: () => selectable && setSelectedId(o.id),
3768
2185
  children: [
3769
- /* @__PURE__ */ jsxRuntime.jsxs("header", { children: [
3770
- /* @__PURE__ */ jsxRuntime.jsxs("h3", { children: [
3771
- selected.orderNumber,
3772
- " — ",
3773
- selected.supplier.name
3774
- ] }),
3775
- !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-purchase-order__actions", children: [
3776
- selected.status === "pending-approval" && onOrderApprove && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => onOrderApprove(selected.id), children: L.approve }),
3777
- (selected.status === "ordered" || selected.status === "partially-received") && onReceiveItems && /* @__PURE__ */ jsxRuntime.jsx(
3778
- "button",
3779
- {
3780
- type: "button",
3781
- onClick: () => onReceiveItems(
3782
- selected.id,
3783
- selected.items.map((it) => ({
3784
- itemId: it.itemId,
3785
- quantity: it.quantity - (it.receivedQuantity ?? 0)
3786
- }))
3787
- ),
3788
- children: L.receive
3789
- }
3790
- ),
3791
- onOrderUpdate && selected.status === "draft" && /* @__PURE__ */ jsxRuntime.jsx(
3792
- "button",
3793
- {
3794
- type: "button",
3795
- onClick: () => onOrderUpdate({ ...selected, status: "pending-approval" }),
3796
- children: "Submit"
3797
- }
3798
- )
3799
- ] })
3800
- ] }),
3801
- /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "nice-purchase-order__items", children: [
3802
- /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3803
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.sku }),
3804
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.name }),
3805
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.qty }),
3806
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.received }),
3807
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.unitPrice }),
3808
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.lineTotal })
3809
- ] }) }),
3810
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: selected.items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3811
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: it.sku }),
3812
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: it.itemName }),
3813
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: it.quantity }),
3814
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: it.receivedQuantity ?? 0 }),
3815
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(it.unitPrice.amount, it.unitPrice.currency, locale) }),
3816
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(it.lineTotal.amount, it.lineTotal.currency, locale) })
3817
- ] }, it.itemId)) }),
3818
- /* @__PURE__ */ jsxRuntime.jsx("tfoot", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3819
- /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "nice-num", children: L.total }),
3820
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: fmtMoney(selected.total.amount, selected.total.currency, locale) }) })
3821
- ] }) })
3822
- ] }),
3823
- selected.notes && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "nice-purchase-order__notes", children: [
3824
- /* @__PURE__ */ jsxRuntime.jsxs("strong", { children: [
3825
- L.notes,
3826
- ":"
3827
- ] }),
2186
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: o.orderNumber }),
2187
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: o.supplier.name }),
2188
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { color: STATUS_TINT[o.status] }, children: [
2189
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "nice-purchase-order__dot" }),
3828
2190
  " ",
3829
- selected.notes
3830
- ] })
2191
+ o.status
2192
+ ] }) }),
2193
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: fmtDate(o.orderDate, locale) }),
2194
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: fmtDate(o.expectedDelivery, locale) }),
2195
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(o.total.amount, o.total.currency, locale) })
3831
2196
  ]
3832
- }
3833
- )
3834
- ] });
3835
- }
3836
- );
3837
- const NiceHRDashboard = be.forwardRef(
2197
+ },
2198
+ o.id
2199
+ )) })
2200
+ ] }),
2201
+ selectable && selected && /* @__PURE__ */ jsxRuntime.jsxs(
2202
+ "section",
2203
+ {
2204
+ className: "nice-purchase-order__detail",
2205
+ "aria-label": `${L.orderNumber} ${selected.orderNumber}`,
2206
+ children: [
2207
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { children: [
2208
+ /* @__PURE__ */ jsxRuntime.jsxs("h3", { children: [
2209
+ selected.orderNumber,
2210
+ " — ",
2211
+ selected.supplier.name
2212
+ ] }),
2213
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-purchase-order__actions", children: [
2214
+ selected.status === "pending-approval" && onOrderApprove && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => onOrderApprove(selected.id), children: L.approve }),
2215
+ (selected.status === "ordered" || selected.status === "partially-received") && onReceiveItems && /* @__PURE__ */ jsxRuntime.jsx(
2216
+ "button",
2217
+ {
2218
+ type: "button",
2219
+ onClick: () => onReceiveItems(
2220
+ selected.id,
2221
+ selected.items.map((it) => ({
2222
+ itemId: it.itemId,
2223
+ quantity: it.quantity - (it.receivedQuantity ?? 0)
2224
+ }))
2225
+ ),
2226
+ children: L.receive
2227
+ }
2228
+ ),
2229
+ onOrderUpdate && selected.status === "draft" && /* @__PURE__ */ jsxRuntime.jsx(
2230
+ "button",
2231
+ {
2232
+ type: "button",
2233
+ onClick: () => onOrderUpdate({ ...selected, status: "pending-approval" }),
2234
+ children: t("purchaseOrder.submit", "Submit")
2235
+ }
2236
+ )
2237
+ ] })
2238
+ ] }),
2239
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "nice-purchase-order__items", children: [
2240
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2241
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.sku }),
2242
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.name }),
2243
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.qty }),
2244
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.received }),
2245
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.unitPrice }),
2246
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.lineTotal })
2247
+ ] }) }),
2248
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: selected.items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2249
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: it.sku }),
2250
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: it.itemName }),
2251
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: it.quantity }),
2252
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: it.receivedQuantity ?? 0 }),
2253
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(it.unitPrice.amount, it.unitPrice.currency, locale) }),
2254
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(it.lineTotal.amount, it.lineTotal.currency, locale) })
2255
+ ] }, it.itemId)) }),
2256
+ /* @__PURE__ */ jsxRuntime.jsx("tfoot", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2257
+ /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "nice-num", children: L.total }),
2258
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: fmtMoney(selected.total.amount, selected.total.currency, locale) }) })
2259
+ ] }) })
2260
+ ] }),
2261
+ selected.notes && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "nice-purchase-order__notes", children: [
2262
+ /* @__PURE__ */ jsxRuntime.jsxs("strong", { children: [
2263
+ L.notes,
2264
+ ":"
2265
+ ] }),
2266
+ " ",
2267
+ selected.notes
2268
+ ] })
2269
+ ]
2270
+ }
2271
+ )
2272
+ ] });
2273
+ });
2274
+ const EMPTY_EMPLOYEES = [];
2275
+ const NiceHRDashboard = /* @__PURE__ */ ve.forwardRef(
3838
2276
  function NiceHRDashboard2({
3839
- employees,
2277
+ employees = EMPTY_EMPLOYEES,
3840
2278
  labels,
3841
2279
  hideWidgets,
3842
2280
  locale,
@@ -3846,6 +2284,7 @@ const NiceHRDashboard = be.forwardRef(
3846
2284
  style,
3847
2285
  id
3848
2286
  }, ref) {
2287
+ const { t } = v();
3849
2288
  const L = {
3850
2289
  headcount: "Headcount",
3851
2290
  fte: "FTE",
@@ -3855,7 +2294,7 @@ const NiceHRDashboard = be.forwardRef(
3855
2294
  activeEmployees: "Active",
3856
2295
  ...labels
3857
2296
  };
3858
- const stats = be.useMemo(() => {
2297
+ const stats = ve.useMemo(() => {
3859
2298
  const active = employees.filter((e) => e.active !== false);
3860
2299
  const fte = active.reduce((s, e) => s + (e.fte ?? 1), 0);
3861
2300
  const vacationAvg = active.length === 0 ? 0 : active.reduce((s, e) => s + (e.vacationBalanceDays ?? 0), 0) / active.length;
@@ -3896,7 +2335,7 @@ const NiceHRDashboard = be.forwardRef(
3896
2335
  className: `nice-hr-dashboard nice-hr-dashboard--${density} ${className ?? ""}`,
3897
2336
  style,
3898
2337
  role: "group",
3899
- "aria-label": "HR dashboard",
2338
+ "aria-label": t("hrDashboard.hrDashboard", "HR dashboard"),
3900
2339
  children: [
3901
2340
  !(hideWidgets == null ? void 0 : hideWidgets.headcount) && /* @__PURE__ */ jsxRuntime.jsx(
3902
2341
  Widget,
@@ -3968,11 +2407,11 @@ const DEFAULT_SEED = {
3968
2407
  };
3969
2408
  function useMockErpApi(options = {}) {
3970
2409
  const { latencyMs = 300, errorRate = 0, seed } = options;
3971
- const [loading, setLoading] = be.useState(true);
3972
- const [error, setError] = be.useState(null);
3973
- const [data, setData] = be.useState(() => ({ ...DEFAULT_SEED, ...seed }));
3974
- const settledRef = be.useRef(false);
3975
- const refresh = be.useCallback(async () => {
2410
+ const [loading, setLoading] = ve.useState(true);
2411
+ const [error, setError] = ve.useState(null);
2412
+ const [data, setData] = ve.useState(() => ({ ...DEFAULT_SEED, ...seed }));
2413
+ const settledRef = ve.useRef(false);
2414
+ const refresh = ve.useCallback(async () => {
3976
2415
  setLoading(true);
3977
2416
  setError(null);
3978
2417
  await wait(latencyMs);
@@ -3983,14 +2422,14 @@ function useMockErpApi(options = {}) {
3983
2422
  }
3984
2423
  setLoading(false);
3985
2424
  }, [latencyMs, errorRate]);
3986
- be.useEffect(() => {
2425
+ ve.useEffect(() => {
3987
2426
  if (settledRef.current) {
3988
2427
  return;
3989
2428
  }
3990
2429
  settledRef.current = true;
3991
2430
  void refresh();
3992
2431
  }, [refresh]);
3993
- const writeWith = be.useCallback(
2432
+ const writeWith = ve.useCallback(
3994
2433
  async (key, item) => {
3995
2434
  await wait(latencyMs);
3996
2435
  if (Math.random() < errorRate) {
@@ -3998,7 +2437,7 @@ function useMockErpApi(options = {}) {
3998
2437
  }
3999
2438
  setData((d) => {
4000
2439
  const arr = [...d[key]];
4001
- const idx = arr.findIndex((i) => i.id === item.id);
2440
+ const idx = arr.findIndex((i2) => i2.id === item.id);
4002
2441
  if (idx >= 0) {
4003
2442
  arr[idx] = item;
4004
2443
  } else {
@@ -4009,7 +2448,7 @@ function useMockErpApi(options = {}) {
4009
2448
  },
4010
2449
  [latencyMs, errorRate]
4011
2450
  );
4012
- return be.useMemo(
2451
+ return ve.useMemo(
4013
2452
  () => ({
4014
2453
  loading,
4015
2454
  error,
@@ -4021,118 +2460,128 @@ function useMockErpApi(options = {}) {
4021
2460
  resources: data.resources,
4022
2461
  vatRates: data.vatRates,
4023
2462
  refresh,
4024
- upsertInvoice: (i) => writeWith("invoices", i),
2463
+ upsertInvoice: (i2) => writeWith("invoices", i2),
4025
2464
  upsertPurchaseOrder: (p) => writeWith("purchaseOrders", p),
4026
- upsertInventory: (i) => writeWith("inventory", i)
2465
+ upsertInventory: (i2) => writeWith("inventory", i2)
4027
2466
  }),
4028
2467
  [loading, error, data, refresh, writeWith]
4029
2468
  );
4030
2469
  }
4031
- const NiceVatTable = be.forwardRef(function NiceVatTable2({
4032
- country = "PL",
4033
- rates,
4034
- editable = false,
4035
- onChange,
4036
- onRemove,
4037
- locale,
4038
- labels,
4039
- density = "comfortable",
4040
- className,
4041
- style,
4042
- id
4043
- }, ref) {
4044
- const [internal, setInternal] = be.useState(rates ?? NICE_VAT_PRESETS[country]);
4045
- const L = {
4046
- code: "Code",
4047
- rate: "Rate",
4048
- label: "Label",
4049
- description: "Description",
4050
- add: "+ Add",
4051
- remove: "Remove",
4052
- ...labels
4053
- };
4054
- const update = be.useCallback(
4055
- (next) => {
4056
- setInternal(next);
4057
- onChange == null ? void 0 : onChange(next);
4058
- },
4059
- [onChange]
4060
- );
4061
- const onCellEdit = (idx, key, raw) => {
4062
- const next = [...internal];
4063
- const r = { ...next[idx] };
4064
- if (key === "rate") {
4065
- const n = Number(raw.replace(",", "."));
4066
- if (!Number.isFinite(n)) {
4067
- return;
2470
+ const NiceVatTable = /* @__PURE__ */ ve.forwardRef(
2471
+ function NiceVatTable2({
2472
+ country = "PL",
2473
+ rates,
2474
+ editable = false,
2475
+ onChange,
2476
+ onRemove,
2477
+ locale,
2478
+ labels,
2479
+ density = "comfortable",
2480
+ className,
2481
+ style,
2482
+ id
2483
+ }, ref) {
2484
+ const { t } = v();
2485
+ const [internal, setInternal] = ve.useState(rates ?? NICE_VAT_PRESETS[country]);
2486
+ const L = {
2487
+ code: "Code",
2488
+ rate: "Rate",
2489
+ label: t("vatTable.label", "Label"),
2490
+ description: t("vatTable.description", "Description"),
2491
+ add: "+ Add",
2492
+ remove: "Remove",
2493
+ ...labels
2494
+ };
2495
+ const update = ve.useCallback(
2496
+ (next) => {
2497
+ setInternal(next);
2498
+ onChange == null ? void 0 : onChange(next);
2499
+ },
2500
+ [onChange]
2501
+ );
2502
+ const onCellEdit = (idx, key, raw) => {
2503
+ const next = [...internal];
2504
+ const r = { ...next[idx] };
2505
+ if (key === "rate") {
2506
+ const n = Number(raw.replace(",", "."));
2507
+ if (!Number.isFinite(n)) {
2508
+ return;
2509
+ }
2510
+ r.rate = n > 1 ? n / 100 : n;
2511
+ } else if (key === "code" || key === "label" || key === "description") {
2512
+ r[key] = raw;
4068
2513
  }
4069
- r.rate = n > 1 ? n / 100 : n;
4070
- } else if (key === "code" || key === "label" || key === "description") {
4071
- r[key] = raw;
4072
- }
4073
- next[idx] = r;
4074
- update(next);
4075
- };
4076
- const addRow = () => {
4077
- update([...internal, { code: `NEW-${internal.length + 1}`, rate: 0, label: "0%" }]);
4078
- };
4079
- const removeRow = (idx) => {
4080
- const code = internal[idx].code;
4081
- const next = internal.filter((_, i) => i !== idx);
4082
- update(next);
4083
- onRemove == null ? void 0 : onRemove(code);
4084
- };
4085
- return /* @__PURE__ */ jsxRuntime.jsxs(
4086
- "div",
4087
- {
4088
- ref,
4089
- id,
4090
- className: `nice-vat-table nice-vat-table--${density} ${className ?? ""}`,
4091
- style,
4092
- children: [
4093
- /* @__PURE__ */ jsxRuntime.jsxs("table", { children: [
4094
- /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
4095
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.code }),
4096
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.rate }),
4097
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.label }),
4098
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.description }),
4099
- editable && /* @__PURE__ */ jsxRuntime.jsx("th", { "aria-label": L.remove })
4100
- ] }) }),
4101
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: internal.map((r, idx) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
4102
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx("input", { value: r.code, onChange: (e) => onCellEdit(idx, "code", e.target.value) }) : r.code }),
4103
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
4104
- "input",
4105
- {
4106
- type: "number",
4107
- step: "0.01",
4108
- min: 0,
4109
- max: 1,
4110
- value: r.rate,
4111
- onChange: (e) => onCellEdit(idx, "rate", e.target.value)
4112
- }
4113
- ) : `${(r.rate * 100).toLocaleString(locale, { maximumFractionDigits: 2 })}%` }),
4114
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
4115
- "input",
4116
- {
4117
- value: r.label ?? "",
4118
- onChange: (e) => onCellEdit(idx, "label", e.target.value)
4119
- }
4120
- ) : r.label ?? "" }),
4121
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
4122
- "input",
4123
- {
4124
- value: r.description ?? "",
4125
- onChange: (e) => onCellEdit(idx, "description", e.target.value)
4126
- }
4127
- ) : r.description ?? "" }),
4128
- editable && /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => removeRow(idx), "aria-label": L.remove, children: "×" }) })
4129
- ] }, r.code)) })
4130
- ] }),
4131
- editable && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-vat-table__add", onClick: addRow, children: L.add })
4132
- ]
4133
- }
4134
- );
4135
- });
2514
+ next[idx] = r;
2515
+ update(next);
2516
+ };
2517
+ const addRow = () => {
2518
+ update([...internal, { code: `NEW-${internal.length + 1}`, rate: 0, label: "0%" }]);
2519
+ };
2520
+ const removeRow = (idx) => {
2521
+ const code = internal[idx].code;
2522
+ const next = internal.filter((_, i2) => i2 !== idx);
2523
+ update(next);
2524
+ onRemove == null ? void 0 : onRemove(code);
2525
+ };
2526
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2527
+ "div",
2528
+ {
2529
+ ref,
2530
+ id,
2531
+ className: `nice-vat-table nice-vat-table--${density} ${className ?? ""}`,
2532
+ style,
2533
+ children: [
2534
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { children: [
2535
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2536
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.code }),
2537
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.rate }),
2538
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.label }),
2539
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.description }),
2540
+ editable && /* @__PURE__ */ jsxRuntime.jsx("th", { "aria-label": L.remove })
2541
+ ] }) }),
2542
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: internal.map((r, idx) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2543
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
2544
+ "input",
2545
+ {
2546
+ value: r.code,
2547
+ onChange: (e) => onCellEdit(idx, "code", e.target.value)
2548
+ }
2549
+ ) : r.code }),
2550
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
2551
+ "input",
2552
+ {
2553
+ type: "number",
2554
+ step: "0.01",
2555
+ min: 0,
2556
+ max: 1,
2557
+ value: r.rate,
2558
+ onChange: (e) => onCellEdit(idx, "rate", e.target.value)
2559
+ }
2560
+ ) : `${(r.rate * 100).toLocaleString(locale, { maximumFractionDigits: 2 })}%` }),
2561
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
2562
+ "input",
2563
+ {
2564
+ value: r.label ?? "",
2565
+ onChange: (e) => onCellEdit(idx, "label", e.target.value)
2566
+ }
2567
+ ) : r.label ?? "" }),
2568
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
2569
+ "input",
2570
+ {
2571
+ value: r.description ?? "",
2572
+ onChange: (e) => onCellEdit(idx, "description", e.target.value)
2573
+ }
2574
+ ) : r.description ?? "" }),
2575
+ editable && /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => removeRow(idx), "aria-label": L.remove, children: /* @__PURE__ */ jsxRuntime.jsx(ae, { name: "close", size: 14 }) }) })
2576
+ ] }, r.code)) })
2577
+ ] }),
2578
+ editable && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-vat-table__add", onClick: addRow, children: L.add })
2579
+ ]
2580
+ }
2581
+ );
2582
+ }
2583
+ );
2584
+ const EMPTY_INVOICES = [];
4136
2585
  function pad(n) {
4137
2586
  return n < 10 ? `0${n}` : String(n);
4138
2587
  }
@@ -4173,9 +2622,9 @@ function defaultBuildXml(opts) {
4173
2622
  let vat = 0;
4174
2623
  for (const ln of inv.lines) {
4175
2624
  const n = Math.round(ln.quantity * ln.unitPrice.amount * (1 - (ln.discount ?? 0)));
4176
- const v = Math.round(n * ln.vatRate);
2625
+ const v2 = Math.round(n * ln.vatRate);
4177
2626
  net += n;
4178
- vat += v;
2627
+ vat += v2;
4179
2628
  }
4180
2629
  lines.push(` <SumaNetto>${(net / 100).toFixed(2)}</SumaNetto>`);
4181
2630
  lines.push(` <SumaVAT>${(vat / 100).toFixed(2)}</SumaVAT>`);
@@ -4185,9 +2634,9 @@ function defaultBuildXml(opts) {
4185
2634
  lines.push("</JPK>");
4186
2635
  return lines.join("\n");
4187
2636
  }
4188
- const NiceJpkExporter = be.forwardRef(
2637
+ const NiceJpkExporter = /* @__PURE__ */ ve.forwardRef(
4189
2638
  function NiceJpkExporter2({
4190
- invoices,
2639
+ invoices = EMPTY_INVOICES,
4191
2640
  taxpayer,
4192
2641
  defaultFormat = "JPK_V7M",
4193
2642
  defaultPeriod,
@@ -4199,12 +2648,13 @@ const NiceJpkExporter = be.forwardRef(
4199
2648
  style,
4200
2649
  id
4201
2650
  }, ref) {
2651
+ const { t } = v();
4202
2652
  const today = /* @__PURE__ */ new Date();
4203
- const [format, setFormat] = be.useState(defaultFormat);
4204
- const [from, setFrom] = be.useState(
2653
+ const [format, setFormat] = ve.useState(defaultFormat);
2654
+ const [from, setFrom] = ve.useState(
4205
2655
  isoDate((defaultPeriod == null ? void 0 : defaultPeriod.from) ?? new Date(today.getFullYear(), today.getMonth(), 1))
4206
2656
  );
4207
- const [to, setTo] = be.useState(
2657
+ const [to, setTo] = ve.useState(
4208
2658
  isoDate((defaultPeriod == null ? void 0 : defaultPeriod.to) ?? new Date(today.getFullYear(), today.getMonth() + 1, 0))
4209
2659
  );
4210
2660
  const L = {
@@ -4214,7 +2664,7 @@ const NiceJpkExporter = be.forwardRef(
4214
2664
  export: "Export",
4215
2665
  ...labels
4216
2666
  };
4217
- const exportNow = be.useCallback(() => {
2667
+ const exportNow = ve.useCallback(() => {
4218
2668
  const opts = {
4219
2669
  format,
4220
2670
  period: { from: new Date(from), to: new Date(to) },
@@ -4227,12 +2677,12 @@ const NiceJpkExporter = be.forwardRef(
4227
2677
  onExport == null ? void 0 : onExport(xml, blob, opts);
4228
2678
  if (typeof window !== "undefined" && typeof URL.createObjectURL === "function") {
4229
2679
  const url = URL.createObjectURL(blob);
4230
- const a = document.createElement("a");
4231
- a.href = url;
4232
- a.download = filename;
4233
- document.body.appendChild(a);
4234
- a.click();
4235
- a.remove();
2680
+ const a2 = document.createElement("a");
2681
+ a2.href = url;
2682
+ a2.download = filename;
2683
+ document.body.appendChild(a2);
2684
+ a2.click();
2685
+ a2.remove();
4236
2686
  URL.revokeObjectURL(url);
4237
2687
  }
4238
2688
  }, [format, from, to, taxpayer, invoices, buildXml, onExport, filenameFor]);
@@ -4261,10 +2711,10 @@ const NiceJpkExporter = be.forwardRef(
4261
2711
  /* @__PURE__ */ jsxRuntime.jsx("input", { type: "date", value: to, onChange: (e) => setTo(e.target.value) })
4262
2712
  ] }),
4263
2713
  /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: exportNow, children: L.export }),
4264
- /* @__PURE__ */ jsxRuntime.jsxs("small", { children: [
4265
- invoices.length,
4266
- " invoices ready"
4267
- ] })
2714
+ /* @__PURE__ */ jsxRuntime.jsx("small", { children: t("jpkExporter.invoicesReady", "{invoices} invoices ready").replace(
2715
+ "{invoices}",
2716
+ String(invoices.length)
2717
+ ) })
4268
2718
  ] });
4269
2719
  }
4270
2720
  );