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