@khipu/design-system 0.2.0-alpha.12 → 0.2.0-alpha.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -37,6 +37,8 @@ __export(index_exports, {
37
37
  KdsBankList: () => KdsBankList,
38
38
  KdsBankModal: () => KdsBankModal,
39
39
  KdsBankRow: () => KdsBankRow,
40
+ KdsBillAttachment: () => KdsBillAttachment,
41
+ KdsBillAttachments: () => KdsBillAttachments,
40
42
  KdsBottomSheet: () => KdsBottomSheet,
41
43
  KdsButton: () => KdsButton,
42
44
  KdsCard: () => KdsCard,
@@ -47,24 +49,26 @@ __export(index_exports, {
47
49
  KdsCardSelector: () => KdsCardSelector,
48
50
  KdsCheckbox: () => KdsCheckbox,
49
51
  KdsChip: () => KdsChip,
52
+ KdsCopyButton: () => KdsCopyButton,
50
53
  KdsCopyRow: () => KdsCopyRow,
51
54
  KdsCopyableTable: () => KdsCopyableTable,
52
55
  KdsCountdown: () => KdsCountdown,
53
56
  KdsDivider: () => KdsDivider,
54
57
  KdsExpandPanel: () => KdsExpandPanel,
58
+ KdsFab: () => KdsFab,
59
+ KdsInvoiceMerchant: () => KdsInvoiceMerchant,
55
60
  KdsInvoiceSticky: () => KdsInvoiceSticky,
56
61
  KdsLinearProgress: () => KdsLinearProgress,
57
- KdsLogoHeader: () => KdsLogoHeader,
58
- KdsLogoHeaderCloseButton: () => KdsLogoHeaderCloseButton,
59
- KdsLogoHeaderCode: () => KdsLogoHeaderCode,
60
- KdsLogoHeaderLogo: () => KdsLogoHeaderLogo,
61
- KdsLogoHeaderSeparator: () => KdsLogoHeaderSeparator,
62
- KdsModal: () => KdsModal,
62
+ KdsMerchantTile: () => KdsMerchantTile,
63
+ KdsMontoRow: () => KdsMontoRow,
64
+ KdsPaymentTotal: () => KdsPaymentTotal,
63
65
  KdsQrRow: () => KdsQrRow,
64
66
  KdsRadioGroup: () => KdsRadioGroup,
65
67
  KdsRecapList: () => KdsRecapList,
68
+ KdsSearchField: () => KdsSearchField,
66
69
  KdsSectionNote: () => KdsSectionNote,
67
70
  KdsSecureFooter: () => KdsSecureFooter,
71
+ KdsSecureLoader: () => KdsSecureLoader,
68
72
  KdsSegmentedTabs: () => KdsSegmentedTabs,
69
73
  KdsSelect: () => KdsSelect,
70
74
  KdsSnackbar: () => KdsSnackbar,
@@ -78,6 +82,7 @@ __export(index_exports, {
78
82
  KdsThemeProvider: () => KdsThemeProvider,
79
83
  KdsTooltip: () => KdsTooltip,
80
84
  KdsTypography: () => KdsTypography,
85
+ LIGHT_LOGO_LUMINANCE_THRESHOLD: () => LIGHT_LOGO_LUMINANCE_THRESHOLD,
81
86
  borderRadius: () => borderRadius,
82
87
  breakpoints: () => breakpoints,
83
88
  clsx: () => import_clsx.clsx,
@@ -86,10 +91,15 @@ __export(index_exports, {
86
91
  fontFamilies: () => fontFamilies,
87
92
  fontSizes: () => fontSizes,
88
93
  fontWeights: () => fontWeights,
94
+ formatDate: () => formatDate,
95
+ formatDateTime: () => formatDateTime,
96
+ formatTime: () => formatTime,
89
97
  getContrastColor: () => getContrastColor,
90
98
  letterSpacings: () => letterSpacings,
91
99
  lighten: () => lighten,
92
100
  lineHeights: () => lineHeights,
101
+ measureLogoLuminance: () => measureLogoLuminance,
102
+ pickLogoBackdrop: () => pickLogoBackdrop,
93
103
  semanticSpacing: () => semanticSpacing,
94
104
  shadows: () => shadows,
95
105
  spacing: () => spacing,
@@ -100,6 +110,10 @@ __export(index_exports, {
100
110
  useAutoHide: () => useAutoHide,
101
111
  useCopyToClipboard: () => useCopyToClipboard,
102
112
  useCountdown: () => useCountdown,
113
+ useExpandToggle: () => useExpandToggle,
114
+ useHideOnScroll: () => useHideOnScroll,
115
+ useLogoBackdrop: () => useLogoBackdrop,
116
+ useStickyInvoiceCollapse: () => useStickyInvoiceCollapse,
103
117
  useTabsKeyboard: () => useTabsKeyboard,
104
118
  zIndex: () => zIndex
105
119
  });
@@ -141,6 +155,40 @@ function lighten(hex, amount) {
141
155
  b + (255 - b) * amount
142
156
  );
143
157
  }
158
+ function formatDateTime(iso) {
159
+ if (!iso) {
160
+ return "";
161
+ }
162
+ const date = new Date(iso);
163
+ if (Number.isNaN(date.getTime())) {
164
+ return "";
165
+ }
166
+ const pad = (n) => n.toString().padStart(2, "0");
167
+ const datePart = `${pad(date.getDate())}-${pad(date.getMonth() + 1)}-${date.getFullYear()}`;
168
+ const timePart = `${pad(date.getHours())}:${pad(date.getMinutes())}`;
169
+ return `${datePart} ${timePart}`;
170
+ }
171
+ function formatDate(iso) {
172
+ if (!iso) {
173
+ return "";
174
+ }
175
+ const date = new Date(iso);
176
+ if (Number.isNaN(date.getTime())) {
177
+ return "";
178
+ }
179
+ return `${date.getDate()}-${date.getMonth() + 1}-${date.getFullYear()}`;
180
+ }
181
+ function formatTime(iso) {
182
+ if (!iso) {
183
+ return "";
184
+ }
185
+ const date = new Date(iso);
186
+ if (Number.isNaN(date.getTime())) {
187
+ return "";
188
+ }
189
+ const pad = (n) => n.toString().padStart(2, "0");
190
+ return `${pad(date.getHours())}:${pad(date.getMinutes())}`;
191
+ }
144
192
 
145
193
  // src/theme/KdsThemeProvider.tsx
146
194
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -454,6 +502,8 @@ var semanticColors = {
454
502
  // From Figma: warning/light
455
503
  dark: "#E65100",
456
504
  // From Figma: warning/dark
505
+ warm: "#8A6D1A",
506
+ // Warm/olive variant for header icons (LigoPay handoff v2)
457
507
  container: "#FFFBEB",
458
508
  // Light amber background for chips/badges
459
509
  contrastText: "#FFFFFF"
@@ -472,6 +522,8 @@ var semanticColors = {
472
522
  main: "#0288D1",
473
523
  light: "#03A9F4",
474
524
  dark: "#01579B",
525
+ blue: "#5A5FE0",
526
+ // Khipu-blue / LigoPay informational blue (distinct from cyan main)
475
527
  container: "#EFF6FF",
476
528
  // Light blue background for chips/badges
477
529
  contrastText: "#FFFFFF"
@@ -498,6 +550,8 @@ var fontWeights = {
498
550
  bold: 700
499
551
  };
500
552
  var fontSizes = {
553
+ "2xs": "0.625rem",
554
+ // 10px — tiny captions (version footer, fine print)
501
555
  xs: "0.75rem",
502
556
  // 12px
503
557
  sm: "0.875rem",
@@ -514,8 +568,10 @@ var fontSizes = {
514
568
  // 24px
515
569
  "3xl": "1.875rem",
516
570
  // 30px
517
- "4xl": "2.25rem"
571
+ "4xl": "2.25rem",
518
572
  // 36px
573
+ decimalSup: "0.5em"
574
+ // Relative size for decimal superscript in amount displays
519
575
  };
520
576
  var lineHeights = {
521
577
  tight: 1.2,
@@ -918,6 +974,8 @@ var responsiveTypography = {
918
974
  }
919
975
  };
920
976
  var responsiveBaseFontSizes = {
977
+ "2xs": { mobile: "0.5625rem", tablet: "0.625rem", desktop: "0.625rem" },
978
+ // 9px → 10px
921
979
  xs: { mobile: "0.6875rem", tablet: "0.75rem", desktop: "0.75rem" },
922
980
  // 11px → 12px
923
981
  sm: { mobile: "0.8125rem", tablet: "0.875rem", desktop: "0.875rem" },
@@ -1147,7 +1205,7 @@ var KdsButton = (0, import_react.forwardRef)(
1147
1205
  children: [
1148
1206
  !loading && startIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "kds-icon", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { className: "material-symbols-outlined", children: startIcon }) }),
1149
1207
  loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
1150
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "loader small" }),
1208
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("progress", { className: "circle indeterminate small" }),
1151
1209
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children })
1152
1210
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children }),
1153
1211
  !loading && endIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "kds-icon", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { className: "material-symbols-outlined", children: endIcon }) })
@@ -1166,14 +1224,31 @@ var KdsTextField = (0, import_react2.forwardRef)(
1166
1224
  helperText,
1167
1225
  error,
1168
1226
  fullWidth = true,
1227
+ narrow = false,
1169
1228
  readOnly,
1170
1229
  startIcon,
1171
1230
  endIcon,
1231
+ required,
1172
1232
  className,
1173
1233
  id,
1234
+ type,
1235
+ revealable,
1236
+ revealLabel = "Mostrar u ocultar contrase\xF1a",
1237
+ requiredMark = true,
1174
1238
  ...props
1175
1239
  }, ref) => {
1240
+ const [revealed, setRevealed] = (0, import_react2.useState)(false);
1176
1241
  const fieldId = id || `kds-field-${label.toLowerCase().replace(/\s+/g, "-")}`;
1242
+ const isRevealable = !!revealable && !readOnly && !props.disabled;
1243
+ const inputType = isRevealable ? revealed ? "text" : "password" : type;
1244
+ const hasSuffix = !!endIcon || readOnly || isRevealable;
1245
+ const toggleReveal = () => setRevealed((v) => !v);
1246
+ const onToggleKeyDown = (e) => {
1247
+ if (e.key === "Enter" || e.key === " ") {
1248
+ e.preventDefault();
1249
+ toggleReveal();
1250
+ }
1251
+ };
1177
1252
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1178
1253
  "div",
1179
1254
  {
@@ -1181,9 +1256,12 @@ var KdsTextField = (0, import_react2.forwardRef)(
1181
1256
  "field",
1182
1257
  "label",
1183
1258
  "border",
1259
+ startIcon && "prefix",
1260
+ hasSuffix && "suffix",
1184
1261
  error && "invalid",
1185
1262
  readOnly && "locked",
1186
- fullWidth && "kds-w-full",
1263
+ fullWidth && !narrow && "kds-w-full",
1264
+ narrow && "kds-field--narrow",
1187
1265
  className
1188
1266
  ),
1189
1267
  children: [
@@ -1193,14 +1271,32 @@ var KdsTextField = (0, import_react2.forwardRef)(
1193
1271
  {
1194
1272
  ref,
1195
1273
  id: fieldId,
1196
- placeholder: " ",
1274
+ type: inputType,
1197
1275
  readOnly,
1198
- ...props
1276
+ required,
1277
+ ...props,
1278
+ placeholder: " "
1199
1279
  }
1200
1280
  ),
1201
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: fieldId, children: label }),
1281
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { htmlFor: fieldId, children: [
1282
+ label,
1283
+ required && requiredMark && " *"
1284
+ ] }),
1202
1285
  readOnly && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "material-symbols-outlined", children: "lock" }),
1203
- endIcon && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "material-symbols-outlined", children: endIcon }),
1286
+ isRevealable && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1287
+ "a",
1288
+ {
1289
+ className: "kds-field-reveal",
1290
+ role: "button",
1291
+ tabIndex: 0,
1292
+ "aria-label": revealLabel,
1293
+ "aria-pressed": revealed,
1294
+ onClick: toggleReveal,
1295
+ onKeyDown: onToggleKeyDown,
1296
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: revealed ? "visibility" : "visibility_off" })
1297
+ }
1298
+ ),
1299
+ endIcon && !readOnly && !isRevealable && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "material-symbols-outlined", children: endIcon }),
1204
1300
  helperText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "helper", children: helperText })
1205
1301
  ]
1206
1302
  }
@@ -1209,76 +1305,41 @@ var KdsTextField = (0, import_react2.forwardRef)(
1209
1305
  );
1210
1306
  KdsTextField.displayName = "KdsTextField";
1211
1307
 
1212
- // src/components/core/KdsCheckbox/KdsCheckbox.tsx
1308
+ // src/components/core/KdsSearchField/KdsSearchField.tsx
1213
1309
  var import_react3 = require("react");
1214
1310
  var import_jsx_runtime4 = require("react/jsx-runtime");
1215
- var KdsCheckbox = (0, import_react3.forwardRef)(
1216
- ({ label, className, id, ...props }, ref) => {
1217
- const fieldId = id || `kds-cb-${label?.toLowerCase().replace(/\s+/g, "-") || "check"}`;
1218
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: (0, import_clsx.clsx)("field", className), htmlFor: fieldId, children: [
1219
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("input", { ref, type: "checkbox", id: fieldId, ...props }),
1220
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: label })
1311
+ var KdsSearchField = (0, import_react3.forwardRef)(
1312
+ ({ className, withIcon = false, ...props }, ref) => {
1313
+ const input = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1314
+ "input",
1315
+ {
1316
+ ref,
1317
+ type: "search",
1318
+ className: (0, import_clsx.clsx)("kds-search-field", className),
1319
+ ...props
1320
+ }
1321
+ );
1322
+ if (!withIcon) {
1323
+ return input;
1324
+ }
1325
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "kds-search-field-wrapper", children: [
1326
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { className: "material-symbols-outlined kds-search-field-icon", "aria-hidden": "true", children: "search" }),
1327
+ input
1221
1328
  ] });
1222
1329
  }
1223
1330
  );
1224
- KdsCheckbox.displayName = "KdsCheckbox";
1331
+ KdsSearchField.displayName = "KdsSearchField";
1225
1332
 
1226
- // src/components/core/KdsModal/KdsModal.tsx
1333
+ // src/components/core/KdsCheckbox/KdsCheckbox.tsx
1227
1334
  var import_react4 = require("react");
1228
- var Dialog = __toESM(require("@radix-ui/react-dialog"));
1229
1335
  var import_jsx_runtime5 = require("react/jsx-runtime");
1230
- var KdsModal = (0, import_react4.forwardRef)(
1231
- ({
1232
- open,
1233
- onClose,
1234
- title,
1235
- description,
1236
- footer,
1237
- children,
1238
- size = "md",
1239
- showCloseButton = true,
1240
- className
1241
- }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1242
- Dialog.Root,
1243
- {
1244
- open,
1245
- onOpenChange: (o) => {
1246
- if (!o) onClose();
1247
- },
1248
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Dialog.Portal, { children: [
1249
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Dialog.Overlay, { className: "kds-bottom-sheet-scrim" }),
1250
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1251
- Dialog.Content,
1252
- {
1253
- ref,
1254
- className: (0, import_clsx.clsx)(
1255
- "kds-bottom-sheet",
1256
- `kds-bottom-sheet-${size}`,
1257
- className
1258
- ),
1259
- children: [
1260
- title && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "kds-bottom-sheet-header", children: [
1261
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Dialog.Title, { className: "kds-bottom-sheet-title", children: title }),
1262
- showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1263
- "button",
1264
- {
1265
- className: "kds-bottom-sheet-close",
1266
- "aria-label": "Cerrar",
1267
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("i", { className: "material-symbols-outlined", children: "close" })
1268
- }
1269
- ) })
1270
- ] }),
1271
- description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Dialog.Description, { className: "kds-bottom-sheet-description", children: description }),
1272
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "kds-bottom-sheet-body", children }),
1273
- footer && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "kds-bottom-sheet-actions", children: footer })
1274
- ]
1275
- }
1276
- )
1277
- ] })
1278
- }
1279
- )
1336
+ var KdsCheckbox = (0, import_react4.forwardRef)(
1337
+ ({ label, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: (0, import_clsx.clsx)("checkbox", className), children: [
1338
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { ref, type: "checkbox", ...props }),
1339
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: label })
1340
+ ] })
1280
1341
  );
1281
- KdsModal.displayName = "KdsModal";
1342
+ KdsCheckbox.displayName = "KdsCheckbox";
1282
1343
 
1283
1344
  // src/components/core/KdsCard/KdsCard.tsx
1284
1345
  var import_react5 = require("react");
@@ -1315,50 +1376,161 @@ KdsCardFooter.displayName = "KdsCardFooter";
1315
1376
  // src/components/core/KdsSpinner/KdsSpinner.tsx
1316
1377
  var import_react6 = require("react");
1317
1378
  var import_jsx_runtime7 = require("react/jsx-runtime");
1379
+ var SIZE_CLASS = {
1380
+ small: "small",
1381
+ medium: null,
1382
+ large: "large"
1383
+ };
1318
1384
  var KdsSpinner = (0, import_react6.forwardRef)(
1319
- ({ size = "medium", label, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-flex kds-flex-col kds-items-center kds-gap-2", className), role: "status", ...props, children: [
1320
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: (0, import_clsx.clsx)("loader", size) }),
1321
- label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "kds-text-body-small kds-text-muted", children: label }),
1322
- !label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "kds-hidden", children: "Cargando" })
1323
- ] })
1385
+ ({ size = "medium", label, className, ...props }, ref) => {
1386
+ const sizeClass = SIZE_CLASS[size];
1387
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1388
+ "div",
1389
+ {
1390
+ ref,
1391
+ className: (0, import_clsx.clsx)("kds-flex kds-flex-col kds-items-center kds-gap-2", className),
1392
+ role: "status",
1393
+ ...props,
1394
+ children: [
1395
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("progress", { className: (0, import_clsx.clsx)("circle indeterminate", sizeClass) }),
1396
+ label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "kds-text-body-small kds-text-muted", children: label }),
1397
+ !label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "kds-hidden", children: "Cargando" })
1398
+ ]
1399
+ }
1400
+ );
1401
+ }
1324
1402
  );
1325
1403
  KdsSpinner.displayName = "KdsSpinner";
1326
1404
 
1327
- // src/components/core/KdsLinearProgress/KdsLinearProgress.tsx
1405
+ // src/components/core/KdsSecureLoader/KdsSecureLoader.tsx
1328
1406
  var import_react7 = require("react");
1329
1407
  var import_jsx_runtime8 = require("react/jsx-runtime");
1330
- var KdsLinearProgress = (0, import_react7.forwardRef)(
1331
- ({ value, max = 100, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("progress", { ref, className: (0, import_clsx.clsx)("kds-progress", className), value, max, ...props })
1408
+ var KdsSecureLoader = (0, import_react7.forwardRef)(
1409
+ ({ title, message, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-secure-loader", className), role: "status", "aria-busy": "true", ...props, children: [
1410
+ (title || message) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "kds-secure-loader-text", children: [
1411
+ title && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "kds-secure-loader-title", children: title }),
1412
+ message && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "kds-secure-loader-message", children: message })
1413
+ ] }),
1414
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "kds-secure-loader-spinner", children: [
1415
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1416
+ "svg",
1417
+ {
1418
+ className: "kds-secure-loader-ring",
1419
+ viewBox: "22 22 44 44",
1420
+ width: "100",
1421
+ height: "100",
1422
+ fill: "none",
1423
+ "aria-hidden": "true",
1424
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("circle", { cx: "44", cy: "44", r: "20.2", fill: "none" })
1425
+ }
1426
+ ),
1427
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("i", { className: "material-symbols-outlined kds-secure-loader-lock", "aria-hidden": "true", children: "lock" })
1428
+ ] })
1429
+ ] })
1332
1430
  );
1333
- KdsLinearProgress.displayName = "KdsLinearProgress";
1431
+ KdsSecureLoader.displayName = "KdsSecureLoader";
1334
1432
 
1335
- // src/components/core/KdsAlert/KdsAlert.tsx
1433
+ // src/components/core/KdsCopyButton/KdsCopyButton.tsx
1434
+ var import_react9 = require("react");
1435
+
1436
+ // src/components/core/hooks/useCopyToClipboard.ts
1336
1437
  var import_react8 = require("react");
1438
+ function useCopyToClipboard(resetMs = 1200) {
1439
+ const [copied, setCopied] = (0, import_react8.useState)(false);
1440
+ const copy = (0, import_react8.useCallback)(
1441
+ async (text) => {
1442
+ try {
1443
+ await navigator.clipboard.writeText(text);
1444
+ setCopied(true);
1445
+ setTimeout(() => setCopied(false), resetMs);
1446
+ } catch {
1447
+ }
1448
+ },
1449
+ [resetMs]
1450
+ );
1451
+ return { copied, copy };
1452
+ }
1453
+
1454
+ // src/components/core/KdsCopyButton/KdsCopyButton.tsx
1337
1455
  var import_jsx_runtime9 = require("react/jsx-runtime");
1338
- var KdsAlert = (0, import_react8.forwardRef)(
1339
- ({ severity, title, icon, inline, onClose, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1340
- "div",
1341
- {
1342
- ref,
1343
- role: "alert",
1344
- className: (0, import_clsx.clsx)("kds-alert", `kds-${severity}`, inline && "kds-alert-inline", className),
1345
- ...props,
1346
- children: [
1347
- icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "kds-alert-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
1348
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "kds-alert-content", children: [
1349
- title && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "kds-alert-title", children: title }),
1350
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "kds-alert-description", children })
1351
- ] }),
1352
- onClose && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: "kds-btn kds-btn-text kds-btn-sm", onClick: onClose, "aria-label": "Cerrar", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", { className: "material-symbols-outlined", children: "close" }) })
1353
- ]
1354
- }
1355
- )
1456
+ var KdsCopyButton = (0, import_react9.forwardRef)(
1457
+ ({ value, copiedText = "Copiado", className, ...props }, ref) => {
1458
+ const { copied, copy } = useCopyToClipboard();
1459
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1460
+ "button",
1461
+ {
1462
+ ref,
1463
+ type: "button",
1464
+ className: (0, import_clsx.clsx)("kds-copy-button", copied && "copied", className),
1465
+ onClick: () => copy(value),
1466
+ "aria-label": `Copiar: ${value}`,
1467
+ ...props,
1468
+ children: [
1469
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "kds-copy-button-label", children: [
1470
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "kds-copy-button-value", "aria-hidden": copied || void 0, children: value }),
1471
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "kds-copy-button-copied", "aria-hidden": !copied || void 0, children: copiedText })
1472
+ ] }),
1473
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: copied ? "check" : "content_copy" })
1474
+ ]
1475
+ }
1476
+ );
1477
+ }
1478
+ );
1479
+ KdsCopyButton.displayName = "KdsCopyButton";
1480
+
1481
+ // src/components/core/KdsLinearProgress/KdsLinearProgress.tsx
1482
+ var import_react10 = require("react");
1483
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1484
+ var KdsLinearProgress = (0, import_react10.forwardRef)(
1485
+ ({ value, max = 100, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("progress", { ref, className: (0, import_clsx.clsx)("kds-progress", className), value, max, ...props })
1486
+ );
1487
+ KdsLinearProgress.displayName = "KdsLinearProgress";
1488
+
1489
+ // src/components/core/KdsAlert/KdsAlert.tsx
1490
+ var import_react11 = require("react");
1491
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1492
+ var DEFAULT_ICONS = {
1493
+ success: "check_circle",
1494
+ info: "info",
1495
+ warning: "warning",
1496
+ error: "error"
1497
+ };
1498
+ var KdsAlert = (0, import_react11.forwardRef)(
1499
+ ({ severity, title, icon, inline, onClose, children, className, ...props }, ref) => {
1500
+ const resolvedIcon = icon === false ? null : typeof icon === "string" ? icon : DEFAULT_ICONS[severity];
1501
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1502
+ "div",
1503
+ {
1504
+ ref,
1505
+ role: "alert",
1506
+ className: (0, import_clsx.clsx)("kds-alert", `kds-${severity}`, inline && "kds-alert-inline", className),
1507
+ ...props,
1508
+ children: [
1509
+ resolvedIcon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "kds-alert-icon", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", { className: "material-symbols-outlined", children: resolvedIcon }) }),
1510
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "kds-alert-content", children: [
1511
+ title && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "kds-alert-title", children: title }),
1512
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "kds-alert-description", children })
1513
+ ] }),
1514
+ onClose && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1515
+ "button",
1516
+ {
1517
+ type: "button",
1518
+ className: "kds-alert-close",
1519
+ onClick: onClose,
1520
+ "aria-label": "Cerrar",
1521
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", { className: "material-symbols-outlined", children: "close" })
1522
+ }
1523
+ )
1524
+ ]
1525
+ }
1526
+ );
1527
+ }
1356
1528
  );
1357
1529
  KdsAlert.displayName = "KdsAlert";
1358
1530
 
1359
1531
  // src/components/core/KdsTypography/KdsTypography.tsx
1360
- var import_react9 = require("react");
1361
- var import_jsx_runtime10 = require("react/jsx-runtime");
1532
+ var import_react12 = require("react");
1533
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1362
1534
  var variantTag = {
1363
1535
  display1: "h1",
1364
1536
  display2: "h2",
@@ -1370,13 +1542,18 @@ var variantTag = {
1370
1542
  "body-small": "p",
1371
1543
  label: "span",
1372
1544
  "label-small": "span",
1545
+ "kv-label": "span",
1546
+ value: "span",
1547
+ code: "span",
1548
+ caption: "span",
1373
1549
  muted: "p",
1374
- link: "span"
1550
+ link: "span",
1551
+ strong: "span"
1375
1552
  };
1376
- var KdsTypography = (0, import_react9.forwardRef)(
1553
+ var KdsTypography = (0, import_react12.forwardRef)(
1377
1554
  ({ variant = "body", color, as, children, className, ...props }, ref) => {
1378
1555
  const Tag = as || variantTag[variant];
1379
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1556
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1380
1557
  Tag,
1381
1558
  {
1382
1559
  ref,
@@ -1394,12 +1571,12 @@ var KdsTypography = (0, import_react9.forwardRef)(
1394
1571
  KdsTypography.displayName = "KdsTypography";
1395
1572
 
1396
1573
  // src/components/core/KdsTabs/KdsTabs.tsx
1397
- var import_react11 = __toESM(require("react"));
1574
+ var import_react14 = __toESM(require("react"));
1398
1575
 
1399
1576
  // src/components/core/hooks/useTabsKeyboard.ts
1400
- var import_react10 = require("react");
1577
+ var import_react13 = require("react");
1401
1578
  function useTabsKeyboard(tabCount, activeIndex, onChange) {
1402
- const onKeyDown = (0, import_react10.useCallback)(
1579
+ const onKeyDown = (0, import_react13.useCallback)(
1403
1580
  (e) => {
1404
1581
  let next = activeIndex;
1405
1582
  if (e.key === "ArrowRight") next = (activeIndex + 1) % tabCount;
@@ -1419,31 +1596,31 @@ function useTabsKeyboard(tabCount, activeIndex, onChange) {
1419
1596
  }
1420
1597
 
1421
1598
  // src/components/core/KdsTabs/KdsTabs.tsx
1422
- var import_jsx_runtime11 = require("react/jsx-runtime");
1423
- var KdsTabs = (0, import_react11.forwardRef)(
1424
- ({ activeIndex, onChange, variant = "standard", children, className, style, ...props }, ref) => {
1425
- const tabCount = import_react11.Children.count(children);
1599
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1600
+ var KdsTabs = (0, import_react14.forwardRef)(
1601
+ ({ activeIndex, onChange, children, className, style, ...props }, ref) => {
1602
+ const tabCount = import_react14.Children.count(children);
1426
1603
  const { onKeyDown } = useTabsKeyboard(tabCount, activeIndex, onChange);
1427
- const mergedStyle = (0, import_react11.useMemo)(() => {
1428
- if (variant !== "segmented") return style;
1429
- return {
1604
+ const mergedStyle = (0, import_react14.useMemo)(
1605
+ () => ({
1430
1606
  ...style,
1431
1607
  "--_tab-count": tabCount,
1432
1608
  "--_active-idx": activeIndex
1433
- };
1434
- }, [variant, tabCount, activeIndex, style]);
1435
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1609
+ }),
1610
+ [tabCount, activeIndex, style]
1611
+ );
1612
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1436
1613
  "div",
1437
1614
  {
1438
1615
  ref,
1439
1616
  role: "tablist",
1440
- className: (0, import_clsx.clsx)(variant === "segmented" ? "kds-segmented-tabs" : "kds-tabs", className),
1617
+ className: (0, import_clsx.clsx)("kds-segmented-tabs", className),
1441
1618
  style: mergedStyle,
1442
1619
  onKeyDown,
1443
1620
  ...props,
1444
- children: import_react11.Children.map(children, (child, i) => {
1445
- if (!import_react11.default.isValidElement(child)) return child;
1446
- return import_react11.default.cloneElement(child, {
1621
+ children: import_react14.Children.map(children, (child, i) => {
1622
+ if (!import_react14.default.isValidElement(child)) return child;
1623
+ return import_react14.default.cloneElement(child, {
1447
1624
  _active: i === activeIndex,
1448
1625
  _onClick: () => onChange(i)
1449
1626
  });
@@ -1453,11 +1630,12 @@ var KdsTabs = (0, import_react11.forwardRef)(
1453
1630
  }
1454
1631
  );
1455
1632
  KdsTabs.displayName = "KdsTabs";
1456
- var KdsTab = (0, import_react11.forwardRef)(
1457
- ({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1633
+ var KdsTab = (0, import_react14.forwardRef)(
1634
+ ({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1458
1635
  "button",
1459
1636
  {
1460
1637
  ref,
1638
+ type: "button",
1461
1639
  role: "tab",
1462
1640
  "aria-selected": _active,
1463
1641
  tabIndex: _active ? 0 : -1,
@@ -1469,8 +1647,8 @@ var KdsTab = (0, import_react11.forwardRef)(
1469
1647
  )
1470
1648
  );
1471
1649
  KdsTab.displayName = "KdsTab";
1472
- var KdsTabPanel = (0, import_react11.forwardRef)(
1473
- ({ active, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1650
+ var KdsTabPanel = (0, import_react14.forwardRef)(
1651
+ ({ active, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1474
1652
  "div",
1475
1653
  {
1476
1654
  ref,
@@ -1484,220 +1662,197 @@ var KdsTabPanel = (0, import_react11.forwardRef)(
1484
1662
  );
1485
1663
  KdsTabPanel.displayName = "KdsTabPanel";
1486
1664
 
1487
- // src/components/core/KdsLogoHeader/KdsLogoHeader.tsx
1488
- var import_react12 = require("react");
1489
-
1490
- // src/assets/images/khipu-logo-color.svg
1491
- var khipu_logo_color_default = "./khipu-logo-color-TV75AKOV.svg";
1492
-
1493
- // src/components/core/KdsLogoHeader/KdsLogoHeader.tsx
1494
- var import_jsx_runtime12 = require("react/jsx-runtime");
1495
- var KhipuLogo = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1496
- "img",
1497
- {
1498
- src: khipu_logo_color_default,
1499
- alt: "Khipu",
1500
- className: "kds-logo-header-logo-img"
1501
- }
1665
+ // src/components/core/KdsRadioGroup/KdsRadioGroup.tsx
1666
+ var import_react15 = require("react");
1667
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1668
+ var KdsRadioGroup = (0, import_react15.forwardRef)(
1669
+ ({ label, name, options, value, onChange, size, variant, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1670
+ "fieldset",
1671
+ {
1672
+ ref,
1673
+ className: (0, import_clsx.clsx)("kds-radio-group", variant === "card" && "kds-radio-group--card", className),
1674
+ ...props,
1675
+ children: [
1676
+ label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("legend", { children: label }),
1677
+ options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: (0, import_clsx.clsx)("radio", size), children: [
1678
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1679
+ "input",
1680
+ {
1681
+ type: "radio",
1682
+ name,
1683
+ value: opt.value,
1684
+ checked: value === opt.value,
1685
+ disabled: opt.disabled,
1686
+ onChange: () => onChange?.(opt.value)
1687
+ }
1688
+ ),
1689
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: opt.label })
1690
+ ] }, opt.value))
1691
+ ]
1692
+ }
1693
+ )
1502
1694
  );
1503
- var KdsLogoHeaderLogo = (0, import_react12.forwardRef)(
1504
- ({ children, className, ...props }, ref) => {
1505
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1695
+ KdsRadioGroup.displayName = "KdsRadioGroup";
1696
+
1697
+ // src/components/core/KdsSelect/KdsSelect.tsx
1698
+ var import_react16 = require("react");
1699
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1700
+ var KdsSelect = (0, import_react16.forwardRef)(
1701
+ ({
1702
+ label,
1703
+ options,
1704
+ placeholder,
1705
+ helperText,
1706
+ error,
1707
+ prefixIcon,
1708
+ fullWidth = true,
1709
+ disabled,
1710
+ required,
1711
+ className,
1712
+ id,
1713
+ ...props
1714
+ }, ref) => {
1715
+ const fieldId = id || `kds-select-${label.toLowerCase().replace(/\s+/g, "-")}`;
1716
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1506
1717
  "div",
1507
1718
  {
1508
- ref,
1509
- className: (0, import_clsx.clsx)("kds-logo-header-logo", className),
1510
- ...props,
1511
- children: children || /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(KhipuLogo, {})
1512
- }
1513
- );
1514
- }
1515
- );
1516
- KdsLogoHeaderLogo.displayName = "KdsLogoHeaderLogo";
1517
- var KdsLogoHeaderSeparator = (0, import_react12.forwardRef)(
1518
- ({ children = "|", className, ...props }, ref) => {
1519
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1520
- "span",
1521
- {
1522
- ref,
1523
- className: (0, import_clsx.clsx)("kds-logo-header-separator", className),
1524
- ...props,
1525
- children
1526
- }
1527
- );
1528
- }
1529
- );
1530
- KdsLogoHeaderSeparator.displayName = "KdsLogoHeaderSeparator";
1531
- var KdsLogoHeaderCode = (0, import_react12.forwardRef)(
1532
- ({ children, className, ...props }, ref) => {
1533
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1534
- "span",
1535
- {
1536
- ref,
1537
- className: (0, import_clsx.clsx)("kds-logo-header-code", className),
1538
- ...props,
1539
- children
1719
+ className: (0, import_clsx.clsx)(
1720
+ "field",
1721
+ "label",
1722
+ "border",
1723
+ prefixIcon && "prefix",
1724
+ error && "invalid",
1725
+ fullWidth && "kds-w-full",
1726
+ className
1727
+ ),
1728
+ children: [
1729
+ prefixIcon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { className: "material-symbols-outlined", children: prefixIcon }),
1730
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1731
+ "select",
1732
+ {
1733
+ ref,
1734
+ id: fieldId,
1735
+ disabled,
1736
+ required,
1737
+ ...props,
1738
+ children: [
1739
+ placeholder !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: placeholder }),
1740
+ options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value))
1741
+ ]
1742
+ }
1743
+ ),
1744
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { htmlFor: fieldId, children: [
1745
+ label,
1746
+ required && " *"
1747
+ ] }),
1748
+ helperText && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "helper", children: helperText })
1749
+ ]
1540
1750
  }
1541
1751
  );
1542
1752
  }
1543
1753
  );
1544
- KdsLogoHeaderCode.displayName = "KdsLogoHeaderCode";
1545
- var KdsLogoHeaderCloseButton = (0, import_react12.forwardRef)(
1546
- ({ onClose, className, ...props }, ref) => {
1547
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "kds-logo-header-close-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1754
+ KdsSelect.displayName = "KdsSelect";
1755
+
1756
+ // src/components/core/KdsChip/KdsChip.tsx
1757
+ var import_react17 = require("react");
1758
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1759
+ var KdsChip = (0, import_react17.forwardRef)(
1760
+ ({ color, icon, onDelete, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { ref, className: (0, import_clsx.clsx)("kds-badge", color, className), ...props, children: [
1761
+ icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", { className: "material-symbols-outlined", children: icon }),
1762
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children }),
1763
+ onDelete && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1548
1764
  "button",
1549
1765
  {
1550
- ref,
1551
- onClick: onClose,
1552
- className: (0, import_clsx.clsx)("kds-btn kds-btn-icon", className),
1553
- "aria-label": "close",
1554
- ...props,
1555
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { className: "material-symbols-outlined", children: "close" })
1766
+ type: "button",
1767
+ className: "kds-badge-close",
1768
+ onClick: (e) => {
1769
+ e.stopPropagation();
1770
+ onDelete();
1771
+ },
1772
+ "aria-label": "Eliminar",
1773
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", { className: "material-symbols-outlined", children: "close" })
1556
1774
  }
1557
- ) });
1558
- }
1775
+ )
1776
+ ] })
1559
1777
  );
1560
- KdsLogoHeaderCloseButton.displayName = "KdsLogoHeaderCloseButton";
1561
- var KdsLogoHeader = (0, import_react12.forwardRef)(
1562
- ({ children, className, ...props }, ref) => {
1563
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1778
+ KdsChip.displayName = "KdsChip";
1779
+
1780
+ // src/components/core/KdsSnackbar/KdsSnackbar.tsx
1781
+ var import_react19 = require("react");
1782
+
1783
+ // src/components/core/hooks/useAutoHide.ts
1784
+ var import_react18 = require("react");
1785
+ function useAutoHide(durationMs, onHide) {
1786
+ const [visible, setVisible] = (0, import_react18.useState)(true);
1787
+ const onHideRef = (0, import_react18.useRef)(onHide);
1788
+ onHideRef.current = onHide;
1789
+ (0, import_react18.useEffect)(() => {
1790
+ if (durationMs <= 0) return;
1791
+ const timer = setTimeout(() => {
1792
+ setVisible(false);
1793
+ onHideRef.current?.();
1794
+ }, durationMs);
1795
+ return () => clearTimeout(timer);
1796
+ }, [durationMs]);
1797
+ return { visible, setVisible };
1798
+ }
1799
+
1800
+ // src/components/core/KdsSnackbar/KdsSnackbar.tsx
1801
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1802
+ var DEFAULT_ICONS2 = {
1803
+ info: "info",
1804
+ success: "check_circle",
1805
+ error: "error"
1806
+ };
1807
+ var KdsSnackbar = (0, import_react19.forwardRef)(
1808
+ ({
1809
+ message,
1810
+ type = "info",
1811
+ duration = 5e3,
1812
+ onClose,
1813
+ open = true,
1814
+ icon,
1815
+ className,
1816
+ style,
1817
+ ...props
1818
+ }, ref) => {
1819
+ const autoDismiss = duration > 0;
1820
+ const { visible } = useAutoHide(autoDismiss ? duration : 0, onClose);
1821
+ if (!open || !visible) return null;
1822
+ const resolvedIcon = icon === false ? null : icon ?? DEFAULT_ICONS2[type];
1823
+ const mergedStyle = autoDismiss ? { ...style, ["--kds-snackbar-duration"]: `${duration}ms` } : style ?? {};
1824
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1564
1825
  "div",
1565
1826
  {
1566
1827
  ref,
1567
- className: (0, import_clsx.clsx)("kds-brand-row", className),
1828
+ role: "status",
1829
+ className: (0, import_clsx.clsx)("snackbar", "active", type, className),
1830
+ "data-auto-dismiss": autoDismiss ? "true" : void 0,
1831
+ style: mergedStyle,
1568
1832
  ...props,
1569
- children
1833
+ children: [
1834
+ resolvedIcon && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { className: "material-symbols-outlined", children: resolvedIcon }),
1835
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "max", children: message }),
1836
+ onClose && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1837
+ "button",
1838
+ {
1839
+ type: "button",
1840
+ className: "kds-snackbar-close",
1841
+ onClick: onClose,
1842
+ "aria-label": "Cerrar",
1843
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { className: "material-symbols-outlined", children: "close" })
1844
+ }
1845
+ )
1846
+ ]
1570
1847
  }
1571
1848
  );
1572
1849
  }
1573
1850
  );
1574
- KdsLogoHeader.displayName = "KdsLogoHeader";
1575
-
1576
- // src/components/core/KdsRadioGroup/KdsRadioGroup.tsx
1577
- var import_react13 = require("react");
1578
- var import_jsx_runtime13 = require("react/jsx-runtime");
1579
- var KdsRadioGroup = (0, import_react13.forwardRef)(
1580
- ({ label, name, options, value, onChange, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("fieldset", { ref, className: (0, import_clsx.clsx)("kds-radio-group", className), ...props, children: [
1581
- label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("legend", { children: label }),
1582
- options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "field", children: [
1583
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1584
- "input",
1585
- {
1586
- type: "radio",
1587
- name,
1588
- value: opt.value,
1589
- checked: value === opt.value,
1590
- disabled: opt.disabled,
1591
- onChange: () => onChange?.(opt.value)
1592
- }
1593
- ),
1594
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: opt.label })
1595
- ] }, opt.value))
1596
- ] })
1597
- );
1598
- KdsRadioGroup.displayName = "KdsRadioGroup";
1599
-
1600
- // src/components/core/KdsSelect/KdsSelect.tsx
1601
- var import_react14 = require("react");
1602
- var Select = __toESM(require("@radix-ui/react-select"));
1603
- var import_jsx_runtime14 = require("react/jsx-runtime");
1604
- var KdsSelectRoot = (0, import_react14.forwardRef)(
1605
- ({
1606
- value,
1607
- onValueChange,
1608
- placeholder,
1609
- label,
1610
- error,
1611
- helperText,
1612
- disabled,
1613
- fullWidth = true,
1614
- children,
1615
- className
1616
- }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1617
- "div",
1618
- {
1619
- ref,
1620
- className: (0, import_clsx.clsx)(
1621
- "kds-select",
1622
- error && "kds-select-error",
1623
- fullWidth && "kds-select-full",
1624
- className
1625
- ),
1626
- children: [
1627
- label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "kds-select-label", children: label }),
1628
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Select.Root, { value, onValueChange, disabled, children: [
1629
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Select.Trigger, { className: "kds-select-trigger", children: [
1630
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Select.Value, { placeholder }),
1631
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Select.Icon, { className: "kds-select-icon", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { className: "material-symbols-outlined", children: "expand_more" }) })
1632
- ] }),
1633
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Select.Content, { className: "kds-select-content", position: "popper", sideOffset: 4, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Select.Viewport, { className: "kds-select-viewport", children }) }) })
1634
- ] }),
1635
- helperText && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: (0, import_clsx.clsx)("kds-select-helper", error && "kds-select-helper-error"), children: helperText })
1636
- ]
1637
- }
1638
- )
1639
- );
1640
- KdsSelectRoot.displayName = "KdsSelect";
1641
- var KdsSelectItem = (0, import_react14.forwardRef)(
1642
- ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Select.Item, { ref, className: (0, import_clsx.clsx)("kds-select-item", className), ...props, children: [
1643
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Select.ItemText, { children }),
1644
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Select.ItemIndicator, { className: "kds-select-item-indicator", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { className: "material-symbols-outlined", children: "check" }) })
1645
- ] })
1646
- );
1647
- KdsSelectItem.displayName = "KdsSelect.Item";
1648
- var KdsSelect = Object.assign(KdsSelectRoot, {
1649
- Item: KdsSelectItem
1650
- });
1651
-
1652
- // src/components/core/KdsChip/KdsChip.tsx
1653
- var import_react15 = require("react");
1654
- var import_jsx_runtime15 = require("react/jsx-runtime");
1655
- var KdsChip = (0, import_react15.forwardRef)(
1656
- ({ color, icon, onDelete, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { ref, className: (0, import_clsx.clsx)("kds-badge", color, className), ...props, children: [
1657
- icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { className: "material-symbols-outlined", children: icon }),
1658
- children,
1659
- onDelete && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "kds-btn kds-btn-text kds-btn-sm", onClick: onDelete, "aria-label": "Eliminar", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { className: "material-symbols-outlined", children: "close" }) })
1660
- ] })
1661
- );
1662
- KdsChip.displayName = "KdsChip";
1663
-
1664
- // src/components/core/KdsSnackbar/KdsSnackbar.tsx
1665
- var import_react17 = require("react");
1666
-
1667
- // src/components/core/hooks/useAutoHide.ts
1668
- var import_react16 = require("react");
1669
- function useAutoHide(durationMs, onHide) {
1670
- const [visible, setVisible] = (0, import_react16.useState)(true);
1671
- const onHideRef = (0, import_react16.useRef)(onHide);
1672
- onHideRef.current = onHide;
1673
- (0, import_react16.useEffect)(() => {
1674
- if (durationMs <= 0) return;
1675
- const timer = setTimeout(() => {
1676
- setVisible(false);
1677
- onHideRef.current?.();
1678
- }, durationMs);
1679
- return () => clearTimeout(timer);
1680
- }, [durationMs]);
1681
- return { visible, setVisible };
1682
- }
1683
-
1684
- // src/components/core/KdsSnackbar/KdsSnackbar.tsx
1685
- var import_jsx_runtime16 = require("react/jsx-runtime");
1686
- var KdsSnackbar = (0, import_react17.forwardRef)(
1687
- ({ message, type, duration = 5e3, onClose, open = true, className, ...props }, ref) => {
1688
- const { visible } = useAutoHide(duration, onClose);
1689
- if (!open || !visible) return null;
1690
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { ref, role: "status", className: (0, import_clsx.clsx)("snackbar", "active", type, className), ...props, children: [
1691
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: message }),
1692
- onClose && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { onClick: onClose, "aria-label": "Cerrar", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", { className: "material-symbols-outlined", children: "close" }) })
1693
- ] });
1694
- }
1695
- );
1696
- KdsSnackbar.displayName = "KdsSnackbar";
1851
+ KdsSnackbar.displayName = "KdsSnackbar";
1697
1852
 
