@xerios/design-system 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +403 -2
- package/dist/components/AnchorHeading.svelte +79 -0
- package/dist/components/AnchorHeading.svelte.d.ts +28 -0
- package/dist/components/Breadcrumbs.svelte +216 -0
- package/dist/components/Breadcrumbs.svelte.d.ts +37 -0
- package/dist/components/Button.svelte +178 -0
- package/dist/components/Button.svelte.d.ts +58 -0
- package/dist/components/Canvas.svelte +248 -0
- package/dist/components/Canvas.svelte.d.ts +91 -0
- package/dist/components/Collapsible.svelte +139 -0
- package/dist/components/Collapsible.svelte.d.ts +52 -0
- package/dist/components/CollapsibleAdvanced.svelte +174 -0
- package/dist/components/CollapsibleAdvanced.svelte.d.ts +43 -0
- package/dist/components/DashOutline.svelte +47 -0
- package/dist/components/DashOutline.svelte.d.ts +6 -0
- package/dist/components/Dialogs.svelte +123 -0
- package/dist/components/Dialogs.svelte.d.ts +6 -0
- package/dist/components/Drawer.svelte +231 -0
- package/dist/components/Drawer.svelte.d.ts +62 -0
- package/dist/components/ErrorMessage.svelte +140 -0
- package/dist/components/ErrorMessage.svelte.d.ts +41 -0
- package/dist/components/Icon.svelte +94 -0
- package/dist/components/Icon.svelte.d.ts +33 -0
- package/dist/components/InfoTip.svelte +183 -0
- package/dist/components/InfoTip.svelte.d.ts +28 -0
- package/dist/components/Md.svelte +28 -0
- package/dist/components/Md.svelte.d.ts +11 -0
- package/dist/components/Modal.svelte +91 -0
- package/dist/components/Modal.svelte.d.ts +41 -0
- package/dist/components/Notice.svelte +50 -0
- package/dist/components/Notice.svelte.d.ts +30 -0
- package/dist/components/Popover.svelte +212 -0
- package/dist/components/Popover.svelte.d.ts +70 -0
- package/dist/components/Shimmer.svelte +27 -0
- package/dist/components/Shimmer.svelte.d.ts +22 -0
- package/dist/components/Splitter.svelte +152 -0
- package/dist/components/Splitter.svelte.d.ts +41 -0
- package/dist/components/Table.svelte +448 -0
- package/dist/components/Table.svelte.d.ts +268 -0
- package/dist/components/Toast.svelte +273 -0
- package/dist/components/Toast.svelte.d.ts +31 -0
- package/dist/components/Tooltip.svelte +97 -0
- package/dist/components/Tooltip.svelte.d.ts +19 -0
- package/dist/components/WorkingBorder.svelte +105 -0
- package/dist/components/WorkingBorder.svelte.d.ts +26 -0
- package/dist/components/empty/Empty.svelte +55 -0
- package/dist/components/empty/Empty.svelte.d.ts +39 -0
- package/dist/components/empty/EmptyError.svelte +47 -0
- package/dist/components/empty/EmptyError.svelte.d.ts +28 -0
- package/dist/components/empty/index.d.ts +18 -0
- package/dist/components/empty/index.js +10 -0
- package/dist/components/filters/DateFilter.svelte +59 -0
- package/dist/components/filters/DateFilter.svelte.d.ts +23 -0
- package/dist/components/filters/FilterBar.svelte +342 -0
- package/dist/components/filters/FilterBar.svelte.d.ts +283 -0
- package/dist/components/filters/FilterChip.svelte +235 -0
- package/dist/components/filters/FilterChip.svelte.d.ts +68 -0
- package/dist/components/filters/OptionList.svelte +352 -0
- package/dist/components/filters/OptionList.svelte.d.ts +91 -0
- package/dist/components/filters/Panel.svelte +123 -0
- package/dist/components/filters/Panel.svelte.d.ts +25 -0
- package/dist/components/filters/index.d.ts +288 -0
- package/dist/components/filters/index.js +12 -0
- package/dist/components/icons.d.ts +54 -0
- package/dist/components/icons.js +58 -0
- package/dist/components/inputs/ButtonGroup.svelte +104 -0
- package/dist/components/inputs/ButtonGroup.svelte.d.ts +40 -0
- package/dist/components/inputs/Calendar.svelte +535 -0
- package/dist/components/inputs/Calendar.svelte.d.ts +45 -0
- package/dist/components/inputs/DateField.svelte +247 -0
- package/dist/components/inputs/DateField.svelte.d.ts +74 -0
- package/dist/components/inputs/DateInput.svelte +118 -0
- package/dist/components/inputs/DateInput.svelte.d.ts +43 -0
- package/dist/components/inputs/DatePicker.svelte +102 -0
- package/dist/components/inputs/DatePicker.svelte.d.ts +67 -0
- package/dist/components/inputs/DateRangePicker.svelte +208 -0
- package/dist/components/inputs/DateRangePicker.svelte.d.ts +76 -0
- package/dist/components/inputs/DateRangeSelect.svelte +548 -0
- package/dist/components/inputs/DateRangeSelect.svelte.d.ts +70 -0
- package/dist/components/inputs/FieldLabel.svelte +43 -0
- package/dist/components/inputs/FieldLabel.svelte.d.ts +28 -0
- package/dist/components/inputs/ListSearch.svelte +142 -0
- package/dist/components/inputs/ListSearch.svelte.d.ts +35 -0
- package/dist/components/inputs/RadioGroup.svelte +153 -0
- package/dist/components/inputs/RadioGroup.svelte.d.ts +49 -0
- package/dist/components/inputs/RangeShortcuts.svelte +90 -0
- package/dist/components/inputs/RangeShortcuts.svelte.d.ts +31 -0
- package/dist/components/inputs/RangeSlider.svelte +225 -0
- package/dist/components/inputs/RangeSlider.svelte.d.ts +37 -0
- package/dist/components/inputs/SearchField.svelte +24 -0
- package/dist/components/inputs/SearchField.svelte.d.ts +41 -0
- package/dist/components/inputs/Segmented.svelte +76 -0
- package/dist/components/inputs/Segmented.svelte.d.ts +43 -0
- package/dist/components/inputs/Select.svelte +552 -0
- package/dist/components/inputs/Select.svelte.d.ts +100 -0
- package/dist/components/inputs/Slider.svelte +177 -0
- package/dist/components/inputs/Slider.svelte.d.ts +33 -0
- package/dist/components/inputs/SliderTicks.svelte +62 -0
- package/dist/components/inputs/SliderTicks.svelte.d.ts +23 -0
- package/dist/components/inputs/Switch.svelte +120 -0
- package/dist/components/inputs/Switch.svelte.d.ts +31 -0
- package/dist/components/inputs/TagInput.svelte +296 -0
- package/dist/components/inputs/TagInput.svelte.d.ts +61 -0
- package/dist/components/inputs/TextArea.svelte +86 -0
- package/dist/components/inputs/TextArea.svelte.d.ts +56 -0
- package/dist/components/inputs/TextField.svelte +170 -0
- package/dist/components/inputs/TextField.svelte.d.ts +80 -0
- package/dist/components/menu/ContextMenu.svelte +25 -0
- package/dist/components/menu/ContextMenu.svelte.d.ts +26 -0
- package/dist/components/menu/MenuButton.svelte +46 -0
- package/dist/components/menu/MenuButton.svelte.d.ts +16 -0
- package/dist/components/menu/MenuList.svelte +319 -0
- package/dist/components/menu/MenuList.svelte.d.ts +30 -0
- package/dist/components/metadata/Metadata.svelte +38 -0
- package/dist/components/metadata/Metadata.svelte.d.ts +31 -0
- package/dist/components/metadata/MetadataRow.svelte +84 -0
- package/dist/components/metadata/MetadataRow.svelte.d.ts +26 -0
- package/dist/components/metadata/index.d.ts +8 -0
- package/dist/components/metadata/index.js +13 -0
- package/dist/components/side-menu/SideMenu.svelte +138 -0
- package/dist/components/side-menu/SideMenu.svelte.d.ts +25 -0
- package/dist/components/side-menu/SideMenuGroup.svelte +108 -0
- package/dist/components/side-menu/SideMenuGroup.svelte.d.ts +31 -0
- package/dist/components/side-menu/SideMenuItem.svelte +221 -0
- package/dist/components/side-menu/SideMenuItem.svelte.d.ts +46 -0
- package/dist/components/side-menu/context.d.ts +1 -0
- package/dist/components/side-menu/context.js +3 -0
- package/dist/components/side-menu/index.d.ts +62 -0
- package/dist/components/side-menu/index.js +15 -0
- package/dist/components/tiles/Tile.svelte +419 -0
- package/dist/components/tiles/Tile.svelte.d.ts +58 -0
- package/dist/components/tiles/TileGroup.svelte +135 -0
- package/dist/components/tiles/TileGroup.svelte.d.ts +45 -0
- package/dist/components/tiles/context.d.ts +35 -0
- package/dist/components/tiles/context.js +14 -0
- package/dist/components/tiles/index.d.ts +6 -0
- package/dist/components/tiles/index.js +13 -0
- package/dist/components/upload/FileCard.svelte +301 -0
- package/dist/components/upload/FileCard.svelte.d.ts +127 -0
- package/dist/components/upload/Thumb.svelte +274 -0
- package/dist/components/upload/Thumb.svelte.d.ts +101 -0
- package/dist/components/upload/UploadFile.svelte +123 -0
- package/dist/components/upload/UploadFile.svelte.d.ts +48 -0
- package/dist/components/upload/UploadFiles.svelte +177 -0
- package/dist/components/upload/UploadFiles.svelte.d.ts +50 -0
- package/dist/components/upload/UploadFolder.svelte +153 -0
- package/dist/components/upload/UploadFolder.svelte.d.ts +63 -0
- package/dist/components/upload/UploadImage.svelte +137 -0
- package/dist/components/upload/UploadImage.svelte.d.ts +52 -0
- package/dist/components/upload/UploadImages.svelte +172 -0
- package/dist/components/upload/UploadImages.svelte.d.ts +52 -0
- package/dist/components/upload/UploadZone.svelte +130 -0
- package/dist/components/upload/UploadZone.svelte.d.ts +41 -0
- package/dist/components/upload/common.d.ts +31 -0
- package/dist/components/upload/common.js +103 -0
- package/dist/components/upload/context.d.ts +18 -0
- package/dist/components/upload/context.js +10 -0
- package/dist/components/upload/index.d.ts +16 -0
- package/dist/components/upload/index.js +18 -0
- package/dist/css/atoms.css +892 -0
- package/dist/css/base.css +333 -0
- package/dist/css/effects.css +430 -0
- package/dist/css/index.css +10 -0
- package/dist/css/tokens.css +296 -0
- package/dist/fonts.d.ts +1 -0
- package/dist/fonts.js +7 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +77 -0
- package/dist/lib/announce.d.ts +8 -0
- package/dist/lib/announce.js +48 -0
- package/dist/lib/controls.d.ts +10 -0
- package/dist/lib/controls.js +42 -0
- package/dist/lib/dates.d.ts +104 -0
- package/dist/lib/dates.js +235 -0
- package/dist/lib/dialogs.svelte.d.ts +8 -0
- package/dist/lib/dialogs.svelte.js +45 -0
- package/dist/lib/dom.d.ts +34 -0
- package/dist/lib/dom.js +90 -0
- package/dist/lib/field-errors.svelte.d.ts +40 -0
- package/dist/lib/field-errors.svelte.js +89 -0
- package/dist/lib/files.d.ts +74 -0
- package/dist/lib/files.js +215 -0
- package/dist/lib/inline-md.d.ts +1 -0
- package/dist/lib/inline-md.js +36 -0
- package/dist/lib/invalid.d.ts +4 -0
- package/dist/lib/invalid.js +35 -0
- package/dist/lib/list-search.d.ts +9 -0
- package/dist/lib/list-search.js +27 -0
- package/dist/lib/menu.svelte.d.ts +39 -0
- package/dist/lib/menu.svelte.js +98 -0
- package/dist/lib/morph.svelte.d.ts +17 -0
- package/dist/lib/morph.svelte.js +46 -0
- package/dist/lib/motion.d.ts +115 -0
- package/dist/lib/motion.js +174 -0
- package/dist/lib/observe.d.ts +36 -0
- package/dist/lib/observe.js +142 -0
- package/dist/lib/reveal.d.ts +7 -0
- package/dist/lib/reveal.js +28 -0
- package/dist/lib/roving.d.ts +16 -0
- package/dist/lib/roving.js +35 -0
- package/dist/lib/runs.d.ts +18 -0
- package/dist/lib/runs.js +25 -0
- package/dist/lib/scroll-fade.d.ts +4 -0
- package/dist/lib/scroll-fade.js +71 -0
- package/dist/lib/spotlight.d.ts +4 -0
- package/dist/lib/spotlight.js +109 -0
- package/dist/lib/ticks.d.ts +12 -0
- package/dist/lib/ticks.js +24 -0
- package/dist/lib/tooltip.d.ts +4 -0
- package/dist/lib/tooltip.js +110 -0
- package/dist/lib/validity.d.ts +16 -0
- package/dist/lib/validity.js +36 -0
- package/package.json +69 -3
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* One row of a Metadata list: its label, and its values as children.
|
|
4
|
+
*
|
|
5
|
+
* <Metadata.Row label="Resources" onlabelclick={addLink} labelTip="Add a link">
|
|
6
|
+
* <a class="chip-btn" href="/docs/plan"><Icon name="link" />Plan</a>
|
|
7
|
+
* </Metadata.Row>
|
|
8
|
+
*
|
|
9
|
+
* label: the row's name, short (it sits in an 80px column).
|
|
10
|
+
* onlabelclick(event): makes the label a button (open the row's menu, add a value); it fills on hover.
|
|
11
|
+
* labelTip: what pressing the label does, as its tooltip. Give it with onlabelclick: the label alone doesn't say.
|
|
12
|
+
* Children: the values, usually `.chip-btn` pills (`.outlined` for a row of labels), or `.label-chip` for ones that do
|
|
13
|
+
* nothing. Other attributes, the class and attachments go to the row's <div>.
|
|
14
|
+
* Keyboard: Enter or Space presses the label when it is a button.
|
|
15
|
+
*
|
|
16
|
+
* @typedef {object} Props
|
|
17
|
+
* @property {string} label
|
|
18
|
+
* @property {(event: MouseEvent) => void} [onlabelclick]
|
|
19
|
+
* @property {string} [labelTip]
|
|
20
|
+
* @property {import('svelte').Snippet} [children]
|
|
21
|
+
*/
|
|
22
|
+
import { tooltip } from '../../lib/tooltip.js'
|
|
23
|
+
|
|
24
|
+
/** @type {Props & Omit<import('svelte/elements').HTMLAttributes<HTMLDivElement>, keyof Props>} */
|
|
25
|
+
let { label, onlabelclick, labelTip = '', children, class: className, ...rest } = $props()
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<div class={['row', className]} {...rest}>
|
|
29
|
+
<dt>
|
|
30
|
+
{#if onlabelclick}
|
|
31
|
+
<button type="button" class="label action" onclick={onlabelclick} {@attach tooltip(labelTip)}>{label}</button>
|
|
32
|
+
{:else}
|
|
33
|
+
<span class="label">{label}</span>
|
|
34
|
+
{/if}
|
|
35
|
+
</dt>
|
|
36
|
+
<dd class="values">{@render children?.()}</dd>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<style>
|
|
40
|
+
/* Laid on the list's two columns (subgrid), so every row's label shares one width. The label stays with the first line
|
|
41
|
+
of values when they wrap. */
|
|
42
|
+
.row {
|
|
43
|
+
display: grid;
|
|
44
|
+
grid-column: 1 / -1;
|
|
45
|
+
grid-template-columns: subgrid;
|
|
46
|
+
align-items: start;
|
|
47
|
+
}
|
|
48
|
+
dt {
|
|
49
|
+
min-width: 0;
|
|
50
|
+
}
|
|
51
|
+
.label {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
min-height: 24px;
|
|
55
|
+
padding-inline: var(--space-2);
|
|
56
|
+
border-radius: var(--r-pill);
|
|
57
|
+
color: var(--muted);
|
|
58
|
+
font: var(--w-medium) 12px/14px var(--font-body);
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
}
|
|
61
|
+
.action {
|
|
62
|
+
width: 100%;
|
|
63
|
+
border: 0;
|
|
64
|
+
background: none;
|
|
65
|
+
text-align: start;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
transition: background-color var(--dur) var(--ease-out);
|
|
68
|
+
}
|
|
69
|
+
.action:hover {
|
|
70
|
+
background: var(--control-3);
|
|
71
|
+
}
|
|
72
|
+
.action:active {
|
|
73
|
+
background: var(--control-4);
|
|
74
|
+
}
|
|
75
|
+
.values {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-wrap: wrap;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: var(--space-1);
|
|
80
|
+
min-width: 0;
|
|
81
|
+
min-height: 24px;
|
|
82
|
+
margin: 0;
|
|
83
|
+
}
|
|
84
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default MetadataRow;
|
|
2
|
+
/**
|
|
3
|
+
* One row of a Metadata list: its label, and its values as children.
|
|
4
|
+
*
|
|
5
|
+
* <Metadata.Row label="Resources" onlabelclick={addLink} labelTip="Add a link">
|
|
6
|
+
* <a class="chip-btn" href="/docs/plan"><Icon name="link" />Plan</a>
|
|
7
|
+
* </Metadata.Row>
|
|
8
|
+
*
|
|
9
|
+
* label: the row's name, short (it sits in an 80px column).
|
|
10
|
+
* onlabelclick(event): makes the label a button (open the row's menu, add a value); it fills on hover.
|
|
11
|
+
* labelTip: what pressing the label does, as its tooltip. Give it with onlabelclick: the label alone doesn't say.
|
|
12
|
+
* Children: the values, usually `.chip-btn` pills (`.outlined` for a row of labels), or `.label-chip` for ones that do
|
|
13
|
+
* nothing. Other attributes, the class and attachments go to the row's <div>.
|
|
14
|
+
* Keyboard: Enter or Space presses the label when it is a button.
|
|
15
|
+
*/
|
|
16
|
+
export type Props = {
|
|
17
|
+
label: string;
|
|
18
|
+
onlabelclick?: ((event: MouseEvent) => void) | undefined;
|
|
19
|
+
labelTip?: string | undefined;
|
|
20
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
21
|
+
};
|
|
22
|
+
type MetadataRow = {
|
|
23
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
24
|
+
$set?(props: Partial<Props & Omit<HTMLAttributes<HTMLDivElement>, keyof Props>>): void;
|
|
25
|
+
};
|
|
26
|
+
declare const MetadataRow: import("svelte").Component<Props & Omit<import("svelte/elements").HTMLAttributes<HTMLDivElement>, keyof Props>, {}, "">;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: import("svelte").Component<{
|
|
2
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
3
|
+
} & Omit<import("svelte/elements").HTMLAttributes<HTMLDListElement>, "children">, {}, ""> & {
|
|
4
|
+
Row: import("svelte").Component<import("./MetadataRow.svelte").Props & Omit<import("svelte/elements").HTMLAttributes<HTMLDivElement>, keyof import("./MetadataRow.svelte").Props>, {}, "">;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export { MetadataRow };
|
|
8
|
+
import MetadataRow from './MetadataRow.svelte';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Labelled values as one import: <Metadata> is the list, <Metadata.Row> one label and its values.
|
|
2
|
+
//
|
|
3
|
+
// import Metadata from '@xerios/design-system/components/metadata/index.js'
|
|
4
|
+
// <Metadata>
|
|
5
|
+
// <Metadata.Row label="Properties">
|
|
6
|
+
// <button type="button" class="chip-btn"><Icon name="circleDashed" />Planned</button>
|
|
7
|
+
// </Metadata.Row>
|
|
8
|
+
// </Metadata>
|
|
9
|
+
import Metadata from './Metadata.svelte'
|
|
10
|
+
import MetadataRow from './MetadataRow.svelte'
|
|
11
|
+
|
|
12
|
+
export default Object.assign(Metadata, { Row: MetadataRow })
|
|
13
|
+
export { MetadataRow }
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* A side menu (Linear's sidebar): a header row on top (a title or workspace menu, with buttons at the right), then
|
|
4
|
+
* groups of rows that scroll under it. Built from parts; import it from side-menu/index.js.
|
|
5
|
+
*
|
|
6
|
+
* <SideMenu label="Sections">
|
|
7
|
+
* {#snippet header()}<WorkspaceMenu />{/snippet}
|
|
8
|
+
* {#snippet actions()}
|
|
9
|
+
* <Button iconOnly icon="search" label="Search" onclick={search} />
|
|
10
|
+
* <Button iconOnly icon="plus" label="New issue" onclick={compose} />
|
|
11
|
+
* {/snippet}
|
|
12
|
+
* <SideMenu.Group>
|
|
13
|
+
* <SideMenu.Item href="/inbox" icon="inbox" label="Inbox" count={3} current={path === '/inbox'} />
|
|
14
|
+
* <SideMenu.Item href="/mine" icon="target" label="My issues" />
|
|
15
|
+
* </SideMenu.Group>
|
|
16
|
+
* <SideMenu.Group title="Workspace">
|
|
17
|
+
* <SideMenu.Item href="/views" icon="stack" label="Views" />
|
|
18
|
+
* <SideMenu.Item icon="folder" label="Projects"> no href: a button that folds its items
|
|
19
|
+
* <SideMenu.Item href="/p/mobile" icon="phone" label="Mobile app" />
|
|
20
|
+
* </SideMenu.Item>
|
|
21
|
+
* </SideMenu.Group>
|
|
22
|
+
* {#snippet footer()}<ButtonGroup label="Theme" options={THEMES} value={theme} onchange={setTheme} />{/snippet}
|
|
23
|
+
* </SideMenu>
|
|
24
|
+
*
|
|
25
|
+
* label: the <nav>'s accessible name (default "Menu").
|
|
26
|
+
* header: the left of the top row (a title, or a menu button for the workspace). Its icon belongs in the icon column:
|
|
27
|
+
* give it a negative start margin of --bleed, as a row's fill has.
|
|
28
|
+
* actions: buttons at the right of the top row. The last is the menu's main action (new, compose): it is drawn raised,
|
|
29
|
+
* and centred on the trailing column, where the rows' counts sit.
|
|
30
|
+
* children: SideMenu.Group parts. They scroll, with edge fades, under the header.
|
|
31
|
+
* footer: pinned under the rows at the content edge (a theme switch, an account or help button); the rows scroll above it.
|
|
32
|
+
* Other attributes (class, id…) and attachments go to the <nav>. Fill the height it is given (it scrolls inside).
|
|
33
|
+
*
|
|
34
|
+
* Everything lines up on four columns, set here as properties and read by the parts: the content edge (--edge, where
|
|
35
|
+
* group headings start), the icon column (--slot wide, icons centred in it), the label column after it (--gap on),
|
|
36
|
+
* and the trailing column at the right (--trail wide, counts and buttons centred in it). A row's fill reaches --bleed
|
|
37
|
+
* past the content edge on both sides, so an icon and a count sit the same distance in from its ends; the main action
|
|
38
|
+
* (--action square) is centred on the trailing column. Override them on the element to retune the menu.
|
|
39
|
+
* Keyboard: Tab moves through the header's controls, then the rows in order; Enter follows a link or folds a group.
|
|
40
|
+
*/
|
|
41
|
+
import { scrollFade } from '../../lib/scroll-fade.js'
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @typedef {object} Props
|
|
45
|
+
* @property {string} [label]
|
|
46
|
+
* @property {import('svelte').Snippet} [header]
|
|
47
|
+
* @property {import('svelte').Snippet} [actions]
|
|
48
|
+
* @property {import('svelte').Snippet} [footer]
|
|
49
|
+
* @property {import('svelte').Snippet} children
|
|
50
|
+
*/
|
|
51
|
+
/** @type {Props & Omit<import('svelte/elements').HTMLAttributes<HTMLElement>, keyof Props>} */
|
|
52
|
+
let { label = 'Menu', header, actions, footer, class: className, children, ...rest } = $props()
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<nav aria-label={label} class={['side-menu', className]} {...rest}>
|
|
56
|
+
{#if header || actions}
|
|
57
|
+
<div class="top">
|
|
58
|
+
<div class="title">{@render header?.()}</div>
|
|
59
|
+
{#if actions}<div class="actions">{@render actions()}</div>{/if}
|
|
60
|
+
</div>
|
|
61
|
+
{/if}
|
|
62
|
+
<div class="scroll" {@attach scrollFade()}>{@render children()}</div>
|
|
63
|
+
{#if footer}<div class="footer">{@render footer()}</div>{/if}
|
|
64
|
+
</nav>
|
|
65
|
+
|
|
66
|
+
<style>
|
|
67
|
+
/* Navigation chrome: nothing in it is text to copy or drag out (base.css); its links keep their right-click menu. */
|
|
68
|
+
.side-menu {
|
|
69
|
+
user-select: none;
|
|
70
|
+
-webkit-user-select: none;
|
|
71
|
+
--edge: var(--space-4);
|
|
72
|
+
--slot: var(--icon-lg);
|
|
73
|
+
--gap: var(--space-2);
|
|
74
|
+
/* As wide as a count, and --bleed as wide as the gap between the icon column and the fill's edge, so an icon and a
|
|
75
|
+
count sit the same distance in from either end of a row's fill. */
|
|
76
|
+
--trail: 20px;
|
|
77
|
+
--bleed: var(--space-2);
|
|
78
|
+
--action: 28px;
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
gap: var(--space-3);
|
|
82
|
+
min-height: 0;
|
|
83
|
+
height: 100%;
|
|
84
|
+
padding: var(--space-2) var(--edge);
|
|
85
|
+
}
|
|
86
|
+
/* The title, then the actions ending on the trailing column. */
|
|
87
|
+
.top {
|
|
88
|
+
display: grid;
|
|
89
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
90
|
+
align-items: center;
|
|
91
|
+
column-gap: var(--space-2);
|
|
92
|
+
min-height: 32px;
|
|
93
|
+
}
|
|
94
|
+
.title {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
min-width: 0;
|
|
98
|
+
}
|
|
99
|
+
.actions {
|
|
100
|
+
display: flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
gap: var(--space-1);
|
|
103
|
+
}
|
|
104
|
+
/* The main action: ghost (a fill on hover only), square-cornered like the rows, and centred on the trailing column (it
|
|
105
|
+
is wider, so it reaches past the column's end by half the difference). */
|
|
106
|
+
.actions > :global(.icon-btn:last-child) {
|
|
107
|
+
width: var(--action);
|
|
108
|
+
height: var(--action);
|
|
109
|
+
margin-inline-end: calc((var(--trail) - var(--action)) / 2);
|
|
110
|
+
border-radius: var(--r);
|
|
111
|
+
color: var(--fg-2);
|
|
112
|
+
}
|
|
113
|
+
.actions > :global(.icon-btn:last-child:hover) {
|
|
114
|
+
background: var(--control-3);
|
|
115
|
+
color: var(--fg);
|
|
116
|
+
}
|
|
117
|
+
.actions > :global(.icon-btn:last-child:active) {
|
|
118
|
+
background: var(--control-4);
|
|
119
|
+
}
|
|
120
|
+
.scroll {
|
|
121
|
+
flex: 1;
|
|
122
|
+
min-height: 0;
|
|
123
|
+
/* The row fills reach past the content edge; the scroller must not clip them. */
|
|
124
|
+
margin-inline: calc(var(--bleed) * -1);
|
|
125
|
+
padding-inline: var(--bleed);
|
|
126
|
+
overflow-y: auto;
|
|
127
|
+
overscroll-behavior: contain;
|
|
128
|
+
/* Leaves room under the last row, where the bottom fade is. */
|
|
129
|
+
padding-bottom: var(--space-8);
|
|
130
|
+
}
|
|
131
|
+
/* Under the scroll's bottom fade, which already parts it from the rows: no rule needed. */
|
|
132
|
+
.footer {
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
gap: var(--space-2);
|
|
136
|
+
min-height: 32px;
|
|
137
|
+
}
|
|
138
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default SideMenu;
|
|
2
|
+
type SideMenu = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props & Omit<HTMLAttributes<HTMLElement>, keyof Props>>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const SideMenu: import("svelte").Component<{
|
|
7
|
+
label?: string | undefined;
|
|
8
|
+
header?: import("svelte").Snippet<[]> | undefined;
|
|
9
|
+
actions?: import("svelte").Snippet<[]> | undefined;
|
|
10
|
+
footer?: import("svelte").Snippet<[]> | undefined;
|
|
11
|
+
children: import("svelte").Snippet;
|
|
12
|
+
} & Omit<import("svelte/elements").HTMLAttributes<HTMLElement>, keyof {
|
|
13
|
+
label?: string | undefined;
|
|
14
|
+
header?: import("svelte").Snippet<[]> | undefined;
|
|
15
|
+
actions?: import("svelte").Snippet<[]> | undefined;
|
|
16
|
+
footer?: import("svelte").Snippet<[]> | undefined;
|
|
17
|
+
children: import("svelte").Snippet;
|
|
18
|
+
}>, {}, "">;
|
|
19
|
+
type Props = {
|
|
20
|
+
label?: string | undefined;
|
|
21
|
+
header?: import("svelte").Snippet<[]> | undefined;
|
|
22
|
+
actions?: import("svelte").Snippet<[]> | undefined;
|
|
23
|
+
footer?: import("svelte").Snippet<[]> | undefined;
|
|
24
|
+
children: import("svelte").Snippet;
|
|
25
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* SideMenu.Group: a run of rows in a SideMenu. With a title, it gets a muted heading at the content edge that folds it
|
|
4
|
+
* (the caret right after the name); without one, it is a plain list, for the menu's first rows (inbox, your own work),
|
|
5
|
+
* set apart from the titled groups below by the space between groups.
|
|
6
|
+
*
|
|
7
|
+
* <SideMenu.Group>…items…</SideMenu.Group>
|
|
8
|
+
* <SideMenu.Group title="Favorites">…items…</SideMenu.Group> opens and closes on its own
|
|
9
|
+
* <SideMenu.Group title="Teams" bind:open={teamsOpen}>…</SideMenu.Group> the parent holds the state
|
|
10
|
+
* <SideMenu.Group title="Teams" open={saved} ontoggle={save}>…</SideMenu.Group> …or stores it somewhere
|
|
11
|
+
*
|
|
12
|
+
* title: the heading. open (bindable, default true) and ontoggle(open): its folded state; only with a title.
|
|
13
|
+
* children: SideMenu.Item rows.
|
|
14
|
+
* Other attributes (class, id…) and attachments go to the wrapper.
|
|
15
|
+
* Keyboard: the heading is a button (Enter or Space folds the group); it says whether the group is open.
|
|
16
|
+
*/
|
|
17
|
+
import { setContext } from 'svelte'
|
|
18
|
+
|
|
19
|
+
import Icon from '../Icon.svelte'
|
|
20
|
+
import { slide } from '../../lib/motion.js'
|
|
21
|
+
import { DEPTH } from './context.js'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @typedef {object} Props
|
|
25
|
+
* @property {string} [title]
|
|
26
|
+
* @property {boolean} [open] bindable
|
|
27
|
+
* @property {(open: boolean) => void} [ontoggle]
|
|
28
|
+
* @property {import('svelte').Snippet} children
|
|
29
|
+
*/
|
|
30
|
+
/** @type {Props & Omit<import('svelte/elements').HTMLAttributes<HTMLDivElement>, keyof Props>} */
|
|
31
|
+
let { title = '', open = $bindable(true), ontoggle, class: className, children, ...rest } = $props()
|
|
32
|
+
|
|
33
|
+
const uid = $props.id()
|
|
34
|
+
setContext(DEPTH, 0)
|
|
35
|
+
|
|
36
|
+
function toggle() {
|
|
37
|
+
open = !open
|
|
38
|
+
ontoggle?.(open)
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<div class={['side-menu-group', className]} {...rest}>
|
|
43
|
+
{#if title}
|
|
44
|
+
<button type="button" id="{uid}-heading" class="heading" aria-expanded={open} aria-controls="{uid}-items" onclick={toggle}>
|
|
45
|
+
<span class="name">{title}</span>
|
|
46
|
+
<Icon name="caretDown" size="sm" />
|
|
47
|
+
</button>
|
|
48
|
+
{#if open}
|
|
49
|
+
<ul id="{uid}-items" class="items" aria-labelledby="{uid}-heading" transition:slide>{@render children()}</ul>
|
|
50
|
+
{/if}
|
|
51
|
+
{:else}
|
|
52
|
+
<ul class="items">{@render children()}</ul>
|
|
53
|
+
{/if}
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<style>
|
|
57
|
+
.side-menu-group:not(:first-child) {
|
|
58
|
+
margin-top: var(--space-5);
|
|
59
|
+
}
|
|
60
|
+
.items {
|
|
61
|
+
display: grid;
|
|
62
|
+
gap: 2px;
|
|
63
|
+
}
|
|
64
|
+
/* Muted text from the content edge, the caret right after it. */
|
|
65
|
+
.heading {
|
|
66
|
+
all: unset;
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: var(--space-1);
|
|
71
|
+
min-height: 28px;
|
|
72
|
+
max-width: 100%;
|
|
73
|
+
margin-inline: calc(var(--bleed) * -1);
|
|
74
|
+
padding-inline: var(--bleed);
|
|
75
|
+
border-radius: var(--r);
|
|
76
|
+
color: var(--muted);
|
|
77
|
+
font-size: 12px;
|
|
78
|
+
font-weight: var(--w-medium);
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
transition: color var(--dur) var(--ease-out);
|
|
81
|
+
}
|
|
82
|
+
.heading:hover {
|
|
83
|
+
color: var(--fg-2);
|
|
84
|
+
}
|
|
85
|
+
.heading:focus-visible {
|
|
86
|
+
outline: 2px solid var(--accent);
|
|
87
|
+
outline-offset: -2px;
|
|
88
|
+
}
|
|
89
|
+
.name {
|
|
90
|
+
min-width: 0;
|
|
91
|
+
overflow: clip;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
white-space: nowrap;
|
|
94
|
+
}
|
|
95
|
+
.heading > :global(.icon) {
|
|
96
|
+
flex: none;
|
|
97
|
+
rotate: 0deg;
|
|
98
|
+
transition: rotate var(--dur) var(--ease-out);
|
|
99
|
+
}
|
|
100
|
+
.heading[aria-expanded='false'] > :global(.icon) {
|
|
101
|
+
rotate: -90deg;
|
|
102
|
+
}
|
|
103
|
+
@media (pointer: coarse) {
|
|
104
|
+
.heading {
|
|
105
|
+
min-height: 44px;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export default SideMenuGroup;
|
|
2
|
+
type SideMenuGroup = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<Props & Omit<HTMLAttributes<HTMLDivElement>, keyof Props>>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const SideMenuGroup: import("svelte").Component<{
|
|
7
|
+
title?: string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* bindable
|
|
10
|
+
*/
|
|
11
|
+
open?: boolean | undefined;
|
|
12
|
+
ontoggle?: ((open: boolean) => void) | undefined;
|
|
13
|
+
children: import("svelte").Snippet;
|
|
14
|
+
} & Omit<import("svelte/elements").HTMLAttributes<HTMLDivElement>, keyof {
|
|
15
|
+
title?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* bindable
|
|
18
|
+
*/
|
|
19
|
+
open?: boolean | undefined;
|
|
20
|
+
ontoggle?: ((open: boolean) => void) | undefined;
|
|
21
|
+
children: import("svelte").Snippet;
|
|
22
|
+
}>, {}, "open">;
|
|
23
|
+
type Props = {
|
|
24
|
+
title?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* bindable
|
|
27
|
+
*/
|
|
28
|
+
open?: boolean | undefined;
|
|
29
|
+
ontoggle?: ((open: boolean) => void) | undefined;
|
|
30
|
+
children: import("svelte").Snippet;
|
|
31
|
+
};
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* SideMenu.Item: one row of a SideMenu: an icon in the icon column, the label in the label column, and a count or
|
|
4
|
+
* other trailing content centred on the trailing column. A link with href, otherwise a button. Items nested in it are
|
|
5
|
+
* its sub-items, shown under it; each level starts at its parent's label column (a child's icon there, or its label
|
|
6
|
+
* when it has none), so labels line up down the menu. A hairline runs down the parent's icon column beside them.
|
|
7
|
+
*
|
|
8
|
+
* <SideMenu.Item href="/inbox" icon="inbox" label="Inbox" count={3} current={path === '/inbox'} />
|
|
9
|
+
* <SideMenu.Item icon="gear" label="Settings" onclick={openSettings} /> a button that acts
|
|
10
|
+
* <SideMenu.Item icon="folder" label="Projects">…items…</SideMenu.Item> a button that folds them
|
|
11
|
+
* <SideMenu.Item href="/team" icon="users" label="Team" open={path.startsWith('/team')}>…</SideMenu.Item>
|
|
12
|
+
*
|
|
13
|
+
* label: the row's text. href: makes it a link. icon: an Icon name, in the icon column.
|
|
14
|
+
* current: marks the row as where you are (true is aria-current="page"; or pass "location" for a spot on the page,
|
|
15
|
+
* "step"…): it takes the raised fill. A row whose open sub-items hold the current one keeps only its brighter text,
|
|
16
|
+
* so one row is marked at a time.
|
|
17
|
+
* count: a number in a badge on the trailing column (unread, items in it); trailing: a snippet there instead.
|
|
18
|
+
* children: sub-items (SideMenu.Item). Without href the row folds them, with a caret after the label; with href they
|
|
19
|
+
* show while open is true (bindable, default false), e.g. while its page is open. ontoggle(open) after a fold.
|
|
20
|
+
* Other attributes (onclick, class, title…) and attachments go to the <a> or <button>.
|
|
21
|
+
* Keyboard: a link or button in the Tab order; a folding row says whether it is open.
|
|
22
|
+
*/
|
|
23
|
+
import { getContext, setContext } from 'svelte'
|
|
24
|
+
|
|
25
|
+
import Icon from '../Icon.svelte'
|
|
26
|
+
import { slide } from '../../lib/motion.js'
|
|
27
|
+
import { DEPTH } from './context.js'
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @typedef {object} Props
|
|
31
|
+
* @property {string} label
|
|
32
|
+
* @property {string} [href]
|
|
33
|
+
* @property {string} [icon]
|
|
34
|
+
* @property {boolean | 'page' | 'location' | 'step' | 'date' | 'time'} [current]
|
|
35
|
+
* @property {number | string | null} [count]
|
|
36
|
+
* @property {import('svelte').Snippet} [trailing]
|
|
37
|
+
* @property {boolean} [open] bindable
|
|
38
|
+
* @property {(open: boolean) => void} [ontoggle]
|
|
39
|
+
* @property {import('svelte').Snippet} [children]
|
|
40
|
+
*/
|
|
41
|
+
/** @type {Props & Omit<import('svelte/elements').HTMLAnchorAttributes & import('svelte/elements').HTMLButtonAttributes, keyof Props>} */
|
|
42
|
+
let { label, href, icon, current = false, count = null, trailing, open = $bindable(false), ontoggle, class: className, onclick, children, ...rest } = $props()
|
|
43
|
+
|
|
44
|
+
const uid = $props.id()
|
|
45
|
+
/** @type {number} */
|
|
46
|
+
const depth = getContext(DEPTH) ?? 0
|
|
47
|
+
setContext(DEPTH, depth + 1)
|
|
48
|
+
|
|
49
|
+
const ariaCurrent = $derived(current === true ? 'page' : current || undefined)
|
|
50
|
+
// A row without a link folds its sub-items.
|
|
51
|
+
const folds = $derived(!href && !!children)
|
|
52
|
+
|
|
53
|
+
/** @param {MouseEvent & { currentTarget: EventTarget & HTMLButtonElement }} e */
|
|
54
|
+
function press(e) {
|
|
55
|
+
onclick?.(e)
|
|
56
|
+
if (!folds || e.defaultPrevented) return
|
|
57
|
+
open = !open
|
|
58
|
+
ontoggle?.(open)
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
{#snippet content()}
|
|
63
|
+
{#if icon}<Icon name={icon} size="lg" />{/if}
|
|
64
|
+
<span class="name">
|
|
65
|
+
<span class="label">{label}</span>
|
|
66
|
+
{#if folds}<span class="caret"><Icon name="caretRight" size="sm" /></span>{/if}
|
|
67
|
+
</span>
|
|
68
|
+
{#if trailing}
|
|
69
|
+
<span class="trail">{@render trailing()}</span>
|
|
70
|
+
{:else if count != null}
|
|
71
|
+
<span class="trail"><span class="count">{count}</span></span>
|
|
72
|
+
{/if}
|
|
73
|
+
{/snippet}
|
|
74
|
+
|
|
75
|
+
<li class="side-menu-item">
|
|
76
|
+
{#if href}
|
|
77
|
+
<a class={['row', className]} class:bare={!icon} style:--depth={depth} {href} aria-current={ariaCurrent} {...rest} {onclick}>{@render content()}</a>
|
|
78
|
+
{:else}
|
|
79
|
+
<button
|
|
80
|
+
type="button"
|
|
81
|
+
class={['row', className]}
|
|
82
|
+
class:bare={!icon}
|
|
83
|
+
style:--depth={depth}
|
|
84
|
+
aria-current={ariaCurrent}
|
|
85
|
+
aria-expanded={folds ? open : undefined}
|
|
86
|
+
aria-controls={folds ? `${uid}-items` : undefined}
|
|
87
|
+
{...rest}
|
|
88
|
+
onclick={press}>{@render content()}</button
|
|
89
|
+
>
|
|
90
|
+
{/if}
|
|
91
|
+
{#if children && open}
|
|
92
|
+
<ul id="{uid}-items" class="items" style:--depth={depth} transition:slide>{@render children()}</ul>
|
|
93
|
+
{/if}
|
|
94
|
+
</li>
|
|
95
|
+
|
|
96
|
+
<style>
|
|
97
|
+
.items {
|
|
98
|
+
position: relative;
|
|
99
|
+
display: grid;
|
|
100
|
+
gap: 2px;
|
|
101
|
+
margin-top: 2px;
|
|
102
|
+
}
|
|
103
|
+
/* The indent line: a hairline down the parent's icon column, beside its sub-items. A border, not a background, so it
|
|
104
|
+
stays in forced colours. */
|
|
105
|
+
.items::before {
|
|
106
|
+
content: '';
|
|
107
|
+
position: absolute;
|
|
108
|
+
inset-block: 2px;
|
|
109
|
+
inset-inline-start: calc(var(--depth) * (var(--slot) + var(--gap)) + var(--slot) / 2 - 0.5px);
|
|
110
|
+
border-inline-start: 1px solid var(--line-strong);
|
|
111
|
+
pointer-events: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* The fill reaches --bleed past the content edge on both sides; each level of nesting starts one icon column and gap
|
|
115
|
+
further in, at its parent's label column. */
|
|
116
|
+
.row {
|
|
117
|
+
all: unset;
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
display: grid;
|
|
120
|
+
grid-template-columns: var(--slot) minmax(0, 1fr) auto;
|
|
121
|
+
align-items: center;
|
|
122
|
+
column-gap: var(--gap);
|
|
123
|
+
width: calc(100% + var(--bleed) * 2);
|
|
124
|
+
min-height: 28px;
|
|
125
|
+
margin-inline: calc(var(--bleed) * -1);
|
|
126
|
+
padding-inline: calc(var(--bleed) + var(--depth) * (var(--slot) + var(--gap))) var(--bleed);
|
|
127
|
+
border-radius: var(--r);
|
|
128
|
+
color: var(--fg);
|
|
129
|
+
font-size: 13px;
|
|
130
|
+
font-weight: var(--w-medium);
|
|
131
|
+
text-decoration: none;
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
transition:
|
|
134
|
+
background-color var(--dur) var(--ease-out),
|
|
135
|
+
color var(--dur) var(--ease-out);
|
|
136
|
+
}
|
|
137
|
+
/* No icon: the label takes the icon column's place. */
|
|
138
|
+
.row.bare {
|
|
139
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
140
|
+
}
|
|
141
|
+
.row > :global(.icon) {
|
|
142
|
+
justify-self: center;
|
|
143
|
+
color: var(--muted);
|
|
144
|
+
transition: color var(--dur) var(--ease-out);
|
|
145
|
+
}
|
|
146
|
+
.row:hover {
|
|
147
|
+
background: var(--control-2);
|
|
148
|
+
}
|
|
149
|
+
.row:hover > :global(.icon) {
|
|
150
|
+
color: var(--fg-2);
|
|
151
|
+
}
|
|
152
|
+
.row[aria-current] {
|
|
153
|
+
background: var(--control-3);
|
|
154
|
+
}
|
|
155
|
+
.row[aria-current] > :global(.icon) {
|
|
156
|
+
color: var(--fg);
|
|
157
|
+
}
|
|
158
|
+
/* The current row is further down, among this row's sub-items: only that one takes the fill. */
|
|
159
|
+
/* :global: the sub-items are other instances of this component. */
|
|
160
|
+
.side-menu-item:has(> .items :global(.row[aria-current])) > .row[aria-current]:not(:hover) {
|
|
161
|
+
background: none;
|
|
162
|
+
}
|
|
163
|
+
.row:focus-visible {
|
|
164
|
+
outline: 2px solid var(--accent);
|
|
165
|
+
outline-offset: -2px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.name {
|
|
169
|
+
display: flex;
|
|
170
|
+
align-items: center;
|
|
171
|
+
gap: var(--space-1);
|
|
172
|
+
min-width: 0;
|
|
173
|
+
}
|
|
174
|
+
.label {
|
|
175
|
+
min-width: 0;
|
|
176
|
+
overflow: clip;
|
|
177
|
+
text-overflow: ellipsis;
|
|
178
|
+
white-space: nowrap;
|
|
179
|
+
}
|
|
180
|
+
.caret {
|
|
181
|
+
display: inline-flex;
|
|
182
|
+
flex: none;
|
|
183
|
+
color: var(--muted);
|
|
184
|
+
rotate: 0deg;
|
|
185
|
+
transition: rotate var(--dur) var(--ease-out);
|
|
186
|
+
}
|
|
187
|
+
.row[aria-expanded='true'] .caret {
|
|
188
|
+
rotate: 90deg;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* The trailing column: its content centred on it, so counts line up with the header's main action. */
|
|
192
|
+
.trail {
|
|
193
|
+
display: grid;
|
|
194
|
+
place-items: center;
|
|
195
|
+
min-width: var(--trail);
|
|
196
|
+
}
|
|
197
|
+
.count {
|
|
198
|
+
display: inline-grid;
|
|
199
|
+
place-items: center;
|
|
200
|
+
min-width: 20px;
|
|
201
|
+
min-height: 20px;
|
|
202
|
+
padding-inline: var(--space-1);
|
|
203
|
+
border-radius: var(--r-sm);
|
|
204
|
+
background: var(--fill-3);
|
|
205
|
+
color: var(--fg-2);
|
|
206
|
+
font: var(--w-medium) 11px var(--font-data);
|
|
207
|
+
font-variant-numeric: tabular-nums;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@media (pointer: coarse) {
|
|
211
|
+
.row {
|
|
212
|
+
min-height: 44px;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
@media (forced-colors: active) {
|
|
216
|
+
.row[aria-current] {
|
|
217
|
+
outline: 1px solid Highlight;
|
|
218
|
+
outline-offset: -1px;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
</style>
|