@tarsis/toolkit 0.4.8 → 0.5.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.
Files changed (97) hide show
  1. package/dist/fonts/GT-Flexa-VF-Trial.woff2 +0 -0
  2. package/dist/fonts/GT-Maru-Light-Oblique-Trial.woff2 +0 -0
  3. package/dist/fonts/GT-Maru-Light-Trial.woff2 +0 -0
  4. package/dist/fonts/GT-Maru-Medium-Oblique-Trial.woff2 +0 -0
  5. package/dist/fonts/GT-Maru-Medium-Trial.woff2 +0 -0
  6. package/dist/fonts/GT-Maru-Mono-Black-Oblique-Trial.woff2 +0 -0
  7. package/dist/fonts/GT-Maru-Mono-Black-Trial.woff2 +0 -0
  8. package/dist/fonts/GT-Maru-Mono-Bold-Oblique-Trial.woff2 +0 -0
  9. package/dist/fonts/GT-Maru-Mono-Bold-Trial.woff2 +0 -0
  10. package/dist/fonts/GT-Maru-Mono-Light-Oblique-Trial.woff2 +0 -0
  11. package/dist/fonts/GT-Maru-Mono-Light-Trial.woff2 +0 -0
  12. package/dist/fonts/GT-Maru-Mono-Medium-Oblique-Trial.woff2 +0 -0
  13. package/dist/fonts/GT-Maru-Mono-Medium-Trial.woff2 +0 -0
  14. package/dist/fonts/gt/maru/GT-Maru-Light-Oblique-Trial.woff2 +0 -0
  15. package/dist/fonts/gt/maru/GT-Maru-Light-Trial.woff2 +0 -0
  16. package/dist/fonts/gt/maru/GT-Maru-Medium-Oblique-Trial.woff2 +0 -0
  17. package/dist/fonts/gt/maru/GT-Maru-Medium-Trial.woff2 +0 -0
  18. package/dist/fonts/gt/maru/GT-Maru-Mono-Black-Oblique-Trial.woff2 +0 -0
  19. package/dist/fonts/gt/maru/GT-Maru-Mono-Black-Trial.woff2 +0 -0
  20. package/dist/fonts/gt/maru/GT-Maru-Mono-Bold-Oblique-Trial.woff2 +0 -0
  21. package/dist/fonts/gt/maru/GT-Maru-Mono-Bold-Trial.woff2 +0 -0
  22. package/dist/fonts/gt/maru/GT-Maru-Mono-Light-Oblique-Trial.woff2 +0 -0
  23. package/dist/fonts/gt/maru/GT-Maru-Mono-Light-Trial.woff2 +0 -0
  24. package/dist/fonts/gt/maru/GT-Maru-Mono-Medium-Oblique-Trial.woff2 +0 -0
  25. package/dist/fonts/gt/maru/GT-Maru-Mono-Medium-Trial.woff2 +0 -0
  26. package/dist/fonts/gt/maru/gt-maru-black-oblique.woff2 +0 -0
  27. package/dist/fonts/gt/maru/gt-maru-black.woff2 +0 -0
  28. package/dist/fonts/gt/maru/gt-maru-bold-oblique.woff2 +0 -0
  29. package/dist/fonts/gt/maru/gt-maru-bold.woff2 +0 -0
  30. package/dist/fonts/gt/maru/gt-maru-mega-l.woff2 +0 -0
  31. package/dist/fonts/gt/maru/gt-maru-mega-m.woff2 +0 -0
  32. package/dist/fonts/gt/maru/gt-maru-mega-s.woff2 +0 -0
  33. package/dist/fonts/gt/maru/gt-maru-mono-regular-oblique.woff2 +0 -0
  34. package/dist/fonts/gt/maru/gt-maru-mono-regular.woff2 +0 -0
  35. package/dist/fonts/gt/maru/gt-maru-regular-oblique.woff2 +0 -0
  36. package/dist/fonts/gt/maru/gt-maru-regular.woff2 +0 -0
  37. package/dist/fonts/gt-flexa/GT-Flexa-VF-Trial.woff2 +0 -0
  38. package/dist/fonts/gt-maru-black-oblique.woff2 +0 -0
  39. package/dist/fonts/gt-maru-black.woff2 +0 -0
  40. package/dist/fonts/gt-maru-bold-oblique.woff2 +0 -0
  41. package/dist/fonts/gt-maru-bold.woff2 +0 -0
  42. package/dist/fonts/gt-maru-mega-l.woff2 +0 -0
  43. package/dist/fonts/gt-maru-mega-m.woff2 +0 -0
  44. package/dist/fonts/gt-maru-mega-s.woff2 +0 -0
  45. package/dist/fonts/gt-maru-mono-regular-oblique.woff2 +0 -0
  46. package/dist/fonts/gt-maru-mono-regular.woff2 +0 -0
  47. package/dist/fonts/gt-maru-regular-oblique.woff2 +0 -0
  48. package/dist/fonts/gt-maru-regular.woff2 +0 -0
  49. package/dist/fonts/maru/GT-Maru-Light-Oblique-Trial.woff2 +0 -0
  50. package/dist/fonts/maru/GT-Maru-Light-Trial.woff2 +0 -0
  51. package/dist/fonts/maru/GT-Maru-Medium-Oblique-Trial.woff2 +0 -0
  52. package/dist/fonts/maru/GT-Maru-Medium-Trial.woff2 +0 -0
  53. package/dist/fonts/maru/GT-Maru-Mono-Black-Oblique-Trial.woff2 +0 -0
  54. package/dist/fonts/maru/GT-Maru-Mono-Black-Trial.woff2 +0 -0
  55. package/dist/fonts/maru/GT-Maru-Mono-Bold-Oblique-Trial.woff2 +0 -0
  56. package/dist/fonts/maru/GT-Maru-Mono-Bold-Trial.woff2 +0 -0
  57. package/dist/fonts/maru/GT-Maru-Mono-Light-Oblique-Trial.woff2 +0 -0
  58. package/dist/fonts/maru/GT-Maru-Mono-Light-Trial.woff2 +0 -0
  59. package/dist/fonts/maru/GT-Maru-Mono-Medium-Oblique-Trial.woff2 +0 -0
  60. package/dist/fonts/maru/GT-Maru-Mono-Medium-Trial.woff2 +0 -0
  61. package/dist/fonts/maru/gt-maru-black-oblique.woff2 +0 -0
  62. package/dist/fonts/maru/gt-maru-black.woff2 +0 -0
  63. package/dist/fonts/maru/gt-maru-bold-oblique.woff2 +0 -0
  64. package/dist/fonts/maru/gt-maru-bold.woff2 +0 -0
  65. package/dist/fonts/maru/gt-maru-mega-l.woff2 +0 -0
  66. package/dist/fonts/maru/gt-maru-mega-m.woff2 +0 -0
  67. package/dist/fonts/maru/gt-maru-mega-s.woff2 +0 -0
  68. package/dist/fonts/maru/gt-maru-mono-regular-oblique.woff2 +0 -0
  69. package/dist/fonts/maru/gt-maru-mono-regular.woff2 +0 -0
  70. package/dist/fonts/maru/gt-maru-regular-oblique.woff2 +0 -0
  71. package/dist/fonts/maru/gt-maru-regular.woff2 +0 -0
  72. package/dist/gl-BlKJDzVL.cjs +3262 -0
  73. package/dist/gl-DA94DTyS.js +3258 -0
  74. package/dist/hooks.cjs +24 -0
  75. package/dist/hooks.d.ts +190 -0
  76. package/dist/hooks.js +1 -0
  77. package/dist/index-B9O5nl2I.js +113847 -0
  78. package/dist/index-B_kRoqUz.cjs +3912 -0
  79. package/dist/index-BlpASwt4.js +3910 -0
  80. package/dist/index-DrShaNFt.cjs +114199 -0
  81. package/dist/index.cjs +343 -41240
  82. package/dist/index.d.ts +470 -354
  83. package/dist/index.js +4 -40894
  84. package/dist/server.cjs +0 -3
  85. package/dist/server.d.ts +0 -2
  86. package/dist/server.js +1 -3
  87. package/dist/styles.css +961 -647
  88. package/dist/svg-6fNe-PW5.cjs +68 -0
  89. package/dist/svg-C0Ykxk94.js +60 -0
  90. package/dist/useWindowReady-CESjx5iD.cjs +9275 -0
  91. package/dist/useWindowReady-CIGrizO6.js +9185 -0
  92. package/dist/utils.cjs +39 -0
  93. package/dist/utils.d.ts +90 -0
  94. package/dist/utils.js +2 -0
  95. package/package.json +71 -70
  96. package/dist/gl-BytuN41l.cjs +0 -380
  97. package/dist/gl-D_Ly48gx.js +0 -357
