@rogieking/figui3 1.1.4 → 1.1.5
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/README.md +2 -2
- package/example.html +5 -3
- package/fig.js +8 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ The library includes the following components:
|
|
|
36
36
|
## Installation
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
npm install
|
|
39
|
+
npm install @rogieking/figui3
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
```jsx
|
|
@@ -74,7 +74,7 @@ or
|
|
|
74
74
|
|
|
75
75
|
## Documentation
|
|
76
76
|
|
|
77
|
-
For detailed documentation and examples, visit our [documentation site](https://
|
|
77
|
+
For detailed documentation and examples, visit our [documentation site](https://github.com/rogie/figui3#readme).
|
|
78
78
|
|
|
79
79
|
## Browser Support
|
|
80
80
|
|
package/example.html
CHANGED
|
@@ -471,9 +471,11 @@
|
|
|
471
471
|
size="large"></fig-chit>
|
|
472
472
|
</hstack>
|
|
473
473
|
<br />
|
|
474
|
-
<
|
|
475
|
-
<
|
|
476
|
-
|
|
474
|
+
<p>Some paragraph text here with a
|
|
475
|
+
<fig-tooltip text="Tooltip text">
|
|
476
|
+
<em>Tooltip</em>
|
|
477
|
+
</fig-tooltip> for more information.
|
|
478
|
+
</p>
|
|
477
479
|
<br /><br />
|
|
478
480
|
<hstack>
|
|
479
481
|
<input type="radio"
|
package/fig.js
CHANGED
|
@@ -1132,9 +1132,7 @@ class FigInputColor extends HTMLElement {
|
|
|
1132
1132
|
);
|
|
1133
1133
|
let html = ``;
|
|
1134
1134
|
if (this.getAttribute("text")) {
|
|
1135
|
-
let label = `<fig-input-text type="text" placeholder="Text" value="${this.
|
|
1136
|
-
"value"
|
|
1137
|
-
)}"></fig-input-text>`;
|
|
1135
|
+
let label = `<fig-input-text type="text" placeholder="Text" value="${this.value}"></fig-input-text>`;
|
|
1138
1136
|
if (this.getAttribute("alpha") === "true") {
|
|
1139
1137
|
label += `<fig-tooltip text="Opacity">
|
|
1140
1138
|
<fig-input-text
|
|
@@ -1254,9 +1252,12 @@ class FigInputColor extends HTMLElement {
|
|
|
1254
1252
|
switch (name) {
|
|
1255
1253
|
case "value":
|
|
1256
1254
|
if (this.textInput) {
|
|
1257
|
-
this.value =
|
|
1255
|
+
this.value =
|
|
1256
|
+
this.#swatch.value =
|
|
1257
|
+
this.textInput.value =
|
|
1258
|
+
newValue.toUpperCase();
|
|
1258
1259
|
} else {
|
|
1259
|
-
this.value = newValue;
|
|
1260
|
+
this.value = newValue.toUpperCase();
|
|
1260
1261
|
}
|
|
1261
1262
|
this.dispatchEvent(new CustomEvent("input", { bubbles: true }));
|
|
1262
1263
|
break;
|
|
@@ -1279,13 +1280,13 @@ class FigInputColor extends HTMLElement {
|
|
|
1279
1280
|
|
|
1280
1281
|
// If alpha is 1, return 6-digit hex
|
|
1281
1282
|
if (a === 1) {
|
|
1282
|
-
return `#${hexR}${hexG}${hexB}
|
|
1283
|
+
return `#${hexR}${hexG}${hexB}`.toUpperCase();
|
|
1283
1284
|
}
|
|
1284
1285
|
|
|
1285
1286
|
// Otherwise, include alpha in 8-digit hex
|
|
1286
1287
|
const alpha = Math.round(a * 255);
|
|
1287
1288
|
const hexA = alpha.toString(16).padStart(2, "0");
|
|
1288
|
-
return `#${hexR}${hexG}${hexB}${hexA}
|
|
1289
|
+
return `#${hexR}${hexG}${hexB}${hexA}`.toUpperCase();
|
|
1289
1290
|
}
|
|
1290
1291
|
|
|
1291
1292
|
convertToRGBA(color) {
|