@actioneer/ads 0.5.7 → 0.5.9

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 (147) hide show
  1. package/bin/ads-init.mjs +6 -0
  2. package/components/accordion.js +50 -48
  3. package/components/agent-icon.d.ts +12 -0
  4. package/components/agent-icon.js +133 -120
  5. package/components/ai-elements/chain-of-thought.d.ts +1 -1
  6. package/components/ai-elements/chain-of-thought.js +108 -108
  7. package/components/ai-elements/chart.js +16 -14
  8. package/components/ai-elements/inline-citation.js +41 -41
  9. package/components/ai-elements/message.js +4 -4
  10. package/components/ai-elements/queue.js +7 -7
  11. package/components/ai-elements/research-activity.js +114 -114
  12. package/components/ai-elements/shimmer.d.ts +2 -2
  13. package/components/ai-elements/speech-input.js +28 -28
  14. package/components/ai-elements/task-progress.js +26 -16
  15. package/components/ai-elements/task.js +17 -17
  16. package/components/ai-elements/tool.js +6 -6
  17. package/components/ai-elements/transcript.js +6 -5
  18. package/components/ai-elements/voice.js +1 -1
  19. package/components/alert.js +10 -10
  20. package/components/answer-sources.js +1 -1
  21. package/components/answer.js +115 -114
  22. package/components/assistant-ui/action-bar.js +94 -48
  23. package/components/assistant-ui/attachment.js +103 -75
  24. package/components/assistant-ui/badge.d.ts +1 -1
  25. package/components/assistant-ui/badge.js +17 -17
  26. package/components/assistant-ui/chain-of-thought.d.ts +1 -1
  27. package/components/assistant-ui/composer-add-context.js +9 -9
  28. package/components/assistant-ui/composer-deep-research.js +5 -5
  29. package/components/assistant-ui/composer-harness.js +11 -9
  30. package/components/assistant-ui/composer-trigger-popover.js +45 -34
  31. package/components/assistant-ui/composer.js +59 -59
  32. package/components/assistant-ui/error.js +14 -14
  33. package/components/assistant-ui/file.d.ts +1 -1
  34. package/components/assistant-ui/image.d.ts +1 -1
  35. package/components/assistant-ui/image.js +113 -103
  36. package/components/assistant-ui/markdown-text.js +18 -18
  37. package/components/assistant-ui/message.js +46 -45
  38. package/components/assistant-ui/quote.js +1 -1
  39. package/components/assistant-ui/reasoning.d.ts +1 -1
  40. package/components/assistant-ui/reasoning.js +66 -77
  41. package/components/assistant-ui/suggestions.js +4 -4
  42. package/components/assistant-ui/thread.js +22 -22
  43. package/components/assistant-ui/tool-fallback.js +60 -63
  44. package/components/assistant-ui/tool-group.d.ts +1 -1
  45. package/components/assistant-ui/tool-group.js +36 -42
  46. package/components/audio-waveform.js +25 -24
  47. package/components/autocomplete.d.ts +1 -0
  48. package/components/autocomplete.js +45 -43
  49. package/components/avatar.d.ts +1 -0
  50. package/components/avatar.js +27 -26
  51. package/components/badge.d.ts +1 -1
  52. package/components/breadcrumbs.d.ts +2 -0
  53. package/components/breadcrumbs.js +52 -50
  54. package/components/button.d.ts +2 -2
  55. package/components/button.js +22 -20
  56. package/components/card.js +8 -8
  57. package/components/carousel.js +105 -104
  58. package/components/chart.d.ts +6 -0
  59. package/components/chart.js +743 -672
  60. package/components/checkbox.js +74 -38
  61. package/components/chip.d.ts +1 -1
  62. package/components/code-block.js +3 -3
  63. package/components/collapsible.js +67 -23
  64. package/components/connector-card.js +6 -6
  65. package/components/drawer.d.ts +18 -11
  66. package/components/drawer.js +81 -78
  67. package/components/dropdown.d.ts +2 -0
  68. package/components/dropdown.js +88 -79
  69. package/components/empty-state.d.ts +1 -1
  70. package/components/empty-state.js +7 -7
  71. package/components/field.d.ts +4 -0
  72. package/components/field.js +45 -34
  73. package/components/file-dropzone.js +12 -12
  74. package/components/index.d.ts +3 -0
  75. package/components/index.js +584 -558
  76. package/components/input-field.js +51 -46
  77. package/components/input.js +20 -20
  78. package/components/link.js +9 -9
  79. package/components/modal.d.ts +5 -1
  80. package/components/modal.js +121 -76
  81. package/components/navbar.d.ts +1 -1
  82. package/components/navbar.js +1 -1
  83. package/components/number-field.js +38 -29
  84. package/components/page-header.js +12 -12
  85. package/components/pagination.js +19 -19
  86. package/components/panel.js +2 -2
  87. package/components/pixel-blast-svg.js +3 -3
  88. package/components/pixel-icon.d.ts +4 -0
  89. package/components/pixel-icon.js +210 -164
  90. package/components/popover.d.ts +1 -1
  91. package/components/popover.js +66 -64
  92. package/components/progress-circle.js +36 -32
  93. package/components/progress.js +28 -24
  94. package/components/radio.js +59 -49
  95. package/components/resizable-panel.js +1 -1
  96. package/components/reveal.d.ts +2 -2
  97. package/components/ripple.d.ts +3 -3
  98. package/components/scroll-area.js +17 -16
  99. package/components/segmented.d.ts +1 -0
  100. package/components/segmented.js +39 -36
  101. package/components/select.d.ts +7 -0
  102. package/components/select.js +186 -137
  103. package/components/setting-row.js +45 -42
  104. package/components/sidebar.js +131 -127
  105. package/components/skeleton.js +5 -5
  106. package/components/spinner.d.ts +13 -4
  107. package/components/spinner.js +42 -42
  108. package/components/stepper.js +21 -21
  109. package/components/switch.js +41 -39
  110. package/components/table.d.ts +16 -0
  111. package/components/table.js +393 -260
  112. package/components/tabs.js +149 -137
  113. package/components/toast.js +66 -66
  114. package/components/tooltip.js +2 -2
  115. package/components/tree.js +62 -51
  116. package/components/typography.d.ts +2 -1
  117. package/components/typography.js +33 -32
  118. package/components/ui/button.d.ts +2 -2
  119. package/components/ui/button.js +19 -19
  120. package/components/ui/collapsible.d.ts +1 -5
  121. package/components/ui/dialog.d.ts +3 -3
  122. package/components/ui/dialog.js +95 -58
  123. package/components/ui/tooltip.d.ts +2 -2
  124. package/components/ui/tooltip.js +67 -33
  125. package/components/viz-charts.js +95 -95
  126. package/demo/components/add-to-artifact.js +363 -0
  127. package/demo/lib/artifact-library.js +142 -0
  128. package/demo/lib/artifact-pin-guard.js +12 -0
  129. package/fonts/aribau-grotesk-medium.woff2 +0 -0
  130. package/fonts/aribau-grotesk-regular.woff2 +0 -0
  131. package/fonts.css +11 -11
  132. package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +17 -16
  133. package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +21 -20
  134. package/lib/icons.d.ts +24 -0
  135. package/lib/icons.js +114 -108
  136. package/lib/motion.d.ts +42 -39
  137. package/lib/motion.js +112 -52
  138. package/lib/spinner-mark.d.ts +9 -0
  139. package/lib/spinner-mark.js +98 -0
  140. package/llms.txt +53 -19
  141. package/manifest.json +258 -36
  142. package/package.json +1 -1
  143. package/styles.css +143 -124
  144. package/theme.css +90 -93
  145. package/components/ui/collapsible.js +0 -35
  146. package/fonts/aribau-grotesk-500.otf +0 -0
  147. package/fonts/aribau-grotesk-600.woff2 +0 -0
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- var G = Object.defineProperty;
3
- var I = (r, e, o) => e in r ? G(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o;
4
- var i = (r, e, o) => I(r, typeof e != "symbol" ? e + "" : e, o);
5
- import { jsx as O } from "react/jsx-runtime";
6
- import * as P from "react";
7
- import { Renderer as z, Triangle as K, Program as U, Mesh as _, Texture as N } from "ogl";
8
- import { cn as q } from "../lib/cn.js";
9
- const R = {
2
+ var I = Object.defineProperty;
3
+ var O = (o, e, t) => e in o ? I(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
4
+ var i = (o, e, t) => O(o, typeof e != "symbol" ? e + "" : e, t);
5
+ import { jsx as z } from "react/jsx-runtime";
6
+ import * as D from "react";
7
+ import { Renderer as K, Triangle as U, Program as _, Mesh as N, Texture as q } from "ogl";
8
+ import { cn as V } from "../lib/cn.js";
9
+ const P = {
10
10
  growth: [
11
11
  "...##....##....##",
12
12
  "..###...###...###",
@@ -94,7 +94,7 @@ const R = {
94
94
  "...............",
95
95
  "..............."
96
96
  ]
97
- }, D = [
97
+ }, M = [
98
98
  "var(--color-ink-950)",
99
99
  "var(--color-ink-950)",
100
100
  "var(--color-ink-900)",
@@ -105,7 +105,7 @@ const R = {
105
105
  "var(--color-ink-800)",
106
106
  "var(--color-ink-700)",
107
107
  "var(--color-ink-700)"
108
- ], V = [
108
+ ], X = [
109
109
  "var(--color-warning-700)",
110
110
  "var(--color-warning-700)",
111
111
  "var(--color-warning-600)",
@@ -116,13 +116,20 @@ const R = {
116
116
  "var(--color-chart-2)",
117
117
  "var(--color-amber-soft)",
118
118
  "var(--color-amber-soft)"
119
- ], A = {
120
- growth: D,
121
- "document-agent": D,
122
- search: D,
123
- books: D,
124
- artifacts: V
125
- }, F = /* @__PURE__ */ new Set(), X = ["#c7cad0", "#d0d3d8", "#d8dade", "#dfe1e4", "#e6e7e9"], S = 0, Y = (
119
+ ], R = {
120
+ growth: M,
121
+ "document-agent": M,
122
+ search: M,
123
+ books: M,
124
+ artifacts: X
125
+ };
126
+ function F(o) {
127
+ return o.length === 0 ? [...M] : Array.from(
128
+ { length: 10 },
129
+ (e, t) => o[t % o.length]
130
+ );
131
+ }
132
+ const H = /* @__PURE__ */ new Set(), Y = ["#c7cad0", "#d0d3d8", "#d8dade", "#dfe1e4", "#e6e7e9"], w = 0, W = (
126
133
  /* glsl */
127
134
  `
128
135
  attribute vec2 uv;
@@ -135,7 +142,7 @@ const R = {
135
142
  gl_Position = vec4(position, 0.0, 1.0);
136
143
  }
137
144
  `
138
- ), W = (
145
+ ), $ = (
139
146
  /* glsl */
140
147
  `
141
148
  precision highp float;
@@ -197,7 +204,7 @@ const R = {
197
204
  }
198
205
 
199
206
  void main() {
200
- const float padding = ${S.toFixed(4)};
207
+ const float padding = ${w.toFixed(4)};
201
208
  vec2 iconUv = (vUv - padding) / (1.0 - padding * 2.0);
202
209
 
203
210
  if (iconUv.x < 0.0 || iconUv.x > 1.0 || iconUv.y < 0.0 || iconUv.y > 1.0) {
@@ -322,13 +329,25 @@ const R = {
322
329
  directCell * hoverMotion,
323
330
  (1.0 - smoothstep(0.15, 2.85, cellDistance)) * hoverMotion
324
331
  );
332
+ float hoverAura = (1.0 - smoothstep(0.0, 4.2, cellDistance)) * hoverMotion;
333
+ float hoverBreath = 0.5 + 0.5 * sin(uHoverTime * 4.6 - cellDistance * 0.7);
325
334
 
326
335
  float tileScale = 0.82;
327
336
  vec2 springShape = vec2(1.0);
328
337
  float angle = 0.0;
329
338
  vec2 tileOffset = vec2(0.0);
330
339
 
331
- tileScale += radialGrowMode * radialGrow * 0.15;
340
+ tileScale += radialGrowMode * (
341
+ radialGrow * 0.2 + hoverAura * hoverBreath * 0.055
342
+ );
343
+ springShape += radialGrowMode * vec2(
344
+ -hoverAura * 0.02,
345
+ hoverAura * 0.045
346
+ );
347
+ angle += radialGrowMode
348
+ * sin(uHoverTime * 3.8 - cellDistance)
349
+ * hoverAura
350
+ * 0.075;
332
351
 
333
352
  tileScale += mode0 * (directCell * hoverMotion * 0.075 + colorRipple * 0.045);
334
353
 
@@ -350,7 +369,7 @@ const R = {
350
369
  springShape += mode3 * vec2(-radialEcho * 0.055, radialEcho * 0.08);
351
370
  angle += mode3 * sin(blastDistance * 1.8 + uBlastTime * 3.0) * radialEcho * 0.12;
352
371
  tileScale += mode3 * (
353
- blastRing * 0.19 - blastCore * 0.13 + abs(blastShake) * 0.055
372
+ blastRing * 0.26 - blastCore * 0.18 + abs(blastShake) * 0.075
354
373
  );
355
374
  springShape += mode3 * vec2(-blastRing * 0.055, blastRing * 0.075);
356
375
  angle += mode3 * (
@@ -470,6 +489,11 @@ const R = {
470
489
  magneticColor,
471
490
  mode2 * clamp(max(magneticField * 0.72, directCell * hoverMotion * 0.72), 0.0, 0.82)
472
491
  );
492
+ color = mix(
493
+ color,
494
+ interactionColor,
495
+ mode3 * clamp(hoverAura * (0.28 + hoverBreath * 0.18), 0.0, 0.68)
496
+ );
473
497
  color = mix(
474
498
  color,
475
499
  echoColor,
@@ -499,99 +523,99 @@ const R = {
499
523
  ), y = typeof window < "u" ? window.matchMedia("(prefers-reduced-motion: reduce)") : {
500
524
  matches: !1
501
525
  };
502
- function f(r) {
503
- const e = Number.parseInt(r.slice(1), 16);
526
+ function p(o) {
527
+ const e = Number.parseInt(o.slice(1), 16);
504
528
  return [
505
529
  (e >> 16 & 255) / 255,
506
530
  (e >> 8 & 255) / 255,
507
531
  (e & 255) / 255
508
532
  ];
509
533
  }
510
- function E(r, e) {
511
- var n;
512
- const o = (n = r.match(/^var\((--[^)]+)\)$/)) == null ? void 0 : n[1];
513
- return o ? getComputedStyle(e).getPropertyValue(o).trim() : r;
534
+ function E(o, e) {
535
+ var s;
536
+ const t = (s = o.match(/^var\((--[^)]+)\)$/)) == null ? void 0 : s[1];
537
+ return t ? getComputedStyle(e).getPropertyValue(t).trim() : o;
514
538
  }
515
- function L(r) {
516
- const e = r.length, o = r[0].length, n = Array.from(
539
+ function L(o) {
540
+ const e = o.length, t = o[0].length, s = Array.from(
517
541
  { length: e },
518
- () => Array(o).fill(!1)
519
- ), c = [], l = (a, t) => {
520
- a < 0 || a >= e || t < 0 || t >= o || n[a][t] || r[a][t] === "#" || (n[a][t] = !0, c.push([a, t]));
542
+ () => Array(t).fill(!1)
543
+ ), c = [], n = (r, l) => {
544
+ r < 0 || r >= e || l < 0 || l >= t || s[r][l] || o[r][l] === "#" || (s[r][l] = !0, c.push([r, l]));
521
545
  };
522
- for (let a = 0; a < o; a += 1)
523
- l(0, a), l(e - 1, a);
524
- for (let a = 0; a < e; a += 1)
525
- l(a, 0), l(a, o - 1);
526
- for (let a = 0; a < c.length; a += 1) {
527
- const [t, s] = c[a];
528
- l(t - 1, s), l(t + 1, s), l(t, s - 1), l(t, s + 1);
546
+ for (let r = 0; r < t; r += 1)
547
+ n(0, r), n(e - 1, r);
548
+ for (let r = 0; r < e; r += 1)
549
+ n(r, 0), n(r, t - 1);
550
+ for (let r = 0; r < c.length; r += 1) {
551
+ const [l, h] = c[r];
552
+ n(l - 1, h), n(l + 1, h), n(l, h - 1), n(l, h + 1);
529
553
  }
530
- return r.map(
531
- (a, t) => [...a].map((s, u) => s === "#" ? 2 : n[t][u] ? 0 : 1)
554
+ return o.map(
555
+ (r, l) => [...r].map((h, a) => h === "#" ? 2 : s[l][a] ? 0 : 1)
532
556
  );
533
557
  }
534
- function $(r, e, o, n, c) {
535
- const l = e.length, a = e[0].length, t = new Uint8Array(a * l * 4);
536
- for (let s = 0; s < l; s += 1) {
537
- const u = l - 1 - s;
538
- for (let h = 0; h < a; h += 1) {
539
- const m = (s * a + h) * 4, d = n[u][h], v = d === 2 || c && d === 0;
540
- t[m] = v ? 255 : 0, t[m + 1] = v ? (h * 3 + s * 7 + o) % 10 : 0, t[m + 2] = d === 2 ? 255 : d === 1 ? 128 : 0, t[m + 3] = 255;
558
+ function J(o, e, t, s, c) {
559
+ const n = e.length, r = e[0].length, l = new Uint8Array(r * n * 4);
560
+ for (let h = 0; h < n; h += 1) {
561
+ const a = n - 1 - h;
562
+ for (let u = 0; u < r; u += 1) {
563
+ const d = (h * r + u) * 4, m = s[a][u], v = m === 2 || c && m === 0;
564
+ l[d] = v ? 255 : 0, l[d + 1] = v ? (u * 3 + h * 7 + t) % 10 : 0, l[d + 2] = m === 2 ? 255 : m === 1 ? 128 : 0, l[d + 3] = 255;
541
565
  }
542
566
  }
543
- return new N(r, {
544
- image: t,
545
- width: a,
546
- height: l,
547
- format: r.RGBA,
548
- internalFormat: r.RGBA,
567
+ return new q(o, {
568
+ image: l,
569
+ width: r,
570
+ height: n,
571
+ format: o.RGBA,
572
+ internalFormat: o.RGBA,
549
573
  generateMipmaps: !1,
550
- minFilter: r.NEAREST,
551
- magFilter: r.NEAREST,
574
+ minFilter: o.NEAREST,
575
+ magFilter: o.NEAREST,
552
576
  flipY: !1,
553
577
  unpackAlignment: 1
554
578
  });
555
579
  }
556
- function J() {
557
- const r = document.createElement("canvas");
558
- return !!(r.getContext("webgl2") || r.getContext("webgl"));
580
+ function j() {
581
+ const o = document.createElement("canvas");
582
+ return !!(o.getContext("webgl2") || o.getContext("webgl"));
559
583
  }
560
- function j(r) {
561
- const e = r[0].length, o = r.length;
562
- let n = [0.5, 0.5], c = 1 / 0;
563
- return r.forEach((l, a) => {
564
- [...l].forEach((t, s) => {
565
- if (t !== "#") return;
566
- const u = (s + 0.5) / e, h = 1 - (a + 0.5) / o, m = (u - 0.5) ** 2 + (h - 0.5) ** 2;
567
- m < c && (c = m, n = [u, h]);
584
+ function Q(o) {
585
+ const e = o[0].length, t = o.length;
586
+ let s = [0.5, 0.5], c = 1 / 0;
587
+ return o.forEach((n, r) => {
588
+ [...n].forEach((l, h) => {
589
+ if (l !== "#") return;
590
+ const a = (h + 0.5) / e, u = 1 - (r + 0.5) / t, d = (a - 0.5) ** 2 + (u - 0.5) ** 2;
591
+ d < c && (c = d, s = [a, u]);
568
592
  });
569
- }), n;
593
+ }), s;
570
594
  }
571
- function Q(r, e, o, n, c) {
572
- r.classList.add("is-fallback");
573
- const l = document.createElement("canvas"), a = 600, t = 63, s = (a - t * 2) / e[0].length, u = l.getContext("2d");
574
- if (!u) return;
575
- l.width = a, l.height = a;
576
- const h = L(e), m = o.map(
577
- (d) => E(d, r)
595
+ function Z(o, e, t, s, c) {
596
+ o.classList.add("is-fallback");
597
+ const n = document.createElement("canvas"), r = 600, l = 63, h = (r - l * 2) / e[0].length, a = n.getContext("2d");
598
+ if (!a) return;
599
+ n.width = r, n.height = r;
600
+ const u = L(e), d = t.map(
601
+ (m) => E(m, o)
578
602
  );
579
- e.forEach((d, v) => {
580
- [...d].forEach((C, b) => {
581
- const p = h[v][b];
582
- if (p === 1 || !c && p !== 2) return;
583
- const x = (b * 3 + (e.length - 1 - v) * 7 + n) % o.length, k = p === 2 ? m : X, T = s * 0.08, w = t + b * s + T, B = t + v * s + T, g = s - T * 2;
584
- u.save(), u.beginPath(), u.rect(w, B, g, g), u.clip(), u.globalAlpha = p === 2 ? 1 : 0.1, u.strokeStyle = k[x];
585
- const H = r.classList.contains("pixel-icon--hero") ? 0.095 : 0.13;
586
- u.lineWidth = Math.max(1.5, g * H);
587
- for (let M = -g; M < g * 2; M += g * 0.16)
588
- u.beginPath(), u.moveTo(w + M, B), u.lineTo(w + M - g, B + g), u.stroke();
589
- u.restore();
603
+ e.forEach((m, v) => {
604
+ [...m].forEach((b, f) => {
605
+ const g = u[v][f];
606
+ if (g === 1 || !c && g !== 2) return;
607
+ const x = (f * 3 + (e.length - 1 - v) * 7 + s) % t.length, k = g === 2 ? d : Y, T = h * 0.08, S = l + f * h + T, B = l + v * h + T, C = h - T * 2;
608
+ a.save(), a.beginPath(), a.rect(S, B, C, C), a.clip(), a.globalAlpha = g === 2 ? 1 : 0.1, a.strokeStyle = k[x];
609
+ const G = o.classList.contains("pixel-icon--hero") ? 0.095 : 0.13;
610
+ a.lineWidth = Math.max(1.5, C * G);
611
+ for (let A = -C; A < C * 2; A += C * 0.16)
612
+ a.beginPath(), a.moveTo(S + A, B), a.lineTo(S + A - C, B + C), a.stroke();
613
+ a.restore();
590
614
  });
591
- }), r.append(l);
615
+ }), o.append(n);
592
616
  }
593
- class Z {
594
- constructor(e, o, n, c) {
617
+ class ee {
618
+ constructor(e, t, s, c, n, r = "tiles") {
595
619
  i(this, "root");
596
620
  i(this, "surface");
597
621
  i(this, "maskName");
@@ -600,6 +624,7 @@ class Z {
600
624
  i(this, "cellKinds");
601
625
  i(this, "seed");
602
626
  i(this, "palette");
627
+ i(this, "interactionArea");
603
628
  i(this, "focusPoint");
604
629
  i(this, "hoverTarget", 0);
605
630
  i(this, "hover", 0);
@@ -631,7 +656,9 @@ class Z {
631
656
  i(this, "onFocus");
632
657
  i(this, "onBlur");
633
658
  i(this, "onClick");
634
- this.root = e, this.surface = e.closest(".pixel-surface") || e, this.maskName = e.dataset.mask && e.dataset.mask in R ? e.dataset.mask : "growth", this.rows = R[this.maskName], this.boxed = F.has(this.maskName), this.cellKinds = L(this.rows), this.seed = o * 13 + 7, this.palette = A[this.maskName] || A.growth, this.focusPoint = j(this.rows), this.intro = y.matches ? 1 : 0, this.startedAt = performance.now(), this.lastFrameTime = this.startedAt, this.motionMode = e.classList.contains("pixel-icon--hero") ? 3 : n, this.canvas = document.createElement("canvas"), this.canvas.setAttribute("aria-hidden", "true"), e.append(this.canvas), this.renderer = new z({
659
+ this.root = e, this.surface = e.closest(".pixel-surface") || e, this.maskName = e.dataset.mask && e.dataset.mask in P ? e.dataset.mask : "growth", this.rows = P[this.maskName], this.boxed = H.has(this.maskName), this.cellKinds = L(this.rows), this.seed = t * 13 + 7, this.palette = F(
660
+ n != null && n.length ? n : R[this.maskName] || R.growth
661
+ ), this.interactionArea = r, this.focusPoint = Q(this.rows), this.intro = y.matches ? 1 : 0, this.startedAt = performance.now(), this.lastFrameTime = this.startedAt, this.motionMode = e.classList.contains("pixel-icon--hero") ? 3 : s, this.canvas = document.createElement("canvas"), this.canvas.setAttribute("aria-hidden", "true"), e.append(this.canvas), this.renderer = new K({
635
662
  canvas: this.canvas,
636
663
  dpr: Math.min(window.devicePixelRatio || 1, 2),
637
664
  alpha: !0,
@@ -640,18 +667,18 @@ class Z {
640
667
  premultipliedAlpha: !1,
641
668
  powerPreference: "high-performance"
642
669
  }), this.gl = this.renderer.gl, this.gl.clearColor(0, 0, 0, 0);
643
- const l = $(
670
+ const l = J(
644
671
  this.gl,
645
672
  this.rows,
646
673
  this.seed,
647
674
  this.cellKinds,
648
675
  this.boxed
649
- ), a = new K(this.gl), t = this.palette.map(
650
- (u) => E(u, e)
651
- ), s = c ? E(c, e) : null;
652
- this.program = new U(this.gl, {
653
- vertex: Y,
654
- fragment: W,
676
+ ), h = new U(this.gl), a = this.palette.map(
677
+ (d) => E(d, e)
678
+ ), u = c ? E(c, e) : null;
679
+ this.program = new _(this.gl, {
680
+ vertex: W,
681
+ fragment: $,
655
682
  transparent: !0,
656
683
  depthTest: !1,
657
684
  depthWrite: !1,
@@ -674,44 +701,44 @@ class Z {
674
701
  uGapInner: { value: 0.13 },
675
702
  uGapOuter: { value: 0.19 },
676
703
  uMode: { value: this.motionMode },
677
- uColor0: { value: f(t[0]) },
678
- uColor1: { value: f(t[1]) },
679
- uColor2: { value: f(t[2]) },
680
- uColor3: { value: f(t[3]) },
681
- uColor4: { value: f(t[4]) },
682
- uColor5: { value: f(t[5]) },
683
- uColor6: { value: f(t[6]) },
684
- uColor7: { value: f(t[7]) },
685
- uColor8: { value: f(t[8]) },
686
- uColor9: { value: f(t[9]) },
704
+ uColor0: { value: p(a[0]) },
705
+ uColor1: { value: p(a[1]) },
706
+ uColor2: { value: p(a[2]) },
707
+ uColor3: { value: p(a[3]) },
708
+ uColor4: { value: p(a[4]) },
709
+ uColor5: { value: p(a[5]) },
710
+ uColor6: { value: p(a[6]) },
711
+ uColor7: { value: p(a[7]) },
712
+ uColor8: { value: p(a[8]) },
713
+ uColor9: { value: p(a[9]) },
687
714
  uInteractionColor: {
688
- value: s ? f(s) : [0, 0, 0]
715
+ value: u ? p(u) : [0, 0, 0]
689
716
  },
690
- uUseInteractionColor: { value: s ? 1 : 0 }
717
+ uUseInteractionColor: { value: u ? 1 : 0 }
691
718
  }
692
- }), this.mesh = new _(this.gl, { geometry: a, program: this.program }), this.bindEvents(), this.observe(), this.resize();
719
+ }), this.mesh = new N(this.gl, { geometry: h, program: this.program }), this.bindEvents(), this.observe(), this.resize();
693
720
  }
694
- getPointerHit(e, o) {
695
- const n = this.root.getBoundingClientRect(), c = 1 - S * 2, l = (e - n.left) / n.width, a = (o - n.top) / n.height, t = (l - S) / c, s = (a - S) / c, u = t >= 0 && t < 1 && s >= 0 && s < 1;
696
- let h = !1, m = null;
697
- if (u) {
698
- const d = this.rows[0].length, v = this.rows.length, C = t * d, b = s * v, p = Math.floor(C), x = Math.floor(b), k = C - p, T = b - x;
699
- h = Math.abs(k - 0.5) <= 0.43 && Math.abs(T - 0.5) <= 0.43 && this.cellKinds[x][p] === 2, h && (m = `${x}:${p}`);
721
+ getPointerHit(e, t) {
722
+ const s = this.root.getBoundingClientRect(), c = 1 - w * 2, n = (e - s.left) / s.width, r = (t - s.top) / s.height, l = (n - w) / c, h = (r - w) / c, a = l >= 0 && l < 1 && h >= 0 && h < 1;
723
+ let u = !1, d = null;
724
+ if (a) {
725
+ const m = this.rows[0].length, v = this.rows.length, b = l * m, f = h * v, g = Math.floor(b), x = Math.floor(f), k = b - g, T = f - x, S = Math.abs(k - 0.5) <= 0.43 && Math.abs(T - 0.5) <= 0.43;
726
+ u = this.interactionArea === "surface" || S && this.cellKinds[x][g] === 2, u && (d = `${x}:${g}`);
700
727
  }
701
- return { iconX: t, iconYTop: s, isTileHit: h, tileKey: m };
728
+ return { iconX: l, iconYTop: h, isTileHit: u, tileKey: d };
702
729
  }
703
730
  bindEvents() {
704
731
  this.onPointerLeave = () => {
705
732
  this.hoverTarget = 0, this.pointerTarget[0] = 0.5, this.pointerTarget[1] = 0.5, this.hoverAge = 0, this.hoveredTileKey = null, this.pointerTileKey = null, this.pointerDownSource = null, this.hadPointerDown = !1, this.surface.classList.remove("is-over-tile");
706
733
  }, this.onPointerMove = (e) => {
707
- const { iconX: o, iconYTop: n, isTileHit: c, tileKey: l } = this.getPointerHit(
734
+ const { iconX: t, iconYTop: s, isTileHit: c, tileKey: n } = this.getPointerHit(
708
735
  e.clientX,
709
736
  e.clientY
710
737
  );
711
- l !== this.hoveredTileKey && (this.hoverAge = 0), this.hoveredTileKey = l, this.pointerTileKey = l, this.hoverTarget = c ? 1 : 0, this.surface.classList.toggle("is-over-tile", c), c ? (this.pointerTarget[0] = o, this.pointerTarget[1] = 1 - n) : (this.pointerTarget[0] = 0.5, this.pointerTarget[1] = 0.5);
738
+ n !== this.hoveredTileKey && (this.hoverAge = 0), this.hoveredTileKey = n, this.pointerTileKey = n, this.hoverTarget = c ? 1 : 0, this.surface.classList.toggle("is-over-tile", c), c ? (this.pointerTarget[0] = t, this.pointerTarget[1] = 1 - s) : (this.pointerTarget[0] = 0.5, this.pointerTarget[1] = 0.5);
712
739
  }, this.onPointerDown = (e) => {
713
- const o = this.getPointerHit(e.clientX, e.clientY);
714
- this.hadPointerDown = !0, this.pointerDownSource = o.isTileHit ? [o.iconX, 1 - o.iconYTop] : null;
740
+ const t = this.getPointerHit(e.clientX, e.clientY);
741
+ this.hadPointerDown = !0, this.pointerDownSource = t.isTileHit ? [t.iconX, 1 - t.iconYTop] : null;
715
742
  }, this.onFocus = () => {
716
743
  this.hadPointerDown || (this.hoverTarget = 1, this.hoverAge = 0, this.hoveredTileKey = "focus", this.pointerTarget[0] = this.focusPoint[0], this.pointerTarget[1] = this.focusPoint[1]);
717
744
  }, this.onBlur = () => {
@@ -730,84 +757,103 @@ class Z {
730
757
  ), this.intersectionObserver.observe(this.root);
731
758
  }
732
759
  resize() {
733
- const e = this.root.getBoundingClientRect(), o = Math.max(1, Math.round(Math.min(e.width, e.height))), n = Math.max(this.rows[0].length, this.rows.length), c = o * (1 - S * 2) / n, l = Math.min(1, Math.max(0, (c - 12) / 4.5));
734
- this.renderer.setSize(o, o), this.program.uniforms.uStripeFrequency.value = 2 + (4.455 - 2) * l, this.program.uniforms.uGapInner.value = 0.13, this.program.uniforms.uGapOuter.value = 0.2 + (0.19 - 0.2) * l;
760
+ const e = this.root.getBoundingClientRect(), t = Math.max(1, Math.round(Math.min(e.width, e.height))), s = Math.max(this.rows[0].length, this.rows.length), c = t * (1 - w * 2) / s, n = Math.min(1, Math.max(0, (c - 12) / 4.5));
761
+ this.renderer.setSize(t, t), this.program.uniforms.uStripeFrequency.value = 2 + (4.455 - 2) * n, this.program.uniforms.uGapInner.value = 0.13, this.program.uniforms.uGapOuter.value = 0.2 + (0.19 - 0.2) * n;
735
762
  }
736
763
  update(e) {
737
- const o = Math.min(
764
+ const t = Math.min(
738
765
  0.05,
739
766
  Math.max(0, (e - this.lastFrameTime) * 1e-3)
740
767
  );
741
768
  if (this.lastFrameTime = e, !this.visible) return;
742
- const n = (e - this.startedAt) * 1e-3, c = y.matches ? 0 : 1;
743
- this.hoverAge = this.hoverTarget > 0 ? this.hoverAge + o : 0, this.blastActive > 0 && (this.blastAge += o, this.blastAge >= 1.35 && (this.blastActive = 0)), this.hover += (this.hoverTarget - this.hover) * (this.hoverTarget > this.hover ? 0.1 : 0.07), this.pointer[0] += (this.pointerTarget[0] - this.pointer[0]) * 0.1, this.pointer[1] += (this.pointerTarget[1] - this.pointer[1]) * 0.1, this.intro = c ? Math.min(1, n / 1.7) : 1, this.program.uniforms.uTime.value = n, this.program.uniforms.uHoverTime.value = this.hoverAge, this.program.uniforms.uHover.value = this.hover, this.program.uniforms.uBlastTime.value = this.blastAge, this.program.uniforms.uBlast.value = this.blastActive, this.program.uniforms.uIntro.value = this.intro, this.program.uniforms.uMotion.value = c, this.renderer.render({ scene: this.mesh });
769
+ const s = (e - this.startedAt) * 1e-3, c = y.matches ? 0 : 1;
770
+ this.hoverAge = this.hoverTarget > 0 ? this.hoverAge + t : 0, this.blastActive > 0 && (this.blastAge += t, this.blastAge >= 1.35 && (this.blastActive = 0)), this.hover += (this.hoverTarget - this.hover) * (this.hoverTarget > this.hover ? 0.1 : 0.07), this.pointer[0] += (this.pointerTarget[0] - this.pointer[0]) * 0.1, this.pointer[1] += (this.pointerTarget[1] - this.pointer[1]) * 0.1, this.intro = c ? Math.min(1, s / 1.7) : 1, this.program.uniforms.uTime.value = s, this.program.uniforms.uHoverTime.value = this.hoverAge, this.program.uniforms.uHover.value = this.hover, this.program.uniforms.uBlastTime.value = this.blastAge, this.program.uniforms.uBlast.value = this.blastActive, this.program.uniforms.uIntro.value = this.intro, this.program.uniforms.uMotion.value = c, this.renderer.render({ scene: this.mesh });
744
771
  }
745
772
  destroy() {
746
- var o, n;
747
- (o = this.resizeObserver) == null || o.disconnect(), (n = this.intersectionObserver) == null || n.disconnect(), this.surface.removeEventListener("pointerleave", this.onPointerLeave), this.surface.removeEventListener("pointermove", this.onPointerMove), this.surface.removeEventListener("pointerdown", this.onPointerDown), this.surface.removeEventListener("focus", this.onFocus), this.surface.removeEventListener("blur", this.onBlur), this.surface.removeEventListener("click", this.onClick);
773
+ var t, s;
774
+ (t = this.resizeObserver) == null || t.disconnect(), (s = this.intersectionObserver) == null || s.disconnect(), this.surface.removeEventListener("pointerleave", this.onPointerLeave), this.surface.removeEventListener("pointermove", this.onPointerMove), this.surface.removeEventListener("pointerdown", this.onPointerDown), this.surface.removeEventListener("focus", this.onFocus), this.surface.removeEventListener("blur", this.onBlur), this.surface.removeEventListener("click", this.onClick);
748
775
  const e = this.gl.getExtension("WEBGL_lose_context");
749
776
  e == null || e.loseContext();
750
777
  }
751
778
  }
752
- const ee = P.forwardRef(
779
+ const te = D.forwardRef(
753
780
  ({
754
- mask: r = "growth",
781
+ mask: o = "growth",
755
782
  motion: e = "sequence",
756
- motionMode: o = 3,
757
- interactionColor: n,
758
- hero: c = !1,
783
+ motionMode: t = 3,
784
+ interactionColor: s,
785
+ palette: c,
786
+ interactionArea: n = "tiles",
787
+ hero: r = !1,
759
788
  className: l,
760
- ...a
761
- }, t) => {
762
- const s = P.useRef(null), u = P.useCallback(
763
- (h) => {
764
- s.current = h, typeof t == "function" ? t(h) : t && (t.current = h);
789
+ ...h
790
+ }, a) => {
791
+ const u = D.useRef(null), d = D.useCallback(
792
+ (m) => {
793
+ u.current = m, typeof a == "function" ? a(m) : a && (a.current = m);
765
794
  },
766
- [t]
795
+ [a]
767
796
  );
768
- return P.useEffect(() => {
769
- const h = s.current;
770
- if (!h) return;
771
- let m = null, d = 0;
772
- if (J()) {
773
- m = new Z(h, 0, o, n);
774
- const v = (C) => {
775
- m == null || m.update(C), d = window.requestAnimationFrame(v);
797
+ return D.useEffect(() => {
798
+ const m = u.current;
799
+ if (!m) return;
800
+ let v = null, b = 0;
801
+ if (j()) {
802
+ v = new ee(
803
+ m,
804
+ 0,
805
+ t,
806
+ s,
807
+ c,
808
+ n
809
+ );
810
+ const f = (g) => {
811
+ v == null || v.update(g), b = window.requestAnimationFrame(f);
776
812
  };
777
- d = window.requestAnimationFrame(v);
813
+ b = window.requestAnimationFrame(f);
778
814
  } else {
779
- const v = r in R ? r : "growth";
780
- Q(
781
- h,
782
- R[v],
783
- A[v] || A.growth,
815
+ const f = o in P ? o : "growth";
816
+ Z(
817
+ m,
818
+ P[f],
819
+ F(
820
+ c != null && c.length ? c : R[f] || R.growth
821
+ ),
784
822
  7,
785
- F.has(v)
823
+ H.has(f)
786
824
  );
787
825
  }
788
826
  return () => {
789
- d && window.cancelAnimationFrame(d), m == null || m.destroy(), h.replaceChildren(), h.classList.remove("is-fallback");
827
+ b && window.cancelAnimationFrame(b), v == null || v.destroy(), m.replaceChildren(), m.classList.remove("is-fallback");
790
828
  };
791
- }, [r, e, o, n, c]), /* @__PURE__ */ O(
829
+ }, [
830
+ o,
831
+ e,
832
+ t,
833
+ s,
834
+ c,
835
+ n,
836
+ r
837
+ ]), /* @__PURE__ */ z(
792
838
  "span",
793
839
  {
794
- ref: u,
840
+ ref: d,
795
841
  "aria-hidden": !0,
796
842
  "data-pixel-icon": !0,
797
- "data-mask": r,
843
+ "data-mask": o,
798
844
  "data-motion": e,
799
- className: q(
845
+ className: V(
800
846
  "pixel-surface pixel-icon relative block outline-none [&_canvas]:block [&_canvas]:size-full",
801
- c && "pixel-icon--hero",
847
+ n === "surface" && "cursor-crosshair",
848
+ r && "pixel-icon--hero",
802
849
  l
803
850
  ),
804
- tabIndex: 0,
805
- ...a
851
+ ...h
806
852
  }
807
853
  );
808
854
  }
809
855
  );
810
- ee.displayName = "PixelIcon";
856
+ te.displayName = "PixelIcon";
811
857
  export {
812
- ee as PixelIcon
858
+ te as PixelIcon
813
859
  };
@@ -17,4 +17,4 @@ export interface PopoverContentProps extends React.HTMLAttributes<HTMLDivElement
17
17
  align?: "start" | "center" | "end";
18
18
  sideOffset?: number;
19
19
  }
20
- export declare function PopoverContent({ className, align, sideOffset, children, ...props }: PopoverContentProps): React.ReactPortal;
20
+ export declare function PopoverContent({ className, align, sideOffset, children, "aria-label": ariaLabel, ...props }: PopoverContentProps): React.ReactPortal;