@nice2dev/ui-erp 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,33 @@ 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
+ }, la = {
226
221
  xs: 12,
227
222
  sm: 16,
228
223
  md: 20,
229
224
  lg: 24,
230
225
  xl: 32
231
- }, gt = be.createContext({});
232
- function la({
226
+ }, gt = /* @__PURE__ */ ve.createContext({});
227
+ function da({
233
228
  path: e,
234
229
  size: t,
235
230
  className: r,
236
- style: a,
231
+ style: a2,
237
232
  color: n,
238
233
  title: o,
239
- onClick: i
234
+ onClick: s
240
235
  }) {
241
236
  return /* @__PURE__ */ jsxRuntime.jsxs(
242
237
  "svg",
@@ -251,11 +246,11 @@ function la({
251
246
  strokeLinecap: "round",
252
247
  strokeLinejoin: "round",
253
248
  className: `nice-icon ${r || ""}`,
254
- style: a,
249
+ style: a2,
255
250
  role: o ? "img" : "presentation",
256
251
  "aria-label": o,
257
252
  "aria-hidden": !o,
258
- onClick: i,
253
+ onClick: s,
259
254
  children: [
260
255
  o && /* @__PURE__ */ jsxRuntime.jsx("title", { children: o }),
261
256
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: e })
@@ -263,1726 +258,51 @@ function la({
263
258
  }
264
259
  );
265
260
  }
266
- const Ae = ({
261
+ const re = ({
267
262
  name: e,
268
263
  size: t = "md",
269
264
  className: r,
270
- style: a,
265
+ style: a2,
271
266
  color: n,
272
267
  title: o,
273
- onClick: i
268
+ onClick: s
274
269
  }) => {
275
- const { resolver: s } = be.useContext(gt), c = typeof t == "number" ? t : ca[t];
276
- if (s) {
277
- const d = s(e, c);
270
+ const { resolver: i2 } = ve.useContext(gt), c2 = typeof t == "number" ? t : la[t];
271
+ if (i2) {
272
+ const d = i2(e, c2);
278
273
  if (d)
279
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `nice-icon-wrap ${r || ""}`, style: a, onClick: i, children: d });
274
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `nice-icon-wrap ${r || ""}`, style: a2, onClick: s, children: d });
280
275
  }
281
- const l = er[e];
276
+ const l = tr[e];
282
277
  return l ? /* @__PURE__ */ jsxRuntime.jsx(
283
- la,
278
+ da,
284
279
  {
285
280
  path: l,
286
- size: c,
281
+ size: c2,
287
282
  className: r,
288
- style: a,
283
+ style: a2,
289
284
  color: n,
290
285
  title: o,
291
- onClick: i
286
+ onClick: s
292
287
  }
293
288
  ) : null;
294
289
  };
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";
290
+ process.env.NODE_ENV !== "production" && "NiceRTLProvider";
291
+ process.env.NODE_ENV !== "production" && "NiceAccessControl";
292
+ process.env.NODE_ENV !== "production" && "NiceA11yProvider";
293
+ process.env.NODE_ENV !== "production" && "NiceVisuallyHidden";
294
+ process.env.NODE_ENV !== "production" && "NiceSkipLink";
295
+ process.env.NODE_ENV !== "production" && "NiceKeyboardHint";
296
+ process.env.NODE_ENV !== "production" && "NiceThemeProvider";
297
+ process.env.NODE_ENV !== "production" && "NiceTestWrapper";
1943
298
  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);
299
+ process.env.NODE_ENV === "development";
300
+ process.env.NODE_ENV !== "production" && "NiceHelpProvider";
301
+ process.env.NODE_ENV !== "production" && "NiceInlineHelp";
302
+ process.env.NODE_ENV !== "production" && "NiceQuickHelp";
303
+ process.env.NODE_ENV !== "production" && "NiceHelpIcon";
304
+ const EMPTY_RESOURCES = [];
305
+ const EMPTY_ALLOCATIONS = [];
1986
306
  const DEFAULT_VIEW_CONFIG$1 = {
1987
307
  timeUnit: "day",
1988
308
  showUtilization: true,
@@ -1999,8 +319,8 @@ const TIME_INCREMENTS = {
1999
319
  year: 365 * 24 * 60 * 60 * 1e3
2000
320
  };
2001
321
  const NiceCapacityPlanner = ({
2002
- resources,
2003
- allocations,
322
+ resources = EMPTY_RESOURCES,
323
+ allocations = EMPTY_ALLOCATIONS,
2004
324
  dateRange,
2005
325
  viewConfig: externalConfig,
2006
326
  onAllocationCreate,
@@ -2010,17 +330,18 @@ const NiceCapacityPlanner = ({
2010
330
  readOnly = false,
2011
331
  className = ""
2012
332
  }) => {
2013
- var _a2, _b;
333
+ var _a, _b;
334
+ const { t } = v();
2014
335
  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(
336
+ const [selectedAllocation, setSelectedAllocation] = ve.useState(null);
337
+ const [hoveredCell, setHoveredCell] = ve.useState(null);
338
+ const [timeUnit, setTimeUnit] = ve.useState(config.timeUnit);
339
+ const [expandedResources, setExpandedResources] = ve.useState(
2019
340
  new Set(resources.map((r) => r.id))
2020
341
  );
2021
- const [showAllocationModal, setShowAllocationModal] = be.useState(false);
2022
- const [newAllocation, setNewAllocation] = be.useState({});
2023
- const timePeriods = be.useMemo(() => {
342
+ const [showAllocationModal, setShowAllocationModal] = ve.useState(false);
343
+ const [newAllocation, setNewAllocation] = ve.useState({});
344
+ const timePeriods = ve.useMemo(() => {
2024
345
  const periods = [];
2025
346
  const increment = TIME_INCREMENTS[timeUnit];
2026
347
  let current = new Date(dateRange.start);
@@ -2030,22 +351,22 @@ const NiceCapacityPlanner = ({
2030
351
  }
2031
352
  return periods;
2032
353
  }, [dateRange.start, dateRange.end, timeUnit]);
2033
- const utilizationMap = be.useMemo(() => {
354
+ const utilizationMap = ve.useMemo(() => {
2034
355
  const map = /* @__PURE__ */ new Map();
2035
356
  resources.forEach((resource) => {
2036
357
  const resourceMap = /* @__PURE__ */ new Map();
2037
358
  timePeriods.forEach((period) => {
2038
359
  const periodStart = period.getTime();
2039
360
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2040
- const periodAllocations = allocations.filter((a) => {
2041
- if (a.resourceId !== resource.id) {
361
+ const periodAllocations = allocations.filter((a2) => {
362
+ if (a2.resourceId !== resource.id) {
2042
363
  return false;
2043
364
  }
2044
- const allocStart = a.start.getTime();
2045
- const allocEnd = a.end.getTime();
365
+ const allocStart = a2.start.getTime();
366
+ const allocEnd = a2.end.getTime();
2046
367
  return allocStart < periodEnd && allocEnd > periodStart;
2047
368
  });
2048
- const allocatedHours = periodAllocations.reduce((sum, a) => sum + a.hoursPerDay, 0);
369
+ const allocatedHours = periodAllocations.reduce((sum, a2) => sum + a2.hoursPerDay, 0);
2049
370
  const availableHours = resource.maxCapacity;
2050
371
  const utilizationPercent = availableHours > 0 ? allocatedHours / availableHours * 100 : 0;
2051
372
  resourceMap.set(periodStart, {
@@ -2061,7 +382,7 @@ const NiceCapacityPlanner = ({
2061
382
  });
2062
383
  return map;
2063
384
  }, [resources, allocations, timePeriods, timeUnit]);
2064
- const conflicts = be.useMemo(() => {
385
+ const conflicts = ve.useMemo(() => {
2065
386
  const conflictList = [];
2066
387
  utilizationMap.forEach((resourceMap, resourceId) => {
2067
388
  const resource = resources.find((r) => r.id === resourceId);
@@ -2069,12 +390,12 @@ const NiceCapacityPlanner = ({
2069
390
  if (util.overallocated) {
2070
391
  const period = new Date(periodStart);
2071
392
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2072
- const conflictAllocations = allocations.filter((a) => {
2073
- if (a.resourceId !== resourceId) {
393
+ const conflictAllocations = allocations.filter((a2) => {
394
+ if (a2.resourceId !== resourceId) {
2074
395
  return false;
2075
396
  }
2076
- const allocStart = a.start.getTime();
2077
- const allocEnd = a.end.getTime();
397
+ const allocStart = a2.start.getTime();
398
+ const allocEnd = a2.end.getTime();
2078
399
  return allocStart < periodEnd && allocEnd > periodStart;
2079
400
  });
2080
401
  conflictList.push({
@@ -2089,24 +410,24 @@ const NiceCapacityPlanner = ({
2089
410
  });
2090
411
  return conflictList;
2091
412
  }, [utilizationMap, allocations, resources, timeUnit]);
2092
- const getCellAllocations = be.useCallback(
413
+ const getCellAllocations = ve.useCallback(
2093
414
  (resourceId, date) => {
2094
415
  const periodStart = date.getTime();
2095
416
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2096
- return allocations.filter((a) => {
2097
- if (a.resourceId !== resourceId) {
417
+ return allocations.filter((a2) => {
418
+ if (a2.resourceId !== resourceId) {
2098
419
  return false;
2099
420
  }
2100
- const allocStart = a.start.getTime();
2101
- const allocEnd = a.end.getTime();
421
+ const allocStart = a2.start.getTime();
422
+ const allocEnd = a2.end.getTime();
2102
423
  return allocStart < periodEnd && allocEnd > periodStart;
2103
424
  });
2104
425
  },
2105
426
  [allocations, timeUnit]
2106
427
  );
2107
428
  const getCellColor = (resourceId, date) => {
2108
- var _a3;
2109
- const util = (_a3 = utilizationMap.get(resourceId)) == null ? void 0 : _a3.get(date.getTime());
429
+ var _a2;
430
+ const util = (_a2 = utilizationMap.get(resourceId)) == null ? void 0 : _a2.get(date.getTime());
2110
431
  if (!util) {
2111
432
  return "transparent";
2112
433
  }
@@ -2136,7 +457,7 @@ const NiceCapacityPlanner = ({
2136
457
  }
2137
458
  };
2138
459
  const handleCellClick = (resourceId, date) => {
2139
- var _a3;
460
+ var _a2;
2140
461
  if (readOnly) {
2141
462
  return;
2142
463
  }
@@ -2144,7 +465,7 @@ const NiceCapacityPlanner = ({
2144
465
  resourceId,
2145
466
  start: date,
2146
467
  end: new Date(date.getTime() + TIME_INCREMENTS[timeUnit]),
2147
- hoursPerDay: ((_a3 = resources.find((r) => r.id === resourceId)) == null ? void 0 : _a3.maxCapacity) || 8,
468
+ hoursPerDay: ((_a2 = resources.find((r) => r.id === resourceId)) == null ? void 0 : _a2.maxCapacity) || 8,
2148
469
  status: "tentative"
2149
470
  });
2150
471
  setShowAllocationModal(true);
@@ -2191,47 +512,45 @@ const NiceCapacityPlanner = ({
2191
512
  }
2192
513
  };
2193
514
  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: [
515
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "nice-resource-allocation__toolbar", children: [
516
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__toolbar-left", children: [
517
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { children: t("capacityPlanner.resourceAllocation", "Resource Allocation") }),
518
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-resource-allocation__date-range", children: [
2198
519
  dateRange.start.toLocaleDateString(),
2199
520
  " - ",
2200
521
  dateRange.end.toLocaleDateString()
2201
522
  ] })
2202
523
  ] }),
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(
524
+ /* @__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
525
  "button",
2205
526
  {
2206
- className: `unit-button ${timeUnit === unit ? "unit-button--active" : ""}`,
527
+ className: `nice-resource-allocation__unit-button ${timeUnit === unit ? "nice-resource-allocation__unit-button--active" : ""}`,
2207
528
  onClick: () => setTimeUnit(unit),
2208
529
  children: unit.charAt(0).toUpperCase() + unit.slice(1)
2209
530
  },
2210
531
  unit
2211
532
  )) }) }),
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" : ""
533
+ /* @__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: [
534
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-resource-allocation__badge-icon", children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "warning", size: 14 }) }),
535
+ (conflicts.length === 1 ? t("capacityPlanner.oneConflict", "1 Conflict") : t("capacityPlanner.conflicts", "{count} Conflicts")).replace("{count}", String(conflicts.length))
2217
536
  ] }) })
2218
537
  ] }),
2219
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "allocation__legend", children: [
2220
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "legend-item", children: [
538
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__legend", children: [
539
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__legend-item", children: [
2221
540
  /* @__PURE__ */ jsxRuntime.jsx(
2222
541
  "span",
2223
542
  {
2224
- className: "legend-color",
543
+ className: "nice-resource-allocation__legend-color",
2225
544
  style: { backgroundColor: "var(--nice-success-tint-20, rgba(34, 197, 94, 0.2))" }
2226
545
  }
2227
546
  ),
2228
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Allocated" })
547
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("capacityPlanner.allocated", "Allocated") })
2229
548
  ] }),
2230
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "legend-item", children: [
549
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__legend-item", children: [
2231
550
  /* @__PURE__ */ jsxRuntime.jsx(
2232
551
  "span",
2233
552
  {
2234
- className: "legend-color",
553
+ className: "nice-resource-allocation__legend-color",
2235
554
  style: { backgroundColor: "var(--nice-warning-tint-30, rgba(245, 158, 11, 0.3))" }
2236
555
  }
2237
556
  ),
@@ -2243,70 +562,77 @@ const NiceCapacityPlanner = ({
2243
562
  "%)"
2244
563
  ] })
2245
564
  ] }),
2246
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "legend-item", children: [
565
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__legend-item", children: [
2247
566
  /* @__PURE__ */ jsxRuntime.jsx(
2248
567
  "span",
2249
568
  {
2250
- className: "legend-color",
569
+ className: "nice-resource-allocation__legend-color",
2251
570
  style: { backgroundColor: "var(--nice-danger-tint-40, rgba(239, 68, 68, 0.4))" }
2252
571
  }
2253
572
  ),
2254
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Overallocated" })
573
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("capacityPlanner.overallocated", "Overallocated") })
2255
574
  ] })
2256
575
  ] }),
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)) })
576
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__grid", children: [
577
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__grid-header", children: [
578
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-resource-allocation__resource-header", children: t("capacityPlanner.resource", "Resource") }),
579
+ /* @__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
580
  ] }),
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,
581
+ /* @__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: [
582
+ /* @__PURE__ */ jsxRuntime.jsxs(
583
+ "div",
584
+ {
585
+ className: "nice-resource-allocation__resource-cell",
586
+ onClick: () => onResourceClick == null ? void 0 : onResourceClick(resource),
587
+ children: [
588
+ /* @__PURE__ */ jsxRuntime.jsx(
589
+ "button",
2274
590
  {
2275
- name: expandedResources.has(resource.id) ? "chevron-down" : "chevron-right",
2276
- size: 14
591
+ className: "nice-resource-allocation__expand-button",
592
+ onClick: (e) => {
593
+ e.stopPropagation();
594
+ toggleResource(resource.id);
595
+ },
596
+ children: /* @__PURE__ */ jsxRuntime.jsx(
597
+ re,
598
+ {
599
+ name: expandedResources.has(resource.id) ? "chevron-down" : "chevron-right",
600
+ size: 14
601
+ }
602
+ )
2277
603
  }
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;
604
+ ),
605
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-resource-allocation__resource-icon", children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: getResourceTypeIcon(resource.type), size: 16 }) }),
606
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__resource-info", children: [
607
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-resource-allocation__resource-name", children: resource.name }),
608
+ resource.department && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-resource-allocation__resource-dept", children: resource.department })
609
+ ] }),
610
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-resource-allocation__resource-capacity", children: [
611
+ resource.maxCapacity,
612
+ "h/day"
613
+ ] })
614
+ ]
615
+ }
616
+ ),
617
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-resource-allocation__time-cells", children: timePeriods.map((period, idx) => {
618
+ var _a2;
2293
619
  const cellAllocations = getCellAllocations(resource.id, period);
2294
- const util = (_a3 = utilizationMap.get(resource.id)) == null ? void 0 : _a3.get(period.getTime());
620
+ const util = (_a2 = utilizationMap.get(resource.id)) == null ? void 0 : _a2.get(period.getTime());
2295
621
  const isHovered = (hoveredCell == null ? void 0 : hoveredCell.resourceId) === resource.id && (hoveredCell == null ? void 0 : hoveredCell.date.getTime()) === period.getTime();
2296
622
  return /* @__PURE__ */ jsxRuntime.jsxs(
2297
623
  "div",
2298
624
  {
2299
- className: `time-cell ${isHovered ? "time-cell--hovered" : ""}`,
625
+ className: `nice-resource-allocation__time-cell ${isHovered ? "nice-resource-allocation__time-cell--hovered" : ""}`,
2300
626
  style: { backgroundColor: getCellColor(resource.id, period) },
2301
627
  onClick: () => handleCellClick(resource.id, period),
2302
628
  onMouseEnter: () => setHoveredCell({ resourceId: resource.id, date: period }),
2303
629
  onMouseLeave: () => setHoveredCell(null),
2304
630
  children: [
2305
- cellAllocations.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "allocation-indicators", children: [
631
+ cellAllocations.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__allocation-indicators", children: [
2306
632
  cellAllocations.slice(0, 2).map((alloc) => /* @__PURE__ */ jsxRuntime.jsx(
2307
633
  "div",
2308
634
  {
2309
- className: `allocation-dot ${alloc.status}`,
635
+ className: `nice-resource-allocation__allocation-dot nice-resource-allocation__allocation-dot--${alloc.status}`,
2310
636
  onClick: (e) => {
2311
637
  e.stopPropagation();
2312
638
  setSelectedAllocation(alloc.id);
@@ -2314,12 +640,12 @@ const NiceCapacityPlanner = ({
2314
640
  },
2315
641
  alloc.id
2316
642
  )),
2317
- cellAllocations.length > 2 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "more-indicator", children: [
643
+ cellAllocations.length > 2 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-resource-allocation__more-indicator", children: [
2318
644
  "+",
2319
645
  cellAllocations.length - 2
2320
646
  ] })
2321
647
  ] }),
2322
- config.showUtilization && util && util.allocatedHours > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "utilization-label", children: [
648
+ config.showUtilization && util && util.allocatedHours > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-resource-allocation__utilization-label", children: [
2323
649
  util.allocatedHours.toFixed(1),
2324
650
  "h"
2325
651
  ] })
@@ -2328,7 +654,7 @@ const NiceCapacityPlanner = ({
2328
654
  idx
2329
655
  );
2330
656
  }) }),
2331
- expandedResources.has(resource.id) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "expanded-allocations", children: allocations.filter((a) => a.resourceId === resource.id).map((allocation) => {
657
+ 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
658
  const startIdx = timePeriods.findIndex(
2333
659
  (p) => p.getTime() <= allocation.start.getTime()
2334
660
  );
@@ -2344,26 +670,27 @@ const NiceCapacityPlanner = ({
2344
670
  return /* @__PURE__ */ jsxRuntime.jsxs(
2345
671
  "div",
2346
672
  {
2347
- className: `allocation-bar ${allocation.status} ${selectedAllocation === allocation.id ? "selected" : ""}`,
673
+ className: `nice-resource-allocation__allocation-bar nice-resource-allocation__allocation-bar--${allocation.status} ${selectedAllocation === allocation.id ? "nice-resource-allocation__allocation-bar--selected" : ""}`,
2348
674
  style: {
2349
675
  left: `${leftPercent}%`,
2350
676
  width: `${widthPercent}%`
2351
677
  },
2352
678
  onClick: () => setSelectedAllocation(allocation.id),
2353
679
  children: [
2354
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "allocation-label", children: [
680
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-resource-allocation__allocation-label", children: [
2355
681
  allocation.hoursPerDay,
2356
682
  "h/day"
2357
683
  ] }),
2358
684
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
2359
685
  "button",
2360
686
  {
2361
- className: "delete-allocation",
687
+ "aria-label": t("capacityPlanner.close", "Close"),
688
+ className: "nice-resource-allocation__delete-allocation",
2362
689
  onClick: (e) => {
2363
690
  e.stopPropagation();
2364
691
  onAllocationDelete == null ? void 0 : onAllocationDelete(allocation.id);
2365
692
  },
2366
- children: "×"
693
+ children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "close", size: 14 })
2367
694
  }
2368
695
  )
2369
696
  ]
@@ -2373,98 +700,127 @@ const NiceCapacityPlanner = ({
2373
700
  }) })
2374
701
  ] }, resource.id)) })
