@rinzai/zen 0.8.5 → 0.8.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"theme-wave.d.ts","sourceRoot":"","sources":["../../packages/utils/theme-wave.ts"],"names":[],"mappings":"AA6NA;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAIvC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CACrB,MAAM,EAAE,MAAM,IAAI,EAClB,IAAI,CAAC,EAAE,OAAO,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EAChD,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,GACxB,IAAI,CAqKN"}
1
+ {"version":3,"file":"theme-wave.d.ts","sourceRoot":"","sources":["../../packages/utils/theme-wave.ts"],"names":[],"mappings":"AA6NA;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAIvC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CACrB,MAAM,EAAE,MAAM,IAAI,EAClB,IAAI,CAAC,EAAE,OAAO,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EAChD,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,GACxB,IAAI,CAyKN"}
@@ -168,19 +168,19 @@ function A() {
168
168
  e?.gl.drawArrays(e.gl.TRIANGLES, 0, 3);
169
169
  }
170
170
  function j(e, n, s) {
171
- let l = document.documentElement, f = !!s && s !== l, h = window.innerWidth, C = window.innerHeight, w = f ? s.getBoundingClientRect() : new DOMRect(0, 0, h, C), T = Math.max(0, w.left), A = Math.max(0, w.top), j = Math.min(h, w.right), M = Math.min(C, w.bottom), N = k() && j > T && M > A ? E() : null;
172
- if (!N) {
171
+ let l = document.documentElement, f = !!s && s !== l, C = window.innerWidth, w = window.innerHeight, T = f ? s.getBoundingClientRect() : new DOMRect(0, 0, C, w), A = Math.max(0, T.left), j = Math.max(0, T.top), M = Math.min(C, T.right), N = Math.min(w, T.bottom), P = k() && M > A && N > j ? E() : null;
172
+ if (!P) {
173
173
  t(f ? s : l, e);
174
174
  return;
175
175
  }
176
- let P = (T + j) / 2, F = (A + M) / 2;
176
+ let F = (A + M) / 2, I = (j + N) / 2;
177
177
  if (n instanceof Element) {
178
178
  let e = n.getBoundingClientRect();
179
- P = e.left + e.width / 2, F = e.top + e.height / 2;
180
- } else n && ({x: P, y: F} = n);
181
- let I = Math.hypot(Math.max(P - w.left, w.right - P), Math.max(F - w.top, w.bottom - F)), L = Math.random() * 2 * Math.PI, R = I + c + 2, z = ++_;
182
- D(N), y(), l.classList.add(p);
183
- let B = f ? g : "root";
179
+ F = e.left + e.width / 2, I = e.top + e.height / 2;
180
+ } else n && ({x: F, y: I} = n);
181
+ let L = Math.hypot(Math.max(F - T.left, T.right - F), Math.max(I - T.top, T.bottom - I)), R = Math.random() * 2 * Math.PI, z = L + c + 2, B = ++_;
182
+ D(P), y(), l.classList.add(p);
183
+ let V = f ? g : "root";
184
184
  if (f) {
185
185
  let { style: e } = s;
186
186
  v = {
@@ -189,52 +189,52 @@ function j(e, n, s) {
189
189
  priority: e.getPropertyPriority("view-transition-name")
190
190
  }, e.setProperty("view-transition-name", g, "important");
191
191
  }
192
- Object.assign(N.canvas.style, {
193
- left: `${T}px`,
194
- top: `${A}px`,
195
- width: `${j - T}px`,
196
- height: `${M - A}px`,
197
- clipPath: f ? `inset(${w.top - A}px ${j - w.right}px ${M - w.bottom}px ${w.left - T}px round ${getComputedStyle(s).borderRadius})` : ""
192
+ Object.assign(P.canvas.style, {
193
+ left: `${A}px`,
194
+ top: `${j}px`,
195
+ width: `${M - A}px`,
196
+ height: `${N - j}px`,
197
+ clipPath: f ? `inset(${T.top - j}px ${M - T.right}px ${N - T.bottom}px ${T.left - A}px round ${getComputedStyle(s).borderRadius})` : ""
198
198
  });
199
- let V = [], H = !1, U = document.startViewTransition(async () => {
199
+ let H = [], U = !1, W = document.startViewTransition(async () => {
200
200
  e(), await Promise.resolve();
201
201
  let t = getComputedStyle(f ? s : l);
202
- H = Number(t.getPropertyValue("--background").trim().split(" ")[0]) <= .5, l.classList.toggle(m, H);
202
+ U = Number(t.getPropertyValue("--background").trim().split(" ")[0]) <= .5, l.classList.toggle(m, U);
203
203
  let n = t.getPropertyValue("--glow").trim(), [r, i, a] = n.split(" ").map(Number);
204
- V = [
204
+ H = [
205
205
  n,
206
206
  t.getPropertyValue("--glow-2").trim(),
207
207
  `${r} ${i} ${(a + 240) % 360}`
208
- ].flatMap(O), document.body.append(N.canvas);
208
+ ].flatMap(O), document.body.append(P.canvas);
209
209
  });
210
- U.ready.then(() => {
211
- let e = H ? a : r, t = (e) => (H ? 1 - x(o, e) : x(i, e)) * R, n = `::view-transition-${H ? "old" : "new"}(${B})`, s = (n) => {
210
+ W.ready.then(() => {
211
+ let e = U ? a : r, t = (e) => (U ? 1 - x(o, e) : x(i, e)) * z, n = `::view-transition-${U ? "old" : "new"}(${V})`, s = new DOMMatrix(getComputedStyle(l, `::view-transition-group(${h})`).transform), [c, p] = f ? [T.left, T.top] : [A - s.e, j - s.f], m = (n) => {
212
212
  let r = t(n), i = n * e / 1e3;
213
213
  return `polygon(${Array.from({ length: d }, (e, t) => {
214
- let n = t / d * 2 * Math.PI, a = Math.max(0, r + S(n, r, i, L));
215
- return `${(P - w.left + a * Math.cos(n)).toFixed(1)}px ${(F - w.top + a * Math.sin(n)).toFixed(1)}px`;
214
+ let n = t / d * 2 * Math.PI, a = Math.max(0, r + S(n, r, i, R));
215
+ return `${(F - c + a * Math.cos(n)).toFixed(1)}px ${(I - p + a * Math.sin(n)).toFixed(1)}px`;
216
216
  }).join(",")})`;
217
- }, c = Array.from({ length: 49 }, (e, t) => ({
218
- clipPath: s(t / u),
217
+ }, g = Array.from({ length: 49 }, (e, t) => ({
218
+ clipPath: m(t / u),
219
219
  offset: t / u
220
- })), f = l.animate(c, {
220
+ })), v = l.animate(g, {
221
221
  duration: e,
222
222
  pseudoElement: n
223
223
  });
224
- f.pause();
225
- let p, { canvas: m, gl: h, uniform: g } = N, v = Math.min(window.devicePixelRatio || 1, 2);
226
- m.width = Math.round((j - T) * v), m.height = Math.round((M - A) * v), h.viewport(0, 0, m.width, m.height), h.uniform2f(g("res"), m.width, m.height), h.uniform1f(g("dpr"), v), h.uniform2f(g("from"), P - T, F - A), h.uniform1f(g("seed"), L), h.uniform3fv(g("aurora[0]"), V), h.uniform1f(g("light"), +!H);
227
- let y = (e) => 1.6 * b(.05, .45, e) * (1 - e) ** 1.5, C = (n) => {
228
- if (z !== _) return;
229
- p ??= n;
230
- let r = Math.min(1, (n - p) / e);
231
- if (f.currentTime = r * e, r === 1) return f.finish(), D(N);
224
+ v.pause();
225
+ let y, { canvas: C, gl: w, uniform: E } = P, O = Math.min(window.devicePixelRatio || 1, 2);
226
+ C.width = Math.round((M - A) * O), C.height = Math.round((N - j) * O), w.viewport(0, 0, C.width, C.height), w.uniform2f(E("res"), C.width, C.height), w.uniform1f(E("dpr"), O), w.uniform2f(E("from"), F - A, I - j), w.uniform1f(E("seed"), R), w.uniform3fv(E("aurora[0]"), H), w.uniform1f(E("light"), +!U);
227
+ let k = (e) => 1.6 * b(.05, .45, e) * (1 - e) ** 1.5, L = (n) => {
228
+ if (B !== _) return;
229
+ y ??= n;
230
+ let r = Math.min(1, (n - y) / e);
231
+ if (v.currentTime = r * e, r === 1) return v.finish(), D(P);
232
232
  let i = t(r), a = Math.min(1, (1 - r) / .12), o, s;
233
- H ? (o = 1.6 * r * Math.sqrt(1 - r) * a, s = Math.min(1, r * 4) * Math.min(1, i / 24) * a) : (o = y(r) * a, s = Math.min(1, i / 40) * (1 - r ** 3) * a), h.uniform1f(g("time"), r * e / 1e3), h.uniform1f(g("edge"), i), h.uniform1f(g("dir"), H ? -1 : 1), h.uniform1f(g("strength"), o), h.uniform1f(g("prism"), s), h.drawArrays(h.TRIANGLES, 0, 3), requestAnimationFrame(C);
233
+ U ? (o = 1.6 * r * Math.sqrt(1 - r) * a, s = Math.min(1, r * 4) * Math.min(1, i / 24) * a) : (o = k(r) * a, s = Math.min(1, i / 40) * (1 - r ** 3) * a), w.uniform1f(E("time"), r * e / 1e3), w.uniform1f(E("edge"), i), w.uniform1f(E("dir"), U ? -1 : 1), w.uniform1f(E("strength"), o), w.uniform1f(E("prism"), s), w.drawArrays(w.TRIANGLES, 0, 3), requestAnimationFrame(L);
234
234
  };
235
- requestAnimationFrame(C);
236
- }).catch(() => {}), U.finished.finally(() => {
237
- z === _ && (y(), l.classList.remove(p, m), D(N));
235
+ requestAnimationFrame(L);
236
+ }).catch(() => {}), W.finished.finally(() => {
237
+ B === _ && (y(), l.classList.remove(p, m), D(P));
238
238
  });
239
239
  }
240
240
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rinzai/zen",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "React components in dark glass: translucent surfaces, hairline borders that catch a pointer light, one accent colour. Tailwind v4, no runtime dependencies.",
5
5
  "keywords": [
6
6
  "react",