dssoca 0.10.0 → 0.12.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/dist/components/Accordion.svelte +35 -15
  2. package/dist/components/Accordion.svelte.d.ts +7 -0
  3. package/dist/components/Avatar.svelte +5 -9
  4. package/dist/components/Badge.svelte +27 -53
  5. package/dist/components/Badge.svelte.d.ts +2 -5
  6. package/dist/components/BottomNav.svelte +2 -2
  7. package/dist/components/BoxPlot.svelte +421 -0
  8. package/dist/components/BoxPlot.svelte.d.ts +36 -0
  9. package/dist/components/BumpChart.svelte +345 -0
  10. package/dist/components/BumpChart.svelte.d.ts +32 -0
  11. package/dist/components/Button.svelte +50 -34
  12. package/dist/components/Button.svelte.d.ts +8 -2
  13. package/dist/components/Chart.svelte +2 -8
  14. package/dist/components/DateField.svelte +1 -1
  15. package/dist/components/FileDrop.svelte +1 -1
  16. package/dist/components/Heatmap.svelte +333 -0
  17. package/dist/components/Heatmap.svelte.d.ts +30 -0
  18. package/dist/components/Icon.svelte +29 -7
  19. package/dist/components/Icon.svelte.d.ts +14 -2
  20. package/dist/components/Input.svelte +1 -1
  21. package/dist/components/LogStream.svelte +3 -3
  22. package/dist/components/Menu.svelte +1 -1
  23. package/dist/components/NumberField.svelte +1 -1
  24. package/dist/components/ScatterPlot.svelte +395 -0
  25. package/dist/components/ScatterPlot.svelte.d.ts +55 -0
  26. package/dist/components/Select.svelte +1 -1
  27. package/dist/components/ServiceCard.svelte +13 -2
  28. package/dist/components/Sidebar.svelte +1 -1
  29. package/dist/components/Spinner.svelte +26 -19
  30. package/dist/components/Spinner.svelte.d.ts +14 -4
  31. package/dist/components/Textarea.svelte +1 -1
  32. package/dist/components/Topbar.svelte +2 -2
  33. package/dist/config.d.ts +44 -3
  34. package/dist/config.js +52 -3
  35. package/dist/dssoca.config.d.ts +38 -1
  36. package/dist/dssoca.config.js +47 -0
  37. package/dist/index.d.ts +10 -5
  38. package/dist/index.js +11 -4
  39. package/dist/palette.d.ts +10 -0
  40. package/dist/palette.js +17 -0
  41. package/dist/theme.css +158 -158
  42. package/dist/tokens.css +158 -158
  43. package/package.json +3 -2
@@ -18,6 +18,7 @@
18
18
  <script lang="ts">
19
19
  import { untrack, type Snippet } from 'svelte'
20
20
  import { resolveComponentSize, type Size } from '../config.js'
21
+ import Icon from './Icon.svelte'
21
22
 
