@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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} MarkdownEditorProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} MarkdownEditorEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} MarkdownEditorSlots */
|
|
4
|
+
/** A Markdown text editor. */
|
|
5
|
+
export default class MarkdownEditor extends SvelteComponentTyped<{
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
value?: string;
|
|
8
|
+
}, {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
}, {}> {
|
|
11
|
+
}
|
|
12
|
+
export type MarkdownEditorProps = typeof __propDef.props;
|
|
13
|
+
export type MarkdownEditorEvents = typeof __propDef.events;
|
|
14
|
+
export type MarkdownEditorSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponentTyped } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
value?: string | null;
|
|
20
|
+
};
|
|
21
|
+
events: {
|
|
22
|
+
[evt: string]: CustomEvent<any>;
|
|
23
|
+
};
|
|
24
|
+
slots: {};
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
The equivalent of the HTML `<input type="number">` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number
|
|
3
5
|
@see https://w3c.github.io/aria/#textbox
|
|
4
6
|
-->
|
|
5
7
|
<script>
|
|
6
8
|
import { _ } from 'svelte-i18n';
|
|
7
|
-
import Button from '
|
|
8
|
-
import Icon from '
|
|
9
|
+
import Button from '../button/button.svelte';
|
|
10
|
+
import Icon from '../icon/icon.svelte';
|
|
9
11
|
import TextInput from './text-input.svelte';
|
|
10
12
|
|
|
11
13
|
/**
|
|
@@ -24,28 +26,32 @@
|
|
|
24
26
|
export let max = undefined;
|
|
25
27
|
export let step = 1;
|
|
26
28
|
|
|
29
|
+
$: maximumFractionDigits = String(step).split('.')[1]?.length || 0;
|
|
30
|
+
$: isMin = typeof min === 'number' && Number(value || 0) <= min;
|
|
31
|
+
$: isMax = typeof max === 'number' && Number(value || 0) >= max;
|
|
32
|
+
|
|
27
33
|
let component;
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
36
|
*
|
|
31
37
|
*/
|
|
32
38
|
const decrease = () => {
|
|
33
|
-
if (
|
|
39
|
+
if (isMin) {
|
|
34
40
|
return;
|
|
35
41
|
}
|
|
36
42
|
|
|
37
|
-
value =
|
|
43
|
+
value = Number(Number(value || 0) - step).toFixed(maximumFractionDigits);
|
|
38
44
|
};
|
|
39
45
|
|
|
40
46
|
/**
|
|
41
47
|
*
|
|
42
48
|
*/
|
|
43
49
|
const increase = () => {
|
|
44
|
-
if (
|
|
50
|
+
if (isMax) {
|
|
45
51
|
return;
|
|
46
52
|
}
|
|
47
53
|
|
|
48
|
-
value =
|
|
54
|
+
value = Number(Number(value || 0) + step).toFixed(maximumFractionDigits);
|
|
49
55
|
};
|
|
50
56
|
</script>
|
|
51
57
|
|
|
@@ -60,13 +66,14 @@
|
|
|
60
66
|
{...$$restProps}
|
|
61
67
|
on:keydown={(event) => {
|
|
62
68
|
const { key, ctrlKey, metaKey, altKey, shiftKey } = event;
|
|
69
|
+
const hasModifier = shiftKey || altKey || ctrlKey || metaKey;
|
|
63
70
|
|
|
64
|
-
if (key === 'ArrowDown' && !
|
|
71
|
+
if (key === 'ArrowDown' && !hasModifier) {
|
|
65
72
|
event.preventDefault();
|
|
66
73
|
decrease();
|
|
67
74
|
}
|
|
68
75
|
|
|
69
|
-
if (key === 'ArrowUp' && !
|
|
76
|
+
if (key === 'ArrowUp' && !hasModifier) {
|
|
70
77
|
event.preventDefault();
|
|
71
78
|
increase();
|
|
72
79
|
}
|
|
@@ -76,7 +83,7 @@
|
|
|
76
83
|
/>
|
|
77
84
|
<Button
|
|
78
85
|
class="iconic"
|
|
79
|
-
disabled={disabled || Number.isNaN(Number(value))}
|
|
86
|
+
disabled={disabled || Number.isNaN(Number(value)) || isMin}
|
|
80
87
|
on:click={() => {
|
|
81
88
|
decrease();
|
|
82
89
|
}}
|
|
@@ -85,7 +92,7 @@
|
|
|
85
92
|
</Button>
|
|
86
93
|
<Button
|
|
87
94
|
class="iconic"
|
|
88
|
-
disabled={disabled || Number.isNaN(Number(value))}
|
|
95
|
+
disabled={disabled || Number.isNaN(Number(value)) || isMax}
|
|
89
96
|
on:click={() => {
|
|
90
97
|
increase();
|
|
91
98
|
}}
|
|
@@ -104,13 +111,16 @@
|
|
|
104
111
|
}
|
|
105
112
|
.number-input :global(button) {
|
|
106
113
|
flex: none;
|
|
107
|
-
margin-left: -1px;
|
|
108
114
|
border-width: 1px;
|
|
109
115
|
border-color: var(--control-border-color);
|
|
110
116
|
width: 32px;
|
|
111
117
|
height: var(--input--medium--height);
|
|
112
118
|
}
|
|
113
|
-
.number-input :global(button):
|
|
119
|
+
.number-input :global(button):first-of-type {
|
|
120
|
+
border-radius: 0;
|
|
121
|
+
border-width: 1px 0;
|
|
122
|
+
}
|
|
123
|
+
.number-input :global(button):last-of-type {
|
|
114
124
|
border-radius: 0 4px 4px 0;
|
|
115
125
|
}
|
|
116
126
|
.number-input :global(button) :global(.icon) {
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} NumberInputProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} NumberInputEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} NumberInputSlots */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* The equivalent of the HTML `<input type="number">` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number
|
|
7
|
+
* @see https://w3c.github.io/aria/#textbox
|
|
8
|
+
*/
|
|
5
9
|
export default class NumberInput extends SvelteComponentTyped<{
|
|
6
10
|
[x: string]: any;
|
|
7
|
-
class?: string;
|
|
8
11
|
disabled?: boolean;
|
|
9
12
|
value?: string;
|
|
13
|
+
class?: string;
|
|
10
14
|
min?: any;
|
|
11
15
|
max?: any;
|
|
12
16
|
step?: number;
|
|
@@ -24,9 +28,9 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
24
28
|
declare const __propDef: {
|
|
25
29
|
props: {
|
|
26
30
|
[x: string]: any;
|
|
27
|
-
class?: string;
|
|
28
31
|
disabled?: boolean;
|
|
29
32
|
value?: string | null;
|
|
33
|
+
class?: string;
|
|
30
34
|
min?: any;
|
|
31
35
|
max?: any;
|
|
32
36
|
step?: number;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
The equivalent of the HTML `<input type="password">` element, but it comes with the Show/Hide
|
|
4
|
+
button.
|
|
5
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/password
|
|
3
6
|
@see https://w3c.github.io/aria/#textbox
|
|
4
7
|
-->
|
|
5
8
|
<script>
|
|
6
9
|
import { _ } from 'svelte-i18n';
|
|
7
|
-
import Button from '
|
|
8
|
-
import Icon from '
|
|
10
|
+
import Button from '../button/button.svelte';
|
|
11
|
+
import Icon from '../icon/icon.svelte';
|
|
9
12
|
import TextInput from './text-input.svelte';
|
|
10
13
|
|
|
11
14
|
/**
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} PasswordInputProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} PasswordInputEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} PasswordInputSlots */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* The equivalent of the HTML `<input type="password">` element, but it comes with the Show/Hide
|
|
6
|
+
* button.
|
|
7
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/password
|
|
8
|
+
* @see https://w3c.github.io/aria/#textbox
|
|
9
|
+
*/
|
|
5
10
|
export default class PasswordInput extends SvelteComponentTyped<{
|
|
6
11
|
[x: string]: any;
|
|
7
|
-
class?: string;
|
|
8
12
|
value?: string;
|
|
13
|
+
class?: string;
|
|
9
14
|
}, {
|
|
10
15
|
input: Event;
|
|
11
16
|
keypress: KeyboardEvent;
|
|
@@ -21,8 +26,8 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
21
26
|
declare const __propDef: {
|
|
22
27
|
props: {
|
|
23
28
|
[x: string]: any;
|
|
24
|
-
class?: string;
|
|
25
29
|
value?: string | null;
|
|
30
|
+
class?: string;
|
|
26
31
|
};
|
|
27
32
|
events: {
|
|
28
33
|
input: Event;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
The equivalent of the HTML `<input type="search">` element. It comes with a magnifier icon and
|
|
4
|
+
clear button.
|
|
5
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search
|
|
3
6
|
@see https://w3c.github.io/aria/#search
|
|
4
7
|
-->
|
|
5
8
|
<svelte:options accessors={true} />
|
|
6
9
|
|
|
7
10
|
<script>
|
|
8
11
|
import { _ } from 'svelte-i18n';
|
|
9
|
-
import Button from '
|
|
10
|
-
import Icon from '
|
|
12
|
+
import Button from '../button/button.svelte';
|
|
13
|
+
import Icon from '../icon/icon.svelte';
|
|
11
14
|
import TextInput from './text-input.svelte';
|
|
12
15
|
|
|
13
16
|
/**
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} SearchBarProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} SearchBarEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SearchBarSlots */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* The equivalent of the HTML `<input type="search">` element. It comes with a magnifier icon and
|
|
6
|
+
* clear button.
|
|
7
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search
|
|
8
|
+
* @see https://w3c.github.io/aria/#search
|
|
9
|
+
*/
|
|
5
10
|
export default class SearchBar extends SvelteComponentTyped<{
|
|
6
11
|
[x: string]: any;
|
|
7
12
|
focus?: () => void;
|
|
8
|
-
class?: string;
|
|
9
13
|
value?: string;
|
|
14
|
+
class?: string;
|
|
10
15
|
}, {
|
|
11
16
|
input: Event;
|
|
12
17
|
keydown: KeyboardEvent;
|
|
@@ -32,8 +37,8 @@ declare const __propDef: {
|
|
|
32
37
|
props: {
|
|
33
38
|
[x: string]: any;
|
|
34
39
|
focus?: () => void;
|
|
35
|
-
class?: string;
|
|
36
40
|
value?: string;
|
|
41
|
+
class?: string;
|
|
37
42
|
};
|
|
38
43
|
events: {
|
|
39
44
|
input: Event;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} TextAreaProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} TextAreaEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} TextAreaSlots */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A multi-line text field. The equivalent of the HTML `<textarea>` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
|
|
7
|
+
* @see https://w3c.github.io/aria/#textbox
|
|
8
|
+
*/
|
|
5
9
|
export default class TextArea extends SvelteComponentTyped<{
|
|
6
10
|
[x: string]: any;
|
|
7
|
-
class?: string;
|
|
8
|
-
element?: HTMLTextAreaElement;
|
|
9
11
|
name?: string;
|
|
10
12
|
value?: string;
|
|
13
|
+
class?: string;
|
|
14
|
+
element?: HTMLTextAreaElement;
|
|
11
15
|
autoResize?: boolean;
|
|
12
16
|
}, {
|
|
13
17
|
click: MouseEvent;
|
|
@@ -39,10 +43,10 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
39
43
|
declare const __propDef: {
|
|
40
44
|
props: {
|
|
41
45
|
[x: string]: any;
|
|
42
|
-
class?: string;
|
|
43
|
-
element?: HTMLTextAreaElement | null;
|
|
44
46
|
name?: string;
|
|
45
47
|
value?: string | null;
|
|
48
|
+
class?: string;
|
|
49
|
+
element?: HTMLTextAreaElement | null;
|
|
46
50
|
autoResize?: boolean;
|
|
47
51
|
};
|
|
48
52
|
events: {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
A generic, single-line text field. The equivalent of the HTML `<input type="text">` element.
|
|
4
|
+
@see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text
|
|
3
5
|
@see https://w3c.github.io/aria/#textbox
|
|
4
6
|
-->
|
|
5
7
|
<svelte:options accessors={true} />
|
|
6
8
|
|
|
7
9
|
<script>
|
|
8
|
-
import { getRandomId } from '../
|
|
10
|
+
import { getRandomId } from '../util/util';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* CSS class name on the button.
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} TextInputProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} TextInputEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} TextInputSlots */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A generic, single-line text field. The equivalent of the HTML `<input type="text">` element.
|
|
6
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text
|
|
7
|
+
* @see https://w3c.github.io/aria/#textbox
|
|
8
|
+
*/
|
|
5
9
|
export default class TextInput extends SvelteComponentTyped<{
|
|
6
10
|
[x: string]: any;
|
|
7
|
-
class?: string;
|
|
8
|
-
element?: HTMLInputElement;
|
|
9
|
-
role?: "textbox" | "searchbox" | "combobox" | "spinbutton";
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
name?: string;
|
|
12
13
|
value?: string | number;
|
|
14
|
+
class?: string;
|
|
15
|
+
element?: HTMLInputElement;
|
|
16
|
+
role?: "textbox" | "searchbox" | "combobox" | "spinbutton";
|
|
13
17
|
readOnly?: boolean;
|
|
14
18
|
}, {
|
|
15
19
|
input: Event;
|
|
@@ -49,12 +53,12 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
49
53
|
declare const __propDef: {
|
|
50
54
|
props: {
|
|
51
55
|
[x: string]: any;
|
|
52
|
-
class?: string;
|
|
53
|
-
element?: HTMLInputElement | null;
|
|
54
|
-
role?: ('textbox' | 'searchbox' | 'combobox' | 'spinbutton');
|
|
55
56
|
disabled?: boolean;
|
|
56
57
|
name?: string;
|
|
57
58
|
value?: (string | number | undefined);
|
|
59
|
+
class?: string;
|
|
60
|
+
element?: HTMLInputElement | null;
|
|
61
|
+
role?: ('textbox' | 'searchbox' | 'combobox' | 'spinbutton');
|
|
58
62
|
readOnly?: boolean;
|
|
59
63
|
};
|
|
60
64
|
events: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
+
A toolbar layout that can contain `<Button>`, `<Select>` and other widgets.
|
|
3
4
|
@see https://w3c.github.io/aria/#toolbar
|
|
4
|
-
@see https://
|
|
5
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/
|
|
5
6
|
-->
|
|
6
7
|
<script>
|
|
7
8
|
/**
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} ToolbarEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} ToolbarSlots */
|
|
4
4
|
/**
|
|
5
|
+
* A toolbar layout that can contain `<Button>`, `<Select>` and other widgets.
|
|
5
6
|
* @see https://w3c.github.io/aria/#toolbar
|
|
6
|
-
* @see https://
|
|
7
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/
|
|
7
8
|
*/
|
|
8
9
|
export default class Toolbar extends SvelteComponentTyped<{
|
|
9
10
|
[x: string]: any;
|
|
10
11
|
class?: string;
|
|
11
|
-
orientation?: "
|
|
12
|
+
orientation?: "vertical" | "horizontal";
|
|
12
13
|
}, {
|
|
13
14
|
[evt: string]: CustomEvent<any>;
|
|
14
15
|
}, {
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
--foreground-color-2-hsl: var(--base-hue) 5% 20%;
|
|
53
53
|
--foreground-color-3-hsl: var(--base-hue) 5% 40%;
|
|
54
54
|
--foreground-color-4-hsl: var(--base-hue) 5% 60%;
|
|
55
|
-
--border-color-1-hsl: var(--base-hue) 5% 75%;
|
|
56
|
-
--border-color-2-hsl: var(--base-hue) 5% 80%;
|
|
57
55
|
--background-color-1-hsl: var(--base-hue) 5% 100%;
|
|
58
56
|
--background-color-2-hsl: var(--base-hue) 5% 98%;
|
|
59
57
|
--background-color-3-hsl: var(--base-hue) 5% 94%;
|
|
60
58
|
--background-color-4-hsl: var(--base-hue) 5% 90%;
|
|
61
59
|
--background-color-5-hsl: var(--base-hue) 5% 86%;
|
|
60
|
+
--border-color-1-hsl: var(--base-hue) 5% 78%;
|
|
61
|
+
--border-color-2-hsl: var(--base-hue) 5% 82%;
|
|
62
62
|
--shadow-color: var(--base-hue) 10% 0%;
|
|
63
63
|
--primary-accent-color: hsl(var(--base-hue) 80% 45%);
|
|
64
64
|
--primary-accent-color-lighter: hsl(var(--base-hue) 80% 40%);
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
--foreground-color-2-hsl: var(--base-hue) 10% 80%;
|
|
82
82
|
--foreground-color-3-hsl: var(--base-hue) 10% 60%;
|
|
83
83
|
--foreground-color-4-hsl: var(--base-hue) 10% 40%;
|
|
84
|
-
--border-color-1-hsl: var(--base-hue) 10% 28%;
|
|
85
|
-
--border-color-2-hsl: var(--base-hue) 10% 24%;
|
|
86
84
|
--background-color-1-hsl: var(--base-hue) 10% 10%;
|
|
87
85
|
--background-color-2-hsl: var(--base-hue) 10% 12%;
|
|
88
86
|
--background-color-3-hsl: var(--base-hue) 10% 16%;
|
|
89
87
|
--background-color-4-hsl: var(--base-hue) 10% 20%;
|
|
90
88
|
--background-color-5-hsl: var(--base-hue) 10% 24%;
|
|
89
|
+
--border-color-1-hsl: var(--base-hue) 10% 32%;
|
|
90
|
+
--border-color-2-hsl: var(--base-hue) 10% 28%;
|
|
91
91
|
--shadow-color: var(--base-hue) 10% 0%;
|
|
92
92
|
--primary-accent-color: hsl(var(--base-hue) 100% 45%);
|
|
93
93
|
--primary-accent-color-lighter: hsl(var(--base-hue) 100% 55%);
|
|
@@ -157,6 +157,7 @@
|
|
|
157
157
|
--primary-border-color: hsl(var(--border-color-1-hsl));
|
|
158
158
|
--secondary-border-color: hsl(var(--border-color-2-hsl));
|
|
159
159
|
--control-border-color: hsl(var(--border-color-2-hsl));
|
|
160
|
+
--checkbox-border-color: hsl(var(--foreground-color-3-hsl));
|
|
160
161
|
--danger-border-color: hsl(
|
|
161
162
|
var(--danger-color-hue) var(--alert-border-color-saturation) var(--alert-border-color-lightness)
|
|
162
163
|
);
|
|
@@ -224,6 +225,10 @@
|
|
|
224
225
|
:global(*) {
|
|
225
226
|
scroll-behavior: smooth;
|
|
226
227
|
box-sizing: border-box;
|
|
228
|
+
outline-offset: 1px;
|
|
229
|
+
outline-width: 2px !important;
|
|
230
|
+
outline-style: solid;
|
|
231
|
+
outline-color: transparent;
|
|
227
232
|
border-width: 0;
|
|
228
233
|
border-style: solid;
|
|
229
234
|
}
|
|
@@ -234,10 +239,7 @@
|
|
|
234
239
|
}
|
|
235
240
|
|
|
236
241
|
:global(:focus-visible) {
|
|
237
|
-
outline-
|
|
238
|
-
outline-width: 2px !important;
|
|
239
|
-
outline-style: solid;
|
|
240
|
-
outline-color: hsl(var(--hue), 100%, 50%, 25%);
|
|
242
|
+
outline-color: var(--primary-accent-color-lighter);
|
|
241
243
|
}
|
|
242
244
|
|
|
243
245
|
:global(h1),
|
|
@@ -280,17 +282,6 @@
|
|
|
280
282
|
line-height: 1.75;
|
|
281
283
|
}
|
|
282
284
|
|
|
283
|
-
:global([role=grid]) {
|
|
284
|
-
display: table;
|
|
285
|
-
width: 100%;
|
|
286
|
-
}
|
|
287
|
-
:global([role=grid]) :global(.colgroup) {
|
|
288
|
-
display: table-column-group;
|
|
289
|
-
}
|
|
290
|
-
:global([role=grid]) :global(.colgroup) :global(.col) {
|
|
291
|
-
display: table-column;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
285
|
:global(code),
|
|
295
286
|
:global(pre) {
|
|
296
287
|
font-family: var(--font-family--monospace);
|
|
@@ -324,23 +315,6 @@
|
|
|
324
315
|
background: transparent;
|
|
325
316
|
}
|
|
326
317
|
|
|
327
|
-
:global(.thead[role=rowgroup]) {
|
|
328
|
-
display: table-header-group;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
:global(.tbody[role=rowgroup]) {
|
|
332
|
-
display: table-row-group;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
:global([role=row]) {
|
|
336
|
-
display: table-row;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
:global([role=columnheader]),
|
|
340
|
-
:global([role=gridcell]) {
|
|
341
|
-
display: table-cell;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
318
|
:global(.app-shell) {
|
|
345
319
|
position: fixed;
|
|
346
320
|
inset: 0;
|