@netlify/spark-ui 0.0.12 → 0.0.14
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/KeyboardKey.css +1 -0
- package/dist/assets/SearchHeading.css +1 -0
- package/dist/assets/SearchModal.css +1 -0
- package/dist/assets/SearchToggle.css +1 -1
- package/dist/{compat.module-DWiGVdMB.js → chunks/compat.module.BPxt-oTe.js} +2 -2
- package/dist/components/index.d.ts +4 -4
- package/dist/components/preact/Icon/index.js +1 -1
- package/dist/components/preact/KeyboardKey/KeyboardKey.d.ts +5 -0
- package/dist/components/preact/KeyboardKey/KeyboardKey.js +7 -0
- package/dist/components/preact/Modal/{index.js → Modal.js} +2 -2
- package/dist/components/preact/SearchModal/components/{SearchHeading.d.ts → SearchHeading/SearchHeading.d.ts} +2 -2
- package/dist/components/preact/SearchModal/components/SearchHeading/SearchHeading.js +5 -0
- package/dist/components/preact/SearchModal/components/SearchInput.d.ts +2 -3
- package/dist/components/preact/SearchModal/components/SearchInput.js +11 -11
- package/dist/components/preact/SearchModal/components/SearchLink.d.ts +1 -2
- package/dist/components/preact/SearchModal/components/SearchLink.js +10 -10
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.d.ts +7 -0
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +98 -0
- package/dist/components/preact/SearchModal/components/SearchToggle/SearchToggle.js +3 -3
- package/dist/components/preact/SearchModal/components/SearchWindow.d.ts +1 -2
- package/dist/components/preact/SearchModal/components/SearchWindow.js +10 -10
- package/dist/components/preact/SearchModal/hooks/index.d.ts +5 -0
- package/dist/components/preact/SearchModal/hooks/index.js +12 -0
- package/dist/components/preact/SearchModal/hooks/useKeyboardNav.js +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearch.js +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearchHotkeys.js +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearchParams.js +1 -1
- package/dist/components/preact/SearchModal/hooks/useSearchToggles.js +1 -1
- package/dist/components/preact/SearchModal/index.d.ts +6 -6
- package/dist/components/preact/SearchModal/index.js +12 -55
- package/dist/components/preact/index.d.ts +4 -4
- package/dist/components/preact/index.js +16 -14
- package/package.json +6 -6
- package/packages/components/index.ts +4 -4
- package/packages/components/preact/KeyboardKey/KeyboardKey.css +10 -12
- package/packages/components/preact/KeyboardKey/{index.tsx → KeyboardKey.tsx} +1 -3
- package/packages/components/preact/Modal/{index.tsx → Modal.tsx} +1 -1
- package/packages/components/preact/SearchModal/components/SearchHeading/SearchHeading.css +7 -0
- package/packages/components/preact/SearchModal/components/{SearchHeading.tsx → SearchHeading/SearchHeading.tsx} +4 -2
- package/packages/components/preact/SearchModal/components/SearchInput.tsx +5 -6
- package/packages/components/preact/SearchModal/components/SearchLink.tsx +5 -6
- package/packages/{styles/search.css → components/preact/SearchModal/components/SearchModal/SearchModal.css} +59 -87
- package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.tsx +78 -0
- package/packages/components/preact/SearchModal/components/SearchToggle/SearchToggle.css +2 -2
- package/packages/components/preact/SearchModal/components/SearchToggle/SearchToggle.tsx +1 -1
- package/packages/components/preact/SearchModal/components/SearchWindow.tsx +6 -8
- package/packages/components/preact/SearchModal/hooks/index.ts +5 -0
- package/packages/components/preact/SearchModal/index.tsx +6 -72
- package/packages/components/preact/SearchModal/types/search.types.tsx +1 -1
- package/packages/components/preact/index.ts +4 -4
- package/dist/assets/index.css +0 -1
- package/dist/assets/index2.css +0 -1
- package/dist/components/preact/KeyboardKey/index.d.ts +0 -6
- package/dist/components/preact/KeyboardKey/index.js +0 -7
- package/dist/components/preact/SearchModal/components/SearchFooter.d.ts +0 -6
- package/dist/components/preact/SearchModal/components/SearchFooter.js +0 -7
- package/dist/components/preact/SearchModal/components/SearchFooterTip.d.ts +0 -6
- package/dist/components/preact/SearchModal/components/SearchFooterTip.js +0 -7
- package/dist/components/preact/SearchModal/components/SearchHeading.js +0 -5
- package/dist/components/preact/SearchModal/components/index.d.ts +0 -7
- package/dist/components/preact/SearchModal/components/index.js +0 -16
- package/packages/components/preact/SearchModal/components/SearchFooter.tsx +0 -11
- package/packages/components/preact/SearchModal/components/SearchFooterTip.tsx +0 -11
- package/packages/components/preact/SearchModal/components/index.ts +0 -7
- /package/dist/{hooks.module-ExpuRnbo.js → chunks/hooks.module.ExpuRnbo.js} +0 -0
- /package/dist/{jsxRuntime.module-Bzuv3cXw.js → chunks/jsxRuntime.module.Bzuv3cXw.js} +0 -0
- /package/dist/components/preact/Modal/{index.d.ts → Modal.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.n-keyboard-key{--n-key-text-size: .8em;--n-key-border-radius: 6px;--n-key-text-color: currentColor;--n-key-bg-color: transparent;display:flex;gap:calc(var(--space-3xs) * .5);font-size:var(--n-key-text-size);color:var(--n-key-text-color);background:var(--n-key-bg-color);border:1px solid currentColor;border-radius:var(--n-key-border-radius);padding:var(--n-key-padding-block, .05em) var(--n-key-padding-inline, .3em)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.n-search-heading{padding-inline:1rem;margin-block:var(--space-xs);font-size:var(--step--2);font-weight:var(--font-regular);color:var(--color-text-3)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.n-search-modal{--n-search-padding-inline: .5em;--n-search-color-text: var(--color-text-1, currentColor);--n-search-color-text-secondary: var(--color-text-2, currentColor);--n-search-color-bg: var(--color-bg-1);--n-search-color-bg-2: var(--color-bg-2);--n-search-color-border: var(--color-bg-3);--n-search-border-radius: 8px;--n-search-max-w: 600px;--n-search-text-highlight: var(--color-text-accent)}.n-search-modal{padding:0;border:none;border-radius:var(--n-search-border-radius);width:min(var(--n-search-max-w),100%);margin-inline:auto}.n-search-container{--mark-bg: var(--n-search-text-highlight);display:grid;width:min(var(--n-search-max-w),100%);min-height:470px;background-color:var(--n-search-color-bg);border-radius:var(--n-search-border-radius);overflow:hidden}.n-search-bar{display:flex;flex-wrap:wrap;align-items:center;overflow:hidden;background:var(--n-search-color-bg);border-bottom:1px solid var(--n-search-color-border)}.n-search-input-wrapper{all:unset;display:flex;width:100%}.n-search-input{display:inline-flex;box-sizing:border-box;background:var(--n-search-color-bg);inline-size:100%;padding-block:.75rem;padding-inline:var(--n-search-padding-inline);flex:1;border:none;outline:none;font-size:1rem}.n-search-input::placeholder{color:var(--n-search-color-text)}.n-search-label{display:flex;padding-inline:var(--n-search-padding-inline)}.n-search-label>*{display:inline-block;margin:0}.n-search-icon{display:flex;width:1em;height:auto;color:var(--n-search-color-text-secondary)}.icon{display:flex;width:1em;height:auto;height:1em}.icon [data-icon=caretRight]{width:10px;color:var(--n-search-color-text-secondary)}.n-search-term{font-weight:var(--font-medium);font-size:1.1em}.n-search-window{height:400px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;margin-block:0;background:var(--n-search-color-bg)}.n-results-list,ul[role=list]{list-style:none;padding:0}.n-results-list-item{border-bottom:1px solid var(--color-bg-3)}.n-results-list-item:first-of-type{border-top:1px solid var(--color-bg-3)}.n-result-link{all:unset;display:flex;flex-wrap:wrap;row-gap:var(--space-3xs);padding:var(--n-result-padding-block, 1em) var(--n-result-padding-inline, 1rem);font-size:var(--step--1);font-weight:var(--font-regular);text-decoration:none;cursor:pointer}.n-result-link:is(:hover,:focus-within){background:var(--n-search-color-bg-2)}.n-result-header{display:flex;justify-content:space-between;width:100%;align-items:center}.n-result-title{display:flex;align-items:center;gap:var(--space-s);font-weight:var(--font-semibold);color:var(--color-text-2)}.n-result-excerpt{color:var(--color-text-3);line-height:1.3;font-size:.9em;padding-inline-start:var(--space-l)}.n-search-footer{border-top:1px solid var(--n-search-color-border);padding:var(--space-2xs) var(--space-s);background:var(--color-bg-2);display:flex;gap:var(--space-m)}.n-search-footer-tip{--n-key-text-color: var(--n-search-color-text-secondary);color:var(--n-search-color-text-secondary);display:flex;gap:var(--space-2xs);align-items:center;font-size:var(--step--1)}.n-search-modal{transition:display .2s allow-discrete,overlay .2s allow-discrete;animation:closeSearch .2s forwards}.n-search-modal[open]{animation:openSearch .2s forwards}@keyframes openSearch{0%{opacity:0;transform:translateY(20px) scale(.9)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes closeSearch{0%{opacity:1;transform:translateY(0) scale(1)}50%{opacity:.3}to{opacity:0;transform:translateY(20px) scale(.9)}}.n-search-modal::backdrop{animation:closeSearchBackdrop .2s forwards}.n-search-modal[open]::backdrop{animation:openSearchBackdrop .2s forwards}@keyframes openSearchBackdrop{0%{opacity:0;-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px)}to{opacity:1;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}}@keyframes closeSearchBackdrop{0%{opacity:1;-webkit-backdrop-filter:blur(1.5px);backdrop-filter:blur(1.5px)}50%{opacity:.3}to{opacity:0;-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.search-toggle{all:unset;outline:revert;cursor:pointer;line-height:normal;padding:var(--space-2xs);transition:opacity .3s ease-in-out;max-width:max-content}.search-toggle:disabled{opacity:.3}
|
|
1
|
+
.n-search-toggle{all:unset;outline:revert;cursor:pointer;line-height:normal;padding:var(--space-2xs);transition:opacity .3s ease-in-out;max-width:max-content}.n-search-toggle:disabled{opacity:.3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component as f, options as a, createElement as d, Fragment as h, toChildArray as v } from "preact";
|
|
2
|
-
import "./hooks.module
|
|
2
|
+
import "./hooks.module.ExpuRnbo.js";
|
|
3
3
|
function C(e, t) {
|
|
4
4
|
for (var r in t) e[r] = t[r];
|
|
5
5
|
return e;
|
|
@@ -38,7 +38,7 @@ var g = a.unmount;
|
|
|
38
38
|
function N(e, t, r) {
|
|
39
39
|
return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(o) {
|
|
40
40
|
typeof o.__c == "function" && o.__c();
|
|
41
|
-
}), e.__c.__H = null), (e = C({}, e)).__c != null && (e.__c.__P === r && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(o) {
|
|
41
|
+
}), e.__c.__H = null), (e = C({}, e)).__c != null && (e.__c.__P === r && (e.__c.__P = t), e.__c.__e = !0, e.__c = null), e.__k = e.__k && e.__k.map(function(o) {
|
|
42
42
|
return N(o, t, r);
|
|
43
43
|
})), e;
|
|
44
44
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { default as KeyboardKey } from './preact/KeyboardKey';
|
|
2
|
-
export { default as Modal } from './preact/Modal';
|
|
1
|
+
export { default as KeyboardKey } from './preact/KeyboardKey/KeyboardKey';
|
|
2
|
+
export { default as Modal } from './preact/Modal/Modal';
|
|
3
3
|
export { default as Icon } from './preact/Icon';
|
|
4
4
|
export { default as SearchLink } from './preact/SearchModal/components/SearchLink';
|
|
5
|
-
export { default as SearchHeading } from './preact/SearchModal/components/SearchHeading';
|
|
5
|
+
export { default as SearchHeading } from './preact/SearchModal/components/SearchHeading/SearchHeading';
|
|
6
6
|
export { default as SearchToggle } from './preact/SearchModal/components/SearchToggle/SearchToggle';
|
|
7
|
-
export { default as SearchModal } from './preact/SearchModal';
|
|
7
|
+
export { default as SearchModal } from './preact/SearchModal/components/SearchModal/SearchModal';
|
|
8
8
|
export { default as Tabs } from './Tabs.astro';
|
|
9
9
|
export { type IconName } from './preact/Icon';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { u as e } from "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import '../../../assets/KeyboardKey.css';function s(a) {
|
|
3
|
+
return /* @__PURE__ */ e("span", { class: "n-keyboard-key", children: a.keyNames.map((r, n) => /* @__PURE__ */ e("span", { children: r }, n)) });
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
s as default
|
|
7
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as l } from "../../../jsxRuntime.module
|
|
2
|
-
import { D as d } from "../../../compat.module-
|
|
1
|
+
import { u as l } from "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import { D as d } from "../../../chunks/compat.module.BPxt-oTe.js";
|
|
3
3
|
const u = d(function({ children: o, className: r, ...a }, t) {
|
|
4
4
|
return /* @__PURE__ */ l("dialog", { ref: t, className: r, role: "dialog", "aria-modal": "true", ...a, children: o });
|
|
5
5
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentChildren } from 'preact';
|
|
2
2
|
type SearchHeadingProps = {
|
|
3
3
|
children: ComponentChildren;
|
|
4
4
|
};
|
|
5
|
-
declare const SearchHeading: ({ children }: SearchHeadingProps) =>
|
|
5
|
+
declare const SearchHeading: ({ children }: SearchHeadingProps) => import("preact").JSX.Element;
|
|
6
6
|
export default SearchHeading;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
interface Props extends h.JSX.HTMLAttributes<HTMLInputElement> {
|
|
1
|
+
interface Props {
|
|
3
2
|
setSearchTerm: (term: string) => void;
|
|
4
3
|
placeholder?: string;
|
|
5
4
|
initialValue?: string;
|
|
6
5
|
}
|
|
7
|
-
declare const SearchInput: (props: Props) =>
|
|
6
|
+
declare const SearchInput: (props: Props) => import("preact").JSX.Element;
|
|
8
7
|
export default SearchInput;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { u as e } from "../../../../jsxRuntime.module
|
|
2
|
-
import { d as
|
|
1
|
+
import { u as e } from "../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import { d as i, y as s } from "../../../../chunks/hooks.module.ExpuRnbo.js";
|
|
3
3
|
import h from "../../Icon/index.js";
|
|
4
4
|
const m = (a) => {
|
|
5
|
-
const [
|
|
6
|
-
const
|
|
7
|
-
l(
|
|
5
|
+
const [t, l] = i(""), c = (r) => {
|
|
6
|
+
const n = r.target;
|
|
7
|
+
l(n.value), a.setSearchTerm(n.value);
|
|
8
8
|
};
|
|
9
9
|
return s(() => {
|
|
10
10
|
a.initialValue && l(a.initialValue);
|
|
11
|
-
}, [a.initialValue, l]), /* @__PURE__ */ e("div", { class: "search-input-wrapper", children: [
|
|
12
|
-
/* @__PURE__ */ e("label", { class: "search-label", htmlFor: "search", children: [
|
|
11
|
+
}, [a.initialValue, l]), /* @__PURE__ */ e("div", { class: "n-search-input-wrapper", children: [
|
|
12
|
+
/* @__PURE__ */ e("label", { class: "n-search-label", htmlFor: "search", children: [
|
|
13
13
|
/* @__PURE__ */ e("span", { class: "visually-hidden", children: "Search" }),
|
|
14
|
-
/* @__PURE__ */ e("div", { class: "search-icon", children: /* @__PURE__ */ e(h, { name: "search" }) })
|
|
14
|
+
/* @__PURE__ */ e("div", { class: "n-search-icon", children: /* @__PURE__ */ e(h, { name: "search" }) })
|
|
15
15
|
] }),
|
|
16
16
|
/* @__PURE__ */ e(
|
|
17
17
|
"input",
|
|
18
18
|
{
|
|
19
|
-
class: "search-input",
|
|
19
|
+
class: "n-search-input",
|
|
20
20
|
type: "text",
|
|
21
|
-
value:
|
|
21
|
+
value: t,
|
|
22
22
|
placeholder: a.placeholder || "Search...",
|
|
23
|
-
onInput:
|
|
23
|
+
onInput: c
|
|
24
24
|
}
|
|
25
25
|
)
|
|
26
26
|
] });
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { h } from 'preact';
|
|
2
1
|
import { IconName } from '../../Icon';
|
|
3
2
|
export interface Props {
|
|
4
3
|
icon: IconName;
|
|
@@ -7,5 +6,5 @@ export interface Props {
|
|
|
7
6
|
url: string;
|
|
8
7
|
excerpt?: string;
|
|
9
8
|
}
|
|
10
|
-
declare const SearchLink: ({ icon, title,
|
|
9
|
+
declare const SearchLink: ({ icon, title, url, excerpt }: Props) => import("preact").JSX.Element;
|
|
11
10
|
export default SearchLink;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { u as e } from "../../../../jsxRuntime.module
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
/* @__PURE__ */ e("div", { className: "result-header", children: [
|
|
5
|
-
/* @__PURE__ */ e("div", { className: "result-title", children: [
|
|
6
|
-
a && /* @__PURE__ */ e("span", { className: "icon", children: /* @__PURE__ */ e(
|
|
7
|
-
/* @__PURE__ */ e("span", { children:
|
|
1
|
+
import { u as e } from "../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import r from "../../Icon/index.js";
|
|
3
|
+
const t = ({ icon: a, title: l, url: s, excerpt: n }) => /* @__PURE__ */ e("a", { className: "n-result-link", href: s, children: [
|
|
4
|
+
/* @__PURE__ */ e("div", { className: "n-result-header", children: [
|
|
5
|
+
/* @__PURE__ */ e("div", { className: "n-result-title", children: [
|
|
6
|
+
a && /* @__PURE__ */ e("span", { className: "icon", children: /* @__PURE__ */ e(r, { name: a }) }),
|
|
7
|
+
/* @__PURE__ */ e("span", { children: l })
|
|
8
8
|
] }),
|
|
9
|
-
/* @__PURE__ */ e("div", { className: "icon", children: /* @__PURE__ */ e(
|
|
9
|
+
/* @__PURE__ */ e("div", { className: "icon", children: /* @__PURE__ */ e(r, { name: "caretRight" }) })
|
|
10
10
|
] }),
|
|
11
|
-
|
|
11
|
+
n && /* @__PURE__ */ e("p", { className: "n-result-excerpt", dangerouslySetInnerHTML: { __html: n } })
|
|
12
12
|
] });
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
t as default
|
|
15
15
|
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { u as s } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import { A as h, y as S, d as v } from "../../../../../chunks/hooks.module.ExpuRnbo.js";
|
|
3
|
+
import N from "../../../Modal/Modal.js";
|
|
4
|
+
import f from "../../../KeyboardKey/KeyboardKey.js";
|
|
5
|
+
import O from "../SearchWindow.js";
|
|
6
|
+
import T from "../SearchInput.js";
|
|
7
|
+
import { useSearch as b } from "../../hooks/useSearch.js";
|
|
8
|
+
import { useKeyboardNav as w } from "../../hooks/useKeyboardNav.js";
|
|
9
|
+
import { useSearchHotkeys as E } from "../../hooks/useSearchHotkeys.js";
|
|
10
|
+
import { useSearchParams as g } from "../../hooks/useSearchParams.js";
|
|
11
|
+
import { useSearchToggles as j } from "../../hooks/useSearchToggles.js";
|
|
12
|
+
import '../../../../../assets/SearchModal.css';function x(t) {
|
|
13
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
14
|
+
}
|
|
15
|
+
var p = { exports: {} };
|
|
16
|
+
/*!
|
|
17
|
+
Copyright (c) 2018 Jed Watson.
|
|
18
|
+
Licensed under the MIT License (MIT), see
|
|
19
|
+
http://jedwatson.github.io/classnames
|
|
20
|
+
*/
|
|
21
|
+
var d;
|
|
22
|
+
function C() {
|
|
23
|
+
return d || (d = 1, function(t) {
|
|
24
|
+
(function() {
|
|
25
|
+
var a = {}.hasOwnProperty;
|
|
26
|
+
function n() {
|
|
27
|
+
for (var e = "", r = 0; r < arguments.length; r++) {
|
|
28
|
+
var o = arguments[r];
|
|
29
|
+
o && (e = c(e, i(o)));
|
|
30
|
+
}
|
|
31
|
+
return e;
|
|
32
|
+
}
|
|
33
|
+
function i(e) {
|
|
34
|
+
if (typeof e == "string" || typeof e == "number")
|
|
35
|
+
return e;
|
|
36
|
+
if (typeof e != "object")
|
|
37
|
+
return "";
|
|
38
|
+
if (Array.isArray(e))
|
|
39
|
+
return n.apply(null, e);
|
|
40
|
+
if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
|
|
41
|
+
return e.toString();
|
|
42
|
+
var r = "";
|
|
43
|
+
for (var o in e)
|
|
44
|
+
a.call(e, o) && e[o] && (r = c(r, o));
|
|
45
|
+
return r;
|
|
46
|
+
}
|
|
47
|
+
function c(e, r) {
|
|
48
|
+
return r ? e ? e + " " + r : e + r : e;
|
|
49
|
+
}
|
|
50
|
+
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
51
|
+
})();
|
|
52
|
+
}(p)), p.exports;
|
|
53
|
+
}
|
|
54
|
+
var L = C();
|
|
55
|
+
const M = /* @__PURE__ */ x(L);
|
|
56
|
+
function k(t) {
|
|
57
|
+
const a = h(null);
|
|
58
|
+
return S(() => {
|
|
59
|
+
function n(i) {
|
|
60
|
+
a.current && !a.current.contains(i.target) && t();
|
|
61
|
+
}
|
|
62
|
+
return document.addEventListener("mousedown", n), () => {
|
|
63
|
+
document.removeEventListener("mousedown", n);
|
|
64
|
+
};
|
|
65
|
+
}, [t]), a;
|
|
66
|
+
}
|
|
67
|
+
function W(t) {
|
|
68
|
+
const { children: a, className: n, ...i } = t, { state: c, actions: e } = b(), [r, o] = v(!1), m = () => o(!0), l = () => o(!1), u = h(null), y = k(l);
|
|
69
|
+
return j(m), g(e.setSearchTerm, m), E(r, m, l), w(u, r, l), S(() => {
|
|
70
|
+
u.current && (r ? u.current.showModal() : u.current.close());
|
|
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
|
+
/* @__PURE__ */ s("form", { className: "n-search-bar", children: /* @__PURE__ */ s(T, { setSearchTerm: e.setSearchTerm, initialValue: c.searchTerm }) }),
|
|
73
|
+
/* @__PURE__ */ s(
|
|
74
|
+
O,
|
|
75
|
+
{
|
|
76
|
+
searchLoading: c.isLoading,
|
|
77
|
+
searchTerm: c.searchTerm,
|
|
78
|
+
results: c.results,
|
|
79
|
+
children: a
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ s("div", { className: "n-search-footer", children: [
|
|
83
|
+
/* @__PURE__ */ s("p", { className: "n-search-footer-tip", children: [
|
|
84
|
+
/* @__PURE__ */ s(f, { keyNames: ["Esc"] }),
|
|
85
|
+
"to close"
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ s("p", { className: "n-search-footer-tip", children: [
|
|
88
|
+
/* @__PURE__ */ s(f, { keyNames: ["Tab"] }),
|
|
89
|
+
/* @__PURE__ */ s("span", { children: "or" }),
|
|
90
|
+
/* @__PURE__ */ s(f, { keyNames: ["↑", "↓"] }),
|
|
91
|
+
"to navigate"
|
|
92
|
+
] })
|
|
93
|
+
] })
|
|
94
|
+
] }) });
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
W as default
|
|
98
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { u as e } from "../../../../../jsxRuntime.module
|
|
2
|
-
import { D as t } from "../../../../../compat.module-
|
|
1
|
+
import { u as e } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import { D as t } from "../../../../../chunks/compat.module.BPxt-oTe.js";
|
|
3
3
|
import o from "../../../Icon/index.js";
|
|
4
4
|
import '../../../../../assets/SearchToggle.css';const s = t(function(r, a) {
|
|
5
|
-
return /* @__PURE__ */ e("button", { id: r.id, ref: a, class: "search-toggle", disabled: !0, "data-ntl-search-toggle": !0, children: [
|
|
5
|
+
return /* @__PURE__ */ e("button", { id: r.id, ref: a, class: "n-search-toggle", disabled: !0, "data-ntl-search-toggle": !0, children: [
|
|
6
6
|
/* @__PURE__ */ e("span", { class: "visually-hidden", children: "Search" }),
|
|
7
7
|
/* @__PURE__ */ e(o, { name: r.iconName || "search" })
|
|
8
8
|
] });
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { h } from 'preact';
|
|
2
1
|
import { SearchWindowProps } from '../types/search.types';
|
|
3
|
-
export default function SearchWindow({ searchLoading, searchTerm, results, children: DefaultWindow, }: SearchWindowProps):
|
|
2
|
+
export default function SearchWindow({ searchLoading, searchTerm, results, children: DefaultWindow, }: SearchWindowProps): import("preact").JSX.Element;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { u as e } from "../../../../jsxRuntime.module
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { u as e } from "../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
+
import t from "./SearchHeading/SearchHeading.js";
|
|
3
|
+
import c from "./SearchLink.js";
|
|
4
4
|
const a = ({
|
|
5
5
|
searchLoading: s,
|
|
6
6
|
searchTerm: i,
|
|
7
7
|
results: l
|
|
8
|
-
}) => s ? /* @__PURE__ */ e(
|
|
8
|
+
}) => s ? /* @__PURE__ */ e(t, { children: [
|
|
9
9
|
"Searching for ",
|
|
10
|
-
/* @__PURE__ */ e("span", { className: "search-term", children: i }),
|
|
10
|
+
/* @__PURE__ */ e("span", { className: "n-search-term", children: i }),
|
|
11
11
|
" ..."
|
|
12
|
-
] }) : !l || l.length === 0 ? /* @__PURE__ */ e(
|
|
12
|
+
] }) : !l || l.length === 0 ? /* @__PURE__ */ e(t, { children: [
|
|
13
13
|
"0 results for ",
|
|
14
|
-
/* @__PURE__ */ e("span", { className: "search-term", children: i })
|
|
15
|
-
] }) : /* @__PURE__ */ e("ul", { className: "results-list", role: "list", children: l.slice(0, 15).map((r,
|
|
14
|
+
/* @__PURE__ */ e("span", { className: "n-search-term", children: i })
|
|
15
|
+
] }) : /* @__PURE__ */ e("ul", { className: "n-results-list", role: "list", children: l.slice(0, 15).map((r, n) => /* @__PURE__ */ e("li", { className: "n-results-list-item", children: /* @__PURE__ */ e(c, { ...r }) }, n)) });
|
|
16
16
|
function m({
|
|
17
17
|
searchLoading: s,
|
|
18
18
|
searchTerm: i,
|
|
19
19
|
results: l,
|
|
20
20
|
children: r
|
|
21
21
|
}) {
|
|
22
|
-
return /* @__PURE__ */ e("div", { className: "search-window", children: /* @__PURE__ */ e("div", { className: "search-links", children: [
|
|
23
|
-
/* @__PURE__ */ e(
|
|
22
|
+
return /* @__PURE__ */ e("div", { className: "n-search-window", children: /* @__PURE__ */ e("div", { className: "search-links", children: [
|
|
23
|
+
/* @__PURE__ */ e(c, { ...{
|
|
24
24
|
icon: "askNetlify",
|
|
25
25
|
title: "Ask Netlify AI",
|
|
26
26
|
url: "https://docs.netlify.com/ask-netlify/"
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useSearch } from '../hooks/useSearch';
|
|
2
|
+
export { useKeyboardNav } from '../hooks/useKeyboardNav';
|
|
3
|
+
export { useSearchHotkeys } from '../hooks/useSearchHotkeys';
|
|
4
|
+
export { useSearchParams } from '../hooks/useSearchParams';
|
|
5
|
+
export { useSearchToggles } from '../hooks/useSearchToggles';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useSearch as o } from "./useSearch.js";
|
|
2
|
+
import { useKeyboardNav as s } from "./useKeyboardNav.js";
|
|
3
|
+
import { useSearchHotkeys as t } from "./useSearchHotkeys.js";
|
|
4
|
+
import { useSearchParams as p } from "./useSearchParams.js";
|
|
5
|
+
import { useSearchToggles as x } from "./useSearchToggles.js";
|
|
6
|
+
export {
|
|
7
|
+
s as useKeyboardNav,
|
|
8
|
+
o as useSearch,
|
|
9
|
+
t as useSearchHotkeys,
|
|
10
|
+
p as useSearchParams,
|
|
11
|
+
x as useSearchToggles
|
|
12
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as h, y as p, d as g } from "../../../../hooks.module
|
|
1
|
+
import { A as h, y as p, d as g } from "../../../../chunks/hooks.module.ExpuRnbo.js";
|
|
2
2
|
import { getSiteIcon as S } from "../utils/index.js";
|
|
3
3
|
function w(s, r) {
|
|
4
4
|
const t = h(null), c = h("");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export default SearchModal;
|
|
1
|
+
export { default as SearchHeading } from './components/SearchHeading/SearchHeading';
|
|
2
|
+
export { default as SearchInput } from './components/SearchInput';
|
|
3
|
+
export { default as SearchLink } from './components/SearchLink';
|
|
4
|
+
export { default as SearchToggle } from './components/SearchToggle/SearchToggle';
|
|
5
|
+
export { default as SearchWindow } from './components/SearchWindow';
|
|
6
|
+
export { default as SearchModal } from './components/SearchModal/SearchModal';
|
|
@@ -1,57 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import "./components/SearchToggle/SearchToggle.js";
|
|
8
|
-
import y from "./components/SearchWindow.js";
|
|
9
|
-
import i from "../KeyboardKey/index.js";
|
|
10
|
-
import { useSearch as g } from "./hooks/useSearch.js";
|
|
11
|
-
import { useKeyboardNav as v } from "./hooks/useKeyboardNav.js";
|
|
12
|
-
import { useSearchHotkeys as k } from "./hooks/useSearchHotkeys.js";
|
|
13
|
-
import { useSearchParams as N } from "./hooks/useSearchParams.js";
|
|
14
|
-
import { useSearchToggles as w } from "./hooks/useSearchToggles.js";
|
|
15
|
-
import '../../../assets/index2.css';function L(a) {
|
|
16
|
-
const r = h(null);
|
|
17
|
-
return l(() => {
|
|
18
|
-
function t(o) {
|
|
19
|
-
r.current && !r.current.contains(o.target) && a();
|
|
20
|
-
}
|
|
21
|
-
return document.addEventListener("mousedown", t), () => {
|
|
22
|
-
document.removeEventListener("mousedown", t);
|
|
23
|
-
};
|
|
24
|
-
}, [a]), r;
|
|
25
|
-
}
|
|
26
|
-
function W({ children: a }) {
|
|
27
|
-
const { state: r, actions: t } = g(), [o, m] = f(!1), c = () => m(!0), n = () => m(!1), s = h(null), d = L(n);
|
|
28
|
-
return w(c), N(t.setSearchTerm, c), k(o, c, n), v(s, o, n), l(() => {
|
|
29
|
-
s.current && (o ? s.current.showModal() : s.current.close());
|
|
30
|
-
}, [o]), /* @__PURE__ */ e(p, { ref: s, className: "search-modal", children: /* @__PURE__ */ e("div", { ref: d, class: "search-container", children: [
|
|
31
|
-
/* @__PURE__ */ e("form", { class: "search", children: /* @__PURE__ */ e(T, { setSearchTerm: t.setSearchTerm, initialValue: r.searchTerm }) }),
|
|
32
|
-
/* @__PURE__ */ e(
|
|
33
|
-
y,
|
|
34
|
-
{
|
|
35
|
-
searchLoading: r.isLoading,
|
|
36
|
-
searchTerm: r.searchTerm,
|
|
37
|
-
results: r.results,
|
|
38
|
-
children: a
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
/* @__PURE__ */ e(S, { children: [
|
|
42
|
-
/* @__PURE__ */ e(u, { children: [
|
|
43
|
-
/* @__PURE__ */ e(i, { keyNames: ["Esc"] }),
|
|
44
|
-
"to close"
|
|
45
|
-
] }),
|
|
46
|
-
/* @__PURE__ */ e(u, { children: [
|
|
47
|
-
/* @__PURE__ */ e(i, { keyNames: ["Tab"] }),
|
|
48
|
-
/* @__PURE__ */ e("span", { children: "or" }),
|
|
49
|
-
/* @__PURE__ */ e(i, { keyNames: ["↑", "↓"] }),
|
|
50
|
-
"to navigate"
|
|
51
|
-
] })
|
|
52
|
-
] })
|
|
53
|
-
] }) });
|
|
54
|
-
}
|
|
1
|
+
import { default as r } from "./components/SearchHeading/SearchHeading.js";
|
|
2
|
+
import { default as t } from "./components/SearchInput.js";
|
|
3
|
+
import { default as d } from "./components/SearchLink.js";
|
|
4
|
+
import { default as p } from "./components/SearchToggle/SearchToggle.js";
|
|
5
|
+
import { default as c } from "./components/SearchWindow.js";
|
|
6
|
+
import { default as m } from "./components/SearchModal/SearchModal.js";
|
|
55
7
|
export {
|
|
56
|
-
|
|
8
|
+
r as SearchHeading,
|
|
9
|
+
t as SearchInput,
|
|
10
|
+
d as SearchLink,
|
|
11
|
+
m as SearchModal,
|
|
12
|
+
p as SearchToggle,
|
|
13
|
+
c as SearchWindow
|
|
57
14
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { default as KeyboardKey } from './KeyboardKey';
|
|
2
|
-
export { default as Modal } from './Modal';
|
|
1
|
+
export { default as KeyboardKey } from './KeyboardKey/KeyboardKey';
|
|
2
|
+
export { default as Modal } from './Modal/Modal';
|
|
3
3
|
export { default as Icon } from './Icon';
|
|
4
4
|
export { default as SearchLink } from './SearchModal/components/SearchLink';
|
|
5
|
-
export { default as SearchHeading } from './SearchModal/components/SearchHeading';
|
|
5
|
+
export { default as SearchHeading } from './SearchModal/components/SearchHeading/SearchHeading';
|
|
6
6
|
export { default as SearchToggle } from './SearchModal/components/SearchToggle/SearchToggle';
|
|
7
|
-
export {
|
|
7
|
+
export { SearchModal } from './SearchModal';
|
|
8
8
|
export { type IconName } from './Icon';
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import
|
|
1
|
+
import { default as t } from "./KeyboardKey/KeyboardKey.js";
|
|
2
|
+
import { default as d } from "./Modal/Modal.js";
|
|
3
|
+
import { default as m } from "./Icon/index.js";
|
|
4
|
+
import { default as s } from "./SearchModal/components/SearchLink.js";
|
|
5
|
+
import { default as x } from "./SearchModal/components/SearchHeading/SearchHeading.js";
|
|
6
|
+
import { default as h } from "./SearchModal/components/SearchToggle/SearchToggle.js";
|
|
7
|
+
import "preact";
|
|
8
|
+
import "../../chunks/hooks.module.ExpuRnbo.js";
|
|
9
|
+
import { default as S } from "./SearchModal/components/SearchModal/SearchModal.js";
|
|
8
10
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
m as Icon,
|
|
12
|
+
t as KeyboardKey,
|
|
13
|
+
d as Modal,
|
|
14
|
+
x as SearchHeading,
|
|
15
|
+
s as SearchLink,
|
|
16
|
+
S as SearchModal,
|
|
17
|
+
h as SearchToggle
|
|
16
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": "0.0.
|
|
4
|
+
"version": "0.0.14",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/components/preact/index.js",
|
|
7
7
|
"types": "dist/components/preact/index.d.ts",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"exports": {
|
|
23
23
|
"./preact": "./dist/components/preact/index.js",
|
|
24
|
+
"./preact/styles/*.css": "./dist/assets/*.css",
|
|
24
25
|
"./assets/*.css": "./dist/assets/*.css",
|
|
25
26
|
"./logos/*.svg": "./packages/assets/logos/*.svg",
|
|
26
27
|
"./styles/*.css": "./packages/styles/*.css",
|
|
@@ -30,11 +31,13 @@
|
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"@preact/preset-vite": "^2.10.1",
|
|
34
|
+
"classnames": "^2.5.1",
|
|
33
35
|
"glob": "^11.0.1",
|
|
34
36
|
"preact": "^10.26.4",
|
|
35
37
|
"vite": "^6.2.5",
|
|
36
38
|
"vite-plugin-dts": "^4.5.3",
|
|
37
|
-
"vite-plugin-lib-inject-css": "^2.2.1"
|
|
39
|
+
"vite-plugin-lib-inject-css": "^2.2.1",
|
|
40
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
38
41
|
},
|
|
39
42
|
"devDependencies": {
|
|
40
43
|
"@terrazzo/cli": "^0.6.3",
|
|
@@ -52,8 +55,5 @@
|
|
|
52
55
|
"preact": "^10.26.4",
|
|
53
56
|
"prettier": "^3.5.3",
|
|
54
57
|
"prettier-plugin-astro": "^0.14.1"
|
|
55
|
-
}
|
|
56
|
-
"sideEffects": [
|
|
57
|
-
"**/*.css"
|
|
58
|
-
]
|
|
58
|
+
}
|
|
59
59
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { default as KeyboardKey } from './preact/KeyboardKey';
|
|
2
|
-
export { default as Modal } from './preact/Modal';
|
|
1
|
+
export { default as KeyboardKey } from './preact/KeyboardKey/KeyboardKey';
|
|
2
|
+
export { default as Modal } from './preact/Modal/Modal';
|
|
3
3
|
export { default as Icon } from './preact/Icon';
|
|
4
4
|
export { default as SearchLink } from './preact/SearchModal/components/SearchLink';
|
|
5
|
-
export { default as SearchHeading } from './preact/SearchModal/components/SearchHeading';
|
|
5
|
+
export { default as SearchHeading } from './preact/SearchModal/components/SearchHeading/SearchHeading';
|
|
6
6
|
export { default as SearchToggle } from './preact/SearchModal/components/SearchToggle/SearchToggle';
|
|
7
|
-
export { default as SearchModal } from './preact/SearchModal';
|
|
7
|
+
export { default as SearchModal } from './preact/SearchModal/components/SearchModal/SearchModal';
|
|
8
8
|
export { default as Tabs } from './Tabs.astro';
|
|
9
9
|
|
|
10
10
|
export { type IconName } from './preact/Icon';
|