dssoca 0.2.0 → 0.5.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.
Files changed (37) hide show
  1. package/README.md +54 -18
  2. package/dist/components/Badge.svelte +43 -3
  3. package/dist/components/Badge.svelte.d.ts +3 -0
  4. package/dist/components/Button.svelte +46 -2
  5. package/dist/components/Button.svelte.d.ts +3 -0
  6. package/dist/components/Card.svelte +41 -5
  7. package/dist/components/Card.svelte.d.ts +5 -0
  8. package/dist/components/EmptyState.svelte +45 -34
  9. package/dist/components/EmptyState.svelte.d.ts +5 -0
  10. package/dist/components/Icon.svelte +17 -4
  11. package/dist/components/Icon.svelte.d.ts +7 -1
  12. package/dist/components/Input.svelte +56 -3
  13. package/dist/components/Input.svelte.d.ts +7 -0
  14. package/dist/components/LogStream.svelte +43 -2
  15. package/dist/components/LogStream.svelte.d.ts +3 -0
  16. package/dist/components/MetricTile.svelte +45 -3
  17. package/dist/components/MetricTile.svelte.d.ts +3 -0
  18. package/dist/components/ServiceCard.svelte +68 -3
  19. package/dist/components/ServiceCard.svelte.d.ts +3 -0
  20. package/dist/components/Sidebar.svelte +60 -5
  21. package/dist/components/Sidebar.svelte.d.ts +3 -0
  22. package/dist/components/Sparkline.svelte +26 -2
  23. package/dist/components/Sparkline.svelte.d.ts +5 -0
  24. package/dist/components/Toaster.svelte +91 -59
  25. package/dist/components/Toaster.svelte.d.ts +6 -16
  26. package/dist/components/Topbar.svelte +131 -6
  27. package/dist/components/Topbar.svelte.d.ts +3 -0
  28. package/dist/config.d.ts +32 -14
  29. package/dist/config.js +43 -17
  30. package/dist/dssoca.config.d.ts +50 -0
  31. package/dist/dssoca.config.js +39 -0
  32. package/dist/index.d.ts +2 -2
  33. package/dist/index.js +2 -2
  34. package/dist/theme.css +359 -396
  35. package/package.json +17 -3
  36. package/dist/components/PassocaMark.svelte +0 -15
  37. package/dist/components/PassocaMark.svelte.d.ts +0 -7
@@ -1,11 +1,14 @@
1
1
  <script lang="ts">
2
2
  import { tick, untrack } from 'svelte'
3
+ import { resolveComponentSize, type Size } from '../config.js'
3
4
 
4
5
  interface LogLine { id: number; t: string; lvl: string; svc: string; msg: string }
5
6
 
6
7
  interface Props {
7
8
  live?: boolean
8
9
  initialLines?: Omit<LogLine, 'id'>[]
10
+ /** Token size (sm|md|lg); inherits the global size when unset. */
11
+ size?: Size
9
12
  }
10
13
 
