@netlify/spark-ui 1.5.0-alpha.9 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/assets/SearchHeading.css +1 -1
  2. package/dist/assets/SearchLink.css +1 -1
  3. package/dist/assets/SearchModal.css +1 -1
  4. package/dist/chunks/compat.module.DJD78v1z.js +175 -0
  5. package/dist/chunks/hooks.module.D9IrxdEh.js +138 -0
  6. package/dist/chunks/{useTimeout.Cq4aqnDe.js → useTimeout.YR4eKwj7.js} +1 -1
  7. package/dist/components/index.d.ts +0 -1
  8. package/dist/components/preact/Icon/index.d.ts +2 -2
  9. package/dist/components/preact/Icon/index.js +75 -87
  10. package/dist/components/preact/Modal/Modal.js +1 -1
  11. package/dist/components/preact/SearchModal/components/SearchInput.d.ts +0 -2
  12. package/dist/components/preact/SearchModal/components/SearchInput.js +2 -2
  13. package/dist/components/preact/SearchModal/components/SearchLink/SearchLink.d.ts +1 -1
  14. package/dist/components/preact/SearchModal/components/SearchLink/SearchLink.js +17 -35
  15. package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +49 -72
  16. package/dist/components/preact/SearchModal/components/SearchToggle/SearchToggle.js +1 -1
  17. package/dist/components/preact/SearchModal/components/SearchWindow.d.ts +1 -1
  18. package/dist/components/preact/SearchModal/components/SearchWindow.js +30 -49
  19. package/dist/components/preact/SearchModal/hooks/useKeyboardNav.js +6 -6
  20. package/dist/components/preact/SearchModal/hooks/useSearch.js +2 -2
  21. package/dist/components/preact/SearchModal/hooks/useSearchHotkeys.js +1 -1
  22. package/dist/components/preact/SearchModal/hooks/useSearchLogger.js +1 -1
  23. package/dist/components/preact/SearchModal/hooks/useSearchParams.js +1 -1
  24. package/dist/components/preact/SearchModal/hooks/useSearchToggles.d.ts +1 -3
  25. package/dist/components/preact/SearchModal/hooks/useSearchToggles.js +10 -13
  26. package/dist/components/preact/SearchModal/types/search.types.d.ts +1 -6
  27. package/dist/components/preact/index.d.ts +0 -1
  28. package/dist/components/preact/index.js +5 -7
  29. package/package.json +3 -5
  30. package/packages/assets/icons/ai.svg +22 -0
  31. package/packages/assets/icons/dev.svg +8 -0
  32. package/packages/assets/icons/ecommerce.svg +16 -0
  33. package/packages/assets/icons/marketing.svg +20 -0
  34. package/packages/components/CodeBlock.astro +4 -1
  35. package/packages/components/SectionTabbedContent.astro +185 -0
  36. package/packages/components/Tab.astro +12 -0
  37. package/packages/components/TabList.astro +7 -0
  38. package/packages/components/TabPanel.astro +13 -0
  39. package/packages/components/TabPanelGroup.astro +45 -0
  40. package/packages/components/TabbedContent.astro +72 -0
  41. package/packages/components/Tabs.astro +0 -2
  42. package/packages/components/Testimonial.astro +0 -0
  43. package/packages/components/index.ts +0 -1
  44. package/packages/components/preact/Icon/index.tsx +55 -56
  45. package/packages/components/preact/SearchModal/components/SearchHeading/SearchHeading.css +4 -5
  46. package/packages/components/preact/SearchModal/components/SearchInput.tsx +7 -9
  47. package/packages/components/preact/SearchModal/components/SearchLink/SearchLink.css +9 -14
  48. package/packages/components/preact/SearchModal/components/SearchLink/SearchLink.tsx +7 -27
  49. package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.css +29 -67
  50. package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.tsx +30 -60
  51. package/packages/components/preact/SearchModal/components/SearchWindow.tsx +18 -32
  52. package/packages/components/preact/SearchModal/hooks/useKeyboardNav.ts +2 -2
  53. package/packages/components/preact/SearchModal/hooks/useSearchToggles.ts +3 -11
  54. package/packages/components/preact/SearchModal/types/search.types.tsx +2 -5
  55. package/packages/components/preact/index.ts +0 -1
  56. package/packages/styles/code-block.css +22 -23
  57. package/packages/styles/fonts.css +8 -3
  58. package/packages/styles/layout.css +33 -0
  59. package/packages/styles/tokens.css +22 -36
  60. package/packages/themes/poimandres.json +6 -19
  61. package/dist/assets/AskNetlify.css +0 -1
  62. package/dist/assets/Orb.css +0 -1
  63. package/dist/chunks/compat.module.BNbXPLVY.js +0 -298
  64. package/dist/chunks/hooks.module.DGkdD5n9.js +0 -177
  65. package/dist/components/preact/AskNetlify/AskNetlify.d.ts +0 -7
  66. package/dist/components/preact/AskNetlify/AskNetlify.js +0 -5774
  67. package/dist/components/preact/Orb/Orb.d.ts +0 -2
  68. package/dist/components/preact/Orb/Orb.js +0 -5
  69. package/dist/components/preact/SpriteIcon/index.d.ts +0 -7
  70. package/dist/components/preact/SpriteIcon/index.js +0 -7
  71. package/dist/components/preact/icons/AskNetlify.d.ts +0 -5
  72. package/dist/components/preact/icons/AskNetlify.js +0 -69
  73. package/dist/components/preact/icons/Book.d.ts +0 -5
  74. package/dist/components/preact/icons/Book.js +0 -23
  75. package/dist/components/preact/icons/CircleQuestion.d.ts +0 -5
  76. package/dist/components/preact/icons/CircleQuestion.js +0 -25
  77. package/dist/components/preact/icons/Comment.d.ts +0 -5
  78. package/dist/components/preact/icons/Comment.js +0 -23
  79. package/dist/components/preact/icons/Lightbulb.d.ts +0 -5
  80. package/dist/components/preact/icons/Lightbulb.js +0 -34
  81. package/dist/components/preact/icons/MagnifyingGlass.d.ts +0 -5
  82. package/dist/components/preact/icons/MagnifyingGlass.js +0 -23
  83. package/dist/utils/theme.d.ts +0 -3
  84. package/packages/assets/icons/AskNetlify.svg +0 -23
  85. package/packages/assets/icons/icons.svg +0 -10
  86. package/packages/assets/icons/lightbulb.svg +0 -4
  87. package/packages/components/preact/AskNetlify/AskNetlify.css +0 -224
  88. package/packages/components/preact/AskNetlify/AskNetlify.tsx +0 -156
  89. package/packages/components/preact/Orb/Orb.css +0 -94
  90. package/packages/components/preact/Orb/Orb.tsx +0 -7
  91. package/packages/components/preact/SpriteIcon/index.tsx +0 -13
  92. package/packages/components/preact/icons/AskNetlify.tsx +0 -46
  93. package/packages/components/preact/icons/Book.tsx +0 -20
  94. package/packages/components/preact/icons/CircleQuestion.tsx +0 -22
  95. package/packages/components/preact/icons/Comment.tsx +0 -20
  96. package/packages/components/preact/icons/Lightbulb.tsx +0 -26
  97. package/packages/components/preact/icons/MagnifyingGlass.tsx +0 -20
  98. package/packages/utils/theme.ts +0 -12
