dssoca 0.20.0 → 0.21.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 +3 -3
- package/dist/components/Accordion.svelte +23 -52
- package/dist/components/BottomNav.svelte +18 -28
- package/dist/components/BoxPlot.svelte +7 -6
- package/dist/components/BumpChart.svelte +9 -12
- package/dist/components/Chart.svelte +9 -12
- package/dist/components/Checkbox.svelte +210 -0
- package/dist/components/Checkbox.svelte.d.ts +38 -0
- package/dist/components/FileDrop.svelte +52 -83
- package/dist/components/FileDrop.svelte.d.ts +6 -2
- package/dist/components/Heatmap.svelte +8 -8
- package/dist/components/Image.svelte +44 -44
- package/dist/components/Input.svelte +8 -3
- package/dist/components/LogStream.svelte +15 -25
- package/dist/components/Menu.svelte +69 -94
- package/dist/components/Menu.svelte.d.ts +6 -0
- package/dist/components/Modal.svelte +61 -14
- package/dist/components/Modal.svelte.d.ts +7 -2
- package/dist/components/NumberField.svelte +18 -19
- package/dist/components/Pagination.svelte +47 -37
- package/dist/components/Pagination.svelte.d.ts +6 -2
- package/dist/components/Popover.svelte +247 -0
- package/dist/components/Popover.svelte.d.ts +36 -0
- package/dist/components/RadioGroup.svelte +227 -0
- package/dist/components/RadioGroup.svelte.d.ts +42 -0
- package/dist/components/ScatterPlot.svelte +11 -13
- package/dist/components/SearchPalette.svelte +124 -120
- package/dist/components/SearchPalette.svelte.d.ts +6 -4
- package/dist/components/SegmentedControl.svelte +41 -62
- package/dist/components/SegmentedControl.svelte.d.ts +7 -2
- package/dist/components/ShortcutsHelp.svelte +48 -47
- package/dist/components/Sidebar.svelte +48 -60
- package/dist/components/Switch.svelte +20 -10
- package/dist/components/Switch.svelte.d.ts +6 -2
- package/dist/components/Table.svelte +15 -37
- package/dist/components/Tabs.svelte +223 -0
- package/dist/components/Tabs.svelte.d.ts +51 -0
- package/dist/components/TierList.svelte +38 -38
- package/dist/components/TierList.svelte.d.ts +7 -3
- package/dist/components/Toaster.svelte +29 -29
- package/dist/components/Tooltip.svelte +37 -21
- package/dist/components/Topbar.svelte +13 -38
- package/dist/core/accordion.d.ts +32 -0
- package/dist/core/accordion.js +53 -0
- package/dist/core/behaviors/focusable.d.ts +5 -0
- package/dist/core/behaviors/focusable.js +14 -0
- package/dist/core/behaviors/roving.d.ts +13 -0
- package/dist/core/behaviors/roving.js +29 -0
- package/dist/core/bottom-nav.d.ts +36 -0
- package/dist/core/bottom-nav.js +33 -0
- package/dist/core/chart-nav.d.ts +53 -0
- package/dist/{chart-nav.js → core/chart-nav.js} +27 -0
- package/dist/core/checkbox.d.ts +36 -0
- package/dist/core/checkbox.js +29 -0
- package/dist/core/file-drop.d.ts +75 -0
- package/dist/core/file-drop.js +101 -0
- package/dist/core/image.d.ts +59 -0
- package/dist/core/image.js +64 -0
- package/dist/core/input.d.ts +21 -0
- package/dist/core/input.js +17 -0
- package/dist/core/log-stream.d.ts +51 -0
- package/dist/core/log-stream.js +50 -0
- package/dist/core/menu.d.ts +70 -0
- package/dist/core/menu.js +84 -0
- package/dist/core/modal.d.ts +59 -0
- package/dist/core/modal.js +44 -0
- package/dist/core/number-field.d.ts +47 -0
- package/dist/core/number-field.js +64 -0
- package/dist/core/pagination.d.ts +59 -0
- package/dist/core/pagination.js +65 -0
- package/dist/core/popover.d.ts +68 -0
- package/dist/core/popover.js +55 -0
- package/dist/core/radio.d.ts +36 -0
- package/dist/core/radio.js +48 -0
- package/dist/core/search-palette.d.ts +124 -0
- package/dist/core/search-palette.js +149 -0
- package/dist/core/segmented.d.ts +46 -0
- package/dist/core/segmented.js +66 -0
- package/dist/core/shortcuts-help.d.ts +56 -0
- package/dist/core/shortcuts-help.js +50 -0
- package/dist/core/sidebar.d.ts +63 -0
- package/dist/core/sidebar.js +84 -0
- package/dist/core/switch.d.ts +19 -0
- package/dist/core/switch.js +11 -0
- package/dist/core/table.d.ts +40 -0
- package/dist/core/table.js +57 -0
- package/dist/core/tabs.d.ts +84 -0
- package/dist/core/tabs.js +90 -0
- package/dist/{tierlist-core.d.ts → core/tierlist.d.ts} +62 -0
- package/dist/{tierlist-core.js → core/tierlist.js} +34 -0
- package/dist/core/toast.d.ts +112 -0
- package/dist/{toast-core.js → core/toast.js} +48 -2
- package/dist/core/tooltip.d.ts +47 -0
- package/dist/core/tooltip.js +51 -0
- package/dist/core/topbar.d.ts +41 -0
- package/dist/core/topbar.js +52 -0
- package/dist/dssoca.config.d.ts +1 -1
- package/dist/dssoca.config.js +4 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +9 -1
- package/dist/theme.css +47 -0
- package/dist/toast.svelte.d.ts +2 -2
- package/dist/toast.svelte.js +1 -1
- package/dist/tokens.css +47 -0
- package/dist/vanilla/accordion.js +28 -29
- package/dist/vanilla/checkbox.d.ts +8 -0
- package/dist/vanilla/checkbox.js +43 -0
- package/dist/vanilla/delegate.d.ts +2 -0
- package/dist/vanilla/delegate.js +9 -0
- package/dist/vanilla/fields.js +37 -32
- package/dist/vanilla/index.d.ts +4 -0
- package/dist/vanilla/index.js +16 -3
- package/dist/vanilla/menu.js +92 -86
- package/dist/vanilla/modal.d.ts +3 -1
- package/dist/vanilla/modal.js +65 -15
- package/dist/vanilla/popover.d.ts +10 -0
- package/dist/vanilla/popover.js +129 -0
- package/dist/vanilla/radio.d.ts +3 -0
- package/dist/vanilla/radio.js +54 -0
- package/dist/vanilla/segmented.js +49 -51
- package/dist/vanilla/switch.d.ts +2 -1
- package/dist/vanilla/switch.js +13 -8
- package/dist/vanilla/tabs.d.ts +2 -0
- package/dist/vanilla/tabs.js +87 -0
- package/dist/vanilla/tierlist.d.ts +1 -1
- package/dist/vanilla/tierlist.js +29 -25
- package/dist/vanilla/toast.d.ts +2 -2
- package/dist/vanilla/toast.js +16 -14
- package/dist/vanilla/tooltip.js +35 -23
- package/dist/vanilla.css +349 -42
- package/package.json +1 -1
- package/dist/chart-nav.d.ts +0 -13
- package/dist/toast-core.d.ts +0 -61
|
@@ -72,6 +72,68 @@ export declare function keyboardTarget(zones: TierListZones, zoneOrder: readonly
|
|
|
72
72
|
zone: string;
|
|
73
73
|
index: number;
|
|
74
74
|
} | null;
|
|
75
|
+
/** What committed the new order; passed to `onchange` / `ss:change`. */
|
|
76
|
+
export type TierListChangeReason = 'pointer' | 'keyboard';
|
|
77
|
+
export interface TierListChangeDetails {
|
|
78
|
+
reason: TierListChangeReason;
|
|
79
|
+
}
|
|
80
|
+
export interface TierListTileState {
|
|
81
|
+
/** The list is display only. */
|
|
82
|
+
readonly: boolean;
|
|
83
|
+
/** This tile is the one picked up with the keyboard. */
|
|
84
|
+
grabbed: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* How Enter activates a tile. `'callback'`: the caller runs its select handler. `'native'`:
|
|
87
|
+
* the key is left alone so the button's own click reaches the host. `'none'`: there is
|
|
88
|
+
* nothing to activate, so Enter picks the tile up like Space.
|
|
89
|
+
*/
|
|
90
|
+
select: 'callback' | 'native' | 'none';
|
|
91
|
+
/** The tile sits in a right-to-left layout (read from the DOM by the caller). */
|
|
92
|
+
rtl: boolean;
|
|
93
|
+
}
|
|
94
|
+
export type TierListKeyAction =
|
|
95
|
+
/** Pick the tile up, or drop it when it is the one picked up. */
|
|
96
|
+
{
|
|
97
|
+
type: 'toggle';
|
|
98
|
+
}
|
|
99
|
+
/** Activate the tile (a details view). */
|
|
100
|
+
| {
|
|
101
|
+
type: 'select';
|
|
102
|
+
}
|
|
103
|
+
/** Put the picked-up tile back where it came from, keeping focus on it. */
|
|
104
|
+
| {
|
|
105
|
+
type: 'cancel';
|
|
106
|
+
}
|
|
107
|
+
/** Step the picked-up tile; see {@link keyboardTarget} for where it lands. */
|
|
108
|
+
| {
|
|
109
|
+
type: 'move';
|
|
110
|
+
move: TierListKeyMove;
|
|
111
|
+
};
|
|
112
|
+
/** A key the tile handles: its action, and whether the browser default must be cancelled. */
|
|
113
|
+
export interface TierListKeyResult {
|
|
114
|
+
action: TierListKeyAction;
|
|
115
|
+
preventDefault: boolean;
|
|
116
|
+
}
|
|
117
|
+
/** A key on a tile. `null` = not a tier-list key (or a read-only list), let it through. */
|
|
118
|
+
export declare function tierListTileKey(state: TierListTileState, key: string): TierListKeyResult | null;
|
|
119
|
+
/** Pointer travel, in px, before a press on a tile becomes a drag. */
|
|
120
|
+
export declare const DRAG_THRESHOLD = 4;
|
|
121
|
+
export interface TierListPressState {
|
|
122
|
+
readonly: boolean;
|
|
123
|
+
/** `PointerEvent.button`; only the primary button drags. */
|
|
124
|
+
button: number;
|
|
125
|
+
/** A tile is picked up with the keyboard; the pointer must not start a second sort. */
|
|
126
|
+
grabbing: boolean;
|
|
127
|
+
}
|
|
128
|
+
/** Whether a press on a tile may turn into a drag. */
|
|
129
|
+
export declare function tierListPressArmsDrag(state: TierListPressState): boolean;
|
|
130
|
+
/** Whether the pointer has travelled far enough from the press for it to count as a drag. */
|
|
131
|
+
export declare function tierListDragStarts(dx: number, dy: number): boolean;
|
|
132
|
+
/** Whether a click on a tile activates it: not in a read-only list, not the click that ends a drag. */
|
|
133
|
+
export declare function tierListClickSelects(state: {
|
|
134
|
+
readonly: boolean;
|
|
135
|
+
afterDrag: boolean;
|
|
136
|
+
}): boolean;
|
|
75
137
|
/** Axis-aligned box, as `getBoundingClientRect()` gives it. */
|
|
76
138
|
export interface Box {
|
|
77
139
|
left: number;
|
|
@@ -171,6 +171,40 @@ export function keyboardTarget(zones, zoneOrder, itemId, move) {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
+
/** A key on a tile. `null` = not a tier-list key (or a read-only list), let it through. */
|
|
175
|
+
export function tierListTileKey(state, key) {
|
|
176
|
+
if (state.readonly)
|
|
177
|
+
return null;
|
|
178
|
+
const act = (action) => ({ action, preventDefault: true });
|
|
179
|
+
if (key === ' ')
|
|
180
|
+
return act({ type: 'toggle' });
|
|
181
|
+
if (key === 'Enter') {
|
|
182
|
+
if (state.select === 'none')
|
|
183
|
+
return act({ type: 'toggle' });
|
|
184
|
+
return state.select === 'callback' ? act({ type: 'select' }) : null;
|
|
185
|
+
}
|
|
186
|
+
// Everything below only means something while this tile is picked up.
|
|
187
|
+
if (!state.grabbed)
|
|
188
|
+
return null;
|
|
189
|
+
if (key === 'Escape')
|
|
190
|
+
return act({ type: 'cancel' });
|
|
191
|
+
const move = keyMoveFor(key, state.rtl);
|
|
192
|
+
return move ? act({ type: 'move', move }) : null;
|
|
193
|
+
}
|
|
194
|
+
/** Pointer travel, in px, before a press on a tile becomes a drag. */
|
|
195
|
+
export const DRAG_THRESHOLD = 4;
|
|
196
|
+
/** Whether a press on a tile may turn into a drag. */
|
|
197
|
+
export function tierListPressArmsDrag(state) {
|
|
198
|
+
return !state.readonly && state.button === 0 && !state.grabbing;
|
|
199
|
+
}
|
|
200
|
+
/** Whether the pointer has travelled far enough from the press for it to count as a drag. */
|
|
201
|
+
export function tierListDragStarts(dx, dy) {
|
|
202
|
+
return Math.hypot(dx, dy) >= DRAG_THRESHOLD;
|
|
203
|
+
}
|
|
204
|
+
/** Whether a click on a tile activates it: not in a read-only list, not the click that ends a drag. */
|
|
205
|
+
export function tierListClickSelects(state) {
|
|
206
|
+
return !state.readonly && !state.afterDrag;
|
|
207
|
+
}
|
|
174
208
|
/**
|
|
175
209
|
* Insertion index for a pointer at (x, y) among wrapped tiles: every tile whose row ends above
|
|
176
210
|
* the pointer counts as "before", and on the pointer's own row every tile whose centre is
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-free core of the toast system (DS-0148): types, per-kind defaults, the
|
|
3
|
+
* pause/resume timer and the decisions (dismiss key, hold, swipe, focus handover; DS-0197). Shared by the Svelte-runes store (`toast.svelte.ts`) and the vanilla
|
|
4
|
+
* DOM store (`vanilla/toast.ts`) so the two can never disagree on semantics.
|
|
5
|
+
*/
|
|
6
|
+
export type ToastKind = 'success' | 'error' | 'info' | 'loading';
|
|
7
|
+
/** An optional inline action rendered as a button inside the toast. */
|
|
8
|
+
export interface ToastAction {
|
|
9
|
+
label: string;
|
|
10
|
+
/**
|
|
11
|
+
* Invoked on click. Return `false` to keep the toast open (e.g. an async
|
|
12
|
+
* action that wants to swap itself for a result toast); any other return
|
|
13
|
+
* value dismisses the toast.
|
|
14
|
+
*/
|
|
15
|
+
onClick: () => void | false;
|
|
16
|
+
}
|
|
17
|
+
export interface Toast {
|
|
18
|
+
id: number;
|
|
19
|
+
kind: ToastKind;
|
|
20
|
+
message: string;
|
|
21
|
+
/** Effective auto-dismiss duration in ms; <= 0 / Infinity means sticky. */
|
|
22
|
+
timeout: number;
|
|
23
|
+
action?: ToastAction;
|
|
24
|
+
}
|
|
25
|
+
/** Fields a caller may set when pushing; the store fills in the rest. */
|
|
26
|
+
export interface ToastOptions {
|
|
27
|
+
timeout?: number;
|
|
28
|
+
action?: ToastAction;
|
|
29
|
+
}
|
|
30
|
+
/** A subset of a toast a caller may patch in-place via `update`. */
|
|
31
|
+
export type ToastPatch = Partial<Pick<Toast, 'kind' | 'message' | 'timeout' | 'action'>>;
|
|
32
|
+
/** Options for `toast.promise`. */
|
|
33
|
+
export interface PromiseMessages<T> {
|
|
34
|
+
loading: string;
|
|
35
|
+
success: string | ((value: T) => string);
|
|
36
|
+
error: string | ((err: unknown) => string);
|
|
37
|
+
}
|
|
38
|
+
/** Default auto-dismiss per kind. Errors linger; loading is sticky. */
|
|
39
|
+
export declare const DEFAULT_TIMEOUT: Record<ToastKind, number>;
|
|
40
|
+
/** Toasts carrying an action default to sticky so the action stays reachable. */
|
|
41
|
+
export declare const ACTION_TIMEOUT = 0;
|
|
42
|
+
/** Treat <= 0 or non-finite as sticky (never auto-dismiss). */
|
|
43
|
+
export declare function isSticky(timeout: number): boolean;
|
|
44
|
+
/** Effective timeout for a push: explicit > action-sticky > per-kind default. */
|
|
45
|
+
export declare function resolveTimeout(kind: ToastKind, opts?: ToastOptions): number;
|
|
46
|
+
/** Back-compat: the old push signature accepted a bare `timeout` number. */
|
|
47
|
+
export declare function normalizeOptions(opts?: ToastOptions | number): ToastOptions | undefined;
|
|
48
|
+
/** What a key on a toast does. */
|
|
49
|
+
export type ToastKeyAction = {
|
|
50
|
+
type: 'dismiss';
|
|
51
|
+
};
|
|
52
|
+
/** A key the toast handles, and whether it must stop there instead of reaching the page. */
|
|
53
|
+
export interface ToastKeyResult {
|
|
54
|
+
action: ToastKeyAction;
|
|
55
|
+
stopPropagation: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A key on a toast (or on a control inside it). Escape dismisses it and is kept from the
|
|
59
|
+
* surfaces behind (an open dialog must not close on the same press). `null` = let it through.
|
|
60
|
+
*/
|
|
61
|
+
export declare function toastKey(key: string): ToastKeyResult | null;
|
|
62
|
+
/** What currently holds a toast open. */
|
|
63
|
+
export interface ToastHoldState {
|
|
64
|
+
/** The pointer is over the toast. */
|
|
65
|
+
hovered: boolean;
|
|
66
|
+
/** Focus is on the toast or inside it. */
|
|
67
|
+
focused: boolean;
|
|
68
|
+
/** The toast is being swiped. */
|
|
69
|
+
dragging?: boolean;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Whether the auto-dismiss timer may run again. Hover, keyboard focus and a swipe each hold
|
|
73
|
+
* it: a pointer leaving must not restart the clock under a keyboard user, and vice versa.
|
|
74
|
+
*/
|
|
75
|
+
export declare function toastShouldResume(state: ToastHoldState): boolean;
|
|
76
|
+
/** Whether the toast goes away after its action ran: yes, unless the handler returned `false`. */
|
|
77
|
+
export declare function toastActionDismisses(result: void | false): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Where focus goes when the toast holding it is dismissed, so it never falls to `<body>`: the
|
|
80
|
+
* next toast in the stack, else the nearest one before it. `order` is the stack as it was with
|
|
81
|
+
* the dismissed toast still in it; `canTake` filters out toasts that cannot receive focus
|
|
82
|
+
* (already gone, not rendered). `null` = no toast left, hand focus back to where it came from.
|
|
83
|
+
*/
|
|
84
|
+
export declare function toastFocusAfterDismiss(order: readonly number[], id: number, canTake?: (id: number) => boolean): number | null;
|
|
85
|
+
/** Horizontal travel, in px, past which releasing a swiped toast dismisses it. */
|
|
86
|
+
export declare const SWIPE_THRESHOLD = 64;
|
|
87
|
+
export interface ToastPressState {
|
|
88
|
+
/** `PointerEvent.button`; only the primary button swipes. */
|
|
89
|
+
button: number;
|
|
90
|
+
/** The press landed on a button inside the toast (buttons own their clicks). */
|
|
91
|
+
onControl: boolean;
|
|
92
|
+
/** The user prefers reduced motion: no swipe, the buttons are the way to dismiss. */
|
|
93
|
+
reducedMotion: boolean;
|
|
94
|
+
}
|
|
95
|
+
/** Whether a press on a toast starts a swipe. */
|
|
96
|
+
export declare function toastPressStartsSwipe(state: ToastPressState): boolean;
|
|
97
|
+
/** Whether a swipe released after travelling `dx` px dismisses the toast (either direction). */
|
|
98
|
+
export declare function toastSwipeDismisses(dx: number): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Per-toast auto-dismiss controller. Tracks remaining time so the timer can be
|
|
101
|
+
* paused (on hover/focus) and resumed without losing or resetting the budget.
|
|
102
|
+
*/
|
|
103
|
+
export declare class ToastTimer {
|
|
104
|
+
#private;
|
|
105
|
+
constructor(timeout: number, fire: () => void);
|
|
106
|
+
get sticky(): boolean;
|
|
107
|
+
resume(): void;
|
|
108
|
+
pause(): void;
|
|
109
|
+
/** Re-arm with a fresh budget (used by `update`). */
|
|
110
|
+
reset(timeout: number): void;
|
|
111
|
+
cancel(): void;
|
|
112
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Framework-free core of the toast system (DS-0148): types, per-kind defaults
|
|
3
|
-
* pause/resume timer. Shared by the Svelte-runes store (`toast.svelte.ts`) and the vanilla
|
|
2
|
+
* Framework-free core of the toast system (DS-0148): types, per-kind defaults, the
|
|
3
|
+
* pause/resume timer and the decisions (dismiss key, hold, swipe, focus handover; DS-0197). Shared by the Svelte-runes store (`toast.svelte.ts`) and the vanilla
|
|
4
4
|
* DOM store (`vanilla/toast.ts`) so the two can never disagree on semantics.
|
|
5
5
|
*/
|
|
6
6
|
/** Default auto-dismiss per kind. Errors linger; loading is sticky. */
|
|
@@ -28,6 +28,52 @@ export function resolveTimeout(kind, opts) {
|
|
|
28
28
|
export function normalizeOptions(opts) {
|
|
29
29
|
return typeof opts === 'number' ? { timeout: opts } : opts;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* A key on a toast (or on a control inside it). Escape dismisses it and is kept from the
|
|
33
|
+
* surfaces behind (an open dialog must not close on the same press). `null` = let it through.
|
|
34
|
+
*/
|
|
35
|
+
export function toastKey(key) {
|
|
36
|
+
return key === 'Escape' ? { action: { type: 'dismiss' }, stopPropagation: true } : null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Whether the auto-dismiss timer may run again. Hover, keyboard focus and a swipe each hold
|
|
40
|
+
* it: a pointer leaving must not restart the clock under a keyboard user, and vice versa.
|
|
41
|
+
*/
|
|
42
|
+
export function toastShouldResume(state) {
|
|
43
|
+
return !state.hovered && !state.focused && !state.dragging;
|
|
44
|
+
}
|
|
45
|
+
/** Whether the toast goes away after its action ran: yes, unless the handler returned `false`. */
|
|
46
|
+
export function toastActionDismisses(result) {
|
|
47
|
+
return result !== false;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Where focus goes when the toast holding it is dismissed, so it never falls to `<body>`: the
|
|
51
|
+
* next toast in the stack, else the nearest one before it. `order` is the stack as it was with
|
|
52
|
+
* the dismissed toast still in it; `canTake` filters out toasts that cannot receive focus
|
|
53
|
+
* (already gone, not rendered). `null` = no toast left, hand focus back to where it came from.
|
|
54
|
+
*/
|
|
55
|
+
export function toastFocusAfterDismiss(order, id, canTake = () => true) {
|
|
56
|
+
const i = order.indexOf(id);
|
|
57
|
+
if (i === -1)
|
|
58
|
+
return null;
|
|
59
|
+
for (let n = i + 1; n < order.length; n++)
|
|
60
|
+
if (canTake(order[n]))
|
|
61
|
+
return order[n];
|
|
62
|
+
for (let n = i - 1; n >= 0; n--)
|
|
63
|
+
if (canTake(order[n]))
|
|
64
|
+
return order[n];
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
/** Horizontal travel, in px, past which releasing a swiped toast dismisses it. */
|
|
68
|
+
export const SWIPE_THRESHOLD = 64;
|
|
69
|
+
/** Whether a press on a toast starts a swipe. */
|
|
70
|
+
export function toastPressStartsSwipe(state) {
|
|
71
|
+
return !state.reducedMotion && state.button === 0 && !state.onControl;
|
|
72
|
+
}
|
|
73
|
+
/** Whether a swipe released after travelling `dx` px dismisses the toast (either direction). */
|
|
74
|
+
export function toastSwipeDismisses(dx) {
|
|
75
|
+
return Math.abs(dx) >= SWIPE_THRESHOLD;
|
|
76
|
+
}
|
|
31
77
|
const hasWindow = typeof window !== 'undefined';
|
|
32
78
|
/**
|
|
33
79
|
* Per-toast auto-dismiss controller. Tracks remaining time so the timer can be
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip core (DS-0197) — which event shows or hides the tip, shared by Tooltip.svelte and
|
|
3
|
+
* `vanilla/tooltip.ts`. It encodes WCAG 1.4.13 (Content on Hover or Focus):
|
|
4
|
+
*
|
|
5
|
+
* - dismissable: Escape hides an open tip wherever focus is;
|
|
6
|
+
* - hoverable: the tip is part of the tooltip root, so a pointer or focus move that stays
|
|
7
|
+
* `within` the root never hides it;
|
|
8
|
+
* - persistent: nothing here hides on a timer; the tip stays until the pointer leaves, focus
|
|
9
|
+
* leaves or Escape is pressed.
|
|
10
|
+
*
|
|
11
|
+
* Positioning and the DOM writes stay in the adapters. No DOM, no Svelte.
|
|
12
|
+
*/
|
|
13
|
+
export interface TooltipState {
|
|
14
|
+
open: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type TooltipAction = {
|
|
17
|
+
type: 'show';
|
|
18
|
+
} | {
|
|
19
|
+
type: 'hide';
|
|
20
|
+
};
|
|
21
|
+
/** Where the pointer or focus came from / is going to. */
|
|
22
|
+
export interface TooltipMove {
|
|
23
|
+
/** The other end of the move is inside the tooltip root (trigger or tip). */
|
|
24
|
+
within: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The pointer entered the root. Shows even when already open, so the adapter re-resolves which
|
|
28
|
+
* element the tip describes.
|
|
29
|
+
*/
|
|
30
|
+
export declare function tooltipPointerEnter(_state: TooltipState, from?: TooltipMove): TooltipAction | null;
|
|
31
|
+
/** The pointer left the root. Moving between the trigger and the tip is not leaving. */
|
|
32
|
+
export declare function tooltipPointerLeave(state: TooltipState, to?: TooltipMove): TooltipAction | null;
|
|
33
|
+
/** Focus landed inside the root: show, describing the element that took focus. */
|
|
34
|
+
export declare function tooltipFocusIn(_state: TooltipState): TooltipAction | null;
|
|
35
|
+
/** Focus left an element of the root. Moving to another element inside it is not leaving. */
|
|
36
|
+
export declare function tooltipFocusOut(state: TooltipState, to?: TooltipMove): TooltipAction | null;
|
|
37
|
+
/**
|
|
38
|
+
* A key pressed anywhere in the document. Escape hides an open tip; the event is left alone
|
|
39
|
+
* (never cancelled), so an enclosing dialog or menu still sees it. `null` = not a tooltip key.
|
|
40
|
+
*/
|
|
41
|
+
export declare function tooltipKey(state: TooltipState, key: string): TooltipAction | null;
|
|
42
|
+
/**
|
|
43
|
+
* The `aria-describedby` value of the described element: the tip id is added as one token while
|
|
44
|
+
* open and removed while closed, keeping any description the element already has. `undefined` =
|
|
45
|
+
* remove the attribute.
|
|
46
|
+
*/
|
|
47
|
+
export declare function tooltipDescribedBy(current: string | null | undefined, tipId: string, open: boolean): string | undefined;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip core (DS-0197) — which event shows or hides the tip, shared by Tooltip.svelte and
|
|
3
|
+
* `vanilla/tooltip.ts`. It encodes WCAG 1.4.13 (Content on Hover or Focus):
|
|
4
|
+
*
|
|
5
|
+
* - dismissable: Escape hides an open tip wherever focus is;
|
|
6
|
+
* - hoverable: the tip is part of the tooltip root, so a pointer or focus move that stays
|
|
7
|
+
* `within` the root never hides it;
|
|
8
|
+
* - persistent: nothing here hides on a timer; the tip stays until the pointer leaves, focus
|
|
9
|
+
* leaves or Escape is pressed.
|
|
10
|
+
*
|
|
11
|
+
* Positioning and the DOM writes stay in the adapters. No DOM, no Svelte.
|
|
12
|
+
*/
|
|
13
|
+
const OUTSIDE = { within: false };
|
|
14
|
+
const hide = (state) => (state.open ? { type: 'hide' } : null);
|
|
15
|
+
/**
|
|
16
|
+
* The pointer entered the root. Shows even when already open, so the adapter re-resolves which
|
|
17
|
+
* element the tip describes.
|
|
18
|
+
*/
|
|
19
|
+
export function tooltipPointerEnter(_state, from = OUTSIDE) {
|
|
20
|
+
return from.within ? null : { type: 'show' };
|
|
21
|
+
}
|
|
22
|
+
/** The pointer left the root. Moving between the trigger and the tip is not leaving. */
|
|
23
|
+
export function tooltipPointerLeave(state, to = OUTSIDE) {
|
|
24
|
+
return to.within ? null : hide(state);
|
|
25
|
+
}
|
|
26
|
+
/** Focus landed inside the root: show, describing the element that took focus. */
|
|
27
|
+
export function tooltipFocusIn(_state) {
|
|
28
|
+
return { type: 'show' };
|
|
29
|
+
}
|
|
30
|
+
/** Focus left an element of the root. Moving to another element inside it is not leaving. */
|
|
31
|
+
export function tooltipFocusOut(state, to = OUTSIDE) {
|
|
32
|
+
return to.within ? null : hide(state);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A key pressed anywhere in the document. Escape hides an open tip; the event is left alone
|
|
36
|
+
* (never cancelled), so an enclosing dialog or menu still sees it. `null` = not a tooltip key.
|
|
37
|
+
*/
|
|
38
|
+
export function tooltipKey(state, key) {
|
|
39
|
+
return key === 'Escape' ? hide(state) : null;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The `aria-describedby` value of the described element: the tip id is added as one token while
|
|
43
|
+
* open and removed while closed, keeping any description the element already has. `undefined` =
|
|
44
|
+
* remove the attribute.
|
|
45
|
+
*/
|
|
46
|
+
export function tooltipDescribedBy(current, tipId, open) {
|
|
47
|
+
const ids = (current ?? '').split(/\s+/).filter((id) => id && id !== tipId);
|
|
48
|
+
if (open)
|
|
49
|
+
ids.push(tipId);
|
|
50
|
+
return ids.length ? ids.join(' ') : undefined;
|
|
51
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** A tab as the consumer passes it: a plain string (id = label) or an object. */
|
|
2
|
+
export type TopbarTabInput = string | {
|
|
3
|
+
id: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
};
|
|
7
|
+
/** One normalized tab. */
|
|
8
|
+
export interface TopbarTabItem {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
href?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Normalize both tab shapes: string tabs keep id === label, object tabs default `label` to `id`. */
|
|
14
|
+
export declare function topbarTabs(tabs: readonly TopbarTabInput[]): TopbarTabItem[];
|
|
15
|
+
/**
|
|
16
|
+
* The roving tab stop: the active tab, or — when `active` matches no tab — the first button
|
|
17
|
+
* tab, so the strip stays reachable by Tab. `-1` when there is neither.
|
|
18
|
+
*/
|
|
19
|
+
export declare function topbarRovingIndex(tabs: readonly TopbarTabItem[], active: string | undefined): number;
|
|
20
|
+
/**
|
|
21
|
+
* `tabindex` for a tab. Button tabs rove (one tab stop); link tabs return `undefined` and stay
|
|
22
|
+
* in the natural tab order, so they remain keyboard-reachable without JS.
|
|
23
|
+
*/
|
|
24
|
+
export declare function topbarTabTabindex(tab: TopbarTabItem, index: number, rovingIndex: number): 0 | -1 | undefined;
|
|
25
|
+
/** A key the tab strip handles: its action, and whether the browser default must be cancelled. */
|
|
26
|
+
export interface TopbarKeyResult {
|
|
27
|
+
action: {
|
|
28
|
+
type: 'focus';
|
|
29
|
+
index: number;
|
|
30
|
+
} | null;
|
|
31
|
+
preventDefault: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A key on tab `index` of `count` tabs: arrows move focus across the strip (wrapping), Home/End
|
|
35
|
+
* jump to the ends. `null` = not a tab-strip key, let it through.
|
|
36
|
+
*
|
|
37
|
+
* `rtl` = the strip's computed direction (the adapter reads it at keydown). The strip is laid
|
|
38
|
+
* out right-to-left there, so ArrowLeft points at the NEXT tab and ArrowRight at the previous
|
|
39
|
+
* one (DS-0204); Up/Down, Home and End stay logical.
|
|
40
|
+
*/
|
|
41
|
+
export declare function topbarTabKey(key: string, index: number, count: number, rtl?: boolean): TopbarKeyResult | null;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Topbar core (DS-0197) — the tab strip's decisions: the normalized tab list, which tab is the
|
|
3
|
+
* roving tab stop and where a key moves focus. Pure functions; Topbar.svelte owns the DOM focus
|
|
4
|
+
* call. No DOM, no Svelte.
|
|
5
|
+
*/
|
|
6
|
+
import { rovingStep, rovingTabindex } from './behaviors/roving.js';
|
|
7
|
+
/** Normalize both tab shapes: string tabs keep id === label, object tabs default `label` to `id`. */
|
|
8
|
+
export function topbarTabs(tabs) {
|
|
9
|
+
return tabs.map((t) => typeof t === 'string'
|
|
10
|
+
? { id: t, label: t }
|
|
11
|
+
: { id: t.id, label: t.label ?? t.id, href: t.href });
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The roving tab stop: the active tab, or — when `active` matches no tab — the first button
|
|
15
|
+
* tab, so the strip stays reachable by Tab. `-1` when there is neither.
|
|
16
|
+
*/
|
|
17
|
+
export function topbarRovingIndex(tabs, active) {
|
|
18
|
+
const i = tabs.findIndex((t) => t.id === active);
|
|
19
|
+
return i >= 0 ? i : tabs.findIndex((t) => !t.href);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* `tabindex` for a tab. Button tabs rove (one tab stop); link tabs return `undefined` and stay
|
|
23
|
+
* in the natural tab order, so they remain keyboard-reachable without JS.
|
|
24
|
+
*/
|
|
25
|
+
export function topbarTabTabindex(tab, index, rovingIndex) {
|
|
26
|
+
return tab.href ? undefined : rovingTabindex(index, rovingIndex);
|
|
27
|
+
}
|
|
28
|
+
const MOVES = {
|
|
29
|
+
ArrowRight: 'next',
|
|
30
|
+
ArrowDown: 'next',
|
|
31
|
+
ArrowLeft: 'prev',
|
|
32
|
+
ArrowUp: 'prev',
|
|
33
|
+
Home: 'first',
|
|
34
|
+
End: 'last',
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A key on tab `index` of `count` tabs: arrows move focus across the strip (wrapping), Home/End
|
|
38
|
+
* jump to the ends. `null` = not a tab-strip key, let it through.
|
|
39
|
+
*
|
|
40
|
+
* `rtl` = the strip's computed direction (the adapter reads it at keydown). The strip is laid
|
|
41
|
+
* out right-to-left there, so ArrowLeft points at the NEXT tab and ArrowRight at the previous
|
|
42
|
+
* one (DS-0204); Up/Down, Home and End stay logical.
|
|
43
|
+
*/
|
|
44
|
+
export function topbarTabKey(key, index, count, rtl = false) {
|
|
45
|
+
if (!Object.hasOwn(MOVES, key))
|
|
46
|
+
return null;
|
|
47
|
+
const horizontal = key === 'ArrowLeft' || key === 'ArrowRight';
|
|
48
|
+
const move = rtl && horizontal ? (MOVES[key] === 'next' ? 'prev' : 'next') : MOVES[key];
|
|
49
|
+
const all = Array.from({ length: count }, (_, i) => i);
|
|
50
|
+
const target = rovingStep(all, index, move);
|
|
51
|
+
return { action: target >= 0 ? { type: 'focus', index: target } : null, preventDefault: true };
|
|
52
|
+
}
|
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", "TierList", "Toaster", "Tooltip", "Topbar"];
|
|
84
|
+
export declare const COMPONENT_NAMES: readonly ["Accordion", "Avatar", "Badge", "BottomNav", "Button", "Card", "Chart", "Checkbox", "Container", "DateField", "EmptyState", "FileDrop", "Heading", "Icon", "Image", "Input", "Kbd", "Link", "LogStream", "Menu", "MetricTile", "Modal", "NumberField", "Pagination", "Popover", "RadioGroup", "SearchPalette", "SegmentedControl", "Select", "ServiceCard", "Sidebar", "Sparkline", "Spinner", "Switch", "Table", "Tabs", "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
|
@@ -77,6 +77,7 @@ export const COMPONENT_NAMES = [
|
|
|
77
77
|
'Button',
|
|
78
78
|
'Card',
|
|
79
79
|
'Chart',
|
|
80
|
+
'Checkbox',
|
|
80
81
|
'Container',
|
|
81
82
|
'DateField',
|
|
82
83
|
'EmptyState',
|
|
@@ -93,6 +94,8 @@ export const COMPONENT_NAMES = [
|
|
|
93
94
|
'Modal',
|
|
94
95
|
'NumberField',
|
|
95
96
|
'Pagination',
|
|
97
|
+
'Popover',
|
|
98
|
+
'RadioGroup',
|
|
96
99
|
'SearchPalette',
|
|
97
100
|
'SegmentedControl',
|
|
98
101
|
'Select',
|
|
@@ -102,6 +105,7 @@ export const COMPONENT_NAMES = [
|
|
|
102
105
|
'Spinner',
|
|
103
106
|
'Switch',
|
|
104
107
|
'Table',
|
|
108
|
+
'Tabs',
|
|
105
109
|
'Textarea',
|
|
106
110
|
'TierList',
|
|
107
111
|
'Toaster',
|
package/dist/index.d.ts
CHANGED
|
@@ -19,9 +19,11 @@ export { default as LogStream, type LogLevel, type LogLine } from './components/
|
|
|
19
19
|
export { default as Toaster } from './components/Toaster.svelte';
|
|
20
20
|
export { default as EmptyState } from './components/EmptyState.svelte';
|
|
21
21
|
export { default as Menu, type MenuItem } from './components/Menu.svelte';
|
|
22
|
+
export type { MenuReason, MenuOpenChangeDetails } from './core/menu.js';
|
|
22
23
|
export { default as Accordion, type AccordionItem } from './components/Accordion.svelte';
|
|
23
24
|
export { default as Link } from './components/Link.svelte';
|
|
24
25
|
export { default as SegmentedControl, type SegmentOption, } from './components/SegmentedControl.svelte';
|
|
26
|
+
export type { SegmentedReason, SegmentedChangeDetails } from './core/segmented.js';
|
|
25
27
|
export { default as BottomNav, type BottomNavItem } from './components/BottomNav.svelte';
|
|
26
28
|
export { default as Image, type ImageSource } from './components/Image.svelte';
|
|
27
29
|
export { default as Heading } from './components/Heading.svelte';
|
|
@@ -34,20 +36,31 @@ export { default as Table, type TableColumn, type TableSort } from './components
|
|
|
34
36
|
export { default as Select } from './components/Select.svelte';
|
|
35
37
|
export type { SelectOption, SelectOptGroup } from './components/Select.svelte';
|
|
36
38
|
export { default as Modal } from './components/Modal.svelte';
|
|
39
|
+
export type { ModalReason, ModalCloseDetails } from './core/modal.js';
|
|
37
40
|
export { default as DateField } from './components/DateField.svelte';
|
|
38
41
|
export { default as FileDrop } from './components/FileDrop.svelte';
|
|
42
|
+
export type { FileDropReason, FileDropChangeDetails } from './core/file-drop.js';
|
|
39
43
|
export { default as NumberField } from './components/NumberField.svelte';
|
|
40
44
|
export { default as Tooltip } from './components/Tooltip.svelte';
|
|
41
45
|
export { default as Avatar } from './components/Avatar.svelte';
|
|
42
46
|
export { default as Pagination } from './components/Pagination.svelte';
|
|
47
|
+
export type { PaginationReason, PaginationChangeDetails } from './core/pagination.js';
|
|
43
48
|
export { default as Switch } from './components/Switch.svelte';
|
|
49
|
+
export type { SwitchReason, SwitchChangeDetails } from './core/switch.js';
|
|
44
50
|
export { default as SearchPalette, type SearchPaletteItem } from './components/SearchPalette.svelte';
|
|
51
|
+
export type { SearchPaletteReason, SearchPaletteOpenDetails } from './core/search-palette.js';
|
|
45
52
|
export { default as ScatterPlot, type ScatterPoint } from './components/ScatterPlot.svelte';
|
|
46
53
|
export { default as BoxPlot, type BoxGroup } from './components/BoxPlot.svelte';
|
|
47
54
|
export { default as BumpChart, type BumpSeries } from './components/BumpChart.svelte';
|
|
48
55
|
export { default as Heatmap } from './components/Heatmap.svelte';
|
|
49
56
|
export { default as TierList } from './components/TierList.svelte';
|
|
50
|
-
export { DEFAULT_TIERS as TIERLIST_DEFAULT_TIERS, type TierListTier, type TierListItem, type TierListPlacements, } from './tierlist
|
|
57
|
+
export { DEFAULT_TIERS as TIERLIST_DEFAULT_TIERS, type TierListTier, type TierListItem, type TierListPlacements, type TierListChangeDetails, type TierListChangeReason, } from './core/tierlist.js';
|
|
58
|
+
export { default as Checkbox } from './components/Checkbox.svelte';
|
|
59
|
+
export { default as RadioGroup, type RadioOption } from './components/RadioGroup.svelte';
|
|
60
|
+
export { default as Tabs, type TabItem } from './components/Tabs.svelte';
|
|
61
|
+
export type { TabsReason, TabsActivation, TabsChangeDetails } from './core/tabs.js';
|
|
62
|
+
export { default as Popover } from './components/Popover.svelte';
|
|
63
|
+
export type { PopoverReason, PopoverOpenChangeDetails } from './core/popover.js';
|
|
51
64
|
export { default as Kbd } from './components/Kbd.svelte';
|
|
52
65
|
export { default as ShortcutsHelp } from './components/ShortcutsHelp.svelte';
|
|
53
66
|
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
|
@@ -55,7 +55,15 @@ export { default as BumpChart } from './components/BumpChart.svelte';
|
|
|
55
55
|
export { default as Heatmap } from './components/Heatmap.svelte';
|
|
56
56
|
// TierList (DS-0159): ranked rows + tray with pointer and keyboard sorting.
|
|
57
57
|
export { default as TierList } from './components/TierList.svelte';
|
|
58
|
-
export { DEFAULT_TIERS as TIERLIST_DEFAULT_TIERS, } from './tierlist
|
|
58
|
+
export { DEFAULT_TIERS as TIERLIST_DEFAULT_TIERS, } from './core/tierlist.js';
|
|
59
|
+
// Checkbox (DS-0197): native checkbox with a mixed state.
|
|
60
|
+
export { default as Checkbox } from './components/Checkbox.svelte';
|
|
61
|
+
// RadioGroup (DS-0197): native radios in a named radiogroup.
|
|
62
|
+
export { default as RadioGroup } from './components/RadioGroup.svelte';
|
|
63
|
+
// Tabs (DS-0197): WAI-ARIA tablist + panels.
|
|
64
|
+
export { default as Tabs } from './components/Tabs.svelte';
|
|
65
|
+
// Popover (DS-0197): non-modal floating panel anchored to a trigger.
|
|
66
|
+
export { default as Popover } from './components/Popover.svelte';
|
|
59
67
|
// Keyboard-shortcuts feature (DS-0135): registry core + display chip.
|
|
60
68
|
export { default as Kbd } from './components/Kbd.svelte';
|
|
61
69
|
export { default as ShortcutsHelp } from './components/ShortcutsHelp.svelte';
|
package/dist/theme.css
CHANGED
|
@@ -636,6 +636,53 @@
|
|
|
636
636
|
--ss-tier-gap: var(--ss-s-2);
|
|
637
637
|
}
|
|
638
638
|
|
|
639
|
+
:root,
|
|
640
|
+
[data-size-variant=md] {
|
|
641
|
+
--ss-tabs-font: var(--ss-ui-md);
|
|
642
|
+
--ss-tabs-py: 9px;
|
|
643
|
+
--ss-tabs-px: 14px;
|
|
644
|
+
--ss-tabs-gap: 8px;
|
|
645
|
+
--ss-tabs-panel-py: 16px;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
[data-size-variant=sm] {
|
|
649
|
+
--ss-tabs-font: var(--ss-ui-sm);
|
|
650
|
+
--ss-tabs-py: 5px;
|
|
651
|
+
--ss-tabs-px: 10px;
|
|
652
|
+
--ss-tabs-gap: 6px;
|
|
653
|
+
--ss-tabs-panel-py: 10px;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
[data-size-variant=lg] {
|
|
657
|
+
--ss-tabs-font: var(--ss-ui-lg);
|
|
658
|
+
--ss-tabs-py: 12px;
|
|
659
|
+
--ss-tabs-px: 18px;
|
|
660
|
+
--ss-tabs-gap: 10px;
|
|
661
|
+
--ss-tabs-panel-py: 20px;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
:root,
|
|
665
|
+
[data-size-variant=md] {
|
|
666
|
+
--ss-popover-pad: 14px;
|
|
667
|
+
--ss-popover-min-w: 200px;
|
|
668
|
+
--ss-popover-max-w: 340px;
|
|
669
|
+
--ss-popover-offset: 6px;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
[data-size-variant=sm] {
|
|
673
|
+
--ss-popover-pad: 10px;
|
|
674
|
+
--ss-popover-min-w: 160px;
|
|
675
|
+
--ss-popover-max-w: 280px;
|
|
676
|
+
--ss-popover-offset: 5px;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
[data-size-variant=lg] {
|
|
680
|
+
--ss-popover-pad: 18px;
|
|
681
|
+
--ss-popover-min-w: 240px;
|
|
682
|
+
--ss-popover-max-w: 400px;
|
|
683
|
+
--ss-popover-offset: 8px;
|
|
684
|
+
}
|
|
685
|
+
|
|
639
686
|
html {
|
|
640
687
|
font-family: var(--ss-font-body);
|
|
641
688
|
font-size: clamp(16px, 1vw + 12px, 20px);
|
package/dist/toast.svelte.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Toast, type ToastKind, type ToastOptions, type ToastPatch, type PromiseMessages } from './toast
|
|
2
|
-
export type { Toast, ToastKind, ToastAction, ToastOptions, ToastPatch, PromiseMessages, } from './toast
|
|
1
|
+
import { type Toast, type ToastKind, type ToastOptions, type ToastPatch, type PromiseMessages } from './core/toast.js';
|
|
2
|
+
export type { Toast, ToastKind, ToastAction, ToastOptions, ToastPatch, PromiseMessages, } from './core/toast.js';
|
|
3
3
|
/**
|
|
4
4
|
* Module-singleton toast store (Svelte 5 runes). One instance is shared by
|
|
5
5
|
* every consumer of the package, so `toast.success(...)` from anywhere shows
|
package/dist/toast.svelte.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_TIMEOUT, isSticky, resolveTimeout, normalizeOptions, ToastTimer, } from './toast
|
|
1
|
+
import { DEFAULT_TIMEOUT, isSticky, resolveTimeout, normalizeOptions, ToastTimer, } from './core/toast.js';
|
|
2
2
|
/**
|
|
3
3
|
* Module-singleton toast store (Svelte 5 runes). One instance is shared by
|
|
4
4
|
* every consumer of the package, so `toast.success(...)` from anywhere shows
|