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