@@ -1,67 +1,48 @@
1
1
  import { u as e } from "../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import { T as o } from "../../../../chunks/hooks.module.DGkdD5n9.js";
3
- import a from "./SearchHeading/SearchHeading.js";
4
- import s from "./SearchLink/SearchLink.js";
5
- import { Fragment as m } from "preact";
6
- const h = {
7
- light: "dark",
8
- dark: "light"
9
- }, d = (n) => {
10
- document.documentElement.setAttribute("data-theme", n), localStorage.setItem("theme", n);
11
- }, u = ({
12
- searchLoading: n,
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,
13
7
  searchTerm: r,
14
- results: t
8
+ results: n
15
9
  }) => {
16
- if (n)
17
- return /* @__PURE__ */ e(a, { children: [
10
+ if (s)
11
+ return /* @__PURE__ */ e(t, { children: [
18
12
  "Searching for ",
19
13
  /* @__PURE__ */ e("span", { className: "n-search-term", children: r }),
20
14
  " ..."
21
15
  ] });
22
- if (!t || t.length === 0)
23
- return /* @__PURE__ */ e(a, { children: [
16
+ if (!n || n.length === 0)
17
+ return /* @__PURE__ */ e(t, { children: [
24
18
  "0 results for ",
25
19
  /* @__PURE__ */ e("span", { className: "n-search-term", children: r })
26
20
  ] });
27
- const c = o(() => t.map((l, i) => /* @__PURE__ */ e("li", { className: "n-results-list-item", children: /* @__PURE__ */ e(s, { ...l }) }, i)), [t]);
28
- return /* @__PURE__ */ e("ul", { className: "n-results-list", role: "list", children: c });
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 });
29
23
  };
30
- function N({
31
- setModalState: n,
32
- searchLoading: r,
33
- searchTerm: t,
34
- results: c,
24
+ function p({
25
+ searchLoading: s,
26
+ searchTerm: r,
27
+ results: n,
35
28
  children: l
36
29
  }) {
37
- return /* @__PURE__ */ e("div", { className: "n-search-window", children: /* @__PURE__ */ e("div", { className: "n-search-links", children: t && t.length > 1 ? /* @__PURE__ */ e(u, { searchLoading: r, searchTerm: t, results: c }) : l ? /* @__PURE__ */ e(m, { children: [
38
- /* @__PURE__ */ e(
39
- s,
40
- {
41
- as: "button",
42
- icon: "askNetlify",
43
- label: "Ask Netlify AI",
44
- onClick: () => {
45
- n({ current: "ask" });
46
- }
47
- }
48
- ),
49
- l,
50
- /* @__PURE__ */ e(a, { children: "Actions" }),
51
- /* @__PURE__ */ e(
52
- s,
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,
53
38
  {
54
- as: "button",
55
- icon: "lightbulb",
56
- label: "Toggle theme",
57
- onClick: () => {
58
- const i = document.documentElement.getAttribute("data-theme");
59
- i && d(h[i]);
60
- }
39
+ searchLoading: s,
40
+ searchTerm: r,
41
+ results: n
61
42
  }
62
- )
63
- ] }) : null }) });
43
+ ) : l || null
44
+ ] }) });
64
45
  }
