@rogieking/figui3 1.1.3 → 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.css +48 -42
- 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.css
CHANGED
|
@@ -422,7 +422,8 @@
|
|
|
422
422
|
--elevation-500-modal-window: 0px 0px 0.5px rgba(0, 0, 0, 0.08),
|
|
423
423
|
0px 10px 24px rgba(0, 0, 0, 0.18), 0px 2px 5px rgba(0, 0, 0, 0.15);
|
|
424
424
|
|
|
425
|
-
--figma-elevation-500-modal-window:
|
|
425
|
+
--figma-elevation-500-modal-window: 0px 0px 0.5px 0px rgba(0, 0, 0, 0.08),
|
|
426
|
+
0px 10px 24px 0px rgba(0, 0, 0, 0.18), 0px 2px 5px 0px rgba(0, 0, 0, 0.15);
|
|
426
427
|
|
|
427
428
|
color-scheme: light dark;
|
|
428
429
|
/* Icons */
|
|
@@ -434,6 +435,10 @@
|
|
|
434
435
|
|
|
435
436
|
--figma-elevation-200: 0px 1px 3px 0px rgba(0, 0, 0, 0.102),
|
|
436
437
|
0px 3px 8px 0px rgba(0, 0, 0, 0.102), 0px 0px 0.5px 0px rgba(0, 0, 0, 0.18);
|
|
438
|
+
|
|
439
|
+
--font-family: "Inter", AppleSystemUIFont, BlinkMacSystemFont, avenir next,
|
|
440
|
+
avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto,
|
|
441
|
+
arial, sans-serif;
|
|
437
442
|
}
|
|
438
443
|
|
|
439
444
|
@media (prefers-color-scheme: dark) {
|
|
@@ -452,7 +457,6 @@
|
|
|
452
457
|
}
|
|
453
458
|
}
|
|
454
459
|
|
|
455
|
-
|
|
456
460
|
html {
|
|
457
461
|
width: 100%;
|
|
458
462
|
height: 100%;
|
|
@@ -461,9 +465,7 @@ html {
|
|
|
461
465
|
color: var(--figma-color-text);
|
|
462
466
|
-webkit-font-smoothing: antialiased;
|
|
463
467
|
-moz-osx-font-smoothing: grayscale;
|
|
464
|
-
font-family:
|
|
465
|
-
segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial,
|
|
466
|
-
sans-serif;
|
|
468
|
+
font-family: var(--font-family);
|
|
467
469
|
font-size: 16px;
|
|
468
470
|
font-weight: var(--body-medium-fontWeight);
|
|
469
471
|
letter-spacing: var(--body-letter-spacing);
|
|
@@ -481,11 +483,12 @@ body {
|
|
|
481
483
|
letter-spacing: var(--body-letter-spacing);
|
|
482
484
|
}
|
|
483
485
|
|
|
484
|
-
h1,
|
|
486
|
+
h1,
|
|
487
|
+
h2 {
|
|
485
488
|
font-weight: var(--body-large-strong-fontWeight);
|
|
486
489
|
font-size: var(--body-large-fontSize);
|
|
487
490
|
}
|
|
488
|
-
h3{
|
|
491
|
+
h3 {
|
|
489
492
|
font-weight: var(--body-medium-strong-fontWeight);
|
|
490
493
|
font-size: var(--body-medium-fontSize);
|
|
491
494
|
}
|
|
@@ -561,14 +564,16 @@ input[type="number"],
|
|
|
561
564
|
font: inherit;
|
|
562
565
|
display: flex;
|
|
563
566
|
color: inherit;
|
|
567
|
+
-moz-appearance: textfield;
|
|
564
568
|
|
|
565
569
|
&:focus {
|
|
566
570
|
box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
|
|
567
571
|
outline: 0;
|
|
568
572
|
}
|
|
569
|
-
|
|
573
|
+
&::-webkit-outer-spin-button,
|
|
570
574
|
&::-webkit-inner-spin-button {
|
|
571
575
|
display: none;
|
|
576
|
+
margin: 0;
|
|
572
577
|
}
|
|
573
578
|
}
|
|
574
579
|
|
|
@@ -595,9 +600,9 @@ input[type="text"][list] {
|
|
|
595
600
|
background-color: var(--figma-color-bg);
|
|
596
601
|
box-shadow: inset 0 0 0 1px var(--figma-color-border);
|
|
597
602
|
accent-color: var(--figma-color-bg-brand);
|
|
598
|
-
overflow:hidden;
|
|
599
|
-
white-space:nowrap;
|
|
600
|
-
text-overflow:ellipsis;
|
|
603
|
+
overflow: hidden;
|
|
604
|
+
white-space: nowrap;
|
|
605
|
+
text-overflow: ellipsis;
|
|
601
606
|
|
|
602
607
|
&:focus {
|
|
603
608
|
box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
|
|
@@ -707,29 +712,29 @@ fig-button {
|
|
|
707
712
|
}
|
|
708
713
|
|
|
709
714
|
/* Icon only */
|
|
710
|
-
&[icon]{
|
|
715
|
+
&[icon] {
|
|
711
716
|
width: var(--spacer-4);
|
|
712
717
|
padding: 0;
|
|
713
718
|
flex-grow: 0;
|
|
714
719
|
flex-shrink: 0;
|
|
715
720
|
flex-basis: var(--spacer-4);
|
|
716
|
-
&[size="compact"]{
|
|
721
|
+
&[size="compact"] {
|
|
717
722
|
width: var(--spacer-3);
|
|
718
723
|
flex-basis: var(--spacer-3);
|
|
719
724
|
}
|
|
720
725
|
}
|
|
721
726
|
|
|
722
727
|
/* Disabled */
|
|
723
|
-
&[disabled]:not([disabled="false"]){
|
|
728
|
+
&[disabled]:not([disabled="false"]) {
|
|
724
729
|
background-color: var(--figma-color-bg-disabled);
|
|
725
730
|
pointer-events: none;
|
|
726
731
|
cursor: not-allowed;
|
|
727
|
-
&:not([variant="secondary"]){
|
|
732
|
+
&:not([variant="secondary"]) {
|
|
728
733
|
color: var(--figma-color-text-ondisabled);
|
|
729
734
|
box-shadow: none;
|
|
730
735
|
}
|
|
731
736
|
&[variant="secondary"],
|
|
732
|
-
&[variant="ghost"]{
|
|
737
|
+
&[variant="ghost"] {
|
|
733
738
|
color: var(--figma-color-text-disabled);
|
|
734
739
|
background-color: transparent;
|
|
735
740
|
}
|
|
@@ -831,7 +836,7 @@ fig-button-combo {
|
|
|
831
836
|
> *:not([variant="secondary"]):not(:first-child) {
|
|
832
837
|
box-shadow: inset 1px 0 0 0 var(--figma-color-bg-brand-hover);
|
|
833
838
|
&[disabled]:not([disabled="false"]) {
|
|
834
|
-
|
|
839
|
+
box-shadow: inset 1px 0 0 0 var(--figma-color-border-disabled);
|
|
835
840
|
}
|
|
836
841
|
}
|
|
837
842
|
> *[variant="secondary"]:not(:first-child) {
|
|
@@ -927,7 +932,7 @@ fig-avatar,
|
|
|
927
932
|
background: var(--checkerboard);
|
|
928
933
|
}
|
|
929
934
|
}
|
|
930
|
-
&[borderless] img{
|
|
935
|
+
&[borderless] img {
|
|
931
936
|
box-shadow: none;
|
|
932
937
|
}
|
|
933
938
|
|
|
@@ -987,7 +992,6 @@ input[type="color"] {
|
|
|
987
992
|
rgba(0, 0, 0, var(--alpha)) 50%
|
|
988
993
|
);
|
|
989
994
|
}
|
|
990
|
-
|
|
991
995
|
}
|
|
992
996
|
|
|
993
997
|
input[type="color"] {
|
|
@@ -1007,7 +1011,6 @@ input[type="color"] {
|
|
|
1007
1011
|
}
|
|
1008
1012
|
}
|
|
1009
1013
|
|
|
1010
|
-
|
|
1011
1014
|
fig-chit {
|
|
1012
1015
|
--gradient-color-1: #ff90ff;
|
|
1013
1016
|
--gradient-color-2: #0000ff;
|
|
@@ -1068,7 +1071,7 @@ fig-chit {
|
|
|
1068
1071
|
}
|
|
1069
1072
|
|
|
1070
1073
|
&[type="gradient"],
|
|
1071
|
-
&[type="image"]{
|
|
1074
|
+
&[type="image"] {
|
|
1072
1075
|
&::after {
|
|
1073
1076
|
content: "";
|
|
1074
1077
|
width: 0.875rem;
|
|
@@ -1086,11 +1089,14 @@ fig-chit {
|
|
|
1086
1089
|
input[type="color"]::-webkit-color-swatch-wrapper {
|
|
1087
1090
|
background: none;
|
|
1088
1091
|
}
|
|
1092
|
+
input[type="color"]::-moz-color-swatch {
|
|
1093
|
+
opacity: 0;
|
|
1094
|
+
}
|
|
1089
1095
|
input[type="color"]::-webkit-color-swatch {
|
|
1090
1096
|
opacity: 0;
|
|
1091
1097
|
}
|
|
1092
1098
|
}
|
|
1093
|
-
|
|
1099
|
+
|
|
1094
1100
|
&[type="image"] {
|
|
1095
1101
|
&:not([src])::after {
|
|
1096
1102
|
background: var(--checkerboard);
|
|
@@ -1154,8 +1160,6 @@ fig-image {
|
|
|
1154
1160
|
}
|
|
1155
1161
|
}
|
|
1156
1162
|
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
1163
|
/* Combo input */
|
|
1160
1164
|
.input-combo {
|
|
1161
1165
|
display: inline-flex;
|
|
@@ -1399,7 +1403,9 @@ details {
|
|
|
1399
1403
|
transition: transform var(--transition-duration)
|
|
1400
1404
|
var(--transition-timing-function);
|
|
1401
1405
|
}
|
|
1402
|
-
|
|
1406
|
+
&::-webkit-details-marker {
|
|
1407
|
+
display: none;
|
|
1408
|
+
}
|
|
1403
1409
|
&::marker {
|
|
1404
1410
|
content: "";
|
|
1405
1411
|
}
|
|
@@ -1425,7 +1431,6 @@ details {
|
|
|
1425
1431
|
content: var(--icon-chevron);
|
|
1426
1432
|
}
|
|
1427
1433
|
|
|
1428
|
-
|
|
1429
1434
|
/* Sliders */
|
|
1430
1435
|
.fig-slider,
|
|
1431
1436
|
fig-slider {
|
|
@@ -1566,6 +1571,7 @@ fig-slider {
|
|
|
1566
1571
|
|
|
1567
1572
|
&::-webkit-slider-thumb {
|
|
1568
1573
|
appearance: none;
|
|
1574
|
+
background: transparent;
|
|
1569
1575
|
-webkit-appearance: none;
|
|
1570
1576
|
transition: var(--slider-transition);
|
|
1571
1577
|
border-radius: 100%;
|
|
@@ -1621,7 +1627,7 @@ fig-slider {
|
|
|
1621
1627
|
input[type="range"] {
|
|
1622
1628
|
height: var(--slider-height);
|
|
1623
1629
|
appearance: none;
|
|
1624
|
-
-
|
|
1630
|
+
-moz-appearance: none;
|
|
1625
1631
|
border-radius: calc(var(--slider-height) / 2);
|
|
1626
1632
|
display: block;
|
|
1627
1633
|
width: 100%;
|
|
@@ -1639,6 +1645,8 @@ fig-slider {
|
|
|
1639
1645
|
|
|
1640
1646
|
&::-moz-range-thumb {
|
|
1641
1647
|
appearance: none;
|
|
1648
|
+
-moz-appearance: none;
|
|
1649
|
+
background: transparent;
|
|
1642
1650
|
border-radius: 100%;
|
|
1643
1651
|
height: var(--slider-thumb-size);
|
|
1644
1652
|
width: var(--slider-thumb-size);
|
|
@@ -1691,7 +1699,7 @@ fig-slider {
|
|
|
1691
1699
|
datalist {
|
|
1692
1700
|
position: absolute;
|
|
1693
1701
|
inset: 0;
|
|
1694
|
-
top: calc((var(--slider-field-height) - var(--slider-height))/2);
|
|
1702
|
+
top: calc((var(--slider-field-height) - var(--slider-height)) / 2);
|
|
1695
1703
|
display: flex;
|
|
1696
1704
|
transition: var(--slider-transition);
|
|
1697
1705
|
background: transparent;
|
|
@@ -1757,23 +1765,22 @@ fig-slider {
|
|
|
1757
1765
|
--slider-tick-size: calc(var(--slider-height) / 4);
|
|
1758
1766
|
.fig-slider-input-container {
|
|
1759
1767
|
&::before {
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
}
|
|
1768
|
+
box-shadow: inset 0 0 0 1px var(--figma-color-bordertranslucent);
|
|
1769
|
+
background: var(--figma-color-bg-brand);
|
|
1763
1770
|
}
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
}
|
|
1769
|
-
fig-input-text {
|
|
1770
|
-
height: auto;
|
|
1771
|
+
}
|
|
1772
|
+
input[type="range"] {
|
|
1773
|
+
&::-webkit-slider-runnable-track {
|
|
1774
|
+
box-shadow: inset 0 0 0 1px var(--figma-color-bordertranslucent);
|
|
1771
1775
|
}
|
|
1776
|
+
}
|
|
1777
|
+
fig-input-text {
|
|
1778
|
+
height: auto;
|
|
1779
|
+
}
|
|
1772
1780
|
}
|
|
1773
1781
|
}
|
|
1774
1782
|
}
|
|
1775
1783
|
|
|
1776
|
-
|
|
1777
1784
|
/* Popovers/Dialogs */
|
|
1778
1785
|
.dialog,
|
|
1779
1786
|
dialog,
|
|
@@ -1907,7 +1914,7 @@ fig-dialog,
|
|
|
1907
1914
|
}
|
|
1908
1915
|
|
|
1909
1916
|
/* Tooltip */
|
|
1910
|
-
fig-tooltip{
|
|
1917
|
+
fig-tooltip {
|
|
1911
1918
|
display: contents;
|
|
1912
1919
|
}
|
|
1913
1920
|
.fig-tooltip {
|
|
@@ -2013,7 +2020,6 @@ fig-tabs {
|
|
|
2013
2020
|
}
|
|
2014
2021
|
}
|
|
2015
2022
|
|
|
2016
|
-
|
|
2017
2023
|
fig-checkbox,
|
|
2018
2024
|
fig-radio {
|
|
2019
2025
|
align-items: center;
|
|
@@ -2195,7 +2201,7 @@ fig-field,
|
|
|
2195
2201
|
|
|
2196
2202
|
&[direction="horizontal"] {
|
|
2197
2203
|
gap: var(--spacer-2);
|
|
2198
|
-
align-items:
|
|
2204
|
+
align-items: start;
|
|
2199
2205
|
flex-direction: row;
|
|
2200
2206
|
|
|
2201
2207
|
& > label {
|
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) {
|