@sveltia/ui 0.2.4 → 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 +2 -1
- package/package/components/{core → button}/button.svelte.d.ts +6 -5
- package/package/components/{composite → button}/select-button-group.svelte +8 -5
- package/package/components/{composite → button}/select-button-group.svelte.d.ts +6 -6
- package/package/components/{core → button}/select-button.svelte +2 -2
- package/package/components/{core → button}/select-button.svelte.d.ts +2 -2
- 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 +3 -2
- package/package/components/{composite → checkbox}/checkbox-group.svelte.d.ts +2 -2
- package/package/components/{core → checkbox}/checkbox.svelte +38 -17
- package/package/components/{core → checkbox}/checkbox.svelte.d.ts +7 -3
- package/package/components/{core → dialog}/dialog.svelte +5 -4
- package/package/components/{core → dialog}/dialog.svelte.d.ts +2 -1
- 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 +5 -4
- package/package/components/{core → drawer}/drawer.svelte.d.ts +2 -1
- 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 +3 -1
- 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 +3 -17
- 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 +3 -2
- package/package/components/{composite → menu}/menu.svelte.d.ts +2 -1
- package/package/components/{composite/radio-button-group.svelte → radio/radio-group.svelte} +15 -10
- package/package/components/radio/radio-group.svelte.d.ts +40 -0
- package/package/components/{core/radio-button.svelte → radio/radio.svelte} +45 -18
- package/package/components/radio/radio.svelte.d.ts +43 -0
- package/package/components/{composite → select}/combobox.svelte +7 -6
- package/package/components/{composite → select}/combobox.svelte.d.ts +4 -3
- 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 +82 -57
- 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 +4 -3
- 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 +7 -6
- package/package/components/{core → tabs}/tab-panel.svelte +2 -1
- package/package/components/{core → tabs}/tab-panel.svelte.d.ts +2 -1
- package/package/components/{core → tabs}/tab.svelte +3 -2
- package/package/components/{core → tabs}/tab.svelte.d.ts +2 -1
- 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 +22 -12
- package/package/components/{core → text-field}/number-input.svelte.d.ts +7 -3
- package/package/components/{core → text-field}/password-input.svelte +5 -2
- 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 +2 -0
- package/package/components/{core → text-field}/text-area.svelte.d.ts +9 -5
- package/package/components/{core → text-field}/text-input.svelte +3 -1
- package/package/components/{core → text-field}/text-input.svelte.d.ts +11 -7
- package/package/components/{core → toolbar}/toolbar.svelte +2 -1
- package/package/components/{core → toolbar}/toolbar.svelte.d.ts +3 -2
- package/package/components/util/app-shell.svelte +10 -36
- 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 +36 -26
- 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 +5 -4
- package/package.json +362 -328
- 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/composite/radio-button-group.svelte.d.ts +0 -36
- package/package/components/core/grid-cell.svelte +0 -13
- package/package/components/core/grid-cell.svelte.d.ts +0 -29
- package/package/components/core/radio-button.svelte.d.ts +0 -37
- 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 -251
- 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/{helpers → util}/group.d.ts +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
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
|
-
@see https://
|
|
5
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/button/
|
|
5
6
|
-->
|
|
6
7
|
<svelte:options accessors={true} />
|
|
7
8
|
|
|
@@ -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
|
-
* @see https://
|
|
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
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
A variant of `<
|
|
3
|
+
A variant of `<RadioGroup>`, looking like normal buttons.
|
|
4
4
|
@see https://w3c.github.io/aria/#radiogroup
|
|
5
|
-
@see https://
|
|
5
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
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;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} SelectButtonGroupEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SelectButtonGroupSlots */
|
|
4
4
|
/**
|
|
5
|
-
* A variant of `<
|
|
5
|
+
* A variant of `<RadioGroup>`, looking like normal buttons.
|
|
6
6
|
* @see https://w3c.github.io/aria/#radiogroup
|
|
7
|
-
* @see https://
|
|
7
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
8
8
|
*/
|
|
9
9
|
export default class SelectButtonGroup extends SvelteComponentTyped<{
|
|
10
|
-
class?: string;
|
|
11
|
-
element?: HTMLElement;
|
|
12
10
|
disabled?: boolean;
|
|
13
11
|
value?: string;
|
|
12
|
+
class?: string;
|
|
13
|
+
element?: HTMLElement;
|
|
14
14
|
ariaLabel?: string;
|
|
15
15
|
}, {
|
|
16
16
|
change: CustomEvent<any>;
|
|
@@ -26,10 +26,10 @@ export type SelectButtonGroupSlots = typeof __propDef.slots;
|
|
|
26
26
|
import { SvelteComponentTyped } from "svelte";
|
|
27
27
|
declare const __propDef: {
|
|
28
28
|
props: {
|
|
29
|
-
class?: string;
|
|
30
|
-
element?: HTMLElement | null;
|
|
31
29
|
disabled?: boolean;
|
|
32
30
|
value?: string;
|
|
31
|
+
class?: string;
|
|
32
|
+
element?: HTMLElement | null;
|
|
33
33
|
ariaLabel?: string;
|
|
34
34
|
};
|
|
35
35
|
events: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
A variant of `<
|
|
3
|
+
A variant of `<Radio>`, looking like a normal button.
|
|
4
4
|
@see https://w3c.github.io/aria/#radio
|
|
5
|
-
@see https://
|
|
5
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
8
|
import Button from './button.svelte';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} SelectButtonEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SelectButtonSlots */
|
|
4
4
|
/**
|
|
5
|
-
* A variant of `<
|
|
5
|
+
* A variant of `<Radio>`, looking like a normal button.
|
|
6
6
|
* @see https://w3c.github.io/aria/#radio
|
|
7
|
-
* @see https://
|
|
7
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
8
8
|
*/
|
|
9
9
|
export default class SelectButton extends SvelteComponentTyped<{
|
|
10
10
|
[x: string]: any;
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
The container of `<Checkbox>`es.
|
|
3
|
+
The layout container of `<Checkbox>`es.
|
|
4
4
|
-->
|
|
5
5
|
<script>
|
|
6
6
|
/**
|
|
@@ -32,11 +32,12 @@
|
|
|
32
32
|
|
|
33
33
|
<style>.checkbox-group {
|
|
34
34
|
display: inline-flex;
|
|
35
|
-
gap: 16px;
|
|
36
35
|
}
|
|
37
36
|
.checkbox-group.horizontal {
|
|
37
|
+
gap: 16px;
|
|
38
38
|
align-items: center;
|
|
39
39
|
}
|
|
40
40
|
.checkbox-group.vertical {
|
|
41
|
+
gap: 8px;
|
|
41
42
|
flex-direction: column;
|
|
42
43
|
}</style>
|
|
@@ -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
|
-
@see https://
|
|
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.
|
|
@@ -20,6 +22,9 @@
|
|
|
20
22
|
/** @type {string} */
|
|
21
23
|
export let name = '';
|
|
22
24
|
|
|
25
|
+
/** @type {string?} */
|
|
26
|
+
export let label = undefined;
|
|
27
|
+
|
|
23
28
|
/** @type {string?} */
|
|
24
29
|
export let value = undefined;
|
|
25
30
|
|
|
@@ -35,7 +40,7 @@
|
|
|
35
40
|
const dispatch = createEventDispatcher();
|
|
36
41
|
const id = getRandomId('checkbox');
|
|
37
42
|
/** @type {Button} */
|
|
38
|
-
let
|
|
43
|
+
let buttonComponent;
|
|
39
44
|
</script>
|
|
40
45
|
|
|
41
46
|
{#if name && value && checked && !indeterminate}
|
|
@@ -43,24 +48,26 @@
|
|
|
43
48
|
{/if}
|
|
44
49
|
|
|
45
50
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
46
|
-
<
|
|
51
|
+
<span
|
|
47
52
|
class="sui checkbox {className}"
|
|
48
53
|
class:checked
|
|
49
54
|
class:indeterminate
|
|
50
55
|
class:disabled
|
|
51
56
|
on:click|preventDefault|stopPropagation={(event) => {
|
|
52
57
|
if (!(/** @type {HTMLElement} */ (event.target).matches('button'))) {
|
|
53
|
-
|
|
58
|
+
buttonComponent.element.click();
|
|
54
59
|
}
|
|
55
60
|
}}
|
|
56
61
|
>
|
|
57
62
|
<Button
|
|
58
63
|
{id}
|
|
59
64
|
{disabled}
|
|
65
|
+
{name}
|
|
66
|
+
{value}
|
|
60
67
|
role="checkbox"
|
|
61
68
|
aria-checked={indeterminate ? 'mixed' : checked}
|
|
62
69
|
aria-labelledby="{id}-label"
|
|
63
|
-
bind:this={
|
|
70
|
+
bind:this={buttonComponent}
|
|
64
71
|
on:click={(event) => {
|
|
65
72
|
event.preventDefault();
|
|
66
73
|
event.stopPropagation();
|
|
@@ -71,12 +78,16 @@
|
|
|
71
78
|
>
|
|
72
79
|
<Icon slot="start-icon" name={indeterminate ? 'remove' : 'check'} />
|
|
73
80
|
</Button>
|
|
74
|
-
{#if $$slots.default}
|
|
81
|
+
{#if $$slots.default || label}
|
|
75
82
|
<label id="{id}-label">
|
|
76
|
-
|
|
83
|
+
{#if $$slots.default}
|
|
84
|
+
<slot />
|
|
85
|
+
{:else}
|
|
86
|
+
{label}
|
|
87
|
+
{/if}
|
|
77
88
|
</label>
|
|
78
89
|
{/if}
|
|
79
|
-
</
|
|
90
|
+
</span>
|
|
80
91
|
|
|
81
92
|
<style>.checkbox {
|
|
82
93
|
display: inline-flex;
|
|
@@ -90,25 +101,35 @@
|
|
|
90
101
|
.checkbox.disabled {
|
|
91
102
|
cursor: default;
|
|
92
103
|
}
|
|
104
|
+
.checkbox.disabled label {
|
|
105
|
+
color: var(--disabled-foreground-color);
|
|
106
|
+
}
|
|
93
107
|
.checkbox :global(button) {
|
|
94
108
|
align-items: center;
|
|
95
109
|
justify-content: center;
|
|
96
110
|
overflow: hidden;
|
|
97
111
|
border-width: 2px;
|
|
98
|
-
border-color: var(--
|
|
112
|
+
border-color: var(--checkbox-border-color);
|
|
99
113
|
border-radius: 4px;
|
|
100
|
-
width:
|
|
101
|
-
height:
|
|
114
|
+
width: 20px;
|
|
115
|
+
height: 20px;
|
|
102
116
|
color: var(--primary-accent-color-lighter);
|
|
103
117
|
transition: all 200ms;
|
|
104
118
|
}
|
|
105
119
|
.checkbox :global(button) :global(.icon) {
|
|
106
|
-
font-size:
|
|
120
|
+
font-size: 20px;
|
|
121
|
+
}
|
|
122
|
+
.checkbox :global(button[aria-checked="true"]) {
|
|
123
|
+
border-color: var(--primary-accent-color-lighter);
|
|
124
|
+
color: var(--control-background-color);
|
|
125
|
+
background-color: var(--primary-accent-color-lighter);
|
|
107
126
|
}
|
|
108
|
-
.checkbox :global(button[aria-checked="true"]),
|
|
109
127
|
.checkbox :global(button[aria-checked="mixed"]) {
|
|
110
|
-
color: var(--
|
|
128
|
+
color: var(--checkbox-border-color);
|
|
111
129
|
}
|
|
112
130
|
.checkbox :global(button[aria-checked="false"]) {
|
|
113
131
|
color: transparent;
|
|
132
|
+
}
|
|
133
|
+
.checkbox label {
|
|
134
|
+
cursor: inherit;
|
|
114
135
|
}</style>
|
|
@@ -2,14 +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
|
-
* @see https://
|
|
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
12
|
disabled?: boolean;
|
|
11
13
|
name?: string;
|
|
12
14
|
value?: string;
|
|
15
|
+
class?: string;
|
|
13
16
|
checked?: string | boolean;
|
|
14
17
|
indeterminate?: boolean;
|
|
15
18
|
}, {
|
|
@@ -26,10 +29,11 @@ export type CheckboxSlots = typeof __propDef.slots;
|
|
|
26
29
|
import { SvelteComponentTyped } from "svelte";
|
|
27
30
|
declare const __propDef: {
|
|
28
31
|
props: {
|
|
29
|
-
|
|
32
|
+
label?: string | null;
|
|
30
33
|
disabled?: boolean;
|
|
31
34
|
name?: string;
|
|
32
35
|
value?: string | null;
|
|
36
|
+
class?: string;
|
|
33
37
|
checked?: (boolean | string | undefined);
|
|
34
38
|
indeterminate?: boolean;
|
|
35
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
|
-
@see https://
|
|
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,8 +2,9 @@
|
|
|
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
|
-
* @see https://
|
|
7
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
7
8
|
*/
|
|
8
9
|
export default class Dialog extends SvelteComponentTyped<{
|
|
9
10
|
title?: string;
|
|
@@ -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
|
-
@see https://
|
|
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,8 +2,9 @@
|
|
|
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
|
-
* @see https://
|
|
7
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
|
|
7
8
|
*/
|
|
8
9
|
export default class Drawer extends SvelteComponentTyped<{
|
|
9
10
|
title?: string;
|
|
@@ -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>;
|