@rogieking/figui3 8.9.10 → 8.9.12

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
@@ -692,6 +692,15 @@ fig-select {
692
692
  }
693
693
  }
694
694
 
695
+ &[variant="ghost"] {
696
+ box-shadow: none;
697
+ background-color: transparent;
698
+
699
+ &:hover:not([disabled]):not([disabled="false"]) {
700
+ background-color: var(--figma-color-bg-secondary);
701
+ }
702
+ }
703
+
695
704
  &::after {
696
705
  content: "";
697
706
  position: absolute;
@@ -739,97 +748,8 @@ fig-select::part(listbox) {
739
748
  height: max-content;
740
749
  }
741
750
 
742
- /* Vertical option panels own their scroller and shared top/bottom paging buttons. */
743
- fig-select-options,
744
- .fig-menu-options {
745
- --fig-vertical-overflow-size: var(--spacer-4);
746
-
747
- box-sizing: border-box;
748
- display: flex;
749
- flex-direction: column;
750
- gap: 0;
751
- width: 100%;
752
- max-width: 100%;
753
- max-height: calc(100vh - 1rem);
754
- /* No block padding — sticky overflow buttons must sit flush to the popup edges. */
755
- padding: 0;
756
- overflow: hidden auto;
757
- scrollbar-width: none;
758
-
759
- &::-webkit-scrollbar {
760
- display: none;
761
- }
762
-
763
- & > :not(.fig-overflow) {
764
- flex-shrink: 0;
765
- }
766
-
767
- /* List breathing room (not on the scroller itself). */
768
- & > :nth-child(1 of :not(.fig-overflow)) {
769
- margin-top: var(--spacer-2);
770
- }
771
-
772
- & > :not(.fig-overflow):last-child,
773
- & > :not(.fig-overflow):has(+ .fig-overflow-end) {
774
- margin-bottom: var(--spacer-2);
775
- }
776
-
777
- & > .fig-overflow {
778
- position: sticky;
779
- left: 0;
780
- flex: 0 0 var(--fig-vertical-overflow-size);
781
- width: 100%;
782
- height: var(--fig-vertical-overflow-size);
783
- margin: 0;
784
- z-index: 3;
785
- /* Menu chrome — not option hover (bg-menu-hover is brand blue). */
786
- color: var(--figma-color-text-menu);
787
- background: var(--figma-color-bg-menu) !important;
788
-
789
- &::before {
790
- inset: 0;
791
- border-radius: 0;
792
- background: var(--figma-color-bg-menu) !important;
793
- }
794
-
795
- &:hover::before {
796
- background: light-dark(
797
- rgba(0, 0, 0, 0.06),
798
- rgba(255, 255, 255, 0.08)
799
- )
800
- !important;
801
- }
802
-
803
- &:hover {
804
- color: var(--figma-color-text-menu);
805
- }
806
- }
807
-
808
- & > .fig-overflow-start {
809
- order: -1;
810
- top: 0;
811
- margin-block-end: calc(-1 * var(--fig-vertical-overflow-size));
812
-
813
- &::before {
814
- border-radius: var(--radius-large) var(--radius-large) 0 0;
815
- }
816
-
817
- .fig-overflow-chevron {
818
- rotate: 180deg;
819
- }
820
- }
821
-
822
- & > .fig-overflow-end {
823
- order: 1;
824
- bottom: 0;
825
- margin-block-start: calc(-1 * var(--fig-vertical-overflow-size));
826
-
827
- &::before {
828
- border-radius: 0 0 var(--radius-large) var(--radius-large);
829
- }
830
- }
831
-
832
- }
751
+ /* Vertical option-panel overflow chrome lives in fig.js (figVerticalOverflowSheet)
752
+ and is adopted on document + fig-menu shadow. */
833
753
 
834
754
  fig-select-options > :is(fig-separator, fig-menu-separator) {
835
755
  /* Align labels with select option text after the checkmark column. */
package/fig-editor.js CHANGED
@@ -454,6 +454,10 @@ class FigSelectOptions extends HTMLElement {
454
454
  }
455
455
  figEditorDefineElement("fig-select-options", FigSelectOptions);
456
456
 
457
+ /**
458
+ * A dropdown-styled select.
459
+ * @attr {string} variant - Visual style. Use `ghost` for a borderless control.
460
+ */
457
461
  class FigSelect extends HTMLElement {
458
462
  #button = null;
459
463
  #popup = null;
@@ -492,6 +496,7 @@ class FigSelect extends HTMLElement {
492
496
  "offset",
493
497
  "closedby",
494
498
  "open",
499
+ "variant",
495
500
  ];
496
501
  }
497
502