@khipu/design-system 0.2.0-alpha.14 → 0.2.0-alpha.140

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