@ikatec/nebula-react 1.0.14 → 1.0.16

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.js CHANGED
@@ -8,6 +8,7 @@ var jsxRuntime = require('react/jsx-runtime');
8
8
  var PopoverPrimitive = require('@radix-ui/react-popover');
9
9
  var LabelPrimitive = require('@radix-ui/react-label');
10
10
  var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
11
+ var lucideReact = require('lucide-react');
11
12
  var SeparatorPrimitive = require('@radix-ui/react-separator');
12
13
  var Select = require('react-select');
13
14
  var Creatable = require('react-select/creatable');
@@ -23,6 +24,9 @@ var TabsPrimitive = require('@radix-ui/react-tabs');
23
24
  var sonner = require('sonner');
24
25
  var RPNInput = require('react-phone-number-input');
25
26
  var flags = require('react-phone-number-input/flags');
27
+ var dateFns = require('date-fns');
28
+ var reactDayPicker = require('react-day-picker');
29
+ var locale = require('react-day-picker/locale');
26
30
 
27
31
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
28
32
 
@@ -535,193 +539,6 @@ var TableCell = React8__namespace.forwardRef(({ className, ...props }, ref) => /
535
539
  TableCell.displayName = "TableCell";
536
540
  var TableCaption = React8__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("caption", { ref, className: cn("mt-4 text-sm", className), ...props }));
537
541
  TableCaption.displayName = "TableCaption";
538
-
539
- // ../../node_modules/lucide-react/dist/esm/shared/src/utils.js
540
- var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
541
- var mergeClasses = (...classes) => classes.filter((className, index, array) => {
542
- return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
543
- }).join(" ").trim();
544
-
545
- // ../../node_modules/lucide-react/dist/esm/defaultAttributes.js
546
- var defaultAttributes = {
547
- xmlns: "http://www.w3.org/2000/svg",
548
- width: 24,
549
- height: 24,
550
- viewBox: "0 0 24 24",
551
- fill: "none",
552
- stroke: "currentColor",
553
- strokeWidth: 2,
554
- strokeLinecap: "round",
555
- strokeLinejoin: "round"
556
- };
557
-
558
- // ../../node_modules/lucide-react/dist/esm/Icon.js
559
- var Icon = React8.forwardRef(
560
- ({
561
- color: color2 = "currentColor",
562
- size: size4 = 24,
563
- strokeWidth = 2,
564
- absoluteStrokeWidth,
565
- className = "",
566
- children,
567
- iconNode,
568
- ...rest
569
- }, ref) => {
570
- return React8.createElement(
571
- "svg",
572
- {
573
- ref,
574
- ...defaultAttributes,
575
- width: size4,
576
- height: size4,
577
- stroke: color2,
578
- strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size4) : strokeWidth,
579
- className: mergeClasses("lucide", className),
580
- ...rest
581
- },
582
- [
583
- ...iconNode.map(([tag, attrs]) => React8.createElement(tag, attrs)),
584
- ...Array.isArray(children) ? children : [children]
585
- ]
586
- );
587
- }
588
- );
589
-
590
- // ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
591
- var createLucideIcon = (iconName, iconNode) => {
592
- const Component = React8.forwardRef(
593
- ({ className, ...props }, ref) => React8.createElement(Icon, {
594
- ref,
595
- iconNode,
596
- className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
597
- ...props
598
- })
599
- );
600
- Component.displayName = `${iconName}`;
601
- return Component;
602
- };
603
-
604
- // ../../node_modules/lucide-react/dist/esm/icons/check.js
605
- var __iconNode = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
606
- var Check = createLucideIcon("Check", __iconNode);
607
-
608
- // ../../node_modules/lucide-react/dist/esm/icons/chevron-down.js
609
- var __iconNode2 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
610
- var ChevronDown = createLucideIcon("ChevronDown", __iconNode2);
611
-
612
- // ../../node_modules/lucide-react/dist/esm/icons/chevron-left.js
613
- var __iconNode3 = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
614
- var ChevronLeft = createLucideIcon("ChevronLeft", __iconNode3);
615
-
616
- // ../../node_modules/lucide-react/dist/esm/icons/chevron-right.js
617
- var __iconNode4 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
618
- var ChevronRight = createLucideIcon("ChevronRight", __iconNode4);
619
-
620
- // ../../node_modules/lucide-react/dist/esm/icons/chevrons-left.js
621
- var __iconNode5 = [
622
- ["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
623
- ["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
624
- ];
625
- var ChevronsLeft = createLucideIcon("ChevronsLeft", __iconNode5);
626
-
627
- // ../../node_modules/lucide-react/dist/esm/icons/chevrons-right.js
628
- var __iconNode6 = [
629
- ["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
630
- ["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
631
- ];
632
- var ChevronsRight = createLucideIcon("ChevronsRight", __iconNode6);
633
-
634
- // ../../node_modules/lucide-react/dist/esm/icons/circle-check-big.js
635
- var __iconNode7 = [
636
- ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
637
- ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
638
- ];
639
- var CircleCheckBig = createLucideIcon("CircleCheckBig", __iconNode7);
640
-
641
- // ../../node_modules/lucide-react/dist/esm/icons/circle-x.js
642
- var __iconNode8 = [
643
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
644
- ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
645
- ["path", { d: "m9 9 6 6", key: "z0biqf" }]
646
- ];
647
- var CircleX = createLucideIcon("CircleX", __iconNode8);
648
-
649
- // ../../node_modules/lucide-react/dist/esm/icons/circle.js
650
- var __iconNode9 = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
651
- var Circle = createLucideIcon("Circle", __iconNode9);
652
-
653
- // ../../node_modules/lucide-react/dist/esm/icons/ellipsis.js
654
- var __iconNode10 = [
655
- ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
656
- ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
657
- ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
658
- ];
659
- var Ellipsis = createLucideIcon("Ellipsis", __iconNode10);
660
-
661
- // ../../node_modules/lucide-react/dist/esm/icons/eye-off.js
662
- var __iconNode11 = [
663
- [
664
- "path",
665
- {
666
- d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
667
- key: "ct8e1f"
668
- }
669
- ],
670
- ["path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242", key: "151rxh" }],
671
- [
672
- "path",
673
- {
674
- d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
675
- key: "13bj9a"
676
- }
677
- ],
678
- ["path", { d: "m2 2 20 20", key: "1ooewy" }]
679
- ];
680
- var EyeOff = createLucideIcon("EyeOff", __iconNode11);
681
-
682
- // ../../node_modules/lucide-react/dist/esm/icons/eye.js
683
- var __iconNode12 = [
684
- [
685
- "path",
686
- {
687
- d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
688
- key: "1nclc0"
689
- }
690
- ],
691
- ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
692
- ];
693
- var Eye = createLucideIcon("Eye", __iconNode12);
694
-
695
- // ../../node_modules/lucide-react/dist/esm/icons/info.js
696
- var __iconNode13 = [
697
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
698
- ["path", { d: "M12 16v-4", key: "1dtifu" }],
699
- ["path", { d: "M12 8h.01", key: "e9boi3" }]
700
- ];
701
- var Info = createLucideIcon("Info", __iconNode13);
702
-
703
- // ../../node_modules/lucide-react/dist/esm/icons/minus.js
704
- var __iconNode14 = [["path", { d: "M5 12h14", key: "1ays0h" }]];
705
- var Minus = createLucideIcon("Minus", __iconNode14);
706
-
707
- // ../../node_modules/lucide-react/dist/esm/icons/phone.js
708
- var __iconNode15 = [
709
- [
710
- "path",
711
- {
712
- d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",
713
- key: "foiqr5"
714
- }
715
- ]
716
- ];
717
- var Phone = createLucideIcon("Phone", __iconNode15);
718
-
719
- // ../../node_modules/lucide-react/dist/esm/icons/x.js
720
- var __iconNode16 = [
721
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
722
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
723
- ];
724
- var X = createLucideIcon("X", __iconNode16);
725
542
  var DropdownMenu = DropdownMenuPrimitive__namespace.Root;
726
543
  var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
727
544
  var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
@@ -754,7 +571,7 @@ var DropdownMenuSubTrigger = React8__namespace.forwardRef(({ className, inset, c
754
571
  ...props,
755
572
  children: [
756
573
  children,
757
- /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { className: "nebula-ds ml-auto size-4" })
574
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "nebula-ds ml-auto size-4" })
758
575
  ]
759
576
  }
760
577
  ));
