dssoca 0.8.2 → 0.9.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 (43) hide show
  1. package/README.md +39 -13
  2. package/dist/components/Accordion.svelte +22 -6
  3. package/dist/components/Accordion.svelte.d.ts +5 -1
  4. package/dist/components/Badge.svelte +3 -5
  5. package/dist/components/BottomNav.svelte +57 -19
  6. package/dist/components/BottomNav.svelte.d.ts +2 -0
  7. package/dist/components/Card.svelte +7 -1
  8. package/dist/components/Container.svelte +55 -0
  9. package/dist/components/Container.svelte.d.ts +16 -0
  10. package/dist/components/EmptyState.svelte +9 -3
  11. package/dist/components/EmptyState.svelte.d.ts +6 -0
  12. package/dist/components/Heading.svelte +83 -0
  13. package/dist/components/Heading.svelte.d.ts +17 -0
  14. package/dist/components/Icon.svelte +32 -23
  15. package/dist/components/Icon.svelte.d.ts +7 -0
  16. package/dist/components/Image.svelte +19 -21
  17. package/dist/components/Input.svelte +2 -3
  18. package/dist/components/Link.svelte +42 -7
  19. package/dist/components/Link.svelte.d.ts +7 -0
  20. package/dist/components/LogStream.svelte +46 -31
  21. package/dist/components/Menu.svelte +59 -6
  22. package/dist/components/Menu.svelte.d.ts +22 -2
  23. package/dist/components/MetricTile.svelte +4 -4
  24. package/dist/components/SegmentedControl.svelte +16 -4
  25. package/dist/components/SegmentedControl.svelte.d.ts +7 -0
  26. package/dist/components/ServiceCard.svelte +15 -15
  27. package/dist/components/Sidebar.svelte +47 -21
  28. package/dist/components/Sparkline.svelte +15 -13
  29. package/dist/components/Spinner.svelte +124 -0
  30. package/dist/components/Spinner.svelte.d.ts +74 -0
  31. package/dist/components/Textarea.svelte +214 -0
  32. package/dist/components/Textarea.svelte.d.ts +38 -0
  33. package/dist/components/Toaster.svelte +20 -4
  34. package/dist/components/Topbar.svelte +170 -50
  35. package/dist/components/Topbar.svelte.d.ts +30 -3
  36. package/dist/dssoca.config.d.ts +1 -1
  37. package/dist/dssoca.config.js +4 -0
  38. package/dist/index.d.ts +7 -1
  39. package/dist/index.js +7 -1
  40. package/dist/theme.css +177 -37
  41. package/dist/toast.svelte.js +3 -3
  42. package/dist/tokens.css +597 -0
  43. package/package.json +25 -4
@@ -31,6 +31,13 @@
31
31
  onChange?: (value: string) => void
32
32
  /** Stretch segments to equal widths and fill the container. */
33
33
  fullWidth?: boolean
34
+ /**
35
+ * Disable the whole control (DS-0078): every segment is rendered inert
36
+ * (`disabled` + skipped by keyboard nav) and the group carries
37
+ * `aria-disabled="true"`. Per-option `disabled` still works for
38
+ * disabling individual segments.
39
+ */
40
+ disabled?: boolean
34
41
  /** Token size (sm|md|lg); inherits the global size when unset. */
35
42
  size?: Size
36
43
  /**
@@ -45,29 +52,33 @@
45
52
  value = $bindable(),
46
53
  onChange,
47
54
  fullWidth = false,
55
+ disabled = false,
48
56
  size,
49
57
  label,
50
58
  }: Props = $props()
51
59
 
60
+ // Component-wide `disabled` wins over (and combines with) per-option flags.
61
+ const isOptionDisabled = (o: SegmentOption) => disabled || Boolean(o.disabled)
62
+
52
63
  // Bound references to each segment, indexed by option position, so keyboard
53
64
  // navigation can move focus across the roving-tabindex group.
54
65
  let segments = $state<(HTMLButtonElement | undefined)[]>([])
55
66
 
56
67
  const enabledIndexes = $derived(
57
- options.map((o, i) => (o.disabled ? -1 : i)).filter((i) => i >= 0),
68
+ options.map((o, i) => (isOptionDisabled(o) ? -1 : i)).filter((i) => i >= 0),
58
69
  )
59
70
 
60
71
  /** Index that owns the single tab stop (roving tabindex). The selected option
61
72
  * when it's enabled; otherwise the first enabled option; -1 when none. */
