dssoca 0.17.0 → 0.19.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.
- package/README.md +9 -6
- package/dist/components/BottomNav.svelte +4 -0
- package/dist/components/Card.svelte +16 -1
- package/dist/components/Card.svelte.d.ts +6 -0
- package/dist/components/Input.svelte +3 -0
- package/dist/components/Kbd.svelte +17 -1
- package/dist/components/Kbd.svelte.d.ts +9 -0
- package/dist/components/MetricTile.svelte +5 -1
- package/dist/components/SearchPalette.svelte +3 -0
- package/dist/components/ServiceCard.svelte +3 -0
- package/dist/components/ShortcutsHelp.svelte +2 -1
- package/dist/components/Sidebar.svelte +43 -1
- package/dist/components/Sidebar.svelte.d.ts +5 -0
- package/dist/components/TierList.svelte +602 -0
- package/dist/components/TierList.svelte.d.ts +37 -0
- package/dist/components/Toaster.svelte +1 -0
- package/dist/components/Topbar.svelte +18 -0
- package/dist/dssoca.config.d.ts +1 -1
- package/dist/dssoca.config.js +1 -0
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/theme.css +25 -27
- package/dist/tierlist-core.d.ts +87 -0
- package/dist/tierlist-core.js +183 -0
- package/dist/tokens.css +25 -0
- package/dist/vanilla/index.d.ts +1 -0
- package/dist/vanilla/index.js +6 -3
- package/dist/vanilla/tierlist.d.ts +8 -0
- package/dist/vanilla/tierlist.js +304 -0
- package/dist/vanilla/toast.js +1 -0
- package/dist/vanilla.css +257 -42
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -84,22 +84,25 @@ wires the interactive parts (modal, menu, accordion, tooltip, switch, toasts, ic
|
|
|
84
84
|
**after** `theme.css`; it needs CSS `@scope` (Chrome/Edge 118+, Safari 17.4+, Firefox 2026+).
|
|
85
85
|
|
|
86
86
|
```html
|
|
87
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dssoca@0.
|
|
88
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dssoca@0.
|
|
89
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/dssoca@0.
|
|
87
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dssoca@0.19/dist/theme.css" />
|
|
88
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dssoca@0.19/dist/vanilla.css" />
|
|
89
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/dssoca@0.19/dist/vanilla/index.js"></script>
|
|
90
90
|
|
|
91
91
|
<button class="ss-btn primary" type="button" data-ss-modal="#confirm">deploy</button>
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
Every component page in the docs has an **HTML** section with copy-paste markup; the full contract
|
|
95
|
-
is in the _Plain HTML & CSS_ guide.
|
|
95
|
+
is in the _Plain HTML & CSS_ guide. For whole pages, see **[Inspirations](https://dssoca.vercel.app/inspirations/)**
|
|
96
|
+
(standalone site: <https://httpassoca.github.io/dssoca/>)
|
|
97
|
+
— twelve example websites (dashboard, social feed, chat, storefront, blog, …) written in plain
|
|
98
|
+
HTML on this path, deployed from `inspirations/` to GitHub Pages.
|
|
96
99
|
|
|
97
100
|
## What's in the box
|
|
98
101
|
|
|
99
|
-
**Components (
|
|
102
|
+
**Components (24):** `Icon`, `Badge`, `Button`, `Input`, `Textarea`, `Card`, `Sparkline`,
|
|
100
103
|
`ServiceCard`, `MetricTile`, `Topbar`, `Sidebar`, `BottomNav`, `Menu`, `Link`,
|
|
101
104
|
`SegmentedControl`, `Accordion`, `LogStream`, `Toaster`, `EmptyState`, `Image`,
|
|
102
|
-
`Heading`, `Container`, `Spinner`.
|
|
105
|
+
`Heading`, `Container`, `Spinner`, `TierList`.
|
|
103
106
|
|
|
104
107
|
**Toasts:** `toast` (`.success` / `.error` / `.info` / `.loading` / `.promise`) + the `toasts`
|
|
105
108
|
store (`update` / `dismiss` / `pause` / `resume` / `clear`, `max` cap) — render once with
|
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
children: Snippet
|
|
19
19
|
/** Makes the whole card a primary link to this href. */
|
|
20
20
|
href?: string
|
|
21
|
+
/**
|
|
22
|
+
* Off-site `href` (DS-0158): the overlay link opens in a new tab with
|
|
23
|
+
* `rel="noopener noreferrer"` and announces "(opens in a new tab)" — Sidebar's `external`
|
|
24
|
+
* convention.
|
|
25
|
+
*/
|
|
26
|
+
external?: boolean
|
|
21
27
|
/** Makes the whole card clickable; pairs with keyboard activation. */
|
|
22
28
|
onclick?: (e: MouseEvent | KeyboardEvent) => void
|
|
23
29
|
/** Surface style: outlined (default) or elevated (shadow tokens). */
|
|
@@ -36,6 +42,7 @@
|
|
|
36
42
|
footer,
|
|
37
43
|
children,
|
|
38
44
|
href,
|
|
45
|
+
external = false,
|
|
39
46
|
onclick,
|
|
40
47
|
variant = 'outlined',
|
|
41
48
|
size,
|
|
@@ -99,11 +106,15 @@
|
|
|
99
106
|
<a
|
|
100
107
|
class="overlay"
|
|
101
108
|
{href}
|
|
109
|
+
target={external ? '_blank' : undefined}
|
|
110
|
+
rel={external ? 'noopener noreferrer' : undefined}
|
|
102
111
|
{onclick}
|
|
103
112
|
onkeydown={onKeydown}
|
|
104
113
|
aria-labelledby={title ? titleId : undefined}
|
|
105
114
|
>
|
|
106
|
-
<span class="sr-only"
|
|
115
|
+
<span class="sr-only"
|
|
116
|
+
>{typeof title === 'string' ? title : 'Open'}{external ? ' (opens in a new tab)' : ''}</span
|
|
117
|
+
>
|
|
107
118
|
</a>
|
|
108
119
|
{/if}
|
|
109
120
|
</div>
|
|
@@ -224,4 +235,8 @@
|
|
|
224
235
|
clip: rect(0 0 0 0);
|
|
225
236
|
white-space: nowrap;
|
|
226
237
|
border: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.overlay::before {
|
|
241
|
+
content: none;
|
|
227
242
|
}</style>
|
|
@@ -16,6 +16,12 @@ interface Props {
|
|
|
16
16
|
children: Snippet;
|
|
17
17
|
/** Makes the whole card a primary link to this href. */
|
|
18
18
|
href?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Off-site `href` (DS-0158): the overlay link opens in a new tab with
|
|
21
|
+
* `rel="noopener noreferrer"` and announces "(opens in a new tab)" — Sidebar's `external`
|
|
22
|
+
* convention.
|
|
23
|
+
*/
|
|
24
|
+
external?: boolean;
|
|
19
25
|
/** Makes the whole card clickable; pairs with keyboard activation. */
|
|
20
26
|
onclick?: (e: MouseEvent | KeyboardEvent) => void;
|
|
21
27
|
/** Surface style: outlined (default) or elevated (shadow tokens). */
|
|
@@ -39,11 +39,20 @@
|
|
|
39
39
|
platform?: ShortcutPlatform
|
|
40
40
|
/** Token size (sm|md|lg); inherits the global size when unset. */
|
|
41
41
|
size?: Size
|
|
42
|
+
/**
|
|
43
|
+
* Hide the chip on devices without a keyboard (DS-0157): a capability query —
|
|
44
|
+
* `(hover: none) and (pointer: coarse)`, i.e. phones and tablets — not a width, so a narrow
|
|
45
|
+
* desktop window keeps its hint. Default `true`; pass `false` where the chip *is* the
|
|
46
|
+
* content (a shortcuts overlay, a keyboard guide). Reflected as
|
|
47
|
+
* `data-hide-on-mobile="false"` on the root only when opted out, so the default DOM is
|
|
48
|
+
* unchanged and plain-HTML `.ss-kbd` markup gets the behaviour for free.
|
|
49
|
+
*/
|
|
50
|
+
hideOnMobile?: boolean
|
|
42
51
|
/** Raw-content escape hatch for keys the grammar can't express (`<Kbd>F12</Kbd>` sequences, chords…). Ignored when `keys` is set. */
|
|
43
52
|
children?: Snippet
|
|
44
53
|
}
|
|
45
54
|
|
|
46
|
-
let { keys, format = 'glyph', platform, size, children }: Props = $props()
|
|
55
|
+
let { keys, format = 'glyph', platform, size, hideOnMobile = true, children }: Props = $props()
|
|
47
56
|
|
|
48
57
|
// Hydration posture: 'other' on the server AND the first client render,
|
|
49
58
|
// corrected in an effect so server and client first paints agree. An
|
|
@@ -73,6 +82,7 @@
|
|
|
73
82
|
<kbd
|
|
74
83
|
class="ss-kbd"
|
|
75
84
|
data-size-variant={resolveComponentSize('Kbd', size)}
|
|
85
|
+
data-hide-on-mobile={hideOnMobile ? undefined : 'false'}
|
|
76
86
|
role={ariaLabel ? 'img' : undefined}
|
|
77
87
|
aria-label={ariaLabel}
|
|
78
88
|
>
|
|
@@ -117,4 +127,10 @@
|
|
|
117
127
|
.ss-kbd .or {
|
|
118
128
|
font-size: var(--ss-ui-xs);
|
|
119
129
|
letter-spacing: 0.05em;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@media (hover: none) and (pointer: coarse) {
|
|
133
|
+
.ss-kbd:not([data-hide-on-mobile=false]) {
|
|
134
|
+
display: none;
|
|
135
|
+
}
|
|
120
136
|
}</style>
|
|
@@ -22,6 +22,15 @@ interface Props {
|
|
|
22
22
|
platform?: ShortcutPlatform;
|
|
23
23
|
/** Token size (sm|md|lg); inherits the global size when unset. */
|
|
24
24
|
size?: Size;
|
|
25
|
+
/**
|
|
26
|
+
* Hide the chip on devices without a keyboard (DS-0157): a capability query —
|
|
27
|
+
* `(hover: none) and (pointer: coarse)`, i.e. phones and tablets — not a width, so a narrow
|
|
28
|
+
* desktop window keeps its hint. Default `true`; pass `false` where the chip *is* the
|
|
29
|
+
* content (a shortcuts overlay, a keyboard guide). Reflected as
|
|
30
|
+
* `data-hide-on-mobile="false"` on the root only when opted out, so the default DOM is
|
|
31
|
+
* unchanged and plain-HTML `.ss-kbd` markup gets the behaviour for free.
|
|
32
|
+
*/
|
|
33
|
+
hideOnMobile?: boolean;
|
|
25
34
|
/** Raw-content escape hatch for keys the grammar can't express (`<Kbd>F12</Kbd>` sequences, chords…). Ignored when `keys` is set. */
|
|
26
35
|
children?: Snippet;
|
|
27
36
|
}
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
}
|
|
108
108
|
.ss-metric .val .small {
|
|
109
109
|
font-size: 0.5em;
|
|
110
|
-
|
|
110
|
+
color: var(--ss-fg-muted);
|
|
111
111
|
}
|
|
112
112
|
.ss-metric .delta {
|
|
113
113
|
font-family: var(--ss-font-mono);
|
|
@@ -138,10 +138,14 @@
|
|
|
138
138
|
}
|
|
139
139
|
.ss-metric .delta.emphasis.negative {
|
|
140
140
|
background: var(--ss-danger-soft);
|
|
141
|
+
color: color-mix(in oklab, var(--ss-danger) 70%, var(--ss-fg));
|
|
141
142
|
}
|
|
142
143
|
.ss-metric .delta.emphasis.neutral {
|
|
143
144
|
background: var(--ss-hover);
|
|
144
145
|
}
|
|
146
|
+
.ss-metric .delta.emphasis .period {
|
|
147
|
+
color: inherit;
|
|
148
|
+
}
|
|
145
149
|
.ss-metric .chart {
|
|
146
150
|
margin-top: var(--ss-s-1);
|
|
147
151
|
}
|
|
@@ -219,7 +219,8 @@
|
|
|
219
219
|
{#if recordingId === item.id}
|
|
220
220
|
<span class="prompt">Press keys…</span>
|
|
221
221
|
{:else}
|
|
222
|
-
|
|
222
|
+
<!-- The chip IS the content here — never hide it on touch devices (DS-0157). -->
|
|
223
|
+
<Kbd keys={item.keys} hideOnMobile={false} />
|
|
223
224
|
{/if}
|
|
224
225
|
</dd>
|
|
225
226
|
{#if editable}
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
status?: SideStatus
|
|
11
11
|
/** Optional URL — when set the item renders as a real `<a href>`. */
|
|
12
12
|
href?: string
|
|
13
|
+
/**
|
|
14
|
+
* Off-site link (needs `href`): opens in a new tab with `rel="noopener noreferrer"`, shows
|
|
15
|
+
* a trailing external glyph and announces "(opens in a new tab)".
|
|
16
|
+
*/
|
|
17
|
+
external?: boolean
|
|
13
18
|
/** Optional count/label rendered as a square badge near the status dot. */
|
|
14
19
|
badge?: string | number
|
|
15
20
|
/** One level of nested sub-items, rendered with the Disclosure pattern. */
|
|
@@ -79,6 +84,7 @@
|
|
|
79
84
|
const parts = [item.label]
|
|
80
85
|
if (item.status && STATUS_WORD[item.status]) parts.push(STATUS_WORD[item.status])
|
|
81
86
|
if (item.badge != null && item.badge !== '') parts.push(`${item.badge}`)
|
|
87
|
+
if (item.external) parts.push('opens in a new tab')
|
|
82
88
|
return parts.join(', ')
|
|
83
89
|
}
|
|
84
90
|
|
|
@@ -169,6 +175,8 @@
|
|
|
169
175
|
<a
|
|
170
176
|
class="item child {isActive(child) ? 'active' : ''}"
|
|
171
177
|
href={child.href}
|
|
178
|
+
target={child.external ? '_blank' : undefined}
|
|
179
|
+
rel={child.external ? 'noopener noreferrer' : undefined}
|
|
172
180
|
aria-current={isActive(child) ? 'page' : undefined}
|
|
173
181
|
aria-label={collapsed ? accessibleName(child) : undefined}
|
|
174
182
|
title={collapsed ? accessibleName(child) : undefined}
|
|
@@ -176,6 +184,10 @@
|
|
|
176
184
|
>
|
|
177
185
|
{#if child.icon}<Icon name={child.icon} px={13} />{/if}
|
|
178
186
|
<span class="label">{child.label}</span>
|
|
187
|
+
{#if child.external}
|
|
188
|
+
<span class="ext" aria-hidden="true"><Icon name="external" px={11} /></span>
|
|
189
|
+
<span class="sr-only">(opens in a new tab)</span>
|
|
190
|
+
{/if}
|
|
179
191
|
{#if child.badge != null && child.badge !== ''}
|
|
180
192
|
<span class="badge">{child.badge}</span>
|
|
181
193
|
{/if}
|
|
@@ -230,6 +242,8 @@
|
|
|
230
242
|
<a
|
|
231
243
|
class="item {isActive(item) ? 'active' : ''}"
|
|
232
244
|
href={item.href}
|
|
245
|
+
target={item.external ? '_blank' : undefined}
|
|
246
|
+
rel={item.external ? 'noopener noreferrer' : undefined}
|
|
233
247
|
aria-current={isActive(item) ? 'page' : undefined}
|
|
234
248
|
aria-label={collapsed ? accessibleName(item) : undefined}
|
|
235
249
|
title={collapsed ? accessibleName(item) : undefined}
|
|
@@ -237,6 +251,10 @@
|
|
|
237
251
|
>
|
|
238
252
|
{#if item.icon}<Icon name={item.icon} px={13} />{/if}
|
|
239
253
|
<span class="label">{item.label}</span>
|
|
254
|
+
{#if item.external}
|
|
255
|
+
<span class="ext" aria-hidden="true"><Icon name="external" px={11} /></span>
|
|
256
|
+
<span class="sr-only">(opens in a new tab)</span>
|
|
257
|
+
{/if}
|
|
240
258
|
{#if item.badge != null && item.badge !== ''}
|
|
241
259
|
<span class="badge">{item.badge}</span>
|
|
242
260
|
{/if}
|
|
@@ -282,7 +300,8 @@
|
|
|
282
300
|
{/each}
|
|
283
301
|
</nav>
|
|
284
302
|
|
|
285
|
-
<style
|
|
303
|
+
<style>@charset "UTF-8";
|
|
304
|
+
.ss-side {
|
|
286
305
|
border-right: 1px solid var(--ss-line);
|
|
287
306
|
padding: var(--ss-gap) var(--ss-s-1);
|
|
288
307
|
display: flex;
|
|
@@ -387,6 +406,25 @@
|
|
|
387
406
|
flex: 1 1 auto;
|
|
388
407
|
min-width: 0;
|
|
389
408
|
}
|
|
409
|
+
.ss-side .item {
|
|
410
|
+
/* Off-site glyph (external items) — muted, never steals the row's colour. */
|
|
411
|
+
}
|
|
412
|
+
.ss-side .item .ext {
|
|
413
|
+
flex: 0 0 auto;
|
|
414
|
+
display: inline-flex;
|
|
415
|
+
color: var(--ss-fg-faint);
|
|
416
|
+
}
|
|
417
|
+
.ss-side .item .sr-only {
|
|
418
|
+
position: absolute;
|
|
419
|
+
width: 1px;
|
|
420
|
+
height: 1px;
|
|
421
|
+
padding: 0;
|
|
422
|
+
margin: -1px;
|
|
423
|
+
overflow: hidden;
|
|
424
|
+
clip: rect(0, 0, 0, 0);
|
|
425
|
+
white-space: nowrap;
|
|
426
|
+
border: 0;
|
|
427
|
+
}
|
|
390
428
|
.ss-side .item .badge {
|
|
391
429
|
flex: 0 0 auto;
|
|
392
430
|
margin-left: auto;
|
|
@@ -438,4 +476,8 @@
|
|
|
438
476
|
}
|
|
439
477
|
.ss-side .item.child:hover {
|
|
440
478
|
color: var(--ss-fg);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.item::before {
|
|
482
|
+
content: none;
|
|
441
483
|
}</style>
|
|
@@ -8,6 +8,11 @@ export interface SideItem {
|
|
|
8
8
|
status?: SideStatus;
|
|
9
9
|
/** Optional URL — when set the item renders as a real `<a href>`. */
|
|
10
10
|
href?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Off-site link (needs `href`): opens in a new tab with `rel="noopener noreferrer"`, shows
|
|
13
|
+
* a trailing external glyph and announces "(opens in a new tab)".
|
|
14
|
+
*/
|
|
15
|
+
external?: boolean;
|
|
11
16
|
/** Optional count/label rendered as a square badge near the status dot. */
|
|
12
17
|
badge?: string | number;
|
|
13
18
|
/** One level of nested sub-items, rendered with the Disclosure pattern. */
|