@@ -879,7 +696,7 @@ var DropdownMenuCheckboxItem = React8__namespace.forwardRef(({ className, childr
879
696
  checked,
880
697
  ...props,
881
698
  children: [
882
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { className: "nebula-ds absolute left-4 h-11 w-4 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(Check, { className: "nebula-ds h-4 w-4" }) }),
699
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { className: "nebula-ds absolute left-4 h-11 w-4 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "nebula-ds h-4 w-4" }) }),
883
700
  children
884
701
  ]
885
702
  }
@@ -915,7 +732,7 @@ var DropdownMenuRadioItem = React8__namespace.forwardRef(({ className, children,
915
732
  ),
916
733
  ...props,
917
734
  children: [
918
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { className: "nebula-ds absolute left-4 flex h-11 w-2 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(Circle, { className: "nebula-ds h-2 w-2 fill-current" }) }),
735
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { className: "nebula-ds absolute left-4 flex h-11 w-2 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "nebula-ds h-2 w-2 fill-current" }) }),
919
736
  children
920
737
  ]
921
738
  }
@@ -1327,15 +1144,29 @@ var messages3 = {
1327
1144
  };
1328
1145
  var input_phone_default = messages3;
1329
1146
 
1147
+ // src/i18n/messages/en/time-picker.ts
1148
+ var messages4 = {
1149
+ label: "Time"
1150
+ };
1151
+ var time_picker_default = messages4;
1152
+
1153
+ // src/i18n/messages/en/file-upload.ts
1154
+ var messages5 = {
1155
+ deleteAll: "Remove all"
1156
+ };
1157
+ var file_upload_default = messages5;
1158
+
1330
1159
  // src/i18n/messages/en/index.ts
1331
1160
  var enMessages = {
1332
1161
  pagination: pagination_default,
1333
1162
  inputSelect: input_select_default,
1334
- inputPhone: input_phone_default
1163
+ inputPhone: input_phone_default,
1164
+ timePicker: time_picker_default,
1165
+ fileUpload: file_upload_default
1335
1166
  };
1336
1167
 
1337
1168
  // src/i18n/messages/es/pagination.ts
1338
- var messages4 = {
1169
+ var messages6 = {
1339
1170
  totalResultsLabel(pagesSize, totalResults) {
1340
1171
  if (totalResults < pagesSize) {
1341
1172
  pagesSize = totalResults;
@@ -1346,16 +1177,16 @@ var messages4 = {
1346
1177
  return `P\xE1gina ${currentPage} de ${totalPages}`;
1347
1178
  }
1348
1179
  };
1349
- var pagination_default2 = messages4;
1180
+ var pagination_default2 = messages6;
1350
1181
 
1351
1182
  // src/i18n/messages/es/input-select.ts
1352
- var messages5 = {
1183
+ var messages7 = {
1353
1184
  noOptions: "No hay opciones disponibles"
1354
1185
  };
1355
- var input_select_default2 = messages5;
1186
+ var input_select_default2 = messages7;
1356
1187
 
1357
1188
  // src/i18n/messages/es/input-phone.ts
1358
- var messages6 = {
1189
+ var messages8 = {
1359
1190
  countries: {
1360
1191
  empty: "Seleccionar",
1361
1192
  AF: "Afganist\xE1n",
@@ -1605,17 +1436,31 @@ var messages6 = {
1605
1436
  ZW: "Zimbabue"
1606
1437
  }
1607
1438
  };
1608
- var input_phone_default2 = messages6;
1439
+ var input_phone_default2 = messages8;
1440
+
1441
+ // src/i18n/messages/es/time-picker.ts
1442
+ var messages9 = {
1443
+ label: "Tiempo"
1444
+ };
1445
+ var time_picker_default2 = messages9;
1446
+
1447
+ // src/i18n/messages/es/file-upload.ts
1448
+ var messages10 = {
1449
+ deleteAll: "Remover todos"
1450
+ };
1451
+ var file_upload_default2 = messages10;
1609
1452
 
1610
1453
  // src/i18n/messages/es/index.ts
1611
1454
  var esMessages = {
1612
1455
  pagination: pagination_default2,
1613
1456
  inputSelect: input_select_default2,
1614
- inputPhone: input_phone_default2
1457
+ inputPhone: input_phone_default2,
1458
+ timePicker: time_picker_default2,
1459
+ fileUpload: file_upload_default2
1615
1460
  };
1616
1461
 
1617
1462
  // src/i18n/messages/pt-br/pagination.ts
1618
- var messages7 = {
1463
+ var messages11 = {
1619
1464
  totalResultsLabel(pagesSize, totalResults) {
1620
1465
  if (totalResults < pagesSize) {
1621
1466
  pagesSize = totalResults;
@@ -1626,16 +1471,16 @@ var messages7 = {
1626
1471
  return `P\xE1gina ${currentPage} de ${totalPages}`;
1627
1472
  }
1628
1473
  };
1629
- var pagination_default3 = messages7;
1474
+ var pagination_default3 = messages11;
1630
1475
 
1631
1476
  // src/i18n/messages/pt-br/input-select.ts
1632
- var messages8 = {
1477
+ var messages12 = {
1633
1478
  noOptions: "Nenhuma op\xE7\xE3o dispon\xEDvel"
1634
1479
  };
1635
- var input_select_default3 = messages8;
1480
+ var input_select_default3 = messages12;
1636
1481
 
1637
1482
  // src/i18n/messages/pt-br/input-phone.ts
1638
- var messages9 = {
1483
+ var messages13 = {
1639
1484
  countries: {
1640
1485
  empty: "Selecione",
1641
1486
  AF: "Afeganist\xE3o",
@@ -1885,13 +1730,27 @@ var messages9 = {
1885
1730
  ZW: "Zimb\xE1bue"
1886
1731
  }
1887
1732
  };
1888
- var input_phone_default3 = messages9;
1733
+ var input_phone_default3 = messages13;
1734
+
1735
+ // src/i18n/messages/pt-br/time-picker.ts
1736
+ var messages14 = {
1737
+ label: "Hor\xE1rio"
1738
+ };
1739
+ var time_picker_default3 = messages14;
1740
+
1741
+ // src/i18n/messages/pt-br/file-upload.ts
1742
+ var messages15 = {
1743
+ deleteAll: "Remover todos"
1744
+ };
1745
+ var file_upload_default3 = messages15;
1889
1746
 
1890
1747
  // src/i18n/messages/pt-br/index.ts
1891
1748
  var ptBrMessages = {
1892
1749
  pagination: pagination_default3,
1893
1750
  inputSelect: input_select_default3,
1894
- inputPhone: input_phone_default3
1751
+ inputPhone: input_phone_default3,
1752
+ timePicker: time_picker_default3,
1753
+ fileUpload: file_upload_default3
1895
1754
  };
1896
1755
 
1897
1756
  // src/i18n/message-storage-handler.ts
@@ -1916,7 +1775,7 @@ var setNebulaLanguage = (language) => {
1916
1775
  }
1917
1776
  localStorage.setItem(getNebulaI18nStorageKey(), language);
1918
1777
  };
1919
- var messages10 = /* @__PURE__ */ new Map([
1778
+ var messages16 = /* @__PURE__ */ new Map([
1920
1779
  [null, enMessages],
1921
1780
  [void 0, enMessages],
1922
1781
  ["en-US", enMessages],
@@ -1934,14 +1793,14 @@ var NebulaI18nProvider = ({
1934
1793
  () => customI18nStorageKey ?? localStorageKey,
1935
1794
  [customI18nStorageKey]
1936
1795
  );
1937
- const [messages11, setMessages] = React8.useState(
1938
- messages10.get(getNebulaLanguage()) ?? messages10.get("en-US")
1796
+ const [messages17, setMessages] = React8.useState(
1797
+ messages16.get(getNebulaLanguage()) ?? messages16.get("en-US")
1939
1798
  );
1940
1799
  const handleStorageChange = React8.useCallback(
1941
1800
  ({ detail }) => {
1942
1801
  if (detail.key === storageKey) {
1943
1802
  setMessages(
1944
- messages10.get(detail.value) ?? messages10.get("en-US")
1803
+ messages16.get(detail.value) ?? messages16.get("en-US")
1945
1804
  );
1946
1805
  }
1947
1806
  },
@@ -1981,7 +1840,16 @@ var NebulaI18nProvider = ({
1981
1840
  localStorage.removeItem(localStorageKey);
1982
1841
  localStorage.setItem(customNebulaI18nStorageKey, customI18nStorageKey);
1983
1842
  }, [customI18nStorageKey]);
1984
- return /* @__PURE__ */ jsxRuntime.jsx(NebulaI18nContext.Provider, { value: { messages: messages11 }, children });
1843
+ return /* @__PURE__ */ jsxRuntime.jsx(
1844
+ NebulaI18nContext.Provider,
1845
+ {
1846
+ value: {
1847
+ messages: messages17,
1848
+ locale: getNebulaLanguage()
1849
+ },
1850
+ children
1851
+ }
1852
+ );
1985
1853
  };
1986
1854
  var useNebulaI18n = () => {
1987
1855
  const context = React8.useContext(NebulaI18nContext);
@@ -1998,7 +1866,7 @@ var Pagination = ({
1998
1866
  onChangePage,
1999
1867
  ...props
2000
1868
  }) => {
2001
- const { messages: messages11 } = useNebulaI18n();
1869
+ const { messages: messages17 } = useNebulaI18n();
2002
1870
  const totalPages = React8.useMemo(() => {
2003
1871
  return Math.ceil(total / (pageSize || 1));
2004
1872
  }, [total, pageSize]);
@@ -2031,13 +1899,13 @@ var Pagination = ({
2031
1899
  }, [totalPages, pageSize, total]);
2032
1900
  const totalResultsLabel = React8.useMemo(() => {
2033
1901
  if (page === totalPages) {
2034
- return messages11.pagination.totalResultsLabel(lastPageSize, total);
1902
+ return messages17.pagination.totalResultsLabel(lastPageSize, total);
2035
1903
  }
2036
- return messages11.pagination.totalResultsLabel(pageSize, total);
2037
- }, [messages11.pagination, pageSize, total, page, totalPages, lastPageSize]);
1904
+ return messages17.pagination.totalResultsLabel(pageSize, total);
1905
+ }, [messages17.pagination, pageSize, total, page, totalPages, lastPageSize]);
2038
1906
  const currentPageLabel = React8.useMemo(
2039
- () => messages11.pagination.currentPageLabel(normalizedPage, totalPages),
2040
- [messages11.pagination, normalizedPage, totalPages]
1907
+ () => messages17.pagination.currentPageLabel(normalizedPage, totalPages),
1908
+ [messages17.pagination, normalizedPage, totalPages]
2041
1909
  );
2042
1910
  return /* @__PURE__ */ jsxRuntime.jsxs(
2043
1911
  "nav",
@@ -2157,7 +2025,7 @@ var PaginationButtonFirstPage = ({ ...props }) => /* @__PURE__ */ jsxRuntime.jsx
2157
2025
  "aria-label": "Go to previous chunk",
2158
2026
  "data-testid": "nebula-pagination-button-first-page",
2159
2027
  ...props,
2160
- children: /* @__PURE__ */ jsxRuntime.jsx(ChevronsLeft, { className: "nebula-ds h-4 w-4" })
2028
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeft, { className: "nebula-ds h-4 w-4" })
2161
2029
  }
2162
2030
  );
2163
2031
  PaginationButtonFirstPage.displayName = "PaginationButtonFirstPage";
@@ -2169,7 +2037,7 @@ var PaginationButtonPreviousPage = ({
2169
2037
  "aria-label": "Go to previous page",
2170
2038
  "data-testid": "nebula-pagination-button-previous-page",
2171
2039
  ...props,
2172
- children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeft, { className: "nebula-ds h-4" })
2040
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "nebula-ds h-4" })
2173
2041
  }
2174
2042
  );
2175
2043
  PaginationButtonPreviousPage.displayName = "PaginationButtonPreviousPage";
@@ -2181,7 +2049,7 @@ var PaginationButtonNextPage = ({
2181
2049
  "aria-label": "Go to next page",
2182
2050
  "data-testid": "nebula-pagination-button-next-page",
2183
2051
  ...props,
2184
- children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { className: "nebula-ds h-4" })
2052
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "nebula-ds h-4" })
2185
2053
  }
2186
2054
  );
2187
2055
  PaginationButtonNextPage.displayName = "PaginationButtonNextPage";
@@ -2191,7 +2059,7 @@ var PaginationButtonLastPage = ({ ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
2191
2059
  "aria-label": "Go to next chunk",
2192
2060
  "data-testid": "nebula-pagination-button-last-page",
2193
2061
  ...props,
2194
- children: /* @__PURE__ */ jsxRuntime.jsx(ChevronsRight, { className: "nebula-ds h-4 w-4" })
2062
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsRight, { className: "nebula-ds h-4 w-4" })
2195
2063
  }
2196
2064
  );
2197
2065
  PaginationButtonLastPage.displayName = "PaginationButtonLastPage";
@@ -2231,23 +2099,23 @@ var Tag = React8__namespace.forwardRef(
2231
2099
  children: [
2232
2100
  color2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(tagVariantsConfig({ color: color2 })) }),
2233
2101
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds text-tag-text text-xs font-medium px-1 leading-none", children }),
2234
- onDelete && /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onDelete, children: /* @__PURE__ */ jsxRuntime.jsx(CircleX, { className: "nebula-ds w-3 h-3 block rounded-sm text-tag-icon" }) })
2102
+ onDelete && /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onDelete, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleX, { className: "nebula-ds w-3 h-3 block rounded-sm text-tag-icon" }) })
2235
2103
  ]
2236
2104
  }
2237
2105
  );
2238
2106
  }
2239
2107
  );
2240
2108
  Tag.displayName = "Tag";
2241
- var DropdownIndicator = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.DropdownIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: "16px" }) });
2109
+ var DropdownIndicator = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.DropdownIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { size: "16px" }) });
2242
2110
  var ClearIndicator = (props) => /* @__PURE__ */ jsxRuntime.jsx(
2243
2111
  Select.components.ClearIndicator,
2244
2112
  {
2245
2113
  ...props,
2246
2114
  className: cn(props.className, "cursor-pointer"),
2247
- children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: "16px" })
2115
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: "16px" })
2248
2116
  }
2249
2117
  );
2250
- var MultiValueRemove = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.MultiValueRemove, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(CircleX, { size: "16px" }) });
2118
+ var MultiValueRemove = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.MultiValueRemove, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleX, { size: "16px" }) });
2251
2119
  var Option = (props) => {
2252
2120
  const { isSelected, data, innerRef, innerProps } = props;
2253
2121
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2273,7 +2141,7 @@ var Option = (props) => {
2273
2141
  }
2274
2142
  ),
2275
2143
  children: [
2276
- isSelected && /* @__PURE__ */ jsxRuntime.jsx(Check, { size: "16px" }),
2144
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: "16px" }),
2277
2145
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: data.label })
2278
2146
  ]
2279
2147
  }
