@khipu/design-system 0.2.0-alpha.79 → 0.2.0-alpha.80
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 +1 -1
- package/dist/beercss/khipu-beercss.scoped.css +1 -1
- package/dist/beercss/metadata.json +5 -5
- package/dist/index.d.mts +88 -3
- package/dist/index.d.ts +88 -3
- package/dist/index.js +93 -20
- package/dist/index.mjs +86 -15
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khipu/design-system/beercss",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.80",
|
|
4
4
|
"description": "Khipu BeerCSS bundle with Material Design 3 and Khipu customizations",
|
|
5
|
-
"buildDate": "2026-06-
|
|
5
|
+
"buildDate": "2026-06-30T16:01:28.190Z",
|
|
6
6
|
"includes": {
|
|
7
7
|
"beercss": "4.0.1",
|
|
8
8
|
"khipu-tokens": "latest",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
},
|
|
20
20
|
"scopeClass": ".kds-theme-root",
|
|
21
21
|
"cdn": {
|
|
22
|
-
"css": "https://cdn.jsdelivr.net/npm/@khipu/design-system@0.2.0-alpha.
|
|
23
|
-
"cssScoped": "https://cdn.jsdelivr.net/npm/@khipu/design-system@0.2.0-alpha.
|
|
24
|
-
"js": "https://cdn.jsdelivr.net/npm/@khipu/design-system@0.2.0-alpha.
|
|
22
|
+
"css": "https://cdn.jsdelivr.net/npm/@khipu/design-system@0.2.0-alpha.80/dist/beercss/khipu-beercss.min.css",
|
|
23
|
+
"cssScoped": "https://cdn.jsdelivr.net/npm/@khipu/design-system@0.2.0-alpha.80/dist/beercss/khipu-beercss.scoped.min.css",
|
|
24
|
+
"js": "https://cdn.jsdelivr.net/npm/@khipu/design-system@0.2.0-alpha.80/dist/beercss/khipu-beercss.min.js"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -3362,9 +3362,9 @@ interface KdsCardPlanProps extends React__default.HTMLAttributes<HTMLDivElement>
|
|
|
3362
3362
|
}
|
|
3363
3363
|
declare const KdsCardPlan: React__default.ForwardRefExoticComponent<KdsCardPlanProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3364
3364
|
|
|
3365
|
-
interface KdsInvoiceStickyProps extends React__default.HTMLAttributes<
|
|
3365
|
+
interface KdsInvoiceStickyProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
3366
3366
|
}
|
|
3367
|
-
declare const KdsInvoiceSticky: React__default.ForwardRefExoticComponent<KdsInvoiceStickyProps & React__default.RefAttributes<
|
|
3367
|
+
declare const KdsInvoiceSticky: React__default.ForwardRefExoticComponent<KdsInvoiceStickyProps & React__default.RefAttributes<HTMLElement>>;
|
|
3368
3368
|
|
|
3369
3369
|
/**
|
|
3370
3370
|
* Khipu Design System - BottomSheet Component
|
|
@@ -3508,6 +3508,26 @@ interface KdsMerchantTileProps extends Omit<React__default.HTMLAttributes<HTMLDi
|
|
|
3508
3508
|
*/
|
|
3509
3509
|
declare const KdsMerchantTile: React__default.ForwardRefExoticComponent<KdsMerchantTileProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3510
3510
|
|
|
3511
|
+
interface KdsInvoiceMerchantProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3512
|
+
/** Logo URL del comercio. Si falla la carga (o no se provee), cae al ícono `storefront`. */
|
|
3513
|
+
logoUrl?: string;
|
|
3514
|
+
/** Color de marca de fondo (ej. del cobro). Si se omite, usa el fondo púrpura del DS. */
|
|
3515
|
+
brandColor?: string;
|
|
3516
|
+
}
|
|
3517
|
+
/**
|
|
3518
|
+
* KdsInvoiceMerchant — avatar cuadrado del comercio dentro del `kds-invoice-header`.
|
|
3519
|
+
*
|
|
3520
|
+
* Renderiza el markup canónico `.kds-invoice-merchant` (decorativo: `aria-hidden`), con el
|
|
3521
|
+
* logo del comercio y fallback al ícono `storefront` si la imagen no carga. El fondo toma el
|
|
3522
|
+
* color de marca del cobro cuando se provee. Dentro de `.kds-invoice-sticky` el tamaño colapsa
|
|
3523
|
+
* con el scroll vía el CSS del DS (`--collapse-progress`).
|
|
3524
|
+
*
|
|
3525
|
+
* Reemplaza la imagen + `onerror` inline del header server-side por manejo de error en React.
|
|
3526
|
+
*
|
|
3527
|
+
* @css .kds-invoice-merchant, .kds-invoice-merchant img, .kds-invoice-merchant i
|
|
3528
|
+
*/
|
|
3529
|
+
declare const KdsInvoiceMerchant: React__default.ForwardRefExoticComponent<KdsInvoiceMerchantProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3530
|
+
|
|
3511
3531
|
type KdsPaymentTotalVariant = 'default' | 'email';
|
|
3512
3532
|
/**
|
|
3513
3533
|
* Color tone for the amount value.
|
|
@@ -3708,6 +3728,71 @@ interface UseStickyInvoiceCollapseOptions {
|
|
|
3708
3728
|
*/
|
|
3709
3729
|
declare function useStickyInvoiceCollapse(options?: UseStickyInvoiceCollapseOptions): void;
|
|
3710
3730
|
|
|
3731
|
+
/**
|
|
3732
|
+
* Options for {@link useExpandToggle}.
|
|
3733
|
+
*/
|
|
3734
|
+
interface UseExpandToggleOptions {
|
|
3735
|
+
/** Initial open state when uncontrolled. Default `false`. */
|
|
3736
|
+
defaultOpen?: boolean;
|
|
3737
|
+
/** Controlled open state. When provided, the hook is controlled and `onOpenChange` must drive updates. */
|
|
3738
|
+
open?: boolean;
|
|
3739
|
+
/** Called whenever the open state should change (toggle click). */
|
|
3740
|
+
onOpenChange?: (open: boolean) => void;
|
|
3741
|
+
/** Override the generated panel id (`aria-controls` / panel `id`). Defaults to a stable `useId()`. */
|
|
3742
|
+
id?: string;
|
|
3743
|
+
}
|
|
3744
|
+
/** Props to spread on the `.kds-expand-toggle` `<button>`. */
|
|
3745
|
+
interface ExpandToggleProps {
|
|
3746
|
+
type: 'button';
|
|
3747
|
+
'aria-expanded': boolean;
|
|
3748
|
+
'aria-controls': string;
|
|
3749
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
3750
|
+
}
|
|
3751
|
+
/** Props to spread on the `.kds-expand-panel` `<div>`. */
|
|
3752
|
+
interface ExpandPanelProps {
|
|
3753
|
+
id: string;
|
|
3754
|
+
className: string;
|
|
3755
|
+
hidden: boolean;
|
|
3756
|
+
}
|
|
3757
|
+
/**
|
|
3758
|
+
* Result of {@link useExpandToggle}.
|
|
3759
|
+
*/
|
|
3760
|
+
interface UseExpandToggleResult {
|
|
3761
|
+
/** Current open state. */
|
|
3762
|
+
open: boolean;
|
|
3763
|
+
/** Imperatively set the open state (e.g. close on header collapse). */
|
|
3764
|
+
setOpen: (open: boolean) => void;
|
|
3765
|
+
/** Toggle the open state. */
|
|
3766
|
+
toggle: () => void;
|
|
3767
|
+
/** Prop-getter for the `.kds-expand-toggle` button — wires `aria-expanded`, `aria-controls`, `onClick`. */
|
|
3768
|
+
getToggleProps: () => ExpandToggleProps;
|
|
3769
|
+
/**
|
|
3770
|
+
* Prop-getter for the `.kds-expand-panel` div — wires `id`, the `open` class and the
|
|
3771
|
+
* `hidden` attribute. Pass the base class (defaults to `kds-expand-panel`).
|
|
3772
|
+
*/
|
|
3773
|
+
getPanelProps: (baseClassName?: string) => ExpandPanelProps;
|
|
3774
|
+
}
|
|
3775
|
+
/**
|
|
3776
|
+
* Accessible disclosure (expand/collapse) wiring for the DS `.kds-expand-toggle` +
|
|
3777
|
+
* `.kds-expand-panel` pattern — the React equivalent of the vanilla `initExpandToggle`
|
|
3778
|
+
* (`khipu-init.js`) for consumers that don't load the global DS JS.
|
|
3779
|
+
*
|
|
3780
|
+
* It links button and panel via a stable `aria-controls`/`id` pair (`useId`), reflects the
|
|
3781
|
+
* open state through `aria-expanded` (which drives the caret rotation in CSS) and toggles the
|
|
3782
|
+
* `open` class on the panel (whose `max-height` animation the DS CSS owns). The `hidden`
|
|
3783
|
+
* attribute is also set when closed — the DS provides a `.kds-expand-panel[hidden]` rule that
|
|
3784
|
+
* keeps the panel `display:block` so the collapse still animates.
|
|
3785
|
+
*
|
|
3786
|
+
* Supports controlled (`open` + `onOpenChange`) and uncontrolled (`defaultOpen`) usage. Combine
|
|
3787
|
+
* with `useStickyInvoiceCollapse({ onCollapseStart: () => setOpen(false) })` to close on scroll.
|
|
3788
|
+
*
|
|
3789
|
+
* @example
|
|
3790
|
+
* const detail = useExpandToggle();
|
|
3791
|
+
* <button className="kds-expand-toggle" {...detail.getToggleProps()}>…</button>
|
|
3792
|
+
* <div {...detail.getPanelProps('kds-expand-panel')}>…</div>
|
|
3793
|
+
*/
|
|
3794
|
+
declare function useExpandToggle(options?: UseExpandToggleOptions): UseExpandToggleResult;
|
|
3795
|
+
|
|
3711
3796
|
/**
|
|
3712
3797
|
* Khipu Design System - Core Utilities
|
|
3713
3798
|
*
|
|
@@ -3726,4 +3811,4 @@ declare function getContrastColor(hex: string): string;
|
|
|
3726
3811
|
*/
|
|
3727
3812
|
declare function lighten(hex: string, amount: number): string;
|
|
3728
3813
|
|
|
3729
|
-
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, 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, 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 UseStickyInvoiceCollapseOptions, borderRadius, breakpoints, colors, colorsByMode, fontFamilies, fontSizes, fontWeights, getContrastColor, letterSpacings, lighten, lineHeights, semanticSpacing, shadows, spacing, tokens, tokensByMode, transitions, typography, useAutoHide, useCopyToClipboard, useCountdown, useStickyInvoiceCollapse, useTabsKeyboard, zIndex };
|
|
3814
|
+
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, 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 UseStickyInvoiceCollapseOptions, borderRadius, breakpoints, colors, colorsByMode, fontFamilies, fontSizes, fontWeights, getContrastColor, letterSpacings, lighten, lineHeights, semanticSpacing, shadows, spacing, tokens, tokensByMode, transitions, typography, useAutoHide, useCopyToClipboard, useCountdown, useExpandToggle, useStickyInvoiceCollapse, useTabsKeyboard, zIndex };
|
package/dist/index.d.ts
CHANGED
|
@@ -3362,9 +3362,9 @@ interface KdsCardPlanProps extends React__default.HTMLAttributes<HTMLDivElement>
|
|
|
3362
3362
|
}
|
|
3363
3363
|
declare const KdsCardPlan: React__default.ForwardRefExoticComponent<KdsCardPlanProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3364
3364
|
|
|
3365
|
-
interface KdsInvoiceStickyProps extends React__default.HTMLAttributes<
|
|
3365
|
+
interface KdsInvoiceStickyProps extends React__default.HTMLAttributes<HTMLElement> {
|
|
3366
3366
|
}
|
|
3367
|
-
declare const KdsInvoiceSticky: React__default.ForwardRefExoticComponent<KdsInvoiceStickyProps & React__default.RefAttributes<
|
|
3367
|
+
declare const KdsInvoiceSticky: React__default.ForwardRefExoticComponent<KdsInvoiceStickyProps & React__default.RefAttributes<HTMLElement>>;
|
|
3368
3368
|
|
|
3369
3369
|
/**
|
|
3370
3370
|
* Khipu Design System - BottomSheet Component
|
|
@@ -3508,6 +3508,26 @@ interface KdsMerchantTileProps extends Omit<React__default.HTMLAttributes<HTMLDi
|
|
|
3508
3508
|
*/
|
|
3509
3509
|
declare const KdsMerchantTile: React__default.ForwardRefExoticComponent<KdsMerchantTileProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3510
3510
|
|
|
3511
|
+
interface KdsInvoiceMerchantProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3512
|
+
/** Logo URL del comercio. Si falla la carga (o no se provee), cae al ícono `storefront`. */
|
|
3513
|
+
logoUrl?: string;
|
|
3514
|
+
/** Color de marca de fondo (ej. del cobro). Si se omite, usa el fondo púrpura del DS. */
|
|
3515
|
+
brandColor?: string;
|
|
3516
|
+
}
|
|
3517
|
+
/**
|
|
3518
|
+
* KdsInvoiceMerchant — avatar cuadrado del comercio dentro del `kds-invoice-header`.
|
|
3519
|
+
*
|
|
3520
|
+
* Renderiza el markup canónico `.kds-invoice-merchant` (decorativo: `aria-hidden`), con el
|
|
3521
|
+
* logo del comercio y fallback al ícono `storefront` si la imagen no carga. El fondo toma el
|
|
3522
|
+
* color de marca del cobro cuando se provee. Dentro de `.kds-invoice-sticky` el tamaño colapsa
|
|
3523
|
+
* con el scroll vía el CSS del DS (`--collapse-progress`).
|
|
3524
|
+
*
|
|
3525
|
+
* Reemplaza la imagen + `onerror` inline del header server-side por manejo de error en React.
|
|
3526
|
+
*
|
|
3527
|
+
* @css .kds-invoice-merchant, .kds-invoice-merchant img, .kds-invoice-merchant i
|
|
3528
|
+
*/
|
|
3529
|
+
declare const KdsInvoiceMerchant: React__default.ForwardRefExoticComponent<KdsInvoiceMerchantProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3530
|
+
|
|
3511
3531
|
type KdsPaymentTotalVariant = 'default' | 'email';
|
|
3512
3532
|
/**
|
|
3513
3533
|
* Color tone for the amount value.
|
|
@@ -3708,6 +3728,71 @@ interface UseStickyInvoiceCollapseOptions {
|
|
|
3708
3728
|
*/
|
|
3709
3729
|
declare function useStickyInvoiceCollapse(options?: UseStickyInvoiceCollapseOptions): void;
|
|
3710
3730
|
|
|
3731
|
+
/**
|
|
3732
|
+
* Options for {@link useExpandToggle}.
|
|
3733
|
+
*/
|
|
3734
|
+
interface UseExpandToggleOptions {
|
|
3735
|
+
/** Initial open state when uncontrolled. Default `false`. */
|
|
3736
|
+
defaultOpen?: boolean;
|
|
3737
|
+
/** Controlled open state. When provided, the hook is controlled and `onOpenChange` must drive updates. */
|
|
3738
|
+
open?: boolean;
|
|
3739
|
+
/** Called whenever the open state should change (toggle click). */
|
|
3740
|
+
onOpenChange?: (open: boolean) => void;
|
|
3741
|
+
/** Override the generated panel id (`aria-controls` / panel `id`). Defaults to a stable `useId()`. */
|
|
3742
|
+
id?: string;
|
|
3743
|
+
}
|
|
3744
|
+
/** Props to spread on the `.kds-expand-toggle` `<button>`. */
|
|
3745
|
+
interface ExpandToggleProps {
|
|
3746
|
+
type: 'button';
|
|
3747
|
+
'aria-expanded': boolean;
|
|
3748
|
+
'aria-controls': string;
|
|
3749
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
3750
|
+
}
|
|
3751
|
+
/** Props to spread on the `.kds-expand-panel` `<div>`. */
|
|
3752
|
+
interface ExpandPanelProps {
|
|
3753
|
+
id: string;
|
|
3754
|
+
className: string;
|
|
3755
|
+
hidden: boolean;
|
|
3756
|
+
}
|
|
3757
|
+
/**
|
|
3758
|
+
* Result of {@link useExpandToggle}.
|
|
3759
|
+
*/
|
|
3760
|
+
interface UseExpandToggleResult {
|
|
3761
|
+
/** Current open state. */
|
|
3762
|
+
open: boolean;
|
|
3763
|
+
/** Imperatively set the open state (e.g. close on header collapse). */
|
|
3764
|
+
setOpen: (open: boolean) => void;
|
|
3765
|
+
/** Toggle the open state. */
|
|
3766
|
+
toggle: () => void;
|
|
3767
|
+
/** Prop-getter for the `.kds-expand-toggle` button — wires `aria-expanded`, `aria-controls`, `onClick`. */
|
|
3768
|
+
getToggleProps: () => ExpandToggleProps;
|
|
3769
|
+
/**
|
|
3770
|
+
* Prop-getter for the `.kds-expand-panel` div — wires `id`, the `open` class and the
|
|
3771
|
+
* `hidden` attribute. Pass the base class (defaults to `kds-expand-panel`).
|
|
3772
|
+
*/
|
|
3773
|
+
getPanelProps: (baseClassName?: string) => ExpandPanelProps;
|
|
3774
|
+
}
|
|
3775
|
+
/**
|
|
3776
|
+
* Accessible disclosure (expand/collapse) wiring for the DS `.kds-expand-toggle` +
|
|
3777
|
+
* `.kds-expand-panel` pattern — the React equivalent of the vanilla `initExpandToggle`
|
|
3778
|
+
* (`khipu-init.js`) for consumers that don't load the global DS JS.
|
|
3779
|
+
*
|
|
3780
|
+
* It links button and panel via a stable `aria-controls`/`id` pair (`useId`), reflects the
|
|
3781
|
+
* open state through `aria-expanded` (which drives the caret rotation in CSS) and toggles the
|
|
3782
|
+
* `open` class on the panel (whose `max-height` animation the DS CSS owns). The `hidden`
|
|
3783
|
+
* attribute is also set when closed — the DS provides a `.kds-expand-panel[hidden]` rule that
|
|
3784
|
+
* keeps the panel `display:block` so the collapse still animates.
|
|
3785
|
+
*
|
|
3786
|
+
* Supports controlled (`open` + `onOpenChange`) and uncontrolled (`defaultOpen`) usage. Combine
|
|
3787
|
+
* with `useStickyInvoiceCollapse({ onCollapseStart: () => setOpen(false) })` to close on scroll.
|
|
3788
|
+
*
|
|
3789
|
+
* @example
|
|
3790
|
+
* const detail = useExpandToggle();
|
|
3791
|
+
* <button className="kds-expand-toggle" {...detail.getToggleProps()}>…</button>
|
|
3792
|
+
* <div {...detail.getPanelProps('kds-expand-panel')}>…</div>
|
|
3793
|
+
*/
|
|
3794
|
+
declare function useExpandToggle(options?: UseExpandToggleOptions): UseExpandToggleResult;
|
|
3795
|
+
|
|
3711
3796
|
/**
|
|
3712
3797
|
* Khipu Design System - Core Utilities
|
|
3713
3798
|
*
|
|
@@ -3726,4 +3811,4 @@ declare function getContrastColor(hex: string): string;
|
|
|
3726
3811
|
*/
|
|
3727
3812
|
declare function lighten(hex: string, amount: number): string;
|
|
3728
3813
|
|
|
3729
|
-
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, 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, 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 UseStickyInvoiceCollapseOptions, borderRadius, breakpoints, colors, colorsByMode, fontFamilies, fontSizes, fontWeights, getContrastColor, letterSpacings, lighten, lineHeights, semanticSpacing, shadows, spacing, tokens, tokensByMode, transitions, typography, useAutoHide, useCopyToClipboard, useCountdown, useStickyInvoiceCollapse, useTabsKeyboard, zIndex };
|
|
3814
|
+
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, 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 UseStickyInvoiceCollapseOptions, borderRadius, breakpoints, colors, colorsByMode, fontFamilies, fontSizes, fontWeights, getContrastColor, letterSpacings, lighten, lineHeights, semanticSpacing, shadows, spacing, tokens, tokensByMode, transitions, typography, useAutoHide, useCopyToClipboard, useCountdown, useExpandToggle, useStickyInvoiceCollapse, useTabsKeyboard, zIndex };
|
package/dist/index.js
CHANGED
|
@@ -55,6 +55,7 @@ __export(index_exports, {
|
|
|
55
55
|
KdsCountdown: () => KdsCountdown,
|
|
56
56
|
KdsDivider: () => KdsDivider,
|
|
57
57
|
KdsExpandPanel: () => KdsExpandPanel,
|
|
58
|
+
KdsInvoiceMerchant: () => KdsInvoiceMerchant,
|
|
58
59
|
KdsInvoiceSticky: () => KdsInvoiceSticky,
|
|
59
60
|
KdsLinearProgress: () => KdsLinearProgress,
|
|
60
61
|
KdsMerchantTile: () => KdsMerchantTile,
|
|
@@ -102,6 +103,7 @@ __export(index_exports, {
|
|
|
102
103
|
useAutoHide: () => useAutoHide,
|
|
103
104
|
useCopyToClipboard: () => useCopyToClipboard,
|
|
104
105
|
useCountdown: () => useCountdown,
|
|
106
|
+
useExpandToggle: () => useExpandToggle,
|
|
105
107
|
useStickyInvoiceCollapse: () => useStickyInvoiceCollapse,
|
|
106
108
|
useTabsKeyboard: () => useTabsKeyboard,
|
|
107
109
|
zIndex: () => zIndex
|
|
@@ -2373,7 +2375,15 @@ KdsCardPlan.displayName = "KdsCardPlan";
|
|
|
2373
2375
|
var import_react37 = require("react");
|
|
2374
2376
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2375
2377
|
var KdsInvoiceSticky = (0, import_react37.forwardRef)(
|
|
2376
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2378
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2379
|
+
"article",
|
|
2380
|
+
{
|
|
2381
|
+
ref,
|
|
2382
|
+
className: (0, import_clsx.clsx)("kds-card-elevated", "kds-invoice-sticky", className),
|
|
2383
|
+
...props,
|
|
2384
|
+
children
|
|
2385
|
+
}
|
|
2386
|
+
)
|
|
2377
2387
|
);
|
|
2378
2388
|
KdsInvoiceSticky.displayName = "KdsInvoiceSticky";
|
|
2379
2389
|
|
|
@@ -2527,10 +2537,32 @@ var KdsMerchantTile = (0, import_react43.forwardRef)(
|
|
|
2527
2537
|
);
|
|
2528
2538
|
KdsMerchantTile.displayName = "KdsMerchantTile";
|
|
2529
2539
|
|
|
2530
|
-
// src/components/domain/
|
|
2540
|
+
// src/components/domain/KdsInvoiceMerchant/KdsInvoiceMerchant.tsx
|
|
2531
2541
|
var import_react44 = require("react");
|
|
2532
2542
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2533
|
-
var
|
|
2543
|
+
var KdsInvoiceMerchant = (0, import_react44.forwardRef)(
|
|
2544
|
+
({ logoUrl, brandColor, className, style, ...props }, ref) => {
|
|
2545
|
+
const [failed, setFailed] = (0, import_react44.useState)(false);
|
|
2546
|
+
const showLogo = !!logoUrl && !failed;
|
|
2547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2548
|
+
"div",
|
|
2549
|
+
{
|
|
2550
|
+
ref,
|
|
2551
|
+
className: (0, import_clsx.clsx)("kds-invoice-merchant", className),
|
|
2552
|
+
"aria-hidden": "true",
|
|
2553
|
+
style: brandColor ? { background: brandColor, ...style } : style,
|
|
2554
|
+
...props,
|
|
2555
|
+
children: showLogo ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("img", { src: logoUrl, alt: "", onError: () => setFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", { className: "material-symbols-outlined", children: "storefront" })
|
|
2556
|
+
}
|
|
2557
|
+
);
|
|
2558
|
+
}
|
|
2559
|
+
);
|
|
2560
|
+
KdsInvoiceMerchant.displayName = "KdsInvoiceMerchant";
|
|
2561
|
+
|
|
2562
|
+
// src/components/domain/KdsPaymentTotal/KdsPaymentTotal.tsx
|
|
2563
|
+
var import_react45 = require("react");
|
|
2564
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2565
|
+
var KdsPaymentTotal = (0, import_react45.forwardRef)(
|
|
2534
2566
|
({
|
|
2535
2567
|
variant = "default",
|
|
2536
2568
|
tone = "brand",
|
|
@@ -2548,7 +2580,7 @@ var KdsPaymentTotal = (0, import_react44.forwardRef)(
|
|
|
2548
2580
|
const { integer, fraction } = formatAmount(amount, decimals, locale);
|
|
2549
2581
|
const isEmail = variant === "email";
|
|
2550
2582
|
const isInfoTone = tone === "info";
|
|
2551
|
-
return /* @__PURE__ */ (0,
|
|
2583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
2552
2584
|
"div",
|
|
2553
2585
|
{
|
|
2554
2586
|
ref,
|
|
@@ -2561,14 +2593,14 @@ var KdsPaymentTotal = (0, import_react44.forwardRef)(
|
|
|
2561
2593
|
),
|
|
2562
2594
|
...props,
|
|
2563
2595
|
children: [
|
|
2564
|
-
!isEmail && title != null && /* @__PURE__ */ (0,
|
|
2565
|
-
!isEmail && titleMobile != null && /* @__PURE__ */ (0,
|
|
2566
|
-
label != null && /* @__PURE__ */ (0,
|
|
2567
|
-
/* @__PURE__ */ (0,
|
|
2596
|
+
!isEmail && title != null && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h5", { className: "kds-payment-total-title", children: title }),
|
|
2597
|
+
!isEmail && titleMobile != null && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h5", { className: "kds-payment-total-title-mobile", children: titleMobile }),
|
|
2598
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h6", { className: "kds-payment-label", children: label }),
|
|
2599
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("h5", { className: "kds-payment-amount", children: [
|
|
2568
2600
|
currency,
|
|
2569
2601
|
" ",
|
|
2570
2602
|
integer,
|
|
2571
|
-
fraction !== null && /* @__PURE__ */ (0,
|
|
2603
|
+
fraction !== null && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("sup", { className: "kds-payment-total-decimal-sup", children: fraction })
|
|
2572
2604
|
] })
|
|
2573
2605
|
]
|
|
2574
2606
|
}
|
|
@@ -2604,10 +2636,10 @@ function formatAmount(amount, decimals, locale) {
|
|
|
2604
2636
|
}
|
|
2605
2637
|
|
|
2606
2638
|
// src/components/domain/KdsBillAttachment/KdsBillAttachment.tsx
|
|
2607
|
-
var
|
|
2608
|
-
var
|
|
2609
|
-
var KdsBillAttachment = (0,
|
|
2610
|
-
({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2639
|
+
var import_react46 = require("react");
|
|
2640
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2641
|
+
var KdsBillAttachment = (0, import_react46.forwardRef)(
|
|
2642
|
+
({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
2611
2643
|
"a",
|
|
2612
2644
|
{
|
|
2613
2645
|
ref,
|
|
@@ -2617,25 +2649,25 @@ var KdsBillAttachment = (0, import_react45.forwardRef)(
|
|
|
2617
2649
|
className: (0, import_clsx.clsx)("kds-bill-attachment", className),
|
|
2618
2650
|
...props,
|
|
2619
2651
|
children: [
|
|
2620
|
-
/* @__PURE__ */ (0,
|
|
2621
|
-
/* @__PURE__ */ (0,
|
|
2652
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("i", { className: "material-symbols-outlined", children: icon }),
|
|
2653
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: filename })
|
|
2622
2654
|
]
|
|
2623
2655
|
}
|
|
2624
2656
|
)
|
|
2625
2657
|
);
|
|
2626
2658
|
KdsBillAttachment.displayName = "KdsBillAttachment";
|
|
2627
|
-
var KdsBillAttachments = (0,
|
|
2628
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2659
|
+
var KdsBillAttachments = (0, import_react46.forwardRef)(
|
|
2660
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { ref, className: (0, import_clsx.clsx)("kds-bill-attachments", className), ...props, children })
|
|
2629
2661
|
);
|
|
2630
2662
|
KdsBillAttachments.displayName = "KdsBillAttachments";
|
|
2631
2663
|
|
|
2632
2664
|
// src/components/core/hooks/useStickyInvoiceCollapse.ts
|
|
2633
|
-
var
|
|
2665
|
+
var import_react47 = require("react");
|
|
2634
2666
|
function useStickyInvoiceCollapse(options = {}) {
|
|
2635
2667
|
const { onCollapseStart, collapseEnd = 20, mobileBreakpoint = 768 } = options;
|
|
2636
|
-
const onCollapseStartRef = (0,
|
|
2668
|
+
const onCollapseStartRef = (0, import_react47.useRef)(onCollapseStart);
|
|
2637
2669
|
onCollapseStartRef.current = onCollapseStart;
|
|
2638
|
-
(0,
|
|
2670
|
+
(0, import_react47.useEffect)(() => {
|
|
2639
2671
|
let viewportOffset = 0;
|
|
2640
2672
|
let ticking = false;
|
|
2641
2673
|
let wasCollapsing = false;
|
|
@@ -2705,6 +2737,45 @@ function useStickyInvoiceCollapse(options = {}) {
|
|
|
2705
2737
|
};
|
|
2706
2738
|
}, [collapseEnd, mobileBreakpoint]);
|
|
2707
2739
|
}
|
|
2740
|
+
|
|
2741
|
+
// src/components/core/hooks/useExpandToggle.ts
|
|
2742
|
+
var import_react48 = require("react");
|
|
2743
|
+
function useExpandToggle(options = {}) {
|
|
2744
|
+
const { defaultOpen = false, open: controlledOpen, onOpenChange, id } = options;
|
|
2745
|
+
const generatedId = (0, import_react48.useId)();
|
|
2746
|
+
const panelId = id ?? `kds-expand-${generatedId}`;
|
|
2747
|
+
const isControlled = controlledOpen !== void 0;
|
|
2748
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react48.useState)(defaultOpen);
|
|
2749
|
+
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
2750
|
+
const setOpen = (0, import_react48.useCallback)(
|
|
2751
|
+
(next) => {
|
|
2752
|
+
if (!isControlled) {
|
|
2753
|
+
setUncontrolledOpen(next);
|
|
2754
|
+
}
|
|
2755
|
+
onOpenChange?.(next);
|
|
2756
|
+
},
|
|
2757
|
+
[isControlled, onOpenChange]
|
|
2758
|
+
);
|
|
2759
|
+
const toggle = (0, import_react48.useCallback)(() => setOpen(!open), [open, setOpen]);
|
|
2760
|
+
const getToggleProps = (0, import_react48.useCallback)(
|
|
2761
|
+
() => ({
|
|
2762
|
+
type: "button",
|
|
2763
|
+
"aria-expanded": open,
|
|
2764
|
+
"aria-controls": panelId,
|
|
2765
|
+
onClick: () => toggle()
|
|
2766
|
+
}),
|
|
2767
|
+
[open, panelId, toggle]
|
|
2768
|
+
);
|
|
2769
|
+
const getPanelProps = (0, import_react48.useCallback)(
|
|
2770
|
+
(baseClassName = "kds-expand-panel") => ({
|
|
2771
|
+
id: panelId,
|
|
2772
|
+
className: open ? `${baseClassName} open` : baseClassName,
|
|
2773
|
+
hidden: !open
|
|
2774
|
+
}),
|
|
2775
|
+
[open, panelId]
|
|
2776
|
+
);
|
|
2777
|
+
return { open, setOpen, toggle, getToggleProps, getPanelProps };
|
|
2778
|
+
}
|
|
2708
2779
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2709
2780
|
0 && (module.exports = {
|
|
2710
2781
|
KdsAccordion,
|
|
@@ -2732,6 +2803,7 @@ function useStickyInvoiceCollapse(options = {}) {
|
|
|
2732
2803
|
KdsCountdown,
|
|
2733
2804
|
KdsDivider,
|
|
2734
2805
|
KdsExpandPanel,
|
|
2806
|
+
KdsInvoiceMerchant,
|
|
2735
2807
|
KdsInvoiceSticky,
|
|
2736
2808
|
KdsLinearProgress,
|
|
2737
2809
|
KdsMerchantTile,
|
|
@@ -2779,6 +2851,7 @@ function useStickyInvoiceCollapse(options = {}) {
|
|
|
2779
2851
|
useAutoHide,
|
|
2780
2852
|
useCopyToClipboard,
|
|
2781
2853
|
useCountdown,
|
|
2854
|
+
useExpandToggle,
|
|
2782
2855
|
useStickyInvoiceCollapse,
|
|
2783
2856
|
useTabsKeyboard,
|
|
2784
2857
|
zIndex
|
package/dist/index.mjs
CHANGED
|
@@ -2263,7 +2263,15 @@ KdsCardPlan.displayName = "KdsCardPlan";
|
|
|
2263
2263
|
import { forwardRef as forwardRef33 } from "react";
|
|
2264
2264
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2265
2265
|
var KdsInvoiceSticky = forwardRef33(
|
|
2266
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
2266
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
2267
|
+
"article",
|
|
2268
|
+
{
|
|
2269
|
+
ref,
|
|
2270
|
+
className: clsx("kds-card-elevated", "kds-invoice-sticky", className),
|
|
2271
|
+
...props,
|
|
2272
|
+
children
|
|
2273
|
+
}
|
|
2274
|
+
)
|
|
2267
2275
|
);
|
|
2268
2276
|
KdsInvoiceSticky.displayName = "KdsInvoiceSticky";
|
|
2269
2277
|
|
|
@@ -2417,10 +2425,32 @@ var KdsMerchantTile = forwardRef39(
|
|
|
2417
2425
|
);
|
|
2418
2426
|
KdsMerchantTile.displayName = "KdsMerchantTile";
|
|
2419
2427
|
|
|
2428
|
+
// src/components/domain/KdsInvoiceMerchant/KdsInvoiceMerchant.tsx
|
|
2429
|
+
import { forwardRef as forwardRef40, useState as useState8 } from "react";
|
|
2430
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2431
|
+
var KdsInvoiceMerchant = forwardRef40(
|
|
2432
|
+
({ logoUrl, brandColor, className, style, ...props }, ref) => {
|
|
2433
|
+
const [failed, setFailed] = useState8(false);
|
|
2434
|
+
const showLogo = !!logoUrl && !failed;
|
|
2435
|
+
return /* @__PURE__ */ jsx42(
|
|
2436
|
+
"div",
|
|
2437
|
+
{
|
|
2438
|
+
ref,
|
|
2439
|
+
className: clsx("kds-invoice-merchant", className),
|
|
2440
|
+
"aria-hidden": "true",
|
|
2441
|
+
style: brandColor ? { background: brandColor, ...style } : style,
|
|
2442
|
+
...props,
|
|
2443
|
+
children: showLogo ? /* @__PURE__ */ jsx42("img", { src: logoUrl, alt: "", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx42("i", { className: "material-symbols-outlined", children: "storefront" })
|
|
2444
|
+
}
|
|
2445
|
+
);
|
|
2446
|
+
}
|
|
2447
|
+
);
|
|
2448
|
+
KdsInvoiceMerchant.displayName = "KdsInvoiceMerchant";
|
|
2449
|
+
|
|
2420
2450
|
// src/components/domain/KdsPaymentTotal/KdsPaymentTotal.tsx
|
|
2421
|
-
import { forwardRef as
|
|
2422
|
-
import { jsx as
|
|
2423
|
-
var KdsPaymentTotal =
|
|
2451
|
+
import { forwardRef as forwardRef41 } from "react";
|
|
2452
|
+
import { jsx as jsx43, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2453
|
+
var KdsPaymentTotal = forwardRef41(
|
|
2424
2454
|
({
|
|
2425
2455
|
variant = "default",
|
|
2426
2456
|
tone = "brand",
|
|
@@ -2451,14 +2481,14 @@ var KdsPaymentTotal = forwardRef40(
|
|
|
2451
2481
|
),
|
|
2452
2482
|
...props,
|
|
2453
2483
|
children: [
|
|
2454
|
-
!isEmail && title != null && /* @__PURE__ */
|
|
2455
|
-
!isEmail && titleMobile != null && /* @__PURE__ */
|
|
2456
|
-
label != null && /* @__PURE__ */
|
|
2484
|
+
!isEmail && title != null && /* @__PURE__ */ jsx43("h5", { className: "kds-payment-total-title", children: title }),
|
|
2485
|
+
!isEmail && titleMobile != null && /* @__PURE__ */ jsx43("h5", { className: "kds-payment-total-title-mobile", children: titleMobile }),
|
|
2486
|
+
label != null && /* @__PURE__ */ jsx43("h6", { className: "kds-payment-label", children: label }),
|
|
2457
2487
|
/* @__PURE__ */ jsxs32("h5", { className: "kds-payment-amount", children: [
|
|
2458
2488
|
currency,
|
|
2459
2489
|
" ",
|
|
2460
2490
|
integer,
|
|
2461
|
-
fraction !== null && /* @__PURE__ */
|
|
2491
|
+
fraction !== null && /* @__PURE__ */ jsx43("sup", { className: "kds-payment-total-decimal-sup", children: fraction })
|
|
2462
2492
|
] })
|
|
2463
2493
|
]
|
|
2464
2494
|
}
|
|
@@ -2494,9 +2524,9 @@ function formatAmount(amount, decimals, locale) {
|
|
|
2494
2524
|
}
|
|
2495
2525
|
|
|
2496
2526
|
// src/components/domain/KdsBillAttachment/KdsBillAttachment.tsx
|
|
2497
|
-
import { forwardRef as
|
|
2498
|
-
import { jsx as
|
|
2499
|
-
var KdsBillAttachment =
|
|
2527
|
+
import { forwardRef as forwardRef42 } from "react";
|
|
2528
|
+
import { jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2529
|
+
var KdsBillAttachment = forwardRef42(
|
|
2500
2530
|
({ filename, href, icon = "attach_file", className, ...props }, ref) => /* @__PURE__ */ jsxs33(
|
|
2501
2531
|
"a",
|
|
2502
2532
|
{
|
|
@@ -2507,15 +2537,15 @@ var KdsBillAttachment = forwardRef41(
|
|
|
2507
2537
|
className: clsx("kds-bill-attachment", className),
|
|
2508
2538
|
...props,
|
|
2509
2539
|
children: [
|
|
2510
|
-
/* @__PURE__ */
|
|
2511
|
-
/* @__PURE__ */
|
|
2540
|
+
/* @__PURE__ */ jsx44("i", { className: "material-symbols-outlined", children: icon }),
|
|
2541
|
+
/* @__PURE__ */ jsx44("span", { children: filename })
|
|
2512
2542
|
]
|
|
2513
2543
|
}
|
|
2514
2544
|
)
|
|
2515
2545
|
);
|
|
2516
2546
|
KdsBillAttachment.displayName = "KdsBillAttachment";
|
|
2517
|
-
var KdsBillAttachments =
|
|
2518
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2547
|
+
var KdsBillAttachments = forwardRef42(
|
|
2548
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx44("div", { ref, className: clsx("kds-bill-attachments", className), ...props, children })
|
|
2519
2549
|
);
|
|
2520
2550
|
KdsBillAttachments.displayName = "KdsBillAttachments";
|
|
2521
2551
|
|
|
@@ -2595,6 +2625,45 @@ function useStickyInvoiceCollapse(options = {}) {
|
|
|
2595
2625
|
};
|
|
2596
2626
|
}, [collapseEnd, mobileBreakpoint]);
|
|
2597
2627
|
}
|
|
2628
|
+
|
|
2629
|
+
// src/components/core/hooks/useExpandToggle.ts
|
|
2630
|
+
import { useCallback as useCallback4, useId, useState as useState9 } from "react";
|
|
2631
|
+
function useExpandToggle(options = {}) {
|
|
2632
|
+
const { defaultOpen = false, open: controlledOpen, onOpenChange, id } = options;
|
|
2633
|
+
const generatedId = useId();
|
|
2634
|
+
const panelId = id ?? `kds-expand-${generatedId}`;
|
|
2635
|
+
const isControlled = controlledOpen !== void 0;
|
|
2636
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState9(defaultOpen);
|
|
2637
|
+
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
2638
|
+
const setOpen = useCallback4(
|
|
2639
|
+
(next) => {
|
|
2640
|
+
if (!isControlled) {
|
|
2641
|
+
setUncontrolledOpen(next);
|
|
2642
|
+
}
|
|
2643
|
+
onOpenChange?.(next);
|
|
2644
|
+
},
|
|
2645
|
+
[isControlled, onOpenChange]
|
|
2646
|
+
);
|
|
2647
|
+
const toggle = useCallback4(() => setOpen(!open), [open, setOpen]);
|
|
2648
|
+
const getToggleProps = useCallback4(
|
|
2649
|
+
() => ({
|
|
2650
|
+
type: "button",
|
|
2651
|
+
"aria-expanded": open,
|
|
2652
|
+
"aria-controls": panelId,
|
|
2653
|
+
onClick: () => toggle()
|
|
2654
|
+
}),
|
|
2655
|
+
[open, panelId, toggle]
|
|
2656
|
+
);
|
|
2657
|
+
const getPanelProps = useCallback4(
|
|
2658
|
+
(baseClassName = "kds-expand-panel") => ({
|
|
2659
|
+
id: panelId,
|
|
2660
|
+
className: open ? `${baseClassName} open` : baseClassName,
|
|
2661
|
+
hidden: !open
|
|
2662
|
+
}),
|
|
2663
|
+
[open, panelId]
|
|
2664
|
+
);
|
|
2665
|
+
return { open, setOpen, toggle, getToggleProps, getPanelProps };
|
|
2666
|
+
}
|
|
2598
2667
|
export {
|
|
2599
2668
|
KdsAccordion,
|
|
2600
2669
|
KdsAccordionDetails,
|
|
@@ -2621,6 +2690,7 @@ export {
|
|
|
2621
2690
|
KdsCountdown,
|
|
2622
2691
|
KdsDivider,
|
|
2623
2692
|
KdsExpandPanel,
|
|
2693
|
+
KdsInvoiceMerchant,
|
|
2624
2694
|
KdsInvoiceSticky,
|
|
2625
2695
|
KdsLinearProgress,
|
|
2626
2696
|
KdsMerchantTile,
|
|
@@ -2668,6 +2738,7 @@ export {
|
|
|
2668
2738
|
useAutoHide,
|
|
2669
2739
|
useCopyToClipboard,
|
|
2670
2740
|
useCountdown,
|
|
2741
|
+
useExpandToggle,
|
|
2671
2742
|
useStickyInvoiceCollapse,
|
|
2672
2743
|
useTabsKeyboard,
|
|
2673
2744
|
zIndex
|
package/package.json
CHANGED