@geoffcox/sterling-svelte 0.0.27 → 0.0.28
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 +0 -4
- 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/index.js
CHANGED
|
@@ -16,28 +16,27 @@ export { neutralColors, lightStatusColors, darkStatusColors, blueColors as blueA
|
|
|
16
16
|
export { toggleDarkTheme } from './theme/toggleDarkTheme';
|
|
17
17
|
// ----- Component constants ----- //
|
|
18
18
|
export { BUTTON_SHAPES, BUTTON_VARIANTS } from './Button.constants';
|
|
19
|
-
export {
|
|
19
|
+
export { LABEL_STATUSES } from './Label.constants';
|
|
20
20
|
export { FLOATING_PLACEMENTS } from './floating-ui.constants';
|
|
21
21
|
export { LINK_VARIANTS } from './Link.constants';
|
|
22
22
|
export { LIST_CONTEXT_KEY } from './List.constants';
|
|
23
23
|
export { MENU_BAR_CONTEXT_KEY } from './MenuBar.constants';
|
|
24
24
|
export { MENU_ITEM_CONTEXT_KEY, MENU_ITEM_ROLES } from './MenuItem.constants';
|
|
25
|
-
export {
|
|
25
|
+
export { PROGRESS_STATUSES } from './Progress.constants';
|
|
26
26
|
export { TAB_LIST_CONTEXT_KEY } from './TabList.constants';
|
|
27
27
|
export { TEXT_AREA_RESIZES } from './TextArea.constants';
|
|
28
28
|
export { TOOLTIP_SHOW_ONS } from './Tooltip.constants';
|
|
29
|
-
export { TREE_CONTEXT_KEY
|
|
29
|
+
export { TREE_CONTEXT_KEY, TREE_ITEM_CONTEXT_KEY } from './Tree.constants';
|
|
30
30
|
// ----- Components ----- //
|
|
31
31
|
import Button from './Button.svelte';
|
|
32
32
|
import Checkbox from './Checkbox.svelte';
|
|
33
33
|
import ColorPicker from './ColorPicker.svelte';
|
|
34
34
|
import Dialog from './Dialog.svelte';
|
|
35
35
|
import Dropdown from './Dropdown.svelte';
|
|
36
|
-
import
|
|
36
|
+
import Label from './Label.svelte';
|
|
37
37
|
import HexColorSliders from './HexColorSliders.svelte';
|
|
38
38
|
import HslColorSliders from './HslColorSliders.svelte';
|
|
39
39
|
import Input from './Input.svelte';
|
|
40
|
-
import Label from './Label.svelte';
|
|
41
40
|
import Link from './Link.svelte';
|
|
42
41
|
import List from './List.svelte';
|
|
43
42
|
import ListItem from './ListItem.svelte';
|
|
@@ -62,4 +61,4 @@ import Tree from './Tree.svelte';
|
|
|
62
61
|
import TreeChevron from './TreeChevron.svelte';
|
|
63
62
|
import TreeItem from './TreeItem.svelte';
|
|
64
63
|
import TreeItemDisplay from './TreeItemDisplay.svelte';
|
|
65
|
-
export { Button, Checkbox, ColorPicker, Dialog, Dropdown,
|
|
64
|
+
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geoffcox/sterling-svelte",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"author": "Geoff Cox",
|
|
5
5
|
"description": "A modern, accessible, and lightweight component library for Svelte.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,13 +60,12 @@
|
|
|
60
60
|
"./ColorPicker.types": "./ColorPicker.types.js",
|
|
61
61
|
"./Dialog.svelte": "./Dialog.svelte",
|
|
62
62
|
"./Dropdown.svelte": "./Dropdown.svelte",
|
|
63
|
-
"./Field.constants": "./Field.constants.js",
|
|
64
|
-
"./Field.svelte": "./Field.svelte",
|
|
65
|
-
"./Field.types": "./Field.types.js",
|
|
66
63
|
"./HexColorSliders.svelte": "./HexColorSliders.svelte",
|
|
67
64
|
"./HslColorSliders.svelte": "./HslColorSliders.svelte",
|
|
68
65
|
"./Input.svelte": "./Input.svelte",
|
|
66
|
+
"./Label.constants": "./Label.constants.js",
|
|
69
67
|
"./Label.svelte": "./Label.svelte",
|
|
68
|
+
"./Label.types": "./Label.types.js",
|
|
70
69
|
"./Link.constants": "./Link.constants.js",
|
|
71
70
|
"./Link.svelte": "./Link.svelte",
|
|
72
71
|
"./Link.types": "./Link.types.js",
|
package/theme/darkTheme.js
CHANGED
|
@@ -19,11 +19,10 @@ export const darkTheme = {
|
|
|
19
19
|
'stsv-common__outline-style': 'solid',
|
|
20
20
|
'stsv-common__outline-width': '2px',
|
|
21
21
|
// disabled
|
|
22
|
-
'stsv-
|
|
23
|
-
'stsv-
|
|
24
|
-
'stsv-
|
|
25
|
-
'stsv-
|
|
26
|
-
'stsv-common__background-color2--disabled': `hsla(0, 0%, 100%, 0.2)`,
|
|
22
|
+
'stsv-common--disabled__stripe-color': 'hsla(0, 0%, 0%, 0.2)',
|
|
23
|
+
'stsv-common--disabled__stripe-color--alt': `hsla(0, 0%, 100%, 0.2)`,
|
|
24
|
+
'stsv-common--disabled__stripe-angle': '135deg',
|
|
25
|
+
'stsv-common--disabled__stripe-width': '3px',
|
|
27
26
|
// ----- Common--colorful (15) ---- //
|
|
28
27
|
'stsv-common--colorful__background-color': blueColors.color1,
|
|
29
28
|
'stsv-common--colorful__border-color': blueColors.color8,
|
|
@@ -114,9 +113,9 @@ export const darkTheme = {
|
|
|
114
113
|
'stsv-status--warning__background-color': darkStatusColors.warning.backgroundColor,
|
|
115
114
|
'stsv-status--warning__border-color': darkStatusColors.warning.borderColor,
|
|
116
115
|
'stsv-status--warning__color': darkStatusColors.warning.color,
|
|
117
|
-
'stsv-status--
|
|
118
|
-
'stsv-status--
|
|
119
|
-
'stsv-status--
|
|
116
|
+
'stsv-status--danger__background-color': darkStatusColors.error.backgroundColor,
|
|
117
|
+
'stsv-status--danger__border-color': darkStatusColors.error.borderColor,
|
|
118
|
+
'stsv-status--danger__color': darkStatusColors.error.color,
|
|
120
119
|
// ----- Colorful (18) ---- //
|
|
121
120
|
'stsv-Colorful__background-color': blueColors.color4,
|
|
122
121
|
'stsv-Colorful__border-color': blueColors.color8,
|
package/theme/lightTheme.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { blueColors, lightStatusColors, neutralColors } from './colors';
|
|
2
2
|
export const lightTheme = {
|
|
3
|
-
// ----- Common
|
|
3
|
+
// ----- Common ---- //
|
|
4
4
|
'stsv-common__background-color': neutralColors.color12,
|
|
5
5
|
'stsv-common__border-color': neutralColors.color5,
|
|
6
6
|
'stsv-common__border-radius': '0',
|
|
@@ -19,12 +19,11 @@ export const lightTheme = {
|
|
|
19
19
|
'stsv-common__outline-style': 'solid',
|
|
20
20
|
'stsv-common__outline-width': '2px',
|
|
21
21
|
// disabled
|
|
22
|
-
'stsv-
|
|
23
|
-
'stsv-
|
|
24
|
-
'stsv-
|
|
25
|
-
'stsv-
|
|
26
|
-
|
|
27
|
-
// ----- Common--colorful (15) ---- //
|
|
22
|
+
'stsv-common--disabled__stripe-color': 'hsla(0, 0%, 0%, 0.2)',
|
|
23
|
+
'stsv-common--disabled__stripe-color--alt': `hsla(0, 0%, 100%, 0.2)`,
|
|
24
|
+
'stsv-common--disabled__stripe-angle': '135deg',
|
|
25
|
+
'stsv-common--disabled__stripe-width': '3px',
|
|
26
|
+
// ----- Common--colorful ---- //
|
|
28
27
|
'stsv-common--colorful__background-color': blueColors.color12,
|
|
29
28
|
'stsv-common--colorful__border-color': blueColors.color4,
|
|
30
29
|
'stsv-common--colorful__color': blueColors.color3,
|
|
@@ -34,7 +33,7 @@ export const lightTheme = {
|
|
|
34
33
|
'stsv-common--colorful__color--subtle': blueColors.color7,
|
|
35
34
|
'stsv-common--colorful__background-color--faint': blueColors.color11,
|
|
36
35
|
'stsv-common--colorful__color--faint': blueColors.color9,
|
|
37
|
-
// ----- Button
|
|
36
|
+
// ----- Button ----- //
|
|
38
37
|
'stsv-button__background-color': neutralColors.color10,
|
|
39
38
|
'stsv-button__border-color': neutralColors.color5,
|
|
40
39
|
'stsv-button__border-radius': '8px',
|
|
@@ -53,7 +52,7 @@ export const lightTheme = {
|
|
|
53
52
|
'stsv-button__background-color--active': neutralColors.color8,
|
|
54
53
|
'stsv-button__border-color--active': neutralColors.color3,
|
|
55
54
|
'stsv-button__color--active': neutralColors.color1,
|
|
56
|
-
// ----- Button--colorful
|
|
55
|
+
// ----- Button--colorful ---- //
|
|
57
56
|
'stsv-button--colorful__background-color': blueColors.color6,
|
|
58
57
|
'stsv-button--colorful__border-color': blueColors.color4,
|
|
59
58
|
'stsv-button--colorful__color': blueColors.color11,
|
|
@@ -69,7 +68,7 @@ export const lightTheme = {
|
|
|
69
68
|
'stsv-button--colorful__background-color--active': blueColors.color5,
|
|
70
69
|
'stsv-button--colorful__border-color--active': blueColors.color3,
|
|
71
70
|
'stsv-button--colorful__color--active': blueColors.color12,
|
|
72
|
-
// ----- Input
|
|
71
|
+
// ----- Input ----- //
|
|
73
72
|
'stsv-input__background-color': neutralColors.color11,
|
|
74
73
|
'stsv-input__border-color': neutralColors.color5,
|
|
75
74
|
'stsv-input__border-radius': '3px',
|
|
@@ -88,7 +87,7 @@ export const lightTheme = {
|
|
|
88
87
|
'stsv-input__background-color--selected': neutralColors.color9,
|
|
89
88
|
'stsv-input__border-color--selected': neutralColors.color3,
|
|
90
89
|
'stsv-input__color--selected': neutralColors.color2,
|
|
91
|
-
// ----- Input--colorful
|
|
90
|
+
// ----- Input--colorful ---- //
|
|
92
91
|
'stsv-input--colorful__background-color': blueColors.color11,
|
|
93
92
|
'stsv-input--colorful__border-color': blueColors.color4,
|
|
94
93
|
'stsv-input--colorful__color': blueColors.color2,
|
|
@@ -104,7 +103,7 @@ export const lightTheme = {
|
|
|
104
103
|
'stsv-input--colorful__background-color--selected': blueColors.color9,
|
|
105
104
|
'stsv-input--colorful__border-color--selected': blueColors.color3,
|
|
106
105
|
'stsv-input--colorful__color--selected': blueColors.color2,
|
|
107
|
-
// ----- Status
|
|
106
|
+
// ----- Status ----- //
|
|
108
107
|
'stsv-status--info__background-color': lightStatusColors.info.backgroundColor,
|
|
109
108
|
'stsv-status--info__border-color': lightStatusColors.info.borderColor,
|
|
110
109
|
'stsv-status--info__color': lightStatusColors.info.color,
|
|
@@ -114,7 +113,7 @@ export const lightTheme = {
|
|
|
114
113
|
'stsv-status--warning__background-color': lightStatusColors.warning.backgroundColor,
|
|
115
114
|
'stsv-status--warning__border-color': lightStatusColors.warning.borderColor,
|
|
116
115
|
'stsv-status--warning__color': lightStatusColors.warning.color,
|
|
117
|
-
'stsv-status--
|
|
118
|
-
'stsv-status--
|
|
119
|
-
'stsv-status--
|
|
116
|
+
'stsv-status--danger__background-color': lightStatusColors.error.backgroundColor,
|
|
117
|
+
'stsv-status--danger__border-color': lightStatusColors.error.borderColor,
|
|
118
|
+
'stsv-status--danger__color': lightStatusColors.error.color
|
|
120
119
|
};
|
package/Field.constants.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const FIELD_STATUSES: string[];
|
package/Field.constants.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const FIELD_STATUSES = ['none', 'info', 'success', 'warning', 'error'];
|
package/Field.svelte
DELETED
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
<script>import Tooltip from "./Tooltip.svelte";
|
|
2
|
-
import { usingKeyboard } from "./stores/usingKeyboard";
|
|
3
|
-
export let forwardClick = false;
|
|
4
|
-
let htmlFor = void 0;
|
|
5
|
-
export { htmlFor as for };
|
|
6
|
-
export let label = void 0;
|
|
7
|
-
export let message = void 0;
|
|
8
|
-
export let required = false;
|
|
9
|
-
export let requiredReason = "This field is required";
|
|
10
|
-
export let status = "none";
|
|
11
|
-
let fieldRef;
|
|
12
|
-
let targetDisabled = false;
|
|
13
|
-
let targetRef = null;
|
|
14
|
-
const findTarget = () => {
|
|
15
|
-
let candidate = null;
|
|
16
|
-
if (htmlFor) {
|
|
17
|
-
candidate = fieldRef?.querySelector(`[id="${htmlFor}"]`);
|
|
18
|
-
}
|
|
19
|
-
if (!candidate) {
|
|
20
|
-
candidate = fieldRef?.querySelector(
|
|
21
|
-
'a[href], audio[controls], button, details, div[contenteditable], form, input, select, textarea, video[controls], [tabindex]:not([tabindex="-1"])'
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
targetRef = candidate;
|
|
25
|
-
};
|
|
26
|
-
const isElementDisabled = (element) => {
|
|
27
|
-
if (element) {
|
|
28
|
-
return element.getAttribute("aria-disabled") === "true" || element?.matches(":disabled") || element?.disabled === true || element?.classList.contains("disabled");
|
|
29
|
-
}
|
|
30
|
-
return false;
|
|
31
|
-
};
|
|
32
|
-
$:
|
|
33
|
-
$$slots.default, fieldRef, htmlFor, findTarget();
|
|
34
|
-
$: {
|
|
35
|
-
targetDisabled = isElementDisabled(targetRef);
|
|
36
|
-
}
|
|
37
|
-
const mutationCallback = (mutations) => {
|
|
38
|
-
let disabled = void 0;
|
|
39
|
-
for (let i = 0; i < mutations.length; i++) {
|
|
40
|
-
const mutation = mutations[i];
|
|
41
|
-
if (mutation.type === "attributes") {
|
|
42
|
-
if (mutation.attributeName === "aria-disabled" || mutation.attributeName === "disabled" || mutation.attributeName === "class") {
|
|
43
|
-
if (isElementDisabled(targetRef)) {
|
|
44
|
-
disabled = true;
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
disabled = false;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (disabled !== void 0) {
|
|
52
|
-
targetDisabled = disabled;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
let mutationObserver = new MutationObserver(mutationCallback);
|
|
56
|
-
$: {
|
|
57
|
-
mutationObserver.disconnect();
|
|
58
|
-
if (targetRef) {
|
|
59
|
-
mutationObserver.observe(targetRef, {
|
|
60
|
-
attributes: true
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
export const click = () => {
|
|
65
|
-
fieldRef?.click();
|
|
66
|
-
};
|
|
67
|
-
export const blur = () => {
|
|
68
|
-
fieldRef?.blur();
|
|
69
|
-
};
|
|
70
|
-
export const focus = (options) => {
|
|
71
|
-
fieldRef?.focus(options);
|
|
72
|
-
};
|
|
73
|
-
const onClick = () => {
|
|
74
|
-
if (forwardClick) {
|
|
75
|
-
targetRef?.click();
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
</script>
|
|
79
|
-
|
|
80
|
-
<label
|
|
81
|
-
bind:this={fieldRef}
|
|
82
|
-
aria-disabled={targetDisabled}
|
|
83
|
-
class="sterling-field"
|
|
84
|
-
class:disabled={targetDisabled}
|
|
85
|
-
class:using-keyboard={$usingKeyboard}
|
|
86
|
-
for={htmlFor}
|
|
87
|
-
on:blur
|
|
88
|
-
on:click
|
|
89
|
-
on:click={onClick}
|
|
90
|
-
on:copy
|
|
91
|
-
on:cut
|
|
92
|
-
on:dblclick
|
|
93
|
-
on:dragend
|
|
94
|
-
on:dragenter
|
|
95
|
-
on:dragleave
|
|
96
|
-
on:dragover
|
|
97
|
-
on:dragstart
|
|
98
|
-
on:drop
|
|
99
|
-
on:focus
|
|
100
|
-
on:focusin
|
|
101
|
-
on:focusout
|
|
102
|
-
on:keydown
|
|
103
|
-
on:keypress
|
|
104
|
-
on:keyup
|
|
105
|
-
on:mousedown
|
|
106
|
-
on:mouseenter
|
|
107
|
-
on:mouseleave
|
|
108
|
-
on:mousemove
|
|
109
|
-
on:mouseover
|
|
110
|
-
on:mouseout
|
|
111
|
-
on:mouseup
|
|
112
|
-
on:scroll
|
|
113
|
-
on:wheel|passive
|
|
114
|
-
on:paste
|
|
115
|
-
{...$$restProps}
|
|
116
|
-
>
|
|
117
|
-
{#if label || $$slots.label}
|
|
118
|
-
<slot name="label" disabled={targetDisabled} for={htmlFor} {forwardClick} {label} {required}>
|
|
119
|
-
<div class="label-text">
|
|
120
|
-
{label}
|
|
121
|
-
</div>
|
|
122
|
-
</slot>
|
|
123
|
-
{/if}
|
|
124
|
-
{#if $$slots.default}
|
|
125
|
-
<div class="content">
|
|
126
|
-
<slot />
|
|
127
|
-
</div>
|
|
128
|
-
{/if}
|
|
129
|
-
{#if message}
|
|
130
|
-
<slot name="message" disabled={targetDisabled} {message} {required} {status}>
|
|
131
|
-
<div
|
|
132
|
-
class="message"
|
|
133
|
-
class:info={status === 'info'}
|
|
134
|
-
class:success={status === 'success'}
|
|
135
|
-
class:warning={status === 'warning'}
|
|
136
|
-
class:error={status === 'error'}
|
|
137
|
-
>
|
|
138
|
-
{message}
|
|
139
|
-
</div>
|
|
140
|
-
</slot>
|
|
141
|
-
{/if}
|
|
142
|
-
{#if required}
|
|
143
|
-
<slot name="required" requiredTip={requiredReason}>
|
|
144
|
-
<Tooltip showOn="hover">
|
|
145
|
-
<span class="required-tip" slot="tip">{requiredReason}</span>
|
|
146
|
-
<div class="required">*</div>
|
|
147
|
-
</Tooltip>
|
|
148
|
-
</slot>
|
|
149
|
-
{/if}
|
|
150
|
-
</label>
|
|
151
|
-
|
|
152
|
-
<style>
|
|
153
|
-
.sterling-field {
|
|
154
|
-
background-color: var(--stsv-input__background-color);
|
|
155
|
-
border-color: var(--stsv-input__border-color);
|
|
156
|
-
border-radius: var(--stsv-input__border-radius);
|
|
157
|
-
border-style: var(--stsv-input__border-style);
|
|
158
|
-
border-width: var(--stsv-input__border-width);
|
|
159
|
-
box-sizing: border-box;
|
|
160
|
-
color: var(--stsv-input__color);
|
|
161
|
-
display: flex;
|
|
162
|
-
flex-direction: column;
|
|
163
|
-
font: inherit;
|
|
164
|
-
margin: 0;
|
|
165
|
-
overflow: visible;
|
|
166
|
-
padding: 0;
|
|
167
|
-
position: relative;
|
|
168
|
-
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.sterling-field:not(.disabled):hover {
|
|
172
|
-
background-color: var(--stsv-input__background-color--hover);
|
|
173
|
-
border-color: var(--stsv-input__border-color--hover);
|
|
174
|
-
color: var(--stsv-input__color--hover);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.sterling-field.using-keyboard:focus-within {
|
|
178
|
-
border-color: var(--stsv-input__border-color--focus);
|
|
179
|
-
color: var(--stsv-input__color--focus);
|
|
180
|
-
outline-color: var(--stsv-common__outline-color);
|
|
181
|
-
outline-offset: var(--stsv-common__outline-offset);
|
|
182
|
-
outline-style: var(--stsv-common__outline-style);
|
|
183
|
-
outline-width: var(--stsv-common__outline-width);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.sterling-field.disabled {
|
|
187
|
-
cursor: not-allowed;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.sterling-field.disabled * {
|
|
191
|
-
cursor: not-allowed;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.label-text {
|
|
195
|
-
color: var(--stsv-common__color--secondary);
|
|
196
|
-
font-size: 0.8em;
|
|
197
|
-
margin: 0.5em 0.7em 0.2em 0.2em;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.label-text:empty {
|
|
201
|
-
margin: 0;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.content {
|
|
205
|
-
display: grid;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.message {
|
|
209
|
-
box-sizing: border-box;
|
|
210
|
-
font-size: 0.8em;
|
|
211
|
-
background-color: var(--stsv-common__background-color--secondary);
|
|
212
|
-
color: var(--stsv-common__color--secondary);
|
|
213
|
-
padding: 0.5em;
|
|
214
|
-
width: 100%;
|
|
215
|
-
transition: background-color 250ms, color 250ms, border-color 250ms;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.message.info {
|
|
219
|
-
background-color: var(--stsv-status--info__background-color);
|
|
220
|
-
border-color: var(--stsv-status--info__border-color);
|
|
221
|
-
color: var(--stsv-status--info__color);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.message.success {
|
|
225
|
-
background-color: var(--stsv-status--success__background-color);
|
|
226
|
-
border-color: var(--stsv-status--success__border-color);
|
|
227
|
-
color: var(--stsv-status--success__color);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.message.warning {
|
|
231
|
-
background-color: var(--stsv-status--warning__background-color);
|
|
232
|
-
border-color: var(--stsv-status--warning__border-color);
|
|
233
|
-
color: var(--stsv-status--warning__color);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.message.error {
|
|
237
|
-
background-color: var(--stsv-status--error__background-color);
|
|
238
|
-
border-color: var(--stsv_--error-color);
|
|
239
|
-
color: var(--stsv-status--error__color);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.required {
|
|
243
|
-
text-align: center;
|
|
244
|
-
font-weight: bold;
|
|
245
|
-
box-sizing: border-box;
|
|
246
|
-
width: 1em;
|
|
247
|
-
height: 1em;
|
|
248
|
-
position: absolute;
|
|
249
|
-
top: 0;
|
|
250
|
-
right: 0;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.required-tip {
|
|
254
|
-
display: block;
|
|
255
|
-
padding: 4px;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
@media (prefers-reduced-motion) {
|
|
259
|
-
.sterling-field,
|
|
260
|
-
.sterling-field::after,
|
|
261
|
-
.message {
|
|
262
|
-
transition: none;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
</style>
|
package/Field.svelte.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
forwardClick?: boolean | undefined;
|
|
6
|
-
for?: string | undefined;
|
|
7
|
-
label?: string | undefined;
|
|
8
|
-
message?: string | undefined;
|
|
9
|
-
required?: boolean | undefined;
|
|
10
|
-
requiredReason?: string | undefined;
|
|
11
|
-
status?: string | undefined;
|
|
12
|
-
click?: (() => void) | undefined;
|
|
13
|
-
blur?: (() => void) | undefined;
|
|
14
|
-
focus?: ((options?: FocusOptions) => void) | undefined;
|
|
15
|
-
};
|
|
16
|
-
events: {
|
|
17
|
-
blur: FocusEvent;
|
|
18
|
-
click: MouseEvent;
|
|
19
|
-
copy: ClipboardEvent;
|
|
20
|
-
cut: ClipboardEvent;
|
|
21
|
-
dblclick: MouseEvent;
|
|
22
|
-
dragend: DragEvent;
|
|
23
|
-
dragenter: DragEvent;
|
|
24
|
-
dragleave: DragEvent;
|
|
25
|
-
dragover: DragEvent;
|
|
26
|
-
dragstart: DragEvent;
|
|
27
|
-
drop: DragEvent;
|
|
28
|
-
focus: FocusEvent;
|
|
29
|
-
focusin: FocusEvent;
|
|
30
|
-
focusout: FocusEvent;
|
|
31
|
-
keydown: KeyboardEvent;
|
|
32
|
-
keypress: KeyboardEvent;
|
|
33
|
-
keyup: KeyboardEvent;
|
|
34
|
-
mousedown: MouseEvent;
|
|
35
|
-
mouseenter: MouseEvent;
|
|
36
|
-
mouseleave: MouseEvent;
|
|
37
|
-
mousemove: MouseEvent;
|
|
38
|
-
mouseover: MouseEvent;
|
|
39
|
-
mouseout: MouseEvent;
|
|
40
|
-
mouseup: MouseEvent;
|
|
41
|
-
scroll: Event;
|
|
42
|
-
wheel: WheelEvent;
|
|
43
|
-
paste: ClipboardEvent;
|
|
44
|
-
} & {
|
|
45
|
-
[evt: string]: CustomEvent<any>;
|
|
46
|
-
};
|
|
47
|
-
slots: {
|
|
48
|
-
label: {
|
|
49
|
-
disabled: boolean;
|
|
50
|
-
for: string | undefined;
|
|
51
|
-
forwardClick: boolean;
|
|
52
|
-
label: string | undefined;
|
|
53
|
-
required: boolean;
|
|
54
|
-
};
|
|
55
|
-
default: {};
|
|
56
|
-
message: {
|
|
57
|
-
disabled: boolean;
|
|
58
|
-
message: string | undefined;
|
|
59
|
-
required: boolean;
|
|
60
|
-
status: string;
|
|
61
|
-
};
|
|
62
|
-
required: {
|
|
63
|
-
requiredTip: string;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
export type FieldProps = typeof __propDef.props;
|
|
68
|
-
export type FieldEvents = typeof __propDef.events;
|
|
69
|
-
export type FieldSlots = typeof __propDef.slots;
|
|
70
|
-
export default class Field extends SvelteComponentTyped<FieldProps, FieldEvents, FieldSlots> {
|
|
71
|
-
get click(): () => void;
|
|
72
|
-
get blur(): () => void;
|
|
73
|
-
get focus(): (options?: FocusOptions | undefined) => void;
|
|
74
|
-
}
|
|
75
|
-
export {};
|
package/Field.types.d.ts
DELETED
|
File without changes
|