@netlify/spark-ui 1.17.5 → 1.18.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.
@@ -1,23 +1,23 @@
1
1
  import { u as r } from "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import { g as a } from "../../../chunks/hooks.module.DGkdD5n9.js";
2
+ import { g as d } from "../../../chunks/hooks.module.DGkdD5n9.js";
3
3
  import '../../../assets/Popover.css';const v = ({
4
4
  id: e,
5
- content: t,
6
- position: p = "top",
5
+ content: p,
6
+ position: t = "top",
7
7
  class: n = "",
8
8
  children: s,
9
9
  ...i
10
10
  }) => {
11
- const d = a(), o = e || d;
12
- return /* @__PURE__ */ r("div", { id: o, class: `n-popover-container n-popover-${p} ${n}`, ...i, children: [
13
- /* @__PURE__ */ r("button", { class: "n-popover-trigger", "aria-describedby": `${o}-popover`, type: "button", children: s }),
11
+ const a = d(), o = e || a;
12
+ return /* @__PURE__ */ r("div", { id: o, class: `n-popover-container n-popover-${t} ${n}`, ...i, children: [
13
+ /* @__PURE__ */ r("span", { class: "n-popover-trigger", "aria-describedby": `${o}-popover`, children: s }),
14
14
  /* @__PURE__ */ r(
15
15
  "div",
16
16
  {
17
17
  id: `${o}-popover`,
18
18
  class: "n-popover",
19
19
  role: "tooltip",
20
- dangerouslySetInnerHTML: { __html: t }
20
+ dangerouslySetInnerHTML: { __html: p }
21
21
  }
22
22
  )
23
23
  ] });
@@ -1,6 +1,6 @@
1
1
  import { u as e } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
2
  import { A as g, y as f, d } from "../../../../../chunks/hooks.module.DGkdD5n9.js";
3
- import { A as K, K as L } from "../../../../../chunks/AskNetlify.C3J4605n.js";
3
+ import { A as K, K as L } from "../../../../../chunks/AskNetlify.nCAFTKgo.js";
4
4
  import P from "../../../Modal/Modal.js";
5
5
  import h from "../../../KeyboardKey/KeyboardKey.js";
6
6
  import M from "../SearchWindow.js";
@@ -4,7 +4,7 @@ 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 u } from "./SearchModal/components/SearchHeading/SearchHeading.js";
6
6
  import { default as i } from "./SearchModal/components/SearchToggle/SearchToggle.js";
7
- import { A as S } from "../../chunks/AskNetlify.C3J4605n.js";
7
+ import { A as S } from "../../chunks/AskNetlify.nCAFTKgo.js";
8
8
  import "preact";
9
9
  import "../../chunks/hooks.module.DGkdD5n9.js";
10
10
  import { default as n } from "./SearchModal/components/SearchModal/SearchModal.js";
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.17.5",
4
+ "version": "1.18.0-alpha.0",
5
5
  "type": "module",
6
6
  "main": "dist/components/preact/index.js",
7
7
  "types": "dist/components/preact/index.d.ts",
@@ -121,7 +121,7 @@
121
121
  }
122
122
 
123
123
  .n-ask-sources {
124
- margin-block-start: var(--space-m);
124
+ margin-block-start: var(--space-xs);
125
125
  }
126
126
 
127
127
  .n-ask-sources-title {
@@ -168,6 +168,28 @@
168
168
  transform: rotate(270deg);
169
169
  }
170
170
 
171
+ .n-ask-action-bar {
172
+ margin-block-start: var(--space-m);
173
+ }
174
+
175
+ .n-ask-action-bar button {
176
+ display: grid;
177
+ border: none;
178
+ }
179
+
180
+ .n-ask-action-bar button svg {
181
+ pointer-events: none;
182
+ }
183
+
184
+ .n-ask-action-bar .n-popover {
185
+ --n-popover-padding: var(--space-2xs) var(--space-xs);
186
+ }
187
+
188
+ .n-ask-action-bar [id*='icon-'] {
189
+ width: auto;
190
+ height: 14px;
191
+ }
192
+
171
193
  /* ----------------------------- */
172
194
  /* Form UI */
173
195
  /* ----------------------------- */
@@ -23,8 +23,18 @@ export default function AskNetlify({ setModalState, searchQuery, urlParamQuery }
23
23
  const inputRef = useRef<HTMLInputElement>(null);
24
24
  const lastMessageRef = useRef<HTMLDivElement | null>(null);
25
25
 
26
- const { conversation, submitQuery, isGeneratingAnswer, isPreparingAnswer, stopGeneration } =
27
- useChat();
26
+ const {
27
+ conversation,
28
+ submitQuery,
29
+ isGeneratingAnswer,
30
+ isPreparingAnswer,
31
+ stopGeneration,
32
+ addFeedback,
33
+ } = useChat();
34
+
35
+ useEffect(() => {
36
+ console.log(conversation);
37
+ }, [conversation]);
28
38
 
29
39
  const handleSubmit = (e: Event | preact.JSX.TargetedMouseEvent<HTMLButtonElement>) => {
30
40
  e.preventDefault();
@@ -73,13 +83,14 @@ export default function AskNetlify({ setModalState, searchQuery, urlParamQuery }
73
83
  <QuestionList onClick={handleSubmit} menuRef={menuRef} />
74
84
  )}
75
85
 
76
- {conversation.length > 0 && (
86
+ {
77
87
  <ChatMessages
78
88
  isPreparingAnswer={isPreparingAnswer}
79
89
  conversation={conversation}
80
90
  lastMessageRef={lastMessageRef}
91
+ addFeedback={addFeedback}
81
92
  />
82
- )}
93
+ }
83
94
  </div>
84
95
 
85
96
  <form onSubmit={handleSubmit} className="n-ask-form n-search-input-wrapper">
@@ -0,0 +1,109 @@
1
+ import Icon from '@components/preact/Icon';
2
+ import Popover from '@components/preact/Popover/Popover';
3
+
4
+ interface ActionBarProps {
5
+ answer: string;
6
+ questionAnswerId: string;
7
+ addFeedback: (id: string, type: string, meta?: object) => void;
8
+ }
9
+
10
+ const toggleFeedbackButton = (e: MouseEvent): void => {
11
+ const btn = (e.target as HTMLElement).closest('button');
12
+ if (!btn) return;
13
+
14
+ const isHelpfulBtn = btn.classList.contains('btn-feedback-helpful');
15
+ const isIncorrectBtn = btn.classList.contains('btn-feedback-incorrect');
16
+
17
+ // Only proceed if it's one of the feedback buttons
18
+ if (!isHelpfulBtn && !isIncorrectBtn) return;
19
+
20
+ // Get both feedback buttons
21
+ const actionBar = btn.closest('.n-ask-action-bar');
22
+ const helpfulBtn = actionBar?.querySelector('.btn-feedback-helpful');
23
+ const incorrectBtn = actionBar?.querySelector('.btn-feedback-incorrect');
24
+
25
+ // Reset both buttons first (hide all solid icons, show all outline icons)
26
+ [helpfulBtn, incorrectBtn].forEach(button => {
27
+ if (!button) return;
28
+ const icons = button.querySelectorAll('[id*="icon"]');
29
+ icons.forEach((icon, index) => {
30
+ if (index === 0) {
31
+ icon.classList.remove('hidden'); // Show outline
32
+ } else {
33
+ icon.classList.add('hidden'); // Hide solid
34
+ }
35
+ });
36
+ });
37
+
38
+ // Toggle the clicked button
39
+ const clickedIcons = btn.querySelectorAll('[id*="icon"]');
40
+ clickedIcons.forEach(icon => {
41
+ icon.classList.toggle('hidden');
42
+ });
43
+ };
44
+
45
+ const copyToClipboard = async (text: string): Promise<void> => {
46
+ const copyPopover = document.getElementById('copy-popover');
47
+ try {
48
+ await navigator.clipboard.writeText(text);
49
+ if (copyPopover) {
50
+ copyPopover.textContent = 'Copied';
51
+ setTimeout(() => {
52
+ copyPopover.textContent = 'Copy';
53
+ copyPopover.blur();
54
+ }, 2000);
55
+ }
56
+ } catch (error) {
57
+ console.error('Failed to copy code: ', error);
58
+ if (copyPopover) {
59
+ copyPopover.textContent = 'Failed to copy';
60
+ setTimeout(() => {
61
+ copyPopover.textContent = 'Copy';
62
+ copyPopover.blur();
63
+ }, 2000);
64
+ }
65
+ }
66
+ };
67
+
68
+ export function ActionBar({ answer, questionAnswerId, addFeedback }: ActionBarProps) {
69
+ return (
70
+ <div className="n-ask-action-bar">
71
+ <Popover id="copy" content={`Copy`}>
72
+ <button onClick={() => copyToClipboard(answer)}>
73
+ <Icon name="copy" />
74
+ </button>
75
+ </Popover>
76
+
77
+ <Popover id="feedback-helpful" content={`Helpful`}>
78
+ <button
79
+ class="btn-feedback-helpful n-stack"
80
+ onClick={e => {
81
+ toggleFeedbackButton(e as unknown as MouseEvent);
82
+ addFeedback(questionAnswerId, 'upvote');
83
+ }}
84
+ >
85
+ <Icon name="thumbsUp" />
86
+ <Icon name="thumbsUpSolid" className="hidden" />
87
+ </button>
88
+ </Popover>
89
+
90
+ <Popover id="feedback-incorrect" content={`Not helpful`}>
91
+ <button
92
+ class="btn-feedback-incorrect n-stack"
93
+ onClick={e => {
94
+ toggleFeedbackButton(e as unknown as MouseEvent);
95
+ addFeedback(questionAnswerId, 'downvote', {
96
+ incorrect: true,
97
+ irrelevant: false,
98
+ unaddressed: false,
99
+ issue: "This information isn't accurate",
100
+ });
101
+ }}
102
+ >
103
+ <Icon name="thumbsDown" />
104
+ <Icon name="thumbsDownSolid" className="hidden" />
105
+ </button>
106
+ </Popover>
107
+ </div>
108
+ );
109
+ }
@@ -2,15 +2,18 @@ import { marked } from 'marked';
2
2
  import Icon from '../../Icon';
3
3
  import { Ref } from 'preact';
4
4
  import { SourcesList } from './SourcesList';
5
+ import { ActionBar } from './ActionBar';
5
6
 
6
7
  export function ChatMessages({
7
8
  conversation,
8
9
  lastMessageRef,
9
10
  isPreparingAnswer,
11
+ addFeedback,
10
12
  }: {
11
13
  conversation: any[];
12
14
  lastMessageRef: Ref<HTMLDivElement>;
13
15
  isPreparingAnswer: boolean;
16
+ addFeedback: any;
14
17
  }) {
15
18
  return (
16
19
  <>
@@ -29,11 +32,18 @@ export function ChatMessages({
29
32
 
30
33
  <div class="n-ask-message-left">
31
34
  {qa.answer && (
32
- <div class="n-ask-message-bubble n-ask-bot-message">
35
+ <div class="n-ask-message-bubble n-ask-bot-message flow">
33
36
  <div
34
37
  class="n-ask-message-answer n-ask-prose prose flow"
35
38
  dangerouslySetInnerHTML={{ __html: marked.parse(qa.answer) }}
36
39
  />
40
+ {qa.id && (
41
+ <ActionBar
42
+ answer={qa.answer}
43
+ addFeedback={addFeedback}
44
+ questionAnswerId={qa.id}
45
+ />
46
+ )}
37
47
  {qa.id && <SourcesList sources={qa.sources} />}
38
48
  </div>
39
49
  )}
@@ -2,6 +2,7 @@ import { type FunctionComponent } from 'preact';
2
2
 
3
3
  type Props = {
4
4
  name: IconName;
5
+ className?: string;
5
6
  };
6
7
 
7
8
  export default function Icon(props: Props) {
@@ -16,6 +17,7 @@ export default function Icon(props: Props) {
16
17
  viewBox="0 0 16 16"
17
18
  fill="none"
18
19
  xmlns="http://www.w3.org/2000/svg"
20
+ class={props.className}
19
21
  {...props}
20
22
  >
21
23
  <IconPath />;
@@ -117,6 +119,15 @@ const RSSIcon: FunctionComponent = () => {
117
119
  );
118
120
  };
119
121
 
122
+ const CheckIcon: FunctionComponent = () => {
123
+ return (
124
+ <path
125
+ d="M15.5281 0.223937C16.0388 0.598824 16.1531 1.31976 15.7817 1.83523L6.63858 14.5237C6.44215 14.7977 6.13857 14.9671 5.80284 14.9959C5.46712 15.0248 5.14211 14.8986 4.90639 14.6607L0.334831 10.0467C-0.11161 9.59612 -0.11161 8.86437 0.334831 8.41378C0.781272 7.9632 1.50629 7.9632 1.95273 8.41378L5.57783 12.0725L13.9352 0.476265C14.3067 -0.0392051 15.021 -0.154555 15.5317 0.220332L15.5281 0.223937Z"
126
+ fill="currentColor"
127
+ />
128
+ );
129
+ };
130
+
120
131
  const CommentIcon: FunctionComponent = () => {
121
132
  return (
122
133
  <path
@@ -126,6 +137,15 @@ const CommentIcon: FunctionComponent = () => {
126
137
  );
127
138
  };
128
139
 
140
+ const CopyIcon: FunctionComponent = () => {
141
+ return (
142
+ <path
143
+ d="M12 10.5H6C5.725 10.5 5.5 10.275 5.5 10V2C5.5 1.725 5.725 1.5 6 1.5H10.1719C10.3031 1.5 10.4312 1.55312 10.525 1.64687L12.3531 3.475C12.4469 3.56875 12.5 3.69688 12.5 3.82812V10C12.5 10.275 12.275 10.5 12 10.5ZM6 12H12C13.1031 12 14 11.1031 14 10V3.82812C14 3.29688 13.7906 2.7875 13.4156 2.4125L11.5844 0.584375C11.2094 0.209375 10.7031 0 10.1719 0H6C4.89688 0 4 0.896875 4 2V10C4 11.1031 4.89688 12 6 12ZM2 4C0.896875 4 0 4.89688 0 6V14C0 15.1031 0.896875 16 2 16H8C9.10312 16 10 15.1031 10 14V13.5H8.5V14C8.5 14.275 8.275 14.5 8 14.5H2C1.725 14.5 1.5 14.275 1.5 14V6C1.5 5.725 1.725 5.5 2 5.5H2.5V4H2Z"
144
+ fill="currentColor"
145
+ />
146
+ );
147
+ };
148
+
129
149
  const LightbulbIcon: FunctionComponent = () => {
130
150
  return (
131
151
  <>
@@ -179,6 +199,42 @@ const TerminalIcon: FunctionComponent = () => {
179
199
  );
180
200
  };
181
201
 
202
+ const ThumbsDownIcon: FunctionComponent = () => {
203
+ return (
204
+ <path
205
+ d="M12.0008 0L12.2474 0.0133305C13.4139 0.133305 14.3303 1.08643 14.3937 2.26951C14.9869 2.66276 15.3968 3.31595 15.4601 4.06579L15.4668 4.26575C15.4668 4.45571 15.4434 4.639 15.4001 4.81563C15.7401 5.19888 15.96 5.69211 15.9933 6.23865L16 6.39862C16 6.83852 15.88 7.2451 15.6734 7.59836C15.8367 7.8783 15.9467 8.1949 15.9833 8.53149L15.9967 8.7981C15.9967 10.0412 15.0535 11.0609 13.8438 11.1843L13.5972 11.1976H9.94126L10.4112 12.1974L10.5145 12.4506C10.9311 13.6404 10.4545 14.9668 9.37471 15.6166L9.13476 15.7466C7.88502 16.3331 6.412 15.8666 5.71548 14.7068L5.69548 14.6768L5.6055 14.5102L5.5855 14.4702L4.58238 12.3373C4.26911 12.9305 3.64924 13.3338 2.93272 13.3338H1.86628C0.836492 13.3338 0 12.4973 0 11.4675L0.00333259 3.99914C0.00333259 2.96936 0.839825 2.13287 1.86961 2.13287H2.93606C3.3493 2.13287 3.73256 2.26951 4.04249 2.49946C4.4824 1.78628 5.10894 1.18641 5.87544 0.779832L6.28202 0.563212L6.30535 0.553214L6.52531 0.44657L6.54864 0.436572L6.78525 0.336594C7.3418 0.116641 7.93501 0.00666513 8.53822 0.00666513L12.0008 0ZM8.53156 1.59965C8.13164 1.59965 7.73506 1.67631 7.3618 1.81961L7.20517 1.88626L7.02854 1.97291L6.62195 2.18953C5.64882 2.70608 5.01229 3.68587 4.93231 4.77564L4.92564 5.04225V8.80477L4.92897 8.9414C4.94564 9.21468 5.01229 9.48129 5.12893 9.73123L7.02187 13.7604L7.09186 13.887C7.3718 14.3436 7.95834 14.5235 8.45157 14.2936L8.54822 14.2403C8.98146 13.9803 9.17142 13.4504 9.00479 12.9739L8.9648 12.8739L7.95834 10.7344C7.8417 10.4877 7.8617 10.1978 8.00833 9.96452C8.15497 9.73123 8.40825 9.5946 8.68152 9.5946H13.5972L13.6772 9.59126C14.0537 9.5546 14.3537 9.25467 14.3903 8.87808L14.3937 8.79477C14.3937 8.55815 14.2904 8.34487 14.1204 8.1949C13.9471 8.0416 13.8471 7.82498 13.8471 7.59503C13.8471 7.36508 13.9471 7.14846 14.1204 6.99516C14.267 6.86518 14.367 6.68522 14.387 6.48527L14.3937 6.39529C14.3937 6.11535 14.247 5.8654 14.0204 5.7221C13.6638 5.49215 13.5472 5.02558 13.7538 4.65566C13.8038 4.56901 13.8371 4.46904 13.8504 4.36906L13.8571 4.26241C13.8571 3.90916 13.6272 3.60922 13.3039 3.50258C12.914 3.37594 12.6807 2.97269 12.7707 2.56945C12.7773 2.53945 12.7807 2.50946 12.784 2.4828L12.7907 2.39615C12.7907 1.98291 12.4741 1.64298 12.0708 1.60299L12.0008 1.59965H8.53156ZM1.86961 3.73253C1.72297 3.73253 1.603 3.8525 1.603 3.99914V11.4642C1.603 11.6108 1.72297 11.7308 1.86961 11.7308H2.93606C3.08269 11.7308 3.20267 11.6108 3.20267 11.4642V3.99914C3.20267 3.8525 3.08269 3.73253 2.93606 3.73253H1.86961Z"
206
+ fill="currentColor"
207
+ />
208
+ );
209
+ };
210
+
211
+ const ThumbsDownSolidIcon: FunctionComponent = () => {
212
+ return (
213
+ <path
214
+ d="M12.3871 0C13.2419 0 13.9355 0.695193 13.9355 1.55206C13.9355 1.75577 13.8935 1.94654 13.8258 2.12438C14.4839 2.30222 14.9677 2.90364 14.9677 3.62147C14.9677 3.91571 14.8839 4.19056 14.7419 4.4266C15.4581 4.56241 16 5.19293 16 5.94956C16 6.58655 15.6161 7.133 15.0677 7.37228C15.6161 7.61155 16 8.15801 16 8.795C16 9.65186 15.3065 10.3471 14.4516 10.3471H9.29032L10.2 12.6234C10.2806 12.8271 10.3226 13.047 10.3226 13.2669V13.4027C10.3226 14.2854 9.60968 15 8.72903 15C8.12581 15 7.57419 14.6573 7.30323 14.1173L5.4871 10.4861C5.27097 10.056 5.16129 9.58073 5.16129 9.09894V3.06532C5.16129 2.43803 5.44839 1.84307 5.93548 1.44859L6.32903 1.13494C7.24516 0.400949 8.38065 0 9.55161 0H12.3871ZM2.58065 2.06941C3.15161 2.06941 3.6129 2.5318 3.6129 3.10412V11.3818C3.6129 11.9541 3.15161 12.4165 2.58065 12.4165H1.03226C0.46129 12.4165 0 11.9541 0 11.3818V3.10412C0 2.5318 0.46129 2.06941 1.03226 2.06941H2.58065Z"
215
+ fill="currentColor"
216
+ />
217
+ );
218
+ };
219
+
220
+ const ThumbsUpIcon: FunctionComponent = () => {
221
+ return (
222
+ <path
223
+ d="M5.72095 1.29317C6.41399 0.133424 7.88671 -0.333142 9.13619 0.253398L9.37609 0.380037C10.5356 1.07655 11.0021 2.54957 10.4157 3.7993L9.94586 4.79908H13.601L13.8476 4.81241C15.0571 4.93572 16 5.95883 16 7.19857C16 7.63847 15.8801 8.04505 15.6735 8.39831C15.8767 8.75157 15.9967 9.15814 16 9.59805C16 10.2079 15.7701 10.7578 15.4003 11.181C15.4436 11.3577 15.4669 11.541 15.4669 11.7309C15.4669 12.5674 15.0371 13.2973 14.394 13.7272C14.3307 14.9102 13.4144 15.8667 12.2482 15.9833L12.0017 15.9967H8.53311C7.93336 15.9967 7.33694 15.8834 6.78051 15.6667L6.54394 15.5668L6.52062 15.5568L6.30071 15.4501L6.27738 15.4401L5.87089 15.2235C5.46106 15.0069 5.09454 14.7336 4.77468 14.4203C4.63807 15.3168 3.86506 16 2.93211 16H1.86589C0.836318 16 0 15.1635 0 14.1337L0.00666392 6.66535C0.00666392 5.63557 0.842982 4.79908 1.87255 4.79908H2.93878C3.29863 4.79908 3.63515 4.9024 3.9217 5.08236L5.591 1.53312L5.611 1.49313L5.70096 1.3265L5.72095 1.29651V1.29317ZM1.87255 6.39874C1.72595 6.39874 1.606 6.51871 1.606 6.66535V14.1304C1.606 14.277 1.72595 14.397 1.87255 14.397H2.93878C3.08538 14.397 3.20533 14.277 3.20533 14.1304V6.66535C3.20533 6.51871 3.08538 6.39874 2.93878 6.39874H1.87255ZM8.45648 1.69975C7.96335 1.4698 7.38026 1.64643 7.10037 2.09967L7.02707 2.23297L5.13453 6.2621C5.01791 6.51205 4.95127 6.77866 4.93461 7.05193L4.93128 7.1919V10.9544L4.93794 11.2177C5.01791 12.3075 5.65098 13.2873 6.62724 13.8071L7.01041 14.0104L7.22032 14.1137C7.63349 14.3004 8.07997 14.397 8.53311 14.397H12.0017L12.0816 14.3937C12.4848 14.3537 12.8013 14.0104 12.8013 13.5972L12.7947 13.5105C12.7913 13.4805 12.788 13.4539 12.7813 13.4239C12.6914 13.0206 12.9246 12.6174 13.3145 12.4908C13.6377 12.3874 13.8676 12.0842 13.8676 11.7309C13.8676 11.5876 13.8309 11.4576 13.7643 11.3377C13.5544 10.9678 13.671 10.4979 14.0308 10.2712C14.2574 10.1279 14.404 9.87799 14.404 9.59805C14.404 9.36143 14.3007 9.14815 14.1308 8.99818C13.9575 8.84488 13.8576 8.62826 13.8576 8.39831C13.8576 8.16836 13.9575 7.95174 14.1308 7.79844C14.3007 7.64847 14.404 7.43518 14.404 7.19857L14.4007 7.11858C14.364 6.742 14.0641 6.44206 13.6876 6.40541L13.6077 6.40207H8.69305C8.41983 6.40207 8.1666 6.2621 8.01999 6.03215C7.87339 5.8022 7.85339 5.50893 7.97001 5.26232L8.9696 3.11945C9.20283 2.61955 9.01624 2.02968 8.5531 1.75307L8.45648 1.69975Z"
224
+ fill="currentColor"
225
+ />
226
+ );
227
+ };
228
+
229
+ const ThumbsUpSolidIcon: FunctionComponent = () => {
230
+ return (
231
+ <path
232
+ d="M2.58065 4.65517C3.15161 4.65517 3.6129 5.11746 3.6129 5.68965V13.9655C3.6129 14.5377 3.15161 15 2.58065 15H1.03226C0.46129 15 0 14.5377 0 13.9655V5.68965C0 5.11746 0.46129 4.65517 1.03226 4.65517H2.58065ZM8.72903 0C9.60968 0 10.3226 0.714439 10.3226 1.59698V1.73276C10.3226 1.95259 10.2806 2.17241 10.2 2.37608L9.29032 4.65517H14.4516C15.3065 4.65517 16 5.35022 16 6.2069C16 6.84375 15.6161 7.39009 15.0677 7.62931C15.6161 7.86853 16 8.41487 16 9.05172C16 9.80819 15.4581 10.4386 14.7419 10.5744C14.8839 10.8103 14.9677 11.0851 14.9677 11.3793C14.9677 12.097 14.4839 12.6983 13.8258 12.8761C13.8968 13.0539 13.9355 13.2478 13.9355 13.4483C13.9355 14.305 13.2419 15 12.3871 15H9.55161C8.38065 15 7.24194 14.5991 6.32903 13.8653L5.93548 13.5517C5.44516 13.1606 5.16129 12.5657 5.16129 11.9353V5.90302C5.16129 5.42134 5.27419 4.94612 5.4871 4.51616L7.3 0.882543C7.57097 0.342672 8.12258 0 8.72903 0Z"
233
+ fill="currentColor"
234
+ />
235
+ );
236
+ };
237
+
182
238
  const QuestionIcon: FunctionComponent = () => {
183
239
  return (
184
240
  <path
@@ -230,8 +286,10 @@ export type IconName =
230
286
  | 'askNetlify'
231
287
  | 'book'
232
288
  | 'caretRight'
289
+ | 'check'
233
290
  | 'code'
234
291
  | 'comment'
292
+ | 'copy'
235
293
  | 'cube'
236
294
  | 'lightbulb'
237
295
  | 'link'
@@ -240,6 +298,10 @@ export type IconName =
240
298
  | 'rss'
241
299
  | 'search'
242
300
  | 'terminal'
301
+ | 'thumbsDown'
302
+ | 'thumbsDownSolid'
303
+ | 'thumbsUp'
304
+ | 'thumbsUpSolid'
243
305
  | 'question'
244
306
  | 'linkedin'
245
307
  | 'netlify'
@@ -251,14 +313,20 @@ const iconPathMap: Record<IconName, FunctionComponent> = {
251
313
  askNetlify: AskNetlify,
252
314
  book: BookIcon,
253
315
  caretRight: CaretRightIcon,
316
+ check: CheckIcon,
254
317
  code: CodeIcon,
255
318
  comment: CommentIcon,
319
+ copy: CopyIcon,
256
320
  link: LinkIcon,
257
321
  lightbulb: LightbulbIcon,
258
322
  pageWithLines: PageWithLinesIcon,
259
323
  rss: RSSIcon,
260
324
  search: SearchIcon,
261
325
  terminal: TerminalIcon,
326
+ thumbsDown: ThumbsDownIcon,
327
+ thumbsDownSolid: ThumbsDownSolidIcon,
328
+ thumbsUp: ThumbsUpIcon,
329
+ thumbsUpSolid: ThumbsUpSolidIcon,
262
330
  question: QuestionIcon,
263
331
  bluesky: BlueSkyIcon,
264
332
  linkedin: LinkedInIcon,
@@ -5,6 +5,7 @@
5
5
  }
6
6
 
7
7
  .n-popover-trigger {
8
+ display: block;
8
9
  background-color: transparent;
9
10
  border: none;
10
11
  padding: 0;
@@ -17,7 +18,7 @@
17
18
  position: absolute;
18
19
  background-color: var(--color-bg-2);
19
20
  color: var(--color-text);
20
- padding: var(--space-xs) var(--space-s);
21
+ padding: var(--n-popover-padding, var(--space-xs) var(--space-s));
21
22
  border-radius: var(--radius-s);
22
23
  opacity: 0;
23
24
  pointer-events: none;
@@ -31,23 +32,17 @@
31
32
  border-style: solid;
32
33
  }
33
34
 
34
- .n-popover-container:focus-within .n-popover,
35
35
  .n-popover-container:hover .n-popover {
36
36
  opacity: 1;
37
37
  pointer-events: auto;
38
38
  }
39
39
 
40
- .n-popover-container:focus-within .n-popover-trigger,
41
- .n-popover-container:hover .n-popover-trigger {
42
- box-shadow: 0px 1px 0px 0px var(--neutral-300);
43
- border-radius: 0;
44
- }
45
-
46
40
  .n-popover-top .n-popover {
47
41
  bottom: 145%;
48
42
  left: 50%;
49
43
  transform: translateX(-50%);
50
- width: 255px;
44
+ width: max-content;
45
+ max-width: var(--n-popover-width, 255px);
51
46
  box-shadow: var(--shadow-light);
52
47
  }
53
48
 
@@ -24,9 +24,9 @@ const Popover: FunctionComponent<Props> = ({
24
24
 
25
25
  return (
26
26
  <div id={tooltipId} class={`n-popover-container n-popover-${position} ${className}`} {...rest}>
27
- <button class="n-popover-trigger" aria-describedby={`${tooltipId}-popover`} type="button">
27
+ <span class="n-popover-trigger" aria-describedby={`${tooltipId}-popover`}>
28
28
  {children}
29
- </button>
29
+ </span>
30
30
  <div
31
31
  id={`${tooltipId}-popover`}
32
32
  class="n-popover"
@@ -19,7 +19,7 @@
19
19
  --blue-800: color(srgb 0.12549019607843137 0.21176470588235294 0.6313725490196078);
20
20
  --blue-900: color(srgb 0.10588235294117647 0.12549019607843137 0.3568627450980392);
21
21
  --button-outline-bg-color: color(srgb 0 0 0 / 0);
22
- --button-outline-bg-color-hover: color(srgb 0.19607843137254902 0.9019607843137255 0.8862745098039215 / 0.2);
22
+ --button-outline-bg-color-hover: color(srgb 0.8392156862745098 0.9803921568627451 0.9764705882352941);
23
23
  --button-outline-stroke-color: var(--neutral-800);
24
24
  --button-outline-text-color: var(--neutral-800);
25
25
  --button-primary-bg-color: var(--teal-200);
@@ -211,7 +211,7 @@
211
211
  --badge-text-color: var(--neutral-100);
212
212
  --blockquote-accent-color: var(--teal-200);
213
213
  --button-outline-bg-color: color(srgb 0 0 0 / 0);
214
- --button-outline-bg-color-hover: color(srgb 0.6509803921568628 1 0.9921568627450981 / 0.09803921568627451);
214
+ --button-outline-bg-color-hover: var(--neutral-500);
215
215
  --button-outline-stroke-color: var(--teal-200);
216
216
  --button-outline-text-color: var(--teal-200);
217
217
  --button-primary-bg-color: var(--teal-200);
@@ -296,7 +296,7 @@
296
296
  --badge-text-color: var(--neutral-100);
297
297
  --blockquote-accent-color: var(--teal-200);
298
298
  --button-outline-bg-color: color(srgb 0 0 0 / 0);
299
- --button-outline-bg-color-hover: color(srgb 0.6509803921568628 1 0.9921568627450981 / 0.09803921568627451);
299
+ --button-outline-bg-color-hover: var(--neutral-500);
300
300
  --button-outline-stroke-color: var(--teal-200);
301
301
  --button-outline-text-color: var(--teal-200);
302
302
  --button-primary-bg-color: var(--teal-200);
@@ -380,7 +380,7 @@
380
380
  --badge-text-color: var(--neutral-500);
381
381
  --blockquote-accent-color: var(--blue-700);
382
382
  --button-outline-bg-color: color(srgb 0 0 0 / 0);
383
- --button-outline-bg-color-hover: color(srgb 0.19607843137254902 0.9019607843137255 0.8862745098039215 / 0.2);
383
+ --button-outline-bg-color-hover: color(srgb 0.8392156862745098 0.9803921568627451 0.9764705882352941);
384
384
  --button-outline-stroke-color: var(--neutral-800);
385
385
  --button-outline-text-color: var(--neutral-800);
386
386
  --button-primary-bg-color: var(--teal-200);