@code-sherpas/pharos-tokens 1.1.1 → 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 +5 -9
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/styles.css +2 -0
- package/dist/tokens.d.ts +4 -0
- package/dist/tokens.js +2 -0
- package/dist/tokens.json +3 -1
- package/package.json +1 -1
- package/src/color.tokens.json +5 -0
- package/src/layout.tokens.json +5 -0
package/README.md
CHANGED
|
@@ -64,13 +64,7 @@ const cardRadius = tokens.radius['2xl'];
|
|
|
64
64
|
|
|
65
65
|
Every token path is typed, so a renamed or removed token fails your compilation. The declarations need neither `resolveJsonModule` nor `skipLibCheck`, and compile with `moduleResolution` `bundler`, `node16` and `nodenext`.
|
|
66
66
|
|
|
67
|
-
### Option C —
|
|
68
|
-
|
|
69
|
-
```ts
|
|
70
|
-
import { PharosColorPrimary600, PharosRadius2xl } from '@code-sherpas/pharos-tokens/tokens.js';
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Option D — DTCG source (custom pipelines)
|
|
67
|
+
### Option C — DTCG source (custom pipelines)
|
|
74
68
|
|
|
75
69
|
For your own transforms (iOS, Android, Figma, etc.):
|
|
76
70
|
|
|
@@ -99,7 +93,9 @@ See [the rules for consumers](https://app.notion.com/p/4071751eee1081b2b000e212c
|
|
|
99
93
|
| Duration | `duration.{fast,normal,slow}` | Transitions. |
|
|
100
94
|
| Easing | `easing.{in,out,in-out}` | Cubic-bezier curves. |
|
|
101
95
|
| Width | `width.panel` | Widths by role. `panel`: Sheet and SidePanel (24rem). |
|
|
102
|
-
| Breakpoint | `breakpoint.panel`
|
|
96
|
+
| Breakpoint | `breakpoint.{compact,panel}` | By role (D32), read in JS. `compact`: a phone, < 40rem. |
|
|
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.
|
|
103
99
|
|
|
104
100
|
## Contributing
|
|
105
101
|
|
|
@@ -110,7 +106,7 @@ See [the rules for consumers](https://app.notion.com/p/4071751eee1081b2b000e212c
|
|
|
110
106
|
5. `pnpm changeset` — declare the type of change (patch / minor / major).
|
|
111
107
|
6. Open a PR.
|
|
112
108
|
|
|
113
|
-
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.
|
|
114
110
|
|
|
115
111
|
## License
|
|
116
112
|
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export type PharosTokens = {
|
|
|
49
49
|
"fg": string;
|
|
50
50
|
"bg": string;
|
|
51
51
|
"on": string;
|
|
52
|
+
"border": string;
|
|
52
53
|
};
|
|
53
54
|
"info": {
|
|
54
55
|
"fg": string;
|
|
@@ -97,6 +98,7 @@ export type PharosTokens = {
|
|
|
97
98
|
"panel": string;
|
|
98
99
|
};
|
|
99
100
|
"breakpoint": {
|
|
101
|
+
"compact": string;
|
|
100
102
|
"panel": string;
|
|
101
103
|
};
|
|
102
104
|
"radius": {
|
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)",
|
|
@@ -101,6 +102,7 @@ export const tokens = {
|
|
|
101
102
|
"panel": "24rem"
|
|
102
103
|
},
|
|
103
104
|
"breakpoint": {
|
|
105
|
+
"compact": "40rem",
|
|
104
106
|
"panel": "64rem"
|
|
105
107
|
},
|
|
106
108
|
"radius": {
|
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,6 +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)). */
|
|
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. */
|
|
56
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. */
|
|
57
59
|
--pharos-radius-none: 0; /** Square corners. */
|
|
58
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,6 +128,8 @@ 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;
|
|
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. */
|
|
132
|
+
export const PharosBreakpointCompact: string;
|
|
129
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. */
|
|
130
134
|
export const PharosBreakpointPanel: string;
|
|
131
135
|
/** Square corners. */
|
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,6 +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)).
|
|
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.
|
|
68
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.
|
|
69
71
|
export const PharosRadiusNone = "0"; // Square corners.
|
|
70
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)",
|
|
@@ -94,6 +95,7 @@
|
|
|
94
95
|
"panel": "24rem"
|
|
95
96
|
},
|
|
96
97
|
"breakpoint": {
|
|
98
|
+
"compact": "40rem",
|
|
97
99
|
"panel": "64rem"
|
|
98
100
|
},
|
|
99
101
|
"radius": {
|
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
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
}
|
|
8
8
|
},
|
|
9
9
|
"breakpoint": {
|
|
10
|
+
"compact": {
|
|
11
|
+
"$value": "40rem",
|
|
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). Read it in JS (matchMedia) — a custom property does not work inside @media."
|
|
14
|
+
},
|
|
10
15
|
"panel": {
|
|
11
16
|
"$value": "64rem",
|
|
12
17
|
"$type": "dimension",
|