@khipu/design-system 0.2.0-alpha.5 → 0.2.0-alpha.50

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
@@ -347,6 +347,8 @@ var semanticColors = {
347
347
  // From Figma: warning/light
348
348
  dark: "#E65100",
349
349
  // From Figma: warning/dark
350
+ warm: "#8A6D1A",
351
+ // Warm/olive variant for header icons (LigoPay handoff v2)
350
352
  container: "#FFFBEB",
351
353
  // Light amber background for chips/badges
352
354
  contrastText: "#FFFFFF"
@@ -365,6 +367,8 @@ var semanticColors = {
365
367
  main: "#0288D1",
366
368
  light: "#03A9F4",
367
369
  dark: "#01579B",
370
+ blue: "#5A5FE0",
371
+ // Khipu-blue / LigoPay informational blue (distinct from cyan main)
368
372
  container: "#EFF6FF",
369
373
  // Light blue background for chips/badges
370
374
  contrastText: "#FFFFFF"
@@ -407,8 +411,10 @@ var fontSizes = {
407
411
  // 24px
408
412
  "3xl": "1.875rem",
409
413
  // 30px
410
- "4xl": "2.25rem"
414
+ "4xl": "2.25rem",
411
415
  // 36px
416
+ decimalSup: "0.5em"
417
+ // Relative size for decimal superscript in amount displays
412
418
  };
413
419
  var lineHeights = {
414
420
  tight: 1.2,
@@ -1040,7 +1046,7 @@ var KdsButton = forwardRef(
1040
1046
  children: [
1041
1047
  !loading && startIcon && /* @__PURE__ */ jsx2("span", { className: "kds-icon", children: /* @__PURE__ */ jsx2("i", { className: "material-symbols-outlined", children: startIcon }) }),
1042
1048
  loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
1043
- /* @__PURE__ */ jsx2("span", { className: "loader small" }),
1049
+ /* @__PURE__ */ jsx2("progress", { className: "circle indeterminate small" }),
1044
1050
  /* @__PURE__ */ jsx2("span", { children })
1045
1051
  ] }) : /* @__PURE__ */ jsx2("span", { children }),
1046
1052
  !loading && endIcon && /* @__PURE__ */ jsx2("span", { className: "kds-icon", children: /* @__PURE__ */ jsx2("i", { className: "material-symbols-outlined", children: endIcon }) })
@@ -1051,7 +1057,7 @@ var KdsButton = forwardRef(
1051
1057
  KdsButton.displayName = "KdsButton";
1052
1058
 
1053
1059
  // src/components/core/KdsTextField/KdsTextField.tsx
1054
- import { forwardRef as forwardRef2 } from "react";
1060
+ import { forwardRef as forwardRef2, useState } from "react";
1055
1061
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
1056
1062
  var KdsTextField = forwardRef2(
1057
1063
  ({
@@ -1062,11 +1068,27 @@ var KdsTextField = forwardRef2(
1062
1068
  readOnly,
1063
1069
  startIcon,
1064
1070
  endIcon,
1071
+ required,
1065
1072
  className,
1066
1073
  id,
1074
+ type,
1075
+ revealable,
1076
+ revealLabel = "Mostrar u ocultar contrase\xF1a",
1077
+ requiredMark = true,
1067
1078
  ...props
1068
1079
  }, ref) => {
1080
+ const [revealed, setRevealed] = useState(false);
1069
1081
  const fieldId = id || `kds-field-${label.toLowerCase().replace(/\s+/g, "-")}`;
1082
+ const isRevealable = !!revealable && !readOnly && !props.disabled;
1083
+ const inputType = isRevealable ? revealed ? "text" : "password" : type;
1084
+ const hasSuffix = !!endIcon || readOnly || isRevealable;
1085
+ const toggleReveal = () => setRevealed((v) => !v);
1086
+ const onToggleKeyDown = (e) => {
1087
+ if (e.key === "Enter" || e.key === " ") {
1088
+ e.preventDefault();
1089
+ toggleReveal();
1090
+ }
1091
+ };
1070
1092
  return /* @__PURE__ */ jsxs2(
1071
1093
  "div",
1072
1094
  {
@@ -1074,6 +1096,8 @@ var KdsTextField = forwardRef2(
1074
1096
  "field",
1075
1097
  "label",
1076
1098
  "border",
1099
+ startIcon && "prefix",
1100
+ hasSuffix && "suffix",
1077
1101
  error && "invalid",
1078
1102
  readOnly && "locked",
1079
1103
  fullWidth && "kds-w-full",
@@ -1086,14 +1110,32 @@ var KdsTextField = forwardRef2(
1086
1110
  {
1087
1111
  ref,
1088
1112
  id: fieldId,
1089
- placeholder: " ",
1113
+ type: inputType,
1090
1114
  readOnly,
1091
- ...props
1115
+ required,
1116
+ ...props,
1117
+ placeholder: " "
1092
1118
  }
1093
1119
  ),
1094
- /* @__PURE__ */ jsx3("label", { htmlFor: fieldId, children: label }),
1120
+ /* @__PURE__ */ jsxs2("label", { htmlFor: fieldId, children: [
1121
+ label,
1122
+ required && requiredMark && " *"
1123
+ ] }),
1095
1124
  readOnly && /* @__PURE__ */ jsx3("i", { className: "material-symbols-outlined", children: "lock" }),
1096
- endIcon && !readOnly && /* @__PURE__ */ jsx3("i", { className: "material-symbols-outlined", children: endIcon }),
1125
+ isRevealable && /* @__PURE__ */ jsx3(
1126
+ "a",
1127
+ {
1128
+ className: "kds-field-reveal",
1129
+ role: "button",
1130
+ tabIndex: 0,
1131
+ "aria-label": revealLabel,
1132
+ "aria-pressed": revealed,
1133
+ onClick: toggleReveal,
1134
+ onKeyDown: onToggleKeyDown,
1135
+ children: /* @__PURE__ */ jsx3("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: revealed ? "visibility" : "visibility_off" })
1136
+ }
1137
+ ),
1138
+ endIcon && !readOnly && !isRevealable && /* @__PURE__ */ jsx3("i", { className: "material-symbols-outlined", children: endIcon }),
1097
1139
  helperText && /* @__PURE__ */ jsx3("span", { className: "helper", children: helperText })
1098
1140
  ]
1099
1141
  }
@@ -1106,78 +1148,18 @@ KdsTextField.displayName = "KdsTextField";
1106
1148
  import { forwardRef as forwardRef3 } from "react";
1107
1149
  import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1108
1150
  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 })
1114
- ] });
1115
- }
1151
+ ({ label, className, ...props }, ref) => /* @__PURE__ */ jsxs3("label", { className: clsx("checkbox", className), children: [
1152
+ /* @__PURE__ */ jsx4("input", { ref, type: "checkbox", ...props }),
1153
+ /* @__PURE__ */ jsx4("span", { children: label })
1154
+ ] })
1116
1155
  );
1117
1156
  KdsCheckbox.displayName = "KdsCheckbox";
1118
1157
 
1119
- // src/components/core/KdsModal/KdsModal.tsx
1120
- import { forwardRef as forwardRef4 } from "react";
1121
- import * as Dialog from "@radix-ui/react-dialog";
1122
- 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
- )
1173
- );
1174
- KdsModal.displayName = "KdsModal";
1175
-
1176
1158
  // src/components/core/KdsCard/KdsCard.tsx
