noph-ui 0.29.4 → 0.29.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.
@@ -14,6 +14,7 @@
14
14
  },
15
15
  showPopover = $bindable(),
16
16
  hidePopover = $bindable(),
17
+ open = $bindable(false),
17
18
  onbeforetoggle,
18
19
  timeout = 4000,
19
20
  element = $bindable(),
@@ -42,10 +43,10 @@
42
43
  aria-labelledby="np-snackbar-label-{uid}"
43
44
  onbeforetoggle={(event) => {
44
45
  let { newState } = event
45
- if (newState === 'closed') {
46
+ open = newState === 'open'
47
+ if (!open) {
46
48
  clearTimeout(timeoutId)
47
- }
48
- if (newState === 'open' && timeout > 0) {
49
+ } else if (timeout > 0) {
49
50
  timeoutId = setTimeout(() => {
50
51
  element?.hidePopover()
51
52
  }, timeout)
@@ -1,4 +1,4 @@
1
1
  import type { SnackbarProps } from './types.ts';
2
- declare const Snackbar: import("svelte").Component<SnackbarProps, {}, "element" | "showPopover" | "hidePopover">;
2
+ declare const Snackbar: import("svelte").Component<SnackbarProps, {}, "element" | "showPopover" | "hidePopover" | "open">;
3
3
  type Snackbar = ReturnType<typeof Snackbar>;
4
4
  export default Snackbar;
@@ -2,6 +2,7 @@ import type { Snippet } from 'svelte';
2
2
  import type { HTMLAttributes } from 'svelte/elements';
3
3
  export interface SnackbarProps extends HTMLAttributes<HTMLDivElement> {
4
4
  label: string;
5
+ open?: boolean;
5
6
  supportingText?: string | undefined;
6
7
  actionLabel?: string | undefined;
7
8
  onActionClick?: (event: Event) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.29.4",
3
+ "version": "0.29.5",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {