@sveltia/ui 0.1.5 → 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 +22 -11
- 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 -206
- 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 -71
- 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 -104
- 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 -154
- 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 -145
- 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,113 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#menuitem
|
|
4
|
-
-->
|
|
5
|
-
<script>
|
|
6
|
-
import { writable } from 'svelte/store';
|
|
7
|
-
import Menu from '../composite/menu.svelte';
|
|
8
|
-
import Popup from '../util/popup.svelte';
|
|
9
|
-
import Button from './button.svelte';
|
|
10
|
-
import Icon from './icon.svelte';
|
|
11
|
-
|
|
12
|
-
let className = '';
|
|
13
|
-
|
|
14
|
-
export { className as class };
|
|
15
|
-
|
|
16
|
-
/** @type {('menuitem'|'menuitemcheckbox'|'menuitemradio')} */
|
|
17
|
-
export let role = 'menuitem';
|
|
18
|
-
|
|
19
|
-
export let label = '';
|
|
20
|
-
|
|
21
|
-
export let iconName = '';
|
|
22
|
-
|
|
23
|
-
export let iconLabel = '';
|
|
24
|
-
|
|
25
|
-
export let checked = false;
|
|
26
|
-
|
|
27
|
-
/** @type {Button} */
|
|
28
|
-
let buttonComponent;
|
|
29
|
-
let isPopupOpen = writable(false);
|
|
30
|
-
|
|
31
|
-
$: hasChildren = role === 'menuitem' && $$slots.default;
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<div class="sui menuitem {className}">
|
|
35
|
-
<Button
|
|
36
|
-
{role}
|
|
37
|
-
aria-checked={checked}
|
|
38
|
-
aria-haspopup={hasChildren ? 'menu' : undefined}
|
|
39
|
-
aria-expanded={$isPopupOpen ? true : undefined}
|
|
40
|
-
{...$$restProps}
|
|
41
|
-
bind:this={buttonComponent}
|
|
42
|
-
on:click
|
|
43
|
-
on:mouseenter={() => {
|
|
44
|
-
$isPopupOpen = true;
|
|
45
|
-
}}
|
|
46
|
-
on:mouseleave={() => {
|
|
47
|
-
$isPopupOpen = false;
|
|
48
|
-
}}
|
|
49
|
-
>
|
|
50
|
-
{#if iconName}
|
|
51
|
-
<Icon slot="start-icon" name={iconName} label={iconLabel} />
|
|
52
|
-
{/if}
|
|
53
|
-
{#if label}
|
|
54
|
-
<span class="label">{label}</span>
|
|
55
|
-
{/if}
|
|
56
|
-
{#if role === 'menuitemradio' || role === 'menuitemcheckbox'}
|
|
57
|
-
<span class="icon-outer">
|
|
58
|
-
{#if checked}
|
|
59
|
-
<Icon name="check" />
|
|
60
|
-
{/if}
|
|
61
|
-
</span>
|
|
62
|
-
{/if}
|
|
63
|
-
{#if hasChildren}
|
|
64
|
-
<span class="icon-outer">
|
|
65
|
-
<Icon name="chevron_right" />
|
|
66
|
-
</span>
|
|
67
|
-
{/if}
|
|
68
|
-
</Button>
|
|
69
|
-
{#if hasChildren}
|
|
70
|
-
<Popup anchor={buttonComponent?.element} position="right-top" bind:open={isPopupOpen}>
|
|
71
|
-
<Menu>
|
|
72
|
-
<slot />
|
|
73
|
-
</Menu>
|
|
74
|
-
</Popup>
|
|
75
|
-
{/if}
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<style>.menuitem {
|
|
79
|
-
position: relative;
|
|
80
|
-
}
|
|
81
|
-
.menuitem :global(button) {
|
|
82
|
-
display: flex;
|
|
83
|
-
justify-content: space-between !important;
|
|
84
|
-
border-radius: 4px;
|
|
85
|
-
padding: 0 16px;
|
|
86
|
-
width: 100%;
|
|
87
|
-
min-width: 160px;
|
|
88
|
-
height: var(--option--medium--height);
|
|
89
|
-
}
|
|
90
|
-
.menuitem :global(button[aria-checked="true"]) :global(.icon) {
|
|
91
|
-
color: var(--primary-accent-color-lighter);
|
|
92
|
-
}
|
|
93
|
-
.menuitem :global(button:hover),
|
|
94
|
-
.menuitem :global(button:focus) {
|
|
95
|
-
color: var(--highlight-foreground-color);
|
|
96
|
-
background-color: var(--highlight-background-color);
|
|
97
|
-
}
|
|
98
|
-
.menuitem:hover > :global([role="menu"]) {
|
|
99
|
-
opacity: 1;
|
|
100
|
-
}
|
|
101
|
-
.menuitem > :global([role="menu"]) {
|
|
102
|
-
position: absolute;
|
|
103
|
-
inset: 2px auto auto calc(100% + 4px);
|
|
104
|
-
}
|
|
105
|
-
.menuitem > :global([role="menu"]):hover {
|
|
106
|
-
opacity: 1;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.icon-outer {
|
|
110
|
-
flex: none;
|
|
111
|
-
width: 24px;
|
|
112
|
-
height: 24px;
|
|
113
|
-
}</style>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} MenuItemProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} MenuItemEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} MenuItemSlots */
|
|
4
|
-
/** @see https://w3c.github.io/aria/#menuitem */
|
|
5
|
-
export default class MenuItem {
|
|
6
|
-
}
|
|
7
|
-
export type MenuItemProps = typeof __propDef.props;
|
|
8
|
-
export type MenuItemEvents = typeof __propDef.events;
|
|
9
|
-
export type MenuItemSlots = typeof __propDef.slots;
|
|
10
|
-
declare const __propDef: {
|
|
11
|
-
props: {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
label?: string;
|
|
14
|
-
class?: string;
|
|
15
|
-
role?: ('menuitem' | 'menuitemcheckbox' | 'menuitemradio');
|
|
16
|
-
checked?: boolean;
|
|
17
|
-
iconName?: string;
|
|
18
|
-
iconLabel?: string;
|
|
19
|
-
};
|
|
20
|
-
events: {
|
|
21
|
-
click: any;
|
|
22
|
-
} & {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
};
|
|
25
|
-
slots: {
|
|
26
|
-
default: {};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export {};
|
|
@@ -1,112 +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
|
-
export let disabled = false;
|
|
23
|
-
export let min = undefined;
|
|
24
|
-
export let max = undefined;
|
|
25
|
-
export let step = 1;
|
|
26
|
-
|
|
27
|
-
let component;
|
|
28
|
-
|
|
29
|
-
const decrease = () => {
|
|
30
|
-
if (typeof min === 'number' && Number(value || 0) === min) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
value = String(Number(value || 0) - step);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const increase = () => {
|
|
38
|
-
if (typeof min === 'number' && Number(value || 0) === max) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
value = String(Number(value || 0) + step);
|
|
43
|
-
};
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<div class="sui number-input {className}">
|
|
47
|
-
<TextInput
|
|
48
|
-
bind:this={component}
|
|
49
|
-
bind:value
|
|
50
|
-
{disabled}
|
|
51
|
-
role="spinbutton"
|
|
52
|
-
aria-valuenow={Number(value || 0)}
|
|
53
|
-
aria-invalid={Number.isNaN(Number(value))}
|
|
54
|
-
{...$$restProps}
|
|
55
|
-
on:keydown={(event) => {
|
|
56
|
-
const { key, ctrlKey, metaKey, altKey, shiftKey } = event;
|
|
57
|
-
|
|
58
|
-
if (key === 'ArrowDown' && !ctrlKey && !metaKey && !altKey && !shiftKey) {
|
|
59
|
-
event.preventDefault();
|
|
60
|
-
decrease();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (key === 'ArrowUp' && !ctrlKey && !metaKey && !altKey && !shiftKey) {
|
|
64
|
-
event.preventDefault();
|
|
65
|
-
increase();
|
|
66
|
-
}
|
|
67
|
-
}}
|
|
68
|
-
on:keypress
|
|
69
|
-
on:input
|
|
70
|
-
/>
|
|
71
|
-
<Button
|
|
72
|
-
class="iconic"
|
|
73
|
-
disabled={disabled || Number.isNaN(Number(value))}
|
|
74
|
-
on:click={() => {
|
|
75
|
-
decrease();
|
|
76
|
-
}}
|
|
77
|
-
>
|
|
78
|
-
<Icon slot="start-icon" name="arrow_downward" label={$_('sui.number_input.decrease')} />
|
|
79
|
-
</Button>
|
|
80
|
-
<Button
|
|
81
|
-
class="iconic"
|
|
82
|
-
disabled={disabled || Number.isNaN(Number(value))}
|
|
83
|
-
on:click={() => {
|
|
84
|
-
increase();
|
|
85
|
-
}}
|
|
86
|
-
>
|
|
87
|
-
<Icon slot="start-icon" name={'arrow_upward'} label={$_('sui.number_input.increase')} />
|
|
88
|
-
</Button>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<style>.number-input {
|
|
92
|
-
width: 100%;
|
|
93
|
-
display: inline-flex;
|
|
94
|
-
align-items: center;
|
|
95
|
-
}
|
|
96
|
-
.number-input :global(input) {
|
|
97
|
-
border-radius: 4px 0 0 4px;
|
|
98
|
-
}
|
|
99
|
-
.number-input :global(button) {
|
|
100
|
-
flex: none;
|
|
101
|
-
margin-left: -1px;
|
|
102
|
-
border-width: 1px;
|
|
103
|
-
border-color: var(--control-border-color);
|
|
104
|
-
width: 32px;
|
|
105
|
-
height: var(--input--medium--height);
|
|
106
|
-
}
|
|
107
|
-
.number-input :global(button):last-child {
|
|
108
|
-
border-radius: 0 4px 4px 0;
|
|
109
|
-
}
|
|
110
|
-
.number-input :global(button) :global(.icon) {
|
|
111
|
-
font-size: 20px;
|
|
112
|
-
}</style>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} NumberInputProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} NumberInputEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} NumberInputSlots */
|
|
4
|
-
/** @see https://w3c.github.io/aria/#textbox */
|
|
5
|
-
export default class NumberInput {
|
|
6
|
-
}
|
|
7
|
-
export type NumberInputProps = typeof __propDef.props;
|
|
8
|
-
export type NumberInputEvents = typeof __propDef.events;
|
|
9
|
-
export type NumberInputSlots = typeof __propDef.slots;
|
|
10
|
-
declare const __propDef: {
|
|
11
|
-
props: {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
class?: string;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
value?: (string | undefined);
|
|
16
|
-
min?: any;
|
|
17
|
-
max?: any;
|
|
18
|
-
step?: number;
|
|
19
|
-
};
|
|
20
|
-
events: {
|
|
21
|
-
keypress: any;
|
|
22
|
-
input: any;
|
|
23
|
-
} & {
|
|
24
|
-
[evt: string]: CustomEvent<any>;
|
|
25
|
-
};
|
|
26
|
-
slots: {};
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
@@ -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 {};
|