@code-sherpas/pharos-tokens 1.1.0 → 1.2.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 CHANGED
@@ -62,15 +62,9 @@ const darkSurface = tokens.color.neutral['900'];
62
62
  const cardRadius = tokens.radius['2xl'];
63
63
  ```
64
64
 
65
- Full autocomplete thanks to `typeof tokens`.
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 — Flat constants (selective imports)
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,7 @@ 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` | Viewport breakpoints by role (D32); read them in JS. |
96
+ | Breakpoint | `breakpoint.{compact,panel}` | By role (D32), read in JS. `compact`: a phone, < 40rem. |
103
97
 
104
98
  ## Contributing
105
99
 
package/dist/index.d.ts CHANGED
@@ -1,8 +1,249 @@
1
1
  /**
2
2
  * Do not edit directly, this file was auto-generated.
3
3
  */
4
- import tokens from './tokens.json';
5
-
6
- export type PharosTokens = typeof tokens;
4
+ export type PharosTokens = {
5
+ "color": {
6
+ "base": {
7
+ "white": string;
8
+ "black": string;
9
+ };
10
+ "neutral": {
11
+ "50": string;
12
+ "100": string;
13
+ "200": string;
14
+ "300": string;
15
+ "400": string;
16
+ "500": string;
17
+ "600": string;
18
+ "700": string;
19
+ "800": string;
20
+ "900": string;
21
+ "950": string;
22
+ };
23
+ "primary": {
24
+ "50": string;
25
+ "100": string;
26
+ "200": string;
27
+ "300": string;
28
+ "400": string;
29
+ "500": string;
30
+ "600": string;
31
+ "700": string;
32
+ "800": string;
33
+ "900": string;
34
+ };
35
+ "semantic": {
36
+ "success": {
37
+ "fg": string;
38
+ "bg": string;
39
+ "on": string;
40
+ };
41
+ "error": {
42
+ "fg": string;
43
+ "fg-hover": string;
44
+ "fg-active": string;
45
+ "bg": string;
46
+ "on": string;
47
+ };
48
+ "warning": {
49
+ "fg": string;
50
+ "bg": string;
51
+ "on": string;
52
+ };
53
+ "info": {
54
+ "fg": string;
55
+ "bg": string;
56
+ "on": string;
57
+ };
58
+ };
59
+ "paper": {
60
+ "50": string;
61
+ "100": string;
62
+ "200": string;
63
+ "300": string;
64
+ };
65
+ "rule": {
66
+ "subtle": string;
67
+ "strong": string;
68
+ };
69
+ "surface": {
70
+ "canvas": string;
71
+ "card": string;
72
+ "sunken": string;
73
+ };
74
+ "border": {
75
+ "subtle": string;
76
+ "strong": string;
77
+ };
78
+ "accent": {
79
+ "terracotta": {
80
+ "50": string;
81
+ "100": string;
82
+ "200": string;
83
+ "300": string;
84
+ "400": string;
85
+ "500": string;
86
+ "600": string;
87
+ "700": string;
88
+ "800": string;
89
+ "900": string;
90
+ "fg": string;
91
+ "bg": string;
92
+ "on": string;
93
+ };
94
+ };
95
+ };
96
+ "width": {
97
+ "panel": string;
98
+ };
99
+ "breakpoint": {
100
+ "compact": string;
101
+ "panel": string;
102
+ };
103
+ "radius": {
104
+ "none": string;
105
+ "sm": string;
106
+ "md": string;
107
+ "lg": string;
108
+ "xl": string;
109
+ "2xl": string;
110
+ "3xl": string;
111
+ "full": string;
112
+ };
113
+ "shadow": {
114
+ "sm": string;
115
+ "md": string;
116
+ "lg": string;
117
+ "xl": string;
118
+ };
119
+ "zIndex": {
120
+ "base": string;
121
+ "sticky": string;
122
+ "overlay": string;
123
+ "modal": string;
124
+ "popover": string;
125
+ "toast": string;
126
+ "tooltip": string;
127
+ };
128
+ "duration": {
129
+ "fast": string;
130
+ "normal": string;
131
+ "slow": string;
132
+ };
133
+ "easing": {
134
+ "in": string;
135
+ "out": string;
136
+ "in-out": string;
137
+ };
138
+ "spacing": {
139
+ "0": string;
140
+ "1": string;
141
+ "2": string;
142
+ "3": string;
143
+ "4": string;
144
+ "5": string;
145
+ "6": string;
146
+ "7": string;
147
+ "8": string;
148
+ "10": string;
149
+ "12": string;
150
+ "16": string;
151
+ "20": string;
152
+ "24": string;
153
+ };
154
+ "font": {
155
+ "family": {
156
+ "sans": string;
157
+ "mono": string;
158
+ };
159
+ "weight": {
160
+ "regular": string;
161
+ "medium": string;
162
+ "semibold": string;
163
+ "bold": string;
164
+ };
165
+ "size": {
166
+ "xs": string;
167
+ "sm": string;
168
+ "base": string;
169
+ "lg": string;
170
+ "xl": string;
171
+ "2xl": string;
172
+ "3xl": string;
173
+ "4xl": string;
174
+ "5xl": string;
175
+ };
176
+ "lineHeight": {
177
+ "tight": string;
178
+ "snug": string;
179
+ "normal": string;
180
+ "relaxed": string;
181
+ "loose": string;
182
+ };
183
+ "letterSpacing": {
184
+ "tight": string;
185
+ "normal": string;
186
+ "wide": string;
187
+ };
188
+ };
189
+ "type": {
190
+ "display": {
191
+ "fontFamily": string;
192
+ "fontSize": string;
193
+ "fontWeight": string;
194
+ "lineHeight": string;
195
+ "letterSpacing": string;
196
+ };
197
+ "h1": {
198
+ "fontFamily": string;
199
+ "fontSize": string;
200
+ "fontWeight": string;
201
+ "lineHeight": string;
202
+ "letterSpacing": string;
203
+ };
204
+ "h2": {
205
+ "fontFamily": string;
206
+ "fontSize": string;
207
+ "fontWeight": string;
208
+ "lineHeight": string;
209
+ "letterSpacing": string;
210
+ };
211
+ "h3": {
212
+ "fontFamily": string;
213
+ "fontSize": string;
214
+ "fontWeight": string;
215
+ "lineHeight": string;
216
+ "letterSpacing": string;
217
+ };
218
+ "h4": {
219
+ "fontFamily": string;
220
+ "fontSize": string;
221
+ "fontWeight": string;
222
+ "lineHeight": string;
223
+ "letterSpacing": string;
224
+ };
225
+ "subtitle": {
226
+ "fontFamily": string;
227
+ "fontSize": string;
228
+ "fontWeight": string;
229
+ "lineHeight": string;
230
+ "letterSpacing": string;
231
+ };
232
+ "body": {
233
+ "fontFamily": string;
234
+ "fontSize": string;
235
+ "fontWeight": string;
236
+ "lineHeight": string;
237
+ "letterSpacing": string;
238
+ };
239
+ "caption": {
240
+ "fontFamily": string;
241
+ "fontSize": string;
242
+ "fontWeight": string;
243
+ "lineHeight": string;
244
+ "letterSpacing": string;
245
+ };
246
+ };
247
+ };
7
248
  export declare const tokens: PharosTokens;