@@ -2310,7 +2178,7 @@ var createStyledSelect = (BaseSelect, displayName) => {
2310
2178
  isError = false,
2311
2179
  ...props
2312
2180
  }) => {
2313
- const { messages: messages11 } = useNebulaI18n();
2181
+ const { messages: messages17 } = useNebulaI18n();
2314
2182
  const customClassNames = React8.useMemo(() => {
2315
2183
  return {
2316
2184
  control: (props2) => controlStyles(props2, isError),
@@ -2357,7 +2225,7 @@ var createStyledSelect = (BaseSelect, displayName) => {
2357
2225
  isDisabled: disabled,
2358
2226
  components: customComponents,
2359
2227
  classNames: customClassNames,
2360
- noOptionsMessage: () => /* @__PURE__ */ jsxRuntime.jsx("p", { children: messages11.inputSelect.noOptions }),
2228
+ noOptionsMessage: () => /* @__PURE__ */ jsxRuntime.jsx("p", { children: messages17.inputSelect.noOptions }),
2361
2229
  ...props
2362
2230
  }
2363
2231
  );
@@ -2373,7 +2241,15 @@ var StyledAsyncCreatable = createStyledSelect(
2373
2241
  "AsyncCreatable"
2374
2242
  );
2375
2243
  var InputText = React8__namespace.forwardRef(
2376
- ({ className, icon, isError = false, onClean, ...props }, ref) => {
2244
+ ({
2245
+ className,
2246
+ icon,
2247
+ isError = false,
2248
+ onClean,
2249
+ iconPlacement = "start",
2250
+ disabled,
2251
+ ...props
2252
+ }, ref) => {
2377
2253
  const initialInputType = props.type || "text";
2378
2254
  const [type, setType] = React8__namespace.useState(initialInputType);
2379
2255
  const iconClass = {
@@ -2381,60 +2257,79 @@ var InputText = React8__namespace.forwardRef(
2381
2257
  "text-inputText-icon-default focus:text-inputText-icon-focus": !isError && !props.value,
2382
2258
  "text-inputText-icon-filled focus:text-inputText-icon-filled": !isError && !!props.value
2383
2259
  };
2384
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds relative w-full", children: [
2385
- icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds absolute left-4 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsxRuntime.jsx(
2386
- "span",
2387
- {
2388
- className: cn(
2389
- "w-4 h-4 flex items-center justify-center disabled:text-inputText-icon-disabled",
2390
- iconClass
2260
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2261
+ "div",
2262
+ {
2263
+ className: cn("relative w-full", {
2264
+ "pointer-events-none": disabled
2265
+ }),
2266
+ children: [
2267
+ /* @__PURE__ */ jsxRuntime.jsx(
2268
+ "input",
2269
+ {
2270
+ ref,
2271
+ className: cn(
2272
+ "w-full h-10 outline-none rounded-input text-sm leading-none font-medium",
2273
+ "bg-inputText-background-default disabled:bg-inputText-background-disabled",
2274
+ "border border-inputText-border-default focus:ring-[3px] focus:ring-inputText-border-focus focus:border-inputText-border-focus",
2275
+ "text-inputText-text-filled focus:text-inputText-text-focus placeholder:text-inputText-text-default disabled:text-inputText-text-disabled",
2276
+ "disabled:cursor-not-allowed",
2277
+ {
2278
+ "pl-10 pr-4": !!icon && iconPlacement === "start",
2279
+ "pr-10 pl-4": !!icon && iconPlacement === "end" && initialInputType !== "password",
2280
+ "px-4": !icon,
2281
+ "border-inputText-border-danger focus:border-inputText-border-danger focus:ring-button-danger-border-focus": isError
2282
+ },
2283
+ className
2284
+ ),
2285
+ ...props,
2286
+ disabled,
2287
+ type
2288
+ }
2391
2289
  ),
2392
- children: icon
2393
- }
2394
- ) }),
2395
- /* @__PURE__ */ jsxRuntime.jsx(
2396
- "input",
2397
- {
2398
- ref,
2399
- className: cn(
2400
- "w-full h-10 outline-none rounded-input text-sm leading-none font-medium",
2401
- "bg-inputText-background-default disabled:bg-inputText-background-disabled",
2402
- "border border-inputText-border-default focus:ring-[3px] focus:ring-inputText-border-focus focus:border-inputText-border-focus",
2403
- "text-inputText-text-filled focus:text-inputText-text-focus placeholder:text-inputText-text-default disabled:text-inputText-text-disabled",
2404
- "disabled:cursor-not-allowed",
2290
+ onClean && props.value && /* @__PURE__ */ jsxRuntime.jsx(
2291
+ "button",
2405
2292
  {
2406
- "pl-10 pr-4": !!icon,
2407
- "px-4": !icon,
2408
- "border-inputText-border-danger focus:border-inputText-border-danger focus:ring-button-danger-border-focus": isError
2409
- },
2410
- className
2293
+ type: "button",
2294
+ className: cn("absolute top-1/2 transform -translate-y-1/2", {
2295
+ "right-10": initialInputType === "password" || iconPlacement === "end",
2296
+ "right-4": initialInputType === "text" && iconPlacement === "start"
2297
+ }),
2298
+ onClick: onClean,
2299
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleX, { className: cn("w-4 h-4", iconClass) })
2300
+ }
2411
2301
  ),
2412
- ...props,
2413
- type
2414
- }
2415
- ),
2416
- onClean && props.value && /* @__PURE__ */ jsxRuntime.jsx(
2417
- "button",
2418
- {
2419
- type: "button",
2420
- className: cn("absolute top-1/2 transform -translate-y-1/2", {
2421
- "right-10": initialInputType === "password",
2422
- "right-4": initialInputType === "text"
2423
- }),
2424
- onClick: onClean,
2425
- children: /* @__PURE__ */ jsxRuntime.jsx(CircleX, { className: cn("w-4 h-4", iconClass) })
2426
- }
2427
- ),
2428
- initialInputType === "password" && /* @__PURE__ */ jsxRuntime.jsx(
2429
- "button",
2430
- {
2431
- type: "button",
2432
- className: "nebula-ds absolute right-4 top-1/2 transform -translate-y-1/2",
2433
- onClick: () => setType((prev) => prev === "text" ? "password" : "text"),
2434
- children: type === "text" ? /* @__PURE__ */ jsxRuntime.jsx(Eye, { className: cn("w-4 h-4", iconClass) }) : /* @__PURE__ */ jsxRuntime.jsx(EyeOff, { className: cn("w-4 h-4", iconClass) })
2435
- }
2436
- )
2437
- ] });
2302
+ initialInputType === "password" && /* @__PURE__ */ jsxRuntime.jsx(
2303
+ "button",
2304
+ {
2305
+ type: "button",
2306
+ className: "nebula-ds absolute right-4 top-1/2 transform -translate-y-1/2",
2307
+ onClick: () => setType((prev) => prev === "text" ? "password" : "text"),
2308
+ children: type === "text" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: cn("w-4 h-4", iconClass) }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOff, { className: cn("w-4 h-4", iconClass) })
2309
+ }
2310
+ ),
2311
+ icon && /* @__PURE__ */ jsxRuntime.jsx(
2312
+ "span",
2313
+ {
2314
+ className: cn("absolute top-1/2 transform -translate-y-1/2", {
2315
+ "left-4": iconPlacement === "start",
2316
+ "right-4": iconPlacement === "end" && initialInputType !== "password"
2317
+ }),
2318
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2319
+ "span",
2320
+ {
2321
+ className: cn(
2322
+ "w-4 h-4 flex items-center justify-center disabled:text-inputText-icon-disabled",
2323
+ iconClass
2324
+ ),
2325
+ children: icon
2326
+ }
2327
+ )
2328
+ }
2329
+ )
2330
+ ]
2331
+ }
2332
+ );
2438
2333
  }
2439
2334
  );
2440
2335
  InputText.displayName = "InputText";
