refract-ui 0.0.0 → 1.0.2

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 (88) hide show
  1. package/README.md +14 -3
  2. package/dist/RefractProvider-Bzz4G22S.cjs +25 -0
  3. package/dist/RefractProvider-Bzz4G22S.cjs.map +1 -0
  4. package/dist/RefractProvider-D__A8gQl.js +238 -0
  5. package/dist/RefractProvider-D__A8gQl.js.map +1 -0
  6. package/dist/assets/iphone-11.glb +0 -0
  7. package/dist/assets/macbook-pro.glb +0 -0
  8. package/dist/carousel.cjs +48 -1
  9. package/dist/carousel.cjs.map +1 -1
  10. package/dist/carousel.js +300 -0
  11. package/dist/carousel.js.map +1 -1
  12. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +10 -0
  13. package/dist/components/Breadcrumbs/index.d.ts +2 -0
  14. package/dist/components/Button/Button.d.ts +22 -0
  15. package/dist/components/Button/index.d.ts +2 -0
  16. package/dist/components/Carousel/Carousel.d.ts +21 -0
  17. package/dist/components/Carousel/index.d.ts +1 -0
  18. package/dist/components/Divider/Divider.d.ts +12 -0
  19. package/dist/components/Divider/index.d.ts +2 -0
  20. package/dist/components/Heading/Heading.d.ts +9 -0
  21. package/dist/components/Heading/index.d.ts +2 -0
  22. package/dist/components/Icon/Icon.d.ts +30 -0
  23. package/dist/components/Icon/index.d.ts +2 -0
  24. package/dist/components/Image/Image.d.ts +27 -0
  25. package/dist/components/Image/index.d.ts +1 -0
  26. package/dist/components/Input/Input.d.ts +21 -0
  27. package/dist/components/Input/TextArea.d.ts +11 -0
  28. package/dist/components/Input/index.d.ts +2 -0
  29. package/dist/components/Link/Link.d.ts +10 -0
  30. package/dist/components/Link/index.d.ts +1 -0
  31. package/dist/components/LinkProvider/LinkProvider.d.ts +11 -0
  32. package/dist/components/LinkProvider/index.d.ts +1 -0
  33. package/dist/components/List/List.d.ts +11 -0
  34. package/dist/components/List/index.d.ts +1 -0
  35. package/dist/components/Loader/Loader.d.ts +6 -0
  36. package/dist/components/Loader/index.d.ts +2 -0
  37. package/dist/components/Model/Model.d.ts +40 -0
  38. package/dist/components/Model/deviceModels.d.ts +29 -0
  39. package/dist/components/Model/index.d.ts +2 -0
  40. package/dist/components/RefractProvider/RefractProvider.d.ts +20 -0
  41. package/dist/components/RefractProvider/index.d.ts +1 -0
  42. package/dist/components/ScrambleReveal/ScrambleReveal.d.ts +9 -0
  43. package/dist/components/ScrambleReveal/index.d.ts +1 -0
  44. package/dist/components/Section/Section.d.ts +8 -0
  45. package/dist/components/Section/index.d.ts +1 -0
  46. package/dist/components/SegmentedControl/SegmentedControl.d.ts +15 -0
  47. package/dist/components/SegmentedControl/index.d.ts +1 -0
  48. package/dist/components/Table/Table.d.ts +11 -0
  49. package/dist/components/Table/index.d.ts +1 -0
  50. package/dist/components/ThemeProvider/ThemeProvider.d.ts +21 -0
  51. package/dist/components/ThemeProvider/index.d.ts +5 -0
  52. package/dist/components/ThemeProvider/theme.d.ts +138 -0
  53. package/dist/components/ThemeProvider/useTheme.d.ts +2 -0
  54. package/dist/components/Transition/Transition.d.ts +19 -0
  55. package/dist/components/Transition/index.d.ts +1 -0
  56. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +10 -0
  57. package/dist/components/VisuallyHidden/index.d.ts +2 -0
  58. package/dist/components/Wordmark/Wordmark.d.ts +5 -0
  59. package/dist/components/Wordmark/index.d.ts +2 -0
  60. package/dist/entries/carousel.d.ts +1 -1
  61. package/dist/entries/model.d.ts +1 -1
  62. package/dist/hooks/useFormInput.d.ts +11 -0
  63. package/dist/hooks/useFps.d.ts +8 -0
  64. package/dist/hooks/useHasMounted.d.ts +1 -0
  65. package/dist/hooks/useInViewport.d.ts +2 -0
  66. package/dist/index.cjs +1 -1
  67. package/dist/index.cjs.map +1 -1
  68. package/dist/index.d.ts +20 -0
  69. package/dist/index.js +914 -45
  70. package/dist/index.js.map +1 -1
  71. package/dist/model.cjs +4 -1
  72. package/dist/model.cjs.map +1 -1
  73. package/dist/model.js +267 -0
  74. package/dist/model.js.map +1 -1
  75. package/dist/style-CWBkJEps.cjs +2 -0
  76. package/dist/style-CWBkJEps.cjs.map +1 -0
  77. package/dist/style-uMN7vipQ.js +96 -0
  78. package/dist/style-uMN7vipQ.js.map +1 -0
  79. package/dist/styles.css +1 -1
  80. package/dist/three-CWsiEOQZ.js +48 -0
  81. package/dist/three-CWsiEOQZ.js.map +1 -0
  82. package/dist/three-aeLbW1yA.cjs +2 -0
  83. package/dist/three-aeLbW1yA.cjs.map +1 -0
  84. package/dist/tokens.css +1 -0
  85. package/dist/utils/delay.d.ts +1 -0
  86. package/dist/utils/image.d.ts +31 -0
  87. package/dist/utils/three.d.ts +29 -0
  88. package/package.json +5 -5
package/dist/carousel.js CHANGED
@@ -1,2 +1,302 @@
1
1
  "use client";
