@khipu/design-system 0.2.0-alpha.24 → 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 +171 -1
- package/dist/beercss/khipu-beercss.min.css +1 -1
- package/dist/beercss/metadata.json +4 -4
- package/dist/index.d.mts +105 -1
- package/dist/index.d.ts +105 -1
- package/dist/index.js +90 -8
- package/dist/index.mjs +89 -8
- package/package.json +1 -1
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,
|
|
@@ -2181,11 +2187,85 @@ var KdsMerchantTile = forwardRef35(
|
|
|
2181
2187
|
);
|
|
2182
2188
|
KdsMerchantTile.displayName = "KdsMerchantTile";
|
|
2183
2189
|
|
|
2184
|
-
// src/components/domain/
|
|
2190
|
+
// src/components/domain/KdsPaymentTotal/KdsPaymentTotal.tsx
|
|
2185
2191
|
import { forwardRef as forwardRef36 } from "react";
|
|
2186
2192
|
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2187
|
-
var
|
|
2188
|
-
({
|
|
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(
|
|
2189
2269
|
"a",
|
|
2190
2270
|
{
|
|
2191
2271
|
ref,
|
|
@@ -2195,15 +2275,15 @@ var KdsBillAttachment = forwardRef36(
|
|
|
2195
2275
|
className: clsx("kds-bill-attachment", className),
|
|
2196
2276
|
...props,
|
|
2197
2277
|
children: [
|
|
2198
|
-
/* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2278
|
+
/* @__PURE__ */ jsx39("i", { className: "material-symbols-outlined", children: icon }),
|
|
2279
|
+
/* @__PURE__ */ jsx39("span", { children: filename })
|
|
2200
2280
|
]
|
|
2201
2281
|
}
|
|
2202
2282
|
)
|
|
2203
2283
|
);
|
|
2204
2284
|
KdsBillAttachment.displayName = "KdsBillAttachment";
|
|
2205
|
-
var KdsBillAttachments =
|
|
2206
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2285
|
+
var KdsBillAttachments = forwardRef37(
|
|
2286
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx39("div", { ref, className: clsx("kds-bill-attachments", className), ...props, children })
|
|
2207
2287
|
);
|
|
2208
2288
|
KdsBillAttachments.displayName = "KdsBillAttachments";
|
|
2209
2289
|
export {
|
|
@@ -2235,6 +2315,7 @@ export {
|
|
|
2235
2315
|
KdsLinearProgress,
|
|
2236
2316
|
KdsMerchantTile,
|
|
2237
2317
|
KdsMontoRow,
|
|
2318
|
+
KdsPaymentTotal,
|
|
2238
2319
|
KdsQrRow,
|
|
2239
2320
|
KdsRadioGroup,
|
|
2240
2321
|
KdsRecapList,
|
package/package.json
CHANGED