@sveltia/ui 0.1.4 → 0.2.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.json +23 -12
- package/package/components/composite/calendar.svelte +0 -240
- package/package/components/composite/calendar.svelte.d.ts +0 -20
- package/package/components/composite/checkbox-group.svelte +0 -43
- package/package/components/composite/checkbox-group.svelte.d.ts +0 -24
- package/package/components/composite/combobox.svelte +0 -197
- package/package/components/composite/combobox.svelte.d.ts +0 -32
- package/package/components/composite/disclosure.svelte +0 -60
- package/package/components/composite/disclosure.svelte.d.ts +0 -26
- package/package/components/composite/grid.svelte +0 -24
- package/package/components/composite/grid.svelte.d.ts +0 -22
- package/package/components/composite/listbox.svelte +0 -63
- package/package/components/composite/listbox.svelte.d.ts +0 -39
- package/package/components/composite/menu-item-group.svelte +0 -31
- package/package/components/composite/menu-item-group.svelte.d.ts +0 -23
- package/package/components/composite/menu.svelte +0 -44
- package/package/components/composite/menu.svelte.d.ts +0 -32
- package/package/components/composite/radio-button-group.svelte +0 -45
- package/package/components/composite/radio-button-group.svelte.d.ts +0 -27
- package/package/components/composite/select-button-group.svelte +0 -70
- package/package/components/composite/select-button-group.svelte.d.ts +0 -31
- package/package/components/composite/select.svelte +0 -34
- package/package/components/composite/select.svelte.d.ts +0 -26
- package/package/components/composite/tab-list.svelte +0 -76
- package/package/components/composite/tab-list.svelte.d.ts +0 -42
- package/package/components/core/button.svelte +0 -205
- package/package/components/core/button.svelte.d.ts +0 -78
- package/package/components/core/checkbox.svelte +0 -107
- package/package/components/core/checkbox.svelte.d.ts +0 -30
- package/package/components/core/dialog.svelte +0 -274
- package/package/components/core/dialog.svelte.d.ts +0 -45
- package/package/components/core/grid-cell.svelte +0 -14
- package/package/components/core/grid-cell.svelte.d.ts +0 -21
- package/package/components/core/group.svelte +0 -31
- package/package/components/core/group.svelte.d.ts +0 -23
- package/package/components/core/icon.svelte +0 -21
- package/package/components/core/icon.svelte.d.ts +0 -20
- package/package/components/core/menu-button.svelte +0 -57
- package/package/components/core/menu-button.svelte.d.ts +0 -30
- package/package/components/core/menu-item-checkbox.svelte +0 -24
- package/package/components/core/menu-item-checkbox.svelte.d.ts +0 -24
- package/package/components/core/menu-item-radio.svelte +0 -19
- package/package/components/core/menu-item-radio.svelte.d.ts +0 -24
- package/package/components/core/menu-item.svelte +0 -113
- package/package/components/core/menu-item.svelte.d.ts +0 -29
- package/package/components/core/number-input.svelte +0 -112
- package/package/components/core/number-input.svelte.d.ts +0 -28
- package/package/components/core/option.svelte +0 -59
- package/package/components/core/option.svelte.d.ts +0 -35
- package/package/components/core/password-input.svelte +0 -81
- package/package/components/core/password-input.svelte.d.ts +0 -25
- package/package/components/core/radio-button.svelte +0 -93
- package/package/components/core/radio-button.svelte.d.ts +0 -27
- package/package/components/core/row-group.svelte +0 -14
- package/package/components/core/row-group.svelte.d.ts +0 -21
- package/package/components/core/row.svelte +0 -14
- package/package/components/core/row.svelte.d.ts +0 -23
- package/package/components/core/search-bar.svelte +0 -90
- package/package/components/core/search-bar.svelte.d.ts +0 -35
- package/package/components/core/select-button.svelte +0 -31
- package/package/components/core/select-button.svelte.d.ts +0 -35
- package/package/components/core/separator.svelte +0 -28
- package/package/components/core/separator.svelte.d.ts +0 -20
- package/package/components/core/slider.svelte +0 -270
- package/package/components/core/slider.svelte.d.ts +0 -35
- package/package/components/core/spacer.svelte +0 -22
- package/package/components/core/spacer.svelte.d.ts +0 -19
- package/package/components/core/switch.svelte +0 -80
- package/package/components/core/switch.svelte.d.ts +0 -27
- package/package/components/core/tab-panel.svelte +0 -23
- package/package/components/core/tab-panel.svelte.d.ts +0 -25
- package/package/components/core/tab.svelte +0 -22
- package/package/components/core/tab.svelte.d.ts +0 -31
- package/package/components/core/text-area.svelte +0 -90
- package/package/components/core/text-area.svelte.d.ts +0 -43
- package/package/components/core/text-input.svelte +0 -145
- package/package/components/core/text-input.svelte.d.ts +0 -53
- package/package/components/core/toolbar.svelte +0 -74
- package/package/components/core/toolbar.svelte.d.ts +0 -26
- package/package/components/editor/markdown.svelte +0 -78
- package/package/components/editor/markdown.svelte.d.ts +0 -19
- package/package/components/helpers/group.d.ts +0 -37
- package/package/components/helpers/group.js +0 -246
- package/package/components/helpers/popup.d.ts +0 -26
- package/package/components/helpers/popup.js +0 -146
- package/package/components/helpers/util.d.ts +0 -1
- package/package/components/helpers/util.js +0 -8
- package/package/components/util/app-shell.svelte +0 -284
- package/package/components/util/app-shell.svelte.d.ts +0 -28
- package/package/components/util/misc.d.ts +0 -2
- package/package/components/util/misc.js +0 -22
- package/package/components/util/popup.svelte +0 -131
- package/package/components/util/popup.svelte.d.ts +0 -37
- package/package/components/util/portal.svelte +0 -34
- package/package/components/util/portal.svelte.d.ts +0 -21
- package/package/index.d.ts +0 -41
- package/package/index.js +0 -66
- package/package/locales/en.d.ts +0 -42
- package/package/locales/en.js +0 -41
- package/package/locales/ja.d.ts +0 -42
- package/package/locales/ja.js +0 -41
- package/package/styles/core.scss +0 -134
- package/package/styles/variables.scss +0 -114
- package/package/typedef.d.ts +0 -0
- package/package/typedef.js +0 -0
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#option
|
|
4
|
-
-->
|
|
5
|
-
<script>
|
|
6
|
-
import Button from './button.svelte';
|
|
7
|
-
import Icon from './icon.svelte';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* CSS class name on the button.
|
|
11
|
-
* @type {String}
|
|
12
|
-
*/
|
|
13
|
-
let className = '';
|
|
14
|
-
|
|
15
|
-
export { className as class };
|
|
16
|
-
|
|
17
|
-
export let selected = false;
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<div class="sui option {className}">
|
|
21
|
-
<Button
|
|
22
|
-
role="option"
|
|
23
|
-
aria-selected={selected}
|
|
24
|
-
{...$$restProps}
|
|
25
|
-
on:click
|
|
26
|
-
on:dragover
|
|
27
|
-
on:dragleave
|
|
28
|
-
on:dragend
|
|
29
|
-
on:drop
|
|
30
|
-
>
|
|
31
|
-
{#if selected}
|
|
32
|
-
<Icon class="check" name="check" />
|
|
33
|
-
{/if}
|
|
34
|
-
<slot name="start-icon" slot="start-icon" />
|
|
35
|
-
<slot />
|
|
36
|
-
<slot name="end-icon" slot="end-icon" />
|
|
37
|
-
</Button>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<style>.option {
|
|
41
|
-
display: contents;
|
|
42
|
-
}
|
|
43
|
-
.option :global([role="option"]) {
|
|
44
|
-
flex: none;
|
|
45
|
-
display: flex;
|
|
46
|
-
justify-content: space-between;
|
|
47
|
-
gap: 4px;
|
|
48
|
-
border-radius: 4px;
|
|
49
|
-
padding: 0 8px 0 16px;
|
|
50
|
-
width: 100%;
|
|
51
|
-
height: var(--option--medium--height);
|
|
52
|
-
}
|
|
53
|
-
.option :global([role="option"]:hover) {
|
|
54
|
-
color: var(--highlight-foreground-color);
|
|
55
|
-
background-color: var(--highlight-background-color);
|
|
56
|
-
}
|
|
57
|
-
.option :global([role="option"][aria-selected="true"]) :global(.icon) {
|
|
58
|
-
color: var(--primary-accent-color-lighter);
|
|
59
|
-
}</style>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} OptionProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} OptionEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} OptionSlots */
|
|
4
|
-
/** @see https://w3c.github.io/aria/#option */
|
|
5
|
-
export default class Option {
|
|
6
|
-
}
|
|
7
|
-
export type OptionProps = typeof __propDef.props;
|
|
8
|
-
export type OptionEvents = typeof __propDef.events;
|
|
9
|
-
export type OptionSlots = typeof __propDef.slots;
|
|
10
|
-
declare const __propDef: {
|
|
11
|
-
props: {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
class?: string;
|
|
14
|
-
selected?: boolean;
|
|
15
|
-
};
|
|
16
|
-
events: {
|
|
17
|
-
click: any;
|
|
18
|
-
dragover: any;
|
|
19
|
-
dragleave: any;
|
|
20
|
-
dragend: any;
|
|
21
|
-
drop: any;
|
|
22
|
-
} & {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
};
|
|
25
|
-
slots: {
|
|
26
|
-
'start-icon': {
|
|
27
|
-
slot: string;
|
|
28
|
-
};
|
|
29
|
-
default: {};
|
|
30
|
-
'end-icon': {
|
|
31
|
-
slot: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export {};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#textbox
|
|
4
|
-
-->
|
|
5
|
-
<script>
|
|
6
|
-
import { _ } from 'svelte-i18n';
|
|
7
|
-
import Button from './button.svelte';
|
|
8
|
-
import Icon from './icon.svelte';
|
|
9
|
-
import TextInput from './text-input.svelte';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* CSS class name on the button.
|
|
13
|
-
* @type {String}
|
|
14
|
-
*/
|
|
15
|
-
let className = '';
|
|
16
|
-
|
|
17
|
-
export { className as class };
|
|
18
|
-
|
|
19
|
-
/** @type {(String|undefined)} */
|
|
20
|
-
export let value = undefined;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @type {TextInput}
|
|
24
|
-
*/
|
|
25
|
-
let inputComponent;
|
|
26
|
-
let passwordVisible = false;
|
|
27
|
-
|
|
28
|
-
$: {
|
|
29
|
-
if (inputComponent) {
|
|
30
|
-
inputComponent.element.setAttribute('type', passwordVisible ? 'text' : 'password');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<div class="sui password-input {className}">
|
|
36
|
-
<TextInput
|
|
37
|
-
bind:this={inputComponent}
|
|
38
|
-
bind:value
|
|
39
|
-
type="password"
|
|
40
|
-
{...$$restProps}
|
|
41
|
-
on:input
|
|
42
|
-
on:keypress
|
|
43
|
-
on:change
|
|
44
|
-
/>
|
|
45
|
-
<Button
|
|
46
|
-
class="iconic"
|
|
47
|
-
pressed={passwordVisible}
|
|
48
|
-
on:click={() => {
|
|
49
|
-
passwordVisible = !passwordVisible;
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
<Icon
|
|
53
|
-
slot="start-icon"
|
|
54
|
-
name={passwordVisible ? 'visibility_off' : 'visibility'}
|
|
55
|
-
label={$_('sui.password_input.show_password')}
|
|
56
|
-
/>
|
|
57
|
-
</Button>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<style>.password-input {
|
|
61
|
-
width: 100%;
|
|
62
|
-
display: inline-flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
}
|
|
65
|
-
.password-input :global(input) {
|
|
66
|
-
border-radius: 4px 0 0 4px;
|
|
67
|
-
}
|
|
68
|
-
.password-input :global(button) {
|
|
69
|
-
flex: none;
|
|
70
|
-
margin-left: -1px;
|
|
71
|
-
border-width: 1px;
|
|
72
|
-
border-color: var(--control-border-color);
|
|
73
|
-
height: var(--input--medium--height);
|
|
74
|
-
aspect-ratio: 1/1;
|
|
75
|
-
}
|
|
76
|
-
.password-input :global(button):last-child {
|
|
77
|
-
border-radius: 0 4px 4px 0;
|
|
78
|
-
}
|
|
79
|
-
.password-input :global(button) :global(.icon) {
|
|
80
|
-
font-size: 20px;
|
|
81
|
-
}</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} PasswordInputProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} PasswordInputEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} PasswordInputSlots */
|
|
4
|
-
/** @see https://w3c.github.io/aria/#textbox */
|
|
5
|
-
export default class PasswordInput {
|
|
6
|
-
}
|
|
7
|
-
export type PasswordInputProps = typeof __propDef.props;
|
|
8
|
-
export type PasswordInputEvents = typeof __propDef.events;
|
|
9
|
-
export type PasswordInputSlots = typeof __propDef.slots;
|
|
10
|
-
declare const __propDef: {
|
|
11
|
-
props: {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
class?: string;
|
|
14
|
-
value?: (string | undefined);
|
|
15
|
-
};
|
|
16
|
-
events: {
|
|
17
|
-
input: any;
|
|
18
|
-
keypress: any;
|
|
19
|
-
change: any;
|
|
20
|
-
} & {
|
|
21
|
-
[evt: string]: CustomEvent<any>;
|
|
22
|
-
};
|
|
23
|
-
slots: {};
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#radio
|
|
4
|
-
@see https://w3c.github.io/aria-practices/#radiobutton
|
|
5
|
-
-->
|
|
6
|
-
<script>
|
|
7
|
-
import { getRandomId } from '../helpers/util';
|
|
8
|
-
import Button from './button.svelte';
|
|
9
|
-
import Icon from './icon.svelte';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* CSS class name on the button.
|
|
13
|
-
* @type {String}
|
|
14
|
-
*/
|
|
15
|
-
let className = '';
|
|
16
|
-
|
|
17
|
-
export { className as class };
|
|
18
|
-
|
|
19
|
-
/** @type {String} */
|
|
20
|
-
export let name = '';
|
|
21
|
-
|
|
22
|
-
/** @type {(String|undefined)} */
|
|
23
|
-
export let value = undefined;
|
|
24
|
-
|
|
25
|
-
/** @type {Boolean} */
|
|
26
|
-
export let selected = false;
|
|
27
|
-
|
|
28
|
-
const id = getRandomId('checkbox');
|
|
29
|
-
/** @type {Button} */
|
|
30
|
-
let buttonComponent;
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
{#if name && value && selected}
|
|
34
|
-
<input type="hidden" {name} {value} />
|
|
35
|
-
{/if}
|
|
36
|
-
|
|
37
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
38
|
-
<span
|
|
39
|
-
class="sui radio-button {className}"
|
|
40
|
-
on:click={(event) => {
|
|
41
|
-
if (!event.target.matches('button')) {
|
|
42
|
-
buttonComponent.element.click();
|
|
43
|
-
}
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
46
|
-
<Button
|
|
47
|
-
{id}
|
|
48
|
-
role="radio"
|
|
49
|
-
aria-checked={selected}
|
|
50
|
-
aria-labelledby="{id}-label"
|
|
51
|
-
bind:this={buttonComponent}
|
|
52
|
-
on:click={(event) => {
|
|
53
|
-
event.preventDefault();
|
|
54
|
-
selected = !selected;
|
|
55
|
-
}}
|
|
56
|
-
>
|
|
57
|
-
<Icon slot="start-icon" name="circle" />
|
|
58
|
-
</Button>
|
|
59
|
-
<label id="{id}-label">
|
|
60
|
-
<slot />
|
|
61
|
-
</label>
|
|
62
|
-
</span>
|
|
63
|
-
|
|
64
|
-
<style>.radio-button {
|
|
65
|
-
display: inline-flex;
|
|
66
|
-
align-items: center;
|
|
67
|
-
gap: 8px;
|
|
68
|
-
color: inherit;
|
|
69
|
-
cursor: pointer;
|
|
70
|
-
-webkit-user-select: none;
|
|
71
|
-
user-select: none;
|
|
72
|
-
}
|
|
73
|
-
.radio-button :global(button) {
|
|
74
|
-
justify-content: center;
|
|
75
|
-
overflow: hidden;
|
|
76
|
-
border-width: 2px;
|
|
77
|
-
border-color: var(--control-border-color);
|
|
78
|
-
border-radius: 24px;
|
|
79
|
-
width: 24px;
|
|
80
|
-
height: 24px;
|
|
81
|
-
color: var(--primary-accent-color-lighter);
|
|
82
|
-
transition: all 200ms;
|
|
83
|
-
}
|
|
84
|
-
.radio-button :global(button) :global(.icon) {
|
|
85
|
-
font-size: 16px;
|
|
86
|
-
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 48;
|
|
87
|
-
}
|
|
88
|
-
.radio-button :global(button[aria-checked="true"]) {
|
|
89
|
-
color: var(--primary-accent-color-lighter);
|
|
90
|
-
}
|
|
91
|
-
.radio-button :global(button[aria-checked="false"]) {
|
|
92
|
-
color: transparent;
|
|
93
|
-
}</style>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} RadioButtonProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} RadioButtonEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} RadioButtonSlots */
|
|
4
|
-
/**
|
|
5
|
-
* @see https://w3c.github.io/aria/#radio
|
|
6
|
-
* @see https://w3c.github.io/aria-practices/#radiobutton
|
|
7
|
-
*/
|
|
8
|
-
export default class RadioButton {
|
|
9
|
-
}
|
|
10
|
-
export type RadioButtonProps = typeof __propDef.props;
|
|
11
|
-
export type RadioButtonEvents = typeof __propDef.events;
|
|
12
|
-
export type RadioButtonSlots = typeof __propDef.slots;
|
|
13
|
-
declare const __propDef: {
|
|
14
|
-
props: {
|
|
15
|
-
class?: string;
|
|
16
|
-
name?: string;
|
|
17
|
-
value?: (string | undefined);
|
|
18
|
-
selected?: boolean;
|
|
19
|
-
};
|
|
20
|
-
events: {
|
|
21
|
-
[evt: string]: CustomEvent<any>;
|
|
22
|
-
};
|
|
23
|
-
slots: {
|
|
24
|
-
default: {};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
/**
|
|
3
|
-
* CSS class name on the button.
|
|
4
|
-
* @type {String}
|
|
5
|
-
*/
|
|
6
|
-
// eslint-disable-next-line padding-line-between-statements
|
|
7
|
-
let className = 'tbody';
|
|
8
|
-
|
|
9
|
-
export { className as class };
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<div role="rowgroup" class="sui row-group {className}" {...$$restProps}>
|
|
13
|
-
<slot />
|
|
14
|
-
</div>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} RowGroupProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} RowGroupEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} RowGroupSlots */
|
|
4
|
-
export default class RowGroup {
|
|
5
|
-
}
|
|
6
|
-
export type RowGroupProps = typeof __propDef.props;
|
|
7
|
-
export type RowGroupEvents = typeof __propDef.events;
|
|
8
|
-
export type RowGroupSlots = typeof __propDef.slots;
|
|
9
|
-
declare const __propDef: {
|
|
10
|
-
props: {
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
class?: string;
|
|
13
|
-
};
|
|
14
|
-
events: {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {
|
|
18
|
-
default: {};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
/**
|
|
3
|
-
* CSS class name on the button.
|
|
4
|
-
* @type {String}
|
|
5
|
-
*/
|
|
6
|
-
// eslint-disable-next-line padding-line-between-statements
|
|
7
|
-
let className = '';
|
|
8
|
-
|
|
9
|
-
export { className as class };
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<div role="row" tabindex="0" class="sui row {className}" {...$$restProps} on:click>
|
|
13
|
-
<slot />
|
|
14
|
-
</div>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} RowProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} RowEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} RowSlots */
|
|
4
|
-
export default class Row {
|
|
5
|
-
}
|
|
6
|
-
export type RowProps = typeof __propDef.props;
|
|
7
|
-
export type RowEvents = typeof __propDef.events;
|
|
8
|
-
export type RowSlots = typeof __propDef.slots;
|
|
9
|
-
declare const __propDef: {
|
|
10
|
-
props: {
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
class?: string;
|
|
13
|
-
};
|
|
14
|
-
events: {
|
|
15
|
-
click: MouseEvent;
|
|
16
|
-
} & {
|
|
17
|
-
[evt: string]: CustomEvent<any>;
|
|
18
|
-
};
|
|
19
|
-
slots: {
|
|
20
|
-
default: {};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#search
|
|
4
|
-
-->
|
|
5
|
-
<svelte:options accessors={true} />
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import { _ } from 'svelte-i18n';
|
|
9
|
-
import Button from './button.svelte';
|
|
10
|
-
import Icon from './icon.svelte';
|
|
11
|
-
import TextInput from './text-input.svelte';
|
|
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 {_SvelteComponent} */
|
|
22
|
-
let input;
|
|
23
|
-
|
|
24
|
-
export let value = '';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Move focus to the `<input>` element.
|
|
28
|
-
*/
|
|
29
|
-
export const focus = () => {
|
|
30
|
-
input?.element?.focus();
|
|
31
|
-
};
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<div class="sui search-bar {className}" role="search">
|
|
35
|
-
<Icon name="search" />
|
|
36
|
-
<TextInput
|
|
37
|
-
bind:this={input}
|
|
38
|
-
bind:value
|
|
39
|
-
role="searchbox"
|
|
40
|
-
{...$$restProps}
|
|
41
|
-
on:input
|
|
42
|
-
on:keydown
|
|
43
|
-
on:keyup
|
|
44
|
-
on:keypress
|
|
45
|
-
on:change
|
|
46
|
-
/>
|
|
47
|
-
{#if value}
|
|
48
|
-
<Button
|
|
49
|
-
class="ternary iconic"
|
|
50
|
-
on:click={() => {
|
|
51
|
-
value = '';
|
|
52
|
-
input.element.focus();
|
|
53
|
-
window.requestIdleCallback(() => {
|
|
54
|
-
input.element.dispatchEvent(new KeyboardEvent('input'));
|
|
55
|
-
input.element.dispatchEvent(new KeyboardEvent('keypress'));
|
|
56
|
-
input.element.dispatchEvent(new KeyboardEvent('change'));
|
|
57
|
-
});
|
|
58
|
-
}}
|
|
59
|
-
>
|
|
60
|
-
<Icon slot="start-icon" name="close" label={$_('sui._.clear')} />
|
|
61
|
-
</Button>
|
|
62
|
-
{/if}
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
<style>[role=search] {
|
|
66
|
-
display: flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
position: relative;
|
|
69
|
-
}
|
|
70
|
-
[role=search] :global(.icon) {
|
|
71
|
-
font-size: 20px;
|
|
72
|
-
opacity: 0.5;
|
|
73
|
-
}
|
|
74
|
-
[role=search] > :global(.icon) {
|
|
75
|
-
position: absolute;
|
|
76
|
-
inset: 8px auto auto 8px;
|
|
77
|
-
z-index: 2;
|
|
78
|
-
}
|
|
79
|
-
[role=search] > :global(button) {
|
|
80
|
-
position: absolute;
|
|
81
|
-
inset: 0 0 auto auto;
|
|
82
|
-
z-index: 2;
|
|
83
|
-
}
|
|
84
|
-
[role=search] :global(.label) {
|
|
85
|
-
inset: 0 36px;
|
|
86
|
-
}
|
|
87
|
-
[role=search] :global(input) {
|
|
88
|
-
padding: 0 36px !important;
|
|
89
|
-
width: 100%;
|
|
90
|
-
}</style>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} SearchBarProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} SearchBarEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} SearchBarSlots */
|
|
4
|
-
/** @see https://w3c.github.io/aria/#search */
|
|
5
|
-
export default class SearchBar {
|
|
6
|
-
get focus(): any;
|
|
7
|
-
/**accessor*/
|
|
8
|
-
set class(arg: any);
|
|
9
|
-
get class(): any;
|
|
10
|
-
/**accessor*/
|
|
11
|
-
set value(arg: any);
|
|
12
|
-
get value(): any;
|
|
13
|
-
}
|
|
14
|
-
export type SearchBarProps = typeof __propDef.props;
|
|
15
|
-
export type SearchBarEvents = typeof __propDef.events;
|
|
16
|
-
export type SearchBarSlots = typeof __propDef.slots;
|
|
17
|
-
declare const __propDef: {
|
|
18
|
-
props: {
|
|
19
|
-
[x: string]: any;
|
|
20
|
-
focus?: () => void;
|
|
21
|
-
class?: string;
|
|
22
|
-
value?: string;
|
|
23
|
-
};
|
|
24
|
-
events: {
|
|
25
|
-
input: any;
|
|
26
|
-
keydown: any;
|
|
27
|
-
keyup: any;
|
|
28
|
-
keypress: any;
|
|
29
|
-
change: any;
|
|
30
|
-
} & {
|
|
31
|
-
[evt: string]: CustomEvent<any>;
|
|
32
|
-
};
|
|
33
|
-
slots: {};
|
|
34
|
-
};
|
|
35
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
A variant of `<RadioButton>`, looking like a normal button.
|
|
4
|
-
@see https://w3c.github.io/aria/#radio
|
|
5
|
-
@see https://w3c.github.io/aria-practices/#radiobutton
|
|
6
|
-
-->
|
|
7
|
-
<script>
|
|
8
|
-
import Button from './button.svelte';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* CSS class name on the button.
|
|
12
|
-
* @type {String}
|
|
13
|
-
*/
|
|
14
|
-
let className = '';
|
|
15
|
-
|
|
16
|
-
export { className as class };
|
|
17
|
-
|
|
18
|
-
export let selected = false;
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<Button
|
|
22
|
-
class="sui select-button {className}"
|
|
23
|
-
role="radio"
|
|
24
|
-
aria-checked={selected}
|
|
25
|
-
{...$$restProps}
|
|
26
|
-
on:click
|
|
27
|
-
>
|
|
28
|
-
<slot name="start-icon" slot="start-icon" />
|
|
29
|
-
<slot />
|
|
30
|
-
<slot name="end-icon" slot="end-icon" />
|
|
31
|
-
</Button>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} SelectButtonProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} SelectButtonEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} SelectButtonSlots */
|
|
4
|
-
/**
|
|
5
|
-
* A variant of `<RadioButton>`, looking like a normal button.
|
|
6
|
-
* @see https://w3c.github.io/aria/#radio
|
|
7
|
-
* @see https://w3c.github.io/aria-practices/#radiobutton
|
|
8
|
-
*/
|
|
9
|
-
export default class SelectButton {
|
|
10
|
-
}
|
|
11
|
-
export type SelectButtonProps = typeof __propDef.props;
|
|
12
|
-
export type SelectButtonEvents = typeof __propDef.events;
|
|
13
|
-
export type SelectButtonSlots = typeof __propDef.slots;
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {
|
|
16
|
-
[x: string]: any;
|
|
17
|
-
class?: string;
|
|
18
|
-
selected?: boolean;
|
|
19
|
-
};
|
|
20
|
-
events: {
|
|
21
|
-
click: any;
|
|
22
|
-
} & {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
};
|
|
25
|
-
slots: {
|
|
26
|
-
'start-icon': {
|
|
27
|
-
slot: string;
|
|
28
|
-
};
|
|
29
|
-
default: {};
|
|
30
|
-
'end-icon': {
|
|
31
|
-
slot: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#separator
|
|
4
|
-
-->
|
|
5
|
-
<script>
|
|
6
|
-
export let orientation = 'horizontal';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* CSS class name on the button.
|
|
10
|
-
* @type {String}
|
|
11
|
-
*/
|
|
12
|
-
let className = '';
|
|
13
|
-
|
|
14
|
-
export { className as class };
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div role="separator" class="sui separator {className}" aria-orientation={orientation} />
|
|
18
|
-
|
|
19
|
-
<style>.separator {
|
|
20
|
-
flex: none;
|
|
21
|
-
background-color: var(--secondary-border-color);
|
|
22
|
-
}
|
|
23
|
-
.separator[aria-orientation=horizontal] {
|
|
24
|
-
height: 1px;
|
|
25
|
-
}
|
|
26
|
-
.separator[aria-orientation=vertical] {
|
|
27
|
-
width: 1px;
|
|
28
|
-
}</style>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} SeparatorProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} SeparatorEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} SeparatorSlots */
|
|
4
|
-
/** @see https://w3c.github.io/aria/#separator */
|
|
5
|
-
export default class Separator {
|
|
6
|
-
}
|
|
7
|
-
export type SeparatorProps = typeof __propDef.props;
|
|
8
|
-
export type SeparatorEvents = typeof __propDef.events;
|
|
9
|
-
export type SeparatorSlots = typeof __propDef.slots;
|
|
10
|
-
declare const __propDef: {
|
|
11
|
-
props: {
|
|
12
|
-
class?: string;
|
|
13
|
-
orientation?: string;
|
|
14
|
-
};
|
|
15
|
-
events: {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {};
|
|
19
|
-
};
|
|
20
|
-
export {};
|