figma-kit 1.0.0-beta.25 → 1.0.0-beta.27

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/styles.css CHANGED
@@ -568,7 +568,7 @@
568
568
  bottom: 0;
569
569
  left: 0;
570
570
  z-index: 1;
571
- width: var(--space-6);
571
+ width: var(--space-1);
572
572
  }
573
573
  .fp-ValueFieldScrubber[data-disabled] {
574
574
  cursor: default;
@@ -627,22 +627,32 @@
627
627
  display: flex;
628
628
  position: relative;
629
629
  border-radius: var(--radius-medium);
630
- outline-offset: -1px;
631
630
  box-sizing: border-box;
632
631
  border: 1px solid transparent;
633
632
  height: var(--space-6);
634
633
  background-color: var(--figma-color-bg-secondary);
635
634
  }
636
- .fp-ValueFieldMulti:hover:where(:not([data-disabled])) {
637
- border: 1px solid var(--figma-color-border);
635
+ .fp-ValueFieldMulti::after {
636
+ content: '';
637
+ position: absolute;
638
+ inset: -1px;
639
+ border: 1px solid transparent;
640
+ border-radius: inherit;
641
+ outline-offset: -1px;
642
+ pointer-events: none;
643
+ }
644
+ .fp-ValueFieldMulti:hover:where(:not([data-disabled]))::after {
645
+ border-color: var(--figma-color-border);
638
646
  }
639
- .fp-ValueFieldMulti:focus-within {
647
+ .fp-ValueFieldMulti:focus-within::after {
640
648
  outline: 1px solid var(--figma-color-border-selected);
641
649
  }
642
650
  .fp-ValueFieldMulti[data-disabled] {
643
- border: 1px solid var(--figma-color-border-disabled);
644
651
  background-color: var(--figma-color-bg);
645
652
  }
653
+ .fp-ValueFieldMulti[data-disabled]::after {
654
+ border-color: var(--figma-color-border-disabled);
655
+ }
646
656
  .fp-ValueFieldMulti .fp-ValueFieldRoot {
647
657
  height: var(--space-6);
648
658
  flex-grow: 1;
@@ -666,13 +676,34 @@
666
676
  background-color: transparent;
667
677
  padding-left: calc(var(--space-2) - 1px);
668
678
  }
679
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot):hover:where(:not([data-disabled]))::after {
680
+ border-color: transparent;
681
+ }
682
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot):focus-within::after {
683
+ outline: 0;
684
+ }
685
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot) > .fp-SliderRoot {
686
+ align-self: center;
687
+ margin-inline: 10px 11px;
688
+ }
689
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot) > .fp-ValueFieldRoot {
690
+ flex: 0 0 var(--space-14);
691
+ outline: 1px solid transparent;
692
+ outline-offset: -1px;
693
+ }
694
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot) > .fp-ValueFieldRoot:hover:where(:not([data-disabled])) {
695
+ outline-color: var(--figma-color-border);
696
+ }
697
+ .fp-ValueFieldMulti:has(> .fp-SliderRoot) > .fp-ValueFieldRoot:focus-within {
698
+ outline-color: var(--figma-color-border-selected);
699
+ }
669
700
  .fp-ValueFieldNumericSelect {
670
701
  width: 100%;
671
702
  }
