@rogieking/figui3 1.0.53 → 1.0.55

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/example.html CHANGED
@@ -91,6 +91,20 @@
91
91
  </fig-tooltip>
92
92
  </hstack>
93
93
  <br />
94
+ <fig-field direction="horizontal">
95
+ <label>Grouped options</label>
96
+ <fig-dropdown>
97
+ <optgroup label="Numbers">
98
+ <option>One</option>
99
+ <option>Two</option>
100
+ </optgroup>
101
+ <optgroup label="Fruits">
102
+ <option>Apple</option>
103
+ <option>Banana</option>
104
+ </optgroup>
105
+ </fig-dropdown>
106
+ </fig-field>
107
+ <br />
94
108
  <fig-field direction="horizontal">
95
109
  <label>Dropdown</label>
96
110
  <fig-dropdown>
package/fig.css CHANGED
@@ -611,7 +611,7 @@ fig-dropdown:has([trigger]) {
611
611
  }
612
612
 
613
613
  fig-dialog > *:not(dialog),
614
- fig-dropdown > option {
614
+ fig-dropdown > *:not(select) {
615
615
  display: none !important;
616
616
  }
617
617
 
@@ -657,7 +657,8 @@ fig-button {
657
657
  }
658
658
 
659
659
  /* Variant: Ghost */
660
- &[variant="ghost"] {
660
+ &[variant="ghost"],
661
+ &[variant="link"] {
661
662
  box-shadow: none;
662
663
  background: none;
663
664
  color: var(--figma-color-text);
@@ -676,6 +677,10 @@ fig-button {
676
677
  background-color: transparent;
677
678
  }
678
679
 
680
+ &[variant="link"] {
681
+ color: var(--figma-color-text-brand);
682
+ }
683
+
679
684
  /* Variant: Secondary */
680
685
  &[variant="secondary"] {
681
686
  box-shadow: inset 0 0 0 1px var(--figma-color-border);
@@ -698,6 +703,8 @@ fig-button {
698
703
  &[icon] > button {
699
704
  width: var(--spacer-4);
700
705
  padding: 0;
706
+ flex-grow: 0
707
+ flex-shrink: 0;
701
708
 
702
709
  &:hover {
703
710
  background-color: var(--figma-color-bg-ghost-hover);
package/fig.js CHANGED
@@ -98,13 +98,12 @@ class FigDropdown extends HTMLElement {
98
98
  connectedCallback() {
99
99
  this.type = this.getAttribute("type") || "select";
100
100
  this.value = this.getAttribute("value") || "";
101
+
101
102
  this.select = document.createElement("select");
102
103
  this.optionsSlot = document.createElement("slot");
103
-
104
104
  this.appendChild(this.select);
105
105
  this.shadowRoot.appendChild(this.optionsSlot);
106
106
 
107
- // Move slotted options into the select element
108
107
  this.optionsSlot.addEventListener("slotchange", this.slotChange.bind(this));
109
108
 
110
109
  this.select.addEventListener("input", this.handleDropdownInput.bind(this));
@@ -132,6 +131,7 @@ class FigDropdown extends HTMLElement {
132
131
  this.select.selectedIndex = -1;
133
132
  }
134
133
  }
134
+
135
135
  handleDropdownInput() {
136
136
  if (this.type === "dropdown") {
137
137
  this.value = this.select.value;
package/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "1.0.53"
3
+ "version": "1.0.55"
4
4
  }