@nice2dev/ui-erp 1.1.10 → 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,1722 +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
- { primary: "#e5e7eb", secondary: "#9ca3af", muted: "#4b5563" },
781
- "#374151"
782
- );
783
- j(
784
- "Nebula",
785
- {
786
- primary: "#e879f9",
787
- primaryHover: "#d946ef",
788
- success: "#4ade80",
789
- warning: "#fbbf24",
790
- error: "#fb7185",
791
- info: "#67e8f9"
792
- },
793
- { primary: "#0d0117", secondary: "#1a0533", tertiary: "#2d0a52", hover: "#2d0a52" },
794
- { primary: "#fae8ff", secondary: "#d8b4fe", muted: "#7c3aed" },
795
- "#581c87"
796
- );
797
- j(
798
- "Abyss",
799
- {
800
- primary: "#22d3ee",
801
- primaryHover: "#06b6d4",
802
- success: "#34d399",
803
- warning: "#fbbf24",
804
- error: "#f87171",
805
- info: "#38bdf8"
806
- },
807
- { primary: "#001219", secondary: "#002a3a", tertiary: "#003e54", hover: "#003e54" },
808
- { primary: "#e0f2fe", secondary: "#7dd3fc", muted: "#0369a1" },
809
- "#075985"
810
- );
811
- j(
812
- "Shadow",
813
- {
814
- primary: "#a3a3a3",
815
- primaryHover: "#737373",
816
- success: "#4ade80",
817
- warning: "#facc15",
818
- error: "#f87171",
819
- info: "#38bdf8"
820
- },
821
- { primary: "#171717", secondary: "#1f1f1f", tertiary: "#2a2a2a", hover: "#2a2a2a" },
822
- { primary: "#e5e5e5", secondary: "#a3a3a3", muted: "#525252" },
823
- "#404040"
824
- );
825
- j(
826
- "Emerald Dark",
827
- {
828
- primary: "#34d399",
829
- primaryHover: "#10b981",
830
- success: "#4ade80",
831
- warning: "#fbbf24",
832
- error: "#f87171",
833
- info: "#22d3ee"
834
- },
835
- { primary: "#022c22", secondary: "#064e3b", tertiary: "#065f46", hover: "#065f46" },
836
- { primary: "#ecfdf5", secondary: "#6ee7b7", muted: "#047857" },
837
- "#047857"
838
- );
839
- $(
840
- "Forest",
841
- {
842
- primary: "#166534",
843
- primaryHover: "#14532d",
844
- success: "#22c55e",
845
- warning: "#ca8a04",
846
- error: "#dc2626",
847
- info: "#0891b2"
848
- },
849
- { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
850
- { primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
851
- "#86efac"
852
- );
853
- $(
854
- "Ocean",
855
- {
856
- primary: "#0369a1",
857
- primaryHover: "#075985",
858
- success: "#059669",
859
- warning: "#d97706",
860
- error: "#dc2626",
861
- info: "#0284c7"
862
- },
863
- { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
864
- { primary: "#0c4a6e", secondary: "#0369a1", muted: "#38bdf8" },
865
- "#7dd3fc"
866
- );
867
- $(
868
- "Desert",
869
- {
870
- primary: "#b45309",
871
- primaryHover: "#92400e",
872
- success: "#4d7c0f",
873
- warning: "#a16207",
874
- error: "#b91c1c",
875
- info: "#0e7490"
876
- },
877
- { primary: "#fefce8", secondary: "#fef9c3", tertiary: "#fef08a", hover: "#fef9c3" },
878
- { primary: "#422006", secondary: "#713f12", muted: "#ca8a04" },
879
- "#fde047"
880
- );
881
- $(
882
- "Sunset",
883
- {
884
- primary: "#ea580c",
885
- primaryHover: "#c2410c",
886
- success: "#16a34a",
887
- warning: "#d97706",
888
- error: "#dc2626",
889
- info: "#0891b2"
890
- },
891
- { primary: "#fff7ed", secondary: "#ffedd5", tertiary: "#fed7aa", hover: "#ffedd5" },
892
- { primary: "#431407", secondary: "#9a3412", muted: "#f97316" },
893
- "#fdba74"
894
- );
895
- $(
896
- "Aurora",
897
- {
898
- primary: "#0d9488",
899
- primaryHover: "#0f766e",
900
- success: "#22c55e",
901
- warning: "#eab308",
902
- error: "#ef4444",
903
- info: "#06b6d4"
904
- },
905
- { primary: "#f0fdfa", secondary: "#ccfbf1", tertiary: "#99f6e4", hover: "#ccfbf1" },
906
- { primary: "#134e4a", secondary: "#115e59", muted: "#2dd4bf" },
907
- "#5eead4"
908
- );
909
- $(
910
- "Lavender",
911
- {
912
- primary: "#7e22ce",
913
- primaryHover: "#6b21a8",
914
- success: "#16a34a",
915
- warning: "#d97706",
916
- error: "#dc2626",
917
- info: "#0891b2"
918
- },
919
- { primary: "#faf5ff", secondary: "#f3e8ff", tertiary: "#e9d5ff", hover: "#f3e8ff" },
920
- { primary: "#3b0764", secondary: "#581c87", muted: "#a855f7" },
921
- "#d8b4fe"
922
- );
923
- $(
924
- "Autumn",
925
- {
926
- primary: "#c2410c",
927
- primaryHover: "#9a3412",
928
- success: "#4d7c0f",
929
- warning: "#a16207",
930
- error: "#b91c1c",
931
- info: "#0e7490"
932
- },
933
- { primary: "#fef2f2", secondary: "#fee2e2", tertiary: "#fecaca", hover: "#fee2e2" },
934
- { primary: "#450a0a", secondary: "#7f1d1d", muted: "#f87171" },
935
- "#fca5a5"
936
- );
937
- $(
938
- "Spring",
939
- {
940
- primary: "#16a34a",
941
- primaryHover: "#15803d",
942
- success: "#22c55e",
943
- warning: "#eab308",
944
- error: "#ef4444",
945
- info: "#06b6d4"
946
- },
947
- { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
948
- { primary: "#14532d", secondary: "#166534", muted: "#4ade80" },
949
- "#86efac"
950
- );
951
- $(
952
- "Arctic",
953
- {
954
- primary: "#0ea5e9",
955
- primaryHover: "#0284c7",
956
- success: "#10b981",
957
- warning: "#f59e0b",
958
- error: "#ef4444",
959
- info: "#06b6d4"
960
- },
961
- { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
962
- { primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
963
- "#bae6fd"
964
- );
965
- $(
966
- "Tropical",
967
- {
968
- primary: "#0d9488",
969
- primaryHover: "#0f766e",
970
- success: "#16a34a",
971
- warning: "#f59e0b",
972
- error: "#ef4444",
973
- info: "#06b6d4"
974
- },
975
- { primary: "#ecfdf5", secondary: "#d1fae5", tertiary: "#a7f3d0", hover: "#d1fae5" },
976
- { primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
977
- "#a7f3d0"
978
- );
979
- $(
980
- "Pastel Rose",
981
- {
982
- primary: "#f472b6",
983
- primaryHover: "#ec4899",
984
- success: "#4ade80",
985
- warning: "#fcd34d",
986
- error: "#fb7185",
987
- info: "#67e8f9"
988
- },
989
- { primary: "#fdf2f8", secondary: "#fce7f3", tertiary: "#fbcfe8", hover: "#fce7f3" },
990
- { primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
991
- "#f9a8d4"
992
- );
993
- $(
994
- "Pastel Sky",
995
- {
996
- primary: "#38bdf8",
997
- primaryHover: "#0ea5e9",
998
- success: "#4ade80",
999
- warning: "#fcd34d",
1000
- error: "#fb7185",
1001
- info: "#67e8f9"
1002
- },
1003
- { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
1004
- { primary: "#075985", secondary: "#0369a1", muted: "#7dd3fc" },
1005
- "#bae6fd"
1006
- );
1007
- $(
1008
- "Pastel Mint",
1009
- {
1010
- primary: "#34d399",
1011
- primaryHover: "#10b981",
1012
- success: "#4ade80",
1013
- warning: "#fcd34d",
1014
- error: "#fb7185",
1015
- info: "#67e8f9"
1016
- },
1017
- { primary: "#ecfdf5", secondary: "#d1fae5", tertiary: "#a7f3d0", hover: "#d1fae5" },
1018
- { primary: "#065f46", secondary: "#047857", muted: "#6ee7b7" },
1019
- "#a7f3d0"
1020
- );
1021
- $(
1022
- "Pastel Peach",
1023
- {
1024
- primary: "#fb923c",
1025
- primaryHover: "#f97316",
1026
- success: "#4ade80",
1027
- warning: "#fcd34d",
1028
- error: "#fb7185",
1029
- info: "#67e8f9"
1030
- },
1031
- { primary: "#fff7ed", secondary: "#ffedd5", tertiary: "#fed7aa", hover: "#ffedd5" },
1032
- { primary: "#7c2d12", secondary: "#9a3412", muted: "#fdba74" },
1033
- "#fed7aa"
1034
- );
1035
- $(
1036
- "Pastel Lavender",
1037
- {
1038
- primary: "#a78bfa",
1039
- primaryHover: "#8b5cf6",
1040
- success: "#4ade80",
1041
- warning: "#fcd34d",
1042
- error: "#fb7185",
1043
- info: "#67e8f9"
1044
- },
1045
- { primary: "#f5f3ff", secondary: "#ede9fe", tertiary: "#ddd6fe", hover: "#ede9fe" },
1046
- { primary: "#4c1d95", secondary: "#5b21b6", muted: "#c4b5fd" },
1047
- "#ddd6fe"
1048
- );
1049
- $(
1050
- "Pastel Lemon",
1051
- {
1052
- primary: "#facc15",
1053
- primaryHover: "#eab308",
1054
- success: "#4ade80",
1055
- warning: "#fcd34d",
1056
- error: "#fb7185",
1057
- info: "#67e8f9"
1058
- },
1059
- { primary: "#fefce8", secondary: "#fef9c3", tertiary: "#fef08a", hover: "#fef9c3" },
1060
- { primary: "#713f12", secondary: "#854d0e", muted: "#fde047" },
1061
- "#fef08a"
1062
- );
1063
- $(
1064
- "Pastel Sage",
1065
- {
1066
- primary: "#86efac",
1067
- primaryHover: "#4ade80",
1068
- success: "#22c55e",
1069
- warning: "#fcd34d",
1070
- error: "#fb7185",
1071
- info: "#67e8f9"
1072
- },
1073
- { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
1074
- { primary: "#166534", secondary: "#15803d", muted: "#86efac" },
1075
- "#bbf7d0"
1076
- );
1077
- $(
1078
- "Pastel Coral",
1079
- {
1080
- primary: "#fb7185",
1081
- primaryHover: "#f43f5e",
1082
- success: "#4ade80",
1083
- warning: "#fcd34d",
1084
- error: "#ef4444",
1085
- info: "#67e8f9"
1086
- },
1087
- { primary: "#fff1f2", secondary: "#ffe4e6", tertiary: "#fecdd3", hover: "#ffe4e6" },
1088
- { primary: "#881337", secondary: "#9f1239", muted: "#fda4af" },
1089
- "#fecdd3"
1090
- );
1091
- $(
1092
- "Banking",
1093
- {
1094
- primary: "#1e3a5f",
1095
- primaryHover: "#152c4a",
1096
- success: "#059669",
1097
- warning: "#d97706",
1098
- error: "#dc2626",
1099
- info: "#0891b2"
1100
- },
1101
- { primary: "#f8fafc", secondary: "#f1f5f9", tertiary: "#e2e8f0", hover: "#e2e8f0" },
1102
- { primary: "#0f172a", secondary: "#334155", muted: "#94a3b8" },
1103
- "#cbd5e1"
1104
- );
1105
- $(
1106
- "Healthcare",
1107
- {
1108
- primary: "#0891b2",
1109
- primaryHover: "#0e7490",
1110
- success: "#059669",
1111
- warning: "#d97706",
1112
- error: "#dc2626",
1113
- info: "#0284c7"
1114
- },
1115
- { primary: "#f0fdfa", secondary: "#e0f7fa", tertiary: "#b2ebf2", hover: "#e0f7fa" },
1116
- { primary: "#134e4a", secondary: "#1a6b6a", muted: "#80cbc4" },
1117
- "#b2dfdb"
1118
- );
1119
- $(
1120
- "Legal",
1121
- {
1122
- primary: "#1e293b",
1123
- primaryHover: "#0f172a",
1124
- success: "#059669",
1125
- warning: "#d97706",
1126
- error: "#dc2626",
1127
- info: "#0284c7"
1128
- },
1129
- { primary: "#fafaf9", secondary: "#f5f5f4", tertiary: "#e7e5e4", hover: "#e7e5e4" },
1130
- { primary: "#0f172a", secondary: "#44403c", muted: "#a8a29e" },
1131
- "#d6d3d1"
1132
- );
1133
- $(
1134
- "Tech Startup",
1135
- {
1136
- primary: "#7c3aed",
1137
- primaryHover: "#6d28d9",
1138
- success: "#10b981",
1139
- warning: "#f59e0b",
1140
- error: "#ef4444",
1141
- info: "#06b6d4"
1142
- },
1143
- { primary: "#faf5ff", secondary: "#f3e8ff", tertiary: "#e9d5ff", hover: "#f3e8ff" },
1144
- { primary: "#1e1b4b", secondary: "#4c1d95", muted: "#a78bfa" },
1145
- "#c4b5fd"
1146
- );
1147
- $(
1148
- "Enterprise",
1149
- {
1150
- primary: "#1e40af",
1151
- primaryHover: "#1e3a8a",
1152
- success: "#059669",
1153
- warning: "#d97706",
1154
- error: "#dc2626",
1155
- info: "#0891b2"
1156
- },
1157
- { primary: "#eff6ff", secondary: "#dbeafe", tertiary: "#bfdbfe", hover: "#dbeafe" },
1158
- { primary: "#1e3a5f", secondary: "#1e40af", muted: "#60a5fa" },
1159
- "#93c5fd"
1160
- );
1161
- $(
1162
- "Government",
1163
- {
1164
- primary: "#1d4ed8",
1165
- primaryHover: "#1e40af",
1166
- success: "#059669",
1167
- warning: "#d97706",
1168
- error: "#dc2626",
1169
- info: "#0891b2"
1170
- },
1171
- { primary: "#f8fafc", secondary: "#f1f5f9", tertiary: "#e2e8f0", hover: "#e2e8f0" },
1172
- { primary: "#0f172a", secondary: "#1e293b", muted: "#64748b" },
1173
- "#cbd5e1"
1174
- );
1175
- $(
1176
- "Education",
1177
- {
1178
- primary: "#059669",
1179
- primaryHover: "#047857",
1180
- success: "#16a34a",
1181
- warning: "#f59e0b",
1182
- error: "#ef4444",
1183
- info: "#0891b2"
1184
- },
1185
- { primary: "#f0fdf9", secondary: "#d1fae5", tertiary: "#a7f3d0", hover: "#d1fae5" },
1186
- { primary: "#064e3b", secondary: "#065f46", muted: "#6ee7b7" },
1187
- "#a7f3d0"
1188
- );
1189
- $(
1190
- "Real Estate",
1191
- {
1192
- primary: "#92400e",
1193
- primaryHover: "#78350f",
1194
- success: "#059669",
1195
- warning: "#b45309",
1196
- error: "#dc2626",
1197
- info: "#0891b2"
1198
- },
1199
- { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1200
- { primary: "#422006", secondary: "#713f12", muted: "#d97706" },
1201
- "#fcd34d"
1202
- );
1203
- $(
1204
- "Nord",
1205
- {
1206
- primary: "#5e81ac",
1207
- primaryHover: "#4c6b90",
1208
- success: "#a3be8c",
1209
- warning: "#ebcb8b",
1210
- error: "#bf616a",
1211
- info: "#88c0d0"
1212
- },
1213
- { primary: "#eceff4", secondary: "#e5e9f0", tertiary: "#d8dee9", hover: "#d8dee9" },
1214
- { primary: "#2e3440", secondary: "#3b4252", muted: "#4c566a" },
1215
- "#d8dee9"
1216
- );
1217
- j(
1218
- "Dracula",
1219
- {
1220
- primary: "#bd93f9",
1221
- primaryHover: "#9d79d9",
1222
- success: "#50fa7b",
1223
- warning: "#f1fa8c",
1224
- error: "#ff5555",
1225
- info: "#8be9fd"
1226
- },
1227
- { primary: "#282a36", secondary: "#343746", tertiary: "#44475a", hover: "#44475a" },
1228
- { primary: "#f8f8f2", secondary: "#c0c0c0", muted: "#6272a4" },
1229
- "#44475a"
1230
- );
1231
- $(
1232
- "Solarized Light",
1233
- {
1234
- primary: "#268bd2",
1235
- primaryHover: "#1a6da0",
1236
- success: "#859900",
1237
- warning: "#b58900",
1238
- error: "#dc322f",
1239
- info: "#2aa198"
1240
- },
1241
- { primary: "#fdf6e3", secondary: "#eee8d5", tertiary: "#e0dbc7", hover: "#eee8d5" },
1242
- { primary: "#073642", secondary: "#586e75", muted: "#93a1a1" },
1243
- "#eee8d5"
1244
- );
1245
- j(
1246
- "Solarized Dark",
1247
- {
1248
- primary: "#268bd2",
1249
- primaryHover: "#3d98db",
1250
- success: "#859900",
1251
- warning: "#b58900",
1252
- error: "#dc322f",
1253
- info: "#2aa198"
1254
- },
1255
- { primary: "#002b36", secondary: "#073642", tertiary: "#0a4858", hover: "#073642" },
1256
- { primary: "#eee8d5", secondary: "#93a1a1", muted: "#586e75" },
1257
- "#073642"
1258
- );
1259
- j(
1260
- "Monokai",
1261
- {
1262
- primary: "#66d9ef",
1263
- primaryHover: "#45c0d6",
1264
- success: "#a6e22e",
1265
- warning: "#e6db74",
1266
- error: "#f92672",
1267
- info: "#66d9ef"
1268
- },
1269
- { primary: "#272822", secondary: "#34352e", tertiary: "#3e3d32", hover: "#3e3d32" },
1270
- { primary: "#f8f8f2", secondary: "#cfcfc2", muted: "#75715e" },
1271
- "#3e3d32"
1272
- );
1273
- j(
1274
- "One Dark",
1275
- {
1276
- primary: "#61afef",
1277
- primaryHover: "#4b9ee0",
1278
- success: "#98c379",
1279
- warning: "#e5c07b",
1280
- error: "#e06c75",
1281
- info: "#56b6c2"
1282
- },
1283
- { primary: "#282c34", secondary: "#2c313a", tertiary: "#353b45", hover: "#353b45" },
1284
- { primary: "#abb2bf", secondary: "#828997", muted: "#545862" },
1285
- "#3e4452"
1286
- );
1287
- j(
1288
- "Synthwave",
1289
- {
1290
- primary: "#ff7edb",
1291
- primaryHover: "#e660c2",
1292
- success: "#72f1b8",
1293
- warning: "#fede5d",
1294
- error: "#fe4450",
1295
- info: "#36f9f6"
1296
- },
1297
- { primary: "#241b2f", secondary: "#2d2140", tertiary: "#362a50", hover: "#362a50" },
1298
- { primary: "#f0e4fc", secondary: "#b4a0cc", muted: "#6c5c84" },
1299
- "#4a3866"
1300
- );
1301
- $(
1302
- "Vaporwave",
1303
- {
1304
- primary: "#ff71ce",
1305
- primaryHover: "#e655b5",
1306
- success: "#78dcca",
1307
- warning: "#ffb86c",
1308
- error: "#ff5555",
1309
- info: "#76e8fc"
1310
- },
1311
- { primary: "#fce4f7", secondary: "#e8d0f4", tertiary: "#d4bcf0", hover: "#e8d0f4" },
1312
- { primary: "#4a1a4e", secondary: "#7b3f7d", muted: "#c080c0" },
1313
- "#d8a8e8"
1314
- );
1315
- j(
1316
- "Terminal Green",
1317
- {
1318
- primary: "#00ff41",
1319
- primaryHover: "#00cc34",
1320
- success: "#00ff41",
1321
- warning: "#ffff00",
1322
- error: "#ff0000",
1323
- info: "#00ffff"
1324
- },
1325
- { primary: "#0a0a0a", secondary: "#0d1a0d", tertiary: "#1a2e1a", hover: "#1a2e1a" },
1326
- { primary: "#00ff41", secondary: "#00cc33", muted: "#008822" },
1327
- "#003300"
1328
- );
1329
- $(
1330
- "Sepia",
1331
- {
1332
- primary: "#8b6914",
1333
- primaryHover: "#704f10",
1334
- success: "#6b8e23",
1335
- warning: "#cd853f",
1336
- error: "#b22222",
1337
- info: "#5f9ea0"
1338
- },
1339
- { primary: "#faf0e6", secondary: "#f5e6d3", tertiary: "#eddcc7", hover: "#f5e6d3" },
1340
- { primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
1341
- "#d7ccc8"
1342
- );
1343
- $(
1344
- "Vintage",
1345
- {
1346
- primary: "#8d6e63",
1347
- primaryHover: "#6d4c41",
1348
- success: "#66bb6a",
1349
- warning: "#ffb300",
1350
- error: "#e53935",
1351
- info: "#29b6f6"
1352
- },
1353
- { primary: "#efebe9", secondary: "#d7ccc8", tertiary: "#bcaaa4", hover: "#d7ccc8" },
1354
- { primary: "#3e2723", secondary: "#5d4037", muted: "#a1887f" },
1355
- "#bcaaa4"
1356
- );
1357
- j(
1358
- "Cyberpunk",
1359
- {
1360
- primary: "#00f0ff",
1361
- primaryHover: "#00c8d4",
1362
- success: "#39ff14",
1363
- warning: "#ffff00",
1364
- error: "#ff003c",
1365
- info: "#bf00ff"
1366
- },
1367
- { primary: "#0a0e17", secondary: "#131824", tertiary: "#1c2333", hover: "#1c2333" },
1368
- { primary: "#e0fbfc", secondary: "#80d4dd", muted: "#3a6b72" },
1369
- "#1c3a44"
1370
- );
1371
- j(
1372
- "Neon",
1373
- {
1374
- primary: "#ff00ff",
1375
- primaryHover: "#cc00cc",
1376
- success: "#00ff00",
1377
- warning: "#ffff00",
1378
- error: "#ff0000",
1379
- info: "#00ffff"
1380
- },
1381
- { primary: "#0d0d0d", secondary: "#1a1a1a", tertiary: "#262626", hover: "#262626" },
1382
- { primary: "#ffffff", secondary: "#cccccc", muted: "#666666" },
1383
- "#333333"
1384
- );
1385
- j(
1386
- "Retrowave",
1387
- {
1388
- primary: "#f77fbe",
1389
- primaryHover: "#e462a3",
1390
- success: "#72f1b8",
1391
- warning: "#ffe261",
1392
- error: "#ff4444",
1393
- info: "#79e8fb"
1394
- },
1395
- { primary: "#1b0a2e", secondary: "#261440", tertiary: "#321e52", hover: "#321e52" },
1396
- { primary: "#ffe6f7", secondary: "#c9a0c9", muted: "#6b4c7a" },
1397
- "#4a2d66"
1398
- );
1399
- $(
1400
- "Christmas",
1401
- {
1402
- primary: "#c41e3a",
1403
- primaryHover: "#a01830",
1404
- success: "#228b22",
1405
- warning: "#ffd700",
1406
- error: "#dc2626",
1407
- info: "#0891b2"
1408
- },
1409
- { primary: "#fef2f2", secondary: "#fde8e8", tertiary: "#f8d0d0", hover: "#fde8e8" },
1410
- { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
1411
- "#e8a0a0"
1412
- );
1413
- j(
1414
- "Halloween",
1415
- {
1416
- primary: "#ff6600",
1417
- primaryHover: "#e05500",
1418
- success: "#4ade80",
1419
- warning: "#fbbf24",
1420
- error: "#ff0000",
1421
- info: "#9333ea"
1422
- },
1423
- { primary: "#1a0a00", secondary: "#2d1500", tertiary: "#402000", hover: "#402000" },
1424
- { primary: "#ffedd5", secondary: "#fdba74", muted: "#9a5c28" },
1425
- "#5c3400"
1426
- );
1427
- $(
1428
- "Valentine",
1429
- {
1430
- primary: "#e11d48",
1431
- primaryHover: "#be123c",
1432
- success: "#10b981",
1433
- warning: "#f59e0b",
1434
- error: "#dc2626",
1435
- info: "#ec4899"
1436
- },
1437
- { primary: "#fff1f2", secondary: "#ffe4e6", tertiary: "#fecdd3", hover: "#ffe4e6" },
1438
- { primary: "#4c0519", secondary: "#881337", muted: "#f9a8d4" },
1439
- "#fda4af"
1440
- );
1441
- $(
1442
- "Easter",
1443
- {
1444
- primary: "#a78bfa",
1445
- primaryHover: "#8b5cf6",
1446
- success: "#4ade80",
1447
- warning: "#fcd34d",
1448
- error: "#fb7185",
1449
- info: "#67e8f9"
1450
- },
1451
- { primary: "#fef9ff", secondary: "#f3e8ff", tertiary: "#e8d5ff", hover: "#f3e8ff" },
1452
- { primary: "#581c87", secondary: "#6d28d9", muted: "#c4b5fd" },
1453
- "#ddd6fe"
1454
- );
1455
- $(
1456
- "Summer Beach",
1457
- {
1458
- primary: "#0ea5e9",
1459
- primaryHover: "#0284c7",
1460
- success: "#10b981",
1461
- warning: "#f59e0b",
1462
- error: "#ef4444",
1463
- info: "#06b6d4"
1464
- },
1465
- { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1466
- { primary: "#0c4a6e", secondary: "#0369a1", muted: "#7dd3fc" },
1467
- "#fcd34d"
1468
- );
1469
- $(
1470
- "Winter Frost",
1471
- {
1472
- primary: "#3b82f6",
1473
- primaryHover: "#2563eb",
1474
- success: "#10b981",
1475
- warning: "#f59e0b",
1476
- error: "#ef4444",
1477
- info: "#06b6d4"
1478
- },
1479
- { primary: "#f0f9ff", secondary: "#e0f2fe", tertiary: "#bae6fd", hover: "#e0f2fe" },
1480
- { primary: "#1e3a5f", secondary: "#1e40af", muted: "#93c5fd" },
1481
- "#bfdbfe"
1482
- );
1483
- $(
1484
- "Cherry Blossom",
1485
- {
1486
- primary: "#ec4899",
1487
- primaryHover: "#db2777",
1488
- success: "#10b981",
1489
- warning: "#f59e0b",
1490
- error: "#ef4444",
1491
- info: "#06b6d4"
1492
- },
1493
- { primary: "#fdf2f8", secondary: "#fce7f3", tertiary: "#fbcfe8", hover: "#fce7f3" },
1494
- { primary: "#831843", secondary: "#9d174d", muted: "#f9a8d4" },
1495
- "#fbcfe8"
1496
- );
1497
- $(
1498
- "Harvest",
1499
- {
1500
- primary: "#b45309",
1501
- primaryHover: "#92400e",
1502
- success: "#4d7c0f",
1503
- warning: "#a16207",
1504
- error: "#b91c1c",
1505
- info: "#0e7490"
1506
- },
1507
- { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1508
- { primary: "#451a03", secondary: "#78350f", muted: "#d97706" },
1509
- "#fcd34d"
1510
- );
1511
- $(
1512
- "Japanese Zen",
1513
- {
1514
- primary: "#6b7280",
1515
- primaryHover: "#4b5563",
1516
- success: "#6b8e23",
1517
- warning: "#d4a017",
1518
- error: "#c0392b",
1519
- info: "#5f9ea0"
1520
- },
1521
- { primary: "#faf9f6", secondary: "#f0ece3", tertiary: "#e6e0d4", hover: "#f0ece3" },
1522
- { primary: "#2c2c2c", secondary: "#5c5c5c", muted: "#a0998a" },
1523
- "#d5cec0"
1524
- );
1525
- $(
1526
- "Moroccan",
1527
- {
1528
- primary: "#c2410c",
1529
- primaryHover: "#9a3412",
1530
- success: "#15803d",
1531
- warning: "#ca8a04",
1532
- error: "#b91c1c",
1533
- info: "#0e7490"
1534
- },
1535
- { primary: "#fffbf0", secondary: "#fef3e0", tertiary: "#fde6c4", hover: "#fef3e0" },
1536
- { primary: "#3a1a00", secondary: "#7c2d12", muted: "#d97706" },
1537
- "#f5d0a0"
1538
- );
1539
- $(
1540
- "Scandinavian",
1541
- {
1542
- primary: "#4b5563",
1543
- primaryHover: "#374151",
1544
- success: "#059669",
1545
- warning: "#d97706",
1546
- error: "#dc2626",
1547
- info: "#0891b2"
1548
- },
1549
- { primary: "#ffffff", secondary: "#f9fafb", tertiary: "#f3f4f6", hover: "#f3f4f6" },
1550
- { primary: "#111827", secondary: "#374151", muted: "#9ca3af" },
1551
- "#e5e7eb"
1552
- );
1553
- $(
1554
- "Mediterranean",
1555
- {
1556
- primary: "#1e40af",
1557
- primaryHover: "#1e3a8a",
1558
- success: "#059669",
1559
- warning: "#d97706",
1560
- error: "#dc2626",
1561
- info: "#0891b2"
1562
- },
1563
- { primary: "#eff6ff", secondary: "#dbeafe", tertiary: "#bfdbfe", hover: "#dbeafe" },
1564
- { primary: "#1e3a5f", secondary: "#2563eb", muted: "#93c5fd" },
1565
- "#bfdbfe"
1566
- );
1567
- $(
1568
- "Chinese New Year",
1569
- {
1570
- primary: "#dc2626",
1571
- primaryHover: "#b91c1c",
1572
- success: "#16a34a",
1573
- warning: "#d4a017",
1574
- error: "#ef4444",
1575
- info: "#0891b2"
1576
- },
1577
- { primary: "#fef2f2", secondary: "#fee2e2", tertiary: "#fecaca", hover: "#fee2e2" },
1578
- { primary: "#450a0a", secondary: "#991b1b", muted: "#f87171" },
1579
- "#fca5a5"
1580
- );
1581
- $(
1582
- "Indian Festive",
1583
- {
1584
- primary: "#d97706",
1585
- primaryHover: "#b45309",
1586
- success: "#16a34a",
1587
- warning: "#ca8a04",
1588
- error: "#dc2626",
1589
- info: "#7c3aed"
1590
- },
1591
- { primary: "#fffbeb", secondary: "#fef3c7", tertiary: "#fde68a", hover: "#fef3c7" },
1592
- { primary: "#451a03", secondary: "#92400e", muted: "#f59e0b" },
1593
- "#fcd34d"
1594
- );
1595
- $(
1596
- "Brazilian Carnival",
1597
- {
1598
- primary: "#16a34a",
1599
- primaryHover: "#15803d",
1600
- success: "#22c55e",
1601
- warning: "#facc15",
1602
- error: "#ef4444",
1603
- info: "#0ea5e9"
1604
- },
1605
- { primary: "#f0fdf4", secondary: "#dcfce7", tertiary: "#bbf7d0", hover: "#dcfce7" },
1606
- { primary: "#052e16", secondary: "#166534", muted: "#4ade80" },
1607
- "#86efac"
1608
- );
1609
- $(
1610
- "African Earth",
1611
- {
1612
- primary: "#92400e",
1613
- primaryHover: "#78350f",
1614
- success: "#4d7c0f",
1615
- warning: "#a16207",
1616
- error: "#b91c1c",
1617
- info: "#0e7490"
1618
- },
1619
- { primary: "#faf5f0", secondary: "#f0e6d6", tertiary: "#e6d5bb", hover: "#f0e6d6" },
1620
- { primary: "#2b1a0e", secondary: "#5c3d1e", muted: "#a08060" },
1621
- "#d4b896"
1622
- );
1623
- j(
1624
- "High Contrast Dark",
1625
- {
1626
- primary: "#ffff00",
1627
- primaryHover: "#cccc00",
1628
- success: "#00ff00",
1629
- warning: "#ff8c00",
1630
- error: "#ff0000",
1631
- info: "#00ffff"
1632
- },
1633
- { primary: "#000000", secondary: "#1a1a1a", tertiary: "#333333", hover: "#333333" },
1634
- { primary: "#ffffff", secondary: "#ffffff", muted: "#cccccc" },
1635
- "#ffffff"
1636
- );
1637
- $(
1638
- "Monochrome",
1639
- {
1640
- primary: "#404040",
1641
- primaryHover: "#262626",
1642
- success: "#4d7c0f",
1643
- warning: "#a16207",
1644
- error: "#b91c1c",
1645
- info: "#0e7490"
1646
- },
1647
- { primary: "#fafafa", secondary: "#f0f0f0", tertiary: "#e0e0e0", hover: "#e0e0e0" },
1648
- { primary: "#1a1a1a", secondary: "#404040", muted: "#808080" },
1649
- "#c0c0c0"
1650
- );
1651
- $(
1652
- "Enhanced Contrast",
1653
- {
1654
- primary: "#0050b3",
1655
- primaryHover: "#003d8c",
1656
- success: "#006400",
1657
- warning: "#cc7000",
1658
- error: "#cc0000",
1659
- info: "#006680"
1660
- },
1661
- { primary: "#ffffff", secondary: "#f5f5f5", tertiary: "#ebebeb", hover: "#ebebeb" },
1662
- { primary: "#000000", secondary: "#1a1a1a", muted: "#595959" },
1663
- "#8c8c8c"
1664
- );
1665
- $(
1666
- "Minimalist",
1667
- {
1668
- primary: "#18181b",
1669
- primaryHover: "#27272a",
1670
- success: "#22c55e",
1671
- warning: "#eab308",
1672
- error: "#ef4444",
1673
- info: "#3b82f6"
1674
- },
1675
- { primary: "#ffffff", secondary: "#fafafa", tertiary: "#f5f5f5", hover: "#f5f5f5" },
1676
- { primary: "#0a0a0a", secondary: "#404040", muted: "#a3a3a3" },
1677
- "#e5e5e5"
1678
- );
1679
- j(
1680
- "Warm Dark",
1681
- {
1682
- primary: "#f59e0b",
1683
- primaryHover: "#d97706",
1684
- success: "#10b981",
1685
- warning: "#fbbf24",
1686
- error: "#f87171",
1687
- info: "#38bdf8"
1688
- },
1689
- { primary: "#1c1917", secondary: "#292524", tertiary: "#44403c", hover: "#44403c" },
1690
- { primary: "#fafaf9", secondary: "#d6d3d1", muted: "#78716c" },
1691
- "#57534e"
1692
- );
1693
- j(
1694
- "Soft Dark",
1695
- {
1696
- primary: "#a78bfa",
1697
- primaryHover: "#8b5cf6",
1698
- success: "#34d399",
1699
- warning: "#fcd34d",
1700
- error: "#fb7185",
1701
- info: "#67e8f9"
1702
- },
1703
- { primary: "#1e1e2e", secondary: "#262637", tertiary: "#313147", hover: "#313147" },
1704
- { primary: "#e8e8f0", secondary: "#a0a0b8", muted: "#5c5c74" },
1705
- "#3e3e58"
1706
- );
1707
- $(
1708
- "Coffee",
1709
- {
1710
- primary: "#6f4e37",
1711
- primaryHover: "#5c3d28",
1712
- success: "#4d7c0f",
1713
- warning: "#a16207",
1714
- error: "#b91c1c",
1715
- info: "#0e7490"
1716
- },
1717
- { primary: "#faf6f1", secondary: "#f0e8dc", tertiary: "#e6d8c6", hover: "#f0e8dc" },
1718
- { primary: "#2c1a0e", secondary: "#5c3d28", muted: "#a08868" },
1719
- "#d4c4a8"
1720
- );
1721
- $(
1722
- "Wine",
1723
- {
1724
- primary: "#7f1d1d",
1725
- primaryHover: "#641717",
1726
- success: "#059669",
1727
- warning: "#d97706",
1728
- error: "#dc2626",
1729
- info: "#0891b2"
1730
- },
1731
- { primary: "#fef2f2", secondary: "#fde8e8", tertiary: "#f8d0d0", hover: "#fde8e8" },
1732
- { primary: "#3b0a0a", secondary: "#7f1d1d", muted: "#dc6868" },
1733
- "#e8a0a0"
1734
- );
1735
- const gr = process.env.NODE_ENV === "development";
1736
- let V = {
1737
- enabled: gr,
1738
- slowRenderThreshold: 16
1739
- };
1740
- const We = [], te = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
1741
- function yr() {
1742
- We.length = 0, te.clear(), _e.clear();
1743
- }
1744
- function hr(e) {
1745
- const t = V.slowRenderThreshold;
1746
- return We.filter((r) => r.actualDuration > t);
1747
- }
1748
- function ee(e) {
1749
- return e < 1 ? `${(e * 1e3).toFixed(0)}μs` : e < 1e3 ? `${e.toFixed(2)}ms` : `${(e / 1e3).toFixed(2)}s`;
1750
- }
1751
- function ei() {
1752
- 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());
1753
- return { stats: e, slowRenders: t, totalRenders: r, avgRenderTime: a, marks: n };
1754
- }
1755
- function br() {
1756
- const e = ei();
1757
- console.group(
1758
- "%c[Nice2Dev Performance Report]",
1759
- "color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"
1760
- ), 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(
1761
- e.stats.sort((t, r) => r.totalRenderTime - t.totalRenderTime).map((t) => ({
1762
- Name: t.componentName,
1763
- Renders: t.renderCount,
1764
- "Avg Time": ee(t.avgRenderTime),
1765
- "Max Time": ee(t.maxRenderTime),
1766
- "Total Time": ee(t.totalRenderTime),
1767
- "Slow Renders": t.slowRenderCount
1768
- }))
1769
- ), console.groupEnd(), e.slowRenders.length > 0 && (console.group("Slow Renders (last 10)"), console.table(
1770
- e.slowRenders.slice(-10).map((t) => ({
1771
- Component: t.componentName,
1772
- Phase: t.phase,
1773
- Duration: ee(t.actualDuration),
1774
- Time: new Date(t.timestamp).toLocaleTimeString()
1775
- }))
1776
- ), console.groupEnd()), e.marks.length > 0 && (console.group("Custom Marks"), console.table(
1777
- e.marks.filter((t) => t.duration).map((t) => ({
1778
- Name: t.name,
1779
- Duration: ee(t.duration)
1780
- }))
1781
- ), console.groupEnd()), console.groupEnd();
1782
- }
1783
- const ai = be.memo(
1784
- ({ position: e = "bottom-right", defaultCollapsed: t = true }) => {
1785
- const [r, a] = be.useState(t), [n, o] = be.useState([]), [i, s] = be.useState({ used: 0, total: 0 });
1786
- if (be.useEffect(() => {
1787
- const l = () => {
1788
- const u = Array.from(te.values());
1789
- o(u.sort((y, f) => f.totalRenderTime - y.totalRenderTime).slice(0, 10));
1790
- const m = window.performance;
1791
- m.memory && s({
1792
- used: m.memory.usedJSHeapSize / 1024 / 1024,
1793
- total: m.memory.totalJSHeapSize / 1024 / 1024
1794
- });
1795
- };
1796
- l();
1797
- const d = setInterval(l, 2e3);
1798
- return () => clearInterval(d);
1799
- }, []), !V.enabled)
1800
- return null;
1801
- const c = {
1802
- position: "fixed",
1803
- zIndex: 99999,
1804
- ...e.includes("top") ? { top: 8 } : { bottom: 8 },
1805
- ...e.includes("left") ? { left: 8 } : { right: 8 }
1806
- };
1807
- return /* @__PURE__ */ jsxRuntime.jsxs(
1808
- "div",
1809
- {
1810
- style: {
1811
- ...c,
1812
- background: "var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",
1813
- color: "var(--nice-text-on-primary, #fff)",
1814
- borderRadius: 8,
1815
- fontSize: 11,
1816
- fontFamily: "Monaco, Consolas, monospace",
1817
- padding: r ? "4px 8px" : 8,
1818
- maxWidth: r ? "auto" : 300,
1819
- maxHeight: r ? "auto" : 400,
1820
- overflow: "auto"
1821
- },
1822
- children: [
1823
- /* @__PURE__ */ jsxRuntime.jsxs(
1824
- "div",
1825
- {
1826
- style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 8 },
1827
- onClick: () => a((l) => !l),
1828
- children: [
1829
- /* @__PURE__ */ jsxRuntime.jsx(
1830
- "span",
1831
- {
1832
- "aria-hidden": "true",
1833
- style: {
1834
- width: 8,
1835
- height: 8,
1836
- borderRadius: "50%",
1837
- background: "var(--nice-color-success, #22c55e)"
1838
- }
1839
- }
1840
- ),
1841
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Profiler" }),
1842
- i.used > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
1843
- "span",
1844
- {
1845
- style: {
1846
- color: i.used > 100 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-text-muted, #64748b)"
1847
- },
1848
- children: [
1849
- i.used.toFixed(0),
1850
- "MB"
1851
- ]
1852
- }
1853
- ),
1854
- /* @__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 }) })
1855
- ]
1856
- }
1857
- ),
1858
- !r && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginTop: 8 }, children: [
1859
- /* @__PURE__ */ jsxRuntime.jsx(
1860
- "div",
1861
- {
1862
- style: {
1863
- borderBottom: "1px solid var(--nice-border-color, #333)",
1864
- paddingBottom: 4,
1865
- marginBottom: 8
1866
- },
1867
- children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Top Components" })
1868
- }
1869
- ),
1870
- n.map((l) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: 4, display: "flex", gap: 8 }, children: [
1871
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: l.componentName }),
1872
- /* @__PURE__ */ jsxRuntime.jsx(
1873
- "span",
1874
- {
1875
- style: {
1876
- color: l.avgRenderTime > 16 ? "var(--nice-color-warning, #f59e0b)" : "var(--nice-color-success, #22c55e)"
1877
- },
1878
- children: ee(l.avgRenderTime)
1879
- }
1880
- ),
1881
- /* @__PURE__ */ jsxRuntime.jsxs(
1882
- "span",
1883
- {
1884
- style: {
1885
- color: "var(--nice-text-muted, #64748b)",
1886
- minWidth: 30,
1887
- textAlign: "right"
1888
- },
1889
- children: [
1890
- "x",
1891
- l.renderCount
1892
- ]
1893
- }
1894
- )
1895
- ] }, l.componentName)),
1896
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginTop: 8, display: "flex", gap: 8 }, children: [
1897
- /* @__PURE__ */ jsxRuntime.jsx(
1898
- "button",
1899
- {
1900
- onClick: br,
1901
- style: {
1902
- flex: 1,
1903
- padding: "4px 8px",
1904
- background: "var(--nice-bg-tertiary, #333)",
1905
- border: "none",
1906
- borderRadius: 4,
1907
- color: "var(--nice-text-primary, #fff)",
1908
- cursor: "pointer",
1909
- fontSize: 10
1910
- },
1911
- children: "Print Report"
1912
- }
1913
- ),
1914
- /* @__PURE__ */ jsxRuntime.jsx(
1915
- "button",
1916
- {
1917
- onClick: yr,
1918
- style: {
1919
- flex: 1,
1920
- padding: "4px 8px",
1921
- background: "var(--nice-bg-tertiary, #333)",
1922
- border: "none",
1923
- borderRadius: 4,
1924
- color: "var(--nice-text-primary, #fff)",
1925
- cursor: "pointer",
1926
- fontSize: 10
1927
- },
1928
- children: "Clear"
1929
- }
1930
- )
1931
- ] })
1932
- ] })
1933
- ]
1934
- }
1935
- );
1936
- }
1937
- );
1938
- 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";
1939
298
  process.env.NODE_ENV === "development";
1940
- be.createContext(null);
1941
- be.createContext({
1942
- enabled: true,
1943
- active: false,
1944
- run: () => {
1945
- }
1946
- });
1947
- const Dt = "nice-tutorial-button-styles";
1948
- if (typeof document < "u" && !document.getElementById(Dt)) {
1949
- const e = document.createElement("style");
1950
- e.id = Dt, e.textContent = `
1951
- .nice-tutorial-button {
1952
- display: inline-flex;
1953
- align-items: center;
1954
- justify-content: center;
1955
- border: 1px solid var(--nice-border, #cbd5e1);
1956
- background: var(--nice-bg, #fff);
1957
- color: var(--nice-text-secondary, #475569);
1958
- border-radius: var(--nice-radius-full, 9999px);
1959
- cursor: help;
1960
- font-weight: 700;
1961
- line-height: 1;
1962
- padding: 0;
1963
- transition: background var(--nice-transition, 200ms ease), color var(--nice-transition, 200ms ease), border-color var(--nice-transition, 200ms ease);
1964
- }
1965
- .nice-tutorial-button:hover {
1966
- background: var(--nice-primary, #2563eb);
1967
- border-color: var(--nice-primary, #2563eb);
1968
- color: var(--nice-text-inverse, #fff);
1969
- }
1970
- .nice-tutorial-button:focus-visible {
1971
- outline: none;
1972
- box-shadow: 0 0 0 2px var(--nice-bg, #fff), 0 0 0 4px var(--nice-primary, #2563eb);
1973
- }
1974
- .nice-tutorial-button--sm { width: 16px; height: 16px; font-size: 11px; }
1975
- .nice-tutorial-button--md { width: 20px; height: 20px; font-size: 12px; }
1976
- `, document.head.appendChild(e);
1977
- }
1978
- be.createContext(null);
1979
- be.createContext(null);
1980
- be.createContext(null);
1981
- 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 = [];
1982
306
  const DEFAULT_VIEW_CONFIG$1 = {
1983
307
  timeUnit: "day",
1984
308
  showUtilization: true,
@@ -1994,9 +318,9 @@ const TIME_INCREMENTS = {
1994
318
  quarter: 90 * 24 * 60 * 60 * 1e3,
1995
319
  year: 365 * 24 * 60 * 60 * 1e3
1996
320
  };
1997
- const NiceResourceAllocation = ({
1998
- resources,
1999
- allocations,
321
+ const NiceCapacityPlanner = ({
322
+ resources = EMPTY_RESOURCES,
323
+ allocations = EMPTY_ALLOCATIONS,
2000
324
  dateRange,
2001
325
  viewConfig: externalConfig,
2002
326
  onAllocationCreate,
@@ -2006,17 +330,18 @@ const NiceResourceAllocation = ({
2006
330
  readOnly = false,
2007
331
  className = ""
2008
332
  }) => {
2009
- var _a2, _b;
333
+ var _a, _b;
334
+ const { t } = v();
2010
335
  const config = { ...DEFAULT_VIEW_CONFIG$1, ...externalConfig };
2011
- const [selectedAllocation, setSelectedAllocation] = be.useState(null);
2012
- const [hoveredCell, setHoveredCell] = be.useState(null);
2013
- const [timeUnit, setTimeUnit] = be.useState(config.timeUnit);
2014
- 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(
2015
340
  new Set(resources.map((r) => r.id))
2016
341
  );
2017
- const [showAllocationModal, setShowAllocationModal] = be.useState(false);
2018
- const [newAllocation, setNewAllocation] = be.useState({});
2019
- const timePeriods = be.useMemo(() => {
342
+ const [showAllocationModal, setShowAllocationModal] = ve.useState(false);
343
+ const [newAllocation, setNewAllocation] = ve.useState({});
344
+ const timePeriods = ve.useMemo(() => {
2020
345
  const periods = [];
2021
346
  const increment = TIME_INCREMENTS[timeUnit];
2022
347
  let current = new Date(dateRange.start);
@@ -2026,22 +351,22 @@ const NiceResourceAllocation = ({
2026
351
  }
2027
352
  return periods;
2028
353
  }, [dateRange.start, dateRange.end, timeUnit]);
2029
- const utilizationMap = be.useMemo(() => {
354
+ const utilizationMap = ve.useMemo(() => {
2030
355
  const map = /* @__PURE__ */ new Map();
2031
356
  resources.forEach((resource) => {
2032
357
  const resourceMap = /* @__PURE__ */ new Map();
2033
358
  timePeriods.forEach((period) => {
2034
359
  const periodStart = period.getTime();
2035
360
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2036
- const periodAllocations = allocations.filter((a) => {
2037
- if (a.resourceId !== resource.id) {
361
+ const periodAllocations = allocations.filter((a2) => {
362
+ if (a2.resourceId !== resource.id) {
2038
363
  return false;
2039
364
  }
2040
- const allocStart = a.start.getTime();
2041
- const allocEnd = a.end.getTime();
365
+ const allocStart = a2.start.getTime();
366
+ const allocEnd = a2.end.getTime();
2042
367
  return allocStart < periodEnd && allocEnd > periodStart;
2043
368
  });
2044
- const allocatedHours = periodAllocations.reduce((sum, a) => sum + a.hoursPerDay, 0);
369
+ const allocatedHours = periodAllocations.reduce((sum, a2) => sum + a2.hoursPerDay, 0);
2045
370
  const availableHours = resource.maxCapacity;
2046
371
  const utilizationPercent = availableHours > 0 ? allocatedHours / availableHours * 100 : 0;
2047
372
  resourceMap.set(periodStart, {
@@ -2057,7 +382,7 @@ const NiceResourceAllocation = ({
2057
382
  });
2058
383
  return map;
2059
384
  }, [resources, allocations, timePeriods, timeUnit]);
2060
- const conflicts = be.useMemo(() => {
385
+ const conflicts = ve.useMemo(() => {
2061
386
  const conflictList = [];
2062
387
  utilizationMap.forEach((resourceMap, resourceId) => {
2063
388
  const resource = resources.find((r) => r.id === resourceId);
@@ -2065,12 +390,12 @@ const NiceResourceAllocation = ({
2065
390
  if (util.overallocated) {
2066
391
  const period = new Date(periodStart);
2067
392
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2068
- const conflictAllocations = allocations.filter((a) => {
2069
- if (a.resourceId !== resourceId) {
393
+ const conflictAllocations = allocations.filter((a2) => {
394
+ if (a2.resourceId !== resourceId) {
2070
395
  return false;
2071
396
  }
2072
- const allocStart = a.start.getTime();
2073
- const allocEnd = a.end.getTime();
397
+ const allocStart = a2.start.getTime();
398
+ const allocEnd = a2.end.getTime();
2074
399
  return allocStart < periodEnd && allocEnd > periodStart;
2075
400
  });
2076
401
  conflictList.push({
@@ -2085,24 +410,24 @@ const NiceResourceAllocation = ({
2085
410
  });
2086
411
  return conflictList;
2087
412
  }, [utilizationMap, allocations, resources, timeUnit]);
2088
- const getCellAllocations = be.useCallback(
413
+ const getCellAllocations = ve.useCallback(
2089
414
  (resourceId, date) => {
2090
415
  const periodStart = date.getTime();
2091
416
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2092
- return allocations.filter((a) => {
2093
- if (a.resourceId !== resourceId) {
417
+ return allocations.filter((a2) => {
418
+ if (a2.resourceId !== resourceId) {
2094
419
  return false;
2095
420
  }
2096
- const allocStart = a.start.getTime();
2097
- const allocEnd = a.end.getTime();
421
+ const allocStart = a2.start.getTime();
422
+ const allocEnd = a2.end.getTime();
2098
423
  return allocStart < periodEnd && allocEnd > periodStart;
2099
424
  });
2100
425
  },
2101
426
  [allocations, timeUnit]
2102
427
  );
2103
428
  const getCellColor = (resourceId, date) => {
2104
- var _a3;
2105
- 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());
2106
431
  if (!util) {
2107
432
  return "transparent";
2108
433
  }
@@ -2132,7 +457,7 @@ const NiceResourceAllocation = ({
2132
457
  }
2133
458
  };
2134
459
  const handleCellClick = (resourceId, date) => {
2135
- var _a3;
460
+ var _a2;
2136
461
  if (readOnly) {
2137
462
  return;
2138
463
  }
@@ -2140,7 +465,7 @@ const NiceResourceAllocation = ({
2140
465
  resourceId,
2141
466
  start: date,
2142
467
  end: new Date(date.getTime() + TIME_INCREMENTS[timeUnit]),
2143
- 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,
2144
469
  status: "tentative"
2145
470
  });
2146
471
  setShowAllocationModal(true);
@@ -2187,47 +512,45 @@ const NiceResourceAllocation = ({
2187
512
  }
2188
513
  };
2189
514
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-resource-allocation ${className}`, children: [
2190
- /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "allocation__toolbar", children: [
2191
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "toolbar__left", children: [
2192
- /* @__PURE__ */ jsxRuntime.jsx("h2", { children: "Resource Allocation" }),
2193
- /* @__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: [
2194
519
  dateRange.start.toLocaleDateString(),
2195
520
  " - ",
2196
521
  dateRange.end.toLocaleDateString()
2197
522
  ] })
2198
523
  ] }),
2199
- /* @__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(
2200
525
  "button",
2201
526
  {
2202
- className: `unit-button ${timeUnit === unit ? "unit-button--active" : ""}`,
527
+ className: `nice-resource-allocation__unit-button ${timeUnit === unit ? "nice-resource-allocation__unit-button--active" : ""}`,
2203
528
  onClick: () => setTimeUnit(unit),
2204
529
  children: unit.charAt(0).toUpperCase() + unit.slice(1)
2205
530
  },
2206
531
  unit
2207
532
  )) }) }),
2208
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "toolbar__right", children: config.showConflicts && conflicts.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "conflicts-badge", children: [
2209
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "badge-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "warning", size: 14 }) }),
2210
- conflicts.length,
2211
- " Conflict",
2212
- 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))
2213
536
  ] }) })
2214
537
  ] }),
2215
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "allocation__legend", children: [
2216
- /* @__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: [
2217
540
  /* @__PURE__ */ jsxRuntime.jsx(
2218
541
  "span",
2219
542
  {
2220
- className: "legend-color",
543
+ className: "nice-resource-allocation__legend-color",
2221
544
  style: { backgroundColor: "var(--nice-success-tint-20, rgba(34, 197, 94, 0.2))" }
2222
545
  }
2223
546
  ),
2224
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Allocated" })
547
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("capacityPlanner.allocated", "Allocated") })
2225
548
  ] }),
2226
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "legend-item", children: [
549
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__legend-item", children: [
2227
550
  /* @__PURE__ */ jsxRuntime.jsx(
2228
551
  "span",
2229
552
  {
2230
- className: "legend-color",
553
+ className: "nice-resource-allocation__legend-color",
2231
554
  style: { backgroundColor: "var(--nice-warning-tint-30, rgba(245, 158, 11, 0.3))" }
2232
555
  }
2233
556
  ),
@@ -2239,70 +562,77 @@ const NiceResourceAllocation = ({
2239
562
  "%)"
2240
563
  ] })
2241
564
  ] }),
2242
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "legend-item", children: [
565
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-resource-allocation__legend-item", children: [
2243
566
  /* @__PURE__ */ jsxRuntime.jsx(
2244
567
  "span",
2245
568
  {
2246
- className: "legend-color",
569
+ className: "nice-resource-allocation__legend-color",
2247
570
  style: { backgroundColor: "var(--nice-danger-tint-40, rgba(239, 68, 68, 0.4))" }
2248
571
  }
2249
572
  ),
2250
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Overallocated" })
573
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("capacityPlanner.overallocated", "Overallocated") })
2251
574
  ] })
2252
575
  ] }),
2253
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "allocation__grid", children: [
2254
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid__header", children: [
2255
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "resource-header", children: "Resource" }),
2256
- /* @__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)) })
2257
580
  ] }),
2258
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid__body", children: resources.map((resource) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "resource-row", children: [
2259
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "resource-cell", onClick: () => onResourceClick == null ? void 0 : onResourceClick(resource), children: [
2260
- /* @__PURE__ */ jsxRuntime.jsx(
2261
- "button",
2262
- {
2263
- className: "expand-button",
2264
- onClick: (e) => {
2265
- e.stopPropagation();
2266
- toggleResource(resource.id);
2267
- },
2268
- children: /* @__PURE__ */ jsxRuntime.jsx(
2269
- 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",
2270
590
  {
2271
- name: expandedResources.has(resource.id) ? "chevron-down" : "chevron-right",
2272
- 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
+ )
2273
603
  }
2274
- )
2275
- }
2276
- ),
2277
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "resource-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: getResourceTypeIcon(resource.type), size: 16 }) }),
2278
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "resource-info", children: [
2279
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "resource-name", children: resource.name }),
2280
- resource.department && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "resource-dept", children: resource.department })
2281
- ] }),
2282
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "resource-capacity", children: [
2283
- resource.maxCapacity,
2284
- "h/day"
2285
- ] })
2286
- ] }),
2287
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "time-cells", children: timePeriods.map((period, idx) => {
2288
- 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;
2289
619
  const cellAllocations = getCellAllocations(resource.id, period);
2290
- 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());
2291
621
  const isHovered = (hoveredCell == null ? void 0 : hoveredCell.resourceId) === resource.id && (hoveredCell == null ? void 0 : hoveredCell.date.getTime()) === period.getTime();
2292
622
  return /* @__PURE__ */ jsxRuntime.jsxs(
2293
623
  "div",
2294
624
  {
2295
- className: `time-cell ${isHovered ? "time-cell--hovered" : ""}`,
625
+ className: `nice-resource-allocation__time-cell ${isHovered ? "nice-resource-allocation__time-cell--hovered" : ""}`,
2296
626
  style: { backgroundColor: getCellColor(resource.id, period) },
2297
627
  onClick: () => handleCellClick(resource.id, period),
2298
628
  onMouseEnter: () => setHoveredCell({ resourceId: resource.id, date: period }),
2299
629
  onMouseLeave: () => setHoveredCell(null),
2300
630
  children: [
2301
- 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: [
2302
632
  cellAllocations.slice(0, 2).map((alloc) => /* @__PURE__ */ jsxRuntime.jsx(
2303
633
  "div",
2304
634
  {
2305
- className: `allocation-dot ${alloc.status}`,
635
+ className: `nice-resource-allocation__allocation-dot nice-resource-allocation__allocation-dot--${alloc.status}`,
2306
636
  onClick: (e) => {
2307
637
  e.stopPropagation();
2308
638
  setSelectedAllocation(alloc.id);
@@ -2310,12 +640,12 @@ const NiceResourceAllocation = ({
2310
640
  },
2311
641
  alloc.id
2312
642
  )),
2313
- 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: [
2314
644
  "+",
2315
645
  cellAllocations.length - 2
2316
646
  ] })
2317
647
  ] }),
2318
- 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: [
2319
649
  util.allocatedHours.toFixed(1),
2320
650
  "h"
2321
651
  ] })
@@ -2324,7 +654,7 @@ const NiceResourceAllocation = ({
2324
654
  idx
2325
655
  );
2326
656
  }) }),
2327
- 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) => {
2328
658
  const startIdx = timePeriods.findIndex(
2329
659
  (p) => p.getTime() <= allocation.start.getTime()
2330
660
  );
@@ -2340,26 +670,27 @@ const NiceResourceAllocation = ({
2340
670
  return /* @__PURE__ */ jsxRuntime.jsxs(
2341
671
  "div",
2342
672
  {
2343
- 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" : ""}`,
2344
674
  style: {
2345
675
  left: `${leftPercent}%`,
2346
676
  width: `${widthPercent}%`
2347
677
  },
2348
678
  onClick: () => setSelectedAllocation(allocation.id),
2349
679
  children: [
2350
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "allocation-label", children: [
680
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-resource-allocation__allocation-label", children: [
2351
681
  allocation.hoursPerDay,
2352
682
  "h/day"
2353
683
  ] }),
2354
684
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
2355
685
  "button",
2356
686
  {
2357
- className: "delete-allocation",
687
+ "aria-label": t("capacityPlanner.close", "Close"),
688
+ className: "nice-resource-allocation__delete-allocation",
2358
689
  onClick: (e) => {
2359
690
  e.stopPropagation();
2360
691
  onAllocationDelete == null ? void 0 : onAllocationDelete(allocation.id);
2361
692
  },
2362
- children: "×"
693
+ children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "close", size: 14 })
2363
694
  }
2364
695
  )
2365
696
  ]
@@ -2369,98 +700,127 @@ const NiceResourceAllocation = ({
2369
700
  }) })
2370
701
  ] }, resource.id)) })
2371
702
  ] }),
2372
- showAllocationModal && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-overlay", onClick: () => setShowAllocationModal(false), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "allocation-modal", onClick: (e) => e.stopPropagation(), children: [
2373
- /* @__PURE__ */ jsxRuntime.jsx("h3", { children: "Create Allocation" }),
2374
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-form", children: [
2375
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2376
- "Resource",
2377
- /* @__PURE__ */ jsxRuntime.jsxs(
2378
- "select",
2379
- {
2380
- value: newAllocation.resourceId || "",
2381
- onChange: (e) => setNewAllocation((prev) => ({ ...prev, resourceId: e.target.value })),
2382
- children: [
2383
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "Select resource..." }),
2384
- resources.map((r) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: r.id, children: r.name }, r.id))
2385
- ]
2386
- }
2387
- )
2388
- ] }),
2389
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2390
- "Start Date",
2391
- /* @__PURE__ */ jsxRuntime.jsx(
2392
- "input",
2393
- {
2394
- type: "date",
2395
- value: ((_a2 = newAllocation.start) == null ? void 0 : _a2.toISOString().split("T")[0]) || "",
2396
- onChange: (e) => setNewAllocation((prev) => ({ ...prev, start: new Date(e.target.value) }))
2397
- }
2398
- )
2399
- ] }),
2400
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2401
- "End Date",
2402
- /* @__PURE__ */ jsxRuntime.jsx(
2403
- "input",
2404
- {
2405
- type: "date",
2406
- value: ((_b = newAllocation.end) == null ? void 0 : _b.toISOString().split("T")[0]) || "",
2407
- onChange: (e) => setNewAllocation((prev) => ({ ...prev, end: new Date(e.target.value) }))
2408
- }
2409
- )
2410
- ] }),
2411
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2412
- "Hours per Day",
2413
- /* @__PURE__ */ jsxRuntime.jsx(
2414
- "input",
2415
- {
2416
- type: "number",
2417
- min: "0.5",
2418
- max: "24",
2419
- step: "0.5",
2420
- value: newAllocation.hoursPerDay || 8,
2421
- onChange: (e) => setNewAllocation((prev) => ({
2422
- ...prev,
2423
- hoursPerDay: parseFloat(e.target.value)
2424
- }))
2425
- }
2426
- )
2427
- ] }),
2428
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2429
- "Status",
2430
- /* @__PURE__ */ jsxRuntime.jsxs(
2431
- "select",
2432
- {
2433
- value: newAllocation.status || "tentative",
2434
- onChange: (e) => setNewAllocation((prev) => ({
2435
- ...prev,
2436
- status: e.target.value
2437
- })),
2438
- children: [
2439
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "tentative", children: "Tentative" }),
2440
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "confirmed", children: "Confirmed" })
2441
- ]
2442
- }
2443
- )
2444
- ] }),
2445
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
2446
- "Notes",
2447
- /* @__PURE__ */ jsxRuntime.jsx(
2448
- "textarea",
2449
- {
2450
- value: newAllocation.notes || "",
2451
- onChange: (e) => setNewAllocation((prev) => ({ ...prev, notes: e.target.value })),
2452
- placeholder: "Optional notes..."
2453
- }
2454
- )
2455
- ] })
2456
- ] }),
2457
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-actions", children: [
2458
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "cancel-button", onClick: () => setShowAllocationModal(false), children: "Cancel" }),
2459
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "create-button", onClick: handleCreateAllocation, children: "Create Allocation" })
2460
- ] })
2461
- ] }) })
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
+ )
2462
821
  ] });
