@yenio-pld/blocks 1.2.0-rc.16 → 1.2.0-rc.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +203 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -4
- package/dist/index.d.ts +47 -4
- package/dist/index.js +198 -5
- package/dist/index.js.map +1 -1
- package/dist/ui/button.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -198,6 +198,10 @@ type DataTableProps<T> = {
|
|
|
198
198
|
toolbar?: ReactNode;
|
|
199
199
|
emptyTitle: string;
|
|
200
200
|
emptyDescription?: string;
|
|
201
|
+
emptyIllustration?: {
|
|
202
|
+
src: string;
|
|
203
|
+
alt?: string;
|
|
204
|
+
};
|
|
201
205
|
loading?: boolean;
|
|
202
206
|
skeletonRows?: number;
|
|
203
207
|
/** Omit when there is no next page. Keep it mounted, with `pending`, while a page appends. */
|
|
@@ -209,7 +213,7 @@ type DataTableProps<T> = {
|
|
|
209
213
|
label?: string;
|
|
210
214
|
className?: string;
|
|
211
215
|
};
|
|
212
|
-
declare function DataTable<T>({ columns, rows, rowKey, toolbar, emptyTitle, emptyDescription, loading, skeletonRows, loadMore, label, className, }: DataTableProps<T>): react.JSX.Element;
|
|
216
|
+
declare function DataTable<T>({ columns, rows, rowKey, toolbar, emptyTitle, emptyDescription, emptyIllustration, loading, skeletonRows, loadMore, label, className, }: DataTableProps<T>): react.JSX.Element;
|
|
213
217
|
|
|
214
218
|
/**
|
|
215
219
|
* Ignore navigation-start signals for the rest of this turn. An in-flight
|
|
@@ -290,15 +294,30 @@ type EmptyStateIcon = react.ComponentType<{
|
|
|
290
294
|
className?: string;
|
|
291
295
|
"aria-hidden"?: boolean | "true" | "false";
|
|
292
296
|
}>;
|
|
297
|
+
type EmptyStateIllustration = {
|
|
298
|
+
src: string;
|
|
299
|
+
alt?: string;
|
|
300
|
+
};
|
|
293
301
|
type EmptyStateProps = {
|
|
294
302
|
title: string;
|
|
295
303
|
description?: string;
|
|
296
304
|
action?: react.ReactNode;
|
|
297
305
|
icon?: EmptyStateIcon;
|
|
306
|
+
illustration?: EmptyStateIllustration;
|
|
298
307
|
variant?: "default" | "compact";
|
|
299
308
|
className?: string;
|
|
300
309
|
};
|
|
301
|
-
declare function EmptyState({ title, description, action, icon: Icon, variant, className, }: EmptyStateProps): react.JSX.Element;
|
|
310
|
+
declare function EmptyState({ title, description, action, icon: Icon, illustration, variant, className, }: EmptyStateProps): react.JSX.Element;
|
|
311
|
+
|
|
312
|
+
type ProductIllustrationProps = {
|
|
313
|
+
src: string;
|
|
314
|
+
/** Decorative product art: default empty alt. */
|
|
315
|
+
alt?: string;
|
|
316
|
+
className?: string;
|
|
317
|
+
size?: "sm" | "md" | "lg";
|
|
318
|
+
};
|
|
319
|
+
/** Transparent PNG product illustration sized for empty states and intro panels. */
|
|
320
|
+
declare function ProductIllustration({ src, alt, className, size, }: ProductIllustrationProps): react.JSX.Element;
|
|
302
321
|
|
|
303
322
|
declare function Empty({ className, ...props }: react.ComponentProps<"div">): react.JSX.Element;
|
|
304
323
|
declare function EmptyHeader({ className, ...props }: react.ComponentProps<"div">): react.JSX.Element;
|
|
@@ -853,6 +872,30 @@ type PhoneInputProps = Omit<react.ComponentProps<"input">, "value" | "onChange"
|
|
|
853
872
|
};
|
|
854
873
|
declare function PhoneInput({ value, onValueChange, defaultCountry, searchPlaceholder, countryListLabel, countryTriggerLabel, emptyLabel, className, disabled, id, name, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, placeholder, ...props }: PhoneInputProps): react.JSX.Element;
|
|
855
874
|
|
|
875
|
+
type MoneyCurrency = "MXN" | "USD";
|
|
876
|
+
/** Format integer minor units for display (major units with currency symbol). */
|
|
877
|
+
declare function formatMoney(valueMinor: number | null, currency: MoneyCurrency, locale?: string): string;
|
|
878
|
+
/** Cents-first: append a digit (0–9) to minor units. */
|
|
879
|
+
declare function appendMoneyDigit(valueMinor: number | null, digit: number): number | null;
|
|
880
|
+
/** Cents-first: remove the least significant digit. */
|
|
881
|
+
declare function backspaceMoneyMinor(valueMinor: number | null): number | null;
|
|
882
|
+
/** Parse a pasted or typed major-unit decimal into minor units. */
|
|
883
|
+
declare function parseMoneyToMinor(raw: string): number | null;
|
|
884
|
+
|
|
885
|
+
type MoneyInputProps = Omit<react.ComponentProps<"input">, "value" | "onChange" | "type" | "inputMode" | "defaultValue" | "size"> & {
|
|
886
|
+
valueMinor: number | null;
|
|
887
|
+
onValueMinorChange: (valueMinor: number | null) => void;
|
|
888
|
+
currency?: MoneyCurrency;
|
|
889
|
+
currencies?: MoneyCurrency[];
|
|
890
|
+
showCurrencySwitch?: boolean;
|
|
891
|
+
onCurrencyChange?: (currency: MoneyCurrency) => void;
|
|
892
|
+
locale?: string;
|
|
893
|
+
moneySize?: "default" | "large";
|
|
894
|
+
mxnLabel?: string;
|
|
895
|
+
usdLabel?: string;
|
|
896
|
+
};
|
|
897
|
+
declare function MoneyInput({ valueMinor, onValueMinorChange, currency, currencies, showCurrencySwitch, onCurrencyChange, locale, moneySize, mxnLabel, usdLabel, className, disabled, id, name, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, placeholder, ...props }: MoneyInputProps): react.JSX.Element;
|
|
898
|
+
|
|
856
899
|
type AvatarEditorLabels = {
|
|
857
900
|
uploadAria?: string;
|
|
858
901
|
uploadHint?: string;
|
|
@@ -1344,7 +1387,7 @@ declare function queueRowKeyDown(event: KeyboardEvent, onOpen: () => void): void
|
|
|
1344
1387
|
type SectionCardTone = "default" | "danger";
|
|
1345
1388
|
type SectionCardProps = {
|
|
1346
1389
|
id: string;
|
|
1347
|
-
title:
|
|
1390
|
+
title: ReactNode;
|
|
1348
1391
|
description?: string;
|
|
1349
1392
|
badge?: ReactNode;
|
|
1350
1393
|
headerAction?: ReactNode;
|
|
@@ -1534,4 +1577,4 @@ declare function sourceUrlIsHttps(url: string): boolean;
|
|
|
1534
1577
|
declare function matchClaimIsUnverified(hit: MatchReviewHit): boolean;
|
|
1535
1578
|
declare function MatchReview({ hit, onResolve, labels, sourceLabels, emptyAction, className, }: MatchReviewProps): react.JSX.Element;
|
|
1536
1579
|
|
|
1537
|
-
export { AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AppNavGroup, type AppNavItem, AppShell, type AppShellProps, type AuditActor, type AuditSubject, AuditTimeline, type AuditTimelineItem, type AuditTimelineLabels, type AuditTimelineProps, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorLabels, type AvatarEditorProps, type BlocksLanguage, COUNTRY_OPTIONS, CURP_REGEX, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ControlKind, CookieConsentBanner, type CookieConsentBannerLabels, type CookieConsentBannerProps, CookieConsentValue, CostBreakdownCard, type CostBreakdownCardProps, type CostBreakdownItem, type CountryLocale, type CountryOption, CountryPicker, type CountryPickerItem, type CountryPickerLabels, type CountryPickerProps, type CountryPickerPurpose, type CountryRecord, type CreateMultipartUploadControllerOptions, CurpInput, type CurpInputProps, type CurpValidationError, DATA_TABLE_BODY_MIN_CLASS, DATA_TABLE_DEFAULT_SKELETON_ROWS, DATA_TABLE_ROW_CLASS, DEFAULT_AUDIT_TIMELINE_LABELS, DEFAULT_COOKIE_CONSENT_BANNER_LABELS, DEFAULT_EDITABLE_SECTION_LABELS, DEFAULT_ENTITY_GRAPH_LABELS, DEFAULT_FILE_DROPZONE_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILE_UPLOAD_TRAY_LABELS, DEFAULT_LEGAL_ACCEPT_CHECKBOX_LABELS, DEFAULT_LEGAL_ACCEPT_DIALOG_LABELS, DEFAULT_MATCH_REVIEW_LABELS, DEFAULT_NOTIFICATION_BELL_LABELS, DEFAULT_RISK_BADGE_LABELS, DashboardSkeleton, type DashboardSkeletonVariant, DataList, DataListItem, type DataListItemProps, type DataListProps, DataTable, type DataTableColumn, type DataTableProps, DataTableSkeleton, type DetailFact, DetailHeader, type DetailHeaderProps, DetailPageSkeleton, type DimensionBreakdownRow, DimensionBreakdownTable, type DimensionBreakdownTableProps, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, EntityGraph, type EntityGraphEdge, type EntityGraphLabels, type EntityGraphNode, type EntityGraphProps, ErrorState, Field, FieldMessage, type FieldMessageProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, FileUploadMenu, type FileUploadMenuProps, FileUploadTray, type FileUploadTrayLabels, type FileUploadTrayProps, FormCardSkeleton, FormSection, type FormSectionProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LegalAcceptCheckbox, type LegalAcceptCheckboxLabels, type LegalAcceptCheckboxProps, LegalAcceptDialog, type LegalAcceptDialogLabels, type LegalAcceptDialogProps, LegalMarkdown, type LegalMarkdownProps, ListSkeleton, LoadingState, MatchReview, type MatchReviewHit, type MatchReviewLabels, type MatchReviewProps, type MatchReviewSource, type MatchReviewStatus, MetricChartCard, type MetricChartCardProps, MetricEmptyState, type MetricEmptyStateProps, MetricSkeleton, type MetricSkeletonProps, type MultipartUploadAdapter, type MultipartUploadController, type MultipartUploadPart, type NavTab, NavTabs, type NavTabsProps, NavigationProgress, type NavigationProgressProps, NotificationBell, type NotificationBellItem, type NotificationBellLabels, type NotificationBellProps, OptionRow, type OptionRowProps, PageContainer, PageTitle, type PageTitleProps, PageTitleSkeleton, PaginatedCombobox, type PaginatedComboboxItem, type PaginatedComboboxLabels, type PaginatedComboboxProps, type PartRange, PasswordInput, type PasswordInputProps, type PersonKindForRfc, PhoneInput, type PhoneInputProps, QueueLayout, type QueueLayoutProps, RfcInput, type RfcInputProps, type RfcValidationError, RiskBadge, type RiskBadgeLabels, type RiskBadgeProps, type RiskSeverity, RouteLoading, SAT_TAX_REGIME_CODES, SafeImage, type SafeImageProps, SearchablePicker, type SearchablePickerOption, type SearchablePickerProps, SectionCard, type SectionCardProps, type SectionCardTone, SectionNav, type SectionNavItem, SectionNavList, type SectionNavListProps, type SectionNavProps, SectionSummary, type SectionSummaryProps, SettingRow, type SettingRowProps, type ShellIcon, type ShellLinkProps, type ShellLinkRenderer, SparklineStat, type SparklineStatProps, StatHighlightCard, type StatHighlightCardProps, StatusBadge, type StatusBadgeProps, type StatusTone, StepProgress, type StepProgressProps, type StepProgressSegment, StickyActionBar, type StickyActionBarProps, TAX_REGIME_OPTIONS, TIME_RANGE_OPTIONS, TableSkeleton, type TaxRegimeLocale, type TaxRegimeOption, TaxRegimePicker, type TaxRegimePickerItem, type TaxRegimePickerLabels, type TaxRegimePickerProps, type TaxRegimeRecord, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type TimeRange, TimeRangePicker, type TimeRangePickerLabels, type TimeRangePickerProps, type UploadControllerStatus, type UploadJob, type UploadJobStatus, type UploadProgress, type UseEditableSectionOptions, type UseEditableSectionResult, type UseQueueKeysOptions, type UseSectionNavResult, WizardLayout, type WizardLayoutProps, cn, countryLabel, countryPickerItems, createMultipartUploadController, curpCheckDigit, dataTableBodyMinClass, defaultLanguages, fileMatchesAccept, filterCountries, filterTaxRegimes, formatCountryOptionLabel, formatTaxRegimeOptionLabel, isKnownCountryCode, isKnownTaxRegimeCode, matchClaimIsUnverified, normalizeCurpInput, normalizeRfc, partRanges, progressFromBytes, queueRowKeyDown, renderShellLink, rfcMaxLengthForPersonKind, signalNavigationStart, sourceUrlIsHttps, suppressNavigationProgress, taxRegimeLabel, taxRegimePickerItems, useDirtyGuard, useEditableSection, useLanguageContext, useMediaQuery, useQueueKeys, useSectionNav, validateCurp, validateRfcForPersonKind };
|
|
1580
|
+
export { AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AppNavGroup, type AppNavItem, AppShell, type AppShellProps, type AuditActor, type AuditSubject, AuditTimeline, type AuditTimelineItem, type AuditTimelineLabels, type AuditTimelineProps, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorLabels, type AvatarEditorProps, type BlocksLanguage, COUNTRY_OPTIONS, CURP_REGEX, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ControlKind, CookieConsentBanner, type CookieConsentBannerLabels, type CookieConsentBannerProps, CookieConsentValue, CostBreakdownCard, type CostBreakdownCardProps, type CostBreakdownItem, type CountryLocale, type CountryOption, CountryPicker, type CountryPickerItem, type CountryPickerLabels, type CountryPickerProps, type CountryPickerPurpose, type CountryRecord, type CreateMultipartUploadControllerOptions, CurpInput, type CurpInputProps, type CurpValidationError, DATA_TABLE_BODY_MIN_CLASS, DATA_TABLE_DEFAULT_SKELETON_ROWS, DATA_TABLE_ROW_CLASS, DEFAULT_AUDIT_TIMELINE_LABELS, DEFAULT_COOKIE_CONSENT_BANNER_LABELS, DEFAULT_EDITABLE_SECTION_LABELS, DEFAULT_ENTITY_GRAPH_LABELS, DEFAULT_FILE_DROPZONE_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILE_UPLOAD_TRAY_LABELS, DEFAULT_LEGAL_ACCEPT_CHECKBOX_LABELS, DEFAULT_LEGAL_ACCEPT_DIALOG_LABELS, DEFAULT_MATCH_REVIEW_LABELS, DEFAULT_NOTIFICATION_BELL_LABELS, DEFAULT_RISK_BADGE_LABELS, DashboardSkeleton, type DashboardSkeletonVariant, DataList, DataListItem, type DataListItemProps, type DataListProps, DataTable, type DataTableColumn, type DataTableProps, DataTableSkeleton, type DetailFact, DetailHeader, type DetailHeaderProps, DetailPageSkeleton, type DimensionBreakdownRow, DimensionBreakdownTable, type DimensionBreakdownTableProps, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateIllustration, type EmptyStateProps, EmptyTitle, EntityGraph, type EntityGraphEdge, type EntityGraphLabels, type EntityGraphNode, type EntityGraphProps, ErrorState, Field, FieldMessage, type FieldMessageProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, FileUploadMenu, type FileUploadMenuProps, FileUploadTray, type FileUploadTrayLabels, type FileUploadTrayProps, FormCardSkeleton, FormSection, type FormSectionProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LegalAcceptCheckbox, type LegalAcceptCheckboxLabels, type LegalAcceptCheckboxProps, LegalAcceptDialog, type LegalAcceptDialogLabels, type LegalAcceptDialogProps, LegalMarkdown, type LegalMarkdownProps, ListSkeleton, LoadingState, MatchReview, type MatchReviewHit, type MatchReviewLabels, type MatchReviewProps, type MatchReviewSource, type MatchReviewStatus, MetricChartCard, type MetricChartCardProps, MetricEmptyState, type MetricEmptyStateProps, MetricSkeleton, type MetricSkeletonProps, type MoneyCurrency, MoneyInput, type MoneyInputProps, type MultipartUploadAdapter, type MultipartUploadController, type MultipartUploadPart, type NavTab, NavTabs, type NavTabsProps, NavigationProgress, type NavigationProgressProps, NotificationBell, type NotificationBellItem, type NotificationBellLabels, type NotificationBellProps, OptionRow, type OptionRowProps, PageContainer, PageTitle, type PageTitleProps, PageTitleSkeleton, PaginatedCombobox, type PaginatedComboboxItem, type PaginatedComboboxLabels, type PaginatedComboboxProps, type PartRange, PasswordInput, type PasswordInputProps, type PersonKindForRfc, PhoneInput, type PhoneInputProps, ProductIllustration, type ProductIllustrationProps, QueueLayout, type QueueLayoutProps, RfcInput, type RfcInputProps, type RfcValidationError, RiskBadge, type RiskBadgeLabels, type RiskBadgeProps, type RiskSeverity, RouteLoading, SAT_TAX_REGIME_CODES, SafeImage, type SafeImageProps, SearchablePicker, type SearchablePickerOption, type SearchablePickerProps, SectionCard, type SectionCardProps, type SectionCardTone, SectionNav, type SectionNavItem, SectionNavList, type SectionNavListProps, type SectionNavProps, SectionSummary, type SectionSummaryProps, SettingRow, type SettingRowProps, type ShellIcon, type ShellLinkProps, type ShellLinkRenderer, SparklineStat, type SparklineStatProps, StatHighlightCard, type StatHighlightCardProps, StatusBadge, type StatusBadgeProps, type StatusTone, StepProgress, type StepProgressProps, type StepProgressSegment, StickyActionBar, type StickyActionBarProps, TAX_REGIME_OPTIONS, TIME_RANGE_OPTIONS, TableSkeleton, type TaxRegimeLocale, type TaxRegimeOption, TaxRegimePicker, type TaxRegimePickerItem, type TaxRegimePickerLabels, type TaxRegimePickerProps, type TaxRegimeRecord, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type TimeRange, TimeRangePicker, type TimeRangePickerLabels, type TimeRangePickerProps, type UploadControllerStatus, type UploadJob, type UploadJobStatus, type UploadProgress, type UseEditableSectionOptions, type UseEditableSectionResult, type UseQueueKeysOptions, type UseSectionNavResult, WizardLayout, type WizardLayoutProps, appendMoneyDigit, backspaceMoneyMinor, cn, countryLabel, countryPickerItems, createMultipartUploadController, curpCheckDigit, dataTableBodyMinClass, defaultLanguages, fileMatchesAccept, filterCountries, filterTaxRegimes, formatCountryOptionLabel, formatMoney, formatTaxRegimeOptionLabel, isKnownCountryCode, isKnownTaxRegimeCode, matchClaimIsUnverified, normalizeCurpInput, normalizeRfc, parseMoneyToMinor, partRanges, progressFromBytes, queueRowKeyDown, renderShellLink, rfcMaxLengthForPersonKind, signalNavigationStart, sourceUrlIsHttps, suppressNavigationProgress, taxRegimeLabel, taxRegimePickerItems, useDirtyGuard, useEditableSection, useLanguageContext, useMediaQuery, useQueueKeys, useSectionNav, validateCurp, validateRfcForPersonKind };
|
package/dist/index.d.ts
CHANGED
|
@@ -198,6 +198,10 @@ type DataTableProps<T> = {
|
|
|
198
198
|
toolbar?: ReactNode;
|
|
199
199
|
emptyTitle: string;
|
|
200
200
|
emptyDescription?: string;
|
|
201
|
+
emptyIllustration?: {
|
|
202
|
+
src: string;
|
|
203
|
+
alt?: string;
|
|
204
|
+
};
|
|
201
205
|
loading?: boolean;
|
|
202
206
|
skeletonRows?: number;
|
|
203
207
|
/** Omit when there is no next page. Keep it mounted, with `pending`, while a page appends. */
|
|
@@ -209,7 +213,7 @@ type DataTableProps<T> = {
|
|
|
209
213
|
label?: string;
|
|
210
214
|
className?: string;
|
|
211
215
|
};
|
|
212
|
-
declare function DataTable<T>({ columns, rows, rowKey, toolbar, emptyTitle, emptyDescription, loading, skeletonRows, loadMore, label, className, }: DataTableProps<T>): react.JSX.Element;
|
|
216
|
+
declare function DataTable<T>({ columns, rows, rowKey, toolbar, emptyTitle, emptyDescription, emptyIllustration, loading, skeletonRows, loadMore, label, className, }: DataTableProps<T>): react.JSX.Element;
|
|
213
217
|
|
|
214
218
|
/**
|
|
215
219
|
* Ignore navigation-start signals for the rest of this turn. An in-flight
|
|
@@ -290,15 +294,30 @@ type EmptyStateIcon = react.ComponentType<{
|
|
|
290
294
|
className?: string;
|
|
291
295
|
"aria-hidden"?: boolean | "true" | "false";
|
|
292
296
|
}>;
|
|
297
|
+
type EmptyStateIllustration = {
|
|
298
|
+
src: string;
|
|
299
|
+
alt?: string;
|
|
300
|
+
};
|
|
293
301
|
type EmptyStateProps = {
|
|
294
302
|
title: string;
|
|
295
303
|
description?: string;
|
|
296
304
|
action?: react.ReactNode;
|
|
297
305
|
icon?: EmptyStateIcon;
|
|
306
|
+
illustration?: EmptyStateIllustration;
|
|
298
307
|
variant?: "default" | "compact";
|
|
299
308
|
className?: string;
|
|
300
309
|
};
|
|
301
|
-
declare function EmptyState({ title, description, action, icon: Icon, variant, className, }: EmptyStateProps): react.JSX.Element;
|
|
310
|
+
declare function EmptyState({ title, description, action, icon: Icon, illustration, variant, className, }: EmptyStateProps): react.JSX.Element;
|
|
311
|
+
|
|
312
|
+
type ProductIllustrationProps = {
|
|
313
|
+
src: string;
|
|
314
|
+
/** Decorative product art: default empty alt. */
|
|
315
|
+
alt?: string;
|
|
316
|
+
className?: string;
|
|
317
|
+
size?: "sm" | "md" | "lg";
|
|
318
|
+
};
|
|
319
|
+
/** Transparent PNG product illustration sized for empty states and intro panels. */
|
|
320
|
+
declare function ProductIllustration({ src, alt, className, size, }: ProductIllustrationProps): react.JSX.Element;
|
|
302
321
|
|
|
303
322
|
declare function Empty({ className, ...props }: react.ComponentProps<"div">): react.JSX.Element;
|
|
304
323
|
declare function EmptyHeader({ className, ...props }: react.ComponentProps<"div">): react.JSX.Element;
|
|
@@ -853,6 +872,30 @@ type PhoneInputProps = Omit<react.ComponentProps<"input">, "value" | "onChange"
|
|
|
853
872
|
};
|
|
854
873
|
declare function PhoneInput({ value, onValueChange, defaultCountry, searchPlaceholder, countryListLabel, countryTriggerLabel, emptyLabel, className, disabled, id, name, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, placeholder, ...props }: PhoneInputProps): react.JSX.Element;
|
|
855
874
|
|
|
875
|
+
type MoneyCurrency = "MXN" | "USD";
|
|
876
|
+
/** Format integer minor units for display (major units with currency symbol). */
|
|
877
|
+
declare function formatMoney(valueMinor: number | null, currency: MoneyCurrency, locale?: string): string;
|
|
878
|
+
/** Cents-first: append a digit (0–9) to minor units. */
|
|
879
|
+
declare function appendMoneyDigit(valueMinor: number | null, digit: number): number | null;
|
|
880
|
+
/** Cents-first: remove the least significant digit. */
|
|
881
|
+
declare function backspaceMoneyMinor(valueMinor: number | null): number | null;
|
|
882
|
+
/** Parse a pasted or typed major-unit decimal into minor units. */
|
|
883
|
+
declare function parseMoneyToMinor(raw: string): number | null;
|
|
884
|
+
|
|
885
|
+
type MoneyInputProps = Omit<react.ComponentProps<"input">, "value" | "onChange" | "type" | "inputMode" | "defaultValue" | "size"> & {
|
|
886
|
+
valueMinor: number | null;
|
|
887
|
+
onValueMinorChange: (valueMinor: number | null) => void;
|
|
888
|
+
currency?: MoneyCurrency;
|
|
889
|
+
currencies?: MoneyCurrency[];
|
|
890
|
+
showCurrencySwitch?: boolean;
|
|
891
|
+
onCurrencyChange?: (currency: MoneyCurrency) => void;
|
|
892
|
+
locale?: string;
|
|
893
|
+
moneySize?: "default" | "large";
|
|
894
|
+
mxnLabel?: string;
|
|
895
|
+
usdLabel?: string;
|
|
896
|
+
};
|
|
897
|
+
declare function MoneyInput({ valueMinor, onValueMinorChange, currency, currencies, showCurrencySwitch, onCurrencyChange, locale, moneySize, mxnLabel, usdLabel, className, disabled, id, name, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, placeholder, ...props }: MoneyInputProps): react.JSX.Element;
|
|
898
|
+
|
|
856
899
|
type AvatarEditorLabels = {
|
|
857
900
|
uploadAria?: string;
|
|
858
901
|
uploadHint?: string;
|
|
@@ -1344,7 +1387,7 @@ declare function queueRowKeyDown(event: KeyboardEvent, onOpen: () => void): void
|
|
|
1344
1387
|
type SectionCardTone = "default" | "danger";
|
|
1345
1388
|
type SectionCardProps = {
|
|
1346
1389
|
id: string;
|
|
1347
|
-
title:
|
|
1390
|
+
title: ReactNode;
|
|
1348
1391
|
description?: string;
|
|
1349
1392
|
badge?: ReactNode;
|
|
1350
1393
|
headerAction?: ReactNode;
|
|
@@ -1534,4 +1577,4 @@ declare function sourceUrlIsHttps(url: string): boolean;
|
|
|
1534
1577
|
declare function matchClaimIsUnverified(hit: MatchReviewHit): boolean;
|
|
1535
1578
|
declare function MatchReview({ hit, onResolve, labels, sourceLabels, emptyAction, className, }: MatchReviewProps): react.JSX.Element;
|
|
1536
1579
|
|
|
1537
|
-
export { AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AppNavGroup, type AppNavItem, AppShell, type AppShellProps, type AuditActor, type AuditSubject, AuditTimeline, type AuditTimelineItem, type AuditTimelineLabels, type AuditTimelineProps, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorLabels, type AvatarEditorProps, type BlocksLanguage, COUNTRY_OPTIONS, CURP_REGEX, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ControlKind, CookieConsentBanner, type CookieConsentBannerLabels, type CookieConsentBannerProps, CookieConsentValue, CostBreakdownCard, type CostBreakdownCardProps, type CostBreakdownItem, type CountryLocale, type CountryOption, CountryPicker, type CountryPickerItem, type CountryPickerLabels, type CountryPickerProps, type CountryPickerPurpose, type CountryRecord, type CreateMultipartUploadControllerOptions, CurpInput, type CurpInputProps, type CurpValidationError, DATA_TABLE_BODY_MIN_CLASS, DATA_TABLE_DEFAULT_SKELETON_ROWS, DATA_TABLE_ROW_CLASS, DEFAULT_AUDIT_TIMELINE_LABELS, DEFAULT_COOKIE_CONSENT_BANNER_LABELS, DEFAULT_EDITABLE_SECTION_LABELS, DEFAULT_ENTITY_GRAPH_LABELS, DEFAULT_FILE_DROPZONE_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILE_UPLOAD_TRAY_LABELS, DEFAULT_LEGAL_ACCEPT_CHECKBOX_LABELS, DEFAULT_LEGAL_ACCEPT_DIALOG_LABELS, DEFAULT_MATCH_REVIEW_LABELS, DEFAULT_NOTIFICATION_BELL_LABELS, DEFAULT_RISK_BADGE_LABELS, DashboardSkeleton, type DashboardSkeletonVariant, DataList, DataListItem, type DataListItemProps, type DataListProps, DataTable, type DataTableColumn, type DataTableProps, DataTableSkeleton, type DetailFact, DetailHeader, type DetailHeaderProps, DetailPageSkeleton, type DimensionBreakdownRow, DimensionBreakdownTable, type DimensionBreakdownTableProps, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, EntityGraph, type EntityGraphEdge, type EntityGraphLabels, type EntityGraphNode, type EntityGraphProps, ErrorState, Field, FieldMessage, type FieldMessageProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, FileUploadMenu, type FileUploadMenuProps, FileUploadTray, type FileUploadTrayLabels, type FileUploadTrayProps, FormCardSkeleton, FormSection, type FormSectionProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LegalAcceptCheckbox, type LegalAcceptCheckboxLabels, type LegalAcceptCheckboxProps, LegalAcceptDialog, type LegalAcceptDialogLabels, type LegalAcceptDialogProps, LegalMarkdown, type LegalMarkdownProps, ListSkeleton, LoadingState, MatchReview, type MatchReviewHit, type MatchReviewLabels, type MatchReviewProps, type MatchReviewSource, type MatchReviewStatus, MetricChartCard, type MetricChartCardProps, MetricEmptyState, type MetricEmptyStateProps, MetricSkeleton, type MetricSkeletonProps, type MultipartUploadAdapter, type MultipartUploadController, type MultipartUploadPart, type NavTab, NavTabs, type NavTabsProps, NavigationProgress, type NavigationProgressProps, NotificationBell, type NotificationBellItem, type NotificationBellLabels, type NotificationBellProps, OptionRow, type OptionRowProps, PageContainer, PageTitle, type PageTitleProps, PageTitleSkeleton, PaginatedCombobox, type PaginatedComboboxItem, type PaginatedComboboxLabels, type PaginatedComboboxProps, type PartRange, PasswordInput, type PasswordInputProps, type PersonKindForRfc, PhoneInput, type PhoneInputProps, QueueLayout, type QueueLayoutProps, RfcInput, type RfcInputProps, type RfcValidationError, RiskBadge, type RiskBadgeLabels, type RiskBadgeProps, type RiskSeverity, RouteLoading, SAT_TAX_REGIME_CODES, SafeImage, type SafeImageProps, SearchablePicker, type SearchablePickerOption, type SearchablePickerProps, SectionCard, type SectionCardProps, type SectionCardTone, SectionNav, type SectionNavItem, SectionNavList, type SectionNavListProps, type SectionNavProps, SectionSummary, type SectionSummaryProps, SettingRow, type SettingRowProps, type ShellIcon, type ShellLinkProps, type ShellLinkRenderer, SparklineStat, type SparklineStatProps, StatHighlightCard, type StatHighlightCardProps, StatusBadge, type StatusBadgeProps, type StatusTone, StepProgress, type StepProgressProps, type StepProgressSegment, StickyActionBar, type StickyActionBarProps, TAX_REGIME_OPTIONS, TIME_RANGE_OPTIONS, TableSkeleton, type TaxRegimeLocale, type TaxRegimeOption, TaxRegimePicker, type TaxRegimePickerItem, type TaxRegimePickerLabels, type TaxRegimePickerProps, type TaxRegimeRecord, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type TimeRange, TimeRangePicker, type TimeRangePickerLabels, type TimeRangePickerProps, type UploadControllerStatus, type UploadJob, type UploadJobStatus, type UploadProgress, type UseEditableSectionOptions, type UseEditableSectionResult, type UseQueueKeysOptions, type UseSectionNavResult, WizardLayout, type WizardLayoutProps, cn, countryLabel, countryPickerItems, createMultipartUploadController, curpCheckDigit, dataTableBodyMinClass, defaultLanguages, fileMatchesAccept, filterCountries, filterTaxRegimes, formatCountryOptionLabel, formatTaxRegimeOptionLabel, isKnownCountryCode, isKnownTaxRegimeCode, matchClaimIsUnverified, normalizeCurpInput, normalizeRfc, partRanges, progressFromBytes, queueRowKeyDown, renderShellLink, rfcMaxLengthForPersonKind, signalNavigationStart, sourceUrlIsHttps, suppressNavigationProgress, taxRegimeLabel, taxRegimePickerItems, useDirtyGuard, useEditableSection, useLanguageContext, useMediaQuery, useQueueKeys, useSectionNav, validateCurp, validateRfcForPersonKind };
|
|
1580
|
+
export { AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AppNavGroup, type AppNavItem, AppShell, type AppShellProps, type AuditActor, type AuditSubject, AuditTimeline, type AuditTimelineItem, type AuditTimelineLabels, type AuditTimelineProps, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorLabels, type AvatarEditorProps, type BlocksLanguage, COUNTRY_OPTIONS, CURP_REGEX, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ControlKind, CookieConsentBanner, type CookieConsentBannerLabels, type CookieConsentBannerProps, CookieConsentValue, CostBreakdownCard, type CostBreakdownCardProps, type CostBreakdownItem, type CountryLocale, type CountryOption, CountryPicker, type CountryPickerItem, type CountryPickerLabels, type CountryPickerProps, type CountryPickerPurpose, type CountryRecord, type CreateMultipartUploadControllerOptions, CurpInput, type CurpInputProps, type CurpValidationError, DATA_TABLE_BODY_MIN_CLASS, DATA_TABLE_DEFAULT_SKELETON_ROWS, DATA_TABLE_ROW_CLASS, DEFAULT_AUDIT_TIMELINE_LABELS, DEFAULT_COOKIE_CONSENT_BANNER_LABELS, DEFAULT_EDITABLE_SECTION_LABELS, DEFAULT_ENTITY_GRAPH_LABELS, DEFAULT_FILE_DROPZONE_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILE_UPLOAD_TRAY_LABELS, DEFAULT_LEGAL_ACCEPT_CHECKBOX_LABELS, DEFAULT_LEGAL_ACCEPT_DIALOG_LABELS, DEFAULT_MATCH_REVIEW_LABELS, DEFAULT_NOTIFICATION_BELL_LABELS, DEFAULT_RISK_BADGE_LABELS, DashboardSkeleton, type DashboardSkeletonVariant, DataList, DataListItem, type DataListItemProps, type DataListProps, DataTable, type DataTableColumn, type DataTableProps, DataTableSkeleton, type DetailFact, DetailHeader, type DetailHeaderProps, DetailPageSkeleton, type DimensionBreakdownRow, DimensionBreakdownTable, type DimensionBreakdownTableProps, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateIllustration, type EmptyStateProps, EmptyTitle, EntityGraph, type EntityGraphEdge, type EntityGraphLabels, type EntityGraphNode, type EntityGraphProps, ErrorState, Field, FieldMessage, type FieldMessageProps, FileDropzone, type FileDropzoneLabels, type FileDropzoneProps, FileUploadMenu, type FileUploadMenuProps, FileUploadTray, type FileUploadTrayLabels, type FileUploadTrayProps, FormCardSkeleton, FormSection, type FormSectionProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LegalAcceptCheckbox, type LegalAcceptCheckboxLabels, type LegalAcceptCheckboxProps, LegalAcceptDialog, type LegalAcceptDialogLabels, type LegalAcceptDialogProps, LegalMarkdown, type LegalMarkdownProps, ListSkeleton, LoadingState, MatchReview, type MatchReviewHit, type MatchReviewLabels, type MatchReviewProps, type MatchReviewSource, type MatchReviewStatus, MetricChartCard, type MetricChartCardProps, MetricEmptyState, type MetricEmptyStateProps, MetricSkeleton, type MetricSkeletonProps, type MoneyCurrency, MoneyInput, type MoneyInputProps, type MultipartUploadAdapter, type MultipartUploadController, type MultipartUploadPart, type NavTab, NavTabs, type NavTabsProps, NavigationProgress, type NavigationProgressProps, NotificationBell, type NotificationBellItem, type NotificationBellLabels, type NotificationBellProps, OptionRow, type OptionRowProps, PageContainer, PageTitle, type PageTitleProps, PageTitleSkeleton, PaginatedCombobox, type PaginatedComboboxItem, type PaginatedComboboxLabels, type PaginatedComboboxProps, type PartRange, PasswordInput, type PasswordInputProps, type PersonKindForRfc, PhoneInput, type PhoneInputProps, ProductIllustration, type ProductIllustrationProps, QueueLayout, type QueueLayoutProps, RfcInput, type RfcInputProps, type RfcValidationError, RiskBadge, type RiskBadgeLabels, type RiskBadgeProps, type RiskSeverity, RouteLoading, SAT_TAX_REGIME_CODES, SafeImage, type SafeImageProps, SearchablePicker, type SearchablePickerOption, type SearchablePickerProps, SectionCard, type SectionCardProps, type SectionCardTone, SectionNav, type SectionNavItem, SectionNavList, type SectionNavListProps, type SectionNavProps, SectionSummary, type SectionSummaryProps, SettingRow, type SettingRowProps, type ShellIcon, type ShellLinkProps, type ShellLinkRenderer, SparklineStat, type SparklineStatProps, StatHighlightCard, type StatHighlightCardProps, StatusBadge, type StatusBadgeProps, type StatusTone, StepProgress, type StepProgressProps, type StepProgressSegment, StickyActionBar, type StickyActionBarProps, TAX_REGIME_OPTIONS, TIME_RANGE_OPTIONS, TableSkeleton, type TaxRegimeLocale, type TaxRegimeOption, TaxRegimePicker, type TaxRegimePickerItem, type TaxRegimePickerLabels, type TaxRegimePickerProps, type TaxRegimeRecord, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type TimeRange, TimeRangePicker, type TimeRangePickerLabels, type TimeRangePickerProps, type UploadControllerStatus, type UploadJob, type UploadJobStatus, type UploadProgress, type UseEditableSectionOptions, type UseEditableSectionResult, type UseQueueKeysOptions, type UseSectionNavResult, WizardLayout, type WizardLayoutProps, appendMoneyDigit, backspaceMoneyMinor, cn, countryLabel, countryPickerItems, createMultipartUploadController, curpCheckDigit, dataTableBodyMinClass, defaultLanguages, fileMatchesAccept, filterCountries, filterTaxRegimes, formatCountryOptionLabel, formatMoney, formatTaxRegimeOptionLabel, isKnownCountryCode, isKnownTaxRegimeCode, matchClaimIsUnverified, normalizeCurpInput, normalizeRfc, parseMoneyToMinor, partRanges, progressFromBytes, queueRowKeyDown, renderShellLink, rfcMaxLengthForPersonKind, signalNavigationStart, sourceUrlIsHttps, suppressNavigationProgress, taxRegimeLabel, taxRegimePickerItems, useDirtyGuard, useEditableSection, useLanguageContext, useMediaQuery, useQueueKeys, useSectionNav, validateCurp, validateRfcForPersonKind };
|
package/dist/index.js
CHANGED
|
@@ -158,6 +158,32 @@ function avatarFallbackStyle(name) {
|
|
|
158
158
|
function cn(...inputs) {
|
|
159
159
|
return twMerge(clsx(inputs));
|
|
160
160
|
}
|
|
161
|
+
var SIZE_CLASS = {
|
|
162
|
+
sm: "max-w-[140px]",
|
|
163
|
+
md: "max-w-[220px]",
|
|
164
|
+
lg: "max-w-[280px]"
|
|
165
|
+
};
|
|
166
|
+
function ProductIllustration({
|
|
167
|
+
src,
|
|
168
|
+
alt = "",
|
|
169
|
+
className,
|
|
170
|
+
size = "md"
|
|
171
|
+
}) {
|
|
172
|
+
return /* @__PURE__ */ jsx(
|
|
173
|
+
"img",
|
|
174
|
+
{
|
|
175
|
+
src,
|
|
176
|
+
alt,
|
|
177
|
+
loading: "lazy",
|
|
178
|
+
decoding: "async",
|
|
179
|
+
className: cn(
|
|
180
|
+
"mx-auto h-auto w-full object-contain",
|
|
181
|
+
SIZE_CLASS[size],
|
|
182
|
+
className
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
161
187
|
function LoadingState({
|
|
162
188
|
label,
|
|
163
189
|
className
|
|
@@ -215,6 +241,7 @@ function EmptyState({
|
|
|
215
241
|
description,
|
|
216
242
|
action,
|
|
217
243
|
icon: Icon = Inbox,
|
|
244
|
+
illustration,
|
|
218
245
|
variant = "default",
|
|
219
246
|
className
|
|
220
247
|
}) {
|
|
@@ -229,7 +256,14 @@ function EmptyState({
|
|
|
229
256
|
),
|
|
230
257
|
children: [
|
|
231
258
|
/* @__PURE__ */ jsxs(EmptyHeader, { className: "gap-3", children: [
|
|
232
|
-
/* @__PURE__ */ jsx(
|
|
259
|
+
illustration ? /* @__PURE__ */ jsx(EmptyMedia, { variant: "default", className: "mb-0 w-full max-w-[240px]", children: /* @__PURE__ */ jsx(
|
|
260
|
+
ProductIllustration,
|
|
261
|
+
{
|
|
262
|
+
src: illustration.src,
|
|
263
|
+
alt: illustration.alt ?? "",
|
|
264
|
+
size: isCompact ? "sm" : "md"
|
|
265
|
+
}
|
|
266
|
+
) }) : /* @__PURE__ */ jsx(
|
|
233
267
|
EmptyMedia,
|
|
234
268
|
{
|
|
235
269
|
variant: "icon",
|
|
@@ -582,6 +616,7 @@ function DataTableBody({
|
|
|
582
616
|
rowKey,
|
|
583
617
|
emptyTitle,
|
|
584
618
|
emptyDescription,
|
|
619
|
+
emptyIllustration,
|
|
585
620
|
skeletonRows
|
|
586
621
|
}) {
|
|
587
622
|
switch (mode) {
|
|
@@ -600,7 +635,8 @@ function DataTableBody({
|
|
|
600
635
|
{
|
|
601
636
|
variant: "compact",
|
|
602
637
|
title: emptyTitle,
|
|
603
|
-
description: emptyDescription
|
|
638
|
+
description: emptyDescription,
|
|
639
|
+
illustration: emptyIllustration
|
|
604
640
|
}
|
|
605
641
|
) }) });
|
|
606
642
|
case "rows":
|
|
@@ -625,6 +661,7 @@ function DataTable({
|
|
|
625
661
|
toolbar,
|
|
626
662
|
emptyTitle,
|
|
627
663
|
emptyDescription,
|
|
664
|
+
emptyIllustration,
|
|
628
665
|
loading = false,
|
|
629
666
|
skeletonRows = DATA_TABLE_DEFAULT_SKELETON_ROWS,
|
|
630
667
|
loadMore,
|
|
@@ -646,6 +683,7 @@ function DataTable({
|
|
|
646
683
|
rowKey,
|
|
647
684
|
emptyTitle,
|
|
648
685
|
emptyDescription,
|
|
686
|
+
emptyIllustration,
|
|
649
687
|
skeletonRows
|
|
650
688
|
}
|
|
651
689
|
) })
|
|
@@ -4634,6 +4672,161 @@ function PhoneInput({
|
|
|
4634
4672
|
}
|
|
4635
4673
|
);
|
|
4636
4674
|
}
|
|
4675
|
+
|
|
4676
|
+
// src/lib/money.ts
|
|
4677
|
+
var MAX_MINOR = Number.MAX_SAFE_INTEGER;
|
|
4678
|
+
function formatMoney(valueMinor, currency, locale = "es-MX") {
|
|
4679
|
+
if (valueMinor === null || !Number.isFinite(valueMinor)) return "";
|
|
4680
|
+
const minor = Math.abs(Math.trunc(valueMinor));
|
|
4681
|
+
return new Intl.NumberFormat(locale, {
|
|
4682
|
+
style: "currency",
|
|
4683
|
+
currency,
|
|
4684
|
+
minimumFractionDigits: 2,
|
|
4685
|
+
maximumFractionDigits: 2
|
|
4686
|
+
}).format(minor / 100);
|
|
4687
|
+
}
|
|
4688
|
+
function appendMoneyDigit(valueMinor, digit) {
|
|
4689
|
+
if (!Number.isInteger(digit) || digit < 0 || digit > 9) return valueMinor;
|
|
4690
|
+
const base = valueMinor ?? 0;
|
|
4691
|
+
const next = base * 10 + digit;
|
|
4692
|
+
if (!Number.isSafeInteger(next) || next > MAX_MINOR) return valueMinor;
|
|
4693
|
+
return next === 0 ? null : next;
|
|
4694
|
+
}
|
|
4695
|
+
function backspaceMoneyMinor(valueMinor) {
|
|
4696
|
+
if (valueMinor === null || valueMinor === 0) return null;
|
|
4697
|
+
const next = Math.trunc(valueMinor / 10);
|
|
4698
|
+
return next === 0 ? null : next;
|
|
4699
|
+
}
|
|
4700
|
+
function parseMoneyToMinor(raw) {
|
|
4701
|
+
const trimmed = raw.trim();
|
|
4702
|
+
if (!trimmed) return null;
|
|
4703
|
+
const digits = trimmed.replace(/[^\d.]/g, "");
|
|
4704
|
+
if (!digits) return null;
|
|
4705
|
+
const parts = digits.split(".");
|
|
4706
|
+
if (parts.length > 2) return null;
|
|
4707
|
+
const whole = parts[0] ?? "";
|
|
4708
|
+
const frac = parts[1] ?? "";
|
|
4709
|
+
if (!/^\d*$/.test(whole) || !/^\d{0,2}$/.test(frac)) return null;
|
|
4710
|
+
if (!whole && !frac) return null;
|
|
4711
|
+
const parsed = Number(`${whole || "0"}.${frac.padEnd(2, "0")}`);
|
|
4712
|
+
if (!Number.isFinite(parsed) || parsed < 0) return null;
|
|
4713
|
+
const minor = Math.round(parsed * 100);
|
|
4714
|
+
if (!Number.isSafeInteger(minor) || minor < 0) return null;
|
|
4715
|
+
if (minor === 0) return null;
|
|
4716
|
+
return minor;
|
|
4717
|
+
}
|
|
4718
|
+
var ROW_CLASS2 = "flex w-full min-w-0 items-stretch overflow-hidden rounded-lg border border-input bg-transparent transition-colors outline-none focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
|
|
4719
|
+
function currencyLabel(currency, mxnLabel, usdLabel) {
|
|
4720
|
+
return currency === "USD" ? usdLabel : mxnLabel;
|
|
4721
|
+
}
|
|
4722
|
+
function MoneyInput({
|
|
4723
|
+
valueMinor,
|
|
4724
|
+
onValueMinorChange,
|
|
4725
|
+
currency = "MXN",
|
|
4726
|
+
currencies = ["MXN", "USD"],
|
|
4727
|
+
showCurrencySwitch = false,
|
|
4728
|
+
onCurrencyChange,
|
|
4729
|
+
locale = "es-MX",
|
|
4730
|
+
moneySize = "default",
|
|
4731
|
+
mxnLabel = "MXN",
|
|
4732
|
+
usdLabel = "USD",
|
|
4733
|
+
className,
|
|
4734
|
+
disabled,
|
|
4735
|
+
id,
|
|
4736
|
+
name,
|
|
4737
|
+
"aria-invalid": ariaInvalid,
|
|
4738
|
+
"aria-label": ariaLabel,
|
|
4739
|
+
placeholder,
|
|
4740
|
+
...props
|
|
4741
|
+
}) {
|
|
4742
|
+
const display = formatMoney(valueMinor, currency, locale);
|
|
4743
|
+
const switchable = showCurrencySwitch && currencies.length > 1 && onCurrencyChange;
|
|
4744
|
+
function applyDigit(digit) {
|
|
4745
|
+
onValueMinorChange(appendMoneyDigit(valueMinor, digit));
|
|
4746
|
+
}
|
|
4747
|
+
function onKeyDown(event) {
|
|
4748
|
+
if (disabled) return;
|
|
4749
|
+
if (event.key >= "0" && event.key <= "9") {
|
|
4750
|
+
event.preventDefault();
|
|
4751
|
+
applyDigit(Number(event.key));
|
|
4752
|
+
return;
|
|
4753
|
+
}
|
|
4754
|
+
if (event.key === "Backspace" || event.key === "Delete") {
|
|
4755
|
+
event.preventDefault();
|
|
4756
|
+
onValueMinorChange(backspaceMoneyMinor(valueMinor));
|
|
4757
|
+
return;
|
|
4758
|
+
}
|
|
4759
|
+
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey) {
|
|
4760
|
+
event.preventDefault();
|
|
4761
|
+
}
|
|
4762
|
+
}
|
|
4763
|
+
function onPaste(event) {
|
|
4764
|
+
if (disabled) return;
|
|
4765
|
+
const text = event.clipboardData.getData("text");
|
|
4766
|
+
const parsed = parseMoneyToMinor(text);
|
|
4767
|
+
if (parsed === null && text.trim()) return;
|
|
4768
|
+
event.preventDefault();
|
|
4769
|
+
onValueMinorChange(parsed);
|
|
4770
|
+
}
|
|
4771
|
+
const sizeClass = moneySize === "large" ? "h-14 text-2xl tabular-nums" : "tabular-nums";
|
|
4772
|
+
return /* @__PURE__ */ jsxs(
|
|
4773
|
+
"div",
|
|
4774
|
+
{
|
|
4775
|
+
"aria-invalid": ariaInvalid,
|
|
4776
|
+
className: cn(
|
|
4777
|
+
ROW_CLASS2,
|
|
4778
|
+
disabled ? "pointer-events-none cursor-not-allowed bg-input/50 opacity-50 dark:bg-input/80" : null,
|
|
4779
|
+
className
|
|
4780
|
+
),
|
|
4781
|
+
children: [
|
|
4782
|
+
switchable ? /* @__PURE__ */ jsx(
|
|
4783
|
+
"div",
|
|
4784
|
+
{
|
|
4785
|
+
className: "flex shrink-0 items-stretch border-r border-input",
|
|
4786
|
+
role: "group",
|
|
4787
|
+
"aria-label": "Currency",
|
|
4788
|
+
children: currencies.map((code) => /* @__PURE__ */ jsx(
|
|
4789
|
+
Button,
|
|
4790
|
+
{
|
|
4791
|
+
type: "button",
|
|
4792
|
+
variant: currency === code ? "secondary" : "ghost",
|
|
4793
|
+
className: "h-full min-w-14 rounded-none px-2 text-xs font-semibold",
|
|
4794
|
+
disabled,
|
|
4795
|
+
"aria-pressed": currency === code,
|
|
4796
|
+
onClick: () => onCurrencyChange(code),
|
|
4797
|
+
children: currencyLabel(code, mxnLabel, usdLabel)
|
|
4798
|
+
},
|
|
4799
|
+
code
|
|
4800
|
+
))
|
|
4801
|
+
}
|
|
4802
|
+
) : null,
|
|
4803
|
+
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value: valueMinor ?? "" }) : null,
|
|
4804
|
+
/* @__PURE__ */ jsx(
|
|
4805
|
+
Input,
|
|
4806
|
+
{
|
|
4807
|
+
...props,
|
|
4808
|
+
"aria-invalid": ariaInvalid,
|
|
4809
|
+
"aria-label": ariaLabel,
|
|
4810
|
+
autoComplete: "off",
|
|
4811
|
+
className: cn(
|
|
4812
|
+
"h-full min-w-0 flex-1 border-0 bg-transparent shadow-none focus-visible:ring-0",
|
|
4813
|
+
sizeClass
|
|
4814
|
+
),
|
|
4815
|
+
disabled,
|
|
4816
|
+
id,
|
|
4817
|
+
inputMode: "numeric",
|
|
4818
|
+
placeholder,
|
|
4819
|
+
type: "text",
|
|
4820
|
+
value: display,
|
|
4821
|
+
readOnly: true,
|
|
4822
|
+
onKeyDown,
|
|
4823
|
+
onPaste
|
|
4824
|
+
}
|
|
4825
|
+
)
|
|
4826
|
+
]
|
|
4827
|
+
}
|
|
4828
|
+
);
|
|
4829
|
+
}
|
|
4637
4830
|
var DEFAULT_LABELS2 = {
|
|
4638
4831
|
uploadAria: "Upload image",
|
|
4639
4832
|
uploadHint: "Click to upload",
|
|
@@ -6652,7 +6845,7 @@ function OptionRow({
|
|
|
6652
6845
|
),
|
|
6653
6846
|
...props,
|
|
6654
6847
|
children: [
|
|
6655
|
-
icon ? /* @__PURE__ */ jsx("span", { className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg]:size-5", children: icon }) : null,
|
|
6848
|
+
icon ? /* @__PURE__ */ jsx("span", { className: "flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground [&_img]:size-9 [&_img]:object-contain [&_svg]:size-5", children: icon }) : null,
|
|
6656
6849
|
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
6657
6850
|
/* @__PURE__ */ jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [
|
|
6658
6851
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: title }),
|
|
@@ -7089,7 +7282,7 @@ function SectionCard({
|
|
|
7089
7282
|
] }),
|
|
7090
7283
|
headerAction ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: headerAction }) : null
|
|
7091
7284
|
] }),
|
|
7092
|
-
/* @__PURE__ */ jsx(CardContent, { children }),
|
|
7285
|
+
children != null ? /* @__PURE__ */ jsx(CardContent, { children }) : null,
|
|
7093
7286
|
footer ? /* @__PURE__ */ jsx("div", { className: "flex justify-end border-t border-border/60 px-6 pb-6 pt-4", children: footer }) : null
|
|
7094
7287
|
]
|
|
7095
7288
|
}
|
|
@@ -7688,6 +7881,6 @@ function MatchReview({
|
|
|
7688
7881
|
);
|
|
7689
7882
|
}
|
|
7690
7883
|
|
|
7691
|
-
export { AccountMenu, AppShell, AuditTimeline, AvatarEditor, AvatarEditorDialog, COOKIE_CONSENT_MAX_AGE, COOKIE_CONSENT_NAME, COOKIE_CONSENT_VALUES, COUNTRY_OPTIONS, CURP_REGEX, ConfirmDestructiveDialog, CookieConsentBanner, CostBreakdownCard, CountryPicker, CurpInput, DATA_TABLE_BODY_MIN_CLASS, DATA_TABLE_DEFAULT_SKELETON_ROWS, DATA_TABLE_ROW_CLASS, DEFAULT_AUDIT_TIMELINE_LABELS, DEFAULT_COOKIE_CONSENT_BANNER_LABELS, DEFAULT_EDITABLE_SECTION_LABELS, DEFAULT_ENTITY_GRAPH_LABELS, DEFAULT_FILE_DROPZONE_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILE_UPLOAD_TRAY_LABELS, DEFAULT_LEGAL_ACCEPT_CHECKBOX_LABELS, DEFAULT_LEGAL_ACCEPT_DIALOG_LABELS, DEFAULT_MATCH_REVIEW_LABELS, DEFAULT_NOTIFICATION_BELL_LABELS, DEFAULT_RISK_BADGE_LABELS, DashboardSkeleton, DataList, DataListItem, DataTable, DataTableSkeleton, DetailHeader, DetailPageSkeleton, DimensionBreakdownTable, EditableSection, Empty2 as Empty, EmptyContent2 as EmptyContent, EmptyDescription2 as EmptyDescription, EmptyHeader2 as EmptyHeader, EmptyMedia2 as EmptyMedia, EmptyState, EmptyTitle2 as EmptyTitle, EntityGraph, ErrorState, Field, FieldMessage, FileDropzone, FileUploadMenu, FileUploadTray, FormCardSkeleton, FormSection, LanguageContext, LanguageSwitcher, LegalAcceptCheckbox, LegalAcceptDialog, LegalMarkdown, ListSkeleton, LoadingState, MatchReview, MetricChartCard, MetricEmptyState, MetricSkeleton, NavTabs, NavigationProgress, NotificationBell, OptionRow, PageContainer, PageTitle, PageTitleSkeleton, PaginatedCombobox, PasswordInput, PhoneInput, QueueLayout, RfcInput, RiskBadge, RouteLoading, SAT_TAX_REGIME_CODES, SafeImage, SearchablePicker, SectionCard, SectionNav, SectionNavList, SectionSummary, SettingRow, SparklineStat, StatHighlightCard, StatusBadge, StepProgress, StickyActionBar, TAX_REGIME_OPTIONS, THEME_INIT_SCRIPT, THEME_INIT_SCRIPT_ID, THEME_STORAGE_KEY, TIME_RANGE_OPTIONS, TableSkeleton, TaxRegimePicker, ThemeSwitcher, TimeRangePicker, WizardLayout, avatarFallbackStyle, cn, cookieConsentAllowsReplay, cookieDomainFromHostname, countryLabel, countryPickerItems, createMultipartUploadController, curpCheckDigit, dataTableBodyMinClass, defaultLanguages, fileMatchesAccept, filterCountries, filterTaxRegimes, formatCountryOptionLabel, formatTaxRegimeOptionLabel, getAvatarColors, getInitials, isCookieConsentValue, isEmbeddedWindow, isKnownCountryCode, isKnownTaxRegimeCode, matchClaimIsUnverified, normalizeCurpInput, normalizeRfc, parseCookieConsent, partRanges, progressFromBytes, queueRowKeyDown, readCookieConsent, renderShellLink, rfcMaxLengthForPersonKind, serializeCookieConsent, signalNavigationStart, sourceUrlIsHttps, suppressNavigationProgress, taxRegimeLabel, taxRegimePickerItems, useDirtyGuard, useEditableSection, useLanguageContext, useMediaQuery, useQueueKeys, useSectionNav, validateCurp, validateRfcForPersonKind, writeCookieConsent };
|
|
7884
|
+
export { AccountMenu, AppShell, AuditTimeline, AvatarEditor, AvatarEditorDialog, COOKIE_CONSENT_MAX_AGE, COOKIE_CONSENT_NAME, COOKIE_CONSENT_VALUES, COUNTRY_OPTIONS, CURP_REGEX, ConfirmDestructiveDialog, CookieConsentBanner, CostBreakdownCard, CountryPicker, CurpInput, DATA_TABLE_BODY_MIN_CLASS, DATA_TABLE_DEFAULT_SKELETON_ROWS, DATA_TABLE_ROW_CLASS, DEFAULT_AUDIT_TIMELINE_LABELS, DEFAULT_COOKIE_CONSENT_BANNER_LABELS, DEFAULT_EDITABLE_SECTION_LABELS, DEFAULT_ENTITY_GRAPH_LABELS, DEFAULT_FILE_DROPZONE_LABELS, DEFAULT_FILE_UPLOAD_LABELS, DEFAULT_FILE_UPLOAD_TRAY_LABELS, DEFAULT_LEGAL_ACCEPT_CHECKBOX_LABELS, DEFAULT_LEGAL_ACCEPT_DIALOG_LABELS, DEFAULT_MATCH_REVIEW_LABELS, DEFAULT_NOTIFICATION_BELL_LABELS, DEFAULT_RISK_BADGE_LABELS, DashboardSkeleton, DataList, DataListItem, DataTable, DataTableSkeleton, DetailHeader, DetailPageSkeleton, DimensionBreakdownTable, EditableSection, Empty2 as Empty, EmptyContent2 as EmptyContent, EmptyDescription2 as EmptyDescription, EmptyHeader2 as EmptyHeader, EmptyMedia2 as EmptyMedia, EmptyState, EmptyTitle2 as EmptyTitle, EntityGraph, ErrorState, Field, FieldMessage, FileDropzone, FileUploadMenu, FileUploadTray, FormCardSkeleton, FormSection, LanguageContext, LanguageSwitcher, LegalAcceptCheckbox, LegalAcceptDialog, LegalMarkdown, ListSkeleton, LoadingState, MatchReview, MetricChartCard, MetricEmptyState, MetricSkeleton, MoneyInput, NavTabs, NavigationProgress, NotificationBell, OptionRow, PageContainer, PageTitle, PageTitleSkeleton, PaginatedCombobox, PasswordInput, PhoneInput, ProductIllustration, QueueLayout, RfcInput, RiskBadge, RouteLoading, SAT_TAX_REGIME_CODES, SafeImage, SearchablePicker, SectionCard, SectionNav, SectionNavList, SectionSummary, SettingRow, SparklineStat, StatHighlightCard, StatusBadge, StepProgress, StickyActionBar, TAX_REGIME_OPTIONS, THEME_INIT_SCRIPT, THEME_INIT_SCRIPT_ID, THEME_STORAGE_KEY, TIME_RANGE_OPTIONS, TableSkeleton, TaxRegimePicker, ThemeSwitcher, TimeRangePicker, WizardLayout, appendMoneyDigit, avatarFallbackStyle, backspaceMoneyMinor, cn, cookieConsentAllowsReplay, cookieDomainFromHostname, countryLabel, countryPickerItems, createMultipartUploadController, curpCheckDigit, dataTableBodyMinClass, defaultLanguages, fileMatchesAccept, filterCountries, filterTaxRegimes, formatCountryOptionLabel, formatMoney, formatTaxRegimeOptionLabel, getAvatarColors, getInitials, isCookieConsentValue, isEmbeddedWindow, isKnownCountryCode, isKnownTaxRegimeCode, matchClaimIsUnverified, normalizeCurpInput, normalizeRfc, parseCookieConsent, parseMoneyToMinor, partRanges, progressFromBytes, queueRowKeyDown, readCookieConsent, renderShellLink, rfcMaxLengthForPersonKind, serializeCookieConsent, signalNavigationStart, sourceUrlIsHttps, suppressNavigationProgress, taxRegimeLabel, taxRegimePickerItems, useDirtyGuard, useEditableSection, useLanguageContext, useMediaQuery, useQueueKeys, useSectionNav, validateCurp, validateRfcForPersonKind, writeCookieConsent };
|
|
7692
7885
|
//# sourceMappingURL=index.js.map
|
|
7693
7886
|
//# sourceMappingURL=index.js.map
|