@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,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* money-math — exact integer-minor-unit arithmetic for the double-entry third rail.
|
|
3
|
+
*
|
|
4
|
+
* INTERNAL to the domain layer: nothing here is re-exported from
|
|
5
|
+
* `src/domain/index.ts`, so `toMinor`/`Amount`/`sumMinor` are NOT part of
|
|
6
|
+
* `@lerianstudio/sindarian-ui`'s public API. The consumers that need exact money
|
|
7
|
+
* arithmetic reach it through the components that own it (`moneyDiff`,
|
|
8
|
+
* `MoneyText`, `DelinquencyAging`).
|
|
9
|
+
*
|
|
10
|
+
* Amounts parse to integer minor units (BigInt) at a fixed scale; sums never
|
|
11
|
+
* round-trip through IEEE-754. Pass amounts as canonical decimal STRINGS for
|
|
12
|
+
* lossless math — numbers are converted via toFixed, which is float-bounded
|
|
13
|
+
* (fine for display-scale magnitudes, exact for strings).
|
|
14
|
+
*/
|
|
15
|
+
import { isValidDigitCount } from './format.js';
|
|
16
|
+
// Round half-away-from-zero on the first dropped fraction digit.
|
|
17
|
+
function roundsUp(fraction, scale) {
|
|
18
|
+
return fraction.length > scale && fraction.charCodeAt(scale) - 48 >= 5;
|
|
19
|
+
}
|
|
20
|
+
/** Normalize to a canonical signed decimal: trim, unicode-minus, accounting parens. */
|
|
21
|
+
function canonical(raw) {
|
|
22
|
+
let s = raw.trim().replace(/−/g, '-');
|
|
23
|
+
if (/^\(.*\)$/.test(s))
|
|
24
|
+
s = '-' + s.slice(1, -1).trim(); // (1.23) -> -1.23
|
|
25
|
+
return s;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Amount -> integer minor units at `scale`, or null if unparseable.
|
|
29
|
+
*
|
|
30
|
+
* `scale` is validated before it reaches `toFixed`/`repeat`: an out-of-range
|
|
31
|
+
* scale (a caller passing `minorDigits: -1`) would throw a RangeError mid-render
|
|
32
|
+
* rather than degrade. It is the single choke point every money path in this
|
|
33
|
+
* layer routes through (`sumMinor`, `moneyDiff`, `delinquencyRate`,
|
|
34
|
+
* `sumBucketTotals`), so guarding it here guards all of them.
|
|
35
|
+
*/
|
|
36
|
+
export function toMinor(value, scale) {
|
|
37
|
+
if (!isValidDigitCount(scale))
|
|
38
|
+
return null;
|
|
39
|
+
if (value === null || value === undefined || value === '')
|
|
40
|
+
return null;
|
|
41
|
+
let s = typeof value === 'number'
|
|
42
|
+
? Number.isFinite(value)
|
|
43
|
+
? value.toFixed(scale)
|
|
44
|
+
: ''
|
|
45
|
+
: canonical(value);
|
|
46
|
+
if (s === '' || s === '-' || s === '.' || !/^-?\d*(\.\d*)?$/.test(s))
|
|
47
|
+
return null;
|
|
48
|
+
const neg = s.startsWith('-');
|
|
49
|
+
if (neg)
|
|
50
|
+
s = s.slice(1);
|
|
51
|
+
const [intPart = '', fracPart = ''] = s.split('.');
|
|
52
|
+
// DELIBERATE DIVERGENCE from sindarian-x@0.15.0: the legacy regex admits a
|
|
53
|
+
// digitless token ('-.', and '.' once the sign is stripped) and coerced it to
|
|
54
|
+
// an exact 0n. A fabricated exact zero is the worst possible answer in
|
|
55
|
+
// reconciliation — it reads as a perfect tie and hides the bad input — so a
|
|
56
|
+
// digitless amount is now indeterminate (null), like every other garbage
|
|
57
|
+
// token. This mirrors the guard the legacy `rateFraction` already had.
|
|
58
|
+
if (intPart === '' && fracPart === '')
|
|
59
|
+
return null;
|
|
60
|
+
const frac = (fracPart + '0'.repeat(scale)).slice(0, scale);
|
|
61
|
+
let minor = BigInt((intPart || '0') + frac);
|
|
62
|
+
if (roundsUp(fracPart, scale))
|
|
63
|
+
minor += 1n;
|
|
64
|
+
return neg ? -minor : minor;
|
|
65
|
+
}
|
|
66
|
+
/** Sum amounts to minor units; null if ANY operand is unparseable (indeterminate). */
|
|
67
|
+
export function sumMinor(values, scale) {
|
|
68
|
+
let total = 0n;
|
|
69
|
+
for (const v of values) {
|
|
70
|
+
const m = toMinor(v, scale);
|
|
71
|
+
if (m === null)
|
|
72
|
+
return null;
|
|
73
|
+
total += m;
|
|
74
|
+
}
|
|
75
|
+
return total;
|
|
76
|
+
}
|
|
77
|
+
/** Currency's minor-unit digit count via CLDR (BRL/USD->2, JPY->0, BHD->3), or fallback. */
|
|
78
|
+
export function minorDigitsOf(currency, fallback = 2) {
|
|
79
|
+
try {
|
|
80
|
+
const opts = new Intl.NumberFormat('en', {
|
|
81
|
+
style: 'currency',
|
|
82
|
+
currency,
|
|
83
|
+
currencyDisplay: 'code'
|
|
84
|
+
}).resolvedOptions();
|
|
85
|
+
return opts.maximumFractionDigits ?? fallback;
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return fallback;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Minor units -> canonical decimal string (lossless), for handing to MoneyText. */
|
|
92
|
+
export function minorToDecimal(minor, scale) {
|
|
93
|
+
const neg = minor < 0n;
|
|
94
|
+
const abs = (neg ? -minor : minor).toString().padStart(scale + 1, '0');
|
|
95
|
+
const intPart = abs.slice(0, abs.length - scale) || '0';
|
|
96
|
+
const fracPart = scale > 0 ? '.' + abs.slice(abs.length - scale) : '';
|
|
97
|
+
return (neg ? '-' : '') + intPart + fracPart;
|
|
98
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type MoneyTextProps = {
|
|
2
|
+
amount: string | number | null | undefined;
|
|
3
|
+
/** ISO 4217 currency code, e.g. "BRL", "USD". */
|
|
4
|
+
currency?: string | null;
|
|
5
|
+
/** Number of fraction digits. Defaults to 2. */
|
|
6
|
+
fractionDigits?: number;
|
|
7
|
+
/** Hide the trailing currency code. */
|
|
8
|
+
hideCurrency?: boolean;
|
|
9
|
+
/** Color negative values red. Defaults to true. */
|
|
10
|
+
signColor?: boolean;
|
|
11
|
+
/** BCP 47 locale for grouping/decimal marks. Defaults to the runtime locale. */
|
|
12
|
+
locale?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Normalize a raw amount into a string the Intl formatter accepts while
|
|
17
|
+
* preserving precision: trim, convert the unicode minus U+2212 to ASCII '-',
|
|
18
|
+
* and rewrite accounting parens `(123.45)` → `-123.45`. Returns null when the
|
|
19
|
+
* input is empty after trimming (→ NO_VALUE upstream).
|
|
20
|
+
*
|
|
21
|
+
* Internal: exported for its unit tests, never from `src/domain/index.ts`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function normalizeAmount(amount: string | number): string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Pure money formatting: normalize the amount, format it via Intl (preserving
|
|
26
|
+
* precision through the ES2020 string overload), and derive sign + finiteness
|
|
27
|
+
* from the formatted parts — so color and glyph can never disagree. Returns
|
|
28
|
+
* null for empty, non-finite, or unparseable input (→ NO_VALUE upstream).
|
|
29
|
+
*
|
|
30
|
+
* Internal: exported for its unit tests, never from `src/domain/index.ts`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function formatMoneyParts(amount: string | number, fractionDigits: number, locale?: string): {
|
|
33
|
+
formatted: string;
|
|
34
|
+
negative: boolean;
|
|
35
|
+
} | null;
|
|
36
|
+
export declare function MoneyText({ amount, currency, fractionDigits, hideCurrency, signColor, locale, className }: MoneyTextProps): import("react").JSX.Element;
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/money-text/index.tsx"],"names":[],"mappings":"AAwBA,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IAC1C,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,gDAAgD;IAChD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,uCAAuC;IACvC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,mDAAmD;IACnD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAOtE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,cAAc,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,MAAM,GACd;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CA+CjD;AAED,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,QAAQ,EACR,cAAkB,EAClB,YAAoB,EACpB,SAAgB,EAChB,MAAM,EACN,SAAS,EACV,EAAE,cAAc,+BA8BhB"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* MoneyText renders a monetary amount with optional ISO currency code,
|
|
4
|
+
* tabular figures so columns line up. The amount is formatted losslessly: when
|
|
5
|
+
* passed as a string, `Intl.NumberFormat.format()` (ES2020+) parses it as an
|
|
6
|
+
* arbitrary-precision value and rounds to `fractionDigits` without ever
|
|
7
|
+
* round-tripping through an IEEE-754 double — so 16+ significant-digit tokens
|
|
8
|
+
* keep every digit. Pass the raw decimal string (not a pre-coerced Number) to
|
|
9
|
+
* preserve that guarantee.
|
|
10
|
+
*
|
|
11
|
+
* The currency code is shown as a suffix rather than a symbol so mixed-currency
|
|
12
|
+
* ledgers stay unambiguous. Negative amounts get the destructive color;
|
|
13
|
+
* null/undefined/empty render the muted no-value placeholder.
|
|
14
|
+
*
|
|
15
|
+
* SIGN COLOR IS NOT THE CREDIT ROLE. `--destructive` marks a negative/alarm
|
|
16
|
+
* amount; `--credit` is the accounting reading of a credit amount. They are two
|
|
17
|
+
* roles, and a consumer layers the credit role on top (matcher's fork passes
|
|
18
|
+
* `signColor={false}` with `tone="credit"` precisely so the two never fight).
|
|
19
|
+
* Collapsing the sign color into `text-credit` would erase that distinction —
|
|
20
|
+
* this class stays `text-destructive`, as in sindarian-x@0.15.0.
|
|
21
|
+
*/
|
|
22
|
+
import { cn } from '../../lib/utils.js';
|
|
23
|
+
import { NO_VALUE, isValidDigitCount } from '../format.js';
|
|
24
|
+
/**
|
|
25
|
+
* Normalize a raw amount into a string the Intl formatter accepts while
|
|
26
|
+
* preserving precision: trim, convert the unicode minus U+2212 to ASCII '-',
|
|
27
|
+
* and rewrite accounting parens `(123.45)` → `-123.45`. Returns null when the
|
|
28
|
+
* input is empty after trimming (→ NO_VALUE upstream).
|
|
29
|
+
*
|
|
30
|
+
* Internal: exported for its unit tests, never from `src/domain/index.ts`.
|
|
31
|
+
*/
|
|
32
|
+
export function normalizeAmount(amount) {
|
|
33
|
+
let s = String(amount).trim();
|
|
34
|
+
if (s === '')
|
|
35
|
+
return null;
|
|
36
|
+
s = s.replace(/−/g, '-');
|
|
37
|
+
const parens = s.match(/^\((.*)\)$/);
|
|
38
|
+
if (parens)
|
|
39
|
+
s = `-${parens[1].trim()}`;
|
|
40
|
+
return s;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Pure money formatting: normalize the amount, format it via Intl (preserving
|
|
44
|
+
* precision through the ES2020 string overload), and derive sign + finiteness
|
|
45
|
+
* from the formatted parts — so color and glyph can never disagree. Returns
|
|
46
|
+
* null for empty, non-finite, or unparseable input (→ NO_VALUE upstream).
|
|
47
|
+
*
|
|
48
|
+
* Internal: exported for its unit tests, never from `src/domain/index.ts`.
|
|
49
|
+
*/
|
|
50
|
+
export function formatMoneyParts(amount, fractionDigits, locale) {
|
|
51
|
+
// Reject non-finite numeric inputs (NaN / ±Infinity) before they reach Intl,
|
|
52
|
+
// which would otherwise render literal "NaN" / "∞".
|
|
53
|
+
if (typeof amount === 'number' && !Number.isFinite(amount))
|
|
54
|
+
return null;
|
|
55
|
+
// A caller-supplied digit count reaches Intl directly; an out-of-range one
|
|
56
|
+
// would throw a RangeError and blank the amount instead of degrading to
|
|
57
|
+
// NO_VALUE.
|
|
58
|
+
if (!isValidDigitCount(fractionDigits))
|
|
59
|
+
return null;
|
|
60
|
+
const normalized = normalizeAmount(amount);
|
|
61
|
+
if (normalized === null)
|
|
62
|
+
return null;
|
|
63
|
+
// DELIBERATE DIVERGENCE from sindarian-x@0.15.0: an exact zero written with a
|
|
64
|
+
// sign ('-0', '-0.00', '(0)') formatted as "-0.00" and reported negative:true,
|
|
65
|
+
// which painted a zero balance in the destructive sign color. Zero is neither
|
|
66
|
+
// positive nor negative — a signed-zero ledger cell is a rendering artifact of
|
|
67
|
+
// the input notation, never a fact about the money. The sign is dropped for an
|
|
68
|
+
// EXACT zero only; '-0.004' still rounds to "-0.00" and stays negative,
|
|
69
|
+
// because that one really is below zero.
|
|
70
|
+
const exactZero = /\d/.test(normalized) && /^-?0*(\.0*)?$/.test(normalized);
|
|
71
|
+
const forFormat = exactZero ? normalized.replace(/^-/, '') : normalized;
|
|
72
|
+
const formatter = new Intl.NumberFormat(locale, {
|
|
73
|
+
minimumFractionDigits: fractionDigits,
|
|
74
|
+
maximumFractionDigits: fractionDigits,
|
|
75
|
+
signDisplay: 'auto'
|
|
76
|
+
});
|
|
77
|
+
// The bundled lib types only model a `number | bigint` overload; the ES2020
|
|
78
|
+
// string overload (which preserves precision) is unmodelled, so the
|
|
79
|
+
// normalized amount is cast at the boundary.
|
|
80
|
+
//
|
|
81
|
+
// RUNTIME FLOOR: this relies on a V8 with exact decimal-STRING Intl support
|
|
82
|
+
// (Node >= 20, evergreen browsers) — the whole point is that a 20-digit amount
|
|
83
|
+
// never round-trips through an IEEE-754 double. There is deliberately NO
|
|
84
|
+
// Number-coercion fallback for older runtimes: that fallback would silently
|
|
85
|
+
// reintroduce the precision loss this function exists to prevent.
|
|
86
|
+
const parts = formatter.formatToParts(forFormat);
|
|
87
|
+
// Intl emits a literal "nan"/"∞" part for non-finite values; treat those as
|
|
88
|
+
// no-value rather than rendering them.
|
|
89
|
+
if (parts.some((p) => p.type === 'nan' || p.type === 'infinity'))
|
|
90
|
+
return null;
|
|
91
|
+
return {
|
|
92
|
+
formatted: parts.map((p) => p.value).join(''),
|
|
93
|
+
negative: parts.some((p) => p.type === 'minusSign')
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export function MoneyText({ amount, currency, fractionDigits = 2, hideCurrency = false, signColor = true, locale, className }) {
|
|
97
|
+
const noValue = (_jsx("span", { className: cn('text-muted-foreground tabular-nums', className), children: NO_VALUE }));
|
|
98
|
+
if (amount === null || amount === undefined || amount === '')
|
|
99
|
+
return noValue;
|
|
100
|
+
// Sign and finiteness are derived from the formatted parts, not a raw string
|
|
101
|
+
// prefix — so color and glyph can never disagree, and "-0" / "(0)" are
|
|
102
|
+
// treated as the non-negative zero Intl renders.
|
|
103
|
+
const result = formatMoneyParts(amount, fractionDigits, locale);
|
|
104
|
+
if (result === null)
|
|
105
|
+
return noValue;
|
|
106
|
+
const { formatted, negative } = result;
|
|
107
|
+
return (_jsxs("span", { className: cn('tabular-nums', signColor && negative && 'text-destructive', className), children: [formatted, !hideCurrency && currency ? (_jsx("span", { className: "text-muted-foreground ml-1 text-xs", children: currency })) : null] }));
|
|
108
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SectionLabel — THE canonical uppercase tracked sans label of the console.
|
|
3
|
+
*
|
|
4
|
+
* Every panel heading, section title, and caption is uppercase, tracked
|
|
5
|
+
* (0.08em) muted-foreground — the recessive foil that lets the mono figures be
|
|
6
|
+
* loud. The class itself lives in `@/lib/typography` (`SECTION_LABEL_CLASS`,
|
|
7
|
+
* an alias of `LABEL_VOICE_CLASS`) and is NEVER re-stated here, so the voice
|
|
8
|
+
* cannot drift between this component and the `ui/` layer that shares it.
|
|
9
|
+
*
|
|
10
|
+
* Renders an `<h2>` by default (the ledger-sheet cell heading), but `as` lets
|
|
11
|
+
* it become a `<p>`/`<span>`/`<dt>` for captions and inline labels.
|
|
12
|
+
*/
|
|
13
|
+
import type { ElementType, ReactNode } from 'react';
|
|
14
|
+
export type SectionLabelProps = {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Render element. Defaults to `h2` (the ledger-sheet cell heading). */
|
|
18
|
+
as?: ElementType;
|
|
19
|
+
};
|
|
20
|
+
export declare function SectionLabel({ children, className, as: Tag }: SectionLabelProps): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/section-label/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wEAAwE;IACxE,EAAE,CAAC,EAAE,WAAW,CAAA;CACjB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,EAAE,EAAE,GAAU,EACf,EAAE,iBAAiB,+BAEnB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SECTION_LABEL_CLASS } from '../../lib/typography.js';
|
|
3
|
+
import { cn } from '../../lib/utils.js';
|
|
4
|
+
export function SectionLabel({ children, className, as: Tag = 'h2' }) {
|
|
5
|
+
return _jsx(Tag, { className: cn(SECTION_LABEL_CLASS, className), children: children });
|
|
6
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type StatusRailItem = {
|
|
3
|
+
/** Optional stable key for dynamic (reordered/filtered) rails; falls back to index. */
|
|
4
|
+
id?: string;
|
|
5
|
+
/** Optional uppercase label rendered inline before the value. */
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
value: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export type StatusRailChip = {
|
|
10
|
+
/** Optional stable key for dynamic (reordered/filtered) rails; falls back to index. */
|
|
11
|
+
id?: string;
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
value: ReactNode;
|
|
14
|
+
/** Escalate the chip to destructive styling when a count is in alarm. */
|
|
15
|
+
alarm?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type StatusRailProps = {
|
|
18
|
+
/** Foreground identity token, rendered first (e.g. context name). */
|
|
19
|
+
lead?: ReactNode;
|
|
20
|
+
/** Dot-separated mono tape items. */
|
|
21
|
+
items?: StatusRailItem[];
|
|
22
|
+
/** Right-pinned count chips. */
|
|
23
|
+
chips?: StatusRailChip[];
|
|
24
|
+
className?: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function StatusRail({ lead, items, chips, className }: StatusRailProps): import("react").JSX.Element;
|
|
27
|
+
/** Decorative dot separator — muted, so the tape reads as punctuated, not broken. */
|
|
28
|
+
export declare function Dot(): import("react").JSX.Element;
|
|
29
|
+
/**
|
|
30
|
+
* The live auto-refresh pulse: a success dot with a reduced-motion-gated ping
|
|
31
|
+
* ring. Place it inside a tape item value, e.g. `<><LivePulse /> Live</>`.
|
|
32
|
+
*
|
|
33
|
+
* The ring rides Tailwind's built-in `ping` keyframe under the `motion-safe:`
|
|
34
|
+
* variant (`@media (prefers-reduced-motion: no-preference)`), so a
|
|
35
|
+
* reduced-motion reader sees only the static dot — same gating as the
|
|
36
|
+
* hand-rolled `status-rail-pulse` keyframe it replaces, with no stylesheet of
|
|
37
|
+
* its own.
|
|
38
|
+
*/
|
|
39
|
+
export declare function LivePulse(): import("react").JSX.Element;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/status-rail/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,MAAM,cAAc,GAAG;IAC3B,uFAAuF;IACvF,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,iEAAiE;IACjE,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,uFAAuF;IACvF,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,qEAAqE;IACrE,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,qCAAqC;IACrC,KAAK,CAAC,EAAE,cAAc,EAAE,CAAA;IACxB,gCAAgC;IAChC,KAAK,CAAC,EAAE,cAAc,EAAE,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,KAAU,EACV,KAAU,EACV,SAAS,EACV,EAAE,eAAe,+BA+DjB;AAkBD,qFAAqF;AACrF,wBAAgB,GAAG,gCAMlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,gCAOxB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* StatusRail — Row 0 of every console screen. A thin, full-width recessed strip
|
|
4
|
+
* that reads "the terminal is live": a dot-separated mono tape on the recessed
|
|
5
|
+
* page surface (`bg-body-surface`), with optional right-pinned count chips.
|
|
6
|
+
*
|
|
7
|
+
* <StatusRail
|
|
8
|
+
* lead={contextName}
|
|
9
|
+
* items={[
|
|
10
|
+
* { value: '90d' },
|
|
11
|
+
* { label: 'Updated', value: '12:04 UTC' },
|
|
12
|
+
* { value: <><LivePulse /> Live</> }
|
|
13
|
+
* ]}
|
|
14
|
+
* chips={[
|
|
15
|
+
* { label: 'Open', value: '12' },
|
|
16
|
+
* { label: 'Pending overdue', value: '3', alarm: true }
|
|
17
|
+
* ]}
|
|
18
|
+
* />
|
|
19
|
+
*
|
|
20
|
+
* The first token (`lead`) is `text-foreground font-medium`. Tape items are
|
|
21
|
+
* dot-separated; an item with a `label` renders the uppercase label inline
|
|
22
|
+
* before its value. Chips pin right via `ml-auto`; `alarm` escalates a chip to
|
|
23
|
+
* destructive.
|
|
24
|
+
*/
|
|
25
|
+
import { TriangleAlert } from 'lucide-react';
|
|
26
|
+
import { cn } from '../../lib/utils.js';
|
|
27
|
+
export function StatusRail({ lead, items = [], chips = [], className }) {
|
|
28
|
+
return (_jsxs("div", { className: cn(
|
|
29
|
+
// Recessed instrument strip: the page surface inside a hairline border
|
|
30
|
+
// whose top edge runs one step darker — light-from-above recession
|
|
31
|
+
// without any inner shadow.
|
|
32
|
+
'border-border border-t-foreground/10 bg-body-surface text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-lg border px-4 py-2 font-mono text-xs tabular-nums', className), children: [lead !== undefined && lead !== null ? (_jsx("span", { className: "text-foreground font-medium", children: lead })) : null, items.map((item, i) => (_jsx(RailFragment, { hasLead: lead != null || i > 0, children: item.label != null ? (_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "tracking-[0.08em] uppercase", children: item.label }), item.value] })) : (_jsx("span", { className: "flex items-center gap-1.5", children: item.value })) }, item.id ?? i))), chips.length ? (_jsx("span", { className: "ml-auto flex flex-wrap items-center gap-x-3 gap-y-1.5", children: chips.map((chip, i) => (_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx("span", { className: "tracking-[0.08em] uppercase", children: chip.label }), _jsxs("span", { className: cn(
|
|
33
|
+
// Tiny mono token: raised a hair off the sunken tape by the
|
|
34
|
+
// card surface + whisper shadow.
|
|
35
|
+
'inline-flex items-center gap-1 rounded-sm border px-1.5 py-0.5 shadow-sm', chip.alarm
|
|
36
|
+
? 'border-destructive/40 bg-destructive/10 text-destructive'
|
|
37
|
+
: 'border-border bg-card text-foreground'), children: [chip.alarm ? (_jsxs(_Fragment, { children: [_jsx(TriangleAlert, { "aria-hidden": true, className: "size-3" }), _jsx("span", { className: "sr-only", children: "(alarme)" })] })) : null, chip.value] })] }, chip.id ?? i))) })) : null] }));
|
|
38
|
+
}
|
|
39
|
+
/** A tape item preceded by a separator dot when it is not the first token. */
|
|
40
|
+
function RailFragment({ children, hasLead }) {
|
|
41
|
+
return (_jsxs(_Fragment, { children: [hasLead ? _jsx(Dot, {}) : null, children] }));
|
|
42
|
+
}
|
|
43
|
+
/** Decorative dot separator — muted, so the tape reads as punctuated, not broken. */
|
|
44
|
+
export function Dot() {
|
|
45
|
+
return (_jsx("span", { "aria-hidden": true, className: "text-muted-foreground/50", children: "\u00B7" }));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The live auto-refresh pulse: a success dot with a reduced-motion-gated ping
|
|
49
|
+
* ring. Place it inside a tape item value, e.g. `<><LivePulse /> Live</>`.
|
|
50
|
+
*
|
|
51
|
+
* The ring rides Tailwind's built-in `ping` keyframe under the `motion-safe:`
|
|
52
|
+
* variant (`@media (prefers-reduced-motion: no-preference)`), so a
|
|
53
|
+
* reduced-motion reader sees only the static dot — same gating as the
|
|
54
|
+
* hand-rolled `status-rail-pulse` keyframe it replaces, with no stylesheet of
|
|
55
|
+
* its own.
|
|
56
|
+
*/
|
|
57
|
+
export function LivePulse() {
|
|
58
|
+
return (_jsxs("span", { className: "relative flex size-2", "aria-hidden": true, children: [_jsx("span", { className: "bg-system-success/60 absolute inline-flex size-2 rounded-full motion-safe:animate-ping" }), _jsx("span", { className: "bg-system-success relative inline-flex size-2 rounded-full" })] }));
|
|
59
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export type GaugeBand = 'low' | 'warn' | 'breach';
|
|
2
|
+
/** higher-is-worse: value climbs into danger (warn < breach) — utilization.
|
|
3
|
+
* lower-is-worse: value falls into danger (breach < warn) — coverage ratio. */
|
|
4
|
+
export type GaugeDirection = 'higher-is-worse' | 'lower-is-worse';
|
|
5
|
+
/** How the numeric readout is formatted. 'ratio' is a 0..1 share shown as a
|
|
6
|
+
* percent; 'percent' is an already-scaled 0..100; 'count' a plain integer;
|
|
7
|
+
* 'money' an ISO-4217 amount via MoneyText. */
|
|
8
|
+
export type GaugeFormat = 'percent' | 'ratio' | 'count' | 'money';
|
|
9
|
+
/** Whether a value sitting exactly ON a threshold escalates.
|
|
10
|
+
* 'strict' (default) — it stays in the calmer band; escalation needs the value
|
|
11
|
+
* strictly past the edge. 'inclusive' — being ON the edge already escalates,
|
|
12
|
+
* for consumers whose enforcement is inclusive (a quota that blocks at
|
|
13
|
+
* `used >= limit`: a tenant exactly at the cap is already blocked). */
|
|
14
|
+
export type GaugeEdges = 'strict' | 'inclusive';
|
|
15
|
+
export interface GaugeThresholds {
|
|
16
|
+
/** The warn edge — crossing it escalates low → warn. */
|
|
17
|
+
warn: number;
|
|
18
|
+
/** The breach edge — crossing it escalates to breach. */
|
|
19
|
+
breach: number;
|
|
20
|
+
/** Whether a value exactly ON a threshold escalates. Defaults to 'strict'. */
|
|
21
|
+
edges?: GaugeEdges;
|
|
22
|
+
}
|
|
23
|
+
export interface ThresholdGaugeProps {
|
|
24
|
+
/** The observed value, in the same unit as `min`/`max`/`warn`/`breach`. It
|
|
25
|
+
* drives the band, the track fill and every ARIA attribute. */
|
|
26
|
+
value: number;
|
|
27
|
+
/** The figure to PRINT, when it differs from `value`. A consumer that must
|
|
28
|
+
* keep `aria-valuenow` inside [min, max] has to clamp `value` — pass the true
|
|
29
|
+
* (unclamped) figure here so the readout does not contradict the number the
|
|
30
|
+
* consumer renders beside the gauge. Band and ARIA still follow `value`.
|
|
31
|
+
* Omitted → the readout formats `value`. */
|
|
32
|
+
displayValue?: number;
|
|
33
|
+
/** Bottom of the track. Defaults to 0. */
|
|
34
|
+
min?: number;
|
|
35
|
+
/** Top of the track. */
|
|
36
|
+
max: number;
|
|
37
|
+
/** Warn edge (see `GaugeThresholds`). */
|
|
38
|
+
warn: number;
|
|
39
|
+
/** Breach edge (see `GaugeThresholds`). */
|
|
40
|
+
breach: number;
|
|
41
|
+
/** On-edge behaviour (see `GaugeEdges`). Defaults to 'strict'. */
|
|
42
|
+
edges?: GaugeEdges;
|
|
43
|
+
/** Which way is danger — mandatory, the numbers alone do not say. */
|
|
44
|
+
direction: GaugeDirection;
|
|
45
|
+
/** Numeric readout format. Defaults to 'percent'. */
|
|
46
|
+
format?: GaugeFormat;
|
|
47
|
+
/** ISO 4217 code for `format='money'`, e.g. "BRL". */
|
|
48
|
+
currency?: string;
|
|
49
|
+
/** BCP 47 locale for figure grouping/decimal marks. */
|
|
50
|
+
locale?: string;
|
|
51
|
+
/** Quiet caption above the gauge (e.g. "Utilização do limite"). */
|
|
52
|
+
label?: string;
|
|
53
|
+
/** Accessible name for the meter when no visible `label` is rendered, or when
|
|
54
|
+
* the meter needs a fuller name than the caption. A meter with no name is
|
|
55
|
+
* announced as a bare number, so this resolves `ariaLabel ?? label ?? the
|
|
56
|
+
* band word`, which is never empty. Additive — existing call sites that pass
|
|
57
|
+
* only `label` are unaffected. */
|
|
58
|
+
ariaLabel?: string;
|
|
59
|
+
/** Override the accessible band word, per band, in the consumer's own locale.
|
|
60
|
+
* Shallow-merged over the pt-BR defaults, so `{ breach: 'Limit exceeded' }`
|
|
61
|
+
* leaves low/warn untouched. The band word is the ONLY non-chromatic carrier
|
|
62
|
+
* of the band (the glyph and the tint are decorative), so a consumer serving
|
|
63
|
+
* en/es MUST be able to translate it — see WCAG 1.4.1 note above. */
|
|
64
|
+
bandLabels?: Partial<Record<GaugeBand, string>>;
|
|
65
|
+
className?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Resolve which band a value occupies. Pure — the testable heart of the atom.
|
|
69
|
+
*
|
|
70
|
+
* STRICT edges by default: a value exactly ON a threshold stays in the CALMER
|
|
71
|
+
* band; escalation needs the value strictly past.
|
|
72
|
+
*
|
|
73
|
+
* - higher-is-worse: `value > breach` → breach; `value > warn` → warn; else low.
|
|
74
|
+
* - lower-is-worse: `value < breach` → breach; `value < warn` → warn; else low.
|
|
75
|
+
*
|
|
76
|
+
* `thresholds.edges = 'inclusive'` opts into `>=` / `<=` instead, for a consumer
|
|
77
|
+
* whose enforcement is inclusive. Omitted or 'strict' → the behaviour above.
|
|
78
|
+
*
|
|
79
|
+
* Non-finite input degrades to 'low' rather than throwing — a missing reading is
|
|
80
|
+
* not, by itself, an alarm.
|
|
81
|
+
*/
|
|
82
|
+
export declare function gaugeBand(value: number, thresholds: GaugeThresholds, direction: GaugeDirection): GaugeBand;
|
|
83
|
+
export declare function ThresholdGauge({ value, displayValue, min, max, warn, breach, edges, direction, format, currency, locale, label, ariaLabel, bandLabels, className }: ThresholdGaugeProps): import("react").JSX.Element;
|
|
84
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/threshold-gauge/index.tsx"],"names":[],"mappings":"AAiDA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA;AAEjD;gFACgF;AAChF,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,gBAAgB,CAAA;AAEjE;;gDAEgD;AAChD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAEjE;;;;wEAIwE;AACxE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAA;AAE/C,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAA;IACd,8EAA8E;IAC9E,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC;oEACgE;IAChE,KAAK,EAAE,MAAM,CAAA;IACb;;;;iDAI6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAA;IACd,kEAAkE;IAClE,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,qEAAqE;IACrE,SAAS,EAAE,cAAc,CAAA;IACzB,qDAAqD;IACrD,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;uCAImC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;0EAIsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAmCD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,eAAe,EAC3B,SAAS,EAAE,cAAc,GACxB,SAAS,CAUX;AA+CD,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,YAAY,EACZ,GAAO,EACP,GAAG,EACH,IAAI,EACJ,MAAM,EACN,KAAK,EACL,SAAS,EACT,MAAkB,EAClB,QAAQ,EACR,MAAM,EACN,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACV,EAAE,mBAAmB,+BAyErB"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* ThresholdGauge — where a value sits across ordered, NAMED bands.
|
|
4
|
+
*
|
|
5
|
+
* A metric is rarely interesting in isolation; what matters is which band it has
|
|
6
|
+
* crossed. A credit utilization of 95% is a breach; a liquidity coverage ratio
|
|
7
|
+
* of 95% may be perfectly calm. So a gauge that paints a smooth red→green
|
|
8
|
+
* gradient is lying by implication — it suggests a continuum where the business
|
|
9
|
+
* has hard thresholds. This atom STATES the thresholds: it resolves the current
|
|
10
|
+
* band (low / warn / breach), names it with a glyph + an sr-only word + a tint,
|
|
11
|
+
* and marks the band edges on the bar so the reader sees the line the value
|
|
12
|
+
* crossed, not a vibe.
|
|
13
|
+
*
|
|
14
|
+
* <ThresholdGauge value={0.92} max={1} warn={0.8} breach={0.9} format="percent"
|
|
15
|
+
* direction="higher-is-worse" label="Utilização do limite" /> // breach
|
|
16
|
+
* <ThresholdGauge value={1.18} max={2} warn={1} breach={0.9} format="ratio"
|
|
17
|
+
* direction="lower-is-worse" label="Índice de cobertura" /> // low (calm)
|
|
18
|
+
*
|
|
19
|
+
* DIRECTION is mandatory because the same numbers mean opposite things:
|
|
20
|
+
* - higher-is-worse: the value climbs INTO danger (warn < breach). Utilization,
|
|
21
|
+
* concentration, error rate.
|
|
22
|
+
* - lower-is-worse: the value FALLS into danger (breach < warn). Coverage,
|
|
23
|
+
* liquidity, capital adequacy.
|
|
24
|
+
*
|
|
25
|
+
* INVARIANT (strict edges by DEFAULT): a band escalation requires the value to
|
|
26
|
+
* be STRICTLY beyond the edge. A value sitting exactly ON a threshold belongs to
|
|
27
|
+
* the calmer band, not the louder one — `gaugeBand` encodes this so an on-edge
|
|
28
|
+
* utilization of exactly the breach line still reads as warn, never a surprise
|
|
29
|
+
* breach. A consumer whose own enforcement is INCLUSIVE (a quota blocking at
|
|
30
|
+
* `used >= limit`) opts out with `edges="inclusive"`, which escalates ON the
|
|
31
|
+
* edge in both directions.
|
|
32
|
+
*
|
|
33
|
+
* The current band is the load-bearing signal and it never rides on color alone
|
|
34
|
+
* (WCAG 1.4.1): a glyph leads, an sr-only word names it, the tint only
|
|
35
|
+
* reinforces. The numeric position reads via a mono `Figure`, never inferred
|
|
36
|
+
* from the bar geometry — and a consumer forced to clamp `value` to keep
|
|
37
|
+
* `aria-valuenow` in range can still print the true figure via `displayValue`.
|
|
38
|
+
*
|
|
39
|
+
* Pure display: server-safe, no directive.
|
|
40
|
+
*/
|
|
41
|
+
import { OctagonX, ShieldCheck, TriangleAlert } from 'lucide-react';
|
|
42
|
+
import { LABEL_VOICE_CLASS } from '../../lib/typography.js';
|
|
43
|
+
import { cn } from '../../lib/utils.js';
|
|
44
|
+
import { Figure } from '../figure/index.js';
|
|
45
|
+
import { formatCount, formatPercent, NO_VALUE } from '../format.js';
|
|
46
|
+
import { MoneyText } from '../money-text/index.js';
|
|
47
|
+
/** Band → glyph + tint + accessible word. The glyph and sr-only word are the
|
|
48
|
+
* load-bearing cue; the tint only reinforces, so the band survives grayscale
|
|
49
|
+
* and color-vision deficiency. The words are pt-BR defaults — a consumer in
|
|
50
|
+
* another locale overrides them via the `bandLabels` prop. */
|
|
51
|
+
const BAND = {
|
|
52
|
+
low: {
|
|
53
|
+
Icon: ShieldCheck,
|
|
54
|
+
tint: 'text-system-success',
|
|
55
|
+
word: 'Dentro do limite'
|
|
56
|
+
},
|
|
57
|
+
warn: {
|
|
58
|
+
Icon: TriangleAlert,
|
|
59
|
+
tint: 'text-system-alert',
|
|
60
|
+
word: 'Próximo do limite'
|
|
61
|
+
},
|
|
62
|
+
breach: {
|
|
63
|
+
Icon: OctagonX,
|
|
64
|
+
tint: 'text-destructive',
|
|
65
|
+
word: 'Limite ultrapassado'
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/** Track fill tint per band — kept distinct from the glyph tint so the bar can
|
|
69
|
+
* use the softer wash while the glyph carries the full tint. */
|
|
70
|
+
const BAND_FILL = {
|
|
71
|
+
low: 'bg-system-success',
|
|
72
|
+
warn: 'bg-system-alert',
|
|
73
|
+
breach: 'bg-destructive'
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Resolve which band a value occupies. Pure — the testable heart of the atom.
|
|
77
|
+
*
|
|
78
|
+
* STRICT edges by default: a value exactly ON a threshold stays in the CALMER
|
|
79
|
+
* band; escalation needs the value strictly past.
|
|
80
|
+
*
|
|
81
|
+
* - higher-is-worse: `value > breach` → breach; `value > warn` → warn; else low.
|
|
82
|
+
* - lower-is-worse: `value < breach` → breach; `value < warn` → warn; else low.
|
|
83
|
+
*
|
|
84
|
+
* `thresholds.edges = 'inclusive'` opts into `>=` / `<=` instead, for a consumer
|
|
85
|
+
* whose enforcement is inclusive. Omitted or 'strict' → the behaviour above.
|
|
86
|
+
*
|
|
87
|
+
* Non-finite input degrades to 'low' rather than throwing — a missing reading is
|
|
88
|
+
* not, by itself, an alarm.
|
|
89
|
+
*/
|
|
90
|
+
export function gaugeBand(value, thresholds, direction) {
|
|
91
|
+
if (!Number.isFinite(value))
|
|
92
|
+
return 'low';
|
|
93
|
+
const { warn, breach, edges = 'strict' } = thresholds;
|
|
94
|
+
const beyond = direction === 'higher-is-worse'
|
|
95
|
+
? (edge) => (edges === 'inclusive' ? value >= edge : value > edge)
|
|
96
|
+
: (edge) => (edges === 'inclusive' ? value <= edge : value < edge);
|
|
97
|
+
if (beyond(breach))
|
|
98
|
+
return 'breach';
|
|
99
|
+
if (beyond(warn))
|
|
100
|
+
return 'warn';
|
|
101
|
+
return 'low';
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* An empty or whitespace-only string is not a name. `??` only skips null and
|
|
105
|
+
* undefined, so `ariaLabel=""` or `bandLabels={{ breach: '' }}` won the fallback
|
|
106
|
+
* chain and produced an EMPTY accessible name — worse than the missing one it
|
|
107
|
+
* was meant to fix, because `aria-label=""` also suppresses the element's other
|
|
108
|
+
* naming routes. Normalizing to undefined lets the chain fall through properly.
|
|
109
|
+
*/
|
|
110
|
+
function nonEmpty(value) {
|
|
111
|
+
return value != null && value.trim() !== '' ? value : undefined;
|
|
112
|
+
}
|
|
113
|
+
/** Clamp a value into [min, max] then normalize to a 0..1 fraction of the
|
|
114
|
+
* track. A zero-width track (max <= min) collapses to 0 rather than dividing by
|
|
115
|
+
* zero. */
|
|
116
|
+
function trackFraction(value, min, max) {
|
|
117
|
+
if (!Number.isFinite(value) || max <= min)
|
|
118
|
+
return 0;
|
|
119
|
+
const clamped = Math.max(min, Math.min(max, value));
|
|
120
|
+
return (clamped - min) / (max - min);
|
|
121
|
+
}
|
|
122
|
+
/** Format the value for the mono readout per `format`. Money routes through
|
|
123
|
+
* MoneyText (never a hand-rolled string); the rest through the format helpers. */
|
|
124
|
+
function readout(value, format, currency, locale) {
|
|
125
|
+
if (!Number.isFinite(value))
|
|
126
|
+
return NO_VALUE;
|
|
127
|
+
if (format === 'money') {
|
|
128
|
+
return (_jsx(MoneyText, { amount: value, currency: currency, signColor: false, locale: locale }));
|
|
129
|
+
}
|
|
130
|
+
if (format === 'percent')
|
|
131
|
+
return formatPercent(value, { unit: 'percent', locale });
|
|
132
|
+
if (format === 'ratio')
|
|
133
|
+
return formatPercent(value, { unit: 'ratio', locale });
|
|
134
|
+
return formatCount(value, locale);
|
|
135
|
+
}
|
|
136
|
+
export function ThresholdGauge({ value, displayValue, min = 0, max, warn, breach, edges, direction, format = 'percent', currency, locale, label, ariaLabel, bandLabels, className }) {
|
|
137
|
+
const band = gaugeBand(value, { warn, breach, edges }, direction);
|
|
138
|
+
const { Icon, tint } = BAND[band];
|
|
139
|
+
// The sr-only word is the band's only non-chromatic cue, so it is also the
|
|
140
|
+
// string a trilingual consumer has to translate. pt-BR default, override wins.
|
|
141
|
+
// Every rung of the naming chain is normalized: an empty override must fall
|
|
142
|
+
// through to the next source rather than win with a blank string.
|
|
143
|
+
const word = nonEmpty(bandLabels?.[band]) ?? BAND[band].word;
|
|
144
|
+
const caption = nonEmpty(label);
|
|
145
|
+
// A `role="meter"` with no accessible name is announced as a naked number.
|
|
146
|
+
// The band word is always present and always meaningful, so the meter is named
|
|
147
|
+
// even when a consumer renders the gauge without a visible caption.
|
|
148
|
+
const meterName = nonEmpty(ariaLabel) ?? caption ?? word;
|
|
149
|
+
const valuePct = trackFraction(value, min, max) * 100;
|
|
150
|
+
const warnPct = trackFraction(warn, min, max) * 100;
|
|
151
|
+
const breachPct = trackFraction(breach, min, max) * 100;
|
|
152
|
+
return (_jsxs("div", { className: cn('flex flex-col gap-2', className), children: [_jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [caption != null ? (_jsx("span", { className: LABEL_VOICE_CLASS, children: caption })) : (_jsx("span", {})), _jsxs("span", { className: cn('inline-flex items-center gap-1.5', tint), children: [_jsx(Icon, { "aria-hidden": true, className: "size-4 shrink-0" }), _jsxs("span", { className: "sr-only", children: [word, ": "] }), _jsx(Figure, { size: "row", className: tint, children: readout(displayValue ?? value, format, currency, locale) })] })] }), _jsxs("div", { role: "meter", "aria-valuenow": value, "aria-valuemin": min, "aria-valuemax": max, "aria-label": meterName, className: "border-border bg-muted relative h-2 w-full overflow-hidden rounded-full border", children: [_jsx("div", { "aria-hidden": true, className: cn('absolute inset-y-0 left-0 rounded-full', BAND_FILL[band]), style: { width: `${valuePct}%` } }), _jsx("span", { "aria-hidden": true, className: "bg-system-alert absolute inset-y-0 w-px", style: { left: `${warnPct}%` } }), _jsx("span", { "aria-hidden": true, className: "bg-destructive absolute inset-y-0 w-px", style: { left: `${breachPct}%` } })] })] }));
|
|
153
|
+
}
|