@nice2dev/ui-erp 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.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,42 @@ 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
+ // 1.2.2: geometry tools and object grouping, drawn as glyphs before (Ntd* of the same names in icons)
219
+ point: "M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z M12 12h.01",
220
+ segment: "M6.5 17.5L17.5 6.5 M3 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0 M17 5a2 2 0 1 0 4 0a2 2 0 1 0-4 0",
221
+ perpendicular: "M3 20h18 M12 20V4 M12 15h5v5",
222
+ parallel: "M4 16L14 6 M10 20L20 10",
223
+ midpoint: "M3 12h6 M15 12h6 M3 9v6 M21 9v6 M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6z",
224
+ "angle-bisector": "M4 20h17 M4 20L16 5 M4 20l14.4-6.9 M10 20a6 6 0 0 0-2.25-4.68",
225
+ group: "M3 7V3h4 M17 3h4v4 M21 17v4h-4 M7 21H3v-4 M7 7h5v5H7z M12 12h5v5h-5z",
226
+ ungroup: "M3 3h8v8H3z M13 13h8v8h-8z"
227
+ }, la = {
224
228
  xs: 12,
225
229
  sm: 16,
226
230
  md: 20,
227
231
  lg: 24,
228
232
  xl: 32
229
- }, gt = createContext({});
230
- function la({
233
+ }, gt = /* @__PURE__ */ createContext({});
234
+ function da({
231
235
  path: e,
232
236
  size: t,
233
237
  className: r,
234
- style: a,
238
+ style: a2,
235
239
  color: n,
236
240
  title: o,
237
- onClick: i
241
+ onClick: i2
238
242
  }) {
239
243
  return /* @__PURE__ */ jsxs(
240
244
  "svg",
@@ -249,11 +253,11 @@ function la({
249
253
  strokeLinecap: "round",
250
254
  strokeLinejoin: "round",
251
255
  className: `nice-icon ${r || ""}`,
252
- style: a,
256
+ style: a2,
253
257
  role: o ? "img" : "presentation",
254
258
  "aria-label": o,
255
259
  "aria-hidden": !o,
256
- onClick: i,
260
+ onClick: i2,
257
261
  children: [
258
262
  o && /* @__PURE__ */ jsx("title", { children: o }),
259
263
  /* @__PURE__ */ jsx("path", { d: e })
@@ -261,1726 +265,51 @@ function la({
261
265
  }
262
266
  );
263
267
  }
264
- const Ae = ({
268
+ const ae = ({
265
269
  name: e,
266
270
  size: t = "md",
267
271
  className: r,
268
- style: a,
272
+ style: a2,
269
273
  color: n,
270
274
  title: o,
271
- onClick: i
275
+ onClick: i2
272
276
  }) => {
273
- const { resolver: s } = useContext(gt), c = typeof t == "number" ? t : ca[t];
277
+ const { resolver: s } = useContext(gt), c2 = typeof t == "number" ? t : la[t];
274
278
  if (s) {
275
- const d = s(e, c);
279
+ const d = s(e, c2);
276
280
  if (d)
277
- return /* @__PURE__ */ jsx("span", { className: `nice-icon-wrap ${r || ""}`, style: a, onClick: i, children: d });
281
+ return /* @__PURE__ */ jsx("span", { className: `nice-icon-wrap ${r || ""}`, style: a2, onClick: i2, children: d });
278
282
  }
279
- const l = er[e];
283
+ const l = tr[e];
280
284
  return l ? /* @__PURE__ */ jsx(
281
- la,
285
+ da,
282
286
  {
283
287
  path: l,
284
- size: c,
288
+ size: c2,
285
289
  className: r,
286
- style: a,
290
+ style: a2,
287
291
  color: n,
288
292
  title: o,
289
- onClick: i
293
+ onClick: i2
290
294
  }
291
295
  ) : null;
292
296
  };
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";
297
+ process.env.NODE_ENV !== "production" && "NiceRTLProvider";
298
+ process.env.NODE_ENV !== "production" && "NiceAccessControl";
299
+ process.env.NODE_ENV !== "production" && "NiceA11yProvider";
300
+ process.env.NODE_ENV !== "production" && "NiceVisuallyHidden";
301
+ process.env.NODE_ENV !== "production" && "NiceSkipLink";
302
+ process.env.NODE_ENV !== "production" && "NiceKeyboardHint";
303
+ process.env.NODE_ENV !== "production" && "NiceThemeProvider";
304
+ process.env.NODE_ENV !== "production" && "NiceTestWrapper";
1941
305
  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);
306
+ process.env.NODE_ENV === "development";
307
+ process.env.NODE_ENV !== "production" && "NiceHelpProvider";
308
+ process.env.NODE_ENV !== "production" && "NiceInlineHelp";
309
+ process.env.NODE_ENV !== "production" && "NiceQuickHelp";
310
+ process.env.NODE_ENV !== "production" && "NiceHelpIcon";
311
+ const EMPTY_RESOURCES = [];
312
+ const EMPTY_ALLOCATIONS = [];
1984
313
  const DEFAULT_VIEW_CONFIG$1 = {
1985
314
  timeUnit: "day",
1986
315
  showUtilization: true,
@@ -1997,8 +326,8 @@ const TIME_INCREMENTS = {
1997
326
  year: 365 * 24 * 60 * 60 * 1e3
1998
327
  };
1999
328
  const NiceCapacityPlanner = ({
2000
- resources,
2001
- allocations,
329
+ resources = EMPTY_RESOURCES,
330
+ allocations = EMPTY_ALLOCATIONS,
2002
331
  dateRange,
2003
332
  viewConfig: externalConfig,
2004
333
  onAllocationCreate,
@@ -2008,7 +337,8 @@ const NiceCapacityPlanner = ({
2008
337
  readOnly = false,
2009
338
  className = ""
2010
339
  }) => {
2011
- var _a2, _b;
340
+ var _a, _b;
341
+ const { t } = v();
2012
342
  const config = { ...DEFAULT_VIEW_CONFIG$1, ...externalConfig };
2013
343
  const [selectedAllocation, setSelectedAllocation] = useState(null);
2014
344
  const [hoveredCell, setHoveredCell] = useState(null);
@@ -2035,15 +365,15 @@ const NiceCapacityPlanner = ({
2035
365
  timePeriods.forEach((period) => {
2036
366
  const periodStart = period.getTime();
2037
367
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2038
- const periodAllocations = allocations.filter((a) => {
2039
- if (a.resourceId !== resource.id) {
368
+ const periodAllocations = allocations.filter((a2) => {
369
+ if (a2.resourceId !== resource.id) {
2040
370
  return false;
2041
371
  }
2042
- const allocStart = a.start.getTime();
2043
- const allocEnd = a.end.getTime();
372
+ const allocStart = a2.start.getTime();
373
+ const allocEnd = a2.end.getTime();
2044
374
  return allocStart < periodEnd && allocEnd > periodStart;
2045
375
  });
2046
- const allocatedHours = periodAllocations.reduce((sum, a) => sum + a.hoursPerDay, 0);
376
+ const allocatedHours = periodAllocations.reduce((sum, a2) => sum + a2.hoursPerDay, 0);
2047
377
  const availableHours = resource.maxCapacity;
2048
378
  const utilizationPercent = availableHours > 0 ? allocatedHours / availableHours * 100 : 0;
2049
379
  resourceMap.set(periodStart, {
@@ -2067,12 +397,12 @@ const NiceCapacityPlanner = ({
2067
397
  if (util.overallocated) {
2068
398
  const period = new Date(periodStart);
2069
399
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2070
- const conflictAllocations = allocations.filter((a) => {
2071
- if (a.resourceId !== resourceId) {
400
+ const conflictAllocations = allocations.filter((a2) => {
401
+ if (a2.resourceId !== resourceId) {
2072
402
  return false;
2073
403
  }
2074
- const allocStart = a.start.getTime();
2075
- const allocEnd = a.end.getTime();
404
+ const allocStart = a2.start.getTime();
405
+ const allocEnd = a2.end.getTime();
2076
406
  return allocStart < periodEnd && allocEnd > periodStart;
2077
407
  });
2078
408
  conflictList.push({
@@ -2091,20 +421,20 @@ const NiceCapacityPlanner = ({
2091
421
  (resourceId, date) => {
2092
422
  const periodStart = date.getTime();
2093
423
  const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
2094
- return allocations.filter((a) => {
2095
- if (a.resourceId !== resourceId) {
424
+ return allocations.filter((a2) => {
425
+ if (a2.resourceId !== resourceId) {
2096
426
  return false;
2097
427
  }
2098
- const allocStart = a.start.getTime();
2099
- const allocEnd = a.end.getTime();
428
+ const allocStart = a2.start.getTime();
429
+ const allocEnd = a2.end.getTime();
2100
430
  return allocStart < periodEnd && allocEnd > periodStart;
2101
431
  });
2102
432
  },
2103
433
  [allocations, timeUnit]
2104
434
  );
2105
435
  const getCellColor = (resourceId, date) => {
2106
- var _a3;
2107
- const util = (_a3 = utilizationMap.get(resourceId)) == null ? void 0 : _a3.get(date.getTime());
436
+ var _a2;
437
+ const util = (_a2 = utilizationMap.get(resourceId)) == null ? void 0 : _a2.get(date.getTime());
2108
438
  if (!util) {
2109
439
  return "transparent";
2110
440
  }
@@ -2134,7 +464,7 @@ const NiceCapacityPlanner = ({
2134
464
  }
2135
465
  };
2136
466
  const handleCellClick = (resourceId, date) => {
2137
- var _a3;
467
+ var _a2;
2138
468
  if (readOnly) {
2139
469
  return;
2140
470
  }
@@ -2142,7 +472,7 @@ const NiceCapacityPlanner = ({
2142
472
  resourceId,
2143
473
  start: date,
2144
474
  end: new Date(date.getTime() + TIME_INCREMENTS[timeUnit]),
2145
- hoursPerDay: ((_a3 = resources.find((r) => r.id === resourceId)) == null ? void 0 : _a3.maxCapacity) || 8,
475
+ hoursPerDay: ((_a2 = resources.find((r) => r.id === resourceId)) == null ? void 0 : _a2.maxCapacity) || 8,
2146
476
  status: "tentative"
2147
477
  });
2148
478
  setShowAllocationModal(true);
@@ -2189,122 +519,124 @@ const NiceCapacityPlanner = ({
2189
519
  }
2190
520
  };
2191
521
  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: [
522
+ /* @__PURE__ */ jsxs("header", { className: "nice-resource-allocation__toolbar", children: [
523
+ /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__toolbar-left", children: [
524
+ /* @__PURE__ */ jsx("h2", { children: t("capacityPlanner.resourceAllocation", "Resource Allocation") }),
525
+ /* @__PURE__ */ jsxs("span", { className: "nice-resource-allocation__date-range", children: [
2196
526
  dateRange.start.toLocaleDateString(),
2197
527
  " - ",
2198
528
  dateRange.end.toLocaleDateString()
2199
529
  ] })
2200
530
  ] }),
2201
- /* @__PURE__ */ jsx("div", { className: "toolbar__center", children: /* @__PURE__ */ jsx("div", { className: "time-unit-selector", children: ["day", "week", "month"].map((unit) => /* @__PURE__ */ jsx(
531
+ /* @__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
532
  "button",
2203
533
  {
2204
- className: `unit-button ${timeUnit === unit ? "unit-button--active" : ""}`,
534
+ className: `nice-resource-allocation__unit-button ${timeUnit === unit ? "nice-resource-allocation__unit-button--active" : ""}`,
2205
535
  onClick: () => setTimeUnit(unit),
2206
536
  children: unit.charAt(0).toUpperCase() + unit.slice(1)
2207
537
  },
2208
538
  unit
2209
539
  )) }) }),
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" : ""
540
+ /* @__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: [
541
+ /* @__PURE__ */ jsx("span", { className: "nice-resource-allocation__badge-icon", children: /* @__PURE__ */ jsx(ae, { name: "warning", size: 14 }) }),
542
+ (conflicts.length === 1 ? t("capacityPlanner.oneConflict", "1 Conflict") : t("capacityPlanner.conflicts", "{count} Conflicts")).replace("{count}", String(conflicts.length))
2215
543
  ] }) })
2216
544
  ] }),
2217
- /* @__PURE__ */ jsxs("div", { className: "allocation__legend", children: [
2218
- /* @__PURE__ */ jsxs("div", { className: "legend-item", children: [
545
+ /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__legend", children: [
546
+ /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__legend-item", children: [
2219
547
  /* @__PURE__ */ jsx(
2220
548
  "span",
2221
549
  {
2222
- className: "legend-color",
550
+ className: "nice-resource-allocation__legend-color",
2223
551
  style: { backgroundColor: "var(--nice-success-tint-20, rgba(34, 197, 94, 0.2))" }
2224
552
  }
2225
553
  ),
2226
- /* @__PURE__ */ jsx("span", { children: "Allocated" })
554
+ /* @__PURE__ */ jsx("span", { children: t("capacityPlanner.allocated", "Allocated") })
2227
555
  ] }),
2228
- /* @__PURE__ */ jsxs("div", { className: "legend-item", children: [
556
+ /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__legend-item", children: [
2229
557
  /* @__PURE__ */ jsx(
2230
558
  "span",
2231
559
  {
2232
- className: "legend-color",
560
+ className: "nice-resource-allocation__legend-color",
2233
561
  style: { backgroundColor: "var(--nice-warning-tint-30, rgba(245, 158, 11, 0.3))" }
2234
562
  }
2235
563
  ),
2236
- /* @__PURE__ */ jsxs("span", { children: [
2237
- "High Utilization (",
2238
- ">",
2239
- "=",
2240
- config.utilizationThreshold,
2241
- "%)"
2242
- ] })
564
+ /* @__PURE__ */ jsx("span", { children: t(
565
+ "capacityPlanner.highUtilization",
566
+ "High Utilization (>={utilizationThreshold}%)"
567
+ ).replace("{utilizationThreshold}", String(config.utilizationThreshold)) })
2243
568
  ] }),
2244
- /* @__PURE__ */ jsxs("div", { className: "legend-item", children: [
569
+ /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__legend-item", children: [
2245
570
  /* @__PURE__ */ jsx(
2246
571
  "span",
2247
572
  {
2248
- className: "legend-color",
573
+ className: "nice-resource-allocation__legend-color",
2249
574
  style: { backgroundColor: "var(--nice-danger-tint-40, rgba(239, 68, 68, 0.4))" }
2250
575
  }
2251
576
  ),
2252
- /* @__PURE__ */ jsx("span", { children: "Overallocated" })
577
+ /* @__PURE__ */ jsx("span", { children: t("capacityPlanner.overallocated", "Overallocated") })
2253
578
  ] })
2254
579
  ] }),
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)) })
580
+ /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__grid", children: [
581
+ /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__grid-header", children: [
582
+ /* @__PURE__ */ jsx("div", { className: "nice-resource-allocation__resource-header", children: t("capacityPlanner.resource", "Resource") }),
583
+ /* @__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
584
  ] }),
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,
585
+ /* @__PURE__ */ jsx("div", { className: "nice-resource-allocation__grid-body", children: resources.map((resource) => /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__resource-row", children: [
586
+ /* @__PURE__ */ jsxs(
587
+ "div",
588
+ {
589
+ className: "nice-resource-allocation__resource-cell",
590
+ onClick: () => onResourceClick == null ? void 0 : onResourceClick(resource),
591
+ children: [
592
+ /* @__PURE__ */ jsx(
593
+ "button",
2272
594
  {
2273
- name: expandedResources.has(resource.id) ? "chevron-down" : "chevron-right",
2274
- size: 14
595
+ className: "nice-resource-allocation__expand-button",
596
+ onClick: (e) => {
597
+ e.stopPropagation();
598
+ toggleResource(resource.id);
599
+ },
600
+ children: /* @__PURE__ */ jsx(
601
+ ae,
602
+ {
603
+ name: expandedResources.has(resource.id) ? "chevron-down" : "chevron-right",
604
+ size: 14
605
+ }
606
+ )
2275
607
  }
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;
608
+ ),
609
+ /* @__PURE__ */ jsx("span", { className: "nice-resource-allocation__resource-icon", children: /* @__PURE__ */ jsx(ae, { name: getResourceTypeIcon(resource.type), size: 16 }) }),
610
+ /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__resource-info", children: [
611
+ /* @__PURE__ */ jsx("span", { className: "nice-resource-allocation__resource-name", children: resource.name }),
612
+ resource.department && /* @__PURE__ */ jsx("span", { className: "nice-resource-allocation__resource-dept", children: resource.department })
613
+ ] }),
614
+ /* @__PURE__ */ jsx("span", { className: "nice-resource-allocation__resource-capacity", children: t("capacityPlanner.hDay", "{maxCapacity}h/day").replace(
615
+ "{maxCapacity}",
616
+ String(resource.maxCapacity)
617
+ ) })
618
+ ]
619
+ }
620
+ ),
621
+ /* @__PURE__ */ jsx("div", { className: "nice-resource-allocation__time-cells", children: timePeriods.map((period, idx) => {
622
+ var _a2;
2291
623
  const cellAllocations = getCellAllocations(resource.id, period);
2292
- const util = (_a3 = utilizationMap.get(resource.id)) == null ? void 0 : _a3.get(period.getTime());
624
+ const util = (_a2 = utilizationMap.get(resource.id)) == null ? void 0 : _a2.get(period.getTime());
2293
625
  const isHovered = (hoveredCell == null ? void 0 : hoveredCell.resourceId) === resource.id && (hoveredCell == null ? void 0 : hoveredCell.date.getTime()) === period.getTime();
2294
626
  return /* @__PURE__ */ jsxs(
2295
627
  "div",
2296
628
  {
2297
- className: `time-cell ${isHovered ? "time-cell--hovered" : ""}`,
629
+ className: `nice-resource-allocation__time-cell ${isHovered ? "nice-resource-allocation__time-cell--hovered" : ""}`,
2298
630
  style: { backgroundColor: getCellColor(resource.id, period) },
2299
631
  onClick: () => handleCellClick(resource.id, period),
2300
632
  onMouseEnter: () => setHoveredCell({ resourceId: resource.id, date: period }),
2301
633
  onMouseLeave: () => setHoveredCell(null),
2302
634
  children: [
2303
- cellAllocations.length > 0 && /* @__PURE__ */ jsxs("div", { className: "allocation-indicators", children: [
635
+ cellAllocations.length > 0 && /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__allocation-indicators", children: [
2304
636
  cellAllocations.slice(0, 2).map((alloc) => /* @__PURE__ */ jsx(
2305
637
  "div",
2306
638
  {
2307
- className: `allocation-dot ${alloc.status}`,
639
+ className: `nice-resource-allocation__allocation-dot nice-resource-allocation__allocation-dot--${alloc.status}`,
2308
640
  onClick: (e) => {
2309
641
  e.stopPropagation();
2310
642
  setSelectedAllocation(alloc.id);
@@ -2312,12 +644,12 @@ const NiceCapacityPlanner = ({
2312
644
  },
2313
645
  alloc.id
2314
646
  )),
2315
- cellAllocations.length > 2 && /* @__PURE__ */ jsxs("span", { className: "more-indicator", children: [
647
+ cellAllocations.length > 2 && /* @__PURE__ */ jsxs("span", { className: "nice-resource-allocation__more-indicator", children: [
2316
648
  "+",
2317
649
  cellAllocations.length - 2
2318
650
  ] })
2319
651
  ] }),
2320
- config.showUtilization && util && util.allocatedHours > 0 && /* @__PURE__ */ jsxs("span", { className: "utilization-label", children: [
652
+ config.showUtilization && util && util.allocatedHours > 0 && /* @__PURE__ */ jsxs("span", { className: "nice-resource-allocation__utilization-label", children: [
2321
653
  util.allocatedHours.toFixed(1),
2322
654
  "h"
2323
655
  ] })
@@ -2326,7 +658,7 @@ const NiceCapacityPlanner = ({
2326
658
  idx
2327
659
  );
2328
660
  }) }),
2329
- expandedResources.has(resource.id) && /* @__PURE__ */ jsx("div", { className: "expanded-allocations", children: allocations.filter((a) => a.resourceId === resource.id).map((allocation) => {
661
+ expandedResources.has(resource.id) && /* @__PURE__ */ jsx("div", { className: "nice-resource-allocation__expanded-allocations", children: allocations.filter((a2) => a2.resourceId === resource.id).map((allocation) => {
2330
662
  const startIdx = timePeriods.findIndex(
2331
663
  (p) => p.getTime() <= allocation.start.getTime()
2332
664
  );
@@ -2342,26 +674,27 @@ const NiceCapacityPlanner = ({
2342
674
  return /* @__PURE__ */ jsxs(
2343
675
  "div",
2344
676
  {
2345
- className: `allocation-bar ${allocation.status} ${selectedAllocation === allocation.id ? "selected" : ""}`,
677
+ className: `nice-resource-allocation__allocation-bar nice-resource-allocation__allocation-bar--${allocation.status} ${selectedAllocation === allocation.id ? "nice-resource-allocation__allocation-bar--selected" : ""}`,
2346
678
  style: {
2347
679
  left: `${leftPercent}%`,
2348
680
  width: `${widthPercent}%`
2349
681
  },
2350
682
  onClick: () => setSelectedAllocation(allocation.id),
2351
683
  children: [
2352
- /* @__PURE__ */ jsxs("span", { className: "allocation-label", children: [
2353
- allocation.hoursPerDay,
2354
- "h/day"
2355
- ] }),
684
+ /* @__PURE__ */ jsx("span", { className: "nice-resource-allocation__allocation-label", children: t("capacityPlanner.hDay2", "{hoursPerDay}h/day").replace(
685
+ "{hoursPerDay}",
686
+ String(allocation.hoursPerDay)
687
+ ) }),
2356
688
  !readOnly && /* @__PURE__ */ jsx(
2357
689
  "button",
2358
690
  {
2359
- className: "delete-allocation",
691
+ "aria-label": t("capacityPlanner.close", "Close"),
692
+ className: "nice-resource-allocation__delete-allocation",
2360
693
  onClick: (e) => {
2361
694
  e.stopPropagation();
2362
695
  onAllocationDelete == null ? void 0 : onAllocationDelete(allocation.id);
2363
696
  },
2364
- children: "×"
697
+ children: /* @__PURE__ */ jsx(ae, { name: "close", size: 14 })
2365
698
  }
2366
699
  )
2367
700
  ]
@@ -2371,98 +704,127 @@ const NiceCapacityPlanner = ({
2371
704
  }) })
2372
705
  ] }, resource.id)) })
2373
706
  ] }),
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
- ] }) })
707
+ showAllocationModal && /* @__PURE__ */ jsx(
708
+ "div",
709
+ {
710
+ className: "nice-resource-allocation__modal-overlay",
711
+ onClick: () => setShowAllocationModal(false),
712
+ children: /* @__PURE__ */ jsxs(
713
+ "div",
714
+ {
715
+ className: "nice-resource-allocation__allocation-modal",
716
+ onClick: (e) => e.stopPropagation(),
717
+ children: [
718
+ /* @__PURE__ */ jsx("h3", { children: t("capacityPlanner.createAllocation", "Create Allocation") }),
719
+ /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__modal-form", children: [
720
+ /* @__PURE__ */ jsxs("label", { children: [
721
+ t("capacityPlanner.resource", "Resource"),
722
+ /* @__PURE__ */ jsxs(
723
+ "select",
724
+ {
725
+ value: newAllocation.resourceId || "",
726
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, resourceId: e.target.value })),
727
+ children: [
728
+ /* @__PURE__ */ jsx("option", { value: "", children: t("capacityPlanner.selectResource", "Select resource...") }),
729
+ resources.map((r) => /* @__PURE__ */ jsx("option", { value: r.id, children: r.name }, r.id))
730
+ ]
731
+ }
732
+ )
733
+ ] }),
734
+ /* @__PURE__ */ jsxs("label", { children: [
735
+ t("capacityPlanner.startDate", "Start Date"),
736
+ /* @__PURE__ */ jsx(
737
+ "input",
738
+ {
739
+ type: "date",
740
+ value: ((_a = newAllocation.start) == null ? void 0 : _a.toISOString().split("T")[0]) || "",
741
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, start: new Date(e.target.value) }))
742
+ }
743
+ )
744
+ ] }),
745
+ /* @__PURE__ */ jsxs("label", { children: [
746
+ t("capacityPlanner.endDate", "End Date"),
747
+ /* @__PURE__ */ jsx(
748
+ "input",
749
+ {
750
+ type: "date",
751
+ value: ((_b = newAllocation.end) == null ? void 0 : _b.toISOString().split("T")[0]) || "",
752
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, end: new Date(e.target.value) }))
753
+ }
754
+ )
755
+ ] }),
756
+ /* @__PURE__ */ jsxs("label", { children: [
757
+ t("capacityPlanner.hoursPerDay", "Hours per Day"),
758
+ /* @__PURE__ */ jsx(
759
+ "input",
760
+ {
761
+ type: "number",
762
+ min: "0.5",
763
+ max: "24",
764
+ step: "0.5",
765
+ value: newAllocation.hoursPerDay || 8,
766
+ onChange: (e) => setNewAllocation((prev) => ({
767
+ ...prev,
768
+ hoursPerDay: parseFloat(e.target.value)
769
+ }))
770
+ }
771
+ )
772
+ ] }),
773
+ /* @__PURE__ */ jsxs("label", { children: [
774
+ t("capacityPlanner.status", "Status"),
775
+ /* @__PURE__ */ jsxs(
776
+ "select",
777
+ {
778
+ value: newAllocation.status || "tentative",
779
+ onChange: (e) => setNewAllocation((prev) => ({
780
+ ...prev,
781
+ status: e.target.value
782
+ })),
783
+ children: [
784
+ /* @__PURE__ */ jsx("option", { value: "tentative", children: t("capacityPlanner.tentative", "Tentative") }),
785
+ /* @__PURE__ */ jsx("option", { value: "confirmed", children: t("capacityPlanner.confirmed", "Confirmed") })
786
+ ]
787
+ }
788
+ )
789
+ ] }),
790
+ /* @__PURE__ */ jsxs("label", { children: [
791
+ t("capacityPlanner.notes", "Notes"),
792
+ /* @__PURE__ */ jsx(
793
+ "textarea",
794
+ {
795
+ value: newAllocation.notes || "",
796
+ onChange: (e) => setNewAllocation((prev) => ({ ...prev, notes: e.target.value })),
797
+ placeholder: t("capacityPlanner.optionalNotes", "Optional notes...")
798
+ }
799
+ )
800
+ ] })
801
+ ] }),
802
+ /* @__PURE__ */ jsxs("div", { className: "nice-resource-allocation__modal-actions", children: [
803
+ /* @__PURE__ */ jsx(
804
+ "button",
805
+ {
806
+ className: "nice-resource-allocation__cancel-button",
807
+ onClick: () => setShowAllocationModal(false),
808
+ children: t("capacityPlanner.cancel", "Cancel")
809
+ }
810
+ ),
811
+ /* @__PURE__ */ jsx(
812
+ "button",
813
+ {
814
+ className: "nice-resource-allocation__create-button",
815
+ onClick: handleCreateAllocation,
816
+ children: t("capacityPlanner.createAllocation", "Create Allocation")
817
+ }
818
+ )
819
+ ] })
820
+ ]
821
+ }
822
+ )
823
+ }
824
+ )
2464
825
  ] });
2465
826
  };
827
+ const EMPTY_ITEMS = [];
2466
828
  const DEFAULT_VIEW_CONFIG = {
2467
829
  view: "grid",
2468
830
  sortBy: "name",
@@ -2471,7 +833,7 @@ const DEFAULT_VIEW_CONFIG = {
2471
833
  pageSize: 24
2472
834
  };
2473
835
  const NiceInventoryManager = ({
2474
- items,
836
+ items = EMPTY_ITEMS,
2475
837
  transactions = [],
2476
838
  viewConfig: externalConfig,
2477
839
  onItemCreate,
@@ -2480,10 +842,12 @@ const NiceInventoryManager = ({
2480
842
  onTransactionCreate,
2481
843
  onStockCount,
2482
844
  onItemClick,
845
+ onCreatePurchaseOrder,
2483
846
  readOnly = false,
2484
847
  className = ""
2485
848
  }) => {
2486
- var _a2, _b;
849
+ var _a, _b;
850
+ const { t } = v();
2487
851
  const config = { ...DEFAULT_VIEW_CONFIG, ...externalConfig };
2488
852
  const [filters, setFilters] = useState({});
2489
853
  const [view, setView] = useState(config.view);
@@ -2500,18 +864,18 @@ const NiceInventoryManager = ({
2500
864
  return Array.from(new Set(items.map((item) => item.category))).sort();
2501
865
  }, [items]);
2502
866
  const filteredItems = useMemo(() => {
2503
- var _a3, _b2;
867
+ var _a2, _b2;
2504
868
  let result = [...items];
2505
869
  if (filters.searchQuery) {
2506
870
  const query = filters.searchQuery.toLowerCase();
2507
871
  result = result.filter(
2508
872
  (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));
873
+ var _a3;
874
+ return item.name.toLowerCase().includes(query) || item.sku.toLowerCase().includes(query) || ((_a3 = item.description) == null ? void 0 : _a3.toLowerCase().includes(query));
2511
875
  }
2512
876
  );
2513
877
  }
2514
- if ((_a3 = filters.categories) == null ? void 0 : _a3.length) {
878
+ if ((_a2 = filters.categories) == null ? void 0 : _a2.length) {
2515
879
  result = result.filter((item) => filters.categories.includes(item.category));
2516
880
  }
2517
881
  if ((_b2 = filters.statuses) == null ? void 0 : _b2.length) {
@@ -2520,24 +884,24 @@ const NiceInventoryManager = ({
2520
884
  if (filters.lowStockOnly) {
2521
885
  result = result.filter((item) => item.quantity <= item.reorderLevel);
2522
886
  }
2523
- result.sort((a, b) => {
2524
- var _a4, _b3;
887
+ result.sort((a2, b) => {
888
+ var _a3, _b3;
2525
889
  let comparison = 0;
2526
890
  switch (sortBy) {
2527
891
  case "name":
2528
- comparison = a.name.localeCompare(b.name);
892
+ comparison = a2.name.localeCompare(b.name);
2529
893
  break;
2530
894
  case "sku":
2531
- comparison = a.sku.localeCompare(b.sku);
895
+ comparison = a2.sku.localeCompare(b.sku);
2532
896
  break;
2533
897
  case "quantity":
2534
- comparison = a.quantity - b.quantity;
898
+ comparison = a2.quantity - b.quantity;
2535
899
  break;
2536
900
  case "value":
2537
- comparison = a.quantity * a.cost.amount - b.quantity * b.cost.amount;
901
+ comparison = a2.quantity * a2.cost.amount - b.quantity * b.cost.amount;
2538
902
  break;
2539
903
  case "lastUpdated":
2540
- comparison = (((_a4 = a.lastCountDate) == null ? void 0 : _a4.getTime()) || 0) - (((_b3 = b.lastCountDate) == null ? void 0 : _b3.getTime()) || 0);
904
+ comparison = (((_a3 = a2.lastCountDate) == null ? void 0 : _a3.getTime()) || 0) - (((_b3 = b.lastCountDate) == null ? void 0 : _b3.getTime()) || 0);
2541
905
  break;
2542
906
  }
2543
907
  return sortOrder === "asc" ? comparison : -comparison;
@@ -2553,7 +917,7 @@ const NiceInventoryManager = ({
2553
917
  return items.filter((item) => item.quantity <= item.reorderLevel);
2554
918
  }, [items]);
2555
919
  const recentTransactions = useMemo(() => {
2556
- return [...transactions].sort((a, b) => b.date.getTime() - a.date.getTime()).slice(0, 50);
920
+ return [...transactions].sort((a2, b) => b.date.getTime() - a2.date.getTime()).slice(0, 50);
2557
921
  }, [transactions]);
2558
922
  const kanbanGroups = useMemo(() => {
2559
923
  if (view !== "kanban") {
@@ -2569,8 +933,8 @@ const NiceInventoryManager = ({
2569
933
  ];
2570
934
  statuses.forEach((status) => groups.set(status, []));
2571
935
  filteredItems.forEach((item) => {
2572
- var _a3;
2573
- (_a3 = groups.get(item.status)) == null ? void 0 : _a3.push(item);
936
+ var _a2;
937
+ (_a2 = groups.get(item.status)) == null ? void 0 : _a2.push(item);
2574
938
  });
2575
939
  return groups;
2576
940
  }, [filteredItems, view]);
@@ -2651,35 +1015,35 @@ const NiceInventoryManager = ({
2651
1015
  });
2652
1016
  };
2653
1017
  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: [
1018
+ /* @__PURE__ */ jsxs("header", { className: "nice-inventory-manager__toolbar", children: [
1019
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__toolbar-left", children: [
1020
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__search-box", children: [
2657
1021
  /* @__PURE__ */ jsx(
2658
1022
  "input",
2659
1023
  {
2660
1024
  type: "text",
2661
- placeholder: "Search items...",
1025
+ placeholder: t("inventoryManager.searchItems", "Search items..."),
2662
1026
  value: filters.searchQuery || "",
2663
1027
  onChange: (e) => setFilters((prev) => ({ ...prev, searchQuery: e.target.value }))
2664
1028
  }
2665
1029
  ),
2666
- /* @__PURE__ */ jsx("span", { className: "search-icon", children: /* @__PURE__ */ jsx(Ae, { name: "search", size: 14 }) })
1030
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__search-icon", children: /* @__PURE__ */ jsx(ae, { name: "search", size: 14 }) })
2667
1031
  ] }),
2668
1032
  /* @__PURE__ */ jsxs(
2669
1033
  "select",
2670
1034
  {
2671
- value: ((_a2 = filters.categories) == null ? void 0 : _a2[0]) || "",
1035
+ value: ((_a = filters.categories) == null ? void 0 : _a[0]) || "",
2672
1036
  onChange: (e) => setFilters((prev) => ({
2673
1037
  ...prev,
2674
1038
  categories: e.target.value ? [e.target.value] : void 0
2675
1039
  })),
2676
1040
  children: [
2677
- /* @__PURE__ */ jsx("option", { value: "", children: "All Categories" }),
1041
+ /* @__PURE__ */ jsx("option", { value: "", children: t("inventoryManager.allCategories", "All Categories") }),
2678
1042
  categories.map((cat) => /* @__PURE__ */ jsx("option", { value: cat, children: cat }, cat))
2679
1043
  ]
2680
1044
  }
2681
1045
  ),
2682
- /* @__PURE__ */ jsxs("label", { className: "filter-checkbox", children: [
1046
+ /* @__PURE__ */ jsxs("label", { className: "nice-inventory-manager__filter-checkbox", children: [
2683
1047
  /* @__PURE__ */ jsx(
2684
1048
  "input",
2685
1049
  {
@@ -2688,29 +1052,29 @@ const NiceInventoryManager = ({
2688
1052
  onChange: (e) => setFilters((prev) => ({ ...prev, lowStockOnly: e.target.checked }))
2689
1053
  }
2690
1054
  ),
2691
- "Low Stock Only"
1055
+ t("inventoryManager.lowStockOnly", "Low Stock Only")
2692
1056
  ] })
2693
1057
  ] }),
2694
- /* @__PURE__ */ jsxs("div", { className: "toolbar__right", children: [
2695
- /* @__PURE__ */ jsx("div", { className: "view-selector", children: ["grid", "list", "kanban"].map((v) => /* @__PURE__ */ jsx(
1058
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__toolbar-right", children: [
1059
+ /* @__PURE__ */ jsx("div", { className: "nice-inventory-manager__view-selector", children: ["grid", "list", "kanban"].map((v2) => /* @__PURE__ */ jsx(
2696
1060
  "button",
2697
1061
  {
2698
- className: `view-button ${view === v ? "view-button--active" : ""}`,
2699
- onClick: () => setView(v),
1062
+ className: `nice-inventory-manager__view-button ${view === v2 ? "nice-inventory-manager__view-button--active" : ""}`,
1063
+ onClick: () => setView(v2),
2700
1064
  children: /* @__PURE__ */ jsx(
2701
- Ae,
1065
+ ae,
2702
1066
  {
2703
- name: v === "grid" ? "grid" : v === "list" ? "list" : "table",
1067
+ name: v2 === "grid" ? "grid" : v2 === "list" ? "list" : "table",
2704
1068
  size: 14
2705
1069
  }
2706
1070
  )
2707
1071
  },
2708
- v
1072
+ v2
2709
1073
  )) }),
2710
1074
  !readOnly && /* @__PURE__ */ jsx(
2711
1075
  "button",
2712
1076
  {
2713
- className: "add-button",
1077
+ className: "nice-inventory-manager__add-button",
2714
1078
  onClick: () => {
2715
1079
  setEditingItem({
2716
1080
  category: categories[0],
@@ -2723,100 +1087,99 @@ const NiceInventoryManager = ({
2723
1087
  });
2724
1088
  setShowItemModal(true);
2725
1089
  },
2726
- children: "+ Add Item"
1090
+ children: t("inventoryManager.addItem", "+ Add Item")
2727
1091
  }
2728
1092
  )
2729
1093
  ] })
2730
1094
  ] }),
2731
- /* @__PURE__ */ jsxs("div", { className: "inventory__tabs", children: [
2732
- /* @__PURE__ */ jsxs(
1095
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__tabs", children: [
1096
+ /* @__PURE__ */ jsx(
2733
1097
  "button",
2734
1098
  {
2735
- className: `tab ${activeTab === "inventory" ? "tab--active" : ""}`,
1099
+ className: `nice-inventory-manager__tab ${activeTab === "inventory" ? "nice-inventory-manager__tab--active" : ""}`,
2736
1100
  onClick: () => setActiveTab("inventory"),
2737
- children: [
2738
- "Inventory (",
2739
- items.length,
2740
- ")"
2741
- ]
1101
+ children: t("inventoryManager.inventory", "Inventory ({items})").replace(
1102
+ "{items}",
1103
+ String(items.length)
1104
+ )
2742
1105
  }
2743
1106
  ),
2744
- /* @__PURE__ */ jsxs(
1107
+ /* @__PURE__ */ jsx(
2745
1108
  "button",
2746
1109
  {
2747
- className: `tab ${activeTab === "transactions" ? "tab--active" : ""}`,
1110
+ className: `nice-inventory-manager__tab ${activeTab === "transactions" ? "nice-inventory-manager__tab--active" : ""}`,
2748
1111
  onClick: () => setActiveTab("transactions"),
2749
- children: [
2750
- "Transactions (",
2751
- transactions.length,
2752
- ")"
2753
- ]
1112
+ children: t("inventoryManager.transactions", "Transactions ({transactions})").replace(
1113
+ "{transactions}",
1114
+ String(transactions.length)
1115
+ )
2754
1116
  }
2755
1117
  ),
2756
1118
  /* @__PURE__ */ jsxs(
2757
1119
  "button",
2758
1120
  {
2759
- className: `tab ${activeTab === "reorder" ? "tab--active" : ""}`,
1121
+ className: `nice-inventory-manager__tab ${activeTab === "reorder" ? "nice-inventory-manager__tab--active" : ""}`,
2760
1122
  onClick: () => setActiveTab("reorder"),
2761
1123
  children: [
2762
- "Reorder Alerts",
2763
- reorderItems.length > 0 && /* @__PURE__ */ jsx("span", { className: "alert-badge", children: reorderItems.length })
1124
+ t("inventoryManager.reorderAlerts", "Reorder Alerts"),
1125
+ reorderItems.length > 0 && /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__alert-badge", children: reorderItems.length })
2764
1126
  ]
2765
1127
  }
2766
1128
  )
2767
1129
  ] }),
2768
- /* @__PURE__ */ jsxs("div", { className: "inventory__content", children: [
1130
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__content", children: [
2769
1131
  activeTab === "inventory" && /* @__PURE__ */ jsxs(Fragment, { children: [
2770
- view === "grid" && /* @__PURE__ */ jsx("div", { className: "items-grid", children: paginatedItems.map((item) => {
2771
- var _a3;
1132
+ view === "grid" && /* @__PURE__ */ jsx("div", { className: "nice-inventory-manager__items-grid", children: paginatedItems.map((item) => {
1133
+ var _a2;
2772
1134
  return /* @__PURE__ */ jsxs(
2773
1135
  "div",
2774
1136
  {
2775
- className: `item-card ${selectedItems.has(item.id) ? "item-card--selected" : ""}`,
1137
+ className: `nice-inventory-manager__item-card ${selectedItems.has(item.id) ? "nice-inventory-manager__item-card--selected" : ""}`,
2776
1138
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2777
1139
  children: [
2778
1140
  !readOnly && /* @__PURE__ */ jsx(
2779
1141
  "input",
2780
1142
  {
2781
1143
  type: "checkbox",
2782
- className: "item-checkbox",
1144
+ className: "nice-inventory-manager__item-checkbox",
2783
1145
  checked: selectedItems.has(item.id),
2784
1146
  onChange: () => toggleItemSelection(item.id),
2785
1147
  onClick: (e) => e.stopPropagation()
2786
1148
  }
2787
1149
  ),
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 })
1150
+ 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(ae, { name: "box", size: 32 }) }) }),
1151
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__item-info", children: [
1152
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__item-sku", children: item.sku }),
1153
+ /* @__PURE__ */ jsx("h4", { className: "nice-inventory-manager__item-name", children: item.name }),
1154
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__item-category", children: item.category })
2793
1155
  ] }),
2794
- /* @__PURE__ */ jsxs("div", { className: "item-stock", children: [
1156
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__item-stock", children: [
2795
1157
  /* @__PURE__ */ jsx(
2796
1158
  "span",
2797
1159
  {
2798
- className: "status-badge",
1160
+ className: "nice-inventory-manager__status-badge",
2799
1161
  style: { backgroundColor: getStatusColor(item.status) },
2800
1162
  children: item.status.replace("-", " ")
2801
1163
  }
2802
1164
  ),
2803
- /* @__PURE__ */ jsxs("span", { className: "quantity", children: [
1165
+ /* @__PURE__ */ jsxs("span", { className: "nice-inventory-manager__quantity", children: [
2804
1166
  item.quantity,
2805
1167
  " ",
2806
1168
  item.unit
2807
1169
  ] }),
2808
- item.quantity <= item.reorderLevel && /* @__PURE__ */ jsxs("span", { className: "reorder-alert", children: [
2809
- /* @__PURE__ */ jsx(Ae, { name: "warning", size: 12 }),
2810
- " Low Stock"
1170
+ item.quantity <= item.reorderLevel && /* @__PURE__ */ jsxs("span", { className: "nice-inventory-manager__reorder-alert", children: [
1171
+ /* @__PURE__ */ jsx(ae, { name: "warning", size: 12 }),
1172
+ " ",
1173
+ t("inventoryManager.lowStock", "Low Stock")
2811
1174
  ] })
2812
1175
  ] }),
2813
- /* @__PURE__ */ jsx("div", { className: "item-value", children: formatCurrency(item.quantity * item.cost.amount, item.cost.currency.symbol) })
1176
+ /* @__PURE__ */ jsx("div", { className: "nice-inventory-manager__item-value", children: formatCurrency(item.quantity * item.cost.amount, item.cost.currency.symbol) })
2814
1177
  ]
2815
1178
  },
2816
1179
  item.id
2817
1180
  );
2818
1181
  }) }),
2819
- view === "list" && /* @__PURE__ */ jsx("div", { className: "items-table", children: /* @__PURE__ */ jsxs("table", { children: [
1182
+ view === "list" && /* @__PURE__ */ jsx("div", { className: "nice-inventory-manager__items-table", children: /* @__PURE__ */ jsxs("table", { children: [
2820
1183
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
2821
1184
  !readOnly && /* @__PURE__ */ jsx("th", {}),
2822
1185
  /* @__PURE__ */ jsxs(
@@ -2827,8 +1190,15 @@ const NiceInventoryManager = ({
2827
1190
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2828
1191
  },
2829
1192
  children: [
2830
- "SKU ",
2831
- sortBy === "sku" && (sortOrder === "asc" ? "↑" : "↓")
1193
+ t("inventoryManager.sku", "SKU"),
1194
+ " ",
1195
+ sortBy === "sku" && /* @__PURE__ */ jsx(
1196
+ ae,
1197
+ {
1198
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1199
+ size: 12
1200
+ }
1201
+ )
2832
1202
  ]
2833
1203
  }
2834
1204
  ),
@@ -2840,12 +1210,19 @@ const NiceInventoryManager = ({
2840
1210
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2841
1211
  },
2842
1212
  children: [
2843
- "Name ",
2844
- sortBy === "name" && (sortOrder === "asc" ? "↑" : "↓")
1213
+ t("inventoryManager.name", "Name"),
1214
+ " ",
1215
+ sortBy === "name" && /* @__PURE__ */ jsx(
1216
+ ae,
1217
+ {
1218
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1219
+ size: 12
1220
+ }
1221
+ )
2845
1222
  ]
2846
1223
  }
2847
1224
  ),
2848
- /* @__PURE__ */ jsx("th", { children: "Category" }),
1225
+ /* @__PURE__ */ jsx("th", { children: t("inventoryManager.category", "Category") }),
2849
1226
  /* @__PURE__ */ jsxs(
2850
1227
  "th",
2851
1228
  {
@@ -2854,13 +1231,20 @@ const NiceInventoryManager = ({
2854
1231
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2855
1232
  },
2856
1233
  children: [
2857
- "Qty ",
2858
- sortBy === "quantity" && (sortOrder === "asc" ? "↑" : "↓")
1234
+ t("inventoryManager.qty", "Qty"),
1235
+ " ",
1236
+ sortBy === "quantity" && /* @__PURE__ */ jsx(
1237
+ ae,
1238
+ {
1239
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1240
+ size: 12
1241
+ }
1242
+ )
2859
1243
  ]
2860
1244
  }
2861
1245
  ),
2862
- /* @__PURE__ */ jsx("th", { children: "Status" }),
2863
- /* @__PURE__ */ jsx("th", { children: "Location" }),
1246
+ /* @__PURE__ */ jsx("th", { children: t("inventoryManager.status", "Status") }),
1247
+ /* @__PURE__ */ jsx("th", { children: t("inventoryManager.location", "Location") }),
2864
1248
  /* @__PURE__ */ jsxs(
2865
1249
  "th",
2866
1250
  {
@@ -2869,17 +1253,24 @@ const NiceInventoryManager = ({
2869
1253
  setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
2870
1254
  },
2871
1255
  children: [
2872
- "Value ",
2873
- sortBy === "value" && (sortOrder === "asc" ? "↑" : "↓")
1256
+ t("inventoryManager.value", "Value"),
1257
+ " ",
1258
+ sortBy === "value" && /* @__PURE__ */ jsx(
1259
+ ae,
1260
+ {
1261
+ name: sortOrder === "asc" ? "arrow-up" : "arrow-down",
1262
+ size: 12
1263
+ }
1264
+ )
2874
1265
  ]
2875
1266
  }
2876
1267
  ),
2877
- !readOnly && /* @__PURE__ */ jsx("th", { children: "Actions" })
1268
+ !readOnly && /* @__PURE__ */ jsx("th", { children: t("inventoryManager.actions", "Actions") })
2878
1269
  ] }) }),
2879
1270
  /* @__PURE__ */ jsx("tbody", { children: paginatedItems.map((item) => /* @__PURE__ */ jsxs(
2880
1271
  "tr",
2881
1272
  {
2882
- className: selectedItems.has(item.id) ? "row--selected" : "",
1273
+ className: `nice-inventory-manager__row ${selectedItems.has(item.id) ? "nice-inventory-manager__row--selected" : ""}`,
2883
1274
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2884
1275
  children: [
2885
1276
  !readOnly && /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(
@@ -2891,18 +1282,24 @@ const NiceInventoryManager = ({
2891
1282
  onClick: (e) => e.stopPropagation()
2892
1283
  }
2893
1284
  ) }),
2894
- /* @__PURE__ */ jsx("td", { className: "sku-cell", children: item.sku }),
1285
+ /* @__PURE__ */ jsx("td", { className: "nice-inventory-manager__sku-cell", children: item.sku }),
2895
1286
  /* @__PURE__ */ jsx("td", { children: item.name }),
2896
1287
  /* @__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
- ] }),
1288
+ /* @__PURE__ */ jsxs(
1289
+ "td",
1290
+ {
1291
+ className: `nice-inventory-manager__qty-cell ${item.quantity <= item.reorderLevel ? "nice-inventory-manager__qty-cell--low-stock" : ""}`,
1292
+ children: [
1293
+ item.quantity,
1294
+ " ",
1295
+ item.unit
1296
+ ]
1297
+ }
1298
+ ),
2902
1299
  /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(
2903
1300
  "span",
2904
1301
  {
2905
- className: "status-badge",
1302
+ className: "nice-inventory-manager__status-badge",
2906
1303
  style: { backgroundColor: getStatusColor(item.status) },
2907
1304
  children: item.status.replace("-", " ")
2908
1305
  }
@@ -2912,40 +1309,40 @@ const NiceInventoryManager = ({
2912
1309
  item.quantity * item.cost.amount,
2913
1310
  item.cost.currency.symbol
2914
1311
  ) }),
2915
- !readOnly && /* @__PURE__ */ jsxs("td", { className: "actions-cell", children: [
1312
+ !readOnly && /* @__PURE__ */ jsxs("td", { className: "nice-inventory-manager__actions-cell", children: [
2916
1313
  /* @__PURE__ */ jsx(
2917
1314
  "button",
2918
1315
  {
2919
- className: "action-btn",
1316
+ className: "nice-inventory-manager__action-btn",
2920
1317
  onClick: (e) => {
2921
1318
  e.stopPropagation();
2922
1319
  setEditingItem(item);
2923
1320
  setShowItemModal(true);
2924
1321
  },
2925
- children: /* @__PURE__ */ jsx(Ae, { name: "edit", size: 14 })
1322
+ children: /* @__PURE__ */ jsx(ae, { name: "edit", size: 14 })
2926
1323
  }
2927
1324
  ),
2928
1325
  /* @__PURE__ */ jsx(
2929
1326
  "button",
2930
1327
  {
2931
- className: "action-btn",
1328
+ className: "nice-inventory-manager__action-btn",
2932
1329
  onClick: (e) => {
2933
1330
  e.stopPropagation();
2934
1331
  setNewTransaction({ itemId: item.id });
2935
1332
  setShowTransactionModal(true);
2936
1333
  },
2937
- children: /* @__PURE__ */ jsx(Ae, { name: "clipboard", size: 14 })
1334
+ children: /* @__PURE__ */ jsx(ae, { name: "clipboard", size: 14 })
2938
1335
  }
2939
1336
  ),
2940
1337
  /* @__PURE__ */ jsx(
2941
1338
  "button",
2942
1339
  {
2943
- className: "action-btn action-btn--danger",
1340
+ className: "nice-inventory-manager__action-btn nice-inventory-manager__action-btn--danger",
2944
1341
  onClick: (e) => {
2945
1342
  e.stopPropagation();
2946
1343
  onItemDelete == null ? void 0 : onItemDelete(item.id);
2947
1344
  },
2948
- children: /* @__PURE__ */ jsx(Ae, { name: "trash", size: 14 })
1345
+ children: /* @__PURE__ */ jsx(ae, { name: "trash", size: 14 })
2949
1346
  }
2950
1347
  )
2951
1348
  ] })
@@ -2954,27 +1351,34 @@ const NiceInventoryManager = ({
2954
1351
  item.id
2955
1352
  )) })
2956
1353
  ] }) }),
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(
1354
+ 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: [
1355
+ /* @__PURE__ */ jsxs(
1356
+ "div",
1357
+ {
1358
+ className: "nice-inventory-manager__column-header",
1359
+ style: { borderColor: getStatusColor(status) },
1360
+ children: [
1361
+ /* @__PURE__ */ jsx(
1362
+ "span",
1363
+ {
1364
+ className: "nice-inventory-manager__status-dot",
1365
+ style: { backgroundColor: getStatusColor(status) }
1366
+ }
1367
+ ),
1368
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__column-title", children: status.replace("-", " ") }),
1369
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__column-count", children: statusItems.length })
1370
+ ]
1371
+ }
1372
+ ),
1373
+ /* @__PURE__ */ jsx("div", { className: "nice-inventory-manager__column-items", children: statusItems.map((item) => /* @__PURE__ */ jsxs(
2970
1374
  "div",
2971
1375
  {
2972
- className: "kanban-card",
1376
+ className: "nice-inventory-manager__kanban-card",
2973
1377
  onClick: () => onItemClick == null ? void 0 : onItemClick(item),
2974
1378
  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: [
1379
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__card-sku", children: item.sku }),
1380
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__card-name", children: item.name }),
1381
+ /* @__PURE__ */ jsxs("span", { className: "nice-inventory-manager__card-qty", children: [
2978
1382
  item.quantity,
2979
1383
  " ",
2980
1384
  item.unit
@@ -2984,298 +1388,334 @@ const NiceInventoryManager = ({
2984
1388
  item.id
2985
1389
  )) })
2986
1390
  ] }, 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" })
1391
+ totalPages > 1 && /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__pagination", children: [
1392
+ /* @__PURE__ */ jsx("button", { disabled: page === 1, onClick: () => setPage((p) => p - 1), children: t("inventoryManager.previous", "Previous") }),
1393
+ /* @__PURE__ */ jsx("span", { children: t("inventoryManager.pageOf", "Page {page} of {totalPages}").replace("{page}", String(page)).replace("{totalPages}", String(totalPages)) }),
1394
+ /* @__PURE__ */ jsx("button", { disabled: page === totalPages, onClick: () => setPage((p) => p + 1), children: t("inventoryManager.next", "Next") })
2996
1395
  ] })
2997
1396
  ] }),
2998
- activeTab === "transactions" && /* @__PURE__ */ jsxs("div", { className: "transactions-tab", children: [
1397
+ activeTab === "transactions" && /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__transactions-tab", children: [
2999
1398
  !readOnly && /* @__PURE__ */ jsx(
3000
1399
  "button",
3001
1400
  {
3002
- className: "add-transaction-button",
1401
+ className: "nice-inventory-manager__add-transaction-button",
3003
1402
  onClick: () => setShowTransactionModal(true),
3004
- children: "+ New Transaction"
1403
+ children: t("inventoryManager.newTransaction", "+ New Transaction")
3005
1404
  }
3006
1405
  ),
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 })
1406
+ /* @__PURE__ */ jsx("div", { className: "nice-inventory-manager__transactions-list", children: recentTransactions.map((tx) => {
1407
+ const item = items.find((i2) => i2.id === tx.itemId);
1408
+ return /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__transaction-item", children: [
1409
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__tx-icon", children: /* @__PURE__ */ jsx(ae, { name: getTransactionIcon(tx.type), size: 16 }) }),
1410
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__tx-info", children: [
1411
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__tx-type", children: tx.type }),
1412
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__tx-item", children: (item == null ? void 0 : item.name) || tx.itemId })
3014
1413
  ] }),
3015
1414
  /* @__PURE__ */ jsxs(
3016
1415
  "span",
3017
1416
  {
3018
- className: `tx-qty ${tx.type === "receipt" || tx.type === "return" ? "positive" : "negative"}`,
1417
+ 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
1418
  children: [
3020
1419
  tx.type === "receipt" || tx.type === "return" ? "+" : "-",
3021
1420
  tx.quantity
3022
1421
  ]
3023
1422
  }
3024
1423
  ),
3025
- /* @__PURE__ */ jsx("span", { className: "tx-date", children: tx.date.toLocaleString() }),
3026
- tx.reference && /* @__PURE__ */ jsxs("span", { className: "tx-ref", children: [
3027
- "Ref: ",
3028
- tx.reference
3029
- ] })
1424
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__tx-date", children: tx.date.toLocaleString() }),
1425
+ tx.reference && /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__tx-ref", children: t("inventoryManager.ref", "Ref: {reference}").replace(
1426
+ "{reference}",
1427
+ String(tx.reference)
1428
+ ) })
3030
1429
  ] }, tx.id);
3031
1430
  }) })
3032
1431
  ] }),
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 })
1432
+ 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: [
1433
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__empty-icon", children: /* @__PURE__ */ jsx(ae, { name: "success", size: 32 }) }),
1434
+ /* @__PURE__ */ jsx("p", { children: t(
1435
+ "inventoryManager.allItemsAreSufficientlyStocked",
1436
+ "All items are sufficiently stocked"
1437
+ ) })
1438
+ ] }) : /* @__PURE__ */ jsx("div", { className: "nice-inventory-manager__reorder-list", children: reorderItems.map((item) => /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__reorder-item", children: [
1439
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__reorder-info", children: [
1440
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__reorder-sku", children: item.sku }),
1441
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__reorder-name", children: item.name })
3040
1442
  ] }),
3041
- /* @__PURE__ */ jsxs("div", { className: "reorder-stock", children: [
3042
- /* @__PURE__ */ jsxs("span", { className: "current-qty", children: [
3043
- "Current: ",
3044
- item.quantity,
3045
- " ",
3046
- item.unit
3047
- ] }),
3048
- /* @__PURE__ */ jsxs("span", { className: "reorder-level", children: [
3049
- "Reorder at: ",
3050
- item.reorderLevel
3051
- ] }),
3052
- /* @__PURE__ */ jsxs("span", { className: "reorder-qty", children: [
3053
- "Order qty: ",
3054
- item.reorderQuantity
3055
- ] })
1443
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__reorder-stock", children: [
1444
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__current-qty", children: t("inventoryManager.current", "Current: {quantity} {unit}").replace("{quantity}", String(item.quantity)).replace("{unit}", String(item.unit)) }),
1445
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__reorder-level", children: t("inventoryManager.reorderAt", "Reorder at: {reorderLevel}").replace(
1446
+ "{reorderLevel}",
1447
+ String(item.reorderLevel)
1448
+ ) }),
1449
+ /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__reorder-qty", children: t("inventoryManager.orderQty", "Order qty: {reorderQuantity}").replace(
1450
+ "{reorderQuantity}",
1451
+ String(item.reorderQuantity)
1452
+ ) })
3056
1453
  ] }),
3057
- item.supplier && /* @__PURE__ */ jsx("span", { className: "supplier-name", children: item.supplier.name }),
3058
- !readOnly && /* @__PURE__ */ jsx(
1454
+ item.supplier && /* @__PURE__ */ jsx("span", { className: "nice-inventory-manager__supplier-name", children: item.supplier.name }),
1455
+ !readOnly && onCreatePurchaseOrder && /* @__PURE__ */ jsx(
3059
1456
  "button",
3060
1457
  {
3061
- className: "create-po-button",
3062
- onClick: () => console.log("Create PO for", item.id),
3063
- children: "Create PO"
1458
+ type: "button",
1459
+ className: "nice-inventory-manager__create-po-button",
1460
+ onClick: () => onCreatePurchaseOrder(item),
1461
+ children: t("inventoryManager.createPo", "Create PO")
3064
1462
  }
3065
1463
  )
3066
1464
  ] }, item.id)) }) })
3067
1465
  ] }),
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
- )
3082
- ] }),
3083
- /* @__PURE__ */ jsxs("label", { children: [
3084
- "Name",
3085
- /* @__PURE__ */ jsx(
3086
- "input",
3087
- {
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"
3115
- }
3116
- ),
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
- )
3129
- ] })
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)
1466
+ showItemModal && editingItem && /* @__PURE__ */ jsx(
1467
+ "div",
1468
+ {
1469
+ className: "nice-inventory-manager__modal-overlay",
1470
+ onClick: () => setShowItemModal(false),
1471
+ children: /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__item-modal", onClick: (e) => e.stopPropagation(), children: [
1472
+ /* @__PURE__ */ jsx("h3", { children: editingItem.id ? t("inventoryManager.editItem", "Edit Item") : t("inventoryManager.addNewItem", "Add New Item") }),
1473
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__modal-form", children: [
1474
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__form-row", children: [
1475
+ /* @__PURE__ */ jsxs("label", { children: [
1476
+ "SKU",
1477
+ /* @__PURE__ */ jsx(
1478
+ "input",
1479
+ {
1480
+ type: "text",
1481
+ value: editingItem.sku || "",
1482
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, sku: e.target.value }))
1483
+ }
1484
+ )
1485
+ ] }),
1486
+ /* @__PURE__ */ jsxs("label", { children: [
1487
+ t("inventoryManager.name", "Name"),
1488
+ /* @__PURE__ */ jsx(
1489
+ "input",
1490
+ {
1491
+ type: "text",
1492
+ value: editingItem.name || "",
1493
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, name: e.target.value }))
1494
+ }
1495
+ )
1496
+ ] })
1497
+ ] }),
1498
+ /* @__PURE__ */ jsxs("label", { children: [
1499
+ t("inventoryManager.description", "Description"),
1500
+ /* @__PURE__ */ jsx(
1501
+ "textarea",
1502
+ {
1503
+ value: editingItem.description || "",
1504
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, description: e.target.value }))
3185
1505
  }
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
- )
1506
+ )
1507
+ ] }),
1508
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__form-row", children: [
1509
+ /* @__PURE__ */ jsxs("label", { children: [
1510
+ t("inventoryManager.category", "Category"),
1511
+ /* @__PURE__ */ jsx(
1512
+ "input",
1513
+ {
1514
+ type: "text",
1515
+ value: editingItem.category || "",
1516
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, category: e.target.value })),
1517
+ list: "categories"
1518
+ }
1519
+ ),
1520
+ /* @__PURE__ */ jsx("datalist", { id: "categories", children: categories.map((c2) => /* @__PURE__ */ jsx("option", { value: c2 }, c2)) })
1521
+ ] }),
1522
+ /* @__PURE__ */ jsxs("label", { children: [
1523
+ t("inventoryManager.unit", "Unit"),
1524
+ /* @__PURE__ */ jsx(
1525
+ "input",
1526
+ {
1527
+ type: "text",
1528
+ value: editingItem.unit || "",
1529
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, unit: e.target.value }))
1530
+ }
1531
+ )
1532
+ ] })
1533
+ ] }),
1534
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__form-row", children: [
1535
+ /* @__PURE__ */ jsxs("label", { children: [
1536
+ t("inventoryManager.quantity", "Quantity"),
1537
+ /* @__PURE__ */ jsx(
1538
+ "input",
1539
+ {
1540
+ type: "number",
1541
+ value: editingItem.quantity || 0,
1542
+ onChange: (e) => setEditingItem((prev) => ({ ...prev, quantity: parseInt(e.target.value) }))
1543
+ }
1544
+ )
1545
+ ] }),
1546
+ /* @__PURE__ */ jsxs("label", { children: [
1547
+ t("inventoryManager.reorderLevel", "Reorder Level"),
1548
+ /* @__PURE__ */ jsx(
1549
+ "input",
1550
+ {
1551
+ type: "number",
1552
+ value: editingItem.reorderLevel || 0,
1553
+ onChange: (e) => setEditingItem((prev) => ({
1554
+ ...prev,
1555
+ reorderLevel: parseInt(e.target.value)
1556
+ }))
1557
+ }
1558
+ )
1559
+ ] }),
1560
+ /* @__PURE__ */ jsxs("label", { children: [
1561
+ t("inventoryManager.reorderQty", "Reorder Qty"),
1562
+ /* @__PURE__ */ jsx(
1563
+ "input",
1564
+ {
1565
+ type: "number",
1566
+ value: editingItem.reorderQuantity || 0,
1567
+ onChange: (e) => setEditingItem((prev) => ({
1568
+ ...prev,
1569
+ reorderQuantity: parseInt(e.target.value)
1570
+ }))
1571
+ }
1572
+ )
1573
+ ] })
1574
+ ] }),
1575
+ /* @__PURE__ */ jsxs("label", { children: [
1576
+ t("inventoryManager.unitCost", "Unit Cost"),
1577
+ /* @__PURE__ */ jsx(
1578
+ "input",
1579
+ {
1580
+ type: "number",
1581
+ step: "0.01",
1582
+ value: ((_b = editingItem.cost) == null ? void 0 : _b.amount) || 0,
1583
+ onChange: (e) => setEditingItem((prev) => ({
1584
+ ...prev,
1585
+ cost: {
1586
+ ...prev.cost,
1587
+ amount: parseFloat(e.target.value)
1588
+ }
1589
+ }))
1590
+ }
1591
+ )
1592
+ ] })
1593
+ ] }),
1594
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__modal-actions", children: [
1595
+ /* @__PURE__ */ jsx(
1596
+ "button",
1597
+ {
1598
+ className: "nice-inventory-manager__cancel-button",
1599
+ onClick: () => setShowItemModal(false),
1600
+ children: t("inventoryManager.cancel", "Cancel")
1601
+ }
1602
+ ),
1603
+ /* @__PURE__ */ jsx("button", { className: "nice-inventory-manager__save-button", onClick: handleItemSubmit, children: editingItem.id ? t("inventoryManager.saveChanges", "Save Changes") : t("inventoryManager.createItem", "Create Item") })
1604
+ ] })
3272
1605
  ] })
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
- ] }) })
1606
+ }
1607
+ ),
1608
+ showTransactionModal && /* @__PURE__ */ jsx(
1609
+ "div",
1610
+ {
1611
+ className: "nice-inventory-manager__modal-overlay",
1612
+ onClick: () => setShowTransactionModal(false),
1613
+ children: /* @__PURE__ */ jsxs(
1614
+ "div",
1615
+ {
1616
+ className: "nice-inventory-manager__transaction-modal",
1617
+ onClick: (e) => e.stopPropagation(),
1618
+ children: [
1619
+ /* @__PURE__ */ jsx("h3", { children: t("inventoryManager.createTransaction", "Create Transaction") }),
1620
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__modal-form", children: [
1621
+ /* @__PURE__ */ jsxs("label", { children: [
1622
+ t("inventoryManager.item", "Item"),
1623
+ /* @__PURE__ */ jsxs(
1624
+ "select",
1625
+ {
1626
+ value: newTransaction.itemId || "",
1627
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, itemId: e.target.value })),
1628
+ children: [
1629
+ /* @__PURE__ */ jsx("option", { value: "", children: t("inventoryManager.selectItem", "Select item...") }),
1630
+ items.map((item) => /* @__PURE__ */ jsxs("option", { value: item.id, children: [
1631
+ item.sku,
1632
+ " - ",
1633
+ item.name
1634
+ ] }, item.id))
1635
+ ]
1636
+ }
1637
+ )
1638
+ ] }),
1639
+ /* @__PURE__ */ jsxs("label", { children: [
1640
+ t("inventoryManager.type", "Type"),
1641
+ /* @__PURE__ */ jsxs(
1642
+ "select",
1643
+ {
1644
+ value: newTransaction.type || "",
1645
+ onChange: (e) => setNewTransaction((prev) => ({
1646
+ ...prev,
1647
+ type: e.target.value
1648
+ })),
1649
+ children: [
1650
+ /* @__PURE__ */ jsx("option", { value: "", children: t("inventoryManager.selectType", "Select type...") }),
1651
+ /* @__PURE__ */ jsx("option", { value: "receipt", children: t("inventoryManager.receipt", "Receipt") }),
1652
+ /* @__PURE__ */ jsx("option", { value: "issue", children: t("inventoryManager.issue", "Issue") }),
1653
+ /* @__PURE__ */ jsx("option", { value: "transfer", children: t("inventoryManager.transfer", "Transfer") }),
1654
+ /* @__PURE__ */ jsx("option", { value: "adjustment", children: t("inventoryManager.adjustment", "Adjustment") }),
1655
+ /* @__PURE__ */ jsx("option", { value: "return", children: t("inventoryManager.return", "Return") }),
1656
+ /* @__PURE__ */ jsx("option", { value: "write-off", children: t("inventoryManager.writeOff", "Write-off") })
1657
+ ]
1658
+ }
1659
+ )
1660
+ ] }),
1661
+ /* @__PURE__ */ jsxs("label", { children: [
1662
+ t("inventoryManager.quantity", "Quantity"),
1663
+ /* @__PURE__ */ jsx(
1664
+ "input",
1665
+ {
1666
+ type: "number",
1667
+ min: "1",
1668
+ value: newTransaction.quantity || "",
1669
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, quantity: parseInt(e.target.value) }))
1670
+ }
1671
+ )
1672
+ ] }),
1673
+ /* @__PURE__ */ jsxs("label", { children: [
1674
+ t("inventoryManager.reference", "Reference"),
1675
+ /* @__PURE__ */ jsx(
1676
+ "input",
1677
+ {
1678
+ type: "text",
1679
+ value: newTransaction.reference || "",
1680
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, reference: e.target.value })),
1681
+ placeholder: t("inventoryManager.poNumberInvoiceEtc", "PO number, invoice, etc.")
1682
+ }
1683
+ )
1684
+ ] }),
1685
+ /* @__PURE__ */ jsxs("label", { children: [
1686
+ t("inventoryManager.notes", "Notes"),
1687
+ /* @__PURE__ */ jsx(
1688
+ "textarea",
1689
+ {
1690
+ value: newTransaction.notes || "",
1691
+ onChange: (e) => setNewTransaction((prev) => ({ ...prev, notes: e.target.value }))
1692
+ }
1693
+ )
1694
+ ] })
1695
+ ] }),
1696
+ /* @__PURE__ */ jsxs("div", { className: "nice-inventory-manager__modal-actions", children: [
1697
+ /* @__PURE__ */ jsx(
1698
+ "button",
1699
+ {
1700
+ className: "nice-inventory-manager__cancel-button",
1701
+ onClick: () => setShowTransactionModal(false),
1702
+ children: t("inventoryManager.cancel", "Cancel")
1703
+ }
1704
+ ),
1705
+ /* @__PURE__ */ jsx(
1706
+ "button",
1707
+ {
1708
+ className: "nice-inventory-manager__save-button",
1709
+ onClick: handleTransactionSubmit,
1710
+ children: t("inventoryManager.createTransaction", "Create Transaction")
1711
+ }
1712
+ )
1713
+ ] })
1714
+ ]
1715
+ }
1716
+ )
1717
+ }
1718
+ )
3279
1719
  ] });
