@code-sherpas/pharos-tokens 1.0.1 → 1.1.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 CHANGED
@@ -11,7 +11,7 @@ lives in Notion → [Programa Pharos](https://app.notion.com/p/38c1751eee1081a38
11
11
 
12
12
  ## What's in this package
13
13
 
14
- This package defines **the atomic values** of Code Sherpas's visual system: colors, spacing, radius, typography, shadows, z-index, duration, and easing. They are consumable from any frontend (React, Vue, Svelte, React Native) and from backends (transactional emails, PDFs, reports).
14
+ This package defines **the atomic values** of Code Sherpas's visual system: colors, spacing, radius, typography, shadows, z-index, duration, easing, and layout widths and breakpoints. They are consumable from any frontend (React, Vue, Svelte, React Native) and from backends (transactional emails, PDFs, reports).
15
15
 
16
16
  It contains no components. React components live in [`@code-sherpas/pharos-react`](https://github.com/code-sherpas/pharos-react) and consume this package as a peer dependency.
17
17
 
@@ -62,7 +62,7 @@ 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
67
  ### Option C — Flat constants (selective imports)
68
68
 
@@ -98,6 +98,8 @@ See [the rules for consumers](https://app.notion.com/p/4071751eee1081b2b000e212c
98
98
  | Z-index | `z.{0,header,above-header,modal-overlay,modal,drawer-overlay,drawer,dropdown,tooltip}` | Semantic, not literal. |
99
99
  | Duration | `duration.{fast,normal,slow}` | Transitions. |
100
100
  | Easing | `easing.{in,out,in-out}` | Cubic-bezier curves. |
101
+ | Width | `width.panel` | Widths by role. `panel`: Sheet and SidePanel (24rem). |
102
+ | Breakpoint | `breakpoint.panel` | Viewport breakpoints by role (D32); read them in JS. |
101
103
 
102
104
  ## Contributing
103
105
 
package/dist/index.d.ts CHANGED
@@ -1,8 +1,248 @@
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
+ "panel": string;
101
+ };
102
+ "radius": {
103
+ "none": string;
104
+ "sm": string;
105
+ "md": string;
106
+ "lg": string;
107
+ "xl": string;
108
+ "2xl": string;
109
+ "3xl": string;
110
+ "full": string;
111
+ };
112
+ "shadow": {
113
+ "sm": string;
114
+ "md": string;
115
+ "lg": string;
116
+ "xl": string;
117
+ };
118
+ "zIndex": {
119
+ "base": string;
120
+ "sticky": string;
121
+ "overlay": string;
122
+ "modal": string;
123
+ "popover": string;
124
+ "toast": string;
125
+ "tooltip": string;
126
+ };
127
+ "duration": {
128
+ "fast": string;
129
+ "normal": string;
130
+ "slow": string;
131
+ };
132
+ "easing": {
133
+ "in": string;
134
+ "out": string;
135
+ "in-out": string;
136
+ };
137
+ "spacing": {
138
+ "0": string;
139
+ "1": string;
140
+ "2": string;
141
+ "3": string;
142
+ "4": string;
143
+ "5": string;
144
+ "6": string;
145
+ "7": string;
146
+ "8": string;
147
+ "10": string;
148
+ "12": string;
149
+ "16": string;
150
+ "20": string;
151
+ "24": string;
152
+ };
153
+ "font": {
154
+ "family": {
155
+ "sans": string;
156
+ "mono": string;
157
+ };
158
+ "weight": {
159
+ "regular": string;
160
+ "medium": string;
161
+ "semibold": string;
162
+ "bold": string;
163
+ };
164
+ "size": {
165
+ "xs": string;
166
+ "sm": string;
167
+ "base": string;
168
+ "lg": string;
169
+ "xl": string;
170
+ "2xl": string;
171
+ "3xl": string;
172
+ "4xl": string;
173
+ "5xl": string;
174
+ };
175
+ "lineHeight": {
176
+ "tight": string;
177
+ "snug": string;
178
+ "normal": string;
179
+ "relaxed": string;
180
+ "loose": string;
181
+ };
182
+ "letterSpacing": {
183
+ "tight": string;
184
+ "normal": string;
185
+ "wide": string;
186
+ };
187
+ };
188
+ "type": {
189
+ "display": {
190
+ "fontFamily": string;
191
+ "fontSize": string;
192
+ "fontWeight": string;
193
+ "lineHeight": string;
194
+ "letterSpacing": string;
195
+ };
196
+ "h1": {
197
+ "fontFamily": string;
198
+ "fontSize": string;
199
+ "fontWeight": string;
200
+ "lineHeight": string;
201
+ "letterSpacing": string;
202
+ };
203
+ "h2": {
204
+ "fontFamily": string;
205
+ "fontSize": string;
206
+ "fontWeight": string;
207
+ "lineHeight": string;
208
+ "letterSpacing": string;
209
+ };
210
+ "h3": {
211
+ "fontFamily": string;
212
+ "fontSize": string;
213
+ "fontWeight": string;
214
+ "lineHeight": string;
215
+ "letterSpacing": string;
216
+ };
217
+ "h4": {
218
+ "fontFamily": string;
219
+ "fontSize": string;
220
+ "fontWeight": string;
221
+ "lineHeight": string;
222
+ "letterSpacing": string;
223
+ };
224
+ "subtitle": {
225
+ "fontFamily": string;
226
+ "fontSize": string;
227
+ "fontWeight": string;
228
+ "lineHeight": string;
229
+ "letterSpacing": string;
230
+ };
231
+ "body": {
232
+ "fontFamily": string;
233
+ "fontSize": string;
234
+ "fontWeight": string;
235
+ "lineHeight": string;
236
+ "letterSpacing": string;
237
+ };
238
+ "caption": {
239
+ "fontFamily": string;
240
+ "fontSize": string;
241
+ "fontWeight": string;
242
+ "lineHeight": string;
243
+ "letterSpacing": string;
244
+ };
245
+ };
246
+ };
7
247
  export declare const tokens: PharosTokens;
8
248
  export default tokens;
package/dist/index.js CHANGED
@@ -97,6 +97,12 @@ export const tokens = {
97
97
  }
98
98
  }
99
99
  },
100
+ "width": {
101
+ "panel": "24rem"
102
+ },
103
+ "breakpoint": {
104
+ "panel": "64rem"
105
+ },
100
106
  "radius": {
101
107
  "none": "0",
102
108
  "sm": "0.125rem",
package/dist/styles.css CHANGED
@@ -52,6 +52,8 @@
52
52
  --pharos-color-accent-terracotta-700: oklch(51.60% 0.1261 40.7); /** Terracotta ink #A24A28: accent text on white (5.92:1, AA); solid marks carrying small white text; hover of a 600 fill. */
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
+ --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-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. */
55
57
  --pharos-radius-none: 0; /** Square corners. */
56
58
  --pharos-radius-sm: 0.125rem; /** 2px — small marks, code chips. */
57
59
  --pharos-radius-md: 0.375rem; /** 6px — default control rounding. */
package/dist/tokens.d.ts CHANGED
@@ -124,6 +124,10 @@ export const PharosColorAccentTerracottaFg: string;
124
124
  export const PharosColorAccentTerracottaBg: string;
125
125
  /** Text on a solid terracotta mark (use on 700 for small text). */
126
126
  export const PharosColorAccentTerracottaOn: string;
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
+ export const PharosWidthPanel: string;
129
+ /** 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
+ export const PharosBreakpointPanel: string;
127
131
  /** Square corners. */
128
132
  export const PharosRadiusNone: string;
129
133
  /** 2px — small marks, code chips. */
package/dist/tokens.js CHANGED
@@ -64,6 +64,8 @@ export const PharosColorAccentTerracotta900 = "oklch(33.00% 0.0770 42.5)"; // De
64
64
  export const PharosColorAccentTerracottaFg = "oklch(51.60% 0.1261 40.7)"; // Accessible ink for warm-accent blocks on white (→ terracotta-700).
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
+ 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 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.
67
69
  export const PharosRadiusNone = "0"; // Square corners.
68
70
  export const PharosRadiusSm = "0.125rem"; // 2px — small marks, code chips.
69
71
  export const PharosRadiusMd = "0.375rem"; // 6px — default control rounding.
package/dist/tokens.json CHANGED
@@ -90,6 +90,12 @@
90
90
  }
91
91
  }
92
92
  },
93
+ "width": {
94
+ "panel": "24rem"
95
+ },
96
+ "breakpoint": {
97
+ "panel": "64rem"
98
+ },
93
99
  "radius": {
94
100
  "none": "0",
95
101
  "sm": "0.125rem",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-sherpas/pharos-tokens",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Design tokens de Code Sherpas — agnóstico de framework. DTCG + Style Dictionary + OKLCH.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -43,9 +43,9 @@
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
- "@types/node": "^25.6.0",
48
+ "@types/node": "^26.6.6",
49
49
  "@typescript-eslint/eslint-plugin": "^8.20.0",
50
50
  "@typescript-eslint/parser": "^8.20.0",
51
51
  "culori": "^4.0.1",
@@ -57,10 +57,11 @@
57
57
  "prettier": "^3.4.2",
58
58
  "style-dictionary": "^5.4.0",
59
59
  "typescript": "^6.0.3",
60
- "vitest": "^4.1.4"
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",
@@ -0,0 +1,16 @@
1
+ {
2
+ "width": {
3
+ "panel": {
4
+ "$value": "24rem",
5
+ "$type": "dimension",
6
+ "$description": "Width of an edge-docked panel: Sheet, and SidePanel inline or modal. Cap it at the viewport (min(var(--pharos-width-panel), 100vw))."
7
+ }
8
+ },
9
+ "breakpoint": {
10
+ "panel": {
11
+ "$value": "64rem",
12
+ "$type": "dimension",
13
+ "$description": "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."
14
+ }
15
+ }
16
+ }