@sveltia/ui 0.2.5 → 0.3.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/package/components/{core → button}/button.svelte +3 -2
- package/package/components/{core → button}/button.svelte.d.ts +5 -4
- package/package/components/{composite → button}/select-button-group.svelte +6 -3
- package/package/components/{composite → calendar}/calendar.svelte +9 -5
- package/package/components/{composite → calendar}/calendar.svelte.d.ts +1 -0
- package/package/components/{composite → checkbox}/checkbox-group.svelte +1 -1
- package/package/components/{composite → checkbox}/checkbox-group.svelte.d.ts +2 -2
- package/package/components/{core → checkbox}/checkbox.svelte +7 -5
- package/package/components/{core → checkbox}/checkbox.svelte.d.ts +4 -2
- package/package/components/{core → dialog}/dialog.svelte +4 -3
- package/package/components/{core → dialog}/dialog.svelte.d.ts +1 -0
- package/package/components/{composite → disclosure}/disclosure.svelte +5 -4
- package/package/components/{composite → disclosure}/disclosure.svelte.d.ts +2 -1
- package/package/components/{core/separator.svelte → divider/divider.svelte} +5 -4
- package/package/components/divider/divider.svelte.d.ts +29 -0
- package/package/components/{core → divider}/spacer.svelte +4 -0
- package/package/components/{core → divider}/spacer.svelte.d.ts +1 -0
- package/package/components/{core → drawer}/drawer.svelte +4 -3
- package/package/components/{core → drawer}/drawer.svelte.d.ts +1 -0
- package/package/components/{core → icon}/icon.svelte +5 -0
- package/package/components/{core → icon}/icon.svelte.d.ts +6 -2
- package/package/components/listbox/listbox.svelte +74 -0
- package/package/components/{composite → listbox}/listbox.svelte.d.ts +2 -0
- package/package/components/listbox/option-group.svelte +47 -0
- package/package/components/listbox/option-group.svelte.d.ts +38 -0
- package/package/components/{core → listbox}/option.svelte +34 -2
- package/package/components/{core → listbox}/option.svelte.d.ts +7 -3
- package/package/components/{core → menu}/menu-button.svelte +2 -16
- package/package/components/{core → menu}/menu-button.svelte.d.ts +4 -1
- package/package/components/{core → menu}/menu-item-checkbox.svelte +1 -0
- package/package/components/{core → menu}/menu-item-checkbox.svelte.d.ts +4 -1
- package/package/components/{composite → menu}/menu-item-group.svelte +5 -1
- package/package/components/{composite → menu}/menu-item-group.svelte.d.ts +1 -0
- package/package/components/{core → menu}/menu-item-radio.svelte +2 -0
- package/package/components/{core → menu}/menu-item-radio.svelte.d.ts +5 -1
- package/package/components/{core → menu}/menu-item.svelte +6 -6
- package/package/components/{core → menu}/menu-item.svelte.d.ts +4 -1
- package/package/components/{composite → menu}/menu.svelte +2 -1
- package/package/components/{composite → menu}/menu.svelte.d.ts +1 -0
- package/package/components/{composite → radio}/radio-group.svelte +6 -2
- package/package/components/{composite → radio}/radio-group.svelte.d.ts +1 -1
- package/package/components/{core → radio}/radio.svelte +6 -4
- package/package/components/{core → radio}/radio.svelte.d.ts +4 -2
- package/package/components/{composite → select}/combobox.svelte +7 -6
- package/package/components/{composite → select}/combobox.svelte.d.ts +3 -2
- package/package/components/{composite → select}/select.svelte +3 -1
- package/package/components/{composite → select}/select.svelte.d.ts +7 -3
- package/package/components/{core → slider}/slider.svelte +58 -47
- package/package/components/{core → slider}/slider.svelte.d.ts +12 -10
- package/package/components/{core → switch}/switch.svelte +36 -19
- package/package/components/{core → switch}/switch.svelte.d.ts +3 -2
- package/package/components/table/table-body.svelte +23 -0
- package/package/components/table/table-body.svelte.d.ts +34 -0
- package/package/components/table/table-cell.svelte +23 -0
- package/package/components/table/table-cell.svelte.d.ts +34 -0
- package/package/components/table/table-col-header.svelte +23 -0
- package/package/components/table/table-col-header.svelte.d.ts +34 -0
- package/package/components/table/table-foot.svelte +23 -0
- package/package/components/table/table-foot.svelte.d.ts +34 -0
- package/package/components/table/table-head.svelte +23 -0
- package/package/components/table/table-head.svelte.d.ts +34 -0
- package/package/components/table/table-row-header.svelte +23 -0
- package/package/components/table/table-row-header.svelte.d.ts +34 -0
- package/package/components/table/table-row.svelte +23 -0
- package/package/components/table/table-row.svelte.d.ts +38 -0
- package/package/components/table/table.svelte +44 -0
- package/package/components/table/table.svelte.d.ts +36 -0
- package/package/components/{composite → tabs}/tab-list.svelte +3 -2
- package/package/components/{composite → tabs}/tab-list.svelte.d.ts +6 -5
- package/package/components/{core → tabs}/tab-panel.svelte +1 -0
- package/package/components/{core → tabs}/tab-panel.svelte.d.ts +1 -0
- package/package/components/{core → tabs}/tab.svelte +2 -1
- package/package/components/{core → tabs}/tab.svelte.d.ts +1 -0
- package/package/components/{editor/markdown.svelte → text-field/markdown-editor.svelte} +10 -6
- package/package/components/text-field/markdown-editor.svelte.d.ts +26 -0
- package/package/components/{core → text-field}/number-input.svelte +13 -7
- package/package/components/{core → text-field}/number-input.svelte.d.ts +7 -3
- package/package/components/{core → text-field}/password-input.svelte +6 -3
- package/package/components/{core → text-field}/password-input.svelte.d.ts +8 -3
- package/package/components/{core → text-field}/search-bar.svelte +5 -2
- package/package/components/{core → text-field}/search-bar.svelte.d.ts +8 -3
- package/package/components/{core → text-field}/text-area.svelte +3 -1
- package/package/components/{core → text-field}/text-area.svelte.d.ts +9 -5
- package/package/components/{core → text-field}/text-input.svelte +6 -4
- package/package/components/{core → text-field}/text-input.svelte.d.ts +11 -7
- package/package/components/{core → toolbar}/toolbar.svelte +1 -0
- package/package/components/{core → toolbar}/toolbar.svelte.d.ts +2 -1
- package/package/components/util/app-shell.svelte +11 -40
- package/package/components/util/group.js +305 -0
- package/package/components/{core → util}/group.svelte +5 -11
- package/package/components/{core → util}/group.svelte.d.ts +4 -2
- package/package/components/util/popup.d.ts +30 -0
- package/package/components/{helpers → util}/popup.js +26 -25
- package/package/components/util/popup.svelte +14 -5
- package/package/components/util/{misc.d.ts → util.d.ts} +1 -0
- package/package/components/util/{misc.js → util.js} +15 -0
- package/package/index.d.ts +46 -41
- package/package/index.js +48 -83
- package/package/styles/core.scss +5 -34
- package/package/styles/variables.scss +6 -8
- package/package.json +351 -317
- package/package/components/composite/grid.svelte +0 -24
- package/package/components/composite/grid.svelte.d.ts +0 -31
- package/package/components/composite/listbox.svelte +0 -63
- package/package/components/core/grid-cell.svelte +0 -13
- package/package/components/core/grid-cell.svelte.d.ts +0 -29
- package/package/components/core/row-group.svelte +0 -13
- package/package/components/core/row-group.svelte.d.ts +0 -29
- package/package/components/core/row.svelte +0 -13
- package/package/components/core/row.svelte.d.ts +0 -33
- package/package/components/core/separator.svelte.d.ts +0 -26
- package/package/components/editor/markdown.svelte.d.ts +0 -25
- package/package/components/helpers/group.js +0 -253
- package/package/components/helpers/popup.d.ts +0 -30
- package/package/components/helpers/util.d.ts +0 -1
- package/package/components/helpers/util.js +0 -14
- package/package/components/{composite → button}/select-button-group.svelte.d.ts +4 -4
- /package/package/components/{core → button}/select-button.svelte +0 -0
- /package/package/components/{core → button}/select-button.svelte.d.ts +0 -0
- /package/package/components/{helpers → util}/group.d.ts +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
A generic button widget based on the HTML `<button>` element.
|
|
3
4
|
@see https://w3c.github.io/aria/#button
|
|
4
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/button/
|
|
5
6
|
-->
|
|
@@ -151,7 +152,7 @@ button:global(.primary) :global(.label:only-child), button:global(.secondary) :g
|
|
|
151
152
|
padding: 0 4px;
|
|
152
153
|
}
|
|
153
154
|
button:global(.primary) {
|
|
154
|
-
border-color: var(--
|
|
155
|
+
border-color: var(--control-border-color);
|
|
155
156
|
color: var(--primary-accent-color-foreground);
|
|
156
157
|
background-color: var(--primary-accent-color);
|
|
157
158
|
}
|
|
@@ -173,7 +174,7 @@ button:global(.secondary)[aria-pressed=true] {
|
|
|
173
174
|
background-color: var(--primary-accent-color);
|
|
174
175
|
}
|
|
175
176
|
button:global(.tertiary) {
|
|
176
|
-
border-color: var(--
|
|
177
|
+
border-color: var(--control-border-color);
|
|
177
178
|
color: var(--highlight-foreground-color);
|
|
178
179
|
background-color: var(--tertiary-background-color);
|
|
179
180
|
}
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} ButtonEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} ButtonSlots */
|
|
4
4
|
/**
|
|
5
|
+
* A generic button widget based on the HTML `<button>` element.
|
|
5
6
|
* @see https://w3c.github.io/aria/#button
|
|
6
7
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/button/
|
|
7
8
|
*/
|
|
8
9
|
export default class Button extends SvelteComponentTyped<{
|
|
9
10
|
[x: string]: any;
|
|
10
11
|
label?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
type?: "reset" | "submit" | "button";
|
|
11
14
|
class?: string;
|
|
12
15
|
element?: HTMLButtonElement;
|
|
13
|
-
type?: "reset" | "submit" | "button";
|
|
14
16
|
role?: string;
|
|
15
17
|
size?: "small" | "medium" | "large";
|
|
16
18
|
hidden?: boolean;
|
|
17
|
-
disabled?: boolean;
|
|
18
19
|
pressed?: boolean | "true" | "false" | "mixed";
|
|
19
20
|
popupPosition?: PopupPosition;
|
|
20
21
|
}, {
|
|
@@ -75,13 +76,13 @@ declare const __propDef: {
|
|
|
75
76
|
props: {
|
|
76
77
|
[x: string]: any;
|
|
77
78
|
label?: string;
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
type?: ('button' | 'submit' | 'reset');
|
|
78
81
|
class?: string;
|
|
79
82
|
element?: HTMLButtonElement | null;
|
|
80
|
-
type?: ('button' | 'submit' | 'reset');
|
|
81
83
|
role?: string;
|
|
82
84
|
size?: ('small' | 'medium' | 'large');
|
|
83
85
|
hidden?: boolean;
|
|
84
|
-
disabled?: boolean;
|
|
85
86
|
pressed?: (boolean | 'false' | 'mixed' | 'true' | undefined);
|
|
86
87
|
popupPosition?: PopupPosition;
|
|
87
88
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
8
|
import { createEventDispatcher } from 'svelte';
|
|
9
|
-
import { activateGroup } from '../
|
|
9
|
+
import { activateGroup } from '../util/group';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* CSS class name on the button.
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
34
34
|
<div
|
|
35
35
|
class="sui select-button-group {className}"
|
|
36
|
+
tabindex="-1"
|
|
36
37
|
role="radiogroup"
|
|
37
|
-
tabindex="0"
|
|
38
38
|
aria-label={ariaLabel || undefined}
|
|
39
39
|
aria-disabled={disabled ? true : undefined}
|
|
40
40
|
bind:this={element}
|
|
@@ -52,6 +52,9 @@
|
|
|
52
52
|
display: inline-flex;
|
|
53
53
|
align-items: center;
|
|
54
54
|
}
|
|
55
|
+
.select-button-group:focus-visible {
|
|
56
|
+
outline-width: 0 !important;
|
|
57
|
+
}
|
|
55
58
|
.select-button-group :global(button) {
|
|
56
59
|
border-radius: 0;
|
|
57
60
|
color: var(--secondary-foreground-color);
|
|
@@ -60,7 +63,7 @@
|
|
|
60
63
|
border-radius: 4px 0 0 4px;
|
|
61
64
|
}
|
|
62
65
|
.select-button-group :global(button):not(:first-child) {
|
|
63
|
-
|
|
66
|
+
border-left-width: 0;
|
|
64
67
|
}
|
|
65
68
|
.select-button-group :global(button):last-child {
|
|
66
69
|
border-radius: 0 4px 4px 0;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
A calendar (date picker) widget.
|
|
4
|
+
-->
|
|
1
5
|
<script>
|
|
2
6
|
import { _ } from 'svelte-i18n';
|
|
3
|
-
import Button from '../
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
+
import Button from '../button/button.svelte';
|
|
8
|
+
import Divider from '../divider/divider.svelte';
|
|
9
|
+
import Spacer from '../divider/spacer.svelte';
|
|
10
|
+
import Icon from '../icon/icon.svelte';
|
|
7
11
|
|
|
8
12
|
/** @type {string?} */
|
|
9
13
|
export let value = undefined;
|
|
@@ -78,7 +82,7 @@
|
|
|
78
82
|
{/each}
|
|
79
83
|
</div>
|
|
80
84
|
</div>
|
|
81
|
-
<
|
|
85
|
+
<Divider orientation="vertical" />
|
|
82
86
|
<div role="group" aria-label={$_('_sui.calendar.month')}>
|
|
83
87
|
<div class="grid">
|
|
84
88
|
{#each [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] as month}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} CalendarProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} CalendarEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} CalendarSlots */
|
|
4
|
+
/** A calendar (date picker) widget. */
|
|
4
5
|
export default class Calendar extends SvelteComponentTyped<{
|
|
5
6
|
value?: string;
|
|
6
7
|
}, {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} CheckboxGroupProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} CheckboxGroupEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} CheckboxGroupSlots */
|
|
4
|
-
/** The container of `<Checkbox>`es. */
|
|
4
|
+
/** The layout container of `<Checkbox>`es. */
|
|
5
5
|
export default class CheckboxGroup extends SvelteComponentTyped<{
|
|
6
6
|
[x: string]: any;
|
|
7
7
|
class?: string;
|
|
8
|
-
orientation?: "
|
|
8
|
+
orientation?: "vertical" | "horizontal";
|
|
9
9
|
ariaLabel?: string;
|
|
10
10
|
}, {
|
|
11
11
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
The equivalent of the HTML `<input type="checkbox">` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox
|
|
3
5
|
@see https://w3c.github.io/aria/#checkbox
|
|
4
6
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/
|
|
5
7
|
-->
|
|
6
8
|
<script>
|
|
7
9
|
import { createEventDispatcher } from 'svelte';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
10
|
+
import Button from '../button/button.svelte';
|
|
11
|
+
import Icon from '../icon/icon.svelte';
|
|
12
|
+
import { getRandomId } from '../util/util';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* CSS class name on the button.
|
|
@@ -107,7 +109,7 @@
|
|
|
107
109
|
justify-content: center;
|
|
108
110
|
overflow: hidden;
|
|
109
111
|
border-width: 2px;
|
|
110
|
-
border-color: var(--
|
|
112
|
+
border-color: var(--checkbox-border-color);
|
|
111
113
|
border-radius: 4px;
|
|
112
114
|
width: 20px;
|
|
113
115
|
height: 20px;
|
|
@@ -123,7 +125,7 @@
|
|
|
123
125
|
background-color: var(--primary-accent-color-lighter);
|
|
124
126
|
}
|
|
125
127
|
.checkbox :global(button[aria-checked="mixed"]) {
|
|
126
|
-
color: var(--
|
|
128
|
+
color: var(--checkbox-border-color);
|
|
127
129
|
}
|
|
128
130
|
.checkbox :global(button[aria-checked="false"]) {
|
|
129
131
|
color: transparent;
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} CheckboxEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} CheckboxSlots */
|
|
4
4
|
/**
|
|
5
|
+
* The equivalent of the HTML `<input type="checkbox">` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox
|
|
5
7
|
* @see https://w3c.github.io/aria/#checkbox
|
|
6
8
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/
|
|
7
9
|
*/
|
|
8
10
|
export default class Checkbox extends SvelteComponentTyped<{
|
|
9
11
|
label?: string;
|
|
10
|
-
class?: string;
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
name?: string;
|
|
13
14
|
value?: string;
|
|
15
|
+
class?: string;
|
|
14
16
|
checked?: string | boolean;
|
|
15
17
|
indeterminate?: boolean;
|
|
16
18
|
}, {
|
|
@@ -28,10 +30,10 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
28
30
|
declare const __propDef: {
|
|
29
31
|
props: {
|
|
30
32
|
label?: string | null;
|
|
31
|
-
class?: string;
|
|
32
33
|
disabled?: boolean;
|
|
33
34
|
name?: string;
|
|
34
35
|
value?: string | null;
|
|
36
|
+
class?: string;
|
|
35
37
|
checked?: (boolean | string | undefined);
|
|
36
38
|
indeterminate?: boolean;
|
|
37
39
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
A feedback dialog widget based on the HTML `<dialog>` element.
|
|
3
4
|
@see https://w3c.github.io/aria/#dialog
|
|
4
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
5
6
|
-->
|
|
6
7
|
<script>
|
|
7
8
|
import { createEventDispatcher, onMount } from 'svelte';
|
|
8
9
|
import { _ } from 'svelte-i18n';
|
|
9
|
-
import Button from '
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import Button from '../button/button.svelte';
|
|
11
|
+
import Spacer from '../divider/spacer.svelte';
|
|
12
|
+
import Icon from '../icon/icon.svelte';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* CSS class name on the button.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} DialogEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} DialogSlots */
|
|
4
4
|
/**
|
|
5
|
+
* A feedback dialog widget based on the HTML `<dialog>` element.
|
|
5
6
|
* @see https://w3c.github.io/aria/#dialog
|
|
6
7
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
7
8
|
*/
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
|
|
3
|
+
A disclosure (expander) widget. The equivalent of the HTML `<details>` element.
|
|
4
4
|
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
|
|
5
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
|
|
5
6
|
-->
|
|
6
7
|
<script>
|
|
7
|
-
import Button from '../
|
|
8
|
-
import Icon from '../
|
|
9
|
-
import { getRandomId } from '../
|
|
8
|
+
import Button from '../button/button.svelte';
|
|
9
|
+
import Icon from '../icon/icon.svelte';
|
|
10
|
+
import { getRandomId } from '../util/util';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* CSS class name on the button.
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} DisclosureEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} DisclosureSlots */
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* A disclosure (expander) widget. The equivalent of the HTML `<details>` element.
|
|
6
6
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
|
|
7
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
|
|
7
8
|
*/
|
|
8
9
|
export default class Disclosure extends SvelteComponentTyped<{
|
|
9
10
|
label?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
A content divider with a visible vertical/horizontal line.
|
|
3
4
|
@see https://w3c.github.io/aria/#separator
|
|
4
5
|
-->
|
|
5
6
|
<script>
|
|
@@ -15,15 +16,15 @@
|
|
|
15
16
|
export { className as class };
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
|
-
<div role="separator" class="sui
|
|
19
|
+
<div role="separator" class="sui divider {className}" aria-orientation={orientation} />
|
|
19
20
|
|
|
20
|
-
<style>.
|
|
21
|
+
<style>.divider {
|
|
21
22
|
flex: none;
|
|
22
23
|
background-color: var(--secondary-border-color);
|
|
23
24
|
}
|
|
24
|
-
.
|
|
25
|
+
.divider[aria-orientation=horizontal] {
|
|
25
26
|
height: 1px;
|
|
26
27
|
}
|
|
27
|
-
.
|
|
28
|
+
.divider[aria-orientation=vertical] {
|
|
28
29
|
width: 1px;
|
|
29
30
|
}</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} DividerProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} DividerEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} DividerSlots */
|
|
4
|
+
/**
|
|
5
|
+
* A content divider with a visible vertical/horizontal line.
|
|
6
|
+
* @see https://w3c.github.io/aria/#separator
|
|
7
|
+
*/
|
|
8
|
+
export default class Divider extends SvelteComponentTyped<{
|
|
9
|
+
class?: string;
|
|
10
|
+
orientation?: "vertical" | "horizontal";
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}> {
|
|
14
|
+
}
|
|
15
|
+
export type DividerProps = typeof __propDef.props;
|
|
16
|
+
export type DividerEvents = typeof __propDef.events;
|
|
17
|
+
export type DividerSlots = typeof __propDef.slots;
|
|
18
|
+
import { SvelteComponentTyped } from "svelte";
|
|
19
|
+
declare const __propDef: {
|
|
20
|
+
props: {
|
|
21
|
+
class?: string;
|
|
22
|
+
orientation?: ('horizontal' | 'vertical');
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
};
|
|
27
|
+
slots: {};
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} SpacerProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} SpacerEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SpacerSlots */
|
|
4
|
+
/** A content divider with no line. It can be flexible. */
|
|
4
5
|
export default class Spacer extends SvelteComponentTyped<{
|
|
5
6
|
class?: string;
|
|
6
7
|
flex?: boolean;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
A generic drawer widget based on the HTML `<dialog>` element.
|
|
3
4
|
@see https://w3c.github.io/aria/#dialog
|
|
4
5
|
@see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
5
6
|
-->
|
|
6
7
|
<script>
|
|
7
8
|
import { createEventDispatcher, onMount } from 'svelte';
|
|
8
9
|
import { _ } from 'svelte-i18n';
|
|
9
|
-
import Button from '
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import Button from '../button/button.svelte';
|
|
11
|
+
import Spacer from '../divider/spacer.svelte';
|
|
12
|
+
import Icon from '../icon/icon.svelte';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* CSS class name on the button.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} DrawerEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} DrawerSlots */
|
|
4
4
|
/**
|
|
5
|
+
* A generic drawer widget based on the HTML `<dialog>` element.
|
|
5
6
|
* @see https://w3c.github.io/aria/#dialog
|
|
6
7
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
7
8
|
*/
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} IconProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} IconEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} IconSlots */
|
|
4
|
+
/**
|
|
5
|
+
* A Material Symbols icon.
|
|
6
|
+
* @see https://developers.google.com/fonts/docs/material_symbols
|
|
7
|
+
*/
|
|
4
8
|
export default class Icon extends SvelteComponentTyped<{
|
|
5
9
|
label?: string;
|
|
6
|
-
class?: string;
|
|
7
10
|
name?: string;
|
|
11
|
+
class?: string;
|
|
8
12
|
}, {
|
|
9
13
|
[evt: string]: CustomEvent<any>;
|
|
10
14
|
}, {}> {
|
|
@@ -16,8 +20,8 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
16
20
|
declare const __propDef: {
|
|
17
21
|
props: {
|
|
18
22
|
label?: string;
|
|
19
|
-
class?: string;
|
|
20
23
|
name?: string;
|
|
24
|
+
class?: string;
|
|
21
25
|
};
|
|
22
26
|
events: {
|
|
23
27
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
A list widget with selectable options. The equivalent of the HTML `<select multiple>` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
|
|
5
|
+
@see https://w3c.github.io/aria/#listbox
|
|
6
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
|
|
7
|
+
-->
|
|
8
|
+
<svelte:options accessors={true} />
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { activateGroup } from '../util/group';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* CSS class name on the button.
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
let className = '';
|
|
18
|
+
|
|
19
|
+
export { className as class };
|
|
20
|
+
|
|
21
|
+
/** @type {HTMLElement?} */
|
|
22
|
+
export let element = undefined;
|
|
23
|
+
|
|
24
|
+
export let multiple = false;
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
class="sui listbox {className}"
|
|
29
|
+
tabindex="0"
|
|
30
|
+
role="listbox"
|
|
31
|
+
aria-multiselectable={multiple}
|
|
32
|
+
{...$$restProps}
|
|
33
|
+
bind:this={element}
|
|
34
|
+
on:click
|
|
35
|
+
on:select
|
|
36
|
+
use:activateGroup
|
|
37
|
+
>
|
|
38
|
+
<slot />
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<style>[role=listbox] {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
color: inherit;
|
|
45
|
+
margin: 0;
|
|
46
|
+
border-width: 1px;
|
|
47
|
+
border-color: var(--control-border-color);
|
|
48
|
+
border-radius: 4px;
|
|
49
|
+
padding: 4px;
|
|
50
|
+
min-width: 160px;
|
|
51
|
+
}
|
|
52
|
+
[role=listbox] :global([role="separator"]) {
|
|
53
|
+
margin: 4px;
|
|
54
|
+
}
|
|
55
|
+
[role=listbox]:global(.tabs) {
|
|
56
|
+
padding: 0;
|
|
57
|
+
border-width: 0 1px 0 0;
|
|
58
|
+
border-color: var(--control-border-color);
|
|
59
|
+
}
|
|
60
|
+
[role=listbox]:global(.tabs) :global(.option button) {
|
|
61
|
+
justify-content: flex-start;
|
|
62
|
+
border-width: 0 2px 0 0;
|
|
63
|
+
border-color: transparent;
|
|
64
|
+
padding: 0 12px;
|
|
65
|
+
border-top-right-radius: 0;
|
|
66
|
+
border-bottom-right-radius: 0;
|
|
67
|
+
height: var(--tab--medium--height);
|
|
68
|
+
}
|
|
69
|
+
[role=listbox]:global(.tabs) :global(.option button) :global(.icon) {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
[role=listbox]:global(.tabs) :global(.option button[aria-selected="true"]) {
|
|
73
|
+
border-color: var(--primary-accent-color-lighter);
|
|
74
|
+
}</style>
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} ListboxEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} ListboxSlots */
|
|
4
4
|
/**
|
|
5
|
+
* A list widget with selectable options. The equivalent of the HTML `<select multiple>` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
|
|
5
7
|
* @see https://w3c.github.io/aria/#listbox
|
|
6
8
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/listbox/
|
|
7
9
|
*/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
A group within a `<Listbox>`. The equivalent of the HTML `<optgroup>` element. It can contain one
|
|
4
|
+
or more `<Option>`s.
|
|
5
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup
|
|
6
|
+
@see https://w3c.github.io/aria/#listbox
|
|
7
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/listbox/examples/listbox-grouped/
|
|
8
|
+
-->
|
|
9
|
+
<script>
|
|
10
|
+
import { getRandomId } from '../util/util';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* CSS class name on the group.
|
|
14
|
+
* @type {string}
|
|
15
|
+
*/
|
|
16
|
+
let className = '';
|
|
17
|
+
|
|
18
|
+
export { className as class };
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The group’s label to be displayed above the child `<Option>`s.
|
|
22
|
+
*/
|
|
23
|
+
export let label = '';
|
|
24
|
+
|
|
25
|
+
const id = getRandomId('optgroup');
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<div
|
|
29
|
+
{id}
|
|
30
|
+
class="sui optgroup {className}"
|
|
31
|
+
role="group"
|
|
32
|
+
aria-labelledby="{id}-label"
|
|
33
|
+
{...$$restProps}
|
|
34
|
+
>
|
|
35
|
+
<div id="{id}-label" class="label" role="none">{label}</div>
|
|
36
|
+
<slot />
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<style>.optgroup:not(:first-child) {
|
|
40
|
+
margin: 12px 0 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.label {
|
|
44
|
+
margin: 8px;
|
|
45
|
+
color: var(--secondary-foreground-color);
|
|
46
|
+
font-size: var(--font-size--small);
|
|
47
|
+
}</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} OptionGroupProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} OptionGroupEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} OptionGroupSlots */
|
|
4
|
+
/**
|
|
5
|
+
* A group within a `<Listbox>`. The equivalent of the HTML `<optgroup>` element. It can contain one
|
|
6
|
+
* or more `<Option>`s.
|
|
7
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup
|
|
8
|
+
* @see https://w3c.github.io/aria/#listbox
|
|
9
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/listbox/examples/listbox-grouped/
|
|
10
|
+
*/
|
|
11
|
+
export default class OptionGroup extends SvelteComponentTyped<{
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
label?: string;
|
|
14
|
+
class?: string;
|
|
15
|
+
}, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {
|
|
18
|
+
default: {};
|
|
19
|
+
}> {
|
|
20
|
+
}
|
|
21
|
+
export type OptionGroupProps = typeof __propDef.props;
|
|
22
|
+
export type OptionGroupEvents = typeof __propDef.events;
|
|
23
|
+
export type OptionGroupSlots = typeof __propDef.slots;
|
|
24
|
+
import { SvelteComponentTyped } from "svelte";
|
|
25
|
+
declare const __propDef: {
|
|
26
|
+
props: {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
label?: string;
|
|
29
|
+
class?: string;
|
|
30
|
+
};
|
|
31
|
+
events: {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
};
|
|
34
|
+
slots: {
|
|
35
|
+
default: {};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export {};
|