@netlify/spark-ui 1.6.0 → 1.8.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 -0
- package/dist/assets/SearchHeading.css +1 -1
- package/dist/assets/SearchLink.css +1 -1
- package/dist/assets/SearchModal.css +1 -1
- package/dist/components/preact/AskNetlify/AskNetlify.d.ts +7 -0
- package/dist/components/preact/AskNetlify/AskNetlify.js +20 -0
- package/dist/components/preact/AskNetlify/components/BackButton.d.ts +5 -0
- package/dist/components/preact/AskNetlify/components/BackButton.js +20 -0
- package/dist/components/preact/AskNetlify/components/ChatInterface.d.ts +7 -0
- package/dist/components/preact/AskNetlify/components/ChatInterface.js +53 -0
- package/dist/components/preact/AskNetlify/components/ChatMessages.d.ts +3 -0
- package/dist/components/preact/AskNetlify/components/ChatMessages.js +19 -0
- package/dist/components/preact/AskNetlify/components/QuestionList/QuestionList.d.ts +4 -0
- package/dist/components/preact/AskNetlify/components/QuestionList/QuestionList.js +23 -0
- package/dist/components/preact/AskNetlify/components/QuestionList/questions.d.ts +1 -0
- package/dist/components/preact/AskNetlify/components/QuestionList/questions.js +10 -0
- package/dist/components/preact/Icon/index.d.ts +2 -2
- package/dist/components/preact/Icon/index.js +108 -72
- package/dist/components/preact/SearchModal/components/SearchInput.d.ts +2 -0
- package/dist/components/preact/SearchModal/components/SearchLink/SearchLink.d.ts +1 -1
- package/dist/components/preact/SearchModal/components/SearchLink/SearchLink.js +34 -16
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +76 -53
- package/dist/components/preact/SearchModal/components/SearchWindow.d.ts +1 -1
- package/dist/components/preact/SearchModal/components/SearchWindow.js +49 -29
- package/dist/components/preact/SearchModal/hooks/useKeyboardNav.js +6 -6
- package/dist/components/preact/SearchModal/hooks/useSearchToggles.d.ts +3 -1
- package/dist/components/preact/SearchModal/hooks/useSearchToggles.js +13 -10
- package/dist/components/preact/SearchModal/types/search.types.d.ts +6 -1
- package/dist/components/preact/SpriteIcon/index.d.ts +7 -0
- package/dist/components/preact/SpriteIcon/index.js +7 -0
- package/dist/components/preact/index.d.ts +1 -0
- package/dist/components/preact/index.js +6 -4
- package/dist/utils/theme.d.ts +3 -0
- package/package.json +4 -1
- package/packages/components/Ticker.astro +29 -18
- package/packages/components/TrustBarTicker.astro +26 -0
- package/packages/components/TrustBarTickerItem.astro +54 -0
- package/packages/components/preact/AskNetlify/AskNetlify.css +282 -0
- package/packages/components/preact/AskNetlify/AskNetlify.tsx +22 -0
- package/packages/components/preact/AskNetlify/components/BackButton.tsx +19 -0
- package/packages/components/preact/AskNetlify/components/ChatInterface.tsx +79 -0
- package/packages/components/preact/AskNetlify/components/ChatMessages.tsx +33 -0
- package/packages/components/preact/AskNetlify/components/QuestionList/QuestionList.tsx +27 -0
- package/packages/components/preact/AskNetlify/components/QuestionList/questions.ts +10 -0
- package/packages/components/preact/Icon/index.tsx +72 -53
- package/packages/components/preact/SearchModal/components/SearchHeading/SearchHeading.css +4 -3
- package/packages/components/preact/SearchModal/components/SearchInput.tsx +9 -7
- package/packages/components/preact/SearchModal/components/SearchLink/SearchLink.css +20 -10
- package/packages/components/preact/SearchModal/components/SearchLink/SearchLink.tsx +27 -7
- package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.css +68 -29
- package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.tsx +59 -30
- package/packages/components/preact/SearchModal/components/SearchWindow.tsx +34 -18
- package/packages/components/preact/SearchModal/hooks/useKeyboardNav.ts +2 -2
- package/packages/components/preact/SearchModal/hooks/useSearchToggles.ts +11 -3
- package/packages/components/preact/SearchModal/types/search.types.tsx +5 -2
- package/packages/components/preact/SpriteIcon/index.tsx +13 -0
- package/packages/components/preact/index.ts +1 -0
- package/packages/styles/tokens.css +72 -24
- package/packages/utils/theme.ts +16 -0
|
@@ -7,92 +7,93 @@ type Props = {
|
|
|
7
7
|
export default function Icon(props: Props) {
|
|
8
8
|
const IconPath = iconPathMap[props.name];
|
|
9
9
|
|
|
10
|
+
if (!IconPath) return;
|
|
11
|
+
|
|
10
12
|
return (
|
|
11
|
-
<svg
|
|
12
|
-
|
|
13
|
+
<svg
|
|
14
|
+
id={`icon-${props.name}`}
|
|
15
|
+
data-icon={props.name}
|
|
16
|
+
viewBox="0 0 16 16"
|
|
17
|
+
fill="none"
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
<IconPath />;
|
|
13
22
|
</svg>
|
|
14
23
|
);
|
|
15
24
|
}
|
|
16
25
|
|
|
17
|
-
const
|
|
18
|
-
return (
|
|
19
|
-
<path
|
|
20
|
-
d="M8.5328 26.6769C8.5328 16.6562 16.6562 8.5328 26.6769 8.5328C36.6977 8.5328 44.8211 16.6562 44.8211 26.6769C44.8211 36.6977 36.6977 44.8211 26.6769 44.8211C16.6562 44.8211 8.5328 36.6977 8.5328 26.6769ZM26.6769 0C11.9437 0 0 11.9437 0 26.6769C0 41.4102 11.9437 53.3539 26.6769 53.3539C32.5038 53.3539 37.8943 51.4858 42.2822 48.3158L56.7168 62.7504C58.3829 64.4165 61.0843 64.4165 62.7504 62.7504C64.4165 61.0843 64.4165 58.3829 62.7504 56.7168L48.3158 42.2822C51.4858 37.8943 53.3539 32.5038 53.3539 26.6769C53.3539 11.9437 41.4102 0 26.6769 0Z"
|
|
21
|
-
fill="currentColor"
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const SparklesIcon: FunctionComponent = () => {
|
|
27
|
-
return (
|
|
28
|
-
<path
|
|
29
|
-
d="M45.264 17.719L37.08 15.439C35.64 14.987 35.64 13.011 37.08 12.631L45.264 10.275C45.4922 10.1958 45.6994 10.0656 45.8699 9.89446C46.0404 9.72329 46.1697 9.51555 46.248 9.287L48.6 1.083C49.052 -0.361 51.024 -0.361 51.4 1.083L53.676 9.287C53.7543 9.51555 53.8836 9.72329 54.0541 9.89446C54.2246 10.0656 54.4318 10.1958 54.66 10.275L62.92 12.635C64.36 13.087 64.36 15.063 62.92 15.443L54.736 17.723C54.5078 17.8022 54.3006 17.9324 54.1301 18.1035C53.9596 18.2747 53.8303 18.4824 53.752 18.711L51.4 26.915C50.948 28.359 48.976 28.359 48.6 26.915L46.248 18.711C46.1694 18.4826 46.0401 18.275 45.8696 18.1039C45.6992 17.9327 45.4921 17.8025 45.264 17.723V17.719ZM29.36 33.663L42.348 37.615C44.536 38.271 44.536 41.643 42.424 42.383L29.436 46.335C29.0506 46.4707 28.7043 46.6988 28.4274 46.9994C28.1506 47.2999 27.9516 47.6637 27.848 48.059L24.224 62.211C24.1201 62.7151 23.8456 63.1679 23.4466 63.4931C23.0476 63.8182 22.5487 63.9958 22.034 63.9958C21.5193 63.9958 21.0204 63.8182 20.6214 63.4931C20.2224 63.1679 19.9479 62.7151 19.844 62.211L16.22 48.059C16.1164 47.6637 15.9174 47.2999 15.6406 46.9994C15.3637 46.6988 15.0174 46.4707 14.632 46.335L1.644 42.383C-0.548 41.727 -0.548 38.271 1.644 37.615L14.556 33.663C14.9414 33.5273 15.2877 33.2992 15.5646 32.9986C15.8414 32.6981 16.0404 32.3343 16.144 31.939L19.768 17.787C19.8719 17.2829 20.1464 16.8301 20.5454 16.5049C20.9444 16.1798 21.4433 16.0022 21.958 16.0022C22.4727 16.0022 22.9716 16.1798 23.3706 16.5049C23.7696 16.8301 24.0441 17.2829 24.148 17.787L27.772 31.939C28 32.759 28.604 33.419 29.36 33.663Z"
|
|
30
|
-
fill="currentColor"
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const NetlifyIcon: FunctionComponent = () => {
|
|
26
|
+
const AskNetlify: FunctionComponent = () => {
|
|
36
27
|
return (
|
|
37
28
|
<>
|
|
38
29
|
<path
|
|
39
|
-
|
|
30
|
+
id="ask-netlify-tick-3"
|
|
31
|
+
d="M9.26465 1.02094L9.31322 0.921348L10.0528 0.666687L10.1524 0.715259L10.5563 1.9638L10.2999 2.4895L10.195 2.52628L9.6685 2.26948L9.26465 1.02094Z"
|
|
40
32
|
fill="currentColor"
|
|
41
33
|
/>
|
|
42
34
|
<path
|
|
43
|
-
|
|
35
|
+
id="ask-netlify-tick-1"
|
|
36
|
+
d="M15.5915 3.11667L15.6942 3.15818L15.9999 3.8782L15.9584 3.98093L14.741 4.4709L14.1987 4.25179L14.1547 4.14977L14.3742 3.60663L15.5915 3.11667Z"
|
|
44
37
|
fill="currentColor"
|
|
45
38
|
/>
|
|
46
39
|
<path
|
|
47
|
-
|
|
40
|
+
id="ask-netlify-tick-2"
|
|
41
|
+
d="M12.8306 0.944052L12.9353 0.907978L13.6384 1.25087L13.6744 1.35564L12.9408 2.91375L12.3877 3.10417L12.2876 3.05604L12.0969 2.50216L12.8306 0.944052Z"
|
|
48
42
|
fill="currentColor"
|
|
49
43
|
/>
|
|
50
44
|
<path
|
|
51
|
-
|
|
45
|
+
id="ask-netlify-eye-left"
|
|
46
|
+
d="M5.60625 10.7823C5.60625 11.421 5.09138 11.9387 4.45625 11.9387C3.82112 11.9387 3.30625 11.421 3.30625 10.7823C3.30625 10.1436 3.82112 9.62585 4.45625 9.62585C5.09138 9.62585 5.60625 10.1436 5.60625 10.7823Z"
|
|
52
47
|
fill="currentColor"
|
|
53
48
|
/>
|
|
54
49
|
<path
|
|
55
|
-
|
|
50
|
+
id="ask-netlify-eye-right"
|
|
51
|
+
d="M10.8777 11.9387C11.5129 11.9387 12.0277 11.421 12.0277 10.7823C12.0277 10.1436 11.5129 9.62585 10.8777 9.62585C10.2426 9.62585 9.72774 10.1436 9.72774 10.7823C9.72774 11.421 10.2426 11.9387 10.8777 11.9387Z"
|
|
56
52
|
fill="currentColor"
|
|
57
53
|
/>
|
|
58
54
|
<path
|
|
59
|
-
d="
|
|
55
|
+
d="M8.41582 10.9491L8.43331 10.994L8.43337 11.2417L8.41589 11.2866L7.86046 12.4215L7.78018 12.4806H7.5763L7.49602 12.4215L6.91751 11.2866L6.90003 11.2417L6.89997 11.2114V10.994L6.91745 10.9491L7.55316 10.526H7.75704L8.41582 10.9491Z"
|
|
60
56
|
fill="currentColor"
|
|
61
57
|
/>
|
|
62
58
|
<path
|
|
63
|
-
|
|
59
|
+
fill-rule="evenodd"
|
|
60
|
+
clip-rule="evenodd"
|
|
61
|
+
d="M7.86997 4.00002C11.9918 4.00002 15.3333 6.70814 15.3333 10.853C15.3333 13.3274 13.3386 15.3334 10.878 15.3334H0V10.853C0 6.70814 3.34157 4.00002 7.46336 4.00002H7.86997ZM0.990302 10.5245C0.990302 8.69571 2.51537 7.15558 4.33747 7.15558C5.71877 7.15558 6.90206 7.9938 7.41504 9.19232C7.41751 9.1981 7.42291 9.20918 7.42291 9.20918H7.91072C7.91072 9.20918 7.91612 9.1981 7.91859 9.19232C8.43157 7.9938 9.61486 7.15558 10.9962 7.15558C12.8183 7.15558 14.3433 8.69571 14.3433 10.5245C14.3433 12.2311 12.9812 13.8499 11.447 13.8845H4.15184C2.38987 13.7867 0.990302 12.323 0.990302 10.5245Z"
|
|
64
62
|
fill="currentColor"
|
|
65
63
|
/>
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
<rect
|
|
65
|
+
id="ask-netlify-eyelid-left"
|
|
66
|
+
x="3"
|
|
67
|
+
y="7.3"
|
|
68
|
+
width="3"
|
|
69
|
+
height="2"
|
|
70
|
+
fill="var(--search-bg-color, currentColor)"
|
|
71
|
+
/>
|
|
72
|
+
<rect
|
|
73
|
+
id="ask-netlify-eyelid-right"
|
|
74
|
+
x="9.7"
|
|
75
|
+
y="7.3"
|
|
76
|
+
width="3"
|
|
77
|
+
height="2"
|
|
78
|
+
fill="var(--search-bg-color, currentColor)"
|
|
69
79
|
/>
|
|
70
80
|
</>
|
|
71
81
|
);
|
|
72
82
|
};
|
|
73
83
|
|
|
74
|
-
const
|
|
75
|
-
return (
|
|
76
|
-
<path
|
|
77
|
-
d="M0 11C0 4.925 4.925 0 11 0H49C52.8625 0 56 3.1375 56 7V43C56 45.7875 54.3625 48.2 52 49.325V58H53C54.6625 58 56 59.3375 56 61C56 62.6625 54.6625 64 53 64H10C4.475 64 0 59.525 0 54C0 53.6625 0.0125 53.325 0.05 53H0V11ZM10 50C7.7875 50 6 51.7875 6 54C6 56.2125 7.7875 58 10 58H46V50H10ZM6 44.8375C7.225 44.3 8.575 44 10 44H49C49.55 44 50 43.55 50 43V7C50 6.45 49.55 6 49 6H11C8.2375 6 6 8.2375 6 11V44.8375ZM19 14H41C42.6625 14 44 15.3375 44 17C44 18.6625 42.6625 20 41 20H19C17.3375 20 16 18.6625 16 17C16 15.3375 17.3375 14 19 14ZM19 24H41C42.6625 24 44 25.3375 44 27C44 28.6625 42.6625 30 41 30H19C17.3375 30 16 28.6625 16 27C16 25.3375 17.3375 24 19 24Z"
|
|
78
|
-
fill="currentColor"
|
|
79
|
-
/>
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const PencilIcon: FunctionComponent = () => {
|
|
84
|
+
const SearchIcon: FunctionComponent = () => {
|
|
84
85
|
return (
|
|
85
86
|
<path
|
|
86
|
-
d="
|
|
87
|
+
d="M12.3756 6.68667C12.3756 7.94156 11.9681 9.10077 11.2818 10.0413L14.7436 13.5052C15.0855 13.8469 15.0855 14.4019 14.7436 14.7437C14.4018 15.0854 13.8467 15.0854 13.5049 14.7437L10.043 11.2797C9.10235 11.9687 7.94292 12.3733 6.68778 12.3733C3.54583 12.3733 1 9.828 1 6.68667C1 3.54533 3.54583 1 6.68778 1C9.82973 1 12.3756 3.54533 12.3756 6.68667ZM6.68778 10.6236C7.20488 10.6236 7.71692 10.5218 8.19467 10.3239C8.67241 10.1261 9.1065 9.83607 9.47215 9.47049C9.83779 9.10491 10.1278 8.67091 10.3257 8.19326C10.5236 7.71561 10.6255 7.20367 10.6255 6.68667C10.6255 6.16966 10.5236 5.65772 10.3257 5.18007C10.1278 4.70242 9.83779 4.26842 9.47215 3.90284C9.1065 3.53726 8.67241 3.24727 8.19467 3.04942C7.71692 2.85158 7.20488 2.74974 6.68778 2.74974C6.17067 2.74974 5.65863 2.85158 5.18089 3.04942C4.70315 3.24727 4.26906 3.53726 3.90341 3.90284C3.53776 4.26842 3.24771 4.70242 3.04982 5.18007C2.85194 5.65772 2.75009 6.16966 2.75009 6.68667C2.75009 7.20367 2.85194 7.71561 3.04982 8.19326C3.24771 8.67091 3.53776 9.10491 3.90341 9.47049C4.26906 9.83607 4.70315 10.1261 5.18089 10.3239C5.65863 10.5218 6.17067 10.6236 6.68778 10.6236Z"
|
|
87
88
|
fill="currentColor"
|
|
88
89
|
/>
|
|
89
90
|
);
|
|
90
91
|
};
|
|
91
92
|
|
|
92
|
-
const
|
|
93
|
+
const BookIcon: FunctionComponent = () => {
|
|
93
94
|
return (
|
|
94
95
|
<path
|
|
95
|
-
d="
|
|
96
|
+
d="M4.57143 1C3.15179 1 2 2.17578 2 3.625V12.375C2 13.8242 3.15179 15 4.57143 15H12.2857H13.1429C13.617 15 14 14.609 14 14.125C14 13.641 13.617 13.25 13.1429 13.25V11.5C13.617 11.5 14 11.109 14 10.625V1.875C14 1.39102 13.617 1 13.1429 1H12.2857H4.57143ZM4.57143 11.5H11.4286V13.25H4.57143C4.09732 13.25 3.71429 12.859 3.71429 12.375C3.71429 11.891 4.09732 11.5 4.57143 11.5ZM5.42857 4.9375C5.42857 4.69687 5.62143 4.5 5.85714 4.5H11C11.2357 4.5 11.4286 4.69687 11.4286 4.9375C11.4286 5.17813 11.2357 5.375 11 5.375H5.85714C5.62143 5.375 5.42857 5.17813 5.42857 4.9375ZM5.85714 6.25H11C11.2357 6.25 11.4286 6.44687 11.4286 6.6875C11.4286 6.92813 11.2357 7.125 11 7.125H5.85714C5.62143 7.125 5.42857 6.92813 5.42857 6.6875C5.42857 6.44687 5.62143 6.25 5.85714 6.25Z"
|
|
96
97
|
fill="currentColor"
|
|
97
98
|
/>
|
|
98
99
|
);
|
|
@@ -101,7 +102,7 @@ const CubeIcon: FunctionComponent = () => {
|
|
|
101
102
|
const CaretRightIcon: FunctionComponent = () => {
|
|
102
103
|
return (
|
|
103
104
|
<path
|
|
104
|
-
d="
|
|
105
|
+
d="M11.7071 7.29399C12.0976 7.68448 12.0976 8.31864 11.7071 8.70914L5.70826 14.7071C5.31771 15.0976 4.68346 15.0976 4.29291 14.7071C3.90236 14.3166 3.90236 13.6825 4.29291 13.292L9.58563 8L4.29604 2.70802C3.90549 2.31753 3.90549 1.68336 4.29604 1.29287C4.68658 0.902376 5.32084 0.902376 5.71138 1.29287L11.7102 7.29086L11.7071 7.29399Z"
|
|
105
106
|
fill="currentColor"
|
|
106
107
|
/>
|
|
107
108
|
);
|
|
@@ -119,12 +120,29 @@ const RSSIcon: FunctionComponent = () => {
|
|
|
119
120
|
const CommentIcon: FunctionComponent = () => {
|
|
120
121
|
return (
|
|
121
122
|
<path
|
|
122
|
-
d="M15
|
|
123
|
+
d="M15 7.57143C15 10.6491 11.8666 13.1429 8.00041 13.1429C6.98601 13.1429 6.02357 12.9714 5.15409 12.6634C4.82871 12.8964 4.29828 13.2152 3.66941 13.483C3.01319 13.7616 2.22301 14 1.43829 14C1.26056 14 1.10198 13.8955 1.03362 13.7348C0.965266 13.5741 1.00355 13.392 1.12658 13.2688L1.13479 13.2607C1.14299 13.2527 1.15393 13.242 1.17033 13.2232C1.20041 13.1911 1.24689 13.1402 1.30431 13.0705C1.41641 12.9366 1.56679 12.7384 1.71991 12.492C1.99333 12.0473 2.25308 11.4634 2.30503 10.8071C1.48477 9.89643 1.00081 8.77946 1.00081 7.57143C1.00081 4.49375 4.13422 2 8.00041 2C11.8666 2 15 4.49375 15 7.57143Z"
|
|
123
124
|
fill="currentColor"
|
|
124
125
|
/>
|
|
125
126
|
);
|
|
126
127
|
};
|
|
127
128
|
|
|
129
|
+
const LightbulbIcon: FunctionComponent = () => {
|
|
130
|
+
return (
|
|
131
|
+
<>
|
|
132
|
+
<path
|
|
133
|
+
fill-rule="evenodd"
|
|
134
|
+
clip-rule="evenodd"
|
|
135
|
+
d="M4.04938 8.73798C3.2407 7.81172 2.75 6.59946 2.75 5.27071C2.75 2.48473 4.94068 0.00930912 7.98359 2.55322e-05C10.8908 -0.00895859 13.25 2.35416 13.25 5.27071C13.25 6.59946 12.7593 7.81172 11.9506 8.73798C11.4578 9.30248 10.687 10.9818 10.3932 11.9766L10.3899 12H5.61006L5.60678 11.9766C5.31295 10.9818 4.54216 9.30248 4.04938 8.73798ZM8.34274 2.03953C8.42611 2.41703 8.18767 2.79064 7.81017 2.87402C6.80315 3.09642 6.06073 3.89938 5.85994 4.87157C5.78174 5.25018 5.41143 5.49371 5.03282 5.41552C4.65421 5.33732 4.41068 4.96701 4.48888 4.5884C4.79524 3.10505 5.93379 1.85468 7.50825 1.50696C7.88575 1.42359 8.25936 1.66203 8.34274 2.03953Z"
|
|
136
|
+
fill="currentColor"
|
|
137
|
+
/>
|
|
138
|
+
<path
|
|
139
|
+
d="M5.76932 14.9479C5.67636 14.81 5.62681 14.6478 5.62655 14.4823L5.62521 13.5L10.3752 13.5L10.3741 14.4823C10.374 14.648 10.3243 14.81 10.2314 14.9479L9.77614 15.6241C9.69838 15.7397 9.5929 15.8345 9.46909 15.9001C9.34529 15.9657 9.207 16 9.06653 16L6.93417 16C6.7937 16 6.65541 15.9657 6.5316 15.9001C6.4078 15.8345 6.30232 15.7397 6.22455 15.6241L5.76932 14.9479Z"
|
|
140
|
+
fill="currentColor"
|
|
141
|
+
/>
|
|
142
|
+
</>
|
|
143
|
+
);
|
|
144
|
+
};
|
|
145
|
+
|
|
128
146
|
const LinkIcon: FunctionComponent = () => {
|
|
129
147
|
return (
|
|
130
148
|
<path
|
|
@@ -146,7 +164,7 @@ const CodeIcon: FunctionComponent = () => {
|
|
|
146
164
|
const PageWithLinesIcon: FunctionComponent = () => {
|
|
147
165
|
return (
|
|
148
166
|
<path
|
|
149
|
-
d="
|
|
167
|
+
d="M4.83333 1C3.82214 1 3 1.78477 3 2.75V13.25C3 14.2152 3.82214 15 4.83333 15H12.1667C13.1779 15 14 14.2152 14 13.25V5.375H10.3333C9.8263 5.375 9.41667 4.98398 9.41667 4.5V1H4.83333ZM10.3333 1V4.5H14L10.3333 1ZM6.20833 8H10.7917C11.0438 8 11.25 8.19687 11.25 8.4375C11.25 8.67813 11.0438 8.875 10.7917 8.875H6.20833C5.95625 8.875 5.75 8.67813 5.75 8.4375C5.75 8.19687 5.95625 8 6.20833 8ZM6.20833 9.75H10.7917C11.0438 9.75 11.25 9.94687 11.25 10.1875C11.25 10.4281 11.0438 10.625 10.7917 10.625H6.20833C5.95625 10.625 5.75 10.4281 5.75 10.1875C5.75 9.94687 5.95625 9.75 6.20833 9.75ZM6.20833 11.5H10.7917C11.0438 11.5 11.25 11.6969 11.25 11.9375C11.25 12.1781 11.0438 12.375 10.7917 12.375H6.20833C5.95625 12.375 5.75 12.1781 5.75 11.9375C5.75 11.6969 5.95625 11.5 6.20833 11.5Z"
|
|
150
168
|
fill="currentColor"
|
|
151
169
|
/>
|
|
152
170
|
);
|
|
@@ -164,7 +182,9 @@ const TerminalIcon: FunctionComponent = () => {
|
|
|
164
182
|
const QuestionIcon: FunctionComponent = () => {
|
|
165
183
|
return (
|
|
166
184
|
<path
|
|
167
|
-
|
|
185
|
+
fill-rule="evenodd"
|
|
186
|
+
clip-rule="evenodd"
|
|
187
|
+
d="M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM7.48998 7.58293C7.24532 7.9418 7.1073 8.36489 7.09243 8.80158L7.09232 9.00062C7.09232 9.21263 7.17498 9.41595 7.32211 9.56587C7.46924 9.71578 7.6688 9.8 7.87688 9.8C8.08495 9.8 8.28451 9.71578 8.43164 9.56587C8.57878 9.41595 8.66143 9.21263 8.66143 9.00062V8.8172C8.67459 8.68789 8.72283 8.56481 8.80083 8.46179C8.82284 8.43271 8.87624 8.39281 8.96482 8.34893C9.04677 8.30834 9.13665 8.27475 9.21483 8.24583L9.2194 8.24414L9.22961 8.24053L9.23662 8.2376C9.7635 8.01739 10.1981 7.61624 10.4651 7.10372C10.7321 6.5912 10.8149 5.99957 10.6987 5.43153L10.6962 5.42197C10.5641 4.91215 10.2876 4.45323 9.90133 4.10235C9.51593 3.7523 9.03819 3.52522 8.52737 3.44924C8.1077 3.37054 7.67619 3.38633 7.26312 3.49553C6.849 3.605 6.46349 3.80568 6.13376 4.08342C5.58181 4.54443 5.25866 5.23048 5.25 5.95706V5.95934C5.25 6.17135 5.33266 6.37468 5.47979 6.52459C5.62692 6.6745 5.82648 6.75872 6.03456 6.75872C6.24264 6.75872 6.44219 6.6745 6.58933 6.52459C6.73595 6.37519 6.81855 6.17275 6.81911 5.96153C6.82486 5.70702 6.94287 5.46722 7.13988 5.30865C7.29566 5.18188 7.47721 5.09021 7.67067 5.04112C7.86413 4.99203 8.06566 4.98632 8.26159 5.02383L8.2716 5.02518C8.47683 5.05273 8.67003 5.13962 8.82831 5.27556C8.98372 5.40903 9.09909 5.5843 9.16133 5.78128C9.23237 6.20988 8.99652 6.63061 8.59639 6.78484L8.59136 6.78696C8.22065 6.94277 7.74615 7.20718 7.48998 7.58293ZM7.87406 12.6C8.42636 12.6 8.8741 12.1523 8.8741 11.6C8.8741 11.0477 8.42636 10.6 7.87406 10.6C7.32175 10.6 6.87402 11.0477 6.87402 11.6C6.87402 12.1523 7.32175 12.6 7.87406 12.6Z"
|
|
168
188
|
fill="currentColor"
|
|
169
189
|
/>
|
|
170
190
|
);
|
|
@@ -207,17 +227,18 @@ const YouTubeIcon: FunctionComponent = () => {
|
|
|
207
227
|
};
|
|
208
228
|
|
|
209
229
|
export type IconName =
|
|
230
|
+
| 'askNetlify'
|
|
210
231
|
| 'book'
|
|
211
232
|
| 'caretRight'
|
|
212
233
|
| 'code'
|
|
213
234
|
| 'comment'
|
|
214
235
|
| 'cube'
|
|
236
|
+
| 'lightbulb'
|
|
215
237
|
| 'link'
|
|
216
238
|
| 'pageWithLines'
|
|
217
239
|
| 'pencil'
|
|
218
240
|
| 'rss'
|
|
219
241
|
| 'search'
|
|
220
|
-
| 'sparkles'
|
|
221
242
|
| 'terminal'
|
|
222
243
|
| 'question'
|
|
223
244
|
| 'linkedin'
|
|
@@ -227,22 +248,20 @@ export type IconName =
|
|
|
227
248
|
| 'youtube';
|
|
228
249
|
|
|
229
250
|
const iconPathMap: Record<IconName, FunctionComponent> = {
|
|
251
|
+
askNetlify: AskNetlify,
|
|
230
252
|
book: BookIcon,
|
|
231
253
|
caretRight: CaretRightIcon,
|
|
232
254
|
code: CodeIcon,
|
|
233
255
|
comment: CommentIcon,
|
|
234
|
-
cube: CubeIcon,
|
|
235
256
|
link: LinkIcon,
|
|
257
|
+
lightbulb: LightbulbIcon,
|
|
236
258
|
pageWithLines: PageWithLinesIcon,
|
|
237
|
-
pencil: PencilIcon,
|
|
238
259
|
rss: RSSIcon,
|
|
239
260
|
search: SearchIcon,
|
|
240
|
-
sparkles: SparklesIcon,
|
|
241
261
|
terminal: TerminalIcon,
|
|
242
262
|
question: QuestionIcon,
|
|
243
263
|
bluesky: BlueSkyIcon,
|
|
244
264
|
linkedin: LinkedInIcon,
|
|
245
|
-
netlify: NetlifyIcon,
|
|
246
265
|
twitter: TwitterIcon,
|
|
247
266
|
youtube: YouTubeIcon,
|
|
248
267
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
.n-search-heading {
|
|
2
|
-
--n-search-heading-weight: var(--font-weight-
|
|
3
|
-
--n-search-heading-size: var(--font-size-text-
|
|
2
|
+
--n-search-heading-weight: var(--font-weight-semibold, 400);
|
|
3
|
+
--n-search-heading-size: var(--font-size-text-xs, 13px);
|
|
4
4
|
--n-search-heading-color: var(--color-text-weak, #757575);
|
|
5
5
|
|
|
6
6
|
font-size: var(--n-search-heading-size);
|
|
7
7
|
font-weight: var(--n-search-heading-weight);
|
|
8
|
+
font-family: var(--font-family-mono);
|
|
8
9
|
color: var(--n-search-heading-color);
|
|
9
|
-
padding-inline:
|
|
10
|
+
padding-inline: var(--space-xs);
|
|
10
11
|
margin-block: var(--space-xs);
|
|
11
12
|
letter-spacing: 0.2px;
|
|
12
13
|
}
|
|
@@ -6,20 +6,22 @@ interface Props {
|
|
|
6
6
|
setSearchTerm: (term: string) => void;
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
initialValue?: string;
|
|
9
|
+
isGeneratingAnswer?: boolean;
|
|
10
|
+
isPreparingAnswer?: boolean;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
const SearchInput = (props: Props) => {
|
|
12
14
|
const [value, setValue] = useState<string>('');
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const { reset, run } = useTimeout((query: string) => {
|
|
17
|
+
props.setSearchTerm(query);
|
|
18
|
+
}, 300);
|
|
19
|
+
|
|
20
|
+
const handleInput = (e: InputEvent) => {
|
|
19
21
|
const target = e.target as HTMLInputElement;
|
|
20
22
|
setValue(target.value);
|
|
21
|
-
reset()
|
|
22
|
-
run(target.value)
|
|
23
|
+
reset();
|
|
24
|
+
run(target.value);
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
useEffect(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.n-search-link {
|
|
2
|
-
--n-search-icon-size:
|
|
3
|
-
|
|
2
|
+
--n-search-icon-size: 1.25em;
|
|
3
|
+
box-sizing: border-box;
|
|
4
4
|
display: flex;
|
|
5
5
|
justify-content: space-between;
|
|
6
6
|
flex-wrap: wrap;
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
font-weight: var(--font-weight-regular);
|
|
12
12
|
text-decoration: none;
|
|
13
13
|
cursor: pointer;
|
|
14
|
+
width: 100%;
|
|
15
|
+
border: none;
|
|
16
|
+
text-align: left;
|
|
17
|
+
outline: none;
|
|
18
|
+
border-radius: var(--radius-l);
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
.n-search-link-body {
|
|
@@ -20,17 +25,22 @@
|
|
|
20
25
|
text-wrap: pretty;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
.n-search-link:is(:hover, :focus-
|
|
28
|
+
.n-search-link:is(:hover, :focus-visible) {
|
|
24
29
|
background: var(--n-search-color-bg-2);
|
|
25
30
|
|
|
26
31
|
& .n-search-link-icon [data-icon='caretRight'] {
|
|
27
|
-
|
|
32
|
+
opacity: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
& .n-search-link-icon :where(#ask-netlify-eyelid-left, #ask-netlify-eyelid-right) {
|
|
36
|
+
animation: askEyeBlink 4s infinite;
|
|
37
|
+
animation-delay: 500ms;
|
|
28
38
|
}
|
|
29
39
|
}
|
|
30
40
|
|
|
31
41
|
.n-search-link-title {
|
|
32
42
|
font-weight: var(--font-weight-medium);
|
|
33
|
-
color: var(--color-text);
|
|
43
|
+
color: var(--color-text-1);
|
|
34
44
|
line-height: 1.5;
|
|
35
45
|
}
|
|
36
46
|
|
|
@@ -49,17 +59,17 @@
|
|
|
49
59
|
background-color: var(--mark-bg, var(--color-highlight));
|
|
50
60
|
}
|
|
51
61
|
|
|
52
|
-
.n-search-link-icon
|
|
62
|
+
.n-search-link-icon,
|
|
63
|
+
.n-search-link-icon svg {
|
|
53
64
|
display: flex;
|
|
54
65
|
width: var(--n-search-icon-size);
|
|
55
66
|
height: var(--n-search-icon-size);
|
|
56
|
-
color: var(--n-search-color-
|
|
67
|
+
color: var(--n-search-color-icon);
|
|
57
68
|
}
|
|
58
69
|
|
|
59
70
|
.n-search-link-icon [data-icon='caretRight'] {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
opacity: 0.3;
|
|
71
|
+
width: 1em;
|
|
72
|
+
opacity: 0;
|
|
63
73
|
}
|
|
64
74
|
|
|
65
75
|
.n-search-link-label {
|
|
@@ -4,20 +4,40 @@ import './SearchLink.css';
|
|
|
4
4
|
|
|
5
5
|
import Icon from '../../../Icon';
|
|
6
6
|
|
|
7
|
-
const SearchLink = ({
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const SearchLink = ({
|
|
8
|
+
as: Component = 'a',
|
|
9
|
+
icon,
|
|
10
|
+
label,
|
|
11
|
+
url,
|
|
12
|
+
excerpt,
|
|
13
|
+
resource,
|
|
14
|
+
onClick,
|
|
15
|
+
}: SearchLinkProps) => {
|
|
16
|
+
const { handleClick: log } = useSearchLogger();
|
|
17
|
+
|
|
10
18
|
return (
|
|
11
|
-
<
|
|
19
|
+
<Component
|
|
20
|
+
className="n-search-link"
|
|
21
|
+
href={url}
|
|
22
|
+
onClick={(e: Event) => {
|
|
23
|
+
onClick && onClick();
|
|
24
|
+
log(e);
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
12
27
|
{icon && (
|
|
13
28
|
<span className="n-search-link-icon">
|
|
14
29
|
<Icon name={icon} />
|
|
15
30
|
</span>
|
|
16
31
|
)}
|
|
17
32
|
<div className="n-search-link-body">
|
|
18
|
-
|
|
19
33
|
<p className="n-search-link-title">
|
|
20
|
-
|
|
34
|
+
<span className="n-search-link-label">{label}</span>{' '}
|
|
35
|
+
{resource && (
|
|
36
|
+
<span className="n-search-link-badge" data-resource={resource}>
|
|
37
|
+
{resource}
|
|
38
|
+
</span>
|
|
39
|
+
)}
|
|
40
|
+
</p>
|
|
21
41
|
{excerpt && (
|
|
22
42
|
<p className="n-search-link-excerpt" dangerouslySetInnerHTML={{ __html: excerpt }} />
|
|
23
43
|
)}
|
|
@@ -25,7 +45,7 @@ const SearchLink = ({ icon, label, url, excerpt, resource }: SearchLinkProps) =>
|
|
|
25
45
|
<div className="n-search-link-icon">
|
|
26
46
|
<Icon name="caretRight" />
|
|
27
47
|
</div>
|
|
28
|
-
</
|
|
48
|
+
</Component>
|
|
29
49
|
);
|
|
30
50
|
};
|
|
31
51
|
|
|
@@ -4,15 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
/* Root Variables */
|
|
6
6
|
.n-search-modal {
|
|
7
|
-
--n-search-padding-inline:
|
|
8
|
-
--n-search-color-text: var(--color-text, currentColor);
|
|
7
|
+
--n-search-padding-inline: var(--space-s);
|
|
8
|
+
--n-search-color-text: var(--color-text-1, currentColor);
|
|
9
9
|
--n-search-color-text-secondary: var(--color-text-weak, currentColor);
|
|
10
|
+
--n-search-color-icon: var(--search-icon-color);
|
|
10
11
|
--n-search-color-bg: var(--search-bg-color);
|
|
11
|
-
--n-search-color-bg-2: var(--color-bg-
|
|
12
|
+
--n-search-color-bg-2: var(--color-bg-3);
|
|
12
13
|
--n-search-color-border: var(--color-bg-3);
|
|
13
|
-
--n-search-border-radius:
|
|
14
|
+
--n-search-border-radius: 1.3rem;
|
|
14
15
|
--n-search-max-w: 600px;
|
|
15
16
|
--n-search-text-highlight: var(--search-highlight-color);
|
|
17
|
+
--n-search-input-height: 50px;
|
|
18
|
+
--n-search-footer-height: 40px;
|
|
19
|
+
--n-search-container-height: min(50dvh, 26.5rem);
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
.n-search-modal {
|
|
@@ -21,13 +25,17 @@
|
|
|
21
25
|
border-radius: var(--n-search-border-radius);
|
|
22
26
|
width: min(var(--n-search-max-w), 100%);
|
|
23
27
|
margin: auto;
|
|
28
|
+
background: var(--n-search-color-bg);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.n-search-modal-ask {
|
|
32
|
+
--n-search-max-w: 800px;
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
.n-search-container {
|
|
27
36
|
--mark-bg: var(--n-search-text-highlight);
|
|
28
37
|
display: grid;
|
|
29
38
|
width: min(var(--n-search-max-w), 100%);
|
|
30
|
-
min-height: 470px;
|
|
31
39
|
background-color: var(--n-search-color-bg);
|
|
32
40
|
border-radius: var(--n-search-border-radius);
|
|
33
41
|
overflow: hidden;
|
|
@@ -43,16 +51,17 @@
|
|
|
43
51
|
}
|
|
44
52
|
|
|
45
53
|
.n-search-input-wrapper {
|
|
46
|
-
|
|
54
|
+
position: relative;
|
|
47
55
|
display: flex;
|
|
48
56
|
width: 100%;
|
|
49
|
-
|
|
57
|
+
height: var(--n-search-input-height);
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
.n-search-input {
|
|
61
|
+
position: relative;
|
|
53
62
|
display: inline-flex;
|
|
54
63
|
box-sizing: border-box;
|
|
55
|
-
background:
|
|
64
|
+
background: transparent;
|
|
56
65
|
inline-size: 100%;
|
|
57
66
|
padding-block: 0.75rem;
|
|
58
67
|
padding-inline: var(--n-search-padding-inline);
|
|
@@ -60,16 +69,32 @@
|
|
|
60
69
|
border: none;
|
|
61
70
|
outline: none;
|
|
62
71
|
font-size: 1rem;
|
|
63
|
-
color: var(--color-text);
|
|
72
|
+
color: var(--color-text-1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.n-search-input-wrapper::after,
|
|
76
|
+
.n-search-footer::after {
|
|
77
|
+
content: '';
|
|
78
|
+
display: block;
|
|
79
|
+
width: 200%;
|
|
80
|
+
height: 1px;
|
|
81
|
+
background: var(--n-search-color-border);
|
|
82
|
+
position: absolute;
|
|
83
|
+
bottom: 0;
|
|
84
|
+
left: 0;
|
|
64
85
|
}
|
|
65
86
|
|
|
66
87
|
.n-search-input::placeholder {
|
|
67
|
-
color: var(--n-search-color-text);
|
|
88
|
+
color: var(--n-search-color-text-secondary);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.n-search-links {
|
|
92
|
+
padding: var(--space-2xs);
|
|
68
93
|
}
|
|
69
94
|
|
|
70
95
|
.n-search-label {
|
|
71
96
|
display: flex;
|
|
72
|
-
padding-inline: var(--n-search-padding-inline);
|
|
97
|
+
padding-inline-start: var(--n-search-padding-inline);
|
|
73
98
|
align-items: center;
|
|
74
99
|
}
|
|
75
100
|
|
|
@@ -80,8 +105,8 @@
|
|
|
80
105
|
|
|
81
106
|
.n-search-icon {
|
|
82
107
|
display: flex;
|
|
83
|
-
width: var(--n-search-icon-size,
|
|
84
|
-
height: var(--n-search-icon-size,
|
|
108
|
+
width: var(--n-search-icon-size, 1em);
|
|
109
|
+
height: var(--n-search-icon-size, 1em);
|
|
85
110
|
color: var(--n-search-color-text-secondary);
|
|
86
111
|
}
|
|
87
112
|
|
|
@@ -92,28 +117,26 @@
|
|
|
92
117
|
|
|
93
118
|
/* Search Results */
|
|
94
119
|
.n-search-window {
|
|
95
|
-
height:
|
|
120
|
+
height: var(--n-search-container-height);
|
|
96
121
|
overflow-x: hidden;
|
|
97
122
|
overflow-y: auto;
|
|
98
123
|
overscroll-behavior: contain;
|
|
124
|
+
scroll-padding-block: var(--space-s);
|
|
99
125
|
margin-block: 0;
|
|
100
126
|
background: var(--n-search-color-bg);
|
|
101
127
|
}
|
|
102
128
|
|
|
103
|
-
.n-results-list-item {
|
|
104
|
-
border-bottom: 1px solid var(--color-bg-3);
|
|
105
|
-
}
|
|
106
|
-
.n-results-list-item:first-of-type {
|
|
107
|
-
border-top: 1px solid var(--color-bg-3);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
129
|
/* Footer */
|
|
111
130
|
.n-search-footer {
|
|
112
|
-
|
|
113
|
-
padding: var(--space-2xs) var(--space-s);
|
|
114
|
-
background: var(--color-bg-2);
|
|
131
|
+
position: relative;
|
|
115
132
|
display: flex;
|
|
116
133
|
gap: var(--space-m);
|
|
134
|
+
padding: var(--space-2xs) var(--space-s);
|
|
135
|
+
height: var(--n-search-footer-height);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.n-search-footer::after {
|
|
139
|
+
top: 0;
|
|
117
140
|
}
|
|
118
141
|
|
|
119
142
|
.n-search-footer-tip {
|
|
@@ -128,7 +151,8 @@
|
|
|
128
151
|
.n-search-modal {
|
|
129
152
|
transition:
|
|
130
153
|
display 0.2s allow-discrete,
|
|
131
|
-
overlay 0.2s allow-discrete
|
|
154
|
+
overlay 0.2s allow-discrete,
|
|
155
|
+
width 0.15s ease-in-out;
|
|
132
156
|
animation: closeSearch 0.2s forwards;
|
|
133
157
|
}
|
|
134
158
|
|
|
@@ -136,28 +160,43 @@
|
|
|
136
160
|
animation: openSearch 0.2s forwards;
|
|
137
161
|
}
|
|
138
162
|
|
|
163
|
+
.n-search-modal[data-state='search'] > * {
|
|
164
|
+
opacity: 0;
|
|
165
|
+
animation: appearContainer 120ms ease-in-out forwards;
|
|
166
|
+
animation-delay: 140ms;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@keyframes appearContainer {
|
|
170
|
+
0% {
|
|
171
|
+
opacity: 0;
|
|
172
|
+
}
|
|
173
|
+
100% {
|
|
174
|
+
opacity: 1;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
139
178
|
@keyframes openSearch {
|
|
140
179
|
from {
|
|
141
180
|
opacity: 0;
|
|
142
|
-
transform:
|
|
181
|
+
transform: scale(0.9);
|
|
143
182
|
}
|
|
144
183
|
to {
|
|
145
184
|
opacity: 1;
|
|
146
|
-
transform:
|
|
185
|
+
transform: scale(1);
|
|
147
186
|
}
|
|
148
187
|
}
|
|
149
188
|
|
|
150
189
|
@keyframes closeSearch {
|
|
151
190
|
from {
|
|
152
191
|
opacity: 1;
|
|
153
|
-
transform:
|
|
192
|
+
transform: scale(1);
|
|
154
193
|
}
|
|
155
194
|
50% {
|
|
156
195
|
opacity: 0.3;
|
|
157
196
|
}
|
|
158
197
|
to {
|
|
159
198
|
opacity: 0;
|
|
160
|
-
transform:
|
|
199
|
+
transform: scale(0.9);
|
|
161
200
|
}
|
|
162
201
|
}
|
|
163
202
|
|