@code-sherpas/pharos-tokens 0.2.0 → 0.4.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/RULES.md CHANGED
@@ -48,3 +48,13 @@ When picking which tokens to use, respect the defined pairs:
48
48
  ## 7. Extensions and overrides
49
49
 
50
50
  **Do not** publish a new package `@yourorg/pharos-tokens-extended`. If a product needs its own tokens (e.g. co-branded identities), implement them as additional CSS vars in the consumer under your own namespace (`--myapp-*`) and document it.
51
+
52
+ ## 8. Font loading is the consumer's responsibility
53
+
54
+ `pharos-tokens` declares the font stack (e.g. `"Outfit", Inter, system-ui, ...`) but does **not** ship font files. The package stays framework-agnostic and cannot assume how the consumer serves assets. Each consumer is responsible for loading the primary face before the UI renders:
55
+
56
+ - **Next.js**: `next/font/google` with `Outfit` (and optionally `Inter`) in the root layout.
57
+ - **Vite / CRA / generic web**: `@fontsource/outfit` + `@fontsource/inter`, or a `<link>` tag to Google Fonts.
58
+ - **Emails / PDFs**: the renderer falls back through the stack; declare `Outfit` as the primary face only if the renderer can embed it, otherwise the fallback chain kicks in.
59
+
60
+ If the primary face is not loaded, the stack falls back through `Inter → system-ui → ...`, so the UI degrades gracefully — but the intended design requires the primary face.
package/dist/index.js CHANGED
@@ -43,10 +43,10 @@ export const tokens = {
43
43
  "on": "oklch(100% 0 0)"
44
44
  },
45
45
  "error": {
46
- "fg": "oklch(61.28% 0.2305 27.48)",
47
- "fg-hover": "oklch(54% 0.22 27.48)",
48
- "fg-active": "oklch(46% 0.195 27.48)",
49
- "bg": "oklch(61.28% 0.2305 27.48 / 0.063)",
46
+ "fg": "oklch(54% 0.22 27.48)",
47
+ "fg-hover": "oklch(47% 0.205 27.48)",
48
+ "fg-active": "oklch(40% 0.175 27.48)",
49
+ "bg": "oklch(54% 0.22 27.48 / 0.063)",
50
50
  "on": "oklch(100% 0 0)"
51
51
  },
