@geoffcox/sterling-svelte 0.0.7 → 0.0.9
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/buttons/Button.svelte +152 -145
- package/buttons/Button.svelte.d.ts +1 -1
- package/buttons/{types.d.ts → Button.types.d.ts} +0 -0
- package/buttons/{types.js → Button.types.js} +0 -0
- package/display/Progress.svelte +182 -0
- package/display/Progress.svelte.d.ts +42 -0
- package/display/Progress.types.d.ts +1 -0
- package/display/Progress.types.js +1 -0
- package/index.d.ts +7 -3
- package/index.js +7 -3
- package/inputs/Checkbox.svelte +8 -0
- package/inputs/Input.svelte +9 -1
- package/inputs/Radio.svelte +8 -0
- package/inputs/Select.svelte +7 -10
- package/inputs/Slider.svelte +221 -134
- package/inputs/Slider.svelte.d.ts +3 -1
- package/lists/List.svelte +9 -0
- package/package.json +7 -2
- package/surfaces/CloseX.svelte +5 -0
- package/surfaces/CloseX.svelte.d.ts +23 -0
- package/surfaces/Dialog.svelte +241 -0
- package/surfaces/Dialog.svelte.d.ts +34 -0
- package/theme/colors.js +2 -0
- package/theme/darkTheme.js +3 -3
- package/theme/lightTheme.js +2 -2
package/buttons/Button.svelte
CHANGED
|
@@ -7,153 +7,160 @@ export let shape = "rounded";
|
|
|
7
7
|
A styled HTML button element.
|
|
8
8
|
-->
|
|
9
9
|
<button
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
10
|
+
class="sterling-button"
|
|
11
|
+
class:square={shape === 'square'}
|
|
12
|
+
class:circular={shape === 'circular'}
|
|
13
|
+
class:outline={variant === 'outline'}
|
|
14
|
+
class:ghost={variant === 'ghost'}
|
|
15
|
+
type="button"
|
|
16
|
+
on:blur
|
|
17
|
+
on:click
|
|
18
|
+
on:dblclick
|
|
19
|
+
on:focus
|
|
20
|
+
on:focusin
|
|
21
|
+
on:focusout
|
|
22
|
+
on:keydown
|
|
23
|
+
on:keypress
|
|
24
|
+
on:keyup
|
|
25
|
+
on:mousedown
|
|
26
|
+
on:mouseenter
|
|
27
|
+
on:mouseleave
|
|
28
|
+
on:mousemove
|
|
29
|
+
on:mouseover
|
|
30
|
+
on:mouseout
|
|
31
|
+
on:mouseup
|
|
32
|
+
on:pointercancel
|
|
33
|
+
on:pointerdown
|
|
34
|
+
on:pointerenter
|
|
35
|
+
on:pointerleave
|
|
36
|
+
on:pointermove
|
|
37
|
+
on:pointerover
|
|
38
|
+
on:pointerout
|
|
39
|
+
on:pointerup
|
|
40
|
+
on:wheel
|
|
41
|
+
{...$$restProps}
|
|
41
42
|
>
|
|
42
|
-
|
|
43
|
+
<slot />
|
|
43
44
|
</button>
|
|
44
45
|
|
|
45
46
|
<style>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
47
|
+
button {
|
|
48
|
+
align-content: center;
|
|
49
|
+
align-items: center;
|
|
50
|
+
background-color: var(--Button__background-color);
|
|
51
|
+
border-color: var(--Button__border-color);
|
|
52
|
+
border-radius: var(--Button__border-radius);
|
|
53
|
+
border-style: var(--Button__border-style);
|
|
54
|
+
border-width: var(--Button__border-width);
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
color: var(--Button__color);
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
flex-direction: row;
|
|
60
|
+
font: inherit;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
justify-items: center;
|
|
63
|
+
column-gap: 0.25em;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
padding: 0.5em 1em;
|
|
66
|
+
text-decoration: none;
|
|
67
|
+
text-overflow: ellipsis;
|
|
68
|
+
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
user-select: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
button.vertical {
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
row-gap: 0.15em;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
button.circular {
|
|
79
|
+
border-radius: 10000px;
|
|
80
|
+
padding: 0.5em;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
button.square {
|
|
84
|
+
border-radius: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
button:hover {
|
|
88
|
+
background-color: var(--Button__background-color--hover);
|
|
89
|
+
border-color: var(--Button__border-color--hover);
|
|
90
|
+
color: var(--Button__color--hover);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
button:active {
|
|
94
|
+
background-color: var(--Button__background-color--active);
|
|
95
|
+
border-color: var(--Button__border-color--active);
|
|
96
|
+
color: var(--Button__color--active);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
button:focus-visible {
|
|
100
|
+
border-color: var(--Button__border-color--focus);
|
|
101
|
+
outline-color: var(--Common__outline-color);
|
|
102
|
+
outline-offset: var(--Common__outline-offset);
|
|
103
|
+
outline-style: var(--Common__outline-style);
|
|
104
|
+
outline-width: var(--Common__outline-width);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
button:disabled {
|
|
108
|
+
background-color: var(--Button__background-color--disabled);
|
|
109
|
+
border-color: var(--Button__border-color--disabled);
|
|
110
|
+
color: var(--Button__color--disabled);
|
|
111
|
+
cursor: not-allowed;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
button.outline {
|
|
115
|
+
background-color: transparent;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
button.outline:hover {
|
|
119
|
+
background-color: var(--Button__background-color--hover);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
button.outline:active {
|
|
123
|
+
background-color: var(--Button__background-color--active);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
button.outline:disabled {
|
|
127
|
+
background-color: transparent;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
button.outline:disabled:hover {
|
|
131
|
+
border-color: var(--Button__border-color--disabled);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
button.ghost {
|
|
135
|
+
background-color: transparent;
|
|
136
|
+
border-color: transparent;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
button.ghost:hover {
|
|
140
|
+
background-color: var(--Button__background-color--hover);
|
|
141
|
+
border-color: transparent;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
button.ghost:active {
|
|
145
|
+
background-color: var(--Button__background-color--active);
|
|
146
|
+
border-color: transparent;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
button.ghost:focus-visible {
|
|
150
|
+
border-color: var(--Button__border-color--focus);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
button.ghost:disabled {
|
|
154
|
+
border-color: transparent;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
button.ghost:disabled:hover {
|
|
158
|
+
background-color: var(--Button__background-color--disabled);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@media (prefers-reduced-motion) {
|
|
162
|
+
button {
|
|
163
|
+
transition: none;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
159
166
|
</style>
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
<script>export let value = 0;
|
|
2
|
+
export let max = 100;
|
|
3
|
+
export let percent = 0;
|
|
4
|
+
export let vertical = false;
|
|
5
|
+
export let colorful = "none";
|
|
6
|
+
export let disabled = false;
|
|
7
|
+
let clientHeight;
|
|
8
|
+
let clientWidth;
|
|
9
|
+
$:
|
|
10
|
+
clampMax = Math.max(1, max);
|
|
11
|
+
$:
|
|
12
|
+
clampValue = Math.max(0, Math.min(value, clampMax));
|
|
13
|
+
$:
|
|
14
|
+
ratio = clampValue / clampMax;
|
|
15
|
+
$: {
|
|
16
|
+
percent = Math.round(ratio * 100);
|
|
17
|
+
}
|
|
18
|
+
$:
|
|
19
|
+
percentHeight = clientHeight * ratio;
|
|
20
|
+
$:
|
|
21
|
+
percentWidth = clientWidth * ratio;
|
|
22
|
+
$:
|
|
23
|
+
indicatorStyle = vertical ? `height: ${percentHeight}px` : `width: ${percentWidth}px`;
|
|
24
|
+
$:
|
|
25
|
+
indicatorColor = colorful === "auto" ? percent === 100 ? "success" : "progress" : colorful;
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<!--
|
|
29
|
+
@component
|
|
30
|
+
An indicator of a value between 0 and a maximum value.ß
|
|
31
|
+
Does not use the HTML progress element.
|
|
32
|
+
-->
|
|
33
|
+
<!-- svelte-ignore a11y-label-has-associated-control -->
|
|
34
|
+
|
|
35
|
+
<div
|
|
36
|
+
class="sterling-progress"
|
|
37
|
+
class:disabled
|
|
38
|
+
class:vertical
|
|
39
|
+
on:click
|
|
40
|
+
on:dblclick
|
|
41
|
+
on:focus
|
|
42
|
+
on:blur
|
|
43
|
+
on:mousedown
|
|
44
|
+
on:mouseenter
|
|
45
|
+
on:mouseleave
|
|
46
|
+
on:mousemove
|
|
47
|
+
on:mouseover
|
|
48
|
+
on:mouseout
|
|
49
|
+
on:mouseup
|
|
50
|
+
on:wheel
|
|
51
|
+
{...$$restProps}
|
|
52
|
+
>
|
|
53
|
+
{#if $$slots.label}
|
|
54
|
+
<div class="label-content" class:disabled>
|
|
55
|
+
<slot name="label" />
|
|
56
|
+
</div>
|
|
57
|
+
{/if}
|
|
58
|
+
<div class="progress-bar">
|
|
59
|
+
<div class="container" bind:clientWidth bind:clientHeight>
|
|
60
|
+
<div
|
|
61
|
+
class="indicator"
|
|
62
|
+
class:progress={indicatorColor === 'progress'}
|
|
63
|
+
class:success={indicatorColor === 'success'}
|
|
64
|
+
class:warning={indicatorColor === 'warning'}
|
|
65
|
+
class:error={indicatorColor === 'error'}
|
|
66
|
+
style={indicatorStyle}
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<style>
|
|
73
|
+
.sterling-progress {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
align-content: flex-start;
|
|
77
|
+
align-items: flex-start;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.label-content {
|
|
81
|
+
font-size: 0.7em;
|
|
82
|
+
margin: 0.5em 0;
|
|
83
|
+
color: var(--Display__color--subtle);
|
|
84
|
+
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.progress-bar {
|
|
88
|
+
display: block;
|
|
89
|
+
background: var(--Common__background-color);
|
|
90
|
+
box-sizing: border-box;
|
|
91
|
+
height: 1em;
|
|
92
|
+
padding: 0.2em;
|
|
93
|
+
border-width: var(--Common__border-width);
|
|
94
|
+
border-style: var(--Common__border-style);
|
|
95
|
+
border-color: var(--Common__border-color);
|
|
96
|
+
border-radius: var(--Common__border-radius);
|
|
97
|
+
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.container {
|
|
101
|
+
display: flex;
|
|
102
|
+
justify-content: flex-start;
|
|
103
|
+
width: 100%;
|
|
104
|
+
height: 100%;
|
|
105
|
+
min-width: 100px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.indicator {
|
|
109
|
+
background-color: var(--Display__color);
|
|
110
|
+
box-sizing: border-box;
|
|
111
|
+
height: 100%;
|
|
112
|
+
min-height: 1px;
|
|
113
|
+
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* ----- Vertical ----- */
|
|
117
|
+
|
|
118
|
+
.sterling-progress.vertical {
|
|
119
|
+
align-items: center;
|
|
120
|
+
align-content: center;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.sterling-progress.vertical .progress-bar {
|
|
124
|
+
height: unset;
|
|
125
|
+
width: 1em;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.sterling-progress.vertical .container {
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
justify-content: flex-end;
|
|
131
|
+
min-width: unset;
|
|
132
|
+
min-height: 100px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.sterling-progress.vertical .indicator {
|
|
136
|
+
height: unset;
|
|
137
|
+
min-height: unset;
|
|
138
|
+
min-width: 1px;
|
|
139
|
+
width: 100%;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* ----- Colorful ----- */
|
|
143
|
+
|
|
144
|
+
.indicator.progress {
|
|
145
|
+
background-color: var(--Display__color--progress);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.indicator.success {
|
|
149
|
+
background-color: var(--Display__color--success);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.indicator.warning {
|
|
153
|
+
background-color: var(--Display__color--warning);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.indicator.error {
|
|
157
|
+
background-color: var(--Display__color--error);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* ----- Disabled ----- */
|
|
161
|
+
|
|
162
|
+
.label-content.disabled {
|
|
163
|
+
color: var(--Display__color--disabled);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.sterling-progress.disabled .progress-bar {
|
|
167
|
+
background: var(--Common__background-color--disabled);
|
|
168
|
+
border-color: var(--Common__border-color--disabled);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.sterling-progress.disabled .indicator {
|
|
172
|
+
background-color: var(--Display__color--disabled);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@media (prefers-reduced-motion) {
|
|
176
|
+
.progress-bar,
|
|
177
|
+
.indicator,
|
|
178
|
+
.label-content {
|
|
179
|
+
transition: none;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { ProgressColorful } from './Progress.types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
value?: number | undefined;
|
|
7
|
+
max?: number | undefined;
|
|
8
|
+
percent?: number | undefined;
|
|
9
|
+
vertical?: boolean | undefined;
|
|
10
|
+
colorful?: ProgressColorful | undefined;
|
|
11
|
+
disabled?: boolean | undefined;
|
|
12
|
+
};
|
|
13
|
+
events: {
|
|
14
|
+
click: MouseEvent;
|
|
15
|
+
dblclick: MouseEvent;
|
|
16
|
+
focus: FocusEvent;
|
|
17
|
+
blur: FocusEvent;
|
|
18
|
+
mousedown: MouseEvent;
|
|
19
|
+
mouseenter: MouseEvent;
|
|
20
|
+
mouseleave: MouseEvent;
|
|
21
|
+
mousemove: MouseEvent;
|
|
22
|
+
mouseover: MouseEvent;
|
|
23
|
+
mouseout: MouseEvent;
|
|
24
|
+
mouseup: MouseEvent;
|
|
25
|
+
wheel: WheelEvent;
|
|
26
|
+
} & {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
};
|
|
29
|
+
slots: {
|
|
30
|
+
label: {};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type ProgressProps = typeof __propDef.props;
|
|
34
|
+
export type ProgressEvents = typeof __propDef.events;
|
|
35
|
+
export type ProgressSlots = typeof __propDef.slots;
|
|
36
|
+
/**
|
|
37
|
+
* An indicator of a value between 0 and a maximum value.ß
|
|
38
|
+
* Does not use the HTML progress element.
|
|
39
|
+
*/
|
|
40
|
+
export default class Progress extends SvelteComponentTyped<ProgressProps, ProgressEvents, ProgressSlots> {
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ProgressColorful = 'none' | 'auto' | 'progress' | 'success' | 'warning' | 'error';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -6,12 +6,16 @@ export { darkTheme } from './theme/darkTheme';
|
|
|
6
6
|
export { lightTheme } from './theme/lightTheme';
|
|
7
7
|
export { neutrals } from './theme/colors';
|
|
8
8
|
export { toggleDarkTheme } from './theme/toggleDarkTheme';
|
|
9
|
-
export { type ButtonVariant, type ButtonShape } from './buttons/types';
|
|
9
|
+
export { type ButtonVariant, type ButtonShape } from './buttons/Button.types';
|
|
10
|
+
export { type ProgressColorful } from './display/Progress.types';
|
|
10
11
|
export { clickOutside } from './clickOutside';
|
|
11
12
|
import Button from './buttons/Button.svelte';
|
|
13
|
+
import Checkbox from './inputs/Checkbox.svelte';
|
|
14
|
+
import Dialog from './surfaces/Dialog.svelte';
|
|
12
15
|
import Input from './inputs/Input.svelte';
|
|
13
16
|
import List from './lists/List.svelte';
|
|
14
|
-
import
|
|
17
|
+
import Progress from './display/Progress.svelte';
|
|
15
18
|
import Radio from './inputs/Radio.svelte';
|
|
16
19
|
import Select from './inputs/Select.svelte';
|
|
17
|
-
|
|
20
|
+
import Slider from './inputs/Slider.svelte';
|
|
21
|
+
export { Button, Checkbox, Dialog, Input, List, Progress, Radio, Select, Slider };
|
package/index.js
CHANGED
|
@@ -6,12 +6,16 @@ export { darkTheme } from './theme/darkTheme';
|
|
|
6
6
|
export { lightTheme } from './theme/lightTheme';
|
|
7
7
|
export { neutrals } from './theme/colors';
|
|
8
8
|
export { toggleDarkTheme } from './theme/toggleDarkTheme';
|
|
9
|
-
export {} from './buttons/types';
|
|
9
|
+
export {} from './buttons/Button.types';
|
|
10
|
+
export {} from './display/Progress.types';
|
|
10
11
|
export { clickOutside } from './clickOutside';
|
|
11
12
|
import Button from './buttons/Button.svelte';
|
|
13
|
+
import Checkbox from './inputs/Checkbox.svelte';
|
|
14
|
+
import Dialog from './surfaces/Dialog.svelte';
|
|
12
15
|
import Input from './inputs/Input.svelte';
|
|
13
16
|
import List from './lists/List.svelte';
|
|
14
|
-
import
|
|
17
|
+
import Progress from './display/Progress.svelte';
|
|
15
18
|
import Radio from './inputs/Radio.svelte';
|
|
16
19
|
import Select from './inputs/Select.svelte';
|
|
17
|
-
|
|
20
|
+
import Slider from './inputs/Slider.svelte';
|
|
21
|
+
export { Button, Checkbox, Dialog, Input, List, Progress, Radio, Select, Slider };
|
package/inputs/Checkbox.svelte
CHANGED
|
@@ -148,4 +148,12 @@ export let disabled = false;
|
|
|
148
148
|
.label-content.disabled {
|
|
149
149
|
color: var(--Input__color--disabled);
|
|
150
150
|
}
|
|
151
|
+
|
|
152
|
+
@media (prefers-reduced-motion) {
|
|
153
|
+
.indicator,
|
|
154
|
+
input:checked + .indicator::after,
|
|
155
|
+
.label-content {
|
|
156
|
+
transition: none;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
151
159
|
</style>
|
package/inputs/Input.svelte
CHANGED
|
@@ -138,7 +138,6 @@ export let disabled = false;
|
|
|
138
138
|
|
|
139
139
|
.sterling-input {
|
|
140
140
|
padding: 0.5em 0.5em;
|
|
141
|
-
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
.sterling-input.labeled,
|
|
@@ -158,4 +157,13 @@ export let disabled = false;
|
|
|
158
157
|
.sterling-input:disabled::placeholder {
|
|
159
158
|
color: var(--Display__color--disabled);
|
|
160
159
|
}
|
|
160
|
+
|
|
161
|
+
@media (prefers-reduced-motion) {
|
|
162
|
+
.sterling-input-label,
|
|
163
|
+
.sterling-input,
|
|
164
|
+
.label-content,
|
|
165
|
+
.sterling-input::placeholder {
|
|
166
|
+
transition: none;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
161
169
|
</style>
|
package/inputs/Radio.svelte
CHANGED
package/inputs/Select.svelte
CHANGED
|
@@ -36,7 +36,6 @@ $: {
|
|
|
36
36
|
raiseItemSelected(selectedIndex);
|
|
37
37
|
}
|
|
38
38
|
$: {
|
|
39
|
-
console.log("raise pendingSelectedIndex changed");
|
|
40
39
|
raiseItemSelectPending(pendingSelectedIndex);
|
|
41
40
|
}
|
|
42
41
|
$: {
|
|
@@ -240,15 +239,6 @@ A single item that can be selected from a popup list of items.
|
|
|
240
239
|
</div>
|
|
241
240
|
|
|
242
241
|
<style>
|
|
243
|
-
/*
|
|
244
|
-
sterling-select
|
|
245
|
-
sterling-select-label
|
|
246
|
-
label-content
|
|
247
|
-
input
|
|
248
|
-
value
|
|
249
|
-
button
|
|
250
|
-
(popup)
|
|
251
|
-
*/
|
|
252
242
|
.sterling-select {
|
|
253
243
|
background-color: var(--Input__background-color);
|
|
254
244
|
border-color: var(--Input__border-color);
|
|
@@ -363,4 +353,11 @@ A single item that can be selected from a popup list of items.
|
|
|
363
353
|
.popup-content {
|
|
364
354
|
max-height: 15em;
|
|
365
355
|
}
|
|
356
|
+
|
|
357
|
+
@media (prefers-reduced-motion) {
|
|
358
|
+
.sterling-select,
|
|
359
|
+
.label-content {
|
|
360
|
+
transition: none;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
366
363
|
</style>
|