@@ -2508,7 +2403,7 @@ var DialogContent = React8__namespace.forwardRef(({ className, children, portal
2508
2403
  right-4
2509
2404
  top-4`,
2510
2405
  children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", size: "sm", icon: true, children: [
2511
- /* @__PURE__ */ jsxRuntime.jsx(X, { className: "nebula-ds !h-4 !w-4 !text-dialog-icon" }),
2406
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "nebula-ds !h-4 !w-4 !text-dialog-icon" }),
2512
2407
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds sr-only", children: "Close" })
2513
2408
  ] })
2514
2409
  }
@@ -2699,7 +2594,7 @@ var Checkbox = React8__namespace.forwardRef(({ className, ...props }, ref) => /*
2699
2594
  CheckboxPrimitive__namespace.Indicator,
2700
2595
  {
2701
2596
  className: cn("flex items-center justify-center text-current"),
2702
- children: props.variant === "multiselect" ? /* @__PURE__ */ jsxRuntime.jsx(Minus, { className: "nebula-ds h-3 w-3" }) : /* @__PURE__ */ jsxRuntime.jsx(Check, { className: "nebula-ds h-3 w-3" })
2597
+ children: props.variant === "multiselect" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { className: "nebula-ds h-3 w-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "nebula-ds h-3 w-3" })
2703
2598
  }
2704
2599
  )
2705
2600
  }
@@ -2761,7 +2656,7 @@ var DrawerHeader = ({
2761
2656
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds bg-drawer-header-background text-drawer-header-title flex w-full min-h-16 items-start gap-2 p-4 border-b border-drawer-header-border", children: [
2762
2657
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds flex gap-2", children: [
2763
2658
  /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", icon: true, tabIndex: -1, children: [
2764
- /* @__PURE__ */ jsxRuntime.jsx(X, { className: "nebula-ds !h-4 !w-4" }),
2659
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "nebula-ds !h-4 !w-4" }),
2765
2660
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds sr-only", children: "Close" })
2766
2661
  ] }) }),
2767
2662
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2889,7 +2784,7 @@ var BreadcrumbSeparator = ({
2889
2784
  "aria-hidden": "true",
2890
2785
  className: cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className),
2891
2786
  ...props,
2892
- children: children ?? /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, {})
2787
+ children: children ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, {})
2893
2788
  }
2894
2789
  );
2895
2790
  BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
@@ -2907,7 +2802,7 @@ var BreadcrumbEllipsis = ({
2907
2802
  ),
2908
2803
  ...props,
2909
2804
  children: [
2910
- /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, { className: "nebula-ds h-3 w-3" }),
2805
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "nebula-ds h-3 w-3" }),
2911
2806
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds sr-only", children: "More" })
2912
2807
  ]
2913
2808
  }
@@ -3060,7 +2955,7 @@ function AccordionTrigger({
3060
2955
  children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3061
2956
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds flex flex-col gap-2", children }),
3062
2957
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds flex items-center justify-center w-5 h-5", children: /* @__PURE__ */ jsxRuntime.jsx(
3063
- ChevronDown,
2958
+ lucideReact.ChevronDown,
3064
2959
  {
3065
2960
  "data-slot": "accordion-icon",
3066
2961
  className: "nebula-ds text-accordion-icon w-4 h-4"
@@ -3264,9 +3159,9 @@ function ToastComponent({
3264
3159
  size: 20
3265
3160
  }) : null;
3266
3161
  const typeIcons = {
3267
- success: /* @__PURE__ */ jsxRuntime.jsx(CircleCheckBig, { className: "nebula-ds text-toast-icon-default", size: 20 }),
3268
- error: /* @__PURE__ */ jsxRuntime.jsx(CircleX, { className: "nebula-ds text-toast-icon-error", size: 20 }),
3269
- info: /* @__PURE__ */ jsxRuntime.jsx(Info, { className: "nebula-ds text-toast-icon-default", size: 20 }),
3162
+ success: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheckBig, { className: "nebula-ds text-toast-icon-default", size: 20 }),
3163
+ error: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleX, { className: "nebula-ds text-toast-icon-error", size: 20 }),
3164
+ info: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Info, { className: "nebula-ds text-toast-icon-default", size: 20 }),
3270
3165
  custom: CustomIcon
3271
3166
  };
3272
3167
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds w-[400px] bg-toast-background border border-toast-border rounded-xl p-4 flex items-start justify-start gap-2 shadow-md", children: [
@@ -3286,7 +3181,7 @@ function ToastComponent({
3286
3181
  }
3287
3182
  ) })
3288
3183
  ] }),
3289
- /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => sonner.toast.dismiss(t), children: /* @__PURE__ */ jsxRuntime.jsx(X, { className: "nebula-ds text-toast-icon-default", size: 20 }) })
3184
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => sonner.toast.dismiss(t), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "nebula-ds text-toast-icon-default", size: 20 }) })
3290
3185
  ] });
3291
3186
  }
3292
3187
  function success(message, options) {
@@ -3333,13 +3228,13 @@ function custom(message, options) {
3333
3228
  }
3334
3229
  );
3335
3230
  }
3336
- async function promise(promise2, messages11, options) {
3231
+ async function promise(promise2, messages17, options) {
3337
3232
  const loadingToast = sonner.toast.custom(
3338
3233
  (t) => /* @__PURE__ */ jsxRuntime.jsx(
3339
3234
  ToastComponent,
3340
3235
  {
3341
3236
  type: "info",
3342
- message: messages11.loading,
3237
+ message: messages17.loading,
3343
3238
  options,
3344
3239
  t
3345
3240
  }
@@ -3353,7 +3248,7 @@ async function promise(promise2, messages11, options) {
3353
3248
  ToastComponent,
3354
3249
  {
3355
3250
  type: "success",
3356
- message: messages11.success,
3251
+ message: messages17.success,
3357
3252
  options,
3358
3253
  t
3359
3254
  }
@@ -3368,7 +3263,7 @@ async function promise(promise2, messages11, options) {
3368
3263
  ToastComponent,
3369
3264
  {
3370
3265
  type: "error",
3371
- message: messages11.error,
3266
+ message: messages17.error,
3372
3267
  options,
3373
3268
  t
3374
3269
  }
@@ -3538,12 +3433,12 @@ var CountrySelect = ({
3538
3433
  const handleSelect = (event) => {
3539
3434
  onChange(event.target.value);
3540
3435
  };
3541
- const { messages: messages11 } = useNebulaI18n();
3542
- const { countries } = messages11.inputPhone;
3436
+ const { messages: messages17 } = useNebulaI18n();
3437
+ const { countries } = messages17.inputPhone;
3543
3438
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds rounded-s-[20px] relative inline-flex items-center self-stretch py-2 ps-4 pe-2 transition-[color,box-shadow] outline-none has-disabled:pointer-events-none has-disabled:opacity-50", children: [
3544
3439
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds inline-flex items-center gap-1", "aria-hidden": "true", children: [
3545
3440
  /* @__PURE__ */ jsxRuntime.jsx(FlagComponent, { country: value, countryName: value, "aria-hidden": "true" }),
3546
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds text-inputText-text-filled focus:text-inputText-text-focus", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 16, "aria-hidden": "true" }) })
3441
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds text-inputText-text-filled focus:text-inputText-text-focus", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { size: 16, "aria-hidden": "true" }) })
3547
3442
  ] }),
3548
3443
  /* @__PURE__ */ jsxRuntime.jsxs(
3549
3444
  "select",
@@ -3567,7 +3462,7 @@ var CountrySelect = ({
3567
3462
  };
3568
3463
  var FlagComponent = ({ country, countryName }) => {
3569
3464
  const Flag = flags__default.default[country];
3570
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds w-5 overflow-hidden rounded-sm", children: Flag ? /* @__PURE__ */ jsxRuntime.jsx(Flag, { title: countryName }) : /* @__PURE__ */ jsxRuntime.jsx(Phone, { size: 16, "aria-hidden": "true" }) });
3465
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds w-5 overflow-hidden rounded-sm", children: Flag ? /* @__PURE__ */ jsxRuntime.jsx(Flag, { title: countryName }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PhoneIcon, { size: 16, "aria-hidden": "true" }) });
3571
3466
  };
3572
3467
  var PhoneInput = React8__namespace.default.forwardRef(({ className, ...props }, ref) => {
3573
3468
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds flex items-center justify-center rounded-e-[20px] w-full", children: [
@@ -3675,6 +3570,1315 @@ var Skeleton = React8__namespace.default.forwardRef(
3675
3570
  }
3676
3571
  );
3677
3572
  Skeleton.displayName = "Skeleton";
3573
+ var MONTHS = [
3574
+ "01/01",
3575
+ "02/01",
3576
+ "03/01",
3577
+ "04/01",
3578
+ "05/01",
3579
+ "06/01",
3580
+ "07/01",
3581
+ "08/01",
3582
+ "09/01",
3583
+ "10/01",
3584
+ "11/01",
3585
+ "12/01"
3586
+ ];
3587
+ var localeByi18nKey = {
3588
+ es: locale.es,
3589
+ "en-US": locale.enUS,
3590
+ "pt-BR": locale.ptBR
3591
+ };
3592
+ var Calendar = ({
3593
+ numberOfMonths = 1,
3594
+ hideNavigation = false,
3595
+ month,
3596
+ onNextClick,
3597
+ onPrevClick,
3598
+ components: calendarComponents,
3599
+ ...props
3600
+ }) => {
3601
+ const { locale } = useNebulaI18n();
3602
+ const [selectedMonth, setSelectedMonth] = React8.useState(/* @__PURE__ */ new Date());
3603
+ const [showMonthGridSelection, setShowMonthGridSelection] = React8.useState(false);
3604
+ const isRange = props.mode === "range";
3605
+ const currentMonth = React8.useMemo(
3606
+ () => month ?? selectedMonth,
3607
+ [month, selectedMonth]
3608
+ );
3609
+ const handleSelectMonthByOption = React8.useCallback(
3610
+ (monthOption) => {
3611
+ setShowMonthGridSelection(false);
3612
+ const calendarDate = currentMonth;
3613
+ currentMonth.setMonth(monthOption.getMonth());
3614
+ if (typeof month !== "undefined") {
3615
+ onNextClick?.(calendarDate);
3616
+ } else {
3617
+ setSelectedMonth(calendarDate);
3618
+ }
3619
+ },
3620
+ [currentMonth, month, onNextClick]
3621
+ );
3622
+ const components2 = React8.useMemo(() => {
3623
+ return {
3624
+ Day(props2) {
3625
+ const {
3626
+ selected,
3627
+ range_end: rangeEnd,
3628
+ range_start: rangeStart
3629
+ } = props2.modifiers;
3630
+ const isSaturday = props2.day.date.getDay() === 0;
3631
+ const isSunday = props2.day.date.getDay() === 6;
3632
+ return /* @__PURE__ */ jsxRuntime.jsx(
3633
+ "td",
3634
+ {
3635
+ ...props2,
3636
+ className: cn(props2.className, "!w-9 !h-9 !p-0", {
3637
+ "rounded-r-full": isSunday && selected || rangeEnd,
3638
+ "rounded-l-full": isSaturday && selected || rangeStart,
3639
+ "!bg-calendar-rowSelected-background [&>button]:!border-none": selected && isRange
3640
+ })
3641
+ }
3642
+ );
3643
+ },
3644
+ DayButton(props2) {
3645
+ const {
3646
+ outside,
3647
+ today,
3648
+ selected,
3649
+ disabled,
3650
+ range_middle: rangeMiddle,
3651
+ range_end: rangeEnd,
3652
+ range_start: rangeStart
3653
+ } = props2.modifiers;
3654
+ return /* @__PURE__ */ jsxRuntime.jsx(
3655
+ "button",
3656
+ {
3657
+ ...props2,
3658
+ tabIndex: 0,
3659
+ className: cn(
3660
+ props2.className,
3661
+ "!w-9 !h-9 hover:bg-button-ghost-background-hover hover:rounded-full",
3662
+ {
3663
+ "!text-calendar-day-color": !outside,
3664
+ "!text-calendar-outsideDay-color !opacity-1": outside,
3665
+ "!bg-calendar-daySelected-background !border-calendar-daySelected-background !text-calendar-daySelected-color rounded-full": (selected || rangeEnd || rangeStart) && !rangeMiddle,
3666
+ "!text-neutral-200 dark:!text-neutral-900 pointer-events-none cursor-not-allowed": disabled
3667
+ }
3668
+ ),
3669
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
3670
+ "div",
3671
+ {
3672
+ className: cn({
3673
+ "flex flex-col relative items-center text-inherit": today
3674
+ }),
3675
+ children: [
3676
+ /* @__PURE__ */ jsxRuntime.jsx(
3677
+ Paragraph,
3678
+ {
3679
+ size: "md",
3680
+ className: "!font-medium !text-inherit text-center",
3681
+ children: props2.children
3682
+ }
3683
+ ),
3684
+ today && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds !bg-calendar-today-dotColor w-1 h-1 rounded-full absolute -bottom-[2px]" })
3685
+ ]
3686
+ }
3687
+ )
3688
+ }
3689
+ );
3690
+ },
3691
+ MonthCaption({ calendarMonth, displayIndex, ...rest }) {
3692
+ const handleNextMonth = () => {
3693
+ const newMonth = dateFns.addMonths(
3694
+ currentMonth,
3695
+ props.pagedNavigation || numberOfMonths === 1 ? 1 : 0
3696
+ );
3697
+ if (typeof month !== "undefined") {
3698
+ onNextClick?.(newMonth);
3699
+ return;
3700
+ }
3701
+ setSelectedMonth(newMonth);
3702
+ };
3703
+ const handlePreviousMonth = () => {
3704
+ const newMonth = dateFns.addMonths(
3705
+ currentMonth,
3706
+ props.pagedNavigation ? -2 : -1
3707
+ );
3708
+ if (typeof month !== "undefined") {
3709
+ onPrevClick?.(newMonth);
3710
+ return;
3711
+ }
3712
+ setSelectedMonth(newMonth);
3713
+ };
3714
+ const handleToggleShowMonthGridSelection = () => {
3715
+ setShowMonthGridSelection((s) => !s);
3716
+ };
3717
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3718
+ "div",
3719
+ {
3720
+ className: cn("flex justify-between items-center !h-9 mb-3", {
3721
+ "ps-3": numberOfMonths === 1,
3722
+ "mb-0": showMonthGridSelection
3723
+ }),
3724
+ children: [
3725
+ !hideNavigation && numberOfMonths > 1 && /* @__PURE__ */ jsxRuntime.jsx(
3726
+ Button,
3727
+ {
3728
+ icon: true,
3729
+ size: "sm",
3730
+ variant: "ghost",
3731
+ onClick: handlePreviousMonth,
3732
+ className: cn({
3733
+ "pointer-events-none invisible": displayIndex === 1
3734
+ }),
3735
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, { className: "nebula-ds !w-[unset] !h-[unset]" })
3736
+ }
3737
+ ),
3738
+ /* @__PURE__ */ jsxRuntime.jsx(
3739
+ "div",
3740
+ {
3741
+ ...rest,
3742
+ className: cn(
3743
+ rest.className,
3744
+ "!h-auto select-none ",
3745
+ numberOfMonths > 1 && "pointer-events-none"
3746
+ ),
3747
+ role: "button",
3748
+ onClick: handleToggleShowMonthGridSelection,
3749
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Space, { size: "xs", className: "nebula-ds items-center", children: [
3750
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nebula-ds !text-calendar-month-label !text-sm !font-semibold", children: dateFns.formatDate(calendarMonth.date, "LLL yyyy", {
3751
+ locale: localeByi18nKey[locale ?? "en-US"]
3752
+ }).replace(/^./, (char) => char.toUpperCase()) }),
3753
+ numberOfMonths === 1 && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "nebula-ds !text-calendar-month-selectionChevron" })
3754
+ ] })
3755
+ }
3756
+ ),
3757
+ !hideNavigation && numberOfMonths === 1 && !showMonthGridSelection && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds flex gap-x-1", children: [
3758
+ /* @__PURE__ */ jsxRuntime.jsx(
3759
+ Button,
3760
+ {
3761
+ icon: true,
3762
+ size: "sm",
3763
+ variant: "ghost",
3764
+ onClick: handlePreviousMonth,
3765
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, { className: "nebula-ds !w-[unset] !h-[unset] !text-calendar-month-navigator" })
3766
+ }
3767
+ ),
3768
+ /* @__PURE__ */ jsxRuntime.jsx(
3769
+ Button,
3770
+ {
3771
+ icon: true,
3772
+ size: "sm",
3773
+ variant: "ghost",
3774
+ onClick: handleNextMonth,
3775
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "nebula-ds !w-[unset] !h-[unset] !text-calendar-month-navigator" })
3776
+ }
3777
+ )
3778
+ ] }),
3779
+ !hideNavigation && numberOfMonths > 1 && /* @__PURE__ */ jsxRuntime.jsx(
3780
+ Button,
3781
+ {
3782
+ icon: true,
3783
+ size: "sm",
3784
+ variant: "ghost",
3785
+ onClick: handleNextMonth,
3786
+ className: cn({
3787
+ "pointer-events-none invisible": displayIndex !== numberOfMonths - 1
3788
+ }),
3789
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "nebula-ds !w-[unset] !h-[unset]" })
3790
+ }
3791
+ )
3792
+ ]
3793
+ }
3794
+ );
3795
+ },
3796
+ MonthGrid(props2) {
3797
+ if (!showMonthGridSelection) {
3798
+ return /* @__PURE__ */ jsxRuntime.jsx("table", { ...props2 });
3799
+ }
3800
+ return /* @__PURE__ */ jsxRuntime.jsx(
3801
+ Box,
3802
+ {
3803
+ className: "nebula-ds z-40 !p-0 flex gap-2 flex-col justify-between w-full",
3804
+ border: false,
3805
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds z-40 grid grid-cols-2 gap-1 bg-inherit pt-2", children: MONTHS.map((monthOption) => {
3806
+ const monthOptionAsDate = new Date(monthOption);
3807
+ const isSelectedMonth = month ? month.getMonth() === monthOptionAsDate.getMonth() : monthOptionAsDate.getMonth() === currentMonth.getMonth();
3808
+ const monthLabel = dateFns.formatDate(monthOptionAsDate, "LLLL", {
3809
+ locale: localeByi18nKey[locale ?? "en-US"]
3810
+ });
3811
+ return /* @__PURE__ */ jsxRuntime.jsx(
3812
+ Button,
3813
+ {
3814
+ variant: isSelectedMonth ? "primary" : "secondary",
3815
+ type: "button",
3816
+ className: cn("rounded-lg", {
3817
+ "border-neutral-200 dark:border-neutral-800": !isSelectedMonth
3818
+ }),
3819
+ size: "md",
3820
+ onClick: () => handleSelectMonthByOption(monthOptionAsDate),
3821
+ children: monthLabel
3822
+ },
3823
+ monthLabel
3824
+ );
3825
+ }) })
3826
+ }
3827
+ );
3828
+ },
3829
+ Months(props2) {
3830
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props2, className: cn(props2.className, "gap-2 flex p-2") });
3831
+ },
3832
+ Month(props2) {
3833
+ return /* @__PURE__ */ jsxRuntime.jsx(
3834
+ "div",
3835
+ {
3836
+ ...props2,
3837
+ className: cn(
3838
+ props2.className,
3839
+ "[&:not(:last-child)]:pr-2 [&:not(:last-child)]:border-neutral-200 [&:not(:last-child)]:border-r dark:[&:not(:last-child)]:border-neutral-800"
3840
+ )
3841
+ }
3842
+ );
3843
+ },
3844
+ Week(props2) {
3845
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3846
+ /* @__PURE__ */ jsxRuntime.jsx("tr", { ...props2, className: cn(props2.className) }),
3847
+ /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "nebula-ds h-1 last:h-0" })
3848
+ ] });
3849
+ },
3850
+ Weekdays(props2) {
3851
+ return /* @__PURE__ */ jsxRuntime.jsx("tr", { ...props2 });
3852
+ },
3853
+ Weekday(props2) {
3854
+ return /* @__PURE__ */ jsxRuntime.jsx(
3855
+ "th",
3856
+ {
3857
+ ...props2,
3858
+ className: cn(
3859
+ props2.className,
3860
+ "font-medium text-xs !text-calendar-weekDay-color"
3861
+ ),
3862
+ children: String(props2.children)?.toUpperCase()?.[0]
3863
+ }
3864
+ );
3865
+ },
3866
+ Footer(props2) {
3867
+ if (showMonthGridSelection) return void 0;
3868
+ return /* @__PURE__ */ jsxRuntime.jsx(
3869
+ "div",
3870
+ {
3871
+ ...props2,
3872
+ className: cn(props2.className, "p-3 border-t border-t-box-border")
3873
+ }
3874
+ );
3875
+ },
3876
+ ...calendarComponents
3877
+ };
3878
+ }, [
3879
+ calendarComponents,
3880
+ isRange,
3881
+ currentMonth,
3882
+ handleSelectMonthByOption,
3883
+ hideNavigation,
3884
+ locale,
3885
+ month,
3886
+ numberOfMonths,
3887
+ onNextClick,
3888
+ onPrevClick,
3889
+ props.pagedNavigation,
3890
+ showMonthGridSelection
3891
+ ]);
3892
+ return /* @__PURE__ */ jsxRuntime.jsx(
3893
+ Box,
3894
+ {
3895
+ border: true,
3896
+ className: cn("p-0 w-fit", numberOfMonths === 1 && "w-[270px]"),
3897
+ shadow: "md",
3898
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3899
+ reactDayPicker.DayPicker,
3900
+ {
3901
+ showOutsideDays: true,
3902
+ mode: "single",
3903
+ animate: false,
3904
+ ...props,
3905
+ month: currentMonth,
3906
+ hideNavigation: true,
3907
+ numberOfMonths: Math.min(Math.max(numberOfMonths, 1), 2),
3908
+ components: components2,
3909
+ locale: localeByi18nKey[locale ?? "en-US"],
3910
+ footer: showMonthGridSelection ? void 0 : props.footer
3911
+ }
3912
+ )
3913
+ }
3914
+ );
3915
+ };
3916
+
3917
+ // src/utils/valid-date-format.ts
3918
+ function dateFormatIsValid(dateStr, locale) {
3919
+ const regexBR = /^(?:(?:31\/(0[13578]|1[02]))\/(?:\d{4})|(?:29|30)\/(0[13-9]|1[0-2])\/(?:\d{4})|29\/02\/(?:\d\d(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)|(?:0[1-9]|1\d|2[0-8])\/(0[1-9]|1[0-2])\/(?:\d{4}))$/;
3920
+ const regexUS = /^(?:(?:(0[13578]|1[02])\/31)\/(?:\d{4})|(?:(0[13-9]|1[0-2])\/(29|30))\/(?:\d{4})|(?:02\/29)\/(?:\d\d(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)|(?:(0[1-9]|1[0-2])\/(0[1-9]|1\d|2[0-8]))\/(?:\d{4}))$/;
3921
+ const regex = locale === "en-US" ? regexUS : regexBR;
3922
+ return regex.test(dateStr);
3923
+ }
3924
+ function timeFormatIsValid(timeStr) {
3925
+ const regex = /^(?:[01]\d|2[0-3]):[0-5]\d$/;
3926
+ return regex.test(timeStr);
3927
+ }
3928
+ var dateIsAvailable = (inputDate, disabledDates) => {
3929
+ if (!disabledDates || !inputDate) return true;
3930
+ const dateIsDisabled = (d, matcher) => {
3931
+ if (Array.isArray(matcher)) {
3932
+ return matcher.some((date) => dateFns.isSameDay(date, d));
3933
+ }
3934
+ if (typeof matcher === "boolean") return matcher;
3935
+ if (typeof matcher === "function") {
3936
+ return matcher(d);
3937
+ }
3938
+ if ("from" in matcher) {
3939
+ const { from, to } = matcher;
3940
+ if (!from) return false;
3941
+ if (from && to) {
3942
+ return dateFns.isBefore(d, to) && dateFns.isAfter(d, from) || dateFns.isSameDay(d, from) || dateFns.isSameDay(d, to);
3943
+ }
3944
+ return dateFns.isSameDay(d, from);
3945
+ }
3946
+ if ("before" in matcher && !("after" in matcher)) {
3947
+ const { before } = matcher;
3948
+ return dateFns.isBefore(d, before) && !dateFns.isSameDay(d, before);
3949
+ }
3950
+ if ("after" in matcher && !("before" in matcher)) {
3951
+ const { after } = matcher;
3952
+ return dateFns.isAfter(d, after) && !dateFns.isSameDay(d, after);
3953
+ }
3954
+ if ("after" in matcher && "before" in matcher) {
3955
+ const { after, before } = matcher;
3956
+ return dateFns.isAfter(d, after) && !dateFns.isSameDay(d, after) || dateFns.isBefore(d, before) && !dateFns.isSameDay(d, before);
3957
+ }
3958
+ if ("dayOfWeek" in matcher) {
3959
+ const { dayOfWeek } = matcher;
3960
+ if (Array.isArray(dayOfWeek)) {
3961
+ return dayOfWeek.includes(d.getDay());
3962
+ }
3963
+ return dayOfWeek === d.getDay();
3964
+ }
3965
+ return dateFns.isSameDay(d, matcher);
3966
+ };
3967
+ if (Array.isArray(disabledDates)) {
3968
+ return disabledDates.every((matcher) => {
3969
+ return dateIsDisabled(inputDate, matcher) === false;
3970
+ });
3971
+ }
3972
+ return !dateIsDisabled(inputDate, disabledDates);
3973
+ };
3974
+ var InputDatePickerSingle = ({
3975
+ portal,
3976
+ placeholder,
3977
+ className,
3978
+ value,
3979
+ onChange,
3980
+ numberOfMonths = 1,
3981
+ onClean,
3982
+ disabledDates,
3983
+ ...rest
3984
+ }) => {
3985
+ const [popoverIsOpen, setPopoverIsOpen] = React8.useState(false);
3986
+ const [innerDate, setInnerDate] = React8.useState(
3987
+ value ? new Date(value) : void 0
3988
+ );
3989
+ const { locale } = useNebulaI18n();
3990
+ const [month, setMonth] = React8.useState(/* @__PURE__ */ new Date());
3991
+ const handleClearValue = () => {
3992
+ setInnerDate(void 0);
3993
+ setMonth(/* @__PURE__ */ new Date());
3994
+ };
3995
+ const handleInnerInputChange = (text) => {
3996
+ const dateSlice = text.substring(0, 10).trim();
3997
+ if (!text) {
3998
+ onChange?.(text);
3999
+ handleClearValue();
4000
+ return;
4001
+ }
4002
+ const [day, month2, year] = [
4003
+ locale !== "en-US" ? dateSlice.substring(0, 2) : dateSlice.substring(3, 5),
4004
+ locale === "en-US" ? dateSlice.substring(0, 2) : dateSlice.substring(3, 5),
4005
+ dateSlice.substring(6)
4006
+ ];
4007
+ const date = new Date(Number(year), Number(month2) - 1, Number(day));
4008
+ if ([day, month2, year].some((value2) => !value2) || !dateFormatIsValid(dateSlice, locale) || !dateFns.isValid(new Date(date)) || !dateIsAvailable(date, disabledDates)) {
4009
+ onChange?.(text);
4010
+ handleClearValue();
4011
+ return;
4012
+ }
4013
+ onChange?.(text, date);
4014
+ setInnerDate(date);
4015
+ };
4016
+ const handleKeyDown = (e) => {
4017
+ if ((e.altKey || e.ctrlKey || e.metaKey) && e.key !== "z") return;
4018
+ const allowedKeys = [
4019
+ "Backspace",
4020
+ "Delete",
4021
+ "Tab",
4022
+ "ArrowLeft",
4023
+ "ArrowRight",
4024
+ "Home",
4025
+ "End",
4026
+ "/"
4027
+ ];
4028
+ if (!allowedKeys.includes(e.key) && !/^[0-9]$/.test(e.key)) {
4029
+ e.preventDefault();
4030
+ }
4031
+ };
4032
+ const handleCalendarSelect = (date) => {
4033
+ const dateToStr = Intl.DateTimeFormat(locale ?? "en-US", {
4034
+ month: "2-digit",
4035
+ year: "numeric",
4036
+ day: "2-digit"
4037
+ }).format(date);
4038
+ setInnerDate(date);
4039
+ onChange?.(dateToStr, date);
4040
+ };
4041
+ const normalizedCalendarDate = React8.useMemo(() => {
4042
+ return dateFns.isValid(innerDate) ? innerDate : void 0;
4043
+ }, [innerDate]);
4044
+ React8.useEffect(() => {
4045
+ if (innerDate) setMonth(innerDate);
4046
+ }, [innerDate]);
4047
+ return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: popoverIsOpen, onOpenChange: setPopoverIsOpen, children: [
4048
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { className, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4049
+ "div",
4050
+ {
4051
+ onClick: (e) => e.preventDefault(),
4052
+ onFocus: (e) => e.preventDefault(),
4053
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4054
+ InputText,
4055
+ {
4056
+ placeholder,
4057
+ value,
4058
+ className,
4059
+ onChange: (e) => handleInnerInputChange(e.target.value),
4060
+ onKeyDown: handleKeyDown,
4061
+ icon: /* @__PURE__ */ jsxRuntime.jsx(
4062
+ lucideReact.CalendarIcon,
4063
+ {
4064
+ tabIndex: 0,
4065
+ role: "button",
4066
+ onClick: () => setPopoverIsOpen((s) => !s),
4067
+ onKeyUp: (e) => {
4068
+ if (e.key === "Enter") {
4069
+ setPopoverIsOpen((s) => !s);
4070
+ }
4071
+ },
4072
+ className: "nebula-ds cursor-pointer"
4073
+ }
4074
+ ),
4075
+ iconPlacement: "end",
4076
+ onKeyUp: (e) => {
4077
+ if (e.key === "ArrowDown") {
4078
+ setPopoverIsOpen(true);
4079
+ }
4080
+ },
4081
+ maxLength: 10,
4082
+ onClean: onClean ? () => {
4083
+ onClean();
4084
+ handleClearValue();
4085
+ } : void 0,
4086
+ ...rest
4087
+ }
4088
+ )
4089
+ }
4090
+ ) }),
4091
+ /* @__PURE__ */ jsxRuntime.jsx(
4092
+ PopoverContent,
4093
+ {
4094
+ portal,
4095
+ side: "bottom",
4096
+ className: "nebula-ds p-0 border-none bg-transparent shadow-none",
4097
+ align: "start",
4098
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4099
+ Calendar,
4100
+ {
4101
+ required: false,
4102
+ mode: "single",
4103
+ numberOfMonths,
4104
+ selected: normalizedCalendarDate,
4105
+ onSelect: handleCalendarSelect,
4106
+ month,
4107
+ onPrevClick: setMonth,
4108
+ onNextClick: setMonth,
4109
+ disabled: disabledDates
4110
+ }
4111
+ )
4112
+ }
4113
+ )
4114
+ ] });
4115
+ };
4116
+ var InputTime = React8.forwardRef(
4117
+ ({ value = "", onChange, placeholder = "--:--", ...rest }, ref) => {
4118
+ const [displayValue, setDisplayValue] = React8.useState(value);
4119
+ const handleKeyDown = (e) => {
4120
+ const currentValue = e.currentTarget.value;
4121
+ if ((e.altKey || e.ctrlKey || e.metaKey) && e.key !== "z") return;
4122
+ const allowedKeys = [
4123
+ "Backspace",
4124
+ "Delete",
4125
+ "Tab",
4126
+ "ArrowLeft",
4127
+ "ArrowRight",
4128
+ "Home",
4129
+ "End",
4130
+ ":"
4131
+ ];
4132
+ if (!allowedKeys.includes(e.key) && !/^[0-9]$/.test(e.key)) {
4133
+ e.preventDefault();
4134
+ }
4135
+ if (currentValue.indexOf(":") > -1 && e.key === ":" || e.key === ":" && currentValue.length < 2) {
4136
+ e.preventDefault();
4137
+ }
4138
+ };
4139
+ const handleInput = (value2) => {
4140
+ if (value2.startsWith(":")) return;
4141
+ let clean = value2.replace(/\D/g, "");
4142
+ if (clean.length === 2) {
4143
+ clean = String(
4144
+ Math.min(Math.max(parseInt(clean || "0", 10), 0), 23)
4145
+ ).padStart(2, "0");
4146
+ }
4147
+ if (clean.length === 4) {
4148
+ let h = parseInt(clean.slice(0, 2) || "0", 10);
4149
+ let m = parseInt(clean.slice(2, 4) || "0", 10);
4150
+ h = Math.min(Math.max(h, 0), 23);
4151
+ m = Math.min(Math.max(m, 0), 59);
4152
+ const value24h = `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`;
4153
+ setDisplayValue(value24h);
4154
+ onChange?.(value24h);
4155
+ } else {
4156
+ setDisplayValue(value2);
4157
+ onChange?.(value2);
4158
+ }
4159
+ };
4160
+ React8.useEffect(() => {
4161
+ if (!value) {
4162
+ setDisplayValue("");
4163
+ }
4164
+ }, [value]);
4165
+ return /* @__PURE__ */ jsxRuntime.jsx(
4166
+ InputText,
4167
+ {
4168
+ ref,
4169
+ type: "text",
4170
+ value: displayValue,
4171
+ placeholder,
4172
+ ...rest,
4173
+ onChange: (e) => handleInput(e.target.value),
4174
+ onKeyDown: handleKeyDown,
4175
+ maxLength: 5,
4176
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClockIcon, {})
4177
+ }
4178
+ );
4179
+ }
4180
+ );
4181
+ InputTime.displayName = "InputTime";
4182
+ var InputDateTimePickerSingle = ({
4183
+ portal,
4184
+ placeholder,
4185
+ className,
4186
+ value,
4187
+ onChange,
4188
+ numberOfMonths = 1,
4189
+ onClean,
4190
+ disabledDates,
4191
+ ...rest
4192
+ }) => {
4193
+ const [popoverIsOpen, setPopoverIsOpen] = React8.useState(false);
4194
+ const [innerTimeValue, setInnerTimeValue] = React8.useState();
4195
+ const [innerDate, setInnerDate] = React8.useState(
4196
+ value ? new Date(value) : void 0
4197
+ );
4198
+ const { locale, messages: messages17 } = useNebulaI18n();
4199
+ const [month, setMonth] = React8.useState(/* @__PURE__ */ new Date());
4200
+ const inputTimeRef = React8.useRef(null);
4201
+ const handleClearValue = () => {
4202
+ setInnerTimeValue("");
4203
+ setInnerDate(void 0);
4204
+ setMonth(/* @__PURE__ */ new Date());
4205
+ };
4206
+ const handleInnerInputChange = (text) => {
4207
+ const dateSlice = text.substring(0, 11).trim();
4208
+ let hourSlice = text.substring(11).trim();
4209
+ if (!text) {
4210
+ onChange?.(text);
4211
+ handleClearValue();
4212
+ return;
4213
+ }
4214
+ const [day, month2, year] = [
4215
+ locale !== "en-US" ? dateSlice.substring(0, 2) : dateSlice.substring(3, 5),
4216
+ locale === "en-US" ? dateSlice.substring(0, 2) : dateSlice.substring(3, 5),
4217
+ dateSlice.substring(6)
4218
+ ];
4219
+ const date = new Date(Number(year), Number(month2) - 1, Number(day));
4220
+ if ([day, month2, year].some((value2) => !value2) || !dateFormatIsValid(dateSlice, locale) || !dateFns.isValid(new Date(date)) || !dateIsAvailable(date, disabledDates)) {
4221
+ onChange?.(text);
4222
+ handleClearValue();
4223
+ return;
4224
+ }
4225
+ if (!timeFormatIsValid(hourSlice)) {
4226
+ hourSlice = "";
4227
+ setInnerTimeValue("");
4228
+ } else {
4229
+ setInnerTimeValue(hourSlice);
4230
+ }
4231
+ onChange?.(text, date, hourSlice);
4232
+ setInnerDate(date);
4233
+ };
4234
+ const handleOnChangeTime = (newTime) => {
4235
+ const [date = ""] = value?.split(" ") ?? [];
4236
+ setInnerTimeValue(newTime);
4237
+ if (date && !dateFormatIsValid(date, locale)) {
4238
+ handleClearValue();
4239
+ }
4240
+ onChange?.(date + " " + newTime, innerDate, newTime);
4241
+ };
4242
+ const handleKeyDown = (e) => {
4243
+ if ((e.altKey || e.ctrlKey || e.metaKey) && e.key !== "z") return;
4244
+ const allowedKeys = [
4245
+ "Backspace",
4246
+ "Delete",
4247
+ "Tab",
4248
+ "ArrowLeft",
4249
+ "ArrowRight",
4250
+ "Home",
4251
+ "End",
4252
+ ":",
4253
+ "/",
4254
+ " "
4255
+ ];
4256
+ if (!allowedKeys.includes(e.key) && !/^[0-9]$/.test(e.key)) {
4257
+ e.preventDefault();
4258
+ }
4259
+ };
4260
+ const handleCalendarSelect = (date) => {
4261
+ const dateToStr = Intl.DateTimeFormat(locale ?? "en-US", {
4262
+ month: "2-digit",
4263
+ year: "numeric",
4264
+ day: "2-digit"
4265
+ }).format(date);
4266
+ setInnerDate(date);
4267
+ onChange?.(
4268
+ [dateToStr, innerTimeValue].filter(Boolean).join(" "),
4269
+ date,
4270
+ innerTimeValue
4271
+ );
4272
+ if (!innerTimeValue) {
4273
+ setTimeout(() => inputTimeRef.current?.focus(), 100);
4274
+ }
4275
+ };
4276
+ const normalizedCalendarDate = React8.useMemo(() => {
4277
+ return dateFns.isValid(innerDate) ? innerDate : void 0;
4278
+ }, [innerDate]);
4279
+ React8.useEffect(() => {
4280
+ if (innerDate) setMonth(innerDate);
4281
+ }, [innerDate]);
4282
+ return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: popoverIsOpen, onOpenChange: setPopoverIsOpen, children: [
4283
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { className, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4284
+ "div",
4285
+ {
4286
+ onClick: (e) => e.preventDefault(),
4287
+ onFocus: (e) => e.preventDefault(),
4288
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4289
+ InputText,
4290
+ {
4291
+ placeholder,
4292
+ value,
4293
+ className,
4294
+ onChange: (e) => handleInnerInputChange(e.target.value),
4295
+ onKeyDown: handleKeyDown,
4296
+ icon: /* @__PURE__ */ jsxRuntime.jsx(
4297
+ lucideReact.CalendarIcon,
4298
+ {
4299
+ tabIndex: 0,
4300
+ role: "button",
4301
+ onClick: () => setPopoverIsOpen((s) => !s),
4302
+ onKeyUp: (e) => {
4303
+ if (e.key === "Enter") {
4304
+ setPopoverIsOpen((s) => !s);
4305
+ }
4306
+ },
4307
+ className: "nebula-ds cursor-pointer"
4308
+ }
4309
+ ),
4310
+ iconPlacement: "end",
4311
+ onKeyUp: (e) => {
4312
+ if (e.key === "ArrowDown") {
4313
+ setPopoverIsOpen(true);
4314
+ }
4315
+ },
4316
+ maxLength: 16,
4317
+ onClean: onClean ? () => {
4318
+ onClean();
4319
+ handleClearValue();
4320
+ } : void 0,
4321
+ ...rest
4322
+ }
4323
+ )
4324
+ }
4325
+ ) }),
4326
+ /* @__PURE__ */ jsxRuntime.jsx(
4327
+ PopoverContent,
4328
+ {
4329
+ portal,
4330
+ side: "bottom",
4331
+ className: "nebula-ds p-0 border-none bg-transparent shadow-none",
4332
+ align: "start",
4333
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4334
+ Calendar,
4335
+ {
4336
+ required: false,
4337
+ mode: "single",
4338
+ numberOfMonths,
4339
+ selected: normalizedCalendarDate,
4340
+ onSelect: handleCalendarSelect,
4341
+ month,
4342
+ onPrevClick: setMonth,
4343
+ onNextClick: setMonth,
4344
+ disabled: disabledDates,
4345
+ footer: /* @__PURE__ */ jsxRuntime.jsxs(Space, { className: "nebula-ds items-center", children: [
4346
+ /* @__PURE__ */ jsxRuntime.jsxs(Label, { children: [
4347
+ messages17.timePicker.label,
4348
+ ":"
4349
+ ] }),
4350
+ /* @__PURE__ */ jsxRuntime.jsx(
4351
+ InputTime,
4352
+ {
4353
+ placeholder: "00:00",
4354
+ value: innerTimeValue,
4355
+ onChange: handleOnChangeTime,
4356
+ ref: inputTimeRef,
4357
+ className: "nebula-ds max-w-[188px]"
4358
+ }
4359
+ )
4360
+ ] })
4361
+ }
4362
+ )
4363
+ }
4364
+ )
4365
+ ] });
4366
+ };
4367
+ var FileUploadError = /* @__PURE__ */ ((FileUploadError2) => {
4368
+ FileUploadError2["MAX_FILES_EXCEEDED"] = "MAX_FILES_EXCEEDED";
4369
+ FileUploadError2["MAXIMUM_FILE_SIZE_EXCEEDED"] = "MAXIMUM_FILE_SIZE_EXCEEDED";
4370
+ FileUploadError2["INVALID_FORMAT"] = "INVALID_FORMAT";
4371
+ return FileUploadError2;
4372
+ })(FileUploadError || {});
4373
+ var useFileUpload = (options = {}) => {
4374
+ const {
4375
+ maxFiles = Infinity,
4376
+ maxSize = Infinity,
4377
+ accept = "*",
4378
+ multiple = false,
4379
+ initialFiles = [],
4380
+ onFilesChange,
4381
+ onFilesAdded
4382
+ } = options;
4383
+ const [state, setState] = React8.useState({
4384
+ files: initialFiles.map((file) => ({
4385
+ file,
4386
+ id: file.id,
4387
+ preview: file.url
4388
+ })),
4389
+ isDragging: false,
4390
+ errors: []
4391
+ });
4392
+ const inputRef = React8.useRef(null);
4393
+ const validateFile = React8.useCallback(
4394
+ (file) => {
4395
+ if (file instanceof File) {
4396
+ if (file.size > maxSize) {
4397
+ return {
4398
+ file,
4399
+ error: "MAXIMUM_FILE_SIZE_EXCEEDED" /* MAXIMUM_FILE_SIZE_EXCEEDED */
4400
+ };
4401
+ }
4402
+ } else {
4403
+ if (file.size > maxSize) {
4404
+ return { error: "MAXIMUM_FILE_SIZE_EXCEEDED" /* MAXIMUM_FILE_SIZE_EXCEEDED */, file };
4405
+ }
4406
+ }
4407
+ if (accept !== "*") {
4408
+ const acceptedTypes = accept.split(",").map((type) => type.trim());
4409
+ const fileType = file instanceof File ? file.type || "" : file.type;
4410
+ const fileExtension = `.${file instanceof File ? file.name.split(".").pop() : file.name.split(".").pop()}`;
4411
+ const isAccepted = acceptedTypes.some((type) => {
4412
+ if (type.startsWith(".")) {
4413
+ return fileExtension.toLowerCase() === type.toLowerCase();
4414
+ }
4415
+ if (type.endsWith("/*")) {
4416
+ const baseType = type.split("/")[0];
4417
+ return fileType.startsWith(`${baseType}/`);
4418
+ }
4419
+ return fileType === type;
4420
+ });
4421
+ if (!isAccepted) {
4422
+ return {
4423
+ file,
4424
+ error: "INVALID_FORMAT" /* INVALID_FORMAT */
4425
+ };
4426
+ }
4427
+ }
4428
+ return null;
4429
+ },
4430
+ [accept, maxSize]
4431
+ );
4432
+ const createPreview = React8.useCallback(
4433
+ (file) => {
4434
+ if (file instanceof File) {
4435
+ return URL.createObjectURL(file);
4436
+ }
4437
+ return file.url;
4438
+ },
4439
+ []
4440
+ );
4441
+ const generateUniqueId = React8.useCallback((file) => {
4442
+ if (file instanceof File) {
4443
+ return `${file.name}-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
4444
+ }
4445
+ return file.id;
4446
+ }, []);
4447
+ const clearFiles = React8.useCallback(() => {
4448
+ setState((prev) => {
4449
+ prev.files.forEach((file) => {
4450
+ if (file.preview && file.file instanceof File && file.file.type.startsWith("image/")) {
4451
+ URL.revokeObjectURL(file.preview);
4452
+ }
4453
+ });
4454
+ if (inputRef.current) {
4455
+ inputRef.current.value = "";
4456
+ }
4457
+ const newState = {
4458
+ ...prev,
4459
+ files: [],
4460
+ errors: []
4461
+ };
4462
+ onFilesChange?.(newState.files);
4463
+ return newState;
4464
+ });
4465
+ }, [onFilesChange]);
4466
+ const addFiles = React8.useCallback(
4467
+ (newFiles) => {
4468
+ if (!newFiles || newFiles.length === 0) return;
4469
+ const newFilesArray = Array.from(newFiles);
4470
+ const errors = [];
4471
+ setState((prev) => ({ ...prev, errors: [] }));
4472
+ if (!multiple) {
4473
+ clearFiles();
4474
+ }
4475
+ if (multiple && maxFiles !== Infinity && state.files.length + newFilesArray.length > maxFiles) {
4476
+ errors.push({ error: "MAX_FILES_EXCEEDED" /* MAX_FILES_EXCEEDED */ });
4477
+ setState((prev) => ({ ...prev, errors }));
4478
+ return;
4479
+ }
4480
+ const validFiles = [];
4481
+ newFilesArray.forEach((file) => {
4482
+ if (multiple) {
4483
+ const isDuplicate = state.files.some(
4484
+ (existingFile) => existingFile.file.name === file.name && existingFile.file.size === file.size
4485
+ );
4486
+ if (isDuplicate) {
4487
+ return;
4488
+ }
4489
+ }
4490
+ if (file.size > maxSize) {
4491
+ errors.push({
4492
+ error: "MAXIMUM_FILE_SIZE_EXCEEDED" /* MAXIMUM_FILE_SIZE_EXCEEDED */,
4493
+ file
4494
+ });
4495
+ return;
4496
+ }
4497
+ const error2 = validateFile(file);
4498
+ if (error2) {
4499
+ errors.push(error2);
4500
+ } else {
4501
+ validFiles.push({
4502
+ file,
4503
+ id: generateUniqueId(file),
4504
+ preview: createPreview(file)
4505
+ });
4506
+ }
4507
+ });
4508
+ if (validFiles.length > 0) {
4509
+ onFilesAdded?.(validFiles);
4510
+ setState((prev) => {
4511
+ const newFiles2 = !multiple ? validFiles : [...prev.files, ...validFiles];
4512
+ onFilesChange?.(newFiles2);
4513
+ return {
4514
+ ...prev,
4515
+ files: newFiles2,
4516
+ errors
4517
+ };
4518
+ });
4519
+ } else if (errors.length > 0) {
4520
+ setState((prev) => ({
4521
+ ...prev,
4522
+ errors
4523
+ }));
4524
+ }
4525
+ if (inputRef.current) {
4526
+ inputRef.current.value = "";
4527
+ }
4528
+ },
4529
+ [
4530
+ state.files,
4531
+ maxFiles,
4532
+ multiple,
4533
+ maxSize,
4534
+ validateFile,
4535
+ createPreview,
4536
+ generateUniqueId,
4537
+ clearFiles,
4538
+ onFilesChange,
4539
+ onFilesAdded
4540
+ ]
4541
+ );
4542
+ const removeFile = React8.useCallback(
4543
+ (id) => {
4544
+ setState((prev) => {
4545
+ const fileToRemove = prev.files.find((file) => file.id === id);
4546
+ if (fileToRemove && fileToRemove.preview && fileToRemove.file instanceof File && fileToRemove.file.type.startsWith("image/")) {
4547
+ URL.revokeObjectURL(fileToRemove.preview);
4548
+ }
4549
+ const newFiles = prev.files.filter((file) => file.id !== id);
4550
+ onFilesChange?.(newFiles);
4551
+ return {
4552
+ ...prev,
4553
+ files: newFiles,
4554
+ errors: []
4555
+ };
4556
+ });
4557
+ },
4558
+ [onFilesChange]
4559
+ );
4560
+ const clearErrors = React8.useCallback(() => {
4561
+ setState((prev) => ({
4562
+ ...prev,
4563
+ errors: []
4564
+ }));
4565
+ }, []);
4566
+ const handleDragEnter = React8.useCallback((e) => {
4567
+ e.preventDefault();
4568
+ e.stopPropagation();
4569
+ setState((prev) => ({ ...prev, isDragging: true }));
4570
+ }, []);
4571
+ const handleDragLeave = React8.useCallback((e) => {
4572
+ e.preventDefault();
4573
+ e.stopPropagation();
4574
+ if (e.currentTarget.contains(e.relatedTarget)) {
4575
+ return;
4576
+ }
4577
+ setState((prev) => ({ ...prev, isDragging: false }));
4578
+ }, []);
4579
+ const handleDragOver = React8.useCallback((e) => {
4580
+ e.preventDefault();
4581
+ e.stopPropagation();
4582
+ }, []);
4583
+ const handleDrop = React8.useCallback(
4584
+ (e) => {
4585
+ e.preventDefault();
4586
+ e.stopPropagation();
4587
+ setState((prev) => ({ ...prev, isDragging: false }));
4588
+ if (inputRef.current?.disabled) {
4589
+ return;
4590
+ }
4591
+ if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {
4592
+ if (!multiple) {
4593
+ const file = e.dataTransfer.files[0];
4594
+ if (file) {
4595
+ addFiles([file]);
4596
+ }
4597
+ } else {
4598
+ addFiles(e.dataTransfer.files);
4599
+ }
4600
+ }
4601
+ },
4602
+ [addFiles, multiple]
4603
+ );
4604
+ const handleFileChange = React8.useCallback(
4605
+ (e) => {
4606
+ if (e.target.files && e.target.files.length > 0) {
4607
+ addFiles(e.target.files);
4608
+ }
4609
+ },
4610
+ [addFiles]
4611
+ );
4612
+ const openFileDialog = React8.useCallback(() => {
4613
+ if (inputRef.current) {
4614
+ inputRef.current.click();
4615
+ }
4616
+ }, []);
4617
+ const getInputProps = React8.useCallback(
4618
+ (props = {}) => {
4619
+ return {
4620
+ ...props,
4621
+ type: "file",
4622
+ onChange: handleFileChange,
4623
+ accept: props.accept || accept,
4624
+ multiple: props.multiple !== void 0 ? props.multiple : multiple,
4625
+ ref: inputRef
4626
+ };
4627
+ },
4628
+ [accept, multiple, handleFileChange]
4629
+ );
4630
+ return [
4631
+ state,
4632
+ {
4633
+ addFiles,
4634
+ removeFile,
4635
+ clearFiles,
4636
+ clearErrors,
4637
+ handleDragEnter,
4638
+ handleDragLeave,
4639
+ handleDragOver,
4640
+ handleDrop,
4641
+ handleFileChange,
4642
+ openFileDialog,
4643
+ getInputProps
4644
+ }
4645
+ ];
4646
+ };
4647
+ var formatBytes = (bytes, decimals = 2) => {
4648
+ if (bytes === 0) return "0 Bytes";
4649
+ const k = 1024;
4650
+ const dm = decimals < 0 ? 0 : decimals;
4651
+ const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
4652
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
4653
+ return Number.parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + (sizes?.[i] || "");
4654
+ };
4655
+ var filePreviewByMimetype = (mimetype) => {
4656
+ if (mimetype.match("text") || mimetype.match("application")) {
4657
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileTextIcon, {});
4658
+ }
4659
+ if (mimetype.match("audio")) {
4660
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileAudioIcon, {});
4661
+ }
4662
+ if (mimetype.match("video")) {
4663
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileVideoIcon, {});
4664
+ }
4665
+ return null;
4666
+ };
4667
+ function FileUpload({
4668
+ maxSizeMB = 2,
4669
+ subtitle,
4670
+ title,
4671
+ imagePreview,
4672
+ showPreview = true,
4673
+ onError,
4674
+ maxFiles = Infinity,
4675
+ ...rest
4676
+ }) {
4677
+ const { fileUpload } = useNebulaI18n().messages;
4678
+ const maxSize = maxSizeMB * 1024 * 1024;
4679
+ const [
4680
+ { files, isDragging, errors },
4681
+ {
4682
+ handleDragEnter,
4683
+ handleDragLeave,
4684
+ handleDragOver,
4685
+ handleDrop,
4686
+ openFileDialog,
4687
+ removeFile,
4688
+ getInputProps,
4689
+ clearFiles
4690
+ }
4691
+ ] = useFileUpload({
4692
+ multiple: false,
4693
+ maxSize: maxSize > 0 ? maxSize : void 0,
4694
+ accept: "*",
4695
+ ...rest,
4696
+ maxFiles
4697
+ });
4698
+ React8.useEffect(() => {
4699
+ onError?.(errors);
4700
+ }, [errors, onError]);
4701
+ const disabled = React8.useMemo(() => {
4702
+ if (rest.disabled) return true;
4703
+ if (rest.multiple) {
4704
+ if (!Number.isFinite(maxFiles)) return false;
4705
+ return files.length === maxFiles;
4706
+ }
4707
+ return files.length;
4708
+ }, [rest.disabled, rest.multiple, files.length, maxFiles]);
4709
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds flex flex-col gap-2 w-full", children: [
4710
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds relative w-full", children: /* @__PURE__ */ jsxRuntime.jsxs(
4711
+ "div",
4712
+ {
4713
+ role: "button",
4714
+ onClick: openFileDialog,
4715
+ onDragEnter: handleDragEnter,
4716
+ onDragLeave: handleDragLeave,
4717
+ onDragOver: handleDragOver,
4718
+ onDrop: handleDrop,
4719
+ "data-dragging": isDragging || void 0,
4720
+ className: cn(
4721
+ "bg-fileUpload-background hover:bg-fileUpload-backgroundHover transition-colors",
4722
+ "border border-dashed border-fileUpload-border rounded-2xl",
4723
+ "py-14",
4724
+ disabled && "pointer-events-none cursor-not-allowed"
4725
+ ),
4726
+ children: [
4727
+ /* @__PURE__ */ jsxRuntime.jsx(
4728
+ "input",
4729
+ {
4730
+ ...getInputProps(),
4731
+ className: "nebula-ds sr-only",
4732
+ "aria-label": "Upload file"
4733
+ }
4734
+ ),
4735
+ /* @__PURE__ */ jsxRuntime.jsxs(
4736
+ "div",
4737
+ {
4738
+ className: cn(
4739
+ "flex flex-col items-center justify-center px-4 py-3 text-center w-full",
4740
+ disabled && "opacity-60"
4741
+ ),
4742
+ children: [
4743
+ /* @__PURE__ */ jsxRuntime.jsx(
4744
+ "div",
4745
+ {
4746
+ className: "nebula-ds mb-2 flex size-12 shrink-0 items-center justify-center rounded-full border border-fileUpload-border",
4747
+ "aria-hidden": "true",
4748
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ImageUpIcon, { className: "nebula-ds size-4 opacity-60 text-fileUpload-icon" })
4749
+ }
4750
+ ),
4751
+ /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: "5", className: "nebula-ds mb-1", children: title }),
4752
+ /* @__PURE__ */ jsxRuntime.jsx(Paragraph, { size: "sm", children: subtitle })
4753
+ ]
4754
+ }
4755
+ )
4756
+ ]
4757
+ }
4758
+ ) }),
4759
+ files.length > 0 && showPreview && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds space-y-2", children: files.map((file, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
4760
+ "div",
4761
+ {
4762
+ className: "nebula-ds bg-fileUpload-backgroundFile flex items-center justify-between gap-2 rounded-xl border border-fileUpload-borderFile p-2",
4763
+ children: [
4764
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds flex items-center gap-3 overflow-hidden", children: [
4765
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds bg-[inherit] aspect-square shrink-0 rounded border border-fileUpload-borderFile size-10 [&>svg]:size-4 [&>svg]:text-fileUpload-icon flex items-center justify-center", children: imagePreview?.(file) || filePreviewByMimetype(file.file.type) || /* @__PURE__ */ jsxRuntime.jsx(
4766
+ "img",
4767
+ {
4768
+ src: file.preview,
4769
+ alt: file.file.name,
4770
+ className: "nebula-ds rounded-[inherit] object-cover h-full w-full"
4771
+ }
4772
+ ) }),
4773
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds flex min-w-0 flex-col gap-1", children: [
4774
+ /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: "5", className: "nebula-ds text-xs", children: file.file.name }),
4775
+ /* @__PURE__ */ jsxRuntime.jsx(Paragraph, { size: "sm", children: formatBytes(file.file.size) })
4776
+ ] })
4777
+ ] }),
4778
+ /* @__PURE__ */ jsxRuntime.jsx(
4779
+ Button,
4780
+ {
4781
+ icon: true,
4782
+ variant: "ghost",
4783
+ onClick: () => removeFile(file.id),
4784
+ "aria-label": "Remove file",
4785
+ "data-testid": `file-upload-remove-file-${idx}`,
4786
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { "aria-hidden": "true" })
4787
+ }
4788
+ )
4789
+ ]
4790
+ },
4791
+ file.id
4792
+ )) }),
4793
+ files.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
4794
+ Button,
4795
+ {
4796
+ size: "md",
4797
+ variant: "secondary",
4798
+ onClick: clearFiles,
4799
+ "data-testid": "file-upload-remove-all-files",
4800
+ children: fileUpload.deleteAll
4801
+ }
4802
+ ) })
4803
+ ] });
4804
+ }
4805
+ var TextArea = React8__namespace.forwardRef(
4806
+ ({
4807
+ className,
4808
+ isError = false,
4809
+ disabled,
4810
+ resize = true,
4811
+ showCount = false,
4812
+ autoResize = true,
4813
+ maxLength,
4814
+ asInput,
4815
+ ...props
4816
+ }, ref) => {
4817
+ const innerRef = React8__namespace.useRef(
4818
+ null
4819
+ );
4820
+ const [count, setCount] = React8__namespace.useState(String(props.value ?? "").length);
4821
+ const countParts = [count, maxLength].filter(
4822
+ (part) => typeof part === "number"
4823
+ );
4824
+ React8__namespace.useEffect(() => {
4825
+ const textarea = innerRef.current;
4826
+ if (!textarea || !autoResize) return;
4827
+ const adjustHeight = () => {
4828
+ textarea.style.height = "auto";
4829
+ textarea.style.height = asInput && !textarea.value || !textarea.value.match("\n") ? "22px" : `${textarea.scrollHeight}px`;
4830
+ };
4831
+ adjustHeight();
4832
+ textarea.addEventListener("input", adjustHeight);
4833
+ return () => {
4834
+ textarea.removeEventListener("input", adjustHeight);
4835
+ };
4836
+ }, [asInput, autoResize, props.value]);
4837
+ React8__namespace.useImperativeHandle(ref, () => innerRef.current);
4838
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nebula-ds relative", children: [
4839
+ /* @__PURE__ */ jsxRuntime.jsx(
4840
+ "div",
4841
+ {
4842
+ className: cn(
4843
+ "w-full pl-0 pr-2 py-2 overflow-hidden flex box-border",
4844
+ "w-full outline-none rounded-textarea text-sm font-medium",
4845
+ "bg-inputText-background-default",
4846
+ "border border-inputText-border-default focus-within:ring-[3px] focus-within:ring-inputText-border-focus focus-within:border-inputText-border-focus",
4847
+ "text-inputText-text-filled focus-within:text-inputText-text-focus ",
4848
+ "disabled:cursor-not-allowed",
4849
+ "[&>textarea]:bg-transparent [&>textarea]:w-full [&>textarea]:py-0 [&>textarea]:pr-2 [&>textarea]:pl-4 [&>textarea]:flex-1 [&>textarea]:min-h-[62px] [&>textarea]:box-border",
4850
+ "[&>textarea]:focus:ring-0 [&>textarea]:focus:border-none [&>textarea]:border-none [&>textarea]:outline-none [&>textarea]:ring-0",
4851
+ "[&>textarea]:bg-inputText-background-default disabled:[&>textarea]:bg-inputText-background-disabled",
4852
+ "[&>textarea]:placeholder:text-inputText-text-default disabled:[&>textarea]:text-inputText-text-disabled",
4853
+ {
4854
+ "bg-inputText-background-disabled text-inputText-text-disabled [&>textarea]:ps-4 [&>textarea]:pr-2": disabled,
4855
+ "border-inputText-border-danger focus-within:border-inputText-border-danger focus-within:ring-button-danger-border-focus": isError,
4856
+ "[&>textarea]:resize-none": !resize,
4857
+ "[&>textarea]:min-h-[22px] !rounded-input": asInput
4858
+ },
4859
+ className
4860
+ ),
4861
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4862
+ "textarea",
4863
+ {
4864
+ ref: innerRef,
4865
+ ...props,
4866
+ disabled,
4867
+ onChange: (e) => {
4868
+ if (showCount) {
4869
+ setCount(e.target.value.length);
4870
+ }
4871
+ props.onChange?.(e);
4872
+ }
4873
+ }
4874
+ )
4875
+ }
4876
+ ),
4877
+ !!showCount && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nebula-ds absolute right-0 top-[100%] pt-1", children: /* @__PURE__ */ jsxRuntime.jsx(Paragraph, { size: "sm", children: countParts.join("/") }) })
4878
+ ] });
4879
+ }
4880
+ );
4881
+ TextArea.displayName = "TextArea";
3678
4882
 
