@rogieking/figui3 2.36.0 → 2.38.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 +2 -1
- package/components.css +191 -4
- package/dist/fig.js +81 -52
- package/fig.js +557 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -319,12 +319,13 @@ A range slider with multiple types and optional text input.
|
|
|
319
319
|
| Attribute | Type | Default | Description |
|
|
320
320
|
|-----------|------|---------|-------------|
|
|
321
321
|
| `type` | string | `"range"` | Type: `"range"`, `"hue"`, `"opacity"`, `"delta"`, `"stepper"` |
|
|
322
|
-
| `value` | number | — | Current value |
|
|
322
|
+
| `value` | number | — | Current value; missing/invalid values fall back to `min` (or `default` for `type="delta"`, then `0`) |
|
|
323
323
|
| `min` | number | `0` | Minimum value |
|
|
324
324
|
| `max` | number | `100` | Maximum value |
|
|
325
325
|
| `step` | number | `1` | Step increment |
|
|
326
326
|
| `default` | number | — | Default/reset value (shown as a marker on the track) |
|
|
327
327
|
| `text` | boolean | `false` | Show text input |
|
|
328
|
+
| `placeholder` | string | `"##"` | Placeholder for text input mode (`text="true"`) |
|
|
328
329
|
| `units` | string | — | Unit label (e.g., `"%"`, `"px"`) |
|
|
329
330
|
| `transform` | number | — | Multiplier for display value |
|
|
330
331
|
| `color` | string | — | Track color (for opacity type) |
|
package/components.css
CHANGED
|
@@ -306,6 +306,7 @@
|
|
|
306
306
|
--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");
|
|
307
307
|
--icon-minus: 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='M18 12C18 12.2761 17.7761 12.5 17.5 12.5H6.5C6.22386 12.5 6 12.2761 6 12C6 11.7239 6.22386 11.5 6.5 11.5H17.5C17.7761 11.5 18 11.7239 18 12Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
308
308
|
--icon-back: 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='M13.8536 7.14645C14.0488 7.34171 14.0488 7.65829 13.8536 7.85355L9.70711 12L13.8536 16.1464C14.0488 16.3417 14.0488 16.6583 13.8536 16.8536C13.6583 17.0488 13.3417 17.0488 13.1464 16.8536L8.64645 12.3535C8.55268 12.2598 8.5 12.1326 8.5 12C8.5 11.8674 8.55268 11.7402 8.64645 11.6464L13.1464 7.14645C13.3417 6.95118 13.6583 6.95118 13.8536 7.14645Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
309
|
+
--icon-arrow-left: 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='M9.5 4.5L5.5 8L9.5 11.5' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
309
310
|
--icon-forward: 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='M10.1464 16.8536C9.95118 16.6583 9.95118 16.3417 10.1464 16.1464L14.2929 12L10.1464 7.85355C9.95118 7.65829 9.95118 7.34171 10.1464 7.14645C10.3417 6.95118 10.6583 6.95118 10.8536 7.14645L15.3536 11.6464C15.5488 11.8417 15.5488 12.1583 15.3536 12.3536L10.8536 16.8536C10.6583 17.0488 10.3417 17.0488 10.1464 16.8536Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
310
311
|
--icon-close: 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='M16.2242 7.08154C16.4182 6.95348 16.6823 6.97551 16.8531 7.146C17.024 7.31683 17.0457 7.58084 16.9176 7.7749L16.8531 7.85303L12.7067 11.9995L16.8531 16.146L16.9176 16.2241C17.0457 16.4182 17.024 16.6822 16.8531 16.853C16.6823 17.0239 16.4183 17.0456 16.2242 16.9175L16.1461 16.853L11.9996 12.7065L7.85315 16.853C7.65789 17.0483 7.34138 17.0483 7.14612 16.853C6.95128 16.6577 6.95101 16.3411 7.14612 16.146L11.2926 11.9995L7.14612 7.85303L7.08167 7.7749C6.95389 7.58087 6.97541 7.3167 7.14612 7.146C7.31683 6.97532 7.58101 6.95376 7.77502 7.08154L7.85315 7.146L11.9996 11.2925L16.1461 7.146L16.2242 7.08154Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
311
312
|
--icon-rotate: 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='M10.2325 6.47442C11.2088 5.49811 12.7917 5.49811 13.768 6.47442L15.2931 7.99955H14.0002C13.7241 7.99955 13.5002 8.2234 13.5002 8.49955C13.5002 8.77569 13.7241 8.99955 14.0002 8.99955H16.5002C16.7764 8.99955 17.0002 8.77569 17.0002 8.49955V5.99955C17.0002 5.7234 16.7764 5.49955 16.5002 5.49955C16.2241 5.49955 16.0002 5.7234 16.0002 5.99955V7.29244L14.4751 5.76731C13.1083 4.40048 10.8922 4.40048 9.52537 5.76731L7.14669 8.14599C6.95143 8.34126 6.95143 8.65784 7.14669 8.8531C7.34195 9.04836 7.65854 9.04836 7.8538 8.8531L10.2325 6.47442ZM13.0609 9.64599C12.4751 9.06021 11.5254 9.06021 10.9396 9.64599L7.64669 12.9389C7.06091 13.5247 7.0609 14.4744 7.64669 15.0602L10.9396 18.3531C11.5254 18.9389 12.4751 18.9389 13.0609 18.3531L16.3538 15.0602C16.9396 14.4744 16.9396 13.5247 16.3538 12.9389L13.0609 9.64599ZM11.6467 10.3531C11.842 10.1578 12.1585 10.1578 12.3538 10.3531L15.6467 13.646C15.842 13.8413 15.842 14.1578 15.6467 14.3531L12.3538 17.646C12.1585 17.8413 11.842 17.8413 11.6467 17.646L8.3538 14.3531C8.15854 14.1578 8.15854 13.8413 8.3538 13.646L11.6467 10.3531Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
@@ -324,6 +325,12 @@
|
|
|
324
325
|
inset 0px 0.5px 0px 0px light-dark(transparent, rgba(255, 255, 255, 0.08)),
|
|
325
326
|
inset 0px 0px 0.5px 0px light-dark(transparent, rgba(255, 255, 255, 0.3));
|
|
326
327
|
|
|
328
|
+
--elevation-100-canvas:
|
|
329
|
+
0 0 0.5px 0 light-dark(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5)),
|
|
330
|
+
0 0.5px 0 0 light-dark(transparent, rgba(255, 255, 255, 0.1)) inset,
|
|
331
|
+
0 0 0.5px 0 light-dark(transparent, rgba(255, 255, 255, 0.3)) inset,
|
|
332
|
+
0 1px 3px 0 light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4));
|
|
333
|
+
|
|
327
334
|
--figma-elevation-400-menu-panel:
|
|
328
335
|
0px 0px 0.5px 0px light-dark(rgba(0, 0, 0, 0.12), transparent),
|
|
329
336
|
0px 10px 16px 0px light-dark(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.35)),
|
|
@@ -372,6 +379,7 @@ input[type="password"],
|
|
|
372
379
|
font: inherit;
|
|
373
380
|
display: flex;
|
|
374
381
|
color: inherit;
|
|
382
|
+
appearance: textfield;
|
|
375
383
|
-moz-appearance: textfield;
|
|
376
384
|
|
|
377
385
|
&:focus {
|
|
@@ -1448,8 +1456,8 @@ fig-3d-rotate {
|
|
|
1448
1456
|
);
|
|
1449
1457
|
--border-width: 1px;
|
|
1450
1458
|
--border-start-color: light-dark(
|
|
1451
|
-
rgba(0, 0, 0, 0.
|
|
1452
|
-
rgba(255, 255, 255, 0.
|
|
1459
|
+
rgba(0, 0, 0, 0.1),
|
|
1460
|
+
rgba(255, 255, 255, 0.1)
|
|
1453
1461
|
);
|
|
1454
1462
|
--border-end-color: transparent;
|
|
1455
1463
|
--border-end-color: transparent;
|
|
@@ -1521,13 +1529,14 @@ fig-3d-rotate {
|
|
|
1521
1529
|
background: var(--figma-color-border-strong) !important;
|
|
1522
1530
|
inset: -1px;
|
|
1523
1531
|
border-radius: var(--radius-medium);
|
|
1532
|
+
box-shadow: var(--elevation-100-canvas);
|
|
1524
1533
|
}
|
|
1525
1534
|
|
|
1526
1535
|
&.front {
|
|
1527
1536
|
background: var(--front-face-bg);
|
|
1528
1537
|
border-radius: var(--radius-medium);
|
|
1529
1538
|
transform-style: preserve-3d;
|
|
1530
|
-
box-shadow: var(--
|
|
1539
|
+
box-shadow: var(--elevation-100-canvas);
|
|
1531
1540
|
inset: -1px;
|
|
1532
1541
|
|
|
1533
1542
|
&::after {
|
|
@@ -1628,6 +1637,184 @@ fig-3d-rotate {
|
|
|
1628
1637
|
}
|
|
1629
1638
|
}
|
|
1630
1639
|
|
|
1640
|
+
/* Origin Grid */
|
|
1641
|
+
fig-origin-grid {
|
|
1642
|
+
display: flex;
|
|
1643
|
+
flex-direction: column;
|
|
1644
|
+
width: 100%;
|
|
1645
|
+
gap: var(--spacer-2);
|
|
1646
|
+
--aspect-ratio: 1 / 1;
|
|
1647
|
+
--origin-grid-dot-size: 0.125rem;
|
|
1648
|
+
--origin-grid-handle-size: 0.75rem;
|
|
1649
|
+
--origin-grid-height: var(--spacer-4);
|
|
1650
|
+
|
|
1651
|
+
fig-field[direction="horizontal"] & {
|
|
1652
|
+
flex: 1;
|
|
1653
|
+
min-width: 0;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
.fig-origin-grid-surface {
|
|
1657
|
+
width: 100%;
|
|
1658
|
+
aspect-ratio: var(--aspect-ratio);
|
|
1659
|
+
min-height: calc(var(--origin-grid-height) * 3);
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
.origin-grid {
|
|
1663
|
+
position: relative;
|
|
1664
|
+
container-type: size;
|
|
1665
|
+
width: 100%;
|
|
1666
|
+
height: 100%;
|
|
1667
|
+
border-radius: var(--radius-medium);
|
|
1668
|
+
background: var(--figma-color-bg-secondary);
|
|
1669
|
+
user-select: none;
|
|
1670
|
+
cursor: default;
|
|
1671
|
+
|
|
1672
|
+
&.is-dragging {
|
|
1673
|
+
cursor: grabbing !important;
|
|
1674
|
+
|
|
1675
|
+
.origin-grid-handle {
|
|
1676
|
+
cursor: grabbing !important;
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
&.drag-disabled {
|
|
1681
|
+
.origin-grid-handle {
|
|
1682
|
+
cursor: default;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
.origin-grid-cells {
|
|
1688
|
+
position: absolute;
|
|
1689
|
+
inset: 0;
|
|
1690
|
+
display: grid;
|
|
1691
|
+
grid-template-columns: repeat(3, 1fr);
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
.origin-grid-cell {
|
|
1695
|
+
display: grid;
|
|
1696
|
+
place-items: center;
|
|
1697
|
+
width: 100%;
|
|
1698
|
+
height: 100%;
|
|
1699
|
+
min-height: var(--origin-grid-height);
|
|
1700
|
+
color: var(--figma-color-icon-tertiary);
|
|
1701
|
+
pointer-events: none;
|
|
1702
|
+
|
|
1703
|
+
.origin-grid-dot {
|
|
1704
|
+
width: var(--origin-grid-dot-size);
|
|
1705
|
+
height: var(--origin-grid-dot-size);
|
|
1706
|
+
border-radius: var(--radius-small);
|
|
1707
|
+
background: currentColor;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
&.is-hovered {
|
|
1711
|
+
color: var(--figma-color-bg-brand-secondary);
|
|
1712
|
+
|
|
1713
|
+
.origin-grid-dot {
|
|
1714
|
+
width: var(--origin-grid-handle-size);
|
|
1715
|
+
height: var(--origin-grid-handle-size);
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
.origin-grid-handle {
|
|
1721
|
+
--origin-overflow-rotation: 0deg;
|
|
1722
|
+
--origin-overflow-nudge-base: var(--spacer-2-5);
|
|
1723
|
+
--origin-overflow-nudge-x: 0px;
|
|
1724
|
+
--origin-overflow-nudge-y: 0px;
|
|
1725
|
+
--origin-overflow-nudge-x-scale: calc((100cqb / 100cqi) * -1);
|
|
1726
|
+
--origin-overflow-nudge-y-scale: calc((100cqb / 100cqi) * -1);
|
|
1727
|
+
position: absolute;
|
|
1728
|
+
left: 50%;
|
|
1729
|
+
top: 50%;
|
|
1730
|
+
width: var(--origin-grid-handle-size);
|
|
1731
|
+
height: var(--origin-grid-handle-size);
|
|
1732
|
+
border-radius: var(--radius-small);
|
|
1733
|
+
background: var(--figma-color-bg-brand);
|
|
1734
|
+
box-shadow:
|
|
1735
|
+
0 0 0 1px var(--figma-color-bg),
|
|
1736
|
+
var(--elevation-100-canvas);
|
|
1737
|
+
transform: translate(
|
|
1738
|
+
calc(-50% + var(--origin-overflow-nudge-x)),
|
|
1739
|
+
calc(-50% + var(--origin-overflow-nudge-y))
|
|
1740
|
+
)
|
|
1741
|
+
rotate(var(--origin-overflow-rotation));
|
|
1742
|
+
cursor: default;
|
|
1743
|
+
touch-action: none;
|
|
1744
|
+
|
|
1745
|
+
&.beyond-bounds-x,
|
|
1746
|
+
&.beyond-bounds-y {
|
|
1747
|
+
-webkit-mask-image: var(--icon-arrow-left);
|
|
1748
|
+
mask-image: var(--icon-arrow-left);
|
|
1749
|
+
-webkit-mask-repeat: no-repeat;
|
|
1750
|
+
mask-repeat: no-repeat;
|
|
1751
|
+
-webkit-mask-position: center;
|
|
1752
|
+
mask-position: center;
|
|
1753
|
+
-webkit-mask-size: 24px 24px;
|
|
1754
|
+
mask-size: 24px 24px;
|
|
1755
|
+
border-radius: 0;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
&.beyond-bounds-x.overflow-right {
|
|
1759
|
+
--origin-overflow-rotation: 180deg;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
&.beyond-bounds-y:not(.beyond-bounds-x) {
|
|
1763
|
+
--origin-overflow-rotation: 90deg;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
&.beyond-bounds-y.overflow-down:not(.beyond-bounds-x) {
|
|
1767
|
+
--origin-overflow-rotation: -90deg;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
&.beyond-bounds-x.beyond-bounds-y.overflow-left.overflow-up {
|
|
1771
|
+
--origin-overflow-rotation: 45deg;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
&.beyond-bounds-x.beyond-bounds-y.overflow-left.overflow-down {
|
|
1775
|
+
--origin-overflow-rotation: -45deg;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
&.beyond-bounds-x.beyond-bounds-y.overflow-right.overflow-up {
|
|
1779
|
+
--origin-overflow-rotation: 135deg;
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
&.beyond-bounds-x.beyond-bounds-y.overflow-right.overflow-down {
|
|
1783
|
+
--origin-overflow-rotation: -135deg;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
&.overflow-left {
|
|
1787
|
+
--origin-overflow-nudge-x: calc(
|
|
1788
|
+
var(--origin-overflow-nudge-base) * var(--origin-overflow-nudge-x-scale)
|
|
1789
|
+
);
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
&.overflow-right {
|
|
1793
|
+
--origin-overflow-nudge-x: calc(
|
|
1794
|
+
var(--origin-overflow-nudge-base) * var(--origin-overflow-nudge-x-scale) * -1
|
|
1795
|
+
);
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
&.overflow-up {
|
|
1799
|
+
--origin-overflow-nudge-y: calc(
|
|
1800
|
+
var(--origin-overflow-nudge-base) * var(--origin-overflow-nudge-y-scale)
|
|
1801
|
+
);
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
&.overflow-down {
|
|
1805
|
+
--origin-overflow-nudge-y: calc(
|
|
1806
|
+
var(--origin-overflow-nudge-base) * var(--origin-overflow-nudge-y-scale) * -1
|
|
1807
|
+
);
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
.origin-values {
|
|
1812
|
+
display: grid;
|
|
1813
|
+
grid-template-columns: 1fr 1fr;
|
|
1814
|
+
gap: var(--spacer-2);
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1631
1818
|
/* Combo input */
|
|
1632
1819
|
.input-combo {
|
|
1633
1820
|
display: inline-flex;
|
|
@@ -1959,7 +2146,7 @@ fig-slider {
|
|
|
1959
2146
|
--slider-handle-shadow-focus:
|
|
1960
2147
|
inset 0 0 0 4px var(--handle-color), inset 0 0 0 5px rgba(0, 0, 0, 0.1),
|
|
1961
2148
|
var(--handle-shadow), 0 0 0 1px var(--figma-color-border-selected);
|
|
1962
|
-
--slider-transition:
|
|
2149
|
+
--slider-transition: none;
|
|
1963
2150
|
--handle-transition: var(--slider-transition);
|
|
1964
2151
|
|
|
1965
2152
|
display: inline-flex;
|