dssoca 0.17.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/dist/chart-nav.d.ts +13 -0
- package/dist/chart-nav.js +35 -0
- package/dist/components/Accordion.svelte +7 -2
- package/dist/components/Badge.svelte +12 -7
- package/dist/components/Badge.svelte.d.ts +2 -1
- package/dist/components/BottomNav.svelte +4 -0
- package/dist/components/BoxPlot.svelte +33 -7
- package/dist/components/BumpChart.svelte +68 -26
- package/dist/components/Button.svelte +23 -1
- package/dist/components/Button.svelte.d.ts +5 -1
- package/dist/components/Card.svelte +48 -15
- package/dist/components/Card.svelte.d.ts +10 -1
- package/dist/components/Chart.svelte +169 -32
- package/dist/components/Chart.svelte.d.ts +13 -1
- package/dist/components/DateField.svelte +1 -1
- package/dist/components/FileDrop.svelte +81 -14
- package/dist/components/FileDrop.svelte.d.ts +6 -0
- package/dist/components/Heatmap.svelte +128 -50
- package/dist/components/Heatmap.svelte.d.ts +2 -1
- package/dist/components/Icon.svelte +12 -3
- package/dist/components/Icon.svelte.d.ts +4 -0
- package/dist/components/Input.svelte +6 -3
- package/dist/components/Kbd.svelte +17 -1
- package/dist/components/Kbd.svelte.d.ts +9 -0
- package/dist/components/Link.svelte +25 -14
- package/dist/components/LogStream.svelte +34 -9
- package/dist/components/Menu.svelte +12 -8
- package/dist/components/Menu.svelte.d.ts +2 -2
- package/dist/components/MetricTile.svelte +16 -2
- package/dist/components/MetricTile.svelte.d.ts +6 -0
- package/dist/components/Modal.svelte +47 -7
- package/dist/components/Modal.svelte.d.ts +11 -3
- package/dist/components/NumberField.svelte +33 -10
- package/dist/components/Pagination.svelte +7 -4
- package/dist/components/ScatterPlot.svelte +44 -7
- package/dist/components/SearchPalette.svelte +102 -23
- package/dist/components/SearchPalette.svelte.d.ts +5 -0
- package/dist/components/SegmentedControl.svelte +14 -5
- package/dist/components/Select.svelte +3 -4
- package/dist/components/ServiceCard.svelte +108 -68
- package/dist/components/ServiceCard.svelte.d.ts +8 -3
- package/dist/components/ShortcutsHelp.svelte +3 -2
- package/dist/components/Sidebar.svelte +84 -59
- package/dist/components/Sidebar.svelte.d.ts +5 -0
- package/dist/components/Switch.svelte +4 -8
- package/dist/components/Table.svelte +20 -13
- package/dist/components/Table.svelte.d.ts +6 -2
- package/dist/components/Textarea.svelte +1 -1
- package/dist/components/TierList.svelte +598 -0
- package/dist/components/TierList.svelte.d.ts +37 -0
- package/dist/components/Toaster.svelte +144 -21
- package/dist/components/Tooltip.svelte +101 -13
- package/dist/components/Tooltip.svelte.d.ts +1 -1
- package/dist/components/Topbar.svelte +39 -16
- package/dist/dssoca.config.d.ts +1 -1
- package/dist/dssoca.config.js +1 -0
- package/dist/icons.d.ts +20 -2
- package/dist/icons.js +43 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -1
- package/dist/theme.css +25 -27
- package/dist/tierlist-core.d.ts +97 -0
- package/dist/tierlist-core.js +206 -0
- package/dist/tokens.css +25 -0
- package/dist/vanilla/accordion.js +7 -3
- package/dist/vanilla/fields.js +19 -6
- package/dist/vanilla/index.d.ts +2 -1
- package/dist/vanilla/index.js +7 -4
- package/dist/vanilla/menu.js +12 -1
- package/dist/vanilla/modal.d.ts +4 -0
- package/dist/vanilla/modal.js +57 -2
- package/dist/vanilla/segmented.js +13 -4
- package/dist/vanilla/tierlist.d.ts +8 -0
- package/dist/vanilla/tierlist.js +300 -0
- package/dist/vanilla/toast.d.ts +11 -3
- package/dist/vanilla/toast.js +125 -10
- package/dist/vanilla/tooltip.d.ts +5 -1
- package/dist/vanilla/tooltip.js +57 -10
- package/dist/vanilla.css +581 -158
- package/package.json +4 -1
package/dist/icons.js
CHANGED
|
@@ -33,16 +33,52 @@ const BUILTIN_PATHS = {
|
|
|
33
33
|
linkedin: '<rect x="3" y="3" width="18" height="18"/><path d="M8 16v-5M8 8v.01M12 16v-5h2l2 2v3"/>',
|
|
34
34
|
language: '<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3L8 12l4 9M12 3l4 9-4 9"/>',
|
|
35
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"/>',
|
|
36
37
|
};
|
|
37
38
|
/**
|
|
38
39
|
* The curated built-in glyphs plus any runtime-registered ones.
|
|
39
40
|
* (`PATHS` is kept as the public name for backward compatibility.)
|
|
40
41
|
*/
|
|
41
42
|
export const PATHS = { ...BUILTIN_PATHS };
|
|
43
|
+
// Light defence-in-depth pass for the raw-markup escape hatches (`registerIcon`, Icon's
|
|
44
|
+
// `paths`, DS-0176). Removes the obvious script vectors and nothing a glyph needs: drawing
|
|
45
|
+
// elements, their attributes, `<g>`/`<defs>`/`<use>`/`<style>` all pass through untouched.
|
|
46
|
+
const SCRIPT_BLOCK = /<script\b[\s\S]*?<\/script\s*>/gi;
|
|
47
|
+
const FOREIGN_BLOCK = /<foreignObject\b[\s\S]*?<\/foreignObject\s*>/gi;
|
|
48
|
+
const STRAY_TAG = /<\/?(?:script|foreignObject)\b[^>]*>/gi;
|
|
49
|
+
const EVENT_ATTR = /([\s/])on[a-z0-9_.:-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi;
|
|
50
|
+
const JS_URL_ATTR = /([\s/])((?:xlink:)?href)\s*=\s*(["']?)\s*javascript:[^"'\s>]*\3/gi;
|
|
51
|
+
/**
|
|
52
|
+
* Strip `<script>`, `<foreignObject>`, `on*` event-handler attributes and `javascript:`
|
|
53
|
+
* links from SVG inner markup. Repeats until stable so split-up payloads can't reassemble.
|
|
54
|
+
*
|
|
55
|
+
* This is a light filter, **not** a security boundary: a regex can't fully parse markup.
|
|
56
|
+
* Markup passed to `registerIcon` or Icon's `paths` must still be trusted (authored by you,
|
|
57
|
+
* never user input).
|
|
58
|
+
*/
|
|
59
|
+
export function sanitizeIconMarkup(markup) {
|
|
60
|
+
let prev;
|
|
61
|
+
let out = markup;
|
|
62
|
+
do {
|
|
63
|
+
prev = out;
|
|
64
|
+
out = out
|
|
65
|
+
.replace(SCRIPT_BLOCK, '')
|
|
66
|
+
.replace(FOREIGN_BLOCK, '')
|
|
67
|
+
.replace(STRAY_TAG, '')
|
|
68
|
+
.replace(EVENT_ATTR, '$1')
|
|
69
|
+
.replace(JS_URL_ATTR, '$1');
|
|
70
|
+
} while (out !== prev);
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
42
73
|
/**
|
|
43
74
|
* Register (or override) a glyph at runtime so `<Icon name="foo" />` resolves
|
|
44
75
|
* raw SVG inner markup that isn't part of the curated {@link IconName} union.
|
|
45
|
-
* The markup is rendered
|
|
76
|
+
* The markup is rendered inside the icon's `<svg viewBox="0 0 24 24">` after a light
|
|
77
|
+
* {@link sanitizeIconMarkup} pass.
|
|
78
|
+
*
|
|
79
|
+
* **Trust requirement:** `paths` is injected as HTML. Only pass markup you control (your own
|
|
80
|
+
* icon set, a vetted file); never user-supplied or third-party strings. The filter removes
|
|
81
|
+
* obvious script vectors but is not a substitute for that.
|
|
46
82
|
*
|
|
47
83
|
* registerIcon('heart', '<path d="M12 21 4 13a5 5 0 0 1 7-7l1 1 1-1a5 5 0 0 1 7 7z"/>')
|
|
48
84
|
* <Icon name={'heart' as IconName} />
|
|
@@ -50,7 +86,11 @@ export const PATHS = { ...BUILTIN_PATHS };
|
|
|
50
86
|
export function registerIcon(name, paths) {
|
|
51
87
|
PATHS[name] = paths;
|
|
52
88
|
}
|
|
53
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* Look a glyph up; built-ins first, then runtime registrations. Registered markup comes back
|
|
91
|
+
* through {@link sanitizeIconMarkup} (also covers direct writes to the public `PATHS` record).
|
|
92
|
+
*/
|
|
54
93
|
export function resolveIcon(name) {
|
|
55
|
-
|
|
94
|
+
const found = PATHS[name];
|
|
95
|
+
return found == null ? undefined : sanitizeIconMarkup(found);
|
|
56
96
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export { default as Container } from './components/Container.svelte';
|
|
|
29
29
|
export { default as Textarea } from './components/Textarea.svelte';
|
|
30
30
|
export { default as Spinner } from './components/Spinner.svelte';
|
|
31
31
|
export { SPINNER_VARIANTS, type SpinnerFrames } from './spinner-frames.js';
|
|
32
|
-
export { default as Chart, type ChartSeries, type ChartPoint } from './components/Chart.svelte';
|
|
32
|
+
export { default as Chart, type ChartSeries, type ChartPoint, CHART_DASH_CYCLE, } from './components/Chart.svelte';
|
|
33
33
|
export { default as Table, type TableColumn, type TableSort } from './components/Table.svelte';
|
|
34
34
|
export { default as Select } from './components/Select.svelte';
|
|
35
35
|
export type { SelectOption, SelectOptGroup } from './components/Select.svelte';
|
|
@@ -46,6 +46,8 @@ export { default as ScatterPlot, type ScatterPoint } from './components/ScatterP
|
|
|
46
46
|
export { default as BoxPlot, type BoxGroup } from './components/BoxPlot.svelte';
|
|
47
47
|
export { default as BumpChart, type BumpSeries } from './components/BumpChart.svelte';
|
|
48
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';
|
|
49
51
|
export { default as Kbd } from './components/Kbd.svelte';
|
|
50
52
|
export { default as ShortcutsHelp } from './components/ShortcutsHelp.svelte';
|
|
51
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
|
@@ -36,7 +36,7 @@ export { default as Textarea } from './components/Textarea.svelte';
|
|
|
36
36
|
export { default as Spinner } from './components/Spinner.svelte';
|
|
37
37
|
export { SPINNER_VARIANTS } from './spinner-frames.js';
|
|
38
38
|
// geossoca component gaps (DS-0090).
|
|
39
|
-
export { default as Chart } from './components/Chart.svelte';
|
|
39
|
+
export { default as Chart, CHART_DASH_CYCLE, } from './components/Chart.svelte';
|
|
40
40
|
export { default as Table } from './components/Table.svelte';
|
|
41
41
|
export { default as Select } from './components/Select.svelte';
|
|
42
42
|
export { default as Modal } from './components/Modal.svelte';
|
|
@@ -53,6 +53,9 @@ export { default as ScatterPlot } from './components/ScatterPlot.svelte';
|
|
|
53
53
|
export { default as BoxPlot } from './components/BoxPlot.svelte';
|
|
54
54
|
export { default as BumpChart } from './components/BumpChart.svelte';
|
|
55
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';
|
|
56
59
|
// Keyboard-shortcuts feature (DS-0135): registry core + display chip.
|
|
57
60
|
export { default as Kbd } from './components/Kbd.svelte';
|
|
58
61
|
export { default as ShortcutsHelp } from './components/ShortcutsHelp.svelte';
|
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,97 @@
|
|
|
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
|
+
/**
|
|
56
|
+
* A keyboard sorting step. `prev`/`next` are positions in the row's reading order, not screen
|
|
57
|
+
* directions — {@link keyMoveFor} maps the physical arrow keys onto them per writing direction.
|
|
58
|
+
*/
|
|
59
|
+
export type TierListKeyMove = 'prev' | 'next' | 'up' | 'down' | 'home' | 'end';
|
|
60
|
+
/**
|
|
61
|
+
* The sorting step a key stands for, or `undefined` for any other key. In a right-to-left
|
|
62
|
+
* layout the row reads right to left, so ArrowLeft steps *forward* and ArrowRight back.
|
|
63
|
+
*/
|
|
64
|
+
export declare function keyMoveFor(key: string, rtl?: boolean): TierListKeyMove | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Keyboard sorting target: prev/next step within the zone (wrapping is deliberately off —
|
|
67
|
+
* the edges are meaningful), home/end jump within it, up/down move to the neighbouring zone
|
|
68
|
+
* keeping the same position (clamped). `zoneOrder` is the visual order, tray last.
|
|
69
|
+
* Returns `null` when the move is impossible (already at the edge).
|
|
70
|
+
*/
|
|
71
|
+
export declare function keyboardTarget(zones: TierListZones, zoneOrder: readonly string[], itemId: string, move: TierListKeyMove): {
|
|
72
|
+
zone: string;
|
|
73
|
+
index: number;
|
|
74
|
+
} | null;
|
|
75
|
+
/** Axis-aligned box, as `getBoundingClientRect()` gives it. */
|
|
76
|
+
export interface Box {
|
|
77
|
+
left: number;
|
|
78
|
+
right: number;
|
|
79
|
+
top: number;
|
|
80
|
+
bottom: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Insertion index for a pointer at (x, y) among wrapped tiles: every tile whose row ends above
|
|
84
|
+
* the pointer counts as "before", and on the pointer's own row every tile whose centre is
|
|
85
|
+
* before it in reading order — left of it, or right of it when `rtl` (the row then flows right
|
|
86
|
+
* to left). The dragged tile's own box must not be in `cells`.
|
|
87
|
+
*/
|
|
88
|
+
export declare function insertionIndex(cells: readonly Box[], x: number, y: number, rtl?: boolean): number;
|
|
89
|
+
/** Copy for the polite live region — one sentence per step, position 1-based. */
|
|
90
|
+
export declare function announceText(kind: 'grab' | 'move' | 'drop' | 'cancel', d: {
|
|
91
|
+
label: string;
|
|
92
|
+
zone: string;
|
|
93
|
+
index: number;
|
|
94
|
+
count: number;
|
|
95
|
+
}): string;
|
|
96
|
+
/** Screen-reader instructions attached to every tile. */
|
|
97
|
+
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.";
|
|
@@ -0,0 +1,206 @@
|
|
|
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
|
+
/** Zone key of the unranked tray. Never a valid tier id. */
|
|
8
|
+
export const TRAY = '__tray__';
|
|
9
|
+
/** The classic five rows. */
|
|
10
|
+
export const DEFAULT_TIERS = Object.freeze([
|
|
11
|
+
{ id: 'S', label: 'S' },
|
|
12
|
+
{ id: 'A', label: 'A' },
|
|
13
|
+
{ id: 'B', label: 'B' },
|
|
14
|
+
{ id: 'C', label: 'C' },
|
|
15
|
+
{ id: 'D', label: 'D' },
|
|
16
|
+
]);
|
|
17
|
+
/**
|
|
18
|
+
* Default row accents by index: palette slots, never literals (DS-0125). The first five mirror
|
|
19
|
+
* the reference app (accent → cyan → yellow → muted → red); longer lists cycle through the rest.
|
|
20
|
+
*/
|
|
21
|
+
export const TIER_COLOR_VARS = Object.freeze([
|
|
22
|
+
'--ss-accent',
|
|
23
|
+
'--ss-cyan',
|
|
24
|
+
'--ss-yellow',
|
|
25
|
+
'--ss-fg-muted',
|
|
26
|
+
'--ss-red',
|
|
27
|
+
'--ss-blue',
|
|
28
|
+
'--ss-magenta',
|
|
29
|
+
'--ss-green',
|
|
30
|
+
]);
|
|
31
|
+
/** The CSS colour a row uses: its own `color`, else the slot for its index. */
|
|
32
|
+
export function tierColor(tier, index) {
|
|
33
|
+
return tier.color ?? `var(${TIER_COLOR_VARS[index % TIER_COLOR_VARS.length]})`;
|
|
34
|
+
}
|
|
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 function buildZones(tiers, items, placements, previous) {
|
|
41
|
+
const known = new Set(items.map((i) => i.id));
|
|
42
|
+
const placed = new Set();
|
|
43
|
+
const zones = {};
|
|
44
|
+
for (const tier of tiers) {
|
|
45
|
+
const ids = [];
|
|
46
|
+
for (const id of placements?.[tier.id] ?? []) {
|
|
47
|
+
if (!known.has(id) || placed.has(id))
|
|
48
|
+
continue;
|
|
49
|
+
placed.add(id);
|
|
50
|
+
ids.push(id);
|
|
51
|
+
}
|
|
52
|
+
zones[tier.id] = ids;
|
|
53
|
+
}
|
|
54
|
+
const tray = [];
|
|
55
|
+
for (const id of previous?.[TRAY] ?? []) {
|
|
56
|
+
if (known.has(id) && !placed.has(id)) {
|
|
57
|
+
placed.add(id);
|
|
58
|
+
tray.push(id);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
for (const item of items) {
|
|
62
|
+
if (!placed.has(item.id)) {
|
|
63
|
+
placed.add(item.id);
|
|
64
|
+
tray.push(item.id);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
zones[TRAY] = tray;
|
|
68
|
+
return zones;
|
|
69
|
+
}
|
|
70
|
+
/** Where an item currently sits. `null` when it is in no zone. */
|
|
71
|
+
export function locate(zones, itemId) {
|
|
72
|
+
for (const zone of Object.keys(zones)) {
|
|
73
|
+
const index = zones[zone].indexOf(itemId);
|
|
74
|
+
if (index >= 0)
|
|
75
|
+
return { zone, index };
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Move an item to `toZone` at `toIndex` (clamped to the zone's length, counted after the item
|
|
81
|
+
* has been lifted out). Returns the same object when nothing changes, so callers can compare
|
|
82
|
+
* by identity.
|
|
83
|
+
*/
|
|
84
|
+
export function moveItem(zones, itemId, toZone, toIndex) {
|
|
85
|
+
const from = locate(zones, itemId);
|
|
86
|
+
if (!from || !(toZone in zones))
|
|
87
|
+
return zones;
|
|
88
|
+
const lifted = zones[from.zone].filter((id) => id !== itemId);
|
|
89
|
+
const target = from.zone === toZone ? lifted : zones[toZone].slice();
|
|
90
|
+
const index = Math.max(0, Math.min(toIndex, target.length));
|
|
91
|
+
if (from.zone === toZone && index === from.index)
|
|
92
|
+
return zones;
|
|
93
|
+
target.splice(index, 0, itemId);
|
|
94
|
+
return {
|
|
95
|
+
...zones,
|
|
96
|
+
[from.zone]: from.zone === toZone ? target : lifted,
|
|
97
|
+
[toZone]: target,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/** The public placements: tiers only, in the given tier order; the tray is implicit. */
|
|
101
|
+
export function placementsOf(zones, tiers) {
|
|
102
|
+
const out = {};
|
|
103
|
+
for (const tier of tiers)
|
|
104
|
+
out[tier.id] = (zones[tier.id] ?? []).slice();
|
|
105
|
+
return out;
|
|
106
|
+
}
|
|
107
|
+
export function zonesEqual(a, b) {
|
|
108
|
+
const ka = Object.keys(a);
|
|
109
|
+
const kb = Object.keys(b);
|
|
110
|
+
if (ka.length !== kb.length)
|
|
111
|
+
return false;
|
|
112
|
+
for (const k of ka) {
|
|
113
|
+
const x = a[k];
|
|
114
|
+
const y = b[k];
|
|
115
|
+
if (!y || x.length !== y.length)
|
|
116
|
+
return false;
|
|
117
|
+
for (let i = 0; i < x.length; i++)
|
|
118
|
+
if (x[i] !== y[i])
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The sorting step a key stands for, or `undefined` for any other key. In a right-to-left
|
|
125
|
+
* layout the row reads right to left, so ArrowLeft steps *forward* and ArrowRight back.
|
|
126
|
+
*/
|
|
127
|
+
export function keyMoveFor(key, rtl = false) {
|
|
128
|
+
switch (key) {
|
|
129
|
+
case 'ArrowLeft':
|
|
130
|
+
return rtl ? 'next' : 'prev';
|
|
131
|
+
case 'ArrowRight':
|
|
132
|
+
return rtl ? 'prev' : 'next';
|
|
133
|
+
case 'ArrowUp':
|
|
134
|
+
return 'up';
|
|
135
|
+
case 'ArrowDown':
|
|
136
|
+
return 'down';
|
|
137
|
+
case 'Home':
|
|
138
|
+
return 'home';
|
|
139
|
+
case 'End':
|
|
140
|
+
return 'end';
|
|
141
|
+
}
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Keyboard sorting target: prev/next step within the zone (wrapping is deliberately off —
|
|
146
|
+
* the edges are meaningful), home/end jump within it, up/down move to the neighbouring zone
|
|
147
|
+
* keeping the same position (clamped). `zoneOrder` is the visual order, tray last.
|
|
148
|
+
* Returns `null` when the move is impossible (already at the edge).
|
|
149
|
+
*/
|
|
150
|
+
export function keyboardTarget(zones, zoneOrder, itemId, move) {
|
|
151
|
+
const at = locate(zones, itemId);
|
|
152
|
+
if (!at)
|
|
153
|
+
return null;
|
|
154
|
+
const len = zones[at.zone].length;
|
|
155
|
+
const zi = zoneOrder.indexOf(at.zone);
|
|
156
|
+
switch (move) {
|
|
157
|
+
case 'prev':
|
|
158
|
+
return at.index > 0 ? { zone: at.zone, index: at.index - 1 } : null;
|
|
159
|
+
case 'next':
|
|
160
|
+
return at.index < len - 1 ? { zone: at.zone, index: at.index + 1 } : null;
|
|
161
|
+
case 'home':
|
|
162
|
+
return at.index > 0 ? { zone: at.zone, index: 0 } : null;
|
|
163
|
+
case 'end':
|
|
164
|
+
return at.index < len - 1 ? { zone: at.zone, index: len - 1 } : null;
|
|
165
|
+
case 'up':
|
|
166
|
+
case 'down': {
|
|
167
|
+
const next = zoneOrder[zi + (move === 'up' ? -1 : 1)];
|
|
168
|
+
if (next === undefined)
|
|
169
|
+
return null;
|
|
170
|
+
return { zone: next, index: Math.min(at.index, zones[next].length) };
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Insertion index for a pointer at (x, y) among wrapped tiles: every tile whose row ends above
|
|
176
|
+
* the pointer counts as "before", and on the pointer's own row every tile whose centre is
|
|
177
|
+
* before it in reading order — left of it, or right of it when `rtl` (the row then flows right
|
|
178
|
+
* to left). The dragged tile's own box must not be in `cells`.
|
|
179
|
+
*/
|
|
180
|
+
export function insertionIndex(cells, x, y, rtl = false) {
|
|
181
|
+
let index = 0;
|
|
182
|
+
for (const c of cells) {
|
|
183
|
+
const centre = (c.left + c.right) / 2;
|
|
184
|
+
if (c.bottom <= y)
|
|
185
|
+
index++;
|
|
186
|
+
else if (c.top <= y && (rtl ? centre >= x : centre <= x))
|
|
187
|
+
index++;
|
|
188
|
+
}
|
|
189
|
+
return index;
|
|
190
|
+
}
|
|
191
|
+
/** Copy for the polite live region — one sentence per step, position 1-based. */
|
|
192
|
+
export function announceText(kind, d) {
|
|
193
|
+
const where = `${d.zone}, position ${d.index + 1} of ${d.count}`;
|
|
194
|
+
switch (kind) {
|
|
195
|
+
case 'grab':
|
|
196
|
+
return `Picked up ${d.label}, ${where}. Use the arrow keys to move it, Space to drop, Escape to cancel.`;
|
|
197
|
+
case 'move':
|
|
198
|
+
return `${d.label} moved to ${where}.`;
|
|
199
|
+
case 'drop':
|
|
200
|
+
return `Dropped ${d.label} in ${where}.`;
|
|
201
|
+
case 'cancel':
|
|
202
|
+
return `Cancelled. ${d.label} returned to ${where}.`;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/** Screen-reader instructions attached to every tile. */
|
|
206
|
+
export 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.';
|
package/dist/tokens.css
CHANGED
|
@@ -595,3 +595,28 @@
|
|
|
595
595
|
[data-size-variant=lg] {
|
|
596
596
|
--ss-spinner-font: 22px;
|
|
597
597
|
}
|
|
598
|
+
|
|
599
|
+
:root,
|
|
600
|
+
[data-size-variant=md] {
|
|
601
|
+
--ss-tier-tile-w: 108px;
|
|
602
|
+
--ss-tier-tile-h: 108px;
|
|
603
|
+
--ss-tier-label-w: 44px;
|
|
604
|
+
--ss-tier-label-font: var(--ss-ui-lg);
|
|
605
|
+
--ss-tier-gap: 6px;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
[data-size-variant=sm] {
|
|
609
|
+
--ss-tier-tile-w: 84px;
|
|
610
|
+
--ss-tier-tile-h: 84px;
|
|
611
|
+
--ss-tier-label-w: 36px;
|
|
612
|
+
--ss-tier-label-font: var(--ss-ui-md);
|
|
613
|
+
--ss-tier-gap: var(--ss-s-1);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
[data-size-variant=lg] {
|
|
617
|
+
--ss-tier-tile-w: 132px;
|
|
618
|
+
--ss-tier-tile-h: 132px;
|
|
619
|
+
--ss-tier-label-w: 56px;
|
|
620
|
+
--ss-tier-label-font: var(--ss-size-h3);
|
|
621
|
+
--ss-tier-gap: var(--ss-s-2);
|
|
622
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Accordion (DS-0148) — toggles `hidden` on the panel referenced by each header's
|
|
2
|
+
* Accordion (DS-0148) — toggles `hidden` + `inert` on the panel referenced by each header's
|
|
3
3
|
* `aria-controls`, mirroring Accordion.svelte: single-open by default (opening one closes the
|
|
4
4
|
* others), `data-ss-multiple` on the root allows several, Arrow/Home/End rove between headers.
|
|
5
5
|
* Emits `ss:change` on the root with `{ value }` (open ids: string | string[] | undefined).
|
|
@@ -10,8 +10,12 @@ function setOpen(head, open) {
|
|
|
10
10
|
head.setAttribute('aria-expanded', String(open));
|
|
11
11
|
head.closest('.item')?.classList.toggle('open', open);
|
|
12
12
|
const panel = byId(head.getAttribute('aria-controls'));
|
|
13
|
-
if (panel)
|
|
14
|
-
|
|
13
|
+
if (!panel)
|
|
14
|
+
return;
|
|
15
|
+
panel.hidden = !open;
|
|
16
|
+
// A closed panel keeps `display: grid` (so the collapse animates); `inert` keeps its content
|
|
17
|
+
// out of the Tab order and a11y tree, matching Accordion.svelte (DS-0162).
|
|
18
|
+
panel.toggleAttribute('inert', !open);
|
|
15
19
|
}
|
|
16
20
|
export function toggleAccordion(head) {
|
|
17
21
|
if (head.getAttribute('aria-disabled') === 'true')
|
package/dist/vanilla/fields.js
CHANGED
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
* - Input `clearable`: `.ss-field .clear` empties `.ss-input`, refocuses it and hides itself;
|
|
5
5
|
* typing shows it again (Input.svelte removes the button entirely — vanilla toggles `hidden`).
|
|
6
6
|
* - NumberField steppers: `.ss-numberfield .step.dec/.inc` nudge by `step`, clamped to
|
|
7
|
-
* `min`/`max
|
|
7
|
+
* `min`/`max` (same `nudge`/`clamp` as the component). At a bound a stepper becomes an
|
|
8
|
+
* `aria-disabled` no-op (still focusable, so focus never drops to <body>); it is natively
|
|
9
|
+
* `disabled` only when the input is disabled/readonly. Each nudge writes the new value to
|
|
10
|
+
* the field's polite `.live` region.
|
|
8
11
|
* - Textarea autosize: `.ss-textarea .field.autosize` grows with content. Browsers with
|
|
9
12
|
* `field-sizing: content` do it in CSS; the JS `scrollHeight` sync is the fallback.
|
|
10
13
|
*/
|
|
@@ -37,14 +40,21 @@ function syncSteppers(input) {
|
|
|
37
40
|
const locked = input.disabled || input.readOnly;
|
|
38
41
|
const dec = control.querySelector('.step.dec');
|
|
39
42
|
const inc = control.querySelector('.step.inc');
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
const bound = (btn, atBound) => {
|
|
44
|
+
if (!btn)
|
|
45
|
+
return;
|
|
46
|
+
btn.disabled = locked;
|
|
47
|
+
if (!locked && atBound)
|
|
48
|
+
btn.setAttribute('aria-disabled', 'true');
|
|
49
|
+
else
|
|
50
|
+
btn.removeAttribute('aria-disabled');
|
|
51
|
+
};
|
|
52
|
+
bound(dec, v != null && min != null && v <= min);
|
|
53
|
+
bound(inc, v != null && max != null && v >= max);
|
|
44
54
|
}
|
|
45
55
|
export function nudgeNumber(btn) {
|
|
46
56
|
const input = btn.closest('.control')?.querySelector('.ss-input');
|
|
47
|
-
if (!input || btn.disabled)
|
|
57
|
+
if (!input || btn.disabled || btn.getAttribute('aria-disabled') === 'true')
|
|
48
58
|
return;
|
|
49
59
|
const dir = btn.classList.contains('inc') ? 1 : -1;
|
|
50
60
|
const min = num(input.getAttribute('min'));
|
|
@@ -61,6 +71,9 @@ export function nudgeNumber(btn) {
|
|
|
61
71
|
fire(input, 'input');
|
|
62
72
|
fire(input, 'change');
|
|
63
73
|
syncSteppers(input);
|
|
74
|
+
const live = input.closest('.ss-numberfield')?.querySelector('.live');
|
|
75
|
+
if (live)
|
|
76
|
+
live.textContent = input.value;
|
|
64
77
|
}
|
|
65
78
|
// ── Textarea autosize ──────────────────────────────────────────────────────
|
|
66
79
|
export const supportsFieldSizing = typeof CSS !== 'undefined' &&
|
package/dist/vanilla/index.d.ts
CHANGED
|
@@ -2,12 +2,13 @@ export { toast, toasts } from './toast.js';
|
|
|
2
2
|
export type { Toast, ToastKind, ToastOptions, ToastPatch, ToastAction, PromiseMessages, } from './toast.js';
|
|
3
3
|
export { iconSvg, hydrateIcons, type IconOptions } from './icons.js';
|
|
4
4
|
export { registerIcon, type IconName } from '../icons.js';
|
|
5
|
-
export { openModal, closeModal } from './modal.js';
|
|
5
|
+
export { openModal, closeModal, lockScroll, unlockScroll } from './modal.js';
|
|
6
6
|
export { toggleAccordion } from './accordion.js';
|
|
7
7
|
export { openMenu, closeMenu } from './menu.js';
|
|
8
8
|
export { showTooltip, hideTooltip } from './tooltip.js';
|
|
9
9
|
export { toggleSwitch } from './switch.js';
|
|
10
10
|
export { selectSegment } from './segmented.js';
|
|
11
|
+
export { toggleGrab, readPlacements } from './tierlist.js';
|
|
11
12
|
export { clearInput, nudgeNumber, autosize } from './fields.js';
|
|
12
13
|
export { applyDesignConfig, designAttributes, getDesignConfig, paletteToCss, type DesignConfig, type ColorTheme, type Size, } from '../config.js';
|
|
13
14
|
/** Hydrate icon placeholders and initialise setup-type behaviours under `root`. */
|
package/dist/vanilla/index.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* consumption path. Importing this module wires every behaviour once via document-level event
|
|
4
4
|
* delegation (so markup added later just works) and runs `mount()` when the DOM is ready.
|
|
5
5
|
*
|
|
6
|
-
* <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dssoca@0.
|
|
7
|
-
* <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dssoca@0.
|
|
8
|
-
* <script type="module" src="https://cdn.jsdelivr.net/npm/dssoca@0.
|
|
6
|
+
* <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dssoca@0.20/dist/theme.css">
|
|
7
|
+
* <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dssoca@0.20/dist/vanilla.css">
|
|
8
|
+
* <script type="module" src="https://cdn.jsdelivr.net/npm/dssoca@0.20/dist/vanilla/index.js"></script>
|
|
9
9
|
*
|
|
10
10
|
* Call `mount(root)` after injecting HTML that contains `[data-ss-icon]` placeholders or
|
|
11
11
|
* autosizing textareas. Nothing here imports Svelte or a `.svelte` module.
|
|
@@ -16,17 +16,19 @@ import { installMenu } from './menu.js';
|
|
|
16
16
|
import { installTooltip } from './tooltip.js';
|
|
17
17
|
import { installSwitch } from './switch.js';
|
|
18
18
|
import { installSegmented } from './segmented.js';
|
|
19
|
+
import { installTierlist } from './tierlist.js';
|
|
19
20
|
import { installFields, mountFields } from './fields.js';
|
|
20
21
|
import { hydrateIcons } from './icons.js';
|
|
21
22
|
export { toast, toasts } from './toast.js';
|
|
22
23
|
export { iconSvg, hydrateIcons } from './icons.js';
|
|
23
24
|
export { registerIcon } from '../icons.js';
|
|
24
|
-
export { openModal, closeModal } from './modal.js';
|
|
25
|
+
export { openModal, closeModal, lockScroll, unlockScroll } from './modal.js';
|
|
25
26
|
export { toggleAccordion } from './accordion.js';
|
|
26
27
|
export { openMenu, closeMenu } from './menu.js';
|
|
27
28
|
export { showTooltip, hideTooltip } from './tooltip.js';
|
|
28
29
|
export { toggleSwitch } from './switch.js';
|
|
29
30
|
export { selectSegment } from './segmented.js';
|
|
31
|
+
export { toggleGrab, readPlacements } from './tierlist.js';
|
|
30
32
|
export { clearInput, nudgeNumber, autosize } from './fields.js';
|
|
31
33
|
export { applyDesignConfig, designAttributes, getDesignConfig, paletteToCss, } from '../config.js';
|
|
32
34
|
/** Hydrate icon placeholders and initialise setup-type behaviours under `root`. */
|
|
@@ -49,6 +51,7 @@ export function install() {
|
|
|
49
51
|
installTooltip();
|
|
50
52
|
installSwitch();
|
|
51
53
|
installSegmented();
|
|
54
|
+
installTierlist();
|
|
52
55
|
installFields();
|
|
53
56
|
if (document.readyState === 'loading') {
|
|
54
57
|
document.addEventListener('DOMContentLoaded', () => mount(), { once: true });
|
package/dist/vanilla/menu.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Outside pointerdown closes without returning focus; Escape / item activation return focus
|
|
5
5
|
* to the trigger. Emits `ss:select` on the root with `{ index, value }` (`value` is the
|
|
6
6
|
* item's `data-value`, when authored). For `menuitemradio` items the check marker moves to
|
|
7
|
-
* the activated item.
|
|
7
|
+
* the activated item. A panel with neither `aria-label` nor `aria-labelledby` gets
|
|
8
|
+
* `aria-labelledby` pointing at its trigger on first open (an id is minted if needed).
|
|
8
9
|
*/
|
|
9
10
|
import { on, emit, all } from './delegate.js';
|
|
10
11
|
import { iconSvg } from './icons.js';
|
|
@@ -29,10 +30,20 @@ function focusItem(panel, item) {
|
|
|
29
30
|
i.tabIndex = i === item ? 0 : -1;
|
|
30
31
|
item.focus();
|
|
31
32
|
}
|
|
33
|
+
let autoId = 0;
|
|
34
|
+
/** An unnamed `role="menu"` panel is named by its trigger (mirrors Menu.svelte's fallback). */
|
|
35
|
+
function ensureName(trigger, panel) {
|
|
36
|
+
if (panel.hasAttribute('aria-label') || panel.hasAttribute('aria-labelledby'))
|
|
37
|
+
return;
|
|
38
|
+
if (!trigger.id)
|
|
39
|
+
trigger.id = `ss-menu-trigger-${++autoId}`;
|
|
40
|
+
panel.setAttribute('aria-labelledby', trigger.id);
|
|
41
|
+
}
|
|
32
42
|
export function openMenu(trigger, focus = 'first') {
|
|
33
43
|
const { panel } = parts(trigger);
|
|
34
44
|
if (!panel || trigger.getAttribute('aria-expanded') === 'true')
|
|
35
45
|
return;
|
|
46
|
+
ensureName(trigger, panel);
|
|
36
47
|
trigger.setAttribute('aria-expanded', 'true');
|
|
37
48
|
panel.classList.add('open');
|
|
38
49
|
panel.setAttribute('aria-hidden', 'false');
|