@rogieking/figui3 11.0.3 → 11.1.1
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/components.md +1 -1
- package/.cursor/skills/fig-editor/reference.md +1 -0
- package/.cursor/skills/figui3/components.md +7 -4
- package/.cursor/skills/figui3/react.md +1 -0
- package/CHANGELOG.md +27 -0
- package/README.md +13 -5
- package/components.css +14 -2
- package/dist/components.css +1 -1
- package/dist/fig-editor.css +1 -1
- package/dist/fig.css +1 -1
- package/dist/fig.js +6 -6
- package/fig-editor.css +25 -1
- package/fig-editor.js +1 -1
- package/fig.js +172 -87
- package/package.json +1 -1
|
@@ -29,7 +29,7 @@ Data-driven (no authored options):
|
|
|
29
29
|
/>
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
- Attrs: `value`, `label`, `options` (comma / newline / JSON), `menu-anchor` (alternate anchor selector), `variant` (`ghost`), `size` (`large`, 32px trigger), `icon` (square chevron-only trigger; provide `aria-label`), `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`
|
|
32
|
+
- Attrs: `value`, `label`, `options` (comma / newline / JSON), `menu-anchor` (alternate anchor selector), `variant` (`ghost` | `input`), `size` (`large`, 32px trigger), `icon` (square chevron-only trigger; provide `aria-label`), `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
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.
|
|
34
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.
|
|
35
35
|
- Do not `stopPropagation` on option click — React light-DOM handlers must run.
|
|
@@ -24,6 +24,7 @@ Observed: `value`, `disabled`, `selected`, `label`.
|
|
|
24
24
|
`value`, `disabled`, `label`, `options`, `menu-anchor`, `position`, `offset`, `closedby`, `open`, `variant`, `size`
|
|
25
25
|
|
|
26
26
|
- `icon` renders a square chevron-only trigger; provide `aria-label`
|
|
27
|
+
- `variant="input"` matches input-style fill, hover, press, and focus states
|
|
27
28
|
- `subtle` applies the secondary hover/focus fill to every option
|
|
28
29
|
- `size="large"` sets a 32px trigger
|
|
29
30
|
- `menu-anchor` accepts an alternate anchor selector; the `menuAnchor` property accepts an `Element`, selector string, or `null`
|
|
@@ -53,12 +53,13 @@ Handlers below assume `onInput` / `onChange` / `onClick` from [react.md](react.m
|
|
|
53
53
|
- Events: `input` / `change` → `currentTarget.value`
|
|
54
54
|
- Prefer `fig-select` (editor) for Figma-style menus.
|
|
55
55
|
|
|
56
|
-
### `fig-
|
|
56
|
+
### `fig-split-input`
|
|
57
57
|
|
|
58
58
|
```tsx
|
|
59
|
-
<fig-
|
|
59
|
+
<fig-split-input
|
|
60
|
+
type="number"
|
|
60
61
|
value={value}
|
|
61
|
-
options="
|
|
62
|
+
options="8,16,24"
|
|
62
63
|
placeholder="Size"
|
|
63
64
|
full
|
|
64
65
|
onInput={onInput}
|
|
@@ -66,7 +67,9 @@ Handlers below assume `onInput` / `onChange` / `onClick` from [react.md](react.m
|
|
|
66
67
|
/>
|
|
67
68
|
```
|
|
68
69
|
|
|
69
|
-
- Attrs: `value`, `options`, `placeholder`, `disabled`, `full`
|
|
70
|
+
- Attrs: `type` (`text` | `number`, default `text`), `value`, `options`, `placeholder`, `disabled`, `full`
|
|
71
|
+
- Uses `fig-select` when the editor bundle is registered; otherwise uses core `fig-dropdown`.
|
|
72
|
+
- Legacy alias: `fig-combo-input`
|
|
70
73
|
|
|
71
74
|
### `fig-input-text`
|
|
72
75
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [11.1.1]
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Added missing disabled controls to the playground Attributes view.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Forwarded the `fig-slider` disabled state to its internal `fig-input-number`.
|
|
14
|
+
|
|
15
|
+
## [11.1.0]
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Added `fig-split-input` with text and number modes, full-width layout, and custom selector support; `fig-combo-input` remains as a legacy alias.
|
|
20
|
+
- Added `variant="input"` to `fig-select`.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Updated split inputs to prefer `fig-select` when available, fall back to `fig-dropdown`, and anchor select menus to the full split input.
|
|
25
|
+
- Added matching split-input playground examples, type presets, typings, and documentation.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Prevented hover styles from overriding the open state of `fig-select`.
|
|
30
|
+
- Preserved split-input values, accessibility attributes, events, and generated controls across updates and reconnects.
|
|
31
|
+
|
|
5
32
|
## [11.0.3]
|
|
6
33
|
|
|
7
34
|
### Fixed
|
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ Minimal example:
|
|
|
98
98
|
| [Button](#button) | `<fig-button>` | Buttons with variants, toggle, select, upload |
|
|
99
99
|
| [Dropdown](#dropdown) | `<fig-dropdown>` | Native select wrapper with Figma styling |
|
|
100
100
|
| [Select](#select) | `<fig-select>` | Custom listbox select (requires `fig-editor.js`) |
|
|
101
|
-
| [
|
|
101
|
+
| [Split Input](#split-input) | `<fig-split-input>` | Text or number input with dropdown suggestions |
|
|
102
102
|
| [Checkbox](#checkbox) | `<fig-checkbox>` | Checkbox with indeterminate state |
|
|
103
103
|
| [Radio](#radio) | `<fig-radio>` | Radio button |
|
|
104
104
|
| [Switch](#switch) | `<fig-switch>` | Toggle switch |
|
|
@@ -226,7 +226,7 @@ Custom listbox select with overflow chevrons, grouped options, and sticky separa
|
|
|
226
226
|
| `label` | string | — | Closed-state / accessible label |
|
|
227
227
|
| `options` | string | — | Comma, newline, or JSON options if no authored `fig-select-option` children |
|
|
228
228
|
| `menu-anchor` | CSS selector | — | Alternate element to align the open menu against |
|
|
229
|
-
| `variant` | string | — | `"ghost"` for a borderless control
|
|
229
|
+
| `variant` | string | — | `"ghost"` for a borderless control or `"input"` for input-style fill and interaction states |
|
|
230
230
|
| `size` | string | — | `"large"` for a 32px-tall trigger |
|
|
231
231
|
| `icon` | boolean | `false` | Render a square chevron-only trigger; provide `aria-label` |
|
|
232
232
|
| `subtle` | boolean | `false` | Use the secondary hover/focus fill for every option |
|
|
@@ -257,21 +257,29 @@ document.querySelector("fig-select").menuAnchor =
|
|
|
257
257
|
|
|
258
258
|
---
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
<a id="combo-input"></a>
|
|
261
|
+
|
|
262
|
+
#### Split Input
|
|
261
263
|
|
|
262
|
-
`<fig-
|
|
264
|
+
`<fig-split-input>` — [demo](https://rog.ie/figui3/#split-input)
|
|
263
265
|
|
|
264
266
|
| Attribute | Type | Default | Description |
|
|
265
267
|
|---|---|---|---|
|
|
268
|
+
| `type` | `text` \| `number` | `text` | Main input control |
|
|
266
269
|
| `options` | string | — | Comma-separated suggestion list |
|
|
267
270
|
| `placeholder` | string | — | Placeholder text |
|
|
268
271
|
| `value` | string | — | Current value |
|
|
269
272
|
| `disabled` | boolean | `false` | Disabled state |
|
|
273
|
+
| `full` | boolean | `false` | Expand to the available width |
|
|
270
274
|
|
|
271
275
|
```html
|
|
272
|
-
<fig-
|
|
276
|
+
<fig-split-input options="House, Apartment, Condo" placeholder="Residence type"></fig-split-input>
|
|
277
|
+
<fig-split-input type="number" options="8, 16, 24, 32" value="16"></fig-split-input>
|
|
273
278
|
```
|
|
274
279
|
|
|
280
|
+
`<fig-combo-input>` remains available as a legacy alias.
|
|
281
|
+
The suggestion trigger uses `fig-select` when `fig-editor.js` is registered and falls back to core `fig-dropdown`.
|
|
282
|
+
|
|
275
283
|
---
|
|
276
284
|
|
|
277
285
|
#### Checkbox
|
package/components.css
CHANGED
|
@@ -2652,25 +2652,37 @@ fig-origin-grid {
|
|
|
2652
2652
|
}
|
|
2653
2653
|
}
|
|
2654
2654
|
|
|
2655
|
-
/*
|
|
2655
|
+
/* Split input */
|
|
2656
|
+
fig-split-input,
|
|
2656
2657
|
fig-combo-input {
|
|
2657
2658
|
display: inline-flex;
|
|
2658
2659
|
flex: 1;
|
|
2659
2660
|
min-width: 0;
|
|
2660
2661
|
|
|
2662
|
+
&[full]:not([full="false"]) {
|
|
2663
|
+
width: 100%;
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2661
2666
|
> .input-combo {
|
|
2662
2667
|
flex: 1 1 auto;
|
|
2663
2668
|
width: 100%;
|
|
2664
2669
|
min-width: 0;
|
|
2665
2670
|
}
|
|
2666
2671
|
|
|
2667
|
-
fig-input-text
|
|
2672
|
+
fig-input-text,
|
|
2673
|
+
fig-input-number {
|
|
2668
2674
|
flex: 1 1 auto;
|
|
2669
2675
|
min-width: 0;
|
|
2670
2676
|
}
|
|
2671
2677
|
}
|
|
2672
2678
|
|
|
2679
|
+
fig-split-input fig-button[type="select"],
|
|
2673
2680
|
fig-combo-input fig-button[type="select"] {
|
|
2681
|
+
&[icon]:not([icon="false"]) {
|
|
2682
|
+
width: var(--spacer-4);
|
|
2683
|
+
padding: 0;
|
|
2684
|
+
}
|
|
2685
|
+
|
|
2674
2686
|
> fig-dropdown,
|
|
2675
2687
|
> fig-dropdown > select {
|
|
2676
2688
|
width: 100%;
|