@rogieking/figui3 9.0.7 → 9.0.8

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/fig-editor.css CHANGED
@@ -56,7 +56,6 @@ fig-interpolation-swatch {
56
56
  dialog[is="fig-toast"] {
57
57
  --fig-toast-bg-color: var(--figma-color-bg);
58
58
  --z-index: 999999;
59
- contain: none;
60
59
  z-index: var(--z-index);
61
60
  box-shadow: var(--figma-elevation-100);
62
61
  border-radius: var(--radius-large);
@@ -150,7 +149,6 @@ fig-fill-picker {
150
149
  }
151
150
 
152
151
  .fig-fill-picker-dialog {
153
- contain: layout;
154
152
  width: 240px;
155
153
  padding: 0;
156
154
 
@@ -781,6 +779,9 @@ fig-select-option {
781
779
  align-items: center;
782
780
  gap: 0;
783
781
  position: relative;
782
+ box-sizing: border-box;
783
+ min-width: 0;
784
+ max-width: 100%;
784
785
  min-height: var(--spacer-4);
785
786
  height: auto;
786
787
  padding: var(--spacer-1) var(--spacer-2);
@@ -789,10 +790,24 @@ fig-select-option {
789
790
  color: var(--figma-color-text-menu);
790
791
  cursor: default;
791
792
  user-select: none;
793
+ overflow: hidden;
794
+ text-overflow: ellipsis;
792
795
  white-space: nowrap;
793
796
 
797
+ /* Anonymous flex items cannot ellipsize; text-only options stay a block. */
798
+ &:not(:has(> :not([slot="prepend"]):not([slot="append"]))) {
799
+ display: block;
800
+ }
801
+
794
802
  h3{
795
803
  margin: 0 0 var(--spacer-1) 0;
804
+ overflow: hidden;
805
+ text-overflow: ellipsis;
806
+ }
807
+
808
+ label {
809
+ overflow: hidden;
810
+ text-overflow: ellipsis;
796
811
  }
797
812
 
798
813
  &::before {
@@ -808,6 +823,7 @@ fig-select-option {
808
823
  &::after {
809
824
  content: "";
810
825
  display: block;
826
+ float: left;
811
827
  flex: 0 0 1rem;
812
828
  order: -1;
813
829
  width: 1rem;
@@ -832,10 +848,20 @@ fig-select-option {
832
848
  margin-right: var(--spacer-1);
833
849
  }
834
850
 
851
+ &:not(:has(> :not([slot="prepend"]):not([slot="append"]))) > [slot="prepend"] {
852
+ display: inline-flex;
853
+ vertical-align: middle;
854
+ }
855
+
856
+ &:not(:has(> :not([slot="prepend"]):not([slot="append"]))) > [slot="append"] {
857
+ float: right;
858
+ }
835
859
 
836
860
  & > :not([slot="prepend"]):not([slot="append"]) {
837
861
  flex: 1 1 auto;
838
862
  min-width: 0;
863
+ overflow: hidden;
864
+ text-overflow: ellipsis;
839
865
  }
840
866
 
841
867
  & > [slot="append"] {
package/fig-lab.css CHANGED
@@ -101,10 +101,6 @@ fig-ai-context {
101
101
  }
102
102
  }
103
103
 
104
- fig-ai-context:has(+ fig-ai-prompt) {
105
- margin-bottom: calc(-1 * var(--spacer-3));
106
- }
107
-
108
104
  fig-attachments {
109
105
  display: flex;
110
106
  flex-wrap: wrap;
package/fig.js CHANGED
@@ -4776,6 +4776,7 @@ figDefineElement("fig-segment", FigSegment);
4776
4776
  * @attr {string} value - Selected segment value
4777
4777
  * @attr {boolean} animated - Enables animated selection indicator
4778
4778
  * @attr {"equal"|"auto"} sizing - Segment sizing mode
4779
+ * @attr {string} size - Control size. Use `large` for a 32px-tall control.
4779
4780
  */
4780
4781
  class FigSegmentedControl extends HTMLElement {
4781
4782
  #selectedSegment = null;
@@ -18042,11 +18043,20 @@ class FigChooser extends HTMLElement {
18042
18043
  #syncGridColumns() {
18043
18044
  const raw = this.getAttribute("columns");
18044
18045
  const columns = raw === null ? NaN : Number(raw);
18045
- if (Number.isInteger(columns) && columns > 0) {
18046
- this.style.setProperty("--fig-chooser-grid-columns", String(columns));
18046
+ const validColumns = Number.isInteger(columns) && columns > 0;
18047
+ const effectiveColumns = validColumns ? columns : 2;
18048
+ if (validColumns) {
18049
+ this.style.setProperty("--fig-chooser-grid-columns", String(effectiveColumns));
18047
18050
  } else {
18048
18051
  this.style.removeProperty("--fig-chooser-grid-columns");
18049
18052
  }
18053
+ const isGrid = this.getAttribute("layout") === "grid";
18054
+ this.choices.forEach((choice, index) => {
18055
+ choice.toggleAttribute(
18056
+ "data-fig-chooser-first-row",
18057
+ isGrid && index < effectiveColumns,
18058
+ );
18059
+ });
18050
18060
  }
18051
18061
 
18052
18062
  get choices() {
@@ -18169,7 +18179,10 @@ class FigChooser extends HTMLElement {
18169
18179
  this.#syncDisabledChoices();
18170
18180
  }
18171
18181
  if (name === "choice-element") {
18172
- requestAnimationFrame(() => this.#syncSelection());
18182
+ requestAnimationFrame(() => {
18183
+ this.#syncGridColumns();
18184
+ this.#syncSelection();
18185
+ });
18173
18186
  }
18174
18187
  if (name === "columns") {
18175
18188
  this.#syncGridColumns();
@@ -18187,6 +18200,7 @@ class FigChooser extends HTMLElement {
18187
18200
  requestAnimationFrame(() => this.#syncOverflow());
18188
18201
  }
18189
18202
  if (name === "layout") {
18203
+ this.#syncGridColumns();
18190
18204
  this.#applyOverflowMode();
18191
18205
  if (newValue === "horizontal") {
18192
18206
  this.scrollTop = 0;
@@ -18506,8 +18520,14 @@ class FigChooser extends HTMLElement {
18506
18520
  #applyOverflowMode() {
18507
18521
  if (this.#overflowMode === "scrollbar") {
18508
18522
  this.#removeNavButtons();
18523
+ this.classList.add("fig-overflow-fade");
18524
+ this.classList.toggle(
18525
+ "fig-overflow-fade-horizontal",
18526
+ this.getAttribute("layout") === "horizontal",
18527
+ );
18509
18528
  } else {
18510
18529
  this.#createNavButtons();
18530
+ this.classList.remove("fig-overflow-fade", "fig-overflow-fade-horizontal");
18511
18531
  }
18512
18532
  }
18513
18533
 
@@ -18659,6 +18679,7 @@ class FigChooser extends HTMLElement {
18659
18679
  this.#mutationObserver = new MutationObserver(() => {
18660
18680
  if (this.#isUnwrapping) return;
18661
18681
  this.#removeLegacyScroller();
18682
+ this.#syncGridColumns();
18662
18683
  this.#applyOverflowMode();
18663
18684
  this.#syncDisabledChoices();
18664
18685
  const choices = this.choices;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "9.0.7",
3
+ "version": "9.0.8",
4
4
  "description": "A lightweight web components library for building Figma plugin and widget UIs with native look and feel",
5
5
  "author": "Rogie King",
6
6
  "license": "SEE LICENSE IN LICENSE",