@khipu/design-system 0.2.0-alpha.24 → 0.2.0-alpha.26

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/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,87 @@ var KdsMerchantTile = forwardRef35(
2181
2187
  );
2182
2188
  KdsMerchantTile.displayName = "KdsMerchantTile";
2183
2189
 
2184
- // src/components/domain/KdsBillAttachment/KdsBillAttachment.tsx
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 KdsBillAttachment = forwardRef36(
2188
- ({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ jsxs28(
2193
+ var KdsPaymentTotal = forwardRef36(
2194
+ ({
2195
+ variant = "default",
2196
+ tone = "brand",
2197
+ centered = false,
2198
+ amount,
2199
+ currency = "S/",
2200
+ decimals = 2,
2201
+ locale = "es-PE",
2202
+ label = "Monto a pagar",
2203
+ title = "Escanea el QR",
2204
+ titleMobile = "Descarga el QR",
2205
+ className,
2206
+ ...props
2207
+ }, ref) => {
2208
+ const { integer, fraction } = formatAmount(amount, decimals, locale);
2209
+ const isEmail = variant === "email";
2210
+ const isInfoTone = tone === "info";
2211
+ return /* @__PURE__ */ jsxs28(
2212
+ "div",
2213
+ {
2214
+ ref,
2215
+ className: clsx(
2216
+ "kds-payment-total",
2217
+ isEmail && "kds-payment-total--email",
2218
+ isInfoTone && "kds-payment-total--tone-info",
2219
+ centered && "kds-payment-total--centered",
2220
+ className
2221
+ ),
2222
+ ...props,
2223
+ children: [
2224
+ !isEmail && title != null && /* @__PURE__ */ jsx38("h5", { className: "kds-payment-total-title", children: title }),
2225
+ !isEmail && titleMobile != null && /* @__PURE__ */ jsx38("h5", { className: "kds-payment-total-title-mobile", children: titleMobile }),
2226
+ label != null && /* @__PURE__ */ jsx38("h6", { className: "kds-payment-label", children: label }),
2227
+ /* @__PURE__ */ jsxs28("h5", { className: "kds-payment-amount", children: [
2228
+ currency,
2229
+ " ",
2230
+ integer,
2231
+ fraction !== null && /* @__PURE__ */ jsx38("sup", { className: "kds-payment-total-decimal-sup", children: fraction })
2232
+ ] })
2233
+ ]
2234
+ }
2235
+ );
2236
+ }
2237
+ );
2238
+ KdsPaymentTotal.displayName = "KdsPaymentTotal";
2239
+ function formatAmount(amount, decimals, locale) {
2240
+ const showDecimals = typeof decimals === "number" && decimals > 0;
2241
+ if (typeof amount === "number") {
2242
+ if (showDecimals) {
2243
+ const fixed = amount.toFixed(decimals);
2244
+ const [int, frac] = fixed.split(".");
2245
+ const formattedInt2 = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
2246
+ Number(int)
2247
+ );
2248
+ return { integer: formattedInt2, fraction: frac ?? null };
2249
+ }
2250
+ const formattedInt = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(
2251
+ Math.trunc(amount)
2252
+ );
2253
+ return { integer: formattedInt, fraction: null };
2254
+ }
2255
+ const str = amount.trim();
2256
+ const dotIdx = str.indexOf(".");
2257
+ if (dotIdx === -1 || !showDecimals) {
2258
+ return { integer: str, fraction: null };
2259
+ }
2260
+ return {
2261
+ integer: str.slice(0, dotIdx),
2262
+ fraction: str.slice(dotIdx + 1)
2263
+ };
2264
+ }
2265
+
2266
+ // src/components/domain/KdsBillAttachment/KdsBillAttachment.tsx
2267
+ import { forwardRef as forwardRef37 } from "react";
2268
+ import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
2269
+ var KdsBillAttachment = forwardRef37(
2270
+ ({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ jsxs29(
2189
2271
  "a",
2190
2272
  {
2191
2273
  ref,
@@ -2195,15 +2277,15 @@ var KdsBillAttachment = forwardRef36(
2195
2277
  className: clsx("kds-bill-attachment", className),
2196
2278
  ...props,
2197
2279
  children: [
2198
- /* @__PURE__ */ jsx38("i", { className: "material-symbols-outlined", children: icon }),
2199
- /* @__PURE__ */ jsx38("span", { children: filename })
2280
+ /* @__PURE__ */ jsx39("i", { className: "material-symbols-outlined", children: icon }),
2281
+ /* @__PURE__ */ jsx39("span", { children: filename })
2200
2282
  ]
2201
2283
  }
2202
2284
  )
2203
2285
  );
2204
2286
  KdsBillAttachment.displayName = "KdsBillAttachment";
2205
- var KdsBillAttachments = forwardRef36(
2206
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx38("div", { ref, className: clsx("kds-bill-attachments", className), ...props, children })
2287
+ var KdsBillAttachments = forwardRef37(
2288
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx39("div", { ref, className: clsx("kds-bill-attachments", className), ...props, children })
2207
2289
  );
2208
2290
  KdsBillAttachments.displayName = "KdsBillAttachments";
2209
2291
  export {
@@ -2235,6 +2317,7 @@ export {
2235
2317
  KdsLinearProgress,
2236
2318
  KdsMerchantTile,
2237
2319
  KdsMontoRow,
2320
+ KdsPaymentTotal,
2238
2321
  KdsQrRow,
2239
2322
  KdsRadioGroup,
2240
2323
  KdsRecapList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khipu/design-system",
3
- "version": "0.2.0-alpha.24",
3
+ "version": "0.2.0-alpha.26",
4
4
  "description": "Khipu Design System - UI components and design tokens for the Khipu payment platform",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",