dssoca 0.16.0 → 0.17.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 +19 -0
- package/dist/components/Icon.svelte +9 -61
- package/dist/components/Icon.svelte.d.ts +4 -47
- package/dist/components/LogStream.svelte +2 -2
- package/dist/components/MetricTile.svelte +2 -2
- package/dist/components/ServiceCard.svelte +2 -2
- package/dist/components/Spinner.svelte +7 -34
- package/dist/components/Spinner.svelte.d.ts +2 -59
- package/dist/icons.d.ts +54 -0
- package/dist/icons.js +56 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -2
- package/dist/spinner-frames.d.ts +59 -0
- package/dist/spinner-frames.js +15 -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/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 +16 -0
- package/dist/vanilla/index.js +60 -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/toast.d.ts +37 -0
- package/dist/vanilla/toast.js +196 -0
- package/dist/vanilla/tooltip.d.ts +3 -0
- package/dist/vanilla/tooltip.js +54 -0
- package/dist/vanilla.css +4433 -0
- package/package.json +14 -5
package/README.md
CHANGED
|
@@ -75,6 +75,25 @@ 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.17/dist/theme.css" />
|
|
88
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dssoca@0.17/dist/vanilla.css" />
|
|
89
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/dssoca@0.17/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.
|
|
96
|
+
|
|
78
97
|
## What's in the box
|
|
79
98
|
|
|
80
99
|
**Components (23):** `Icon`, `Badge`, `Button`, `Input`, `Textarea`, `Card`, `Sparkline`,
|
|
@@ -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
|
|
@@ -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
|
}
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
.ss-metric .skeleton {
|
|
149
149
|
background: var(--ss-skeleton);
|
|
150
150
|
border-radius: var(--ss-radius-0);
|
|
151
|
-
animation: skeleton-pulse var(--ss-dur-xslow) var(--ss-ease) infinite alternate;
|
|
151
|
+
animation: ss-metric-skeleton-pulse var(--ss-dur-xslow) var(--ss-ease) infinite alternate;
|
|
152
152
|
}
|
|
153
153
|
.ss-metric .skeleton-val {
|
|
154
154
|
height: var(--ss-metric-val);
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
width: 35%;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
@keyframes skeleton-pulse {
|
|
162
|
+
@keyframes ss-metric-skeleton-pulse {
|
|
163
163
|
from {
|
|
164
164
|
opacity: 1;
|
|
165
165
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
|
|
@@ -1,65 +1,8 @@
|
|
|
1
1
|
import { type SpinnerVariant as SpinnerVariantName } from '../dssoca.config.js';
|
|
2
2
|
export { SPINNER_VARIANT_NAMES } from '../dssoca.config.js';
|
|
3
3
|
export type SpinnerVariant = SpinnerVariantName;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* sindresorhus/cli-spinners (MIT — https://github.com/sindresorhus/cli-spinners),
|
|
7
|
-
* curated for the squared/blocky glyphs that fit the DS's zero-radius look.
|
|
8
|
-
* No runtime fetch, no dependency — just data.
|
|
9
|
-
*
|
|
10
|
-
* The *variant names* are owned by `dssoca.config.ts` (`SpinnerVariant`,
|
|
11
|
-
* derived from the `spinner` manifest axis — DS-0108); this object holds the
|
|
12
|
-
* frame data and is pinned to that union via `satisfies Record<SpinnerVariant,
|
|
13
|
-
* …>`, so the two cannot drift.
|
|
14
|
-
*/
|
|
15
|
-
export interface SpinnerFrames {
|
|
16
|
-
/** Milliseconds between frames (cli-spinners' recommended cadence). */
|
|
17
|
-
interval: number;
|
|
18
|
-
/** The glyph sequence, cycled in order. */
|
|
19
|
-
frames: readonly string[];
|
|
20
|
-
}
|
|
21
|
-
export declare const SPINNER_VARIANTS: {
|
|
22
|
-
readonly boxBounce2: {
|
|
23
|
-
readonly interval: 100;
|
|
24
|
-
readonly frames: readonly ["▌", "▀", "▐", "▄"];
|
|
25
|
-
};
|
|
26
|
-
readonly boxBounce: {
|
|
27
|
-
readonly interval: 120;
|
|
28
|
-
readonly frames: readonly ["▖", "▘", "▝", "▗"];
|
|
29
|
-
};
|
|
30
|
-
readonly squareCorners: {
|
|
31
|
-
readonly interval: 180;
|
|
32
|
-
readonly frames: readonly ["◰", "◳", "◲", "◱"];
|
|
33
|
-
};
|
|
34
|
-
readonly toggle2: {
|
|
35
|
-
readonly interval: 80;
|
|
36
|
-
readonly frames: readonly ["▫", "▪"];
|
|
37
|
-
};
|
|
38
|
-
readonly toggle3: {
|
|
39
|
-
readonly interval: 120;
|
|
40
|
-
readonly frames: readonly ["□", "■"];
|
|
41
|
-
};
|
|
42
|
-
readonly toggle4: {
|
|
43
|
-
readonly interval: 100;
|
|
44
|
-
readonly frames: readonly ["■", "□", "▪", "▫"];
|
|
45
|
-
};
|
|
46
|
-
readonly pipe: {
|
|
47
|
-
readonly interval: 100;
|
|
48
|
-
readonly frames: readonly ["┤", "┘", "┴", "└", "├", "┌", "┬", "┐"];
|
|
49
|
-
};
|
|
50
|
-
readonly line: {
|
|
51
|
-
readonly interval: 130;
|
|
52
|
-
readonly frames: readonly ["-", "\\", "|", "/"];
|
|
53
|
-
};
|
|
54
|
-
readonly growVertical: {
|
|
55
|
-
readonly interval: 120;
|
|
56
|
-
readonly frames: readonly ["▁", "▃", "▄", "▅", "▆", "▇", "▆", "▅", "▄", "▃"];
|
|
57
|
-
};
|
|
58
|
-
readonly growHorizontal: {
|
|
59
|
-
readonly interval: 120;
|
|
60
|
-
readonly frames: readonly ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "▊", "▋", "▌", "▍", "▎"];
|
|
61
|
-
};
|
|
62
|
-
};
|
|
4
|
+
export { SPINNER_VARIANTS } from '../spinner-frames.js';
|
|
5
|
+
export type { SpinnerFrames } from '../spinner-frames.js';
|
|
63
6
|
import { type Size } from '../config.js';
|
|
64
7
|
interface Props {
|
|
65
8
|
/**
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
};
|
|
37
|
+
export type IconName = keyof typeof BUILTIN_PATHS;
|
|
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 declare const PATHS: Record<string, string>;
|
|
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 declare function registerIcon(name: string, paths: string): void;
|
|
52
|
+
/** Look a glyph up; built-ins first, then runtime registrations. */
|
|
53
|
+
export declare function resolveIcon(name: string): string | undefined;
|
|
54
|
+
export {};
|
package/dist/icons.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The curated built-in glyphs plus any runtime-registered ones.
|
|
39
|
+
* (`PATHS` is kept as the public name for backward compatibility.)
|
|
40
|
+
*/
|
|
41
|
+
export const PATHS = { ...BUILTIN_PATHS };
|
|
42
|
+
/**
|
|
43
|
+
* Register (or override) a glyph at runtime so `<Icon name="foo" />` resolves
|
|
44
|
+
* raw SVG inner markup that isn't part of the curated {@link IconName} union.
|
|
45
|
+
* The markup is rendered verbatim inside the icon's `<svg viewBox="0 0 24 24">`.
|
|
46
|
+
*
|
|
47
|
+
* registerIcon('heart', '<path d="M12 21 4 13a5 5 0 0 1 7-7l1 1 1-1a5 5 0 0 1 7 7z"/>')
|
|
48
|
+
* <Icon name={'heart' as IconName} />
|
|
49
|
+
*/
|
|
50
|
+
export function registerIcon(name, paths) {
|
|
51
|
+
PATHS[name] = paths;
|
|
52
|
+
}
|
|
53
|
+
/** Look a glyph up; built-ins first, then runtime registrations. */
|
|
54
|
+
export function resolveIcon(name) {
|
|
55
|
+
return PATHS[name];
|
|
56
|
+
}
|
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';
|
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';
|
|
@@ -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
|
+
};
|