@umbraco-ui/uui-color-swatch 1.2.1 → 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.
@@ -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": " string ",
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": " boolean ",
19
- "default": "\"false\""
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": " string ",
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": " boolean ",
68
- "default": "\"false\""
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": "(Colord | null)"
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": "unselected",
121
- "description": "fires when the media card is unselected"
118
+ "name": "deselected",
119
+ "description": "fires when the media card is deselected"
122
120
  }
123
121
  ],
124
122
  "slots": [
package/lib/index.js CHANGED
@@ -40,12 +40,23 @@ let UUIColorSwatchElement = class extends LabelMixin(
40
40
  this._value = newValue;
41
41
  this.requestUpdate("value", oldValue);
42
42
  }
43
+ /**
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
+ *
46
+ * @memberof UUIColorSwatchElement
47
+ */
43
48
  get color() {
44
49
  return this._color;
45
50
  }
46
51
  set color(_) {
47
52
  return;
48
53
  }
54
+ /**
55
+ * Returns true if the color brightness is >= 0.5
56
+ *
57
+ * @readonly
58
+ * @memberof UUIColorSwatchElement
59
+ */
49
60
  get isLight() {
50
61
  var _a, _b;
51
62
  return (_b = (_a = this.color) == null ? void 0 : _a.isLight()) != null ? _b : false;
@@ -75,7 +86,7 @@ let UUIColorSwatchElement = class extends LabelMixin(
75
86
  if (changedProperties.has("disabled")) {
76
87
  if (this.selectable) {
77
88
  this.selectable = !this.disabled;
78
- this.unselectable = !this.disabled;
89
+ this.deselectable = !this.disabled;
79
90
  }
80
91
  }
81
92
  if (changedProperties.has("selectable") || changedProperties.has("selected")) {
@@ -278,7 +289,7 @@ UUIColorSwatchElement.styles = [
278
289
  `
279
290
  ];
280
291
  __decorateClass([
281
- property({ type: String })
292
+ property()
282
293
  ], UUIColorSwatchElement.prototype, "value", 1);
283
294
  __decorateClass([
284
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
- * @type { string }
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
- * @type { boolean }
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.2.1",
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.2.1",
34
- "@umbraco-ui/uui-icon-registry-essential": "1.2.1",
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 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": "94eb22bee5ff21bac6fadbd78653671279bebe36"
46
+ "gitHead": "0c517175884931aa0bc0d8f05974852a7704626e"
47
47
  }