@sveltia/ui 0.22.1 → 0.22.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.
@@ -179,7 +179,7 @@
179
179
  color: var(--sui-error-foreground-color);
180
180
  }
181
181
  .checkbox :global(button[aria-checked="true"][aria-invalid="true"]) {
182
- background-color: var(--sui-error-background-color);
182
+ background-color: var(--sui-checkbox-background-color);
183
183
  }
184
184
  .checkbox label {
185
185
  cursor: inherit;
@@ -182,7 +182,7 @@
182
182
  {position}
183
183
  touchOptimized={true}
184
184
  bind:open={isPopupOpen}
185
- onopen={() => {
185
+ onOpen={() => {
186
186
  showFilter = (popupContent?.querySelectorAll('[role="option"]')?.length ?? 0) > 5;
187
187
  searchTerms = '';
188
188
  }}
@@ -284,7 +284,6 @@
284
284
  }
285
285
  .combobox div[role=combobox][aria-invalid=true] {
286
286
  border-color: var(--sui-error-border-color);
287
- background-color: var(--sui-error-background-color);
288
287
  }
289
288
  .combobox div[role=combobox] .label {
290
289
  display: block;
@@ -6,6 +6,7 @@
6
6
  -->
7
7
  <script>
8
8
  import { generateElementId } from '@sveltia/utils/element';
9
+ import { untrack } from 'svelte';
9
10
  import { _ } from 'svelte-i18n';
10
11
  import Button from '../button/button.svelte';
11
12
  import Icon from '../icon/icon.svelte';
@@ -55,6 +56,16 @@
55
56
  const isMin = $derived(typeof min === 'number' && Number(inputValue || 0) <= min);
56
57
  const isMax = $derived(typeof max === 'number' && Number(inputValue || 0) >= max);
57
58
 
59
+ $effect(() => {
60
+ const newInputValue = String(value ?? '');
61
+
62
+ untrack(() => {
63
+ if (inputValue !== newInputValue) {
64
+ inputValue = newInputValue;
65
+ }
66
+ });
67
+ });
68
+
58
69
  $effect(() => {
59
70
  const newValue = inputValue.trim() ? Number(inputValue) : NaN;
60
71
 
@@ -98,9 +98,7 @@
98
98
  {@render children?.()}
99
99
  </div>
100
100
 
101
- <style>@import url("https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,300..800;1,300..800&family=Noto+Sans+Mono:wght@100..900&display=swap");
102
- @import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block");
103
- :global(:root),
101
+ <style>:global(:root),
104
102
  :global(:host) {
105
103
  --sui-base-hue: 210;
106
104
  --sui-highlight-foreground-color: hsl(var(--sui-foreground-color-1-hsl));
@@ -1,11 +1,5 @@
1
1
  @use "variables.scss";
2
2
 
3
- // https://fonts.google.com/share?selection.family=Merriweather+Sans:ital,wght@0,300..800;1,300..800|Noto+Sans+Mono:wght@100..900
4
- @import url("https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,300..800;1,300..800&family=Noto+Sans+Mono:wght@100..900&display=swap");
5
- // https://fonts.google.com/icons?icon.set=Material+Symbols
6
- // Use `font-display: block;` @see https://stackoverflow.com/q/41710834
7
- @import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block");
8
-
9
3
  :global {
10
4
  .material-symbols-outlined {
11
5
  font-variation-settings:
@@ -387,10 +387,10 @@ export type TextInputProps = {
387
387
  */
388
388
  element?: HTMLInputElement | undefined;
389
389
  /**
390
- * - The `role` attribute on
391
- * the `<input>` element.
390
+ * - The `role`
391
+ * attribute on the `<input>` element.
392
392
  */
393
- role?: "textbox" | "searchbox" | "combobox" | "spinbutton" | undefined;
393
+ role?: "textbox" | "searchbox" | "combobox" | "spinbutton" | "gridcell" | undefined;
394
394
  /**
395
395
  * - Keyboard shortcuts. An alias of the
396
396
  * `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
package/dist/typedefs.js CHANGED
@@ -130,8 +130,8 @@
130
130
  /**
131
131
  * @typedef {object} TextInputProps
132
132
  * @property {HTMLInputElement} [element] - Reference to the `<input>` element.
133
- * @property {'textbox' | 'searchbox' | 'combobox' | 'spinbutton'} [role] - The `role` attribute on
134
- * the `<input>` element.
133
+ * @property {'textbox' | 'searchbox' | 'combobox' | 'spinbutton' | 'gridcell'} [role] - The `role`
134
+ * attribute on the `<input>` element.
135
135
  * @property {string} [keyShortcuts] - Keyboard shortcuts. An alias of the
136
136
  * `aria-keyshortcuts` attribute. Accepts the special `Accel` key, which will be replaced with
137
137
  * `Control` or `Meta` depending on the user’s operating system.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.22.1",
3
+ "version": "0.22.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {