@netlify/spark-ui 1.14.3 → 1.14.5

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.
@@ -1,6 +1,6 @@
1
1
  import "../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
2
  import "../../../chunks/hooks.module.DGkdD5n9.js";
3
- import { A as d } from "../../../chunks/AskNetlify.34ZT77N0.js";
3
+ import { A as d } from "../../../chunks/AskNetlify.5UxkBfoE.js";
4
4
  import "./components/QuestionList/questions.js";
5
5
  import "./components/QuestionList/QuestionList.js";
6
6
  import "./components/BackButton.js";
@@ -1,6 +1,6 @@
1
1
  import { u as e } from "../../../../../chunks/jsxRuntime.module.Bzuv3cXw.js";
2
2
  import { A as g, y as f, d } from "../../../../../chunks/hooks.module.DGkdD5n9.js";
3
- import { A as K, K as L } from "../../../../../chunks/AskNetlify.34ZT77N0.js";
3
+ import { A as K, K as L } from "../../../../../chunks/AskNetlify.5UxkBfoE.js";
4
4
  import P from "../../../Modal/Modal.js";
5
5
  import h from "../../../KeyboardKey/KeyboardKey.js";
6
6
  import M from "../SearchWindow.js";
@@ -4,7 +4,7 @@ import { default as m } from "./Icon/index.js";
4
4
  import { default as s } from "./SearchModal/components/SearchLink/SearchLink.js";
5
5
  import { default as u } from "./SearchModal/components/SearchHeading/SearchHeading.js";
6
6
  import { default as i } from "./SearchModal/components/SearchToggle/SearchToggle.js";
7
- import { A as S } from "../../chunks/AskNetlify.34ZT77N0.js";
7
+ import { A as S } from "../../chunks/AskNetlify.5UxkBfoE.js";
8
8
  import "preact";
9
9
  import "../../chunks/hooks.module.DGkdD5n9.js";
10
10
  import { default as n } from "./SearchModal/components/SearchModal/SearchModal.js";
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.14.3",
4
+ "version": "1.14.5",
5
5
  "type": "module",
6
6
  "main": "dist/components/preact/index.js",
7
7
  "types": "dist/components/preact/index.d.ts",
@@ -1,6 +1,10 @@
1
- <div class="n-action-arrow">
1
+ ---
2
+ const { class: className, ...rest } = Astro.props;
3
+ ---
4
+
5
+ <div class:list={['n-action-arrow', className]} {...rest}>
2
6
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="none" viewBox="0 0 14 14">
3
- <g stroke="currentColor" stroke-linecap="square" stroke-width="1.564" clip-path="url(#a)">
7
+ <g stroke="currentColor" stroke-linecap="square" stroke-width="1.564">
4
8
  <path stroke-linejoin="round" d="M3.417 10.556 9.4 4.572"></path>
5
9
  <path d="M9.88 9.381V4.093H4.59"></path>
6
10
  </g>
@@ -17,7 +17,7 @@ const { id, href, text, class: className, ...rest } = Astro.props;
17
17
 
18
18
  <style>
19
19
  .n-action-link {
20
- display: inline-flex;
20
+ display: inline-block;
21
21
  gap: var(--space-3xs);
22
22
  align-items: center;
23
23
  font-weight: var(--font-weight-medium);
@@ -31,5 +31,9 @@ const { id, href, text, class: className, ...rest } = Astro.props;
31
31
  text-decoration-color: var(--color-link);
32
32
  text-underline-offset: 0.1em;
33
33
  }
34
+
35
+ :is(span + .n-action-arrow) {
36
+ margin-inline-start: 0.1em;
37
+ }
34
38
  }
35
39
  </style>
@@ -121,12 +121,6 @@ const isAnchorHeadline = isCardClickable && headline && !link?.text && link?.hre
121
121
  min-width: 0;
122
122
  }
123
123
 
124
- .n-card :global(.n-action-arrow) {
125
- flex: 0 0 auto;
126
- align-self: center;
127
- margin-inline-start: auto;
128
- }
129
-
130
124
  .n-card-paragraph {
131
125
  line-height: var(--line-height-text);
132
126
  }
@@ -167,6 +161,10 @@ const isAnchorHeadline = isCardClickable && headline && !link?.text && link?.hre
167
161
  }
168
162
  }
169
163
 
164
+ .n-card-clickable .n-action-arrow {
165
+ margin-inline-start: auto;
166
+ }
167
+
170
168
  /* Focus for Anchor Headline */
171
169
  .n-card-anchor-heaadline:focus-within {
172
170
  box-shadow: 0 0 0 3px var(--color-focus-ring, Highlight);
@@ -51,35 +51,19 @@ export default function AskNetlify({ setModalState, searchQuery, urlParamQuery }
51
51
  }
52
52
  }, [newMessageReady]);
53
53
 
54
- const [urlParamHandled, setUrlParamHandled] = useState(false);
55
-
56
54
  useEffect(() => {
57
- if (urlParamQuery && !urlParamHandled) {
58
- const trimmedQuery = urlParamQuery.trim();
59
- setMessage(trimmedQuery);
60
- setUrlParamHandled(true); // prevent refilling after submission
55
+ if (searchQuery) {
56
+ message && setMessage('');
57
+ submitQuery(searchQuery.trim());
58
+ setNewMessageReady(true);
61
59
  }
62
- }, [urlParamQuery, urlParamHandled]);
60
+ }, [searchQuery, setMessage, setNewMessageReady]);
63
61
 
64
- /**
65
- * Populates and handles the input when a query is present.
66
- *
67
- * - If `urlParamQuery` exists, pre-fills the input and waits for user action.
68
- * - If `searchQuery` exists, auto-submits the query.
69
- *
70
- * Focuses the input and marks the message as ready in both cases.
71
- */
72
62
  useEffect(() => {
73
- if (!searchQuery) return;
74
-
75
- const trimmedQuery = searchQuery.trim();
76
-
77
- if (searchQuery) {
78
- submitQuery(trimmedQuery);
79
- inputRef?.current?.focus();
80
- setNewMessageReady(true);
63
+ if (!searchQuery && urlParamQuery) {
64
+ setMessage(urlParamQuery);
81
65
  }
82
- }, [setMessage, setNewMessageReady, submitQuery, searchQuery]);
66
+ }, [urlParamQuery, searchQuery, setMessage]);
83
67
 
84
68
  return (
85
69
  <div className="n-ask-chat-container">
@@ -29,6 +29,16 @@
29
29
  grid-auto-rows: var(--n-grid-auto-rows, auto);
30
30
  }
31
31
 
32
+ .n-flex-grid {
33
+ display: flex;
34
+ flex-wrap: wrap;
35
+ gap: var(--n-grid-gap, var(--space-m));
36
+
37
+ > * {
38
+ flex: 1 1 var(--n-grid-column-min-size);
39
+ }
40
+ }
41
+
32
42
  .n-stack {
33
43
  display: grid;
34
44
  grid-template-areas: 'stack';