@@ -0,0 +1,68 @@
1
+ 'use strict';
2
+
3
+ const jsxRuntime = require('react/jsx-runtime');
4
+ const React = require('react');
5
+
6
+ const chain = (...elements) => {
7
+ return elements.map((element, index) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
8
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: element }),
9
+ index !== elements.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("span", { children: " • " })
10
+ ] }, index));
11
+ };
12
+
13
+ function distance(x1, x2, y1, y2) {
14
+ const a = x1 - x2;
15
+ const b = y1 - y2;
16
+ return Math.hypot(a, b);
17
+ }
18
+ function lineEq(y2, y1, x2, x1, currentVal) {
19
+ const m = (y2 - y1) / (x2 - x1);
20
+ const b = y1 - m * x1;
21
+ return m * currentVal + b;
22
+ }
23
+ function lerp(a, b, n) {
24
+ return (1 - n) * a + n * b;
25
+ }
26
+
27
+ function delay(ms) {
28
+ return new Promise((resolve) => {
29
+ setTimeout(() => {
30
+ resolve(void 0);
31
+ }, ms);
32
+ });
33
+ }
34
+ const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
35
+
36
+ function getPath(x, smoothing) {
37
+ const points = [
38
+ [2, 2],
39
+ [12 - x, 12 + x],
40
+ [22, 22]
41
+ ];
42
+ const calculateControlPoint = (current, previous, next, reverse) => {
43
+ const p = previous || current;
44
+ const n = next || current;
45
+ const o = {
46
+ length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)),
47
+ angle: Math.atan2(n[1] - p[1], n[0] - p[0])
48
+ };
49
+ const angle = o.angle + (0);
50
+ const length = o.length * smoothing;
51
+ return [
52
+ current[0] + Math.cos(angle) * length,
53
+ current[1] + Math.sin(angle) * length
54
+ ];
55
+ };
56
+ return points.reduce(
57
+ (acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${calculateControlPoint(a[i - 1], a[i - 2], point)}`,
58
+ ""
59
+ );
60
+ }
61
+
62
+ exports.chain = chain;
63
+ exports.delay = delay;
64
+ exports.distance = distance;
65
+ exports.getPath = getPath;
66
+ exports.lerp = lerp;
67
+ exports.lineEq = lineEq;
68
+ exports.wait = wait;
@@ -0,0 +1,60 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Fragment } from 'react';
3
+
4
+ const chain = (...elements) => {
5
+ return elements.map((element, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
6
+ /* @__PURE__ */ jsx("span", { children: element }),
7
+ index !== elements.length - 1 && /* @__PURE__ */ jsx("span", { children: " • " })
8
+ ] }, index));
9
+ };
10
+
11
+ function distance(x1, x2, y1, y2) {
12
+ const a = x1 - x2;
13
+ const b = y1 - y2;
14
+ return Math.hypot(a, b);
15
+ }
16
+ function lineEq(y2, y1, x2, x1, currentVal) {
17
+ const m = (y2 - y1) / (x2 - x1);
18
+ const b = y1 - m * x1;
19
+ return m * currentVal + b;
20
+ }
21
+ function lerp(a, b, n) {
22
+ return (1 - n) * a + n * b;
23
+ }
24
+
25
+ function delay(ms) {
26
+ return new Promise((resolve) => {
27
+ setTimeout(() => {
28
+ resolve(void 0);
29
+ }, ms);
30
+ });
31
+ }
32
+ const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
33
+
34
+ function getPath(x, smoothing) {
35
+ const points = [
36
+ [2, 2],
37
+ [12 - x, 12 + x],
38
+ [22, 22]
39
+ ];
40
+ const calculateControlPoint = (current, previous, next, reverse) => {
41
+ const p = previous || current;
42
+ const n = next || current;
43
+ const o = {
44
+ length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)),
45
+ angle: Math.atan2(n[1] - p[1], n[0] - p[0])
46
+ };
47
+ const angle = o.angle + (0);
48
+ const length = o.length * smoothing;
49
+ return [
50
+ current[0] + Math.cos(angle) * length,
51
+ current[1] + Math.sin(angle) * length
52
+ ];
53
+ };
54
+ return points.reduce(
55
+ (acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${calculateControlPoint(a[i - 1], a[i - 2], point)}`,
56
+ ""
57
+ );
58
+ }
59
+
60
+ export { lerp as a, delay as b, chain as c, distance as d, getPath as g, lineEq as l, wait as w };