11
14
  const TEMPLATES = [
@@ -29,7 +32,7 @@
29
32
  return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`
30
33
  }
31
34
 
32
- let { live = true, initialLines }: Props = $props()
35
+ let { live = true, initialLines, size }: Props = $props()
33
36
 
34
37
  const seed = untrack(() => initialLines ?? TEMPLATES)
35
38
  let counter = $state(seed.length)
@@ -49,7 +52,7 @@
49
52
  })
50
53
  </script>
51
54
 
52
- <div class="ss-logs" bind:this={el}>
55
+ <div class="ss-logs" bind:this={el} data-size-variant={resolveComponentSize('LogStream', size)}>
53
56
  {#each lines as line (line.id)}
54
57
  <div class="ln">
55
58
  <span class="t">{line.t}</span>
@@ -59,3 +62,41 @@
59
62
  </div>
60
63
  {/each}
61
64
  </div>
65
+
66
+ <style>.ss-logs {
67
+ font-family: var(--ss-font-mono);
68
+ font-size: var(--ss-ui-md);
69
+ background: #0a0a0a;
70
+ color: var(--ss-code-fg);
71
+ padding: var(--ss-gap) var(--ss-panel-body-px);
72
+ min-height: 160px;
73
+ max-height: 240px;
74
+ overflow: auto;
75
+ }
76
+ .ss-logs .ln {
77
+ display: flex;
78
+ gap: 10px;
79
+ line-height: 1.45;
80
+ }
81
+ .ss-logs .t {
82
+ color: var(--ss-fg-faint);
83
+ min-width: 58px;
84
+ }
85
+ .ss-logs .lvl {
86
+ min-width: 38px;
87
+ }
88
+ .ss-logs .lvl.info {
89
+ color: var(--ss-cyan);
90
+ }
91
+ .ss-logs .lvl.warn {
92
+ color: var(--ss-yellow);
93
+ }
94
+ .ss-logs .lvl.err {
95
+ color: var(--ss-red);
96
+ }
97
+ .ss-logs .lvl.ok {
98
+ color: var(--ss-primary);
99
+ }
100
+ .ss-logs .svc {
101
+ color: var(--ss-purple);
102
+ }</style>
@@ -1,3 +1,4 @@
1
+ import { type Size } from '../config.js';
1
2
  interface LogLine {
2
3
  id: number;
3
4
  t: string;
@@ -8,6 +9,8 @@ interface LogLine {
8
9
  interface Props {
9
10
  live?: boolean;
10
11
  initialLines?: Omit<LogLine, 'id'>[];
12
+ /** Token size (sm|md|lg); inherits the global size when unset. */
13
+ size?: Size;
11
14
  }
12
15
  declare const LogStream: import("svelte").Component<Props, {}, "">;
13
16
  type LogStream = ReturnType<typeof LogStream>;
@@ -1,20 +1,62 @@
1
1
  <script lang="ts">
2
+ import { resolveComponentSize, type Size } from '../config.js'
3
+
2
4
  interface Props {
3
5
  label: string
4
6
  value: string | number
5
7
  suffix?: string
6
8
  delta?: string
7
9
  dir?: 'up' | 'down'
10
+ /** Token size (sm|md|lg); inherits the global size when unset. */
11
+ size?: Size
8
12
  }
9
- let { label, value, suffix, delta, dir = 'up' }: Props = $props()
13
+ let { label, value, suffix, delta, dir = 'up', size }: Props = $props()
10
14
  </script>
11
15
 
12
- <div class="ss-metric">
16
+ <div class="ss-metric" data-size-variant={resolveComponentSize('MetricTile', size)}>
13
17
  <div class="label">{label}</div>
14
18
  <div class="val">
15
19
  {value}{#if suffix}<span class="small">{suffix}</span>{/if}
16
20
  </div>
17
21
  {#if delta}
18
- <div class="delta {dir}">{dir === 'up' ? '↑' : '↓'} {delta}</div>
22
+ <div class="delta {dir}" aria-label="{dir === 'up' ? 'up' : 'down'} {delta}">{dir === 'up' ? '↑' : '↓'} {delta}</div>
19
23
  {/if}
20
24
  </div>
25
+
26
+ <style>.ss-metric {
27
+ padding: var(--ss-card-py) var(--ss-card-px);
28
+ border: 1px solid var(--ss-line);
29
+ background: var(--ss-bg-elev);
30
+ display: flex;
31
+ flex-direction: column;
32
+ gap: 4px;
33
+ }
34
+ .ss-metric .label {
35
+ font-family: var(--ss-font-mono);
36
+ font-size: var(--ss-ui-xs);
37
+ color: var(--ss-fg-faint);
38
+ text-transform: lowercase;
39
+ letter-spacing: 0.04em;
40
+ }
41
+ .ss-metric .val {
42
+ font-family: var(--ss-font-display);
43
+ font-weight: 400;
44
+ font-size: var(--ss-metric-val);
45
+ line-height: 1;
46
+ letter-spacing: -0.015em;
47
+ font-variant-numeric: tabular-nums;
48
+ }
49
+ .ss-metric .val .small {
50
+ font-size: 0.5em;
51
+ opacity: 0.5;
52
+ }
53
+ .ss-metric .delta {
54
+ font-family: var(--ss-font-mono);
55
+ font-size: var(--ss-ui-xs);
56
+ }
57
+ .ss-metric .delta.up {
58
+ color: var(--ss-primary);
59
+ }
60
+ .ss-metric .delta.down {
61
+ color: var(--ss-red);
62
+ }</style>
@@ -1,9 +1,12 @@
1
+ import { type Size } from '../config.js';
1
2
  interface Props {
2
3
  label: string;
3
4
  value: string | number;
4
5
  suffix?: string;
5
6
  delta?: string;
6
7
  dir?: 'up' | 'down';
8
+ /** Token size (sm|md|lg); inherits the global size when unset. */
9
+ size?: Size;
7
10
  }
8
11
  declare const MetricTile: import("svelte").Component<Props, {}, "">;
9
12
  type MetricTile = ReturnType<typeof MetricTile>;
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import Badge from './Badge.svelte'
3
3
  import Sparkline from './Sparkline.svelte'
4
+ import { resolveComponentSize, type Size } from '../config.js'
4
5
 
5
6
  interface Props {
6
7
  name: string
@@ -9,6 +10,8 @@
9
10
  latency?: string
10
11
  spark?: number[]
11
12
  onclick?: () => void
13
+ /** Token size (sm|md|lg); inherits the global size when unset. */
14
+ size?: Size
12
15
  }
13
16
  let {
14
17
  name,
@@ -17,6 +20,7 @@
17
20
  latency = '',
18
21
  spark = [4, 8, 6, 10, 7, 12, 9, 14, 11, 16, 13, 10, 12],
19
22
  onclick,
23
+ size,
20
24
  }: Props = $props()
21
25
 
22
26
  const sparkColor = $derived(
@@ -24,9 +28,22 @@
24
28
  : status === 'down' ? 'var(--ss-red)'
25
29
  : 'var(--ss-primary)'
26
30
  )
31
+
32
+ // Spell the status out for assistive tech ("deg" is an opaque abbreviation).
33
+ const statusLabel = $derived(status === 'deg' ? 'degraded' : status)
27
34
  </script>
28
35
 
29
- <div class="ss-svc" role="button" tabindex="0" {onclick} onkeydown={(e) => e.key === 'Enter' && onclick?.()}>
36
+ <div
37
+ class="ss-svc"
38
+ role="button"
39
+ tabindex="0"
40
+ aria-label={name}
41
+ data-size-variant={resolveComponentSize('ServiceCard', size)}
42
+ {onclick}
43
+ onkeydown={(e) => {
44
+ if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onclick?.() }
45
+ }}
46
+ >
30
47
  <div class="head">
31
48
  <div>
32
49
  <div class="name">{name}</div>
@@ -34,11 +51,59 @@
34
51
  </div>
35
52
  </div>
36
53
  <div class="status">
37
- <Badge tone={status}>{status}</Badge>
54
+ <Badge tone={status}>{statusLabel}</Badge>
38
55
  <div class="latency">{latency}</div>
39
56
  </div>
40
57
  <div class="footer">
41
58
  <Sparkline data={spark} color={sparkColor} />
42
- <div class="latency">▸ open</div>
59
+ <div class="latency"><span aria-hidden="true">▸</span> open</div>
43
60
  </div>
44
61
  </div>
62
+
63
+ <style>.ss-svc {
64
+ display: grid;
65
+ grid-template-columns: 1fr auto;
66
+ gap: var(--ss-gap);
67
+ padding: var(--ss-card-py) var(--ss-card-px);
68
+ border: 1px solid var(--ss-line);
69
+ background: var(--ss-bg-elev);
70
+ cursor: pointer;
71
+ transition: all var(--ss-dur-fast) var(--ss-ease);
72
+ }
73
+ .ss-svc:hover {
74
+ border-color: var(--ss-line-strong);
75
+ background: #232323;
76
+ }
77
+ .ss-svc .head {
78
+ display: flex;
79
+ align-items: center;
80
+ gap: 10px;
81
+ }
82
+ .ss-svc .head .name {
83
+ font-family: var(--ss-font-display);
84
+ font-size: var(--ss-ui-lg);
85
+ letter-spacing: -0.005em;
86
+ }
87
+ .ss-svc .head .host {
88
+ font-family: var(--ss-font-mono);
89
+ font-size: var(--ss-ui-sm);
90
+ color: var(--ss-fg-muted);
91
+ }
92
+ .ss-svc .status {
93
+ display: flex;
94
+ flex-direction: column;
95
+ align-items: flex-end;
96
+ gap: 2px;
97
+ }
98
+ .ss-svc .footer {
99
+ grid-column: 1/-1;
100
+ display: flex;
101
+ align-items: center;
102
+ justify-content: space-between;
103
+ margin-top: 2px;
104
+ }
105
+ .ss-svc .latency {
106
+ font-family: var(--ss-font-mono);
107
+ font-size: var(--ss-ui-sm);
108
+ color: var(--ss-fg-muted);
109
+ }</style>
@@ -1,3 +1,4 @@
1
+ import { type Size } from '../config.js';
1
2
  interface Props {
2
3
  name: string;
3
4
  host: string;
@@ -5,6 +6,8 @@ interface Props {
5
6
  latency?: string;
6
7
  spark?: number[];
7
8
  onclick?: () => void;
9
+ /** Token size (sm|md|lg); inherits the global size when unset. */
10
+ size?: Size;
8
11
  }
9
12
  declare const ServiceCard: import("svelte").Component<Props, {}, "">;
10
13
  type ServiceCard = ReturnType<typeof ServiceCard>;
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
2
  import Icon, { type IconName } from './Icon.svelte'
3
+ import { resolveComponentSize, type Size } from '../config.js'
3
4
 
4
5
  type Status = 'up' | 'deg' | 'down'
5
6
  interface SideItem { id: string; label: string; icon: IconName; status?: Status }
@@ -9,6 +10,8 @@
9
10
  active?: string
10
11
  onSelect?: (id: string) => void
11
12
  groups?: SideGroup[]
13
+ /** Token size (sm|md|lg); inherits the global size when unset. */
14
+ size?: Size
12
15
  }
13
16
 
14
17
  const DEFAULT_GROUPS: SideGroup[] = [
@@ -24,10 +27,10 @@
24
27
  ]},
25
28
  ]
26
29
 
27
- let { active = 'hub', onSelect, groups = DEFAULT_GROUPS }: Props = $props()
30
+ let { active = 'hub', onSelect, groups = DEFAULT_GROUPS, size }: Props = $props()
28
31
  </script>
29
32
 
30
- <aside class="ss-side">
33
+ <aside class="ss-side" aria-label="Sidebar" data-size-variant={resolveComponentSize('Sidebar', size)}>
31
34
  {#each groups as g}
32
35
  <div class="section">{g.section}</div>
33
36
  {#each g.items as item}
@@ -35,15 +38,67 @@
35
38
  class="item {item.id === active ? 'active' : ''}"
36
39
  role="button"
37
40
  tabindex="0"
41
+ aria-current={item.id === active ? 'page' : undefined}
38
42
  onclick={() => onSelect?.(item.id)}
39
- onkeydown={(e) => e.key === 'Enter' && onSelect?.(item.id)}
43
+ onkeydown={(e) => {
44
+ if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onSelect?.(item.id) }
45
+ }}
40
46
  >
41
- <Icon name={item.icon} size={13} />
47
+ <Icon name={item.icon} px={13} />
42
48
  <span>{item.label}</span>
43
49
  {#if item.status}
44
- <span class="dot {item.status === 'deg' ? 'warn' : item.status === 'down' ? 'err' : ''}"></span>
50
+ <span class="dot {item.status === 'deg' ? 'warn' : item.status === 'down' ? 'err' : ''}" aria-hidden="true"></span>
45
51
  {/if}
46
52
  </div>
47
53
  {/each}
48
54
  {/each}
49
55
  </aside>
56
+
57
+ <style>.ss-side {
58
+ border-right: 1px solid var(--ss-line);
59
+ padding: var(--ss-gap) var(--ss-s-1);
60
+ display: flex;
61
+ flex-direction: column;
62
+ gap: 1px;
63
+ background: var(--ss-bg);
64
+ }
65
+ .ss-side .section {
66
+ font-family: var(--ss-font-mono);
67
+ font-size: var(--ss-ui-xs);
68
+ color: var(--ss-fg-faint);
69
+ text-transform: uppercase;
70
+ letter-spacing: 0.12em;
71
+ padding: var(--ss-row-px) var(--ss-row-px) var(--ss-s-1);
72
+ }
73
+ .ss-side .item {
74
+ display: flex;
75
+ align-items: center;
76
+ gap: 8px;
77
+ padding: var(--ss-row-py) var(--ss-row-px);
78
+ cursor: pointer;
79
+ color: var(--ss-fg-muted);
80
+ font: 500 var(--ss-ui-md) var(--ss-font-mono);
81
+ border-left: 2px solid transparent;
82
+ transition: all var(--ss-dur-fast) var(--ss-ease);
83
+ }
84
+ .ss-side .item:hover {
85
+ color: var(--ss-fg);
86
+ background: var(--ss-hover);
87
+ }
88
+ .ss-side .item.active {
89
+ color: var(--ss-fg);
90
+ background: rgba(102, 239, 115, 0.06);
91
+ border-left-color: var(--ss-primary);
92
+ }
93
+ .ss-side .item .dot {
94
+ width: 5px;
95
+ height: 5px;
96
+ margin-left: auto;
97
+ background: var(--ss-primary);
98
+ }
99
+ .ss-side .item .dot.warn {
100
+ background: var(--ss-yellow);
101
+ }
102
+ .ss-side .item .dot.err {
103
+ background: var(--ss-red);
104
+ }</style>
@@ -1,4 +1,5 @@
1
1
  import { type IconName } from './Icon.svelte';
2
+ import { type Size } from '../config.js';
2
3
  type Status = 'up' | 'deg' | 'down';
3
4
  interface SideItem {
4
5
  id: string;
@@ -14,6 +15,8 @@ interface Props {
14
15
  active?: string;
15
16
  onSelect?: (id: string) => void;
16
17
  groups?: SideGroup[];
18
+ /** Token size (sm|md|lg); inherits the global size when unset. */
19
+ size?: Size;
17
20
  }
18
21
  declare const Sidebar: import("svelte").Component<Props, {}, "">;
19
22
  type Sidebar = ReturnType<typeof Sidebar>;
@@ -1,15 +1,39 @@
1
1
  <script lang="ts">
2
+ import { resolveComponentSize, type Size } from '../config.js'
3
+
2
4
  interface Props {
3
5
  data: number[]
4
6
  color?: string
7
+ /** Token size (sm|md|lg); inherits the global size when unset. */
8
+ size?: Size
9
+ /** Accessible label; when set the sparkline is exposed to AT (role="img"), else it's decorative (aria-hidden). */
10
+ label?: string
5
11
  }
6
- let { data, color = 'var(--ss-primary)' }: Props = $props()
12
+ let { data, color = 'var(--ss-primary)', size, label }: Props = $props()
7
13
 
8
14
  const max = $derived(Math.max(...data, 1))
9
15
  </script>
10
16
 
11
- <div class="ss-spark">
17
+ <div
18
+ class="ss-spark"
19
+ data-size-variant={resolveComponentSize('Sparkline', size)}
20
+ role={label ? 'img' : undefined}
21
+ aria-label={label}
22
+ aria-hidden={label ? undefined : 'true'}
23
+ >
12
24
  {#each data as v}
13
25
  <i style="height:{Math.max(8, (v / max) * 100)}%;background:{color}"></i>
14
26
  {/each}
15
27
  </div>
28
+
29
+ <style>.ss-spark {
30
+ display: flex;
31
+ align-items: flex-end;
32
+ gap: 1px;
33
+ height: 18px;
34
+ }
35
+ .ss-spark i {
36
+ width: 3px;
37
+ background: var(--ss-primary);
38
+ opacity: 0.85;
39
+ }</style>
@@ -1,6 +1,11 @@
1
+ import { type Size } from '../config.js';
1
2
  interface Props {
2
3
  data: number[];
3
4
  color?: string;
5
+ /** Token size (sm|md|lg); inherits the global size when unset. */
6
+ size?: Size;
7
+ /** Accessible label; when set the sparkline is exposed to AT (role="img"), else it's decorative (aria-hidden). */
8
+ label?: string;
4
9
  }
5
10
  declare const Sparkline: import("svelte").Component<Props, {}, "">;
6
11
  type Sparkline = ReturnType<typeof Sparkline>;
@@ -1,72 +1,104 @@
1
1
  <script lang="ts">
2
2
  import { fly } from 'svelte/transition'
3
+ import { prefersReducedMotion } from 'svelte/motion'
3
4
  import { toasts, type ToastKind } from '../toast.svelte.js'
5
+ import { resolveComponentSize, type Size } from '../config.js'
6
+
7
+ interface Props {
8
+ /** Token size (sm|md|lg); inherits the global size when unset. */
9
+ size?: Size
10
+ }
11
+
12
+ let { size }: Props = $props()
4
13
 
5
14
  const glyph: Record<ToastKind, string> = { success: '✓', error: '✕', info: 'i' }
15
+ // Honor prefers-reduced-motion: collapse the fly transition to an instant swap.
16
+ const flyDuration = $derived(prefersReducedMotion.current ? 0 : 180)
6
17
  </script>
7
18
 
8
- <div class="ss-toaster" role="region" aria-live="polite" aria-label="Notifications">
19
+ <div class="ss-toaster" aria-label="Notifications" data-size-variant={resolveComponentSize('Toaster', size)}>
9
20
  {#each toasts.items as t (t.id)}
10
- <output class="ss-toast {t.kind}" transition:fly={{ x: 16, duration: 180 }}>
11
- <span class="ic">{glyph[t.kind]}</span>
21
+ <div
22
+ class="ss-toast {t.kind}"
23
+ role={t.kind === 'error' ? 'alert' : 'status'}
24
+ aria-live={t.kind === 'error' ? 'assertive' : 'polite'}
25
+ transition:fly={{ x: 16, duration: flyDuration }}
26
+ >
27
+ <span class="ic" aria-hidden="true">{glyph[t.kind]}</span>
12
28
  <span class="msg">{t.message}</span>
13
29
  <button class="x" type="button" aria-label="Dismiss" onclick={() => toasts.dismiss(t.id)}>×</button>
14
- </output>
30
+ </div>
15
31
  {/each}
16
32
  </div>
17
33
 
18
- <style>
19
- .ss-toaster {
20
- position: fixed;
21
- top: var(--ss-s-4);
22
- right: var(--ss-s-4);
23
- z-index: 1000;
24
- display: flex;
25
- flex-direction: column;
26
- gap: var(--ss-s-2);
27
- max-width: min(360px, calc(100vw - var(--ss-s-8)));
28
- pointer-events: none;
29
- }
30
- .ss-toast {
31
- pointer-events: auto;
32
- display: flex;
33
- align-items: center;
34
- gap: var(--ss-s-3);
35
- padding: var(--ss-s-3) var(--ss-s-4);
36
- background: var(--ss-bg-elev);
37
- border: 1px solid var(--ss-line);
38
- border-left: 3px solid var(--ss-fg-faint);
39
- box-shadow: var(--ss-shadow-pop);
40
- font-family: var(--ss-font-mono);
41
- font-size: var(--ss-ui-md);
42
- color: var(--ss-fg);
43
- }
44
- .ss-toast.success { border-left-color: var(--ss-primary); }
45
- .ss-toast.error { border-left-color: var(--ss-red); }
46
- .ss-toast.info { border-left-color: var(--ss-cyan); }
47
- .ic {
48
- display: inline-flex;
49
- align-items: center;
50
- justify-content: center;
51
- width: 18px;
52
- height: 18px;
53
- font-size: var(--ss-ui-sm);
54
- color: var(--ss-fg-on-primary);
55
- flex: none;
56
- }
57
- .success .ic { background: var(--ss-primary); }
58
- .error .ic { background: var(--ss-red); }
59
- .info .ic { background: var(--ss-cyan); }
60
- .msg { flex: 1; line-height: 1.3; }
61
- .x {
62
- flex: none;
63
- background: none;
64
- border: none;
65
- color: var(--ss-fg-faint);
66
- cursor: pointer;
67
- font-size: var(--ss-size-h3);
68
- line-height: 1;
69
- padding: 0;
70
- }
71
- .x:hover { color: var(--ss-fg); }
72
- </style>
34
+ <style>.ss-toaster {
35
+ position: fixed;
36
+ top: var(--ss-s-4);
37
+ right: var(--ss-s-4);
38
+ z-index: 1000;
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: var(--ss-s-2);
42
+ max-width: min(360px, 100vw - var(--ss-s-8));
43
+ pointer-events: none;
44
+ }
45
+
46
+ .ss-toast {
47
+ pointer-events: auto;
48
+ display: flex;
49
+ align-items: center;
50
+ gap: var(--ss-s-3);
51
+ padding: var(--ss-s-3) var(--ss-s-4);
52
+ background: var(--ss-bg-elev);
53
+ border: 1px solid var(--ss-line);
54
+ border-left: 3px solid var(--ss-fg-faint);
55
+ box-shadow: var(--ss-shadow-pop);
56
+ font-family: var(--ss-font-mono);
57
+ font-size: var(--ss-ui-md);
58
+ color: var(--ss-fg);
59
+ }
60
+ .ss-toast.success {
61
+ border-left-color: var(--ss-primary);
62
+ }
63
+ .ss-toast.error {
64
+ border-left-color: var(--ss-red);
65
+ }
66
+ .ss-toast.info {
67
+ border-left-color: var(--ss-cyan);
68
+ }
69
+ .ss-toast .ic {
70
+ display: inline-flex;
71
+ align-items: center;
72
+ justify-content: center;
73
+ width: 18px;
74
+ height: 18px;
75
+ font-size: var(--ss-ui-sm);
76
+ color: var(--ss-fg-on-primary);
77
+ flex: none;
78
+ }
79
+ .ss-toast.success .ic {
80
+ background: var(--ss-primary);
81
+ }
82
+ .ss-toast.error .ic {
83
+ background: var(--ss-red);
84
+ }
85
+ .ss-toast.info .ic {
86
+ background: var(--ss-cyan);
87
+ }
88
+ .ss-toast .msg {
89
+ flex: 1;
90
+ line-height: 1.3;
91
+ }
92
+ .ss-toast .x {
93
+ flex: none;
94
+ background: none;
95
+ border: none;
96
+ color: var(--ss-fg-faint);
97
+ cursor: pointer;
98
+ font-size: var(--ss-size-h3);
99
+ line-height: 1;
100
+ padding: 0;
101
+ }
102
+ .ss-toast .x:hover {
103
+ color: var(--ss-fg);
104
+ }</style>
@@ -1,18 +1,8 @@
1
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
- $$bindings?: Bindings;
4
- } & Exports;
5
- (internal: unknown, props: {
6
- $$events?: Events;
7
- $$slots?: Slots;
8
- }): Exports & {
9
- $set?: any;
10
- $on?: any;
11
- };
12
- z_$$bindings?: Bindings;
1
+ import { type Size } from '../config.js';
2
+ interface Props {
3
+ /** Token size (sm|md|lg); inherits the global size when unset. */
4
+ size?: Size;
13
5
  }
14
- declare const Toaster: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
- [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
17
- type Toaster = InstanceType<typeof Toaster>;
6
+ declare const Toaster: import("svelte").Component<Props, {}, "">;
7
+ type Toaster = ReturnType<typeof Toaster>;
18
8
  export default Toaster;