3679
4883
  // src/tailwind.ts
3680
4884
  function content({ base = "./" } = {}) {
@@ -3685,36 +4889,6 @@ var tailwind = {
3685
4889
  content
3686
4890
  // plugin: () => require("tailwindcss")("node_modules/@nebulareact/dist/tailwind.config.js"),
3687
4891
  };
3688
- /*! Bundled license information:
3689
-
3690
- lucide-react/dist/esm/shared/src/utils.js:
3691
- lucide-react/dist/esm/defaultAttributes.js:
3692
- lucide-react/dist/esm/Icon.js:
3693
- lucide-react/dist/esm/createLucideIcon.js:
3694
- lucide-react/dist/esm/icons/check.js:
3695
- lucide-react/dist/esm/icons/chevron-down.js:
3696
- lucide-react/dist/esm/icons/chevron-left.js:
3697
- lucide-react/dist/esm/icons/chevron-right.js:
3698
- lucide-react/dist/esm/icons/chevrons-left.js:
3699
- lucide-react/dist/esm/icons/chevrons-right.js:
3700
- lucide-react/dist/esm/icons/circle-check-big.js:
3701
- lucide-react/dist/esm/icons/circle-x.js:
3702
- lucide-react/dist/esm/icons/circle.js:
3703
- lucide-react/dist/esm/icons/ellipsis.js:
3704
- lucide-react/dist/esm/icons/eye-off.js:
3705
- lucide-react/dist/esm/icons/eye.js:
3706
- lucide-react/dist/esm/icons/info.js:
3707
- lucide-react/dist/esm/icons/minus.js:
3708
- lucide-react/dist/esm/icons/phone.js:
3709
- lucide-react/dist/esm/icons/x.js:
3710
- lucide-react/dist/esm/lucide-react.js:
3711
- (**
3712
- * @license lucide-react v0.476.0 - ISC
3713
- *
3714
- * This source code is licensed under the ISC license.
3715
- * See the LICENSE file in the root directory of this source tree.
3716
- *)
3717
- */
3718
4892
 
3719
4893
  exports.Accordion = Accordion;
3720
4894
  exports.AccordionContent = AccordionContent;
@@ -3754,6 +4928,7 @@ exports.BreadcrumbList = BreadcrumbList;
3754
4928
  exports.BreadcrumbPage = BreadcrumbPage;
3755
4929
  exports.BreadcrumbSeparator = BreadcrumbSeparator;
3756
4930
  exports.Button = Button;
4931
+ exports.Calendar = Calendar;
3757
4932
  exports.Caption = Caption;
3758
4933
  exports.Checkbox = Checkbox;
3759
4934
  exports.Creatable = StyledCreatable;
@@ -3791,9 +4966,14 @@ exports.DropdownMenuSub = DropdownMenuSub;
3791
4966
  exports.DropdownMenuSubContent = DropdownMenuSubContent;
3792
4967
  exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
3793
4968
  exports.DropdownMenuTrigger = DropdownMenuTrigger;
4969
+ exports.FileUpload = FileUpload;
4970
+ exports.FileUploadError = FileUploadError;
3794
4971
  exports.Heading = Heading;
4972
+ exports.InputDatePickerSingle = InputDatePickerSingle;
4973
+ exports.InputDateTimePickerSingle = InputDateTimePickerSingle;
3795
4974
  exports.InputPhone = InputPhone;
3796
4975
  exports.InputText = InputText;
4976
+ exports.InputTime = InputTime;
3797
4977
  exports.Label = Label;
3798
4978
  exports.Link = Link;
3799
4979
  exports.NebulaI18nProvider = NebulaI18nProvider;
@@ -3822,6 +5002,7 @@ exports.TabsContent = TabsContent;
3822
5002
  exports.TabsList = TabsList;
3823
5003
  exports.TabsTrigger = TabsTrigger;
3824
5004
  exports.Tag = Tag;
5005
+ exports.TextArea = TextArea;
3825
5006
  exports.Toaster = Toaster;
3826
5007
  exports.Tooltip = Tooltip;
3827
5008
  exports.alertVariants = alertVariants;
@@ -3830,8 +5011,11 @@ exports.badgeVariantEnum = badgeVariantEnum;
3830
5011
  exports.buttonSizeEnum = buttonSizeEnum;
3831
5012
  exports.buttonVariantEnum = buttonVariantEnum;
3832
5013
  exports.buttonVariantsConfig = buttonVariantsConfig;
5014
+ exports.dateIsAvailable = dateIsAvailable;
5015
+ exports.formatBytes = formatBytes;
3833
5016
  exports.getNebulaLanguage = getNebulaLanguage;
3834
- exports.messages = messages10;
5017
+ exports.localeByi18nKey = localeByi18nKey;
5018
+ exports.messages = messages16;
3835
5019
  exports.separatorVariants = separatorVariants;
3836
5020
  exports.setNebulaLanguage = setNebulaLanguage;
3837
5021
  exports.tagVariantsEnum = tagVariantsEnum;