@rogieking/figui3 1.0.93 → 1.0.95

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.
Files changed (4) hide show
  1. package/example.html +17 -2
  2. package/fig.css +20 -50
  3. package/fig.js +6 -8
  4. package/package.json +1 -1
package/example.html CHANGED
@@ -19,6 +19,21 @@
19
19
  <h2>Heading 2</h2>
20
20
  <h3>Heading 3</h3>
21
21
  <br />
22
+ <fig-button id="button-progressive-blur"
23
+ variant="ghost"
24
+ icon="true"
25
+ class=""
26
+ disabled="true"><svg width="16"
27
+ height="16"
28
+ viewBox="0 0 16 16"
29
+ fill="none"
30
+ xmlns="http://www.w3.org/2000/svg">
31
+ <path fill-rule="evenodd"
32
+ clip-rule="evenodd"
33
+ d="M6.5 6C7.32843 6 8 5.32843 8 4.5C8 3.67157 7.32843 3 6.5 3C5.67157 3 5 3.67157 5 4.5C5 5.32843 5.67157 6 6.5 6ZM6.5 7C7.70948 7 8.71836 6.14112 8.94999 5H14V4H8.94999C8.71836 2.85888 7.70948 2 6.5 2C5.29052 2 4.28164 2.85888 4.05001 4H2V5H4.05001C4.28164 6.14112 5.29052 7 6.5 7ZM9.5 13C8.67157 13 8 12.3284 8 11.5C8 10.6716 8.67157 10 9.5 10C10.3284 10 11 10.6716 11 11.5C11 12.3284 10.3284 13 9.5 13ZM9.5 14C8.29052 14 7.28164 13.1411 7.05001 12H2V11H7.05001C7.28164 9.85888 8.29052 9 9.5 9C10.7095 9 11.7184 9.85888 11.95 11H14V12H11.95C11.7184 13.1411 10.7095 14 9.5 14Z"
34
+ fill="currentColor"></path>
35
+ </svg></fig-button>
36
+ <br /> <br />
22
37
  <fig-button disabled>Button 1</fig-button>
23
38
  <br /><br />
24
39
  <fig-button variant="secondary"
@@ -39,11 +54,11 @@
39
54
  disabled>Button 3</fig-button>
40
55
  </fig-button-combo>
41
56
  <br /><br />
42
- <fig-dropdown>
57
+ <fig-dropdown style="width:100px;">
43
58
  <option>One</option>
44
59
  <option>Two</option>
45
60
  <option>Three</option>
46
- <option selected>Four</option>
61
+ <option selected>Fourhundred sixty two</option>
47
62
  </fig-dropdown>
48
63
  <br /><br />
49
64
  <fig-slider min="0"
package/fig.css CHANGED
@@ -595,6 +595,9 @@ input[type="text"][list] {
595
595
  background-color: var(--figma-color-bg);
596
596
  box-shadow: inset 0 0 0 1px var(--figma-color-border);
597
597
  accent-color: var(--figma-color-bg-brand);
598
+ overflow:hidden;
599
+ white-space:nowrap;
600
+ text-overflow:ellipsis;
598
601
 
599
602
  &:focus {
600
603
  box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
@@ -635,6 +638,7 @@ fig-dropdown,
635
638
  }
636
639
  > select {
637
640
  display: block;
641
+ width: 100%;
638
642
  }
639
643
  }
640
644
 
