@khipu/design-system 0.2.0-alpha.9 → 0.2.0-alpha.90
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 +1541 -165
- package/dist/beercss/khipu-beercss.js +82 -4
- 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 +8395 -0
- package/dist/beercss/khipu-beercss.scoped.min.css +1 -0
- package/dist/beercss/metadata.json +8 -4
- package/dist/index.d.mts +943 -265
- package/dist/index.d.ts +943 -265
- package/dist/index.js +1311 -522
- package/dist/index.mjs +1281 -500
- package/package.json +12 -9
- package/dist/khipu-logo-color-TV75AKOV.svg +0 -19
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import * as Select from '@radix-ui/react-select';
|
|
5
4
|
export { clsx } from 'clsx';
|
|
6
5
|
|
|
7
6
|
interface KdsThemeProviderProps {
|
|
@@ -239,6 +238,7 @@ declare const colors: {
|
|
|
239
238
|
main: string;
|
|
240
239
|
light: string;
|
|
241
240
|
dark: string;
|
|
241
|
+
warm: string;
|
|
242
242
|
container: string;
|
|
243
243
|
contrastText: string;
|
|
244
244
|
};
|
|
@@ -255,6 +255,7 @@ declare const colors: {
|
|
|
255
255
|
main: string;
|
|
256
256
|
light: string;
|
|
257
257
|
dark: string;
|
|
258
|
+
blue: string;
|
|
258
259
|
container: string;
|
|
259
260
|
contrastText: string;
|
|
260
261
|
};
|
|
@@ -367,6 +368,7 @@ declare const fontWeights: {
|
|
|
367
368
|
readonly bold: 700;
|
|
368
369
|
};
|
|
369
370
|
declare const fontSizes: {
|
|
371
|
+
readonly '2xs': "0.625rem";
|
|
370
372
|
readonly xs: "0.75rem";
|
|
371
373
|
readonly sm: "0.875rem";
|
|
372
374
|
readonly base: "1rem";
|
|
@@ -376,6 +378,7 @@ declare const fontSizes: {
|
|
|
376
378
|
readonly '2xl': "1.5rem";
|
|
377
379
|
readonly '3xl': "1.875rem";
|
|
378
380
|
readonly '4xl': "2.25rem";
|
|
381
|
+
readonly decimalSup: "0.5em";
|
|
379
382
|
};
|
|
380
383
|
declare const lineHeights: {
|
|
381
384
|
readonly tight: 1.2;
|
|
@@ -694,6 +697,7 @@ declare const tokensByMode: {
|
|
|
694
697
|
main: string;
|
|
695
698
|
light: string;
|
|
696
699
|
dark: string;
|
|
700
|
+
warm: string;
|
|
697
701
|
container: string;
|
|
698
702
|
contrastText: string;
|
|
699
703
|
};
|
|
@@ -710,6 +714,7 @@ declare const tokensByMode: {
|
|
|
710
714
|
main: string;
|
|
711
715
|
light: string;
|
|
712
716
|
dark: string;
|
|
717
|
+
blue: string;
|
|
713
718
|
container: string;
|
|
714
719
|
contrastText: string;
|
|
715
720
|
};
|
|
@@ -822,6 +827,7 @@ declare const tokensByMode: {
|
|
|
822
827
|
readonly bold: 700;
|
|
823
828
|
};
|
|
824
829
|
readonly fontSizes: {
|
|
830
|
+
readonly '2xs': "0.625rem";
|
|
825
831
|
readonly xs: "0.75rem";
|
|
826
832
|
readonly sm: "0.875rem";
|
|
827
833
|
readonly base: "1rem";
|
|
@@ -831,6 +837,7 @@ declare const tokensByMode: {
|
|
|
831
837
|
readonly '2xl': "1.5rem";
|
|
832
838
|
readonly '3xl': "1.875rem";
|
|
833
839
|
readonly '4xl': "2.25rem";
|
|
840
|
+
readonly decimalSup: "0.5em";
|
|
834
841
|
};
|
|
835
842
|
readonly lineHeights: {
|
|
836
843
|
readonly tight: 1.2;
|
|
@@ -1127,6 +1134,11 @@ declare const tokensByMode: {
|
|
|
1127
1134
|
};
|
|
1128
1135
|
};
|
|
1129
1136
|
readonly responsiveBaseFontSizes: {
|
|
1137
|
+
readonly '2xs': {
|
|
1138
|
+
readonly mobile: "0.5625rem";
|
|
1139
|
+
readonly tablet: "0.625rem";
|
|
1140
|
+
readonly desktop: "0.625rem";
|
|
1141
|
+
};
|
|
1130
1142
|
readonly xs: {
|
|
1131
1143
|
readonly mobile: "0.6875rem";
|
|
1132
1144
|
readonly tablet: "0.75rem";
|
|
@@ -1285,6 +1297,7 @@ declare const tokensByMode: {
|
|
|
1285
1297
|
main: string;
|
|
1286
1298
|
light: string;
|
|
1287
1299
|
dark: string;
|
|
1300
|
+
warm: string;
|
|
1288
1301
|
container: string;
|
|
1289
1302
|
contrastText: string;
|
|
1290
1303
|
};
|
|
@@ -1301,6 +1314,7 @@ declare const tokensByMode: {
|
|
|
1301
1314
|
main: string;
|
|
1302
1315
|
light: string;
|
|
1303
1316
|
dark: string;
|
|
1317
|
+
blue: string;
|
|
1304
1318
|
container: string;
|
|
1305
1319
|
contrastText: string;
|
|
1306
1320
|
};
|
|
@@ -1411,6 +1425,7 @@ declare const tokensByMode: {
|
|
|
1411
1425
|
readonly bold: 700;
|
|
1412
1426
|
};
|
|
1413
1427
|
readonly fontSizes: {
|
|
1428
|
+
readonly '2xs': "0.625rem";
|
|
1414
1429
|
readonly xs: "0.75rem";
|
|
1415
1430
|
readonly sm: "0.875rem";
|
|
1416
1431
|
readonly base: "1rem";
|
|
@@ -1420,6 +1435,7 @@ declare const tokensByMode: {
|
|
|
1420
1435
|
readonly '2xl': "1.5rem";
|
|
1421
1436
|
readonly '3xl': "1.875rem";
|
|
1422
1437
|
readonly '4xl': "2.25rem";
|
|
1438
|
+
readonly decimalSup: "0.5em";
|
|
1423
1439
|
};
|
|
1424
1440
|
readonly lineHeights: {
|
|
1425
1441
|
readonly tight: 1.2;
|
|
@@ -1716,6 +1732,11 @@ declare const tokensByMode: {
|
|
|
1716
1732
|
};
|
|
1717
1733
|
};
|
|
1718
1734
|
readonly responsiveBaseFontSizes: {
|
|
1735
|
+
readonly '2xs': {
|
|
1736
|
+
readonly mobile: "0.5625rem";
|
|
1737
|
+
readonly tablet: "0.625rem";
|
|
1738
|
+
readonly desktop: "0.625rem";
|
|
1739
|
+
};
|
|
1719
1740
|
readonly xs: {
|
|
1720
1741
|
readonly mobile: "0.6875rem";
|
|
1721
1742
|
readonly tablet: "0.75rem";
|
|
@@ -1881,6 +1902,7 @@ declare const tokens: {
|
|
|
1881
1902
|
main: string;
|
|
1882
1903
|
light: string;
|
|
1883
1904
|
dark: string;
|
|
1905
|
+
warm: string;
|
|
1884
1906
|
container: string;
|
|
1885
1907
|
contrastText: string;
|
|
1886
1908
|
};
|
|
@@ -1897,6 +1919,7 @@ declare const tokens: {
|
|
|
1897
1919
|
main: string;
|
|
1898
1920
|
light: string;
|
|
1899
1921
|
dark: string;
|
|
1922
|
+
blue: string;
|
|
1900
1923
|
container: string;
|
|
1901
1924
|
contrastText: string;
|
|
1902
1925
|
};
|
|
@@ -2009,6 +2032,7 @@ declare const tokens: {
|
|
|
2009
2032
|
readonly bold: 700;
|
|
2010
2033
|
};
|
|
2011
2034
|
readonly fontSizes: {
|
|
2035
|
+
readonly '2xs': "0.625rem";
|
|
2012
2036
|
readonly xs: "0.75rem";
|
|
2013
2037
|
readonly sm: "0.875rem";
|
|
2014
2038
|
readonly base: "1rem";
|
|
@@ -2018,6 +2042,7 @@ declare const tokens: {
|
|
|
2018
2042
|
readonly '2xl': "1.5rem";
|
|
2019
2043
|
readonly '3xl': "1.875rem";
|
|
2020
2044
|
readonly '4xl': "2.25rem";
|
|
2045
|
+
readonly decimalSup: "0.5em";
|
|
2021
2046
|
};
|
|
2022
2047
|
readonly lineHeights: {
|
|
2023
2048
|
readonly tight: 1.2;
|
|
@@ -2314,6 +2339,11 @@ declare const tokens: {
|
|
|
2314
2339
|
};
|
|
2315
2340
|
};
|
|
2316
2341
|
readonly responsiveBaseFontSizes: {
|
|
2342
|
+
readonly '2xs': {
|
|
2343
|
+
readonly mobile: "0.5625rem";
|
|
2344
|
+
readonly tablet: "0.625rem";
|
|
2345
|
+
readonly desktop: "0.625rem";
|
|
2346
|
+
};
|
|
2317
2347
|
readonly xs: {
|
|
2318
2348
|
readonly mobile: "0.6875rem";
|
|
2319
2349
|
readonly tablet: "0.75rem";
|
|
@@ -2475,7 +2505,7 @@ type Typography = typeof typography;
|
|
|
2475
2505
|
* Matches the Figma design: Pagos Automáticos - MUI v610
|
|
2476
2506
|
*/
|
|
2477
2507
|
|
|
2478
|
-
type KdsButtonVariant = 'primary' | 'secondary' | 'outlined' | 'outlined-white' | 'text' | 'success';
|
|
2508
|
+
type KdsButtonVariant = 'primary' | 'secondary' | 'outlined' | 'outlined-white' | 'text' | 'success' | 'warning' | 'error' | 'error-text';
|
|
2479
2509
|
type KdsButtonSize = 'sm' | 'md';
|
|
2480
2510
|
interface KdsButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2481
2511
|
/** Visual style variant */
|
|
@@ -2496,6 +2526,10 @@ interface KdsButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonE
|
|
|
2496
2526
|
*
|
|
2497
2527
|
* Built with native HTML and kds-* CSS classes from the BeerCSS bundle.
|
|
2498
2528
|
*
|
|
2529
|
+
* Compose with: para apilar CTAs al pie de una card, envolver en
|
|
2530
|
+
* `.kds-btn-stack` (NO usar gap/margin inline) — primario arriba, outlined
|
|
2531
|
+
* debajo, todos `fullWidth`. Ver `Patterns/CSS-only → ButtonStack`.
|
|
2532
|
+
*
|
|
2499
2533
|
* @example
|
|
2500
2534
|
* ```tsx
|
|
2501
2535
|
* <KdsButton variant="primary">
|
|
@@ -2524,120 +2558,118 @@ declare const KdsButton: React__default.ForwardRefExoticComponent<KdsButtonProps
|
|
|
2524
2558
|
/**
|
|
2525
2559
|
* Khipu Design System - TextField Component
|
|
2526
2560
|
*
|
|
2527
|
-
*
|
|
2528
|
-
*
|
|
2561
|
+
* Matchea exactamente el markup que genera `matFieldImpl()` del taglib `mat:textField` de payment:
|
|
2562
|
+
*
|
|
2563
|
+
* <div class="field label border [prefix] [suffix] [invalid|valid|info|warning]">
|
|
2564
|
+
* <i class="material-symbols-outlined">prefixIcon</i> // si startIcon
|
|
2565
|
+
* <input type="..." id="..." name="..." value="..." placeholder=" " [required] [disabled]>
|
|
2566
|
+
* <label for="...">Label [*]</label>
|
|
2567
|
+
* <i class="material-symbols-outlined">suffixIcon</i> // si endIcon
|
|
2568
|
+
* <span class="helper">errorMessage o help</span> // si helperText
|
|
2569
|
+
* </div>
|
|
2570
|
+
*
|
|
2571
|
+
* Reglas críticas del truco floating-label de BeerCSS:
|
|
2572
|
+
* - `placeholder=" "` (un espacio) — NUNCA aceptar placeholder real del consumidor.
|
|
2573
|
+
* BeerCSS usa `input:placeholder-shown ~ label` para mantener la label abajo cuando el input
|
|
2574
|
+
* está vacío. Si pasas un placeholder real, el label se queda siempre arriba y se superpone.
|
|
2575
|
+
* - El wrapper DEBE tener `.prefix` cuando hay icono al inicio (alinea la label al lado del icono).
|
|
2576
|
+
* - El wrapper DEBE tener `.suffix` cuando hay icono al final.
|
|
2577
|
+
*
|
|
2578
|
+
* Variante `revealable` (campo de contraseña con mostrar/ocultar):
|
|
2579
|
+
* - El toggle es un `<a role="button">` — BeerCSS posiciona como icono del field a
|
|
2580
|
+
* `:is(i, img, svg, progress.circle, a)` y da `pointer-events: all` solo a `<a>`/`.front`,
|
|
2581
|
+
* así que el anchor es el elemento interactivo idiomático del field (no `<button>`).
|
|
2582
|
+
*
|
|
2583
|
+
* @gsp `mat:textField`, `mat:emailField`, `mat:passwordField`, `mat:numberField` (taglib `matFieldImpl`)
|
|
2529
2584
|
*/
|
|
2530
2585
|
|
|
2531
|
-
interface KdsTextFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
2532
|
-
/**
|
|
2586
|
+
interface KdsTextFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'size' | 'placeholder'> {
|
|
2587
|
+
/** Floating label. */
|
|
2533
2588
|
label: string;
|
|
2534
|
-
/** Helper text
|
|
2589
|
+
/** Helper text bajo el field (error o info). */
|
|
2535
2590
|
helperText?: string;
|
|
2536
|
-
/**
|
|
2591
|
+
/** Estado inválido — aplica `.invalid` al wrapper. */
|
|
2537
2592
|
error?: boolean;
|
|
2538
|
-
/** Full width
|
|
2593
|
+
/** Full width (default: true). */
|
|
2539
2594
|
fullWidth?: boolean;
|
|
2540
|
-
/**
|
|
2595
|
+
/**
|
|
2596
|
+
* Variante angosta: el field toma un ancho reducido con el texto centrado, y
|
|
2597
|
+
* deja de ser fullWidth. Pensado para inputs de pocos caracteres dispuestos en
|
|
2598
|
+
* fila (ej. segmentos de coordenadas, código de verificación).
|
|
2599
|
+
*/
|
|
2600
|
+
narrow?: boolean;
|
|
2601
|
+
/** Material Symbol al inicio del input (aplica clase `.prefix`). */
|
|
2541
2602
|
startIcon?: string;
|
|
2542
|
-
/** Material
|
|
2603
|
+
/** Material Symbol al final del input (aplica clase `.suffix`). */
|
|
2543
2604
|
endIcon?: string;
|
|
2605
|
+
/**
|
|
2606
|
+
* Campo de contraseña con toggle interactivo de mostrar/ocultar.
|
|
2607
|
+
*
|
|
2608
|
+
* Renderiza un botón "ojo" como suffix que alterna el `type` del input entre
|
|
2609
|
+
* `password` (oculto) y `text` (visible). Cuando es `true`, el `type` se
|
|
2610
|
+
* gestiona internamente (se ignora la prop `type`). No tiene efecto si el
|
|
2611
|
+
* field es `readOnly`. Toma precedencia sobre `endIcon`.
|
|
2612
|
+
*/
|
|
2613
|
+
revealable?: boolean;
|
|
2614
|
+
/**
|
|
2615
|
+
* aria-label del toggle de contraseña, para i18n.
|
|
2616
|
+
* @default 'Mostrar u ocultar contraseña'
|
|
2617
|
+
*/
|
|
2618
|
+
revealLabel?: string;
|
|
2619
|
+
/**
|
|
2620
|
+
* Muestra la marca ` *` en la label cuando el campo es `required`.
|
|
2621
|
+
*
|
|
2622
|
+
* El atributo `required` del input se aplica siempre que se pase `required`;
|
|
2623
|
+
* esta prop solo controla la marca visual. Ponla en `false` para campos
|
|
2624
|
+
* requeridos que no deben mostrar asterisco (el requerimiento se comunica de otra forma).
|
|
2625
|
+
* @default true
|
|
2626
|
+
*/
|
|
2627
|
+
requiredMark?: boolean;
|
|
2544
2628
|
}
|
|
2545
|
-
/**
|
|
2546
|
-
* Text input field with label, validation, and icons.
|
|
2547
|
-
*
|
|
2548
|
-
* Built with native HTML and BeerCSS floating labels.
|
|
2549
|
-
* The label animates up when the input has focus or value.
|
|
2550
|
-
*
|
|
2551
|
-
* @example
|
|
2552
|
-
* ```tsx
|
|
2553
|
-
* <KdsTextField
|
|
2554
|
-
* label="RUT Suscriptor"
|
|
2555
|
-
* placeholder="12.345.678-9"
|
|
2556
|
-
* />
|
|
2557
|
-
*
|
|
2558
|
-
* <KdsTextField
|
|
2559
|
-
* label="Buscar por nombre"
|
|
2560
|
-
* startIcon="search"
|
|
2561
|
-
* />
|
|
2562
|
-
*
|
|
2563
|
-
* <KdsTextField
|
|
2564
|
-
* label="Contraseña"
|
|
2565
|
-
* type="password"
|
|
2566
|
-
* error
|
|
2567
|
-
* helperText="Contraseña incorrecta"
|
|
2568
|
-
* />
|
|
2569
|
-
*
|
|
2570
|
-
* <KdsTextField
|
|
2571
|
-
* label="Monto"
|
|
2572
|
-
* value="$1.000"
|
|
2573
|
-
* readOnly
|
|
2574
|
-
* />
|
|
2575
|
-
* ```
|
|
2576
|
-
*/
|
|
2577
2629
|
declare const KdsTextField: React__default.ForwardRefExoticComponent<KdsTextFieldProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
2578
2630
|
|
|
2579
2631
|
/**
|
|
2580
|
-
* Khipu Design System -
|
|
2632
|
+
* Khipu Design System - SearchField Component
|
|
2633
|
+
*
|
|
2634
|
+
* Campo de búsqueda reutilizable (input `type="search"`) con el mismo look que el
|
|
2635
|
+
* search del `KdsBankModal`: borde sutil, radio md, foco con borde primario y halo.
|
|
2636
|
+
* Sin label flotante. Pensado para usarse standalone (ej: lista de bancos inline en
|
|
2637
|
+
* khenshin) o dentro del `KdsBankModal`, que lo consume como única fuente de verdad.
|
|
2581
2638
|
*
|
|
2582
|
-
*
|
|
2639
|
+
* Acepta value, onChange, placeholder, etc. por spread de las props nativas del input.
|
|
2583
2640
|
*/
|
|
2584
2641
|
|
|
2585
|
-
interface
|
|
2586
|
-
|
|
2642
|
+
interface KdsSearchFieldProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
2643
|
+
/** Muestra un ícono de lupa al inicio del campo (additive, off por defecto). */
|
|
2644
|
+
withIcon?: boolean;
|
|
2587
2645
|
}
|
|
2588
|
-
declare const
|
|
2646
|
+
declare const KdsSearchField: React__default.ForwardRefExoticComponent<KdsSearchFieldProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
2589
2647
|
|
|
2590
2648
|
/**
|
|
2591
|
-
* Khipu Design System -
|
|
2649
|
+
* Khipu Design System - Checkbox Component
|
|
2592
2650
|
*
|
|
2593
|
-
*
|
|
2594
|
-
* Uses kds-bottom-sheet BeerCSS classes for visual presentation.
|
|
2595
|
-
*/
|
|
2596
|
-
|
|
2597
|
-
type KdsModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2598
|
-
interface KdsModalProps {
|
|
2599
|
-
/** Controls modal visibility */
|
|
2600
|
-
open: boolean;
|
|
2601
|
-
/** Callback when modal should close */
|
|
2602
|
-
onClose: () => void;
|
|
2603
|
-
/** Modal title */
|
|
2604
|
-
title?: string;
|
|
2605
|
-
/** Modal description text */
|
|
2606
|
-
description?: string;
|
|
2607
|
-
/** Footer content (usually action buttons) */
|
|
2608
|
-
footer?: React__default.ReactNode;
|
|
2609
|
-
/** Modal content */
|
|
2610
|
-
children: React__default.ReactNode;
|
|
2611
|
-
/** Modal max width */
|
|
2612
|
-
size?: KdsModalSize;
|
|
2613
|
-
/** Show close button */
|
|
2614
|
-
showCloseButton?: boolean;
|
|
2615
|
-
/** Additional CSS class */
|
|
2616
|
-
className?: string;
|
|
2617
|
-
}
|
|
2618
|
-
/**
|
|
2619
|
-
* Modal dialog component for displaying content that requires attention.
|
|
2651
|
+
* Wrapper React que matchea exactamente el markup del taglib `mat:checkBox` de payment:
|
|
2620
2652
|
*
|
|
2621
|
-
*
|
|
2653
|
+
* <label class="checkbox">
|
|
2654
|
+
* <input type="checkbox" id="..." name="..." value="..." [checked] [disabled]>
|
|
2655
|
+
* <span>Label</span>
|
|
2656
|
+
* </label>
|
|
2622
2657
|
*
|
|
2623
|
-
*
|
|
2624
|
-
*
|
|
2625
|
-
*
|
|
2626
|
-
*
|
|
2627
|
-
*
|
|
2628
|
-
* title="Confirmar pago"
|
|
2629
|
-
* footer={
|
|
2630
|
-
* <>
|
|
2631
|
-
* <button onClick={handleCancel}>Cancelar</button>
|
|
2632
|
-
* <button onClick={handleConfirm}>Confirmar</button>
|
|
2633
|
-
* </>
|
|
2634
|
-
* }
|
|
2635
|
-
* >
|
|
2636
|
-
* <p>¿Estás seguro de que deseas realizar este pago?</p>
|
|
2637
|
-
* </KdsModal>
|
|
2638
|
-
* ```
|
|
2658
|
+
* BeerCSS oculta el input via `opacity: 0` y renderiza un sprite vía `::before` con
|
|
2659
|
+
* `content: "check_box_outline_blank"` usando la fuente Material Symbols Outlined.
|
|
2660
|
+
*
|
|
2661
|
+
* NO agregamos `htmlFor` al label porque el `<input>` está anidado dentro: la
|
|
2662
|
+
* asociación es implícita y `for` puede causar doble-disparo del click event.
|
|
2639
2663
|
*/
|
|
2640
|
-
|
|
2664
|
+
|
|
2665
|
+
interface KdsCheckboxProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
2666
|
+
/**
|
|
2667
|
+
* Contenido del label mostrado al lado del sprite. Opcional (puede usar aria-label).
|
|
2668
|
+
* Acepta texto o nodos (p. ej. un enlace embebido en "Acepto los términos…").
|
|
2669
|
+
*/
|
|
2670
|
+
label?: React__default.ReactNode;
|
|
2671
|
+
}
|
|
2672
|
+
declare const KdsCheckbox: React__default.ForwardRefExoticComponent<KdsCheckboxProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
2641
2673
|
|
|
2642
2674
|
/**
|
|
2643
2675
|
* Khipu Design System - Card Component
|
|
@@ -2692,16 +2724,63 @@ declare const KdsCardFooter: React__default.ForwardRefExoticComponent<KdsCardSec
|
|
|
2692
2724
|
/**
|
|
2693
2725
|
* Khipu Design System - Spinner Component
|
|
2694
2726
|
*
|
|
2695
|
-
*
|
|
2727
|
+
* Spinner circular animado usando el patrón nativo de BeerCSS:
|
|
2728
|
+
* <progress class="circle [small|large] indeterminate"></progress>
|
|
2729
|
+
*
|
|
2730
|
+
* Tamaños (BeerCSS):
|
|
2731
|
+
* - `small` → 1.5rem (24px)
|
|
2732
|
+
* - default → 2.5rem (40px)
|
|
2733
|
+
* - `large` → 3.5rem (56px)
|
|
2734
|
+
*
|
|
2735
|
+
* El `<progress>` indeterminate aplica animación `to-rotate 1s linear infinite` con
|
|
2736
|
+
* gradient cónico (currentColor / `--active`).
|
|
2696
2737
|
*/
|
|
2697
2738
|
|
|
2698
2739
|
type KdsSpinnerSize = 'small' | 'medium' | 'large';
|
|
2699
2740
|
interface KdsSpinnerProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
2741
|
+
/** Tamaño del spinner. Default `medium` (sin modifier = 2.5rem). */
|
|
2700
2742
|
size?: KdsSpinnerSize;
|
|
2743
|
+
/** Texto bajo el spinner (visible). Si se omite, se usa "Cargando" como sr-only para a11y. */
|
|
2701
2744
|
label?: string;
|
|
2702
2745
|
}
|
|
2703
2746
|
declare const KdsSpinner: React__default.ForwardRefExoticComponent<KdsSpinnerProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
2704
2747
|
|
|
2748
|
+
/**
|
|
2749
|
+
* Khipu Design System - SecureLoader Component
|
|
2750
|
+
*
|
|
2751
|
+
* Loader de pantalla completa para flujos de pago: anillo circular animado con
|
|
2752
|
+
* un candado centrado y, opcionalmente, dos líneas de texto (estado + detalle).
|
|
2753
|
+
*
|
|
2754
|
+
* El anillo es un arco fino (~2px) rotando, definido en `.kds-secure-loader-ring`.
|
|
2755
|
+
* El texto es opcional y se pasa por props (`title`/`message`) porque su contenido
|
|
2756
|
+
* lo provee el consumidor (i18n / estado de la operación).
|
|
2757
|
+
*/
|
|
2758
|
+
|
|
2759
|
+
interface KdsSecureLoaderProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
2760
|
+
/** Frase de estado (línea principal) mostrada sobre el spinner. */
|
|
2761
|
+
title?: string;
|
|
2762
|
+
/** Detalle/submensaje (color primario) bajo el título. */
|
|
2763
|
+
message?: string;
|
|
2764
|
+
}
|
|
2765
|
+
declare const KdsSecureLoader: React__default.ForwardRefExoticComponent<KdsSecureLoaderProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
2766
|
+
|
|
2767
|
+
/**
|
|
2768
|
+
* Khipu Design System - CopyButton Component
|
|
2769
|
+
*
|
|
2770
|
+
* Botón-chip compacto que muestra un valor y lo copia al portapapeles al click.
|
|
2771
|
+
* Acción de copia inline (distinto de KdsCopyRow, que es una fila label+valor para
|
|
2772
|
+
* mostrar datos del destinatario/recap). Porta el look del copy button de khenshin:
|
|
2773
|
+
* fondo info suave, texto info-dark, icono copy info-main, esquinas redondeadas.
|
|
2774
|
+
*/
|
|
2775
|
+
|
|
2776
|
+
interface KdsCopyButtonProps extends Omit<React__default.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'children' | 'onClick'> {
|
|
2777
|
+
/** Valor mostrado y copiado al portapapeles. */
|
|
2778
|
+
value: string;
|
|
2779
|
+
/** Texto que reemplaza brevemente al valor cuando se copia. Default "Copiado". */
|
|
2780
|
+
copiedText?: string;
|
|
2781
|
+
}
|
|
2782
|
+
declare const KdsCopyButton: React__default.ForwardRefExoticComponent<KdsCopyButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
2783
|
+
|
|
2705
2784
|
/**
|
|
2706
2785
|
* Khipu Design System - LinearProgress Component
|
|
2707
2786
|
*
|
|
@@ -2717,53 +2796,34 @@ declare const KdsLinearProgress: React__default.ForwardRefExoticComponent<KdsLin
|
|
|
2717
2796
|
/**
|
|
2718
2797
|
* Khipu Design System - Alert Component
|
|
2719
2798
|
*
|
|
2720
|
-
*
|
|
2721
|
-
*
|
|
2799
|
+
* Alert con icon opcional, content y close button.
|
|
2800
|
+
*
|
|
2801
|
+
* Specs (CSS-derived):
|
|
2802
|
+
* - `.kds-alert`: flex, align-items center, gap 8px, padding 16px, border-radius md, border 1px
|
|
2803
|
+
* - `.kds-alert-icon`: 24px, flex-shrink 0
|
|
2804
|
+
* - `.kds-alert-content`: flex 1, min-width 0 (permite ellipsis del texto)
|
|
2805
|
+
* - Variantes: kds-info / kds-success / kds-warning / kds-error
|
|
2806
|
+
* - `.kds-alert-inline` reduce padding y bottom-margin
|
|
2722
2807
|
*/
|
|
2723
2808
|
|
|
2724
2809
|
type KdsAlertSeverity = 'success' | 'info' | 'warning' | 'error';
|
|
2725
2810
|
interface KdsAlertProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
2726
|
-
/** Alert severity/type */
|
|
2811
|
+
/** Alert severity/type. */
|
|
2727
2812
|
severity: KdsAlertSeverity;
|
|
2728
|
-
/** Alert title */
|
|
2813
|
+
/** Alert title (negrita arriba). */
|
|
2729
2814
|
title?: string;
|
|
2730
|
-
/**
|
|
2731
|
-
|
|
2732
|
-
|
|
2815
|
+
/**
|
|
2816
|
+
* Material Symbols icon name. Si es `true` (o se omite y hay otra prop), se usa el default por severity.
|
|
2817
|
+
* Pasar `false` para ocultar el icon. Pasar un string custom para override.
|
|
2818
|
+
*/
|
|
2819
|
+
icon?: string | boolean;
|
|
2820
|
+
/** Inline variant (compact display, sin border-radius grande). */
|
|
2733
2821
|
inline?: boolean;
|
|
2734
|
-
/** Alert
|
|
2822
|
+
/** Alert body. */
|
|
2735
2823
|
children: React__default.ReactNode;
|
|
2736
|
-
/**
|
|
2824
|
+
/** Callback para cerrar — renderiza icon-button discreto a la derecha. */
|
|
2737
2825
|
onClose?: () => void;
|
|
2738
2826
|
}
|
|
2739
|
-
/**
|
|
2740
|
-
* Alert component for displaying important messages.
|
|
2741
|
-
*
|
|
2742
|
-
* Built with native HTML and kds-* CSS classes from the BeerCSS bundle.
|
|
2743
|
-
*
|
|
2744
|
-
* @example
|
|
2745
|
-
* ```tsx
|
|
2746
|
-
* // Info alert (like in subscription details)
|
|
2747
|
-
* <KdsAlert severity="info">
|
|
2748
|
-
* El tope mensual corresponde al monto máximo posible a cobrar mensualmente.
|
|
2749
|
-
* </KdsAlert>
|
|
2750
|
-
*
|
|
2751
|
-
* // Success alert
|
|
2752
|
-
* <KdsAlert severity="success" title="¡Todo listo!">
|
|
2753
|
-
* Espera la confirmación por parte de tu banco
|
|
2754
|
-
* </KdsAlert>
|
|
2755
|
-
*
|
|
2756
|
-
* // Warning alert
|
|
2757
|
-
* <KdsAlert severity="warning" onClose={() => setOpen(false)}>
|
|
2758
|
-
* Tu sesión expirará pronto
|
|
2759
|
-
* </KdsAlert>
|
|
2760
|
-
*
|
|
2761
|
-
* // Error alert
|
|
2762
|
-
* <KdsAlert severity="error">
|
|
2763
|
-
* Ha ocurrido un error al procesar tu pago
|
|
2764
|
-
* </KdsAlert>
|
|
2765
|
-
* ```
|
|
2766
|
-
*/
|
|
2767
2827
|
declare const KdsAlert: React__default.ForwardRefExoticComponent<KdsAlertProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
2768
2828
|
|
|
2769
2829
|
/**
|
|
@@ -2776,7 +2836,7 @@ declare const KdsAlert: React__default.ForwardRefExoticComponent<KdsAlertProps &
|
|
|
2776
2836
|
/**
|
|
2777
2837
|
* Custom Khipu typography variants that map to specific design tokens
|
|
2778
2838
|
*/
|
|
2779
|
-
type KdsTypographyVariant = 'display1' | 'display2' | 'heading1' | 'heading2' | 'heading3' | 'body-large' | 'body' | 'body-small' | 'label' | 'label-small' | 'muted' | 'link';
|
|
2839
|
+
type KdsTypographyVariant = 'display1' | 'display2' | 'heading1' | 'heading2' | 'heading3' | 'body-large' | 'body' | 'body-small' | 'label' | 'label-small' | 'value' | 'code' | 'caption' | 'muted' | 'link' | 'strong';
|
|
2780
2840
|
type ElementTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'label';
|
|
2781
2841
|
interface KdsTypographyProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
2782
2842
|
/**
|
|
@@ -2817,10 +2877,27 @@ interface KdsTypographyProps extends React__default.HTMLAttributes<HTMLElement>
|
|
|
2817
2877
|
*/
|
|
2818
2878
|
declare const KdsTypography: React__default.ForwardRefExoticComponent<KdsTypographyProps & React__default.RefAttributes<HTMLElement>>;
|
|
2819
2879
|
|
|
2880
|
+
/**
|
|
2881
|
+
* Khipu Design System - Tabs Component
|
|
2882
|
+
*
|
|
2883
|
+
* Matchea exactamente el markup que usa producción payment:
|
|
2884
|
+
*
|
|
2885
|
+
* <div class="kds-segmented-tabs" role="tablist">
|
|
2886
|
+
* <button type="button" class="active" role="tab" aria-selected="true">Personas</button>
|
|
2887
|
+
* <button type="button" role="tab" aria-selected="false">Empresas</button>
|
|
2888
|
+
* </div>
|
|
2889
|
+
*
|
|
2890
|
+
* Solo existe la variante segmented — producción payment no usa otra cosa, y el
|
|
2891
|
+
* "standard" Material Design 3 underline tab no está en el Khipu DS.
|
|
2892
|
+
*
|
|
2893
|
+
* @gsp `_choosePaymentMethodFormMaterial.gsp` (líneas 18-25)
|
|
2894
|
+
*/
|
|
2895
|
+
|
|
2820
2896
|
interface KdsTabsProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
2897
|
+
/** Índice 0-based del tab activo. */
|
|
2821
2898
|
activeIndex: number;
|
|
2899
|
+
/** Callback cuando cambia el tab activo. */
|
|
2822
2900
|
onChange: (index: number) => void;
|
|
2823
|
-
variant?: 'standard' | 'segmented';
|
|
2824
2901
|
}
|
|
2825
2902
|
declare const KdsTabs: React__default.ForwardRefExoticComponent<KdsTabsProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
2826
2903
|
interface KdsTabInternalProps {
|
|
@@ -2836,111 +2913,29 @@ interface KdsTabPanelProps extends React__default.HTMLAttributes<HTMLDivElement>
|
|
|
2836
2913
|
declare const KdsTabPanel: React__default.ForwardRefExoticComponent<KdsTabPanelProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
2837
2914
|
|
|
2838
2915
|
/**
|
|
2839
|
-
* Khipu Design System -
|
|
2840
|
-
*
|
|
2841
|
-
* A header bar component that displays the Khipu logo, a transaction code,
|
|
2842
|
-
* and a close button. Used at the top of payment flow screens.
|
|
2843
|
-
*
|
|
2844
|
-
* Built with composable sub-components for maximum flexibility.
|
|
2845
|
-
*/
|
|
2846
|
-
|
|
2847
|
-
interface KdsLogoHeaderProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
2848
|
-
/** Content - typically LogoHeader sub-components */
|
|
2849
|
-
children?: React__default.ReactNode;
|
|
2850
|
-
}
|
|
2851
|
-
interface KdsLogoHeaderLogoProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
2852
|
-
/** Custom logo content. Defaults to Khipu text logo */
|
|
2853
|
-
children?: React__default.ReactNode;
|
|
2854
|
-
}
|
|
2855
|
-
interface KdsLogoHeaderSeparatorProps extends React__default.HTMLAttributes<HTMLSpanElement> {
|
|
2856
|
-
/** Separator character. Defaults to "|" */
|
|
2857
|
-
children?: React__default.ReactNode;
|
|
2858
|
-
}
|
|
2859
|
-
interface KdsLogoHeaderCodeProps extends React__default.HTMLAttributes<HTMLSpanElement> {
|
|
2860
|
-
/** Transaction or reference code to display */
|
|
2861
|
-
children: React__default.ReactNode;
|
|
2862
|
-
}
|
|
2863
|
-
interface KdsLogoHeaderCloseButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2864
|
-
/** Callback fired when the close button is clicked */
|
|
2865
|
-
onClose?: () => void;
|
|
2866
|
-
}
|
|
2867
|
-
/**
|
|
2868
|
-
* Logo section of the LogoHeader.
|
|
2869
|
-
*
|
|
2870
|
-
* @example
|
|
2871
|
-
* ```tsx
|
|
2872
|
-
* <KdsLogoHeaderLogo />
|
|
2873
|
-
*
|
|
2874
|
-
* <KdsLogoHeaderLogo>
|
|
2875
|
-
* <img src="/custom-logo.svg" alt="Custom Logo" />
|
|
2876
|
-
* </KdsLogoHeaderLogo>
|
|
2877
|
-
* ```
|
|
2878
|
-
*/
|
|
2879
|
-
declare const KdsLogoHeaderLogo: React__default.ForwardRefExoticComponent<KdsLogoHeaderLogoProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
2880
|
-
/**
|
|
2881
|
-
* Separator element between logo and code.
|
|
2882
|
-
*
|
|
2883
|
-
* @example
|
|
2884
|
-
* ```tsx
|
|
2885
|
-
* <KdsLogoHeaderSeparator />
|
|
2886
|
-
*
|
|
2887
|
-
* <KdsLogoHeaderSeparator>•</KdsLogoHeaderSeparator>
|
|
2888
|
-
* ```
|
|
2889
|
-
*/
|
|
2890
|
-
declare const KdsLogoHeaderSeparator: React__default.ForwardRefExoticComponent<KdsLogoHeaderSeparatorProps & React__default.RefAttributes<HTMLSpanElement>>;
|
|
2891
|
-
/**
|
|
2892
|
-
* Transaction code section.
|
|
2893
|
-
*
|
|
2894
|
-
* @example
|
|
2895
|
-
* ```tsx
|
|
2896
|
-
* <KdsLogoHeaderCode>HUSK-P7ZZ-XGYG</KdsLogoHeaderCode>
|
|
2897
|
-
* ```
|
|
2898
|
-
*/
|
|
2899
|
-
declare const KdsLogoHeaderCode: React__default.ForwardRefExoticComponent<KdsLogoHeaderCodeProps & React__default.RefAttributes<HTMLSpanElement>>;
|
|
2900
|
-
/**
|
|
2901
|
-
* Close button for the header.
|
|
2916
|
+
* Khipu Design System - RadioGroup Component
|
|
2902
2917
|
*
|
|
2903
|
-
*
|
|
2904
|
-
* ```tsx
|
|
2905
|
-
* <KdsLogoHeaderCloseButton onClose={() => handleClose()} />
|
|
2906
|
-
* ```
|
|
2907
|
-
*/
|
|
2908
|
-
declare const KdsLogoHeaderCloseButton: React__default.ForwardRefExoticComponent<KdsLogoHeaderCloseButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
2909
|
-
/**
|
|
2910
|
-
* LogoHeader bar component.
|
|
2918
|
+
* Native HTML radio group with BeerCSS `.radio` class.
|
|
2911
2919
|
*
|
|
2912
|
-
*
|
|
2913
|
-
*
|
|
2920
|
+
* Contrato BeerCSS:
|
|
2921
|
+
* <fieldset class="kds-radio-group">
|
|
2922
|
+
* <legend>Label</legend>
|
|
2923
|
+
* <label class="radio">
|
|
2924
|
+
* <input type="radio" name="x" value="a" />
|
|
2925
|
+
* <span>Opción A</span>
|
|
2926
|
+
* </label>
|
|
2927
|
+
* ...
|
|
2928
|
+
* </fieldset>
|
|
2914
2929
|
*
|
|
2915
|
-
*
|
|
2916
|
-
*
|
|
2917
|
-
*
|
|
2918
|
-
* <KdsLogoHeader>
|
|
2919
|
-
* <KdsLogoHeaderLogo />
|
|
2920
|
-
* <KdsLogoHeaderSeparator />
|
|
2921
|
-
* <KdsLogoHeaderCode>HUSK-P7ZZ-XGYG</KdsLogoHeaderCode>
|
|
2922
|
-
* <KdsLogoHeaderCloseButton onClose={() => handleClose()} />
|
|
2923
|
-
* </KdsLogoHeader>
|
|
2924
|
-
*
|
|
2925
|
-
* // Simple usage with defaults
|
|
2926
|
-
* <KdsLogoHeader>
|
|
2927
|
-
* <KdsLogoHeaderLogo />
|
|
2928
|
-
* <KdsLogoHeaderSeparator />
|
|
2929
|
-
* <KdsLogoHeaderCode>ABC-1234-XYZ</KdsLogoHeaderCode>
|
|
2930
|
-
* </KdsLogoHeader>
|
|
2931
|
-
* ```
|
|
2932
|
-
*/
|
|
2933
|
-
declare const KdsLogoHeader: React__default.ForwardRefExoticComponent<KdsLogoHeaderProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
2934
|
-
|
|
2935
|
-
/**
|
|
2936
|
-
* Khipu Design System - RadioGroup Component
|
|
2937
|
-
*
|
|
2938
|
-
* Native HTML radio group with BeerCSS styling.
|
|
2930
|
+
* Specs:
|
|
2931
|
+
* - Input oculto, sprite circular generado por `:is(.checkbox, .radio) > span::before`
|
|
2932
|
+
* - Tamaño default 18x18; modifiers `.small` (14px) / `.large` (22px)
|
|
2939
2933
|
*/
|
|
2940
2934
|
|
|
2941
2935
|
interface KdsRadioOption {
|
|
2942
2936
|
value: string;
|
|
2943
|
-
label:
|
|
2937
|
+
/** Texto o nodo del label de la opción (permite contenido rico: montos, enlaces, tablas). */
|
|
2938
|
+
label: React__default.ReactNode;
|
|
2944
2939
|
disabled?: boolean;
|
|
2945
2940
|
}
|
|
2946
2941
|
interface KdsRadioGroupProps extends Omit<React__default.FieldsetHTMLAttributes<HTMLFieldSetElement>, 'onChange'> {
|
|
@@ -2949,55 +2944,145 @@ interface KdsRadioGroupProps extends Omit<React__default.FieldsetHTMLAttributes<
|
|
|
2949
2944
|
options: KdsRadioOption[];
|
|
2950
2945
|
value?: string;
|
|
2951
2946
|
onChange?: (value: string) => void;
|
|
2947
|
+
/** Tamaño del sprite del radio (aplicado a cada opción). */
|
|
2948
|
+
size?: 'small' | 'large';
|
|
2949
|
+
/**
|
|
2950
|
+
* Variante de presentación.
|
|
2951
|
+
* - `'default'`: filas simples (radio + texto).
|
|
2952
|
+
* - `'card'`: cada opción como fila con borde (estilo selección de banco/cuenta);
|
|
2953
|
+
* hover y opción seleccionada resaltada. Mantiene el control radio.
|
|
2954
|
+
* @default 'default'
|
|
2955
|
+
*/
|
|
2956
|
+
variant?: 'default' | 'card';
|
|
2952
2957
|
}
|
|
2953
2958
|
declare const KdsRadioGroup: React__default.ForwardRefExoticComponent<KdsRadioGroupProps & React__default.RefAttributes<HTMLFieldSetElement>>;
|
|
2954
2959
|
|
|
2955
2960
|
/**
|
|
2956
2961
|
* Khipu Design System - Select Component
|
|
2957
2962
|
*
|
|
2958
|
-
*
|
|
2963
|
+
* Native HTML `<select>` wrapped en el patrón BeerCSS `field label border`.
|
|
2964
|
+
* Matchea exactamente el markup que genera la taglib `mat:select` de payment.
|
|
2965
|
+
*
|
|
2966
|
+
* Markup canónico:
|
|
2967
|
+
*
|
|
2968
|
+
* <div class="field label border [prefix] [invalid|valid|info|warning]">
|
|
2969
|
+
* <i class="material-symbols-outlined">prefixIcon</i> // opcional
|
|
2970
|
+
* <select id="..." name="..." [required] [disabled]>
|
|
2971
|
+
* <option value="">Placeholder...</option> // opcional (noSelection)
|
|
2972
|
+
* <option value="bci">BCI</option>
|
|
2973
|
+
* ...
|
|
2974
|
+
* </select>
|
|
2975
|
+
* <label for="...">Banco *</label>
|
|
2976
|
+
* <span class="helper">errorMessage o help</span> // opcional
|
|
2977
|
+
* </div>
|
|
2978
|
+
*
|
|
2979
|
+
* BeerCSS dibuja el chevron automáticamente, el floating label, focus ring, etc.
|
|
2980
|
+
*
|
|
2981
|
+
* @gsp `mat:select` taglib (MaterialTagLib.groovy:260)
|
|
2959
2982
|
*/
|
|
2960
2983
|
|
|
2961
|
-
interface
|
|
2984
|
+
interface KdsSelectOption {
|
|
2985
|
+
/** Valor del `<option>` (string serializable). */
|
|
2962
2986
|
value: string;
|
|
2963
|
-
|
|
2987
|
+
/** Texto visible del `<option>`. */
|
|
2988
|
+
label: string;
|
|
2989
|
+
/** Si está disabled. */
|
|
2990
|
+
disabled?: boolean;
|
|
2991
|
+
}
|
|
2992
|
+
interface KdsSelectProps extends Omit<React__default.SelectHTMLAttributes<HTMLSelectElement>, 'children'> {
|
|
2993
|
+
/** Floating label. */
|
|
2994
|
+
label: string;
|
|
2995
|
+
/** Lista de opciones del select. */
|
|
2996
|
+
options: KdsSelectOption[];
|
|
2997
|
+
/**
|
|
2998
|
+
* Texto del primer `<option>` con value="" (placeholder). Si está vacío, no se renderiza.
|
|
2999
|
+
* Equivalente a `noSelection` del taglib.
|
|
3000
|
+
*/
|
|
2964
3001
|
placeholder?: string;
|
|
2965
|
-
|
|
3002
|
+
/** Helper text bajo el field (error o info). */
|
|
3003
|
+
helperText?: string;
|
|
3004
|
+
/** Estado inválido — aplica clase `.invalid` al wrapper. */
|
|
2966
3005
|
error?: boolean;
|
|
2967
|
-
|
|
2968
|
-
|
|
3006
|
+
/** Material Symbols icon al inicio del field (aplica clase `.prefix`). */
|
|
3007
|
+
prefixIcon?: string;
|
|
3008
|
+
/** Full width (default: true). */
|
|
2969
3009
|
fullWidth?: boolean;
|
|
2970
|
-
children: React__default.ReactNode;
|
|
2971
|
-
className?: string;
|
|
2972
|
-
}
|
|
2973
|
-
interface KdsSelectItemProps extends Select.SelectItemProps {
|
|
2974
|
-
children: React__default.ReactNode;
|
|
2975
3010
|
}
|
|
2976
|
-
declare const KdsSelect: React__default.ForwardRefExoticComponent<KdsSelectProps & React__default.RefAttributes<
|
|
2977
|
-
Item: React__default.ForwardRefExoticComponent<KdsSelectItemProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
2978
|
-
};
|
|
3011
|
+
declare const KdsSelect: React__default.ForwardRefExoticComponent<KdsSelectProps & React__default.RefAttributes<HTMLSelectElement>>;
|
|
2979
3012
|
|
|
2980
3013
|
/**
|
|
2981
3014
|
* Khipu Design System - Chip Component
|
|
2982
3015
|
*
|
|
2983
|
-
*
|
|
3016
|
+
* Chip/badge inline con color, icon opcional y close opcional (deletable).
|
|
3017
|
+
*
|
|
3018
|
+
* Specs (CSS-derived):
|
|
3019
|
+
* - `.kds-badge`: inline-flex, align-items center, gap 4px, padding 2px 8px, radius sm
|
|
3020
|
+
* - `font-size: xs`, `font-weight: medium`, `line-height: 1.5`
|
|
3021
|
+
* - Icon prefix `<i>`: 14px, inline
|
|
3022
|
+
* - Close button (`.kds-badge-close`): 16×16 circular discreto, NO usa kds-btn
|
|
3023
|
+
*
|
|
3024
|
+
* Variantes de color: primary | success | error | warning | info
|
|
2984
3025
|
*/
|
|
2985
3026
|
|
|
2986
3027
|
type KdsChipColor = 'primary' | 'success' | 'error' | 'warning' | 'info';
|
|
2987
3028
|
interface KdsChipProps extends React__default.HTMLAttributes<HTMLSpanElement> {
|
|
3029
|
+
/** Color variant. */
|
|
2988
3030
|
color?: KdsChipColor;
|
|
3031
|
+
/** Material Symbol opcional al inicio del chip. */
|
|
2989
3032
|
icon?: string;
|
|
3033
|
+
/**
|
|
3034
|
+
* Callback cuando se hace click en el icon de cerrar.
|
|
3035
|
+
* Si está definido, renderiza un icon-button discreto (NO usa kds-btn).
|
|
3036
|
+
*/
|
|
2990
3037
|
onDelete?: () => void;
|
|
2991
3038
|
}
|
|
2992
3039
|
declare const KdsChip: React__default.ForwardRefExoticComponent<KdsChipProps & React__default.RefAttributes<HTMLSpanElement>>;
|
|
2993
3040
|
|
|
3041
|
+
/**
|
|
3042
|
+
* Khipu Design System - Snackbar Component
|
|
3043
|
+
*
|
|
3044
|
+
* Matchea exactamente el markup que genera `Khipu.showSnackbar()` y
|
|
3045
|
+
* `initFlashMessages()` (`src/beercss/customizations/khipu-init.js`):
|
|
3046
|
+
*
|
|
3047
|
+
* <div class="snackbar active [info|success|error]"
|
|
3048
|
+
* data-auto-dismiss="true"
|
|
3049
|
+
* style="--kds-snackbar-duration: 5000ms">
|
|
3050
|
+
* <i class="material-symbols-outlined">[icon]</i>
|
|
3051
|
+
* <span class="max">message</span>
|
|
3052
|
+
* <button class="kds-snackbar-close" aria-label="Cerrar">
|
|
3053
|
+
* <i class="material-symbols-outlined">close</i>
|
|
3054
|
+
* </button>
|
|
3055
|
+
* </div>
|
|
3056
|
+
*
|
|
3057
|
+
* Features:
|
|
3058
|
+
* - Icon prefix automático según `type` (info / check_circle / error).
|
|
3059
|
+
* - Progress bar lineal en la parte inferior animado durante `duration` ms (CSS `::after`).
|
|
3060
|
+
* - Close button con estilo `.kds-snackbar-close` (icon-only, blanco semi-transparente).
|
|
3061
|
+
*
|
|
3062
|
+
* @gsp `_paymentFlashSnackbars.gsp` (markup base) + `khipu-init.js → initFlashMessages()` (close + dismiss timer)
|
|
3063
|
+
*/
|
|
3064
|
+
|
|
2994
3065
|
type KdsSnackbarType = 'success' | 'error' | 'info';
|
|
2995
|
-
interface KdsSnackbarProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
3066
|
+
interface KdsSnackbarProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, 'role'> {
|
|
3067
|
+
/** Mensaje del snackbar. */
|
|
2996
3068
|
message: string;
|
|
3069
|
+
/** Variante semántica. Default `info`. */
|
|
2997
3070
|
type?: KdsSnackbarType;
|
|
3071
|
+
/**
|
|
3072
|
+
* Duración en ms antes de auto-dismiss. Default `5000`.
|
|
3073
|
+
* También controla la duración del progress bar (CSS var `--kds-snackbar-duration`).
|
|
3074
|
+
* Pasa `0` para deshabilitar auto-dismiss (no progress bar).
|
|
3075
|
+
*/
|
|
2998
3076
|
duration?: number;
|
|
3077
|
+
/** Callback al cerrar (click en X o tras auto-dismiss). */
|
|
2999
3078
|
onClose?: () => void;
|
|
3079
|
+
/** Controla visibilidad. Default `true`. */
|
|
3000
3080
|
open?: boolean;
|
|
3081
|
+
/**
|
|
3082
|
+
* Material Symbol icon name. Si se omite, usa el default por `type`.
|
|
3083
|
+
* Pasa `false` para ocultar el icon prefix.
|
|
3084
|
+
*/
|
|
3085
|
+
icon?: string | false;
|
|
3001
3086
|
}
|
|
3002
3087
|
declare const KdsSnackbar: React__default.ForwardRefExoticComponent<KdsSnackbarProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3003
3088
|
|
|
@@ -3049,15 +3134,24 @@ declare const KdsSectionNote: React__default.ForwardRefExoticComponent<KdsSectio
|
|
|
3049
3134
|
/**
|
|
3050
3135
|
* Khipu Design System - StatusBlock Component
|
|
3051
3136
|
*
|
|
3052
|
-
*
|
|
3137
|
+
* Bloque de resultado (icono + título + descripción) para pantallas de éxito/error/pendiente.
|
|
3138
|
+
*
|
|
3139
|
+
* Spacing: el padding vertical estándar es `--kds-spacing-2` (16px) — el mismo rhythm
|
|
3140
|
+
* inter-elementos que usan `kds-btn-stack` y `kds-hr-dashed`. Usarlo standalone (sin
|
|
3141
|
+
* envolverlo en wrappers con su propio padding) para no duplicar el espacio.
|
|
3053
3142
|
*/
|
|
3054
3143
|
|
|
3055
|
-
type KdsStatusType = 'success' | 'pending' | 'warn' | 'error';
|
|
3144
|
+
type KdsStatusType = 'success' | 'pending' | 'warn' | 'error' | 'info';
|
|
3056
3145
|
interface KdsStatusBlockProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
3057
3146
|
status: KdsStatusType;
|
|
3058
3147
|
icon?: string;
|
|
3059
3148
|
title: string;
|
|
3060
|
-
|
|
3149
|
+
/**
|
|
3150
|
+
* Texto descriptivo bajo el título. Acepta `ReactNode` para permitir énfasis
|
|
3151
|
+
* en línea (p.ej. un lead-in en `<strong>` seguido del detalle). Se renderiza
|
|
3152
|
+
* dentro de un `<p>`, así que usar solo contenido válido como hijo de párrafo.
|
|
3153
|
+
*/
|
|
3154
|
+
description?: React__default.ReactNode;
|
|
3061
3155
|
inline?: boolean;
|
|
3062
3156
|
}
|
|
3063
3157
|
declare const KdsStatusBlock: React__default.ForwardRefExoticComponent<KdsStatusBlockProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
@@ -3065,27 +3159,139 @@ declare const KdsStatusBlock: React__default.ForwardRefExoticComponent<KdsStatus
|
|
|
3065
3159
|
/**
|
|
3066
3160
|
* Khipu Design System - Stepper Component
|
|
3067
3161
|
*
|
|
3068
|
-
*
|
|
3162
|
+
* Matchea exactamente el markup del taglib `mat:stepper` de payment:
|
|
3163
|
+
*
|
|
3164
|
+
* <div class="kds-stepper">
|
|
3165
|
+
* <div class="kds-step [completed|current]">
|
|
3166
|
+
* <div class="kds-step-indicator"></div> <!-- vacío: número/check via CSS -->
|
|
3167
|
+
* <div class="kds-step-label">Label</div>
|
|
3168
|
+
* </div>
|
|
3169
|
+
* ...
|
|
3170
|
+
* </div>
|
|
3171
|
+
*
|
|
3172
|
+
* Specs CSS-driven:
|
|
3173
|
+
* - La línea conectora horizontal es `.kds-stepper::before` (NO un `<div>`).
|
|
3174
|
+
* - El check de completed viene de `.kds-step-indicator::after { content: "check" }`.
|
|
3175
|
+
* - El número del step está oculto (`font-size: 0`) — el design no usa números.
|
|
3176
|
+
*
|
|
3177
|
+
* @gsp `mat:stepper` taglib (MaterialTagLib.groovy:817)
|
|
3069
3178
|
*/
|
|
3070
3179
|
|
|
3071
3180
|
interface KdsStepperProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
3072
|
-
|
|
3181
|
+
/** Labels de cada step. La longitud del array determina el número de pasos. */
|
|
3182
|
+
steps: string[];
|
|
3183
|
+
/**
|
|
3184
|
+
* Índice 0-based del step actual.
|
|
3185
|
+
* - Steps `< current` → `.completed` (verde con check)
|
|
3186
|
+
* - Step `== current` → `.current` (azul info)
|
|
3187
|
+
* - Steps `> current` → pending (gris)
|
|
3188
|
+
*/
|
|
3073
3189
|
current: number;
|
|
3074
3190
|
}
|
|
3075
3191
|
declare const KdsStepper: React__default.ForwardRefExoticComponent<KdsStepperProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3076
3192
|
|
|
3077
|
-
|
|
3193
|
+
/**
|
|
3194
|
+
* Khipu Design System - CopyRow Component
|
|
3195
|
+
*
|
|
3196
|
+
* Fila clickeable que copia su `value` al portapapeles. El ROW completo es el botón.
|
|
3197
|
+
*
|
|
3198
|
+
* Markup canónico (mirrors `src/beercss/demo/payment-components.html`):
|
|
3199
|
+
*
|
|
3200
|
+
* <button class="kds-copy-row" data-copy="value">
|
|
3201
|
+
* <i class="material-symbols-outlined">content_copy</i> ← icon a la IZQUIERDA
|
|
3202
|
+
* <div>
|
|
3203
|
+
* <span class="kds-copy-row-label">Banco</span>
|
|
3204
|
+
* <span class="kds-copy-row-value">Banco Security</span>
|
|
3205
|
+
* </div>
|
|
3206
|
+
* <span class="kds-copy-toast">
|
|
3207
|
+
* <i class="material-symbols-outlined">check_circle</i> Copiado
|
|
3208
|
+
* </span>
|
|
3209
|
+
* </button>
|
|
3210
|
+
*
|
|
3211
|
+
* Cuando `.copied`:
|
|
3212
|
+
* - bg → success-soft, border → success-main
|
|
3213
|
+
* - `.kds-copy-toast` aparece (position absolute right, opacity 0 → 1)
|
|
3214
|
+
*/
|
|
3215
|
+
|
|
3216
|
+
interface KdsCopyRowProps extends Omit<React__default.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'children' | 'onClick'> {
|
|
3217
|
+
/** Label arriba (uppercase caption). */
|
|
3078
3218
|
label: string;
|
|
3219
|
+
/** Valor mostrado y copiado al portapapeles. */
|
|
3079
3220
|
value: string;
|
|
3221
|
+
/** Texto del toast cuando se copia. Default: "Copiado". */
|
|
3222
|
+
copiedText?: string;
|
|
3080
3223
|
}
|
|
3081
|
-
declare const KdsCopyRow: React__default.ForwardRefExoticComponent<KdsCopyRowProps & React__default.RefAttributes<
|
|
3224
|
+
declare const KdsCopyRow: React__default.ForwardRefExoticComponent<KdsCopyRowProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
3225
|
+
|
|
3226
|
+
/**
|
|
3227
|
+
* Khipu Design System - CopyableTable Component
|
|
3228
|
+
*
|
|
3229
|
+
* Tabla compacta con filas que se copian individualmente al click, y un
|
|
3230
|
+
* botón "Copiar todos los datos" que cambia el color de todas las filas al copy.
|
|
3231
|
+
*
|
|
3232
|
+
* Variante `'grid'` (aditiva): grilla read-only de N celdas de texto por fila,
|
|
3233
|
+
* sin copy ni botón "Copiar todo". Las celdas reparten el ancho equitativamente.
|
|
3234
|
+
* Útil para mostrar datos dentro de opciones de radio. Soporta `disabled`
|
|
3235
|
+
* (atenúa el color del texto).
|
|
3236
|
+
*
|
|
3237
|
+
* Contrato HTML (matchea el CSS .kds-copyable-table del DS):
|
|
3238
|
+
* ```html
|
|
3239
|
+
* <div class="kds-copyable-table" id="destination-copy-list">
|
|
3240
|
+
* <div class="kds-copyable-table-row" data-copy="value-to-copy">
|
|
3241
|
+
* <span class="kds-key">Banco</span>
|
|
3242
|
+
* <span class="kds-value">Banco Security</span>
|
|
3243
|
+
* </div>
|
|
3244
|
+
* ...
|
|
3245
|
+
* </div>
|
|
3246
|
+
* <button class="kds-btn kds-btn-outlined kds-btn-block kds-copy-all-btn"
|
|
3247
|
+
* data-copy-all="#destination-copy-list">
|
|
3248
|
+
* <span class="kds-icon"><i class="material-symbols-outlined">content_copy</i></span>
|
|
3249
|
+
* <span>Copiar todos los datos</span>
|
|
3250
|
+
* </button>
|
|
3251
|
+
* ```
|
|
3252
|
+
*
|
|
3253
|
+
* Specs:
|
|
3254
|
+
* - Row: flex space-between, padding 10px 8px, border-top divider, font sm, cursor pointer
|
|
3255
|
+
* - Row hover: bg primary-faint + icon copy aparece en `.kds-value::after`
|
|
3256
|
+
* - Row `.copied`: bg success-soft, `.kds-value` color success-dark, icon → check
|
|
3257
|
+
* - Copy-all-btn: kds-btn-outlined-block + bg primary-faint
|
|
3258
|
+
* - Copy-all-btn `.copied`: bg success-soft
|
|
3259
|
+
*/
|
|
3082
3260
|
|
|
3083
3261
|
interface KdsCopyableTableRow {
|
|
3084
3262
|
label: string;
|
|
3085
3263
|
value: string;
|
|
3264
|
+
/** Override del valor a copiar (default: `value`). */
|
|
3265
|
+
copy?: string;
|
|
3086
3266
|
}
|
|
3087
3267
|
interface KdsCopyableTableProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
3088
|
-
|
|
3268
|
+
/**
|
|
3269
|
+
* Filas key/value copiables (modo `'copyable'`). Opcional: default `[]`.
|
|
3270
|
+
* En modo `'grid'` no se usa; usá `gridRows` en su lugar.
|
|
3271
|
+
*/
|
|
3272
|
+
rows?: KdsCopyableTableRow[];
|
|
3273
|
+
/**
|
|
3274
|
+
* Variante de la tabla.
|
|
3275
|
+
* - `'copyable'` (default): filas key/value que se copian individualmente al click.
|
|
3276
|
+
* - `'grid'`: grilla read-only de N celdas de texto por fila, sin copy ni botón
|
|
3277
|
+
* "Copiar todo". Útil para mostrar datos dentro de opciones de radio.
|
|
3278
|
+
*/
|
|
3279
|
+
variant?: 'copyable' | 'grid';
|
|
3280
|
+
/**
|
|
3281
|
+
* Datos de la grilla en modo `'grid'`: cada fila es un array de textos de celda.
|
|
3282
|
+
* Las celdas se reparten el ancho equitativamente. Ignorado en modo `'copyable'`.
|
|
3283
|
+
*/
|
|
3284
|
+
gridRows?: string[][];
|
|
3285
|
+
/**
|
|
3286
|
+
* Atenúa el color del texto de la grilla (modo `'grid'`). Sin efecto en `'copyable'`.
|
|
3287
|
+
*/
|
|
3288
|
+
disabled?: boolean;
|
|
3289
|
+
/** Texto del botón "Copiar todo". Default: "Copiar todos los datos". */
|
|
3290
|
+
copyAllLabel?: string;
|
|
3291
|
+
/** Texto cuando se copió todo. Default: "Datos copiados". */
|
|
3292
|
+
copiedAllLabel?: string;
|
|
3293
|
+
/** Si `false`, no muestra el botón "Copiar todo". */
|
|
3294
|
+
showCopyAll?: boolean;
|
|
3089
3295
|
}
|
|
3090
3296
|
declare const KdsCopyableTable: React__default.ForwardRefExoticComponent<KdsCopyableTableProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3091
3297
|
|
|
@@ -3102,13 +3308,66 @@ interface KdsCountdownProps extends React__default.HTMLAttributes<HTMLDivElement
|
|
|
3102
3308
|
}
|
|
3103
3309
|
declare const KdsCountdown: React__default.ForwardRefExoticComponent<KdsCountdownProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3104
3310
|
|
|
3105
|
-
|
|
3106
|
-
|
|
3311
|
+
/**
|
|
3312
|
+
* KdsSegmentedTabs — alias semántico de `KdsTabs`.
|
|
3313
|
+
*
|
|
3314
|
+
* Mantenido por backwards-compat con código que importa `KdsSegmentedTabs`.
|
|
3315
|
+
* `KdsTabs` ahora ya renderiza directamente segmented (la única variante del DS).
|
|
3316
|
+
*/
|
|
3317
|
+
type KdsSegmentedTabsProps = KdsTabsProps;
|
|
3318
|
+
declare const KdsSegmentedTabs: React$1.ForwardRefExoticComponent<KdsTabsProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
3319
|
+
|
|
3320
|
+
/**
|
|
3321
|
+
* Khipu Design System - Floating Action Button (FAB)
|
|
3322
|
+
*
|
|
3323
|
+
* A circular, icon-only floating button built with native HTML and kds-* CSS classes.
|
|
3324
|
+
* Presentational only: pair it with `useHideOnScroll` and drive the `hidden` prop for
|
|
3325
|
+
* hide-on-scroll behavior.
|
|
3326
|
+
*/
|
|
3107
3327
|
|
|
3108
|
-
|
|
3109
|
-
|
|
3328
|
+
type KdsFabPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'corner' | 'none';
|
|
3329
|
+
interface KdsFabProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3330
|
+
/** Material Symbols icon name, e.g. "close". */
|
|
3331
|
+
icon: string;
|
|
3332
|
+
/** Accessible label — required, since the button is icon-only. */
|
|
3333
|
+
'aria-label': string;
|
|
3334
|
+
/**
|
|
3335
|
+
* Corner to pin to (fixed). `corner` mounts it centered OVER the top-right corner of the
|
|
3336
|
+
* content column (`--kds-fab-column-width`), overlapping outward; `top-right` insets inside it.
|
|
3337
|
+
* Use `none` to leave positioning to the consumer. Default `top-right`.
|
|
3338
|
+
*/
|
|
3339
|
+
position?: KdsFabPosition;
|
|
3340
|
+
/** When true, animates the button out (fade + slight move) and disables interaction. */
|
|
3341
|
+
hidden?: boolean;
|
|
3342
|
+
}
|
|
3343
|
+
/**
|
|
3344
|
+
* Floating action button — circular, icon-only, with an animated hide state.
|
|
3345
|
+
*
|
|
3346
|
+
* @example
|
|
3347
|
+
* ```tsx
|
|
3348
|
+
* // Static, pinned top-right
|
|
3349
|
+
* <KdsFab icon="close" aria-label="Cancelar pago" onClick={openCancel} />
|
|
3350
|
+
*
|
|
3351
|
+
* // Hide on scroll down, show on scroll up
|
|
3352
|
+
* const { hidden } = useHideOnScroll();
|
|
3353
|
+
* <KdsFab icon="close" aria-label="Cancelar pago" hidden={hidden} onClick={openCancel} />
|
|
3354
|
+
* ```
|
|
3355
|
+
*/
|
|
3356
|
+
declare const KdsFab: React__default.ForwardRefExoticComponent<KdsFabProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
3357
|
+
|
|
3358
|
+
interface KdsBankRowProps extends Omit<React__default.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'name'> {
|
|
3359
|
+
/**
|
|
3360
|
+
* Contenido principal de la fila. Acepta texto o nodo — permite contenido en
|
|
3361
|
+
* columnas por elemento (p. ej. tipo de cuenta · Nº · saldo) para selección de cuentas.
|
|
3362
|
+
*/
|
|
3363
|
+
name: React__default.ReactNode;
|
|
3110
3364
|
logoUrl?: string;
|
|
3111
3365
|
selected?: boolean;
|
|
3366
|
+
/**
|
|
3367
|
+
* Oculta el slot de logo/iniciales. Útil para filas sin marca (p. ej. selección
|
|
3368
|
+
* de cuenta de origen, que no tiene logo).
|
|
3369
|
+
*/
|
|
3370
|
+
hideLogo?: boolean;
|
|
3112
3371
|
}
|
|
3113
3372
|
declare const KdsBankRow: React__default.ForwardRefExoticComponent<KdsBankRowProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
3114
3373
|
|
|
@@ -3160,24 +3419,67 @@ interface KdsCardPlanProps extends React__default.HTMLAttributes<HTMLDivElement>
|
|
|
3160
3419
|
}
|
|
3161
3420
|
declare const KdsCardPlan: React__default.ForwardRefExoticComponent<KdsCardPlanProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3162
3421
|
|
|
3163
|
-
interface KdsInvoiceStickyProps extends React__default.HTMLAttributes<
|
|
3422
|
+
interface KdsInvoiceStickyProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
3164
3423
|
}
|
|
3165
|
-
declare const KdsInvoiceSticky: React__default.ForwardRefExoticComponent<KdsInvoiceStickyProps & React__default.RefAttributes<
|
|
3424
|
+
declare const KdsInvoiceSticky: React__default.ForwardRefExoticComponent<KdsInvoiceStickyProps & React__default.RefAttributes<HTMLElement>>;
|
|
3425
|
+
|
|
3426
|
+
/**
|
|
3427
|
+
* Khipu Design System - BottomSheet Component
|
|
3428
|
+
*
|
|
3429
|
+
* Bottom-sheet (modal que sube desde abajo en mobile, centrado en desktop) basado
|
|
3430
|
+
* en Radix Dialog. Único componente de modales del DS — `KdsModal` fue unificado aquí.
|
|
3431
|
+
*
|
|
3432
|
+
* Contrato HTML (matchea CSS `.kds-bottom-sheet*` de khipu-components.css):
|
|
3433
|
+
*
|
|
3434
|
+
* <div class="kds-bottom-sheet-scrim open">
|
|
3435
|
+
* <div class="kds-bottom-sheet">
|
|
3436
|
+
* <div class="kds-bottom-sheet-grabber" /> <!-- opcional -->
|
|
3437
|
+
* <button class="kds-bottom-sheet-close">X</button> <!-- opcional -->
|
|
3438
|
+
* <h2 class="kds-bottom-sheet-title">...</h2> <!-- opcional -->
|
|
3439
|
+
* <p class="kds-bottom-sheet-description">...</p> <!-- opcional -->
|
|
3440
|
+
* <div class="kds-bottom-sheet-body">children</div>
|
|
3441
|
+
* <div class="kds-bottom-sheet-actions">actions</div> <!-- opcional -->
|
|
3442
|
+
* </div>
|
|
3443
|
+
* </div>
|
|
3444
|
+
*
|
|
3445
|
+
* IMPORTANTE: el scrim DEBE llevar la clase `.open` SIEMPRE (Radix maneja mount/unmount).
|
|
3446
|
+
* Sin `.open`, el scrim queda `display: none` y no se ve.
|
|
3447
|
+
*/
|
|
3166
3448
|
|
|
3167
3449
|
interface KdsBottomSheetProps {
|
|
3450
|
+
/** Controla la visibilidad. */
|
|
3168
3451
|
open: boolean;
|
|
3452
|
+
/** Callback cuando se debe cerrar (close button / ESC / click fuera). */
|
|
3169
3453
|
onClose: () => void;
|
|
3454
|
+
/** Título — renderiza `<h2 class="kds-bottom-sheet-title">`. */
|
|
3170
3455
|
title?: string;
|
|
3456
|
+
/** Descripción opcional bajo el título (`<p class="kds-bottom-sheet-description">`). */
|
|
3457
|
+
description?: string;
|
|
3458
|
+
/** Contenido del body. */
|
|
3171
3459
|
children: React__default.ReactNode;
|
|
3460
|
+
/** Botones de acción (footer). Renderiza dentro de `.kds-bottom-sheet-actions`. */
|
|
3172
3461
|
actions?: React__default.ReactNode;
|
|
3173
|
-
|
|
3174
|
-
|
|
3462
|
+
/** Mostrar grabber (handle) visual en el top. Default: true. */
|
|
3463
|
+
showGrabber?: boolean;
|
|
3464
|
+
/** Mostrar X de cierre en el top-right. Default: false. */
|
|
3465
|
+
showCloseButton?: boolean;
|
|
3466
|
+
/** Portal container — útil para Storybook o anchors específicos. */
|
|
3175
3467
|
container?: HTMLElement | null;
|
|
3468
|
+
/** Clase adicional al sheet. */
|
|
3469
|
+
className?: string;
|
|
3176
3470
|
}
|
|
3177
3471
|
declare const KdsBottomSheet: React__default.ForwardRefExoticComponent<KdsBottomSheetProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3178
3472
|
|
|
3179
3473
|
interface KdsSecureFooterProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
3180
3474
|
variant?: 'default' | 'inside';
|
|
3475
|
+
/** Muestra el logo de Khipu (a color). Default: true. */
|
|
3476
|
+
showLogo?: boolean;
|
|
3477
|
+
/**
|
|
3478
|
+
* Logo del proveedor de pagos (PSP) que contrató a Khipu. Si se provee, se renderiza
|
|
3479
|
+
* a la derecha del logo de Khipu separado por un divisor (ej. "Khipu | klap").
|
|
3480
|
+
* El consumidor pasa el `<img>`/SVG del PSP — el DS no empaqueta logos de terceros.
|
|
3481
|
+
*/
|
|
3482
|
+
psp?: React__default.ReactNode;
|
|
3181
3483
|
}
|
|
3182
3484
|
declare const KdsSecureFooter: React__default.ForwardRefExoticComponent<KdsSecureFooterProps & React__default.RefAttributes<HTMLElement>>;
|
|
3183
3485
|
|
|
@@ -3191,6 +3493,230 @@ interface KdsRecapListProps extends React__default.HTMLAttributes<HTMLUListEleme
|
|
|
3191
3493
|
}
|
|
3192
3494
|
declare const KdsRecapList: React__default.ForwardRefExoticComponent<KdsRecapListProps & React__default.RefAttributes<HTMLUListElement>>;
|
|
3193
3495
|
|
|
3496
|
+
interface KdsMontoRowProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
3497
|
+
/** Título principal (e.g. "Monto a transferir"). */
|
|
3498
|
+
title: string;
|
|
3499
|
+
/** Valor destacado (e.g. "$3.300"). */
|
|
3500
|
+
value: string;
|
|
3501
|
+
/**
|
|
3502
|
+
* Texto secundario opcional bajo el título (deadline/subtitle).
|
|
3503
|
+
* Acepta un nodo React para incluir line-breaks o formato.
|
|
3504
|
+
*/
|
|
3505
|
+
deadline?: React__default.ReactNode;
|
|
3506
|
+
}
|
|
3507
|
+
/**
|
|
3508
|
+
* KdsMontoRow — bloque destacado de monto con título + deadline opcional + valor.
|
|
3509
|
+
*
|
|
3510
|
+
* Layout (spec):
|
|
3511
|
+
* - `display: flex; justify-content: space-between`
|
|
3512
|
+
* - `padding: 14px 0 8px`
|
|
3513
|
+
* - `border-top: 1px dashed var(--kds-border-medium)`
|
|
3514
|
+
*
|
|
3515
|
+
* Tipografía:
|
|
3516
|
+
* - `.kds-monto-row-title`: `font-size: sm`, `font-weight: 500`
|
|
3517
|
+
* - `.kds-monto-row-deadline`: `font-size: xs`, `color: text-secondary`
|
|
3518
|
+
* - `.kds-monto-row-value`: `font-size: 24px`, `font-weight: 700`, `letter-spacing: tight`
|
|
3519
|
+
*
|
|
3520
|
+
* @gsp `_manualVerifyChileMaterial.gsp` y demás manualVerify
|
|
3521
|
+
* @css .kds-monto-row, .kds-monto-row-title, .kds-monto-row-deadline, .kds-monto-row-value
|
|
3522
|
+
*/
|
|
3523
|
+
declare const KdsMontoRow: React__default.ForwardRefExoticComponent<KdsMontoRowProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3524
|
+
|
|
3525
|
+
interface KdsMerchantTileProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3526
|
+
/** Nombre del merchant (usado para alt del logo o initials fallback). */
|
|
3527
|
+
name: string;
|
|
3528
|
+
/** URL del logo del merchant. Si está presente, renderiza `<img>` dentro del tile. */
|
|
3529
|
+
logoUrl?: string;
|
|
3530
|
+
/** Initials custom (2-3 letras). Si no se provee, usa las primeras 2 letras de `name`. */
|
|
3531
|
+
initials?: string;
|
|
3532
|
+
/** Variante compacta: 40×40 en vez de 56×56. */
|
|
3533
|
+
compact?: boolean;
|
|
3534
|
+
}
|
|
3535
|
+
/**
|
|
3536
|
+
* KdsMerchantTile — tile cuadrado con logo del comercio o initials.
|
|
3537
|
+
*
|
|
3538
|
+
* Layout (spec):
|
|
3539
|
+
* - `56 x 56` (default) / `40 x 40` (compact)
|
|
3540
|
+
* - `border-radius: var(--kds-radius-card)`
|
|
3541
|
+
* - `background: var(--kds-color-primary-deep)` (#5B3DB5)
|
|
3542
|
+
* - `color: white`, `display: grid; place-items: center`
|
|
3543
|
+
* - Initials: `font-size: xl` (20px), `font-weight: 700`, `letter-spacing: 0.02em`
|
|
3544
|
+
*
|
|
3545
|
+
* Variante logo:
|
|
3546
|
+
* - Agrega clase `.logo`, padding `var(--kds-spacing-0-5)` (4px)
|
|
3547
|
+
* - `<img>` interna: `object-fit: cover`, `border-radius: var(--kds-radius-md)`
|
|
3548
|
+
*
|
|
3549
|
+
* Compose with: este componente SOLO renderiza el tile cuadrado. Para el header
|
|
3550
|
+
* de comercio completo ("estás pagando a" + nombre), envolver en el patrón
|
|
3551
|
+
* `.kds-merchant`:
|
|
3552
|
+
* ```html
|
|
3553
|
+
* <div class="kds-merchant">
|
|
3554
|
+
* <!-- KdsMerchantTile → .kds-merchant-tile -->
|
|
3555
|
+
* <div class="kds-merchant-meta">
|
|
3556
|
+
* <span class="kds-merchant-label">Estás pagando a</span>
|
|
3557
|
+
* <strong>Comercial Santiago SpA</strong>
|
|
3558
|
+
* </div>
|
|
3559
|
+
* </div>
|
|
3560
|
+
* ```
|
|
3561
|
+
* Spacing canónico: `.kds-merchant` gap `var(--kds-spacing-1-75)`; label
|
|
3562
|
+
* `margin-bottom: var(--kds-spacing-0-25)`. Ver `Patterns/CSS-only → MerchantHeader`.
|
|
3563
|
+
*
|
|
3564
|
+
* @css .kds-merchant-tile, .kds-merchant-tile.logo, .kds-merchant.compact .kds-merchant-tile
|
|
3565
|
+
*/
|
|
3566
|
+
declare const KdsMerchantTile: React__default.ForwardRefExoticComponent<KdsMerchantTileProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3567
|
+
|
|
3568
|
+
interface KdsInvoiceMerchantProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3569
|
+
/** Logo URL del comercio. Si falla la carga (o no se provee), cae al ícono `storefront`. */
|
|
3570
|
+
logoUrl?: string;
|
|
3571
|
+
/** Color de marca de fondo (ej. del cobro). Si se omite, usa el fondo púrpura del DS. */
|
|
3572
|
+
brandColor?: string;
|
|
3573
|
+
}
|
|
3574
|
+
/**
|
|
3575
|
+
* KdsInvoiceMerchant — avatar cuadrado del comercio dentro del `kds-invoice-header`.
|
|
3576
|
+
*
|
|
3577
|
+
* Renderiza el markup canónico `.kds-invoice-merchant` (decorativo: `aria-hidden`), con el
|
|
3578
|
+
* logo del comercio y fallback al ícono `storefront` si la imagen no carga. El fondo toma el
|
|
3579
|
+
* color de marca del cobro cuando se provee. Dentro de `.kds-invoice-sticky` el tamaño colapsa
|
|
3580
|
+
* con el scroll vía el CSS del DS (`--collapse-progress`).
|
|
3581
|
+
*
|
|
3582
|
+
* Reemplaza la imagen + `onerror` inline del header server-side por manejo de error en React.
|
|
3583
|
+
*
|
|
3584
|
+
* @css .kds-invoice-merchant, .kds-invoice-merchant img, .kds-invoice-merchant i
|
|
3585
|
+
*/
|
|
3586
|
+
declare const KdsInvoiceMerchant: React__default.ForwardRefExoticComponent<KdsInvoiceMerchantProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3587
|
+
|
|
3588
|
+
type KdsPaymentTotalVariant = 'default' | 'email';
|
|
3589
|
+
/**
|
|
3590
|
+
* Color tone for the amount value.
|
|
3591
|
+
* - `brand`: default Khipu purple (current behaviour).
|
|
3592
|
+
* - `info`: khipu-blue (#5A5FE0) — LigoPay QR / transfer flows.
|
|
3593
|
+
*/
|
|
3594
|
+
type KdsPaymentTotalTone = 'brand' | 'info';
|
|
3595
|
+
interface KdsPaymentTotalProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
3596
|
+
/**
|
|
3597
|
+
* Variante visual.
|
|
3598
|
+
* - `default`: monto destacado en color primario (QR / payment view).
|
|
3599
|
+
* - `email`: monto compacto en color de texto primario (email templates).
|
|
3600
|
+
* @default 'default'
|
|
3601
|
+
*/
|
|
3602
|
+
variant?: KdsPaymentTotalVariant;
|
|
3603
|
+
/**
|
|
3604
|
+
* Tono de color del monto. Combinable con cualquier `variant`.
|
|
3605
|
+
* - `brand` (default): purple Khipu / texto primario según variante.
|
|
3606
|
+
* - `info`: khipu-blue (#5A5FE0) — pantallas QR/transfer de LigoPay.
|
|
3607
|
+
* @default 'brand'
|
|
3608
|
+
*/
|
|
3609
|
+
tone?: KdsPaymentTotalTone;
|
|
3610
|
+
/**
|
|
3611
|
+
* Si `true`, aplica el modificador `kds-payment-total--centered`: remueve el
|
|
3612
|
+
* `padding-left` asimétrico (que existe por defecto para la vista QR de
|
|
3613
|
+
* LigoPay) y centra todo el texto interno. Combinable con `variant` y `tone`.
|
|
3614
|
+
* @default false
|
|
3615
|
+
*/
|
|
3616
|
+
centered?: boolean;
|
|
3617
|
+
/**
|
|
3618
|
+
* Monto a mostrar.
|
|
3619
|
+
* - `number`: el componente formatea (entera + decimal) con `Intl.NumberFormat`.
|
|
3620
|
+
* - `string`: ya formateado (e.g. `"1,500.50"` o `"1500.50"`). Si contiene `.`,
|
|
3621
|
+
* la parte tras el punto se renderiza como superíndice decimal.
|
|
3622
|
+
*/
|
|
3623
|
+
amount: number | string;
|
|
3624
|
+
/**
|
|
3625
|
+
* Símbolo de moneda. Default `'S/'` (sol peruano) para mantener paridad con el origen
|
|
3626
|
+
* en paylink-ligopay. Pásalo explícito para otras monedas (`'$'`, `'CLP$'`, etc.).
|
|
3627
|
+
* @default 'S/'
|
|
3628
|
+
*/
|
|
3629
|
+
currency?: string;
|
|
3630
|
+
/**
|
|
3631
|
+
* Cantidad de decimales. `0` o `null` ocultan el superíndice decimal.
|
|
3632
|
+
* Aplica sólo cuando `amount` es `number` o cuando contiene un `.`.
|
|
3633
|
+
* @default 2
|
|
3634
|
+
*/
|
|
3635
|
+
decimals?: number | null;
|
|
3636
|
+
/**
|
|
3637
|
+
* Locale BCP-47 para `Intl.NumberFormat` (separadores miles/decimal).
|
|
3638
|
+
* Aplica sólo cuando `amount` es `number`.
|
|
3639
|
+
* @default 'es-PE'
|
|
3640
|
+
*/
|
|
3641
|
+
locale?: string;
|
|
3642
|
+
/**
|
|
3643
|
+
* Etiqueta sobre el monto (e.g. `"Monto a pagar"`).
|
|
3644
|
+
* @default 'Monto a pagar'
|
|
3645
|
+
*/
|
|
3646
|
+
label?: React__default.ReactNode;
|
|
3647
|
+
/**
|
|
3648
|
+
* Título principal (desktop). En la variante `default` aparece arriba; en `email`
|
|
3649
|
+
* se omite. Pasa `null` para ocultarlo en `default` también.
|
|
3650
|
+
* @default 'Escanea el QR'
|
|
3651
|
+
*/
|
|
3652
|
+
title?: React__default.ReactNode;
|
|
3653
|
+
/**
|
|
3654
|
+
* Título alternativo para mobile en variante `default`. En desktop se oculta vía CSS.
|
|
3655
|
+
* Pasa `null` para omitirlo.
|
|
3656
|
+
* @default 'Descarga el QR'
|
|
3657
|
+
*/
|
|
3658
|
+
titleMobile?: React__default.ReactNode;
|
|
3659
|
+
}
|
|
3660
|
+
/**
|
|
3661
|
+
* KdsPaymentTotal — bloque de "monto a pagar" usado en pantallas de pago QR y emails de cobro.
|
|
3662
|
+
*
|
|
3663
|
+
* Portado desde el taglib `<kh:paymentTotal>` de paylink-ligopay
|
|
3664
|
+
* (`KhipuTagLib.groovy:131-177` + `materialize-config.css → .payment-total`).
|
|
3665
|
+
*
|
|
3666
|
+
* **Variantes:**
|
|
3667
|
+
* - `default`: amount grande (`3rem`) en color primario Khipu — vista QR de pago.
|
|
3668
|
+
* - `email`: amount compacto (`1.5rem`) en color texto primario — plantillas email.
|
|
3669
|
+
*
|
|
3670
|
+
* **Layout responsive (default):**
|
|
3671
|
+
* - Desktop: padding-left 80px, title visible (titleMobile oculto).
|
|
3672
|
+
* - Mobile (≤ 1024px): centrado, sólo titleMobile visible.
|
|
3673
|
+
* - La variante `email` mantiene alineación izquierda en todos los breakpoints.
|
|
3674
|
+
*
|
|
3675
|
+
* **Decimal handling:**
|
|
3676
|
+
* - Si `amount` es `number`, se formatea con `Intl.NumberFormat(locale)`.
|
|
3677
|
+
* - Si `amount` es `string` con `.`, la parte tras el punto va al `<sup>`.
|
|
3678
|
+
* - `decimals={0}` o `null` desactivan el superíndice.
|
|
3679
|
+
*
|
|
3680
|
+
* @gsp Origen: paylink-ligopay/grails-app/taglib/com/khipu/payment/paylink/ligopay/KhipuTagLib.groovy
|
|
3681
|
+
* @css .kds-payment-total, .kds-payment-total--email, .kds-payment-total-title,
|
|
3682
|
+
* .kds-payment-total-title-mobile, .kds-payment-label, .kds-payment-amount,
|
|
3683
|
+
* .kds-payment-total-decimal-sup
|
|
3684
|
+
*/
|
|
3685
|
+
declare const KdsPaymentTotal: React__default.ForwardRefExoticComponent<KdsPaymentTotalProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3686
|
+
|
|
3687
|
+
interface KdsBillAttachmentProps extends Omit<React__default.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> {
|
|
3688
|
+
/** Nombre del archivo a descargar. */
|
|
3689
|
+
filename: string;
|
|
3690
|
+
/** URL absoluta o relativa del archivo. */
|
|
3691
|
+
href: string;
|
|
3692
|
+
/** Icon Material Symbols. Default: `attach_file`. */
|
|
3693
|
+
icon?: string;
|
|
3694
|
+
}
|
|
3695
|
+
/**
|
|
3696
|
+
* KdsBillAttachment — link de descarga para adjuntos de la factura/bill.
|
|
3697
|
+
*
|
|
3698
|
+
* Layout (spec):
|
|
3699
|
+
* - `display: inline-flex; align-items: center; justify-content: flex-start`
|
|
3700
|
+
* - `width: fit-content`
|
|
3701
|
+
* - `color: var(--kds-color-info-main)`, `font-size: sm` (14px), `font-weight: 500`
|
|
3702
|
+
* - `text-decoration: none` → hover `underline` solo en el span
|
|
3703
|
+
* - Icon: `font-size: lg` (16px)
|
|
3704
|
+
*
|
|
3705
|
+
* @gsp `mat:billAttachments` taglib (introducida en commit 1a8e228c9)
|
|
3706
|
+
* @css .kds-bill-attachment, .kds-bill-attachments
|
|
3707
|
+
*/
|
|
3708
|
+
declare const KdsBillAttachment: React__default.ForwardRefExoticComponent<KdsBillAttachmentProps & React__default.RefAttributes<HTMLAnchorElement>>;
|
|
3709
|
+
interface KdsBillAttachmentsProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
3710
|
+
}
|
|
3711
|
+
/**
|
|
3712
|
+
* KdsBillAttachments — contenedor vertical de varios `KdsBillAttachment`.
|
|
3713
|
+
*
|
|
3714
|
+
* Layout (spec):
|
|
3715
|
+
* - `display: flex; flex-direction: column`
|
|
3716
|
+
* - `gap: var(--kds-spacing-0-75)` (6px)
|
|
3717
|
+
*/
|
|
3718
|
+
declare const KdsBillAttachments: React__default.ForwardRefExoticComponent<KdsBillAttachmentsProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3719
|
+
|
|
3194
3720
|
declare function useCopyToClipboard(resetMs?: number): {
|
|
3195
3721
|
copied: boolean;
|
|
3196
3722
|
copy: (text: string) => Promise<void>;
|
|
@@ -3218,6 +3744,151 @@ declare function useTabsKeyboard(tabCount: number, activeIndex: number, onChange
|
|
|
3218
3744
|
onKeyDown: (e: React.KeyboardEvent) => void;
|
|
3219
3745
|
};
|
|
3220
3746
|
|
|
3747
|
+
/**
|
|
3748
|
+
* Options for {@link useStickyInvoiceCollapse}.
|
|
3749
|
+
*/
|
|
3750
|
+
interface UseStickyInvoiceCollapseOptions {
|
|
3751
|
+
/**
|
|
3752
|
+
* Called once each time the sticky header *starts* collapsing (scroll crosses the
|
|
3753
|
+
* threshold, progress 0 → >0). Use it to close any open expand panel from React
|
|
3754
|
+
* state — mirrors the vanilla DS behavior that closes `[data-expand-toggle]` panels
|
|
3755
|
+
* as soon as the header begins to collapse. Not fired again until the header
|
|
3756
|
+
* fully expands (progress returns to 0).
|
|
3757
|
+
*/
|
|
3758
|
+
onCollapseStart?: () => void;
|
|
3759
|
+
/**
|
|
3760
|
+
* Scroll/collapse range end in px (header is fully collapsed at this scroll). Default 20.
|
|
3761
|
+
*/
|
|
3762
|
+
collapseEnd?: number;
|
|
3763
|
+
/**
|
|
3764
|
+
* Max viewport width (px) for the collapse to apply. Desktop is always expanded. Default 768.
|
|
3765
|
+
*/
|
|
3766
|
+
mobileBreakpoint?: number;
|
|
3767
|
+
}
|
|
3768
|
+
/**
|
|
3769
|
+
* React port of the DS vanilla `initStickyInvoice` (`khipu-init.js`).
|
|
3770
|
+
*
|
|
3771
|
+
* On **mobile only** (< `mobileBreakpoint`), maps scroll (0 → `collapseEnd`px) to
|
|
3772
|
+
* `--collapse-progress` (0 → 1) on `.kds-screen.active`; the scoped DS CSS interpolates
|
|
3773
|
+
* the sticky-header collapse + box-shadow. Also caches `--collapse-collapsible-h`,
|
|
3774
|
+
* toggles `.is-collapsed` on `.kds-invoice-sticky`, and closes any open expand panel as
|
|
3775
|
+
* soon as the header starts collapsing (DOM `[data-expand-toggle]` / `.kds-expand-toggle`
|
|
3776
|
+
* for uncontrolled consumers, plus the {@link UseStickyInvoiceCollapseOptions.onCollapseStart}
|
|
3777
|
+
* callback for React-controlled toggles).
|
|
3778
|
+
*
|
|
3779
|
+
* Works standalone (`window.scrollY`) and **embedded in an iframe**, where the widget does
|
|
3780
|
+
* not scroll internally and the parent posts the scroll offset via
|
|
3781
|
+
* `postMessage({ type: 'VIEWPORT_OFFSET', offsetTop })`.
|
|
3782
|
+
*
|
|
3783
|
+
* This hook only reads/writes the DOM and `window` listeners; it renders nothing and
|
|
3784
|
+
* returns nothing. Call it once near the root of the payment screen.
|
|
3785
|
+
*/
|
|
3786
|
+
declare function useStickyInvoiceCollapse(options?: UseStickyInvoiceCollapseOptions): void;
|
|
3787
|
+
|
|
3788
|
+
/**
|
|
3789
|
+
* Options for {@link useExpandToggle}.
|
|
3790
|
+
*/
|
|
3791
|
+
interface UseExpandToggleOptions {
|
|
3792
|
+
/** Initial open state when uncontrolled. Default `false`. */
|
|
3793
|
+
defaultOpen?: boolean;
|
|
3794
|
+
/** Controlled open state. When provided, the hook is controlled and `onOpenChange` must drive updates. */
|
|
3795
|
+
open?: boolean;
|
|
3796
|
+
/** Called whenever the open state should change (toggle click). */
|
|
3797
|
+
onOpenChange?: (open: boolean) => void;
|
|
3798
|
+
/** Override the generated panel id (`aria-controls` / panel `id`). Defaults to a stable `useId()`. */
|
|
3799
|
+
id?: string;
|
|
3800
|
+
}
|
|
3801
|
+
/** Props to spread on the `.kds-expand-toggle` `<button>`. */
|
|
3802
|
+
interface ExpandToggleProps {
|
|
3803
|
+
type: 'button';
|
|
3804
|
+
'aria-expanded': boolean;
|
|
3805
|
+
'aria-controls': string;
|
|
3806
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
3807
|
+
}
|
|
3808
|
+
/** Props to spread on the `.kds-expand-panel` `<div>`. */
|
|
3809
|
+
interface ExpandPanelProps {
|
|
3810
|
+
id: string;
|
|
3811
|
+
className: string;
|
|
3812
|
+
hidden: boolean;
|
|
3813
|
+
/**
|
|
3814
|
+
* Ref the hook uses to drive the panel's `max-height` off its own `scrollHeight`, so the
|
|
3815
|
+
* expand animation fits any content length instead of clipping against a fixed CSS cap.
|
|
3816
|
+
*/
|
|
3817
|
+
ref: (node: HTMLDivElement | null) => void;
|
|
3818
|
+
}
|
|
3819
|
+
/**
|
|
3820
|
+
* Result of {@link useExpandToggle}.
|
|
3821
|
+
*/
|
|
3822
|
+
interface UseExpandToggleResult {
|
|
3823
|
+
/** Current open state. */
|
|
3824
|
+
open: boolean;
|
|
3825
|
+
/** Imperatively set the open state (e.g. close on header collapse). */
|
|
3826
|
+
setOpen: (open: boolean) => void;
|
|
3827
|
+
/** Toggle the open state. */
|
|
3828
|
+
toggle: () => void;
|
|
3829
|
+
/** Prop-getter for the `.kds-expand-toggle` button — wires `aria-expanded`, `aria-controls`, `onClick`. */
|
|
3830
|
+
getToggleProps: () => ExpandToggleProps;
|
|
3831
|
+
/**
|
|
3832
|
+
* Prop-getter for the `.kds-expand-panel` div — wires `id`, the `open` class and the
|
|
3833
|
+
* `hidden` attribute. Pass the base class (defaults to `kds-expand-panel`).
|
|
3834
|
+
*/
|
|
3835
|
+
getPanelProps: (baseClassName?: string) => ExpandPanelProps;
|
|
3836
|
+
}
|
|
3837
|
+
/**
|
|
3838
|
+
* Accessible disclosure (expand/collapse) wiring for the DS `.kds-expand-toggle` +
|
|
3839
|
+
* `.kds-expand-panel` pattern — the React equivalent of the vanilla `initExpandToggle`
|
|
3840
|
+
* (`khipu-init.js`) for consumers that don't load the global DS JS.
|
|
3841
|
+
*
|
|
3842
|
+
* It links button and panel via a stable `aria-controls`/`id` pair (`useId`), reflects the
|
|
3843
|
+
* open state through `aria-expanded` (which drives the caret rotation in CSS) and toggles the
|
|
3844
|
+
* `open` class on the panel, sizing its `max-height` to the content's `scrollHeight` so the
|
|
3845
|
+
* animation never clips. The `hidden` attribute is also set when closed — the DS provides a
|
|
3846
|
+
* `.kds-expand-panel[hidden]` rule that keeps the panel `display:block` so the collapse still animates.
|
|
3847
|
+
*
|
|
3848
|
+
* Supports controlled (`open` + `onOpenChange`) and uncontrolled (`defaultOpen`) usage. Combine
|
|
3849
|
+
* with `useStickyInvoiceCollapse({ onCollapseStart: () => setOpen(false) })` to close on scroll.
|
|
3850
|
+
*
|
|
3851
|
+
* @example
|
|
3852
|
+
* const detail = useExpandToggle();
|
|
3853
|
+
* <button className="kds-expand-toggle" {...detail.getToggleProps()}>…</button>
|
|
3854
|
+
* <div {...detail.getPanelProps('kds-expand-panel')}>…</div>
|
|
3855
|
+
*/
|
|
3856
|
+
declare function useExpandToggle(options?: UseExpandToggleOptions): UseExpandToggleResult;
|
|
3857
|
+
|
|
3858
|
+
/**
|
|
3859
|
+
* Options for {@link useHideOnScroll}.
|
|
3860
|
+
*/
|
|
3861
|
+
interface UseHideOnScrollOptions {
|
|
3862
|
+
/** Minimum scroll delta (px) before toggling, to avoid jitter. Default 8. */
|
|
3863
|
+
threshold?: number;
|
|
3864
|
+
/** Scroll offset (px) at/under which the element is always visible. Default 0. */
|
|
3865
|
+
topOffset?: number;
|
|
3866
|
+
}
|
|
3867
|
+
/**
|
|
3868
|
+
* Result of {@link useHideOnScroll}.
|
|
3869
|
+
*/
|
|
3870
|
+
interface UseHideOnScrollResult {
|
|
3871
|
+
/** True when the element should be hidden (user scrolled down past the threshold). */
|
|
3872
|
+
hidden: boolean;
|
|
3873
|
+
}
|
|
3874
|
+
/**
|
|
3875
|
+
* Hide-on-scroll-down / show-on-scroll-up for floating UI (e.g. `KdsFab`).
|
|
3876
|
+
*
|
|
3877
|
+
* Returns `{ hidden }`: starts visible, hides once the user scrolls **down** past
|
|
3878
|
+
* `threshold`, shows again as soon as they scroll **up**, and is always visible while
|
|
3879
|
+
* within `topOffset` of the top. Coalesced through `requestAnimationFrame` so it stays cheap.
|
|
3880
|
+
*
|
|
3881
|
+
* Works standalone (`window.scrollY`) and **embedded in an iframe**, where the widget does
|
|
3882
|
+
* not scroll internally and the parent posts the scroll offset via
|
|
3883
|
+
* `postMessage({ type: 'VIEWPORT_OFFSET', offsetTop })` — the same mechanism as
|
|
3884
|
+
* {@link useStickyInvoiceCollapse}.
|
|
3885
|
+
*
|
|
3886
|
+
* @example
|
|
3887
|
+
* const { hidden } = useHideOnScroll();
|
|
3888
|
+
* <KdsFab icon="close" aria-label="Cancelar" hidden={hidden} onClick={open} />
|
|
3889
|
+
*/
|
|
3890
|
+
declare function useHideOnScroll(options?: UseHideOnScrollOptions): UseHideOnScrollResult;
|
|
3891
|
+
|
|
3221
3892
|
/**
|
|
3222
3893
|
* Khipu Design System - Core Utilities
|
|
3223
3894
|
*
|
|
@@ -3235,5 +3906,12 @@ declare function getContrastColor(hex: string): string;
|
|
|
3235
3906
|
* @param amount - 0 = original, 1 = white. Typical: 0.85 for container colors.
|
|
3236
3907
|
*/
|
|
3237
3908
|
declare function lighten(hex: string, amount: number): string;
|
|
3909
|
+
/**
|
|
3910
|
+
* Format an ISO 8601 string as "DD-MM-YYYY HH:mm" (24h) in the browser's local timezone.
|
|
3911
|
+
* Returns "" for empty or invalid input. Numeric (not `Intl` locale-aware) so the 24h + numeric
|
|
3912
|
+
* output matches server-side (ICU/Java) formatting regardless of locale.
|
|
3913
|
+
* @param iso - ISO 8601 date-time, e.g. "2026-08-26T03:59:00.000Z"
|
|
3914
|
+
*/
|
|
3915
|
+
declare function formatDateTime(iso?: string): string;
|
|
3238
3916
|
|
|
3239
|
-
export { type Colors, KdsAccordion, KdsAccordionDetails, type KdsAccordionDetailsProps, type KdsAccordionProps, KdsAccordionSummary, type KdsAccordionSummaryProps, KdsAlert, type KdsAlertProps, type KdsAlertSeverity, KdsBankList, type KdsBankListProps, KdsBankModal, type KdsBankModalProps, KdsBankRow, type KdsBankRowProps, KdsBottomSheet, type KdsBottomSheetProps, KdsButton, type KdsButtonProps, type KdsButtonSize, type KdsButtonVariant, KdsCard, KdsCardBody, KdsCardFooter, KdsCardHeader, KdsCardPlan, type KdsCardPlanProps, type KdsCardProps, type KdsCardSectionProps, KdsCardSelector, type KdsCardSelectorProps, type KdsCardVariant, KdsCheckbox, type KdsCheckboxProps, KdsChip, type KdsChipColor, type KdsChipProps, KdsCopyRow, type KdsCopyRowProps, KdsCopyableTable, type KdsCopyableTableProps, type KdsCopyableTableRow, KdsCountdown, type KdsCountdownProps, KdsDivider, type KdsDividerProps, KdsExpandPanel, type KdsExpandPanelProps,
|
|
3917
|
+
export { type Colors, type ExpandPanelProps, type ExpandToggleProps, KdsAccordion, KdsAccordionDetails, type KdsAccordionDetailsProps, type KdsAccordionProps, KdsAccordionSummary, type KdsAccordionSummaryProps, KdsAlert, type KdsAlertProps, type KdsAlertSeverity, KdsBankList, type KdsBankListProps, KdsBankModal, type KdsBankModalProps, KdsBankRow, type KdsBankRowProps, KdsBillAttachment, type KdsBillAttachmentProps, KdsBillAttachments, type KdsBillAttachmentsProps, KdsBottomSheet, type KdsBottomSheetProps, KdsButton, type KdsButtonProps, type KdsButtonSize, type KdsButtonVariant, KdsCard, KdsCardBody, KdsCardFooter, KdsCardHeader, KdsCardPlan, type KdsCardPlanProps, type KdsCardProps, type KdsCardSectionProps, KdsCardSelector, type KdsCardSelectorProps, type KdsCardVariant, KdsCheckbox, type KdsCheckboxProps, KdsChip, type KdsChipColor, type KdsChipProps, KdsCopyButton, type KdsCopyButtonProps, KdsCopyRow, type KdsCopyRowProps, KdsCopyableTable, type KdsCopyableTableProps, type KdsCopyableTableRow, KdsCountdown, type KdsCountdownProps, KdsDivider, type KdsDividerProps, KdsExpandPanel, type KdsExpandPanelProps, KdsFab, type KdsFabPosition, type KdsFabProps, KdsInvoiceMerchant, type KdsInvoiceMerchantProps, KdsInvoiceSticky, type KdsInvoiceStickyProps, KdsLinearProgress, type KdsLinearProgressProps, KdsMerchantTile, type KdsMerchantTileProps, KdsMontoRow, type KdsMontoRowProps, KdsPaymentTotal, type KdsPaymentTotalProps, type KdsPaymentTotalVariant, KdsQrRow, type KdsQrRowProps, KdsRadioGroup, type KdsRadioGroupProps, type KdsRadioOption, type KdsRecapItem, KdsRecapList, type KdsRecapListProps, KdsSearchField, type KdsSearchFieldProps, KdsSectionNote, type KdsSectionNoteProps, KdsSecureFooter, type KdsSecureFooterProps, KdsSecureLoader, type KdsSecureLoaderProps, KdsSegmentedTabs, type KdsSegmentedTabsProps, KdsSelect, type KdsSelectOption, type KdsSelectProps, KdsSnackbar, type KdsSnackbarProps, type KdsSnackbarType, KdsSpinner, type KdsSpinnerProps, type KdsSpinnerSize, KdsStatusBlock, type KdsStatusBlockProps, type KdsStatusType, KdsStepper, type KdsStepperProps, KdsTab, KdsTabPanel, type KdsTabPanelProps, type KdsTabProps, KdsTabs, type KdsTabsProps, KdsTextField, type KdsTextFieldProps, KdsThemeProvider, type KdsThemeProviderProps, KdsTooltip, type KdsTooltipPlacement, type KdsTooltipProps, KdsTypography, type KdsTypographyProps, type KdsTypographyVariant, type ThemeMode, type Tokens, type TokensByMode, type Typography as TypographyTokens, type UseExpandToggleOptions, type UseExpandToggleResult, type UseHideOnScrollOptions, type UseHideOnScrollResult, type UseStickyInvoiceCollapseOptions, borderRadius, breakpoints, colors, colorsByMode, fontFamilies, fontSizes, fontWeights, formatDateTime, getContrastColor, letterSpacings, lighten, lineHeights, semanticSpacing, shadows, spacing, tokens, tokensByMode, transitions, typography, useAutoHide, useCopyToClipboard, useCountdown, useExpandToggle, useHideOnScroll, useStickyInvoiceCollapse, useTabsKeyboard, zIndex };
|