@iclips/ui 0.0.17 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -5,7 +5,7 @@ var lucideReact = require('lucide-react');
5
5
  var clsx = require('clsx');
6
6
  var tailwindMerge = require('tailwind-merge');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
- var React5 = require('react');
8
+ var React7 = require('react');
9
9
  var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
10
10
  var reactSlot = require('@radix-ui/react-slot');
11
11
  var classVarianceAuthority = require('class-variance-authority');
@@ -66,7 +66,7 @@ function _interopNamespace(e) {
66
66
  }
67
67
 
68
68
  var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
69
- var React5__namespace = /*#__PURE__*/_interopNamespace(React5);
69
+ var React7__namespace = /*#__PURE__*/_interopNamespace(React7);
70
70
  var AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(AlertDialogPrimitive);
71
71
  var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
72
72
  var AspectRatioPrimitive__namespace = /*#__PURE__*/_interopNamespace(AspectRatioPrimitive);
@@ -178,7 +178,7 @@ var buttonVariants = classVarianceAuthority.cva(
178
178
  }
179
179
  }
180
180
  );
181
- var Button = React5__namespace.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
181
+ var Button = React7__namespace.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
182
182
  const Comp = asChild ? reactSlot.Slot : "button";
183
183
  return /* @__PURE__ */ jsxRuntime.jsx(
184
184
  Comp,
@@ -206,7 +206,7 @@ function AlertDialogPortal({
206
206
  }) {
207
207
  return /* @__PURE__ */ jsxRuntime.jsx(AlertDialogPrimitive__namespace.Portal, { "data-slot": "alert-dialog-portal", ...props });
208
208
  }
209
- var AlertDialogOverlay = React5__namespace.forwardRef(({ className, ...props }, ref) => {
209
+ var AlertDialogOverlay = React7__namespace.forwardRef(({ className, ...props }, ref) => {
210
210
  return /* @__PURE__ */ jsxRuntime.jsx(
211
211
  AlertDialogPrimitive__namespace.Overlay,
212
212
  {
@@ -446,7 +446,7 @@ var badgeVariants = classVarianceAuthority.cva(
446
446
  }
447
447
  }
448
448
  );
449
- var Badge = React5__namespace.forwardRef(({ className, variant, asChild = false, ...props }, ref) => {
449
+ var Badge = React7__namespace.forwardRef(({ className, variant, asChild = false, ...props }, ref) => {
450
450
  const Comp = asChild ? reactSlot.Slot : "span";
451
451
  return /* @__PURE__ */ jsxRuntime.jsx(
452
452
  Comp,
@@ -591,10 +591,10 @@ function AppLayout({
591
591
  defaultPrimaryNavPinned = false,
592
592
  defaultSecondaryNavOpen = true
593
593
  }) {
594
- const [isPrimaryNavPinned, setIsPrimaryNavPinned] = React5__namespace.useState(defaultPrimaryNavPinned);
595
- const [isPrimaryNavHovered, setIsPrimaryNavHovered] = React5__namespace.useState(false);
596
- const [isSecondaryNavOpen, setIsSecondaryNavOpen] = React5__namespace.useState(defaultSecondaryNavOpen);
597
- const [activeItem, setActiveItem] = React5__namespace.useState(activePrimaryItem || primaryNavItems[0]?.id);
594
+ const [isPrimaryNavPinned, setIsPrimaryNavPinned] = React7__namespace.useState(defaultPrimaryNavPinned);
595
+ const [isPrimaryNavHovered, setIsPrimaryNavHovered] = React7__namespace.useState(false);
596
+ const [isSecondaryNavOpen, setIsSecondaryNavOpen] = React7__namespace.useState(defaultSecondaryNavOpen);
597
+ const [activeItem, setActiveItem] = React7__namespace.useState(activePrimaryItem || primaryNavItems[0]?.id);
598
598
  const isPrimaryNavExpanded = isPrimaryNavPinned || isPrimaryNavHovered;
599
599
  const handlePrimaryItemClick = (id) => {
600
600
  setActiveItem(id);
@@ -866,61 +866,6 @@ function BreadcrumbEllipsis({
866
866
  }
867
867
  );
868
868
  }
869
- function Calendar2({
870
- className,
871
- classNames,
872
- showOutsideDays = true,
873
- ...props
874
- }) {
875
- return /* @__PURE__ */ jsxRuntime.jsx(
876
- reactDayPicker.DayPicker,
877
- {
878
- showOutsideDays,
879
- className: cn("p-3", className),
880
- classNames: {
881
- months: "flex flex-col sm:flex-row gap-2",
882
- month: "flex flex-col gap-4",
883
- caption: "flex justify-center pt-1 relative items-center w-full",
884
- caption_label: "text-sm font-medium",
885
- nav: "flex items-center gap-1",
886
- nav_button: cn(
887
- buttonVariants({ variant: "outline" }),
888
- "size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
889
- ),
890
- nav_button_previous: "absolute left-1",
891
- nav_button_next: "absolute right-1",
892
- table: "w-full border-collapse space-x-1",
893
- head_row: "flex",
894
- head_cell: "text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",
895
- row: "flex w-full mt-2",
896
- cell: cn(
897
- "relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",
898
- props.mode === "range" ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" : "[&:has([aria-selected])]:rounded-md"
899
- ),
900
- day: cn(
901
- buttonVariants({ variant: "ghost" }),
902
- "size-8 p-0 font-normal aria-selected:opacity-100"
903
- ),
904
- day_range_start: "day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",
905
- day_range_end: "day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",
906
- day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
907
- day_today: "bg-accent text-accent-foreground",
908
- day_outside: "day-outside text-muted-foreground aria-selected:text-muted-foreground",
909
- day_disabled: "text-muted-foreground opacity-50",
910
- day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
911
- day_hidden: "invisible",
912
- ...classNames
913
- },
914
- components: {
915
- Chevron: ({ orientation, ...props2 }) => {
916
- const Icon2 = orientation === "left" ? lucideReact.ChevronLeft : lucideReact.ChevronRight;
917
- return /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-4", ...props2 });
918
- }
919
- },
920
- ...props
921
- }
922
- );
923
- }
924
869
  function Card({ className, ...props }) {
925
870
  return /* @__PURE__ */ jsxRuntime.jsx(
926
871
  "div",
@@ -987,9 +932,863 @@ function CardFooter({ className, ...props }) {
987
932
  }
988
933
  );
989
934
  }
990
- var CarouselContext = React5__namespace.createContext(null);
935
+ var ERROR_IMG_SRC = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODgiIGhlaWdodD0iODgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBvcGFjaXR5PSIuMyIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIzLjciPjxyZWN0IHg9IjE2IiB5PSIxNiIgd2lkdGg9IjU2IiBoZWlnaHQ9IjU2IiByeD0iNiIvPjxwYXRoIGQ9Im0xNiA1OCAxNi0xOCAzMiAzMiIvPjxjaXJjbGUgY3g9IjUzIiBjeT0iMzUiIHI9IjciLz48L3N2Zz4KCg==";
936
+ function ImageWithFallback(props) {
937
+ const [didError, setDidError] = React7.useState(false);
938
+ const handleError = () => {
939
+ setDidError(true);
940
+ };
941
+ const { src, alt, style, className, ...rest } = props;
942
+ return didError ? /* @__PURE__ */ jsxRuntime.jsx(
943
+ "div",
944
+ {
945
+ className: `inline-block bg-gray-100 text-center align-middle ${className ?? ""}`,
946
+ style,
947
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: ERROR_IMG_SRC, alt: "Error loading image", ...rest, "data-original-url": src }) })
948
+ }
949
+ ) : /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt, className, style, ...rest, onError: handleError });
950
+ }
951
+ function PrintHeader({
952
+ logo,
953
+ companyName = "iClips",
954
+ contactInfo,
955
+ documentType,
956
+ documentNumber,
957
+ issueDate
958
+ }) {
959
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "print-header border-b-2 border-primary pb-6 mb-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between", children: [
960
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-4", children: [
961
+ logo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-24 h-24 flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(
962
+ ImageWithFallback,
963
+ {
964
+ src: logo,
965
+ alt: `${companyName} Logo`,
966
+ className: "w-full h-full object-contain"
967
+ }
968
+ ) }),
969
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
970
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-semibold text-primary", children: companyName }),
971
+ contactInfo && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-gray-600 space-y-0.5", children: [
972
+ contactInfo.address && /* @__PURE__ */ jsxRuntime.jsx("p", { children: contactInfo.address }),
973
+ contactInfo.phone && /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
974
+ "Tel: ",
975
+ contactInfo.phone
976
+ ] }),
977
+ contactInfo.email && /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
978
+ "Email: ",
979
+ contactInfo.email
980
+ ] }),
981
+ contactInfo.website && /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
982
+ "Site: ",
983
+ contactInfo.website
984
+ ] })
985
+ ] })
986
+ ] })
987
+ ] }),
988
+ (documentType || documentNumber || issueDate) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-right space-y-1", children: [
989
+ documentType && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-gray-900", children: documentType }),
990
+ documentNumber && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-600", children: [
991
+ "N\xBA ",
992
+ documentNumber
993
+ ] }),
994
+ issueDate && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-gray-500", children: [
995
+ "Emitido em: ",
996
+ issueDate
997
+ ] })
998
+ ] })
999
+ ] }) });
1000
+ }
1001
+ function PrintFooter({
1002
+ pageNumber,
1003
+ totalPages,
1004
+ footerText,
1005
+ showGeneratedDate = true
1006
+ }) {
1007
+ const currentDate = (/* @__PURE__ */ new Date()).toLocaleDateString("pt-BR", {
1008
+ year: "numeric",
1009
+ month: "long",
1010
+ day: "numeric"
1011
+ });
1012
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "print-footer mt-12 pt-6 border-t border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-xs text-gray-500", children: [
1013
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: footerText ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: footerText }) : showGeneratedDate ? /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
1014
+ "Documento gerado em ",
1015
+ currentDate
1016
+ ] }) : null }),
1017
+ pageNumber && totalPages && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
1018
+ "P\xE1gina ",
1019
+ pageNumber,
1020
+ " de ",
1021
+ totalPages
1022
+ ] }) })
1023
+ ] }) });
1024
+ }
1025
+ function PrintSection({
1026
+ title,
1027
+ subtitle,
1028
+ children,
1029
+ className,
1030
+ avoidBreak = false,
1031
+ pageBreak = false
1032
+ }) {
1033
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1034
+ "div",
1035
+ {
1036
+ className: cn(
1037
+ "print-section mb-8",
1038
+ avoidBreak && "avoid-break",
1039
+ pageBreak && "page-break",
1040
+ className
1041
+ ),
1042
+ children: [
1043
+ title && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", children: [
1044
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-gray-900 border-b-2 border-primary pb-2", children: title }),
1045
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600 mt-1", children: subtitle })
1046
+ ] }),
1047
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-700 leading-relaxed", children })
1048
+ ]
1049
+ }
1050
+ );
1051
+ }
1052
+ function PrintInfoGrid({
1053
+ items,
1054
+ columns = 2,
1055
+ className
1056
+ }) {
1057
+ const gridClass = {
1058
+ 1: "grid-cols-1",
1059
+ 2: "grid-cols-2",
1060
+ 3: "grid-cols-3",
1061
+ 4: "grid-cols-4"
1062
+ }[columns];
1063
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("print-info-grid", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("grid gap-4", gridClass), children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
1064
+ "div",
1065
+ {
1066
+ className: cn(
1067
+ "info-item",
1068
+ item.highlight && "bg-gray-50 p-3 rounded border border-gray-200"
1069
+ ),
1070
+ children: [
1071
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide mb-1", children: item.label }),
1072
+ /* @__PURE__ */ jsxRuntime.jsx(
1073
+ "dd",
1074
+ {
1075
+ className: cn(
1076
+ "text-sm text-gray-900",
1077
+ item.highlight && "font-semibold"
1078
+ ),
1079
+ children: item.value
1080
+ }
1081
+ )
1082
+ ]
1083
+ },
1084
+ index
1085
+ )) }) });
1086
+ }
1087
+ function PrintTable({
1088
+ columns,
1089
+ data,
1090
+ title,
1091
+ striped = true,
1092
+ bordered = true,
1093
+ density = "normal"
1094
+ }) {
1095
+ const paddingClass = {
1096
+ compact: "px-2 py-1",
1097
+ normal: "px-3 py-2",
1098
+ comfortable: "px-4 py-3"
1099
+ }[density];
1100
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "print-table-container avoid-break", children: [
1101
+ title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold text-gray-900 mb-3", children: title }),
1102
+ /* @__PURE__ */ jsxRuntime.jsxs(
1103
+ "table",
1104
+ {
1105
+ className: cn(
1106
+ "w-full text-sm",
1107
+ bordered && "border border-gray-300"
1108
+ ),
1109
+ children: [
1110
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "bg-gray-100", children: columns.map((column, index) => /* @__PURE__ */ jsxRuntime.jsx(
1111
+ "th",
1112
+ {
1113
+ className: cn(
1114
+ paddingClass,
1115
+ "font-semibold text-gray-900 border-b-2 border-gray-300",
1116
+ column.align === "center" && "text-center",
1117
+ column.align === "right" && "text-right"
1118
+ ),
1119
+ style: { width: column.width },
1120
+ children: column.header
1121
+ },
1122
+ index
1123
+ )) }) }),
1124
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: data.map((row, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(
1125
+ "tr",
1126
+ {
1127
+ className: cn(
1128
+ striped && rowIndex % 2 === 0 && "bg-gray-50",
1129
+ "avoid-break"
1130
+ ),
1131
+ children: columns.map((column, colIndex) => {
1132
+ const value = row[column.key];
1133
+ const displayValue = column.render ? column.render(value, row) : value;
1134
+ return /* @__PURE__ */ jsxRuntime.jsx(
1135
+ "td",
1136
+ {
1137
+ className: cn(
1138
+ paddingClass,
1139
+ "border-b border-gray-200",
1140
+ column.align === "center" && "text-center",
1141
+ column.align === "right" && "text-right"
1142
+ ),
1143
+ children: displayValue
1144
+ },
1145
+ colIndex
1146
+ );
1147
+ })
1148
+ },
1149
+ rowIndex
1150
+ )) })
1151
+ ]
1152
+ }
1153
+ )
1154
+ ] });
1155
+ }
1156
+ function PrintSignature({
1157
+ signatures,
1158
+ layout = "horizontal",
1159
+ showLine = true,
1160
+ instructionText
1161
+ }) {
1162
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "print-signature mt-12 page-break avoid-break", children: [
1163
+ instructionText && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600 mb-6", children: instructionText }),
1164
+ /* @__PURE__ */ jsxRuntime.jsx(
1165
+ "div",
1166
+ {
1167
+ className: layout === "horizontal" ? "grid grid-cols-2 gap-8" : "space-y-12",
1168
+ children: signatures.map((signature, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "signature-field", children: [
1169
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-20 mb-2" }),
1170
+ showLine && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t-2 border-gray-900 mb-2" }),
1171
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm", children: [
1172
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold text-gray-900", children: signature.label }),
1173
+ signature.name && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: signature.name }),
1174
+ signature.role && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 text-xs", children: signature.role }),
1175
+ signature.date && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-gray-500 text-xs mt-1", children: [
1176
+ "Data: ",
1177
+ signature.date
1178
+ ] })
1179
+ ] })
1180
+ ] }, index))
1181
+ }
1182
+ )
1183
+ ] });
1184
+ }
1185
+ function ContractTemplate({
1186
+ data,
1187
+ showPreview = false,
1188
+ logo,
1189
+ showServices = true
1190
+ }) {
1191
+ const formatCurrency = (value) => {
1192
+ return new Intl.NumberFormat("pt-BR", {
1193
+ style: "currency",
1194
+ currency: "BRL"
1195
+ }).format(value);
1196
+ };
1197
+ const formatDate = (dateStr) => {
1198
+ return new Date(dateStr).toLocaleDateString("pt-BR", {
1199
+ year: "numeric",
1200
+ month: "long",
1201
+ day: "numeric"
1202
+ });
1203
+ };
1204
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1205
+ "div",
1206
+ {
1207
+ className: cn(
1208
+ "contract-template bg-white text-black",
1209
+ showPreview ? "shadow-lg rounded-lg p-8 max-w-5xl mx-auto my-8" : "p-0"
1210
+ ),
1211
+ style: {
1212
+ fontFamily: "system-ui, -apple-system, sans-serif",
1213
+ fontSize: "12pt",
1214
+ lineHeight: "1.6"
1215
+ },
1216
+ children: [
1217
+ /* @__PURE__ */ jsxRuntime.jsx(
1218
+ PrintHeader,
1219
+ {
1220
+ logo,
1221
+ companyName: data.agencia.nome,
1222
+ contactInfo: {
1223
+ address: data.agencia.endereco,
1224
+ phone: data.agencia.telefone,
1225
+ email: data.agencia.email
1226
+ },
1227
+ documentType: "Contrato de Fee Mensal",
1228
+ documentNumber: data.numeroContrato,
1229
+ issueDate: formatDate(data.dataEmissao)
1230
+ }
1231
+ ),
1232
+ /* @__PURE__ */ jsxRuntime.jsx(PrintSection, { title: "Informa\xE7\xF5es do Contrato", children: /* @__PURE__ */ jsxRuntime.jsx(
1233
+ PrintInfoGrid,
1234
+ {
1235
+ columns: 2,
1236
+ items: [
1237
+ {
1238
+ label: "N\xFAmero do Contrato",
1239
+ value: data.numeroContrato,
1240
+ highlight: true
1241
+ },
1242
+ {
1243
+ label: "Data de Emiss\xE3o",
1244
+ value: formatDate(data.dataEmissao)
1245
+ },
1246
+ {
1247
+ label: "Vig\xEAncia - In\xEDcio",
1248
+ value: formatDate(data.dataInicio)
1249
+ },
1250
+ {
1251
+ label: "Vig\xEAncia - T\xE9rmino",
1252
+ value: formatDate(data.dataTermino)
1253
+ },
1254
+ {
1255
+ label: "Valor do Fee Mensal",
1256
+ value: formatCurrency(data.valorFee),
1257
+ highlight: true
1258
+ },
1259
+ {
1260
+ label: "Total de Horas",
1261
+ value: `${data.totalHoras}h/m\xEAs`
1262
+ }
1263
+ ]
1264
+ }
1265
+ ) }),
1266
+ /* @__PURE__ */ jsxRuntime.jsxs(PrintSection, { title: "Partes Contratantes", className: "grid grid-cols-2 gap-6", children: [
1267
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1268
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-sm mb-3 text-primary", children: "CONTRATANTE" }),
1269
+ /* @__PURE__ */ jsxRuntime.jsx(
1270
+ PrintInfoGrid,
1271
+ {
1272
+ columns: 1,
1273
+ items: [
1274
+ { label: "Raz\xE3o Social", value: data.cliente.nome },
1275
+ ...data.cliente.cnpj ? [{ label: "CNPJ", value: data.cliente.cnpj }] : [],
1276
+ ...data.cliente.endereco ? [{ label: "Endere\xE7o", value: data.cliente.endereco }] : [],
1277
+ ...data.cliente.representante ? [
1278
+ {
1279
+ label: "Representante Legal",
1280
+ value: data.cliente.representante
1281
+ }
1282
+ ] : [],
1283
+ ...data.cliente.email ? [{ label: "E-mail", value: data.cliente.email }] : [],
1284
+ ...data.cliente.telefone ? [{ label: "Telefone", value: data.cliente.telefone }] : []
1285
+ ]
1286
+ }
1287
+ )
1288
+ ] }),
1289
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1290
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-sm mb-3 text-primary", children: "CONTRATADA" }),
1291
+ /* @__PURE__ */ jsxRuntime.jsx(
1292
+ PrintInfoGrid,
1293
+ {
1294
+ columns: 1,
1295
+ items: [
1296
+ { label: "Raz\xE3o Social", value: data.agencia.nome },
1297
+ ...data.agencia.cnpj ? [{ label: "CNPJ", value: data.agencia.cnpj }] : [],
1298
+ ...data.agencia.endereco ? [{ label: "Endere\xE7o", value: data.agencia.endereco }] : [],
1299
+ ...data.agencia.representante ? [
1300
+ {
1301
+ label: "Representante Legal",
1302
+ value: data.agencia.representante
1303
+ }
1304
+ ] : [],
1305
+ ...data.agencia.email ? [{ label: "E-mail", value: data.agencia.email }] : [],
1306
+ ...data.agencia.telefone ? [{ label: "Telefone", value: data.agencia.telefone }] : []
1307
+ ]
1308
+ }
1309
+ )
1310
+ ] })
1311
+ ] }),
1312
+ showServices && data.servicos && data.servicos.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(PrintSection, { title: "Escopo dos Servi\xE7os", children: /* @__PURE__ */ jsxRuntime.jsx(
1313
+ PrintTable,
1314
+ {
1315
+ columns: [
1316
+ { header: "Servi\xE7o", key: "nome", width: "40%" },
1317
+ { header: "Descri\xE7\xE3o", key: "descricao", width: "45%" },
1318
+ {
1319
+ header: "Horas Est.",
1320
+ key: "horasEstimadas",
1321
+ align: "center",
1322
+ width: "15%",
1323
+ render: (value) => value ? `${value}h` : "-"
1324
+ }
1325
+ ],
1326
+ data: data.servicos,
1327
+ striped: true,
1328
+ density: "comfortable"
1329
+ }
1330
+ ) }),
1331
+ /* @__PURE__ */ jsxRuntime.jsx(PrintSection, { title: "Condi\xE7\xF5es Comerciais", children: /* @__PURE__ */ jsxRuntime.jsx(
1332
+ PrintInfoGrid,
1333
+ {
1334
+ columns: 2,
1335
+ items: [
1336
+ {
1337
+ label: "Valor do Fee Mensal",
1338
+ value: formatCurrency(data.valorFee),
1339
+ highlight: true
1340
+ },
1341
+ {
1342
+ label: "Total de Horas Mensais",
1343
+ value: `${data.totalHoras} horas`
1344
+ },
1345
+ ...data.valorHora ? [
1346
+ {
1347
+ label: "Valor da Hora Adicional",
1348
+ value: formatCurrency(data.valorHora)
1349
+ }
1350
+ ] : [],
1351
+ {
1352
+ label: "Condi\xE7\xF5es de Pagamento",
1353
+ value: data.condicoesPagamento
1354
+ },
1355
+ ...data.formaPagamento ? [
1356
+ {
1357
+ label: "Forma de Pagamento",
1358
+ value: data.formaPagamento
1359
+ }
1360
+ ] : []
1361
+ ]
1362
+ }
1363
+ ) }),
1364
+ data.clausulas && data.clausulas.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(PrintSection, { title: "Cl\xE1usulas Contratuais", pageBreak: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-6", children: data.clausulas.map((clause, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "clause avoid-break", children: [
1365
+ /* @__PURE__ */ jsxRuntime.jsxs("h4", { className: "font-semibold text-sm mb-2", children: [
1366
+ "Cl\xE1usula ",
1367
+ index + 1,
1368
+ "\xAA - ",
1369
+ clause.titulo
1370
+ ] }),
1371
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-700 leading-relaxed pl-4", children: clause.conteudo })
1372
+ ] }, index)) }) }),
1373
+ data.observacoes && /* @__PURE__ */ jsxRuntime.jsx(PrintSection, { title: "Observa\xE7\xF5es", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-700 leading-relaxed", children: data.observacoes }) }),
1374
+ /* @__PURE__ */ jsxRuntime.jsx(
1375
+ PrintSignature,
1376
+ {
1377
+ signatures: [
1378
+ {
1379
+ label: "CONTRATANTE",
1380
+ name: data.cliente.nome,
1381
+ role: data.cliente.representante
1382
+ },
1383
+ {
1384
+ label: "CONTRATADA",
1385
+ name: data.agencia.nome,
1386
+ role: data.agencia.representante
1387
+ }
1388
+ ],
1389
+ instructionText: "As partes, estando de acordo com os termos e condi\xE7\xF5es estabelecidos neste contrato, assinam o presente instrumento em duas vias de igual teor e forma."
1390
+ }
1391
+ ),
1392
+ /* @__PURE__ */ jsxRuntime.jsx(PrintFooter, { pageNumber: 1, totalPages: 1 })
1393
+ ]
1394
+ }
1395
+ );
1396
+ }
1397
+ var dadosContratoExemplo = {
1398
+ numeroContrato: "FEE-2024-001",
1399
+ dataEmissao: "2024-01-15",
1400
+ dataInicio: "2024-02-01",
1401
+ dataTermino: "2025-01-31",
1402
+ cliente: {
1403
+ nome: "Coca-Cola Brasil Ltda.",
1404
+ cnpj: "00.000.000/0001-00",
1405
+ endereco: "Av. Paulista, 1000 - S\xE3o Paulo, SP - CEP 01310-100",
1406
+ representante: "Jo\xE3o da Silva",
1407
+ email: "joao.silva@cocacola.com.br",
1408
+ telefone: "(11) 3000-0000"
1409
+ },
1410
+ agencia: {
1411
+ nome: "iClips Publicidade e Marketing",
1412
+ cnpj: "11.111.111/0001-11",
1413
+ endereco: "Rua das Flores, 500 - S\xE3o Paulo, SP - CEP 04567-890",
1414
+ representante: "Maria Santos",
1415
+ email: "contato@iclips.com.br",
1416
+ telefone: "(11) 4000-0000"
1417
+ },
1418
+ valorFee: 15e3,
1419
+ totalHoras: 160,
1420
+ valorHora: 150,
1421
+ condicoesPagamento: "At\xE9 o 5\xBA dia \xFAtil do m\xEAs subsequente",
1422
+ formaPagamento: "Transfer\xEAncia banc\xE1ria",
1423
+ servicos: [
1424
+ {
1425
+ nome: "Gest\xE3o de M\xEDdias Sociais",
1426
+ descricao: "Planejamento, cria\xE7\xE3o de conte\xFAdo e publica\xE7\xE3o em redes sociais",
1427
+ horasEstimadas: 60
1428
+ },
1429
+ {
1430
+ nome: "Cria\xE7\xE3o de Campanhas",
1431
+ descricao: "Desenvolvimento de campanhas publicit\xE1rias integradas",
1432
+ horasEstimadas: 50
1433
+ },
1434
+ {
1435
+ nome: "Produ\xE7\xE3o de Conte\xFAdo",
1436
+ descricao: "Cria\xE7\xE3o de textos, imagens e v\xEDdeos para diversos canais",
1437
+ horasEstimadas: 30
1438
+ },
1439
+ {
1440
+ nome: "Atendimento e Planejamento",
1441
+ descricao: "Reuni\xF5es de alinhamento, relat\xF3rios e planejamento estrat\xE9gico",
1442
+ horasEstimadas: 20
1443
+ }
1444
+ ],
1445
+ clausulas: [
1446
+ {
1447
+ titulo: "Do Objeto",
1448
+ conteudo: "O presente contrato tem por objeto a presta\xE7\xE3o de servi\xE7os de publicidade e marketing pela CONTRATADA \xE0 CONTRATANTE, compreendendo as atividades descritas no escopo dos servi\xE7os, mediante o pagamento do fee mensal estabelecido."
1449
+ },
1450
+ {
1451
+ titulo: "Do Valor e Forma de Pagamento",
1452
+ conteudo: "Pelos servi\xE7os prestados, a CONTRATANTE pagar\xE1 \xE0 CONTRATADA o valor mensal de R$ 15.000,00 (quinze mil reais), que dever\xE1 ser pago at\xE9 o 5\xBA dia \xFAtil do m\xEAs subsequente \xE0 presta\xE7\xE3o dos servi\xE7os, mediante transfer\xEAncia banc\xE1ria para a conta indicada pela CONTRATADA."
1453
+ },
1454
+ {
1455
+ titulo: "Das Horas de Trabalho",
1456
+ conteudo: "O fee mensal inclui at\xE9 160 (cento e sessenta) horas de trabalho. Horas excedentes ser\xE3o cobradas separadamente ao valor de R$ 150,00 (cento e cinquenta reais) por hora, mediante aprova\xE7\xE3o pr\xE9via da CONTRATANTE."
1457
+ },
1458
+ {
1459
+ titulo: "Da Vig\xEAncia",
1460
+ conteudo: "O presente contrato ter\xE1 vig\xEAncia de 12 (doze) meses, iniciando-se em 01 de fevereiro de 2024 e encerrando-se em 31 de janeiro de 2025, podendo ser renovado mediante acordo entre as partes."
1461
+ },
1462
+ {
1463
+ titulo: "Da Rescis\xE3o",
1464
+ conteudo: "Qualquer das partes poder\xE1 rescindir o presente contrato mediante comunica\xE7\xE3o por escrito com anteced\xEAncia m\xEDnima de 30 (trinta) dias, sem preju\xEDzo das obriga\xE7\xF5es j\xE1 assumidas at\xE9 a data da rescis\xE3o."
1465
+ },
1466
+ {
1467
+ titulo: "Da Confidencialidade",
1468
+ conteudo: "As partes se comprometem a manter sigilo sobre todas as informa\xE7\xF5es confidenciais a que tiverem acesso em decorr\xEAncia deste contrato, n\xE3o podendo divulg\xE1-las a terceiros sem pr\xE9via autoriza\xE7\xE3o por escrito da outra parte."
1469
+ },
1470
+ {
1471
+ titulo: "Da Propriedade Intelectual",
1472
+ conteudo: "Todos os materiais criados pela CONTRATADA no \xE2mbito deste contrato ser\xE3o de propriedade da CONTRATANTE ap\xF3s o pagamento integral dos valores devidos, sendo permitido \xE0 CONTRATADA utilizar tais materiais em seu portf\xF3lio."
1473
+ },
1474
+ {
1475
+ titulo: "Do Foro",
1476
+ conteudo: "As partes elegem o foro da Comarca de S\xE3o Paulo, Estado de S\xE3o Paulo, para dirimir quaisquer d\xFAvidas ou quest\xF5es oriundas do presente contrato, com ren\xFAncia expressa a qualquer outro, por mais privilegiado que seja."
1477
+ }
1478
+ ],
1479
+ observacoes: "Este contrato substitui e cancela todos os acordos anteriores, sejam verbais ou escritos, entre as partes. Qualquer altera\xE7\xE3o dever\xE1 ser feita por escrito e assinada por ambas as partes."
1480
+ };
1481
+
1482
+ // components/ui/use-print-contract.ts
1483
+ function usePrintContract(contentRef, contractNumber, options = {}) {
1484
+ const {
1485
+ onPrintStart,
1486
+ onPrintSuccess,
1487
+ onPrintError,
1488
+ onDownloadStart,
1489
+ onDownloadSuccess,
1490
+ onDownloadError
1491
+ } = options;
1492
+ const printContract = () => {
1493
+ try {
1494
+ const content = contentRef.current;
1495
+ if (!content) {
1496
+ throw new Error("Ref do conte\xFAdo n\xE3o est\xE1 dispon\xEDvel");
1497
+ }
1498
+ onPrintStart?.();
1499
+ const printWindow = window.open("", "_blank");
1500
+ if (!printWindow) {
1501
+ throw new Error("N\xE3o foi poss\xEDvel abrir janela de impress\xE3o");
1502
+ }
1503
+ const title = contractNumber ? `Contrato-${contractNumber}` : "Contrato";
1504
+ printWindow.document.write(`
1505
+ <!DOCTYPE html>
1506
+ <html>
1507
+ <head>
1508
+ <title>${title}</title>
1509
+ <meta charset="utf-8">
1510
+ <style>
1511
+ @page {
1512
+ size: A4;
1513
+ margin: 10mm;
1514
+ }
1515
+
1516
+ body {
1517
+ margin: 0;
1518
+ padding: 0;
1519
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
1520
+ font-size: 12pt;
1521
+ line-height: 1.6;
1522
+ color: #000;
1523
+ }
1524
+
1525
+ .container {
1526
+ padding: 10mm;
1527
+ }
1528
+
1529
+ /* Evitar quebras de p\xE1gina inadequadas */
1530
+ .avoid-break {
1531
+ page-break-inside: avoid !important;
1532
+ }
1533
+
1534
+ /* For\xE7ar quebra de p\xE1gina */
1535
+ .page-break {
1536
+ page-break-before: always !important;
1537
+ }
1538
+
1539
+ /* Ocultar elementos com classe no-print */
1540
+ .no-print {
1541
+ display: none !important;
1542
+ }
1543
+
1544
+ /* Garantir que cores sejam preservadas */
1545
+ * {
1546
+ -webkit-print-color-adjust: exact !important;
1547
+ print-color-adjust: exact !important;
1548
+ }
1549
+ </style>
1550
+ </head>
1551
+ <body>
1552
+ <div class="container">
1553
+ ${content.innerHTML}
1554
+ </div>
1555
+ </body>
1556
+ </html>
1557
+ `);
1558
+ printWindow.document.close();
1559
+ printWindow.onload = () => {
1560
+ setTimeout(() => {
1561
+ printWindow.print();
1562
+ printWindow.close();
1563
+ onPrintSuccess?.();
1564
+ }, 250);
1565
+ };
1566
+ } catch (error) {
1567
+ onPrintError?.(error);
1568
+ console.error("Erro ao imprimir contrato:", error);
1569
+ }
1570
+ };
1571
+ const downloadPDF = () => {
1572
+ try {
1573
+ onDownloadStart?.();
1574
+ setTimeout(() => {
1575
+ console.log("PDF gerado (simulado):", {
1576
+ contractNumber,
1577
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1578
+ });
1579
+ onDownloadSuccess?.();
1580
+ }, 1500);
1581
+ console.info(
1582
+ "usePrintContract: downloadPDF \xE9 uma implementa\xE7\xE3o simulada. Para gerar PDFs reais, integre com html2pdf.js ou jsPDF. Veja a documenta\xE7\xE3o do hook para exemplos."
1583
+ );
1584
+ } catch (error) {
1585
+ onDownloadError?.(error);
1586
+ console.error("Erro ao gerar PDF:", error);
1587
+ }
1588
+ };
1589
+ return {
1590
+ /** Imprime o contrato em nova janela */
1591
+ printContract,
1592
+ /** Gera e baixa PDF do contrato (implementação simulada) */
1593
+ downloadPDF
1594
+ };
1595
+ }
1596
+ function ContractPrint({
1597
+ data,
1598
+ logo,
1599
+ showActions = true,
1600
+ showSummary = true,
1601
+ showServices = true,
1602
+ showInfo = false,
1603
+ className,
1604
+ onPrintStart,
1605
+ onPrintSuccess,
1606
+ onPrintError,
1607
+ onDownloadStart,
1608
+ onDownloadSuccess,
1609
+ onDownloadError
1610
+ }) {
1611
+ const printRef = React7__namespace.useRef(null);
1612
+ const { printContract, downloadPDF } = usePrintContract(
1613
+ printRef,
1614
+ data.numeroContrato,
1615
+ {
1616
+ onPrintStart,
1617
+ onPrintSuccess,
1618
+ onPrintError,
1619
+ onDownloadStart,
1620
+ onDownloadSuccess,
1621
+ onDownloadError
1622
+ }
1623
+ );
1624
+ const formatCurrency = (value) => {
1625
+ return new Intl.NumberFormat("pt-BR", {
1626
+ style: "currency",
1627
+ currency: "BRL"
1628
+ }).format(value);
1629
+ };
1630
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-6", className), children: [
1631
+ showActions && /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "no-print", children: [
1632
+ /* @__PURE__ */ jsxRuntime.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(CardTitle, { className: "flex items-center justify-between", children: [
1633
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "A\xE7\xF5es do Documento" }),
1634
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
1635
+ /* @__PURE__ */ jsxRuntime.jsxs(
1636
+ Button,
1637
+ {
1638
+ variant: "outline",
1639
+ size: "sm",
1640
+ onClick: downloadPDF,
1641
+ className: "gap-2",
1642
+ children: [
1643
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4" }),
1644
+ "Download PDF"
1645
+ ]
1646
+ }
1647
+ ),
1648
+ /* @__PURE__ */ jsxRuntime.jsxs(
1649
+ Button,
1650
+ {
1651
+ variant: "default",
1652
+ size: "sm",
1653
+ onClick: printContract,
1654
+ className: "gap-2",
1655
+ children: [
1656
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Printer, { className: "h-4 w-4" }),
1657
+ "Imprimir"
1658
+ ]
1659
+ }
1660
+ )
1661
+ ] })
1662
+ ] }) }),
1663
+ showSummary && /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-4 text-sm", children: [
1664
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1665
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mb-1", children: "N\xBA do Contrato" }),
1666
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold", children: data.numeroContrato })
1667
+ ] }),
1668
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1669
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mb-1", children: "Cliente" }),
1670
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold", children: data.cliente.nome })
1671
+ ] }),
1672
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1673
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mb-1", children: "Valor do Fee" }),
1674
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold", children: formatCurrency(data.valorFee) })
1675
+ ] })
1676
+ ] }) })
1677
+ ] }),
1678
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white rounded-lg shadow-sm p-8", children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: printRef, children: /* @__PURE__ */ jsxRuntime.jsx(
1679
+ ContractTemplate,
1680
+ {
1681
+ data,
1682
+ showPreview: true,
1683
+ logo,
1684
+ showServices
1685
+ }
1686
+ ) }) }),
1687
+ showInfo && /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "no-print", children: [
1688
+ /* @__PURE__ */ jsxRuntime.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(CardTitle, { className: "flex items-center gap-2", children: [
1689
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "h-5 w-5" }),
1690
+ "Sobre este Template"
1691
+ ] }) }),
1692
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 text-sm text-muted-foreground", children: [
1693
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
1694
+ "\u2705 ",
1695
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Design System:" }),
1696
+ " Utiliza a paleta de cores e tipografia do iClips"
1697
+ ] }),
1698
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
1699
+ "\u2705 ",
1700
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Impress\xE3o Otimizada:" }),
1701
+ " Layout preparado para impress\xE3o em A4"
1702
+ ] }),
1703
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
1704
+ "\u2705 ",
1705
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Componentes Reutiliz\xE1veis:" }),
1706
+ " PrintHeader, PrintFooter, PrintTable, PrintSignature"
1707
+ ] }),
1708
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
1709
+ "\u2705 ",
1710
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Quebras de P\xE1gina:" }),
1711
+ " Configuradas automaticamente para evitar cortes"
1712
+ ] }),
1713
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
1714
+ "\u2705 ",
1715
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Profissional:" }),
1716
+ " Layout clean e adequado para documentos legais"
1717
+ ] })
1718
+ ] }) })
1719
+ ] })
1720
+ ] });
1721
+ }
1722
+ var ContractPrintPreview = React7__namespace.forwardRef(({ data, logo, showServices = true, className }, ref) => {
1723
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("bg-white rounded-lg shadow-sm p-8", className), ref, children: /* @__PURE__ */ jsxRuntime.jsx(
1724
+ ContractTemplate,
1725
+ {
1726
+ data,
1727
+ showPreview: true,
1728
+ logo,
1729
+ showServices
1730
+ }
1731
+ ) });
1732
+ });
1733
+ ContractPrintPreview.displayName = "ContractPrintPreview";
1734
+ function Calendar2({
1735
+ className,
1736
+ classNames,
1737
+ showOutsideDays = true,
1738
+ ...props
1739
+ }) {
1740
+ return /* @__PURE__ */ jsxRuntime.jsx(
1741
+ reactDayPicker.DayPicker,
1742
+ {
1743
+ showOutsideDays,
1744
+ className: cn("p-3", className),
1745
+ classNames: {
1746
+ months: "flex flex-col sm:flex-row gap-2",
1747
+ month: "flex flex-col gap-4",
1748
+ caption: "flex justify-center pt-1 relative items-center w-full",
1749
+ caption_label: "text-sm font-medium",
1750
+ nav: "flex items-center gap-1",
1751
+ nav_button: cn(
1752
+ buttonVariants({ variant: "outline" }),
1753
+ "size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
1754
+ ),
1755
+ nav_button_previous: "absolute left-1",
1756
+ nav_button_next: "absolute right-1",
1757
+ table: "w-full border-collapse space-x-1",
1758
+ head_row: "flex",
1759
+ head_cell: "text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",
1760
+ row: "flex w-full mt-2",
1761
+ cell: cn(
1762
+ "relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",
1763
+ props.mode === "range" ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" : "[&:has([aria-selected])]:rounded-md"
1764
+ ),
1765
+ day: cn(
1766
+ buttonVariants({ variant: "ghost" }),
1767
+ "size-8 p-0 font-normal aria-selected:opacity-100"
1768
+ ),
1769
+ day_range_start: "day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",
1770
+ day_range_end: "day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",
1771
+ day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
1772
+ day_today: "bg-accent text-accent-foreground",
1773
+ day_outside: "day-outside text-muted-foreground aria-selected:text-muted-foreground",
1774
+ day_disabled: "text-muted-foreground opacity-50",
1775
+ day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
1776
+ day_hidden: "invisible",
1777
+ ...classNames
1778
+ },
1779
+ components: {
1780
+ Chevron: ({ orientation, ...props2 }) => {
1781
+ const Icon2 = orientation === "left" ? lucideReact.ChevronLeft : lucideReact.ChevronRight;
1782
+ return /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-4", ...props2 });
1783
+ }
1784
+ },
1785
+ ...props
1786
+ }
1787
+ );
1788
+ }
1789
+ var CarouselContext = React7__namespace.createContext(null);
991
1790
  function useCarousel() {
992
- const context = React5__namespace.useContext(CarouselContext);
1791
+ const context = React7__namespace.useContext(CarouselContext);
993
1792
  if (!context) {
994
1793
  throw new Error("useCarousel must be used within a <Carousel />");
995
1794
  }
@@ -1011,20 +1810,20 @@ function Carousel({
1011
1810
  },
1012
1811
  plugins
1013
1812
  );
1014
- const [canScrollPrev, setCanScrollPrev] = React5__namespace.useState(false);
1015
- const [canScrollNext, setCanScrollNext] = React5__namespace.useState(false);
1016
- const onSelect = React5__namespace.useCallback((api2) => {
1813
+ const [canScrollPrev, setCanScrollPrev] = React7__namespace.useState(false);
1814
+ const [canScrollNext, setCanScrollNext] = React7__namespace.useState(false);
1815
+ const onSelect = React7__namespace.useCallback((api2) => {
1017
1816
  if (!api2) return;
1018
1817
  setCanScrollPrev(api2.canScrollPrev());
1019
1818
  setCanScrollNext(api2.canScrollNext());
1020
1819
  }, []);
1021
- const scrollPrev = React5__namespace.useCallback(() => {
1820
+ const scrollPrev = React7__namespace.useCallback(() => {
1022
1821
  api?.scrollPrev();
1023
1822
  }, [api]);
1024
- const scrollNext = React5__namespace.useCallback(() => {
1823
+ const scrollNext = React7__namespace.useCallback(() => {
1025
1824
  api?.scrollNext();
1026
1825
  }, [api]);
1027
- const handleKeyDown = React5__namespace.useCallback(
1826
+ const handleKeyDown = React7__namespace.useCallback(
1028
1827
  (event) => {
1029
1828
  if (event.key === "ArrowLeft") {
1030
1829
  event.preventDefault();
@@ -1036,11 +1835,11 @@ function Carousel({
1036
1835
  },
1037
1836
  [scrollPrev, scrollNext]
1038
1837
  );
1039
- React5__namespace.useEffect(() => {
1838
+ React7__namespace.useEffect(() => {
1040
1839
  if (!api || !setApi) return;
1041
1840
  setApi(api);
1042
1841
  }, [api, setApi]);
1043
- React5__namespace.useEffect(() => {
1842
+ React7__namespace.useEffect(() => {
1044
1843
  if (!api) return;
1045
1844
  onSelect(api);
1046
1845
  api.on("reInit", onSelect);
@@ -1173,9 +1972,9 @@ function CarouselNext({
1173
1972
  );
1174
1973
  }
1175
1974
  var THEMES = { light: "", dark: ".dark" };
1176
- var ChartContext = React5__namespace.createContext(null);
1975
+ var ChartContext = React7__namespace.createContext(null);
1177
1976
  function useChart() {
1178
- const context = React5__namespace.useContext(ChartContext);
1977
+ const context = React7__namespace.useContext(ChartContext);
1179
1978
  if (!context) {
1180
1979
  throw new Error("useChart must be used within a <ChartContainer />");
1181
1980
  }
@@ -1188,7 +1987,7 @@ function ChartContainer({
1188
1987
  config,
1189
1988
  ...props
1190
1989
  }) {
1191
- const uniqueId = React5__namespace.useId();
1990
+ const uniqueId = React7__namespace.useId();
1192
1991
  const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
1193
1992
  return /* @__PURE__ */ jsxRuntime.jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxRuntime.jsxs(
1194
1993
  "div",
@@ -1249,7 +2048,7 @@ function ChartTooltipContent({
1249
2048
  labelKey
1250
2049
  }) {
1251
2050
  const { config } = useChart();
1252
- const tooltipLabel = React5__namespace.useMemo(() => {
2051
+ const tooltipLabel = React7__namespace.useMemo(() => {
1253
2052
  if (hideLabel || !payload?.length) {
1254
2053
  return null;
1255
2054
  }
@@ -1431,11 +2230,11 @@ function Popover({
1431
2230
  }) {
1432
2231
  return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Root, { "data-slot": "popover", ...props });
1433
2232
  }
1434
- var PopoverTrigger = React5__namespace.forwardRef((props, ref) => {
2233
+ var PopoverTrigger = React7__namespace.forwardRef((props, ref) => {
1435
2234
  return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Trigger, { ref, "data-slot": "popover-trigger", ...props });
1436
2235
  });
1437
2236
  PopoverTrigger.displayName = PopoverPrimitive__namespace.Trigger.displayName;
1438
- var PopoverContent = React5__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => {
2237
+ var PopoverContent = React7__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => {
1439
2238
  return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
1440
2239
  PopoverPrimitive__namespace.Content,
1441
2240
  {
@@ -1452,7 +2251,7 @@ var PopoverContent = React5__namespace.forwardRef(({ className, align = "center"
1452
2251
  ) });
1453
2252
  });
1454
2253
  PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
1455
- var PopoverAnchor = React5__namespace.forwardRef((props, ref) => {
2254
+ var PopoverAnchor = React7__namespace.forwardRef((props, ref) => {
1456
2255
  return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Anchor, { ref, "data-slot": "popover-anchor", ...props });
1457
2256
  });
1458
2257
  PopoverAnchor.displayName = PopoverPrimitive__namespace.Anchor.displayName;
@@ -1495,9 +2294,9 @@ function ColorPicker({
1495
2294
  className,
1496
2295
  disabled = false
1497
2296
  }) {
1498
- const [color, setColor] = React5.useState(value);
1499
- const [open, setOpen] = React5.useState(false);
1500
- React5__namespace.useEffect(() => {
2297
+ const [color, setColor] = React7.useState(value);
2298
+ const [open, setOpen] = React7.useState(false);
2299
+ React7__namespace.useEffect(() => {
1501
2300
  setColor(value);
1502
2301
  }, [value]);
1503
2302
  const handleColorChange = (newColor) => {
@@ -1667,13 +2466,13 @@ function TimePicker({
1667
2466
  className,
1668
2467
  disabled = false
1669
2468
  }) {
1670
- const [hours, setHours] = React5__namespace.useState(
2469
+ const [hours, setHours] = React7__namespace.useState(
1671
2470
  date ? String(date.getHours()).padStart(2, "0") : "00"
1672
2471
  );
1673
- const [minutes, setMinutes] = React5__namespace.useState(
2472
+ const [minutes, setMinutes] = React7__namespace.useState(
1674
2473
  date ? String(date.getMinutes()).padStart(2, "0") : "00"
1675
2474
  );
1676
- React5__namespace.useEffect(() => {
2475
+ React7__namespace.useEffect(() => {
1677
2476
  if (date) {
1678
2477
  setHours(String(date.getHours()).padStart(2, "0"));
1679
2478
  setMinutes(String(date.getMinutes()).padStart(2, "0"));
@@ -1768,9 +2567,9 @@ function DateTimePicker({
1768
2567
  className,
1769
2568
  disabled = false
1770
2569
  }) {
1771
- const [open, setOpen] = React5__namespace.useState(false);
1772
- const [selectedDate, setSelectedDate] = React5__namespace.useState(date);
1773
- React5__namespace.useEffect(() => {
2570
+ const [open, setOpen] = React7__namespace.useState(false);
2571
+ const [selectedDate, setSelectedDate] = React7__namespace.useState(date);
2572
+ React7__namespace.useEffect(() => {
1774
2573
  setSelectedDate(date);
1775
2574
  }, [date]);
1776
2575
  const handleDateSelect = (newDate) => {
@@ -1886,9 +2685,9 @@ function DateRangePicker({
1886
2685
  disabled = false,
1887
2686
  withTime = false
1888
2687
  }) {
1889
- const [open, setOpen] = React5__namespace.useState(false);
1890
- const [range, setRange] = React5__namespace.useState(dateRange);
1891
- React5__namespace.useEffect(() => {
2688
+ const [open, setOpen] = React7__namespace.useState(false);
2689
+ const [range, setRange] = React7__namespace.useState(dateRange);
2690
+ React7__namespace.useEffect(() => {
1892
2691
  setRange(dateRange);
1893
2692
  }, [dateRange]);
1894
2693
  const handleRangeSelect = (newRange) => {
@@ -2277,7 +3076,7 @@ var priorityConfig = {
2277
3076
  bgColor: "bg-red-50 dark:bg-red-950/20"
2278
3077
  }
2279
3078
  };
2280
- var KanbanCard = React5__namespace.forwardRef(
3079
+ var KanbanCard = React7__namespace.forwardRef(
2281
3080
  ({
2282
3081
  title,
2283
3082
  description,
@@ -2535,7 +3334,7 @@ function DialogClose({
2535
3334
  }) {
2536
3335
  return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { "data-slot": "dialog-close", ...props });
2537
3336
  }
2538
- var DialogOverlay = React5__namespace.forwardRef(({ className, ...props }, ref) => {
3337
+ var DialogOverlay = React7__namespace.forwardRef(({ className, ...props }, ref) => {
2539
3338
  return /* @__PURE__ */ jsxRuntime.jsx(
2540
3339
  DialogPrimitive__namespace.Overlay,
2541
3340
  {
@@ -2978,7 +3777,7 @@ function Drawer({
2978
3777
  }) {
2979
3778
  return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Root, { "data-slot": "drawer", ...props });
2980
3779
  }
2981
- var DrawerTrigger = React5__namespace.forwardRef(({ ...props }, ref) => {
3780
+ var DrawerTrigger = React7__namespace.forwardRef(({ ...props }, ref) => {
2982
3781
  return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Trigger, { ref, "data-slot": "drawer-trigger", ...props });
2983
3782
  });
2984
3783
  DrawerTrigger.displayName = "DrawerTrigger";
@@ -2987,11 +3786,11 @@ function DrawerPortal({
2987
3786
  }) {
2988
3787
  return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Portal, { "data-slot": "drawer-portal", ...props });
2989
3788
  }
2990
- var DrawerClose = React5__namespace.forwardRef(({ ...props }, ref) => {
3789
+ var DrawerClose = React7__namespace.forwardRef(({ ...props }, ref) => {
2991
3790
  return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Close, { ref, "data-slot": "drawer-close", ...props });
2992
3791
  });
2993
3792
  DrawerClose.displayName = "DrawerClose";
2994
- var DrawerOverlay = React5__namespace.forwardRef(({ className, ...props }, ref) => {
3793
+ var DrawerOverlay = React7__namespace.forwardRef(({ className, ...props }, ref) => {
2995
3794
  return /* @__PURE__ */ jsxRuntime.jsx(
2996
3795
  vaul.Drawer.Overlay,
2997
3796
  {
@@ -3006,7 +3805,7 @@ var DrawerOverlay = React5__namespace.forwardRef(({ className, ...props }, ref)
3006
3805
  );
3007
3806
  });
3008
3807
  DrawerOverlay.displayName = "DrawerOverlay";
3009
- var DrawerContent = React5__namespace.forwardRef(({ className, children, ...props }, ref) => {
3808
+ var DrawerContent = React7__namespace.forwardRef(({ className, children, ...props }, ref) => {
3010
3809
  return /* @__PURE__ */ jsxRuntime.jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
3011
3810
  /* @__PURE__ */ jsxRuntime.jsx(DrawerOverlay, {}),
3012
3811
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3052,7 +3851,7 @@ function DrawerFooter({ className, ...props }) {
3052
3851
  }
3053
3852
  );
3054
3853
  }
3055
- var DrawerTitle = React5__namespace.forwardRef(({ className, ...props }, ref) => {
3854
+ var DrawerTitle = React7__namespace.forwardRef(({ className, ...props }, ref) => {
3056
3855
  return /* @__PURE__ */ jsxRuntime.jsx(
3057
3856
  vaul.Drawer.Title,
3058
3857
  {
@@ -3064,7 +3863,7 @@ var DrawerTitle = React5__namespace.forwardRef(({ className, ...props }, ref) =>
3064
3863
  );
3065
3864
  });
3066
3865
  DrawerTitle.displayName = "DrawerTitle";
3067
- var DrawerDescription = React5__namespace.forwardRef(({ className, ...props }, ref) => {
3866
+ var DrawerDescription = React7__namespace.forwardRef(({ className, ...props }, ref) => {
3068
3867
  return /* @__PURE__ */ jsxRuntime.jsx(
3069
3868
  vaul.Drawer.Description,
3070
3869
  {
@@ -3077,7 +3876,7 @@ var DrawerDescription = React5__namespace.forwardRef(({ className, ...props }, r
3077
3876
  });
3078
3877
  DrawerDescription.displayName = "DrawerDescription";
3079
3878
  var Form = reactHookForm.FormProvider;
3080
- var FormFieldContext = React5__namespace.createContext(
3879
+ var FormFieldContext = React7__namespace.createContext(
3081
3880
  {}
3082
3881
  );
3083
3882
  var FormField = ({
@@ -3086,8 +3885,8 @@ var FormField = ({
3086
3885
  return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
3087
3886
  };
3088
3887
  var useFormField = () => {
3089
- const fieldContext = React5__namespace.useContext(FormFieldContext);
3090
- const itemContext = React5__namespace.useContext(FormItemContext);
3888
+ const fieldContext = React7__namespace.useContext(FormFieldContext);
3889
+ const itemContext = React7__namespace.useContext(FormItemContext);
3091
3890
  const { getFieldState } = reactHookForm.useFormContext();
3092
3891
  const formState = reactHookForm.useFormState({ name: fieldContext.name });
3093
3892
  const fieldState = getFieldState(fieldContext.name, formState);
@@ -3104,11 +3903,11 @@ var useFormField = () => {
3104
3903
  ...fieldState
3105
3904
  };
3106
3905
  };
3107
- var FormItemContext = React5__namespace.createContext(
3906
+ var FormItemContext = React7__namespace.createContext(
3108
3907
  {}
3109
3908
  );
3110
3909
  function FormItem({ className, ...props }) {
3111
- const id = React5__namespace.useId();
3910
+ const id = React7__namespace.useId();
3112
3911
  return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx(
3113
3912
  "div",
3114
3913
  {
@@ -3239,7 +4038,7 @@ function InputOTPSlot({
3239
4038
  className,
3240
4039
  ...props
3241
4040
  }) {
3242
- const inputOTPContext = React5__namespace.useContext(inputOtp.OTPInputContext);
4041
+ const inputOTPContext = React7__namespace.useContext(inputOtp.OTPInputContext);
3243
4042
  const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
3244
4043
  return /* @__PURE__ */ jsxRuntime.jsxs(
3245
4044
  "div",
@@ -3979,7 +4778,7 @@ function SheetPortal({
3979
4778
  }) {
3980
4779
  return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "sheet-portal", ...props });
3981
4780
  }
3982
- var SheetOverlay = React5__namespace.forwardRef(({ className, ...props }, ref) => {
4781
+ var SheetOverlay = React7__namespace.forwardRef(({ className, ...props }, ref) => {
3983
4782
  return /* @__PURE__ */ jsxRuntime.jsx(
3984
4783
  DialogPrimitive__namespace.Overlay,
3985
4784
  {
@@ -4074,10 +4873,10 @@ function SheetDescription({
4074
4873
  }
4075
4874
  var MOBILE_BREAKPOINT = 768;
4076
4875
  function useIsMobile() {
4077
- const [isMobile, setIsMobile] = React5__namespace.useState(
4876
+ const [isMobile, setIsMobile] = React7__namespace.useState(
4078
4877
  void 0
4079
4878
  );
4080
- React5__namespace.useEffect(() => {
4879
+ React7__namespace.useEffect(() => {
4081
4880
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
4082
4881
  const onChange = () => {
4083
4882
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -4150,9 +4949,9 @@ var SIDEBAR_WIDTH = "16rem";
4150
4949
  var SIDEBAR_WIDTH_MOBILE = "18rem";
4151
4950
  var SIDEBAR_WIDTH_ICON = "3rem";
4152
4951
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
4153
- var SidebarContext = React5__namespace.createContext(null);
4952
+ var SidebarContext = React7__namespace.createContext(null);
4154
4953
  function useSidebar() {
4155
- const context = React5__namespace.useContext(SidebarContext);
4954
+ const context = React7__namespace.useContext(SidebarContext);
4156
4955
  if (!context) {
4157
4956
  throw new Error("useSidebar must be used within a SidebarProvider.");
4158
4957
  }
@@ -4168,10 +4967,10 @@ function SidebarProvider({
4168
4967
  ...props
4169
4968
  }) {
4170
4969
  const isMobile = useIsMobile();
4171
- const [openMobile, setOpenMobile] = React5__namespace.useState(false);
4172
- const [_open, _setOpen] = React5__namespace.useState(defaultOpen);
4970
+ const [openMobile, setOpenMobile] = React7__namespace.useState(false);
4971
+ const [_open, _setOpen] = React7__namespace.useState(defaultOpen);
4173
4972
  const open = openProp ?? _open;
4174
- const setOpen = React5__namespace.useCallback(
4973
+ const setOpen = React7__namespace.useCallback(
4175
4974
  (value) => {
4176
4975
  const openState = typeof value === "function" ? value(open) : value;
4177
4976
  if (setOpenProp) {
@@ -4183,10 +4982,10 @@ function SidebarProvider({
4183
4982
  },
4184
4983
  [setOpenProp, open]
4185
4984
  );
4186
- const toggleSidebar = React5__namespace.useCallback(() => {
4985
+ const toggleSidebar = React7__namespace.useCallback(() => {
4187
4986
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
4188
4987
  }, [isMobile, setOpen, setOpenMobile]);
4189
- React5__namespace.useEffect(() => {
4988
+ React7__namespace.useEffect(() => {
4190
4989
  const handleKeyDown = (event) => {
4191
4990
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
4192
4991
  event.preventDefault();
@@ -4197,7 +4996,7 @@ function SidebarProvider({
4197
4996
  return () => window.removeEventListener("keydown", handleKeyDown);
4198
4997
  }, [toggleSidebar]);
4199
4998
  const state = open ? "expanded" : "collapsed";
4200
- const contextValue = React5__namespace.useMemo(
4999
+ const contextValue = React7__namespace.useMemo(
4201
5000
  () => ({
4202
5001
  state,
4203
5002
  open,
@@ -4641,7 +5440,7 @@ function SidebarMenuSkeleton({
4641
5440
  showIcon = false,
4642
5441
  ...props
4643
5442
  }) {
4644
- const width = React5__namespace.useMemo(() => {
5443
+ const width = React7__namespace.useMemo(() => {
4645
5444
  return `${Math.floor(Math.random() * 40) + 50}%`;
4646
5445
  }, []);
4647
5446
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4737,7 +5536,7 @@ function Slider({
4737
5536
  max = 100,
4738
5537
  ...props
4739
5538
  }) {
4740
- const _values = React5__namespace.useMemo(
5539
+ const _values = React7__namespace.useMemo(
4741
5540
  () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
4742
5541
  [value, defaultValue, min, max]
4743
5542
  );
@@ -4876,7 +5675,7 @@ function TableFooter({ className, ...props }) {
4876
5675
  }
4877
5676
  );
4878
5677
  }
4879
- var TableRow = React5__namespace.forwardRef(({ className, ...props }, ref) => {
5678
+ var TableRow = React7__namespace.forwardRef(({ className, ...props }, ref) => {
4880
5679
  return /* @__PURE__ */ jsxRuntime.jsx(
4881
5680
  "tr",
4882
5681
  {
@@ -4988,9 +5787,9 @@ function TabsContent({
4988
5787
  }
4989
5788
  );
4990
5789
  }
4991
- var UnderlineTabsContext = React5__namespace.createContext(void 0);
5790
+ var UnderlineTabsContext = React7__namespace.createContext(void 0);
4992
5791
  function useUnderlineTabs() {
4993
- const context = React5__namespace.useContext(UnderlineTabsContext);
5792
+ const context = React7__namespace.useContext(UnderlineTabsContext);
4994
5793
  if (!context) {
4995
5794
  throw new Error("UnderlineTabs components must be used within UnderlineTabs");
4996
5795
  }
@@ -5003,7 +5802,7 @@ function UnderlineTabs({
5003
5802
  children,
5004
5803
  className
5005
5804
  }) {
5006
- const [internalValue, setInternalValue] = React5__namespace.useState(defaultValue || "");
5805
+ const [internalValue, setInternalValue] = React7__namespace.useState(defaultValue || "");
5007
5806
  const value = controlledValue !== void 0 ? controlledValue : internalValue;
5008
5807
  const handleValueChange = (newValue) => {
5009
5808
  if (controlledValue === void 0) {
@@ -5111,7 +5910,7 @@ function Toggle({
5111
5910
  }
5112
5911
  );
5113
5912
  }
5114
- var ToggleGroupContext = React5__namespace.createContext({
5913
+ var ToggleGroupContext = React7__namespace.createContext({
5115
5914
  size: "default",
5116
5915
  variant: "default"
5117
5916
  });
@@ -5144,7 +5943,7 @@ function ToggleGroupItem({
5144
5943
  size,
5145
5944
  ...props
5146
5945
  }) {
5147
- const context = React5__namespace.useContext(ToggleGroupContext);
5946
+ const context = React7__namespace.useContext(ToggleGroupContext);
5148
5947
  return /* @__PURE__ */ jsxRuntime.jsx(
5149
5948
  ToggleGroupPrimitive__namespace.Item,
5150
5949
  {
@@ -5164,21 +5963,172 @@ function ToggleGroupItem({
5164
5963
  }
5165
5964
  );
5166
5965
  }
5167
- var ERROR_IMG_SRC = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODgiIGhlaWdodD0iODgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBvcGFjaXR5PSIuMyIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIzLjciPjxyZWN0IHg9IjE2IiB5PSIxNiIgd2lkdGg9IjU2IiBoZWlnaHQ9IjU2IiByeD0iNiIvPjxwYXRoIGQ9Im0xNiA1OCAxNi0xOCAzMiAzMiIvPjxjaXJjbGUgY3g9IjUzIiBjeT0iMzUiIHI9IjciLz48L3N2Zz4KCg==";
5168
- function ImageWithFallback(props) {
5169
- const [didError, setDidError] = React5.useState(false);
5170
- const handleError = () => {
5171
- setDidError(true);
5966
+ function ProposalTemplate({
5967
+ data,
5968
+ showPreview = false,
5969
+ logo
5970
+ }) {
5971
+ const formatCurrency = (value) => {
5972
+ return new Intl.NumberFormat("pt-BR", {
5973
+ style: "currency",
5974
+ currency: "BRL"
5975
+ }).format(value);
5172
5976
  };
5173
- const { src, alt, style, className, ...rest } = props;
5174
- return didError ? /* @__PURE__ */ jsxRuntime.jsx(
5977
+ const formatDate = (dateStr) => {
5978
+ return new Date(dateStr).toLocaleDateString("pt-BR", {
5979
+ year: "numeric",
5980
+ month: "long",
5981
+ day: "numeric"
5982
+ });
5983
+ };
5984
+ return /* @__PURE__ */ jsxRuntime.jsxs(
5175
5985
  "div",
5176
5986
  {
5177
- className: `inline-block bg-gray-100 text-center align-middle ${className ?? ""}`,
5178
- style,
5179
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: ERROR_IMG_SRC, alt: "Error loading image", ...rest, "data-original-url": src }) })
5987
+ className: cn(
5988
+ "proposal-template bg-white text-black",
5989
+ showPreview ? "shadow-lg rounded-lg p-8 max-w-5xl mx-auto my-8" : "p-0"
5990
+ ),
5991
+ style: {
5992
+ fontFamily: "system-ui, -apple-system, sans-serif",
5993
+ fontSize: "12pt",
5994
+ lineHeight: "1.6"
5995
+ },
5996
+ children: [
5997
+ /* @__PURE__ */ jsxRuntime.jsx(
5998
+ PrintHeader,
5999
+ {
6000
+ logo,
6001
+ companyName: data.agency.name,
6002
+ contactInfo: {
6003
+ email: data.agency.email,
6004
+ phone: data.agency.phone
6005
+ },
6006
+ documentType: "Proposta Comercial",
6007
+ documentNumber: data.proposalNumber,
6008
+ issueDate: formatDate(data.issueDate)
6009
+ }
6010
+ ),
6011
+ /* @__PURE__ */ jsxRuntime.jsx(PrintSection, { children: /* @__PURE__ */ jsxRuntime.jsx(
6012
+ PrintInfoGrid,
6013
+ {
6014
+ columns: 2,
6015
+ items: [
6016
+ {
6017
+ label: "N\xBA da Proposta",
6018
+ value: data.proposalNumber,
6019
+ highlight: true
6020
+ },
6021
+ {
6022
+ label: "Validade",
6023
+ value: formatDate(data.validUntil)
6024
+ },
6025
+ {
6026
+ label: "Cliente",
6027
+ value: data.client.name,
6028
+ highlight: true
6029
+ },
6030
+ ...data.client.contact ? [{ label: "Contato", value: data.client.contact }] : []
6031
+ ]
6032
+ }
6033
+ ) }),
6034
+ /* @__PURE__ */ jsxRuntime.jsxs(PrintSection, { title: "Projeto", children: [
6035
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-semibold text-primary mb-3", children: data.projectTitle }),
6036
+ data.projectDescription && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-700 leading-relaxed", children: data.projectDescription })
6037
+ ] }),
6038
+ data.objectives && data.objectives.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(PrintSection, { title: "Objetivos", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "list-disc list-inside space-y-2", children: data.objectives.map((objective, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "text-sm text-gray-700", children: objective }, index)) }) }),
6039
+ /* @__PURE__ */ jsxRuntime.jsxs(PrintSection, { title: "Escopo e Investimento", children: [
6040
+ /* @__PURE__ */ jsxRuntime.jsx(
6041
+ PrintTable,
6042
+ {
6043
+ columns: [
6044
+ { header: "Item", key: "name", width: "35%" },
6045
+ { header: "Descri\xE7\xE3o", key: "description", width: "30%" },
6046
+ {
6047
+ header: "Qtd.",
6048
+ key: "quantity",
6049
+ align: "center",
6050
+ width: "10%",
6051
+ render: (value) => value || "-"
6052
+ },
6053
+ {
6054
+ header: "Valor Unit.",
6055
+ key: "unitPrice",
6056
+ align: "right",
6057
+ width: "12.5%",
6058
+ render: (value) => value ? formatCurrency(value) : "-"
6059
+ },
6060
+ {
6061
+ header: "Valor Total",
6062
+ key: "totalPrice",
6063
+ align: "right",
6064
+ width: "12.5%",
6065
+ render: (value) => formatCurrency(value)
6066
+ }
6067
+ ],
6068
+ data: data.items,
6069
+ striped: true,
6070
+ density: "comfortable"
6071
+ }
6072
+ ),
6073
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-6 flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-80 space-y-2", children: [
6074
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
6075
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-600", children: "Subtotal:" }),
6076
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: formatCurrency(data.subtotal) })
6077
+ ] }),
6078
+ data.discount && data.discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm", children: [
6079
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-600", children: "Desconto:" }),
6080
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-semibold text-green-600", children: [
6081
+ "- ",
6082
+ formatCurrency(data.discount)
6083
+ ] })
6084
+ ] }),
6085
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t-2 border-primary pt-2 flex justify-between", children: [
6086
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-base", children: "Total:" }),
6087
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-lg text-primary", children: formatCurrency(data.total) })
6088
+ ] })
6089
+ ] }) })
6090
+ ] }),
6091
+ (data.paymentConditions || data.deliveryTime) && /* @__PURE__ */ jsxRuntime.jsx(PrintSection, { title: "Condi\xE7\xF5es Comerciais", children: /* @__PURE__ */ jsxRuntime.jsx(
6092
+ PrintInfoGrid,
6093
+ {
6094
+ columns: 1,
6095
+ items: [
6096
+ ...data.paymentConditions ? [
6097
+ {
6098
+ label: "Forma de Pagamento",
6099
+ value: data.paymentConditions
6100
+ }
6101
+ ] : [],
6102
+ ...data.deliveryTime ? [{ label: "Prazo de Entrega", value: data.deliveryTime }] : []
6103
+ ]
6104
+ }
6105
+ ) }),
6106
+ data.notes && /* @__PURE__ */ jsxRuntime.jsx(PrintSection, { title: "Observa\xE7\xF5es", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-700 leading-relaxed", children: data.notes }) }),
6107
+ /* @__PURE__ */ jsxRuntime.jsx(
6108
+ PrintSignature,
6109
+ {
6110
+ signatures: [
6111
+ {
6112
+ label: "APROVA\xC7\xC3O DO CLIENTE",
6113
+ name: data.client.name,
6114
+ role: data.client.contact
6115
+ }
6116
+ ],
6117
+ layout: "vertical",
6118
+ instructionText: "Para aprovar esta proposta, assine abaixo e retorne para o e-mail indicado no cabe\xE7alho."
6119
+ }
6120
+ ),
6121
+ /* @__PURE__ */ jsxRuntime.jsx(
6122
+ PrintFooter,
6123
+ {
6124
+ pageNumber: 1,
6125
+ totalPages: 1,
6126
+ footerText: `Proposta v\xE1lida at\xE9 ${formatDate(data.validUntil)}`
6127
+ }
6128
+ )
6129
+ ]
5180
6130
  }
5181
- ) : /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt, className, style, ...rest, onError: handleError });
6131
+ );
5182
6132
  }
5183
6133
 
5184
6134
  exports.Accordion = Accordion;
@@ -5257,6 +6207,9 @@ exports.ContextMenuSub = ContextMenuSub;
5257
6207
  exports.ContextMenuSubContent = ContextMenuSubContent;
5258
6208
  exports.ContextMenuSubTrigger = ContextMenuSubTrigger;
5259
6209
  exports.ContextMenuTrigger = ContextMenuTrigger;
6210
+ exports.ContractPrint = ContractPrint;
6211
+ exports.ContractPrintPreview = ContractPrintPreview;
6212
+ exports.ContractTemplate = ContractTemplate;
5260
6213
  exports.DateRangePicker = DateRangePicker;
5261
6214
  exports.DateTimePicker = DateTimePicker;
5262
6215
  exports.Dialog = Dialog;
@@ -5340,7 +6293,14 @@ exports.PaginationPrevious = PaginationPrevious;
5340
6293
  exports.Popover = Popover;
5341
6294
  exports.PopoverContent = PopoverContent;
5342
6295
  exports.PopoverTrigger = PopoverTrigger;
6296
+ exports.PrintFooter = PrintFooter;
6297
+ exports.PrintHeader = PrintHeader;
6298
+ exports.PrintInfoGrid = PrintInfoGrid;
6299
+ exports.PrintSection = PrintSection;
6300
+ exports.PrintSignature = PrintSignature;
6301
+ exports.PrintTable = PrintTable;
5343
6302
  exports.Progress = Progress;
6303
+ exports.ProposalTemplate = ProposalTemplate;
5344
6304
  exports.RadioGroup = RadioGroup4;
5345
6305
  exports.RadioGroupItem = RadioGroupItem;
5346
6306
  exports.ResizableHandle = ResizableHandle;
@@ -5419,10 +6379,12 @@ exports.UnderlineTabsTrigger = UnderlineTabsTrigger;
5419
6379
  exports.badgeVariants = badgeVariants;
5420
6380
  exports.buttonVariants = buttonVariants;
5421
6381
  exports.cn = cn;
6382
+ exports.dadosContratoExemplo = dadosContratoExemplo;
5422
6383
  exports.navigationMenuTriggerStyle = navigationMenuTriggerStyle;
5423
6384
  exports.toggleVariants = toggleVariants;
5424
6385
  exports.useFormField = useFormField;
5425
6386
  exports.useIsMobile = useIsMobile;
6387
+ exports.usePrintContract = usePrintContract;
5426
6388
  exports.useSidebar = useSidebar;
5427
6389
  //# sourceMappingURL=index.cjs.map
5428
6390
  //# sourceMappingURL=index.cjs.map