@@ -718,13 +722,14 @@ fig-button {
718
722
  /* Disabled */
719
723
  &[disabled]:not([disabled="false"]){
720
724
  background-color: var(--figma-color-bg-disabled);
721
-
722
725
  pointer-events: none;
726
+ cursor: not-allowed;
723
727
  &:not([variant="secondary"]){
724
728
  color: var(--figma-color-text-ondisabled);
725
729
  box-shadow: none;
726
730
  }
727
- &[variant="secondary"]{
731
+ &[variant="secondary"],
732
+ &[variant="ghost"]{
728
733
  color: var(--figma-color-text-disabled);
729
734
  background-color: transparent;
730
735
  }
@@ -922,7 +927,7 @@ fig-avatar,
922
927
  background: var(--checkerboard);
923
928
  }
924
929
  }
925
- &[borderless] {
930
+ &[borderless] img{
926
931
  box-shadow: none;
927
932
  }
928
933
 
@@ -1420,44 +1425,8 @@ details {
1420
1425
  content: var(--icon-chevron);
1421
1426
  }
1422
1427
 
1423
- /* Details
1424
-
1425
- details summary{
1426
- cursor: pointer;
1427
- user-select: none;
1428
- padding: 0 1rem;
1429
- min-height: 2rem;
1430
- list-style: none;
1431
- pointer-events: none;
1432
- }
1433
- details summary>*{
1434
- pointer-events: all;
1435
- }
1436
- details summary:before{
1437
- content: '▸';
1438
- display: inline-flex;
1439
- align-items: start;
1440
- justify-content: center;
1441
- width: 0.75rem;
1442
- margin-right: -0.75rem;
1443
- transform: translateX(-100%);
1444
- color: inherit;
1445
- visibility: hidden;
1446
- }
1447
- details summary:hover:before{
1448
- visibility: visible;
1449
- }
1450
- details[open] summary:before{
1451
- content: '▾';
1452
- }
1453
- details summary:first-child:last-child:before{
1454
- content: '';
1455
- }
1456
- details summary:first-child:last-child h3{
1457
- pointer-events: none;
1458
- }
1459
- */
1460
1428
 
1429
+ /* Sliders */
1461
1430
  .fig-slider,
1462
1431
  fig-slider {
1463
1432
  --slider-height: 1rem;
@@ -1490,6 +1459,7 @@ fig-slider {
1490
1459
  position: absolute;
1491
1460
  left: 0;
1492
1461
  top: 0;
1462
+ pointer-events: none;
1493
1463
  bottom: 0;
1494
1464
  border-radius: 0.5rem;
1495
1465
  min-width: var(--slider-height);
@@ -1576,11 +1546,9 @@ fig-slider {
1576
1546
  border-radius: calc(var(--slider-height) / 2);
1577
1547
  display: block;
1578
1548
  width: 100%;
1579
- cursor: grab;
1580
- cursor: -webkit-grab;
1581
1549
  background-color: transparent;
1582
1550
 
1583
- &:active {
1551
+ &:active::-webkit-slider-thumb {
1584
1552
  cursor: grabbing;
1585
1553
  cursor: -webkit-grabbing;
1586
1554
  }
@@ -1599,6 +1567,8 @@ fig-slider {
1599
1567
  border: none;
1600
1568
  position: relative;
1601
1569
  z-index: 1;
1570
+ cursor: grab;
1571
+ cursor: -webkit-grab;
1602
1572
  box-shadow: var(--slider-handle-shadow);
1603
1573
  }
1604
1574
 
@@ -1645,19 +1615,17 @@ fig-slider {
1645
1615
  border-radius: calc(var(--slider-height) / 2);
1646
1616
  display: block;
1647
1617
  width: 100%;
1648
- cursor: grab;
1649
- cursor: -moz-grab;
1650
1618
  background-color: transparent;
1651
1619
 
1652
- &:active {
1653
- cursor: grabbing;
1654
- cursor: -moz-grabbing;
1655
- }
1656
-
1657
1620
  &:focus {
1658
1621
  outline: none;
1659
1622
  }
1660
1623
 
1624
+ &:active::-moz-range-thumb {
1625
+ cursor: grabbing;
1626
+ cursor: -webkit-grabbing;
1627
+ }
1628
+
1661
1629
  &::-moz-range-thumb {
1662
1630
  appearance: none;
1663
1631
  border-radius: 0.5rem;
@@ -1667,6 +1635,8 @@ fig-slider {
1667
1635
  border: none;
1668
1636
  position: relative;
1669
1637
  z-index: 1;
1638
+ cursor: grab;
1639
+ cursor: -moz-grab;
1670
1640
  box-shadow: var(--slider-handle-shadow);
1671
1641
  }
1672
1642
 
package/fig.js CHANGED
@@ -15,9 +15,6 @@ if (window.customElements && !window.customElements.get("fig-button")) {
15
15
  this.attachShadow({ mode: "open" });
16
16
  }
17
17
  connectedCallback() {
18
- this.render();
19
- }
20
- render() {
21
18
  this.#type = this.getAttribute("type") || "button";
22
19
  this.shadowRoot.innerHTML = `
23
20
  <style>
@@ -47,10 +44,13 @@ if (window.customElements && !window.customElements.get("fig-button")) {
47
44
  this.#selected =
48
45
  this.hasAttribute("selected") &&
49
46
  this.getAttribute("selected") !== "false";
50
- this.addEventListener("click", this.handleClick.bind(this));
47
+ this.addEventListener("click", this.#handleClick.bind(this));
51
48
 
52
- this.button = this.querySelector("button");
49
+ requestAnimationFrame(() => {
50
+ this.button = this.querySelector("button");
51
+ });
53
52
  }
53
+
54
54
  get type() {
55
55
  return this.#type;
56
56
  }
@@ -67,7 +67,7 @@ if (window.customElements && !window.customElements.get("fig-button")) {
67
67
  this.setAttribute("selected", value);
68
68
  }
69
69
 
70
- handleClick(event) {
70
+ #handleClick(event) {
71
71
  if (this.#type === "toggle") {
72
72
  this.selected = !this.#selected;
73
73
  }
@@ -145,7 +145,6 @@ if (window.customElements && !window.customElements.get("fig-dropdown")) {
145
145
  }
146
146
 
147
147
  #handleSelectInput(e) {
148
- console.log("FigDropdown #handleSelectInput:", e.target.value);
149
148
  this.value = e.target.value;
150
149
  this.setAttribute("value", this.value);
151
150
  }
@@ -181,7 +180,6 @@ if (window.customElements && !window.customElements.get("fig-dropdown")) {
181
180
  attributeChangedCallback(name, oldValue, newValue) {
182
181
  if (name === "value") {
183
182
  this.#syncSelectedValue(newValue);
184
- console.log("val:", this.value);
185
183
  }
186
184
  if (name === "type") {
187
185
  this.type = newValue;
package/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "1.0.93"
3
+ "version": "1.0.95"
4
4
  }