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