2463
822
  };
823
+ const EMPTY_ITEMS = [];
2464
824
  const DEFAULT_VIEW_CONFIG = {
2465
825
  view: "grid",
2466
826
  sortBy: "name",
@@ -2469,7 +829,7 @@ const DEFAULT_VIEW_CONFIG = {
2469
829
  pageSize: 24
2470
830
  };
2471
831
  const NiceInventoryManager = ({
2472
- items,
832
+ items = EMPTY_ITEMS,
2473
833
  transactions = [],
2474
834
  viewConfig: externalConfig,
2475
835
  onItemCreate,
@@ -2478,38 +838,40 @@ const NiceInventoryManager = ({
2478
838
  onTransactionCreate,
2479
839
  onStockCount,
2480
840
  onItemClick,
841
+ onCreatePurchaseOrder,
2481
842
  readOnly = false,
2482
843
  className = ""
2483
844
  }) => {
2484
- var _a2, _b;
845
+ var _a, _b;
846
+ const { t } = v();
2485
847
  const config = { ...DEFAULT_VIEW_CONFIG, ...externalConfig };
2486
- const [filters, setFilters] = be.useState({});
2487
- const [view, setView] = be.useState(config.view);
2488
- const [sortBy, setSortBy] = be.useState(config.sortBy);
2489
- const [sortOrder, setSortOrder] = be.useState(config.sortOrder);
2490
- const [page, setPage] = be.useState(1);
2491
- const [selectedItems, setSelectedItems] = be.useState(/* @__PURE__ */ new Set());
2492
- const [showItemModal, setShowItemModal] = be.useState(false);
2493
- const [showTransactionModal, setShowTransactionModal] = be.useState(false);
2494
- const [editingItem, setEditingItem] = be.useState(null);
2495
- const [newTransaction, setNewTransaction] = be.useState({});
2496
- const [activeTab, setActiveTab] = be.useState("inventory");
2497
- 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(() => {
2498
860
  return Array.from(new Set(items.map((item) => item.category))).sort();
2499
861
  }, [items]);
2500
- const filteredItems = be.useMemo(() => {
2501
- var _a3, _b2;
862
+ const filteredItems = ve.useMemo(() => {
863
+ var _a2, _b2;
2502
864
  let result = [...items];
2503
865
  if (filters.searchQuery) {
2504
866
  const query = filters.searchQuery.toLowerCase();
2505
867
  result = result.filter(
2506
868
  (item) => {
2507
- var _a4;
2508
- 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));
2509
871
  }
2510
872
  );
2511
873
  }
2512
- if ((_a3 = filters.categories) == null ? void 0 : _a3.length) {
874
+ if ((_a2 = filters.categories) == null ? void 0 : _a2.length) {
2513
875
  result = result.filter((item) => filters.categories.includes(item.category));
2514
876
  }
2515
877
  if ((_b2 = filters.statuses) == null ? void 0 : _b2.length) {
@@ -2518,42 +880,42 @@ const NiceInventoryManager = ({
2518
880
  if (filters.lowStockOnly) {
2519
881
  result = result.filter((item) => item.quantity <= item.reorderLevel);
2520
882
  }
2521
- result.sort((a, b) => {
2522
- var _a4, _b3;
883
+ result.sort((a2, b) => {
884
+ var _a3, _b3;
2523
885
  let comparison = 0;
2524
886
  switch (sortBy) {
2525
887
  case "name":
2526
- comparison = a.name.localeCompare(b.name);
888
+ comparison = a2.name.localeCompare(b.name);
2527
889
  break;
2528
890
  case "sku":
2529
- comparison = a.sku.localeCompare(b.sku);
891
+ comparison = a2.sku.localeCompare(b.sku);
2530
892
  break;
2531
893
  case "quantity":
2532
- comparison = a.quantity - b.quantity;
894
+ comparison = a2.quantity - b.quantity;
2533
895
  break;
2534
896
  case "value":
2535
- comparison = a.quantity * a.cost.amount - b.quantity * b.cost.amount;
897
+ comparison = a2.quantity * a2.cost.amount - b.quantity * b.cost.amount;
2536
898
  break;
2537
899
  case "lastUpdated":
2538
- 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);
2539
901
  break;
2540
902
  }
2541
903
  return sortOrder === "asc" ? comparison : -comparison;
2542
904
  });
2543
905
  return result;
2544
906
  }, [items, filters, sortBy, sortOrder]);
2545
- const paginatedItems = be.useMemo(() => {
907
+ const paginatedItems = ve.useMemo(() => {
2546
908
  const start = (page - 1) * config.pageSize;
2547
909
  return filteredItems.slice(start, start + config.pageSize);
2548
910
  }, [filteredItems, page, config.pageSize]);
2549
911
  const totalPages = Math.ceil(filteredItems.length / config.pageSize);
2550
- const reorderItems = be.useMemo(() => {
912
+ const reorderItems = ve.useMemo(() => {
2551
913
  return items.filter((item) => item.quantity <= item.reorderLevel);
2552
914
  }, [items]);
2553
- const recentTransactions = be.useMemo(() => {
2554
- 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);
2555
917
  }, [transactions]);
2556
- const kanbanGroups = be.useMemo(() => {
918
+ const kanbanGroups = ve.useMemo(() => {
2557
919
  if (view !== "kanban") {
2558
920
  return null;
2559
921
  }
@@ -2567,8 +929,8 @@ const NiceInventoryManager = ({
2567
929
  ];
2568
930
  statuses.forEach((status) => groups.set(status, []));
2569
931
  filteredItems.forEach((item) => {
2570
- var _a3;
2571
- (_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);
2572
934
  });
2573
935
  return groups;
2574
936
  }, [filteredItems, view]);
@@ -2649,35 +1011,35 @@ const NiceInventoryManager = ({
2649
1011
  });
2650
1012
  };
2651
1013
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-inventory-manager ${className}`, children: [
2652
- /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "inventory__toolbar", children: [
2653
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "toolbar__left", children: [
2654
- /* @__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: [
2655
1017
  /* @__PURE__ */ jsxRuntime.jsx(
2656
1018
  "input",
2657
1019
  {
2658
1020
  type: "text",
2659
- placeholder: "Search items...",
1021
+ placeholder: t("inventoryManager.searchItems", "Search items..."),
2660
1022
  value: filters.searchQuery || "",
2661
1023
  onChange: (e) => setFilters((prev) => ({ ...prev, searchQuery: e.target.value }))
2662
1024
  }
2663
1025
  ),
2664
- /* @__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 }) })
2665
1027
  ] }),
2666
1028
  /* @__PURE__ */ jsxRuntime.jsxs(
2667
1029
  "select",
2668
1030
  {
2669
- value: ((_a2 = filters.categories) == null ? void 0 : _a2[0]) || "",
1031
+ value: ((_a = filters.categories) == null ? void 0 : _a[0]) || "",
2670
1032
  onChange: (e) => setFilters((prev) => ({
2671
1033
  ...prev,
2672
1034
  categories: e.target.value ? [e.target.value] : void 0
2673
1035
  })),
2674
1036
  children: [
2675
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "All Categories" }),
1037
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("inventoryManager.allCategories", "All Categories") }),
2676
1038
  categories.map((cat) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: cat, children: cat }, cat))
2677
1039
  ]
2678
1040
  }
2679
1041
  ),
2680
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "filter-checkbox", children: [
1042
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "nice-inventory-manager__filter-checkbox", children: [
2681
1043
  /* @__PURE__ */ jsxRuntime.jsx(
2682
1044
  "input",
2683
1045
  {
@@ -2686,29 +1048,29 @@ const NiceInventoryManager = ({
2686
1048
  onChange: (e) => setFilters((prev) => ({ ...prev, lowStockOnly: e.target.checked }))
2687
1049
  }
2688
1050
  ),
2689
- "Low Stock Only"
1051
+ t("inventoryManager.lowStockOnly", "Low Stock Only")
2690
1052
  ] })
2691
1053
  ] }),
2692
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "toolbar__right", children: [
2693
- /* @__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(
2694
1056
  "button",
2695
1057
  {
2696
- className: `view-button ${view === v ? "view-button--active" : ""}`,
2697
- onClick: () => setView(v),
1058
+ className: `nice-inventory-manager__view-button ${view === v2 ? "nice-inventory-manager__view-button--active" : ""}`,
1059
+ onClick: () => setView(v2),
2698
1060
  children: /* @__PURE__ */ jsxRuntime.jsx(
2699
- Ae,
1061
+ re,
2700
1062
  {
2701
- name: v === "grid" ? "grid" : v === "list" ? "list" : "table",
1063
+ name: v2 === "grid" ? "grid" : v2 === "list" ? "list" : "table",
2702
1064
  size: 14
2703
1065
  }
2704
1066
  )
2705
1067
  },
2706
- v
1068
+ v2
2707
1069
  )) }),
2708
1070
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
2709
1071
  "button",
2710
1072
  {
2711
- className: "add-button",
1073
+ className: "nice-inventory-manager__add-button",
2712
1074
  onClick: () => {
2713
1075
  setEditingItem({
2714
1076
  category: categories[0],
@@ -2726,11 +1088,11 @@ const NiceInventoryManager = ({
2726
1088
  )
2727
1089
  ] })
2728
1090
  ] }),
2729
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inventory__tabs", children: [
1091
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__tabs", children: [
2730
1092
  /* @__PURE__ */ jsxRuntime.jsxs(
2731
1093
  "button",
2732
1094
  {
2733
- className: `tab ${activeTab === "inventory" ? "tab--active" : ""}`,
1095
+ className: `nice-inventory-manager__tab ${activeTab === "inventory" ? "nice-inventory-manager__tab--active" : ""}`,
2734
1096
  onClick: () => setActiveTab("inventory"),
2735
1097
  children: [
2736
1098
  "Inventory (",
@@ -2742,7 +1104,7 @@ const NiceInventoryManager = ({
2742
1104
  /* @__PURE__ */ jsxRuntime.jsxs(
2743
1105
  "button",
2744
1106
  {
2745
- className: `tab ${activeTab === "transactions" ? "tab--active" : ""}`,
1107
+ className: `nice-inventory-manager__tab ${activeTab === "transactions" ? "nice-inventory-manager__tab--active" : ""}`,
2746
1108
  onClick: () => setActiveTab("transactions"),
2747
1109
  children: [
2748
1110
  "Transactions (",
@@ -2754,67 +1116,68 @@ const NiceInventoryManager = ({
2754
1116
  /* @__PURE__ */ jsxRuntime.jsxs(
2755
1117
  "button",
2756
1118
  {
2757
- className: `tab ${activeTab === "reorder" ? "tab--active" : ""}`,
1119
+ className: `nice-inventory-manager__tab ${activeTab === "reorder" ? "nice-inventory-manager__tab--active" : ""}`,
2758
1120
  onClick: () => setActiveTab("reorder"),
2759
1121
  children: [
2760
- "Reorder Alerts",
2761
- 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 })
2762
1124
  ]
2763
1125
  }
2764
1126
  )
2765
1127
  ] }),
2766
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inventory__content", children: [
1128
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__content", children: [
2767
1129
  activeTab === "inventory" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2768
- view === "grid" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "items-grid", children: paginatedItems.map((item) => {
2769
- var _a3;
1130
+ view === "grid" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-inventory-manager__items-grid", children: paginatedItems.map((item) => {
1131
+ var _a2;
2770
1132
  return /* @__PURE__ */ jsxRuntime.jsxs(
2771
1133
  "div",
2772
1134
  {
2773
- 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" : ""}`,
2774
1136
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2775
1137
  children: [
2776
1138
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
2777
1139
  "input",
2778
1140
  {
2779
1141
  type: "checkbox",
2780
- className: "item-checkbox",
1142
+ className: "nice-inventory-manager__item-checkbox",
2781
1143
  checked: selectedItems.has(item.id),
2782
1144
  onChange: () => toggleItemSelection(item.id),
2783
1145
  onClick: (e) => e.stopPropagation()
2784
1146
  }
2785
1147
  ),
2786
- 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 }) }) }),
2787
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "item-info", children: [
2788
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "item-sku", children: item.sku }),
2789
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "item-name", children: item.name }),
2790
- /* @__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 })
2791
1153
  ] }),
2792
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "item-stock", children: [
1154
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__item-stock", children: [
2793
1155
  /* @__PURE__ */ jsxRuntime.jsx(
2794
1156
  "span",
2795
1157
  {
2796
- className: "status-badge",
1158
+ className: "nice-inventory-manager__status-badge",
2797
1159
  style: { backgroundColor: getStatusColor(item.status) },
2798
1160
  children: item.status.replace("-", " ")
2799
1161
  }
2800
1162
  ),
2801
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "quantity", children: [
1163
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__quantity", children: [
2802
1164
  item.quantity,
2803
1165
  " ",
2804
1166
  item.unit
2805
1167
  ] }),
2806
- item.quantity <= item.reorderLevel && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "reorder-alert", children: [
2807
- /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "warning", size: 12 }),
2808
- " 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")
2809
1172
  ] })