2
+ import { jsxs as B, jsx as v } from "react/jsx-runtime";
3
+ import * as R from "react";
4
+ import { useState as y, useRef as o, useEffect as F, useCallback as f } from "react";
5
+ import { useReducedMotion as ce, animate as ie } from "framer-motion";
6
+ import { u as se, c as ue, r as le } from "./style-uMN7vipQ.js";
7
+ import { WebGLRenderer as de, OrthographicCamera as me, Scene as ve, Color as pe, SRGBColorSpace as fe, LinearFilter as O, ShaderMaterial as ge, PlaneGeometry as xe, Mesh as Ie } from "three";
8
+ import { c as _e, a as we, t as he } from "./three-CWsiEOQZ.js";
9
+ const ye = (r) => /* @__PURE__ */ R.createElement("svg", { fill: "currentColor", width: 18, height: 42, viewBox: "0 0 18 42", ...r }, /* @__PURE__ */ R.createElement("path", { d: "M18.03 1.375L16.47.125-.031 20.75l16.5 20.625 1.562-1.25L2.53 20.75z" })), Fe = (r) => /* @__PURE__ */ R.createElement("svg", { fill: "currentColor", width: 18, height: 42, viewBox: "0 0 18 42", ...r }, /* @__PURE__ */ R.createElement("path", { d: "M-.03 1.375L1.53.125l16.5 20.625-16.5 20.625-1.562-1.25 15.5-19.375z" })), Se = "_carousel_miavd_1", be = "_content_miavd_5", Pe = "_imageWrapper_miavd_11", Ce = "_canvasWrapper_miavd_23", Me = "_canvas_miavd_23", Le = "_placeholder_miavd_36", De = "_button_miavd_51", Ae = "_nav_miavd_107", Ee = "_navButton_miavd_114", l = {
10
+ carousel: Se,
11
+ content: be,
12
+ imageWrapper: Pe,
13
+ canvasWrapper: Ce,
14
+ canvas: Me,
15
+ placeholder: Le,
16
+ button: De,
17
+ nav: Ae,
18
+ navButton: Ee
19
+ }, Re = `varying vec2 vUv;
20
+ uniform sampler2D currentImage;
21
+ uniform sampler2D nextImage;
22
+ uniform float dispFactor;
23
+ uniform float direction;
24
+ uniform bool reduceMotion;
25
+
26
+ void main() {
27
+ if (reduceMotion) {
28
+ // Simple crossfade
29
+ vec4 _currentImage = texture2D(currentImage, vUv);
30
+ vec4 _nextImage = texture2D(nextImage, vUv);
31
+ vec4 finalTexture = mix(_currentImage, _nextImage, dispFactor);
32
+ gl_FragColor = finalTexture;
33
+ } else {
34
+ // Liquid distortion effect
35
+ vec2 uv = vUv;
36
+ vec4 _currentImage;
37
+ vec4 _nextImage;
38
+ float intensity = 0.6;
39
+
40
+ vec4 orig1 = texture2D(currentImage, uv);
41
+ vec4 orig2 = texture2D(nextImage, uv);
42
+
43
+ vec2 distortedPosition = vec2(
44
+ uv.x + direction * (dispFactor * (orig2.r * intensity)),
45
+ uv.y + direction * (dispFactor * (orig2 * intensity))
46
+ );
47
+
48
+ vec2 distortedPosition2 = vec2(
49
+ uv.x - direction * ((1.0 - dispFactor) * (orig1.r * intensity)),
50
+ uv.y - direction * ((1.0 - dispFactor) * (orig1 * intensity))
51
+ );
52
+
53
+ _currentImage = texture2D(currentImage, distortedPosition);
54
+ _nextImage = texture2D(nextImage, distortedPosition2);
55
+
56
+ vec4 finalTexture = mix(_currentImage, _nextImage, dispFactor);
57
+ gl_FragColor = finalTexture;
58
+ }
59
+ }
60
+ `, Ne = `varying vec2 vUv;
61
+
62
+ void main() {
63
+ vUv = uv;
64
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
65
+ }
66
+ `;
67
+ function J(r, s, d, h) {
68
+ if (s !== null) return s;
69
+ const S = d.length, b = (r - 1 + S) % S, D = (r + 1) % S;
70
+ return h > 0 ? D : b;
71
+ }
72
+ const qe = ({ width: r, height: s, images: d, placeholder: h, ...S }) => {
73
+ const [b, D] = y(!1), [a, H] = y(0), [P, Q] = y(!1), [Y, Z] = y(!0), [i, ee] = y(), [C, ne] = y(), A = o(null), N = o(), U = o(), g = o(), x = o(), M = o(), c = o(), I = o(!1), L = o(), W = o(), z = o(), q = ce(), $ = se(A, !0), j = o(null), X = o(), te = `Slide ${a + 1} of ${d.length}. ${d[a].alt}`;
74
+ F(() => (b && (document.body.style.cursor = "grabbing"), () => {
75
+ document.body.style.cursor = "";
76
+ }), [b]), F(() => {
77
+ const e = [r / -2, r / 2, s / 2, s / -2, 1, 1e3];
78
+ return c.current = new de({
79
+ canvas: A.current,
80
+ antialias: !1,
81
+ alpha: !0,
82
+ powerPreference: "high-performance",
83
+ failIfMajorPerformanceCaveat: !0
84
+ }), M.current = new me(...e), x.current = new ve(), c.current.setPixelRatio(2), c.current.setClearColor(1118481, 1), c.current.setSize(r, s), c.current.domElement.style.width = "100%", c.current.domElement.style.height = "auto", x.current.background = new pe(1118481), M.current.position.z = 1, () => {
85
+ I.current = !1, _e(x.current), we(c.current);
86
+ };
87
+ }, [s, r]), F(() => {
88
+ let e = !0;
89
+ return $ && !P && (async () => {
90
+ const t = c.current.capabilities.getMaxAnisotropy(), m = d.map(async (p) => {
91
+ const T = p.srcSet ? await le({ srcSet: p.srcSet }) : p.src.src, w = await he.loadAsync(T);
92
+ return await c.current.initTexture(w), w.colorSpace = fe, w.minFilter = O, w.magFilter = O, w.anisotropy = t, w.generateMipmaps = !1, w;
93
+ }), _ = await Promise.all(m);
94
+ e && (g.current = new ge({
95
+ uniforms: {
96
+ dispFactor: { value: 0 },
97
+ direction: { value: 1 },
98
+ currentImage: { value: _[0] },
99
+ nextImage: { value: _[1] },
100
+ reduceMotion: { value: q }
101
+ },
102
+ vertexShader: Ne,
103
+ fragmentShader: Re,
104
+ transparent: !1,
105
+ opacity: 1
106
+ }), U.current = new xe(r, s, 1), N.current = new Ie(U.current, g.current), N.current.position.set(0, 0, 0), x.current.add(N.current), Q(!0), ee(_), requestAnimationFrame(() => {
107
+ c.current.render(x.current, M.current);
108
+ }));
109
+ })(), () => {
110
+ e = !1;
111
+ };
112
+ }, [s, d, $, P, q, r]);
113
+ const G = f(
114
+ ({ index: e, direction: n = 1 }) => {
115
+ if (!i) return;
116
+ H(e);
117
+ const { uniforms: t } = g.current;
118
+ t.nextImage.value = i[e], t.direction.value = n;
119
+ const m = () => {
120
+ t.currentImage.value = i[e], t.dispFactor.value = 0, I.current = !1;
121
+ };
122
+ t.dispFactor.value !== 1 && (I.current = !0, ie(t.dispFactor.value, 1, {
123
+ type: "spring",
124
+ stiffness: 100,
125
+ damping: 20,
126
+ restSpeed: 1e-3,
127
+ restDelta: 1e-3,
128
+ onUpdate: (_) => {
129
+ t.dispFactor.value = _;
130
+ },
131
+ onComplete: m
132
+ }));
133
+ },
134
+ [i]
135
+ ), u = f(
136
+ ({ direction: e, index: n = null, ...t }) => {
137
+ if (!P) return;
138
+ if (I.current) {
139
+ cancelAnimationFrame(z.current), z.current = requestAnimationFrame(
140
+ () => (
141
+ // Self-recursive call: safe, runs async after `navigate` is fully assigned
142
+ // eslint-disable-next-line react-hooks/immutability
143
+ u({ direction: e, index: n, ...t })
144
+ )
145
+ );
146
+ return;
147
+ }
148
+ const m = J(a, n ?? null, i, e);
149
+ G({ index: m, direction: e, ...t });
150
+ },
151
+ [G, a, P, i]
152
+ ), re = f(
153
+ (e) => {
154
+ if (e === a) return;
155
+ const n = e > a ? 1 : -1;
156
+ u({ direction: n, index: e });
157
+ },
158
+ [a, u]
159
+ );
160
+ F(() => {
161
+ const e = () => {
162
+ const n = A.current.getBoundingClientRect();
163
+ ne(n);
164
+ };
165
+ return window.addEventListener("resize", e), e(), () => {
166
+ window.removeEventListener("resize", e);
167
+ };
168
+ }, []), F(() => {
169
+ let e;
170
+ const n = () => {
171
+ e = requestAnimationFrame(n), I.current && c.current.render(x.current, M.current);
172
+ };
173
+ return e = requestAnimationFrame(n), () => {
174
+ cancelAnimationFrame(e);
175
+ };
176
+ }, []), F(() => {
177
+ if (h) {
178
+ const e = () => {
179
+ Z(!1);
180
+ }, n = j.current;
181
+ return n == null || n.addEventListener("transitionend", e), () => {
182
+ n && n.removeEventListener("transitionend", e);
183
+ };
184
+ }
185
+ }, [h]);
186
+ const V = f(
187
+ (e) => {
188
+ if (I.current || !g.current || !i || !C) return;
189
+ W.current = e;
190
+ const n = Math.abs(e), t = C.width;
191
+ L.current = e > 0 ? -1 : 1;
192
+ const m = 1 - (n - t) / t * -1, _ = J(a, null, d, L.current), p = g.current.uniforms, T = Math.min(Math.max(m, 0), 1);
193
+ p.currentImage.value = i[a], p.nextImage.value = i[_], p.direction.value = L.current, p.dispFactor.value = T, requestAnimationFrame(() => {
194
+ c.current.render(x.current, M.current);
195
+ });
196
+ },
197
+ [C, a, d, i]
198
+ ), K = f(() => {
199
+ if (!g.current) return;
200
+ const e = g.current.uniforms, n = (1 - e.dispFactor.value) * 1e3, t = Math.abs(W.current), m = C.width * 0.2;
201
+ W.current = 0, !I.current && (t === 0 || !t || (t > m ? u({
202
+ duration: n,
203
+ direction: L.current
204
+ }) : (e.currentImage.value = e.nextImage.value, e.nextImage.value = e.currentImage.value, e.dispFactor.value = 1 - e.dispFactor.value, u({
205
+ direction: L.current * -1,
206
+ index: a
207
+ }))));
208
+ }, [C, a, u]), E = f(
209
+ (e) => {
210
+ V(e.clientX - X.current);
211
+ },
212
+ [V]
213
+ ), k = f(() => {
214
+ D(!1), K(), document.removeEventListener("pointerup", k), document.removeEventListener("pointermove", E);
215
+ }, [E, K]), ae = f(
216
+ (e) => {
217
+ X.current = e.clientX, D(!0), document.addEventListener("pointermove", E), document.addEventListener("pointerup", k);
218
+ },
219
+ [E, k]
220
+ ), oe = (e) => {
221
+ switch (e.key) {
222
+ case "ArrowRight":
223
+ u({ direction: 1 });
224
+ break;
225
+ case "ArrowLeft":
226
+ u({ direction: -1 });
227
+ break;
228
+ }
229
+ };
230
+ return /* @__PURE__ */ B("div", { className: l.carousel, onKeyDown: oe, ...S, children: [
231
+ /* @__PURE__ */ B("div", { className: l.content, children: [
232
+ /* @__PURE__ */ B(
233
+ "div",
234
+ {
235
+ className: l.imageWrapper,
236
+ "data-dragging": b,
237
+ onPointerDown: ae,
238
+ style: ue({ aspectRatio: `${r} / ${s}` }),
239
+ children: [
240
+ /* @__PURE__ */ v(
241
+ "div",
242
+ {
243
+ "aria-atomic": !0,
244
+ className: l.canvasWrapper,
245
+ "aria-live": "polite",
246
+ "aria-label": te,
247
+ role: "img",
248
+ children: /* @__PURE__ */ v("canvas", { "aria-hidden": !0, className: l.canvas, ref: A })
249
+ }
250
+ ),
251
+ Y && h && /* @__PURE__ */ v(
252
+ "img",
253
+ {
254
+ "aria-hidden": !0,
255
+ className: l.placeholder,
256
+ "data-loaded": P && !!i,
257
+ src: h.src,
258
+ ref: j,
259
+ alt: "",
260
+ role: "presentation"
261
+ }
262
+ )
263
+ ]
264
+ }
265
+ ),
266
+ /* @__PURE__ */ v(
267
+ "button",
268
+ {
269
+ className: l.button,
270
+ "data-prev": !0,
271
+ "aria-label": "Previous slide",
272
+ onClick: () => u({ direction: -1 }),
273
+ children: /* @__PURE__ */ v(ye, {})
274
+ }
275
+ ),
276
+ /* @__PURE__ */ v(
277
+ "button",
278
+ {
279
+ className: l.button,
280
+ "data-next": !0,
281
+ "aria-label": "Next slide",
282
+ onClick: () => u({ direction: 1 }),
283
+ children: /* @__PURE__ */ v(Fe, {})
284
+ }
285
+ )
286
+ ] }),
287
+ /* @__PURE__ */ v("div", { className: l.nav, children: d.map((e, n) => /* @__PURE__ */ v(
288
+ "button",
289
+ {
290
+ className: l.navButton,
291
+ onClick: () => re(n),
292
+ "aria-label": `Jump to slide ${n + 1}`,
293
+ "aria-pressed": n === a
294
+ },
295
+ e.alt
296
+ )) })
297
+ ] });
298
+ };
299
+ export {
300
+ qe as Carousel
301
+ };
2
302
  //# sourceMappingURL=carousel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"carousel.js","sources":["../src/components/Carousel/svg/arrow-left.svg","../src/components/Carousel/svg/arrow-right.svg","../src/components/Carousel/carousel.frag.glsl?raw","../src/components/Carousel/carousel.vert.glsl?raw","../src/components/Carousel/Carousel.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgArrowLeft = (props) => /* @__PURE__ */ React.createElement(\"svg\", { fill: \"currentColor\", width: 18, height: 42, viewBox: \"0 0 18 42\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M18.03 1.375L16.47.125-.031 20.75l16.5 20.625 1.562-1.25L2.53 20.75z\" }));\nexport default SvgArrowLeft;\n","import * as React from \"react\";\nconst SvgArrowRight = (props) => /* @__PURE__ */ React.createElement(\"svg\", { fill: \"currentColor\", width: 18, height: 42, viewBox: \"0 0 18 42\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M-.03 1.375L1.53.125l16.5 20.625-16.5 20.625-1.562-1.25 15.5-19.375z\" }));\nexport default SvgArrowRight;\n","export default \"varying vec2 vUv;\\nuniform sampler2D currentImage;\\nuniform sampler2D nextImage;\\nuniform float dispFactor;\\nuniform float direction;\\nuniform bool reduceMotion;\\n\\nvoid main() {\\n if (reduceMotion) {\\n // Simple crossfade\\n vec4 _currentImage = texture2D(currentImage, vUv);\\n vec4 _nextImage = texture2D(nextImage, vUv);\\n vec4 finalTexture = mix(_currentImage, _nextImage, dispFactor);\\n gl_FragColor = finalTexture;\\n } else {\\n // Liquid distortion effect\\n vec2 uv = vUv;\\n vec4 _currentImage;\\n vec4 _nextImage;\\n float intensity = 0.6;\\n\\n vec4 orig1 = texture2D(currentImage, uv);\\n vec4 orig2 = texture2D(nextImage, uv);\\n\\n vec2 distortedPosition = vec2(\\n uv.x + direction * (dispFactor * (orig2.r * intensity)),\\n uv.y + direction * (dispFactor * (orig2 * intensity))\\n );\\n\\n vec2 distortedPosition2 = vec2(\\n uv.x - direction * ((1.0 - dispFactor) * (orig1.r * intensity)),\\n uv.y - direction * ((1.0 - dispFactor) * (orig1 * intensity))\\n );\\n\\n _currentImage = texture2D(currentImage, distortedPosition);\\n _nextImage = texture2D(nextImage, distortedPosition2);\\n\\n vec4 finalTexture = mix(_currentImage, _nextImage, dispFactor);\\n gl_FragColor = finalTexture;\\n }\\n}\\n\"","export default \"varying vec2 vUv;\\n\\nvoid main() {\\n vUv = uv;\\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\\n}\\n\"","import ArrowLeft from './svg/arrow-left.svg';\nimport ArrowRight from './svg/arrow-right.svg';\nimport { animate, useReducedMotion } from 'framer-motion';\nimport { useInViewport } from '../../hooks/useInViewport';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport type { HTMLAttributes, KeyboardEvent, PointerEvent } from 'react';\nimport {\n Color,\n LinearFilter,\n Mesh,\n OrthographicCamera,\n PlaneGeometry,\n Scene,\n ShaderMaterial,\n SRGBColorSpace,\n WebGLRenderer,\n} from 'three';\nimport type { Texture } from 'three';\nimport { resolveSrcFromSrcSet } from '../../utils/image';\nimport { cssProps } from '../../utils/style';\nimport { cleanRenderer, cleanScene, textureLoader } from '../../utils/three';\nimport styles from './Carousel.module.css';\nimport fragment from './carousel.frag.glsl?raw';\nimport vertex from './carousel.vert.glsl?raw';\n\ninterface CarouselImage {\n src?: { src: string };\n srcSet?: { src: string; width: number }[];\n alt: string;\n}\n\ninterface CarouselProps extends HTMLAttributes<HTMLDivElement> {\n width: number;\n height: number;\n images: CarouselImage[];\n placeholder?: { src: string };\n}\n\nfunction determineIndex(\n imageIndex: number,\n index: number | null,\n images: CarouselImage[] | Texture[],\n direction: number\n) {\n if (index !== null) return index;\n const length = images.length;\n const prevIndex = (imageIndex - 1 + length) % length;\n const nextIndex = (imageIndex + 1) % length;\n const finalIndex = direction > 0 ? nextIndex : prevIndex;\n return finalIndex;\n}\n\nexport const Carousel = ({ width, height, images, placeholder, ...rest }: CarouselProps) => {\n const [dragging, setDragging] = useState(false);\n const [imageIndex, setImageIndex] = useState(0);\n const [loaded, setLoaded] = useState(false);\n const [showPlaceholder, setShowPlaceholder] = useState(true);\n const [textures, setTextures] = useState<Texture[]>();\n const [canvasRect, setCanvasRect] = useState<DOMRect>();\n const canvas = useRef<HTMLCanvasElement>(null);\n const imagePlane = useRef<Mesh>();\n const geometry = useRef<PlaneGeometry>();\n const material = useRef<ShaderMaterial>();\n const scene = useRef<Scene>();\n const camera = useRef<OrthographicCamera>();\n const renderer = useRef<WebGLRenderer>();\n const animating = useRef(false);\n const swipeDirection = useRef<number>();\n const lastSwipePosition = useRef<number>();\n const scheduledAnimationFrame = useRef<number>();\n const reduceMotion = useReducedMotion();\n const inViewport = useInViewport(canvas, true);\n const placeholderRef = useRef<HTMLImageElement>(null);\n const initSwipeX = useRef<number>();\n\n const currentImageAlt = `Slide ${imageIndex + 1} of ${images.length}. ${\n images[imageIndex].alt\n }`;\n\n useEffect(() => {\n if (dragging) {\n document.body.style.cursor = 'grabbing';\n }\n\n return () => {\n document.body.style.cursor = '';\n };\n }, [dragging]);\n\n useEffect(() => {\n const cameraOptions = [width / -2, width / 2, height / 2, height / -2, 1, 1000] as const;\n renderer.current = new WebGLRenderer({\n canvas: canvas.current!,\n antialias: false,\n alpha: true,\n powerPreference: 'high-performance',\n failIfMajorPerformanceCaveat: true,\n });\n camera.current = new OrthographicCamera(...cameraOptions);\n scene.current = new Scene();\n renderer.current.setPixelRatio(2);\n renderer.current.setClearColor(0x111111, 1.0);\n renderer.current.setSize(width, height);\n renderer.current.domElement.style.width = '100%';\n renderer.current.domElement.style.height = 'auto';\n scene.current.background = new Color(0x111111);\n camera.current.position.z = 1;\n\n return () => {\n animating.current = false;\n cleanScene(scene.current!);\n cleanRenderer(renderer.current!);\n };\n }, [height, width]);\n\n useEffect(() => {\n let mounted = true;\n\n const loadImages = async () => {\n const anisotropy = renderer.current!.capabilities.getMaxAnisotropy();\n\n const texturePromises = images.map(async image => {\n const imageSrc = image.srcSet\n ? await resolveSrcFromSrcSet({ srcSet: image.srcSet })\n : image.src!.src;\n const imageTexture = await textureLoader.loadAsync(imageSrc);\n await renderer.current!.initTexture(imageTexture);\n imageTexture.colorSpace = SRGBColorSpace;\n imageTexture.minFilter = LinearFilter;\n imageTexture.magFilter = LinearFilter;\n imageTexture.anisotropy = anisotropy;\n imageTexture.generateMipmaps = false;\n return imageTexture;\n });\n\n const loadedTextures = await Promise.all(texturePromises);\n\n if (!mounted) return;\n\n material.current = new ShaderMaterial({\n uniforms: {\n dispFactor: { value: 0 },\n direction: { value: 1 },\n currentImage: { value: loadedTextures[0] },\n nextImage: { value: loadedTextures[1] },\n reduceMotion: { value: reduceMotion },\n },\n vertexShader: vertex,\n fragmentShader: fragment,\n transparent: false,\n opacity: 1,\n });\n\n geometry.current = new PlaneGeometry(width, height, 1);\n imagePlane.current = new Mesh(geometry.current, material.current);\n imagePlane.current.position.set(0, 0, 0);\n scene.current!.add(imagePlane.current);\n\n setLoaded(true);\n setTextures(loadedTextures);\n\n requestAnimationFrame(() => {\n renderer.current!.render(scene.current!, camera.current!);\n });\n };\n\n if (inViewport && !loaded) {\n loadImages();\n }\n\n return () => {\n mounted = false;\n };\n }, [height, images, inViewport, loaded, reduceMotion, width]);\n\n const goToIndex = useCallback(\n ({ index, direction = 1 }: { index: number; direction?: number }) => {\n if (!textures) return;\n setImageIndex(index);\n const { uniforms } = material.current!;\n uniforms.nextImage.value = textures[index];\n uniforms.direction.value = direction;\n\n const onComplete = () => {\n uniforms.currentImage.value = textures[index];\n uniforms.dispFactor.value = 0;\n animating.current = false;\n };\n\n if (uniforms.dispFactor.value !== 1) {\n animating.current = true;\n\n animate(uniforms.dispFactor.value, 1, {\n type: 'spring',\n stiffness: 100,\n damping: 20,\n restSpeed: 0.001,\n restDelta: 0.001,\n onUpdate: (value: number) => {\n uniforms.dispFactor.value = value;\n },\n onComplete,\n });\n }\n },\n [textures]\n );\n\n const navigate = useCallback(\n ({ direction, index = null, ...navRest }: { direction: number; index?: number | null; duration?: number }) => {\n if (!loaded) return;\n\n if (animating.current) {\n cancelAnimationFrame(scheduledAnimationFrame.current!);\n scheduledAnimationFrame.current = requestAnimationFrame(() =>\n // Self-recursive call: safe, runs async after `navigate` is fully assigned\n // eslint-disable-next-line react-hooks/immutability\n navigate({ direction, index, ...navRest })\n );\n return;\n }\n\n const finalIndex = determineIndex(imageIndex, index ?? null, textures!, direction);\n goToIndex({ index: finalIndex, direction, ...navRest });\n },\n [goToIndex, imageIndex, loaded, textures]\n );\n\n const onNavClick = useCallback(\n (index: number) => {\n if (index === imageIndex) return;\n const direction = index > imageIndex ? 1 : -1;\n navigate({ direction, index });\n },\n [imageIndex, navigate]\n );\n\n useEffect(() => {\n const handleResize = () => {\n const rect = canvas.current!.getBoundingClientRect();\n setCanvasRect(rect);\n };\n\n window.addEventListener('resize', handleResize);\n handleResize();\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n useEffect(() => {\n let animation: number;\n\n const animateLoop = () => {\n animation = requestAnimationFrame(animateLoop);\n if (animating.current) {\n renderer.current!.render(scene.current!, camera.current!);\n }\n };\n\n animation = requestAnimationFrame(animateLoop);\n\n return () => {\n cancelAnimationFrame(animation);\n };\n }, []);\n\n useEffect(() => {\n if (placeholder) {\n const purgePlaceholder = () => {\n setShowPlaceholder(false);\n };\n\n const placeholderElement = placeholderRef.current;\n placeholderElement?.addEventListener('transitionend', purgePlaceholder);\n\n return () => {\n if (placeholderElement) {\n placeholderElement.removeEventListener('transitionend', purgePlaceholder);\n }\n };\n }\n }, [placeholder]);\n\n const onSwipeMove = useCallback(\n (x: number) => {\n if (animating.current || !material.current || !textures || !canvasRect) return;\n lastSwipePosition.current = x;\n const absoluteX = Math.abs(x);\n const containerWidth = canvasRect.width;\n swipeDirection.current = x > 0 ? -1 : 1;\n const swipePercentage = 1 - ((absoluteX - containerWidth) / containerWidth) * -1;\n const nextIndex = determineIndex(imageIndex, null, images, swipeDirection.current);\n const uniforms = material.current.uniforms;\n const displacementClamp = Math.min(Math.max(swipePercentage, 0), 1);\n\n uniforms.currentImage.value = textures[imageIndex];\n uniforms.nextImage.value = textures[nextIndex];\n uniforms.direction.value = swipeDirection.current;\n\n uniforms.dispFactor.value = displacementClamp;\n\n requestAnimationFrame(() => {\n renderer.current!.render(scene.current!, camera.current!);\n });\n },\n [canvasRect, imageIndex, images, textures]\n );\n\n const onSwipeEnd = useCallback(() => {\n if (!material.current) return;\n const uniforms = material.current.uniforms;\n const duration = (1 - uniforms.dispFactor.value) * 1000;\n const position = Math.abs(lastSwipePosition.current!);\n const minSwipeDistance = canvasRect!.width * 0.2;\n lastSwipePosition.current = 0;\n\n if (animating.current) return;\n if (position === 0 || !position) return;\n\n if (position > minSwipeDistance) {\n navigate({\n duration,\n direction: swipeDirection.current!,\n });\n } else {\n uniforms.currentImage.value = uniforms.nextImage.value;\n uniforms.nextImage.value = uniforms.currentImage.value;\n uniforms.dispFactor.value = 1 - uniforms.dispFactor.value;\n\n navigate({\n direction: swipeDirection.current! * -1,\n index: imageIndex,\n });\n }\n }, [canvasRect, imageIndex, navigate]);\n\n const handlePointerMove = useCallback(\n (event: globalThis.PointerEvent) => {\n onSwipeMove(event.clientX - initSwipeX.current!);\n },\n [onSwipeMove]\n );\n\n const handlePointerUp = useCallback(() => {\n setDragging(false);\n onSwipeEnd();\n\n // Self-reference: safe, only runs when the listener actually fires (after assignment)\n // eslint-disable-next-line react-hooks/immutability\n document.removeEventListener('pointerup', handlePointerUp);\n document.removeEventListener('pointermove', handlePointerMove);\n }, [handlePointerMove, onSwipeEnd]);\n\n const handlePointerDown = useCallback(\n (event: PointerEvent) => {\n initSwipeX.current = event.clientX;\n setDragging(true);\n\n document.addEventListener('pointermove', handlePointerMove);\n document.addEventListener('pointerup', handlePointerUp);\n },\n [handlePointerMove, handlePointerUp]\n );\n\n const handleKeyDown = (event: KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowRight':\n navigate({ direction: 1 });\n break;\n case 'ArrowLeft':\n navigate({ direction: -1 });\n break;\n }\n };\n\n return (\n <div className={styles.carousel} onKeyDown={handleKeyDown} {...rest}>\n <div className={styles.content}>\n <div\n className={styles.imageWrapper}\n data-dragging={dragging}\n onPointerDown={handlePointerDown}\n style={cssProps({ aspectRatio: `${width} / ${height}` })}\n >\n <div\n aria-atomic\n className={styles.canvasWrapper}\n aria-live=\"polite\"\n aria-label={currentImageAlt}\n role=\"img\"\n >\n <canvas aria-hidden className={styles.canvas} ref={canvas} />\n </div>\n {showPlaceholder && placeholder && (\n <img\n aria-hidden\n className={styles.placeholder}\n data-loaded={loaded && !!textures}\n src={placeholder.src}\n ref={placeholderRef}\n alt=\"\"\n role=\"presentation\"\n />\n )}\n </div>\n <button\n className={styles.button}\n data-prev={true}\n aria-label=\"Previous slide\"\n onClick={() => navigate({ direction: -1 })}\n >\n <ArrowLeft />\n </button>\n <button\n className={styles.button}\n data-next={true}\n aria-label=\"Next slide\"\n onClick={() => navigate({ direction: 1 })}\n >\n <ArrowRight />\n </button>\n </div>\n <div className={styles.nav}>\n {images.map((image, index) => (\n <button\n className={styles.navButton}\n key={image.alt}\n onClick={() => onNavClick(index)}\n aria-label={`Jump to slide ${index + 1}`}\n aria-pressed={index === imageIndex}\n />\n ))}\n </div>\n </div>\n );\n};\n"],"names":["SvgArrowLeft","props","React","SvgArrowRight","fragment","vertex","determineIndex","imageIndex","index","images","direction","length","prevIndex","nextIndex","Carousel","width","height","placeholder","rest","dragging","setDragging","useState","setImageIndex","loaded","setLoaded","showPlaceholder","setShowPlaceholder","textures","setTextures","canvasRect","setCanvasRect","canvas","useRef","imagePlane","geometry","material","scene","camera","renderer","animating","swipeDirection","lastSwipePosition","scheduledAnimationFrame","reduceMotion","useReducedMotion","inViewport","useInViewport","placeholderRef","initSwipeX","currentImageAlt","useEffect","cameraOptions","WebGLRenderer","OrthographicCamera","Scene","Color","cleanScene","cleanRenderer","mounted","anisotropy","texturePromises","image","imageSrc","resolveSrcFromSrcSet","imageTexture","textureLoader","SRGBColorSpace","LinearFilter","loadedTextures","ShaderMaterial","PlaneGeometry","Mesh","goToIndex","useCallback","uniforms","onComplete","animate","value","navigate","navRest","finalIndex","onNavClick","handleResize","rect","animation","animateLoop","purgePlaceholder","placeholderElement","onSwipeMove","x","absoluteX","containerWidth","swipePercentage","displacementClamp","onSwipeEnd","duration","position","minSwipeDistance","handlePointerMove","event","handlePointerUp","handlePointerDown","handleKeyDown","jsxs","styles","cssProps","jsx","ArrowLeft","ArrowRight"],"mappings":";;;;;;;;AACA,MAAMA,KAAe,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,MAAM,gBAAgB,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,GAAG,uEAAsE,CAAE,CAAC,GCAhRC,KAAgB,CAACF,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,MAAM,gBAAgB,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,GAAG,uEAAsE,CAAE,CAAC;;;;;;;;;;GCDvRE,KAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GCAfC,KAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACsCf,SAASC,EACPC,GAC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AAK8B;AAAA,gBACL,KAAI;AAAA,gBACJ,MAAK;AAAA,cAAA;AAAA,YAAA;AAAA,UACP;AAAA,QAAA;AAAA,MAAA;AAAA,MAGJ,gBAAA2D;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWF,EAAO;AAAA,UAClB,aAAW;AAAA,UACX,cAAW;AAAA,UACX,SAAS,MAAM1B,EAAS,EAAE,WAAW,IAAI;AAAA,UAEzC,4BAAC6B,IAAA,CAAA,CAAU;AAAA,QAAA;AAAA,MAAA;AAAA,MAEb,gBAAAD;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWF,EAAO;AAAA,UAClB,aAAW;AAAA,UACX,cAAW;AAAA,UACX,SAAS,MAAM1B,EAAS,EAAE,WAAW,GAAG;AAAA,UAExC,4BAAC8B,IAAA,CAAA,CAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IACd,GACF;AAAA,IACA,gBAAAF,EAAC,SAAI,WAAWF,EAAO,KACpB,UAAA/F,EAAO,IAAI,CAACoD,GAAOrD,MAClB,gBAAAkG;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWF,EAAO;AAAA,QAElB,SAAS,MAAMvB,GAAWzE,CAAK;AAAA,QAC/B,cAAY,iBAAiBA,IAAQ,CAAC;AAAA,QACtC,gBAAcA,MAAUD;AAAA,MAAA;AAAA,MAHnBsD,EAAM;AAAA,IAAA,CAKd,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
@@ -0,0 +1,10 @@
1
+ export interface BreadcrumbItem {
2
+ label: string;
3
+ href: string;
4
+ }
5
+ interface BreadcrumbsProps {
6
+ items: BreadcrumbItem[];
7
+ className?: string;
8
+ }
9
+ export declare const Breadcrumbs: ({ items, className }: BreadcrumbsProps) => import("react").JSX.Element;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Breadcrumbs } from './Breadcrumbs';
2
+ export type { BreadcrumbItem } from './Breadcrumbs';
@@ -0,0 +1,22 @@
1
+ import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
2
+ import { LinkComponent } from '../LinkProvider';
3
+ import { icons } from '../Icon';
4
+ export interface ButtonProps extends ComponentPropsWithoutRef<'button'> {
5
+ href?: string;
6
+ as?: ElementType;
7
+ secondary?: boolean;
8
+ loading?: boolean;
9
+ loadingText?: string;
10
+ icon?: keyof typeof icons;
11
+ iconEnd?: keyof typeof icons;
12
+ iconHoverShift?: boolean;
13
+ iconOnly?: boolean;
14
+ children?: ReactNode;
15
+ rel?: string;
16
+ target?: string;
17
+ disabled?: boolean;
18
+ download?: string;
19
+ /** Overrides the LinkProvider-supplied component for this instance only. */
20
+ linkComponent?: LinkComponent;
21
+ }
22
+ export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLElement>>;
@@ -0,0 +1,2 @@
1
+ export { Button } from './Button';
2
+ export type { ButtonProps } from './Button';
@@ -0,0 +1,21 @@
1
+ import { HTMLAttributes } from 'react';
2
+ interface CarouselImage {
3
+ src?: {
4
+ src: string;
5
+ };
6
+ srcSet?: {
7
+ src: string;
8
+ width: number;
9
+ }[];
10
+ alt: string;
11
+ }
12
+ interface CarouselProps extends HTMLAttributes<HTMLDivElement> {
13
+ width: number;
14
+ height: number;
15
+ images: CarouselImage[];
16
+ placeholder?: {
17
+ src: string;
18
+ };
19
+ }
20
+ export declare const Carousel: ({ width, height, images, placeholder, ...rest }: CarouselProps) => import("react").JSX.Element;
21
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Carousel';
@@ -0,0 +1,12 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ export interface DividerProps extends ComponentPropsWithoutRef<'div'> {
3
+ lineWidth?: string;
4
+ lineHeight?: string;
5
+ notchWidth?: string;
6
+ notchHeight?: string;
7
+ collapseDelay?: number;
8
+ collapsed?: boolean;
9
+ notch?: boolean;
10
+ light?: boolean;
11
+ }
12
+ export declare const Divider: ({ lineWidth, lineHeight, notchWidth, notchHeight, collapseDelay, collapsed, notch, light, className, style, ...rest }: DividerProps) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Divider } from './Divider';
2
+ export type { DividerProps } from './Divider';
@@ -0,0 +1,9 @@
1
+ import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
2
+ export interface HeadingProps extends ComponentPropsWithoutRef<'h1'> {
3
+ children?: ReactNode;
4
+ level?: number;
5
+ as?: ElementType;
6
+ align?: string;
7
+ weight?: string;
8
+ }
9
+ export declare const Heading: ({ children, level, as, align, weight, className, ...rest }: HeadingProps) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Heading } from './Heading';
2
+ export type { HeadingProps } from './Heading';
@@ -0,0 +1,30 @@
1
+ export declare const icons: {
2
+ arrowLeft: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
3
+ arrowRight: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
4
+ articles: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
5
+ company: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
6
+ check: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
7
+ chevronRight: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
8
+ close: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
9
+ copy: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
10
+ download: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
11
+ error: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
12
+ figma: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
13
+ github: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
14
+ link: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
15
+ linkedin: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
16
+ menu: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
17
+ pause: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
18
+ play: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
19
+ send: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
20
+ skills: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
21
+ storybook: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
22
+ twitter: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
23
+ };
24
+ export type IconName = keyof typeof icons;
25
+ export interface IconProps {
26
+ icon: IconName;
27
+ className?: string;
28
+ [key: string]: unknown;
29
+ }
30
+ export declare const Icon: ({ icon, className, ...rest }: IconProps) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Icon, icons } from './Icon';
2
+ export type { IconProps, IconName } from './Icon';
@@ -0,0 +1,27 @@
1
+ import { CSSProperties, HTMLAttributes } from 'react';
2
+ interface ImageSrc {
3
+ src: string;
4
+ width?: number;
5
+ height?: number;
6
+ }
7
+ interface SrcSetItem {
8
+ src: string;
9
+ width: number;
10
+ }
11
+ interface ImageProps extends HTMLAttributes<HTMLDivElement> {
12
+ className?: string;
13
+ style?: CSSProperties;
14
+ reveal?: boolean;
15
+ delay?: number;
16
+ raised?: boolean;
17
+ src?: ImageSrc;
18
+ srcSet?: SrcSetItem[];
19
+ placeholder?: ImageSrc;
20
+ alt?: string;
21
+ play?: boolean;
22
+ restartOnPause?: boolean;
23
+ sizes?: string;
24
+ noPauseButton?: boolean;
25
+ }
26
+ export declare const Image: ({ className, style, reveal, delay, raised, src: baseSrc, srcSet, placeholder, ...rest }: ImageProps) => import("react").JSX.Element;
27
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Image';
@@ -0,0 +1,21 @@
1
+ import { default as React, ChangeEvent, FocusEvent } from 'react';
2
+ export interface InputProps {
3
+ id?: string;
4
+ label?: string;
5
+ value?: string;
6
+ multiline?: boolean;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ error?: string | null;
10
+ onBlur?: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
11
+ autoComplete?: string;
12
+ required?: boolean;
13
+ maxLength?: number;
14
+ type?: string;
15
+ placeholder?: string;
16
+ /** Multiline only: cap the auto-grow at this many rows, then scroll inside. */
17
+ maxRows?: number;
18
+ onChange?: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
19
+ [key: string]: unknown;
20
+ }
21
+ export declare const Input: ({ id, label, value, multiline, className, style, error, onBlur, autoComplete, required, maxLength, type, placeholder, maxRows, onChange, ...rest }: InputProps) => React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { ChangeEvent, TextareaHTMLAttributes } from 'react';
2
+ interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'> {
3
+ className?: string;
4
+ resize?: string;
5
+ value?: string;
6
+ onChange: (event: ChangeEvent<HTMLTextAreaElement>) => void;
7
+ minRows?: number;
8
+ maxRows?: number;
9
+ }
10
+ export declare const TextArea: ({ className, resize, value, onChange, minRows, maxRows, ...rest }: TextAreaProps) => import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './Input';
2
+ export * from './TextArea';
@@ -0,0 +1,10 @@
1
+ import { ReactNode, ComponentPropsWithoutRef } from 'react';
2
+ import { LinkComponent } from '../LinkProvider';
3
+ interface LinkProps extends ComponentPropsWithoutRef<'a'> {
4
+ secondary?: boolean;
5
+ children?: ReactNode;
6
+ /** Overrides the LinkProvider-supplied component for this instance only. */
7
+ linkComponent?: LinkComponent;
8
+ }
9
+ export declare const Link: import('react').ForwardRefExoticComponent<LinkProps & import('react').RefAttributes<HTMLAnchorElement>>;
10
+ export {};
@@ -0,0 +1 @@
1
+ export { Link } from './Link';
@@ -0,0 +1,11 @@
1
+ import { AnchorHTMLAttributes, ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
2
+ export type LinkComponentProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
3
+ href: string;
4
+ };
5
+ export type LinkComponent = ForwardRefExoticComponent<LinkComponentProps & RefAttributes<HTMLAnchorElement>>;
6
+ export interface LinkProviderProps {
7
+ component: LinkComponent;
8
+ children?: ReactNode;
9
+ }
10
+ export declare const LinkProvider: ({ component, children }: LinkProviderProps) => import("react").JSX.Element;
11
+ export declare const useLinkComponent: () => LinkComponent;
@@ -0,0 +1 @@
1
+ export * from './LinkProvider';
@@ -0,0 +1,11 @@
1
+ import { ReactNode, ComponentPropsWithoutRef } from 'react';
2
+ interface ListProps extends ComponentPropsWithoutRef<'ul'> {
3
+ ordered?: boolean;
4
+ children?: ReactNode;
5
+ }
6
+ export declare const List: ({ ordered, children, className, ...rest }: ListProps) => import("react").JSX.Element;
7
+ interface ListItemProps extends ComponentPropsWithoutRef<'li'> {
8
+ children?: ReactNode;
9
+ }
10
+ export declare const ListItem: ({ children, ...rest }: ListItemProps) => import("react").JSX.Element;
11
+ export {};
@@ -0,0 +1 @@
1
+ export { List, ListItem } from './List';
@@ -0,0 +1,6 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ export interface LoaderProps extends ComponentPropsWithoutRef<'div'> {
3
+ size?: number;
4
+ text?: string;
5
+ }
6
+ export declare const Loader: ({ className, style, size, text, ...rest }: LoaderProps) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Loader } from './Loader';
2
+ export type { LoaderProps } from './Loader';