@marianmeres/stuic 1.75.0 → 1.76.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.
@@ -131,66 +131,63 @@ const _isFn = (v) => typeof v === "function";
131
131
  </script>
132
132
 
133
133
  {#if $notifications.length}
134
- <dialog open>
135
- <div class={_wrapClass}>
136
- <div class={_wrapInnerClass}>
137
- {#each $notifications as n}
138
- {@const iconFn = _iconFn(n)}
139
- <!-- use your own component -->
140
- {#if n?.component}
141
- <svelte:component
142
- this={n.component.component || n.component}
143
- {...n.component.props || {}}
144
- notification={n}
145
- {notifications}
146
- />
147
- {:else}
148
- <!-- svelte-ignore
134
+ <div class={_wrapClass} aria-live="assertive">
135
+ <div class={_wrapInnerClass}>
136
+ {#each $notifications as n}
137
+ {@const iconFn = _iconFn(n)}
138
+ <!-- use your own component -->
139
+ {#if n?.component}
140
+ <svelte:component
141
+ this={n.component.component || n.component}
142
+ {...n.component.props || {}}
143
+ notification={n}
144
+ {notifications}
145
+ />
146
+ {:else}
147
+ <!-- svelte-ignore
149
148
  a11y-click-events-have-key-events
150
149
  a11y-no-noninteractive-element-interactions
151
150
  a11y-mouse-events-have-key-events -->
152
- <div
153
- transition:fade|global={{ duration: 200 }}
154
- class={_boxClass(n)}
155
- class:cursor-pointer={typeof n.onClick === 'function'}
156
- data-notification-type={n.type}
157
- data-notification-multiple={n.count > 1 ? true : undefined}
158
- role="alert"
159
- on:mouseover={() =>
160
- notifications.event(n.id, notifications.EVENT.MOUSEOVER)}
161
- on:mouseout={() => notifications.event(n.id, notifications.EVENT.MOUSEOUT)}
162
- on:click={() => notifications.event(n.id, notifications.EVENT.CLICK)}
163
- >
164
- {#if n.count > 1}
165
- <div class={_countClass(n)}>
166
- {n.count}
167
- </div>
168
- {/if}
169
-
170
- {#if _isFn(iconFn)}
171
- <div class={_iconClass(n)}>{@html iconFn()}</div>
172
- {/if}
173
-
174
- <div class={_contentClass(n)}>
175
- <Thc
176
- thc={n.content}
177
- forceAsHtml={n.forceAsHtml ?? forceAsHtml}
178
- notification={n}
179
- {notifications}
180
- />
151
+ <div
152
+ transition:fade|global={{ duration: 200 }}
153
+ class={_boxClass(n)}
154
+ class:cursor-pointer={typeof n.onClick === 'function'}
155
+ data-notification-type={n.type}
156
+ data-notification-multiple={n.count > 1 ? true : undefined}
157
+ role="alert"
158
+ on:mouseover={() => notifications.event(n.id, notifications.EVENT.MOUSEOVER)}
159
+ on:mouseout={() => notifications.event(n.id, notifications.EVENT.MOUSEOUT)}
160
+ on:click={() => notifications.event(n.id, notifications.EVENT.CLICK)}
161
+ >
162
+ {#if n.count > 1}
163
+ <div class={_countClass(n)}>
164
+ {n.count}
181
165
  </div>
166
+ {/if}
182
167
 
183
- <button
184
- class={_buttonClass(n)}
185
- aria-label={ariaCloseLabel}
186
- on:click|preventDefault|stopPropagation={() => notifications.remove(n.id)}
187
- >
188
- <X class={_xClass(n)} />
189
- </button>
168
+ {#if _isFn(iconFn)}
169
+ <div class={_iconClass(n)}>{@html iconFn()}</div>
170
+ {/if}
171
+
172
+ <div class={_contentClass(n)}>
173
+ <Thc
174
+ thc={n.content}
175
+ forceAsHtml={n.forceAsHtml ?? forceAsHtml}
176
+ notification={n}
177
+ {notifications}
178
+ />
190
179
  </div>
191
- {/if}
192
- {/each}
193
- </div>
180
+
181
+ <button
182
+ class={_buttonClass(n)}
183
+ aria-label={ariaCloseLabel}
184
+ on:click|preventDefault|stopPropagation={() => notifications.remove(n.id)}
185
+ >
186
+ <X class={_xClass(n)} />
187
+ </button>
188
+ </div>
189
+ {/if}
190
+ {/each}
194
191
  </div>
195
- </dialog>
192
+ </div>
196
193
  {/if}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/stuic",
3
- "version": "1.75.0",
3
+ "version": "1.76.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package && node ./scripts/date.js",