@netlify/spark-ui 1.5.0-alpha.14 → 1.5.0-alpha.3

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.
Files changed (23) hide show
  1. package/dist/assets/AskNetlify.css +1 -1
  2. package/dist/assets/SearchHeading.css +1 -1
  3. package/dist/assets/SearchLink.css +1 -1
  4. package/dist/assets/SearchModal.css +1 -1
  5. package/dist/components/preact/AskNetlify/AskNetlify.d.ts +1 -6
  6. package/dist/components/preact/AskNetlify/AskNetlify.js +665 -680
  7. package/dist/components/preact/Icon/index.js +30 -57
  8. package/dist/components/preact/SearchModal/components/SearchModal/SearchModal.js +49 -42
  9. package/dist/components/preact/SearchModal/components/SearchWindow.js +19 -20
  10. package/dist/components/preact/SearchModal/hooks/useSearchToggles.d.ts +1 -3
  11. package/dist/components/preact/SearchModal/hooks/useSearchToggles.js +10 -13
  12. package/package.json +1 -1
  13. package/packages/components/preact/AskNetlify/AskNetlify.css +109 -191
  14. package/packages/components/preact/AskNetlify/AskNetlify.tsx +29 -45
  15. package/packages/components/preact/Icon/index.tsx +0 -21
  16. package/packages/components/preact/SearchModal/components/SearchHeading/SearchHeading.css +1 -1
  17. package/packages/components/preact/SearchModal/components/SearchLink/SearchLink.css +1 -6
  18. package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.css +20 -4
  19. package/packages/components/preact/SearchModal/components/SearchModal/SearchModal.tsx +11 -3
  20. package/packages/components/preact/SearchModal/components/SearchWindow.tsx +2 -4
  21. package/packages/components/preact/SearchModal/hooks/useSearchToggles.ts +3 -11
  22. package/packages/styles/tokens.css +4 -12
  23. package/packages/utils/theme.ts +0 -4
@@ -1,6 +1,6 @@
1
1
  import { u as C } from "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import { Fragment as e } from "preact";