52
52
  "warning": {
@@ -116,7 +116,7 @@ export const tokens = {
116
116
  },
117
117
  "font": {
118
118
  "family": {
119
- "sans": "\"Inter\", system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif",
119
+ "sans": "\"Outfit\", Inter, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif",
120
120
  "mono": "ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace"
121
121
  },
122
122
  "weight": {
package/dist/styles.css CHANGED
@@ -28,10 +28,10 @@
28
28
  --pharos-color-primary-900: oklch(25.97% 0.1317 268.18); /** Primary darkest. */
29
29
  --pharos-color-semantic-success-fg: oklch(52% 0.17 152); /** Success foreground. Darkened from Alexandria #05b661 (L=68%, failed WCAG) to pass AA 4.5:1 vs white background and AA 3:1 for white text on filled surfaces. */
30
30
  --pharos-color-semantic-success-bg: oklch(52% 0.17 152 / 0.063); /** Success background, subtle tint of success.fg. */
31
- --pharos-color-semantic-error-fg: oklch(61.28% 0.2305 27.48); /** Error foreground. Replaces Alexandria #ef2828 / true-red-opaque. Decision D2: single red (laser-red merged). */
32
- --pharos-color-semantic-error-fg-hover: oklch(54% 0.22 27.48); /** Darker shade of error.fg for hover states on filled destructive surfaces. Passes WCAG AA 4.5:1 against error.on (white). */
33
- --pharos-color-semantic-error-fg-active: oklch(46% 0.195 27.48); /** Darker still — pressed/active state for filled destructive surfaces. Passes WCAG AAA 7:1 against error.on (white). */
34
- --pharos-color-semantic-error-bg: oklch(61.28% 0.2305 27.48 / 0.063); /** Error background, subtle. Replaces Alexandria #ef282810. */
31
+ --pharos-color-semantic-error-fg: oklch(54% 0.22 27.48); /** Error foreground. Darkened from Alexandria #ef2828 (L=61%, contrast 4.19 against white failed WCAG AA 4.5:1 for normal text in filled destructive buttons) to pass AA 4.5:1 (contrast 5.68 vs white). Decision D2: single red (laser-red merged). Same precedent as success.fg and info.fg — Alexandria's value failed AA, Pharos fixes it systemically. */
32
+ --pharos-color-semantic-error-fg-hover: oklch(47% 0.205 27.48); /** Darker shade of error.fg for hover states on filled destructive surfaces. Contrast 7.26 vs error.on (white), passes WCAG AA 4.5:1 with margin. */
33
+ --pharos-color-semantic-error-fg-active: oklch(40% 0.175 27.48); /** Darkest — pressed/active state for filled destructive surfaces. Contrast 9.69 vs error.on (white), passes WCAG AAA 7:1. */
34
+ --pharos-color-semantic-error-bg: oklch(54% 0.22 27.48 / 0.063); /** Error background, subtle tint of error.fg. Tracks the darkened fg so the relationship stays consistent. */
35
35
  --pharos-color-semantic-warning-fg: oklch(77.77% 0.1588 90.66); /** Warning foreground. Replaces Alexandria #ddb101 / warning.fore. */
36
36
  --pharos-color-semantic-warning-bg: oklch(77.77% 0.1588 90.66 / 0.063); /** Warning background, subtle. Replaces Alexandria #ddb10110 / warning.back. */
37
37
  --pharos-color-semantic-info-fg: oklch(52% 0.17 246); /** Info foreground. Darkened from Alexandria #009bf9 (L=67%, failed WCAG) to pass AA 4.5:1 vs white background. */
@@ -80,7 +80,7 @@
80
80
  --pharos-spacing-0-5: 0.125rem; /** 2px. */
81
81
  --pharos-spacing-1-5: 0.375rem; /** 6px. */
82
82
  --pharos-spacing-2-5: 0.625rem; /** 10px. */
83
- --pharos-font-family-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /** Default sans-serif stack. Inter can be replaced at the consumer layer via CSS var override. */
83
+ --pharos-font-family-sans: "Outfit", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /** Default sans-serif stack. Outfit is the primary face (Decision D8); Inter is the fallback before system fonts. Loading Outfit is the consumer's responsibility — see RULES.md §8. */
84
84
  --pharos-font-family-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; /** Default monospace stack for code. */
85
85
  --pharos-font-weight-regular: 400;
86
86
  --pharos-font-weight-medium: 500;
@@ -104,7 +104,7 @@
104
104
  --pharos-font-letter-spacing-normal: 0;
105
105
  --pharos-font-letter-spacing-wide: 0.025em;
106
106
  --pharos-color-semantic-success-on: var(--pharos-color-base-white); /** Readable on success.fg filled surfaces (WCAG AA). */
107
- --pharos-color-semantic-error-on: var(--pharos-color-base-white); /** Readable on error.fg filled surfaces (WCAG AA). */
107
+ --pharos-color-semantic-error-on: var(--pharos-color-base-white); /** Readable on error.fg filled surfaces (WCAG AA 4.5:1 for normal text). */
108
108
  --pharos-color-semantic-warning-on: var(--pharos-color-neutral-900); /** Readable on warning.fg filled surfaces (WCAG AA). Warning is light/amber — needs dark on-color. */
109
109
  --pharos-color-semantic-info-on: var(--pharos-color-base-white); /** Readable on info.fg filled surfaces (WCAG AA). */
110
110
  }
package/dist/tokens.d.ts CHANGED
@@ -54,15 +54,15 @@ export const PharosColorSemanticSuccessFg: string;
54
54
  export const PharosColorSemanticSuccessBg: string;
55
55
  /** Readable on success.fg filled surfaces (WCAG AA). */
56
56
  export const PharosColorSemanticSuccessOn: string;
57
- /** Error foreground. Replaces Alexandria #ef2828 / true-red-opaque. Decision D2: single red (laser-red merged). */
57
+ /** Error foreground. Darkened from Alexandria #ef2828 (L=61%, contrast 4.19 against white failed WCAG AA 4.5:1 for normal text in filled destructive buttons) to pass AA 4.5:1 (contrast 5.68 vs white). Decision D2: single red (laser-red merged). Same precedent as success.fg and info.fg — Alexandria's value failed AA, Pharos fixes it systemically. */
58
58
  export const PharosColorSemanticErrorFg: string;
59
- /** Darker shade of error.fg for hover states on filled destructive surfaces. Passes WCAG AA 4.5:1 against error.on (white). */
59
+ /** Darker shade of error.fg for hover states on filled destructive surfaces. Contrast 7.26 vs error.on (white), passes WCAG AA 4.5:1 with margin. */
60
60
  export const PharosColorSemanticErrorFgHover: string;
61
- /** Darker still — pressed/active state for filled destructive surfaces. Passes WCAG AAA 7:1 against error.on (white). */
61
+ /** Darkest — pressed/active state for filled destructive surfaces. Contrast 9.69 vs error.on (white), passes WCAG AAA 7:1. */
62
62
  export const PharosColorSemanticErrorFgActive: string;
63
- /** Error background, subtle. Replaces Alexandria #ef282810. */
63
+ /** Error background, subtle tint of error.fg. Tracks the darkened fg so the relationship stays consistent. */
64
64
  export const PharosColorSemanticErrorBg: string;
65
- /** Readable on error.fg filled surfaces (WCAG AA). */
65
+ /** Readable on error.fg filled surfaces (WCAG AA 4.5:1 for normal text). */
66
66
  export const PharosColorSemanticErrorOn: string;
67
67
  /** Warning foreground. Replaces Alexandria #ddb101 / warning.fore. */
68
68
  export const PharosColorSemanticWarningFg: string;
@@ -154,7 +154,7 @@ export const PharosSpacing05: string;
154
154
  export const PharosSpacing15: string;
155
155
  /** 10px. */
156
156
  export const PharosSpacing25: string;
157
- /** Default sans-serif stack. Inter can be replaced at the consumer layer via CSS var override. */
157
+ /** Default sans-serif stack. Outfit is the primary face (Decision D8); Inter is the fallback before system fonts. Loading Outfit is the consumer's responsibility — see RULES.md §8. */
158
158
  export const PharosFontFamilySans: string;
159
159
  /** Default monospace stack for code. */
160
160
  export const PharosFontFamilyMono: string;
package/dist/tokens.js CHANGED
@@ -28,11 +28,11 @@ export const PharosColorPrimary900 = "oklch(25.97% 0.1317 268.18)"; // Primary d
28
28
  export const PharosColorSemanticSuccessFg = "oklch(52% 0.17 152)"; // Success foreground. Darkened from Alexandria #05b661 (L=68%, failed WCAG) to pass AA 4.5:1 vs white background and AA 3:1 for white text on filled surfaces.
29
29
  export const PharosColorSemanticSuccessBg = "oklch(52% 0.17 152 / 0.063)"; // Success background, subtle tint of success.fg.
30
30
  export const PharosColorSemanticSuccessOn = "oklch(100% 0 0)"; // Readable on success.fg filled surfaces (WCAG AA).
31
- export const PharosColorSemanticErrorFg = "oklch(61.28% 0.2305 27.48)"; // Error foreground. Replaces Alexandria #ef2828 / true-red-opaque. Decision D2: single red (laser-red merged).
32
- export const PharosColorSemanticErrorFgHover = "oklch(54% 0.22 27.48)"; // Darker shade of error.fg for hover states on filled destructive surfaces. Passes WCAG AA 4.5:1 against error.on (white).
33
- export const PharosColorSemanticErrorFgActive = "oklch(46% 0.195 27.48)"; // Darker still — pressed/active state for filled destructive surfaces. Passes WCAG AAA 7:1 against error.on (white).
34
- export const PharosColorSemanticErrorBg = "oklch(61.28% 0.2305 27.48 / 0.063)"; // Error background, subtle. Replaces Alexandria #ef282810.
35
- export const PharosColorSemanticErrorOn = "oklch(100% 0 0)"; // Readable on error.fg filled surfaces (WCAG AA).
31
+ export const PharosColorSemanticErrorFg = "oklch(54% 0.22 27.48)"; // Error foreground. Darkened from Alexandria #ef2828 (L=61%, contrast 4.19 against white failed WCAG AA 4.5:1 for normal text in filled destructive buttons) to pass AA 4.5:1 (contrast 5.68 vs white). Decision D2: single red (laser-red merged). Same precedent as success.fg and info.fg — Alexandria's value failed AA, Pharos fixes it systemically.
32
+ export const PharosColorSemanticErrorFgHover = "oklch(47% 0.205 27.48)"; // Darker shade of error.fg for hover states on filled destructive surfaces. Contrast 7.26 vs error.on (white), passes WCAG AA 4.5:1 with margin.
33
+ export const PharosColorSemanticErrorFgActive = "oklch(40% 0.175 27.48)"; // Darkest — pressed/active state for filled destructive surfaces. Contrast 9.69 vs error.on (white), passes WCAG AAA 7:1.
34
+ export const PharosColorSemanticErrorBg = "oklch(54% 0.22 27.48 / 0.063)"; // Error background, subtle tint of error.fg. Tracks the darkened fg so the relationship stays consistent.
35
+ export const PharosColorSemanticErrorOn = "oklch(100% 0 0)"; // Readable on error.fg filled surfaces (WCAG AA 4.5:1 for normal text).
36
36
  export const PharosColorSemanticWarningFg = "oklch(77.77% 0.1588 90.66)"; // Warning foreground. Replaces Alexandria #ddb101 / warning.fore.
37
37
  export const PharosColorSemanticWarningBg =
38
38
  "oklch(77.77% 0.1588 90.66 / 0.063)"; // Warning background, subtle. Replaces Alexandria #ddb10110 / warning.back.
@@ -88,7 +88,7 @@ export const PharosSpacing05 = "0.125rem"; // 2px.
88
88
  export const PharosSpacing15 = "0.375rem"; // 6px.
89
89
  export const PharosSpacing25 = "0.625rem"; // 10px.
90
90
  export const PharosFontFamilySans =
91
- '"Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'; // Default sans-serif stack. Inter can be replaced at the consumer layer via CSS var override.
91
+ '"Outfit", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'; // Default sans-serif stack. Outfit is the primary face (Decision D8); Inter is the fallback before system fonts. Loading Outfit is the consumer's responsibility — see RULES.md §8.
92
92
  export const PharosFontFamilyMono =
93
93
  'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace'; // Default monospace stack for code.
94
94
  export const PharosFontWeightRegular = "400";
package/dist/tokens.json CHANGED
@@ -36,10 +36,10 @@
36
36
  "on": "oklch(100% 0 0)"
37
37
  },
38
38
  "error": {
39
- "fg": "oklch(61.28% 0.2305 27.48)",
40
- "fg-hover": "oklch(54% 0.22 27.48)",
41
- "fg-active": "oklch(46% 0.195 27.48)",
42
- "bg": "oklch(61.28% 0.2305 27.48 / 0.063)",
39
+ "fg": "oklch(54% 0.22 27.48)",
40
+ "fg-hover": "oklch(47% 0.205 27.48)",
41
+ "fg-active": "oklch(40% 0.175 27.48)",
42
+ "bg": "oklch(54% 0.22 27.48 / 0.063)",
43
43
  "on": "oklch(100% 0 0)"
44
44
  },
45
45
  "warning": {
@@ -109,7 +109,7 @@
109
109
  },
110
110
  "font": {
111
111
  "family": {
112
- "sans": "\"Inter\", system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif",
112
+ "sans": "\"Outfit\", Inter, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif",
113
113
  "mono": "ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace"
114
114
  },
115
115
  "weight": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-sherpas/pharos-tokens",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Design tokens de Code Sherpas — agnóstico de framework. DTCG + Style Dictionary + OKLCH.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -30,7 +30,7 @@
30
30
  "./dtcg/*": "./src/*.tokens.json"
31
31
  },
32
32
  "engines": {
33
- "node": ">=24"
33
+ "node": ">=22"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@changesets/cli": "^2.27.10",
@@ -141,29 +141,29 @@
141
141
  },
142
142
  "error": {
143
143
  "fg": {
144
- "$value": "oklch(61.28% 0.2305 27.48)",
144
+ "$value": "oklch(54% 0.22 27.48)",
145
145
  "$type": "color",
146
- "$description": "Error foreground. Replaces Alexandria #ef2828 / true-red-opaque. Decision D2: single red (laser-red merged)."
146
+ "$description": "Error foreground. Darkened from Alexandria #ef2828 (L=61%, contrast 4.19 against white failed WCAG AA 4.5:1 for normal text in filled destructive buttons) to pass AA 4.5:1 (contrast 5.68 vs white). Decision D2: single red (laser-red merged). Same precedent as success.fg and info.fg — Alexandria's value failed AA, Pharos fixes it systemically."
147
147
  },
148
148
  "fg-hover": {
149
- "$value": "oklch(54% 0.22 27.48)",
149
+ "$value": "oklch(47% 0.205 27.48)",
150
150
  "$type": "color",
151
- "$description": "Darker shade of error.fg for hover states on filled destructive surfaces. Passes WCAG AA 4.5:1 against error.on (white)."
151
+ "$description": "Darker shade of error.fg for hover states on filled destructive surfaces. Contrast 7.26 vs error.on (white), passes WCAG AA 4.5:1 with margin."
152
152
  },
153
153
  "fg-active": {
154
- "$value": "oklch(46% 0.195 27.48)",
154
+ "$value": "oklch(40% 0.175 27.48)",
155
155
  "$type": "color",
156
- "$description": "Darker still — pressed/active state for filled destructive surfaces. Passes WCAG AAA 7:1 against error.on (white)."
156
+ "$description": "Darkest — pressed/active state for filled destructive surfaces. Contrast 9.69 vs error.on (white), passes WCAG AAA 7:1."
157
157
  },
158
158
  "bg": {
159
- "$value": "oklch(61.28% 0.2305 27.48 / 0.063)",
159
+ "$value": "oklch(54% 0.22 27.48 / 0.063)",
160
160
  "$type": "color",
161
- "$description": "Error background, subtle. Replaces Alexandria #ef282810."
161
+ "$description": "Error background, subtle tint of error.fg. Tracks the darkened fg so the relationship stays consistent."
162
162
  },
163
163
  "on": {
164
164
  "$value": "{color.base.white}",
165
165
  "$type": "color",
166
- "$description": "Readable on error.fg filled surfaces (WCAG AA)."
166
+ "$description": "Readable on error.fg filled surfaces (WCAG AA 4.5:1 for normal text)."
167
167
  }
168
168
  },
169
169
  "warning": {
@@ -2,9 +2,9 @@
2
2
  "font": {
3
3
  "family": {
4
4
  "sans": {
5
- "$value": "\"Inter\", system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif",
5
+ "$value": "\"Outfit\", Inter, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif",
6
6
  "$type": "fontFamily",
7
- "$description": "Default sans-serif stack. Inter can be replaced at the consumer layer via CSS var override."
7
+ "$description": "Default sans-serif stack. Outfit is the primary face (Decision D8); Inter is the fallback before system fonts. Loading Outfit is the consumer's responsibility — see RULES.md §8."
8
8
  },
9
9
  "mono": {
10
10
  "$value": "ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace",