@joystyk/ui 0.0.0-stage → 0.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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/NOTICE +36 -0
- package/README.md +33 -2
- package/dist/ad-slot.d.ts +129 -0
- package/dist/ad-slot.js +628 -0
- package/dist/ad-slot.js.map +1 -0
- package/dist/ad-wire.d.ts +96 -0
- package/dist/ad-wire.js +101 -0
- package/dist/ad-wire.js.map +1 -0
- package/dist/button.d.ts +40 -0
- package/dist/button.js +133 -0
- package/dist/button.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/slots.d.ts +38 -0
- package/dist/slots.js +154 -0
- package/dist/slots.js.map +1 -0
- package/dist/tokens.css +98 -0
- package/package.json +72 -3
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Joystyk design tokens: the frame's colors, type, space, shape and motion.
|
|
3
|
+
*
|
|
4
|
+
* Load this once per page, before other styles. Components inside shadow roots read the
|
|
5
|
+
* tokens through inheritance. Every color is oklch. `color-scheme: light dark` makes each
|
|
6
|
+
* `light-dark()` pair follow the visitor's `prefers-color-scheme`; set `color-scheme` to
|
|
7
|
+
* `light` or `dark` on an element to pin a theme for that subtree.
|
|
8
|
+
*
|
|
9
|
+
* Games may theme their own canvas, but the frame uses only these tokens.
|
|
10
|
+
*/
|
|
11
|
+
@layer reset, tokens, base, layout, components, utilities;
|
|
12
|
+
|
|
13
|
+
@layer tokens {
|
|
14
|
+
:root {
|
|
15
|
+
color-scheme: light dark;
|
|
16
|
+
|
|
17
|
+
/* Color: one brand hue, everything else derived from it. */
|
|
18
|
+
--jy-hue: 285;
|
|
19
|
+
--jy-surface: light-dark(oklch(98.5% 0.006 var(--jy-hue)), oklch(17% 0.02 var(--jy-hue)));
|
|
20
|
+
--jy-surface-raised: light-dark(oklch(100% 0 0), oklch(22% 0.025 var(--jy-hue)));
|
|
21
|
+
--jy-text: light-dark(oklch(22% 0.03 var(--jy-hue)), oklch(94% 0.012 var(--jy-hue)));
|
|
22
|
+
--jy-text-muted: color-mix(in oklch, var(--jy-text) 68%, var(--jy-surface));
|
|
23
|
+
--jy-border: color-mix(in oklch, var(--jy-text) 16%, var(--jy-surface));
|
|
24
|
+
--jy-accent: light-dark(oklch(50% 0.2 var(--jy-hue)), oklch(76% 0.13 var(--jy-hue)));
|
|
25
|
+
--jy-accent-hover: light-dark(oklch(44% 0.2 var(--jy-hue)), oklch(82% 0.11 var(--jy-hue)));
|
|
26
|
+
--jy-on-accent: light-dark(oklch(99% 0.005 var(--jy-hue)), oklch(18% 0.03 var(--jy-hue)));
|
|
27
|
+
--jy-focus-ring: light-dark(oklch(55% 0.22 var(--jy-hue)), oklch(80% 0.15 var(--jy-hue)));
|
|
28
|
+
--jy-danger: light-dark(oklch(50% 0.19 25), oklch(75% 0.14 25));
|
|
29
|
+
--jy-success: light-dark(oklch(50% 0.13 150), oklch(78% 0.13 150));
|
|
30
|
+
|
|
31
|
+
/* Type: a system stack and a fluid scale. */
|
|
32
|
+
--jy-font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
33
|
+
--jy-font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;
|
|
34
|
+
--jy-step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.94rem);
|
|
35
|
+
--jy-step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
|
|
36
|
+
--jy-step-1: clamp(1.25rem, 1.1rem + 0.7vw, 1.62rem);
|
|
37
|
+
--jy-step-2: clamp(1.56rem, 1.3rem + 1.3vw, 2.33rem);
|
|
38
|
+
--jy-step-3: clamp(1.95rem, 1.5rem + 2.2vw, 3.35rem);
|
|
39
|
+
|
|
40
|
+
/* Space: a fluid scale for gaps and padding. */
|
|
41
|
+
--jy-space-3xs: 0.25rem;
|
|
42
|
+
--jy-space-2xs: 0.5rem;
|
|
43
|
+
--jy-space-xs: 0.75rem;
|
|
44
|
+
--jy-space-s: clamp(1rem, 0.9rem + 0.4vw, 1.25rem);
|
|
45
|
+
--jy-space-m: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
|
|
46
|
+
--jy-space-l: clamp(2rem, 1.6rem + 1.6vw, 3rem);
|
|
47
|
+
|
|
48
|
+
/* Shape and depth. */
|
|
49
|
+
--jy-radius-s: 0.5rem;
|
|
50
|
+
--jy-radius-m: 0.75rem;
|
|
51
|
+
--jy-radius-pill: 999px;
|
|
52
|
+
--jy-shadow: 0 1px 2px oklch(20% 0.03 var(--jy-hue) / 0.08),
|
|
53
|
+
0 8px 24px oklch(20% 0.03 var(--jy-hue) / 0.1);
|
|
54
|
+
|
|
55
|
+
/* Touch targets meet WCAG 2.5.5 (44 by 44 CSS pixels). */
|
|
56
|
+
--jy-target-min: 2.75rem;
|
|
57
|
+
|
|
58
|
+
/* Motion: short and purposeful. Decorative motion stops under reduced motion. */
|
|
59
|
+
--jy-duration-fast: 120ms;
|
|
60
|
+
--jy-duration: 200ms;
|
|
61
|
+
--jy-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@media (prefers-reduced-motion: reduce) {
|
|
65
|
+
:root {
|
|
66
|
+
--jy-duration-fast: 0ms;
|
|
67
|
+
--jy-duration: 0ms;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@layer base {
|
|
73
|
+
body {
|
|
74
|
+
background: var(--jy-surface);
|
|
75
|
+
color: var(--jy-text);
|
|
76
|
+
font-family: var(--jy-font-sans);
|
|
77
|
+
font-size: var(--jy-step-0);
|
|
78
|
+
line-height: 1.5;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:focus-visible {
|
|
82
|
+
outline: 2px solid var(--jy-focus-ring);
|
|
83
|
+
outline-offset: 2px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@layer components {
|
|
88
|
+
/*
|
|
89
|
+
* A page the service worker answered from its cache, because the network failed, carries
|
|
90
|
+
* `data-offline` on <html> (@joystyk/pwa, offline-mark.ts). Offline there are no ads, so
|
|
91
|
+
* its ad slots take no space from the first paint, before <ad-slot> has hydrated, and the
|
|
92
|
+
* page never shifts when they collapse. A slot comes back once it hears the browser is
|
|
93
|
+
* online (its `online` state), as on any other page.
|
|
94
|
+
*/
|
|
95
|
+
:root[data-offline] ad-slot:not(:state(online)) {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,75 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joystyk/ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Joystyk design tokens, frame components, and <ad-slot> with the billboard slot registry and its wire format, built with Gyral.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"**/index.[jt]s",
|
|
9
|
+
"**/button.[jt]s",
|
|
10
|
+
"**/ad-slot.[jt]s",
|
|
11
|
+
"**/tokens.css"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./button": {
|
|
19
|
+
"types": "./dist/button.d.ts",
|
|
20
|
+
"default": "./dist/button.js"
|
|
21
|
+
},
|
|
22
|
+
"./ad-slot": {
|
|
23
|
+
"types": "./dist/ad-slot.d.ts",
|
|
24
|
+
"default": "./dist/ad-slot.js"
|
|
25
|
+
},
|
|
26
|
+
"./ad-wire": {
|
|
27
|
+
"types": "./dist/ad-wire.d.ts",
|
|
28
|
+
"default": "./dist/ad-wire.js"
|
|
29
|
+
},
|
|
30
|
+
"./slots": {
|
|
31
|
+
"types": "./dist/slots.d.ts",
|
|
32
|
+
"default": "./dist/slots.js"
|
|
33
|
+
},
|
|
34
|
+
"./tokens.css": "./dist/tokens.css"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@gyral/core": "0.3.1",
|
|
38
|
+
"zod": "4.6.5"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@gyral/testing": "0.3.1",
|
|
42
|
+
"axe-core": "4.13.0",
|
|
43
|
+
"parse5": "8.0.1",
|
|
44
|
+
"typescript": "5.9.3",
|
|
45
|
+
"vite": "8.3.3",
|
|
46
|
+
"vitest": "4.1.11"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"dist",
|
|
53
|
+
"README.md",
|
|
54
|
+
"LICENSE",
|
|
55
|
+
"NOTICE",
|
|
56
|
+
"CHANGELOG.md"
|
|
57
|
+
],
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=24.15.0"
|
|
60
|
+
},
|
|
61
|
+
"license": "MIT",
|
|
62
|
+
"repository": {
|
|
63
|
+
"type": "git",
|
|
64
|
+
"url": "git+https://github.com/joystyk-games/game-libraries.git",
|
|
65
|
+
"directory": "packages/ui"
|
|
66
|
+
},
|
|
67
|
+
"homepage": "https://github.com/joystyk-games/game-libraries/tree/main/packages/ui#readme",
|
|
68
|
+
"bugs": {
|
|
69
|
+
"url": "https://github.com/joystyk-games/game-libraries/issues"
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"typecheck": "tsc --noEmit",
|
|
73
|
+
"build": "node ../../scripts/build-package.ts"
|
|
74
|
+
}
|
|
6
75
|
}
|