1698
1853
  // src/components/core/KdsTooltip/KdsTooltip.tsx
1699
1854
  var Tooltip = __toESM(require("@radix-ui/react-tooltip"));
1700
- var import_jsx_runtime17 = require("react/jsx-runtime");
1855
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1701
1856
  function KdsTooltip({
1702
1857
  content,
1703
1858
  children,
@@ -1708,167 +1863,377 @@ function KdsTooltip({
1708
1863
  onOpenChange,
1709
1864
  delayDuration = 300
1710
1865
  }) {
1711
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip.Provider, { delayDuration, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Tooltip.Root, { open, defaultOpen, onOpenChange, children: [
1712
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip.Trigger, { asChild: true, children }),
1713
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Tooltip.Content, { className: (0, import_clsx.clsx)("kds-tooltip", className), side: placement, sideOffset: 4, children: [
1714
- content,
1715
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip.Arrow, { className: "kds-tooltip-arrow" })
1716
- ] }) })
1866
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Tooltip.Provider, { delayDuration, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip.Root, { open, defaultOpen, onOpenChange, children: [
1867
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Tooltip.Trigger, { asChild: true, children }),
1868
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "kds-theme-root", style: { display: "contents" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1869
+ Tooltip.Content,
1870
+ {
1871
+ className: (0, import_clsx.clsx)("kds-tooltip", className),
1872
+ side: placement,
1873
+ sideOffset: 6,
1874
+ collisionPadding: 8,
1875
+ children: [
1876
+ content,
1877
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Tooltip.Arrow, { className: "kds-tooltip-arrow", width: 10, height: 5 })
1878
+ ]
1879
+ }
1880
+ ) }) })
1717
1881
  ] }) });
1718
1882
  }
1719
1883
 
1720
1884
  // src/components/core/KdsAccordion/KdsAccordion.tsx
1721
- var import_react18 = require("react");
1722
- var import_jsx_runtime18 = require("react/jsx-runtime");
1723
- var KdsAccordion = (0, import_react18.forwardRef)(
1724
- ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("details", { ref, className: (0, import_clsx.clsx)("kds-accordion", className), ...props, children })
1885
+ var import_react20 = require("react");
1886
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1887
+ var KdsAccordion = (0, import_react20.forwardRef)(
1888
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("details", { ref, className: (0, import_clsx.clsx)("kds-accordion", className), ...props, children })
1725
1889
  );
1726
1890
  KdsAccordion.displayName = "KdsAccordion";
1727
- var KdsAccordionSummary = (0, import_react18.forwardRef)(
1728
- ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("summary", { ref, className: (0, import_clsx.clsx)("kds-accordion-summary", className), ...props, children: [
1891
+ var KdsAccordionSummary = (0, import_react20.forwardRef)(
1892
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("summary", { ref, className: (0, import_clsx.clsx)("kds-accordion-summary", className), ...props, children: [
1729
1893
  children,
1730
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", { className: "material-symbols-outlined", children: "expand_more" })
1894
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { className: "material-symbols-outlined", children: "expand_more" })
1731
1895
  ] })
1732
1896
  );
1733
1897
  KdsAccordionSummary.displayName = "KdsAccordionSummary";
1734
- var KdsAccordionDetails = (0, import_react18.forwardRef)(
1735
- ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-accordion-details", className), ...props, children })
1898
+ var KdsAccordionDetails = (0, import_react20.forwardRef)(
1899
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-accordion-details", className), ...props, children })
1736
1900
  );
1737
1901
  KdsAccordionDetails.displayName = "KdsAccordionDetails";
1738
1902
 
1739
1903
  // src/components/core/KdsDivider/KdsDivider.tsx
1740
- var import_react19 = require("react");
1741
- var import_jsx_runtime19 = require("react/jsx-runtime");
1742
- var KdsDivider = (0, import_react19.forwardRef)(
1743
- ({ dashed, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("hr", { ref, className: (0, import_clsx.clsx)(dashed ? "kds-hr-dashed" : "kds-hr", className), ...props })
1904
+ var import_react21 = require("react");
1905
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1906
+ var KdsDivider = (0, import_react21.forwardRef)(
1907
+ ({ dashed, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("hr", { ref, className: (0, import_clsx.clsx)(dashed ? "kds-hr-dashed" : "kds-hr", className), ...props })
1744
1908
  );
1745
1909
  KdsDivider.displayName = "KdsDivider";
1746
1910
 
1747
1911
  // src/components/core/KdsSectionNote/KdsSectionNote.tsx
1748
- var import_react20 = require("react");
1749
- var import_jsx_runtime20 = require("react/jsx-runtime");
1750
- var KdsSectionNote = (0, import_react20.forwardRef)(
1751
- ({ icon = "info", children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { ref, className: (0, import_clsx.clsx)("kds-section-note", className), ...props, children: [
1752
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", { className: "material-symbols-outlined", children: icon }),
1753
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children })
1912
+ var import_react22 = require("react");
1913
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1914
+ var KdsSectionNote = (0, import_react22.forwardRef)(
1915
+ ({ icon = "info", children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("p", { ref, className: (0, import_clsx.clsx)("kds-section-note", className), ...props, children: [
1916
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", { className: "material-symbols-outlined", children: icon }),
1917
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children })
1754
1918
  ] })
1755
1919
  );
1756
1920
  KdsSectionNote.displayName = "KdsSectionNote";
1757
1921
 
1758
1922
  // src/components/core/KdsStatusBlock/KdsStatusBlock.tsx
1759
- var import_react21 = require("react");
1760
- var import_jsx_runtime21 = require("react/jsx-runtime");
1761
- var KdsStatusBlock = (0, import_react21.forwardRef)(
1762
- ({ status, icon, title, description, inline, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-status-block", inline && "inline", className), "data-status": status, ...props, children: [
1763
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "kds-status-block-icon", children: icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
1764
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
1765
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className: "kds-status-block-title", children: title }),
1766
- description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "kds-status-block-description", children: description })
1923
+ var import_react23 = require("react");
1924
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1925
+ var KdsStatusBlock = (0, import_react23.forwardRef)(
1926
+ ({ status, icon, title, description, inline, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-status-block", inline && "inline", className), "data-status": status, ...props, children: [
1927
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "kds-status-block-icon", children: icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
1928
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
1929
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className: "kds-status-block-title", children: title }),
1930
+ description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "kds-status-block-description", children: description })
1767
1931
  ] })
1768
1932
  ] })
1769
1933
  );
1770
1934
  KdsStatusBlock.displayName = "KdsStatusBlock";
1771
1935
 
1772
1936
  // src/components/core/KdsStepper/KdsStepper.tsx
1773
- var import_react22 = require("react");
1774
- var import_jsx_runtime22 = require("react/jsx-runtime");
1775
- var KdsStepper = (0, import_react22.forwardRef)(
1776
- ({ steps, current, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-stepper", className), "data-steps": steps, "data-current": current, ...props, children: Array.from({ length: steps }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: (0, import_clsx.clsx)("kds-step", i < current && "completed", i === current && "current"), children: [
1777
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "kds-step-indicator", children: i < current ? "\u2713" : i + 1 }),
1778
- i < steps - 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "kds-step-line" })
1779
- ] }, i)) })
1780
- );
1781
- KdsStepper.displayName = "KdsStepper";
1782
-
1783
- // src/components/core/KdsCopyRow/KdsCopyRow.tsx
1784
1937
  var import_react24 = require("react");
1785
-
1786
- // src/components/core/hooks/useCopyToClipboard.ts
1787
- var import_react23 = require("react");
1788
- function useCopyToClipboard(resetMs = 1200) {
1789
- const [copied, setCopied] = (0, import_react23.useState)(false);
1790
- const copy = (0, import_react23.useCallback)(
1791
- async (text) => {
1792
- try {
1793
- await navigator.clipboard.writeText(text);
1794
- setCopied(true);
1795
- setTimeout(() => setCopied(false), resetMs);
1796
- } catch {
1797
- }
1938
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1939
+ var KdsStepper = (0, import_react24.forwardRef)(
1940
+ ({ steps, current, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-stepper", className), ...props, children: steps.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
1941
+ "div",
1942
+ {
1943
+ className: (0, import_clsx.clsx)("kds-step", i < current && "completed", i === current && "current"),
1944
+ children: [
1945
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "kds-step-indicator" }),
1946
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "kds-step-label", children: label })
1947
+ ]
1798
1948
  },
1799
- [resetMs]
1800
- );
1801
- return { copied, copy };
1802
- }
1949
+ `${i}-${label}`
1950
+ )) })
1951
+ );
1952
+ KdsStepper.displayName = "KdsStepper";
1803
1953
 
1804
1954
  // src/components/core/KdsCopyRow/KdsCopyRow.tsx
1805
- var import_jsx_runtime23 = require("react/jsx-runtime");
1806
- var KdsCopyRow = (0, import_react24.forwardRef)(
1807
- ({ label, value, className, ...props }, ref) => {
1955
+ var import_react25 = require("react");
1956
+ var import_jsx_runtime24 = require("react/jsx-runtime");
1957
+ var KdsCopyRow = (0, import_react25.forwardRef)(
1958
+ ({ label, value, copiedText = "Copiado", className, ...props }, ref) => {
1808
1959
  const { copied, copy } = useCopyToClipboard();
1809
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-copy-row", copied && "copied", className), ...props, children: [
1810
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "kds-copy-row-label", children: label }),
1811
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "kds-copy-row-value", children: value }),
1812
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { className: "kds-copy-row-btn", onClick: () => copy(value), "aria-label": `Copiar ${label}`, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("i", { className: "material-symbols-outlined", children: copied ? "check" : "content_copy" }) })
1813
- ] });
1960
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
1961
+ "button",
1962
+ {
1963
+ ref,
1964
+ type: "button",
1965
+ className: (0, import_clsx.clsx)("kds-copy-row", copied && "copied", className),
1966
+ "data-copy": value,
1967
+ onClick: () => copy(value),
1968
+ "aria-label": `Copiar ${label}: ${value}`,
1969
+ ...props,
1970
+ children: [
1971
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: "content_copy" }),
1972
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
1973
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kds-copy-row-label", children: label }),
1974
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kds-copy-row-value", children: value })
1975
+ ] }),
1976
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "kds-copy-toast", "aria-hidden": "true", children: [
1977
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("i", { className: "material-symbols-outlined", children: "check_circle" }),
1978
+ " ",
1979
+ copiedText
1980
+ ] })
1981
+ ]
1982
+ }
1983
+ );
1814
1984
  }
