figma-kit 1.0.0-beta.26 → 1.0.0-beta.28

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/dist/tailwind.css CHANGED
@@ -644,7 +644,7 @@
644
644
  bottom: 0;
645
645
  left: 0;
646
646
  z-index: 1;
647
- width: var(--space-6);
647
+ width: var(--space-1);
648
648
  }
649
649
 
650
650
  .fp-ValueFieldScrubber[data-disabled] {
@@ -712,26 +712,38 @@
712
712
  display: flex;
713
713
  position: relative;
714
714
  border-radius: var(--radius-medium);
715
- outline-offset: -1px;
716
715
  box-sizing: border-box;
717
716
  border: 1px solid transparent;
718
717
  height: var(--space-6);
719
718
  background-color: var(--figma-color-bg-secondary);
720
719
  }
721
720
 
722
- .fp-ValueFieldMulti:hover:where(:not([data-disabled])) {
723
- border: 1px solid var(--figma-color-border);
721
+ .fp-ValueFieldMulti::after {
722
+ content: '';
723
+ position: absolute;
724
+ inset: -1px;
725
+ border: 1px solid transparent;
726
+ border-radius: inherit;
727
+ outline-offset: -1px;
728
+ pointer-events: none;
724
729
  }
725
730
 
726
- .fp-ValueFieldMulti:focus-within {
731
+ .fp-ValueFieldMulti:hover:where(:not([data-disabled]))::after {
732
+ border-color: var(--figma-color-border);
733
+ }
734
+
735
+ .fp-ValueFieldMulti:focus-within::after {
727
736
  outline: 1px solid var(--figma-color-border-selected);
728
737
  }
729
738
 
730
739
  .fp-ValueFieldMulti[data-disabled] {
731
- border: 1px solid var(--figma-color-border-disabled);
732
740
  background-color: var(--figma-color-bg);
733
741
  }
734
742
 
743
+ .fp-ValueFieldMulti[data-disabled]::after {
744
+ border-color: var(--figma-color-border-disabled);
745
+ }
746
+
735
747
  .fp-ValueFieldMulti .fp-ValueFieldRoot {
736
748
  height: var(--space-6);
737
749
  flex-grow: 1;
@@ -759,16 +771,42 @@
759
771
  background-color: transparent;
760
772
  padding-left: calc(var(--space-2) - 1px);
761
773
  }
774
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot):hover:where(:not([data-disabled]))::after {
775
+ border-color: transparent;
776
+ }
777
+
778
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot):focus-within::after {
779
+ outline: 0;
780
+ }
781
+
782
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot) > .fp-SliderRoot {
783
+ align-self: center;
784
+ margin-inline: 10px 11px;
785
+ }
786
+
787
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot) > .fp-ValueFieldRoot {
788
+ flex: 0 0 var(--space-14);
789
+ outline: 1px solid transparent;
790
+ outline-offset: -1px;
791
+ }
792
+
793
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot) > .fp-ValueFieldRoot:hover:where(:not([data-disabled])) {
794
+ outline-color: var(--figma-color-border);
795
+ }
796
+
797
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot) > .fp-ValueFieldRoot:focus-within {
798
+ outline-color: var(--figma-color-border-selected);
799
+ }
762
800
 
763
801
  .fp-ValueFieldNumericSelect {
764
802
  width: 100%;
765
803
  }
766
804
 