65
46
  export {
66
- N as default
47
+ p as default
67
48
  };
@@ -1,6 +1,6 @@
1
- import { y as f } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
- function k(r, t, o, c) {
3
- f(() => {
1
+ import { y as l } from "../../../../chunks/hooks.module.D9IrxdEh.js";
2
+ function s(r, t, o, c) {
3
+ l(() => {
4
4
  if (!r) return;
5
5
  const u = (e) => {
6
6
  if (o) {
@@ -12,8 +12,8 @@ function k(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(".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();
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();
17
17
  }
18
18
  }
19
19
  };
@@ -21,5 +21,5 @@ function k(r, t, o, c) {
21
21
  }, [r, t, o, c]);
22
22
  }
23
23
  export {
24
- k as useKeyboardNav
24
+ s as useKeyboardNav
25
25
  };
@@ -1,5 +1,5 @@
1
- import { d as g, A as w } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
- import { u as S } from "../../../../chunks/useTimeout.Cq4aqnDe.js";
1
+ import { d as g, A as w } from "../../../../chunks/hooks.module.D9IrxdEh.js";
2
+ import { u as S } from "../../../../chunks/useTimeout.YR4eKwj7.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.DGkdD5n9.js";
1
+ import { y as u } from "../../../../chunks/hooks.module.D9IrxdEh.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.DGkdD5n9.js";
1
+ import { A as y, y as h, q as k } from "../../../../chunks/hooks.module.D9IrxdEh.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.DGkdD5n9.js";
1
+ import { y as c } from "../../../../chunks/hooks.module.D9IrxdEh.js";
2
2
  function n(r, o, a) {
3
3
  c(() => {
4
4
  if (typeof location > "u" || r) return;
@@ -9,6 +9,4 @@
9
9
  *
10
10
  * @param onOpen - A function to be called when a toggle element is clicked.
11
11
  */
12
- export declare function useSearchToggles(isPagefindLoaded: boolean, onOpen: () => void, setState: (state: {
13
- current: string;
14
- }) => void): void;
12
+ export declare function useSearchToggles(isPagefindLoaded: boolean, onOpen: () => void): void;
@@ -1,19 +1,16 @@
1
- import { y as a } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
- function s(c, t, l) {
3
- a(() => {
1
+ import { y as l } from "../../../../chunks/hooks.module.D9IrxdEh.js";
2
+ function i(c, r) {
3
+ l(() => {
4
4
  if (!c) return;
5
- const r = document.querySelectorAll("[data-ntl-search-toggle]");
6
- if (r.length)
7
- return r.forEach((e) => {
8
- const o = e.dataset.ntlSearchToggle ? e.dataset.ntlSearchToggle : "search";
9
- e.removeAttribute("disabled"), e.addEventListener("click", () => {
10
- t(), l({ current: o });
11
- });
5
+ const t = document.querySelectorAll("[data-ntl-search-toggle]");
6
+ if (t.length)
7
+ return t.forEach((e) => {
8
+ e.removeAttribute("disabled"), e.addEventListener("click", r);
12
9
  }), () => {
13
- r.forEach((e) => e.removeEventListener("click", t));
10
+ t.forEach((e) => e.removeEventListener("click", r));
14
11
  };
15
- }, [c, t]);
12
+ }, [c, r]);
16
13
  }
17
14
  export {
18
- s as useSearchToggles
15
+ i as useSearchToggles
19
16
  };
@@ -1,18 +1,13 @@
1
1
  import { ComponentChildren } from 'preact';
2
2
  import { IconName } from '../../Icon';
3
3
  export interface SearchLinkProps {
4
- as?: any;
5
4
  icon: IconName;
6
5
  label: string;
7
6
  resource?: 'blog' | 'changelog' | 'docs' | 'guide';
8
- url?: string;
7
+ url: string;
9
8
  excerpt?: string;
10
- onClick?: () => void;
11
9
  }
12
10
  export interface SearchWindowProps {
13
- setModalState: (e: {
14
- current: string;
15
- }) => void;
16
11
  searchLoading: boolean;
17
12
  searchTerm?: string;
18
13
  results?: SearchLinkProps[];
@@ -4,6 +4,5 @@ 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';
8
7
  export { SearchModal } from './SearchModal';
9
8
  export { type IconName } from './Icon';
@@ -3,18 +3,16 @@ 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 i } from "./SearchModal/components/SearchToggle/SearchToggle.js";
7
- import { default as S } from "./AskNetlify/AskNetlify.js";
6
+ import { default as h } from "./SearchModal/components/SearchToggle/SearchToggle.js";
8
7
  import "preact";
9
- import "../../chunks/hooks.module.DGkdD5n9.js";
10
- import { default as n } from "./SearchModal/components/SearchModal/SearchModal.js";
8
+ import "../../chunks/hooks.module.D9IrxdEh.js";
9
+ import { default as S } from "./SearchModal/components/SearchModal/SearchModal.js";
11
10
  export {
12
- S as AskNetlify,
13
11
  m as Icon,
14
12
  t as KeyboardKey,
15
13
  d as Modal,
16
14
  x as SearchHeading,
17
15
  s as SearchLink,
18
- n as SearchModal,
19
- i as SearchToggle
16
+ S as SearchModal,
17
+ h as SearchToggle
20
18
  };
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.5.0-alpha.9",
4
+ "version": "1.5.0",
5
5
  "type": "module",
6
6
  "main": "dist/components/preact/index.js",
7
7
  "types": "dist/components/preact/index.d.ts",
@@ -25,20 +25,18 @@
25
25
  "exports": {
26
26
  "./preact": "./dist/components/preact/index.js",
27
27
  "./assets/*.css": "./dist/assets/*.css",
28
- "./assets/icons/*.svg": "./packages/assets/icons/*.svg",
29
28
  "./logos/*.svg": "./packages/assets/logos/*.svg",
30
29
  "./styles/*.css": "./packages/styles/*.css",
30
+ "./assets/*": "./packages/assets/*",
31
31
  "./components": "./packages/components/index.ts",
32
32
  "./components/*": "./packages/components/*",
33
33
  "./utils": "./packages/utils/index.ts",
34
34
  "./analytics": "./packages/analytics/index.ts"
35
35
  },
36
36
  "dependencies": {
37
- "@kapaai/react-sdk": "^0.1.3",
38
37
  "@preact/preset-vite": "^2.10.1",
39
38
  "@shikijs/transformers": "^3.3.0",
40
39
  "glob": "^11.0.1",
41
- "marked": "^15.0.11",
42
40
  "preact": "^10.26.4",
43
41
  "vite": "^6.2.5",
44
42
  "vite-plugin-dts": "^4.5.3",
@@ -67,4 +65,4 @@
67
65
  "prettier": "^3.5.3",
68
66
  "prettier-plugin-astro": "^0.14.1"
69
67
  }
70
- }
68
+ }
@@ -0,0 +1,22 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_1_5265)">
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M9.5164 9.0614H0.844727V20.6468C0.844727 21.5609 1.58572 22.3018 2.49979 22.3018H19.0504C19.9645 22.3018 20.7054 21.5609 20.7054 20.6468V13.6548C20.6996 13.6548 20.6938 13.6548 20.688 13.6548H14.0678C11.5541 13.6548 9.5164 11.6171 9.5164 9.10342V9.0614Z" fill="#382AA4"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.6918 4.13806C9.94647 5.33965 9.5162 6.75717 9.5162 8.27571V9.10323H0.827148V5.79312C0.827148 4.87906 1.56814 4.13806 2.48221 4.13806H10.6918Z" fill="#292142"/>
5
+ <path d="M4.99805 18.1816L7.48063 15.699L4.99805 13.2164" stroke="#775CE7" stroke-width="1.65506" stroke-linecap="round" stroke-linejoin="round"/>
6
+ <path d="M9.96387 18.1814H12.4465" stroke="#775CE7" stroke-width="1.65506" stroke-linecap="round" stroke-linejoin="round"/>
7
+ <path d="M8.89555 4.13806H2.48221C2.04325 4.13806 1.62229 4.31244 1.3119 4.62281C1.00152 4.9332 0.827148 5.35416 0.827148 5.79312V20.6886C0.827148 21.1276 1.00152 21.5486 1.3119 21.8589C1.62229 22.1693 2.04325 22.3437 2.48221 22.3437H19.0328C19.9469 22.3437 20.6878 21.6027 20.6878 20.6886V14.4822" stroke="#775CE7" stroke-width="1.65506" stroke-linecap="round" stroke-linejoin="round"/>
8
+ <path d="M0.827148 9.10352H8.68867" stroke="#775CE7" stroke-width="1.65506" stroke-linecap="round" stroke-linejoin="round"/>
9
+ <path d="M12.4131 8.27535C12.4131 5.53317 14.6361 3.31018 17.3783 3.31018C20.1205 3.31018 22.3434 5.53317 22.3434 8.27535V9.10288C22.3434 10.0169 21.6025 10.7579 20.6884 10.7579H14.0681C13.1541 10.7579 12.4131 10.0169 12.4131 9.10288V8.27535Z" fill="#E2D9F7"/>
10
+ <path d="M12.4131 8.27535C12.4131 5.53317 14.6361 3.31018 17.3783 3.31018C20.1205 3.31018 22.3434 5.53317 22.3434 8.27535V9.10288C22.3434 10.0169 21.6025 10.7579 20.6884 10.7579H14.0681C13.1541 10.7579 12.4131 10.0169 12.4131 9.10288V8.27535Z" stroke="#775CE7" stroke-width="1.65506" stroke-linecap="round" stroke-linejoin="round"/>
11
+ <path d="M15.3093 7.86122C15.0808 7.86122 14.8955 7.67597 14.8955 7.44746C14.8955 7.21894 15.0808 7.03369 15.3093 7.03369" stroke="#775CE7" stroke-width="1.65506" stroke-linecap="round" stroke-linejoin="round"/>
12
+ <path d="M15.3086 7.86134C15.5371 7.86134 15.7224 7.67609 15.7224 7.44758C15.7224 7.21906 15.5371 7.03381 15.3086 7.03381" stroke="#775CE7" stroke-width="1.65506" stroke-linecap="round" stroke-linejoin="round"/>
13
+ <path d="M19.446 7.86122C19.2174 7.86122 19.0322 7.67597 19.0322 7.44746C19.0322 7.21894 19.2174 7.03369 19.446 7.03369" stroke="#775CE7" stroke-width="1.65506" stroke-linecap="round" stroke-linejoin="round"/>
14
+ <path d="M19.4463 7.86134C19.6749 7.86134 19.8601 7.67609 19.8601 7.44758C19.8601 7.21906 19.6749 7.03381 19.4463 7.03381" stroke="#775CE7" stroke-width="1.65506" stroke-linecap="round" stroke-linejoin="round"/>
15
+ <path d="M17.3779 3.31022V0.827637" stroke="#775CE7" stroke-width="1.65506" stroke-linecap="round" stroke-linejoin="round"/>
16
+ </g>
17
+ <defs>
18
+ <clipPath id="clip0_1_5265">
19
+ <rect width="23.1708" height="23.1708" fill="white"/>
20
+ </clipPath>
21
+ </defs>
22
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.72852 6.04785V20.8685C1.72852 21.7495 2.44265 22.4636 3.32358 22.4636H20.8691C21.7501 22.4636 22.4642 21.7495 22.4642 20.8685V6.04785H1.72852Z" fill="#332213"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M22.4642 6.07901H1.72852V3.32236C1.72852 2.44143 2.44265 1.72729 3.32358 1.72729H20.8691C21.7501 1.72729 22.4642 2.44143 22.4642 3.32236V6.07901Z" fill="#A85D13"/>
4
+ <path d="M20.8691 1.72729H3.32358C2.44265 1.72729 1.72852 2.44143 1.72852 3.32236V20.8679C1.72852 21.7488 2.44265 22.463 3.32358 22.463H20.8691C21.7501 22.463 22.4642 21.7488 22.4642 20.8679V3.32236C22.4642 2.44143 21.7501 1.72729 20.8691 1.72729Z" stroke="#F98E21" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M1.72852 6.04785H22.4644" stroke="#F98E21" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
6
+ <path d="M9.50407 12.0958L6.91211 14.6878L9.50407 17.2798" stroke="#F98E21" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
7
+ <path d="M14.6885 12.0958L17.2804 14.6878L14.6885 17.2798" stroke="#F98E21" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
8
+ </svg>
@@ -0,0 +1,16 @@
1
+ <svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M2.46484 5.33927L4.10951 1.77581C4.37805 1.194 4.96036 0.821411 5.60116 0.821411H17.3999C18.0408 0.821411 18.623 1.194 18.8916 1.77581L20.5363 5.33927H2.46484Z" fill="#D6FFFE"/>
3
+ <path d="M2.46484 5.33923H8.48866V6.43448C8.48866 8.0979 7.14018 9.44638 5.47674 9.44638C3.81332 9.44638 2.46484 8.0979 2.46484 6.43448V5.33923Z" fill="#D6FFFE"/>
4
+ <path d="M8.48926 5.33923H14.5131V6.43448C14.5131 8.0979 13.1646 9.44638 11.5012 9.44638C9.83773 9.44638 8.48926 8.0979 8.48926 6.43448V5.33923Z" fill="#D6FFFE"/>
5
+ <path d="M14.5117 5.33923H20.5355V6.43448C20.5355 8.0979 19.187 9.44638 17.5237 9.44638C15.8602 9.44638 14.5117 8.0979 14.5117 6.43448V5.33923Z" fill="#D6FFFE"/>
6
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.48964 11.4932C7.60887 12.0185 6.57844 12.3215 5.47766 12.3215C4.64766 12.3215 3.85776 12.1497 3.1416 11.8398V16.3773C3.1416 17.2846 3.87713 18.0201 4.78446 18.0201H18.2176C19.125 18.0201 19.8605 17.2846 19.8605 16.3773V11.8401C19.1445 12.1498 18.355 12.3215 17.5252 12.3215C16.4245 12.3215 15.3941 12.0186 14.5134 11.4933C13.6327 12.0186 12.6023 12.3215 11.5016 12.3215C10.4008 12.3215 9.3704 12.0185 8.48964 11.4932Z" fill="#D6FFFE"/>
7
+ <path d="M8.21484 22.1786L9.8577 18.0714H13.1434L14.7863 22.1786H8.21484Z" fill="#D6FFFE"/>
8
+ <path d="M19.8605 12.3214V16.3772C19.8605 17.2845 19.125 18.0202 18.2176 18.0202H4.78446C3.87713 18.0202 3.1416 17.2845 3.1416 16.3772V12.3214" stroke="#32E6E2" stroke-width="1.64286" stroke-linecap="round" stroke-linejoin="round"/>
9
+ <path d="M9.8577 18.0714L8.21484 22.1786" stroke="#32E6E2" stroke-width="1.64286" stroke-linecap="round" stroke-linejoin="round"/>
10
+ <path d="M13.1436 18.0714L14.7864 22.1786" stroke="#32E6E2" stroke-width="1.64286" stroke-linecap="round" stroke-linejoin="round"/>
11
+ <path d="M6.57227 22.1786H16.4294" stroke="#32E6E2" stroke-width="1.64286" stroke-linecap="round" stroke-linejoin="round"/>
12
+ <path d="M2.46484 5.33927L4.10951 1.77581C4.37805 1.194 4.96036 0.821411 5.60116 0.821411H17.3999C18.0408 0.821411 18.623 1.194 18.8916 1.77581L20.5363 5.33927H2.46484Z" stroke="#32E6E2" stroke-width="1.64286" stroke-linecap="round" stroke-linejoin="round"/>
13
+ <path d="M2.46484 5.33923H8.48866V6.43448C8.48866 8.0979 7.14018 9.44638 5.47674 9.44638C3.81332 9.44638 2.46484 8.0979 2.46484 6.43448V5.33923Z" stroke="#32E6E2" stroke-width="1.64286" stroke-linecap="round" stroke-linejoin="round"/>
14
+ <path d="M8.48926 5.33923H14.5131V6.43448C14.5131 8.0979 13.1646 9.44638 11.5012 9.44638C9.83773 9.44638 8.48926 8.0979 8.48926 6.43448V5.33923Z" stroke="#32E6E2" stroke-width="1.64286" stroke-linecap="round" stroke-linejoin="round"/>
15
+ <path d="M14.5117 5.33923H20.5355V6.43448C20.5355 8.0979 19.187 9.44638 17.5237 9.44638C15.8602 9.44638 14.5117 8.0979 14.5117 6.43448V5.33923Z" stroke="#32E6E2" stroke-width="1.64286" stroke-linecap="round" stroke-linejoin="round"/>
16
+ </svg>
@@ -0,0 +1,20 @@
1
+ <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_1_5250)">
3
+ <path d="M8.64062 22.9532L10.3686 18.6333H13.8246L15.5525 22.9532H8.64062Z" fill="#CDE2FF"/>
4
+ <path d="M22.464 2.21704H1.72825C1.25108 2.21704 0.864258 2.60387 0.864258 3.08103V17.7688C0.864258 18.2459 1.25108 18.6328 1.72825 18.6328H22.464C22.9411 18.6328 23.328 18.2459 23.328 17.7688V3.08103C23.328 2.60387 22.9411 2.21704 22.464 2.21704Z" fill="#2036A1"/>
5
+ <path d="M22.464 2.21704H1.72825C1.25108 2.21704 0.864258 2.60387 0.864258 3.08103V17.7688C0.864258 18.2459 1.25108 18.6328 1.72825 18.6328H22.464C22.9411 18.6328 23.328 18.2459 23.328 17.7688V3.08103C23.328 2.60387 22.9411 2.21704 22.464 2.21704Z" stroke="#2E51ED" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
6
+ <path d="M10.3686 18.6333L8.64062 22.9532" stroke="#2E51ED" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
7
+ <path d="M13.8252 18.6333L15.5532 22.9532" stroke="#2E51ED" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
8
+ <path d="M6.91211 22.9524H17.28" stroke="#2E51ED" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
9
+ <path d="M7.87402 12.2764C8.69713 13.1135 10.1509 13.8809 12.0958 13.8809C14.0407 13.8809 15.4944 13.1135 16.3175 12.2764" stroke="#80ABFA" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
10
+ <path d="M9.073 7.8335C8.83421 7.8335 8.64062 7.63991 8.64062 7.40112C8.64062 7.16233 8.83421 6.96875 9.073 6.96875" stroke="#80ABFA" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
11
+ <path d="M9.07227 7.8335C9.31105 7.8335 9.50464 7.63991 9.50464 7.40112C9.50464 7.16234 9.31105 6.96875 9.07227 6.96875" stroke="#80ABFA" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
12
+ <path d="M15.1205 7.83274C14.8819 7.83274 14.6885 7.63933 14.6885 7.40074C14.6885 7.16216 14.8819 6.96875 15.1205 6.96875" stroke="#80ABFA" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
13
+ <path d="M15.1191 7.83274C15.3577 7.83274 15.5511 7.63933 15.5511 7.40074C15.5511 7.16216 15.3577 6.96875 15.1191 6.96875" stroke="#80ABFA" stroke-width="1.72798" stroke-linecap="round" stroke-linejoin="round"/>
14
+ </g>
15
+ <defs>
16
+ <clipPath id="clip0_1_5250">
17
+ <rect width="24.1917" height="24.1917" fill="white" transform="translate(0 0.489746)"/>
18
+ </clipPath>
19
+ </defs>
20
+ </svg>
@@ -20,6 +20,7 @@ interface Props {
20
20
  title?: string;
21
21
  class?: string;
22
22
  showLineNumbers?: boolean;
23
+ showCopyOnHover?: boolean;
23
24
  }
24
25
 
25
26
  const {
@@ -32,8 +33,9 @@ const {
32
33
  theme = 'poimandres',
33
34
  wrap = false,
34
35
  title = '',
35
- class: className,
36
+ showCopyOnHover,
36
37
  showLineNumbers = false,
38
+ class: className,
37
39
  ...rest
38
40
  } = Astro.props;
39
41
 
@@ -115,6 +117,7 @@ const showNumbers = showLineNumbers && code.split('\n').length > 1;
115
117
  frame === 'code' && 'code-frame',
116
118
  frame === 'none' && 'no-frame',
117
119
  showNumbers && 'with-line-numbers',
120
+ showCopyOnHover && 'show-copy-on-hover',
118
121
  className,
119
122
  ]}
120
123
  {...rest}
@@ -0,0 +1,185 @@
1
+ ---
2
+ import { CallToActionProps } from '@utils/types';
3
+ import TabbedContent from '@netlify/spark-ui/components/TabbedContent.astro';
4
+ import Tab from '@netlify/spark-ui/components/Tab.astro';
5
+ import TabList from '@netlify/spark-ui/components/TabList.astro';
6
+ import TabPanel from '@netlify/spark-ui/components/TabPanel.astro';
7
+ import TabPanelGroup from '@netlify/spark-ui/components/TabPanelGroup.astro';
8
+ import Button from '@netlify/spark-ui/components/Button.astro';
9
+ import HeadingBlock from '@netlify/spark-ui/components/HeadingBlock.astro';
10
+ import CodeBlock from './CodeBlock.astro';
11
+
12
+ interface CodeBlockProps {
13
+ heading?: string;
14
+ icon?: string;
15
+ code: string;
16
+ lang: string;
17
+ }
18
+
19
+ interface ItemProps {
20
+ title: string;
21
+ icon?: string;
22
+ isSelected?: boolean;
23
+ heading?: string;
24
+ text?: string;
25
+ list?: string[];
26
+ ctas?: CallToActionProps[];
27
+ codeBlock?: CodeBlockProps;
28
+ }
29
+
30
+ interface Props {
31
+ class?: string;
32
+ id?: string;
33
+ eyebrow?: string;
34
+ heading?: string;
35
+ items: ItemProps[];
36
+ }
37
+
38
+ const { id, eyebrow, heading, items, class: className, ...rest } = Astro.props;
39
+ ---
40
+
41
+ <section id={id} class:list={['n-section-tabbed-content', className]} {...rest}>
42
+ <HeadingBlock eyebrow={eyebrow} heading={heading} />
43
+ <TabbedContent>
44
+ <TabList>
45
+ {
46
+ items.map(({ title, icon, isSelected }: ItemProps) => (
47
+ <Tab isSelected={isSelected}>
48
+ <img src={`${icon}`} alt="" width="16" height="16" />
49
+ {title}
50
+ </Tab>
51
+ ))
52
+ }
53
+ </TabList>
54
+ <TabPanelGroup isUniformHeight noPadding>
55
+ {
56
+ items.map(({ heading, list, text, ctas, codeBlock, isSelected }: ItemProps) => (
57
+ <TabPanel class="n-section-tabbed-content-panel" isHidden={!isSelected}>
58
+ <div
59
+ class:list={[
60
+ 'n-section-tabbed-content-panel-content',
61
+ codeBlock && 'n-section-tabbed-content-wrapper-split',
62
+ ]}
63
+ >
64
+ <div class="n-section-tabbed-content-body n-flow">
65
+ {heading && <h3 class="h4">{heading}</h3>}
66
+ {text && <p set:html={text} />}
67
+ {list && list.length > 0 && (
68
+ <ul data-list-variant="checklist">
69
+ {list.map(item => (
70
+ <li set:html={item} />
71
+ ))}
72
+ </ul>
73
+ )}
74
+ {ctas && ctas.length > 0 && (
75
+ <div class="n-section-tabbed-content-ctas">
76
+ {ctas?.map((cta: CallToActionProps) => (
77
+ <Button id={cta.id} href={cta.href} variant={cta.variant}>
78
+ {cta.text}
79
+ </Button>
80
+ ))}
81
+ </div>
82
+ )}
83
+ </div>
84
+ {codeBlock && (
85
+ <div class="n-section-tabbed-content-code">
86
+ {codeBlock.heading && (
87
+ <div class="n-section-tabbed-content-code-heading">
88
+ {codeBlock.icon && (
89
+ <img
90
+ class="n-section-tabbed-content-code-icon"
91
+ src={codeBlock.icon}
92
+ alt=""
93
+ width="16"
94
+ height="16"
95
+ aria-hidden="true"
96
+ />
97
+ )}
98
+ {codeBlock.heading}
99
+ </div>
100
+ )}
101
+ <CodeBlock
102
+ class="n-section-tabbed-content-code-block"
103
+ code={codeBlock.code}
104
+ lang={codeBlock.lang}
105
+ showCopyOnHover
106
+ />
107
+ </div>
108
+ )}
109
+ </div>
110
+ </TabPanel>
111
+ ))
112
+ }
113
+ </TabPanelGroup>
114
+ </TabbedContent>
115
+ </section>
116
+
117
+ <style>
118
+ .n-section-tabbed-content-panel {
119
+ container-type: inline-size;
120
+ }
121
+
122
+ .n-section-tabbed-content-wrapper-split {
123
+ display: grid;
124
+ grid-template-rows: auto 1fr;
125
+ height: 100%;
126
+ }
127
+
128
+ .n-section-tabbed-content-body {
129
+ padding: var(--space-xl);
130
+ }
131
+
132
+ .n-section-tabbed-content-code {
133
+ display: flex;
134
+ flex-direction: column;
135
+ }
136
+
137
+ .n-section-tabbed-content-code-heading {
138
+ display: flex;
139
+ gap: var(--space-xs);
140
+ align-items: center;
141
+ margin-block-start: calc(var(--_border-size) * -1); /* overlap the parent border */
142
+ padding: var(--space-xs);
143
+ font-family: var(--font-family-mono);
144
+ font-size: var(--font-size-text-md);
145
+ text-transform: uppercase;
146
+ background-color: var(--tabbed-content-code-bg-color);
147
+ border-block: var(--_border-size) var(--_border-style) var(--tabbed-content-border-color);
148
+ }
149
+
150
+ .n-section-tabbed-content-code-icon {
151
+ flex-shrink: 0;
152
+ width: 1em;
153
+ height: auto;
154
+ }
155
+
156
+ .n-section-tabbed-content-code-block {
157
+ --n-code-block-border: none;
158
+ --n-code-block-radius: 0;
159
+ --n-code-block-bg-color: var(--tabbed-content-code-bg-color);
160
+ flex-grow: 1;
161
+ }
162
+
163
+ .n-section-tabbed-content-ctas {
164
+ display: grid;
165
+ gap: var(--space-s);
166
+ }
167
+
168
+ @media (min-width: 30rem) {
169
+ .n-section-tabbed-content-ctas {
170
+ justify-items: start;
171
+ }
172
+ }
173
+
174
+ @container (width > 55rem) {
175
+ .n-section-tabbed-content-wrapper-split {
176
+ grid-template-columns: 1fr 1fr;
177
+ grid-template-rows: 1fr;
178
+ }
179
+
180
+ .n-section-tabbed-content-code {
181
+ border-inline-start: var(--_border-size) var(--_border-style)
182
+ var(--tabbed-content-border-color);
183
+ }
184
+ }
185
+ </style>
@@ -0,0 +1,12 @@
1
+ ---
2
+ interface Props {
3
+ isSelected?: boolean;
4
+ class?: string;
5
+ }
6
+
7
+ const { isSelected, class: className, ...rest } = Astro.props;
8
+ ---
9
+
10
+ <button role="tab" class={className} aria-selected={isSelected} {...rest}>
11
+ <slot />
12
+ </button>
@@ -0,0 +1,7 @@
1
+ ---
2
+ const { class: className, ...rest } = Astro.props;
3
+ ---
4
+
5
+ <div role="tablist" class={className} {...rest}>
6
+ <slot />
7
+ </div>
@@ -0,0 +1,13 @@
1
+ ---
2
+ interface Props {
3
+ id?: string;
4
+ class?: string;
5
+ isHidden?: boolean;
6
+ }
7
+
8
+ const { id, isHidden, class: className, ...rest } = Astro.props;
9
+ ---
10
+
11
+ <div {id} role="tabpanel" hidden={isHidden} class={className} {...rest}>
12
+ <slot />
13
+ </div>