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.
|
@@ -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, {
|
|
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;
|