3280
1720
  };
3281
1721
  const STATUS_COLOR = {
@@ -3306,7 +1746,7 @@ function fmtDate$1(d, locale) {
3306
1746
  const dt = d instanceof Date ? d : new Date(d);
3307
1747
  return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
3308
1748
  }
3309
- const NiceInvoiceView = forwardRef(
1749
+ const NiceInvoiceView = /* @__PURE__ */ forwardRef(
3310
1750
  function NiceInvoiceView2({
3311
1751
  invoice,
3312
1752
  locale,
@@ -3320,15 +1760,16 @@ const NiceInvoiceView = forwardRef(
3320
1760
  style,
3321
1761
  id
3322
1762
  }, ref) {
3323
- var _a2;
3324
- const cur = currency ?? invoice.currency ?? ((_a2 = invoice.lines[0]) == null ? void 0 : _a2.unitPrice.currency) ?? "EUR";
1763
+ var _a;
1764
+ const { t } = v();
1765
+ const cur = currency ?? invoice.currency ?? ((_a = invoice.lines[0]) == null ? void 0 : _a.unitPrice.currency) ?? "EUR";
3325
1766
  const L = {
3326
1767
  invoiceNumber: "Invoice",
3327
1768
  issueDate: "Issue date",
3328
1769
  dueDate: "Due date",
3329
1770
  seller: "Seller",
3330
1771
  buyer: "Buyer",
3331
- description: "Description",
1772
+ description: t("invoiceView.description", "Description"),
3332
1773
  qty: "Qty",
3333
1774
  unitPrice: "Unit price",
3334
1775
  vat: "VAT",
@@ -3349,12 +1790,12 @@ const NiceInvoiceView = forwardRef(
3349
1790
  const byRate = /* @__PURE__ */ new Map();
3350
1791
  for (const ln of invoice.lines) {
3351
1792
  const n = lineNet(ln);
3352
- const v = lineVat(ln);
1793
+ const v2 = lineVat(ln);
3353
1794
  net += n;
3354
- vat += v;
1795
+ vat += v2;
3355
1796
  const cell = byRate.get(ln.vatRate) ?? { net: 0, vat: 0 };
3356
1797
  cell.net += n;
3357
- cell.vat += v;
1798
+ cell.vat += v2;
3358
1799
  byRate.set(ln.vatRate, cell);
3359
1800
  }
3360
1801
  return { net, vat, gross: net + vat, byRate };
@@ -3394,34 +1835,31 @@ const NiceInvoiceView = forwardRef(
3394
1835
  className: "nice-invoice-view__status",
3395
1836
  style: { color: STATUS_COLOR[invoice.status] },
3396
1837
  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
- ),
1838
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "nice-invoice-view__dot" }),
3410
1839
  " ",
3411
1840
  invoice.status
3412
1841
  ]
3413
1842
  }
3414
1843
  ),
3415
1844
  showActions && /* @__PURE__ */ jsxs("div", { className: "nice-invoice-view__actions", children: [
3416
- /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onAction == null ? void 0 : onAction("download"), children: "↓" }),
1845
+ /* @__PURE__ */ jsx(
1846
+ "button",
1847
+ {
1848
+ type: "button",
1849
+ onClick: () => onAction == null ? void 0 : onAction("download"),
1850
+ "aria-label": t("invoiceView.download", "Download"),
1851
+ title: t("invoiceView.download", "Download"),
1852
+ children: /* @__PURE__ */ jsx(ae, { name: "arrow-down", size: 12 })
1853
+ }
1854
+ ),
3417
1855
  /* @__PURE__ */ jsx(
3418
1856
  "button",
3419
1857
  {
3420
1858
  type: "button",
3421
1859
  onClick: () => onAction == null ? void 0 : onAction("print"),
3422
- "aria-label": "Print",
3423
- title: "Print",
3424
- children: /* @__PURE__ */ jsx(Ae, { name: "printer", size: 14 })
1860
+ "aria-label": t("invoiceView.print", "Print"),
1861
+ title: t("invoiceView.print", "Print"),
1862
+ children: /* @__PURE__ */ jsx(ae, { name: "printer", size: 14 })
3425
1863
  }
3426
1864
  ),
3427
1865
  /* @__PURE__ */ jsx(
@@ -3429,9 +1867,9 @@ const NiceInvoiceView = forwardRef(
3429
1867
  {
3430
1868
  type: "button",
3431
1869
  onClick: () => onAction == null ? void 0 : onAction("send"),
3432
- "aria-label": "Send",
3433
- title: "Send",
3434
- children: /* @__PURE__ */ jsx(Ae, { name: "mail", size: 14 })
1870
+ "aria-label": t("invoiceView.send", "Send"),
1871
+ title: t("invoiceView.send", "Send"),
1872
+ children: /* @__PURE__ */ jsx(ae, { name: "mail", size: 14 })
3435
1873
  }
3436
1874
  )
3437
1875
  ] })
@@ -3467,7 +1905,7 @@ const NiceInvoiceView = forwardRef(
3467
1905
  ] }) }),
