@invopop/popui 0.1.8 → 0.1.9

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.
@@ -32,7 +32,7 @@
32
32
  {@render children?.()}
33
33
  {#if !collapsed}
34
34
  <div>
35
- <div class="whitespace-nowrap max-w-[140px] truncate tracking-tight">{title}</div>
35
+ <div class="whitespace-nowrap max-w-[120px] truncate tracking-tight">{title}</div>
36
36
  {#if subtitle}
37
37
  <div class="text-sm font-medium text-yellow-600">{subtitle}</div>
38
38
  {/if}
@@ -1,12 +1,46 @@
1
1
  <script lang="ts">
2
2
  import { Toaster as Sonner, type ToasterProps as SonnerProps } from 'svelte-sonner'
3
3
  import { mode } from 'mode-watcher'
4
+ import { Icon } from '@steeze-ui/svelte-icon'
5
+ import { Success, Failure, Info } from '@invopop/ui-icons'
6
+
4
7
  let { ...restProps }: SonnerProps = $props()
5
8
  </script>
6
9
 
7
10
  <Sonner
8
11
  theme={mode.current}
9
12
  class="toaster group"
10
- style="--normal-bg: var(--color-popover); --normal-text: var(--color-popover-foreground); --normal-border: var(--color-border);"
13
+ toastOptions={{
14
+ unstyled: true,
15
+ classes: {
16
+ toast:
17
+ 'group toast bg-neutral-800 border-0 rounded-lg text-white flex gap-2 items-start py-2 px-3 w-[336px]',
18
+ title: 'font-medium text-sm leading-5 tracking-tight text-white',
19
+ description: 'font-normal text-sm leading-5 tracking-tight text-white/70',
20
+ actionButton:
21
+ 'bg-white/10 rounded px-2 py-1 text-xs font-medium text-white leading-4 hover:bg-white/15 transition-colors',
22
+ cancelButton:
23
+ 'bg-white/10 rounded px-2 py-1 text-xs font-medium text-white leading-4 hover:bg-white/15 transition-colors',
24
+ closeButton: 'hidden'
25
+ }
26
+ }}
11
27
  {...restProps}
12
- />
28
+ >
29
+ {#snippet successIcon()}
30
+ <Icon src={Success} class="w-4 h-4 text-positive-500" />
31
+ {/snippet}
32
+
33
+ {#snippet errorIcon()}
34
+ <Icon src={Failure} class="w-4 h-4 text-danger-500" />
35
+ {/snippet}
36
+
37
+ {#snippet infoIcon()}
38
+ <Icon src={Info} class="w-4 h-4 text-white" />
39
+ {/snippet}
40
+ </Sonner>
41
+
42
+ <style>
43
+ :global(.toaster) {
44
+ --width: 336px;
45
+ }
46
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.1.8",
4
+ "version": "0.1.9",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run package",