@khipu/design-system 0.2.0-alpha.9 → 0.2.0-alpha.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -34,6 +34,19 @@ function lighten(hex, amount) {
34
34
  b + (255 - b) * amount
35
35
  );
36
36
  }
37
+ function formatDateTime(iso) {
38
+ if (!iso) {
39
+ return "";
40
+ }
41
+ const date = new Date(iso);
42
+ if (Number.isNaN(date.getTime())) {
43
+ return "";
44
+ }
45
+ const pad = (n) => n.toString().padStart(2, "0");
46
+ const datePart = `${pad(date.getDate())}-${pad(date.getMonth() + 1)}-${date.getFullYear()}`;
47
+ const timePart = `${pad(date.getHours())}:${pad(date.getMinutes())}`;
48
+ return `${datePart} ${timePart}`;
49
+ }
37
50
 
38
51
  // src/theme/KdsThemeProvider.tsx
39
52
  import { jsx } from "react/jsx-runtime";
@@ -347,6 +360,8 @@ var semanticColors = {
347
360
  // From Figma: warning/light
348
361
  dark: "#E65100",
349
362
  // From Figma: warning/dark
363
+ warm: "#8A6D1A",
364
+ // Warm/olive variant for header icons (LigoPay handoff v2)
350
365
  container: "#FFFBEB",
351
366
  // Light amber background for chips/badges
352
367
  contrastText: "#FFFFFF"
@@ -365,6 +380,8 @@ var semanticColors = {
365
380
  main: "#0288D1",
366
381
  light: "#03A9F4",
367
382
  dark: "#01579B",
383
+ blue: "#5A5FE0",
384
+ // Khipu-blue / LigoPay informational blue (distinct from cyan main)
368
385
  container: "#EFF6FF",
369
386
  // Light blue background for chips/badges
370
387
  contrastText: "#FFFFFF"
@@ -391,6 +408,8 @@ var fontWeights = {
391
408
  bold: 700
392
409
  };
393
410
  var fontSizes = {
411
+ "2xs": "0.625rem",
412
+ // 10px — tiny captions (version footer, fine print)
394
413
  xs: "0.75rem",
395
414
  // 12px
396
415
  sm: "0.875rem",
@@ -407,8 +426,10 @@ var fontSizes = {
407
426
  // 24px
408
427
  "3xl": "1.875rem",
409
428
  // 30px
410
- "4xl": "2.25rem"
429
+ "4xl": "2.25rem",
411
430
  // 36px
431
+ decimalSup: "0.5em"
432
+ // Relative size for decimal superscript in amount displays
412
433
  };
413
434
  var lineHeights = {
414
435
  tight: 1.2,
@@ -811,6 +832,8 @@ var responsiveTypography = {
811
832
  }
812
833
  };
813
834
  var responsiveBaseFontSizes = {
835
+ "2xs": { mobile: "0.5625rem", tablet: "0.625rem", desktop: "0.625rem" },
836
+ // 9px → 10px
814
837
  xs: { mobile: "0.6875rem", tablet: "0.75rem", desktop: "0.75rem" },
815
838
  // 11px → 12px
816
839
  sm: { mobile: "0.8125rem", tablet: "0.875rem", desktop: "0.875rem" },
@@ -1040,7 +1063,7 @@ var KdsButton = forwardRef(
1040
1063
  children: [
1041
1064
  !loading && startIcon && /* @__PURE__ */ jsx2("span", { className: "kds-icon", children: /* @__PURE__ */ jsx2("i", { className: "material-symbols-outlined", children: startIcon }) }),
1042
1065
  loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
1043
- /* @__PURE__ */ jsx2("span", { className: "loader small" }),
1066
+ /* @__PURE__ */ jsx2("progress", { className: "circle indeterminate small" }),
1044
1067
  /* @__PURE__ */ jsx2("span", { children })
1045
1068
  ] }) : /* @__PURE__ */ jsx2("span", { children }),
1046
1069
  !loading && endIcon && /* @__PURE__ */ jsx2("span", { className: "kds-icon", children: /* @__PURE__ */ jsx2("i", { className: "material-symbols-outlined", children: endIcon }) })
@@ -1051,7 +1074,7 @@ var KdsButton = forwardRef(
1051
1074
  KdsButton.displayName = "KdsButton";
1052
1075
 
1053
1076
  // src/components/core/KdsTextField/KdsTextField.tsx
1054
- import { forwardRef as forwardRef2 } from "react";
1077
+ import { forwardRef as forwardRef2, useState } from "react";
1055
1078
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
1056
1079
  var KdsTextField = forwardRef2(
1057
1080
  ({
@@ -1059,14 +1082,31 @@ var KdsTextField = forwardRef2(
1059
1082
  helperText,
1060
1083
  error,
1061
1084
  fullWidth = true,
1085
+ narrow = false,
1062
1086
  readOnly,
1063
1087
  startIcon,
1064
1088
  endIcon,
1089
+ required,
1065
1090
  className,
1066
1091
  id,
1092
+ type,
1093
+ revealable,
1094
+ revealLabel = "Mostrar u ocultar contrase\xF1a",
1095
+ requiredMark = true,
1067
1096
  ...props
1068
1097
  }, ref) => {
1098
+ const [revealed, setRevealed] = useState(false);
1069
1099
  const fieldId = id || `kds-field-${label.toLowerCase().replace(/\s+/g, "-")}`;
1100
+ const isRevealable = !!revealable && !readOnly && !props.disabled;
1101
+ const inputType = isRevealable ? revealed ? "text" : "password" : type;
1102
+ const hasSuffix = !!endIcon || readOnly || isRevealable;
1103
+ const toggleReveal = () => setRevealed((v) => !v);
1104
+ const onToggleKeyDown = (e) => {
1105
+ if (e.key === "Enter" || e.key === " ") {
1106
+ e.preventDefault();
1107
+ toggleReveal();
1108
+ }
1109
+ };
1070
1110
  return /* @__PURE__ */ jsxs2(
1071
1111
  "div",
1072
1112
  {
@@ -1074,9 +1114,12 @@ var KdsTextField = forwardRef2(
1074
1114
  "field",
1075
1115
  "label",
1076
1116
  "border",
1117
+ startIcon && "prefix",
1118
+ hasSuffix && "suffix",
1077
1119
  error && "invalid",
1078
1120
  readOnly && "locked",
1079
- fullWidth && "kds-w-full",
1121
+ fullWidth && !narrow && "kds-w-full",
1122
+ narrow && "kds-field--narrow",
1080
1123
  className
1081
1124
  ),
1082
1125
  children: [
@@ -1086,14 +1129,32 @@ var KdsTextField = forwardRef2(
1086
1129
  {
1087
1130
  ref,
1088
1131
  id: fieldId,
1089
- placeholder: " ",
1132
+ type: inputType,
1090
1133
  readOnly,
1091
- ...props
1134
+ required,
1135
+ ...props,
1136
+ placeholder: " "
1092
1137
  }
1093
1138
  ),
1094
- /* @__PURE__ */ jsx3("label", { htmlFor: fieldId, children: label }),
1139
+ /* @__PURE__ */ jsxs2("label", { htmlFor: fieldId, children: [
1140
+ label,
1141
+ required && requiredMark && " *"
1142
+ ] }),
1095
1143
  readOnly && /* @__PURE__ */ jsx3("i", { className: "material-symbols-outlined", children: "lock" }),
1096
- endIcon && !readOnly && /* @__PURE__ */ jsx3("i", { className: "material-symbols-outlined", children: endIcon }),
1144
+ isRevealable && /* @__PURE__ */ jsx3(
1145
+ "a",
1146
+ {
1147
+ className: "kds-field-reveal",
1148
+ role: "button",
1149
+ tabIndex: 0,
1150
+ "aria-label": revealLabel,
1151
+ "aria-pressed": revealed,
1152
+ onClick: toggleReveal,
1153
+ onKeyDown: onToggleKeyDown,
1154
+ children: /* @__PURE__ */ jsx3("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: revealed ? "visibility" : "visibility_off" })
1155
+ }
1156
+ ),
1157
+ endIcon && !readOnly && !isRevealable && /* @__PURE__ */ jsx3("i", { className: "material-symbols-outlined", children: endIcon }),
1097
1158
  helperText && /* @__PURE__ */ jsx3("span", { className: "helper", children: helperText })
1098
1159
  ]
1099
1160
  }
@@ -1102,76 +1163,41 @@ var KdsTextField = forwardRef2(
1102
1163
  );
1103
1164
  KdsTextField.displayName = "KdsTextField";
1104
1165
 
1105
- // src/components/core/KdsCheckbox/KdsCheckbox.tsx
1166
+ // src/components/core/KdsSearchField/KdsSearchField.tsx
1106
1167
  import { forwardRef as forwardRef3 } from "react";
1107
1168
  import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1108
- var KdsCheckbox = forwardRef3(
1109
- ({ label, className, id, ...props }, ref) => {
1110
- const fieldId = id || `kds-cb-${label?.toLowerCase().replace(/\s+/g, "-") || "check"}`;
1111
- return /* @__PURE__ */ jsxs3("label", { className: clsx("field", className), htmlFor: fieldId, children: [
1112
- /* @__PURE__ */ jsx4("input", { ref, type: "checkbox", id: fieldId, ...props }),
1113
- /* @__PURE__ */ jsx4("span", { children: label })
1169
+ var KdsSearchField = forwardRef3(
1170
+ ({ className, withIcon = false, ...props }, ref) => {
1171
+ const input = /* @__PURE__ */ jsx4(
1172
+ "input",
1173
+ {
1174
+ ref,
1175
+ type: "search",
1176
+ className: clsx("kds-search-field", className),
1177
+ ...props
1178
+ }
1179
+ );
1180
+ if (!withIcon) {
1181
+ return input;
1182
+ }
1183
+ return /* @__PURE__ */ jsxs3("div", { className: "kds-search-field-wrapper", children: [
1184
+ /* @__PURE__ */ jsx4("i", { className: "material-symbols-outlined kds-search-field-icon", "aria-hidden": "true", children: "search" }),
1185
+ input
1114
1186
  ] });
1115
1187
  }
1116
1188
  );
1117
- KdsCheckbox.displayName = "KdsCheckbox";
1189
+ KdsSearchField.displayName = "KdsSearchField";
1118
1190
 
1119
- // src/components/core/KdsModal/KdsModal.tsx
1191
+ // src/components/core/KdsCheckbox/KdsCheckbox.tsx
1120
1192
  import { forwardRef as forwardRef4 } from "react";
1121
- import * as Dialog from "@radix-ui/react-dialog";
1122
1193
  import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
1123
- var KdsModal = forwardRef4(
1124
- ({
1125
- open,
1126
- onClose,
1127
- title,
1128
- description,
1129
- footer,
1130
- children,
1131
- size = "md",
1132
- showCloseButton = true,
1133
- className
1134
- }, ref) => /* @__PURE__ */ jsx5(
1135
- Dialog.Root,
1136
- {
1137
- open,
1138
- onOpenChange: (o) => {
1139
- if (!o) onClose();
1140
- },
1141
- children: /* @__PURE__ */ jsxs4(Dialog.Portal, { children: [
1142
- /* @__PURE__ */ jsx5(Dialog.Overlay, { className: "kds-bottom-sheet-scrim" }),
1143
- /* @__PURE__ */ jsxs4(
1144
- Dialog.Content,
1145
- {
1146
- ref,
1147
- className: clsx(
1148
- "kds-bottom-sheet",
1149
- `kds-bottom-sheet-${size}`,
1150
- className
1151
- ),
1152
- children: [
1153
- title && /* @__PURE__ */ jsxs4("div", { className: "kds-bottom-sheet-header", children: [
1154
- /* @__PURE__ */ jsx5(Dialog.Title, { className: "kds-bottom-sheet-title", children: title }),
1155
- showCloseButton && /* @__PURE__ */ jsx5(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx5(
1156
- "button",
1157
- {
1158
- className: "kds-bottom-sheet-close",
1159
- "aria-label": "Cerrar",
1160
- children: /* @__PURE__ */ jsx5("i", { className: "material-symbols-outlined", children: "close" })
1161
- }
1162
- ) })
1163
- ] }),
1164
- description && /* @__PURE__ */ jsx5(Dialog.Description, { className: "kds-bottom-sheet-description", children: description }),
1165
- /* @__PURE__ */ jsx5("div", { className: "kds-bottom-sheet-body", children }),
1166
- footer && /* @__PURE__ */ jsx5("div", { className: "kds-bottom-sheet-actions", children: footer })
1167
- ]
1168
- }
1169
- )
1170
- ] })
1171
- }
1172
- )
1194
+ var KdsCheckbox = forwardRef4(
1195
+ ({ label, className, ...props }, ref) => /* @__PURE__ */ jsxs4("label", { className: clsx("checkbox", className), children: [
1196
+ /* @__PURE__ */ jsx5("input", { ref, type: "checkbox", ...props }),
1197
+ /* @__PURE__ */ jsx5("span", { children: label })
1198
+ ] })
1173
1199
  );
1174
- KdsModal.displayName = "KdsModal";
1200
+ KdsCheckbox.displayName = "KdsCheckbox";
1175
1201
 
1176
1202
  // src/components/core/KdsCard/KdsCard.tsx
1177
1203
  import { forwardRef as forwardRef5 } from "react";
@@ -1208,50 +1234,161 @@ KdsCardFooter.displayName = "KdsCardFooter";
1208
1234
  // src/components/core/KdsSpinner/KdsSpinner.tsx
1209
1235
  import { forwardRef as forwardRef6 } from "react";
1210
1236
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1237
+ var SIZE_CLASS = {
1238
+ small: "small",
1239
+ medium: null,
1240
+ large: "large"
1241
+ };
1211
1242
  var KdsSpinner = forwardRef6(
1212
- ({ size = "medium", label, className, ...props }, ref) => /* @__PURE__ */ jsxs5("div", { ref, className: clsx("kds-flex kds-flex-col kds-items-center kds-gap-2", className), role: "status", ...props, children: [
1213
- /* @__PURE__ */ jsx7("span", { className: clsx("loader", size) }),
1214
- label && /* @__PURE__ */ jsx7("span", { className: "kds-text-body-small kds-text-muted", children: label }),
1215
- !label && /* @__PURE__ */ jsx7("span", { className: "kds-hidden", children: "Cargando" })
1216
- ] })
1243
+ ({ size = "medium", label, className, ...props }, ref) => {
1244
+ const sizeClass = SIZE_CLASS[size];
1245
+ return /* @__PURE__ */ jsxs5(
1246
+ "div",
1247
+ {
1248
+ ref,
1249
+ className: clsx("kds-flex kds-flex-col kds-items-center kds-gap-2", className),
1250
+ role: "status",
1251
+ ...props,
1252
+ children: [
1253
+ /* @__PURE__ */ jsx7("progress", { className: clsx("circle indeterminate", sizeClass) }),
1254
+ label && /* @__PURE__ */ jsx7("span", { className: "kds-text-body-small kds-text-muted", children: label }),
1255
+ !label && /* @__PURE__ */ jsx7("span", { className: "kds-hidden", children: "Cargando" })
1256
+ ]
1257
+ }
1258
+ );
1259
+ }
1217
1260
  );
1218
1261
  KdsSpinner.displayName = "KdsSpinner";
1219
1262
 
1220
- // src/components/core/KdsLinearProgress/KdsLinearProgress.tsx
1263
+ // src/components/core/KdsSecureLoader/KdsSecureLoader.tsx
1221
1264
  import { forwardRef as forwardRef7 } from "react";
1222
- import { jsx as jsx8 } from "react/jsx-runtime";
1223
- var KdsLinearProgress = forwardRef7(
1224
- ({ value, max = 100, className, ...props }, ref) => /* @__PURE__ */ jsx8("progress", { ref, className: clsx("kds-progress", className), value, max, ...props })
1265
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1266
+ var KdsSecureLoader = forwardRef7(
1267
+ ({ title, message, className, ...props }, ref) => /* @__PURE__ */ jsxs6("div", { ref, className: clsx("kds-secure-loader", className), role: "status", "aria-busy": "true", ...props, children: [
1268
+ (title || message) && /* @__PURE__ */ jsxs6("div", { className: "kds-secure-loader-text", children: [
1269
+ title && /* @__PURE__ */ jsx8("p", { className: "kds-secure-loader-title", children: title }),
1270
+ message && /* @__PURE__ */ jsx8("p", { className: "kds-secure-loader-message", children: message })
1271
+ ] }),
1272
+ /* @__PURE__ */ jsxs6("div", { className: "kds-secure-loader-spinner", children: [
1273
+ /* @__PURE__ */ jsx8(
1274
+ "svg",
1275
+ {
1276
+ className: "kds-secure-loader-ring",
1277
+ viewBox: "22 22 44 44",
1278
+ width: "100",
1279
+ height: "100",
1280
+ fill: "none",
1281
+ "aria-hidden": "true",
1282
+ children: /* @__PURE__ */ jsx8("circle", { cx: "44", cy: "44", r: "20.2", fill: "none" })
1283
+ }
1284
+ ),
1285
+ /* @__PURE__ */ jsx8("i", { className: "material-symbols-outlined kds-secure-loader-lock", "aria-hidden": "true", children: "lock" })
1286
+ ] })
1287
+ ] })
1288
+ );
1289
+ KdsSecureLoader.displayName = "KdsSecureLoader";
1290
+
1291
+ // src/components/core/KdsCopyButton/KdsCopyButton.tsx
1292
+ import { forwardRef as forwardRef8 } from "react";
1293
+
1294
+ // src/components/core/hooks/useCopyToClipboard.ts
1295
+ import { useState as useState2, useCallback } from "react";
1296
+ function useCopyToClipboard(resetMs = 1200) {
1297
+ const [copied, setCopied] = useState2(false);
1298
+ const copy = useCallback(
1299
+ async (text) => {
1300
+ try {
1301
+ await navigator.clipboard.writeText(text);
1302
+ setCopied(true);
1303
+ setTimeout(() => setCopied(false), resetMs);
1304
+ } catch {
1305
+ }
1306
+ },
1307
+ [resetMs]
1308
+ );
1309
+ return { copied, copy };
1310
+ }
1311
+
1312
+ // src/components/core/KdsCopyButton/KdsCopyButton.tsx
1313
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
1314
+ var KdsCopyButton = forwardRef8(
1315
+ ({ value, copiedText = "Copiado", className, ...props }, ref) => {
1316
+ const { copied, copy } = useCopyToClipboard();
1317
+ return /* @__PURE__ */ jsxs7(
1318
+ "button",
1319
+ {
1320
+ ref,
1321
+ type: "button",
1322
+ className: clsx("kds-copy-button", copied && "copied", className),
1323
+ onClick: () => copy(value),
1324
+ "aria-label": `Copiar: ${value}`,
1325
+ ...props,
1326
+ children: [
1327
+ /* @__PURE__ */ jsxs7("span", { className: "kds-copy-button-label", children: [
1328
+ /* @__PURE__ */ jsx9("span", { className: "kds-copy-button-value", "aria-hidden": copied || void 0, children: value }),
1329
+ /* @__PURE__ */ jsx9("span", { className: "kds-copy-button-copied", "aria-hidden": !copied || void 0, children: copiedText })
1330
+ ] }),
1331
+ /* @__PURE__ */ jsx9("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: copied ? "check" : "content_copy" })
1332
+ ]
1333
+ }
1334
+ );
1335
+ }
1336
+ );
1337
+ KdsCopyButton.displayName = "KdsCopyButton";
1338
+
1339
+ // src/components/core/KdsLinearProgress/KdsLinearProgress.tsx
1340
+ import { forwardRef as forwardRef9 } from "react";
1341
+ import { jsx as jsx10 } from "react/jsx-runtime";
1342
+ var KdsLinearProgress = forwardRef9(
1343
+ ({ value, max = 100, className, ...props }, ref) => /* @__PURE__ */ jsx10("progress", { ref, className: clsx("kds-progress", className), value, max, ...props })
1225
1344
  );
1226
1345
  KdsLinearProgress.displayName = "KdsLinearProgress";
1227
1346
 
1228
1347
  // src/components/core/KdsAlert/KdsAlert.tsx
1229
- import { forwardRef as forwardRef8 } from "react";
1230
- import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
1231
- var KdsAlert = forwardRef8(
1232
- ({ severity, title, icon, inline, onClose, children, className, ...props }, ref) => /* @__PURE__ */ jsxs6(
1233
- "div",
1234
- {
1235
- ref,
1236
- role: "alert",
1237
- className: clsx("kds-alert", `kds-${severity}`, inline && "kds-alert-inline", className),
1238
- ...props,
1239
- children: [
1240
- icon && /* @__PURE__ */ jsx9("div", { className: "kds-alert-icon", children: /* @__PURE__ */ jsx9("i", { className: "material-symbols-outlined", children: icon }) }),
1241
- /* @__PURE__ */ jsxs6("div", { className: "kds-alert-content", children: [
1242
- title && /* @__PURE__ */ jsx9("p", { className: "kds-alert-title", children: title }),
1243
- /* @__PURE__ */ jsx9("p", { className: "kds-alert-description", children })
1244
- ] }),
1245
- onClose && /* @__PURE__ */ jsx9("button", { className: "kds-btn kds-btn-text kds-btn-sm", onClick: onClose, "aria-label": "Cerrar", children: /* @__PURE__ */ jsx9("i", { className: "material-symbols-outlined", children: "close" }) })
1246
- ]
1247
- }
1248
- )
1348
+ import { forwardRef as forwardRef10 } from "react";
1349
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
1350
+ var DEFAULT_ICONS = {
1351
+ success: "check_circle",
1352
+ info: "info",
1353
+ warning: "warning",
1354
+ error: "error"
1355
+ };
1356
+ var KdsAlert = forwardRef10(
1357
+ ({ severity, title, icon, inline, onClose, children, className, ...props }, ref) => {
1358
+ const resolvedIcon = icon === false ? null : typeof icon === "string" ? icon : DEFAULT_ICONS[severity];
1359
+ return /* @__PURE__ */ jsxs8(
1360
+ "div",
1361
+ {
1362
+ ref,
1363
+ role: "alert",
1364
+ className: clsx("kds-alert", `kds-${severity}`, inline && "kds-alert-inline", className),
1365
+ ...props,
1366
+ children: [
1367
+ resolvedIcon && /* @__PURE__ */ jsx11("div", { className: "kds-alert-icon", children: /* @__PURE__ */ jsx11("i", { className: "material-symbols-outlined", children: resolvedIcon }) }),
1368
+ /* @__PURE__ */ jsxs8("div", { className: "kds-alert-content", children: [
1369
+ title && /* @__PURE__ */ jsx11("p", { className: "kds-alert-title", children: title }),
1370
+ /* @__PURE__ */ jsx11("p", { className: "kds-alert-description", children })
1371
+ ] }),
1372
+ onClose && /* @__PURE__ */ jsx11(
1373
+ "button",
1374
+ {
1375
+ type: "button",
1376
+ className: "kds-alert-close",
1377
+ onClick: onClose,
1378
+ "aria-label": "Cerrar",
1379
+ children: /* @__PURE__ */ jsx11("i", { className: "material-symbols-outlined", children: "close" })
1380
+ }
1381
+ )
1382
+ ]
1383
+ }
1384
+ );
1385
+ }
1249
1386
  );
1250
1387
  KdsAlert.displayName = "KdsAlert";
1251
1388
 
1252
1389
  // src/components/core/KdsTypography/KdsTypography.tsx
1253
- import { forwardRef as forwardRef9 } from "react";
1254
- import { jsx as jsx10 } from "react/jsx-runtime";
1390
+ import { forwardRef as forwardRef11 } from "react";
1391
+ import { jsx as jsx12 } from "react/jsx-runtime";
1255
1392
  var variantTag = {
1256
1393
  display1: "h1",
1257
1394
  display2: "h2",
@@ -1263,13 +1400,17 @@ var variantTag = {
1263
1400
  "body-small": "p",
1264
1401
  label: "span",
1265
1402
  "label-small": "span",
1403
+ value: "span",
1404
+ code: "span",
1405
+ caption: "span",
1266
1406
  muted: "p",
1267
- link: "span"
1407
+ link: "span",
1408
+ strong: "span"
1268
1409
  };
1269
- var KdsTypography = forwardRef9(
1410
+ var KdsTypography = forwardRef11(
1270
1411
  ({ variant = "body", color, as, children, className, ...props }, ref) => {
1271
1412
  const Tag = as || variantTag[variant];
1272
- return /* @__PURE__ */ jsx10(
1413
+ return /* @__PURE__ */ jsx12(
1273
1414
  Tag,
1274
1415
  {
1275
1416
  ref,
@@ -1287,12 +1428,12 @@ var KdsTypography = forwardRef9(
1287
1428
  KdsTypography.displayName = "KdsTypography";
1288
1429
 
1289
1430
  // src/components/core/KdsTabs/KdsTabs.tsx
1290
- import React10, { forwardRef as forwardRef10, Children, useMemo } from "react";
1431
+ import React12, { forwardRef as forwardRef12, Children, useMemo } from "react";
1291
1432
 
1292
1433
  // src/components/core/hooks/useTabsKeyboard.ts
1293
- import { useCallback } from "react";
1434
+ import { useCallback as useCallback2 } from "react";
1294
1435
  function useTabsKeyboard(tabCount, activeIndex, onChange) {
1295
- const onKeyDown = useCallback(
1436
+ const onKeyDown = useCallback2(
1296
1437
  (e) => {
1297
1438
  let next = activeIndex;
1298
1439
  if (e.key === "ArrowRight") next = (activeIndex + 1) % tabCount;
@@ -1312,31 +1453,31 @@ function useTabsKeyboard(tabCount, activeIndex, onChange) {
1312
1453
  }
1313
1454
 
1314
1455
  // src/components/core/KdsTabs/KdsTabs.tsx
1315
- import { jsx as jsx11 } from "react/jsx-runtime";
1316
- var KdsTabs = forwardRef10(
1317
- ({ activeIndex, onChange, variant = "standard", children, className, style, ...props }, ref) => {
1456
+ import { jsx as jsx13 } from "react/jsx-runtime";
1457
+ var KdsTabs = forwardRef12(
1458
+ ({ activeIndex, onChange, children, className, style, ...props }, ref) => {
1318
1459
  const tabCount = Children.count(children);
1319
1460
  const { onKeyDown } = useTabsKeyboard(tabCount, activeIndex, onChange);
1320
- const mergedStyle = useMemo(() => {
1321
- if (variant !== "segmented") return style;
1322
- return {
1461
+ const mergedStyle = useMemo(
1462
+ () => ({
1323
1463
  ...style,
1324
1464
  "--_tab-count": tabCount,
1325
1465
  "--_active-idx": activeIndex
1326
- };
1327
- }, [variant, tabCount, activeIndex, style]);
1328
- return /* @__PURE__ */ jsx11(
1466
+ }),
1467
+ [tabCount, activeIndex, style]
1468
+ );
1469
+ return /* @__PURE__ */ jsx13(
1329
1470
  "div",
1330
1471
  {
1331
1472
  ref,
1332
1473
  role: "tablist",
1333
- className: clsx(variant === "segmented" ? "kds-segmented-tabs" : "kds-tabs", className),
1474
+ className: clsx("kds-segmented-tabs", className),
1334
1475
  style: mergedStyle,
1335
1476
  onKeyDown,
1336
1477
  ...props,
1337
1478
  children: Children.map(children, (child, i) => {
1338
- if (!React10.isValidElement(child)) return child;
1339
- return React10.cloneElement(child, {
1479
+ if (!React12.isValidElement(child)) return child;
1480
+ return React12.cloneElement(child, {
1340
1481
  _active: i === activeIndex,
1341
1482
  _onClick: () => onChange(i)
1342
1483
  });
@@ -1346,11 +1487,12 @@ var KdsTabs = forwardRef10(
1346
1487
  }
1347
1488
  );
1348
1489
  KdsTabs.displayName = "KdsTabs";
1349
- var KdsTab = forwardRef10(
1350
- ({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */ jsx11(
1490
+ var KdsTab = forwardRef12(
1491
+ ({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */ jsx13(
1351
1492
  "button",
1352
1493
  {
1353
1494
  ref,
1495
+ type: "button",
1354
1496
  role: "tab",
1355
1497
  "aria-selected": _active,
1356
1498
  tabIndex: _active ? 0 : -1,
@@ -1362,8 +1504,8 @@ var KdsTab = forwardRef10(
1362
1504
  )
1363
1505
  );
1364
1506
  KdsTab.displayName = "KdsTab";
1365
- var KdsTabPanel = forwardRef10(
1366
- ({ active, children, className, ...props }, ref) => /* @__PURE__ */ jsx11(
1507
+ var KdsTabPanel = forwardRef12(
1508
+ ({ active, children, className, ...props }, ref) => /* @__PURE__ */ jsx13(
1367
1509
  "div",
1368
1510
  {
1369
1511
  ref,
@@ -1377,190 +1519,128 @@ var KdsTabPanel = forwardRef10(
1377
1519
  );
1378
1520
  KdsTabPanel.displayName = "KdsTabPanel";
1379
1521
 
1380
- // src/components/core/KdsLogoHeader/KdsLogoHeader.tsx
1381
- import { forwardRef as forwardRef11 } from "react";
1382
-
1383
- // src/assets/images/khipu-logo-color.svg
1384
- var khipu_logo_color_default = "./khipu-logo-color-TV75AKOV.svg";
1385
-
1386
- // src/components/core/KdsLogoHeader/KdsLogoHeader.tsx
1387
- import { jsx as jsx12 } from "react/jsx-runtime";
1388
- var KhipuLogo = () => /* @__PURE__ */ jsx12(
1389
- "img",
1390
- {
1391
- src: khipu_logo_color_default,
1392
- alt: "Khipu",
1393
- className: "kds-logo-header-logo-img"
1394
- }
1395
- );
1396
- var KdsLogoHeaderLogo = forwardRef11(
1397
- ({ children, className, ...props }, ref) => {
1398
- return /* @__PURE__ */ jsx12(
1399
- "div",
1400
- {
1401
- ref,
1402
- className: clsx("kds-logo-header-logo", className),
1403
- ...props,
1404
- children: children || /* @__PURE__ */ jsx12(KhipuLogo, {})
1405
- }
1406
- );
1407
- }
1408
- );
1409
- KdsLogoHeaderLogo.displayName = "KdsLogoHeaderLogo";
1410
- var KdsLogoHeaderSeparator = forwardRef11(
1411
- ({ children = "|", className, ...props }, ref) => {
1412
- return /* @__PURE__ */ jsx12(
1413
- "span",
1414
- {
1415
- ref,
1416
- className: clsx("kds-logo-header-separator", className),
1417
- ...props,
1418
- children
1419
- }
1420
- );
1421
- }
1422
- );
1423
- KdsLogoHeaderSeparator.displayName = "KdsLogoHeaderSeparator";
1424
- var KdsLogoHeaderCode = forwardRef11(
1425
- ({ children, className, ...props }, ref) => {
1426
- return /* @__PURE__ */ jsx12(
1427
- "span",
1428
- {
1429
- ref,
1430
- className: clsx("kds-logo-header-code", className),
1431
- ...props,
1432
- children
1433
- }
1434
- );
1435
- }
1436
- );
1437
- KdsLogoHeaderCode.displayName = "KdsLogoHeaderCode";
1438
- var KdsLogoHeaderCloseButton = forwardRef11(
1439
- ({ onClose, className, ...props }, ref) => {
1440
- return /* @__PURE__ */ jsx12("div", { className: "kds-logo-header-close-wrapper", children: /* @__PURE__ */ jsx12(
1441
- "button",
1442
- {
1443
- ref,
1444
- onClick: onClose,
1445
- className: clsx("kds-btn kds-btn-icon", className),
1446
- "aria-label": "close",
1447
- ...props,
1448
- children: /* @__PURE__ */ jsx12("i", { className: "material-symbols-outlined", children: "close" })
1449
- }
1450
- ) });
1451
- }
1452
- );
1453
- KdsLogoHeaderCloseButton.displayName = "KdsLogoHeaderCloseButton";
1454
- var KdsLogoHeader = forwardRef11(
1455
- ({ children, className, ...props }, ref) => {
1456
- return /* @__PURE__ */ jsx12(
1457
- "div",
1458
- {
1459
- ref,
1460
- className: clsx("kds-brand-row", className),
1461
- ...props,
1462
- children
1463
- }
1464
- );
1465
- }
1466
- );
1467
- KdsLogoHeader.displayName = "KdsLogoHeader";
1468
-
1469
1522
  // src/components/core/KdsRadioGroup/KdsRadioGroup.tsx
1470
- import { forwardRef as forwardRef12 } from "react";
1471
- import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
1472
- var KdsRadioGroup = forwardRef12(
1473
- ({ label, name, options, value, onChange, className, ...props }, ref) => /* @__PURE__ */ jsxs7("fieldset", { ref, className: clsx("kds-radio-group", className), ...props, children: [
1474
- label && /* @__PURE__ */ jsx13("legend", { children: label }),
1475
- options.map((opt) => /* @__PURE__ */ jsxs7("label", { className: "field", children: [
1476
- /* @__PURE__ */ jsx13(
1477
- "input",
1478
- {
1479
- type: "radio",
1480
- name,
1481
- value: opt.value,
1482
- checked: value === opt.value,
1483
- disabled: opt.disabled,
1484
- onChange: () => onChange?.(opt.value)
1485
- }
1486
- ),
1487
- /* @__PURE__ */ jsx13("span", { children: opt.label })
1488
- ] }, opt.value))
1489
- ] })
1523
+ import { forwardRef as forwardRef13 } from "react";
1524
+ import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
1525
+ var KdsRadioGroup = forwardRef13(
1526
+ ({ label, name, options, value, onChange, size, variant, className, ...props }, ref) => /* @__PURE__ */ jsxs9(
1527
+ "fieldset",
1528
+ {
1529
+ ref,
1530
+ className: clsx("kds-radio-group", variant === "card" && "kds-radio-group--card", className),
1531
+ ...props,
1532
+ children: [
1533
+ label && /* @__PURE__ */ jsx14("legend", { children: label }),
1534
+ options.map((opt) => /* @__PURE__ */ jsxs9("label", { className: clsx("radio", size), children: [
1535
+ /* @__PURE__ */ jsx14(
1536
+ "input",
1537
+ {
1538
+ type: "radio",
1539
+ name,
1540
+ value: opt.value,
1541
+ checked: value === opt.value,
1542
+ disabled: opt.disabled,
1543
+ onChange: () => onChange?.(opt.value)
1544
+ }
1545
+ ),
1546
+ /* @__PURE__ */ jsx14("span", { children: opt.label })
1547
+ ] }, opt.value))
1548
+ ]
1549
+ }
1550
+ )
1490
1551
  );
1491
1552
  KdsRadioGroup.displayName = "KdsRadioGroup";
1492
1553
 
1493
1554
  // src/components/core/KdsSelect/KdsSelect.tsx
1494
- import { forwardRef as forwardRef13 } from "react";
1495
- import * as Select from "@radix-ui/react-select";
1496
- import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
1497
- var KdsSelectRoot = forwardRef13(
1555
+ import { forwardRef as forwardRef14 } from "react";
1556
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
1557
+ var KdsSelect = forwardRef14(
1498
1558
  ({
1499
- value,
1500
- onValueChange,
1501
- placeholder,
1502
1559
  label,
1503
- error,
1560
+ options,
1561
+ placeholder,
1504
1562
  helperText,
1505
- disabled,
1563
+ error,
1564
+ prefixIcon,
1506
1565
  fullWidth = true,
1507
- children,
1508
- className
1509
- }, ref) => /* @__PURE__ */ jsxs8(
1510
- "div",
1511
- {
1512
- ref,
1513
- className: clsx(
1514
- "kds-select",
1515
- error && "kds-select-error",
1516
- fullWidth && "kds-select-full",
1517
- className
1518
- ),
1519
- children: [
1520
- label && /* @__PURE__ */ jsx14("label", { className: "kds-select-label", children: label }),
1521
- /* @__PURE__ */ jsxs8(Select.Root, { value, onValueChange, disabled, children: [
1522
- /* @__PURE__ */ jsxs8(Select.Trigger, { className: "kds-select-trigger", children: [
1523
- /* @__PURE__ */ jsx14(Select.Value, { placeholder }),
1524
- /* @__PURE__ */ jsx14(Select.Icon, { className: "kds-select-icon", children: /* @__PURE__ */ jsx14("i", { className: "material-symbols-outlined", children: "expand_more" }) })
1566
+ disabled,
1567
+ required,
1568
+ className,
1569
+ id,
1570
+ ...props
1571
+ }, ref) => {
1572
+ const fieldId = id || `kds-select-${label.toLowerCase().replace(/\s+/g, "-")}`;
1573
+ return /* @__PURE__ */ jsxs10(
1574
+ "div",
1575
+ {
1576
+ className: clsx(
1577
+ "field",
1578
+ "label",
1579
+ "border",
1580
+ prefixIcon && "prefix",
1581
+ error && "invalid",
1582
+ fullWidth && "kds-w-full",
1583
+ className
1584
+ ),
1585
+ children: [
1586
+ prefixIcon && /* @__PURE__ */ jsx15("i", { className: "material-symbols-outlined", children: prefixIcon }),
1587
+ /* @__PURE__ */ jsxs10(
1588
+ "select",
1589
+ {
1590
+ ref,
1591
+ id: fieldId,
1592
+ disabled,
1593
+ required,
1594
+ ...props,
1595
+ children: [
1596
+ placeholder !== void 0 && /* @__PURE__ */ jsx15("option", { value: "", children: placeholder }),
1597
+ options.map((opt) => /* @__PURE__ */ jsx15("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value))
1598
+ ]
1599
+ }
1600
+ ),
1601
+ /* @__PURE__ */ jsxs10("label", { htmlFor: fieldId, children: [
1602
+ label,
1603
+ required && " *"
1525
1604
  ] }),
1526
- /* @__PURE__ */ jsx14(Select.Portal, { children: /* @__PURE__ */ jsx14(Select.Content, { className: "kds-select-content", position: "popper", sideOffset: 4, children: /* @__PURE__ */ jsx14(Select.Viewport, { className: "kds-select-viewport", children }) }) })
1527
- ] }),
1528
- helperText && /* @__PURE__ */ jsx14("span", { className: clsx("kds-select-helper", error && "kds-select-helper-error"), children: helperText })
1529
- ]
1530
- }
1531
- )
1532
- );
1533
- KdsSelectRoot.displayName = "KdsSelect";
1534
- var KdsSelectItem = forwardRef13(
1535
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsxs8(Select.Item, { ref, className: clsx("kds-select-item", className), ...props, children: [
1536
- /* @__PURE__ */ jsx14(Select.ItemText, { children }),
1537
- /* @__PURE__ */ jsx14(Select.ItemIndicator, { className: "kds-select-item-indicator", children: /* @__PURE__ */ jsx14("i", { className: "material-symbols-outlined", children: "check" }) })
1538
- ] })
1605
+ helperText && /* @__PURE__ */ jsx15("span", { className: "helper", children: helperText })
1606
+ ]
1607
+ }
1608
+ );
1609
+ }
1539
1610
  );
1540
- KdsSelectItem.displayName = "KdsSelect.Item";
1541
- var KdsSelect = Object.assign(KdsSelectRoot, {
1542
- Item: KdsSelectItem
1543
- });
1611
+ KdsSelect.displayName = "KdsSelect";
1544
1612
 
1545
1613
  // src/components/core/KdsChip/KdsChip.tsx
1546
- import { forwardRef as forwardRef14 } from "react";
1547
- import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
1548
- var KdsChip = forwardRef14(
1549
- ({ color, icon, onDelete, children, className, ...props }, ref) => /* @__PURE__ */ jsxs9("span", { ref, className: clsx("kds-badge", color, className), ...props, children: [
1550
- icon && /* @__PURE__ */ jsx15("i", { className: "material-symbols-outlined", children: icon }),
1551
- children,
1552
- onDelete && /* @__PURE__ */ jsx15("button", { className: "kds-btn kds-btn-text kds-btn-sm", onClick: onDelete, "aria-label": "Eliminar", children: /* @__PURE__ */ jsx15("i", { className: "material-symbols-outlined", children: "close" }) })
1614
+ import { forwardRef as forwardRef15 } from "react";
1615
+ import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
1616
+ var KdsChip = forwardRef15(
1617
+ ({ color, icon, onDelete, children, className, ...props }, ref) => /* @__PURE__ */ jsxs11("span", { ref, className: clsx("kds-badge", color, className), ...props, children: [
1618
+ icon && /* @__PURE__ */ jsx16("i", { className: "material-symbols-outlined", children: icon }),
1619
+ /* @__PURE__ */ jsx16("span", { children }),
1620
+ onDelete && /* @__PURE__ */ jsx16(
1621
+ "button",
1622
+ {
1623
+ type: "button",
1624
+ className: "kds-badge-close",
1625
+ onClick: (e) => {
1626
+ e.stopPropagation();
1627
+ onDelete();
1628
+ },
1629
+ "aria-label": "Eliminar",
1630
+ children: /* @__PURE__ */ jsx16("i", { className: "material-symbols-outlined", children: "close" })
1631
+ }
1632
+ )
1553
1633
  ] })
1554
1634
  );
1555
1635
  KdsChip.displayName = "KdsChip";
1556
1636
 
1557
1637
  // src/components/core/KdsSnackbar/KdsSnackbar.tsx
1558
- import { forwardRef as forwardRef15 } from "react";
1638
+ import { forwardRef as forwardRef16 } from "react";
1559
1639
 
1560
1640
  // src/components/core/hooks/useAutoHide.ts
1561
- import { useState, useEffect, useRef } from "react";
1641
+ import { useState as useState3, useEffect, useRef } from "react";
1562
1642
  function useAutoHide(durationMs, onHide) {
1563
- const [visible, setVisible] = useState(true);
1643
+ const [visible, setVisible] = useState3(true);
1564
1644
  const onHideRef = useRef(onHide);
1565
1645
  onHideRef.current = onHide;
1566
1646
  useEffect(() => {
@@ -1575,22 +1655,61 @@ function useAutoHide(durationMs, onHide) {
1575
1655
  }
1576
1656
 
1577
1657
  // src/components/core/KdsSnackbar/KdsSnackbar.tsx
1578
- import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
1579
- var KdsSnackbar = forwardRef15(
1580
- ({ message, type, duration = 5e3, onClose, open = true, className, ...props }, ref) => {
1581
- const { visible } = useAutoHide(duration, onClose);
1658
+ import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
1659
+ var DEFAULT_ICONS2 = {
1660
+ info: "info",
1661
+ success: "check_circle",
1662
+ error: "error"
1663
+ };
1664
+ var KdsSnackbar = forwardRef16(
1665
+ ({
1666
+ message,
1667
+ type = "info",
1668
+ duration = 5e3,
1669
+ onClose,
1670
+ open = true,
1671
+ icon,
1672
+ className,
1673
+ style,
1674
+ ...props
1675
+ }, ref) => {
1676
+ const autoDismiss = duration > 0;
1677
+ const { visible } = useAutoHide(autoDismiss ? duration : 0, onClose);
1582
1678
  if (!open || !visible) return null;
1583
- return /* @__PURE__ */ jsxs10("div", { ref, role: "status", className: clsx("snackbar", "active", type, className), ...props, children: [
1584
- /* @__PURE__ */ jsx16("span", { children: message }),
1585
- onClose && /* @__PURE__ */ jsx16("button", { onClick: onClose, "aria-label": "Cerrar", children: /* @__PURE__ */ jsx16("i", { className: "material-symbols-outlined", children: "close" }) })
1586
- ] });
1587
- }
1588
- );
1589
- KdsSnackbar.displayName = "KdsSnackbar";
1590
-
1591
- // src/components/core/KdsTooltip/KdsTooltip.tsx
1592
- import * as Tooltip from "@radix-ui/react-tooltip";
1593
- import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
1679
+ const resolvedIcon = icon === false ? null : icon ?? DEFAULT_ICONS2[type];
1680
+ const mergedStyle = autoDismiss ? { ...style, ["--kds-snackbar-duration"]: `${duration}ms` } : style ?? {};
1681
+ return /* @__PURE__ */ jsxs12(
1682
+ "div",
1683
+ {
1684
+ ref,
1685
+ role: "status",
1686
+ className: clsx("snackbar", "active", type, className),
1687
+ "data-auto-dismiss": autoDismiss ? "true" : void 0,
1688
+ style: mergedStyle,
1689
+ ...props,
1690
+ children: [
1691
+ resolvedIcon && /* @__PURE__ */ jsx17("i", { className: "material-symbols-outlined", children: resolvedIcon }),
1692
+ /* @__PURE__ */ jsx17("span", { className: "max", children: message }),
1693
+ onClose && /* @__PURE__ */ jsx17(
1694
+ "button",
1695
+ {
1696
+ type: "button",
1697
+ className: "kds-snackbar-close",
1698
+ onClick: onClose,
1699
+ "aria-label": "Cerrar",
1700
+ children: /* @__PURE__ */ jsx17("i", { className: "material-symbols-outlined", children: "close" })
1701
+ }
1702
+ )
1703
+ ]
1704
+ }
1705
+ );
1706
+ }
1707
+ );
1708
+ KdsSnackbar.displayName = "KdsSnackbar";
1709
+
1710
+ // src/components/core/KdsTooltip/KdsTooltip.tsx
1711
+ import * as Tooltip from "@radix-ui/react-tooltip";
1712
+ import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
1594
1713
  function KdsTooltip({
1595
1714
  content,
1596
1715
  children,
@@ -1601,167 +1720,377 @@ function KdsTooltip({
1601
1720
  onOpenChange,
1602
1721
  delayDuration = 300
1603
1722
  }) {
1604
- return /* @__PURE__ */ jsx17(Tooltip.Provider, { delayDuration, children: /* @__PURE__ */ jsxs11(Tooltip.Root, { open, defaultOpen, onOpenChange, children: [
1605
- /* @__PURE__ */ jsx17(Tooltip.Trigger, { asChild: true, children }),
1606
- /* @__PURE__ */ jsx17(Tooltip.Portal, { children: /* @__PURE__ */ jsxs11(Tooltip.Content, { className: clsx("kds-tooltip", className), side: placement, sideOffset: 4, children: [
1607
- content,
1608
- /* @__PURE__ */ jsx17(Tooltip.Arrow, { className: "kds-tooltip-arrow" })
1609
- ] }) })
1723
+ return /* @__PURE__ */ jsx18(Tooltip.Provider, { delayDuration, children: /* @__PURE__ */ jsxs13(Tooltip.Root, { open, defaultOpen, onOpenChange, children: [
1724
+ /* @__PURE__ */ jsx18(Tooltip.Trigger, { asChild: true, children }),
1725
+ /* @__PURE__ */ jsx18(Tooltip.Portal, { children: /* @__PURE__ */ jsxs13(
1726
+ Tooltip.Content,
1727
+ {
1728
+ className: clsx("kds-tooltip", className),
1729
+ side: placement,
1730
+ sideOffset: 6,
1731
+ collisionPadding: 8,
1732
+ children: [
1733
+ content,
1734
+ /* @__PURE__ */ jsx18(Tooltip.Arrow, { className: "kds-tooltip-arrow", width: 10, height: 5 })
1735
+ ]
1736
+ }
1737
+ ) })
1610
1738
  ] }) });
1611
1739
  }
1612
1740
 
1613
1741
  // src/components/core/KdsAccordion/KdsAccordion.tsx
1614
- import { forwardRef as forwardRef16 } from "react";
1615
- import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
1616
- var KdsAccordion = forwardRef16(
1617
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx18("details", { ref, className: clsx("kds-accordion", className), ...props, children })
1742
+ import { forwardRef as forwardRef17 } from "react";
1743
+ import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
1744
+ var KdsAccordion = forwardRef17(
1745
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx19("details", { ref, className: clsx("kds-accordion", className), ...props, children })
1618
1746
  );
1619
1747
  KdsAccordion.displayName = "KdsAccordion";
1620
- var KdsAccordionSummary = forwardRef16(
1621
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsxs12("summary", { ref, className: clsx("kds-accordion-summary", className), ...props, children: [
1748
+ var KdsAccordionSummary = forwardRef17(
1749
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsxs14("summary", { ref, className: clsx("kds-accordion-summary", className), ...props, children: [
1622
1750
  children,
1623
- /* @__PURE__ */ jsx18("i", { className: "material-symbols-outlined", children: "expand_more" })
1751
+ /* @__PURE__ */ jsx19("i", { className: "material-symbols-outlined", children: "expand_more" })
1624
1752
  ] })
1625
1753
  );
1626
1754
  KdsAccordionSummary.displayName = "KdsAccordionSummary";
1627
- var KdsAccordionDetails = forwardRef16(
1628
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx18("div", { ref, className: clsx("kds-accordion-details", className), ...props, children })
1755
+ var KdsAccordionDetails = forwardRef17(
1756
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx19("div", { ref, className: clsx("kds-accordion-details", className), ...props, children })
1629
1757
  );
1630
1758
  KdsAccordionDetails.displayName = "KdsAccordionDetails";
1631
1759
 
1632
1760
  // src/components/core/KdsDivider/KdsDivider.tsx
1633
- import { forwardRef as forwardRef17 } from "react";
1634
- import { jsx as jsx19 } from "react/jsx-runtime";
1635
- var KdsDivider = forwardRef17(
1636
- ({ dashed, className, ...props }, ref) => /* @__PURE__ */ jsx19("hr", { ref, className: clsx(dashed ? "kds-hr-dashed" : "kds-hr", className), ...props })
1761
+ import { forwardRef as forwardRef18 } from "react";
1762
+ import { jsx as jsx20 } from "react/jsx-runtime";
1763
+ var KdsDivider = forwardRef18(
1764
+ ({ dashed, className, ...props }, ref) => /* @__PURE__ */ jsx20("hr", { ref, className: clsx(dashed ? "kds-hr-dashed" : "kds-hr", className), ...props })
1637
1765
  );
1638
1766
  KdsDivider.displayName = "KdsDivider";
1639
1767
 
1640
1768
  // src/components/core/KdsSectionNote/KdsSectionNote.tsx
1641
- import { forwardRef as forwardRef18 } from "react";
1642
- import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
1643
- var KdsSectionNote = forwardRef18(
1644
- ({ icon = "info", children, className, ...props }, ref) => /* @__PURE__ */ jsxs13("p", { ref, className: clsx("kds-section-note", className), ...props, children: [
1645
- /* @__PURE__ */ jsx20("i", { className: "material-symbols-outlined", children: icon }),
1646
- /* @__PURE__ */ jsx20("span", { children })
1769
+ import { forwardRef as forwardRef19 } from "react";
1770
+ import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
1771
+ var KdsSectionNote = forwardRef19(
1772
+ ({ icon = "info", children, className, ...props }, ref) => /* @__PURE__ */ jsxs15("p", { ref, className: clsx("kds-section-note", className), ...props, children: [
1773
+ /* @__PURE__ */ jsx21("i", { className: "material-symbols-outlined", children: icon }),
1774
+ /* @__PURE__ */ jsx21("span", { children })
1647
1775
  ] })
1648
1776
  );
1649
1777
  KdsSectionNote.displayName = "KdsSectionNote";
1650
1778
 
1651
1779
  // src/components/core/KdsStatusBlock/KdsStatusBlock.tsx
1652
- import { forwardRef as forwardRef19 } from "react";
1653
- import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
1654
- var KdsStatusBlock = forwardRef19(
1655
- ({ status, icon, title, description, inline, className, ...props }, ref) => /* @__PURE__ */ jsxs14("div", { ref, className: clsx("kds-status-block", inline && "inline", className), "data-status": status, ...props, children: [
1656
- /* @__PURE__ */ jsx21("div", { className: "kds-status-block-icon", children: icon && /* @__PURE__ */ jsx21("i", { className: "material-symbols-outlined", children: icon }) }),
1657
- /* @__PURE__ */ jsxs14("div", { children: [
1658
- /* @__PURE__ */ jsx21("h2", { className: "kds-status-block-title", children: title }),
1659
- description && /* @__PURE__ */ jsx21("p", { className: "kds-status-block-description", children: description })
1780
+ import { forwardRef as forwardRef20 } from "react";
1781
+ import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
1782
+ var KdsStatusBlock = forwardRef20(
1783
+ ({ status, icon, title, description, inline, className, ...props }, ref) => /* @__PURE__ */ jsxs16("div", { ref, className: clsx("kds-status-block", inline && "inline", className), "data-status": status, ...props, children: [
1784
+ /* @__PURE__ */ jsx22("div", { className: "kds-status-block-icon", children: icon && /* @__PURE__ */ jsx22("i", { className: "material-symbols-outlined", children: icon }) }),
1785
+ /* @__PURE__ */ jsxs16("div", { children: [
1786
+ /* @__PURE__ */ jsx22("h2", { className: "kds-status-block-title", children: title }),
1787
+ description && /* @__PURE__ */ jsx22("p", { className: "kds-status-block-description", children: description })
1660
1788
  ] })
1661
1789
  ] })
1662
1790
  );
1663
1791
  KdsStatusBlock.displayName = "KdsStatusBlock";
1664
1792
 
1665
1793
  // src/components/core/KdsStepper/KdsStepper.tsx
1666
- import { forwardRef as forwardRef20 } from "react";
1667
- import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
1668
- var KdsStepper = forwardRef20(
1669
- ({ steps, current, className, ...props }, ref) => /* @__PURE__ */ jsx22("div", { ref, className: clsx("kds-stepper", className), "data-steps": steps, "data-current": current, ...props, children: Array.from({ length: steps }, (_, i) => /* @__PURE__ */ jsxs15("div", { className: clsx("kds-step", i < current && "completed", i === current && "current"), children: [
1670
- /* @__PURE__ */ jsx22("div", { className: "kds-step-indicator", children: i < current ? "\u2713" : i + 1 }),
1671
- i < steps - 1 && /* @__PURE__ */ jsx22("div", { className: "kds-step-line" })
1672
- ] }, i)) })
1673
- );
1674
- KdsStepper.displayName = "KdsStepper";
1675
-
1676
- // src/components/core/KdsCopyRow/KdsCopyRow.tsx
1677
1794
  import { forwardRef as forwardRef21 } from "react";
1678
-
1679
- // src/components/core/hooks/useCopyToClipboard.ts
1680
- import { useState as useState2, useCallback as useCallback2 } from "react";
1681
- function useCopyToClipboard(resetMs = 1200) {
1682
- const [copied, setCopied] = useState2(false);
1683
- const copy = useCallback2(
1684
- async (text) => {
1685
- try {
1686
- await navigator.clipboard.writeText(text);
1687
- setCopied(true);
1688
- setTimeout(() => setCopied(false), resetMs);
1689
- } catch {
1690
- }
1795
+ import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
1796
+ var KdsStepper = forwardRef21(
1797
+ ({ steps, current, className, ...props }, ref) => /* @__PURE__ */ jsx23("div", { ref, className: clsx("kds-stepper", className), ...props, children: steps.map((label, i) => /* @__PURE__ */ jsxs17(
1798
+ "div",
1799
+ {
1800
+ className: clsx("kds-step", i < current && "completed", i === current && "current"),
1801
+ children: [
1802
+ /* @__PURE__ */ jsx23("div", { className: "kds-step-indicator" }),
1803
+ /* @__PURE__ */ jsx23("div", { className: "kds-step-label", children: label })
1804
+ ]
1691
1805
  },
1692
- [resetMs]
1693
- );
1694
- return { copied, copy };
1695
- }
1806
+ `${i}-${label}`
1807
+ )) })
1808
+ );
1809
+ KdsStepper.displayName = "KdsStepper";
1696
1810
 
1697
1811
  // src/components/core/KdsCopyRow/KdsCopyRow.tsx
1698
- import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
1699
- var KdsCopyRow = forwardRef21(
1700
- ({ label, value, className, ...props }, ref) => {
1812
+ import { forwardRef as forwardRef22 } from "react";
1813
+ import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
1814
+ var KdsCopyRow = forwardRef22(
1815
+ ({ label, value, copiedText = "Copiado", className, ...props }, ref) => {
1701
1816
  const { copied, copy } = useCopyToClipboard();
1702
- return /* @__PURE__ */ jsxs16("div", { ref, className: clsx("kds-copy-row", copied && "copied", className), ...props, children: [
1703
- /* @__PURE__ */ jsx23("span", { className: "kds-copy-row-label", children: label }),
1704
- /* @__PURE__ */ jsx23("span", { className: "kds-copy-row-value", children: value }),
1705
- /* @__PURE__ */ jsx23("button", { className: "kds-copy-row-btn", onClick: () => copy(value), "aria-label": `Copiar ${label}`, children: /* @__PURE__ */ jsx23("i", { className: "material-symbols-outlined", children: copied ? "check" : "content_copy" }) })
1706
- ] });
1817
+ return /* @__PURE__ */ jsxs18(
1818
+ "button",
1819
+ {
1820
+ ref,
1821
+ type: "button",
1822
+ className: clsx("kds-copy-row", copied && "copied", className),
1823
+ "data-copy": value,
1824
+ onClick: () => copy(value),
1825
+ "aria-label": `Copiar ${label}: ${value}`,
1826
+ ...props,
1827
+ children: [
1828
+ /* @__PURE__ */ jsx24("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: "content_copy" }),
1829
+ /* @__PURE__ */ jsxs18("div", { children: [
1830
+ /* @__PURE__ */ jsx24("span", { className: "kds-copy-row-label", children: label }),
1831
+ /* @__PURE__ */ jsx24("span", { className: "kds-copy-row-value", children: value })
1832
+ ] }),
1833
+ /* @__PURE__ */ jsxs18("span", { className: "kds-copy-toast", "aria-hidden": "true", children: [
1834
+ /* @__PURE__ */ jsx24("i", { className: "material-symbols-outlined", children: "check_circle" }),
1835
+ " ",
1836
+ copiedText
1837
+ ] })
1838
+ ]
1839
+ }
1840
+ );
1707
1841
  }
1708
1842
  );
1709
1843
  KdsCopyRow.displayName = "KdsCopyRow";
1710
1844
 
1711
1845
  // src/components/core/KdsCopyableTable/KdsCopyableTable.tsx
1712
- import { forwardRef as forwardRef22 } from "react";
1713
- import { Fragment as Fragment2, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
1714
- var KdsCopyableTable = forwardRef22(
1715
- ({ rows, className, ...props }, ref) => {
1716
- const { copied, copy } = useCopyToClipboard();
1717
- const handleCopyAll = () => {
1718
- const text = rows.map((r) => `${r.label}: ${r.value}`).join("\n");
1719
- copy(text);
1720
- };
1721
- return /* @__PURE__ */ jsxs17(Fragment2, { children: [
1722
- /* @__PURE__ */ jsx24("div", { ref, className: clsx("kds-copyable-table", className), ...props, children: rows.map((row) => /* @__PURE__ */ jsxs17("div", { className: "kds-copyable-table-row", children: [
1723
- /* @__PURE__ */ jsx24("span", { className: "kds-copyable-table-label", children: row.label }),
1724
- /* @__PURE__ */ jsx24("span", { className: "kds-copyable-table-value", children: row.value })
1725
- ] }, row.label)) }),
1726
- /* @__PURE__ */ jsxs17("button", { className: `kds-btn kds-btn-outlined kds-btn-block kds-copy-all-btn${copied ? " copied" : ""}`, onClick: handleCopyAll, "aria-label": "Copiar todo", children: [
1727
- /* @__PURE__ */ jsx24("span", { className: "kds-icon", children: /* @__PURE__ */ jsx24("i", { className: "material-symbols-outlined", children: copied ? "check" : "content_copy" }) }),
1728
- /* @__PURE__ */ jsx24("span", { children: copied ? "Copiado" : "Copiar todos los datos" })
1729
- ] })
1730
- ] });
1846
+ import { forwardRef as forwardRef23, useState as useState4, useRef as useRef2, useCallback as useCallback3 } from "react";
1847
+ import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
1848
+ async function copyToClipboard(text) {
1849
+ try {
1850
+ if (navigator.clipboard?.writeText) {
1851
+ await navigator.clipboard.writeText(text);
1852
+ return true;
1853
+ }
1854
+ } catch {
1855
+ }
1856
+ const ta = document.createElement("textarea");
1857
+ ta.value = text;
1858
+ ta.style.position = "fixed";
1859
+ ta.style.opacity = "0";
1860
+ document.body.appendChild(ta);
1861
+ ta.select();
1862
+ try {
1863
+ document.execCommand("copy");
1864
+ return true;
1865
+ } catch {
1866
+ return false;
1867
+ } finally {
1868
+ document.body.removeChild(ta);
1869
+ }
1870
+ }
1871
+ var TRANSITION_MS = 300;
1872
+ function GridVariant({
1873
+ gridRows,
1874
+ disabled,
1875
+ className,
1876
+ forwardedRef,
1877
+ rest
1878
+ }) {
1879
+ return /* @__PURE__ */ jsx25(
1880
+ "div",
1881
+ {
1882
+ ref: forwardedRef,
1883
+ className: clsx("kds-copyable-table", "kds-copyable-table--grid", className),
1884
+ ...rest,
1885
+ children: gridRows.map((cells, rowIndex) => /* @__PURE__ */ jsx25(
1886
+ "div",
1887
+ {
1888
+ className: "kds-copyable-table-row kds-copyable-table-row--grid",
1889
+ "data-testid": "kds-grid-row",
1890
+ children: cells.map((text, cellIndex) => /* @__PURE__ */ jsx25(
1891
+ "span",
1892
+ {
1893
+ className: clsx("kds-grid-cell", disabled && "kds-grid-cell--disabled"),
1894
+ children: text
1895
+ },
1896
+ cellIndex
1897
+ ))
1898
+ },
1899
+ rowIndex
1900
+ ))
1901
+ }
1902
+ );
1903
+ }
1904
+ function CopyableVariant({
1905
+ rows,
1906
+ copyAllLabel = "Copiar todos los datos",
1907
+ copiedAllLabel = "Datos copiados",
1908
+ showCopyAll = true,
1909
+ className,
1910
+ forwardedRef,
1911
+ rest
1912
+ }) {
1913
+ const copiedTimers = useRef2(/* @__PURE__ */ new Map());
1914
+ const settlingTimers = useRef2(/* @__PURE__ */ new Map());
1915
+ const [copiedRows, setCopiedRows] = useState4(/* @__PURE__ */ new Set());
1916
+ const [settlingRows, setSettlingRows] = useState4(/* @__PURE__ */ new Set());
1917
+ const [allCopied, setAllCopied] = useState4(false);
1918
+ const markCopied = useCallback3((indexes, duration = 1500) => {
1919
+ setCopiedRows((prev) => {
1920
+ const next = new Set(prev);
1921
+ indexes.forEach((i) => next.add(i));
1922
+ return next;
1923
+ });
1924
+ indexes.forEach((i) => {
1925
+ const st = settlingTimers.current.get(i);
1926
+ if (st) {
1927
+ clearTimeout(st);
1928
+ settlingTimers.current.delete(i);
1929
+ }
1930
+ });
1931
+ setSettlingRows((prev) => {
1932
+ const next = new Set(prev);
1933
+ indexes.forEach((i) => next.delete(i));
1934
+ return next;
1935
+ });
1936
+ indexes.forEach((i) => {
1937
+ const existing = copiedTimers.current.get(i);
1938
+ if (existing) clearTimeout(existing);
1939
+ const t = setTimeout(() => {
1940
+ setCopiedRows((prev) => {
1941
+ const next = new Set(prev);
1942
+ next.delete(i);
1943
+ return next;
1944
+ });
1945
+ setSettlingRows((prev) => {
1946
+ const next = new Set(prev);
1947
+ next.add(i);
1948
+ return next;
1949
+ });
1950
+ copiedTimers.current.delete(i);
1951
+ const settlingT = setTimeout(() => {
1952
+ setSettlingRows((prev) => {
1953
+ const next = new Set(prev);
1954
+ next.delete(i);
1955
+ return next;
1956
+ });
1957
+ settlingTimers.current.delete(i);
1958
+ }, TRANSITION_MS);
1959
+ settlingTimers.current.set(i, settlingT);
1960
+ }, duration);
1961
+ copiedTimers.current.set(i, t);
1962
+ });
1963
+ }, []);
1964
+ const handleRowCopy = async (row, index) => {
1965
+ const ok = await copyToClipboard(row.copy ?? row.value);
1966
+ if (ok) markCopied([index]);
1967
+ };
1968
+ const handleCopyAll = async () => {
1969
+ const text = rows.map((r) => `${r.label}: ${r.value}`).join("\n");
1970
+ const ok = await copyToClipboard(text);
1971
+ if (ok) {
1972
+ markCopied(rows.map((_, i) => i));
1973
+ setAllCopied(true);
1974
+ setTimeout(() => setAllCopied(false), 2e3);
1975
+ }
1976
+ };
1977
+ return /* @__PURE__ */ jsxs19(Fragment2, { children: [
1978
+ /* @__PURE__ */ jsx25("div", { ref: forwardedRef, className: clsx("kds-copyable-table", className), ...rest, children: rows.map((row, i) => /* @__PURE__ */ jsxs19(
1979
+ "div",
1980
+ {
1981
+ className: clsx(
1982
+ "kds-copyable-table-row",
1983
+ copiedRows.has(i) && "copied",
1984
+ settlingRows.has(i) && "settling"
1985
+ ),
1986
+ role: "button",
1987
+ tabIndex: 0,
1988
+ onClick: () => handleRowCopy(row, i),
1989
+ onKeyDown: (e) => {
1990
+ if (e.key === "Enter" || e.key === " ") {
1991
+ e.preventDefault();
1992
+ handleRowCopy(row, i);
1993
+ }
1994
+ },
1995
+ "aria-label": `Copiar ${row.label}: ${row.value}`,
1996
+ children: [
1997
+ /* @__PURE__ */ jsx25("span", { className: "kds-key", children: row.label }),
1998
+ /* @__PURE__ */ jsx25("span", { className: "kds-value", children: row.value })
1999
+ ]
2000
+ },
2001
+ `${row.label}-${i}`
2002
+ )) }),
2003
+ showCopyAll && /* @__PURE__ */ jsxs19(
2004
+ "button",
2005
+ {
2006
+ type: "button",
2007
+ className: clsx(
2008
+ "kds-btn",
2009
+ "kds-btn-outlined",
2010
+ "kds-btn-block",
2011
+ "kds-copy-all-btn",
2012
+ allCopied && "copied"
2013
+ ),
2014
+ onClick: handleCopyAll,
2015
+ "aria-label": allCopied ? copiedAllLabel : copyAllLabel,
2016
+ children: [
2017
+ /* @__PURE__ */ jsx25("span", { className: "kds-icon", children: /* @__PURE__ */ jsx25("i", { className: "material-symbols-outlined", children: allCopied ? "check" : "content_copy" }) }),
2018
+ /* @__PURE__ */ jsx25("span", { children: allCopied ? copiedAllLabel : copyAllLabel })
2019
+ ]
2020
+ }
2021
+ )
2022
+ ] });
2023
+ }
2024
+ var KdsCopyableTable = forwardRef23(
2025
+ ({
2026
+ rows = [],
2027
+ variant = "copyable",
2028
+ gridRows = [],
2029
+ disabled = false,
2030
+ copyAllLabel,
2031
+ copiedAllLabel,
2032
+ showCopyAll,
2033
+ className,
2034
+ ...props
2035
+ }, ref) => {
2036
+ if (variant === "grid") {
2037
+ return /* @__PURE__ */ jsx25(
2038
+ GridVariant,
2039
+ {
2040
+ gridRows,
2041
+ disabled,
2042
+ className,
2043
+ forwardedRef: ref,
2044
+ rest: props
2045
+ }
2046
+ );
2047
+ }
2048
+ return /* @__PURE__ */ jsx25(
2049
+ CopyableVariant,
2050
+ {
2051
+ rows,
2052
+ copyAllLabel,
2053
+ copiedAllLabel,
2054
+ showCopyAll,
2055
+ className,
2056
+ forwardedRef: ref,
2057
+ rest: props
2058
+ }
2059
+ );
1731
2060
  }
1732
2061
  );
1733
2062
  KdsCopyableTable.displayName = "KdsCopyableTable";
1734
2063
 
1735
2064
  // src/components/core/KdsExpandPanel/KdsExpandPanel.tsx
1736
- import { forwardRef as forwardRef23, useState as useState3 } from "react";
1737
- import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
1738
- var KdsExpandPanel = forwardRef23(
2065
+ import { forwardRef as forwardRef24, useState as useState5 } from "react";
2066
+ import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
2067
+ var KdsExpandPanel = forwardRef24(
1739
2068
  ({ label, defaultExpanded = false, children, className, ...props }, ref) => {
1740
- const [expanded, setExpanded] = useState3(defaultExpanded);
1741
- return /* @__PURE__ */ jsxs18("div", { ref, className, ...props, children: [
1742
- /* @__PURE__ */ jsxs18(
2069
+ const [expanded, setExpanded] = useState5(defaultExpanded);
2070
+ return /* @__PURE__ */ jsxs20("div", { ref, className, ...props, children: [
2071
+ /* @__PURE__ */ jsxs20(
1743
2072
  "button",
1744
2073
  {
1745
2074
  className: "kds-expand-toggle",
1746
2075
  onClick: () => setExpanded((v) => !v),
1747
2076
  "aria-expanded": expanded,
1748
2077
  children: [
1749
- /* @__PURE__ */ jsx25("span", { children: label }),
1750
- /* @__PURE__ */ jsx25("i", { className: "material-symbols-outlined", children: expanded ? "expand_less" : "expand_more" })
2078
+ /* @__PURE__ */ jsx26("span", { children: label }),
2079
+ /* @__PURE__ */ jsx26("i", { className: "material-symbols-outlined", children: expanded ? "expand_less" : "expand_more" })
1751
2080
  ]
1752
2081
  }
1753
2082
  ),
1754
- /* @__PURE__ */ jsx25("div", { className: clsx("kds-expand-panel", expanded && "open"), hidden: !expanded, children })
2083
+ /* @__PURE__ */ jsx26("div", { className: clsx("kds-expand-panel", expanded && "open"), hidden: !expanded, children })
1755
2084
  ] });
1756
2085
  }
1757
2086
  );
1758
2087
  KdsExpandPanel.displayName = "KdsExpandPanel";
1759
2088
 
1760
2089
  // src/components/core/KdsCountdown/KdsCountdown.tsx
1761
- import { forwardRef as forwardRef24, useEffect as useEffect3, useRef as useRef2 } from "react";
2090
+ import { forwardRef as forwardRef25, useEffect as useEffect3, useRef as useRef3 } from "react";
1762
2091
 
1763
2092
  // src/components/core/hooks/useCountdown.ts
1764
- import { useState as useState4, useEffect as useEffect2 } from "react";
2093
+ import { useState as useState6, useEffect as useEffect2 } from "react";
1765
2094
  function calcRemaining(deadline) {
1766
2095
  const diff = Math.max(0, new Date(deadline).getTime() - Date.now());
1767
2096
  const totalSeconds = Math.floor(diff / 1e3);
@@ -1774,7 +2103,7 @@ function calcRemaining(deadline) {
1774
2103
  };
1775
2104
  }
1776
2105
  function useCountdown(deadline) {
1777
- const [state, setState] = useState4(() => calcRemaining(deadline));
2106
+ const [state, setState] = useState6(() => calcRemaining(deadline));
1778
2107
  useEffect2(() => {
1779
2108
  const tick = () => setState(calcRemaining(deadline));
1780
2109
  const id = setInterval(tick, 1e3);
@@ -1784,11 +2113,11 @@ function useCountdown(deadline) {
1784
2113
  }
1785
2114
 
1786
2115
  // src/components/core/KdsCountdown/KdsCountdown.tsx
1787
- import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
1788
- var KdsCountdown = forwardRef24(
2116
+ import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
2117
+ var KdsCountdown = forwardRef25(
1789
2118
  ({ deadline, label, onExpire, className, ...props }, ref) => {
1790
2119
  const { hours, minutes, seconds, expired, urgent } = useCountdown(deadline);
1791
- const onExpireRef = useRef2(onExpire);
2120
+ const onExpireRef = useRef3(onExpire);
1792
2121
  onExpireRef.current = onExpire;
1793
2122
  useEffect3(() => {
1794
2123
  if (expired) {
@@ -1799,9 +2128,9 @@ var KdsCountdown = forwardRef24(
1799
2128
  return null;
1800
2129
  }
1801
2130
  const pad = (n) => String(n).padStart(2, "0");
1802
- return /* @__PURE__ */ jsxs19("div", { ref, className: clsx("kds-countdown", urgent && "urgent", className), ...props, children: [
1803
- label && /* @__PURE__ */ jsx26("span", { className: "kds-countdown-label", children: label }),
1804
- /* @__PURE__ */ jsxs19("span", { className: "kds-countdown-value", children: [
2131
+ return /* @__PURE__ */ jsxs21("div", { ref, className: clsx("kds-countdown", urgent && "urgent", className), ...props, children: [
2132
+ label && /* @__PURE__ */ jsx27("span", { className: "kds-countdown-label", children: label }),
2133
+ /* @__PURE__ */ jsxs21("span", { className: "kds-countdown-value", children: [
1805
2134
  pad(hours),
1806
2135
  ":",
1807
2136
  pad(minutes),
@@ -1814,96 +2143,122 @@ var KdsCountdown = forwardRef24(
1814
2143
  KdsCountdown.displayName = "KdsCountdown";
1815
2144
 
1816
2145
  // src/components/core/KdsSegmentedTabs/KdsSegmentedTabs.tsx
1817
- import { forwardRef as forwardRef25 } from "react";
1818
- import { jsx as jsx27 } from "react/jsx-runtime";
1819
- var KdsSegmentedTabs = forwardRef25(
1820
- (props, ref) => /* @__PURE__ */ jsx27(KdsTabs, { ref, variant: "segmented", ...props })
2146
+ import { forwardRef as forwardRef26 } from "react";
2147
+ import { jsx as jsx28 } from "react/jsx-runtime";
2148
+ var KdsSegmentedTabs = forwardRef26(
2149
+ (props, ref) => /* @__PURE__ */ jsx28(KdsTabs, { ref, ...props })
1821
2150
  );
1822
2151
  KdsSegmentedTabs.displayName = "KdsSegmentedTabs";
1823
2152
 
1824
- // src/components/domain/KdsBankRow/KdsBankRow.tsx
1825
- import { forwardRef as forwardRef26 } from "react";
1826
- import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
1827
- var KdsBankRow = forwardRef26(
1828
- ({ name, logoUrl, selected, className, ...props }, ref) => /* @__PURE__ */ jsxs20(
2153
+ // src/components/core/KdsFab/KdsFab.tsx
2154
+ import { forwardRef as forwardRef27 } from "react";
2155
+ import { jsx as jsx29 } from "react/jsx-runtime";
2156
+ var KdsFab = forwardRef27(
2157
+ ({ icon, position = "top-right", hidden = false, className, ...props }, ref) => /* @__PURE__ */ jsx29(
1829
2158
  "button",
1830
2159
  {
1831
2160
  ref,
1832
2161
  type: "button",
1833
- className: clsx("kds-bank-row", selected && "selected", className),
2162
+ className: clsx(
2163
+ "kds-fab",
2164
+ position !== "none" && `kds-fab--${position}`,
2165
+ hidden && "kds-fab--hidden",
2166
+ className
2167
+ ),
2168
+ "aria-hidden": hidden || void 0,
2169
+ tabIndex: hidden ? -1 : void 0,
1834
2170
  ...props,
1835
- children: [
1836
- /* @__PURE__ */ jsx28("span", { className: "kds-bank-row-logo", children: logoUrl ? /* @__PURE__ */ jsx28("img", { src: logoUrl, alt: name }) : /* @__PURE__ */ jsx28("span", { className: "initials", children: name.charAt(0) }) }),
1837
- /* @__PURE__ */ jsx28("span", { className: "kds-bank-row-name", children: name }),
1838
- /* @__PURE__ */ jsx28("i", { className: "material-symbols-outlined", children: selected ? "check_circle" : "chevron_right" })
1839
- ]
2171
+ children: /* @__PURE__ */ jsx29("i", { className: "material-symbols-outlined", children: icon })
1840
2172
  }
1841
2173
  )
1842
2174
  );
2175
+ KdsFab.displayName = "KdsFab";
2176
+
2177
+ // src/components/domain/KdsBankRow/KdsBankRow.tsx
2178
+ import { forwardRef as forwardRef28 } from "react";
2179
+ import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
2180
+ var KdsBankRow = forwardRef28(
2181
+ ({ name, logoUrl, selected, hideLogo, className, ...props }, ref) => {
2182
+ const nameStr = typeof name === "string" ? name : "";
2183
+ return /* @__PURE__ */ jsxs22(
2184
+ "button",
2185
+ {
2186
+ ref,
2187
+ type: "button",
2188
+ className: clsx("kds-bank-row", selected && "selected", className),
2189
+ ...props,
2190
+ children: [
2191
+ !hideLogo && /* @__PURE__ */ jsx30("span", { className: "kds-bank-row-logo", children: logoUrl ? /* @__PURE__ */ jsx30("img", { src: logoUrl, alt: nameStr }) : /* @__PURE__ */ jsx30("span", { className: "initials", children: nameStr.charAt(0) }) }),
2192
+ /* @__PURE__ */ jsx30("span", { className: "kds-bank-row-name", children: name }),
2193
+ /* @__PURE__ */ jsx30("i", { className: "material-symbols-outlined", children: selected ? "check_circle" : "chevron_right" })
2194
+ ]
2195
+ }
2196
+ );
2197
+ }
2198
+ );
1843
2199
  KdsBankRow.displayName = "KdsBankRow";
1844
2200
 
1845
2201
  // src/components/domain/KdsBankList/KdsBankList.tsx
1846
- import { forwardRef as forwardRef27 } from "react";
1847
- import { jsx as jsx29 } from "react/jsx-runtime";
1848
- var KdsBankList = forwardRef27(
1849
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx29("div", { ref, className: clsx("kds-bank-list", className), role: "list", ...props, children })
2202
+ import { forwardRef as forwardRef29 } from "react";
2203
+ import { jsx as jsx31 } from "react/jsx-runtime";
2204
+ var KdsBankList = forwardRef29(
2205
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx31("div", { ref, className: clsx("kds-bank-list", className), role: "list", ...props, children })
1850
2206
  );
1851
2207
  KdsBankList.displayName = "KdsBankList";
1852
2208
 
1853
2209
  // src/components/domain/KdsBankModal/KdsBankModal.tsx
1854
- import { forwardRef as forwardRef28, useState as useState5 } from "react";
1855
- import * as Dialog2 from "@radix-ui/react-dialog";
1856
- import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
1857
- var KdsBankModal = forwardRef28(
2210
+ import { forwardRef as forwardRef30, useState as useState7 } from "react";
2211
+ import * as Dialog from "@radix-ui/react-dialog";
2212
+ import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
2213
+ var KdsBankModal = forwardRef30(
1858
2214
  ({ open, onClose, title = "Selecciona tu banco", searchPlaceholder = "Buscar banco...", onSearch, children, className, container }, ref) => {
1859
- const [query, setQuery] = useState5("");
2215
+ const [query, setQuery] = useState7("");
1860
2216
  const handleSearch = (value) => {
1861
2217
  setQuery(value);
1862
2218
  onSearch?.(value);
1863
2219
  };
1864
- return /* @__PURE__ */ jsx30(Dialog2.Root, { open, onOpenChange: (o) => {
2220
+ return /* @__PURE__ */ jsx32(Dialog.Root, { open, onOpenChange: (o) => {
1865
2221
  if (!o) onClose();
1866
- }, children: /* @__PURE__ */ jsx30(Dialog2.Portal, { container, children: /* @__PURE__ */ jsx30(Dialog2.Overlay, { className: "kds-bank-modal-scrim open", children: /* @__PURE__ */ jsxs21(Dialog2.Content, { ref, className: clsx("kds-bank-modal", className), children: [
1867
- /* @__PURE__ */ jsxs21("div", { className: "kds-bank-modal-header", children: [
1868
- /* @__PURE__ */ jsx30(Dialog2.Title, { asChild: true, children: /* @__PURE__ */ jsx30("h3", { children: title }) }),
1869
- /* @__PURE__ */ jsx30(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ jsx30("button", { className: "kds-bank-modal-close", "aria-label": "Cerrar", children: /* @__PURE__ */ jsx30("i", { className: "material-symbols-outlined", children: "close" }) }) })
2222
+ }, children: /* @__PURE__ */ jsx32(Dialog.Portal, { container, children: /* @__PURE__ */ jsx32(Dialog.Overlay, { className: "kds-bank-modal-scrim open", children: /* @__PURE__ */ jsxs23(Dialog.Content, { ref, className: clsx("kds-bank-modal", className), children: [
2223
+ /* @__PURE__ */ jsxs23("div", { className: "kds-bank-modal-header", children: [
2224
+ /* @__PURE__ */ jsx32(Dialog.Title, { asChild: true, children: /* @__PURE__ */ jsx32("h3", { children: title }) }),
2225
+ /* @__PURE__ */ jsx32(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx32("button", { className: "kds-bank-modal-close", "aria-label": "Cerrar", children: /* @__PURE__ */ jsx32("i", { className: "material-symbols-outlined", children: "close" }) }) })
1870
2226
  ] }),
1871
- /* @__PURE__ */ jsx30("div", { className: "kds-bank-modal-search", children: /* @__PURE__ */ jsx30(
1872
- "input",
2227
+ /* @__PURE__ */ jsx32("div", { className: "kds-bank-modal-search", children: /* @__PURE__ */ jsx32(
2228
+ KdsSearchField,
1873
2229
  {
1874
- type: "text",
1875
2230
  placeholder: searchPlaceholder,
1876
2231
  value: query,
1877
2232
  onChange: (e) => handleSearch(e.target.value)
1878
2233
  }
1879
2234
  ) }),
1880
- /* @__PURE__ */ jsx30("div", { className: "kds-bank-modal-body", children })
2235
+ /* @__PURE__ */ jsx32("div", { className: "kds-bank-modal-body", children })
1881
2236
  ] }) }) }) });
1882
2237
  }
1883
2238
  );
1884
2239
  KdsBankModal.displayName = "KdsBankModal";
1885
2240
 
1886
2241
  // src/components/domain/KdsQrRow/KdsQrRow.tsx
1887
- import { forwardRef as forwardRef29 } from "react";
1888
- import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
1889
- var KdsQrRow = forwardRef29(
1890
- ({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */ jsxs22("button", { ref, type: "button", className: clsx("kds-qr-row", className), ...props, children: [
1891
- /* @__PURE__ */ jsx31("span", { className: "kds-qr-avatar", "aria-hidden": "true", children: /* @__PURE__ */ jsx31("i", { className: "material-symbols-outlined", children: icon }) }),
1892
- /* @__PURE__ */ jsxs22("span", { className: "kds-qr-text", children: [
1893
- /* @__PURE__ */ jsx31("span", { className: "title", children: name }),
1894
- description && /* @__PURE__ */ jsx31("span", { className: "sub", children: description })
2242
+ import { forwardRef as forwardRef31 } from "react";
2243
+ import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
2244
+ var KdsQrRow = forwardRef31(
2245
+ ({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */ jsxs24("button", { ref, type: "button", className: clsx("kds-qr-row", className), ...props, children: [
2246
+ /* @__PURE__ */ jsx33("span", { className: "kds-qr-avatar", "aria-hidden": "true", children: /* @__PURE__ */ jsx33("i", { className: "material-symbols-outlined", children: icon }) }),
2247
+ /* @__PURE__ */ jsxs24("span", { className: "kds-qr-text", children: [
2248
+ /* @__PURE__ */ jsx33("span", { className: "kds-qr-title", children: name }),
2249
+ description && /* @__PURE__ */ jsx33("span", { className: "kds-qr-subtitle", children: description })
1895
2250
  ] }),
1896
- badge && /* @__PURE__ */ jsx31("span", { className: "kds-qr-badge", children: badge }),
1897
- /* @__PURE__ */ jsx31("i", { className: "material-symbols-outlined", children: "chevron_right" })
2251
+ badge && /* @__PURE__ */ jsx33("span", { className: "kds-qr-badge", children: badge }),
2252
+ /* @__PURE__ */ jsx33("i", { className: "material-symbols-outlined", children: "chevron_right" })
1898
2253
  ] })
1899
2254
  );
1900
2255
  KdsQrRow.displayName = "KdsQrRow";
1901
2256
 
1902
2257
  // src/components/domain/KdsCardSelector/KdsCardSelector.tsx
1903
- import { forwardRef as forwardRef30 } from "react";
1904
- import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
1905
- var KdsCardSelector = forwardRef30(
1906
- ({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */ jsxs23(
2258
+ import { forwardRef as forwardRef32 } from "react";
2259
+ import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
2260
+ var KdsCardSelector = forwardRef32(
2261
+ ({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */ jsxs25(
1907
2262
  "button",
1908
2263
  {
1909
2264
  ref,
@@ -1911,9 +2266,9 @@ var KdsCardSelector = forwardRef30(
1911
2266
  className: clsx("kds-card-selector", selected && "selected", className),
1912
2267
  ...props,
1913
2268
  children: [
1914
- icon && /* @__PURE__ */ jsx32("span", { className: "kds-card-selector-icon", children: /* @__PURE__ */ jsx32("i", { className: "material-symbols-outlined", children: icon }) }),
1915
- /* @__PURE__ */ jsx32("span", { className: "kds-card-selector-title", children: title }),
1916
- description && /* @__PURE__ */ jsx32("span", { className: "kds-card-selector-description", children: description })
2269
+ icon && /* @__PURE__ */ jsx34("span", { className: "kds-card-selector-icon", children: /* @__PURE__ */ jsx34("i", { className: "material-symbols-outlined", children: icon }) }),
2270
+ /* @__PURE__ */ jsx34("span", { className: "kds-card-selector-title", children: title }),
2271
+ description && /* @__PURE__ */ jsx34("span", { className: "kds-card-selector-description", children: description })
1917
2272
  ]
1918
2273
  }
1919
2274
  )
@@ -1921,26 +2276,26 @@ var KdsCardSelector = forwardRef30(
1921
2276
  KdsCardSelector.displayName = "KdsCardSelector";
1922
2277
 
1923
2278
  // src/components/domain/KdsCardPlan/KdsCardPlan.tsx
1924
- import { forwardRef as forwardRef31 } from "react";
1925
- import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
1926
- var KdsCardPlan = forwardRef31(
1927
- ({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */ jsxs24(
2279
+ import { forwardRef as forwardRef33 } from "react";
2280
+ import { jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
2281
+ var KdsCardPlan = forwardRef33(
2282
+ ({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */ jsxs26(
1928
2283
  "div",
1929
2284
  {
1930
2285
  ref,
1931
2286
  className: clsx("kds-card-plan", recommended && "recommended", className),
1932
2287
  ...props,
1933
2288
  children: [
1934
- badgeText && /* @__PURE__ */ jsx33("span", { className: "kds-card-plan-badge", children: badgeText }),
1935
- /* @__PURE__ */ jsx33("div", { className: "kds-card-plan-header", children: /* @__PURE__ */ jsx33("h3", { children: title }) }),
1936
- /* @__PURE__ */ jsxs24("div", { className: "kds-card-plan-price", children: [
1937
- /* @__PURE__ */ jsx33("span", { children: price }),
1938
- period && /* @__PURE__ */ jsxs24("span", { children: [
2289
+ /* @__PURE__ */ jsx35("div", { className: "kds-card-plan-header", children: /* @__PURE__ */ jsx35("h3", { children: title }) }),
2290
+ /* @__PURE__ */ jsxs26("div", { className: "kds-card-plan-price", children: [
2291
+ /* @__PURE__ */ jsx35("span", { className: "kds-price", children: price }),
2292
+ period && /* @__PURE__ */ jsxs26("span", { className: "kds-price-period", children: [
1939
2293
  "/",
1940
2294
  period
1941
2295
  ] })
1942
2296
  ] }),
1943
- features && features.length > 0 && /* @__PURE__ */ jsx33("ul", { className: "kds-card-plan-features", children: features.map((f, i) => /* @__PURE__ */ jsx33("li", { children: f }, i)) }),
2297
+ badgeText && /* @__PURE__ */ jsx35("span", { className: "kds-card-plan-badge", children: badgeText }),
2298
+ features && features.length > 0 && /* @__PURE__ */ jsx35("ul", { className: "kds-card-plan-features", children: features.map((f, i) => /* @__PURE__ */ jsx35("li", { children: f }, i)) }),
1944
2299
  action
1945
2300
  ]
1946
2301
  }
@@ -1949,50 +2304,468 @@ var KdsCardPlan = forwardRef31(
1949
2304
  KdsCardPlan.displayName = "KdsCardPlan";
1950
2305
 
1951
2306
  // src/components/domain/KdsInvoiceSticky/KdsInvoiceSticky.tsx
1952
- import { forwardRef as forwardRef32 } from "react";
1953
- import { jsx as jsx34 } from "react/jsx-runtime";
1954
- var KdsInvoiceSticky = forwardRef32(
1955
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx34("div", { ref, className: clsx("kds-card-elevated", "kds-invoice-sticky", className), ...props, children })
2307
+ import { forwardRef as forwardRef34 } from "react";
2308
+ import { jsx as jsx36 } from "react/jsx-runtime";
2309
+ var KdsInvoiceSticky = forwardRef34(
2310
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx36(
2311
+ "article",
2312
+ {
2313
+ ref,
2314
+ className: clsx("kds-card-elevated", "kds-invoice-sticky", className),
2315
+ ...props,
2316
+ children
2317
+ }
2318
+ )
1956
2319
  );
1957
2320
  KdsInvoiceSticky.displayName = "KdsInvoiceSticky";
1958
2321
 
1959
2322
  // src/components/domain/KdsBottomSheet/KdsBottomSheet.tsx
1960
- import { forwardRef as forwardRef33 } from "react";
1961
- import * as Dialog3 from "@radix-ui/react-dialog";
1962
- import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
1963
- var KdsBottomSheet = forwardRef33(
1964
- ({ open, onClose, title, children, actions, className, container }, ref) => /* @__PURE__ */ jsx35(Dialog3.Root, { open, onOpenChange: (o) => {
1965
- if (!o) onClose();
1966
- }, children: /* @__PURE__ */ jsx35(Dialog3.Portal, { container, children: /* @__PURE__ */ jsx35(Dialog3.Overlay, { className: "kds-bottom-sheet-scrim open", children: /* @__PURE__ */ jsxs25(Dialog3.Content, { ref, className: clsx("kds-bottom-sheet", className), children: [
1967
- /* @__PURE__ */ jsx35("div", { className: "kds-bottom-sheet-grabber" }),
1968
- title && /* @__PURE__ */ jsx35(Dialog3.Title, { className: "kds-bottom-sheet-title", children: title }),
1969
- /* @__PURE__ */ jsx35("div", { className: "kds-bottom-sheet-body", children }),
1970
- actions && /* @__PURE__ */ jsx35("div", { className: "kds-bottom-sheet-actions", children: actions })
1971
- ] }) }) }) })
2323
+ import { forwardRef as forwardRef35 } from "react";
2324
+ import * as Dialog2 from "@radix-ui/react-dialog";
2325
+ import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
2326
+ var KdsBottomSheet = forwardRef35(
2327
+ ({
2328
+ open,
2329
+ onClose,
2330
+ title,
2331
+ description,
2332
+ children,
2333
+ actions,
2334
+ showGrabber = true,
2335
+ showCloseButton = false,
2336
+ container,
2337
+ className
2338
+ }, ref) => /* @__PURE__ */ jsx37(
2339
+ Dialog2.Root,
2340
+ {
2341
+ open,
2342
+ onOpenChange: (o) => {
2343
+ if (!o) onClose();
2344
+ },
2345
+ children: /* @__PURE__ */ jsx37(Dialog2.Portal, { container, children: /* @__PURE__ */ jsx37(Dialog2.Overlay, { className: "kds-bottom-sheet-scrim open", children: /* @__PURE__ */ jsxs27(
2346
+ Dialog2.Content,
2347
+ {
2348
+ ref,
2349
+ className: clsx("kds-bottom-sheet", className),
2350
+ onPointerDownOutside: (e) => {
2351
+ const target = e.target;
2352
+ if (target.closest(".kds-bottom-sheet")) e.preventDefault();
2353
+ },
2354
+ children: [
2355
+ showGrabber && /* @__PURE__ */ jsx37("div", { className: "kds-bottom-sheet-grabber", "aria-hidden": "true" }),
2356
+ showCloseButton && /* @__PURE__ */ jsx37(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ jsx37(
2357
+ "button",
2358
+ {
2359
+ type: "button",
2360
+ className: "kds-bottom-sheet-close",
2361
+ "aria-label": "Cerrar",
2362
+ children: /* @__PURE__ */ jsx37("i", { className: "material-symbols-outlined", children: "close" })
2363
+ }
2364
+ ) }),
2365
+ title && /* @__PURE__ */ jsx37(Dialog2.Title, { className: "kds-bottom-sheet-title", children: title }),
2366
+ description && /* @__PURE__ */ jsx37(Dialog2.Description, { className: "kds-bottom-sheet-description", children: description }),
2367
+ /* @__PURE__ */ jsx37("div", { className: "kds-bottom-sheet-body", children }),
2368
+ actions && /* @__PURE__ */ jsx37("div", { className: "kds-bottom-sheet-actions", children: actions })
2369
+ ]
2370
+ }
2371
+ ) }) })
2372
+ }
2373
+ )
1972
2374
  );
1973
2375
  KdsBottomSheet.displayName = "KdsBottomSheet";
1974
2376
 
1975
2377
  // src/components/domain/KdsSecureFooter/KdsSecureFooter.tsx
1976
- import { forwardRef as forwardRef34 } from "react";
1977
- import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
1978
- var KdsSecureFooter = forwardRef34(
1979
- ({ variant = "default", children, className, ...props }, ref) => /* @__PURE__ */ jsxs26("footer", { ref, className: clsx("kds-secure-footer", variant === "inside" && "inside", className), ...props, children: [
1980
- /* @__PURE__ */ jsx36("i", { className: "material-symbols-outlined", children: "lock" }),
1981
- children || /* @__PURE__ */ jsx36("span", { children: "Pago seguro con Khipu" })
2378
+ import { forwardRef as forwardRef37 } from "react";
2379
+
2380
+ // src/components/domain/KdsSecureFooter/KhipuWordmark.tsx
2381
+ import { forwardRef as forwardRef36 } from "react";
2382
+ import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
2383
+ var KhipuWordmark = forwardRef36(
2384
+ ({ className = "khipu-mark", ...props }, ref) => /* @__PURE__ */ jsxs28(
2385
+ "svg",
2386
+ {
2387
+ ref,
2388
+ viewBox: "0 0 45 15",
2389
+ role: "img",
2390
+ "aria-label": "Khipu",
2391
+ className,
2392
+ xmlns: "http://www.w3.org/2000/svg",
2393
+ ...props,
2394
+ children: [
2395
+ /* @__PURE__ */ jsx38("path", { d: "M16.6417 11.8339C16.7273 11.9196 16.8272 11.9624 16.9472 11.9624H18.9628C19.0798 11.9624 19.1826 11.9196 19.2682 11.8339C19.3539 11.7483 19.3967 11.6483 19.3967 11.5284V7.12891C19.3967 6.50081 19.3111 5.95551 19.1398 5.49586C18.9685 5.03621 18.7315 4.65937 18.4289 4.3596C18.1234 4.05983 17.758 3.83999 17.3326 3.69439C16.9043 3.55164 16.4361 3.47741 15.9251 3.47741C15.4226 3.47741 14.9801 3.58019 14.5975 3.7886C14.2121 3.99702 13.9295 4.214 13.7496 4.43668V1.03071C13.7496 0.913654 13.7068 0.810874 13.6211 0.728079C13.5355 0.642434 13.4355 0.599609 13.3185 0.599609H11.2943C11.1773 0.599609 11.0745 0.642434 10.9888 0.728079C10.9032 0.813729 10.8604 0.913654 10.8604 1.03071V11.5284C10.8604 11.6455 10.9032 11.7483 10.9888 11.8339C11.0745 11.9196 11.1744 11.9624 11.2943 11.9624H13.3099C13.427 11.9624 13.5298 11.9196 13.6126 11.8339C13.6982 11.7483 13.741 11.6483 13.741 11.5284V7.48006C13.741 7.02041 13.8495 6.65216 14.0693 6.37521C14.2892 6.09826 14.6375 5.95836 15.1171 5.95836C15.5968 5.95836 15.9479 6.09826 16.1735 6.37521C16.3961 6.65216 16.5103 7.02041 16.5103 7.48006V11.5284C16.5132 11.6483 16.556 11.7483 16.6417 11.8339Z", fill: "#8347AD" }),
2396
+ /* @__PURE__ */ jsx38("path", { d: "M23.6189 3.64014H21.6005C21.4834 3.64014 21.3806 3.68296 21.295 3.76861C21.2093 3.85426 21.1665 3.95418 21.1665 4.07124V11.5284C21.1665 11.6454 21.2093 11.7482 21.295 11.8339C21.3806 11.9195 21.4806 11.9623 21.6005 11.9623H23.6161C23.7331 11.9623 23.8359 11.9195 23.9187 11.8339C24.0044 11.7482 24.0472 11.6483 24.0472 11.5284V4.07124C24.0472 3.95418 24.0044 3.85141 23.9187 3.76861C23.8359 3.68296 23.736 3.64014 23.6189 3.64014Z", fill: "#8347AD" }),
2397
+ /* @__PURE__ */ jsx38("path", { d: "M34.1881 10.0723C34.3851 9.61264 34.4936 9.07019 34.5164 8.43924C34.5278 8.27934 34.5335 8.06239 34.5335 7.79114C34.5335 7.51994 34.5278 7.30294 34.5164 7.14309C34.4936 6.51499 34.3851 5.96969 34.1881 5.51004C33.9911 5.05039 33.7313 4.67068 33.4115 4.36519C33.0918 4.05971 32.7178 3.83702 32.2924 3.69427C31.8642 3.55152 31.4131 3.47729 30.9334 3.47729C30.5823 3.47729 30.2854 3.50584 30.0455 3.5658C29.8057 3.62575 29.603 3.69998 29.4374 3.78848C29.2718 3.87984 29.1348 3.98263 29.0206 4.09968C28.9093 4.21674 28.8036 4.32808 28.7094 4.43657V4.06828C28.7094 3.95122 28.6666 3.84844 28.5809 3.7628C28.4953 3.67715 28.3954 3.63432 28.2783 3.63432H26.3426C26.2256 3.63432 26.1228 3.67715 26.0372 3.7628C25.9515 3.84844 25.9087 3.94837 25.9087 4.06828V14.566C25.9087 14.683 25.9515 14.7858 26.0372 14.8715C26.1228 14.9571 26.2227 14.9999 26.3426 14.9999H28.3583C28.4753 14.9999 28.5781 14.9571 28.6637 14.8715C28.7494 14.7858 28.7922 14.6859 28.7922 14.566V11.1629C28.8664 11.2599 28.9635 11.3627 29.0806 11.474C29.1976 11.5854 29.3432 11.691 29.5117 11.7852C29.683 11.8823 29.8857 11.9622 30.1198 12.0251C30.3539 12.0879 30.6251 12.1221 30.9363 12.1221C31.4159 12.1221 31.8699 12.0479 32.2953 11.8994C32.7206 11.751 33.0946 11.5226 33.4144 11.22C33.7313 10.9145 33.9911 10.5319 34.1881 10.0723ZM31.65 8.24794C31.6186 8.62194 31.4959 8.94739 31.2817 9.22434C31.0676 9.50129 30.7107 9.64119 30.2083 9.64119C29.9742 9.64119 29.7715 9.60404 29.6002 9.52984C29.4289 9.45559 29.289 9.35569 29.1748 9.23289C29.0634 9.11014 28.9749 8.97309 28.9121 8.82464C28.8493 8.67619 28.8065 8.52204 28.7836 8.35929C28.7608 8.19939 28.7522 8.01384 28.7522 7.79974C28.7522 7.58559 28.7637 7.40004 28.7836 7.24014C28.8036 7.08029 28.8465 6.92609 28.9121 6.77479C28.9749 6.62634 29.0634 6.48929 29.1748 6.36654C29.2861 6.24374 29.4289 6.14384 29.6002 6.06959C29.7715 5.99539 29.9742 5.95824 30.2083 5.95824C30.7107 5.95824 31.0676 6.09814 31.2817 6.37509C31.4959 6.65204 31.6186 6.97749 31.65 7.35149C31.6843 7.65124 31.6843 7.95104 31.65 8.24794Z", fill: "#8347AD" }),
2398
+ /* @__PURE__ */ jsx38("path", { d: "M41.7481 11.8339C41.8337 11.9195 41.9337 11.9623 42.0536 11.9623H43.9093C44.0264 11.9623 44.1291 11.9195 44.2119 11.8339C44.2976 11.7482 44.3404 11.6483 44.3404 11.5284V4.07124C44.3404 3.95418 44.2976 3.85141 44.2119 3.76861C44.1263 3.68296 44.0264 3.64014 43.9093 3.64014H41.8937C41.7766 3.64014 41.6739 3.68296 41.5882 3.76861C41.5026 3.85426 41.4597 3.95418 41.4597 4.07124V8.1196C41.4597 8.57925 41.3598 8.94755 41.1628 9.22445C40.9658 9.5014 40.6318 9.6413 40.1636 9.6413C39.6954 9.6413 39.3585 9.5014 39.1558 9.22445C38.9531 8.94755 38.8503 8.57925 38.8503 8.1196V4.07124C38.8503 3.95418 38.8075 3.85141 38.7218 3.76861C38.6362 3.68296 38.5363 3.64014 38.4163 3.64014H36.4007C36.2837 3.64014 36.1809 3.68296 36.0953 3.76861C36.0096 3.85426 35.9668 3.95418 35.9668 4.07124V8.47075C35.9668 9.7298 36.2723 10.6519 36.8861 11.24C37.4999 11.8282 38.325 12.1194 39.3585 12.1194C39.6897 12.1194 39.9752 12.0908 40.215 12.0309C40.4548 11.9709 40.6661 11.8967 40.8459 11.8082C41.0286 11.7168 41.18 11.6169 41.3027 11.5027C41.4255 11.3914 41.5283 11.2772 41.6139 11.1601V11.5284C41.6196 11.6483 41.6624 11.7482 41.7481 11.8339Z", fill: "#8347AD" }),
2399
+ /* @__PURE__ */ jsx38("path", { d: "M22.5569 2.78074C21.7889 2.78074 21.1665 2.1555 21.1665 1.39037C21.1665 0.622385 21.7918 0 22.5569 0C23.3249 0 23.9473 0.62524 23.9473 1.39037C23.9501 2.1555 23.3249 2.78074 22.5569 2.78074Z", fill: "#3CB4E5" }),
2400
+ /* @__PURE__ */ jsx38("path", { d: "M3.1374 7.43996V4.78198L2.34372 5.77836C2.22095 5.93256 2.21524 6.14951 2.32944 6.31226L3.1374 7.43996Z", fill: "#743CEB" }),
2401
+ /* @__PURE__ */ jsx38("path", { d: "M2.96345 0.722369C2.88351 0.642434 2.78074 0.599609 2.66368 0.599609H0.40826C0.299771 0.599609 0.205557 0.639579 0.122763 0.722369C0.0428246 0.802309 0 0.905089 0 1.02214V11.557C0 11.6655 0.0399696 11.7597 0.122763 11.8425C0.202703 11.9224 0.299771 11.9652 0.40826 11.9652H2.66368C2.78359 11.9652 2.88351 11.9253 2.96345 11.8425C3.04339 11.7625 3.08622 11.6655 3.08622 11.557V8.41081L2.83783 8.08246L2.83212 8.07676L2.82642 8.06821L1.81576 6.65216C1.55024 6.28101 1.56166 5.76996 1.84716 5.41306L2.84069 4.16261L3.08622 3.84285V1.01929C3.08622 0.902234 3.04625 0.802309 2.96345 0.722369Z", fill: "#8347AD" }),
2402
+ /* @__PURE__ */ jsx38("path", { d: "M9.60962 11.9625C9.70667 11.9625 9.78947 11.9282 9.85227 11.8568C9.91797 11.7855 9.94937 11.7084 9.94937 11.6227C9.94937 11.5371 9.92652 11.4714 9.88367 11.4286L5.89242 6.0384L9.59247 1.13642C9.63532 1.08217 9.65812 1.01651 9.65812 0.942284C9.65812 0.856634 9.62387 0.776694 9.55252 0.708174C9.50967 0.665349 9.45832 0.633944 9.40407 0.616814C9.37267 0.608249 9.33552 0.602539 9.30127 0.602539H6.73752C6.56337 0.602539 6.42632 0.636799 6.32352 0.708174C6.22077 0.779549 6.14082 0.850924 6.08942 0.928009L3.32868 4.54525L2.32944 5.80145C2.27234 5.8728 2.24094 5.95845 2.24094 6.04695C2.23808 6.13545 2.26378 6.2211 2.31802 6.2982L2.83477 7.0205L3.32868 7.70855L6.29787 11.6199C6.32927 11.6627 6.39492 11.7312 6.49197 11.8226C6.55192 11.8797 6.63472 11.9197 6.73752 11.9425C6.80032 11.9568 6.86882 11.9625 6.94592 11.9625H9.60962Z", fill: "#3CB4E5" })
2403
+ ]
2404
+ }
2405
+ )
2406
+ );
2407
+ KhipuWordmark.displayName = "KhipuWordmark";
2408
+
2409
+ // src/components/domain/KdsSecureFooter/KdsSecureFooter.tsx
2410
+ import { Fragment as Fragment3, jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
2411
+ var KdsSecureFooter = forwardRef37(
2412
+ ({ variant = "default", showLogo = true, psp, children, className, ...props }, ref) => /* @__PURE__ */ jsxs29("footer", { ref, className: clsx("kds-secure-footer", variant === "inside" && "inside", className), ...props, children: [
2413
+ /* @__PURE__ */ jsxs29("svg", { className: "kds-secure-footer-lock", viewBox: "0 0 24 24", "aria-hidden": "true", children: [
2414
+ /* @__PURE__ */ jsx39("rect", { x: "4.5", y: "10.5", width: "15", height: "10", rx: "2.25" }),
2415
+ /* @__PURE__ */ jsx39("path", { d: "M8 10.5V7a4 4 0 0 1 8 0v3.5" })
2416
+ ] }),
2417
+ children || /* @__PURE__ */ jsx39("span", { children: "Pago seguro procesado por" }),
2418
+ showLogo && /* @__PURE__ */ jsx39(KhipuWordmark, {}),
2419
+ psp && /* @__PURE__ */ jsxs29(Fragment3, { children: [
2420
+ /* @__PURE__ */ jsx39("span", { className: "kds-secure-footer-sep", "aria-hidden": "true" }),
2421
+ psp
2422
+ ] })
1982
2423
  ] })
1983
2424
  );
1984
2425
  KdsSecureFooter.displayName = "KdsSecureFooter";
1985
2426
 
1986
2427
  // src/components/domain/KdsRecapList/KdsRecapList.tsx
1987
- import { forwardRef as forwardRef35 } from "react";
1988
- import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
1989
- var KdsRecapList = forwardRef35(
1990
- ({ items, className, ...props }, ref) => /* @__PURE__ */ jsx37("ul", { ref, className: clsx("kds-recap-list", className), ...props, children: items.map((item, i) => /* @__PURE__ */ jsxs27("li", { children: [
1991
- /* @__PURE__ */ jsx37("span", { className: "k", children: item.label }),
1992
- /* @__PURE__ */ jsx37("span", { className: clsx("v", !item.value && item.placeholder && "placeholder"), children: item.value || item.placeholder || "-" })
2428
+ import { forwardRef as forwardRef38 } from "react";
2429
+ import { jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
2430
+ var KdsRecapList = forwardRef38(
2431
+ ({ items, className, ...props }, ref) => /* @__PURE__ */ jsx40("ul", { ref, className: clsx("kds-recap-list", className), ...props, children: items.map((item, i) => /* @__PURE__ */ jsxs30("li", { children: [
2432
+ /* @__PURE__ */ jsx40("span", { className: "kds-key", children: item.label }),
2433
+ /* @__PURE__ */ jsx40("span", { className: clsx("kds-value", !item.value && item.placeholder && "placeholder"), children: item.value || item.placeholder || "-" })
1993
2434
  ] }, i)) })
1994
2435
  );
1995
2436
  KdsRecapList.displayName = "KdsRecapList";
2437
+
2438
+ // src/components/domain/KdsMontoRow/KdsMontoRow.tsx
2439
+ import { forwardRef as forwardRef39 } from "react";
2440
+ import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
2441
+ var KdsMontoRow = forwardRef39(
2442
+ ({ title, value, deadline, className, ...props }, ref) => /* @__PURE__ */ jsxs31("div", { ref, className: clsx("kds-monto-row", className), ...props, children: [
2443
+ /* @__PURE__ */ jsxs31("div", { children: [
2444
+ /* @__PURE__ */ jsx41("div", { className: "kds-monto-row-title", children: title }),
2445
+ deadline && /* @__PURE__ */ jsx41("div", { className: "kds-monto-row-deadline", children: deadline })
2446
+ ] }),
2447
+ /* @__PURE__ */ jsx41("div", { className: "kds-monto-row-value", children: value })
2448
+ ] })
2449
+ );
2450
+ KdsMontoRow.displayName = "KdsMontoRow";
2451
+
2452
+ // src/components/domain/KdsMerchantTile/KdsMerchantTile.tsx
2453
+ import { forwardRef as forwardRef40 } from "react";
2454
+ import { jsx as jsx42 } from "react/jsx-runtime";
2455
+ var KdsMerchantTile = forwardRef40(
2456
+ ({ name, logoUrl, initials, compact, className, ...props }, ref) => {
2457
+ const displayInitials = (initials ?? name.slice(0, 2)).toUpperCase();
2458
+ return /* @__PURE__ */ jsx42(
2459
+ "div",
2460
+ {
2461
+ ref,
2462
+ className: clsx("kds-merchant-tile", logoUrl && "logo", compact && "compact", className),
2463
+ "aria-label": name,
2464
+ ...props,
2465
+ children: logoUrl ? /* @__PURE__ */ jsx42("img", { src: logoUrl, alt: name }) : displayInitials
2466
+ }
2467
+ );
2468
+ }
2469
+ );
2470
+ KdsMerchantTile.displayName = "KdsMerchantTile";
2471
+
2472
+ // src/components/domain/KdsInvoiceMerchant/KdsInvoiceMerchant.tsx
2473
+ import { forwardRef as forwardRef41, useState as useState8 } from "react";
2474
+ import { jsx as jsx43 } from "react/jsx-runtime";
2475
+ var KdsInvoiceMerchant = forwardRef41(
2476
+ ({ logoUrl, brandColor, className, style, ...props }, ref) => {
2477
+ const [failed, setFailed] = useState8(false);
2478
+ const showLogo = !!logoUrl && !failed;
2479
+ return /* @__PURE__ */ jsx43(
2480
+ "div",
2481
+ {
2482
+ ref,
2483
+ className: clsx("kds-invoice-merchant", className),
2484
+ "aria-hidden": "true",
2485
+ style: brandColor ? { background: brandColor, ...style } : style,
2486
+ ...props,
2487
+ children: showLogo ? /* @__PURE__ */ jsx43("img", { src: logoUrl, alt: "", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx43("i", { className: "material-symbols-outlined", children: "storefront" })
2488
+ }
2489
+ );
2490
+ }
2491
+ );
2492
+ KdsInvoiceMerchant.displayName = "KdsInvoiceMerchant";
2493
+
2494
+ // src/components/domain/KdsPaymentTotal/KdsPaymentTotal.tsx
2495
+ import { forwardRef as forwardRef42 } from "react";
2496
+ import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
2497
+ var KdsPaymentTotal = forwardRef42(
2498
+ ({
2499
+ variant = "default",
2500
+ tone = "brand",
2501
+ centered = false,
2502
+ amount,
2503
+ currency = "S/",
2504
+ decimals = 2,
2505
+ locale = "es-PE",
2506
+ label = "Monto a pagar",
2507
+ title = "Escanea el QR",
2508
+ titleMobile = "Descarga el QR",
2509
+ className,
2510
+ ...props
2511
+ }, ref) => {
2512
+ const { integer, fraction } = formatAmount(amount, decimals, locale);
2513
+ const isEmail = variant === "email";
2514
+ const isInfoTone = tone === "info";
2515
+ return /* @__PURE__ */ jsxs32(
2516
+ "div",
2517
+ {
2518
+ ref,
2519
+ className: clsx(
2520
+ "kds-payment-total",
2521
+ isEmail && "kds-payment-total--email",
2522
+ isInfoTone && "kds-payment-total--tone-info",
2523
+ centered && "kds-payment-total--centered",
2524
+ className
2525
+ ),
2526
+ ...props,
2527
+ children: [
2528
+ !isEmail && title != null && /* @__PURE__ */ jsx44("h5", { className: "kds-payment-total-title", children: title }),
2529
+ !isEmail && titleMobile != null && /* @__PURE__ */ jsx44("h5", { className: "kds-payment-total-title-mobile", children: titleMobile }),
2530
+ label != null && /* @__PURE__ */ jsx44("h6", { className: "kds-payment-label", children: label }),
2531
+ /* @__PURE__ */ jsxs32("h5", { className: "kds-payment-amount", children: [
2532
+ currency,
2533
+ " ",
2534
+ integer,
2535
+ fraction !== null && /* @__PURE__ */ jsx44("sup", { className: "kds-payment-total-decimal-sup", children: fraction })
2536
+ ] })
2537
+ ]
2538
+ }
2539
+ );
2540
+ }
2541
+ );
2542
+ KdsPaymentTotal.displayName = "KdsPaymentTotal";
2543
+ function formatAmount(amount, decimals, locale) {
2544
+ const showDecimals = typeof decimals === "number" && decimals > 0;
2545
+ if (typeof amount === "number") {
2546
+ if (showDecimals) {
2547
+ const fixed = amount.toFixed(decimals);
2548
+ const [int, frac] = fixed.split(".");
2549
+ const formattedInt2 = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
2550
+ Number(int)
2551
+ );
2552
+ return { integer: formattedInt2, fraction: frac ?? null };
2553
+ }
2554
+ const formattedInt = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
2555
+ Math.trunc(amount)
2556
+ );
2557
+ return { integer: formattedInt, fraction: null };
2558
+ }
2559
+ const str = amount.trim();
2560
+ const dotIdx = str.indexOf(".");
2561
+ if (dotIdx === -1 || !showDecimals) {
2562
+ return { integer: str, fraction: null };
2563
+ }
2564
+ return {
2565
+ integer: str.slice(0, dotIdx),
2566
+ fraction: str.slice(dotIdx + 1)
2567
+ };
2568
+ }
2569
+
2570
+ // src/components/domain/KdsBillAttachment/KdsBillAttachment.tsx
2571
+ import { forwardRef as forwardRef43 } from "react";
2572
+ import { jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
2573
+ var KdsBillAttachment = forwardRef43(
2574
+ ({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ jsxs33(
2575
+ "a",
2576
+ {
2577
+ ref,
2578
+ href,
2579
+ target: "_blank",
2580
+ rel: "noopener noreferrer",
2581
+ className: clsx("kds-bill-attachment", className),
2582
+ ...props,
2583
+ children: [
2584
+ /* @__PURE__ */ jsx45("i", { className: "material-symbols-outlined", children: icon }),
2585
+ /* @__PURE__ */ jsx45("span", { children: filename })
2586
+ ]
2587
+ }
2588
+ )
2589
+ );
2590
+ KdsBillAttachment.displayName = "KdsBillAttachment";
2591
+ var KdsBillAttachments = forwardRef43(
2592
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx45("div", { ref, className: clsx("kds-bill-attachments", className), ...props, children })
2593
+ );
2594
+ KdsBillAttachments.displayName = "KdsBillAttachments";
2595
+
2596
+ // src/components/core/hooks/useStickyInvoiceCollapse.ts
2597
+ import { useEffect as useEffect4, useRef as useRef4 } from "react";
2598
+ function useStickyInvoiceCollapse(options = {}) {
2599
+ const { onCollapseStart, collapseEnd = 20, mobileBreakpoint = 768 } = options;
2600
+ const onCollapseStartRef = useRef4(onCollapseStart);
2601
+ onCollapseStartRef.current = onCollapseStart;
2602
+ useEffect4(() => {
2603
+ let viewportOffset = 0;
2604
+ let ticking = false;
2605
+ let wasCollapsing = false;
2606
+ const isMobile = () => window.innerWidth < mobileBreakpoint;
2607
+ const closeOpenPanels = (sticky) => {
2608
+ const toggles = sticky.querySelectorAll(
2609
+ '[data-expand-toggle][aria-expanded="true"], .kds-expand-toggle[aria-expanded="true"]'
2610
+ );
2611
+ toggles.forEach((toggle) => {
2612
+ toggle.setAttribute("aria-expanded", "false");
2613
+ const panelId = toggle.getAttribute("aria-controls");
2614
+ const panel = panelId ? document.getElementById(panelId) : toggle.parentElement?.querySelector("[data-expand-panel], .kds-expand-panel");
2615
+ panel?.classList.remove("open");
2616
+ if (panel) panel.style.maxHeight = "";
2617
+ });
2618
+ };
2619
+ const apply = () => {
2620
+ ticking = false;
2621
+ const screen = document.querySelector(".kds-screen.active");
2622
+ if (!screen) return;
2623
+ const sticky = screen.querySelector(".kds-invoice-sticky");
2624
+ if (!sticky || !isMobile()) {
2625
+ screen.style.removeProperty("--collapse-progress");
2626
+ screen.style.removeProperty("--collapse-collapsible-h");
2627
+ sticky?.classList.remove("is-collapsed");
2628
+ wasCollapsing = false;
2629
+ return;
2630
+ }
2631
+ const scrollY = Math.max(window.scrollY || window.pageYOffset || 0, viewportOffset);
2632
+ const progress = Math.min(Math.max(scrollY / collapseEnd, 0), 1);
2633
+ if (!screen.style.getPropertyValue("--collapse-collapsible-h")) {
2634
+ const collapsible = sticky.querySelector(".kds-invoice-collapsible");
2635
+ if (collapsible) {
2636
+ screen.style.setProperty("--collapse-collapsible-h", `${collapsible.offsetHeight}px`);
2637
+ }
2638
+ }
2639
+ screen.style.setProperty("--collapse-progress", String(progress));
2640
+ sticky.classList.toggle("is-collapsed", progress >= 1);
2641
+ if (progress > 0) {
2642
+ if (!wasCollapsing) {
2643
+ wasCollapsing = true;
2644
+ closeOpenPanels(sticky);
2645
+ onCollapseStartRef.current?.();
2646
+ }
2647
+ } else {
2648
+ wasCollapsing = false;
2649
+ }
2650
+ };
2651
+ const onScroll = () => {
2652
+ if (ticking) return;
2653
+ ticking = true;
2654
+ window.requestAnimationFrame(apply);
2655
+ };
2656
+ const onMessage = (event) => {
2657
+ if (event.data && event.data.type === "VIEWPORT_OFFSET") {
2658
+ viewportOffset = Math.max(0, event.data.offsetTop || 0);
2659
+ onScroll();
2660
+ }
2661
+ };
2662
+ window.addEventListener("scroll", onScroll, { passive: true });
2663
+ window.addEventListener("resize", onScroll);
2664
+ window.addEventListener("message", onMessage);
2665
+ apply();
2666
+ return () => {
2667
+ window.removeEventListener("scroll", onScroll);
2668
+ window.removeEventListener("resize", onScroll);
2669
+ window.removeEventListener("message", onMessage);
2670
+ };
2671
+ }, [collapseEnd, mobileBreakpoint]);
2672
+ }
2673
+
2674
+ // src/components/core/hooks/useExpandToggle.ts
2675
+ import { useCallback as useCallback4, useId, useLayoutEffect, useRef as useRef5, useState as useState9 } from "react";
2676
+ function useExpandToggle(options = {}) {
2677
+ const { defaultOpen = false, open: controlledOpen, onOpenChange, id } = options;
2678
+ const generatedId = useId();
2679
+ const panelId = id ?? `kds-expand-${generatedId}`;
2680
+ const isControlled = controlledOpen !== void 0;
2681
+ const [uncontrolledOpen, setUncontrolledOpen] = useState9(defaultOpen);
2682
+ const open = isControlled ? controlledOpen : uncontrolledOpen;
2683
+ const panelRef = useRef5(null);
2684
+ const setPanelRef = useCallback4((node) => {
2685
+ panelRef.current = node;
2686
+ }, []);
2687
+ useLayoutEffect(() => {
2688
+ const panel = panelRef.current;
2689
+ if (!panel) return;
2690
+ panel.style.maxHeight = open ? `${panel.scrollHeight}px` : "";
2691
+ }, [open]);
2692
+ const setOpen = useCallback4(
2693
+ (next) => {
2694
+ if (!isControlled) {
2695
+ setUncontrolledOpen(next);
2696
+ }
2697
+ onOpenChange?.(next);
2698
+ },
2699
+ [isControlled, onOpenChange]
2700
+ );
2701
+ const toggle = useCallback4(() => setOpen(!open), [open, setOpen]);
2702
+ const getToggleProps = useCallback4(
2703
+ () => ({
2704
+ type: "button",
2705
+ "aria-expanded": open,
2706
+ "aria-controls": panelId,
2707
+ onClick: () => toggle()
2708
+ }),
2709
+ [open, panelId, toggle]
2710
+ );
2711
+ const getPanelProps = useCallback4(
2712
+ (baseClassName = "kds-expand-panel") => ({
2713
+ id: panelId,
2714
+ className: open ? `${baseClassName} open` : baseClassName,
2715
+ hidden: !open,
2716
+ ref: setPanelRef
2717
+ }),
2718
+ [open, panelId, setPanelRef]
2719
+ );
2720
+ return { open, setOpen, toggle, getToggleProps, getPanelProps };
2721
+ }
2722
+
2723
+ // src/components/core/hooks/useHideOnScroll.ts
2724
+ import { useEffect as useEffect5, useState as useState10 } from "react";
2725
+ function useHideOnScroll(options = {}) {
2726
+ const { threshold = 8, topOffset = 0 } = options;
2727
+ const [hidden, setHidden] = useState10(false);
2728
+ useEffect5(() => {
2729
+ let viewportOffset = 0;
2730
+ let lastY = 0;
2731
+ let ticking = false;
2732
+ const currentY = () => Math.max(window.scrollY || window.pageYOffset || 0, viewportOffset);
2733
+ const apply = () => {
2734
+ ticking = false;
2735
+ const y = currentY();
2736
+ if (y <= topOffset) {
2737
+ setHidden(false);
2738
+ lastY = y;
2739
+ return;
2740
+ }
2741
+ const delta = y - lastY;
2742
+ if (Math.abs(delta) < threshold) return;
2743
+ setHidden(delta > 0);
2744
+ lastY = y;
2745
+ };
2746
+ const onScroll = () => {
2747
+ if (ticking) return;
2748
+ ticking = true;
2749
+ window.requestAnimationFrame(apply);
2750
+ };
2751
+ const onMessage = (event) => {
2752
+ if (event.data && event.data.type === "VIEWPORT_OFFSET") {
2753
+ viewportOffset = Math.max(0, event.data.offsetTop || 0);
2754
+ onScroll();
2755
+ }
2756
+ };
2757
+ lastY = currentY();
2758
+ window.addEventListener("scroll", onScroll, { passive: true });
2759
+ window.addEventListener("resize", onScroll);
2760
+ window.addEventListener("message", onMessage);
2761
+ return () => {
2762
+ window.removeEventListener("scroll", onScroll);
2763
+ window.removeEventListener("resize", onScroll);
2764
+ window.removeEventListener("message", onMessage);
2765
+ };
2766
+ }, [threshold, topOffset]);
2767
+ return { hidden };
2768
+ }
1996
2769
  export {
1997
2770
  KdsAccordion,
1998
2771
  KdsAccordionDetails,
@@ -2001,6 +2774,8 @@ export {
2001
2774
  KdsBankList,
2002
2775
  KdsBankModal,
2003
2776
  KdsBankRow,
2777
+ KdsBillAttachment,
2778
+ KdsBillAttachments,
2004
2779
  KdsBottomSheet,
2005
2780
  KdsButton,
2006
2781
  KdsCard,
@@ -2011,24 +2786,26 @@ export {
2011
2786
  KdsCardSelector,
2012
2787
  KdsCheckbox,
2013
2788
  KdsChip,
2789
+ KdsCopyButton,
2014
2790
  KdsCopyRow,
2015
2791
  KdsCopyableTable,
2016
2792
  KdsCountdown,
2017
2793
  KdsDivider,
2018
2794
  KdsExpandPanel,
2795
+ KdsFab,
2796
+ KdsInvoiceMerchant,
2019
2797
  KdsInvoiceSticky,
2020
2798
  KdsLinearProgress,
2021
- KdsLogoHeader,
2022
- KdsLogoHeaderCloseButton,
2023
- KdsLogoHeaderCode,
2024
- KdsLogoHeaderLogo,
2025
- KdsLogoHeaderSeparator,
2026
- KdsModal,
2799
+ KdsMerchantTile,
2800
+ KdsMontoRow,
2801
+ KdsPaymentTotal,
2027
2802
  KdsQrRow,
2028
2803
  KdsRadioGroup,
2029
2804
  KdsRecapList,
2805
+ KdsSearchField,
2030
2806
  KdsSectionNote,
2031
2807
  KdsSecureFooter,
2808
+ KdsSecureLoader,
2032
2809
  KdsSegmentedTabs,
2033
2810
  KdsSelect,
2034
2811
  KdsSnackbar,
@@ -2050,6 +2827,7 @@ export {
2050
2827
  fontFamilies,
2051
2828
  fontSizes,
2052
2829
  fontWeights,
2830
+ formatDateTime,
2053
2831
  getContrastColor,
2054
2832
  letterSpacings,
2055
2833
  lighten,
@@ -2064,6 +2842,9 @@ export {
2064
2842
  useAutoHide,
2065
2843
  useCopyToClipboard,
2066
2844
  useCountdown,
2845
+ useExpandToggle,
2846
+ useHideOnScroll,
2847
+ useStickyInvoiceCollapse,
2067
2848
  useTabsKeyboard,
2068
2849
  zIndex
2069
2850
  };