3468
1906
  /* @__PURE__ */ jsx("tbody", { children: invoice.lines.map((ln) => {
3469
1907
  const n = lineNet(ln);
3470
- const v = lineVat(ln);
1908
+ const v2 = lineVat(ln);
3471
1909
  return /* @__PURE__ */ jsxs("tr", { children: [
3472
1910
  /* @__PURE__ */ jsx("td", { children: ln.description }),
3473
1911
  /* @__PURE__ */ jsxs("td", { className: "nice-num", children: [
@@ -3480,7 +1918,7 @@ const NiceInvoiceView = forwardRef(
3480
1918
  "%"
3481
1919
  ] }),
3482
1920
  /* @__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) })
1921
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney$1(n + v2, cur, locale) })
3484
1922
  ] }, ln.id);
3485
1923
  }) })
3486
1924
  ] }),
@@ -3493,14 +1931,14 @@ const NiceInvoiceView = forwardRef(
3493
1931
  /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.vat }),
3494
1932
  /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.gross })
3495
1933
  ] }) }),
3496
- /* @__PURE__ */ jsx("tbody", { children: [...totals.byRate.entries()].sort((a, b) => b[0] - a[0]).map(([rate, c]) => /* @__PURE__ */ jsxs("tr", { children: [
1934
+ /* @__PURE__ */ jsx("tbody", { children: [...totals.byRate.entries()].sort((a2, b) => b[0] - a2[0]).map(([rate, c2]) => /* @__PURE__ */ jsxs("tr", { children: [
3497
1935
  /* @__PURE__ */ jsxs("td", { children: [
3498
1936
  (rate * 100).toFixed(0),
3499
1937
  "%"
3500
1938
  ] }),
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) })
1939
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney$1(c2.net, cur, locale) }),
1940
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney$1(c2.vat, cur, locale) }),
1941
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney$1(c2.net + c2.vat, cur, locale) })
3504
1942
  ] }, rate)) })
3505
1943
  ] })
3506
1944
  ] }),