767
- .fp-ValueFieldNumericSelect:hover:where(:not([data-disabled])) {
805
+ .fp-ValueFieldNumericSelect:hover:where(:not([data-disabled]))::after {
768
806
  border-color: transparent;
769
807
  }
770
808
 
771
- .fp-ValueFieldNumericSelect:has(.fp-ValueFieldNumericSelectField:hover):where(:not([data-disabled])) {
809
+ .fp-ValueFieldNumericSelect:has(.fp-ValueFieldNumericSelectField:hover):where(:not([data-disabled]))::after {
772
810
  border-color: var(--figma-color-border);
773
811
  }
774
812
 
@@ -1428,6 +1466,18 @@
1428
1466
  }
1429
1467
  @layer components {
1430
1468
 
1469
+ :root,
1470
+ .light,
1471
+ .light-theme {
1472
+ --switch-border-color: #00000033;
1473
+ --switch-thumb-outline-color-unchecked: #00000033;
1474
+ --switch-thumb-outline-color-checked: #0000001a;
1475
+ }
1476
+
1477
+ .figma-dark {
1478
+ --switch-border-color: #ffffff33;
1479
+ }
1480
+
1431
1481
  .fp-switchRoot {
1432
1482
  appearance: none;
1433
1483
  box-sizing: border-box;
@@ -1446,14 +1496,20 @@
1446
1496
  outline and the background in the focused mode as it is in Figma. */
1447
1497
  }
1448
1498
  .fp-switchRoot::before {
1499
+ box-sizing: border-box;
1449
1500
  position: absolute;
1450
1501
  inset: 0;
1502
+ border: 1px solid var(--switch-border-color);
1451
1503
  border-radius: var(--radius-full);
1452
1504
  background: none;
1453
1505
  content: '';
1454
1506
  }
1455
1507
 
1456
1508
  .fp-switchRoot[data-unchecked]::before {
1509
+ background: var(--figma-color-bg-secondary);
1510
+ }
1511
+
1512
+ .fp-switchRoot[data-unchecked]:active::before {
1457
1513
  background: var(--figma-color-bg-tertiary);
1458
1514
  }
1459
1515
 
@@ -1461,6 +1517,10 @@
1461
1517
  background: var(--figma-color-bg-brand);
1462
1518
  }
1463
1519
 
1520
+ .fp-switchRoot[data-checked]:active::before {
1521
+ background: var(--figma-color-bg-brand-pressed);
1522
+ }
1523
+
1464
1524
  .fp-switchRoot:focus-visible {
1465
1525
  outline-offset: -1px;
1466
1526
  outline: 1px solid var(--figma-color-border-selected-strong);
@@ -1482,11 +1542,12 @@
1482
1542
  .fp-switchThumb {
1483
1543
  box-sizing: border-box;
1484
1544
  position: absolute;
1485
- top: 1px;
1486
- left: 1px;
1487
- height: var(--space-3_5);
1488
- width: var(--space-3_5);
1545
+ top: var(--space-1);
1546
+ left: var(--space-1);
1547
+ height: var(--space-2);
1548
+ width: var(--space-3);
1489
1549
  border-radius: var(--radius-full);
1550
+ outline: 1px solid var(--switch-thumb-outline-color-unchecked);
1490
1551
  background: var(--figma-color-icon-onbrand);
1491
1552
  transition: all 0.08s ease-out;
1492
1553
  }
@@ -1495,12 +1556,9 @@
1495
1556
  background-color: var(--figma-color-icon-ondisabled);
1496
1557
  }
1497
1558
 
1498
- .fp-switchThumb[data-unchecked] {
1499
- left: 1px;
1500
- }
1501
-
1502
1559
  .fp-switchThumb[data-checked] {
1503
- left: calc(100% - var(--space-3_5) - 1px);
1560
+ left: calc(100% - var(--space-3) - var(--space-1));
1561
+ outline-color: var(--switch-thumb-outline-color-checked);
1504
1562
  }
1505
1563
  }
