dssoca 0.16.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 +24 -2
- 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/Icon.svelte +9 -61
- package/dist/components/Icon.svelte.d.ts +4 -47
- 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/LogStream.svelte +2 -2
- package/dist/components/MetricTile.svelte +7 -3
- package/dist/components/SearchPalette.svelte +3 -0
- package/dist/components/ServiceCard.svelte +5 -2
- 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/Spinner.svelte +7 -34
- package/dist/components/Spinner.svelte.d.ts +2 -59
- 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 +55 -0
- package/dist/icons.js +57 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +7 -2
- package/dist/spinner-frames.d.ts +59 -0
- package/dist/spinner-frames.js +15 -0
- package/dist/theme.css +25 -27
- package/dist/tierlist-core.d.ts +87 -0
- package/dist/tierlist-core.js +183 -0
- package/dist/toast-core.d.ts +61 -0
- package/dist/toast-core.js +73 -0
- package/dist/toast.svelte.d.ts +2 -33
- package/dist/toast.svelte.js +3 -66
- package/dist/tokens.css +25 -0
- package/dist/vanilla/accordion.d.ts +2 -0
- package/dist/vanilla/accordion.js +57 -0
- package/dist/vanilla/delegate.d.ts +16 -0
- package/dist/vanilla/delegate.js +33 -0
- package/dist/vanilla/fields.d.ts +6 -0
- package/dist/vanilla/fields.js +89 -0
- package/dist/vanilla/icons.d.ts +17 -0
- package/dist/vanilla/icons.js +78 -0
- package/dist/vanilla/index.d.ts +17 -0
- package/dist/vanilla/index.js +63 -0
- package/dist/vanilla/menu.d.ts +3 -0
- package/dist/vanilla/menu.js +133 -0
- package/dist/vanilla/modal.d.ts +3 -0
- package/dist/vanilla/modal.js +42 -0
- package/dist/vanilla/segmented.d.ts +2 -0
- package/dist/vanilla/segmented.js +62 -0
- package/dist/vanilla/switch.d.ts +2 -0
- package/dist/vanilla/switch.js +22 -0
- package/dist/vanilla/tierlist.d.ts +8 -0
- package/dist/vanilla/tierlist.js +304 -0
- package/dist/vanilla/toast.d.ts +37 -0
- package/dist/vanilla/toast.js +197 -0
- package/dist/vanilla/tooltip.d.ts +3 -0
- package/dist/vanilla/tooltip.js +54 -0
- package/dist/vanilla.css +4648 -0
- package/package.json +17 -5
package/README.md
CHANGED
|
@@ -75,12 +75,34 @@ SSR / no-flash — spread the attributes directly in markup instead of mutating
|
|
|
75
75
|
<html {...designAttributes({ sizeVariant: 'sm' })}>
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
## Plain HTML (no Svelte)
|
|
79
|
+
|
|
80
|
+
Static sites and quick demos can use the same look without a build step: `dssoca/vanilla.css`
|
|
81
|
+
carries every component's styles (generated from the components themselves — the markup contract
|
|
82
|
+
is the exact DOM they render) and `dssoca/vanilla.js` is an optional, dependency-free module that
|
|
83
|
+
wires the interactive parts (modal, menu, accordion, tooltip, switch, toasts, icons…). Load the CSS
|
|
84
|
+
**after** `theme.css`; it needs CSS `@scope` (Chrome/Edge 118+, Safari 17.4+, Firefox 2026+).
|
|
85
|
+
|
|
86
|
+
```html
|
|
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
|
+
|
|
91
|
+
<button class="ss-btn primary" type="button" data-ss-modal="#confirm">deploy</button>
|
|
92
|
+
```
|
|
93
|
+
|
|
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. 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.
|
|
99
|
+
|
|
78
100
|
## What's in the box
|
|
79
101
|
|
|
80
|
-
**Components (
|
|
102
|
+
**Components (24):** `Icon`, `Badge`, `Button`, `Input`, `Textarea`, `Card`, `Sparkline`,
|
|
81
103
|
`ServiceCard`, `MetricTile`, `Topbar`, `Sidebar`, `BottomNav`, `Menu`, `Link`,
|
|
82
104
|
`SegmentedControl`, `Accordion`, `LogStream`, `Toaster`, `EmptyState`, `Image`,
|
|
83
|
-
`Heading`, `Container`, `Spinner`.
|
|
105
|
+
`Heading`, `Container`, `Spinner`, `TierList`.
|
|
84
106
|
|
|
85
107
|
**Toasts:** `toast` (`.success` / `.error` / `.info` / `.loading` / `.promise`) + the `toasts`
|
|
86
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). */
|
|
@@ -1,67 +1,15 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
activity: '<path d="M3 12h4l3-8 4 16 3-8h4"/>',
|
|
7
|
-
database: '<rect x="3" y="4" width="18" height="16"/><path d="M3 9h18M8 4v5"/>',
|
|
8
|
-
logs: '<path d="M4 6h16M4 12h16M4 18h10"/>',
|
|
9
|
-
terminal: '<rect x="3" y="5" width="18" height="14"/><path d="M3 9h18M7 14h4"/>',
|
|
10
|
-
settings:
|
|
11
|
-
'<circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1"/>',
|
|
12
|
-
user: '<circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-7 8-7s8 3 8 7"/>',
|
|
13
|
-
arrow: '<path d="M5 12h14M13 5l7 7-7 7"/>',
|
|
14
|
-
chevron: '<path d="M8 10l4 4 4-4"/>',
|
|
15
|
-
external: '<path d="M7 17L17 7M9 7h8v8"/>',
|
|
16
|
-
film: '<rect x="3" y="4" width="18" height="16"/><path d="M3 8h4M3 16h4M17 8h4M17 16h4M3 12h18"/>',
|
|
17
|
-
note: '<rect x="4" y="3" width="16" height="18"/><path d="M8 8h8M8 12h8M8 16h6"/>',
|
|
18
|
-
book: '<path d="M6 4h11a1 1 0 011 1v15H7a1 1 0 01-1-1z"/><path d="M17 20a2 2 0 002-2V6a2 2 0 00-2-2"/><path d="M9 8h5"/>',
|
|
19
|
-
check: '<path d="M5 12l4 4L19 6"/>',
|
|
20
|
-
cup: '<path d="M4 8h12v6a4 4 0 01-4 4H8a4 4 0 01-4-4z"/><path d="M16 10h2a2 2 0 010 4h-2M6 4v2M10 4v2M14 4v2"/>',
|
|
21
|
-
wallet: '<rect x="3" y="6" width="18" height="14"/><path d="M3 10h18M17 14h2"/>',
|
|
22
|
-
target:
|
|
23
|
-
'<circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="5"/><circle cx="12" cy="12" r="1.5" class="ss-icon-dot"/>',
|
|
24
|
-
spinner: '<path d="M12 3a9 9 0 1 0 9 9" stroke-linecap="round"/>',
|
|
25
|
-
home: '<path d="M4 11l8-8 8 8"/><path d="M6 9v12h12V9"/><path d="M10 21v-6h4v6"/>',
|
|
26
|
-
briefcase: '<rect x="3" y="7" width="18" height="13"/><path d="M9 7V4h6v3M3 12h18"/>',
|
|
27
|
-
folder: '<path d="M3 5h7l2 3h9v13H3z"/><path d="M3 8h9"/>',
|
|
28
|
-
github:
|
|
29
|
-
'<path d="M7 3h10l2 2v6l-2 3h-4l1 2v5h-4v-5l1-2H7l-2-3V5l2-2z"/><path d="M9 8h1M14 8h1"/>',
|
|
30
|
-
linkedin:
|
|
31
|
-
'<rect x="3" y="3" width="18" height="18"/><path d="M8 16v-5M8 8v.01M12 16v-5h2l2 2v3"/>',
|
|
32
|
-
language: '<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3L8 12l4 9M12 3l4 9-4 9"/>',
|
|
33
|
-
'color-swatch':
|
|
34
|
-
'<rect x="3" y="3" width="8" height="18"/><path d="M7 17v.01"/><path d="M11 19l8-8 2 2-8 8"/><path d="M13 21h8"/>',
|
|
35
|
-
} as const
|
|
36
|
-
|
|
37
|
-
export type IconName = keyof typeof BUILTIN_PATHS
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* The curated built-in glyphs plus any runtime-registered ones.
|
|
41
|
-
* (`PATHS` is kept as the public name for backward compatibility.)
|
|
42
|
-
*/
|
|
43
|
-
export const PATHS: Record<string, string> = { ...BUILTIN_PATHS }
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Register (or override) a glyph at runtime so `<Icon name="foo" />` resolves
|
|
47
|
-
* raw SVG inner markup that isn't part of the curated {@link IconName} union.
|
|
48
|
-
* The markup is rendered verbatim inside the icon's `<svg viewBox="0 0 24 24">`.
|
|
49
|
-
*
|
|
50
|
-
* registerIcon('heart', '<path d="M12 21 4 13a5 5 0 0 1 7-7l1 1 1-1a5 5 0 0 1 7 7z"/>')
|
|
51
|
-
* <Icon name={'heart' as IconName} />
|
|
52
|
-
*/
|
|
53
|
-
export function registerIcon(name: string, paths: string): void {
|
|
54
|
-
PATHS[name] = paths
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** Look a glyph up; built-ins first, then runtime registrations. */
|
|
58
|
-
export function resolveIcon(name: string): string | undefined {
|
|
59
|
-
return PATHS[name]
|
|
60
|
-
}
|
|
2
|
+
// Glyph table + registry live in `../icons.ts` (DS-0148) so the vanilla build can share
|
|
3
|
+
// them without importing a .svelte file. Re-exported here for backward compatibility.
|
|
4
|
+
export { PATHS, registerIcon, resolveIcon } from '../icons.js'
|
|
5
|
+
export type { IconName } from '../icons.js'
|
|
61
6
|
</script>
|
|
62
7
|
|
|
63
8
|
<script lang="ts">
|
|
64
9
|
import { resolveComponentSize, type Size } from '../config.js'
|
|
10
|
+
// Aliased: the module script re-exports the same names, and eslint-plugin-svelte
|
|
11
|
+
// merges both scopes.
|
|
12
|
+
import { resolveIcon as lookupIcon, type IconName as GlyphName } from '../icons.js'
|
|
65
13
|
|
|
66
14
|
/**
|
|
67
15
|
* Icon-local size scale (DS-0109). Distinct from the global `Size` axis
|
|
@@ -76,7 +24,7 @@
|
|
|
76
24
|
const DEFAULT_PX = SIZE_PX.md
|
|
77
25
|
|
|
78
26
|
interface Props {
|
|
79
|
-
name:
|
|
27
|
+
name: GlyphName
|
|
80
28
|
/**
|
|
81
29
|
* Icon-local size (`xs | sm | md | lg`, a fixed px scale); inherits the
|
|
82
30
|
* active `--ss-icon` token when unset. `xs` (12px) is Icon-only and has no
|
|
@@ -141,7 +89,7 @@
|
|
|
141
89
|
// Resolve the glyph: explicit `paths` escape hatch → registered/built-in → warn.
|
|
142
90
|
const markup = $derived.by(() => {
|
|
143
91
|
if (paths != null) return paths
|
|
144
|
-
const found =
|
|
92
|
+
const found = lookupIcon(name)
|
|
145
93
|
if (found != null) return found
|
|
146
94
|
if (typeof console !== 'undefined') {
|
|
147
95
|
console.warn(
|
|
@@ -1,50 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const BUILTIN_PATHS: {
|
|
4
|
-
readonly grid: "<rect x=\"3\" y=\"3\" width=\"7\" height=\"7\"/><rect x=\"14\" y=\"3\" width=\"7\" height=\"7\"/><rect x=\"3\" y=\"14\" width=\"7\" height=\"7\"/><rect x=\"14\" y=\"14\" width=\"7\" height=\"7\"/>";
|
|
5
|
-
readonly activity: "<path d=\"M3 12h4l3-8 4 16 3-8h4\"/>";
|
|
6
|
-
readonly database: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\"/><path d=\"M3 9h18M8 4v5\"/>";
|
|
7
|
-
readonly logs: "<path d=\"M4 6h16M4 12h16M4 18h10\"/>";
|
|
8
|
-
readonly terminal: "<rect x=\"3\" y=\"5\" width=\"18\" height=\"14\"/><path d=\"M3 9h18M7 14h4\"/>";
|
|
9
|
-
readonly settings: "<circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1\"/>";
|
|
10
|
-
readonly user: "<circle cx=\"12\" cy=\"8\" r=\"4\"/><path d=\"M4 21c0-4 4-7 8-7s8 3 8 7\"/>";
|
|
11
|
-
readonly arrow: "<path d=\"M5 12h14M13 5l7 7-7 7\"/>";
|
|
12
|
-
readonly chevron: "<path d=\"M8 10l4 4 4-4\"/>";
|
|
13
|
-
readonly external: "<path d=\"M7 17L17 7M9 7h8v8\"/>";
|
|
14
|
-
readonly film: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\"/><path d=\"M3 8h4M3 16h4M17 8h4M17 16h4M3 12h18\"/>";
|
|
15
|
-
readonly note: "<rect x=\"4\" y=\"3\" width=\"16\" height=\"18\"/><path d=\"M8 8h8M8 12h8M8 16h6\"/>";
|
|
16
|
-
readonly book: "<path d=\"M6 4h11a1 1 0 011 1v15H7a1 1 0 01-1-1z\"/><path d=\"M17 20a2 2 0 002-2V6a2 2 0 00-2-2\"/><path d=\"M9 8h5\"/>";
|
|
17
|
-
readonly check: "<path d=\"M5 12l4 4L19 6\"/>";
|
|
18
|
-
readonly cup: "<path d=\"M4 8h12v6a4 4 0 01-4 4H8a4 4 0 01-4-4z\"/><path d=\"M16 10h2a2 2 0 010 4h-2M6 4v2M10 4v2M14 4v2\"/>";
|
|
19
|
-
readonly wallet: "<rect x=\"3\" y=\"6\" width=\"18\" height=\"14\"/><path d=\"M3 10h18M17 14h2\"/>";
|
|
20
|
-
readonly target: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><circle cx=\"12\" cy=\"12\" r=\"5\"/><circle cx=\"12\" cy=\"12\" r=\"1.5\" class=\"ss-icon-dot\"/>";
|
|
21
|
-
readonly spinner: "<path d=\"M12 3a9 9 0 1 0 9 9\" stroke-linecap=\"round\"/>";
|
|
22
|
-
readonly home: "<path d=\"M4 11l8-8 8 8\"/><path d=\"M6 9v12h12V9\"/><path d=\"M10 21v-6h4v6\"/>";
|
|
23
|
-
readonly briefcase: "<rect x=\"3\" y=\"7\" width=\"18\" height=\"13\"/><path d=\"M9 7V4h6v3M3 12h18\"/>";
|
|
24
|
-
readonly folder: "<path d=\"M3 5h7l2 3h9v13H3z\"/><path d=\"M3 8h9\"/>";
|
|
25
|
-
readonly github: "<path d=\"M7 3h10l2 2v6l-2 3h-4l1 2v5h-4v-5l1-2H7l-2-3V5l2-2z\"/><path d=\"M9 8h1M14 8h1\"/>";
|
|
26
|
-
readonly linkedin: "<rect x=\"3\" y=\"3\" width=\"18\" height=\"18\"/><path d=\"M8 16v-5M8 8v.01M12 16v-5h2l2 2v3\"/>";
|
|
27
|
-
readonly language: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M3 12h18M12 3L8 12l4 9M12 3l4 9-4 9\"/>";
|
|
28
|
-
readonly 'color-swatch': "<rect x=\"3\" y=\"3\" width=\"8\" height=\"18\"/><path d=\"M7 17v.01\"/><path d=\"M11 19l8-8 2 2-8 8\"/><path d=\"M13 21h8\"/>";
|
|
29
|
-
};
|
|
30
|
-
export type IconName = keyof typeof BUILTIN_PATHS;
|
|
31
|
-
/**
|
|
32
|
-
* The curated built-in glyphs plus any runtime-registered ones.
|
|
33
|
-
* (`PATHS` is kept as the public name for backward compatibility.)
|
|
34
|
-
*/
|
|
35
|
-
export declare const PATHS: Record<string, string>;
|
|
36
|
-
/**
|
|
37
|
-
* Register (or override) a glyph at runtime so `<Icon name="foo" />` resolves
|
|
38
|
-
* raw SVG inner markup that isn't part of the curated {@link IconName} union.
|
|
39
|
-
* The markup is rendered verbatim inside the icon's `<svg viewBox="0 0 24 24">`.
|
|
40
|
-
*
|
|
41
|
-
* registerIcon('heart', '<path d="M12 21 4 13a5 5 0 0 1 7-7l1 1 1-1a5 5 0 0 1 7 7z"/>')
|
|
42
|
-
* <Icon name={'heart' as IconName} />
|
|
43
|
-
*/
|
|
44
|
-
export declare function registerIcon(name: string, paths: string): void;
|
|
45
|
-
/** Look a glyph up; built-ins first, then runtime registrations. */
|
|
46
|
-
export declare function resolveIcon(name: string): string | undefined;
|
|
1
|
+
export { PATHS, registerIcon, resolveIcon } from '../icons.js';
|
|
2
|
+
export type { IconName } from '../icons.js';
|
|
47
3
|
import { type Size } from '../config.js';
|
|
4
|
+
import { type IconName as GlyphName } from '../icons.js';
|
|
48
5
|
/**
|
|
49
6
|
* Icon-local size scale (DS-0109). Distinct from the global `Size` axis
|
|
50
7
|
* (`sm | md | lg`): Icon adds an `xs` (12px) dense step that has *no* global
|
|
@@ -53,7 +10,7 @@ import { type Size } from '../config.js';
|
|
|
53
10
|
*/
|
|
54
11
|
export type IconSize = 'xs' | Size;
|
|
55
12
|
interface Props {
|
|
56
|
-
name:
|
|
13
|
+
name: GlyphName;
|
|
57
14
|
/**
|
|
58
15
|
* Icon-local size (`xs | sm | md | lg`, a fixed px scale); inherits the
|
|
59
16
|
* active `--ss-icon` token when unset. `xs` (12px) is Icon-only and has no
|
|
@@ -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
|
}
|
|
@@ -424,10 +424,10 @@
|
|
|
424
424
|
width: var(--ss-s-2);
|
|
425
425
|
height: var(--ss-s-2);
|
|
426
426
|
background: var(--ss-primary);
|
|
427
|
-
animation: pulse var(--ss-dur-xslow) var(--ss-ease) infinite;
|
|
427
|
+
animation: ss-logs-pulse var(--ss-dur-xslow) var(--ss-ease) infinite;
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
-
@keyframes pulse {
|
|
430
|
+
@keyframes ss-logs-pulse {
|
|
431
431
|
0%, 100% {
|
|
432
432
|
opacity: 0.3;
|
|
433
433
|
}
|
|
@@ -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,17 +138,21 @@
|
|
|
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
|
}
|
|
148
152
|
.ss-metric .skeleton {
|
|
149
153
|
background: var(--ss-skeleton);
|
|
150
154
|
border-radius: var(--ss-radius-0);
|
|
151
|
-
animation: skeleton-pulse var(--ss-dur-xslow) var(--ss-ease) infinite alternate;
|
|
155
|
+
animation: ss-metric-skeleton-pulse var(--ss-dur-xslow) var(--ss-ease) infinite alternate;
|
|
152
156
|
}
|
|
153
157
|
.ss-metric .skeleton-val {
|
|
154
158
|
height: var(--ss-metric-val);
|
|
@@ -159,7 +163,7 @@
|
|
|
159
163
|
width: 35%;
|
|
160
164
|
}
|
|
161
165
|
|
|
162
|
-
@keyframes skeleton-pulse {
|
|
166
|
+
@keyframes ss-metric-skeleton-pulse {
|
|
163
167
|
from {
|
|
164
168
|
opacity: 1;
|
|
165
169
|
}
|
|
@@ -280,7 +280,7 @@ a.ss-svc:focus-visible,
|
|
|
280
280
|
inset: 0;
|
|
281
281
|
transform: translateX(-100%);
|
|
282
282
|
background: linear-gradient(90deg, transparent, var(--ss-hover), transparent);
|
|
283
|
-
animation:
|
|
283
|
+
animation: ss-svc-shimmer var(--ss-dur-xslow) var(--ss-ease) infinite;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
.sk-name {
|
|
@@ -304,7 +304,7 @@ a.ss-svc:focus-visible,
|
|
|
304
304
|
height: var(--ss-icon);
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
@keyframes
|
|
307
|
+
@keyframes ss-svc-shimmer {
|
|
308
308
|
100% {
|
|
309
309
|
transform: translateX(100%);
|
|
310
310
|
}
|
|
@@ -313,4 +313,7 @@ a.ss-svc:focus-visible,
|
|
|
313
313
|
.sk::after {
|
|
314
314
|
animation: none;
|
|
315
315
|
}
|
|
316
|
+
}
|
|
317
|
+
.ss-svc::before {
|
|
318
|
+
content: none;
|
|
316
319
|
}</style>
|
|
@@ -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. */
|
|
@@ -7,43 +7,16 @@
|
|
|
7
7
|
export { SPINNER_VARIANT_NAMES } from '../dssoca.config.js'
|
|
8
8
|
export type SpinnerVariant = SpinnerVariantName
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* No runtime fetch, no dependency — just data.
|
|
15
|
-
*
|
|
16
|
-
* The *variant names* are owned by `dssoca.config.ts` (`SpinnerVariant`,
|
|
17
|
-
* derived from the `spinner` manifest axis — DS-0108); this object holds the
|
|
18
|
-
* frame data and is pinned to that union via `satisfies Record<SpinnerVariant,
|
|
19
|
-
* …>`, so the two cannot drift.
|
|
20
|
-
*/
|
|
21
|
-
export interface SpinnerFrames {
|
|
22
|
-
/** Milliseconds between frames (cli-spinners' recommended cadence). */
|
|
23
|
-
interval: number
|
|
24
|
-
/** The glyph sequence, cycled in order. */
|
|
25
|
-
frames: readonly string[]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const SPINNER_VARIANTS = {
|
|
29
|
-
boxBounce2: { interval: 100, frames: ['▌', '▀', '▐', '▄'] },
|
|
30
|
-
boxBounce: { interval: 120, frames: ['▖', '▘', '▝', '▗'] },
|
|
31
|
-
squareCorners: { interval: 180, frames: ['◰', '◳', '◲', '◱'] },
|
|
32
|
-
toggle2: { interval: 80, frames: ['▫', '▪'] },
|
|
33
|
-
toggle3: { interval: 120, frames: ['□', '■'] },
|
|
34
|
-
toggle4: { interval: 100, frames: ['■', '□', '▪', '▫'] },
|
|
35
|
-
pipe: { interval: 100, frames: ['┤', '┘', '┴', '└', '├', '┌', '┬', '┐'] },
|
|
36
|
-
line: { interval: 130, frames: ['-', '\\', '|', '/'] },
|
|
37
|
-
growVertical: { interval: 120, frames: ['▁', '▃', '▄', '▅', '▆', '▇', '▆', '▅', '▄', '▃'] },
|
|
38
|
-
growHorizontal: {
|
|
39
|
-
interval: 120,
|
|
40
|
-
frames: ['▏', '▎', '▍', '▌', '▋', '▊', '▉', '▊', '▋', '▌', '▍', '▎'],
|
|
41
|
-
},
|
|
42
|
-
} as const satisfies Record<SpinnerVariantName, SpinnerFrames>
|
|
10
|
+
// Frame data lives in `../spinner-frames.ts` (DS-0148) so the vanilla CSS generator can
|
|
11
|
+
// share it without importing a .svelte file. Re-exported here for backward compatibility.
|
|
12
|
+
export { SPINNER_VARIANTS } from '../spinner-frames.js'
|
|
13
|
+
export type { SpinnerFrames } from '../spinner-frames.js'
|
|
43
14
|
</script>
|
|
44
15
|
|
|
45
16
|
<script lang="ts">
|
|
46
17
|
import { resolveComponentSize, resolveSpinnerVariant, type Size } from '../config.js'
|
|
18
|
+
// Aliased: the module script re-exports the same name (eslint-plugin-svelte merges scopes).
|
|
19
|
+
import { SPINNER_VARIANTS as VARIANTS } from '../spinner-frames.js'
|
|
47
20
|
|
|
48
21
|
interface Props {
|
|
49
22
|
/**
|
|
@@ -68,7 +41,7 @@
|
|
|
68
41
|
// An explicit `variant` prop wins; otherwise fall back to the configured
|
|
69
42
|
// house default (`spinnerVariant`, from the manifest) — DS-0108.
|
|
70
43
|
const resolvedVariant = $derived(resolveSpinnerVariant(variant))
|
|
71
|
-
const spinner = $derived(
|
|
44
|
+
const spinner = $derived(VARIANTS[resolvedVariant])
|
|
72
45
|
const interval = $derived(speed ?? spinner.interval)
|
|
73
46
|
const resolvedSize = $derived(resolveComponentSize('Spinner', size))
|
|
74
47
|
|