@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.
- package/dist/beercss/arch.svg +1 -0
- package/dist/beercss/arrow.svg +1 -0
- package/dist/beercss/boom.svg +1 -0
- package/dist/beercss/bun.svg +1 -0
- package/dist/beercss/burst.svg +1 -0
- package/dist/beercss/circle.svg +1 -0
- package/dist/beercss/clamshell.svg +1 -0
- package/dist/beercss/diamond.svg +1 -0
- package/dist/beercss/fan.svg +1 -0
- package/dist/beercss/flower.svg +1 -0
- package/dist/beercss/gem.svg +1 -0
- package/dist/beercss/ghost-ish.svg +1 -0
- package/dist/beercss/heart.svg +1 -0
- package/dist/beercss/khipu-beercss.css +2405 -264
- package/dist/beercss/khipu-beercss.js +152 -4
- package/dist/beercss/khipu-beercss.min.css +1 -1
- package/dist/beercss/khipu-beercss.min.js +1 -1
- package/dist/beercss/khipu-beercss.scoped.css +9183 -0
- package/dist/beercss/khipu-beercss.scoped.min.css +1 -0
- package/dist/beercss/leaf-clover4.svg +1 -0
- package/dist/beercss/leaf-clover8.svg +1 -0
- package/dist/beercss/loading-indicator.svg +1 -0
- package/dist/beercss/material-symbols-outlined.woff2 +0 -0
- package/dist/beercss/material-symbols-rounded.woff2 +0 -0
- package/dist/beercss/material-symbols-sharp.woff2 +0 -0
- package/dist/beercss/material-symbols-subset.woff2 +0 -0
- package/dist/beercss/metadata.json +8 -4
- package/dist/beercss/oval.svg +1 -0
- package/dist/beercss/pentagon.svg +1 -0
- package/dist/beercss/pill.svg +1 -0
- package/dist/beercss/pixel-circle.svg +1 -0
- package/dist/beercss/pixel-triangle.svg +1 -0
- package/dist/beercss/puffy-diamond.svg +1 -0
- package/dist/beercss/puffy.svg +1 -0
- package/dist/beercss/semicircle.svg +1 -0
- package/dist/beercss/sided-cookie12.svg +1 -0
- package/dist/beercss/sided-cookie4.svg +1 -0
- package/dist/beercss/sided-cookie6.svg +1 -0
- package/dist/beercss/sided-cookie7.svg +1 -0
- package/dist/beercss/sided-cookie9.svg +1 -0
- package/dist/beercss/slanted.svg +1 -0
- package/dist/beercss/soft-boom.svg +1 -0
- package/dist/beercss/soft-burst.svg +1 -0
- package/dist/beercss/square.svg +1 -0
- package/dist/beercss/sunny.svg +1 -0
- package/dist/beercss/triangle.svg +1 -0
- package/dist/beercss/very-sunny.svg +1 -0
- package/dist/beercss/wavy-circle.svg +1 -0
- package/dist/beercss/wavy.svg +1 -0
- package/dist/index.d.mts +1078 -266
- package/dist/index.d.ts +1078 -266
- package/dist/index.js +1582 -528
- package/dist/index.mjs +1533 -500
- package/package.json +14 -10
- package/dist/khipu-logo-color-TV75AKOV.svg +0 -19
package/dist/index.mjs
CHANGED
|
@@ -34,6 +34,40 @@ function lighten(hex, amount) {
|
|
|
34
34
|
b + (255 - b) * amount
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
|
+
function formatDateTime(iso) {
|
|
38
|
+
if (!iso) {
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
const date = new Date(iso);
|
|
42
|
+
if (Number.isNaN(date.getTime())) {
|
|
43
|
+
return "";
|
|
44
|
+
}
|
|
45
|
+
const pad = (n) => n.toString().padStart(2, "0");
|
|
46
|
+
const datePart = `${pad(date.getDate())}-${pad(date.getMonth() + 1)}-${date.getFullYear()}`;
|
|
47
|
+
const timePart = `${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
48
|
+
return `${datePart} ${timePart}`;
|
|
49
|
+
}
|
|
50
|
+
function formatDate(iso) {
|
|
51
|
+
if (!iso) {
|
|
52
|
+
return "";
|
|
53
|
+
}
|
|
54
|
+
const date = new Date(iso);
|
|
55
|
+
if (Number.isNaN(date.getTime())) {
|
|
56
|
+
return "";
|
|
57
|
+
}
|
|
58
|
+
return `${date.getDate()}-${date.getMonth() + 1}-${date.getFullYear()}`;
|
|
59
|
+
}
|
|
60
|
+
function formatTime(iso) {
|
|
61
|
+
if (!iso) {
|
|
62
|
+
return "";
|
|
63
|
+
}
|
|
64
|
+
const date = new Date(iso);
|
|
65
|
+
if (Number.isNaN(date.getTime())) {
|
|
66
|
+
return "";
|
|
67
|
+
}
|
|
68
|
+
const pad = (n) => n.toString().padStart(2, "0");
|
|
69
|
+
return `${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
70
|
+
}
|
|
37
71
|
|
|
38
72
|
// src/theme/KdsThemeProvider.tsx
|
|
39
73
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -347,6 +381,8 @@ var semanticColors = {
|
|
|
347
381
|
// From Figma: warning/light
|
|
348
382
|
dark: "#E65100",
|
|
349
383
|
// From Figma: warning/dark
|
|
384
|
+
warm: "#8A6D1A",
|
|
385
|
+
// Warm/olive variant for header icons (LigoPay handoff v2)
|
|
350
386
|
container: "#FFFBEB",
|
|
351
387
|
// Light amber background for chips/badges
|
|
352
388
|
contrastText: "#FFFFFF"
|
|
@@ -365,6 +401,8 @@ var semanticColors = {
|
|
|
365
401
|
main: "#0288D1",
|
|
366
402
|
light: "#03A9F4",
|
|
367
403
|
dark: "#01579B",
|
|
404
|
+
blue: "#5A5FE0",
|
|
405
|
+
// Khipu-blue / LigoPay informational blue (distinct from cyan main)
|
|
368
406
|
container: "#EFF6FF",
|
|
369
407
|
// Light blue background for chips/badges
|
|
370
408
|
contrastText: "#FFFFFF"
|
|
@@ -391,6 +429,8 @@ var fontWeights = {
|
|
|
391
429
|
bold: 700
|
|
392
430
|
};
|
|
393
431
|
var fontSizes = {
|
|
432
|
+
"2xs": "0.625rem",
|
|
433
|
+
// 10px — tiny captions (version footer, fine print)
|
|
394
434
|
xs: "0.75rem",
|
|
395
435
|
// 12px
|
|
396
436
|
sm: "0.875rem",
|
|
@@ -407,8 +447,10 @@ var fontSizes = {
|
|
|
407
447
|
// 24px
|
|
408
448
|
"3xl": "1.875rem",
|
|
409
449
|
// 30px
|
|
410
|
-
"4xl": "2.25rem"
|
|
450
|
+
"4xl": "2.25rem",
|
|
411
451
|
// 36px
|
|
452
|
+
decimalSup: "0.5em"
|
|
453
|
+
// Relative size for decimal superscript in amount displays
|
|
412
454
|
};
|
|
413
455
|
var lineHeights = {
|
|
414
456
|
tight: 1.2,
|
|
@@ -811,6 +853,8 @@ var responsiveTypography = {
|
|
|
811
853
|
}
|
|
812
854
|
};
|
|
813
855
|
var responsiveBaseFontSizes = {
|
|
856
|
+
"2xs": { mobile: "0.5625rem", tablet: "0.625rem", desktop: "0.625rem" },
|
|
857
|
+
// 9px → 10px
|
|
814
858
|
xs: { mobile: "0.6875rem", tablet: "0.75rem", desktop: "0.75rem" },
|
|
815
859
|
// 11px → 12px
|
|
816
860
|
sm: { mobile: "0.8125rem", tablet: "0.875rem", desktop: "0.875rem" },
|
|
@@ -1023,7 +1067,7 @@ var KdsButton = forwardRef(
|
|
|
1023
1067
|
children,
|
|
1024
1068
|
className,
|
|
1025
1069
|
...props
|
|
1026
|
-
}, ref) => /* @__PURE__ */
|
|
1070
|
+
}, ref) => /* @__PURE__ */ jsx2(
|
|
1027
1071
|
"button",
|
|
1028
1072
|
{
|
|
1029
1073
|
ref,
|
|
@@ -1037,21 +1081,25 @@ var KdsButton = forwardRef(
|
|
|
1037
1081
|
disabled: disabled || loading,
|
|
1038
1082
|
"aria-busy": loading || void 0,
|
|
1039
1083
|
...props,
|
|
1040
|
-
children: [
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1084
|
+
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1085
|
+
/* @__PURE__ */ jsx2("progress", { className: "circle indeterminate small" }),
|
|
1086
|
+
/* @__PURE__ */ jsx2("span", { children })
|
|
1087
|
+
] }) : (
|
|
1088
|
+
/* Iconos DENTRO del label (inline): si el texto envuelve en pantallas angostas,
|
|
1089
|
+
el icono fluye con la primera linea en vez de quedar anclado al borde del boton. */
|
|
1090
|
+
/* @__PURE__ */ jsxs("span", { className: "kds-btn-label", children: [
|
|
1091
|
+
startIcon && /* @__PURE__ */ jsx2("span", { className: "kds-icon kds-icon-start", children: /* @__PURE__ */ jsx2("i", { className: "material-symbols-outlined", children: startIcon }) }),
|
|
1092
|
+
children,
|
|
1093
|
+
endIcon && /* @__PURE__ */ jsx2("span", { className: "kds-icon kds-icon-end", children: /* @__PURE__ */ jsx2("i", { className: "material-symbols-outlined", children: endIcon }) })
|
|
1094
|
+
] })
|
|
1095
|
+
)
|
|
1048
1096
|
}
|
|
1049
1097
|
)
|
|
1050
1098
|
);
|
|
1051
1099
|
KdsButton.displayName = "KdsButton";
|
|
1052
1100
|
|
|
1053
1101
|
// src/components/core/KdsTextField/KdsTextField.tsx
|
|
1054
|
-
import { forwardRef as forwardRef2 } from "react";
|
|
1102
|
+
import { forwardRef as forwardRef2, useState } from "react";
|
|
1055
1103
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1056
1104
|
var KdsTextField = forwardRef2(
|
|
1057
1105
|
({
|
|
@@ -1059,14 +1107,31 @@ var KdsTextField = forwardRef2(
|
|
|
1059
1107
|
helperText,
|
|
1060
1108
|
error,
|
|
1061
1109
|
fullWidth = true,
|
|
1110
|
+
narrow = false,
|
|
1062
1111
|
readOnly,
|
|
1063
1112
|
startIcon,
|
|
1064
1113
|
endIcon,
|
|
1114
|
+
required,
|
|
1065
1115
|
className,
|
|
1066
1116
|
id,
|
|
1117
|
+
type,
|
|
1118
|
+
revealable,
|
|
1119
|
+
revealLabel = "Mostrar u ocultar contrase\xF1a",
|
|
1120
|
+
requiredMark = true,
|
|
1067
1121
|
...props
|
|
1068
1122
|
}, ref) => {
|
|
1123
|
+
const [revealed, setRevealed] = useState(false);
|
|
1069
1124
|
const fieldId = id || `kds-field-${label.toLowerCase().replace(/\s+/g, "-")}`;
|
|
1125
|
+
const isRevealable = !!revealable && !readOnly && !props.disabled;
|
|
1126
|
+
const inputType = isRevealable ? revealed ? "text" : "password" : type;
|
|
1127
|
+
const hasSuffix = !!endIcon || readOnly || isRevealable;
|
|
1128
|
+
const toggleReveal = () => setRevealed((v) => !v);
|
|
1129
|
+
const onToggleKeyDown = (e) => {
|
|
1130
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1131
|
+
e.preventDefault();
|
|
1132
|
+
toggleReveal();
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1070
1135
|
return /* @__PURE__ */ jsxs2(
|
|
1071
1136
|
"div",
|
|
1072
1137
|
{
|
|
@@ -1074,9 +1139,12 @@ var KdsTextField = forwardRef2(
|
|
|
1074
1139
|
"field",
|
|
1075
1140
|
"label",
|
|
1076
1141
|
"border",
|
|
1142
|
+
startIcon && "prefix",
|
|
1143
|
+
hasSuffix && "suffix",
|
|
1077
1144
|
error && "invalid",
|
|
1078
1145
|
readOnly && "locked",
|
|
1079
|
-
fullWidth && "kds-w-full",
|
|
1146
|
+
fullWidth && !narrow && "kds-w-full",
|
|
1147
|
+
narrow && "kds-field--narrow",
|
|
1080
1148
|
className
|
|
1081
1149
|
),
|
|
1082
1150
|
children: [
|
|
@@ -1086,14 +1154,32 @@ var KdsTextField = forwardRef2(
|
|
|
1086
1154
|
{
|
|
1087
1155
|
ref,
|
|
1088
1156
|
id: fieldId,
|
|
1089
|
-
|
|
1157
|
+
type: inputType,
|
|
1090
1158
|
readOnly,
|
|
1091
|
-
|
|
1159
|
+
required,
|
|
1160
|
+
...props,
|
|
1161
|
+
placeholder: " "
|
|
1092
1162
|
}
|
|
1093
1163
|
),
|
|
1094
|
-
/* @__PURE__ */
|
|
1164
|
+
/* @__PURE__ */ jsxs2("label", { htmlFor: fieldId, children: [
|
|
1165
|
+
label,
|
|
1166
|
+
required && requiredMark && " *"
|
|
1167
|
+
] }),
|
|
1095
1168
|
readOnly && /* @__PURE__ */ jsx3("i", { className: "material-symbols-outlined", children: "lock" }),
|
|
1096
|
-
|
|
1169
|
+
isRevealable && /* @__PURE__ */ jsx3(
|
|
1170
|
+
"a",
|
|
1171
|
+
{
|
|
1172
|
+
className: "kds-field-reveal",
|
|
1173
|
+
role: "button",
|
|
1174
|
+
tabIndex: 0,
|
|
1175
|
+
"aria-label": revealLabel,
|
|
1176
|
+
"aria-pressed": revealed,
|
|
1177
|
+
onClick: toggleReveal,
|
|
1178
|
+
onKeyDown: onToggleKeyDown,
|
|
1179
|
+
children: /* @__PURE__ */ jsx3("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: revealed ? "visibility" : "visibility_off" })
|
|
1180
|
+
}
|
|
1181
|
+
),
|
|
1182
|
+
endIcon && !readOnly && !isRevealable && /* @__PURE__ */ jsx3("i", { className: "material-symbols-outlined", children: endIcon }),
|
|
1097
1183
|
helperText && /* @__PURE__ */ jsx3("span", { className: "helper", children: helperText })
|
|
1098
1184
|
]
|
|
1099
1185
|
}
|
|
@@ -1102,76 +1188,41 @@ var KdsTextField = forwardRef2(
|
|
|
1102
1188
|
);
|
|
1103
1189
|
KdsTextField.displayName = "KdsTextField";
|
|
1104
1190
|
|
|
1105
|
-
// src/components/core/
|
|
1191
|
+
// src/components/core/KdsSearchField/KdsSearchField.tsx
|
|
1106
1192
|
import { forwardRef as forwardRef3 } from "react";
|
|
1107
1193
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1108
|
-
var
|
|
1109
|
-
({
|
|
1110
|
-
const
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1194
|
+
var KdsSearchField = forwardRef3(
|
|
1195
|
+
({ className, withIcon = false, ...props }, ref) => {
|
|
1196
|
+
const input = /* @__PURE__ */ jsx4(
|
|
1197
|
+
"input",
|
|
1198
|
+
{
|
|
1199
|
+
ref,
|
|
1200
|
+
type: "search",
|
|
1201
|
+
className: clsx("kds-search-field", className),
|
|
1202
|
+
...props
|
|
1203
|
+
}
|
|
1204
|
+
);
|
|
1205
|
+
if (!withIcon) {
|
|
1206
|
+
return input;
|
|
1207
|
+
}
|
|
1208
|
+
return /* @__PURE__ */ jsxs3("div", { className: "kds-search-field-wrapper", children: [
|
|
1209
|
+
/* @__PURE__ */ jsx4("i", { className: "material-symbols-outlined kds-search-field-icon", "aria-hidden": "true", children: "search" }),
|
|
1210
|
+
input
|
|
1114
1211
|
] });
|
|
1115
1212
|
}
|
|
1116
1213
|
);
|
|
1117
|
-
|
|
1214
|
+
KdsSearchField.displayName = "KdsSearchField";
|
|
1118
1215
|
|
|
1119
|
-
// src/components/core/
|
|
1216
|
+
// src/components/core/KdsCheckbox/KdsCheckbox.tsx
|
|
1120
1217
|
import { forwardRef as forwardRef4 } from "react";
|
|
1121
|
-
import * as Dialog from "@radix-ui/react-dialog";
|
|
1122
1218
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1123
|
-
var
|
|
1124
|
-
({
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
description,
|
|
1129
|
-
footer,
|
|
1130
|
-
children,
|
|
1131
|
-
size = "md",
|
|
1132
|
-
showCloseButton = true,
|
|
1133
|
-
className
|
|
1134
|
-
}, ref) => /* @__PURE__ */ jsx5(
|
|
1135
|
-
Dialog.Root,
|
|
1136
|
-
{
|
|
1137
|
-
open,
|
|
1138
|
-
onOpenChange: (o) => {
|
|
1139
|
-
if (!o) onClose();
|
|
1140
|
-
},
|
|
1141
|
-
children: /* @__PURE__ */ jsxs4(Dialog.Portal, { children: [
|
|
1142
|
-
/* @__PURE__ */ jsx5(Dialog.Overlay, { className: "kds-bottom-sheet-scrim" }),
|
|
1143
|
-
/* @__PURE__ */ jsxs4(
|
|
1144
|
-
Dialog.Content,
|
|
1145
|
-
{
|
|
1146
|
-
ref,
|
|
1147
|
-
className: clsx(
|
|
1148
|
-
"kds-bottom-sheet",
|
|
1149
|
-
`kds-bottom-sheet-${size}`,
|
|
1150
|
-
className
|
|
1151
|
-
),
|
|
1152
|
-
children: [
|
|
1153
|
-
title && /* @__PURE__ */ jsxs4("div", { className: "kds-bottom-sheet-header", children: [
|
|
1154
|
-
/* @__PURE__ */ jsx5(Dialog.Title, { className: "kds-bottom-sheet-title", children: title }),
|
|
1155
|
-
showCloseButton && /* @__PURE__ */ jsx5(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx5(
|
|
1156
|
-
"button",
|
|
1157
|
-
{
|
|
1158
|
-
className: "kds-bottom-sheet-close",
|
|
1159
|
-
"aria-label": "Cerrar",
|
|
1160
|
-
children: /* @__PURE__ */ jsx5("i", { className: "material-symbols-outlined", children: "close" })
|
|
1161
|
-
}
|
|
1162
|
-
) })
|
|
1163
|
-
] }),
|
|
1164
|
-
description && /* @__PURE__ */ jsx5(Dialog.Description, { className: "kds-bottom-sheet-description", children: description }),
|
|
1165
|
-
/* @__PURE__ */ jsx5("div", { className: "kds-bottom-sheet-body", children }),
|
|
1166
|
-
footer && /* @__PURE__ */ jsx5("div", { className: "kds-bottom-sheet-actions", children: footer })
|
|
1167
|
-
]
|
|
1168
|
-
}
|
|
1169
|
-
)
|
|
1170
|
-
] })
|
|
1171
|
-
}
|
|
1172
|
-
)
|
|
1219
|
+
var KdsCheckbox = forwardRef4(
|
|
1220
|
+
({ label, className, ...props }, ref) => /* @__PURE__ */ jsxs4("label", { className: clsx("checkbox", className), children: [
|
|
1221
|
+
/* @__PURE__ */ jsx5("input", { ref, type: "checkbox", ...props }),
|
|
1222
|
+
/* @__PURE__ */ jsx5("span", { children: label })
|
|
1223
|
+
] })
|
|
1173
1224
|
);
|
|
1174
|
-
|
|
1225
|
+
KdsCheckbox.displayName = "KdsCheckbox";
|
|
1175
1226
|
|
|
1176
1227
|
// src/components/core/KdsCard/KdsCard.tsx
|
|
1177
1228
|
import { forwardRef as forwardRef5 } from "react";
|
|
@@ -1208,50 +1259,161 @@ KdsCardFooter.displayName = "KdsCardFooter";
|
|
|
1208
1259
|
// src/components/core/KdsSpinner/KdsSpinner.tsx
|
|
1209
1260
|
import { forwardRef as forwardRef6 } from "react";
|
|
1210
1261
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1262
|
+
var SIZE_CLASS = {
|
|
1263
|
+
small: "small",
|
|
1264
|
+
medium: null,
|
|
1265
|
+
large: "large"
|
|
1266
|
+
};
|
|
1211
1267
|
var KdsSpinner = forwardRef6(
|
|
1212
|
-
({ size = "medium", label, className, ...props }, ref) =>
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1268
|
+
({ size = "medium", label, className, ...props }, ref) => {
|
|
1269
|
+
const sizeClass = SIZE_CLASS[size];
|
|
1270
|
+
return /* @__PURE__ */ jsxs5(
|
|
1271
|
+
"div",
|
|
1272
|
+
{
|
|
1273
|
+
ref,
|
|
1274
|
+
className: clsx("kds-flex kds-flex-col kds-items-center kds-gap-2", className),
|
|
1275
|
+
role: "status",
|
|
1276
|
+
...props,
|
|
1277
|
+
children: [
|
|
1278
|
+
/* @__PURE__ */ jsx7("progress", { className: clsx("circle indeterminate", sizeClass) }),
|
|
1279
|
+
label && /* @__PURE__ */ jsx7("span", { className: "kds-text-body-small kds-text-muted", children: label }),
|
|
1280
|
+
!label && /* @__PURE__ */ jsx7("span", { className: "kds-hidden", children: "Cargando" })
|
|
1281
|
+
]
|
|
1282
|
+
}
|
|
1283
|
+
);
|
|
1284
|
+
}
|
|
1217
1285
|
);
|
|
1218
1286
|
KdsSpinner.displayName = "KdsSpinner";
|
|
1219
1287
|
|
|
1220
|
-
// src/components/core/
|
|
1288
|
+
// src/components/core/KdsSecureLoader/KdsSecureLoader.tsx
|
|
1221
1289
|
import { forwardRef as forwardRef7 } from "react";
|
|
1222
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1223
|
-
var
|
|
1224
|
-
({
|
|
1290
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1291
|
+
var KdsSecureLoader = forwardRef7(
|
|
1292
|
+
({ title, message, className, ...props }, ref) => /* @__PURE__ */ jsxs6("div", { ref, className: clsx("kds-secure-loader", className), role: "status", "aria-busy": "true", ...props, children: [
|
|
1293
|
+
(title || message) && /* @__PURE__ */ jsxs6("div", { className: "kds-secure-loader-text", children: [
|
|
1294
|
+
title && /* @__PURE__ */ jsx8("p", { className: "kds-secure-loader-title", children: title }),
|
|
1295
|
+
message && /* @__PURE__ */ jsx8("p", { className: "kds-secure-loader-message", children: message })
|
|
1296
|
+
] }),
|
|
1297
|
+
/* @__PURE__ */ jsxs6("div", { className: "kds-secure-loader-spinner", children: [
|
|
1298
|
+
/* @__PURE__ */ jsx8(
|
|
1299
|
+
"svg",
|
|
1300
|
+
{
|
|
1301
|
+
className: "kds-secure-loader-ring",
|
|
1302
|
+
viewBox: "22 22 44 44",
|
|
1303
|
+
width: "100",
|
|
1304
|
+
height: "100",
|
|
1305
|
+
fill: "none",
|
|
1306
|
+
"aria-hidden": "true",
|
|
1307
|
+
children: /* @__PURE__ */ jsx8("circle", { cx: "44", cy: "44", r: "20.2", fill: "none" })
|
|
1308
|
+
}
|
|
1309
|
+
),
|
|
1310
|
+
/* @__PURE__ */ jsx8("i", { className: "material-symbols-outlined kds-secure-loader-lock", "aria-hidden": "true", children: "lock" })
|
|
1311
|
+
] })
|
|
1312
|
+
] })
|
|
1313
|
+
);
|
|
1314
|
+
KdsSecureLoader.displayName = "KdsSecureLoader";
|
|
1315
|
+
|
|
1316
|
+
// src/components/core/KdsCopyButton/KdsCopyButton.tsx
|
|
1317
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
1318
|
+
|
|
1319
|
+
// src/components/core/hooks/useCopyToClipboard.ts
|
|
1320
|
+
import { useState as useState2, useCallback } from "react";
|
|
1321
|
+
function useCopyToClipboard(resetMs = 1200) {
|
|
1322
|
+
const [copied, setCopied] = useState2(false);
|
|
1323
|
+
const copy = useCallback(
|
|
1324
|
+
async (text) => {
|
|
1325
|
+
try {
|
|
1326
|
+
await navigator.clipboard.writeText(text);
|
|
1327
|
+
setCopied(true);
|
|
1328
|
+
setTimeout(() => setCopied(false), resetMs);
|
|
1329
|
+
} catch {
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
[resetMs]
|
|
1333
|
+
);
|
|
1334
|
+
return { copied, copy };
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
// src/components/core/KdsCopyButton/KdsCopyButton.tsx
|
|
1338
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1339
|
+
var KdsCopyButton = forwardRef8(
|
|
1340
|
+
({ value, copiedText = "Copiado", className, ...props }, ref) => {
|
|
1341
|
+
const { copied, copy } = useCopyToClipboard();
|
|
1342
|
+
return /* @__PURE__ */ jsxs7(
|
|
1343
|
+
"button",
|
|
1344
|
+
{
|
|
1345
|
+
ref,
|
|
1346
|
+
type: "button",
|
|
1347
|
+
className: clsx("kds-copy-button", copied && "copied", className),
|
|
1348
|
+
onClick: () => copy(value),
|
|
1349
|
+
"aria-label": `Copiar: ${value}`,
|
|
1350
|
+
...props,
|
|
1351
|
+
children: [
|
|
1352
|
+
/* @__PURE__ */ jsxs7("span", { className: "kds-copy-button-label", children: [
|
|
1353
|
+
/* @__PURE__ */ jsx9("span", { className: "kds-copy-button-value", "aria-hidden": copied || void 0, children: value }),
|
|
1354
|
+
/* @__PURE__ */ jsx9("span", { className: "kds-copy-button-copied", "aria-hidden": !copied || void 0, children: copiedText })
|
|
1355
|
+
] }),
|
|
1356
|
+
/* @__PURE__ */ jsx9("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: copied ? "check" : "content_copy" })
|
|
1357
|
+
]
|
|
1358
|
+
}
|
|
1359
|
+
);
|
|
1360
|
+
}
|
|
1361
|
+
);
|
|
1362
|
+
KdsCopyButton.displayName = "KdsCopyButton";
|
|
1363
|
+
|
|
1364
|
+
// src/components/core/KdsLinearProgress/KdsLinearProgress.tsx
|
|
1365
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
1366
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1367
|
+
var KdsLinearProgress = forwardRef9(
|
|
1368
|
+
({ value, max = 100, className, ...props }, ref) => /* @__PURE__ */ jsx10("progress", { ref, className: clsx("kds-progress", className), value, max, ...props })
|
|
1225
1369
|
);
|
|
1226
1370
|
KdsLinearProgress.displayName = "KdsLinearProgress";
|
|
1227
1371
|
|
|
1228
1372
|
// src/components/core/KdsAlert/KdsAlert.tsx
|
|
1229
|
-
import { forwardRef as
|
|
1230
|
-
import { jsx as
|
|
1231
|
-
var
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1373
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
1374
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1375
|
+
var DEFAULT_ICONS = {
|
|
1376
|
+
success: "check_circle",
|
|
1377
|
+
info: "info",
|
|
1378
|
+
warning: "warning",
|
|
1379
|
+
error: "error"
|
|
1380
|
+
};
|
|
1381
|
+
var KdsAlert = forwardRef10(
|
|
1382
|
+
({ severity, title, icon, inline, onClose, children, className, ...props }, ref) => {
|
|
1383
|
+
const resolvedIcon = icon === false ? null : typeof icon === "string" ? icon : DEFAULT_ICONS[severity];
|
|
1384
|
+
return /* @__PURE__ */ jsxs8(
|
|
1385
|
+
"div",
|
|
1386
|
+
{
|
|
1387
|
+
ref,
|
|
1388
|
+
role: "alert",
|
|
1389
|
+
className: clsx("kds-alert", `kds-${severity}`, inline && "kds-alert-inline", className),
|
|
1390
|
+
...props,
|
|
1391
|
+
children: [
|
|
1392
|
+
resolvedIcon && /* @__PURE__ */ jsx11("div", { className: "kds-alert-icon", children: /* @__PURE__ */ jsx11("i", { className: "material-symbols-outlined", children: resolvedIcon }) }),
|
|
1393
|
+
/* @__PURE__ */ jsxs8("div", { className: "kds-alert-content", children: [
|
|
1394
|
+
title && /* @__PURE__ */ jsx11("p", { className: "kds-alert-title", children: title }),
|
|
1395
|
+
/* @__PURE__ */ jsx11("p", { className: "kds-alert-description", children })
|
|
1396
|
+
] }),
|
|
1397
|
+
onClose && /* @__PURE__ */ jsx11(
|
|
1398
|
+
"button",
|
|
1399
|
+
{
|
|
1400
|
+
type: "button",
|
|
1401
|
+
className: "kds-alert-close",
|
|
1402
|
+
onClick: onClose,
|
|
1403
|
+
"aria-label": "Cerrar",
|
|
1404
|
+
children: /* @__PURE__ */ jsx11("i", { className: "material-symbols-outlined", children: "close" })
|
|
1405
|
+
}
|
|
1406
|
+
)
|
|
1407
|
+
]
|
|
1408
|
+
}
|
|
1409
|
+
);
|
|
1410
|
+
}
|
|
1249
1411
|
);
|
|
1250
1412
|
KdsAlert.displayName = "KdsAlert";
|
|
1251
1413
|
|
|
1252
1414
|
// src/components/core/KdsTypography/KdsTypography.tsx
|
|
1253
|
-
import { forwardRef as
|
|
1254
|
-
import { jsx as
|
|
1415
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
1416
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1255
1417
|
var variantTag = {
|
|
1256
1418
|
display1: "h1",
|
|
1257
1419
|
display2: "h2",
|
|
@@ -1263,13 +1425,18 @@ var variantTag = {
|
|
|
1263
1425
|
"body-small": "p",
|
|
1264
1426
|
label: "span",
|
|
1265
1427
|
"label-small": "span",
|
|
1428
|
+
"kv-label": "span",
|
|
1429
|
+
value: "span",
|
|
1430
|
+
code: "span",
|
|
1431
|
+
caption: "span",
|
|
1266
1432
|
muted: "p",
|
|
1267
|
-
link: "span"
|
|
1433
|
+
link: "span",
|
|
1434
|
+
strong: "span"
|
|
1268
1435
|
};
|
|
1269
|
-
var KdsTypography =
|
|
1436
|
+
var KdsTypography = forwardRef11(
|
|
1270
1437
|
({ variant = "body", color, as, children, className, ...props }, ref) => {
|
|
1271
1438
|
const Tag = as || variantTag[variant];
|
|
1272
|
-
return /* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ jsx12(
|
|
1273
1440
|
Tag,
|
|
1274
1441
|
{
|
|
1275
1442
|
ref,
|
|
@@ -1287,12 +1454,12 @@ var KdsTypography = forwardRef9(
|
|
|
1287
1454
|
KdsTypography.displayName = "KdsTypography";
|
|
1288
1455
|
|
|
1289
1456
|
// src/components/core/KdsTabs/KdsTabs.tsx
|
|
1290
|
-
import
|
|
1457
|
+
import React12, { forwardRef as forwardRef12, Children, useMemo } from "react";
|
|
1291
1458
|
|
|
1292
1459
|
// src/components/core/hooks/useTabsKeyboard.ts
|
|
1293
|
-
import { useCallback } from "react";
|
|
1460
|
+
import { useCallback as useCallback2 } from "react";
|
|
1294
1461
|
function useTabsKeyboard(tabCount, activeIndex, onChange) {
|
|
1295
|
-
const onKeyDown =
|
|
1462
|
+
const onKeyDown = useCallback2(
|
|
1296
1463
|
(e) => {
|
|
1297
1464
|
let next = activeIndex;
|
|
1298
1465
|
if (e.key === "ArrowRight") next = (activeIndex + 1) % tabCount;
|
|
@@ -1312,31 +1479,31 @@ function useTabsKeyboard(tabCount, activeIndex, onChange) {
|
|
|
1312
1479
|
}
|
|
1313
1480
|
|
|
1314
1481
|
// src/components/core/KdsTabs/KdsTabs.tsx
|
|
1315
|
-
import { jsx as
|
|
1316
|
-
var KdsTabs =
|
|
1317
|
-
({ activeIndex, onChange,
|
|
1482
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1483
|
+
var KdsTabs = forwardRef12(
|
|
1484
|
+
({ activeIndex, onChange, children, className, style, ...props }, ref) => {
|
|
1318
1485
|
const tabCount = Children.count(children);
|
|
1319
1486
|
const { onKeyDown } = useTabsKeyboard(tabCount, activeIndex, onChange);
|
|
1320
|
-
const mergedStyle = useMemo(
|
|
1321
|
-
|
|
1322
|
-
return {
|
|
1487
|
+
const mergedStyle = useMemo(
|
|
1488
|
+
() => ({
|
|
1323
1489
|
...style,
|
|
1324
1490
|
"--_tab-count": tabCount,
|
|
1325
1491
|
"--_active-idx": activeIndex
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
|
|
1492
|
+
}),
|
|
1493
|
+
[tabCount, activeIndex, style]
|
|
1494
|
+
);
|
|
1495
|
+
return /* @__PURE__ */ jsx13(
|
|
1329
1496
|
"div",
|
|
1330
1497
|
{
|
|
1331
1498
|
ref,
|
|
1332
1499
|
role: "tablist",
|
|
1333
|
-
className: clsx(
|
|
1500
|
+
className: clsx("kds-segmented-tabs", className),
|
|
1334
1501
|
style: mergedStyle,
|
|
1335
1502
|
onKeyDown,
|
|
1336
1503
|
...props,
|
|
1337
1504
|
children: Children.map(children, (child, i) => {
|
|
1338
|
-
if (!
|
|
1339
|
-
return
|
|
1505
|
+
if (!React12.isValidElement(child)) return child;
|
|
1506
|
+
return React12.cloneElement(child, {
|
|
1340
1507
|
_active: i === activeIndex,
|
|
1341
1508
|
_onClick: () => onChange(i)
|
|
1342
1509
|
});
|
|
@@ -1346,11 +1513,12 @@ var KdsTabs = forwardRef10(
|
|
|
1346
1513
|
}
|
|
1347
1514
|
);
|
|
1348
1515
|
KdsTabs.displayName = "KdsTabs";
|
|
1349
|
-
var KdsTab =
|
|
1350
|
-
({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */
|
|
1516
|
+
var KdsTab = forwardRef12(
|
|
1517
|
+
({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1351
1518
|
"button",
|
|
1352
1519
|
{
|
|
1353
1520
|
ref,
|
|
1521
|
+
type: "button",
|
|
1354
1522
|
role: "tab",
|
|
1355
1523
|
"aria-selected": _active,
|
|
1356
1524
|
tabIndex: _active ? 0 : -1,
|
|
@@ -1362,8 +1530,8 @@ var KdsTab = forwardRef10(
|
|
|
1362
1530
|
)
|
|
1363
1531
|
);
|
|
1364
1532
|
KdsTab.displayName = "KdsTab";
|
|
1365
|
-
var KdsTabPanel =
|
|
1366
|
-
({ active, children, className, ...props }, ref) => /* @__PURE__ */
|
|
1533
|
+
var KdsTabPanel = forwardRef12(
|
|
1534
|
+
({ active, children, className, ...props }, ref) => /* @__PURE__ */ jsx13(
|
|
1367
1535
|
"div",
|
|
1368
1536
|
{
|
|
1369
1537
|
ref,
|
|
@@ -1377,190 +1545,128 @@ var KdsTabPanel = forwardRef10(
|
|
|
1377
1545
|
);
|
|
1378
1546
|
KdsTabPanel.displayName = "KdsTabPanel";
|
|
1379
1547
|
|
|
1380
|
-
// src/components/core/KdsLogoHeader/KdsLogoHeader.tsx
|
|
1381
|
-
import { forwardRef as forwardRef11 } from "react";
|
|
1382
|
-
|
|
1383
|
-
// src/assets/images/khipu-logo-color.svg
|
|
1384
|
-
var khipu_logo_color_default = "./khipu-logo-color-TV75AKOV.svg";
|
|
1385
|
-
|
|
1386
|
-
// src/components/core/KdsLogoHeader/KdsLogoHeader.tsx
|
|
1387
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1388
|
-
var KhipuLogo = () => /* @__PURE__ */ jsx12(
|
|
1389
|
-
"img",
|
|
1390
|
-
{
|
|
1391
|
-
src: khipu_logo_color_default,
|
|
1392
|
-
alt: "Khipu",
|
|
1393
|
-
className: "kds-logo-header-logo-img"
|
|
1394
|
-
}
|
|
1395
|
-
);
|
|
1396
|
-
var KdsLogoHeaderLogo = forwardRef11(
|
|
1397
|
-
({ children, className, ...props }, ref) => {
|
|
1398
|
-
return /* @__PURE__ */ jsx12(
|
|
1399
|
-
"div",
|
|
1400
|
-
{
|
|
1401
|
-
ref,
|
|
1402
|
-
className: clsx("kds-logo-header-logo", className),
|
|
1403
|
-
...props,
|
|
1404
|
-
children: children || /* @__PURE__ */ jsx12(KhipuLogo, {})
|
|
1405
|
-
}
|
|
1406
|
-
);
|
|
1407
|
-
}
|
|
1408
|
-
);
|
|
1409
|
-
KdsLogoHeaderLogo.displayName = "KdsLogoHeaderLogo";
|
|
1410
|
-
var KdsLogoHeaderSeparator = forwardRef11(
|
|
1411
|
-
({ children = "|", className, ...props }, ref) => {
|
|
1412
|
-
return /* @__PURE__ */ jsx12(
|
|
1413
|
-
"span",
|
|
1414
|
-
{
|
|
1415
|
-
ref,
|
|
1416
|
-
className: clsx("kds-logo-header-separator", className),
|
|
1417
|
-
...props,
|
|
1418
|
-
children
|
|
1419
|
-
}
|
|
1420
|
-
);
|
|
1421
|
-
}
|
|
1422
|
-
);
|
|
1423
|
-
KdsLogoHeaderSeparator.displayName = "KdsLogoHeaderSeparator";
|
|
1424
|
-
var KdsLogoHeaderCode = forwardRef11(
|
|
1425
|
-
({ children, className, ...props }, ref) => {
|
|
1426
|
-
return /* @__PURE__ */ jsx12(
|
|
1427
|
-
"span",
|
|
1428
|
-
{
|
|
1429
|
-
ref,
|
|
1430
|
-
className: clsx("kds-logo-header-code", className),
|
|
1431
|
-
...props,
|
|
1432
|
-
children
|
|
1433
|
-
}
|
|
1434
|
-
);
|
|
1435
|
-
}
|
|
1436
|
-
);
|
|
1437
|
-
KdsLogoHeaderCode.displayName = "KdsLogoHeaderCode";
|
|
1438
|
-
var KdsLogoHeaderCloseButton = forwardRef11(
|
|
1439
|
-
({ onClose, className, ...props }, ref) => {
|
|
1440
|
-
return /* @__PURE__ */ jsx12("div", { className: "kds-logo-header-close-wrapper", children: /* @__PURE__ */ jsx12(
|
|
1441
|
-
"button",
|
|
1442
|
-
{
|
|
1443
|
-
ref,
|
|
1444
|
-
onClick: onClose,
|
|
1445
|
-
className: clsx("kds-btn kds-btn-icon", className),
|
|
1446
|
-
"aria-label": "close",
|
|
1447
|
-
...props,
|
|
1448
|
-
children: /* @__PURE__ */ jsx12("i", { className: "material-symbols-outlined", children: "close" })
|
|
1449
|
-
}
|
|
1450
|
-
) });
|
|
1451
|
-
}
|
|
1452
|
-
);
|
|
1453
|
-
KdsLogoHeaderCloseButton.displayName = "KdsLogoHeaderCloseButton";
|
|
1454
|
-
var KdsLogoHeader = forwardRef11(
|
|
1455
|
-
({ children, className, ...props }, ref) => {
|
|
1456
|
-
return /* @__PURE__ */ jsx12(
|
|
1457
|
-
"div",
|
|
1458
|
-
{
|
|
1459
|
-
ref,
|
|
1460
|
-
className: clsx("kds-brand-row", className),
|
|
1461
|
-
...props,
|
|
1462
|
-
children
|
|
1463
|
-
}
|
|
1464
|
-
);
|
|
1465
|
-
}
|
|
1466
|
-
);
|
|
1467
|
-
KdsLogoHeader.displayName = "KdsLogoHeader";
|
|
1468
|
-
|
|
1469
1548
|
// src/components/core/KdsRadioGroup/KdsRadioGroup.tsx
|
|
1470
|
-
import { forwardRef as
|
|
1471
|
-
import { jsx as
|
|
1472
|
-
var KdsRadioGroup =
|
|
1473
|
-
({ label, name, options, value, onChange, className, ...props }, ref) => /* @__PURE__ */
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1549
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
1550
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1551
|
+
var KdsRadioGroup = forwardRef13(
|
|
1552
|
+
({ label, name, options, value, onChange, size, variant, className, ...props }, ref) => /* @__PURE__ */ jsxs9(
|
|
1553
|
+
"fieldset",
|
|
1554
|
+
{
|
|
1555
|
+
ref,
|
|
1556
|
+
className: clsx("kds-radio-group", variant === "card" && "kds-radio-group--card", className),
|
|
1557
|
+
...props,
|
|
1558
|
+
children: [
|
|
1559
|
+
label && /* @__PURE__ */ jsx14("legend", { children: label }),
|
|
1560
|
+
options.map((opt) => /* @__PURE__ */ jsxs9("label", { className: clsx("radio", size), children: [
|
|
1561
|
+
/* @__PURE__ */ jsx14(
|
|
1562
|
+
"input",
|
|
1563
|
+
{
|
|
1564
|
+
type: "radio",
|
|
1565
|
+
name,
|
|
1566
|
+
value: opt.value,
|
|
1567
|
+
checked: value === opt.value,
|
|
1568
|
+
disabled: opt.disabled,
|
|
1569
|
+
onChange: () => onChange?.(opt.value)
|
|
1570
|
+
}
|
|
1571
|
+
),
|
|
1572
|
+
/* @__PURE__ */ jsx14("span", { children: opt.label })
|
|
1573
|
+
] }, opt.value))
|
|
1574
|
+
]
|
|
1575
|
+
}
|
|
1576
|
+
)
|
|
1490
1577
|
);
|
|
1491
1578
|
KdsRadioGroup.displayName = "KdsRadioGroup";
|
|
1492
1579
|
|
|
1493
1580
|
// src/components/core/KdsSelect/KdsSelect.tsx
|
|
1494
|
-
import { forwardRef as
|
|
1495
|
-
import
|
|
1496
|
-
|
|
1497
|
-
var KdsSelectRoot = forwardRef13(
|
|
1581
|
+
import { forwardRef as forwardRef14 } from "react";
|
|
1582
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1583
|
+
var KdsSelect = forwardRef14(
|
|
1498
1584
|
({
|
|
1499
|
-
value,
|
|
1500
|
-
onValueChange,
|
|
1501
|
-
placeholder,
|
|
1502
1585
|
label,
|
|
1503
|
-
|
|
1586
|
+
options,
|
|
1587
|
+
placeholder,
|
|
1504
1588
|
helperText,
|
|
1505
|
-
|
|
1589
|
+
error,
|
|
1590
|
+
prefixIcon,
|
|
1506
1591
|
fullWidth = true,
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
className
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1592
|
+
disabled,
|
|
1593
|
+
required,
|
|
1594
|
+
className,
|
|
1595
|
+
id,
|
|
1596
|
+
...props
|
|
1597
|
+
}, ref) => {
|
|
1598
|
+
const fieldId = id || `kds-select-${label.toLowerCase().replace(/\s+/g, "-")}`;
|
|
1599
|
+
return /* @__PURE__ */ jsxs10(
|
|
1600
|
+
"div",
|
|
1601
|
+
{
|
|
1602
|
+
className: clsx(
|
|
1603
|
+
"field",
|
|
1604
|
+
"label",
|
|
1605
|
+
"border",
|
|
1606
|
+
prefixIcon && "prefix",
|
|
1607
|
+
error && "invalid",
|
|
1608
|
+
fullWidth && "kds-w-full",
|
|
1609
|
+
className
|
|
1610
|
+
),
|
|
1611
|
+
children: [
|
|
1612
|
+
prefixIcon && /* @__PURE__ */ jsx15("i", { className: "material-symbols-outlined", children: prefixIcon }),
|
|
1613
|
+
/* @__PURE__ */ jsxs10(
|
|
1614
|
+
"select",
|
|
1615
|
+
{
|
|
1616
|
+
ref,
|
|
1617
|
+
id: fieldId,
|
|
1618
|
+
disabled,
|
|
1619
|
+
required,
|
|
1620
|
+
...props,
|
|
1621
|
+
children: [
|
|
1622
|
+
placeholder !== void 0 && /* @__PURE__ */ jsx15("option", { value: "", children: placeholder }),
|
|
1623
|
+
options.map((opt) => /* @__PURE__ */ jsx15("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value))
|
|
1624
|
+
]
|
|
1625
|
+
}
|
|
1626
|
+
),
|
|
1627
|
+
/* @__PURE__ */ jsxs10("label", { htmlFor: fieldId, children: [
|
|
1628
|
+
label,
|
|
1629
|
+
required && " *"
|
|
1525
1630
|
] }),
|
|
1526
|
-
|
|
1527
|
-
]
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
)
|
|
1532
|
-
);
|
|
1533
|
-
KdsSelectRoot.displayName = "KdsSelect";
|
|
1534
|
-
var KdsSelectItem = forwardRef13(
|
|
1535
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ jsxs8(Select.Item, { ref, className: clsx("kds-select-item", className), ...props, children: [
|
|
1536
|
-
/* @__PURE__ */ jsx14(Select.ItemText, { children }),
|
|
1537
|
-
/* @__PURE__ */ jsx14(Select.ItemIndicator, { className: "kds-select-item-indicator", children: /* @__PURE__ */ jsx14("i", { className: "material-symbols-outlined", children: "check" }) })
|
|
1538
|
-
] })
|
|
1631
|
+
helperText && /* @__PURE__ */ jsx15("span", { className: "helper", children: helperText })
|
|
1632
|
+
]
|
|
1633
|
+
}
|
|
1634
|
+
);
|
|
1635
|
+
}
|
|
1539
1636
|
);
|
|
1540
|
-
|
|
1541
|
-
var KdsSelect = Object.assign(KdsSelectRoot, {
|
|
1542
|
-
Item: KdsSelectItem
|
|
1543
|
-
});
|
|
1637
|
+
KdsSelect.displayName = "KdsSelect";
|
|
1544
1638
|
|
|
1545
1639
|
// src/components/core/KdsChip/KdsChip.tsx
|
|
1546
|
-
import { forwardRef as
|
|
1547
|
-
import { jsx as
|
|
1548
|
-
var KdsChip =
|
|
1549
|
-
({ color, icon, onDelete, children, className, ...props }, ref) => /* @__PURE__ */
|
|
1550
|
-
icon && /* @__PURE__ */
|
|
1551
|
-
children,
|
|
1552
|
-
onDelete && /* @__PURE__ */
|
|
1640
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
1641
|
+
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1642
|
+
var KdsChip = forwardRef15(
|
|
1643
|
+
({ color, icon, onDelete, children, className, ...props }, ref) => /* @__PURE__ */ jsxs11("span", { ref, className: clsx("kds-badge", color, className), ...props, children: [
|
|
1644
|
+
icon && /* @__PURE__ */ jsx16("i", { className: "material-symbols-outlined", children: icon }),
|
|
1645
|
+
/* @__PURE__ */ jsx16("span", { children }),
|
|
1646
|
+
onDelete && /* @__PURE__ */ jsx16(
|
|
1647
|
+
"button",
|
|
1648
|
+
{
|
|
1649
|
+
type: "button",
|
|
1650
|
+
className: "kds-badge-close",
|
|
1651
|
+
onClick: (e) => {
|
|
1652
|
+
e.stopPropagation();
|
|
1653
|
+
onDelete();
|
|
1654
|
+
},
|
|
1655
|
+
"aria-label": "Eliminar",
|
|
1656
|
+
children: /* @__PURE__ */ jsx16("i", { className: "material-symbols-outlined", children: "close" })
|
|
1657
|
+
}
|
|
1658
|
+
)
|
|
1553
1659
|
] })
|
|
1554
1660
|
);
|
|
1555
1661
|
KdsChip.displayName = "KdsChip";
|
|
1556
1662
|
|
|
1557
1663
|
// src/components/core/KdsSnackbar/KdsSnackbar.tsx
|
|
1558
|
-
import { forwardRef as
|
|
1664
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
1559
1665
|
|
|
1560
1666
|
// src/components/core/hooks/useAutoHide.ts
|
|
1561
|
-
import { useState, useEffect, useRef } from "react";
|
|
1667
|
+
import { useState as useState3, useEffect, useRef } from "react";
|
|
1562
1668
|
function useAutoHide(durationMs, onHide) {
|
|
1563
|
-
const [visible, setVisible] =
|
|
1669
|
+
const [visible, setVisible] = useState3(true);
|
|
1564
1670
|
const onHideRef = useRef(onHide);
|
|
1565
1671
|
onHideRef.current = onHide;
|
|
1566
1672
|
useEffect(() => {
|
|
@@ -1575,22 +1681,61 @@ function useAutoHide(durationMs, onHide) {
|
|
|
1575
1681
|
}
|
|
1576
1682
|
|
|
1577
1683
|
// src/components/core/KdsSnackbar/KdsSnackbar.tsx
|
|
1578
|
-
import { jsx as
|
|
1579
|
-
var
|
|
1580
|
-
|
|
1581
|
-
|
|
1684
|
+
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1685
|
+
var DEFAULT_ICONS2 = {
|
|
1686
|
+
info: "info",
|
|
1687
|
+
success: "check_circle",
|
|
1688
|
+
error: "error"
|
|
1689
|
+
};
|
|
1690
|
+
var KdsSnackbar = forwardRef16(
|
|
1691
|
+
({
|
|
1692
|
+
message,
|
|
1693
|
+
type = "info",
|
|
1694
|
+
duration = 5e3,
|
|
1695
|
+
onClose,
|
|
1696
|
+
open = true,
|
|
1697
|
+
icon,
|
|
1698
|
+
className,
|
|
1699
|
+
style,
|
|
1700
|
+
...props
|
|
1701
|
+
}, ref) => {
|
|
1702
|
+
const autoDismiss = duration > 0;
|
|
1703
|
+
const { visible } = useAutoHide(autoDismiss ? duration : 0, onClose);
|
|
1582
1704
|
if (!open || !visible) return null;
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1705
|
+
const resolvedIcon = icon === false ? null : icon ?? DEFAULT_ICONS2[type];
|
|
1706
|
+
const mergedStyle = autoDismiss ? { ...style, ["--kds-snackbar-duration"]: `${duration}ms` } : style ?? {};
|
|
1707
|
+
return /* @__PURE__ */ jsxs12(
|
|
1708
|
+
"div",
|
|
1709
|
+
{
|
|
1710
|
+
ref,
|
|
1711
|
+
role: "status",
|
|
1712
|
+
className: clsx("snackbar", "active", type, className),
|
|
1713
|
+
"data-auto-dismiss": autoDismiss ? "true" : void 0,
|
|
1714
|
+
style: mergedStyle,
|
|
1715
|
+
...props,
|
|
1716
|
+
children: [
|
|
1717
|
+
resolvedIcon && /* @__PURE__ */ jsx17("i", { className: "material-symbols-outlined", children: resolvedIcon }),
|
|
1718
|
+
/* @__PURE__ */ jsx17("span", { className: "max", children: message }),
|
|
1719
|
+
onClose && /* @__PURE__ */ jsx17(
|
|
1720
|
+
"button",
|
|
1721
|
+
{
|
|
1722
|
+
type: "button",
|
|
1723
|
+
className: "kds-snackbar-close",
|
|
1724
|
+
onClick: onClose,
|
|
1725
|
+
"aria-label": "Cerrar",
|
|
1726
|
+
children: /* @__PURE__ */ jsx17("i", { className: "material-symbols-outlined", children: "close" })
|
|
1727
|
+
}
|
|
1728
|
+
)
|
|
1729
|
+
]
|
|
1730
|
+
}
|
|
1731
|
+
);
|
|
1587
1732
|
}
|
|
1588
1733
|
);
|
|
1589
1734
|
KdsSnackbar.displayName = "KdsSnackbar";
|
|
1590
1735
|
|
|
1591
1736
|
// src/components/core/KdsTooltip/KdsTooltip.tsx
|
|
1592
1737
|
import * as Tooltip from "@radix-ui/react-tooltip";
|
|
1593
|
-
import { jsx as
|
|
1738
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1594
1739
|
function KdsTooltip({
|
|
1595
1740
|
content,
|
|
1596
1741
|
children,
|
|
@@ -1601,167 +1746,377 @@ function KdsTooltip({
|
|
|
1601
1746
|
onOpenChange,
|
|
1602
1747
|
delayDuration = 300
|
|
1603
1748
|
}) {
|
|
1604
|
-
return /* @__PURE__ */
|
|
1605
|
-
/* @__PURE__ */
|
|
1606
|
-
/* @__PURE__ */
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1749
|
+
return /* @__PURE__ */ jsx18(Tooltip.Provider, { delayDuration, children: /* @__PURE__ */ jsxs13(Tooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
1750
|
+
/* @__PURE__ */ jsx18(Tooltip.Trigger, { asChild: true, children }),
|
|
1751
|
+
/* @__PURE__ */ jsx18(Tooltip.Portal, { children: /* @__PURE__ */ jsx18("div", { className: "kds-theme-root", style: { display: "contents" }, children: /* @__PURE__ */ jsxs13(
|
|
1752
|
+
Tooltip.Content,
|
|
1753
|
+
{
|
|
1754
|
+
className: clsx("kds-tooltip", className),
|
|
1755
|
+
side: placement,
|
|
1756
|
+
sideOffset: 6,
|
|
1757
|
+
collisionPadding: 8,
|
|
1758
|
+
children: [
|
|
1759
|
+
content,
|
|
1760
|
+
/* @__PURE__ */ jsx18(Tooltip.Arrow, { className: "kds-tooltip-arrow", width: 10, height: 5 })
|
|
1761
|
+
]
|
|
1762
|
+
}
|
|
1763
|
+
) }) })
|
|
1610
1764
|
] }) });
|
|
1611
1765
|
}
|
|
1612
1766
|
|
|
1613
1767
|
// src/components/core/KdsAccordion/KdsAccordion.tsx
|
|
1614
|
-
import { forwardRef as
|
|
1615
|
-
import { jsx as
|
|
1616
|
-
var KdsAccordion =
|
|
1617
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
1768
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
1769
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1770
|
+
var KdsAccordion = forwardRef17(
|
|
1771
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx19("details", { ref, className: clsx("kds-accordion", className), ...props, children })
|
|
1618
1772
|
);
|
|
1619
1773
|
KdsAccordion.displayName = "KdsAccordion";
|
|
1620
|
-
var KdsAccordionSummary =
|
|
1621
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
1774
|
+
var KdsAccordionSummary = forwardRef17(
|
|
1775
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsxs14("summary", { ref, className: clsx("kds-accordion-summary", className), ...props, children: [
|
|
1622
1776
|
children,
|
|
1623
|
-
/* @__PURE__ */
|
|
1777
|
+
/* @__PURE__ */ jsx19("i", { className: "material-symbols-outlined", children: "expand_more" })
|
|
1624
1778
|
] })
|
|
1625
1779
|
);
|
|
1626
1780
|
KdsAccordionSummary.displayName = "KdsAccordionSummary";
|
|
1627
|
-
var KdsAccordionDetails =
|
|
1628
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
1781
|
+
var KdsAccordionDetails = forwardRef17(
|
|
1782
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx19("div", { ref, className: clsx("kds-accordion-details", className), ...props, children })
|
|
1629
1783
|
);
|
|
1630
1784
|
KdsAccordionDetails.displayName = "KdsAccordionDetails";
|
|
1631
1785
|
|
|
1632
1786
|
// src/components/core/KdsDivider/KdsDivider.tsx
|
|
1633
|
-
import { forwardRef as
|
|
1634
|
-
import { jsx as
|
|
1635
|
-
var KdsDivider =
|
|
1636
|
-
({ dashed, className, ...props }, ref) => /* @__PURE__ */
|
|
1787
|
+
import { forwardRef as forwardRef18 } from "react";
|
|
1788
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1789
|
+
var KdsDivider = forwardRef18(
|
|
1790
|
+
({ dashed, className, ...props }, ref) => /* @__PURE__ */ jsx20("hr", { ref, className: clsx(dashed ? "kds-hr-dashed" : "kds-hr", className), ...props })
|
|
1637
1791
|
);
|
|
1638
1792
|
KdsDivider.displayName = "KdsDivider";
|
|
1639
1793
|
|
|
1640
1794
|
// src/components/core/KdsSectionNote/KdsSectionNote.tsx
|
|
1641
|
-
import { forwardRef as
|
|
1642
|
-
import { jsx as
|
|
1643
|
-
var KdsSectionNote =
|
|
1644
|
-
({ icon = "info", children, className, ...props }, ref) => /* @__PURE__ */
|
|
1645
|
-
/* @__PURE__ */
|
|
1646
|
-
/* @__PURE__ */
|
|
1795
|
+
import { forwardRef as forwardRef19 } from "react";
|
|
1796
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1797
|
+
var KdsSectionNote = forwardRef19(
|
|
1798
|
+
({ icon = "info", children, className, ...props }, ref) => /* @__PURE__ */ jsxs15("p", { ref, className: clsx("kds-section-note", className), ...props, children: [
|
|
1799
|
+
/* @__PURE__ */ jsx21("i", { className: "material-symbols-outlined", children: icon }),
|
|
1800
|
+
/* @__PURE__ */ jsx21("span", { children })
|
|
1647
1801
|
] })
|
|
1648
1802
|
);
|
|
1649
1803
|
KdsSectionNote.displayName = "KdsSectionNote";
|
|
1650
1804
|
|
|
1651
1805
|
// src/components/core/KdsStatusBlock/KdsStatusBlock.tsx
|
|
1652
|
-
import { forwardRef as
|
|
1653
|
-
import { jsx as
|
|
1654
|
-
var KdsStatusBlock =
|
|
1655
|
-
({ status, icon, title, description, inline, className, ...props }, ref) => /* @__PURE__ */
|
|
1656
|
-
/* @__PURE__ */
|
|
1657
|
-
/* @__PURE__ */
|
|
1658
|
-
/* @__PURE__ */
|
|
1659
|
-
description && /* @__PURE__ */
|
|
1806
|
+
import { forwardRef as forwardRef20 } from "react";
|
|
1807
|
+
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1808
|
+
var KdsStatusBlock = forwardRef20(
|
|
1809
|
+
({ status, icon, title, description, inline, className, ...props }, ref) => /* @__PURE__ */ jsxs16("div", { ref, className: clsx("kds-status-block", inline && "inline", className), "data-status": status, ...props, children: [
|
|
1810
|
+
/* @__PURE__ */ jsx22("div", { className: "kds-status-block-icon", children: icon && /* @__PURE__ */ jsx22("i", { className: "material-symbols-outlined", children: icon }) }),
|
|
1811
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
1812
|
+
/* @__PURE__ */ jsx22("h2", { className: "kds-status-block-title", children: title }),
|
|
1813
|
+
description && /* @__PURE__ */ jsx22("p", { className: "kds-status-block-description", children: description })
|
|
1660
1814
|
] })
|
|
1661
1815
|
] })
|
|
1662
1816
|
);
|
|
1663
1817
|
KdsStatusBlock.displayName = "KdsStatusBlock";
|
|
1664
1818
|
|
|
1665
1819
|
// src/components/core/KdsStepper/KdsStepper.tsx
|
|
1666
|
-
import { forwardRef as forwardRef20 } from "react";
|
|
1667
|
-
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1668
|
-
var KdsStepper = forwardRef20(
|
|
1669
|
-
({ steps, current, className, ...props }, ref) => /* @__PURE__ */ jsx22("div", { ref, className: clsx("kds-stepper", className), "data-steps": steps, "data-current": current, ...props, children: Array.from({ length: steps }, (_, i) => /* @__PURE__ */ jsxs15("div", { className: clsx("kds-step", i < current && "completed", i === current && "current"), children: [
|
|
1670
|
-
/* @__PURE__ */ jsx22("div", { className: "kds-step-indicator", children: i < current ? "\u2713" : i + 1 }),
|
|
1671
|
-
i < steps - 1 && /* @__PURE__ */ jsx22("div", { className: "kds-step-line" })
|
|
1672
|
-
] }, i)) })
|
|
1673
|
-
);
|
|
1674
|
-
KdsStepper.displayName = "KdsStepper";
|
|
1675
|
-
|
|
1676
|
-
// src/components/core/KdsCopyRow/KdsCopyRow.tsx
|
|
1677
1820
|
import { forwardRef as forwardRef21 } from "react";
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
setTimeout(() => setCopied(false), resetMs);
|
|
1689
|
-
} catch {
|
|
1690
|
-
}
|
|
1821
|
+
import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1822
|
+
var KdsStepper = forwardRef21(
|
|
1823
|
+
({ steps, current, className, ...props }, ref) => /* @__PURE__ */ jsx23("div", { ref, className: clsx("kds-stepper", className), ...props, children: steps.map((label, i) => /* @__PURE__ */ jsxs17(
|
|
1824
|
+
"div",
|
|
1825
|
+
{
|
|
1826
|
+
className: clsx("kds-step", i < current && "completed", i === current && "current"),
|
|
1827
|
+
children: [
|
|
1828
|
+
/* @__PURE__ */ jsx23("div", { className: "kds-step-indicator" }),
|
|
1829
|
+
/* @__PURE__ */ jsx23("div", { className: "kds-step-label", children: label })
|
|
1830
|
+
]
|
|
1691
1831
|
},
|
|
1692
|
-
|
|
1693
|
-
)
|
|
1694
|
-
|
|
1695
|
-
|
|
1832
|
+
`${i}-${label}`
|
|
1833
|
+
)) })
|
|
1834
|
+
);
|
|
1835
|
+
KdsStepper.displayName = "KdsStepper";
|
|
1696
1836
|
|
|
1697
1837
|
// src/components/core/KdsCopyRow/KdsCopyRow.tsx
|
|
1698
|
-
import {
|
|
1699
|
-
|
|
1700
|
-
|
|
1838
|
+
import { forwardRef as forwardRef22 } from "react";
|
|
1839
|
+
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1840
|
+
var KdsCopyRow = forwardRef22(
|
|
1841
|
+
({ label, value, copiedText = "Copiado", className, ...props }, ref) => {
|
|
1701
1842
|
const { copied, copy } = useCopyToClipboard();
|
|
1702
|
-
return /* @__PURE__ */
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1843
|
+
return /* @__PURE__ */ jsxs18(
|
|
1844
|
+
"button",
|
|
1845
|
+
{
|
|
1846
|
+
ref,
|
|
1847
|
+
type: "button",
|
|
1848
|
+
className: clsx("kds-copy-row", copied && "copied", className),
|
|
1849
|
+
"data-copy": value,
|
|
1850
|
+
onClick: () => copy(value),
|
|
1851
|
+
"aria-label": `Copiar ${label}: ${value}`,
|
|
1852
|
+
...props,
|
|
1853
|
+
children: [
|
|
1854
|
+
/* @__PURE__ */ jsx24("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: "content_copy" }),
|
|
1855
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
1856
|
+
/* @__PURE__ */ jsx24("span", { className: "kds-copy-row-label", children: label }),
|
|
1857
|
+
/* @__PURE__ */ jsx24("span", { className: "kds-copy-row-value", children: value })
|
|
1858
|
+
] }),
|
|
1859
|
+
/* @__PURE__ */ jsxs18("span", { className: "kds-copy-toast", "aria-hidden": "true", children: [
|
|
1860
|
+
/* @__PURE__ */ jsx24("i", { className: "material-symbols-outlined", children: "check_circle" }),
|
|
1861
|
+
" ",
|
|
1862
|
+
copiedText
|
|
1863
|
+
] })
|
|
1864
|
+
]
|
|
1865
|
+
}
|
|
1866
|
+
);
|
|
1707
1867
|
}
|
|
1708
1868
|
);
|
|
1709
1869
|
KdsCopyRow.displayName = "KdsCopyRow";
|
|
1710
1870
|
|
|
1711
1871
|
// src/components/core/KdsCopyableTable/KdsCopyableTable.tsx
|
|
1712
|
-
import { forwardRef as
|
|
1713
|
-
import { Fragment as Fragment2, jsx as
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1872
|
+
import { forwardRef as forwardRef23, useState as useState4, useRef as useRef2, useCallback as useCallback3 } from "react";
|
|
1873
|
+
import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1874
|
+
async function copyToClipboard(text) {
|
|
1875
|
+
try {
|
|
1876
|
+
if (navigator.clipboard?.writeText) {
|
|
1877
|
+
await navigator.clipboard.writeText(text);
|
|
1878
|
+
return true;
|
|
1879
|
+
}
|
|
1880
|
+
} catch {
|
|
1881
|
+
}
|
|
1882
|
+
const ta = document.createElement("textarea");
|
|
1883
|
+
ta.value = text;
|
|
1884
|
+
ta.style.position = "fixed";
|
|
1885
|
+
ta.style.opacity = "0";
|
|
1886
|
+
document.body.appendChild(ta);
|
|
1887
|
+
ta.select();
|
|
1888
|
+
try {
|
|
1889
|
+
document.execCommand("copy");
|
|
1890
|
+
return true;
|
|
1891
|
+
} catch {
|
|
1892
|
+
return false;
|
|
1893
|
+
} finally {
|
|
1894
|
+
document.body.removeChild(ta);
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
var TRANSITION_MS = 300;
|
|
1898
|
+
function GridVariant({
|
|
1899
|
+
gridRows,
|
|
1900
|
+
disabled,
|
|
1901
|
+
className,
|
|
1902
|
+
forwardedRef,
|
|
1903
|
+
rest
|
|
1904
|
+
}) {
|
|
1905
|
+
return /* @__PURE__ */ jsx25(
|
|
1906
|
+
"div",
|
|
1907
|
+
{
|
|
1908
|
+
ref: forwardedRef,
|
|
1909
|
+
className: clsx("kds-copyable-table", "kds-copyable-table--grid", className),
|
|
1910
|
+
...rest,
|
|
1911
|
+
children: gridRows.map((cells, rowIndex) => /* @__PURE__ */ jsx25(
|
|
1912
|
+
"div",
|
|
1913
|
+
{
|
|
1914
|
+
className: "kds-copyable-table-row kds-copyable-table-row--grid",
|
|
1915
|
+
"data-testid": "kds-grid-row",
|
|
1916
|
+
children: cells.map((text, cellIndex) => /* @__PURE__ */ jsx25(
|
|
1917
|
+
"span",
|
|
1918
|
+
{
|
|
1919
|
+
className: clsx("kds-grid-cell", disabled && "kds-grid-cell--disabled"),
|
|
1920
|
+
children: text
|
|
1921
|
+
},
|
|
1922
|
+
cellIndex
|
|
1923
|
+
))
|
|
1924
|
+
},
|
|
1925
|
+
rowIndex
|
|
1926
|
+
))
|
|
1927
|
+
}
|
|
1928
|
+
);
|
|
1929
|
+
}
|
|
1930
|
+
function CopyableVariant({
|
|
1931
|
+
rows,
|
|
1932
|
+
copyAllLabel = "Copiar todos los datos",
|
|
1933
|
+
copiedAllLabel = "Datos copiados",
|
|
1934
|
+
showCopyAll = true,
|
|
1935
|
+
className,
|
|
1936
|
+
forwardedRef,
|
|
1937
|
+
rest
|
|
1938
|
+
}) {
|
|
1939
|
+
const copiedTimers = useRef2(/* @__PURE__ */ new Map());
|
|
1940
|
+
const settlingTimers = useRef2(/* @__PURE__ */ new Map());
|
|
1941
|
+
const [copiedRows, setCopiedRows] = useState4(/* @__PURE__ */ new Set());
|
|
1942
|
+
const [settlingRows, setSettlingRows] = useState4(/* @__PURE__ */ new Set());
|
|
1943
|
+
const [allCopied, setAllCopied] = useState4(false);
|
|
1944
|
+
const markCopied = useCallback3((indexes, duration = 1500) => {
|
|
1945
|
+
setCopiedRows((prev) => {
|
|
1946
|
+
const next = new Set(prev);
|
|
1947
|
+
indexes.forEach((i) => next.add(i));
|
|
1948
|
+
return next;
|
|
1949
|
+
});
|
|
1950
|
+
indexes.forEach((i) => {
|
|
1951
|
+
const st = settlingTimers.current.get(i);
|
|
1952
|
+
if (st) {
|
|
1953
|
+
clearTimeout(st);
|
|
1954
|
+
settlingTimers.current.delete(i);
|
|
1955
|
+
}
|
|
1956
|
+
});
|
|
1957
|
+
setSettlingRows((prev) => {
|
|
1958
|
+
const next = new Set(prev);
|
|
1959
|
+
indexes.forEach((i) => next.delete(i));
|
|
1960
|
+
return next;
|
|
1961
|
+
});
|
|
1962
|
+
indexes.forEach((i) => {
|
|
1963
|
+
const existing = copiedTimers.current.get(i);
|
|
1964
|
+
if (existing) clearTimeout(existing);
|
|
1965
|
+
const t = setTimeout(() => {
|
|
1966
|
+
setCopiedRows((prev) => {
|
|
1967
|
+
const next = new Set(prev);
|
|
1968
|
+
next.delete(i);
|
|
1969
|
+
return next;
|
|
1970
|
+
});
|
|
1971
|
+
setSettlingRows((prev) => {
|
|
1972
|
+
const next = new Set(prev);
|
|
1973
|
+
next.add(i);
|
|
1974
|
+
return next;
|
|
1975
|
+
});
|
|
1976
|
+
copiedTimers.current.delete(i);
|
|
1977
|
+
const settlingT = setTimeout(() => {
|
|
1978
|
+
setSettlingRows((prev) => {
|
|
1979
|
+
const next = new Set(prev);
|
|
1980
|
+
next.delete(i);
|
|
1981
|
+
return next;
|
|
1982
|
+
});
|
|
1983
|
+
settlingTimers.current.delete(i);
|
|
1984
|
+
}, TRANSITION_MS);
|
|
1985
|
+
settlingTimers.current.set(i, settlingT);
|
|
1986
|
+
}, duration);
|
|
1987
|
+
copiedTimers.current.set(i, t);
|
|
1988
|
+
});
|
|
1989
|
+
}, []);
|
|
1990
|
+
const handleRowCopy = async (row, index) => {
|
|
1991
|
+
const ok = await copyToClipboard(row.copy ?? row.value);
|
|
1992
|
+
if (ok) markCopied([index]);
|
|
1993
|
+
};
|
|
1994
|
+
const handleCopyAll = async () => {
|
|
1995
|
+
const text = rows.map((r) => `${r.label}: ${r.value}`).join("\n");
|
|
1996
|
+
const ok = await copyToClipboard(text);
|
|
1997
|
+
if (ok) {
|
|
1998
|
+
markCopied(rows.map((_, i) => i));
|
|
1999
|
+
setAllCopied(true);
|
|
2000
|
+
setTimeout(() => setAllCopied(false), 2e3);
|
|
2001
|
+
}
|
|
2002
|
+
};
|
|
2003
|
+
return /* @__PURE__ */ jsxs19(Fragment2, { children: [
|
|
2004
|
+
/* @__PURE__ */ jsx25("div", { ref: forwardedRef, className: clsx("kds-copyable-table", className), ...rest, children: rows.map((row, i) => /* @__PURE__ */ jsxs19(
|
|
2005
|
+
"div",
|
|
2006
|
+
{
|
|
2007
|
+
className: clsx(
|
|
2008
|
+
"kds-copyable-table-row",
|
|
2009
|
+
copiedRows.has(i) && "copied",
|
|
2010
|
+
settlingRows.has(i) && "settling"
|
|
2011
|
+
),
|
|
2012
|
+
role: "button",
|
|
2013
|
+
tabIndex: 0,
|
|
2014
|
+
onClick: () => handleRowCopy(row, i),
|
|
2015
|
+
onKeyDown: (e) => {
|
|
2016
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2017
|
+
e.preventDefault();
|
|
2018
|
+
handleRowCopy(row, i);
|
|
2019
|
+
}
|
|
2020
|
+
},
|
|
2021
|
+
"aria-label": `Copiar ${row.label}: ${row.value}`,
|
|
2022
|
+
children: [
|
|
2023
|
+
/* @__PURE__ */ jsx25("span", { className: "kds-key", children: row.label }),
|
|
2024
|
+
/* @__PURE__ */ jsx25("span", { className: "kds-value", children: row.value })
|
|
2025
|
+
]
|
|
2026
|
+
},
|
|
2027
|
+
`${row.label}-${i}`
|
|
2028
|
+
)) }),
|
|
2029
|
+
showCopyAll && /* @__PURE__ */ jsxs19(
|
|
2030
|
+
"button",
|
|
2031
|
+
{
|
|
2032
|
+
type: "button",
|
|
2033
|
+
className: clsx(
|
|
2034
|
+
"kds-btn",
|
|
2035
|
+
"kds-btn-outlined",
|
|
2036
|
+
"kds-btn-block",
|
|
2037
|
+
"kds-copy-all-btn",
|
|
2038
|
+
allCopied && "copied"
|
|
2039
|
+
),
|
|
2040
|
+
onClick: handleCopyAll,
|
|
2041
|
+
"aria-label": allCopied ? copiedAllLabel : copyAllLabel,
|
|
2042
|
+
children: [
|
|
2043
|
+
/* @__PURE__ */ jsx25("span", { className: "kds-icon", children: /* @__PURE__ */ jsx25("i", { className: "material-symbols-outlined", children: allCopied ? "check" : "content_copy" }) }),
|
|
2044
|
+
/* @__PURE__ */ jsx25("span", { children: allCopied ? copiedAllLabel : copyAllLabel })
|
|
2045
|
+
]
|
|
2046
|
+
}
|
|
2047
|
+
)
|
|
2048
|
+
] });
|
|
2049
|
+
}
|
|
2050
|
+
var KdsCopyableTable = forwardRef23(
|
|
2051
|
+
({
|
|
2052
|
+
rows = [],
|
|
2053
|
+
variant = "copyable",
|
|
2054
|
+
gridRows = [],
|
|
2055
|
+
disabled = false,
|
|
2056
|
+
copyAllLabel,
|
|
2057
|
+
copiedAllLabel,
|
|
2058
|
+
showCopyAll,
|
|
2059
|
+
className,
|
|
2060
|
+
...props
|
|
2061
|
+
}, ref) => {
|
|
2062
|
+
if (variant === "grid") {
|
|
2063
|
+
return /* @__PURE__ */ jsx25(
|
|
2064
|
+
GridVariant,
|
|
2065
|
+
{
|
|
2066
|
+
gridRows,
|
|
2067
|
+
disabled,
|
|
2068
|
+
className,
|
|
2069
|
+
forwardedRef: ref,
|
|
2070
|
+
rest: props
|
|
2071
|
+
}
|
|
2072
|
+
);
|
|
2073
|
+
}
|
|
2074
|
+
return /* @__PURE__ */ jsx25(
|
|
2075
|
+
CopyableVariant,
|
|
2076
|
+
{
|
|
2077
|
+
rows,
|
|
2078
|
+
copyAllLabel,
|
|
2079
|
+
copiedAllLabel,
|
|
2080
|
+
showCopyAll,
|
|
2081
|
+
className,
|
|
2082
|
+
forwardedRef: ref,
|
|
2083
|
+
rest: props
|
|
2084
|
+
}
|
|
2085
|
+
);
|
|
1731
2086
|
}
|
|
1732
2087
|
);
|
|
1733
2088
|
KdsCopyableTable.displayName = "KdsCopyableTable";
|
|
1734
2089
|
|
|
1735
2090
|
// src/components/core/KdsExpandPanel/KdsExpandPanel.tsx
|
|
1736
|
-
import { forwardRef as
|
|
1737
|
-
import { jsx as
|
|
1738
|
-
var KdsExpandPanel =
|
|
2091
|
+
import { forwardRef as forwardRef24, useState as useState5 } from "react";
|
|
2092
|
+
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2093
|
+
var KdsExpandPanel = forwardRef24(
|
|
1739
2094
|
({ label, defaultExpanded = false, children, className, ...props }, ref) => {
|
|
1740
|
-
const [expanded, setExpanded] =
|
|
1741
|
-
return /* @__PURE__ */
|
|
1742
|
-
/* @__PURE__ */
|
|
2095
|
+
const [expanded, setExpanded] = useState5(defaultExpanded);
|
|
2096
|
+
return /* @__PURE__ */ jsxs20("div", { ref, className, ...props, children: [
|
|
2097
|
+
/* @__PURE__ */ jsxs20(
|
|
1743
2098
|
"button",
|
|
1744
2099
|
{
|
|
1745
2100
|
className: "kds-expand-toggle",
|
|
1746
2101
|
onClick: () => setExpanded((v) => !v),
|
|
1747
2102
|
"aria-expanded": expanded,
|
|
1748
2103
|
children: [
|
|
1749
|
-
/* @__PURE__ */
|
|
1750
|
-
/* @__PURE__ */
|
|
2104
|
+
/* @__PURE__ */ jsx26("span", { children: label }),
|
|
2105
|
+
/* @__PURE__ */ jsx26("i", { className: "material-symbols-outlined", children: expanded ? "expand_less" : "expand_more" })
|
|
1751
2106
|
]
|
|
1752
2107
|
}
|
|
1753
2108
|
),
|
|
1754
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ jsx26("div", { className: clsx("kds-expand-panel", expanded && "open"), hidden: !expanded, children })
|
|
1755
2110
|
] });
|
|
1756
2111
|
}
|
|
1757
2112
|
);
|
|
1758
2113
|
KdsExpandPanel.displayName = "KdsExpandPanel";
|
|
1759
2114
|
|
|
1760
2115
|
// src/components/core/KdsCountdown/KdsCountdown.tsx
|
|
1761
|
-
import { forwardRef as
|
|
2116
|
+
import { forwardRef as forwardRef25, useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
1762
2117
|
|
|
1763
2118
|
// src/components/core/hooks/useCountdown.ts
|
|
1764
|
-
import { useState as
|
|
2119
|
+
import { useState as useState6, useEffect as useEffect2 } from "react";
|
|
1765
2120
|
function calcRemaining(deadline) {
|
|
1766
2121
|
const diff = Math.max(0, new Date(deadline).getTime() - Date.now());
|
|
1767
2122
|
const totalSeconds = Math.floor(diff / 1e3);
|
|
@@ -1774,7 +2129,7 @@ function calcRemaining(deadline) {
|
|
|
1774
2129
|
};
|
|
1775
2130
|
}
|
|
1776
2131
|
function useCountdown(deadline) {
|
|
1777
|
-
const [state, setState] =
|
|
2132
|
+
const [state, setState] = useState6(() => calcRemaining(deadline));
|
|
1778
2133
|
useEffect2(() => {
|
|
1779
2134
|
const tick = () => setState(calcRemaining(deadline));
|
|
1780
2135
|
const id = setInterval(tick, 1e3);
|
|
@@ -1784,11 +2139,11 @@ function useCountdown(deadline) {
|
|
|
1784
2139
|
}
|
|
1785
2140
|
|
|
1786
2141
|
// src/components/core/KdsCountdown/KdsCountdown.tsx
|
|
1787
|
-
import { jsx as
|
|
1788
|
-
var KdsCountdown =
|
|
2142
|
+
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2143
|
+
var KdsCountdown = forwardRef25(
|
|
1789
2144
|
({ deadline, label, onExpire, className, ...props }, ref) => {
|
|
1790
2145
|
const { hours, minutes, seconds, expired, urgent } = useCountdown(deadline);
|
|
1791
|
-
const onExpireRef =
|
|
2146
|
+
const onExpireRef = useRef3(onExpire);
|
|
1792
2147
|
onExpireRef.current = onExpire;
|
|
1793
2148
|
useEffect3(() => {
|
|
1794
2149
|
if (expired) {
|
|
@@ -1799,9 +2154,9 @@ var KdsCountdown = forwardRef24(
|
|
|
1799
2154
|
return null;
|
|
1800
2155
|
}
|
|
1801
2156
|
const pad = (n) => String(n).padStart(2, "0");
|
|
1802
|
-
return /* @__PURE__ */
|
|
1803
|
-
label && /* @__PURE__ */
|
|
1804
|
-
/* @__PURE__ */
|
|
2157
|
+
return /* @__PURE__ */ jsxs21("div", { ref, className: clsx("kds-countdown", urgent && "urgent", className), ...props, children: [
|
|
2158
|
+
label && /* @__PURE__ */ jsx27("span", { className: "kds-countdown-label", children: label }),
|
|
2159
|
+
/* @__PURE__ */ jsxs21("span", { className: "kds-countdown-value", children: [
|
|
1805
2160
|
pad(hours),
|
|
1806
2161
|
":",
|
|
1807
2162
|
pad(minutes),
|
|
@@ -1814,96 +2169,145 @@ var KdsCountdown = forwardRef24(
|
|
|
1814
2169
|
KdsCountdown.displayName = "KdsCountdown";
|
|
1815
2170
|
|
|
1816
2171
|
// src/components/core/KdsSegmentedTabs/KdsSegmentedTabs.tsx
|
|
1817
|
-
import { forwardRef as
|
|
1818
|
-
import { jsx as
|
|
1819
|
-
var KdsSegmentedTabs =
|
|
1820
|
-
(props, ref) => /* @__PURE__ */
|
|
2172
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
2173
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2174
|
+
var KdsSegmentedTabs = forwardRef26(
|
|
2175
|
+
(props, ref) => /* @__PURE__ */ jsx28(KdsTabs, { ref, ...props })
|
|
1821
2176
|
);
|
|
1822
2177
|
KdsSegmentedTabs.displayName = "KdsSegmentedTabs";
|
|
1823
2178
|
|
|
1824
|
-
// src/components/
|
|
1825
|
-
import { forwardRef as
|
|
1826
|
-
import { jsx as
|
|
1827
|
-
var
|
|
1828
|
-
({
|
|
2179
|
+
// src/components/core/KdsFab/KdsFab.tsx
|
|
2180
|
+
import { forwardRef as forwardRef27 } from "react";
|
|
2181
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2182
|
+
var KdsFab = forwardRef27(
|
|
2183
|
+
({ icon, position = "top-right", hidden = false, className, ...props }, ref) => /* @__PURE__ */ jsx29(
|
|
1829
2184
|
"button",
|
|
1830
2185
|
{
|
|
1831
2186
|
ref,
|
|
1832
2187
|
type: "button",
|
|
1833
|
-
className: clsx(
|
|
2188
|
+
className: clsx(
|
|
2189
|
+
"kds-fab",
|
|
2190
|
+
position !== "none" && `kds-fab--${position}`,
|
|
2191
|
+
hidden && "kds-fab--hidden",
|
|
2192
|
+
className
|
|
2193
|
+
),
|
|
2194
|
+
"aria-hidden": hidden || void 0,
|
|
2195
|
+
tabIndex: hidden ? -1 : void 0,
|
|
2196
|
+
...props,
|
|
2197
|
+
children: /* @__PURE__ */ jsx29("i", { className: "material-symbols-outlined", children: icon })
|
|
2198
|
+
}
|
|
2199
|
+
)
|
|
2200
|
+
);
|
|
2201
|
+
KdsFab.displayName = "KdsFab";
|
|
2202
|
+
|
|
2203
|
+
// src/components/core/KdsEmptyState/KdsEmptyState.tsx
|
|
2204
|
+
import { forwardRef as forwardRef28 } from "react";
|
|
2205
|
+
import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2206
|
+
var KdsEmptyState = forwardRef28(
|
|
2207
|
+
({ icon = "hide_source", title, description, className, ...props }, ref) => /* @__PURE__ */ jsxs22(
|
|
2208
|
+
"div",
|
|
2209
|
+
{
|
|
2210
|
+
ref,
|
|
2211
|
+
role: "status",
|
|
2212
|
+
className: clsx("kds-empty-state", className),
|
|
1834
2213
|
...props,
|
|
1835
2214
|
children: [
|
|
1836
|
-
/* @__PURE__ */
|
|
1837
|
-
/* @__PURE__ */
|
|
1838
|
-
|
|
2215
|
+
/* @__PURE__ */ jsx30("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: icon }),
|
|
2216
|
+
/* @__PURE__ */ jsxs22("div", { className: "kds-empty-state-text", children: [
|
|
2217
|
+
/* @__PURE__ */ jsx30(KdsTypography, { variant: "body", color: "primary", children: title }),
|
|
2218
|
+
description && /* @__PURE__ */ jsx30(KdsTypography, { variant: "body", color: "secondary", children: description })
|
|
2219
|
+
] })
|
|
1839
2220
|
]
|
|
1840
2221
|
}
|
|
1841
2222
|
)
|
|
1842
2223
|
);
|
|
2224
|
+
KdsEmptyState.displayName = "KdsEmptyState";
|
|
2225
|
+
|
|
2226
|
+
// src/components/domain/KdsBankRow/KdsBankRow.tsx
|
|
2227
|
+
import { forwardRef as forwardRef29 } from "react";
|
|
2228
|
+
import { jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2229
|
+
var KdsBankRow = forwardRef29(
|
|
2230
|
+
({ name, logoUrl, selected, hideLogo, className, ...props }, ref) => {
|
|
2231
|
+
const nameStr = typeof name === "string" ? name : "";
|
|
2232
|
+
return /* @__PURE__ */ jsxs23(
|
|
2233
|
+
"button",
|
|
2234
|
+
{
|
|
2235
|
+
ref,
|
|
2236
|
+
type: "button",
|
|
2237
|
+
className: clsx("kds-bank-row", selected && "selected", className),
|
|
2238
|
+
...props,
|
|
2239
|
+
children: [
|
|
2240
|
+
!hideLogo && /* @__PURE__ */ jsx31("span", { className: "kds-bank-row-logo", children: logoUrl ? /* @__PURE__ */ jsx31("img", { src: logoUrl, alt: nameStr }) : /* @__PURE__ */ jsx31("span", { className: "initials", children: nameStr.charAt(0) }) }),
|
|
2241
|
+
/* @__PURE__ */ jsx31("span", { className: "kds-bank-row-name", children: name }),
|
|
2242
|
+
/* @__PURE__ */ jsx31("i", { className: "material-symbols-outlined", children: selected ? "check_circle" : "chevron_right" })
|
|
2243
|
+
]
|
|
2244
|
+
}
|
|
2245
|
+
);
|
|
2246
|
+
}
|
|
2247
|
+
);
|
|
1843
2248
|
KdsBankRow.displayName = "KdsBankRow";
|
|
1844
2249
|
|
|
1845
2250
|
// src/components/domain/KdsBankList/KdsBankList.tsx
|
|
1846
|
-
import { forwardRef as
|
|
1847
|
-
import { jsx as
|
|
1848
|
-
var KdsBankList =
|
|
1849
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2251
|
+
import { forwardRef as forwardRef30 } from "react";
|
|
2252
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2253
|
+
var KdsBankList = forwardRef30(
|
|
2254
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx32("div", { ref, className: clsx("kds-bank-list", className), role: "list", ...props, children })
|
|
1850
2255
|
);
|
|
1851
2256
|
KdsBankList.displayName = "KdsBankList";
|
|
1852
2257
|
|
|
1853
2258
|
// src/components/domain/KdsBankModal/KdsBankModal.tsx
|
|
1854
|
-
import { forwardRef as
|
|
1855
|
-
import * as
|
|
1856
|
-
import { jsx as
|
|
1857
|
-
var KdsBankModal =
|
|
2259
|
+
import { forwardRef as forwardRef31, useState as useState7 } from "react";
|
|
2260
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
2261
|
+
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2262
|
+
var KdsBankModal = forwardRef31(
|
|
1858
2263
|
({ open, onClose, title = "Selecciona tu banco", searchPlaceholder = "Buscar banco...", onSearch, children, className, container }, ref) => {
|
|
1859
|
-
const [query, setQuery] =
|
|
2264
|
+
const [query, setQuery] = useState7("");
|
|
1860
2265
|
const handleSearch = (value) => {
|
|
1861
2266
|
setQuery(value);
|
|
1862
2267
|
onSearch?.(value);
|
|
1863
2268
|
};
|
|
1864
|
-
return /* @__PURE__ */
|
|
2269
|
+
return /* @__PURE__ */ jsx33(Dialog.Root, { open, onOpenChange: (o) => {
|
|
1865
2270
|
if (!o) onClose();
|
|
1866
|
-
}, children: /* @__PURE__ */
|
|
1867
|
-
/* @__PURE__ */
|
|
1868
|
-
/* @__PURE__ */
|
|
1869
|
-
/* @__PURE__ */
|
|
2271
|
+
}, children: /* @__PURE__ */ jsx33(Dialog.Portal, { container, children: /* @__PURE__ */ jsx33(Dialog.Overlay, { className: "kds-bank-modal-scrim open", children: /* @__PURE__ */ jsxs24(Dialog.Content, { ref, className: clsx("kds-bank-modal", className), children: [
|
|
2272
|
+
/* @__PURE__ */ jsxs24("div", { className: "kds-bank-modal-header", children: [
|
|
2273
|
+
/* @__PURE__ */ jsx33(Dialog.Title, { asChild: true, children: /* @__PURE__ */ jsx33("h3", { children: title }) }),
|
|
2274
|
+
/* @__PURE__ */ jsx33(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx33("button", { className: "kds-bank-modal-close", "aria-label": "Cerrar", children: /* @__PURE__ */ jsx33("i", { className: "material-symbols-outlined", children: "close" }) }) })
|
|
1870
2275
|
] }),
|
|
1871
|
-
/* @__PURE__ */
|
|
1872
|
-
|
|
2276
|
+
/* @__PURE__ */ jsx33("div", { className: "kds-bank-modal-search", children: /* @__PURE__ */ jsx33(
|
|
2277
|
+
KdsSearchField,
|
|
1873
2278
|
{
|
|
1874
|
-
type: "text",
|
|
1875
2279
|
placeholder: searchPlaceholder,
|
|
1876
2280
|
value: query,
|
|
1877
2281
|
onChange: (e) => handleSearch(e.target.value)
|
|
1878
2282
|
}
|
|
1879
2283
|
) }),
|
|
1880
|
-
/* @__PURE__ */
|
|
2284
|
+
/* @__PURE__ */ jsx33("div", { className: "kds-bank-modal-body", children })
|
|
1881
2285
|
] }) }) }) });
|
|
1882
2286
|
}
|
|
1883
2287
|
);
|
|
1884
2288
|
KdsBankModal.displayName = "KdsBankModal";
|
|
1885
2289
|
|
|
1886
2290
|
// src/components/domain/KdsQrRow/KdsQrRow.tsx
|
|
1887
|
-
import { forwardRef as
|
|
1888
|
-
import { jsx as
|
|
1889
|
-
var KdsQrRow =
|
|
1890
|
-
({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */
|
|
1891
|
-
/* @__PURE__ */
|
|
1892
|
-
/* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
1894
|
-
description && /* @__PURE__ */
|
|
2291
|
+
import { forwardRef as forwardRef32 } from "react";
|
|
2292
|
+
import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2293
|
+
var KdsQrRow = forwardRef32(
|
|
2294
|
+
({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */ jsxs25("button", { ref, type: "button", className: clsx("kds-qr-row", className), ...props, children: [
|
|
2295
|
+
/* @__PURE__ */ jsx34("span", { className: "kds-qr-avatar", "aria-hidden": "true", children: /* @__PURE__ */ jsx34("i", { className: "material-symbols-outlined", children: icon }) }),
|
|
2296
|
+
/* @__PURE__ */ jsxs25("span", { className: "kds-qr-text", children: [
|
|
2297
|
+
/* @__PURE__ */ jsx34("span", { className: "kds-qr-title", children: name }),
|
|
2298
|
+
description && /* @__PURE__ */ jsx34("span", { className: "kds-qr-subtitle", children: description })
|
|
1895
2299
|
] }),
|
|
1896
|
-
badge && /* @__PURE__ */
|
|
1897
|
-
/* @__PURE__ */
|
|
2300
|
+
badge && /* @__PURE__ */ jsx34("span", { className: "kds-qr-badge", children: badge }),
|
|
2301
|
+
/* @__PURE__ */ jsx34("i", { className: "material-symbols-outlined", children: "chevron_right" })
|
|
1898
2302
|
] })
|
|
1899
2303
|
);
|
|
1900
2304
|
KdsQrRow.displayName = "KdsQrRow";
|
|
1901
2305
|
|
|
1902
2306
|
// src/components/domain/KdsCardSelector/KdsCardSelector.tsx
|
|
1903
|
-
import { forwardRef as
|
|
1904
|
-
import { jsx as
|
|
1905
|
-
var KdsCardSelector =
|
|
1906
|
-
({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */
|
|
2307
|
+
import { forwardRef as forwardRef33 } from "react";
|
|
2308
|
+
import { jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2309
|
+
var KdsCardSelector = forwardRef33(
|
|
2310
|
+
({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */ jsxs26(
|
|
1907
2311
|
"button",
|
|
1908
2312
|
{
|
|
1909
2313
|
ref,
|
|
@@ -1911,9 +2315,9 @@ var KdsCardSelector = forwardRef30(
|
|
|
1911
2315
|
className: clsx("kds-card-selector", selected && "selected", className),
|
|
1912
2316
|
...props,
|
|
1913
2317
|
children: [
|
|
1914
|
-
icon && /* @__PURE__ */
|
|
1915
|
-
/* @__PURE__ */
|
|
1916
|
-
description && /* @__PURE__ */
|
|
2318
|
+
icon && /* @__PURE__ */ jsx35("span", { className: "kds-card-selector-icon", children: /* @__PURE__ */ jsx35("i", { className: "material-symbols-outlined", children: icon }) }),
|
|
2319
|
+
/* @__PURE__ */ jsx35("span", { className: "kds-card-selector-title", children: title }),
|
|
2320
|
+
description && /* @__PURE__ */ jsx35("span", { className: "kds-card-selector-description", children: description })
|
|
1917
2321
|
]
|
|
1918
2322
|
}
|
|
1919
2323
|
)
|
|
@@ -1921,26 +2325,26 @@ var KdsCardSelector = forwardRef30(
|
|
|
1921
2325
|
KdsCardSelector.displayName = "KdsCardSelector";
|
|
1922
2326
|
|
|
1923
2327
|
// src/components/domain/KdsCardPlan/KdsCardPlan.tsx
|
|
1924
|
-
import { forwardRef as
|
|
1925
|
-
import { jsx as
|
|
1926
|
-
var KdsCardPlan =
|
|
1927
|
-
({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */
|
|
2328
|
+
import { forwardRef as forwardRef34 } from "react";
|
|
2329
|
+
import { jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2330
|
+
var KdsCardPlan = forwardRef34(
|
|
2331
|
+
({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */ jsxs27(
|
|
1928
2332
|
"div",
|
|
1929
2333
|
{
|
|
1930
2334
|
ref,
|
|
1931
2335
|
className: clsx("kds-card-plan", recommended && "recommended", className),
|
|
1932
2336
|
...props,
|
|
1933
2337
|
children: [
|
|
1934
|
-
|
|
1935
|
-
/* @__PURE__ */
|
|
1936
|
-
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
period && /* @__PURE__ */ jsxs24("span", { children: [
|
|
2338
|
+
/* @__PURE__ */ jsx36("div", { className: "kds-card-plan-header", children: /* @__PURE__ */ jsx36("h3", { children: title }) }),
|
|
2339
|
+
/* @__PURE__ */ jsxs27("div", { className: "kds-card-plan-price", children: [
|
|
2340
|
+
/* @__PURE__ */ jsx36("span", { className: "kds-price", children: price }),
|
|
2341
|
+
period && /* @__PURE__ */ jsxs27("span", { className: "kds-price-period", children: [
|
|
1939
2342
|
"/",
|
|
1940
2343
|
period
|
|
1941
2344
|
] })
|
|
1942
2345
|
] }),
|
|
1943
|
-
|
|
2346
|
+
badgeText && /* @__PURE__ */ jsx36("span", { className: "kds-card-plan-badge", children: badgeText }),
|
|
2347
|
+
features && features.length > 0 && /* @__PURE__ */ jsx36("ul", { className: "kds-card-plan-features", children: features.map((f, i) => /* @__PURE__ */ jsx36("li", { children: f }, i)) }),
|
|
1944
2348
|
action
|
|
1945
2349
|
]
|
|
1946
2350
|
}
|
|
@@ -1949,50 +2353,658 @@ var KdsCardPlan = forwardRef31(
|
|
|
1949
2353
|
KdsCardPlan.displayName = "KdsCardPlan";
|
|
1950
2354
|
|
|
1951
2355
|
// src/components/domain/KdsInvoiceSticky/KdsInvoiceSticky.tsx
|
|
1952
|
-
import { forwardRef as
|
|
1953
|
-
import { jsx as
|
|
1954
|
-
var KdsInvoiceSticky =
|
|
1955
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2356
|
+
import { forwardRef as forwardRef35 } from "react";
|
|
2357
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2358
|
+
var KdsInvoiceSticky = forwardRef35(
|
|
2359
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
2360
|
+
"article",
|
|
2361
|
+
{
|
|
2362
|
+
ref,
|
|
2363
|
+
className: clsx("kds-card-elevated", "kds-invoice-sticky", className),
|
|
2364
|
+
...props,
|
|
2365
|
+
children
|
|
2366
|
+
}
|
|
2367
|
+
)
|
|
1956
2368
|
);
|
|
1957
2369
|
KdsInvoiceSticky.displayName = "KdsInvoiceSticky";
|
|
1958
2370
|
|
|
1959
2371
|
// src/components/domain/KdsBottomSheet/KdsBottomSheet.tsx
|
|
1960
|
-
import { forwardRef as
|
|
1961
|
-
import * as
|
|
1962
|
-
import { jsx as
|
|
1963
|
-
var KdsBottomSheet =
|
|
1964
|
-
({
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
actions
|
|
1971
|
-
|
|
2372
|
+
import { forwardRef as forwardRef36 } from "react";
|
|
2373
|
+
import * as Dialog2 from "@radix-ui/react-dialog";
|
|
2374
|
+
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2375
|
+
var KdsBottomSheet = forwardRef36(
|
|
2376
|
+
({
|
|
2377
|
+
open,
|
|
2378
|
+
onClose,
|
|
2379
|
+
title,
|
|
2380
|
+
description,
|
|
2381
|
+
children,
|
|
2382
|
+
actions,
|
|
2383
|
+
showGrabber = true,
|
|
2384
|
+
showCloseButton = false,
|
|
2385
|
+
container,
|
|
2386
|
+
className,
|
|
2387
|
+
...props
|
|
2388
|
+
}, ref) => /* @__PURE__ */ jsx38(
|
|
2389
|
+
Dialog2.Root,
|
|
2390
|
+
{
|
|
2391
|
+
open,
|
|
2392
|
+
onOpenChange: (o) => {
|
|
2393
|
+
if (!o) onClose();
|
|
2394
|
+
},
|
|
2395
|
+
children: /* @__PURE__ */ jsx38(Dialog2.Portal, { container, children: /* @__PURE__ */ jsx38("div", { className: "kds-theme-root", style: { display: "contents" }, children: /* @__PURE__ */ jsx38(Dialog2.Overlay, { className: "kds-bottom-sheet-scrim open", children: /* @__PURE__ */ jsxs28(
|
|
2396
|
+
Dialog2.Content,
|
|
2397
|
+
{
|
|
2398
|
+
ref,
|
|
2399
|
+
className: clsx("kds-bottom-sheet", className),
|
|
2400
|
+
onPointerDownOutside: (e) => {
|
|
2401
|
+
const target = e.target;
|
|
2402
|
+
if (target.closest(".kds-bottom-sheet")) e.preventDefault();
|
|
2403
|
+
},
|
|
2404
|
+
...props,
|
|
2405
|
+
children: [
|
|
2406
|
+
showGrabber && /* @__PURE__ */ jsx38("div", { className: "kds-bottom-sheet-grabber", "aria-hidden": "true" }),
|
|
2407
|
+
showCloseButton && /* @__PURE__ */ jsx38(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
2408
|
+
"button",
|
|
2409
|
+
{
|
|
2410
|
+
type: "button",
|
|
2411
|
+
className: "kds-bottom-sheet-close",
|
|
2412
|
+
"aria-label": "Cerrar",
|
|
2413
|
+
children: /* @__PURE__ */ jsx38("i", { className: "material-symbols-outlined", children: "close" })
|
|
2414
|
+
}
|
|
2415
|
+
) }),
|
|
2416
|
+
title && /* @__PURE__ */ jsx38(Dialog2.Title, { className: "kds-bottom-sheet-title", children: title }),
|
|
2417
|
+
description && /* @__PURE__ */ jsx38(Dialog2.Description, { className: "kds-bottom-sheet-description", children: description }),
|
|
2418
|
+
/* @__PURE__ */ jsx38("div", { className: "kds-bottom-sheet-body", children }),
|
|
2419
|
+
actions && /* @__PURE__ */ jsx38("div", { className: "kds-bottom-sheet-actions", children: actions })
|
|
2420
|
+
]
|
|
2421
|
+
}
|
|
2422
|
+
) }) }) })
|
|
2423
|
+
}
|
|
2424
|
+
)
|
|
1972
2425
|
);
|
|
1973
2426
|
KdsBottomSheet.displayName = "KdsBottomSheet";
|
|
1974
2427
|
|
|
1975
2428
|
// src/components/domain/KdsSecureFooter/KdsSecureFooter.tsx
|
|
1976
|
-
import { forwardRef as
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
2429
|
+
import { forwardRef as forwardRef38 } from "react";
|
|
2430
|
+
|
|
2431
|
+
// src/components/domain/KdsSecureFooter/KhipuWordmark.tsx
|
|
2432
|
+
import { forwardRef as forwardRef37 } from "react";
|
|
2433
|
+
import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2434
|
+
var KhipuWordmark = forwardRef37(
|
|
2435
|
+
({ className = "khipu-mark", ...props }, ref) => /* @__PURE__ */ jsxs29(
|
|
2436
|
+
"svg",
|
|
2437
|
+
{
|
|
2438
|
+
ref,
|
|
2439
|
+
viewBox: "0 0 45 15",
|
|
2440
|
+
role: "img",
|
|
2441
|
+
"aria-label": "Khipu",
|
|
2442
|
+
className,
|
|
2443
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2444
|
+
...props,
|
|
2445
|
+
children: [
|
|
2446
|
+
/* @__PURE__ */ jsx39("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" }),
|
|
2447
|
+
/* @__PURE__ */ jsx39("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" }),
|
|
2448
|
+
/* @__PURE__ */ jsx39("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" }),
|
|
2449
|
+
/* @__PURE__ */ jsx39("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" }),
|
|
2450
|
+
/* @__PURE__ */ jsx39("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" }),
|
|
2451
|
+
/* @__PURE__ */ jsx39("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" }),
|
|
2452
|
+
/* @__PURE__ */ jsx39("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" }),
|
|
2453
|
+
/* @__PURE__ */ jsx39("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" })
|
|
2454
|
+
]
|
|
2455
|
+
}
|
|
2456
|
+
)
|
|
2457
|
+
);
|
|
2458
|
+
KhipuWordmark.displayName = "KhipuWordmark";
|
|
2459
|
+
|
|
2460
|
+
// src/components/domain/KdsSecureFooter/KdsSecureFooter.tsx
|
|
2461
|
+
import { Fragment as Fragment3, jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2462
|
+
var KdsSecureFooter = forwardRef38(
|
|
2463
|
+
({ variant = "default", showLogo = true, psp, children, className, ...props }, ref) => /* @__PURE__ */ jsxs30("footer", { ref, className: clsx("kds-secure-footer", variant === "inside" && "inside", className), ...props, children: [
|
|
2464
|
+
/* @__PURE__ */ jsxs30("svg", { className: "kds-secure-footer-lock", viewBox: "0 0 24 24", "aria-hidden": "true", children: [
|
|
2465
|
+
/* @__PURE__ */ jsx40("rect", { x: "4.5", y: "10.5", width: "15", height: "10", rx: "2.25" }),
|
|
2466
|
+
/* @__PURE__ */ jsx40("path", { d: "M8 10.5V7a4 4 0 0 1 8 0v3.5" })
|
|
2467
|
+
] }),
|
|
2468
|
+
children || /* @__PURE__ */ jsx40("span", { children: "Pago seguro procesado por" }),
|
|
2469
|
+
showLogo && /* @__PURE__ */ jsx40(KhipuWordmark, {}),
|
|
2470
|
+
psp && /* @__PURE__ */ jsxs30(Fragment3, { children: [
|
|
2471
|
+
/* @__PURE__ */ jsx40("span", { className: "kds-secure-footer-sep", "aria-hidden": "true" }),
|
|
2472
|
+
psp
|
|
2473
|
+
] })
|
|
1982
2474
|
] })
|
|
1983
2475
|
);
|
|
1984
2476
|
KdsSecureFooter.displayName = "KdsSecureFooter";
|
|
1985
2477
|
|
|
1986
2478
|
// src/components/domain/KdsRecapList/KdsRecapList.tsx
|
|
1987
|
-
import { forwardRef as
|
|
1988
|
-
import { jsx as
|
|
1989
|
-
var KdsRecapList =
|
|
1990
|
-
({ items, className, ...props }, ref) => /* @__PURE__ */
|
|
1991
|
-
/* @__PURE__ */
|
|
1992
|
-
/* @__PURE__ */
|
|
2479
|
+
import { forwardRef as forwardRef39 } from "react";
|
|
2480
|
+
import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2481
|
+
var KdsRecapList = forwardRef39(
|
|
2482
|
+
({ items, className, ...props }, ref) => /* @__PURE__ */ jsx41("ul", { ref, className: clsx("kds-recap-list", className), ...props, children: items.map((item, i) => /* @__PURE__ */ jsxs31("li", { children: [
|
|
2483
|
+
/* @__PURE__ */ jsx41("span", { className: "kds-key", children: item.label }),
|
|
2484
|
+
/* @__PURE__ */ jsx41("span", { className: clsx("kds-value", !item.value && item.placeholder && "placeholder"), children: item.value || item.placeholder || "-" })
|
|
1993
2485
|
] }, i)) })
|
|
1994
2486
|
);
|
|
1995
2487
|
KdsRecapList.displayName = "KdsRecapList";
|
|
2488
|
+
|
|
2489
|
+
// src/components/domain/KdsMontoRow/KdsMontoRow.tsx
|
|
2490
|
+
import { forwardRef as forwardRef40 } from "react";
|
|
2491
|
+
import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2492
|
+
var KdsMontoRow = forwardRef40(
|
|
2493
|
+
({ title, value, deadline, className, ...props }, ref) => /* @__PURE__ */ jsxs32("div", { ref, className: clsx("kds-monto-row", className), ...props, children: [
|
|
2494
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
2495
|
+
/* @__PURE__ */ jsx42("div", { className: "kds-monto-row-title", children: title }),
|
|
2496
|
+
deadline && /* @__PURE__ */ jsx42("div", { className: "kds-monto-row-deadline", children: deadline })
|
|
2497
|
+
] }),
|
|
2498
|
+
/* @__PURE__ */ jsx42("div", { className: "kds-monto-row-value", children: value })
|
|
2499
|
+
] })
|
|
2500
|
+
);
|
|
2501
|
+
KdsMontoRow.displayName = "KdsMontoRow";
|
|
2502
|
+
|
|
2503
|
+
// src/components/domain/KdsMerchantTile/KdsMerchantTile.tsx
|
|
2504
|
+
import { forwardRef as forwardRef41 } from "react";
|
|
2505
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2506
|
+
var KdsMerchantTile = forwardRef41(
|
|
2507
|
+
({ name, logoUrl, initials, compact, className, ...props }, ref) => {
|
|
2508
|
+
const displayInitials = (initials ?? name.slice(0, 2)).toUpperCase();
|
|
2509
|
+
return /* @__PURE__ */ jsx43(
|
|
2510
|
+
"div",
|
|
2511
|
+
{
|
|
2512
|
+
ref,
|
|
2513
|
+
className: clsx("kds-merchant-tile", logoUrl && "logo", compact && "compact", className),
|
|
2514
|
+
"aria-label": name,
|
|
2515
|
+
...props,
|
|
2516
|
+
children: logoUrl ? /* @__PURE__ */ jsx43("img", { src: logoUrl, alt: name }) : displayInitials
|
|
2517
|
+
}
|
|
2518
|
+
);
|
|
2519
|
+
}
|
|
2520
|
+
);
|
|
2521
|
+
KdsMerchantTile.displayName = "KdsMerchantTile";
|
|
2522
|
+
|
|
2523
|
+
// src/components/domain/KdsInvoiceMerchant/KdsInvoiceMerchant.tsx
|
|
2524
|
+
import { forwardRef as forwardRef42, useState as useState9 } from "react";
|
|
2525
|
+
|
|
2526
|
+
// src/components/domain/KdsInvoiceMerchant/useLogoBackdrop.ts
|
|
2527
|
+
import { useEffect as useEffect4, useState as useState8 } from "react";
|
|
2528
|
+
|
|
2529
|
+
// src/components/domain/KdsInvoiceMerchant/logoLuminance.ts
|
|
2530
|
+
var LIGHT_LOGO_LUMINANCE_THRESHOLD = 0.72;
|
|
2531
|
+
var SAMPLE_SIZE = 16;
|
|
2532
|
+
var ALPHA_THRESHOLD = 128;
|
|
2533
|
+
var MIN_OPAQUE_RATIO = 0.02;
|
|
2534
|
+
function measureLogoLuminance(url) {
|
|
2535
|
+
return new Promise((resolve) => {
|
|
2536
|
+
const probe = new Image();
|
|
2537
|
+
probe.crossOrigin = "anonymous";
|
|
2538
|
+
probe.onload = () => {
|
|
2539
|
+
try {
|
|
2540
|
+
const canvas = document.createElement("canvas");
|
|
2541
|
+
canvas.width = SAMPLE_SIZE;
|
|
2542
|
+
canvas.height = SAMPLE_SIZE;
|
|
2543
|
+
const context = canvas.getContext("2d");
|
|
2544
|
+
if (!context) {
|
|
2545
|
+
resolve(null);
|
|
2546
|
+
return;
|
|
2547
|
+
}
|
|
2548
|
+
context.drawImage(probe, 0, 0, SAMPLE_SIZE, SAMPLE_SIZE);
|
|
2549
|
+
const { data } = context.getImageData(0, 0, SAMPLE_SIZE, SAMPLE_SIZE);
|
|
2550
|
+
let sum = 0;
|
|
2551
|
+
let opaquePixels = 0;
|
|
2552
|
+
for (let i = 0; i < data.length; i += 4) {
|
|
2553
|
+
if (data[i + 3] < ALPHA_THRESHOLD) continue;
|
|
2554
|
+
sum += (0.2126 * data[i] + 0.7152 * data[i + 1] + 0.0722 * data[i + 2]) / 255;
|
|
2555
|
+
opaquePixels++;
|
|
2556
|
+
}
|
|
2557
|
+
if (opaquePixels < SAMPLE_SIZE * SAMPLE_SIZE * MIN_OPAQUE_RATIO) {
|
|
2558
|
+
resolve(null);
|
|
2559
|
+
return;
|
|
2560
|
+
}
|
|
2561
|
+
resolve(sum / opaquePixels);
|
|
2562
|
+
} catch {
|
|
2563
|
+
resolve(null);
|
|
2564
|
+
}
|
|
2565
|
+
};
|
|
2566
|
+
probe.onerror = () => resolve(null);
|
|
2567
|
+
probe.src = url;
|
|
2568
|
+
});
|
|
2569
|
+
}
|
|
2570
|
+
function pickLogoBackdrop(luminance) {
|
|
2571
|
+
return luminance != null && luminance > LIGHT_LOGO_LUMINANCE_THRESHOLD ? "dark" : "light";
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
// src/components/domain/KdsInvoiceMerchant/useLogoBackdrop.ts
|
|
2575
|
+
function useLogoBackdrop(logoUrl) {
|
|
2576
|
+
const [backdrop, setBackdrop] = useState8("light");
|
|
2577
|
+
useEffect4(() => {
|
|
2578
|
+
let cancelled = false;
|
|
2579
|
+
setBackdrop("light");
|
|
2580
|
+
if (!logoUrl) {
|
|
2581
|
+
return void 0;
|
|
2582
|
+
}
|
|
2583
|
+
measureLogoLuminance(logoUrl).then((luminance) => {
|
|
2584
|
+
if (!cancelled) {
|
|
2585
|
+
setBackdrop(pickLogoBackdrop(luminance));
|
|
2586
|
+
}
|
|
2587
|
+
});
|
|
2588
|
+
return () => {
|
|
2589
|
+
cancelled = true;
|
|
2590
|
+
};
|
|
2591
|
+
}, [logoUrl]);
|
|
2592
|
+
return backdrop;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
// src/components/domain/KdsInvoiceMerchant/KdsInvoiceMerchant.tsx
|
|
2596
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2597
|
+
var KdsInvoiceMerchant = forwardRef42(
|
|
2598
|
+
({ logoUrl, brandColor, className, style, ...props }, ref) => {
|
|
2599
|
+
const [failed, setFailed] = useState9(false);
|
|
2600
|
+
const showLogo = !!logoUrl && !failed;
|
|
2601
|
+
const backdrop = useLogoBackdrop(showLogo ? logoUrl : void 0);
|
|
2602
|
+
return /* @__PURE__ */ jsx44(
|
|
2603
|
+
"div",
|
|
2604
|
+
{
|
|
2605
|
+
ref,
|
|
2606
|
+
className: clsx(
|
|
2607
|
+
"kds-invoice-merchant",
|
|
2608
|
+
showLogo && "kds-invoice-merchant-neutral",
|
|
2609
|
+
showLogo && backdrop === "dark" && "dark",
|
|
2610
|
+
className
|
|
2611
|
+
),
|
|
2612
|
+
"aria-hidden": "true",
|
|
2613
|
+
style: !showLogo && brandColor ? { background: brandColor, ...style } : style,
|
|
2614
|
+
...props,
|
|
2615
|
+
children: showLogo ? /* @__PURE__ */ jsx44("img", { src: logoUrl, alt: "", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx44("i", { className: "material-symbols-outlined", children: "storefront" })
|
|
2616
|
+
}
|
|
2617
|
+
);
|
|
2618
|
+
}
|
|
2619
|
+
);
|
|
2620
|
+
KdsInvoiceMerchant.displayName = "KdsInvoiceMerchant";
|
|
2621
|
+
|
|
2622
|
+
// src/components/domain/KdsPaymentTotal/KdsPaymentTotal.tsx
|
|
2623
|
+
import { forwardRef as forwardRef43 } from "react";
|
|
2624
|
+
import { jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2625
|
+
var KdsPaymentTotal = forwardRef43(
|
|
2626
|
+
({
|
|
2627
|
+
variant = "default",
|
|
2628
|
+
tone = "brand",
|
|
2629
|
+
centered = false,
|
|
2630
|
+
amount,
|
|
2631
|
+
currency = "S/",
|
|
2632
|
+
decimals = 2,
|
|
2633
|
+
locale = "es-PE",
|
|
2634
|
+
label = "Monto a pagar",
|
|
2635
|
+
title = "Escanea el QR",
|
|
2636
|
+
titleMobile = "Descarga el QR",
|
|
2637
|
+
className,
|
|
2638
|
+
...props
|
|
2639
|
+
}, ref) => {
|
|
2640
|
+
const { integer, fraction } = formatAmount(amount, decimals, locale);
|
|
2641
|
+
const isEmail = variant === "email";
|
|
2642
|
+
const isInfoTone = tone === "info";
|
|
2643
|
+
return /* @__PURE__ */ jsxs33(
|
|
2644
|
+
"div",
|
|
2645
|
+
{
|
|
2646
|
+
ref,
|
|
2647
|
+
className: clsx(
|
|
2648
|
+
"kds-payment-total",
|
|
2649
|
+
isEmail && "kds-payment-total--email",
|
|
2650
|
+
isInfoTone && "kds-payment-total--tone-info",
|
|
2651
|
+
centered && "kds-payment-total--centered",
|
|
2652
|
+
className
|
|
2653
|
+
),
|
|
2654
|
+
...props,
|
|
2655
|
+
children: [
|
|
2656
|
+
!isEmail && title != null && /* @__PURE__ */ jsx45("h5", { className: "kds-payment-total-title", children: title }),
|
|
2657
|
+
!isEmail && titleMobile != null && /* @__PURE__ */ jsx45("h5", { className: "kds-payment-total-title-mobile", children: titleMobile }),
|
|
2658
|
+
label != null && /* @__PURE__ */ jsx45("h6", { className: "kds-payment-label", children: label }),
|
|
2659
|
+
/* @__PURE__ */ jsxs33("h5", { className: "kds-payment-amount", children: [
|
|
2660
|
+
currency,
|
|
2661
|
+
" ",
|
|
2662
|
+
integer,
|
|
2663
|
+
fraction !== null && /* @__PURE__ */ jsx45("sup", { className: "kds-payment-total-decimal-sup", children: fraction })
|
|
2664
|
+
] })
|
|
2665
|
+
]
|
|
2666
|
+
}
|
|
2667
|
+
);
|
|
2668
|
+
}
|
|
2669
|
+
);
|
|
2670
|
+
KdsPaymentTotal.displayName = "KdsPaymentTotal";
|
|
2671
|
+
function formatAmount(amount, decimals, locale) {
|
|
2672
|
+
const showDecimals = typeof decimals === "number" && decimals > 0;
|
|
2673
|
+
if (typeof amount === "number") {
|
|
2674
|
+
if (showDecimals) {
|
|
2675
|
+
const fixed = amount.toFixed(decimals);
|
|
2676
|
+
const [int, frac] = fixed.split(".");
|
|
2677
|
+
const formattedInt2 = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
|
|
2678
|
+
Number(int)
|
|
2679
|
+
);
|
|
2680
|
+
return { integer: formattedInt2, fraction: frac ?? null };
|
|
2681
|
+
}
|
|
2682
|
+
const formattedInt = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
|
|
2683
|
+
Math.trunc(amount)
|
|
2684
|
+
);
|
|
2685
|
+
return { integer: formattedInt, fraction: null };
|
|
2686
|
+
}
|
|
2687
|
+
const str = amount.trim();
|
|
2688
|
+
const dotIdx = str.indexOf(".");
|
|
2689
|
+
if (dotIdx === -1 || !showDecimals) {
|
|
2690
|
+
return { integer: str, fraction: null };
|
|
2691
|
+
}
|
|
2692
|
+
return {
|
|
2693
|
+
integer: str.slice(0, dotIdx),
|
|
2694
|
+
fraction: str.slice(dotIdx + 1)
|
|
2695
|
+
};
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
// src/components/domain/KdsBillAttachment/KdsBillAttachment.tsx
|
|
2699
|
+
import { forwardRef as forwardRef44 } from "react";
|
|
2700
|
+
import { jsx as jsx46, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2701
|
+
var KdsBillAttachment = forwardRef44(
|
|
2702
|
+
({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ jsxs34(
|
|
2703
|
+
"a",
|
|
2704
|
+
{
|
|
2705
|
+
ref,
|
|
2706
|
+
href,
|
|
2707
|
+
target: "_blank",
|
|
2708
|
+
rel: "noopener noreferrer",
|
|
2709
|
+
className: clsx("kds-bill-attachment", className),
|
|
2710
|
+
...props,
|
|
2711
|
+
children: [
|
|
2712
|
+
/* @__PURE__ */ jsx46("i", { className: "material-symbols-outlined", children: icon }),
|
|
2713
|
+
/* @__PURE__ */ jsx46("span", { children: filename })
|
|
2714
|
+
]
|
|
2715
|
+
}
|
|
2716
|
+
)
|
|
2717
|
+
);
|
|
2718
|
+
KdsBillAttachment.displayName = "KdsBillAttachment";
|
|
2719
|
+
var KdsBillAttachments = forwardRef44(
|
|
2720
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx46("div", { ref, className: clsx("kds-bill-attachments", className), ...props, children })
|
|
2721
|
+
);
|
|
2722
|
+
KdsBillAttachments.displayName = "KdsBillAttachments";
|
|
2723
|
+
|
|
2724
|
+
// src/utils/runAfterPointerGesture.ts
|
|
2725
|
+
var KEYBOARD_FALLBACK_MS = 400;
|
|
2726
|
+
var runAfterPointerGesture = (callback) => {
|
|
2727
|
+
let done = false;
|
|
2728
|
+
const run = () => {
|
|
2729
|
+
if (done) {
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
done = true;
|
|
2733
|
+
document.removeEventListener("click", run, true);
|
|
2734
|
+
window.setTimeout(callback, 0);
|
|
2735
|
+
};
|
|
2736
|
+
document.addEventListener("click", run, true);
|
|
2737
|
+
window.setTimeout(run, KEYBOARD_FALLBACK_MS);
|
|
2738
|
+
};
|
|
2739
|
+
|
|
2740
|
+
// src/utils/scrollToFirstInvalidField.ts
|
|
2741
|
+
var RECENTER_WINDOW_MS = 1500;
|
|
2742
|
+
var getScrollParent = (field) => {
|
|
2743
|
+
let node = field.parentElement;
|
|
2744
|
+
while (node) {
|
|
2745
|
+
const style = getComputedStyle(node);
|
|
2746
|
+
if (node.scrollHeight > node.clientHeight && /auto|scroll|overlay/.test(style.overflowY)) {
|
|
2747
|
+
const htmlOverflow = getComputedStyle(document.documentElement).overflowY;
|
|
2748
|
+
if (node === document.body && (htmlOverflow === "visible" || htmlOverflow === "")) {
|
|
2749
|
+
return null;
|
|
2750
|
+
}
|
|
2751
|
+
return node;
|
|
2752
|
+
}
|
|
2753
|
+
node = node.parentElement;
|
|
2754
|
+
}
|
|
2755
|
+
return null;
|
|
2756
|
+
};
|
|
2757
|
+
var centerFieldInViewport = (field) => {
|
|
2758
|
+
const viewport = window.visualViewport;
|
|
2759
|
+
const viewportTop = viewport?.offsetTop ?? 0;
|
|
2760
|
+
const viewportHeight = viewport?.height ?? window.innerHeight;
|
|
2761
|
+
const rect = field.getBoundingClientRect();
|
|
2762
|
+
const scroller = getScrollParent(field);
|
|
2763
|
+
if (!scroller || scroller === document.documentElement || scroller === document.scrollingElement) {
|
|
2764
|
+
const top = window.scrollY + rect.top - viewportTop - (viewportHeight - rect.height) / 2;
|
|
2765
|
+
window.scrollTo({ top: Math.max(top, 0), behavior: "smooth" });
|
|
2766
|
+
return;
|
|
2767
|
+
}
|
|
2768
|
+
const scrollerRect = scroller.getBoundingClientRect();
|
|
2769
|
+
const visibleTop = Math.max(scrollerRect.top, viewportTop);
|
|
2770
|
+
const visibleBottom = Math.min(scrollerRect.bottom, viewportTop + viewportHeight);
|
|
2771
|
+
const visibleHeight = Math.max(visibleBottom - visibleTop, 0);
|
|
2772
|
+
const target = scroller.scrollTop + (rect.top - visibleTop) - (visibleHeight - rect.height) / 2;
|
|
2773
|
+
scroller.scrollTo({ top: Math.max(target, 0), behavior: "smooth" });
|
|
2774
|
+
};
|
|
2775
|
+
var isInvalidField = (element) => {
|
|
2776
|
+
const field = element;
|
|
2777
|
+
return typeof field.willValidate === "boolean" && field.willValidate && !field.validity.valid;
|
|
2778
|
+
};
|
|
2779
|
+
var scrollToFirstInvalidField = (form) => {
|
|
2780
|
+
const firstInvalid = Array.from(form.elements).find(isInvalidField);
|
|
2781
|
+
if (!firstInvalid) {
|
|
2782
|
+
return;
|
|
2783
|
+
}
|
|
2784
|
+
centerFieldInViewport(firstInvalid);
|
|
2785
|
+
const viewport = window.visualViewport;
|
|
2786
|
+
if (viewport) {
|
|
2787
|
+
const recenter = () => centerFieldInViewport(firstInvalid);
|
|
2788
|
+
viewport.addEventListener("resize", recenter, { once: true });
|
|
2789
|
+
window.setTimeout(() => viewport.removeEventListener("resize", recenter), RECENTER_WINDOW_MS);
|
|
2790
|
+
}
|
|
2791
|
+
};
|
|
2792
|
+
var focusFirstInvalidField = scrollToFirstInvalidField;
|
|
2793
|
+
var isTextEntryElement = (element) => {
|
|
2794
|
+
if (!element) {
|
|
2795
|
+
return false;
|
|
2796
|
+
}
|
|
2797
|
+
if (element.tagName === "TEXTAREA") {
|
|
2798
|
+
return true;
|
|
2799
|
+
}
|
|
2800
|
+
const input = element;
|
|
2801
|
+
return element.tagName === "INPUT" && !["checkbox", "radio", "button", "submit", "reset"].includes(input.type);
|
|
2802
|
+
};
|
|
2803
|
+
var guideToFirstInvalidFieldOnBlur = (form) => {
|
|
2804
|
+
runAfterPointerGesture(() => {
|
|
2805
|
+
if (!form.isConnected) {
|
|
2806
|
+
return;
|
|
2807
|
+
}
|
|
2808
|
+
const active = document.activeElement;
|
|
2809
|
+
if (active && form.contains(active) && isTextEntryElement(active)) {
|
|
2810
|
+
return;
|
|
2811
|
+
}
|
|
2812
|
+
if (!form.checkValidity()) {
|
|
2813
|
+
scrollToFirstInvalidField(form);
|
|
2814
|
+
}
|
|
2815
|
+
});
|
|
2816
|
+
};
|
|
2817
|
+
|
|
2818
|
+
// src/components/core/hooks/useStickyInvoiceCollapse.ts
|
|
2819
|
+
import { useEffect as useEffect5, useRef as useRef4 } from "react";
|
|
2820
|
+
function useStickyInvoiceCollapse(options = {}) {
|
|
2821
|
+
const { onCollapseStart, collapseEnd = 20, mobileBreakpoint = 768 } = options;
|
|
2822
|
+
const onCollapseStartRef = useRef4(onCollapseStart);
|
|
2823
|
+
onCollapseStartRef.current = onCollapseStart;
|
|
2824
|
+
useEffect5(() => {
|
|
2825
|
+
let viewportOffset = 0;
|
|
2826
|
+
let ticking = false;
|
|
2827
|
+
let wasCollapsing = false;
|
|
2828
|
+
const isMobile = () => window.innerWidth < mobileBreakpoint;
|
|
2829
|
+
const closeOpenPanels = (sticky) => {
|
|
2830
|
+
const toggles = sticky.querySelectorAll(
|
|
2831
|
+
'[data-expand-toggle][aria-expanded="true"], .kds-expand-toggle[aria-expanded="true"]'
|
|
2832
|
+
);
|
|
2833
|
+
toggles.forEach((toggle) => {
|
|
2834
|
+
toggle.setAttribute("aria-expanded", "false");
|
|
2835
|
+
const panelId = toggle.getAttribute("aria-controls");
|
|
2836
|
+
const panel = panelId ? document.getElementById(panelId) : toggle.parentElement?.querySelector("[data-expand-panel], .kds-expand-panel");
|
|
2837
|
+
panel?.classList.remove("open");
|
|
2838
|
+
if (panel) panel.style.maxHeight = "";
|
|
2839
|
+
});
|
|
2840
|
+
};
|
|
2841
|
+
const apply = () => {
|
|
2842
|
+
ticking = false;
|
|
2843
|
+
const screen = document.querySelector(".kds-screen.active");
|
|
2844
|
+
if (!screen) return;
|
|
2845
|
+
const sticky = screen.querySelector(".kds-invoice-sticky");
|
|
2846
|
+
if (!sticky || !isMobile()) {
|
|
2847
|
+
screen.style.removeProperty("--collapse-progress");
|
|
2848
|
+
screen.style.removeProperty("--collapse-collapsible-h");
|
|
2849
|
+
sticky?.classList.remove("is-collapsed");
|
|
2850
|
+
wasCollapsing = false;
|
|
2851
|
+
return;
|
|
2852
|
+
}
|
|
2853
|
+
const scrollY = Math.max(window.scrollY || window.pageYOffset || 0, viewportOffset);
|
|
2854
|
+
const progress = Math.min(Math.max(scrollY / collapseEnd, 0), 1);
|
|
2855
|
+
if (!screen.style.getPropertyValue("--collapse-collapsible-h")) {
|
|
2856
|
+
const collapsible = sticky.querySelector(".kds-invoice-collapsible");
|
|
2857
|
+
if (collapsible) {
|
|
2858
|
+
screen.style.setProperty("--collapse-collapsible-h", `${collapsible.offsetHeight}px`);
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
screen.style.setProperty("--collapse-progress", String(progress));
|
|
2862
|
+
sticky.classList.toggle("is-collapsed", progress >= 1);
|
|
2863
|
+
if (progress > 0) {
|
|
2864
|
+
if (!wasCollapsing) {
|
|
2865
|
+
wasCollapsing = true;
|
|
2866
|
+
closeOpenPanels(sticky);
|
|
2867
|
+
onCollapseStartRef.current?.();
|
|
2868
|
+
}
|
|
2869
|
+
} else {
|
|
2870
|
+
wasCollapsing = false;
|
|
2871
|
+
}
|
|
2872
|
+
};
|
|
2873
|
+
const onScroll = () => {
|
|
2874
|
+
if (ticking) return;
|
|
2875
|
+
ticking = true;
|
|
2876
|
+
window.requestAnimationFrame(apply);
|
|
2877
|
+
};
|
|
2878
|
+
const onMessage = (event) => {
|
|
2879
|
+
if (event.data && event.data.type === "VIEWPORT_OFFSET") {
|
|
2880
|
+
viewportOffset = Math.max(0, event.data.offsetTop || 0);
|
|
2881
|
+
onScroll();
|
|
2882
|
+
}
|
|
2883
|
+
};
|
|
2884
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
2885
|
+
window.addEventListener("resize", onScroll);
|
|
2886
|
+
window.addEventListener("message", onMessage);
|
|
2887
|
+
apply();
|
|
2888
|
+
return () => {
|
|
2889
|
+
window.removeEventListener("scroll", onScroll);
|
|
2890
|
+
window.removeEventListener("resize", onScroll);
|
|
2891
|
+
window.removeEventListener("message", onMessage);
|
|
2892
|
+
};
|
|
2893
|
+
}, [collapseEnd, mobileBreakpoint]);
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
// src/components/core/hooks/useExpandToggle.ts
|
|
2897
|
+
import { useCallback as useCallback4, useId, useLayoutEffect, useRef as useRef5, useState as useState10 } from "react";
|
|
2898
|
+
function useExpandToggle(options = {}) {
|
|
2899
|
+
const { defaultOpen = false, open: controlledOpen, onOpenChange, id } = options;
|
|
2900
|
+
const generatedId = useId();
|
|
2901
|
+
const panelId = id ?? `kds-expand-${generatedId}`;
|
|
2902
|
+
const isControlled = controlledOpen !== void 0;
|
|
2903
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState10(defaultOpen);
|
|
2904
|
+
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
2905
|
+
const panelRef = useRef5(null);
|
|
2906
|
+
const setPanelRef = useCallback4((node) => {
|
|
2907
|
+
panelRef.current = node;
|
|
2908
|
+
}, []);
|
|
2909
|
+
useLayoutEffect(() => {
|
|
2910
|
+
const panel = panelRef.current;
|
|
2911
|
+
if (!panel) return;
|
|
2912
|
+
panel.style.maxHeight = open ? `${panel.scrollHeight}px` : "";
|
|
2913
|
+
}, [open]);
|
|
2914
|
+
const setOpen = useCallback4(
|
|
2915
|
+
(next) => {
|
|
2916
|
+
if (!isControlled) {
|
|
2917
|
+
setUncontrolledOpen(next);
|
|
2918
|
+
}
|
|
2919
|
+
onOpenChange?.(next);
|
|
2920
|
+
},
|
|
2921
|
+
[isControlled, onOpenChange]
|
|
2922
|
+
);
|
|
2923
|
+
const toggle = useCallback4(() => setOpen(!open), [open, setOpen]);
|
|
2924
|
+
const getToggleProps = useCallback4(
|
|
2925
|
+
() => ({
|
|
2926
|
+
type: "button",
|
|
2927
|
+
"aria-expanded": open,
|
|
2928
|
+
"aria-controls": panelId,
|
|
2929
|
+
onClick: () => toggle()
|
|
2930
|
+
}),
|
|
2931
|
+
[open, panelId, toggle]
|
|
2932
|
+
);
|
|
2933
|
+
const getPanelProps = useCallback4(
|
|
2934
|
+
(baseClassName = "kds-expand-panel") => ({
|
|
2935
|
+
id: panelId,
|
|
2936
|
+
className: open ? `${baseClassName} open` : baseClassName,
|
|
2937
|
+
hidden: !open,
|
|
2938
|
+
ref: setPanelRef
|
|
2939
|
+
}),
|
|
2940
|
+
[open, panelId, setPanelRef]
|
|
2941
|
+
);
|
|
2942
|
+
return { open, setOpen, toggle, getToggleProps, getPanelProps };
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
// src/components/core/hooks/useHideOnScroll.ts
|
|
2946
|
+
import { useEffect as useEffect6, useState as useState11 } from "react";
|
|
2947
|
+
function useHideOnScroll(options = {}) {
|
|
2948
|
+
const { threshold = 8, topOffset = 0 } = options;
|
|
2949
|
+
const [hidden, setHidden] = useState11(false);
|
|
2950
|
+
useEffect6(() => {
|
|
2951
|
+
let viewportOffset = 0;
|
|
2952
|
+
let lastY = 0;
|
|
2953
|
+
let ticking = false;
|
|
2954
|
+
const currentY = () => Math.max(window.scrollY || window.pageYOffset || 0, viewportOffset);
|
|
2955
|
+
const apply = () => {
|
|
2956
|
+
ticking = false;
|
|
2957
|
+
const y = currentY();
|
|
2958
|
+
if (y <= topOffset) {
|
|
2959
|
+
setHidden(false);
|
|
2960
|
+
lastY = y;
|
|
2961
|
+
return;
|
|
2962
|
+
}
|
|
2963
|
+
const delta = y - lastY;
|
|
2964
|
+
if (Math.abs(delta) < threshold) return;
|
|
2965
|
+
setHidden(delta > 0);
|
|
2966
|
+
lastY = y;
|
|
2967
|
+
};
|
|
2968
|
+
const onScroll = () => {
|
|
2969
|
+
if (ticking) return;
|
|
2970
|
+
ticking = true;
|
|
2971
|
+
window.requestAnimationFrame(apply);
|
|
2972
|
+
};
|
|
2973
|
+
const onMessage = (event) => {
|
|
2974
|
+
if (event.data && event.data.type === "VIEWPORT_OFFSET") {
|
|
2975
|
+
viewportOffset = Math.max(0, event.data.offsetTop || 0);
|
|
2976
|
+
onScroll();
|
|
2977
|
+
}
|
|
2978
|
+
};
|
|
2979
|
+
lastY = currentY();
|
|
2980
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
2981
|
+
window.addEventListener("resize", onScroll);
|
|
2982
|
+
window.addEventListener("message", onMessage);
|
|
2983
|
+
return () => {
|
|
2984
|
+
window.removeEventListener("scroll", onScroll);
|
|
2985
|
+
window.removeEventListener("resize", onScroll);
|
|
2986
|
+
window.removeEventListener("message", onMessage);
|
|
2987
|
+
};
|
|
2988
|
+
}, [threshold, topOffset]);
|
|
2989
|
+
return { hidden };
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
// src/components/core/hooks/useMediaQuery.ts
|
|
2993
|
+
import { useEffect as useEffect7, useState as useState12 } from "react";
|
|
2994
|
+
function useMediaQuery(query) {
|
|
2995
|
+
const [matches, setMatches] = useState12(
|
|
2996
|
+
() => typeof window !== "undefined" ? window.matchMedia(query).matches : false
|
|
2997
|
+
);
|
|
2998
|
+
useEffect7(() => {
|
|
2999
|
+
if (typeof window === "undefined") return;
|
|
3000
|
+
const mql = window.matchMedia(query);
|
|
3001
|
+
setMatches(mql.matches);
|
|
3002
|
+
const onChange = (event) => setMatches(event.matches);
|
|
3003
|
+
mql.addEventListener("change", onChange);
|
|
3004
|
+
return () => mql.removeEventListener("change", onChange);
|
|
3005
|
+
}, [query]);
|
|
3006
|
+
return matches;
|
|
3007
|
+
}
|
|
1996
3008
|
export {
|
|
1997
3009
|
KdsAccordion,
|
|
1998
3010
|
KdsAccordionDetails,
|
|
@@ -2001,6 +3013,8 @@ export {
|
|
|
2001
3013
|
KdsBankList,
|
|
2002
3014
|
KdsBankModal,
|
|
2003
3015
|
KdsBankRow,
|
|
3016
|
+
KdsBillAttachment,
|
|
3017
|
+
KdsBillAttachments,
|
|
2004
3018
|
KdsBottomSheet,
|
|
2005
3019
|
KdsButton,
|
|
2006
3020
|
KdsCard,
|
|
@@ -2011,24 +3025,27 @@ export {
|
|
|
2011
3025
|
KdsCardSelector,
|
|
2012
3026
|
KdsCheckbox,
|
|
2013
3027
|
KdsChip,
|
|
3028
|
+
KdsCopyButton,
|
|
2014
3029
|
KdsCopyRow,
|
|
2015
3030
|
KdsCopyableTable,
|
|
2016
3031
|
KdsCountdown,
|
|
2017
3032
|
KdsDivider,
|
|
3033
|
+
KdsEmptyState,
|
|
2018
3034
|
KdsExpandPanel,
|
|
3035
|
+
KdsFab,
|
|
3036
|
+
KdsInvoiceMerchant,
|
|
2019
3037
|
KdsInvoiceSticky,
|
|
2020
3038
|
KdsLinearProgress,
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
KdsLogoHeaderLogo,
|
|
2025
|
-
KdsLogoHeaderSeparator,
|
|
2026
|
-
KdsModal,
|
|
3039
|
+
KdsMerchantTile,
|
|
3040
|
+
KdsMontoRow,
|
|
3041
|
+
KdsPaymentTotal,
|
|
2027
3042
|
KdsQrRow,
|
|
2028
3043
|
KdsRadioGroup,
|
|
2029
3044
|
KdsRecapList,
|
|
3045
|
+
KdsSearchField,
|
|
2030
3046
|
KdsSectionNote,
|
|
2031
3047
|
KdsSecureFooter,
|
|
3048
|
+
KdsSecureLoader,
|
|
2032
3049
|
KdsSegmentedTabs,
|
|
2033
3050
|
KdsSelect,
|
|
2034
3051
|
KdsSnackbar,
|
|
@@ -2042,18 +3059,29 @@ export {
|
|
|
2042
3059
|
KdsThemeProvider,
|
|
2043
3060
|
KdsTooltip,
|
|
2044
3061
|
KdsTypography,
|
|
3062
|
+
LIGHT_LOGO_LUMINANCE_THRESHOLD,
|
|
2045
3063
|
borderRadius,
|
|
2046
3064
|
breakpoints,
|
|
3065
|
+
centerFieldInViewport,
|
|
2047
3066
|
clsx,
|
|
2048
3067
|
colors,
|
|
2049
3068
|
colorsByMode,
|
|
3069
|
+
focusFirstInvalidField,
|
|
2050
3070
|
fontFamilies,
|
|
2051
3071
|
fontSizes,
|
|
2052
3072
|
fontWeights,
|
|
3073
|
+
formatDate,
|
|
3074
|
+
formatDateTime,
|
|
3075
|
+
formatTime,
|
|
2053
3076
|
getContrastColor,
|
|
3077
|
+
guideToFirstInvalidFieldOnBlur,
|
|
2054
3078
|
letterSpacings,
|
|
2055
3079
|
lighten,
|
|
2056
3080
|
lineHeights,
|
|
3081
|
+
measureLogoLuminance,
|
|
3082
|
+
pickLogoBackdrop,
|
|
3083
|
+
runAfterPointerGesture,
|
|
3084
|
+
scrollToFirstInvalidField,
|
|
2057
3085
|
semanticSpacing,
|
|
2058
3086
|
shadows,
|
|
2059
3087
|
spacing,
|
|
@@ -2064,6 +3092,11 @@ export {
|
|
|
2064
3092
|
useAutoHide,
|
|
2065
3093
|
useCopyToClipboard,
|
|
2066
3094
|
useCountdown,
|
|
3095
|
+
useExpandToggle,
|
|
3096
|
+
useHideOnScroll,
|
|
3097
|
+
useLogoBackdrop,
|
|
3098
|
+
useMediaQuery,
|
|
3099
|
+
useStickyInvoiceCollapse,
|
|
2067
3100
|
useTabsKeyboard,
|
|
2068
3101
|
zIndex
|
|
2069
3102
|
};
|