2810
1173
  ] }),
2811
- /* @__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) })
2812
1175
  ]
2813
1176
  },
2814
1177
  item.id
2815
1178
  );
2816
1179
  }) }),
2817
- 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: [
2818
1181
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2819
1182
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx("th", {}),
2820
1183
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2825,8 +1188,15 @@ const NiceInventoryManager = ({
2825
1188
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2826
1189
  },
2827
1190
  children: [
2828
- "SKU ",
2829
- 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
+ )
2830
1200
  ]
2831
1201
  }
2832
1202
  ),
@@ -2838,12 +1208,19 @@ const NiceInventoryManager = ({
2838
1208
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2839
1209
  },
2840
1210
  children: [
2841
- "Name ",
2842
- 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
+ )
2843
1220
  ]
2844
1221
  }
2845
1222
  ),
2846
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Category" }),
1223
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: t("inventoryManager.category", "Category") }),
2847
1224
  /* @__PURE__ */ jsxRuntime.jsxs(
2848
1225
  "th",
2849
1226
  {
@@ -2852,13 +1229,20 @@ const NiceInventoryManager = ({
2852
1229
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2853
1230
  },
2854
1231
  children: [
2855
- "Qty ",
2856
- 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
+ )
2857
1241
  ]
2858
1242
  }
2859
1243
  ),
