@stackone/malachite 2.112.0 → 2.114.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 (54) hide show
  1. package/COMPONENTS.md +6 -1
  2. package/dist/assets/icons/arrow_line_left.svg.js +6 -0
  3. package/dist/assets/icons/arrow_line_left.svg.js.map +1 -0
  4. package/dist/assets/icons/arrow_line_right.svg.js +6 -0
  5. package/dist/assets/icons/arrow_line_right.svg.js.map +1 -0
  6. package/dist/assets/icons/book.svg.js +6 -0
  7. package/dist/assets/icons/book.svg.js.map +1 -0
  8. package/dist/assets/icons/book_open.svg.js +6 -0
  9. package/dist/assets/icons/book_open.svg.js.map +1 -0
  10. package/dist/components/Accordion.js +66 -64
  11. package/dist/components/Accordion.js.map +1 -1
  12. package/dist/components/ActionMenu.js +97 -96
  13. package/dist/components/ActionMenu.js.map +1 -1
  14. package/dist/components/BannerButton.js +44 -0
  15. package/dist/components/BannerButton.js.map +1 -0
  16. package/dist/components/Confetti.js +46 -45
  17. package/dist/components/Confetti.js.map +1 -1
  18. package/dist/components/CopyButton.js +37 -0
  19. package/dist/components/CopyButton.js.map +1 -0
  20. package/dist/components/CustomIcons/ArrowLineLeftIcon.js +21 -0
  21. package/dist/components/CustomIcons/ArrowLineLeftIcon.js.map +1 -0
  22. package/dist/components/CustomIcons/ArrowLineRightIcon.js +21 -0
  23. package/dist/components/CustomIcons/ArrowLineRightIcon.js.map +1 -0
  24. package/dist/components/CustomIcons/BookIcon.js +16 -0
  25. package/dist/components/CustomIcons/BookIcon.js.map +1 -0
  26. package/dist/components/CustomIcons/BookOpenIcon.js +21 -0
  27. package/dist/components/CustomIcons/BookOpenIcon.js.map +1 -0
  28. package/dist/components/CustomIcons/index.js +363 -351
  29. package/dist/components/CustomIcons/index.js.map +1 -1
  30. package/dist/components/DividerToggle.js +68 -0
  31. package/dist/components/DividerToggle.js.map +1 -0
  32. package/dist/components/FormSteps.js +110 -0
  33. package/dist/components/FormSteps.js.map +1 -0
  34. package/dist/components/Input/Input.js +202 -178
  35. package/dist/components/Input/Input.js.map +1 -1
  36. package/dist/components/KeyValueList.js +36 -35
  37. package/dist/components/KeyValueList.js.map +1 -1
  38. package/dist/components/LoadingScreen.js +133 -0
  39. package/dist/components/LoadingScreen.js.map +1 -0
  40. package/dist/components/actionMenuStyles.js +70 -51
  41. package/dist/components/actionMenuStyles.js.map +1 -1
  42. package/dist/components/chromeStyles.js +2 -3
  43. package/dist/components/chromeStyles.js.map +1 -1
  44. package/dist/components/confettiPhysics.js +57 -0
  45. package/dist/components/confettiPhysics.js.map +1 -0
  46. package/dist/components/stackOneWordmarkPaths.js +10 -0
  47. package/dist/components/stackOneWordmarkPaths.js.map +1 -0
  48. package/dist/index.d.ts +285 -118
  49. package/dist/index.js +453 -435
  50. package/dist/index.js.map +1 -1
  51. package/dist/tailwind.css.js +1 -1
  52. package/dist/theme.js +12 -9
  53. package/dist/theme.js.map +1 -1
  54. package/package.json +1 -1
