@umbraco-ui/uui-color-swatch 1.3.0-rc.0 → 1.3.0-rc.1
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/custom-elements.json +9 -11
- package/lib/index.js +6 -7
- package/lib/uui-color-swatch.element.d.ts +3 -5
- package/package.json +5 -5
package/custom-elements.json
CHANGED
|
@@ -9,14 +9,13 @@
|
|
|
9
9
|
{
|
|
10
10
|
"name": "value",
|
|
11
11
|
"description": "Value of the swatch. Should be a valid hex, hexa, rgb, rgba, hsl or hsla string. Should fulfill this [css spec](https://www.w3.org/TR/css-color-4/#color-type). If not provided element will look at its text content.",
|
|
12
|
-
"type": "
|
|
13
|
-
"default": "\"\\\"\\\"\""
|
|
12
|
+
"type": "string"
|
|
14
13
|
},
|
|
15
14
|
{
|
|
16
15
|
"name": "disabled",
|
|
17
16
|
"description": "Determines if the options is disabled. If true the option can't be selected",
|
|
18
|
-
"type": "
|
|
19
|
-
"default": "
|
|
17
|
+
"type": "boolean",
|
|
18
|
+
"default": "false"
|
|
20
19
|
},
|
|
21
20
|
{
|
|
22
21
|
"name": "show-label",
|
|
@@ -57,15 +56,14 @@
|
|
|
57
56
|
"name": "value",
|
|
58
57
|
"attribute": "value",
|
|
59
58
|
"description": "Value of the swatch. Should be a valid hex, hexa, rgb, rgba, hsl or hsla string. Should fulfill this [css spec](https://www.w3.org/TR/css-color-4/#color-type). If not provided element will look at its text content.",
|
|
60
|
-
"type": "
|
|
61
|
-
"default": "\"\\\"\\\"\""
|
|
59
|
+
"type": "string"
|
|
62
60
|
},
|
|
63
61
|
{
|
|
64
62
|
"name": "disabled",
|
|
65
63
|
"attribute": "disabled",
|
|
66
64
|
"description": "Determines if the options is disabled. If true the option can't be selected",
|
|
67
|
-
"type": "
|
|
68
|
-
"default": "
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"default": "false"
|
|
69
67
|
},
|
|
70
68
|
{
|
|
71
69
|
"name": "showLabel",
|
|
@@ -77,7 +75,7 @@
|
|
|
77
75
|
{
|
|
78
76
|
"name": "color",
|
|
79
77
|
"description": "Colord object instance based on the value provided to the element. If the value is not a valid color, it falls back to black (like Amy Winehouse). For more information about Colord, see [Colord](https://omgovich.github.io/colord/)",
|
|
80
|
-
"type": "
|
|
78
|
+
"type": "Colord | null"
|
|
81
79
|
},
|
|
82
80
|
{
|
|
83
81
|
"name": "isLight",
|
|
@@ -117,8 +115,8 @@
|
|
|
117
115
|
"description": "fires when the media card is selected"
|
|
118
116
|
},
|
|
119
117
|
{
|
|
120
|
-
"name": "
|
|
121
|
-
"description": "fires when the media card is
|
|
118
|
+
"name": "deselected",
|
|
119
|
+
"description": "fires when the media card is deselected"
|
|
122
120
|
}
|
|
123
121
|
],
|
|
124
122
|
"slots": [
|
package/lib/index.js
CHANGED
|
@@ -43,7 +43,6 @@ let UUIColorSwatchElement = class extends LabelMixin(
|
|
|
43
43
|
/**
|
|
44
44
|
* Colord object instance based on the value provided to the element. If the value is not a valid color, it falls back to black (like Amy Winehouse). For more information about Colord, see [Colord](https://omgovich.github.io/colord/)
|
|
45
45
|
*
|
|
46
|
-
* @type {(Colord | null)}
|
|
47
46
|
* @memberof UUIColorSwatchElement
|
|
48
47
|
*/
|
|
49
48
|
get color() {
|
|
@@ -87,7 +86,7 @@ let UUIColorSwatchElement = class extends LabelMixin(
|
|
|
87
86
|
if (changedProperties.has("disabled")) {
|
|
88
87
|
if (this.selectable) {
|
|
89
88
|
this.selectable = !this.disabled;
|
|
90
|
-
this.
|
|
89
|
+
this.deselectable = !this.disabled;
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
92
|
if (changedProperties.has("selectable") || changedProperties.has("selected")) {
|
|
@@ -141,7 +140,7 @@ UUIColorSwatchElement.styles = [
|
|
|
141
140
|
:host(*),
|
|
142
141
|
* {
|
|
143
142
|
/* TODO: implement globally shared outline style */
|
|
144
|
-
outline-color: var(--uui-color-focus
|
|
143
|
+
outline-color: var(--uui-color-focus,#3879ff);
|
|
145
144
|
outline-offset: 4px;
|
|
146
145
|
}
|
|
147
146
|
|
|
@@ -150,7 +149,7 @@ UUIColorSwatchElement.styles = [
|
|
|
150
149
|
}
|
|
151
150
|
|
|
152
151
|
:host(:focus:not([disabled])) #swatch {
|
|
153
|
-
outline-color: var(--uui-color-focus
|
|
152
|
+
outline-color: var(--uui-color-focus,#3879ff);
|
|
154
153
|
outline-width: var(--uui-swatch-border-width, 1px);
|
|
155
154
|
outline-style: solid;
|
|
156
155
|
outline-offset: var(--uui-swatch-border-width, 1px);
|
|
@@ -187,9 +186,9 @@ UUIColorSwatchElement.styles = [
|
|
|
187
186
|
height: calc(100% + calc(var(--uui-swatch-border-width, 1px) * 2));
|
|
188
187
|
box-sizing: border-box;
|
|
189
188
|
border: var(--uui-swatch-border-width, 1px) solid
|
|
190
|
-
var(--uui-color-selected
|
|
189
|
+
var(--uui-color-selected,#3544b1);
|
|
191
190
|
border-radius: calc(
|
|
192
|
-
var(--uui-border-radius,
|
|
191
|
+
var(--uui-border-radius,3px) + var(--uui-swatch-border-width, 1px)
|
|
193
192
|
);
|
|
194
193
|
transition: opacity 100ms ease-out;
|
|
195
194
|
opacity: 0;
|
|
@@ -290,7 +289,7 @@ UUIColorSwatchElement.styles = [
|
|
|
290
289
|
`
|
|
291
290
|
];
|
|
292
291
|
__decorateClass([
|
|
293
|
-
property(
|
|
292
|
+
property()
|
|
294
293
|
], UUIColorSwatchElement.prototype, "value", 1);
|
|
295
294
|
__decorateClass([
|
|
296
295
|
property({ type: Boolean, reflect: true })
|
|
@@ -14,29 +14,27 @@ export declare class UUIColorSwatchElement extends UUIColorSwatchElement_base {
|
|
|
14
14
|
private _value;
|
|
15
15
|
/**
|
|
16
16
|
* Value of the swatch. Should be a valid hex, hexa, rgb, rgba, hsl or hsla string. Should fulfill this [css spec](https://www.w3.org/TR/css-color-4/#color-type). If not provided element will look at its text content.
|
|
17
|
-
*
|
|
17
|
+
*
|
|
18
18
|
* @attr
|
|
19
|
-
* @default ""
|
|
20
19
|
*/
|
|
21
20
|
get value(): string;
|
|
22
21
|
set value(newValue: string);
|
|
23
22
|
/**
|
|
24
23
|
* Determines if the options is disabled. If true the option can't be selected
|
|
25
|
-
*
|
|
24
|
+
*
|
|
26
25
|
* @attr
|
|
27
|
-
* @default false
|
|
28
26
|
*/
|
|
29
27
|
disabled: boolean;
|
|
30
28
|
/**
|
|
31
29
|
* When true shows element label below the color checkbox
|
|
32
30
|
*
|
|
31
|
+
* @attr
|
|
33
32
|
* @memberof UUIColorSwatchElement
|
|
34
33
|
*/
|
|
35
34
|
showLabel: boolean;
|
|
36
35
|
/**
|
|
37
36
|
* Colord object instance based on the value provided to the element. If the value is not a valid color, it falls back to black (like Amy Winehouse). For more information about Colord, see [Colord](https://omgovich.github.io/colord/)
|
|
38
37
|
*
|
|
39
|
-
* @type {(Colord | null)}
|
|
40
38
|
* @memberof UUIColorSwatchElement
|
|
41
39
|
*/
|
|
42
40
|
get color(): Colord | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-color-swatch",
|
|
3
|
-
"version": "1.3.0-rc.
|
|
3
|
+
"version": "1.3.0-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
"custom-elements.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@umbraco-ui/uui-base": "1.3.0-rc.
|
|
34
|
-
"@umbraco-ui/uui-icon-registry-essential": "1.3.0-rc.
|
|
33
|
+
"@umbraco-ui/uui-base": "1.3.0-rc.1",
|
|
34
|
+
"@umbraco-ui/uui-icon-registry-essential": "1.3.0-rc.1",
|
|
35
35
|
"colord": "^2.9.3"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
|
|
39
|
-
"clean": "tsc --build --clean && rimraf -g dist lib/*.js lib/**/*.js custom-elements.json",
|
|
39
|
+
"clean": "tsc --build --clean && rimraf -g dist lib/*.js lib/**/*.js *.tgz lib/**/*.d.ts custom-elements.json",
|
|
40
40
|
"analyze": "web-component-analyzer **/*.element.ts --outFile custom-elements.json"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-color-swatch",
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "0c517175884931aa0bc0d8f05974852a7704626e"
|
|
47
47
|
}
|