2375
702
  ] }),
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
- ] }) })
703
+ showAllocationModal && /* @__PURE__ */ jsxRuntime.jsx(
704
+ "div",
705
+ {
706
+ className: "nice-resource-allocation__modal-overlay",
707
+ onClick: () => setShowAllocationModal(false),
708
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
709
+ "div",
710
+ {
711
+ className: "nice-resource-allocation__allocation-modal",
712
+ onClick: (e) => e.stopPropagation(),
713
+ children: [
714
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { children: t("capacityPlanner.createAllocation", "Create Allocation") }),
715
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__modal-form", children: [
716
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
717
+ t("capacityPlanner.resource", "Resource"),
718
+ /* @__PURE__ */ jsxRuntime.jsxs(
719
+ "select",
720
+ {
721
+ value: newAllocation.resourceId || "",
722
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, resourceId: e.target.value })),
723
+ children: [
724
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("capacityPlanner.selectResource", "Select resource...") }),
725
+ resources.map((r) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: r.id, children: r.name }, r.id))
726
+ ]
727
+ }
728
+ )
729
+ ] }),
730
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
731
+ t("capacityPlanner.startDate", "Start Date"),
732
+ /* @__PURE__ */ jsxRuntime.jsx(
733
+ "input",
734
+ {
735
+ type: "date",
736
+ value: ((_a = newAllocation.start) == null ? void 0 : _a.toISOString().split("T")[0]) || "",
737
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, start: new Date(e.target.value) }))
738
+ }
739
+ )
740
+ ] }),
741
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
742
+ t("capacityPlanner.endDate", "End Date"),
743
+ /* @__PURE__ */ jsxRuntime.jsx(
744
+ "input",
745
+ {
746
+ type: "date",
747
+ value: ((_b = newAllocation.end) == null ? void 0 : _b.toISOString().split("T")[0]) || "",
748
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, end: new Date(e.target.value) }))
749
+ }
750
+ )
751
+ ] }),
752
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
753
+ t("capacityPlanner.hoursPerDay", "Hours per Day"),
754
+ /* @__PURE__ */ jsxRuntime.jsx(
755
+ "input",
756
+ {
757
+ type: "number",
758
+ min: "0.5",
759
+ max: "24",
760
+ step: "0.5",
761
+ value: newAllocation.hoursPerDay || 8,
762
+ onChange: (e) => setNewAllocation((prev) => ({
763
+ ...prev,
764
+ hoursPerDay: parseFloat(e.target.value)
765
+ }))
766
+ }
767
+ )
768
+ ] }),
769
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
770
+ t("capacityPlanner.status", "Status"),
771
+ /* @__PURE__ */ jsxRuntime.jsxs(
772
+ "select",
773
+ {
774
+ value: newAllocation.status || "tentative",
775
+ onChange: (e) => setNewAllocation((prev) => ({
776
+ ...prev,
777
+ status: e.target.value
778
+ })),
779
+ children: [
780
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "tentative", children: t("capacityPlanner.tentative", "Tentative") }),
781
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "confirmed", children: t("capacityPlanner.confirmed", "Confirmed") })
782
+ ]
783
+ }
784
+ )
785
+ ] }),
786
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
787
+ t("capacityPlanner.notes", "Notes"),
788
+ /* @__PURE__ */ jsxRuntime.jsx(
789
+ "textarea",
790
+ {
791
+ value: newAllocation.notes || "",
792
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, notes: e.target.value })),
793
+ placeholder: t("capacityPlanner.optionalNotes", "Optional notes...")
794
+ }
795
+ )
796
+ ] })
797
+ ] }),
798
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__modal-actions", children: [
799
+ /* @__PURE__ */ jsxRuntime.jsx(
800
+ "button",
801
+ {
802
+ className: "nice-resource-allocation__cancel-button",
803
+ onClick: () => setShowAllocationModal(false),
804
+ children: t("capacityPlanner.cancel", "Cancel")
805
+ }
806
+ ),
807
+ /* @__PURE__ */ jsxRuntime.jsx(
808
+ "button",
809
+ {
810
+ className: "nice-resource-allocation__create-button",
811
+ onClick: handleCreateAllocation,
812
+ children: t("capacityPlanner.createAllocation", "Create Allocation")
813
+ }
814
+ )
815
+ ] })
816
+ ]
817
+ }
818
+ )
819
+ }
820
+ )
2466
821
  ] });