1815
1985
  );
1816
1986
  KdsCopyRow.displayName = "KdsCopyRow";
1817
1987
 
1818
1988
  // src/components/core/KdsCopyableTable/KdsCopyableTable.tsx
1819
- var import_react25 = require("react");
1820
- var import_jsx_runtime24 = require("react/jsx-runtime");
1821
- var KdsCopyableTable = (0, import_react25.forwardRef)(
1822
- ({ rows, className, ...props }, ref) => {
1823
- const { copied, copy } = useCopyToClipboard();
1824
- const handleCopyAll = () => {
1825
- const text = rows.map((r) => `${r.label}: ${r.value}`).join("\n");
1826
- copy(text);
1827
- };
1828
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
1829
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-copyable-table", className), ...props, children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "kds-copyable-table-row", children: [
1830
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kds-copyable-table-label", children: row.label }),
1831
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kds-copyable-table-value", children: row.value })
1832
- ] }, row.label)) }),
1833
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("button", { className: `kds-btn kds-btn-outlined kds-btn-block kds-copy-all-btn${copied ? " copied" : ""}`, onClick: handleCopyAll, "aria-label": "Copiar todo", children: [
1834
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kds-icon", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("i", { className: "material-symbols-outlined", children: copied ? "check" : "content_copy" }) }),
1835
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: copied ? "Copiado" : "Copiar todos los datos" })
1836
- ] })
1837
- ] });
1989
+ var import_react26 = require("react");
1990
+ var import_jsx_runtime25 = require("react/jsx-runtime");
1991
+ async function copyToClipboard(text) {
1992
+ try {
1993
+ if (navigator.clipboard?.writeText) {
1994
+ await navigator.clipboard.writeText(text);
1995
+ return true;
1996
+ }
1997
+ } catch {
1998
+ }
1999
+ const ta = document.createElement("textarea");
2000
+ ta.value = text;
2001
+ ta.style.position = "fixed";
2002
+ ta.style.opacity = "0";
2003
+ document.body.appendChild(ta);
2004
+ ta.select();
2005
+ try {
2006
+ document.execCommand("copy");
2007
+ return true;
2008
+ } catch {
2009
+ return false;
2010
+ } finally {
2011
+ document.body.removeChild(ta);
2012
+ }
2013
+ }
2014
+ var TRANSITION_MS = 300;
2015
+ function GridVariant({
2016
+ gridRows,
2017
+ disabled,
2018
+ className,
2019
+ forwardedRef,
2020
+ rest
2021
+ }) {
2022
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2023
+ "div",
2024
+ {
2025
+ ref: forwardedRef,
2026
+ className: (0, import_clsx.clsx)("kds-copyable-table", "kds-copyable-table--grid", className),
2027
+ ...rest,
2028
+ children: gridRows.map((cells, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2029
+ "div",
2030
+ {
2031
+ className: "kds-copyable-table-row kds-copyable-table-row--grid",
2032
+ "data-testid": "kds-grid-row",
2033
+ children: cells.map((text, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2034
+ "span",
2035
+ {
2036
+ className: (0, import_clsx.clsx)("kds-grid-cell", disabled && "kds-grid-cell--disabled"),
2037
+ children: text
2038
+ },
2039
+ cellIndex
2040
+ ))
2041
+ },
2042
+ rowIndex
2043
+ ))
2044
+ }
2045
+ );
2046
+ }
2047
+ function CopyableVariant({
2048
+ rows,
2049
+ copyAllLabel = "Copiar todos los datos",
2050
+ copiedAllLabel = "Datos copiados",
2051
+ showCopyAll = true,
2052
+ className,
2053
+ forwardedRef,
2054
+ rest
2055
+ }) {
2056
+ const copiedTimers = (0, import_react26.useRef)(/* @__PURE__ */ new Map());
2057
+ const settlingTimers = (0, import_react26.useRef)(/* @__PURE__ */ new Map());
2058
+ const [copiedRows, setCopiedRows] = (0, import_react26.useState)(/* @__PURE__ */ new Set());
2059
+ const [settlingRows, setSettlingRows] = (0, import_react26.useState)(/* @__PURE__ */ new Set());
2060
+ const [allCopied, setAllCopied] = (0, import_react26.useState)(false);
2061
+ const markCopied = (0, import_react26.useCallback)((indexes, duration = 1500) => {
2062
+ setCopiedRows((prev) => {
2063
+ const next = new Set(prev);
2064
+ indexes.forEach((i) => next.add(i));
2065
+ return next;
2066
+ });
2067
+ indexes.forEach((i) => {
2068
+ const st = settlingTimers.current.get(i);
2069
+ if (st) {
2070
+ clearTimeout(st);
2071
+ settlingTimers.current.delete(i);
2072
+ }
2073
+ });
2074
+ setSettlingRows((prev) => {
2075
+ const next = new Set(prev);
2076
+ indexes.forEach((i) => next.delete(i));
2077
+ return next;
2078
+ });
2079
+ indexes.forEach((i) => {
2080
+ const existing = copiedTimers.current.get(i);
2081
+ if (existing) clearTimeout(existing);
2082
+ const t = setTimeout(() => {
2083
+ setCopiedRows((prev) => {
2084
+ const next = new Set(prev);
2085
+ next.delete(i);
2086
+ return next;
2087
+ });
2088
+ setSettlingRows((prev) => {
2089
+ const next = new Set(prev);
2090
+ next.add(i);
2091
+ return next;
2092
+ });
2093
+ copiedTimers.current.delete(i);
2094
+ const settlingT = setTimeout(() => {
2095
+ setSettlingRows((prev) => {
2096
+ const next = new Set(prev);
2097
+ next.delete(i);
2098
+ return next;
2099
+ });
2100
+ settlingTimers.current.delete(i);
2101
+ }, TRANSITION_MS);
2102
+ settlingTimers.current.set(i, settlingT);
2103
+ }, duration);
2104
+ copiedTimers.current.set(i, t);
2105
+ });
2106
+ }, []);
2107
+ const handleRowCopy = async (row, index) => {
2108
+ const ok = await copyToClipboard(row.copy ?? row.value);
2109
+ if (ok) markCopied([index]);
2110
+ };
2111
+ const handleCopyAll = async () => {
2112
+ const text = rows.map((r) => `${r.label}: ${r.value}`).join("\n");
2113
+ const ok = await copyToClipboard(text);
2114
+ if (ok) {
2115
+ markCopied(rows.map((_, i) => i));
2116
+ setAllCopied(true);
2117
+ setTimeout(() => setAllCopied(false), 2e3);
2118
+ }
2119
+ };
2120
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
2121
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref: forwardedRef, className: (0, import_clsx.clsx)("kds-copyable-table", className), ...rest, children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2122
+ "div",
2123
+ {
2124
+ className: (0, import_clsx.clsx)(
2125
+ "kds-copyable-table-row",
2126
+ copiedRows.has(i) && "copied",
2127
+ settlingRows.has(i) && "settling"
2128
+ ),
2129
+ role: "button",
2130
+ tabIndex: 0,
2131
+ onClick: () => handleRowCopy(row, i),
2132
+ onKeyDown: (e) => {
2133
+ if (e.key === "Enter" || e.key === " ") {
2134
+ e.preventDefault();
2135
+ handleRowCopy(row, i);
2136
+ }
2137
+ },
2138
+ "aria-label": `Copiar ${row.label}: ${row.value}`,
2139
+ children: [
2140
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "kds-key", children: row.label }),
2141
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "kds-value", children: row.value })
2142
+ ]
2143
+ },
2144
+ `${row.label}-${i}`
2145
+ )) }),
2146
+ showCopyAll && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2147
+ "button",
2148
+ {
2149
+ type: "button",
2150
+ className: (0, import_clsx.clsx)(
2151
+ "kds-btn",
2152
+ "kds-btn-outlined",
2153
+ "kds-btn-block",
2154
+ "kds-copy-all-btn",
2155
+ allCopied && "copied"
2156
+ ),
2157
+ onClick: handleCopyAll,
2158
+ "aria-label": allCopied ? copiedAllLabel : copyAllLabel,
2159
+ children: [
2160
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "kds-icon", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("i", { className: "material-symbols-outlined", children: allCopied ? "check" : "content_copy" }) }),
2161
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: allCopied ? copiedAllLabel : copyAllLabel })
2162
+ ]
2163
+ }
2164
+ )
2165
+ ] });
2166
+ }
2167
+ var KdsCopyableTable = (0, import_react26.forwardRef)(
2168
+ ({
2169
+ rows = [],
2170
+ variant = "copyable",
2171
+ gridRows = [],
2172
+ disabled = false,
2173
+ copyAllLabel,
2174
+ copiedAllLabel,
2175
+ showCopyAll,
2176
+ className,
2177
+ ...props
2178
+ }, ref) => {
2179
+ if (variant === "grid") {
2180
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2181
+ GridVariant,
2182
+ {
2183
+ gridRows,
2184
+ disabled,
2185
+ className,
2186
+ forwardedRef: ref,
2187
+ rest: props
2188
+ }
2189
+ );
2190
+ }
2191
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2192
+ CopyableVariant,
2193
+ {
2194
+ rows,
2195
+ copyAllLabel,
2196
+ copiedAllLabel,
2197
+ showCopyAll,
2198
+ className,
2199
+ forwardedRef: ref,
2200
+ rest: props
2201
+ }
2202
+ );
1838
2203
  }
1839
2204
  );
1840
2205
  KdsCopyableTable.displayName = "KdsCopyableTable";
1841
2206
 
1842
2207
  // src/components/core/KdsExpandPanel/KdsExpandPanel.tsx
1843
- var import_react26 = require("react");
1844
- var import_jsx_runtime25 = require("react/jsx-runtime");
1845
- var KdsExpandPanel = (0, import_react26.forwardRef)(
2208
+ var import_react27 = require("react");
2209
+ var import_jsx_runtime26 = require("react/jsx-runtime");
2210
+ var KdsExpandPanel = (0, import_react27.forwardRef)(
1846
2211
  ({ label, defaultExpanded = false, children, className, ...props }, ref) => {
1847
- const [expanded, setExpanded] = (0, import_react26.useState)(defaultExpanded);
1848
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ref, className, ...props, children: [
1849
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2212
+ const [expanded, setExpanded] = (0, import_react27.useState)(defaultExpanded);
2213
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { ref, className, ...props, children: [
2214
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
1850
2215
  "button",
1851
2216
  {
1852
2217
  className: "kds-expand-toggle",
1853
2218
  onClick: () => setExpanded((v) => !v),
1854
2219
  "aria-expanded": expanded,
1855
2220
  children: [
1856
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: label }),
1857
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("i", { className: "material-symbols-outlined", children: expanded ? "expand_less" : "expand_more" })
2221
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: label }),
2222
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("i", { className: "material-symbols-outlined", children: expanded ? "expand_less" : "expand_more" })
1858
2223
  ]
1859
2224
  }
1860
2225
  ),
1861
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx.clsx)("kds-expand-panel", expanded && "open"), hidden: !expanded, children })
2226
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: (0, import_clsx.clsx)("kds-expand-panel", expanded && "open"), hidden: !expanded, children })
1862
2227
  ] });
1863
2228
  }
1864
2229
  );
1865
2230
  KdsExpandPanel.displayName = "KdsExpandPanel";
1866
2231
 
1867
2232
  // src/components/core/KdsCountdown/KdsCountdown.tsx
1868
- var import_react28 = require("react");
2233
+ var import_react29 = require("react");
1869
2234
 
1870
2235
  // src/components/core/hooks/useCountdown.ts
1871
- var import_react27 = require("react");
2236
+ var import_react28 = require("react");
1872
2237
  function calcRemaining(deadline) {
1873
2238
  const diff = Math.max(0, new Date(deadline).getTime() - Date.now());
1874
2239
  const totalSeconds = Math.floor(diff / 1e3);
@@ -1881,8 +2246,8 @@ function calcRemaining(deadline) {
1881
2246
  };
1882
2247
  }
