@netlify/spark-ui 1.4.5 → 1.5.0-alpha.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 (52) hide show
  1. package/dist/assets/AskNetlify.css +1 -0
  2. package/dist/assets/Orb.css +1 -0
  3. package/dist/assets/SearchLink.css +1 -1
  4. package/dist/assets/SearchModal.css +1 -1
  5. package/dist/chunks/compat.module.BNbXPLVY.js +298 -0
  6. package/dist/chunks/hooks.module.DGkdD5n9.js +177 -0
  7. package/dist/chunks/{useTimeout.YR4eKwj7.js → useTimeout.Cq4aqnDe.js} +1 -1
  8. package/dist/components/index.d.ts +1 -0
  9. package/dist/components/preact/AskNetlify/AskNetlify.d.ts +2 -0
  10. package/dist/components/preact/AskNetlify/AskNetlify.js +5653 -0
  11. package/dist/components/preact/Modal/Modal.js +1 -1
  12. package/dist/components/preact/Orb/Orb.d.ts +2 -0
  13. package/dist/components/preact/Orb/Orb.js +5 -0
  14. package/dist/components/preact/SearchModal/components/SearchInput.d.ts +2 -0
  15. package/dist/components/preact/SearchModal/components/SearchInput.js +2 -2
  16. package/dist/components/preact/SearchModal/components/SearchLink/SearchLink.d.ts +1 -1
  17. package/dist/components/preact/SearchModal/components/SearchLink/SearchLink.js +35 -17
  18. package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +81 -51
  19. package/dist/components/preact/SearchModal/components/SearchToggle/SearchToggle.js +1 -1
  20. package/dist/components/preact/SearchModal/components/SearchWindow.d.ts +1 -1
  21. package/dist/components/preact/SearchModal/components/SearchWindow.js +46 -30
  22. package/dist/components/preact/SearchModal/hooks/useKeyboardNav.js +6 -6
  23. package/dist/components/preact/SearchModal/hooks/useSearch.js +2 -2
  24. package/dist/components/preact/SearchModal/hooks/useSearchHotkeys.js +1 -1
  25. package/dist/components/preact/SearchModal/hooks/useSearchLogger.js +1 -1
  26. package/dist/components/preact/SearchModal/hooks/useSearchParams.js +1 -1
  27. package/dist/components/preact/SearchModal/hooks/useSearchToggles.js +1 -1
  28. package/dist/components/preact/SearchModal/types/search.types.d.ts +6 -1
  29. package/dist/components/preact/index.d.ts +1 -0
  30. package/dist/components/preact/index.js +7 -5
  31. package/dist/utils/handleThemeChange.d.ts +1 -0
  32. package/package.json +4 -2
  33. package/packages/components/CodeBlock.astro +1 -1
  34. package/packages/components/index.ts +1 -0
  35. package/packages/components/preact/AskNetlify/AskNetlify.css +168 -0
  36. package/packages/components/preact/AskNetlify/AskNetlify.tsx +126 -0
  37. package/packages/components/preact/Orb/Orb.css +94 -0
  38. package/packages/components/preact/Orb/Orb.tsx +7 -0
  39. package/packages/components/preact/SearchModal/components/SearchInput.tsx +9 -7
  40. package/packages/components/preact/SearchModal/components/SearchLink/SearchLink.css +7 -2
  41. package/packages/components/preact/SearchModal/components/SearchLink/SearchLink.tsx +27 -7
  42. package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.css +81 -18
  43. package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.tsx +67 -30
  44. package/packages/components/preact/SearchModal/components/SearchWindow.tsx +31 -16
  45. package/packages/components/preact/SearchModal/hooks/useKeyboardNav.ts +2 -2
  46. package/packages/components/preact/SearchModal/types/search.types.tsx +5 -2
  47. package/packages/components/preact/index.ts +1 -0
  48. package/packages/styles/tokens.css +28 -0
  49. package/packages/utils/handleThemeChange.ts +11 -0
  50. package/dist/chunks/compat.module.DJD78v1z.js +0 -175
  51. package/dist/chunks/hooks.module.D9IrxdEh.js +0 -138
  52. package/packages/themes/poimandres.json +0 -311
@@ -1,5 +1,5 @@
1
1
  import { u as l } from "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import { D as d } from "../../../chunks/compat.module.DJD78v1z.js";