2860
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Status" }),
2861
- /* @__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") }),
2862
1246
  /* @__PURE__ */ jsxRuntime.jsxs(
2863
1247
  "th",
2864
1248
  {
@@ -2867,17 +1251,24 @@ const NiceInventoryManager = ({
2867
1251
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2868
1252
  },
2869
1253
  children: [
2870
- "Value ",
2871
- 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
+ )
2872
1263
  ]
2873
1264
  }
2874
1265
  ),
2875
- !readOnly && /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Actions" })
1266
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsx("th", { children: t("inventoryManager.actions", "Actions") })
2876
1267
  ] }) }),
2877
1268
  /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: paginatedItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
2878
1269
  "tr",
2879
1270
  {
2880
- className: selectedItems.has(item.id) ? "row--selected" : "",
1271
+ className: `nice-inventory-manager__row ${selectedItems.has(item.id) ? "nice-inventory-manager__row--selected" : ""}`,
2881
1272
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2882
1273
  children: [
2883
1274
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -2889,18 +1280,24 @@ const NiceInventoryManager = ({
2889
1280
  onClick: (e) => e.stopPropagation()
2890
1281
  }
2891
1282
  ) }),
2892
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "sku-cell", children: item.sku }),
1283
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-inventory-manager__sku-cell", children: item.sku }),
2893
1284
  /* @__PURE__ */ jsxRuntime.jsx("td", { children: item.name }),