1177
- import { forwardRef as forwardRef5 } from "react";
1178
- import { jsx as jsx6 } from "react/jsx-runtime";
1179
- var KdsCard = forwardRef5(
1180
- ({ variant = "elevated", dimmed, children, className, ...props }, ref) => /* @__PURE__ */ jsx6(
1159
+ import { forwardRef as forwardRef4 } from "react";
1160
+ import { jsx as jsx5 } from "react/jsx-runtime";
1161
+ var KdsCard = forwardRef4(
1162
+ ({ variant = "elevated", dimmed, children, className, ...props }, ref) => /* @__PURE__ */ jsx5(
1181
1163
  "article",
1182
1164
  {
1183
1165
  ref,
@@ -1192,66 +1174,177 @@ var KdsCard = forwardRef5(
1192
1174
  )
1193
1175
  );
1194
1176
  KdsCard.displayName = "KdsCard";
1195
- var KdsCardHeader = forwardRef5(
1196
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx6("div", { ref, className: clsx("kds-card-header", className), ...props, children })
1177
+ var KdsCardHeader = forwardRef4(
1178
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx5("div", { ref, className: clsx("kds-card-header", className), ...props, children })
1197
1179
  );
1198
1180
  KdsCardHeader.displayName = "KdsCardHeader";
1199
- var KdsCardBody = forwardRef5(
1200
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx6("div", { ref, className: clsx("kds-card-body", className), ...props, children })
1181
+ var KdsCardBody = forwardRef4(
1182
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx5("div", { ref, className: clsx("kds-card-body", className), ...props, children })
1201
1183
  );
1202
1184
  KdsCardBody.displayName = "KdsCardBody";
1203
- var KdsCardFooter = forwardRef5(
1204
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx6("div", { ref, className: clsx("kds-card-footer", className), ...props, children })
1185
+ var KdsCardFooter = forwardRef4(
1186
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx5("div", { ref, className: clsx("kds-card-footer", className), ...props, children })
1205
1187
  );
1206
1188
  KdsCardFooter.displayName = "KdsCardFooter";
1207
1189
 
1208
1190
  // src/components/core/KdsSpinner/KdsSpinner.tsx
1191
+ import { forwardRef as forwardRef5 } from "react";
1192
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
1193
+ var SIZE_CLASS = {
1194
+ small: "small",
1195
+ medium: null,
1196
+ large: "large"
1197
+ };
1198
+ var KdsSpinner = forwardRef5(
1199
+ ({ size = "medium", label, className, ...props }, ref) => {
1200
+ const sizeClass = SIZE_CLASS[size];
1201
+ return /* @__PURE__ */ jsxs4(
1202
+ "div",
1203
+ {
1204
+ ref,
1205
+ className: clsx("kds-flex kds-flex-col kds-items-center kds-gap-2", className),
1206
+ role: "status",
1207
+ ...props,
1208
+ children: [
1209
+ /* @__PURE__ */ jsx6("progress", { className: clsx("circle indeterminate", sizeClass) }),
1210
+ label && /* @__PURE__ */ jsx6("span", { className: "kds-text-body-small kds-text-muted", children: label }),
1211
+ !label && /* @__PURE__ */ jsx6("span", { className: "kds-hidden", children: "Cargando" })
1212
+ ]
1213
+ }
1214
+ );
1215
+ }
1216
+ );
1217
+ KdsSpinner.displayName = "KdsSpinner";
1218
+
1219
+ // src/components/core/KdsSecureLoader/KdsSecureLoader.tsx
1209
1220
  import { forwardRef as forwardRef6 } from "react";
1210
1221
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1211
- 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" })
1222
+ var KdsSecureLoader = forwardRef6(
1223
+ ({ title, message, className, ...props }, ref) => /* @__PURE__ */ jsxs5("div", { ref, className: clsx("kds-secure-loader", className), role: "status", "aria-busy": "true", ...props, children: [
1224
+ (title || message) && /* @__PURE__ */ jsxs5("div", { className: "kds-secure-loader-text", children: [
1225
+ title && /* @__PURE__ */ jsx7("p", { className: "kds-secure-loader-title", children: title }),
1226
+ message && /* @__PURE__ */ jsx7("p", { className: "kds-secure-loader-message", children: message })
1227
+ ] }),
1228
+ /* @__PURE__ */ jsxs5("div", { className: "kds-secure-loader-spinner", children: [
1229
+ /* @__PURE__ */ jsx7(
1230
+ "svg",
1231
+ {
1232
+ className: "kds-secure-loader-ring",
1233
+ viewBox: "22 22 44 44",
1234
+ width: "100",
1235
+ height: "100",
1236
+ fill: "none",
1237
+ "aria-hidden": "true",
1238
+ children: /* @__PURE__ */ jsx7("circle", { cx: "44", cy: "44", r: "20.2", fill: "none" })
1239
+ }
1240
+ ),
1241
+ /* @__PURE__ */ jsx7("i", { className: "material-symbols-outlined kds-secure-loader-lock", "aria-hidden": "true", children: "lock" })
1242
+ ] })
1216
1243
  ] })
1217
1244
  );
1218
- KdsSpinner.displayName = "KdsSpinner";
1245
+ KdsSecureLoader.displayName = "KdsSecureLoader";
1219
1246
 
1220
- // src/components/core/KdsLinearProgress/KdsLinearProgress.tsx
1247
+ // src/components/core/KdsCopyButton/KdsCopyButton.tsx
1221
1248
  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 })
1249
+
1250
+ // src/components/core/hooks/useCopyToClipboard.ts
1251
+ import { useState as useState2, useCallback } from "react";
1252
+ function useCopyToClipboard(resetMs = 1200) {
1253
+ const [copied, setCopied] = useState2(false);
1254
+ const copy = useCallback(
1255
+ async (text) => {
1256
+ try {
1257
+ await navigator.clipboard.writeText(text);
1258
+ setCopied(true);
1259
+ setTimeout(() => setCopied(false), resetMs);
1260
+ } catch {
1261
+ }
1262
+ },
1263
+ [resetMs]
1264
+ );
1265
+ return { copied, copy };
1266
+ }
1267
+
1268
+ // src/components/core/KdsCopyButton/KdsCopyButton.tsx
1269
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1270
+ var KdsCopyButton = forwardRef7(
1271
+ ({ value, copiedText = "Copiado", className, ...props }, ref) => {
1272
+ const { copied, copy } = useCopyToClipboard();
1273
+ return /* @__PURE__ */ jsxs6(
1274
+ "button",
1275
+ {
1276
+ ref,
1277
+ type: "button",
1278
+ className: clsx("kds-copy-button", copied && "copied", className),
1279
+ onClick: () => copy(value),
1280
+ "aria-label": `Copiar: ${value}`,
1281
+ ...props,
1282
+ children: [
1283
+ /* @__PURE__ */ jsxs6("span", { className: "kds-copy-button-label", children: [
1284
+ /* @__PURE__ */ jsx8("span", { className: "kds-copy-button-value", "aria-hidden": copied || void 0, children: value }),
1285
+ /* @__PURE__ */ jsx8("span", { className: "kds-copy-button-copied", "aria-hidden": !copied || void 0, children: copiedText })
1286
+ ] }),
1287
+ /* @__PURE__ */ jsx8("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: copied ? "check" : "content_copy" })
1288
+ ]
1289
+ }
1290
+ );
1291
+ }
1292
+ );
1293
+ KdsCopyButton.displayName = "KdsCopyButton";
1294
+
1295
+ // src/components/core/KdsLinearProgress/KdsLinearProgress.tsx
1296
+ import { forwardRef as forwardRef8 } from "react";
1297
+ import { jsx as jsx9 } from "react/jsx-runtime";
1298
+ var KdsLinearProgress = forwardRef8(
1299
+ ({ value, max = 100, className, ...props }, ref) => /* @__PURE__ */ jsx9("progress", { ref, className: clsx("kds-progress", className), value, max, ...props })
1225
1300
  );
1226
1301
  KdsLinearProgress.displayName = "KdsLinearProgress";
1227
1302
 
1228
1303
  // 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
- )
1304
+ import { forwardRef as forwardRef9 } from "react";
1305
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
1306
+ var DEFAULT_ICONS = {
1307
+ success: "check_circle",
1308
+ info: "info",
1309
+ warning: "warning",
1310
+ error: "error"
1311
+ };
1312
+ var KdsAlert = forwardRef9(
1313
+ ({ severity, title, icon, inline, onClose, children, className, ...props }, ref) => {
1314
+ const resolvedIcon = icon === false ? null : typeof icon === "string" ? icon : DEFAULT_ICONS[severity];
1315
+ return /* @__PURE__ */ jsxs7(
1316
+ "div",
1317
+ {
1318
+ ref,
1319
+ role: "alert",
1320
+ className: clsx("kds-alert", `kds-${severity}`, inline && "kds-alert-inline", className),
1321
+ ...props,
1322
+ children: [
1323
+ resolvedIcon && /* @__PURE__ */ jsx10("div", { className: "kds-alert-icon", children: /* @__PURE__ */ jsx10("i", { className: "material-symbols-outlined", children: resolvedIcon }) }),
1324
+ /* @__PURE__ */ jsxs7("div", { className: "kds-alert-content", children: [
1325
+ title && /* @__PURE__ */ jsx10("p", { className: "kds-alert-title", children: title }),
1326
+ /* @__PURE__ */ jsx10("p", { className: "kds-alert-description", children })
1327
+ ] }),
1328
+ onClose && /* @__PURE__ */ jsx10(
1329
+ "button",
1330
+ {
1331
+ type: "button",
1332
+ className: "kds-alert-close",
1333
+ onClick: onClose,
1334
+ "aria-label": "Cerrar",
1335
+ children: /* @__PURE__ */ jsx10("i", { className: "material-symbols-outlined", children: "close" })
1336
+ }
1337
+ )
1338
+ ]
1339
+ }
1340
+ );
1341
+ }
1249
1342
  );
1250
1343
  KdsAlert.displayName = "KdsAlert";
1251
1344
 
1252
1345
  // src/components/core/KdsTypography/KdsTypography.tsx
1253
- import { forwardRef as forwardRef9 } from "react";
1254
- import { jsx as jsx10 } from "react/jsx-runtime";
1346
+ import { forwardRef as forwardRef10 } from "react";
1347
+ import { jsx as jsx11 } from "react/jsx-runtime";
1255
1348
  var variantTag = {
1256
1349
  display1: "h1",
1257
1350
  display2: "h2",
@@ -1264,12 +1357,13 @@ var variantTag = {
1264
1357
  label: "span",
1265
1358
  "label-small": "span",
1266
1359
  muted: "p",
1267
- link: "span"
1360
+ link: "span",
1361
+ strong: "span"
1268
1362
  };
1269
- var KdsTypography = forwardRef9(
1363
+ var KdsTypography = forwardRef10(
1270
1364
  ({ variant = "body", color, as, children, className, ...props }, ref) => {
1271
1365
  const Tag = as || variantTag[variant];
1272
- return /* @__PURE__ */ jsx10(
1366
+ return /* @__PURE__ */ jsx11(
1273
1367
  Tag,
1274
1368
  {
1275
1369
  ref,
@@ -1287,12 +1381,12 @@ var KdsTypography = forwardRef9(
1287
1381
  KdsTypography.displayName = "KdsTypography";
1288
1382
 
1289
1383
  // src/components/core/KdsTabs/KdsTabs.tsx
1290
- import React10, { forwardRef as forwardRef10, Children, useMemo } from "react";
1384
+ import React11, { forwardRef as forwardRef11, Children, useMemo } from "react";
1291
1385
 
1292
1386
  // src/components/core/hooks/useTabsKeyboard.ts
1293
- import { useCallback } from "react";
1387
+ import { useCallback as useCallback2 } from "react";
1294
1388
  function useTabsKeyboard(tabCount, activeIndex, onChange) {
1295
- const onKeyDown = useCallback(
1389
+ const onKeyDown = useCallback2(
1296
1390
  (e) => {
1297
1391
  let next = activeIndex;
1298
1392
  if (e.key === "ArrowRight") next = (activeIndex + 1) % tabCount;
@@ -1312,31 +1406,31 @@ function useTabsKeyboard(tabCount, activeIndex, onChange) {
1312
1406
  }
1313
1407
 
1314
1408
  // 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) => {
1409
+ import { jsx as jsx12 } from "react/jsx-runtime";
1410
+ var KdsTabs = forwardRef11(
1411
+ ({ activeIndex, onChange, children, className, style, ...props }, ref) => {
1318
1412
  const tabCount = Children.count(children);
1319
1413
  const { onKeyDown } = useTabsKeyboard(tabCount, activeIndex, onChange);
1320
- const mergedStyle = useMemo(() => {
1321
- if (variant !== "segmented") return style;
1322
- return {
1414
+ const mergedStyle = useMemo(
1415
+ () => ({
1323
1416
  ...style,
1324
1417
  "--_tab-count": tabCount,
1325
1418
  "--_active-idx": activeIndex
1326
- };
1327
- }, [variant, tabCount, activeIndex, style]);
1328
- return /* @__PURE__ */ jsx11(
1419
+ }),
1420
+ [tabCount, activeIndex, style]
1421
+ );
1422
+ return /* @__PURE__ */ jsx12(
1329
1423
  "div",
1330
1424
  {
1331
1425
  ref,
1332
1426
  role: "tablist",
1333
- className: clsx(variant === "segmented" ? "kds-segmented-tabs" : "kds-tabs", className),
1427
+ className: clsx("kds-segmented-tabs", className),
1334
1428
  style: mergedStyle,
1335
1429
  onKeyDown,
1336
1430
  ...props,
1337
1431
  children: Children.map(children, (child, i) => {
1338
- if (!React10.isValidElement(child)) return child;
1339
- return React10.cloneElement(child, {
1432
+ if (!React11.isValidElement(child)) return child;
1433
+ return React11.cloneElement(child, {
1340
1434
  _active: i === activeIndex,
1341
1435
  _onClick: () => onChange(i)
1342
1436
  });
@@ -1346,11 +1440,12 @@ var KdsTabs = forwardRef10(
1346
1440
  }
1347
1441
  );
1348
1442
  KdsTabs.displayName = "KdsTabs";
1349
- var KdsTab = forwardRef10(
1350
- ({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */ jsx11(
1443
+ var KdsTab = forwardRef11(
1444
+ ({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */ jsx12(
1351
1445
  "button",
1352
1446
  {
1353
1447
  ref,
1448
+ type: "button",
1354
1449
  role: "tab",
1355
1450
  "aria-selected": _active,
1356
1451
  tabIndex: _active ? 0 : -1,
@@ -1362,8 +1457,8 @@ var KdsTab = forwardRef10(
1362
1457
  )
1363
1458
  );
1364
1459
  KdsTab.displayName = "KdsTab";
1365
- var KdsTabPanel = forwardRef10(
1366
- ({ active, children, className, ...props }, ref) => /* @__PURE__ */ jsx11(
1460
+ var KdsTabPanel = forwardRef11(
1461
+ ({ active, children, className, ...props }, ref) => /* @__PURE__ */ jsx12(
1367
1462
  "div",
1368
1463
  {
1369
1464
  ref,
@@ -1377,102 +1472,13 @@ var KdsTabPanel = forwardRef10(
1377
1472
  );
1378
1473
  KdsTabPanel.displayName = "KdsTabPanel";
1379
1474
 
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
1475
  // src/components/core/KdsRadioGroup/KdsRadioGroup.tsx
1470
1476
  import { forwardRef as forwardRef12 } from "react";
1471
- import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
1477
+ import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
1472
1478
  var KdsRadioGroup = forwardRef12(
1473
- ({ label, name, options, value, onChange, className, ...props }, ref) => /* @__PURE__ */ jsxs7("fieldset", { ref, className: clsx("kds-radio-group", className), ...props, children: [
1479
+ ({ label, name, options, value, onChange, size, className, ...props }, ref) => /* @__PURE__ */ jsxs8("fieldset", { ref, className: clsx("kds-radio-group", className), ...props, children: [
1474
1480
  label && /* @__PURE__ */ jsx13("legend", { children: label }),
1475
- options.map((opt) => /* @__PURE__ */ jsxs7("label", { className: "field", children: [
1481
+ options.map((opt) => /* @__PURE__ */ jsxs8("label", { className: clsx("radio", size), children: [
1476
1482
  /* @__PURE__ */ jsx13(
1477
1483
  "input",
1478
1484
  {
@@ -1492,64 +1498,83 @@ KdsRadioGroup.displayName = "KdsRadioGroup";
1492
1498
 
1493
1499
  // src/components/core/KdsSelect/KdsSelect.tsx
1494
1500
  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(
1501
+ import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
1502
+ var KdsSelect = forwardRef13(
1498
1503
  ({
1499
- value,
1500
- onValueChange,
1501
- placeholder,
1502
1504
  label,
1503
- error,
1505
+ options,
1506
+ placeholder,
1504
1507
  helperText,
1505
- disabled,
1508
+ error,
1509
+ prefixIcon,
1506
1510
  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" }) })
1511
+ disabled,
1512
+ required,
1513
+ className,
1514
+ id,
1515
+ ...props
1516
+ }, ref) => {
1517
+ const fieldId = id || `kds-select-${label.toLowerCase().replace(/\s+/g, "-")}`;
1518
+ return /* @__PURE__ */ jsxs9(
1519
+ "div",
1520
+ {
1521
+ className: clsx(
1522
+ "field",
1523
+ "label",
1524
+ "border",
1525
+ prefixIcon && "prefix",
1526
+ error && "invalid",
1527
+ fullWidth && "kds-w-full",
1528
+ className
1529
+ ),
1530
+ children: [
1531
+ prefixIcon && /* @__PURE__ */ jsx14("i", { className: "material-symbols-outlined", children: prefixIcon }),
1532
+ /* @__PURE__ */ jsxs9(
1533
+ "select",
1534
+ {
1535
+ ref,
1536
+ id: fieldId,
1537
+ disabled,
1538
+ required,
1539
+ ...props,
1540
+ children: [
1541
+ placeholder !== void 0 && /* @__PURE__ */ jsx14("option", { value: "", children: placeholder }),
1542
+ options.map((opt) => /* @__PURE__ */ jsx14("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value))
1543
+ ]
1544
+ }
1545
+ ),
1546
+ /* @__PURE__ */ jsxs9("label", { htmlFor: fieldId, children: [
1547
+ label,
1548
+ required && " *"
1525
1549
  ] }),
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
- ] })
1550
+ helperText && /* @__PURE__ */ jsx14("span", { className: "helper", children: helperText })
1551
+ ]
1552
+ }
1553
+ );
1554
+ }
1539
1555
  );
1540
- KdsSelectItem.displayName = "KdsSelect.Item";
1541
- var KdsSelect = Object.assign(KdsSelectRoot, {
1542
- Item: KdsSelectItem
1543
- });
1556
+ KdsSelect.displayName = "KdsSelect";
1544
1557
 
1545
1558
  // src/components/core/KdsChip/KdsChip.tsx
1546
1559
  import { forwardRef as forwardRef14 } from "react";
1547
- import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
1560
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
1548
1561
  var KdsChip = forwardRef14(
1549
- ({ color, icon, onDelete, children, className, ...props }, ref) => /* @__PURE__ */ jsxs9("span", { ref, className: clsx("kds-badge", color, className), ...props, children: [
1562
+ ({ color, icon, onDelete, children, className, ...props }, ref) => /* @__PURE__ */ jsxs10("span", { ref, className: clsx("kds-badge", color, className), ...props, children: [
1550
1563
  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" }) })
1564
+ /* @__PURE__ */ jsx15("span", { children }),
1565
+ onDelete && /* @__PURE__ */ jsx15(
1566
+ "button",
1567
+ {
1568
+ type: "button",
1569
+ className: "kds-badge-close",
1570
+ onClick: (e) => {
1571
+ e.stopPropagation();
1572
+ onDelete();
1573
+ },
1574
+ "aria-label": "Eliminar",
1575
+ children: /* @__PURE__ */ jsx15("i", { className: "material-symbols-outlined", children: "close" })
1576
+ }
1577
+ )
1553
1578
  ] })
1554
1579
  );
1555
1580
  KdsChip.displayName = "KdsChip";
@@ -1558,9 +1583,9 @@ KdsChip.displayName = "KdsChip";
1558
1583
  import { forwardRef as forwardRef15 } from "react";
1559
1584
 
1560
1585
  // src/components/core/hooks/useAutoHide.ts
1561
- import { useState, useEffect, useRef } from "react";
1586
+ import { useState as useState3, useEffect, useRef } from "react";
1562
1587
  function useAutoHide(durationMs, onHide) {
1563
- const [visible, setVisible] = useState(true);
1588
+ const [visible, setVisible] = useState3(true);
1564
1589
  const onHideRef = useRef(onHide);
1565
1590
  onHideRef.current = onHide;
1566
1591
  useEffect(() => {
@@ -1575,22 +1600,61 @@ function useAutoHide(durationMs, onHide) {
1575
1600
  }
1576
1601
 
1577
1602
  // src/components/core/KdsSnackbar/KdsSnackbar.tsx
1578
- import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
1603
+ import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
1604
+ var DEFAULT_ICONS2 = {
1605
+ info: "info",
1606
+ success: "check_circle",
1607
+ error: "error"
1608
+ };
1579
1609
  var KdsSnackbar = forwardRef15(
1580
- ({ message, type, duration = 5e3, onClose, open = true, className, ...props }, ref) => {
1581
- const { visible } = useAutoHide(duration, onClose);
1610
+ ({
1611
+ message,
1612
+ type = "info",
1613
+ duration = 5e3,
1614
+ onClose,
1615
+ open = true,
1616
+ icon,
1617
+ className,
1618
+ style,
1619
+ ...props
1620
+ }, ref) => {
1621
+ const autoDismiss = duration > 0;
1622
+ const { visible } = useAutoHide(autoDismiss ? duration : 0, onClose);
1582
1623
  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
- ] });
1624
+ const resolvedIcon = icon === false ? null : icon ?? DEFAULT_ICONS2[type];
1625
+ const mergedStyle = autoDismiss ? { ...style, ["--kds-snackbar-duration"]: `${duration}ms` } : style ?? {};
1626
+ return /* @__PURE__ */ jsxs11(
1627
+ "div",
1628
+ {
1629
+ ref,
1630
+ role: "status",
1631
+ className: clsx("snackbar", "active", type, className),
1632
+ "data-auto-dismiss": autoDismiss ? "true" : void 0,
1633
+ style: mergedStyle,
1634
+ ...props,
1635
+ children: [
1636
+ resolvedIcon && /* @__PURE__ */ jsx16("i", { className: "material-symbols-outlined", children: resolvedIcon }),
1637
+ /* @__PURE__ */ jsx16("span", { className: "max", children: message }),
1638
+ onClose && /* @__PURE__ */ jsx16(
1639
+ "button",
1640
+ {
1641
+ type: "button",
1642
+ className: "kds-snackbar-close",
1643
+ onClick: onClose,
1644
+ "aria-label": "Cerrar",
1645
+ children: /* @__PURE__ */ jsx16("i", { className: "material-symbols-outlined", children: "close" })
1646
+ }
1647
+ )
1648
+ ]
1649
+ }
1650
+ );
1587
1651
  }
1588
1652
  );
1589
1653
  KdsSnackbar.displayName = "KdsSnackbar";
1590
1654
 
1591
1655
  // src/components/core/KdsTooltip/KdsTooltip.tsx
1592
1656
  import * as Tooltip from "@radix-ui/react-tooltip";
1593
- import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
1657
+ import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
1594
1658
  function KdsTooltip({
1595
1659
  content,
1596
1660
  children,
@@ -1601,24 +1665,33 @@ function KdsTooltip({
1601
1665
  onOpenChange,
1602
1666
  delayDuration = 300
1603
1667
  }) {
1604
- return /* @__PURE__ */ jsx17(Tooltip.Provider, { delayDuration, children: /* @__PURE__ */ jsxs11(Tooltip.Root, { open, defaultOpen, onOpenChange, children: [
1668
+ return /* @__PURE__ */ jsx17(Tooltip.Provider, { delayDuration, children: /* @__PURE__ */ jsxs12(Tooltip.Root, { open, defaultOpen, onOpenChange, children: [
1605
1669
  /* @__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
- ] }) })
1670
+ /* @__PURE__ */ jsx17(Tooltip.Portal, { children: /* @__PURE__ */ jsxs12(
1671
+ Tooltip.Content,
1672
+ {
1673
+ className: clsx("kds-tooltip", className),
1674
+ side: placement,
1675
+ sideOffset: 6,
1676
+ collisionPadding: 8,
1677
+ children: [
1678
+ content,
1679
+ /* @__PURE__ */ jsx17(Tooltip.Arrow, { className: "kds-tooltip-arrow", width: 10, height: 5 })
1680
+ ]
1681
+ }
1682
+ ) })
1610
1683
  ] }) });
1611
1684
  }
1612
1685
 
1613
1686
  // src/components/core/KdsAccordion/KdsAccordion.tsx
1614
1687
  import { forwardRef as forwardRef16 } from "react";
1615
- import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
1688
+ import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
1616
1689
  var KdsAccordion = forwardRef16(
1617
1690
  ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx18("details", { ref, className: clsx("kds-accordion", className), ...props, children })
1618
1691
  );
1619
1692
  KdsAccordion.displayName = "KdsAccordion";
1620
1693
  var KdsAccordionSummary = forwardRef16(
1621
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsxs12("summary", { ref, className: clsx("kds-accordion-summary", className), ...props, children: [
1694
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsxs13("summary", { ref, className: clsx("kds-accordion-summary", className), ...props, children: [
1622
1695
  children,
1623
1696
  /* @__PURE__ */ jsx18("i", { className: "material-symbols-outlined", children: "expand_more" })
1624
1697
  ] })
@@ -1639,9 +1712,9 @@ KdsDivider.displayName = "KdsDivider";
1639
1712
 
1640
1713
  // src/components/core/KdsSectionNote/KdsSectionNote.tsx
1641
1714
  import { forwardRef as forwardRef18 } from "react";
1642
- import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
1715
+ import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
1643
1716
  var KdsSectionNote = forwardRef18(
1644
- ({ icon = "info", children, className, ...props }, ref) => /* @__PURE__ */ jsxs13("p", { ref, className: clsx("kds-section-note", className), ...props, children: [
1717
+ ({ icon = "info", children, className, ...props }, ref) => /* @__PURE__ */ jsxs14("p", { ref, className: clsx("kds-section-note", className), ...props, children: [
1645
1718
  /* @__PURE__ */ jsx20("i", { className: "material-symbols-outlined", children: icon }),
1646
1719
  /* @__PURE__ */ jsx20("span", { children })
1647
1720
  ] })
@@ -1650,11 +1723,11 @@ KdsSectionNote.displayName = "KdsSectionNote";
1650
1723
 
1651
1724
  // src/components/core/KdsStatusBlock/KdsStatusBlock.tsx
1652
1725
  import { forwardRef as forwardRef19 } from "react";
1653
- import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
1726
+ import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
1654
1727
  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: [
1728
+ ({ status, icon, title, description, inline, className, ...props }, ref) => /* @__PURE__ */ jsxs15("div", { ref, className: clsx("kds-status-block", inline && "inline", className), "data-status": status, ...props, children: [
1656
1729
  /* @__PURE__ */ jsx21("div", { className: "kds-status-block-icon", children: icon && /* @__PURE__ */ jsx21("i", { className: "material-symbols-outlined", children: icon }) }),
1657
- /* @__PURE__ */ jsxs14("div", { children: [
1730
+ /* @__PURE__ */ jsxs15("div", { children: [
1658
1731
  /* @__PURE__ */ jsx21("h2", { className: "kds-status-block-title", children: title }),
1659
1732
  description && /* @__PURE__ */ jsx21("p", { className: "kds-status-block-description", children: description })
1660
1733
  ] })
@@ -1664,82 +1737,214 @@ KdsStatusBlock.displayName = "KdsStatusBlock";
1664
1737
 
1665
1738
  // src/components/core/KdsStepper/KdsStepper.tsx
1666
1739
  import { forwardRef as forwardRef20 } from "react";
1667
- import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
1740
+ import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
1668
1741
  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)) })
1742
+ ({ steps, current, className, ...props }, ref) => /* @__PURE__ */ jsx22("div", { ref, className: clsx("kds-stepper", className), ...props, children: steps.map((label, i) => /* @__PURE__ */ jsxs16(
1743
+ "div",
1744
+ {
1745
+ className: clsx("kds-step", i < current && "completed", i === current && "current"),
1746
+ children: [
1747
+ /* @__PURE__ */ jsx22("div", { className: "kds-step-indicator" }),
1748
+ /* @__PURE__ */ jsx22("div", { className: "kds-step-label", children: label })
1749
+ ]
1750
+ },
1751
+ `${i}-${label}`
1752
+ )) })
1673
1753
  );
1674
1754
  KdsStepper.displayName = "KdsStepper";
1675
1755
 
1676
1756
  // src/components/core/KdsCopyRow/KdsCopyRow.tsx
1677
1757
  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
- }
1691
- },
1692
- [resetMs]
1693
- );
1694
- return { copied, copy };
1695
- }
1696
-
1697
- // src/components/core/KdsCopyRow/KdsCopyRow.tsx
1698
- import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
1758
+ import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
1699
1759
  var KdsCopyRow = forwardRef21(
1700
- ({ label, value, className, ...props }, ref) => {
1760
+ ({ label, value, copiedText = "Copiado", className, ...props }, ref) => {
1701
1761
  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
- ] });
1762
+ return /* @__PURE__ */ jsxs17(
1763
+ "button",
1764
+ {
1765
+ ref,
1766
+ type: "button",
1767
+ className: clsx("kds-copy-row", copied && "copied", className),
1768
+ "data-copy": value,
1769
+ onClick: () => copy(value),
1770
+ "aria-label": `Copiar ${label}: ${value}`,
1771
+ ...props,
1772
+ children: [
1773
+ /* @__PURE__ */ jsx23("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: "content_copy" }),
1774
+ /* @__PURE__ */ jsxs17("div", { children: [
1775
+ /* @__PURE__ */ jsx23("span", { className: "kds-copy-row-label", children: label }),
1776
+ /* @__PURE__ */ jsx23("span", { className: "kds-copy-row-value", children: value })
1777
+ ] }),
1778
+ /* @__PURE__ */ jsxs17("span", { className: "kds-copy-toast", "aria-hidden": "true", children: [
1779
+ /* @__PURE__ */ jsx23("i", { className: "material-symbols-outlined", children: "check_circle" }),
1780
+ " ",
1781
+ copiedText
1782
+ ] })
1783
+ ]
1784
+ }
1785
+ );
1707
1786
  }
1708
1787
  );
1709
1788
  KdsCopyRow.displayName = "KdsCopyRow";
1710
1789
 
1711
1790
  // 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";
1791
+ import { forwardRef as forwardRef22, useState as useState4, useRef as useRef2, useCallback as useCallback3 } from "react";
1792
+ import { Fragment as Fragment2, jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
1793
+ async function copyToClipboard(text) {
1794
+ try {
1795
+ if (navigator.clipboard?.writeText) {
1796
+ await navigator.clipboard.writeText(text);
1797
+ return true;
1798
+ }
1799
+ } catch {
1800
+ }
1801
+ const ta = document.createElement("textarea");
1802
+ ta.value = text;
1803
+ ta.style.position = "fixed";
1804
+ ta.style.opacity = "0";
1805
+ document.body.appendChild(ta);
1806
+ ta.select();
1807
+ try {
1808
+ document.execCommand("copy");
1809
+ return true;
1810
+ } catch {
1811
+ return false;
1812
+ } finally {
1813
+ document.body.removeChild(ta);
1814
+ }
1815
+ }
1816
+ var TRANSITION_MS = 300;
1714
1817
  var KdsCopyableTable = forwardRef22(
1715
- ({ rows, className, ...props }, ref) => {
1716
- const { copied, copy } = useCopyToClipboard();
1717
- const handleCopyAll = () => {
1818
+ ({
1819
+ rows,
1820
+ copyAllLabel = "Copiar todos los datos",
1821
+ copiedAllLabel = "Datos copiados",
1822
+ showCopyAll = true,
1823
+ className,
1824
+ ...props
1825
+ }, ref) => {
1826
+ const copiedTimers = useRef2(/* @__PURE__ */ new Map());
1827
+ const settlingTimers = useRef2(/* @__PURE__ */ new Map());
1828
+ const [copiedRows, setCopiedRows] = useState4(/* @__PURE__ */ new Set());
1829
+ const [settlingRows, setSettlingRows] = useState4(/* @__PURE__ */ new Set());
1830
+ const [allCopied, setAllCopied] = useState4(false);
1831
+ const markCopied = useCallback3((indexes, duration = 1500) => {
1832
+ setCopiedRows((prev) => {
1833
+ const next = new Set(prev);
1834
+ indexes.forEach((i) => next.add(i));
1835
+ return next;
1836
+ });
1837
+ indexes.forEach((i) => {
1838
+ const st = settlingTimers.current.get(i);
1839
+ if (st) {
1840
+ clearTimeout(st);
1841
+ settlingTimers.current.delete(i);
1842
+ }
1843
+ });
1844
+ setSettlingRows((prev) => {
1845
+ const next = new Set(prev);
1846
+ indexes.forEach((i) => next.delete(i));
1847
+ return next;
1848
+ });
1849
+ indexes.forEach((i) => {
1850
+ const existing = copiedTimers.current.get(i);
1851
+ if (existing) clearTimeout(existing);
1852
+ const t = setTimeout(() => {
1853
+ setCopiedRows((prev) => {
1854
+ const next = new Set(prev);
1855
+ next.delete(i);
1856
+ return next;
1857
+ });
1858
+ setSettlingRows((prev) => {
1859
+ const next = new Set(prev);
1860
+ next.add(i);
1861
+ return next;
1862
+ });
1863
+ copiedTimers.current.delete(i);
1864
+ const settlingT = setTimeout(() => {
1865
+ setSettlingRows((prev) => {
1866
+ const next = new Set(prev);
1867
+ next.delete(i);
1868
+ return next;
1869
+ });
1870
+ settlingTimers.current.delete(i);
1871
+ }, TRANSITION_MS);
1872
+ settlingTimers.current.set(i, settlingT);
1873
+ }, duration);
1874
+ copiedTimers.current.set(i, t);
1875
+ });
1876
+ }, []);
1877
+ const handleRowCopy = async (row, index) => {
1878
+ const ok = await copyToClipboard(row.copy ?? row.value);
1879
+ if (ok) markCopied([index]);
1880
+ };
1881
+ const handleCopyAll = async () => {
1718
1882
  const text = rows.map((r) => `${r.label}: ${r.value}`).join("\n");
1719
- copy(text);
1883
+ const ok = await copyToClipboard(text);
1884
+ if (ok) {
1885
+ markCopied(rows.map((_, i) => i));
1886
+ setAllCopied(true);
1887
+ setTimeout(() => setAllCopied(false), 2e3);
1888
+ }
1720
1889
  };
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
- ] })
1890
+ return /* @__PURE__ */ jsxs18(Fragment2, { children: [
1891
+ /* @__PURE__ */ jsx24("div", { ref, className: clsx("kds-copyable-table", className), ...props, children: rows.map((row, i) => /* @__PURE__ */ jsxs18(
1892
+ "div",
1893
+ {
1894
+ className: clsx(
1895
+ "kds-copyable-table-row",
1896
+ copiedRows.has(i) && "copied",
1897
+ settlingRows.has(i) && "settling"
1898
+ ),
1899
+ role: "button",
1900
+ tabIndex: 0,
1901
+ onClick: () => handleRowCopy(row, i),
1902
+ onKeyDown: (e) => {
1903
+ if (e.key === "Enter" || e.key === " ") {
1904
+ e.preventDefault();
1905
+ handleRowCopy(row, i);
1906
+ }
1907
+ },
1908
+ "aria-label": `Copiar ${row.label}: ${row.value}`,
1909
+ children: [
1910
+ /* @__PURE__ */ jsx24("span", { className: "kds-key", children: row.label }),
1911
+ /* @__PURE__ */ jsx24("span", { className: "kds-value", children: row.value })
1912
+ ]
1913
+ },
1914
+ `${row.label}-${i}`
1915
+ )) }),
1916
+ showCopyAll && /* @__PURE__ */ jsxs18(
1917
+ "button",
1918
+ {
1919
+ type: "button",
1920
+ className: clsx(
1921
+ "kds-btn",
1922
+ "kds-btn-outlined",
1923
+ "kds-btn-block",
1924
+ "kds-copy-all-btn",
1925
+ allCopied && "copied"
1926
+ ),
1927
+ onClick: handleCopyAll,
1928
+ "aria-label": allCopied ? copiedAllLabel : copyAllLabel,
1929
+ children: [
1930
+ /* @__PURE__ */ jsx24("span", { className: "kds-icon", children: /* @__PURE__ */ jsx24("i", { className: "material-symbols-outlined", children: allCopied ? "check" : "content_copy" }) }),
1931
+ /* @__PURE__ */ jsx24("span", { children: allCopied ? copiedAllLabel : copyAllLabel })
1932
+ ]
1933
+ }
1934
+ )
1730
1935
  ] });
1731
1936
  }
1732
1937
  );
1733
1938
  KdsCopyableTable.displayName = "KdsCopyableTable";
1734
1939
 
1735
1940
  // 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";
1941
+ import { forwardRef as forwardRef23, useState as useState5 } from "react";
1942
+ import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
1738
1943
  var KdsExpandPanel = forwardRef23(
1739
1944
  ({ 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(
1945
+ const [expanded, setExpanded] = useState5(defaultExpanded);
1946
+ return /* @__PURE__ */ jsxs19("div", { ref, className, ...props, children: [
1947
+ /* @__PURE__ */ jsxs19(
1743
1948
  "button",
1744
1949
  {
1745
1950
  className: "kds-expand-toggle",
@@ -1758,10 +1963,10 @@ var KdsExpandPanel = forwardRef23(
1758
1963
  KdsExpandPanel.displayName = "KdsExpandPanel";
1759
1964
 
1760
1965
  // src/components/core/KdsCountdown/KdsCountdown.tsx
1761
- import { forwardRef as forwardRef24, useEffect as useEffect3, useRef as useRef2 } from "react";
1966
+ import { forwardRef as forwardRef24, useEffect as useEffect3, useRef as useRef3 } from "react";
1762
1967
 
1763
1968
  // src/components/core/hooks/useCountdown.ts
1764
- import { useState as useState4, useEffect as useEffect2 } from "react";
1969
+ import { useState as useState6, useEffect as useEffect2 } from "react";
1765
1970
  function calcRemaining(deadline) {
1766
1971
  const diff = Math.max(0, new Date(deadline).getTime() - Date.now());
1767
1972
  const totalSeconds = Math.floor(diff / 1e3);
@@ -1774,7 +1979,7 @@ function calcRemaining(deadline) {
1774
1979
  };
1775
1980
  }
1776
1981
  function useCountdown(deadline) {
1777
- const [state, setState] = useState4(() => calcRemaining(deadline));
1982
+ const [state, setState] = useState6(() => calcRemaining(deadline));
1778
1983
  useEffect2(() => {
1779
1984
  const tick = () => setState(calcRemaining(deadline));
1780
1985
  const id = setInterval(tick, 1e3);
@@ -1784,11 +1989,11 @@ function useCountdown(deadline) {
1784
1989
  }
1785
1990
 
1786
1991
  // src/components/core/KdsCountdown/KdsCountdown.tsx
1787
- import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
1992
+ import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
1788
1993
  var KdsCountdown = forwardRef24(
1789
1994
  ({ deadline, label, onExpire, className, ...props }, ref) => {
1790
1995
  const { hours, minutes, seconds, expired, urgent } = useCountdown(deadline);
1791
- const onExpireRef = useRef2(onExpire);
1996
+ const onExpireRef = useRef3(onExpire);
1792
1997
  onExpireRef.current = onExpire;
1793
1998
  useEffect3(() => {
1794
1999
  if (expired) {
@@ -1799,9 +2004,9 @@ var KdsCountdown = forwardRef24(
1799
2004
  return null;
1800
2005
  }
1801
2006
  const pad = (n) => String(n).padStart(2, "0");
1802
- return /* @__PURE__ */ jsxs19("div", { ref, className: clsx("kds-countdown", urgent && "urgent", className), ...props, children: [
2007
+ return /* @__PURE__ */ jsxs20("div", { ref, className: clsx("kds-countdown", urgent && "urgent", className), ...props, children: [
1803
2008
  label && /* @__PURE__ */ jsx26("span", { className: "kds-countdown-label", children: label }),
1804
- /* @__PURE__ */ jsxs19("span", { className: "kds-countdown-value", children: [
2009
+ /* @__PURE__ */ jsxs20("span", { className: "kds-countdown-value", children: [
1805
2010
  pad(hours),
1806
2011
  ":",
1807
2012
  pad(minutes),
@@ -1817,15 +2022,15 @@ KdsCountdown.displayName = "KdsCountdown";
1817
2022
  import { forwardRef as forwardRef25 } from "react";
1818
2023
  import { jsx as jsx27 } from "react/jsx-runtime";
1819
2024
  var KdsSegmentedTabs = forwardRef25(
1820
- (props, ref) => /* @__PURE__ */ jsx27(KdsTabs, { ref, variant: "segmented", ...props })
2025
+ (props, ref) => /* @__PURE__ */ jsx27(KdsTabs, { ref, ...props })
1821
2026
  );
1822
2027
  KdsSegmentedTabs.displayName = "KdsSegmentedTabs";
1823
2028
 
1824
2029
  // src/components/domain/KdsBankRow/KdsBankRow.tsx
1825
2030
  import { forwardRef as forwardRef26 } from "react";
1826
- import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
2031
+ import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
1827
2032
  var KdsBankRow = forwardRef26(
1828
- ({ name, logoUrl, selected, className, ...props }, ref) => /* @__PURE__ */ jsxs20(
2033
+ ({ name, logoUrl, selected, className, ...props }, ref) => /* @__PURE__ */ jsxs21(
1829
2034
  "button",
1830
2035
  {
1831
2036
  ref,
@@ -1851,22 +2056,22 @@ var KdsBankList = forwardRef27(
1851
2056
  KdsBankList.displayName = "KdsBankList";
1852
2057
 
1853
2058
  // 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";
2059
+ import { forwardRef as forwardRef28, useState as useState7 } from "react";
2060
+ import * as Dialog from "@radix-ui/react-dialog";
2061
+ import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
1857
2062
  var KdsBankModal = forwardRef28(
1858
2063
  ({ open, onClose, title = "Selecciona tu banco", searchPlaceholder = "Buscar banco...", onSearch, children, className, container }, ref) => {
1859
- const [query, setQuery] = useState5("");
2064
+ const [query, setQuery] = useState7("");
1860
2065
  const handleSearch = (value) => {
1861
2066
  setQuery(value);
1862
2067
  onSearch?.(value);
1863
2068
  };
1864
- return /* @__PURE__ */ jsx30(Dialog2.Root, { open, onOpenChange: (o) => {
2069
+ return /* @__PURE__ */ jsx30(Dialog.Root, { open, onOpenChange: (o) => {
1865
2070
  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" }) }) })
2071
+ }, children: /* @__PURE__ */ jsx30(Dialog.Portal, { container, children: /* @__PURE__ */ jsx30(Dialog.Overlay, { className: "kds-bank-modal-scrim open", children: /* @__PURE__ */ jsxs22(Dialog.Content, { ref, className: clsx("kds-bank-modal", className), children: [
2072
+ /* @__PURE__ */ jsxs22("div", { className: "kds-bank-modal-header", children: [
2073
+ /* @__PURE__ */ jsx30(Dialog.Title, { asChild: true, children: /* @__PURE__ */ jsx30("h3", { children: title }) }),
2074
+ /* @__PURE__ */ jsx30(Dialog.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" }) }) })
1870
2075
  ] }),
1871
2076
  /* @__PURE__ */ jsx30("div", { className: "kds-bank-modal-search", children: /* @__PURE__ */ jsx30(
1872
2077
  "input",
@@ -1885,13 +2090,13 @@ KdsBankModal.displayName = "KdsBankModal";
1885
2090
 
1886
2091
  // src/components/domain/KdsQrRow/KdsQrRow.tsx
1887
2092
  import { forwardRef as forwardRef29 } from "react";
1888
- import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
2093
+ import { jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
1889
2094
  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: [
2095
+ ({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */ jsxs23("button", { ref, type: "button", className: clsx("kds-qr-row", className), ...props, children: [
1891
2096
  /* @__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 })
2097
+ /* @__PURE__ */ jsxs23("span", { className: "kds-qr-text", children: [
2098
+ /* @__PURE__ */ jsx31("span", { className: "kds-qr-title", children: name }),
2099
+ description && /* @__PURE__ */ jsx31("span", { className: "kds-qr-subtitle", children: description })
1895
2100
  ] }),
1896
2101
  badge && /* @__PURE__ */ jsx31("span", { className: "kds-qr-badge", children: badge }),
1897
2102
  /* @__PURE__ */ jsx31("i", { className: "material-symbols-outlined", children: "chevron_right" })
@@ -1901,9 +2106,9 @@ KdsQrRow.displayName = "KdsQrRow";
1901
2106
 
1902
2107
  // src/components/domain/KdsCardSelector/KdsCardSelector.tsx
1903
2108
  import { forwardRef as forwardRef30 } from "react";
1904
- import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
2109
+ import { jsx as jsx32, jsxs as jsxs24 } from "react/jsx-runtime";
1905
2110
  var KdsCardSelector = forwardRef30(
1906
- ({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */ jsxs23(
2111
+ ({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */ jsxs24(
1907
2112
  "button",
1908
2113
  {
1909
2114
  ref,
@@ -1922,24 +2127,24 @@ KdsCardSelector.displayName = "KdsCardSelector";
1922
2127
 
1923
2128
  // src/components/domain/KdsCardPlan/KdsCardPlan.tsx
1924
2129
  import { forwardRef as forwardRef31 } from "react";
1925
- import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
2130
+ import { jsx as jsx33, jsxs as jsxs25 } from "react/jsx-runtime";
1926
2131
  var KdsCardPlan = forwardRef31(
1927
- ({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */ jsxs24(
2132
+ ({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */ jsxs25(
1928
2133
  "div",
1929
2134
  {
1930
2135
  ref,
1931
2136
  className: clsx("kds-card-plan", recommended && "recommended", className),
1932
2137
  ...props,
1933
2138
  children: [
1934
- badgeText && /* @__PURE__ */ jsx33("span", { className: "kds-card-plan-badge", children: badgeText }),
1935
2139
  /* @__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: [
2140
+ /* @__PURE__ */ jsxs25("div", { className: "kds-card-plan-price", children: [
2141
+ /* @__PURE__ */ jsx33("span", { className: "kds-price", children: price }),
2142
+ period && /* @__PURE__ */ jsxs25("span", { className: "kds-price-period", children: [
1939
2143
  "/",
1940
2144
  period
1941
2145
  ] })
1942
2146
  ] }),
2147
+ badgeText && /* @__PURE__ */ jsx33("span", { className: "kds-card-plan-badge", children: badgeText }),
1943
2148
  features && features.length > 0 && /* @__PURE__ */ jsx33("ul", { className: "kds-card-plan-features", children: features.map((f, i) => /* @__PURE__ */ jsx33("li", { children: f }, i)) }),
1944
2149
  action
1945
2150
  ]
@@ -1958,25 +2163,64 @@ KdsInvoiceSticky.displayName = "KdsInvoiceSticky";
1958
2163
 
1959
2164
  // src/components/domain/KdsBottomSheet/KdsBottomSheet.tsx
1960
2165
  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";
2166
+ import * as Dialog2 from "@radix-ui/react-dialog";
2167
+ import { jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
1963
2168
  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
- ] }) }) }) })
2169
+ ({
2170
+ open,
2171
+ onClose,
2172
+ title,
2173
+ description,
2174
+ children,
2175
+ actions,
2176
+ showGrabber = true,
2177
+ showCloseButton = false,
2178
+ container,
2179
+ className
2180
+ }, ref) => /* @__PURE__ */ jsx35(
2181
+ Dialog2.Root,
2182
+ {
2183
+ open,
2184
+ onOpenChange: (o) => {
2185
+ if (!o) onClose();
2186
+ },
2187
+ children: /* @__PURE__ */ jsx35(Dialog2.Portal, { container, children: /* @__PURE__ */ jsx35(Dialog2.Overlay, { className: "kds-bottom-sheet-scrim open", children: /* @__PURE__ */ jsxs26(
2188
+ Dialog2.Content,
2189
+ {
2190
+ ref,
2191
+ className: clsx("kds-bottom-sheet", className),
2192
+ onPointerDownOutside: (e) => {
2193
+ const target = e.target;
2194
+ if (target.closest(".kds-bottom-sheet")) e.preventDefault();
2195
+ },
2196
+ children: [
2197
+ showGrabber && /* @__PURE__ */ jsx35("div", { className: "kds-bottom-sheet-grabber", "aria-hidden": "true" }),
2198
+ showCloseButton && /* @__PURE__ */ jsx35(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ jsx35(
2199
+ "button",
2200
+ {
2201
+ type: "button",
2202
+ className: "kds-bottom-sheet-close",
2203
+ "aria-label": "Cerrar",
2204
+ children: /* @__PURE__ */ jsx35("i", { className: "material-symbols-outlined", children: "close" })
2205
+ }
2206
+ ) }),
2207
+ title && /* @__PURE__ */ jsx35(Dialog2.Title, { className: "kds-bottom-sheet-title", children: title }),
2208
+ description && /* @__PURE__ */ jsx35(Dialog2.Description, { className: "kds-bottom-sheet-description", children: description }),
2209
+ /* @__PURE__ */ jsx35("div", { className: "kds-bottom-sheet-body", children }),
2210
+ actions && /* @__PURE__ */ jsx35("div", { className: "kds-bottom-sheet-actions", children: actions })
2211
+ ]
2212
+ }
2213
+ ) }) })
2214
+ }
2215
+ )
1972
2216
  );
1973
2217
  KdsBottomSheet.displayName = "KdsBottomSheet";
1974
2218
 
1975
2219
  // src/components/domain/KdsSecureFooter/KdsSecureFooter.tsx
1976
2220
  import { forwardRef as forwardRef34 } from "react";
1977
- import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
2221
+ import { jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
1978
2222
  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: [
2223
+ ({ variant = "default", children, className, ...props }, ref) => /* @__PURE__ */ jsxs27("footer", { ref, className: clsx("kds-secure-footer", variant === "inside" && "inside", className), ...props, children: [
1980
2224
  /* @__PURE__ */ jsx36("i", { className: "material-symbols-outlined", children: "lock" }),
1981
2225
  children || /* @__PURE__ */ jsx36("span", { children: "Pago seguro con Khipu" })
1982
2226
  ] })
@@ -1985,14 +2229,150 @@ KdsSecureFooter.displayName = "KdsSecureFooter";
1985
2229
 
1986
2230
  // src/components/domain/KdsRecapList/KdsRecapList.tsx
1987
2231
  import { forwardRef as forwardRef35 } from "react";
1988
- import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
2232
+ import { jsx as jsx37, jsxs as jsxs28 } from "react/jsx-runtime";
1989
2233
  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 || "-" })
2234
+ ({ items, className, ...props }, ref) => /* @__PURE__ */ jsx37("ul", { ref, className: clsx("kds-recap-list", className), ...props, children: items.map((item, i) => /* @__PURE__ */ jsxs28("li", { children: [
2235
+ /* @__PURE__ */ jsx37("span", { className: "kds-key", children: item.label }),
2236
+ /* @__PURE__ */ jsx37("span", { className: clsx("kds-value", !item.value && item.placeholder && "placeholder"), children: item.value || item.placeholder || "-" })
1993
2237
  ] }, i)) })
1994
2238
  );
1995
2239
  KdsRecapList.displayName = "KdsRecapList";
2240
+
2241
+ // src/components/domain/KdsMontoRow/KdsMontoRow.tsx
2242
+ import { forwardRef as forwardRef36 } from "react";
2243
+ import { jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
2244
+ var KdsMontoRow = forwardRef36(
2245
+ ({ title, value, deadline, className, ...props }, ref) => /* @__PURE__ */ jsxs29("div", { ref, className: clsx("kds-monto-row", className), ...props, children: [
2246
+ /* @__PURE__ */ jsxs29("div", { children: [
2247
+ /* @__PURE__ */ jsx38("div", { className: "kds-monto-row-title", children: title }),
2248
+ deadline && /* @__PURE__ */ jsx38("div", { className: "kds-monto-row-deadline", children: deadline })
2249
+ ] }),
2250
+ /* @__PURE__ */ jsx38("div", { className: "kds-monto-row-value", children: value })
2251
+ ] })
2252
+ );
2253
+ KdsMontoRow.displayName = "KdsMontoRow";
2254
+
2255
+ // src/components/domain/KdsMerchantTile/KdsMerchantTile.tsx
2256
+ import { forwardRef as forwardRef37 } from "react";
2257
+ import { jsx as jsx39 } from "react/jsx-runtime";
2258
+ var KdsMerchantTile = forwardRef37(
2259
+ ({ name, logoUrl, initials, compact, className, ...props }, ref) => {
2260
+ const displayInitials = (initials ?? name.slice(0, 2)).toUpperCase();
2261
+ return /* @__PURE__ */ jsx39(
2262
+ "div",
2263
+ {
2264
+ ref,
2265
+ className: clsx("kds-merchant-tile", logoUrl && "logo", compact && "compact", className),
2266
+ "aria-label": name,
2267
+ ...props,
2268
+ children: logoUrl ? /* @__PURE__ */ jsx39("img", { src: logoUrl, alt: name }) : displayInitials
2269
+ }
2270
+ );
2271
+ }
2272
+ );
2273
+ KdsMerchantTile.displayName = "KdsMerchantTile";
2274
+
2275
+ // src/components/domain/KdsPaymentTotal/KdsPaymentTotal.tsx
2276
+ import { forwardRef as forwardRef38 } from "react";
2277
+ import { jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
2278
+ var KdsPaymentTotal = forwardRef38(
2279
+ ({
2280
+ variant = "default",
2281
+ tone = "brand",
2282
+ centered = false,
2283
+ amount,
2284
+ currency = "S/",
2285
+ decimals = 2,
2286
+ locale = "es-PE",
2287
+ label = "Monto a pagar",
2288
+ title = "Escanea el QR",
2289
+ titleMobile = "Descarga el QR",
2290
+ className,
2291
+ ...props
2292
+ }, ref) => {
2293
+ const { integer, fraction } = formatAmount(amount, decimals, locale);
2294
+ const isEmail = variant === "email";
2295
+ const isInfoTone = tone === "info";
2296
+ return /* @__PURE__ */ jsxs30(
2297
+ "div",
2298
+ {
2299
+ ref,
2300
+ className: clsx(
2301
+ "kds-payment-total",
2302
+ isEmail && "kds-payment-total--email",
2303
+ isInfoTone && "kds-payment-total--tone-info",
2304
+ centered && "kds-payment-total--centered",
2305
+ className
2306
+ ),
2307
+ ...props,
2308
+ children: [
2309
+ !isEmail && title != null && /* @__PURE__ */ jsx40("h5", { className: "kds-payment-total-title", children: title }),
2310
+ !isEmail && titleMobile != null && /* @__PURE__ */ jsx40("h5", { className: "kds-payment-total-title-mobile", children: titleMobile }),
2311
+ label != null && /* @__PURE__ */ jsx40("h6", { className: "kds-payment-label", children: label }),
2312
+ /* @__PURE__ */ jsxs30("h5", { className: "kds-payment-amount", children: [
2313
+ currency,
2314
+ " ",
2315
+ integer,
2316
+ fraction !== null && /* @__PURE__ */ jsx40("sup", { className: "kds-payment-total-decimal-sup", children: fraction })
2317
+ ] })
2318
+ ]
2319
+ }
2320
+ );
2321
+ }
2322
+ );
2323
+ KdsPaymentTotal.displayName = "KdsPaymentTotal";
2324
+ function formatAmount(amount, decimals, locale) {
2325
+ const showDecimals = typeof decimals === "number" && decimals > 0;
2326
+ if (typeof amount === "number") {
2327
+ if (showDecimals) {
2328
+ const fixed = amount.toFixed(decimals);
2329
+ const [int, frac] = fixed.split(".");
2330
+ const formattedInt2 = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
2331
+ Number(int)
2332
+ );
2333
+ return { integer: formattedInt2, fraction: frac ?? null };
2334
+ }
2335
+ const formattedInt = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
2336
+ Math.trunc(amount)
2337
+ );
2338
+ return { integer: formattedInt, fraction: null };
2339
+ }
2340
+ const str = amount.trim();
2341
+ const dotIdx = str.indexOf(".");
2342
+ if (dotIdx === -1 || !showDecimals) {
2343
+ return { integer: str, fraction: null };
2344
+ }
2345
+ return {
2346
+ integer: str.slice(0, dotIdx),
2347
+ fraction: str.slice(dotIdx + 1)
2348
+ };
2349
+ }
2350
+
2351
+ // src/components/domain/KdsBillAttachment/KdsBillAttachment.tsx
2352
+ import { forwardRef as forwardRef39 } from "react";
2353
+ import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
2354
+ var KdsBillAttachment = forwardRef39(
2355
+ ({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ jsxs31(
2356
+ "a",
2357
+ {
2358
+ ref,
2359
+ href,
2360
+ target: "_blank",
2361
+ rel: "noopener noreferrer",
2362
+ className: clsx("kds-bill-attachment", className),
2363
+ ...props,
2364
+ children: [
2365
+ /* @__PURE__ */ jsx41("i", { className: "material-symbols-outlined", children: icon }),
2366
+ /* @__PURE__ */ jsx41("span", { children: filename })
2367
+ ]
2368
+ }
2369
+ )
2370
+ );
2371
+ KdsBillAttachment.displayName = "KdsBillAttachment";
2372
+ var KdsBillAttachments = forwardRef39(
2373
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx41("div", { ref, className: clsx("kds-bill-attachments", className), ...props, children })
2374
+ );
2375
+ KdsBillAttachments.displayName = "KdsBillAttachments";
1996
2376
  export {
1997
2377
  KdsAccordion,
1998
2378
  KdsAccordionDetails,
@@ -2001,6 +2381,8 @@ export {
2001
2381
  KdsBankList,
2002
2382
  KdsBankModal,
2003
2383
  KdsBankRow,
2384
+ KdsBillAttachment,
2385
+ KdsBillAttachments,
2004
2386
  KdsBottomSheet,
2005
2387
  KdsButton,
2006
2388
  KdsCard,
@@ -2011,6 +2393,7 @@ export {
2011
2393
  KdsCardSelector,
2012
2394
  KdsCheckbox,
2013
2395
  KdsChip,
2396
+ KdsCopyButton,
2014
2397
  KdsCopyRow,
2015
2398
  KdsCopyableTable,
2016
2399
  KdsCountdown,
@@ -2018,17 +2401,15 @@ export {
2018
2401
  KdsExpandPanel,
2019
2402
  KdsInvoiceSticky,
2020
2403
  KdsLinearProgress,
2021
- KdsLogoHeader,
2022
- KdsLogoHeaderCloseButton,
2023
- KdsLogoHeaderCode,
2024
- KdsLogoHeaderLogo,
2025
- KdsLogoHeaderSeparator,
2026
- KdsModal,
2404
+ KdsMerchantTile,
2405
+ KdsMontoRow,
2406
+ KdsPaymentTotal,
2027
2407
  KdsQrRow,
2028
2408
  KdsRadioGroup,
2029
2409
  KdsRecapList,
2030
2410
  KdsSectionNote,
2031
2411
  KdsSecureFooter,
2412
+ KdsSecureLoader,
2032
2413
  KdsSegmentedTabs,
2033
2414
  KdsSelect,
2034
2415
  KdsSnackbar,