@lerianstudio/sindarian-ui 1.2.0-beta.13 → 1.2.0-beta.14
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/charts/chart.d.ts +64 -0
- package/dist/charts/chart.d.ts.map +1 -0
- package/dist/charts/chart.js +232 -0
- package/dist/charts/index.d.ts +3 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +11 -0
- package/dist/components/breadcrumb/get-breadcrumb-paths.js +5 -2
- package/dist/components/form/date-time-picker-field/index.js +1 -1
- package/dist/components/form/file-upload-field/index.d.ts +52 -0
- package/dist/components/form/file-upload-field/index.d.ts.map +1 -0
- package/dist/components/form/file-upload-field/index.js +50 -0
- package/dist/components/form/index.d.ts +3 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +3 -0
- package/dist/components/form/radio-group-field/index.d.ts +32 -0
- package/dist/components/form/radio-group-field/index.d.ts.map +1 -0
- package/dist/components/form/radio-group-field/index.js +29 -0
- package/dist/components/form/renderable-label.d.ts +35 -0
- package/dist/components/form/renderable-label.d.ts.map +1 -0
- package/dist/components/form/renderable-label.js +57 -0
- package/dist/components/form/textarea-field/index.d.ts +31 -0
- package/dist/components/form/textarea-field/index.d.ts.map +1 -0
- package/dist/components/form/textarea-field/index.js +23 -0
- package/dist/components/table/id-table-cell.js +5 -2
- package/dist/components/ui/accordion/index.d.ts +14 -0
- package/dist/components/ui/accordion/index.d.ts.map +1 -0
- package/dist/components/ui/accordion/index.js +62 -0
- package/dist/components/ui/alert-dialog/index.d.ts +15 -0
- package/dist/components/ui/alert-dialog/index.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog/index.js +84 -0
- package/dist/components/ui/autocomplete/index.js +4 -4
- package/dist/components/ui/file-upload/index.d.ts +94 -0
- package/dist/components/ui/file-upload/index.d.ts.map +1 -0
- package/dist/components/ui/file-upload/index.js +230 -0
- package/dist/components/ui/hover-card/index.d.ts +7 -0
- package/dist/components/ui/hover-card/index.d.ts.map +1 -0
- package/dist/components/ui/hover-card/index.js +51 -0
- package/dist/components/ui/input/index.js +2 -2
- package/dist/components/ui/otp-input/index.d.ts.map +1 -1
- package/dist/components/ui/otp-input/index.js +1 -1
- package/dist/components/ui/radio-group/index.d.ts +6 -0
- package/dist/components/ui/radio-group/index.d.ts.map +1 -0
- package/dist/components/ui/radio-group/index.js +48 -0
- package/dist/components/ui/scroll-area/index.d.ts +6 -0
- package/dist/components/ui/scroll-area/index.d.ts.map +1 -0
- package/dist/components/ui/scroll-area/index.js +49 -0
- package/dist/components/ui/sidebar/index.d.ts +1 -0
- package/dist/components/ui/sidebar/index.d.ts.map +1 -1
- package/dist/components/ui/sidebar/index.js +1 -0
- package/dist/components/ui/sidebar/next-router.cjs +44 -0
- package/dist/components/ui/sidebar/next-router.d.cts +7 -0
- package/dist/components/ui/sidebar/sidebar-item-button.d.ts +2 -2
- package/dist/components/ui/sidebar/sidebar-item-button.d.ts.map +1 -1
- package/dist/components/ui/sidebar/sidebar-item-button.js +3 -5
- package/dist/components/ui/sidebar/sidebar-item-icon-button.d.ts +2 -2
- package/dist/components/ui/sidebar/sidebar-item-icon-button.d.ts.map +1 -1
- package/dist/components/ui/sidebar/sidebar-item-icon-button.js +3 -5
- package/dist/components/ui/sidebar/sidebar-item.d.ts.map +1 -1
- package/dist/components/ui/sidebar/sidebar-item.js +3 -2
- package/dist/components/ui/sidebar/sidebar-router.d.ts +82 -0
- package/dist/components/ui/sidebar/sidebar-router.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-router.js +126 -0
- package/dist/components/ui/toast/index.d.ts +1 -1
- package/dist/components/ui/toast/index.d.ts.map +1 -1
- package/dist/components/ui/toggle-group/index.d.ts +18 -0
- package/dist/components/ui/toggle-group/index.d.ts.map +1 -0
- package/dist/components/ui/toggle-group/index.js +87 -0
- package/dist/domain/blotter/index.d.ts +40 -0
- package/dist/domain/blotter/index.d.ts.map +1 -0
- package/dist/domain/blotter/index.js +16 -0
- package/dist/domain/delinquency-aging/aging-buckets.d.ts +37 -0
- package/dist/domain/delinquency-aging/aging-buckets.d.ts.map +1 -0
- package/dist/domain/delinquency-aging/aging-buckets.js +97 -0
- package/dist/domain/delinquency-aging/index.d.ts +52 -0
- package/dist/domain/delinquency-aging/index.d.ts.map +1 -0
- package/dist/domain/delinquency-aging/index.js +151 -0
- package/dist/domain/figure/index.d.ts +30 -0
- package/dist/domain/figure/index.d.ts.map +1 -0
- package/dist/domain/figure/index.js +18 -0
- package/dist/domain/format.d.ts +57 -0
- package/dist/domain/format.d.ts.map +1 -0
- package/dist/domain/format.js +102 -0
- package/dist/domain/index.d.ts +22 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/index.js +43 -0
- package/dist/domain/key-id/index.d.ts +31 -0
- package/dist/domain/key-id/index.d.ts.map +1 -0
- package/dist/domain/key-id/index.js +167 -0
- package/dist/domain/ledger-sheet/index.d.ts +45 -0
- package/dist/domain/ledger-sheet/index.d.ts.map +1 -0
- package/dist/domain/ledger-sheet/index.js +28 -0
- package/dist/domain/money-diff.d.ts +23 -0
- package/dist/domain/money-diff.d.ts.map +1 -0
- package/dist/domain/money-diff.js +48 -0
- package/dist/domain/money-math.d.ts +32 -0
- package/dist/domain/money-math.d.ts.map +1 -0
- package/dist/domain/money-math.js +104 -0
- package/dist/domain/money-text/index.d.ts +37 -0
- package/dist/domain/money-text/index.d.ts.map +1 -0
- package/dist/domain/money-text/index.js +113 -0
- package/dist/domain/section-label/index.d.ts +21 -0
- package/dist/domain/section-label/index.d.ts.map +1 -0
- package/dist/domain/section-label/index.js +9 -0
- package/dist/domain/status-rail/index.d.ts +40 -0
- package/dist/domain/status-rail/index.d.ts.map +1 -0
- package/dist/domain/status-rail/index.js +64 -0
- package/dist/domain/threshold-gauge/index.d.ts +84 -0
- package/dist/domain/threshold-gauge/index.d.ts.map +1 -0
- package/dist/domain/threshold-gauge/index.js +157 -0
- package/dist/enterprise/alert-banner/index.d.ts +30 -0
- package/dist/enterprise/alert-banner/index.d.ts.map +1 -0
- package/dist/enterprise/alert-banner/index.js +24 -0
- package/dist/enterprise/app-shell/index.d.ts +61 -0
- package/dist/enterprise/app-shell/index.d.ts.map +1 -0
- package/dist/enterprise/app-shell/index.js +87 -0
- package/dist/enterprise/cursor-pager/index.d.ts +21 -0
- package/dist/enterprise/cursor-pager/index.d.ts.map +1 -0
- package/dist/enterprise/cursor-pager/index.js +26 -0
- package/dist/enterprise/data-table/index.d.ts +88 -0
- package/dist/enterprise/data-table/index.d.ts.map +1 -0
- package/dist/enterprise/data-table/index.js +245 -0
- package/dist/enterprise/date-range-picker/index.d.ts +37 -0
- package/dist/enterprise/date-range-picker/index.d.ts.map +1 -0
- package/dist/enterprise/date-range-picker/index.js +74 -0
- package/dist/enterprise/detail-panel/index.d.ts +54 -0
- package/dist/enterprise/detail-panel/index.d.ts.map +1 -0
- package/dist/enterprise/detail-panel/index.js +20 -0
- package/dist/enterprise/empty-state/index.d.ts +32 -0
- package/dist/enterprise/empty-state/index.d.ts.map +1 -0
- package/dist/enterprise/empty-state/index.js +13 -0
- package/dist/enterprise/index.d.ts +26 -0
- package/dist/enterprise/index.d.ts.map +1 -0
- package/dist/enterprise/index.js +39 -0
- package/dist/enterprise/number-input/index.d.ts +55 -0
- package/dist/enterprise/number-input/index.d.ts.map +1 -0
- package/dist/enterprise/number-input/index.js +238 -0
- package/dist/enterprise/search-input/index.d.ts +32 -0
- package/dist/enterprise/search-input/index.d.ts.map +1 -0
- package/dist/enterprise/search-input/index.js +114 -0
- package/dist/enterprise/stat-card/index.d.ts +43 -0
- package/dist/enterprise/stat-card/index.d.ts.map +1 -0
- package/dist/enterprise/stat-card/index.js +67 -0
- package/dist/enterprise/status-badge/index.d.ts +31 -0
- package/dist/enterprise/status-badge/index.d.ts.map +1 -0
- package/dist/enterprise/status-badge/index.js +120 -0
- package/dist/enterprise/use-is-mobile.d.ts +11 -0
- package/dist/enterprise/use-is-mobile.d.ts.map +1 -0
- package/dist/enterprise/use-is-mobile.js +59 -0
- package/dist/enterprise/virtualized-table/index.d.ts +26 -0
- package/dist/enterprise/virtualized-table/index.d.ts.map +1 -0
- package/dist/enterprise/virtualized-table/index.js +114 -0
- package/dist/esm/charts/chart.d.ts +64 -0
- package/dist/esm/charts/chart.d.ts.map +1 -0
- package/dist/esm/charts/chart.js +191 -0
- package/dist/esm/charts/index.d.ts +3 -0
- package/dist/esm/charts/index.d.ts.map +1 -0
- package/dist/esm/charts/index.js +3 -0
- package/dist/esm/components/breadcrumb/get-breadcrumb-paths.d.ts +10 -0
- package/dist/esm/components/breadcrumb/get-breadcrumb-paths.d.ts.map +1 -0
- package/dist/esm/components/breadcrumb/get-breadcrumb-paths.js +12 -0
- package/dist/esm/components/breadcrumb/index.d.ts +11 -0
- package/dist/esm/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/esm/components/breadcrumb/index.js +6 -0
- package/dist/esm/components/card/account-card/index.d.ts +32 -0
- package/dist/esm/components/card/account-card/index.d.ts.map +1 -0
- package/dist/esm/components/card/account-card/index.js +53 -0
- package/dist/esm/components/card/basic-card/index.d.ts +6 -0
- package/dist/esm/components/card/basic-card/index.d.ts.map +1 -0
- package/dist/esm/components/card/basic-card/index.js +14 -0
- package/dist/esm/components/card/dashboard-card/index.d.ts +5 -0
- package/dist/esm/components/card/dashboard-card/index.d.ts.map +1 -0
- package/dist/esm/components/card/dashboard-card/index.js +14 -0
- package/dist/esm/components/card/entity-card/index.d.ts +22 -0
- package/dist/esm/components/card/entity-card/index.d.ts.map +1 -0
- package/dist/esm/components/card/entity-card/index.js +48 -0
- package/dist/esm/components/card/index.d.ts +5 -0
- package/dist/esm/components/card/index.d.ts.map +1 -0
- package/dist/esm/components/card/index.js +4 -0
- package/dist/esm/components/dialog/confirmation-dialog/index.d.ts +16 -0
- package/dist/esm/components/dialog/confirmation-dialog/index.d.ts.map +1 -0
- package/dist/esm/components/dialog/confirmation-dialog/index.js +25 -0
- package/dist/esm/components/dialog/confirmation-dialog/use-confirm-dialog.d.ts +31 -0
- package/dist/esm/components/dialog/confirmation-dialog/use-confirm-dialog.d.ts.map +1 -0
- package/dist/esm/components/dialog/confirmation-dialog/use-confirm-dialog.js +49 -0
- package/dist/esm/components/dialog/index.d.ts +4 -0
- package/dist/esm/components/dialog/index.d.ts.map +1 -0
- package/dist/esm/components/dialog/index.js +3 -0
- package/dist/esm/components/dialog/large-dialog/index.d.ts +11 -0
- package/dist/esm/components/dialog/large-dialog/index.d.ts.map +1 -0
- package/dist/esm/components/dialog/large-dialog/index.js +16 -0
- package/dist/esm/components/entity-box/index.d.ts +17 -0
- package/dist/esm/components/entity-box/index.d.ts.map +1 -0
- package/dist/esm/components/entity-box/index.js +31 -0
- package/dist/esm/components/entity-data-table/index.d.ts +17 -0
- package/dist/esm/components/entity-data-table/index.d.ts.map +1 -0
- package/dist/esm/components/entity-data-table/index.js +17 -0
- package/dist/esm/components/form/combo-box-field/index.d.ts +14 -0
- package/dist/esm/components/form/combo-box-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/combo-box-field/index.js +28 -0
- package/dist/esm/components/form/country-field/index.d.ts +5 -0
- package/dist/esm/components/form/country-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/country-field/index.js +7 -0
- package/dist/esm/components/form/date-picker-field/index.d.ts +21 -0
- package/dist/esm/components/form/date-picker-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/date-picker-field/index.js +38 -0
- package/dist/esm/components/form/date-range-field/index.d.ts +21 -0
- package/dist/esm/components/form/date-range-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/date-range-field/index.js +17 -0
- package/dist/esm/components/form/date-time-picker-field/index.d.ts +23 -0
- package/dist/esm/components/form/date-time-picker-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/date-time-picker-field/index.js +73 -0
- package/dist/esm/components/form/file-upload-field/index.d.ts +52 -0
- package/dist/esm/components/form/file-upload-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/file-upload-field/index.js +46 -0
- package/dist/esm/components/form/index.d.ts +16 -0
- package/dist/esm/components/form/index.d.ts.map +1 -0
- package/dist/esm/components/form/index.js +15 -0
- package/dist/esm/components/form/input-field/index.d.ts +26 -0
- package/dist/esm/components/form/input-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/input-field/index.js +10 -0
- package/dist/esm/components/form/otp-field/index.d.ts +18 -0
- package/dist/esm/components/form/otp-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/otp-field/index.js +15 -0
- package/dist/esm/components/form/pagination-limit-field/index.d.ts +9 -0
- package/dist/esm/components/form/pagination-limit-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/pagination-limit-field/index.js +6 -0
- package/dist/esm/components/form/password-field/index.d.ts +14 -0
- package/dist/esm/components/form/password-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/password-field/index.js +10 -0
- package/dist/esm/components/form/radio-group-field/index.d.ts +32 -0
- package/dist/esm/components/form/radio-group-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/radio-group-field/index.js +25 -0
- package/dist/esm/components/form/renderable-label.d.ts +35 -0
- package/dist/esm/components/form/renderable-label.d.ts.map +1 -0
- package/dist/esm/components/form/renderable-label.js +54 -0
- package/dist/esm/components/form/select-field/index.d.ts +20 -0
- package/dist/esm/components/form/select-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/select-field/index.js +16 -0
- package/dist/esm/components/form/state-field/index.d.ts +10 -0
- package/dist/esm/components/form/state-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/state-field/index.js +35 -0
- package/dist/esm/components/form/switch-field/index.d.ts +15 -0
- package/dist/esm/components/form/switch-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/switch-field/index.js +7 -0
- package/dist/esm/components/form/textarea-field/index.d.ts +31 -0
- package/dist/esm/components/form/textarea-field/index.d.ts.map +1 -0
- package/dist/esm/components/form/textarea-field/index.js +19 -0
- package/dist/esm/components/page/index.d.ts +4 -0
- package/dist/esm/components/page/index.d.ts.map +1 -0
- package/dist/esm/components/page/index.js +11 -0
- package/dist/esm/components/page-header/index.d.ts +33 -0
- package/dist/esm/components/page-header/index.d.ts.map +1 -0
- package/dist/esm/components/page-header/index.js +40 -0
- package/dist/esm/components/pagination/index.d.ts +8 -0
- package/dist/esm/components/pagination/index.d.ts.map +1 -0
- package/dist/esm/components/pagination/index.js +6 -0
- package/dist/esm/components/table/id-table-cell.d.ts +7 -0
- package/dist/esm/components/table/id-table-cell.d.ts.map +1 -0
- package/dist/esm/components/table/id-table-cell.js +12 -0
- package/dist/esm/components/table/index.d.ts +3 -0
- package/dist/esm/components/table/index.d.ts.map +1 -0
- package/dist/esm/components/table/index.js +2 -0
- package/dist/esm/components/table/locked-table-actions.d.ts +7 -0
- package/dist/esm/components/table/locked-table-actions.d.ts.map +1 -0
- package/dist/esm/components/table/locked-table-actions.js +7 -0
- package/dist/esm/components/table/name-table-cell.d.ts +6 -0
- package/dist/esm/components/table/name-table-cell.d.ts.map +1 -0
- package/dist/esm/components/table/name-table-cell.js +6 -0
- package/dist/esm/components/ui/accordion/index.d.ts +14 -0
- package/dist/esm/components/ui/accordion/index.d.ts.map +1 -0
- package/dist/esm/components/ui/accordion/index.js +24 -0
- package/dist/esm/components/ui/alert/index.d.ts +15 -0
- package/dist/esm/components/ui/alert/index.d.ts.map +1 -0
- package/dist/esm/components/ui/alert/index.js +38 -0
- package/dist/esm/components/ui/alert-dialog/index.d.ts +15 -0
- package/dist/esm/components/ui/alert-dialog/index.d.ts.map +1 -0
- package/dist/esm/components/ui/alert-dialog/index.js +39 -0
- package/dist/esm/components/ui/autocomplete/index.d.ts +54 -0
- package/dist/esm/components/ui/autocomplete/index.d.ts.map +1 -0
- package/dist/esm/components/ui/autocomplete/index.js +276 -0
- package/dist/esm/components/ui/autosize-textarea/index.d.ts +15 -0
- package/dist/esm/components/ui/autosize-textarea/index.d.ts.map +1 -0
- package/dist/esm/components/ui/autosize-textarea/index.js +51 -0
- package/dist/esm/components/ui/avatar/index.d.ts +7 -0
- package/dist/esm/components/ui/avatar/index.d.ts.map +1 -0
- package/dist/esm/components/ui/avatar/index.js +14 -0
- package/dist/esm/components/ui/badge/index.d.ts +11 -0
- package/dist/esm/components/ui/badge/index.d.ts.map +1 -0
- package/dist/esm/components/ui/badge/index.js +29 -0
- package/dist/esm/components/ui/breadcrumb/index.d.ts +12 -0
- package/dist/esm/components/ui/breadcrumb/index.d.ts.map +1 -0
- package/dist/esm/components/ui/breadcrumb/index.js +27 -0
- package/dist/esm/components/ui/button/index.d.ts +22 -0
- package/dist/esm/components/ui/button/index.d.ts.map +1 -0
- package/dist/esm/components/ui/button/index.js +59 -0
- package/dist/esm/components/ui/calendar/index.d.ts +9 -0
- package/dist/esm/components/ui/calendar/index.d.ts.map +1 -0
- package/dist/esm/components/ui/calendar/index.js +79 -0
- package/dist/esm/components/ui/card/index.d.ts +10 -0
- package/dist/esm/components/ui/card/index.d.ts.map +1 -0
- package/dist/esm/components/ui/card/index.js +24 -0
- package/dist/esm/components/ui/checkbox/index.d.ts +5 -0
- package/dist/esm/components/ui/checkbox/index.d.ts.map +1 -0
- package/dist/esm/components/ui/checkbox/index.js +9 -0
- package/dist/esm/components/ui/collapsible/index.d.ts +6 -0
- package/dist/esm/components/ui/collapsible/index.d.ts.map +1 -0
- package/dist/esm/components/ui/collapsible/index.js +13 -0
- package/dist/esm/components/ui/command/index.d.ts +14 -0
- package/dist/esm/components/ui/command/index.d.ts.map +1 -0
- package/dist/esm/components/ui/command/index.js +51 -0
- package/dist/esm/components/ui/copy-field/index.d.ts +56 -0
- package/dist/esm/components/ui/copy-field/index.d.ts.map +1 -0
- package/dist/esm/components/ui/copy-field/index.js +114 -0
- package/dist/esm/components/ui/dialog/index.d.ts +16 -0
- package/dist/esm/components/ui/dialog/index.d.ts.map +1 -0
- package/dist/esm/components/ui/dialog/index.js +36 -0
- package/dist/esm/components/ui/dropdown-menu/index.d.ts +27 -0
- package/dist/esm/components/ui/dropdown-menu/index.d.ts.map +1 -0
- package/dist/esm/components/ui/dropdown-menu/index.js +57 -0
- package/dist/esm/components/ui/field/index.d.ts +25 -0
- package/dist/esm/components/ui/field/index.d.ts.map +1 -0
- package/dist/esm/components/ui/field/index.js +68 -0
- package/dist/esm/components/ui/file-upload/index.d.ts +94 -0
- package/dist/esm/components/ui/file-upload/index.d.ts.map +1 -0
- package/dist/esm/components/ui/file-upload/index.js +193 -0
- package/dist/esm/components/ui/form.d.ts +39 -0
- package/dist/esm/components/ui/form.d.ts.map +1 -0
- package/dist/esm/components/ui/form.js +67 -0
- package/dist/esm/components/ui/hover-card/index.d.ts +7 -0
- package/dist/esm/components/ui/hover-card/index.d.ts.map +1 -0
- package/dist/esm/components/ui/hover-card/index.js +14 -0
- package/dist/esm/components/ui/icon-button/index.d.ts +13 -0
- package/dist/esm/components/ui/icon-button/index.d.ts.map +1 -0
- package/dist/esm/components/ui/icon-button/index.js +31 -0
- package/dist/esm/components/ui/input/adornment.d.ts +9 -0
- package/dist/esm/components/ui/input/adornment.d.ts.map +1 -0
- package/dist/esm/components/ui/input/adornment.js +17 -0
- package/dist/esm/components/ui/input/index.d.ts +18 -0
- package/dist/esm/components/ui/input/index.d.ts.map +1 -0
- package/dist/esm/components/ui/input/index.js +60 -0
- package/dist/esm/components/ui/label/index.d.ts +7 -0
- package/dist/esm/components/ui/label/index.d.ts.map +1 -0
- package/dist/esm/components/ui/label/index.js +10 -0
- package/dist/esm/components/ui/loading-button/index.d.ts +8 -0
- package/dist/esm/components/ui/loading-button/index.d.ts.map +1 -0
- package/dist/esm/components/ui/loading-button/index.js +7 -0
- package/dist/esm/components/ui/multiple-select/index.d.ts +91 -0
- package/dist/esm/components/ui/multiple-select/index.d.ts.map +1 -0
- package/dist/esm/components/ui/multiple-select/index.js +196 -0
- package/dist/esm/components/ui/otp-input/index.d.ts +13 -0
- package/dist/esm/components/ui/otp-input/index.d.ts.map +1 -0
- package/dist/esm/components/ui/otp-input/index.js +21 -0
- package/dist/esm/components/ui/paper/index.d.ts +4 -0
- package/dist/esm/components/ui/paper/index.d.ts.map +1 -0
- package/dist/esm/components/ui/paper/index.js +5 -0
- package/dist/esm/components/ui/paper-collapsible/index.d.ts +9 -0
- package/dist/esm/components/ui/paper-collapsible/index.d.ts.map +1 -0
- package/dist/esm/components/ui/paper-collapsible/index.js +19 -0
- package/dist/esm/components/ui/popover/index.d.ts +8 -0
- package/dist/esm/components/ui/popover/index.d.ts.map +1 -0
- package/dist/esm/components/ui/popover/index.js +17 -0
- package/dist/esm/components/ui/progress/index.d.ts +8 -0
- package/dist/esm/components/ui/progress/index.d.ts.map +1 -0
- package/dist/esm/components/ui/progress/index.js +8 -0
- package/dist/esm/components/ui/qr-code/index.d.ts +26 -0
- package/dist/esm/components/ui/qr-code/index.d.ts.map +1 -0
- package/dist/esm/components/ui/qr-code/index.js +24 -0
- package/dist/esm/components/ui/radio-group/index.d.ts +6 -0
- package/dist/esm/components/ui/radio-group/index.d.ts.map +1 -0
- package/dist/esm/components/ui/radio-group/index.js +12 -0
- package/dist/esm/components/ui/scroll-area/index.d.ts +6 -0
- package/dist/esm/components/ui/scroll-area/index.d.ts.map +1 -0
- package/dist/esm/components/ui/scroll-area/index.js +13 -0
- package/dist/esm/components/ui/select/index.d.ts +18 -0
- package/dist/esm/components/ui/select/index.d.ts.map +1 -0
- package/dist/esm/components/ui/select/index.js +47 -0
- package/dist/esm/components/ui/separator/index.d.ts +5 -0
- package/dist/esm/components/ui/separator/index.d.ts.map +1 -0
- package/dist/esm/components/ui/separator/index.js +8 -0
- package/dist/esm/components/ui/sheet/index.d.ts +19 -0
- package/dist/esm/components/ui/sheet/index.d.ts.map +1 -0
- package/dist/esm/components/ui/sheet/index.js +59 -0
- package/dist/esm/components/ui/sidebar/index.d.ts +11 -0
- package/dist/esm/components/ui/sidebar/index.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/index.js +10 -0
- package/dist/esm/components/ui/sidebar/next-router.cjs +44 -0
- package/dist/esm/components/ui/sidebar/next-router.d.cts +7 -0
- package/dist/esm/components/ui/sidebar/sidebar-back-button.d.ts +3 -0
- package/dist/esm/components/ui/sidebar/sidebar-back-button.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-back-button.js +5 -0
- package/dist/esm/components/ui/sidebar/sidebar-components.d.ts +23 -0
- package/dist/esm/components/ui/sidebar/sidebar-components.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-components.js +15 -0
- package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts +7 -0
- package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-expand-button.js +12 -0
- package/dist/esm/components/ui/sidebar/sidebar-item-button.d.ts +12 -0
- package/dist/esm/components/ui/sidebar/sidebar-item-button.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-item-button.js +18 -0
- package/dist/esm/components/ui/sidebar/sidebar-item-collapsible.d.ts +12 -0
- package/dist/esm/components/ui/sidebar/sidebar-item-collapsible.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-item-collapsible.js +44 -0
- package/dist/esm/components/ui/sidebar/sidebar-item-icon-button.d.ts +12 -0
- package/dist/esm/components/ui/sidebar/sidebar-item-icon-button.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-item-icon-button.js +14 -0
- package/dist/esm/components/ui/sidebar/sidebar-item.d.ts +13 -0
- package/dist/esm/components/ui/sidebar/sidebar-item.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-item.js +16 -0
- package/dist/esm/components/ui/sidebar/sidebar-provider.d.ts +12 -0
- package/dist/esm/components/ui/sidebar/sidebar-provider.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-provider.js +51 -0
- package/dist/esm/components/ui/sidebar/sidebar-root.d.ts +3 -0
- package/dist/esm/components/ui/sidebar/sidebar-root.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-root.js +20 -0
- package/dist/esm/components/ui/sidebar/sidebar-router.d.ts +82 -0
- package/dist/esm/components/ui/sidebar/sidebar-router.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-router.js +89 -0
- package/dist/esm/components/ui/skeleton/index.d.ts +3 -0
- package/dist/esm/components/ui/skeleton/index.d.ts.map +1 -0
- package/dist/esm/components/ui/skeleton/index.js +6 -0
- package/dist/esm/components/ui/stepper/index.d.ts +18 -0
- package/dist/esm/components/ui/stepper/index.d.ts.map +1 -0
- package/dist/esm/components/ui/stepper/index.js +20 -0
- package/dist/esm/components/ui/switch/index.d.ts +5 -0
- package/dist/esm/components/ui/switch/index.d.ts.map +1 -0
- package/dist/esm/components/ui/switch/index.js +8 -0
- package/dist/esm/components/ui/table/index.d.ts +21 -0
- package/dist/esm/components/ui/table/index.d.ts.map +1 -0
- package/dist/esm/components/ui/table/index.js +44 -0
- package/dist/esm/components/ui/tabs/index.d.ts +8 -0
- package/dist/esm/components/ui/tabs/index.d.ts.map +1 -0
- package/dist/esm/components/ui/tabs/index.js +17 -0
- package/dist/esm/components/ui/textarea/index.d.ts +4 -0
- package/dist/esm/components/ui/textarea/index.d.ts.map +1 -0
- package/dist/esm/components/ui/textarea/index.js +6 -0
- package/dist/esm/components/ui/time-picker/index.d.ts +18 -0
- package/dist/esm/components/ui/time-picker/index.d.ts.map +1 -0
- package/dist/esm/components/ui/time-picker/index.js +49 -0
- package/dist/esm/components/ui/toast/index.d.ts +18 -0
- package/dist/esm/components/ui/toast/index.d.ts.map +1 -0
- package/dist/esm/components/ui/toast/index.js +2 -0
- package/dist/esm/components/ui/toast/toaster.d.ts +6 -0
- package/dist/esm/components/ui/toast/toaster.d.ts.map +1 -0
- package/dist/esm/components/ui/toast/toaster.js +8 -0
- package/dist/esm/components/ui/toggle-group/index.d.ts +18 -0
- package/dist/esm/components/ui/toggle-group/index.d.ts.map +1 -0
- package/dist/esm/components/ui/toggle-group/index.js +51 -0
- package/dist/esm/components/ui/tooltip/index.d.ts +11 -0
- package/dist/esm/components/ui/tooltip/index.d.ts.map +1 -0
- package/dist/esm/components/ui/tooltip/index.js +28 -0
- package/dist/esm/domain/blotter/index.d.ts +40 -0
- package/dist/esm/domain/blotter/index.d.ts.map +1 -0
- package/dist/esm/domain/blotter/index.js +12 -0
- package/dist/esm/domain/delinquency-aging/aging-buckets.d.ts +37 -0
- package/dist/esm/domain/delinquency-aging/aging-buckets.d.ts.map +1 -0
- package/dist/esm/domain/delinquency-aging/aging-buckets.js +92 -0
- package/dist/esm/domain/delinquency-aging/index.d.ts +52 -0
- package/dist/esm/domain/delinquency-aging/index.d.ts.map +1 -0
- package/dist/esm/domain/delinquency-aging/index.js +147 -0
- package/dist/esm/domain/figure/index.d.ts +30 -0
- package/dist/esm/domain/figure/index.d.ts.map +1 -0
- package/dist/esm/domain/figure/index.js +14 -0
- package/dist/esm/domain/format.d.ts +57 -0
- package/dist/esm/domain/format.d.ts.map +1 -0
- package/dist/esm/domain/format.js +94 -0
- package/dist/esm/domain/index.d.ts +22 -0
- package/dist/esm/domain/index.d.ts.map +1 -0
- package/dist/esm/domain/index.js +19 -0
- package/dist/esm/domain/key-id/index.d.ts +31 -0
- package/dist/esm/domain/key-id/index.d.ts.map +1 -0
- package/dist/esm/domain/key-id/index.js +162 -0
- package/dist/esm/domain/ledger-sheet/index.d.ts +45 -0
- package/dist/esm/domain/ledger-sheet/index.d.ts.map +1 -0
- package/dist/esm/domain/ledger-sheet/index.js +24 -0
- package/dist/esm/domain/money-diff.d.ts +23 -0
- package/dist/esm/domain/money-diff.d.ts.map +1 -0
- package/dist/esm/domain/money-diff.js +45 -0
- package/dist/esm/domain/money-math.d.ts +32 -0
- package/dist/esm/domain/money-math.d.ts.map +1 -0
- package/dist/esm/domain/money-math.js +98 -0
- package/dist/esm/domain/money-text/index.d.ts +37 -0
- package/dist/esm/domain/money-text/index.d.ts.map +1 -0
- package/dist/esm/domain/money-text/index.js +108 -0
- package/dist/esm/domain/section-label/index.d.ts +21 -0
- package/dist/esm/domain/section-label/index.d.ts.map +1 -0
- package/dist/esm/domain/section-label/index.js +6 -0
- package/dist/esm/domain/status-rail/index.d.ts +40 -0
- package/dist/esm/domain/status-rail/index.d.ts.map +1 -0
- package/dist/esm/domain/status-rail/index.js +59 -0
- package/dist/esm/domain/threshold-gauge/index.d.ts +84 -0
- package/dist/esm/domain/threshold-gauge/index.d.ts.map +1 -0
- package/dist/esm/domain/threshold-gauge/index.js +153 -0
- package/dist/esm/enterprise/alert-banner/index.d.ts +30 -0
- package/dist/esm/enterprise/alert-banner/index.d.ts.map +1 -0
- package/dist/esm/enterprise/alert-banner/index.js +21 -0
- package/dist/esm/enterprise/app-shell/index.d.ts +61 -0
- package/dist/esm/enterprise/app-shell/index.d.ts.map +1 -0
- package/dist/esm/enterprise/app-shell/index.js +51 -0
- package/dist/esm/enterprise/cursor-pager/index.d.ts +21 -0
- package/dist/esm/enterprise/cursor-pager/index.d.ts.map +1 -0
- package/dist/esm/enterprise/cursor-pager/index.js +23 -0
- package/dist/esm/enterprise/data-table/index.d.ts +88 -0
- package/dist/esm/enterprise/data-table/index.d.ts.map +1 -0
- package/dist/esm/enterprise/data-table/index.js +242 -0
- package/dist/esm/enterprise/date-range-picker/index.d.ts +37 -0
- package/dist/esm/enterprise/date-range-picker/index.d.ts.map +1 -0
- package/dist/esm/enterprise/date-range-picker/index.js +71 -0
- package/dist/esm/enterprise/detail-panel/index.d.ts +54 -0
- package/dist/esm/enterprise/detail-panel/index.d.ts.map +1 -0
- package/dist/esm/enterprise/detail-panel/index.js +17 -0
- package/dist/esm/enterprise/empty-state/index.d.ts +32 -0
- package/dist/esm/enterprise/empty-state/index.d.ts.map +1 -0
- package/dist/esm/enterprise/empty-state/index.js +10 -0
- package/dist/esm/enterprise/index.d.ts +26 -0
- package/dist/esm/enterprise/index.d.ts.map +1 -0
- package/dist/esm/enterprise/index.js +22 -0
- package/dist/esm/enterprise/number-input/index.d.ts +55 -0
- package/dist/esm/enterprise/number-input/index.d.ts.map +1 -0
- package/dist/esm/enterprise/number-input/index.js +200 -0
- package/dist/esm/enterprise/search-input/index.d.ts +32 -0
- package/dist/esm/enterprise/search-input/index.d.ts.map +1 -0
- package/dist/esm/enterprise/search-input/index.js +78 -0
- package/dist/esm/enterprise/stat-card/index.d.ts +43 -0
- package/dist/esm/enterprise/stat-card/index.d.ts.map +1 -0
- package/dist/esm/enterprise/stat-card/index.js +64 -0
- package/dist/esm/enterprise/status-badge/index.d.ts +31 -0
- package/dist/esm/enterprise/status-badge/index.d.ts.map +1 -0
- package/dist/esm/enterprise/status-badge/index.js +116 -0
- package/dist/esm/enterprise/use-is-mobile.d.ts +11 -0
- package/dist/esm/enterprise/use-is-mobile.d.ts.map +1 -0
- package/dist/esm/enterprise/use-is-mobile.js +23 -0
- package/dist/esm/enterprise/virtualized-table/index.d.ts +26 -0
- package/dist/esm/enterprise/virtualized-table/index.d.ts.map +1 -0
- package/dist/esm/enterprise/virtualized-table/index.js +111 -0
- package/dist/esm/hooks/use-click-away.d.ts +9 -0
- package/dist/esm/hooks/use-click-away.d.ts.map +1 -0
- package/dist/esm/hooks/use-click-away.js +22 -0
- package/dist/esm/hooks/use-pagination.d.ts +13 -0
- package/dist/esm/hooks/use-pagination.d.ts.map +1 -0
- package/dist/esm/hooks/use-pagination.js +38 -0
- package/dist/esm/hooks/use-stepper.d.ts +11 -0
- package/dist/esm/hooks/use-stepper.d.ts.map +1 -0
- package/dist/esm/hooks/use-stepper.js +22 -0
- package/dist/esm/hooks/use-time.d.ts +6 -0
- package/dist/esm/hooks/use-time.d.ts.map +1 -0
- package/dist/esm/hooks/use-time.js +13 -0
- package/dist/esm/hooks/use-toast.d.ts +31 -0
- package/dist/esm/hooks/use-toast.d.ts.map +1 -0
- package/dist/esm/hooks/use-toast.js +63 -0
- package/dist/esm/index.d.ts +69 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +74 -0
- package/dist/esm/lib/storage/get-storage-object.d.ts +2 -0
- package/dist/esm/lib/storage/get-storage-object.d.ts.map +1 -0
- package/dist/esm/lib/storage/get-storage-object.js +17 -0
- package/dist/esm/lib/storage/get-storage.d.ts +2 -0
- package/dist/esm/lib/storage/get-storage.d.ts.map +1 -0
- package/dist/esm/lib/storage/get-storage.js +14 -0
- package/dist/esm/lib/storage/index.d.ts +3 -0
- package/dist/esm/lib/storage/index.d.ts.map +1 -0
- package/dist/esm/lib/storage/index.js +2 -0
- package/dist/esm/lib/typography.d.ts +17 -0
- package/dist/esm/lib/typography.d.ts.map +1 -0
- package/dist/esm/lib/typography.js +16 -0
- package/dist/esm/lib/utils.d.ts +3 -0
- package/dist/esm/lib/utils.d.ts.map +1 -0
- package/dist/esm/lib/utils.js +5 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/public/countries.json +21210 -0
- package/dist/esm/theme/get-theme-script.d.ts +3 -0
- package/dist/esm/theme/get-theme-script.d.ts.map +1 -0
- package/dist/esm/theme/get-theme-script.js +41 -0
- package/dist/esm/theme/index.d.ts +6 -0
- package/dist/esm/theme/index.d.ts.map +1 -0
- package/dist/esm/theme/index.js +4 -0
- package/dist/esm/theme/mode-toggle.d.ts +25 -0
- package/dist/esm/theme/mode-toggle.d.ts.map +1 -0
- package/dist/esm/theme/mode-toggle.js +27 -0
- package/dist/esm/theme/theme-provider.d.ts +38 -0
- package/dist/esm/theme/theme-provider.d.ts.map +1 -0
- package/dist/esm/theme/theme-provider.js +98 -0
- package/dist/esm/toast/helpers.d.ts +16 -0
- package/dist/esm/toast/helpers.d.ts.map +1 -0
- package/dist/esm/toast/helpers.js +29 -0
- package/dist/esm/toast/index.d.ts +3 -0
- package/dist/esm/toast/index.d.ts.map +1 -0
- package/dist/esm/toast/index.js +4 -0
- package/dist/esm/types/metadata-type.d.ts +2 -0
- package/dist/esm/types/metadata-type.d.ts.map +1 -0
- package/dist/esm/types/metadata-type.js +1 -0
- package/dist/esm/utils/countries.cjs +17 -0
- package/dist/esm/utils/countries.d.cts +14 -0
- package/dist/esm/utils/country-utils.d.ts +17 -0
- package/dist/esm/utils/country-utils.d.ts.map +1 -0
- package/dist/esm/utils/country-utils.js +18 -0
- package/dist/esm/utils/currency-codes.d.ts +5 -0
- package/dist/esm/utils/currency-codes.d.ts.map +1 -0
- package/dist/esm/utils/currency-codes.js +181 -0
- package/dist/globals.css +66 -0
- package/dist/hooks/use-toast.d.ts +1 -1
- package/dist/hooks/use-toast.d.ts.map +1 -1
- package/dist/hooks/use-toast.js +4 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -1
- package/dist/lib/storage/get-storage-object.d.ts.map +1 -1
- package/dist/lib/storage/get-storage-object.js +6 -2
- package/dist/lib/typography.d.ts +17 -0
- package/dist/lib/typography.d.ts.map +1 -0
- package/dist/lib/typography.js +19 -0
- package/dist/public/countries.json +21200 -21200
- package/dist/theme/get-theme-script.d.ts +3 -0
- package/dist/theme/get-theme-script.d.ts.map +1 -0
- package/dist/theme/get-theme-script.js +44 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +11 -0
- package/dist/theme/mode-toggle.d.ts +25 -0
- package/dist/theme/mode-toggle.d.ts.map +1 -0
- package/dist/theme/mode-toggle.js +30 -0
- package/dist/theme/theme-provider.d.ts +38 -0
- package/dist/theme/theme-provider.d.ts.map +1 -0
- package/dist/theme/theme-provider.js +135 -0
- package/dist/toast/helpers.d.ts +16 -0
- package/dist/toast/helpers.d.ts.map +1 -0
- package/dist/toast/helpers.js +34 -0
- package/dist/toast/index.d.ts +3 -0
- package/dist/toast/index.d.ts.map +1 -0
- package/dist/toast/index.js +10 -0
- package/dist/utils/countries.cjs +17 -0
- package/dist/utils/countries.d.cts +14 -0
- package/dist/utils/country-utils.js +2 -2
- package/package.json +54 -18
- package/dist/components/ui/button/button.test.d.ts +0 -2
- package/dist/components/ui/button/button.test.d.ts.map +0 -1
- package/dist/components/ui/button/button.test.js +0 -65
- package/dist/components/ui/copy-field/copy-field.test.d.ts +0 -2
- package/dist/components/ui/copy-field/copy-field.test.d.ts.map +0 -1
- package/dist/components/ui/copy-field/copy-field.test.js +0 -268
- package/dist/components/ui/input/input.test.d.ts +0 -2
- package/dist/components/ui/input/input.test.d.ts.map +0 -1
- package/dist/components/ui/input/input.test.js +0 -52
- package/dist/components/ui/label/label.stories.d.ts +0 -5
- package/dist/components/ui/label/label.stories.d.ts.map +0 -1
- package/dist/components/ui/label/label.stories.js +0 -24
- package/dist/components/ui/qr-code/qr-code.test.d.ts +0 -2
- package/dist/components/ui/qr-code/qr-code.test.d.ts.map +0 -1
- package/dist/components/ui/qr-code/qr-code.test.js +0 -60
- package/dist/components/ui/sidebar/sidebar-provider.test.d.ts +0 -2
- package/dist/components/ui/sidebar/sidebar-provider.test.d.ts.map +0 -1
- package/dist/components/ui/sidebar/sidebar-provider.test.js +0 -170
- package/dist/hooks/use-click-away.test.d.ts +0 -2
- package/dist/hooks/use-click-away.test.d.ts.map +0 -1
- package/dist/hooks/use-click-away.test.js +0 -39
- package/dist/hooks/use-stepper.test.d.ts +0 -2
- package/dist/hooks/use-stepper.test.d.ts.map +0 -1
- package/dist/hooks/use-stepper.test.js +0 -45
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.delinquencyRate = delinquencyRate;
|
|
4
|
+
exports.DelinquencyAging = DelinquencyAging;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
/**
|
|
7
|
+
* DelinquencyAging — a loan/receivable delinquency surface: the ordered overdue
|
|
8
|
+
* aging distribution PLUS the headline delinquency rate (the share of portfolio
|
|
9
|
+
* value that is past due).
|
|
10
|
+
*
|
|
11
|
+
* <DelinquencyAging
|
|
12
|
+
* currency="BRL"
|
|
13
|
+
* locale="pt-BR"
|
|
14
|
+
* warn={0.05}
|
|
15
|
+
* breach={0.1}
|
|
16
|
+
* buckets={[
|
|
17
|
+
* { label: 'A vencer', count: 312, total: '1840500.00', overdue: false },
|
|
18
|
+
* { label: '1–30', count: 84, total: '402300.00', overdue: true },
|
|
19
|
+
* { label: '31–60', count: 21, total: '118900.00', overdue: true },
|
|
20
|
+
* { label: '61–90', count: 9, total: '54200.00', overdue: true },
|
|
21
|
+
* { label: '90+', count: 4, total: '38100.00', overdue: true }
|
|
22
|
+
* ]}
|
|
23
|
+
* />
|
|
24
|
+
*
|
|
25
|
+
* The distribution is delegated whole to `AgingBuckets`: it owns the ordered
|
|
26
|
+
* current → 90+ schedule, the per-bucket count/total, the ordinal band cue, and
|
|
27
|
+
* the money-math-exact grand total. This composite adds only the one fact aging
|
|
28
|
+
* alone does not state — the delinquency RATE.
|
|
29
|
+
*
|
|
30
|
+
* THIRD RAIL (money): the rate is overdueTotal / portfolioTotal, and BOTH totals
|
|
31
|
+
* are summed in integer minor units (BigInt, at the currency's CLDR scale) via
|
|
32
|
+
* `money-math` — never an IEEE-754 sum of decimals (0.1 + 0.2 ≠ 0.3 in float, a
|
|
33
|
+
* silent basis-point error on a portfolio). The single floating-point operation
|
|
34
|
+
* is the FINAL division of two already-exact integers, which is the correct,
|
|
35
|
+
* lossless-enough place for it (a ratio is not money). A zero portfolio yields a
|
|
36
|
+
* null rate — an explicit empty readout, never a NaN. A single unparseable
|
|
37
|
+
* bucket total poisons the rate to indeterminate rather than reporting a wrong
|
|
38
|
+
* share.
|
|
39
|
+
*
|
|
40
|
+
* NON-COLOR CUE (WCAG 1.4.1): the rate band (healthy / elevated / distressed) is
|
|
41
|
+
* resolved through the gauge's strict-edge `gaugeBand` (higher-is-worse: more
|
|
42
|
+
* overdue is worse) and named with a glyph + an sr-only word + a tint — the tint
|
|
43
|
+
* is reinforcement only, so the band survives grayscale and color-vision
|
|
44
|
+
* deficiency. A distressed rate reads loud (credit-red, role='alert').
|
|
45
|
+
*
|
|
46
|
+
* Pure display: no directive, no interactivity, server-safe for RSC.
|
|
47
|
+
*/
|
|
48
|
+
const lucide_react_1 = require("lucide-react");
|
|
49
|
+
const typography_1 = require("../../lib/typography");
|
|
50
|
+
const utils_1 = require("../../lib/utils");
|
|
51
|
+
const figure_1 = require("../figure");
|
|
52
|
+
const format_1 = require("../format");
|
|
53
|
+
const money_math_1 = require("../money-math");
|
|
54
|
+
const section_label_1 = require("../section-label");
|
|
55
|
+
const threshold_gauge_1 = require("../threshold-gauge");
|
|
56
|
+
const aging_buckets_1 = require("./aging-buckets");
|
|
57
|
+
/** Fixed-point scale for the rate division: 1e12 keeps twelve decimal places of
|
|
58
|
+
* a 0..1 ratio, and both it and any in-range scaled quotient stay well inside
|
|
59
|
+
* the exact-integer range of a double (2^53), so the conversion is lossless. */
|
|
60
|
+
const RATE_PRECISION = 1000000000000n;
|
|
61
|
+
/**
|
|
62
|
+
* THIRD RAIL: the delinquency rate = overdue total / portfolio total, with both
|
|
63
|
+
* totals summed through integer minor units (BigInt) at `scale`. The only float
|
|
64
|
+
* operation is the final division of two EXACT integers — never a float sum of
|
|
65
|
+
* decimals. A zero portfolio gives a null rate (explicit empty, no NaN); an
|
|
66
|
+
* unparseable total poisons everything to indeterminate. Pure: unit-tested.
|
|
67
|
+
*
|
|
68
|
+
* Internal: exported for its unit tests, never from `src/domain/index.ts`.
|
|
69
|
+
*/
|
|
70
|
+
function delinquencyRate(buckets, scale) {
|
|
71
|
+
// Parse each bucket exactly once: the sums and the per-bucket SIGN check both
|
|
72
|
+
// come off the same pass, so the two can never disagree about the same input.
|
|
73
|
+
const parsed = buckets.map((b) => (0, money_math_1.toMinor)(b.total, scale));
|
|
74
|
+
if (parsed.some((m) => m === null)) {
|
|
75
|
+
return {
|
|
76
|
+
rate: null,
|
|
77
|
+
overdueMinor: null,
|
|
78
|
+
totalMinor: null,
|
|
79
|
+
indeterminate: true
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
let totalMinor = 0n;
|
|
83
|
+
let overdueMinor = 0n;
|
|
84
|
+
let hasNegativeBucket = false;
|
|
85
|
+
parsed.forEach((m, i) => {
|
|
86
|
+
const minor = m;
|
|
87
|
+
if (minor < 0n)
|
|
88
|
+
hasNegativeBucket = true;
|
|
89
|
+
totalMinor += minor;
|
|
90
|
+
if (buckets[i].overdue)
|
|
91
|
+
overdueMinor += minor;
|
|
92
|
+
});
|
|
93
|
+
// A NEGATIVE bucket total is parseable but not interpretable as a share of a
|
|
94
|
+
// portfolio: overdue/total stops being bounded by 0..1 the moment a component
|
|
95
|
+
// is negative (a -50 current band against a 100 overdue band yields "200%
|
|
96
|
+
// delinquent"), and it can also cancel the denominator toward zero. A credit
|
|
97
|
+
// adjustment is real data, but it is not aging data, so the honest answer is
|
|
98
|
+
// that the RATE cannot be determined — the sums stay, since they are still
|
|
99
|
+
// correct, and the readout takes the no-value path. Legacy divided anyway and
|
|
100
|
+
// printed the out-of-range percentage.
|
|
101
|
+
if (hasNegativeBucket) {
|
|
102
|
+
return { rate: null, overdueMinor, totalMinor, indeterminate: true };
|
|
103
|
+
}
|
|
104
|
+
// A zero portfolio has no rate to report — null, never overdueMinor/0 (NaN).
|
|
105
|
+
if (totalMinor === 0n) {
|
|
106
|
+
return { rate: null, overdueMinor, totalMinor, indeterminate: false };
|
|
107
|
+
}
|
|
108
|
+
// The division is done as a BOUNDED BigInt ratio first, then converted once.
|
|
109
|
+
// Converting the two totals to Number separately overflowed on a large
|
|
110
|
+
// portfolio: past ~1.8e308 each side becomes Infinity and Infinity/Infinity is
|
|
111
|
+
// NaN — a portfolio big enough to matter reported no rate at all. Scaling the
|
|
112
|
+
// numerator by RATE_PRECISION keeps the quotient the size of a ratio (not the
|
|
113
|
+
// size of the money), so the single Number() sees a value it can hold exactly.
|
|
114
|
+
const scaled = (overdueMinor * RATE_PRECISION) / totalMinor;
|
|
115
|
+
const rate = Number(scaled) / Number(RATE_PRECISION);
|
|
116
|
+
// A ratio that still cannot be represented is no rate at all — the readout
|
|
117
|
+
// shows the no-value placeholder rather than a NaN/Infinity artifact.
|
|
118
|
+
if (!Number.isFinite(rate)) {
|
|
119
|
+
return { rate: null, overdueMinor, totalMinor, indeterminate: false };
|
|
120
|
+
}
|
|
121
|
+
return { rate, overdueMinor, totalMinor, indeterminate: false };
|
|
122
|
+
}
|
|
123
|
+
/** Band → glyph + tint + accessible word. The glyph and sr-only word are the
|
|
124
|
+
* load-bearing cue; the tint only reinforces, so the band survives grayscale
|
|
125
|
+
* and color-vision deficiency. Mirrors the gauge's three-band canon, renamed
|
|
126
|
+
* to the delinquency vocabulary. */
|
|
127
|
+
const RATE_BAND = {
|
|
128
|
+
low: { Icon: lucide_react_1.ShieldCheck, tint: 'text-system-success', word: 'Saudável' },
|
|
129
|
+
warn: { Icon: lucide_react_1.TriangleAlert, tint: 'text-system-alert', word: 'Elevada' },
|
|
130
|
+
breach: { Icon: lucide_react_1.AlertOctagon, tint: 'text-credit', word: 'Em estresse' }
|
|
131
|
+
};
|
|
132
|
+
function DelinquencyAging({ buckets, currency, locale, rateLabel = 'Inadimplência', warn = 0.05, breach = 0.1, showTotal = false, className }) {
|
|
133
|
+
// THIRD RAIL: the rate scale and the two totals come from money-math, never
|
|
134
|
+
// float. The division below is of two exact BigInt-derived integers.
|
|
135
|
+
const scale = currency ? (0, money_math_1.minorDigitsOf)(currency) : 2;
|
|
136
|
+
const { rate, indeterminate } = delinquencyRate(buckets, scale);
|
|
137
|
+
// The band is only meaningful when there is a rate; an empty/indeterminate
|
|
138
|
+
// portfolio has no band to name (rendered as the explicit no-value readout).
|
|
139
|
+
const hasRate = rate !== null;
|
|
140
|
+
// higher-is-worse: more value past due is worse. gaugeBand is strict-edge, so
|
|
141
|
+
// a rate exactly on a threshold stays in the calmer band.
|
|
142
|
+
const band = hasRate
|
|
143
|
+
? (0, threshold_gauge_1.gaugeBand)(rate, { warn, breach }, 'higher-is-worse')
|
|
144
|
+
: 'low';
|
|
145
|
+
const { Icon, tint, word } = RATE_BAND[band];
|
|
146
|
+
const distressed = band === 'breach';
|
|
147
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)('flex flex-col gap-4', className), children: [(0, jsx_runtime_1.jsxs)("header", { className: "flex items-baseline justify-between gap-3", children: [(0, jsx_runtime_1.jsx)(section_label_1.SectionLabel, { as: "span", children: rateLabel }), hasRate ? ((0, jsx_runtime_1.jsxs)("span", {
|
|
148
|
+
// A distressed rate is a credit alarm: announced the moment it
|
|
149
|
+
// crosses the band, so assistive tech does not lean on the tint.
|
|
150
|
+
role: distressed ? 'alert' : undefined, className: (0, utils_1.cn)('inline-flex items-center gap-1.5', tint), children: [(0, jsx_runtime_1.jsx)(Icon, { "aria-hidden": true, className: "size-4 shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { className: "sr-only", children: [word, ": "] }), (0, jsx_runtime_1.jsx)(figure_1.Figure, { size: "row", className: tint, children: (0, format_1.formatPercent)(rate, { unit: 'ratio', locale }) })] })) : ((0, jsx_runtime_1.jsxs)("span", { className: "text-muted-foreground inline-flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(typography_1.LABEL_VOICE_CLASS, 'tracking-normal normal-case'), children: indeterminate ? 'indeterminada' : 'sem carteira' }), (0, jsx_runtime_1.jsx)(figure_1.Figure, { size: "row", className: "text-muted-foreground", children: format_1.NO_VALUE })] }))] }), (0, jsx_runtime_1.jsx)(aging_buckets_1.AgingBuckets, { buckets: buckets, currency: currency, locale: locale, showTotal: showTotal })] }));
|
|
151
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Figure — the locked mono figure type scale of the enterprise console.
|
|
3
|
+
*
|
|
4
|
+
* All numbers are the hero: mono, tabular, visually dominant. This file is the
|
|
5
|
+
* single source of truth for the canonical figure sizes so screens stop
|
|
6
|
+
* re-typing `font-mono … tabular-nums` strings and drifting on
|
|
7
|
+
* size/weight/tracking. Use `<Figure size>` for new markup, or import the
|
|
8
|
+
* `FIGURE_CLASS` constants when composing className strings inline.
|
|
9
|
+
*
|
|
10
|
+
* Scale:
|
|
11
|
+
* - hero : the dominant in-bar figure — text-4xl/5xl, semibold, tracking-tight
|
|
12
|
+
* - panel : compliance / exposure — text-3xl, semibold, tracking-tight
|
|
13
|
+
* - count : ledger count — text-2xl, semibold, tracking-tight
|
|
14
|
+
* - row : inline / row figure — text-sm
|
|
15
|
+
* - tick : ruler / micro figure — text-[10px], leading-none
|
|
16
|
+
*/
|
|
17
|
+
import type { ElementType, ReactNode } from 'react';
|
|
18
|
+
export type FigureSize = 'hero' | 'panel' | 'count' | 'row' | 'tick';
|
|
19
|
+
/** Canonical class strings per figure size. The `tabular-nums` and `font-mono`
|
|
20
|
+
* invariants live here so they can never be forgotten at a call site. */
|
|
21
|
+
export declare const FIGURE_CLASS: Record<FigureSize, string>;
|
|
22
|
+
export type FigureProps = {
|
|
23
|
+
size: FigureSize;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Render element. Defaults to `span` so figures nest inside `dd`/`p`/etc. */
|
|
27
|
+
as?: ElementType;
|
|
28
|
+
};
|
|
29
|
+
export declare function Figure({ size, children, className, as: Tag }: FigureProps): import("react").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/figure/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAInD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAA;AAEpE;0EAC0E;AAC1E,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAMnD,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,UAAU,CAAA;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8EAA8E;IAC9E,EAAE,CAAC,EAAE,WAAW,CAAA;CACjB,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,EAAE,EAAE,GAAY,EACjB,EAAE,WAAW,+BAEb"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FIGURE_CLASS = void 0;
|
|
4
|
+
exports.Figure = Figure;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const utils_1 = require("../../lib/utils");
|
|
7
|
+
/** Canonical class strings per figure size. The `tabular-nums` and `font-mono`
|
|
8
|
+
* invariants live here so they can never be forgotten at a call site. */
|
|
9
|
+
exports.FIGURE_CLASS = {
|
|
10
|
+
hero: 'font-mono text-4xl font-semibold tracking-tight tabular-nums lg:text-5xl',
|
|
11
|
+
panel: 'font-mono text-3xl font-semibold tracking-tight tabular-nums',
|
|
12
|
+
count: 'font-mono text-2xl font-semibold tracking-tight tabular-nums',
|
|
13
|
+
row: 'font-mono text-sm tabular-nums',
|
|
14
|
+
tick: 'font-mono text-[10px] leading-none tabular-nums'
|
|
15
|
+
};
|
|
16
|
+
function Figure({ size, children, className, as: Tag = 'span' }) {
|
|
17
|
+
return (0, jsx_runtime_1.jsx)(Tag, { className: (0, utils_1.cn)(exports.FIGURE_CLASS[size], className), children: children });
|
|
18
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ledger-kit formatting helpers. Pure functions, no React. `MoneyText` owns
|
|
3
|
+
* monetary formatting; these cover percent, integer counts, and humanized
|
|
4
|
+
* durations (e.g. an average resolution time arriving as milliseconds).
|
|
5
|
+
*/
|
|
6
|
+
/** No-value placeholder. A middle dot reads as "empty" without an em dash, and
|
|
7
|
+
* stays narrow enough not to disturb tabular alignment. */
|
|
8
|
+
export declare const NO_VALUE = "\u00B7";
|
|
9
|
+
/**
|
|
10
|
+
* Whether a digit count is one `Intl.NumberFormat` (and `Number#toFixed`, and
|
|
11
|
+
* `String#repeat`) will actually accept: a finite integer in 0..100. Anything
|
|
12
|
+
* else — a negative, a fraction, NaN, Infinity — makes those constructors throw
|
|
13
|
+
* a RangeError, which on a money surface means a blank screen instead of a
|
|
14
|
+
* number. Every caller turns an invalid count into the no-value path instead.
|
|
15
|
+
*
|
|
16
|
+
* Internal: shared by `format`, `money-text` and `money-math` so the three
|
|
17
|
+
* cannot drift on what "valid" means. Never exported from `src/domain/index.ts`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isValidDigitCount(digits: number): boolean;
|
|
20
|
+
/** Whether an input rate is a 0..1 ratio or an already-scaled 0..100 percent.
|
|
21
|
+
* Defaults to 'ratio' — no guessing from magnitude. */
|
|
22
|
+
export type PercentUnit = 'ratio' | 'percent';
|
|
23
|
+
export type FormatPercentOptions = {
|
|
24
|
+
/** Fraction digits. Defaults to 1. */
|
|
25
|
+
digits?: number;
|
|
26
|
+
/** How to interpret `value`. 'ratio' (default) ×100; 'percent' is already 0..100. */
|
|
27
|
+
unit?: PercentUnit;
|
|
28
|
+
/** BCP 47 locale for the decimal mark. Defaults to the runtime locale. */
|
|
29
|
+
locale?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Format a rate as a percent string. `unit` is explicit, never inferred from
|
|
33
|
+
* magnitude: 'ratio' (default) treats `value` as 0..1 and scales ×100;
|
|
34
|
+
* 'percent' treats `value` as already 0..100.
|
|
35
|
+
*
|
|
36
|
+
* Uses Intl style:'percent' for correct rounding and a locale-aware decimal
|
|
37
|
+
* mark. Intl multiplies its input by 100, so we always feed it the RATIO —
|
|
38
|
+
* a 'percent' input is divided by 100 first.
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatPercent(value: number | null | undefined, options?: FormatPercentOptions): string;
|
|
41
|
+
/**
|
|
42
|
+
* Normalize a rate to the 0..100 range for chart geometry. `unit` is explicit:
|
|
43
|
+
* 'ratio' (default) scales a 0..1 input ×100; 'percent' is already 0..100.
|
|
44
|
+
*/
|
|
45
|
+
export declare function toPercentValue(value: number | null | undefined, unit?: PercentUnit): number;
|
|
46
|
+
/** Thousands-grouped integer count. `locale` defaults to the runtime locale. */
|
|
47
|
+
export declare function formatCount(value: number | null | undefined, locale?: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Humanize a millisecond duration into the largest two sensible units.
|
|
50
|
+
* 0ms → "0s". Sub-minute → seconds. Otherwise the two most-significant
|
|
51
|
+
* CONTIGUOUS d/h/m units from the largest non-zero unit down — so "2d 0h 5m"
|
|
52
|
+
* renders as "2d 0h", not the misleading "2d 5m".
|
|
53
|
+
*
|
|
54
|
+
* Note: the d/h/m/s suffixes are English; localizing them is deferred.
|
|
55
|
+
*/
|
|
56
|
+
export declare function humanizeDurationMs(ms: number | null | undefined): string;
|
|
57
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/domain/format.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;2DAC2D;AAC3D,eAAO,MAAM,QAAQ,WAAM,CAAA;AAE3B;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;uDACuD;AACvD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,SAAS,CAAA;AAE7C,MAAM,MAAM,oBAAoB,GAAG;IACjC,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qFAAqF;IACrF,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAaR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,IAAI,GAAE,WAAqB,GAC1B,MAAM,CAIR;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAMR;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAuBxE"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Ledger-kit formatting helpers. Pure functions, no React. `MoneyText` owns
|
|
4
|
+
* monetary formatting; these cover percent, integer counts, and humanized
|
|
5
|
+
* durations (e.g. an average resolution time arriving as milliseconds).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.NO_VALUE = void 0;
|
|
9
|
+
exports.isValidDigitCount = isValidDigitCount;
|
|
10
|
+
exports.formatPercent = formatPercent;
|
|
11
|
+
exports.toPercentValue = toPercentValue;
|
|
12
|
+
exports.formatCount = formatCount;
|
|
13
|
+
exports.humanizeDurationMs = humanizeDurationMs;
|
|
14
|
+
/** No-value placeholder. A middle dot reads as "empty" without an em dash, and
|
|
15
|
+
* stays narrow enough not to disturb tabular alignment. */
|
|
16
|
+
exports.NO_VALUE = '·';
|
|
17
|
+
/**
|
|
18
|
+
* Whether a digit count is one `Intl.NumberFormat` (and `Number#toFixed`, and
|
|
19
|
+
* `String#repeat`) will actually accept: a finite integer in 0..100. Anything
|
|
20
|
+
* else — a negative, a fraction, NaN, Infinity — makes those constructors throw
|
|
21
|
+
* a RangeError, which on a money surface means a blank screen instead of a
|
|
22
|
+
* number. Every caller turns an invalid count into the no-value path instead.
|
|
23
|
+
*
|
|
24
|
+
* Internal: shared by `format`, `money-text` and `money-math` so the three
|
|
25
|
+
* cannot drift on what "valid" means. Never exported from `src/domain/index.ts`.
|
|
26
|
+
*/
|
|
27
|
+
function isValidDigitCount(digits) {
|
|
28
|
+
return Number.isInteger(digits) && digits >= 0 && digits <= 100;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Format a rate as a percent string. `unit` is explicit, never inferred from
|
|
32
|
+
* magnitude: 'ratio' (default) treats `value` as 0..1 and scales ×100;
|
|
33
|
+
* 'percent' treats `value` as already 0..100.
|
|
34
|
+
*
|
|
35
|
+
* Uses Intl style:'percent' for correct rounding and a locale-aware decimal
|
|
36
|
+
* mark. Intl multiplies its input by 100, so we always feed it the RATIO —
|
|
37
|
+
* a 'percent' input is divided by 100 first.
|
|
38
|
+
*/
|
|
39
|
+
function formatPercent(value, options = {}) {
|
|
40
|
+
if (value === null || value === undefined || !Number.isFinite(value))
|
|
41
|
+
return exports.NO_VALUE;
|
|
42
|
+
const { digits = 1, unit = 'ratio', locale } = options;
|
|
43
|
+
// A caller-supplied digit count reaches Intl directly; an out-of-range one
|
|
44
|
+
// would throw a RangeError and take the whole surface down with it.
|
|
45
|
+
if (!isValidDigitCount(digits))
|
|
46
|
+
return exports.NO_VALUE;
|
|
47
|
+
const ratio = unit === 'percent' ? value / 100 : value;
|
|
48
|
+
return new Intl.NumberFormat(locale, {
|
|
49
|
+
style: 'percent',
|
|
50
|
+
minimumFractionDigits: digits,
|
|
51
|
+
maximumFractionDigits: digits
|
|
52
|
+
}).format(ratio);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Normalize a rate to the 0..100 range for chart geometry. `unit` is explicit:
|
|
56
|
+
* 'ratio' (default) scales a 0..1 input ×100; 'percent' is already 0..100.
|
|
57
|
+
*/
|
|
58
|
+
function toPercentValue(value, unit = 'ratio') {
|
|
59
|
+
if (value === null || value === undefined || !Number.isFinite(value))
|
|
60
|
+
return 0;
|
|
61
|
+
const pct = unit === 'percent' ? value : value * 100;
|
|
62
|
+
return Math.max(0, Math.min(100, pct));
|
|
63
|
+
}
|
|
64
|
+
/** Thousands-grouped integer count. `locale` defaults to the runtime locale. */
|
|
65
|
+
function formatCount(value, locale) {
|
|
66
|
+
if (value === null || value === undefined || !Number.isFinite(value))
|
|
67
|
+
return exports.NO_VALUE;
|
|
68
|
+
return new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(value);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Humanize a millisecond duration into the largest two sensible units.
|
|
72
|
+
* 0ms → "0s". Sub-minute → seconds. Otherwise the two most-significant
|
|
73
|
+
* CONTIGUOUS d/h/m units from the largest non-zero unit down — so "2d 0h 5m"
|
|
74
|
+
* renders as "2d 0h", not the misleading "2d 5m".
|
|
75
|
+
*
|
|
76
|
+
* Note: the d/h/m/s suffixes are English; localizing them is deferred.
|
|
77
|
+
*/
|
|
78
|
+
function humanizeDurationMs(ms) {
|
|
79
|
+
if (ms == null || !Number.isFinite(ms) || ms < 0)
|
|
80
|
+
return exports.NO_VALUE;
|
|
81
|
+
if (ms === 0)
|
|
82
|
+
return '0s';
|
|
83
|
+
const totalSeconds = Math.round(ms / 1000);
|
|
84
|
+
if (totalSeconds < 60)
|
|
85
|
+
return `${totalSeconds}s`;
|
|
86
|
+
const days = Math.floor(totalSeconds / 86400);
|
|
87
|
+
const hours = Math.floor((totalSeconds % 86400) / 3600);
|
|
88
|
+
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
89
|
+
// Two contiguous units starting at the largest non-zero unit, in order.
|
|
90
|
+
const units = [
|
|
91
|
+
[days, 'd'],
|
|
92
|
+
[hours, 'h'],
|
|
93
|
+
[minutes, 'm']
|
|
94
|
+
];
|
|
95
|
+
const start = units.findIndex(([n]) => n > 0);
|
|
96
|
+
if (start === -1)
|
|
97
|
+
return `${minutes}m`;
|
|
98
|
+
return units
|
|
99
|
+
.slice(start, start + 2)
|
|
100
|
+
.map(([n, suffix]) => `${n}${suffix}`)
|
|
101
|
+
.join(' ');
|
|
102
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { NO_VALUE, formatCount, formatPercent, humanizeDurationMs, toPercentValue } from './format';
|
|
2
|
+
export type { FormatPercentOptions, PercentUnit } from './format';
|
|
3
|
+
export { moneyDiff } from './money-diff';
|
|
4
|
+
export { MoneyText } from './money-text';
|
|
5
|
+
export type { MoneyTextProps } from './money-text';
|
|
6
|
+
export { FIGURE_CLASS, Figure } from './figure';
|
|
7
|
+
export type { FigureProps, FigureSize } from './figure';
|
|
8
|
+
export { SectionLabel } from './section-label';
|
|
9
|
+
export type { SectionLabelProps } from './section-label';
|
|
10
|
+
export { Blotter, BlotterRow } from './blotter';
|
|
11
|
+
export type { BlotterProps, BlotterRowProps } from './blotter';
|
|
12
|
+
export { LedgerPanel, LedgerSheet } from './ledger-sheet';
|
|
13
|
+
export type { LedgerPanelProps, LedgerSheetProps } from './ledger-sheet';
|
|
14
|
+
export { KeyId } from './key-id';
|
|
15
|
+
export type { KeyIdKind, KeyIdProps } from './key-id';
|
|
16
|
+
export { Dot, LivePulse, StatusRail } from './status-rail';
|
|
17
|
+
export type { StatusRailChip, StatusRailItem, StatusRailProps } from './status-rail';
|
|
18
|
+
export { ThresholdGauge, gaugeBand } from './threshold-gauge';
|
|
19
|
+
export type { GaugeBand, GaugeDirection, GaugeEdges, GaugeFormat, GaugeThresholds, ThresholdGaugeProps } from './threshold-gauge';
|
|
20
|
+
export { DelinquencyAging } from './delinquency-aging';
|
|
21
|
+
export type { DelinquencyAgingProps, DelinquencyBucket } from './delinquency-aging';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,QAAQ,EACR,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,cAAc,EACf,MAAM,UAAU,CAAA;AACjB,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC/C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC/C,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE9D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACzD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAExE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErD,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1D,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,EAChB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7D,YAAY,EACV,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,eAAe,EACf,mBAAmB,EACpB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,YAAY,EACV,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Owned by lane domain — see docs/plans/2026-08-26-sindarian-x-retirement/
|
|
3
|
+
//
|
|
4
|
+
// The finance domain grammar absorbed from @lerianstudio/sindarian-x@0.15.0.
|
|
5
|
+
// Exports are NAMED (never `export *`) on purpose: the port census freezes the
|
|
6
|
+
// public surface to exactly the symbols the four migrating apps import, and the
|
|
7
|
+
// money-math internals (`toMinor`, `Amount`, `sumMinor`, `formatMoneyParts`,
|
|
8
|
+
// `maskKeyId`, `AgingBuckets`, …) stay module-private so they never become an
|
|
9
|
+
// API this package has to keep.
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.DelinquencyAging = exports.gaugeBand = exports.ThresholdGauge = exports.StatusRail = exports.LivePulse = exports.Dot = exports.KeyId = exports.LedgerSheet = exports.LedgerPanel = exports.BlotterRow = exports.Blotter = exports.SectionLabel = exports.Figure = exports.FIGURE_CLASS = exports.MoneyText = exports.moneyDiff = exports.toPercentValue = exports.humanizeDurationMs = exports.formatPercent = exports.formatCount = exports.NO_VALUE = void 0;
|
|
12
|
+
var format_1 = require("./format");
|
|
13
|
+
Object.defineProperty(exports, "NO_VALUE", { enumerable: true, get: function () { return format_1.NO_VALUE; } });
|
|
14
|
+
Object.defineProperty(exports, "formatCount", { enumerable: true, get: function () { return format_1.formatCount; } });
|
|
15
|
+
Object.defineProperty(exports, "formatPercent", { enumerable: true, get: function () { return format_1.formatPercent; } });
|
|
16
|
+
Object.defineProperty(exports, "humanizeDurationMs", { enumerable: true, get: function () { return format_1.humanizeDurationMs; } });
|
|
17
|
+
Object.defineProperty(exports, "toPercentValue", { enumerable: true, get: function () { return format_1.toPercentValue; } });
|
|
18
|
+
var money_diff_1 = require("./money-diff");
|
|
19
|
+
Object.defineProperty(exports, "moneyDiff", { enumerable: true, get: function () { return money_diff_1.moneyDiff; } });
|
|
20
|
+
var money_text_1 = require("./money-text");
|
|
21
|
+
Object.defineProperty(exports, "MoneyText", { enumerable: true, get: function () { return money_text_1.MoneyText; } });
|
|
22
|
+
var figure_1 = require("./figure");
|
|
23
|
+
Object.defineProperty(exports, "FIGURE_CLASS", { enumerable: true, get: function () { return figure_1.FIGURE_CLASS; } });
|
|
24
|
+
Object.defineProperty(exports, "Figure", { enumerable: true, get: function () { return figure_1.Figure; } });
|
|
25
|
+
var section_label_1 = require("./section-label");
|
|
26
|
+
Object.defineProperty(exports, "SectionLabel", { enumerable: true, get: function () { return section_label_1.SectionLabel; } });
|
|
27
|
+
var blotter_1 = require("./blotter");
|
|
28
|
+
Object.defineProperty(exports, "Blotter", { enumerable: true, get: function () { return blotter_1.Blotter; } });
|
|
29
|
+
Object.defineProperty(exports, "BlotterRow", { enumerable: true, get: function () { return blotter_1.BlotterRow; } });
|
|
30
|
+
var ledger_sheet_1 = require("./ledger-sheet");
|
|
31
|
+
Object.defineProperty(exports, "LedgerPanel", { enumerable: true, get: function () { return ledger_sheet_1.LedgerPanel; } });
|
|
32
|
+
Object.defineProperty(exports, "LedgerSheet", { enumerable: true, get: function () { return ledger_sheet_1.LedgerSheet; } });
|
|
33
|
+
var key_id_1 = require("./key-id");
|
|
34
|
+
Object.defineProperty(exports, "KeyId", { enumerable: true, get: function () { return key_id_1.KeyId; } });
|
|
35
|
+
var status_rail_1 = require("./status-rail");
|
|
36
|
+
Object.defineProperty(exports, "Dot", { enumerable: true, get: function () { return status_rail_1.Dot; } });
|
|
37
|
+
Object.defineProperty(exports, "LivePulse", { enumerable: true, get: function () { return status_rail_1.LivePulse; } });
|
|
38
|
+
Object.defineProperty(exports, "StatusRail", { enumerable: true, get: function () { return status_rail_1.StatusRail; } });
|
|
39
|
+
var threshold_gauge_1 = require("./threshold-gauge");
|
|
40
|
+
Object.defineProperty(exports, "ThresholdGauge", { enumerable: true, get: function () { return threshold_gauge_1.ThresholdGauge; } });
|
|
41
|
+
Object.defineProperty(exports, "gaugeBand", { enumerable: true, get: function () { return threshold_gauge_1.gaugeBand; } });
|
|
42
|
+
var delinquency_aging_1 = require("./delinquency-aging");
|
|
43
|
+
Object.defineProperty(exports, "DelinquencyAging", { enumerable: true, get: function () { return delinquency_aging_1.DelinquencyAging; } });
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type KeyIdKind = 'pix-cpf' | 'pix-cnpj' | 'pix-email' | 'pix-phone' | 'pix-evp' | 'e2e' | 'idempotency' | 'generic';
|
|
2
|
+
export interface KeyIdProps {
|
|
3
|
+
value: string;
|
|
4
|
+
/** What the value is. Drives the mask shape and the default mask state. */
|
|
5
|
+
kind?: KeyIdKind;
|
|
6
|
+
/** Optional uppercase tag rendered before the value (e.g. 'Payer', 'E2E'). */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Override the per-kind mask default. PII kinds default true, ids default false. */
|
|
9
|
+
mask?: boolean;
|
|
10
|
+
/** Show a button that copies the RAW (unmasked) value to the clipboard. */
|
|
11
|
+
copyable?: boolean;
|
|
12
|
+
/** BCP 47 locale — reserved for future locale-aware id formatting. */
|
|
13
|
+
locale?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Whether a kind masks by default (PII) — used when `mask` is not supplied.
|
|
17
|
+
* Internal: exported for its unit tests, never from `src/domain/index.ts`. */
|
|
18
|
+
export declare function masksByDefault(kind: KeyIdKind): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Mask a key for display. PII kinds get a structured mask that reveals a
|
|
21
|
+
* non-identifying middle and dots the rest; a value MALFORMED for its kind is
|
|
22
|
+
* redacted outright (see `redactPii`) rather than truncated, so a mask can never
|
|
23
|
+
* fall through to the raw secret. Id-shaped kinds are always middle-truncated
|
|
24
|
+
* (long, not secret). The copy path never uses this — it always sends the raw
|
|
25
|
+
* value.
|
|
26
|
+
*
|
|
27
|
+
* Internal: exported for its unit tests, never from `src/domain/index.ts`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function maskKeyId(value: string, kind: KeyIdKind): string;
|
|
30
|
+
export declare function KeyId({ value, kind, label, mask, copyable, className }: KeyIdProps): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/key-id/index.tsx"],"names":[],"mappings":"AA2BA,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,UAAU,GACV,WAAW,GACX,WAAW,GACX,SAAS,GACT,KAAK,GACL,aAAa,GACb,SAAS,CAAA;AAEb,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,2EAA2E;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qFAAqF;IACrF,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAeD;+EAC+E;AAC/E,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAEvD;AAiED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAahE;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,IAAgB,EAChB,KAAK,EACL,IAAI,EACJ,QAAgB,EAChB,SAAS,EACV,EAAE,UAAU,+BAsBZ"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.masksByDefault = masksByDefault;
|
|
5
|
+
exports.maskKeyId = maskKeyId;
|
|
6
|
+
exports.KeyId = KeyId;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
/**
|
|
9
|
+
* KeyId — a masked, copyable, traceable identifier for Brazilian rails: a Pix
|
|
10
|
+
* key (CPF / CNPJ / email / phone / EVP-random), an End-to-End id (E2E), an
|
|
11
|
+
* idempotency key, or a generic id.
|
|
12
|
+
*
|
|
13
|
+
* Two jobs at once. PII keys (CPF/CNPJ/email/phone) are masked by default so a
|
|
14
|
+
* shared screen or a screenshot doesn't leak a person's document or contact —
|
|
15
|
+
* the middle of a document is revealed, the identifying head/tail is dotted.
|
|
16
|
+
* Long-but-not-secret ids (EVP/E2E/idempotency/generic) are merely truncated in
|
|
17
|
+
* the MIDDLE so the head and tail — the parts an operator eyeballs against a
|
|
18
|
+
* log — stay legible.
|
|
19
|
+
*
|
|
20
|
+
* <KeyId value="529.982.247-25" kind="pix-cpf" label="Payer" copyable />
|
|
21
|
+
* <KeyId value="E32074158202406211200abc123def456" kind="e2e" copyable />
|
|
22
|
+
*
|
|
23
|
+
* The copy button always lifts the RAW, unmasked value to the clipboard — the
|
|
24
|
+
* mask is a display concern, never a data one. The masked render and the copy
|
|
25
|
+
* affordance are what make this a client component.
|
|
26
|
+
*/
|
|
27
|
+
const lucide_react_1 = require("lucide-react");
|
|
28
|
+
const react_1 = require("react");
|
|
29
|
+
const typography_1 = require("../../lib/typography");
|
|
30
|
+
const utils_1 = require("../../lib/utils");
|
|
31
|
+
/** The dot used to redact a character. A bullet, not an asterisk: it reads as
|
|
32
|
+
* "hidden" without looking like a password field's shouting. */
|
|
33
|
+
const DOT = '•';
|
|
34
|
+
/** Kinds that carry PII and are masked by default. The id-shaped kinds are long
|
|
35
|
+
* but not secret, so they default to revealed (just truncated). */
|
|
36
|
+
const PII_KINDS = new Set([
|
|
37
|
+
'pix-cpf',
|
|
38
|
+
'pix-cnpj',
|
|
39
|
+
'pix-email',
|
|
40
|
+
'pix-phone'
|
|
41
|
+
]);
|
|
42
|
+
/** Whether a kind masks by default (PII) — used when `mask` is not supplied.
|
|
43
|
+
* Internal: exported for its unit tests, never from `src/domain/index.ts`. */
|
|
44
|
+
function masksByDefault(kind) {
|
|
45
|
+
return PII_KINDS.has(kind);
|
|
46
|
+
}
|
|
47
|
+
/** Keep only the digits — Brazilian documents arrive punctuated or bare. */
|
|
48
|
+
function digitsOf(value) {
|
|
49
|
+
return value.replace(/\D/g, '');
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Truncate the MIDDLE of a long value, keeping a head and tail so an operator
|
|
53
|
+
* can eyeball it against a log. Short values are returned whole.
|
|
54
|
+
*/
|
|
55
|
+
function truncateMiddle(value, head = 6, tail = 4) {
|
|
56
|
+
if (value.length <= head + tail + 1)
|
|
57
|
+
return value;
|
|
58
|
+
return `${value.slice(0, head)}…${value.slice(-tail)}`;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The fallback for a PII value that is MALFORMED for its kind. It must not be
|
|
62
|
+
* `truncateMiddle`: a short malformed value (a CPF missing a digit, a hand-typed
|
|
63
|
+
* document, a name-shaped email that failed the `@` check) is returned WHOLE by
|
|
64
|
+
* truncation, so the "masked" render leaks the very PII the mask exists to hide.
|
|
65
|
+
* A fixed-width dot run reveals nothing — not the content, not even the length.
|
|
66
|
+
*
|
|
67
|
+
* DELIBERATE DIVERGENCE from sindarian-x@0.15.0, which truncated instead. It
|
|
68
|
+
* costs the operator the ability to eyeball a malformed document against a log;
|
|
69
|
+
* that is the correct trade, because the alternative is a screenshot with a real
|
|
70
|
+
* CPF in it. An operator who needs the value passes `mask={false}` explicitly.
|
|
71
|
+
*/
|
|
72
|
+
function redactPii() {
|
|
73
|
+
return DOT.repeat(6);
|
|
74
|
+
}
|
|
75
|
+
/** Mask all but the central block of a digit string, then re-punctuate it. */
|
|
76
|
+
function maskCpf(value) {
|
|
77
|
+
const d = digitsOf(value);
|
|
78
|
+
if (d.length !== 11)
|
|
79
|
+
return redactPii();
|
|
80
|
+
// Reveal the middle two blocks (456.789), dot the leading block and check digits.
|
|
81
|
+
return `${DOT.repeat(3)}.${d.slice(3, 6)}.${d.slice(6, 9)}-${DOT.repeat(2)}`;
|
|
82
|
+
}
|
|
83
|
+
function maskCnpj(value) {
|
|
84
|
+
const d = digitsOf(value);
|
|
85
|
+
if (d.length !== 14)
|
|
86
|
+
return redactPii();
|
|
87
|
+
// Reveal the central registration blocks, dot the head and the check digits.
|
|
88
|
+
return `${DOT.repeat(2)}.${d.slice(2, 5)}.${d.slice(5, 8)}/${d.slice(8, 12)}-${DOT.repeat(2)}`;
|
|
89
|
+
}
|
|
90
|
+
function maskEmail(value) {
|
|
91
|
+
const at = value.indexOf('@');
|
|
92
|
+
if (at <= 0 || at === value.length - 1)
|
|
93
|
+
return redactPii();
|
|
94
|
+
const first = value.slice(0, 1);
|
|
95
|
+
const domain = value.slice(at + 1);
|
|
96
|
+
return `${first}${DOT.repeat(3)}@${domain}`;
|
|
97
|
+
}
|
|
98
|
+
function maskPhone(value) {
|
|
99
|
+
const d = digitsOf(value);
|
|
100
|
+
// Expect a BR mobile in E.164-ish form: 55 + 2-digit area + 9 subscriber digits.
|
|
101
|
+
if (d.length !== 13 || !d.startsWith('55'))
|
|
102
|
+
return redactPii();
|
|
103
|
+
const area = d.slice(2, 4);
|
|
104
|
+
const last2 = d.slice(-2);
|
|
105
|
+
// Keep country + area, reveal the last two, dot the rest of the subscriber run.
|
|
106
|
+
return `+55 (${area}) ${DOT.repeat(5)}-${DOT.repeat(2)}${last2}`;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Mask a key for display. PII kinds get a structured mask that reveals a
|
|
110
|
+
* non-identifying middle and dots the rest; a value MALFORMED for its kind is
|
|
111
|
+
* redacted outright (see `redactPii`) rather than truncated, so a mask can never
|
|
112
|
+
* fall through to the raw secret. Id-shaped kinds are always middle-truncated
|
|
113
|
+
* (long, not secret). The copy path never uses this — it always sends the raw
|
|
114
|
+
* value.
|
|
115
|
+
*
|
|
116
|
+
* Internal: exported for its unit tests, never from `src/domain/index.ts`.
|
|
117
|
+
*/
|
|
118
|
+
function maskKeyId(value, kind) {
|
|
119
|
+
switch (kind) {
|
|
120
|
+
case 'pix-cpf':
|
|
121
|
+
return maskCpf(value);
|
|
122
|
+
case 'pix-cnpj':
|
|
123
|
+
return maskCnpj(value);
|
|
124
|
+
case 'pix-email':
|
|
125
|
+
return maskEmail(value);
|
|
126
|
+
case 'pix-phone':
|
|
127
|
+
return maskPhone(value);
|
|
128
|
+
default:
|
|
129
|
+
return truncateMiddle(value);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function KeyId({ value, kind = 'generic', label, mask, copyable = false, className }) {
|
|
133
|
+
const masked = mask ?? masksByDefault(kind);
|
|
134
|
+
const display = masked ? maskKeyId(value, kind) : truncateMiddle(value);
|
|
135
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, utils_1.cn)('inline-flex min-w-0 items-center gap-2', className), children: [label ? ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(typography_1.LABEL_VOICE_CLASS, 'shrink-0'), children: label })) : null, (0, jsx_runtime_1.jsx)("span", { className: "text-foreground truncate font-mono text-xs tabular-nums",
|
|
136
|
+
// The raw value as a tooltip only when nothing is hidden — never leak a
|
|
137
|
+
// masked PII value through the title attribute.
|
|
138
|
+
title: masked ? undefined : value, children: display }), copyable ? (0, jsx_runtime_1.jsx)(CopyValue, { value: value }) : null] }));
|
|
139
|
+
}
|
|
140
|
+
/** The copy affordance: lifts the RAW value to the clipboard and flips to a
|
|
141
|
+
* check for a beat. The transient confirmation is announced for assistive tech;
|
|
142
|
+
* the icon is paired with a text aria-label so the state isn't color-only. */
|
|
143
|
+
function CopyValue({ value }) {
|
|
144
|
+
const [copied, setCopied] = (0, react_1.useState)(false);
|
|
145
|
+
const copy = () => {
|
|
146
|
+
// ponytail: best-effort clipboard write — no toast, no error surface. The
|
|
147
|
+
// ceiling is silent failure in an insecure context (clipboard unavailable);
|
|
148
|
+
// upgrade path is to lift a result up via an onCopy callback when a caller
|
|
149
|
+
// needs to react.
|
|
150
|
+
//
|
|
151
|
+
// The rejection handler is NOT optional: `writeText` rejects on a denied
|
|
152
|
+
// permission or a non-secure context, and an unhandled rejection in a render
|
|
153
|
+
// tree is a console error at best and a crashed handler at worst. On failure
|
|
154
|
+
// the button simply does not flip to the copied state, so the operator sees
|
|
155
|
+
// that nothing was copied rather than a false confirmation.
|
|
156
|
+
void navigator.clipboard
|
|
157
|
+
?.writeText(value)
|
|
158
|
+
.then(() => {
|
|
159
|
+
setCopied(true);
|
|
160
|
+
setTimeout(() => setCopied(false), 1500);
|
|
161
|
+
})
|
|
162
|
+
.catch(() => {
|
|
163
|
+
setCopied(false);
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: copy, "aria-label": copied ? 'Copiado para a área de transferência' : 'Copiar valor', className: "text-muted-foreground hover:text-foreground focus:ring-ring inline-flex size-5 shrink-0 items-center justify-center rounded-sm transition-colors duration-150 ease-out focus:ring-2 focus:outline-none", children: copied ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Check, { "aria-hidden": true, className: "text-system-success size-3" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { "aria-hidden": true, className: "size-3" })) }));
|
|
167
|
+
}
|