2894
1285
  /* @__PURE__ */ jsxRuntime.jsx("td", { children: item.category }),
2895
- /* @__PURE__ */ jsxRuntime.jsxs("td", { className: item.quantity <= item.reorderLevel ? "low-stock" : "", children: [
2896
- item.quantity,
2897
- " ",
2898
- item.unit
2899
- ] }),
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
+ ),
2900
1297
  /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx(
2901
1298
  "span",
2902
1299
  {
2903
- className: "status-badge",
1300
+ className: "nice-inventory-manager__status-badge",
2904
1301
  style: { backgroundColor: getStatusColor(item.status) },
2905
1302
  children: item.status.replace("-", " ")
2906
1303
  }
@@ -2910,40 +1307,40 @@ const NiceInventoryManager = ({
2910
1307
  item.quantity * item.cost.amount,
2911
1308
  item.cost.currency.symbol
2912
1309
  ) }),
2913
- !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "actions-cell", children: [
1310
+ !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "nice-inventory-manager__actions-cell", children: [
2914
1311
  /* @__PURE__ */ jsxRuntime.jsx(
2915
1312
  "button",
2916
1313
  {
2917
- className: "action-btn",
1314
+ className: "nice-inventory-manager__action-btn",
2918
1315
  onClick: (e) => {
2919
1316
  e.stopPropagation();
2920
1317
  setEditingItem(item);
2921
1318
  setShowItemModal(true);
2922
1319
  },
2923
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "edit", size: 14 })
1320
+ children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "edit", size: 14 })
2924
1321
  }