2467
822
  };
823
+ const EMPTY_ITEMS = [];
2468
824
  const DEFAULT_VIEW_CONFIG = {
2469
825
  view: "grid",
2470
826
  sortBy: "name",
@@ -2473,7 +829,7 @@ const DEFAULT_VIEW_CONFIG = {
2473
829
  pageSize: 24
2474
830
  };
2475
831
  const NiceInventoryManager = ({
2476
- items,
832
+ items = EMPTY_ITEMS,
2477
833
  transactions = [],
2478
834
  viewConfig: externalConfig,
2479
835
  onItemCreate,
@@ -2482,38 +838,40 @@ const NiceInventoryManager = ({
2482
838
  onTransactionCreate,
2483
839
  onStockCount,
2484
840
  onItemClick,
841
+ onCreatePurchaseOrder,
2485
842
  readOnly = false,
2486
843
  className = ""
2487
844
  }) => {
2488
- var _a2, _b;
845
+ var _a, _b;
846
+ const { t } = v();
2489
847
  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(() => {
848
+ const [filters, setFilters] = ve.useState({});
849
+ const [view, setView] = ve.useState(config.view);
850
+ const [sortBy, setSortBy] = ve.useState(config.sortBy);
851
+ const [sortOrder, setSortOrder] = ve.useState(config.sortOrder);
852
+ const [page, setPage] = ve.useState(1);
853
+ const [selectedItems, setSelectedItems] = ve.useState(/* @__PURE__ */ new Set());
854
+ const [showItemModal, setShowItemModal] = ve.useState(false);
855
+ const [showTransactionModal, setShowTransactionModal] = ve.useState(false);
856
+ const [editingItem, setEditingItem] = ve.useState(null);
857
+ const [newTransaction, setNewTransaction] = ve.useState({});
858
+ const [activeTab, setActiveTab] = ve.useState("inventory");
859
+ const categories = ve.useMemo(() => {
2502
860
  return Array.from(new Set(items.map((item) => item.category))).sort();
2503
861
  }, [items]);
2504
- const filteredItems = be.useMemo(() => {
2505
- var _a3, _b2;
862
+ const filteredItems = ve.useMemo(() => {
863
+ var _a2, _b2;
2506
864
  let result = [...items];
2507
865
  if (filters.searchQuery) {
2508
866
  const query = filters.searchQuery.toLowerCase();
2509
867
  result = result.filter(
2510
868
  (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));
869
+ var _a3;
870
+ return item.name.toLowerCase().includes(query) || item.sku.toLowerCase().includes(query) || ((_a3 = item.description) == null ? void 0 : _a3.toLowerCase().includes(query));
2513
871
  }
2514
872
  );
2515
873
  }
2516
- if ((_a3 = filters.categories) == null ? void 0 : _a3.length) {
874
+ if ((_a2 = filters.categories) == null ? void 0 : _a2.length) {
2517
875
  result = result.filter((item) => filters.categories.includes(item.category));
2518
876
  }
2519
877
  if ((_b2 = filters.statuses) == null ? void 0 : _b2.length) {
@@ -2522,42 +880,42 @@ const NiceInventoryManager = ({
2522
880
  if (filters.lowStockOnly) {
2523
881
  result = result.filter((item) => item.quantity <= item.reorderLevel);
2524
882
  }
2525
- result.sort((a, b) => {
2526
- var _a4, _b3;
883
+ result.sort((a2, b) => {
884
+ var _a3, _b3;
2527
885
  let comparison = 0;
2528
886
  switch (sortBy) {
2529
887
  case "name":
2530
- comparison = a.name.localeCompare(b.name);
888
+ comparison = a2.name.localeCompare(b.name);
2531
889
  break;
2532
890
  case "sku":
2533
- comparison = a.sku.localeCompare(b.sku);
891
+ comparison = a2.sku.localeCompare(b.sku);
2534
892
  break;
2535
893
  case "quantity":
2536
- comparison = a.quantity - b.quantity;
894
+ comparison = a2.quantity - b.quantity;
2537
895
  break;
2538
896
  case "value":
2539
- comparison = a.quantity * a.cost.amount - b.quantity * b.cost.amount;
897
+ comparison = a2.quantity * a2.cost.amount - b.quantity * b.cost.amount;
2540
898
  break;
2541
899
  case "lastUpdated":
2542
- comparison = (((_a4 = a.lastCountDate) == null ? void 0 : _a4.getTime()) || 0) - (((_b3 = b.lastCountDate) == null ? void 0 : _b3.getTime()) || 0);
900
+ comparison = (((_a3 = a2.lastCountDate) == null ? void 0 : _a3.getTime()) || 0) - (((_b3 = b.lastCountDate) == null ? void 0 : _b3.getTime()) || 0);
2543
901
  break;
2544
902
  }
2545
903
  return sortOrder === "asc" ? comparison : -comparison;
2546
904
  });
2547
905
  return result;
2548
906
  }, [items, filters, sortBy, sortOrder]);
2549
- const paginatedItems = be.useMemo(() => {
907
+ const paginatedItems = ve.useMemo(() => {
2550
908
  const start = (page - 1) * config.pageSize;
2551
909
  return filteredItems.slice(start, start + config.pageSize);
2552
910
  }, [filteredItems, page, config.pageSize]);
2553
911
  const totalPages = Math.ceil(filteredItems.length / config.pageSize);
2554
- const reorderItems = be.useMemo(() => {
912
+ const reorderItems = ve.useMemo(() => {
2555
913
  return items.filter((item) => item.quantity <= item.reorderLevel);
2556
914
  }, [items]);
2557
- const recentTransactions = be.useMemo(() => {
2558
- return [...transactions].sort((a, b) => b.date.getTime() - a.date.getTime()).slice(0, 50);
915
+ const recentTransactions = ve.useMemo(() => {
916
+ return [...transactions].sort((a2, b) => b.date.getTime() - a2.date.getTime()).slice(0, 50);
2559
917
  }, [transactions]);
2560
- const kanbanGroups = be.useMemo(() => {
918
+ const kanbanGroups = ve.useMemo(() => {
2561
919
  if (view !== "kanban") {
2562
920
  return null;
2563
921
  }
@@ -2571,8 +929,8 @@ const NiceInventoryManager = ({
2571
929
  ];
2572
930
  statuses.forEach((status) => groups.set(status, []));
2573
931
  filteredItems.forEach((item) => {
2574
- var _a3;
2575
- (_a3 = groups.get(item.status)) == null ? void 0 : _a3.push(item);
932
+ var _a2;
933
+ (_a2 = groups.get(item.status)) == null ? void 0 : _a2.push(item);
2576
934
  });
2577
935
  return groups;
2578
936
  }, [filteredItems, view]);
@@ -2653,35 +1011,35 @@ const NiceInventoryManager = ({
2653
1011
  });
2654
1012
  };
2655
1013
  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: [
1014
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "nice-inventory-manager__toolbar", children: [
1015
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__toolbar-left", children: [
1016
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__search-box", children: [
2659
1017
  /* @__PURE__ */ jsxRuntime.jsx(
2660
1018
  "input",
2661
1019
  {
2662
1020
  type: "text",
2663
- placeholder: "Search items...",
1021
+ placeholder: t("inventoryManager.searchItems", "Search items..."),
2664
1022
  value: filters.searchQuery || "",
2665
1023
  onChange: (e) => setFilters((prev) => ({ ...prev, searchQuery: e.target.value }))
2666
1024
  }
2667
1025
  ),
2668
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "search-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "search", size: 14 }) })
1026
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__search-icon", children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "search", size: 14 }) })
2669
1027
  ] }),
2670
1028
  /* @__PURE__ */ jsxRuntime.jsxs(
2671
1029
  "select",
2672
1030
  {
2673
- value: ((_a2 = filters.categories) == null ? void 0 : _a2[0]) || "",
1031
+ value: ((_a = filters.categories) == null ? void 0 : _a[0]) || "",
2674
1032
  onChange: (e) => setFilters((prev) => ({
2675
1033
  ...prev,
2676
1034
  categories: e.target.value ? [e.target.value] : void 0
2677
1035
  })),
2678
1036
  children: [
2679
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "All Categories" }),
1037
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("inventoryManager.allCategories", "All Categories") }),
2680
1038
  categories.map((cat) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: cat, children: cat }, cat))
2681
1039
  ]
2682
1040
  }
2683
1041
  ),
2684
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "filter-checkbox", children: [
1042
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "nice-inventory-manager__filter-checkbox", children: [
2685
1043
  /* @__PURE__ */ jsxRuntime.jsx(
2686
1044
  "input",
2687
1045
  {
@@ -2690,29 +1048,29 @@ const NiceInventoryManager = ({
2690
1048
  onChange: (e) => setFilters((prev) => ({ ...prev, lowStockOnly: e.target.checked }))
2691
1049
  }
2692
1050
  ),
2693
- "Low Stock Only"
1051
+ t("inventoryManager.lowStockOnly", "Low Stock Only")
2694
1052
  ] })
2695
1053
  ] }),
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(
1054
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__toolbar-right", children: [
1055
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__view-selector", children: ["grid", "list", "kanban"].map((v2) => /* @__PURE__ */ jsxRuntime.jsx(
2698
1056
  "button",
2699
1057
  {
2700
- className: `view-button ${view === v ? "view-button--active" : ""}`,
2701
- onClick: () => setView(v),
1058
+ className: `nice-inventory-manager__view-button ${view === v2 ? "nice-inventory-manager__view-button--active" : ""}`,
1059
+ onClick: () => setView(v2),
2702
1060
  children: /* @__PURE__ */ jsxRuntime.jsx(
2703
- Ae,
1061
+ re,
2704
1062
  {
2705
- name: v === "grid" ? "grid" : v === "list" ? "list" : "table",
1063
+ name: v2 === "grid" ? "grid" : v2 === "list" ? "list" : "table",
2706
1064
  size: 14
2707
1065
  }
2708
1066
  )
2709
1067
  },
2710
- v
1068
+ v2
2711
1069
  )) }),
2712
1070
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
2713
1071
  "button",
2714
1072
  {
2715
- className: "add-button",
1073
+ className: "nice-inventory-manager__add-button",
2716
1074
  onClick: () => {
2717
1075
  setEditingItem({
2718
1076
  category: categories[0],
@@ -2730,11 +1088,11 @@ const NiceInventoryManager = ({
2730
1088
  )
2731
1089
  ] })
2732
1090
  ] }),
2733
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inventory__tabs", children: [
1091
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__tabs", children: [
2734
1092
  /* @__PURE__ */ jsxRuntime.jsxs(
2735
1093
  "button",
2736
1094
  {
2737
- className: `tab ${activeTab === "inventory" ? "tab--active" : ""}`,
1095
+ className: `nice-inventory-manager__tab ${activeTab === "inventory" ? "nice-inventory-manager__tab--active" : ""}`,
2738
1096
  onClick: () => setActiveTab("inventory"),
2739
1097
  children: [
2740
1098
  "Inventory (",
@@ -2746,7 +1104,7 @@ const NiceInventoryManager = ({
2746
1104
  /* @__PURE__ */ jsxRuntime.jsxs(
2747
1105
  "button",
2748
1106
  {
2749
- className: `tab ${activeTab === "transactions" ? "tab--active" : ""}`,
1107
+ className: `nice-inventory-manager__tab ${activeTab === "transactions" ? "nice-inventory-manager__tab--active" : ""}`,
2750
1108
  onClick: () => setActiveTab("transactions"),
2751
1109
  children: [
2752
1110
  "Transactions (",
@@ -2758,67 +1116,68 @@ const NiceInventoryManager = ({
2758
1116
  /* @__PURE__ */ jsxRuntime.jsxs(
2759
1117
  "button",
2760
1118
  {
2761
- className: `tab ${activeTab === "reorder" ? "tab--active" : ""}`,
1119
+ className: `nice-inventory-manager__tab ${activeTab === "reorder" ? "nice-inventory-manager__tab--active" : ""}`,
2762
1120
  onClick: () => setActiveTab("reorder"),
2763
1121
  children: [
2764
- "Reorder Alerts",
2765
- reorderItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "alert-badge", children: reorderItems.length })
1122
+ t("inventoryManager.reorderAlerts", "Reorder Alerts"),
1123
+ reorderItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__alert-badge", children: reorderItems.length })
2766
1124
  ]
2767
1125
  }
2768
1126
  )
2769
1127
  ] }),
2770
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inventory__content", children: [
1128
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__content", children: [
2771
1129
  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;
1130
+ view === "grid" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__items-grid", children: paginatedItems.map((item) => {
1131
+ var _a2;
2774
1132
  return /* @__PURE__ */ jsxRuntime.jsxs(
2775
1133
  "div",
2776
1134
  {
2777
- className: `item-card ${selectedItems.has(item.id) ? "item-card--selected" : ""}`,
1135
+ className: `nice-inventory-manager__item-card ${selectedItems.has(item.id) ? "nice-inventory-manager__item-card--selected" : ""}`,
2778
1136
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2779
1137
  children: [
2780
1138
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
2781
1139
  "input",
2782
1140
  {
2783
1141
  type: "checkbox",
2784
- className: "item-checkbox",
1142
+ className: "nice-inventory-manager__item-checkbox",
2785
1143
  checked: selectedItems.has(item.id),
2786
1144
  onChange: () => toggleItemSelection(item.id),
2787
1145
  onClick: (e) => e.stopPropagation()
2788
1146
  }
2789
1147
  ),
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 })
1148
+ 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(re, { name: "box", size: 32 }) }) }),
1149
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__item-info", children: [
1150
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__item-sku", children: item.sku }),
1151
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "nice-inventory-manager__item-name", children: item.name }),
1152
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__item-category", children: item.category })
2795
1153
  ] }),
2796
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "item-stock", children: [
1154
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__item-stock", children: [
2797
1155
  /* @__PURE__ */ jsxRuntime.jsx(
2798
1156
  "span",
2799
1157
  {
2800
- className: "status-badge",
1158
+ className: "nice-inventory-manager__status-badge",
2801
1159
  style: { backgroundColor: getStatusColor(item.status) },
2802
1160
  children: item.status.replace("-", " ")
2803
1161
  }
2804
1162
  ),
2805
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "quantity", children: [
1163
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__quantity", children: [
2806
1164
  item.quantity,
2807
1165
  " ",
2808
1166
  item.unit
2809
1167
  ] }),
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"
1168
+ item.quantity <= item.reorderLevel && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__reorder-alert", children: [
1169
+ /* @__PURE__ */ jsxRuntime.jsx(re, { name: "warning", size: 12 }),
1170
+ " ",
1171
+ t("inventoryManager.lowStock", "Low Stock")
2813
1172
  ] })
