@websublime/line-utils 0.2.0 → 0.2.1-15254656ebbeae2e99f69c340fd1ad8a3f73f73d-SNAPSHOT
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/contrast.d.ts +11 -6
- package/dist/contrast.d.ts.map +1 -1
- package/dist/contrast.js +12 -7
- package/dist/contrast.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/contrast.ts +13 -7
- package/src/index.ts +1 -0
package/dist/contrast.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* WCAG AA
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* floor (which the verbatim-adopted Radix palette cannot satisfy across all 62
|
|
7
|
-
* hue × mode pairs).
|
|
2
|
+
* WCAG 2.1 AA contrast floor for non-text UI and large text, 3:1 (SC 1.4.11;
|
|
3
|
+
* SC 1.4.3 large text; spec §6.C.5). An icon on a step-9 solid, such as the
|
|
4
|
+
* IconButton `primary` glyph, needs this floor. Normal-size text needs
|
|
5
|
+
* {@link TEXT_THRESHOLD}.
|
|
8
6
|
*/
|
|
9
7
|
export declare const THRESHOLD = 3;
|
|
8
|
+
/**
|
|
9
|
+
* WCAG 2.1 AA contrast floor for normal-size text, 4.5:1 (SC 1.4.3; AM-092,
|
|
10
|
+
* spec §6.C.3, §6.C.5). `scripts/validate-contrast.mjs` requires it of every
|
|
11
|
+
* step-9 / contrast-token pair, because the Button and Chip `primary` labels
|
|
12
|
+
* are normal-size text on step 9.
|
|
13
|
+
*/
|
|
14
|
+
export declare const TEXT_THRESHOLD = 4.5;
|
|
10
15
|
/**
|
|
11
16
|
* Step 9 is the solid brand anchor a contrast token is paired against
|
|
12
17
|
* (PRD §9.6). Hard-coded rather than imported from line-schemas `STEPS` because
|
package/dist/contrast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contrast.d.ts","sourceRoot":"","sources":["../src/contrast.ts"],"names":[],"mappings":"AASA
|
|
1
|
+
{"version":3,"file":"contrast.d.ts","sourceRoot":"","sources":["../src/contrast.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B;;;;;GAKG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,UAAU,IAAI,CAAC;AAE5B;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAqBzE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMhE"}
|
package/dist/contrast.js
CHANGED
|
@@ -5,16 +5,21 @@
|
|
|
5
5
|
// source of truth: the validator imports these helpers rather than inlining its
|
|
6
6
|
// own copy (see bead line-ui-7qm.3.7). The math is ported verbatim from the
|
|
7
7
|
// former inline implementation — any float change would shift computed ratios
|
|
8
|
-
// and could
|
|
8
|
+
// and could move a step-9 pair across the validator's floor, so it must stay exact.
|
|
9
9
|
/**
|
|
10
|
-
* WCAG AA
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* floor (which the verbatim-adopted Radix palette cannot satisfy across all 62
|
|
15
|
-
* hue × mode pairs).
|
|
10
|
+
* WCAG 2.1 AA contrast floor for non-text UI and large text, 3:1 (SC 1.4.11;
|
|
11
|
+
* SC 1.4.3 large text; spec §6.C.5). An icon on a step-9 solid, such as the
|
|
12
|
+
* IconButton `primary` glyph, needs this floor. Normal-size text needs
|
|
13
|
+
* {@link TEXT_THRESHOLD}.
|
|
16
14
|
*/
|
|
17
15
|
export const THRESHOLD = 3;
|
|
16
|
+
/**
|
|
17
|
+
* WCAG 2.1 AA contrast floor for normal-size text, 4.5:1 (SC 1.4.3; AM-092,
|
|
18
|
+
* spec §6.C.3, §6.C.5). `scripts/validate-contrast.mjs` requires it of every
|
|
19
|
+
* step-9 / contrast-token pair, because the Button and Chip `primary` labels
|
|
20
|
+
* are normal-size text on step 9.
|
|
21
|
+
*/
|
|
22
|
+
export const TEXT_THRESHOLD = 4.5;
|
|
18
23
|
/**
|
|
19
24
|
* Step 9 is the solid brand anchor a contrast token is paired against
|
|
20
25
|
* (PRD §9.6). Hard-coded rather than imported from line-schemas `STEPS` because
|
package/dist/contrast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contrast.js","sourceRoot":"","sources":["../src/contrast.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,gFAAgF;AAChF,4EAA4E;AAC5E,8EAA8E;AAC9E
|
|
1
|
+
{"version":3,"file":"contrast.js","sourceRoot":"","sources":["../src/contrast.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,gFAAgF;AAChF,4EAA4E;AAC5E,8EAA8E;AAC9E,oFAAoF;AAEpF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAElC;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,G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AAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC;AACjE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,IAAY;IACtD,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAChC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAC5C,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { contrastRatio, hexToRgb, relativeLuminance, SOLID_STEP, srgbToLinear, THRESHOLD, } from './contrast.js';
|
|
1
|
+
export { contrastRatio, hexToRgb, relativeLuminance, SOLID_STEP, srgbToLinear, TEXT_THRESHOLD, THRESHOLD, } from './contrast.js';
|
|
2
2
|
export type { ColorSpace, MixOptions } from './mix.js';
|
|
3
3
|
export { mix, shade, tint, withAlpha } from './mix.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EACb,QAAQ,EACR,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EACb,QAAQ,EACR,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,cAAc,EACd,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
//
|
|
3
3
|
// This barrel re-exports the contrast and mix helper modules. Each is also
|
|
4
4
|
// available via a subpath export (`./contrast`, `./mix`) — see package.json.
|
|
5
|
-
export { contrastRatio, hexToRgb, relativeLuminance, SOLID_STEP, srgbToLinear, THRESHOLD, } from './contrast.js';
|
|
5
|
+
export { contrastRatio, hexToRgb, relativeLuminance, SOLID_STEP, srgbToLinear, TEXT_THRESHOLD, THRESHOLD, } from './contrast.js';
|
|
6
6
|
export { mix, shade, tint, withAlpha } from './mix.js';
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAE7E,OAAO,EACL,aAAa,EACb,QAAQ,EACR,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,SAAS,GACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAE7E,OAAO,EACL,aAAa,EACb,QAAQ,EACR,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,cAAc,EACd,SAAS,GACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@websublime/line-utils",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1-15254656ebbeae2e99f69c340fd1ad8a3f73f73d-SNAPSHOT",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@websublime/line-schemas": "^0.2.
|
|
34
|
+
"@websublime/line-schemas": "^0.2.1-15254656ebbeae2e99f69c340fd1ad8a3f73f73d-SNAPSHOT"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsc -b",
|
package/src/contrast.ts
CHANGED
|
@@ -5,18 +5,24 @@
|
|
|
5
5
|
// source of truth: the validator imports these helpers rather than inlining its
|
|
6
6
|
// own copy (see bead line-ui-7qm.3.7). The math is ported verbatim from the
|
|
7
7
|
// former inline implementation — any float change would shift computed ratios
|
|
8
|
-
// and could
|
|
8
|
+
// and could move a step-9 pair across the validator's floor, so it must stay exact.
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* WCAG AA
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* floor (which the verbatim-adopted Radix palette cannot satisfy across all 62
|
|
16
|
-
* hue × mode pairs).
|
|
11
|
+
* WCAG 2.1 AA contrast floor for non-text UI and large text, 3:1 (SC 1.4.11;
|
|
12
|
+
* SC 1.4.3 large text; spec §6.C.5). An icon on a step-9 solid, such as the
|
|
13
|
+
* IconButton `primary` glyph, needs this floor. Normal-size text needs
|
|
14
|
+
* {@link TEXT_THRESHOLD}.
|
|
17
15
|
*/
|
|
18
16
|
export const THRESHOLD = 3;
|
|
19
17
|
|
|
18
|
+
/**
|
|
19
|
+
* WCAG 2.1 AA contrast floor for normal-size text, 4.5:1 (SC 1.4.3; AM-092,
|
|
20
|
+
* spec §6.C.3, §6.C.5). `scripts/validate-contrast.mjs` requires it of every
|
|
21
|
+
* step-9 / contrast-token pair, because the Button and Chip `primary` labels
|
|
22
|
+
* are normal-size text on step 9.
|
|
23
|
+
*/
|
|
24
|
+
export const TEXT_THRESHOLD = 4.5;
|
|
25
|
+
|
|
20
26
|
/**
|
|
21
27
|
* Step 9 is the solid brand anchor a contrast token is paired against
|
|
22
28
|
* (PRD §9.6). Hard-coded rather than imported from line-schemas `STEPS` because
|