3
- function I(r) {
2
+ import { Fragment as n } from "preact";
3
+ function g(r) {
4
4
  const t = V[r.name];
5
5
  if (t)
6
6
  return /* @__PURE__ */ C(
@@ -19,11 +19,10 @@ function I(r) {
19
19
  }
20
20
  );
21
21
  }
22
- const l = () => /* @__PURE__ */ C(e, { children: [
22
+ const o = () => /* @__PURE__ */ C(n, { children: [
23
23
  /* @__PURE__ */ C(
24
24
  "path",
25
25
  {
26
- id: "ask-netlify-tick-3",
27
26
  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",
28
27
  fill: "currentColor"
29
28
  }
@@ -31,7 +30,6 @@ const l = () => /* @__PURE__ */ C(e, { children: [
31
30
  /* @__PURE__ */ C(
32
31
  "path",
33
32
  {
34
- id: "ask-netlify-tick-1",
35
33
  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",
36
34
  fill: "currentColor"
37
35
  }
@@ -39,7 +37,6 @@ const l = () => /* @__PURE__ */ C(e, { children: [
39
37
  /* @__PURE__ */ C(
40
38
  "path",
41
39
  {
42
- id: "ask-netlify-tick-2",
43
40
  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",
44
41
  fill: "currentColor"
45
42
  }
@@ -47,7 +44,6 @@ const l = () => /* @__PURE__ */ C(e, { children: [
47
44
  /* @__PURE__ */ C(
48
45
  "path",
49
46
  {
50
- id: "ask-netlify-eye-left",
51
47
  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
48
  fill: "currentColor"
53
49
  }
@@ -55,7 +51,6 @@ const l = () => /* @__PURE__ */ C(e, { children: [
55
51
  /* @__PURE__ */ C(
56
52
  "path",
57
53
  {
58
- id: "ask-netlify-eye-right",
59
54
  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",
60
55
  fill: "currentColor"
61
56
  }
@@ -75,60 +70,38 @@ const l = () => /* @__PURE__ */ C(e, { children: [
75
70
  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",
76
71
  fill: "currentColor"
77
72
  }
78
- ),
79
- /* @__PURE__ */ C(
80
- "rect",
81
- {
82
- id: "ask-netlify-eyelid-left",
83
- x: "3",
84
- y: "7.3",
85
- width: "3",
86
- height: "2",
87
- fill: "var(--search-bg-color, currentColor)"
88
- }
89
- ),
90
- /* @__PURE__ */ C(
91
- "rect",
92
- {
93
- id: "ask-netlify-eyelid-right",
94
- x: "9.7",
95
- y: "7.3",
96
- width: "3",
97
- height: "2",
98
- fill: "var(--search-bg-color, currentColor)"
99
- }
100
73
  )
101
- ] }), n = () => /* @__PURE__ */ C(
74
+ ] }), L = () => /* @__PURE__ */ C(
102
75
  "path",
103
76
  {
104
77
  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",
105
78
  fill: "currentColor"
106
79
  }
107
- ), o = () => /* @__PURE__ */ C(
80
+ ), l = () => /* @__PURE__ */ C(
108
81
  "path",
109
82
  {
110
83
  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",
111
84
  fill: "currentColor"
112
85
  }
113
- ), L = () => /* @__PURE__ */ C(
86
+ ), e = () => /* @__PURE__ */ C(
114
87
  "path",
115
88
  {
116
89
  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",
117
90
  fill: "currentColor"
118
91
  }
119
- ), i = () => /* @__PURE__ */ C(
92
+ ), c = () => /* @__PURE__ */ C(
120
93
  "path",
121
94
  {
122
95
  d: "M0 4.57143C0 2.04286 2.04286 0 4.57143 0C37.4 0 64 26.6 64 59.4286C64 61.9571 61.9571 64 59.4286 64C56.9 64 54.8571 61.9571 54.8571 59.4286C54.8571 31.6571 32.3429 9.14286 4.57143 9.14286C2.04286 9.14286 0 7.1 0 4.57143ZM0 54.8571C0 52.4323 0.963263 50.1068 2.67788 48.3922C4.3925 46.6776 6.71802 45.7143 9.14286 45.7143C11.5677 45.7143 13.8932 46.6776 15.6078 48.3922C17.3225 50.1068 18.2857 52.4323 18.2857 54.8571C18.2857 57.282 17.3225 59.6075 15.6078 61.3221C13.8932 63.0367 11.5677 64 9.14286 64C6.71802 64 4.3925 63.0367 2.67788 61.3221C0.963263 59.6075 0 57.282 0 54.8571ZM4.57143 18.2857C27.3 18.2857 45.7143 36.7 45.7143 59.4286C45.7143 61.9571 43.6714 64 41.1429 64C38.6143 64 36.5714 61.9571 36.5714 59.4286C36.5714 41.7571 22.2429 27.4286 4.57143 27.4286C2.04286 27.4286 0 25.3857 0 22.8571C0 20.3286 2.04286 18.2857 4.57143 18.2857Z",
123
96
  fill: "currentColor"
124
97
  }
125
- ), c = () => /* @__PURE__ */ C(
98
+ ), i = () => /* @__PURE__ */ C(
126
99
  "path",
127
100
  {
128
101
  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",
129
102
  fill: "currentColor"
130
103
  }
131
- ), u = () => /* @__PURE__ */ C(e, { children: [
104
+ ), u = () => /* @__PURE__ */ C(n, { children: [
132
105
  /* @__PURE__ */ C(
133
106
  "path",
134
107
  {
@@ -145,31 +118,31 @@ const l = () => /* @__PURE__ */ C(e, { children: [
145
118
  fill: "currentColor"
146
119
  }
147
120
  )
148
- ] }), d = () => /* @__PURE__ */ C(
121
+ ] }), M = () => /* @__PURE__ */ C(
149
122
  "path",
150
123
  {
151
124
  d: "M58.0309 26.6159C63.6509 21.0179 63.6509 11.9435 58.0309 6.34543C52.6809 1.01633 44.0909 0.72746 38.3909 5.69797L37.7809 6.23586C36.7809 7.10246 36.6809 8.61652 37.5509 9.61262C38.4209 10.6087 39.9409 10.7083 40.9409 9.84172L41.5509 9.30383C45.3509 5.9968 51.0709 6.18605 54.6409 9.74211C58.3809 13.4675 58.3809 19.5138 54.6409 23.2491L43.3109 34.5249C39.5709 38.2503 33.4909 38.2503 29.7509 34.5249C26.1809 30.9689 25.9909 25.2712 29.3109 21.4861L29.7809 20.9482C30.6509 19.9521 30.5509 18.448 29.5509 17.5714C28.5509 16.6948 27.0409 16.8044 26.1609 17.8005L25.6909 18.3384C20.7109 24.0161 21.0009 32.5726 26.3509 37.9017C31.9709 43.4997 41.0809 43.4997 46.7009 37.9017L58.0309 26.6159ZM5.97086 24.3847C0.350859 29.9827 0.350859 39.0571 5.97086 44.6452C11.3309 49.9843 19.9209 50.2632 25.6209 45.2927L26.2309 44.7548C27.2309 43.8882 27.3309 42.3741 26.4609 41.378C25.5909 40.382 24.0709 40.2823 23.0709 41.1489L22.4609 41.6868C18.6609 44.9939 12.9409 44.8046 9.37086 41.2486C5.63086 37.5232 5.63086 31.4769 9.37086 27.7415L20.7009 16.4757C24.4409 12.7503 30.5109 12.7503 34.2609 16.4757C37.8309 20.0318 38.0209 25.7294 34.7009 29.5146L34.1609 30.1222C33.2909 31.1183 33.3909 32.6224 34.3909 33.4989C35.3909 34.3755 36.9009 34.2659 37.7809 33.2698L38.3209 32.6622C43.3109 26.9845 43.0209 18.428 37.6709 13.089C32.0509 7.49094 22.9409 7.49094 17.3209 13.089L5.97086 24.3847Z",
152
125
  fill: "currentColor"
153
126
  }
154
- ), a = () => /* @__PURE__ */ C(
127
+ ), Z = () => /* @__PURE__ */ C(
155
128
  "path",
156
129
  {
157
130
  d: "M49.8875 0.137732C48.3 -0.349768 46.625 0.525232 46.1375 2.11273L28.1375 60.1127C27.65 61.7002 28.525 63.3752 30.1125 63.8627C31.7 64.3502 33.375 63.4752 33.8625 61.8877L51.8625 3.88773C52.35 2.30023 51.475 0.625232 49.8875 0.137732ZM58.8125 14.9502C57.675 16.1627 57.7375 18.0627 58.95 19.1877L72.6125 32.0002L58.95 44.8127C57.7375 45.9502 57.675 47.8502 58.8125 49.0502C59.95 50.2502 61.85 50.3252 63.05 49.1877L79.05 34.1877C79.65 33.6252 80 32.8252 80 32.0002C80 31.1752 79.6625 30.3752 79.05 29.8127L63.05 14.8127C61.8375 13.6752 59.9375 13.7377 58.8125 14.9502ZM21.1875 14.9502C20.05 13.7377 18.15 13.6752 16.95 14.8127L0.95 29.8127C0.3375 30.3752 0 31.1752 0 32.0002C0 32.8252 0.3375 33.6252 0.95 34.1877L16.95 49.1877C18.1625 50.3252 20.0625 50.2627 21.1875 49.0502C22.3125 47.8377 22.2625 45.9377 21.05 44.8127L7.3875 32.0002L21.05 19.1877C22.2625 18.0502 22.325 16.1502 21.1875 14.9502Z",
158
131
  fill: "currentColor"
159
132
  }
160
- ), h = () => /* @__PURE__ */ C(
133
+ ), d = () => /* @__PURE__ */ C(
161
134
  "path",
162
135
  {
163
136
  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",
164
137
  fill: "currentColor"
165
138
  }
166
- ), M = () => /* @__PURE__ */ C(
139
+ ), H = () => /* @__PURE__ */ C(
167
140
  "path",
168
141
  {
169
142
  d: "M0.787918 9.02542C-0.337082 7.80042 -0.249582 5.91292 0.962918 4.78792C2.17542 3.66292 4.07542 3.75042 5.20042 4.96292L28.2004 29.9629C29.2629 31.1129 29.2629 32.8754 28.2004 34.0254L5.20042 59.0254C4.07542 60.2504 2.17542 60.3254 0.962918 59.2004C-0.249582 58.0754 -0.337082 56.1754 0.787918 54.9629L21.9254 32.0004L0.787918 9.02542ZM31.0004 54.0004H69.0004C70.6629 54.0004 72.0004 55.3379 72.0004 57.0004C72.0004 58.6629 70.6629 60.0004 69.0004 60.0004H31.0004C29.3379 60.0004 28.0004 58.6629 28.0004 57.0004C28.0004 55.3379 29.3379 54.0004 31.0004 54.0004Z",
170
143
  fill: "currentColor"
171
144
  }
172
- ), Z = () => /* @__PURE__ */ C(
145
+ ), a = () => /* @__PURE__ */ C(
173
146
  "path",
174
147
  {
175
148
  "fill-rule": "evenodd",
@@ -177,13 +150,13 @@ const l = () => /* @__PURE__ */ C(e, { children: [
177
150
  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",
178
151
  fill: "currentColor"
179
152
  }
180
- ), f = () => /* @__PURE__ */ C(
153
+ ), h = () => /* @__PURE__ */ C(
181
154
  "path",
182
155
  {
183
156
  d: "M59.4286 0H4.55714C2.04286 0 0 2.07143 0 4.61429V59.3857C0 61.9286 2.04286 64 4.55714 64H59.4286C61.9429 64 64 61.9286 64 59.3857V4.61429C64 2.07143 61.9429 0 59.4286 0ZM19.3429 54.8571H9.85714V24.3143H19.3571V54.8571H19.3429ZM14.6 20.1429C11.5571 20.1429 9.1 17.6714 9.1 14.6429C9.1 11.6143 11.5571 9.14286 14.6 9.14286C17.6286 9.14286 20.1 11.6143 20.1 14.6429C20.1 17.6857 17.6429 20.1429 14.6 20.1429ZM54.9 54.8571H45.4143V40C45.4143 36.4571 45.3429 31.9 40.4857 31.9C35.5429 31.9 34.7857 35.7571 34.7857 39.7429V54.8571H25.3V24.3143H34.4V28.4857H34.5286C35.8 26.0857 38.9 23.5571 43.5143 23.5571C53.1143 23.5571 54.9 29.8857 54.9 38.1143V54.8571Z",
184
157
  fill: "currentColor"
185
158
  }
186
- ), H = () => /* @__PURE__ */ C(
159
+ ), f = () => /* @__PURE__ */ C(
187
160
  "path",
188
161
  {
189
162
  d: "M48.6496 6H57.4746L38.1996 28.025L60.8746 58H43.1246L29.2121 39.825L13.3121 58H4.47461L25.0871 34.4375L3.34961 6H21.5496L34.1121 22.6125L48.6496 6ZM45.5496 52.725H50.4371L18.8871 11H13.6371L45.5496 52.725Z",
@@ -202,23 +175,23 @@ const l = () => /* @__PURE__ */ C(e, { children: [
202
175
  fill: "currentColor"
203
176
  }
204
177
  ), V = {
205
- askNetlify: l,
206
- book: o,
207
- caretRight: L,
208
- code: a,
209
- comment: c,
210
- link: d,
178
+ askNetlify: o,
179
+ book: l,
180
+ caretRight: e,
181
+ code: Z,
182
+ comment: i,
183
+ link: M,
211
184
  lightbulb: u,
212
- pageWithLines: h,
213
- rss: i,
214
- search: n,
215
- terminal: M,
216
- question: Z,
185
+ pageWithLines: d,
186
+ rss: c,
187
+ search: L,
188
+ terminal: H,
189
+ question: a,
217
190
  bluesky: s,
218
- linkedin: f,
219
- twitter: H,
191
+ linkedin: h,
192
+ twitter: f,
220
193
  youtube: p
221
194
  };
222
195
  export {
223
- I as default
196
+ g as default
224
197
  };
@@ -1,20 +1,20 @@
1
1
  import { u as e } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import { A as N, y as l, d as h } from "../../../../../chunks/hooks.module.DGkdD5n9.js";
3
- import w from "../../../Modal/Modal.js";
4
- import p from "../../../KeyboardKey/KeyboardKey.js";
5
- import I from "../SearchWindow.js";
6
- import b from "../SearchInput.js";
7
- import { useSearch as M } from "../../hooks/useSearch.js";
8
- import { useSearchLogger as O } from "../../hooks/useSearchLogger.js";
9
- import { useKeyboardNav as P } from "../../hooks/useKeyboardNav.js";
10
- import { useSearchHotkeys as E } from "../../hooks/useSearchHotkeys.js";
11
- import { useSearchParams as K } from "../../hooks/useSearchParams.js";
12
- import { useSearchToggles as A } from "../../hooks/useSearchToggles.js";
13
- import C from "../../../AskNetlify/AskNetlify.js";
14
- import { Fragment as F } from "preact";
2
+ import { A as N, y as u, d as m } from "../../../../../chunks/hooks.module.DGkdD5n9.js";
3
+ import b from "../../../Modal/Modal.js";
4
+ import h from "../../../KeyboardKey/KeyboardKey.js";
5
+ import M from "../SearchWindow.js";
6
+ import O from "../SearchInput.js";
7
+ import { useSearch as P } from "../../hooks/useSearch.js";
8
+ import { useSearchLogger as A } from "../../hooks/useSearchLogger.js";
9
+ import { useKeyboardNav as E } from "../../hooks/useKeyboardNav.js";
10
+ import { useSearchHotkeys as K } from "../../hooks/useSearchHotkeys.js";
11
+ import { useSearchParams as q } from "../../hooks/useSearchParams.js";
12
+ import { useSearchToggles as C } from "../../hooks/useSearchToggles.js";
13
+ import F from "../../../AskNetlify/AskNetlify.js";
14
+ import { Fragment as Q } from "preact";
15
15
  import '../../../../../assets/SearchModal.css';function R(c) {
16
16
  const r = N(null);
17
- return l(() => {
17
+ return u(() => {
18
18
  function i(t) {
19
19
  r.current && !r.current.contains(t.target) && c();
20
20
  }
@@ -23,56 +23,63 @@ import '../../../../../assets/SearchModal.css';function R(c) {
23
23
  };
24
24
  }, [c]), r;
25
25
  }
26
- function X(c = { className: "", children: null, debug: !1 }) {
27
- const [r, i] = h(!1), [t, u] = h({ current: "search" });
28
- l(() => {
29
- let s;
26
+ function Z(c = { className: "", children: null, debug: !1 }) {
27
+ const [r, i] = m(!1), [t, p] = m({ current: "search" }), [k, v] = m("");
28
+ u(() => {
29
+ let a;
30
30
  const o = () => {
31
- window.pagefind && (i(!0), s && clearInterval(s));
31
+ window.pagefind && (i(!0), a && clearInterval(a));
32
32
  };
33
- return o(), s = setInterval(o, 100), () => clearInterval(s);
33
+ return o(), a = setInterval(o, 100), () => clearInterval(a);
34
34
  }, []);
35
- const { children: k, className: S, debug: y, ...T } = c, { state: n, actions: g } = M(), [m, v] = h(!1), d = () => v(!0), f = () => v(!1), a = N(null), L = R(f);
36
- return O(n, y), A(r, d, u), K(r, g.setSearchTerm, d), E(r, m, d, f), P(r, a, m, f), l(() => {
37
- a.current && (m ? a.current.showModal() : a.current.close());
38
- }, [m]), l(() => {
35
+ const { children: T, className: S, debug: L, ...w } = c, { state: n, actions: g } = P(), [l, y] = m(!1), d = () => y(!0), f = () => y(!1), s = N(null), I = R(f);
36
+ return A(n, L), C(r, d), q(r, g.setSearchTerm, d), K(r, l, d, f), E(r, s, l, f), u(() => {
37
+ s.current && (l ? s.current.showModal() : s.current.close());
38
+ }, [l]), u(() => {
39
39
  var o;
40
- const s = (o = a.current) == null ? void 0 : o.querySelector("input");
41
- s && s.focus(), t.current === "ask" ? setTimeout(() => {
42
- a.current.classList.add("n-search-modal-ask");
40
+ const a = (o = s.current) == null ? void 0 : o.querySelector("input");
41
+ a && a.focus(), t.current === "ask" ? setTimeout(() => {
42
+ s.current.classList.add("n-search-modal-ask");
43
43
  }, 150) : t.current === "search" && setTimeout(() => {
44
- a.current.classList.remove("n-search-modal-ask");
44
+ s.current.classList.remove("n-search-modal-ask");
45
45
  }, 150);
46
46
  }, [t.current]), /* @__PURE__ */ e(
47
- w,
47
+ b,
48
48
  {
49
- ref: a,
49
+ ref: s,
50
50
  className: `n-search-modal ${S || ""}`,
51
51
  "data-state": t.current,
52
- ...T,
53
- children: /* @__PURE__ */ e("div", { ref: L, className: "n-search-container", children: [
54
- t.current === "ask" && /* @__PURE__ */ e(C, { setModalState: u }),
55
- t.current === "search" && /* @__PURE__ */ e(F, { children: [
56
- /* @__PURE__ */ e(b, { setSearchTerm: g.setSearchTerm, initialValue: n.searchTerm }),
52
+ ...w,
53
+ children: /* @__PURE__ */ e("div", { ref: I, className: "n-search-container", children: [
54
+ t.current === "ask" && /* @__PURE__ */ e(F, { query: k, setModalState: p }),
55
+ t.current === "search" && /* @__PURE__ */ e(Q, { children: [
57
56
  /* @__PURE__ */ e(
58
- I,
57
+ O,
59
58
  {
60
- setModalState: u,
59
+ setSearchTerm: g.setSearchTerm,
60
+ setAskNetlifyQuery: v,
61
+ initialValue: n.searchTerm
62
+ }
63
+ ),
64
+ /* @__PURE__ */ e(
65
+ M,
66
+ {
67
+ setModalState: p,
61
68
  searchLoading: n.isLoading,
62
69
  searchTerm: n.searchTerm,
63
70
  results: n.results,
64
- children: k
71
+ children: T
65
72
  }
66
73
  ),
67
74
  /* @__PURE__ */ e("div", { className: "n-search-footer", children: [
68
75
  /* @__PURE__ */ e("p", { className: "n-search-footer-tip", children: [
69
- /* @__PURE__ */ e(p, { keyNames: ["Esc"] }),
76
+ /* @__PURE__ */ e(h, { keyNames: ["Esc"] }),
70
77
  "to close"
71
78
  ] }),
72
79
  /* @__PURE__ */ e("p", { className: "n-search-footer-tip", children: [
73
- /* @__PURE__ */ e(p, { keyNames: ["Tab"] }),
80
+ /* @__PURE__ */ e(h, { keyNames: ["Tab"] }),
74
81
  /* @__PURE__ */ e("span", { children: "or" }),
75
- /* @__PURE__ */ e(p, { keyNames: ["↑", "↓"] }),
82
+ /* @__PURE__ */ e(h, { keyNames: ["↑", "↓"] }),
76
83
  "to navigate"
77
84
  ] })
78
85
  ] })
@@ -82,5 +89,5 @@ function X(c = { className: "", children: null, debug: !1 }) {
82
89
  );
83
90
  }
84
91
  export {
85
- X as default
92
+ Z as default
86
93
  };
@@ -1,43 +1,42 @@
1
1
  import { u as e } from "../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
- import { T as h } from "../../../../chunks/hooks.module.DGkdD5n9.js";
3
- import s from "./SearchHeading/SearchHeading.js";
4
- import a from "./SearchLink/SearchLink.js";
5
- import { Fragment as d } from "preact";
6
- const u = {
2
+ import { T as o } from "../../../../chunks/hooks.module.DGkdD5n9.js";
3
+ import a from "./SearchHeading/SearchHeading.js";
4
+ import s from "./SearchLink/SearchLink.js";
5
+ import { Fragment as m } from "preact";
6
+ const h = {
7
7
  light: "dark",
8
8
  dark: "light"
9
- }, g = (n) => {
10
- const r = document.getElementById("site-theme-select");
11
- r && (r.value = n), document.documentElement.setAttribute("data-theme", n), localStorage.setItem("theme", n);
12
- }, f = ({
9
+ }, d = (n) => {
10
+ document.documentElement.setAttribute("data-theme", n), localStorage.setItem("theme", n);
11
+ }, u = ({
13
12
  searchLoading: n,
14
13
  searchTerm: r,
15
14
  results: t
16
15
  }) => {
17
16
  if (n)
18
- return /* @__PURE__ */ e(s, { children: [
17
+ return /* @__PURE__ */ e(a, { children: [
19
18
  "Searching for ",
20
19
  /* @__PURE__ */ e("span", { className: "n-search-term", children: r }),
21
20
  " ..."
22
21
  ] });
23
22
  if (!t || t.length === 0)
24
- return /* @__PURE__ */ e(s, { children: [
23
+ return /* @__PURE__ */ e(a, { children: [
25
24
  "0 results for ",
26
25
  /* @__PURE__ */ e("span", { className: "n-search-term", children: r })
27
26
  ] });
28
- const c = h(() => t.map((l, i) => /* @__PURE__ */ e("li", { className: "n-results-list-item", children: /* @__PURE__ */ e(a, { ...l }) }, i)), [t]);
27
+ const c = o(() => t.map((l, i) => /* @__PURE__ */ e("li", { className: "n-results-list-item", children: /* @__PURE__ */ e(s, { ...l }) }, i)), [t]);
29
28
  return /* @__PURE__ */ e("ul", { className: "n-results-list", role: "list", children: c });
30
29
  };
31
- function A({
30
+ function N({
32
31
  setModalState: n,
33
32
  searchLoading: r,
34
33
  searchTerm: t,
35
34
  results: c,
36
35
  children: l
37
36
  }) {
38
- return /* @__PURE__ */ e("div", { className: "n-search-window", children: /* @__PURE__ */ e("div", { className: "n-search-links", children: t && t.length > 1 ? /* @__PURE__ */ e(f, { searchLoading: r, searchTerm: t, results: c }) : l ? /* @__PURE__ */ e(d, { children: [
37
+ return /* @__PURE__ */ e("div", { className: "n-search-window", children: /* @__PURE__ */ e("div", { className: "n-search-links", children: t && t.length > 1 ? /* @__PURE__ */ e(u, { searchLoading: r, searchTerm: t, results: c }) : l ? /* @__PURE__ */ e(m, { children: [
39
38
  /* @__PURE__ */ e(
40
- a,
39
+ s,
41
40
  {
42
41
  as: "button",
43
42
  icon: "askNetlify",
@@ -48,21 +47,21 @@ function A({
48
47
  }
49
48
  ),
50
49
  l,
51
- /* @__PURE__ */ e(s, { children: "Actions" }),
50
+ /* @__PURE__ */ e(a, { children: "Actions" }),
52
51
  /* @__PURE__ */ e(
53
- a,
52
+ s,
54
53
  {
55
54
  as: "button",
56
55
  icon: "lightbulb",
57
56
  label: "Toggle theme",
58
57
  onClick: () => {
59
- const i = window.matchMedia("(prefers-color-scheme: dark)").matches, m = document.documentElement.getAttribute("data-theme"), o = i ? "dark" : m || "light";
60
- o && g(u[o]);
58
+ const i = document.documentElement.getAttribute("data-theme");
59
+ i && d(h[i]);
61
60
  }
62
61
  }
63
62
  )
64
63
  ] }) : null }) });
65
64
  }
66
65
  export {
67
- A as default
66
+ N as default
68
67
  };
@@ -9,6 +9,4 @@
9
9
  *
10
10
  * @param onOpen - A function to be called when a toggle element is clicked.
11
11
  */
12
- export declare function useSearchToggles(isPagefindLoaded: boolean, onOpen: () => void, setState: (state: {
13
- current: string;
14
- }) => void): void;
12
+ export declare function useSearchToggles(isPagefindLoaded: boolean, onOpen: () => void): void;
@@ -1,19 +1,16 @@
1
- import { y as a } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
- function s(c, t, l) {
3
- a(() => {
1
+ import { y as l } from "../../../../chunks/hooks.module.DGkdD5n9.js";
2
+ function i(c, r) {
3
+ l(() => {
4
4
  if (!c) return;
5
- const r = document.querySelectorAll("[data-ntl-search-toggle]");
6
- if (r.length)
7
- return r.forEach((e) => {
8
- const o = e.dataset.ntlSearchToggle ? e.dataset.ntlSearchToggle : "search";
9
- e.removeAttribute("disabled"), e.addEventListener("click", () => {
10
- t(), l({ current: o });
11
- });
5
+ const t = document.querySelectorAll("[data-ntl-search-toggle]");
6
+ if (t.length)
7
+ return t.forEach((e) => {
8
+ e.removeAttribute("disabled"), e.addEventListener("click", r);
12
9
  }), () => {
13
- r.forEach((e) => e.removeEventListener("click", t));
10
+ t.forEach((e) => e.removeEventListener("click", r));
14
11
  };
15
- }, [c, t]);
12
+ }, [c, r]);
16
13
  }
17
14
  export {
18
- s as useSearchToggles
15
+ i as useSearchToggles
19
16
  };
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": "1.5.0-alpha.14",
4
+ "version": "1.5.0-alpha.3",
5
5
  "type": "module",
6
6
  "main": "dist/components/preact/index.js",
7
7
  "types": "dist/components/preact/index.d.ts",