@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.js
CHANGED
|
@@ -37,6 +37,8 @@ __export(index_exports, {
|
|
|
37
37
|
KdsBankList: () => KdsBankList,
|
|
38
38
|
KdsBankModal: () => KdsBankModal,
|
|
39
39
|
KdsBankRow: () => KdsBankRow,
|
|
40
|
+
KdsBillAttachment: () => KdsBillAttachment,
|
|
41
|
+
KdsBillAttachments: () => KdsBillAttachments,
|
|
40
42
|
KdsBottomSheet: () => KdsBottomSheet,
|
|
41
43
|
KdsButton: () => KdsButton,
|
|
42
44
|
KdsCard: () => KdsCard,
|
|
@@ -47,6 +49,7 @@ __export(index_exports, {
|
|
|
47
49
|
KdsCardSelector: () => KdsCardSelector,
|
|
48
50
|
KdsCheckbox: () => KdsCheckbox,
|
|
49
51
|
KdsChip: () => KdsChip,
|
|
52
|
+
KdsCopyButton: () => KdsCopyButton,
|
|
50
53
|
KdsCopyRow: () => KdsCopyRow,
|
|
51
54
|
KdsCopyableTable: () => KdsCopyableTable,
|
|
52
55
|
KdsCountdown: () => KdsCountdown,
|
|
@@ -54,17 +57,15 @@ __export(index_exports, {
|
|
|
54
57
|
KdsExpandPanel: () => KdsExpandPanel,
|
|
55
58
|
KdsInvoiceSticky: () => KdsInvoiceSticky,
|
|
56
59
|
KdsLinearProgress: () => KdsLinearProgress,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
KdsLogoHeaderLogo: () => KdsLogoHeaderLogo,
|
|
61
|
-
KdsLogoHeaderSeparator: () => KdsLogoHeaderSeparator,
|
|
62
|
-
KdsModal: () => KdsModal,
|
|
60
|
+
KdsMerchantTile: () => KdsMerchantTile,
|
|
61
|
+
KdsMontoRow: () => KdsMontoRow,
|
|
62
|
+
KdsPaymentTotal: () => KdsPaymentTotal,
|
|
63
63
|
KdsQrRow: () => KdsQrRow,
|
|
64
64
|
KdsRadioGroup: () => KdsRadioGroup,
|
|
65
65
|
KdsRecapList: () => KdsRecapList,
|
|
66
66
|
KdsSectionNote: () => KdsSectionNote,
|
|
67
67
|
KdsSecureFooter: () => KdsSecureFooter,
|
|
68
|
+
KdsSecureLoader: () => KdsSecureLoader,
|
|
68
69
|
KdsSegmentedTabs: () => KdsSegmentedTabs,
|
|
69
70
|
KdsSelect: () => KdsSelect,
|
|
70
71
|
KdsSnackbar: () => KdsSnackbar,
|
|
@@ -454,6 +455,8 @@ var semanticColors = {
|
|
|
454
455
|
// From Figma: warning/light
|
|
455
456
|
dark: "#E65100",
|
|
456
457
|
// From Figma: warning/dark
|
|
458
|
+
warm: "#8A6D1A",
|
|
459
|
+
// Warm/olive variant for header icons (LigoPay handoff v2)
|
|
457
460
|
container: "#FFFBEB",
|
|
458
461
|
// Light amber background for chips/badges
|
|
459
462
|
contrastText: "#FFFFFF"
|
|
@@ -472,6 +475,8 @@ var semanticColors = {
|
|
|
472
475
|
main: "#0288D1",
|
|
473
476
|
light: "#03A9F4",
|
|
474
477
|
dark: "#01579B",
|
|
478
|
+
blue: "#5A5FE0",
|
|
479
|
+
// Khipu-blue / LigoPay informational blue (distinct from cyan main)
|
|
475
480
|
container: "#EFF6FF",
|
|
476
481
|
// Light blue background for chips/badges
|
|
477
482
|
contrastText: "#FFFFFF"
|
|
@@ -514,8 +519,10 @@ var fontSizes = {
|
|
|
514
519
|
// 24px
|
|
515
520
|
"3xl": "1.875rem",
|
|
516
521
|
// 30px
|
|
517
|
-
"4xl": "2.25rem"
|
|
522
|
+
"4xl": "2.25rem",
|
|
518
523
|
// 36px
|
|
524
|
+
decimalSup: "0.5em"
|
|
525
|
+
// Relative size for decimal superscript in amount displays
|
|
519
526
|
};
|
|
520
527
|
var lineHeights = {
|
|
521
528
|
tight: 1.2,
|
|
@@ -1147,7 +1154,7 @@ var KdsButton = (0, import_react.forwardRef)(
|
|
|
1147
1154
|
children: [
|
|
1148
1155
|
!loading && startIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "kds-icon", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { className: "material-symbols-outlined", children: startIcon }) }),
|
|
1149
1156
|
loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
1150
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("
|
|
1157
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("progress", { className: "circle indeterminate small" }),
|
|
1151
1158
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children })
|
|
1152
1159
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children }),
|
|
1153
1160
|
!loading && endIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "kds-icon", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { className: "material-symbols-outlined", children: endIcon }) })
|
|
@@ -1169,11 +1176,27 @@ var KdsTextField = (0, import_react2.forwardRef)(
|
|
|
1169
1176
|
readOnly,
|
|
1170
1177
|
startIcon,
|
|
1171
1178
|
endIcon,
|
|
1179
|
+
required,
|
|
1172
1180
|
className,
|
|
1173
1181
|
id,
|
|
1182
|
+
type,
|
|
1183
|
+
revealable,
|
|
1184
|
+
revealLabel = "Mostrar u ocultar contrase\xF1a",
|
|
1185
|
+
requiredMark = true,
|
|
1174
1186
|
...props
|
|
1175
1187
|
}, ref) => {
|
|
1188
|
+
const [revealed, setRevealed] = (0, import_react2.useState)(false);
|
|
1176
1189
|
const fieldId = id || `kds-field-${label.toLowerCase().replace(/\s+/g, "-")}`;
|
|
1190
|
+
const isRevealable = !!revealable && !readOnly && !props.disabled;
|
|
1191
|
+
const inputType = isRevealable ? revealed ? "text" : "password" : type;
|
|
1192
|
+
const hasSuffix = !!endIcon || readOnly || isRevealable;
|
|
1193
|
+
const toggleReveal = () => setRevealed((v) => !v);
|
|
1194
|
+
const onToggleKeyDown = (e) => {
|
|
1195
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1196
|
+
e.preventDefault();
|
|
1197
|
+
toggleReveal();
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1177
1200
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1178
1201
|
"div",
|
|
1179
1202
|
{
|
|
@@ -1181,6 +1204,8 @@ var KdsTextField = (0, import_react2.forwardRef)(
|
|
|
1181
1204
|
"field",
|
|
1182
1205
|
"label",
|
|
1183
1206
|
"border",
|
|
1207
|
+
startIcon && "prefix",
|
|
1208
|
+
hasSuffix && "suffix",
|
|
1184
1209
|
error && "invalid",
|
|
1185
1210
|
readOnly && "locked",
|
|
1186
1211
|
fullWidth && "kds-w-full",
|
|
@@ -1193,14 +1218,32 @@ var KdsTextField = (0, import_react2.forwardRef)(
|
|
|
1193
1218
|
{
|
|
1194
1219
|
ref,
|
|
1195
1220
|
id: fieldId,
|
|
1196
|
-
|
|
1221
|
+
type: inputType,
|
|
1197
1222
|
readOnly,
|
|
1198
|
-
|
|
1223
|
+
required,
|
|
1224
|
+
...props,
|
|
1225
|
+
placeholder: " "
|
|
1199
1226
|
}
|
|
1200
1227
|
),
|
|
1201
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
1228
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { htmlFor: fieldId, children: [
|
|
1229
|
+
label,
|
|
1230
|
+
required && requiredMark && " *"
|
|
1231
|
+
] }),
|
|
1202
1232
|
readOnly && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "material-symbols-outlined", children: "lock" }),
|
|
1203
|
-
|
|
1233
|
+
isRevealable && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1234
|
+
"a",
|
|
1235
|
+
{
|
|
1236
|
+
className: "kds-field-reveal",
|
|
1237
|
+
role: "button",
|
|
1238
|
+
tabIndex: 0,
|
|
1239
|
+
"aria-label": revealLabel,
|
|
1240
|
+
"aria-pressed": revealed,
|
|
1241
|
+
onClick: toggleReveal,
|
|
1242
|
+
onKeyDown: onToggleKeyDown,
|
|
1243
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: revealed ? "visibility" : "visibility_off" })
|
|
1244
|
+
}
|
|
1245
|
+
),
|
|
1246
|
+
endIcon && !readOnly && !isRevealable && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "material-symbols-outlined", children: endIcon }),
|
|
1204
1247
|
helperText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "helper", children: helperText })
|
|
1205
1248
|
]
|
|
1206
1249
|
}
|
|
@@ -1213,78 +1256,18 @@ KdsTextField.displayName = "KdsTextField";
|
|
|
1213
1256
|
var import_react3 = require("react");
|
|
1214
1257
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1215
1258
|
var KdsCheckbox = (0, import_react3.forwardRef)(
|
|
1216
|
-
({ label, className,
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: label })
|
|
1221
|
-
] });
|
|
1222
|
-
}
|
|
1259
|
+
({ label, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: (0, import_clsx.clsx)("checkbox", className), children: [
|
|
1260
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("input", { ref, type: "checkbox", ...props }),
|
|
1261
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: label })
|
|
1262
|
+
] })
|
|
1223
1263
|
);
|
|
1224
1264
|
KdsCheckbox.displayName = "KdsCheckbox";
|
|
1225
1265
|
|
|
1226
|
-
// src/components/core/
|
|
1266
|
+
// src/components/core/KdsCard/KdsCard.tsx
|
|
1227
1267
|
var import_react4 = require("react");
|
|
1228
|
-
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
1229
1268
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1230
|
-
var
|
|
1231
|
-
({
|
|
1232
|
-
open,
|
|
1233
|
-
onClose,
|
|
1234
|
-
title,
|
|
1235
|
-
description,
|
|
1236
|
-
footer,
|
|
1237
|
-
children,
|
|
1238
|
-
size = "md",
|
|
1239
|
-
showCloseButton = true,
|
|
1240
|
-
className
|
|
1241
|
-
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1242
|
-
Dialog.Root,
|
|
1243
|
-
{
|
|
1244
|
-
open,
|
|
1245
|
-
onOpenChange: (o) => {
|
|
1246
|
-
if (!o) onClose();
|
|
1247
|
-
},
|
|
1248
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Dialog.Portal, { children: [
|
|
1249
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Dialog.Overlay, { className: "kds-bottom-sheet-scrim" }),
|
|
1250
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1251
|
-
Dialog.Content,
|
|
1252
|
-
{
|
|
1253
|
-
ref,
|
|
1254
|
-
className: (0, import_clsx.clsx)(
|
|
1255
|
-
"kds-bottom-sheet",
|
|
1256
|
-
`kds-bottom-sheet-${size}`,
|
|
1257
|
-
className
|
|
1258
|
-
),
|
|
1259
|
-
children: [
|
|
1260
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "kds-bottom-sheet-header", children: [
|
|
1261
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Dialog.Title, { className: "kds-bottom-sheet-title", children: title }),
|
|
1262
|
-
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1263
|
-
"button",
|
|
1264
|
-
{
|
|
1265
|
-
className: "kds-bottom-sheet-close",
|
|
1266
|
-
"aria-label": "Cerrar",
|
|
1267
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("i", { className: "material-symbols-outlined", children: "close" })
|
|
1268
|
-
}
|
|
1269
|
-
) })
|
|
1270
|
-
] }),
|
|
1271
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Dialog.Description, { className: "kds-bottom-sheet-description", children: description }),
|
|
1272
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "kds-bottom-sheet-body", children }),
|
|
1273
|
-
footer && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "kds-bottom-sheet-actions", children: footer })
|
|
1274
|
-
]
|
|
1275
|
-
}
|
|
1276
|
-
)
|
|
1277
|
-
] })
|
|
1278
|
-
}
|
|
1279
|
-
)
|
|
1280
|
-
);
|
|
1281
|
-
KdsModal.displayName = "KdsModal";
|
|
1282
|
-
|
|
1283
|
-
// src/components/core/KdsCard/KdsCard.tsx
|
|
1284
|
-
var import_react5 = require("react");
|
|
1285
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1286
|
-
var KdsCard = (0, import_react5.forwardRef)(
|
|
1287
|
-
({ variant = "elevated", dimmed, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1269
|
+
var KdsCard = (0, import_react4.forwardRef)(
|
|
1270
|
+
({ variant = "elevated", dimmed, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1288
1271
|
"article",
|
|
1289
1272
|
{
|
|
1290
1273
|
ref,
|
|
@@ -1299,66 +1282,177 @@ var KdsCard = (0, import_react5.forwardRef)(
|
|
|
1299
1282
|
)
|
|
1300
1283
|
);
|
|
1301
1284
|
KdsCard.displayName = "KdsCard";
|
|
1302
|
-
var KdsCardHeader = (0,
|
|
1303
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1285
|
+
var KdsCardHeader = (0, import_react4.forwardRef)(
|
|
1286
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-card-header", className), ...props, children })
|
|
1304
1287
|
);
|
|
1305
1288
|
KdsCardHeader.displayName = "KdsCardHeader";
|
|
1306
|
-
var KdsCardBody = (0,
|
|
1307
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1289
|
+
var KdsCardBody = (0, import_react4.forwardRef)(
|
|
1290
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-card-body", className), ...props, children })
|
|
1308
1291
|
);
|
|
1309
1292
|
KdsCardBody.displayName = "KdsCardBody";
|
|
1310
|
-
var KdsCardFooter = (0,
|
|
1311
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1293
|
+
var KdsCardFooter = (0, import_react4.forwardRef)(
|
|
1294
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-card-footer", className), ...props, children })
|
|
1312
1295
|
);
|
|
1313
1296
|
KdsCardFooter.displayName = "KdsCardFooter";
|
|
1314
1297
|
|
|
1315
1298
|
// src/components/core/KdsSpinner/KdsSpinner.tsx
|
|
1299
|
+
var import_react5 = require("react");
|
|
1300
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1301
|
+
var SIZE_CLASS = {
|
|
1302
|
+
small: "small",
|
|
1303
|
+
medium: null,
|
|
1304
|
+
large: "large"
|
|
1305
|
+
};
|
|
1306
|
+
var KdsSpinner = (0, import_react5.forwardRef)(
|
|
1307
|
+
({ size = "medium", label, className, ...props }, ref) => {
|
|
1308
|
+
const sizeClass = SIZE_CLASS[size];
|
|
1309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1310
|
+
"div",
|
|
1311
|
+
{
|
|
1312
|
+
ref,
|
|
1313
|
+
className: (0, import_clsx.clsx)("kds-flex kds-flex-col kds-items-center kds-gap-2", className),
|
|
1314
|
+
role: "status",
|
|
1315
|
+
...props,
|
|
1316
|
+
children: [
|
|
1317
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("progress", { className: (0, import_clsx.clsx)("circle indeterminate", sizeClass) }),
|
|
1318
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "kds-text-body-small kds-text-muted", children: label }),
|
|
1319
|
+
!label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "kds-hidden", children: "Cargando" })
|
|
1320
|
+
]
|
|
1321
|
+
}
|
|
1322
|
+
);
|
|
1323
|
+
}
|
|
1324
|
+
);
|
|
1325
|
+
KdsSpinner.displayName = "KdsSpinner";
|
|
1326
|
+
|
|
1327
|
+
// src/components/core/KdsSecureLoader/KdsSecureLoader.tsx
|
|
1316
1328
|
var import_react6 = require("react");
|
|
1317
1329
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1318
|
-
var
|
|
1319
|
-
({
|
|
1320
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.
|
|
1321
|
-
|
|
1322
|
-
|
|
1330
|
+
var KdsSecureLoader = (0, import_react6.forwardRef)(
|
|
1331
|
+
({ title, message, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-secure-loader", className), role: "status", "aria-busy": "true", ...props, children: [
|
|
1332
|
+
(title || message) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "kds-secure-loader-text", children: [
|
|
1333
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "kds-secure-loader-title", children: title }),
|
|
1334
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "kds-secure-loader-message", children: message })
|
|
1335
|
+
] }),
|
|
1336
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "kds-secure-loader-spinner", children: [
|
|
1337
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1338
|
+
"svg",
|
|
1339
|
+
{
|
|
1340
|
+
className: "kds-secure-loader-ring",
|
|
1341
|
+
viewBox: "22 22 44 44",
|
|
1342
|
+
width: "100",
|
|
1343
|
+
height: "100",
|
|
1344
|
+
fill: "none",
|
|
1345
|
+
"aria-hidden": "true",
|
|
1346
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("circle", { cx: "44", cy: "44", r: "20.2", fill: "none" })
|
|
1347
|
+
}
|
|
1348
|
+
),
|
|
1349
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", { className: "material-symbols-outlined kds-secure-loader-lock", "aria-hidden": "true", children: "lock" })
|
|
1350
|
+
] })
|
|
1323
1351
|
] })
|
|
1324
1352
|
);
|
|
1325
|
-
|
|
1353
|
+
KdsSecureLoader.displayName = "KdsSecureLoader";
|
|
1326
1354
|
|
|
1327
|
-
// src/components/core/
|
|
1355
|
+
// src/components/core/KdsCopyButton/KdsCopyButton.tsx
|
|
1356
|
+
var import_react8 = require("react");
|
|
1357
|
+
|
|
1358
|
+
// src/components/core/hooks/useCopyToClipboard.ts
|
|
1328
1359
|
var import_react7 = require("react");
|
|
1360
|
+
function useCopyToClipboard(resetMs = 1200) {
|
|
1361
|
+
const [copied, setCopied] = (0, import_react7.useState)(false);
|
|
1362
|
+
const copy = (0, import_react7.useCallback)(
|
|
1363
|
+
async (text) => {
|
|
1364
|
+
try {
|
|
1365
|
+
await navigator.clipboard.writeText(text);
|
|
1366
|
+
setCopied(true);
|
|
1367
|
+
setTimeout(() => setCopied(false), resetMs);
|
|
1368
|
+
} catch {
|
|
1369
|
+
}
|
|
1370
|
+
},
|
|
1371
|
+
[resetMs]
|
|
1372
|
+
);
|
|
1373
|
+
return { copied, copy };
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
// src/components/core/KdsCopyButton/KdsCopyButton.tsx
|
|
1329
1377
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1330
|
-
var
|
|
1331
|
-
({ value,
|
|
1378
|
+
var KdsCopyButton = (0, import_react8.forwardRef)(
|
|
1379
|
+
({ value, copiedText = "Copiado", className, ...props }, ref) => {
|
|
1380
|
+
const { copied, copy } = useCopyToClipboard();
|
|
1381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1382
|
+
"button",
|
|
1383
|
+
{
|
|
1384
|
+
ref,
|
|
1385
|
+
type: "button",
|
|
1386
|
+
className: (0, import_clsx.clsx)("kds-copy-button", copied && "copied", className),
|
|
1387
|
+
onClick: () => copy(value),
|
|
1388
|
+
"aria-label": `Copiar: ${value}`,
|
|
1389
|
+
...props,
|
|
1390
|
+
children: [
|
|
1391
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "kds-copy-button-label", children: [
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "kds-copy-button-value", "aria-hidden": copied || void 0, children: value }),
|
|
1393
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "kds-copy-button-copied", "aria-hidden": !copied || void 0, children: copiedText })
|
|
1394
|
+
] }),
|
|
1395
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: copied ? "check" : "content_copy" })
|
|
1396
|
+
]
|
|
1397
|
+
}
|
|
1398
|
+
);
|
|
1399
|
+
}
|
|
1400
|
+
);
|
|
1401
|
+
KdsCopyButton.displayName = "KdsCopyButton";
|
|
1402
|
+
|
|
1403
|
+
// src/components/core/KdsLinearProgress/KdsLinearProgress.tsx
|
|
1404
|
+
var import_react9 = require("react");
|
|
1405
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1406
|
+
var KdsLinearProgress = (0, import_react9.forwardRef)(
|
|
1407
|
+
({ value, max = 100, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("progress", { ref, className: (0, import_clsx.clsx)("kds-progress", className), value, max, ...props })
|
|
1332
1408
|
);
|
|
1333
1409
|
KdsLinearProgress.displayName = "KdsLinearProgress";
|
|
1334
1410
|
|
|
1335
1411
|
// src/components/core/KdsAlert/KdsAlert.tsx
|
|
1336
|
-
var
|
|
1337
|
-
var
|
|
1338
|
-
var
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1412
|
+
var import_react10 = require("react");
|
|
1413
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1414
|
+
var DEFAULT_ICONS = {
|
|
1415
|
+
success: "check_circle",
|
|
1416
|
+
info: "info",
|
|
1417
|
+
warning: "warning",
|
|
1418
|
+
error: "error"
|
|
1419
|
+
};
|
|
1420
|
+
var KdsAlert = (0, import_react10.forwardRef)(
|
|
1421
|
+
({ severity, title, icon, inline, onClose, children, className, ...props }, ref) => {
|
|
1422
|
+
const resolvedIcon = icon === false ? null : typeof icon === "string" ? icon : DEFAULT_ICONS[severity];
|
|
1423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1424
|
+
"div",
|
|
1425
|
+
{
|
|
1426
|
+
ref,
|
|
1427
|
+
role: "alert",
|
|
1428
|
+
className: (0, import_clsx.clsx)("kds-alert", `kds-${severity}`, inline && "kds-alert-inline", className),
|
|
1429
|
+
...props,
|
|
1430
|
+
children: [
|
|
1431
|
+
resolvedIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "kds-alert-icon", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { className: "material-symbols-outlined", children: resolvedIcon }) }),
|
|
1432
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "kds-alert-content", children: [
|
|
1433
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "kds-alert-title", children: title }),
|
|
1434
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "kds-alert-description", children })
|
|
1435
|
+
] }),
|
|
1436
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1437
|
+
"button",
|
|
1438
|
+
{
|
|
1439
|
+
type: "button",
|
|
1440
|
+
className: "kds-alert-close",
|
|
1441
|
+
onClick: onClose,
|
|
1442
|
+
"aria-label": "Cerrar",
|
|
1443
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { className: "material-symbols-outlined", children: "close" })
|
|
1444
|
+
}
|
|
1445
|
+
)
|
|
1446
|
+
]
|
|
1447
|
+
}
|
|
1448
|
+
);
|
|
1449
|
+
}
|
|
1356
1450
|
);
|
|
1357
1451
|
KdsAlert.displayName = "KdsAlert";
|
|
1358
1452
|
|
|
1359
1453
|
// src/components/core/KdsTypography/KdsTypography.tsx
|
|
1360
|
-
var
|
|
1361
|
-
var
|
|
1454
|
+
var import_react11 = require("react");
|
|
1455
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1362
1456
|
var variantTag = {
|
|
1363
1457
|
display1: "h1",
|
|
1364
1458
|
display2: "h2",
|
|
@@ -1371,12 +1465,13 @@ var variantTag = {
|
|
|
1371
1465
|
label: "span",
|
|
1372
1466
|
"label-small": "span",
|
|
1373
1467
|
muted: "p",
|
|
1374
|
-
link: "span"
|
|
1468
|
+
link: "span",
|
|
1469
|
+
strong: "span"
|
|
1375
1470
|
};
|
|
1376
|
-
var KdsTypography = (0,
|
|
1471
|
+
var KdsTypography = (0, import_react11.forwardRef)(
|
|
1377
1472
|
({ variant = "body", color, as, children, className, ...props }, ref) => {
|
|
1378
1473
|
const Tag = as || variantTag[variant];
|
|
1379
|
-
return /* @__PURE__ */ (0,
|
|
1474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1380
1475
|
Tag,
|
|
1381
1476
|
{
|
|
1382
1477
|
ref,
|
|
@@ -1394,12 +1489,12 @@ var KdsTypography = (0, import_react9.forwardRef)(
|
|
|
1394
1489
|
KdsTypography.displayName = "KdsTypography";
|
|
1395
1490
|
|
|
1396
1491
|
// src/components/core/KdsTabs/KdsTabs.tsx
|
|
1397
|
-
var
|
|
1492
|
+
var import_react13 = __toESM(require("react"));
|
|
1398
1493
|
|
|
1399
1494
|
// src/components/core/hooks/useTabsKeyboard.ts
|
|
1400
|
-
var
|
|
1495
|
+
var import_react12 = require("react");
|
|
1401
1496
|
function useTabsKeyboard(tabCount, activeIndex, onChange) {
|
|
1402
|
-
const onKeyDown = (0,
|
|
1497
|
+
const onKeyDown = (0, import_react12.useCallback)(
|
|
1403
1498
|
(e) => {
|
|
1404
1499
|
let next = activeIndex;
|
|
1405
1500
|
if (e.key === "ArrowRight") next = (activeIndex + 1) % tabCount;
|
|
@@ -1419,31 +1514,31 @@ function useTabsKeyboard(tabCount, activeIndex, onChange) {
|
|
|
1419
1514
|
}
|
|
1420
1515
|
|
|
1421
1516
|
// src/components/core/KdsTabs/KdsTabs.tsx
|
|
1422
|
-
var
|
|
1423
|
-
var KdsTabs = (0,
|
|
1424
|
-
({ activeIndex, onChange,
|
|
1425
|
-
const tabCount =
|
|
1517
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1518
|
+
var KdsTabs = (0, import_react13.forwardRef)(
|
|
1519
|
+
({ activeIndex, onChange, children, className, style, ...props }, ref) => {
|
|
1520
|
+
const tabCount = import_react13.Children.count(children);
|
|
1426
1521
|
const { onKeyDown } = useTabsKeyboard(tabCount, activeIndex, onChange);
|
|
1427
|
-
const mergedStyle = (0,
|
|
1428
|
-
|
|
1429
|
-
return {
|
|
1522
|
+
const mergedStyle = (0, import_react13.useMemo)(
|
|
1523
|
+
() => ({
|
|
1430
1524
|
...style,
|
|
1431
1525
|
"--_tab-count": tabCount,
|
|
1432
1526
|
"--_active-idx": activeIndex
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
|
|
1527
|
+
}),
|
|
1528
|
+
[tabCount, activeIndex, style]
|
|
1529
|
+
);
|
|
1530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1436
1531
|
"div",
|
|
1437
1532
|
{
|
|
1438
1533
|
ref,
|
|
1439
1534
|
role: "tablist",
|
|
1440
|
-
className: (0, import_clsx.clsx)(
|
|
1535
|
+
className: (0, import_clsx.clsx)("kds-segmented-tabs", className),
|
|
1441
1536
|
style: mergedStyle,
|
|
1442
1537
|
onKeyDown,
|
|
1443
1538
|
...props,
|
|
1444
|
-
children:
|
|
1445
|
-
if (!
|
|
1446
|
-
return
|
|
1539
|
+
children: import_react13.Children.map(children, (child, i) => {
|
|
1540
|
+
if (!import_react13.default.isValidElement(child)) return child;
|
|
1541
|
+
return import_react13.default.cloneElement(child, {
|
|
1447
1542
|
_active: i === activeIndex,
|
|
1448
1543
|
_onClick: () => onChange(i)
|
|
1449
1544
|
});
|
|
@@ -1453,11 +1548,12 @@ var KdsTabs = (0, import_react11.forwardRef)(
|
|
|
1453
1548
|
}
|
|
1454
1549
|
);
|
|
1455
1550
|
KdsTabs.displayName = "KdsTabs";
|
|
1456
|
-
var KdsTab = (0,
|
|
1457
|
-
({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1551
|
+
var KdsTab = (0, import_react13.forwardRef)(
|
|
1552
|
+
({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1458
1553
|
"button",
|
|
1459
1554
|
{
|
|
1460
1555
|
ref,
|
|
1556
|
+
type: "button",
|
|
1461
1557
|
role: "tab",
|
|
1462
1558
|
"aria-selected": _active,
|
|
1463
1559
|
tabIndex: _active ? 0 : -1,
|
|
@@ -1469,8 +1565,8 @@ var KdsTab = (0, import_react11.forwardRef)(
|
|
|
1469
1565
|
)
|
|
1470
1566
|
);
|
|
1471
1567
|
KdsTab.displayName = "KdsTab";
|
|
1472
|
-
var KdsTabPanel = (0,
|
|
1473
|
-
({ active, children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1568
|
+
var KdsTabPanel = (0, import_react13.forwardRef)(
|
|
1569
|
+
({ active, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1474
1570
|
"div",
|
|
1475
1571
|
{
|
|
1476
1572
|
ref,
|
|
@@ -1484,102 +1580,13 @@ var KdsTabPanel = (0, import_react11.forwardRef)(
|
|
|
1484
1580
|
);
|
|
1485
1581
|
KdsTabPanel.displayName = "KdsTabPanel";
|
|
1486
1582
|
|
|
1487
|
-
// src/components/core/KdsLogoHeader/KdsLogoHeader.tsx
|
|
1488
|
-
var import_react12 = require("react");
|
|
1489
|
-
|
|
1490
|
-
// src/assets/images/khipu-logo-color.svg
|
|
1491
|
-
var khipu_logo_color_default = "./khipu-logo-color-TV75AKOV.svg";
|
|
1492
|
-
|
|
1493
|
-
// src/components/core/KdsLogoHeader/KdsLogoHeader.tsx
|
|
1494
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1495
|
-
var KhipuLogo = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1496
|
-
"img",
|
|
1497
|
-
{
|
|
1498
|
-
src: khipu_logo_color_default,
|
|
1499
|
-
alt: "Khipu",
|
|
1500
|
-
className: "kds-logo-header-logo-img"
|
|
1501
|
-
}
|
|
1502
|
-
);
|
|
1503
|
-
var KdsLogoHeaderLogo = (0, import_react12.forwardRef)(
|
|
1504
|
-
({ children, className, ...props }, ref) => {
|
|
1505
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1506
|
-
"div",
|
|
1507
|
-
{
|
|
1508
|
-
ref,
|
|
1509
|
-
className: (0, import_clsx.clsx)("kds-logo-header-logo", className),
|
|
1510
|
-
...props,
|
|
1511
|
-
children: children || /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(KhipuLogo, {})
|
|
1512
|
-
}
|
|
1513
|
-
);
|
|
1514
|
-
}
|
|
1515
|
-
);
|
|
1516
|
-
KdsLogoHeaderLogo.displayName = "KdsLogoHeaderLogo";
|
|
1517
|
-
var KdsLogoHeaderSeparator = (0, import_react12.forwardRef)(
|
|
1518
|
-
({ children = "|", className, ...props }, ref) => {
|
|
1519
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1520
|
-
"span",
|
|
1521
|
-
{
|
|
1522
|
-
ref,
|
|
1523
|
-
className: (0, import_clsx.clsx)("kds-logo-header-separator", className),
|
|
1524
|
-
...props,
|
|
1525
|
-
children
|
|
1526
|
-
}
|
|
1527
|
-
);
|
|
1528
|
-
}
|
|
1529
|
-
);
|
|
1530
|
-
KdsLogoHeaderSeparator.displayName = "KdsLogoHeaderSeparator";
|
|
1531
|
-
var KdsLogoHeaderCode = (0, import_react12.forwardRef)(
|
|
1532
|
-
({ children, className, ...props }, ref) => {
|
|
1533
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1534
|
-
"span",
|
|
1535
|
-
{
|
|
1536
|
-
ref,
|
|
1537
|
-
className: (0, import_clsx.clsx)("kds-logo-header-code", className),
|
|
1538
|
-
...props,
|
|
1539
|
-
children
|
|
1540
|
-
}
|
|
1541
|
-
);
|
|
1542
|
-
}
|
|
1543
|
-
);
|
|
1544
|
-
KdsLogoHeaderCode.displayName = "KdsLogoHeaderCode";
|
|
1545
|
-
var KdsLogoHeaderCloseButton = (0, import_react12.forwardRef)(
|
|
1546
|
-
({ onClose, className, ...props }, ref) => {
|
|
1547
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "kds-logo-header-close-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1548
|
-
"button",
|
|
1549
|
-
{
|
|
1550
|
-
ref,
|
|
1551
|
-
onClick: onClose,
|
|
1552
|
-
className: (0, import_clsx.clsx)("kds-btn kds-btn-icon", className),
|
|
1553
|
-
"aria-label": "close",
|
|
1554
|
-
...props,
|
|
1555
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { className: "material-symbols-outlined", children: "close" })
|
|
1556
|
-
}
|
|
1557
|
-
) });
|
|
1558
|
-
}
|
|
1559
|
-
);
|
|
1560
|
-
KdsLogoHeaderCloseButton.displayName = "KdsLogoHeaderCloseButton";
|
|
1561
|
-
var KdsLogoHeader = (0, import_react12.forwardRef)(
|
|
1562
|
-
({ children, className, ...props }, ref) => {
|
|
1563
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1564
|
-
"div",
|
|
1565
|
-
{
|
|
1566
|
-
ref,
|
|
1567
|
-
className: (0, import_clsx.clsx)("kds-brand-row", className),
|
|
1568
|
-
...props,
|
|
1569
|
-
children
|
|
1570
|
-
}
|
|
1571
|
-
);
|
|
1572
|
-
}
|
|
1573
|
-
);
|
|
1574
|
-
KdsLogoHeader.displayName = "KdsLogoHeader";
|
|
1575
|
-
|
|
1576
1583
|
// src/components/core/KdsRadioGroup/KdsRadioGroup.tsx
|
|
1577
|
-
var
|
|
1584
|
+
var import_react14 = require("react");
|
|
1578
1585
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1579
|
-
var KdsRadioGroup = (0,
|
|
1580
|
-
({ label, name, options, value, onChange, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("fieldset", { ref, className: (0, import_clsx.clsx)("kds-radio-group", className), ...props, children: [
|
|
1586
|
+
var KdsRadioGroup = (0, import_react14.forwardRef)(
|
|
1587
|
+
({ label, name, options, value, onChange, size, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("fieldset", { ref, className: (0, import_clsx.clsx)("kds-radio-group", className), ...props, children: [
|
|
1581
1588
|
label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("legend", { children: label }),
|
|
1582
|
-
options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "
|
|
1589
|
+
options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: (0, import_clsx.clsx)("radio", size), children: [
|
|
1583
1590
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1584
1591
|
"input",
|
|
1585
1592
|
{
|
|
@@ -1598,79 +1605,98 @@ var KdsRadioGroup = (0, import_react13.forwardRef)(
|
|
|
1598
1605
|
KdsRadioGroup.displayName = "KdsRadioGroup";
|
|
1599
1606
|
|
|
1600
1607
|
// src/components/core/KdsSelect/KdsSelect.tsx
|
|
1601
|
-
var
|
|
1602
|
-
var Select = __toESM(require("@radix-ui/react-select"));
|
|
1608
|
+
var import_react15 = require("react");
|
|
1603
1609
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1604
|
-
var
|
|
1610
|
+
var KdsSelect = (0, import_react15.forwardRef)(
|
|
1605
1611
|
({
|
|
1606
|
-
value,
|
|
1607
|
-
onValueChange,
|
|
1608
|
-
placeholder,
|
|
1609
1612
|
label,
|
|
1610
|
-
|
|
1613
|
+
options,
|
|
1614
|
+
placeholder,
|
|
1611
1615
|
helperText,
|
|
1612
|
-
|
|
1616
|
+
error,
|
|
1617
|
+
prefixIcon,
|
|
1613
1618
|
fullWidth = true,
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
className
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1619
|
+
disabled,
|
|
1620
|
+
required,
|
|
1621
|
+
className,
|
|
1622
|
+
id,
|
|
1623
|
+
...props
|
|
1624
|
+
}, ref) => {
|
|
1625
|
+
const fieldId = id || `kds-select-${label.toLowerCase().replace(/\s+/g, "-")}`;
|
|
1626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1627
|
+
"div",
|
|
1628
|
+
{
|
|
1629
|
+
className: (0, import_clsx.clsx)(
|
|
1630
|
+
"field",
|
|
1631
|
+
"label",
|
|
1632
|
+
"border",
|
|
1633
|
+
prefixIcon && "prefix",
|
|
1634
|
+
error && "invalid",
|
|
1635
|
+
fullWidth && "kds-w-full",
|
|
1636
|
+
className
|
|
1637
|
+
),
|
|
1638
|
+
children: [
|
|
1639
|
+
prefixIcon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { className: "material-symbols-outlined", children: prefixIcon }),
|
|
1640
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1641
|
+
"select",
|
|
1642
|
+
{
|
|
1643
|
+
ref,
|
|
1644
|
+
id: fieldId,
|
|
1645
|
+
disabled,
|
|
1646
|
+
required,
|
|
1647
|
+
...props,
|
|
1648
|
+
children: [
|
|
1649
|
+
placeholder !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", children: placeholder }),
|
|
1650
|
+
options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value))
|
|
1651
|
+
]
|
|
1652
|
+
}
|
|
1653
|
+
),
|
|
1654
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { htmlFor: fieldId, children: [
|
|
1655
|
+
label,
|
|
1656
|
+
required && " *"
|
|
1632
1657
|
] }),
|
|
1633
|
-
|
|
1634
|
-
]
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
)
|
|
1639
|
-
);
|
|
1640
|
-
KdsSelectRoot.displayName = "KdsSelect";
|
|
1641
|
-
var KdsSelectItem = (0, import_react14.forwardRef)(
|
|
1642
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Select.Item, { ref, className: (0, import_clsx.clsx)("kds-select-item", className), ...props, children: [
|
|
1643
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Select.ItemText, { children }),
|
|
1644
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Select.ItemIndicator, { className: "kds-select-item-indicator", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { className: "material-symbols-outlined", children: "check" }) })
|
|
1645
|
-
] })
|
|
1658
|
+
helperText && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "helper", children: helperText })
|
|
1659
|
+
]
|
|
1660
|
+
}
|
|
1661
|
+
);
|
|
1662
|
+
}
|
|
1646
1663
|
);
|
|
1647
|
-
|
|
1648
|
-
var KdsSelect = Object.assign(KdsSelectRoot, {
|
|
1649
|
-
Item: KdsSelectItem
|
|
1650
|
-
});
|
|
1664
|
+
KdsSelect.displayName = "KdsSelect";
|
|
1651
1665
|
|
|
1652
1666
|
// src/components/core/KdsChip/KdsChip.tsx
|
|
1653
|
-
var
|
|
1667
|
+
var import_react16 = require("react");
|
|
1654
1668
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1655
|
-
var KdsChip = (0,
|
|
1669
|
+
var KdsChip = (0, import_react16.forwardRef)(
|
|
1656
1670
|
({ color, icon, onDelete, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { ref, className: (0, import_clsx.clsx)("kds-badge", color, className), ...props, children: [
|
|
1657
1671
|
icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { className: "material-symbols-outlined", children: icon }),
|
|
1658
|
-
children,
|
|
1659
|
-
onDelete && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1672
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children }),
|
|
1673
|
+
onDelete && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1674
|
+
"button",
|
|
1675
|
+
{
|
|
1676
|
+
type: "button",
|
|
1677
|
+
className: "kds-badge-close",
|
|
1678
|
+
onClick: (e) => {
|
|
1679
|
+
e.stopPropagation();
|
|
1680
|
+
onDelete();
|
|
1681
|
+
},
|
|
1682
|
+
"aria-label": "Eliminar",
|
|
1683
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { className: "material-symbols-outlined", children: "close" })
|
|
1684
|
+
}
|
|
1685
|
+
)
|
|
1660
1686
|
] })
|
|
1661
1687
|
);
|
|
1662
1688
|
KdsChip.displayName = "KdsChip";
|
|
1663
1689
|
|
|
1664
1690
|
// src/components/core/KdsSnackbar/KdsSnackbar.tsx
|
|
1665
|
-
var
|
|
1691
|
+
var import_react18 = require("react");
|
|
1666
1692
|
|
|
1667
1693
|
// src/components/core/hooks/useAutoHide.ts
|
|
1668
|
-
var
|
|
1694
|
+
var import_react17 = require("react");
|
|
1669
1695
|
function useAutoHide(durationMs, onHide) {
|
|
1670
|
-
const [visible, setVisible] = (0,
|
|
1671
|
-
const onHideRef = (0,
|
|
1696
|
+
const [visible, setVisible] = (0, import_react17.useState)(true);
|
|
1697
|
+
const onHideRef = (0, import_react17.useRef)(onHide);
|
|
1672
1698
|
onHideRef.current = onHide;
|
|
1673
|
-
(0,
|
|
1699
|
+
(0, import_react17.useEffect)(() => {
|
|
1674
1700
|
if (durationMs <= 0) return;
|
|
1675
1701
|
const timer = setTimeout(() => {
|
|
1676
1702
|
setVisible(false);
|
|
@@ -1683,14 +1709,53 @@ function useAutoHide(durationMs, onHide) {
|
|
|
1683
1709
|
|
|
1684
1710
|
// src/components/core/KdsSnackbar/KdsSnackbar.tsx
|
|
1685
1711
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1686
|
-
var
|
|
1687
|
-
|
|
1688
|
-
|
|
1712
|
+
var DEFAULT_ICONS2 = {
|
|
1713
|
+
info: "info",
|
|
1714
|
+
success: "check_circle",
|
|
1715
|
+
error: "error"
|
|
1716
|
+
};
|
|
1717
|
+
var KdsSnackbar = (0, import_react18.forwardRef)(
|
|
1718
|
+
({
|
|
1719
|
+
message,
|
|
1720
|
+
type = "info",
|
|
1721
|
+
duration = 5e3,
|
|
1722
|
+
onClose,
|
|
1723
|
+
open = true,
|
|
1724
|
+
icon,
|
|
1725
|
+
className,
|
|
1726
|
+
style,
|
|
1727
|
+
...props
|
|
1728
|
+
}, ref) => {
|
|
1729
|
+
const autoDismiss = duration > 0;
|
|
1730
|
+
const { visible } = useAutoHide(autoDismiss ? duration : 0, onClose);
|
|
1689
1731
|
if (!open || !visible) return null;
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1732
|
+
const resolvedIcon = icon === false ? null : icon ?? DEFAULT_ICONS2[type];
|
|
1733
|
+
const mergedStyle = autoDismiss ? { ...style, ["--kds-snackbar-duration"]: `${duration}ms` } : style ?? {};
|
|
1734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1735
|
+
"div",
|
|
1736
|
+
{
|
|
1737
|
+
ref,
|
|
1738
|
+
role: "status",
|
|
1739
|
+
className: (0, import_clsx.clsx)("snackbar", "active", type, className),
|
|
1740
|
+
"data-auto-dismiss": autoDismiss ? "true" : void 0,
|
|
1741
|
+
style: mergedStyle,
|
|
1742
|
+
...props,
|
|
1743
|
+
children: [
|
|
1744
|
+
resolvedIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", { className: "material-symbols-outlined", children: resolvedIcon }),
|
|
1745
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "max", children: message }),
|
|
1746
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1747
|
+
"button",
|
|
1748
|
+
{
|
|
1749
|
+
type: "button",
|
|
1750
|
+
className: "kds-snackbar-close",
|
|
1751
|
+
onClick: onClose,
|
|
1752
|
+
"aria-label": "Cerrar",
|
|
1753
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", { className: "material-symbols-outlined", children: "close" })
|
|
1754
|
+
}
|
|
1755
|
+
)
|
|
1756
|
+
]
|
|
1757
|
+
}
|
|
1758
|
+
);
|
|
1694
1759
|
}
|
|
1695
1760
|
);
|
|
1696
1761
|
KdsSnackbar.displayName = "KdsSnackbar";
|
|
@@ -1710,44 +1775,53 @@ function KdsTooltip({
|
|
|
1710
1775
|
}) {
|
|
1711
1776
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip.Provider, { delayDuration, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Tooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
1712
1777
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip.Trigger, { asChild: true, children }),
|
|
1713
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1778
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1779
|
+
Tooltip.Content,
|
|
1780
|
+
{
|
|
1781
|
+
className: (0, import_clsx.clsx)("kds-tooltip", className),
|
|
1782
|
+
side: placement,
|
|
1783
|
+
sideOffset: 6,
|
|
1784
|
+
collisionPadding: 8,
|
|
1785
|
+
children: [
|
|
1786
|
+
content,
|
|
1787
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip.Arrow, { className: "kds-tooltip-arrow", width: 10, height: 5 })
|
|
1788
|
+
]
|
|
1789
|
+
}
|
|
1790
|
+
) })
|
|
1717
1791
|
] }) });
|
|
1718
1792
|
}
|
|
1719
1793
|
|
|
1720
1794
|
// src/components/core/KdsAccordion/KdsAccordion.tsx
|
|
1721
|
-
var
|
|
1795
|
+
var import_react19 = require("react");
|
|
1722
1796
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1723
|
-
var KdsAccordion = (0,
|
|
1797
|
+
var KdsAccordion = (0, import_react19.forwardRef)(
|
|
1724
1798
|
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("details", { ref, className: (0, import_clsx.clsx)("kds-accordion", className), ...props, children })
|
|
1725
1799
|
);
|
|
1726
1800
|
KdsAccordion.displayName = "KdsAccordion";
|
|
1727
|
-
var KdsAccordionSummary = (0,
|
|
1801
|
+
var KdsAccordionSummary = (0, import_react19.forwardRef)(
|
|
1728
1802
|
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("summary", { ref, className: (0, import_clsx.clsx)("kds-accordion-summary", className), ...props, children: [
|
|
1729
1803
|
children,
|
|
1730
1804
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", { className: "material-symbols-outlined", children: "expand_more" })
|
|
1731
1805
|
] })
|
|
1732
1806
|
);
|
|
1733
1807
|
KdsAccordionSummary.displayName = "KdsAccordionSummary";
|
|
1734
|
-
var KdsAccordionDetails = (0,
|
|
1808
|
+
var KdsAccordionDetails = (0, import_react19.forwardRef)(
|
|
1735
1809
|
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-accordion-details", className), ...props, children })
|
|
1736
1810
|
);
|
|
1737
1811
|
KdsAccordionDetails.displayName = "KdsAccordionDetails";
|
|
1738
1812
|
|
|
1739
1813
|
// src/components/core/KdsDivider/KdsDivider.tsx
|
|
1740
|
-
var
|
|
1814
|
+
var import_react20 = require("react");
|
|
1741
1815
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1742
|
-
var KdsDivider = (0,
|
|
1816
|
+
var KdsDivider = (0, import_react20.forwardRef)(
|
|
1743
1817
|
({ dashed, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("hr", { ref, className: (0, import_clsx.clsx)(dashed ? "kds-hr-dashed" : "kds-hr", className), ...props })
|
|
1744
1818
|
);
|
|
1745
1819
|
KdsDivider.displayName = "KdsDivider";
|
|
1746
1820
|
|
|
1747
1821
|
// src/components/core/KdsSectionNote/KdsSectionNote.tsx
|
|
1748
|
-
var
|
|
1822
|
+
var import_react21 = require("react");
|
|
1749
1823
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1750
|
-
var KdsSectionNote = (0,
|
|
1824
|
+
var KdsSectionNote = (0, import_react21.forwardRef)(
|
|
1751
1825
|
({ icon = "info", children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { ref, className: (0, import_clsx.clsx)("kds-section-note", className), ...props, children: [
|
|
1752
1826
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", { className: "material-symbols-outlined", children: icon }),
|
|
1753
1827
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children })
|
|
@@ -1756,9 +1830,9 @@ var KdsSectionNote = (0, import_react20.forwardRef)(
|
|
|
1756
1830
|
KdsSectionNote.displayName = "KdsSectionNote";
|
|
1757
1831
|
|
|
1758
1832
|
// src/components/core/KdsStatusBlock/KdsStatusBlock.tsx
|
|
1759
|
-
var
|
|
1833
|
+
var import_react22 = require("react");
|
|
1760
1834
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1761
|
-
var KdsStatusBlock = (0,
|
|
1835
|
+
var KdsStatusBlock = (0, import_react22.forwardRef)(
|
|
1762
1836
|
({ status, icon, title, description, inline, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-status-block", inline && "inline", className), "data-status": status, ...props, children: [
|
|
1763
1837
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "kds-status-block-icon", children: icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
|
|
1764
1838
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
@@ -1770,47 +1844,53 @@ var KdsStatusBlock = (0, import_react21.forwardRef)(
|
|
|
1770
1844
|
KdsStatusBlock.displayName = "KdsStatusBlock";
|
|
1771
1845
|
|
|
1772
1846
|
// src/components/core/KdsStepper/KdsStepper.tsx
|
|
1773
|
-
var
|
|
1847
|
+
var import_react23 = require("react");
|
|
1774
1848
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1775
|
-
var KdsStepper = (0,
|
|
1776
|
-
({ steps, current, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-stepper", className),
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1849
|
+
var KdsStepper = (0, import_react23.forwardRef)(
|
|
1850
|
+
({ steps, current, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-stepper", className), ...props, children: steps.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1851
|
+
"div",
|
|
1852
|
+
{
|
|
1853
|
+
className: (0, import_clsx.clsx)("kds-step", i < current && "completed", i === current && "current"),
|
|
1854
|
+
children: [
|
|
1855
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "kds-step-indicator" }),
|
|
1856
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "kds-step-label", children: label })
|
|
1857
|
+
]
|
|
1858
|
+
},
|
|
1859
|
+
`${i}-${label}`
|
|
1860
|
+
)) })
|
|
1780
1861
|
);
|
|
1781
1862
|
KdsStepper.displayName = "KdsStepper";
|
|
1782
1863
|
|
|
1783
1864
|
// src/components/core/KdsCopyRow/KdsCopyRow.tsx
|
|
1784
1865
|
var import_react24 = require("react");
|
|
1785
|
-
|
|
1786
|
-
// src/components/core/hooks/useCopyToClipboard.ts
|
|
1787
|
-
var import_react23 = require("react");
|
|
1788
|
-
function useCopyToClipboard(resetMs = 1200) {
|
|
1789
|
-
const [copied, setCopied] = (0, import_react23.useState)(false);
|
|
1790
|
-
const copy = (0, import_react23.useCallback)(
|
|
1791
|
-
async (text) => {
|
|
1792
|
-
try {
|
|
1793
|
-
await navigator.clipboard.writeText(text);
|
|
1794
|
-
setCopied(true);
|
|
1795
|
-
setTimeout(() => setCopied(false), resetMs);
|
|
1796
|
-
} catch {
|
|
1797
|
-
}
|
|
1798
|
-
},
|
|
1799
|
-
[resetMs]
|
|
1800
|
-
);
|
|
1801
|
-
return { copied, copy };
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
// src/components/core/KdsCopyRow/KdsCopyRow.tsx
|
|
1805
1866
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1806
1867
|
var KdsCopyRow = (0, import_react24.forwardRef)(
|
|
1807
|
-
({ label, value, className, ...props }, ref) => {
|
|
1868
|
+
({ label, value, copiedText = "Copiado", className, ...props }, ref) => {
|
|
1808
1869
|
const { copied, copy } = useCopyToClipboard();
|
|
1809
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1871
|
+
"button",
|
|
1872
|
+
{
|
|
1873
|
+
ref,
|
|
1874
|
+
type: "button",
|
|
1875
|
+
className: (0, import_clsx.clsx)("kds-copy-row", copied && "copied", className),
|
|
1876
|
+
"data-copy": value,
|
|
1877
|
+
onClick: () => copy(value),
|
|
1878
|
+
"aria-label": `Copiar ${label}: ${value}`,
|
|
1879
|
+
...props,
|
|
1880
|
+
children: [
|
|
1881
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: "content_copy" }),
|
|
1882
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
1883
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "kds-copy-row-label", children: label }),
|
|
1884
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "kds-copy-row-value", children: value })
|
|
1885
|
+
] }),
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "kds-copy-toast", "aria-hidden": "true", children: [
|
|
1887
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("i", { className: "material-symbols-outlined", children: "check_circle" }),
|
|
1888
|
+
" ",
|
|
1889
|
+
copiedText
|
|
1890
|
+
] })
|
|
1891
|
+
]
|
|
1892
|
+
}
|
|
1893
|
+
);
|
|
1814
1894
|
}
|
|
1815
1895
|
);
|
|
1816
1896
|
KdsCopyRow.displayName = "KdsCopyRow";
|
|
@@ -1818,23 +1898,218 @@ KdsCopyRow.displayName = "KdsCopyRow";
|
|
|
1818
1898
|
// src/components/core/KdsCopyableTable/KdsCopyableTable.tsx
|
|
1819
1899
|
var import_react25 = require("react");
|
|
1820
1900
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1901
|
+
async function copyToClipboard(text) {
|
|
1902
|
+
try {
|
|
1903
|
+
if (navigator.clipboard?.writeText) {
|
|
1904
|
+
await navigator.clipboard.writeText(text);
|
|
1905
|
+
return true;
|
|
1906
|
+
}
|
|
1907
|
+
} catch {
|
|
1908
|
+
}
|
|
1909
|
+
const ta = document.createElement("textarea");
|
|
1910
|
+
ta.value = text;
|
|
1911
|
+
ta.style.position = "fixed";
|
|
1912
|
+
ta.style.opacity = "0";
|
|
1913
|
+
document.body.appendChild(ta);
|
|
1914
|
+
ta.select();
|
|
1915
|
+
try {
|
|
1916
|
+
document.execCommand("copy");
|
|
1917
|
+
return true;
|
|
1918
|
+
} catch {
|
|
1919
|
+
return false;
|
|
1920
|
+
} finally {
|
|
1921
|
+
document.body.removeChild(ta);
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
var TRANSITION_MS = 300;
|
|
1925
|
+
function GridVariant({
|
|
1926
|
+
gridRows,
|
|
1927
|
+
disabled,
|
|
1928
|
+
className,
|
|
1929
|
+
forwardedRef,
|
|
1930
|
+
rest
|
|
1931
|
+
}) {
|
|
1932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1933
|
+
"div",
|
|
1934
|
+
{
|
|
1935
|
+
ref: forwardedRef,
|
|
1936
|
+
className: (0, import_clsx.clsx)("kds-copyable-table", "kds-copyable-table--grid", className),
|
|
1937
|
+
...rest,
|
|
1938
|
+
children: gridRows.map((cells, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1939
|
+
"div",
|
|
1940
|
+
{
|
|
1941
|
+
className: "kds-copyable-table-row kds-copyable-table-row--grid",
|
|
1942
|
+
"data-testid": "kds-grid-row",
|
|
1943
|
+
children: cells.map((text, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1944
|
+
"span",
|
|
1945
|
+
{
|
|
1946
|
+
className: (0, import_clsx.clsx)("kds-grid-cell", disabled && "kds-grid-cell--disabled"),
|
|
1947
|
+
children: text
|
|
1948
|
+
},
|
|
1949
|
+
cellIndex
|
|
1950
|
+
))
|
|
1951
|
+
},
|
|
1952
|
+
rowIndex
|
|
1953
|
+
))
|
|
1954
|
+
}
|
|
1955
|
+
);
|
|
1956
|
+
}
|
|
1957
|
+
function CopyableVariant({
|
|
1958
|
+
rows,
|
|
1959
|
+
copyAllLabel = "Copiar todos los datos",
|
|
1960
|
+
copiedAllLabel = "Datos copiados",
|
|
1961
|
+
showCopyAll = true,
|
|
1962
|
+
className,
|
|
1963
|
+
forwardedRef,
|
|
1964
|
+
rest
|
|
1965
|
+
}) {
|
|
1966
|
+
const copiedTimers = (0, import_react25.useRef)(/* @__PURE__ */ new Map());
|
|
1967
|
+
const settlingTimers = (0, import_react25.useRef)(/* @__PURE__ */ new Map());
|
|
1968
|
+
const [copiedRows, setCopiedRows] = (0, import_react25.useState)(/* @__PURE__ */ new Set());
|
|
1969
|
+
const [settlingRows, setSettlingRows] = (0, import_react25.useState)(/* @__PURE__ */ new Set());
|
|
1970
|
+
const [allCopied, setAllCopied] = (0, import_react25.useState)(false);
|
|
1971
|
+
const markCopied = (0, import_react25.useCallback)((indexes, duration = 1500) => {
|
|
1972
|
+
setCopiedRows((prev) => {
|
|
1973
|
+
const next = new Set(prev);
|
|
1974
|
+
indexes.forEach((i) => next.add(i));
|
|
1975
|
+
return next;
|
|
1976
|
+
});
|
|
1977
|
+
indexes.forEach((i) => {
|
|
1978
|
+
const st = settlingTimers.current.get(i);
|
|
1979
|
+
if (st) {
|
|
1980
|
+
clearTimeout(st);
|
|
1981
|
+
settlingTimers.current.delete(i);
|
|
1982
|
+
}
|
|
1983
|
+
});
|
|
1984
|
+
setSettlingRows((prev) => {
|
|
1985
|
+
const next = new Set(prev);
|
|
1986
|
+
indexes.forEach((i) => next.delete(i));
|
|
1987
|
+
return next;
|
|
1988
|
+
});
|
|
1989
|
+
indexes.forEach((i) => {
|
|
1990
|
+
const existing = copiedTimers.current.get(i);
|
|
1991
|
+
if (existing) clearTimeout(existing);
|
|
1992
|
+
const t = setTimeout(() => {
|
|
1993
|
+
setCopiedRows((prev) => {
|
|
1994
|
+
const next = new Set(prev);
|
|
1995
|
+
next.delete(i);
|
|
1996
|
+
return next;
|
|
1997
|
+
});
|
|
1998
|
+
setSettlingRows((prev) => {
|
|
1999
|
+
const next = new Set(prev);
|
|
2000
|
+
next.add(i);
|
|
2001
|
+
return next;
|
|
2002
|
+
});
|
|
2003
|
+
copiedTimers.current.delete(i);
|
|
2004
|
+
const settlingT = setTimeout(() => {
|
|
2005
|
+
setSettlingRows((prev) => {
|
|
2006
|
+
const next = new Set(prev);
|
|
2007
|
+
next.delete(i);
|
|
2008
|
+
return next;
|
|
2009
|
+
});
|
|
2010
|
+
settlingTimers.current.delete(i);
|
|
2011
|
+
}, TRANSITION_MS);
|
|
2012
|
+
settlingTimers.current.set(i, settlingT);
|
|
2013
|
+
}, duration);
|
|
2014
|
+
copiedTimers.current.set(i, t);
|
|
2015
|
+
});
|
|
2016
|
+
}, []);
|
|
2017
|
+
const handleRowCopy = async (row, index) => {
|
|
2018
|
+
const ok = await copyToClipboard(row.copy ?? row.value);
|
|
2019
|
+
if (ok) markCopied([index]);
|
|
2020
|
+
};
|
|
2021
|
+
const handleCopyAll = async () => {
|
|
2022
|
+
const text = rows.map((r) => `${r.label}: ${r.value}`).join("\n");
|
|
2023
|
+
const ok = await copyToClipboard(text);
|
|
2024
|
+
if (ok) {
|
|
2025
|
+
markCopied(rows.map((_, i) => i));
|
|
2026
|
+
setAllCopied(true);
|
|
2027
|
+
setTimeout(() => setAllCopied(false), 2e3);
|
|
2028
|
+
}
|
|
2029
|
+
};
|
|
2030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2031
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref: forwardedRef, className: (0, import_clsx.clsx)("kds-copyable-table", className), ...rest, children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2032
|
+
"div",
|
|
2033
|
+
{
|
|
2034
|
+
className: (0, import_clsx.clsx)(
|
|
2035
|
+
"kds-copyable-table-row",
|
|
2036
|
+
copiedRows.has(i) && "copied",
|
|
2037
|
+
settlingRows.has(i) && "settling"
|
|
2038
|
+
),
|
|
2039
|
+
role: "button",
|
|
2040
|
+
tabIndex: 0,
|
|
2041
|
+
onClick: () => handleRowCopy(row, i),
|
|
2042
|
+
onKeyDown: (e) => {
|
|
2043
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2044
|
+
e.preventDefault();
|
|
2045
|
+
handleRowCopy(row, i);
|
|
2046
|
+
}
|
|
2047
|
+
},
|
|
2048
|
+
"aria-label": `Copiar ${row.label}: ${row.value}`,
|
|
2049
|
+
children: [
|
|
2050
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kds-key", children: row.label }),
|
|
2051
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kds-value", children: row.value })
|
|
2052
|
+
]
|
|
2053
|
+
},
|
|
2054
|
+
`${row.label}-${i}`
|
|
2055
|
+
)) }),
|
|
2056
|
+
showCopyAll && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2057
|
+
"button",
|
|
2058
|
+
{
|
|
2059
|
+
type: "button",
|
|
2060
|
+
className: (0, import_clsx.clsx)(
|
|
2061
|
+
"kds-btn",
|
|
2062
|
+
"kds-btn-outlined",
|
|
2063
|
+
"kds-btn-block",
|
|
2064
|
+
"kds-copy-all-btn",
|
|
2065
|
+
allCopied && "copied"
|
|
2066
|
+
),
|
|
2067
|
+
onClick: handleCopyAll,
|
|
2068
|
+
"aria-label": allCopied ? copiedAllLabel : copyAllLabel,
|
|
2069
|
+
children: [
|
|
2070
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kds-icon", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("i", { className: "material-symbols-outlined", children: allCopied ? "check" : "content_copy" }) }),
|
|
2071
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: allCopied ? copiedAllLabel : copyAllLabel })
|
|
2072
|
+
]
|
|
2073
|
+
}
|
|
2074
|
+
)
|
|
2075
|
+
] });
|
|
2076
|
+
}
|
|
1821
2077
|
var KdsCopyableTable = (0, import_react25.forwardRef)(
|
|
1822
|
-
({
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
2078
|
+
({
|
|
2079
|
+
rows = [],
|
|
2080
|
+
variant = "copyable",
|
|
2081
|
+
gridRows = [],
|
|
2082
|
+
disabled = false,
|
|
2083
|
+
copyAllLabel,
|
|
2084
|
+
copiedAllLabel,
|
|
2085
|
+
showCopyAll,
|
|
2086
|
+
className,
|
|
2087
|
+
...props
|
|
2088
|
+
}, ref) => {
|
|
2089
|
+
if (variant === "grid") {
|
|
2090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2091
|
+
GridVariant,
|
|
2092
|
+
{
|
|
2093
|
+
gridRows,
|
|
2094
|
+
disabled,
|
|
2095
|
+
className,
|
|
2096
|
+
forwardedRef: ref,
|
|
2097
|
+
rest: props
|
|
2098
|
+
}
|
|
2099
|
+
);
|
|
2100
|
+
}
|
|
2101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2102
|
+
CopyableVariant,
|
|
2103
|
+
{
|
|
2104
|
+
rows,
|
|
2105
|
+
copyAllLabel,
|
|
2106
|
+
copiedAllLabel,
|
|
2107
|
+
showCopyAll,
|
|
2108
|
+
className,
|
|
2109
|
+
forwardedRef: ref,
|
|
2110
|
+
rest: props
|
|
2111
|
+
}
|
|
2112
|
+
);
|
|
1838
2113
|
}
|
|
1839
2114
|
);
|
|
1840
2115
|
KdsCopyableTable.displayName = "KdsCopyableTable";
|
|
@@ -1924,7 +2199,7 @@ KdsCountdown.displayName = "KdsCountdown";
|
|
|
1924
2199
|
var import_react29 = require("react");
|
|
1925
2200
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1926
2201
|
var KdsSegmentedTabs = (0, import_react29.forwardRef)(
|
|
1927
|
-
(props, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KdsTabs, { ref,
|
|
2202
|
+
(props, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KdsTabs, { ref, ...props })
|
|
1928
2203
|
);
|
|
1929
2204
|
KdsSegmentedTabs.displayName = "KdsSegmentedTabs";
|
|
1930
2205
|
|
|
@@ -1959,7 +2234,7 @@ KdsBankList.displayName = "KdsBankList";
|
|
|
1959
2234
|
|
|
1960
2235
|
// src/components/domain/KdsBankModal/KdsBankModal.tsx
|
|
1961
2236
|
var import_react32 = require("react");
|
|
1962
|
-
var
|
|
2237
|
+
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
1963
2238
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1964
2239
|
var KdsBankModal = (0, import_react32.forwardRef)(
|
|
1965
2240
|
({ open, onClose, title = "Selecciona tu banco", searchPlaceholder = "Buscar banco...", onSearch, children, className, container }, ref) => {
|
|
@@ -1968,12 +2243,12 @@ var KdsBankModal = (0, import_react32.forwardRef)(
|
|
|
1968
2243
|
setQuery(value);
|
|
1969
2244
|
onSearch?.(value);
|
|
1970
2245
|
};
|
|
1971
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog.Root, { open, onOpenChange: (o) => {
|
|
1972
2247
|
if (!o) onClose();
|
|
1973
|
-
}, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2248
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog.Overlay, { className: "kds-bank-modal-scrim open", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Dialog.Content, { ref, className: (0, import_clsx.clsx)("kds-bank-modal", className), children: [
|
|
1974
2249
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "kds-bank-modal-header", children: [
|
|
1975
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1976
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2250
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog.Title, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h3", { children: title }) }),
|
|
2251
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { className: "kds-bank-modal-close", "aria-label": "Cerrar", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { className: "material-symbols-outlined", children: "close" }) }) })
|
|
1977
2252
|
] }),
|
|
1978
2253
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "kds-bank-modal-search", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1979
2254
|
"input",
|
|
@@ -1997,8 +2272,8 @@ var KdsQrRow = (0, import_react33.forwardRef)(
|
|
|
1997
2272
|
({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { ref, type: "button", className: (0, import_clsx.clsx)("kds-qr-row", className), ...props, children: [
|
|
1998
2273
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "kds-qr-avatar", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
|
|
1999
2274
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "kds-qr-text", children: [
|
|
2000
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "title", children: name }),
|
|
2001
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "
|
|
2275
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "kds-qr-title", children: name }),
|
|
2276
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "kds-qr-subtitle", children: description })
|
|
2002
2277
|
] }),
|
|
2003
2278
|
badge && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "kds-qr-badge", children: badge }),
|
|
2004
2279
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", { className: "material-symbols-outlined", children: "chevron_right" })
|
|
@@ -2038,15 +2313,15 @@ var KdsCardPlan = (0, import_react35.forwardRef)(
|
|
|
2038
2313
|
className: (0, import_clsx.clsx)("kds-card-plan", recommended && "recommended", className),
|
|
2039
2314
|
...props,
|
|
2040
2315
|
children: [
|
|
2041
|
-
badgeText && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "kds-card-plan-badge", children: badgeText }),
|
|
2042
2316
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "kds-card-plan-header", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h3", { children: title }) }),
|
|
2043
2317
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "kds-card-plan-price", children: [
|
|
2044
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: price }),
|
|
2045
|
-
period && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
|
|
2318
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "kds-price", children: price }),
|
|
2319
|
+
period && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "kds-price-period", children: [
|
|
2046
2320
|
"/",
|
|
2047
2321
|
period
|
|
2048
2322
|
] })
|
|
2049
2323
|
] }),
|
|
2324
|
+
badgeText && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "kds-card-plan-badge", children: badgeText }),
|
|
2050
2325
|
features && features.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "kds-card-plan-features", children: features.map((f, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("li", { children: f }, i)) }),
|
|
2051
2326
|
action
|
|
2052
2327
|
]
|
|
@@ -2065,17 +2340,56 @@ KdsInvoiceSticky.displayName = "KdsInvoiceSticky";
|
|
|
2065
2340
|
|
|
2066
2341
|
// src/components/domain/KdsBottomSheet/KdsBottomSheet.tsx
|
|
2067
2342
|
var import_react37 = require("react");
|
|
2068
|
-
var
|
|
2343
|
+
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
2069
2344
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2070
2345
|
var KdsBottomSheet = (0, import_react37.forwardRef)(
|
|
2071
|
-
({
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
actions
|
|
2078
|
-
|
|
2346
|
+
({
|
|
2347
|
+
open,
|
|
2348
|
+
onClose,
|
|
2349
|
+
title,
|
|
2350
|
+
description,
|
|
2351
|
+
children,
|
|
2352
|
+
actions,
|
|
2353
|
+
showGrabber = true,
|
|
2354
|
+
showCloseButton = false,
|
|
2355
|
+
container,
|
|
2356
|
+
className
|
|
2357
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2358
|
+
Dialog2.Root,
|
|
2359
|
+
{
|
|
2360
|
+
open,
|
|
2361
|
+
onOpenChange: (o) => {
|
|
2362
|
+
if (!o) onClose();
|
|
2363
|
+
},
|
|
2364
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Dialog2.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Dialog2.Overlay, { className: "kds-bottom-sheet-scrim open", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2365
|
+
Dialog2.Content,
|
|
2366
|
+
{
|
|
2367
|
+
ref,
|
|
2368
|
+
className: (0, import_clsx.clsx)("kds-bottom-sheet", className),
|
|
2369
|
+
onPointerDownOutside: (e) => {
|
|
2370
|
+
const target = e.target;
|
|
2371
|
+
if (target.closest(".kds-bottom-sheet")) e.preventDefault();
|
|
2372
|
+
},
|
|
2373
|
+
children: [
|
|
2374
|
+
showGrabber && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kds-bottom-sheet-grabber", "aria-hidden": "true" }),
|
|
2375
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2376
|
+
"button",
|
|
2377
|
+
{
|
|
2378
|
+
type: "button",
|
|
2379
|
+
className: "kds-bottom-sheet-close",
|
|
2380
|
+
"aria-label": "Cerrar",
|
|
2381
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", { className: "material-symbols-outlined", children: "close" })
|
|
2382
|
+
}
|
|
2383
|
+
) }),
|
|
2384
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Dialog2.Title, { className: "kds-bottom-sheet-title", children: title }),
|
|
2385
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Dialog2.Description, { className: "kds-bottom-sheet-description", children: description }),
|
|
2386
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kds-bottom-sheet-body", children }),
|
|
2387
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kds-bottom-sheet-actions", children: actions })
|
|
2388
|
+
]
|
|
2389
|
+
}
|
|
2390
|
+
) }) })
|
|
2391
|
+
}
|
|
2392
|
+
)
|
|
2079
2393
|
);
|
|
2080
2394
|
KdsBottomSheet.displayName = "KdsBottomSheet";
|
|
2081
2395
|
|
|
@@ -2095,11 +2409,147 @@ var import_react39 = require("react");
|
|
|
2095
2409
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2096
2410
|
var KdsRecapList = (0, import_react39.forwardRef)(
|
|
2097
2411
|
({ items, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("ul", { ref, className: (0, import_clsx.clsx)("kds-recap-list", className), ...props, children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("li", { children: [
|
|
2098
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "
|
|
2099
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: (0, import_clsx.clsx)("
|
|
2412
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "kds-key", children: item.label }),
|
|
2413
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: (0, import_clsx.clsx)("kds-value", !item.value && item.placeholder && "placeholder"), children: item.value || item.placeholder || "-" })
|
|
2100
2414
|
] }, i)) })
|
|
2101
2415
|
);
|
|
2102
2416
|
KdsRecapList.displayName = "KdsRecapList";
|
|
2417
|
+
|
|
2418
|
+
// src/components/domain/KdsMontoRow/KdsMontoRow.tsx
|
|
2419
|
+
var import_react40 = require("react");
|
|
2420
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2421
|
+
var KdsMontoRow = (0, import_react40.forwardRef)(
|
|
2422
|
+
({ title, value, deadline, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-monto-row", className), ...props, children: [
|
|
2423
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
2424
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "kds-monto-row-title", children: title }),
|
|
2425
|
+
deadline && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "kds-monto-row-deadline", children: deadline })
|
|
2426
|
+
] }),
|
|
2427
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "kds-monto-row-value", children: value })
|
|
2428
|
+
] })
|
|
2429
|
+
);
|
|
2430
|
+
KdsMontoRow.displayName = "KdsMontoRow";
|
|
2431
|
+
|
|
2432
|
+
// src/components/domain/KdsMerchantTile/KdsMerchantTile.tsx
|
|
2433
|
+
var import_react41 = require("react");
|
|
2434
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2435
|
+
var KdsMerchantTile = (0, import_react41.forwardRef)(
|
|
2436
|
+
({ name, logoUrl, initials, compact, className, ...props }, ref) => {
|
|
2437
|
+
const displayInitials = (initials ?? name.slice(0, 2)).toUpperCase();
|
|
2438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2439
|
+
"div",
|
|
2440
|
+
{
|
|
2441
|
+
ref,
|
|
2442
|
+
className: (0, import_clsx.clsx)("kds-merchant-tile", logoUrl && "logo", compact && "compact", className),
|
|
2443
|
+
"aria-label": name,
|
|
2444
|
+
...props,
|
|
2445
|
+
children: logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("img", { src: logoUrl, alt: name }) : displayInitials
|
|
2446
|
+
}
|
|
2447
|
+
);
|
|
2448
|
+
}
|
|
2449
|
+
);
|
|
2450
|
+
KdsMerchantTile.displayName = "KdsMerchantTile";
|
|
2451
|
+
|
|
2452
|
+
// src/components/domain/KdsPaymentTotal/KdsPaymentTotal.tsx
|
|
2453
|
+
var import_react42 = require("react");
|
|
2454
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2455
|
+
var KdsPaymentTotal = (0, import_react42.forwardRef)(
|
|
2456
|
+
({
|
|
2457
|
+
variant = "default",
|
|
2458
|
+
tone = "brand",
|
|
2459
|
+
centered = false,
|
|
2460
|
+
amount,
|
|
2461
|
+
currency = "S/",
|
|
2462
|
+
decimals = 2,
|
|
2463
|
+
locale = "es-PE",
|
|
2464
|
+
label = "Monto a pagar",
|
|
2465
|
+
title = "Escanea el QR",
|
|
2466
|
+
titleMobile = "Descarga el QR",
|
|
2467
|
+
className,
|
|
2468
|
+
...props
|
|
2469
|
+
}, ref) => {
|
|
2470
|
+
const { integer, fraction } = formatAmount(amount, decimals, locale);
|
|
2471
|
+
const isEmail = variant === "email";
|
|
2472
|
+
const isInfoTone = tone === "info";
|
|
2473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2474
|
+
"div",
|
|
2475
|
+
{
|
|
2476
|
+
ref,
|
|
2477
|
+
className: (0, import_clsx.clsx)(
|
|
2478
|
+
"kds-payment-total",
|
|
2479
|
+
isEmail && "kds-payment-total--email",
|
|
2480
|
+
isInfoTone && "kds-payment-total--tone-info",
|
|
2481
|
+
centered && "kds-payment-total--centered",
|
|
2482
|
+
className
|
|
2483
|
+
),
|
|
2484
|
+
...props,
|
|
2485
|
+
children: [
|
|
2486
|
+
!isEmail && title != null && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h5", { className: "kds-payment-total-title", children: title }),
|
|
2487
|
+
!isEmail && titleMobile != null && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h5", { className: "kds-payment-total-title-mobile", children: titleMobile }),
|
|
2488
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h6", { className: "kds-payment-label", children: label }),
|
|
2489
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("h5", { className: "kds-payment-amount", children: [
|
|
2490
|
+
currency,
|
|
2491
|
+
" ",
|
|
2492
|
+
integer,
|
|
2493
|
+
fraction !== null && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("sup", { className: "kds-payment-total-decimal-sup", children: fraction })
|
|
2494
|
+
] })
|
|
2495
|
+
]
|
|
2496
|
+
}
|
|
2497
|
+
);
|
|
2498
|
+
}
|
|
2499
|
+
);
|
|
2500
|
+
KdsPaymentTotal.displayName = "KdsPaymentTotal";
|
|
2501
|
+
function formatAmount(amount, decimals, locale) {
|
|
2502
|
+
const showDecimals = typeof decimals === "number" && decimals > 0;
|
|
2503
|
+
if (typeof amount === "number") {
|
|
2504
|
+
if (showDecimals) {
|
|
2505
|
+
const fixed = amount.toFixed(decimals);
|
|
2506
|
+
const [int, frac] = fixed.split(".");
|
|
2507
|
+
const formattedInt2 = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
|
|
2508
|
+
Number(int)
|
|
2509
|
+
);
|
|
2510
|
+
return { integer: formattedInt2, fraction: frac ?? null };
|
|
2511
|
+
}
|
|
2512
|
+
const formattedInt = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
|
|
2513
|
+
Math.trunc(amount)
|
|
2514
|
+
);
|
|
2515
|
+
return { integer: formattedInt, fraction: null };
|
|
2516
|
+
}
|
|
2517
|
+
const str = amount.trim();
|
|
2518
|
+
const dotIdx = str.indexOf(".");
|
|
2519
|
+
if (dotIdx === -1 || !showDecimals) {
|
|
2520
|
+
return { integer: str, fraction: null };
|
|
2521
|
+
}
|
|
2522
|
+
return {
|
|
2523
|
+
integer: str.slice(0, dotIdx),
|
|
2524
|
+
fraction: str.slice(dotIdx + 1)
|
|
2525
|
+
};
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
// src/components/domain/KdsBillAttachment/KdsBillAttachment.tsx
|
|
2529
|
+
var import_react43 = require("react");
|
|
2530
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2531
|
+
var KdsBillAttachment = (0, import_react43.forwardRef)(
|
|
2532
|
+
({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2533
|
+
"a",
|
|
2534
|
+
{
|
|
2535
|
+
ref,
|
|
2536
|
+
href,
|
|
2537
|
+
target: "_blank",
|
|
2538
|
+
rel: "noopener noreferrer",
|
|
2539
|
+
className: (0, import_clsx.clsx)("kds-bill-attachment", className),
|
|
2540
|
+
...props,
|
|
2541
|
+
children: [
|
|
2542
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", { className: "material-symbols-outlined", children: icon }),
|
|
2543
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: filename })
|
|
2544
|
+
]
|
|
2545
|
+
}
|
|
2546
|
+
)
|
|
2547
|
+
);
|
|
2548
|
+
KdsBillAttachment.displayName = "KdsBillAttachment";
|
|
2549
|
+
var KdsBillAttachments = (0, import_react43.forwardRef)(
|
|
2550
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-bill-attachments", className), ...props, children })
|
|
2551
|
+
);
|
|
2552
|
+
KdsBillAttachments.displayName = "KdsBillAttachments";
|
|
2103
2553
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2104
2554
|
0 && (module.exports = {
|
|
2105
2555
|
KdsAccordion,
|
|
@@ -2109,6 +2559,8 @@ KdsRecapList.displayName = "KdsRecapList";
|
|
|
2109
2559
|
KdsBankList,
|
|
2110
2560
|
KdsBankModal,
|
|
2111
2561
|
KdsBankRow,
|
|
2562
|
+
KdsBillAttachment,
|
|
2563
|
+
KdsBillAttachments,
|
|
2112
2564
|
KdsBottomSheet,
|
|
2113
2565
|
KdsButton,
|
|
2114
2566
|
KdsCard,
|
|
@@ -2119,6 +2571,7 @@ KdsRecapList.displayName = "KdsRecapList";
|
|
|
2119
2571
|
KdsCardSelector,
|
|
2120
2572
|
KdsCheckbox,
|
|
2121
2573
|
KdsChip,
|
|
2574
|
+
KdsCopyButton,
|
|
2122
2575
|
KdsCopyRow,
|
|
2123
2576
|
KdsCopyableTable,
|
|
2124
2577
|
KdsCountdown,
|
|
@@ -2126,17 +2579,15 @@ KdsRecapList.displayName = "KdsRecapList";
|
|
|
2126
2579
|
KdsExpandPanel,
|
|
2127
2580
|
KdsInvoiceSticky,
|
|
2128
2581
|
KdsLinearProgress,
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
KdsLogoHeaderLogo,
|
|
2133
|
-
KdsLogoHeaderSeparator,
|
|
2134
|
-
KdsModal,
|
|
2582
|
+
KdsMerchantTile,
|
|
2583
|
+
KdsMontoRow,
|
|
2584
|
+
KdsPaymentTotal,
|
|
2135
2585
|
KdsQrRow,
|
|
2136
2586
|
KdsRadioGroup,
|
|
2137
2587
|
KdsRecapList,
|
|
2138
2588
|
KdsSectionNote,
|
|
2139
2589
|
KdsSecureFooter,
|
|
2590
|
+
KdsSecureLoader,
|
|
2140
2591
|
KdsSegmentedTabs,
|
|
2141
2592
|
KdsSelect,
|
|
2142
2593
|
KdsSnackbar,
|