@@ -3520,7 +1958,7 @@ const NiceInvoiceView = forwardRef(
3520
1958
  ] }),
3521
1959
  !(hideSections == null ? void 0 : hideSections.timeline) && invoice.history && invoice.history.length > 0 && /* @__PURE__ */ jsxs("section", { className: "nice-invoice-view__timeline", children: [
3522
1960
  /* @__PURE__ */ jsx("h4", { children: L.timeline }),
3523
- /* @__PURE__ */ jsx("ol", { children: invoice.history.map((h, i) => /* @__PURE__ */ jsxs("li", { children: [
1961
+ /* @__PURE__ */ jsx("ol", { children: invoice.history.map((h, i2) => /* @__PURE__ */ jsxs("li", { children: [
3524
1962
  /* @__PURE__ */ jsx("span", { className: "nice-invoice-view__t-date", children: fmtDate$1(h.at, locale) }),
3525
1963
  /* @__PURE__ */ jsx(
3526
1964
  "span",
@@ -3534,7 +1972,7 @@ const NiceInvoiceView = forwardRef(
3534
1972
  " — ",
3535
1973
  h.note
3536
1974
  ] })
3537
- ] }, i)) })
1975
+ ] }, i2)) })
3538
1976
  ] }),
3539
1977
  !(hideSections == null ? void 0 : hideSections.notes) && invoice.notes && /* @__PURE__ */ jsxs("section", { className: "nice-invoice-view__notes", children: [
3540
1978
  /* @__PURE__ */ jsx("h4", { children: L.notes }),
@@ -3545,6 +1983,7 @@ const NiceInvoiceView = forwardRef(
3545
1983
  );
3546
1984
  }
3547
1985
  );
1986
+ const EMPTY_CELLS = [];
3548
1987
  function colorFor(occ, colors) {
3549
1988
  if (occ <= 0.01) {
3550
1989
  return colors.low;
@@ -3557,11 +1996,15 @@ function colorFor(occ, colors) {
3557
1996
  }
3558
1997
  return colors.high;
3559
1998
  }
3560
- const NiceWarehouseView = forwardRef(
1999
+ const NiceWarehouseView = /* @__PURE__ */ forwardRef(
3561
2000
  function NiceWarehouseView2({
3562
2001
  warehouseName,
3563
- cells,
3564
- colors = { low: "#dcfce7", mid: "#fde68a", high: "#fecaca" },
2002
+ cells = EMPTY_CELLS,
2003
+ colors = {
2004
+ low: "var(--nice-success-bg, #dcfce7)",
2005
+ mid: "var(--nice-warning-bg, #fde68a)",
2006
+ high: "var(--nice-danger-bg, #fecaca)"
2007
+ },
3565
2008
  onCellClick,
3566
2009
  showLegend = true,
3567
2010
  cellSize = 48,
@@ -3570,36 +2013,47 @@ const NiceWarehouseView = forwardRef(
3570
2013
  style,
3571
2014
  id
3572
2015
  }, ref) {
2016
+ const { t } = v();
3573
2017
  const [hovered, setHovered] = useState(null);
3574
2018
  const grid = useMemo(() => {
3575
2019
  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";
2020
+ for (const c2 of cells) {
2021
+ const rowKey = c2.row !== void 0 ? `r${c2.row}` : c2.location.rack ?? c2.location.aisle ?? "0";
3578
2022
  let arr = rows.get(rowKey);
3579
2023
  if (!arr) {
3580
2024
  arr = [];
3581
2025
  rows.set(rowKey, arr);
3582
2026
  }
3583
- arr.push(c);
2027
+ arr.push(c2);
3584
2028
  }
3585
2029
  return [...rows.entries()].map(([rowKey, arr]) => ({ rowKey, cells: arr }));
3586
2030
  }, [cells]);
3587
2031
  return /* @__PURE__ */ jsxs("div", { ref, id, className: `nice-warehouse-view ${className ?? ""}`, style, children: [
3588
2032
  /* @__PURE__ */ jsxs("header", { className: "nice-warehouse-view__header", children: [
3589
2033
  /* @__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
- ] })
2034
+ showLegend && /* @__PURE__ */ jsxs(
2035
+ "div",
2036
+ {
2037
+ className: "nice-warehouse-view__legend",
2038
+ "aria-label": t("warehouseView.occupancyLegend", "Occupancy legend"),
2039
+ children: [
2040
+ /* @__PURE__ */ jsx("span", { style: { background: colors.low } }),
2041
+ " ",
2042
+ t("warehouseView.low", "low"),
2043
+ /* @__PURE__ */ jsx("span", { style: { background: colors.mid } }),
2044
+ " ",
2045
+ t("warehouseView.mid", "mid"),
2046
+ /* @__PURE__ */ jsx("span", { style: { background: colors.high } }),
2047
+ " ",
2048
+ t("warehouseView.high", "high")
2049
+ ]
2050
+ }
2051
+ )
3598
2052
  ] }),
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);
2053
+ /* @__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) => {
2054
+ const key = [c2.location.rack, c2.location.aisle, c2.location.shelf, c2.location.bin].filter(Boolean).join("-") || String(idx);
3601
2055
  const aisleBreak = aisleEvery > 0 && idx > 0 && idx % aisleEvery === 0;
3602
- return /* @__PURE__ */ jsxs(be.Fragment, { children: [
2056
+ return /* @__PURE__ */ jsxs(ve.Fragment, { children: [
3603
2057
  aisleBreak && /* @__PURE__ */ jsx("div", { className: "nice-warehouse-view__aisle", "aria-hidden": true }),
3604
2058
  /* @__PURE__ */ jsx(
3605
2059
  "button",
@@ -3610,13 +2064,13 @@ const NiceWarehouseView = forwardRef(
3610
2064
  style: {
3611
2065
  width: cellSize,
3612
2066
  height: cellSize,
3613
- background: colorFor(c.occupancy, colors)
2067
+ background: colorFor(c2.occupancy, colors)
3614
2068
  },
3615
- title: `${key} — ${(c.occupancy * 100).toFixed(0)}% (${c.items.length} items)`,
3616
- onClick: () => onCellClick == null ? void 0 : onCellClick(c),
3617
- onMouseEnter: () => setHovered(c),
2069
+ title: t("warehouseView.items", "{key} — {occupancy}% ({items} items)").replace("{key}", String(key)).replace("{occupancy}", String((c2.occupancy * 100).toFixed(0))).replace("{items}", String(c2.items.length)),
2070
+ onClick: () => onCellClick == null ? void 0 : onCellClick(c2),
2071
+ onMouseEnter: () => setHovered(c2),
3618
2072
  onMouseLeave: () => setHovered(null),
3619
- children: /* @__PURE__ */ jsx("span", { className: "nice-warehouse-view__bin", children: c.location.bin ?? c.location.shelf ?? "" })
2073
+ children: /* @__PURE__ */ jsx("span", { className: "nice-warehouse-view__bin", children: c2.location.bin ?? c2.location.shelf ?? "" })
3620
2074
  }
3621
2075
  )
3622
2076
  ] }, key);
@@ -3629,12 +2083,7 @@ const NiceWarehouseView = forwardRef(
3629
2083
  "/",
3630
2084
  hovered.location.bin
3631
2085
  ] }),
3632
- /* @__PURE__ */ jsxs("div", { children: [
3633
- hovered.items.length,
3634
- " items · ",
3635
- (hovered.occupancy * 100).toFixed(0),
3636
- "% full"
3637
- ] }),
2086
+ /* @__PURE__ */ jsx("div", { children: t("warehouseView.itemsFull", "{items} items · {occupancy}% full").replace("{items}", String(hovered.items.length)).replace("{occupancy}", String((hovered.occupancy * 100).toFixed(0))) }),
3638
2087
  /* @__PURE__ */ jsxs("ul", { children: [
3639
2088
  hovered.items.slice(0, 5).map((it) => /* @__PURE__ */ jsxs("li", { children: [
3640
2089
  it.sku,
@@ -3650,14 +2099,15 @@ const NiceWarehouseView = forwardRef(
3650
2099
  ] });
3651
2100
  }
3652
2101
  );
2102
+ const EMPTY_ORDERS = [];
3653
2103
  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"
2104
+ draft: "var(--nice-text-muted, #6b7280)",
2105
+ "pending-approval": "var(--nice-color-warning, #ca8a04)",
2106
+ approved: "var(--nice-color-primary, #2563eb)",
2107
+ ordered: "var(--nice-color-info, #0891b2)",
2108
+ "partially-received": "var(--nice-color-accent, #9333ea)",
2109
+ received: "var(--nice-color-success, #16a34a)",
2110
+ cancelled: "var(--nice-color-error, #dc2626)"
3661
2111
  };
3662
2112
  function fmtMoney(amount, currency, locale) {
3663
2113
  const code = typeof currency === "string" ? currency : currency.code;
@@ -3673,168 +2123,156 @@ function fmtDate(d, locale) {
3673
2123
  const dt = d instanceof Date ? d : new Date(d);
3674
2124
  return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
3675
2125
  }
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",
2126
+ const NicePurchaseOrder = /* @__PURE__ */ forwardRef(function NicePurchaseOrder2({
2127
+ orders = EMPTY_ORDERS,
2128
+ selectable = true,
2129
+ initialSelectedId,
2130
+ locale,
2131
+ labels,
2132
+ readOnly,
2133
+ onOrderApprove,
2134
+ onReceiveItems,
2135
+ onOrderUpdate,
2136
+ className,
2137
+ style,
2138
+ id
2139
+ }, ref) {
2140
+ var _a;
2141
+ const { t } = v();
2142
+ const [selectedId, setSelectedId] = useState(
2143
+ initialSelectedId ?? ((_a = orders[0]) == null ? void 0 : _a.id)
2144
+ );
2145
+ const L = {
2146
+ orderNumber: "PO #",
2147
+ supplier: "Supplier",
2148
+ status: "Status",
2149
+ orderDate: "Ordered",
2150
+ expected: "Expected",
2151
+ total: "Total",
2152
+ sku: "SKU",
2153
+ name: "Item",
2154
+ qty: "Qty",
2155
+ received: "Recv",
2156
+ unitPrice: "Unit",
2157
+ lineTotal: "Subtotal",
2158
+ notes: "Notes",
2159
+ approve: "Approve",
2160
+ receive: "Receive all",
2161
+ ...labels
2162
+ };
2163
+ const selected = useMemo(
2164
+ () => orders.find((o) => o.id === selectedId),
2165
+ [orders, selectedId]
2166
+ );
2167
+ return /* @__PURE__ */ jsxs("div", { ref, id, className: `nice-purchase-order ${className ?? ""}`, style, children: [
2168
+ /* @__PURE__ */ jsxs("table", { className: "nice-purchase-order__list", children: [
2169
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
2170
+ /* @__PURE__ */ jsx("th", { children: L.orderNumber }),
2171
+ /* @__PURE__ */ jsx("th", { children: L.supplier }),
2172
+ /* @__PURE__ */ jsx("th", { children: L.status }),
2173
+ /* @__PURE__ */ jsx("th", { children: L.orderDate }),
2174
+ /* @__PURE__ */ jsx("th", { children: L.expected }),
2175
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.total })
2176
+ ] }) }),
2177
+ /* @__PURE__ */ jsx("tbody", { children: orders.map((o) => /* @__PURE__ */ jsxs(
2178
+ "tr",
3763
2179
  {
3764
- className: "nice-purchase-order__detail",
3765
- "aria-label": `${L.orderNumber} ${selected.orderNumber}`,
2180
+ "aria-selected": o.id === selectedId,
2181
+ className: o.id === selectedId ? "is-selected" : void 0,
2182
+ onClick: () => selectable && setSelectedId(o.id),
3766
2183
  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
- ] }),
2184
+ /* @__PURE__ */ jsx("td", { children: o.orderNumber }),
2185
+ /* @__PURE__ */ jsx("td", { children: o.supplier.name }),
2186
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("span", { style: { color: STATUS_TINT[o.status] }, children: [
2187
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "nice-purchase-order__dot" }),
3826
2188
  " ",
3827
- selected.notes
3828
- ] })
2189
+ o.status
2190
+ ] }) }),
2191
+ /* @__PURE__ */ jsx("td", { children: fmtDate(o.orderDate, locale) }),
2192
+ /* @__PURE__ */ jsx("td", { children: fmtDate(o.expectedDelivery, locale) }),
2193
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney(o.total.amount, o.total.currency, locale) })
3829
2194
  ]
3830
- }
3831
- )
3832
- ] });
3833
- }
3834
- );
3835
- const NiceHRDashboard = forwardRef(
2195
+ },
2196
+ o.id
2197
+ )) })
2198
+ ] }),
2199
+ selectable && selected && /* @__PURE__ */ jsxs(
2200
+ "section",
2201
+ {
2202
+ className: "nice-purchase-order__detail",
2203
+ "aria-label": `${L.orderNumber} ${selected.orderNumber}`,
2204
+ children: [
2205
+ /* @__PURE__ */ jsxs("header", { children: [
2206
+ /* @__PURE__ */ jsxs("h3", { children: [
2207
+ selected.orderNumber,
2208
+ " — ",
2209
+ selected.supplier.name
2210
+ ] }),
2211
+ !readOnly && /* @__PURE__ */ jsxs("div", { className: "nice-purchase-order__actions", children: [
2212
+ selected.status === "pending-approval" && onOrderApprove && /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onOrderApprove(selected.id), children: L.approve }),
2213
+ (selected.status === "ordered" || selected.status === "partially-received") && onReceiveItems && /* @__PURE__ */ jsx(
2214
+ "button",
2215
+ {
2216
+ type: "button",
2217
+ onClick: () => onReceiveItems(
2218
+ selected.id,
2219
+ selected.items.map((it) => ({
2220
+ itemId: it.itemId,
2221
+ quantity: it.quantity - (it.receivedQuantity ?? 0)
2222
+ }))
2223
+ ),
2224
+ children: L.receive
2225
+ }
2226
+ ),
2227
+ onOrderUpdate && selected.status === "draft" && /* @__PURE__ */ jsx(
2228
+ "button",
2229
+ {
2230
+ type: "button",
2231
+ onClick: () => onOrderUpdate({ ...selected, status: "pending-approval" }),
2232
+ children: t("purchaseOrder.submit", "Submit")
2233
+ }
2234
+ )
2235
+ ] })
2236
+ ] }),
2237
+ /* @__PURE__ */ jsxs("table", { className: "nice-purchase-order__items", children: [
2238
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
2239
+ /* @__PURE__ */ jsx("th", { children: L.sku }),
2240
+ /* @__PURE__ */ jsx("th", { children: L.name }),
2241
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.qty }),
2242
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.received }),
2243
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.unitPrice }),
2244
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.lineTotal })
2245
+ ] }) }),
2246
+ /* @__PURE__ */ jsx("tbody", { children: selected.items.map((it) => /* @__PURE__ */ jsxs("tr", { children: [
2247
+ /* @__PURE__ */ jsx("td", { children: it.sku }),
2248
+ /* @__PURE__ */ jsx("td", { children: it.itemName }),
2249
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: it.quantity }),
2250
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: it.receivedQuantity ?? 0 }),
2251
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney(it.unitPrice.amount, it.unitPrice.currency, locale) }),
2252
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney(it.lineTotal.amount, it.lineTotal.currency, locale) })
2253
+ ] }, it.itemId)) }),
2254
+ /* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsxs("tr", { children: [
2255
+ /* @__PURE__ */ jsx("td", { colSpan: 5, className: "nice-num", children: L.total }),
2256
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: /* @__PURE__ */ jsx("strong", { children: fmtMoney(selected.total.amount, selected.total.currency, locale) }) })
2257
+ ] }) })
2258
+ ] }),
2259
+ selected.notes && /* @__PURE__ */ jsxs("p", { className: "nice-purchase-order__notes", children: [
2260
+ /* @__PURE__ */ jsxs("strong", { children: [
2261
+ L.notes,
2262
+ ":"
2263
+ ] }),
2264
+ " ",
2265
+ selected.notes
2266
+ ] })
2267
+ ]
2268
+ }
2269
+ )
2270
+ ] });
2271
+ });
2272
+ const EMPTY_EMPLOYEES = [];
2273
+ const NiceHRDashboard = /* @__PURE__ */ forwardRef(
3836
2274
  function NiceHRDashboard2({
3837
- employees,
2275
+ employees = EMPTY_EMPLOYEES,
3838
2276
  labels,
3839
2277
  hideWidgets,
3840
2278
  locale,
@@ -3844,6 +2282,7 @@ const NiceHRDashboard = forwardRef(
3844
2282
  style,
3845
2283
  id
3846
2284
  }, ref) {
2285
+ const { t } = v();
3847
2286
  const L = {
3848
2287
  headcount: "Headcount",
3849
2288
  fte: "FTE",
@@ -3894,7 +2333,7 @@ const NiceHRDashboard = forwardRef(
3894
2333
  className: `nice-hr-dashboard nice-hr-dashboard--${density} ${className ?? ""}`,
3895
2334
  style,
3896
2335
  role: "group",
3897
- "aria-label": "HR dashboard",
2336
+ "aria-label": t("hrDashboard.hrDashboard", "HR dashboard"),
3898
2337
  children: [
3899
2338
  !(hideWidgets == null ? void 0 : hideWidgets.headcount) && /* @__PURE__ */ jsx(
3900
2339
  Widget,
@@ -3996,7 +2435,7 @@ function useMockErpApi(options = {}) {
3996
2435
  }
3997
2436
  setData((d) => {
3998
2437
  const arr = [...d[key]];
3999
- const idx = arr.findIndex((i) => i.id === item.id);
2438
+ const idx = arr.findIndex((i2) => i2.id === item.id);
4000
2439
  if (idx >= 0) {
4001
2440
  arr[idx] = item;
4002
2441
  } else {
@@ -4019,118 +2458,128 @@ function useMockErpApi(options = {}) {
4019
2458
  resources: data.resources,
4020
2459
  vatRates: data.vatRates,
4021
2460
  refresh,
4022
- upsertInvoice: (i) => writeWith("invoices", i),
2461
+ upsertInvoice: (i2) => writeWith("invoices", i2),
4023
2462
  upsertPurchaseOrder: (p) => writeWith("purchaseOrders", p),
4024
- upsertInventory: (i) => writeWith("inventory", i)
2463
+ upsertInventory: (i2) => writeWith("inventory", i2)
4025
2464
  }),
4026
2465
  [loading, error, data, refresh, writeWith]
4027
2466
  );
4028
2467
  }
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;
2468
+ const NiceVatTable = /* @__PURE__ */ forwardRef(
2469
+ function NiceVatTable2({
2470
+ country = "PL",
2471
+ rates,
2472
+ editable = false,
2473
+ onChange,
2474
+ onRemove,
2475
+ locale,
2476
+ labels,
2477
+ density = "comfortable",
2478
+ className,
2479
+ style,
2480
+ id
2481
+ }, ref) {
2482
+ const { t } = v();
2483
+ const [internal, setInternal] = useState(rates ?? NICE_VAT_PRESETS[country]);
2484
+ const L = {
2485
+ code: "Code",
2486
+ rate: "Rate",
2487
+ label: t("vatTable.label", "Label"),
2488
+ description: t("vatTable.description", "Description"),
2489
+ add: "+ Add",
2490
+ remove: "Remove",
2491
+ ...labels
2492
+ };
2493
+ const update = useCallback(
2494
+ (next) => {
2495
+ setInternal(next);
2496
+ onChange == null ? void 0 : onChange(next);
2497
+ },
2498
+ [onChange]
2499
+ );
2500
+ const onCellEdit = (idx, key, raw) => {
2501
+ const next = [...internal];
2502
+ const r = { ...next[idx] };
2503
+ if (key === "rate") {
2504
+ const n = Number(raw.replace(",", "."));
2505
+ if (!Number.isFinite(n)) {
2506
+ return;
2507
+ }
2508
+ r.rate = n > 1 ? n / 100 : n;
2509
+ } else if (key === "code" || key === "label" || key === "description") {
2510
+ r[key] = raw;
4066
2511
  }
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
- });
2512
+ next[idx] = r;
2513
+ update(next);
2514
+ };
2515
+ const addRow = () => {
2516
+ update([...internal, { code: `NEW-${internal.length + 1}`, rate: 0, label: "0%" }]);
2517
+ };
2518
+ const removeRow = (idx) => {
2519
+ const code = internal[idx].code;
2520
+ const next = internal.filter((_, i2) => i2 !== idx);
2521
+ update(next);
2522
+ onRemove == null ? void 0 : onRemove(code);
2523
+ };
2524
+ return /* @__PURE__ */ jsxs(
2525
+ "div",
2526
+ {
2527
+ ref,
2528
+ id,
2529
+ className: `nice-vat-table nice-vat-table--${density} ${className ?? ""}`,
2530
+ style,
2531
+ children: [
2532
+ /* @__PURE__ */ jsxs("table", { children: [
2533
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
2534
+ /* @__PURE__ */ jsx("th", { children: L.code }),
2535
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.rate }),
2536
+ /* @__PURE__ */ jsx("th", { children: L.label }),
2537
+ /* @__PURE__ */ jsx("th", { children: L.description }),
2538
+ editable && /* @__PURE__ */ jsx("th", { "aria-label": L.remove })
2539
+ ] }) }),
2540
+ /* @__PURE__ */ jsx("tbody", { children: internal.map((r, idx) => /* @__PURE__ */ jsxs("tr", { children: [
2541
+ /* @__PURE__ */ jsx("td", { children: editable ? /* @__PURE__ */ jsx(
2542
+ "input",
2543
+ {
2544
+ value: r.code,
2545
+ onChange: (e) => onCellEdit(idx, "code", e.target.value)
2546
+ }
2547
+ ) : r.code }),
2548
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: editable ? /* @__PURE__ */ jsx(
2549
+ "input",
2550
+ {
2551
+ type: "number",
2552
+ step: "0.01",
2553
+ min: 0,
2554
+ max: 1,
2555
+ value: r.rate,
2556
+ onChange: (e) => onCellEdit(idx, "rate", e.target.value)
2557
+ }
2558
+ ) : `${(r.rate * 100).toLocaleString(locale, { maximumFractionDigits: 2 })}%` }),
2559
+ /* @__PURE__ */ jsx("td", { children: editable ? /* @__PURE__ */ jsx(
2560
+ "input",
2561
+ {
2562
+ value: r.label ?? "",
2563
+ onChange: (e) => onCellEdit(idx, "label", e.target.value)
2564
+ }
2565
+ ) : r.label ?? "" }),
2566
+ /* @__PURE__ */ jsx("td", { children: editable ? /* @__PURE__ */ jsx(
2567
+ "input",
2568
+ {
2569
+ value: r.description ?? "",
2570
+ onChange: (e) => onCellEdit(idx, "description", e.target.value)
2571
+ }
2572
+ ) : r.description ?? "" }),
2573
+ editable && /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("button", { type: "button", onClick: () => removeRow(idx), "aria-label": L.remove, children: /* @__PURE__ */ jsx(ae, { name: "close", size: 14 }) }) })
2574
+ ] }, r.code)) })
2575
+ ] }),
2576
+ editable && /* @__PURE__ */ jsx("button", { type: "button", className: "nice-vat-table__add", onClick: addRow, children: L.add })
2577
+ ]
2578
+ }
2579
+ );
2580
+ }
2581
+ );
2582
+ const EMPTY_INVOICES = [];
4134
2583
  function pad(n) {
4135
2584
  return n < 10 ? `0${n}` : String(n);
4136
2585
  }
