@code-sherpas/pharos-tokens 1.2.0 → 1.3.0
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/README.md +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/styles.css +2 -1
- package/dist/tokens.d.ts +3 -1
- package/dist/tokens.js +2 -1
- package/dist/tokens.json +2 -1
- package/package.json +1 -1
- package/src/color.tokens.json +5 -0
- package/src/layout.tokens.json +1 -1
package/README.md
CHANGED
|
@@ -95,6 +95,8 @@ See [the rules for consumers](https://app.notion.com/p/4071751eee1081b2b000e212c
|
|
|
95
95
|
| Width | `width.panel` | Widths by role. `panel`: Sheet and SidePanel (24rem). |
|
|
96
96
|
| Breakpoint | `breakpoint.{compact,panel}` | By role (D32), read in JS. `compact`: a phone, < 40rem. |
|
|
97
97
|
|
|
98
|
+
`color.semantic.warning.border` is the warning amber for borders and bars, such as the side bar of a warning Alert: it clears WCAG 3:1 non-text contrast on `surface.card` and `surface.canvas`, where the amber `warning.fg` is a fill and does not. It is not for text.
|
|
99
|
+
|
|
98
100
|
## Contributing
|
|
99
101
|
|
|
100
102
|
1. `pnpm install`
|
|
@@ -104,7 +106,7 @@ See [the rules for consumers](https://app.notion.com/p/4071751eee1081b2b000e212c
|
|
|
104
106
|
5. `pnpm changeset` — declare the type of change (patch / minor / major).
|
|
105
107
|
6. Open a PR.
|
|
106
108
|
|
|
107
|
-
CI validates WCAG 2.1 AA contrast on every color/on-color pair. A PR cannot be merged if it breaks contrast.
|
|
109
|
+
CI validates WCAG 2.1 AA contrast on every color/on-color pair, and 3:1 non-text contrast for the border tokens on the surfaces they sit on. A PR cannot be merged if it breaks contrast.
|
|
108
110
|
|
|
109
111
|
## License
|
|
110
112
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -52,7 +52,8 @@ export const tokens = {
|
|
|
52
52
|
"warning": {
|
|
53
53
|
"fg": "oklch(77.77% 0.1588 90.66)",
|
|
54
54
|
"bg": "oklch(77.77% 0.1588 90.66 / 0.063)",
|
|
55
|
-
"on": "oklch(20.50% 0.02 248.83)"
|
|
55
|
+
"on": "oklch(20.50% 0.02 248.83)",
|
|
56
|
+
"border": "oklch(62% 0.128 80)"
|
|
56
57
|
},
|
|
57
58
|
"info": {
|
|
58
59
|
"fg": "oklch(52% 0.133 246)",
|
package/dist/styles.css
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
--pharos-color-semantic-error-bg: oklch(54% 0.22 27.48 / 0.063); /** System state only: tinted error background (fg at 6.3%). */
|
|
35
35
|
--pharos-color-semantic-warning-fg: oklch(77.77% 0.1588 90.66); /** System state only: warning fill and warning text colour; pair with semantic-warning-on on the fill (WCAG AA). */
|
|
36
36
|
--pharos-color-semantic-warning-bg: oklch(77.77% 0.1588 90.66 / 0.063); /** System state only: tinted warning background (fg at 6.3%). */
|
|
37
|
+
--pharos-color-semantic-warning-border: oklch(62% 0.128 80); /** System state only: the warning amber for borders and bars (#AE7C02), such as the side bar of a warning Alert. Clears WCAG 3:1 non-text contrast on surface-card (3.69:1) and surface-canvas (3.53:1), where semantic-warning-fg does not (2.03:1 and 1.94:1). Not for text. */
|
|
37
38
|
--pharos-color-semantic-info-fg: oklch(52% 0.133 246); /** System state only: info fill and info text colour; pair with semantic-info-on on the fill (WCAG AA). #026DB0 — chroma clamped to the sRGB gamut edge. */
|
|
38
39
|
--pharos-color-semantic-info-bg: oklch(52% 0.133 246 / 0.063); /** System state only: tinted info background (fg at 6.3%). */
|
|
39
40
|
--pharos-color-paper-50: oklch(99.4% 0.003 70); /** Warm paper #FEFDFB — all but white, a spark of warmth. Fill: hover rows, zebra banding, the faintest lift off white (surface-sunken). Never a border. */
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
--pharos-color-accent-terracotta-800: oklch(42.00% 0.1020 42.5); /** Press step of a terracotta fill (#79371A). */
|
|
54
55
|
--pharos-color-accent-terracotta-900: oklch(33.00% 0.0770 42.5); /** Deep text on a terracotta tint (#552612). */
|
|
55
56
|
--pharos-width-panel: 24rem; /** Width of an edge-docked panel: Sheet, and SidePanel inline or modal. Cap it at the viewport (min(var(--pharos-width-panel), 100vw)). */
|
|
56
|
-
--pharos-breakpoint-compact: 40rem; /** The compact width, a phone's: below it the viewport is compact, the only test for 'phone' in Pharos (Material 3's compact window)
|
|
57
|
+
--pharos-breakpoint-compact: 40rem; /** The compact width, a phone's: below it the viewport is compact, the only test for 'phone' in Pharos (Material 3's compact window). Read it in JS (matchMedia) — a custom property does not work inside @media. */
|
|
57
58
|
--pharos-breakpoint-panel: 64rem; /** Viewport width from which a SidePanel sits inline beside the content and narrows it; below it, the panel opens as a modal Sheet. Read it in JS (matchMedia) — a custom property does not work inside @media. */
|
|
58
59
|
--pharos-radius-none: 0; /** Square corners. */
|
|
59
60
|
--pharos-radius-sm: 0.125rem; /** 2px — small marks, code chips. */
|
package/dist/tokens.d.ts
CHANGED
|
@@ -70,6 +70,8 @@ export const PharosColorSemanticWarningFg: string;
|
|
|
70
70
|
export const PharosColorSemanticWarningBg: string;
|
|
71
71
|
/** Dark text on a semantic-warning-fg (amber) fill. */
|
|
72
72
|
export const PharosColorSemanticWarningOn: string;
|
|
73
|
+
/** System state only: the warning amber for borders and bars (#AE7C02), such as the side bar of a warning Alert. Clears WCAG 3:1 non-text contrast on surface-card (3.69:1) and surface-canvas (3.53:1), where semantic-warning-fg does not (2.03:1 and 1.94:1). Not for text. */
|
|
74
|
+
export const PharosColorSemanticWarningBorder: string;
|
|
73
75
|
/** System state only: info fill and info text colour; pair with semantic-info-on on the fill (WCAG AA). #026DB0 — chroma clamped to the sRGB gamut edge. */
|
|
74
76
|
export const PharosColorSemanticInfoFg: string;
|
|
75
77
|
/** System state only: tinted info background (fg at 6.3%). */
|
|
@@ -126,7 +128,7 @@ export const PharosColorAccentTerracottaBg: string;
|
|
|
126
128
|
export const PharosColorAccentTerracottaOn: string;
|
|
127
129
|
/** Width of an edge-docked panel: Sheet, and SidePanel inline or modal. Cap it at the viewport (min(var(--pharos-width-panel), 100vw)). */
|
|
128
130
|
export const PharosWidthPanel: string;
|
|
129
|
-
/** The compact width, a phone's: below it the viewport is compact, the only test for 'phone' in Pharos (Material 3's compact window)
|
|
131
|
+
/** The compact width, a phone's: below it the viewport is compact, the only test for 'phone' in Pharos (Material 3's compact window). Read it in JS (matchMedia) — a custom property does not work inside @media. */
|
|
130
132
|
export const PharosBreakpointCompact: string;
|
|
131
133
|
/** Viewport width from which a SidePanel sits inline beside the content and narrows it; below it, the panel opens as a modal Sheet. Read it in JS (matchMedia) — a custom property does not work inside @media. */
|
|
132
134
|
export const PharosBreakpointPanel: string;
|
package/dist/tokens.js
CHANGED
|
@@ -37,6 +37,7 @@ export const PharosColorSemanticWarningFg = "oklch(77.77% 0.1588 90.66)"; // Sys
|
|
|
37
37
|
export const PharosColorSemanticWarningBg =
|
|
38
38
|
"oklch(77.77% 0.1588 90.66 / 0.063)"; // System state only: tinted warning background (fg at 6.3%).
|
|
39
39
|
export const PharosColorSemanticWarningOn = "oklch(20.50% 0.02 248.83)"; // Dark text on a semantic-warning-fg (amber) fill.
|
|
40
|
+
export const PharosColorSemanticWarningBorder = "oklch(62% 0.128 80)"; // System state only: the warning amber for borders and bars (#AE7C02), such as the side bar of a warning Alert. Clears WCAG 3:1 non-text contrast on surface-card (3.69:1) and surface-canvas (3.53:1), where semantic-warning-fg does not (2.03:1 and 1.94:1). Not for text.
|
|
40
41
|
export const PharosColorSemanticInfoFg = "oklch(52% 0.133 246)"; // System state only: info fill and info text colour; pair with semantic-info-on on the fill (WCAG AA). #026DB0 — chroma clamped to the sRGB gamut edge.
|
|
41
42
|
export const PharosColorSemanticInfoBg = "oklch(52% 0.133 246 / 0.063)"; // System state only: tinted info background (fg at 6.3%).
|
|
42
43
|
export const PharosColorSemanticInfoOn = "oklch(100% 0 0)"; // Text and icons on a semantic-info-fg fill.
|
|
@@ -65,7 +66,7 @@ export const PharosColorAccentTerracottaFg = "oklch(51.60% 0.1261 40.7)"; // Acc
|
|
|
65
66
|
export const PharosColorAccentTerracottaBg = "oklch(96.50% 0.0160 42.5)"; // Tint surface for warm-accent blocks on white (→ terracotta-50).
|
|
66
67
|
export const PharosColorAccentTerracottaOn = "oklch(100% 0 0)"; // Text on a solid terracotta mark (use on 700 for small text).
|
|
67
68
|
export const PharosWidthPanel = "24rem"; // Width of an edge-docked panel: Sheet, and SidePanel inline or modal. Cap it at the viewport (min(var(--pharos-width-panel), 100vw)).
|
|
68
|
-
export const PharosBreakpointCompact = "40rem"; // The compact width, a phone's: below it the viewport is compact, the only test for 'phone' in Pharos (Material 3's compact window)
|
|
69
|
+
export const PharosBreakpointCompact = "40rem"; // The compact width, a phone's: below it the viewport is compact, the only test for 'phone' in Pharos (Material 3's compact window). Read it in JS (matchMedia) — a custom property does not work inside @media.
|
|
69
70
|
export const PharosBreakpointPanel = "64rem"; // Viewport width from which a SidePanel sits inline beside the content and narrows it; below it, the panel opens as a modal Sheet. Read it in JS (matchMedia) — a custom property does not work inside @media.
|
|
70
71
|
export const PharosRadiusNone = "0"; // Square corners.
|
|
71
72
|
export const PharosRadiusSm = "0.125rem"; // 2px — small marks, code chips.
|
package/dist/tokens.json
CHANGED
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
"warning": {
|
|
46
46
|
"fg": "oklch(77.77% 0.1588 90.66)",
|
|
47
47
|
"bg": "oklch(77.77% 0.1588 90.66 / 0.063)",
|
|
48
|
-
"on": "oklch(20.50% 0.02 248.83)"
|
|
48
|
+
"on": "oklch(20.50% 0.02 248.83)",
|
|
49
|
+
"border": "oklch(62% 0.128 80)"
|
|
49
50
|
},
|
|
50
51
|
"info": {
|
|
51
52
|
"fg": "oklch(52% 0.133 246)",
|
package/package.json
CHANGED
package/src/color.tokens.json
CHANGED
|
@@ -181,6 +181,11 @@
|
|
|
181
181
|
"$value": "{color.neutral.900}",
|
|
182
182
|
"$type": "color",
|
|
183
183
|
"$description": "Dark text on a semantic-warning-fg (amber) fill."
|
|
184
|
+
},
|
|
185
|
+
"border": {
|
|
186
|
+
"$value": "oklch(62% 0.128 80)",
|
|
187
|
+
"$type": "color",
|
|
188
|
+
"$description": "System state only: the warning amber for borders and bars (#AE7C02), such as the side bar of a warning Alert. Clears WCAG 3:1 non-text contrast on surface-card (3.69:1) and surface-canvas (3.53:1), where semantic-warning-fg does not (2.03:1 and 1.94:1). Not for text."
|
|
184
189
|
}
|
|
185
190
|
},
|
|
186
191
|
"info": {
|
package/src/layout.tokens.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"compact": {
|
|
11
11
|
"$value": "40rem",
|
|
12
12
|
"$type": "dimension",
|
|
13
|
-
"$description": "The compact width, a phone's: below it the viewport is compact, the only test for 'phone' in Pharos (Material 3's compact window)
|
|
13
|
+
"$description": "The compact width, a phone's: below it the viewport is compact, the only test for 'phone' in Pharos (Material 3's compact window). Read it in JS (matchMedia) — a custom property does not work inside @media."
|
|
14
14
|
},
|
|
15
15
|
"panel": {
|
|
16
16
|
"$value": "64rem",
|