@umbraco-ui/uui-toggle 1.2.0 → 1.3.0-rc.0
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/lib/index.js +18 -14
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -28,6 +28,10 @@ let UUIToggleElement = class extends UUIBooleanInputElement {
|
|
|
28
28
|
`;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* This is a static class field indicating that the element is can be used inside a native form and participate in its events. It may require a polyfill, check support here https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals. Read more about form controls here https://web.dev/more-capable-form-controls/
|
|
33
|
+
* @type {boolean}
|
|
34
|
+
*/
|
|
31
35
|
UUIToggleElement.formAssociated = true;
|
|
32
36
|
UUIToggleElement.styles = [
|
|
33
37
|
...UUIBooleanInputElement.styles,
|
|
@@ -69,21 +73,21 @@ UUIToggleElement.styles = [
|
|
|
69
73
|
label:focus #slider {
|
|
70
74
|
border-color: var(
|
|
71
75
|
--uui-toggle-border-color-focus,
|
|
72
|
-
var(--uui-color-focus
|
|
76
|
+
var(--uui-color-focus,var(--uui-palette-malibu))
|
|
73
77
|
);
|
|
74
78
|
background-color: var(
|
|
75
79
|
--uui-toggle-background-color-focus,
|
|
76
|
-
var(--uui-color-surface-emphasis,
|
|
80
|
+
var(--uui-color-surface-emphasis,var(--uui-palette-white-dark))
|
|
77
81
|
);
|
|
78
82
|
}
|
|
79
83
|
input:checked ~ #slider {
|
|
80
|
-
background-color: var(--uui-color-selected
|
|
84
|
+
background-color: var(--uui-color-selected,var(--uui-palette-violet-blue));
|
|
81
85
|
}
|
|
82
86
|
label:hover input:checked:not([disabled]) ~ #slider {
|
|
83
|
-
background-color: var(--uui-color-selected-emphasis,
|
|
87
|
+
background-color: var(--uui-color-selected-emphasis,var(--uui-palette-violet-blue-light));
|
|
84
88
|
}
|
|
85
89
|
label:focus input:checked ~ #slider {
|
|
86
|
-
background-color: var(--uui-color-selected-emphasis,
|
|
90
|
+
background-color: var(--uui-color-selected-emphasis,var(--uui-palette-violet-blue-light));
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
#icon-check,
|
|
@@ -99,13 +103,13 @@ UUIToggleElement.styles = [
|
|
|
99
103
|
#icon-check {
|
|
100
104
|
margin-left: -0.5em;
|
|
101
105
|
left: calc(var(--uui-toggle-size) * 0.5);
|
|
102
|
-
fill: var(--uui-color-interactive
|
|
106
|
+
fill: var(--uui-color-interactive,var(--uui-palette-space-cadet));
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
#icon-wrong {
|
|
106
110
|
margin-right: -0.5em;
|
|
107
111
|
right: calc(var(--uui-toggle-size) * 0.5);
|
|
108
|
-
fill: var(--uui-color-interactive
|
|
112
|
+
fill: var(--uui-color-interactive,var(--uui-palette-space-cadet));
|
|
109
113
|
}
|
|
110
114
|
input:checked ~ #slider #icon-check {
|
|
111
115
|
fill: var(--uui-color-selected-contrast,#fff);
|
|
@@ -131,7 +135,7 @@ UUIToggleElement.styles = [
|
|
|
131
135
|
|
|
132
136
|
input:focus ~ #slider {
|
|
133
137
|
outline: calc(2px * var(--uui-show-focus-outline, 1)) solid
|
|
134
|
-
var(--uui-color-focus
|
|
138
|
+
var(--uui-color-focus,var(--uui-palette-malibu));
|
|
135
139
|
}
|
|
136
140
|
|
|
137
141
|
:host(:not([disabled])) label:active #slider::after {
|
|
@@ -140,22 +144,22 @@ UUIToggleElement.styles = [
|
|
|
140
144
|
}
|
|
141
145
|
|
|
142
146
|
:host([disabled]) #slider {
|
|
143
|
-
background-color: var(--uui-color-disabled-standalone,
|
|
147
|
+
background-color: var(--uui-color-disabled-standalone,var(--uui-palette-sand-dark));
|
|
144
148
|
}
|
|
145
149
|
:host([disabled]) input:checked ~ #slider {
|
|
146
|
-
background-color: var(--uui-color-disabled-contrast
|
|
150
|
+
background-color: var(--uui-color-disabled-contrast,var(--uui-palette-grey));
|
|
147
151
|
}
|
|
148
152
|
:host([disabled]) #slider::after {
|
|
149
|
-
background-color: var(--uui-color-disabled
|
|
153
|
+
background-color: var(--uui-color-disabled,var(--uui-palette-sand));
|
|
150
154
|
}
|
|
151
155
|
:host([disabled]) #slider #icon-wrong {
|
|
152
|
-
fill: var(--uui-color-disabled-contrast
|
|
156
|
+
fill: var(--uui-color-disabled-contrast,var(--uui-palette-grey));
|
|
153
157
|
}
|
|
154
158
|
:host([disabled]) label:active #slider {
|
|
155
159
|
animation: ${UUIHorizontalShakeAnimationValue};
|
|
156
160
|
}
|
|
157
161
|
:host([disabled]) input:checked #slider #icon-check {
|
|
158
|
-
fill: var(--uui-color-disabled-contrast
|
|
162
|
+
fill: var(--uui-color-disabled-contrast,var(--uui-palette-grey));
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
:host(:not([pristine]):invalid) #slider,
|
|
@@ -163,7 +167,7 @@ UUIToggleElement.styles = [
|
|
|
163
167
|
/* polyfill support */
|
|
164
168
|
:host(:not([pristine])[internals-invalid]) #slider,
|
|
165
169
|
:host(:not([pristine])[internals-invalid]) label:hover #slider {
|
|
166
|
-
border: 1px solid var(--uui-color-danger-standalone,
|
|
170
|
+
border: 1px solid var(--uui-color-danger-standalone,var(--uui-palette-maroon-flush-dark));
|
|
167
171
|
}
|
|
168
172
|
`
|
|
169
173
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-toggle",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
"custom-elements.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@umbraco-ui/uui-base": "1.
|
|
34
|
-
"@umbraco-ui/uui-boolean-input": "1.
|
|
33
|
+
"@umbraco-ui/uui-base": "1.3.0-rc.0",
|
|
34
|
+
"@umbraco-ui/uui-boolean-input": "1.3.0-rc.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
|
|
38
|
-
"clean": "tsc --build --clean && rimraf dist lib/*.js lib/**/*.js custom-elements.json",
|
|
38
|
+
"clean": "tsc --build --clean && rimraf -g dist lib/*.js lib/**/*.js custom-elements.json",
|
|
39
39
|
"analyze": "web-component-analyzer **/*.element.ts --outFile custom-elements.json"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-toggle",
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "45c3824056586d9817efb3f61dc0bef5478747f0"
|
|
46
46
|
}
|