@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,23 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#tabpanel
|
|
4
|
-
@see https://w3c.github.io/aria-practices/#tabpanel
|
|
5
|
-
-->
|
|
6
|
-
<script>
|
|
7
|
-
/**
|
|
8
|
-
* CSS class name on the button.
|
|
9
|
-
* @type {String}
|
|
10
|
-
*/
|
|
11
|
-
// eslint-disable-next-line padding-line-between-statements
|
|
12
|
-
let className = '';
|
|
13
|
-
|
|
14
|
-
export { className as class };
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div class="sui tabpanel {className}" role="tabpanel" {...$$restProps}>
|
|
18
|
-
<slot />
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<style>.tabpanel[aria-hidden=true], .tabpanel:not([aria-hidden]) {
|
|
22
|
-
display: none;
|
|
23
|
-
}</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} TabPanelProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} TabPanelEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} TabPanelSlots */
|
|
4
|
-
/**
|
|
5
|
-
* @see https://w3c.github.io/aria/#tabpanel
|
|
6
|
-
* @see https://w3c.github.io/aria-practices/#tabpanel
|
|
7
|
-
*/
|
|
8
|
-
export default class TabPanel {
|
|
9
|
-
}
|
|
10
|
-
export type TabPanelProps = typeof __propDef.props;
|
|
11
|
-
export type TabPanelEvents = typeof __propDef.events;
|
|
12
|
-
export type TabPanelSlots = typeof __propDef.slots;
|
|
13
|
-
declare const __propDef: {
|
|
14
|
-
props: {
|
|
15
|
-
[x: string]: any;
|
|
16
|
-
class?: string;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {
|
|
22
|
-
default: {};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#tab
|
|
4
|
-
@see https://w3c.github.io/aria-practices/#tabpanel
|
|
5
|
-
-->
|
|
6
|
-
<script>
|
|
7
|
-
import Button from './button.svelte';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* CSS class name on the button.
|
|
11
|
-
* @type {String}
|
|
12
|
-
*/
|
|
13
|
-
let className = '';
|
|
14
|
-
|
|
15
|
-
export { className as class };
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<Button role="tab" class="sui tab {className}" {...$$restProps}>
|
|
19
|
-
<slot name="start-icon" slot="start-icon" />
|
|
20
|
-
<slot />
|
|
21
|
-
<slot name="end-icon" slot="end-icon" />
|
|
22
|
-
</Button>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} TabProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} TabEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} TabSlots */
|
|
4
|
-
/**
|
|
5
|
-
* @see https://w3c.github.io/aria/#tab
|
|
6
|
-
* @see https://w3c.github.io/aria-practices/#tabpanel
|
|
7
|
-
*/
|
|
8
|
-
export default class Tab {
|
|
9
|
-
}
|
|
10
|
-
export type TabProps = typeof __propDef.props;
|
|
11
|
-
export type TabEvents = typeof __propDef.events;
|
|
12
|
-
export type TabSlots = typeof __propDef.slots;
|
|
13
|
-
declare const __propDef: {
|
|
14
|
-
props: {
|
|
15
|
-
[x: string]: any;
|
|
16
|
-
class?: string;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {
|
|
22
|
-
'start-icon': {
|
|
23
|
-
slot: string;
|
|
24
|
-
};
|
|
25
|
-
default: {};
|
|
26
|
-
'end-icon': {
|
|
27
|
-
slot: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export {};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#textbox
|
|
4
|
-
-->
|
|
5
|
-
<svelte:options accessors={true} />
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
/**
|
|
9
|
-
* CSS class name on the button.
|
|
10
|
-
* @type {String}
|
|
11
|
-
*/
|
|
12
|
-
// eslint-disable-next-line padding-line-between-statements
|
|
13
|
-
let className = '';
|
|
14
|
-
|
|
15
|
-
export { className as class };
|
|
16
|
-
|
|
17
|
-
/** @type {(HTMLTextAreaElement|undefined)} */
|
|
18
|
-
export let element = undefined;
|
|
19
|
-
|
|
20
|
-
export let name = '';
|
|
21
|
-
|
|
22
|
-
/** @type {(String|undefined)} */
|
|
23
|
-
export let value = undefined;
|
|
24
|
-
|
|
25
|
-
export let autoResize = false;
|
|
26
|
-
|
|
27
|
-
/** @type {(String|undefined)} */
|
|
28
|
-
let height;
|
|
29
|
-
|
|
30
|
-
const resizeTextarea = () => {
|
|
31
|
-
height = 'auto';
|
|
32
|
-
|
|
33
|
-
window.requestAnimationFrame(() => {
|
|
34
|
-
height = value && element?.scrollHeight ? `${element.scrollHeight + 4}px` : undefined;
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
$: {
|
|
39
|
-
if (value && autoResize) {
|
|
40
|
-
resizeTextarea();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<div class="sui text-area {className}">
|
|
46
|
-
<textarea
|
|
47
|
-
name={name || undefined}
|
|
48
|
-
{...$$restProps}
|
|
49
|
-
style:height
|
|
50
|
-
bind:this={element}
|
|
51
|
-
on:click
|
|
52
|
-
on:input
|
|
53
|
-
on:keypress
|
|
54
|
-
on:input={() => {
|
|
55
|
-
value = element.value;
|
|
56
|
-
}}>{value}</textarea
|
|
57
|
-
>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<style>.text-area {
|
|
61
|
-
width: 100%;
|
|
62
|
-
display: inline-flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
textarea {
|
|
67
|
-
display: block;
|
|
68
|
-
margin: 0;
|
|
69
|
-
border-width: 1px;
|
|
70
|
-
border-color: var(--control-border-color);
|
|
71
|
-
border-radius: var(--input--medium--border-radius);
|
|
72
|
-
background-color: var(--control-background-color);
|
|
73
|
-
padding: 8px;
|
|
74
|
-
width: 100%;
|
|
75
|
-
min-height: 8em;
|
|
76
|
-
color: inherit;
|
|
77
|
-
font-family: inherit;
|
|
78
|
-
font-size: inherit;
|
|
79
|
-
line-height: 1.75;
|
|
80
|
-
resize: vertical;
|
|
81
|
-
transition: all 200ms;
|
|
82
|
-
}
|
|
83
|
-
textarea:focus {
|
|
84
|
-
border-color: var(--primary-accent-color);
|
|
85
|
-
}
|
|
86
|
-
textarea:disabled {
|
|
87
|
-
background-color: var(--disabled-background-color);
|
|
88
|
-
opacity: 0.4;
|
|
89
|
-
cursor: default;
|
|
90
|
-
}</style>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} TextAreaProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} TextAreaEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} TextAreaSlots */
|
|
4
|
-
/** @see https://w3c.github.io/aria/#textbox */
|
|
5
|
-
export default class TextArea {
|
|
6
|
-
/**accessor*/
|
|
7
|
-
set class(arg: any);
|
|
8
|
-
get class(): any;
|
|
9
|
-
/**accessor*/
|
|
10
|
-
set element(arg: any);
|
|
11
|
-
get element(): any;
|
|
12
|
-
/**accessor*/
|
|
13
|
-
set name(arg: any);
|
|
14
|
-
get name(): any;
|
|
15
|
-
/**accessor*/
|
|
16
|
-
set value(arg: any);
|
|
17
|
-
get value(): any;
|
|
18
|
-
/**accessor*/
|
|
19
|
-
set autoResize(arg: any);
|
|
20
|
-
get autoResize(): any;
|
|
21
|
-
}
|
|
22
|
-
export type TextAreaProps = typeof __propDef.props;
|
|
23
|
-
export type TextAreaEvents = typeof __propDef.events;
|
|
24
|
-
export type TextAreaSlots = typeof __propDef.slots;
|
|
25
|
-
declare const __propDef: {
|
|
26
|
-
props: {
|
|
27
|
-
[x: string]: any;
|
|
28
|
-
class?: string;
|
|
29
|
-
element?: (HTMLTextAreaElement | undefined);
|
|
30
|
-
name?: string;
|
|
31
|
-
value?: (string | undefined);
|
|
32
|
-
autoResize?: boolean;
|
|
33
|
-
};
|
|
34
|
-
events: {
|
|
35
|
-
click: MouseEvent;
|
|
36
|
-
input: Event;
|
|
37
|
-
keypress: KeyboardEvent;
|
|
38
|
-
} & {
|
|
39
|
-
[evt: string]: CustomEvent<any>;
|
|
40
|
-
};
|
|
41
|
-
slots: {};
|
|
42
|
-
};
|
|
43
|
-
export {};
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#textbox
|
|
4
|
-
-->
|
|
5
|
-
<svelte:options accessors={true} />
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import { getRandomId } from '../helpers/util';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* CSS class name on the button.
|
|
12
|
-
* @type {String}
|
|
13
|
-
*/
|
|
14
|
-
let className = '';
|
|
15
|
-
|
|
16
|
-
export { className as class };
|
|
17
|
-
|
|
18
|
-
/** @type {(HTMLInputElement|undefined)} */
|
|
19
|
-
export let element = undefined;
|
|
20
|
-
|
|
21
|
-
/** @type {('textbox'|'searchbox'|'combobox'|'spinbutton')} */
|
|
22
|
-
export let role = 'textbox';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Whether the textbox is editable.
|
|
26
|
-
*/
|
|
27
|
-
export let readOnly = false;
|
|
28
|
-
|
|
29
|
-
export let disabled = false;
|
|
30
|
-
|
|
31
|
-
export let name = '';
|
|
32
|
-
|
|
33
|
-
/** @type {(String|undefined)} */
|
|
34
|
-
export let value = undefined;
|
|
35
|
-
|
|
36
|
-
const id = getRandomId('input');
|
|
37
|
-
let ariaLabel = '';
|
|
38
|
-
|
|
39
|
-
$: {
|
|
40
|
-
// Replace `aria-label` with a visible label if `<input placeholder>` is not defined
|
|
41
|
-
if ('aria-label' in $$restProps && !('placeholder' in $$restProps)) {
|
|
42
|
-
ariaLabel = $$restProps['aria-label'];
|
|
43
|
-
delete $$restProps['aria-label'];
|
|
44
|
-
$$restProps['aria-labelledby'] = `${id}-label`;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<div class="sui text-input {className}">
|
|
50
|
-
<input
|
|
51
|
-
type="text"
|
|
52
|
-
{role}
|
|
53
|
-
name={name || undefined}
|
|
54
|
-
{readOnly}
|
|
55
|
-
aria-readonly={readOnly ? true : undefined}
|
|
56
|
-
{disabled}
|
|
57
|
-
aria-disabled={disabled ? true : undefined}
|
|
58
|
-
{...$$restProps}
|
|
59
|
-
bind:this={element}
|
|
60
|
-
bind:value
|
|
61
|
-
on:input
|
|
62
|
-
on:keydown
|
|
63
|
-
on:keyup
|
|
64
|
-
on:keypress
|
|
65
|
-
on:change
|
|
66
|
-
/>
|
|
67
|
-
{#if ariaLabel}
|
|
68
|
-
<span id="{id}-label" class="label" class:hidden={!!value}>
|
|
69
|
-
{ariaLabel}
|
|
70
|
-
</span>
|
|
71
|
-
{/if}
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<style>.text-input {
|
|
75
|
-
position: relative;
|
|
76
|
-
width: 100%;
|
|
77
|
-
display: inline-flex;
|
|
78
|
-
align-items: center;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
input {
|
|
82
|
-
z-index: 1;
|
|
83
|
-
display: inline-block;
|
|
84
|
-
flex: auto;
|
|
85
|
-
border-width: 1px;
|
|
86
|
-
border-color: var(--control-border-color);
|
|
87
|
-
border-radius: var(--input--medium--border-radius);
|
|
88
|
-
padding: 0 8px;
|
|
89
|
-
min-width: 0;
|
|
90
|
-
height: var(--input--medium--height);
|
|
91
|
-
background-color: var(--control-background-color);
|
|
92
|
-
color: inherit;
|
|
93
|
-
font-family: inherit;
|
|
94
|
-
font-size: inherit;
|
|
95
|
-
line-height: 30px;
|
|
96
|
-
transition: all 200ms;
|
|
97
|
-
}
|
|
98
|
-
input:focus {
|
|
99
|
-
border-color: var(--primary-accent-color);
|
|
100
|
-
}
|
|
101
|
-
input:read-only {
|
|
102
|
-
color: var(--ternary-foreground-color);
|
|
103
|
-
border-color: var(--control-border-color) !important;
|
|
104
|
-
}
|
|
105
|
-
input:disabled {
|
|
106
|
-
background-color: var(--disabled-background-color);
|
|
107
|
-
opacity: 0.4;
|
|
108
|
-
cursor: default;
|
|
109
|
-
}
|
|
110
|
-
input[aria-invalid=true] {
|
|
111
|
-
border-color: deeppink;
|
|
112
|
-
}
|
|
113
|
-
input ~ :global(button) {
|
|
114
|
-
flex: none;
|
|
115
|
-
margin-left: -1px;
|
|
116
|
-
border-width: 1px;
|
|
117
|
-
border-color: var(--control-border-color);
|
|
118
|
-
height: var(--input--medium--height);
|
|
119
|
-
aspect-ratio: 1/1;
|
|
120
|
-
}
|
|
121
|
-
input ~ :global(button):last-child {
|
|
122
|
-
border-radius: 0 4px 4px 0;
|
|
123
|
-
}
|
|
124
|
-
input ~ :global(button) :global(.icon) {
|
|
125
|
-
font-size: 20px;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.label {
|
|
129
|
-
position: absolute;
|
|
130
|
-
inset: 0 8px;
|
|
131
|
-
z-index: 2;
|
|
132
|
-
display: flex;
|
|
133
|
-
justify-content: var(--input-label-align, flex-start);
|
|
134
|
-
align-items: center;
|
|
135
|
-
color: var(--primary-foreground-color);
|
|
136
|
-
opacity: 0.5;
|
|
137
|
-
pointer-events: none;
|
|
138
|
-
}
|
|
139
|
-
.label.hidden {
|
|
140
|
-
opacity: 0;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
input:focus + .label {
|
|
144
|
-
opacity: 0;
|
|
145
|
-
}</style>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} TextInputProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} TextInputEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} TextInputSlots */
|
|
4
|
-
/** @see https://w3c.github.io/aria/#textbox */
|
|
5
|
-
export default class TextInput {
|
|
6
|
-
/**accessor*/
|
|
7
|
-
set class(arg: any);
|
|
8
|
-
get class(): any;
|
|
9
|
-
/**accessor*/
|
|
10
|
-
set element(arg: any);
|
|
11
|
-
get element(): any;
|
|
12
|
-
/**accessor*/
|
|
13
|
-
set role(arg: any);
|
|
14
|
-
get role(): any;
|
|
15
|
-
/**accessor*/
|
|
16
|
-
set readOnly(arg: any);
|
|
17
|
-
get readOnly(): any;
|
|
18
|
-
/**accessor*/
|
|
19
|
-
set disabled(arg: any);
|
|
20
|
-
get disabled(): any;
|
|
21
|
-
/**accessor*/
|
|
22
|
-
set name(arg: any);
|
|
23
|
-
get name(): any;
|
|
24
|
-
/**accessor*/
|
|
25
|
-
set value(arg: any);
|
|
26
|
-
get value(): any;
|
|
27
|
-
}
|
|
28
|
-
export type TextInputProps = typeof __propDef.props;
|
|
29
|
-
export type TextInputEvents = typeof __propDef.events;
|
|
30
|
-
export type TextInputSlots = typeof __propDef.slots;
|
|
31
|
-
declare const __propDef: {
|
|
32
|
-
props: {
|
|
33
|
-
[x: string]: any;
|
|
34
|
-
class?: string;
|
|
35
|
-
element?: (HTMLInputElement | undefined);
|
|
36
|
-
role?: ('textbox' | 'searchbox' | 'combobox' | 'spinbutton');
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
name?: string;
|
|
39
|
-
value?: (string | undefined);
|
|
40
|
-
readOnly?: boolean;
|
|
41
|
-
};
|
|
42
|
-
events: {
|
|
43
|
-
input: Event;
|
|
44
|
-
keydown: KeyboardEvent;
|
|
45
|
-
keyup: KeyboardEvent;
|
|
46
|
-
keypress: KeyboardEvent;
|
|
47
|
-
change: Event;
|
|
48
|
-
} & {
|
|
49
|
-
[evt: string]: CustomEvent<any>;
|
|
50
|
-
};
|
|
51
|
-
slots: {};
|
|
52
|
-
};
|
|
53
|
-
export {};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
@see https://w3c.github.io/aria/#toolbar
|
|
4
|
-
@see https://w3c.github.io/aria-practices/#toolbar
|
|
5
|
-
-->
|
|
6
|
-
<script>
|
|
7
|
-
/**
|
|
8
|
-
* CSS class name on the button.
|
|
9
|
-
* @type {String}
|
|
10
|
-
*/
|
|
11
|
-
// eslint-disable-next-line padding-line-between-statements
|
|
12
|
-
let className = '';
|
|
13
|
-
|
|
14
|
-
export { className as class };
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Define the `aria-orientation` property on the toolbar element.
|
|
18
|
-
* @type {('horizontal'|'vertical')}
|
|
19
|
-
*/
|
|
20
|
-
export let orientation = 'horizontal';
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<div
|
|
24
|
-
class="sui toolbar {orientation} {className}"
|
|
25
|
-
role="toolbar"
|
|
26
|
-
aria-orientation={orientation}
|
|
27
|
-
{...$$restProps}
|
|
28
|
-
>
|
|
29
|
-
<slot />
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<style>[role=toolbar] {
|
|
33
|
-
--toolbar-size: 40px;
|
|
34
|
-
flex: none !important;
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
gap: 8px;
|
|
38
|
-
padding: 8px;
|
|
39
|
-
}
|
|
40
|
-
[role=toolbar].primary {
|
|
41
|
-
--toolbar-size: 48px;
|
|
42
|
-
background-color: var(--secondary-background-color);
|
|
43
|
-
}
|
|
44
|
-
[role=toolbar].secondary {
|
|
45
|
-
background-color: var(--ternary-background-color);
|
|
46
|
-
}
|
|
47
|
-
[role=toolbar][aria-orientation=horizontal] {
|
|
48
|
-
height: var(--toolbar-size);
|
|
49
|
-
}
|
|
50
|
-
[role=toolbar][aria-orientation=vertical] {
|
|
51
|
-
flex-direction: column;
|
|
52
|
-
width: var(--toolbar-size);
|
|
53
|
-
}
|
|
54
|
-
[role=toolbar]:not(:last-child) {
|
|
55
|
-
border-width: 0 0 1px;
|
|
56
|
-
border-color: var(--primary-border-color);
|
|
57
|
-
}
|
|
58
|
-
[role=toolbar] :global(button[role="button"][aria-pressed="true"]),
|
|
59
|
-
[role=toolbar] :global(button[role="button"][aria-checked="true"]) {
|
|
60
|
-
background-color: var(--highlight-background-color);
|
|
61
|
-
}
|
|
62
|
-
[role=toolbar] :global(h2) {
|
|
63
|
-
display: flex;
|
|
64
|
-
align-items: center;
|
|
65
|
-
gap: 8px;
|
|
66
|
-
margin: 0;
|
|
67
|
-
padding: 0 8px;
|
|
68
|
-
font-size: 16px;
|
|
69
|
-
}
|
|
70
|
-
[role=toolbar] :global(h2) :global(span) {
|
|
71
|
-
font-size: 12px;
|
|
72
|
-
font-weight: normal;
|
|
73
|
-
opacity: 0.8;
|
|
74
|
-
}</style>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} ToolbarProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} ToolbarEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} ToolbarSlots */
|
|
4
|
-
/**
|
|
5
|
-
* @see https://w3c.github.io/aria/#toolbar
|
|
6
|
-
* @see https://w3c.github.io/aria-practices/#toolbar
|
|
7
|
-
*/
|
|
8
|
-
export default class Toolbar {
|
|
9
|
-
}
|
|
10
|
-
export type ToolbarProps = typeof __propDef.props;
|
|
11
|
-
export type ToolbarEvents = typeof __propDef.events;
|
|
12
|
-
export type ToolbarSlots = typeof __propDef.slots;
|
|
13
|
-
declare const __propDef: {
|
|
14
|
-
props: {
|
|
15
|
-
[x: string]: any;
|
|
16
|
-
class?: string;
|
|
17
|
-
orientation?: ('horizontal' | 'vertical');
|
|
18
|
-
};
|
|
19
|
-
events: {
|
|
20
|
-
[evt: string]: CustomEvent<any>;
|
|
21
|
-
};
|
|
22
|
-
slots: {
|
|
23
|
-
default: {};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export {};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { _ } from 'svelte-i18n';
|
|
3
|
-
import Button from '../core/button.svelte';
|
|
4
|
-
import Icon from '../core/icon.svelte';
|
|
5
|
-
import Separator from '../core/separator.svelte';
|
|
6
|
-
import TextArea from '../core/text-area.svelte';
|
|
7
|
-
import Toolbar from '../core/toolbar.svelte';
|
|
8
|
-
|
|
9
|
-
/** @type {(String|undefined)} */
|
|
10
|
-
export let value = undefined;
|
|
11
|
-
|
|
12
|
-
export let disabled = false;
|
|
13
|
-
|
|
14
|
-
const defaultButtons = [
|
|
15
|
-
{ name: 'bold', label: $_('sui.markdown_editor.bold'), icon: 'format_bold' },
|
|
16
|
-
{ name: 'italic', label: $_('sui.markdown_editor.italic'), icon: 'format_italic' },
|
|
17
|
-
{ name: 'code', label: $_('sui.markdown_editor.code'), icon: 'code' },
|
|
18
|
-
{ name: 'link', label: $_('sui.markdown_editor.link'), icon: 'link' },
|
|
19
|
-
{ separator: true },
|
|
20
|
-
{
|
|
21
|
-
name: 'heading-one',
|
|
22
|
-
label: $_('sui.markdown_editor.heading_x', { values: { level: 1 } }),
|
|
23
|
-
icon: 'format_h1',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: 'heading-two',
|
|
27
|
-
label: $_('sui.markdown_editor.heading_x', { values: { level: 2 } }),
|
|
28
|
-
icon: 'format_h2',
|
|
29
|
-
},
|
|
30
|
-
{ name: 'quote', label: $_('sui.markdown_editor.quote'), icon: 'format_quote' },
|
|
31
|
-
{ separator: true },
|
|
32
|
-
{
|
|
33
|
-
name: 'bulleted-list',
|
|
34
|
-
label: $_('sui.markdown_editor.bulleted_list'),
|
|
35
|
-
icon: 'format_list_bulleted',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'numbered-list',
|
|
39
|
-
label: $_('sui.markdown_editor.numbered_list'),
|
|
40
|
-
icon: 'format_list_numbered',
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<div>
|
|
46
|
-
<Toolbar aria-label={$_('sui.markdown_editor.markdown_editor')}>
|
|
47
|
-
{#each defaultButtons as { label, icon, separator }}
|
|
48
|
-
{#if separator}
|
|
49
|
-
<Separator />
|
|
50
|
-
{:else}
|
|
51
|
-
<Button {disabled}>
|
|
52
|
-
<Icon slot="start-icon" name={icon} {label} />
|
|
53
|
-
</Button>
|
|
54
|
-
{/if}
|
|
55
|
-
{/each}
|
|
56
|
-
</Toolbar>
|
|
57
|
-
<TextArea autoResize={true} {disabled} bind:value />
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<style>div {
|
|
61
|
-
display: contents;
|
|
62
|
-
}
|
|
63
|
-
div :global([role="toolbar"]) {
|
|
64
|
-
display: flex;
|
|
65
|
-
gap: 8px;
|
|
66
|
-
border-radius: 4px 4px 0 0;
|
|
67
|
-
padding: 8px;
|
|
68
|
-
background-color: var(--ternary-background-color);
|
|
69
|
-
}
|
|
70
|
-
div :global([role="toolbar"]) :global(button) {
|
|
71
|
-
flex: none;
|
|
72
|
-
}
|
|
73
|
-
div :global([role="toolbar"]) + :global(div) {
|
|
74
|
-
width: 100%;
|
|
75
|
-
}
|
|
76
|
-
div :global([role="toolbar"]) + :global(div) :global(textarea) {
|
|
77
|
-
border-radius: 0 0 4px 4px !important;
|
|
78
|
-
}</style>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} MarkdownProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} MarkdownEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} MarkdownSlots */
|
|
4
|
-
export default class Markdown {
|
|
5
|
-
}
|
|
6
|
-
export type MarkdownProps = typeof __propDef.props;
|
|
7
|
-
export type MarkdownEvents = typeof __propDef.events;
|
|
8
|
-
export type MarkdownSlots = typeof __propDef.slots;
|
|
9
|
-
declare const __propDef: {
|
|
10
|
-
props: {
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
value?: (string | undefined);
|
|
13
|
-
};
|
|
14
|
-
events: {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {};
|
|
18
|
-
};
|
|
19
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export function activateGroup(...args: any[]): Promise<Group>;
|
|
2
|
-
/**
|
|
3
|
-
* Implement keyboard and mouse interactions for a grouping composite widget.
|
|
4
|
-
*/
|
|
5
|
-
declare class Group {
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {HTMLElement} parent
|
|
9
|
-
* @todo Check for added elements probably with `MutationObserver`.
|
|
10
|
-
*/
|
|
11
|
-
constructor(parent: HTMLElement);
|
|
12
|
-
parent: HTMLElement;
|
|
13
|
-
role: string;
|
|
14
|
-
grid: boolean;
|
|
15
|
-
multi: boolean;
|
|
16
|
-
id: string;
|
|
17
|
-
parentGroupSelector: string;
|
|
18
|
-
orientation: any;
|
|
19
|
-
childSelectedAttr: any;
|
|
20
|
-
/** @type {string} */
|
|
21
|
-
get selector(): string;
|
|
22
|
-
/** @type {HTMLElement[]} */
|
|
23
|
-
get allMembers(): HTMLElement[];
|
|
24
|
-
/** @type {HTMLElement[]} */
|
|
25
|
-
get activeMembers(): HTMLElement[];
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @param {KeyboardEvent}
|
|
29
|
-
*/
|
|
30
|
-
onClick(event: any): void;
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @param {KeyboardEvent}
|
|
34
|
-
*/
|
|
35
|
-
onKeyDown(event: any): void;
|
|
36
|
-
}
|
|
37
|
-
export {};
|