22
23
  interface Props {
23
24
  /** The collapsible sections, top to bottom. */
@@ -43,6 +44,13 @@
43
44
  onChange?: (value: AccordionValue) => void
44
45
  /** Token size (sm|md|lg); inherits the global size when unset. */
45
46
  size?: Size
47
+ /**
48
+ * How a long header label behaves when it exceeds the available width.
49
+ * `wrap` (default) lets the label flow onto multiple lines; `truncate`
50
+ * keeps it on a single line with an ellipsis. Applies to the default
51
+ * header markup only — a custom `header` snippet owns its own overflow.
52
+ */
53
+ overflow?: 'truncate' | 'wrap'
46
54
  /** Heading level wrapping each header button (for the document outline). */
47
55
  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6
48
56
  /**
@@ -66,6 +74,7 @@
66
74
  defaultValue,
67
75
  onChange,
68
76
  size,
77
+ overflow = 'wrap',
69
78
  headingLevel = 3,
70
79
  idBase = `ss-acc-${uid}`,
71
80
  }: Props = $props()
@@ -145,9 +154,15 @@
145
154
 
146
155
  const headerId = (item: AccordionItem) => `${idBase}-h-${item.id}`
147
156
  const panelId = (item: AccordionItem) => `${idBase}-p-${item.id}`
157
+
158
+ // DS-0111: resolve size ONCE at the root, then hand it explicitly to the
159
+ // nested chevron Icon so a sm/md/lg Accordion gets a matching chevron rather
160
+ // than relying on the cascade. `undefined` → Icon inherits the active
161
+ // --ss-icon token (still coordinated, since the root carries no override).
162
+ const resolvedSize = $derived(resolveComponentSize('Accordion', size))
148
163
  </script>
149
164
 
150
- <div class="ss-accordion" data-size-variant={resolveComponentSize('Accordion', size)}>
165
+ <div class="ss-accordion" data-size-variant={resolvedSize} data-overflow={overflow}>
151
166
  {#each items as item, i (item.id)}
152
167
  {@const expanded = isOpen(item)}
153
168
  <div class="item" class:open={expanded} class:disabled={item.disabled}>
@@ -169,7 +184,9 @@
169
184
  <span class="title">{item.label}</span>
170
185
  {#if item.hint}<span class="hint">{item.hint}</span>{/if}
171
186
  {/if}
172
- <span class="chevron" aria-hidden="true"></span>
187
+ <span class="chevron" aria-hidden="true">
188
+ <Icon name="chevron" size={resolvedSize} />
189
+ </span>
173
190
  </button>
174
191
  </div>
175
192
  <div
@@ -179,8 +196,10 @@
179
196
  aria-labelledby={headerId(item)}
180
197
  hidden={!expanded}
181
198
  >
182
- <div class="panel-inner">
183
- {@render panel(item)}
199
+ <div class="panel-clip">
200
+ <div class="panel-inner">
201
+ {@render panel(item)}
202
+ </div>
184
203
  </div>
185
204
  </div>
186
205
  </div>
@@ -192,7 +211,6 @@
192
211
  --ss-acc-head-px: var(--ss-row-px);
193
212
  --ss-acc-body-py: var(--ss-s-3);
194
213
  --ss-acc-body-px: var(--ss-row-px);
195
- --ss-acc-chevron: 9px;
196
214
  --ss-acc-gap: var(--ss-s-3);
197
215
  }
198
216
  .ss-accordion[data-size-variant=sm] {
@@ -200,7 +218,6 @@
200
218
  --ss-acc-head-px: var(--ss-s-2);
201
219
  --ss-acc-body-py: var(--ss-s-2);
202
220
  --ss-acc-body-px: var(--ss-s-2);
203
- --ss-acc-chevron: 7px;
204
221
  --ss-acc-gap: var(--ss-s-2);
205
222
  }
206
223
  .ss-accordion[data-size-variant=lg] {
@@ -208,7 +225,6 @@
208
225
  --ss-acc-head-px: var(--ss-s-4);
209
226
  --ss-acc-body-py: var(--ss-s-4);
210
227
  --ss-acc-body-px: var(--ss-s-4);
211
- --ss-acc-chevron: 11px;
212
228
  --ss-acc-gap: var(--ss-s-4);
213
229
  }
214
230
  .ss-accordion {
@@ -261,17 +277,21 @@
261
277
  }
262
278
  .ss-accordion .head .chevron {
263
279
  flex: 0 0 auto;
264
- width: var(--ss-acc-chevron);
265
- height: var(--ss-acc-chevron);
266
- border-right: 1.5px solid currentColor;
267
- border-bottom: 1.5px solid currentColor;
268
- transform: rotate(45deg);
280
+ display: inline-flex;
281
+ align-items: center;
282
+ justify-content: center;
283
+ transform: rotate(0deg);
269
284
  transform-origin: center;
270
285
  transition: transform var(--ss-dur) var(--ss-ease);
271
286
  color: var(--ss-fg-muted);
272
287
  }
288
+ .ss-accordion[data-overflow=truncate] .head .title {
289
+ white-space: nowrap;
290
+ overflow: hidden;
291
+ text-overflow: ellipsis;
292
+ }
273
293
  .ss-accordion .item.open .head .chevron {
274
- transform: rotate(225deg);
294
+ transform: rotate(180deg);
275
295
  }
276
296
  .ss-accordion .panel {
277
297
  display: grid;
@@ -285,11 +305,11 @@
285
305
  .ss-accordion .panel:not([hidden]) {
286
306
  grid-template-rows: 1fr;
287
307
  }
288
- .ss-accordion .panel-inner {
308
+ .ss-accordion .panel-clip {
289
309
  overflow: hidden;
290
310
  min-height: 0;
291
311
  }
292
- .ss-accordion .panel:not([hidden]) .panel-inner {
312
+ .ss-accordion .panel-inner {
293
313
  padding: var(--ss-acc-body-py) var(--ss-acc-body-px);
294
314
  color: var(--ss-fg-muted);
295
315
  font-size: var(--ss-ui-md);
@@ -37,6 +37,13 @@ interface Props {
37
37
  onChange?: (value: AccordionValue) => void;
38
38
  /** Token size (sm|md|lg); inherits the global size when unset. */
39
39
  size?: Size;
40
+ /**
41
+ * How a long header label behaves when it exceeds the available width.
42
+ * `wrap` (default) lets the label flow onto multiple lines; `truncate`
43
+ * keeps it on a single line with an ellipsis. Applies to the default
44
+ * header markup only — a custom `header` snippet owns its own overflow.
45
+ */
46
+ overflow?: 'truncate' | 'wrap';
40
47
  /** Heading level wrapping each header button (for the document outline). */
41
48
  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
42
49
  /**
@@ -1,15 +1,11 @@
1
1
  <script module lang="ts">
2
+ import { CHART_PALETTE } from '../palette.js'
3
+
2
4
  // Deterministic palette for the initials tile background (DS-0099). A given
3
5
  // `name` always maps to the same entry via a simple string hash, so the same
4
- // person reads with a stable colour across the app.
5
- const PALETTE = [
6
- 'var(--ss-primary)',
7
- 'var(--ss-blue)',
8
- 'var(--ss-purple)',
9
- 'var(--ss-cyan)',
10
- 'var(--ss-yellow)',
11
- 'var(--ss-lime)',
12
- ]
6
+ // person reads with a stable colour across the app — CHART_PALETTE's order
7
+ // and length are stable API for exactly this reason.
8
+ const PALETTE = CHART_PALETTE
13
9
 
14
10
  /** Up to two leading initials, uppercased: "Ada Lovelace" → "AL", "Cher" → "C". */
15
11
  export function avatarInitials(name: string): string {
@@ -2,7 +2,7 @@
2
2
  import type { Snippet } from 'svelte'
3
3
  import { resolveComponentSize, type Size } from '../config.js'
4
4
 
5
- type Tone = 'up' | 'deg' | 'down' | 'maint' | 'info' | 'neutral'
5
+ type Tone = 'brand' | 'neutral' | 'positive' | 'caution' | 'critical' | 'info'
6
6
 
7
7
  interface Props {
8
8
  /** Semantic tone; `neutral` is the safe baseline for non-status labels. */
@@ -26,25 +26,21 @@
26
26
  live?: boolean
27
27
  /**
28
28
  * Accessible label. Required for dot-only / label-less badges so the
29
- * status isn't conveyed by colour alone (WCAG 1.4.1). Also names the
30
- * dismiss button's target.
29
+ * status isn't conveyed by colour alone (WCAG 1.4.1).
31
30
  */
32
31
  label?: string
33
- /** When provided, renders a trailing, keyboard-focusable dismiss button. */
34
- ondismiss?: () => void
35
32
  /** Badge text. Optional: omit for a dot-only or count-only badge. */
36
33
  children?: Snippet
37
34
  }
38
35
 
39
36
  let {
40
- tone = 'info',
37
+ tone = 'neutral',
41
38
  size,
42
39
  dot = false,
43
40
  count,
44
41
  max = 99,
45
42
  live = false,
46
43
  label,
47
- ondismiss,
48
44
  children,
49
45
  }: Props = $props()
50
46
 
@@ -73,20 +69,13 @@
73
69
  {#if dot}<span class="dot" aria-hidden="true"></span>{/if}
74
70
  {#if hasLabel}{@render children?.()}{/if}
75
71
  {#if showCount}<span class="count">{countText}</span>{/if}
76
- {#if ondismiss}
77
- <button
78
- class="x"
79
- type="button"
80
- aria-label={label ? `Remove ${label}` : 'Remove'}
81
- onclick={ondismiss}>×</button
82
- >
83
- {/if}
84
72
  </span>
85
73
 
86
74
  <style>.ss-badge {
87
75
  font-family: var(--ss-font-mono);
88
76
  font-size: var(--ss-ui-xs);
89
- padding: var(--ss-badge-py) var(--ss-badge-px);
77
+ padding: 0 var(--ss-badge-px);
78
+ line-height: 1.6;
90
79
  letter-spacing: 0.05em;
91
80
  display: inline-flex;
92
81
  align-items: center;
@@ -94,36 +83,36 @@
94
83
  text-transform: lowercase;
95
84
  border: 1px solid var(--ss-line);
96
85
  }
97
- .ss-badge.up {
98
- background: var(--ss-badge-up-bg);
99
- color: var(--ss-primary);
100
- border-color: var(--ss-badge-up-border);
86
+ .ss-badge.brand {
87
+ background: var(--ss-badge-brand-bg);
88
+ color: var(--ss-badge-brand-fg);
89
+ border-color: var(--ss-badge-brand-border);
101
90
  }
102
- .ss-badge.deg {
103
- background: var(--ss-badge-deg-bg);
104
- color: var(--ss-yellow);
105
- border-color: var(--ss-badge-deg-border);
91
+ .ss-badge.neutral {
92
+ background: var(--ss-badge-neutral-bg);
93
+ color: var(--ss-badge-neutral-fg);
94
+ border-color: var(--ss-badge-neutral-border);
106
95
  }
107
- .ss-badge.down {
108
- background: var(--ss-badge-down-bg);
109
- color: var(--ss-red);
110
- border-color: var(--ss-badge-down-border);
96
+ .ss-badge.positive {
97
+ background: var(--ss-badge-positive-bg);
98
+ color: var(--ss-badge-positive-fg);
99
+ border-color: var(--ss-badge-positive-border);
111
100
  }
112
- .ss-badge.maint {
113
- background: var(--ss-badge-maint-bg);
114
- color: var(--ss-blue);
115
- border-color: var(--ss-badge-maint-border);
101
+ .ss-badge.caution {
102
+ background: var(--ss-badge-caution-bg);
103
+ color: var(--ss-badge-caution-fg);
104
+ border-color: var(--ss-badge-caution-border);
105
+ }
106
+ .ss-badge.critical {
107
+ background: var(--ss-badge-critical-bg);
108
+ color: var(--ss-badge-critical-fg);
109
+ border-color: var(--ss-badge-critical-border);
116
110
  }
117
111
  .ss-badge.info {
118
112
  background: var(--ss-badge-info-bg);
119
- color: var(--ss-cyan);
113
+ color: var(--ss-badge-info-fg);
120
114
  border-color: var(--ss-badge-info-border);
121
115
  }
122
- .ss-badge.neutral {
123
- background: var(--ss-badge-neutral-bg);
124
- color: var(--ss-fg-muted);
125
- border-color: var(--ss-badge-neutral-border);
126
- }
127
116
  .ss-badge .dot {
128
117
  width: var(--ss-badge-dot);
129
118
  height: var(--ss-badge-dot);
@@ -133,19 +122,4 @@
133
122
  .ss-badge .count {
134
123
  text-transform: none;
135
124
  font-variant-numeric: tabular-nums;
136
- }
137
- .ss-badge .x {
138
- flex: none;
139
- background: none;
140
- border: none;
141
- color: currentColor;
142
- cursor: pointer;
143
- font-size: var(--ss-size-sm);
144
- line-height: 1;
145
- padding: 0;
146
- margin-inline-start: calc(var(--ss-badge-gap) * -0.25);
147
- opacity: 0.8;
148
- }
149
- .ss-badge .x:hover, .ss-badge .x:focus-visible {
150
- opacity: 1;
151
125
  }</style>
@@ -1,6 +1,6 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import { type Size } from '../config.js';
3
- type Tone = 'up' | 'deg' | 'down' | 'maint' | 'info' | 'neutral';
3
+ type Tone = 'brand' | 'neutral' | 'positive' | 'caution' | 'critical' | 'info';
4
4
  interface Props {
5
5
  /** Semantic tone; `neutral` is the safe baseline for non-status labels. */
6
6
  tone?: Tone;
@@ -23,12 +23,9 @@ interface Props {
23
23
  live?: boolean;
24
24
  /**
25
25
  * Accessible label. Required for dot-only / label-less badges so the
26
- * status isn't conveyed by colour alone (WCAG 1.4.1). Also names the
27
- * dismiss button's target.
26
+ * status isn't conveyed by colour alone (WCAG 1.4.1).
28
27
  */
29
28
  label?: string;
30
- /** When provided, renders a trailing, keyboard-focusable dismiss button. */
31
- ondismiss?: () => void;
32
29
  /** Badge text. Optional: omit for a dot-only or count-only badge. */
33
30
  children?: Snippet;
34
31
  }
@@ -158,7 +158,7 @@
158
158
  background: color-mix(in srgb, var(--ss-bg) 88%, transparent);
159
159
  backdrop-filter: blur(14px);
160
160
  -webkit-backdrop-filter: blur(14px);
161
- border-top: 1px solid var(--ss-line);
161
+ box-shadow: 0 -1px 0 var(--ss-line);
162
162
  font-family: var(--ss-font-mono);
163
163
  }
164
164
  .ss-bottom-nav .list {
@@ -202,7 +202,7 @@
202
202
  }
203
203
  .ss-bottom-nav .tab.active {
204
204
  color: var(--ss-primary);
205
- background: rgba(var(--ss-primary-rgb), 0.06);
205
+ background: color-mix(in srgb, var(--ss-accent) 6%, transparent);
206
206
  border-top-color: var(--ss-primary);
207
207
  }
208
208
  .ss-bottom-nav .tab:disabled, .ss-bottom-nav .tab.disabled {