8
249
  export default tokens;
package/dist/index.js CHANGED
@@ -101,6 +101,7 @@ export const tokens = {
101
101
  "panel": "24rem"
102
102
  },
103
103
  "breakpoint": {
104
+ "compact": "40rem",
104
105
  "panel": "64rem"
105
106
  },
106
107
  "radius": {
package/dist/styles.css CHANGED
@@ -53,6 +53,7 @@
53
53
  --pharos-color-accent-terracotta-800: oklch(42.00% 0.1020 42.5); /** Press step of a terracotta fill (#79371A). */
54
54
  --pharos-color-accent-terracotta-900: oklch(33.00% 0.0770 42.5); /** Deep text on a terracotta tint (#552612). */
55
55
  --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); a Dialog fills the screen below it. Read it in JS (matchMedia) — a custom property does not work inside @media. */
56
57
  --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
58
  --pharos-radius-none: 0; /** Square corners. */
58
59
  --pharos-radius-sm: 0.125rem; /** 2px — small marks, code chips. */
package/dist/tokens.d.ts CHANGED
@@ -126,6 +126,8 @@ export const PharosColorAccentTerracottaBg: string;
126
126
  export const PharosColorAccentTerracottaOn: string;
127
127
  /** Width of an edge-docked panel: Sheet, and SidePanel inline or modal. Cap it at the viewport (min(var(--pharos-width-panel), 100vw)). */
128
128
  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); a Dialog fills the screen below it. Read it in JS (matchMedia) — a custom property does not work inside @media. */
130
+ export const PharosBreakpointCompact: string;
129
131
  /** 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
132
  export const PharosBreakpointPanel: string;
131
133
  /** Square corners. */
package/dist/tokens.js CHANGED
@@ -65,6 +65,7 @@ export const PharosColorAccentTerracottaFg = "oklch(51.60% 0.1261 40.7)"; // Acc
65
65
  export const PharosColorAccentTerracottaBg = "oklch(96.50% 0.0160 42.5)"; // Tint surface for warm-accent blocks on white (→ terracotta-50).
66
66
  export const PharosColorAccentTerracottaOn = "oklch(100% 0 0)"; // Text on a solid terracotta mark (use on 700 for small text).
67
67
  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); a Dialog fills the screen below it. Read it in JS (matchMedia) — a custom property does not work inside @media.
68
69
  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
70
  export const PharosRadiusNone = "0"; // Square corners.
70
71
  export const PharosRadiusSm = "0.125rem"; // 2px — small marks, code chips.
package/dist/tokens.json CHANGED
@@ -94,6 +94,7 @@
94
94
  "panel": "24rem"
95
95
  },
96
96
  "breakpoint": {
97
+ "compact": "40rem",
97
98
  "panel": "64rem"
98
99
  },
99
100
  "radius": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-sherpas/pharos-tokens",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Design tokens de Code Sherpas — agnóstico de framework. DTCG + Style Dictionary + OKLCH.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -43,7 +43,7 @@
43
43
  "*.{ts,tsx,js,mjs,cjs,json,md,mdx,css,yml,yaml}": "prettier --write"
44
44
  },
45
45
  "devDependencies": {
46
- "@changesets/cli": "^2.27.10",
46
+ "@changesets/cli": "^3.0.3",
47
47
  "@types/culori": "^4.0.1",
48
48
  "@types/node": "^26.6.6",
49
49
  "@typescript-eslint/eslint-plugin": "^8.20.0",
@@ -60,7 +60,8 @@
60
60
  "vitest": "^5.0.5"
61
61
  },
62
62
  "scripts": {
63
- "build": "bash scripts/check-node-version.sh && node build/style-dictionary.config.mjs",
63
+ "build": "bash scripts/check-node-version.sh && node build/style-dictionary.config.mjs && pnpm verify:dist-types",
64
+ "verify:dist-types": "bash scripts/verify-dist-types.sh",
64
65
  "test": "bash scripts/check-node-version.sh && vitest run",
65
66
  "test:watch": "vitest",
66
67
  "typecheck": "tsc --noEmit",
@@ -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); a Dialog fills the screen below it. 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",