@netlify/spark-ui 0.0.16 → 0.0.17
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/components/preact/SearchModal/components/SearchLink.d.ts +2 -2
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.d.ts +2 -2
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +3 -3
- package/dist/components/preact/SearchModal/types/search.types.d.ts +4 -4
- package/package.json +1 -1
- package/packages/components/preact/SearchModal/components/SearchLink.tsx +2 -2
- package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.tsx +2 -2
- package/packages/components/preact/SearchModal/components/SearchWindow.tsx +2 -2
- package/packages/components/preact/SearchModal/types/search.types.tsx +4 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const SearchLink: ({ icon, label, url, excerpt }:
|
|
1
|
+
import { SearchLinkProps } from '../types/search.types';
|
|
2
|
+
declare const SearchLink: ({ icon, label, url, excerpt }: SearchLinkProps) => import("preact").JSX.Element;
|
|
3
3
|
export default SearchLink;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentChildren } from 'preact';
|
|
2
2
|
interface Props {
|
|
3
3
|
children: ComponentChildren;
|
|
4
|
-
className
|
|
4
|
+
className?: string;
|
|
5
5
|
}
|
|
6
|
-
declare function SearchModal(props
|
|
6
|
+
declare function SearchModal(props?: Props): import("preact").JSX.Element;
|
|
7
7
|
export default SearchModal;
|
|
@@ -64,9 +64,9 @@ function k(t) {
|
|
|
64
64
|
};
|
|
65
65
|
}, [t]), a;
|
|
66
66
|
}
|
|
67
|
-
function W(t) {
|
|
68
|
-
const { children: a, className: n, ...i } = t, { state: c, actions: e } = b(), [r, o] = v(!1),
|
|
69
|
-
return j(
|
|
67
|
+
function W(t = { className: "", children: null }) {
|
|
68
|
+
const { children: a, className: n, ...i } = t, { state: c, actions: e } = b(), [r, o] = v(!1), l = () => o(!0), m = () => o(!1), u = h(null), y = k(m);
|
|
69
|
+
return j(l), g(e.setSearchTerm, l), E(r, l, m), w(u, r, m), S(() => {
|
|
70
70
|
u.current && (r ? u.current.showModal() : u.current.close());
|
|
71
71
|
}, [r]), /* @__PURE__ */ s(N, { ref: u, className: M(n, "n-search-modal"), ...i, children: /* @__PURE__ */ s("div", { ref: y, className: "n-search-container", children: [
|
|
72
72
|
/* @__PURE__ */ s("form", { className: "n-search-bar", children: /* @__PURE__ */ s(T, { setSearchTerm: e.setSearchTerm, initialValue: c.searchTerm }) }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentChildren } from 'preact';
|
|
2
2
|
import { IconName } from '../../Icon';
|
|
3
|
-
export interface
|
|
3
|
+
export interface SearchLinkProps {
|
|
4
4
|
icon: IconName;
|
|
5
5
|
label: string;
|
|
6
6
|
content_type?: string;
|
|
@@ -10,16 +10,16 @@ export interface ResultProps {
|
|
|
10
10
|
export interface SearchWindowProps {
|
|
11
11
|
searchLoading: boolean;
|
|
12
12
|
searchTerm?: string;
|
|
13
|
-
results?:
|
|
13
|
+
results?: SearchLinkProps[];
|
|
14
14
|
children: ComponentChildren;
|
|
15
15
|
}
|
|
16
16
|
export interface SearchResultsProps {
|
|
17
17
|
searchLoading: boolean;
|
|
18
18
|
searchTerm?: string;
|
|
19
|
-
results?:
|
|
19
|
+
results?: SearchLinkProps[];
|
|
20
20
|
}
|
|
21
21
|
export interface SearchState {
|
|
22
22
|
searchTerm: string;
|
|
23
|
-
results:
|
|
23
|
+
results: SearchLinkProps[];
|
|
24
24
|
isLoading: boolean;
|
|
25
25
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SearchLinkProps} from "../types/search.types"
|
|
2
2
|
|
|
3
3
|
import Icon from '../../Icon';
|
|
4
4
|
|
|
5
|
-
const SearchLink = ({ icon, label, url, excerpt }:
|
|
5
|
+
const SearchLink = ({ icon, label, url, excerpt }: SearchLinkProps) => {
|
|
6
6
|
return (
|
|
7
7
|
<a className="n-result-link" href={url}>
|
|
8
8
|
<div className="n-result-header">
|
|
@@ -19,10 +19,10 @@ import './SearchModal.css';
|
|
|
19
19
|
|
|
20
20
|
interface Props {
|
|
21
21
|
children: ComponentChildren;
|
|
22
|
-
className
|
|
22
|
+
className?: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function SearchModal(props: Props) {
|
|
25
|
+
function SearchModal(props: Props = {className: '', children: null}) {
|
|
26
26
|
const { children, className, ...rest } = props;
|
|
27
27
|
const { state, actions } = useSearch();
|
|
28
28
|
const [searchOpen, setSearchOpen] = useState(false);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FunctionComponent } from 'preact';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SearchLinkProps, SearchResultsProps, SearchWindowProps } from '../types/search.types';
|
|
3
3
|
import SearchHeading from './SearchHeading/SearchHeading';
|
|
4
4
|
import SearchLink from './SearchLink';
|
|
5
5
|
|
|
@@ -43,7 +43,7 @@ export default function SearchWindow({
|
|
|
43
43
|
results,
|
|
44
44
|
children: DefaultWindow,
|
|
45
45
|
}: SearchWindowProps) {
|
|
46
|
-
const askNetlify:
|
|
46
|
+
const askNetlify: SearchLinkProps = {
|
|
47
47
|
icon: 'askNetlify',
|
|
48
48
|
label: 'Ask Netlify AI',
|
|
49
49
|
url: 'https://docs.netlify.com/ask-netlify/',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentChildren } from 'preact';
|
|
2
2
|
import type { IconName } from '../../Icon';
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface SearchLinkProps {
|
|
5
5
|
icon: IconName;
|
|
6
6
|
label: string;
|
|
7
7
|
content_type?: string;
|
|
@@ -12,18 +12,18 @@ export interface ResultProps {
|
|
|
12
12
|
export interface SearchWindowProps {
|
|
13
13
|
searchLoading: boolean;
|
|
14
14
|
searchTerm?: string;
|
|
15
|
-
results?:
|
|
15
|
+
results?: SearchLinkProps[];
|
|
16
16
|
children: ComponentChildren;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface SearchResultsProps {
|
|
20
20
|
searchLoading: boolean;
|
|
21
21
|
searchTerm?: string;
|
|
22
|
-
results?:
|
|
22
|
+
results?: SearchLinkProps[];
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface SearchState {
|
|
26
26
|
searchTerm: string;
|
|
27
|
-
results:
|
|
27
|
+
results: SearchLinkProps[];
|
|
28
28
|
isLoading: boolean;
|
|
29
29
|
}
|