2814
1173
  ] }),
2815
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "item-value", children: formatCurrency(item.quantity * item.cost.amount, item.cost.currency.symbol) })
1174
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__item-value", children: formatCurrency(item.quantity * item.cost.amount, item.cost.currency.symbol) })
2816
1175
  ]
2817
1176
  },
2818
1177
  item.id
2819
1178
  );
2820
1179
  }) }),
2821
- view === "list" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "items-table", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { children: [
1180
+ view === "list" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__items-table", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { children: [
2822
1181
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2823
1182
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx("th", {}),
2824
1183
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2829,8 +1188,15 @@ const NiceInventoryManager = ({
2829
1188
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2830
1189
  },
2831
1190
  children: [
2832
- "SKU ",
2833
- sortBy === "sku" && (sortOrder === "asc" ? "↑" : "↓")
1191
+ t("inventoryManager.sku", "SKU"),
1192
+ " ",
1193
+ sortBy === "sku" && /* @__PURE__ */ jsxRuntime.jsx(
1194
+ re,
1195
+ {
1196
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1197
+ size: 12
1198
+ }
1199
+ )
2834
1200
  ]
2835
1201
  }
2836
1202
  ),
@@ -2842,12 +1208,19 @@ const NiceInventoryManager = ({
2842
1208
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2843
1209
  },
2844
1210
  children: [
2845
- "Name ",
2846
- sortBy === "name" && (sortOrder === "asc" ? "↑" : "↓")
1211
+ t("inventoryManager.name", "Name"),
1212
+ " ",
1213
+ sortBy === "name" && /* @__PURE__ */ jsxRuntime.jsx(
1214
+ re,
1215
+ {
1216
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1217
+ size: 12
1218
+ }
1219
+ )
2847
1220
  ]
2848
1221
  }
2849
1222
  ),
2850
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Category" }),
1223
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: t("inventoryManager.category", "Category") }),
2851
1224
  /* @__PURE__ */ jsxRuntime.jsxs(
2852
1225
  "th",
2853
1226
  {
@@ -2856,13 +1229,20 @@ const NiceInventoryManager = ({
2856
1229
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2857
1230
  },
2858
1231
  children: [
2859
- "Qty ",
2860
- sortBy === "quantity" && (sortOrder === "asc" ? "↑" : "↓")
1232
+ t("inventoryManager.qty", "Qty"),
1233
+ " ",
1234
+ sortBy === "quantity" && /* @__PURE__ */ jsxRuntime.jsx(
1235
+ re,
1236
+ {
1237
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1238
+ size: 12
1239
+ }
1240
+ )
2861
1241
  ]
2862
1242
  }
2863
1243
  ),
2864
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Status" }),
2865
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Location" }),
1244
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: t("inventoryManager.status", "Status") }),
1245
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: t("inventoryManager.location", "Location") }),
2866
1246
  /* @__PURE__ */ jsxRuntime.jsxs(
2867
1247
  "th",
2868
1248
  {
@@ -2871,17 +1251,24 @@ const NiceInventoryManager = ({
2871
1251
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2872
1252
  },
2873
1253
  children: [
2874
- "Value ",
2875
- sortBy === "value" && (sortOrder === "asc" ? "↑" : "↓")
1254
+ t("inventoryManager.value", "Value"),
1255
+ " ",
1256
+ sortBy === "value" && /* @__PURE__ */ jsxRuntime.jsx(
1257
+ re,
1258
+ {
1259
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1260
+ size: 12
1261
+ }
1262
+ )
2876
1263
  ]
2877
1264
  }
2878
1265
  ),
2879
- !readOnly && /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Actions" })
1266
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsx("th", { children: t("inventoryManager.actions", "Actions") })
2880
1267
  ] }) }),
2881
1268
  /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: paginatedItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
2882
1269
  "tr",
2883
1270
  {
2884
- className: selectedItems.has(item.id) ? "row--selected" : "",
1271
+ className: `nice-inventory-manager__row ${selectedItems.has(item.id) ? "nice-inventory-manager__row--selected" : ""}`,
2885
1272
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2886
1273
  children: [
2887
1274
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -2893,18 +1280,24 @@ const NiceInventoryManager = ({
2893
1280
  onClick: (e) => e.stopPropagation()
2894
1281
  }
2895
1282
  ) }),
2896
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "sku-cell", children: item.sku }),
1283
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-inventory-manager__sku-cell", children: item.sku }),
2897
1284
  /* @__PURE__ */ jsxRuntime.jsx("td", { children: item.name }),
2898
1285
  /* @__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
- ] }),
1286
+ /* @__PURE__ */ jsxRuntime.jsxs(
1287
+ "td",
1288
+ {
1289
+ className: `nice-inventory-manager__qty-cell ${item.quantity <= item.reorderLevel ? "nice-inventory-manager__qty-cell--low-stock" : ""}`,
1290
+ children: [
1291
+ item.quantity,
1292
+ " ",
1293
+ item.unit
1294
+ ]
1295
+ }
1296
+ ),
2904
1297
  /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx(
2905
1298
  "span",
2906
1299
  {
2907
- className: "status-badge",
1300
+ className: "nice-inventory-manager__status-badge",
2908
1301
  style: { backgroundColor: getStatusColor(item.status) },
2909
1302
  children: item.status.replace("-", " ")
2910
1303
  }
@@ -2914,40 +1307,40 @@ const NiceInventoryManager = ({
2914
1307
  item.quantity * item.cost.amount,
2915
1308
  item.cost.currency.symbol
2916
1309
  ) }),
2917
- !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "actions-cell", children: [
1310
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "nice-inventory-manager__actions-cell", children: [
2918
1311
  /* @__PURE__ */ jsxRuntime.jsx(
2919
1312
  "button",
2920
1313
  {
2921
- className: "action-btn",
1314
+ className: "nice-inventory-manager__action-btn",
2922
1315
  onClick: (e) => {
2923
1316
  e.stopPropagation();
2924
1317
  setEditingItem(item);
2925
1318
  setShowItemModal(true);
2926
1319
  },
2927
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "edit", size: 14 })
1320
+ children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "edit", size: 14 })
2928
1321
  }
2929
1322
  ),
2930
1323
  /* @__PURE__ */ jsxRuntime.jsx(
2931
1324
  "button",
2932
1325
  {
2933
- className: "action-btn",
1326
+ className: "nice-inventory-manager__action-btn",
2934
1327
  onClick: (e) => {
2935
1328
  e.stopPropagation();
2936
1329
  setNewTransaction({ itemId: item.id });
2937
1330
  setShowTransactionModal(true);
2938
1331
  },
2939
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "clipboard", size: 14 })
1332
+ children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "clipboard", size: 14 })
2940
1333
  }
2941
1334
  ),
2942
1335
  /* @__PURE__ */ jsxRuntime.jsx(
2943
1336
  "button",
2944
1337
  {
2945
- className: "action-btn action-btn--danger",
1338
+ className: "nice-inventory-manager__action-btn nice-inventory-manager__action-btn--danger",
2946
1339
  onClick: (e) => {
2947
1340
  e.stopPropagation();
2948
1341
  onItemDelete == null ? void 0 : onItemDelete(item.id);
2949
1342
  },
2950
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "trash", size: 14 })
1343
+ children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "trash", size: 14 })
2951
1344
  }
2952
1345
  )
2953
1346
  ] })
@@ -2956,27 +1349,34 @@ const NiceInventoryManager = ({
2956
1349
  item.id
2957
1350
  )) })
