@rogieking/figui3 7.1.0 → 8.0.0

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/README.md CHANGED
@@ -51,7 +51,7 @@ import "@rogieking/figui3/fig-layer.css";
51
51
  import "@rogieking/figui3/fig-layer.js";
52
52
  ```
53
53
 
54
- Opt into editor components like the full Figma-style fill picker when you need them:
54
+ Opt into editor components like `<fig-select>` and the full Figma-style fill picker when you need them:
55
55
 
56
56
  ```js
57
57
  import "@rogieking/figui3/fig-editor.css";
@@ -406,7 +406,7 @@ Right-click and choose **Reset**, or call `resetToDefault()`, to restore the def
406
406
 
407
407
  `<propskit-select>`
408
408
 
409
- Composes a `<fig-field>` and `<fig-select>` into a full-surface property control. Options come from the `options` attribute (same formats as `fig-options`: comma-separated, newline-delimited, or a JSON array).
409
+ Composes a `<fig-field>` and `<fig-select>` into a full-surface property control. Requires `fig-editor.js` (which registers `fig-select`). Options come from the `options` attribute (same formats as `fig-options`: comma-separated, newline-delimited, or a JSON array).
410
410
 
411
411
  **Attributes:** `label`, `value`, `default`, `options`, `disabled`, `size`
412
412
 
package/components.css CHANGED
@@ -5542,270 +5542,6 @@ fig-menu {
5542
5542
  }
5543
5543
  }
5544
5544
 
