@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.
@@ -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.s9u28W-S.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,54 +1,98 @@
1
- import { u as e } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import { A as d, y as f, d as S } from "../../../../../chunks/hooks.module.ExpuRnbo.js";
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 l from "../../../KeyboardKey/KeyboardKey.js";
5
- import y from "../SearchWindow.js";
4
+ import f from "../../../KeyboardKey/KeyboardKey.js";
5
+ import O from "../SearchWindow.js";
6
6
  import T from "../SearchInput.js";
7
- import { useSearch as v } from "../../hooks/useSearch.js";
8
- import { useKeyboardNav as g } from "../../hooks/useKeyboardNav.js";
9
- import { useSearchHotkeys as k } from "../../hooks/useSearchHotkeys.js";
10
- import { useSearchParams as w } from "../../hooks/useSearchParams.js";
11
- import { useSearchToggles as L } from "../../hooks/useSearchToggles.js";
12
- import '../../../../../assets/SearchModal.css';function O(o) {
13
- const r = d(null);
14
- return f(() => {
15
- function a(n) {
16
- r.current && !r.current.contains(n.target) && o();
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", a), () => {
19
- document.removeEventListener("mousedown", a);
62
+ return document.addEventListener("mousedown", n), () => {
63
+ document.removeEventListener("mousedown", n);
20
64
  };
21
- }, [o]), r;
65
+ }, [t]), a;
22
66
  }
23
- function V(o) {
24
- const { children: r, className: a, ...n } = o, { state: t, actions: h } = v(), [c, u] = S(!1), m = () => u(!0), i = () => u(!1), s = d(null), p = O(i);
25
- return L(m), w(h.setSearchTerm, m), k(c, m, i), g(s, c, i), f(() => {
26
- s.current && (c ? s.current.showModal() : s.current.close());
27
- }, [c]), /* @__PURE__ */ e(N, { ref: s, className: `${a} n-search-modal`, ...n, children: /* @__PURE__ */ e("div", { ref: p, className: "n-search-container", children: [
28
- /* @__PURE__ */ e("form", { className: "n-search-bar", children: /* @__PURE__ */ e(T, { setSearchTerm: h.setSearchTerm, initialValue: t.searchTerm }) }),
29
- /* @__PURE__ */ e(
30
- y,
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: t.isLoading,
33
- searchTerm: t.searchTerm,
34
- results: t.results,
35
- children: r
76
+ searchLoading: c.isLoading,
77
+ searchTerm: c.searchTerm,
78
+ results: c.results,
79
+ children: a
36
80
  }
37
81
  ),
38
- /* @__PURE__ */ e("div", { className: "n-search-footer", children: [
39
- /* @__PURE__ */ e("p", { className: "n-search-footer-tip", children: [
40
- /* @__PURE__ */ e(l, { keyNames: ["Esc"] }),
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__ */ e("p", { className: "n-search-footer-tip", children: [
44
- /* @__PURE__ */ e(l, { keyNames: ["Tab"] }),
45
- /* @__PURE__ */ e("span", { children: "or" }),
46
- /* @__PURE__ */ e(l, { keyNames: ["↑", "↓"] }),
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
- V as default
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.s9u28W-S.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
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,7 +1,7 @@
1
1
  {
2
2
  "name": "@netlify/spark-ui",
3
3
  "description": "Assets, design tokens, components, and utilities",
4
- "version": "0.0.13",
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",
@@ -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={`${className} n-search-modal`} {...rest}>
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} />