@code-sherpas/pharos-tokens 0.8.0 → 0.8.1
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 +1 -1
- package/dist/styles.css +4 -4
- package/dist/tokens.d.ts +1 -1
- package/dist/tokens.js +1 -1
- package/package.json +6 -6
- package/src/typography.tokens.json +1 -1
- package/RULES.md +0 -60
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ import colorDtcg from '@code-sherpas/pharos-tokens/dtcg/color';
|
|
|
73
73
|
|
|
74
74
|
## Rules for consumers
|
|
75
75
|
|
|
76
|
-
See [
|
|
76
|
+
See [the rules for consumers](https://app.notion.com/p/4071751eee1081b2b000e212c80761b4) in Notion (Programa Pharos), where Pharos keeps its documentation (decision D27).
|
|
77
77
|
|
|
78
78
|
## Token structure
|
|
79
79
|
|
package/dist/styles.css
CHANGED
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
--pharos-z-drawer: 10000; /** DEPRECATED: use --pharos-z-index-modal (decision D29). Removed in the next major. */
|
|
81
81
|
--pharos-z-dropdown: 10001; /** DEPRECATED: use --pharos-z-index-popover (decision D29). Removed in the next major. */
|
|
82
82
|
--pharos-z-tooltip: 10002; /** DEPRECATED: use --pharos-z-index-tooltip (decision D29). Removed in the next major. */
|
|
83
|
-
--pharos-duration-fast:
|
|
84
|
-
--pharos-duration-normal:
|
|
85
|
-
--pharos-duration-slow:
|
|
83
|
+
--pharos-duration-fast: 0.1s; /** Micro interactions (hover). */
|
|
84
|
+
--pharos-duration-normal: 0.2s; /** Default transitions. */
|
|
85
|
+
--pharos-duration-slow: 0.3s; /** Panel slide, overlay fade. */
|
|
86
86
|
--pharos-easing-in: cubic-bezier(0.4, 0, 1, 1);
|
|
87
87
|
--pharos-easing-out: cubic-bezier(0, 0, 0.2, 1);
|
|
88
88
|
--pharos-easing-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
--pharos-spacing-0-5: 0.125rem; /** 2px step of the rem scale. */
|
|
104
104
|
--pharos-spacing-1-5: 0.375rem; /** 6px step of the rem scale. */
|
|
105
105
|
--pharos-spacing-2-5: 0.625rem; /** 10px step of the rem scale. */
|
|
106
|
-
--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 —
|
|
106
|
+
--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 — rule 8 of the consumer rules linked from the README. */
|
|
107
107
|
--pharos-font-family-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; /** Default monospace stack for code. */
|
|
108
108
|
--pharos-font-weight-regular: 400;
|
|
109
109
|
--pharos-font-weight-medium: 500;
|
package/dist/tokens.d.ts
CHANGED
|
@@ -223,7 +223,7 @@ export const PharosSpacing05: string;
|
|
|
223
223
|
export const PharosSpacing15: string;
|
|
224
224
|
/** 10px step of the rem scale. */
|
|
225
225
|
export const PharosSpacing25: string;
|
|
226
|
-
/** 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 —
|
|
226
|
+
/** 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 — rule 8 of the consumer rules linked from the README. */
|
|
227
227
|
export const PharosFontFamilySans: string;
|
|
228
228
|
/** Default monospace stack for code. */
|
|
229
229
|
export const PharosFontFamilyMono: string;
|
package/dist/tokens.js
CHANGED
|
@@ -119,7 +119,7 @@ export const PharosSpacing05 = "0.125rem"; // 2px step of the rem scale.
|
|
|
119
119
|
export const PharosSpacing15 = "0.375rem"; // 6px step of the rem scale.
|
|
120
120
|
export const PharosSpacing25 = "0.625rem"; // 10px step of the rem scale.
|
|
121
121
|
export const PharosFontFamilySans =
|
|
122
|
-
'"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 —
|
|
122
|
+
'"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 — rule 8 of the consumer rules linked from the README.
|
|
123
123
|
export const PharosFontFamilyMono =
|
|
124
124
|
'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace'; // Default monospace stack for code.
|
|
125
125
|
export const PharosFontWeightRegular = "400";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-sherpas/pharos-tokens",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Design tokens de Code Sherpas — agnóstico de framework. DTCG + Style Dictionary + OKLCH.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
"type": "module",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
21
|
-
"src"
|
|
22
|
-
"RULES.md"
|
|
21
|
+
"src"
|
|
23
22
|
],
|
|
24
23
|
"exports": {
|
|
25
24
|
".": {
|
|
@@ -30,7 +29,8 @@
|
|
|
30
29
|
"./dtcg/*": "./src/*.tokens.json"
|
|
31
30
|
},
|
|
32
31
|
"engines": {
|
|
33
|
-
"node": ">=22"
|
|
32
|
+
"node": ">=22",
|
|
33
|
+
"pnpm": "10.33.0"
|
|
34
34
|
},
|
|
35
35
|
"lint-staged": {
|
|
36
36
|
"*.{ts,tsx,js,mjs,cjs,json,md,mdx,css,yml,yaml}": "prettier --write"
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"vitest": "^4.1.4"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
|
-
"build": "node build/style-dictionary.config.mjs",
|
|
57
|
-
"test": "vitest run",
|
|
56
|
+
"build": "bash scripts/check-node-version.sh && node build/style-dictionary.config.mjs",
|
|
57
|
+
"test": "bash scripts/check-node-version.sh && vitest run",
|
|
58
58
|
"test:watch": "vitest",
|
|
59
59
|
"typecheck": "tsc --noEmit",
|
|
60
60
|
"lint": "eslint .",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sans": {
|
|
5
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. Outfit is the primary face (Decision D8); Inter is the fallback before system fonts. Loading Outfit is the consumer's responsibility —
|
|
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 — rule 8 of the consumer rules linked from the README."
|
|
8
8
|
},
|
|
9
9
|
"mono": {
|
|
10
10
|
"$value": "ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace",
|
package/RULES.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Rules for consumers of `@code-sherpas/pharos-tokens`
|
|
2
|
-
|
|
3
|
-
This file ships with the package (`files` includes `RULES.md`). Every
|
|
4
|
-
consumer — `pharos-react`, `alexandria-web-application`,
|
|
5
|
-
and any future app — must follow these rules.
|
|
6
|
-
|
|
7
|
-
## 1. Do not redefine values locally
|
|
8
|
-
|
|
9
|
-
Tokens are the single source of truth. Forbidden:
|
|
10
|
-
|
|
11
|
-
- Hardcoded hex for colors that have an equivalent token (e.g. `#101820` when `--pharos-color-neutral-900` exists).
|
|
12
|
-
- Raw `rem`/`px` values for spacing when `--pharos-spacing-*` exists.
|
|
13
|
-
- Ad-hoc local shadows.
|
|
14
|
-
|
|
15
|
-
If a value has no token, open an issue in this repo. Do not improvise.
|
|
16
|
-
|
|
17
|
-
## 2. Do not invent colors outside the system
|
|
18
|
-
|
|
19
|
-
The system is: `color.neutral.*`, `color.primary.*`, `color.semantic.{success,error,warning,info}.*`, `color.base.{white,black}`. If you need a new accent (purple, amber, etc.) with clear semantics, open an issue — do not add it locally.
|
|
20
|
-
|
|
21
|
-
## 3. Use CSS vars or the JS object
|
|
22
|
-
|
|
23
|
-
**Web**: import `@code-sherpas/pharos-tokens/css` at your entry point and use `var(--pharos-*)` or Tailwind arbitrary values (`bg-[var(--pharos-color-primary-600)]`).
|
|
24
|
-
|
|
25
|
-
**Programmatic** (JS/TS): `import { tokens } from '@code-sherpas/pharos-tokens'` → `tokens.color.neutral['900']`.
|
|
26
|
-
|
|
27
|
-
**DTCG source** (for custom pipelines): `import dtcg from '@code-sherpas/pharos-tokens/dtcg/color'`.
|
|
28
|
-
|
|
29
|
-
## 4. Do not mutate values after importing
|
|
30
|
-
|
|
31
|
-
Forbidden: `tokens.color.primary['600'] = '#new'`. The object is frozen in spirit even if JS does not enforce it. Changes go through a PR to this repo.
|
|
32
|
-
|
|
33
|
-
## 5. Respect semver
|
|
34
|
-
|
|
35
|
-
- Breaking change in this repo → major bump → consumers upgrade explicitly.
|
|
36
|
-
- New token → minor bump → consumers may adopt without breaking anything.
|
|
37
|
-
- Value adjustment without renaming → patch → consumers receive visual improvements automatically.
|
|
38
|
-
|
|
39
|
-
## 6. Accessibility
|
|
40
|
-
|
|
41
|
-
When picking which tokens to use, respect the defined pairs:
|
|
42
|
-
|
|
43
|
-
- Text over `color.neutral.50`/`100`/`200`: use `color.neutral.900` or darker.
|
|
44
|
-
- Text over `color.primary.600`+: use `color.base.white`.
|
|
45
|
-
- Text over `color.semantic.{success,error,info}.fg` (filled): use `.on` from the same group.
|
|
46
|
-
- Text over `color.semantic.warning.fg`: `.on` is `color.neutral.900` (warning is light).
|
|
47
|
-
|
|
48
|
-
## 7. Extensions and overrides
|
|
49
|
-
|
|
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.
|