@42-central/ui-react 0.22.0 → 0.24.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/dist/{chunk-DJAXXLN6.js → chunk-F2FSHVO5.js} +3 -3
- package/dist/{chunk-DJAXXLN6.js.map → chunk-F2FSHVO5.js.map} +1 -1
- package/dist/components/ambient-background/ambient-background.d.ts +14 -3
- package/dist/components/ambient-background/ambient-background.d.ts.map +1 -1
- package/dist/components/ambient-background/index.js +222 -1
- package/dist/components/ambient-background/index.js.map +1 -1
- package/dist/components/ambient-background/starfield.d.ts +13 -0
- package/dist/components/ambient-background/starfield.d.ts.map +1 -0
- package/dist/components/camera/index.js +2 -2
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/geodesic/a11y.d.ts +15 -0
- package/dist/components/geodesic/a11y.d.ts.map +1 -0
- package/dist/components/geodesic/activity-badge.d.ts +5 -0
- package/dist/components/geodesic/activity-badge.d.ts.map +1 -0
- package/dist/components/geodesic/badge-frame.d.ts +60 -0
- package/dist/components/geodesic/badge-frame.d.ts.map +1 -0
- package/dist/components/geodesic/exam-badge.d.ts +5 -0
- package/dist/components/geodesic/exam-badge.d.ts.map +1 -0
- package/dist/components/geodesic/geometry.d.ts +1089 -0
- package/dist/components/geodesic/geometry.d.ts.map +1 -0
- package/dist/components/geodesic/gift-box-badge.d.ts +5 -0
- package/dist/components/geodesic/gift-box-badge.d.ts.map +1 -0
- package/dist/components/geodesic/gift-token.d.ts +23 -0
- package/dist/components/geodesic/gift-token.d.ts.map +1 -0
- package/dist/components/geodesic/glyph-slot.d.ts +8 -0
- package/dist/components/geodesic/glyph-slot.d.ts.map +1 -0
- package/dist/components/geodesic/index.d.ts +12 -0
- package/dist/components/geodesic/index.d.ts.map +1 -0
- package/dist/components/geodesic/index.js +917 -0
- package/dist/components/geodesic/index.js.map +1 -0
- package/dist/components/geodesic/module-badge.d.ts +5 -0
- package/dist/components/geodesic/module-badge.d.ts.map +1 -0
- package/dist/components/geodesic/planet.d.ts +30 -0
- package/dist/components/geodesic/planet.d.ts.map +1 -0
- package/dist/components/geodesic/project-badge.d.ts +5 -0
- package/dist/components/geodesic/project-badge.d.ts.map +1 -0
- package/dist/components/geodesic/skill-badge.d.ts +5 -0
- package/dist/components/geodesic/skill-badge.d.ts.map +1 -0
- package/dist/components/geodesic/social-badge.d.ts +8 -0
- package/dist/components/geodesic/social-badge.d.ts.map +1 -0
- package/dist/components/geodesic/status.d.ts +80 -0
- package/dist/components/geodesic/status.d.ts.map +1 -0
- package/dist/components/geodesic/styles.css +146 -0
- package/dist/components/photo-capture/index.js +2 -2
- package/dist/theme.css +75 -0
- package/package.json +2 -1
- package/src/as-child.contract.test.tsx +2 -0
- package/src/components/ambient-background/ambient-background.test.tsx +59 -0
- package/src/components/ambient-background/ambient-background.tsx +15 -2
- package/src/components/ambient-background/starfield.tsx +331 -0
- package/src/components/geodesic/a11y.ts +10 -0
- package/src/components/geodesic/activity-badge.tsx +17 -0
- package/src/components/geodesic/badge-frame.tsx +324 -0
- package/src/components/geodesic/exam-badge.tsx +17 -0
- package/src/components/geodesic/geometry.test.ts +60 -0
- package/src/components/geodesic/geometry.ts +367 -0
- package/src/components/geodesic/gift-box-badge.tsx +17 -0
- package/src/components/geodesic/gift-token.tsx +104 -0
- package/src/components/geodesic/glyph-slot.tsx +28 -0
- package/src/components/geodesic/index.ts +13 -0
- package/src/components/geodesic/module-badge.tsx +17 -0
- package/src/components/geodesic/planet.tsx +131 -0
- package/src/components/geodesic/project-badge.tsx +17 -0
- package/src/components/geodesic/skill-badge.tsx +17 -0
- package/src/components/geodesic/social-badge.tsx +21 -0
- package/src/components/geodesic/status.test.ts +66 -0
- package/src/components/geodesic/status.ts +176 -0
- package/src/components/geodesic/styles.css +146 -0
- package/src/icon-stroke.test.tsx +7 -0
- package/src/theme.css +75 -0
- package/src/theme.test.ts +10 -2
|
@@ -3,11 +3,231 @@ import { props } from '../../chunk-WYCMIIRR.js';
|
|
|
3
3
|
import { cn } from '../../chunk-4ASNIDV7.js';
|
|
4
4
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
+
var prng = (seed) => () => {
|
|
7
|
+
seed = seed + 1831565813 | 0;
|
|
8
|
+
let t = Math.imul(seed ^ seed >>> 15, 1 | seed);
|
|
9
|
+
t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
|
|
10
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
11
|
+
};
|
|
12
|
+
var round = (n) => Math.round(n * 100) / 100;
|
|
13
|
+
var TONES = [
|
|
14
|
+
"fill-brand-500 dark:fill-brand-100",
|
|
15
|
+
"fill-purple-500 dark:fill-purple-200",
|
|
16
|
+
"fill-pink-500 dark:fill-pink-200"
|
|
17
|
+
];
|
|
18
|
+
var pickTone = (n) => n < 0.78 ? TONES[0] : n < 0.95 ? TONES[1] : TONES[2];
|
|
19
|
+
var DIM_BEATS = [
|
|
20
|
+
{ duration: "11s", delay: "-3s" },
|
|
21
|
+
{ duration: "17s", delay: "-11s" },
|
|
22
|
+
{ duration: "23s", delay: "-7s" }
|
|
23
|
+
];
|
|
24
|
+
var scatter = (seed, size, count) => {
|
|
25
|
+
const random = prng(seed);
|
|
26
|
+
const group = prng(seed + 1);
|
|
27
|
+
const phases = DIM_BEATS.map(() => new Map(TONES.map((tone) => [tone, []])));
|
|
28
|
+
for (let i = 0; i < count; i++) {
|
|
29
|
+
const weight = random() ** 2.4;
|
|
30
|
+
const star = {
|
|
31
|
+
// Kept off the tile's edge so no dot is cut in half where tiles meet.
|
|
32
|
+
x: round(2 + random() * (size - 4)),
|
|
33
|
+
y: round(2 + random() * (size - 4)),
|
|
34
|
+
r: round(0.4 + weight * 0.75),
|
|
35
|
+
opacity: round(0.22 + weight * 0.4 + random() * 0.1)
|
|
36
|
+
};
|
|
37
|
+
phases[Math.floor(group() * phases.length)]?.get(pickTone(random()))?.push(star);
|
|
38
|
+
}
|
|
39
|
+
return { size, phases: phases.map((phase) => [...phase]) };
|
|
40
|
+
};
|
|
41
|
+
var TILES = [scatter(42, 509, 26), scatter(1337, 733, 38)];
|
|
42
|
+
var BRIGHT_STARS = [
|
|
43
|
+
{ x: "8%", y: "14%", sparkle: true, delay: "0s", duration: "7s" },
|
|
44
|
+
{ x: "31%", y: "6%", sparkle: false, delay: "-2s", duration: "9s" },
|
|
45
|
+
{ x: "62%", y: "11%", sparkle: false, delay: "-5s", duration: "8s" },
|
|
46
|
+
{ x: "88%", y: "22%", sparkle: true, delay: "-3s", duration: "10s" },
|
|
47
|
+
{ x: "18%", y: "58%", sparkle: false, delay: "-6s", duration: "8s" },
|
|
48
|
+
{ x: "47%", y: "41%", sparkle: false, delay: "-1s", duration: "11s" },
|
|
49
|
+
{ x: "76%", y: "63%", sparkle: true, delay: "-4s", duration: "9s" },
|
|
50
|
+
{ x: "36%", y: "86%", sparkle: false, delay: "-7s", duration: "10s" },
|
|
51
|
+
{ x: "93%", y: "90%", sparkle: false, delay: "-2.5s", duration: "7s" }
|
|
52
|
+
];
|
|
53
|
+
var SPARKLE = "M0 -6Q0 0 6 0Q0 0 0 6Q0 0 -6 0Q0 0 0 -6Z";
|
|
54
|
+
var BLEED = 15;
|
|
55
|
+
var SPAN = 100 + 2 * BLEED;
|
|
56
|
+
var inLayer = (viewport, offset = 0) => `${round((viewport + offset) / SPAN * 100)}%`;
|
|
57
|
+
var cloud = ({ rx, ry, x, y }, { color, strength }) => `radial-gradient(ellipse ${inLayer(rx)} ${inLayer(ry)} at ${inLayer(x, BLEED)} ${inLayer(y, BLEED)}, color-mix(in oklab, var(${color}) ${strength}%, transparent), color-mix(in oklab, var(${color}) ${strength * 0.45}%, transparent) 45%, transparent 100%)`;
|
|
58
|
+
var CLOUDS = [
|
|
59
|
+
{
|
|
60
|
+
at: { rx: 42, ry: 34, x: 30, y: 64 },
|
|
61
|
+
dark: { color: "--color-purple-400", strength: 9 },
|
|
62
|
+
light: { color: "--color-purple-200", strength: 14 },
|
|
63
|
+
drift: { x: "6vw", y: "-4vh", scale: 1.12, fade: 0.7, duration: "70s", delay: "-20s" }
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
at: { rx: 60, ry: 38, x: 42, y: 104 },
|
|
67
|
+
dark: { color: "--color-purple-800", strength: 20 },
|
|
68
|
+
light: { color: "--color-purple-200", strength: 26 },
|
|
69
|
+
drift: { x: "-8vw", y: "-3vh", scale: 1.08, fade: 0.85, duration: "95s", delay: "-50s" }
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
at: { rx: 40, ry: 34, x: 92, y: 4 },
|
|
73
|
+
dark: { color: "--color-purple-800", strength: 22 },
|
|
74
|
+
light: { color: "--color-purple-200", strength: 28 },
|
|
75
|
+
drift: { x: "-5vw", y: "5vh", scale: 1.15, fade: 0.8, duration: "85s", delay: "-10s" }
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
at: { rx: 46, ry: 40, x: 24, y: 20 },
|
|
79
|
+
dark: { color: "--color-brand-700", strength: 18 },
|
|
80
|
+
light: { color: "--color-brand-200", strength: 24 },
|
|
81
|
+
drift: { x: "7vw", y: "4vh", scale: 1.1, fade: 0.85, duration: "110s", delay: "-70s" }
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
at: { rx: 36, ry: 30, x: 4, y: 92 },
|
|
85
|
+
dark: { color: "--color-pink-800", strength: 10 },
|
|
86
|
+
light: { color: "--color-pink-200", strength: 16 },
|
|
87
|
+
drift: { x: "5vw", y: "-6vh", scale: 1.2, fade: 0.6, duration: "75s", delay: "-35s" }
|
|
88
|
+
}
|
|
89
|
+
];
|
|
90
|
+
var cloudStyle = ({ at, dark, light, drift }) => ({
|
|
91
|
+
"--nebula-light": cloud(at, light),
|
|
92
|
+
"--nebula-dark": cloud(at, dark),
|
|
93
|
+
"--drift-x": drift.x,
|
|
94
|
+
"--drift-y": drift.y,
|
|
95
|
+
"--drift-scale": drift.scale,
|
|
96
|
+
"--drift-fade": drift.fade,
|
|
97
|
+
inset: `-${BLEED}%`,
|
|
98
|
+
animationDuration: drift.duration,
|
|
99
|
+
animationDelay: drift.delay
|
|
100
|
+
});
|
|
101
|
+
var METEORS = [
|
|
102
|
+
{ x: "72%", y: "8%", angle: "152deg", duration: "37s", delay: "9s" },
|
|
103
|
+
{ x: "50%", y: "20%", angle: "160deg", duration: "53s", delay: "24s" },
|
|
104
|
+
{ x: "92%", y: "30%", angle: "148deg", duration: "71s", delay: "41s" }
|
|
105
|
+
];
|
|
106
|
+
var HALO_THEME = "[--star-halo-core:var(--color-brand-400)] [--star-halo-rim:var(--color-purple-400)] dark:[--star-halo-core:var(--color-brand-100)] dark:[--star-halo-rim:var(--color-purple-300)]";
|
|
107
|
+
var LAYER = "ambient-starfield pointer-events-none fixed -z-10 forced-colors:hidden";
|
|
108
|
+
var Starfield = ({
|
|
109
|
+
classNames,
|
|
110
|
+
testId
|
|
111
|
+
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
112
|
+
CLOUDS.map((c, i) => /* @__PURE__ */ jsx(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
"aria-hidden": "true",
|
|
116
|
+
className: cn(
|
|
117
|
+
LAYER,
|
|
118
|
+
"[background-image:var(--nebula-light)] motion-safe:animate-ambient-nebula-drift dark:[background-image:var(--nebula-dark)]",
|
|
119
|
+
classNames?.nebula
|
|
120
|
+
),
|
|
121
|
+
style: cloudStyle(c),
|
|
122
|
+
...props({ "data-testid": testId && `${testId}-nebula-${i}` })
|
|
123
|
+
},
|
|
124
|
+
`${c.at.x}-${c.at.y}`
|
|
125
|
+
)),
|
|
126
|
+
/* @__PURE__ */ jsxs(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
"aria-hidden": "true",
|
|
130
|
+
className: cn(LAYER, "inset-0 opacity-70 dark:opacity-100", HALO_THEME, classNames?.stars),
|
|
131
|
+
...props({ "data-testid": testId && `${testId}-stars` }),
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ jsx("svg", { "aria-hidden": "true", className: "absolute size-0", children: /* @__PURE__ */ jsxs("defs", { children: [
|
|
134
|
+
TILES.flatMap(
|
|
135
|
+
({ size, phases }, i) => phases.map((groups, phase) => /* @__PURE__ */ jsx(
|
|
136
|
+
"pattern",
|
|
137
|
+
{
|
|
138
|
+
id: `ambient-starfield-tile-${i}-${phase}`,
|
|
139
|
+
width: size,
|
|
140
|
+
height: size,
|
|
141
|
+
patternUnits: "userSpaceOnUse",
|
|
142
|
+
children: groups.map(([tone, stars]) => /* @__PURE__ */ jsx("g", { className: tone, children: stars.map(({ x, y, r, opacity }) => /* @__PURE__ */ jsx("circle", { cx: x, cy: y, r, fillOpacity: opacity }, `${x}-${y}`)) }, tone))
|
|
143
|
+
},
|
|
144
|
+
`${i}-${phase}`
|
|
145
|
+
))
|
|
146
|
+
),
|
|
147
|
+
/* @__PURE__ */ jsxs("radialGradient", { id: "ambient-starfield-halo", children: [
|
|
148
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", style: { stopColor: "var(--star-halo-core)" }, stopOpacity: 0.32 }),
|
|
149
|
+
/* @__PURE__ */ jsx("stop", { offset: "35%", style: { stopColor: "var(--star-halo-rim)" }, stopOpacity: 0.1 }),
|
|
150
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", style: { stopColor: "var(--star-halo-rim)" }, stopOpacity: 0 })
|
|
151
|
+
] })
|
|
152
|
+
] }) }),
|
|
153
|
+
DIM_BEATS.map(({ duration, delay }, phase) => /* @__PURE__ */ jsx(
|
|
154
|
+
"svg",
|
|
155
|
+
{
|
|
156
|
+
"aria-hidden": "true",
|
|
157
|
+
className: "absolute inset-0 size-full motion-safe:animate-ambient-star-dim",
|
|
158
|
+
style: { animationDuration: duration, animationDelay: delay },
|
|
159
|
+
children: TILES.map(({ size }, i) => /* @__PURE__ */ jsx(
|
|
160
|
+
"rect",
|
|
161
|
+
{
|
|
162
|
+
width: "100%",
|
|
163
|
+
height: "100%",
|
|
164
|
+
fill: `url(#ambient-starfield-tile-${i}-${phase})`
|
|
165
|
+
},
|
|
166
|
+
size
|
|
167
|
+
))
|
|
168
|
+
},
|
|
169
|
+
duration
|
|
170
|
+
)),
|
|
171
|
+
/* @__PURE__ */ jsx("svg", { "aria-hidden": "true", className: "absolute inset-0 size-full", children: BRIGHT_STARS.map(({ x, y, sparkle, delay, duration }) => /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", x, y, overflow: "visible", children: /* @__PURE__ */ jsxs(
|
|
172
|
+
"g",
|
|
173
|
+
{
|
|
174
|
+
className: "motion-safe:animate-ambient-star-twinkle",
|
|
175
|
+
style: { animationDelay: delay, animationDuration: duration },
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsx("circle", { r: 7, fill: "url(#ambient-starfield-halo)" }),
|
|
178
|
+
sparkle ? /* @__PURE__ */ jsx(
|
|
179
|
+
"path",
|
|
180
|
+
{
|
|
181
|
+
d: SPARKLE,
|
|
182
|
+
className: "fill-purple-400 dark:fill-purple-100",
|
|
183
|
+
fillOpacity: 0.4
|
|
184
|
+
}
|
|
185
|
+
) : null,
|
|
186
|
+
/* @__PURE__ */ jsx("circle", { r: 1.1, className: "fill-brand-500 dark:fill-brand-50", fillOpacity: 0.85 })
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
) }, `${x}-${y}`)) })
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
/* @__PURE__ */ jsx(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
"aria-hidden": "true",
|
|
197
|
+
className: cn(
|
|
198
|
+
LAYER,
|
|
199
|
+
"ambient-starfield-meteors inset-0 hidden overflow-hidden motion-safe:block",
|
|
200
|
+
classNames?.meteors
|
|
201
|
+
),
|
|
202
|
+
...props({ "data-testid": testId && `${testId}-meteors` }),
|
|
203
|
+
children: METEORS.map(({ x, y, angle, duration, delay }) => (
|
|
204
|
+
// A zero-size anchor turned to the meteor's heading; the streak
|
|
205
|
+
// ends at it, head first, and flies along that heading.
|
|
206
|
+
/* @__PURE__ */ jsx(
|
|
207
|
+
"span",
|
|
208
|
+
{
|
|
209
|
+
className: "absolute size-0",
|
|
210
|
+
style: { left: x, top: y, rotate: angle },
|
|
211
|
+
children: /* @__PURE__ */ jsx(
|
|
212
|
+
"span",
|
|
213
|
+
{
|
|
214
|
+
className: "absolute top-0 right-0 h-px w-28 origin-right rounded-full bg-linear-to-r from-transparent to-brand-500/50 opacity-0 motion-safe:animate-ambient-meteor dark:to-white/60",
|
|
215
|
+
style: { animationDuration: duration, animationDelay: delay }
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
},
|
|
219
|
+
`${x}-${y}`
|
|
220
|
+
)
|
|
221
|
+
))
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
] });
|
|
6
225
|
var AmbientBackground = ({
|
|
7
226
|
glow,
|
|
8
227
|
noise,
|
|
9
228
|
withGlow = glow ?? true,
|
|
10
229
|
withNoise = noise ?? true,
|
|
230
|
+
withStarfield = false,
|
|
11
231
|
classNames,
|
|
12
232
|
testId
|
|
13
233
|
}) => {
|
|
@@ -37,7 +257,8 @@ var AmbientBackground = ({
|
|
|
37
257
|
style: { backgroundImage: "var(--ambient-noise)" },
|
|
38
258
|
...props({ "data-testid": testId && `${testId}-noise` })
|
|
39
259
|
}
|
|
40
|
-
)
|
|
260
|
+
),
|
|
261
|
+
withStarfield && /* @__PURE__ */ jsx(Starfield, { classNames, testId })
|
|
41
262
|
] });
|
|
42
263
|
};
|
|
43
264
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ambient-background/ambient-background.tsx"],"names":[],"mappings":";;;;;AA4DO,IAAM,oBAAoB,CAAC;AAAA,EAChC,IAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAW,IAAA,IAAQ,IAAA;AAAA,EACnB,YAAY,KAAA,IAAS,IAAA;AAAA,EACrB,UAAA;AAAA,EACA;AACF,CAAA,KAA8B;AAC5B,EAAA,IAAI,IAAA,KAAS,MAAA,EAAW,eAAA,CAAgB,mBAAA,EAAqB,QAAQ,UAAU,CAAA;AAC/E,EAAA,IAAI,KAAA,KAAU,MAAA,EAAW,eAAA,CAAgB,mBAAA,EAAqB,SAAS,WAAW,CAAA;AAClF,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,QAAA,oBACC,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAY,MAAA;AAAA,QACZ,SAAA,EAAW,EAAA;AAAA,UACT,8DAAA;AAAA,UACA,UAAA,EAAY;AAAA,SACd;AAAA,QACA,KAAA,EAAO,EAAE,eAAA,EAAiB,qBAAA,EAAsB;AAAA,QAC/C,GAAG,MAAM,EAAE,aAAA,EAAe,UAAU,CAAA,EAAG,MAAM,SAAS;AAAA;AAAA,KACzD;AAAA,IAED,SAAA,oBACC,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAY,MAAA;AAAA,QACZ,SAAA,EAAW,EAAA;AAAA,UACT,wEAAA;AAAA,UACA,UAAA,EAAY;AAAA,SACd;AAAA,QACA,KAAA,EAAO,EAAE,eAAA,EAAiB,sBAAA,EAAuB;AAAA,QAChD,GAAG,MAAM,EAAE,aAAA,EAAe,UAAU,CAAA,EAAG,MAAM,UAAU;AAAA;AAAA;AAC1D,GAAA,EAEJ,CAAA;AAEJ","file":"index.js","sourcesContent":["import { cn } from \"../../lib/cn\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * AmbientBackground — a decorative, brand-tinted page background: a soft\n * radial glow plus a fine film-grain noise texture, so a flat page fill reads\n * as a considered surface instead of a plain color.\n *\n * Render it once, as the first child of your root layout (so later content\n * naturally paints over it) — both layers are `position: fixed`, so a single\n * instance covers the whole viewport regardless of scroll position or page\n * height. It renders nothing interactive: `aria-hidden`, `pointer-events-none`,\n * and hidden under `forced-colors` (Windows High Contrast), since a decorative\n * background has no place overriding a user's forced palette.\n *\n * Glow and noise render as two *independent* fixed elements rather than one\n * wrapper containing two children, so either can be toggled/overridden\n * without the other, and neither traps a future blend-mode override inside\n * an isolated stacking context (`position: fixed` always creates one,\n * regardless of z-index — nesting a blended layer inside another `fixed`\n * wrapper would cut off what it can blend against).\n *\n * The actual glow/noise values are CSS custom properties (`--ambient-glow` /\n * `--ambient-noise`, defined in `theme.css`, brand-tinted and theme-aware via\n * `data-theme`) rather than hardcoded here — override either on `:root` to\n * reskin it without forking this component.\n *\n * Pure Server Component: no state, no client JS.\n *\n * @example\n * ```tsx\n * // app/layout.tsx\n * <body>\n * <AmbientBackground />\n * {children}\n * </body>\n * ```\n */\n/**\n * There is no root element, so `testId` lands on each layer with its part as a\n * suffix: `` `${testId}-glow` `` and `` `${testId}-noise` ``.\n */\nexport type AmbientBackgroundProps = WithTestId & {\n /** Render the radial glow layer. Default `true`. */\n withGlow?: boolean\n /** Render the film-grain noise layer. Default `true`. */\n withNoise?: boolean\n /** @deprecated Renamed `withGlow`. Removed in the next minor. `withGlow` wins when both are set. */\n glow?: boolean\n /** @deprecated Renamed `withNoise`. Removed in the next minor. `withNoise` wins when both are set. */\n noise?: boolean\n /** Extra classes for each layer. */\n classNames?: {\n glow?: string\n noise?: string\n }\n}\n\nexport const AmbientBackground = ({\n glow,\n noise,\n withGlow = glow ?? true,\n withNoise = noise ?? true,\n classNames,\n testId,\n}: AmbientBackgroundProps) => {\n if (glow !== undefined) warnRenamedProp(\"AmbientBackground\", \"glow\", \"withGlow\")\n if (noise !== undefined) warnRenamedProp(\"AmbientBackground\", \"noise\", \"withNoise\")\n return (\n <>\n {withGlow && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 forced-colors:hidden\",\n classNames?.glow,\n )}\n style={{ backgroundImage: \"var(--ambient-glow)\" }}\n {...props({ \"data-testid\": testId && `${testId}-glow` })}\n />\n )}\n {withNoise && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 bg-repeat forced-colors:hidden\",\n classNames?.noise,\n )}\n style={{ backgroundImage: \"var(--ambient-noise)\" }}\n {...props({ \"data-testid\": testId && `${testId}-noise` })}\n />\n )}\n </>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ambient-background/starfield.tsx","../../../src/components/ambient-background/ambient-background.tsx"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;AAoBA,IAAM,IAAA,GAAO,CAAC,IAAA,KAAiB,MAAM;AACnC,EAAA,IAAA,GAAQ,OAAO,UAAA,GAAc,CAAA;AAC7B,EAAA,IAAI,IAAI,IAAA,CAAK,IAAA,CAAK,OAAQ,IAAA,KAAS,EAAA,EAAK,IAAI,IAAI,CAAA;AAChD,EAAA,CAAA,GAAK,CAAA,GAAI,KAAK,IAAA,CAAK,CAAA,GAAK,MAAM,CAAA,EAAI,EAAA,GAAK,CAAC,CAAA,GAAK,CAAA;AAC7C,EAAA,OAAA,CAAA,CAAS,CAAA,GAAK,CAAA,KAAM,EAAA,MAAS,CAAA,IAAK,UAAA;AACpC,CAAA;AAEA,IAAM,QAAQ,CAAC,CAAA,KAAc,KAAK,KAAA,CAAM,CAAA,GAAI,GAAG,CAAA,GAAI,GAAA;AAMnD,IAAM,KAAA,GAAQ;AAAA,EACZ,oCAAA;AAAA,EACA,sCAAA;AAAA,EACA;AACF,CAAA;AAIA,IAAM,QAAA,GAAW,CAAC,CAAA,KAAqB,CAAA,GAAI,OAAO,KAAA,CAAM,CAAC,CAAA,GAAI,CAAA,GAAI,IAAA,GAAO,KAAA,CAAM,CAAC,CAAA,GAAI,MAAM,CAAC,CAAA;AAO1F,IAAM,SAAA,GAAY;AAAA,EAChB,EAAE,QAAA,EAAU,KAAA,EAAO,KAAA,EAAO,KAAA,EAAM;AAAA,EAChC,EAAE,Q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UACT,wEAAA;AAAA,UACA,UAAA,EAAY;AAAA,SACd;AAAA,QACA,KAAA,EAAO,EAAE,eAAA,EAAiB,sBAAA,EAAuB;AAAA,QAChD,GAAG,MAAM,EAAE,aAAA,EAAe,UAAU,CAAA,EAAG,MAAM,UAAU;AAAA;AAAA,KAC1D;AAAA,IAED,aAAA,oBAAiBA,GAAAA,CAAC,SAAA,EAAA,EAAU,YAAwB,MAAA,EAAgB;AAAA,GAAA,EACvE,CAAA;AAEJ","file":"index.js","sourcesContent":["import type { CSSProperties } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\n\n// The starfield AmbientBackground draws with `withStarfield`: a starry sky over\n// soft violet nebulae, stacked on the glow and noise (the noise is what\n// dithers these gradients so they never band). Every layer takes the same\n// recipe as glow and noise (fixed, -z-10, no shared wrapper) and paints over\n// them, still under every piece of the app.\n//\n// Everything is computed once at module load from a seeded PRNG, so the sky\n// is identical on every render, on the server and the client, and on every\n// visit. It moves, slowly: the clouds drift and swell, the dust dims and comes\n// back, the brighter stars breathe, and now and then a meteor crosses. All of\n// it is CSS animation of transform and opacity (keyframes in theme.css), so\n// the compositor runs it and no script does per frame; and all of it sits\n// behind `motion-safe:` and the `data-motion=\"reduced\"` rule in theme.css, so\n// with reduced motion the sky is a still picture, without the meteors.\n\n// mulberry32: tiny, fast, and good enough to scatter dots.\nconst prng = (seed: number) => () => {\n seed = (seed + 0x6d2b79f5) | 0\n let t = Math.imul(seed ^ (seed >>> 15), 1 | seed)\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296\n}\n\nconst round = (n: number) => Math.round(n * 100) / 100\n\ntype Star = { x: number; y: number; r: number; opacity: number }\n\n// Most stars are a cool white; a few lean violet or pink, as in the design.\n// On a light sky the same hues go dark, so the dots read as ink, not glare.\nconst TONES = [\n \"fill-brand-500 dark:fill-brand-100\",\n \"fill-purple-500 dark:fill-purple-200\",\n \"fill-pink-500 dark:fill-pink-200\",\n] as const\n\ntype Tone = (typeof TONES)[number]\n\nconst pickTone = (n: number): Tone => (n < 0.78 ? TONES[0] : n < 0.95 ? TONES[1] : TONES[2])\n\n// The dust dims in a few groups, each on its own slow beat, so at any moment\n// some stars are fading and others coming back. A group is a whole layer\n// fading (cheap: the compositor does it), and its stars are scattered all\n// over, so it reads as single stars dimming, not as a region pulsing. The\n// beats share no common factor, so the groups never line up into one blink.\nconst DIM_BEATS = [\n { duration: \"11s\", delay: \"-3s\" },\n { duration: \"17s\", delay: \"-11s\" },\n { duration: \"23s\", delay: \"-7s\" },\n] as const\n\n// Dots for one repeating tile, by dimming group, then by tone so each tone\n// is one <g>.\nconst scatter = (seed: number, size: number, count: number) => {\n const random = prng(seed)\n // Its own sequence, so sorting the dots into groups doesn't move them.\n const group = prng(seed + 1)\n const phases = DIM_BEATS.map(() => new Map<Tone, Star[]>(TONES.map((tone) => [tone, []])))\n for (let i = 0; i < count; i++) {\n // Skewed towards the faintest, smallest dots: a real sky is mostly dust.\n const weight = random() ** 2.4\n const star = {\n // Kept off the tile's edge so no dot is cut in half where tiles meet.\n x: round(2 + random() * (size - 4)),\n y: round(2 + random() * (size - 4)),\n r: round(0.4 + weight * 0.75),\n opacity: round(0.22 + weight * 0.4 + random() * 0.1),\n }\n phases[Math.floor(group() * phases.length)]?.get(pickTone(random()))?.push(star)\n }\n return { size, phases: phases.map((phase) => [...phase]) }\n}\n\n// Two tiles of coprime-ish sizes overlap into a pattern that only repeats\n// every few thousand pixels, so the eye never catches the tiling. Fixed pixel\n// tiles (not a scaled viewBox) keep the same density on a phone and a wide\n// screen. Together about one dot per 6000px², the design's own density.\nconst TILES = [scatter(42, 509, 26), scatter(1337, 733, 38)]\n\n// The few brighter stars, placed by viewport percentage so they spread over\n// any screen. A soft halo rather than a hard disc; the three with `sparkle`\n// carry the design's diffraction spikes, kept thin and short.\nconst BRIGHT_STARS = [\n { x: \"8%\", y: \"14%\", sparkle: true, delay: \"0s\", duration: \"7s\" },\n { x: \"31%\", y: \"6%\", sparkle: false, delay: \"-2s\", duration: \"9s\" },\n { x: \"62%\", y: \"11%\", sparkle: false, delay: \"-5s\", duration: \"8s\" },\n { x: \"88%\", y: \"22%\", sparkle: true, delay: \"-3s\", duration: \"10s\" },\n { x: \"18%\", y: \"58%\", sparkle: false, delay: \"-6s\", duration: \"8s\" },\n { x: \"47%\", y: \"41%\", sparkle: false, delay: \"-1s\", duration: \"11s\" },\n { x: \"76%\", y: \"63%\", sparkle: true, delay: \"-4s\", duration: \"9s\" },\n { x: \"36%\", y: \"86%\", sparkle: false, delay: \"-7s\", duration: \"10s\" },\n { x: \"93%\", y: \"90%\", sparkle: false, delay: \"-2.5s\", duration: \"7s\" },\n] as const\n\n// A four-point sparkle with concave sides: reads as a lens glint, not a shape.\nconst SPARKLE = \"M0 -6Q0 0 6 0Q0 0 0 6Q0 0 -6 0Q0 0 0 -6Z\"\n\n// Each cloud's layer overhangs the viewport by this much on every side, so a\n// cloud cut by the screen's edge (several are) can drift without the cut\n// ever coming into view.\nconst BLEED = 15\nconst SPAN = 100 + 2 * BLEED\n\n// A length or a position given in viewport %, as % of the overhanging layer.\nconst inLayer = (viewport: number, offset = 0) => `${round(((viewport + offset) / SPAN) * 100)}%`\n\ntype Ellipse = { rx: number; ry: number; x: number; y: number }\ntype Hue = { color: string; strength: number }\n\n// Violet and indigo clouds after the design's \"Nébuleuse\", softened: wide\n// ellipses that fade out over their whole radius so no edge ever shows. The\n// design's blue core is already the kit's ambient glow; this adds the purple.\nconst cloud = ({ rx, ry, x, y }: Ellipse, { color, strength }: Hue) =>\n `radial-gradient(ellipse ${inLayer(rx)} ${inLayer(ry)} at ${inLayer(x, BLEED)} ${inLayer(y, BLEED)}, color-mix(in oklab, var(${color}) ${strength}%, transparent), color-mix(in oklab, var(${color}) ${strength * 0.45}%, transparent) 45%, transparent 100%)`\n\n// Each cloud drifts on its own long, slow swing (there and back, eased at\n// both ends), swelling a little and thinning as it goes: a few px a second,\n// so the sky is never seen moving, only found changed. On a light sky the\n// same clouds are pale tints, so the light theme keeps the violet without\n// muddying the page.\nconst CLOUDS: {\n at: Ellipse\n dark: Hue\n light: Hue\n drift: { x: string; y: string; scale: number; fade: number; duration: string; delay: string }\n}[] = [\n {\n at: { rx: 42, ry: 34, x: 30, y: 64 },\n dark: { color: \"--color-purple-400\", strength: 9 },\n light: { color: \"--color-purple-200\", strength: 14 },\n drift: { x: \"6vw\", y: \"-4vh\", scale: 1.12, fade: 0.7, duration: \"70s\", delay: \"-20s\" },\n },\n {\n at: { rx: 60, ry: 38, x: 42, y: 104 },\n dark: { color: \"--color-purple-800\", strength: 20 },\n light: { color: \"--color-purple-200\", strength: 26 },\n drift: { x: \"-8vw\", y: \"-3vh\", scale: 1.08, fade: 0.85, duration: \"95s\", delay: \"-50s\" },\n },\n {\n at: { rx: 40, ry: 34, x: 92, y: 4 },\n dark: { color: \"--color-purple-800\", strength: 22 },\n light: { color: \"--color-purple-200\", strength: 28 },\n drift: { x: \"-5vw\", y: \"5vh\", scale: 1.15, fade: 0.8, duration: \"85s\", delay: \"-10s\" },\n },\n {\n at: { rx: 46, ry: 40, x: 24, y: 20 },\n dark: { color: \"--color-brand-700\", strength: 18 },\n light: { color: \"--color-brand-200\", strength: 24 },\n drift: { x: \"7vw\", y: \"4vh\", scale: 1.1, fade: 0.85, duration: \"110s\", delay: \"-70s\" },\n },\n {\n at: { rx: 36, ry: 30, x: 4, y: 92 },\n dark: { color: \"--color-pink-800\", strength: 10 },\n light: { color: \"--color-pink-200\", strength: 16 },\n drift: { x: \"5vw\", y: \"-6vh\", scale: 1.2, fade: 0.6, duration: \"75s\", delay: \"-35s\" },\n },\n]\n\n// The cloud's picture per theme and its drift, as variables the classes and\n// the ambient-nebula-drift keyframes (theme.css) read.\nconst cloudStyle = ({ at, dark, light, drift }: (typeof CLOUDS)[number]) =>\n ({\n \"--nebula-light\": cloud(at, light),\n \"--nebula-dark\": cloud(at, dark),\n \"--drift-x\": drift.x,\n \"--drift-y\": drift.y,\n \"--drift-scale\": drift.scale,\n \"--drift-fade\": drift.fade,\n inset: `-${BLEED}%`,\n animationDuration: drift.duration,\n animationDelay: drift.delay,\n }) as CSSProperties\n\n// The meteors: three, each on its own long cycle and visible for about a\n// second of it, so one crosses every twenty seconds or so, never on arrival\n// and almost never two at once. Thin, short and faint, high in the sky,\n// falling down and to the left. Seen from the corner of the eye, not watched.\nconst METEORS = [\n { x: \"72%\", y: \"8%\", angle: \"152deg\", duration: \"37s\", delay: \"9s\" },\n { x: \"50%\", y: \"20%\", angle: \"160deg\", duration: \"53s\", delay: \"24s\" },\n { x: \"92%\", y: \"30%\", angle: \"148deg\", duration: \"71s\", delay: \"41s\" },\n] as const\n\n// The halo's stops, per theme: a gradient stop takes no `dark:` class.\nconst HALO_THEME =\n \"[--star-halo-core:var(--color-brand-400)] [--star-halo-rim:var(--color-purple-400)] dark:[--star-halo-core:var(--color-brand-100)] dark:[--star-halo-rim:var(--color-purple-300)]\"\n\n// Every layer's recipe: decorative, out of the pointer's way and out of a\n// forced palette's. `ambient-starfield` is the hook theme.css's\n// `data-motion=\"reduced\"` rule stills it by.\nconst LAYER = \"ambient-starfield pointer-events-none fixed -z-10 forced-colors:hidden\"\n\nexport type StarfieldClassNames = {\n /** Each nebula cloud's layer. */\n nebula?: string\n /** The layer holding the dust and the brighter stars. */\n stars?: string\n /** The meteors' layer. */\n meteors?: string\n}\n\nexport const Starfield = ({\n classNames,\n testId,\n}: {\n classNames?: StarfieldClassNames\n testId?: string\n}) => (\n <>\n {CLOUDS.map((c, i) => (\n <div\n key={`${c.at.x}-${c.at.y}`}\n aria-hidden=\"true\"\n className={cn(\n LAYER,\n \"[background-image:var(--nebula-light)] motion-safe:animate-ambient-nebula-drift dark:[background-image:var(--nebula-dark)]\",\n classNames?.nebula,\n )}\n style={cloudStyle(c)}\n {...props({ \"data-testid\": testId && `${testId}-nebula-${i}` })}\n />\n ))}\n\n {/* Fainter on a light sky: dark dots at the dark sky's strength read\n as specks rather than dust. Set on the wrapper, because the layers\n inside animate their own opacity. */}\n <div\n aria-hidden=\"true\"\n className={cn(LAYER, \"inset-0 opacity-70 dark:opacity-100\", HALO_THEME, classNames?.stars)}\n {...props({ \"data-testid\": testId && `${testId}-stars` })}\n >\n <svg aria-hidden=\"true\" className=\"absolute size-0\">\n <defs>\n {TILES.flatMap(({ size, phases }, i) =>\n phases.map((groups, phase) => (\n <pattern\n // biome-ignore lint/suspicious/noArrayIndexKey: a static, never-reordered list\n key={`${i}-${phase}`}\n id={`ambient-starfield-tile-${i}-${phase}`}\n width={size}\n height={size}\n patternUnits=\"userSpaceOnUse\"\n >\n {groups.map(([tone, stars]) => (\n <g key={tone} className={tone}>\n {stars.map(({ x, y, r, opacity }) => (\n <circle key={`${x}-${y}`} cx={x} cy={y} r={r} fillOpacity={opacity} />\n ))}\n </g>\n ))}\n </pattern>\n )),\n )}\n <radialGradient id=\"ambient-starfield-halo\">\n <stop offset=\"0%\" style={{ stopColor: \"var(--star-halo-core)\" }} stopOpacity={0.32} />\n <stop offset=\"35%\" style={{ stopColor: \"var(--star-halo-rim)\" }} stopOpacity={0.1} />\n <stop offset=\"100%\" style={{ stopColor: \"var(--star-halo-rim)\" }} stopOpacity={0} />\n </radialGradient>\n </defs>\n </svg>\n\n {DIM_BEATS.map(({ duration, delay }, phase) => (\n <svg\n key={duration}\n aria-hidden=\"true\"\n className=\"absolute inset-0 size-full motion-safe:animate-ambient-star-dim\"\n style={{ animationDuration: duration, animationDelay: delay }}\n >\n {TILES.map(({ size }, i) => (\n <rect\n key={size}\n width=\"100%\"\n height=\"100%\"\n fill={`url(#ambient-starfield-tile-${i}-${phase})`}\n />\n ))}\n </svg>\n ))}\n\n <svg aria-hidden=\"true\" className=\"absolute inset-0 size-full\">\n {BRIGHT_STARS.map(({ x, y, sparkle, delay, duration }) => (\n <svg key={`${x}-${y}`} aria-hidden=\"true\" x={x} y={y} overflow=\"visible\">\n <g\n className=\"motion-safe:animate-ambient-star-twinkle\"\n style={{ animationDelay: delay, animationDuration: duration }}\n >\n <circle r={7} fill=\"url(#ambient-starfield-halo)\" />\n {sparkle ? (\n <path\n d={SPARKLE}\n className=\"fill-purple-400 dark:fill-purple-100\"\n fillOpacity={0.4}\n />\n ) : null}\n <circle r={1.1} className=\"fill-brand-500 dark:fill-brand-50\" fillOpacity={0.85} />\n </g>\n </svg>\n ))}\n </svg>\n </div>\n\n {/* Only where motion is welcome: a meteor standing still is a scratch. */}\n <div\n aria-hidden=\"true\"\n className={cn(\n LAYER,\n \"ambient-starfield-meteors inset-0 hidden overflow-hidden motion-safe:block\",\n classNames?.meteors,\n )}\n {...props({ \"data-testid\": testId && `${testId}-meteors` })}\n >\n {METEORS.map(({ x, y, angle, duration, delay }) => (\n // A zero-size anchor turned to the meteor's heading; the streak\n // ends at it, head first, and flies along that heading.\n <span\n key={`${x}-${y}`}\n className=\"absolute size-0\"\n style={{ left: x, top: y, rotate: angle }}\n >\n <span\n className=\"absolute top-0 right-0 h-px w-28 origin-right rounded-full bg-linear-to-r from-transparent to-brand-500/50 opacity-0 motion-safe:animate-ambient-meteor dark:to-white/60\"\n style={{ animationDuration: duration, animationDelay: delay }}\n />\n </span>\n ))}\n </div>\n </>\n)\n","import { cn } from \"../../lib/cn\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { Starfield, type StarfieldClassNames } from \"./starfield\"\n\n/**\n * AmbientBackground — a decorative, brand-tinted page background: a soft\n * radial glow plus a fine film-grain noise texture, so a flat page fill reads\n * as a considered surface instead of a plain color.\n *\n * Render it once, as the first child of your root layout (so later content\n * naturally paints over it) — both layers are `position: fixed`, so a single\n * instance covers the whole viewport regardless of scroll position or page\n * height. It renders nothing interactive: `aria-hidden`, `pointer-events-none`,\n * and hidden under `forced-colors` (Windows High Contrast), since a decorative\n * background has no place overriding a user's forced palette.\n *\n * Glow and noise render as two *independent* fixed elements rather than one\n * wrapper containing two children, so either can be toggled/overridden\n * without the other, and neither traps a future blend-mode override inside\n * an isolated stacking context (`position: fixed` always creates one,\n * regardless of z-index — nesting a blended layer inside another `fixed`\n * wrapper would cut off what it can blend against).\n *\n * `withStarfield` adds a third, opt-in layer set: a slowly moving starry sky\n * over soft violet nebulae (dimming dust, breathing bright stars, a rare\n * meteor), seeded so it is identical on every render. It follows the same\n * recipe — separate fixed layers, no shared wrapper — and stills under reduced\n * motion, either the OS setting or `data-motion=\"reduced\"` on `<html>`.\n *\n * The actual glow/noise values are CSS custom properties (`--ambient-glow` /\n * `--ambient-noise`, defined in `theme.css`, brand-tinted and theme-aware via\n * `data-theme`) rather than hardcoded here — override either on `:root` to\n * reskin it without forking this component.\n *\n * Pure Server Component: no state, no client JS.\n *\n * @example\n * ```tsx\n * // app/layout.tsx\n * <body>\n * <AmbientBackground />\n * {children}\n * </body>\n * ```\n */\n/**\n * There is no root element, so `testId` lands on each layer with its part as a\n * suffix: `` `${testId}-glow` `` and `` `${testId}-noise` ``, and with the\n * starfield `` `${testId}-nebula-<n>` ``, `` `${testId}-stars` `` and\n * `` `${testId}-meteors` ``.\n */\nexport type AmbientBackgroundProps = WithTestId & {\n /** Render the radial glow layer. Default `true`. */\n withGlow?: boolean\n /** Render the film-grain noise layer. Default `true`. */\n withNoise?: boolean\n /** Render the starfield over the glow and noise: nebulae, stars and meteors. Default `false`. */\n withStarfield?: boolean\n /** @deprecated Renamed `withGlow`. Removed in the next minor. `withGlow` wins when both are set. */\n glow?: boolean\n /** @deprecated Renamed `withNoise`. Removed in the next minor. `withNoise` wins when both are set. */\n noise?: boolean\n /** Extra classes for each layer. */\n classNames?: StarfieldClassNames & {\n glow?: string\n noise?: string\n }\n}\n\nexport const AmbientBackground = ({\n glow,\n noise,\n withGlow = glow ?? true,\n withNoise = noise ?? true,\n withStarfield = false,\n classNames,\n testId,\n}: AmbientBackgroundProps) => {\n if (glow !== undefined) warnRenamedProp(\"AmbientBackground\", \"glow\", \"withGlow\")\n if (noise !== undefined) warnRenamedProp(\"AmbientBackground\", \"noise\", \"withNoise\")\n return (\n <>\n {withGlow && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 forced-colors:hidden\",\n classNames?.glow,\n )}\n style={{ backgroundImage: \"var(--ambient-glow)\" }}\n {...props({ \"data-testid\": testId && `${testId}-glow` })}\n />\n )}\n {withNoise && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 bg-repeat forced-colors:hidden\",\n classNames?.noise,\n )}\n style={{ backgroundImage: \"var(--ambient-noise)\" }}\n {...props({ \"data-testid\": testId && `${testId}-noise` })}\n />\n )}\n {withStarfield && <Starfield classNames={classNames} testId={testId} />}\n </>\n )\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type StarfieldClassNames = {
|
|
2
|
+
/** Each nebula cloud's layer. */
|
|
3
|
+
nebula?: string;
|
|
4
|
+
/** The layer holding the dust and the brighter stars. */
|
|
5
|
+
stars?: string;
|
|
6
|
+
/** The meteors' layer. */
|
|
7
|
+
meteors?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const Starfield: ({ classNames, testId, }: {
|
|
10
|
+
classNames?: StarfieldClassNames;
|
|
11
|
+
testId?: string;
|
|
12
|
+
}) => import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=starfield.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starfield.d.ts","sourceRoot":"","sources":["../../../src/components/ambient-background/starfield.tsx"],"names":[],"mappings":"AAmMA,MAAM,MAAM,mBAAmB,GAAG;IAChC,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,SAAS,4BAGnB;IACD,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,gCAwHA,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { Camera, useCamera, useCameraContext } from '../../chunk-
|
|
2
|
+
export { Camera, useCamera, useCameraContext } from '../../chunk-F2FSHVO5.js';
|
|
3
3
|
import '../../chunk-HX3LNK26.js';
|
|
4
4
|
import '../../chunk-K6YASO4L.js';
|
|
5
|
-
import '../../chunk-TWNIAF7K.js';
|
|
6
5
|
import '../../chunk-FB2G4LNH.js';
|
|
6
|
+
import '../../chunk-TWNIAF7K.js';
|
|
7
7
|
import '../../chunk-J43LSYQO.js';
|
|
8
8
|
import '../../chunk-7TDHT3QD.js';
|
|
9
9
|
import '../../chunk-YPFSRZ3T.js';
|
|
@@ -22,8 +22,8 @@ import '../../chunk-NLOBBJAA.js';
|
|
|
22
22
|
import { resolveCalendarTranslations } from '../../chunk-MXAACRWE.js';
|
|
23
23
|
import '../../chunk-ZB5VMGKB.js';
|
|
24
24
|
import '../../chunk-ZP6EBROY.js';
|
|
25
|
-
import { Skeleton } from '../../chunk-TWNIAF7K.js';
|
|
26
25
|
import { Select } from '../../chunk-FB2G4LNH.js';
|
|
26
|
+
import { Skeleton } from '../../chunk-TWNIAF7K.js';
|
|
27
27
|
import { Card } from '../../chunk-2MXWEIMD.js';
|
|
28
28
|
import { Drawer } from '../../chunk-O7LS6OZR.js';
|
|
29
29
|
import '../../chunk-DA4QII2N.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A badge's accessible name lives on its wrapper: with a label it is one image,
|
|
3
|
+
* without one it is decoration and stays out of the accessibility tree. The
|
|
4
|
+
* SVG inside is always hidden — the wrapper already speaks for it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function imageProps(label: string | undefined): {
|
|
7
|
+
"aria-hidden"?: undefined;
|
|
8
|
+
readonly role: "img";
|
|
9
|
+
readonly "aria-label": string;
|
|
10
|
+
} | {
|
|
11
|
+
role?: undefined;
|
|
12
|
+
"aria-label"?: undefined;
|
|
13
|
+
readonly "aria-hidden": true;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=a11y.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../../../src/components/geodesic/a11y.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;;mBAErC,KAAK;;;;;;EAEnB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type BadgeBaseProps } from "./badge-frame";
|
|
2
|
+
export type ActivityBadgeProps = BadgeBaseProps;
|
|
3
|
+
/** An activity (rush, workshop, event): the octahedron in a diamond. Completed is blue — you take part in an activity, you don't validate it. */
|
|
4
|
+
export declare function ActivityBadge(props: ActivityBadgeProps): import("react").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=activity-badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-badge.d.ts","sourceRoot":"","sources":["../../../src/components/geodesic/activity-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAc,MAAM,eAAe,CAAA;AAG/D,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAA;AAE/C,iJAAiJ;AACjJ,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAUtD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
import type { WithTestId } from "../../lib/test-id";
|
|
3
|
+
import { type BadgeStatus, type Hue, type Tone } from "./status";
|
|
4
|
+
/** The shape every generated solid has (see `packages/react/scripts/generate-geometry.ts`). */
|
|
5
|
+
export type SolidData = {
|
|
6
|
+
readonly facets: readonly {
|
|
7
|
+
readonly points: string;
|
|
8
|
+
readonly tone: Tone;
|
|
9
|
+
readonly rank: number;
|
|
10
|
+
}[];
|
|
11
|
+
readonly edges: string;
|
|
12
|
+
readonly hidden: string;
|
|
13
|
+
readonly hull: string;
|
|
14
|
+
readonly details: string;
|
|
15
|
+
};
|
|
16
|
+
export type BadgeTile = {
|
|
17
|
+
readonly kind: "circle";
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: "polygon";
|
|
20
|
+
readonly points: string;
|
|
21
|
+
};
|
|
22
|
+
/** Props every badge shares. */
|
|
23
|
+
export type BadgeBaseProps = WithTestId & {
|
|
24
|
+
status: BadgeStatus;
|
|
25
|
+
/**
|
|
26
|
+
* Completion while `in-progress`, 0–100: fills the solid from the bottom
|
|
27
|
+
* up, each face from its own base through a soft gradient, animating
|
|
28
|
+
* between values. 0–100 is drawn as 15–100% of the fill, so
|
|
29
|
+
* started work always shows light. Ignored in other statuses. Defaults to 50.
|
|
30
|
+
*/
|
|
31
|
+
progress?: number;
|
|
32
|
+
/** Rendered width and height, in px. */
|
|
33
|
+
size?: number;
|
|
34
|
+
/** Accessible name. Without one the badge is decorative and hidden from assistive tech. */
|
|
35
|
+
label?: string;
|
|
36
|
+
className?: string;
|
|
37
|
+
style?: CSSProperties;
|
|
38
|
+
};
|
|
39
|
+
type BadgeFrameProps = BadgeBaseProps & {
|
|
40
|
+
tile: BadgeTile;
|
|
41
|
+
solids: readonly SolidData[];
|
|
42
|
+
doneHue: Hue;
|
|
43
|
+
/**
|
|
44
|
+
* How a locked badge shows its solid: the module keeps its wireframe, the
|
|
45
|
+
* other shapes collapse to a dotted silhouette.
|
|
46
|
+
*/
|
|
47
|
+
locked: "wire" | "silhouette";
|
|
48
|
+
/** Dotted connectors drawn between the solids (the social badge). */
|
|
49
|
+
links?: string;
|
|
50
|
+
};
|
|
51
|
+
/** Starts at `from` and moves to `target` on the next frame, so CSS can transition it. */
|
|
52
|
+
export declare function useSettled<T>(from: T, target: T): T;
|
|
53
|
+
/**
|
|
54
|
+
* Draws any statused badge: a tile, one or more solids, and what the status
|
|
55
|
+
* adds (lock, glow). The per-shape components only pick the geometry
|
|
56
|
+
* and the done hue.
|
|
57
|
+
*/
|
|
58
|
+
export declare function BadgeFrame({ status, size, label, className, style, testId, tile, solids, doneHue, progress, locked, links, }: BadgeFrameProps): import("react").JSX.Element;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=badge-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge-frame.d.ts","sourceRoot":"","sources":["../../../src/components/geodesic/badge-frame.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAA6C,MAAM,OAAO,CAAA;AAGrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,GAAG,EAIR,KAAK,IAAI,EAEV,MAAM,UAAU,CAAA;AAEjB,+FAA+F;AAC/F,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS;QACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;QACvB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;QACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KACtB,EAAE,CAAA;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,SAAS,GACjB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAEzD,gCAAgC;AAChC,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IACxC,MAAM,EAAE,WAAW,CAAA;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAA;AAED,KAAK,eAAe,GAAG,cAAc,GAAG;IACtC,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,SAAS,SAAS,EAAE,CAAA;IAC5B,OAAO,EAAE,GAAG,CAAA;IACZ;;;OAGG;IACH,MAAM,EAAE,MAAM,GAAG,YAAY,CAAA;IAC7B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAoID,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,KAO/C;AAiCD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,IAAS,EACT,KAAK,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAa,EACb,MAAM,EACN,KAAK,GACN,EAAE,eAAe,+BAmEjB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type BadgeBaseProps } from "./badge-frame";
|
|
2
|
+
export type ExamBadgeProps = BadgeBaseProps;
|
|
3
|
+
/** An exam: the tetrahedron in a triangle. Validated, gold. */
|
|
4
|
+
export declare function ExamBadge(props: ExamBadgeProps): import("react").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=exam-badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exam-badge.d.ts","sourceRoot":"","sources":["../../../src/components/geodesic/exam-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAc,MAAM,eAAe,CAAA;AAG/D,MAAM,MAAM,cAAc,GAAG,cAAc,CAAA;AAE3C,+DAA+D;AAC/D,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAU9C"}
|