62
73
  const tabbableIndex = $derived.by(() => {
63
- const sel = options.findIndex((o) => o.value === value && !o.disabled)
74
+ const sel = options.findIndex((o) => o.value === value && !isOptionDisabled(o))
64
75
  if (sel >= 0) return sel
65
76
  return enabledIndexes[0] ?? -1
66
77
  })
67
78
 
68
79
  function select(index: number) {
69
80
  const opt = options[index]
70
- if (!opt || opt.disabled) return
81
+ if (!opt || isOptionDisabled(opt)) return
71
82
  if (opt.value !== value) {
72
83
  value = opt.value
73
84
  onChange?.(opt.value)
@@ -123,6 +134,7 @@
123
134
  class:full={fullWidth}
124
135
  role="radiogroup"
125
136
  aria-label={label}
137
+ aria-disabled={disabled ? 'true' : undefined}
126
138
  data-size-variant={sizeAttr}
127
139
  >
128
140
  {#each options as opt, i (opt.value)}
@@ -135,7 +147,7 @@
135
147
  role="radio"
136
148
  aria-checked={selected}
137
149
  tabindex={i === tabbableIndex ? 0 : -1}
138
- disabled={opt.disabled}
150
+ disabled={isOptionDisabled(opt)}
139
151
  onclick={() => select(i)}
140
152
  onkeydown={(e) => onKeydown(e, i)}
141
153
  >
@@ -17,6 +17,13 @@ interface Props {
17
17
  onChange?: (value: string) => void;
18
18
  /** Stretch segments to equal widths and fill the container. */
19
19
  fullWidth?: boolean;
20
+ /**
21
+ * Disable the whole control (DS-0078): every segment is rendered inert
22
+ * (`disabled` + skipped by keyboard nav) and the group carries
23
+ * `aria-disabled="true"`. Per-option `disabled` still works for
24
+ * disabling individual segments.
25
+ */
26
+ disabled?: boolean;
20
27
  /** Token size (sm|md|lg); inherits the global size when unset. */
21
28
  size?: Size;
22
29
  /**
@@ -42,17 +42,18 @@
42
42
  }: Props = $props()
43
43
 
44
44
  const sparkColor = $derived(
45
- status === 'deg' ? 'var(--ss-yellow)'
46
- : status === 'down' ? 'var(--ss-red)'
47
- : status === 'maint' ? 'var(--ss-blue)'
48
- : 'var(--ss-primary)'
45
+ status === 'deg'
46
+ ? 'var(--ss-yellow)'
47
+ : status === 'down'
48
+ ? 'var(--ss-red)'
49
+ : status === 'maint'
50
+ ? 'var(--ss-blue)'
51
+ : 'var(--ss-primary)',
49
52
  )
50
53
 
51
54
  // Spell the status out for assistive tech (the abbreviations are opaque).
52
55
  const statusLabel = $derived(
53
- status === 'deg' ? 'degraded'
54
- : status === 'maint' ? 'maintenance'
55
- : status
56
+ status === 'deg' ? 'degraded' : status === 'maint' ? 'maintenance' : status,
56
57
  )
57
58
 
58
59
  // Status is decorative on the dot/badge, but meaningful — fold it into the label.
@@ -65,13 +66,9 @@
65
66
 
66
67
  // --- relative "last checked" timestamp -------------------------------------
67
68
  const updatedDate = $derived(
68
- updatedAt == null ? undefined
69
- : updatedAt instanceof Date ? updatedAt
70
- : new Date(updatedAt)
71
- )
72
- const updatedValid = $derived(
73
- !!updatedDate && !Number.isNaN(updatedDate.getTime())
69
+ updatedAt == null ? undefined : updatedAt instanceof Date ? updatedAt : new Date(updatedAt),
74
70
  )
71
+ const updatedValid = $derived(!!updatedDate && !Number.isNaN(updatedDate.getTime()))
75
72
  const updatedISO = $derived(updatedValid ? updatedDate!.toISOString() : undefined)
76
73
 
77
74
  function relativeTime(d: Date): string {
@@ -146,7 +143,10 @@
146
143
  data-size-variant={resolveComponentSize('ServiceCard', size)}
147
144
  {onclick}
148
145
  onkeydown={(e) => {
149
- if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onclick?.() }
146
+ if (e.key === 'Enter' || e.key === ' ') {
147
+ e.preventDefault()
148
+ onclick?.()
149
+ }
150
150
  }}
151
151
  >
152
152
  {@render body()}
@@ -180,7 +180,7 @@
180
180
  .ss-svc .head {
181
181
  display: flex;
182
182
  align-items: center;
183
- gap: 10px;
183
+ gap: var(--ss-gap-sm);
184
184
  }
185
185
  .ss-svc .head .name {
186
186
  font-family: var(--ss-font-display);
@@ -15,7 +15,10 @@
15
15
  /** One level of nested sub-items, rendered with the Disclosure pattern. */
16
16
  children?: SideItem[]
17
17
  }
18
- export interface SideGroup { section: string; items: SideItem[] }
18
+ export interface SideGroup {
19
+ section: string
20
+ items: SideItem[]
21
+ }
19
22
  </script>
20
23
 
21
24
  <script lang="ts">
@@ -35,16 +38,22 @@
35
38
  }
36
39
 
37
40
  const DEFAULT_GROUPS: SideGroup[] = [
38
- { section: 'platform', items: [
39
- { id: 'hub', label: 'Hub', icon: 'grid', status: 'up' },
40
- { id: 'auth', label: 'Auth', icon: 'user', status: 'up' },
41
- { id: 'caddy', label: 'Caddy', icon: 'settings', status: 'up' },
42
- ]},
43
- { section: 'services', items: [
44
- { id: 'movies', label: 'Movies', icon: 'film', status: 'up' },
45
- { id: 'notes', label: 'Notes', icon: 'note', status: 'up' },
46
- { id: 'tasks', label: 'Tasks', icon: 'check', status: 'up' },
47
- ]},
41
+ {
42
+ section: 'platform',
43
+ items: [
44
+ { id: 'hub', label: 'Hub', icon: 'grid', status: 'up' },
45
+ { id: 'auth', label: 'Auth', icon: 'user', status: 'up' },
46
+ { id: 'caddy', label: 'Caddy', icon: 'settings', status: 'up' },
47
+ ],
48
+ },
49
+ {
50
+ section: 'services',
51
+ items: [
52
+ { id: 'movies', label: 'Movies', icon: 'film', status: 'up' },
53
+ { id: 'notes', label: 'Notes', icon: 'note', status: 'up' },
54
+ { id: 'tasks', label: 'Tasks', icon: 'check', status: 'up' },
55
+ ],
56
+ },
48
57
  ]
49
58
 
50
59
  let {
@@ -85,8 +94,7 @@
85
94
  // Per-disclosure open state. Auto-expanded when a descendant is active;
86
95
  // user toggles override afterwards.
87
96
  let openState = $state<Record<string, boolean>>({})
88
- const isOpen = (item: SideItem): boolean =>
89
- openState[item.id] ?? hasActiveDescendant(item)
97
+ const isOpen = (item: SideItem): boolean => openState[item.id] ?? hasActiveDescendant(item)
90
98
 
91
99
  function toggleOpen(item: SideItem) {
92
100
  openState[item.id] = !isOpen(item)
@@ -173,7 +181,11 @@
173
181
  {/if}
174
182
  {#if child.status}
175
183
  <span
176
- class="dot {child.status === 'deg' ? 'warn' : child.status === 'down' ? 'err' : ''}"
184
+ class="dot {child.status === 'deg'
185
+ ? 'warn'
186
+ : child.status === 'down'
187
+ ? 'err'
188
+ : ''}"
177
189
  aria-hidden="true"
178
190
  ></span>
179
191
  {/if}
@@ -188,7 +200,10 @@
188
200
  title={collapsed ? accessibleName(child) : undefined}
189
201
  onclick={() => onSelect?.(child.id)}
190
202
  onkeydown={(e) => {
191
- if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onSelect?.(child.id) }
203
+ if (e.key === 'Enter' || e.key === ' ') {
204
+ e.preventDefault()
205
+ onSelect?.(child.id)
206
+ }
192
207
  }}
193
208
  >
194
209
  {#if child.icon}<Icon name={child.icon} px={13} />{/if}
@@ -198,7 +213,11 @@
198
213
  {/if}
199
214
  {#if child.status}
200
215
  <span
201
- class="dot {child.status === 'deg' ? 'warn' : child.status === 'down' ? 'err' : ''}"
216
+ class="dot {child.status === 'deg'
217
+ ? 'warn'
218
+ : child.status === 'down'
219
+ ? 'err'
220
+ : ''}"
202
221
  aria-hidden="true"
203
222
  ></span>
204
223
  {/if}
@@ -238,7 +257,10 @@
238
257
  title={collapsed ? accessibleName(item) : undefined}
239
258
  onclick={() => onSelect?.(item.id)}
240
259
  onkeydown={(e) => {
241
- if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onSelect?.(item.id) }
260
+ if (e.key === 'Enter' || e.key === ' ') {
261
+ e.preventDefault()
262
+ onSelect?.(item.id)
263
+ }
242
264
  }}
243
265
  >
244
266
  {#if item.icon}<Icon name={item.icon} px={13} />{/if}
@@ -280,7 +302,9 @@
280
302
  padding: 0;
281
303
  overflow: hidden;
282
304
  }
283
- .ss-side[data-collapsed] .label, .ss-side[data-collapsed] .badge, .ss-side[data-collapsed] .caret {
305
+ .ss-side[data-collapsed] .label,
306
+ .ss-side[data-collapsed] .badge,
307
+ .ss-side[data-collapsed] .caret {
284
308
  display: none;
285
309
  }
286
310
  .ss-side[data-collapsed] .item {
@@ -293,7 +317,8 @@
293
317
  .ss-side[data-collapsed] .sublist {
294
318
  padding-left: 0;
295
319
  }
296
- .ss-side .list, .ss-side .sublist {
320
+ .ss-side .list,
321
+ .ss-side .sublist {
297
322
  list-style: none;
298
323
  margin: 0;
299
324
  padding: 0;
@@ -333,7 +358,7 @@
333
358
  .ss-side .item {
334
359
  display: flex;
335
360
  align-items: center;
336
- gap: 8px;
361
+ gap: var(--ss-s-2);
337
362
  width: 100%;
338
363
  padding: var(--ss-row-py) var(--ss-row-px);
339
364
  cursor: pointer;
@@ -403,7 +428,8 @@
403
428
  .ss-side .item .caret.open {
404
429
  transform: rotate(90deg);
405
430
  }
406
- .ss-side .item .badge + .caret, .ss-side .item .dot + .caret {
431
+ .ss-side .item .badge + .caret,
432
+ .ss-side .item .dot + .caret {
407
433
  margin-left: var(--ss-s-1);
408
434
  }
409
435
  .ss-side .item.child {
@@ -41,7 +41,7 @@
41
41
  fluid = false,
42
42
  width,
43
43
  valueFormat,
44
- summary
44
+ summary,
45
45
  }: Props = $props()
46
46
 
47
47
  const fmt = $derived(valueFormat ?? ((v: number) => String(v)))
@@ -71,10 +71,14 @@
71
71
  // Colour: a resolved direction overrides the `color` prop.
72
72
  const fill = $derived.by(() => {
73
73
  switch (direction) {
74
- case 'up': return 'var(--ss-success)'
75
- case 'down': return 'var(--ss-danger)'
76
- case 'flat': return 'var(--ss-fg-muted)'
77
- default: return color
74
+ case 'up':
75
+ return 'var(--ss-success)'
76
+ case 'down':
77
+ return 'var(--ss-danger)'
78
+ case 'flat':
79
+ return 'var(--ss-fg-muted)'
80
+ default:
81
+ return color
78
82
  }
79
83
  })
80
84
 
@@ -103,25 +107,23 @@
103
107
  }
104
108
  return data.map((v, i) => ({
105
109
  x: (i / (data.length - 1)) * VB_W,
106
- y: VB_H - norm(v) * VB_H
110
+ y: VB_H - norm(v) * VB_H,
107
111
  }))
108
112
  })
109
113
  const polyline = $derived(points.map((p) => `${p.x},${p.y}`).join(' '))
110
114
  const areaPath = $derived(
111
115
  points.length
112
116
  ? `M${points[0].x},${VB_H} L` +
113
- points.map((p) => `${p.x},${p.y}`).join(' ') +
114
- ` L${points[points.length - 1].x},${VB_H} Z`
115
- : ''
117
+ points.map((p) => `${p.x},${p.y}`).join(' ') +
118
+ ` L${points[points.length - 1].x},${VB_H} Z`
119
+ : '',
116
120
  )
117
121
 
118
122
  const isEmpty = $derived(data.length === 0)
119
123
  const isSingle = $derived(data.length === 1)
120
124
 
121
125
  const rootStyle = $derived(
122
- [width ? `width:${width}` : '', fluid && !width ? 'width:100%' : '']
123
- .filter(Boolean)
124
- .join(';')
126
+ [width ? `width:${width}` : '', fluid && !width ? 'width:100%' : ''].filter(Boolean).join(';'),
125
127
  )
126
128
  </script>
127
129
 
@@ -172,7 +174,7 @@
172
174
  display: inline-flex;
173
175
  align-items: flex-end;
174
176
  gap: var(--ss-spark-gap, 1px);
175
- height: var(--ss-spark-h, 18px);
177
+ height: var(--ss-spark-h, var(--ss-icon, 18px));
176
178
  position: relative;
177
179
  }
178
180
  .ss-spark.fluid {
@@ -0,0 +1,124 @@
1
+ <script module lang="ts">
2
+ /**
3
+ * Text-frame spinner variants. Frames + intervals are embedded verbatim from
4
+ * sindresorhus/cli-spinners (MIT — https://github.com/sindresorhus/cli-spinners),
5
+ * curated for the squared/blocky glyphs that fit the DS's zero-radius look.
6
+ * No runtime fetch, no dependency — just data.
7
+ */
8
+ export interface SpinnerFrames {
9
+ /** Milliseconds between frames (cli-spinners' recommended cadence). */
10
+ interval: number
11
+ /** The glyph sequence, cycled in order. */
12
+ frames: readonly string[]
13
+ }
14
+
15
+ export const SPINNER_VARIANTS = {
16
+ boxBounce2: { interval: 100, frames: ['▌', '▀', '▐', '▄'] },
17
+ boxBounce: { interval: 120, frames: ['▖', '▘', '▝', '▗'] },
18
+ squareCorners: { interval: 180, frames: ['◰', '◳', '◲', '◱'] },
19
+ toggle2: { interval: 80, frames: ['▫', '▪'] },
20
+ toggle3: { interval: 120, frames: ['□', '■'] },
21
+ toggle4: { interval: 100, frames: ['■', '□', '▪', '▫'] },
22
+ pipe: { interval: 100, frames: ['┤', '┘', '┴', '└', '├', '┌', '┬', '┐'] },
23
+ line: { interval: 130, frames: ['-', '\\', '|', '/'] },
24
+ growVertical: { interval: 120, frames: ['▁', '▃', '▄', '▅', '▆', '▇', '▆', '▅', '▄', '▃'] },
25
+ growHorizontal: {
26
+ interval: 120,
27
+ frames: ['▏', '▎', '▍', '▌', '▋', '▊', '▉', '▊', '▋', '▌', '▍', '▎'],
28
+ },
29
+ } as const satisfies Record<string, SpinnerFrames>
30
+
31
+ export type SpinnerVariant = keyof typeof SPINNER_VARIANTS
32
+
33
+ export const SPINNER_VARIANT_NAMES = Object.keys(SPINNER_VARIANTS) as SpinnerVariant[]
34
+ </script>
35
+
36
+ <script lang="ts">
37
+ import { resolveComponentSize, type Size } from '../config.js'
38
+
39
+ interface Props {
40
+ /** Which frame set to animate (curated from cli-spinners, MIT). */
41
+ variant?: SpinnerVariant
42
+ /** Token size (sm|md|lg); inherits the global size when unset. */
43
+ size?: Size
44
+ /** Accessible name announced via role="status". */
45
+ label?: string
46
+ /** Render the label visibly next to the glyph (it is announced either way). */
47
+ showLabel?: boolean
48
+ /** Override the variant's frame interval (ms). */
49
+ speed?: number
50
+ /** Any remaining native attributes are forwarded to the root span. */
51
+ [key: string]: unknown
52
+ }
53
+ let {
54
+ variant = 'boxBounce2',
55
+ size,
56
+ label = 'Loading',
57
+ showLabel = false,
58
+ speed,
59
+ ...rest
60
+ }: Props = $props()
61
+
62
+ const spinner = $derived(SPINNER_VARIANTS[variant])
63
+ const interval = $derived(speed ?? spinner.interval)
64
+ // 'Spinner' is not in the ComponentName union yet (manifest is owned by the
65
+ // integration step) — cast until dssoca.config.ts registers it.
66
+ const resolvedSize = $derived(resolveComponentSize('Spinner', size))
67
+
68
+ // Under prefers-reduced-motion the first frame renders statically — no cycling.
69
+ const reduceMotion =
70
+ typeof window !== 'undefined' &&
71
+ typeof window.matchMedia === 'function' &&
72
+ window.matchMedia('(prefers-reduced-motion: reduce)').matches
73
+
74
+ let tickIndex = $state(0)
75
+ // Modulo on read so a variant swap to a shorter frame set never reads past the end.
76
+ const frame = $derived(spinner.frames[tickIndex % spinner.frames.length])
77
+
78
+ $effect(() => {
79
+ if (reduceMotion) return
80
+ const count = spinner.frames.length
81
+ const ms = interval
82
+ const id = setInterval(() => {
83
+ tickIndex = (tickIndex + 1) % count
84
+ }, ms)
85
+ return () => clearInterval(id)
86
+ })
87
+ </script>
88
+
89
+ <span class="ss-spinner" data-size-variant={resolvedSize} role="status" {...rest}>
90
+ <span class="frame" aria-hidden="true">{frame}</span>
91
+ <span class="lbl" class:sr-only={!showLabel}>{label}</span>
92
+ </span>
93
+
94
+ <style>.ss-spinner {
95
+ display: inline-flex;
96
+ align-items: center;
97
+ gap: var(--ss-gap-sm);
98
+ color: var(--ss-spinner-color, var(--ss-primary));
99
+ }
100
+ .ss-spinner .frame {
101
+ font-family: var(--ss-font-mono);
102
+ font-size: var(--ss-spinner-font, var(--ss-control-font));
103
+ line-height: 1;
104
+ min-width: 1ch;
105
+ text-align: center;
106
+ color: currentColor;
107
+ }
108
+ .ss-spinner .lbl {
109
+ font-family: var(--ss-font-mono);
110
+ font-size: var(--ss-ui-sm);
111
+ color: var(--ss-fg-muted);
112
+ letter-spacing: 0.02em;
113
+ }
114
+ .ss-spinner .sr-only {
115
+ position: absolute;
116
+ width: 1px;
117
+ height: 1px;
118
+ padding: 0;
119
+ margin: -1px;
120
+ overflow: hidden;
121
+ clip: rect(0, 0, 0, 0);
122
+ white-space: nowrap;
123
+ border: 0;
124
+ }</style>
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Text-frame spinner variants. Frames + intervals are embedded verbatim from
3
+ * sindresorhus/cli-spinners (MIT — https://github.com/sindresorhus/cli-spinners),
4
+ * curated for the squared/blocky glyphs that fit the DS's zero-radius look.
5
+ * No runtime fetch, no dependency — just data.
6
+ */
7
+ export interface SpinnerFrames {
8
+ /** Milliseconds between frames (cli-spinners' recommended cadence). */
9
+ interval: number;
10
+ /** The glyph sequence, cycled in order. */
11
+ frames: readonly string[];
12
+ }
13
+ export declare const SPINNER_VARIANTS: {
14
+ readonly boxBounce2: {
15
+ readonly interval: 100;
16
+ readonly frames: readonly ["▌", "▀", "▐", "▄"];
17
+ };
18
+ readonly boxBounce: {
19
+ readonly interval: 120;
20
+ readonly frames: readonly ["▖", "▘", "▝", "▗"];
21
+ };
22
+ readonly squareCorners: {
23
+ readonly interval: 180;
24
+ readonly frames: readonly ["◰", "◳", "◲", "◱"];
25
+ };
26
+ readonly toggle2: {
27
+ readonly interval: 80;
28
+ readonly frames: readonly ["▫", "▪"];
29
+ };
30
+ readonly toggle3: {
31
+ readonly interval: 120;
32
+ readonly frames: readonly ["□", "■"];
33
+ };
34
+ readonly toggle4: {
35
+ readonly interval: 100;
36
+ readonly frames: readonly ["■", "□", "▪", "▫"];
37
+ };
38
+ readonly pipe: {
39
+ readonly interval: 100;
40
+ readonly frames: readonly ["┤", "┘", "┴", "└", "├", "┌", "┬", "┐"];
41
+ };
42
+ readonly line: {
43
+ readonly interval: 130;
44
+ readonly frames: readonly ["-", "\\", "|", "/"];
45
+ };
46
+ readonly growVertical: {
47
+ readonly interval: 120;
48
+ readonly frames: readonly ["▁", "▃", "▄", "▅", "▆", "▇", "▆", "▅", "▄", "▃"];
49
+ };
50
+ readonly growHorizontal: {
51
+ readonly interval: 120;
52
+ readonly frames: readonly ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "▊", "▋", "▌", "▍", "▎"];
53
+ };
54
+ };
55
+ export type SpinnerVariant = keyof typeof SPINNER_VARIANTS;
56
+ export declare const SPINNER_VARIANT_NAMES: SpinnerVariant[];
57
+ import { type Size } from '../config.js';
58
+ interface Props {
59
+ /** Which frame set to animate (curated from cli-spinners, MIT). */
60
+ variant?: SpinnerVariant;
61
+ /** Token size (sm|md|lg); inherits the global size when unset. */
62
+ size?: Size;
63
+ /** Accessible name announced via role="status". */
64
+ label?: string;
65
+ /** Render the label visibly next to the glyph (it is announced either way). */
66
+ showLabel?: boolean;
67
+ /** Override the variant's frame interval (ms). */
68
+ speed?: number;
69
+ /** Any remaining native attributes are forwarded to the root span. */
70
+ [key: string]: unknown;
71
+ }
72
+ declare const Spinner: import("svelte").Component<Props, {}, "">;
73
+ type Spinner = ReturnType<typeof Spinner>;
74
+ export default Spinner;