@geoffcox/sterling-svelte 0.0.27 → 0.0.29
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 +7 -6
- package/Button.svelte.d.ts +2 -0
- package/Checkbox.svelte +18 -13
- package/Checkbox.svelte.d.ts +2 -1
- package/ColorPicker.svelte +33 -2
- package/ColorPicker.svelte.d.ts +28 -1
- package/Dropdown.svelte +16 -9
- package/HexColorSliders.svelte +25 -4
- package/HexColorSliders.svelte.d.ts +1 -1
- package/HslColorSliders.svelte +25 -4
- package/HslColorSliders.svelte.d.ts +1 -1
- package/Input.svelte +16 -10
- package/Input.svelte.d.ts +2 -2
- package/Label.constants.d.ts +1 -0
- package/Label.constants.js +1 -0
- package/Label.svelte +211 -13
- package/Label.svelte.d.ts +24 -4
- package/Label.types.d.ts +4 -0
- package/Link.svelte +2 -2
- package/Link.svelte.d.ts +1 -1
- package/List.svelte +6 -5
- package/ListItem.svelte +7 -6
- package/MenuButton.svelte +1 -5
- package/MenuButton.svelte.d.ts +2 -4
- package/MenuItem.svelte +1 -1
- package/MenuItem.svelte.d.ts +1 -1
- package/MenuItemDisplay.svelte +6 -5
- package/Progress.constants.d.ts +1 -1
- package/Progress.constants.js +1 -1
- package/Progress.svelte +27 -21
- package/Progress.svelte.d.ts +1 -1
- package/Progress.types.d.ts +3 -3
- package/Radio.svelte +18 -13
- package/Radio.svelte.d.ts +2 -1
- package/RgbColorSliders.svelte +25 -4
- package/RgbColorSliders.svelte.d.ts +1 -1
- package/Select.svelte +7 -6
- package/Select.svelte.d.ts +1 -1
- package/Slider.svelte +6 -8
- package/Switch.svelte +21 -13
- package/Switch.svelte.d.ts +3 -3
- package/Tab.svelte +6 -5
- package/Tab.svelte.d.ts +7 -4
- package/TabList.svelte +0 -1
- package/TextArea.svelte +8 -7
- package/TextArea.svelte.d.ts +2 -2
- package/Tooltip.svelte +47 -5
- package/Tooltip.svelte.d.ts +34 -2
- package/Tree.svelte +6 -5
- package/Tree.types.d.ts +5 -8
- package/TreeItem.svelte +2 -2
- package/TreeItem.svelte.d.ts +1 -1
- package/TreeItem.types.d.ts +4 -4
- package/TreeItemDisplay.svelte +7 -6
- package/TreeItemDisplay.svelte.d.ts +1 -1
- package/index.d.ts +7 -8
- package/index.js +5 -6
- package/package.json +3 -4
- package/theme/darkTheme.js +7 -8
- package/theme/lightTheme.js +14 -15
- package/Field.constants.d.ts +0 -1
- package/Field.constants.js +0 -1
- package/Field.svelte +0 -265
- package/Field.svelte.d.ts +0 -75
- package/Field.types.d.ts +0 -4
- /package/{Field.types.js → Label.types.js} +0 -0
package/RgbColorSliders.svelte
CHANGED
|
@@ -137,16 +137,37 @@ const onAlphaInputchange = (event) => {
|
|
|
137
137
|
background-color: #eee;
|
|
138
138
|
opacity: 0.1;
|
|
139
139
|
background-image: repeating-linear-gradient(
|
|
140
|
-
|
|
140
|
+
var(--stsv-common--disabled__stripe-angle),
|
|
141
141
|
#444 25%,
|
|
142
142
|
transparent 25%,
|
|
143
143
|
transparent 75%,
|
|
144
144
|
#444 75%,
|
|
145
145
|
#444
|
|
146
146
|
),
|
|
147
|
-
repeating-linear-gradient(
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
repeating-linear-gradient(
|
|
148
|
+
var(--stsv-common--disabled__stripe-angle),
|
|
149
|
+
#444 25%,
|
|
150
|
+
#eee 25%,
|
|
151
|
+
#eee 75%,
|
|
152
|
+
#444 75%,
|
|
153
|
+
#444
|
|
154
|
+
),
|
|
155
|
+
repeating-linear-gradient(
|
|
156
|
+
-var(--stsv-common--disabled__stripe-angle),
|
|
157
|
+
#444 25%,
|
|
158
|
+
transparent 25%,
|
|
159
|
+
transparent 75%,
|
|
160
|
+
#444 75%,
|
|
161
|
+
#444
|
|
162
|
+
),
|
|
163
|
+
repeating-linear-gradient(
|
|
164
|
+
-var(--stsv-common--disabled__stripe-angle),
|
|
165
|
+
#444 25%,
|
|
166
|
+
#eee 25%,
|
|
167
|
+
#eee 75%,
|
|
168
|
+
#444 75%,
|
|
169
|
+
#444
|
|
170
|
+
);
|
|
150
171
|
background-position: 0 0, 4px 4px;
|
|
151
172
|
background-size: 8px 8px;
|
|
152
173
|
}
|
|
@@ -5,7 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
green?: number | undefined;
|
|
6
6
|
blue?: number | undefined;
|
|
7
7
|
alpha?: number | undefined;
|
|
8
|
-
colorful?: boolean | undefined;
|
|
8
|
+
/** When true, applies colorful theme styles. */ colorful?: boolean | undefined;
|
|
9
9
|
};
|
|
10
10
|
events: {
|
|
11
11
|
change: CustomEvent<any>;
|
package/Select.svelte
CHANGED
|
@@ -4,8 +4,8 @@ import { idGenerator } from "./idGenerator";
|
|
|
4
4
|
import List from "./List.svelte";
|
|
5
5
|
import Popup from "./Popover.svelte";
|
|
6
6
|
const popupId = idGenerator.nextId("Select-popup");
|
|
7
|
-
export let composed = false;
|
|
8
7
|
export let disabled = false;
|
|
8
|
+
export let composed = false;
|
|
9
9
|
export let open = false;
|
|
10
10
|
export let selectedValue = void 0;
|
|
11
11
|
let prevOpen = false;
|
|
@@ -260,11 +260,12 @@ const onListSelect = (event) => {
|
|
|
260
260
|
|
|
261
261
|
.sterling-select::after {
|
|
262
262
|
background: repeating-linear-gradient(
|
|
263
|
-
|
|
264
|
-
var(--stsv-
|
|
265
|
-
var(--stsv-
|
|
266
|
-
var(--stsv-
|
|
267
|
-
var(--stsv-
|
|
263
|
+
var(--stsv-common--disabled__stripe-angle),
|
|
264
|
+
var(--stsv-common--disabled__stripe-color),
|
|
265
|
+
var(--stsv-common--disabled__stripe-color) var(--stsv-common--disabled__stripe-width),
|
|
266
|
+
var(--stsv-common--disabled__stripe-color--alt) var(--stsv-common--disabled__stripe-width),
|
|
267
|
+
var(--stsv-common--disabled__stripe-color--alt)
|
|
268
|
+
calc(2 * var(--stsv-common--disabled__stripe-width))
|
|
268
269
|
);
|
|
269
270
|
bottom: 0;
|
|
270
271
|
content: '';
|
package/Select.svelte.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
composed?: boolean | undefined;
|
|
6
5
|
disabled?: boolean | undefined;
|
|
6
|
+
composed?: boolean | undefined;
|
|
7
7
|
open?: boolean | undefined;
|
|
8
8
|
selectedValue?: string | undefined;
|
|
9
9
|
blur?: (() => void) | undefined;
|
package/Slider.svelte
CHANGED
|
@@ -6,7 +6,7 @@ export let disabled = false;
|
|
|
6
6
|
export let min = 0;
|
|
7
7
|
export let max = 100;
|
|
8
8
|
export let precision = void 0;
|
|
9
|
-
export let step =
|
|
9
|
+
export let step = 1;
|
|
10
10
|
export let value = 0;
|
|
11
11
|
export let vertical = false;
|
|
12
12
|
let sliderRef;
|
|
@@ -36,8 +36,6 @@ $:
|
|
|
36
36
|
min, max, precision, setValue(value);
|
|
37
37
|
$:
|
|
38
38
|
ratio = (value - min) / (max - min);
|
|
39
|
-
$:
|
|
40
|
-
changeBy = step ? step : 1;
|
|
41
39
|
const setValueByOffset = (offset) => {
|
|
42
40
|
if (sliderSize > 0) {
|
|
43
41
|
const positionRatio = Math.max(0, Math.min(1, offset / sliderSize));
|
|
@@ -83,13 +81,13 @@ const onKeyDown = (event) => {
|
|
|
83
81
|
switch (event.code) {
|
|
84
82
|
case "ArrowDown":
|
|
85
83
|
case "ArrowLeft":
|
|
86
|
-
setValue(value -
|
|
84
|
+
setValue(value - step);
|
|
87
85
|
event.preventDefault();
|
|
88
86
|
event.stopPropagation();
|
|
89
87
|
return;
|
|
90
88
|
case "ArrowRight":
|
|
91
89
|
case "ArrowUp":
|
|
92
|
-
setValue(value +
|
|
90
|
+
setValue(value + step);
|
|
93
91
|
event.preventDefault();
|
|
94
92
|
event.stopPropagation();
|
|
95
93
|
return;
|
|
@@ -326,9 +324,9 @@ Slider lets the user chose a value within a min/max range by dragging a thumb bu
|
|
|
326
324
|
|
|
327
325
|
.sterling-slider .thumb::after {
|
|
328
326
|
background: repeating-linear-gradient(
|
|
329
|
-
|
|
330
|
-
var(--stsv-
|
|
331
|
-
var(--stsv-
|
|
327
|
+
var(--stsv-common--disabled__stripe-angle),
|
|
328
|
+
var(--stsv-common--disabled__stripe-color),
|
|
329
|
+
var(--stsv-common--disabled__stripe-color) 3px,
|
|
332
330
|
var(--stsv-common__background-color2_disabled) 3px,
|
|
333
331
|
var(--stsv-common__background-color2_disabled) 6px
|
|
334
332
|
);
|
package/Switch.svelte
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import { idGenerator } from "./idGenerator";
|
|
1
|
+
<script>import { idGenerator } from "./idGenerator";
|
|
3
2
|
export let checked = false;
|
|
4
|
-
export let colorful = false;
|
|
5
3
|
export let disabled = false;
|
|
6
|
-
export let
|
|
7
|
-
export let onText = void 0;
|
|
4
|
+
export let colorful = false;
|
|
8
5
|
export let offText = void 0;
|
|
6
|
+
export let onText = void 0;
|
|
7
|
+
export let vertical = false;
|
|
9
8
|
const inputId = idGenerator.nextId("Switch");
|
|
10
9
|
let inputRef;
|
|
11
10
|
let switchWidth = 0;
|
|
@@ -77,7 +76,7 @@ export const focus = (options) => {
|
|
|
77
76
|
<div class="off-label">
|
|
78
77
|
<slot name="offLabel" {checked} {disabled} {inputId} {offText} {vertical}>
|
|
79
78
|
{#if offText}
|
|
80
|
-
<
|
|
79
|
+
<label for={inputId}>{offText}</label>
|
|
81
80
|
{/if}
|
|
82
81
|
</slot>
|
|
83
82
|
</div>
|
|
@@ -95,7 +94,7 @@ export const focus = (options) => {
|
|
|
95
94
|
<div class="on-label">
|
|
96
95
|
<slot name="onLabel" {checked} {disabled} {inputId} {onText} {vertical}>
|
|
97
96
|
{#if onText}
|
|
98
|
-
<
|
|
97
|
+
<label for={inputId}>{onText}</label>
|
|
99
98
|
{/if}
|
|
100
99
|
</slot>
|
|
101
100
|
</div>
|
|
@@ -206,6 +205,12 @@ export const focus = (options) => {
|
|
|
206
205
|
|
|
207
206
|
/* ----- labels ----- */
|
|
208
207
|
|
|
208
|
+
label {
|
|
209
|
+
color: var(--stsv-common__color);
|
|
210
|
+
transition: color 250ms;
|
|
211
|
+
font: inherit;
|
|
212
|
+
}
|
|
213
|
+
|
|
209
214
|
.off-label,
|
|
210
215
|
.on-label {
|
|
211
216
|
padding-top: var(--stsv-button__border-width);
|
|
@@ -285,13 +290,15 @@ export const focus = (options) => {
|
|
|
285
290
|
|
|
286
291
|
.sterling-switch .thumb::after {
|
|
287
292
|
background: repeating-linear-gradient(
|
|
288
|
-
|
|
289
|
-
var(--stsv-
|
|
290
|
-
var(--stsv-
|
|
291
|
-
var(--stsv-
|
|
292
|
-
var(--stsv-
|
|
293
|
+
var(--stsv-common--disabled__stripe-angle),
|
|
294
|
+
var(--stsv-common--disabled__stripe-color),
|
|
295
|
+
var(--stsv-common--disabled__stripe-color) var(--stsv-common--disabled__stripe-width),
|
|
296
|
+
var(--stsv-common--disabled__stripe-color--alt) var(--stsv-common--disabled__stripe-width),
|
|
297
|
+
var(--stsv-common--disabled__stripe-color--alt)
|
|
298
|
+
calc(2 * var(--stsv-common--disabled__stripe-width))
|
|
293
299
|
);
|
|
294
300
|
bottom: 0;
|
|
301
|
+
border-radius: 10000px;
|
|
295
302
|
content: '';
|
|
296
303
|
left: 0;
|
|
297
304
|
opacity: 0;
|
|
@@ -323,7 +330,8 @@ export const focus = (options) => {
|
|
|
323
330
|
@media (prefers-reduced-motion) {
|
|
324
331
|
.switch,
|
|
325
332
|
.thumb,
|
|
326
|
-
.thumb::after
|
|
333
|
+
.thumb::after,
|
|
334
|
+
label {
|
|
327
335
|
transition: none;
|
|
328
336
|
}
|
|
329
337
|
}
|
package/Switch.svelte.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ declare const __propDef: {
|
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
checked?: boolean | undefined;
|
|
6
|
-
colorful?: boolean | undefined;
|
|
7
6
|
disabled?: boolean | undefined;
|
|
8
|
-
|
|
9
|
-
onText?: string | undefined;
|
|
7
|
+
colorful?: boolean | undefined;
|
|
10
8
|
offText?: string | undefined;
|
|
9
|
+
onText?: string | undefined;
|
|
10
|
+
vertical?: boolean | undefined;
|
|
11
11
|
blur?: (() => void) | undefined;
|
|
12
12
|
click?: (() => void) | undefined;
|
|
13
13
|
focus?: ((options?: FocusOptions) => void) | undefined;
|
package/Tab.svelte
CHANGED
|
@@ -145,11 +145,12 @@ export const focus = (options) => {
|
|
|
145
145
|
|
|
146
146
|
.sterling-tab::after {
|
|
147
147
|
background: repeating-linear-gradient(
|
|
148
|
-
|
|
149
|
-
var(--stsv-
|
|
150
|
-
var(--stsv-
|
|
151
|
-
var(--stsv-
|
|
152
|
-
var(--stsv-
|
|
148
|
+
var(--stsv-common--disabled__stripe-angle),
|
|
149
|
+
var(--stsv-common--disabled__stripe-color),
|
|
150
|
+
var(--stsv-common--disabled__stripe-color) var(--stsv-common--disabled__stripe-width),
|
|
151
|
+
var(--stsv-common--disabled__stripe-color--alt) var(--stsv-common--disabled__stripe-width),
|
|
152
|
+
var(--stsv-common--disabled__stripe-color--alt)
|
|
153
|
+
calc(2 * var(--stsv-common--disabled__stripe-width))
|
|
153
154
|
);
|
|
154
155
|
bottom: 0;
|
|
155
156
|
content: '';
|
package/Tab.svelte.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* When true, the tab is disabled.
|
|
6
|
+
* The tab is also disabled if the tab list is disabled.
|
|
7
|
+
*/ disabled?: boolean | undefined;
|
|
8
|
+
/** When true, the tab is selected. */ selected?: boolean | undefined;
|
|
9
|
+
/** The text of the tab when the default slot is not replaced. */ text?: string | undefined;
|
|
10
|
+
/** The value uniquely identifying this item within the tab list. */ value: string;
|
|
8
11
|
click?: (() => void) | undefined;
|
|
9
12
|
blur?: (() => void) | undefined;
|
|
10
13
|
focus?: ((options?: FocusOptions) => void) | undefined;
|
package/TabList.svelte
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script>import { createEventDispatcher, setContext } from "svelte";
|
|
2
2
|
import { writable } from "svelte/store";
|
|
3
3
|
import { TAB_LIST_CONTEXT_KEY } from "./TabList.constants";
|
|
4
|
-
import { usingKeyboard } from "./stores/usingKeyboard";
|
|
5
4
|
export let colorful = false;
|
|
6
5
|
export let disabled = false;
|
|
7
6
|
export let vertical = false;
|
package/TextArea.svelte
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script>import { onMount } from "svelte";
|
|
2
|
+
export let disabled = false;
|
|
3
|
+
export let value = "";
|
|
2
4
|
export let autoHeight = false;
|
|
3
5
|
export let colorful = false;
|
|
4
|
-
export let disabled = false;
|
|
5
6
|
export let resize = "none";
|
|
6
|
-
export let value = "";
|
|
7
7
|
let textAreaRef;
|
|
8
8
|
const autoSetHeight = () => {
|
|
9
9
|
if (autoHeight && textAreaRef) {
|
|
@@ -158,11 +158,12 @@ export const setRangeText = (replacement, start, end, selectionMode) => {
|
|
|
158
158
|
|
|
159
159
|
.sterling-text-area::after {
|
|
160
160
|
background: repeating-linear-gradient(
|
|
161
|
-
|
|
162
|
-
var(--stsv-
|
|
163
|
-
var(--stsv-
|
|
164
|
-
var(--stsv-
|
|
165
|
-
var(--stsv-
|
|
161
|
+
var(--stsv-common--disabled__stripe-angle),
|
|
162
|
+
var(--stsv-common--disabled__stripe-color),
|
|
163
|
+
var(--stsv-common--disabled__stripe-color) var(--stsv-common--disabled__stripe-width),
|
|
164
|
+
var(--stsv-common--disabled__stripe-color--alt) var(--stsv-common--disabled__stripe-width),
|
|
165
|
+
var(--stsv-common--disabled__stripe-color--alt)
|
|
166
|
+
calc(2 * var(--stsv-common--disabled__stripe-width))
|
|
166
167
|
);
|
|
167
168
|
bottom: 0;
|
|
168
169
|
content: '';
|
package/TextArea.svelte.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
value?: string | undefined;
|
|
5
7
|
autoHeight?: boolean | undefined;
|
|
6
8
|
colorful?: boolean | undefined;
|
|
7
|
-
disabled?: boolean | undefined;
|
|
8
9
|
resize?: "none" | "vertical" | "horizontal" | "both" | undefined;
|
|
9
|
-
value?: string | undefined;
|
|
10
10
|
blur?: (() => void) | undefined;
|
|
11
11
|
click?: (() => void) | undefined;
|
|
12
12
|
focus?: ((options?: FocusOptions) => void) | undefined;
|
package/Tooltip.svelte
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import { arrow, autoUpdate, computePosition, flip, offset } from "@floating-ui/dom";
|
|
1
|
+
<script>import { arrow, autoUpdate, computePosition, flip, offset } from "@floating-ui/dom";
|
|
3
2
|
import { onMount } from "svelte";
|
|
4
3
|
import { fade } from "svelte/transition";
|
|
4
|
+
import { portal } from "./actions/portal";
|
|
5
|
+
import { prefersReducedMotion } from "./stores/prefersReducedMotion";
|
|
5
6
|
export let disabled = false;
|
|
6
|
-
export let showOn =
|
|
7
|
+
export let showOn = "hover";
|
|
7
8
|
export let hoverDelayMilliseconds = 1e3;
|
|
8
9
|
export let open = false;
|
|
9
10
|
export let placement = "top";
|
|
@@ -133,6 +134,11 @@ const autoShowUpdate = () => {
|
|
|
133
134
|
};
|
|
134
135
|
$:
|
|
135
136
|
reference, showOn, autoShowUpdate();
|
|
137
|
+
const fadeNoOp = (node, params) => {
|
|
138
|
+
return { delay: 0, duration: 0 };
|
|
139
|
+
};
|
|
140
|
+
$:
|
|
141
|
+
fadeMotion = !$prefersReducedMotion ? fade : fadeNoOp;
|
|
136
142
|
let mounted = false;
|
|
137
143
|
onMount(() => {
|
|
138
144
|
mounted = true;
|
|
@@ -150,9 +156,45 @@ onMount(() => {
|
|
|
150
156
|
<div
|
|
151
157
|
class="sterling-tooltip-portal"
|
|
152
158
|
use:portal={{ target: document.body }}
|
|
153
|
-
transition:
|
|
159
|
+
transition:fadeMotion={{ duration: 250 }}
|
|
154
160
|
>
|
|
155
|
-
<div
|
|
161
|
+
<div
|
|
162
|
+
bind:this={tooltipRef}
|
|
163
|
+
class="sterling-tooltip"
|
|
164
|
+
style={tipStyle}
|
|
165
|
+
on:blur
|
|
166
|
+
on:click
|
|
167
|
+
on:dblclick
|
|
168
|
+
on:dragend
|
|
169
|
+
on:dragenter
|
|
170
|
+
on:dragleave
|
|
171
|
+
on:dragover
|
|
172
|
+
on:dragstart
|
|
173
|
+
on:drop
|
|
174
|
+
on:focus
|
|
175
|
+
on:focusin
|
|
176
|
+
on:focusout
|
|
177
|
+
on:keydown
|
|
178
|
+
on:keypress
|
|
179
|
+
on:keyup
|
|
180
|
+
on:mousedown
|
|
181
|
+
on:mouseenter
|
|
182
|
+
on:mouseleave
|
|
183
|
+
on:mousemove
|
|
184
|
+
on:mouseover
|
|
185
|
+
on:mouseout
|
|
186
|
+
on:mouseup
|
|
187
|
+
on:pointercancel
|
|
188
|
+
on:pointerdown
|
|
189
|
+
on:pointerenter
|
|
190
|
+
on:pointerleave
|
|
191
|
+
on:pointermove
|
|
192
|
+
on:pointerover
|
|
193
|
+
on:pointerout
|
|
194
|
+
on:pointerup
|
|
195
|
+
on:wheel|passive
|
|
196
|
+
{...$$restProps}
|
|
197
|
+
>
|
|
156
198
|
<div class="arrow" bind:this={arrowRef} style={arrowStyle} />
|
|
157
199
|
<slot name="tip" />
|
|
158
200
|
</div>
|
package/Tooltip.svelte.d.ts
CHANGED
|
@@ -1,15 +1,47 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { TooltipShowOn } from './Tooltip.types';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
5
|
disabled?: boolean | undefined;
|
|
6
|
-
showOn?:
|
|
6
|
+
showOn?: string | undefined;
|
|
7
7
|
hoverDelayMilliseconds?: number | undefined;
|
|
8
8
|
open?: boolean | undefined;
|
|
9
9
|
placement?: import("@floating-ui/core").Placement | undefined;
|
|
10
10
|
portalTarget?: HTMLElement | undefined;
|
|
11
11
|
};
|
|
12
12
|
events: {
|
|
13
|
+
blur: FocusEvent;
|
|
14
|
+
click: MouseEvent;
|
|
15
|
+
dblclick: MouseEvent;
|
|
16
|
+
dragend: DragEvent;
|
|
17
|
+
dragenter: DragEvent;
|
|
18
|
+
dragleave: DragEvent;
|
|
19
|
+
dragover: DragEvent;
|
|
20
|
+
dragstart: DragEvent;
|
|
21
|
+
drop: DragEvent;
|
|
22
|
+
focus: FocusEvent;
|
|
23
|
+
focusin: FocusEvent;
|
|
24
|
+
focusout: FocusEvent;
|
|
25
|
+
keydown: KeyboardEvent;
|
|
26
|
+
keypress: KeyboardEvent;
|
|
27
|
+
keyup: KeyboardEvent;
|
|
28
|
+
mousedown: MouseEvent;
|
|
29
|
+
mouseenter: MouseEvent;
|
|
30
|
+
mouseleave: MouseEvent;
|
|
31
|
+
mousemove: MouseEvent;
|
|
32
|
+
mouseover: MouseEvent;
|
|
33
|
+
mouseout: MouseEvent;
|
|
34
|
+
mouseup: MouseEvent;
|
|
35
|
+
pointercancel: PointerEvent;
|
|
36
|
+
pointerdown: PointerEvent;
|
|
37
|
+
pointerenter: PointerEvent;
|
|
38
|
+
pointerleave: PointerEvent;
|
|
39
|
+
pointermove: PointerEvent;
|
|
40
|
+
pointerover: PointerEvent;
|
|
41
|
+
pointerout: PointerEvent;
|
|
42
|
+
pointerup: PointerEvent;
|
|
43
|
+
wheel: WheelEvent;
|
|
44
|
+
} & {
|
|
13
45
|
[evt: string]: CustomEvent<any>;
|
|
14
46
|
};
|
|
15
47
|
slots: {
|
package/Tree.svelte
CHANGED
|
@@ -155,11 +155,12 @@ setContext(TREE_CONTEXT_KEY, {
|
|
|
155
155
|
|
|
156
156
|
.container::after {
|
|
157
157
|
background: repeating-linear-gradient(
|
|
158
|
-
|
|
159
|
-
var(--stsv-
|
|
160
|
-
var(--stsv-
|
|
161
|
-
var(--stsv-
|
|
162
|
-
var(--stsv-
|
|
158
|
+
var(--stsv-common--disabled__stripe-angle),
|
|
159
|
+
var(--stsv-common--disabled__stripe-color),
|
|
160
|
+
var(--stsv-common--disabled__stripe-color) var(--stsv-common--disabled__stripe-width),
|
|
161
|
+
var(--stsv-common--disabled__stripe-color--alt) var(--stsv-common--disabled__stripe-width),
|
|
162
|
+
var(--stsv-common--disabled__stripe-color--alt)
|
|
163
|
+
calc(2 * var(--stsv-common--disabled__stripe-width))
|
|
163
164
|
);
|
|
164
165
|
bottom: 0;
|
|
165
166
|
content: '';
|
package/Tree.types.d.ts
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import type { Readable, Writable } from 'svelte/store';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* The context for a Tree and its descendants.
|
|
4
4
|
*/
|
|
5
5
|
export type TreeContext = {
|
|
6
|
+
/** When true, applies colorful theme styles. */
|
|
6
7
|
colorful: Readable<boolean>;
|
|
7
|
-
/**
|
|
8
|
+
/** When true, the tree and its descendants are disabled */
|
|
8
9
|
disabled: Readable<boolean>;
|
|
9
|
-
/**
|
|
10
|
-
* The values of the expanded tree tree items.
|
|
11
|
-
*/
|
|
10
|
+
/** The values of items that are expanded. */
|
|
12
11
|
expandedValues: Writable<string[]>;
|
|
13
|
-
/**
|
|
14
|
-
* The value of the selected tree item.
|
|
15
|
-
*/
|
|
12
|
+
/** The value of the currently selected item. */
|
|
16
13
|
selectedValue: Writable<string | undefined>;
|
|
17
14
|
};
|
package/TreeItem.svelte
CHANGED
|
@@ -5,7 +5,7 @@ import TreeItemDisplay from "./TreeItemDisplay.svelte";
|
|
|
5
5
|
import { readable, writable } from "svelte/store";
|
|
6
6
|
import { prefersReducedMotion } from "./stores/prefersReducedMotion";
|
|
7
7
|
export let disabled = false;
|
|
8
|
-
export let
|
|
8
|
+
export let text = void 0;
|
|
9
9
|
export let value;
|
|
10
10
|
const slidNoOp = (node, params) => {
|
|
11
11
|
return { delay: 0, duration: 0 };
|
|
@@ -323,7 +323,7 @@ A item in a Tree displaying the item and children.
|
|
|
323
323
|
{expanded}
|
|
324
324
|
{hasChildren}
|
|
325
325
|
{selected}
|
|
326
|
-
{value}>{
|
|
326
|
+
{value}>{text || value}</slot
|
|
327
327
|
>
|
|
328
328
|
</svelte:fragment>
|
|
329
329
|
</TreeItemDisplay>
|
package/TreeItem.svelte.d.ts
CHANGED
package/TreeItem.types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Readable } from 'svelte/store';
|
|
2
2
|
/**
|
|
3
|
-
* The context for a tree item.
|
|
3
|
+
* The context for a tree item and its descendants.
|
|
4
4
|
*/
|
|
5
5
|
export type TreeItemContext = {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* The depth of this tree item within the tree hierarchy.
|
|
8
|
+
* Starts at zero.
|
|
9
9
|
*/
|
|
10
10
|
depth: number;
|
|
11
|
-
/**
|
|
11
|
+
/** When true, the three item is disabled. */
|
|
12
12
|
disabled: Readable<boolean>;
|
|
13
13
|
};
|
package/TreeItemDisplay.svelte
CHANGED
|
@@ -7,8 +7,8 @@ export let depth = 0;
|
|
|
7
7
|
export let disabled = false;
|
|
8
8
|
export let expanded = false;
|
|
9
9
|
export let hasChildren = false;
|
|
10
|
-
export let value;
|
|
11
10
|
export let selected = false;
|
|
11
|
+
export let value;
|
|
12
12
|
const { disabled: treeDisabled } = getContext(TREE_CONTEXT_KEY) || {
|
|
13
13
|
disabled: readable(false)
|
|
14
14
|
};
|
|
@@ -117,11 +117,12 @@ export const focus = (options) => {
|
|
|
117
117
|
|
|
118
118
|
.sterling-tree-item-display::after {
|
|
119
119
|
background: repeating-linear-gradient(
|
|
120
|
-
|
|
121
|
-
var(--stsv-
|
|
122
|
-
var(--stsv-
|
|
123
|
-
var(--stsv-
|
|
124
|
-
var(--stsv-
|
|
120
|
+
var(--stsv-common--disabled__stripe-angle),
|
|
121
|
+
var(--stsv-common--disabled__stripe-color),
|
|
122
|
+
var(--stsv-common--disabled__stripe-color) var(--stsv-common--disabled__stripe-width),
|
|
123
|
+
var(--stsv-common--disabled__stripe-color--alt) var(--stsv-common--disabled__stripe-width),
|
|
124
|
+
var(--stsv-common--disabled__stripe-color--alt)
|
|
125
|
+
calc(2 * var(--stsv-common--disabled__stripe-width))
|
|
125
126
|
);
|
|
126
127
|
bottom: 0;
|
|
127
128
|
content: '';
|
|
@@ -7,8 +7,8 @@ declare const __propDef: {
|
|
|
7
7
|
disabled?: boolean | undefined;
|
|
8
8
|
expanded?: boolean | undefined;
|
|
9
9
|
hasChildren?: boolean | undefined;
|
|
10
|
-
value: string;
|
|
11
10
|
selected?: boolean | undefined;
|
|
11
|
+
value: string;
|
|
12
12
|
click?: (() => void) | undefined;
|
|
13
13
|
blur?: (() => void) | undefined;
|
|
14
14
|
focus?: ((options?: FocusOptions) => void) | undefined;
|
package/index.d.ts
CHANGED
|
@@ -12,40 +12,39 @@ export { lightTheme } from './theme/lightTheme';
|
|
|
12
12
|
export { neutralColors, lightStatusColors, darkStatusColors, blueColors as blueAccentColors } from './theme/colors';
|
|
13
13
|
export { toggleDarkTheme } from './theme/toggleDarkTheme';
|
|
14
14
|
export type { ButtonVariant, ButtonShape } from './Button.types';
|
|
15
|
-
export type {
|
|
15
|
+
export type { LabelStatus } from './Label.types';
|
|
16
16
|
export type { FloatingPlacement, FloatingOffsetOptions } from './floating-ui.types';
|
|
17
17
|
export type { LinkVariant } from './Link.types';
|
|
18
18
|
export type { ListContext } from './List.types';
|
|
19
19
|
export type { MenuBarContext } from './MenuBar.types';
|
|
20
20
|
export type { MenuItemContext, MenuItemRegistration, MenuItemRole } from './MenuItem.types';
|
|
21
|
-
export type {
|
|
21
|
+
export type { ProgressStatus } from './Progress.types';
|
|
22
22
|
export type { TabListContext } from './TabList.types';
|
|
23
23
|
export type { TextAreaResize } from './TextArea.types';
|
|
24
24
|
export type { TooltipShowOn } from './Tooltip.types';
|
|
25
25
|
export type { TreeContext } from './Tree.types';
|
|
26
26
|
export type { TreeItemContext } from './TreeItem.types';
|
|
27
27
|
export { BUTTON_SHAPES, BUTTON_VARIANTS } from './Button.constants';
|
|
28
|
-
export {
|
|
28
|
+
export { LABEL_STATUSES } from './Label.constants';
|
|
29
29
|
export { FLOATING_PLACEMENTS } from './floating-ui.constants';
|
|
30
30
|
export { LINK_VARIANTS } from './Link.constants';
|
|
31
31
|
export { LIST_CONTEXT_KEY } from './List.constants';
|
|
32
32
|
export { MENU_BAR_CONTEXT_KEY } from './MenuBar.constants';
|
|
33
33
|
export { MENU_ITEM_CONTEXT_KEY, MENU_ITEM_ROLES } from './MenuItem.constants';
|
|
34
|
-
export {
|
|
34
|
+
export { PROGRESS_STATUSES } from './Progress.constants';
|
|
35
35
|
export { TAB_LIST_CONTEXT_KEY } from './TabList.constants';
|
|
36
36
|
export { TEXT_AREA_RESIZES } from './TextArea.constants';
|
|
37
37
|
export { TOOLTIP_SHOW_ONS } from './Tooltip.constants';
|
|
38
|
-
export { TREE_CONTEXT_KEY
|
|
38
|
+
export { TREE_CONTEXT_KEY, TREE_ITEM_CONTEXT_KEY } from './Tree.constants';
|
|
39
39
|
import Button from './Button.svelte';
|
|
40
40
|
import Checkbox from './Checkbox.svelte';
|
|
41
41
|
import ColorPicker from './ColorPicker.svelte';
|
|
42
42
|
import Dialog from './Dialog.svelte';
|
|
43
43
|
import Dropdown from './Dropdown.svelte';
|
|
44
|
-
import
|
|
44
|
+
import Label from './Label.svelte';
|
|
45
45
|
import HexColorSliders from './HexColorSliders.svelte';
|
|
46
46
|
import HslColorSliders from './HslColorSliders.svelte';
|
|
47
47
|
import Input from './Input.svelte';
|
|
48
|
-
import Label from './Label.svelte';
|
|
49
48
|
import Link from './Link.svelte';
|
|
50
49
|
import List from './List.svelte';
|
|
51
50
|
import ListItem from './ListItem.svelte';
|
|
@@ -70,4 +69,4 @@ import Tree from './Tree.svelte';
|
|
|
70
69
|
import TreeChevron from './TreeChevron.svelte';
|
|
71
70
|
import TreeItem from './TreeItem.svelte';
|
|
72
71
|
import TreeItemDisplay from './TreeItemDisplay.svelte';
|
|
73
|
-
export { Button, Checkbox, ColorPicker, Dialog, Dropdown,
|
|
72
|
+
export { Button, 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 };
|