@@ -4171,9 +2620,9 @@ function defaultBuildXml(opts) {
4171
2620
  let vat = 0;
4172
2621
  for (const ln of inv.lines) {
4173
2622
  const n = Math.round(ln.quantity * ln.unitPrice.amount * (1 - (ln.discount ?? 0)));
4174
- const v = Math.round(n * ln.vatRate);
2623
+ const v2 = Math.round(n * ln.vatRate);
4175
2624
  net += n;
4176
- vat += v;
2625
+ vat += v2;
4177
2626
  }
4178
2627
  lines.push(` <SumaNetto>${(net / 100).toFixed(2)}</SumaNetto>`);
4179
2628
  lines.push(` <SumaVAT>${(vat / 100).toFixed(2)}</SumaVAT>`);
@@ -4183,9 +2632,9 @@ function defaultBuildXml(opts) {
4183
2632
  lines.push("</JPK>");
4184
2633
  return lines.join("\n");
4185
2634
  }
4186
- const NiceJpkExporter = forwardRef(
2635
+ const NiceJpkExporter = /* @__PURE__ */ forwardRef(
4187
2636
  function NiceJpkExporter2({
4188
- invoices,
2637
+ invoices = EMPTY_INVOICES,
4189
2638
  taxpayer,
4190
2639
  defaultFormat = "JPK_V7M",
4191
2640
  defaultPeriod,
@@ -4197,6 +2646,7 @@ const NiceJpkExporter = forwardRef(
4197
2646
  style,
4198
2647
  id
4199
2648
  }, ref) {
2649
+ const { t } = v();
4200
2650
  const today = /* @__PURE__ */ new Date();
4201
2651
  const [format, setFormat] = useState(defaultFormat);
4202
2652
  const [from, setFrom] = useState(
@@ -4225,12 +2675,12 @@ const NiceJpkExporter = forwardRef(
4225
2675
  onExport == null ? void 0 : onExport(xml, blob, opts);
4226
2676
  if (typeof window !== "undefined" && typeof URL.createObjectURL === "function") {
4227
2677
  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();
2678
+ const a2 = document.createElement("a");
2679
+ a2.href = url;
2680
+ a2.download = filename;
2681
+ document.body.appendChild(a2);
2682
+ a2.click();
2683
+ a2.remove();
4234
2684
  URL.revokeObjectURL(url);
4235
2685
  }
4236
2686
  }, [format, from, to, taxpayer, invoices, buildXml, onExport, filenameFor]);
@@ -4259,10 +2709,10 @@ const NiceJpkExporter = forwardRef(
4259
2709
  /* @__PURE__ */ jsx("input", { type: "date", value: to, onChange: (e) => setTo(e.target.value) })
4260
2710
  ] }),
4261
2711
  /* @__PURE__ */ jsx("button", { type: "button", onClick: exportNow, children: L.export }),
4262
- /* @__PURE__ */ jsxs("small", { children: [
4263
- invoices.length,
4264
- " invoices ready"
4265
- ] })
2712
+ /* @__PURE__ */ jsx("small", { children: t("jpkExporter.invoicesReady", "{invoices} invoices ready").replace(
2713
+ "{invoices}",
2714
+ String(invoices.length)
2715
+ ) })
4266
2716
  ] });
4267
2717
  }
4268
2718
  );