1506
1564
  @layer components {
@@ -1508,9 +1566,6 @@
1508
1566
  :root,
1509
1567
  .light,
1510
1568
  .light-theme {
1511
- --slider-root-size: var(--space-6);
1512
- --slider-track-size: var(--space-4);
1513
- --slider-thumb-width: var(--space-4);
1514
1569
  --slider-track-border-color: #0000001a;
1515
1570
  --slider-track-bg: var(--figma-color-bg-secondary);
1516
1571
  --slider-thumb-bg: transparent;
@@ -1532,15 +1587,40 @@
1532
1587
 
1533
1588
  .fp-SliderRoot[data-orientation='horizontal'] {
1534
1589
  height: var(--slider-root-size);
1535
- border-width: 0 calc(var(--slider-thumb-width) / 2);
1590
+ border-width: 0 var(--slider-thumb-inset);
1536
1591
  }
1537
1592
 
1538
1593
  .fp-SliderRoot[data-orientation='vertical'] {
1539
1594
  flex-direction: column;
1540
1595
  width: var(--slider-root-size);
1541
- border-width: calc(var(--slider-thumb-width) / 2) 0;
1596
+ border-width: var(--slider-thumb-inset) 0;
1542
1597
  }
1543
1598
 
1599
+ .fp-SliderRoot:where(.fp-size-large) {
1600
+ --slider-root-size: var(--space-6);
1601
+ --slider-track-size: var(--space-4);
1602
+ --slider-thumb-size: var(--space-4);
1603
+ --slider-thumb-inset: calc(var(--slider-thumb-size) / 2);
1604
+ --slider-hint-width: var(--space-1);
1605
+ --slider-hint-height: var(--space-1);
1606
+ --slider-hint-offset: 0px;
1607
+ --slider-hint-radius: var(--radius-full);
1608
+ }
1609
+
1610
+ .fp-SliderRoot:where(.fp-size-small) {
1611
+ --slider-root-size: var(--space-4);
1612
+ --slider-track-size: var(--space-1_5);
1613
+ --slider-thumb-size: var(--space-3);
1614
+ --slider-thumb-inset: calc(var(--slider-track-size) / 2);
1615
+ --slider-hint-width: 1px;
1616
+ --slider-hint-height: 3px;
1617
+ --slider-hint-offset: calc(var(--slider-track-size) / 2 + 3px + var(--slider-hint-height) / 2);
1618
+ --slider-hint-radius: 0;
1619
+ --slider-track-bg: var(--figma-color-bg-tertiary);
1620
+ --slider-track-border-color: transparent;
1621
+ --slider-thumb-bg: var(--figma-color-icon-onbrand);
1622
+ }
1623
+
1544
1624
  .fp-SliderControl {
1545
1625
  position: relative;
1546
1626
  display: flex;
@@ -1551,10 +1631,23 @@
1551
1631
  outline: 0;
1552
1632
  }
1553
1633
 
1634
+ .fp-SliderControl::before {
1635
+ content: '';
1636
+ position: absolute;
1637
+ }
1638
+
1639
+ .fp-SliderRoot[data-orientation='horizontal'] .fp-SliderControl::before {
1640
+ inset: calc(50% - var(--space-11) / 2) calc((var(--slider-thumb-inset) + var(--space-3)) * -1);
1641
+ }
1642
+
1554
1643
  .fp-SliderRoot[data-orientation='vertical'] .fp-SliderControl {
1555
1644
  flex-direction: column;
1556
1645
  }
1557
1646
 
1647
+ .fp-SliderRoot[data-orientation='vertical'] .fp-SliderControl::before {
1648
+ inset: calc((var(--slider-thumb-inset) + var(--space-3)) * -1) calc(50% - var(--space-11) / 2);
1649
+ }
1650
+
1558
1651
  .fp-SliderTrack {
1559
1652
  box-sizing: border-box;
1560
1653
  position: static;
@@ -1567,14 +1660,14 @@
1567
1660
  }
1568
1661
 
1569
1662
  .fp-SliderTrack[data-orientation='horizontal'] {
1570
- margin-left: calc((var(--slider-thumb-width) / 2) * -1);
1571
- margin-right: calc((var(--slider-thumb-width) / 2) * -1);
1663
+ margin-left: calc(var(--slider-thumb-inset) * -1);
1664
+ margin-right: calc(var(--slider-thumb-inset) * -1);
1572
1665
  height: var(--slider-track-size);
1573
1666
  }
1574
1667
 
1575
1668
  .fp-SliderTrack[data-orientation='vertical'] {
1576
- margin-top: calc((var(--slider-thumb-width) / 2) * -1);
1577
- margin-bottom: calc((var(--slider-thumb-width) / 2) * -1);
1669
+ margin-top: calc(var(--slider-thumb-inset) * -1);
1670
+ margin-bottom: calc(var(--slider-thumb-inset) * -1);
1578
1671
  width: var(--slider-track-size);
1579
1672
  }
1580
1673
 
@@ -1587,14 +1680,14 @@
1587
1680
 
1588
1681
  .fp-SliderRange[data-orientation='horizontal'] {
1589
1682
  height: var(--slider-track-size);
1590
- margin-left: calc((var(--slider-thumb-width) / 2) * -1);
1591
- margin-right: calc((var(--slider-thumb-width) / 2) * -1);
1683
+ margin-left: calc(var(--slider-thumb-inset) * -1);
1684
+ margin-right: calc(var(--slider-thumb-inset) * -1);
1592
1685
  }
1593
1686
 
1594
1687
  .fp-SliderRange[data-orientation='vertical'] {
1595
1688
  width: var(--slider-track-size);
1596
- margin-top: calc((var(--slider-thumb-width) / 2) * -1);
1597
- margin-bottom: calc((var(--slider-thumb-width) / 2) * -1);
1689
+ margin-top: calc(var(--slider-thumb-inset) * -1);
1690
+ margin-bottom: calc(var(--slider-thumb-inset) * -1);
1598
1691
  }
1599
1692
 
1600
1693
  .fp-SliderRange[data-disabled] {
@@ -1605,8 +1698,8 @@
1605
1698
  box-sizing: border-box;
1606
1699
  display: block;
1607
1700
  z-index: 1;
1608
- width: var(--slider-track-size);
1609
- height: var(--slider-track-size);
1701
+ width: var(--slider-thumb-size);
1702
+ height: var(--slider-thumb-size);
1610
1703
  background-color: var(--slider-thumb-bg);
1611
1704
  border: 4px solid var(--figma-color-icon-onbrand);
1612
1705
  border-radius: var(--radius-full);
@@ -1631,19 +1724,21 @@
1631
1724
  .fp-SliderHint {
1632
1725
  position: absolute;
1633
1726
  display: block;
1634
- width: var(--space-1);
1635
- height: var(--space-1);
1636
1727
  background-color: var(--figma-color-icon-tertiary);
1637
- border-radius: var(--radius-full);
1728
+ border-radius: var(--slider-hint-radius);
1638
1729
  }
1639
1730
 
1640
1731
  .fp-SliderHint[data-orientation='horizontal'] {
1641
- top: 50%;
1732
+ top: calc(50% + var(--slider-hint-offset));
1733
+ width: var(--slider-hint-width);
1734
+ height: var(--slider-hint-height);
1642
1735
  transform: translateY(-50%);
1643
1736
  }
1644
1737
 
1645
1738
  .fp-SliderHint[data-orientation='vertical'] {
1646
- left: 50%;
1739
+ left: calc(50% + var(--slider-hint-offset));
1740
+ width: var(--slider-hint-height);
1741
+ height: var(--slider-hint-width);
1647
1742
  transform: translateX(-50%);
1648
1743
  }
1649
1744
 
@@ -2066,7 +2161,7 @@
2066
2161
  .fp-ColorPickerHueSlider:where(.fp-color-model-hsv, .fp-color-model-hsl, .fp-color-model-rgb, .fp-color-model-hex) {
2067
2162
  --slider-track-bg: linear-gradient(
2068
2163
  90deg,
2069
- rgba(255, 0, 0, 1) calc(var(--slider-track-size) / 2),
2164
+ rgba(255, 0, 0, 1) var(--slider-thumb-inset),
2070
2165
  rgba(255, 48, 0, 1),
2071
2166
  rgba(255, 96, 0, 1),
2072
2167
  rgba(255, 143, 0, 1),
@@ -2097,7 +2192,7 @@
2097
2192
  rgba(255, 0, 191, 1),
2098
2193
  rgba(255, 0, 143, 1),
2099
2194
  rgba(255, 0, 96, 1),
2100
- rgba(255, 0, 48, 1) calc(100% - calc(var(--slider-track-size) / 2))
2195
+ rgba(255, 0, 48, 1) calc(100% - var(--slider-thumb-inset))
2101
2196
  );
2102
2197
  }
2103
2198
  @supports (color: color(display-p3 1 1 1)) {
@@ -2106,7 +2201,7 @@
2106
2201
  .fp-ColorPickerHueSlider:where(.fp-color-model-hsv, .fp-color-model-hsl):where(.fp-color-space-display-p3) {
2107
2202
  --slider-track-bg: linear-gradient(
2108
2203
  90deg,
2109
- color(display-p3 1 0 0) calc(var(--slider-track-size) / 2),
2204
+ color(display-p3 1 0 0) var(--slider-thumb-inset),
2110
2205
  color(display-p3 1 0.1875 0),
2111
2206
  color(display-p3 1 0.375 0),
2112
2207
  color(display-p3 1 0.5625 0),
@@ -2137,7 +2232,7 @@
2137
2232
  color(display-p3 1 0 0.75),
2138
2233
  color(display-p3 1 0 0.5625),
2139
2234
  color(display-p3 1 0 0.375),
2140
- color(display-p3 1 0 0.1875) calc(100% - calc(var(--slider-track-size) / 2))
2235
+ color(display-p3 1 0 0.1875) calc(100% - var(--slider-thumb-inset))
2141
2236
  );
2142
2237
  }
2143
2238
  }
@@ -2150,8 +2245,8 @@
2150
2245
 
2151
2246
  --slider-track-bg: linear-gradient(
2152
2247
  to right,
2153
- var(--track-bg-step-1) 0 calc(var(--slider-track-size) / 2),
2154
- var(--track-bg-step-2) calc(100% - calc(var(--slider-track-size) / 2)) 100%
2248
+ var(--track-bg-step-1) 0 var(--slider-thumb-inset),
2249
+ var(--track-bg-step-2) calc(100% - var(--slider-thumb-inset)) 100%
2155
2250
  ),
2156
2251
  url('data:image/svg+xml;utf8,%3Csvg%20width%3D%222%22%20height%3D%222%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M0%200h1v2h1V1H0%22%20fill-rule%3D%22nonzero%22%20fill%3D%22%23e1e1e1%22/%3E%3C/svg%3E')
2157
2252
  0 0 / auto 66.66%,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "figma-kit",
3
3
  "description": "A set of React components for building Figma plugins.",
4
4
  "homepage": "https://figma-kit.dev",
5
- "version": "1.0.0-beta.26",
5
+ "version": "1.0.0-beta.28",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",