@rogieking/figui3 10.0.13 → 11.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/.cursor/skills/figui3/components.md +8 -15
- package/.cursor/skills/figui3/react.md +0 -1
- package/.cursor/skills/figui3/reference.md +3 -9
- package/CHANGELOG.md +26 -0
- package/README.md +6 -46
- package/components.css +42 -23
- package/dist/components.css +1 -1
- package/dist/fig.css +1 -1
- package/dist/fig.js +6 -6
- package/fig.js +0 -99
- package/package.json +1 -1
|
@@ -12,29 +12,22 @@ Handlers below assume `onInput` / `onChange` / `onClick` from [react.md](react.m
|
|
|
12
12
|
<fig-button variant="ghost" icon aria-label="Close" onClick={onClick}>
|
|
13
13
|
<fig-icon name="close" />
|
|
14
14
|
</fig-button>
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
- Attrs: `variant` (`""` primary, `secondary`, `destructive`, `destructiveSecondary`, `destructiveGhost`, `destructiveLink`, `ghost`, `link`, `input`, `overlay`), `type` (`button`, `toggle`, `submit`, `select`, `upload`), `size` (`""`, `large`, `compact`), `align`, `selected`, `disabled`, `icon`, `close-dialog`
|
|
18
|
-
- Events: `click`; toggle also reflects `selected`
|
|
19
|
-
|
|
20
|
-
### `fig-property-button`
|
|
21
15
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
icon="settings"
|
|
16
|
+
<fig-button
|
|
17
|
+
variant="property"
|
|
25
18
|
aria-haspopup="dialog"
|
|
26
19
|
aria-controls="effects-editor"
|
|
27
20
|
onClick={onClick}
|
|
28
21
|
>
|
|
22
|
+
<fig-icon name="settings" slot="prepend" />
|
|
29
23
|
Effects
|
|
30
|
-
</fig-
|
|
24
|
+
</fig-button>
|
|
31
25
|
```
|
|
32
26
|
|
|
33
|
-
- Attrs: `
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
- Events: `click`
|
|
27
|
+
- Attrs: `variant` (`""` primary, `secondary`, `property`, `destructive`, `destructiveSecondary`, `destructiveGhost`, `destructiveLink`, `ghost`, `link`, `input`, `overlay`), `type` (`button`, `toggle`, `submit`, `select`, `upload`), `size` (`""`, `large`, `compact`), `align`, `selected`, `disabled`, `icon`, `close-dialog`
|
|
28
|
+
- `variant="property"` shares secondary styling and adds full-width, start-aligned property-trigger layout; use `slot="prepend"` for its leading icon
|
|
29
|
+
- Property triggers own no popup behavior; consumers manage the popup/dialog and reflect `selected`, `aria-haspopup`, `aria-expanded`, and `aria-controls`
|
|
30
|
+
- Events: `click`; toggle also reflects `selected`
|
|
38
31
|
|
|
39
32
|
### `fig-button-combo`
|
|
40
33
|
|
|
@@ -11,18 +11,12 @@ Public API: `README.md`. React recipes: [components.md](components.md).
|
|
|
11
11
|
|
|
12
12
|
## `fig-button`
|
|
13
13
|
|
|
14
|
-
- `variant`: `""` (primary), `secondary`, `destructive`, `destructiveSecondary`, `destructiveGhost`, `destructiveLink`, `ghost`, `link`, `input`, `overlay`
|
|
14
|
+
- `variant`: `""` (primary), `secondary`, `property`, `destructive`, `destructiveSecondary`, `destructiveGhost`, `destructiveLink`, `ghost`, `link`, `input`, `overlay`
|
|
15
15
|
- `type`: `button`, `toggle`, `submit`, `select`, `upload`
|
|
16
16
|
- `size`: `""`, `large`, `compact`
|
|
17
17
|
- `selected`, `disabled`, `icon` (presence)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- `icon`: generated `fig-icon` name; optional when authoring custom `slot="prepend"` content
|
|
22
|
-
- `selected`, `disabled`
|
|
23
|
-
- `aria-haspopup`, `aria-expanded`, `aria-controls`
|
|
24
|
-
- Fixed secondary, full-width, start-aligned presentation
|
|
25
|
-
- Trigger only; consumers manage the popup/dialog
|
|
18
|
+
- `variant="property"` shares secondary styling and adds full-width, start-aligned layout
|
|
19
|
+
- Property icons use authored `slot="prepend"` content; consumers manage the popup/dialog
|
|
26
20
|
|
|
27
21
|
## `fig-input-text`
|
|
28
22
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [11.0.0]
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added `variant="property"` to `fig-button` with secondary styling and property-trigger layout.
|
|
10
|
+
- Added Button Combo playground examples for grouped buttons and action menus.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Removed `fig-property-button`; use `fig-button variant="property"` with an explicit prepend icon.
|
|
15
|
+
- Updated button combos to support property buttons, selects, dropdowns, and tooltip-wrapped controls.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Preserved `fig-select` and `fig-dropdown` chrome when grouped in button combos.
|
|
20
|
+
|
|
21
|
+
## [10.0.14]
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- Simplified the custom group-header example to one group with several fields.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Updated group chevrons to use the default icon color when hovering the header.
|
|
30
|
+
|
|
5
31
|
## [10.0.13]
|
|
6
32
|
|
|
7
33
|
### Changed
|
package/README.md
CHANGED
|
@@ -96,7 +96,6 @@ Minimal example:
|
|
|
96
96
|
| Component | Tag | Description |
|
|
97
97
|
|---|---|---|
|
|
98
98
|
| [Button](#button) | `<fig-button>` | Buttons with variants, toggle, select, upload |
|
|
99
|
-
| [Property Button](#property-button) | `<fig-property-button>` | Full-width secondary trigger for property editors |
|
|
100
99
|
| [Dropdown](#dropdown) | `<fig-dropdown>` | Native select wrapper with Figma styling |
|
|
101
100
|
| [Select](#select) | `<fig-select>` | Custom listbox select (requires `fig-editor.js`) |
|
|
102
101
|
| [Combo Input](#combo-input) | `<fig-combo-input>` | Text input with dropdown suggestions |
|
|
@@ -157,7 +156,7 @@ Minimal example:
|
|
|
157
156
|
|
|
158
157
|
| Attribute | Type | Default | Description |
|
|
159
158
|
|---|---|---|---|
|
|
160
|
-
| `variant` | string | `"primary"` | `"primary"`, `"secondary"`, `"destructive"`, `"destructiveSecondary"`, `"destructiveGhost"`, `"destructiveLink"`, `"ghost"`, `"link"` |
|
|
159
|
+
| `variant` | string | `"primary"` | `"primary"`, `"secondary"`, `"property"`, `"destructive"`, `"destructiveSecondary"`, `"destructiveGhost"`, `"destructiveLink"`, `"ghost"`, `"link"` |
|
|
161
160
|
| `type` | string | `"button"` | `"button"`, `"toggle"`, `"submit"`, `"select"`, `"upload"` |
|
|
162
161
|
| `size` | string | — | `"large"`, `"compact"` |
|
|
163
162
|
| `selected` | boolean | `false` | Selected state (toggle type) |
|
|
@@ -175,6 +174,10 @@ Minimal example:
|
|
|
175
174
|
<fig-button variant="destructiveGhost">Destructive ghost</fig-button>
|
|
176
175
|
<fig-button variant="destructiveLink">Destructive link</fig-button>
|
|
177
176
|
<fig-button full align="start">Start aligned</fig-button>
|
|
177
|
+
<fig-button variant="property">
|
|
178
|
+
<fig-icon name="settings" slot="prepend"></fig-icon>
|
|
179
|
+
Effects
|
|
180
|
+
</fig-button>
|
|
178
181
|
<fig-button type="toggle" selected="true">Toggle</fig-button>
|
|
179
182
|
<fig-button variant="ghost" icon>
|
|
180
183
|
<svg><!-- icon --></svg>
|
|
@@ -183,50 +186,7 @@ Minimal example:
|
|
|
183
186
|
|
|
184
187
|
`type="select"` and `type="upload"` are visual wrappers for native select/file controls. They avoid nested native buttons, show the shared focus outline on the wrapper, and open the native picker from keyboard activation where supported.
|
|
185
188
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
#### Property Button
|
|
189
|
-
|
|
190
|
-
`<fig-property-button>` — [demo](https://rog.ie/figui3/#property-button)
|
|
191
|
-
|
|
192
|
-
A full-width secondary trigger for opening an effect editor, binding editor, preset picker, or other property-specific flyout. The component supplies the surface and can generate a leading icon from `icon`, or accept custom prepend content, but does not create or position a popup.
|
|
193
|
-
|
|
194
|
-
| Attribute | Type | Default | Description |
|
|
195
|
-
|---|---|---|---|
|
|
196
|
-
| `icon` | string | — | `fig-icon` name rendered in the prepend slot |
|
|
197
|
-
| `slot="prepend"` | element | — | Custom leading icon/content; takes precedence over `icon` |
|
|
198
|
-
| `selected` | boolean | `false` | Selected styling, typically while the editor is open |
|
|
199
|
-
| `disabled` | boolean | `false` | Disabled state |
|
|
200
|
-
| `aria-haspopup` | string | — | Popup type exposed to assistive technology |
|
|
201
|
-
| `aria-expanded` | boolean | — | Whether the controlled flyout is open |
|
|
202
|
-
| `aria-controls` | string | — | ID of the controlled flyout |
|
|
203
|
-
|
|
204
|
-
```html
|
|
205
|
-
<fig-property-button
|
|
206
|
-
id="effects-trigger"
|
|
207
|
-
icon="settings"
|
|
208
|
-
aria-haspopup="dialog"
|
|
209
|
-
aria-controls="effects-editor"
|
|
210
|
-
>
|
|
211
|
-
Effects
|
|
212
|
-
</fig-property-button>
|
|
213
|
-
|
|
214
|
-
<fig-property-button>
|
|
215
|
-
<fig-icon name="sun" slot="prepend"></fig-icon>
|
|
216
|
-
Lighting effect
|
|
217
|
-
</fig-property-button>
|
|
218
|
-
|
|
219
|
-
<dialog
|
|
220
|
-
is="fig-popup"
|
|
221
|
-
id="effects-editor"
|
|
222
|
-
anchor="#effects-trigger"
|
|
223
|
-
position="bottom left"
|
|
224
|
-
>
|
|
225
|
-
<fig-content>Effect controls</fig-content>
|
|
226
|
-
</dialog>
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
Wire click/open state in application code. `variant="secondary"`, `full`, and start alignment are enforced by the component.
|
|
189
|
+
`variant="property"` shares the secondary visual treatment and adds the full-width, start-aligned property-trigger layout. Author a leading icon with `slot="prepend"`. The consumer owns any corresponding popup or dialog and can use `selected`, `aria-haspopup`, `aria-expanded`, and `aria-controls` on the button.
|
|
230
190
|
|
|
231
191
|
---
|
|
232
192
|
|
package/components.css
CHANGED
|
@@ -810,8 +810,7 @@ select,
|
|
|
810
810
|
|
|
811
811
|
/* Button */
|
|
812
812
|
button,
|
|
813
|
-
fig-button
|
|
814
|
-
fig-property-button {
|
|
813
|
+
fig-button {
|
|
815
814
|
--fig-button-content-alignment: center;
|
|
816
815
|
--fig-button-text-alignment: center;
|
|
817
816
|
|
|
@@ -947,8 +946,9 @@ fig-property-button {
|
|
|
947
946
|
&[variant="ghost"][disabled]:not([disabled="false"]) {
|
|
948
947
|
background-color: transparent;
|
|
949
948
|
}
|
|
950
|
-
/*
|
|
951
|
-
&[variant="secondary"]
|
|
949
|
+
/* Variants: Secondary and Property */
|
|
950
|
+
&[variant="secondary"],
|
|
951
|
+
&[variant="property"] {
|
|
952
952
|
box-shadow: inset 0 0 0 1px var(--figma-color-bordertranslucent);
|
|
953
953
|
padding: 0 calc(var(--spacer-2) - 1px);
|
|
954
954
|
background: none;
|
|
@@ -1018,7 +1018,7 @@ fig-property-button {
|
|
|
1018
1018
|
background-color: var(--figma-color-bg-disabled);
|
|
1019
1019
|
pointer-events: none;
|
|
1020
1020
|
cursor: not-allowed;
|
|
1021
|
-
&:not([variant="secondary"]):not([variant="destructiveSecondary"]):not(
|
|
1021
|
+
&:not([variant="secondary"]):not([variant="property"]):not([variant="destructiveSecondary"]):not(
|
|
1022
1022
|
[variant="destructiveGhost"]
|
|
1023
1023
|
):not(
|
|
1024
1024
|
[variant="destructiveLink"]
|
|
@@ -1029,6 +1029,7 @@ fig-property-button {
|
|
|
1029
1029
|
box-shadow: none;
|
|
1030
1030
|
}
|
|
1031
1031
|
&[variant="secondary"],
|
|
1032
|
+
&[variant="property"],
|
|
1032
1033
|
&[variant="destructiveSecondary"],
|
|
1033
1034
|
&[variant="destructiveGhost"],
|
|
1034
1035
|
&[variant="destructiveLink"],
|
|
@@ -1126,7 +1127,7 @@ fig-property-button {
|
|
|
1126
1127
|
stroke: currentColor;
|
|
1127
1128
|
}
|
|
1128
1129
|
}
|
|
1129
|
-
&:
|
|
1130
|
+
&:has(svg:first-child):not([icon]) {
|
|
1130
1131
|
padding-left: var(--spacer-1);
|
|
1131
1132
|
}
|
|
1132
1133
|
|
|
@@ -1156,17 +1157,20 @@ fig-property-button {
|
|
|
1156
1157
|
}
|
|
1157
1158
|
}
|
|
1158
1159
|
|
|
1159
|
-
fig-property
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1160
|
+
fig-button[variant="property"] {
|
|
1161
|
+
--fig-button-content-alignment: flex-start;
|
|
1162
|
+
--fig-button-text-alignment: start;
|
|
1163
|
+
|
|
1163
1164
|
width: 100%;
|
|
1164
|
-
flex: 1 1 auto;
|
|
1165
|
-
padding: 0 calc(var(--spacer-2) - 1px) 0 0;
|
|
1166
1165
|
|
|
1167
1166
|
&[selected]:not([selected="false"]) {
|
|
1168
1167
|
box-shadow: none;
|
|
1169
1168
|
}
|
|
1169
|
+
|
|
1170
|
+
&:has(> [slot="prepend"]) {
|
|
1171
|
+
flex: 1 1 auto;
|
|
1172
|
+
padding: 0 calc(var(--spacer-2) - 1px) 0 0;
|
|
1173
|
+
}
|
|
1170
1174
|
}
|
|
1171
1175
|
|
|
1172
1176
|
/* Combo button */
|
|
@@ -1206,21 +1210,32 @@ fig-input-combo {
|
|
|
1206
1210
|
}
|
|
1207
1211
|
|
|
1208
1212
|
:is(.fig-button-combo, fig-button-combo, .fig-input-combo, fig-input-combo):not(
|
|
1209
|
-
:has(
|
|
1210
|
-
|
|
1213
|
+
:has(
|
|
1214
|
+
> :not(:is([variant="secondary"], [variant="property"], fig-dropdown, fig-select)):not(fig-tooltip)
|
|
1215
|
+
)
|
|
1216
|
+
):not(
|
|
1217
|
+
:has(
|
|
1218
|
+
> fig-tooltip > :not(:is([variant="secondary"], [variant="property"], fig-dropdown, fig-select))
|
|
1219
|
+
)
|
|
1220
|
+
) {
|
|
1211
1221
|
gap: 0;
|
|
1212
1222
|
border-radius: var(--radius-medium);
|
|
1213
1223
|
box-shadow: inset 0 0 0 1px var(--figma-color-bordertranslucent);
|
|
1214
1224
|
|
|
1215
|
-
> [variant="secondary"],
|
|
1216
|
-
> fig-tooltip > [variant="secondary"] {
|
|
1225
|
+
> :is([variant="secondary"], [variant="property"]),
|
|
1226
|
+
> fig-tooltip > :is([variant="secondary"], [variant="property"]) {
|
|
1217
1227
|
box-shadow: none;
|
|
1218
1228
|
}
|
|
1219
1229
|
|
|
1220
|
-
> :is(
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1230
|
+
> :is(
|
|
1231
|
+
[variant="secondary"],
|
|
1232
|
+
[variant="property"],
|
|
1233
|
+
fig-tooltip:has(
|
|
1234
|
+
> :is([variant="secondary"], [variant="property"], fig-dropdown, fig-select)
|
|
1235
|
+
)
|
|
1236
|
+
) {
|
|
1237
|
+
+ :is([variant="secondary"], [variant="property"], fig-dropdown, fig-select),
|
|
1238
|
+
+ fig-tooltip > :is([variant="secondary"], [variant="property"], fig-dropdown, fig-select) {
|
|
1224
1239
|
background-image: linear-gradient(
|
|
1225
1240
|
var(--figma-color-bordertranslucent),
|
|
1226
1241
|
var(--figma-color-bordertranslucent)
|
|
@@ -1234,7 +1249,8 @@ fig-input-combo {
|
|
|
1234
1249
|
|
|
1235
1250
|
.fig-button-combo,
|
|
1236
1251
|
fig-button-combo {
|
|
1237
|
-
>
|
|
1252
|
+
> :not(fig-tooltip):not([variant="secondary"]):not([variant="property"]):not(fig-select):not(fig-dropdown):not(:first-child),
|
|
1253
|
+
> fig-tooltip:not(:first-child) > :not([variant="secondary"]):not([variant="property"]):not(fig-select):not(fig-dropdown){
|
|
1238
1254
|
box-shadow: inset 1px 0 0 0 var(--figma-color-bg-brand-hover);
|
|
1239
1255
|
&[disabled]:not([disabled="false"]) {
|
|
1240
1256
|
box-shadow: inset 1px 0 0 0 var(--figma-color-border-disabled);
|
|
@@ -3680,7 +3696,6 @@ fig-preview {
|
|
|
3680
3696
|
|
|
3681
3697
|
/* Web Components */
|
|
3682
3698
|
fig-button,
|
|
3683
|
-
fig-property-button,
|
|
3684
3699
|
fig-content,
|
|
3685
3700
|
fig-slider,
|
|
3686
3701
|
fig-switch,
|
|
@@ -3874,12 +3889,16 @@ fig-group {
|
|
|
3874
3889
|
&:has(> h3:hover, > .fig-group-chevron:hover) {
|
|
3875
3890
|
color: var(--figma-color-text);
|
|
3876
3891
|
.fig-group-chevron {
|
|
3877
|
-
color:
|
|
3892
|
+
color: var(--figma-color-icon);
|
|
3878
3893
|
}
|
|
3879
3894
|
}
|
|
3880
3895
|
}
|
|
3881
3896
|
}
|
|
3882
3897
|
|
|
3898
|
+
& > fig-header:hover > .fig-group-chevron {
|
|
3899
|
+
color: var(--figma-color-icon);
|
|
3900
|
+
}
|
|
3901
|
+
|
|
3883
3902
|
&[open]:not([open="false"]) > fig-header .fig-group-chevron {
|
|
3884
3903
|
transform: rotate(0deg);
|
|
3885
3904
|
}
|