@rogieking/figui3 8.9.20 → 8.9.21
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/.cursor/skills/fig-lab/SKILL.md +3 -3
- package/components.css +19 -0
- package/dist/components.css +1 -1
- package/dist/fig-editor.js +2 -2
- package/dist/fig-lab.css +1 -1
- package/dist/fig-lab.js +1 -1
- package/dist/fig.css +1 -1
- package/dist/fig.js +1 -1
- package/fig-editor.js +2 -0
- package/fig-lab.css +29 -8
- package/fig-lab.js +3 -0
- package/fig.js +2 -1
- package/package.json +1 -1
package/fig-editor.js
CHANGED
|
@@ -2228,6 +2228,8 @@ class FigFillPicker extends HTMLElement {
|
|
|
2228
2228
|
if (this.#isDisabled()) return;
|
|
2229
2229
|
if (!this.#dialog) {
|
|
2230
2230
|
this.#createDialog();
|
|
2231
|
+
} else {
|
|
2232
|
+
this.#dialog.anchor = this.anchorElement || this.#trigger;
|
|
2231
2233
|
}
|
|
2232
2234
|
|
|
2233
2235
|
this.#valueAtOpen = JSON.stringify(this.value);
|
package/fig-lab.css
CHANGED
|
@@ -658,20 +658,41 @@ propskit-gradient {
|
|
|
658
658
|
}
|
|
659
659
|
|
|
660
660
|
:is(propskit-color, propskit-fill, propskit-gradient) {
|
|
661
|
+
outline: none;
|
|
662
|
+
|
|
661
663
|
fig-field:not([direction="vertical"]) {
|
|
662
664
|
outline: none;
|
|
665
|
+
}
|
|
663
666
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
+
&:focus-within fig-field:not([direction="vertical"]),
|
|
668
|
+
&.has-popup-open fig-field:not([direction="vertical"]) {
|
|
669
|
+
outline: var(--figma-focus-outline);
|
|
670
|
+
outline-offset: var(--figma-focus-outline-offset);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/* Same split as fig-input-gradient: chrome outlines, inner focus does not. */
|
|
674
|
+
:is(fig-swatch, fig-chit, fig-input-gradient, fig-input-fill, fig-fill-picker) {
|
|
675
|
+
--selected: 0 !important;
|
|
676
|
+
|
|
677
|
+
&:hover,
|
|
678
|
+
&:focus,
|
|
679
|
+
&:active {
|
|
680
|
+
outline: 0 !important;
|
|
667
681
|
}
|
|
668
682
|
|
|
669
|
-
:
|
|
670
|
-
|
|
671
|
-
&.has-popup-open {
|
|
672
|
-
outline: none !important;
|
|
673
|
-
}
|
|
683
|
+
&:focus-within:not(:focus) {
|
|
684
|
+
outline: 0 !important;
|
|
674
685
|
}
|
|
686
|
+
|
|
687
|
+
&:focus-within:not(:focus) :is(input, fig-swatch, fig-chit) {
|
|
688
|
+
outline: 0 !important;
|
|
689
|
+
outline-offset: 0 !important;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
input[type="color"]:is(:focus, :focus-visible) {
|
|
694
|
+
outline: 0 !important;
|
|
695
|
+
outline-offset: 0 !important;
|
|
675
696
|
}
|
|
676
697
|
}
|
|
677
698
|
|
package/fig-lab.js
CHANGED
|
@@ -922,6 +922,7 @@ class PropskitColor extends HTMLElement {
|
|
|
922
922
|
const label = customLabel || document.createElement("label");
|
|
923
923
|
const picker = document.createElement("fig-fill-picker");
|
|
924
924
|
const swatch = document.createElement("fig-swatch");
|
|
925
|
+
picker.anchorElement = this;
|
|
925
926
|
picker.append(swatch);
|
|
926
927
|
swatch.setAttribute("tabindex", "0");
|
|
927
928
|
for (const node of initialChildren) {
|
|
@@ -1278,6 +1279,7 @@ class PropskitFill extends HTMLElement {
|
|
|
1278
1279
|
const label = customLabel || document.createElement("label");
|
|
1279
1280
|
const picker = document.createElement("fig-fill-picker");
|
|
1280
1281
|
const swatch = document.createElement("fig-swatch");
|
|
1282
|
+
picker.anchorElement = this;
|
|
1281
1283
|
picker.append(swatch);
|
|
1282
1284
|
swatch.setAttribute("tabindex", "0");
|
|
1283
1285
|
for (const node of initialChildren) {
|
|
@@ -1646,6 +1648,7 @@ class PropskitGradient extends HTMLElement {
|
|
|
1646
1648
|
const field = document.createElement("fig-field");
|
|
1647
1649
|
const label = customLabel || document.createElement("label");
|
|
1648
1650
|
const input = document.createElement("fig-input-gradient");
|
|
1651
|
+
input.anchorElement = this;
|
|
1649
1652
|
|
|
1650
1653
|
field.append(label, input);
|
|
1651
1654
|
this.#field = field;
|
package/fig.js
CHANGED
|
@@ -10363,6 +10363,7 @@ class FigInputGradient extends HTMLElement {
|
|
|
10363
10363
|
#colorObserver = null;
|
|
10364
10364
|
#repositionRAF = null;
|
|
10365
10365
|
#pickerDefinitionPromise = null;
|
|
10366
|
+
anchorElement = null;
|
|
10366
10367
|
#gradient = {
|
|
10367
10368
|
type: "linear",
|
|
10368
10369
|
angle: 90,
|
|
@@ -10733,7 +10734,7 @@ class FigInputGradient extends HTMLElement {
|
|
|
10733
10734
|
#setupPickerEvents() {
|
|
10734
10735
|
const picker = this.querySelector("fig-fill-picker");
|
|
10735
10736
|
if (!picker) return;
|
|
10736
|
-
picker.anchorElement = this;
|
|
10737
|
+
picker.anchorElement = this.anchorElement || this;
|
|
10737
10738
|
|
|
10738
10739
|
const syncFromPicker = (e) => {
|
|
10739
10740
|
e.stopPropagation();
|
package/package.json
CHANGED