@lerianstudio/sindarian-ui 1.4.0-beta.7 → 1.4.0-beta.8
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/money-text/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/money-text/index.tsx"],"names":[],"mappings":"AAgCA,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,CAiDjD;AAED,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,QAAQ,EACR,cAAkB,EAClB,YAAoB,EACpB,SAAgB,EAChB,MAAM,EACN,SAAS,EACV,EAAE,cAAc,+BA8BhB"}
|
|
@@ -14,15 +14,23 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
14
14
|
* preserve that guarantee.
|
|
15
15
|
*
|
|
16
16
|
* The currency code is shown as a suffix rather than a symbol so mixed-currency
|
|
17
|
-
* ledgers stay unambiguous. Negative amounts get the
|
|
17
|
+
* ledgers stay unambiguous. Negative amounts get the error sign color;
|
|
18
18
|
* null/undefined/empty render the muted no-value placeholder.
|
|
19
19
|
*
|
|
20
|
-
* SIGN COLOR IS NOT THE CREDIT ROLE.
|
|
20
|
+
* SIGN COLOR IS NOT THE CREDIT ROLE. The sign ink marks a negative/alarm
|
|
21
21
|
* amount; `--credit` is the accounting reading of a credit amount. They are two
|
|
22
22
|
* roles, and a consumer layers the credit role on top (matcher's fork passes
|
|
23
23
|
* `signColor={false}` with `tone="credit"` precisely so the two never fight).
|
|
24
|
-
* Collapsing the sign color into `text-credit` would erase that distinction
|
|
25
|
-
*
|
|
24
|
+
* Collapsing the sign color into `text-credit` would erase that distinction.
|
|
25
|
+
*
|
|
26
|
+
* THE SIGN INK IS THE `system-error` H1A INK, not `--destructive`. A signed
|
|
27
|
+
* amount is TEXT, so it answers to WCAG AA on whatever surface holds it, and
|
|
28
|
+
* `--destructive` is a FILL family (buttons, badges, tinted chips) whose dark
|
|
29
|
+
* value reads 3.80:1 as ink on `--card`, an axe finding on a live console.
|
|
30
|
+
* `--system-error-h1a` is the error INK of the same family and reads 8.28:1
|
|
31
|
+
* light / 7.12:1 dark on that surface. `__tests__/tokens-contract.test.ts`
|
|
32
|
+
* re-measures whichever token this line applies, so the pairing is measured
|
|
33
|
+
* rather than trusted.
|
|
26
34
|
*/
|
|
27
35
|
const utils_1 = require("../../lib/utils");
|
|
28
36
|
const format_1 = require("../format");
|
|
@@ -111,5 +119,5 @@ function MoneyText({ amount, currency, fractionDigits = 2, hideCurrency = false,
|
|
|
111
119
|
if (result === null)
|
|
112
120
|
return noValue;
|
|
113
121
|
const { formatted, negative } = result;
|
|
114
|
-
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, utils_1.cn)('tabular-nums', signColor && negative && 'text-
|
|
122
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: (0, utils_1.cn)('tabular-nums', signColor && negative && 'text-system-error-h1a', className), children: [formatted, !hideCurrency && currency ? ((0, jsx_runtime_1.jsx)("span", { className: "text-muted-foreground ml-1 text-xs", children: currency })) : null] }));
|
|
115
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/money-text/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domain/money-text/index.tsx"],"names":[],"mappings":"AAgCA,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,CAiDjD;AAED,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,QAAQ,EACR,cAAkB,EAClB,YAAoB,EACpB,SAAgB,EAChB,MAAM,EACN,SAAS,EACV,EAAE,cAAc,+BA8BhB"}
|
|
@@ -9,15 +9,23 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
* preserve that guarantee.
|
|
10
10
|
*
|
|
11
11
|
* The currency code is shown as a suffix rather than a symbol so mixed-currency
|
|
12
|
-
* ledgers stay unambiguous. Negative amounts get the
|
|
12
|
+
* ledgers stay unambiguous. Negative amounts get the error sign color;
|
|
13
13
|
* null/undefined/empty render the muted no-value placeholder.
|
|
14
14
|
*
|
|
15
|
-
* SIGN COLOR IS NOT THE CREDIT ROLE.
|
|
15
|
+
* SIGN COLOR IS NOT THE CREDIT ROLE. The sign ink marks a negative/alarm
|
|
16
16
|
* amount; `--credit` is the accounting reading of a credit amount. They are two
|
|
17
17
|
* roles, and a consumer layers the credit role on top (matcher's fork passes
|
|
18
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
|
-
*
|
|
19
|
+
* Collapsing the sign color into `text-credit` would erase that distinction.
|
|
20
|
+
*
|
|
21
|
+
* THE SIGN INK IS THE `system-error` H1A INK, not `--destructive`. A signed
|
|
22
|
+
* amount is TEXT, so it answers to WCAG AA on whatever surface holds it, and
|
|
23
|
+
* `--destructive` is a FILL family (buttons, badges, tinted chips) whose dark
|
|
24
|
+
* value reads 3.80:1 as ink on `--card`, an axe finding on a live console.
|
|
25
|
+
* `--system-error-h1a` is the error INK of the same family and reads 8.28:1
|
|
26
|
+
* light / 7.12:1 dark on that surface. `__tests__/tokens-contract.test.ts`
|
|
27
|
+
* re-measures whichever token this line applies, so the pairing is measured
|
|
28
|
+
* rather than trusted.
|
|
21
29
|
*/
|
|
22
30
|
import { cn } from '../../lib/utils.js';
|
|
23
31
|
import { NO_VALUE, isValidDigitCount, safeLocale } from '../format.js';
|
|
@@ -106,5 +114,5 @@ export function MoneyText({ amount, currency, fractionDigits = 2, hideCurrency =
|
|
|
106
114
|
if (result === null)
|
|
107
115
|
return noValue;
|
|
108
116
|
const { formatted, negative } = result;
|
|
109
|
-
return (_jsxs("span", { className: cn('tabular-nums', signColor && negative && 'text-
|
|
117
|
+
return (_jsxs("span", { className: cn('tabular-nums', signColor && negative && 'text-system-error-h1a', className), children: [formatted, !hideCurrency && currency ? (_jsx("span", { className: "text-muted-foreground ml-1 text-xs", children: currency })) : null] }));
|
|
110
118
|
}
|