@rogieking/figui3 9.0.7 → 9.0.9

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
 
@@ -320,7 +318,7 @@ fig-fill-picker {
320
318
  grid-template-columns: unset;
321
319
  grid-template-areas: unset;
322
320
  padding-right: var(--spacer-2);
323
- padding-left: var(--spacer-3);
321
+ padding-left: var(--spacer-2);
324
322
  gap: var(--spacer-2);
325
323
 
326
324
  > *:not(.fig-field-chevron):not(label) {
@@ -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-editor.js CHANGED
@@ -3505,6 +3505,7 @@ class FigFillPicker extends HTMLElement {
3505
3505
  className: "fig-fill-picker-gradient-type",
3506
3506
  label: "Gradient type",
3507
3507
  value: this.#gradient.type,
3508
+ variant: "ghost",
3508
3509
  },
3509
3510
  figEditorCreateElement(
3510
3511
  "fig-select-options",
@@ -3591,7 +3592,7 @@ class FigFillPicker extends HTMLElement {
3591
3592
  className: "fig-fill-picker-gradient-stops-header",
3592
3593
  borderless: true,
3593
3594
  },
3594
- [figEditorCreateElement("span", {}, "Stops"), addButton],
3595
+ [figEditorCreateElement("h3", {}, "Stops"), addButton],
3595
3596
  ),
3596
3597
  figEditorCreateElement(
3597
3598
  "div",
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;
@@ -18957,6 +18978,7 @@ class FigHandle extends HTMLElement {
18957
18978
  this.#syncDrag();
18958
18979
  this.#syncHitArea();
18959
18980
  this.addEventListener("click", this.#handleSelect);
18981
+ this.addEventListener("blur", this.#handleBlur);
18960
18982
  document.addEventListener("pointerdown", this.#handleDeselect);
18961
18983
  document.addEventListener("keydown", this.#handleKeyDown);
18962
18984
  const initial = this.getAttribute("value");
@@ -18974,6 +18996,7 @@ class FigHandle extends HTMLElement {
18974
18996
  this.#hitAreaEl = null;
18975
18997
  }
18976
18998
  this.removeEventListener("click", this.#handleSelect);
18999
+ this.removeEventListener("blur", this.#handleBlur);
18977
19000
  document.removeEventListener("pointerdown", this.#handleDeselect);
18978
19001
  document.removeEventListener("keydown", this.#handleKeyDown);
18979
19002
  }
@@ -19008,7 +19031,12 @@ class FigHandle extends HTMLElement {
19008
19031
  this.deselect();
19009
19032
  };
19010
19033
 
19034
+ #handleBlur = () => {
19035
+ this.removeAttribute("data-fig-pointer-focus");
19036
+ };
19037
+
19011
19038
  #handleKeyDown = (e) => {
19039
+ this.removeAttribute("data-fig-pointer-focus");
19012
19040
  if (e.defaultPrevented) return;
19013
19041
  if (
19014
19042
  e.target === this &&
@@ -19194,6 +19222,7 @@ class FigHandle extends HTMLElement {
19194
19222
  #onPointerDown(e) {
19195
19223
  if (!this.#dragEnabled || figBooleanAttribute(this, "disabled")) return;
19196
19224
  e.preventDefault();
19225
+ this.setAttribute("data-fig-pointer-focus", "");
19197
19226
  this.focus();
19198
19227
  this.select();
19199
19228
  const container = this.#getContainer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "9.0.7",
3
+ "version": "9.0.9",
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",