2925
1322
  ),
2926
1323
  /* @__PURE__ */ jsxRuntime.jsx(
2927
1324
  "button",
2928
1325
  {
2929
- className: "action-btn",
1326
+ className: "nice-inventory-manager__action-btn",
2930
1327
  onClick: (e) => {
2931
1328
  e.stopPropagation();
2932
1329
  setNewTransaction({ itemId: item.id });
2933
1330
  setShowTransactionModal(true);
2934
1331
  },
2935
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "clipboard", size: 14 })
1332
+ children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "clipboard", size: 14 })
2936
1333
  }
2937
1334
  ),
2938
1335
  /* @__PURE__ */ jsxRuntime.jsx(
2939
1336
  "button",
2940
1337
  {
2941
- className: "action-btn action-btn--danger",
1338
+ className: "nice-inventory-manager__action-btn nice-inventory-manager__action-btn--danger",
2942
1339
  onClick: (e) => {
2943
1340
  e.stopPropagation();
2944
1341
  onItemDelete == null ? void 0 : onItemDelete(item.id);
2945
1342
  },
2946
- children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "trash", size: 14 })
1343
+ children: /* @__PURE__ */ jsxRuntime.jsx(re, { name: "trash", size: 14 })
2947
1344
  }
2948
1345
  )
2949
1346
  ] })
@@ -2952,27 +1349,34 @@ const NiceInventoryManager = ({
2952
1349
  item.id
2953
1350
  )) })
2954
1351
  ] }) }),
2955
- 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: [
2956
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "column-header", style: { borderColor: getStatusColor(status) }, children: [
2957
- /* @__PURE__ */ jsxRuntime.jsx(
2958
- "span",
2959
- {
2960
- className: "status-dot",
2961
- style: { backgroundColor: getStatusColor(status) }
2962
- }
2963
- ),
2964
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "column-title", children: status.replace("-", " ") }),
2965
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "column-count", children: statusItems.length })
2966
- ] }),
2967
- /* @__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(
2968
1372
  "div",
2969
1373
  {
2970
- className: "kanban-card",
1374
+ className: "nice-inventory-manager__kanban-card",
2971
1375
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2972
1376
  children: [
2973
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "card-sku", children: item.sku }),
2974
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "card-name", children: item.name }),
2975
- /* @__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: [
2976
1380
  item.quantity,
2977
1381
  " ",
2978
1382
  item.unit
@@ -2982,298 +1386,339 @@ const NiceInventoryManager = ({
2982
1386
  item.id
2983
1387
  )) })
2984
1388
  ] }, status)) }),
2985
- totalPages > 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pagination", children: [
2986
- /* @__PURE__ */ jsxRuntime.jsx("button", { disabled: page === 1, onClick: () => setPage((p) => p - 1), children: "Previous" }),
2987
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2988
- "Page ",
2989
- page,
2990
- " of ",
2991
- totalPages
2992
- ] }),
2993
- /* @__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") })
2994
1393
  ] })
2995
1394
  ] }),
2996
- activeTab === "transactions" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "transactions-tab", children: [
1395
+ activeTab === "transactions" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__transactions-tab", children: [
2997
1396
  !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
2998
1397
  "button",
2999
1398
  {
3000
- className: "add-transaction-button",
1399
+ className: "nice-inventory-manager__add-transaction-button",
3001
1400
  onClick: () => setShowTransactionModal(true),
3002
1401
  children: "+ New Transaction"
3003
1402
  }
3004
1403
  ),
3005
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "transactions-list", children: recentTransactions.map((tx) => {
3006
- const item = items.find((i) => i.id === tx.itemId);
3007
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "transaction-item", children: [
3008
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tx-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: getTransactionIcon(tx.type), size: 16 }) }),
3009
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tx-info", children: [
3010
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tx-type", children: tx.type }),
3011
- /* @__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 })
3012
1411
  ] }),
3013
1412
  /* @__PURE__ */ jsxRuntime.jsxs(
3014
1413
  "span",
3015
1414
  {
3016
- 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"}`,
3017
1416
  children: [
3018
1417
  tx.type === "receipt" || tx.type === "return" ? "+" : "-",
3019
1418
  tx.quantity
3020
1419
  ]
3021
1420
  }
3022
1421
  ),
3023
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tx-date", children: tx.date.toLocaleString() }),
3024
- 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: [
3025
1424
  "Ref: ",
3026
1425
  tx.reference
3027
1426
  ] })
3028
1427
  ] }, tx.id);
3029
1428
  }) })
3030
1429
  ] }),
3031
- activeTab === "reorder" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "reorder-tab", children: reorderItems.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "empty-state", children: [
3032
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "empty-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Ae, { name: "success", size: 32 }) }),
3033
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "All items are sufficiently stocked" })
3034
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "reorder-list", children: reorderItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "reorder-item", children: [
3035
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "reorder-info", children: [
3036
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "reorder-sku", children: item.sku }),
3037
- /* @__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 })
3038
1440
  ] }),
3039
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "reorder-stock", children: [
3040
- /* @__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: [
3041
1443
  "Current: ",
3042
1444
  item.quantity,
3043
1445
  " ",
3044
1446
  item.unit
3045
1447
  ] }),
3046
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "reorder-level", children: [
1448
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__reorder-level", children: [
3047
1449
  "Reorder at: ",
3048
1450
  item.reorderLevel
3049
1451
  ] }),
3050
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "reorder-qty", children: [
1452
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "nice-inventory-manager__reorder-qty", children: [
3051
1453
  "Order qty: ",
3052
1454
  item.reorderQuantity
3053
1455
  ] })
3054
1456
  ] }),
3055
- item.supplier && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "supplier-name", children: item.supplier.name }),
3056
- !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(
3057
1459
  "button",
3058
1460
  {
3059
- className: "create-po-button",
3060
- onClick: () => console.log("Create PO for", item.id),
3061
- 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")
3062
1465
  }
3063
1466
  )
3064
1467
  ] }, item.id)) }) })
3065
1468
  ] }),
3066
- 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: [
3067
- /* @__PURE__ */ jsxRuntime.jsx("h3", { children: editingItem.id ? "Edit Item" : "Add New Item" }),
3068
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-form", children: [
3069
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "form-row", children: [
3070
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3071
- "SKU",
3072
- /* @__PURE__ */ jsxRuntime.jsx(
3073
- "input",
3074
- {
3075
- type: "text",
3076
- value: editingItem.sku || "",
3077
- onChange: (e) => setEditingItem((prev) => ({ ...prev, sku: e.target.value }))
3078
- }
3079
- )
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
+ ] })
3080
1596
  ] }),
3081
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3082
- "Name",
1597
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-inventory-manager__modal-actions", children: [
3083
1598
  /* @__PURE__ */ jsxRuntime.jsx(
3084
- "input",
1599
+ "button",
3085
1600
  {
3086
- type: "text",
3087
- value: editingItem.name || "",
3088
- onChange: (e) => setEditingItem((prev) => ({ ...prev, name: e.target.value }))
3089
- }
3090
- )
3091
- ] })
3092
- ] }),
3093
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3094
- "Description",
3095
- /* @__PURE__ */ jsxRuntime.jsx(
3096
- "textarea",
3097
- {
3098
- value: editingItem.description || "",
3099
- onChange: (e) => setEditingItem((prev) => ({ ...prev, description: e.target.value }))
3100
- }
3101
- )
3102
- ] }),
3103
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "form-row", children: [
3104
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3105
- "Category",
3106
- /* @__PURE__ */ jsxRuntime.jsx(
3107
- "input",
3108
- {
3109
- type: "text",
3110
- value: editingItem.category || "",
3111
- onChange: (e) => setEditingItem((prev) => ({ ...prev, category: e.target.value })),
3112
- list: "categories"
1601
+ className: "nice-inventory-manager__cancel-button",
1602
+ onClick: () => setShowItemModal(false),
1603
+ children: t("inventoryManager.cancel", "Cancel")
3113
1604
  }
3114
1605
  ),
3115
- /* @__PURE__ */ jsxRuntime.jsx("datalist", { id: "categories", children: categories.map((c) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: c }, c)) })
3116
- ] }),
3117
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3118
- "Unit",
3119
- /* @__PURE__ */ jsxRuntime.jsx(
3120
- "input",
3121
- {
3122
- type: "text",
3123
- value: editingItem.unit || "",
3124
- onChange: (e) => setEditingItem((prev) => ({ ...prev, unit: e.target.value }))
3125
- }
3126
- )
1606
+ /* @__PURE__ */ jsxRuntime.jsx("button", { className: "nice-inventory-manager__save-button", onClick: handleItemSubmit, children: editingItem.id ? "Save Changes" : "Create Item" })
3127
1607
  ] })
3128
- ] }),
3129
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "form-row", children: [
3130
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3131
- "Quantity",
3132
- /* @__PURE__ */ jsxRuntime.jsx(
3133
- "input",
3134
- {
3135
- type: "number",
3136
- value: editingItem.quantity || 0,
3137
- onChange: (e) => setEditingItem((prev) => ({ ...prev, quantity: parseInt(e.target.value) }))
3138
- }
3139
- )
3140
- ] }),
3141
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3142
- "Reorder Level",
3143
- /* @__PURE__ */ jsxRuntime.jsx(
3144
- "input",
3145
- {
3146
- type: "number",
3147
- value: editingItem.reorderLevel || 0,
3148
- onChange: (e) => setEditingItem((prev) => ({
3149
- ...prev,
3150
- reorderLevel: parseInt(e.target.value)
3151
- }))
3152
- }
3153
- )
3154
- ] }),
3155
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3156
- "Reorder Qty",
3157
- /* @__PURE__ */ jsxRuntime.jsx(
3158
- "input",
3159
- {
3160
- type: "number",
3161
- value: editingItem.reorderQuantity || 0,
3162
- onChange: (e) => setEditingItem((prev) => ({
3163
- ...prev,
3164
- reorderQuantity: parseInt(e.target.value)
3165
- }))
3166
- }
3167
- )
3168
- ] })
3169
- ] }),
3170
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3171
- "Unit Cost",
3172
- /* @__PURE__ */ jsxRuntime.jsx(
3173
- "input",
3174
- {
3175
- type: "number",
3176
- step: "0.01",
3177
- value: ((_b = editingItem.cost) == null ? void 0 : _b.amount) || 0,
3178
- onChange: (e) => setEditingItem((prev) => ({
3179
- ...prev,
3180
- cost: {
3181
- ...prev.cost,
3182
- amount: parseFloat(e.target.value)
3183
- }
3184
- }))
3185
- }
3186
- )
3187
- ] })
3188
- ] }),
3189
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-actions", children: [
3190
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "cancel-button", onClick: () => setShowItemModal(false), children: "Cancel" }),
3191
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "save-button", onClick: handleItemSubmit, children: editingItem.id ? "Save Changes" : "Create Item" })
3192
- ] })
3193
- ] }) }),
3194
- showTransactionModal && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-overlay", onClick: () => setShowTransactionModal(false), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "transaction-modal", onClick: (e) => e.stopPropagation(), children: [
3195
- /* @__PURE__ */ jsxRuntime.jsx("h3", { children: "Create Transaction" }),
3196
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-form", children: [
3197
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3198
- "Item",
3199
- /* @__PURE__ */ jsxRuntime.jsxs(
3200
- "select",
3201
- {
3202
- value: newTransaction.itemId || "",
3203
- onChange: (e) => setNewTransaction((prev) => ({ ...prev, itemId: e.target.value })),
3204
- children: [
3205
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "Select item..." }),
3206
- items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: item.id, children: [
3207
- item.sku,
3208
- " - ",
3209
- item.name
3210
- ] }, item.id))
3211
- ]
3212
- }
3213
- )
3214
- ] }),
3215
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3216
- "Type",
3217
- /* @__PURE__ */ jsxRuntime.jsxs(
3218
- "select",
3219
- {
3220
- value: newTransaction.type || "",
3221
- onChange: (e) => setNewTransaction((prev) => ({
3222
- ...prev,
3223
- type: e.target.value
3224
- })),
3225
- children: [
3226
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "Select type..." }),
3227
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "receipt", children: "Receipt" }),
3228
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "issue", children: "Issue" }),
3229
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "transfer", children: "Transfer" }),
3230
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "adjustment", children: "Adjustment" }),
3231
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "return", children: "Return" }),
3232
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "write-off", children: "Write-off" })
3233
- ]
3234
- }
3235
- )
3236
- ] }),
3237
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3238
- "Quantity",
3239
- /* @__PURE__ */ jsxRuntime.jsx(
3240
- "input",
3241
- {
3242
- type: "number",
3243
- min: "1",
3244
- value: newTransaction.quantity || "",
3245
- onChange: (e) => setNewTransaction((prev) => ({ ...prev, quantity: parseInt(e.target.value) }))
3246
- }
3247
- )
3248
- ] }),
3249
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3250
- "Reference",
3251
- /* @__PURE__ */ jsxRuntime.jsx(
3252
- "input",
3253
- {
3254
- type: "text",
3255
- value: newTransaction.reference || "",
3256
- onChange: (e) => setNewTransaction((prev) => ({ ...prev, reference: e.target.value })),
3257
- placeholder: "PO number, invoice, etc."
3258
- }
3259
- )
3260
- ] }),
3261
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
3262
- "Notes",
3263
- /* @__PURE__ */ jsxRuntime.jsx(
3264
- "textarea",
3265
- {
3266
- value: newTransaction.notes || "",
3267
- onChange: (e) => setNewTransaction((prev) => ({ ...prev, notes: e.target.value }))
3268
- }
3269
- )
3270
1608
  ] })
