@geoffcox/sterling-svelte 1.0.9 → 1.0.11
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/dist/Callout.svelte +1 -1
- package/dist/ColorPicker.svelte +27 -10
- package/dist/ColorPicker.svelte.d.ts +2 -0
- package/dist/Dialog.svelte +8 -11
- package/dist/HslColorSliders.svelte +3 -3
- package/dist/List.svelte +0 -1
- package/dist/MenuButton.svelte +4 -12
- package/dist/MenuButton.svelte.d.ts +2 -2
- package/dist/MenuItem.types.d.ts +1 -1
- package/dist/Popover.svelte +1 -1
- package/dist/TextArea.svelte +20 -2
- package/dist/Tooltip.svelte +1 -1
- package/dist/css/Input.base.css +5 -2
- package/dist/css/Link.base.css +7 -5
- package/dist/css/Link.css +4 -0
- package/dist/css/Link.text-underline.css +8 -0
- package/dist/css/Link.text-underline.ghost.css +13 -0
- package/dist/css/Link.undecorated.colorful.css +2 -0
- package/dist/css/Link.undecorated.css +2 -0
- package/dist/css/Link.undecorated.ghost.css +8 -0
- package/dist/css/Link.undecorated.underline.css +8 -0
- package/dist/css/MenuItemDisplay.base.css +5 -1
- package/dist/css/Slider.base.css +16 -6
- package/dist/css/Switch.base.css +15 -2
- package/dist/css/Switch.colorful.css +6 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/package.json +108 -0
- package/package.json +5 -6
package/dist/Callout.svelte
CHANGED
|
@@ -14,7 +14,7 @@ export let mainAxisOffset = 0;
|
|
|
14
14
|
/** When true, the callout is open and visible. */
|
|
15
15
|
export let open = false;
|
|
16
16
|
/** How the callout should be positioned relative to the reference element. */
|
|
17
|
-
export let placement = '
|
|
17
|
+
export let placement = 'top-start';
|
|
18
18
|
/** The host container for the callout. */
|
|
19
19
|
export let portalHost = undefined;
|
|
20
20
|
/** The reference to the element anchoring the position of the callout. */
|
package/dist/ColorPicker.svelte
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import { tick } from 'svelte';
|
|
2
|
-
import
|
|
2
|
+
import { TinyColor } from '@ctrl/tinycolor';
|
|
3
3
|
import Dropdown from './Dropdown.svelte';
|
|
4
4
|
import Input from './Input.svelte';
|
|
5
5
|
import Tab from './Tab.svelte';
|
|
@@ -22,6 +22,10 @@ export let disabled = false;
|
|
|
22
22
|
export let open = false;
|
|
23
23
|
/** Additional class names to apply. */
|
|
24
24
|
export let variant = '';
|
|
25
|
+
/** Additional class names to apply to the value input. */
|
|
26
|
+
export let valueVariant = '';
|
|
27
|
+
/** Additional class names to apply to sliders. */
|
|
28
|
+
export let sliderVariant = '';
|
|
25
29
|
// ----- State ----- //
|
|
26
30
|
let hue = 0;
|
|
27
31
|
let saturation = 0;
|
|
@@ -41,7 +45,7 @@ const updateFromRgb = async () => {
|
|
|
41
45
|
if (!updating && (colorFormat === 'hex' || colorFormat === 'rgb')) {
|
|
42
46
|
updating = true;
|
|
43
47
|
const newAlpha = colorFormat === 'hex' ? hexAlpha / 255 : alpha;
|
|
44
|
-
const color =
|
|
48
|
+
const color = new TinyColor({ r: red, g: green, b: blue, a: newAlpha });
|
|
45
49
|
const hsl = color.toHsl();
|
|
46
50
|
hue = Math.round(hsl.h);
|
|
47
51
|
saturation = Math.round(hsl.s * 100);
|
|
@@ -66,7 +70,7 @@ const updateFromHsl = async () => {
|
|
|
66
70
|
if (globalThis.window) {
|
|
67
71
|
if (!updating && colorFormat === 'hsl') {
|
|
68
72
|
updating = true;
|
|
69
|
-
const color =
|
|
73
|
+
const color = new TinyColor({ h: hue, s: saturation / 100, l: lightness / 100, a: alpha });
|
|
70
74
|
const rgb = color.toRgb();
|
|
71
75
|
red = rgb.r;
|
|
72
76
|
green = rgb.g;
|
|
@@ -81,7 +85,7 @@ const updateFromHsl = async () => {
|
|
|
81
85
|
const updateColorsFromText = async () => {
|
|
82
86
|
// tinycolor requires window
|
|
83
87
|
if (globalThis.window) {
|
|
84
|
-
const color =
|
|
88
|
+
const color = new TinyColor(colorText);
|
|
85
89
|
if (color.isValid) {
|
|
86
90
|
if (!updating) {
|
|
87
91
|
updating = true;
|
|
@@ -144,13 +148,13 @@ $: {
|
|
|
144
148
|
}
|
|
145
149
|
// ----- Event handlers ----- //
|
|
146
150
|
const onInputBlur = async () => {
|
|
147
|
-
if (globalThis.window
|
|
151
|
+
if (globalThis.window) {
|
|
148
152
|
if (!updating) {
|
|
149
153
|
if (colorText.trim().length === 0) {
|
|
150
154
|
colorText = defaultColorText;
|
|
151
155
|
return;
|
|
152
156
|
}
|
|
153
|
-
const color =
|
|
157
|
+
const color = new TinyColor(colorText);
|
|
154
158
|
if (color.isValid) {
|
|
155
159
|
updating = true;
|
|
156
160
|
switch (colorFormat) {
|
|
@@ -234,6 +238,7 @@ updateColorsFromText();
|
|
|
234
238
|
on:mouseup
|
|
235
239
|
on:wheel
|
|
236
240
|
on:paste
|
|
241
|
+
{variant}
|
|
237
242
|
{...$$restProps}
|
|
238
243
|
>
|
|
239
244
|
<div class="value" slot="value">
|
|
@@ -245,7 +250,7 @@ updateColorsFromText();
|
|
|
245
250
|
on:click={onInputClick}
|
|
246
251
|
on:keydown={onInputKeydown}
|
|
247
252
|
spellcheck="false"
|
|
248
|
-
variant={`composed ${
|
|
253
|
+
variant={`composed ${valueVariant}`}
|
|
249
254
|
/>
|
|
250
255
|
</div>
|
|
251
256
|
<div class="sterling-color-picker-popup" use:trapKeyboardFocus>
|
|
@@ -258,11 +263,23 @@ updateColorsFromText();
|
|
|
258
263
|
</div>
|
|
259
264
|
<div class="sliders">
|
|
260
265
|
{#if colorFormat === 'rgb'}
|
|
261
|
-
<RgbColorSliders bind:red bind:green bind:blue bind:alpha />
|
|
266
|
+
<RgbColorSliders bind:red bind:green bind:blue bind:alpha variant={sliderVariant} />
|
|
262
267
|
{:else if colorFormat === 'hex'}
|
|
263
|
-
<HexColorSliders
|
|
268
|
+
<HexColorSliders
|
|
269
|
+
bind:red
|
|
270
|
+
bind:green
|
|
271
|
+
bind:blue
|
|
272
|
+
bind:alpha={hexAlpha}
|
|
273
|
+
variant={sliderVariant}
|
|
274
|
+
/>
|
|
264
275
|
{:else if colorFormat === 'hsl'}
|
|
265
|
-
<HslColorSliders
|
|
276
|
+
<HslColorSliders
|
|
277
|
+
bind:hue
|
|
278
|
+
bind:saturation
|
|
279
|
+
bind:lightness
|
|
280
|
+
bind:alpha
|
|
281
|
+
variant={sliderVariant}
|
|
282
|
+
/>
|
|
266
283
|
{/if}
|
|
267
284
|
</div>
|
|
268
285
|
</div>
|
package/dist/Dialog.svelte
CHANGED
|
@@ -39,17 +39,18 @@ const showDialog = () => {
|
|
|
39
39
|
if (dialogRef?.open === false) {
|
|
40
40
|
// when open, track clicks outside the dialog (use capture = true)
|
|
41
41
|
document.addEventListener('click', onDocumentClick, true);
|
|
42
|
+
returnValue = '';
|
|
42
43
|
dialogRef.showModal();
|
|
43
44
|
}
|
|
44
45
|
open = true;
|
|
45
46
|
};
|
|
46
|
-
const closeDialog = (
|
|
47
|
+
const closeDialog = async () => {
|
|
47
48
|
if (dialogRef?.open === true) {
|
|
48
49
|
// when closed, stop tracking clicks outside the dialog
|
|
49
50
|
document.removeEventListener('click', onDocumentClick);
|
|
50
51
|
// to allow time for the CSS transition animation, closing the dialog is delayed
|
|
51
52
|
closing = true;
|
|
52
|
-
tick();
|
|
53
|
+
await tick();
|
|
53
54
|
setTimeout(() => {
|
|
54
55
|
dialogRef.close(returnValue);
|
|
55
56
|
open = false;
|
|
@@ -73,6 +74,7 @@ const onCancel = (event) => {
|
|
|
73
74
|
// To allow animation with closeDialog, this event is canceled.
|
|
74
75
|
event.preventDefault();
|
|
75
76
|
event.stopPropagation();
|
|
77
|
+
returnValue = '';
|
|
76
78
|
closeDialog();
|
|
77
79
|
return false;
|
|
78
80
|
};
|
|
@@ -84,9 +86,11 @@ const onSubmit = (event) => {
|
|
|
84
86
|
const anyEvent = event;
|
|
85
87
|
if (anyEvent?.submitter.type === 'submit') {
|
|
86
88
|
if (dialogRef.open) {
|
|
87
|
-
|
|
89
|
+
const eventSubmitter = anyEvent?.submitter;
|
|
90
|
+
returnValue = eventSubmitter?.value ?? '';
|
|
91
|
+
closeDialog();
|
|
88
92
|
setTimeout(() => {
|
|
89
|
-
formRef.requestSubmit(
|
|
93
|
+
formRef.requestSubmit(eventSubmitter);
|
|
90
94
|
}, dialogFadeDuration);
|
|
91
95
|
event.preventDefault();
|
|
92
96
|
return false;
|
|
@@ -97,11 +101,6 @@ const onSubmit = (event) => {
|
|
|
97
101
|
return false;
|
|
98
102
|
}
|
|
99
103
|
};
|
|
100
|
-
const onClose = (event) => {
|
|
101
|
-
// This event is not cancelable.
|
|
102
|
-
// Update the returnValue whenever the dialog closes.
|
|
103
|
-
returnValue = dialogRef.returnValue;
|
|
104
|
-
};
|
|
105
104
|
$: {
|
|
106
105
|
updateDialog(open);
|
|
107
106
|
}
|
|
@@ -110,10 +109,8 @@ onMount(() => {
|
|
|
110
109
|
// Use the dialog for any element portals
|
|
111
110
|
portalHostStore.set(dialogRef);
|
|
112
111
|
dialogRef.addEventListener('cancel', onCancel);
|
|
113
|
-
dialogRef.addEventListener('close', onClose);
|
|
114
112
|
return () => {
|
|
115
113
|
dialogRef?.removeEventListener('cancel', onCancel);
|
|
116
|
-
dialogRef?.removeEventListener('close', onClose);
|
|
117
114
|
portalHostStore.set(undefined);
|
|
118
115
|
};
|
|
119
116
|
});
|
|
@@ -4,11 +4,11 @@ import Slider from './Slider.svelte';
|
|
|
4
4
|
import { round } from 'lodash-es';
|
|
5
5
|
// ----- Props ----- //
|
|
6
6
|
/** The hue value. */
|
|
7
|
-
export let hue =
|
|
7
|
+
export let hue = 0;
|
|
8
8
|
/** The saturation value. */
|
|
9
|
-
export let saturation =
|
|
9
|
+
export let saturation = 0;
|
|
10
10
|
/** The lightness value. */
|
|
11
|
-
export let lightness =
|
|
11
|
+
export let lightness = 0;
|
|
12
12
|
/** The alpha value. */
|
|
13
13
|
export let alpha = 1;
|
|
14
14
|
/** Additional class names to apply. */
|
package/dist/List.svelte
CHANGED
|
@@ -114,7 +114,6 @@ export const selectNextItem = () => {
|
|
|
114
114
|
};
|
|
115
115
|
export const selectLastItem = () => {
|
|
116
116
|
let candidate = listRef?.querySelector('[data-value][role=listitem]:last-of-type');
|
|
117
|
-
console.log('in selectLastItem', candidate);
|
|
118
117
|
while (candidate && !isElementListItem(candidate)) {
|
|
119
118
|
candidate = candidate.previousElementSibling;
|
|
120
119
|
}
|
package/dist/MenuButton.svelte
CHANGED
|
@@ -7,14 +7,11 @@ import { idGenerator } from './idGenerator';
|
|
|
7
7
|
import Popover from './Popover.svelte';
|
|
8
8
|
import { clickOutside } from './actions/clickOutside';
|
|
9
9
|
// ----- Props ----- //
|
|
10
|
-
/** When true, the menu is open. */
|
|
11
10
|
export let open = false;
|
|
12
|
-
|
|
11
|
+
export let menuVariant = '';
|
|
12
|
+
export let popoverPlacement = 'bottom-start';
|
|
13
13
|
export let value;
|
|
14
|
-
/** Additional class names to apply. */
|
|
15
14
|
export let variant = '';
|
|
16
|
-
/** Additional class names to apply to the Menu*/
|
|
17
|
-
export let menuVariant = '';
|
|
18
15
|
// ----- State ----- //
|
|
19
16
|
const instanceId = idGenerator.nextId('MenuButton');
|
|
20
17
|
let buttonRef;
|
|
@@ -66,7 +63,6 @@ $: {
|
|
|
66
63
|
}
|
|
67
64
|
prevOpen = open;
|
|
68
65
|
}
|
|
69
|
-
// ----- Event Handlers ----- //
|
|
70
66
|
const closeAllMenus = () => {
|
|
71
67
|
openValues.set([]);
|
|
72
68
|
};
|
|
@@ -81,7 +77,7 @@ const onClickOutside = (event) => {
|
|
|
81
77
|
}
|
|
82
78
|
closeAllMenus?.();
|
|
83
79
|
};
|
|
84
|
-
// -----
|
|
80
|
+
// ----- Context ----- //
|
|
85
81
|
setContext(MENU_ITEM_CONTEXT_KEY, {
|
|
86
82
|
depth: 1,
|
|
87
83
|
openValues,
|
|
@@ -95,10 +91,6 @@ setContext(MENU_ITEM_CONTEXT_KEY, {
|
|
|
95
91
|
});
|
|
96
92
|
</script>
|
|
97
93
|
|
|
98
|
-
<!--
|
|
99
|
-
@component
|
|
100
|
-
A Button that displays a context menu when clicked.
|
|
101
|
-
-->
|
|
102
94
|
<Button
|
|
103
95
|
bind:this={buttonRef}
|
|
104
96
|
aria-controls={menuId}
|
|
@@ -145,7 +137,7 @@ setContext(MENU_ITEM_CONTEXT_KEY, {
|
|
|
145
137
|
<div class="reference" bind:this={reference} use:clickOutside on:click_outside={onClickOutside}>
|
|
146
138
|
<slot {open} {value} {variant} />
|
|
147
139
|
</div>
|
|
148
|
-
<Popover {reference} {open}>
|
|
140
|
+
<Popover {reference} {open} placement={popoverPlacement}>
|
|
149
141
|
<Menu bind:this={menuRef} id={menuId} {reference} {open} variant={menuVariant}>
|
|
150
142
|
<slot name="items" />
|
|
151
143
|
</Menu>
|
|
@@ -3,9 +3,10 @@ declare const __propDef: {
|
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
open?: boolean | undefined;
|
|
6
|
+
menuVariant?: string | undefined;
|
|
7
|
+
popoverPlacement?: string | undefined;
|
|
6
8
|
value: string;
|
|
7
9
|
variant?: string | undefined;
|
|
8
|
-
menuVariant?: string | undefined;
|
|
9
10
|
click?: (() => void) | undefined;
|
|
10
11
|
blur?: (() => void) | undefined;
|
|
11
12
|
focus?: ((options?: FocusOptions) => void) | undefined;
|
|
@@ -62,7 +63,6 @@ declare const __propDef: {
|
|
|
62
63
|
export type MenuButtonProps = typeof __propDef.props;
|
|
63
64
|
export type MenuButtonEvents = typeof __propDef.events;
|
|
64
65
|
export type MenuButtonSlots = typeof __propDef.slots;
|
|
65
|
-
/** A Button that displays a context menu when clicked. */
|
|
66
66
|
export default class MenuButton extends SvelteComponent<MenuButtonProps, MenuButtonEvents, MenuButtonSlots> {
|
|
67
67
|
get click(): () => void;
|
|
68
68
|
get blur(): () => void;
|
package/dist/MenuItem.types.d.ts
CHANGED
package/dist/Popover.svelte
CHANGED
|
@@ -12,7 +12,7 @@ export let mainAxisOffset = 0;
|
|
|
12
12
|
/** When true, the popover is open and visible. */
|
|
13
13
|
export let open = false;
|
|
14
14
|
/** How the popover should be positioned relative to the reference element. */
|
|
15
|
-
export let placement = '
|
|
15
|
+
export let placement = 'top-start';
|
|
16
16
|
/** The host container for the callout. */
|
|
17
17
|
export let portalHost = undefined;
|
|
18
18
|
/** The reference to the element anchoring the position of the popover. */
|
package/dist/TextArea.svelte
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import { onMount } from 'svelte';
|
|
1
|
+
<script>import { onMount, tick } from 'svelte';
|
|
2
2
|
// ----- Props ----- //
|
|
3
3
|
export let disabled = false;
|
|
4
4
|
export let value = '';
|
|
@@ -10,6 +10,24 @@ export let resize = 'none';
|
|
|
10
10
|
export let variant = '';
|
|
11
11
|
// ----- State ----- //
|
|
12
12
|
let textAreaRef;
|
|
13
|
+
const correctResize = async () => {
|
|
14
|
+
console.log('correctResize');
|
|
15
|
+
await tick();
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
if (autoHeight) {
|
|
18
|
+
if (resize === 'both') {
|
|
19
|
+
console.warn('The resize property cannot be set to "both" when autoHeight is true. The resize property will be set to "horizontal".');
|
|
20
|
+
resize = 'horizontal';
|
|
21
|
+
}
|
|
22
|
+
if (resize === 'vertical') {
|
|
23
|
+
console.warn('The resize property cannot be set to "vertical" when autoHeight is true. The resize property will be set to "none".');
|
|
24
|
+
resize = 'none';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, 0);
|
|
28
|
+
};
|
|
29
|
+
$: autoHeight, resize, correctResize();
|
|
30
|
+
// ----- autoHeight ----- //
|
|
13
31
|
const autoSetHeight = () => {
|
|
14
32
|
if (autoHeight && textAreaRef) {
|
|
15
33
|
// the style must be directly set to avoid re-rendering looping latency
|
|
@@ -18,11 +36,11 @@ const autoSetHeight = () => {
|
|
|
18
36
|
textAreaRef.style.height = `${textAreaRef.scrollHeight}px`;
|
|
19
37
|
}
|
|
20
38
|
};
|
|
39
|
+
$: autoHeight, autoSetHeight();
|
|
21
40
|
// ----- Event Handlers ----- //
|
|
22
41
|
const onInput = () => {
|
|
23
42
|
autoSetHeight();
|
|
24
43
|
};
|
|
25
|
-
$: autoHeight, autoSetHeight();
|
|
26
44
|
onMount(() => {
|
|
27
45
|
autoSetHeight();
|
|
28
46
|
});
|
package/dist/Tooltip.svelte
CHANGED
|
@@ -6,7 +6,7 @@ export let conditionalRender = true;
|
|
|
6
6
|
export let crossAxisOffset = 0;
|
|
7
7
|
export let mainAxisOffset = 0;
|
|
8
8
|
export let open = false;
|
|
9
|
-
export let placement = '
|
|
9
|
+
export let placement = 'top-start';
|
|
10
10
|
export let portalHost = undefined;
|
|
11
11
|
export let variant = '';
|
|
12
12
|
/** When true, the tooltip is disabled and will not be shown. */
|
package/dist/css/Input.base.css
CHANGED
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
margin: 0;
|
|
21
21
|
outline: none;
|
|
22
22
|
padding: 0.5em;
|
|
23
|
-
transition:
|
|
23
|
+
transition:
|
|
24
|
+
background-color 250ms,
|
|
25
|
+
color 250ms,
|
|
26
|
+
border-color 250ms;
|
|
24
27
|
width: 100%;
|
|
25
28
|
}
|
|
26
29
|
|
|
@@ -78,7 +81,7 @@ input::placeholder {
|
|
|
78
81
|
transition: opacity 250ms;
|
|
79
82
|
}
|
|
80
83
|
|
|
81
|
-
.sterling-input.disabled::after {
|
|
84
|
+
.sterling-input:not(.composed).disabled::after {
|
|
82
85
|
opacity: 1;
|
|
83
86
|
}
|
|
84
87
|
|
package/dist/css/Link.base.css
CHANGED
|
@@ -5,14 +5,17 @@
|
|
|
5
5
|
border-right: none;
|
|
6
6
|
border-radius: 0;
|
|
7
7
|
border-bottom-style: solid;
|
|
8
|
-
border-bottom-width:
|
|
8
|
+
border-bottom-width: 2px;
|
|
9
9
|
border-bottom-color: var(--stsv-common__border-color);
|
|
10
10
|
color: var(--stsv-common__color);
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
font: inherit;
|
|
13
13
|
text-decoration: none;
|
|
14
14
|
text-overflow: ellipsis;
|
|
15
|
-
transition:
|
|
15
|
+
transition:
|
|
16
|
+
background-color 250ms,
|
|
17
|
+
color 250ms,
|
|
18
|
+
border-color 250ms;
|
|
16
19
|
white-space: nowrap;
|
|
17
20
|
user-select: none;
|
|
18
21
|
}
|
|
@@ -37,10 +40,9 @@
|
|
|
37
40
|
.sterling-link.disabled:visited,
|
|
38
41
|
.sterling-link.disabled:hover,
|
|
39
42
|
.sterling-link.disabled:active {
|
|
40
|
-
border-bottom-color: var(--stsv-
|
|
41
|
-
color: var(--stsv-common__color--disabled);
|
|
42
|
-
cursor: not-allowed;
|
|
43
|
+
border-bottom-color: var(--stsv-common__color--faint);
|
|
43
44
|
pointer-events: none;
|
|
45
|
+
position: relative;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
/* ----- prefers-reduced-motion ----- */
|
package/dist/css/Link.css
CHANGED
|
@@ -2,5 +2,9 @@
|
|
|
2
2
|
@import url('./Link.colorful.css');
|
|
3
3
|
@import url('./Link.ghost.css');
|
|
4
4
|
@import url('./Link.ghost.colorful.css');
|
|
5
|
+
@import url('./Link.text-underline.css');
|
|
6
|
+
@import url('./Link.text-underline.ghost.css');
|
|
5
7
|
@import url('./Link.undecorated.css');
|
|
6
8
|
@import url('./Link.undecorated.colorful.css');
|
|
9
|
+
@import url('./Link.undecorated.ghost.css');
|
|
10
|
+
@import url('./Link.undecorated.underline.css');
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.sterling-link.text-underline.ghost,
|
|
2
|
+
.sterling-link.text-underline.ghost:visited {
|
|
3
|
+
border-bottom-color: transparent;
|
|
4
|
+
border-bottom-width: 0;
|
|
5
|
+
text-decoration: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.sterling-link.text-underline.ghost:hover,
|
|
9
|
+
.sterling-link.text-underline.ghost:active {
|
|
10
|
+
border-bottom-color: transparent;
|
|
11
|
+
border-bottom-width: 0;
|
|
12
|
+
text-decoration: underline;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
.sterling-link.undecorated.underline,
|
|
2
|
+
.sterling-link.undecorated.underline:hover,
|
|
3
|
+
.sterling-link.undecorated.underline:active,
|
|
4
|
+
.sterling-link.undecorated.underline:visited {
|
|
5
|
+
border-bottom-width: 0;
|
|
6
|
+
border-bottom-color: transparent;
|
|
7
|
+
text-decoration: none;
|
|
8
|
+
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
grid-template-columns: 1em 1fr 1em;
|
|
6
6
|
column-gap: 0.5em;
|
|
7
7
|
padding: 0.25em;
|
|
8
|
+
position: relative;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
.sterling-menu-item-display .check {
|
|
@@ -13,7 +14,10 @@
|
|
|
13
14
|
width: 20px;
|
|
14
15
|
height: 20px;
|
|
15
16
|
position: relative;
|
|
16
|
-
transition:
|
|
17
|
+
transition:
|
|
18
|
+
background-color 250ms,
|
|
19
|
+
color 250ms,
|
|
20
|
+
border-color 250ms;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
.sterling-menu-item-display .check.checkmark.checked::after {
|
package/dist/css/Slider.base.css
CHANGED
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
padding: 0;
|
|
5
5
|
overflow: visible;
|
|
6
6
|
display: grid;
|
|
7
|
-
transition:
|
|
7
|
+
transition:
|
|
8
|
+
background-color 250ms,
|
|
9
|
+
color 250ms,
|
|
10
|
+
border-color 250ms;
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
.sterling-slider.horizontal {
|
|
@@ -44,7 +47,10 @@
|
|
|
44
47
|
.sterling-slider .track {
|
|
45
48
|
position: absolute;
|
|
46
49
|
background: var(--stsv-common__background-color--secondary);
|
|
47
|
-
transition:
|
|
50
|
+
transition:
|
|
51
|
+
background-color 250ms,
|
|
52
|
+
color 250ms,
|
|
53
|
+
border-color 250ms;
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
.sterling-slider.horizontal .track {
|
|
@@ -75,7 +81,10 @@
|
|
|
75
81
|
.sterling-slider .fill {
|
|
76
82
|
background: var(--stsv-common__color);
|
|
77
83
|
position: absolute;
|
|
78
|
-
transition:
|
|
84
|
+
transition:
|
|
85
|
+
background-color 250ms,
|
|
86
|
+
color 250ms,
|
|
87
|
+
border-color 250ms;
|
|
79
88
|
}
|
|
80
89
|
|
|
81
90
|
.sterling-slider.horizontal .fill {
|
|
@@ -107,9 +116,11 @@
|
|
|
107
116
|
height: 1.5em;
|
|
108
117
|
overflow: hidden;
|
|
109
118
|
padding: 0;
|
|
110
|
-
position: relative;
|
|
111
119
|
text-decoration: none;
|
|
112
|
-
transition:
|
|
120
|
+
transition:
|
|
121
|
+
background-color 250ms,
|
|
122
|
+
color 250ms,
|
|
123
|
+
border-color 250ms;
|
|
113
124
|
white-space: nowrap;
|
|
114
125
|
position: absolute;
|
|
115
126
|
width: 1.5em;
|
|
@@ -141,7 +152,6 @@
|
|
|
141
152
|
|
|
142
153
|
.sterling-slider.disabled .thumb {
|
|
143
154
|
cursor: not-allowed;
|
|
144
|
-
position: relative;
|
|
145
155
|
outline: none;
|
|
146
156
|
}
|
|
147
157
|
|
package/dist/css/Switch.base.css
CHANGED
|
@@ -67,7 +67,10 @@
|
|
|
67
67
|
font: inherit;
|
|
68
68
|
pointer-events: none;
|
|
69
69
|
position: relative;
|
|
70
|
-
transition:
|
|
70
|
+
transition:
|
|
71
|
+
background-color 250ms,
|
|
72
|
+
color 250ms,
|
|
73
|
+
border-color 250ms;
|
|
71
74
|
user-select: none;
|
|
72
75
|
}
|
|
73
76
|
|
|
@@ -87,6 +90,12 @@ input:focus-visible ~ .switch {
|
|
|
87
90
|
outline-width: 2px;
|
|
88
91
|
}
|
|
89
92
|
|
|
93
|
+
input:checked ~ .switch,
|
|
94
|
+
input:checked:hover ~ .switch,
|
|
95
|
+
input:checked:focus-visible ~ .switch {
|
|
96
|
+
background-color: var(--stsv-input__border-color--hover);
|
|
97
|
+
}
|
|
98
|
+
|
|
90
99
|
/* ----- switch vertical ----- */
|
|
91
100
|
|
|
92
101
|
.sterling-switch:not(.vertical) .switch {
|
|
@@ -126,7 +135,11 @@ input:focus-visible ~ .switch {
|
|
|
126
135
|
font: inherit;
|
|
127
136
|
height: 1.25em;
|
|
128
137
|
position: absolute;
|
|
129
|
-
transition:
|
|
138
|
+
transition:
|
|
139
|
+
background-color 250ms,
|
|
140
|
+
color 250ms,
|
|
141
|
+
border-color 250ms,
|
|
142
|
+
transform 250ms;
|
|
130
143
|
width: 1.25em;
|
|
131
144
|
}
|
|
132
145
|
|
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
color: var(--stsv-input--colorful__color--focus);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
.sterling-switch.colorful input:checked ~ .switch,
|
|
22
|
+
.sterling-switch.colorful input:checked:hover ~ .switch,
|
|
23
|
+
.sterling-switch.colorful input:checked:focus-visible ~ .switch {
|
|
24
|
+
background-color: var(--stsv-input--colorful__border-color--hover);
|
|
25
|
+
}
|
|
26
|
+
|
|
21
27
|
/* ----- thumb colorful ----- */
|
|
22
28
|
|
|
23
29
|
.sterling-switch.colorful .thumb {
|
package/dist/index.d.ts
CHANGED
|
@@ -65,4 +65,3 @@ import TreeChevron from './TreeChevron.svelte';
|
|
|
65
65
|
import TreeItem from './TreeItem.svelte';
|
|
66
66
|
import TreeItemDisplay from './TreeItemDisplay.svelte';
|
|
67
67
|
export { Button, Callout, Checkbox, ColorPicker, Dialog, Dropdown, HexColorSliders, HslColorSliders, Input, Label, Link, List, ListItem, Menu, MenuBar, MenuButton, MenuItem, MenuItemDisplay, MenuSeparator, Popover, Progress, Radio, RgbColorSliders, Select, Slider, Switch, Tab, TabList, TextArea, Tooltip, Tree, TreeChevron, TreeItem, TreeItemDisplay };
|
|
68
|
-
export * from './css/sterling.css';
|
package/dist/index.js
CHANGED
|
@@ -58,4 +58,3 @@ import TreeChevron from './TreeChevron.svelte';
|
|
|
58
58
|
import TreeItem from './TreeItem.svelte';
|
|
59
59
|
import TreeItemDisplay from './TreeItemDisplay.svelte';
|
|
60
60
|
export { Button, Callout, Checkbox, ColorPicker, Dialog, Dropdown, HexColorSliders, HslColorSliders, Input, Label, Link, List, ListItem, Menu, MenuBar, MenuButton, MenuItem, MenuItemDisplay, MenuSeparator, Popover, Progress, Radio, RgbColorSliders, Select, Slider, Switch, Tab, TabList, TextArea, Tooltip, Tree, TreeChevron, TreeItem, TreeItemDisplay };
|
|
61
|
-
export * from './css/sterling.css';
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@geoffcox/sterling-svelte",
|
|
3
|
+
"version": "1.0.11",
|
|
4
|
+
"author": "Geoff Cox",
|
|
5
|
+
"description": "A modern, accessible, and lightweight UI component library for Svelte.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/GeoffCox/sterling-svelte/issues"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/GeoffCox/sterling-svelte/blob/main/README.md",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"svelte",
|
|
13
|
+
"svelte 4",
|
|
14
|
+
"sveltekit",
|
|
15
|
+
"design system",
|
|
16
|
+
"component",
|
|
17
|
+
"components",
|
|
18
|
+
"controls",
|
|
19
|
+
"typescript",
|
|
20
|
+
"javascript",
|
|
21
|
+
"button",
|
|
22
|
+
"callout",
|
|
23
|
+
"checkbox",
|
|
24
|
+
"colorpicker",
|
|
25
|
+
"dialog",
|
|
26
|
+
"dropdown",
|
|
27
|
+
"input",
|
|
28
|
+
"label",
|
|
29
|
+
"link",
|
|
30
|
+
"list",
|
|
31
|
+
"menu",
|
|
32
|
+
"popover",
|
|
33
|
+
"progress",
|
|
34
|
+
"radio",
|
|
35
|
+
"select",
|
|
36
|
+
"slider",
|
|
37
|
+
"switch",
|
|
38
|
+
"tabs",
|
|
39
|
+
"textarea",
|
|
40
|
+
"tooltip",
|
|
41
|
+
"tree"
|
|
42
|
+
],
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./index.d.ts",
|
|
46
|
+
"svelte": "./index.js"
|
|
47
|
+
},
|
|
48
|
+
"./css/*.css": "./css/*.css",
|
|
49
|
+
"./*.svelte": "./**/*.svelte"
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"**/*",
|
|
53
|
+
"!**/*.test.*",
|
|
54
|
+
"!**/*.spec.*"
|
|
55
|
+
],
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "vite build && npm run package",
|
|
58
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
59
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
60
|
+
"dev": "vite dev",
|
|
61
|
+
"format": "prettier --write .",
|
|
62
|
+
"lint": "prettier --check . && eslint .",
|
|
63
|
+
"package": "svelte-kit sync && svelte-package && publint",
|
|
64
|
+
"preview": "vite preview",
|
|
65
|
+
"test": "npm run test:integration && npm run test:unit",
|
|
66
|
+
"test:integration": "playwright test",
|
|
67
|
+
"test:unit": "vitest"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"svelte": "^4.0.0"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@fontsource/open-sans": "^4.5.14",
|
|
74
|
+
"@fontsource/source-code-pro": "^4.5.14",
|
|
75
|
+
"@playwright/test": "^1.28.1",
|
|
76
|
+
"@sveltejs/adapter-auto": "^3.0.0",
|
|
77
|
+
"@sveltejs/adapter-static": "^3.0.0",
|
|
78
|
+
"@sveltejs/kit": "^2.0.0",
|
|
79
|
+
"@sveltejs/package": "^2.0.0",
|
|
80
|
+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
|
81
|
+
"@types/eslint": "^8.56.7",
|
|
82
|
+
"@types/lodash-es": "^4.17.6",
|
|
83
|
+
"eslint": "^9.0.0",
|
|
84
|
+
"eslint-config-prettier": "^9.1.0",
|
|
85
|
+
"eslint-plugin-svelte": "^2.36.0",
|
|
86
|
+
"globals": "^15.0.0",
|
|
87
|
+
"mdsvex": "^0.11.0",
|
|
88
|
+
"prettier": "^3.1.1",
|
|
89
|
+
"prettier-plugin-svelte": "^3.1.2",
|
|
90
|
+
"publint": "^0.1.9",
|
|
91
|
+
"svelte": "^4.2.7",
|
|
92
|
+
"svelte-check": "^3.6.0",
|
|
93
|
+
"svelte-preprocess": "^5.0.4",
|
|
94
|
+
"typescript": "^5.0.0",
|
|
95
|
+
"typescript-eslint": "^8.0.0-alpha.20",
|
|
96
|
+
"vite": "^5.0.11",
|
|
97
|
+
"vitest": "^1.2.0"
|
|
98
|
+
},
|
|
99
|
+
"dependencies": {
|
|
100
|
+
"@ctrl/tinycolor": "^4.1.0",
|
|
101
|
+
"@floating-ui/dom": "^1.1.0",
|
|
102
|
+
"keyborg": "^2.0.0",
|
|
103
|
+
"lodash-es": "^4.17.21"
|
|
104
|
+
},
|
|
105
|
+
"svelte": "./index.js",
|
|
106
|
+
"types": "./index.d.ts",
|
|
107
|
+
"type": "module"
|
|
108
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geoffcox/sterling-svelte",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"author": "Geoff Cox",
|
|
5
|
-
"description": "A modern, accessible, and lightweight component library for Svelte.",
|
|
5
|
+
"description": "A modern, accessible, and lightweight UI component library for Svelte.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bugs": {
|
|
8
8
|
"url": "https://github.com/GeoffCox/sterling-svelte/issues"
|
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
"types": "./dist/index.d.ts",
|
|
46
46
|
"svelte": "./dist/index.js"
|
|
47
47
|
},
|
|
48
|
-
"./css/*.css": "./dist/css/*.css"
|
|
48
|
+
"./css/*.css": "./dist/css/*.css",
|
|
49
|
+
"./*.svelte": "./dist/*.svelte"
|
|
49
50
|
},
|
|
50
51
|
"files": [
|
|
51
52
|
"dist/*",
|
|
@@ -72,7 +73,6 @@
|
|
|
72
73
|
"@fontsource/open-sans": "^4.5.14",
|
|
73
74
|
"@fontsource/source-code-pro": "^4.5.14",
|
|
74
75
|
"@playwright/test": "^1.28.1",
|
|
75
|
-
"@stackblitz/sdk": "^1.10.0",
|
|
76
76
|
"@sveltejs/adapter-auto": "^3.0.0",
|
|
77
77
|
"@sveltejs/adapter-static": "^3.0.0",
|
|
78
78
|
"@sveltejs/kit": "^2.0.0",
|
|
@@ -80,7 +80,6 @@
|
|
|
80
80
|
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
|
81
81
|
"@types/eslint": "^8.56.7",
|
|
82
82
|
"@types/lodash-es": "^4.17.6",
|
|
83
|
-
"@types/tinycolor2": "^1.4.3",
|
|
84
83
|
"eslint": "^9.0.0",
|
|
85
84
|
"eslint-config-prettier": "^9.1.0",
|
|
86
85
|
"eslint-plugin-svelte": "^2.36.0",
|
|
@@ -98,7 +97,7 @@
|
|
|
98
97
|
"vitest": "^1.2.0"
|
|
99
98
|
},
|
|
100
99
|
"dependencies": {
|
|
101
|
-
"@ctrl/tinycolor": "^
|
|
100
|
+
"@ctrl/tinycolor": "^4.1.0",
|
|
102
101
|
"@floating-ui/dom": "^1.1.0",
|
|
103
102
|
"keyborg": "^2.0.0",
|
|
104
103
|
"lodash-es": "^4.17.21"
|