@khipu/design-system 0.2.0-alpha.99 → 0.3.0
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/arch.svg +1 -0
- package/dist/beercss/arrow.svg +1 -0
- package/dist/beercss/boom.svg +1 -0
- package/dist/beercss/bun.svg +1 -0
- package/dist/beercss/burst.svg +1 -0
- package/dist/beercss/circle.svg +1 -0
- package/dist/beercss/clamshell.svg +1 -0
- package/dist/beercss/diamond.svg +1 -0
- package/dist/beercss/fan.svg +1 -0
- package/dist/beercss/flower.svg +1 -0
- package/dist/beercss/gem.svg +1 -0
- package/dist/beercss/ghost-ish.svg +1 -0
- package/dist/beercss/heart.svg +1 -0
- package/dist/beercss/khipu-beercss.css +868 -98
- package/dist/beercss/khipu-beercss.js +75 -0
- 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 +868 -98
- package/dist/beercss/khipu-beercss.scoped.min.css +1 -1
- package/dist/beercss/leaf-clover4.svg +1 -0
- package/dist/beercss/leaf-clover8.svg +1 -0
- package/dist/beercss/loading-indicator.svg +1 -0
- package/dist/beercss/material-symbols-outlined.woff2 +0 -0
- package/dist/beercss/material-symbols-rounded.woff2 +0 -0
- package/dist/beercss/material-symbols-sharp.woff2 +0 -0
- package/dist/beercss/material-symbols-subset.woff2 +0 -0
- package/dist/beercss/metadata.json +5 -5
- package/dist/beercss/oval.svg +1 -0
- package/dist/beercss/pentagon.svg +1 -0
- package/dist/beercss/pill.svg +1 -0
- package/dist/beercss/pixel-circle.svg +1 -0
- package/dist/beercss/pixel-triangle.svg +1 -0
- package/dist/beercss/puffy-diamond.svg +1 -0
- package/dist/beercss/puffy.svg +1 -0
- package/dist/beercss/semicircle.svg +1 -0
- package/dist/beercss/sided-cookie12.svg +1 -0
- package/dist/beercss/sided-cookie4.svg +1 -0
- package/dist/beercss/sided-cookie6.svg +1 -0
- package/dist/beercss/sided-cookie7.svg +1 -0
- package/dist/beercss/sided-cookie9.svg +1 -0
- package/dist/beercss/slanted.svg +1 -0
- package/dist/beercss/soft-boom.svg +1 -0
- package/dist/beercss/soft-burst.svg +1 -0
- package/dist/beercss/square.svg +1 -0
- package/dist/beercss/sunny.svg +1 -0
- package/dist/beercss/triangle.svg +1 -0
- package/dist/beercss/very-sunny.svg +1 -0
- package/dist/beercss/wavy-circle.svg +1 -0
- package/dist/beercss/wavy.svg +1 -0
- package/dist/index.d.mts +128 -6
- package/dist/index.d.ts +128 -6
- package/dist/index.js +394 -156
- package/dist/index.mjs +373 -146
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -1067,7 +1067,7 @@ var KdsButton = forwardRef(
|
|
|
1067
1067
|
children,
|
|
1068
1068
|
className,
|
|
1069
1069
|
...props
|
|
1070
|
-
}, ref) => /* @__PURE__ */
|
|
1070
|
+
}, ref) => /* @__PURE__ */ jsx2(
|
|
1071
1071
|
"button",
|
|
1072
1072
|
{
|
|
1073
1073
|
ref,
|
|
@@ -1081,14 +1081,18 @@ var KdsButton = forwardRef(
|
|
|
1081
1081
|
disabled: disabled || loading,
|
|
1082
1082
|
"aria-busy": loading || void 0,
|
|
1083
1083
|
...props,
|
|
1084
|
-
children: [
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1084
|
+
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1085
|
+
/* @__PURE__ */ jsx2("progress", { className: "circle indeterminate small" }),
|
|
1086
|
+
/* @__PURE__ */ jsx2("span", { children })
|
|
1087
|
+
] }) : (
|
|
1088
|
+
/* Iconos DENTRO del label (inline): si el texto envuelve en pantallas angostas,
|
|
1089
|
+
el icono fluye con la primera linea en vez de quedar anclado al borde del boton. */
|
|
1090
|
+
/* @__PURE__ */ jsxs("span", { className: "kds-btn-label", children: [
|
|
1091
|
+
startIcon && /* @__PURE__ */ jsx2("span", { className: "kds-icon kds-icon-start", children: /* @__PURE__ */ jsx2("i", { className: "material-symbols-outlined", children: startIcon }) }),
|
|
1092
|
+
children,
|
|
1093
|
+
endIcon && /* @__PURE__ */ jsx2("span", { className: "kds-icon kds-icon-end", children: /* @__PURE__ */ jsx2("i", { className: "material-symbols-outlined", children: endIcon }) })
|
|
1094
|
+
] })
|
|
1095
|
+
)
|
|
1092
1096
|
}
|
|
1093
1097
|
)
|
|
1094
1098
|
);
|
|
@@ -1421,6 +1425,7 @@ var variantTag = {
|
|
|
1421
1425
|
"body-small": "p",
|
|
1422
1426
|
label: "span",
|
|
1423
1427
|
"label-small": "span",
|
|
1428
|
+
"kv-label": "span",
|
|
1424
1429
|
value: "span",
|
|
1425
1430
|
code: "span",
|
|
1426
1431
|
caption: "span",
|
|
@@ -2195,13 +2200,36 @@ var KdsFab = forwardRef27(
|
|
|
2195
2200
|
);
|
|
2196
2201
|
KdsFab.displayName = "KdsFab";
|
|
2197
2202
|
|
|
2198
|
-
// src/components/
|
|
2203
|
+
// src/components/core/KdsEmptyState/KdsEmptyState.tsx
|
|
2199
2204
|
import { forwardRef as forwardRef28 } from "react";
|
|
2200
2205
|
import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2201
|
-
var
|
|
2206
|
+
var KdsEmptyState = forwardRef28(
|
|
2207
|
+
({ icon = "hide_source", title, description, className, ...props }, ref) => /* @__PURE__ */ jsxs22(
|
|
2208
|
+
"div",
|
|
2209
|
+
{
|
|
2210
|
+
ref,
|
|
2211
|
+
role: "status",
|
|
2212
|
+
className: clsx("kds-empty-state", className),
|
|
2213
|
+
...props,
|
|
2214
|
+
children: [
|
|
2215
|
+
/* @__PURE__ */ jsx30("i", { className: "material-symbols-outlined", "aria-hidden": "true", children: icon }),
|
|
2216
|
+
/* @__PURE__ */ jsxs22("div", { className: "kds-empty-state-text", children: [
|
|
2217
|
+
/* @__PURE__ */ jsx30(KdsTypography, { variant: "body", color: "primary", children: title }),
|
|
2218
|
+
description && /* @__PURE__ */ jsx30(KdsTypography, { variant: "body", color: "secondary", children: description })
|
|
2219
|
+
] })
|
|
2220
|
+
]
|
|
2221
|
+
}
|
|
2222
|
+
)
|
|
2223
|
+
);
|
|
2224
|
+
KdsEmptyState.displayName = "KdsEmptyState";
|
|
2225
|
+
|
|
2226
|
+
// src/components/domain/KdsBankRow/KdsBankRow.tsx
|
|
2227
|
+
import { forwardRef as forwardRef29 } from "react";
|
|
2228
|
+
import { jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2229
|
+
var KdsBankRow = forwardRef29(
|
|
2202
2230
|
({ name, logoUrl, selected, hideLogo, className, ...props }, ref) => {
|
|
2203
2231
|
const nameStr = typeof name === "string" ? name : "";
|
|
2204
|
-
return /* @__PURE__ */
|
|
2232
|
+
return /* @__PURE__ */ jsxs23(
|
|
2205
2233
|
"button",
|
|
2206
2234
|
{
|
|
2207
2235
|
ref,
|
|
@@ -2209,9 +2237,9 @@ var KdsBankRow = forwardRef28(
|
|
|
2209
2237
|
className: clsx("kds-bank-row", selected && "selected", className),
|
|
2210
2238
|
...props,
|
|
2211
2239
|
children: [
|
|
2212
|
-
!hideLogo && /* @__PURE__ */
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
-
/* @__PURE__ */
|
|
2240
|
+
!hideLogo && /* @__PURE__ */ jsx31("span", { className: "kds-bank-row-logo", children: logoUrl ? /* @__PURE__ */ jsx31("img", { src: logoUrl, alt: nameStr }) : /* @__PURE__ */ jsx31("span", { className: "initials", children: nameStr.charAt(0) }) }),
|
|
2241
|
+
/* @__PURE__ */ jsx31("span", { className: "kds-bank-row-name", children: name }),
|
|
2242
|
+
/* @__PURE__ */ jsx31("i", { className: "material-symbols-outlined", children: selected ? "check_circle" : "chevron_right" })
|
|
2215
2243
|
]
|
|
2216
2244
|
}
|
|
2217
2245
|
);
|
|
@@ -2220,32 +2248,32 @@ var KdsBankRow = forwardRef28(
|
|
|
2220
2248
|
KdsBankRow.displayName = "KdsBankRow";
|
|
2221
2249
|
|
|
2222
2250
|
// src/components/domain/KdsBankList/KdsBankList.tsx
|
|
2223
|
-
import { forwardRef as
|
|
2224
|
-
import { jsx as
|
|
2225
|
-
var KdsBankList =
|
|
2226
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2251
|
+
import { forwardRef as forwardRef30 } from "react";
|
|
2252
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2253
|
+
var KdsBankList = forwardRef30(
|
|
2254
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx32("div", { ref, className: clsx("kds-bank-list", className), role: "list", ...props, children })
|
|
2227
2255
|
);
|
|
2228
2256
|
KdsBankList.displayName = "KdsBankList";
|
|
2229
2257
|
|
|
2230
2258
|
// src/components/domain/KdsBankModal/KdsBankModal.tsx
|
|
2231
|
-
import { forwardRef as
|
|
2259
|
+
import { forwardRef as forwardRef31, useState as useState7 } from "react";
|
|
2232
2260
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
2233
|
-
import { jsx as
|
|
2234
|
-
var KdsBankModal =
|
|
2261
|
+
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2262
|
+
var KdsBankModal = forwardRef31(
|
|
2235
2263
|
({ open, onClose, title = "Selecciona tu banco", searchPlaceholder = "Buscar banco...", onSearch, children, className, container }, ref) => {
|
|
2236
2264
|
const [query, setQuery] = useState7("");
|
|
2237
2265
|
const handleSearch = (value) => {
|
|
2238
2266
|
setQuery(value);
|
|
2239
2267
|
onSearch?.(value);
|
|
2240
2268
|
};
|
|
2241
|
-
return /* @__PURE__ */
|
|
2269
|
+
return /* @__PURE__ */ jsx33(Dialog.Root, { open, onOpenChange: (o) => {
|
|
2242
2270
|
if (!o) onClose();
|
|
2243
|
-
}, children: /* @__PURE__ */
|
|
2244
|
-
/* @__PURE__ */
|
|
2245
|
-
/* @__PURE__ */
|
|
2246
|
-
/* @__PURE__ */
|
|
2271
|
+
}, children: /* @__PURE__ */ jsx33(Dialog.Portal, { container, children: /* @__PURE__ */ jsx33(Dialog.Overlay, { className: "kds-bank-modal-scrim open", children: /* @__PURE__ */ jsxs24(Dialog.Content, { ref, className: clsx("kds-bank-modal", className), children: [
|
|
2272
|
+
/* @__PURE__ */ jsxs24("div", { className: "kds-bank-modal-header", children: [
|
|
2273
|
+
/* @__PURE__ */ jsx33(Dialog.Title, { asChild: true, children: /* @__PURE__ */ jsx33("h3", { children: title }) }),
|
|
2274
|
+
/* @__PURE__ */ jsx33(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx33("button", { className: "kds-bank-modal-close", "aria-label": "Cerrar", children: /* @__PURE__ */ jsx33("i", { className: "material-symbols-outlined", children: "close" }) }) })
|
|
2247
2275
|
] }),
|
|
2248
|
-
/* @__PURE__ */
|
|
2276
|
+
/* @__PURE__ */ jsx33("div", { className: "kds-bank-modal-search", children: /* @__PURE__ */ jsx33(
|
|
2249
2277
|
KdsSearchField,
|
|
2250
2278
|
{
|
|
2251
2279
|
placeholder: searchPlaceholder,
|
|
@@ -2253,33 +2281,33 @@ var KdsBankModal = forwardRef30(
|
|
|
2253
2281
|
onChange: (e) => handleSearch(e.target.value)
|
|
2254
2282
|
}
|
|
2255
2283
|
) }),
|
|
2256
|
-
/* @__PURE__ */
|
|
2284
|
+
/* @__PURE__ */ jsx33("div", { className: "kds-bank-modal-body", children })
|
|
2257
2285
|
] }) }) }) });
|
|
2258
2286
|
}
|
|
2259
2287
|
);
|
|
2260
2288
|
KdsBankModal.displayName = "KdsBankModal";
|
|
2261
2289
|
|
|
2262
2290
|
// src/components/domain/KdsQrRow/KdsQrRow.tsx
|
|
2263
|
-
import { forwardRef as
|
|
2264
|
-
import { jsx as
|
|
2265
|
-
var KdsQrRow =
|
|
2266
|
-
({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */
|
|
2267
|
-
/* @__PURE__ */
|
|
2268
|
-
/* @__PURE__ */
|
|
2269
|
-
/* @__PURE__ */
|
|
2270
|
-
description && /* @__PURE__ */
|
|
2291
|
+
import { forwardRef as forwardRef32 } from "react";
|
|
2292
|
+
import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2293
|
+
var KdsQrRow = forwardRef32(
|
|
2294
|
+
({ name, description, badge, icon = "qr_code_2", className, ...props }, ref) => /* @__PURE__ */ jsxs25("button", { ref, type: "button", className: clsx("kds-qr-row", className), ...props, children: [
|
|
2295
|
+
/* @__PURE__ */ jsx34("span", { className: "kds-qr-avatar", "aria-hidden": "true", children: /* @__PURE__ */ jsx34("i", { className: "material-symbols-outlined", children: icon }) }),
|
|
2296
|
+
/* @__PURE__ */ jsxs25("span", { className: "kds-qr-text", children: [
|
|
2297
|
+
/* @__PURE__ */ jsx34("span", { className: "kds-qr-title", children: name }),
|
|
2298
|
+
description && /* @__PURE__ */ jsx34("span", { className: "kds-qr-subtitle", children: description })
|
|
2271
2299
|
] }),
|
|
2272
|
-
badge && /* @__PURE__ */
|
|
2273
|
-
/* @__PURE__ */
|
|
2300
|
+
badge && /* @__PURE__ */ jsx34("span", { className: "kds-qr-badge", children: badge }),
|
|
2301
|
+
/* @__PURE__ */ jsx34("i", { className: "material-symbols-outlined", children: "chevron_right" })
|
|
2274
2302
|
] })
|
|
2275
2303
|
);
|
|
2276
2304
|
KdsQrRow.displayName = "KdsQrRow";
|
|
2277
2305
|
|
|
2278
2306
|
// src/components/domain/KdsCardSelector/KdsCardSelector.tsx
|
|
2279
|
-
import { forwardRef as
|
|
2280
|
-
import { jsx as
|
|
2281
|
-
var KdsCardSelector =
|
|
2282
|
-
({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */
|
|
2307
|
+
import { forwardRef as forwardRef33 } from "react";
|
|
2308
|
+
import { jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2309
|
+
var KdsCardSelector = forwardRef33(
|
|
2310
|
+
({ icon, title, description, selected, className, ...props }, ref) => /* @__PURE__ */ jsxs26(
|
|
2283
2311
|
"button",
|
|
2284
2312
|
{
|
|
2285
2313
|
ref,
|
|
@@ -2287,9 +2315,9 @@ var KdsCardSelector = forwardRef32(
|
|
|
2287
2315
|
className: clsx("kds-card-selector", selected && "selected", className),
|
|
2288
2316
|
...props,
|
|
2289
2317
|
children: [
|
|
2290
|
-
icon && /* @__PURE__ */
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
description && /* @__PURE__ */
|
|
2318
|
+
icon && /* @__PURE__ */ jsx35("span", { className: "kds-card-selector-icon", children: /* @__PURE__ */ jsx35("i", { className: "material-symbols-outlined", children: icon }) }),
|
|
2319
|
+
/* @__PURE__ */ jsx35("span", { className: "kds-card-selector-title", children: title }),
|
|
2320
|
+
description && /* @__PURE__ */ jsx35("span", { className: "kds-card-selector-description", children: description })
|
|
2293
2321
|
]
|
|
2294
2322
|
}
|
|
2295
2323
|
)
|
|
@@ -2297,26 +2325,26 @@ var KdsCardSelector = forwardRef32(
|
|
|
2297
2325
|
KdsCardSelector.displayName = "KdsCardSelector";
|
|
2298
2326
|
|
|
2299
2327
|
// src/components/domain/KdsCardPlan/KdsCardPlan.tsx
|
|
2300
|
-
import { forwardRef as
|
|
2301
|
-
import { jsx as
|
|
2302
|
-
var KdsCardPlan =
|
|
2303
|
-
({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */
|
|
2328
|
+
import { forwardRef as forwardRef34 } from "react";
|
|
2329
|
+
import { jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2330
|
+
var KdsCardPlan = forwardRef34(
|
|
2331
|
+
({ title, price, period, features, recommended, badgeText, action, className, ...props }, ref) => /* @__PURE__ */ jsxs27(
|
|
2304
2332
|
"div",
|
|
2305
2333
|
{
|
|
2306
2334
|
ref,
|
|
2307
2335
|
className: clsx("kds-card-plan", recommended && "recommended", className),
|
|
2308
2336
|
...props,
|
|
2309
2337
|
children: [
|
|
2310
|
-
/* @__PURE__ */
|
|
2311
|
-
/* @__PURE__ */
|
|
2312
|
-
/* @__PURE__ */
|
|
2313
|
-
period && /* @__PURE__ */
|
|
2338
|
+
/* @__PURE__ */ jsx36("div", { className: "kds-card-plan-header", children: /* @__PURE__ */ jsx36("h3", { children: title }) }),
|
|
2339
|
+
/* @__PURE__ */ jsxs27("div", { className: "kds-card-plan-price", children: [
|
|
2340
|
+
/* @__PURE__ */ jsx36("span", { className: "kds-price", children: price }),
|
|
2341
|
+
period && /* @__PURE__ */ jsxs27("span", { className: "kds-price-period", children: [
|
|
2314
2342
|
"/",
|
|
2315
2343
|
period
|
|
2316
2344
|
] })
|
|
2317
2345
|
] }),
|
|
2318
|
-
badgeText && /* @__PURE__ */
|
|
2319
|
-
features && features.length > 0 && /* @__PURE__ */
|
|
2346
|
+
badgeText && /* @__PURE__ */ jsx36("span", { className: "kds-card-plan-badge", children: badgeText }),
|
|
2347
|
+
features && features.length > 0 && /* @__PURE__ */ jsx36("ul", { className: "kds-card-plan-features", children: features.map((f, i) => /* @__PURE__ */ jsx36("li", { children: f }, i)) }),
|
|
2320
2348
|
action
|
|
2321
2349
|
]
|
|
2322
2350
|
}
|
|
@@ -2325,10 +2353,10 @@ var KdsCardPlan = forwardRef33(
|
|
|
2325
2353
|
KdsCardPlan.displayName = "KdsCardPlan";
|
|
2326
2354
|
|
|
2327
2355
|
// src/components/domain/KdsInvoiceSticky/KdsInvoiceSticky.tsx
|
|
2328
|
-
import { forwardRef as
|
|
2329
|
-
import { jsx as
|
|
2330
|
-
var KdsInvoiceSticky =
|
|
2331
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2356
|
+
import { forwardRef as forwardRef35 } from "react";
|
|
2357
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2358
|
+
var KdsInvoiceSticky = forwardRef35(
|
|
2359
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx37(
|
|
2332
2360
|
"article",
|
|
2333
2361
|
{
|
|
2334
2362
|
ref,
|
|
@@ -2341,10 +2369,10 @@ var KdsInvoiceSticky = forwardRef34(
|
|
|
2341
2369
|
KdsInvoiceSticky.displayName = "KdsInvoiceSticky";
|
|
2342
2370
|
|
|
2343
2371
|
// src/components/domain/KdsBottomSheet/KdsBottomSheet.tsx
|
|
2344
|
-
import { forwardRef as
|
|
2372
|
+
import { forwardRef as forwardRef36 } from "react";
|
|
2345
2373
|
import * as Dialog2 from "@radix-ui/react-dialog";
|
|
2346
|
-
import { jsx as
|
|
2347
|
-
var KdsBottomSheet =
|
|
2374
|
+
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2375
|
+
var KdsBottomSheet = forwardRef36(
|
|
2348
2376
|
({
|
|
2349
2377
|
open,
|
|
2350
2378
|
onClose,
|
|
@@ -2357,14 +2385,14 @@ var KdsBottomSheet = forwardRef35(
|
|
|
2357
2385
|
container,
|
|
2358
2386
|
className,
|
|
2359
2387
|
...props
|
|
2360
|
-
}, ref) => /* @__PURE__ */
|
|
2388
|
+
}, ref) => /* @__PURE__ */ jsx38(
|
|
2361
2389
|
Dialog2.Root,
|
|
2362
2390
|
{
|
|
2363
2391
|
open,
|
|
2364
2392
|
onOpenChange: (o) => {
|
|
2365
2393
|
if (!o) onClose();
|
|
2366
2394
|
},
|
|
2367
|
-
children: /* @__PURE__ */
|
|
2395
|
+
children: /* @__PURE__ */ jsx38(Dialog2.Portal, { container, children: /* @__PURE__ */ jsx38("div", { className: "kds-theme-root", style: { display: "contents" }, children: /* @__PURE__ */ jsx38(Dialog2.Overlay, { className: "kds-bottom-sheet-scrim open", children: /* @__PURE__ */ jsxs28(
|
|
2368
2396
|
Dialog2.Content,
|
|
2369
2397
|
{
|
|
2370
2398
|
ref,
|
|
@@ -2375,20 +2403,20 @@ var KdsBottomSheet = forwardRef35(
|
|
|
2375
2403
|
},
|
|
2376
2404
|
...props,
|
|
2377
2405
|
children: [
|
|
2378
|
-
showGrabber && /* @__PURE__ */
|
|
2379
|
-
showCloseButton && /* @__PURE__ */
|
|
2406
|
+
showGrabber && /* @__PURE__ */ jsx38("div", { className: "kds-bottom-sheet-grabber", "aria-hidden": "true" }),
|
|
2407
|
+
showCloseButton && /* @__PURE__ */ jsx38(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ jsx38(
|
|
2380
2408
|
"button",
|
|
2381
2409
|
{
|
|
2382
2410
|
type: "button",
|
|
2383
2411
|
className: "kds-bottom-sheet-close",
|
|
2384
2412
|
"aria-label": "Cerrar",
|
|
2385
|
-
children: /* @__PURE__ */
|
|
2413
|
+
children: /* @__PURE__ */ jsx38("i", { className: "material-symbols-outlined", children: "close" })
|
|
2386
2414
|
}
|
|
2387
2415
|
) }),
|
|
2388
|
-
title && /* @__PURE__ */
|
|
2389
|
-
description && /* @__PURE__ */
|
|
2390
|
-
/* @__PURE__ */
|
|
2391
|
-
actions && /* @__PURE__ */
|
|
2416
|
+
title && /* @__PURE__ */ jsx38(Dialog2.Title, { className: "kds-bottom-sheet-title", children: title }),
|
|
2417
|
+
description && /* @__PURE__ */ jsx38(Dialog2.Description, { className: "kds-bottom-sheet-description", children: description }),
|
|
2418
|
+
/* @__PURE__ */ jsx38("div", { className: "kds-bottom-sheet-body", children }),
|
|
2419
|
+
actions && /* @__PURE__ */ jsx38("div", { className: "kds-bottom-sheet-actions", children: actions })
|
|
2392
2420
|
]
|
|
2393
2421
|
}
|
|
2394
2422
|
) }) }) })
|
|
@@ -2398,13 +2426,13 @@ var KdsBottomSheet = forwardRef35(
|
|
|
2398
2426
|
KdsBottomSheet.displayName = "KdsBottomSheet";
|
|
2399
2427
|
|
|
2400
2428
|
// src/components/domain/KdsSecureFooter/KdsSecureFooter.tsx
|
|
2401
|
-
import { forwardRef as
|
|
2429
|
+
import { forwardRef as forwardRef38 } from "react";
|
|
2402
2430
|
|
|
2403
2431
|
// src/components/domain/KdsSecureFooter/KhipuWordmark.tsx
|
|
2404
|
-
import { forwardRef as
|
|
2405
|
-
import { jsx as
|
|
2406
|
-
var KhipuWordmark =
|
|
2407
|
-
({ className = "khipu-mark", ...props }, ref) => /* @__PURE__ */
|
|
2432
|
+
import { forwardRef as forwardRef37 } from "react";
|
|
2433
|
+
import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2434
|
+
var KhipuWordmark = forwardRef37(
|
|
2435
|
+
({ className = "khipu-mark", ...props }, ref) => /* @__PURE__ */ jsxs29(
|
|
2408
2436
|
"svg",
|
|
2409
2437
|
{
|
|
2410
2438
|
ref,
|
|
@@ -2415,14 +2443,14 @@ var KhipuWordmark = forwardRef36(
|
|
|
2415
2443
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2416
2444
|
...props,
|
|
2417
2445
|
children: [
|
|
2418
|
-
/* @__PURE__ */
|
|
2419
|
-
/* @__PURE__ */
|
|
2420
|
-
/* @__PURE__ */
|
|
2421
|
-
/* @__PURE__ */
|
|
2422
|
-
/* @__PURE__ */
|
|
2423
|
-
/* @__PURE__ */
|
|
2424
|
-
/* @__PURE__ */
|
|
2425
|
-
/* @__PURE__ */
|
|
2446
|
+
/* @__PURE__ */ jsx39("path", { d: "M16.6417 11.8339C16.7273 11.9196 16.8272 11.9624 16.9472 11.9624H18.9628C19.0798 11.9624 19.1826 11.9196 19.2682 11.8339C19.3539 11.7483 19.3967 11.6483 19.3967 11.5284V7.12891C19.3967 6.50081 19.3111 5.95551 19.1398 5.49586C18.9685 5.03621 18.7315 4.65937 18.4289 4.3596C18.1234 4.05983 17.758 3.83999 17.3326 3.69439C16.9043 3.55164 16.4361 3.47741 15.9251 3.47741C15.4226 3.47741 14.9801 3.58019 14.5975 3.7886C14.2121 3.99702 13.9295 4.214 13.7496 4.43668V1.03071C13.7496 0.913654 13.7068 0.810874 13.6211 0.728079C13.5355 0.642434 13.4355 0.599609 13.3185 0.599609H11.2943C11.1773 0.599609 11.0745 0.642434 10.9888 0.728079C10.9032 0.813729 10.8604 0.913654 10.8604 1.03071V11.5284C10.8604 11.6455 10.9032 11.7483 10.9888 11.8339C11.0745 11.9196 11.1744 11.9624 11.2943 11.9624H13.3099C13.427 11.9624 13.5298 11.9196 13.6126 11.8339C13.6982 11.7483 13.741 11.6483 13.741 11.5284V7.48006C13.741 7.02041 13.8495 6.65216 14.0693 6.37521C14.2892 6.09826 14.6375 5.95836 15.1171 5.95836C15.5968 5.95836 15.9479 6.09826 16.1735 6.37521C16.3961 6.65216 16.5103 7.02041 16.5103 7.48006V11.5284C16.5132 11.6483 16.556 11.7483 16.6417 11.8339Z", fill: "#8347AD" }),
|
|
2447
|
+
/* @__PURE__ */ jsx39("path", { d: "M23.6189 3.64014H21.6005C21.4834 3.64014 21.3806 3.68296 21.295 3.76861C21.2093 3.85426 21.1665 3.95418 21.1665 4.07124V11.5284C21.1665 11.6454 21.2093 11.7482 21.295 11.8339C21.3806 11.9195 21.4806 11.9623 21.6005 11.9623H23.6161C23.7331 11.9623 23.8359 11.9195 23.9187 11.8339C24.0044 11.7482 24.0472 11.6483 24.0472 11.5284V4.07124C24.0472 3.95418 24.0044 3.85141 23.9187 3.76861C23.8359 3.68296 23.736 3.64014 23.6189 3.64014Z", fill: "#8347AD" }),
|
|
2448
|
+
/* @__PURE__ */ jsx39("path", { d: "M34.1881 10.0723C34.3851 9.61264 34.4936 9.07019 34.5164 8.43924C34.5278 8.27934 34.5335 8.06239 34.5335 7.79114C34.5335 7.51994 34.5278 7.30294 34.5164 7.14309C34.4936 6.51499 34.3851 5.96969 34.1881 5.51004C33.9911 5.05039 33.7313 4.67068 33.4115 4.36519C33.0918 4.05971 32.7178 3.83702 32.2924 3.69427C31.8642 3.55152 31.4131 3.47729 30.9334 3.47729C30.5823 3.47729 30.2854 3.50584 30.0455 3.5658C29.8057 3.62575 29.603 3.69998 29.4374 3.78848C29.2718 3.87984 29.1348 3.98263 29.0206 4.09968C28.9093 4.21674 28.8036 4.32808 28.7094 4.43657V4.06828C28.7094 3.95122 28.6666 3.84844 28.5809 3.7628C28.4953 3.67715 28.3954 3.63432 28.2783 3.63432H26.3426C26.2256 3.63432 26.1228 3.67715 26.0372 3.7628C25.9515 3.84844 25.9087 3.94837 25.9087 4.06828V14.566C25.9087 14.683 25.9515 14.7858 26.0372 14.8715C26.1228 14.9571 26.2227 14.9999 26.3426 14.9999H28.3583C28.4753 14.9999 28.5781 14.9571 28.6637 14.8715C28.7494 14.7858 28.7922 14.6859 28.7922 14.566V11.1629C28.8664 11.2599 28.9635 11.3627 29.0806 11.474C29.1976 11.5854 29.3432 11.691 29.5117 11.7852C29.683 11.8823 29.8857 11.9622 30.1198 12.0251C30.3539 12.0879 30.6251 12.1221 30.9363 12.1221C31.4159 12.1221 31.8699 12.0479 32.2953 11.8994C32.7206 11.751 33.0946 11.5226 33.4144 11.22C33.7313 10.9145 33.9911 10.5319 34.1881 10.0723ZM31.65 8.24794C31.6186 8.62194 31.4959 8.94739 31.2817 9.22434C31.0676 9.50129 30.7107 9.64119 30.2083 9.64119C29.9742 9.64119 29.7715 9.60404 29.6002 9.52984C29.4289 9.45559 29.289 9.35569 29.1748 9.23289C29.0634 9.11014 28.9749 8.97309 28.9121 8.82464C28.8493 8.67619 28.8065 8.52204 28.7836 8.35929C28.7608 8.19939 28.7522 8.01384 28.7522 7.79974C28.7522 7.58559 28.7637 7.40004 28.7836 7.24014C28.8036 7.08029 28.8465 6.92609 28.9121 6.77479C28.9749 6.62634 29.0634 6.48929 29.1748 6.36654C29.2861 6.24374 29.4289 6.14384 29.6002 6.06959C29.7715 5.99539 29.9742 5.95824 30.2083 5.95824C30.7107 5.95824 31.0676 6.09814 31.2817 6.37509C31.4959 6.65204 31.6186 6.97749 31.65 7.35149C31.6843 7.65124 31.6843 7.95104 31.65 8.24794Z", fill: "#8347AD" }),
|
|
2449
|
+
/* @__PURE__ */ jsx39("path", { d: "M41.7481 11.8339C41.8337 11.9195 41.9337 11.9623 42.0536 11.9623H43.9093C44.0264 11.9623 44.1291 11.9195 44.2119 11.8339C44.2976 11.7482 44.3404 11.6483 44.3404 11.5284V4.07124C44.3404 3.95418 44.2976 3.85141 44.2119 3.76861C44.1263 3.68296 44.0264 3.64014 43.9093 3.64014H41.8937C41.7766 3.64014 41.6739 3.68296 41.5882 3.76861C41.5026 3.85426 41.4597 3.95418 41.4597 4.07124V8.1196C41.4597 8.57925 41.3598 8.94755 41.1628 9.22445C40.9658 9.5014 40.6318 9.6413 40.1636 9.6413C39.6954 9.6413 39.3585 9.5014 39.1558 9.22445C38.9531 8.94755 38.8503 8.57925 38.8503 8.1196V4.07124C38.8503 3.95418 38.8075 3.85141 38.7218 3.76861C38.6362 3.68296 38.5363 3.64014 38.4163 3.64014H36.4007C36.2837 3.64014 36.1809 3.68296 36.0953 3.76861C36.0096 3.85426 35.9668 3.95418 35.9668 4.07124V8.47075C35.9668 9.7298 36.2723 10.6519 36.8861 11.24C37.4999 11.8282 38.325 12.1194 39.3585 12.1194C39.6897 12.1194 39.9752 12.0908 40.215 12.0309C40.4548 11.9709 40.6661 11.8967 40.8459 11.8082C41.0286 11.7168 41.18 11.6169 41.3027 11.5027C41.4255 11.3914 41.5283 11.2772 41.6139 11.1601V11.5284C41.6196 11.6483 41.6624 11.7482 41.7481 11.8339Z", fill: "#8347AD" }),
|
|
2450
|
+
/* @__PURE__ */ jsx39("path", { d: "M22.5569 2.78074C21.7889 2.78074 21.1665 2.1555 21.1665 1.39037C21.1665 0.622385 21.7918 0 22.5569 0C23.3249 0 23.9473 0.62524 23.9473 1.39037C23.9501 2.1555 23.3249 2.78074 22.5569 2.78074Z", fill: "#3CB4E5" }),
|
|
2451
|
+
/* @__PURE__ */ jsx39("path", { d: "M3.1374 7.43996V4.78198L2.34372 5.77836C2.22095 5.93256 2.21524 6.14951 2.32944 6.31226L3.1374 7.43996Z", fill: "#743CEB" }),
|
|
2452
|
+
/* @__PURE__ */ jsx39("path", { d: "M2.96345 0.722369C2.88351 0.642434 2.78074 0.599609 2.66368 0.599609H0.40826C0.299771 0.599609 0.205557 0.639579 0.122763 0.722369C0.0428246 0.802309 0 0.905089 0 1.02214V11.557C0 11.6655 0.0399696 11.7597 0.122763 11.8425C0.202703 11.9224 0.299771 11.9652 0.40826 11.9652H2.66368C2.78359 11.9652 2.88351 11.9253 2.96345 11.8425C3.04339 11.7625 3.08622 11.6655 3.08622 11.557V8.41081L2.83783 8.08246L2.83212 8.07676L2.82642 8.06821L1.81576 6.65216C1.55024 6.28101 1.56166 5.76996 1.84716 5.41306L2.84069 4.16261L3.08622 3.84285V1.01929C3.08622 0.902234 3.04625 0.802309 2.96345 0.722369Z", fill: "#8347AD" }),
|
|
2453
|
+
/* @__PURE__ */ jsx39("path", { d: "M9.60962 11.9625C9.70667 11.9625 9.78947 11.9282 9.85227 11.8568C9.91797 11.7855 9.94937 11.7084 9.94937 11.6227C9.94937 11.5371 9.92652 11.4714 9.88367 11.4286L5.89242 6.0384L9.59247 1.13642C9.63532 1.08217 9.65812 1.01651 9.65812 0.942284C9.65812 0.856634 9.62387 0.776694 9.55252 0.708174C9.50967 0.665349 9.45832 0.633944 9.40407 0.616814C9.37267 0.608249 9.33552 0.602539 9.30127 0.602539H6.73752C6.56337 0.602539 6.42632 0.636799 6.32352 0.708174C6.22077 0.779549 6.14082 0.850924 6.08942 0.928009L3.32868 4.54525L2.32944 5.80145C2.27234 5.8728 2.24094 5.95845 2.24094 6.04695C2.23808 6.13545 2.26378 6.2211 2.31802 6.2982L2.83477 7.0205L3.32868 7.70855L6.29787 11.6199C6.32927 11.6627 6.39492 11.7312 6.49197 11.8226C6.55192 11.8797 6.63472 11.9197 6.73752 11.9425C6.80032 11.9568 6.86882 11.9625 6.94592 11.9625H9.60962Z", fill: "#3CB4E5" })
|
|
2426
2454
|
]
|
|
2427
2455
|
}
|
|
2428
2456
|
)
|
|
@@ -2430,17 +2458,17 @@ var KhipuWordmark = forwardRef36(
|
|
|
2430
2458
|
KhipuWordmark.displayName = "KhipuWordmark";
|
|
2431
2459
|
|
|
2432
2460
|
// src/components/domain/KdsSecureFooter/KdsSecureFooter.tsx
|
|
2433
|
-
import { Fragment as Fragment3, jsx as
|
|
2434
|
-
var KdsSecureFooter =
|
|
2435
|
-
({ variant = "default", showLogo = true, psp, children, className, ...props }, ref) => /* @__PURE__ */
|
|
2436
|
-
/* @__PURE__ */
|
|
2437
|
-
/* @__PURE__ */
|
|
2438
|
-
/* @__PURE__ */
|
|
2461
|
+
import { Fragment as Fragment3, jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2462
|
+
var KdsSecureFooter = forwardRef38(
|
|
2463
|
+
({ variant = "default", showLogo = true, psp, children, className, ...props }, ref) => /* @__PURE__ */ jsxs30("footer", { ref, className: clsx("kds-secure-footer", variant === "inside" && "inside", className), ...props, children: [
|
|
2464
|
+
/* @__PURE__ */ jsxs30("svg", { className: "kds-secure-footer-lock", viewBox: "0 0 24 24", "aria-hidden": "true", children: [
|
|
2465
|
+
/* @__PURE__ */ jsx40("rect", { x: "4.5", y: "10.5", width: "15", height: "10", rx: "2.25" }),
|
|
2466
|
+
/* @__PURE__ */ jsx40("path", { d: "M8 10.5V7a4 4 0 0 1 8 0v3.5" })
|
|
2439
2467
|
] }),
|
|
2440
|
-
children || /* @__PURE__ */
|
|
2441
|
-
showLogo && /* @__PURE__ */
|
|
2442
|
-
psp && /* @__PURE__ */
|
|
2443
|
-
/* @__PURE__ */
|
|
2468
|
+
children || /* @__PURE__ */ jsx40("span", { children: "Pago seguro procesado por" }),
|
|
2469
|
+
showLogo && /* @__PURE__ */ jsx40(KhipuWordmark, {}),
|
|
2470
|
+
psp && /* @__PURE__ */ jsxs30(Fragment3, { children: [
|
|
2471
|
+
/* @__PURE__ */ jsx40("span", { className: "kds-secure-footer-sep", "aria-hidden": "true" }),
|
|
2444
2472
|
psp
|
|
2445
2473
|
] })
|
|
2446
2474
|
] })
|
|
@@ -2448,44 +2476,44 @@ var KdsSecureFooter = forwardRef37(
|
|
|
2448
2476
|
KdsSecureFooter.displayName = "KdsSecureFooter";
|
|
2449
2477
|
|
|
2450
2478
|
// src/components/domain/KdsRecapList/KdsRecapList.tsx
|
|
2451
|
-
import { forwardRef as
|
|
2452
|
-
import { jsx as
|
|
2453
|
-
var KdsRecapList =
|
|
2454
|
-
({ items, className, ...props }, ref) => /* @__PURE__ */
|
|
2455
|
-
/* @__PURE__ */
|
|
2456
|
-
/* @__PURE__ */
|
|
2479
|
+
import { forwardRef as forwardRef39 } from "react";
|
|
2480
|
+
import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2481
|
+
var KdsRecapList = forwardRef39(
|
|
2482
|
+
({ items, className, ...props }, ref) => /* @__PURE__ */ jsx41("ul", { ref, className: clsx("kds-recap-list", className), ...props, children: items.map((item, i) => /* @__PURE__ */ jsxs31("li", { children: [
|
|
2483
|
+
/* @__PURE__ */ jsx41("span", { className: "kds-key", children: item.label }),
|
|
2484
|
+
/* @__PURE__ */ jsx41("span", { className: clsx("kds-value", !item.value && item.placeholder && "placeholder"), children: item.value || item.placeholder || "-" })
|
|
2457
2485
|
] }, i)) })
|
|
2458
2486
|
);
|
|
2459
2487
|
KdsRecapList.displayName = "KdsRecapList";
|
|
2460
2488
|
|
|
2461
2489
|
// src/components/domain/KdsMontoRow/KdsMontoRow.tsx
|
|
2462
|
-
import { forwardRef as
|
|
2463
|
-
import { jsx as
|
|
2464
|
-
var KdsMontoRow =
|
|
2465
|
-
({ title, value, deadline, className, ...props }, ref) => /* @__PURE__ */
|
|
2466
|
-
/* @__PURE__ */
|
|
2467
|
-
/* @__PURE__ */
|
|
2468
|
-
deadline && /* @__PURE__ */
|
|
2490
|
+
import { forwardRef as forwardRef40 } from "react";
|
|
2491
|
+
import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2492
|
+
var KdsMontoRow = forwardRef40(
|
|
2493
|
+
({ title, value, deadline, className, ...props }, ref) => /* @__PURE__ */ jsxs32("div", { ref, className: clsx("kds-monto-row", className), ...props, children: [
|
|
2494
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
2495
|
+
/* @__PURE__ */ jsx42("div", { className: "kds-monto-row-title", children: title }),
|
|
2496
|
+
deadline && /* @__PURE__ */ jsx42("div", { className: "kds-monto-row-deadline", children: deadline })
|
|
2469
2497
|
] }),
|
|
2470
|
-
/* @__PURE__ */
|
|
2498
|
+
/* @__PURE__ */ jsx42("div", { className: "kds-monto-row-value", children: value })
|
|
2471
2499
|
] })
|
|
2472
2500
|
);
|
|
2473
2501
|
KdsMontoRow.displayName = "KdsMontoRow";
|
|
2474
2502
|
|
|
2475
2503
|
// src/components/domain/KdsMerchantTile/KdsMerchantTile.tsx
|
|
2476
|
-
import { forwardRef as
|
|
2477
|
-
import { jsx as
|
|
2478
|
-
var KdsMerchantTile =
|
|
2504
|
+
import { forwardRef as forwardRef41 } from "react";
|
|
2505
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2506
|
+
var KdsMerchantTile = forwardRef41(
|
|
2479
2507
|
({ name, logoUrl, initials, compact, className, ...props }, ref) => {
|
|
2480
2508
|
const displayInitials = (initials ?? name.slice(0, 2)).toUpperCase();
|
|
2481
|
-
return /* @__PURE__ */
|
|
2509
|
+
return /* @__PURE__ */ jsx43(
|
|
2482
2510
|
"div",
|
|
2483
2511
|
{
|
|
2484
2512
|
ref,
|
|
2485
2513
|
className: clsx("kds-merchant-tile", logoUrl && "logo", compact && "compact", className),
|
|
2486
2514
|
"aria-label": name,
|
|
2487
2515
|
...props,
|
|
2488
|
-
children: logoUrl ? /* @__PURE__ */
|
|
2516
|
+
children: logoUrl ? /* @__PURE__ */ jsx43("img", { src: logoUrl, alt: name }) : displayInitials
|
|
2489
2517
|
}
|
|
2490
2518
|
);
|
|
2491
2519
|
}
|
|
@@ -2493,21 +2521,98 @@ var KdsMerchantTile = forwardRef40(
|
|
|
2493
2521
|
KdsMerchantTile.displayName = "KdsMerchantTile";
|
|
2494
2522
|
|
|
2495
2523
|
// src/components/domain/KdsInvoiceMerchant/KdsInvoiceMerchant.tsx
|
|
2496
|
-
import { forwardRef as
|
|
2497
|
-
|
|
2498
|
-
|
|
2524
|
+
import { forwardRef as forwardRef42, useState as useState9 } from "react";
|
|
2525
|
+
|
|
2526
|
+
// src/components/domain/KdsInvoiceMerchant/useLogoBackdrop.ts
|
|
2527
|
+
import { useEffect as useEffect4, useState as useState8 } from "react";
|
|
2528
|
+
|
|
2529
|
+
// src/components/domain/KdsInvoiceMerchant/logoLuminance.ts
|
|
2530
|
+
var LIGHT_LOGO_LUMINANCE_THRESHOLD = 0.72;
|
|
2531
|
+
var SAMPLE_SIZE = 16;
|
|
2532
|
+
var ALPHA_THRESHOLD = 128;
|
|
2533
|
+
var MIN_OPAQUE_RATIO = 0.02;
|
|
2534
|
+
function measureLogoLuminance(url) {
|
|
2535
|
+
return new Promise((resolve) => {
|
|
2536
|
+
const probe = new Image();
|
|
2537
|
+
probe.crossOrigin = "anonymous";
|
|
2538
|
+
probe.onload = () => {
|
|
2539
|
+
try {
|
|
2540
|
+
const canvas = document.createElement("canvas");
|
|
2541
|
+
canvas.width = SAMPLE_SIZE;
|
|
2542
|
+
canvas.height = SAMPLE_SIZE;
|
|
2543
|
+
const context = canvas.getContext("2d");
|
|
2544
|
+
if (!context) {
|
|
2545
|
+
resolve(null);
|
|
2546
|
+
return;
|
|
2547
|
+
}
|
|
2548
|
+
context.drawImage(probe, 0, 0, SAMPLE_SIZE, SAMPLE_SIZE);
|
|
2549
|
+
const { data } = context.getImageData(0, 0, SAMPLE_SIZE, SAMPLE_SIZE);
|
|
2550
|
+
let sum = 0;
|
|
2551
|
+
let opaquePixels = 0;
|
|
2552
|
+
for (let i = 0; i < data.length; i += 4) {
|
|
2553
|
+
if (data[i + 3] < ALPHA_THRESHOLD) continue;
|
|
2554
|
+
sum += (0.2126 * data[i] + 0.7152 * data[i + 1] + 0.0722 * data[i + 2]) / 255;
|
|
2555
|
+
opaquePixels++;
|
|
2556
|
+
}
|
|
2557
|
+
if (opaquePixels < SAMPLE_SIZE * SAMPLE_SIZE * MIN_OPAQUE_RATIO) {
|
|
2558
|
+
resolve(null);
|
|
2559
|
+
return;
|
|
2560
|
+
}
|
|
2561
|
+
resolve(sum / opaquePixels);
|
|
2562
|
+
} catch {
|
|
2563
|
+
resolve(null);
|
|
2564
|
+
}
|
|
2565
|
+
};
|
|
2566
|
+
probe.onerror = () => resolve(null);
|
|
2567
|
+
probe.src = url;
|
|
2568
|
+
});
|
|
2569
|
+
}
|
|
2570
|
+
function pickLogoBackdrop(luminance) {
|
|
2571
|
+
return luminance != null && luminance > LIGHT_LOGO_LUMINANCE_THRESHOLD ? "dark" : "light";
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
// src/components/domain/KdsInvoiceMerchant/useLogoBackdrop.ts
|
|
2575
|
+
function useLogoBackdrop(logoUrl) {
|
|
2576
|
+
const [backdrop, setBackdrop] = useState8("light");
|
|
2577
|
+
useEffect4(() => {
|
|
2578
|
+
let cancelled = false;
|
|
2579
|
+
setBackdrop("light");
|
|
2580
|
+
if (!logoUrl) {
|
|
2581
|
+
return void 0;
|
|
2582
|
+
}
|
|
2583
|
+
measureLogoLuminance(logoUrl).then((luminance) => {
|
|
2584
|
+
if (!cancelled) {
|
|
2585
|
+
setBackdrop(pickLogoBackdrop(luminance));
|
|
2586
|
+
}
|
|
2587
|
+
});
|
|
2588
|
+
return () => {
|
|
2589
|
+
cancelled = true;
|
|
2590
|
+
};
|
|
2591
|
+
}, [logoUrl]);
|
|
2592
|
+
return backdrop;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
// src/components/domain/KdsInvoiceMerchant/KdsInvoiceMerchant.tsx
|
|
2596
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2597
|
+
var KdsInvoiceMerchant = forwardRef42(
|
|
2499
2598
|
({ logoUrl, brandColor, className, style, ...props }, ref) => {
|
|
2500
|
-
const [failed, setFailed] =
|
|
2599
|
+
const [failed, setFailed] = useState9(false);
|
|
2501
2600
|
const showLogo = !!logoUrl && !failed;
|
|
2502
|
-
|
|
2601
|
+
const backdrop = useLogoBackdrop(showLogo ? logoUrl : void 0);
|
|
2602
|
+
return /* @__PURE__ */ jsx44(
|
|
2503
2603
|
"div",
|
|
2504
2604
|
{
|
|
2505
2605
|
ref,
|
|
2506
|
-
className: clsx(
|
|
2606
|
+
className: clsx(
|
|
2607
|
+
"kds-invoice-merchant",
|
|
2608
|
+
showLogo && "kds-invoice-merchant-neutral",
|
|
2609
|
+
showLogo && backdrop === "dark" && "dark",
|
|
2610
|
+
className
|
|
2611
|
+
),
|
|
2507
2612
|
"aria-hidden": "true",
|
|
2508
|
-
style: brandColor ? { background: brandColor, ...style } : style,
|
|
2613
|
+
style: !showLogo && brandColor ? { background: brandColor, ...style } : style,
|
|
2509
2614
|
...props,
|
|
2510
|
-
children: showLogo ? /* @__PURE__ */
|
|
2615
|
+
children: showLogo ? /* @__PURE__ */ jsx44("img", { src: logoUrl, alt: "", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx44("i", { className: "material-symbols-outlined", children: "storefront" })
|
|
2511
2616
|
}
|
|
2512
2617
|
);
|
|
2513
2618
|
}
|
|
@@ -2515,9 +2620,9 @@ var KdsInvoiceMerchant = forwardRef41(
|
|
|
2515
2620
|
KdsInvoiceMerchant.displayName = "KdsInvoiceMerchant";
|
|
2516
2621
|
|
|
2517
2622
|
// src/components/domain/KdsPaymentTotal/KdsPaymentTotal.tsx
|
|
2518
|
-
import { forwardRef as
|
|
2519
|
-
import { jsx as
|
|
2520
|
-
var KdsPaymentTotal =
|
|
2623
|
+
import { forwardRef as forwardRef43 } from "react";
|
|
2624
|
+
import { jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2625
|
+
var KdsPaymentTotal = forwardRef43(
|
|
2521
2626
|
({
|
|
2522
2627
|
variant = "default",
|
|
2523
2628
|
tone = "brand",
|
|
@@ -2535,7 +2640,7 @@ var KdsPaymentTotal = forwardRef42(
|
|
|
2535
2640
|
const { integer, fraction } = formatAmount(amount, decimals, locale);
|
|
2536
2641
|
const isEmail = variant === "email";
|
|
2537
2642
|
const isInfoTone = tone === "info";
|
|
2538
|
-
return /* @__PURE__ */
|
|
2643
|
+
return /* @__PURE__ */ jsxs33(
|
|
2539
2644
|
"div",
|
|
2540
2645
|
{
|
|
2541
2646
|
ref,
|
|
@@ -2548,14 +2653,14 @@ var KdsPaymentTotal = forwardRef42(
|
|
|
2548
2653
|
),
|
|
2549
2654
|
...props,
|
|
2550
2655
|
children: [
|
|
2551
|
-
!isEmail && title != null && /* @__PURE__ */
|
|
2552
|
-
!isEmail && titleMobile != null && /* @__PURE__ */
|
|
2553
|
-
label != null && /* @__PURE__ */
|
|
2554
|
-
/* @__PURE__ */
|
|
2656
|
+
!isEmail && title != null && /* @__PURE__ */ jsx45("h5", { className: "kds-payment-total-title", children: title }),
|
|
2657
|
+
!isEmail && titleMobile != null && /* @__PURE__ */ jsx45("h5", { className: "kds-payment-total-title-mobile", children: titleMobile }),
|
|
2658
|
+
label != null && /* @__PURE__ */ jsx45("h6", { className: "kds-payment-label", children: label }),
|
|
2659
|
+
/* @__PURE__ */ jsxs33("h5", { className: "kds-payment-amount", children: [
|
|
2555
2660
|
currency,
|
|
2556
2661
|
" ",
|
|
2557
2662
|
integer,
|
|
2558
|
-
fraction !== null && /* @__PURE__ */
|
|
2663
|
+
fraction !== null && /* @__PURE__ */ jsx45("sup", { className: "kds-payment-total-decimal-sup", children: fraction })
|
|
2559
2664
|
] })
|
|
2560
2665
|
]
|
|
2561
2666
|
}
|
|
@@ -2591,10 +2696,10 @@ function formatAmount(amount, decimals, locale) {
|
|
|
2591
2696
|
}
|
|
2592
2697
|
|
|
2593
2698
|
// src/components/domain/KdsBillAttachment/KdsBillAttachment.tsx
|
|
2594
|
-
import { forwardRef as
|
|
2595
|
-
import { jsx as
|
|
2596
|
-
var KdsBillAttachment =
|
|
2597
|
-
({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */
|
|
2699
|
+
import { forwardRef as forwardRef44 } from "react";
|
|
2700
|
+
import { jsx as jsx46, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2701
|
+
var KdsBillAttachment = forwardRef44(
|
|
2702
|
+
({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ jsxs34(
|
|
2598
2703
|
"a",
|
|
2599
2704
|
{
|
|
2600
2705
|
ref,
|
|
@@ -2604,25 +2709,119 @@ var KdsBillAttachment = forwardRef43(
|
|
|
2604
2709
|
className: clsx("kds-bill-attachment", className),
|
|
2605
2710
|
...props,
|
|
2606
2711
|
children: [
|
|
2607
|
-
/* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */
|
|
2712
|
+
/* @__PURE__ */ jsx46("i", { className: "material-symbols-outlined", children: icon }),
|
|
2713
|
+
/* @__PURE__ */ jsx46("span", { children: filename })
|
|
2609
2714
|
]
|
|
2610
2715
|
}
|
|
2611
2716
|
)
|
|
2612
2717
|
);
|
|
2613
2718
|
KdsBillAttachment.displayName = "KdsBillAttachment";
|
|
2614
|
-
var KdsBillAttachments =
|
|
2615
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2719
|
+
var KdsBillAttachments = forwardRef44(
|
|
2720
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx46("div", { ref, className: clsx("kds-bill-attachments", className), ...props, children })
|
|
2616
2721
|
);
|
|
2617
2722
|
KdsBillAttachments.displayName = "KdsBillAttachments";
|
|
2618
2723
|
|
|
2724
|
+
// src/utils/runAfterPointerGesture.ts
|
|
2725
|
+
var KEYBOARD_FALLBACK_MS = 400;
|
|
2726
|
+
var runAfterPointerGesture = (callback) => {
|
|
2727
|
+
let done = false;
|
|
2728
|
+
const run = () => {
|
|
2729
|
+
if (done) {
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
done = true;
|
|
2733
|
+
document.removeEventListener("click", run, true);
|
|
2734
|
+
window.setTimeout(callback, 0);
|
|
2735
|
+
};
|
|
2736
|
+
document.addEventListener("click", run, true);
|
|
2737
|
+
window.setTimeout(run, KEYBOARD_FALLBACK_MS);
|
|
2738
|
+
};
|
|
2739
|
+
|
|
2740
|
+
// src/utils/scrollToFirstInvalidField.ts
|
|
2741
|
+
var RECENTER_WINDOW_MS = 1500;
|
|
2742
|
+
var getScrollParent = (field) => {
|
|
2743
|
+
let node = field.parentElement;
|
|
2744
|
+
while (node) {
|
|
2745
|
+
const style = getComputedStyle(node);
|
|
2746
|
+
if (node.scrollHeight > node.clientHeight && /auto|scroll|overlay/.test(style.overflowY)) {
|
|
2747
|
+
const htmlOverflow = getComputedStyle(document.documentElement).overflowY;
|
|
2748
|
+
if (node === document.body && (htmlOverflow === "visible" || htmlOverflow === "")) {
|
|
2749
|
+
return null;
|
|
2750
|
+
}
|
|
2751
|
+
return node;
|
|
2752
|
+
}
|
|
2753
|
+
node = node.parentElement;
|
|
2754
|
+
}
|
|
2755
|
+
return null;
|
|
2756
|
+
};
|
|
2757
|
+
var centerFieldInViewport = (field) => {
|
|
2758
|
+
const viewport = window.visualViewport;
|
|
2759
|
+
const viewportTop = viewport?.offsetTop ?? 0;
|
|
2760
|
+
const viewportHeight = viewport?.height ?? window.innerHeight;
|
|
2761
|
+
const rect = field.getBoundingClientRect();
|
|
2762
|
+
const scroller = getScrollParent(field);
|
|
2763
|
+
if (!scroller || scroller === document.documentElement || scroller === document.scrollingElement) {
|
|
2764
|
+
const top = window.scrollY + rect.top - viewportTop - (viewportHeight - rect.height) / 2;
|
|
2765
|
+
window.scrollTo({ top: Math.max(top, 0), behavior: "smooth" });
|
|
2766
|
+
return;
|
|
2767
|
+
}
|
|
2768
|
+
const scrollerRect = scroller.getBoundingClientRect();
|
|
2769
|
+
const visibleTop = Math.max(scrollerRect.top, viewportTop);
|
|
2770
|
+
const visibleBottom = Math.min(scrollerRect.bottom, viewportTop + viewportHeight);
|
|
2771
|
+
const visibleHeight = Math.max(visibleBottom - visibleTop, 0);
|
|
2772
|
+
const target = scroller.scrollTop + (rect.top - visibleTop) - (visibleHeight - rect.height) / 2;
|
|
2773
|
+
scroller.scrollTo({ top: Math.max(target, 0), behavior: "smooth" });
|
|
2774
|
+
};
|
|
2775
|
+
var isInvalidField = (element) => {
|
|
2776
|
+
const field = element;
|
|
2777
|
+
return typeof field.willValidate === "boolean" && field.willValidate && !field.validity.valid;
|
|
2778
|
+
};
|
|
2779
|
+
var scrollToFirstInvalidField = (form) => {
|
|
2780
|
+
const firstInvalid = Array.from(form.elements).find(isInvalidField);
|
|
2781
|
+
if (!firstInvalid) {
|
|
2782
|
+
return;
|
|
2783
|
+
}
|
|
2784
|
+
centerFieldInViewport(firstInvalid);
|
|
2785
|
+
const viewport = window.visualViewport;
|
|
2786
|
+
if (viewport) {
|
|
2787
|
+
const recenter = () => centerFieldInViewport(firstInvalid);
|
|
2788
|
+
viewport.addEventListener("resize", recenter, { once: true });
|
|
2789
|
+
window.setTimeout(() => viewport.removeEventListener("resize", recenter), RECENTER_WINDOW_MS);
|
|
2790
|
+
}
|
|
2791
|
+
};
|
|
2792
|
+
var focusFirstInvalidField = scrollToFirstInvalidField;
|
|
2793
|
+
var isTextEntryElement = (element) => {
|
|
2794
|
+
if (!element) {
|
|
2795
|
+
return false;
|
|
2796
|
+
}
|
|
2797
|
+
if (element.tagName === "TEXTAREA") {
|
|
2798
|
+
return true;
|
|
2799
|
+
}
|
|
2800
|
+
const input = element;
|
|
2801
|
+
return element.tagName === "INPUT" && !["checkbox", "radio", "button", "submit", "reset"].includes(input.type);
|
|
2802
|
+
};
|
|
2803
|
+
var guideToFirstInvalidFieldOnBlur = (form) => {
|
|
2804
|
+
runAfterPointerGesture(() => {
|
|
2805
|
+
if (!form.isConnected) {
|
|
2806
|
+
return;
|
|
2807
|
+
}
|
|
2808
|
+
const active = document.activeElement;
|
|
2809
|
+
if (active && form.contains(active) && isTextEntryElement(active)) {
|
|
2810
|
+
return;
|
|
2811
|
+
}
|
|
2812
|
+
if (!form.checkValidity()) {
|
|
2813
|
+
scrollToFirstInvalidField(form);
|
|
2814
|
+
}
|
|
2815
|
+
});
|
|
2816
|
+
};
|
|
2817
|
+
|
|
2619
2818
|
// src/components/core/hooks/useStickyInvoiceCollapse.ts
|
|
2620
|
-
import { useEffect as
|
|
2819
|
+
import { useEffect as useEffect5, useRef as useRef4 } from "react";
|
|
2621
2820
|
function useStickyInvoiceCollapse(options = {}) {
|
|
2622
2821
|
const { onCollapseStart, collapseEnd = 20, mobileBreakpoint = 768 } = options;
|
|
2623
2822
|
const onCollapseStartRef = useRef4(onCollapseStart);
|
|
2624
2823
|
onCollapseStartRef.current = onCollapseStart;
|
|
2625
|
-
|
|
2824
|
+
useEffect5(() => {
|
|
2626
2825
|
let viewportOffset = 0;
|
|
2627
2826
|
let ticking = false;
|
|
2628
2827
|
let wasCollapsing = false;
|
|
@@ -2695,13 +2894,13 @@ function useStickyInvoiceCollapse(options = {}) {
|
|
|
2695
2894
|
}
|
|
2696
2895
|
|
|
2697
2896
|
// src/components/core/hooks/useExpandToggle.ts
|
|
2698
|
-
import { useCallback as useCallback4, useId, useLayoutEffect, useRef as useRef5, useState as
|
|
2897
|
+
import { useCallback as useCallback4, useId, useLayoutEffect, useRef as useRef5, useState as useState10 } from "react";
|
|
2699
2898
|
function useExpandToggle(options = {}) {
|
|
2700
2899
|
const { defaultOpen = false, open: controlledOpen, onOpenChange, id } = options;
|
|
2701
2900
|
const generatedId = useId();
|
|
2702
2901
|
const panelId = id ?? `kds-expand-${generatedId}`;
|
|
2703
2902
|
const isControlled = controlledOpen !== void 0;
|
|
2704
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
2903
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState10(defaultOpen);
|
|
2705
2904
|
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
2706
2905
|
const panelRef = useRef5(null);
|
|
2707
2906
|
const setPanelRef = useCallback4((node) => {
|
|
@@ -2744,11 +2943,11 @@ function useExpandToggle(options = {}) {
|
|
|
2744
2943
|
}
|
|
2745
2944
|
|
|
2746
2945
|
// src/components/core/hooks/useHideOnScroll.ts
|
|
2747
|
-
import { useEffect as
|
|
2946
|
+
import { useEffect as useEffect6, useState as useState11 } from "react";
|
|
2748
2947
|
function useHideOnScroll(options = {}) {
|
|
2749
2948
|
const { threshold = 8, topOffset = 0 } = options;
|
|
2750
|
-
const [hidden, setHidden] =
|
|
2751
|
-
|
|
2949
|
+
const [hidden, setHidden] = useState11(false);
|
|
2950
|
+
useEffect6(() => {
|
|
2752
2951
|
let viewportOffset = 0;
|
|
2753
2952
|
let lastY = 0;
|
|
2754
2953
|
let ticking = false;
|
|
@@ -2789,6 +2988,23 @@ function useHideOnScroll(options = {}) {
|
|
|
2789
2988
|
}, [threshold, topOffset]);
|
|
2790
2989
|
return { hidden };
|
|
2791
2990
|
}
|
|
2991
|
+
|
|
2992
|
+
// src/components/core/hooks/useMediaQuery.ts
|
|
2993
|
+
import { useEffect as useEffect7, useState as useState12 } from "react";
|
|
2994
|
+
function useMediaQuery(query) {
|
|
2995
|
+
const [matches, setMatches] = useState12(
|
|
2996
|
+
() => typeof window !== "undefined" ? window.matchMedia(query).matches : false
|
|
2997
|
+
);
|
|
2998
|
+
useEffect7(() => {
|
|
2999
|
+
if (typeof window === "undefined") return;
|
|
3000
|
+
const mql = window.matchMedia(query);
|
|
3001
|
+
setMatches(mql.matches);
|
|
3002
|
+
const onChange = (event) => setMatches(event.matches);
|
|
3003
|
+
mql.addEventListener("change", onChange);
|
|
3004
|
+
return () => mql.removeEventListener("change", onChange);
|
|
3005
|
+
}, [query]);
|
|
3006
|
+
return matches;
|
|
3007
|
+
}
|
|
2792
3008
|
export {
|
|
2793
3009
|
KdsAccordion,
|
|
2794
3010
|
KdsAccordionDetails,
|
|
@@ -2814,6 +3030,7 @@ export {
|
|
|
2814
3030
|
KdsCopyableTable,
|
|
2815
3031
|
KdsCountdown,
|
|
2816
3032
|
KdsDivider,
|
|
3033
|
+
KdsEmptyState,
|
|
2817
3034
|
KdsExpandPanel,
|
|
2818
3035
|
KdsFab,
|
|
2819
3036
|
KdsInvoiceMerchant,
|
|
@@ -2842,11 +3059,14 @@ export {
|
|
|
2842
3059
|
KdsThemeProvider,
|
|
2843
3060
|
KdsTooltip,
|
|
2844
3061
|
KdsTypography,
|
|
3062
|
+
LIGHT_LOGO_LUMINANCE_THRESHOLD,
|
|
2845
3063
|
borderRadius,
|
|
2846
3064
|
breakpoints,
|
|
3065
|
+
centerFieldInViewport,
|
|
2847
3066
|
clsx,
|
|
2848
3067
|
colors,
|
|
2849
3068
|
colorsByMode,
|
|
3069
|
+
focusFirstInvalidField,
|
|
2850
3070
|
fontFamilies,
|
|
2851
3071
|
fontSizes,
|
|
2852
3072
|
fontWeights,
|
|
@@ -2854,9 +3074,14 @@ export {
|
|
|
2854
3074
|
formatDateTime,
|
|
2855
3075
|
formatTime,
|
|
2856
3076
|
getContrastColor,
|
|
3077
|
+
guideToFirstInvalidFieldOnBlur,
|
|
2857
3078
|
letterSpacings,
|
|
2858
3079
|
lighten,
|
|
2859
3080
|
lineHeights,
|
|
3081
|
+
measureLogoLuminance,
|
|
3082
|
+
pickLogoBackdrop,
|
|
3083
|
+
runAfterPointerGesture,
|
|
3084
|
+
scrollToFirstInvalidField,
|
|
2860
3085
|
semanticSpacing,
|
|
2861
3086
|
shadows,
|
|
2862
3087
|
spacing,
|
|
@@ -2869,6 +3094,8 @@ export {
|
|
|
2869
3094
|
useCountdown,
|
|
2870
3095
|
useExpandToggle,
|
|
2871
3096
|
useHideOnScroll,
|
|
3097
|
+
useLogoBackdrop,
|
|
3098
|
+
useMediaQuery,
|
|
2872
3099
|
useStickyInvoiceCollapse,
|
|
2873
3100
|
useTabsKeyboard,
|
|
2874
3101
|
zIndex
|