2958
1351
  ] }) }),
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(
1352
+ 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: [
1353
+ /* @__PURE__ */ jsxRuntime.jsxs(
1354
+ "div",
1355
+ {
1356
+ className: "nice-inventory-manager__column-header",
1357
+ style: { borderColor: getStatusColor(status) },
1358
+ children: [
1359
+ /* @__PURE__ */ jsxRuntime.jsx(
1360
+ "span",
1361
+ {
1362
+ className: "nice-inventory-manager__status-dot",
1363
+ style: { backgroundColor: getStatusColor(status) }
1364
+ }
1365
+ ),
1366
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__column-title", children: status.replace("-", " ") }),
1367
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__column-count", children: statusItems.length })
1368
+ ]
1369
+ }
1370
+ ),
1371
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__column-items", children: statusItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
2972
1372
  "div",
2973
1373
  {
2974
- className: "kanban-card",
1374
+ className: "nice-inventory-manager__kanban-card",
2975
1375
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2976
1376
  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: [
1377
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__card-sku", children: item.sku }),
1378
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__card-name", children: item.name }),
1379
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__card-qty", children: [
2980
1380
  item.quantity,
2981
1381
  " ",
2982
1382
  item.unit
@@ -2986,298 +1386,339 @@ const NiceInventoryManager = ({
2986
1386
  item.id
2987
1387
  )) })
2988
1388
  ] }, 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" })
1389
+ totalPages > 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__pagination", children: [
1390
+ /* @__PURE__ */ jsxRuntime.jsx("button", { disabled: page === 1, onClick: () => setPage((p) => p - 1), children: t("inventoryManager.previous", "Previous") }),
1391
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("inventoryManager.pageOf", "Page {page} of {totalPages}").replace("{page}", String(page)).replace("{totalPages}", String(totalPages)) }),
1392
+ /* @__PURE__ */ jsxRuntime.jsx("button", { disabled: page === totalPages, onClick: () => setPage((p) => p + 1), children: t("inventoryManager.next", "Next") })
2998
1393
  ] })
2999
1394
  ] }),
3000
- activeTab === "transactions" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "transactions-tab", children: [
1395
+ activeTab === "transactions" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__transactions-tab", children: [
3001
1396
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
3002
1397
  "button",
3003
1398
  {
3004
- className: "add-transaction-button",
1399
+ className: "nice-inventory-manager__add-transaction-button",
3005
1400
  onClick: () => setShowTransactionModal(true),
3006
1401
  children: "+ New Transaction"
3007
1402
  }
3008
1403
  ),
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 })
1404
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__transactions-list", children: recentTransactions.map((tx) => {
1405
+ const item = items.find((i2) => i2.id === tx.itemId);
1406
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__transaction-item", children: [
1407
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__tx-icon", children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: getTransactionIcon(tx.type), size: 16 }) }),
1408
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__tx-info", children: [
1409
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__tx-type", children: tx.type }),
1410
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__tx-item", children: (item == null ? void 0 : item.name) || tx.itemId })
3016
1411
  ] }),
3017
1412
  /* @__PURE__ */ jsxRuntime.jsxs(
3018
1413
  "span",
3019
1414
  {
3020
- className: `tx-qty ${tx.type === "receipt" || tx.type === "return" ? "positive" : "negative"}`,
1415
+ 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
1416
  children: [
3022
1417
  tx.type === "receipt" || tx.type === "return" ? "+" : "-",
3023
1418
  tx.quantity
3024
1419
  ]
3025
1420
  }
3026
1421
  ),
3027
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tx-date", children: tx.date.toLocaleString() }),
3028
- tx.reference && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tx-ref", children: [
1422
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__tx-date", children: tx.date.toLocaleString() }),
1423
+ tx.reference && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__tx-ref", children: [
3029
1424
  "Ref: ",
3030
1425
  tx.reference
3031
1426
  ] })
3032
1427
  ] }, tx.id);
3033
1428
  }) })
3034
1429
  ] }),
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 })
1430
+ 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: [
1431
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__empty-icon", children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "success", size: 32 }) }),
1432
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: t(
1433
+ "inventoryManager.allItemsAreSufficientlyStocked",
1434
+ "All items are sufficiently stocked"
1435
+ ) })
1436
+ ] }) : /* @__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: [
1437
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__reorder-info", children: [
1438
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__reorder-sku", children: item.sku }),
1439
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__reorder-name", children: item.name })
3042
1440
  ] }),
3043
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "reorder-stock", children: [
3044
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "current-qty", children: [
1441
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__reorder-stock", children: [
1442
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__current-qty", children: [
3045
1443
  "Current: ",
3046
1444
  item.quantity,
3047
1445
  " ",
3048
1446
  item.unit
3049
1447
  ] }),
3050
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "reorder-level", children: [
1448
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__reorder-level", children: [
3051
1449
  "Reorder at: ",
3052
1450
  item.reorderLevel
3053
1451
  ] }),
3054
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "reorder-qty", children: [
1452
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__reorder-qty", children: [
3055
1453
  "Order qty: ",
3056
1454
  item.reorderQuantity
3057
1455
  ] })
3058
1456
  ] }),
3059
- item.supplier && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "supplier-name", children: item.supplier.name }),
3060
- !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
1457
+ item.supplier && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-inventory-manager__supplier-name", children: item.supplier.name }),
1458
+ !readOnly && onCreatePurchaseOrder && /* @__PURE__ */ jsxRuntime.jsx(
3061
1459
  "button",
3062
1460
  {
3063
- className: "create-po-button",
3064
- onClick: () => console.log("Create PO for", item.id),
3065
- children: "Create PO"
1461
+ type: "button",
1462
+ className: "nice-inventory-manager__create-po-button",
1463
+ onClick: () => onCreatePurchaseOrder(item),
1464
+ children: t("inventoryManager.createPo", "Create PO")
3066
1465
  }
3067
1466
  )
3068
1467
  ] }, item.id)) }) })
3069
1468
  ] }),
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
- )
1469
+ showItemModal && editingItem && /* @__PURE__ */ jsxRuntime.jsx(
1470
+ "div",
1471
+ {
1472
+ className: "nice-inventory-manager__modal-overlay",
1473
+ onClick: () => setShowItemModal(false),
1474
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__item-modal", onClick: (e) => e.stopPropagation(), children: [
1475
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { children: editingItem.id ? "Edit Item" : "Add New Item" }),
1476
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__modal-form", children: [
1477
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__form-row", children: [
1478
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1479
+ "SKU",
1480
+ /* @__PURE__ */ jsxRuntime.jsx(
1481
+ "input",
1482
+ {
1483
+ type: "text",
1484
+ value: editingItem.sku || "",
1485
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, sku: e.target.value }))
1486
+ }
1487
+ )
1488
+ ] }),
1489
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1490
+ t("inventoryManager.name", "Name"),
1491
+ /* @__PURE__ */ jsxRuntime.jsx(
1492
+ "input",
1493
+ {
1494
+ type: "text",
1495
+ value: editingItem.name || "",
1496
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, name: e.target.value }))
1497
+ }
1498
+ )
1499
+ ] })
1500
+ ] }),
1501
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1502
+ t("inventoryManager.description", "Description"),
1503
+ /* @__PURE__ */ jsxRuntime.jsx(
1504
+ "textarea",
1505
+ {
1506
+ value: editingItem.description || "",
1507
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, description: e.target.value }))
1508
+ }
1509
+ )
1510
+ ] }),
1511
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__form-row", children: [
1512
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1513
+ t("inventoryManager.category", "Category"),
1514
+ /* @__PURE__ */ jsxRuntime.jsx(
1515
+ "input",
1516
+ {
1517
+ type: "text",
1518
+ value: editingItem.category || "",
1519
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, category: e.target.value })),
1520
+ list: "categories"
1521
+ }
1522
+ ),
1523
+ /* @__PURE__ */ jsxRuntime.jsx("datalist", { id: "categories", children: categories.map((c2) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: c2 }, c2)) })
1524
+ ] }),
1525
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1526
+ t("inventoryManager.unit", "Unit"),
1527
+ /* @__PURE__ */ jsxRuntime.jsx(
1528
+ "input",
1529
+ {
1530
+ type: "text",
1531
+ value: editingItem.unit || "",
1532
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, unit: e.target.value }))
1533
+ }
1534
+ )
1535
+ ] })
1536
+ ] }),
1537
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__form-row", children: [
1538
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1539
+ t("inventoryManager.quantity", "Quantity"),
1540
+ /* @__PURE__ */ jsxRuntime.jsx(
1541
+ "input",
1542
+ {
1543
+ type: "number",
1544
+ value: editingItem.quantity || 0,
1545
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, quantity: parseInt(e.target.value) }))
1546
+ }
1547
+ )
1548
+ ] }),
1549
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1550
+ t("inventoryManager.reorderLevel", "Reorder Level"),
1551
+ /* @__PURE__ */ jsxRuntime.jsx(
1552
+ "input",
1553
+ {
1554
+ type: "number",
1555
+ value: editingItem.reorderLevel || 0,
1556
+ onChange: (e) => setEditingItem((prev) => ({
1557
+ ...prev,
1558
+ reorderLevel: parseInt(e.target.value)
1559
+ }))
1560
+ }
1561
+ )
1562
+ ] }),
1563
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1564
+ t("inventoryManager.reorderQty", "Reorder Qty"),
1565
+ /* @__PURE__ */ jsxRuntime.jsx(
1566
+ "input",
1567
+ {
1568
+ type: "number",
1569
+ value: editingItem.reorderQuantity || 0,
1570
+ onChange: (e) => setEditingItem((prev) => ({
1571
+ ...prev,
1572
+ reorderQuantity: parseInt(e.target.value)
1573
+ }))
1574
+ }
1575
+ )
1576
+ ] })
1577
+ ] }),
1578
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1579
+ t("inventoryManager.unitCost", "Unit Cost"),
1580
+ /* @__PURE__ */ jsxRuntime.jsx(
1581
+ "input",
1582
+ {
1583
+ type: "number",
1584
+ step: "0.01",
1585
+ value: ((_b = editingItem.cost) == null ? void 0 : _b.amount) || 0,
1586
+ onChange: (e) => setEditingItem((prev) => ({
1587
+ ...prev,
1588
+ cost: {
1589
+ ...prev.cost,
1590
+ amount: parseFloat(e.target.value)
1591
+ }
1592
+ }))
1593
+ }
1594
+ )
1595
+ ] })
3084
1596
  ] }),
3085
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3086
- "Name",
1597
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__modal-actions", children: [
3087
1598
  /* @__PURE__ */ jsxRuntime.jsx(
3088
- "input",
1599
+ "button",
3089
1600
  {
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"
1601
+ className: "nice-inventory-manager__cancel-button",
1602
+ onClick: () => setShowItemModal(false),
1603
+ children: t("inventoryManager.cancel", "Cancel")
3117
1604
  }
3118
1605
  ),
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
- )
1606
+ /* @__PURE__ */ jsxRuntime.jsx("button", { className: "nice-inventory-manager__save-button", onClick: handleItemSubmit, children: editingItem.id ? "Save Changes" : "Create Item" })
3131
1607
  ] })
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)
3187
- }
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
- )
3274
1608
  ] })
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
- ] }) })
1609
+ }
1610
+ ),
1611
+ showTransactionModal && /* @__PURE__ */ jsxRuntime.jsx(
1612
+ "div",
1613
+ {
1614
+ className: "nice-inventory-manager__modal-overlay",
1615
+ onClick: () => setShowTransactionModal(false),
1616
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1617
+ "div",
1618
+ {
1619
+ className: "nice-inventory-manager__transaction-modal",
1620
+ onClick: (e) => e.stopPropagation(),
1621
+ children: [
1622
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { children: t("inventoryManager.createTransaction", "Create Transaction") }),
1623
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__modal-form", children: [
1624
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1625
+ t("inventoryManager.item", "Item"),
1626
+ /* @__PURE__ */ jsxRuntime.jsxs(
1627
+ "select",
1628
+ {
1629
+ value: newTransaction.itemId || "",
1630
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, itemId: e.target.value })),
1631
+ children: [
1632
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("inventoryManager.selectItem", "Select item...") }),
1633
+ items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: item.id, children: [
1634
+ item.sku,
1635
+ " - ",
1636
+ item.name
1637
+ ] }, item.id))
1638
+ ]
1639
+ }
1640
+ )
1641
+ ] }),
1642
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1643
+ t("inventoryManager.type", "Type"),
1644
+ /* @__PURE__ */ jsxRuntime.jsxs(
1645
+ "select",
1646
+ {
1647
+ value: newTransaction.type || "",
1648
+ onChange: (e) => setNewTransaction((prev) => ({
1649
+ ...prev,
1650
+ type: e.target.value
1651
+ })),
1652
+ children: [
1653
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("inventoryManager.selectType", "Select type...") }),
1654
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "receipt", children: t("inventoryManager.receipt", "Receipt") }),
1655
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "issue", children: t("inventoryManager.issue", "Issue") }),
1656
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "transfer", children: t("inventoryManager.transfer", "Transfer") }),
1657
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "adjustment", children: t("inventoryManager.adjustment", "Adjustment") }),
1658
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "return", children: t("inventoryManager.return", "Return") }),
1659
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "write-off", children: t("inventoryManager.writeOff", "Write-off") })
1660
+ ]
1661
+ }
1662
+ )
1663
+ ] }),
1664
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1665
+ t("inventoryManager.quantity", "Quantity"),
1666
+ /* @__PURE__ */ jsxRuntime.jsx(
1667
+ "input",
1668
+ {
1669
+ type: "number",
1670
+ min: "1",
1671
+ value: newTransaction.quantity || "",
1672
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, quantity: parseInt(e.target.value) }))
1673
+ }
1674
+ )
1675
+ ] }),
1676
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1677
+ t("inventoryManager.reference", "Reference"),
1678
+ /* @__PURE__ */ jsxRuntime.jsx(
1679
+ "input",
1680
+ {
1681
+ type: "text",
1682
+ value: newTransaction.reference || "",
1683
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, reference: e.target.value })),
1684
+ placeholder: t("inventoryManager.poNumberInvoiceEtc", "PO number, invoice, etc.")
1685
+ }
1686
+ )
1687
+ ] }),
1688
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1689
+ t("inventoryManager.notes", "Notes"),
1690
+ /* @__PURE__ */ jsxRuntime.jsx(
1691
+ "textarea",
1692
+ {
1693
+ value: newTransaction.notes || "",
1694
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, notes: e.target.value }))
1695
+ }
1696
+ )
1697
+ ] })
1698
+ ] }),
1699
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__modal-actions", children: [
1700
+ /* @__PURE__ */ jsxRuntime.jsx(
1701
+ "button",
1702
+ {
1703
+ className: "nice-inventory-manager__cancel-button",
1704
+ onClick: () => setShowTransactionModal(false),
1705
+ children: t("inventoryManager.cancel", "Cancel")
1706
+ }
1707
+ ),
1708
+ /* @__PURE__ */ jsxRuntime.jsx(
1709
+ "button",
1710
+ {
1711
+ className: "nice-inventory-manager__save-button",
1712
+ onClick: handleTransactionSubmit,
1713
+ children: t("inventoryManager.createTransaction", "Create Transaction")
1714
+ }
1715
+ )
1716
+ ] })
1717
+ ]
1718
+ }
1719
+ )
1720
+ }
1721
+ )
3281
1722
  ] });
3282
1723
  };
3283
1724
  const STATUS_COLOR = {
@@ -3308,7 +1749,7 @@ function fmtDate$1(d, locale) {
3308
1749
  const dt = d instanceof Date ? d : new Date(d);
3309
1750
  return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
3310
1751
  }
3311
- const NiceInvoiceView = be.forwardRef(
1752
+ const NiceInvoiceView = /* @__PURE__ */ ve.forwardRef(
3312
1753
  function NiceInvoiceView2({
3313
1754
  invoice,
3314
1755
  locale,
@@ -3322,8 +1763,9 @@ const NiceInvoiceView = be.forwardRef(
3322
1763
  style,
3323
1764
  id
3324
1765
  }, ref) {
3325
- var _a2;
3326
- const cur = currency ?? invoice.currency ?? ((_a2 = invoice.lines[0]) == null ? void 0 : _a2.unitPrice.currency) ?? "EUR";
1766
+ var _a;
1767
+ const { t } = v();
1768
+ const cur = currency ?? invoice.currency ?? ((_a = invoice.lines[0]) == null ? void 0 : _a.unitPrice.currency) ?? "EUR";
3327
1769
  const L = {
3328
1770
  invoiceNumber: "Invoice",
3329
1771
  issueDate: "Issue date",
@@ -3345,18 +1787,18 @@ const NiceInvoiceView = be.forwardRef(
3345
1787
  vatId: "VAT ID",
3346
1788
  ...labels
3347
1789
  };
3348
- const totals = be.useMemo(() => {
1790
+ const totals = ve.useMemo(() => {
3349
1791
  let net = 0;
3350
1792
  let vat = 0;
3351
1793
  const byRate = /* @__PURE__ */ new Map();
3352
1794
  for (const ln of invoice.lines) {
3353
1795
  const n = lineNet(ln);
3354
- const v = lineVat(ln);
1796
+ const v2 = lineVat(ln);
3355
1797
  net += n;
3356
- vat += v;
1798
+ vat += v2;
3357
1799
  const cell = byRate.get(ln.vatRate) ?? { net: 0, vat: 0 };
3358
1800
  cell.net += n;
3359
- cell.vat += v;
1801
+ cell.vat += v2;
3360
1802
  byRate.set(ln.vatRate, cell);
3361
1803
  }
3362
1804
  return { net, vat, gross: net + vat, byRate };
@@ -3396,34 +1838,31 @@ const NiceInvoiceView = be.forwardRef(
3396
1838
  className: "nice-invoice-view__status",
3397
1839
  style: { color: STATUS_COLOR[invoice.status] },
3398
1840
  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
- ),
1841
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "nice-invoice-view__dot" }),
3412
1842
  " ",
3413
1843
  invoice.status
3414
1844
  ]
3415
1845
  }
3416
1846
  ),
3417
1847
  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: "↓" }),
1848
+ /* @__PURE__ */ jsxRuntime.jsx(
1849
+ "button",
1850
+ {
1851
+ type: "button",
1852
+ onClick: () => onAction == null ? void 0 : onAction("download"),
1853
+ "aria-label": t("invoiceView.download", "Download"),
1854
+ title: t("invoiceView.download", "Download"),
1855
+ children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "arrow-down", size: 12 })
1856
+ }
1857
+ ),
3419
1858
  /* @__PURE__ */ jsxRuntime.jsx(
3420
1859
  "button",
3421
1860
  {
3422
1861
  type: "button",
3423
1862
  onClick: () => onAction == null ? void 0 : onAction("print"),
3424
- "aria-label": "Print",
3425
- title: "Print",
3426
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "printer", size: 14 })
1863
+ "aria-label": t("invoiceView.print", "Print"),
1864
+ title: t("invoiceView.print", "Print"),
1865
+ children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "printer", size: 14 })
3427
1866
  }
3428
1867
  ),
3429
1868
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3431,9 +1870,9 @@ const NiceInvoiceView = be.forwardRef(
3431
1870
  {
3432
1871
  type: "button",
3433
1872
  onClick: () => onAction == null ? void 0 : onAction("send"),
3434
- "aria-label": "Send",
3435
- title: "Send",
3436
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "mail", size: 14 })
1873
+ "aria-label": t("invoiceView.send", "Send"),
1874
+ title: t("invoiceView.send", "Send"),
1875
+ children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "mail", size: 14 })
3437
1876
  }
3438
1877
  )
3439
1878
  ] })
@@ -3469,7 +1908,7 @@ const NiceInvoiceView = be.forwardRef(
3469
1908
  ] }) }),
3470
1909
  /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: invoice.lines.map((ln) => {
3471
1910
  const n = lineNet(ln);
3472
- const v = lineVat(ln);
1911
+ const v2 = lineVat(ln);
3473
1912
  return /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3474
1913
  /* @__PURE__ */ jsxRuntime.jsx("td", { children: ln.description }),
3475
1914
  /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "nice-num", children: [
@@ -3482,7 +1921,7 @@ const NiceInvoiceView = be.forwardRef(
3482
1921
  "%"
3483
1922
  ] }),
3484
1923
  /* @__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) })
1924
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(n + v2, cur, locale) })
3486
1925
  ] }, ln.id);
3487
1926
  }) })
3488
1927
  ] }),
@@ -3495,14 +1934,14 @@ const NiceInvoiceView = be.forwardRef(
3495
1934
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.vat }),
3496
1935
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.gross })
3497
1936
  ] }) }),
3498
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: [...totals.byRate.entries()].sort((a, b) => b[0] - a[0]).map(([rate, c]) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
1937
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: [...totals.byRate.entries()].sort((a2, b) => b[0] - a2[0]).map(([rate, c2]) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3499
1938
  /* @__PURE__ */ jsxRuntime.jsxs("td", { children: [
3500
1939
  (rate * 100).toFixed(0),
3501
1940
  "%"
3502
1941
  ] }),
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) })
1942
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(c2.net, cur, locale) }),
1943
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(c2.vat, cur, locale) }),
1944
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(c2.net + c2.vat, cur, locale) })
3506
1945
  ] }, rate)) })
3507
1946
  ] })
3508
1947
  ] }),
@@ -3522,7 +1961,7 @@ const NiceInvoiceView = be.forwardRef(
3522
1961
  ] }),
3523
1962
  !(hideSections == null ? void 0 : hideSections.timeline) && invoice.history && invoice.history.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "nice-invoice-view__timeline", children: [
3524
1963
  /* @__PURE__ */ jsxRuntime.jsx("h4", { children: L.timeline }),
3525
- /* @__PURE__ */ jsxRuntime.jsx("ol", { children: invoice.history.map((h, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
1964
+ /* @__PURE__ */ jsxRuntime.jsx("ol", { children: invoice.history.map((h, i2) => /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
3526
1965
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-invoice-view__t-date", children: fmtDate$1(h.at, locale) }),
3527
1966
  /* @__PURE__ */ jsxRuntime.jsx(
3528
1967
  "span",
@@ -3536,7 +1975,7 @@ const NiceInvoiceView = be.forwardRef(
3536
1975
  " — ",
3537
1976
  h.note
3538
1977
  ] })
3539
- ] }, i)) })
1978
+ ] }, i2)) })
3540
1979
  ] }),
3541
1980
  !(hideSections == null ? void 0 : hideSections.notes) && invoice.notes && /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "nice-invoice-view__notes", children: [
3542
1981
  /* @__PURE__ */ jsxRuntime.jsx("h4", { children: L.notes }),
@@ -3547,6 +1986,7 @@ const NiceInvoiceView = be.forwardRef(
3547
1986
  );
3548
1987
  }
3549
1988
  );
1989
+ const EMPTY_CELLS = [];
3550
1990
  function colorFor(occ, colors) {
3551
1991
  if (occ <= 0.01) {
3552
1992
  return colors.low;
@@ -3559,11 +1999,15 @@ function colorFor(occ, colors) {
3559
1999
  }
3560
2000
  return colors.high;
3561
2001
  }
3562
- const NiceWarehouseView = be.forwardRef(
2002
+ const NiceWarehouseView = /* @__PURE__ */ ve.forwardRef(
3563
2003
  function NiceWarehouseView2({
3564
2004
  warehouseName,
3565
- cells,
3566
- colors = { low: "#dcfce7", mid: "#fde68a", high: "#fecaca" },
2005
+ cells = EMPTY_CELLS,
2006
+ colors = {
2007
+ low: "var(--nice-success-bg, #dcfce7)",
2008
+ mid: "var(--nice-warning-bg, #fde68a)",
2009
+ high: "var(--nice-danger-bg, #fecaca)"
2010
+ },
3567
2011
  onCellClick,
3568
2012
  showLegend = true,
3569
2013
  cellSize = 48,
@@ -3572,36 +2016,44 @@ const NiceWarehouseView = be.forwardRef(
3572
2016
  style,
3573
2017
  id
3574
2018
  }, ref) {
3575
- const [hovered, setHovered] = be.useState(null);
3576
- const grid = be.useMemo(() => {
2019
+ const { t } = v();
2020
+ const [hovered, setHovered] = ve.useState(null);
2021
+ const grid = ve.useMemo(() => {
3577
2022
  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";
2023
+ for (const c2 of cells) {
2024
+ const rowKey = c2.row !== void 0 ? `r${c2.row}` : c2.location.rack ?? c2.location.aisle ?? "0";
3580
2025
  let arr = rows.get(rowKey);
3581
2026
  if (!arr) {
3582
2027
  arr = [];
3583
2028
  rows.set(rowKey, arr);
3584
2029
  }
3585
- arr.push(c);
2030
+ arr.push(c2);
3586
2031
  }
3587
2032
  return [...rows.entries()].map(([rowKey, arr]) => ({ rowKey, cells: arr }));
3588
2033
  }, [cells]);
3589
2034
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, id, className: `nice-warehouse-view ${className ?? ""}`, style, children: [
3590
2035
  /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "nice-warehouse-view__header", children: [
3591
2036
  /* @__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
- ] })
2037
+ showLegend && /* @__PURE__ */ jsxRuntime.jsxs(
2038
+ "div",
2039
+ {
2040
+ className: "nice-warehouse-view__legend",
2041
+ "aria-label": t("warehouseView.occupancyLegend", "Occupancy legend"),
2042
+ children: [
2043
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.low } }),
2044
+ " low",
2045
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.mid } }),
2046
+ " mid",
2047
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.high } }),
2048
+ " high"
2049
+ ]
2050
+ }
2051
+ )
3600
2052
  ] }),
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);
2053
+ /* @__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) => {
2054
+ const key = [c2.location.rack, c2.location.aisle, c2.location.shelf, c2.location.bin].filter(Boolean).join("-") || String(idx);
3603
2055
  const aisleBreak = aisleEvery > 0 && idx > 0 && idx % aisleEvery === 0;
3604
- return /* @__PURE__ */ jsxRuntime.jsxs(be.Fragment, { children: [
2056
+ return /* @__PURE__ */ jsxRuntime.jsxs(ve.Fragment, { children: [
3605
2057
  aisleBreak && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-warehouse-view__aisle", "aria-hidden": true }),
3606
2058
  /* @__PURE__ */ jsxRuntime.jsx(
3607
2059
  "button",
@@ -3612,13 +2064,13 @@ const NiceWarehouseView = be.forwardRef(
3612
2064
  style: {
3613
2065
  width: cellSize,
3614
2066
  height: cellSize,
3615
- background: colorFor(c.occupancy, colors)
2067
+ background: colorFor(c2.occupancy, colors)
3616
2068
  },
3617
- title: `${key} — ${(c.occupancy * 100).toFixed(0)}% (${c.items.length} items)`,
3618
- onClick: () => onCellClick == null ? void 0 : onCellClick(c),
3619
- onMouseEnter: () => setHovered(c),
2069
+ title: `${key} — ${(c2.occupancy * 100).toFixed(0)}% (${c2.items.length} items)`,
2070
+ onClick: () => onCellClick == null ? void 0 : onCellClick(c2),
2071
+ onMouseEnter: () => setHovered(c2),
3620
2072
  onMouseLeave: () => setHovered(null),
3621
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-warehouse-view__bin", children: c.location.bin ?? c.location.shelf ?? "" })
2073
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-warehouse-view__bin", children: c2.location.bin ?? c2.location.shelf ?? "" })
3622
2074
  }
3623
2075
  )
3624
2076
  ] }, key);
@@ -3652,14 +2104,15 @@ const NiceWarehouseView = be.forwardRef(
3652
2104
  ] });
3653
2105
  }
3654
2106
  );
2107
+ const EMPTY_ORDERS = [];
3655
2108
  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"
2109
+ draft: "var(--nice-text-muted, #6b7280)",
2110
+ "pending-approval": "var(--nice-color-warning, #ca8a04)",
2111
+ approved: "var(--nice-color-primary, #2563eb)",
2112
+ ordered: "var(--nice-color-info, #0891b2)",
2113
+ "partially-received": "var(--nice-color-accent, #9333ea)",
2114
+ received: "var(--nice-color-success, #16a34a)",
2115
+ cancelled: "var(--nice-color-error, #dc2626)"
3663
2116
  };
3664
2117
  function fmtMoney(amount, currency, locale) {
3665
2118
  const code = typeof currency === "string" ? currency : currency.code;
@@ -3675,168 +2128,156 @@ function fmtDate(d, locale) {
3675
2128
  const dt = d instanceof Date ? d : new Date(d);
3676
2129
  return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
3677
2130
  }
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",
2131
+ const NicePurchaseOrder = /* @__PURE__ */ ve.forwardRef(function NicePurchaseOrder2({
2132
+ orders = EMPTY_ORDERS,
2133
+ selectable = true,
2134
+ initialSelectedId,
2135
+ locale,
2136
+ labels,
2137
+ readOnly,
2138
+ onOrderApprove,
2139
+ onReceiveItems,
2140
+ onOrderUpdate,
2141
+ className,
2142
+ style,
2143
+ id
2144
+ }, ref) {
2145
+ var _a;
2146
+ const { t } = v();
2147
+ const [selectedId, setSelectedId] = ve.useState(
2148
+ initialSelectedId ?? ((_a = orders[0]) == null ? void 0 : _a.id)
2149
+ );
2150
+ const L = {
2151
+ orderNumber: "PO #",
2152
+ supplier: "Supplier",
2153
+ status: "Status",
2154
+ orderDate: "Ordered",
2155
+ expected: "Expected",
2156
+ total: "Total",
2157
+ sku: "SKU",
2158
+ name: "Item",
2159
+ qty: "Qty",
2160
+ received: "Recv",
2161
+ unitPrice: "Unit",
2162
+ lineTotal: "Subtotal",
2163
+ notes: "Notes",
2164
+ approve: "Approve",
2165
+ receive: "Receive all",
2166
+ ...labels
2167
+ };
2168
+ const selected = ve.useMemo(
2169
+ () => orders.find((o) => o.id === selectedId),
2170
+ [orders, selectedId]
2171
+ );
2172
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, id, className: `nice-purchase-order ${className ?? ""}`, style, children: [
2173
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "nice-purchase-order__list", children: [
2174
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2175
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.orderNumber }),
2176
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.supplier }),
2177
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.status }),
2178
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.orderDate }),
2179
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.expected }),
2180
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.total })
2181
+ ] }) }),
2182
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: orders.map((o) => /* @__PURE__ */ jsxRuntime.jsxs(
2183
+ "tr",
3765
2184
  {
3766
- className: "nice-purchase-order__detail",
3767
- "aria-label": `${L.orderNumber} ${selected.orderNumber}`,
2185
+ "aria-selected": o.id === selectedId,
2186
+ className: o.id === selectedId ? "is-selected" : void 0,
2187
+ onClick: () => selectable && setSelectedId(o.id),
3768
2188
  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
- ] }),
2189
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: o.orderNumber }),
2190
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: o.supplier.name }),
2191
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { color: STATUS_TINT[o.status] }, children: [
2192
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "nice-purchase-order__dot" }),
3828
2193
  " ",
3829
- selected.notes
3830
- ] })
2194
+ o.status
2195
+ ] }) }),
2196
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: fmtDate(o.orderDate, locale) }),
2197
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: fmtDate(o.expectedDelivery, locale) }),
2198
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(o.total.amount, o.total.currency, locale) })
3831
2199
  ]