3271
- ] }),
3272
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-actions", children: [
3273
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "cancel-button", onClick: () => setShowTransactionModal(false), children: "Cancel" }),
3274
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "save-button", onClick: handleTransactionSubmit, children: "Create Transaction" })
3275
- ] })
3276
- ] }) })
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
+ )
3277
1722
  ] });
3278
1723
  };
3279
1724
  const STATUS_COLOR = {
@@ -3304,7 +1749,7 @@ function fmtDate$1(d, locale) {
3304
1749
  const dt = d instanceof Date ? d : new Date(d);
3305
1750
  return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
3306
1751
  }
3307
- const NiceInvoiceView = be.forwardRef(
1752
+ const NiceInvoiceView = /* @__PURE__ */ ve.forwardRef(
3308
1753
  function NiceInvoiceView2({
3309
1754
  invoice,
3310
1755
  locale,
@@ -3318,8 +1763,9 @@ const NiceInvoiceView = be.forwardRef(
3318
1763
  style,
3319
1764
  id
3320
1765
  }, ref) {
3321
- var _a2;
3322
- 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";
3323
1769
  const L = {
3324
1770
  invoiceNumber: "Invoice",
3325
1771
  issueDate: "Issue date",
@@ -3341,18 +1787,18 @@ const NiceInvoiceView = be.forwardRef(
3341
1787
  vatId: "VAT ID",
3342
1788
  ...labels
3343
1789
  };
3344
- const totals = be.useMemo(() => {
1790
+ const totals = ve.useMemo(() => {
3345
1791
  let net = 0;
3346
1792
  let vat = 0;
3347
1793
  const byRate = /* @__PURE__ */ new Map();
3348
1794
  for (const ln of invoice.lines) {
3349
1795
  const n = lineNet(ln);
3350
- const v = lineVat(ln);
1796
+ const v2 = lineVat(ln);
3351
1797
  net += n;
3352
- vat += v;
1798
+ vat += v2;
3353
1799
  const cell = byRate.get(ln.vatRate) ?? { net: 0, vat: 0 };
3354
1800
  cell.net += n;
3355
- cell.vat += v;
1801
+ cell.vat += v2;
3356
1802
  byRate.set(ln.vatRate, cell);
3357
1803
  }
3358
1804
  return { net, vat, gross: net + vat, byRate };
@@ -3392,34 +1838,31 @@ const NiceInvoiceView = be.forwardRef(
3392
1838
  className: "nice-invoice-view__status",
3393
1839
  style: { color: STATUS_COLOR[invoice.status] },
3394
1840
  children: [
3395
- /* @__PURE__ */ jsxRuntime.jsx(
3396
- "span",
3397
- {
3398
- "aria-hidden": true,
3399
- style: {
3400
- display: "inline-block",
3401
- width: 8,
3402
- height: 8,
3403
- borderRadius: "50%",
3404
- background: "currentColor"
3405
- }
3406
- }
3407
- ),
1841
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "nice-invoice-view__dot" }),
3408
1842
  " ",
3409
1843
  invoice.status
3410
1844
  ]
3411
1845
  }
3412
1846
  ),
3413
1847
  showActions && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-invoice-view__actions", children: [
3414
- /* @__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
+ ),
3415
1858
  /* @__PURE__ */ jsxRuntime.jsx(
3416
1859
  "button",
3417
1860
  {
3418
1861
  type: "button",
3419
1862
  onClick: () => onAction == null ? void 0 : onAction("print"),
3420
- "aria-label": "Print",
3421
- title: "Print",
3422
- 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 })
3423
1866
  }
3424
1867
  ),
3425
1868
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3427,9 +1870,9 @@ const NiceInvoiceView = be.forwardRef(
3427
1870
  {
3428
1871
  type: "button",
3429
1872
  onClick: () => onAction == null ? void 0 : onAction("send"),
3430
- "aria-label": "Send",
3431
- title: "Send",
3432
- 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 })
3433
1876
  }
3434
1877
  )
3435
1878
  ] })
@@ -3465,7 +1908,7 @@ const NiceInvoiceView = be.forwardRef(
3465
1908
  ] }) }),
3466
1909
  /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: invoice.lines.map((ln) => {
3467
1910
  const n = lineNet(ln);
3468
- const v = lineVat(ln);
1911
+ const v2 = lineVat(ln);
3469
1912
  return /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3470
1913
  /* @__PURE__ */ jsxRuntime.jsx("td", { children: ln.description }),
3471
1914
  /* @__PURE__ */ jsxRuntime.jsxs("td", { className: "nice-num", children: [
@@ -3478,7 +1921,7 @@ const NiceInvoiceView = be.forwardRef(
3478
1921
  "%"
3479
1922
  ] }),
3480
1923
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(n, cur, locale) }),
3481
- /* @__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) })
3482
1925
  ] }, ln.id);
3483
1926
  }) })
3484
1927
  ] }),
@@ -3491,14 +1934,14 @@ const NiceInvoiceView = be.forwardRef(
3491
1934
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.vat }),
3492
1935
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.gross })
3493
1936
  ] }) }),
3494
- /* @__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: [
3495
1938
  /* @__PURE__ */ jsxRuntime.jsxs("td", { children: [
3496
1939
  (rate * 100).toFixed(0),
3497
1940
  "%"
3498
1941
  ] }),
3499
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(c.net, cur, locale) }),
3500
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney$1(c.vat, cur, locale) }),
3501
- /* @__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) })
3502
1945
  ] }, rate)) })
3503
1946
  ] })
3504
1947
  ] }),
@@ -3518,7 +1961,7 @@ const NiceInvoiceView = be.forwardRef(
3518
1961
  ] }),
3519
1962
  !(hideSections == null ? void 0 : hideSections.timeline) && invoice.history && invoice.history.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "nice-invoice-view__timeline", children: [
3520
1963
  /* @__PURE__ */ jsxRuntime.jsx("h4", { children: L.timeline }),
3521
- /* @__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: [
3522
1965
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-invoice-view__t-date", children: fmtDate$1(h.at, locale) }),
3523
1966
  /* @__PURE__ */ jsxRuntime.jsx(
3524
1967
  "span",
@@ -3532,7 +1975,7 @@ const NiceInvoiceView = be.forwardRef(
3532
1975
  " — ",
3533
1976
  h.note
3534
1977
  ] })
3535
- ] }, i)) })
1978
+ ] }, i2)) })
3536
1979
  ] }),
3537
1980
  !(hideSections == null ? void 0 : hideSections.notes) && invoice.notes && /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "nice-invoice-view__notes", children: [
3538
1981
  /* @__PURE__ */ jsxRuntime.jsx("h4", { children: L.notes }),
@@ -3543,6 +1986,7 @@ const NiceInvoiceView = be.forwardRef(
3543
1986
  );
3544
1987
  }
3545
1988
  );
1989
+ const EMPTY_CELLS = [];
3546
1990
  function colorFor(occ, colors) {
3547
1991
  if (occ <= 0.01) {
3548
1992
  return colors.low;
@@ -3555,11 +1999,15 @@ function colorFor(occ, colors) {
3555
1999
  }
3556
2000
  return colors.high;
3557
2001
  }
3558
- const NiceWarehouseView = be.forwardRef(
2002
+ const NiceWarehouseView = /* @__PURE__ */ ve.forwardRef(
3559
2003
  function NiceWarehouseView2({
3560
2004
  warehouseName,
3561
- cells,
3562
- 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
+ },
3563
2011
  onCellClick,
3564
2012
  showLegend = true,
3565
2013
  cellSize = 48,
@@ -3568,36 +2016,44 @@ const NiceWarehouseView = be.forwardRef(
3568
2016
  style,
3569
2017
  id
3570
2018
  }, ref) {
3571
- const [hovered, setHovered] = be.useState(null);
3572
- const grid = be.useMemo(() => {
2019
+ const { t } = v();
2020
+ const [hovered, setHovered] = ve.useState(null);
2021
+ const grid = ve.useMemo(() => {
3573
2022
  const rows = /* @__PURE__ */ new Map();
3574
- for (const c of cells) {
3575
- 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";
3576
2025
  let arr = rows.get(rowKey);
3577
2026
  if (!arr) {
3578
2027
  arr = [];
3579
2028
  rows.set(rowKey, arr);
3580
2029
  }
3581
- arr.push(c);
2030
+ arr.push(c2);
3582
2031
  }
3583
2032
  return [...rows.entries()].map(([rowKey, arr]) => ({ rowKey, cells: arr }));
3584
2033
  }, [cells]);
3585
2034
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, id, className: `nice-warehouse-view ${className ?? ""}`, style, children: [
3586
2035
  /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "nice-warehouse-view__header", children: [
3587
2036
  /* @__PURE__ */ jsxRuntime.jsx("h3", { children: warehouseName }),
3588
- showLegend && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-warehouse-view__legend", "aria-label": "Occupancy legend", children: [
3589
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.low } }),
3590
- " low",
3591
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.mid } }),
3592
- " mid",
3593
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { background: colors.high } }),
3594
- " high"
3595
- ] })
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
+ )
3596
2052
  ] }),
3597
- /* @__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) => {
3598
- 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);
3599
2055
  const aisleBreak = aisleEvery > 0 && idx > 0 && idx % aisleEvery === 0;
3600
- return /* @__PURE__ */ jsxRuntime.jsxs(be.Fragment, { children: [
2056
+ return /* @__PURE__ */ jsxRuntime.jsxs(ve.Fragment, { children: [
3601
2057
  aisleBreak && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-warehouse-view__aisle", "aria-hidden": true }),
3602
2058
  /* @__PURE__ */ jsxRuntime.jsx(
3603
2059
  "button",
@@ -3608,13 +2064,13 @@ const NiceWarehouseView = be.forwardRef(
3608
2064
  style: {
3609
2065
  width: cellSize,
3610
2066
  height: cellSize,
3611
- background: colorFor(c.occupancy, colors)
2067
+ background: colorFor(c2.occupancy, colors)
3612
2068
  },
3613
- title: `${key} — ${(c.occupancy * 100).toFixed(0)}% (${c.items.length} items)`,
3614
- onClick: () => onCellClick == null ? void 0 : onCellClick(c),
3615
- 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),
3616
2072
  onMouseLeave: () => setHovered(null),
3617
- 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 ?? "" })
3618
2074
  }
3619
2075
  )
3620
2076
  ] }, key);
@@ -3648,14 +2104,15 @@ const NiceWarehouseView = be.forwardRef(
3648
2104
  ] });
3649
2105
  }
3650
2106
  );
2107
+ const EMPTY_ORDERS = [];
3651
2108
  const STATUS_TINT = {
3652
- draft: "#6b7280",
3653
- "pending-approval": "#ca8a04",
3654
- approved: "#2563eb",
3655
- ordered: "#0891b2",
3656
- "partially-received": "#9333ea",
3657
- received: "#16a34a",
3658
- 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)"
3659
2116
  };
3660
2117
  function fmtMoney(amount, currency, locale) {
3661
2118
  const code = typeof currency === "string" ? currency : currency.code;
@@ -3671,168 +2128,156 @@ function fmtDate(d, locale) {
3671
2128
  const dt = d instanceof Date ? d : new Date(d);
3672
2129
  return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
3673
2130
  }
3674
- const NicePurchaseOrder = be.forwardRef(
3675
- function NicePurchaseOrder2({
3676
- orders,
3677
- selectable = true,
3678
- initialSelectedId,
3679
- locale,
3680
- labels,
3681
- readOnly,
3682
- onOrderApprove,
3683
- onReceiveItems,
3684
- onOrderUpdate,
3685
- className,
3686
- style,
3687
- id
3688
- }, ref) {
3689
- var _a2;
3690
- const [selectedId, setSelectedId] = be.useState(
3691
- initialSelectedId ?? ((_a2 = orders[0]) == null ? void 0 : _a2.id)
3692
- );
3693
- const L = {
3694
- orderNumber: "PO #",
3695
- supplier: "Supplier",
3696
- status: "Status",
3697
- orderDate: "Ordered",
3698
- expected: "Expected",
3699
- total: "Total",
3700
- sku: "SKU",
3701
- name: "Item",
3702
- qty: "Qty",
3703
- received: "Recv",
3704
- unitPrice: "Unit",
3705
- lineTotal: "Subtotal",
3706
- notes: "Notes",
3707
- approve: "Approve",
3708
- receive: "Receive all",
3709
- ...labels
3710
- };
3711
- const selected = be.useMemo(
3712
- () => orders.find((o) => o.id === selectedId),
3713
- [orders, selectedId]
3714
- );
3715
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, id, className: `nice-purchase-order ${className ?? ""}`, style, children: [
3716
- /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "nice-purchase-order__list", children: [
3717
- /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3718
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.orderNumber }),
3719
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.supplier }),
3720
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.status }),
3721
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.orderDate }),
3722
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.expected }),
3723
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.total })
3724
- ] }) }),
3725
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: orders.map((o) => /* @__PURE__ */ jsxRuntime.jsxs(
3726
- "tr",
3727
- {
3728
- "aria-selected": o.id === selectedId,
3729
- className: o.id === selectedId ? "is-selected" : void 0,
3730
- onClick: () => selectable && setSelectedId(o.id),
3731
- children: [
3732
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: o.orderNumber }),
3733
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: o.supplier.name }),
3734
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { color: STATUS_TINT[o.status] }, children: [
3735
- /* @__PURE__ */ jsxRuntime.jsx(
3736
- "span",
3737
- {
3738
- "aria-hidden": true,
3739
- style: {
3740
- display: "inline-block",
3741
- width: 8,
3742
- height: 8,
3743
- borderRadius: "50%",
3744
- background: "currentColor"
3745
- }
3746
- }
3747
- ),
3748
- " ",
3749
- o.status
3750
- ] }) }),
3751
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: fmtDate(o.orderDate, locale) }),
3752
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: fmtDate(o.expectedDelivery, locale) }),
3753
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(o.total.amount, o.total.currency, locale) })
3754
- ]
3755
- },
3756
- o.id
3757
- )) })
3758
- ] }),
3759
- selectable && selected && /* @__PURE__ */ jsxRuntime.jsxs(
3760
- "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",
3761
2184
  {
3762
- className: "nice-purchase-order__detail",
3763
- "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),
3764
2188
  children: [
3765
- /* @__PURE__ */ jsxRuntime.jsxs("header", { children: [
3766
- /* @__PURE__ */ jsxRuntime.jsxs("h3", { children: [
3767
- selected.orderNumber,
3768
- " — ",
3769
- selected.supplier.name
3770
- ] }),
3771
- !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-purchase-order__actions", children: [
3772
- selected.status === "pending-approval" && onOrderApprove && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => onOrderApprove(selected.id), children: L.approve }),
3773
- (selected.status === "ordered" || selected.status === "partially-received") && onReceiveItems && /* @__PURE__ */ jsxRuntime.jsx(
3774
- "button",
3775
- {
3776
- type: "button",
3777
- onClick: () => onReceiveItems(
3778
- selected.id,
3779
- selected.items.map((it) => ({
3780
- itemId: it.itemId,
3781
- quantity: it.quantity - (it.receivedQuantity ?? 0)
3782
- }))
3783
- ),
3784
- children: L.receive
3785
- }
3786
- ),
3787
- onOrderUpdate && selected.status === "draft" && /* @__PURE__ */ jsxRuntime.jsx(
3788
- "button",
3789
- {
3790
- type: "button",
3791
- onClick: () => onOrderUpdate({ ...selected, status: "pending-approval" }),
3792
- children: "Submit"
3793
- }
3794
- )
3795
- ] })
3796
- ] }),
3797
- /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "nice-purchase-order__items", children: [
3798
- /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3799
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.sku }),
3800
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.name }),
3801
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.qty }),
3802
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.received }),
3803
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.unitPrice }),
3804
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.lineTotal })
3805
- ] }) }),
3806
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: selected.items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3807
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: it.sku }),
3808
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: it.itemName }),
3809
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: it.quantity }),
3810
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: it.receivedQuantity ?? 0 }),
3811
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(it.unitPrice.amount, it.unitPrice.currency, locale) }),
3812
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: fmtMoney(it.lineTotal.amount, it.lineTotal.currency, locale) })
3813
- ] }, it.itemId)) }),
3814
- /* @__PURE__ */ jsxRuntime.jsx("tfoot", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
3815
- /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "nice-num", children: L.total }),
3816
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: fmtMoney(selected.total.amount, selected.total.currency, locale) }) })
3817
- ] }) })
3818
- ] }),
3819
- selected.notes && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "nice-purchase-order__notes", children: [
3820
- /* @__PURE__ */ jsxRuntime.jsxs("strong", { children: [
3821
- L.notes,
3822
- ":"
3823
- ] }),
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" }),
3824
2193
  " ",
3825
- selected.notes
3826
- ] })
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) })
3827
2199
  ]
