@paulperigault/tokens 0.0.0 → 0.1.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.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -0
  3. package/dist/customize/derive-overrides.d.ts +13 -0
  4. package/dist/customize/derive-overrides.js +40 -0
  5. package/dist/customize/derive-roles.d.ts +16 -0
  6. package/dist/customize/derive-roles.js +38 -0
  7. package/dist/customize/font-stack.d.ts +5 -0
  8. package/dist/customize/font-stack.js +26 -0
  9. package/dist/customize/hue.d.ts +8 -0
  10. package/dist/customize/hue.js +20 -0
  11. package/dist/customize/index.d.ts +8 -0
  12. package/dist/customize/index.js +5 -0
  13. package/dist/customize/input.d.ts +11 -0
  14. package/dist/customize/input.js +26 -0
  15. package/dist/customize/result.d.ts +16 -0
  16. package/dist/customize/result.js +18 -0
  17. package/dist/customize/settle.d.ts +8 -0
  18. package/dist/customize/settle.js +16 -0
  19. package/dist/lib/color-data.d.ts +30 -0
  20. package/dist/lib/color-data.js +28 -0
  21. package/dist/lib/color.d.ts +24 -0
  22. package/dist/lib/color.js +105 -0
  23. package/dist/lib/contrast.d.ts +13 -0
  24. package/dist/lib/contrast.js +90 -0
  25. package/dist/palette/domain/categorical.d.ts +7 -0
  26. package/dist/palette/domain/categorical.js +42 -0
  27. package/dist/palette/domain/color/cvd.d.ts +18 -0
  28. package/dist/palette/domain/color/cvd.js +29 -0
  29. package/dist/palette/domain/color/delta-e.d.ts +2 -0
  30. package/dist/palette/domain/color/delta-e.js +73 -0
  31. package/dist/palette/domain/color/gamut.d.ts +5 -0
  32. package/dist/palette/domain/color/gamut.js +24 -0
  33. package/dist/palette/domain/color/lab.d.ts +8 -0
  34. package/dist/palette/domain/color/lab.js +21 -0
  35. package/dist/palette/domain/color/vision.d.ts +11 -0
  36. package/dist/palette/domain/color/vision.js +28 -0
  37. package/dist/palette/domain/derive.d.ts +8 -0
  38. package/dist/palette/domain/derive.js +55 -0
  39. package/dist/palette/domain/ink.d.ts +12 -0
  40. package/dist/palette/domain/ink.js +13 -0
  41. package/dist/palette/domain/ramps.d.ts +8 -0
  42. package/dist/palette/domain/ramps.js +43 -0
  43. package/dist/palette/domain/result.d.ts +10 -0
  44. package/dist/palette/domain/result.js +6 -0
  45. package/dist/palette/domain/thresholds.d.ts +12 -0
  46. package/dist/palette/domain/thresholds.js +12 -0
  47. package/dist/palette/domain/tokens.d.ts +6 -0
  48. package/dist/palette/domain/tokens.js +25 -0
  49. package/dist/palette/domain/types.d.ts +22 -0
  50. package/dist/palette/domain/types.js +1 -0
  51. package/dist/palette/errors.d.ts +10 -0
  52. package/dist/palette/errors.js +14 -0
  53. package/dist/palette/index.d.ts +10 -0
  54. package/dist/palette/index.js +6 -0
  55. package/dist/palette/infrastructure/guards.d.ts +2 -0
  56. package/dist/palette/infrastructure/guards.js +1 -0
  57. package/dist/palette/infrastructure/series-ink.d.ts +12 -0
  58. package/dist/palette/infrastructure/series-ink.js +30 -0
  59. package/dist/palette/infrastructure/theme-base.d.ts +7 -0
  60. package/dist/palette/infrastructure/theme-base.js +44 -0
  61. package/generated/tokens.css +92 -0
  62. package/generated/tokens.d.ts +73 -0
  63. package/generated/tokens.json +223 -0
  64. package/package.json +66 -1
@@ -0,0 +1,14 @@
1
+ /** Erreurs typées de la dérivation de palettes : union fermée à champ `code`. */
2
+ export const PALETTE_ERROR_CODES = [
3
+ 'palette.bad-hue',
4
+ 'palette.bad-base',
5
+ 'palette.cvd-failed',
6
+ 'palette.contrast-failed',
7
+ 'palette.sequential-failed',
8
+ 'palette.diverging-failed',
9
+ ];
10
+ export const paletteError = (code, message, path = '') => ({
11
+ code,
12
+ message,
13
+ path,
14
+ });
@@ -0,0 +1,10 @@
1
+ export type { PaletteError, PaletteErrorCode } from './errors.ts';
2
+ export { PALETTE_ERROR_CODES } from './errors.ts';
3
+ export { derivePalettes } from './domain/derive.ts';
4
+ export type { Ink, Inks } from './domain/ink.ts';
5
+ export { inkOn } from './domain/ink.ts';
6
+ export { lightDarkTokens, paletteTokens } from './domain/tokens.ts';
7
+ export type { Palettes, Theme, ThemeBase } from './domain/types.ts';
8
+ export type { SeriesInk } from './infrastructure/series-ink.ts';
9
+ export { seriesInksFromTokens } from './infrastructure/series-ink.ts';
10
+ export { readThemeColor, themeBaseFromTokens } from './infrastructure/theme-base.ts';
@@ -0,0 +1,6 @@
1
+ export { PALETTE_ERROR_CODES } from "./errors.js";
2
+ export { derivePalettes } from "./domain/derive.js";
3
+ export { inkOn } from "./domain/ink.js";
4
+ export { lightDarkTokens, paletteTokens } from "./domain/tokens.js";
5
+ export { seriesInksFromTokens } from "./infrastructure/series-ink.js";
6
+ export { readThemeColor, themeBaseFromTokens } from "./infrastructure/theme-base.js";
@@ -0,0 +1,2 @@
1
+ export type UnknownRecord = Readonly<Record<string, unknown>>;
2
+ export declare const isRecord: (value: unknown) => value is UnknownRecord;
@@ -0,0 +1 @@
1
+ export const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
@@ -0,0 +1,12 @@
1
+ import type { Ink } from '../domain/ink.ts';
2
+ import type { Result } from '../domain/result.ts';
3
+ /** Neutre à poser sur une couleur de série, par thème ; `null` : aucun n'atteint 4,5:1. */
4
+ export interface SeriesInk {
5
+ readonly light: Ink | null;
6
+ readonly dark: Ink | null;
7
+ }
8
+ /**
9
+ * Texte lisible (≥ 4,5:1) sur chacune des `count` couleurs `--pp-chart-N`, lues dans `tokens.json`,
10
+ * dans les deux thèmes.
11
+ */
12
+ export declare function seriesInksFromTokens(tokens: unknown, count: number): Result<readonly SeriesInk[]>;
@@ -0,0 +1,30 @@
1
+ import { inkOn } from "../domain/ink.js";
2
+ import { fail, ok } from "../domain/result.js";
3
+ import { readThemeColor, themeBaseFromTokens } from "./theme-base.js";
4
+ function inkIn(tokens, theme, rank) {
5
+ const base = themeBaseFromTokens(tokens, theme);
6
+ if (!base.ok)
7
+ return base;
8
+ const name = `--pp-chart-${rank}`;
9
+ const color = readThemeColor(tokens, theme, name);
10
+ if (!color)
11
+ return fail('palette.bad-base', `tokens.json : ${name} absent (${theme}).`, name);
12
+ return ok(inkOn(color, base.value));
13
+ }
14
+ /**
15
+ * Texte lisible (≥ 4,5:1) sur chacune des `count` couleurs `--pp-chart-N`, lues dans `tokens.json`,
16
+ * dans les deux thèmes.
17
+ */
18
+ export function seriesInksFromTokens(tokens, count) {
19
+ const inks = [];
20
+ for (let rank = 1; rank <= count; rank += 1) {
21
+ const light = inkIn(tokens, 'light', rank);
22
+ if (!light.ok)
23
+ return light;
24
+ const dark = inkIn(tokens, 'dark', rank);
25
+ if (!dark.ok)
26
+ return dark;
27
+ inks.push({ light: light.value, dark: dark.value });
28
+ }
29
+ return ok(inks);
30
+ }
@@ -0,0 +1,7 @@
1
+ import type { Oklch } from '../../lib/color.ts';
2
+ import type { Theme, ThemeBase } from '../domain/types.ts';
3
+ import type { Result } from '../domain/result.ts';
4
+ /** Couleur OKLCH d'un jeton (`--pp-*`) d'un thème de `tokens.json`, `undefined` si absente. */
5
+ export declare function readThemeColor(tokens: unknown, theme: Theme, name: string): Oklch | undefined;
6
+ /** Lit accent, texte sur accent, fond, texte et trait d'un thème dans `tokens.json` (`themes.*`). */
7
+ export declare function themeBaseFromTokens(tokens: unknown, theme: Theme): Result<ThemeBase>;
@@ -0,0 +1,44 @@
1
+ import { parseOklch } from "../../lib/color.js";
2
+ import { fail, ok } from "../domain/result.js";
3
+ import { isRecord } from "./guards.js";
4
+ const NAMES = {
5
+ accent: '--pp-color-accent',
6
+ onAccent: '--pp-color-on-accent',
7
+ bg: '--pp-color-bg',
8
+ fg: '--pp-color-fg',
9
+ line: '--pp-color-line',
10
+ };
11
+ function readColor(theme, name) {
12
+ const entry = isRecord(theme) ? theme[name] : undefined;
13
+ const text = isRecord(entry) ? entry['oklch'] : undefined;
14
+ if (typeof text !== 'string')
15
+ return undefined;
16
+ try {
17
+ return parseOklch(text);
18
+ }
19
+ catch {
20
+ return undefined;
21
+ }
22
+ }
23
+ /** Couleur OKLCH d'un jeton (`--pp-*`) d'un thème de `tokens.json`, `undefined` si absente. */
24
+ export function readThemeColor(tokens, theme, name) {
25
+ const themes = isRecord(tokens) ? tokens['themes'] : undefined;
26
+ return readColor(isRecord(themes) ? themes[theme] : undefined, name);
27
+ }
28
+ /** Lit accent, texte sur accent, fond, texte et trait d'un thème dans `tokens.json` (`themes.*`). */
29
+ export function themeBaseFromTokens(tokens, theme) {
30
+ const themes = isRecord(tokens) ? tokens['themes'] : undefined;
31
+ const source = isRecord(themes) ? themes[theme] : undefined;
32
+ const read = (key) => readColor(source, NAMES[key]);
33
+ const [accent, onAccent, bg, fg, line] = [
34
+ read('accent'),
35
+ read('onAccent'),
36
+ read('bg'),
37
+ read('fg'),
38
+ read('line'),
39
+ ];
40
+ if (!accent || !onAccent || !bg || !fg || !line) {
41
+ return fail('palette.bad-base', `tokens.json : thème « ${theme} » incomplet.`, theme);
42
+ }
43
+ return ok({ accent, onAccent, bg, fg, line });
44
+ }
@@ -0,0 +1,92 @@
1
+ /* Fichier généré par scripts/build.ts depuis src/tokens/ : ne pas éditer. */
2
+
3
+ :root {
4
+ color-scheme: light dark;
5
+
6
+ --pp-chart-1: light-dark(oklch(47% 0.19 270.7), oklch(78% 0.1 270.7));
7
+ --pp-chart-2: light-dark(oklch(64% 0.149 60.7), oklch(52% 0.1093 75.7));
8
+ --pp-chart-3: light-dark(oklch(20% 0.0787 30.7), oklch(92% 0.067 75.7));
9
+ --pp-chart-4: light-dark(oklch(64% 0.109 195.7), oklch(52% 0.16 285.7));
10
+ --pp-chart-5: light-dark(oklch(44% 0.1781 0.7), oklch(72% 0.1514 75.7));
11
+ --pp-chart-6: light-dark(oklch(64% 0.2025 285.7), oklch(60% 0.1 165.7));
12
+ --pp-color-accent: light-dark(oklch(47% 0.19 270.7), oklch(78% 0.1 270.7));
13
+ --pp-color-bg: light-dark(oklch(98.5% 0.004 270.7), oklch(20.1% 0.0124 270.7));
14
+ --pp-color-control: light-dark(oklch(60% 0.02 270.7), oklch(60% 0.02 270.7));
15
+ --pp-color-fg: light-dark(oklch(21.5% 0.016 270.7), oklch(94.5% 0.008 270.7));
16
+ --pp-color-focus: light-dark(oklch(47% 0.19 270.7), oklch(78% 0.1 270.7));
17
+ --pp-color-line: light-dark(oklch(88.5% 0.01 270.7), oklch(34% 0.016 270.7));
18
+ --pp-color-media-placeholder: light-dark(oklch(91.5% 0.01 270.7), oklch(30% 0.015 270.7));
19
+ --pp-color-muted: light-dark(oklch(43% 0.022 270.7), oklch(79% 0.018 270.7));
20
+ --pp-color-on-accent: light-dark(oklch(99.5% 0.002 270.7), oklch(20.1% 0.0124 270.7));
21
+ --pp-color-status-degraded: light-dark(oklch(50% 0.1 70), oklch(82% 0.11 75));
22
+ --pp-color-status-failed: light-dark(oklch(50% 0.17 25), oklch(76% 0.13 25));
23
+ --pp-color-status-passed: light-dark(oklch(47% 0.105 155), oklch(80% 0.13 155));
24
+ --pp-color-status-running: light-dark(oklch(47% 0.19 270.7), oklch(78% 0.1 270.7));
25
+ --pp-color-surface: light-dark(oklch(95.8% 0.007 270.7), oklch(25% 0.014 270.7));
26
+ --pp-duration-base: 160ms;
27
+ --pp-duration-fast: 100ms;
28
+ --pp-easing-standard: cubic-bezier(0.2, 0, 0, 1);
29
+ --pp-font-family-mono:
30
+ 'Atkinson Hyperlegible Mono Variable', 'Atkinson Mono Fallback', ui-monospace, monospace;
31
+ --pp-font-family-sans:
32
+ 'Atkinson Hyperlegible Next Variable', 'Atkinson Next Fallback', system-ui, sans-serif;
33
+ --pp-font-line-height-body: 1.55;
34
+ --pp-font-line-height-heading: 1.15;
35
+ --pp-font-size--1: 0.9rem;
36
+ --pp-font-size-0: 1.125rem;
37
+ --pp-font-size-1: 1.406rem;
38
+ --pp-font-size-2: 1.758rem;
39
+ --pp-font-size-3: 2.197rem;
40
+ --pp-font-size-4: 2.747rem;
41
+ --pp-font-weight-bold: 700;
42
+ --pp-font-weight-medium: 500;
43
+ --pp-font-weight-regular: 400;
44
+ --pp-font-weight-semibold: 600;
45
+ --pp-media-budget-card: 80;
46
+ --pp-media-budget-gallery: 150;
47
+ --pp-media-budget-hero: 200;
48
+ --pp-media-radius: 0.5rem;
49
+ --pp-media-rule: 1px;
50
+ --pp-media-scrim-color: oklch(20.1% 0.0124 270.7);
51
+ --pp-media-scrim-opacity: 0.72;
52
+ --pp-media-scrim-text: oklch(99.5% 0.002 270.7);
53
+ --pp-radius-control: 0.25rem;
54
+ --pp-radius-surface: 0.5rem;
55
+ --pp-ratio-landscape: 1.5;
56
+ --pp-ratio-portrait: 0.8;
57
+ --pp-ratio-square: 1;
58
+ --pp-ratio-wide: 1.7778;
59
+ --pp-size-control-height: 2.75rem;
60
+ --pp-size-focus-offset: 2px;
61
+ --pp-size-focus-width: 2px;
62
+ --pp-size-measure: 36rem;
63
+ --pp-size-page: 72rem;
64
+ --pp-size-rule: 1px;
65
+ --pp-size-target-min: 1.5rem;
66
+ --pp-space-2xl: 4rem;
67
+ --pp-space-2xs: 0.5rem;
68
+ --pp-space-3xl: 6rem;
69
+ --pp-space-3xs: 0.25rem;
70
+ --pp-space-l: 2rem;
71
+ --pp-space-m: 1.5rem;
72
+ --pp-space-s: 1rem;
73
+ --pp-space-xl: 3rem;
74
+ --pp-space-xs: 0.75rem;
75
+ --pp-z-overlay: 100;
76
+ --pp-z-sticky: 10;
77
+ }
78
+
79
+ :root[data-theme='light'] {
80
+ color-scheme: light;
81
+ }
82
+
83
+ :root[data-theme='dark'] {
84
+ color-scheme: dark;
85
+ }
86
+
87
+ @media (prefers-reduced-motion: reduce) {
88
+ :root {
89
+ --pp-duration-base: 0ms;
90
+ --pp-duration-fast: 0ms;
91
+ }
92
+ }
@@ -0,0 +1,73 @@
1
+ // Fichier généré par scripts/build.ts depuis src/tokens/ : ne pas éditer.
2
+ export type TokenName =
3
+ | '--pp-chart-1'
4
+ | '--pp-chart-2'
5
+ | '--pp-chart-3'
6
+ | '--pp-chart-4'
7
+ | '--pp-chart-5'
8
+ | '--pp-chart-6'
9
+ | '--pp-color-accent'
10
+ | '--pp-color-bg'
11
+ | '--pp-color-control'
12
+ | '--pp-color-fg'
13
+ | '--pp-color-focus'
14
+ | '--pp-color-line'
15
+ | '--pp-color-media-placeholder'
16
+ | '--pp-color-muted'
17
+ | '--pp-color-on-accent'
18
+ | '--pp-color-status-degraded'
19
+ | '--pp-color-status-failed'
20
+ | '--pp-color-status-passed'
21
+ | '--pp-color-status-running'
22
+ | '--pp-color-surface'
23
+ | '--pp-duration-base'
24
+ | '--pp-duration-fast'
25
+ | '--pp-easing-standard'
26
+ | '--pp-font-family-mono'
27
+ | '--pp-font-family-sans'
28
+ | '--pp-font-line-height-body'
29
+ | '--pp-font-line-height-heading'
30
+ | '--pp-font-size--1'
31
+ | '--pp-font-size-0'
32
+ | '--pp-font-size-1'
33
+ | '--pp-font-size-2'
34
+ | '--pp-font-size-3'
35
+ | '--pp-font-size-4'
36
+ | '--pp-font-weight-bold'
37
+ | '--pp-font-weight-medium'
38
+ | '--pp-font-weight-regular'
39
+ | '--pp-font-weight-semibold'
40
+ | '--pp-media-budget-card'
41
+ | '--pp-media-budget-gallery'
42
+ | '--pp-media-budget-hero'
43
+ | '--pp-media-radius'
44
+ | '--pp-media-rule'
45
+ | '--pp-media-scrim-color'
46
+ | '--pp-media-scrim-opacity'
47
+ | '--pp-media-scrim-text'
48
+ | '--pp-radius-control'
49
+ | '--pp-radius-surface'
50
+ | '--pp-ratio-landscape'
51
+ | '--pp-ratio-portrait'
52
+ | '--pp-ratio-square'
53
+ | '--pp-ratio-wide'
54
+ | '--pp-size-control-height'
55
+ | '--pp-size-focus-offset'
56
+ | '--pp-size-focus-width'
57
+ | '--pp-size-measure'
58
+ | '--pp-size-page'
59
+ | '--pp-size-rule'
60
+ | '--pp-size-target-min'
61
+ | '--pp-space-2xl'
62
+ | '--pp-space-2xs'
63
+ | '--pp-space-3xl'
64
+ | '--pp-space-3xs'
65
+ | '--pp-space-l'
66
+ | '--pp-space-m'
67
+ | '--pp-space-s'
68
+ | '--pp-space-xl'
69
+ | '--pp-space-xs'
70
+ | '--pp-z-overlay'
71
+ | '--pp-z-sticky';
72
+
73
+ export declare const themeColor: { readonly light: '#f9fafd'; readonly dark: '#14161c' };
@@ -0,0 +1,223 @@
1
+ {
2
+ "themes": {
3
+ "light": {
4
+ "--pp-chart-1": {
5
+ "oklch": "oklch(47% 0.19 270.7)",
6
+ "hex": "#3749c3"
7
+ },
8
+ "--pp-chart-2": {
9
+ "oklch": "oklch(64% 0.149 60.7)",
10
+ "hex": "#cb7300"
11
+ },
12
+ "--pp-chart-3": {
13
+ "oklch": "oklch(20% 0.0787 30.7)",
14
+ "hex": "#310100"
15
+ },
16
+ "--pp-chart-4": {
17
+ "oklch": "oklch(64% 0.109 195.7)",
18
+ "hex": "#01a0a1"
19
+ },
20
+ "--pp-chart-5": {
21
+ "oklch": "oklch(44% 0.1781 0.7)",
22
+ "hex": "#98004d"
23
+ },
24
+ "--pp-chart-6": {
25
+ "oklch": "oklch(64% 0.2025 285.7)",
26
+ "hex": "#8671ff"
27
+ },
28
+ "--pp-color-accent": {
29
+ "oklch": "oklch(47% 0.19 270.7)",
30
+ "hex": "#3749c3"
31
+ },
32
+ "--pp-color-bg": {
33
+ "oklch": "oklch(98.5% 0.004 270.7)",
34
+ "hex": "#f9fafd"
35
+ },
36
+ "--pp-color-control": {
37
+ "oklch": "oklch(60% 0.02 270.7)",
38
+ "hex": "#7b808d"
39
+ },
40
+ "--pp-color-fg": {
41
+ "oklch": "oklch(21.5% 0.016 270.7)",
42
+ "hex": "#171921"
43
+ },
44
+ "--pp-color-focus": {
45
+ "oklch": "oklch(47% 0.19 270.7)",
46
+ "hex": "#3749c3"
47
+ },
48
+ "--pp-color-line": {
49
+ "oklch": "oklch(88.5% 0.01 270.7)",
50
+ "hex": "#d6d9e0"
51
+ },
52
+ "--pp-color-media-placeholder": {
53
+ "oklch": "oklch(91.5% 0.01 270.7)",
54
+ "hex": "#e0e3ea"
55
+ },
56
+ "--pp-color-muted": {
57
+ "oklch": "oklch(43% 0.022 270.7)",
58
+ "hex": "#4b4f5c"
59
+ },
60
+ "--pp-color-on-accent": {
61
+ "oklch": "oklch(99.5% 0.002 270.7)",
62
+ "hex": "#fdfdff"
63
+ },
64
+ "--pp-color-status-degraded": {
65
+ "oklch": "oklch(50% 0.1 70)",
66
+ "hex": "#875814"
67
+ },
68
+ "--pp-color-status-failed": {
69
+ "oklch": "oklch(50% 0.17 25)",
70
+ "hex": "#b02a2d"
71
+ },
72
+ "--pp-color-status-passed": {
73
+ "oklch": "oklch(47% 0.105 155)",
74
+ "hex": "#196c40"
75
+ },
76
+ "--pp-color-status-running": {
77
+ "oklch": "oklch(47% 0.19 270.7)",
78
+ "hex": "#3749c3"
79
+ },
80
+ "--pp-color-surface": {
81
+ "oklch": "oklch(95.8% 0.007 270.7)",
82
+ "hex": "#eff1f6"
83
+ }
84
+ },
85
+ "dark": {
86
+ "--pp-chart-1": {
87
+ "oklch": "oklch(78% 0.1 270.7)",
88
+ "hex": "#9fb4f8"
89
+ },
90
+ "--pp-chart-2": {
91
+ "oklch": "oklch(52% 0.1093 75.7)",
92
+ "hex": "#8d5e00"
93
+ },
94
+ "--pp-chart-3": {
95
+ "oklch": "oklch(92% 0.067 75.7)",
96
+ "hex": "#ffdfb3"
97
+ },
98
+ "--pp-chart-4": {
99
+ "oklch": "oklch(52% 0.16 285.7)",
100
+ "hex": "#6455bf"
101
+ },
102
+ "--pp-chart-5": {
103
+ "oklch": "oklch(72% 0.1514 75.7)",
104
+ "hex": "#da9500"
105
+ },
106
+ "--pp-chart-6": {
107
+ "oklch": "oklch(60% 0.1 165.7)",
108
+ "hex": "#399372"
109
+ },
110
+ "--pp-color-accent": {
111
+ "oklch": "oklch(78% 0.1 270.7)",
112
+ "hex": "#9fb4f8"
113
+ },
114
+ "--pp-color-bg": {
115
+ "oklch": "oklch(20.1% 0.0124 270.7)",
116
+ "hex": "#14161c"
117
+ },
118
+ "--pp-color-control": {
119
+ "oklch": "oklch(60% 0.02 270.7)",
120
+ "hex": "#7b808d"
121
+ },
122
+ "--pp-color-fg": {
123
+ "oklch": "oklch(94.5% 0.008 270.7)",
124
+ "hex": "#ebedf2"
125
+ },
126
+ "--pp-color-focus": {
127
+ "oklch": "oklch(78% 0.1 270.7)",
128
+ "hex": "#9fb4f8"
129
+ },
130
+ "--pp-color-line": {
131
+ "oklch": "oklch(34% 0.016 270.7)",
132
+ "hex": "#353840"
133
+ },
134
+ "--pp-color-media-placeholder": {
135
+ "oklch": "oklch(30% 0.015 270.7)",
136
+ "hex": "#2b2e36"
137
+ },
138
+ "--pp-color-muted": {
139
+ "oklch": "oklch(79% 0.018 270.7)",
140
+ "hex": "#b6bac7"
141
+ },
142
+ "--pp-color-on-accent": {
143
+ "oklch": "oklch(20.1% 0.0124 270.7)",
144
+ "hex": "#14161c"
145
+ },
146
+ "--pp-color-status-degraded": {
147
+ "oklch": "oklch(82% 0.11 75)",
148
+ "hex": "#eeba70"
149
+ },
150
+ "--pp-color-status-failed": {
151
+ "oklch": "oklch(76% 0.13 25)",
152
+ "hex": "#f98f87"
153
+ },
154
+ "--pp-color-status-passed": {
155
+ "oklch": "oklch(80% 0.13 155)",
156
+ "hex": "#72d699"
157
+ },
158
+ "--pp-color-status-running": {
159
+ "oklch": "oklch(78% 0.1 270.7)",
160
+ "hex": "#9fb4f8"
161
+ },
162
+ "--pp-color-surface": {
163
+ "oklch": "oklch(25% 0.014 270.7)",
164
+ "hex": "#1f2129"
165
+ }
166
+ }
167
+ },
168
+ "base": {
169
+ "--pp-duration-base": "160ms",
170
+ "--pp-duration-fast": "100ms",
171
+ "--pp-easing-standard": "cubic-bezier(0.2, 0, 0, 1)",
172
+ "--pp-font-family-mono": "'Atkinson Hyperlegible Mono Variable', 'Atkinson Mono Fallback', ui-monospace, monospace",
173
+ "--pp-font-family-sans": "'Atkinson Hyperlegible Next Variable', 'Atkinson Next Fallback', system-ui, sans-serif",
174
+ "--pp-font-line-height-body": "1.55",
175
+ "--pp-font-line-height-heading": "1.15",
176
+ "--pp-font-size--1": "0.9rem",
177
+ "--pp-font-size-0": "1.125rem",
178
+ "--pp-font-size-1": "1.406rem",
179
+ "--pp-font-size-2": "1.758rem",
180
+ "--pp-font-size-3": "2.197rem",
181
+ "--pp-font-size-4": "2.747rem",
182
+ "--pp-font-weight-bold": "700",
183
+ "--pp-font-weight-medium": "500",
184
+ "--pp-font-weight-regular": "400",
185
+ "--pp-font-weight-semibold": "600",
186
+ "--pp-media-budget-card": "80",
187
+ "--pp-media-budget-gallery": "150",
188
+ "--pp-media-budget-hero": "200",
189
+ "--pp-media-radius": "0.5rem",
190
+ "--pp-media-rule": "1px",
191
+ "--pp-media-scrim-color": "oklch(20.1% 0.0124 270.7)",
192
+ "--pp-media-scrim-opacity": "0.72",
193
+ "--pp-media-scrim-text": "oklch(99.5% 0.002 270.7)",
194
+ "--pp-radius-control": "0.25rem",
195
+ "--pp-radius-surface": "0.5rem",
196
+ "--pp-ratio-landscape": "1.5",
197
+ "--pp-ratio-portrait": "0.8",
198
+ "--pp-ratio-square": "1",
199
+ "--pp-ratio-wide": "1.7778",
200
+ "--pp-size-control-height": "2.75rem",
201
+ "--pp-size-focus-offset": "2px",
202
+ "--pp-size-focus-width": "2px",
203
+ "--pp-size-measure": "36rem",
204
+ "--pp-size-page": "72rem",
205
+ "--pp-size-rule": "1px",
206
+ "--pp-size-target-min": "1.5rem",
207
+ "--pp-space-2xl": "4rem",
208
+ "--pp-space-2xs": "0.5rem",
209
+ "--pp-space-3xl": "6rem",
210
+ "--pp-space-3xs": "0.25rem",
211
+ "--pp-space-l": "2rem",
212
+ "--pp-space-m": "1.5rem",
213
+ "--pp-space-s": "1rem",
214
+ "--pp-space-xl": "3rem",
215
+ "--pp-space-xs": "0.75rem",
216
+ "--pp-z-overlay": "100",
217
+ "--pp-z-sticky": "10"
218
+ },
219
+ "themeColor": {
220
+ "light": "#f9fafd",
221
+ "dark": "#14161c"
222
+ }
223
+ }
package/package.json CHANGED
@@ -1 +1,66 @@
1
- {"name":"@paulperigault/tokens","version":"0.0.0","license":"MIT","description":"Placeholder published before the release workflow of PaulPerigault/design-system."}
1
+ {
2
+ "name": "@paulperigault/tokens",
3
+ "version": "0.1.0",
4
+ "description": "Design tokens DTCG 2025.10 de paulperigault.fr : CSS, JSON et types générés ; couleur et contraste.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Paul Perigault",
8
+ "keywords": [
9
+ "design-tokens",
10
+ "dtcg",
11
+ "oklch"
12
+ ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/PaulPerigault/design-system.git",
16
+ "directory": "packages/tokens"
17
+ },
18
+ "homepage": "https://design.paulperigault.dev",
19
+ "bugs": "https://github.com/PaulPerigault/design-system/issues",
20
+ "engines": {
21
+ "node": ">=24"
22
+ },
23
+ "sideEffects": false,
24
+ "files": [
25
+ "dist",
26
+ "generated",
27
+ "README.md"
28
+ ],
29
+ "publishConfig": {
30
+ "registry": "https://registry.npmjs.org/",
31
+ "access": "public",
32
+ "provenance": true
33
+ },
34
+ "scripts": {
35
+ "prepublishOnly": "node ../../tools/checks/check-publish-env.mjs",
36
+ "build": "node scripts/build.ts && node --eval \"fs.rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
37
+ "check": "node scripts/build.ts --check",
38
+ "prepack": "npm run build"
39
+ },
40
+ "exports": {
41
+ "./color": {
42
+ "@paulperigault/source": "./src/lib/color.ts",
43
+ "types": "./dist/lib/color.d.ts",
44
+ "default": "./dist/lib/color.js"
45
+ },
46
+ "./contrast": {
47
+ "@paulperigault/source": "./src/lib/contrast.ts",
48
+ "types": "./dist/lib/contrast.d.ts",
49
+ "default": "./dist/lib/contrast.js"
50
+ },
51
+ "./customize": {
52
+ "@paulperigault/source": "./src/customize/index.ts",
53
+ "types": "./dist/customize/index.d.ts",
54
+ "default": "./dist/customize/index.js"
55
+ },
56
+ "./palette": {
57
+ "@paulperigault/source": "./src/palette/index.ts",
58
+ "types": "./dist/palette/index.d.ts",
59
+ "default": "./dist/palette/index.js"
60
+ },
61
+ "./tokens.css": "./generated/tokens.css",
62
+ "./tokens.json": "./generated/tokens.json",
63
+ "./types": "./generated/tokens.d.ts",
64
+ "./package.json": "./package.json"
65
+ }
66
+ }