@sveltia/ui 0.6.5 → 0.7.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/button/button.svelte +114 -79
- package/package/components/button/button.svelte.d.ts +45 -18
- package/package/components/button/select-button-group.svelte +51 -30
- package/package/components/button/select-button-group.svelte.d.ts +12 -8
- package/package/components/button/select-button.svelte +50 -2
- package/package/components/button/select-button.svelte.d.ts +16 -0
- package/package/components/calendar/calendar.svelte +6 -4
- package/package/components/checkbox/checkbox-group.svelte +28 -10
- package/package/components/checkbox/checkbox-group.svelte.d.ts +4 -2
- package/package/components/checkbox/checkbox.svelte +115 -71
- package/package/components/checkbox/checkbox.svelte.d.ts +13 -7
- package/package/components/dialog/dialog.svelte +39 -19
- package/package/components/dialog/dialog.svelte.d.ts +0 -4
- package/package/components/disclosure/disclosure.svelte +48 -21
- package/package/components/disclosure/disclosure.svelte.d.ts +19 -0
- package/package/components/divider/divider.svelte +14 -6
- package/package/components/divider/divider.svelte.d.ts +3 -1
- package/package/components/divider/spacer.svelte +17 -5
- package/package/components/divider/spacer.svelte.d.ts +2 -0
- package/package/components/drawer/drawer.svelte +14 -7
- package/package/components/drawer/drawer.svelte.d.ts +2 -2
- package/package/components/listbox/listbox.svelte +55 -20
- package/package/components/listbox/listbox.svelte.d.ts +12 -13
- package/package/components/listbox/option-group.svelte +22 -5
- package/package/components/listbox/option-group.svelte.d.ts +4 -0
- package/package/components/listbox/option.svelte +41 -14
- package/package/components/listbox/option.svelte.d.ts +9 -3
- package/package/components/menu/menu-button.svelte +51 -5
- package/package/components/menu/menu-button.svelte.d.ts +15 -0
- package/package/components/menu/menu-item-checkbox.svelte +41 -2
- package/package/components/menu/menu-item-checkbox.svelte.d.ts +14 -0
- package/package/components/menu/menu-item-group.svelte +26 -9
- package/package/components/menu/menu-item-group.svelte.d.ts +4 -2
- package/package/components/menu/menu-item-radio.svelte +47 -3
- package/package/components/menu/menu-item-radio.svelte.d.ts +14 -0
- package/package/components/menu/menu-item.svelte +48 -21
- package/package/components/menu/menu-item.svelte.d.ts +10 -4
- package/package/components/menu/menu.svelte +17 -9
- package/package/components/menu/menu.svelte.d.ts +8 -8
- package/package/components/radio/radio-group.svelte +50 -11
- package/package/components/radio/radio-group.svelte.d.ts +13 -5
- package/package/components/radio/radio.svelte +76 -45
- package/package/components/radio/radio.svelte.d.ts +11 -5
- package/package/components/select/combobox.svelte +59 -29
- package/package/components/select/combobox.svelte.d.ts +11 -8
- package/package/components/select/select.svelte +31 -6
- package/package/components/select/select.svelte.d.ts +10 -2
- package/package/components/slider/slider.svelte +158 -70
- package/package/components/slider/slider.svelte.d.ts +12 -4
- package/package/components/switch/switch.svelte +71 -29
- package/package/components/switch/switch.svelte.d.ts +11 -3
- package/package/components/table/table-row-header.svelte +1 -0
- package/package/components/table/table-row.svelte +16 -3
- package/package/components/table/table-row.svelte.d.ts +4 -0
- package/package/components/table/table.svelte +2 -1
- package/package/components/table/table.svelte.d.ts +4 -0
- package/package/components/tabs/tab-list.svelte +33 -16
- package/package/components/tabs/tab-list.svelte.d.ts +8 -18
- package/package/components/tabs/tab-panel.svelte +1 -2
- package/package/components/tabs/tab.svelte +25 -3
- package/package/components/tabs/tab.svelte.d.ts +10 -0
- package/package/components/text-field/markdown-editor.svelte +54 -22
- package/package/components/text-field/markdown-editor.svelte.d.ts +11 -1
- package/package/components/text-field/number-input.svelte +66 -15
- package/package/components/text-field/number-input.svelte.d.ts +13 -5
- package/package/components/text-field/password-input.svelte +42 -9
- package/package/components/text-field/password-input.svelte.d.ts +11 -1
- package/package/components/text-field/search-bar.svelte +68 -18
- package/package/components/text-field/search-bar.svelte.d.ts +26 -1
- package/package/components/text-field/text-area.svelte +55 -21
- package/package/components/text-field/text-area.svelte.d.ts +12 -19
- package/package/components/text-field/text-input.svelte +71 -46
- package/package/components/text-field/text-input.svelte.d.ts +34 -14
- package/package/components/toast/toast.svelte +119 -0
- package/package/components/toast/toast.svelte.d.ts +36 -0
- package/package/components/toolbar/toolbar.svelte +33 -10
- package/package/components/toolbar/toolbar.svelte.d.ts +7 -1
- package/package/components/util/app-shell.svelte +133 -68
- package/package/components/util/group.svelte +21 -6
- package/package/components/util/group.svelte.d.ts +4 -2
- package/package/components/util/popup.svelte +62 -10
- package/package/components/util/popup.svelte.d.ts +13 -3
- package/package/components/util/portal.svelte +1 -1
- package/package/components/util/portal.svelte.d.ts +2 -0
- package/package/index.d.ts +2 -0
- package/package/index.js +4 -3
- package/package/locales/en.d.ts +7 -9
- package/package/locales/en.js +7 -9
- package/package/locales/ja.d.ts +7 -9
- package/package/locales/ja.js +7 -9
- package/package/{components/util → services}/events.d.ts +1 -1
- package/package/{components/util → services}/events.js +3 -2
- package/package/services/group.d.ts +1 -0
- package/package/{components/util → services}/group.js +15 -13
- package/package/{components/util → services}/popup.js +10 -1
- package/package/{components/util → services}/util.d.ts +1 -1
- package/package/{components/util → services}/util.js +2 -2
- package/package/styles/core.scss +36 -7
- package/package/styles/variables.scss +98 -61
- package/package.json +40 -32
- package/package/components/util/group.d.ts +0 -1
- /package/package/{components/util → services}/popup.d.ts +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
Toast notification. Use the Popover API if possible to acquire a non-modal top layer.
|
|
4
|
+
@see https://w3c.github.io/aria/#alert
|
|
5
|
+
@see https://developer.chrome.com/blog/introducing-popover-api/
|
|
6
|
+
-->
|
|
7
|
+
<script>
|
|
8
|
+
import { onMount } from 'svelte';
|
|
9
|
+
import Alert from '../alert/alert.svelte';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @type {boolean}
|
|
13
|
+
*/
|
|
14
|
+
export let show = false;
|
|
15
|
+
/**
|
|
16
|
+
* @type {number}
|
|
17
|
+
*/
|
|
18
|
+
export let duration = 5000;
|
|
19
|
+
/**
|
|
20
|
+
* Alert type.
|
|
21
|
+
* @type {'error' | 'warning' | 'info' | 'success'}
|
|
22
|
+
*/
|
|
23
|
+
export let type = 'info';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @type {HTMLElement}
|
|
27
|
+
*/
|
|
28
|
+
let popoverBase;
|
|
29
|
+
/**
|
|
30
|
+
* @type {HTMLElement}
|
|
31
|
+
*/
|
|
32
|
+
let popover;
|
|
33
|
+
/**
|
|
34
|
+
* @type {HTMLElement}
|
|
35
|
+
*/
|
|
36
|
+
let toast;
|
|
37
|
+
|
|
38
|
+
onMount(() => {
|
|
39
|
+
popover = document.querySelector('.sui.toast-base.enabled');
|
|
40
|
+
|
|
41
|
+
if (popover) {
|
|
42
|
+
popoverBase.remove();
|
|
43
|
+
} else {
|
|
44
|
+
popover = popoverBase;
|
|
45
|
+
popover.classList.add('enabled');
|
|
46
|
+
document.body.appendChild(popover);
|
|
47
|
+
|
|
48
|
+
// Move the element to top layer
|
|
49
|
+
if (popover.showPopover) {
|
|
50
|
+
popover.popover = 'manual';
|
|
51
|
+
popover.showPopover();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return () => {
|
|
56
|
+
toast?.remove();
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
$: {
|
|
61
|
+
if (popover && toast) {
|
|
62
|
+
popover.appendChild(toast);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
$: {
|
|
67
|
+
if (show) {
|
|
68
|
+
window.setTimeout(() => {
|
|
69
|
+
show = false;
|
|
70
|
+
}, duration);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<div class="sui toast-base" bind:this={popoverBase} />
|
|
76
|
+
|
|
77
|
+
<div class="sui toast" hidden={!show || undefined} bind:this={toast}>
|
|
78
|
+
<Alert {type}>
|
|
79
|
+
{#if show}
|
|
80
|
+
<slot />
|
|
81
|
+
{/if}
|
|
82
|
+
</Alert>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<style>
|
|
86
|
+
.toast-base {
|
|
87
|
+
position: fixed;
|
|
88
|
+
inset: 0;
|
|
89
|
+
z-index: 99999;
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
justify-content: flex-end;
|
|
93
|
+
align-items: flex-end;
|
|
94
|
+
gap: 8px;
|
|
95
|
+
margin: 0;
|
|
96
|
+
border: 0;
|
|
97
|
+
padding: 16px;
|
|
98
|
+
width: 100vw;
|
|
99
|
+
height: 100vh;
|
|
100
|
+
background-color: transparent;
|
|
101
|
+
pointer-events: none;
|
|
102
|
+
-webkit-user-select: none;
|
|
103
|
+
user-select: none;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.toast {
|
|
107
|
+
position: absolute;
|
|
108
|
+
inset: auto 16px 16px auto;
|
|
109
|
+
box-shadow: 0 8px 16px var(--sui-popup-shadow-color);
|
|
110
|
+
opacity: 1;
|
|
111
|
+
transition-duration: 250ms;
|
|
112
|
+
will-change: opacity;
|
|
113
|
+
|
|
114
|
+
&[hidden] {
|
|
115
|
+
display: block;
|
|
116
|
+
opacity: 0;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ToastProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ToastEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ToastSlots */
|
|
4
|
+
/**
|
|
5
|
+
* Toast notification. Use the Popover API if possible to acquire a non-modal top layer.
|
|
6
|
+
* @see https://w3c.github.io/aria/#alert
|
|
7
|
+
* @see https://developer.chrome.com/blog/introducing-popover-api/
|
|
8
|
+
*/
|
|
9
|
+
export default class Toast extends SvelteComponent<{
|
|
10
|
+
type?: "error" | "warning" | "info" | "success";
|
|
11
|
+
show?: boolean;
|
|
12
|
+
duration?: number;
|
|
13
|
+
}, {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
}, {
|
|
16
|
+
default: {};
|
|
17
|
+
}> {
|
|
18
|
+
}
|
|
19
|
+
export type ToastProps = typeof __propDef.props;
|
|
20
|
+
export type ToastEvents = typeof __propDef.events;
|
|
21
|
+
export type ToastSlots = typeof __propDef.slots;
|
|
22
|
+
import { SvelteComponent } from "svelte";
|
|
23
|
+
declare const __propDef: {
|
|
24
|
+
props: {
|
|
25
|
+
type?: 'error' | 'warning' | 'info' | 'success';
|
|
26
|
+
show?: boolean;
|
|
27
|
+
duration?: number;
|
|
28
|
+
};
|
|
29
|
+
events: {
|
|
30
|
+
[evt: string]: CustomEvent<any>;
|
|
31
|
+
};
|
|
32
|
+
slots: {
|
|
33
|
+
default: {};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
@@ -6,31 +6,49 @@
|
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* The `class` attribute on the wrapper element.
|
|
10
10
|
* @type {string}
|
|
11
11
|
*/
|
|
12
12
|
let className = '';
|
|
13
|
-
|
|
14
13
|
export { className as class };
|
|
15
|
-
|
|
16
14
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @type {
|
|
15
|
+
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
16
|
+
* @type {boolean | undefined}
|
|
17
|
+
*/
|
|
18
|
+
export let hidden = undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to disable the widget. An alias of the `aria-disabled` attribute.
|
|
21
|
+
* @type {boolean}
|
|
22
|
+
*/
|
|
23
|
+
export let disabled = false;
|
|
24
|
+
/**
|
|
25
|
+
* Orientation of the widget. An alias of the `aria-orientation` attribute.
|
|
26
|
+
* @type {'horizontal' | 'vertical'}
|
|
19
27
|
*/
|
|
20
28
|
export let orientation = 'horizontal';
|
|
29
|
+
/**
|
|
30
|
+
* The style variant of the toolbar.
|
|
31
|
+
* @type {'primary' | 'secondary' | undefined}
|
|
32
|
+
*/
|
|
33
|
+
export let variant = undefined;
|
|
21
34
|
</script>
|
|
22
35
|
|
|
23
36
|
<div
|
|
24
|
-
class="sui toolbar {orientation} {className}"
|
|
37
|
+
class="sui toolbar {orientation} {variant ?? ''} {className}"
|
|
25
38
|
role="toolbar"
|
|
39
|
+
hidden={hidden || undefined}
|
|
40
|
+
aria-hidden={hidden}
|
|
41
|
+
aria-disabled={disabled}
|
|
26
42
|
aria-orientation={orientation}
|
|
27
43
|
{...$$restProps}
|
|
28
44
|
>
|
|
29
|
-
<
|
|
45
|
+
<div class="inner" inert={disabled}>
|
|
46
|
+
<slot />
|
|
47
|
+
</div>
|
|
30
48
|
</div>
|
|
31
49
|
|
|
32
50
|
<style>[role=toolbar] {
|
|
33
|
-
--toolbar-size:
|
|
51
|
+
--toolbar-size: var(--sui-secondary-toolbar-size);
|
|
34
52
|
flex: none !important;
|
|
35
53
|
display: flex;
|
|
36
54
|
align-items: center;
|
|
@@ -38,7 +56,8 @@
|
|
|
38
56
|
padding: 8px;
|
|
39
57
|
}
|
|
40
58
|
[role=toolbar].primary {
|
|
41
|
-
--toolbar-size:
|
|
59
|
+
--toolbar-size: var(--sui-primary-toolbar-size);
|
|
60
|
+
border-color: var(--sui-primary-border-color);
|
|
42
61
|
background-color: var(--sui-secondary-background-color);
|
|
43
62
|
}
|
|
44
63
|
[role=toolbar].secondary {
|
|
@@ -57,7 +76,7 @@
|
|
|
57
76
|
}
|
|
58
77
|
[role=toolbar] :global(button[role="button"][aria-pressed="true"]),
|
|
59
78
|
[role=toolbar] :global(button[role="button"][aria-checked="true"]) {
|
|
60
|
-
background-color: var(--sui-
|
|
79
|
+
background-color: var(--sui-selected-background-color);
|
|
61
80
|
}
|
|
62
81
|
[role=toolbar] :global(h2) {
|
|
63
82
|
display: flex;
|
|
@@ -71,4 +90,8 @@
|
|
|
71
90
|
font-size: var(--sui-font-size-small);
|
|
72
91
|
font-weight: normal;
|
|
73
92
|
opacity: 0.8;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.inner {
|
|
96
|
+
display: contents;
|
|
74
97
|
}</style>
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
export default class Toolbar extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
11
|
class?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
variant?: "primary" | "secondary";
|
|
12
15
|
orientation?: "vertical" | "horizontal";
|
|
13
16
|
}, {
|
|
14
17
|
[evt: string]: CustomEvent<any>;
|
|
@@ -24,7 +27,10 @@ declare const __propDef: {
|
|
|
24
27
|
props: {
|
|
25
28
|
[x: string]: any;
|
|
26
29
|
class?: string;
|
|
27
|
-
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
hidden?: boolean | undefined;
|
|
32
|
+
variant?: 'primary' | 'secondary' | undefined;
|
|
33
|
+
orientation?: 'horizontal' | 'vertical';
|
|
28
34
|
};
|
|
29
35
|
events: {
|
|
30
36
|
[evt: string]: CustomEvent<any>;
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
window.setTimeout(() => {
|
|
44
|
-
fontLoader
|
|
44
|
+
fontLoader?.remove();
|
|
45
45
|
}, 1000);
|
|
46
46
|
});
|
|
47
47
|
</script>
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
|
|
60
60
|
<!-- Preload fonts, including the icons -->
|
|
61
61
|
<div class="font-loader" aria-hidden="true" bind:this={fontLoader} style:opacity="0">
|
|
62
|
-
<strong>Sveltia</strong> <em>UI</em>
|
|
62
|
+
Loading <strong>Sveltia</strong> <em>UI</em>
|
|
63
|
+
<span class="material-symbols-outlined">favorite</span>
|
|
63
64
|
</div>
|
|
64
65
|
|
|
65
66
|
<div
|
|
@@ -85,60 +86,66 @@
|
|
|
85
86
|
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block");
|
|
86
87
|
:global(:root[data-theme=light]),
|
|
87
88
|
:global(:host[data-theme=light]) {
|
|
88
|
-
--sui-foreground-color-1-hsl: var(--sui-base-hue) 5%
|
|
89
|
-
--sui-foreground-color-2-hsl: var(--sui-base-hue) 5%
|
|
90
|
-
--sui-foreground-color-3-hsl: var(--sui-base-hue) 5%
|
|
91
|
-
--sui-foreground-color-4-hsl: var(--sui-base-hue) 5%
|
|
89
|
+
--sui-foreground-color-1-hsl: var(--sui-base-hue) 5% 5%;
|
|
90
|
+
--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 25%;
|
|
91
|
+
--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 35%;
|
|
92
|
+
--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 45%;
|
|
93
|
+
--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 65%;
|
|
92
94
|
--sui-background-color-1-hsl: var(--sui-base-hue) 5% 100%;
|
|
93
95
|
--sui-background-color-2-hsl: var(--sui-base-hue) 5% 98%;
|
|
94
|
-
--sui-background-color-3-hsl: var(--sui-base-hue) 5%
|
|
95
|
-
--sui-background-color-4-hsl: var(--sui-base-hue) 5%
|
|
96
|
-
--sui-background-color-5-hsl: var(--sui-base-hue) 5%
|
|
97
|
-
--sui-border-color-1-hsl: var(--sui-base-hue) 5%
|
|
98
|
-
--sui-border-color-2-hsl: var(--sui-base-hue) 5%
|
|
96
|
+
--sui-background-color-3-hsl: var(--sui-base-hue) 5% 96%;
|
|
97
|
+
--sui-background-color-4-hsl: var(--sui-base-hue) 5% 94%;
|
|
98
|
+
--sui-background-color-5-hsl: var(--sui-base-hue) 5% 74%;
|
|
99
|
+
--sui-border-color-1-hsl: var(--sui-base-hue) 5% 65%;
|
|
100
|
+
--sui-border-color-2-hsl: var(--sui-base-hue) 5% 74%;
|
|
101
|
+
--sui-border-color-3-hsl: var(--sui-base-hue) 5% 70%;
|
|
99
102
|
--sui-shadow-color: var(--sui-base-hue) 10% 0%;
|
|
100
|
-
--sui-primary-accent-color: hsl(var(--sui-base-hue) 80%
|
|
101
|
-
--sui-primary-accent-color-
|
|
102
|
-
--sui-primary-accent-color
|
|
103
|
-
--sui-primary-accent-color-
|
|
103
|
+
--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 40%);
|
|
104
|
+
--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 45%);
|
|
105
|
+
--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);
|
|
106
|
+
--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);
|
|
107
|
+
--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);
|
|
104
108
|
--sui-error-color-hue: 0;
|
|
105
109
|
--sui-warning-color-hue: 40;
|
|
106
110
|
--sui-info-color-hue: 210;
|
|
107
111
|
--sui-success-color-hue: 100;
|
|
108
|
-
--sui-alert-foreground-color-saturation:
|
|
109
|
-
--sui-alert-foreground-color-lightness:
|
|
110
|
-
--sui-alert-background-color-saturation:
|
|
111
|
-
--sui-alert-background-color-lightness:
|
|
112
|
+
--sui-alert-foreground-color-saturation: 85%;
|
|
113
|
+
--sui-alert-foreground-color-lightness: 25%;
|
|
114
|
+
--sui-alert-background-color-saturation: 65%;
|
|
115
|
+
--sui-alert-background-color-lightness: 90%;
|
|
112
116
|
--sui-alert-border-color-saturation: 48%;
|
|
113
117
|
--sui-alert-border-color-lightness: 68%;
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
:global(:root[data-theme=dark]),
|
|
117
121
|
:global(:host[data-theme=dark]) {
|
|
118
|
-
--sui-foreground-color-1-hsl: var(--sui-base-hue) 10%
|
|
119
|
-
--sui-foreground-color-2-hsl: var(--sui-base-hue) 10%
|
|
120
|
-
--sui-foreground-color-3-hsl: var(--sui-base-hue) 10%
|
|
121
|
-
--sui-foreground-color-4-hsl: var(--sui-base-hue) 10%
|
|
122
|
+
--sui-foreground-color-1-hsl: var(--sui-base-hue) 10% 95%;
|
|
123
|
+
--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 75%;
|
|
124
|
+
--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 65%;
|
|
125
|
+
--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 55%;
|
|
126
|
+
--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 35%;
|
|
122
127
|
--sui-background-color-1-hsl: var(--sui-base-hue) 10% 10%;
|
|
123
128
|
--sui-background-color-2-hsl: var(--sui-base-hue) 10% 12%;
|
|
124
|
-
--sui-background-color-3-hsl: var(--sui-base-hue) 10%
|
|
125
|
-
--sui-background-color-4-hsl: var(--sui-base-hue) 10%
|
|
126
|
-
--sui-background-color-5-hsl: var(--sui-base-hue) 10%
|
|
127
|
-
--sui-border-color-1-hsl: var(--sui-base-hue) 10%
|
|
128
|
-
--sui-border-color-2-hsl: var(--sui-base-hue) 10%
|
|
129
|
+
--sui-background-color-3-hsl: var(--sui-base-hue) 10% 14%;
|
|
130
|
+
--sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;
|
|
131
|
+
--sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;
|
|
132
|
+
--sui-border-color-1-hsl: var(--sui-base-hue) 10% 35%;
|
|
133
|
+
--sui-border-color-2-hsl: var(--sui-base-hue) 10% 26%;
|
|
134
|
+
--sui-border-color-3-hsl: var(--sui-base-hue) 10% 22%;
|
|
129
135
|
--sui-shadow-color: var(--sui-base-hue) 10% 0%;
|
|
130
|
-
--sui-primary-accent-color: hsl(var(--sui-base-hue) 100%
|
|
131
|
-
--sui-primary-accent-color-
|
|
132
|
-
--sui-primary-accent-color
|
|
133
|
-
--sui-primary-accent-color-
|
|
136
|
+
--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 60%);
|
|
137
|
+
--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 100% 45%);
|
|
138
|
+
--sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);
|
|
139
|
+
--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);
|
|
140
|
+
--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);
|
|
134
141
|
--sui-error-color-hue: 0;
|
|
135
142
|
--sui-warning-color-hue: 40;
|
|
136
143
|
--sui-info-color-hue: 210;
|
|
137
144
|
--sui-success-color-hue: 100;
|
|
138
|
-
--sui-alert-foreground-color-saturation:
|
|
139
|
-
--sui-alert-foreground-color-lightness:
|
|
140
|
-
--sui-alert-background-color-saturation:
|
|
141
|
-
--sui-alert-background-color-lightness:
|
|
145
|
+
--sui-alert-foreground-color-saturation: 85%;
|
|
146
|
+
--sui-alert-foreground-color-lightness: 75%;
|
|
147
|
+
--sui-alert-background-color-saturation: 40%;
|
|
148
|
+
--sui-alert-background-color-lightness: 10%;
|
|
142
149
|
--sui-alert-border-color-saturation: 38%;
|
|
143
150
|
--sui-alert-border-color-lightness: 18%;
|
|
144
151
|
}
|
|
@@ -149,8 +156,8 @@
|
|
|
149
156
|
--sui-highlight-foreground-color: hsl(var(--sui-foreground-color-1-hsl));
|
|
150
157
|
--sui-primary-foreground-color: hsl(var(--sui-foreground-color-2-hsl));
|
|
151
158
|
--sui-secondary-foreground-color: hsl(var(--sui-foreground-color-3-hsl));
|
|
152
|
-
--sui-tertiary-foreground-color: hsl(var(--sui-foreground-color-
|
|
153
|
-
--sui-disabled-foreground-color: hsl(var(--sui-foreground-color-
|
|
159
|
+
--sui-tertiary-foreground-color: hsl(var(--sui-foreground-color-4-hsl));
|
|
160
|
+
--sui-disabled-foreground-color: hsl(var(--sui-foreground-color-5-hsl));
|
|
154
161
|
--sui-error-foreground-color: hsl(
|
|
155
162
|
var(--sui-error-color-hue) var(--sui-alert-foreground-color-saturation)
|
|
156
163
|
var(--sui-alert-foreground-color-lightness)
|
|
@@ -167,7 +174,9 @@
|
|
|
167
174
|
var(--sui-success-color-hue) var(--sui-alert-foreground-color-saturation)
|
|
168
175
|
var(--sui-alert-foreground-color-lightness)
|
|
169
176
|
);
|
|
170
|
-
--sui-
|
|
177
|
+
--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 50%);
|
|
178
|
+
--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl) / 75%);
|
|
179
|
+
--sui-active-background-color: hsl(var(--sui-background-color-5-hsl) / 100%);
|
|
171
180
|
--sui-content-background-color: hsl(var(--sui-background-color-1-hsl));
|
|
172
181
|
--sui-primary-background-color: hsl(var(--sui-background-color-2-hsl));
|
|
173
182
|
--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl) / 80%);
|
|
@@ -192,9 +201,8 @@
|
|
|
192
201
|
var(--sui-success-color-hue) var(--sui-alert-background-color-saturation)
|
|
193
202
|
var(--sui-alert-background-color-lightness)
|
|
194
203
|
);
|
|
195
|
-
--sui-primary-border-color: hsl(var(--sui-border-color-
|
|
196
|
-
--sui-secondary-border-color: hsl(var(--sui-border-color-
|
|
197
|
-
--sui-checkbox-border-color: hsl(var(--sui-foreground-color-4-hsl));
|
|
204
|
+
--sui-primary-border-color: hsl(var(--sui-border-color-2-hsl));
|
|
205
|
+
--sui-secondary-border-color: hsl(var(--sui-border-color-3-hsl));
|
|
198
206
|
--sui-error-border-color: hsl(
|
|
199
207
|
var(--sui-error-color-hue) var(--sui-alert-border-color-saturation)
|
|
200
208
|
var(--sui-alert-border-color-lightness)
|
|
@@ -229,40 +237,50 @@
|
|
|
229
237
|
--sui-line-height-compact: 1.5;
|
|
230
238
|
--sui-line-height-comfortable: 1.75;
|
|
231
239
|
--sui-control-small-border-width: 1px;
|
|
232
|
-
--sui-control-small-border-radius:
|
|
240
|
+
--sui-control-small-border-radius: calc(var(--sui-control-small-height) / 8);
|
|
241
|
+
--sui-control-small-padding: 0 calc((var(--sui-control-small-height) / 5));
|
|
233
242
|
--sui-control-small-height: 24px;
|
|
234
243
|
--sui-control-medium-border-width: 1px;
|
|
235
|
-
--sui-control-medium-border-radius:
|
|
244
|
+
--sui-control-medium-border-radius: calc(var(--sui-control-medium-height) / 8);
|
|
245
|
+
--sui-control-medium-padding: 0 calc((var(--sui-control-medium-height) / 4));
|
|
236
246
|
--sui-control-medium-height: 32px;
|
|
237
247
|
--sui-control-large-border-width: 1px;
|
|
238
|
-
--sui-control-large-border-radius:
|
|
239
|
-
--sui-control-large-
|
|
240
|
-
--sui-control-
|
|
248
|
+
--sui-control-large-border-radius: calc(var(--sui-control-large-height) / 8);
|
|
249
|
+
--sui-control-large-padding: 0 calc((var(--sui-control-large-height) / 3));
|
|
250
|
+
--sui-control-large-height: 48px;
|
|
251
|
+
--sui-control-border-color: hsl(var(--sui-border-color-1-hsl));
|
|
241
252
|
--sui-control-foreground-color: var(--sui-primary-foreground-color);
|
|
242
|
-
--sui-control-background-color: hsl(var(--sui-background-color-
|
|
253
|
+
--sui-control-background-color: hsl(var(--sui-background-color-4-hsl));
|
|
243
254
|
--sui-control-font-family: var(--sui-font-family-default);
|
|
244
255
|
--sui-control-font-size: var(--sui-font-size-default);
|
|
245
256
|
--sui-control-line-height: var(--sui-line-height-default);
|
|
246
257
|
--sui-button-small-border-radius: var(--sui-control-small-border-radius);
|
|
258
|
+
--sui-button-small-padding: var(--sui-control-small-padding);
|
|
247
259
|
--sui-button-small-height: var(--sui-control-small-height);
|
|
248
260
|
--sui-button-medium-border-radius: var(--sui-control-medium-border-radius);
|
|
261
|
+
--sui-button-medium-padding: var(--sui-control-medium-padding);
|
|
249
262
|
--sui-button-medium-height: var(--sui-control-medium-height);
|
|
250
263
|
--sui-button-large-border-radius: var(--sui-control-large-border-radius);
|
|
264
|
+
--sui-button-large-padding: var(--sui-control-large-padding);
|
|
251
265
|
--sui-button-large-height: var(--sui-control-large-height);
|
|
252
|
-
--sui-
|
|
253
|
-
--sui-
|
|
254
|
-
--sui-
|
|
255
|
-
--sui-
|
|
256
|
-
--sui-
|
|
257
|
-
--sui-
|
|
258
|
-
--sui-
|
|
259
|
-
--sui-
|
|
260
|
-
--sui-
|
|
261
|
-
--sui-
|
|
262
|
-
--sui-
|
|
263
|
-
--sui-
|
|
266
|
+
--sui-button-border-color: var(--sui-control-border-color);
|
|
267
|
+
--sui-button-background-color: var(--sui-control-background-color);
|
|
268
|
+
--sui-checkbox-border-radius: var(--sui-control-medium-border-radius);
|
|
269
|
+
--sui-checkbox-height: 20px;
|
|
270
|
+
--sui-checkbox-border-color: var(--sui-control-border-color);
|
|
271
|
+
--sui-checkbox-background-color: var(--sui-control-background-color);
|
|
272
|
+
--sui-option-border-radius: var(--sui-control-medium-border-radius);
|
|
273
|
+
--sui-option-padding: var(--sui-control-medium-padding);
|
|
274
|
+
--sui-option-height: var(--sui-control-medium-height);
|
|
275
|
+
--sui-listbox-border-radius: var(--sui-control-medium-border-radius);
|
|
276
|
+
--sui-listbox-border-color: hsl(var(--sui-border-color-2-hsl));
|
|
277
|
+
--sui-listbox-foreground-color: var(--sui-control-foreground-color);
|
|
278
|
+
--sui-listbox-background-color: hsl(var(--sui-background-color-1-hsl));
|
|
279
|
+
--sui-textbox-border-radius: var(--sui-control-medium-border-radius);
|
|
280
|
+
--sui-textbox-height: var(--sui-control-medium-height);
|
|
281
|
+
--sui-textbox-border-color: hsl(var(--sui-border-color-2-hsl));
|
|
264
282
|
--sui-textbox-foreground-color: var(--sui-control-foreground-color);
|
|
265
|
-
--sui-textbox-background-color: var(--sui-
|
|
283
|
+
--sui-textbox-background-color: hsl(var(--sui-background-color-1-hsl));
|
|
266
284
|
--sui-textbox-font-family: var(--sui-font-family-default);
|
|
267
285
|
--sui-textbox-font-size: var(--sui-font-size-default);
|
|
268
286
|
--sui-textbox-singleline-line-height: var(--sui-line-height-compact);
|
|
@@ -270,13 +288,32 @@
|
|
|
270
288
|
--sui-tab-small-height: var(--sui-control-small-height);
|
|
271
289
|
--sui-tab-medium-height: var(--sui-control-medium-height);
|
|
272
290
|
--sui-tab-large-height: var(--sui-control-large-height);
|
|
291
|
+
--sui-primary-toolbar-size: 48px;
|
|
292
|
+
--sui-secondary-toolbar-size: 40px;
|
|
293
|
+
--sui-primary-row-height: 48px;
|
|
294
|
+
--sui-secondary-row-height: 40px;
|
|
295
|
+
}
|
|
296
|
+
@media (pointer: coarse) {
|
|
297
|
+
:global(:root),
|
|
298
|
+
:global(:host) {
|
|
299
|
+
--sui-control-small-height: 30px;
|
|
300
|
+
--sui-control-medium-height: 40px;
|
|
301
|
+
--sui-control-large-height: 60px;
|
|
302
|
+
--sui-checkbox-height: 24px;
|
|
303
|
+
--sui-primary-toolbar-size: 56px;
|
|
304
|
+
--sui-secondary-toolbar-size: 48px;
|
|
305
|
+
--sui-primary-row-height: 56px;
|
|
306
|
+
--sui-secondary-row-height: 48px;
|
|
307
|
+
}
|
|
273
308
|
}
|
|
274
309
|
|
|
275
310
|
:global(.material-symbols-outlined) {
|
|
276
311
|
font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
|
|
277
312
|
}
|
|
278
313
|
|
|
279
|
-
:global(*)
|
|
314
|
+
:global(*),
|
|
315
|
+
:global(::before),
|
|
316
|
+
:global(::after) {
|
|
280
317
|
overflow-anchor: none;
|
|
281
318
|
scroll-behavior: smooth;
|
|
282
319
|
box-sizing: border-box;
|
|
@@ -289,13 +326,17 @@
|
|
|
289
326
|
vertical-align: top;
|
|
290
327
|
}
|
|
291
328
|
|
|
329
|
+
:global(*) {
|
|
330
|
+
-webkit-tap-highlight-color: transparent;
|
|
331
|
+
}
|
|
332
|
+
|
|
292
333
|
:global(:focus) {
|
|
293
334
|
z-index: 1;
|
|
294
335
|
outline-width: 0;
|
|
295
336
|
}
|
|
296
337
|
|
|
297
338
|
:global(:focus-visible) {
|
|
298
|
-
outline-color: var(--sui-primary-accent-color-
|
|
339
|
+
outline-color: var(--sui-primary-accent-color-light);
|
|
299
340
|
}
|
|
300
341
|
|
|
301
342
|
:global(h1),
|
|
@@ -313,7 +354,7 @@
|
|
|
313
354
|
}
|
|
314
355
|
|
|
315
356
|
:global(a) {
|
|
316
|
-
color: var(--sui-primary-accent-color-
|
|
357
|
+
color: var(--sui-primary-accent-color-text);
|
|
317
358
|
text-decoration: none;
|
|
318
359
|
}
|
|
319
360
|
|
|
@@ -340,10 +381,10 @@
|
|
|
340
381
|
margin: 0;
|
|
341
382
|
border: 0;
|
|
342
383
|
padding: 0;
|
|
343
|
-
width:
|
|
344
|
-
max-width:
|
|
345
|
-
height:
|
|
346
|
-
max-height:
|
|
384
|
+
width: 100vw;
|
|
385
|
+
max-width: 100vw;
|
|
386
|
+
height: 100vh;
|
|
387
|
+
max-height: 100vh;
|
|
347
388
|
color: var(--sui-primary-foreground-color);
|
|
348
389
|
background: transparent;
|
|
349
390
|
-webkit-user-select: none;
|
|
@@ -355,6 +396,30 @@
|
|
|
355
396
|
background: transparent;
|
|
356
397
|
}
|
|
357
398
|
|
|
399
|
+
:global(.disabled),
|
|
400
|
+
:global([aria-disabled=true]),
|
|
401
|
+
:global([inert]) {
|
|
402
|
+
cursor: default;
|
|
403
|
+
pointer-events: none;
|
|
404
|
+
-webkit-user-select: none;
|
|
405
|
+
user-select: none;
|
|
406
|
+
filter: grayscale(1) opacity(0.35);
|
|
407
|
+
}
|
|
408
|
+
:global(.disabled) :global(*),
|
|
409
|
+
:global([aria-disabled=true]) :global(*),
|
|
410
|
+
:global([inert]) :global(*) {
|
|
411
|
+
filter: grayscale(0) opacity(1);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
:global(.disabled) :global(*),
|
|
415
|
+
:global([aria-disabled=true]) :global(*),
|
|
416
|
+
:global([inert]) :global(*) {
|
|
417
|
+
cursor: default;
|
|
418
|
+
pointer-events: none;
|
|
419
|
+
-webkit-user-select: none;
|
|
420
|
+
user-select: none;
|
|
421
|
+
}
|
|
422
|
+
|
|
358
423
|
:global(.font-loader) {
|
|
359
424
|
position: absolute;
|
|
360
425
|
left: -99999px;
|
|
@@ -5,21 +5,36 @@
|
|
|
5
5
|
-->
|
|
6
6
|
<script>
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* The `class` attribute on the wrapper element.
|
|
9
9
|
* @type {string}
|
|
10
10
|
*/
|
|
11
11
|
let className = '';
|
|
12
|
-
|
|
13
12
|
export { className as class };
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
15
|
+
* @type {boolean | undefined}
|
|
16
|
+
*/
|
|
17
|
+
export let hidden = undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to disable the widget. An alias of the `aria-disabled` attribute.
|
|
20
|
+
* @type {boolean}
|
|
21
|
+
*/
|
|
22
|
+
export let disabled = false;
|
|
16
23
|
</script>
|
|
17
24
|
|
|
18
25
|
<div
|
|
19
26
|
class="sui group {className}"
|
|
20
27
|
role="group"
|
|
21
|
-
|
|
28
|
+
hidden={hidden || undefined}
|
|
29
|
+
aria-hidden={hidden}
|
|
30
|
+
aria-disabled={disabled}
|
|
22
31
|
{...$$restProps}
|
|
23
32
|
>
|
|
24
|
-
<
|
|
33
|
+
<div class="inner" inert={disabled}>
|
|
34
|
+
<slot />
|
|
35
|
+
</div>
|
|
25
36
|
</div>
|
|
37
|
+
|
|
38
|
+
<style>.inner {
|
|
39
|
+
display: contents;
|
|
40
|
+
}</style>
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
export default class Group extends SvelteComponent<{
|
|
9
9
|
[x: string]: any;
|
|
10
10
|
class?: string;
|
|
11
|
-
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
hidden?: boolean;
|
|
12
13
|
}, {
|
|
13
14
|
[evt: string]: CustomEvent<any>;
|
|
14
15
|
}, {
|
|
@@ -23,7 +24,8 @@ declare const __propDef: {
|
|
|
23
24
|
props: {
|
|
24
25
|
[x: string]: any;
|
|
25
26
|
class?: string;
|
|
26
|
-
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
hidden?: boolean | undefined;
|
|
27
29
|
};
|
|
28
30
|
events: {
|
|
29
31
|
[evt: string]: CustomEvent<any>;
|