@netlify/spark-ui 0.0.13 → 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/chunks/{compat.module.s9u28W-S.js → compat.module.BPxt-oTe.js} +1 -1
- package/dist/components/preact/Modal/Modal.js +1 -1
- package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +81 -37
- package/dist/components/preact/SearchModal/components/SearchToggle/SearchToggle.js +1 -1
- package/package.json +1 -1
- package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.tsx +2 -1
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
import { u as l } from "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
-
import { D as d } from "../../../chunks/compat.module.
|
|
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,54 +1,98 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { A as
|
|
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
3
|
import N from "../../../Modal/Modal.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import f from "../../../KeyboardKey/KeyboardKey.js";
|
|
5
|
+
import O from "../SearchWindow.js";
|
|
6
6
|
import T from "../SearchInput.js";
|
|
7
|
-
import { useSearch as
|
|
8
|
-
import { useKeyboardNav as
|
|
9
|
-
import { useSearchHotkeys as
|
|
10
|
-
import { useSearchParams as
|
|
11
|
-
import { useSearchToggles as
|
|
12
|
-
import '../../../../../assets/SearchModal.css';function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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();
|
|
17
61
|
}
|
|
18
|
-
return document.addEventListener("mousedown",
|
|
19
|
-
document.removeEventListener("mousedown",
|
|
62
|
+
return document.addEventListener("mousedown", n), () => {
|
|
63
|
+
document.removeEventListener("mousedown", n);
|
|
20
64
|
};
|
|
21
|
-
}, [
|
|
65
|
+
}, [t]), a;
|
|
22
66
|
}
|
|
23
|
-
function
|
|
24
|
-
const { children:
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
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,
|
|
31
75
|
{
|
|
32
|
-
searchLoading:
|
|
33
|
-
searchTerm:
|
|
34
|
-
results:
|
|
35
|
-
children:
|
|
76
|
+
searchLoading: c.isLoading,
|
|
77
|
+
searchTerm: c.searchTerm,
|
|
78
|
+
results: c.results,
|
|
79
|
+
children: a
|
|
36
80
|
}
|
|
37
81
|
),
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
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"] }),
|
|
41
85
|
"to close"
|
|
42
86
|
] }),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
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: ["↑", "↓"] }),
|
|
47
91
|
"to navigate"
|
|
48
92
|
] })
|
|
49
93
|
] })
|
|
50
94
|
] }) });
|
|
51
95
|
}
|
|
52
96
|
export {
|
|
53
|
-
|
|
97
|
+
W as default
|
|
54
98
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u as e } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
|
|
2
|
-
import { D as t } from "../../../../../chunks/compat.module.
|
|
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
5
|
return /* @__PURE__ */ e("button", { id: r.id, ref: a, class: "n-search-toggle", disabled: !0, "data-ntl-search-toggle": !0, children: [
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ComponentChildren } from 'preact';
|
|
2
2
|
import { useState, useEffect, useRef } from 'preact/hooks';
|
|
3
|
+
import cn from "classnames"
|
|
3
4
|
|
|
4
5
|
import Modal from '@components/preact/Modal/Modal';
|
|
5
6
|
import KeyboardKey from '@components/preact/KeyboardKey/KeyboardKey';
|
|
@@ -43,7 +44,7 @@ function SearchModal(props: Props) {
|
|
|
43
44
|
}, [searchOpen]);
|
|
44
45
|
|
|
45
46
|
return (
|
|
46
|
-
<Modal ref={modalRef} className={
|
|
47
|
+
<Modal ref={modalRef} className={cn(className, 'n-search-modal')} {...rest}>
|
|
47
48
|
<div ref={containerRef} className="n-search-container">
|
|
48
49
|
<form className="n-search-bar">
|
|
49
50
|
<SearchInput setSearchTerm={actions.setSearchTerm} initialValue={state.searchTerm} />
|