@geoffcox/sterling-svelte 0.0.22 → 0.0.24
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/Button.svelte +24 -22
- package/Button.svelte.d.ts +8 -0
- package/Checkbox.svelte +54 -29
- package/Checkbox.svelte.d.ts +6 -1
- package/Dropdown.svelte +32 -7
- package/Dropdown.svelte.d.ts +6 -0
- package/Field.svelte +17 -12
- package/Field.svelte.d.ts +6 -0
- package/Input.svelte +78 -53
- package/Input.svelte.d.ts +7 -0
- package/Label.svelte +6 -0
- package/Label.svelte.d.ts +6 -0
- package/Link.svelte +6 -0
- package/Link.svelte.d.ts +6 -0
- package/List.svelte +52 -16
- package/List.svelte.d.ts +6 -0
- package/ListItem.svelte +36 -7
- package/ListItem.svelte.d.ts +6 -0
- package/Menu.svelte +7 -1
- package/Menu.svelte.d.ts +6 -0
- package/MenuBar.svelte +6 -0
- package/MenuBar.svelte.d.ts +6 -0
- package/MenuButton.svelte +6 -0
- package/MenuButton.svelte.d.ts +6 -0
- package/MenuItem.svelte +12 -7
- package/MenuItem.svelte.d.ts +6 -0
- package/MenuItemDisplay.svelte +33 -2
- package/MenuItemDisplay.svelte.d.ts +1 -0
- package/MenuSeparator.svelte +6 -0
- package/MenuSeparator.svelte.d.ts +12 -0
- package/Progress.svelte +6 -13
- package/Progress.svelte.d.ts +6 -1
- package/Radio.svelte +42 -25
- package/Radio.svelte.d.ts +6 -1
- package/Select.svelte +30 -4
- package/Select.svelte.d.ts +6 -0
- package/Slider.svelte +25 -10
- package/Slider.svelte.d.ts +6 -0
- package/Switch.svelte +37 -12
- package/Switch.svelte.d.ts +6 -1
- package/Tab.svelte +31 -3
- package/Tab.svelte.d.ts +6 -0
- package/TabList.svelte +8 -2
- package/TabList.svelte.d.ts +6 -0
- package/TextArea.svelte +81 -49
- package/TextArea.svelte.d.ts +8 -0
- package/Tooltip.svelte +0 -1
- package/Tree.svelte +50 -13
- package/Tree.svelte.d.ts +6 -0
- package/TreeChevron.svelte +6 -0
- package/TreeChevron.svelte.d.ts +6 -0
- package/TreeItem.svelte +14 -8
- package/TreeItem.svelte.d.ts +6 -1
- package/TreeItemDisplay.svelte +42 -11
- package/TreeItemDisplay.svelte.d.ts +6 -0
- package/package.json +3 -3
- package/theme/darkTheme.js +9 -0
- package/theme/lightTheme.js +9 -0
package/Button.svelte
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>export let
|
|
1
|
+
<script>export let disabled = false;
|
|
2
|
+
export let variant = "regular";
|
|
2
3
|
export let shape = "rounded";
|
|
3
4
|
let buttonRef;
|
|
4
5
|
export const click = () => {
|
|
@@ -23,9 +24,17 @@ export const focus = (options) => {
|
|
|
23
24
|
class:circular={shape === 'circular'}
|
|
24
25
|
class:outline={variant === 'outline'}
|
|
25
26
|
class:ghost={variant === 'ghost'}
|
|
27
|
+
{disabled}
|
|
26
28
|
type="button"
|
|
27
29
|
on:blur
|
|
28
30
|
on:click
|
|
31
|
+
on:drag
|
|
32
|
+
on:dragend
|
|
33
|
+
on:dragenter
|
|
34
|
+
on:dragleave
|
|
35
|
+
on:dragover
|
|
36
|
+
on:dragstart
|
|
37
|
+
on:drop
|
|
29
38
|
on:dblclick
|
|
30
39
|
on:focus
|
|
31
40
|
on:focusin
|
|
@@ -115,13 +124,6 @@ export const focus = (options) => {
|
|
|
115
124
|
outline-width: var(--stsv-Common__outline-width);
|
|
116
125
|
}
|
|
117
126
|
|
|
118
|
-
button:disabled {
|
|
119
|
-
background-color: var(--stsv-Common__background-color--disabled);
|
|
120
|
-
border-color: var(--stsv-Common__border-color--disabled);
|
|
121
|
-
color: var(--stsv-Common__color--disabled);
|
|
122
|
-
cursor: not-allowed;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
127
|
button.outline {
|
|
126
128
|
background-color: transparent;
|
|
127
129
|
}
|
|
@@ -134,14 +136,6 @@ export const focus = (options) => {
|
|
|
134
136
|
background-color: var(--stsv-Button__background-color--active);
|
|
135
137
|
}
|
|
136
138
|
|
|
137
|
-
button.outline:disabled {
|
|
138
|
-
background-color: transparent;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
button.outline:disabled:hover {
|
|
142
|
-
border-color: var(--stsv-Common__border-color--disabled);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
139
|
button.ghost {
|
|
146
140
|
background-color: transparent;
|
|
147
141
|
border-color: transparent;
|
|
@@ -161,12 +155,20 @@ export const focus = (options) => {
|
|
|
161
155
|
border-color: var(--stsv-Button__border-color--focus);
|
|
162
156
|
}
|
|
163
157
|
|
|
164
|
-
button
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
158
|
+
button:disabled {
|
|
159
|
+
cursor: not-allowed;
|
|
160
|
+
position: relative;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
button:disabled::after {
|
|
164
|
+
content: '';
|
|
165
|
+
position: absolute;
|
|
166
|
+
left: 0;
|
|
167
|
+
right: 0;
|
|
168
|
+
top: 0;
|
|
169
|
+
bottom: 0;
|
|
170
|
+
background: var(--stsv-Disabled__background);
|
|
171
|
+
pointer-events: none;
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
@media (prefers-reduced-motion) {
|
package/Button.svelte.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
+
disabled?: boolean | undefined;
|
|
5
6
|
variant?: "regular" | "outline" | "ghost" | undefined;
|
|
6
7
|
shape?: "circular" | "rounded" | "square" | undefined;
|
|
7
8
|
click?: (() => void) | undefined;
|
|
@@ -11,6 +12,13 @@ declare const __propDef: {
|
|
|
11
12
|
events: {
|
|
12
13
|
blur: FocusEvent;
|
|
13
14
|
click: MouseEvent;
|
|
15
|
+
drag: DragEvent;
|
|
16
|
+
dragend: DragEvent;
|
|
17
|
+
dragenter: DragEvent;
|
|
18
|
+
dragleave: DragEvent;
|
|
19
|
+
dragover: DragEvent;
|
|
20
|
+
dragstart: DragEvent;
|
|
21
|
+
drop: DragEvent;
|
|
14
22
|
dblclick: MouseEvent;
|
|
15
23
|
focus: FocusEvent;
|
|
16
24
|
focusin: FocusEvent;
|
package/Checkbox.svelte
CHANGED
|
@@ -24,10 +24,11 @@ export const focus = (options) => {
|
|
|
24
24
|
@component
|
|
25
25
|
A styled HTML input type=checkbox element.
|
|
26
26
|
-->
|
|
27
|
-
<div class="sterling-checkbox">
|
|
27
|
+
<div class="sterling-checkbox" class:disabled>
|
|
28
28
|
<div class="container">
|
|
29
29
|
<input
|
|
30
30
|
bind:this={inputRef}
|
|
31
|
+
bind:checked
|
|
31
32
|
{disabled}
|
|
32
33
|
{id}
|
|
33
34
|
type="checkbox"
|
|
@@ -35,6 +36,12 @@ export const focus = (options) => {
|
|
|
35
36
|
on:click
|
|
36
37
|
on:change
|
|
37
38
|
on:dblclick
|
|
39
|
+
on:dragend
|
|
40
|
+
on:dragenter
|
|
41
|
+
on:dragleave
|
|
42
|
+
on:dragover
|
|
43
|
+
on:dragstart
|
|
44
|
+
on:drop
|
|
38
45
|
on:focus
|
|
39
46
|
on:focusin
|
|
40
47
|
on:focusout
|
|
@@ -49,35 +56,30 @@ export const focus = (options) => {
|
|
|
49
56
|
on:mouseover
|
|
50
57
|
on:mouseout
|
|
51
58
|
on:mouseup
|
|
52
|
-
on:toggle
|
|
53
59
|
on:wheel
|
|
54
|
-
bind:checked
|
|
55
60
|
{...$$restProps}
|
|
56
61
|
/>
|
|
57
62
|
<div class="indicator" />
|
|
58
63
|
</div>
|
|
59
64
|
{#if $$slots.default}
|
|
60
|
-
<
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</Label>
|
|
66
|
-
</div>
|
|
65
|
+
<Label for={id}>
|
|
66
|
+
<slot {checked} {disabled} inputId={id} value={$$restProps.value}>
|
|
67
|
+
{$$restProps.value}
|
|
68
|
+
</slot>
|
|
69
|
+
</Label>
|
|
67
70
|
{/if}
|
|
68
71
|
</div>
|
|
69
72
|
|
|
70
73
|
<style>
|
|
71
74
|
.sterling-checkbox {
|
|
72
|
-
|
|
73
|
-
align-
|
|
74
|
-
align-items: stretch;
|
|
75
|
+
align-content: center;
|
|
76
|
+
align-items: center;
|
|
75
77
|
box-sizing: border-box;
|
|
78
|
+
display: inline-flex;
|
|
76
79
|
font: inherit;
|
|
77
|
-
|
|
80
|
+
margin: 0;
|
|
78
81
|
outline: none;
|
|
79
82
|
padding: 0;
|
|
80
|
-
margin: 0;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
/*
|
|
@@ -91,6 +93,7 @@ export const focus = (options) => {
|
|
|
91
93
|
position: relative;
|
|
92
94
|
display: grid;
|
|
93
95
|
align-items: center;
|
|
96
|
+
margin-right: 0.25em;
|
|
94
97
|
}
|
|
95
98
|
|
|
96
99
|
/*
|
|
@@ -130,6 +133,11 @@ export const focus = (options) => {
|
|
|
130
133
|
border-color: var(--stsv-Input__border-color);
|
|
131
134
|
}
|
|
132
135
|
|
|
136
|
+
.sterling-checkbox:hover .indicator {
|
|
137
|
+
background-color: var(--stsv-Input__background-color--hover);
|
|
138
|
+
border-color: var(--stsv-Input__border-color--hover);
|
|
139
|
+
}
|
|
140
|
+
|
|
133
141
|
input:focus-visible + .indicator {
|
|
134
142
|
outline-color: var(--stsv-Common__outline-color);
|
|
135
143
|
outline-offset: var(--stsv-Common__outline-offset);
|
|
@@ -137,15 +145,10 @@ export const focus = (options) => {
|
|
|
137
145
|
outline-width: var(--stsv-Common__outline-width);
|
|
138
146
|
}
|
|
139
147
|
|
|
140
|
-
input:disabled + .indicator {
|
|
141
|
-
background-color: var(--stsv-Common__background-color--disabled);
|
|
142
|
-
border-color: var(--stsv-Common__border-color--disabled);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
148
|
/*
|
|
146
149
|
The checkmark is a rotated L centered in the box.
|
|
147
150
|
*/
|
|
148
|
-
|
|
151
|
+
.indicator::after {
|
|
149
152
|
border-color: var(--stsv-Input__color);
|
|
150
153
|
border-style: solid;
|
|
151
154
|
border-width: 0 3px 3px 0;
|
|
@@ -157,23 +160,45 @@ export const focus = (options) => {
|
|
|
157
160
|
top: 45%;
|
|
158
161
|
transform: translate(-50%, -50%) rotate(45deg);
|
|
159
162
|
transform-origin: center;
|
|
160
|
-
transition: border-color 250ms;
|
|
163
|
+
transition: border-color 250ms, opacity 150ms;
|
|
161
164
|
width: 7px;
|
|
162
|
-
|
|
165
|
+
opacity: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
input:checked + .indicator::after {
|
|
169
|
+
opacity: 1;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.sterling-checkbox:hover input:checked + .indicator::after {
|
|
173
|
+
border-color: var(--stsv-Input__color--hover);
|
|
163
174
|
}
|
|
164
175
|
|
|
165
|
-
|
|
166
|
-
|
|
176
|
+
.sterling-checkbox.disabled,
|
|
177
|
+
.sterling-checkbox.disabled input {
|
|
178
|
+
cursor: not-allowed;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.container::after {
|
|
182
|
+
background: var(--stsv-Disabled__background);
|
|
183
|
+
bottom: 0;
|
|
184
|
+
content: '';
|
|
185
|
+
left: 0;
|
|
186
|
+
opacity: 0;
|
|
187
|
+
position: absolute;
|
|
188
|
+
right: 0;
|
|
189
|
+
top: 0;
|
|
190
|
+
pointer-events: none;
|
|
191
|
+
transition: opacity 250ms;
|
|
167
192
|
}
|
|
168
193
|
|
|
169
|
-
.
|
|
170
|
-
|
|
171
|
-
margin-top: 0.25em;
|
|
194
|
+
.sterling-checkbox.disabled .container::after {
|
|
195
|
+
opacity: 1;
|
|
172
196
|
}
|
|
173
197
|
|
|
174
198
|
@media (prefers-reduced-motion) {
|
|
175
199
|
.indicator,
|
|
176
|
-
|
|
200
|
+
.indicator::after,
|
|
201
|
+
.container::after {
|
|
177
202
|
transition: none;
|
|
178
203
|
}
|
|
179
204
|
}
|
package/Checkbox.svelte.d.ts
CHANGED
|
@@ -14,6 +14,12 @@ declare const __propDef: {
|
|
|
14
14
|
click: MouseEvent;
|
|
15
15
|
change: Event;
|
|
16
16
|
dblclick: MouseEvent;
|
|
17
|
+
dragend: DragEvent;
|
|
18
|
+
dragenter: DragEvent;
|
|
19
|
+
dragleave: DragEvent;
|
|
20
|
+
dragover: DragEvent;
|
|
21
|
+
dragstart: DragEvent;
|
|
22
|
+
drop: DragEvent;
|
|
17
23
|
focus: FocusEvent;
|
|
18
24
|
focusin: FocusEvent;
|
|
19
25
|
focusout: FocusEvent;
|
|
@@ -28,7 +34,6 @@ declare const __propDef: {
|
|
|
28
34
|
mouseover: MouseEvent;
|
|
29
35
|
mouseout: MouseEvent;
|
|
30
36
|
mouseup: MouseEvent;
|
|
31
|
-
toggle: Event;
|
|
32
37
|
wheel: WheelEvent;
|
|
33
38
|
} & {
|
|
34
39
|
[evt: string]: CustomEvent<any>;
|
package/Dropdown.svelte
CHANGED
|
@@ -88,6 +88,12 @@ const onClickOutside = (event) => {
|
|
|
88
88
|
on:copy
|
|
89
89
|
on:cut
|
|
90
90
|
on:dblclick
|
|
91
|
+
on:dragend
|
|
92
|
+
on:dragenter
|
|
93
|
+
on:dragleave
|
|
94
|
+
on:dragover
|
|
95
|
+
on:dragstart
|
|
96
|
+
on:drop
|
|
91
97
|
on:focus
|
|
92
98
|
on:focusin
|
|
93
99
|
on:focusout
|
|
@@ -117,7 +123,7 @@ const onClickOutside = (event) => {
|
|
|
117
123
|
<div
|
|
118
124
|
bind:this={popupRef}
|
|
119
125
|
class="popup"
|
|
120
|
-
class:open
|
|
126
|
+
class:open={open && !disabled}
|
|
121
127
|
id={popupId}
|
|
122
128
|
style="left:{popupPosition.x}px; top:{popupPosition.y}px"
|
|
123
129
|
>
|
|
@@ -140,6 +146,7 @@ const onClickOutside = (event) => {
|
|
|
140
146
|
grid-template-rows: auto;
|
|
141
147
|
outline: none;
|
|
142
148
|
padding: 0;
|
|
149
|
+
position: relative;
|
|
143
150
|
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
144
151
|
}
|
|
145
152
|
|
|
@@ -160,22 +167,39 @@ const onClickOutside = (event) => {
|
|
|
160
167
|
}
|
|
161
168
|
|
|
162
169
|
.sterling-dropdown.disabled {
|
|
163
|
-
background-color: var(--stsv-Common__background-color--disabled);
|
|
164
|
-
border-color: var(--stsv--Common__border-color--disabled);
|
|
165
|
-
color: var(--stsv-Common__color--disabled);
|
|
166
170
|
cursor: not-allowed;
|
|
167
171
|
outline: none;
|
|
168
172
|
}
|
|
169
173
|
|
|
174
|
+
.sterling-dropdown::after {
|
|
175
|
+
background: var(--stsv-Disabled__background);
|
|
176
|
+
bottom: 0;
|
|
177
|
+
content: '';
|
|
178
|
+
left: 0;
|
|
179
|
+
opacity: 0;
|
|
180
|
+
position: absolute;
|
|
181
|
+
right: 0;
|
|
182
|
+
top: 0;
|
|
183
|
+
pointer-events: none;
|
|
184
|
+
transition: opacity 250ms;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.sterling-dropdown.disabled::after {
|
|
188
|
+
opacity: 1;
|
|
189
|
+
}
|
|
190
|
+
|
|
170
191
|
.sterling-dropdown.composed,
|
|
171
192
|
.sterling-dropdown.composed:hover,
|
|
172
|
-
.sterling-dropdown.composed.focus
|
|
173
|
-
.sterling-dropdown.composed.disabled {
|
|
193
|
+
.sterling-dropdown.composed.focus {
|
|
174
194
|
background: none;
|
|
175
195
|
border: none;
|
|
176
196
|
outline: none;
|
|
177
197
|
}
|
|
178
198
|
|
|
199
|
+
.sterling-dropdown.composed.disabled::after {
|
|
200
|
+
opacity: 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
179
203
|
.button {
|
|
180
204
|
grid-column-start: 2;
|
|
181
205
|
grid-row-start: 1;
|
|
@@ -243,7 +267,8 @@ const onClickOutside = (event) => {
|
|
|
243
267
|
}
|
|
244
268
|
|
|
245
269
|
@media (prefers-reduced-motion) {
|
|
246
|
-
.sterling-dropdown
|
|
270
|
+
.sterling-dropdown,
|
|
271
|
+
.sterling-dropdown::after {
|
|
247
272
|
transition: none;
|
|
248
273
|
}
|
|
249
274
|
}
|
package/Dropdown.svelte.d.ts
CHANGED
|
@@ -16,6 +16,12 @@ declare const __propDef: {
|
|
|
16
16
|
copy: ClipboardEvent;
|
|
17
17
|
cut: ClipboardEvent;
|
|
18
18
|
dblclick: MouseEvent;
|
|
19
|
+
dragend: DragEvent;
|
|
20
|
+
dragenter: DragEvent;
|
|
21
|
+
dragleave: DragEvent;
|
|
22
|
+
dragover: DragEvent;
|
|
23
|
+
dragstart: DragEvent;
|
|
24
|
+
drop: DragEvent;
|
|
19
25
|
focus: FocusEvent;
|
|
20
26
|
focusin: FocusEvent;
|
|
21
27
|
focusout: FocusEvent;
|
package/Field.svelte
CHANGED
|
@@ -102,6 +102,12 @@ const onClick = () => {
|
|
|
102
102
|
on:copy
|
|
103
103
|
on:cut
|
|
104
104
|
on:dblclick
|
|
105
|
+
on:dragend
|
|
106
|
+
on:dragenter
|
|
107
|
+
on:dragleave
|
|
108
|
+
on:dragover
|
|
109
|
+
on:dragstart
|
|
110
|
+
on:drop
|
|
105
111
|
on:focus
|
|
106
112
|
on:focusin
|
|
107
113
|
on:focusout
|
|
@@ -174,7 +180,7 @@ const onClick = () => {
|
|
|
174
180
|
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
175
181
|
}
|
|
176
182
|
|
|
177
|
-
.sterling-field:hover {
|
|
183
|
+
.sterling-field:not(.disabled):hover {
|
|
178
184
|
background-color: var(--stsv-Input__background-color--hover);
|
|
179
185
|
border-color: var(--stsv-Input__border-color--hover);
|
|
180
186
|
color: var(--stsv-Input__color--hover);
|
|
@@ -190,9 +196,11 @@ const onClick = () => {
|
|
|
190
196
|
}
|
|
191
197
|
|
|
192
198
|
.sterling-field.disabled {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
199
|
+
cursor: not-allowed;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.sterling-field.disabled * {
|
|
203
|
+
cursor: not-allowed;
|
|
196
204
|
}
|
|
197
205
|
|
|
198
206
|
.label-text {
|
|
@@ -205,15 +213,17 @@ const onClick = () => {
|
|
|
205
213
|
margin: 0;
|
|
206
214
|
}
|
|
207
215
|
|
|
208
|
-
.
|
|
209
|
-
|
|
216
|
+
.content {
|
|
217
|
+
display: grid;
|
|
210
218
|
}
|
|
211
219
|
|
|
212
220
|
.message {
|
|
221
|
+
box-sizing: border-box;
|
|
213
222
|
font-size: 0.8em;
|
|
214
223
|
background-color: var(--stsv-Display__background-color);
|
|
215
224
|
color: var(--stsv-Display__color);
|
|
216
225
|
padding: 0.5em;
|
|
226
|
+
width: 100%;
|
|
217
227
|
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
218
228
|
}
|
|
219
229
|
|
|
@@ -241,12 +251,6 @@ const onClick = () => {
|
|
|
241
251
|
color: var(--stsv-Error__color);
|
|
242
252
|
}
|
|
243
253
|
|
|
244
|
-
.sterling-field.disabled .message {
|
|
245
|
-
background-color: var(--stsv-Common__background-color--disabled);
|
|
246
|
-
border-color: var(--stsv--Common__border-color--disabled);
|
|
247
|
-
color: var(--stsv-Common__color--disabled);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
254
|
.required {
|
|
251
255
|
text-align: center;
|
|
252
256
|
font-weight: bold;
|
|
@@ -265,6 +269,7 @@ const onClick = () => {
|
|
|
265
269
|
|
|
266
270
|
@media (prefers-reduced-motion) {
|
|
267
271
|
.sterling-field,
|
|
272
|
+
.sterling-field::after,
|
|
268
273
|
.message {
|
|
269
274
|
transition: none;
|
|
270
275
|
}
|
package/Field.svelte.d.ts
CHANGED
|
@@ -19,6 +19,12 @@ declare const __propDef: {
|
|
|
19
19
|
copy: ClipboardEvent;
|
|
20
20
|
cut: ClipboardEvent;
|
|
21
21
|
dblclick: MouseEvent;
|
|
22
|
+
dragend: DragEvent;
|
|
23
|
+
dragenter: DragEvent;
|
|
24
|
+
dragleave: DragEvent;
|
|
25
|
+
dragover: DragEvent;
|
|
26
|
+
dragstart: DragEvent;
|
|
27
|
+
drop: DragEvent;
|
|
22
28
|
focus: FocusEvent;
|
|
23
29
|
focusin: FocusEvent;
|
|
24
30
|
focusout: FocusEvent;
|
package/Input.svelte
CHANGED
|
@@ -39,44 +39,59 @@ export const setRangeText = (replacement, start, end, selectionMode) => {
|
|
|
39
39
|
<slot {composed} {disabled} {value} />
|
|
40
40
|
</Label>
|
|
41
41
|
{/if}
|
|
42
|
-
<input
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
42
|
+
<div class="sterling-input" class:composed class:disabled>
|
|
43
|
+
<input
|
|
44
|
+
bind:this={inputRef}
|
|
45
|
+
{disabled}
|
|
46
|
+
{id}
|
|
47
|
+
bind:value
|
|
48
|
+
on:beforeinput
|
|
49
|
+
on:blur
|
|
50
|
+
on:click
|
|
51
|
+
on:change
|
|
52
|
+
on:copy
|
|
53
|
+
on:cut
|
|
54
|
+
on:paste
|
|
55
|
+
on:dblclick
|
|
56
|
+
on:dragend
|
|
57
|
+
on:dragenter
|
|
58
|
+
on:dragleave
|
|
59
|
+
on:dragover
|
|
60
|
+
on:dragstart
|
|
61
|
+
on:drop
|
|
62
|
+
on:focus
|
|
63
|
+
on:focusin
|
|
64
|
+
on:focusout
|
|
65
|
+
on:input
|
|
66
|
+
on:invalid
|
|
67
|
+
on:keydown
|
|
68
|
+
on:keypress
|
|
69
|
+
on:keyup
|
|
70
|
+
on:mousedown
|
|
71
|
+
on:mouseenter
|
|
72
|
+
on:mouseleave
|
|
73
|
+
on:mousemove
|
|
74
|
+
on:mouseover
|
|
75
|
+
on:mouseout
|
|
76
|
+
on:mouseup
|
|
77
|
+
on:select
|
|
78
|
+
on:submit
|
|
79
|
+
on:reset
|
|
80
|
+
on:wheel
|
|
81
|
+
{...$$restProps}
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
77
84
|
|
|
78
85
|
<style>
|
|
79
86
|
.sterling-input {
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
display: inline-block;
|
|
89
|
+
margin: 0;
|
|
90
|
+
padding: 0;
|
|
91
|
+
position: relative;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
input {
|
|
80
95
|
background-color: var(--stsv-Input__background-color);
|
|
81
96
|
border-color: var(--stsv-Input__border-color);
|
|
82
97
|
border-radius: var(--stsv-Input__border-radius);
|
|
@@ -90,13 +105,13 @@ export const setRangeText = (replacement, start, end, selectionMode) => {
|
|
|
90
105
|
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
91
106
|
}
|
|
92
107
|
|
|
93
|
-
.sterling-input:hover {
|
|
108
|
+
.sterling-input:hover input {
|
|
94
109
|
background-color: var(--stsv-Input__background-color--hover);
|
|
95
110
|
border-color: var(--stsv-Input__border-color--hover);
|
|
96
111
|
color: var(--stsv-Input__color--hover);
|
|
97
112
|
}
|
|
98
113
|
|
|
99
|
-
|
|
114
|
+
input:focus {
|
|
100
115
|
background-color: var(--stsv-Input__background-color--focus);
|
|
101
116
|
border-color: var(--stsv-Input__border-color--focus);
|
|
102
117
|
color: var(--stsv-Input__color--focus);
|
|
@@ -106,33 +121,43 @@ export const setRangeText = (replacement, start, end, selectionMode) => {
|
|
|
106
121
|
outline-width: var(--stsv-Common__outline-width);
|
|
107
122
|
}
|
|
108
123
|
|
|
109
|
-
.sterling-input
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
color: var(--stsv-Common__color--disabled);
|
|
113
|
-
cursor: not-allowed;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.sterling-input.composed,
|
|
117
|
-
.sterling-input.composed:hover,
|
|
118
|
-
.sterling-input.composed:focus,
|
|
119
|
-
.sterling-input.composed.disabled {
|
|
124
|
+
.sterling-input.composed input,
|
|
125
|
+
.sterling-input.composed:hover input,
|
|
126
|
+
.sterling-input.composed:focus input {
|
|
120
127
|
background: transparent;
|
|
121
128
|
border: none;
|
|
122
129
|
outline: none;
|
|
123
130
|
}
|
|
124
131
|
|
|
125
|
-
|
|
132
|
+
input::placeholder {
|
|
126
133
|
color: var(--stsv-Display__color--faint);
|
|
127
|
-
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
128
134
|
}
|
|
129
135
|
|
|
130
|
-
.sterling-input
|
|
131
|
-
|
|
136
|
+
.sterling-input.disabled * {
|
|
137
|
+
cursor: not-allowed;
|
|
138
|
+
outline: none;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.sterling-input::after {
|
|
142
|
+
background: var(--stsv-Disabled__background);
|
|
143
|
+
bottom: 0;
|
|
144
|
+
content: '';
|
|
145
|
+
left: 0;
|
|
146
|
+
opacity: 0;
|
|
147
|
+
position: absolute;
|
|
148
|
+
right: 0;
|
|
149
|
+
top: 0;
|
|
150
|
+
pointer-events: none;
|
|
151
|
+
transition: opacity 250ms;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.sterling-input.disabled::after {
|
|
155
|
+
opacity: 1;
|
|
132
156
|
}
|
|
133
157
|
|
|
134
158
|
@media (prefers-reduced-motion) {
|
|
135
|
-
.sterling-input
|
|
159
|
+
.sterling-input::after,
|
|
160
|
+
input {
|
|
136
161
|
transition: none;
|
|
137
162
|
}
|
|
138
163
|
}
|
package/Input.svelte.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ declare const __propDef: {
|
|
|
14
14
|
setRangeText?: ((replacement: string, start?: number, end?: number, selectionMode?: SelectionMode) => void) | undefined;
|
|
15
15
|
};
|
|
16
16
|
events: {
|
|
17
|
+
beforeinput: InputEvent;
|
|
17
18
|
blur: FocusEvent;
|
|
18
19
|
click: MouseEvent;
|
|
19
20
|
change: Event;
|
|
@@ -21,6 +22,12 @@ declare const __propDef: {
|
|
|
21
22
|
cut: ClipboardEvent;
|
|
22
23
|
paste: ClipboardEvent;
|
|
23
24
|
dblclick: MouseEvent;
|
|
25
|
+
dragend: DragEvent;
|
|
26
|
+
dragenter: DragEvent;
|
|
27
|
+
dragleave: DragEvent;
|
|
28
|
+
dragover: DragEvent;
|
|
29
|
+
dragstart: DragEvent;
|
|
30
|
+
drop: DragEvent;
|
|
24
31
|
focus: FocusEvent;
|
|
25
32
|
focusin: FocusEvent;
|
|
26
33
|
focusout: FocusEvent;
|
package/Label.svelte
CHANGED
package/Label.svelte.d.ts
CHANGED
|
@@ -13,6 +13,12 @@ declare const __propDef: {
|
|
|
13
13
|
copy: ClipboardEvent;
|
|
14
14
|
cut: ClipboardEvent;
|
|
15
15
|
dblclick: MouseEvent;
|
|
16
|
+
dragend: DragEvent;
|
|
17
|
+
dragenter: DragEvent;
|
|
18
|
+
dragleave: DragEvent;
|
|
19
|
+
dragover: DragEvent;
|
|
20
|
+
dragstart: DragEvent;
|
|
21
|
+
drop: DragEvent;
|
|
16
22
|
focus: FocusEvent;
|
|
17
23
|
focusin: FocusEvent;
|
|
18
24
|
focusout: FocusEvent;
|