noph-ui 0.45.1 → 0.46.0

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.
@@ -35,6 +35,7 @@
35
35
  let {
36
36
  value = $bindable(),
37
37
  defaultValue,
38
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- pulled out of the rest props on purpose
38
39
  type,
39
40
  'aria-invalid': ariaInvalid,
40
41
  style,
@@ -49,6 +49,7 @@
49
49
  let {
50
50
  value = $bindable(),
51
51
  defaultValue,
52
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- pulled out of the rest props on purpose
52
53
  type,
53
54
  'aria-invalid': ariaInvalid,
54
55
  style,
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import { tick } from 'svelte'
2
3
  import '../internal/focus-ring.css'
3
4
  import IconButton from '../button/IconButton.svelte'
4
5
  import ArrowBackIcon from '../icons/ArrowBackIcon.svelte'
@@ -34,6 +35,18 @@
34
35
 
35
36
  let pointerFocus = false
36
37
  let focusRing = $state(false)
38
+
39
+ export const show = async () => {
40
+ expanded = true
41
+ pointerFocus = true
42
+ await tick()
43
+ inputElement?.focus()
44
+ }
45
+
46
+ export const close = () => {
47
+ expanded = false
48
+ inputElement?.blur()
49
+ }
37
50
  </script>
38
51
 
39
52
  <div
@@ -388,4 +401,14 @@
388
401
  .np-search-divided.np-search-full-screen.np-search-expanded .np-search-bar {
389
402
  height: 4.5rem;
390
403
  }
404
+
405
+ @media (prefers-reduced-motion: no-preference) {
406
+ @starting-style {
407
+ .np-search-full-screen.np-search-expanded,
408
+ .np-search-divided.np-search-full-screen.np-search-expanded {
409
+ padding-block-start: 0;
410
+ padding-inline: var(--np-search-pane-margin, 1.5rem);
411
+ }
412
+ }
413
+ }
391
414
  </style>
@@ -1,5 +1,8 @@
1
1
  import '../internal/focus-ring.css';
2
2
  import type { SearchProps } from './types.ts';
3
- declare const Search: import("svelte").Component<SearchProps, {}, "element" | "value" | "inputElement" | "expanded">;
3
+ declare const Search: import("svelte").Component<SearchProps, {
4
+ show: () => Promise<void>;
5
+ close: () => void;
6
+ }, "element" | "value" | "inputElement" | "expanded">;
4
7
  type Search = ReturnType<typeof Search>;
5
8
  export default Search;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.45.1",
3
+ "version": "0.46.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {