@khipu/design-system 0.2.0-alpha.3 → 0.2.0-alpha.30
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 +785 -157
- package/dist/beercss/khipu-beercss.js +60 -27
- package/dist/beercss/khipu-beercss.min.css +1 -1
- package/dist/beercss/khipu-beercss.min.js +1 -1
- package/dist/beercss/metadata.json +4 -4
- package/dist/index.d.mts +584 -285
- package/dist/index.d.ts +584 -285
- package/dist/index.js +780 -487
- package/dist/index.mjs +763 -469
- 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,
|
|
@@ -54,12 +56,9 @@ __export(index_exports, {
|
|
|
54
56
|
KdsExpandPanel: () => KdsExpandPanel,
|
|
55
57
|
KdsInvoiceSticky: () => KdsInvoiceSticky,
|
|
56
58
|
KdsLinearProgress: () => KdsLinearProgress,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
KdsLogoHeaderLogo: () => KdsLogoHeaderLogo,
|
|
61
|
-
KdsLogoHeaderSeparator: () => KdsLogoHeaderSeparator,
|
|
62
|
-
KdsModal: () => KdsModal,
|
|
59
|
+
KdsMerchantTile: () => KdsMerchantTile,
|
|
60
|
+
KdsMontoRow: () => KdsMontoRow,
|
|
61
|
+
KdsPaymentTotal: () => KdsPaymentTotal,
|
|
63
62
|
KdsQrRow: () => KdsQrRow,
|
|
64
63
|
KdsRadioGroup: () => KdsRadioGroup,
|
|
65
64
|
KdsRecapList: () => KdsRecapList,
|
|
@@ -454,6 +453,8 @@ var semanticColors = {
|
|
|
454
453
|
// From Figma: warning/light
|
|
455
454
|
dark: "#E65100",
|
|
456
455
|
// From Figma: warning/dark
|
|
456
|
+
warm: "#8A6D1A",
|
|
457
|
+
// Warm/olive variant for header icons (LigoPay handoff v2)
|
|
457
458
|
container: "#FFFBEB",
|
|
458
459
|
// Light amber background for chips/badges
|
|
459
460
|
contrastText: "#FFFFFF"
|
|
@@ -472,6 +473,8 @@ var semanticColors = {
|
|
|
472
473
|
main: "#0288D1",
|
|
473
474
|
light: "#03A9F4",
|
|
474
475
|
dark: "#01579B",
|
|
476
|
+
blue: "#5A5FE0",
|
|
477
|
+
// Khipu-blue / LigoPay informational blue (distinct from cyan main)
|
|
475
478
|
container: "#EFF6FF",
|
|
476
479
|
// Light blue background for chips/badges
|
|
477
480
|
contrastText: "#FFFFFF"
|
|
@@ -514,8 +517,10 @@ var fontSizes = {
|
|
|
514
517
|
// 24px
|
|
515
518
|
"3xl": "1.875rem",
|
|
516
519
|
// 30px
|
|
517
|
-
"4xl": "2.25rem"
|
|
520
|
+
"4xl": "2.25rem",
|
|
518
521
|
// 36px
|
|
522
|
+
decimalSup: "0.5em"
|
|
523
|
+
// Relative size for decimal superscript in amount displays
|
|
519
524
|
};
|
|
520
525
|
var lineHeights = {
|
|
521
526
|
tight: 1.2,
|
|
@@ -620,9 +625,9 @@ var typography = {
|
|
|
620
625
|
button: {
|
|
621
626
|
fontFamily: fontFamilies.secondary,
|
|
622
627
|
fontWeight: fontWeights.medium,
|
|
623
|
-
fontSize: "0.
|
|
624
|
-
//
|
|
625
|
-
lineHeight: "
|
|
628
|
+
fontSize: "0.875rem",
|
|
629
|
+
// 14px
|
|
630
|
+
lineHeight: "1.5",
|
|
626
631
|
letterSpacing: "0.46px",
|
|
627
632
|
textTransform: "uppercase"
|
|
628
633
|
},
|
|
@@ -732,10 +737,10 @@ var semanticSpacing = {
|
|
|
732
737
|
},
|
|
733
738
|
// Button spacing
|
|
734
739
|
button: {
|
|
735
|
-
paddingY: "
|
|
736
|
-
paddingX: "
|
|
737
|
-
padding: "
|
|
738
|
-
minHeight: "
|
|
740
|
+
paddingY: "0",
|
|
741
|
+
paddingX: "16px",
|
|
742
|
+
padding: "0 16px",
|
|
743
|
+
minHeight: "44px",
|
|
739
744
|
// Altura mínima para coincidir con KdsButton
|
|
740
745
|
iconSize: "20px"
|
|
741
746
|
// Tamaño de iconos en botones (Material Design medium)
|
|
@@ -946,7 +951,7 @@ var borderRadius = {
|
|
|
946
951
|
"3xl": "24px",
|
|
947
952
|
full: "9999px",
|
|
948
953
|
// Component-specific
|
|
949
|
-
button: "
|
|
954
|
+
button: "10px",
|
|
950
955
|
input: "4px",
|
|
951
956
|
card: "14px",
|
|
952
957
|
// Payment card radius (between lg=12px and xl=16px) - Beer CSS Proposal
|
|
@@ -1147,7 +1152,7 @@ var KdsButton = (0, import_react.forwardRef)(
|
|
|
1147
1152
|
children: [
|
|
1148
1153
|
!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
1154
|
loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
1150
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("
|
|
1155
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("progress", { className: "circle indeterminate small" }),
|
|
1151
1156
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children })
|
|
1152
1157
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children }),
|
|
1153
1158
|
!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 +1174,13 @@ var KdsTextField = (0, import_react2.forwardRef)(
|
|
|
1169
1174
|
readOnly,
|
|
1170
1175
|
startIcon,
|
|
1171
1176
|
endIcon,
|
|
1177
|
+
required,
|
|
1172
1178
|
className,
|
|
1173
1179
|
id,
|
|
1174
1180
|
...props
|
|
1175
1181
|
}, ref) => {
|
|
1176
1182
|
const fieldId = id || `kds-field-${label.toLowerCase().replace(/\s+/g, "-")}`;
|
|
1183
|
+
const hasSuffix = !!endIcon || readOnly;
|
|
1177
1184
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1178
1185
|
"div",
|
|
1179
1186
|
{
|
|
@@ -1181,6 +1188,8 @@ var KdsTextField = (0, import_react2.forwardRef)(
|
|
|
1181
1188
|
"field",
|
|
1182
1189
|
"label",
|
|
1183
1190
|
"border",
|
|
1191
|
+
startIcon && "prefix",
|
|
1192
|
+
hasSuffix && "suffix",
|
|
1184
1193
|
error && "invalid",
|
|
1185
1194
|
readOnly && "locked",
|
|
1186
1195
|
fullWidth && "kds-w-full",
|
|
@@ -1193,12 +1202,16 @@ var KdsTextField = (0, import_react2.forwardRef)(
|
|
|
1193
1202
|
{
|
|
1194
1203
|
ref,
|
|
1195
1204
|
id: fieldId,
|
|
1196
|
-
placeholder: " ",
|
|
1197
1205
|
readOnly,
|
|
1198
|
-
|
|
1206
|
+
required,
|
|
1207
|
+
...props,
|
|
1208
|
+
placeholder: " "
|
|
1199
1209
|
}
|
|
1200
1210
|
),
|
|
1201
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
1211
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { htmlFor: fieldId, children: [
|
|
1212
|
+
label,
|
|
1213
|
+
required && " *"
|
|
1214
|
+
] }),
|
|
1202
1215
|
readOnly && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "material-symbols-outlined", children: "lock" }),
|
|
1203
1216
|
endIcon && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "material-symbols-outlined", children: endIcon }),
|
|
1204
1217
|
helperText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "helper", children: helperText })
|
|
@@ -1213,78 +1226,18 @@ KdsTextField.displayName = "KdsTextField";
|
|
|
1213
1226
|
var import_react3 = require("react");
|
|
1214
1227
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1215
1228
|
var KdsCheckbox = (0, import_react3.forwardRef)(
|
|
1216
|
-
({ label, className,
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: label })
|
|
1221
|
-
] });
|
|
1222
|
-
}
|
|
1229
|
+
({ label, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: (0, import_clsx.clsx)("checkbox", className), children: [
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("input", { ref, type: "checkbox", ...props }),
|
|
1231
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: label })
|
|
1232
|
+
] })
|
|
1223
1233
|
);
|
|
1224
1234
|
KdsCheckbox.displayName = "KdsCheckbox";
|
|
1225
1235
|
|
|
1226
|
-
// src/components/core/
|
|
1236
|
+
// src/components/core/KdsCard/KdsCard.tsx
|
|
1227
1237
|
var import_react4 = require("react");
|
|
1228
|
-
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
1229
1238
|
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)(
|
|
1239
|
+
var KdsCard = (0, import_react4.forwardRef)(
|
|
1240
|
+
({ variant = "elevated", dimmed, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1288
1241
|
"article",
|
|
1289
1242
|
{
|
|
1290
1243
|
ref,
|
|
@@ -1299,66 +1252,101 @@ var KdsCard = (0, import_react5.forwardRef)(
|
|
|
1299
1252
|
)
|
|
1300
1253
|
);
|
|
1301
1254
|
KdsCard.displayName = "KdsCard";
|
|
1302
|
-
var KdsCardHeader = (0,
|
|
1303
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1255
|
+
var KdsCardHeader = (0, import_react4.forwardRef)(
|
|
1256
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-card-header", className), ...props, children })
|
|
1304
1257
|
);
|
|
1305
1258
|
KdsCardHeader.displayName = "KdsCardHeader";
|
|
1306
|
-
var KdsCardBody = (0,
|
|
1307
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1259
|
+
var KdsCardBody = (0, import_react4.forwardRef)(
|
|
1260
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-card-body", className), ...props, children })
|
|
1308
1261
|
);
|
|
1309
1262
|
KdsCardBody.displayName = "KdsCardBody";
|
|
1310
|
-
var KdsCardFooter = (0,
|
|
1311
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1263
|
+
var KdsCardFooter = (0, import_react4.forwardRef)(
|
|
1264
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-card-footer", className), ...props, children })
|
|
1312
1265
|
);
|
|
1313
1266
|
KdsCardFooter.displayName = "KdsCardFooter";
|
|
1314
1267
|
|
|
1315
1268
|
// src/components/core/KdsSpinner/KdsSpinner.tsx
|
|
1316
|
-
var
|
|
1317
|
-
var
|
|
1318
|
-
var
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1269
|
+
var import_react5 = require("react");
|
|
1270
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1271
|
+
var SIZE_CLASS = {
|
|
1272
|
+
small: "small",
|
|
1273
|
+
medium: null,
|
|
1274
|
+
large: "large"
|
|
1275
|
+
};
|
|
1276
|
+
var KdsSpinner = (0, import_react5.forwardRef)(
|
|
1277
|
+
({ size = "medium", label, className, ...props }, ref) => {
|
|
1278
|
+
const sizeClass = SIZE_CLASS[size];
|
|
1279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1280
|
+
"div",
|
|
1281
|
+
{
|
|
1282
|
+
ref,
|
|
1283
|
+
className: (0, import_clsx.clsx)("kds-flex kds-flex-col kds-items-center kds-gap-2", className),
|
|
1284
|
+
role: "status",
|
|
1285
|
+
...props,
|
|
1286
|
+
children: [
|
|
1287
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("progress", { className: (0, import_clsx.clsx)("circle indeterminate", sizeClass) }),
|
|
1288
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "kds-text-body-small kds-text-muted", children: label }),
|
|
1289
|
+
!label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "kds-hidden", children: "Cargando" })
|
|
1290
|
+
]
|
|
1291
|
+
}
|
|
1292
|
+
);
|
|
1293
|
+
}
|
|
1324
1294
|
);
|
|
1325
1295
|
KdsSpinner.displayName = "KdsSpinner";
|
|
1326
1296
|
|
|
1327
1297
|
// src/components/core/KdsLinearProgress/KdsLinearProgress.tsx
|
|
1328
|
-
var
|
|
1329
|
-
var
|
|
1330
|
-
var KdsLinearProgress = (0,
|
|
1331
|
-
({ value, max = 100, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1298
|
+
var import_react6 = require("react");
|
|
1299
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1300
|
+
var KdsLinearProgress = (0, import_react6.forwardRef)(
|
|
1301
|
+
({ value, max = 100, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("progress", { ref, className: (0, import_clsx.clsx)("kds-progress", className), value, max, ...props })
|
|
1332
1302
|
);
|
|
1333
1303
|
KdsLinearProgress.displayName = "KdsLinearProgress";
|
|
1334
1304
|
|
|
1335
1305
|
// 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
|
-
|
|
1306
|
+
var import_react7 = require("react");
|
|
1307
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1308
|
+
var DEFAULT_ICONS = {
|
|
1309
|
+
success: "check_circle",
|
|
1310
|
+
info: "info",
|
|
1311
|
+
warning: "warning",
|
|
1312
|
+
error: "error"
|
|
1313
|
+
};
|
|
1314
|
+
var KdsAlert = (0, import_react7.forwardRef)(
|
|
1315
|
+
({ severity, title, icon, inline, onClose, children, className, ...props }, ref) => {
|
|
1316
|
+
const resolvedIcon = icon === false ? null : typeof icon === "string" ? icon : DEFAULT_ICONS[severity];
|
|
1317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1318
|
+
"div",
|
|
1319
|
+
{
|
|
1320
|
+
ref,
|
|
1321
|
+
role: "alert",
|
|
1322
|
+
className: (0, import_clsx.clsx)("kds-alert", `kds-${severity}`, inline && "kds-alert-inline", className),
|
|
1323
|
+
...props,
|
|
1324
|
+
children: [
|
|
1325
|
+
resolvedIcon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "kds-alert-icon", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("i", { className: "material-symbols-outlined", children: resolvedIcon }) }),
|
|
1326
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "kds-alert-content", children: [
|
|
1327
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "kds-alert-title", children: title }),
|
|
1328
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "kds-alert-description", children })
|
|
1329
|
+
] }),
|
|
1330
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1331
|
+
"button",
|
|
1332
|
+
{
|
|
1333
|
+
type: "button",
|
|
1334
|
+
className: "kds-alert-close",
|
|
1335
|
+
onClick: onClose,
|
|
1336
|
+
"aria-label": "Cerrar",
|
|
1337
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("i", { className: "material-symbols-outlined", children: "close" })
|
|
1338
|
+
}
|
|
1339
|
+
)
|
|
1340
|
+
]
|
|
1341
|
+
}
|
|
1342
|
+
);
|
|
1343
|
+
}
|
|
1356
1344
|
);
|
|
1357
1345
|
KdsAlert.displayName = "KdsAlert";
|
|
1358
1346
|
|
|
1359
1347
|
// src/components/core/KdsTypography/KdsTypography.tsx
|
|
1360
|
-
var
|
|
1361
|
-
var
|
|
1348
|
+
var import_react8 = require("react");
|
|
1349
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1362
1350
|
var variantTag = {
|
|
1363
1351
|
display1: "h1",
|
|
1364
1352
|
display2: "h2",
|
|
@@ -1373,10 +1361,10 @@ var variantTag = {
|
|
|
1373
1361
|
muted: "p",
|
|
1374
1362
|
link: "span"
|
|
1375
1363
|
};
|
|
1376
|
-
var KdsTypography = (0,
|
|
1364
|
+
var KdsTypography = (0, import_react8.forwardRef)(
|
|
1377
1365
|
({ variant = "body", color, as, children, className, ...props }, ref) => {
|
|
1378
1366
|
const Tag = as || variantTag[variant];
|
|
1379
|
-
return /* @__PURE__ */ (0,
|
|
1367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1380
1368
|
Tag,
|
|
1381
1369
|
{
|
|
1382
1370
|
ref,
|
|
@@ -1394,12 +1382,12 @@ var KdsTypography = (0, import_react9.forwardRef)(
|
|
|
1394
1382
|
KdsTypography.displayName = "KdsTypography";
|
|
1395
1383
|
|
|
1396
1384
|
// src/components/core/KdsTabs/KdsTabs.tsx
|
|
1397
|
-
var
|
|
1385
|
+
var import_react10 = __toESM(require("react"));
|
|
1398
1386
|
|
|
1399
1387
|
// src/components/core/hooks/useTabsKeyboard.ts
|
|
1400
|
-
var
|
|
1388
|
+
var import_react9 = require("react");
|
|
1401
1389
|
function useTabsKeyboard(tabCount, activeIndex, onChange) {
|
|
1402
|
-
const onKeyDown = (0,
|
|
1390
|
+
const onKeyDown = (0, import_react9.useCallback)(
|
|
1403
1391
|
(e) => {
|
|
1404
1392
|
let next = activeIndex;
|
|
1405
1393
|
if (e.key === "ArrowRight") next = (activeIndex + 1) % tabCount;
|
|
@@ -1419,31 +1407,31 @@ function useTabsKeyboard(tabCount, activeIndex, onChange) {
|
|
|
1419
1407
|
}
|
|
1420
1408
|
|
|
1421
1409
|
// src/components/core/KdsTabs/KdsTabs.tsx
|
|
1422
|
-
var
|
|
1423
|
-
var KdsTabs = (0,
|
|
1424
|
-
({ activeIndex, onChange,
|
|
1425
|
-
const tabCount =
|
|
1410
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1411
|
+
var KdsTabs = (0, import_react10.forwardRef)(
|
|
1412
|
+
({ activeIndex, onChange, children, className, style, ...props }, ref) => {
|
|
1413
|
+
const tabCount = import_react10.Children.count(children);
|
|
1426
1414
|
const { onKeyDown } = useTabsKeyboard(tabCount, activeIndex, onChange);
|
|
1427
|
-
const mergedStyle = (0,
|
|
1428
|
-
|
|
1429
|
-
return {
|
|
1415
|
+
const mergedStyle = (0, import_react10.useMemo)(
|
|
1416
|
+
() => ({
|
|
1430
1417
|
...style,
|
|
1431
1418
|
"--_tab-count": tabCount,
|
|
1432
1419
|
"--_active-idx": activeIndex
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
|
|
1420
|
+
}),
|
|
1421
|
+
[tabCount, activeIndex, style]
|
|
1422
|
+
);
|
|
1423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1436
1424
|
"div",
|
|
1437
1425
|
{
|
|
1438
1426
|
ref,
|
|
1439
1427
|
role: "tablist",
|
|
1440
|
-
className: (0, import_clsx.clsx)(
|
|
1428
|
+
className: (0, import_clsx.clsx)("kds-segmented-tabs", className),
|
|
1441
1429
|
style: mergedStyle,
|
|
1442
1430
|
onKeyDown,
|
|
1443
1431
|
...props,
|
|
1444
|
-
children:
|
|
1445
|
-
if (!
|
|
1446
|
-
return
|
|
1432
|
+
children: import_react10.Children.map(children, (child, i) => {
|
|
1433
|
+
if (!import_react10.default.isValidElement(child)) return child;
|
|
1434
|
+
return import_react10.default.cloneElement(child, {
|
|
1447
1435
|
_active: i === activeIndex,
|
|
1448
1436
|
_onClick: () => onChange(i)
|
|
1449
1437
|
});
|
|
@@ -1453,11 +1441,12 @@ var KdsTabs = (0, import_react11.forwardRef)(
|
|
|
1453
1441
|
}
|
|
1454
1442
|
);
|
|
1455
1443
|
KdsTabs.displayName = "KdsTabs";
|
|
1456
|
-
var KdsTab = (0,
|
|
1457
|
-
({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1444
|
+
var KdsTab = (0, import_react10.forwardRef)(
|
|
1445
|
+
({ _active, _onClick, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1458
1446
|
"button",
|
|
1459
1447
|
{
|
|
1460
1448
|
ref,
|
|
1449
|
+
type: "button",
|
|
1461
1450
|
role: "tab",
|
|
1462
1451
|
"aria-selected": _active,
|
|
1463
1452
|
tabIndex: _active ? 0 : -1,
|
|
@@ -1469,8 +1458,8 @@ var KdsTab = (0, import_react11.forwardRef)(
|
|
|
1469
1458
|
)
|
|
1470
1459
|
);
|
|
1471
1460
|
KdsTab.displayName = "KdsTab";
|
|
1472
|
-
var KdsTabPanel = (0,
|
|
1473
|
-
({ active, children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1461
|
+
var KdsTabPanel = (0, import_react10.forwardRef)(
|
|
1462
|
+
({ active, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1474
1463
|
"div",
|
|
1475
1464
|
{
|
|
1476
1465
|
ref,
|
|
@@ -1484,103 +1473,14 @@ var KdsTabPanel = (0, import_react11.forwardRef)(
|
|
|
1484
1473
|
);
|
|
1485
1474
|
KdsTabPanel.displayName = "KdsTabPanel";
|
|
1486
1475
|
|
|
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
1476
|
// src/components/core/KdsRadioGroup/KdsRadioGroup.tsx
|
|
1577
|
-
var
|
|
1578
|
-
var
|
|
1579
|
-
var KdsRadioGroup = (0,
|
|
1580
|
-
({ label, name, options, value, onChange, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1581
|
-
label && /* @__PURE__ */ (0,
|
|
1582
|
-
options.map((opt) => /* @__PURE__ */ (0,
|
|
1583
|
-
/* @__PURE__ */ (0,
|
|
1477
|
+
var import_react11 = require("react");
|
|
1478
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1479
|
+
var KdsRadioGroup = (0, import_react11.forwardRef)(
|
|
1480
|
+
({ label, name, options, value, onChange, size, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("fieldset", { ref, className: (0, import_clsx.clsx)("kds-radio-group", className), ...props, children: [
|
|
1481
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("legend", { children: label }),
|
|
1482
|
+
options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: (0, import_clsx.clsx)("radio", size), children: [
|
|
1483
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1584
1484
|
"input",
|
|
1585
1485
|
{
|
|
1586
1486
|
type: "radio",
|
|
@@ -1591,86 +1491,105 @@ var KdsRadioGroup = (0, import_react13.forwardRef)(
|
|
|
1591
1491
|
onChange: () => onChange?.(opt.value)
|
|
1592
1492
|
}
|
|
1593
1493
|
),
|
|
1594
|
-
/* @__PURE__ */ (0,
|
|
1494
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: opt.label })
|
|
1595
1495
|
] }, opt.value))
|
|
1596
1496
|
] })
|
|
1597
1497
|
);
|
|
1598
1498
|
KdsRadioGroup.displayName = "KdsRadioGroup";
|
|
1599
1499
|
|
|
1600
1500
|
// src/components/core/KdsSelect/KdsSelect.tsx
|
|
1601
|
-
var
|
|
1602
|
-
var
|
|
1603
|
-
var
|
|
1604
|
-
var KdsSelectRoot = (0, import_react14.forwardRef)(
|
|
1501
|
+
var import_react12 = require("react");
|
|
1502
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1503
|
+
var KdsSelect = (0, import_react12.forwardRef)(
|
|
1605
1504
|
({
|
|
1606
|
-
value,
|
|
1607
|
-
onValueChange,
|
|
1608
|
-
placeholder,
|
|
1609
1505
|
label,
|
|
1610
|
-
|
|
1506
|
+
options,
|
|
1507
|
+
placeholder,
|
|
1611
1508
|
helperText,
|
|
1612
|
-
|
|
1509
|
+
error,
|
|
1510
|
+
prefixIcon,
|
|
1613
1511
|
fullWidth = true,
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
className
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1512
|
+
disabled,
|
|
1513
|
+
required,
|
|
1514
|
+
className,
|
|
1515
|
+
id,
|
|
1516
|
+
...props
|
|
1517
|
+
}, ref) => {
|
|
1518
|
+
const fieldId = id || `kds-select-${label.toLowerCase().replace(/\s+/g, "-")}`;
|
|
1519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1520
|
+
"div",
|
|
1521
|
+
{
|
|
1522
|
+
className: (0, import_clsx.clsx)(
|
|
1523
|
+
"field",
|
|
1524
|
+
"label",
|
|
1525
|
+
"border",
|
|
1526
|
+
prefixIcon && "prefix",
|
|
1527
|
+
error && "invalid",
|
|
1528
|
+
fullWidth && "kds-w-full",
|
|
1529
|
+
className
|
|
1530
|
+
),
|
|
1531
|
+
children: [
|
|
1532
|
+
prefixIcon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { className: "material-symbols-outlined", children: prefixIcon }),
|
|
1533
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1534
|
+
"select",
|
|
1535
|
+
{
|
|
1536
|
+
ref,
|
|
1537
|
+
id: fieldId,
|
|
1538
|
+
disabled,
|
|
1539
|
+
required,
|
|
1540
|
+
...props,
|
|
1541
|
+
children: [
|
|
1542
|
+
placeholder !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: placeholder }),
|
|
1543
|
+
options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value))
|
|
1544
|
+
]
|
|
1545
|
+
}
|
|
1546
|
+
),
|
|
1547
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { htmlFor: fieldId, children: [
|
|
1548
|
+
label,
|
|
1549
|
+
required && " *"
|
|
1632
1550
|
] }),
|
|
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
|
-
] })
|
|
1551
|
+
helperText && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "helper", children: helperText })
|
|
1552
|
+
]
|
|
1553
|
+
}
|
|
1554
|
+
);
|
|
1555
|
+
}
|
|
1646
1556
|
);
|
|
1647
|
-
|
|
1648
|
-
var KdsSelect = Object.assign(KdsSelectRoot, {
|
|
1649
|
-
Item: KdsSelectItem
|
|
1650
|
-
});
|
|
1557
|
+
KdsSelect.displayName = "KdsSelect";
|
|
1651
1558
|
|
|
1652
1559
|
// src/components/core/KdsChip/KdsChip.tsx
|
|
1653
|
-
var
|
|
1654
|
-
var
|
|
1655
|
-
var KdsChip = (0,
|
|
1656
|
-
({ color, icon, onDelete, children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1657
|
-
icon && /* @__PURE__ */ (0,
|
|
1658
|
-
children,
|
|
1659
|
-
onDelete && /* @__PURE__ */ (0,
|
|
1560
|
+
var import_react13 = require("react");
|
|
1561
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1562
|
+
var KdsChip = (0, import_react13.forwardRef)(
|
|
1563
|
+
({ color, icon, onDelete, children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { ref, className: (0, import_clsx.clsx)("kds-badge", color, className), ...props, children: [
|
|
1564
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { className: "material-symbols-outlined", children: icon }),
|
|
1565
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children }),
|
|
1566
|
+
onDelete && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1567
|
+
"button",
|
|
1568
|
+
{
|
|
1569
|
+
type: "button",
|
|
1570
|
+
className: "kds-badge-close",
|
|
1571
|
+
onClick: (e) => {
|
|
1572
|
+
e.stopPropagation();
|
|
1573
|
+
onDelete();
|
|
1574
|
+
},
|
|
1575
|
+
"aria-label": "Eliminar",
|
|
1576
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { className: "material-symbols-outlined", children: "close" })
|
|
1577
|
+
}
|
|
1578
|
+
)
|
|
1660
1579
|
] })
|
|
1661
1580
|
);
|
|
1662
1581
|
KdsChip.displayName = "KdsChip";
|
|
1663
1582
|
|
|
1664
1583
|
// src/components/core/KdsSnackbar/KdsSnackbar.tsx
|
|
1665
|
-
var
|
|
1584
|
+
var import_react15 = require("react");
|
|
1666
1585
|
|
|
1667
1586
|
// src/components/core/hooks/useAutoHide.ts
|
|
1668
|
-
var
|
|
1587
|
+
var import_react14 = require("react");
|
|
1669
1588
|
function useAutoHide(durationMs, onHide) {
|
|
1670
|
-
const [visible, setVisible] = (0,
|
|
1671
|
-
const onHideRef = (0,
|
|
1589
|
+
const [visible, setVisible] = (0, import_react14.useState)(true);
|
|
1590
|
+
const onHideRef = (0, import_react14.useRef)(onHide);
|
|
1672
1591
|
onHideRef.current = onHide;
|
|
1673
|
-
(0,
|
|
1592
|
+
(0, import_react14.useEffect)(() => {
|
|
1674
1593
|
if (durationMs <= 0) return;
|
|
1675
1594
|
const timer = setTimeout(() => {
|
|
1676
1595
|
setVisible(false);
|
|
@@ -1682,22 +1601,61 @@ function useAutoHide(durationMs, onHide) {
|
|
|
1682
1601
|
}
|
|
1683
1602
|
|
|
1684
1603
|
// src/components/core/KdsSnackbar/KdsSnackbar.tsx
|
|
1685
|
-
var
|
|
1686
|
-
var
|
|
1687
|
-
|
|
1688
|
-
|
|
1604
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1605
|
+
var DEFAULT_ICONS2 = {
|
|
1606
|
+
info: "info",
|
|
1607
|
+
success: "check_circle",
|
|
1608
|
+
error: "error"
|
|
1609
|
+
};
|
|
1610
|
+
var KdsSnackbar = (0, import_react15.forwardRef)(
|
|
1611
|
+
({
|
|
1612
|
+
message,
|
|
1613
|
+
type = "info",
|
|
1614
|
+
duration = 5e3,
|
|
1615
|
+
onClose,
|
|
1616
|
+
open = true,
|
|
1617
|
+
icon,
|
|
1618
|
+
className,
|
|
1619
|
+
style,
|
|
1620
|
+
...props
|
|
1621
|
+
}, ref) => {
|
|
1622
|
+
const autoDismiss = duration > 0;
|
|
1623
|
+
const { visible } = useAutoHide(autoDismiss ? duration : 0, onClose);
|
|
1689
1624
|
if (!open || !visible) return null;
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1625
|
+
const resolvedIcon = icon === false ? null : icon ?? DEFAULT_ICONS2[type];
|
|
1626
|
+
const mergedStyle = autoDismiss ? { ...style, ["--kds-snackbar-duration"]: `${duration}ms` } : style ?? {};
|
|
1627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1628
|
+
"div",
|
|
1629
|
+
{
|
|
1630
|
+
ref,
|
|
1631
|
+
role: "status",
|
|
1632
|
+
className: (0, import_clsx.clsx)("snackbar", "active", type, className),
|
|
1633
|
+
"data-auto-dismiss": autoDismiss ? "true" : void 0,
|
|
1634
|
+
style: mergedStyle,
|
|
1635
|
+
...props,
|
|
1636
|
+
children: [
|
|
1637
|
+
resolvedIcon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { className: "material-symbols-outlined", children: resolvedIcon }),
|
|
1638
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "max", children: message }),
|
|
1639
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1640
|
+
"button",
|
|
1641
|
+
{
|
|
1642
|
+
type: "button",
|
|
1643
|
+
className: "kds-snackbar-close",
|
|
1644
|
+
onClick: onClose,
|
|
1645
|
+
"aria-label": "Cerrar",
|
|
1646
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { className: "material-symbols-outlined", children: "close" })
|
|
1647
|
+
}
|
|
1648
|
+
)
|
|
1649
|
+
]
|
|
1650
|
+
}
|
|
1651
|
+
);
|
|
1694
1652
|
}
|
|
1695
1653
|
);
|
|
1696
1654
|
KdsSnackbar.displayName = "KdsSnackbar";
|
|
1697
1655
|
|
|
1698
1656
|
// src/components/core/KdsTooltip/KdsTooltip.tsx
|
|
1699
1657
|
var Tooltip = __toESM(require("@radix-ui/react-tooltip"));
|
|
1700
|
-
var
|
|
1658
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1701
1659
|
function KdsTooltip({
|
|
1702
1660
|
content,
|
|
1703
1661
|
children,
|
|
@@ -1708,86 +1666,102 @@ function KdsTooltip({
|
|
|
1708
1666
|
onOpenChange,
|
|
1709
1667
|
delayDuration = 300
|
|
1710
1668
|
}) {
|
|
1711
|
-
return /* @__PURE__ */ (0,
|
|
1712
|
-
/* @__PURE__ */ (0,
|
|
1713
|
-
/* @__PURE__ */ (0,
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Tooltip.Provider, { delayDuration, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Tooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
1670
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Tooltip.Trigger, { asChild: true, children }),
|
|
1671
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1672
|
+
Tooltip.Content,
|
|
1673
|
+
{
|
|
1674
|
+
className: (0, import_clsx.clsx)("kds-tooltip", className),
|
|
1675
|
+
side: placement,
|
|
1676
|
+
sideOffset: 6,
|
|
1677
|
+
collisionPadding: 8,
|
|
1678
|
+
children: [
|
|
1679
|
+
content,
|
|
1680
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Tooltip.Arrow, { className: "kds-tooltip-arrow", width: 10, height: 5 })
|
|
1681
|
+
]
|
|
1682
|
+
}
|
|
1683
|
+
) })
|
|
1717
1684
|
] }) });
|
|
1718
1685
|
}
|
|
1719
1686
|
|
|
1720
1687
|
// src/components/core/KdsAccordion/KdsAccordion.tsx
|
|
1721
|
-
var
|
|
1722
|
-
var
|
|
1723
|
-
var KdsAccordion = (0,
|
|
1724
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1688
|
+
var import_react16 = require("react");
|
|
1689
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1690
|
+
var KdsAccordion = (0, import_react16.forwardRef)(
|
|
1691
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("details", { ref, className: (0, import_clsx.clsx)("kds-accordion", className), ...props, children })
|
|
1725
1692
|
);
|
|
1726
1693
|
KdsAccordion.displayName = "KdsAccordion";
|
|
1727
|
-
var KdsAccordionSummary = (0,
|
|
1728
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1694
|
+
var KdsAccordionSummary = (0, import_react16.forwardRef)(
|
|
1695
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("summary", { ref, className: (0, import_clsx.clsx)("kds-accordion-summary", className), ...props, children: [
|
|
1729
1696
|
children,
|
|
1730
|
-
/* @__PURE__ */ (0,
|
|
1697
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", { className: "material-symbols-outlined", children: "expand_more" })
|
|
1731
1698
|
] })
|
|
1732
1699
|
);
|
|
1733
1700
|
KdsAccordionSummary.displayName = "KdsAccordionSummary";
|
|
1734
|
-
var KdsAccordionDetails = (0,
|
|
1735
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1701
|
+
var KdsAccordionDetails = (0, import_react16.forwardRef)(
|
|
1702
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-accordion-details", className), ...props, children })
|
|
1736
1703
|
);
|
|
1737
1704
|
KdsAccordionDetails.displayName = "KdsAccordionDetails";
|
|
1738
1705
|
|
|
1739
1706
|
// src/components/core/KdsDivider/KdsDivider.tsx
|
|
1740
|
-
var
|
|
1741
|
-
var
|
|
1742
|
-
var KdsDivider = (0,
|
|
1743
|
-
({ dashed, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1707
|
+
var import_react17 = require("react");
|
|
1708
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1709
|
+
var KdsDivider = (0, import_react17.forwardRef)(
|
|
1710
|
+
({ dashed, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("hr", { ref, className: (0, import_clsx.clsx)(dashed ? "kds-hr-dashed" : "kds-hr", className), ...props })
|
|
1744
1711
|
);
|
|
1745
1712
|
KdsDivider.displayName = "KdsDivider";
|
|
1746
1713
|
|
|
1747
1714
|
// src/components/core/KdsSectionNote/KdsSectionNote.tsx
|
|
1748
|
-
var
|
|
1749
|
-
var
|
|
1750
|
-
var KdsSectionNote = (0,
|
|
1751
|
-
({ icon = "info", children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1752
|
-
/* @__PURE__ */ (0,
|
|
1753
|
-
/* @__PURE__ */ (0,
|
|
1715
|
+
var import_react18 = require("react");
|
|
1716
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1717
|
+
var KdsSectionNote = (0, import_react18.forwardRef)(
|
|
1718
|
+
({ icon = "info", children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { ref, className: (0, import_clsx.clsx)("kds-section-note", className), ...props, children: [
|
|
1719
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", { className: "material-symbols-outlined", children: icon }),
|
|
1720
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children })
|
|
1754
1721
|
] })
|
|
1755
1722
|
);
|
|
1756
1723
|
KdsSectionNote.displayName = "KdsSectionNote";
|
|
1757
1724
|
|
|
1758
1725
|
// src/components/core/KdsStatusBlock/KdsStatusBlock.tsx
|
|
1759
|
-
var
|
|
1760
|
-
var
|
|
1761
|
-
var KdsStatusBlock = (0,
|
|
1762
|
-
({ status, icon, title, description, inline, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1763
|
-
/* @__PURE__ */ (0,
|
|
1764
|
-
/* @__PURE__ */ (0,
|
|
1765
|
-
/* @__PURE__ */ (0,
|
|
1766
|
-
description && /* @__PURE__ */ (0,
|
|
1726
|
+
var import_react19 = require("react");
|
|
1727
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1728
|
+
var KdsStatusBlock = (0, import_react19.forwardRef)(
|
|
1729
|
+
({ status, icon, title, description, inline, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-status-block", inline && "inline", className), "data-status": status, ...props, children: [
|
|
1730
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "kds-status-block-icon", children: icon && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
|
|
1731
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
1732
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { className: "kds-status-block-title", children: title }),
|
|
1733
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "kds-status-block-description", children: description })
|
|
1767
1734
|
] })
|
|
1768
1735
|
] })
|
|
1769
1736
|
);
|
|
1770
1737
|
KdsStatusBlock.displayName = "KdsStatusBlock";
|
|
1771
1738
|
|
|
1772
1739
|
// src/components/core/KdsStepper/KdsStepper.tsx
|
|
1773
|
-
var
|
|
1774
|
-
var
|
|
1775
|
-
var KdsStepper = (0,
|
|
1776
|
-
({ steps, current, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1740
|
+
var import_react20 = require("react");
|
|
1741
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1742
|
+
var KdsStepper = (0, import_react20.forwardRef)(
|
|
1743
|
+
({ steps, current, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-stepper", className), ...props, children: steps.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1744
|
+
"div",
|
|
1745
|
+
{
|
|
1746
|
+
className: (0, import_clsx.clsx)("kds-step", i < current && "completed", i === current && "current"),
|
|
1747
|
+
children: [
|
|
1748
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "kds-step-indicator" }),
|
|
1749
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "kds-step-label", children: label })
|
|
1750
|
+
]
|
|
1751
|
+
},
|
|
1752
|
+
`${i}-${label}`
|
|
1753
|
+
)) })
|
|
1780
1754
|
);
|
|
1781
1755
|
KdsStepper.displayName = "KdsStepper";
|
|
1782
1756
|
|
|
1783
1757
|
// src/components/core/KdsCopyRow/KdsCopyRow.tsx
|
|
1784
|
-
var
|
|
1758
|
+
var import_react22 = require("react");
|
|
1785
1759
|
|
|
1786
1760
|
// src/components/core/hooks/useCopyToClipboard.ts
|
|
1787
|
-
var
|
|
1761
|
+
var import_react21 = require("react");
|
|
1788
1762
|
function useCopyToClipboard(resetMs = 1200) {
|
|
1789
|
-
const [copied, setCopied] = (0,
|
|
1790
|
-
const copy = (0,
|
|
1763
|
+
const [copied, setCopied] = (0, import_react21.useState)(false);
|
|
1764
|
+
const copy = (0, import_react21.useCallback)(
|
|
1791
1765
|
async (text) => {
|
|
1792
1766
|
try {
|
|
1793
1767
|
await navigator.clipboard.writeText(text);
|
|
@@ -1802,73 +1776,218 @@ function useCopyToClipboard(resetMs = 1200) {
|
|
|
1802
1776
|
}
|
|
1803
1777
|
|
|
1804
1778
|
// src/components/core/KdsCopyRow/KdsCopyRow.tsx
|
|
1805
|
-
var
|
|
1806
|
-
var KdsCopyRow = (0,
|
|
1807
|
-
({ label, value, className, ...props }, ref) => {
|
|
1779
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1780
|
+
var KdsCopyRow = (0, import_react22.forwardRef)(
|
|
1781
|
+
({ label, value, copiedText = "Copiado", className, ...props }, ref) => {
|
|
1808
1782
|
const { copied, copy } = useCopyToClipboard();
|
|
1809
|
-
return /* @__PURE__ */ (0,
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1784
|
+
"button",
|
|
1785
|
+
{
|
|
1786
|
+
ref,
|
|
1787
|
+
type: "button",
|
|
1788
|
+
className: (0, import_clsx.clsx)("kds-copy-row", copied && "copied", className),
|
|
1789
|
+
"data-copy": value,
|
|
1790
|
+
onClick: () => copy(value),
|
|
1791
|
+
"aria-label": `Copiar ${label}: ${value}`,
|
|
1792
|
+
...props,
|
|
1793
|
+
children: [
|
|
1794
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: "content_copy" }),
|
|
1795
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
1796
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "kds-copy-row-label", children: label }),
|
|
1797
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "kds-copy-row-value", children: value })
|
|
1798
|
+
] }),
|
|
1799
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "kds-copy-toast", "aria-hidden": "true", children: [
|
|
1800
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", { className: "material-symbols-outlined", children: "check_circle" }),
|
|
1801
|
+
" ",
|
|
1802
|
+
copiedText
|
|
1803
|
+
] })
|
|
1804
|
+
]
|
|
1805
|
+
}
|
|
1806
|
+
);
|
|
1814
1807
|
}
|
|
1815
1808
|
);
|
|
1816
1809
|
KdsCopyRow.displayName = "KdsCopyRow";
|
|
1817
1810
|
|
|
1818
1811
|
// src/components/core/KdsCopyableTable/KdsCopyableTable.tsx
|
|
1819
|
-
var
|
|
1820
|
-
var
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1812
|
+
var import_react23 = require("react");
|
|
1813
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1814
|
+
async function copyToClipboard(text) {
|
|
1815
|
+
try {
|
|
1816
|
+
if (navigator.clipboard?.writeText) {
|
|
1817
|
+
await navigator.clipboard.writeText(text);
|
|
1818
|
+
return true;
|
|
1819
|
+
}
|
|
1820
|
+
} catch {
|
|
1821
|
+
}
|
|
1822
|
+
const ta = document.createElement("textarea");
|
|
1823
|
+
ta.value = text;
|
|
1824
|
+
ta.style.position = "fixed";
|
|
1825
|
+
ta.style.opacity = "0";
|
|
1826
|
+
document.body.appendChild(ta);
|
|
1827
|
+
ta.select();
|
|
1828
|
+
try {
|
|
1829
|
+
document.execCommand("copy");
|
|
1830
|
+
return true;
|
|
1831
|
+
} catch {
|
|
1832
|
+
return false;
|
|
1833
|
+
} finally {
|
|
1834
|
+
document.body.removeChild(ta);
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
var TRANSITION_MS = 300;
|
|
1838
|
+
var KdsCopyableTable = (0, import_react23.forwardRef)(
|
|
1839
|
+
({
|
|
1840
|
+
rows,
|
|
1841
|
+
copyAllLabel = "Copiar todos los datos",
|
|
1842
|
+
copiedAllLabel = "Datos copiados",
|
|
1843
|
+
showCopyAll = true,
|
|
1844
|
+
className,
|
|
1845
|
+
...props
|
|
1846
|
+
}, ref) => {
|
|
1847
|
+
const copiedTimers = (0, import_react23.useRef)(/* @__PURE__ */ new Map());
|
|
1848
|
+
const settlingTimers = (0, import_react23.useRef)(/* @__PURE__ */ new Map());
|
|
1849
|
+
const [copiedRows, setCopiedRows] = (0, import_react23.useState)(/* @__PURE__ */ new Set());
|
|
1850
|
+
const [settlingRows, setSettlingRows] = (0, import_react23.useState)(/* @__PURE__ */ new Set());
|
|
1851
|
+
const [allCopied, setAllCopied] = (0, import_react23.useState)(false);
|
|
1852
|
+
const markCopied = (0, import_react23.useCallback)((indexes, duration = 1500) => {
|
|
1853
|
+
setCopiedRows((prev) => {
|
|
1854
|
+
const next = new Set(prev);
|
|
1855
|
+
indexes.forEach((i) => next.add(i));
|
|
1856
|
+
return next;
|
|
1857
|
+
});
|
|
1858
|
+
indexes.forEach((i) => {
|
|
1859
|
+
const st = settlingTimers.current.get(i);
|
|
1860
|
+
if (st) {
|
|
1861
|
+
clearTimeout(st);
|
|
1862
|
+
settlingTimers.current.delete(i);
|
|
1863
|
+
}
|
|
1864
|
+
});
|
|
1865
|
+
setSettlingRows((prev) => {
|
|
1866
|
+
const next = new Set(prev);
|
|
1867
|
+
indexes.forEach((i) => next.delete(i));
|
|
1868
|
+
return next;
|
|
1869
|
+
});
|
|
1870
|
+
indexes.forEach((i) => {
|
|
1871
|
+
const existing = copiedTimers.current.get(i);
|
|
1872
|
+
if (existing) clearTimeout(existing);
|
|
1873
|
+
const t = setTimeout(() => {
|
|
1874
|
+
setCopiedRows((prev) => {
|
|
1875
|
+
const next = new Set(prev);
|
|
1876
|
+
next.delete(i);
|
|
1877
|
+
return next;
|
|
1878
|
+
});
|
|
1879
|
+
setSettlingRows((prev) => {
|
|
1880
|
+
const next = new Set(prev);
|
|
1881
|
+
next.add(i);
|
|
1882
|
+
return next;
|
|
1883
|
+
});
|
|
1884
|
+
copiedTimers.current.delete(i);
|
|
1885
|
+
const settlingT = setTimeout(() => {
|
|
1886
|
+
setSettlingRows((prev) => {
|
|
1887
|
+
const next = new Set(prev);
|
|
1888
|
+
next.delete(i);
|
|
1889
|
+
return next;
|
|
1890
|
+
});
|
|
1891
|
+
settlingTimers.current.delete(i);
|
|
1892
|
+
}, TRANSITION_MS);
|
|
1893
|
+
settlingTimers.current.set(i, settlingT);
|
|
1894
|
+
}, duration);
|
|
1895
|
+
copiedTimers.current.set(i, t);
|
|
1896
|
+
});
|
|
1897
|
+
}, []);
|
|
1898
|
+
const handleRowCopy = async (row, index) => {
|
|
1899
|
+
const ok = await copyToClipboard(row.copy ?? row.value);
|
|
1900
|
+
if (ok) markCopied([index]);
|
|
1901
|
+
};
|
|
1902
|
+
const handleCopyAll = async () => {
|
|
1825
1903
|
const text = rows.map((r) => `${r.label}: ${r.value}`).join("\n");
|
|
1826
|
-
|
|
1904
|
+
const ok = await copyToClipboard(text);
|
|
1905
|
+
if (ok) {
|
|
1906
|
+
markCopied(rows.map((_, i) => i));
|
|
1907
|
+
setAllCopied(true);
|
|
1908
|
+
setTimeout(() => setAllCopied(false), 2e3);
|
|
1909
|
+
}
|
|
1827
1910
|
};
|
|
1828
|
-
return /* @__PURE__ */ (0,
|
|
1829
|
-
/* @__PURE__ */ (0,
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
1912
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-copyable-table", className), ...props, children: rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1913
|
+
"div",
|
|
1914
|
+
{
|
|
1915
|
+
className: (0, import_clsx.clsx)(
|
|
1916
|
+
"kds-copyable-table-row",
|
|
1917
|
+
copiedRows.has(i) && "copied",
|
|
1918
|
+
settlingRows.has(i) && "settling"
|
|
1919
|
+
),
|
|
1920
|
+
role: "button",
|
|
1921
|
+
tabIndex: 0,
|
|
1922
|
+
onClick: () => handleRowCopy(row, i),
|
|
1923
|
+
onKeyDown: (e) => {
|
|
1924
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1925
|
+
e.preventDefault();
|
|
1926
|
+
handleRowCopy(row, i);
|
|
1927
|
+
}
|
|
1928
|
+
},
|
|
1929
|
+
"aria-label": `Copiar ${row.label}: ${row.value}`,
|
|
1930
|
+
children: [
|
|
1931
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "kds-key", children: row.label }),
|
|
1932
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "kds-value", children: row.value })
|
|
1933
|
+
]
|
|
1934
|
+
},
|
|
1935
|
+
`${row.label}-${i}`
|
|
1936
|
+
)) }),
|
|
1937
|
+
showCopyAll && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1938
|
+
"button",
|
|
1939
|
+
{
|
|
1940
|
+
type: "button",
|
|
1941
|
+
className: (0, import_clsx.clsx)(
|
|
1942
|
+
"kds-btn",
|
|
1943
|
+
"kds-btn-outlined",
|
|
1944
|
+
"kds-btn-block",
|
|
1945
|
+
"kds-copy-all-btn",
|
|
1946
|
+
allCopied && "copied"
|
|
1947
|
+
),
|
|
1948
|
+
onClick: handleCopyAll,
|
|
1949
|
+
"aria-label": allCopied ? copiedAllLabel : copyAllLabel,
|
|
1950
|
+
children: [
|
|
1951
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "kds-icon", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("i", { className: "material-symbols-outlined", children: allCopied ? "check" : "content_copy" }) }),
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: allCopied ? copiedAllLabel : copyAllLabel })
|
|
1953
|
+
]
|
|
1954
|
+
}
|
|
1955
|
+
)
|
|
1837
1956
|
] });
|
|
1838
1957
|
}
|
|
1839
1958
|
);
|
|
1840
1959
|
KdsCopyableTable.displayName = "KdsCopyableTable";
|
|
1841
1960
|
|
|
1842
1961
|
// src/components/core/KdsExpandPanel/KdsExpandPanel.tsx
|
|
1843
|
-
var
|
|
1844
|
-
var
|
|
1845
|
-
var KdsExpandPanel = (0,
|
|
1962
|
+
var import_react24 = require("react");
|
|
1963
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1964
|
+
var KdsExpandPanel = (0, import_react24.forwardRef)(
|
|
1846
1965
|
({ label, defaultExpanded = false, children, className, ...props }, ref) => {
|
|
1847
|
-
const [expanded, setExpanded] = (0,
|
|
1848
|
-
return /* @__PURE__ */ (0,
|
|
1849
|
-
/* @__PURE__ */ (0,
|
|
1966
|
+
const [expanded, setExpanded] = (0, import_react24.useState)(defaultExpanded);
|
|
1967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { ref, className, ...props, children: [
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1850
1969
|
"button",
|
|
1851
1970
|
{
|
|
1852
1971
|
className: "kds-expand-toggle",
|
|
1853
1972
|
onClick: () => setExpanded((v) => !v),
|
|
1854
1973
|
"aria-expanded": expanded,
|
|
1855
1974
|
children: [
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1857
|
-
/* @__PURE__ */ (0,
|
|
1975
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: label }),
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("i", { className: "material-symbols-outlined", children: expanded ? "expand_less" : "expand_more" })
|
|
1858
1977
|
]
|
|
1859
1978
|
}
|
|
1860
1979
|
),
|
|
1861
|
-
/* @__PURE__ */ (0,
|
|
1980
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: (0, import_clsx.clsx)("kds-expand-panel", expanded && "open"), hidden: !expanded, children })
|
|
1862
1981
|
] });
|
|
1863
1982
|
}
|
|
1864
1983
|
);
|
|
1865
1984
|
KdsExpandPanel.displayName = "KdsExpandPanel";
|
|
1866
1985
|
|
|
1867
1986
|
// src/components/core/KdsCountdown/KdsCountdown.tsx
|
|
1868
|
-
var
|
|
1987
|
+
var import_react26 = require("react");
|
|
1869
1988
|
|
|
1870
1989
|
// src/components/core/hooks/useCountdown.ts
|
|
1871
|
-
var
|
|
1990
|
+
var import_react25 = require("react");
|
|
1872
1991
|
function calcRemaining(deadline) {
|
|
1873
1992
|
const diff = Math.max(0, new Date(deadline).getTime() - Date.now());
|
|
1874
1993
|
const totalSeconds = Math.floor(diff / 1e3);
|
|
@@ -1881,8 +2000,8 @@ function calcRemaining(deadline) {
|
|
|
1881
2000
|
};
|
|
1882
2001
|
}
|
|
1883
2002
|
function useCountdown(deadline) {
|
|
1884
|
-
const [state, setState] = (0,
|
|
1885
|
-
(0,
|
|
2003
|
+
const [state, setState] = (0, import_react25.useState)(() => calcRemaining(deadline));
|
|
2004
|
+
(0, import_react25.useEffect)(() => {
|
|
1886
2005
|
const tick = () => setState(calcRemaining(deadline));
|
|
1887
2006
|
const id = setInterval(tick, 1e3);
|
|
1888
2007
|
return () => clearInterval(id);
|
|
@@ -1891,13 +2010,13 @@ function useCountdown(deadline) {
|
|
|
1891
2010
|
}
|
|
1892
2011
|
|
|
1893
2012
|
// src/components/core/KdsCountdown/KdsCountdown.tsx
|
|
1894
|
-
var
|
|
1895
|
-
var KdsCountdown = (0,
|
|
2013
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2014
|
+
var KdsCountdown = (0, import_react26.forwardRef)(
|
|
1896
2015
|
({ deadline, label, onExpire, className, ...props }, ref) => {
|
|
1897
2016
|
const { hours, minutes, seconds, expired, urgent } = useCountdown(deadline);
|
|
1898
|
-
const onExpireRef = (0,
|
|
2017
|
+
const onExpireRef = (0, import_react26.useRef)(onExpire);
|
|
1899
2018
|
onExpireRef.current = onExpire;
|
|
1900
|
-
(0,
|
|
2019
|
+
(0, import_react26.useEffect)(() => {
|
|
1901
2020
|
if (expired) {
|
|
1902
2021
|
onExpireRef.current?.();
|
|
1903
2022
|
}
|
|
@@ -1906,9 +2025,9 @@ var KdsCountdown = (0, import_react28.forwardRef)(
|
|
|
1906
2025
|
return null;
|
|
1907
2026
|
}
|
|
1908
2027
|
const pad = (n) => String(n).padStart(2, "0");
|
|
1909
|
-
return /* @__PURE__ */ (0,
|
|
1910
|
-
label && /* @__PURE__ */ (0,
|
|
1911
|
-
/* @__PURE__ */ (0,
|
|
2028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-countdown", urgent && "urgent", className), ...props, children: [
|
|
2029
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "kds-countdown-label", children: label }),
|
|
2030
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "kds-countdown-value", children: [
|
|
1912
2031
|
pad(hours),
|
|
1913
2032
|
":",
|
|
1914
2033
|
pad(minutes),
|
|
@@ -1921,18 +2040,18 @@ var KdsCountdown = (0, import_react28.forwardRef)(
|
|
|
1921
2040
|
KdsCountdown.displayName = "KdsCountdown";
|
|
1922
2041
|
|
|
1923
2042
|
// src/components/core/KdsSegmentedTabs/KdsSegmentedTabs.tsx
|
|
1924
|
-
var
|
|
1925
|
-
var
|
|
1926
|
-
var KdsSegmentedTabs = (0,
|
|
1927
|
-
(props, ref) => /* @__PURE__ */ (0,
|
|
2043
|
+
var import_react27 = require("react");
|
|
2044
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2045
|
+
var KdsSegmentedTabs = (0, import_react27.forwardRef)(
|
|
2046
|
+
(props, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(KdsTabs, { ref, ...props })
|
|
1928
2047
|
);
|
|
1929
2048
|
KdsSegmentedTabs.displayName = "KdsSegmentedTabs";
|
|
1930
2049
|
|
|
1931
2050
|
// src/components/domain/KdsBankRow/KdsBankRow.tsx
|
|
1932
|
-
var
|
|
1933
|
-
var
|
|
1934
|
-
var KdsBankRow = (0,
|
|
1935
|
-
({ name, logoUrl, selected, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2051
|
+
var import_react28 = require("react");
|
|
2052
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2053
|
+
var KdsBankRow = (0, import_react28.forwardRef)(
|
|
2054
|
+
({ name, logoUrl, selected, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1936
2055
|
"button",
|
|
1937
2056
|
{
|
|
1938
2057
|
ref,
|
|
@@ -1940,9 +2059,9 @@ var KdsBankRow = (0, import_react30.forwardRef)(
|
|
|
1940
2059
|
className: (0, import_clsx.clsx)("kds-bank-row", selected && "selected", className),
|
|
1941
2060
|
...props,
|
|
1942
2061
|
children: [
|
|
1943
|
-
/* @__PURE__ */ (0,
|
|
1944
|
-
/* @__PURE__ */ (0,
|
|
1945
|
-
/* @__PURE__ */ (0,
|
|
2062
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "kds-bank-row-logo", children: logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("img", { src: logoUrl, alt: name }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "initials", children: name.charAt(0) }) }),
|
|
2063
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "kds-bank-row-name", children: name }),
|
|
2064
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("i", { className: "material-symbols-outlined", children: selected ? "check_circle" : "chevron_right" })
|
|
1946
2065
|
]
|
|
1947
2066
|
}
|
|
1948
2067
|
)
|
|
@@ -1950,32 +2069,32 @@ var KdsBankRow = (0, import_react30.forwardRef)(
|
|
|
1950
2069
|
KdsBankRow.displayName = "KdsBankRow";
|
|
1951
2070
|
|
|
1952
2071
|
// src/components/domain/KdsBankList/KdsBankList.tsx
|
|
1953
|
-
var
|
|
1954
|
-
var
|
|
1955
|
-
var KdsBankList = (0,
|
|
1956
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2072
|
+
var import_react29 = require("react");
|
|
2073
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2074
|
+
var KdsBankList = (0, import_react29.forwardRef)(
|
|
2075
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-bank-list", className), role: "list", ...props, children })
|
|
1957
2076
|
);
|
|
1958
2077
|
KdsBankList.displayName = "KdsBankList";
|
|
1959
2078
|
|
|
1960
2079
|
// src/components/domain/KdsBankModal/KdsBankModal.tsx
|
|
1961
|
-
var
|
|
1962
|
-
var
|
|
1963
|
-
var
|
|
1964
|
-
var KdsBankModal = (0,
|
|
2080
|
+
var import_react30 = require("react");
|
|
2081
|
+
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
2082
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2083
|
+
var KdsBankModal = (0, import_react30.forwardRef)(
|
|
1965
2084
|
({ open, onClose, title = "Selecciona tu banco", searchPlaceholder = "Buscar banco...", onSearch, children, className, container }, ref) => {
|
|
1966
|
-
const [query, setQuery] = (0,
|
|
2085
|
+
const [query, setQuery] = (0, import_react30.useState)("");
|
|
1967
2086
|
const handleSearch = (value) => {
|
|
1968
2087
|
setQuery(value);
|
|
1969
2088
|
onSearch?.(value);
|
|
1970
2089
|
};
|
|
1971
|
-
return /* @__PURE__ */ (0,
|
|
2090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Dialog.Root, { open, onOpenChange: (o) => {
|
|
1972
2091
|
if (!o) onClose();
|
|
1973
|
-
}, children: /* @__PURE__ */ (0,
|
|
1974
|
-
/* @__PURE__ */ (0,
|
|
1975
|
-
/* @__PURE__ */ (0,
|
|
1976
|
-
/* @__PURE__ */ (0,
|
|
2092
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Dialog.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Dialog.Overlay, { className: "kds-bank-modal-scrim open", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Dialog.Content, { ref, className: (0, import_clsx.clsx)("kds-bank-modal", className), children: [
|
|
2093
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "kds-bank-modal-header", children: [
|
|
2094
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Dialog.Title, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h3", { children: title }) }),
|
|
2095
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { className: "kds-bank-modal-close", "aria-label": "Cerrar", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("i", { className: "material-symbols-outlined", children: "close" }) }) })
|
|
1977
2096
|
] }),
|
|
1978
|
-
/* @__PURE__ */ (0,
|
|
2097
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "kds-bank-modal-search", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1979
2098
|
"input",
|
|
1980
2099
|
{
|
|
1981
2100
|
type: "text",
|
|
@@ -1984,33 +2103,33 @@ var KdsBankModal = (0, import_react32.forwardRef)(
|
|
|
1984
2103
|
onChange: (e) => handleSearch(e.target.value)
|
|
1985
2104
|
}
|
|
1986
2105
|
) }),
|
|
1987
|
-
/* @__PURE__ */ (0,
|
|
2106
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "kds-bank-modal-body", children })
|
|
1988
2107
|
] }) }) }) });
|
|
1989
2108
|
}
|
|
1990
2109
|
);
|
|
1991
2110
|
KdsBankModal.displayName = "KdsBankModal";
|
|
1992
2111
|
|
|
1993
2112
|
// src/components/domain/KdsQrRow/KdsQrRow.tsx
|
|
1994
|
-
var
|
|
1995
|
-
var
|
|
1996
|
-
var KdsQrRow = (0,
|
|
1997
|
-
({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1998
|
-
/* @__PURE__ */ (0,
|
|
1999
|
-
/* @__PURE__ */ (0,
|
|
2000
|
-
/* @__PURE__ */ (0,
|
|
2001
|
-
description && /* @__PURE__ */ (0,
|
|
2113
|
+
var import_react31 = require("react");
|
|
2114
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2115
|
+
var KdsQrRow = (0, import_react31.forwardRef)(
|
|
2116
|
+
({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { ref, type: "button", className: (0, import_clsx.clsx)("kds-qr-row", className), ...props, children: [
|
|
2117
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "kds-qr-avatar", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
|
|
2118
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "kds-qr-text", children: [
|
|
2119
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "kds-qr-title", children: name }),
|
|
2120
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "kds-qr-subtitle", children: description })
|
|
2002
2121
|
] }),
|
|
2003
|
-
badge && /* @__PURE__ */ (0,
|
|
2004
|
-
/* @__PURE__ */ (0,
|
|
2122
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "kds-qr-badge", children: badge }),
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("i", { className: "material-symbols-outlined", children: "chevron_right" })
|
|
2005
2124
|
] })
|
|
2006
2125
|
);
|
|
2007
2126
|
KdsQrRow.displayName = "KdsQrRow";
|
|
2008
2127
|
|
|
2009
2128
|
// src/components/domain/KdsCardSelector/KdsCardSelector.tsx
|
|
2010
|
-
var
|
|
2011
|
-
var
|
|
2012
|
-
var KdsCardSelector = (0,
|
|
2013
|
-
({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2129
|
+
var import_react32 = require("react");
|
|
2130
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2131
|
+
var KdsCardSelector = (0, import_react32.forwardRef)(
|
|
2132
|
+
({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
2014
2133
|
"button",
|
|
2015
2134
|
{
|
|
2016
2135
|
ref,
|
|
@@ -2018,9 +2137,9 @@ var KdsCardSelector = (0, import_react34.forwardRef)(
|
|
|
2018
2137
|
className: (0, import_clsx.clsx)("kds-card-selector", selected && "selected", className),
|
|
2019
2138
|
...props,
|
|
2020
2139
|
children: [
|
|
2021
|
-
icon && /* @__PURE__ */ (0,
|
|
2022
|
-
/* @__PURE__ */ (0,
|
|
2023
|
-
description && /* @__PURE__ */ (0,
|
|
2140
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "kds-card-selector-icon", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { className: "material-symbols-outlined", children: icon }) }),
|
|
2141
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "kds-card-selector-title", children: title }),
|
|
2142
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "kds-card-selector-description", children: description })
|
|
2024
2143
|
]
|
|
2025
2144
|
}
|
|
2026
2145
|
)
|
|
@@ -2028,26 +2147,26 @@ var KdsCardSelector = (0, import_react34.forwardRef)(
|
|
|
2028
2147
|
KdsCardSelector.displayName = "KdsCardSelector";
|
|
2029
2148
|
|
|
2030
2149
|
// src/components/domain/KdsCardPlan/KdsCardPlan.tsx
|
|
2031
|
-
var
|
|
2032
|
-
var
|
|
2033
|
-
var KdsCardPlan = (0,
|
|
2034
|
-
({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2150
|
+
var import_react33 = require("react");
|
|
2151
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2152
|
+
var KdsCardPlan = (0, import_react33.forwardRef)(
|
|
2153
|
+
({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2035
2154
|
"div",
|
|
2036
2155
|
{
|
|
2037
2156
|
ref,
|
|
2038
2157
|
className: (0, import_clsx.clsx)("kds-card-plan", recommended && "recommended", className),
|
|
2039
2158
|
...props,
|
|
2040
2159
|
children: [
|
|
2041
|
-
|
|
2042
|
-
/* @__PURE__ */ (0,
|
|
2043
|
-
|
|
2044
|
-
/* @__PURE__ */ (0,
|
|
2045
|
-
period && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
|
|
2160
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "kds-card-plan-header", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h3", { children: title }) }),
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "kds-card-plan-price", children: [
|
|
2162
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "kds-price", children: price }),
|
|
2163
|
+
period && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "kds-price-period", children: [
|
|
2046
2164
|
"/",
|
|
2047
2165
|
period
|
|
2048
2166
|
] })
|
|
2049
2167
|
] }),
|
|
2050
|
-
|
|
2168
|
+
badgeText && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "kds-card-plan-badge", children: badgeText }),
|
|
2169
|
+
features && features.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("ul", { className: "kds-card-plan-features", children: features.map((f, i) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { children: f }, i)) }),
|
|
2051
2170
|
action
|
|
2052
2171
|
]
|
|
2053
2172
|
}
|
|
@@ -2056,50 +2175,225 @@ var KdsCardPlan = (0, import_react35.forwardRef)(
|
|
|
2056
2175
|
KdsCardPlan.displayName = "KdsCardPlan";
|
|
2057
2176
|
|
|
2058
2177
|
// src/components/domain/KdsInvoiceSticky/KdsInvoiceSticky.tsx
|
|
2059
|
-
var
|
|
2060
|
-
var
|
|
2061
|
-
var KdsInvoiceSticky = (0,
|
|
2062
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2178
|
+
var import_react34 = require("react");
|
|
2179
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2180
|
+
var KdsInvoiceSticky = (0, import_react34.forwardRef)(
|
|
2181
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-card-elevated", "kds-invoice-sticky", className), ...props, children })
|
|
2063
2182
|
);
|
|
2064
2183
|
KdsInvoiceSticky.displayName = "KdsInvoiceSticky";
|
|
2065
2184
|
|
|
2066
2185
|
// src/components/domain/KdsBottomSheet/KdsBottomSheet.tsx
|
|
2067
|
-
var
|
|
2068
|
-
var
|
|
2069
|
-
var
|
|
2070
|
-
var KdsBottomSheet = (0,
|
|
2071
|
-
({
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
actions
|
|
2078
|
-
|
|
2186
|
+
var import_react35 = require("react");
|
|
2187
|
+
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
2188
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2189
|
+
var KdsBottomSheet = (0, import_react35.forwardRef)(
|
|
2190
|
+
({
|
|
2191
|
+
open,
|
|
2192
|
+
onClose,
|
|
2193
|
+
title,
|
|
2194
|
+
description,
|
|
2195
|
+
children,
|
|
2196
|
+
actions,
|
|
2197
|
+
showGrabber = true,
|
|
2198
|
+
showCloseButton = false,
|
|
2199
|
+
container,
|
|
2200
|
+
className
|
|
2201
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2202
|
+
Dialog2.Root,
|
|
2203
|
+
{
|
|
2204
|
+
open,
|
|
2205
|
+
onOpenChange: (o) => {
|
|
2206
|
+
if (!o) onClose();
|
|
2207
|
+
},
|
|
2208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Dialog2.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Dialog2.Overlay, { className: "kds-bottom-sheet-scrim open", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2209
|
+
Dialog2.Content,
|
|
2210
|
+
{
|
|
2211
|
+
ref,
|
|
2212
|
+
className: (0, import_clsx.clsx)("kds-bottom-sheet", className),
|
|
2213
|
+
onPointerDownOutside: (e) => {
|
|
2214
|
+
const target = e.target;
|
|
2215
|
+
if (target.closest(".kds-bottom-sheet")) e.preventDefault();
|
|
2216
|
+
},
|
|
2217
|
+
children: [
|
|
2218
|
+
showGrabber && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "kds-bottom-sheet-grabber", "aria-hidden": "true" }),
|
|
2219
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2220
|
+
"button",
|
|
2221
|
+
{
|
|
2222
|
+
type: "button",
|
|
2223
|
+
className: "kds-bottom-sheet-close",
|
|
2224
|
+
"aria-label": "Cerrar",
|
|
2225
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", { className: "material-symbols-outlined", children: "close" })
|
|
2226
|
+
}
|
|
2227
|
+
) }),
|
|
2228
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Dialog2.Title, { className: "kds-bottom-sheet-title", children: title }),
|
|
2229
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Dialog2.Description, { className: "kds-bottom-sheet-description", children: description }),
|
|
2230
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "kds-bottom-sheet-body", children }),
|
|
2231
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "kds-bottom-sheet-actions", children: actions })
|
|
2232
|
+
]
|
|
2233
|
+
}
|
|
2234
|
+
) }) })
|
|
2235
|
+
}
|
|
2236
|
+
)
|
|
2079
2237
|
);
|
|
2080
2238
|
KdsBottomSheet.displayName = "KdsBottomSheet";
|
|
2081
2239
|
|
|
2082
2240
|
// src/components/domain/KdsSecureFooter/KdsSecureFooter.tsx
|
|
2083
|
-
var
|
|
2084
|
-
var
|
|
2085
|
-
var KdsSecureFooter = (0,
|
|
2086
|
-
({ variant = "default", children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2087
|
-
/* @__PURE__ */ (0,
|
|
2088
|
-
children || /* @__PURE__ */ (0,
|
|
2241
|
+
var import_react36 = require("react");
|
|
2242
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2243
|
+
var KdsSecureFooter = (0, import_react36.forwardRef)(
|
|
2244
|
+
({ variant = "default", children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("footer", { ref, className: (0, import_clsx.clsx)("kds-secure-footer", variant === "inside" && "inside", className), ...props, children: [
|
|
2245
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("i", { className: "material-symbols-outlined", children: "lock" }),
|
|
2246
|
+
children || /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "Pago seguro con Khipu" })
|
|
2089
2247
|
] })
|
|
2090
2248
|
);
|
|
2091
2249
|
KdsSecureFooter.displayName = "KdsSecureFooter";
|
|
2092
2250
|
|
|
2093
2251
|
// src/components/domain/KdsRecapList/KdsRecapList.tsx
|
|
2094
|
-
var
|
|
2095
|
-
var
|
|
2096
|
-
var KdsRecapList = (0,
|
|
2097
|
-
({ items, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2098
|
-
/* @__PURE__ */ (0,
|
|
2099
|
-
/* @__PURE__ */ (0,
|
|
2252
|
+
var import_react37 = require("react");
|
|
2253
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2254
|
+
var KdsRecapList = (0, import_react37.forwardRef)(
|
|
2255
|
+
({ items, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("ul", { ref, className: (0, import_clsx.clsx)("kds-recap-list", className), ...props, children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("li", { children: [
|
|
2256
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "kds-key", children: item.label }),
|
|
2257
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: (0, import_clsx.clsx)("kds-value", !item.value && item.placeholder && "placeholder"), children: item.value || item.placeholder || "-" })
|
|
2100
2258
|
] }, i)) })
|
|
2101
2259
|
);
|
|
2102
2260
|
KdsRecapList.displayName = "KdsRecapList";
|
|
2261
|
+
|
|
2262
|
+
// src/components/domain/KdsMontoRow/KdsMontoRow.tsx
|
|
2263
|
+
var import_react38 = require("react");
|
|
2264
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2265
|
+
var KdsMontoRow = (0, import_react38.forwardRef)(
|
|
2266
|
+
({ title, value, deadline, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { ref, className: (0, import_clsx.clsx)("kds-monto-row", className), ...props, children: [
|
|
2267
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
|
|
2268
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "kds-monto-row-title", children: title }),
|
|
2269
|
+
deadline && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "kds-monto-row-deadline", children: deadline })
|
|
2270
|
+
] }),
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "kds-monto-row-value", children: value })
|
|
2272
|
+
] })
|
|
2273
|
+
);
|
|
2274
|
+
KdsMontoRow.displayName = "KdsMontoRow";
|
|
2275
|
+
|
|
2276
|
+
// src/components/domain/KdsMerchantTile/KdsMerchantTile.tsx
|
|
2277
|
+
var import_react39 = require("react");
|
|
2278
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2279
|
+
var KdsMerchantTile = (0, import_react39.forwardRef)(
|
|
2280
|
+
({ name, logoUrl, initials, compact, className, ...props }, ref) => {
|
|
2281
|
+
const displayInitials = (initials ?? name.slice(0, 2)).toUpperCase();
|
|
2282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2283
|
+
"div",
|
|
2284
|
+
{
|
|
2285
|
+
ref,
|
|
2286
|
+
className: (0, import_clsx.clsx)("kds-merchant-tile", logoUrl && "logo", compact && "compact", className),
|
|
2287
|
+
"aria-label": name,
|
|
2288
|
+
...props,
|
|
2289
|
+
children: logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("img", { src: logoUrl, alt: name }) : displayInitials
|
|
2290
|
+
}
|
|
2291
|
+
);
|
|
2292
|
+
}
|
|
2293
|
+
);
|
|
2294
|
+
KdsMerchantTile.displayName = "KdsMerchantTile";
|
|
2295
|
+
|
|
2296
|
+
// src/components/domain/KdsPaymentTotal/KdsPaymentTotal.tsx
|
|
2297
|
+
var import_react40 = require("react");
|
|
2298
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2299
|
+
var KdsPaymentTotal = (0, import_react40.forwardRef)(
|
|
2300
|
+
({
|
|
2301
|
+
variant = "default",
|
|
2302
|
+
tone = "brand",
|
|
2303
|
+
centered = false,
|
|
2304
|
+
amount,
|
|
2305
|
+
currency = "S/",
|
|
2306
|
+
decimals = 2,
|
|
2307
|
+
locale = "es-PE",
|
|
2308
|
+
label = "Monto a pagar",
|
|
2309
|
+
title = "Escanea el QR",
|
|
2310
|
+
titleMobile = "Descarga el QR",
|
|
2311
|
+
className,
|
|
2312
|
+
...props
|
|
2313
|
+
}, ref) => {
|
|
2314
|
+
const { integer, fraction } = formatAmount(amount, decimals, locale);
|
|
2315
|
+
const isEmail = variant === "email";
|
|
2316
|
+
const isInfoTone = tone === "info";
|
|
2317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2318
|
+
"div",
|
|
2319
|
+
{
|
|
2320
|
+
ref,
|
|
2321
|
+
className: (0, import_clsx.clsx)(
|
|
2322
|
+
"kds-payment-total",
|
|
2323
|
+
isEmail && "kds-payment-total--email",
|
|
2324
|
+
isInfoTone && "kds-payment-total--tone-info",
|
|
2325
|
+
centered && "kds-payment-total--centered",
|
|
2326
|
+
className
|
|
2327
|
+
),
|
|
2328
|
+
...props,
|
|
2329
|
+
children: [
|
|
2330
|
+
!isEmail && title != null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h5", { className: "kds-payment-total-title", children: title }),
|
|
2331
|
+
!isEmail && titleMobile != null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h5", { className: "kds-payment-total-title-mobile", children: titleMobile }),
|
|
2332
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h6", { className: "kds-payment-label", children: label }),
|
|
2333
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("h5", { className: "kds-payment-amount", children: [
|
|
2334
|
+
currency,
|
|
2335
|
+
" ",
|
|
2336
|
+
integer,
|
|
2337
|
+
fraction !== null && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("sup", { className: "kds-payment-total-decimal-sup", children: fraction })
|
|
2338
|
+
] })
|
|
2339
|
+
]
|
|
2340
|
+
}
|
|
2341
|
+
);
|
|
2342
|
+
}
|
|
2343
|
+
);
|
|
2344
|
+
KdsPaymentTotal.displayName = "KdsPaymentTotal";
|
|
2345
|
+
function formatAmount(amount, decimals, locale) {
|
|
2346
|
+
const showDecimals = typeof decimals === "number" && decimals > 0;
|
|
2347
|
+
if (typeof amount === "number") {
|
|
2348
|
+
if (showDecimals) {
|
|
2349
|
+
const fixed = amount.toFixed(decimals);
|
|
2350
|
+
const [int, frac] = fixed.split(".");
|
|
2351
|
+
const formattedInt2 = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
|
|
2352
|
+
Number(int)
|
|
2353
|
+
);
|
|
2354
|
+
return { integer: formattedInt2, fraction: frac ?? null };
|
|
2355
|
+
}
|
|
2356
|
+
const formattedInt = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
|
|
2357
|
+
Math.trunc(amount)
|
|
2358
|
+
);
|
|
2359
|
+
return { integer: formattedInt, fraction: null };
|
|
2360
|
+
}
|
|
2361
|
+
const str = amount.trim();
|
|
2362
|
+
const dotIdx = str.indexOf(".");
|
|
2363
|
+
if (dotIdx === -1 || !showDecimals) {
|
|
2364
|
+
return { integer: str, fraction: null };
|
|
2365
|
+
}
|
|
2366
|
+
return {
|
|
2367
|
+
integer: str.slice(0, dotIdx),
|
|
2368
|
+
fraction: str.slice(dotIdx + 1)
|
|
2369
|
+
};
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
// src/components/domain/KdsBillAttachment/KdsBillAttachment.tsx
|
|
2373
|
+
var import_react41 = require("react");
|
|
2374
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2375
|
+
var KdsBillAttachment = (0, import_react41.forwardRef)(
|
|
2376
|
+
({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
2377
|
+
"a",
|
|
2378
|
+
{
|
|
2379
|
+
ref,
|
|
2380
|
+
href,
|
|
2381
|
+
target: "_blank",
|
|
2382
|
+
rel: "noopener noreferrer",
|
|
2383
|
+
className: (0, import_clsx.clsx)("kds-bill-attachment", className),
|
|
2384
|
+
...props,
|
|
2385
|
+
children: [
|
|
2386
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("i", { className: "material-symbols-outlined", children: icon }),
|
|
2387
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: filename })
|
|
2388
|
+
]
|
|
2389
|
+
}
|
|
2390
|
+
)
|
|
2391
|
+
);
|
|
2392
|
+
KdsBillAttachment.displayName = "KdsBillAttachment";
|
|
2393
|
+
var KdsBillAttachments = (0, import_react41.forwardRef)(
|
|
2394
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-bill-attachments", className), ...props, children })
|
|
2395
|
+
);
|
|
2396
|
+
KdsBillAttachments.displayName = "KdsBillAttachments";
|
|
2103
2397
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2104
2398
|
0 && (module.exports = {
|
|
2105
2399
|
KdsAccordion,
|
|
@@ -2109,6 +2403,8 @@ KdsRecapList.displayName = "KdsRecapList";
|
|
|
2109
2403
|
KdsBankList,
|
|
2110
2404
|
KdsBankModal,
|
|
2111
2405
|
KdsBankRow,
|
|
2406
|
+
KdsBillAttachment,
|
|
2407
|
+
KdsBillAttachments,
|
|
2112
2408
|
KdsBottomSheet,
|
|
2113
2409
|
KdsButton,
|
|
2114
2410
|
KdsCard,
|
|
@@ -2126,12 +2422,9 @@ KdsRecapList.displayName = "KdsRecapList";
|
|
|
2126
2422
|
KdsExpandPanel,
|
|
2127
2423
|
KdsInvoiceSticky,
|
|
2128
2424
|
KdsLinearProgress,
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
KdsLogoHeaderLogo,
|
|
2133
|
-
KdsLogoHeaderSeparator,
|
|
2134
|
-
KdsModal,
|
|
2425
|
+
KdsMerchantTile,
|
|
2426
|
+
KdsMontoRow,
|
|
2427
|
+
KdsPaymentTotal,
|
|
2135
2428
|
KdsQrRow,
|
|
2136
2429
|
KdsRadioGroup,
|
|
2137
2430
|
KdsRecapList,
|