1883
2248
  function useCountdown(deadline) {
1884
- const [state, setState] = (0, import_react27.useState)(() => calcRemaining(deadline));
1885
- (0, import_react27.useEffect)(() => {
2249
+ const [state, setState] = (0, import_react28.useState)(() => calcRemaining(deadline));
2250
+ (0, import_react28.useEffect)(() => {
1886
2251
  const tick = () => setState(calcRemaining(deadline));
1887
2252
  const id = setInterval(tick, 1e3);
1888
2253
  return () => clearInterval(id);
@@ -1891,13 +2256,13 @@ function useCountdown(deadline) {
1891
2256
  }
1892
2257
 
1893
2258
  // src/components/core/KdsCountdown/KdsCountdown.tsx
1894
- var import_jsx_runtime26 = require("react/jsx-runtime");
1895
- var KdsCountdown = (0, import_react28.forwardRef)(
2259
+ var import_jsx_runtime27 = require("react/jsx-runtime");
2260
+ var KdsCountdown = (0, import_react29.forwardRef)(
1896
2261
  ({ deadline, label, onExpire, className, ...props }, ref) => {
1897
2262
  const { hours, minutes, seconds, expired, urgent } = useCountdown(deadline);
1898
- const onExpireRef = (0, import_react28.useRef)(onExpire);
2263
+ const onExpireRef = (0, import_react29.useRef)(onExpire);
1899
2264
  onExpireRef.current = onExpire;
1900
- (0, import_react28.useEffect)(() => {
2265
+ (0, import_react29.useEffect)(() => {
1901
2266
  if (expired) {
1902
2267
  onExpireRef.current?.();
1903
2268
  }
@@ -1906,9 +2271,9 @@ var KdsCountdown = (0, import_react28.forwardRef)(
1906
2271
  return null;
1907
2272
  }
1908
2273
  const pad = (n) => String(n).padStart(2, "0");
1909
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-countdown", urgent && "urgent", className), ...props, children: [
1910
- label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "kds-countdown-label", children: label }),
1911
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "kds-countdown-value", children: [
2274
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-countdown", urgent && "urgent", className), ...props, children: [
2275
+ label && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "kds-countdown-label", children: label }),
2276
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "kds-countdown-value", children: [
1912
2277
  pad(hours),
1913
2278
  ":",
1914
2279
  pad(minutes),
@@ -1921,96 +2286,122 @@ var KdsCountdown = (0, import_react28.forwardRef)(
1921
2286
  KdsCountdown.displayName = "KdsCountdown";
1922
2287
 
1923
2288
  // src/components/core/KdsSegmentedTabs/KdsSegmentedTabs.tsx
1924
- var import_react29 = require("react");
1925
- var import_jsx_runtime27 = require("react/jsx-runtime");
1926
- var KdsSegmentedTabs = (0, import_react29.forwardRef)(
1927
- (props, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KdsTabs, { ref, variant: "segmented", ...props })
2289
+ var import_react30 = require("react");
2290
+ var import_jsx_runtime28 = require("react/jsx-runtime");
2291
+ var KdsSegmentedTabs = (0, import_react30.forwardRef)(
2292
+ (props, ref) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(KdsTabs, { ref, ...props })
1928
2293
  );
1929
2294
  KdsSegmentedTabs.displayName = "KdsSegmentedTabs";
1930
2295
 
1931
- // src/components/domain/KdsBankRow/KdsBankRow.tsx
1932
- var import_react30 = require("react");
1933
- var import_jsx_runtime28 = require("react/jsx-runtime");
1934
- var KdsBankRow = (0, import_react30.forwardRef)(
1935
- ({ name, logoUrl, selected, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2296
+ // src/components/core/KdsFab/KdsFab.tsx
2297
+ var import_react31 = require("react");
2298
+ var import_jsx_runtime29 = require("react/jsx-runtime");
2299
+ var KdsFab = (0, import_react31.forwardRef)(
2300
+ ({ icon, position = "top-right", hidden = false, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1936
2301
  "button",
1937
2302
  {
1938
2303
  ref,
1939
2304
  type: "button",
1940
- className: (0, import_clsx.clsx)("kds-bank-row", selected && "selected", className),
2305
+ className: (0, import_clsx.clsx)(
2306
+ "kds-fab",
2307
+ position !== "none" && `kds-fab--${position}`,
2308
+ hidden && "kds-fab--hidden",
2309
+ className
2310
+ ),
2311
+ "aria-hidden": hidden || void 0,
2312
+ tabIndex: hidden ? -1 : void 0,
1941
2313
  ...props,
1942
- children: [
1943
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "kds-bank-row-logo", children: logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("img", { src: logoUrl, alt: name }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "initials", children: name.charAt(0) }) }),
1944
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "kds-bank-row-name", children: name }),
1945
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("i", { className: "material-symbols-outlined", children: selected ? "check_circle" : "chevron_right" })
1946
- ]
2314
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("i", { className: "material-symbols-outlined", children: icon })
1947
2315
  }
1948
2316
  )
1949
2317
  );
2318
+ KdsFab.displayName = "KdsFab";
2319
+
2320
+ // src/components/domain/KdsBankRow/KdsBankRow.tsx
2321
+ var import_react32 = require("react");
2322
+ var import_jsx_runtime30 = require("react/jsx-runtime");
2323
+ var KdsBankRow = (0, import_react32.forwardRef)(
2324
+ ({ name, logoUrl, selected, hideLogo, className, ...props }, ref) => {
2325
+ const nameStr = typeof name === "string" ? name : "";
2326
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2327
+ "button",
2328
+ {
2329
+ ref,
2330
+ type: "button",
2331
+ className: (0, import_clsx.clsx)("kds-bank-row", selected && "selected", className),
2332
+ ...props,
2333
+ children: [
2334
+ !hideLogo && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "kds-bank-row-logo", children: logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("img", { src: logoUrl, alt: nameStr }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "initials", children: nameStr.charAt(0) }) }),
2335
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "kds-bank-row-name", children: name }),
2336
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { className: "material-symbols-outlined", children: selected ? "check_circle" : "chevron_right" })
2337
+ ]
2338
+ }
2339
+ );
2340
+ }
2341
+ );
1950
2342
  KdsBankRow.displayName = "KdsBankRow";
1951
2343
 
1952
2344
  // src/components/domain/KdsBankList/KdsBankList.tsx
1953
- var import_react31 = require("react");
1954
- var import_jsx_runtime29 = require("react/jsx-runtime");
1955
- var KdsBankList = (0, import_react31.forwardRef)(
1956
- ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-bank-list", className), role: "list", ...props, children })
2345
+ var import_react33 = require("react");
2346
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2347
+ var KdsBankList = (0, import_react33.forwardRef)(
2348
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-bank-list", className), role: "list", ...props, children })
1957
2349
  );
1958
2350
  KdsBankList.displayName = "KdsBankList";
1959
2351
 
1960
2352
  // src/components/domain/KdsBankModal/KdsBankModal.tsx
1961
- var import_react32 = require("react");
1962
- var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
1963
- var import_jsx_runtime30 = require("react/jsx-runtime");
1964
- var KdsBankModal = (0, import_react32.forwardRef)(
2353
+ var import_react34 = require("react");
2354
+ var Dialog = __toESM(require("@radix-ui/react-dialog"));
2355
+ var import_jsx_runtime32 = require("react/jsx-runtime");
2356
+ var KdsBankModal = (0, import_react34.forwardRef)(
1965
2357
  ({ open, onClose, title = "Selecciona tu banco", searchPlaceholder = "Buscar banco...", onSearch, children, className, container }, ref) => {
1966
- const [query, setQuery] = (0, import_react32.useState)("");
2358
+ const [query, setQuery] = (0, import_react34.useState)("");
1967
2359
  const handleSearch = (value) => {
1968
2360
  setQuery(value);
1969
2361
  onSearch?.(value);
1970
2362
  };
1971
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog2.Root, { open, onOpenChange: (o) => {
2363
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Dialog.Root, { open, onOpenChange: (o) => {
1972
2364
  if (!o) onClose();
1973
- }, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog2.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog2.Overlay, { className: "kds-bank-modal-scrim open", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Dialog2.Content, { ref, className: (0, import_clsx.clsx)("kds-bank-modal", className), children: [
1974
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "kds-bank-modal-header", children: [
1975
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog2.Title, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h3", { children: title }) }),
1976
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { className: "kds-bank-modal-close", "aria-label": "Cerrar", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { className: "material-symbols-outlined", children: "close" }) }) })
2365
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Dialog.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Dialog.Overlay, { className: "kds-bank-modal-scrim open", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Dialog.Content, { ref, className: (0, import_clsx.clsx)("kds-bank-modal", className), children: [
2366
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "kds-bank-modal-header", children: [
2367
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Dialog.Title, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("h3", { children: title }) }),
2368
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { className: "kds-bank-modal-close", "aria-label": "Cerrar", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("i", { className: "material-symbols-outlined", children: "close" }) }) })
1977
2369
  ] }),
1978
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "kds-bank-modal-search", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1979
- "input",
2370
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "kds-bank-modal-search", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2371
+ KdsSearchField,
1980
2372
  {
1981
- type: "text",
1982
2373
  placeholder: searchPlaceholder,
1983
2374
  value: query,
1984
2375
  onChange: (e) => handleSearch(e.target.value)
1985
2376
  }
1986
2377
  ) }),
1987
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "kds-bank-modal-body", children })
2378
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "kds-bank-modal-body", children })
1988
2379
  ] }) }) }) });
1989
2380
  }
1990
2381
  );
1991
2382
  KdsBankModal.displayName = "KdsBankModal";
1992
2383
 
1993
2384
  // src/components/domain/KdsQrRow/KdsQrRow.tsx
1994
- var import_react33 = require("react");
1995
- var import_jsx_runtime31 = require("react/jsx-runtime");
1996
- var KdsQrRow = (0, import_react33.forwardRef)(
1997
- ({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { ref, type: "button", className: (0, import_clsx.clsx)("kds-qr-row", className), ...props, children: [
1998
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "kds-qr-avatar", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
1999
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "kds-qr-text", children: [
2000
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "title", children: name }),
2001
- description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "sub", children: description })
2385
+ var import_react35 = require("react");
2386
+ var import_jsx_runtime33 = require("react/jsx-runtime");
2387
+ var KdsQrRow = (0, import_react35.forwardRef)(
2388
+ ({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { ref, type: "button", className: (0, import_clsx.clsx)("kds-qr-row", className), ...props, children: [
2389
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "kds-qr-avatar", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
2390
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "kds-qr-text", children: [
2391
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "kds-qr-title", children: name }),
2392
+ description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "kds-qr-subtitle", children: description })
2002
2393
  ] }),
2003
- badge && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "kds-qr-badge", children: badge }),
2004
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", { className: "material-symbols-outlined", children: "chevron_right" })
2394
+ badge && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "kds-qr-badge", children: badge }),
2395
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", { className: "material-symbols-outlined", children: "chevron_right" })
2005
2396
  ] })
2006
2397
  );
2007
2398
  KdsQrRow.displayName = "KdsQrRow";
2008
2399
 
2009
2400
  // src/components/domain/KdsCardSelector/KdsCardSelector.tsx
2010
- var import_react34 = require("react");
2011
- var import_jsx_runtime32 = require("react/jsx-runtime");
2012
- var KdsCardSelector = (0, import_react34.forwardRef)(
2013
- ({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
2401
+ var import_react36 = require("react");
2402
+ var import_jsx_runtime34 = require("react/jsx-runtime");
2403
+ var KdsCardSelector = (0, import_react36.forwardRef)(
2404
+ ({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2014
2405
  "button",
2015
2406
  {
2016
2407
  ref,
@@ -2018,9 +2409,9 @@ var KdsCardSelector = (0, import_react34.forwardRef)(
2018
2409
  className: (0, import_clsx.clsx)("kds-card-selector", selected && "selected", className),
2019
2410
  ...props,
2020
2411
  children: [
2021
- icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "kds-card-selector-icon", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
2022
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "kds-card-selector-title", children: title }),
2023
- description && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "kds-card-selector-description", children: description })
2412
+ icon && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "kds-card-selector-icon", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
2413
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "kds-card-selector-title", children: title }),
2414
+ description && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "kds-card-selector-description", children: description })
2024
2415
  ]
2025
2416
  }
2026
2417
  )
@@ -2028,26 +2419,26 @@ var KdsCardSelector = (0, import_react34.forwardRef)(
2028
2419
  KdsCardSelector.displayName = "KdsCardSelector";
2029
2420
 
2030
2421
  // src/components/domain/KdsCardPlan/KdsCardPlan.tsx
2031
- var import_react35 = require("react");
2032
- var import_jsx_runtime33 = require("react/jsx-runtime");
2033
- var KdsCardPlan = (0, import_react35.forwardRef)(
2034
- ({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
2422
+ var import_react37 = require("react");
2423
+ var import_jsx_runtime35 = require("react/jsx-runtime");
2424
+ var KdsCardPlan = (0, import_react37.forwardRef)(
2425
+ ({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
2035
2426
  "div",
2036
2427
  {
2037
2428
  ref,
2038
2429
  className: (0, import_clsx.clsx)("kds-card-plan", recommended && "recommended", className),
2039
2430
  ...props,
2040
2431
  children: [
2041
- badgeText && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "kds-card-plan-badge", children: badgeText }),
2042
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "kds-card-plan-header", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h3", { children: title }) }),
2043
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "kds-card-plan-price", children: [
2044
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: price }),
2045
- period && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
2432
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kds-card-plan-header", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h3", { children: title }) }),
2433
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "kds-card-plan-price", children: [
2434
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "kds-price", children: price }),
2435
+ period && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "kds-price-period", children: [
2046
2436
  "/",
2047
2437
  period
2048
2438
  ] })
2049
2439
  ] }),
2050
- features && features.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "kds-card-plan-features", children: features.map((f, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("li", { children: f }, i)) }),
2440
+ badgeText && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "kds-card-plan-badge", children: badgeText }),
2441
+ features && features.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("ul", { className: "kds-card-plan-features", children: features.map((f, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("li", { children: f }, i)) }),
2051
2442
  action
2052
2443
  ]
2053
2444
  }
@@ -2056,50 +2447,547 @@ var KdsCardPlan = (0, import_react35.forwardRef)(
2056
2447
  KdsCardPlan.displayName = "KdsCardPlan";
2057
2448
 
2058
2449
  // src/components/domain/KdsInvoiceSticky/KdsInvoiceSticky.tsx
2059
- var import_react36 = require("react");
2060
- var import_jsx_runtime34 = require("react/jsx-runtime");
2061
- var KdsInvoiceSticky = (0, import_react36.forwardRef)(
2062
- ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-card-elevated", "kds-invoice-sticky", className), ...props, children })
2450
+ var import_react38 = require("react");
2451
+ var import_jsx_runtime36 = require("react/jsx-runtime");
2452
+ var KdsInvoiceSticky = (0, import_react38.forwardRef)(
2453
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
2454
+ "article",
2455
+ {
2456
+ ref,
2457
+ className: (0, import_clsx.clsx)("kds-card-elevated", "kds-invoice-sticky", className),
2458
+ ...props,
2459
+ children
2460
+ }
2461
+ )
2063
2462
  );
2064
2463
  KdsInvoiceSticky.displayName = "KdsInvoiceSticky";
2065
2464
 
2066
2465
  // src/components/domain/KdsBottomSheet/KdsBottomSheet.tsx
2067
- var import_react37 = require("react");
2068
- var Dialog3 = __toESM(require("@radix-ui/react-dialog"));
2069
- var import_jsx_runtime35 = require("react/jsx-runtime");
2070
- var KdsBottomSheet = (0, import_react37.forwardRef)(
2071
- ({ open, onClose, title, children, actions, className, container }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Dialog3.Root, { open, onOpenChange: (o) => {
2072
- if (!o) onClose();
2073
- }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Dialog3.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Dialog3.Overlay, { className: "kds-bottom-sheet-scrim open", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Dialog3.Content, { ref, className: (0, import_clsx.clsx)("kds-bottom-sheet", className), children: [
2074
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kds-bottom-sheet-grabber" }),
2075
- title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Dialog3.Title, { className: "kds-bottom-sheet-title", children: title }),
2076
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kds-bottom-sheet-body", children }),
2077
- actions && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kds-bottom-sheet-actions", children: actions })
2078
- ] }) }) }) })
2466
+ var import_react39 = require("react");
2467
+ var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
2468
+ var import_jsx_runtime37 = require("react/jsx-runtime");
2469
+ var KdsBottomSheet = (0, import_react39.forwardRef)(
2470
+ ({
2471
+ open,
2472
+ onClose,
2473
+ title,
2474
+ description,
2475
+ children,
2476
+ actions,
2477
+ showGrabber = true,
2478
+ showCloseButton = false,
2479
+ container,
2480
+ className,
2481
+ ...props
2482
+ }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2483
+ Dialog2.Root,
2484
+ {
2485
+ open,
2486
+ onOpenChange: (o) => {
2487
+ if (!o) onClose();
2488
+ },
2489
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Dialog2.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "kds-theme-root", style: { display: "contents" }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Dialog2.Overlay, { className: "kds-bottom-sheet-scrim open", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
2490
+ Dialog2.Content,
2491
+ {
2492
+ ref,
2493
+ className: (0, import_clsx.clsx)("kds-bottom-sheet", className),
2494
+ onPointerDownOutside: (e) => {
2495
+ const target = e.target;
2496
+ if (target.closest(".kds-bottom-sheet")) e.preventDefault();
2497
+ },
2498
+ ...props,
2499
+ children: [
2500
+ showGrabber && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "kds-bottom-sheet-grabber", "aria-hidden": "true" }),
2501
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2502
+ "button",
2503
+ {
2504
+ type: "button",
2505
+ className: "kds-bottom-sheet-close",
2506
+ "aria-label": "Cerrar",
2507
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { className: "material-symbols-outlined", children: "close" })
2508
+ }
2509
+ ) }),
2510
+ title && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Dialog2.Title, { className: "kds-bottom-sheet-title", children: title }),
2511
+ description && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Dialog2.Description, { className: "kds-bottom-sheet-description", children: description }),
2512
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "kds-bottom-sheet-body", children }),
2513
+ actions && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "kds-bottom-sheet-actions", children: actions })
2514
+ ]
2515
+ }
2516
+ ) }) }) })
2517
+ }
2518
+ )
2079
2519
  );
