@rogieking/figui3 3.7.0 → 3.8.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 +4 -3
- package/base.css +4 -2
- package/components.css +83 -56
- package/dist/editor.js +10718 -0
- package/fig.js +67 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,17 +63,18 @@ git clone https://github.com/rogie/figui3.git
|
|
|
63
63
|
cd figui3
|
|
64
64
|
bun install
|
|
65
65
|
bun dev # Core component docs at http://localhost:3000
|
|
66
|
-
npm run dev:playground # Interactive playground app (routes: /figui3, /propkit)
|
|
66
|
+
npm run dev:playground # Interactive playground app (routes: /figui3, /propkit, /sandbox)
|
|
67
67
|
npm run build:playground # Build playground app
|
|
68
68
|
bun build # Build dist/fig.js
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
### Playground (`/figui3
|
|
71
|
+
### Playground (`/figui3`, `/propkit`, and `/sandbox`)
|
|
72
72
|
|
|
73
73
|
The playground app is the fastest way to author and validate component markup.
|
|
74
74
|
|
|
75
75
|
- **`/figui3`**: component-focused examples and attribute controls for FigUI3 primitives.
|
|
76
76
|
- **`/propkit`**: property-panel patterns composed from FigUI3 controls.
|
|
77
|
+
- **`/sandbox`**: a styled React sample app for quick layout and interaction prototyping.
|
|
77
78
|
- Live preview, attributes editing, and code view stay synchronized.
|
|
78
79
|
- Attribute controls write real component markup and preserve internal-only playground metadata where needed.
|
|
79
80
|
|
|
@@ -81,7 +82,7 @@ Open locally:
|
|
|
81
82
|
|
|
82
83
|
```bash
|
|
83
84
|
npm run dev:playground
|
|
84
|
-
# then visit http://localhost:5173/figui3 or
|
|
85
|
+
# then visit http://localhost:5173/figui3, /propkit, or /sandbox
|
|
85
86
|
```
|
|
86
87
|
|
|
87
88
|
## Quick Start
|
package/base.css
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
html
|
|
1
|
+
html,
|
|
2
|
+
:host {
|
|
2
3
|
width: 100%;
|
|
3
4
|
height: 100%;
|
|
4
5
|
margin: 0;
|
|
@@ -12,7 +13,8 @@ html {
|
|
|
12
13
|
letter-spacing: var(--body-letter-spacing);
|
|
13
14
|
background-color: var(--figma-color-bg);
|
|
14
15
|
}
|
|
15
|
-
body
|
|
16
|
+
body,
|
|
17
|
+
:host {
|
|
16
18
|
font-size: var(--body-medium-fontSize);
|
|
17
19
|
letter-spacing: var(--body-letter-spacing);
|
|
18
20
|
}
|
package/components.css
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
:root
|
|
1
|
+
:root,
|
|
2
|
+
:host {
|
|
2
3
|
color-scheme: light dark;
|
|
3
4
|
|
|
4
5
|
/* Background Colors */
|
|
@@ -190,7 +191,8 @@
|
|
|
190
191
|
--figma-color-text-menu-tertiary: rgba(255, 255, 255, 0.4);
|
|
191
192
|
}
|
|
192
193
|
|
|
193
|
-
:root
|
|
194
|
+
:root,
|
|
195
|
+
:host {
|
|
194
196
|
/* Typography & Sizing */
|
|
195
197
|
--font-size: 16px;
|
|
196
198
|
--font-family:
|
|
@@ -314,6 +316,7 @@
|
|
|
314
316
|
/* Icons - colorless shapes for use with mask-image */
|
|
315
317
|
--icon-chevron: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.87868 7.12132L8 9.24264L10.1213 7.12132' stroke='black' stroke-linecap='round'/%3E%3C/svg%3E%0A");
|
|
316
318
|
--icon-checkmark: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.084 4.22266C11.2372 3.99292 11.5476 3.93084 11.7773 4.08398C12.0071 4.23716 12.0692 4.54758 11.916 4.77734L7.91602 10.7773C7.83292 10.902 7.6979 10.9833 7.54883 10.998C7.39993 11.0126 7.25229 10.9593 7.14648 10.8535L4.14648 7.85352C3.95126 7.65825 3.95123 7.34173 4.14648 7.14648C4.34174 6.95124 4.65825 6.95126 4.85352 7.14648L7.42188 9.71484L11.084 4.22266Z' fill='white'/%3E%3C/svg%3E%0A");
|
|
319
|
+
--icon-reset: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' fill-rule='evenodd' d='M6.354 2.146a.5.5 0 0 1 0 .708L5.207 4H8.5a5 5 0 1 1-5 5 .5.5 0 0 1 1 0 4 4 0 1 0 4-4H5.207l1.147 1.146a.5.5 0 1 1-.708.708l-2-2a.5.5 0 0 1 0-.708l2-2a.5.5 0 0 1 .708 0' clip-rule='evenodd'/%3E%3C/svg%3E");
|
|
317
320
|
--icon-steppers: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.7245 6.08191C11.9186 5.95386 12.1826 5.97562 12.3534 6.14637L14.3534 8.14637L14.4179 8.22449C14.546 8.41852 14.5242 8.68253 14.3534 8.8534C14.1826 9.02426 13.9186 9.04601 13.7245 8.91785L13.6464 8.8534L11.9999 7.20691L10.3534 8.8534C10.1582 9.04866 9.84166 9.04866 9.6464 8.8534C9.45123 8.65813 9.45117 8.3416 9.6464 8.14637L11.6464 6.14637L11.7245 6.08191Z' fill='black'/%3E%3Cpath d='M13.7248 15.0822C13.9189 14.9541 14.1829 14.9758 14.3537 15.1467C14.5246 15.3176 14.5463 15.5815 14.4182 15.7756L14.3537 15.8537L12.3537 17.8537C12.1829 18.0246 11.9189 18.0463 11.7248 17.9182L11.6467 17.8537L9.64669 15.8537L9.58224 15.7756C9.45407 15.5815 9.47583 15.3176 9.64669 15.1467C9.81756 14.9758 10.0815 14.9541 10.2756 15.0822L10.3537 15.1467L12.0002 16.7932L13.6467 15.1467L13.7248 15.0822Z' fill='black' /%3E%3C/svg%3E%0A");
|
|
318
321
|
--icon-eyedropper: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15.1592 5.65801C16.0376 4.78045 17.4621 4.78055 18.3408 5.65899L18.4951 5.82989C19.1671 6.65442 19.168 7.84476 18.4951 8.66973L18.3408 8.84063L16.6455 10.533C17.1104 11.083 17.1181 11.889 16.6641 12.4461L16.5605 12.5604C16.0111 13.1097 15.1425 13.1428 14.5537 12.6629L14.5342 12.6453L10.0908 17.0916C9.6188 17.5633 8.98876 17.7764 8.375 17.742L7.56055 18.5574C6.97441 19.1432 6.02451 19.1422 5.43945 18.5584V18.5574C4.8538 17.9718 4.85405 17.0221 5.43945 16.4363L6.25586 15.618C6.22412 15.0058 6.44026 14.3794 6.90918 13.91L11.3516 9.46367C10.856 8.87434 10.885 7.99381 11.4395 7.43926L11.5537 7.33574C12.1094 6.88283 12.9136 6.88854 13.4639 7.35137L15.1592 5.65801ZM7.61621 14.617C7.33755 14.8961 7.21782 15.2747 7.25781 15.6385C7.27925 15.8351 7.24419 16.0445 7.10449 16.1844L6.14648 17.1434C5.9516 17.3387 5.95135 17.6553 6.14648 17.8504C6.34167 18.0449 6.65842 18.0451 6.85352 17.8504L7.80859 16.8943C7.94931 16.7536 8.16065 16.7184 8.3584 16.741C8.72329 16.7828 9.10374 16.6643 9.38379 16.3846L13.8223 11.9432L12.0547 10.1756L7.61621 14.617ZM17.6338 6.36602C17.1458 5.87828 16.3544 5.8783 15.8662 6.36602L14.084 8.14629L14.0186 8.20586C13.6767 8.48476 13.1722 8.46484 12.8535 8.14629C12.6583 7.95131 12.3417 7.95119 12.1465 8.14629C11.9514 8.34148 11.9515 8.65808 12.1465 8.85332L15.1465 11.8533C15.3175 12.024 15.5814 12.0451 15.7754 11.9168L15.8535 11.8533C16.0486 11.6582 16.0484 11.3416 15.8535 11.1463V11.1453C15.8524 11.1443 15.8507 11.1434 15.8496 11.1424C15.5128 10.8013 15.514 10.2513 15.8535 9.91192L17.6338 8.1336C18.1216 7.6457 18.1213 6.85425 17.6338 6.36602Z' fill='black' fill-opacity='0.9'/%3E%3C/svg%3E");
|
|
319
322
|
--icon-add: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 6C12.2761 6 12.5 6.22386 12.5 6.5V11.5H17.5C17.7761 11.5 18 11.7239 18 12C18 12.2761 17.7761 12.5 17.5 12.5H12.5V17.5C12.5 17.7761 12.2761 18 12 18C11.7239 18 11.5 17.7761 11.5 17.5V12.5H6.5C6.22386 12.5 6 12.2761 6 12C6 11.7239 6.22386 11.5 6.5 11.5H11.5V6.5C11.5 6.22386 11.7239 6 12 6Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
@@ -1387,19 +1390,13 @@ fig-easing-curve {
|
|
|
1387
1390
|
flex-direction: column;
|
|
1388
1391
|
gap: var(--spacer-2);
|
|
1389
1392
|
--stroke-width: 1;
|
|
1390
|
-
--easing-bezier-handle-radius:
|
|
1391
|
-
--easing-spring-handle-radius:
|
|
1393
|
+
--easing-bezier-handle-radius: 6;
|
|
1394
|
+
--easing-spring-handle-radius: 6;
|
|
1392
1395
|
--easing-handle-fill: var(--figma-color-border-strong);
|
|
1393
|
-
--easing-handle-fill-active: var(--figma-color-bg-brand);
|
|
1394
|
-
--easing-handle-stroke: var(--figma-color-bg-secondary);
|
|
1395
|
-
--easing-handle-stroke-width: var(--stroke-width);
|
|
1396
1396
|
--easing-duration-bar-width: 4.25;
|
|
1397
1397
|
--easing-duration-bar-height: 16;
|
|
1398
1398
|
--easing-duration-bar-radius: 3;
|
|
1399
1399
|
--aspect-ratio: 1 / 1;
|
|
1400
|
-
--easing-duration-bar-fill: var(--figma-color-border-strong);
|
|
1401
|
-
--easing-duration-bar-stroke: var(--figma-color-bg-secondary);
|
|
1402
|
-
--easing-duration-bar-stroke-width: var(--stroke-width);
|
|
1403
1400
|
|
|
1404
1401
|
width: 100%;
|
|
1405
1402
|
.fig-easing-curve-svg {
|
|
@@ -1458,35 +1455,28 @@ fig-easing-curve {
|
|
|
1458
1455
|
stroke-linecap: round;
|
|
1459
1456
|
}
|
|
1460
1457
|
.fig-easing-curve-handle {
|
|
1461
|
-
|
|
1462
|
-
cursor: default;
|
|
1458
|
+
overflow: visible;
|
|
1463
1459
|
pointer-events: all;
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1460
|
+
cursor: default;
|
|
1461
|
+
|
|
1462
|
+
fig-handle {
|
|
1463
|
+
width: 100%;
|
|
1464
|
+
height: 100%;
|
|
1465
|
+
pointer-events: all;
|
|
1466
|
+
cursor: default;
|
|
1468
1467
|
}
|
|
1469
|
-
|
|
1468
|
+
|
|
1469
|
+
&:active fig-handle {
|
|
1470
1470
|
cursor: grabbing;
|
|
1471
|
-
fill: var(--easing-handle-fill-active);
|
|
1472
1471
|
}
|
|
1473
1472
|
}
|
|
1474
1473
|
.fig-easing-curve-endpoint {
|
|
1475
1474
|
fill: var(--easing-handle-fill);
|
|
1476
1475
|
}
|
|
1477
|
-
.fig-easing-curve-duration-bar {
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
cursor: default;
|
|
1482
|
-
pointer-events: all;
|
|
1483
|
-
&:hover {
|
|
1484
|
-
fill: var(--easing-handle-fill-active);
|
|
1485
|
-
}
|
|
1486
|
-
&:active {
|
|
1487
|
-
cursor: grabbing;
|
|
1488
|
-
fill: var(--easing-handle-fill-active);
|
|
1489
|
-
}
|
|
1476
|
+
.fig-easing-curve-duration-bar fig-handle {
|
|
1477
|
+
--border-radius: calc(var(--easing-duration-bar-radius) * 1px);
|
|
1478
|
+
--width: calc(var(--easing-duration-bar-width) * 1px);
|
|
1479
|
+
--height: calc(var(--easing-duration-bar-height) * 1px);
|
|
1490
1480
|
}
|
|
1491
1481
|
.fig-easing-curve-dropdown {
|
|
1492
1482
|
option svg {
|
|
@@ -1727,13 +1717,13 @@ fig-origin-grid {
|
|
|
1727
1717
|
&.is-dragging {
|
|
1728
1718
|
cursor: grabbing !important;
|
|
1729
1719
|
|
|
1730
|
-
|
|
1720
|
+
fig-handle {
|
|
1731
1721
|
cursor: grabbing !important;
|
|
1732
1722
|
}
|
|
1733
1723
|
}
|
|
1734
1724
|
|
|
1735
1725
|
&.drag-disabled {
|
|
1736
|
-
|
|
1726
|
+
fig-handle {
|
|
1737
1727
|
cursor: default;
|
|
1738
1728
|
}
|
|
1739
1729
|
}
|
|
@@ -1772,25 +1762,19 @@ fig-origin-grid {
|
|
|
1772
1762
|
}
|
|
1773
1763
|
}
|
|
1774
1764
|
|
|
1775
|
-
|
|
1765
|
+
fig-handle {
|
|
1776
1766
|
--origin-overflow-rotation: 0deg;
|
|
1777
1767
|
--origin-overflow-nudge-base: var(--spacer-2-5);
|
|
1778
1768
|
--origin-overflow-nudge-x: 0px;
|
|
1779
1769
|
--origin-overflow-nudge-y: 0px;
|
|
1780
|
-
--origin-grid-handle-radius: var(--radius-small);
|
|
1781
1770
|
--origin-overflow-nudge-x-scale: calc((100cqb / 100cqi) * -1);
|
|
1782
1771
|
--origin-overflow-nudge-y-scale: calc((100cqb / 100cqi) * -1);
|
|
1772
|
+
--width: var(--origin-grid-handle-size);
|
|
1773
|
+
--height: var(--origin-grid-handle-size);
|
|
1774
|
+
--border-radius: var(--radius-small);
|
|
1783
1775
|
position: absolute;
|
|
1784
1776
|
left: 50%;
|
|
1785
1777
|
top: 50%;
|
|
1786
|
-
width: var(--origin-grid-handle-size);
|
|
1787
|
-
height: var(--origin-grid-handle-size);
|
|
1788
|
-
border-radius: var(--origin-grid-handle-radius);
|
|
1789
|
-
background: var(--figma-color-bg-brand);
|
|
1790
|
-
box-shadow:
|
|
1791
|
-
inset 0 0 0 0.09375rem var(--handle-color),
|
|
1792
|
-
0px 0 0 0.5px rgba(0, 0, 0, 0.1),
|
|
1793
|
-
var(--elevation-100-canvas);
|
|
1794
1778
|
transform: translate(
|
|
1795
1779
|
calc(-50% + var(--origin-overflow-nudge-x)),
|
|
1796
1780
|
calc(-50% + var(--origin-overflow-nudge-y))
|
|
@@ -1809,8 +1793,8 @@ fig-origin-grid {
|
|
|
1809
1793
|
mask-position: center;
|
|
1810
1794
|
-webkit-mask-size: 24px 24px;
|
|
1811
1795
|
mask-size: 24px 24px;
|
|
1812
|
-
border-radius: 0;
|
|
1813
|
-
box-shadow: none;
|
|
1796
|
+
--border-radius: 0;
|
|
1797
|
+
--box-shadow: none;
|
|
1814
1798
|
}
|
|
1815
1799
|
|
|
1816
1800
|
&.beyond-bounds-x.overflow-right {
|
|
@@ -3290,6 +3274,8 @@ fig-field-slider {
|
|
|
3290
3274
|
}
|
|
3291
3275
|
|
|
3292
3276
|
&[disabled]:not([disabled="false"]) {
|
|
3277
|
+
pointer-events: none;
|
|
3278
|
+
|
|
3293
3279
|
label,
|
|
3294
3280
|
input {
|
|
3295
3281
|
color: var(--figma-color-text-disabled);
|
|
@@ -3515,6 +3501,7 @@ fig-segmented-control {
|
|
|
3515
3501
|
fig-joystick {
|
|
3516
3502
|
--size: 100%;
|
|
3517
3503
|
--aspect-ratio: 1 / 1;
|
|
3504
|
+
--is-not-default: 0;
|
|
3518
3505
|
display: flex;
|
|
3519
3506
|
flex-direction: column;
|
|
3520
3507
|
gap: var(--spacer-2);
|
|
@@ -3557,6 +3544,34 @@ fig-joystick {
|
|
|
3557
3544
|
}
|
|
3558
3545
|
}
|
|
3559
3546
|
|
|
3547
|
+
.fig-joystick-reset {
|
|
3548
|
+
position: absolute;
|
|
3549
|
+
top: 50%;
|
|
3550
|
+
left: 50%;
|
|
3551
|
+
translate: -50% -50%;
|
|
3552
|
+
z-index: 3;
|
|
3553
|
+
opacity: 0;
|
|
3554
|
+
visibility: hidden;
|
|
3555
|
+
pointer-events: none;
|
|
3556
|
+
background-color: var(--figma-color-bg-secondary) !important;
|
|
3557
|
+
&:hover {
|
|
3558
|
+
.fig-mask-icon {
|
|
3559
|
+
color: var(--figma-color-text);
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3563
|
+
.fig-mask-icon {
|
|
3564
|
+
--size: var(--spacer-3);
|
|
3565
|
+
color: var(--figma-color-text-tertiary);
|
|
3566
|
+
}
|
|
3567
|
+
}
|
|
3568
|
+
|
|
3569
|
+
&:not([default]) .fig-joystick-reset {
|
|
3570
|
+
opacity: 1;
|
|
3571
|
+
visibility: visible;
|
|
3572
|
+
pointer-events: auto;
|
|
3573
|
+
}
|
|
3574
|
+
|
|
3560
3575
|
.fig-joystick-axis-label {
|
|
3561
3576
|
position: absolute;
|
|
3562
3577
|
z-index: 1;
|
|
@@ -3667,19 +3682,10 @@ fig-joystick {
|
|
|
3667
3682
|
box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
|
|
3668
3683
|
}
|
|
3669
3684
|
|
|
3670
|
-
|
|
3685
|
+
fig-handle {
|
|
3671
3686
|
position: absolute;
|
|
3672
|
-
z-index:
|
|
3673
|
-
width: 0.75rem;
|
|
3674
|
-
height: 0.75rem;
|
|
3675
|
-
background: var(--figma-color-bg-brand);
|
|
3676
|
-
box-shadow:
|
|
3677
|
-
inset 0 0 0 0.09375rem var(--handle-color),
|
|
3678
|
-
0px 0 0 0.5px rgba(0, 0, 0, 0.1),
|
|
3679
|
-
var(--elevation-100-canvas);
|
|
3680
|
-
border-radius: 50%;
|
|
3687
|
+
z-index: 4;
|
|
3681
3688
|
transform: translate(-50%, -50%);
|
|
3682
|
-
transition: box-shadow var(--slider-transition);
|
|
3683
3689
|
}
|
|
3684
3690
|
}
|
|
3685
3691
|
|
|
@@ -4445,6 +4451,27 @@ fig-choice {
|
|
|
4445
4451
|
}
|
|
4446
4452
|
}
|
|
4447
4453
|
|
|
4454
|
+
fig-handle {
|
|
4455
|
+
--width: 0.75rem;
|
|
4456
|
+
--height: 0.75rem;
|
|
4457
|
+
--fill: var(--figma-color-bg-brand);
|
|
4458
|
+
--border-radius: 50%;
|
|
4459
|
+
--box-shadow:
|
|
4460
|
+
inset 0 0 0 0.09375rem var(--handle-color),
|
|
4461
|
+
0px 0 0 0.5px rgba(0, 0, 0, 0.1), var(--elevation-100-canvas);
|
|
4462
|
+
--outline: none;
|
|
4463
|
+
--border: none;
|
|
4464
|
+
|
|
4465
|
+
display: inline-block;
|
|
4466
|
+
width: var(--width);
|
|
4467
|
+
height: var(--height);
|
|
4468
|
+
background: var(--fill);
|
|
4469
|
+
border-radius: var(--border-radius);
|
|
4470
|
+
box-shadow: var(--box-shadow);
|
|
4471
|
+
outline: var(--outline);
|
|
4472
|
+
border: var(--border);
|
|
4473
|
+
}
|
|
4474
|
+
|
|
4448
4475
|
@keyframes fig-shimmer {
|
|
4449
4476
|
0% {
|
|
4450
4477
|
background-position: 100% 100%;
|