noph-ui 0.45.1 → 0.46.1
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.
- package/dist/date-picker/DockedDatePicker.svelte +1 -0
- package/dist/date-picker/DockedDateTimePicker.svelte +1 -0
- package/dist/dialog/Dialog.svelte +4 -2
- package/dist/dialog/types.d.ts +1 -0
- package/dist/list/index.d.ts +1 -0
- package/dist/list/index.js +1 -0
- package/dist/search/Search.svelte +34 -1
- package/dist/search/Search.svelte.d.ts +4 -1
- package/dist/sheet/Sheet.svelte +4 -1
- package/dist/sheet/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
quick = false,
|
|
10
10
|
children,
|
|
11
11
|
headline,
|
|
12
|
+
headlineLevel = 2,
|
|
12
13
|
icon,
|
|
13
14
|
supportingText,
|
|
14
15
|
actions,
|
|
@@ -61,13 +62,14 @@
|
|
|
61
62
|
</div>
|
|
62
63
|
{/if}
|
|
63
64
|
{#if headline}
|
|
64
|
-
<
|
|
65
|
+
<svelte:element
|
|
66
|
+
this={`h${headlineLevel}`}
|
|
65
67
|
id="{uid}-dialog-headline"
|
|
66
68
|
class="np-dialog-headline"
|
|
67
69
|
style={icon ? 'text-align: center' : ''}
|
|
68
70
|
>
|
|
69
71
|
{headline}
|
|
70
|
-
</
|
|
72
|
+
</svelte:element>
|
|
71
73
|
{/if}
|
|
72
74
|
{#if supportingText}
|
|
73
75
|
<p id="{uid}-dialog-supporting-text" class="np-dialog-supporting-text">{supportingText}</p>
|
package/dist/dialog/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { HTMLDialogAttributes } from 'svelte/elements';
|
|
|
3
3
|
export interface DialogProps extends Omit<HTMLDialogAttributes, 'open'> {
|
|
4
4
|
icon?: Snippet;
|
|
5
5
|
headline?: string;
|
|
6
|
+
headlineLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
7
|
supportingText?: string;
|
|
7
8
|
divider?: boolean;
|
|
8
9
|
actions?: Snippet;
|
package/dist/list/index.d.ts
CHANGED
package/dist/list/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { flushSync } 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,8 +35,29 @@
|
|
|
34
35
|
|
|
35
36
|
let pointerFocus = false
|
|
36
37
|
let focusRing = $state(false)
|
|
38
|
+
let pointerInside = false
|
|
39
|
+
|
|
40
|
+
export const show = () => {
|
|
41
|
+
expanded = true
|
|
42
|
+
pointerFocus = true
|
|
43
|
+
flushSync()
|
|
44
|
+
inputElement?.focus()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const close = () => {
|
|
48
|
+
expanded = false
|
|
49
|
+
inputElement?.blur()
|
|
50
|
+
}
|
|
37
51
|
</script>
|
|
38
52
|
|
|
53
|
+
<svelte:window
|
|
54
|
+
onpointerdown={(event) => {
|
|
55
|
+
pointerInside = event.target instanceof Node && element?.contains(event.target) === true
|
|
56
|
+
}}
|
|
57
|
+
onpointercancel={() => (pointerInside = false)}
|
|
58
|
+
onclick={() => (pointerInside = false)}
|
|
59
|
+
/>
|
|
60
|
+
|
|
39
61
|
<div
|
|
40
62
|
{...attributes}
|
|
41
63
|
bind:this={element}
|
|
@@ -52,7 +74,8 @@
|
|
|
52
74
|
}}
|
|
53
75
|
onfocusout={(event) => {
|
|
54
76
|
const next = event.relatedTarget
|
|
55
|
-
if (expanded && !(next instanceof Node && element?.contains(next)))
|
|
77
|
+
if (expanded && !pointerInside && !(next instanceof Node && element?.contains(next)))
|
|
78
|
+
expanded = false
|
|
56
79
|
attributes.onfocusout?.(event)
|
|
57
80
|
}}
|
|
58
81
|
>
|
|
@@ -388,4 +411,14 @@
|
|
|
388
411
|
.np-search-divided.np-search-full-screen.np-search-expanded .np-search-bar {
|
|
389
412
|
height: 4.5rem;
|
|
390
413
|
}
|
|
414
|
+
|
|
415
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
416
|
+
@starting-style {
|
|
417
|
+
.np-search-full-screen.np-search-expanded,
|
|
418
|
+
.np-search-divided.np-search-full-screen.np-search-expanded {
|
|
419
|
+
padding-block-start: 0;
|
|
420
|
+
padding-inline: var(--np-search-pane-margin, 1.5rem);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
391
424
|
</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: () => void;
|
|
5
|
+
close: () => void;
|
|
6
|
+
}, "element" | "value" | "inputElement" | "expanded">;
|
|
4
7
|
type Search = ReturnType<typeof Search>;
|
|
5
8
|
export default Search;
|
package/dist/sheet/Sheet.svelte
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
placement = 'bottom',
|
|
9
9
|
handle = true,
|
|
10
10
|
headline,
|
|
11
|
+
headlineLevel = 2,
|
|
11
12
|
action,
|
|
12
13
|
children,
|
|
13
14
|
element = $bindable(),
|
|
@@ -63,7 +64,9 @@
|
|
|
63
64
|
{#if headline || action}
|
|
64
65
|
<div class="np-sheet-header">
|
|
65
66
|
{#if headline}
|
|
66
|
-
<
|
|
67
|
+
<svelte:element this={`h${headlineLevel}`} id={headlineId} class="np-sheet-headline">
|
|
68
|
+
{headline}
|
|
69
|
+
</svelte:element>
|
|
67
70
|
{/if}
|
|
68
71
|
{#if action}
|
|
69
72
|
<div class="np-sheet-action">{@render action()}</div>
|
package/dist/sheet/types.d.ts
CHANGED