3828
- }
3829
- )
3830
- ] });
3831
- }
3832
- );
3833
- 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(
3834
2279
  function NiceHRDashboard2({
3835
- employees,
2280
+ employees = EMPTY_EMPLOYEES,
3836
2281
  labels,
3837
2282
  hideWidgets,
3838
2283
  locale,
@@ -3842,6 +2287,7 @@ const NiceHRDashboard = be.forwardRef(
3842
2287
  style,
3843
2288
  id
3844
2289
  }, ref) {
2290
+ const { t } = v();
3845
2291
  const L = {
3846
2292
  headcount: "Headcount",
3847
2293
  fte: "FTE",
@@ -3851,7 +2297,7 @@ const NiceHRDashboard = be.forwardRef(
3851
2297
  activeEmployees: "Active",
3852
2298
  ...labels
3853
2299
  };
3854
- const stats = be.useMemo(() => {
2300
+ const stats = ve.useMemo(() => {
3855
2301
  const active = employees.filter((e) => e.active !== false);
3856
2302
  const fte = active.reduce((s, e) => s + (e.fte ?? 1), 0);
3857
2303
  const vacationAvg = active.length === 0 ? 0 : active.reduce((s, e) => s + (e.vacationBalanceDays ?? 0), 0) / active.length;
@@ -3892,7 +2338,7 @@ const NiceHRDashboard = be.forwardRef(
3892
2338
  className: `nice-hr-dashboard nice-hr-dashboard--${density} ${className ?? ""}`,
3893
2339
  style,
3894
2340
  role: "group",
3895
- "aria-label": "HR dashboard",
2341
+ "aria-label": t("hrDashboard.hrDashboard", "HR dashboard"),
3896
2342
  children: [
3897
2343
  !(hideWidgets == null ? void 0 : hideWidgets.headcount) && /* @__PURE__ */ jsxRuntime.jsx(
3898
2344
  Widget,
@@ -3964,11 +2410,11 @@ const DEFAULT_SEED = {
3964
2410
  };
3965
2411
  function useMockErpApi(options = {}) {
3966
2412
  const { latencyMs = 300, errorRate = 0, seed } = options;
3967
- const [loading, setLoading] = be.useState(true);
3968
- const [error, setError] = be.useState(null);
3969
- const [data, setData] = be.useState(() => ({ ...DEFAULT_SEED, ...seed }));
3970
- const settledRef = be.useRef(false);
3971
- 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 () => {
3972
2418
  setLoading(true);
3973
2419
  setError(null);
3974
2420
  await wait(latencyMs);
@@ -3979,14 +2425,14 @@ function useMockErpApi(options = {}) {
3979
2425
  }
3980
2426
  setLoading(false);
3981
2427
  }, [latencyMs, errorRate]);
3982
- be.useEffect(() => {
2428
+ ve.useEffect(() => {
3983
2429
  if (settledRef.current) {
3984
2430
  return;
3985
2431
  }
3986
2432
  settledRef.current = true;
3987
2433
  void refresh();
3988
2434
  }, [refresh]);
3989
- const writeWith = be.useCallback(
2435
+ const writeWith = ve.useCallback(
3990
2436
  async (key, item) => {
3991
2437
  await wait(latencyMs);
3992
2438
  if (Math.random() < errorRate) {
@@ -3994,7 +2440,7 @@ function useMockErpApi(options = {}) {
3994
2440
  }
3995
2441
  setData((d) => {
3996
2442
  const arr = [...d[key]];
3997
- const idx = arr.findIndex((i) => i.id === item.id);
2443
+ const idx = arr.findIndex((i2) => i2.id === item.id);
3998
2444
  if (idx >= 0) {
3999
2445
  arr[idx] = item;
4000
2446
  } else {
@@ -4005,7 +2451,7 @@ function useMockErpApi(options = {}) {
4005
2451
  },
4006
2452
  [latencyMs, errorRate]
4007
2453
  );
4008
- return be.useMemo(
2454
+ return ve.useMemo(
4009
2455
  () => ({
4010
2456
  loading,
4011
2457
  error,
@@ -4017,118 +2463,127 @@ function useMockErpApi(options = {}) {
4017
2463
  resources: data.resources,
4018
2464
  vatRates: data.vatRates,
4019
2465
  refresh,
4020
- upsertInvoice: (i) => writeWith("invoices", i),
2466
+ upsertInvoice: (i2) => writeWith("invoices", i2),
4021
2467
  upsertPurchaseOrder: (p) => writeWith("purchaseOrders", p),
4022
- upsertInventory: (i) => writeWith("inventory", i)
2468
+ upsertInventory: (i2) => writeWith("inventory", i2)
4023
2469
  }),
4024
2470
  [loading, error, data, refresh, writeWith]
4025
2471
  );
4026
2472
  }
4027
- const NiceVatTable = be.forwardRef(function NiceVatTable2({
4028
- country = "PL",
4029
- rates,
4030
- editable = false,
4031
- onChange,
4032
- onRemove,
4033
- locale,
4034
- labels,
4035
- density = "comfortable",
4036
- className,
4037
- style,
4038
- id
4039
- }, ref) {
4040
- const [internal, setInternal] = be.useState(rates ?? NICE_VAT_PRESETS[country]);
4041
- const L = {
4042
- code: "Code",
4043
- rate: "Rate",
4044
- label: "Label",
4045
- description: "Description",
4046
- add: "+ Add",
4047
- remove: "Remove",
4048
- ...labels
4049
- };
4050
- const update = be.useCallback(
4051
- (next) => {
4052
- setInternal(next);
4053
- onChange == null ? void 0 : onChange(next);
4054
- },
4055
- [onChange]
4056
- );
4057
- const onCellEdit = (idx, key, raw) => {
4058
- const next = [...internal];
4059
- const r = { ...next[idx] };
4060
- if (key === "rate") {
4061
- const n = Number(raw.replace(",", "."));
4062
- if (!Number.isFinite(n)) {
4063
- 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;
4064
2515
  }
4065
- r.rate = n > 1 ? n / 100 : n;
4066
- } else if (key === "code" || key === "label" || key === "description") {
4067
- r[key] = raw;
4068
- }
4069
- next[idx] = r;
4070
- update(next);
4071
- };
4072
- const addRow = () => {
4073
- update([...internal, { code: `NEW-${internal.length + 1}`, rate: 0, label: "0%" }]);
4074
- };
4075
- const removeRow = (idx) => {
4076
- const code = internal[idx].code;
4077
- const next = internal.filter((_, i) => i !== idx);
4078
- update(next);
4079
- onRemove == null ? void 0 : onRemove(code);
4080
- };
4081
- return /* @__PURE__ */ jsxRuntime.jsxs(
4082
- "div",
4083
- {
4084
- ref,
4085
- id,
4086
- className: `nice-vat-table nice-vat-table--${density} ${className ?? ""}`,
4087
- style,
4088
- children: [
4089
- /* @__PURE__ */ jsxRuntime.jsxs("table", { children: [
4090
- /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
4091
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.code }),
4092
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "nice-num", children: L.rate }),
4093
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.label }),
4094
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: L.description }),
4095
- editable && /* @__PURE__ */ jsxRuntime.jsx("th", { "aria-label": L.remove })
4096
- ] }) }),
4097
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: internal.map((r, idx) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
4098
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx("input", { value: r.code, onChange: (e) => onCellEdit(idx, "code", e.target.value) }) : r.code }),
4099
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "nice-num", children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
4100
- "input",
4101
- {
4102
- type: "number",
4103
- step: "0.01",
4104
- min: 0,
4105
- max: 1,
4106
- value: r.rate,
4107
- onChange: (e) => onCellEdit(idx, "rate", e.target.value)
4108
- }
4109
- ) : `${(r.rate * 100).toLocaleString(locale, { maximumFractionDigits: 2 })}%` }),
4110
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
4111
- "input",
4112
- {
4113
- value: r.label ?? "",
4114
- onChange: (e) => onCellEdit(idx, "label", e.target.value)
4115
- }
4116
- ) : r.label ?? "" }),
4117
- /* @__PURE__ */ jsxRuntime.jsx("td", { children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
4118
- "input",
4119
- {
4120
- value: r.description ?? "",
4121
- onChange: (e) => onCellEdit(idx, "description", e.target.value)
4122
- }
4123
- ) : r.description ?? "" }),
4124
- editable && /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => removeRow(idx), "aria-label": L.remove, children: "×" }) })
4125
- ] }, r.code)) })
4126
- ] }),
4127
- editable && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-vat-table__add", onClick: addRow, children: L.add })
4128
- ]
4129
- }
4130
- );
4131
- });
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 = [];
4132
2587
  function pad(n) {
4133
2588
  return n < 10 ? `0${n}` : String(n);
4134
2589
  }
@@ -4169,9 +2624,9 @@ function defaultBuildXml(opts) {
4169
2624
  let vat = 0;
4170
2625
  for (const ln of inv.lines) {
4171
2626
  const n = Math.round(ln.quantity * ln.unitPrice.amount * (1 - (ln.discount ?? 0)));
4172
- const v = Math.round(n * ln.vatRate);
2627
+ const v2 = Math.round(n * ln.vatRate);
4173
2628
  net += n;
4174
- vat += v;
2629
+ vat += v2;
4175
2630
  }
4176
2631
  lines.push(` <SumaNetto>${(net / 100).toFixed(2)}</SumaNetto>`);
4177
2632
  lines.push(` <SumaVAT>${(vat / 100).toFixed(2)}</SumaVAT>`);
@@ -4181,9 +2636,9 @@ function defaultBuildXml(opts) {
4181
2636
  lines.push("</JPK>");
4182
2637
  return lines.join("\n");
4183
2638
  }
4184
- const NiceJpkExporter = be.forwardRef(
2639
+ const NiceJpkExporter = /* @__PURE__ */ ve.forwardRef(
4185
2640
  function NiceJpkExporter2({
4186
- invoices,
2641
+ invoices = EMPTY_INVOICES,
4187
2642
  taxpayer,
4188
2643
  defaultFormat = "JPK_V7M",
4189
2644
  defaultPeriod,
@@ -4196,11 +2651,11 @@ const NiceJpkExporter = be.forwardRef(
4196
2651
  id
4197
2652
  }, ref) {
4198
2653
  const today = /* @__PURE__ */ new Date();
4199
- const [format, setFormat] = be.useState(defaultFormat);
4200
- const [from, setFrom] = be.useState(
2654
+ const [format, setFormat] = ve.useState(defaultFormat);
2655
+ const [from, setFrom] = ve.useState(
4201
2656
  isoDate((defaultPeriod == null ? void 0 : defaultPeriod.from) ?? new Date(today.getFullYear(), today.getMonth(), 1))
4202
2657
  );
4203
- const [to, setTo] = be.useState(
2658
+ const [to, setTo] = ve.useState(
4204
2659
  isoDate((defaultPeriod == null ? void 0 : defaultPeriod.to) ?? new Date(today.getFullYear(), today.getMonth() + 1, 0))
4205
2660
  );
4206
2661
  const L = {
@@ -4210,7 +2665,7 @@ const NiceJpkExporter = be.forwardRef(
4210
2665
  export: "Export",
4211
2666
  ...labels
4212
2667
  };
4213
- const exportNow = be.useCallback(() => {
2668
+ const exportNow = ve.useCallback(() => {
4214
2669
  const opts = {
4215
2670
  format,
4216
2671
  period: { from: new Date(from), to: new Date(to) },
@@ -4223,12 +2678,12 @@ const NiceJpkExporter = be.forwardRef(
4223
2678
  onExport == null ? void 0 : onExport(xml, blob, opts);
4224
2679
  if (typeof window !== "undefined" && typeof URL.createObjectURL === "function") {
4225
2680
  const url = URL.createObjectURL(blob);
4226
- const a = document.createElement("a");
4227
- a.href = url;
4228
- a.download = filename;
4229
- document.body.appendChild(a);
4230
- a.click();
4231
- 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();
4232
2687
  URL.revokeObjectURL(url);
4233
2688
  }
4234
2689
  }, [format, from, to, taxpayer, invoices, buildXml, onExport, filenameFor]);
@@ -4265,12 +2720,12 @@ const NiceJpkExporter = be.forwardRef(
4265
2720
  }
4266
2721
  );
4267
2722
  exports.NICE_VAT_PRESETS = NICE_VAT_PRESETS;
2723
+ exports.NiceCapacityPlanner = NiceCapacityPlanner;
4268
2724
  exports.NiceHRDashboard = NiceHRDashboard;
4269
2725
  exports.NiceInventoryManager = NiceInventoryManager;
4270
2726
  exports.NiceInvoiceView = NiceInvoiceView;
4271
2727
  exports.NiceJpkExporter = NiceJpkExporter;
4272
2728
  exports.NicePurchaseOrder = NicePurchaseOrder;
4273
- exports.NiceResourceAllocation = NiceResourceAllocation;
4274
2729
  exports.NiceVatTable = NiceVatTable;
4275
2730
  exports.NiceWarehouseView = NiceWarehouseView;
4276
2731
  exports.buildJpkXml = defaultBuildXml;