2080
2520
  KdsBottomSheet.displayName = "KdsBottomSheet";
2081
2521
 
2082
2522
  // src/components/domain/KdsSecureFooter/KdsSecureFooter.tsx
2083
- var import_react38 = require("react");
2084
- var import_jsx_runtime36 = require("react/jsx-runtime");
2085
- var KdsSecureFooter = (0, import_react38.forwardRef)(
2086
- ({ variant = "default", children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("footer", { ref, className: (0, import_clsx.clsx)("kds-secure-footer", variant === "inside" && "inside", className), ...props, children: [
2087
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("i", { className: "material-symbols-outlined", children: "lock" }),
2088
- children || /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: "Pago seguro con Khipu" })
2523
+ var import_react41 = require("react");
2524
+
2525
+ // src/components/domain/KdsSecureFooter/KhipuWordmark.tsx
2526
+ var import_react40 = require("react");
2527
+ var import_jsx_runtime38 = require("react/jsx-runtime");
2528
+ var KhipuWordmark = (0, import_react40.forwardRef)(
2529
+ ({ className = "khipu-mark", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2530
+ "svg",
2531
+ {
2532
+ ref,
2533
+ viewBox: "0 0 45 15",
2534
+ role: "img",
2535
+ "aria-label": "Khipu",
2536
+ className,
2537
+ xmlns: "http://www.w3.org/2000/svg",
2538
+ ...props,
2539
+ children: [
2540
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("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" }),
2541
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("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" }),
2542
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("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" }),
2543
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("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" }),
2544
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("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" }),
2545
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("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" }),
2546
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("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" }),
2547
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("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" })
2548
+ ]
2549
+ }
2550
+ )
2551
+ );
2552
+ KhipuWordmark.displayName = "KhipuWordmark";
2553
+
2554
+ // src/components/domain/KdsSecureFooter/KdsSecureFooter.tsx
2555
+ var import_jsx_runtime39 = require("react/jsx-runtime");
2556
+ var KdsSecureFooter = (0, import_react41.forwardRef)(
2557
+ ({ variant = "default", showLogo = true, psp, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("footer", { ref, className: (0, import_clsx.clsx)("kds-secure-footer", variant === "inside" && "inside", className), ...props, children: [
2558
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("svg", { className: "kds-secure-footer-lock", viewBox: "0 0 24 24", "aria-hidden": "true", children: [
2559
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("rect", { x: "4.5", y: "10.5", width: "15", height: "10", rx: "2.25" }),
2560
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("path", { d: "M8 10.5V7a4 4 0 0 1 8 0v3.5" })
2561
+ ] }),
2562
+ children || /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: "Pago seguro procesado por" }),
2563
+ showLogo && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(KhipuWordmark, {}),
2564
+ psp && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
2565
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "kds-secure-footer-sep", "aria-hidden": "true" }),
2566
+ psp
2567
+ ] })
2089
2568
  ] })
2090
2569
  );
2091
2570
  KdsSecureFooter.displayName = "KdsSecureFooter";
2092
2571
 
2093
2572
  // src/components/domain/KdsRecapList/KdsRecapList.tsx
