@nice2dev/ui-erp 1.2.0 → 1.2.1

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