@sveltia/ui 0.1.5 → 0.2.1
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/composite/calendar.svelte +5 -6
- package/package/components/composite/calendar.svelte.d.ts +8 -1
- package/package/components/composite/checkbox-group.svelte.d.ts +11 -1
- package/package/components/composite/combobox.svelte +21 -17
- package/package/components/composite/combobox.svelte.d.ts +16 -1
- package/package/components/composite/disclosure.svelte.d.ts +10 -1
- package/package/components/composite/grid.svelte.d.ts +10 -1
- package/package/components/composite/listbox.svelte +1 -1
- package/package/components/composite/listbox.svelte.d.ts +20 -7
- package/package/components/composite/menu-item-group.svelte.d.ts +11 -1
- package/package/components/composite/menu.svelte.d.ts +14 -5
- package/package/components/composite/radio-button-group.svelte.d.ts +10 -1
- package/package/components/composite/select-button-group.svelte.d.ts +14 -1
- package/package/components/composite/select.svelte.d.ts +14 -2
- package/package/components/composite/tab-list.svelte.d.ts +22 -9
- package/package/components/core/button.svelte +25 -14
- package/package/components/core/button.svelte.d.ts +50 -19
- package/package/components/core/checkbox.svelte +11 -1
- package/package/components/core/checkbox.svelte.d.ts +16 -1
- package/package/components/core/dialog.svelte +50 -36
- package/package/components/core/dialog.svelte.d.ts +29 -1
- package/package/components/core/drawer.svelte +338 -0
- package/package/components/core/drawer.svelte.d.ts +59 -0
- package/package/components/core/grid-cell.svelte.d.ts +9 -1
- package/package/components/core/group.svelte.d.ts +11 -1
- package/package/components/core/icon.svelte.d.ts +8 -1
- package/package/components/core/menu-button.svelte.d.ts +17 -1
- package/package/components/core/menu-item-checkbox.svelte.d.ts +12 -2
- package/package/components/core/menu-item-radio.svelte.d.ts +12 -2
- package/package/components/core/menu-item.svelte.d.ts +17 -2
- package/package/components/core/number-input.svelte +1 -1
- package/package/components/core/number-input.svelte.d.ts +17 -3
- package/package/components/core/option.svelte +6 -0
- package/package/components/core/option.svelte.d.ts +31 -6
- package/package/components/core/password-input.svelte +1 -1
- package/package/components/core/password-input.svelte.d.ts +15 -4
- package/package/components/core/radio-button.svelte +1 -1
- package/package/components/core/radio-button.svelte.d.ts +11 -1
- package/package/components/core/row-group.svelte.d.ts +9 -1
- package/package/components/core/row.svelte.d.ts +11 -1
- package/package/components/core/search-bar.svelte +3 -2
- package/package/components/core/search-bar.svelte.d.ts +25 -11
- package/package/components/core/select-button.svelte.d.ts +19 -2
- package/package/components/core/separator.svelte.d.ts +7 -1
- package/package/components/core/slider.svelte +2 -1
- package/package/components/core/slider.svelte.d.ts +17 -1
- package/package/components/core/spacer.svelte.d.ts +7 -1
- package/package/components/core/switch.svelte +6 -0
- package/package/components/core/switch.svelte.d.ts +11 -1
- package/package/components/core/tab-panel.svelte.d.ts +9 -1
- package/package/components/core/tab.svelte.d.ts +15 -1
- package/package/components/core/text-area.svelte.d.ts +25 -11
- package/package/components/core/text-input.svelte +3 -2
- package/package/components/core/text-input.svelte.d.ts +33 -15
- package/package/components/core/toolbar.svelte +3 -3
- package/package/components/core/toolbar.svelte.d.ts +10 -1
- package/package/components/editor/markdown.svelte +1 -1
- package/package/components/editor/markdown.svelte.d.ts +7 -1
- package/package/components/helpers/popup.d.ts +7 -2
- package/package/components/helpers/popup.js +11 -0
- package/package/components/util/app-shell.svelte +128 -58
- package/package/components/util/app-shell.svelte.d.ts +11 -1
- package/package/components/util/popup.svelte +24 -14
- package/package/components/util/popup.svelte.d.ts +24 -8
- package/package/components/util/portal.svelte.d.ts +8 -1
- package/package/index.d.ts +2 -0
- package/package/index.js +5 -5
- package/package/styles/core.scss +3 -3
- package/package/styles/variables.scss +127 -57
- package/package.json +23 -13
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<input type="hidden" bind:value />
|
|
44
44
|
<div class="header">
|
|
45
45
|
<Button
|
|
46
|
-
class="
|
|
46
|
+
class="tertiary"
|
|
47
47
|
label={firstDay.toLocaleDateString('en', { year: 'numeric', month: 'short' })}
|
|
48
48
|
aria-haspopup="dialog"
|
|
49
49
|
>
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
value = '';
|
|
140
140
|
}}
|
|
141
141
|
>
|
|
142
|
-
{$_('sui.
|
|
142
|
+
{$_('sui._.clear')}
|
|
143
143
|
</Button>
|
|
144
144
|
<Spacer flex={true} />
|
|
145
145
|
<Button
|
|
@@ -159,7 +159,6 @@
|
|
|
159
159
|
-webkit-user-select: none;
|
|
160
160
|
user-select: none;
|
|
161
161
|
cursor: default;
|
|
162
|
-
font-size: 14px;
|
|
163
162
|
}
|
|
164
163
|
[role=group] > * {
|
|
165
164
|
flex: none;
|
|
@@ -190,13 +189,13 @@
|
|
|
190
189
|
align-items: center;
|
|
191
190
|
width: 24px;
|
|
192
191
|
height: 24px;
|
|
193
|
-
font-size:
|
|
192
|
+
font-size: var(--font-size--small);
|
|
194
193
|
}
|
|
195
194
|
.grid div.weekday {
|
|
196
195
|
color: var(--secondary-foreground-color);
|
|
197
196
|
}
|
|
198
197
|
.grid div.other-month {
|
|
199
|
-
color: var(--
|
|
198
|
+
color: var(--tertiary-foreground-color);
|
|
200
199
|
}
|
|
201
200
|
.grid div.today :global(button) {
|
|
202
201
|
color: var(--highlight-foreground-color);
|
|
@@ -217,7 +216,7 @@
|
|
|
217
216
|
}
|
|
218
217
|
|
|
219
218
|
.footer :global(button) {
|
|
220
|
-
font-size:
|
|
219
|
+
font-size: var(--font-size--small);
|
|
221
220
|
}
|
|
222
221
|
|
|
223
222
|
.popup-inner {
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} CalendarProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} CalendarEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} CalendarSlots */
|
|
4
|
-
export default class Calendar {
|
|
4
|
+
export default class Calendar extends SvelteComponentTyped<{
|
|
5
|
+
value?: string;
|
|
6
|
+
}, {
|
|
7
|
+
click: MouseEvent;
|
|
8
|
+
} & {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
}, {}> {
|
|
5
11
|
}
|
|
6
12
|
export type CalendarProps = typeof __propDef.props;
|
|
7
13
|
export type CalendarEvents = typeof __propDef.events;
|
|
8
14
|
export type CalendarSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponentTyped } from "svelte";
|
|
9
16
|
declare const __propDef: {
|
|
10
17
|
props: {
|
|
11
18
|
value?: (string | undefined);
|
|
@@ -2,11 +2,21 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} CheckboxGroupEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} CheckboxGroupSlots */
|
|
4
4
|
/** The container of `<Checkbox>`es. */
|
|
5
|
-
export default class CheckboxGroup {
|
|
5
|
+
export default class CheckboxGroup extends SvelteComponentTyped<{
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
class?: string;
|
|
8
|
+
orientation?: "horizontal" | "vertical";
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
}, {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
}, {
|
|
13
|
+
default: {};
|
|
14
|
+
}> {
|
|
6
15
|
}
|
|
7
16
|
export type CheckboxGroupProps = typeof __propDef.props;
|
|
8
17
|
export type CheckboxGroupEvents = typeof __propDef.events;
|
|
9
18
|
export type CheckboxGroupSlots = typeof __propDef.slots;
|
|
19
|
+
import { SvelteComponentTyped } from "svelte";
|
|
10
20
|
declare const __propDef: {
|
|
11
21
|
props: {
|
|
12
22
|
[x: string]: any;
|
|
@@ -51,19 +51,6 @@
|
|
|
51
51
|
/** @type {(Popup| undefined)} */
|
|
52
52
|
let popupComponent;
|
|
53
53
|
let isPopupOpen = writable(false);
|
|
54
|
-
|
|
55
|
-
$: {
|
|
56
|
-
dispatch('change', { target: inputComponent?.element, value });
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
$: {
|
|
60
|
-
if (readOnly && value && popupComponent?.element) {
|
|
61
|
-
window.requestAnimationFrame(() => {
|
|
62
|
-
label =
|
|
63
|
-
popupComponent?.element.querySelector('[aria-selected="true"] .label')?.textContent || '';
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
54
|
</script>
|
|
68
55
|
|
|
69
56
|
<div class="sui combobox {className}">
|
|
@@ -72,7 +59,7 @@
|
|
|
72
59
|
class:selected={value !== undefined}
|
|
73
60
|
role="combobox"
|
|
74
61
|
{id}
|
|
75
|
-
tabindex=
|
|
62
|
+
tabindex={disabled ? -1 : 0}
|
|
76
63
|
aria-controls="{id}-popup"
|
|
77
64
|
aria-expanded={$isPopupOpen}
|
|
78
65
|
aria-disabled={disabled ? true : undefined}
|
|
@@ -102,10 +89,11 @@
|
|
|
102
89
|
{/if}
|
|
103
90
|
<Button
|
|
104
91
|
{disabled}
|
|
92
|
+
tabindex={readOnly || disabled ? -1 : 0}
|
|
105
93
|
aria-controls="{id}-popup"
|
|
106
94
|
aria-expanded={$isPopupOpen}
|
|
107
95
|
aria-disabled={disabled ? true : undefined}
|
|
108
|
-
class="
|
|
96
|
+
class="tertiary iconic"
|
|
109
97
|
on:click={(event) => {
|
|
110
98
|
event.stopPropagation();
|
|
111
99
|
|
|
@@ -131,7 +119,10 @@
|
|
|
131
119
|
<Listbox
|
|
132
120
|
on:click={({ target }) => {
|
|
133
121
|
if (target.matches('[role="option"]')) {
|
|
134
|
-
|
|
122
|
+
// @todo support more types
|
|
123
|
+
value = target.dataset.type === 'number' ? Number(target.value) : target.value;
|
|
124
|
+
label = target.querySelector('.label')?.textContent || target.value;
|
|
125
|
+
dispatch('change', { target: inputComponent?.element, value });
|
|
135
126
|
}
|
|
136
127
|
}}
|
|
137
128
|
>
|
|
@@ -143,9 +134,10 @@
|
|
|
143
134
|
display: flex;
|
|
144
135
|
align-items: center;
|
|
145
136
|
position: relative;
|
|
137
|
+
min-width: var(--combobox-min-width, 160px);
|
|
146
138
|
}
|
|
147
139
|
.combobox :global(.icon) {
|
|
148
|
-
font-size:
|
|
140
|
+
font-size: var(--font-size--xx-large);
|
|
149
141
|
opacity: 0.5;
|
|
150
142
|
}
|
|
151
143
|
.combobox > :global(.icon) {
|
|
@@ -157,6 +149,13 @@
|
|
|
157
149
|
position: absolute;
|
|
158
150
|
inset: 0 0 auto auto;
|
|
159
151
|
z-index: 1;
|
|
152
|
+
border-top-left-radius: 0;
|
|
153
|
+
border-bottom-left-radius: 0;
|
|
154
|
+
border-width: 0;
|
|
155
|
+
background-color: transparent;
|
|
156
|
+
}
|
|
157
|
+
.combobox > :global(button[tabindex="-1"]) {
|
|
158
|
+
pointer-events: none;
|
|
160
159
|
}
|
|
161
160
|
.combobox div[role=combobox] {
|
|
162
161
|
display: flex;
|
|
@@ -167,13 +166,18 @@
|
|
|
167
166
|
padding: 0 32px 0 8px;
|
|
168
167
|
width: 100%;
|
|
169
168
|
height: var(--input--medium--height);
|
|
169
|
+
background-color: var(--disabled-background-color);
|
|
170
170
|
-webkit-user-select: none;
|
|
171
171
|
user-select: none;
|
|
172
172
|
cursor: pointer;
|
|
173
|
+
transition: all 200ms;
|
|
173
174
|
}
|
|
174
175
|
.combobox div[role=combobox]:not(.selected) {
|
|
175
176
|
font-style: italic;
|
|
176
177
|
}
|
|
178
|
+
.combobox div[role=combobox]:hover, .combobox div[role=combobox]:focus {
|
|
179
|
+
background-color: var(--highlight-background-color);
|
|
180
|
+
}
|
|
177
181
|
.combobox div[role=combobox][aria-disabled=true] {
|
|
178
182
|
background-color: var(--disabled-background-color);
|
|
179
183
|
opacity: 0.4;
|
|
@@ -5,11 +5,26 @@
|
|
|
5
5
|
* @see https://w3c.github.io/aria/#combobox
|
|
6
6
|
* @see https://w3c.github.io/aria-practices/#combobox
|
|
7
7
|
*/
|
|
8
|
-
export default class Combobox {
|
|
8
|
+
export default class Combobox extends SvelteComponentTyped<{
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
label?: string;
|
|
11
|
+
position?: any;
|
|
12
|
+
class?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
value?: string;
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
}, {
|
|
17
|
+
change: CustomEvent<any>;
|
|
18
|
+
} & {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {
|
|
21
|
+
default: {};
|
|
22
|
+
}> {
|
|
9
23
|
}
|
|
10
24
|
export type ComboboxProps = typeof __propDef.props;
|
|
11
25
|
export type ComboboxEvents = typeof __propDef.events;
|
|
12
26
|
export type ComboboxSlots = typeof __propDef.slots;
|
|
27
|
+
import { SvelteComponentTyped } from "svelte";
|
|
13
28
|
declare const __propDef: {
|
|
14
29
|
props: {
|
|
15
30
|
[x: string]: any;
|
|
@@ -5,11 +5,20 @@
|
|
|
5
5
|
* @see https://w3c.github.io/aria-practices/#disclosure
|
|
6
6
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
|
|
7
7
|
*/
|
|
8
|
-
export default class Disclosure {
|
|
8
|
+
export default class Disclosure extends SvelteComponentTyped<{
|
|
9
|
+
label?: string;
|
|
10
|
+
class?: string;
|
|
11
|
+
expanded?: boolean;
|
|
12
|
+
}, {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {
|
|
15
|
+
default: {};
|
|
16
|
+
}> {
|
|
9
17
|
}
|
|
10
18
|
export type DisclosureProps = typeof __propDef.props;
|
|
11
19
|
export type DisclosureEvents = typeof __propDef.events;
|
|
12
20
|
export type DisclosureSlots = typeof __propDef.slots;
|
|
21
|
+
import { SvelteComponentTyped } from "svelte";
|
|
13
22
|
declare const __propDef: {
|
|
14
23
|
props: {
|
|
15
24
|
label?: string;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} GridProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} GridEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} GridSlots */
|
|
4
|
-
export default class Grid {
|
|
4
|
+
export default class Grid extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
class?: string;
|
|
7
|
+
element?: HTMLElement;
|
|
8
|
+
}, {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
}, {
|
|
11
|
+
default: {};
|
|
12
|
+
}> {
|
|
5
13
|
}
|
|
6
14
|
export type GridProps = typeof __propDef.props;
|
|
7
15
|
export type GridEvents = typeof __propDef.events;
|
|
8
16
|
export type GridSlots = typeof __propDef.slots;
|
|
17
|
+
import { SvelteComponentTyped } from "svelte";
|
|
9
18
|
declare const __propDef: {
|
|
10
19
|
props: {
|
|
11
20
|
[x: string]: any;
|
|
@@ -5,20 +5,33 @@
|
|
|
5
5
|
* @see https://w3c.github.io/aria/#listbox
|
|
6
6
|
* @see https://w3c.github.io/aria-practices/#Listbox
|
|
7
7
|
*/
|
|
8
|
-
export default class Listbox {
|
|
8
|
+
export default class Listbox extends SvelteComponentTyped<{
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
class?: string;
|
|
11
|
+
element?: HTMLElement;
|
|
12
|
+
multiple?: boolean;
|
|
13
|
+
}, {
|
|
14
|
+
click: MouseEvent;
|
|
15
|
+
select: Event;
|
|
16
|
+
} & {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {
|
|
19
|
+
default: {};
|
|
20
|
+
}> {
|
|
9
21
|
/**accessor*/
|
|
10
|
-
set class(arg:
|
|
11
|
-
get class():
|
|
22
|
+
set class(arg: string);
|
|
23
|
+
get class(): string;
|
|
12
24
|
/**accessor*/
|
|
13
|
-
set element(arg:
|
|
14
|
-
get element():
|
|
25
|
+
set element(arg: HTMLElement);
|
|
26
|
+
get element(): HTMLElement;
|
|
15
27
|
/**accessor*/
|
|
16
|
-
set multiple(arg:
|
|
17
|
-
get multiple():
|
|
28
|
+
set multiple(arg: boolean);
|
|
29
|
+
get multiple(): boolean;
|
|
18
30
|
}
|
|
19
31
|
export type ListboxProps = typeof __propDef.props;
|
|
20
32
|
export type ListboxEvents = typeof __propDef.events;
|
|
21
33
|
export type ListboxSlots = typeof __propDef.slots;
|
|
34
|
+
import { SvelteComponentTyped } from "svelte";
|
|
22
35
|
declare const __propDef: {
|
|
23
36
|
props: {
|
|
24
37
|
[x: string]: any;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} MenuItemGroupProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} MenuItemGroupEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MenuItemGroupSlots */
|
|
4
|
-
export default class MenuItemGroup {
|
|
4
|
+
export default class MenuItemGroup extends SvelteComponentTyped<{
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
title?: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
}, {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
}, {
|
|
12
|
+
default: {};
|
|
13
|
+
}> {
|
|
5
14
|
}
|
|
6
15
|
export type MenuItemGroupProps = typeof __propDef.props;
|
|
7
16
|
export type MenuItemGroupEvents = typeof __propDef.events;
|
|
8
17
|
export type MenuItemGroupSlots = typeof __propDef.slots;
|
|
18
|
+
import { SvelteComponentTyped } from "svelte";
|
|
9
19
|
declare const __propDef: {
|
|
10
20
|
props: {
|
|
11
21
|
[x: string]: any;
|
|
@@ -5,17 +5,26 @@
|
|
|
5
5
|
* @see https://w3c.github.io/aria/#menu
|
|
6
6
|
* @see https://w3c.github.io/aria-practices/#menu
|
|
7
7
|
*/
|
|
8
|
-
export default class Menu {
|
|
8
|
+
export default class Menu extends SvelteComponentTyped<{
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
class?: string;
|
|
11
|
+
element?: HTMLElement;
|
|
12
|
+
}, {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {
|
|
15
|
+
default: {};
|
|
16
|
+
}> {
|
|
9
17
|
/**accessor*/
|
|
10
|
-
set class(arg:
|
|
11
|
-
get class():
|
|
18
|
+
set class(arg: string);
|
|
19
|
+
get class(): string;
|
|
12
20
|
/**accessor*/
|
|
13
|
-
set element(arg:
|
|
14
|
-
get element():
|
|
21
|
+
set element(arg: HTMLElement);
|
|
22
|
+
get element(): HTMLElement;
|
|
15
23
|
}
|
|
16
24
|
export type MenuProps = typeof __propDef.props;
|
|
17
25
|
export type MenuEvents = typeof __propDef.events;
|
|
18
26
|
export type MenuSlots = typeof __propDef.slots;
|
|
27
|
+
import { SvelteComponentTyped } from "svelte";
|
|
19
28
|
declare const __propDef: {
|
|
20
29
|
props: {
|
|
21
30
|
[x: string]: any;
|
|
@@ -6,11 +6,20 @@
|
|
|
6
6
|
* @see https://w3c.github.io/aria/#radiogroup
|
|
7
7
|
* @see https://w3c.github.io/aria-practices/#radiobutton
|
|
8
8
|
*/
|
|
9
|
-
export default class RadioButtonGroup {
|
|
9
|
+
export default class RadioButtonGroup extends SvelteComponentTyped<{
|
|
10
|
+
class?: string;
|
|
11
|
+
element?: HTMLElement;
|
|
12
|
+
orientation?: "horizontal" | "vertical";
|
|
13
|
+
}, {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
}, {
|
|
16
|
+
default: {};
|
|
17
|
+
}> {
|
|
10
18
|
}
|
|
11
19
|
export type RadioButtonGroupProps = typeof __propDef.props;
|
|
12
20
|
export type RadioButtonGroupEvents = typeof __propDef.events;
|
|
13
21
|
export type RadioButtonGroupSlots = typeof __propDef.slots;
|
|
22
|
+
import { SvelteComponentTyped } from "svelte";
|
|
14
23
|
declare const __propDef: {
|
|
15
24
|
props: {
|
|
16
25
|
class?: string;
|
|
@@ -6,11 +6,24 @@
|
|
|
6
6
|
* @see https://w3c.github.io/aria/#radiogroup
|
|
7
7
|
* @see https://w3c.github.io/aria-practices/#radiobutton
|
|
8
8
|
*/
|
|
9
|
-
export default class SelectButtonGroup {
|
|
9
|
+
export default class SelectButtonGroup extends SvelteComponentTyped<{
|
|
10
|
+
class?: string;
|
|
11
|
+
element?: HTMLElement;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
value?: string;
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
}, {
|
|
16
|
+
change: CustomEvent<any>;
|
|
17
|
+
} & {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {
|
|
20
|
+
default: {};
|
|
21
|
+
}> {
|
|
10
22
|
}
|
|
11
23
|
export type SelectButtonGroupProps = typeof __propDef.props;
|
|
12
24
|
export type SelectButtonGroupEvents = typeof __propDef.events;
|
|
13
25
|
export type SelectButtonGroupSlots = typeof __propDef.slots;
|
|
26
|
+
import { SvelteComponentTyped } from "svelte";
|
|
14
27
|
declare const __propDef: {
|
|
15
28
|
props: {
|
|
16
29
|
class?: string;
|
|
@@ -2,11 +2,23 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} SelectEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SelectSlots */
|
|
4
4
|
/** A read-only variant of `<Combobox>`. */
|
|
5
|
-
export default class Select {
|
|
5
|
+
export default class Select extends SvelteComponentTyped<{
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
label?: string;
|
|
8
|
+
class?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
}, {
|
|
11
|
+
change: CustomEvent<any>;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
}, {
|
|
15
|
+
default: {};
|
|
16
|
+
}> {
|
|
6
17
|
}
|
|
7
18
|
export type SelectProps = typeof __propDef.props;
|
|
8
19
|
export type SelectEvents = typeof __propDef.events;
|
|
9
20
|
export type SelectSlots = typeof __propDef.slots;
|
|
21
|
+
import { SvelteComponentTyped } from "svelte";
|
|
10
22
|
declare const __propDef: {
|
|
11
23
|
props: {
|
|
12
24
|
[x: string]: any;
|
|
@@ -15,7 +27,7 @@ declare const __propDef: {
|
|
|
15
27
|
value?: (string | undefined);
|
|
16
28
|
};
|
|
17
29
|
events: {
|
|
18
|
-
change: any
|
|
30
|
+
change: CustomEvent<any>;
|
|
19
31
|
} & {
|
|
20
32
|
[evt: string]: CustomEvent<any>;
|
|
21
33
|
};
|
|
@@ -5,23 +5,36 @@
|
|
|
5
5
|
* @see https://w3c.github.io/aria/#tablist
|
|
6
6
|
* @see https://w3c.github.io/aria-practices/#tabpanel
|
|
7
7
|
*/
|
|
8
|
-
export default class TabList {
|
|
8
|
+
export default class TabList extends SvelteComponentTyped<{
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
class?: string;
|
|
11
|
+
element?: HTMLElement;
|
|
12
|
+
name?: string;
|
|
13
|
+
orientation?: "horizontal" | "vertical";
|
|
14
|
+
}, {
|
|
15
|
+
select: Event;
|
|
16
|
+
} & {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {
|
|
19
|
+
default: {};
|
|
20
|
+
}> {
|
|
9
21
|
/**accessor*/
|
|
10
|
-
set class(arg:
|
|
11
|
-
get class():
|
|
22
|
+
set class(arg: string);
|
|
23
|
+
get class(): string;
|
|
12
24
|
/**accessor*/
|
|
13
|
-
set element(arg:
|
|
14
|
-
get element():
|
|
25
|
+
set element(arg: HTMLElement);
|
|
26
|
+
get element(): HTMLElement;
|
|
15
27
|
/**accessor*/
|
|
16
|
-
set orientation(arg:
|
|
17
|
-
get orientation():
|
|
28
|
+
set orientation(arg: "horizontal" | "vertical");
|
|
29
|
+
get orientation(): "horizontal" | "vertical";
|
|
18
30
|
/**accessor*/
|
|
19
|
-
set name(arg:
|
|
20
|
-
get name():
|
|
31
|
+
set name(arg: string);
|
|
32
|
+
get name(): string;
|
|
21
33
|
}
|
|
22
34
|
export type TabListProps = typeof __propDef.props;
|
|
23
35
|
export type TabListEvents = typeof __propDef.events;
|
|
24
36
|
export type TabListSlots = typeof __propDef.slots;
|
|
37
|
+
import { SvelteComponentTyped } from "svelte";
|
|
25
38
|
declare const __propDef: {
|
|
26
39
|
props: {
|
|
27
40
|
[x: string]: any;
|
|
@@ -141,41 +141,47 @@ button[disabled] {
|
|
|
141
141
|
cursor: default;
|
|
142
142
|
pointer-events: none;
|
|
143
143
|
}
|
|
144
|
-
button:global(.primary), button:global(.secondary), button:global(.
|
|
144
|
+
button:global(.primary), button:global(.secondary), button:global(.tertiary) {
|
|
145
145
|
justify-content: center;
|
|
146
|
+
border-width: 1px;
|
|
146
147
|
border-radius: var(--button--medium--border-radius);
|
|
147
148
|
padding: var(--button--medium--padding, 0 8px);
|
|
148
149
|
height: var(--button--medium--height);
|
|
149
150
|
}
|
|
150
|
-
button:global(.primary) :global(.label:only-child), button:global(.secondary) :global(.label:only-child), button:global(.
|
|
151
|
+
button:global(.primary) :global(.label:only-child), button:global(.secondary) :global(.label:only-child), button:global(.tertiary) :global(.label:only-child) {
|
|
151
152
|
padding: 0 4px;
|
|
152
153
|
}
|
|
153
154
|
button:global(.primary) {
|
|
154
|
-
border-width: 1px;
|
|
155
155
|
border-color: var(--control-border-color);
|
|
156
156
|
color: var(--primary-accent-color-foreground);
|
|
157
157
|
background-color: var(--primary-accent-color);
|
|
158
158
|
}
|
|
159
|
-
button:global(.primary):hover {
|
|
159
|
+
button:global(.primary):hover, button:global(.primary):focus {
|
|
160
160
|
background-color: var(--primary-accent-color-lighter);
|
|
161
161
|
}
|
|
162
162
|
button:global(.primary):active {
|
|
163
163
|
background-color: var(--primary-accent-color-darker);
|
|
164
164
|
}
|
|
165
165
|
button:global(.secondary) {
|
|
166
|
-
border-
|
|
167
|
-
|
|
168
|
-
color: var(--
|
|
169
|
-
|
|
166
|
+
border-color: var(--primary-accent-color);
|
|
167
|
+
color: var(--primary-accent-color-lighter);
|
|
168
|
+
background-color: var(--tertiary-background-color);
|
|
169
|
+
}
|
|
170
|
+
button:global(.secondary):hover, button:global(.secondary):focus {
|
|
171
|
+
background-color: var(--highlight-background-color);
|
|
170
172
|
}
|
|
171
173
|
button:global(.secondary)[aria-pressed=true] {
|
|
172
174
|
background-color: var(--primary-accent-color);
|
|
173
175
|
}
|
|
174
|
-
button:global(.
|
|
175
|
-
color: var(--
|
|
176
|
-
|
|
176
|
+
button:global(.tertiary) {
|
|
177
|
+
border-color: var(--control-border-color);
|
|
178
|
+
color: var(--highlight-foreground-color);
|
|
179
|
+
background-color: var(--tertiary-background-color);
|
|
177
180
|
}
|
|
178
|
-
button:global(.
|
|
181
|
+
button:global(.tertiary):hover, button:global(.tertiary):focus {
|
|
182
|
+
background-color: var(--highlight-background-color);
|
|
183
|
+
}
|
|
184
|
+
button:global(.tertiary)[aria-pressed=true] {
|
|
179
185
|
background-color: var(--highlight-background-color);
|
|
180
186
|
}
|
|
181
187
|
button:global(.danger) {
|
|
@@ -187,16 +193,21 @@ button:global(.large) {
|
|
|
187
193
|
button:global(.small) {
|
|
188
194
|
padding: var(--button--small--padding, 0 8px);
|
|
189
195
|
height: var(--button--small--height);
|
|
190
|
-
font-size:
|
|
196
|
+
font-size: var(--font-size--small);
|
|
191
197
|
}
|
|
192
198
|
button:global(.small) :global(.icon) {
|
|
193
|
-
font-size:
|
|
199
|
+
font-size: var(--font-size--large);
|
|
200
|
+
}
|
|
201
|
+
button:global(.pill) {
|
|
202
|
+
border-radius: var(--button--medium--pill--height, 16px);
|
|
203
|
+
padding: var(--button--medium--pill--padding, 0 16px);
|
|
194
204
|
}
|
|
195
205
|
button:global(.link) {
|
|
196
206
|
color: var(--primary-accent-color-lighter);
|
|
197
207
|
}
|
|
198
208
|
button:global(.iconic) {
|
|
199
209
|
justify-content: center;
|
|
210
|
+
padding: 0;
|
|
200
211
|
border-radius: 4px;
|
|
201
212
|
aspect-ratio: 1/1;
|
|
202
213
|
}
|
|
@@ -5,34 +5,64 @@
|
|
|
5
5
|
* @see https://w3c.github.io/aria/#button
|
|
6
6
|
* @see https://w3c.github.io/aria-practices/#button
|
|
7
7
|
*/
|
|
8
|
-
export default class Button {
|
|
8
|
+
export default class Button extends SvelteComponentTyped<{
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
label?: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
element?: HTMLButtonElement;
|
|
13
|
+
type?: "reset" | "submit" | "button";
|
|
14
|
+
role?: string;
|
|
15
|
+
size?: "small" | "medium" | "large";
|
|
16
|
+
hidden?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
pressed?: string | boolean;
|
|
19
|
+
popupPosition?: any;
|
|
20
|
+
}, {
|
|
21
|
+
mouseenter: MouseEvent;
|
|
22
|
+
mouseleave: MouseEvent;
|
|
23
|
+
click: MouseEvent;
|
|
24
|
+
dragover: DragEvent;
|
|
25
|
+
dragleave: DragEvent;
|
|
26
|
+
dragend: DragEvent;
|
|
27
|
+
drop: DragEvent;
|
|
28
|
+
keydown: KeyboardEvent;
|
|
29
|
+
keyup: KeyboardEvent;
|
|
30
|
+
keypress: KeyboardEvent;
|
|
31
|
+
} & {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
}, {
|
|
34
|
+
'start-icon': {};
|
|
35
|
+
default: {};
|
|
36
|
+
'end-icon': {};
|
|
37
|
+
popup: {};
|
|
38
|
+
}> {
|
|
9
39
|
/**accessor*/
|
|
10
|
-
set class(arg:
|
|
11
|
-
get class():
|
|
40
|
+
set class(arg: string);
|
|
41
|
+
get class(): string;
|
|
12
42
|
/**accessor*/
|
|
13
|
-
set element(arg:
|
|
14
|
-
get element():
|
|
43
|
+
set element(arg: HTMLButtonElement);
|
|
44
|
+
get element(): HTMLButtonElement;
|
|
15
45
|
/**accessor*/
|
|
16
|
-
set type(arg:
|
|
17
|
-
get type():
|
|
46
|
+
set type(arg: "reset" | "submit" | "button");
|
|
47
|
+
get type(): "reset" | "submit" | "button";
|
|
18
48
|
/**accessor*/
|
|
19
|
-
set role(arg:
|
|
20
|
-
get role():
|
|
49
|
+
set role(arg: string);
|
|
50
|
+
get role(): string;
|
|
21
51
|
/**accessor*/
|
|
22
|
-
set size(arg:
|
|
23
|
-
get size():
|
|
52
|
+
set size(arg: "small" | "medium" | "large");
|
|
53
|
+
get size(): "small" | "medium" | "large";
|
|
24
54
|
/**accessor*/
|
|
25
|
-
set hidden(arg:
|
|
26
|
-
get hidden():
|
|
55
|
+
set hidden(arg: boolean);
|
|
56
|
+
get hidden(): boolean;
|
|
27
57
|
/**accessor*/
|
|
28
|
-
set disabled(arg:
|
|
29
|
-
get disabled():
|
|
58
|
+
set disabled(arg: boolean);
|
|
59
|
+
get disabled(): boolean;
|
|
30
60
|
/**accessor*/
|
|
31
|
-
set pressed(arg:
|
|
32
|
-
get pressed():
|
|
61
|
+
set pressed(arg: string | boolean);
|
|
62
|
+
get pressed(): string | boolean;
|
|
33
63
|
/**accessor*/
|
|
34
|
-
set label(arg:
|
|
35
|
-
get label():
|
|
64
|
+
set label(arg: string);
|
|
65
|
+
get label(): string;
|
|
36
66
|
/**accessor*/
|
|
37
67
|
set popupPosition(arg: any);
|
|
38
68
|
get popupPosition(): any;
|
|
@@ -40,6 +70,7 @@ export default class Button {
|
|
|
40
70
|
export type ButtonProps = typeof __propDef.props;
|
|
41
71
|
export type ButtonEvents = typeof __propDef.events;
|
|
42
72
|
export type ButtonSlots = typeof __propDef.slots;
|
|
73
|
+
import { SvelteComponentTyped } from "svelte";
|
|
43
74
|
declare const __propDef: {
|
|
44
75
|
props: {
|
|
45
76
|
[x: string]: any;
|