@netlify/spark-ui 1.12.4 → 1.13.1
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.
- package/dist/assets/AskNetlify.css +1 -1
- package/dist/assets/Popover.css +1 -0
- package/dist/chunks/{AskNetlify.1ejGUA_O.js → AskNetlify.CNYCiNSp.js} +340 -327
- package/dist/components/preact/AskNetlify/AskNetlify.js +3 -2
- package/dist/components/preact/Popover/Popover.d.ts +10 -0
- package/dist/components/preact/Popover/Popover.js +27 -0
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +1 -1
- package/dist/components/preact/index.js +1 -1
- package/package.json +1 -1
- package/packages/components/preact/AskNetlify/AskNetlify.css +6 -0
- package/packages/components/preact/AskNetlify/AskNetlify.tsx +14 -0
- package/packages/components/preact/Popover/Popover.css +102 -0
- package/packages/components/preact/Popover/Popover.tsx +40 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
2
|
import "../../../chunks/hooks.module.DGkdD5n9.js";
|
|
3
|
-
import { A as
|
|
3
|
+
import { A as d } from "../../../chunks/AskNetlify.CNYCiNSp.js";
|
|
4
4
|
import "./components/QuestionList/questions.js";
|
|
5
5
|
import "./components/QuestionList/QuestionList.js";
|
|
6
6
|
import "./components/BackButton.js";
|
|
7
7
|
import "./components/ChatMessages.js";
|
|
8
|
+
import "../Popover/Popover.js";
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
d as default
|
|
10
11
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FunctionComponent } from 'preact';
|
|
2
|
+
interface Props {
|
|
3
|
+
id?: string;
|
|
4
|
+
content: string;
|
|
5
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
6
|
+
class?: string;
|
|
7
|
+
children: preact.ComponentChildren;
|
|
8
|
+
}
|
|
9
|
+
declare const Popover: FunctionComponent<Props>;
|
|
10
|
+
export default Popover;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { u as r } from "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import { g as a } from "../../../chunks/hooks.module.DGkdD5n9.js";
|
|
3
|
+
import '../../../assets/Popover.css';const v = ({
|
|
4
|
+
id: e,
|
|
5
|
+
content: t,
|
|
6
|
+
position: p = "top",
|
|
7
|
+
class: n = "",
|
|
8
|
+
children: s,
|
|
9
|
+
...i
|
|
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 }),
|
|
14
|
+
/* @__PURE__ */ r(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
id: `${o}-popover`,
|
|
18
|
+
class: "n-popover",
|
|
19
|
+
role: "tooltip",
|
|
20
|
+
dangerouslySetInnerHTML: { __html: t }
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
v as default
|
|
27
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { u as e } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
2
|
import { A as g, y as h, d as k } from "../../../../../chunks/hooks.module.DGkdD5n9.js";
|
|
3
|
-
import { A as w, K as b } from "../../../../../chunks/AskNetlify.
|
|
3
|
+
import { A as w, K as b } from "../../../../../chunks/AskNetlify.CNYCiNSp.js";
|
|
4
4
|
import K from "../../../Modal/Modal.js";
|
|
5
5
|
import d from "../../../KeyboardKey/KeyboardKey.js";
|
|
6
6
|
import L 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.
|
|
7
|
+
import { A as S } from "../../chunks/AskNetlify.CNYCiNSp.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
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
/* ----------------------------- */
|
|
4
4
|
/* Layout Containers */
|
|
5
5
|
/* ----------------------------- */
|
|
6
|
+
.grecaptcha-badge {
|
|
7
|
+
visibility: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
.n-ask-chat-container {
|
|
7
11
|
opacity: 0;
|
|
8
12
|
animation: appearContainer 120ms ease-in-out forwards;
|
|
@@ -10,6 +14,7 @@
|
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
.n-ask-conversation {
|
|
17
|
+
position: relative;
|
|
13
18
|
display: grid;
|
|
14
19
|
align-items: flex-end;
|
|
15
20
|
gap: var(--space-s);
|
|
@@ -23,6 +28,7 @@
|
|
|
23
28
|
.n-ask-form {
|
|
24
29
|
display: flex;
|
|
25
30
|
align-items: center;
|
|
31
|
+
gap: var(--space-s);
|
|
26
32
|
position: relative;
|
|
27
33
|
height: var(--n-search-input-height);
|
|
28
34
|
background-color: var(--search-input-bg-color);
|
|
@@ -5,6 +5,8 @@ import { QuestionList } from './components/QuestionList/QuestionList';
|
|
|
5
5
|
import { BackButton } from './components/BackButton';
|
|
6
6
|
import { ChatMessages } from './components/ChatMessages';
|
|
7
7
|
|
|
8
|
+
import Popover from '../Popover/Popover';
|
|
9
|
+
|
|
8
10
|
import './AskNetlify.css';
|
|
9
11
|
|
|
10
12
|
interface Props {
|
|
@@ -78,6 +80,18 @@ export default function AskNetlify({ setModalState, initialQuery }: Props) {
|
|
|
78
80
|
placeholder="Ask a question..."
|
|
79
81
|
disabled={isPreparingAnswer || isGeneratingAnswer}
|
|
80
82
|
/>
|
|
83
|
+
{
|
|
84
|
+
<Popover
|
|
85
|
+
id="recaptcha"
|
|
86
|
+
content={`<p>
|
|
87
|
+
This site is protected by reCAPTCHA and the Google
|
|
88
|
+
<a href="https://policies.google.com/privacy">Privacy Policy</a> and
|
|
89
|
+
<a href="https://policies.google.com/terms">Terms of Service</a> apply.
|
|
90
|
+
</p>`}
|
|
91
|
+
>
|
|
92
|
+
protected by reCAPTCHA
|
|
93
|
+
</Popover>
|
|
94
|
+
}
|
|
81
95
|
|
|
82
96
|
{isGeneratingAnswer ? (
|
|
83
97
|
<button
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
.n-popover-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
font-size: var(--font-size-text-xs);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.n-popover-trigger {
|
|
8
|
+
background-color: transparent;
|
|
9
|
+
border: none;
|
|
10
|
+
padding: 0;
|
|
11
|
+
font: inherit;
|
|
12
|
+
color: var(--color-text-weak);
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.n-popover {
|
|
17
|
+
position: absolute;
|
|
18
|
+
background-color: var(--color-bg-2);
|
|
19
|
+
color: var(--color-text);
|
|
20
|
+
padding: var(--space-xs) var(--space-s);
|
|
21
|
+
border-radius: var(--radius-s);
|
|
22
|
+
opacity: 0;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
transition: opacity 0.2s ease-in-out;
|
|
25
|
+
z-index: 10;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.n-popover::after {
|
|
29
|
+
content: '';
|
|
30
|
+
position: absolute;
|
|
31
|
+
border-style: solid;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.n-popover-container:focus-within .n-popover,
|
|
35
|
+
.n-popover-container:hover .n-popover {
|
|
36
|
+
opacity: 1;
|
|
37
|
+
pointer-events: auto;
|
|
38
|
+
}
|
|
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
|
+
.n-popover-top .n-popover {
|
|
47
|
+
bottom: 145%;
|
|
48
|
+
left: 50%;
|
|
49
|
+
transform: translateX(-50%);
|
|
50
|
+
width: 260px;
|
|
51
|
+
box-shadow: var(--shadow-light);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.n-popover-top .n-popover::after {
|
|
55
|
+
top: 100%;
|
|
56
|
+
left: 50%;
|
|
57
|
+
margin-left: -5px;
|
|
58
|
+
border-width: 5px;
|
|
59
|
+
border-color: var(--color-bg-2) transparent transparent transparent;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.n-popover-bottom .n-popover {
|
|
63
|
+
top: 145%;
|
|
64
|
+
left: 50%;
|
|
65
|
+
transform: translateX(-50%);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.n-popover-bottom .n-popover::after {
|
|
69
|
+
bottom: 100%;
|
|
70
|
+
left: 50%;
|
|
71
|
+
margin-left: -5px;
|
|
72
|
+
border-width: 5px;
|
|
73
|
+
border-color: transparent transparent var(--color-bg-2) transparent;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.n-popover-left .n-popover {
|
|
77
|
+
right: 125%;
|
|
78
|
+
top: 50%;
|
|
79
|
+
transform: translateY(-50%);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.n-popover-left .n-popover::after {
|
|
83
|
+
top: 50%;
|
|
84
|
+
left: 100%;
|
|
85
|
+
margin-top: -5px;
|
|
86
|
+
border-width: 5px;
|
|
87
|
+
border-color: transparent transparent transparent var(--color-bg-2);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.n-popover-right .n-popover {
|
|
91
|
+
left: 125%;
|
|
92
|
+
top: 50%;
|
|
93
|
+
transform: translateY(-50%);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.n-popover-right .n-popover::after {
|
|
97
|
+
top: 50%;
|
|
98
|
+
right: 100%;
|
|
99
|
+
margin-top: -5px;
|
|
100
|
+
border-width: 5px;
|
|
101
|
+
border-color: transparent var(--color-bg-2) transparent transparent;
|
|
102
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useId } from 'preact/hooks';
|
|
2
|
+
import type { FunctionComponent } from 'preact';
|
|
3
|
+
|
|
4
|
+
import './Popover.css';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
id?: string;
|
|
8
|
+
content: string;
|
|
9
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
10
|
+
class?: string;
|
|
11
|
+
children: preact.ComponentChildren;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Popover: FunctionComponent<Props> = ({
|
|
15
|
+
id,
|
|
16
|
+
content,
|
|
17
|
+
position = 'top',
|
|
18
|
+
class: className = '',
|
|
19
|
+
children,
|
|
20
|
+
...rest
|
|
21
|
+
}) => {
|
|
22
|
+
const generatedId = useId();
|
|
23
|
+
const tooltipId = id || generatedId;
|
|
24
|
+
|
|
25
|
+
return (
|
|
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">
|
|
28
|
+
{children}
|
|
29
|
+
</button>
|
|
30
|
+
<div
|
|
31
|
+
id={`${tooltipId}-popover`}
|
|
32
|
+
class="n-popover"
|
|
33
|
+
role="tooltip"
|
|
34
|
+
dangerouslySetInnerHTML={{ __html: content }}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default Popover;
|