@rinzai/zen 0.6.1 → 0.7.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/LICENSE +27 -0
- package/README.md +3 -3
- package/dist/alert/index.d.ts +21 -0
- package/dist/alert/index.d.ts.map +1 -0
- package/dist/alert/index.js +49 -0
- package/dist/avatar/index.d.ts.map +1 -1
- package/dist/avatar/index.js +25 -22
- package/dist/button/index.d.ts +2 -1
- package/dist/button/index.d.ts.map +1 -1
- package/dist/button/index.js +43 -12
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +86 -85
- package/dist/chart/donut.d.ts +4 -1
- package/dist/chart/donut.d.ts.map +1 -1
- package/dist/chart/donut.js +76 -66
- package/dist/chart/index.d.ts +8 -2
- package/dist/chart/index.d.ts.map +1 -1
- package/dist/chart/index.js +192 -182
- package/dist/chart/palette.d.ts +14 -0
- package/dist/chart/palette.d.ts.map +1 -0
- package/dist/chart/palette.js +9 -0
- package/dist/chart/tooltip.d.ts +6 -2
- package/dist/chart/tooltip.d.ts.map +1 -1
- package/dist/chart/tooltip.js +6 -6
- package/dist/checkbox/index.d.ts.map +1 -1
- package/dist/checkbox/index.js +28 -44
- package/dist/chip/index.js +1 -1
- package/dist/code-block/index.js +1 -1
- package/dist/date-picker/index.d.ts.map +1 -1
- package/dist/date-picker/index.js +24 -38
- package/dist/disclosure/index.js +1 -1
- package/dist/editable-cell/index.js +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +33 -32
- package/dist/header/index.d.ts +9 -1
- package/dist/header/index.d.ts.map +1 -1
- package/dist/header/index.js +17 -9
- package/dist/icons/arrow-left.d.ts +3 -0
- package/dist/icons/arrow-left.d.ts.map +1 -0
- package/dist/icons/arrow-right.d.ts +3 -0
- package/dist/icons/arrow-right.d.ts.map +1 -0
- package/dist/icons/bars.d.ts +3 -0
- package/dist/icons/bars.d.ts.map +1 -0
- package/dist/icons/calendar.d.ts +3 -0
- package/dist/icons/calendar.d.ts.map +1 -0
- package/dist/icons/chart-bar.d.ts +3 -0
- package/dist/icons/chart-bar.d.ts.map +1 -0
- package/dist/icons/chevron-down.d.ts.map +1 -1
- package/dist/icons/chevron-down.js +4 -2
- package/dist/icons/chevron-left.d.ts.map +1 -1
- package/dist/icons/chevron-left.js +4 -2
- package/dist/icons/chevron-right.d.ts.map +1 -1
- package/dist/icons/chevron-right.js +4 -2
- package/dist/icons/chevron-up.d.ts.map +1 -1
- package/dist/icons/chevron-up.js +4 -2
- package/dist/icons/ellipsis.d.ts +0 -1
- package/dist/icons/ellipsis.d.ts.map +1 -1
- package/dist/icons/flag.d.ts +3 -0
- package/dist/icons/flag.d.ts.map +1 -0
- package/dist/icons/list-bullet.d.ts +3 -0
- package/dist/icons/list-bullet.d.ts.map +1 -0
- package/dist/icons/lock.d.ts +3 -0
- package/dist/icons/lock.d.ts.map +1 -0
- package/dist/icons/logout.d.ts +3 -0
- package/dist/icons/logout.d.ts.map +1 -0
- package/dist/icons/micro/calendar.d.ts +3 -0
- package/dist/icons/micro/calendar.d.ts.map +1 -0
- package/dist/icons/micro/calendar.js +21 -0
- package/dist/icons/micro/check.d.ts +3 -0
- package/dist/icons/micro/check.d.ts.map +1 -0
- package/dist/icons/micro/check.js +21 -0
- package/dist/icons/micro/chevron-down.d.ts +3 -0
- package/dist/icons/micro/chevron-down.d.ts.map +1 -0
- package/dist/icons/micro/chevron-down.js +21 -0
- package/dist/icons/micro/chevron-right.d.ts +3 -0
- package/dist/icons/micro/chevron-right.d.ts.map +1 -0
- package/dist/icons/micro/chevron-right.js +21 -0
- package/dist/icons/micro/exclamation-triangle.d.ts +3 -0
- package/dist/icons/micro/exclamation-triangle.d.ts.map +1 -0
- package/dist/icons/micro/exclamation-triangle.js +21 -0
- package/dist/icons/micro/information-circle.d.ts +3 -0
- package/dist/icons/micro/information-circle.d.ts.map +1 -0
- package/dist/icons/micro/information-circle.js +21 -0
- package/dist/icons/micro/minus.d.ts +3 -0
- package/dist/icons/micro/minus.d.ts.map +1 -0
- package/dist/icons/micro/minus.js +17 -0
- package/dist/icons/micro/moon.d.ts +3 -0
- package/dist/icons/micro/moon.d.ts.map +1 -0
- package/dist/icons/micro/moon.js +17 -0
- package/dist/icons/micro/sun.d.ts +3 -0
- package/dist/icons/micro/sun.d.ts.map +1 -0
- package/dist/icons/micro/sun.js +17 -0
- package/dist/icons/micro/x-mark.d.ts +3 -0
- package/dist/icons/micro/x-mark.d.ts.map +1 -0
- package/dist/icons/micro/x-mark.js +17 -0
- package/dist/icons/search.d.ts.map +1 -1
- package/dist/icons/search.js +4 -2
- package/dist/icons/settings.d.ts +3 -0
- package/dist/icons/settings.d.ts.map +1 -0
- package/dist/icons/squares.d.ts +3 -0
- package/dist/icons/squares.d.ts.map +1 -0
- package/dist/icons/table.d.ts +3 -0
- package/dist/icons/table.d.ts.map +1 -0
- package/dist/icons/x-mark.d.ts.map +1 -1
- package/dist/icons/x-mark.js +4 -2
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/lib.js +57 -61
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +67 -60
- package/dist/month-picker/index.d.ts.map +1 -1
- package/dist/month-picker/index.js +55 -55
- package/dist/pills/index.d.ts +1 -1
- package/dist/pills/index.d.ts.map +1 -1
- package/dist/pills/index.js +6 -2
- package/dist/popover/index.js +12 -11
- package/dist/select/index.d.ts.map +1 -1
- package/dist/select/index.js +96 -102
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/slider/index.js +1 -1
- package/dist/status-pill/index.d.ts +18 -0
- package/dist/status-pill/index.d.ts.map +1 -0
- package/dist/status-pill/index.js +25 -0
- package/dist/tab-bar/index.js +1 -1
- package/dist/table/index.js +1 -1
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +9 -5
- package/dist/theme-toggle/index.d.ts +26 -4
- package/dist/theme-toggle/index.d.ts.map +1 -1
- package/dist/theme-toggle/index.js +42 -35
- package/dist/theme.css +67 -1
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +119 -106
- package/dist/tree/index.d.ts +22 -3
- package/dist/tree/index.d.ts.map +1 -1
- package/dist/tree/index.js +76 -56
- package/dist/utils/date.d.ts +6 -4
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +18 -16
- package/dist/utils/field-chevron.d.ts.map +1 -1
- package/dist/utils/field-chevron.js +5 -14
- package/dist/utils/status-icons.d.ts +1 -1
- package/dist/utils/status-icons.d.ts.map +1 -1
- package/dist/utils/status-icons.js +11 -41
- package/dist/utils/styles.d.ts +9 -3
- package/dist/utils/styles.d.ts.map +1 -1
- package/dist/utils/styles.js +2 -2
- package/dist/utils/theme-wave.d.ts +26 -0
- package/dist/utils/theme-wave.d.ts.map +1 -0
- package/dist/utils/theme-wave.js +239 -0
- package/dist/utils/typeahead.d.ts +12 -0
- package/dist/utils/typeahead.d.ts.map +1 -0
- package/dist/utils/typeahead.js +19 -0
- package/dist/zen.css +1 -1
- package/package.json +2 -1
- package/dist/icons/ellipsis.js +0 -31
- package/dist/icons/index.d.ts +0 -9
- package/dist/icons/index.d.ts.map +0 -1
- package/dist/icons/status.d.ts +0 -2
- package/dist/icons/status.d.ts.map +0 -1
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { applyGraphicsMode as e } from "./graphics.js";
|
|
3
|
+
import { oklchToLinearRgb as t } from "./theme.js";
|
|
4
|
+
//#region packages/utils/theme-wave.ts
|
|
5
|
+
var n = 1330, r = [
|
|
6
|
+
.25,
|
|
7
|
+
.55,
|
|
8
|
+
.35,
|
|
9
|
+
1
|
|
10
|
+
], i = 1050, a = [
|
|
11
|
+
.55,
|
|
12
|
+
0,
|
|
13
|
+
.85,
|
|
14
|
+
.35
|
|
15
|
+
], o = .05, s = 36, c = [
|
|
16
|
+
[
|
|
17
|
+
3,
|
|
18
|
+
1.9,
|
|
19
|
+
.5
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
5,
|
|
23
|
+
-2.7,
|
|
24
|
+
.3
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
8,
|
|
28
|
+
4.1,
|
|
29
|
+
.2
|
|
30
|
+
]
|
|
31
|
+
], l = 48, u = 72, d = 28, f = "zen-theme-waving", p = "zen-theme-closing", m = "zen-theme-water", h = "zen-theme-area", g = 0, _ = null;
|
|
32
|
+
function v() {
|
|
33
|
+
_ && (_.style.viewTransitionName = _.name), _ = null;
|
|
34
|
+
}
|
|
35
|
+
function y(e, t, n) {
|
|
36
|
+
let r = Math.min(1, Math.max(0, (n - e) / (t - e)));
|
|
37
|
+
return r * r * (3 - 2 * r);
|
|
38
|
+
}
|
|
39
|
+
function b([e, t, n, r], i) {
|
|
40
|
+
let a = (e, t, n) => 3 * e * n * (1 - n) ** 2 + 3 * t * n ** 2 * (1 - n) + n ** 3, o = 0, s = 1;
|
|
41
|
+
for (let t = 0; t < 24; t++) {
|
|
42
|
+
let t = (o + s) / 2;
|
|
43
|
+
a(e, n, t) < i ? o = t : s = t;
|
|
44
|
+
}
|
|
45
|
+
return a(t, r, (o + s) / 2);
|
|
46
|
+
}
|
|
47
|
+
function x(e, t, n, r) {
|
|
48
|
+
return Math.min(s, o * t) * c.reduce((t, [i, a, o], s) => t + o * Math.sin(i * e + a * n + r * (s + 1)), 0);
|
|
49
|
+
}
|
|
50
|
+
var S = `
|
|
51
|
+
precision highp float;
|
|
52
|
+
uniform vec2 res;
|
|
53
|
+
uniform float dpr;
|
|
54
|
+
uniform vec2 from;
|
|
55
|
+
uniform float time;
|
|
56
|
+
uniform float seed;
|
|
57
|
+
uniform float strength;
|
|
58
|
+
// 1 while the edge spreads out, -1 while it closes in.
|
|
59
|
+
uniform float dir;
|
|
60
|
+
uniform float edge;
|
|
61
|
+
uniform float prism;
|
|
62
|
+
uniform vec3 aurora[3];
|
|
63
|
+
uniform float light;
|
|
64
|
+
|
|
65
|
+
float wobble(float a, float r) {
|
|
66
|
+
float size = min(${s.toFixed(1)}, ${o.toFixed(3)} * r);
|
|
67
|
+
return size * (${c.map(([e, t, n], r) => `${n.toFixed(2)} * sin(${e.toFixed(1)} * a + ${t.toFixed(2)} * time + seed * ${(r + 1).toFixed(1)})`).join(" + ")});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// A train of ripples whose front is x px away (ahead of it when positive, as it moves):
|
|
71
|
+
// a steep front, crests fading out behind it, and running outwards through
|
|
72
|
+
// the train faster than it spreads, as on water. Its slope (height per px of x): the
|
|
73
|
+
// ripples are a fixed size, as real ones are, however big the water.
|
|
74
|
+
float rippleSlope(float x) {
|
|
75
|
+
float k = 6.2832 / ${d.toFixed(1)};
|
|
76
|
+
float reach = x < 0.0 ? ${(2.5 * d).toFixed(1)} : ${(.35 * d).toFixed(1)};
|
|
77
|
+
float phase = k * x - 7.0 * time;
|
|
78
|
+
return exp(-x * x / (2.0 * reach * reach)) * (-x / (reach * reach) * cos(phase) / k - sin(phase));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Light from the top left. A glint off a surface of this slope, bent a little
|
|
82
|
+
// more or less for each colour, so glints split into a rainbow at their edges.
|
|
83
|
+
const vec3 LIGHT = vec3(-0.45, -0.55, 0.7);
|
|
84
|
+
float glint(vec2 slope, float bend) {
|
|
85
|
+
vec3 n = normalize(vec3(-slope * bend, 1.0));
|
|
86
|
+
vec3 mid = normalize(normalize(LIGHT) + vec3(0.0, 0.0, 1.0));
|
|
87
|
+
return max(0.0, pow(max(dot(n, mid), 0.0), 40.0) - pow(mid.z, 40.0));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
void main() {
|
|
91
|
+
vec2 p = vec2(gl_FragCoord.x, res.y - gl_FragCoord.y) / dpr;
|
|
92
|
+
vec2 v = p - from;
|
|
93
|
+
float a = atan(v.y, v.x);
|
|
94
|
+
// How far from the edge (outside it when positive).
|
|
95
|
+
float e = length(v) - edge - wobble(a, edge);
|
|
96
|
+
// The ripples' slope: across their rings, outwards.
|
|
97
|
+
vec2 slope = 0.9 * strength * dir * rippleSlope(dir * e) * v / max(length(v), 0.001);
|
|
98
|
+
|
|
99
|
+
// Aurora: the glow colours, drifting round the circle.
|
|
100
|
+
float hue = fract(a / 6.2832 + 0.15 * time + length(v) * 0.0008) * 3.0;
|
|
101
|
+
vec3 tint = hue < 1.0 ? mix(aurora[0], aurora[1], hue)
|
|
102
|
+
: hue < 2.0 ? mix(aurora[1], aurora[2], hue - 1.0)
|
|
103
|
+
: mix(aurora[2], aurora[0], hue - 2.0);
|
|
104
|
+
|
|
105
|
+
// Iridescence, as on a soap film: the colour turns with the film's thickness,
|
|
106
|
+
// which swells and thins round the ring and over time, slowly, and in soft
|
|
107
|
+
// colours: nothing flickers, or flashes saturated colour (photosensitivity).
|
|
108
|
+
float film = 0.02 * e + 0.35 * sin(2.0 * a + 0.6 * time + seed) + 0.25 * sin(5.0 * a - 0.9 * time) + 0.25 * time;
|
|
109
|
+
vec3 sheen = mix(mix(tint, 0.5 + 0.5 * cos(6.2832 * (film + vec3(0.0, 0.33, 0.67))), 0.5), vec3(1.0), 0.2);
|
|
110
|
+
|
|
111
|
+
vec3 spark = vec3(glint(slope, 0.8), glint(slope, 1.0), glint(slope, 1.2));
|
|
112
|
+
// Slopes facing the light are lit, the others shaded.
|
|
113
|
+
float facing = dot(normalize(vec3(-slope, 1.0)), normalize(LIGHT)) - normalize(LIGHT).z;
|
|
114
|
+
vec3 color = 1.6 * spark * mix(vec3(1.0), mix(tint, sheen, 0.6), mix(0.4, 0.85, light)) + 0.6 * max(facing, 0.0) * tint;
|
|
115
|
+
float shade = mix(0.7, 0.45, light) * max(-facing, 0.0);
|
|
116
|
+
|
|
117
|
+
// The edge: a band of sheen with a bright core, and the aurora trailing behind.
|
|
118
|
+
color += prism * (0.9 * sheen * exp(-e * e / 160.0) + 0.5 * exp(-e * e / 6.0));
|
|
119
|
+
color += prism * 0.45 * tint * exp(-(e + 28.0 * dir) * (e + 28.0 * dir) / 1800.0);
|
|
120
|
+
|
|
121
|
+
color = clamp(color, 0.0, 1.0);
|
|
122
|
+
float cover = max(color.r, max(color.g, color.b));
|
|
123
|
+
gl_FragColor = vec4(color, cover + shade * (1.0 - cover));
|
|
124
|
+
}`, C = "attribute vec2 at; void main() { gl_Position = vec4(at, 0.0, 1.0); }", w;
|
|
125
|
+
function T() {
|
|
126
|
+
if (w !== void 0) return w;
|
|
127
|
+
w = null;
|
|
128
|
+
let e = document.createElement("canvas");
|
|
129
|
+
e.setAttribute("aria-hidden", "true"), e.style.cssText = `position:fixed;pointer-events:none;z-index:2147483647;view-transition-name:${m}`;
|
|
130
|
+
let t = e.getContext("webgl", {
|
|
131
|
+
premultipliedAlpha: !0,
|
|
132
|
+
antialias: !1
|
|
133
|
+
}), n = t?.createProgram();
|
|
134
|
+
if (!t || !n) return null;
|
|
135
|
+
for (let [e, r] of [[t.VERTEX_SHADER, C], [t.FRAGMENT_SHADER, S]]) {
|
|
136
|
+
let i = t.createShader(e);
|
|
137
|
+
if (!i) return null;
|
|
138
|
+
t.shaderSource(i, r), t.compileShader(i), t.attachShader(n, i);
|
|
139
|
+
}
|
|
140
|
+
if (t.bindAttribLocation(n, 0, "at"), t.linkProgram(n), !t.getProgramParameter(n, t.LINK_STATUS)) return null;
|
|
141
|
+
t.useProgram(n), t.bindBuffer(t.ARRAY_BUFFER, t.createBuffer()), t.bufferData(t.ARRAY_BUFFER, new Float32Array([
|
|
142
|
+
-1,
|
|
143
|
+
-1,
|
|
144
|
+
3,
|
|
145
|
+
-1,
|
|
146
|
+
-1,
|
|
147
|
+
3
|
|
148
|
+
]), t.STATIC_DRAW), t.enableVertexAttribArray(0), t.vertexAttribPointer(0, 2, t.FLOAT, !1, 0, 0);
|
|
149
|
+
let r = /* @__PURE__ */ new Map();
|
|
150
|
+
return w = {
|
|
151
|
+
canvas: e,
|
|
152
|
+
gl: t,
|
|
153
|
+
uniform: (e) => (r.has(e) || r.set(e, t.getUniformLocation(n, e)), r.get(e))
|
|
154
|
+
}, w;
|
|
155
|
+
}
|
|
156
|
+
function E(e) {
|
|
157
|
+
e.gl.clear(e.gl.COLOR_BUFFER_BIT), e.canvas.remove();
|
|
158
|
+
}
|
|
159
|
+
function D(e) {
|
|
160
|
+
return t(e).map((e) => e <= .0031308 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - .055);
|
|
161
|
+
}
|
|
162
|
+
function O() {
|
|
163
|
+
return !(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches || document.documentElement.classList.contains("reduce-motion")) && !!document.startViewTransition && e() !== "lite";
|
|
164
|
+
}
|
|
165
|
+
function k() {
|
|
166
|
+
if (w !== void 0 || !O()) return;
|
|
167
|
+
let e = T();
|
|
168
|
+
e?.gl.drawArrays(e.gl.TRIANGLES, 0, 3);
|
|
169
|
+
}
|
|
170
|
+
function A(e, t, o) {
|
|
171
|
+
let c = document.documentElement, d = !!o && o !== c, m = window.innerWidth, S = window.innerHeight, C = d ? o.getBoundingClientRect() : new DOMRect(0, 0, m, S), w = Math.max(0, C.left), k = Math.max(0, C.top), A = Math.min(m, C.right), j = Math.min(S, C.bottom), M = O() && A > w && j > k ? T() : null;
|
|
172
|
+
if (!M) {
|
|
173
|
+
e();
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
let N = (w + A) / 2, P = (k + j) / 2;
|
|
177
|
+
if (t instanceof Element) {
|
|
178
|
+
let e = t.getBoundingClientRect();
|
|
179
|
+
N = e.left + e.width / 2, P = e.top + e.height / 2;
|
|
180
|
+
} else t && ({x: N, y: P} = t);
|
|
181
|
+
let F = Math.hypot(Math.max(N - C.left, C.right - N), Math.max(P - C.top, C.bottom - P)), I = Math.random() * 2 * Math.PI, L = F + s + 2, R = ++g;
|
|
182
|
+
E(M), v(), c.classList.add(f);
|
|
183
|
+
let z = d ? h : "root";
|
|
184
|
+
if (d) {
|
|
185
|
+
let { style: e } = o;
|
|
186
|
+
_ = {
|
|
187
|
+
style: e,
|
|
188
|
+
name: e.viewTransitionName
|
|
189
|
+
}, e.viewTransitionName = h;
|
|
190
|
+
}
|
|
191
|
+
Object.assign(M.canvas.style, {
|
|
192
|
+
left: `${w}px`,
|
|
193
|
+
top: `${k}px`,
|
|
194
|
+
width: `${A - w}px`,
|
|
195
|
+
height: `${j - k}px`,
|
|
196
|
+
clipPath: d ? `inset(${C.top - k}px ${A - C.right}px ${j - C.bottom}px ${C.left - w}px round ${getComputedStyle(o).borderRadius})` : ""
|
|
197
|
+
});
|
|
198
|
+
let B = [], V = !1, H = document.startViewTransition(() => {
|
|
199
|
+
e();
|
|
200
|
+
let t = getComputedStyle(d ? o : c);
|
|
201
|
+
V = Number(t.getPropertyValue("--background").trim().split(" ")[0]) <= .5, c.classList.toggle(p, V);
|
|
202
|
+
let n = t.getPropertyValue("--glow").trim(), [r, i, a] = n.split(" ").map(Number);
|
|
203
|
+
B = [
|
|
204
|
+
n,
|
|
205
|
+
t.getPropertyValue("--glow-2").trim(),
|
|
206
|
+
`${r} ${i} ${(a + 240) % 360}`
|
|
207
|
+
].flatMap(D), document.body.append(M.canvas);
|
|
208
|
+
});
|
|
209
|
+
H.ready.then(() => {
|
|
210
|
+
let e = V ? i : n, t = (e) => (V ? 1 - b(a, e) : b(r, e)) * L, o = `::view-transition-${V ? "old" : "new"}(${z})`, s = (n) => {
|
|
211
|
+
let r = t(n), i = n * e / 1e3;
|
|
212
|
+
return `polygon(${Array.from({ length: u }, (e, t) => {
|
|
213
|
+
let n = t / u * 2 * Math.PI, a = Math.max(0, r + x(n, r, i, I));
|
|
214
|
+
return `${(N - C.left + a * Math.cos(n)).toFixed(1)}px ${(P - C.top + a * Math.sin(n)).toFixed(1)}px`;
|
|
215
|
+
}).join(",")})`;
|
|
216
|
+
}, d = Array.from({ length: 49 }, (e, t) => ({
|
|
217
|
+
clipPath: s(t / l),
|
|
218
|
+
offset: t / l
|
|
219
|
+
})), f = c.animate(d, {
|
|
220
|
+
duration: e,
|
|
221
|
+
pseudoElement: o,
|
|
222
|
+
fill: "forwards"
|
|
223
|
+
});
|
|
224
|
+
H.finished.finally(() => f.cancel());
|
|
225
|
+
let { canvas: p, gl: m, uniform: h } = M, _ = Math.min(window.devicePixelRatio || 1, 2);
|
|
226
|
+
p.width = Math.round((A - w) * _), p.height = Math.round((j - k) * _), m.viewport(0, 0, p.width, p.height), m.uniform2f(h("res"), p.width, p.height), m.uniform1f(h("dpr"), _), m.uniform2f(h("from"), N - w, P - k), m.uniform1f(h("seed"), I), m.uniform3fv(h("aurora[0]"), B), m.uniform1f(h("light"), +!V);
|
|
227
|
+
let v = (e) => 1.6 * y(.05, .45, e) * (1 - e) ** 1.5, S = () => {
|
|
228
|
+
if (R !== g) return;
|
|
229
|
+
if (f.playState === "finished") return E(M);
|
|
230
|
+
let n = Math.min(1, Number(f.currentTime ?? 0) / e), r = t(n), i = Math.min(1, (1 - n) / .12), a, o;
|
|
231
|
+
V ? (a = 1.6 * n * Math.sqrt(1 - n) * i, o = Math.min(1, n * 4) * Math.min(1, r / 24) * i) : (a = v(n) * i, o = Math.min(1, r / 40) * (1 - n ** 3) * i), m.uniform1f(h("time"), n * e / 1e3), m.uniform1f(h("edge"), r), m.uniform1f(h("dir"), V ? -1 : 1), m.uniform1f(h("strength"), a), m.uniform1f(h("prism"), o), m.drawArrays(m.TRIANGLES, 0, 3), requestAnimationFrame(S);
|
|
232
|
+
};
|
|
233
|
+
S();
|
|
234
|
+
}).catch(() => {}), H.finished.finally(() => {
|
|
235
|
+
R === g && (v(), c.classList.remove(f, p), E(M));
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
//#endregion
|
|
239
|
+
export { k as prepareThemeWave, A as themeWave };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type to jump, as in a native list: keys typed quickly in a row search
|
|
3
|
+
* together. Returns what's been typed so far (lower case) when the key is a
|
|
4
|
+
* letter or digit, else null; match it against the start of each item's label.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useTypeahead(): (e: {
|
|
7
|
+
key: string;
|
|
8
|
+
ctrlKey: boolean;
|
|
9
|
+
metaKey: boolean;
|
|
10
|
+
altKey: boolean;
|
|
11
|
+
}) => string | null;
|
|
12
|
+
//# sourceMappingURL=typeahead.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeahead.d.ts","sourceRoot":"","sources":["../../packages/utils/typeahead.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,CAAC,CAAC,EAAE;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACnB,KAAK,MAAM,GAAG,IAAI,CASlB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef as e } from "react";
|
|
3
|
+
//#region packages/utils/typeahead.ts
|
|
4
|
+
function t() {
|
|
5
|
+
let t = e({
|
|
6
|
+
text: "",
|
|
7
|
+
at: 0
|
|
8
|
+
});
|
|
9
|
+
return (e) => {
|
|
10
|
+
if (e.key.length !== 1 || e.ctrlKey || e.metaKey || e.altKey) return null;
|
|
11
|
+
let n = Date.now(), r = (n - t.current.at < 700 ? t.current.text : "") + e.key.toLowerCase();
|
|
12
|
+
return t.current = {
|
|
13
|
+
text: r,
|
|
14
|
+
at: n
|
|
15
|
+
}, r;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as useTypeahead };
|