@@ -1,56 +1,57 @@
1
- import { jsx as h } from "react/jsx-runtime";
2
- import { useRef as g, useEffect as v } from "react";
3
- const x = [
4
- "var(--malachite-success-background)",
5
- "var(--malachite-text-success)",
6
- "var(--malachite-tag-primary-foreground)",
7
- "var(--malachite-warning-background)",
8
- "var(--malachite-error-background)"
9
- ], u = "\0", w = () => typeof window > "u" || typeof window.matchMedia != "function" ? !0 : window.matchMedia("(prefers-reduced-motion: reduce)").matches, b = ({
10
- count: r = 150,
11
- colors: l = x,
12
- className: p = ""
1
+ import { jsxs as O, jsx as C } from "react/jsx-runtime";
2
+ import { useRef as m, useEffect as S } from "react";
3
+ import { createPieces as F, stepPiece as _, isFinished as k, isLaunched as T, wobbleOf as j, opacityOf as L } from "./confettiPhysics.js";
4
+ const P = [
5
+ "var(--malachite-accent-background, rgb(0, 175, 102))",
6
+ "var(--malachite-accent-background, rgb(0, 175, 102))",
7
+ "var(--malachite-accent-foreground, rgb(2, 122, 66))",
8
+ "var(--malachite-tag-primary-foreground, rgb(37, 130, 234))",
9
+ "var(--malachite-tag-assistant-foreground, rgb(110, 86, 207))"
10
+ ], M = "\0", D = 0.72, K = 1 / 30, N = () => typeof window > "u" || typeof window.matchMedia != "function" ? !0 : window.matchMedia("(prefers-reduced-motion: reduce)").matches, q = (o, u) => u.map((i) => {
11
+ o.style.color = i;
12
+ const r = getComputedStyle(o).color || i, a = r.match(/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/), s = a ? `rgb(${a.slice(1, 4).map((l) => Math.round(Number(l) * D)).join(", ")})` : r;
13
+ return { front: r, back: s };
14
+ }), H = ({
15
+ count: o = 150,
16
+ colors: u = P,
17
+ className: i = ""
13
18
  }) => {
14
- const o = g(null), n = l.join(u);
15
- return v(() => {
16
- const a = o.current;
17
- if (!a || w()) return;
18
- const s = n.split(u), m = Array.from({ length: r }, (c, e) => {
19
- const t = document.createElement("div"), i = 10 + e * 7 % 10;
20
- t.style.cssText = `position:absolute;top:-5%;left:${e * 37 % 100}%;width:${i}px;height:${Math.round(i * 0.5)}px;background:${s[e % s.length]};border-radius:2px;`, a.appendChild(t);
21
- const d = (e * 53 % 100 - 50) * 4, f = 360 + e * 47 % 720;
22
- return t.animate(
23
- [
24
- { transform: "translate(0, 0) rotate(0deg)", opacity: 1 },
25
- {
26
- transform: `translate(${d}px, 105vh) rotate(${f}deg)`,
27
- opacity: 1,
28
- offset: 0.9
29
- },
30
- { transform: `translate(${d}px, 110vh) rotate(${f}deg)`, opacity: 0 }
31
- ],
32
- {
33
- duration: 2600 + e * 17 % 1600,
34
- delay: e * 11 % 500,
35
- easing: "cubic-bezier(0.2, 0.6, 0.4, 1)",
36
- fill: "forwards"
37
- }
38
- ), t;
39
- });
40
- return () => {
41
- for (const c of m) c.remove();
19
+ const r = m(null), a = m(null), s = m(null), l = u.join(M);
20
+ return S(() => {
21
+ const g = r.current, n = a.current, p = s.current;
22
+ if (!g || !n || !p || N()) return;
23
+ const e = n.getContext("2d");
24
+ if (!e) return;
25
+ const w = q(p, l.split(M)), b = g.getBoundingClientRect(), d = { width: b.width, height: b.height }, h = window.devicePixelRatio || 1;
26
+ n.width = Math.round(d.width * h), n.height = Math.round(d.height * h);
27
+ const f = F(o, w.length, d), c = { frame: 0, last: performance.now() }, v = (R) => {
28
+ const E = Math.min((R - c.last) / 1e3, K);
29
+ c.last = R, e.setTransform(1, 0, 0, 1, 0, 0), e.clearRect(0, 0, n.width, n.height);
30
+ const y = f.filter((t) => (_(t, E), !k(t, d)));
31
+ for (const t of y.filter(T)) {
32
+ const A = Math.cos(t.tilt), x = w[t.colorIndex];
33
+ e.setTransform(h, 0, 0, h, 0, 0), e.translate(t.x + j(t), t.y), e.rotate(t.rotation), e.scale(1, A), e.globalAlpha = L(t), e.fillStyle = A >= 0 ? x.front : x.back, e.fillRect(-t.width / 2, -t.height / 2, t.width, t.height);
34
+ }
35
+ f.splice(0, f.length, ...y), f.length > 0 && (c.frame = requestAnimationFrame(v));
42
36
  };
43
- }, [r, n]), /* @__PURE__ */ h(
37
+ return c.frame = requestAnimationFrame(v), () => {
38
+ cancelAnimationFrame(c.frame), e.setTransform(1, 0, 0, 1, 0, 0), e.clearRect(0, 0, n.width, n.height);
39
+ };
40
+ }, [o, l]), /* @__PURE__ */ O(
44
41
  "div",
45
42
  {
46
- ref: o,
43
+ ref: r,
47
44
  "aria-hidden": !0,
48
- className: `pointer-events-none fixed inset-0 overflow-hidden z-50 ${p}`
45
+ className: `pointer-events-none fixed inset-0 overflow-hidden z-50 ${i}`,
46
+ children: [
47
+ /* @__PURE__ */ C("canvas", { ref: a, style: { width: "100%", height: "100%", display: "block" } }),
48
+ /* @__PURE__ */ C("span", { ref: s, style: { display: "none" } })
49
+ ]
49
50
  }
50
51
  );
51
52
  };
52
53
  export {
53
- b as Confetti,
54
- b as default
54
+ H as Confetti,
55
+ H as default
55
56
  };
56
57
  //# sourceMappingURL=Confetti.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Confetti.js","sources":["../../src/components/Confetti.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\n\n// Theme tokens so the confetti adapts to light/dark. CSS vars work here because the\n// pieces are appended into the component's own (themed) DOM subtree.\nconst DEFAULT_COLORS = [\n 'var(--malachite-success-background)',\n 'var(--malachite-text-success)',\n 'var(--malachite-tag-primary-foreground)',\n 'var(--malachite-warning-background)',\n 'var(--malachite-error-background)',\n];\n\n/** Joins the palette into a content key; NUL cannot occur in a CSS colour value. */\nconst COLORS_KEY_SEPARATOR = '\\u0000';\n\n/**\n * `window.matchMedia` is absent under SSR and in older test environments. When it cannot\n * be consulted, assume reduced motion — skipping a decorative burst is the safe default.\n */\nconst prefersReducedMotion = (): boolean => {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n return true;\n }\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n};\n\nexport interface ConfettiProps {\n /** Number of confetti pieces. */\n count?: number;\n /** Colors cycled across the pieces. */\n colors?: string[];\n className?: string;\n}\n\n// Dependency-free confetti burst via the Web Animations API. Uses WAAPI (not Tailwind\n// transform utilities) so it works inside the shadow DOM, and respects\n// prefers-reduced-motion. Fires once on mount.\nconst Confetti: React.FC<ConfettiProps> = ({\n count = 150,\n colors = DEFAULT_COLORS,\n className = '',\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n\n // Keyed on the palette's contents, not the array's identity: an inline\n // `colors={['red', 'blue']}` is a new array every render and would re-fire the burst.\n const colorsKey = colors.join(COLORS_KEY_SEPARATOR);\n\n useEffect(() => {\n const container = ref.current;\n if (!container) return;\n if (prefersReducedMotion()) return;\n\n const palette = colorsKey.split(COLORS_KEY_SEPARATOR);\n\n const pieces = Array.from({ length: count }, (_, i) => {\n const piece = document.createElement('div');\n const size = 10 + ((i * 7) % 10);\n piece.style.cssText = `position:absolute;top:-5%;left:${(i * 37) % 100}%;width:${size}px;height:${Math.round(size * 0.5)}px;background:${palette[i % palette.length]};border-radius:2px;`;\n container.appendChild(piece);\n\n const xDrift = (((i * 53) % 100) - 50) * 4;\n const rotation = 360 + ((i * 47) % 720);\n piece.animate(\n [\n { transform: 'translate(0, 0) rotate(0deg)', opacity: 1 },\n {\n transform: `translate(${xDrift}px, 105vh) rotate(${rotation}deg)`,\n opacity: 1,\n offset: 0.9,\n },\n { transform: `translate(${xDrift}px, 110vh) rotate(${rotation}deg)`, opacity: 0 },\n ],\n {\n duration: 2600 + ((i * 17) % 1600),\n delay: (i * 11) % 500,\n easing: 'cubic-bezier(0.2, 0.6, 0.4, 1)',\n fill: 'forwards',\n },\n );\n return piece;\n });\n\n return () => {\n for (const piece of pieces) piece.remove();\n };\n }, [count, colorsKey]);\n\n return (\n <div\n ref={ref}\n aria-hidden\n className={`pointer-events-none fixed inset-0 overflow-hidden z-50 ${className}`}\n />\n );\n};\n\nexport default Confetti;\nexport { Confetti };\n"],"names":["DEFAULT_COLORS","COLORS_KEY_SEPARATOR","prefersReducedMotion","Confetti","count","colors","className","ref","useRef","colorsKey","useEffect","container","palette","pieces","_","i","piece","size","xDrift","rotation","jsx"],"mappings":";;AAIA,MAAMA,IAAiB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAGMC,IAAuB,MAMvBC,IAAuB,MACrB,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,aACvD,KAEJ,OAAO,WAAW,kCAAkC,EAAE,SAc3DC,IAAoC,CAAC;AAAA,EACvC,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAASL;AAAA,EACT,WAAAM,IAAY;AAChB,MAAM;AACF,QAAMC,IAAMC,EAAuB,IAAI,GAIjCC,IAAYJ,EAAO,KAAKJ,CAAoB;AAElD,SAAAS,EAAU,MAAM;AACZ,UAAMC,IAAYJ,EAAI;AAEtB,QADI,CAACI,KACDT,IAAwB;AAE5B,UAAMU,IAAUH,EAAU,MAAMR,CAAoB,GAE9CY,IAAS,MAAM,KAAK,EAAE,QAAQT,EAAA,GAAS,CAACU,GAAGC,MAAM;AACnD,YAAMC,IAAQ,SAAS,cAAc,KAAK,GACpCC,IAAO,KAAOF,IAAI,IAAK;AAC7B,MAAAC,EAAM,MAAM,UAAU,kCAAmCD,IAAI,KAAM,GAAG,WAAWE,CAAI,aAAa,KAAK,MAAMA,IAAO,GAAG,CAAC,iBAAiBL,EAAQG,IAAIH,EAAQ,MAAM,CAAC,uBACpKD,EAAU,YAAYK,CAAK;AAE3B,YAAME,KAAYH,IAAI,KAAM,MAAO,MAAM,GACnCI,IAAW,MAAQJ,IAAI,KAAM;AACnC,aAAAC,EAAM;AAAA,QACF;AAAA,UACI,EAAE,WAAW,gCAAgC,SAAS,EAAA;AAAA,UACtD;AAAA,YACI,WAAW,aAAaE,CAAM,qBAAqBC,CAAQ;AAAA,YAC3D,SAAS;AAAA,YACT,QAAQ;AAAA,UAAA;AAAA,UAEZ,EAAE,WAAW,aAAaD,CAAM,qBAAqBC,CAAQ,QAAQ,SAAS,EAAA;AAAA,QAAE;AAAA,QAEpF;AAAA,UACI,UAAU,OAASJ,IAAI,KAAM;AAAA,UAC7B,OAAQA,IAAI,KAAM;AAAA,UAClB,QAAQ;AAAA,UACR,MAAM;AAAA,QAAA;AAAA,MACV,GAEGC;AAAA,IACX,CAAC;AAED,WAAO,MAAM;AACT,iBAAWA,KAASH,EAAQ,CAAAG,EAAM,OAAA;AAAA,IACtC;AAAA,EACJ,GAAG,CAACZ,GAAOK,CAAS,CAAC,GAGjB,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAAb;AAAA,MACA,eAAW;AAAA,MACX,WAAW,0DAA0DD,CAAS;AAAA,IAAA;AAAA,EAAA;AAG1F;"}
1
+ {"version":3,"file":"Confetti.js","sources":["../../src/components/Confetti.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport {\n type ConfettiViewport,\n createPieces,\n isFinished,\n isLaunched,\n opacityOf,\n stepPiece,\n wobbleOf,\n} from './confettiPhysics';\n\n// Theme tokens, resolved in the component's own subtree so they follow light and dark. Green\n// leads (listed twice), with the brand's blue and purple; no status colours, which would read\n// as a warning in the middle of a celebration.\nconst DEFAULT_COLORS = [\n 'var(--malachite-accent-background, rgb(0, 175, 102))',\n 'var(--malachite-accent-background, rgb(0, 175, 102))',\n 'var(--malachite-accent-foreground, rgb(2, 122, 66))',\n 'var(--malachite-tag-primary-foreground, rgb(37, 130, 234))',\n 'var(--malachite-tag-assistant-foreground, rgb(110, 86, 207))',\n];\n\n/** Joins the palette into a content key; NUL cannot occur in a CSS colour value. */\nconst COLORS_KEY_SEPARATOR = '\\u0000';\n\n// The face turned away from the viewer is drawn this much darker, so a tumbling piece flashes.\nconst BACK_FACE_SHADE = 0.72;\n// A frame after a stall (a background tab) is stepped as this much time at most, so pieces do\n// not teleport.\nconst MAX_FRAME_SECONDS = 1 / 30;\n\n/**\n * `window.matchMedia` is absent under SSR and in older test environments. When it cannot\n * be consulted, assume reduced motion — skipping a decorative burst is the safe default.\n */\nconst prefersReducedMotion = (): boolean => {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n return true;\n }\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n};\n\ninterface ResolvedColor {\n front: string;\n back: string;\n}\n\n// A canvas cannot read `var()`, so each colour is resolved through a probe in this subtree,\n// where the theme's custom properties apply.\nconst resolveColors = (probe: HTMLElement, palette: string[]): ResolvedColor[] =>\n palette.map((color) => {\n probe.style.color = color;\n const front = getComputedStyle(probe).color || color;\n const channels = front.match(/rgba?\\(\\s*([\\d.]+)[\\s,]+([\\d.]+)[\\s,]+([\\d.]+)/);\n const back = channels\n ? `rgb(${channels\n .slice(1, 4)\n .map((channel) => Math.round(Number(channel) * BACK_FACE_SHADE))\n .join(', ')})`\n : front;\n return { front, back };\n });\n\nexport interface ConfettiProps {\n /** Number of confetti pieces, split between the two cannons. */\n count?: number;\n /** Colors picked at random across the pieces; list one twice to weight it. */\n colors?: string[];\n className?: string;\n}\n\n// A burst from two cannons at the bottom corners, drawn on one canvas: the pieces are thrown up\n// against gravity and air drag, then flutter down, tumbling, and fade. Fires once on mount and\n// skips entirely under prefers-reduced-motion; it is aria-hidden decoration carrying nothing.\nconst Confetti: React.FC<ConfettiProps> = ({\n count = 150,\n colors = DEFAULT_COLORS,\n className = '',\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const probeRef = useRef<HTMLSpanElement>(null);\n\n // Keyed on the palette's contents, not the array's identity: an inline\n // `colors={['red', 'blue']}` is a new array every render and would re-fire the burst.\n const colorsKey = colors.join(COLORS_KEY_SEPARATOR);\n\n useEffect(() => {\n const container = ref.current;\n const canvas = canvasRef.current;\n const probe = probeRef.current;\n if (!container || !canvas || !probe || prefersReducedMotion()) return;\n const context = canvas.getContext('2d');\n if (!context) return;\n\n const palette = resolveColors(probe, colorsKey.split(COLORS_KEY_SEPARATOR));\n const bounds = container.getBoundingClientRect();\n const viewport: ConfettiViewport = { width: bounds.width, height: bounds.height };\n const pixelRatio = window.devicePixelRatio || 1;\n canvas.width = Math.round(viewport.width * pixelRatio);\n canvas.height = Math.round(viewport.height * pixelRatio);\n\n const pieces = createPieces(count, palette.length, viewport);\n const state = { frame: 0, last: performance.now() };\n\n const draw = (now: number): void => {\n const seconds = Math.min((now - state.last) / 1000, MAX_FRAME_SECONDS);\n state.last = now;\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.clearRect(0, 0, canvas.width, canvas.height);\n\n const live = pieces.filter((piece) => {\n stepPiece(piece, seconds);\n return !isFinished(piece, viewport);\n });\n for (const piece of live.filter(isLaunched)) {\n const turn = Math.cos(piece.tilt);\n const color = palette[piece.colorIndex];\n context.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n context.translate(piece.x + wobbleOf(piece), piece.y);\n context.rotate(piece.rotation);\n context.scale(1, turn);\n context.globalAlpha = opacityOf(piece);\n context.fillStyle = turn >= 0 ? color.front : color.back;\n context.fillRect(-piece.width / 2, -piece.height / 2, piece.width, piece.height);\n }\n\n pieces.splice(0, pieces.length, ...live);\n if (pieces.length > 0) {\n state.frame = requestAnimationFrame(draw);\n }\n };\n state.frame = requestAnimationFrame(draw);\n\n return () => {\n cancelAnimationFrame(state.frame);\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.clearRect(0, 0, canvas.width, canvas.height);\n };\n }, [count, colorsKey]);\n\n return (\n <div\n ref={ref}\n aria-hidden\n className={`pointer-events-none fixed inset-0 overflow-hidden z-50 ${className}`}\n >\n <canvas ref={canvasRef} style={{ width: '100%', height: '100%', display: 'block' }} />\n <span ref={probeRef} style={{ display: 'none' }} />\n </div>\n );\n};\n\nexport default Confetti;\nexport { Confetti };\n"],"names":["DEFAULT_COLORS","COLORS_KEY_SEPARATOR","BACK_FACE_SHADE","MAX_FRAME_SECONDS","prefersReducedMotion","resolveColors","probe","palette","color","front","channels","back","channel","Confetti","count","colors","className","ref","useRef","canvasRef","probeRef","colorsKey","useEffect","container","canvas","context","bounds","viewport","pixelRatio","pieces","createPieces","state","draw","now","seconds","live","piece","stepPiece","isFinished","isLaunched","turn","wobbleOf","opacityOf","jsxs","jsx"],"mappings":";;;AAcA,MAAMA,IAAiB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAGMC,IAAuB,MAGvBC,IAAkB,MAGlBC,IAAoB,IAAI,IAMxBC,IAAuB,MACrB,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,aACvD,KAEJ,OAAO,WAAW,kCAAkC,EAAE,SAU3DC,IAAgB,CAACC,GAAoBC,MACvCA,EAAQ,IAAI,CAACC,MAAU;AACnB,EAAAF,EAAM,MAAM,QAAQE;AACpB,QAAMC,IAAQ,iBAAiBH,CAAK,EAAE,SAASE,GACzCE,IAAWD,EAAM,MAAM,gDAAgD,GACvEE,IAAOD,IACP,OAAOA,EACF,MAAM,GAAG,CAAC,EACV,IAAI,CAACE,MAAY,KAAK,MAAM,OAAOA,CAAO,IAAIV,CAAe,CAAC,EAC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,KAAKxB,GAAU,OAAO,EAAE,SAAS,SAAO,CAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG7D;"}
@@ -0,0 +1,37 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import n from "./CustomIcons/CheckCircleFilled.js";
3
+ import m from "./CustomIcons/CopyIcon.js";
4
+ import d from "./Tooltip.js";
5
+ import { useClipboardCopy as p } from "./useClipboardCopy.js";
6
+ const g = ({
7
+ value: e,
8
+ onCopy: o,
9
+ copied: c,
10
+ "aria-label": s = "Copy",
11
+ tooltip: t
12
+ }) => {
13
+ const { outcome: a, copy: l } = p(e), i = /* @__PURE__ */ r(
14
+ "button",
15
+ {
16
+ onClick: async () => {
17
+ (e === void 0 || await l(e)) && (o == null || o());
18
+ },
19
+ type: "button",
20
+ "aria-label": s,
21
+ className: "flex items-center justify-center w-5 h-5 hover:bg-[var(--malachite-primary-border)] rounded transition-colors flex-shrink-0 cursor-pointer",
22
+ children: c ?? a === "copied" ? /* @__PURE__ */ r(
23
+ n,
24
+ {
25
+ size: 16,
26
+ style: { color: "var(--malachite-success-foreground)" }
27
+ }
28
+ ) : /* @__PURE__ */ r(m, { size: 16 })
29
+ }
30
+ );
31
+ return t ? /* @__PURE__ */ r(d, { text: t, describesTrigger: !1, children: i }) : i;
32
+ };
33
+ export {
34
+ g as CopyButton,
35
+ g as default
36
+ };
37
+ //# sourceMappingURL=CopyButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyButton.js","sources":["../../src/components/CopyButton.tsx"],"sourcesContent":["import type React from 'react';\nimport CheckCircleFilled from './CustomIcons/CheckCircleFilled';\nimport CopyIcon from './CustomIcons/CopyIcon';\nimport Tooltip from './Tooltip';\nimport { useClipboardCopy } from './useClipboardCopy';\n\nexport interface CopyButtonProps {\n /** Copied on click, after which the button shows a check for a beat. */\n value?: string;\n /**\n * Called once `value` is on the clipboard: a toast, say. Not called when the copy fails or\n * the clipboard is out of reach (outside a secure context). Without `value` it is called on\n * click and the copy is the caller's.\n */\n onCopy?: () => void;\n /** Shows the check, for a caller that tracks the copy itself. */\n copied?: boolean;\n /** Default: `Copy`. */\n 'aria-label'?: string;\n tooltip?: string;\n}\n\n/**\n * The small copy control a copyable `Input` ends with, for a copyable value that is not an\n * input — a list of scopes beside its label, say — so the two read the same.\n */\nconst CopyButton: React.FC<CopyButtonProps> = ({\n value,\n onCopy,\n copied: copiedByCaller,\n 'aria-label': ariaLabel = 'Copy',\n tooltip,\n}) => {\n const { outcome, copy } = useClipboardCopy(value);\n const copied = copiedByCaller ?? outcome === 'copied';\n\n const button = (\n <button\n onClick={async () => {\n if (value === undefined || (await copy(value))) {\n onCopy?.();\n }\n }}\n type=\"button\"\n aria-label={ariaLabel}\n className=\"flex items-center justify-center w-5 h-5 hover:bg-[var(--malachite-primary-border)] rounded transition-colors flex-shrink-0 cursor-pointer\"\n >\n {copied ? (\n <CheckCircleFilled\n size={16}\n style={{ color: 'var(--malachite-success-foreground)' }}\n />\n ) : (\n <CopyIcon size={16} />\n )}\n </button>\n );\n\n return tooltip ? (\n <Tooltip text={tooltip} describesTrigger={false}>\n {button}\n </Tooltip>\n ) : (\n button\n );\n};\n\nexport default CopyButton;\nexport { CopyButton };\n"],"names":["CopyButton","value","onCopy","copiedByCaller","ariaLabel","tooltip","outcome","copy","useClipboardCopy","button","jsx","CheckCircleFilled","CopyIcon","Tooltip"],"mappings":";;;;;AA0BA,MAAMA,IAAwC,CAAC;AAAA,EAC3C,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAQC;AAAA,EACR,cAAcC,IAAY;AAAA,EAC1B,SAAAC;AACJ,MAAM;AACF,QAAM,EAAE,SAAAC,GAAS,MAAAC,MAASC,EAAiBP,CAAK,GAG1CQ,IACF,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,SAAS,YAAY;AACjB,SAAIT,MAAU,UAAc,MAAMM,EAAKN,CAAK,OACxCC,KAAA,QAAAA;AAAA,MAER;AAAA,MACA,MAAK;AAAA,MACL,cAAYE;AAAA,MACZ,WAAU;AAAA,MAET,UAbMD,KAAkBG,MAAY,WAcjC,gBAAAI;AAAA,QAACC;AAAA,QAAA;AAAA,UACG,MAAM;AAAA,UACN,OAAO,EAAE,OAAO,sCAAA;AAAA,QAAsC;AAAA,MAAA,IAG1D,gBAAAD,EAACE,GAAA,EAAS,MAAM,GAAA,CAAI;AAAA,IAAA;AAAA,EAAA;AAKhC,SAAOP,sBACFQ,GAAA,EAAQ,MAAMR,GAAS,kBAAkB,IACrC,aACL,IAEAI;AAER;"}
@@ -0,0 +1,21 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import f from "../../assets/icons/arrow_line_left.svg.js";
3
+ const i = ({
4
+ size: o = 16,
5
+ className: r = "",
6
+ style: t = {},
7
+ onClick: n
8
+ }) => {
9
+ const e = {
10
+ width: typeof o == "number" ? `${o}px` : o,
11
+ height: typeof o == "number" ? `${o}px` : o,
12
+ display: "inline-block",
13
+ fill: "currentColor",
14
+ ...t
15
+ };
16
+ return /* @__PURE__ */ l(f, { className: r, style: e, onClick: n });
17
+ };
18
+ export {
19
+ i as default
20
+ };
21
+ //# sourceMappingURL=ArrowLineLeftIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrowLineLeftIcon.js","sources":["../../../src/components/CustomIcons/ArrowLineLeftIcon.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport ArrowLineLeftIconSvg from '../../assets/icons/arrow_line_left.svg?react';\n\nexport interface IconProps {\n size?: number | string;\n className?: string;\n style?: CSSProperties;\n onClick?: () => void;\n}\n\nconst ArrowLineLeftIcon: React.FC<IconProps> = ({\n size = 16,\n className = '',\n style = {},\n onClick,\n}) => {\n const iconStyle: CSSProperties = {\n width: typeof size === 'number' ? `${size}px` : size,\n height: typeof size === 'number' ? `${size}px` : size,\n display: 'inline-block',\n fill: 'currentColor',\n ...style,\n };\n\n return <ArrowLineLeftIconSvg className={className} style={iconStyle} onClick={onClick} />;\n};\n\nexport default ArrowLineLeftIcon;\n"],"names":["ArrowLineLeftIcon","size","className","style","onClick","iconStyle","jsx","ArrowLineLeftIconSvg"],"mappings":";;AAUA,MAAMA,IAAyC,CAAC;AAAA,EAC5C,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ,CAAA;AAAA,EACR,SAAAC;AACJ,MAAM;AACF,QAAMC,IAA2B;AAAA,IAC7B,OAAO,OAAOJ,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IAChD,QAAQ,OAAOA,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IACjD,SAAS;AAAA,IACT,MAAM;AAAA,IACN,GAAGE;AAAA,EAAA;AAGP,SAAO,gBAAAG,EAACC,GAAA,EAAqB,WAAAL,GAAsB,OAAOG,GAAW,SAAAD,GAAkB;AAC3F;"}
@@ -0,0 +1,21 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import i from "../../assets/icons/arrow_line_right.svg.js";
3
+ const f = ({
4
+ size: o = 16,
5
+ className: r = "",
6
+ style: t = {},
7
+ onClick: n
8
+ }) => {
9
+ const e = {
10
+ width: typeof o == "number" ? `${o}px` : o,
11
+ height: typeof o == "number" ? `${o}px` : o,
12
+ display: "inline-block",
13
+ fill: "currentColor",
14
+ ...t
15
+ };
16
+ return /* @__PURE__ */ l(i, { className: r, style: e, onClick: n });
17
+ };
18
+ export {
19
+ f as default
20
+ };
21
+ //# sourceMappingURL=ArrowLineRightIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrowLineRightIcon.js","sources":["../../../src/components/CustomIcons/ArrowLineRightIcon.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport ArrowLineRightIconSvg from '../../assets/icons/arrow_line_right.svg?react';\n\nexport interface IconProps {\n size?: number | string;\n className?: string;\n style?: CSSProperties;\n onClick?: () => void;\n}\n\nconst ArrowLineRightIcon: React.FC<IconProps> = ({\n size = 16,\n className = '',\n style = {},\n onClick,\n}) => {\n const iconStyle: CSSProperties = {\n width: typeof size === 'number' ? `${size}px` : size,\n height: typeof size === 'number' ? `${size}px` : size,\n display: 'inline-block',\n fill: 'currentColor',\n ...style,\n };\n\n return <ArrowLineRightIconSvg className={className} style={iconStyle} onClick={onClick} />;\n};\n\nexport default ArrowLineRightIcon;\n"],"names":["ArrowLineRightIcon","size","className","style","onClick","iconStyle","jsx","ArrowLineRightIconSvg"],"mappings":";;AAUA,MAAMA,IAA0C,CAAC;AAAA,EAC7C,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ,CAAA;AAAA,EACR,SAAAC;AACJ,MAAM;AACF,QAAMC,IAA2B;AAAA,IAC7B,OAAO,OAAOJ,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IAChD,QAAQ,OAAOA,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IACjD,SAAS;AAAA,IACT,MAAM;AAAA,IACN,GAAGE;AAAA,EAAA;AAGP,SAAO,gBAAAG,EAACC,GAAA,EAAsB,WAAAL,GAAsB,OAAOG,GAAW,SAAAD,GAAkB;AAC5F;"}
@@ -0,0 +1,16 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import e from "../../assets/icons/book.svg.js";
3
+ const m = ({ size: o = 16, className: t = "", style: r = {}, onClick: n }) => {
4
+ const l = {
5
+ width: typeof o == "number" ? `${o}px` : o,
6
+ height: typeof o == "number" ? `${o}px` : o,
7
+ display: "inline-block",
8
+ fill: "currentColor",
9
+ ...r
10
+ };
11
+ return /* @__PURE__ */ p(e, { className: t, style: l, onClick: n });
12
+ };
13
+ export {
14
+ m as default
15
+ };
16
+ //# sourceMappingURL=BookIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BookIcon.js","sources":["../../../src/components/CustomIcons/BookIcon.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport BookIconSvg from '../../assets/icons/book.svg?react';\n\nexport interface IconProps {\n size?: number | string;\n className?: string;\n style?: CSSProperties;\n onClick?: () => void;\n}\n\nconst BookIcon: React.FC<IconProps> = ({ size = 16, className = '', style = {}, onClick }) => {\n const iconStyle: CSSProperties = {\n width: typeof size === 'number' ? `${size}px` : size,\n height: typeof size === 'number' ? `${size}px` : size,\n display: 'inline-block',\n fill: 'currentColor',\n ...style,\n };\n\n return <BookIconSvg className={className} style={iconStyle} onClick={onClick} />;\n};\n\nexport default BookIcon;\n"],"names":["BookIcon","size","className","style","onClick","iconStyle","jsx","BookIconSvg"],"mappings":";;AAUA,MAAMA,IAAgC,CAAC,EAAE,MAAAC,IAAO,IAAI,WAAAC,IAAY,IAAI,OAAAC,IAAQ,IAAI,SAAAC,QAAc;AAC1F,QAAMC,IAA2B;AAAA,IAC7B,OAAO,OAAOJ,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IAChD,QAAQ,OAAOA,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IACjD,SAAS;AAAA,IACT,MAAM;AAAA,IACN,GAAGE;AAAA,EAAA;AAGP,SAAO,gBAAAG,EAACC,GAAA,EAAY,WAAAL,GAAsB,OAAOG,GAAW,SAAAD,GAAkB;AAClF;"}
@@ -0,0 +1,21 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import l from "../../assets/icons/book_open.svg.js";
3
+ const m = ({
4
+ size: o = 16,
5
+ className: t = "",
6
+ style: n = {},
7
+ onClick: r
8
+ }) => {
9
+ const p = {
10
+ width: typeof o == "number" ? `${o}px` : o,
11
+ height: typeof o == "number" ? `${o}px` : o,
12
+ display: "inline-block",
13
+ fill: "currentColor",
14
+ ...n
15
+ };
16
+ return /* @__PURE__ */ e(l, { className: t, style: p, onClick: r });
17
+ };
18
+ export {
19
+ m as default
20
+ };
21
+ //# sourceMappingURL=BookOpenIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BookOpenIcon.js","sources":["../../../src/components/CustomIcons/BookOpenIcon.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport BookOpenIconSvg from '../../assets/icons/book_open.svg?react';\n\nexport interface IconProps {\n size?: number | string;\n className?: string;\n style?: CSSProperties;\n onClick?: () => void;\n}\n\nconst BookOpenIcon: React.FC<IconProps> = ({\n size = 16,\n className = '',\n style = {},\n onClick,\n}) => {\n const iconStyle: CSSProperties = {\n width: typeof size === 'number' ? `${size}px` : size,\n height: typeof size === 'number' ? `${size}px` : size,\n display: 'inline-block',\n fill: 'currentColor',\n ...style,\n };\n\n return <BookOpenIconSvg className={className} style={iconStyle} onClick={onClick} />;\n};\n\nexport default BookOpenIcon;\n"],"names":["BookOpenIcon","size","className","style","onClick","iconStyle","jsx","BookOpenIconSvg"],"mappings":";;AAUA,MAAMA,IAAoC,CAAC;AAAA,EACvC,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ,CAAA;AAAA,EACR,SAAAC;AACJ,MAAM;AACF,QAAMC,IAA2B;AAAA,IAC7B,OAAO,OAAOJ,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IAChD,QAAQ,OAAOA,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IACjD,SAAS;AAAA,IACT,MAAM;AAAA,IACN,GAAGE;AAAA,EAAA;AAGP,SAAO,gBAAAG,EAACC,GAAA,EAAgB,WAAAL,GAAsB,OAAOG,GAAW,SAAAD,GAAkB;AACtF;"}