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/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;
638
643
  }
639
- .fp-ValueFieldMulti:focus-within {
644
+ .fp-ValueFieldMulti:hover:where(:not([data-disabled]))::after {
645
+ border-color: var(--figma-color-border);
646
+ }
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 {
@@ -1217,6 +1248,16 @@
1217
1248
  background-color: var(--figma-color-bg-selected-strong);
1218
1249
  --color-icon: var(--figma-color-icon-onbrand);
1219
1250
  }
1251
+ :root,
1252
+ .light,
1253
+ .light-theme {
1254
+ --switch-border-color: #00000033;
1255
+ --switch-thumb-outline-color-unchecked: #00000033;
1256
+ --switch-thumb-outline-color-checked: #0000001a;
1257
+ }
1258
+ .figma-dark {
1259
+ --switch-border-color: #ffffff33;
1260
+ }
1220
1261
  .fp-switchRoot {
1221
1262
  appearance: none;
1222
1263
  box-sizing: border-box;
@@ -1235,18 +1276,26 @@
1235
1276
  outline and the background in the focused mode as it is in Figma. */
1236
1277
  }
1237
1278
  .fp-switchRoot::before {
1279
+ box-sizing: border-box;
1238
1280
  position: absolute;
1239
1281
  inset: 0;
1282
+ border: 1px solid var(--switch-border-color);
1240
1283
  border-radius: var(--radius-full);
1241
1284
  background: none;
1242
1285
  content: '';
1243
1286
  }
1244
1287
  .fp-switchRoot[data-unchecked]::before {
1288
+ background: var(--figma-color-bg-secondary);
1289
+ }
1290
+ .fp-switchRoot[data-unchecked]:active::before {
1245
1291
  background: var(--figma-color-bg-tertiary);
1246
1292
  }
1247
1293
  .fp-switchRoot[data-checked]::before {
1248
1294
  background: var(--figma-color-bg-brand);
1249
1295
  }
1296
+ .fp-switchRoot[data-checked]:active::before {
1297
+ background: var(--figma-color-bg-brand-pressed);
1298
+ }
1250
1299
  .fp-switchRoot:focus-visible {
1251
1300
  outline-offset: -1px;
1252
1301
  outline: 1px solid var(--figma-color-border-selected-strong);
@@ -1265,29 +1314,25 @@
1265
1314
  .fp-switchThumb {
1266
1315
  box-sizing: border-box;
1267
1316
  position: absolute;
1268
- top: 1px;
1269
- left: 1px;
1270
- height: var(--space-3_5);
1271
- width: var(--space-3_5);
1317
+ top: var(--space-1);
1318
+ left: var(--space-1);
1319
+ height: var(--space-2);
1320
+ width: var(--space-3);
1272
1321
  border-radius: var(--radius-full);
1322
+ outline: 1px solid var(--switch-thumb-outline-color-unchecked);
1273
1323
  background: var(--figma-color-icon-onbrand);
1274
1324
  transition: all 0.08s ease-out;
1275
1325
  }
1276
1326
  .fp-switchThumb[data-disabled] {
1277
1327
  background-color: var(--figma-color-icon-ondisabled);
1278
1328
  }
1279
- .fp-switchThumb[data-unchecked] {
1280
- left: 1px;
1281
- }
1282
1329
  .fp-switchThumb[data-checked] {
1283
- left: calc(100% - var(--space-3_5) - 1px);
1330
+ left: calc(100% - var(--space-3) - var(--space-1));
1331
+ outline-color: var(--switch-thumb-outline-color-checked);
1284
1332
  }
1285
1333
  :root,
1286
1334
  .light,
1287
1335
  .light-theme {
1288
- --slider-root-size: var(--space-6);
1289
- --slider-track-size: var(--space-4);
1290
- --slider-thumb-width: var(--space-4);
1291
1336
  --slider-track-border-color: #0000001a;
1292
1337
  --slider-track-bg: var(--figma-color-bg-secondary);
1293
1338
  --slider-thumb-bg: transparent;
@@ -1306,13 +1351,36 @@
1306
1351
  }
1307
1352
  .fp-SliderRoot[data-orientation='horizontal'] {
1308
1353
  height: var(--slider-root-size);
1309
- border-width: 0 calc(var(--slider-thumb-width) / 2);
1354
+ border-width: 0 var(--slider-thumb-inset);
1310
1355
  }
1311
1356
  .fp-SliderRoot[data-orientation='vertical'] {
1312
1357
  flex-direction: column;
1313
1358
  width: var(--slider-root-size);
1314
- border-width: calc(var(--slider-thumb-width) / 2) 0;
1359
+ border-width: var(--slider-thumb-inset) 0;
1315
1360
  }
1361
+ .fp-SliderRoot:where(.fp-size-large) {
1362
+ --slider-root-size: var(--space-6);
1363
+ --slider-track-size: var(--space-4);
1364
+ --slider-thumb-size: var(--space-4);
1365
+ --slider-thumb-inset: calc(var(--slider-thumb-size) / 2);
1366
+ --slider-hint-width: var(--space-1);
1367
+ --slider-hint-height: var(--space-1);
1368
+ --slider-hint-offset: 0px;
1369
+ --slider-hint-radius: var(--radius-full);
1370
+ }
1371
+ .fp-SliderRoot:where(.fp-size-small) {
1372
+ --slider-root-size: var(--space-4);
1373
+ --slider-track-size: var(--space-1_5);
1374
+ --slider-thumb-size: var(--space-3);
1375
+ --slider-thumb-inset: calc(var(--slider-track-size) / 2);
1376
+ --slider-hint-width: 1px;
1377
+ --slider-hint-height: 3px;
1378
+ --slider-hint-offset: calc(var(--slider-track-size) / 2 + 3px + var(--slider-hint-height) / 2);
1379
+ --slider-hint-radius: 0;
1380
+ --slider-track-bg: var(--figma-color-bg-tertiary);
1381
+ --slider-track-border-color: transparent;
1382
+ --slider-thumb-bg: var(--figma-color-icon-onbrand);
1383
+ }
1316
1384
  .fp-SliderControl {
1317
1385
  position: relative;
1318
1386
  display: flex;
@@ -1322,9 +1390,19 @@
1322
1390
  height: 100%;
1323
1391
  outline: 0;
1324
1392
  }
1393
+ .fp-SliderControl::before {
1394
+ content: '';
1395
+ position: absolute;
1396
+ }
1397
+ .fp-SliderRoot[data-orientation='horizontal'] .fp-SliderControl::before {
1398
+ inset: calc(50% - var(--space-11) / 2) calc((var(--slider-thumb-inset) + var(--space-3)) * -1);
1399
+ }
1325
1400
  .fp-SliderRoot[data-orientation='vertical'] .fp-SliderControl {
1326
1401
  flex-direction: column;
1327
1402
  }
1403
+ .fp-SliderRoot[data-orientation='vertical'] .fp-SliderControl::before {
1404
+ inset: calc((var(--slider-thumb-inset) + var(--space-3)) * -1) calc(50% - var(--space-11) / 2);
1405
+ }
1328
1406
  .fp-SliderTrack {
1329
1407
  box-sizing: border-box;
1330
1408
  position: static;
@@ -1336,13 +1414,13 @@
1336
1414
  outline-offset: -1px;
1337
1415
  }
1338
1416
  .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);
1417
+ margin-left: calc(var(--slider-thumb-inset) * -1);
1418
+ margin-right: calc(var(--slider-thumb-inset) * -1);
1341
1419
  height: var(--slider-track-size);
1342
1420
  }
