@rogieking/figui3 9.1.6 → 9.2.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/figui3/components.md +30 -0
- package/.cursor/skills/figui3/react.md +1 -0
- package/.cursor/skills/figui3/reference.md +8 -0
- package/README.md +75 -0
- package/components.css +126 -29
- package/dist/components.css +1 -1
- package/dist/fig.css +1 -1
- package/dist/fig.js +6 -6
- package/fig.js +155 -1
- package/package.json +1 -1
|
@@ -17,6 +17,24 @@ Handlers below assume `onInput` / `onChange` / `onClick` from [react.md](react.m
|
|
|
17
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
18
|
- Events: `click`; toggle also reflects `selected`
|
|
19
19
|
|
|
20
|
+
### `fig-property-button`
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<fig-property-button
|
|
24
|
+
icon="settings"
|
|
25
|
+
aria-haspopup="dialog"
|
|
26
|
+
aria-controls="effects-editor"
|
|
27
|
+
onClick={onClick}
|
|
28
|
+
>
|
|
29
|
+
Effects
|
|
30
|
+
</fig-property-button>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- Attrs: `icon` (required fig-icon name), `selected`, `disabled`, `aria-haspopup`, `aria-expanded`, `aria-controls`
|
|
34
|
+
- Fixed presentation: secondary, full width, start aligned, leading icon
|
|
35
|
+
- Trigger only: the consumer owns and positions the corresponding popup/dialog
|
|
36
|
+
- Events: `click`
|
|
37
|
+
|
|
20
38
|
### `fig-button-combo`
|
|
21
39
|
|
|
22
40
|
```tsx
|
|
@@ -301,6 +319,18 @@ Handlers below assume `onInput` / `onChange` / `onClick` from [react.md](react.m
|
|
|
301
319
|
- Attrs: `direction` (`horizontal` | `vertical`), `label`, `columns`
|
|
302
320
|
- Put control attrs on the control, not the field.
|
|
303
321
|
|
|
322
|
+
### `fig-stack`
|
|
323
|
+
|
|
324
|
+
```tsx
|
|
325
|
+
<fig-stack direction="vertical" gap="3">
|
|
326
|
+
<fig-stack justify="between" full>{children}</fig-stack>
|
|
327
|
+
<fig-stack direction="grid" columns="3">{children}</fig-stack>
|
|
328
|
+
</fig-stack>
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
- Attrs: `direction` (`horizontal` default | `vertical` | `grid`), `gap` (spacer token or CSS length), `align`, `justify` (`start` | `center` | `end` | `between` | `around` | `stretch`), `wrap`, `full`, `columns` (grid), `min-width` (grid auto-fill)
|
|
332
|
+
- Use instead of the deprecated `hstack` / `vstack` tags.
|
|
333
|
+
|
|
304
334
|
### `fig-group`
|
|
305
335
|
|
|
306
336
|
```tsx
|
|
@@ -16,6 +16,14 @@ Public API: `README.md`. React recipes: [components.md](components.md).
|
|
|
16
16
|
- `size`: `""`, `large`, `compact`
|
|
17
17
|
- `selected`, `disabled`, `icon` (presence)
|
|
18
18
|
|
|
19
|
+
## `fig-property-button`
|
|
20
|
+
|
|
21
|
+
- `icon`: required `fig-icon` name
|
|
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
|
|
26
|
+
|
|
19
27
|
## `fig-input-text`
|
|
20
28
|
|
|
21
29
|
- `type`: `text`, `email`, `password`, `search`, `url`
|
package/README.md
CHANGED
|
@@ -95,6 +95,7 @@ Minimal example:
|
|
|
95
95
|
| Component | Tag | Description |
|
|
96
96
|
|---|---|---|
|
|
97
97
|
| [Button](#button) | `<fig-button>` | Buttons with variants, toggle, select, upload |
|
|
98
|
+
| [Property Button](#property-button) | `<fig-property-button>` | Full-width secondary trigger for property editors |
|
|
98
99
|
| [Dropdown](#dropdown) | `<fig-dropdown>` | Native select wrapper with Figma styling |
|
|
99
100
|
| [Select](#select) | `<fig-select>` | Custom listbox select (requires `fig-editor.js`) |
|
|
100
101
|
| [Combo Input](#combo-input) | `<fig-combo-input>` | Text input with dropdown suggestions |
|
|
@@ -180,6 +181,45 @@ Minimal example:
|
|
|
180
181
|
|
|
181
182
|
---
|
|
182
183
|
|
|
184
|
+
#### Property Button
|
|
185
|
+
|
|
186
|
+
`<fig-property-button>` — [demo](https://rog.ie/figui3/#property-button)
|
|
187
|
+
|
|
188
|
+
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 generated leading icon but does not create or position a popup.
|
|
189
|
+
|
|
190
|
+
| Attribute | Type | Default | Description |
|
|
191
|
+
|---|---|---|---|
|
|
192
|
+
| `icon` | string | required | `fig-icon` name rendered in the prepend slot |
|
|
193
|
+
| `selected` | boolean | `false` | Selected styling, typically while the editor is open |
|
|
194
|
+
| `disabled` | boolean | `false` | Disabled state |
|
|
195
|
+
| `aria-haspopup` | string | — | Popup type exposed to assistive technology |
|
|
196
|
+
| `aria-expanded` | boolean | — | Whether the controlled flyout is open |
|
|
197
|
+
| `aria-controls` | string | — | ID of the controlled flyout |
|
|
198
|
+
|
|
199
|
+
```html
|
|
200
|
+
<fig-property-button
|
|
201
|
+
id="effects-trigger"
|
|
202
|
+
icon="settings"
|
|
203
|
+
aria-haspopup="dialog"
|
|
204
|
+
aria-controls="effects-editor"
|
|
205
|
+
>
|
|
206
|
+
Effects
|
|
207
|
+
</fig-property-button>
|
|
208
|
+
|
|
209
|
+
<dialog
|
|
210
|
+
is="fig-popup"
|
|
211
|
+
id="effects-editor"
|
|
212
|
+
anchor="#effects-trigger"
|
|
213
|
+
position="bottom left"
|
|
214
|
+
>
|
|
215
|
+
<fig-content>Effect controls</fig-content>
|
|
216
|
+
</dialog>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Wire click/open state in application code. `variant="secondary"`, `full`, and start alignment are enforced by the component.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
183
223
|
#### Dropdown
|
|
184
224
|
|
|
185
225
|
`<fig-dropdown>` — [demo](https://rog.ie/figui3/#dropdown)
|
|
@@ -1073,6 +1113,41 @@ timelines. Unsupported browsers retain ordinary scrolling without a fade.
|
|
|
1073
1113
|
|
|
1074
1114
|
---
|
|
1075
1115
|
|
|
1116
|
+
#### Stack
|
|
1117
|
+
|
|
1118
|
+
`<fig-stack>` — [demo](https://rog.ie/figui3/#stack)
|
|
1119
|
+
|
|
1120
|
+
A layout primitive for rows, columns, and grids. Replaces the deprecated `hstack` / `vstack` tags, which still render as aliases.
|
|
1121
|
+
|
|
1122
|
+
| Attribute | Type | Default | Description |
|
|
1123
|
+
|---|---|---|---|
|
|
1124
|
+
| `direction` | string | `"horizontal"` | `"horizontal"`, `"vertical"`, `"grid"` |
|
|
1125
|
+
| `gap` | string | `"2"` | Spacer token (`"0"`–`"6"`, `"2-5"`, `"half"`) or any CSS length |
|
|
1126
|
+
| `align` | string | `"center"` (horizontal), `"start"` (vertical), `"stretch"` (grid) | `"start"`, `"center"`, `"end"`, `"stretch"`, `"baseline"` |
|
|
1127
|
+
| `justify` | string | `"start"` | `"start"`, `"center"`, `"end"`, `"between"`, `"around"`, `"stretch"` |
|
|
1128
|
+
| `wrap` | boolean | `false` | Wrap items onto multiple lines |
|
|
1129
|
+
| `full` | boolean | `false` | Fill the parent's width |
|
|
1130
|
+
| `columns` | string | auto-fill | Grid only: column count (`"3"`) or a `grid-template-columns` value |
|
|
1131
|
+
| `min-width` | string | `"5rem"` | Grid only: minimum auto-fill column width |
|
|
1132
|
+
|
|
1133
|
+
Adjacent `fig-field` children in a horizontal stack share compact gutters.
|
|
1134
|
+
|
|
1135
|
+
```html
|
|
1136
|
+
<fig-stack direction="vertical" gap="3">
|
|
1137
|
+
<fig-stack justify="between" full>
|
|
1138
|
+
<label>Layers</label>
|
|
1139
|
+
<fig-button variant="ghost" icon><fig-icon name="add"></fig-icon></fig-button>
|
|
1140
|
+
</fig-stack>
|
|
1141
|
+
<fig-stack direction="grid" columns="3">
|
|
1142
|
+
<fig-swatch value="#0D99FF"></fig-swatch>
|
|
1143
|
+
<fig-swatch value="#FFC700"></fig-swatch>
|
|
1144
|
+
<fig-swatch value="#14AE5C"></fig-swatch>
|
|
1145
|
+
</fig-stack>
|
|
1146
|
+
</fig-stack>
|
|
1147
|
+
```
|
|
1148
|
+
|
|
1149
|
+
---
|
|
1150
|
+
|
|
1076
1151
|
#### Field
|
|
1077
1152
|
|
|
1078
1153
|
`<fig-field>` — [demo](https://rog.ie/figui3/#field)
|
package/components.css
CHANGED
|
@@ -804,7 +804,8 @@ select,
|
|
|
804
804
|
|
|
805
805
|
/* Button */
|
|
806
806
|
button,
|
|
807
|
-
fig-button
|
|
807
|
+
fig-button,
|
|
808
|
+
fig-property-button {
|
|
808
809
|
--fig-button-content-alignment: center;
|
|
809
810
|
--fig-button-text-alignment: center;
|
|
810
811
|
|
|
@@ -1149,6 +1150,16 @@ fig-button {
|
|
|
1149
1150
|
}
|
|
1150
1151
|
}
|
|
1151
1152
|
|
|
1153
|
+
fig-property-button[icon]:not([icon="false"]) {
|
|
1154
|
+
width: 100%;
|
|
1155
|
+
flex: 1 1 auto;
|
|
1156
|
+
padding: 0 calc(var(--spacer-2) - 1px) 0 0;
|
|
1157
|
+
|
|
1158
|
+
&[selected]:not([selected="false"]) {
|
|
1159
|
+
box-shadow: none;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1152
1163
|
/* Combo button */
|
|
1153
1164
|
.fig-button-combo,
|
|
1154
1165
|
fig-button-combo,
|
|
@@ -1158,6 +1169,9 @@ fig-input-combo {
|
|
|
1158
1169
|
flex-wrap: nowrap;
|
|
1159
1170
|
align-items: center;
|
|
1160
1171
|
gap: 0px;
|
|
1172
|
+
&[full]:not([full="false"]) {
|
|
1173
|
+
width: 100%;
|
|
1174
|
+
}
|
|
1161
1175
|
& > * {
|
|
1162
1176
|
&:first-child,
|
|
1163
1177
|
&:first-child > * {
|
|
@@ -1181,6 +1195,30 @@ fig-input-combo {
|
|
|
1181
1195
|
fig-input-combo {
|
|
1182
1196
|
gap: 1px;
|
|
1183
1197
|
}
|
|
1198
|
+
|
|
1199
|
+
:is(.fig-button-combo, fig-button-combo, .fig-input-combo, fig-input-combo):not(
|
|
1200
|
+
:has(> :not([variant="secondary"]))
|
|
1201
|
+
) {
|
|
1202
|
+
gap: 0;
|
|
1203
|
+
border-radius: var(--radius-medium);
|
|
1204
|
+
box-shadow: inset 0 0 0 1px var(--figma-color-bordertranslucent);
|
|
1205
|
+
|
|
1206
|
+
> [variant="secondary"] {
|
|
1207
|
+
box-shadow: none;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
> [variant="secondary"] + [variant="secondary"] {
|
|
1211
|
+
box-shadow: none;
|
|
1212
|
+
background-image: linear-gradient(
|
|
1213
|
+
var(--figma-color-bordertranslucent),
|
|
1214
|
+
var(--figma-color-bordertranslucent)
|
|
1215
|
+
);
|
|
1216
|
+
background-position: left 1px;
|
|
1217
|
+
background-repeat: no-repeat;
|
|
1218
|
+
background-size: 1px calc(100% - 2px);
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1184
1222
|
.fig-button-combo,
|
|
1185
1223
|
fig-button-combo {
|
|
1186
1224
|
> *:not([variant="secondary"]):not(:first-child) {
|
|
@@ -1189,12 +1227,6 @@ fig-button-combo {
|
|
|
1189
1227
|
box-shadow: inset 1px 0 0 0 var(--figma-color-border-disabled);
|
|
1190
1228
|
}
|
|
1191
1229
|
}
|
|
1192
|
-
> *[variant="secondary"]:not(:first-child) {
|
|
1193
|
-
border-left-width: 0 !important;
|
|
1194
|
-
&[disabled]:not([disabled="false"]) {
|
|
1195
|
-
border-left-width: 0 !important;
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
1230
|
}
|
|
1199
1231
|
|
|
1200
1232
|
/* Tabs */
|
|
@@ -3625,6 +3657,7 @@ fig-preview {
|
|
|
3625
3657
|
|
|
3626
3658
|
/* Web Components */
|
|
3627
3659
|
fig-button,
|
|
3660
|
+
fig-property-button,
|
|
3628
3661
|
fig-content,
|
|
3629
3662
|
fig-slider,
|
|
3630
3663
|
fig-switch,
|
|
@@ -3941,47 +3974,111 @@ fig-content{
|
|
|
3941
3974
|
}
|
|
3942
3975
|
}
|
|
3943
3976
|
|
|
3944
|
-
vstack,
|
|
3945
|
-
.vstack,
|
|
3946
|
-
[vstack] {
|
|
3947
|
-
display: flex;
|
|
3948
|
-
flex-direction: column;
|
|
3949
|
-
align-items: start;
|
|
3950
|
-
gap: var(--spacer-2);
|
|
3951
|
-
flex-wrap: wrap;
|
|
3952
|
-
}
|
|
3953
|
-
|
|
3954
3977
|
:root [hidden],
|
|
3955
3978
|
[hidden] {
|
|
3956
3979
|
display: none !important;
|
|
3957
3980
|
}
|
|
3958
3981
|
|
|
3982
|
+
fig-stack,
|
|
3959
3983
|
hstack,
|
|
3960
|
-
.hstack
|
|
3984
|
+
.hstack,
|
|
3985
|
+
vstack,
|
|
3986
|
+
.vstack,
|
|
3987
|
+
[vstack] {
|
|
3961
3988
|
display: flex;
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3989
|
+
flex-direction: row;
|
|
3990
|
+
gap: var(--fig-stack-gap, var(--hstack-gap, var(--spacer-2)));
|
|
3991
|
+
align-items: var(--fig-stack-align, var(--hstack-align, center));
|
|
3992
|
+
justify-content: var(--fig-stack-justify, var(--hstack-justify, flex-start));
|
|
3993
|
+
flex-wrap: var(--fig-stack-wrap, var(--hstack-wrap, nowrap));
|
|
3994
|
+
min-width: 0;
|
|
3995
|
+
|
|
3996
|
+
&:where(fig-stack[direction="vertical"], vstack, .vstack, [vstack]) {
|
|
3997
|
+
flex-direction: column;
|
|
3998
|
+
--fig-stack-align: flex-start;
|
|
3999
|
+
}
|
|
4000
|
+
|
|
4001
|
+
&:where(vstack, .vstack, [vstack]) {
|
|
4002
|
+
--fig-stack-wrap: wrap;
|
|
4003
|
+
}
|
|
4004
|
+
|
|
4005
|
+
&:where([direction="grid"]) {
|
|
4006
|
+
display: grid;
|
|
4007
|
+
grid-template-columns: var(
|
|
4008
|
+
--fig-stack-columns,
|
|
4009
|
+
repeat(auto-fill, minmax(min(var(--fig-stack-min-width, 5rem), 100%), 1fr))
|
|
4010
|
+
);
|
|
4011
|
+
--fig-stack-align: stretch;
|
|
4012
|
+
justify-items: var(--fig-stack-justify-items, stretch);
|
|
4013
|
+
}
|
|
3966
4014
|
|
|
3967
4015
|
&[align="start"] {
|
|
3968
|
-
--
|
|
4016
|
+
--fig-stack-align: flex-start;
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
&[align="center"] {
|
|
4020
|
+
--fig-stack-align: center;
|
|
3969
4021
|
}
|
|
3970
4022
|
|
|
3971
4023
|
&[align="end"] {
|
|
3972
|
-
--
|
|
4024
|
+
--fig-stack-align: flex-end;
|
|
3973
4025
|
}
|
|
3974
4026
|
|
|
3975
4027
|
&[align="stretch"] {
|
|
3976
|
-
--
|
|
4028
|
+
--fig-stack-align: stretch;
|
|
4029
|
+
}
|
|
4030
|
+
|
|
4031
|
+
&[align="baseline"] {
|
|
4032
|
+
--fig-stack-align: baseline;
|
|
4033
|
+
}
|
|
4034
|
+
|
|
4035
|
+
&[justify="start"] {
|
|
4036
|
+
--fig-stack-justify: flex-start;
|
|
4037
|
+
--fig-stack-justify-items: start;
|
|
3977
4038
|
}
|
|
3978
4039
|
|
|
3979
|
-
&
|
|
3980
|
-
--fig-
|
|
4040
|
+
&[justify="center"] {
|
|
4041
|
+
--fig-stack-justify: center;
|
|
4042
|
+
--fig-stack-justify-items: center;
|
|
3981
4043
|
}
|
|
3982
4044
|
|
|
3983
|
-
&
|
|
3984
|
-
--fig-
|
|
4045
|
+
&[justify="end"] {
|
|
4046
|
+
--fig-stack-justify: flex-end;
|
|
4047
|
+
--fig-stack-justify-items: end;
|
|
4048
|
+
}
|
|
4049
|
+
|
|
4050
|
+
&[justify="between"] {
|
|
4051
|
+
--fig-stack-justify: space-between;
|
|
4052
|
+
}
|
|
4053
|
+
|
|
4054
|
+
&[justify="around"] {
|
|
4055
|
+
--fig-stack-justify: space-around;
|
|
4056
|
+
}
|
|
4057
|
+
|
|
4058
|
+
&[justify="stretch"] {
|
|
4059
|
+
--fig-stack-justify-items: stretch;
|
|
4060
|
+
}
|
|
4061
|
+
|
|
4062
|
+
&[wrap]:not([wrap="false"]) {
|
|
4063
|
+
--fig-stack-wrap: wrap;
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
&[wrap="false"] {
|
|
4067
|
+
--fig-stack-wrap: nowrap;
|
|
4068
|
+
}
|
|
4069
|
+
|
|
4070
|
+
&[full]:not([full="false"]) {
|
|
4071
|
+
width: 100%;
|
|
4072
|
+
}
|
|
4073
|
+
|
|
4074
|
+
&:is(fig-stack:not([direction]), fig-stack[direction="horizontal"], hstack, .hstack) {
|
|
4075
|
+
& > fig-field:has(+ fig-field) {
|
|
4076
|
+
--fig-field-right-padding: var(--spacer-1);
|
|
4077
|
+
}
|
|
4078
|
+
|
|
4079
|
+
& > fig-field + fig-field {
|
|
4080
|
+
--fig-field-left-padding: var(--spacer-1);
|
|
4081
|
+
}
|
|
3985
4082
|
}
|
|
3986
4083
|
}
|
|
3987
4084
|
|