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
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
type ShortcutPlatform,
|
|
30
30
|
} from '../shortcuts.svelte.js'
|
|
31
31
|
import Kbd from './Kbd.svelte'
|
|
32
|
+
import Icon from './Icon.svelte'
|
|
32
33
|
|
|
33
34
|
interface Stat {
|
|
34
35
|
key: string
|
|
@@ -272,6 +273,8 @@
|
|
|
272
273
|
onclick={() => onCommand?.()}
|
|
273
274
|
>
|
|
274
275
|
<span class="kbd" aria-hidden="true"><Kbd keys="mod+k" {platform} {size} /></span>
|
|
276
|
+
<!-- DS-0157: the chip hides on keyboard-less devices; a search glyph keeps the tap target visible. -->
|
|
277
|
+
<span class="touch" aria-hidden="true"><Icon name="search" px={14} /></span>
|
|
275
278
|
</button>
|
|
276
279
|
{/if}
|
|
277
280
|
|
|
@@ -439,6 +442,16 @@
|
|
|
439
442
|
display: inline-flex;
|
|
440
443
|
align-items: center;
|
|
441
444
|
}
|
|
445
|
+
.ss-topbar .touch {
|
|
446
|
+
display: none;
|
|
447
|
+
align-items: center;
|
|
448
|
+
color: var(--ss-fg-muted);
|
|
449
|
+
}
|
|
450
|
+
@media (hover: none) and (pointer: coarse) {
|
|
451
|
+
.ss-topbar .touch {
|
|
452
|
+
display: inline-flex;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
442
455
|
@media (max-width: 720px) {
|
|
443
456
|
.ss-topbar .collapsible {
|
|
444
457
|
display: none;
|
|
@@ -448,4 +461,9 @@
|
|
|
448
461
|
.ss-topbar .ws {
|
|
449
462
|
display: none;
|
|
450
463
|
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.tab::before,
|
|
467
|
+
.skip::before {
|
|
468
|
+
content: none;
|
|
451
469
|
}</style>
|
package/dist/dssoca.config.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export interface Palette {
|
|
|
81
81
|
/** Size axis values — derived from the manifest (`'sm' | 'md' | 'lg'`). */
|
|
82
82
|
export type Size = (typeof dssocaConfig)['size']['values'][number];
|
|
83
83
|
/** Names of the components that accept a `size` prop / `componentsSize` entry. */
|
|
84
|
-
export declare const COMPONENT_NAMES: readonly ["Accordion", "Avatar", "Badge", "BottomNav", "Button", "Card", "Chart", "Container", "DateField", "EmptyState", "FileDrop", "Heading", "Icon", "Image", "Input", "Kbd", "Link", "LogStream", "Menu", "MetricTile", "Modal", "NumberField", "Pagination", "SearchPalette", "SegmentedControl", "Select", "ServiceCard", "Sidebar", "Sparkline", "Spinner", "Switch", "Table", "Textarea", "Toaster", "Tooltip", "Topbar"];
|
|
84
|
+
export declare const COMPONENT_NAMES: readonly ["Accordion", "Avatar", "Badge", "BottomNav", "Button", "Card", "Chart", "Container", "DateField", "EmptyState", "FileDrop", "Heading", "Icon", "Image", "Input", "Kbd", "Link", "LogStream", "Menu", "MetricTile", "Modal", "NumberField", "Pagination", "SearchPalette", "SegmentedControl", "Select", "ServiceCard", "Sidebar", "Sparkline", "Spinner", "Switch", "Table", "Textarea", "TierList", "Toaster", "Tooltip", "Topbar"];
|
|
85
85
|
export type ComponentName = (typeof COMPONENT_NAMES)[number];
|
|
86
86
|
/** Per-component default sizes; any omitted component inherits `sizeVariant`. */
|
|
87
87
|
export type ComponentsSize = Partial<Record<ComponentName, Size>>;
|
package/dist/dssoca.config.js
CHANGED
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon glyph table + runtime registry (DS-0148).
|
|
3
|
+
*
|
|
4
|
+
* Lives outside `Icon.svelte` so framework-free consumers (`dssoca/vanilla.js`) and node
|
|
5
|
+
* scripts can share the exact same paths as the Svelte component. `Icon.svelte` re-exports
|
|
6
|
+
* everything here, so existing imports from the component path keep working.
|
|
7
|
+
*/
|
|
8
|
+
/** Curated glyph set. `target`'s centre dot is a filled circle in the *outline*
|
|
9
|
+
* variant — handled by the `variant` switch in markup, not a per-glyph fill hack. */
|
|
10
|
+
declare const BUILTIN_PATHS: {
|
|
11
|
+
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\"/>";
|
|
12
|
+
readonly activity: "<path d=\"M3 12h4l3-8 4 16 3-8h4\"/>";
|
|
13
|
+
readonly database: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\"/><path d=\"M3 9h18M8 4v5\"/>";
|
|
14
|
+
readonly logs: "<path d=\"M4 6h16M4 12h16M4 18h10\"/>";
|
|
15
|
+
readonly terminal: "<rect x=\"3\" y=\"5\" width=\"18\" height=\"14\"/><path d=\"M3 9h18M7 14h4\"/>";
|
|
16
|
+
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\"/>";
|
|
17
|
+
readonly user: "<circle cx=\"12\" cy=\"8\" r=\"4\"/><path d=\"M4 21c0-4 4-7 8-7s8 3 8 7\"/>";
|
|
18
|
+
readonly arrow: "<path d=\"M5 12h14M13 5l7 7-7 7\"/>";
|
|
19
|
+
readonly chevron: "<path d=\"M8 10l4 4 4-4\"/>";
|
|
20
|
+
readonly external: "<path d=\"M7 17L17 7M9 7h8v8\"/>";
|
|
21
|
+
readonly film: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"16\"/><path d=\"M3 8h4M3 16h4M17 8h4M17 16h4M3 12h18\"/>";
|
|
22
|
+
readonly note: "<rect x=\"4\" y=\"3\" width=\"16\" height=\"18\"/><path d=\"M8 8h8M8 12h8M8 16h6\"/>";
|
|
23
|
+
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\"/>";
|
|
24
|
+
readonly check: "<path d=\"M5 12l4 4L19 6\"/>";
|
|
25
|
+
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\"/>";
|
|
26
|
+
readonly wallet: "<rect x=\"3\" y=\"6\" width=\"18\" height=\"14\"/><path d=\"M3 10h18M17 14h2\"/>";
|
|
27
|
+
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\"/>";
|
|
28
|
+
readonly spinner: "<path d=\"M12 3a9 9 0 1 0 9 9\" stroke-linecap=\"round\"/>";
|
|
29
|
+
readonly home: "<path d=\"M4 11l8-8 8 8\"/><path d=\"M6 9v12h12V9\"/><path d=\"M10 21v-6h4v6\"/>";
|
|
30
|
+
readonly briefcase: "<rect x=\"3\" y=\"7\" width=\"18\" height=\"13\"/><path d=\"M9 7V4h6v3M3 12h18\"/>";
|
|
31
|
+
readonly folder: "<path d=\"M3 5h7l2 3h9v13H3z\"/><path d=\"M3 8h9\"/>";
|
|
32
|
+
readonly github: "<path d=\"M7 3h10l2 2v6l-2 3h-4l1 2v5h-4v-5l1-2H7l-2-3V5l2-2z\"/><path d=\"M9 8h1M14 8h1\"/>";
|
|
33
|
+
readonly linkedin: "<rect x=\"3\" y=\"3\" width=\"18\" height=\"18\"/><path d=\"M8 16v-5M8 8v.01M12 16v-5h2l2 2v3\"/>";
|
|
34
|
+
readonly language: "<circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M3 12h18M12 3L8 12l4 9M12 3l4 9-4 9\"/>";
|
|
35
|
+
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\"/>";
|
|
36
|
+
readonly search: "<circle cx=\"10.5\" cy=\"10.5\" r=\"6.5\"/><path d=\"M15.5 15.5L21 21\"/>";
|
|
37
|
+
};
|
|
38
|
+
export type IconName = keyof typeof BUILTIN_PATHS;
|
|
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 declare const PATHS: Record<string, string>;
|
|
44
|
+
/**
|
|
45
|
+
* Register (or override) a glyph at runtime so `<Icon name="foo" />` resolves
|
|
46
|
+
* raw SVG inner markup that isn't part of the curated {@link IconName} union.
|
|
47
|
+
* The markup is rendered verbatim inside the icon's `<svg viewBox="0 0 24 24">`.
|
|
48
|
+
*
|
|
49
|
+
* registerIcon('heart', '<path d="M12 21 4 13a5 5 0 0 1 7-7l1 1 1-1a5 5 0 0 1 7 7z"/>')
|
|
50
|
+
* <Icon name={'heart' as IconName} />
|
|
51
|
+
*/
|
|
52
|
+
export declare function registerIcon(name: string, paths: string): void;
|
|
53
|
+
/** Look a glyph up; built-ins first, then runtime registrations. */
|
|
54
|
+
export declare function resolveIcon(name: string): string | undefined;
|
|
55
|
+
export {};
|
package/dist/icons.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon glyph table + runtime registry (DS-0148).
|
|
3
|
+
*
|
|
4
|
+
* Lives outside `Icon.svelte` so framework-free consumers (`dssoca/vanilla.js`) and node
|
|
5
|
+
* scripts can share the exact same paths as the Svelte component. `Icon.svelte` re-exports
|
|
6
|
+
* everything here, so existing imports from the component path keep working.
|
|
7
|
+
*/
|
|
8
|
+
/** Curated glyph set. `target`'s centre dot is a filled circle in the *outline*
|
|
9
|
+
* variant — handled by the `variant` switch in markup, not a per-glyph fill hack. */
|
|
10
|
+
const BUILTIN_PATHS = {
|
|
11
|
+
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"/>',
|
|
12
|
+
activity: '<path d="M3 12h4l3-8 4 16 3-8h4"/>',
|
|
13
|
+
database: '<rect x="3" y="4" width="18" height="16"/><path d="M3 9h18M8 4v5"/>',
|
|
14
|
+
logs: '<path d="M4 6h16M4 12h16M4 18h10"/>',
|
|
15
|
+
terminal: '<rect x="3" y="5" width="18" height="14"/><path d="M3 9h18M7 14h4"/>',
|
|
16
|
+
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"/>',
|
|
17
|
+
user: '<circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 4-7 8-7s8 3 8 7"/>',
|
|
18
|
+
arrow: '<path d="M5 12h14M13 5l7 7-7 7"/>',
|
|
19
|
+
chevron: '<path d="M8 10l4 4 4-4"/>',
|
|
20
|
+
external: '<path d="M7 17L17 7M9 7h8v8"/>',
|
|
21
|
+
film: '<rect x="3" y="4" width="18" height="16"/><path d="M3 8h4M3 16h4M17 8h4M17 16h4M3 12h18"/>',
|
|
22
|
+
note: '<rect x="4" y="3" width="16" height="18"/><path d="M8 8h8M8 12h8M8 16h6"/>',
|
|
23
|
+
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"/>',
|
|
24
|
+
check: '<path d="M5 12l4 4L19 6"/>',
|
|
25
|
+
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"/>',
|
|
26
|
+
wallet: '<rect x="3" y="6" width="18" height="14"/><path d="M3 10h18M17 14h2"/>',
|
|
27
|
+
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"/>',
|
|
28
|
+
spinner: '<path d="M12 3a9 9 0 1 0 9 9" stroke-linecap="round"/>',
|
|
29
|
+
home: '<path d="M4 11l8-8 8 8"/><path d="M6 9v12h12V9"/><path d="M10 21v-6h4v6"/>',
|
|
30
|
+
briefcase: '<rect x="3" y="7" width="18" height="13"/><path d="M9 7V4h6v3M3 12h18"/>',
|
|
31
|
+
folder: '<path d="M3 5h7l2 3h9v13H3z"/><path d="M3 8h9"/>',
|
|
32
|
+
github: '<path d="M7 3h10l2 2v6l-2 3h-4l1 2v5h-4v-5l1-2H7l-2-3V5l2-2z"/><path d="M9 8h1M14 8h1"/>',
|
|
33
|
+
linkedin: '<rect x="3" y="3" width="18" height="18"/><path d="M8 16v-5M8 8v.01M12 16v-5h2l2 2v3"/>',
|
|
34
|
+
language: '<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3L8 12l4 9M12 3l4 9-4 9"/>',
|
|
35
|
+
'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"/>',
|
|
36
|
+
search: '<circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.5 15.5L21 21"/>',
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The curated built-in glyphs plus any runtime-registered ones.
|
|
40
|
+
* (`PATHS` is kept as the public name for backward compatibility.)
|
|
41
|
+
*/
|
|
42
|
+
export const PATHS = { ...BUILTIN_PATHS };
|
|
43
|
+
/**
|
|
44
|
+
* Register (or override) a glyph at runtime so `<Icon name="foo" />` resolves
|
|
45
|
+
* raw SVG inner markup that isn't part of the curated {@link IconName} union.
|
|
46
|
+
* The markup is rendered verbatim inside the icon's `<svg viewBox="0 0 24 24">`.
|
|
47
|
+
*
|
|
48
|
+
* registerIcon('heart', '<path d="M12 21 4 13a5 5 0 0 1 7-7l1 1 1-1a5 5 0 0 1 7 7z"/>')
|
|
49
|
+
* <Icon name={'heart' as IconName} />
|
|
50
|
+
*/
|
|
51
|
+
export function registerIcon(name, paths) {
|
|
52
|
+
PATHS[name] = paths;
|
|
53
|
+
}
|
|
54
|
+
/** Look a glyph up; built-ins first, then runtime registrations. */
|
|
55
|
+
export function resolveIcon(name) {
|
|
56
|
+
return PATHS[name];
|
|
57
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ export { type ColorTheme, type Size, type DesignConfig, defaultDesignConfig, get
|
|
|
2
2
|
export { dssocaConfig, SPINNER_VARIANT_NAMES, PALETTE_SLOTS, type DssocaConfig, type DesignAxis, type ComponentName, type ComponentsSize, type SpinnerVariant, type Palette, type ThemePalette, type PaletteSlot, } from './dssoca.config.js';
|
|
3
3
|
export { CHART_PALETTE } from './palette.js';
|
|
4
4
|
export { PRESET_THEMES, presetPalette, type PresetTheme, type PresetName } from './presets.js';
|
|
5
|
-
export { default as Icon,
|
|
5
|
+
export { default as Icon, type IconSize } from './components/Icon.svelte';
|
|
6
|
+
export { registerIcon, type IconName } from './icons.js';
|
|
6
7
|
export { default as Badge } from './components/Badge.svelte';
|
|
7
8
|
export { default as Button } from './components/Button.svelte';
|
|
8
9
|
export { default as Input } from './components/Input.svelte';
|
|
@@ -26,8 +27,8 @@ export { default as Image, type ImageSource } from './components/Image.svelte';
|
|
|
26
27
|
export { default as Heading } from './components/Heading.svelte';
|
|
27
28
|
export { default as Container } from './components/Container.svelte';
|
|
28
29
|
export { default as Textarea } from './components/Textarea.svelte';
|
|
29
|
-
export { default as Spinner
|
|
30
|
-
export type
|
|
30
|
+
export { default as Spinner } from './components/Spinner.svelte';
|
|
31
|
+
export { SPINNER_VARIANTS, type SpinnerFrames } from './spinner-frames.js';
|
|
31
32
|
export { default as Chart, type ChartSeries, type ChartPoint } from './components/Chart.svelte';
|
|
32
33
|
export { default as Table, type TableColumn, type TableSort } from './components/Table.svelte';
|
|
33
34
|
export { default as Select } from './components/Select.svelte';
|
|
@@ -45,6 +46,8 @@ export { default as ScatterPlot, type ScatterPoint } from './components/ScatterP
|
|
|
45
46
|
export { default as BoxPlot, type BoxGroup } from './components/BoxPlot.svelte';
|
|
46
47
|
export { default as BumpChart, type BumpSeries } from './components/BumpChart.svelte';
|
|
47
48
|
export { default as Heatmap } from './components/Heatmap.svelte';
|
|
49
|
+
export { default as TierList } from './components/TierList.svelte';
|
|
50
|
+
export { DEFAULT_TIERS as TIERLIST_DEFAULT_TIERS, type TierListTier, type TierListItem, type TierListPlacements, } from './tierlist-core.js';
|
|
48
51
|
export { default as Kbd } from './components/Kbd.svelte';
|
|
49
52
|
export { default as ShortcutsHelp } from './components/ShortcutsHelp.svelte';
|
|
50
53
|
export { shortcuts, shortcut, formatShortcut, ariaKeyshortcuts, type ShortcutOptions, type ShortcutInfo, type ShortcutOverride, type ShortcutOverrides, type ShortcutScope, type ShortcutPlatform, type ShortcutFormat, type FormatShortcutOptions, } from './shortcuts.svelte.js';
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,8 @@ export { dssocaConfig, SPINNER_VARIANT_NAMES, PALETTE_SLOTS, } from './dssoca.co
|
|
|
4
4
|
export { CHART_PALETTE } from './palette.js';
|
|
5
5
|
// Preset terminal palettes (DS-0142): ready-made 19-slot themes.
|
|
6
6
|
export { PRESET_THEMES, presetPalette } from './presets.js';
|
|
7
|
-
export { default as Icon
|
|
7
|
+
export { default as Icon } from './components/Icon.svelte';
|
|
8
|
+
export { registerIcon } from './icons.js';
|
|
8
9
|
export { default as Badge } from './components/Badge.svelte';
|
|
9
10
|
export { default as Button } from './components/Button.svelte';
|
|
10
11
|
export { default as Input } from './components/Input.svelte';
|
|
@@ -32,7 +33,8 @@ export { default as Image } from './components/Image.svelte';
|
|
|
32
33
|
export { default as Heading } from './components/Heading.svelte';
|
|
33
34
|
export { default as Container } from './components/Container.svelte';
|
|
34
35
|
export { default as Textarea } from './components/Textarea.svelte';
|
|
35
|
-
export { default as Spinner
|
|
36
|
+
export { default as Spinner } from './components/Spinner.svelte';
|
|
37
|
+
export { SPINNER_VARIANTS } from './spinner-frames.js';
|
|
36
38
|
// geossoca component gaps (DS-0090).
|
|
37
39
|
export { default as Chart } from './components/Chart.svelte';
|
|
38
40
|
export { default as Table } from './components/Table.svelte';
|
|
@@ -51,6 +53,9 @@ export { default as ScatterPlot } from './components/ScatterPlot.svelte';
|
|
|
51
53
|
export { default as BoxPlot } from './components/BoxPlot.svelte';
|
|
52
54
|
export { default as BumpChart } from './components/BumpChart.svelte';
|
|
53
55
|
export { default as Heatmap } from './components/Heatmap.svelte';
|
|
56
|
+
// TierList (DS-0159): ranked rows + tray with pointer and keyboard sorting.
|
|
57
|
+
export { default as TierList } from './components/TierList.svelte';
|
|
58
|
+
export { DEFAULT_TIERS as TIERLIST_DEFAULT_TIERS, } from './tierlist-core.js';
|
|
54
59
|
// Keyboard-shortcuts feature (DS-0135): registry core + display chip.
|
|
55
60
|
export { default as Kbd } from './components/Kbd.svelte';
|
|
56
61
|
export { default as ShortcutsHelp } from './components/ShortcutsHelp.svelte';
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
* The *variant names* are owned by `dssoca.config.ts` (`SpinnerVariant`,
|
|
8
|
+
* derived from the `spinner` manifest axis — DS-0108); this object holds the
|
|
9
|
+
* frame data and is pinned to that union via `satisfies Record<SpinnerVariant,
|
|
10
|
+
* …>`, so the two cannot drift.
|
|
11
|
+
*/
|
|
12
|
+
export interface SpinnerFrames {
|
|
13
|
+
/** Milliseconds between frames (cli-spinners' recommended cadence). */
|
|
14
|
+
interval: number;
|
|
15
|
+
/** The glyph sequence, cycled in order. */
|
|
16
|
+
frames: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export declare const SPINNER_VARIANTS: {
|
|
19
|
+
readonly boxBounce2: {
|
|
20
|
+
readonly interval: 100;
|
|
21
|
+
readonly frames: readonly ["▌", "▀", "▐", "▄"];
|
|
22
|
+
};
|
|
23
|
+
readonly boxBounce: {
|
|
24
|
+
readonly interval: 120;
|
|
25
|
+
readonly frames: readonly ["▖", "▘", "▝", "▗"];
|
|
26
|
+
};
|
|
27
|
+
readonly squareCorners: {
|
|
28
|
+
readonly interval: 180;
|
|
29
|
+
readonly frames: readonly ["◰", "◳", "◲", "◱"];
|
|
30
|
+
};
|
|
31
|
+
readonly toggle2: {
|
|
32
|
+
readonly interval: 80;
|
|
33
|
+
readonly frames: readonly ["▫", "▪"];
|
|
34
|
+
};
|
|
35
|
+
readonly toggle3: {
|
|
36
|
+
readonly interval: 120;
|
|
37
|
+
readonly frames: readonly ["□", "■"];
|
|
38
|
+
};
|
|
39
|
+
readonly toggle4: {
|
|
40
|
+
readonly interval: 100;
|
|
41
|
+
readonly frames: readonly ["■", "□", "▪", "▫"];
|
|
42
|
+
};
|
|
43
|
+
readonly pipe: {
|
|
44
|
+
readonly interval: 100;
|
|
45
|
+
readonly frames: readonly ["┤", "┘", "┴", "└", "├", "┌", "┬", "┐"];
|
|
46
|
+
};
|
|
47
|
+
readonly line: {
|
|
48
|
+
readonly interval: 130;
|
|
49
|
+
readonly frames: readonly ["-", "\\", "|", "/"];
|
|
50
|
+
};
|
|
51
|
+
readonly growVertical: {
|
|
52
|
+
readonly interval: 120;
|
|
53
|
+
readonly frames: readonly ["▁", "▃", "▄", "▅", "▆", "▇", "▆", "▅", "▄", "▃"];
|
|
54
|
+
};
|
|
55
|
+
readonly growHorizontal: {
|
|
56
|
+
readonly interval: 120;
|
|
57
|
+
readonly frames: readonly ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "▊", "▋", "▌", "▍", "▎"];
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const SPINNER_VARIANTS = {
|
|
2
|
+
boxBounce2: { interval: 100, frames: ['▌', '▀', '▐', '▄'] },
|
|
3
|
+
boxBounce: { interval: 120, frames: ['▖', '▘', '▝', '▗'] },
|
|
4
|
+
squareCorners: { interval: 180, frames: ['◰', '◳', '◲', '◱'] },
|
|
5
|
+
toggle2: { interval: 80, frames: ['▫', '▪'] },
|
|
6
|
+
toggle3: { interval: 120, frames: ['□', '■'] },
|
|
7
|
+
toggle4: { interval: 100, frames: ['■', '□', '▪', '▫'] },
|
|
8
|
+
pipe: { interval: 100, frames: ['┤', '┘', '┴', '└', '├', '┌', '┬', '┐'] },
|
|
9
|
+
line: { interval: 130, frames: ['-', '\\', '|', '/'] },
|
|
10
|
+
growVertical: { interval: 120, frames: ['▁', '▃', '▄', '▅', '▆', '▇', '▆', '▅', '▄', '▃'] },
|
|
11
|
+
growHorizontal: {
|
|
12
|
+
interval: 120,
|
|
13
|
+
frames: ['▏', '▎', '▍', '▌', '▋', '▊', '▉', '▊', '▋', '▌', '▍', '▎'],
|
|
14
|
+
},
|
|
15
|
+
};
|
package/dist/theme.css
CHANGED
|
@@ -611,6 +611,31 @@
|
|
|
611
611
|
--ss-spinner-font: 22px;
|
|
612
612
|
}
|
|
613
613
|
|
|
614
|
+
:root,
|
|
615
|
+
[data-size-variant=md] {
|
|
616
|
+
--ss-tier-tile-w: 108px;
|
|
617
|
+
--ss-tier-tile-h: 108px;
|
|
618
|
+
--ss-tier-label-w: 44px;
|
|
619
|
+
--ss-tier-label-font: var(--ss-ui-lg);
|
|
620
|
+
--ss-tier-gap: 6px;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
[data-size-variant=sm] {
|
|
624
|
+
--ss-tier-tile-w: 84px;
|
|
625
|
+
--ss-tier-tile-h: 84px;
|
|
626
|
+
--ss-tier-label-w: 36px;
|
|
627
|
+
--ss-tier-label-font: var(--ss-ui-md);
|
|
628
|
+
--ss-tier-gap: var(--ss-s-1);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
[data-size-variant=lg] {
|
|
632
|
+
--ss-tier-tile-w: 132px;
|
|
633
|
+
--ss-tier-tile-h: 132px;
|
|
634
|
+
--ss-tier-label-w: 56px;
|
|
635
|
+
--ss-tier-label-font: var(--ss-size-h3);
|
|
636
|
+
--ss-tier-gap: var(--ss-s-2);
|
|
637
|
+
}
|
|
638
|
+
|
|
614
639
|
html {
|
|
615
640
|
font-family: var(--ss-font-body);
|
|
616
641
|
font-size: clamp(16px, 1vw + 12px, 20px);
|
|
@@ -916,33 +941,6 @@ pre {
|
|
|
916
941
|
margin-top: 6px;
|
|
917
942
|
}
|
|
918
943
|
|
|
919
|
-
.ss-table {
|
|
920
|
-
width: 100%;
|
|
921
|
-
border-collapse: collapse;
|
|
922
|
-
}
|
|
923
|
-
.ss-table th,
|
|
924
|
-
.ss-table td {
|
|
925
|
-
text-align: left;
|
|
926
|
-
padding: var(--ss-row-py) var(--ss-row-px);
|
|
927
|
-
font-size: var(--ss-ui-md);
|
|
928
|
-
border-bottom: 1px solid var(--ss-line);
|
|
929
|
-
font-family: var(--ss-font-mono);
|
|
930
|
-
}
|
|
931
|
-
.ss-table th {
|
|
932
|
-
font-size: var(--ss-ui-xs);
|
|
933
|
-
color: var(--ss-fg-faint);
|
|
934
|
-
text-transform: uppercase;
|
|
935
|
-
letter-spacing: 0.1em;
|
|
936
|
-
font-weight: 400;
|
|
937
|
-
padding: var(--ss-row-py) var(--ss-row-px);
|
|
938
|
-
}
|
|
939
|
-
.ss-table tr:hover td {
|
|
940
|
-
background: var(--ss-hover);
|
|
941
|
-
}
|
|
942
|
-
.ss-table .mono {
|
|
943
|
-
color: var(--ss-fg-muted);
|
|
944
|
-
}
|
|
945
|
-
|
|
946
944
|
.ss-footer {
|
|
947
945
|
margin-top: var(--ss-s-3);
|
|
948
946
|
padding-top: var(--ss-s-2);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TierList core (DS-0159) — the framework-free half of the component: the data model, the pure
|
|
3
|
+
* move/keyboard/hit-test math and the live-region wording. `TierList.svelte` and the plain-HTML
|
|
4
|
+
* behaviour (`vanilla/tierlist.ts`) both run on this module, so the two paths cannot drift.
|
|
5
|
+
* No DOM, no Svelte, no runes.
|
|
6
|
+
*/
|
|
7
|
+
/** A row of the list. `color` is any CSS colour (a token `var(--ss-…)` preferred). */
|
|
8
|
+
export interface TierListTier {
|
|
9
|
+
id: string;
|
|
10
|
+
/** Short row label — the "S", "A", "B" letter (or a word). */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Row accent; defaults to a palette slot by row index (see {@link tierColor}). */
|
|
13
|
+
color?: string;
|
|
14
|
+
}
|
|
15
|
+
/** A rankable item. `label` is the tile's accessible name and the default tile text. */
|
|
16
|
+
export interface TierListItem {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
}
|
|
20
|
+
/** Tier id → item ids in row order. Items in no tier sit in the unranked tray. */
|
|
21
|
+
export type TierListPlacements = Record<string, string[]>;
|
|
22
|
+
/** Internal zone map: every tier id plus the tray, each an ordered list of item ids. */
|
|
23
|
+
export type TierListZones = Record<string, string[]>;
|
|
24
|
+
/** Zone key of the unranked tray. Never a valid tier id. */
|
|
25
|
+
export declare const TRAY = "__tray__";
|
|
26
|
+
/** The classic five rows. */
|
|
27
|
+
export declare const DEFAULT_TIERS: readonly TierListTier[];
|
|
28
|
+
/**
|
|
29
|
+
* Default row accents by index: palette slots, never literals (DS-0125). The first five mirror
|
|
30
|
+
* the reference app (accent → cyan → yellow → muted → red); longer lists cycle through the rest.
|
|
31
|
+
*/
|
|
32
|
+
export declare const TIER_COLOR_VARS: readonly string[];
|
|
33
|
+
/** The CSS colour a row uses: its own `color`, else the slot for its index. */
|
|
34
|
+
export declare function tierColor(tier: Pick<TierListTier, 'color'>, index: number): string;
|
|
35
|
+
/**
|
|
36
|
+
* Build the zone map from props. Placement ids that name no item are dropped, an item placed
|
|
37
|
+
* in two tiers keeps its first placement, and everything unplaced goes to the tray — in the
|
|
38
|
+
* order the previous zones had it (so a tray reorder survives a re-render), then `items` order.
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildZones(tiers: readonly TierListTier[], items: readonly TierListItem[], placements?: TierListPlacements, previous?: TierListZones): TierListZones;
|
|
41
|
+
/** Where an item currently sits. `null` when it is in no zone. */
|
|
42
|
+
export declare function locate(zones: TierListZones, itemId: string): {
|
|
43
|
+
zone: string;
|
|
44
|
+
index: number;
|
|
45
|
+
} | null;
|
|
46
|
+
/**
|
|
47
|
+
* Move an item to `toZone` at `toIndex` (clamped to the zone's length, counted after the item
|
|
48
|
+
* has been lifted out). Returns the same object when nothing changes, so callers can compare
|
|
49
|
+
* by identity.
|
|
50
|
+
*/
|
|
51
|
+
export declare function moveItem(zones: TierListZones, itemId: string, toZone: string, toIndex: number): TierListZones;
|
|
52
|
+
/** The public placements: tiers only, in the given tier order; the tray is implicit. */
|
|
53
|
+
export declare function placementsOf(zones: TierListZones, tiers: readonly TierListTier[]): TierListPlacements;
|
|
54
|
+
export declare function zonesEqual(a: TierListZones, b: TierListZones): boolean;
|
|
55
|
+
export type TierListKeyMove = 'left' | 'right' | 'up' | 'down' | 'home' | 'end';
|
|
56
|
+
/**
|
|
57
|
+
* Keyboard sorting target: left/right step within the zone (wrapping is deliberately off —
|
|
58
|
+
* the edges are meaningful), home/end jump within it, up/down move to the neighbouring zone
|
|
59
|
+
* keeping the same position (clamped). `zoneOrder` is the visual order, tray last.
|
|
60
|
+
* Returns `null` when the move is impossible (already at the edge).
|
|
61
|
+
*/
|
|
62
|
+
export declare function keyboardTarget(zones: TierListZones, zoneOrder: readonly string[], itemId: string, move: TierListKeyMove): {
|
|
63
|
+
zone: string;
|
|
64
|
+
index: number;
|
|
65
|
+
} | null;
|
|
66
|
+
/** Axis-aligned box, as `getBoundingClientRect()` gives it. */
|
|
67
|
+
export interface Box {
|
|
68
|
+
left: number;
|
|
69
|
+
right: number;
|
|
70
|
+
top: number;
|
|
71
|
+
bottom: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Insertion index for a pointer at (x, y) among wrapped tiles: every tile whose row ends above
|
|
75
|
+
* the pointer counts as "before", and on the pointer's own row every tile whose centre is left
|
|
76
|
+
* of it. The dragged tile's own box must not be in `cells`.
|
|
77
|
+
*/
|
|
78
|
+
export declare function insertionIndex(cells: readonly Box[], x: number, y: number): number;
|
|
79
|
+
/** Copy for the polite live region — one sentence per step, position 1-based. */
|
|
80
|
+
export declare function announceText(kind: 'grab' | 'move' | 'drop' | 'cancel', d: {
|
|
81
|
+
label: string;
|
|
82
|
+
zone: string;
|
|
83
|
+
index: number;
|
|
84
|
+
count: number;
|
|
85
|
+
}): string;
|
|
86
|
+
/** Screen-reader instructions attached to every tile. */
|
|
87
|
+
export declare const TILE_INSTRUCTIONS = "Press Space to pick up the tile, then the arrow keys to move it between positions and tiers, Space again to drop it, or Escape to cancel.";
|