1343
1421
  .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);
1422
+ margin-top: calc(var(--slider-thumb-inset) * -1);
1423
+ margin-bottom: calc(var(--slider-thumb-inset) * -1);
1346
1424
  width: var(--slider-track-size);
1347
1425
  }
1348
1426
  .fp-SliderRange {
@@ -1353,13 +1431,13 @@
1353
1431
  }
1354
1432
  .fp-SliderRange[data-orientation='horizontal'] {
1355
1433
  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);
1434
+ margin-left: calc(var(--slider-thumb-inset) * -1);
1435
+ margin-right: calc(var(--slider-thumb-inset) * -1);
1358
1436
  }
1359
1437
  .fp-SliderRange[data-orientation='vertical'] {
1360
1438
  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);
1439
+ margin-top: calc(var(--slider-thumb-inset) * -1);
1440
+ margin-bottom: calc(var(--slider-thumb-inset) * -1);
1363
1441
  }
1364
1442
  .fp-SliderRange[data-disabled] {
1365
1443
  background-color: var(--figma-color-bg-disabled);
@@ -1368,8 +1446,8 @@
1368
1446
  box-sizing: border-box;
1369
1447
  display: block;
1370
1448
  z-index: 1;
1371
- width: var(--slider-track-size);
1372
- height: var(--slider-track-size);
1449
+ width: var(--slider-thumb-size);
1450
+ height: var(--slider-thumb-size);
1373
1451
  background-color: var(--slider-thumb-bg);
1374
1452
  border: 4px solid var(--figma-color-icon-onbrand);
1375
1453
  border-radius: var(--radius-full);
@@ -1390,17 +1468,19 @@
1390
1468
  .fp-SliderHint {
1391
1469
  position: absolute;
1392
1470
  display: block;
1393
- width: var(--space-1);
1394
- height: var(--space-1);
1395
1471
  background-color: var(--figma-color-icon-tertiary);
1396
- border-radius: var(--radius-full);
1472
+ border-radius: var(--slider-hint-radius);
1397
1473
  }
1398
1474
  .fp-SliderHint[data-orientation='horizontal'] {
1399
- top: 50%;
1475
+ top: calc(50% + var(--slider-hint-offset));
1476
+ width: var(--slider-hint-width);
1477
+ height: var(--slider-hint-height);
1400
1478
  transform: translateY(-50%);
1401
1479
  }
1402
1480
  .fp-SliderHint[data-orientation='vertical'] {
1403
- left: 50%;
1481
+ left: calc(50% + var(--slider-hint-offset));
1482
+ width: var(--slider-hint-height);
1483
+ height: var(--slider-hint-width);
1404
1484
  transform: translateX(-50%);
1405
1485
  }
1406
1486
  .fp-SliderHint.fp-SliderHint-baseValue {
@@ -1739,7 +1819,7 @@
1739
1819
  .fp-ColorPickerHueSlider:where(.fp-color-model-hsv, .fp-color-model-hsl, .fp-color-model-rgb, .fp-color-model-hex) {
1740
1820
  --slider-track-bg: linear-gradient(
1741
1821
  90deg,
1742
- rgba(255, 0, 0, 1) calc(var(--slider-track-size) / 2),
1822
+ rgba(255, 0, 0, 1) var(--slider-thumb-inset),
1743
1823
  rgba(255, 48, 0, 1),
1744
1824
  rgba(255, 96, 0, 1),
1745
1825
  rgba(255, 143, 0, 1),
@@ -1770,7 +1850,7 @@
1770
1850
  rgba(255, 0, 191, 1),
1771
1851
  rgba(255, 0, 143, 1),
1772
1852
  rgba(255, 0, 96, 1),
1773
- rgba(255, 0, 48, 1) calc(100% - calc(var(--slider-track-size) / 2))
1853
+ rgba(255, 0, 48, 1) calc(100% - var(--slider-thumb-inset))
1774
1854
  );
1775
1855
  }
1776
1856
  @supports (color: color(display-p3 1 1 1)) {
@@ -1778,7 +1858,7 @@
1778
1858
  .fp-ColorPickerHueSlider:where(.fp-color-model-hsv, .fp-color-model-hsl):where(.fp-color-space-display-p3) {
1779
1859
  --slider-track-bg: linear-gradient(
1780
1860
  90deg,
1781
- color(display-p3 1 0 0) calc(var(--slider-track-size) / 2),
1861
+ color(display-p3 1 0 0) var(--slider-thumb-inset),
1782
1862
  color(display-p3 1 0.1875 0),
1783
1863
  color(display-p3 1 0.375 0),
1784
1864
  color(display-p3 1 0.5625 0),
@@ -1809,7 +1889,7 @@
1809
1889
  color(display-p3 1 0 0.75),
1810
1890
  color(display-p3 1 0 0.5625),
1811
1891
  color(display-p3 1 0 0.375),
1812
- color(display-p3 1 0 0.1875) calc(100% - calc(var(--slider-track-size) / 2))
1892
+ color(display-p3 1 0 0.1875) calc(100% - var(--slider-thumb-inset))
1813
1893
  );
1814
1894
  }
1815
1895
  }
@@ -1821,8 +1901,8 @@
1821
1901
 
1822
1902
  --slider-track-bg: linear-gradient(
1823
1903
  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%
1904
+ var(--track-bg-step-1) 0 var(--slider-thumb-inset),
1905
+ var(--track-bg-step-2) calc(100% - var(--slider-thumb-inset)) 100%
1826
1906
  ),
1827
1907
  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
1908
  0 0 / auto 66.66%,