2094
- var import_react39 = require("react");
2095
- var import_jsx_runtime37 = require("react/jsx-runtime");
2096
- var KdsRecapList = (0, import_react39.forwardRef)(
2097
- ({ items, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("ul", { ref, className: (0, import_clsx.clsx)("kds-recap-list", className), ...props, children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("li", { children: [
2098
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "k", children: item.label }),
2099
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: (0, import_clsx.clsx)("v", !item.value && item.placeholder && "placeholder"), children: item.value || item.placeholder || "-" })
2573
+ var import_react42 = require("react");
2574
+ var import_jsx_runtime40 = require("react/jsx-runtime");
2575
+ var KdsRecapList = (0, import_react42.forwardRef)(
2576
+ ({ items, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("ul", { ref, className: (0, import_clsx.clsx)("kds-recap-list", className), ...props, children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("li", { children: [
2577
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "kds-key", children: item.label }),
2578
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: (0, import_clsx.clsx)("kds-value", !item.value && item.placeholder && "placeholder"), children: item.value || item.placeholder || "-" })
2100
2579
  ] }, i)) })
2101
2580
  );
2102
2581
  KdsRecapList.displayName = "KdsRecapList";
2582
+
2583
+ // src/components/domain/KdsMontoRow/KdsMontoRow.tsx
2584
+ var import_react43 = require("react");
2585
+ var import_jsx_runtime41 = require("react/jsx-runtime");
2586
+ var KdsMontoRow = (0, import_react43.forwardRef)(
2587
+ ({ title, value, deadline, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-monto-row", className), ...props, children: [
2588
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
2589
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "kds-monto-row-title", children: title }),
2590
+ deadline && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "kds-monto-row-deadline", children: deadline })
2591
+ ] }),
2592
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "kds-monto-row-value", children: value })
2593
+ ] })
2594
+ );
2595
+ KdsMontoRow.displayName = "KdsMontoRow";
2596
+
2597
+ // src/components/domain/KdsMerchantTile/KdsMerchantTile.tsx
2598
+ var import_react44 = require("react");
2599
+ var import_jsx_runtime42 = require("react/jsx-runtime");
2600
+ var KdsMerchantTile = (0, import_react44.forwardRef)(
2601
+ ({ name, logoUrl, initials, compact, className, ...props }, ref) => {
2602
+ const displayInitials = (initials ?? name.slice(0, 2)).toUpperCase();
2603
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2604
+ "div",
2605
+ {
2606
+ ref,
2607
+ className: (0, import_clsx.clsx)("kds-merchant-tile", logoUrl && "logo", compact && "compact", className),
2608
+ "aria-label": name,
2609
+ ...props,
2610
+ children: logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("img", { src: logoUrl, alt: name }) : displayInitials
2611
+ }
2612
+ );
2613
+ }
2614
+ );
2615
+ KdsMerchantTile.displayName = "KdsMerchantTile";
2616
+
2617
+ // src/components/domain/KdsInvoiceMerchant/KdsInvoiceMerchant.tsx
2618
+ var import_react46 = require("react");
2619
+
2620
+ // src/components/domain/KdsInvoiceMerchant/useLogoBackdrop.ts
2621
+ var import_react45 = require("react");
2622
+
2623
+ // src/components/domain/KdsInvoiceMerchant/logoLuminance.ts
2624
+ var LIGHT_LOGO_LUMINANCE_THRESHOLD = 0.72;
2625
+ var SAMPLE_SIZE = 16;
2626
+ var ALPHA_THRESHOLD = 128;
2627
+ var MIN_OPAQUE_RATIO = 0.02;
2628
+ function measureLogoLuminance(url) {
2629
+ return new Promise((resolve) => {
2630
+ const probe = new Image();
2631
+ probe.crossOrigin = "anonymous";
2632
+ probe.onload = () => {
2633
+ try {
2634
+ const canvas = document.createElement("canvas");
2635
+ canvas.width = SAMPLE_SIZE;
2636
+ canvas.height = SAMPLE_SIZE;
2637
+ const context = canvas.getContext("2d");
2638
+ if (!context) {
2639
+ resolve(null);
2640
+ return;
2641
+ }
2642
+ context.drawImage(probe, 0, 0, SAMPLE_SIZE, SAMPLE_SIZE);
2643
+ const { data } = context.getImageData(0, 0, SAMPLE_SIZE, SAMPLE_SIZE);
2644
+ let sum = 0;
2645
+ let opaquePixels = 0;
2646
+ for (let i = 0; i < data.length; i += 4) {
2647
+ if (data[i + 3] < ALPHA_THRESHOLD) continue;
2648
+ sum += (0.2126 * data[i] + 0.7152 * data[i + 1] + 0.0722 * data[i + 2]) / 255;
2649
+ opaquePixels++;
2650
+ }
2651
+ if (opaquePixels < SAMPLE_SIZE * SAMPLE_SIZE * MIN_OPAQUE_RATIO) {
2652
+ resolve(null);
2653
+ return;
2654
+ }
2655
+ resolve(sum / opaquePixels);
2656
+ } catch {
2657
+ resolve(null);
2658
+ }
2659
+ };
2660
+ probe.onerror = () => resolve(null);
2661
+ probe.src = url;
2662
+ });
2663
+ }
2664
+ function pickLogoBackdrop(luminance) {
2665
+ return luminance != null && luminance > LIGHT_LOGO_LUMINANCE_THRESHOLD ? "dark" : "light";
2666
+ }
2667
+
2668
+ // src/components/domain/KdsInvoiceMerchant/useLogoBackdrop.ts
2669
+ function useLogoBackdrop(logoUrl) {
2670
+ const [backdrop, setBackdrop] = (0, import_react45.useState)("light");
2671
+ (0, import_react45.useEffect)(() => {
2672
+ let cancelled = false;
2673
+ setBackdrop("light");
2674
+ if (!logoUrl) {
2675
+ return void 0;
2676
+ }
2677
+ measureLogoLuminance(logoUrl).then((luminance) => {
2678
+ if (!cancelled) {
2679
+ setBackdrop(pickLogoBackdrop(luminance));
2680
+ }
2681
+ });
2682
+ return () => {
2683
+ cancelled = true;
2684
+ };
2685
+ }, [logoUrl]);
2686
+ return backdrop;
2687
+ }
2688
+
2689
+ // src/components/domain/KdsInvoiceMerchant/KdsInvoiceMerchant.tsx
2690
+ var import_jsx_runtime43 = require("react/jsx-runtime");
2691
+ var KdsInvoiceMerchant = (0, import_react46.forwardRef)(
2692
+ ({ logoUrl, brandColor, className, style, ...props }, ref) => {
2693
+ const [failed, setFailed] = (0, import_react46.useState)(false);
2694
+ const showLogo = !!logoUrl && !failed;
2695
+ const backdrop = useLogoBackdrop(showLogo ? logoUrl : void 0);
2696
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2697
+ "div",
2698
+ {
2699
+ ref,
2700
+ className: (0, import_clsx.clsx)(
2701
+ "kds-invoice-merchant",
2702
+ showLogo && "kds-invoice-merchant-neutral",
2703
+ showLogo && backdrop === "dark" && "dark",
2704
+ className
2705
+ ),
2706
+ "aria-hidden": "true",
2707
+ style: !showLogo && brandColor ? { background: brandColor, ...style } : style,
2708
+ ...props,
2709
+ children: showLogo ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("img", { src: logoUrl, alt: "", onError: () => setFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("i", { className: "material-symbols-outlined", children: "storefront" })
2710
+ }
2711
+ );
2712
+ }
2713
+ );
2714
+ KdsInvoiceMerchant.displayName = "KdsInvoiceMerchant";
2715
+
2716
+ // src/components/domain/KdsPaymentTotal/KdsPaymentTotal.tsx
2717
+ var import_react47 = require("react");
2718
+ var import_jsx_runtime44 = require("react/jsx-runtime");
2719
+ var KdsPaymentTotal = (0, import_react47.forwardRef)(
2720
+ ({
2721
+ variant = "default",
2722
+ tone = "brand",
2723
+ centered = false,
2724
+ amount,
2725
+ currency = "S/",
2726
+ decimals = 2,
2727
+ locale = "es-PE",
2728
+ label = "Monto a pagar",
2729
+ title = "Escanea el QR",
2730
+ titleMobile = "Descarga el QR",
2731
+ className,
2732
+ ...props
2733
+ }, ref) => {
2734
+ const { integer, fraction } = formatAmount(amount, decimals, locale);
2735
+ const isEmail = variant === "email";
2736
+ const isInfoTone = tone === "info";
2737
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
2738
+ "div",
2739
+ {
2740
+ ref,
2741
+ className: (0, import_clsx.clsx)(
2742
+ "kds-payment-total",
2743
+ isEmail && "kds-payment-total--email",
2744
+ isInfoTone && "kds-payment-total--tone-info",
2745
+ centered && "kds-payment-total--centered",
2746
+ className
2747
+ ),
2748
+ ...props,
2749
+ children: [
2750
+ !isEmail && title != null && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h5", { className: "kds-payment-total-title", children: title }),
2751
+ !isEmail && titleMobile != null && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h5", { className: "kds-payment-total-title-mobile", children: titleMobile }),
2752
+ label != null && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h6", { className: "kds-payment-label", children: label }),
2753
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("h5", { className: "kds-payment-amount", children: [
2754
+ currency,
2755
+ " ",
2756
+ integer,
2757
+ fraction !== null && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("sup", { className: "kds-payment-total-decimal-sup", children: fraction })
2758
+ ] })
2759
+ ]
2760
+ }
2761
+ );
2762
+ }
2763
+ );
2764
+ KdsPaymentTotal.displayName = "KdsPaymentTotal";
2765
+ function formatAmount(amount, decimals, locale) {
2766
+ const showDecimals = typeof decimals === "number" && decimals > 0;
2767
+ if (typeof amount === "number") {
2768
+ if (showDecimals) {
2769
+ const fixed = amount.toFixed(decimals);
2770
+ const [int, frac] = fixed.split(".");
2771
+ const formattedInt2 = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
2772
+ Number(int)
2773
+ );
2774
+ return { integer: formattedInt2, fraction: frac ?? null };
2775
+ }
2776
+ const formattedInt = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
2777
+ Math.trunc(amount)
2778
+ );
2779
+ return { integer: formattedInt, fraction: null };
2780
+ }
2781
+ const str = amount.trim();
2782
+ const dotIdx = str.indexOf(".");
2783
+ if (dotIdx === -1 || !showDecimals) {
2784
+ return { integer: str, fraction: null };
2785
+ }
2786
+ return {
2787
+ integer: str.slice(0, dotIdx),
2788
+ fraction: str.slice(dotIdx + 1)
2789
+ };
2790
+ }
2791
+
2792
+ // src/components/domain/KdsBillAttachment/KdsBillAttachment.tsx
2793
+ var import_react48 = require("react");
2794
+ var import_jsx_runtime45 = require("react/jsx-runtime");
2795
+ var KdsBillAttachment = (0, import_react48.forwardRef)(
2796
+ ({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
2797
+ "a",
2798
+ {
2799
+ ref,
2800
+ href,
2801
+ target: "_blank",
2802
+ rel: "noopener noreferrer",
2803
+ className: (0, import_clsx.clsx)("kds-bill-attachment", className),
2804
+ ...props,
2805
+ children: [
2806
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("i", { className: "material-symbols-outlined", children: icon }),
2807
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: filename })
2808
+ ]
2809
+ }
2810
+ )
2811
+ );
2812
+ KdsBillAttachment.displayName = "KdsBillAttachment";
2813
+ var KdsBillAttachments = (0, import_react48.forwardRef)(
2814
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-bill-attachments", className), ...props, children })
2815
+ );
2816
+ KdsBillAttachments.displayName = "KdsBillAttachments";
2817
+
2818
+ // src/components/core/hooks/useStickyInvoiceCollapse.ts
2819
+ var import_react49 = require("react");
2820
+ function useStickyInvoiceCollapse(options = {}) {
2821
+ const { onCollapseStart, collapseEnd = 20, mobileBreakpoint = 768 } = options;
2822
+ const onCollapseStartRef = (0, import_react49.useRef)(onCollapseStart);
2823
+ onCollapseStartRef.current = onCollapseStart;
2824
+ (0, import_react49.useEffect)(() => {
2825
+ let viewportOffset = 0;
2826
+ let ticking = false;
2827
+ let wasCollapsing = false;
2828
+ const isMobile = () => window.innerWidth < mobileBreakpoint;
2829
+ const closeOpenPanels = (sticky) => {
2830
+ const toggles = sticky.querySelectorAll(
2831
+ '[data-expand-toggle][aria-expanded="true"], .kds-expand-toggle[aria-expanded="true"]'
2832
+ );
2833
+ toggles.forEach((toggle) => {
2834
+ toggle.setAttribute("aria-expanded", "false");
2835
+ const panelId = toggle.getAttribute("aria-controls");
2836
+ const panel = panelId ? document.getElementById(panelId) : toggle.parentElement?.querySelector("[data-expand-panel], .kds-expand-panel");
2837
+ panel?.classList.remove("open");
2838
+ if (panel) panel.style.maxHeight = "";
2839
+ });
2840
+ };
2841
+ const apply = () => {
2842
+ ticking = false;
2843
+ const screen = document.querySelector(".kds-screen.active");
2844
+ if (!screen) return;
2845
+ const sticky = screen.querySelector(".kds-invoice-sticky");
2846
+ if (!sticky || !isMobile()) {
2847
+ screen.style.removeProperty("--collapse-progress");
2848
+ screen.style.removeProperty("--collapse-collapsible-h");
2849
+ sticky?.classList.remove("is-collapsed");
2850
+ wasCollapsing = false;
2851
+ return;
2852
+ }
2853
+ const scrollY = Math.max(window.scrollY || window.pageYOffset || 0, viewportOffset);
2854
+ const progress = Math.min(Math.max(scrollY / collapseEnd, 0), 1);
2855
+ if (!screen.style.getPropertyValue("--collapse-collapsible-h")) {
2856
+ const collapsible = sticky.querySelector(".kds-invoice-collapsible");
2857
+ if (collapsible) {
2858
+ screen.style.setProperty("--collapse-collapsible-h", `${collapsible.offsetHeight}px`);
2859
+ }
2860
+ }
2861
+ screen.style.setProperty("--collapse-progress", String(progress));
2862
+ sticky.classList.toggle("is-collapsed", progress >= 1);
2863
+ if (progress > 0) {
2864
+ if (!wasCollapsing) {
2865
+ wasCollapsing = true;
2866
+ closeOpenPanels(sticky);
2867
+ onCollapseStartRef.current?.();
2868
+ }
2869
+ } else {
2870
+ wasCollapsing = false;
2871
+ }
2872
+ };
2873
+ const onScroll = () => {
2874
+ if (ticking) return;
2875
+ ticking = true;
2876
+ window.requestAnimationFrame(apply);
2877
+ };
2878
+ const onMessage = (event) => {
2879
+ if (event.data && event.data.type === "VIEWPORT_OFFSET") {
2880
+ viewportOffset = Math.max(0, event.data.offsetTop || 0);
2881
+ onScroll();
2882
+ }
2883
+ };
2884
+ window.addEventListener("scroll", onScroll, { passive: true });
2885
+ window.addEventListener("resize", onScroll);
2886
+ window.addEventListener("message", onMessage);
2887
+ apply();
2888
+ return () => {
2889
+ window.removeEventListener("scroll", onScroll);
2890
+ window.removeEventListener("resize", onScroll);
2891
+ window.removeEventListener("message", onMessage);
2892
+ };
2893
+ }, [collapseEnd, mobileBreakpoint]);
2894
+ }
2895
+
2896
+ // src/components/core/hooks/useExpandToggle.ts
2897
+ var import_react50 = require("react");
2898
+ function useExpandToggle(options = {}) {
2899
+ const { defaultOpen = false, open: controlledOpen, onOpenChange, id } = options;
2900
+ const generatedId = (0, import_react50.useId)();
2901
+ const panelId = id ?? `kds-expand-${generatedId}`;
2902
+ const isControlled = controlledOpen !== void 0;
2903
+ const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react50.useState)(defaultOpen);
2904
+ const open = isControlled ? controlledOpen : uncontrolledOpen;
2905
+ const panelRef = (0, import_react50.useRef)(null);
2906
+ const setPanelRef = (0, import_react50.useCallback)((node) => {
2907
+ panelRef.current = node;
2908
+ }, []);
2909
+ (0, import_react50.useLayoutEffect)(() => {
2910
+ const panel = panelRef.current;
2911
+ if (!panel) return;
2912
+ panel.style.maxHeight = open ? `${panel.scrollHeight}px` : "";
2913
+ }, [open]);
2914
+ const setOpen = (0, import_react50.useCallback)(
2915
+ (next) => {
2916
+ if (!isControlled) {
2917
+ setUncontrolledOpen(next);
2918
+ }
2919
+ onOpenChange?.(next);
2920
+ },
2921
+ [isControlled, onOpenChange]
2922
+ );
2923
+ const toggle = (0, import_react50.useCallback)(() => setOpen(!open), [open, setOpen]);
2924
+ const getToggleProps = (0, import_react50.useCallback)(
2925
+ () => ({
2926
+ type: "button",
2927
+ "aria-expanded": open,
2928
+ "aria-controls": panelId,
2929
+ onClick: () => toggle()
2930
+ }),
2931
+ [open, panelId, toggle]
2932
+ );
2933
+ const getPanelProps = (0, import_react50.useCallback)(
2934
+ (baseClassName = "kds-expand-panel") => ({
2935
+ id: panelId,
2936
+ className: open ? `${baseClassName} open` : baseClassName,
2937
+ hidden: !open,
2938
+ ref: setPanelRef
2939
+ }),
2940
+ [open, panelId, setPanelRef]
2941
+ );
2942
+ return { open, setOpen, toggle, getToggleProps, getPanelProps };
2943
+ }
2944
+
2945
+ // src/components/core/hooks/useHideOnScroll.ts
2946
+ var import_react51 = require("react");
2947
+ function useHideOnScroll(options = {}) {
2948
+ const { threshold = 8, topOffset = 0 } = options;
2949
+ const [hidden, setHidden] = (0, import_react51.useState)(false);
2950
+ (0, import_react51.useEffect)(() => {
2951
+ let viewportOffset = 0;
2952
+ let lastY = 0;
2953
+ let ticking = false;
2954
+ const currentY = () => Math.max(window.scrollY || window.pageYOffset || 0, viewportOffset);
2955
+ const apply = () => {
2956
+ ticking = false;
2957
+ const y = currentY();
2958
+ if (y <= topOffset) {
2959
+ setHidden(false);
2960
+ lastY = y;
2961
+ return;
2962
+ }
2963
+ const delta = y - lastY;
2964
+ if (Math.abs(delta) < threshold) return;
2965
+ setHidden(delta > 0);
2966
+ lastY = y;
2967
+ };
2968
+ const onScroll = () => {
2969
+ if (ticking) return;
2970
+ ticking = true;
2971
+ window.requestAnimationFrame(apply);
2972
+ };
2973
+ const onMessage = (event) => {
2974
+ if (event.data && event.data.type === "VIEWPORT_OFFSET") {
2975
+ viewportOffset = Math.max(0, event.data.offsetTop || 0);
2976
+ onScroll();
2977
+ }
2978
+ };
2979
+ lastY = currentY();
2980
+ window.addEventListener("scroll", onScroll, { passive: true });
2981
+ window.addEventListener("resize", onScroll);
2982
+ window.addEventListener("message", onMessage);
2983
+ return () => {
2984
+ window.removeEventListener("scroll", onScroll);
2985
+ window.removeEventListener("resize", onScroll);
2986
+ window.removeEventListener("message", onMessage);
2987
+ };
2988
+ }, [threshold, topOffset]);
2989
+ return { hidden };
2990
+ }
2103
2991
  // Annotate the CommonJS export names for ESM import in node:
2104
2992
  0 && (module.exports = {
2105
2993
  KdsAccordion,
@@ -2109,6 +2997,8 @@ KdsRecapList.displayName = "KdsRecapList";
2109
2997
  KdsBankList,
2110
2998
  KdsBankModal,
2111
2999
  KdsBankRow,
3000
+ KdsBillAttachment,
3001
+ KdsBillAttachments,
2112
3002
  KdsBottomSheet,
2113
3003
  KdsButton,
2114
3004
  KdsCard,
@@ -2119,24 +3009,26 @@ KdsRecapList.displayName = "KdsRecapList";
2119
3009
  KdsCardSelector,
2120
3010
  KdsCheckbox,
2121
3011
  KdsChip,
3012
+ KdsCopyButton,
2122
3013
  KdsCopyRow,
2123
3014
  KdsCopyableTable,
2124
3015
  KdsCountdown,
2125
3016
  KdsDivider,
2126
3017
  KdsExpandPanel,
3018
+ KdsFab,
3019
+ KdsInvoiceMerchant,
2127
3020
  KdsInvoiceSticky,
2128
3021
  KdsLinearProgress,
2129
- KdsLogoHeader,
2130
- KdsLogoHeaderCloseButton,
2131
- KdsLogoHeaderCode,
2132
- KdsLogoHeaderLogo,
2133
- KdsLogoHeaderSeparator,
2134
- KdsModal,
3022
+ KdsMerchantTile,
3023
+ KdsMontoRow,
3024
+ KdsPaymentTotal,
2135
3025
  KdsQrRow,
2136
3026
  KdsRadioGroup,
2137
3027
  KdsRecapList,
3028
+ KdsSearchField,
2138
3029
  KdsSectionNote,
2139
3030
  KdsSecureFooter,
3031
+ KdsSecureLoader,
2140
3032
  KdsSegmentedTabs,
2141
3033
  KdsSelect,
2142
3034
  KdsSnackbar,
@@ -2150,6 +3042,7 @@ KdsRecapList.displayName = "KdsRecapList";
2150
3042
  KdsThemeProvider,
2151
3043
  KdsTooltip,
2152
3044
  KdsTypography,
3045
+ LIGHT_LOGO_LUMINANCE_THRESHOLD,
2153
3046
  borderRadius,
2154
3047
  breakpoints,
2155
3048
  clsx,
@@ -2158,10 +3051,15 @@ KdsRecapList.displayName = "KdsRecapList";
2158
3051
  fontFamilies,
2159
3052
  fontSizes,
2160
3053
  fontWeights,
3054
+ formatDate,
3055
+ formatDateTime,
3056
+ formatTime,
2161
3057
  getContrastColor,
2162
3058
  letterSpacings,
2163
3059
  lighten,
2164
3060
  lineHeights,
3061
+ measureLogoLuminance,
3062
+ pickLogoBackdrop,
2165
3063
  semanticSpacing,
2166
3064
  shadows,
2167
3065
  spacing,
@@ -2172,6 +3070,10 @@ KdsRecapList.displayName = "KdsRecapList";
2172
3070
  useAutoHide,
2173
3071
  useCopyToClipboard,
2174
3072
  useCountdown,
3073
+ useExpandToggle,
3074
+ useHideOnScroll,
3075
+ useLogoBackdrop,
3076
+ useStickyInvoiceCollapse,
2175
3077
  useTabsKeyboard,
2176
3078
  zIndex
2177
3079
  });