672
- .fp-ValueFieldNumericSelect:hover:where(:not([data-disabled])) {
703
+ .fp-ValueFieldNumericSelect:hover:where(:not([data-disabled]))::after {
673
704
  border-color: transparent;
674
705
  }
675
- .fp-ValueFieldNumericSelect:has(.fp-ValueFieldNumericSelectField:hover):where(:not([data-disabled])) {
706
+ .fp-ValueFieldNumericSelect:has(.fp-ValueFieldNumericSelectField:hover):where(:not([data-disabled]))::after {
676
707
  border-color: var(--figma-color-border);
677
708
  }
678
709
  .fp-ValueFieldNumericSelect .fp-ValueFieldNumericSelectField {
@@ -1285,9 +1316,6 @@
1285
1316
  :root,
1286
1317
  .light,
1287
1318
  .light-theme {
1288
- --slider-root-size: var(--space-6);
1289
- --slider-track-size: var(--space-4);
1290
- --slider-thumb-width: var(--space-4);
1291
1319
  --slider-track-border-color: #0000001a;
1292
1320
  --slider-track-bg: var(--figma-color-bg-secondary);
1293
1321
  --slider-thumb-bg: transparent;
@@ -1306,13 +1334,36 @@
1306
1334
  }
1307
1335
  .fp-SliderRoot[data-orientation='horizontal'] {
1308
1336
  height: var(--slider-root-size);
1309
- border-width: 0 calc(var(--slider-thumb-width) / 2);
1337
+ border-width: 0 var(--slider-thumb-inset);
1310
1338
  }
1311
1339
  .fp-SliderRoot[data-orientation='vertical'] {
1312
1340
  flex-direction: column;
1313
1341
  width: var(--slider-root-size);
1314
- border-width: calc(var(--slider-thumb-width) / 2) 0;
1342
+ border-width: var(--slider-thumb-inset) 0;
1315
1343
  }
1344
+ .fp-SliderRoot:where(.fp-size-large) {
1345
+ --slider-root-size: var(--space-6);
1346
+ --slider-track-size: var(--space-4);
1347
+ --slider-thumb-size: var(--space-4);
1348
+ --slider-thumb-inset: calc(var(--slider-thumb-size) / 2);
1349
+ --slider-hint-width: var(--space-1);
1350
+ --slider-hint-height: var(--space-1);
1351
+ --slider-hint-offset: 0px;
1352
+ --slider-hint-radius: var(--radius-full);
1353
+ }
1354
+ .fp-SliderRoot:where(.fp-size-small) {
1355
+ --slider-root-size: var(--space-4);
1356
+ --slider-track-size: var(--space-1_5);
1357
+ --slider-thumb-size: var(--space-3);
1358
+ --slider-thumb-inset: calc(var(--slider-track-size) / 2);
1359
+ --slider-hint-width: 1px;
1360
+ --slider-hint-height: 3px;
1361
+ --slider-hint-offset: calc(var(--slider-track-size) / 2 + 3px + var(--slider-hint-height) / 2);
1362
+ --slider-hint-radius: 0;
1363
+ --slider-track-bg: var(--figma-color-bg-tertiary);
1364
+ --slider-track-border-color: transparent;
1365
+ --slider-thumb-bg: var(--figma-color-icon-onbrand);
1366
+ }
1316
1367
  .fp-SliderControl {
1317
1368
  position: relative;
1318
1369
  display: flex;
@@ -1322,9 +1373,19 @@
1322
1373
  height: 100%;
1323
1374
  outline: 0;
1324
1375
  }
1376
+ .fp-SliderControl::before {
1377
+ content: '';
1378
+ position: absolute;
1379
+ }
1380
+ .fp-SliderRoot[data-orientation='horizontal'] .fp-SliderControl::before {
1381
+ inset: calc(50% - var(--space-11) / 2) calc((var(--slider-thumb-inset) + var(--space-3)) * -1);
1382
+ }
1325
1383
  .fp-SliderRoot[data-orientation='vertical'] .fp-SliderControl {
1326
1384
  flex-direction: column;
1327
1385
  }
1386
+ .fp-SliderRoot[data-orientation='vertical'] .fp-SliderControl::before {
1387
+ inset: calc((var(--slider-thumb-inset) + var(--space-3)) * -1) calc(50% - var(--space-11) / 2);
1388
+ }
1328
1389
  .fp-SliderTrack {
1329
1390
  box-sizing: border-box;
1330
1391
  position: static;
@@ -1336,13 +1397,13 @@
1336
1397
  outline-offset: -1px;
1337
1398
  }
1338
1399
  .fp-SliderTrack[data-orientation='horizontal'] {
1339
- margin-left: calc((var(--slider-thumb-width) / 2) * -1);
1340
- margin-right: calc((var(--slider-thumb-width) / 2) * -1);
1400
+ margin-left: calc(var(--slider-thumb-inset) * -1);
1401
+ margin-right: calc(var(--slider-thumb-inset) * -1);
1341
1402
  height: var(--slider-track-size);
1342
1403
  }
1343
1404
  .fp-SliderTrack[data-orientation='vertical'] {
1344
- margin-top: calc((var(--slider-thumb-width) / 2) * -1);
1345
- margin-bottom: calc((var(--slider-thumb-width) / 2) * -1);
1405
+ margin-top: calc(var(--slider-thumb-inset) * -1);
1406
+ margin-bottom: calc(var(--slider-thumb-inset) * -1);
1346
1407
  width: var(--slider-track-size);
1347
1408
  }
1348
1409
  .fp-SliderRange {
@@ -1353,13 +1414,13 @@
1353
1414
  }
1354
1415
  .fp-SliderRange[data-orientation='horizontal'] {
1355
1416
  height: var(--slider-track-size);
1356
- margin-left: calc((var(--slider-thumb-width) / 2) * -1);
1357
- margin-right: calc((var(--slider-thumb-width) / 2) * -1);
1417
+ margin-left: calc(var(--slider-thumb-inset) * -1);
1418
+ margin-right: calc(var(--slider-thumb-inset) * -1);
1358
1419
  }
1359
1420
  .fp-SliderRange[data-orientation='vertical'] {
1360
1421
  width: var(--slider-track-size);
1361
- margin-top: calc((var(--slider-thumb-width) / 2) * -1);
1362
- margin-bottom: calc((var(--slider-thumb-width) / 2) * -1);
1422
+ margin-top: calc(var(--slider-thumb-inset) * -1);
1423
+ margin-bottom: calc(var(--slider-thumb-inset) * -1);
1363
1424
  }
1364
1425
  .fp-SliderRange[data-disabled] {
1365
1426
  background-color: var(--figma-color-bg-disabled);
@@ -1368,8 +1429,8 @@
1368
1429
  box-sizing: border-box;
1369
1430
  display: block;
1370
1431
  z-index: 1;
1371
- width: var(--slider-track-size);
1372
- height: var(--slider-track-size);
1432
+ width: var(--slider-thumb-size);
1433
+ height: var(--slider-thumb-size);
1373
1434
  background-color: var(--slider-thumb-bg);
1374
1435
  border: 4px solid var(--figma-color-icon-onbrand);
1375
1436
  border-radius: var(--radius-full);
@@ -1390,17 +1451,19 @@
1390
1451
  .fp-SliderHint {
1391
1452
  position: absolute;
1392
1453
  display: block;
1393
- width: var(--space-1);
1394
- height: var(--space-1);
1395
1454
  background-color: var(--figma-color-icon-tertiary);
1396
- border-radius: var(--radius-full);
1455
+ border-radius: var(--slider-hint-radius);
1397
1456
  }
1398
1457
  .fp-SliderHint[data-orientation='horizontal'] {
1399
- top: 50%;
1458
+ top: calc(50% + var(--slider-hint-offset));
1459
+ width: var(--slider-hint-width);
1460
+ height: var(--slider-hint-height);
1400
1461
  transform: translateY(-50%);
1401
1462
  }
1402
1463
  .fp-SliderHint[data-orientation='vertical'] {
1403
- left: 50%;
1464
+ left: calc(50% + var(--slider-hint-offset));
1465
+ width: var(--slider-hint-height);
1466
+ height: var(--slider-hint-width);
1404
1467
  transform: translateX(-50%);
1405
1468
  }
1406
1469
  .fp-SliderHint.fp-SliderHint-baseValue {
@@ -1739,7 +1802,7 @@
1739
1802
  .fp-ColorPickerHueSlider:where(.fp-color-model-hsv, .fp-color-model-hsl, .fp-color-model-rgb, .fp-color-model-hex) {
1740
1803
  --slider-track-bg: linear-gradient(
1741
1804
  90deg,
1742
- rgba(255, 0, 0, 1) calc(var(--slider-track-size) / 2),
1805
+ rgba(255, 0, 0, 1) var(--slider-thumb-inset),
1743
1806
  rgba(255, 48, 0, 1),
1744
1807
  rgba(255, 96, 0, 1),
1745
1808
  rgba(255, 143, 0, 1),
@@ -1770,7 +1833,7 @@
1770
1833
  rgba(255, 0, 191, 1),
1771
1834
  rgba(255, 0, 143, 1),
1772
1835
  rgba(255, 0, 96, 1),
1773
- rgba(255, 0, 48, 1) calc(100% - calc(var(--slider-track-size) / 2))
1836
+ rgba(255, 0, 48, 1) calc(100% - var(--slider-thumb-inset))
1774
1837
  );
1775
1838
  }
1776
1839
  @supports (color: color(display-p3 1 1 1)) {
@@ -1778,7 +1841,7 @@
1778
1841
  .fp-ColorPickerHueSlider:where(.fp-color-model-hsv, .fp-color-model-hsl):where(.fp-color-space-display-p3) {
1779
1842
  --slider-track-bg: linear-gradient(
1780
1843
  90deg,
1781
- color(display-p3 1 0 0) calc(var(--slider-track-size) / 2),
1844
+ color(display-p3 1 0 0) var(--slider-thumb-inset),
1782
1845
  color(display-p3 1 0.1875 0),
1783
1846
  color(display-p3 1 0.375 0),
1784
1847
  color(display-p3 1 0.5625 0),
@@ -1809,7 +1872,7 @@
1809
1872
  color(display-p3 1 0 0.75),
1810
1873
  color(display-p3 1 0 0.5625),
1811
1874
  color(display-p3 1 0 0.375),
1812
- color(display-p3 1 0 0.1875) calc(100% - calc(var(--slider-track-size) / 2))
1875
+ color(display-p3 1 0 0.1875) calc(100% - var(--slider-thumb-inset))
1813
1876
  );
1814
1877
  }
1815
1878
  }
@@ -1821,8 +1884,8 @@
1821
1884
 
1822
1885
  --slider-track-bg: linear-gradient(
1823
1886
  to right,
1824
- var(--track-bg-step-1) 0 calc(var(--slider-track-size) / 2),
1825
- var(--track-bg-step-2) calc(100% - calc(var(--slider-track-size) / 2)) 100%
1887
+ var(--track-bg-step-1) 0 var(--slider-thumb-inset),
1888
+ var(--track-bg-step-2) calc(100% - var(--slider-thumb-inset)) 100%
1826
1889
  ),
1827
1890
  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')
1828
1891
  0 0 / auto 66.66%,