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