@rogieking/figui3 6.20.1 → 6.21.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/README.md +50 -1
- package/components.css +63 -2
- package/dist/components.css +1 -1
- package/dist/fig-editor.css +1 -1
- package/dist/fig-editor.js +240 -98
- package/dist/fig-lab.css +1 -1
- package/dist/fig-lab.js +16 -16
- package/dist/fig.css +1 -1
- package/dist/fig.js +60 -43
- package/dist/propskit.css +1 -0
- package/dist/propskit.js +591 -0
- package/fig-editor.css +157 -17
- package/fig-editor.js +457 -187
- package/fig-lab.css +51 -42
- package/fig-lab.js +125 -9
- package/fig.js +538 -18
- package/package.json +33 -4
- package/propskit-core.js +556 -0
- package/propskit.d.ts +98 -0
- package/propskit.js +15 -0
package/README.md
CHANGED
|
@@ -75,6 +75,51 @@ Minimal example:
|
|
|
75
75
|
<fig-button variant="primary">Save</fig-button>
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
### PropsKit embed (one CSS + one JS)
|
|
79
|
+
|
|
80
|
+
For property panels inside a host app, use the compiled PropsKit pair (bundles fig + fig-lab + fig-editor, styles scoped to `.figui-root`):
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
import "@rogieking/figui3/propskit.css";
|
|
84
|
+
import { createPropsKit } from "@rogieking/figui3/propskit.js";
|
|
85
|
+
|
|
86
|
+
const layerConfig = {
|
|
87
|
+
name: { type: "text", default: "Layer 1", placeholder: "Enter a name" },
|
|
88
|
+
opacity: [75, 0, 100, 1], // slider: [value, min, max, step?]
|
|
89
|
+
visible: true, // switch
|
|
90
|
+
fill: "#0D99FF", // color (hex)
|
|
91
|
+
blend: {
|
|
92
|
+
type: "select",
|
|
93
|
+
options: ["Normal", "Multiply", "Screen", "Overlay"],
|
|
94
|
+
default: "Normal",
|
|
95
|
+
},
|
|
96
|
+
rotation: [0, -180, 180, 1],
|
|
97
|
+
cornerRadius: [8, 0, 64, 1],
|
|
98
|
+
easing: { type: "easing", value: [0.4, 0, 0.2, 1] },
|
|
99
|
+
shadow: {
|
|
100
|
+
_collapsed: true, // folder
|
|
101
|
+
offsetY: [8, 0, 24, 1],
|
|
102
|
+
blur: [16, 0, 48, 1],
|
|
103
|
+
color: "#000000",
|
|
104
|
+
},
|
|
105
|
+
reset: { type: "action" },
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
createPropsKit(mountEl, "Layer", layerConfig, {
|
|
109
|
+
theme: "system", // or "light" | "dark"
|
|
110
|
+
onChange: (path, value, values) => {},
|
|
111
|
+
onAction: (name) => {},
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```html
|
|
116
|
+
<aside class="figui-root" theme="system">…</aside>
|
|
117
|
+
<!-- or -->
|
|
118
|
+
<fig-panel theme="dark">…</fig-panel>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
One import for every host (`@rogieking/figui3/propskit.js`). Framework examples that call the same vanilla API live at `/propskit/quickstart`.
|
|
122
|
+
|
|
78
123
|
---
|
|
79
124
|
|
|
80
125
|
## Components
|
|
@@ -304,10 +349,13 @@ For `type="range"`, omitting `value` follows native range behavior and starts at
|
|
|
304
349
|
|
|
305
350
|
Composes a `<fig-field>` and `<fig-input-number>` into a full-surface property control. Number attributes are forwarded to the inner input.
|
|
306
351
|
|
|
352
|
+
PropsKit controls that support `size` default to the large layout when the attribute is omitted.
|
|
353
|
+
|
|
307
354
|
| Attribute | Type | Default | Description |
|
|
308
355
|
|---|---|---|---|
|
|
309
356
|
| `label` | string | `"Label"` | Field label text; use an empty value to hide it |
|
|
310
357
|
| `direction` | string | `"horizontal"` | Field layout direction |
|
|
358
|
+
| `size` | string | `"large"` | Control layout size |
|
|
311
359
|
| *number attrs* | — | — | All `<fig-input-number>` attributes are forwarded |
|
|
312
360
|
|
|
313
361
|
**Events:** `input`, `change` — forwarded from the inner number input.
|
|
@@ -392,7 +440,8 @@ Wraps a `<fig-field>` and `<fig-slider>` into a single labeled control. All slid
|
|
|
392
440
|
|---|---|---|---|
|
|
393
441
|
| `label` | string | — | Field label text |
|
|
394
442
|
| `direction` | string | `"column"` | Layout direction |
|
|
395
|
-
|
|
|
443
|
+
| `size` | string | `"large"` | Control layout size |
|
|
444
|
+
| *slider attrs* | — | — | All `<fig-slider>` attributes except host-only PropsKit attributes are forwarded |
|
|
396
445
|
|
|
397
446
|
**Events:** `input`, `change` — forwarded from the inner slider.
|
|
398
447
|
|
package/components.css
CHANGED
|
@@ -1847,7 +1847,6 @@ fig-media-controls {
|
|
|
1847
1847
|
align-items: center;
|
|
1848
1848
|
gap: var(--spacer-1);
|
|
1849
1849
|
width: 100%;
|
|
1850
|
-
|
|
1851
1850
|
|
|
1852
1851
|
&[overlay]:not([overlay="false"]) {
|
|
1853
1852
|
border-radius: var(--radius-medium);
|
|
@@ -1858,6 +1857,15 @@ fig-media-controls {
|
|
|
1858
1857
|
box-shadow: 0 0 0 1px var(--figma-color-bordertranslucent);
|
|
1859
1858
|
}
|
|
1860
1859
|
|
|
1860
|
+
&[disabled]:not([disabled="false"]) {
|
|
1861
|
+
pointer-events: none;
|
|
1862
|
+
color: var(--figma-color-text-disabled);
|
|
1863
|
+
|
|
1864
|
+
.fig-media-controls-time {
|
|
1865
|
+
color: var(--figma-color-text-disabled);
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1861
1869
|
> fig-slider {
|
|
1862
1870
|
flex: 1 1 auto;
|
|
1863
1871
|
min-width: 0;
|
|
@@ -3442,7 +3450,8 @@ fig-header {
|
|
|
3442
3450
|
margin-right: calc(var(--spacer-2) * -1);
|
|
3443
3451
|
}
|
|
3444
3452
|
|
|
3445
|
-
&>fig-dropdown
|
|
3453
|
+
&>fig-dropdown,
|
|
3454
|
+
&>fig-select{
|
|
3446
3455
|
&:first-child{
|
|
3447
3456
|
margin-left: calc(var(--spacer-2) * -1);
|
|
3448
3457
|
}
|
|
@@ -4302,6 +4311,52 @@ fig-spinner {
|
|
|
4302
4311
|
}
|
|
4303
4312
|
}
|
|
4304
4313
|
|
|
4314
|
+
fig-interpolation-swatch {
|
|
4315
|
+
position: relative;
|
|
4316
|
+
display: inline-flex;
|
|
4317
|
+
align-items: center;
|
|
4318
|
+
justify-content: center;
|
|
4319
|
+
width: 1.5rem;
|
|
4320
|
+
height: 1.5rem;
|
|
4321
|
+
flex: 0 0 auto;
|
|
4322
|
+
color: var(--figma-color-bordertranslucent);
|
|
4323
|
+
overflow: visible;
|
|
4324
|
+
|
|
4325
|
+
&[size="large"] {
|
|
4326
|
+
width: 2rem;
|
|
4327
|
+
height: 2rem;
|
|
4328
|
+
|
|
4329
|
+
.fig-interpolation-swatch-svg,
|
|
4330
|
+
.fig-interpolation-swatch-fill {
|
|
4331
|
+
width: 1.25rem;
|
|
4332
|
+
height: 1.25rem;
|
|
4333
|
+
}
|
|
4334
|
+
}
|
|
4335
|
+
|
|
4336
|
+
.fig-interpolation-swatch-svg {
|
|
4337
|
+
display: block;
|
|
4338
|
+
width: 1rem;
|
|
4339
|
+
height: 1rem;
|
|
4340
|
+
overflow: visible;
|
|
4341
|
+
}
|
|
4342
|
+
|
|
4343
|
+
.fig-interpolation-swatch-fill {
|
|
4344
|
+
position: absolute;
|
|
4345
|
+
top: 50%;
|
|
4346
|
+
left: 50%;
|
|
4347
|
+
transform: translate(-50%, -50%);
|
|
4348
|
+
width: 1rem;
|
|
4349
|
+
height: 1rem;
|
|
4350
|
+
background: linear-gradient(90deg, #ff0000, #4f9eff);
|
|
4351
|
+
-webkit-mask-size: 100% 100%;
|
|
4352
|
+
mask-size: 100% 100%;
|
|
4353
|
+
-webkit-mask-repeat: no-repeat;
|
|
4354
|
+
mask-repeat: no-repeat;
|
|
4355
|
+
-webkit-mask-position: center;
|
|
4356
|
+
mask-position: center;
|
|
4357
|
+
}
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4305
4360
|
/* Segmented control */
|
|
4306
4361
|
.segmented-control,
|
|
4307
4362
|
fig-segmented-control {
|
|
@@ -5525,6 +5580,12 @@ fig-menu-separator {
|
|
|
5525
5580
|
pointer-events: none;
|
|
5526
5581
|
user-select: none;
|
|
5527
5582
|
|
|
5583
|
+
&:first-of-type{
|
|
5584
|
+
&[label]:not([label=""])::before {
|
|
5585
|
+
display: none;
|
|
5586
|
+
}
|
|
5587
|
+
}
|
|
5588
|
+
|
|
5528
5589
|
/* Labeled: rule, then secondary group label (same pattern as menu optgroups). */
|
|
5529
5590
|
&[label]:not([label=""]) {
|
|
5530
5591
|
display: flex;
|