@rogieking/figui3 9.0.6 → 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;
@@ -7007,6 +7008,7 @@ figDefineElement("fig-input-text", FigInputText);
7007
7008
  * Supports units display and all standard number input attributes.
7008
7009
  * @attr {string} value - The current numeric value
7009
7010
  * @attr {string} placeholder - Placeholder text
7011
+ * @attr {string} size - Input size: default or "large"
7010
7012
  * @attr {boolean} disabled - Whether the input is disabled
7011
7013
  * @attr {number} min - Minimum value
7012
7014
  * @attr {number} max - Maximum value
@@ -18041,11 +18043,20 @@ class FigChooser extends HTMLElement {
18041
18043
  #syncGridColumns() {
18042
18044
  const raw = this.getAttribute("columns");
18043
18045
  const columns = raw === null ? NaN : Number(raw);
18044
- if (Number.isInteger(columns) && columns > 0) {
18045
- 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));
18046
18050
  } else {
18047
18051
  this.style.removeProperty("--fig-chooser-grid-columns");
18048
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
+ });
18049
18060
  }
18050
18061
 
18051
18062
  get choices() {
@@ -18168,7 +18179,10 @@ class FigChooser extends HTMLElement {
18168
18179
  this.#syncDisabledChoices();
18169
18180
  }
18170
18181
  if (name === "choice-element") {
18171
- requestAnimationFrame(() => this.#syncSelection());
18182
+ requestAnimationFrame(() => {
18183
+ this.#syncGridColumns();
18184
+ this.#syncSelection();
18185
+ });
18172
18186
  }
18173
18187
  if (name === "columns") {
18174
18188
  this.#syncGridColumns();
@@ -18186,6 +18200,7 @@ class FigChooser extends HTMLElement {
18186
18200
  requestAnimationFrame(() => this.#syncOverflow());
18187
18201
  }
18188
18202
  if (name === "layout") {
18203
+ this.#syncGridColumns();
18189
18204
  this.#applyOverflowMode();
18190
18205
  if (newValue === "horizontal") {
18191
18206
  this.scrollTop = 0;
@@ -18505,8 +18520,14 @@ class FigChooser extends HTMLElement {
18505
18520
  #applyOverflowMode() {
18506
18521
  if (this.#overflowMode === "scrollbar") {
18507
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
+ );
18508
18528
  } else {
18509
18529
  this.#createNavButtons();
18530
+ this.classList.remove("fig-overflow-fade", "fig-overflow-fade-horizontal");
18510
18531
  }
18511
18532
  }
18512
18533
 
@@ -18658,6 +18679,7 @@ class FigChooser extends HTMLElement {
18658
18679
  this.#mutationObserver = new MutationObserver(() => {
18659
18680
  if (this.#isUnwrapping) return;
18660
18681
  this.#removeLegacyScroller();
18682
+ this.#syncGridColumns();
18661
18683
  this.#applyOverflowMode();
18662
18684
  this.#syncDisabledChoices();
18663
18685
  const choices = this.choices;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "9.0.6",
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",