@rogieking/figui3 9.0.11 → 9.0.13
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-editor/SKILL.md +1 -1
- package/.cursor/skills/fig-editor/components.md +2 -1
- package/.cursor/skills/fig-editor/reference.md +3 -2
- package/README.md +9 -1
- package/components.css +5 -4
- package/dist/components.css +1 -1
- package/dist/fig-editor.js +3 -3
- package/dist/fig.css +1 -1
- package/dist/fig.js +5 -1
- package/fig-editor.js +308 -56
- package/fig.js +8 -2
- package/package.json +1 -1
|
@@ -41,7 +41,7 @@ Registered tags:
|
|
|
41
41
|
- `fig-dropdown` (core): native `<select>`.
|
|
42
42
|
- `fig-select` (this skill): custom listbox. Use this for Figma-style menus.
|
|
43
43
|
|
|
44
|
-
Author options as React children, or pass `options`. Do not `stopPropagation` on option click. `optionhover` and `optionfocus` are native preview listeners.
|
|
44
|
+
Author options as React children, or pass `options`. Set `menu-anchor` to a selector or assign an element to `menuAnchor` when the menu should align against another element. Do not `stopPropagation` on option click. `optionhover` and `optionfocus` are native preview listeners.
|
|
45
45
|
|
|
46
46
|
## Fill picker
|
|
47
47
|
|
|
@@ -29,7 +29,8 @@ Data-driven (no authored options):
|
|
|
29
29
|
/>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
- Attrs: `value`, `label`, `options` (comma / newline / JSON), `variant` (`ghost`), `size` (`large`, 32px trigger), `subtle` (applies the secondary hover/focus fill to every option), `full`, `disabled`, `position` (`bottom left
|
|
32
|
+
- Attrs: `value`, `label`, `options` (comma / newline / JSON), `menu-anchor` (alternate anchor selector), `variant` (`ghost`), `size` (`large`, 32px trigger), `subtle` (applies the secondary hover/focus fill to every option), `full`, `disabled`, `position` (omit to overlay the selected option on the trigger; set `bottom left`, `bottom right`, `top left`, `top right`, `bottom center`, or `top center` to place the menu like a popup), `offset`, `closedby`, `open`
|
|
33
|
+
- Property: `menuAnchor` accepts an `Element`, selector string, or `null`. The menu matches the anchor width and centers its selected row over it; if the anchor is narrower than the menu’s usable minimum, default overlay mode centers the wider menu over the anchor. Clear it to restore trigger-text alignment. Explicit `position` keeps anchor-derived sizing while applying normal popup placement and edge alignment.
|
|
33
34
|
- Events: `input` / `change` on commit; `optionhover` for pointer previews; `optionfocus` for open-menu keyboard previews. Both preview events provide the option value in `detail` without changing selection and require native listeners.
|
|
34
35
|
- Do not `stopPropagation` on option click — React light-DOM handlers must run.
|
|
35
36
|
- Internal popup uses `popover="manual"` so the list works inside `fig-popup variant="popover"`.
|
|
@@ -21,12 +21,13 @@ Observed: `value`, `disabled`, `selected`, `label`.
|
|
|
21
21
|
|
|
22
22
|
## `fig-select` observed
|
|
23
23
|
|
|
24
|
-
`value`, `disabled`, `label`, `options`, `position`, `offset`, `closedby`, `open`, `variant`, `size`
|
|
24
|
+
`value`, `disabled`, `label`, `options`, `menu-anchor`, `position`, `offset`, `closedby`, `open`, `variant`, `size`
|
|
25
25
|
|
|
26
26
|
- `subtle` applies the secondary hover/focus fill to every option
|
|
27
27
|
- `size="large"` sets a 32px trigger
|
|
28
|
+
- `menu-anchor` accepts an alternate anchor selector; the `menuAnchor` property accepts an `Element`, selector string, or `null`
|
|
28
29
|
|
|
29
|
-
Position
|
|
30
|
+
Position: omit to overlay the selected option on the trigger. Set to place the menu like a popup:
|
|
30
31
|
|
|
31
32
|
- `bottom left`, `bottom right`, `top left`, `top right`, `bottom center`, `top center`
|
|
32
33
|
|
package/README.md
CHANGED
|
@@ -215,11 +215,12 @@ Custom listbox select with overflow chevrons, grouped options, and sticky separa
|
|
|
215
215
|
| `value` | string | — | Selected option value |
|
|
216
216
|
| `label` | string | — | Closed-state / accessible label |
|
|
217
217
|
| `options` | string | — | Comma, newline, or JSON options if no authored `fig-select-option` children |
|
|
218
|
+
| `menu-anchor` | CSS selector | — | Alternate element to align the open menu against |
|
|
218
219
|
| `variant` | string | — | `"ghost"` for a borderless control with secondary hover fill |
|
|
219
220
|
| `size` | string | — | `"large"` for a 32px-tall trigger |
|
|
220
221
|
| `subtle` | boolean | `false` | Use the secondary hover/focus fill for every option |
|
|
221
222
|
| `full` | boolean | `false` | Stretch to available width |
|
|
222
|
-
| `position` | string | `
|
|
223
|
+
| `position` | string | — | Omit to overlay the selected option on the trigger; set `bottom left`, `bottom right`, `top left`, `top right`, `bottom center`, or `top center` to place the menu like a popup |
|
|
223
224
|
| `disabled` | boolean | `false` | Disabled state |
|
|
224
225
|
|
|
225
226
|
Author options in `<fig-select-options>`, or pass `options`. Add `subtle` to one `<fig-select-option>` for the secondary hover/focus fill, or to `<fig-select>` to apply it to every option. Use `label` on `<fig-select-option>` when the option content is rich. `fig-separator` with `sticky` pins group labels while scrolling.
|
|
@@ -234,6 +235,13 @@ Author options in `<fig-select-options>`, or pass `options`. Add `subtle` to one
|
|
|
234
235
|
</fig-select>
|
|
235
236
|
```
|
|
236
237
|
|
|
238
|
+
Set `menu-anchor` to a selector, or assign an element to the `menuAnchor` property. The menu matches the anchor width and centers its selected row over the anchor. If the anchor is narrower than the menu’s usable minimum, the wider menu is centered over it in the default overlay mode. Removing the anchor restores trigger-text alignment. An explicit `position` keeps the anchor-derived width while applying normal popup placement and edge alignment relative to the menu anchor.
|
|
239
|
+
|
|
240
|
+
```js
|
|
241
|
+
document.querySelector("fig-select").menuAnchor =
|
|
242
|
+
document.querySelector("#menu-anchor");
|
|
243
|
+
```
|
|
244
|
+
|
|
237
245
|
**Events:** `input`, `change`, `optionhover` (`detail` is the hovered option value), `optionfocus` (`detail` is the keyboard-focused option value while the menu is open).
|
|
238
246
|
|
|
239
247
|
---
|
package/components.css
CHANGED
|
@@ -6248,14 +6248,15 @@ fig-menu-item {
|
|
|
6248
6248
|
display: none;
|
|
6249
6249
|
}
|
|
6250
6250
|
}
|
|
6251
|
-
|
|
6252
|
-
:is(fig-select-options, .fig-menu-options, fig-menu).overflow-start > & {
|
|
6253
|
-
top: var(--fig-vertical-overflow-size, var(--spacer-4,1rem));
|
|
6254
|
-
}
|
|
6255
6251
|
}
|
|
6256
6252
|
}
|
|
6257
6253
|
}
|
|
6258
6254
|
|
|
6255
|
+
:is(fig-select-options, .fig-menu-options, fig-menu).overflow-start
|
|
6256
|
+
> :is(fig-separator, fig-menu-separator)[label]:not([label=""])[sticky]:not([sticky="false"]) {
|
|
6257
|
+
top: var(--fig-vertical-overflow-size, var(--spacer-4, 1rem)) !important;
|
|
6258
|
+
}
|
|
6259
|
+
|
|
6259
6260
|
dialog[is="fig-popup"][theme="menu"]
|
|
6260
6261
|
:is(fig-separator, fig-menu-separator):first-child[label]:not([label=""])::before,
|
|
6261
6262
|
fig-select-options > :is(fig-separator, fig-menu-separator):first-child[label]:not([label=""])::before {
|