@skeletonlabs/skeleton 2.9.0 → 2.9.1-dev.0020c671

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.
@@ -24,7 +24,7 @@ export let transitionInParams = getContext("transitionInParams");
24
24
  export let transitionOut = getContext("transitionOut");
25
25
  export let transitionOutParams = getContext("transitionOutParams");
26
26
  const svgCaretIcon = `
27
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class={classesControlCaret}>
27
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
28
28
  <path d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z" />
29
29
  </svg>`;
30
30
  function setActive(event) {
@@ -4,7 +4,7 @@ declare const __propDef: {
4
4
  [x: string]: any;
5
5
  /** Rail: Provide classes to set the background color.*/
6
6
  background?: string | undefined;
7
- /** Rail: Provide classes to set the background color.*/
7
+ /** Rail: Provide classes to set the border color.*/
8
8
  border?: string | undefined;
9
9
  /** Rail: Provide classes to set the width.*/
10
10
  width?: string | undefined;
@@ -89,6 +89,7 @@ function onMouseLeave(index) {
89
89
  classesSnackbar = classesSnackbar.replace(" scale-[105%]", "");
90
90
  }
91
91
  }
92
+ let wrapperVisible = false;
92
93
  $:
93
94
  classesWrapper = `${cWrapper} ${cPosition} ${zIndex} ${$$props.class || ""}`;
94
95
  $:
@@ -97,9 +98,13 @@ $:
97
98
  classesToast = `${cToast} ${width} ${color} ${padding} ${spacing} ${rounded} ${shadow}`;
98
99
  $:
99
100
  filteredToasts = Array.from($toastStore).slice(0, max);
101
+ $:
102
+ if (filteredToasts.length) {
103
+ wrapperVisible = true;
104
+ }
100
105
  </script>
101
106
 
102
- {#if $toastStore.length}
107
+ {#if filteredToasts.length > 0 || wrapperVisible}
103
108
  <!-- Wrapper -->
104
109
  <div class="snackbar-wrapper {classesWrapper}" data-testid="snackbar-wrapper">
105
110
  <!-- List -->
@@ -117,6 +122,10 @@ $:
117
122
  params: { x: animAxis.x, y: animAxis.y, ...transitionOutParams },
118
123
  enabled: transitions
119
124
  }}
125
+ on:outroend={() => {
126
+ const outroFinishedForLastToastOnQueue = filteredToasts.length === 0;
127
+ if (outroFinishedForLastToastOnQueue) wrapperVisible = false;
128
+ }}
120
129
  on:mouseenter={() => onMouseEnter(i)}
121
130
  on:mouseleave={() => onMouseLeave(i)}
122
131
  role={t.hideDismiss ? 'alert' : 'alertdialog'}
@@ -4,8 +4,12 @@ export let toastSettings = [];
4
4
  export let max = void 0;
5
5
  initializeToastStore();
6
6
  const toastStore = getToastStore();
7
- toastSettings.forEach((element) => {
8
- toastStore.trigger(element);
7
+ toastSettings.forEach(({ triggerDelay, ...settings }) => {
8
+ if (triggerDelay) {
9
+ setTimeout(() => toastStore.trigger(settings), triggerDelay);
10
+ } else {
11
+ toastStore.trigger(settings);
12
+ }
9
13
  });
10
14
  </script>
11
15
 
@@ -2,7 +2,9 @@ import { SvelteComponentTyped } from "svelte";
2
2
  import type { ToastSettings } from './types.js';
3
3
  declare const __propDef: {
4
4
  props: {
5
- toastSettings?: ToastSettings[] | undefined;
5
+ toastSettings?: (ToastSettings & {
6
+ triggerDelay?: number | undefined;
7
+ })[] | undefined;
6
8
  max?: number | undefined;
7
9
  };
8
10
  events: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton",
3
- "version": "2.9.0",
3
+ "version": "2.9.1-dev.0020c671",
4
4
  "description": "A SvelteKit component library.",
5
5
  "author": "endigo9740 <chris@skeletonlabs.dev>",
6
6
  "repository": {