2
+ import { D as d } from "../../../chunks/compat.module.BNbXPLVY.js";
3
3
  const u = d(function({ children: o, className: r, ...a }, t) {
4
4
  return /* @__PURE__ */ l("dialog", { ref: t, className: r, role: "dialog", "aria-modal": "true", ...a, children: o });
5
5
  });
@@ -0,0 +1,2 @@
1
+ declare const Orb: () => import("preact").JSX.Element;
2
+ export default Orb;
@@ -0,0 +1,5 @@
1
+ import { u as r } from "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
+ import '../../../assets/Orb.css';const t = () => /* @__PURE__ */ r("div", { class: "orb" });
3
+ export {
4
+ t as default
5
+ };
@@ -2,6 +2,8 @@ interface Props {
2
2
  setSearchTerm: (term: string) => void;
3
3
  placeholder?: string;
4
4
  initialValue?: string;
5
+ isGeneratingAnswer?: boolean;
6
+ isPreparingAnswer?: boolean;
5
7
  }
6
8
  declare const SearchInput: (props: Props) => import("preact").JSX.Element;
7
9
  export default SearchInput;
@@ -1,6 +1,6 @@
1
1
  import { u as e } from "../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import { d as u, y as h } from "../../../../chunks/hooks.module.D9IrxdEh.js";
3
- import { u as o } from "../../../../chunks/useTimeout.YR4eKwj7.js";
2
+ import { d as u, y as h } from "../../../../chunks/hooks.module.DGkdD5n9.js";
3
+ import { u as o } from "../../../../chunks/useTimeout.Cq4aqnDe.js";
4
4
  import d from "../../Icon/index.js";
5
5
  const I = (a) => {
6
6
  const [r, t] = u(""), { reset: c, run: i } = o((l) => {
@@ -1,3 +1,3 @@
1
1
  import { SearchLinkProps } from '../../types/search.types';
2
- declare const SearchLink: ({ icon, label, url, excerpt, resource }: SearchLinkProps) => import("preact").JSX.Element;
2
+ declare const SearchLink: ({ as: Component, icon, label, url, excerpt, resource, onClick, }: SearchLinkProps) => import("preact").JSX.Element;
3
3
  export default SearchLink;
@@ -1,22 +1,40 @@
1
1
  import { u as a } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import "../../../../../chunks/hooks.module.D9IrxdEh.js";
3
- import { useSearchLogger as h } from "../../hooks/useSearchLogger.js";
2
+ import "../../../../../chunks/hooks.module.DGkdD5n9.js";
3
+ import { useSearchLogger as d } from "../../hooks/useSearchLogger.js";
4
4
  import c from "../../../Icon/index.js";
5
- import '../../../../../assets/SearchLink.css';const k = ({ icon: n, label: s, url: r, excerpt: l, resource: e }) => {
6
- const { handleClick: i } = h();
7
- return /* @__PURE__ */ a("a", { className: "n-search-link", href: r, onClick: i, children: [
8
- n && /* @__PURE__ */ a("span", { className: "n-search-link-icon", children: /* @__PURE__ */ a(c, { name: n }) }),
9
- /* @__PURE__ */ a("div", { className: "n-search-link-body", children: [
10
- /* @__PURE__ */ a("p", { className: "n-search-link-title", children: [
11
- /* @__PURE__ */ a("span", { className: "n-search-link-label", children: s }),
12
- " ",
13
- e && /* @__PURE__ */ a("span", { className: "n-search-link-badge", "data-resource": e, children: e })
14
- ] }),
15
- l && /* @__PURE__ */ a("p", { className: "n-search-link-excerpt", dangerouslySetInnerHTML: { __html: l } })
16
- ] }),
17
- /* @__PURE__ */ a("div", { className: "n-search-link-icon", children: /* @__PURE__ */ a(c, { name: "caretRight" }) })
18
- ] });
5
+ import '../../../../../assets/SearchLink.css';const g = ({
6
+ as: r = "a",
7
+ icon: n,
8
+ label: i,
9
+ url: h,
10
+ excerpt: l,
11
+ resource: e,
12
+ onClick: s
13
+ }) => {
14
+ const { handleClick: m } = d();
15
+ return /* @__PURE__ */ a(
16
+ r,
17
+ {
18
+ className: "n-search-link",
19
+ href: h,
20
+ onClick: (t) => {
21
+ s && s(), m(t);
22
+ },
23
+ children: [
24
+ n && /* @__PURE__ */ a("span", { className: "n-search-link-icon", children: /* @__PURE__ */ a(c, { name: n }) }),
25
+ /* @__PURE__ */ a("div", { className: "n-search-link-body", children: [
26
+ /* @__PURE__ */ a("p", { className: "n-search-link-title", children: [
27
+ /* @__PURE__ */ a("span", { className: "n-search-link-label", children: i }),
28
+ " ",
29
+ e && /* @__PURE__ */ a("span", { className: "n-search-link-badge", "data-resource": e, children: e })
30
+ ] }),
31
+ l && /* @__PURE__ */ a("p", { className: "n-search-link-excerpt", dangerouslySetInnerHTML: { __html: l } })
32
+ ] }),
33
+ /* @__PURE__ */ a("div", { className: "n-search-link-icon", children: /* @__PURE__ */ a(c, { name: "caretRight" }) })
34
+ ]
35
+ }
36
+ );
19
37
  };
20
38
  export {
21
- k as default
39
+ g as default
22
40
  };
@@ -1,63 +1,93 @@
1
1
  import { u as e } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import { A as v, y as u, d as S } from "../../../../../chunks/hooks.module.D9IrxdEh.js";
3
- import L from "../../../Modal/Modal.js";
4
- import d from "../../../KeyboardKey/KeyboardKey.js";
5
- import k from "../SearchWindow.js";
6
- import w from "../SearchInput.js";
7
- import { useSearch as I } from "../../hooks/useSearch.js";
8
- import { useSearchLogger as b } from "../../hooks/useSearchLogger.js";
9
- import { useKeyboardNav as O } from "../../hooks/useKeyboardNav.js";
10
- import { useSearchHotkeys as P } from "../../hooks/useSearchHotkeys.js";
11
- import { useSearchParams as E } from "../../hooks/useSearchParams.js";
12
- import { useSearchToggles as K } from "../../hooks/useSearchToggles.js";
13
- import '../../../../../assets/SearchModal.css';function M(o) {
14
- const r = v(null);
2
+ import { A as N, y as u, d as m } from "../../../../../chunks/hooks.module.DGkdD5n9.js";
3
+ import b from "../../../Modal/Modal.js";
4
+ import h from "../../../KeyboardKey/KeyboardKey.js";
5
+ import M from "../SearchWindow.js";
6
+ import O from "../SearchInput.js";
7
+ import { useSearch as P } from "../../hooks/useSearch.js";
8
+ import { useSearchLogger as A } from "../../hooks/useSearchLogger.js";
9
+ import { useKeyboardNav as E } from "../../hooks/useKeyboardNav.js";
10
+ import { useSearchHotkeys as K } from "../../hooks/useSearchHotkeys.js";
11
+ import { useSearchParams as q } from "../../hooks/useSearchParams.js";
12
+ import { useSearchToggles as C } from "../../hooks/useSearchToggles.js";
13
+ import F from "../../../AskNetlify/AskNetlify.js";
14
+ import { Fragment as Q } from "preact";
15
+ import '../../../../../assets/SearchModal.css';function R(c) {
16
+ const r = N(null);
15
17
  return u(() => {
16
- function t(i) {
17
- r.current && !r.current.contains(i.target) && o();
18
+ function i(t) {
19
+ r.current && !r.current.contains(t.target) && c();
18
20
  }
19
- return document.addEventListener("mousedown", t), () => {
20
- document.removeEventListener("mousedown", t);
21
+ return document.addEventListener("mousedown", i), () => {
22
+ document.removeEventListener("mousedown", i);
21
23
  };
22
- }, [o]), r;
24
+ }, [c]), r;
23
25
  }
24
- function B(o = { className: "", children: null, debug: !1 }) {
25
- const [r, t] = S(!1);
26
+ function Z(c = { className: "", children: null, debug: !1 }) {
27
+ const [r, i] = m(!1), [t, p] = m({ current: "search" }), [k, v] = m("");
26
28
  u(() => {
27
- let c;
28
- const g = () => {
29
- window.pagefind && (t(!0), c && clearInterval(c));
29
+ let a;
30
+ const o = () => {
31
+ window.pagefind && (i(!0), a && clearInterval(a));
30
32
  };
31
- return g(), c = setInterval(g, 100), () => clearInterval(c);
33
+ return o(), a = setInterval(o, 100), () => clearInterval(a);
32
34
  }, []);
33
- const { children: i, className: f, debug: N, ...y } = o, { state: a, actions: h } = I(), [n, p] = S(!1), m = () => p(!0), l = () => p(!1), s = v(null), T = M(l);
34
- return b(a, N), K(r, m), E(r, h.setSearchTerm, m), P(r, n, m, l), O(r, s, n, l), u(() => {
35
- s.current && (n ? s.current.showModal() : s.current.close());
36
- }, [n]), /* @__PURE__ */ e(L, { ref: s, className: `n-search-modal ${f || ""}`, ...y, children: /* @__PURE__ */ e("div", { ref: T, className: "n-search-container", children: [
37
- /* @__PURE__ */ e(w, { setSearchTerm: h.setSearchTerm, initialValue: a.searchTerm }),
38
- /* @__PURE__ */ e(
39
- k,
40
- {
41
- searchLoading: a.isLoading,
42
- searchTerm: a.searchTerm,
43
- results: a.results,
44
- children: i
45
- }
46
- ),
47
- /* @__PURE__ */ e("div", { className: "n-search-footer", children: [
48
- /* @__PURE__ */ e("p", { className: "n-search-footer-tip", children: [
49
- /* @__PURE__ */ e(d, { keyNames: ["Esc"] }),
50
- "to close"
51
- ] }),
52
- /* @__PURE__ */ e("p", { className: "n-search-footer-tip", children: [
53
- /* @__PURE__ */ e(d, { keyNames: ["Tab"] }),
54
- /* @__PURE__ */ e("span", { children: "or" }),
55
- /* @__PURE__ */ e(d, { keyNames: ["↑", "↓"] }),
56
- "to navigate"
35
+ const { children: T, className: S, debug: L, ...w } = c, { state: n, actions: g } = P(), [l, y] = m(!1), d = () => y(!0), f = () => y(!1), s = N(null), I = R(f);
36
+ return A(n, L), C(r, d), q(r, g.setSearchTerm, d), K(r, l, d, f), E(r, s, l, f), u(() => {
37
+ s.current && (l ? s.current.showModal() : s.current.close());
38
+ }, [l]), u(() => {
39
+ var o;
40
+ const a = (o = s.current) == null ? void 0 : o.querySelector("input");
41
+ a && a.focus(), t.current === "ask" ? setTimeout(() => {
42
+ s.current.classList.add("n-search-modal-ask");
43
+ }, 150) : t.current === "search" && setTimeout(() => {
44
+ s.current.classList.remove("n-search-modal-ask");
45
+ }, 150);
46
+ }, [t.current]), /* @__PURE__ */ e(
47
+ b,
48
+ {
49
+ ref: s,
50
+ className: `n-search-modal ${S || ""}`,
51
+ "data-state": t.current,
52
+ ...w,
53
+ children: /* @__PURE__ */ e("div", { ref: I, className: "n-search-container", children: [
54
+ t.current === "ask" && /* @__PURE__ */ e(F, { query: k, setModalState: p }),
55
+ t.current === "search" && /* @__PURE__ */ e(Q, { children: [
56
+ /* @__PURE__ */ e(
57
+ O,
58
+ {
59
+ setSearchTerm: g.setSearchTerm,
60
+ setAskNetlifyQuery: v,
61
+ initialValue: n.searchTerm
62
+ }
63
+ ),
64
+ /* @__PURE__ */ e(
65
+ M,
66
+ {
67
+ setModalState: p,
68
+ searchLoading: n.isLoading,
69
+ searchTerm: n.searchTerm,
70
+ results: n.results,
71
+ children: T
72
+ }
73
+ ),
74
+ /* @__PURE__ */ e("div", { className: "n-search-footer", children: [
75
+ /* @__PURE__ */ e("p", { className: "n-search-footer-tip", children: [
76
+ /* @__PURE__ */ e(h, { keyNames: ["Esc"] }),
77
+ "to closed"
78
+ ] }),
79
+ /* @__PURE__ */ e("p", { className: "n-search-footer-tip", children: [
80
+ /* @__PURE__ */ e(h, { keyNames: ["Tab"] }),
81
+ /* @__PURE__ */ e("span", { children: "or" }),
82
+ /* @__PURE__ */ e(h, { keyNames: ["↑", "↓"] }),
83
+ "to navigate"
84
+ ] })
85
+ ] })
86
+ ] })
57
87
  ] })
58
- ] })
59
- ] }) });
88
+ }
89
+ );
60
90
  }
61
91
  export {
62
- B as default
92
+ Z as default
63
93
  };
@@ -1,5 +1,5 @@
1
1
  import { u as e } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import { D as a } from "../../../../../chunks/compat.module.DJD78v1z.js";
2
+ import { D as a } from "../../../../../chunks/compat.module.BNbXPLVY.js";
3
3
  import o from "../../../Icon/index.js";
4
4
  import '../../../../../assets/SearchToggle.css';const s = a(function(r, t) {
5
5
  return /* @__PURE__ */ e("button", { id: r.id, ref: t, class: "n-search-toggle button", disabled: !0, "data-ntl-search-toggle": !0, children: [
@@ -1,2 +1,2 @@
1
1
  import { SearchWindowProps } from '../types/search.types';
2
- export default function SearchWindow({ searchLoading, searchTerm, results, children: DefaultWindow, }: SearchWindowProps): import("preact").JSX.Element;
2
+ export default function SearchWindow({ setModalState, searchLoading, searchTerm, results, children: DefaultWindow, }: SearchWindowProps): import("preact").JSX.Element;
@@ -1,48 +1,64 @@
1
1
  import { u as e } from "../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import { T as o } from "../../../../chunks/hooks.module.D9IrxdEh.js";
3
- import t from "./SearchHeading/SearchHeading.js";
4
- import a from "./SearchLink/SearchLink.js";
5
- const h = ({
6
- searchLoading: s,
2
+ import { T as m } from "../../../../chunks/hooks.module.DGkdD5n9.js";
3
+ import o from "./SearchHeading/SearchHeading.js";
4
+ import c from "./SearchLink/SearchLink.js";
5
+ import { Fragment as s } from "preact";
6
+ const h = (n) => {
7
+ const r = document.documentElement;
8
+ n === "" ? (r.removeAttribute("data-theme"), localStorage.removeItem("theme")) : (r.setAttribute("data-theme", n), localStorage.setItem("theme", n));
9
+ }, d = ({
10
+ searchLoading: n,
7
11
  searchTerm: r,
8
- results: n
12
+ results: t
9
13
  }) => {
10
- if (s)
11
- return /* @__PURE__ */ e(t, { children: [
14
+ if (n)
15
+ return /* @__PURE__ */ e(o, { children: [
12
16
  "Searching for ",
13
17
  /* @__PURE__ */ e("span", { className: "n-search-term", children: r }),
14
18
  " ..."
15
19
  ] });
16
- if (!n || n.length === 0)
17
- return /* @__PURE__ */ e(t, { children: [
20
+ if (!t || t.length === 0)
21
+ return /* @__PURE__ */ e(o, { children: [
18
22
  "0 results for ",
19
23
  /* @__PURE__ */ e("span", { className: "n-search-term", children: r })
20
24
  ] });
21
- const l = o(() => n.map((i, c) => /* @__PURE__ */ e("li", { className: "n-results-list-item", children: /* @__PURE__ */ e(a, { ...i }) }, c)), [n]);
22
- return /* @__PURE__ */ e("ul", { className: "n-results-list", role: "list", children: l });
25
+ const i = m(() => t.map((l, a) => /* @__PURE__ */ e("li", { className: "n-results-list-item", children: /* @__PURE__ */ e(c, { ...l }) }, a)), [t]);
26
+ return /* @__PURE__ */ e("ul", { className: "n-results-list", role: "list", children: i });
23
27
  };
24
- function p({
25
- searchLoading: s,
26
- searchTerm: r,
27
- results: n,
28
+ function b({
29
+ setModalState: n,
30
+ searchLoading: r,
31
+ searchTerm: t,
32
+ results: i,
28
33
  children: l
29
34
  }) {
30
- return /* @__PURE__ */ e("div", { className: "n-search-window", children: /* @__PURE__ */ e("div", { className: "search-links", children: [
31
- /* @__PURE__ */ e(a, { ...{
32
- icon: "sparkles",
33
- label: "Ask Netlify AI",
34
- url: "https://docs.netlify.com/ask-netlify/"
35
- } }),
36
- r && r.length > 1 ? /* @__PURE__ */ e(
37
- h,
35
+ return /* @__PURE__ */ e("div", { className: "n-search-window", children: /* @__PURE__ */ e("div", { className: "search-links", children: t && t.length > 1 ? /* @__PURE__ */ e(d, { searchLoading: r, searchTerm: t, results: i }) : l ? /* @__PURE__ */ e(s, { children: [
36
+ /* @__PURE__ */ e(
37
+ c,
38
+ {
39
+ as: "button",
40
+ icon: "netlify",
41
+ label: "Ask Netlify AI",
42
+ onClick: () => {
43
+ n({ current: "ask" });
44
+ }
45
+ }
46
+ ),
47
+ l,
48
+ /* @__PURE__ */ e(
49
+ c,
38
50
  {
39
- searchLoading: s,
40
- searchTerm: r,
41
- results: n
51
+ as: "button",
52
+ icon: "netlify",
53
+ label: "Toggle theme",
54
+ onClick: () => {
55
+ const a = document.documentElement.getAttribute("data-theme");
56
+ h(a === "dark" ? "light" : "dark");
57
+ }
42
58
  }
43
- ) : l || null
44
- ] }) });
59
+ )
60
+ ] }) : null }) });
45
61
  }
46
62
  export {
47
- p as default
63
+ b as default
48
64
  };
@@ -1,6 +1,6 @@
1
- import { y as l } from "../../../../chunks/hooks.module.D9IrxdEh.js";
2
- function s(r, t, o, c) {
3
- l(() => {
1
+ import { y as f } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
+ function k(r, t, o, c) {
3
+ f(() => {
4
4
  if (!r) return;
5
5
  const u = (e) => {
6
6
  if (o) {
@@ -12,8 +12,8 @@ function s(r, t, o, c) {
12
12
  e.preventDefault();
13
13
  const d = t.current;
14
14
  if (!d) return;
15
- const n = Array.from(d.querySelectorAll("a")), y = n.findIndex((i) => i === document.activeElement), f = e.key === "ArrowDown" ? (y + 1) % n.length : (y - 1 + n.length) % n.length;
16
- n[f].focus();
15
+ const n = Array.from(d.querySelectorAll(".n-search-link")), y = n.findIndex((l) => l === document.activeElement), i = e.key === "ArrowDown" ? (y + 1) % n.length : (y - 1 + n.length) % n.length;
16
+ n[i].focus();
17
17
  }
18
18
  }
19
19
  };
@@ -21,5 +21,5 @@ function s(r, t, o, c) {
21
21
  }, [r, t, o, c]);
22
22
  }
23
23
  export {
24
- s as useKeyboardNav
24
+ k as useKeyboardNav
25
25
  };
@@ -1,5 +1,5 @@
1
- import { d as g, A as w } from "../../../../chunks/hooks.module.D9IrxdEh.js";
2
- import { u as S } from "../../../../chunks/useTimeout.YR4eKwj7.js";
1
+ import { d as g, A as w } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
+ import { u as S } from "../../../../chunks/useTimeout.Cq4aqnDe.js";
3
3
  function x() {
4
4
  const [l, r] = g({
5
5
  searchTerm: "",
@@ -1,4 +1,4 @@
1
- import { y as u } from "../../../../chunks/hooks.module.D9IrxdEh.js";
1
+ import { y as u } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
2
  function a(t, r, n, o) {
3
3
  u(() => {
4
4
  if (!t) return;
@@ -1,4 +1,4 @@
1
- import { A as y, y as h, q as k } from "../../../../chunks/hooks.module.D9IrxdEh.js";
1
+ import { A as y, y as h, q as k } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
2
  class s {
3
3
  /**
4
4
  * Pushes an event payload into the dataLayer.
@@ -1,4 +1,4 @@
1
- import { y as c } from "../../../../chunks/hooks.module.D9IrxdEh.js";
1
+ import { y as c } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
2
  function n(r, o, a) {
3
3
  c(() => {
4
4
  if (typeof location > "u" || r) return;
@@ -1,4 +1,4 @@
1
- import { y as l } from "../../../../chunks/hooks.module.D9IrxdEh.js";
1
+ import { y as l } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
2
  function i(c, r) {
3
3
  l(() => {
4
4
  if (!c) return;
@@ -1,13 +1,18 @@
1
1
  import { ComponentChildren } from 'preact';
2
2
  import { IconName } from '../../Icon';
3
3
  export interface SearchLinkProps {
4
+ as?: any;
4
5
  icon: IconName;
5
6
  label: string;
6
7
  resource?: 'blog' | 'changelog' | 'docs' | 'guide';
7
- url: string;
8
+ url?: string;
8
9
  excerpt?: string;
10
+ onClick?: () => void;
9
11
  }
10
12
  export interface SearchWindowProps {
13
+ setModalState: (e: {
14
+ current: string;
15
+ }) => void;
11
16
  searchLoading: boolean;
12
17
  searchTerm?: string;
13
18
  results?: SearchLinkProps[];
@@ -4,5 +4,6 @@ export { default as Icon } from './Icon';
4
4
  export { default as SearchLink } from './SearchModal/components/SearchLink/SearchLink';
5
5
  export { default as SearchHeading } from './SearchModal/components/SearchHeading/SearchHeading';
6
6
  export { default as SearchToggle } from './SearchModal/components/SearchToggle/SearchToggle';
7
+ export { default as AskNetlify } from './AskNetlify/AskNetlify';
7
8
  export { SearchModal } from './SearchModal';
8
9
  export { type IconName } from './Icon';
@@ -3,16 +3,18 @@ import { default as d } from "./Modal/Modal.js";
3
3
  import { default as m } from "./Icon/index.js";
4
4
  import { default as s } from "./SearchModal/components/SearchLink/SearchLink.js";
5
5
  import { default as x } from "./SearchModal/components/SearchHeading/SearchHeading.js";
6
- import { default as h } from "./SearchModal/components/SearchToggle/SearchToggle.js";
6
+ import { default as i } from "./SearchModal/components/SearchToggle/SearchToggle.js";
7
+ import { default as S } from "./AskNetlify/AskNetlify.js";
7
8
  import "preact";
8
- import "../../chunks/hooks.module.D9IrxdEh.js";
9
- import { default as S } from "./SearchModal/components/SearchModal/SearchModal.js";
9
+ import "../../chunks/hooks.module.DGkdD5n9.js";
10
+ import { default as n } from "./SearchModal/components/SearchModal/SearchModal.js";
10
11
  export {
12
+ S as AskNetlify,
11
13
  m as Icon,
12
14
  t as KeyboardKey,
13
15
  d as Modal,
14
16
  x as SearchHeading,
15
17
  s as SearchLink,
16
- S as SearchModal,
17
- h as SearchToggle
18
+ n as SearchModal,
19
+ i as SearchToggle
18
20
  };
@@ -0,0 +1 @@
1
+ export declare const handleThemeChange: (value: "dark" | "light" | "") => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@netlify/spark-ui",
3
3
  "description": "Assets, design tokens, components, and utilities",
4
- "version": "1.4.5",
4
+ "version": "1.5.0-alpha.0",
5
5
  "type": "module",
6
6
  "main": "dist/components/preact/index.js",
7
7
  "types": "dist/components/preact/index.d.ts",
@@ -33,9 +33,11 @@
33
33
  "./analytics": "./packages/analytics/index.ts"
34
34
  },
35
35
  "dependencies": {
36
+ "@kapaai/react-sdk": "^0.1.2",
36
37
  "@preact/preset-vite": "^2.10.1",
37
38
  "@shikijs/transformers": "^3.3.0",
38
39
  "glob": "^11.0.1",
40
+ "marked": "^15.0.11",
39
41
  "preact": "^10.26.4",
40
42
  "vite": "^6.2.5",
41
43
  "vite-plugin-dts": "^4.5.3",
@@ -64,4 +66,4 @@
64
66
  "prettier": "^3.5.3",
65
67
  "prettier-plugin-astro": "^0.14.1"
66
68
  }
67
- }
69
+ }
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  import { Code } from 'astro:components';
3
3
  import '../styles/code-block.css';
4
- import poimandresTheme from '../themes/poimandres.json';
4
+ import poimandresTheme from '../../themes/poimandres.json';
5
5
  import {
6
6
  transformerMetaHighlight,
7
7
  transformerNotationDiff,
@@ -6,4 +6,5 @@ export { default as SearchLink } from './preact/SearchModal/components/SearchLin
6
6
  export { default as SearchHeading } from './preact/SearchModal/components/SearchHeading/SearchHeading';
7
7
  export { default as SearchToggle } from './preact/SearchModal/components/SearchToggle/SearchToggle';
8
8
  export { default as SearchModal } from './preact/SearchModal/components/SearchModal/SearchModal';
9
+ export { default as ChatApp } from './preact/ChatApp/ChatApp';
9
10
  export { type IconName } from './preact/Icon';