3832
- }
3833
- )
3834
- ] });
3835
- }
3836
- );
3837
- const NiceHRDashboard = be.forwardRef(
2200
+ },
2201
+ o.id
2202
+ )) })
2203
+ ] }),
2204
+ selectable && selected && /* @__PURE__ */ jsxRuntime.jsxs(
2205
+ "section",
2206
+ {
2207
+ className: "nice-purchase-order__detail",
2208
+ "aria-label": `${L.orderNumber} ${selected.orderNumber}`,
2209
+ children: [
2210
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { children: [
2211
+ /* @__PURE__ */ jsxRuntime.jsxs("h3", { children: [
2212
+ selected.orderNumber,
2213
+ " — ",
2214
+ selected.supplier.name
2215
+ ] }),
2216
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-purchase-order__actions", children: [
2217
+ selected.status === "pending-approval" && onOrderApprove && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => onOrderApprove(selected.id), children: L.approve }),
2218
+ (selected.status === "ordered" || selected.status === "partially-received") && onReceiveItems && /* @__PURE__ */ jsxRuntime.jsx(
2219
+ "button",
2220
+ {
2221
+ type: "button",
2222
+ onClick: () => onReceiveItems(
2223
+ selected.id,
2224
+ selected.items.map((it) => ({
2225
+ itemId: it.itemId,
2226
+ quantity: it.quantity - (it.receivedQuantity ?? 0)
2227
+ }))
2228
+ ),
2229
+ children: L.receive
2230
+ }
2231
+ ),
2232
+ onOrderUpdate && selected.status === "draft" && /* @__PURE__ */ jsxRuntime.jsx(
2233
+ "button",
2234
+ {
2235
+ type: "button",
2236
+ onClick: () => onOrderUpdate({ ...selected, status: "pending-approval" }),
2237
+ children: t("purchaseOrder.submit", "Submit")
2238
+ }
2239
+ )
2240
+ ] })
2241
+ ] }),
2242
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "nice-purchase-order__items", children: [
2243
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2244
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.sku }),
2245
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.name }),
2246
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.qty }),
2247
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.received }),
2248
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.unitPrice }),
2249
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.lineTotal })
2250
+ ] }) }),
2251
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: selected.items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2252
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: it.sku }),
2253
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: it.itemName }),
2254
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: it.quantity }),
2255
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: it.receivedQuantity ?? 0 }),
2256
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(it.unitPrice.amount, it.unitPrice.currency, locale) }),
2257
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(it.lineTotal.amount, it.lineTotal.currency, locale) })
2258
+ ] }, it.itemId)) }),
2259
+ /* @__PURE__ */ jsxRuntime.jsx("tfoot", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2260
+ /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "nice-num", children: L.total }),
2261
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: fmtMoney(selected.total.amount, selected.total.currency, locale) }) })
2262
+ ] }) })
2263
+ ] }),
2264
+ selected.notes && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "nice-purchase-order__notes", children: [
2265
+ /* @__PURE__ */ jsxRuntime.jsxs("strong", { children: [
2266
+ L.notes,
2267
+ ":"
2268
+ ] }),
2269
+ " ",
2270
+ selected.notes
2271
+ ] })
2272
+ ]
2273
+ }
2274
+ )
2275
+ ] });
2276
+ });
2277
+ const EMPTY_EMPLOYEES = [];
2278
+ const NiceHRDashboard = /* @__PURE__ */ ve.forwardRef(
3838
2279
  function NiceHRDashboard2({
3839
- employees,
2280
+ employees = EMPTY_EMPLOYEES,
3840
2281
  labels,
3841
2282
  hideWidgets,
3842
2283
  locale,
@@ -3846,6 +2287,7 @@ const NiceHRDashboard = be.forwardRef(
3846
2287
  style,
3847
2288
  id
3848
2289
  }, ref) {
2290
+ const { t } = v();
3849
2291
  const L = {
3850
2292
  headcount: "Headcount",
3851
2293
  fte: "FTE",
@@ -3855,7 +2297,7 @@ const NiceHRDashboard = be.forwardRef(
3855
2297
  activeEmployees: "Active",
3856
2298
  ...labels
3857
2299
  };
3858
- const stats = be.useMemo(() => {
2300
+ const stats = ve.useMemo(() => {
3859
2301
  const active = employees.filter((e) => e.active !== false);
3860
2302
  const fte = active.reduce((s, e) => s + (e.fte ?? 1), 0);
3861
2303
  const vacationAvg = active.length === 0 ? 0 : active.reduce((s, e) => s + (e.vacationBalanceDays ?? 0), 0) / active.length;
@@ -3896,7 +2338,7 @@ const NiceHRDashboard = be.forwardRef(
3896
2338
  className: `nice-hr-dashboard nice-hr-dashboard--${density} ${className ?? ""}`,
3897
2339
  style,
3898
2340
  role: "group",
3899
- "aria-label": "HR dashboard",
2341
+ "aria-label": t("hrDashboard.hrDashboard", "HR dashboard"),
3900
2342
  children: [
3901
2343
  !(hideWidgets == null ? void 0 : hideWidgets.headcount) && /* @__PURE__ */ jsxRuntime.jsx(
3902
2344
  Widget,
@@ -3968,11 +2410,11 @@ const DEFAULT_SEED = {
3968
2410
  };
3969
2411
  function useMockErpApi(options = {}) {
3970
2412
  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 () => {
2413
+ const [loading, setLoading] = ve.useState(true);
2414
+ const [error, setError] = ve.useState(null);
2415
+ const [data, setData] = ve.useState(() => ({ ...DEFAULT_SEED, ...seed }));
2416
+ const settledRef = ve.useRef(false);
2417
+ const refresh = ve.useCallback(async () => {
3976
2418
  setLoading(true);
3977
2419
  setError(null);
3978
2420
  await wait(latencyMs);
@@ -3983,14 +2425,14 @@ function useMockErpApi(options = {}) {
3983
2425
  }
3984
2426
  setLoading(false);
3985
2427
  }, [latencyMs, errorRate]);
3986
- be.useEffect(() => {
2428
+ ve.useEffect(() => {
3987
2429
  if (settledRef.current) {
3988
2430
  return;
3989
2431
  }
3990
2432
  settledRef.current = true;
3991
2433
  void refresh();
3992
2434
  }, [refresh]);
3993
- const writeWith = be.useCallback(
2435
+ const writeWith = ve.useCallback(
3994
2436
  async (key, item) => {
3995
2437
  await wait(latencyMs);
3996
2438
  if (Math.random() < errorRate) {
@@ -3998,7 +2440,7 @@ function useMockErpApi(options = {}) {
3998
2440
  }
3999
2441
  setData((d) => {
4000
2442
  const arr = [...d[key]];
4001
- const idx = arr.findIndex((i) => i.id === item.id);
2443
+ const idx = arr.findIndex((i2) => i2.id === item.id);
4002
2444
  if (idx >= 0) {
4003
2445
  arr[idx] = item;
4004
2446
  } else {
@@ -4009,7 +2451,7 @@ function useMockErpApi(options = {}) {
4009
2451
  },
4010
2452
  [latencyMs, errorRate]
4011
2453
  );
4012
- return be.useMemo(
2454
+ return ve.useMemo(
4013
2455
  () => ({
4014
2456
  loading,
4015
2457
  error,
@@ -4021,118 +2463,127 @@ function useMockErpApi(options = {}) {
4021
2463
  resources: data.resources,
4022
2464
  vatRates: data.vatRates,
4023
2465
  refresh,
4024
- upsertInvoice: (i) => writeWith("invoices", i),
2466
+ upsertInvoice: (i2) => writeWith("invoices", i2),
4025
2467
  upsertPurchaseOrder: (p) => writeWith("purchaseOrders", p),
4026
- upsertInventory: (i) => writeWith("inventory", i)
2468
+ upsertInventory: (i2) => writeWith("inventory", i2)
4027
2469
  }),
4028
2470
  [loading, error, data, refresh, writeWith]
4029
2471
  );
4030
2472
  }
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;
2473
+ const NiceVatTable = /* @__PURE__ */ ve.forwardRef(
2474
+ function NiceVatTable2({
2475
+ country = "PL",
2476
+ rates,
2477
+ editable = false,
2478
+ onChange,
2479
+ onRemove,
2480
+ locale,
2481
+ labels,
2482
+ density = "comfortable",
2483
+ className,
2484
+ style,
2485
+ id
2486
+ }, ref) {
2487
+ const [internal, setInternal] = ve.useState(rates ?? NICE_VAT_PRESETS[country]);
2488
+ const L = {
2489
+ code: "Code",
2490
+ rate: "Rate",
2491
+ label: "Label",
2492
+ description: "Description",
2493
+ add: "+ Add",
2494
+ remove: "Remove",
2495
+ ...labels
2496
+ };
2497
+ const update = ve.useCallback(
2498
+ (next) => {
2499
+ setInternal(next);
2500
+ onChange == null ? void 0 : onChange(next);
2501
+ },
2502
+ [onChange]
2503
+ );
2504
+ const onCellEdit = (idx, key, raw) => {
2505
+ const next = [...internal];
2506
+ const r = { ...next[idx] };
2507
+ if (key === "rate") {
2508
+ const n = Number(raw.replace(",", "."));
2509
+ if (!Number.isFinite(n)) {
2510
+ return;
2511
+ }
2512
+ r.rate = n > 1 ? n / 100 : n;
2513
+ } else if (key === "code" || key === "label" || key === "description") {
2514
+ r[key] = raw;
4068
2515
  }
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
- });
2516
+ next[idx] = r;
2517
+ update(next);
2518
+ };
2519
+ const addRow = () => {
2520
+ update([...internal, { code: `NEW-${internal.length + 1}`, rate: 0, label: "0%" }]);
2521
+ };
2522
+ const removeRow = (idx) => {
2523
+ const code = internal[idx].code;
2524
+ const next = internal.filter((_, i2) => i2 !== idx);
2525
+ update(next);
2526
+ onRemove == null ? void 0 : onRemove(code);
2527
+ };
2528
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2529
+ "div",
2530
+ {
2531
+ ref,
2532
+ id,
2533
+ className: `nice-vat-table nice-vat-table--${density} ${className ?? ""}`,
2534
+ style,
2535
+ children: [
2536
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { children: [
2537
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2538
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.code }),
2539
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.rate }),
2540
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.label }),
2541
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.description }),
2542
+ editable && /* @__PURE__ */ jsxRuntime.jsx("th", { "aria-label": L.remove })
2543
+ ] }) }),
2544
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: internal.map((r, idx) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2545
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
2546
+ "input",
2547
+ {
2548
+ value: r.code,
2549
+ onChange: (e) => onCellEdit(idx, "code", e.target.value)
2550
+ }
2551
+ ) : r.code }),
2552
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
2553
+ "input",
2554
+ {
2555
+ type: "number",
2556
+ step: "0.01",
2557
+ min: 0,
2558
+ max: 1,
2559
+ value: r.rate,
2560
+ onChange: (e) => onCellEdit(idx, "rate", e.target.value)
2561
+ }
2562
+ ) : `${(r.rate * 100).toLocaleString(locale, { maximumFractionDigits: 2 })}%` }),
2563
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
2564
+ "input",
2565
+ {
2566
+ value: r.label ?? "",
2567
+ onChange: (e) => onCellEdit(idx, "label", e.target.value)
2568
+ }
2569
+ ) : r.label ?? "" }),
2570
+ /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
2571
+ "input",
2572
+ {
2573
+ value: r.description ?? "",
2574
+ onChange: (e) => onCellEdit(idx, "description", e.target.value)
2575
+ }
2576
+ ) : r.description ?? "" }),
2577
+ editable && /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => removeRow(idx), "aria-label": L.remove, children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "close", size: 14 }) }) })
2578
+ ] }, r.code)) })
2579
+ ] }),
2580
+ editable && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-vat-table__add", onClick: addRow, children: L.add })
2581
+ ]
2582
+ }
2583
+ );
2584
+ }
2585
+ );
2586
+ const EMPTY_INVOICES = [];
4136
2587
  function pad(n) {
4137
2588
  return n < 10 ? `0${n}` : String(n);
4138
2589
  }
@@ -4173,9 +2624,9 @@ function defaultBuildXml(opts) {
4173
2624
  let vat = 0;
4174
2625
  for (const ln of inv.lines) {
4175
2626
  const n = Math.round(ln.quantity * ln.unitPrice.amount * (1 - (ln.discount ?? 0)));
4176
- const v = Math.round(n * ln.vatRate);
2627
+ const v2 = Math.round(n * ln.vatRate);
4177
2628
  net += n;
4178
- vat += v;
2629
+ vat += v2;
4179
2630
  }
4180
2631
  lines.push(` <SumaNetto>${(net / 100).toFixed(2)}</SumaNetto>`);
4181
2632
  lines.push(` <SumaVAT>${(vat / 100).toFixed(2)}</SumaVAT>`);
@@ -4185,9 +2636,9 @@ function defaultBuildXml(opts) {
4185
2636
  lines.push("</JPK>");
4186
2637
  return lines.join("\n");
4187
2638
  }
4188
- const NiceJpkExporter = be.forwardRef(
2639
+ const NiceJpkExporter = /* @__PURE__ */ ve.forwardRef(
4189
2640
  function NiceJpkExporter2({
4190
- invoices,
2641
+ invoices = EMPTY_INVOICES,
4191
2642
  taxpayer,
4192
2643
  defaultFormat = "JPK_V7M",
4193
2644
  defaultPeriod,
@@ -4200,11 +2651,11 @@ const NiceJpkExporter = be.forwardRef(
4200
2651
  id
4201
2652
  }, ref) {
4202
2653
  const today = /* @__PURE__ */ new Date();
4203
- const [format, setFormat] = be.useState(defaultFormat);
4204
- const [from, setFrom] = be.useState(
2654
+ const [format, setFormat] = ve.useState(defaultFormat);
2655
+ const [from, setFrom] = ve.useState(
4205
2656
  isoDate((defaultPeriod == null ? void 0 : defaultPeriod.from) ?? new Date(today.getFullYear(), today.getMonth(), 1))
4206
2657
  );
4207
- const [to, setTo] = be.useState(
2658
+ const [to, setTo] = ve.useState(
4208
2659
  isoDate((defaultPeriod == null ? void 0 : defaultPeriod.to) ?? new Date(today.getFullYear(), today.getMonth() + 1, 0))
4209
2660
  );
4210
2661
  const L = {
@@ -4214,7 +2665,7 @@ const NiceJpkExporter = be.forwardRef(
4214
2665
  export: "Export",
4215
2666
  ...labels
4216
2667
  };
4217
- const exportNow = be.useCallback(() => {
2668
+ const exportNow = ve.useCallback(() => {
4218
2669
  const opts = {
4219
2670
  format,
4220
2671
  period: { from: new Date(from), to: new Date(to) },
@@ -4227,12 +2678,12 @@ const NiceJpkExporter = be.forwardRef(
4227
2678
  onExport == null ? void 0 : onExport(xml, blob, opts);
4228
2679
  if (typeof window !== "undefined" && typeof URL.createObjectURL === "function") {
4229
2680
  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();
2681
+ const a2 = document.createElement("a");
2682
+ a2.href = url;
2683
+ a2.download = filename;
2684
+ document.body.appendChild(a2);
2685
+ a2.click();
2686
+ a2.remove();
4236
2687
  URL.revokeObjectURL(url);
4237
2688
  }
4238
2689
  }, [format, from, to, taxpayer, invoices, buildXml, onExport, filenameFor]);