5545
- /* Select — host chrome; trigger/listbox live in shadow (options slotted) */
5546
- fig-select {
5547
- display: inline-flex;
5548
- position: relative;
5549
- align-items: center;
5550
- min-width: 0;
5551
- height: var(--spacer-4);
5552
- border-radius: var(--radius-medium);
5553
- background-color: var(--figma-color-bg);
5554
- color: var(--figma-color-text);
5555
- box-shadow: inset 0 0 0 1px var(--figma-color-border);
5556
-
5557
- &[full]:not([full="false"]) {
5558
- display: flex;
5559
- width: 100%;
5560
- }
5561
-
5562
- &[disabled]:not([disabled="false"]) {
5563
- pointer-events: none;
5564
- color: var(--figma-color-text-tertiary);
5565
-
5566
- &::after {
5567
- background-color: var(--figma-color-icon-disabled);
5568
- }
5569
- }
5570
-
5571
- &::after {
5572
- content: "";
5573
- position: absolute;
5574
- right: 0.25rem;
5575
- top: 50%;
5576
- transform: translateY(-50%);
5577
- width: 1rem;
5578
- height: 1rem;
5579
- mask-image: var(--icon-16-chevron);
5580
- mask-size: contain;
5581
- mask-repeat: no-repeat;
5582
- mask-position: center;
5583
- background-color: var(--figma-color-icon);
5584
- pointer-events: none;
5585
- z-index: 1;
5586
- }
5587
- }
5588
-
5589
- /*
5590
- * Internal listbox is a fig-popup inside fig-select's shadow, so document
5591
- * dialog[is="fig-popup"] rules don't apply. Expose part=listbox and mirror
5592
- * the menu-theme popup chrome (same tokens as components.css).
5593
- */
5594
- fig-select::part(listbox) {
5595
- --z-index: 999999;
5596
- --fig-popup-radius: var(--radius-large);
5597
- --fig-popup-bg-color: var(--figma-color-bg-menu);
5598
-
5599
- z-index: var(--z-index);
5600
- position: fixed;
5601
- /* Do not set inset here — ::part inset beats inline left/top and
5602
- prevents edge clamping from moving the menu back into view. */
5603
- margin: 0;
5604
- border: 0;
5605
- outline: 0;
5606
- padding: 0;
5607
- overflow: hidden;
5608
- border-radius: var(--fig-popup-radius);
5609
- background-color: var(--fig-popup-bg-color);
5610
- color: var(--figma-color-text-menu);
5611
- color-scheme: dark;
5612
- box-shadow: var(--figma-elevation-400-menu-panel);
5613
- /* width/min/max set in JS — ::part width rules override element.style. */
5614
- max-height: calc(100vh - 1rem);
5615
- height: max-content;
5616
- }
5617
-
5618
- /* Vertical option panels own their scroller and shared top/bottom paging buttons. */
5619
- fig-select-options,
5620
- .fig-menu-options {
5621
- --fig-vertical-overflow-size: var(--spacer-4);
5622
-
5623
- box-sizing: border-box;
5624
- display: flex;
5625
- flex-direction: column;
5626
- gap: 0;
5627
- width: 100%;
5628
- max-width: 100%;
5629
- max-height: calc(100vh - 1rem);
5630
- /* No block padding — sticky overflow buttons must sit flush to the popup edges. */
5631
- padding: 0;
5632
- overflow: hidden auto;
5633
- scrollbar-width: none;
5634
-
5635
- &::-webkit-scrollbar {
5636
- display: none;
5637
- }
5638
-
5639
- & > :not(.fig-overflow) {
5640
- flex-shrink: 0;
5641
- }
5642
-
5643
- /* List breathing room (not on the scroller itself). */
5644
- & > :not(.fig-overflow):first-child,
5645
- & > .fig-overflow-start + :not(.fig-overflow) {
5646
- margin-top: var(--spacer-2);
5647
- }
5648
-
5649
- & > :not(.fig-overflow):last-child,
5650
- & > :not(.fig-overflow):has(+ .fig-overflow-end) {
5651
- margin-bottom: var(--spacer-2);
5652
- }
5653
-
5654
- & > .fig-overflow {
5655
- position: sticky;
5656
- left: 0;
5657
- flex: 0 0 var(--fig-vertical-overflow-size);
5658
- width: 100%;
5659
- height: var(--fig-vertical-overflow-size);
5660
- margin: 0;
5661
- z-index: 3;
5662
- /* Menu chrome — not option hover (bg-menu-hover is brand blue). */
5663
- color: var(--figma-color-text-menu);
5664
- background: var(--figma-color-bg-menu) !important;
5665
-
5666
- &::before {
5667
- inset: 0;
5668
- border-radius: 0;
5669
- background: var(--figma-color-bg-menu) !important;
5670
- }
5671
-
5672
- &:hover::before {
5673
- background: light-dark(
5674
- rgba(0, 0, 0, 0.06),
5675
- rgba(255, 255, 255, 0.08)
5676
- )
5677
- !important;
5678
- }
5679
-
5680
- &:hover {
5681
- color: var(--figma-color-text-menu);
5682
- }
5683
- }
5684
-
5685
- & > .fig-overflow-start {
5686
- order: -1;
5687
- top: 0;
5688
- margin-block-end: calc(-1 * var(--fig-vertical-overflow-size));
5689
-
5690
- &::before {
5691
- border-radius: var(--radius-large) var(--radius-large) 0 0;
5692
- }
5693
-
5694
- .fig-overflow-chevron {
5695
- rotate: 180deg;
5696
- }
5697
- }
5698
-
5699
- & > .fig-overflow-end {
5700
- order: 1;
5701
- bottom: 0;
5702
- margin-block-start: calc(-1 * var(--fig-vertical-overflow-size));
5703
-
5704
- &::before {
5705
- border-radius: 0 0 var(--radius-large) var(--radius-large);
5706
- }
5707
- }
5708
-
5709
- }
5710
-
5711
- fig-select-options > fig-separator {
5712
- /* Align labels with select option text after the checkmark column. */
5713
- &[label]:not([label=""]) {
5714
- --fig-menu-inline-padding: 0 var(--spacer-2) 0 var(--spacer-5);
5715
-
5716
- &::before {
5717
- margin-inline: unset;
5718
- margin-left: calc(-1 * var(--spacer-5));
5719
- margin-right: calc(-1 * var(--spacer-2));
5720
- }
5721
- }
5722
- }
5723
-
5724
- fig-select-option {
5725
- display: flex;
5726
- align-items: center;
5727
- gap: 0;
5728
- position: relative;
5729
- min-height: var(--spacer-4);
5730
- height: auto;
5731
- padding: var(--spacer-1) var(--spacer-2);
5732
- padding-right: var(--spacer-3);
5733
- border-radius: var(--radius-medium);
5734
- color: var(--figma-color-text-menu);
5735
- cursor: default;
5736
- user-select: none;
5737
- white-space: nowrap;
5738
-
5739
- &::before {
5740
- content: "";
5741
- display: block;
5742
- position: absolute;
5743
- inset: 0 var(--spacer-2);
5744
- border-radius: var(--radius-medium);
5745
- z-index: -1;
5746
- background-color: transparent;
5747
- }
5748
-
5749
- &::after {
5750
- content: "";
5751
- display: block;
5752
- flex: 0 0 1rem;
5753
- order: -1;
5754
- width: 1rem;
5755
- height: 1rem;
5756
- margin-left: var(--spacer-1);
5757
- margin-right: var(--spacer-1);
5758
- background-color: currentColor;
5759
- -webkit-mask-image: var(--icon-16-checkmark);
5760
- mask-image: var(--icon-16-checkmark);
5761
- -webkit-mask-repeat: no-repeat;
5762
- mask-repeat: no-repeat;
5763
- -webkit-mask-position: center;
5764
- mask-position: center;
5765
- -webkit-mask-size: contain;
5766
- mask-size: contain;
5767
- visibility: hidden;
5768
- }
5769
-
5770
- & > [slot="prepend"] {
5771
- margin-top: calc(var(--spacer-1) * -1);
5772
- margin-bottom: calc(var(--spacer-1) * -1);
5773
- margin-right: var(--spacer-1);
5774
- }
5775
-
5776
-
5777
- & > :not([slot="prepend"]):not([slot="append"]) {
5778
- flex: 1 1 auto;
5779
- min-width: 0;
5780
- }
5781
-
5782
- & > [slot="append"] {
5783
- flex: 0 0 auto;
5784
- margin-inline-start: auto;
5785
- color: var(--figma-color-text-tertiary);
5786
- }
5787
-
5788
- &:hover,
5789
- &:focus-visible {
5790
- outline: none;
5791
-
5792
- &::before {
5793
- background-color: var(--figma-color-bg-menu-hover);
5794
- }
5795
- }
5796
-
5797
- &[selected]:not([selected="false"])::after,
5798
- &[aria-selected="true"]::after {
5799
- visibility: visible;
5800
- }
5801
-
5802
- &[disabled]:not([disabled="false"]),
5803
- &[aria-disabled="true"] {
5804
- opacity: 0.4;
5805
- pointer-events: none;
5806
- }
5807
- }
5808
-
5809
5545
  fig-menu-item {
5810
5546
  --fig-menu-item-padding: var(--spacer-4);
5811
5547
  display: flex;