@lerianstudio/sindarian-ui 1.2.0-beta.14 → 1.2.0-beta.15
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/components/form/radio-group-field/index.d.ts +1 -1
- package/dist/components/form/radio-group-field/index.d.ts.map +1 -1
- package/dist/components/form/radio-group-field/index.js +8 -1
- package/dist/components/ui/alert-dialog/index.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog/index.js +1 -1
- package/dist/components/ui/copy-field/index.d.ts.map +1 -1
- package/dist/components/ui/copy-field/index.js +6 -1
- package/dist/components/ui/file-upload/index.d.ts.map +1 -1
- package/dist/components/ui/file-upload/index.js +8 -1
- package/dist/domain/delinquency-aging/aging-buckets.d.ts +22 -2
- package/dist/domain/delinquency-aging/aging-buckets.d.ts.map +1 -1
- package/dist/domain/delinquency-aging/aging-buckets.js +17 -4
- package/dist/domain/delinquency-aging/index.d.ts +17 -2
- package/dist/domain/delinquency-aging/index.d.ts.map +1 -1
- package/dist/domain/delinquency-aging/index.js +4 -2
- package/dist/domain/index.d.ts +2 -1
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/money-diff.d.ts +9 -4
- package/dist/domain/money-diff.d.ts.map +1 -1
- package/dist/domain/section-label/index.d.ts +3 -3
- package/dist/domain/section-label/index.d.ts.map +1 -1
- package/dist/domain/section-label/index.js +6 -2
- package/dist/domain/status-rail/index.d.ts.map +1 -1
- package/dist/domain/status-rail/index.js +9 -1
- package/dist/domain/threshold-gauge/index.d.ts.map +1 -1
- package/dist/domain/threshold-gauge/index.js +1 -1
- package/dist/enterprise/date-range-picker/index.d.ts.map +1 -1
- package/dist/enterprise/date-range-picker/index.js +28 -10
- package/dist/enterprise/search-input/index.d.ts.map +1 -1
- package/dist/enterprise/search-input/index.js +13 -6
- package/dist/enterprise/use-is-mobile.d.ts +13 -4
- package/dist/enterprise/use-is-mobile.d.ts.map +1 -1
- package/dist/enterprise/use-is-mobile.js +15 -6
- package/dist/esm/components/form/radio-group-field/index.d.ts +1 -1
- package/dist/esm/components/form/radio-group-field/index.d.ts.map +1 -1
- package/dist/esm/components/form/radio-group-field/index.js +8 -1
- package/dist/esm/components/ui/alert-dialog/index.d.ts.map +1 -1
- package/dist/esm/components/ui/alert-dialog/index.js +1 -1
- package/dist/esm/components/ui/copy-field/index.d.ts.map +1 -1
- package/dist/esm/components/ui/copy-field/index.js +6 -1
- package/dist/esm/components/ui/file-upload/index.d.ts.map +1 -1
- package/dist/esm/components/ui/file-upload/index.js +8 -1
- package/dist/esm/domain/delinquency-aging/aging-buckets.d.ts +22 -2
- package/dist/esm/domain/delinquency-aging/aging-buckets.d.ts.map +1 -1
- package/dist/esm/domain/delinquency-aging/aging-buckets.js +17 -4
- package/dist/esm/domain/delinquency-aging/index.d.ts +17 -2
- package/dist/esm/domain/delinquency-aging/index.d.ts.map +1 -1
- package/dist/esm/domain/delinquency-aging/index.js +4 -2
- package/dist/esm/domain/index.d.ts +2 -1
- package/dist/esm/domain/index.d.ts.map +1 -1
- package/dist/esm/domain/money-diff.d.ts +9 -4
- package/dist/esm/domain/money-diff.d.ts.map +1 -1
- package/dist/esm/domain/section-label/index.d.ts +3 -3
- package/dist/esm/domain/section-label/index.d.ts.map +1 -1
- package/dist/esm/domain/section-label/index.js +6 -2
- package/dist/esm/domain/status-rail/index.d.ts.map +1 -1
- package/dist/esm/domain/status-rail/index.js +9 -1
- package/dist/esm/domain/threshold-gauge/index.d.ts.map +1 -1
- package/dist/esm/domain/threshold-gauge/index.js +1 -1
- package/dist/esm/enterprise/date-range-picker/index.d.ts.map +1 -1
- package/dist/esm/enterprise/date-range-picker/index.js +29 -11
- package/dist/esm/enterprise/search-input/index.d.ts.map +1 -1
- package/dist/esm/enterprise/search-input/index.js +13 -6
- package/dist/esm/enterprise/use-is-mobile.d.ts +13 -4
- package/dist/esm/enterprise/use-is-mobile.d.ts.map +1 -1
- package/dist/esm/enterprise/use-is-mobile.js +13 -5
- package/dist/esm/theme/theme-provider.d.ts.map +1 -1
- package/dist/esm/theme/theme-provider.js +15 -1
- package/dist/theme/theme-provider.d.ts.map +1 -1
- package/dist/theme/theme-provider.js +15 -1
- package/package.json +1 -1
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
/** The one breakpoint the hook subscribes at. Exported so its tests can bind to
|
|
2
|
+
* it instead of re-stating the number. */
|
|
3
|
+
export declare const MOBILE_BREAKPOINT = 768;
|
|
1
4
|
/**
|
|
2
5
|
* True while the viewport is narrower than the 768px mobile breakpoint.
|
|
3
6
|
*
|
|
4
7
|
* Always false on the FIRST render, server and client alike, so a narrow
|
|
5
|
-
* viewport can never produce a hydration mismatch
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* viewport can never produce a hydration mismatch. The correction lands in a
|
|
9
|
+
* `useEffect`, which runs AFTER the browser paints: on a narrow viewport the
|
|
10
|
+
* first painted frame therefore shows the desktop branch and the mobile branch
|
|
11
|
+
* appears on the next frame. That one frame is the deliberate price of
|
|
12
|
+
* hydration safety — a layout effect would remove it but would also change the
|
|
13
|
+
* render timing every existing consumer is built on.
|
|
14
|
+
*
|
|
15
|
+
* Every reading comes from the media query itself rather than a mix of
|
|
16
|
+
* `matchMedia` and `window.innerWidth`, so the initial value and the change
|
|
17
|
+
* events can never disagree at the breakpoint boundary.
|
|
9
18
|
*/
|
|
10
19
|
export declare function useIsMobile(): boolean;
|
|
11
20
|
//# sourceMappingURL=use-is-mobile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-is-mobile.d.ts","sourceRoot":"","sources":["../../src/enterprise/use-is-mobile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-is-mobile.d.ts","sourceRoot":"","sources":["../../src/enterprise/use-is-mobile.ts"],"names":[],"mappings":"AAIA;2CAC2C;AAC3C,eAAO,MAAM,iBAAiB,MAAM,CAAA;AAEpC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,YAY1B"}
|
|
@@ -34,22 +34,31 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.MOBILE_BREAKPOINT = void 0;
|
|
37
38
|
exports.useIsMobile = useIsMobile;
|
|
38
39
|
const React = __importStar(require("react"));
|
|
39
|
-
|
|
40
|
+
/** The one breakpoint the hook subscribes at. Exported so its tests can bind to
|
|
41
|
+
* it instead of re-stating the number. */
|
|
42
|
+
exports.MOBILE_BREAKPOINT = 768;
|
|
40
43
|
/**
|
|
41
44
|
* True while the viewport is narrower than the 768px mobile breakpoint.
|
|
42
45
|
*
|
|
43
46
|
* Always false on the FIRST render, server and client alike, so a narrow
|
|
44
|
-
* viewport can never produce a hydration mismatch
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
47
|
+
* viewport can never produce a hydration mismatch. The correction lands in a
|
|
48
|
+
* `useEffect`, which runs AFTER the browser paints: on a narrow viewport the
|
|
49
|
+
* first painted frame therefore shows the desktop branch and the mobile branch
|
|
50
|
+
* appears on the next frame. That one frame is the deliberate price of
|
|
51
|
+
* hydration safety — a layout effect would remove it but would also change the
|
|
52
|
+
* render timing every existing consumer is built on.
|
|
53
|
+
*
|
|
54
|
+
* Every reading comes from the media query itself rather than a mix of
|
|
55
|
+
* `matchMedia` and `window.innerWidth`, so the initial value and the change
|
|
56
|
+
* events can never disagree at the breakpoint boundary.
|
|
48
57
|
*/
|
|
49
58
|
function useIsMobile() {
|
|
50
59
|
const [isMobile, setIsMobile] = React.useState(false);
|
|
51
60
|
React.useEffect(() => {
|
|
52
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
61
|
+
const mql = window.matchMedia(`(max-width: ${exports.MOBILE_BREAKPOINT - 1}px)`);
|
|
53
62
|
const onChange = () => setIsMobile(mql.matches);
|
|
54
63
|
onChange();
|
|
55
64
|
mql.addEventListener('change', onChange);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/radio-group-field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/radio-group-field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAa5D,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,oCAAoC,CAAA;AAE3C,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,KAAK,uBAAuB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI;IAClE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;IACnB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;IACb,OAAO,EAAE,qBAAqB,EAAE,CAAA;IAChC,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAClE,uBAAuB,CAAC,CAAC,CAAC,GACxB,CACI;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAC1C,CAAA;AAEL,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,0GAUlE,oBAAoB,CAAC,CAAC,CAAC,gCA4EzB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from 'react';
|
|
3
4
|
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormTooltip } from '../../../components/ui/form.js';
|
|
4
5
|
import { Label } from '../../../components/ui/label/index.js';
|
|
5
6
|
import { RadioGroup, RadioGroupItem } from '../../../components/ui/radio-group/index.js';
|
|
@@ -9,6 +10,12 @@ export const RadioGroupField = ({ control, name, options, label, description, to
|
|
|
9
10
|
// An empty or whitespace-only aria-label is worse than none: it names the
|
|
10
11
|
// control "". Drop it so the attribute never reaches the DOM.
|
|
11
12
|
const ariaLabel = ariaLabelProp?.trim() ? ariaLabelProp : undefined;
|
|
13
|
+
// `FormLabel` names its control through `htmlFor`, which only works on a
|
|
14
|
+
// labelable element — and the Radix radiogroup root is a plain div. So the
|
|
15
|
+
// visible label reached nobody: a screen-reader user landing on the group
|
|
16
|
+
// heard the options and no field name. The group points BACK at the label
|
|
17
|
+
// instead, via aria-labelledby on a stable generated id.
|
|
18
|
+
const labelId = useId();
|
|
12
19
|
// The type cannot rule out `label=""`, so this is the only signal a developer
|
|
13
20
|
// gets that the control shipped nameless.
|
|
14
21
|
if (process.env.NODE_ENV !== 'production' && !showLabel && !ariaLabel) {
|
|
@@ -18,7 +25,7 @@ export const RadioGroupField = ({ control, name, options, label, description, to
|
|
|
18
25
|
// RadioGroup root is a plain div, so the ref goes on the first option a user
|
|
19
26
|
// could actually reach — a disabled radio is not focusable.
|
|
20
27
|
const focusTargetIndex = options.findIndex((option) => !option.disabled);
|
|
21
|
-
return (_jsx(FormField, { control: control, name: name, render: ({ field }) => (_jsxs(FormItem, { required: required, children: [showLabel && (_jsx(FormLabel, { extra: tooltip ? _jsx(FormTooltip, { children: tooltip }) : undefined, children: label })), _jsx(FormControl, { children: _jsx(RadioGroup, { name: field.name, value: field.value ?? '', onValueChange: field.onChange, onBlur: field.onBlur, disabled: disabled, "aria-label": ariaLabel, className: "gap-2", children: options.map((option, index) => {
|
|
28
|
+
return (_jsx(FormField, { control: control, name: name, render: ({ field }) => (_jsxs(FormItem, { required: required, children: [showLabel && (_jsx(FormLabel, { id: labelId, extra: tooltip ? _jsx(FormTooltip, { children: tooltip }) : undefined, children: label })), _jsx(FormControl, { children: _jsx(RadioGroup, { name: field.name, value: field.value ?? '', onValueChange: field.onChange, onBlur: field.onBlur, disabled: disabled, "aria-labelledby": showLabel ? labelId : undefined, "aria-label": showLabel ? undefined : ariaLabel, className: "gap-2", children: options.map((option, index) => {
|
|
22
29
|
const id = `${name}-${option.value}`;
|
|
23
30
|
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(RadioGroupItem, { ref: index === focusTargetIndex ? field.ref : undefined, value: option.value, id: id, disabled: option.disabled }), _jsx(Label, { htmlFor: id, className: "font-normal", children: option.label })] }, option.value));
|
|
24
31
|
}) }) }), _jsx(FormMessage, {}), description && _jsx(FormDescription, { children: description })] })) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/alert-dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAA;AAKpE,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,qBAExD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,qBAI3D;AAED,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,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AC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,GAI1D,IAAI,CACF,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,EACxD,WAAW,GAAG,YAAY,CAC3B,qBAiBF;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQ7B;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQ7B;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,qBAQzD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,WAAW,CAAC,qBAQ/D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,qBAQ1D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,qBAQ1D;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EAClB,CAAA"}
|
|
@@ -16,7 +16,7 @@ function AlertDialogOverlay({ className, ...props }) {
|
|
|
16
16
|
return (_jsx(AlertDialogPrimitive.Overlay, { "data-slot": "alert-dialog-overlay", className: cn('dialog-overlay', className), ...props }));
|
|
17
17
|
}
|
|
18
18
|
function AlertDialogContent({ className, container, forceMount, ...props }) {
|
|
19
|
-
return (_jsxs(AlertDialogPortal, { container: container, forceMount: forceMount, children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { "data-slot": "alert-dialog-content", className: cn('dialog-content', className), ...props })] }));
|
|
19
|
+
return (_jsxs(AlertDialogPortal, { container: container, forceMount: forceMount, children: [_jsx(AlertDialogOverlay, { forceMount: forceMount }), _jsx(AlertDialogPrimitive.Content, { "data-slot": "alert-dialog-content", className: cn('dialog-content', className), forceMount: forceMount, ...props })] }));
|
|
20
20
|
}
|
|
21
21
|
function AlertDialogHeader({ className, ...props }) {
|
|
22
22
|
return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn('dialog-header', className), ...props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/copy-field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAmCD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,MAAc,EACd,WAAW,EACX,WAA0B,EAC1B,SAAwB,EACxB,UAA4B,EAC5B,mBAAmB,EACpB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/copy-field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAmCD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,MAAc,EACd,WAAW,EACX,WAA0B,EAC1B,SAAwB,EACxB,UAA4B,EAC5B,mBAAmB,EACpB,EAAE,cAAc,qBA6JhB"}
|
|
@@ -105,7 +105,12 @@ export function CopyField({ value, label, masked = false, onCopyLabel, revealLab
|
|
|
105
105
|
handleFallback();
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
return (_jsxs("div", { "data-slot": "copy-field", className: "flex w-full flex-col gap-2", children: [label ? (_jsx("label", { htmlFor: inputId, className: "text-muted-foreground text-sm font-semibold", children: label })) : null, _jsxs("div", { "data-slot": "input-wrapper", className: "border-input-border focus-within:border-ring flex h-10 w-full cursor-text items-center gap-1 rounded-md border pr-1 pl-4 transition-[color,box-shadow]", children: [_jsx("input", { ref: inputRef, id: inputId, "data-slot": "input", "data-testid": "copy-field-input", type: showAsText ? 'text' : 'password', value: value, readOnly: true,
|
|
108
|
+
return (_jsxs("div", { "data-slot": "copy-field", className: "flex w-full flex-col gap-2", children: [label ? (_jsx("label", { htmlFor: inputId, className: "text-muted-foreground text-sm font-semibold", children: label })) : null, _jsxs("div", { "data-slot": "input-wrapper", className: "border-input-border focus-within:border-ring flex h-10 w-full cursor-text items-center gap-1 rounded-md border pr-1 pl-4 transition-[color,box-shadow]", children: [_jsx("input", { ref: inputRef, id: inputId, "data-slot": "input", "data-testid": "copy-field-input", type: showAsText ? 'text' : 'password', value: value, readOnly: true,
|
|
109
|
+
// This field holds secrets: TOTP manual-entry secrets, recovery
|
|
110
|
+
// codes. While masked it renders as type="password", which invites
|
|
111
|
+
// browsers and password managers to autofill it or offer to SAVE its
|
|
112
|
+
// value, and spellcheck can ship the text to a remote service.
|
|
113
|
+
autoComplete: "off", spellCheck: false, "aria-label": label ? undefined : valueLabel,
|
|
109
114
|
// `min-w-0` lets this flex item shrink below its content width so a
|
|
110
115
|
// long value (e.g. a UUID recovery code) scrolls inside the field
|
|
111
116
|
// instead of overflowing its container. No `font-mono`: the value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/file-upload/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAA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IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,GAAG,IAAI,CACN,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAEzC,MAAM,GACN,QAAQ,GACR,OAAO,GACP,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GAEX,UAAU,CACb,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C,eAAe,GAAG,IAAI,CASxB;AA8CD,eAAO,MAAM,UAAU;IAhGrB,wGAAwG;aAC/F,MAAM;IACf,0FAA0F;mBAC3E,MAAM;IACrB,iEAAiE;YACzD,gBAAgB,GAAG,IAAI;IAC/B,iGAAiG;cACvF,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI;IACnD,gHAAgH;cACtG,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI;eAC/B,OAAO;SACb,MAAM;gBACC,MAAM;qBACD,OAAO;sBACN,OAAO;yBACJ,MAAM;mBACZ,MAAM;6LA6RtB,CAAA"}
|
|
@@ -145,7 +145,14 @@ export const FileUpload = React.forwardRef(function FileUpload({ accept, maxSize
|
|
|
145
145
|
reader.readAsText(file);
|
|
146
146
|
};
|
|
147
147
|
const onInputChange = (event) => {
|
|
148
|
-
|
|
148
|
+
const file = event.target.files?.[0];
|
|
149
|
+
// Release the FileList the moment it has been read. The browser fires
|
|
150
|
+
// `change` only when the selection DIFFERS from what the input already
|
|
151
|
+
// holds, so keeping it meant re-picking the same file after a host reset
|
|
152
|
+
// (or retrying a rejected one) was silently a no-op — the picker opened,
|
|
153
|
+
// the user chose the file, and nothing happened.
|
|
154
|
+
event.target.value = '';
|
|
155
|
+
handleFile(file);
|
|
149
156
|
};
|
|
150
157
|
const onDragOver = (event) => {
|
|
151
158
|
if (disabled)
|
|
@@ -6,6 +6,25 @@ export interface AgingBucket {
|
|
|
6
6
|
/** Money total for the band. Pass a decimal STRING for lossless sums. */
|
|
7
7
|
total: string | number;
|
|
8
8
|
}
|
|
9
|
+
export type AgingBand = 'current' | 'recent' | 'aging' | 'overdue';
|
|
10
|
+
/**
|
|
11
|
+
* Overrides for the fixed pt-BR copy. Every field is optional and defaults to
|
|
12
|
+
* the current value, so a consumer that passes nothing renders exactly as
|
|
13
|
+
* before. The band words in particular are the ACCESSIBLE severity cue (the
|
|
14
|
+
* sr-only text a screen reader announces), so a consumer running in another
|
|
15
|
+
* language needs them translatable, not just the digits `locale` already
|
|
16
|
+
* covers.
|
|
17
|
+
*/
|
|
18
|
+
export interface AgingBucketsLabels {
|
|
19
|
+
/** sr-only severity word per band. Merged shallowly over the pt-BR canon. */
|
|
20
|
+
bands?: Partial<Record<AgingBand, string>>;
|
|
21
|
+
/** Caption under the count column. Defaults to "Itens". */
|
|
22
|
+
count?: string;
|
|
23
|
+
/** Caption under the money column. Defaults to "Total". */
|
|
24
|
+
total?: string;
|
|
25
|
+
/** Label of the grand-total row. Defaults to "Total geral". */
|
|
26
|
+
grandTotal?: string;
|
|
27
|
+
}
|
|
9
28
|
export interface AgingBucketsProps {
|
|
10
29
|
/** Ordered current → oldest. Order carries meaning; not reordered internally. */
|
|
11
30
|
buckets: AgingBucket[];
|
|
@@ -15,9 +34,10 @@ export interface AgingBucketsProps {
|
|
|
15
34
|
locale?: string;
|
|
16
35
|
/** Render a money-math-exact grand total row across all buckets. */
|
|
17
36
|
showTotal?: boolean;
|
|
37
|
+
/** Override the fixed pt-BR copy. Omitted fields keep their defaults. */
|
|
38
|
+
labels?: AgingBucketsLabels;
|
|
18
39
|
className?: string;
|
|
19
40
|
}
|
|
20
|
-
export type AgingBand = 'current' | 'recent' | 'aging' | 'overdue';
|
|
21
41
|
/**
|
|
22
42
|
* Resolve a bucket's severity band from its ORDINAL POSITION, not its amount —
|
|
23
43
|
* the order is the information (older = worse). The first bucket is `current`;
|
|
@@ -33,5 +53,5 @@ export declare function bucketBand(index: number, count: number): AgingBand;
|
|
|
33
53
|
* grand total. Pure: the money-math third rail, unit-tested.
|
|
34
54
|
*/
|
|
35
55
|
export declare function sumBucketTotals(buckets: AgingBucket[], scale: number): string | null;
|
|
36
|
-
export declare function AgingBuckets({ buckets, currency, locale, showTotal, className }: AgingBucketsProps): import("react").JSX.Element;
|
|
56
|
+
export declare function AgingBuckets({ buckets, currency, locale, showTotal, labels, className }: AgingBucketsProps): import("react").JSX.Element;
|
|
37
57
|
//# sourceMappingURL=aging-buckets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aging-buckets.d.ts","sourceRoot":"","sources":["../../../../src/domain/delinquency-aging/aging-buckets.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aging-buckets.d.ts","sourceRoot":"","sources":["../../../../src/domain/delinquency-aging/aging-buckets.tsx"],"names":[],"mappings":"AAyCA,MAAM,WAAW,WAAW;IAC1B,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAA;IACb,yEAAyE;IACzE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CACvB;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;AAElE;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;IAC1C,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,iFAAiF;IACjF,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,yEAAyE;IACzE,MAAM,CAAC,EAAE,kBAAkB,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AA2BD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAMlE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,EAAE,EACtB,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,IAAI,CAMf;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAiB,EACjB,MAAM,EACN,SAAS,EACV,EAAE,iBAAiB,+BAyGnB"}
|
|
@@ -22,7 +22,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
22
22
|
* grand total is shown it is summed through `money-math` integer minor units
|
|
23
23
|
* (BigInt, at the currency's CLDR scale) — never IEEE-754 — and rendered via
|
|
24
24
|
* `MoneyText`. A single unparseable bucket total poisons the sum to NO_VALUE
|
|
25
|
-
* rather than silently displaying a wrong number.
|
|
25
|
+
* rather than silently displaying a wrong number. The SAME currency scale that
|
|
26
|
+
* drives the sum is also the print scale handed to `MoneyText`, so the digits on
|
|
27
|
+
* screen are the digits that were summed — the printed total can never be a
|
|
28
|
+
* re-rounding of the computed one.
|
|
26
29
|
*
|
|
27
30
|
* Pure display: no directive, no interactivity, server-safe for RSC.
|
|
28
31
|
*/
|
|
@@ -81,12 +84,22 @@ export function sumBucketTotals(buckets, scale) {
|
|
|
81
84
|
const total = sumMinor(buckets.map((b) => b.total), scale);
|
|
82
85
|
return total === null ? null : minorToDecimal(total, scale);
|
|
83
86
|
}
|
|
84
|
-
export function AgingBuckets({ buckets, currency, locale, showTotal = false, className }) {
|
|
87
|
+
export function AgingBuckets({ buckets, currency, locale, showTotal = false, labels, className }) {
|
|
88
|
+
const countLabel = labels?.count ?? 'Itens';
|
|
89
|
+
const totalLabel = labels?.total ?? 'Total';
|
|
90
|
+
const grandTotalLabel = labels?.grandTotal ?? 'Total geral';
|
|
91
|
+
// THIRD RAIL: one scale for BOTH the arithmetic and the print. `MoneyText`
|
|
92
|
+
// defaults to 2 fraction digits, so leaving it unset printed JPY (scale 0)
|
|
93
|
+
// with two decimals the currency does not have, and re-rounded the exact BHD
|
|
94
|
+
// (scale 3) grand total `1.005` to `1.01` — a printed total that disagreed
|
|
95
|
+
// with the total that was actually summed.
|
|
85
96
|
const scale = currency ? minorDigitsOf(currency) : 2;
|
|
86
97
|
const grandTotal = showTotal ? sumBucketTotals(buckets, scale) : null;
|
|
87
98
|
return (_jsxs("div", { className: cn('flex flex-col', className), children: [_jsx("ul", { className: "flex flex-col", children: buckets.map((bucket, i) => {
|
|
88
99
|
const band = bucketBand(i, buckets.length);
|
|
89
100
|
const { Icon, tint, word } = BAND[band];
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
// Shallow merge: an unlisted band keeps its pt-BR default.
|
|
102
|
+
const bandWord = labels?.bands?.[band] ?? word;
|
|
103
|
+
return (_jsxs("li", { className: "border-border flex items-center gap-3 border-b py-2.5 last:border-b-0", children: [_jsx(Icon, { "aria-hidden": true, className: cn('size-4 shrink-0', tint) }), _jsxs("span", { className: "sr-only", children: [bandWord, ": "] }), _jsx("span", { className: cn(LABEL_VOICE_CLASS, 'text-foreground min-w-0 flex-1 tracking-normal normal-case'), children: bucket.label }), _jsxs("span", { className: "flex shrink-0 flex-col items-end leading-none", children: [_jsx(Figure, { size: "row", className: "text-foreground", children: formatCount(bucket.count, locale) }), _jsx("span", { className: cn(LABEL_VOICE_CLASS, 'mt-1'), children: countLabel })] }), _jsxs("span", { className: "flex w-32 shrink-0 flex-col items-end leading-none sm:w-40", children: [_jsx(Figure, { size: "row", className: cn(band === 'overdue' && 'text-credit'), children: _jsx(MoneyText, { amount: bucket.total, currency: currency, fractionDigits: scale, locale: locale, signColor: false }) }), _jsx("span", { className: cn(LABEL_VOICE_CLASS, 'mt-1'), children: totalLabel })] })] }, `${bucket.label}-${i}`));
|
|
104
|
+
}) }), showTotal ? (_jsxs("div", { className: "border-border flex items-center gap-3 border-t-2 pt-2.5", children: [_jsx("span", { "aria-hidden": true, className: "size-4 shrink-0" }), _jsx("span", { className: cn(LABEL_VOICE_CLASS, 'text-foreground min-w-0 flex-1'), children: grandTotalLabel }), _jsx("span", { className: "w-32 shrink-0 text-right sm:w-40", children: grandTotal === null ? (_jsx(Figure, { size: "row", className: "text-muted-foreground", children: NO_VALUE })) : (_jsx(Figure, { size: "row", className: "text-foreground font-semibold", children: _jsx(MoneyText, { amount: grandTotal, currency: currency, fractionDigits: scale, locale: locale, signColor: false }) })) })] })) : null] }));
|
|
92
105
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GaugeBand } from '../threshold-gauge/index.js';
|
|
2
|
+
import type { AgingBucket, AgingBucketsLabels } from './aging-buckets.js';
|
|
3
|
+
export type { AgingBand, AgingBucketsLabels } from './aging-buckets.js';
|
|
2
4
|
/** A bucket in the aging schedule, plus the flag that marks it past due. The
|
|
3
5
|
* `overdue` flag is what the rate's NUMERATOR sums — the caller declares which
|
|
4
6
|
* bands count as delinquent (typically every band after "current"). */
|
|
@@ -40,6 +42,19 @@ export interface DelinquencyAgingProps {
|
|
|
40
42
|
locale?: string;
|
|
41
43
|
/** Quiet caption above the rate readout. Defaults to "Inadimplência". */
|
|
42
44
|
rateLabel?: string;
|
|
45
|
+
/** sr-only rate band word per band ("Saudável" / "Elevada" / "Em estresse").
|
|
46
|
+
* Merged shallowly; an unlisted band keeps its pt-BR default. This is the
|
|
47
|
+
* ACCESSIBLE band cue, so it has to be translatable — `locale` only reaches
|
|
48
|
+
* the digits. */
|
|
49
|
+
rateBandLabels?: Partial<Record<GaugeBand, string>>;
|
|
50
|
+
/** Readout when the portfolio is empty. Defaults to "sem carteira". */
|
|
51
|
+
emptyLabel?: string;
|
|
52
|
+
/** Readout when the rate cannot be determined. Defaults to "indeterminada". */
|
|
53
|
+
indeterminateLabel?: string;
|
|
54
|
+
/** Override the fixed pt-BR copy of the distribution below (band words, the
|
|
55
|
+
* count/money captions, the grand-total row). Omitted fields keep their
|
|
56
|
+
* defaults. */
|
|
57
|
+
bucketLabels?: AgingBucketsLabels;
|
|
43
58
|
/** Warn edge for the rate band (0..1 ratio). Crossing it strictly → elevated. */
|
|
44
59
|
warn?: number;
|
|
45
60
|
/** Breach edge for the rate band (0..1 ratio). Crossing it strictly → distressed. */
|
|
@@ -48,5 +63,5 @@ export interface DelinquencyAgingProps {
|
|
|
48
63
|
showTotal?: boolean;
|
|
49
64
|
className?: string;
|
|
50
65
|
}
|
|
51
|
-
export declare function DelinquencyAging({ buckets, currency, locale, rateLabel, warn, breach, showTotal, className }: DelinquencyAgingProps): import("react").JSX.Element;
|
|
66
|
+
export declare function DelinquencyAging({ buckets, currency, locale, rateLabel, rateBandLabels, emptyLabel, indeterminateLabel, bucketLabels, warn, breach, showTotal, className }: DelinquencyAgingProps): import("react").JSX.Element;
|
|
52
67
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/delinquency-aging/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/delinquency-aging/index.tsx"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAKtE,YAAY,EAAE,SA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gB,gBAAgB,CAAC,EAC/B,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAA2B,EAC3B,cAAc,EACd,UAA2B,EAC3B,kBAAoC,EACpC,YAAY,EACZ,IAAW,EACX,MAAY,EACZ,SAAiB,EACjB,SAAS,EACV,EAAE,qBAAqB,+BAoEvB"}
|
|
@@ -125,7 +125,7 @@ const RATE_BAND = {
|
|
|
125
125
|
warn: { Icon: TriangleAlert, tint: 'text-system-alert', word: 'Elevada' },
|
|
126
126
|
breach: { Icon: AlertOctagon, tint: 'text-credit', word: 'Em estresse' }
|
|
127
127
|
};
|
|
128
|
-
export function DelinquencyAging({ buckets, currency, locale, rateLabel = 'Inadimplência', warn = 0.05, breach = 0.1, showTotal = false, className }) {
|
|
128
|
+
export function DelinquencyAging({ buckets, currency, locale, rateLabel = 'Inadimplência', rateBandLabels, emptyLabel = 'sem carteira', indeterminateLabel = 'indeterminada', bucketLabels, warn = 0.05, breach = 0.1, showTotal = false, className }) {
|
|
129
129
|
// THIRD RAIL: the rate scale and the two totals come from money-math, never
|
|
130
130
|
// float. The division below is of two exact BigInt-derived integers.
|
|
131
131
|
const scale = currency ? minorDigitsOf(currency) : 2;
|
|
@@ -139,9 +139,11 @@ export function DelinquencyAging({ buckets, currency, locale, rateLabel = 'Inadi
|
|
|
139
139
|
? gaugeBand(rate, { warn, breach }, 'higher-is-worse')
|
|
140
140
|
: 'low';
|
|
141
141
|
const { Icon, tint, word } = RATE_BAND[band];
|
|
142
|
+
// Shallow merge: an unlisted band keeps its pt-BR default.
|
|
143
|
+
const bandWord = rateBandLabels?.[band] ?? word;
|
|
142
144
|
const distressed = band === 'breach';
|
|
143
145
|
return (_jsxs("div", { className: cn('flex flex-col gap-4', className), children: [_jsxs("header", { className: "flex items-baseline justify-between gap-3", children: [_jsx(SectionLabel, { as: "span", children: rateLabel }), hasRate ? (_jsxs("span", {
|
|
144
146
|
// A distressed rate is a credit alarm: announced the moment it
|
|
145
147
|
// crosses the band, so assistive tech does not lean on the tint.
|
|
146
|
-
role: distressed ? 'alert' : undefined, 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: [
|
|
148
|
+
role: distressed ? 'alert' : undefined, 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: [bandWord, ": "] }), _jsx(Figure, { size: "row", className: tint, children: formatPercent(rate, { unit: 'ratio', locale }) })] })) : (_jsxs("span", { className: "text-muted-foreground inline-flex items-center gap-1.5", children: [_jsx("span", { className: cn(LABEL_VOICE_CLASS, 'tracking-normal normal-case'), children: indeterminate ? indeterminateLabel : emptyLabel }), _jsx(Figure, { size: "row", className: "text-muted-foreground", children: NO_VALUE })] }))] }), _jsx(AgingBuckets, { buckets: buckets, currency: currency, locale: locale, showTotal: showTotal, labels: bucketLabels })] }));
|
|
147
149
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { NO_VALUE, formatCount, formatPercent, humanizeDurationMs, toPercentValue } from './format.js';
|
|
2
2
|
export type { FormatPercentOptions, PercentUnit } from './format.js';
|
|
3
3
|
export { moneyDiff } from './money-diff.js';
|
|
4
|
+
export type { MoneyDiffInput } from './money-diff.js';
|
|
4
5
|
export { MoneyText } from './money-text/index.js';
|
|
5
6
|
export type { MoneyTextProps } from './money-text/index.js';
|
|
6
7
|
export { FIGURE_CLASS, Figure } from './figure/index.js';
|
|
@@ -18,5 +19,5 @@ export type { StatusRailChip, StatusRailItem, StatusRailProps } from './status-r
|
|
|
18
19
|
export { ThresholdGauge, gaugeBand } from './threshold-gauge/index.js';
|
|
19
20
|
export type { GaugeBand, GaugeDirection, GaugeEdges, GaugeFormat, GaugeThresholds, ThresholdGaugeProps } from './threshold-gauge/index.js';
|
|
20
21
|
export { DelinquencyAging } from './delinquency-aging/index.js';
|
|
21
|
-
export type { DelinquencyAgingProps, DelinquencyBucket } from './delinquency-aging/index.js';
|
|
22
|
+
export type { AgingBand, AgingBucketsLabels, DelinquencyAgingProps, DelinquencyBucket } from './delinquency-aging/index.js';
|
|
22
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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;
|
|
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;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAElD,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,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,qBAAqB,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Amount } from './money-math.js';
|
|
2
|
-
/** The money-comparison contract: two sides, a currency, an optional tolerance.
|
|
3
|
-
type
|
|
2
|
+
/** The money-comparison contract: two sides, a currency, an optional tolerance.
|
|
3
|
+
* Exported so a consumer can name the argument type it is already passing. */
|
|
4
|
+
export type MoneyDiffInput = {
|
|
4
5
|
/** Left amount (canonical decimal string preferred for lossless math). */
|
|
5
6
|
left: Amount;
|
|
6
7
|
/** Right amount. The difference is left − right. */
|
|
@@ -12,12 +13,16 @@ type MoneyDiffInput = {
|
|
|
12
13
|
minorDigits?: number;
|
|
13
14
|
/** Absolute tolerance in MAJOR units. `|left − right| > tolerance` is a breach. */
|
|
14
15
|
tolerance?: Amount;
|
|
15
|
-
/** BCP 47 locale
|
|
16
|
+
/** BCP 47 locale. CURRENTLY UNUSED: `moneyDiff` returns `{ decimal, breach }`
|
|
17
|
+
* and formats nothing, so this value has no effect on the result. It stays in
|
|
18
|
+
* the contract because removing it would break every consumer that passes it
|
|
19
|
+
* (an object literal with an unknown member is an excess-property error), and
|
|
20
|
+
* because the formatting side of the pair — `MoneyText` — takes a locale of
|
|
21
|
+
* its own. Pass the locale THERE, at the point the figure is rendered. */
|
|
16
22
|
locale?: string;
|
|
17
23
|
};
|
|
18
24
|
export declare function moneyDiff(money: MoneyDiffInput): {
|
|
19
25
|
decimal: string | null;
|
|
20
26
|
breach: boolean;
|
|
21
27
|
};
|
|
22
|
-
export {};
|
|
23
28
|
//# sourceMappingURL=money-diff.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"money-diff.d.ts","sourceRoot":"","sources":["../../../src/domain/money-diff.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C
|
|
1
|
+
{"version":3,"file":"money-diff.d.ts","sourceRoot":"","sources":["../../../src/domain/money-diff.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C;+EAC+E;AAC/E,MAAM,MAAM,cAAc,GAAG;IAC3B,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAA;IACZ,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAA;IAChB;iFAC6E;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;+EAK2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG;IAChD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,OAAO,CAAA;CAChB,CA6BA"}
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
* Renders an `<h2>` by default (the ledger-sheet cell heading), but `as` lets
|
|
11
11
|
* it become a `<p>`/`<span>`/`<dt>` for captions and inline labels.
|
|
12
12
|
*/
|
|
13
|
-
import type { ElementType, ReactNode } from 'react';
|
|
13
|
+
import type { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
14
14
|
export type SectionLabelProps = {
|
|
15
15
|
children: ReactNode;
|
|
16
16
|
className?: string;
|
|
17
17
|
/** Render element. Defaults to `h2` (the ledger-sheet cell heading). */
|
|
18
18
|
as?: ElementType;
|
|
19
|
-
}
|
|
20
|
-
export declare function SectionLabel({ children, className, as: Tag }: SectionLabelProps): import("react").JSX.Element;
|
|
19
|
+
} & Omit<HTMLAttributes<HTMLElement>, 'children' | 'className'>;
|
|
20
|
+
export declare function SectionLabel({ children, className, as: Tag, ...rest }: SectionLabelProps): import("react").JSX.Element;
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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;
|
|
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,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKnE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wEAAwE;IACxE,EAAE,CAAC,EAAE,WAAW,CAAA;CACjB,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC,CAAA;AAE/D,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,EAAE,EAAE,GAAU,EACd,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAUnB"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { SECTION_LABEL_CLASS } from '../../lib/typography.js';
|
|
3
3
|
import { cn } from '../../lib/utils.js';
|
|
4
|
-
export function SectionLabel({ children, className, as: Tag = 'h2' }) {
|
|
5
|
-
|
|
4
|
+
export function SectionLabel({ children, className, as: Tag = 'h2', ...rest }) {
|
|
5
|
+
// The remaining element props reach the rendered tag, so a panel can point
|
|
6
|
+
// `aria-labelledby` at this heading via `id`, and tests can hang a `data-*`
|
|
7
|
+
// hook off it. Without the spread there was no way to reference the heading
|
|
8
|
+
// from its own container.
|
|
9
|
+
return (_jsx(Tag, { className: cn(SECTION_LABEL_CLASS, className), ...rest, children: children }));
|
|
6
10
|
}
|
|
@@ -1 +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,+
|
|
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,+BAwEjB;AAkBD,qFAAqF;AACrF,wBAAgB,GAAG,gCAMlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,gCAOxB"}
|
|
@@ -25,11 +25,19 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
25
25
|
import { TriangleAlert } from 'lucide-react';
|
|
26
26
|
import { cn } from '../../lib/utils.js';
|
|
27
27
|
export function StatusRail({ lead, items = [], chips = [], className }) {
|
|
28
|
+
// ONE test, used by both the lead span and the first item's separator. Two
|
|
29
|
+
// separate tests (`lead !== undefined && lead !== null` vs `lead != null`)
|
|
30
|
+
// agreed on null/undefined and diverged on a ReactNode that RENDERS NOTHING,
|
|
31
|
+
// which produced an empty lead span while the first item still got its
|
|
32
|
+
// leading dot — the rail opened with a stray `·`. React renders BOTH booleans
|
|
33
|
+
// as nothing, so `true` is as empty as `false`; the typeof check covers the
|
|
34
|
+
// pair rather than naming one of them.
|
|
35
|
+
const hasLead = lead != null && lead !== '' && typeof lead !== 'boolean';
|
|
28
36
|
return (_jsxs("div", { className: cn(
|
|
29
37
|
// Recessed instrument strip: the page surface inside a hairline border
|
|
30
38
|
// whose top edge runs one step darker — light-from-above recession
|
|
31
39
|
// 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: [
|
|
40
|
+
'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: [hasLead ? (_jsx("span", { className: "text-foreground font-medium", children: lead })) : null, items.map((item, i) => (_jsx(RailFragment, { hasLead: hasLead || 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
41
|
// Tiny mono token: raised a hair off the sunken tape by the
|
|
34
42
|
// card surface + whisper shadow.
|
|
35
43
|
'inline-flex items-center gap-1 rounded-sm border px-1.5 py-0.5 shadow-sm', chip.alarm
|
|
@@ -1 +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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5 +149,5 @@ export function ThresholdGauge({ value, displayValue, min = 0, max, warn, breach
|
|
|
149
149
|
const valuePct = trackFraction(value, min, max) * 100;
|
|
150
150
|
const warnPct = trackFraction(warn, min, max) * 100;
|
|
151
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}%` } })] })] }));
|
|
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": Number.isFinite(value) ? value : undefined, "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
153
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/date-range-picker/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/enterprise/date-range-picker/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAUnD;;;;GAIG;AACH,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAA;AAE/D,MAAM,MAAM,cAAc,GAAG;IAC3B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,cAAc,CAAA;IACrB,aAAa,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAA;IAC7C,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,OAAO,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB,CAAA;AAkCD,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,aAAa,EACb,MAAM,EACN,IAAI,EACJ,SAAS,EACT,OAAO,EACP,OAAe,EACf,OAAO,EACP,WAAwB,EACxB,SAA+B,EAC/B,UAAoB,EACpB,MAAa,EACd,EAAE,oBAAoB,+BAiHtB"}
|