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