@khipu/design-system 0.2.0-alpha.134 → 0.2.0-alpha.136
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 +13 -11
- package/dist/beercss/khipu-beercss.min.css +1 -1
- package/dist/beercss/khipu-beercss.scoped.css +13 -11
- package/dist/beercss/khipu-beercss.scoped.min.css +1 -1
- package/dist/beercss/metadata.json +5 -5
- package/dist/index.d.mts +42 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.js +102 -0
- package/dist/index.mjs +98 -0
- 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.136",
|
|
4
4
|
"description": "Khipu BeerCSS bundle with Material Design 3 and Khipu customizations",
|
|
5
|
-
"buildDate": "2026-07-
|
|
5
|
+
"buildDate": "2026-07-22T17:27:17.155Z",
|
|
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.136/dist/beercss/khipu-beercss.min.css",
|
|
23
|
+
"cssScoped": "https://cdn.jsdelivr.net/npm/@khipu/design-system@0.2.0-alpha.136/dist/beercss/khipu-beercss.scoped.min.css",
|
|
24
|
+
"js": "https://cdn.jsdelivr.net/npm/@khipu/design-system@0.2.0-alpha.136/dist/beercss/khipu-beercss.min.js"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -3750,6 +3750,47 @@ interface KdsBillAttachmentsProps extends React__default.HTMLAttributes<HTMLDivE
|
|
|
3750
3750
|
*/
|
|
3751
3751
|
declare const KdsBillAttachments: React__default.ForwardRefExoticComponent<KdsBillAttachmentsProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3752
3752
|
|
|
3753
|
+
/**
|
|
3754
|
+
* Corre el callback cuando termina el gesto de puntero en curso (fin del click),
|
|
3755
|
+
* o tras un fallback corto si el gesto no era de puntero (Tab del teclado).
|
|
3756
|
+
*
|
|
3757
|
+
* Por qué: el blur de un campo llega en el mousedown, pero el click sobre el
|
|
3758
|
+
* elemento destino (p.ej. el checkbox de términos) recién se completa en el
|
|
3759
|
+
* mouseup EN LAS MISMAS COORDENADAS. Cualquier cambio de layout o robo de foco
|
|
3760
|
+
* entre medio (mostrar un error bajo el campo, enfocar otro elemento) desplaza
|
|
3761
|
+
* el destino y el click se pierde. Anclar el efecto al fin del click garantiza
|
|
3762
|
+
* el orden: gesto completo → onChange/re-render → efecto.
|
|
3763
|
+
*/
|
|
3764
|
+
declare const runAfterPointerGesture: (callback: () => void) => void;
|
|
3765
|
+
|
|
3766
|
+
/**
|
|
3767
|
+
* Scroll + focus al primer campo inválido de un formulario.
|
|
3768
|
+
*
|
|
3769
|
+
* El scroll se aplica sobre el ancestro scrolleable real del campo (en la app el
|
|
3770
|
+
* scroller es el body con height:100vh, no el window). El centrado usa la porción
|
|
3771
|
+
* visible: con el teclado virtual abierto visualViewport se achica (el layout
|
|
3772
|
+
* viewport no), así que centrar contra él deja el campo visible sobre el teclado.
|
|
3773
|
+
* Además se re-centra una vez cuando el viewport cambia (apertura del teclado
|
|
3774
|
+
* gatillada por el propio focus).
|
|
3775
|
+
*/
|
|
3776
|
+
declare const centerFieldInViewport: (field: HTMLElement) => void;
|
|
3777
|
+
declare const focusFirstInvalidField: (form: HTMLFormElement) => void;
|
|
3778
|
+
/**
|
|
3779
|
+
* Trigger en el blur de los campos: el submit vive deshabilitado hasta que el form
|
|
3780
|
+
* valida, así que la guía al primer campo con error debe correr al perder el foco
|
|
3781
|
+
* (p.ej. al marcar el checkbox de términos con un campo vacío).
|
|
3782
|
+
*
|
|
3783
|
+
* La guía NO puede correr con un timer fijo: el blur llega en el mousedown y el
|
|
3784
|
+
* toggle del checkbox recién en el click (mouseup) — si el gesto dura más que el
|
|
3785
|
+
* timer, robar el foco a mitad de gesto deja el checkbox sin marcar. Por eso se
|
|
3786
|
+
* ancla al fin del click que causó el blur (más un tick para que corran onChange
|
|
3787
|
+
* y el re-render), con fallback por timer para blur de teclado (Tab).
|
|
3788
|
+
*
|
|
3789
|
+
* Guard anti-trampa: si el foco pasó a OTRO campo de texto del form (el usuario va
|
|
3790
|
+
* a escribir ahí), no se le roba el foco.
|
|
3791
|
+
*/
|
|
3792
|
+
declare const guideToFirstInvalidFieldOnBlur: (form: HTMLFormElement) => void;
|
|
3793
|
+
|
|
3753
3794
|
declare function useCopyToClipboard(resetMs?: number): {
|
|
3754
3795
|
copied: boolean;
|
|
3755
3796
|
copy: (text: string) => Promise<void>;
|
|
@@ -3969,4 +4010,4 @@ declare function formatDate(iso?: string): string;
|
|
|
3969
4010
|
*/
|
|
3970
4011
|
declare function formatTime(iso?: string): string;
|
|
3971
4012
|
|
|
3972
|
-
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, LIGHT_LOGO_LUMINANCE_THRESHOLD, type LogoBackdrop, 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, formatDate, formatDateTime, formatTime, getContrastColor, letterSpacings, lighten, lineHeights, measureLogoLuminance, pickLogoBackdrop, semanticSpacing, shadows, spacing, tokens, tokensByMode, transitions, typography, useAutoHide, useCopyToClipboard, useCountdown, useExpandToggle, useHideOnScroll, useLogoBackdrop, useMediaQuery, useStickyInvoiceCollapse, useTabsKeyboard, zIndex };
|
|
4013
|
+
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, LIGHT_LOGO_LUMINANCE_THRESHOLD, type LogoBackdrop, type ThemeMode, type Tokens, type TokensByMode, type Typography as TypographyTokens, type UseExpandToggleOptions, type UseExpandToggleResult, type UseHideOnScrollOptions, type UseHideOnScrollResult, type UseStickyInvoiceCollapseOptions, borderRadius, breakpoints, centerFieldInViewport, colors, colorsByMode, focusFirstInvalidField, fontFamilies, fontSizes, fontWeights, formatDate, formatDateTime, formatTime, getContrastColor, guideToFirstInvalidFieldOnBlur, letterSpacings, lighten, lineHeights, measureLogoLuminance, pickLogoBackdrop, runAfterPointerGesture, semanticSpacing, shadows, spacing, tokens, tokensByMode, transitions, typography, useAutoHide, useCopyToClipboard, useCountdown, useExpandToggle, useHideOnScroll, useLogoBackdrop, useMediaQuery, useStickyInvoiceCollapse, useTabsKeyboard, zIndex };
|
package/dist/index.d.ts
CHANGED
|
@@ -3750,6 +3750,47 @@ interface KdsBillAttachmentsProps extends React__default.HTMLAttributes<HTMLDivE
|
|
|
3750
3750
|
*/
|
|
3751
3751
|
declare const KdsBillAttachments: React__default.ForwardRefExoticComponent<KdsBillAttachmentsProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3752
3752
|
|
|
3753
|
+
/**
|
|
3754
|
+
* Corre el callback cuando termina el gesto de puntero en curso (fin del click),
|
|
3755
|
+
* o tras un fallback corto si el gesto no era de puntero (Tab del teclado).
|
|
3756
|
+
*
|
|
3757
|
+
* Por qué: el blur de un campo llega en el mousedown, pero el click sobre el
|
|
3758
|
+
* elemento destino (p.ej. el checkbox de términos) recién se completa en el
|
|
3759
|
+
* mouseup EN LAS MISMAS COORDENADAS. Cualquier cambio de layout o robo de foco
|
|
3760
|
+
* entre medio (mostrar un error bajo el campo, enfocar otro elemento) desplaza
|
|
3761
|
+
* el destino y el click se pierde. Anclar el efecto al fin del click garantiza
|
|
3762
|
+
* el orden: gesto completo → onChange/re-render → efecto.
|
|
3763
|
+
*/
|
|
3764
|
+
declare const runAfterPointerGesture: (callback: () => void) => void;
|
|
3765
|
+
|
|
3766
|
+
/**
|
|
3767
|
+
* Scroll + focus al primer campo inválido de un formulario.
|
|
3768
|
+
*
|
|
3769
|
+
* El scroll se aplica sobre el ancestro scrolleable real del campo (en la app el
|
|
3770
|
+
* scroller es el body con height:100vh, no el window). El centrado usa la porción
|
|
3771
|
+
* visible: con el teclado virtual abierto visualViewport se achica (el layout
|
|
3772
|
+
* viewport no), así que centrar contra él deja el campo visible sobre el teclado.
|
|
3773
|
+
* Además se re-centra una vez cuando el viewport cambia (apertura del teclado
|
|
3774
|
+
* gatillada por el propio focus).
|
|
3775
|
+
*/
|
|
3776
|
+
declare const centerFieldInViewport: (field: HTMLElement) => void;
|
|
3777
|
+
declare const focusFirstInvalidField: (form: HTMLFormElement) => void;
|
|
3778
|
+
/**
|
|
3779
|
+
* Trigger en el blur de los campos: el submit vive deshabilitado hasta que el form
|
|
3780
|
+
* valida, así que la guía al primer campo con error debe correr al perder el foco
|
|
3781
|
+
* (p.ej. al marcar el checkbox de términos con un campo vacío).
|
|
3782
|
+
*
|
|
3783
|
+
* La guía NO puede correr con un timer fijo: el blur llega en el mousedown y el
|
|
3784
|
+
* toggle del checkbox recién en el click (mouseup) — si el gesto dura más que el
|
|
3785
|
+
* timer, robar el foco a mitad de gesto deja el checkbox sin marcar. Por eso se
|
|
3786
|
+
* ancla al fin del click que causó el blur (más un tick para que corran onChange
|
|
3787
|
+
* y el re-render), con fallback por timer para blur de teclado (Tab).
|
|
3788
|
+
*
|
|
3789
|
+
* Guard anti-trampa: si el foco pasó a OTRO campo de texto del form (el usuario va
|
|
3790
|
+
* a escribir ahí), no se le roba el foco.
|
|
3791
|
+
*/
|
|
3792
|
+
declare const guideToFirstInvalidFieldOnBlur: (form: HTMLFormElement) => void;
|
|
3793
|
+
|
|
3753
3794
|
declare function useCopyToClipboard(resetMs?: number): {
|
|
3754
3795
|
copied: boolean;
|
|
3755
3796
|
copy: (text: string) => Promise<void>;
|
|
@@ -3969,4 +4010,4 @@ declare function formatDate(iso?: string): string;
|
|
|
3969
4010
|
*/
|
|
3970
4011
|
declare function formatTime(iso?: string): string;
|
|
3971
4012
|
|
|
3972
|
-
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, LIGHT_LOGO_LUMINANCE_THRESHOLD, type LogoBackdrop, 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, formatDate, formatDateTime, formatTime, getContrastColor, letterSpacings, lighten, lineHeights, measureLogoLuminance, pickLogoBackdrop, semanticSpacing, shadows, spacing, tokens, tokensByMode, transitions, typography, useAutoHide, useCopyToClipboard, useCountdown, useExpandToggle, useHideOnScroll, useLogoBackdrop, useMediaQuery, useStickyInvoiceCollapse, useTabsKeyboard, zIndex };
|
|
4013
|
+
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, LIGHT_LOGO_LUMINANCE_THRESHOLD, type LogoBackdrop, type ThemeMode, type Tokens, type TokensByMode, type Typography as TypographyTokens, type UseExpandToggleOptions, type UseExpandToggleResult, type UseHideOnScrollOptions, type UseHideOnScrollResult, type UseStickyInvoiceCollapseOptions, borderRadius, breakpoints, centerFieldInViewport, colors, colorsByMode, focusFirstInvalidField, fontFamilies, fontSizes, fontWeights, formatDate, formatDateTime, formatTime, getContrastColor, guideToFirstInvalidFieldOnBlur, letterSpacings, lighten, lineHeights, measureLogoLuminance, pickLogoBackdrop, runAfterPointerGesture, semanticSpacing, shadows, spacing, tokens, tokensByMode, transitions, typography, useAutoHide, useCopyToClipboard, useCountdown, useExpandToggle, useHideOnScroll, useLogoBackdrop, useMediaQuery, useStickyInvoiceCollapse, useTabsKeyboard, zIndex };
|
package/dist/index.js
CHANGED
|
@@ -85,9 +85,11 @@ __export(index_exports, {
|
|
|
85
85
|
LIGHT_LOGO_LUMINANCE_THRESHOLD: () => LIGHT_LOGO_LUMINANCE_THRESHOLD,
|
|
86
86
|
borderRadius: () => borderRadius,
|
|
87
87
|
breakpoints: () => breakpoints,
|
|
88
|
+
centerFieldInViewport: () => centerFieldInViewport,
|
|
88
89
|
clsx: () => import_clsx.clsx,
|
|
89
90
|
colors: () => colors,
|
|
90
91
|
colorsByMode: () => colorsByMode,
|
|
92
|
+
focusFirstInvalidField: () => focusFirstInvalidField,
|
|
91
93
|
fontFamilies: () => fontFamilies,
|
|
92
94
|
fontSizes: () => fontSizes,
|
|
93
95
|
fontWeights: () => fontWeights,
|
|
@@ -95,11 +97,13 @@ __export(index_exports, {
|
|
|
95
97
|
formatDateTime: () => formatDateTime,
|
|
96
98
|
formatTime: () => formatTime,
|
|
97
99
|
getContrastColor: () => getContrastColor,
|
|
100
|
+
guideToFirstInvalidFieldOnBlur: () => guideToFirstInvalidFieldOnBlur,
|
|
98
101
|
letterSpacings: () => letterSpacings,
|
|
99
102
|
lighten: () => lighten,
|
|
100
103
|
lineHeights: () => lineHeights,
|
|
101
104
|
measureLogoLuminance: () => measureLogoLuminance,
|
|
102
105
|
pickLogoBackdrop: () => pickLogoBackdrop,
|
|
106
|
+
runAfterPointerGesture: () => runAfterPointerGesture,
|
|
103
107
|
semanticSpacing: () => semanticSpacing,
|
|
104
108
|
shadows: () => shadows,
|
|
105
109
|
spacing: () => spacing,
|
|
@@ -2820,6 +2824,100 @@ var KdsBillAttachments = (0, import_react48.forwardRef)(
|
|
|
2820
2824
|
);
|
|
2821
2825
|
KdsBillAttachments.displayName = "KdsBillAttachments";
|
|
2822
2826
|
|
|
2827
|
+
// src/utils/runAfterPointerGesture.ts
|
|
2828
|
+
var KEYBOARD_FALLBACK_MS = 400;
|
|
2829
|
+
var runAfterPointerGesture = (callback) => {
|
|
2830
|
+
let done = false;
|
|
2831
|
+
const run = () => {
|
|
2832
|
+
if (done) {
|
|
2833
|
+
return;
|
|
2834
|
+
}
|
|
2835
|
+
done = true;
|
|
2836
|
+
document.removeEventListener("click", run, true);
|
|
2837
|
+
window.setTimeout(callback, 0);
|
|
2838
|
+
};
|
|
2839
|
+
document.addEventListener("click", run, true);
|
|
2840
|
+
window.setTimeout(run, KEYBOARD_FALLBACK_MS);
|
|
2841
|
+
};
|
|
2842
|
+
|
|
2843
|
+
// src/utils/focusFirstInvalidField.ts
|
|
2844
|
+
var RECENTER_WINDOW_MS = 1500;
|
|
2845
|
+
var getScrollParent = (field) => {
|
|
2846
|
+
let node = field.parentElement;
|
|
2847
|
+
while (node) {
|
|
2848
|
+
const style = getComputedStyle(node);
|
|
2849
|
+
if (node.scrollHeight > node.clientHeight && /auto|scroll|overlay/.test(style.overflowY)) {
|
|
2850
|
+
const htmlOverflow = getComputedStyle(document.documentElement).overflowY;
|
|
2851
|
+
if (node === document.body && (htmlOverflow === "visible" || htmlOverflow === "")) {
|
|
2852
|
+
return null;
|
|
2853
|
+
}
|
|
2854
|
+
return node;
|
|
2855
|
+
}
|
|
2856
|
+
node = node.parentElement;
|
|
2857
|
+
}
|
|
2858
|
+
return null;
|
|
2859
|
+
};
|
|
2860
|
+
var centerFieldInViewport = (field) => {
|
|
2861
|
+
const viewport = window.visualViewport;
|
|
2862
|
+
const viewportTop = viewport?.offsetTop ?? 0;
|
|
2863
|
+
const viewportHeight = viewport?.height ?? window.innerHeight;
|
|
2864
|
+
const rect = field.getBoundingClientRect();
|
|
2865
|
+
const scroller = getScrollParent(field);
|
|
2866
|
+
if (!scroller || scroller === document.documentElement || scroller === document.scrollingElement) {
|
|
2867
|
+
const top = window.scrollY + rect.top - viewportTop - (viewportHeight - rect.height) / 2;
|
|
2868
|
+
window.scrollTo({ top: Math.max(top, 0), behavior: "smooth" });
|
|
2869
|
+
return;
|
|
2870
|
+
}
|
|
2871
|
+
const scrollerRect = scroller.getBoundingClientRect();
|
|
2872
|
+
const visibleTop = Math.max(scrollerRect.top, viewportTop);
|
|
2873
|
+
const visibleBottom = Math.min(scrollerRect.bottom, viewportTop + viewportHeight);
|
|
2874
|
+
const visibleHeight = Math.max(visibleBottom - visibleTop, 0);
|
|
2875
|
+
const target = scroller.scrollTop + (rect.top - visibleTop) - (visibleHeight - rect.height) / 2;
|
|
2876
|
+
scroller.scrollTo({ top: Math.max(target, 0), behavior: "smooth" });
|
|
2877
|
+
};
|
|
2878
|
+
var isInvalidField = (element) => {
|
|
2879
|
+
const field = element;
|
|
2880
|
+
return typeof field.willValidate === "boolean" && field.willValidate && !field.validity.valid;
|
|
2881
|
+
};
|
|
2882
|
+
var focusFirstInvalidField = (form) => {
|
|
2883
|
+
const firstInvalid = Array.from(form.elements).find(isInvalidField);
|
|
2884
|
+
if (!firstInvalid) {
|
|
2885
|
+
return;
|
|
2886
|
+
}
|
|
2887
|
+
firstInvalid.focus({ preventScroll: true });
|
|
2888
|
+
centerFieldInViewport(firstInvalid);
|
|
2889
|
+
const viewport = window.visualViewport;
|
|
2890
|
+
if (viewport) {
|
|
2891
|
+
const recenter = () => centerFieldInViewport(firstInvalid);
|
|
2892
|
+
viewport.addEventListener("resize", recenter, { once: true });
|
|
2893
|
+
window.setTimeout(() => viewport.removeEventListener("resize", recenter), RECENTER_WINDOW_MS);
|
|
2894
|
+
}
|
|
2895
|
+
};
|
|
2896
|
+
var isTextEntryElement = (element) => {
|
|
2897
|
+
if (!element) {
|
|
2898
|
+
return false;
|
|
2899
|
+
}
|
|
2900
|
+
if (element.tagName === "TEXTAREA") {
|
|
2901
|
+
return true;
|
|
2902
|
+
}
|
|
2903
|
+
const input = element;
|
|
2904
|
+
return element.tagName === "INPUT" && !["checkbox", "radio", "button", "submit", "reset"].includes(input.type);
|
|
2905
|
+
};
|
|
2906
|
+
var guideToFirstInvalidFieldOnBlur = (form) => {
|
|
2907
|
+
runAfterPointerGesture(() => {
|
|
2908
|
+
if (!form.isConnected) {
|
|
2909
|
+
return;
|
|
2910
|
+
}
|
|
2911
|
+
const active = document.activeElement;
|
|
2912
|
+
if (active && form.contains(active) && isTextEntryElement(active)) {
|
|
2913
|
+
return;
|
|
2914
|
+
}
|
|
2915
|
+
if (!form.checkValidity()) {
|
|
2916
|
+
focusFirstInvalidField(form);
|
|
2917
|
+
}
|
|
2918
|
+
});
|
|
2919
|
+
};
|
|
2920
|
+
|
|
2823
2921
|
// src/components/core/hooks/useStickyInvoiceCollapse.ts
|
|
2824
2922
|
var import_react49 = require("react");
|
|
2825
2923
|
function useStickyInvoiceCollapse(options = {}) {
|
|
@@ -3067,9 +3165,11 @@ function useMediaQuery(query) {
|
|
|
3067
3165
|
LIGHT_LOGO_LUMINANCE_THRESHOLD,
|
|
3068
3166
|
borderRadius,
|
|
3069
3167
|
breakpoints,
|
|
3168
|
+
centerFieldInViewport,
|
|
3070
3169
|
clsx,
|
|
3071
3170
|
colors,
|
|
3072
3171
|
colorsByMode,
|
|
3172
|
+
focusFirstInvalidField,
|
|
3073
3173
|
fontFamilies,
|
|
3074
3174
|
fontSizes,
|
|
3075
3175
|
fontWeights,
|
|
@@ -3077,11 +3177,13 @@ function useMediaQuery(query) {
|
|
|
3077
3177
|
formatDateTime,
|
|
3078
3178
|
formatTime,
|
|
3079
3179
|
getContrastColor,
|
|
3180
|
+
guideToFirstInvalidFieldOnBlur,
|
|
3080
3181
|
letterSpacings,
|
|
3081
3182
|
lighten,
|
|
3082
3183
|
lineHeights,
|
|
3083
3184
|
measureLogoLuminance,
|
|
3084
3185
|
pickLogoBackdrop,
|
|
3186
|
+
runAfterPointerGesture,
|
|
3085
3187
|
semanticSpacing,
|
|
3086
3188
|
shadows,
|
|
3087
3189
|
spacing,
|
package/dist/index.mjs
CHANGED
|
@@ -2698,6 +2698,100 @@ var KdsBillAttachments = forwardRef43(
|
|
|
2698
2698
|
);
|
|
2699
2699
|
KdsBillAttachments.displayName = "KdsBillAttachments";
|
|
2700
2700
|
|
|
2701
|
+
// src/utils/runAfterPointerGesture.ts
|
|
2702
|
+
var KEYBOARD_FALLBACK_MS = 400;
|
|
2703
|
+
var runAfterPointerGesture = (callback) => {
|
|
2704
|
+
let done = false;
|
|
2705
|
+
const run = () => {
|
|
2706
|
+
if (done) {
|
|
2707
|
+
return;
|
|
2708
|
+
}
|
|
2709
|
+
done = true;
|
|
2710
|
+
document.removeEventListener("click", run, true);
|
|
2711
|
+
window.setTimeout(callback, 0);
|
|
2712
|
+
};
|
|
2713
|
+
document.addEventListener("click", run, true);
|
|
2714
|
+
window.setTimeout(run, KEYBOARD_FALLBACK_MS);
|
|
2715
|
+
};
|
|
2716
|
+
|
|
2717
|
+
// src/utils/focusFirstInvalidField.ts
|
|
2718
|
+
var RECENTER_WINDOW_MS = 1500;
|
|
2719
|
+
var getScrollParent = (field) => {
|
|
2720
|
+
let node = field.parentElement;
|
|
2721
|
+
while (node) {
|
|
2722
|
+
const style = getComputedStyle(node);
|
|
2723
|
+
if (node.scrollHeight > node.clientHeight && /auto|scroll|overlay/.test(style.overflowY)) {
|
|
2724
|
+
const htmlOverflow = getComputedStyle(document.documentElement).overflowY;
|
|
2725
|
+
if (node === document.body && (htmlOverflow === "visible" || htmlOverflow === "")) {
|
|
2726
|
+
return null;
|
|
2727
|
+
}
|
|
2728
|
+
return node;
|
|
2729
|
+
}
|
|
2730
|
+
node = node.parentElement;
|
|
2731
|
+
}
|
|
2732
|
+
return null;
|
|
2733
|
+
};
|
|
2734
|
+
var centerFieldInViewport = (field) => {
|
|
2735
|
+
const viewport = window.visualViewport;
|
|
2736
|
+
const viewportTop = viewport?.offsetTop ?? 0;
|
|
2737
|
+
const viewportHeight = viewport?.height ?? window.innerHeight;
|
|
2738
|
+
const rect = field.getBoundingClientRect();
|
|
2739
|
+
const scroller = getScrollParent(field);
|
|
2740
|
+
if (!scroller || scroller === document.documentElement || scroller === document.scrollingElement) {
|
|
2741
|
+
const top = window.scrollY + rect.top - viewportTop - (viewportHeight - rect.height) / 2;
|
|
2742
|
+
window.scrollTo({ top: Math.max(top, 0), behavior: "smooth" });
|
|
2743
|
+
return;
|
|
2744
|
+
}
|
|
2745
|
+
const scrollerRect = scroller.getBoundingClientRect();
|
|
2746
|
+
const visibleTop = Math.max(scrollerRect.top, viewportTop);
|
|
2747
|
+
const visibleBottom = Math.min(scrollerRect.bottom, viewportTop + viewportHeight);
|
|
2748
|
+
const visibleHeight = Math.max(visibleBottom - visibleTop, 0);
|
|
2749
|
+
const target = scroller.scrollTop + (rect.top - visibleTop) - (visibleHeight - rect.height) / 2;
|
|
2750
|
+
scroller.scrollTo({ top: Math.max(target, 0), behavior: "smooth" });
|
|
2751
|
+
};
|
|
2752
|
+
var isInvalidField = (element) => {
|
|
2753
|
+
const field = element;
|
|
2754
|
+
return typeof field.willValidate === "boolean" && field.willValidate && !field.validity.valid;
|
|
2755
|
+
};
|
|
2756
|
+
var focusFirstInvalidField = (form) => {
|
|
2757
|
+
const firstInvalid = Array.from(form.elements).find(isInvalidField);
|
|
2758
|
+
if (!firstInvalid) {
|
|
2759
|
+
return;
|
|
2760
|
+
}
|
|
2761
|
+
firstInvalid.focus({ preventScroll: true });
|
|
2762
|
+
centerFieldInViewport(firstInvalid);
|
|
2763
|
+
const viewport = window.visualViewport;
|
|
2764
|
+
if (viewport) {
|
|
2765
|
+
const recenter = () => centerFieldInViewport(firstInvalid);
|
|
2766
|
+
viewport.addEventListener("resize", recenter, { once: true });
|
|
2767
|
+
window.setTimeout(() => viewport.removeEventListener("resize", recenter), RECENTER_WINDOW_MS);
|
|
2768
|
+
}
|
|
2769
|
+
};
|
|
2770
|
+
var isTextEntryElement = (element) => {
|
|
2771
|
+
if (!element) {
|
|
2772
|
+
return false;
|
|
2773
|
+
}
|
|
2774
|
+
if (element.tagName === "TEXTAREA") {
|
|
2775
|
+
return true;
|
|
2776
|
+
}
|
|
2777
|
+
const input = element;
|
|
2778
|
+
return element.tagName === "INPUT" && !["checkbox", "radio", "button", "submit", "reset"].includes(input.type);
|
|
2779
|
+
};
|
|
2780
|
+
var guideToFirstInvalidFieldOnBlur = (form) => {
|
|
2781
|
+
runAfterPointerGesture(() => {
|
|
2782
|
+
if (!form.isConnected) {
|
|
2783
|
+
return;
|
|
2784
|
+
}
|
|
2785
|
+
const active = document.activeElement;
|
|
2786
|
+
if (active && form.contains(active) && isTextEntryElement(active)) {
|
|
2787
|
+
return;
|
|
2788
|
+
}
|
|
2789
|
+
if (!form.checkValidity()) {
|
|
2790
|
+
focusFirstInvalidField(form);
|
|
2791
|
+
}
|
|
2792
|
+
});
|
|
2793
|
+
};
|
|
2794
|
+
|
|
2701
2795
|
// src/components/core/hooks/useStickyInvoiceCollapse.ts
|
|
2702
2796
|
import { useEffect as useEffect5, useRef as useRef4 } from "react";
|
|
2703
2797
|
function useStickyInvoiceCollapse(options = {}) {
|
|
@@ -2944,9 +3038,11 @@ export {
|
|
|
2944
3038
|
LIGHT_LOGO_LUMINANCE_THRESHOLD,
|
|
2945
3039
|
borderRadius,
|
|
2946
3040
|
breakpoints,
|
|
3041
|
+
centerFieldInViewport,
|
|
2947
3042
|
clsx,
|
|
2948
3043
|
colors,
|
|
2949
3044
|
colorsByMode,
|
|
3045
|
+
focusFirstInvalidField,
|
|
2950
3046
|
fontFamilies,
|
|
2951
3047
|
fontSizes,
|
|
2952
3048
|
fontWeights,
|
|
@@ -2954,11 +3050,13 @@ export {
|
|
|
2954
3050
|
formatDateTime,
|
|
2955
3051
|
formatTime,
|
|
2956
3052
|
getContrastColor,
|
|
3053
|
+
guideToFirstInvalidFieldOnBlur,
|
|
2957
3054
|
letterSpacings,
|
|
2958
3055
|
lighten,
|
|
2959
3056
|
lineHeights,
|
|
2960
3057
|
measureLogoLuminance,
|
|
2961
3058
|
pickLogoBackdrop,
|
|
3059
|
+
runAfterPointerGesture,
|
|
2962
3060
|
semanticSpacing,
|
|
2963
3061
|
shadows,
|
|
2964
3062
|
spacing,
|
package/package.json
CHANGED