@xsolla/xui-core 0.216.1 → 0.218.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/index.mjs CHANGED
@@ -1,6 +1,3 @@
1
- // src/index.tsx
2
- import React3, { createContext, useContext, useState, useMemo } from "react";
3
-
4
1
  // src/tokens/dark.json
5
2
  var dark_default = {
6
3
  background: {
@@ -1306,6 +1303,441 @@ var ltg_dark_default = {
1306
1303
  }
1307
1304
  };
1308
1305
 
1306
+ // src/tokens/ltg-light.json
1307
+ var ltg_light_default = {
1308
+ background: {
1309
+ primary: "#ffffff",
1310
+ secondary: "#f2f2f2",
1311
+ brand: {
1312
+ primary: "#c9eb6a",
1313
+ secondary: "#eff9d2"
1314
+ },
1315
+ brandExtra: {
1316
+ primary: "#535e99",
1317
+ secondary: "#b0baee"
1318
+ },
1319
+ inverse: "#0d143a",
1320
+ static: {
1321
+ dark: "#0d143a",
1322
+ light: "#ffffff"
1323
+ },
1324
+ success: {
1325
+ primary: "#95ff80",
1326
+ secondary: "#bfffb2"
1327
+ },
1328
+ warning: {
1329
+ primary: "#ffc380",
1330
+ secondary: "#ffdbb2"
1331
+ },
1332
+ alert: {
1333
+ primary: "#f67055",
1334
+ secondary: "#ffbfb2"
1335
+ },
1336
+ neutral: {
1337
+ primary: "#888a96",
1338
+ secondary: "#d9dadd"
1339
+ }
1340
+ },
1341
+ content: {
1342
+ primary: "#000000",
1343
+ secondary: "#52535b",
1344
+ tertiary: "#898b97",
1345
+ brand: {
1346
+ primary: "#535e99",
1347
+ secondary: "#31cae8"
1348
+ },
1349
+ brandExtra: {
1350
+ primary: "#0d143a",
1351
+ secondary: "#535e99"
1352
+ },
1353
+ inverse: "#ffffff",
1354
+ static: {
1355
+ light: "#ffffff",
1356
+ dark: "#000000"
1357
+ },
1358
+ success: {
1359
+ primary: "#368f24",
1360
+ secondary: "#3dc322"
1361
+ },
1362
+ warning: {
1363
+ primary: "#c37822",
1364
+ secondary: "#f6ab55"
1365
+ },
1366
+ alert: {
1367
+ primary: "#e84f30",
1368
+ secondary: "#f67055"
1369
+ },
1370
+ neutral: {
1371
+ primary: "#3e4046",
1372
+ secondary: "#6e707c"
1373
+ },
1374
+ on: {
1375
+ brand: "#0d143a",
1376
+ brandExtra: "#ffffff",
1377
+ success: "#000000",
1378
+ warning: "#000000",
1379
+ alert: "#ffffff",
1380
+ neutral: "#000000"
1381
+ }
1382
+ },
1383
+ border: {
1384
+ primary: "rgba(0, 0, 0, 0)",
1385
+ secondary: "rgba(0, 0, 0, 0)",
1386
+ brand: "rgba(0, 0, 0, 0)",
1387
+ brandExtra: "rgba(0, 0, 0, 0)",
1388
+ inverse: "rgba(0, 0, 0, 0)",
1389
+ success: "rgba(0, 0, 0, 0)",
1390
+ warning: "rgba(0, 0, 0, 0)",
1391
+ alert: "rgba(0, 0, 0, 0)",
1392
+ neutral: "rgba(0, 0, 0, 0)"
1393
+ },
1394
+ overlay: {
1395
+ mono: "rgba(0, 0, 0, 0.05)",
1396
+ brand: "rgba(201, 235, 106, 0.3)",
1397
+ brandExtra: "rgba(83, 94, 153, 0.3)",
1398
+ success: "rgba(149, 255, 128, 0.24)",
1399
+ warning: "rgba(255, 195, 128, 0.28)",
1400
+ alert: "rgba(255, 149, 128, 0.24)",
1401
+ neutral: "rgba(136, 138, 150, 0.3)",
1402
+ monoHover: "rgba(0, 0, 0, 0.1)"
1403
+ },
1404
+ layer: {
1405
+ scrim: "rgba(0, 0, 0, 0.5)",
1406
+ float: "rgba(255, 255, 255, 0.75)"
1407
+ },
1408
+ data: {
1409
+ brand: {
1410
+ s12: "#e5fbff",
1411
+ s11: "#ccf6ff",
1412
+ s10: "#b2f2ff",
1413
+ s9: "#80eaff",
1414
+ s8: "#b0baee",
1415
+ s7: "#535e99",
1416
+ s6: "#22a8c3",
1417
+ s5: "#1b8398",
1418
+ s4: "#0d143a",
1419
+ s3: "#0b3841",
1420
+ s2: "#041316"
1421
+ },
1422
+ contrast: {
1423
+ pink: "#ffa5eb",
1424
+ orange: "#d9875e",
1425
+ yellow: "#9c8f6c",
1426
+ green: "#c9eb6a",
1427
+ cyan: "#67cad7",
1428
+ grey: "#898b97",
1429
+ lilac: "#aea0ff",
1430
+ purple: "#5040ad"
1431
+ },
1432
+ neutral: {
1433
+ n11: "rgba(0, 0, 0, 0.05)",
1434
+ n12: "#f2f2f2",
1435
+ n13: "#d7dee0"
1436
+ }
1437
+ },
1438
+ control: {
1439
+ brand: {
1440
+ primary: {
1441
+ bg: "#c9eb6a",
1442
+ bgHover: "#eff9d2",
1443
+ bgPress: "#aac858",
1444
+ bgDisable: "#d0d1d5",
1445
+ border: "rgba(0, 0, 0, 0)",
1446
+ borderHover: "rgba(0, 0, 0, 0)",
1447
+ borderPress: "rgba(0, 0, 0, 0)",
1448
+ borderDisable: "rgba(0, 0, 0, 0)"
1449
+ },
1450
+ secondary: {
1451
+ bg: "#eff9d2",
1452
+ bgHover: "#e4f5b3",
1453
+ bgPress: "#dcf29e",
1454
+ border: "rgba(0, 0, 0, 0)",
1455
+ borderHover: "rgba(0, 0, 0, 0)",
1456
+ borderPress: "rgba(0, 0, 0, 0)"
1457
+ },
1458
+ tertiary: {
1459
+ bg: "rgba(0, 0, 0, 0)",
1460
+ bgHover: "rgba(201, 235, 106, 0.15)",
1461
+ bgPress: "rgba(201, 235, 106, 0.25)",
1462
+ border: "rgba(0, 0, 0, 0)",
1463
+ borderHover: "rgba(0, 0, 0, 0)",
1464
+ borderPress: "rgba(0, 0, 0, 0)"
1465
+ },
1466
+ text: {
1467
+ primary: "#0d143a",
1468
+ secondary: "#0d143a",
1469
+ tertiary: "#63762d",
1470
+ disable: "#898b97",
1471
+ ghost: "#63762d"
1472
+ },
1473
+ ghost: {
1474
+ bg: "rgba(0, 0, 0, 0)",
1475
+ bgHover: "rgba(99, 118, 45, 0.04)",
1476
+ bgPress: "rgba(99, 118, 45, 0.08)",
1477
+ border: "rgba(0, 0, 0, 0)",
1478
+ borderHover: "rgba(0, 0, 0, 0)",
1479
+ borderPress: "rgba(0, 0, 0, 0)"
1480
+ }
1481
+ },
1482
+ mono: {
1483
+ primary: {
1484
+ bg: "#1a1a1a",
1485
+ bgHover: "#333333",
1486
+ bgPress: "#000000",
1487
+ border: "rgba(0, 0, 0, 0)",
1488
+ borderHover: "rgba(0, 0, 0, 0)",
1489
+ borderPress: "rgba(0, 0, 0, 0)"
1490
+ },
1491
+ secondary: {
1492
+ bg: "rgba(26, 26, 26, 0.12)",
1493
+ bgHover: "rgba(51, 51, 51, 0.12)",
1494
+ bgPress: "rgba(0, 0, 0, 0.12)",
1495
+ border: "rgba(0, 0, 0, 0)",
1496
+ borderHover: "rgba(0, 0, 0, 0)",
1497
+ borderPress: "rgba(0, 0, 0, 0)"
1498
+ },
1499
+ tertiary: {
1500
+ bg: "rgba(0, 0, 0, 0)",
1501
+ bgHover: "rgba(0, 0, 0, 0.1)",
1502
+ bgPress: "rgba(0, 0, 0, 0.2)",
1503
+ border: "rgba(0, 0, 0, 0)",
1504
+ borderHover: "rgba(0, 0, 0, 0)",
1505
+ borderPress: "rgba(0, 0, 0, 0)"
1506
+ },
1507
+ text: {
1508
+ primary: "#ffffff",
1509
+ secondary: "#000000",
1510
+ tertiary: "#000000",
1511
+ ghost: "#000000"
1512
+ },
1513
+ ghost: {
1514
+ bg: "rgba(0, 0, 0, 0)",
1515
+ bgHover: "rgba(0, 0, 0, 0.04)",
1516
+ bgPress: "rgba(0, 0, 0, 0.08)",
1517
+ border: "rgba(0, 0, 0, 0)",
1518
+ borderHover: "rgba(0, 0, 0, 0)",
1519
+ borderPress: "rgba(0, 0, 0, 0)"
1520
+ }
1521
+ },
1522
+ brandExtra: {
1523
+ primary: {
1524
+ bg: "#535e99",
1525
+ bgHover: "#0d143a",
1526
+ bgPress: "#30396a",
1527
+ border: "rgba(0, 0, 0, 0)",
1528
+ borderHover: "rgba(0, 0, 0, 0)",
1529
+ borderPress: "rgba(0, 0, 0, 0)"
1530
+ },
1531
+ secondary: {
1532
+ bg: "#b0baee",
1533
+ bgHover: "#949ed5",
1534
+ bgPress: "#828cc4",
1535
+ border: "rgba(0, 0, 0, 0)",
1536
+ borderHover: "rgba(0, 0, 0, 0)",
1537
+ borderPress: "rgba(0, 0, 0, 0)"
1538
+ },
1539
+ tertiary: {
1540
+ bg: "rgba(0, 0, 0, 0)",
1541
+ bgHover: "rgba(83, 94, 153, 0.1)",
1542
+ bgPress: "rgba(83, 94, 153, 0.2)",
1543
+ border: "rgba(0, 0, 0, 0)",
1544
+ borderHover: "rgba(0, 0, 0, 0)",
1545
+ borderPress: "rgba(0, 0, 0, 0)"
1546
+ },
1547
+ text: {
1548
+ primary: "#ffffff",
1549
+ secondary: "#000000",
1550
+ tertiary: "#0d143a",
1551
+ ghost: "#0d143a"
1552
+ },
1553
+ ghost: {
1554
+ bg: "rgba(0, 0, 0, 0)",
1555
+ bgHover: "rgba(13, 20, 58, 0.04)",
1556
+ bgPress: "rgba(13, 20, 58, 0.08)",
1557
+ border: "rgba(0, 0, 0, 0)",
1558
+ borderHover: "rgba(0, 0, 0, 0)",
1559
+ borderPress: "rgba(0, 0, 0, 0)"
1560
+ }
1561
+ },
1562
+ alert: {
1563
+ bg: "#ffbfb2",
1564
+ border: "rgba(0, 0, 0, 0)",
1565
+ primary: {
1566
+ bg: "#e84f30",
1567
+ bgHover: "#f67055",
1568
+ bgPress: "#c33d22",
1569
+ border: "rgba(0, 0, 0, 0)",
1570
+ borderHover: "rgba(0, 0, 0, 0)",
1571
+ borderPress: "rgba(0, 0, 0, 0)"
1572
+ },
1573
+ secondary: {
1574
+ bg: "#ffbfb2",
1575
+ bgHover: "#ffddd6",
1576
+ bgPress: "#ff9580",
1577
+ border: "rgba(0, 0, 0, 0)",
1578
+ borderHover: "rgba(0, 0, 0, 0)",
1579
+ borderPress: "rgba(0, 0, 0, 0)"
1580
+ },
1581
+ tertiary: {
1582
+ bg: "rgba(232, 79, 48, 0)",
1583
+ bgHover: "rgba(232, 79, 48, 0.07)",
1584
+ bgPress: "rgba(232, 79, 48, 0.12)",
1585
+ border: "rgba(0, 0, 0, 0)",
1586
+ borderHover: "rgba(0, 0, 0, 0)",
1587
+ borderPress: "rgba(0, 0, 0, 0)"
1588
+ },
1589
+ text: {
1590
+ primary: "#ffffff",
1591
+ secondary: "#000000",
1592
+ tertiary: "#c33d22",
1593
+ ghost: "#c33d22"
1594
+ },
1595
+ ghost: {
1596
+ bg: "rgba(0, 0, 0, 0)",
1597
+ bgHover: "rgba(195, 61, 34, 0.04)",
1598
+ bgPress: "rgba(195, 61, 34, 0.08)",
1599
+ border: "rgba(0, 0, 0, 0)",
1600
+ borderHover: "rgba(0, 0, 0, 0)",
1601
+ borderPress: "rgba(0, 0, 0, 0)"
1602
+ }
1603
+ },
1604
+ input: {
1605
+ bg: "#ffffff",
1606
+ bgHover: "#f2f2f2",
1607
+ bgDisable: "#d3d3d3",
1608
+ border: "#d0d1d5",
1609
+ borderHover: "#898b97",
1610
+ borderDisable: "rgba(0, 0, 0, 0)",
1611
+ text: "#000000",
1612
+ placeholder: "#6e6e6e",
1613
+ textDisable: "#898b97"
1614
+ },
1615
+ focus: {
1616
+ bg: "#ffffff",
1617
+ border: "#c9eb6b"
1618
+ },
1619
+ check: {
1620
+ bg: "#c9eb6b",
1621
+ bgHover: "#b8e53e",
1622
+ bgDisable: "rgba(0, 0, 0, 0.2)",
1623
+ border: "#c9eb6b",
1624
+ borderHover: "#b8e53e",
1625
+ borderDisable: "rgba(0, 0, 0, 0)",
1626
+ icon: "#0d143a"
1627
+ },
1628
+ faint: {
1629
+ bg: "rgba(0, 0, 0, 0.15)",
1630
+ bgHover: "rgba(0, 0, 0, 0.2)",
1631
+ border: "rgba(0, 0, 0, 0)",
1632
+ borderHover: "rgba(0, 0, 0, 0)"
1633
+ },
1634
+ slider: {
1635
+ bg: "#c9eb6b",
1636
+ bgHover: "#d9f198",
1637
+ bgDisable: "rgba(0, 0, 0, 0.25)"
1638
+ },
1639
+ switch: {
1640
+ bg: "#c9eb6b",
1641
+ bgHover: "#b8e53e",
1642
+ bgDisable: "rgba(0, 0, 0, 0.25)",
1643
+ border: "rgba(0, 0, 0, 0)",
1644
+ borderHover: "rgba(0, 0, 0, 0)",
1645
+ borderDisable: "rgba(0, 0, 0, 0)"
1646
+ },
1647
+ knob: {
1648
+ bg: "#c9eb6b",
1649
+ bgHover: "#eff9d2",
1650
+ bgActive: "#c9eb6b",
1651
+ bgActiveHover: "#eff9d2",
1652
+ bgInactive: "#ffffff",
1653
+ bgInactiveHover: "#f4f5f6",
1654
+ bgDisable: "#8c8c8c"
1655
+ },
1656
+ text: {
1657
+ primary: "#000000",
1658
+ disable: "rgba(0, 0, 0, 0.36)"
1659
+ },
1660
+ link: {
1661
+ primary: "#aea0ff",
1662
+ primaryHover: "#5040ad",
1663
+ secondary: "#aea0ff",
1664
+ secondaryHover: "#5040ad"
1665
+ },
1666
+ segmented: {
1667
+ bg: "rgba(0, 0, 0, 0.08)",
1668
+ bgHover: "rgba(0, 0, 0, 0.08)",
1669
+ bgActive: "#ffffff",
1670
+ border: "rgba(0, 0, 0, 0.1)",
1671
+ borderHover: "rgba(0, 0, 0, 0.1)",
1672
+ borderActive: "rgba(0, 0, 0, 0)",
1673
+ text: "#000000",
1674
+ textDisable: "rgba(0, 0, 0, 0.36)"
1675
+ },
1676
+ tagLabel: {
1677
+ product: {
1678
+ bg: "#d9ff66",
1679
+ text: "#000000",
1680
+ textCompact: "rgba(0, 0, 0, 0.48)"
1681
+ },
1682
+ rarity: {
1683
+ bg: "#141d1f",
1684
+ text: "#22a8c3"
1685
+ },
1686
+ name: {
1687
+ bg: "rgba(155, 165, 145, 0.1)",
1688
+ text: "#000000"
1689
+ },
1690
+ account: {
1691
+ bg: "#9580ff",
1692
+ text: "#000000",
1693
+ textCompact: "rgba(0, 0, 0, 0.48)"
1694
+ },
1695
+ id: {
1696
+ bg: "#dddfd8",
1697
+ bgSeries: "#000000",
1698
+ textSeries: "#d7dee0",
1699
+ textNumber: "#000000",
1700
+ textCompact: "rgba(0, 0, 0, 0.48)"
1701
+ },
1702
+ subentity: {
1703
+ bg: "#a9aca0",
1704
+ text: "#000000"
1705
+ },
1706
+ item: {
1707
+ bg: "#55dcf6",
1708
+ text: "#000000",
1709
+ textCompact: "rgba(0, 0, 0, 0.48)"
1710
+ }
1711
+ },
1712
+ toast: {
1713
+ bg: "#0d143a"
1714
+ },
1715
+ toggleButton: {
1716
+ bg: "rgba(0, 0, 0, 0.08)",
1717
+ bgHover: "rgba(0, 0, 0, 0.12)",
1718
+ bgActive: "rgba(201, 235, 107, 0.4)",
1719
+ bgDisable: "rgba(0, 0, 0, 0.25)",
1720
+ border: "rgba(0, 0, 0, 0)",
1721
+ borderHover: "rgba(0, 0, 0, 0)",
1722
+ borderActive: "rgba(0, 0, 0, 0)",
1723
+ borderDisable: "rgba(0, 0, 0, 0)",
1724
+ text: "#000000",
1725
+ textActive: "#000000",
1726
+ textDisable: "rgba(0, 0, 0, 0.36)"
1727
+ },
1728
+ appButton: {
1729
+ bg: "#dadbd7",
1730
+ bgHover: "#c1c2bc",
1731
+ bgPress: "#a8aaa2",
1732
+ border: "rgba(0, 0, 0, 0)",
1733
+ borderHover: "rgba(0, 0, 0, 0)",
1734
+ borderPress: "rgba(0, 0, 0, 0)",
1735
+ text: "#000000",
1736
+ textDisable: "#999999"
1737
+ }
1738
+ }
1739
+ };
1740
+
1309
1741
  // src/tokens/blueprints.json
1310
1742
  var blueprints_default = {
1311
1743
  background: {
@@ -2618,24 +3050,43 @@ var colors = {
2618
3050
  "pentagram-dark": dark_default,
2619
3051
  "pentagram-light": light_default,
2620
3052
  "ltg-dark": ltg_dark_default,
3053
+ "ltg-light": ltg_light_default,
2621
3054
  blueprints: blueprints_default,
2622
3055
  "corpsite-dark": corpsite_dark_default,
2623
3056
  "corpsite-light": corpsite_light_default
2624
3057
  };
2625
3058
 
2626
3059
  // src/tokens/spacing.ts
3060
+ var spacingScale = {
3061
+ "25": 2,
3062
+ "50": 4,
3063
+ "75": 6,
3064
+ "100": 8,
3065
+ "150": 12,
3066
+ "200": 16,
3067
+ "250": 20,
3068
+ "300": 24,
3069
+ "350": 28,
3070
+ "400": 32,
3071
+ "450": 36,
3072
+ "500": 40,
3073
+ "600": 48,
3074
+ "700": 56,
3075
+ "800": 64,
3076
+ "900": 72
3077
+ };
2627
3078
  var spacing = {
2628
- xs: 4,
2629
- sm: 8,
2630
- md: 16,
2631
- lg: 24,
2632
- xl: 32,
3079
+ xs: spacingScale["50"],
3080
+ sm: spacingScale["100"],
3081
+ md: spacingScale["200"],
3082
+ lg: spacingScale["300"],
3083
+ xl: spacingScale["400"],
2633
3084
  /** @deprecated Use `sm` instead (same 8px). Kept for backwards compatibility. */
2634
- s: 8,
3085
+ s: spacingScale["100"],
2635
3086
  /** @deprecated Use `md` instead (same 16px). Kept for backwards compatibility. */
2636
- m: 16,
3087
+ m: spacingScale["200"],
2637
3088
  /** @deprecated Use `lg` instead (same 24px). Kept for backwards compatibility. */
2638
- l: 24
3089
+ l: spacingScale["300"]
2639
3090
  };
2640
3091
  var radius = {
2641
3092
  button: 4,
@@ -2700,7 +3151,8 @@ var shape = {
2700
3151
  xl: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
2701
3152
  lg: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
2702
3153
  md: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
2703
- sm: { borderRadius: radiusScale["25"], borderWidth: stroke["1"] }
3154
+ sm: { borderRadius: radiusScale["25"], borderWidth: stroke["1"] },
3155
+ xs: { borderRadius: radiusScale["25"], borderWidth: stroke["1"] }
2704
3156
  },
2705
3157
  switch: {
2706
3158
  xl: { borderRadius: radiusScale["50"], borderWidth: stroke["1"] },
@@ -2763,7 +3215,9 @@ var shape = {
2763
3215
  borderRadius: radiusScale["100"]
2764
3216
  },
2765
3217
  toast: {
2766
- borderRadius: radiusScale["50"]
3218
+ borderRadius: radiusScale["50"],
3219
+ /** Figma "toast/frame/border-width" is 0 — toast is borderless by design. */
3220
+ borderWidth: 0
2767
3221
  },
2768
3222
  toggleButtonGroup: {
2769
3223
  xl: { borderRadius: radiusScale["100"], borderWidth: stroke["1"] },
@@ -2922,6 +3376,92 @@ var responsiveTypographyScale = {
2922
3376
  };
2923
3377
 
2924
3378
  // src/tokens/typography.ts
3379
+ var displayVariants = {
3380
+ b2c: {
3381
+ "display-lg": {
3382
+ fontSize: fontSize["900"].common,
3383
+ lineHeight: `${lineHeightDisplay["900"].common}px`,
3384
+ fontWeight: 700,
3385
+ scaleStep: "900",
3386
+ lineHeightCategory: "display",
3387
+ letterSpacing: -4,
3388
+ fontRole: "display"
3389
+ },
3390
+ "display-md": {
3391
+ fontSize: fontSize["850"].common,
3392
+ lineHeight: `${lineHeightDisplay["850"].common}px`,
3393
+ fontWeight: 700,
3394
+ scaleStep: "850",
3395
+ lineHeightCategory: "display",
3396
+ letterSpacing: -3,
3397
+ fontRole: "display"
3398
+ },
3399
+ "display-sm": {
3400
+ fontSize: fontSize["300"].common,
3401
+ lineHeight: `${lineHeightCompact["300"].common}px`,
3402
+ fontWeight: 500,
3403
+ scaleStep: "300",
3404
+ lineHeightCategory: "compact",
3405
+ fontRole: "compact"
3406
+ }
3407
+ },
3408
+ b2b: {
3409
+ "display-lg": {
3410
+ fontSize: fontSize["900"].common,
3411
+ lineHeight: `${lineHeightDisplay["900"].common}px`,
3412
+ fontWeight: 300,
3413
+ scaleStep: "900",
3414
+ lineHeightCategory: "display",
3415
+ letterSpacing: -4,
3416
+ fontRole: "display"
3417
+ },
3418
+ "display-md": {
3419
+ fontSize: fontSize["850"].common,
3420
+ lineHeight: `${lineHeightDisplay["850"].common}px`,
3421
+ fontWeight: 300,
3422
+ scaleStep: "850",
3423
+ lineHeightCategory: "display",
3424
+ letterSpacing: -3,
3425
+ fontRole: "display"
3426
+ },
3427
+ "display-sm": {
3428
+ fontSize: fontSize["750"].common,
3429
+ lineHeight: `${lineHeightDisplay["750"].common}px`,
3430
+ fontWeight: 400,
3431
+ scaleStep: "750",
3432
+ lineHeightCategory: "display",
3433
+ fontRole: "display"
3434
+ }
3435
+ },
3436
+ corpsite: {
3437
+ "display-lg": {
3438
+ fontSize: fontSize["900"].common,
3439
+ lineHeight: `${lineHeightDisplay["900"].common}px`,
3440
+ fontWeight: 300,
3441
+ scaleStep: "900",
3442
+ lineHeightCategory: "display",
3443
+ letterSpacing: -4,
3444
+ fontRole: "display"
3445
+ },
3446
+ "display-md": {
3447
+ fontSize: fontSize["850"].common,
3448
+ lineHeight: `${lineHeightDisplay["850"].common}px`,
3449
+ fontWeight: 300,
3450
+ scaleStep: "850",
3451
+ lineHeightCategory: "display",
3452
+ letterSpacing: -3,
3453
+ fontRole: "display"
3454
+ },
3455
+ "display-sm": {
3456
+ fontSize: fontSize["750"].common,
3457
+ lineHeight: `${lineHeightDisplay["750"].common}px`,
3458
+ fontWeight: 400,
3459
+ scaleStep: "750",
3460
+ lineHeightCategory: "display",
3461
+ fontRole: "display"
3462
+ }
3463
+ }
3464
+ };
2925
3465
  var typographyTokens = {
2926
3466
  b2c: {
2927
3467
  heading: {
@@ -2962,13 +3502,8 @@ var typographyTokens = {
2962
3502
  }
2963
3503
  },
2964
3504
  basic: {
2965
- display: {
2966
- fontSize: fontSize["550"].common,
2967
- lineHeight: `${lineHeightDisplay["550"].common}px`,
2968
- fontWeight: 800,
2969
- scaleStep: "550",
2970
- lineHeightCategory: "display"
2971
- },
3505
+ ...displayVariants.b2c,
3506
+ display: displayVariants.b2c["display-lg"],
2972
3507
  "body-lg": {
2973
3508
  fontSize: fontSize["175"].common,
2974
3509
  lineHeight: `${lineHeightCompact["175"].common}px`,
@@ -3075,13 +3610,8 @@ var typographyTokens = {
3075
3610
  }
3076
3611
  },
3077
3612
  basic: {
3078
- display: {
3079
- fontSize: fontSize["750"].common,
3080
- lineHeight: `${lineHeightDisplay["750"].common}px`,
3081
- fontWeight: 400,
3082
- scaleStep: "750",
3083
- lineHeightCategory: "display"
3084
- },
3613
+ ...displayVariants.b2b,
3614
+ display: displayVariants.b2b["display-lg"],
3085
3615
  "body-lg": {
3086
3616
  fontSize: fontSize["175"].common,
3087
3617
  lineHeight: `${lineHeightCompact["175"].common}px`,
@@ -3188,16 +3718,8 @@ var typographyTokens = {
3188
3718
  }
3189
3719
  },
3190
3720
  basic: {
3191
- // Figma splits corpsite display into display-lg (96px) / display-md (80px)
3192
- // / display-sm (64px). The app models a single `display`; mapped to
3193
- // display-lg (step 900) — the largest, matching Figma's primary display.
3194
- display: {
3195
- fontSize: fontSize["900"].common,
3196
- lineHeight: `${lineHeightDisplay["900"].common}px`,
3197
- fontWeight: 300,
3198
- scaleStep: "900",
3199
- lineHeightCategory: "display"
3200
- },
3721
+ ...displayVariants.corpsite,
3722
+ display: displayVariants.corpsite["display-lg"],
3201
3723
  "body-lg": {
3202
3724
  fontSize: fontSize["175"].common,
3203
3725
  lineHeight: `${lineHeightCompact["175"].common}px`,
@@ -3275,8 +3797,18 @@ var getTypographyVariant = (productContext, variant) => {
3275
3797
  if (variant in tokens.heading) {
3276
3798
  return tokens.heading[variant];
3277
3799
  }
3278
- if (variant === "display") {
3279
- return tokens.basic.display;
3800
+ const displayVariantMap = {
3801
+ display: "display-lg",
3802
+ displayLg: "display-lg",
3803
+ displayMd: "display-md",
3804
+ displaySm: "display-sm",
3805
+ "display-lg": "display-lg",
3806
+ "display-md": "display-md",
3807
+ "display-sm": "display-sm"
3808
+ };
3809
+ const displayKey = displayVariantMap[variant];
3810
+ if (displayKey) {
3811
+ return tokens.basic[displayKey];
3280
3812
  }
3281
3813
  const bodyVariantMap = {
3282
3814
  bodyLg: "body-lg",
@@ -3305,6 +3837,1576 @@ var getTypographyVariant = (productContext, variant) => {
3305
3837
  return void 0;
3306
3838
  };
3307
3839
 
3840
+ // src/theme/sizing/button.ts
3841
+ var button = (size) => {
3842
+ const configs = {
3843
+ xl: {
3844
+ height: 64,
3845
+ padding: 20,
3846
+ fontSize: 20,
3847
+ lineHeight: 22,
3848
+ sublabelFontSize: 18,
3849
+ spinnerSize: 24,
3850
+ iconSize: 32,
3851
+ iconContainerSize: 64,
3852
+ borderRadius: shape.button.xl.borderRadius,
3853
+ labelIconSize: 22,
3854
+ labelIconGap: 6
3855
+ },
3856
+ lg: {
3857
+ height: 56,
3858
+ padding: 18,
3859
+ fontSize: 18,
3860
+ lineHeight: 20,
3861
+ sublabelFontSize: 16,
3862
+ spinnerSize: 24,
3863
+ iconSize: 28,
3864
+ iconContainerSize: 56,
3865
+ borderRadius: shape.button.lg.borderRadius,
3866
+ labelIconSize: 20,
3867
+ labelIconGap: 4
3868
+ },
3869
+ md: {
3870
+ height: 48,
3871
+ padding: 16,
3872
+ fontSize: 16,
3873
+ lineHeight: 18,
3874
+ sublabelFontSize: 14,
3875
+ spinnerSize: 24,
3876
+ iconSize: 24,
3877
+ iconContainerSize: 48,
3878
+ borderRadius: shape.button.md.borderRadius,
3879
+ labelIconSize: 18,
3880
+ labelIconGap: 4
3881
+ },
3882
+ sm: {
3883
+ height: 40,
3884
+ padding: 14,
3885
+ fontSize: 14,
3886
+ lineHeight: 16,
3887
+ sublabelFontSize: 12,
3888
+ spinnerSize: 24,
3889
+ iconSize: 20,
3890
+ iconContainerSize: 40,
3891
+ borderRadius: shape.button.sm.borderRadius,
3892
+ labelIconSize: 16,
3893
+ labelIconGap: 4
3894
+ },
3895
+ xs: {
3896
+ height: 32,
3897
+ padding: 12,
3898
+ fontSize: 12,
3899
+ lineHeight: 14,
3900
+ sublabelFontSize: 10,
3901
+ spinnerSize: 16,
3902
+ iconSize: 16,
3903
+ iconContainerSize: 32,
3904
+ borderRadius: shape.button.xs.borderRadius,
3905
+ labelIconSize: 14,
3906
+ labelIconGap: 4
3907
+ }
3908
+ };
3909
+ return configs[size];
3910
+ };
3911
+
3912
+ // src/theme/sizing/flexButton.ts
3913
+ var flexButton = (size) => {
3914
+ const configs = {
3915
+ xl: {
3916
+ height: 36,
3917
+ padding: 4,
3918
+ fontSize: 16,
3919
+ spinnerSize: 28,
3920
+ iconSize: 20,
3921
+ borderRadius: radiusScale["50"]
3922
+ },
3923
+ lg: {
3924
+ height: 32,
3925
+ padding: 4,
3926
+ fontSize: 14,
3927
+ spinnerSize: 24,
3928
+ iconSize: 18,
3929
+ borderRadius: radiusScale["50"]
3930
+ },
3931
+ md: {
3932
+ height: 28,
3933
+ padding: 2,
3934
+ fontSize: 14,
3935
+ spinnerSize: 24,
3936
+ iconSize: 16,
3937
+ borderRadius: radiusScale["25"]
3938
+ },
3939
+ sm: {
3940
+ height: 22,
3941
+ padding: 2,
3942
+ fontSize: 12,
3943
+ spinnerSize: 16,
3944
+ iconSize: 14,
3945
+ borderRadius: radiusScale["25"]
3946
+ },
3947
+ xs: {
3948
+ height: 20,
3949
+ padding: 2,
3950
+ fontSize: 12,
3951
+ spinnerSize: 16,
3952
+ iconSize: 12,
3953
+ borderRadius: radiusScale["25"]
3954
+ }
3955
+ };
3956
+ return configs[size];
3957
+ };
3958
+
3959
+ // src/theme/sizing/checkbox.ts
3960
+ var checkbox = (size) => {
3961
+ const configs = {
3962
+ xl: {
3963
+ size: 22,
3964
+ fontSize: 18,
3965
+ descriptionFontSize: 16,
3966
+ labelGap: 12,
3967
+ textGap: 4,
3968
+ borderRadius: shape.checkbox.xl.borderRadius
3969
+ },
3970
+ lg: {
3971
+ size: 20,
3972
+ fontSize: 16,
3973
+ descriptionFontSize: 14,
3974
+ labelGap: 10,
3975
+ textGap: 2,
3976
+ borderRadius: shape.checkbox.lg.borderRadius
3977
+ },
3978
+ md: {
3979
+ size: 18,
3980
+ fontSize: 16,
3981
+ descriptionFontSize: 14,
3982
+ labelGap: 8,
3983
+ textGap: 2,
3984
+ borderRadius: shape.checkbox.md.borderRadius
3985
+ },
3986
+ sm: {
3987
+ size: 16,
3988
+ fontSize: 14,
3989
+ descriptionFontSize: 12,
3990
+ labelGap: 8,
3991
+ textGap: 0,
3992
+ borderRadius: shape.checkbox.sm.borderRadius
3993
+ }
3994
+ };
3995
+ return configs[size];
3996
+ };
3997
+
3998
+ // src/theme/sizing/radio.ts
3999
+ var radio = (size) => {
4000
+ const configs = {
4001
+ xl: {
4002
+ size: 24,
4003
+ iconSize: 10,
4004
+ fontSize: 20,
4005
+ lineHeight: 22,
4006
+ descriptionFontSize: 18,
4007
+ descriptionLineHeight: 20,
4008
+ labelGap: 12,
4009
+ textGap: 4,
4010
+ borderWidth: 1
4011
+ },
4012
+ lg: {
4013
+ size: 20,
4014
+ iconSize: 8,
4015
+ fontSize: 18,
4016
+ lineHeight: 20,
4017
+ descriptionFontSize: 16,
4018
+ descriptionLineHeight: 18,
4019
+ labelGap: 10,
4020
+ textGap: 2,
4021
+ borderWidth: 1
4022
+ },
4023
+ md: {
4024
+ size: 18,
4025
+ iconSize: 8,
4026
+ fontSize: 16,
4027
+ lineHeight: 18,
4028
+ descriptionFontSize: 14,
4029
+ descriptionLineHeight: 16,
4030
+ labelGap: 8,
4031
+ textGap: 2,
4032
+ borderWidth: 1
4033
+ },
4034
+ sm: {
4035
+ size: 16,
4036
+ iconSize: 6,
4037
+ fontSize: 14,
4038
+ lineHeight: 16,
4039
+ descriptionFontSize: 12,
4040
+ descriptionLineHeight: 14,
4041
+ labelGap: 6,
4042
+ textGap: 0,
4043
+ borderWidth: 1
4044
+ }
4045
+ };
4046
+ return configs[size];
4047
+ };
4048
+
4049
+ // src/theme/sizing/input.ts
4050
+ var input = (size) => {
4051
+ const configs = {
4052
+ xl: {
4053
+ height: 64,
4054
+ paddingVertical: 12,
4055
+ paddingHorizontal: 12,
4056
+ fontSize: 20,
4057
+ iconSize: 22,
4058
+ radius: shape.input.xl.borderRadius,
4059
+ borderWidth: 2,
4060
+ fieldGap: 8,
4061
+ lineHeight: 20,
4062
+ contentGap: 10,
4063
+ trailingGap: 10
4064
+ },
4065
+ lg: {
4066
+ height: 56,
4067
+ paddingVertical: 14,
4068
+ paddingHorizontal: 12,
4069
+ fontSize: 18,
4070
+ iconSize: 20,
4071
+ radius: shape.input.lg.borderRadius,
4072
+ borderWidth: 2,
4073
+ fieldGap: 6,
4074
+ lineHeight: 18,
4075
+ contentGap: 8,
4076
+ trailingGap: 10
4077
+ },
4078
+ md: {
4079
+ height: 48,
4080
+ paddingVertical: 11,
4081
+ paddingHorizontal: 12,
4082
+ fontSize: 16,
4083
+ iconSize: 18,
4084
+ radius: shape.input.md.borderRadius,
4085
+ borderWidth: 1,
4086
+ fieldGap: 4,
4087
+ lineHeight: 16,
4088
+ contentGap: 6,
4089
+ trailingGap: 8
4090
+ },
4091
+ sm: {
4092
+ height: 40,
4093
+ paddingVertical: 7,
4094
+ paddingHorizontal: 10,
4095
+ fontSize: 14,
4096
+ iconSize: 16,
4097
+ radius: shape.input.sm.borderRadius,
4098
+ borderWidth: 1,
4099
+ fieldGap: 4,
4100
+ lineHeight: 14,
4101
+ contentGap: 4,
4102
+ trailingGap: 8
4103
+ },
4104
+ xs: {
4105
+ height: 32,
4106
+ paddingVertical: 7,
4107
+ paddingHorizontal: 10,
4108
+ fontSize: 12,
4109
+ iconSize: 14,
4110
+ radius: shape.input.xs.borderRadius,
4111
+ borderWidth: 1,
4112
+ fieldGap: 4,
4113
+ lineHeight: 10,
4114
+ contentGap: 4,
4115
+ trailingGap: 4
4116
+ }
4117
+ };
4118
+ return configs[size];
4119
+ };
4120
+
4121
+ // src/theme/sizing/imageUploader.ts
4122
+ var imageUploader = (size) => {
4123
+ const configs = {
4124
+ xl: {
4125
+ box: 200,
4126
+ padding: 14,
4127
+ gap: 10,
4128
+ iconSize: 32,
4129
+ spinnerSize: "lg",
4130
+ labelFontSize: 20,
4131
+ labelLineHeight: 22,
4132
+ descriptionFontSize: 20,
4133
+ descriptionLineHeight: 22,
4134
+ errorFontSize: 16,
4135
+ errorLineHeight: 18,
4136
+ errorGap: 8,
4137
+ radius: shape.input.xl.borderRadius,
4138
+ borderWidth: 1
4139
+ },
4140
+ lg: {
4141
+ box: 168,
4142
+ padding: 14,
4143
+ gap: 10,
4144
+ iconSize: 24,
4145
+ spinnerSize: "lg",
4146
+ labelFontSize: 18,
4147
+ labelLineHeight: 24,
4148
+ descriptionFontSize: 18,
4149
+ descriptionLineHeight: 20,
4150
+ errorFontSize: 16,
4151
+ errorLineHeight: 18,
4152
+ errorGap: 8,
4153
+ radius: shape.input.lg.borderRadius,
4154
+ borderWidth: 1
4155
+ },
4156
+ md: {
4157
+ box: 136,
4158
+ padding: 12,
4159
+ gap: 8,
4160
+ iconSize: 24,
4161
+ spinnerSize: "md",
4162
+ labelFontSize: 16,
4163
+ labelLineHeight: 20,
4164
+ descriptionFontSize: 16,
4165
+ descriptionLineHeight: 20,
4166
+ errorFontSize: 14,
4167
+ errorLineHeight: 16,
4168
+ errorGap: 6,
4169
+ radius: shape.input.md.borderRadius,
4170
+ borderWidth: 1
4171
+ },
4172
+ sm: {
4173
+ box: 104,
4174
+ padding: 10,
4175
+ gap: 6,
4176
+ iconSize: 18,
4177
+ spinnerSize: "sm",
4178
+ labelFontSize: 14,
4179
+ labelLineHeight: 18,
4180
+ descriptionFontSize: 14,
4181
+ descriptionLineHeight: 18,
4182
+ errorFontSize: 12,
4183
+ errorLineHeight: 14,
4184
+ errorGap: 6,
4185
+ radius: shape.input.sm.borderRadius,
4186
+ borderWidth: 1
4187
+ },
4188
+ xs: {
4189
+ box: 72,
4190
+ padding: 8,
4191
+ gap: 4,
4192
+ iconSize: 18,
4193
+ spinnerSize: "sm",
4194
+ labelFontSize: 12,
4195
+ labelLineHeight: 16,
4196
+ descriptionFontSize: 12,
4197
+ descriptionLineHeight: 16,
4198
+ errorFontSize: 11,
4199
+ errorLineHeight: 13,
4200
+ errorGap: 4,
4201
+ radius: shape.input.xs.borderRadius,
4202
+ borderWidth: 1
4203
+ }
4204
+ };
4205
+ return configs[size];
4206
+ };
4207
+
4208
+ // src/theme/sizing/dragDropUploader.ts
4209
+ var dragDropUploader = (size) => {
4210
+ const base = {
4211
+ width: 360,
4212
+ rootGap: 12,
4213
+ radius: 4,
4214
+ borderWidth: 1,
4215
+ textGap: 6,
4216
+ titleFontSize: 14,
4217
+ titleLineHeight: 18,
4218
+ descriptionFontSize: 14,
4219
+ descriptionLineHeight: 18,
4220
+ errorFontSize: 12,
4221
+ errorLineHeight: 16,
4222
+ listGap: 6,
4223
+ itemGap: 8,
4224
+ itemPaddingVertical: 8,
4225
+ itemPaddingLeft: 8,
4226
+ itemPaddingRight: 12,
4227
+ itemIconWrapperSize: 32,
4228
+ itemIconSize: 20,
4229
+ itemTitleFontSize: 14,
4230
+ itemTitleLineHeight: 16,
4231
+ itemDescriptionFontSize: 14,
4232
+ itemDescriptionLineHeight: 18,
4233
+ removeIconSize: 18
4234
+ };
4235
+ const configs = {
4236
+ xl: {
4237
+ ...base,
4238
+ areaHeight: 240,
4239
+ areaPadding: 20,
4240
+ areaGap: 16,
4241
+ iconSize: 32
4242
+ },
4243
+ lg: {
4244
+ ...base,
4245
+ areaHeight: 200,
4246
+ areaPadding: 20,
4247
+ areaGap: 16,
4248
+ iconSize: 24
4249
+ },
4250
+ md: {
4251
+ ...base,
4252
+ areaHeight: 160,
4253
+ areaPadding: 20,
4254
+ areaGap: 16,
4255
+ iconSize: 24
4256
+ },
4257
+ sm: {
4258
+ ...base,
4259
+ areaHeight: 128,
4260
+ areaPadding: 20,
4261
+ areaGap: 16,
4262
+ iconSize: 24
4263
+ },
4264
+ xs: {
4265
+ ...base,
4266
+ width: 320,
4267
+ rootGap: 8,
4268
+ areaHeight: 104,
4269
+ areaPadding: 16,
4270
+ areaGap: 8,
4271
+ textGap: 4,
4272
+ iconSize: 16,
4273
+ titleFontSize: 12,
4274
+ titleLineHeight: 16,
4275
+ descriptionFontSize: 12,
4276
+ descriptionLineHeight: 16,
4277
+ listGap: 4,
4278
+ itemGap: 4,
4279
+ itemPaddingVertical: 4,
4280
+ itemPaddingLeft: 4,
4281
+ itemIconWrapperSize: 24,
4282
+ itemIconSize: 16,
4283
+ itemTitleFontSize: 12,
4284
+ itemTitleLineHeight: 14,
4285
+ itemDescriptionFontSize: 12,
4286
+ itemDescriptionLineHeight: 16,
4287
+ removeIconSize: 14
4288
+ }
4289
+ };
4290
+ return configs[size];
4291
+ };
4292
+
4293
+ // src/theme/sizing/inputPin.ts
4294
+ var inputPin = (size) => {
4295
+ const configs = {
4296
+ xl: {
4297
+ size: 64,
4298
+ gap: 10,
4299
+ fontSize: 20,
4300
+ radius: shape.input.xl.borderRadius,
4301
+ borderWidth: 1,
4302
+ fieldGap: 8
4303
+ },
4304
+ lg: {
4305
+ size: 56,
4306
+ gap: 8,
4307
+ fontSize: 18,
4308
+ radius: shape.input.lg.borderRadius,
4309
+ borderWidth: 1,
4310
+ fieldGap: 6
4311
+ },
4312
+ md: {
4313
+ size: 48,
4314
+ gap: 6,
4315
+ fontSize: 16,
4316
+ radius: shape.input.md.borderRadius,
4317
+ borderWidth: 1,
4318
+ fieldGap: 4
4319
+ },
4320
+ sm: {
4321
+ size: 40,
4322
+ gap: 4,
4323
+ fontSize: 14,
4324
+ radius: shape.input.sm.borderRadius,
4325
+ borderWidth: 1,
4326
+ fieldGap: 4
4327
+ },
4328
+ xs: {
4329
+ size: 32,
4330
+ gap: 4,
4331
+ fontSize: 12,
4332
+ radius: shape.input.xs.borderRadius,
4333
+ borderWidth: 1,
4334
+ fieldGap: 4
4335
+ }
4336
+ };
4337
+ return configs[size];
4338
+ };
4339
+
4340
+ // src/theme/sizing/textarea.ts
4341
+ var textarea = (size) => {
4342
+ const configs = {
4343
+ xl: {
4344
+ height: 144,
4345
+ padding: spacing.xl,
4346
+ fontSize: 20,
4347
+ iconSize: 32,
4348
+ radius: shape.input.xl.borderRadius
4349
+ },
4350
+ lg: {
4351
+ height: 128,
4352
+ padding: spacing.lg,
4353
+ fontSize: 18,
4354
+ iconSize: 28,
4355
+ radius: shape.input.lg.borderRadius
4356
+ },
4357
+ md: {
4358
+ height: 112,
4359
+ padding: spacing.md,
4360
+ fontSize: 16,
4361
+ iconSize: 24,
4362
+ radius: shape.input.md.borderRadius
4363
+ },
4364
+ sm: {
4365
+ height: 96,
4366
+ padding: spacing.sm,
4367
+ fontSize: 14,
4368
+ iconSize: 20,
4369
+ radius: shape.input.sm.borderRadius
4370
+ },
4371
+ xs: {
4372
+ height: 80,
4373
+ padding: spacing.xs,
4374
+ fontSize: 12,
4375
+ iconSize: 16,
4376
+ radius: shape.input.xs.borderRadius
4377
+ }
4378
+ };
4379
+ return configs[size];
4380
+ };
4381
+
4382
+ // src/theme/sizing/switch.ts
4383
+ var switchSizing = (size) => {
4384
+ const configs = {
4385
+ xl: {
4386
+ width: 40,
4387
+ height: 22,
4388
+ knobSize: 18,
4389
+ fontSize: 20,
4390
+ lineHeight: 22,
4391
+ descriptionFontSize: 18,
4392
+ descriptionLineHeight: 20,
4393
+ labelGap: 12,
4394
+ textGap: 4,
4395
+ frameBorderRadius: shape.switch.xl.borderRadius,
4396
+ knobBorderRadius: shape.knob.xl.borderRadius
4397
+ },
4398
+ lg: {
4399
+ width: 36,
4400
+ height: 20,
4401
+ knobSize: 16,
4402
+ fontSize: 18,
4403
+ lineHeight: 20,
4404
+ descriptionFontSize: 16,
4405
+ descriptionLineHeight: 18,
4406
+ labelGap: 10,
4407
+ textGap: 2,
4408
+ frameBorderRadius: shape.switch.lg.borderRadius,
4409
+ knobBorderRadius: shape.knob.lg.borderRadius
4410
+ },
4411
+ md: {
4412
+ width: 32,
4413
+ height: 18,
4414
+ knobSize: 14,
4415
+ fontSize: 16,
4416
+ lineHeight: 18,
4417
+ descriptionFontSize: 14,
4418
+ descriptionLineHeight: 16,
4419
+ labelGap: 8,
4420
+ textGap: 2,
4421
+ frameBorderRadius: shape.switch.md.borderRadius,
4422
+ knobBorderRadius: shape.knob.md.borderRadius
4423
+ },
4424
+ sm: {
4425
+ width: 28,
4426
+ height: 16,
4427
+ knobSize: 12,
4428
+ fontSize: 14,
4429
+ lineHeight: 16,
4430
+ descriptionFontSize: 12,
4431
+ descriptionLineHeight: 14,
4432
+ labelGap: 8,
4433
+ textGap: 0,
4434
+ frameBorderRadius: shape.switch.sm.borderRadius,
4435
+ knobBorderRadius: shape.knob.sm.borderRadius
4436
+ }
4437
+ };
4438
+ return configs[size];
4439
+ };
4440
+
4441
+ // src/theme/sizing/avatar.ts
4442
+ var avatar = (size) => {
4443
+ const configs = {
4444
+ xl: {
4445
+ size: 64,
4446
+ fontSize: 20,
4447
+ iconSize: 32,
4448
+ badgeSize: 20,
4449
+ badgeOffsetCircle: { right: -4, top: -4 },
4450
+ badgeOffsetSquare: { right: -8, top: -8 },
4451
+ borderRadiusSquare: shape.avatar.xl.borderRadius,
4452
+ borderRadiusCircle: radiusScale["999"]
4453
+ },
4454
+ lg: {
4455
+ size: 56,
4456
+ fontSize: 20,
4457
+ iconSize: 28,
4458
+ badgeSize: 20,
4459
+ badgeOffsetCircle: { right: -4, top: -4 },
4460
+ badgeOffsetSquare: { right: -8, top: -8 },
4461
+ borderRadiusSquare: shape.avatar.lg.borderRadius,
4462
+ borderRadiusCircle: radiusScale["999"]
4463
+ },
4464
+ md: {
4465
+ size: 48,
4466
+ fontSize: 18,
4467
+ iconSize: 24,
4468
+ badgeSize: 20,
4469
+ badgeOffsetCircle: { right: -5, top: -5 },
4470
+ badgeOffsetSquare: { right: -8, top: -8 },
4471
+ borderRadiusSquare: shape.avatar.md.borderRadius,
4472
+ borderRadiusCircle: radiusScale["999"]
4473
+ },
4474
+ sm: {
4475
+ size: 40,
4476
+ fontSize: 16,
4477
+ iconSize: 20,
4478
+ badgeSize: 20,
4479
+ badgeOffsetCircle: { right: -6, top: -6 },
4480
+ badgeOffsetSquare: { right: -8, top: -8 },
4481
+ borderRadiusSquare: shape.avatar.sm.borderRadius,
4482
+ borderRadiusCircle: radiusScale["999"]
4483
+ },
4484
+ xs: {
4485
+ size: 32,
4486
+ fontSize: 12,
4487
+ iconSize: 16,
4488
+ badgeSize: 8,
4489
+ badgeOffsetCircle: { right: -1, top: -1 },
4490
+ badgeOffsetSquare: { right: -3, top: -3 },
4491
+ borderRadiusSquare: shape.avatar.xs.borderRadius,
4492
+ borderRadiusCircle: radiusScale["999"]
4493
+ },
4494
+ xxs: {
4495
+ size: 24,
4496
+ fontSize: 10,
4497
+ iconSize: 12,
4498
+ badgeSize: 6,
4499
+ badgeOffsetCircle: { right: -1, top: -1 },
4500
+ badgeOffsetSquare: { right: -2, top: -2 },
4501
+ borderRadiusSquare: shape.avatar.xxs.borderRadius,
4502
+ borderRadiusCircle: radiusScale["999"]
4503
+ }
4504
+ };
4505
+ return configs[size];
4506
+ };
4507
+
4508
+ // src/theme/sizing/tag.ts
4509
+ var tag = (size) => {
4510
+ const configs = {
4511
+ xl: {
4512
+ height: 48,
4513
+ padding: 13,
4514
+ fontSize: 20,
4515
+ lineHeight: 22,
4516
+ gap: 6,
4517
+ iconSize: 22,
4518
+ radius: shape.tag.xl.borderRadius,
4519
+ borderWidth: 1
4520
+ },
4521
+ lg: {
4522
+ height: 40,
4523
+ padding: 10,
4524
+ fontSize: 18,
4525
+ lineHeight: 20,
4526
+ gap: 6,
4527
+ iconSize: 20,
4528
+ radius: shape.tag.lg.borderRadius,
4529
+ borderWidth: 1
4530
+ },
4531
+ md: {
4532
+ height: 32,
4533
+ padding: 7,
4534
+ fontSize: 16,
4535
+ lineHeight: 18,
4536
+ gap: 4,
4537
+ iconSize: 18,
4538
+ radius: shape.tag.md.borderRadius,
4539
+ borderWidth: 1
4540
+ },
4541
+ sm: {
4542
+ height: 24,
4543
+ padding: 4,
4544
+ fontSize: 14,
4545
+ lineHeight: 16,
4546
+ gap: 4,
4547
+ iconSize: 16,
4548
+ radius: shape.tag.sm.borderRadius,
4549
+ borderWidth: 1
4550
+ },
4551
+ xs: {
4552
+ height: 20,
4553
+ padding: 3,
4554
+ fontSize: 12,
4555
+ lineHeight: 14,
4556
+ gap: 4,
4557
+ iconSize: 14,
4558
+ radius: shape.tag.xs.borderRadius,
4559
+ borderWidth: 1
4560
+ }
4561
+ };
4562
+ return configs[size];
4563
+ };
4564
+
4565
+ // src/theme/sizing/divider.ts
4566
+ var divider = (size) => {
4567
+ const configs = {
4568
+ lg: { height: 18, fontSize: 16, lineWeight: 1 },
4569
+ md: { height: 16, fontSize: 14, lineWeight: 1 },
4570
+ sm: { height: 14, fontSize: 12, lineWeight: 1 }
4571
+ };
4572
+ return configs[size];
4573
+ };
4574
+
4575
+ // src/theme/sizing/spinner.ts
4576
+ var spinner = (size) => {
4577
+ const configs = {
4578
+ xl: { size: 96, strokeWidth: 10 },
4579
+ lg: { size: 48, strokeWidth: 5 },
4580
+ md: { size: 24, strokeWidth: 2 },
4581
+ sm: { size: 16, strokeWidth: 2 },
4582
+ xs: { size: 8, strokeWidth: 1 }
4583
+ };
4584
+ return configs[size];
4585
+ };
4586
+
4587
+ // src/theme/sizing/tabs.ts
4588
+ var tabs = (size) => {
4589
+ const configs = {
4590
+ xl: {
4591
+ height: 64,
4592
+ fontSize: 20,
4593
+ lineHeight: 22,
4594
+ iconSize: 24,
4595
+ gap: 10,
4596
+ paddingHorizontal: 20
4597
+ },
4598
+ lg: {
4599
+ height: 56,
4600
+ fontSize: 18,
4601
+ lineHeight: 20,
4602
+ iconSize: 20,
4603
+ gap: 8,
4604
+ paddingHorizontal: 20
4605
+ },
4606
+ md: {
4607
+ height: 48,
4608
+ fontSize: 16,
4609
+ lineHeight: 18,
4610
+ iconSize: 18,
4611
+ gap: 6,
4612
+ paddingHorizontal: 20
4613
+ },
4614
+ sm: {
4615
+ height: 40,
4616
+ fontSize: 14,
4617
+ lineHeight: 16,
4618
+ iconSize: 16,
4619
+ gap: 4,
4620
+ paddingHorizontal: 20
4621
+ }
4622
+ };
4623
+ return configs[size];
4624
+ };
4625
+
4626
+ // src/theme/sizing/segmented.ts
4627
+ var segmented = (size) => {
4628
+ const configs = {
4629
+ xl: {
4630
+ height: 64,
4631
+ containerPadding: 3,
4632
+ containerRadius: shape.segmented.xl.borderRadius,
4633
+ itemHeight: 56,
4634
+ itemPaddingHorizontal: 20,
4635
+ itemPaddingVertical: 10,
4636
+ itemRadius: shape.segmentedItem.xl.borderRadius,
4637
+ fontSize: 20,
4638
+ lineHeight: 22,
4639
+ iconSize: 24,
4640
+ gap: 8
4641
+ },
4642
+ lg: {
4643
+ height: 56,
4644
+ containerPadding: 3,
4645
+ containerRadius: shape.segmented.lg.borderRadius,
4646
+ itemHeight: 48,
4647
+ itemPaddingHorizontal: 20,
4648
+ itemPaddingVertical: 10,
4649
+ itemRadius: shape.segmentedItem.lg.borderRadius,
4650
+ fontSize: 18,
4651
+ lineHeight: 20,
4652
+ iconSize: 24,
4653
+ gap: 8
4654
+ },
4655
+ md: {
4656
+ height: 48,
4657
+ containerPadding: 3,
4658
+ containerRadius: shape.segmented.md.borderRadius,
4659
+ itemHeight: 40,
4660
+ itemPaddingHorizontal: 16,
4661
+ itemPaddingVertical: 8,
4662
+ itemRadius: shape.segmentedItem.md.borderRadius,
4663
+ fontSize: 16,
4664
+ lineHeight: 18,
4665
+ iconSize: 24,
4666
+ gap: 6
4667
+ },
4668
+ sm: {
4669
+ height: 40,
4670
+ containerPadding: 3,
4671
+ containerRadius: shape.segmented.sm.borderRadius,
4672
+ itemHeight: 32,
4673
+ itemPaddingHorizontal: 12,
4674
+ itemPaddingVertical: 6,
4675
+ itemRadius: shape.segmentedItem.sm.borderRadius,
4676
+ fontSize: 14,
4677
+ lineHeight: 16,
4678
+ iconSize: 20,
4679
+ gap: 4
4680
+ }
4681
+ };
4682
+ return configs[size];
4683
+ };
4684
+
4685
+ // src/theme/sizing/tabsSegmented.ts
4686
+ var tabsSegmented = (size) => {
4687
+ const configs = {
4688
+ xl: {
4689
+ height: 64,
4690
+ containerPadding: 4,
4691
+ itemPaddingHorizontal: 16,
4692
+ itemPaddingVertical: 18,
4693
+ fontSize: 20,
4694
+ lineHeight: 22,
4695
+ iconSize: 24,
4696
+ gap: 8
4697
+ },
4698
+ lg: {
4699
+ height: 56,
4700
+ containerPadding: 4,
4701
+ itemPaddingHorizontal: 16,
4702
+ itemPaddingVertical: 14,
4703
+ fontSize: 18,
4704
+ lineHeight: 20,
4705
+ iconSize: 24,
4706
+ gap: 8
4707
+ },
4708
+ md: {
4709
+ height: 48,
4710
+ containerPadding: 4,
4711
+ itemPaddingHorizontal: 12,
4712
+ itemPaddingVertical: 11,
4713
+ fontSize: 16,
4714
+ lineHeight: 18,
4715
+ iconSize: 24,
4716
+ gap: 6
4717
+ },
4718
+ sm: {
4719
+ height: 40,
4720
+ containerPadding: 3,
4721
+ itemPaddingHorizontal: 12,
4722
+ itemPaddingVertical: 8,
4723
+ fontSize: 14,
4724
+ lineHeight: 16,
4725
+ iconSize: 20,
4726
+ gap: 6
4727
+ }
4728
+ };
4729
+ return configs[size];
4730
+ };
4731
+
4732
+ // src/theme/sizing/checkboxTagGroup.ts
4733
+ var checkboxTagGroup = (size) => {
4734
+ const configs = {
4735
+ xl: {
4736
+ height: 64,
4737
+ paddingHorizontal: 16,
4738
+ paddingVertical: 21,
4739
+ fontSize: 20,
4740
+ lineHeight: 22,
4741
+ gap: 8,
4742
+ borderRadius: radiusScale["50"]
4743
+ },
4744
+ lg: {
4745
+ height: 56,
4746
+ paddingHorizontal: 16,
4747
+ paddingVertical: 18,
4748
+ fontSize: 18,
4749
+ lineHeight: 20,
4750
+ gap: 8,
4751
+ borderRadius: radiusScale["50"]
4752
+ },
4753
+ md: {
4754
+ height: 48,
4755
+ paddingHorizontal: 12,
4756
+ paddingVertical: 15,
4757
+ fontSize: 16,
4758
+ lineHeight: 18,
4759
+ gap: 8,
4760
+ borderRadius: radiusScale["25"]
4761
+ },
4762
+ sm: {
4763
+ height: 40,
4764
+ paddingHorizontal: 12,
4765
+ paddingVertical: 11,
4766
+ fontSize: 14,
4767
+ lineHeight: 16,
4768
+ gap: 4,
4769
+ borderRadius: radiusScale["25"]
4770
+ }
4771
+ };
4772
+ return configs[size];
4773
+ };
4774
+
4775
+ // src/theme/sizing/badge.ts
4776
+ var badge = (size) => {
4777
+ const configs = {
4778
+ xl: {
4779
+ size: 20,
4780
+ fontSize: 12,
4781
+ lineHeight: 14,
4782
+ iconSize: 12,
4783
+ padding: 6
4784
+ },
4785
+ lg: {
4786
+ size: 16,
4787
+ fontSize: 10,
4788
+ lineHeight: 10,
4789
+ iconSize: 10,
4790
+ padding: 4
4791
+ },
4792
+ md: {
4793
+ size: 12,
4794
+ fontSize: 10,
4795
+ lineHeight: 10,
4796
+ iconSize: 8,
4797
+ padding: 3
4798
+ },
4799
+ sm: { size: 8, fontSize: 8, lineHeight: 8, iconSize: 6, padding: 0 },
4800
+ xs: { size: 4, fontSize: 4, lineHeight: 4, iconSize: 4, padding: 0 }
4801
+ };
4802
+ return configs[size];
4803
+ };
4804
+
4805
+ // src/theme/sizing/notification.ts
4806
+ var notification = (type) => {
4807
+ const configs = {
4808
+ toast: {
4809
+ width: 400,
4810
+ paddingHorizontal: 20,
4811
+ paddingVertical: 16,
4812
+ gap: 16,
4813
+ titleSize: 18,
4814
+ messageSize: 14,
4815
+ iconSize: 20,
4816
+ iconWrapperSize: 32,
4817
+ radius: shape.toast.borderRadius
4818
+ },
4819
+ inline: {
4820
+ width: "100%",
4821
+ paddingHorizontal: 20,
4822
+ paddingVertical: 16,
4823
+ gap: 28,
4824
+ titleSize: 18,
4825
+ messageSize: 14,
4826
+ iconSize: 20,
4827
+ iconWrapperSize: 32,
4828
+ radius: shape.modal.borderRadius
4829
+ }
4830
+ };
4831
+ return configs[type];
4832
+ };
4833
+
4834
+ // src/theme/sizing/notificationPanel.ts
4835
+ var notificationPanel = (device = "desktop") => {
4836
+ const desktop = {
4837
+ minHeight: 66,
4838
+ iconFrameWidth: 54,
4839
+ iconSize: 24,
4840
+ borderRadius: radiusScale["100"],
4841
+ bodyPaddingHorizontal: 16,
4842
+ bodyPaddingVertical: 12,
4843
+ textGap: 2,
4844
+ contentGap: 24,
4845
+ buttonsGap: 8,
4846
+ closeButtonSize: 32,
4847
+ notificationCloseIconSize: 18,
4848
+ titleFontSize: 16,
4849
+ titleLineHeight: 20,
4850
+ descriptionFontSize: 14,
4851
+ descriptionLineHeight: 20,
4852
+ // Announcement variant: slim, single-line banner
4853
+ announcementPadding: 8,
4854
+ announcementGap: 16,
4855
+ announcementContentGap: 8,
4856
+ announcementIconSize: 16,
4857
+ announcementButtonsGap: 20,
4858
+ announcementCloseIconSize: 16,
4859
+ announcementBlurRadius: 4,
4860
+ // Mobile notification: icon | content column | close column
4861
+ mobileIconColumnPaddingVertical: 12,
4862
+ mobileIconColumnPaddingLeft: 8,
4863
+ mobileIconSize: 24,
4864
+ mobileBodyPaddingHorizontal: 16,
4865
+ mobileBodyPaddingVertical: 12,
4866
+ mobileBodyContentGap: 24,
4867
+ mobileNotificationActionButtonOffsetLeft: -4,
4868
+ mobileCloseColumnPaddingVertical: 12,
4869
+ mobileCloseColumnPaddingRight: 12
4870
+ };
4871
+ return desktop;
4872
+ };
4873
+
4874
+ // src/theme/sizing/progress.ts
4875
+ var progress = (size) => {
4876
+ const configs = {
4877
+ xl: { height: 10, labelSize: 16, helperSize: 14, gap: 10 },
4878
+ lg: { height: 8, labelSize: 14, helperSize: 12, gap: 8 },
4879
+ md: { height: 6, labelSize: 12, helperSize: 12, gap: 6 },
4880
+ sm: { height: 4, labelSize: 12, helperSize: 12, gap: 4 },
4881
+ xs: { height: 2, labelSize: 10, helperSize: 10, gap: 2 },
4882
+ xxs: { height: 2, labelSize: 10, helperSize: 10, gap: 2 },
4883
+ l: { height: 8, labelSize: 16, helperSize: 14, gap: 10 },
4884
+ m: { height: 6, labelSize: 14, helperSize: 12, gap: 8 },
4885
+ s: { height: 4, labelSize: 12, helperSize: 12, gap: 6 }
4886
+ };
4887
+ return configs[size];
4888
+ };
4889
+
4890
+ // src/theme/sizing/supportingText.ts
4891
+ function createSupportingText(contextFonts, contextTypography) {
4892
+ return (size) => {
4893
+ const typographyBySize = {
4894
+ xl: contextTypography.basic["body-lg"],
4895
+ lg: contextTypography.basic["body-md"],
4896
+ md: contextTypography.basic["body-sm"],
4897
+ sm: contextTypography.basic["body-xs"],
4898
+ xs: contextTypography.basic["body-xxs"]
4899
+ };
4900
+ const dimensions = {
4901
+ xl: { gap: 6, iconSize: 18 },
4902
+ lg: { gap: 6, iconSize: 18 },
4903
+ md: { gap: 6, iconSize: 18 },
4904
+ sm: { gap: 4, iconSize: 14 },
4905
+ xs: { gap: 4, iconSize: 14 }
4906
+ };
4907
+ const requiredIndicatorSizeMap = {
4908
+ xl: "lg",
4909
+ lg: "md",
4910
+ md: "sm",
4911
+ sm: "xs",
4912
+ xs: "xs"
4913
+ };
4914
+ const typography2 = typographyBySize[size];
4915
+ const requiredTypography = typographyBySize[requiredIndicatorSizeMap[size]];
4916
+ return {
4917
+ fontSize: typography2.fontSize,
4918
+ lineHeight: typography2.lineHeight,
4919
+ fontWeight: typography2.fontWeight,
4920
+ fontFamily: contextFonts.body,
4921
+ requiredIndicator: {
4922
+ fontSize: requiredTypography.fontSize,
4923
+ lineHeight: requiredTypography.lineHeight
4924
+ },
4925
+ ...dimensions[size]
4926
+ };
4927
+ };
4928
+ }
4929
+
4930
+ // src/theme/sizing/iconWrapper.ts
4931
+ var iconWrapper = (size) => {
4932
+ const configs = {
4933
+ xl: { size: 56, iconSize: 32, fontSize: 24 },
4934
+ lg: { size: 48, iconSize: 28, fontSize: 20 },
4935
+ md: { size: 40, iconSize: 24, fontSize: 18 },
4936
+ sm: { size: 32, iconSize: 20, fontSize: 16 },
4937
+ xs: { size: 24, iconSize: 16, fontSize: 14 },
4938
+ xxs: { size: 18, iconSize: 12, fontSize: 12 }
4939
+ };
4940
+ return configs[size];
4941
+ };
4942
+
4943
+ // src/theme/sizing/stepper.ts
4944
+ var stepper = (size) => {
4945
+ const configs = {
4946
+ md: {
4947
+ iconSize: 32,
4948
+ titleSize: 16,
4949
+ descSize: 14,
4950
+ gap: 12,
4951
+ currentTitleSize: 20,
4952
+ currentDescSize: 14,
4953
+ currentPadding: 24,
4954
+ tailSize: 5
4955
+ },
4956
+ sm: {
4957
+ iconSize: 24,
4958
+ titleSize: 14,
4959
+ descSize: 12,
4960
+ gap: 8,
4961
+ currentTitleSize: 16,
4962
+ currentDescSize: 12,
4963
+ currentPadding: 20,
4964
+ tailSize: 3
4965
+ }
4966
+ };
4967
+ return configs[size];
4968
+ };
4969
+
4970
+ // src/theme/sizing/contextMenu.ts
4971
+ var contextMenu = (size) => {
4972
+ const configs = {
4973
+ xl: {
4974
+ paddingVertical: 8,
4975
+ paddingHorizontal: 8,
4976
+ itemPaddingHorizontal: 16,
4977
+ itemPaddingVertical: 18,
4978
+ fontSize: 20,
4979
+ lineHeight: 26,
4980
+ descriptionFontSize: 18,
4981
+ iconSize: 18,
4982
+ gap: 12,
4983
+ minWidth: 276,
4984
+ panelWidth: 320,
4985
+ statusDotSize: 12,
4986
+ iconWrapperSize: 40,
4987
+ triggerOffset: 4,
4988
+ borderRadius: 8,
4989
+ // Search sizing from Figma
4990
+ searchPaddingHorizontal: 16,
4991
+ searchPaddingVertical: 18,
4992
+ searchGap: 18,
4993
+ searchFontSize: 20,
4994
+ searchLineHeight: 26,
4995
+ searchIconSize: 18
4996
+ },
4997
+ lg: {
4998
+ paddingVertical: 8,
4999
+ paddingHorizontal: 8,
5000
+ itemPaddingHorizontal: 14,
5001
+ itemPaddingVertical: 14,
5002
+ fontSize: 18,
5003
+ lineHeight: 24,
5004
+ descriptionFontSize: 16,
5005
+ iconSize: 18,
5006
+ gap: 10,
5007
+ minWidth: 220,
5008
+ panelWidth: 296,
5009
+ statusDotSize: 10,
5010
+ iconWrapperSize: 36,
5011
+ triggerOffset: 4,
5012
+ borderRadius: 8,
5013
+ // Search sizing from Figma
5014
+ searchPaddingHorizontal: 14,
5015
+ searchPaddingVertical: 14,
5016
+ searchGap: 14,
5017
+ searchFontSize: 18,
5018
+ searchLineHeight: 24,
5019
+ searchIconSize: 18
5020
+ },
5021
+ md: {
5022
+ paddingVertical: 8,
5023
+ paddingHorizontal: 8,
5024
+ itemPaddingHorizontal: 12,
5025
+ itemPaddingVertical: 11,
5026
+ fontSize: 16,
5027
+ lineHeight: 20,
5028
+ descriptionFontSize: 14,
5029
+ iconSize: 18,
5030
+ gap: 8,
5031
+ minWidth: 172,
5032
+ panelWidth: 272,
5033
+ statusDotSize: 8,
5034
+ iconWrapperSize: 32,
5035
+ triggerOffset: 4,
5036
+ borderRadius: 8,
5037
+ // Search sizing from Figma
5038
+ searchPaddingHorizontal: 12,
5039
+ searchPaddingVertical: 11,
5040
+ searchGap: 10,
5041
+ searchFontSize: 16,
5042
+ searchLineHeight: 20,
5043
+ searchIconSize: 18
5044
+ },
5045
+ sm: {
5046
+ paddingVertical: 8,
5047
+ paddingHorizontal: 8,
5048
+ itemPaddingHorizontal: 10,
5049
+ itemPaddingVertical: 8,
5050
+ fontSize: 14,
5051
+ lineHeight: 18,
5052
+ descriptionFontSize: 12,
5053
+ iconSize: 18,
5054
+ gap: 8,
5055
+ minWidth: 132,
5056
+ panelWidth: 248,
5057
+ statusDotSize: 6,
5058
+ iconWrapperSize: 24,
5059
+ triggerOffset: 4,
5060
+ borderRadius: 4,
5061
+ // Search sizing from Figma
5062
+ searchPaddingHorizontal: 10,
5063
+ searchPaddingVertical: 7,
5064
+ searchGap: 6,
5065
+ searchFontSize: 14,
5066
+ searchLineHeight: 18,
5067
+ searchIconSize: 18
5068
+ }
5069
+ };
5070
+ return configs[size];
5071
+ };
5072
+
5073
+ // src/theme/sizing/modal.ts
5074
+ var modal = () => {
5075
+ return {
5076
+ borderRadius: shape.modal.borderRadius,
5077
+ headerPadding: "24px 24px 0",
5078
+ contentPadding: 24,
5079
+ /** @deprecated Header buttons no longer use IconButton sizes. */
5080
+ headerButtonSize: "xs",
5081
+ /** @deprecated Header buttons are FlexButtons; size comes from `Modal`'s `closeButtonSize`. */
5082
+ headerIconSize: 28,
5083
+ /** @deprecated Header buttons are FlexButtons; padding is owned by FlexButton. */
5084
+ headerButtonPadding: 4,
5085
+ /** @deprecated Header buttons are FlexButtons; radius comes from FlexButton's size scale. */
5086
+ headerButtonRadius: 4,
5087
+ headerMinHeight: 44,
5088
+ headerGap: 16,
5089
+ footerGap: 16,
5090
+ /** @deprecated Modal elevation comes from the scrim, not a drop shadow. */
5091
+ shadow: "0px 8px 12px 6px rgba(7, 7, 8, 0.1), 0px 4px 4px rgba(7, 7, 8, 0.2)",
5092
+ maxWidth: 680,
5093
+ overlayColor: "rgba(0, 0, 0, 0.75)",
5094
+ portalPadding: 20,
5095
+ /** @deprecated Layering is contextual now; see OVERLAY_LAYER_BASE / useOverlayLayer. */
5096
+ zIndex: 1e3
5097
+ };
5098
+ };
5099
+
5100
+ // src/theme/sizing/drawer.ts
5101
+ var drawer = () => ({
5102
+ // Sizing values from Figma design: B2B Components Library node-id=8291-103845
5103
+ widthSm: 480,
5104
+ widthMd: 620,
5105
+ widthLg: 1056,
5106
+ headerHeight: 80,
5107
+ headerPaddingX: 32,
5108
+ headerPaddingY: 24,
5109
+ headerGap: 24,
5110
+ titleFontSize: 18,
5111
+ titleLineHeight: 24,
5112
+ contentPaddingX: 32,
5113
+ footerPadding: 32,
5114
+ outerPadding: 8,
5115
+ containerRadius: 4,
5116
+ contentRadius: 8,
5117
+ stepperPadding: 16,
5118
+ stepperRadius: 8,
5119
+ stepperContentGap: 8,
5120
+ scrimColor: "rgba(0, 0, 0, 0.75)",
5121
+ animationDuration: 300,
5122
+ /** @deprecated Layering is contextual now; see MODAL_LAYER_STEP / useOverlayLayer. */
5123
+ zIndex: 1e3
5124
+ });
5125
+
5126
+ // src/theme/sizing/sidebar.ts
5127
+ var sidebar = () => ({
5128
+ // Sizing values from Figma design: B2B Components Library
5129
+ widthExpanded: 280,
5130
+ widthCollapsed: 48,
5131
+ radius: 4,
5132
+ itemHeight: 32,
5133
+ iconSize: 18,
5134
+ padding: 8,
5135
+ sectionLabelHeight: 20,
5136
+ // Aligns nested item text with parent label (padding 8 + icon 18 + gap 8 = 34)
5137
+ // and centers the rail under the parent icon (padding 8 + iconSize/2 = 17).
5138
+ nestedItemPaddingLeft: 34,
5139
+ nestedItemRailLeft: 17,
5140
+ chevronSize: 14,
5141
+ externalIconSize: 18,
5142
+ chatBadgeSize: 6,
5143
+ itemBadgeSize: 4,
5144
+ focusOutlineWidth: 2,
5145
+ scrollbarWidth: 4,
5146
+ popoverGap: 12,
5147
+ popoverViewportPadding: 8,
5148
+ popoverMinWidth: 180,
5149
+ popoverMaxWidth: 240,
5150
+ popoverShadow: "0 2px 25px rgba(7, 7, 8, 0.15)",
5151
+ /** @deprecated Layering is contextual now; see useOverlayLayer / LAYER_OFFSET. */
5152
+ popoverZIndex: 1e3,
5153
+ transitionWidth: "0.25s ease-in-out",
5154
+ transitionFadeIn: "opacity 0.15s ease-in-out 0.1s",
5155
+ transitionFadeOut: "opacity 0.1s ease-in-out",
5156
+ transitionItem: "background-color 0.15s ease-in-out, color 0.15s ease-in-out",
5157
+ transitionRows: "grid-template-rows 0.25s ease-in-out"
5158
+ });
5159
+
5160
+ // src/theme/sizing/stepperB2b.ts
5161
+ var stepperB2b = () => ({
5162
+ // Sizing values from Figma design: B2B Components Library
5163
+ // variant grid node-id=10999-17988, state grid node-id=10259-5501
5164
+ chipSize: 32,
5165
+ chipRadius: 2,
5166
+ chipPaddingTop: 5,
5167
+ chipPaddingBottom: 4,
5168
+ chipPaddingX: 4,
5169
+ chipIconSize: 16,
5170
+ numberFontSize: 18,
5171
+ numberLineHeight: 24,
5172
+ titleFontSize: 16,
5173
+ titleLineHeight: 20,
5174
+ descriptionFontSize: 14,
5175
+ descriptionLineHeight: 20,
5176
+ captionFontSize: 12,
5177
+ captionLineHeight: 16,
5178
+ itemGap: 12,
5179
+ contentGap: 4,
5180
+ contentMinHeight: 32,
5181
+ contentWidth: 128,
5182
+ activeCardRadiusVertical: 4,
5183
+ activeCardRadiusHorizontal: 6,
5184
+ activeCardPaddingTop: 24,
5185
+ activeCardPaddingX: 24,
5186
+ activeCardPaddingYHorizontal: 12,
5187
+ activeCardPaddingLeftHorizontal: 12,
5188
+ activeCardGapHorizontal: 8,
5189
+ innerConnectorLength: 48,
5190
+ connectorSegment: 24,
5191
+ connectorCellHeight: 24,
5192
+ connectorCellWidth: 80,
5193
+ surfaceRadius: 8,
5194
+ surfacePaddingVertical: 16,
5195
+ surfacePaddingHorizontal: 8,
5196
+ horizontalItemGap: 16,
5197
+ horizontalFirstItemWidth: 220,
5198
+ horizontalItemWidth: 236,
5199
+ horizontalConnectorSegment: 32,
5200
+ horizontalConnectorGap: 12,
5201
+ simpleCardPadding: 12,
5202
+ simpleCardRadius: 4,
5203
+ simpleCardGap: 4,
5204
+ simpleItemGap: 4,
5205
+ simpleHorizontalCellWidth: 56,
5206
+ simpleHorizontalStubLength: 8
5207
+ });
5208
+
5209
+ // src/theme/sizing/collapsibleB2b.ts
5210
+ var collapsibleB2b = () => ({
5211
+ // Sizing values from Figma design: B2B Components Library node-id=10469-6509
5212
+ triggerPadding: 16,
5213
+ triggerGap: 12,
5214
+ triggerMinHeight: 56,
5215
+ surfaceRadius: radiusScale["50"],
5216
+ // Must match surfaceRadius: the root clips with `overflow: hidden`, so a
5217
+ // larger cell radius makes the trigger cell's corners show through the
5218
+ // smaller root arc (XUITSD-55).
5219
+ cellRadius: radiusScale["50"],
5220
+ iconSlotSize: 32,
5221
+ iconSlotRadius: radiusScale["50"],
5222
+ chevronSize: 24,
5223
+ trailingGap: 8,
5224
+ textGap: 2,
5225
+ titleFontSize: 16,
5226
+ titleLineHeight: 20,
5227
+ captionFontSize: 12,
5228
+ captionLineHeight: 18,
5229
+ panelPadding: 16,
5230
+ accordionItemGap: 8
5231
+ });
5232
+
5233
+ // src/theme/sizing/toast.ts
5234
+ var toast = () => {
5235
+ return {
5236
+ minHeight: 64,
5237
+ paddingHorizontal: 12,
5238
+ paddingVertical: 8,
5239
+ borderRadius: shape.toast.borderRadius,
5240
+ gap: 12,
5241
+ iconSize: 24,
5242
+ closeButtonSize: 24,
5243
+ closeIconSize: 20,
5244
+ fontSize: 16,
5245
+ lineHeight: 20,
5246
+ maxWidth: 400,
5247
+ containerPadding: 12,
5248
+ groupGap: 4
5249
+ };
5250
+ };
5251
+
5252
+ // src/theme/sizing/toggleButtonGroup.ts
5253
+ var toggleButtonGroup = (size) => {
5254
+ const configs = {
5255
+ xl: {
5256
+ height: 64,
5257
+ paddingHorizontal: 21,
5258
+ fontSize: 20,
5259
+ lineHeight: 22,
5260
+ iconSize: 22,
5261
+ gap: 6,
5262
+ borderRadius: shape.toggleButtonGroup.xl.borderRadius,
5263
+ itemGap: 8,
5264
+ tooltipSize: "lg"
5265
+ },
5266
+ lg: {
5267
+ height: 56,
5268
+ paddingHorizontal: 18,
5269
+ fontSize: 18,
5270
+ lineHeight: 20,
5271
+ iconSize: 20,
5272
+ gap: 4,
5273
+ borderRadius: shape.toggleButtonGroup.lg.borderRadius,
5274
+ itemGap: 8,
5275
+ tooltipSize: "md"
5276
+ },
5277
+ md: {
5278
+ height: 48,
5279
+ paddingHorizontal: 15,
5280
+ fontSize: 16,
5281
+ lineHeight: 18,
5282
+ iconSize: 18,
5283
+ gap: 4,
5284
+ borderRadius: shape.toggleButtonGroup.md.borderRadius,
5285
+ itemGap: 6,
5286
+ tooltipSize: "md"
5287
+ },
5288
+ sm: {
5289
+ height: 40,
5290
+ paddingHorizontal: 12,
5291
+ fontSize: 14,
5292
+ lineHeight: 16,
5293
+ iconSize: 16,
5294
+ gap: 4,
5295
+ borderRadius: shape.toggleButtonGroup.sm.borderRadius,
5296
+ itemGap: 4,
5297
+ tooltipSize: "sm"
5298
+ },
5299
+ xs: {
5300
+ height: 32,
5301
+ paddingHorizontal: 9,
5302
+ fontSize: 12,
5303
+ lineHeight: 14,
5304
+ iconSize: 14,
5305
+ gap: 4,
5306
+ borderRadius: shape.toggleButtonGroup.xs.borderRadius,
5307
+ itemGap: 4,
5308
+ tooltipSize: "sm"
5309
+ }
5310
+ };
5311
+ return configs[size];
5312
+ };
5313
+
5314
+ // src/theme/sizing/table.ts
5315
+ var table = {
5316
+ containerRadius: 8,
5317
+ containerPaddingVertical: 0,
5318
+ containerGap: 0,
5319
+ captionFontSize: 14,
5320
+ captionLineHeight: 20,
5321
+ headerRowHeight: 56,
5322
+ headerRowPaddingHorizontal: 24,
5323
+ headerCellGap: 4,
5324
+ headerCellFontSize: 14,
5325
+ headerCellLineHeight: 18,
5326
+ rowHeight: 56,
5327
+ rowPaddingHorizontal: 24,
5328
+ cellGap: 16,
5329
+ cellFontSize: 14,
5330
+ cellLineHeight: 18,
5331
+ paginationGap: 16,
5332
+ paginationPaddingHorizontal: 24
5333
+ };
5334
+
5335
+ // src/theme/sizing/index.ts
5336
+ function createSizing(contextFonts, contextTypography) {
5337
+ return {
5338
+ button,
5339
+ flexButton,
5340
+ checkbox,
5341
+ radio,
5342
+ input,
5343
+ imageUploader,
5344
+ dragDropUploader,
5345
+ inputPin,
5346
+ textarea,
5347
+ switch: switchSizing,
5348
+ avatar,
5349
+ tag,
5350
+ divider,
5351
+ spinner,
5352
+ tabs,
5353
+ segmented,
5354
+ tabsSegmented,
5355
+ checkboxTagGroup,
5356
+ badge,
5357
+ notification,
5358
+ notificationPanel,
5359
+ progress,
5360
+ supportingText: createSupportingText(contextFonts, contextTypography),
5361
+ iconWrapper,
5362
+ stepper,
5363
+ contextMenu,
5364
+ modal,
5365
+ drawer,
5366
+ sidebar,
5367
+ stepperB2b,
5368
+ collapsibleB2b,
5369
+ toast,
5370
+ toggleButtonGroup,
5371
+ table
5372
+ };
5373
+ }
5374
+
5375
+ // src/theme/themeConfig.ts
5376
+ var DEPRECATED_MODES = /* @__PURE__ */ new Set([
5377
+ "xsolla-dark",
5378
+ "xsolla-light",
5379
+ "xsollaDark",
5380
+ "xsollaLight"
5381
+ ]);
5382
+ var themeConfig = (mode = "dark", productContext = defaultProductContext) => {
5383
+ if (DEPRECATED_MODES.has(mode)) {
5384
+ console.warn(
5385
+ `Theme mode "${mode}" is deprecated and will be removed in the next major update. Please migrate to "dark" or "light".`
5386
+ );
5387
+ }
5388
+ const contextFonts = getFonts(productContext);
5389
+ const contextTypography = getTypographyTokens(productContext);
5390
+ return {
5391
+ colors: colors[mode],
5392
+ spacing,
5393
+ shape,
5394
+ shadow,
5395
+ fonts: contextFonts,
5396
+ typography: {
5397
+ primary: contextFonts.body,
5398
+ heading: contextFonts.heading,
5399
+ body: contextFonts.body
5400
+ },
5401
+ typographyTokens: contextTypography,
5402
+ productContext,
5403
+ sizing: createSizing(contextFonts, contextTypography)
5404
+ };
5405
+ };
5406
+
5407
+ // src/provider.tsx
5408
+ import React3, { createContext, useContext, useMemo, useState } from "react";
5409
+
3308
5410
  // src/fonts/FontLoader.tsx
3309
5411
  import { useEffect, useRef } from "react";
3310
5412
 
@@ -3587,1486 +5689,8 @@ var TypographyStyleLoader = () => {
3587
5689
  };
3588
5690
  TypographyStyleLoader.displayName = "TypographyStyleLoader";
3589
5691
 
3590
- // src/index.tsx
5692
+ // src/provider.tsx
3591
5693
  import { jsx, jsxs } from "react/jsx-runtime";
3592
- var DEPRECATED_MODES = /* @__PURE__ */ new Set([
3593
- "xsolla-dark",
3594
- "xsolla-light",
3595
- "xsollaDark",
3596
- "xsollaLight"
3597
- ]);
3598
- var themeConfig = (mode = "dark", productContext = defaultProductContext) => {
3599
- if (DEPRECATED_MODES.has(mode)) {
3600
- console.warn(
3601
- `Theme mode "${mode}" is deprecated and will be removed in the next major update. Please migrate to "dark" or "light".`
3602
- );
3603
- }
3604
- const contextFonts = getFonts(productContext);
3605
- const contextTypography = getTypographyTokens(productContext);
3606
- return {
3607
- colors: colors[mode],
3608
- spacing,
3609
- shape,
3610
- shadow,
3611
- fonts: contextFonts,
3612
- typography: {
3613
- primary: contextFonts.body,
3614
- heading: contextFonts.heading,
3615
- body: contextFonts.body
3616
- },
3617
- typographyTokens: contextTypography,
3618
- productContext,
3619
- sizing: {
3620
- button: (size) => {
3621
- const configs = {
3622
- xl: {
3623
- height: 64,
3624
- padding: 20,
3625
- fontSize: 20,
3626
- lineHeight: 22,
3627
- sublabelFontSize: 18,
3628
- spinnerSize: 24,
3629
- iconSize: 32,
3630
- iconContainerSize: 64,
3631
- borderRadius: shape.button.xl.borderRadius,
3632
- labelIconSize: 22,
3633
- labelIconGap: 6
3634
- },
3635
- lg: {
3636
- height: 56,
3637
- padding: 18,
3638
- fontSize: 18,
3639
- lineHeight: 20,
3640
- sublabelFontSize: 16,
3641
- spinnerSize: 24,
3642
- iconSize: 28,
3643
- iconContainerSize: 56,
3644
- borderRadius: shape.button.lg.borderRadius,
3645
- labelIconSize: 20,
3646
- labelIconGap: 4
3647
- },
3648
- md: {
3649
- height: 48,
3650
- padding: 16,
3651
- fontSize: 16,
3652
- lineHeight: 18,
3653
- sublabelFontSize: 14,
3654
- spinnerSize: 24,
3655
- iconSize: 24,
3656
- iconContainerSize: 48,
3657
- borderRadius: shape.button.md.borderRadius,
3658
- labelIconSize: 18,
3659
- labelIconGap: 4
3660
- },
3661
- sm: {
3662
- height: 40,
3663
- padding: 14,
3664
- fontSize: 14,
3665
- lineHeight: 16,
3666
- sublabelFontSize: 12,
3667
- spinnerSize: 24,
3668
- iconSize: 20,
3669
- iconContainerSize: 40,
3670
- borderRadius: shape.button.sm.borderRadius,
3671
- labelIconSize: 16,
3672
- labelIconGap: 4
3673
- },
3674
- xs: {
3675
- height: 32,
3676
- padding: 12,
3677
- fontSize: 12,
3678
- lineHeight: 14,
3679
- sublabelFontSize: 10,
3680
- spinnerSize: 16,
3681
- iconSize: 16,
3682
- iconContainerSize: 32,
3683
- borderRadius: shape.button.xs.borderRadius,
3684
- labelIconSize: 14,
3685
- labelIconGap: 4
3686
- }
3687
- };
3688
- return configs[size];
3689
- },
3690
- flexButton: (size) => {
3691
- const configs = {
3692
- xl: {
3693
- height: 36,
3694
- padding: 4,
3695
- fontSize: 16,
3696
- spinnerSize: 28,
3697
- iconSize: 20,
3698
- borderRadius: radiusScale["50"]
3699
- },
3700
- lg: {
3701
- height: 32,
3702
- padding: 4,
3703
- fontSize: 14,
3704
- spinnerSize: 24,
3705
- iconSize: 18,
3706
- borderRadius: radiusScale["50"]
3707
- },
3708
- md: {
3709
- height: 28,
3710
- padding: 2,
3711
- fontSize: 14,
3712
- spinnerSize: 24,
3713
- iconSize: 16,
3714
- borderRadius: radiusScale["25"]
3715
- },
3716
- sm: {
3717
- height: 22,
3718
- padding: 2,
3719
- fontSize: 12,
3720
- spinnerSize: 16,
3721
- iconSize: 14,
3722
- borderRadius: radiusScale["25"]
3723
- },
3724
- xs: {
3725
- height: 20,
3726
- padding: 2,
3727
- fontSize: 12,
3728
- spinnerSize: 16,
3729
- iconSize: 12,
3730
- borderRadius: radiusScale["25"]
3731
- }
3732
- };
3733
- return configs[size];
3734
- },
3735
- checkbox: (size) => {
3736
- const configs = {
3737
- xl: {
3738
- size: 22,
3739
- fontSize: 18,
3740
- descriptionFontSize: 16,
3741
- labelGap: 12,
3742
- textGap: 4,
3743
- borderRadius: shape.checkbox.xl.borderRadius
3744
- },
3745
- lg: {
3746
- size: 20,
3747
- fontSize: 16,
3748
- descriptionFontSize: 14,
3749
- labelGap: 10,
3750
- textGap: 2,
3751
- borderRadius: shape.checkbox.lg.borderRadius
3752
- },
3753
- md: {
3754
- size: 18,
3755
- fontSize: 16,
3756
- descriptionFontSize: 14,
3757
- labelGap: 8,
3758
- textGap: 2,
3759
- borderRadius: shape.checkbox.md.borderRadius
3760
- },
3761
- sm: {
3762
- size: 16,
3763
- fontSize: 14,
3764
- descriptionFontSize: 12,
3765
- labelGap: 8,
3766
- textGap: 0,
3767
- borderRadius: shape.checkbox.sm.borderRadius
3768
- }
3769
- };
3770
- return configs[size];
3771
- },
3772
- radio: (size) => {
3773
- const configs = {
3774
- xl: {
3775
- size: 24,
3776
- iconSize: 10,
3777
- fontSize: 20,
3778
- lineHeight: 22,
3779
- descriptionFontSize: 18,
3780
- descriptionLineHeight: 20,
3781
- labelGap: 12,
3782
- textGap: 4,
3783
- borderWidth: 1
3784
- },
3785
- lg: {
3786
- size: 20,
3787
- iconSize: 8,
3788
- fontSize: 18,
3789
- lineHeight: 20,
3790
- descriptionFontSize: 16,
3791
- descriptionLineHeight: 18,
3792
- labelGap: 10,
3793
- textGap: 2,
3794
- borderWidth: 1
3795
- },
3796
- md: {
3797
- size: 18,
3798
- iconSize: 8,
3799
- fontSize: 16,
3800
- lineHeight: 18,
3801
- descriptionFontSize: 14,
3802
- descriptionLineHeight: 16,
3803
- labelGap: 8,
3804
- textGap: 2,
3805
- borderWidth: 1
3806
- },
3807
- sm: {
3808
- size: 16,
3809
- iconSize: 6,
3810
- fontSize: 14,
3811
- lineHeight: 16,
3812
- descriptionFontSize: 12,
3813
- descriptionLineHeight: 14,
3814
- labelGap: 6,
3815
- textGap: 0,
3816
- borderWidth: 1
3817
- }
3818
- };
3819
- return configs[size];
3820
- },
3821
- input: (size) => {
3822
- const configs = {
3823
- xl: {
3824
- height: 64,
3825
- paddingVertical: 12,
3826
- paddingHorizontal: 12,
3827
- fontSize: 20,
3828
- iconSize: 22,
3829
- radius: shape.input.xl.borderRadius,
3830
- borderWidth: 2,
3831
- fieldGap: 8,
3832
- lineHeight: 20,
3833
- contentGap: 10,
3834
- trailingGap: 10
3835
- },
3836
- lg: {
3837
- height: 56,
3838
- paddingVertical: 14,
3839
- paddingHorizontal: 12,
3840
- fontSize: 18,
3841
- iconSize: 20,
3842
- radius: shape.input.lg.borderRadius,
3843
- borderWidth: 2,
3844
- fieldGap: 6,
3845
- lineHeight: 18,
3846
- contentGap: 8,
3847
- trailingGap: 10
3848
- },
3849
- md: {
3850
- height: 48,
3851
- paddingVertical: 11,
3852
- paddingHorizontal: 12,
3853
- fontSize: 16,
3854
- iconSize: 18,
3855
- radius: shape.input.md.borderRadius,
3856
- borderWidth: 1,
3857
- fieldGap: 4,
3858
- lineHeight: 16,
3859
- contentGap: 6,
3860
- trailingGap: 8
3861
- },
3862
- sm: {
3863
- height: 40,
3864
- paddingVertical: 7,
3865
- paddingHorizontal: 10,
3866
- fontSize: 14,
3867
- iconSize: 16,
3868
- radius: shape.input.sm.borderRadius,
3869
- borderWidth: 1,
3870
- fieldGap: 4,
3871
- lineHeight: 14,
3872
- contentGap: 4,
3873
- trailingGap: 8
3874
- },
3875
- xs: {
3876
- height: 32,
3877
- paddingVertical: 7,
3878
- paddingHorizontal: 10,
3879
- fontSize: 12,
3880
- iconSize: 14,
3881
- radius: shape.input.xs.borderRadius,
3882
- borderWidth: 1,
3883
- fieldGap: 4,
3884
- lineHeight: 10,
3885
- contentGap: 4,
3886
- trailingGap: 4
3887
- }
3888
- };
3889
- return configs[size];
3890
- },
3891
- imageUploader: (size) => {
3892
- const configs = {
3893
- xl: {
3894
- box: 200,
3895
- padding: 14,
3896
- gap: 10,
3897
- iconSize: 32,
3898
- spinnerSize: "lg",
3899
- labelFontSize: 20,
3900
- labelLineHeight: 22,
3901
- descriptionFontSize: 20,
3902
- descriptionLineHeight: 22,
3903
- errorFontSize: 16,
3904
- errorLineHeight: 18,
3905
- errorGap: 8,
3906
- radius: shape.input.xl.borderRadius,
3907
- borderWidth: 1
3908
- },
3909
- lg: {
3910
- box: 168,
3911
- padding: 14,
3912
- gap: 10,
3913
- iconSize: 24,
3914
- spinnerSize: "lg",
3915
- labelFontSize: 18,
3916
- labelLineHeight: 24,
3917
- descriptionFontSize: 18,
3918
- descriptionLineHeight: 20,
3919
- errorFontSize: 16,
3920
- errorLineHeight: 18,
3921
- errorGap: 8,
3922
- radius: shape.input.lg.borderRadius,
3923
- borderWidth: 1
3924
- },
3925
- md: {
3926
- box: 136,
3927
- padding: 12,
3928
- gap: 8,
3929
- iconSize: 24,
3930
- spinnerSize: "md",
3931
- labelFontSize: 16,
3932
- labelLineHeight: 20,
3933
- descriptionFontSize: 16,
3934
- descriptionLineHeight: 20,
3935
- errorFontSize: 14,
3936
- errorLineHeight: 16,
3937
- errorGap: 6,
3938
- radius: shape.input.md.borderRadius,
3939
- borderWidth: 1
3940
- },
3941
- sm: {
3942
- box: 104,
3943
- padding: 10,
3944
- gap: 6,
3945
- iconSize: 18,
3946
- spinnerSize: "sm",
3947
- labelFontSize: 14,
3948
- labelLineHeight: 18,
3949
- descriptionFontSize: 14,
3950
- descriptionLineHeight: 18,
3951
- errorFontSize: 12,
3952
- errorLineHeight: 14,
3953
- errorGap: 6,
3954
- radius: shape.input.sm.borderRadius,
3955
- borderWidth: 1
3956
- },
3957
- xs: {
3958
- box: 72,
3959
- padding: 8,
3960
- gap: 4,
3961
- iconSize: 18,
3962
- spinnerSize: "sm",
3963
- labelFontSize: 12,
3964
- labelLineHeight: 16,
3965
- descriptionFontSize: 12,
3966
- descriptionLineHeight: 16,
3967
- errorFontSize: 11,
3968
- errorLineHeight: 13,
3969
- errorGap: 4,
3970
- radius: shape.input.xs.borderRadius,
3971
- borderWidth: 1
3972
- }
3973
- };
3974
- return configs[size];
3975
- },
3976
- dragDropUploader: (size) => {
3977
- const base = {
3978
- width: 360,
3979
- rootGap: 12,
3980
- radius: 4,
3981
- borderWidth: 1,
3982
- textGap: 6,
3983
- titleFontSize: 14,
3984
- titleLineHeight: 18,
3985
- descriptionFontSize: 14,
3986
- descriptionLineHeight: 18,
3987
- errorFontSize: 12,
3988
- errorLineHeight: 16,
3989
- listGap: 6,
3990
- itemGap: 8,
3991
- itemPaddingVertical: 8,
3992
- itemPaddingLeft: 8,
3993
- itemPaddingRight: 12,
3994
- itemIconWrapperSize: 32,
3995
- itemIconSize: 20,
3996
- itemTitleFontSize: 14,
3997
- itemTitleLineHeight: 16,
3998
- itemDescriptionFontSize: 14,
3999
- itemDescriptionLineHeight: 18,
4000
- removeIconSize: 18
4001
- };
4002
- const configs = {
4003
- xl: {
4004
- ...base,
4005
- areaHeight: 240,
4006
- areaPadding: 20,
4007
- areaGap: 16,
4008
- iconSize: 32
4009
- },
4010
- lg: {
4011
- ...base,
4012
- areaHeight: 200,
4013
- areaPadding: 20,
4014
- areaGap: 16,
4015
- iconSize: 24
4016
- },
4017
- md: {
4018
- ...base,
4019
- areaHeight: 160,
4020
- areaPadding: 20,
4021
- areaGap: 16,
4022
- iconSize: 24
4023
- },
4024
- sm: {
4025
- ...base,
4026
- areaHeight: 128,
4027
- areaPadding: 20,
4028
- areaGap: 16,
4029
- iconSize: 24
4030
- },
4031
- xs: {
4032
- ...base,
4033
- width: 320,
4034
- rootGap: 8,
4035
- areaHeight: 104,
4036
- areaPadding: 16,
4037
- areaGap: 8,
4038
- textGap: 4,
4039
- iconSize: 16,
4040
- titleFontSize: 12,
4041
- titleLineHeight: 16,
4042
- descriptionFontSize: 12,
4043
- descriptionLineHeight: 16,
4044
- listGap: 4,
4045
- itemGap: 4,
4046
- itemPaddingVertical: 4,
4047
- itemPaddingLeft: 4,
4048
- itemIconWrapperSize: 24,
4049
- itemIconSize: 16,
4050
- itemTitleFontSize: 12,
4051
- itemTitleLineHeight: 14,
4052
- itemDescriptionFontSize: 12,
4053
- itemDescriptionLineHeight: 16,
4054
- removeIconSize: 14
4055
- }
4056
- };
4057
- return configs[size];
4058
- },
4059
- inputPin: (size) => {
4060
- const configs = {
4061
- xl: {
4062
- size: 64,
4063
- gap: 10,
4064
- fontSize: 20,
4065
- radius: shape.input.xl.borderRadius,
4066
- borderWidth: 1,
4067
- fieldGap: 8
4068
- },
4069
- lg: {
4070
- size: 56,
4071
- gap: 8,
4072
- fontSize: 18,
4073
- radius: shape.input.lg.borderRadius,
4074
- borderWidth: 1,
4075
- fieldGap: 6
4076
- },
4077
- md: {
4078
- size: 48,
4079
- gap: 6,
4080
- fontSize: 16,
4081
- radius: shape.input.md.borderRadius,
4082
- borderWidth: 1,
4083
- fieldGap: 4
4084
- },
4085
- sm: {
4086
- size: 40,
4087
- gap: 4,
4088
- fontSize: 14,
4089
- radius: shape.input.sm.borderRadius,
4090
- borderWidth: 1,
4091
- fieldGap: 4
4092
- },
4093
- xs: {
4094
- size: 32,
4095
- gap: 4,
4096
- fontSize: 12,
4097
- radius: shape.input.xs.borderRadius,
4098
- borderWidth: 1,
4099
- fieldGap: 4
4100
- }
4101
- };
4102
- return configs[size];
4103
- },
4104
- textarea: (size) => {
4105
- const configs = {
4106
- xl: {
4107
- height: 144,
4108
- padding: spacing.xl,
4109
- fontSize: 20,
4110
- iconSize: 32,
4111
- radius: shape.input.xl.borderRadius
4112
- },
4113
- lg: {
4114
- height: 128,
4115
- padding: spacing.lg,
4116
- fontSize: 18,
4117
- iconSize: 28,
4118
- radius: shape.input.lg.borderRadius
4119
- },
4120
- md: {
4121
- height: 112,
4122
- padding: spacing.md,
4123
- fontSize: 16,
4124
- iconSize: 24,
4125
- radius: shape.input.md.borderRadius
4126
- },
4127
- sm: {
4128
- height: 96,
4129
- padding: spacing.sm,
4130
- fontSize: 14,
4131
- iconSize: 20,
4132
- radius: shape.input.sm.borderRadius
4133
- },
4134
- xs: {
4135
- height: 80,
4136
- padding: spacing.xs,
4137
- fontSize: 12,
4138
- iconSize: 16,
4139
- radius: shape.input.xs.borderRadius
4140
- }
4141
- };
4142
- return configs[size];
4143
- },
4144
- switch: (size) => {
4145
- const configs = {
4146
- xl: {
4147
- width: 40,
4148
- height: 22,
4149
- knobSize: 18,
4150
- fontSize: 20,
4151
- lineHeight: 22,
4152
- descriptionFontSize: 18,
4153
- descriptionLineHeight: 20,
4154
- labelGap: 12,
4155
- textGap: 4,
4156
- frameBorderRadius: shape.switch.xl.borderRadius,
4157
- knobBorderRadius: shape.knob.xl.borderRadius
4158
- },
4159
- lg: {
4160
- width: 36,
4161
- height: 20,
4162
- knobSize: 16,
4163
- fontSize: 18,
4164
- lineHeight: 20,
4165
- descriptionFontSize: 16,
4166
- descriptionLineHeight: 18,
4167
- labelGap: 10,
4168
- textGap: 2,
4169
- frameBorderRadius: shape.switch.lg.borderRadius,
4170
- knobBorderRadius: shape.knob.lg.borderRadius
4171
- },
4172
- md: {
4173
- width: 32,
4174
- height: 18,
4175
- knobSize: 14,
4176
- fontSize: 16,
4177
- lineHeight: 18,
4178
- descriptionFontSize: 14,
4179
- descriptionLineHeight: 16,
4180
- labelGap: 8,
4181
- textGap: 2,
4182
- frameBorderRadius: shape.switch.md.borderRadius,
4183
- knobBorderRadius: shape.knob.md.borderRadius
4184
- },
4185
- sm: {
4186
- width: 28,
4187
- height: 16,
4188
- knobSize: 12,
4189
- fontSize: 14,
4190
- lineHeight: 16,
4191
- descriptionFontSize: 12,
4192
- descriptionLineHeight: 14,
4193
- labelGap: 8,
4194
- textGap: 0,
4195
- frameBorderRadius: shape.switch.sm.borderRadius,
4196
- knobBorderRadius: shape.knob.sm.borderRadius
4197
- }
4198
- };
4199
- return configs[size];
4200
- },
4201
- avatar: (size) => {
4202
- const configs = {
4203
- xl: {
4204
- size: 64,
4205
- fontSize: 20,
4206
- iconSize: 32,
4207
- badgeSize: 20,
4208
- badgeOffsetCircle: { right: -4, top: -4 },
4209
- badgeOffsetSquare: { right: -8, top: -8 },
4210
- borderRadiusSquare: shape.avatar.xl.borderRadius,
4211
- borderRadiusCircle: radiusScale["999"]
4212
- },
4213
- lg: {
4214
- size: 56,
4215
- fontSize: 20,
4216
- iconSize: 28,
4217
- badgeSize: 20,
4218
- badgeOffsetCircle: { right: -4, top: -4 },
4219
- badgeOffsetSquare: { right: -8, top: -8 },
4220
- borderRadiusSquare: shape.avatar.lg.borderRadius,
4221
- borderRadiusCircle: radiusScale["999"]
4222
- },
4223
- md: {
4224
- size: 48,
4225
- fontSize: 18,
4226
- iconSize: 24,
4227
- badgeSize: 20,
4228
- badgeOffsetCircle: { right: -5, top: -5 },
4229
- badgeOffsetSquare: { right: -8, top: -8 },
4230
- borderRadiusSquare: shape.avatar.md.borderRadius,
4231
- borderRadiusCircle: radiusScale["999"]
4232
- },
4233
- sm: {
4234
- size: 40,
4235
- fontSize: 16,
4236
- iconSize: 20,
4237
- badgeSize: 20,
4238
- badgeOffsetCircle: { right: -6, top: -6 },
4239
- badgeOffsetSquare: { right: -8, top: -8 },
4240
- borderRadiusSquare: shape.avatar.sm.borderRadius,
4241
- borderRadiusCircle: radiusScale["999"]
4242
- },
4243
- xs: {
4244
- size: 32,
4245
- fontSize: 12,
4246
- iconSize: 16,
4247
- badgeSize: 8,
4248
- badgeOffsetCircle: { right: -1, top: -1 },
4249
- badgeOffsetSquare: { right: -3, top: -3 },
4250
- borderRadiusSquare: shape.avatar.xs.borderRadius,
4251
- borderRadiusCircle: radiusScale["999"]
4252
- },
4253
- xxs: {
4254
- size: 24,
4255
- fontSize: 10,
4256
- iconSize: 12,
4257
- badgeSize: 6,
4258
- badgeOffsetCircle: { right: -1, top: -1 },
4259
- badgeOffsetSquare: { right: -2, top: -2 },
4260
- borderRadiusSquare: shape.avatar.xxs.borderRadius,
4261
- borderRadiusCircle: radiusScale["999"]
4262
- }
4263
- };
4264
- return configs[size];
4265
- },
4266
- tag: (size) => {
4267
- const configs = {
4268
- xl: {
4269
- height: 48,
4270
- padding: 13,
4271
- fontSize: 20,
4272
- lineHeight: 22,
4273
- gap: 6,
4274
- iconSize: 22,
4275
- radius: shape.tag.xl.borderRadius,
4276
- borderWidth: 1
4277
- },
4278
- lg: {
4279
- height: 40,
4280
- padding: 10,
4281
- fontSize: 18,
4282
- lineHeight: 20,
4283
- gap: 6,
4284
- iconSize: 20,
4285
- radius: shape.tag.lg.borderRadius,
4286
- borderWidth: 1
4287
- },
4288
- md: {
4289
- height: 32,
4290
- padding: 7,
4291
- fontSize: 16,
4292
- lineHeight: 18,
4293
- gap: 4,
4294
- iconSize: 18,
4295
- radius: shape.tag.md.borderRadius,
4296
- borderWidth: 1
4297
- },
4298
- sm: {
4299
- height: 24,
4300
- padding: 4,
4301
- fontSize: 14,
4302
- lineHeight: 16,
4303
- gap: 4,
4304
- iconSize: 16,
4305
- radius: shape.tag.sm.borderRadius,
4306
- borderWidth: 1
4307
- },
4308
- xs: {
4309
- height: 20,
4310
- padding: 3,
4311
- fontSize: 12,
4312
- lineHeight: 14,
4313
- gap: 4,
4314
- iconSize: 14,
4315
- radius: shape.tag.xs.borderRadius,
4316
- borderWidth: 1
4317
- }
4318
- };
4319
- return configs[size];
4320
- },
4321
- divider: (size) => {
4322
- const configs = {
4323
- lg: { height: 18, fontSize: 16, lineWeight: 1 },
4324
- md: { height: 16, fontSize: 14, lineWeight: 1 },
4325
- sm: { height: 14, fontSize: 12, lineWeight: 1 }
4326
- };
4327
- return configs[size];
4328
- },
4329
- spinner: (size) => {
4330
- const configs = {
4331
- xl: { size: 96, strokeWidth: 10 },
4332
- lg: { size: 48, strokeWidth: 5 },
4333
- md: { size: 24, strokeWidth: 2 },
4334
- sm: { size: 16, strokeWidth: 2 },
4335
- xs: { size: 8, strokeWidth: 1 }
4336
- };
4337
- return configs[size];
4338
- },
4339
- tabs: (size) => {
4340
- const configs = {
4341
- xl: {
4342
- height: 64,
4343
- fontSize: 20,
4344
- lineHeight: 22,
4345
- iconSize: 24,
4346
- gap: 10,
4347
- paddingHorizontal: 20
4348
- },
4349
- lg: {
4350
- height: 56,
4351
- fontSize: 18,
4352
- lineHeight: 20,
4353
- iconSize: 20,
4354
- gap: 8,
4355
- paddingHorizontal: 20
4356
- },
4357
- md: {
4358
- height: 48,
4359
- fontSize: 16,
4360
- lineHeight: 18,
4361
- iconSize: 18,
4362
- gap: 6,
4363
- paddingHorizontal: 20
4364
- },
4365
- sm: {
4366
- height: 40,
4367
- fontSize: 14,
4368
- lineHeight: 16,
4369
- iconSize: 16,
4370
- gap: 4,
4371
- paddingHorizontal: 20
4372
- }
4373
- };
4374
- return configs[size];
4375
- },
4376
- segmented: (size) => {
4377
- const configs = {
4378
- xl: {
4379
- height: 64,
4380
- containerPadding: 3,
4381
- containerRadius: shape.segmented.xl.borderRadius,
4382
- itemHeight: 56,
4383
- itemPaddingHorizontal: 20,
4384
- itemPaddingVertical: 10,
4385
- itemRadius: shape.segmentedItem.xl.borderRadius,
4386
- fontSize: 20,
4387
- lineHeight: 22,
4388
- iconSize: 24,
4389
- gap: 8
4390
- },
4391
- lg: {
4392
- height: 56,
4393
- containerPadding: 3,
4394
- containerRadius: shape.segmented.lg.borderRadius,
4395
- itemHeight: 48,
4396
- itemPaddingHorizontal: 20,
4397
- itemPaddingVertical: 10,
4398
- itemRadius: shape.segmentedItem.lg.borderRadius,
4399
- fontSize: 18,
4400
- lineHeight: 20,
4401
- iconSize: 24,
4402
- gap: 8
4403
- },
4404
- md: {
4405
- height: 48,
4406
- containerPadding: 3,
4407
- containerRadius: shape.segmented.md.borderRadius,
4408
- itemHeight: 40,
4409
- itemPaddingHorizontal: 16,
4410
- itemPaddingVertical: 8,
4411
- itemRadius: shape.segmentedItem.md.borderRadius,
4412
- fontSize: 16,
4413
- lineHeight: 18,
4414
- iconSize: 24,
4415
- gap: 6
4416
- },
4417
- sm: {
4418
- height: 40,
4419
- containerPadding: 3,
4420
- containerRadius: shape.segmented.sm.borderRadius,
4421
- itemHeight: 32,
4422
- itemPaddingHorizontal: 12,
4423
- itemPaddingVertical: 6,
4424
- itemRadius: shape.segmentedItem.sm.borderRadius,
4425
- fontSize: 14,
4426
- lineHeight: 16,
4427
- iconSize: 20,
4428
- gap: 4
4429
- }
4430
- };
4431
- return configs[size];
4432
- },
4433
- tabsSegmented: (size) => {
4434
- const configs = {
4435
- xl: {
4436
- height: 64,
4437
- containerPadding: 4,
4438
- itemPaddingHorizontal: 16,
4439
- itemPaddingVertical: 18,
4440
- fontSize: 20,
4441
- lineHeight: 22,
4442
- iconSize: 24,
4443
- gap: 8
4444
- },
4445
- lg: {
4446
- height: 56,
4447
- containerPadding: 4,
4448
- itemPaddingHorizontal: 16,
4449
- itemPaddingVertical: 14,
4450
- fontSize: 18,
4451
- lineHeight: 20,
4452
- iconSize: 24,
4453
- gap: 8
4454
- },
4455
- md: {
4456
- height: 48,
4457
- containerPadding: 4,
4458
- itemPaddingHorizontal: 12,
4459
- itemPaddingVertical: 11,
4460
- fontSize: 16,
4461
- lineHeight: 18,
4462
- iconSize: 24,
4463
- gap: 6
4464
- },
4465
- sm: {
4466
- height: 40,
4467
- containerPadding: 3,
4468
- itemPaddingHorizontal: 12,
4469
- itemPaddingVertical: 8,
4470
- fontSize: 14,
4471
- lineHeight: 16,
4472
- iconSize: 20,
4473
- gap: 6
4474
- }
4475
- };
4476
- return configs[size];
4477
- },
4478
- checkboxTagGroup: (size) => {
4479
- const configs = {
4480
- xl: {
4481
- height: 64,
4482
- paddingHorizontal: 16,
4483
- paddingVertical: 21,
4484
- fontSize: 20,
4485
- lineHeight: 22,
4486
- gap: 8,
4487
- borderRadius: radiusScale["50"]
4488
- },
4489
- lg: {
4490
- height: 56,
4491
- paddingHorizontal: 16,
4492
- paddingVertical: 18,
4493
- fontSize: 18,
4494
- lineHeight: 20,
4495
- gap: 8,
4496
- borderRadius: radiusScale["50"]
4497
- },
4498
- md: {
4499
- height: 48,
4500
- paddingHorizontal: 12,
4501
- paddingVertical: 15,
4502
- fontSize: 16,
4503
- lineHeight: 18,
4504
- gap: 8,
4505
- borderRadius: radiusScale["25"]
4506
- },
4507
- sm: {
4508
- height: 40,
4509
- paddingHorizontal: 12,
4510
- paddingVertical: 11,
4511
- fontSize: 14,
4512
- lineHeight: 16,
4513
- gap: 4,
4514
- borderRadius: radiusScale["25"]
4515
- }
4516
- };
4517
- return configs[size];
4518
- },
4519
- badge: (size) => {
4520
- const configs = {
4521
- xl: {
4522
- size: 20,
4523
- fontSize: 12,
4524
- lineHeight: 14,
4525
- iconSize: 12,
4526
- padding: 6
4527
- },
4528
- lg: {
4529
- size: 16,
4530
- fontSize: 10,
4531
- lineHeight: 10,
4532
- iconSize: 10,
4533
- padding: 4
4534
- },
4535
- md: {
4536
- size: 12,
4537
- fontSize: 10,
4538
- lineHeight: 10,
4539
- iconSize: 8,
4540
- padding: 3
4541
- },
4542
- sm: { size: 8, fontSize: 8, lineHeight: 8, iconSize: 6, padding: 0 },
4543
- xs: { size: 4, fontSize: 4, lineHeight: 4, iconSize: 4, padding: 0 }
4544
- };
4545
- return configs[size];
4546
- },
4547
- notification: (type) => {
4548
- const configs = {
4549
- toast: {
4550
- width: 400,
4551
- paddingHorizontal: 20,
4552
- paddingVertical: 16,
4553
- gap: 16,
4554
- titleSize: 18,
4555
- messageSize: 14,
4556
- iconSize: 20,
4557
- iconWrapperSize: 32,
4558
- radius: shape.toast.borderRadius
4559
- },
4560
- inline: {
4561
- width: "100%",
4562
- paddingHorizontal: 20,
4563
- paddingVertical: 16,
4564
- gap: 28,
4565
- titleSize: 18,
4566
- messageSize: 14,
4567
- iconSize: 20,
4568
- iconWrapperSize: 32,
4569
- radius: shape.modal.borderRadius
4570
- }
4571
- };
4572
- return configs[type];
4573
- },
4574
- notificationPanel: (device = "desktop") => {
4575
- const desktop = {
4576
- minHeight: 66,
4577
- iconFrameWidth: 54,
4578
- iconSize: 24,
4579
- borderRadius: radiusScale["100"],
4580
- bodyPaddingHorizontal: 16,
4581
- bodyPaddingVertical: 12,
4582
- textGap: 2,
4583
- contentGap: 24,
4584
- buttonsGap: 8,
4585
- closeButtonSize: 32,
4586
- notificationCloseIconSize: 18,
4587
- titleFontSize: 16,
4588
- titleLineHeight: 20,
4589
- descriptionFontSize: 14,
4590
- descriptionLineHeight: 20,
4591
- // Announcement variant: slim, single-line banner
4592
- announcementPadding: 8,
4593
- announcementGap: 16,
4594
- announcementContentGap: 8,
4595
- announcementIconSize: 16,
4596
- announcementButtonsGap: 20,
4597
- announcementCloseIconSize: 16,
4598
- announcementBlurRadius: 4,
4599
- // Mobile notification: icon | content column | close column
4600
- mobileIconColumnPaddingVertical: 12,
4601
- mobileIconColumnPaddingLeft: 8,
4602
- mobileIconSize: 24,
4603
- mobileBodyPaddingHorizontal: 16,
4604
- mobileBodyPaddingVertical: 12,
4605
- mobileBodyContentGap: 24,
4606
- mobileNotificationActionButtonOffsetLeft: -4,
4607
- mobileCloseColumnPaddingVertical: 12,
4608
- mobileCloseColumnPaddingRight: 12
4609
- };
4610
- return desktop;
4611
- },
4612
- progress: (size) => {
4613
- const configs = {
4614
- xl: { height: 10, labelSize: 16, helperSize: 14, gap: 10 },
4615
- lg: { height: 8, labelSize: 14, helperSize: 12, gap: 8 },
4616
- md: { height: 6, labelSize: 12, helperSize: 12, gap: 6 },
4617
- sm: { height: 4, labelSize: 12, helperSize: 12, gap: 4 },
4618
- xs: { height: 2, labelSize: 10, helperSize: 10, gap: 2 },
4619
- xxs: { height: 2, labelSize: 10, helperSize: 10, gap: 2 },
4620
- l: { height: 8, labelSize: 16, helperSize: 14, gap: 10 },
4621
- m: { height: 6, labelSize: 14, helperSize: 12, gap: 8 },
4622
- s: { height: 4, labelSize: 12, helperSize: 12, gap: 6 }
4623
- };
4624
- return configs[size];
4625
- },
4626
- /**
4627
- * SupportingText sizing.
4628
- *
4629
- * Typography is bound to the `Theme / Typography` body tokens rather than
4630
- * hardcoded px values, so a change to the Figma-synced scale propagates
4631
- * automatically. Each size maps to the body token whose font-size and
4632
- * compact line-height match the corresponding Figma size variant:
4633
- *
4634
- * | size | typography token | font-size / line-height | icon | gap |
4635
- * | ---- | ---------------- | ----------------------- | ---- | --- |
4636
- * | xl | `body-lg` | 18 / 24 | 18 | 6 |
4637
- * | lg | `body-md` | 16 / 20 | 18 | 6 |
4638
- * | md | `body-sm` | 14 / 18 | 18 | 6 |
4639
- * | sm | `body-xs` | 12 / 16 | 14 | 4 |
4640
- * | xs | `body-xxs` | 10 / 14 | 14 | 4 |
4641
- *
4642
- * `requiredIndicator` is the required-field asterisk that sits beside a
4643
- * label. Figma renders it one step down the same scale, so it aliases the
4644
- * next-smaller size's token instead of carrying its own table.
4645
- *
4646
- * `gap` is the spacing between the text and its trailing icon (Figma
4647
- * `Label & icon` frame item-spacing).
4648
- *
4649
- * @see https://www.figma.com/design/m0qqLlCvR29fvqj0EzlLAU/Xsolla-UI-Toolkit?node-id=5680-33147
4650
- */
4651
- supportingText: (size) => {
4652
- const typographyBySize = {
4653
- xl: contextTypography.basic["body-lg"],
4654
- lg: contextTypography.basic["body-md"],
4655
- md: contextTypography.basic["body-sm"],
4656
- sm: contextTypography.basic["body-xs"],
4657
- xs: contextTypography.basic["body-xxs"]
4658
- };
4659
- const dimensions = {
4660
- xl: { gap: 6, iconSize: 18 },
4661
- lg: { gap: 6, iconSize: 18 },
4662
- md: { gap: 6, iconSize: 18 },
4663
- sm: { gap: 4, iconSize: 14 },
4664
- xs: { gap: 4, iconSize: 14 }
4665
- };
4666
- const requiredIndicatorSizeMap = {
4667
- xl: "lg",
4668
- lg: "md",
4669
- md: "sm",
4670
- sm: "xs",
4671
- xs: "xs"
4672
- };
4673
- const typography2 = typographyBySize[size];
4674
- const requiredTypography = typographyBySize[requiredIndicatorSizeMap[size]];
4675
- return {
4676
- fontSize: typography2.fontSize,
4677
- lineHeight: typography2.lineHeight,
4678
- fontWeight: typography2.fontWeight,
4679
- fontFamily: contextFonts.body,
4680
- requiredIndicator: {
4681
- fontSize: requiredTypography.fontSize,
4682
- lineHeight: requiredTypography.lineHeight
4683
- },
4684
- ...dimensions[size]
4685
- };
4686
- },
4687
- iconWrapper: (size) => {
4688
- const configs = {
4689
- xl: { size: 56, iconSize: 32, fontSize: 24 },
4690
- lg: { size: 48, iconSize: 28, fontSize: 20 },
4691
- md: { size: 40, iconSize: 24, fontSize: 18 },
4692
- sm: { size: 32, iconSize: 20, fontSize: 16 },
4693
- xs: { size: 24, iconSize: 16, fontSize: 14 },
4694
- xxs: { size: 18, iconSize: 12, fontSize: 12 }
4695
- };
4696
- return configs[size];
4697
- },
4698
- stepper: (size) => {
4699
- const configs = {
4700
- md: {
4701
- iconSize: 32,
4702
- titleSize: 16,
4703
- descSize: 14,
4704
- gap: 12,
4705
- currentTitleSize: 20,
4706
- currentDescSize: 14,
4707
- currentPadding: 24,
4708
- tailSize: 5
4709
- },
4710
- sm: {
4711
- iconSize: 24,
4712
- titleSize: 14,
4713
- descSize: 12,
4714
- gap: 8,
4715
- currentTitleSize: 16,
4716
- currentDescSize: 12,
4717
- currentPadding: 20,
4718
- tailSize: 3
4719
- }
4720
- };
4721
- return configs[size];
4722
- },
4723
- contextMenu: (size) => {
4724
- const configs = {
4725
- xl: {
4726
- paddingVertical: 8,
4727
- paddingHorizontal: 8,
4728
- itemPaddingHorizontal: 16,
4729
- itemPaddingVertical: 18,
4730
- fontSize: 20,
4731
- lineHeight: 26,
4732
- descriptionFontSize: 18,
4733
- iconSize: 18,
4734
- gap: 12,
4735
- minWidth: 276,
4736
- panelWidth: 320,
4737
- statusDotSize: 12,
4738
- iconWrapperSize: 40,
4739
- triggerOffset: 4,
4740
- borderRadius: 8,
4741
- // Search sizing from Figma
4742
- searchPaddingHorizontal: 16,
4743
- searchPaddingVertical: 18,
4744
- searchGap: 18,
4745
- searchFontSize: 20,
4746
- searchLineHeight: 26,
4747
- searchIconSize: 18
4748
- },
4749
- lg: {
4750
- paddingVertical: 8,
4751
- paddingHorizontal: 8,
4752
- itemPaddingHorizontal: 14,
4753
- itemPaddingVertical: 14,
4754
- fontSize: 18,
4755
- lineHeight: 24,
4756
- descriptionFontSize: 16,
4757
- iconSize: 18,
4758
- gap: 10,
4759
- minWidth: 220,
4760
- panelWidth: 296,
4761
- statusDotSize: 10,
4762
- iconWrapperSize: 36,
4763
- triggerOffset: 4,
4764
- borderRadius: 8,
4765
- // Search sizing from Figma
4766
- searchPaddingHorizontal: 14,
4767
- searchPaddingVertical: 14,
4768
- searchGap: 14,
4769
- searchFontSize: 18,
4770
- searchLineHeight: 24,
4771
- searchIconSize: 18
4772
- },
4773
- md: {
4774
- paddingVertical: 8,
4775
- paddingHorizontal: 8,
4776
- itemPaddingHorizontal: 12,
4777
- itemPaddingVertical: 11,
4778
- fontSize: 16,
4779
- lineHeight: 20,
4780
- descriptionFontSize: 14,
4781
- iconSize: 18,
4782
- gap: 8,
4783
- minWidth: 172,
4784
- panelWidth: 272,
4785
- statusDotSize: 8,
4786
- iconWrapperSize: 32,
4787
- triggerOffset: 4,
4788
- borderRadius: 8,
4789
- // Search sizing from Figma
4790
- searchPaddingHorizontal: 12,
4791
- searchPaddingVertical: 11,
4792
- searchGap: 10,
4793
- searchFontSize: 16,
4794
- searchLineHeight: 20,
4795
- searchIconSize: 18
4796
- },
4797
- sm: {
4798
- paddingVertical: 8,
4799
- paddingHorizontal: 8,
4800
- itemPaddingHorizontal: 10,
4801
- itemPaddingVertical: 8,
4802
- fontSize: 14,
4803
- lineHeight: 18,
4804
- descriptionFontSize: 12,
4805
- iconSize: 18,
4806
- gap: 8,
4807
- minWidth: 132,
4808
- panelWidth: 248,
4809
- statusDotSize: 6,
4810
- iconWrapperSize: 24,
4811
- triggerOffset: 4,
4812
- borderRadius: 4,
4813
- // Search sizing from Figma
4814
- searchPaddingHorizontal: 10,
4815
- searchPaddingVertical: 7,
4816
- searchGap: 6,
4817
- searchFontSize: 14,
4818
- searchLineHeight: 18,
4819
- searchIconSize: 18
4820
- }
4821
- };
4822
- return configs[size];
4823
- },
4824
- modal: () => {
4825
- return {
4826
- borderRadius: shape.modal.borderRadius,
4827
- headerPadding: "24px 24px 0",
4828
- contentPadding: 24,
4829
- /** @deprecated Header buttons no longer use IconButton sizes. */
4830
- headerButtonSize: "xs",
4831
- /** @deprecated Header buttons are FlexButtons; size comes from `Modal`'s `closeButtonSize`. */
4832
- headerIconSize: 28,
4833
- /** @deprecated Header buttons are FlexButtons; padding is owned by FlexButton. */
4834
- headerButtonPadding: 4,
4835
- /** @deprecated Header buttons are FlexButtons; radius comes from FlexButton's size scale. */
4836
- headerButtonRadius: 4,
4837
- headerMinHeight: 44,
4838
- headerGap: 16,
4839
- footerGap: 16,
4840
- /** @deprecated Modal elevation comes from the scrim, not a drop shadow. */
4841
- shadow: "0px 8px 12px 6px rgba(7, 7, 8, 0.1), 0px 4px 4px rgba(7, 7, 8, 0.2)",
4842
- maxWidth: 680,
4843
- overlayColor: "rgba(0, 0, 0, 0.75)",
4844
- portalPadding: 20,
4845
- /** @deprecated Layering is contextual now; see OVERLAY_LAYER_BASE / useOverlayLayer. */
4846
- zIndex: 1e3
4847
- };
4848
- },
4849
- drawer: () => ({
4850
- // Sizing values from Figma design: B2B Components Library node-id=8291-103845
4851
- widthSm: 480,
4852
- widthMd: 620,
4853
- widthLg: 1056,
4854
- headerHeight: 80,
4855
- headerPaddingX: 32,
4856
- headerPaddingY: 24,
4857
- headerGap: 24,
4858
- titleFontSize: 18,
4859
- titleLineHeight: 24,
4860
- contentPaddingX: 32,
4861
- footerPadding: 32,
4862
- outerPadding: 8,
4863
- containerRadius: 4,
4864
- contentRadius: 8,
4865
- stepperPadding: 16,
4866
- stepperRadius: 8,
4867
- stepperContentGap: 8,
4868
- scrimColor: "rgba(0, 0, 0, 0.75)",
4869
- animationDuration: 300,
4870
- /** @deprecated Layering is contextual now; see MODAL_LAYER_STEP / useOverlayLayer. */
4871
- zIndex: 1e3
4872
- }),
4873
- sidebar: () => ({
4874
- // Sizing values from Figma design: B2B Components Library
4875
- widthExpanded: 280,
4876
- widthCollapsed: 48,
4877
- radius: 4,
4878
- itemHeight: 32,
4879
- iconSize: 18,
4880
- padding: 8,
4881
- sectionLabelHeight: 20,
4882
- // Aligns nested item text with parent label (padding 8 + icon 18 + gap 8 = 34)
4883
- // and centers the rail under the parent icon (padding 8 + iconSize/2 = 17).
4884
- nestedItemPaddingLeft: 34,
4885
- nestedItemRailLeft: 17,
4886
- chevronSize: 14,
4887
- externalIconSize: 18,
4888
- chatBadgeSize: 6,
4889
- itemBadgeSize: 4,
4890
- focusOutlineWidth: 2,
4891
- scrollbarWidth: 4,
4892
- popoverGap: 12,
4893
- popoverViewportPadding: 8,
4894
- popoverMinWidth: 180,
4895
- popoverMaxWidth: 240,
4896
- popoverShadow: "0 2px 25px rgba(7, 7, 8, 0.15)",
4897
- /** @deprecated Layering is contextual now; see useOverlayLayer / LAYER_OFFSET. */
4898
- popoverZIndex: 1e3,
4899
- transitionWidth: "0.25s ease-in-out",
4900
- transitionFadeIn: "opacity 0.15s ease-in-out 0.1s",
4901
- transitionFadeOut: "opacity 0.1s ease-in-out",
4902
- transitionItem: "background-color 0.15s ease-in-out, color 0.15s ease-in-out",
4903
- transitionRows: "grid-template-rows 0.25s ease-in-out"
4904
- }),
4905
- stepperB2b: () => ({
4906
- // Sizing values from Figma design: B2B Components Library
4907
- // variant grid node-id=10999-17988, state grid node-id=10259-5501
4908
- chipSize: 32,
4909
- chipRadius: 2,
4910
- chipPaddingTop: 5,
4911
- chipPaddingBottom: 4,
4912
- chipPaddingX: 4,
4913
- chipIconSize: 16,
4914
- numberFontSize: 18,
4915
- numberLineHeight: 24,
4916
- titleFontSize: 16,
4917
- titleLineHeight: 20,
4918
- descriptionFontSize: 14,
4919
- descriptionLineHeight: 20,
4920
- captionFontSize: 12,
4921
- captionLineHeight: 16,
4922
- itemGap: 12,
4923
- contentGap: 4,
4924
- contentMinHeight: 32,
4925
- contentWidth: 128,
4926
- activeCardRadiusVertical: 4,
4927
- activeCardRadiusHorizontal: 6,
4928
- activeCardPaddingTop: 24,
4929
- activeCardPaddingX: 24,
4930
- activeCardPaddingYHorizontal: 12,
4931
- activeCardPaddingLeftHorizontal: 12,
4932
- activeCardGapHorizontal: 8,
4933
- innerConnectorLength: 48,
4934
- connectorSegment: 24,
4935
- connectorCellHeight: 24,
4936
- connectorCellWidth: 80,
4937
- surfaceRadius: 8,
4938
- surfacePaddingVertical: 16,
4939
- surfacePaddingHorizontal: 8,
4940
- horizontalItemGap: 16,
4941
- horizontalFirstItemWidth: 220,
4942
- horizontalItemWidth: 236,
4943
- horizontalConnectorSegment: 32,
4944
- horizontalConnectorGap: 12,
4945
- simpleCardPadding: 12,
4946
- simpleCardRadius: 4,
4947
- simpleCardGap: 4,
4948
- simpleItemGap: 4,
4949
- simpleHorizontalCellWidth: 56,
4950
- simpleHorizontalStubLength: 8
4951
- }),
4952
- collapsibleB2b: () => ({
4953
- // Sizing values from Figma design: B2B Components Library node-id=10469-6509
4954
- triggerPadding: 16,
4955
- triggerGap: 12,
4956
- triggerMinHeight: 56,
4957
- surfaceRadius: radiusScale["50"],
4958
- cellRadius: radiusScale["100"],
4959
- iconSlotSize: 32,
4960
- iconSlotRadius: radiusScale["50"],
4961
- chevronSize: 24,
4962
- trailingGap: 8,
4963
- textGap: 2,
4964
- titleFontSize: 16,
4965
- titleLineHeight: 20,
4966
- captionFontSize: 12,
4967
- captionLineHeight: 18,
4968
- panelPadding: 16,
4969
- accordionItemGap: 8
4970
- }),
4971
- toast: () => {
4972
- return {
4973
- minHeight: 64,
4974
- paddingHorizontal: 12,
4975
- paddingVertical: 8,
4976
- borderRadius: shape.toast.borderRadius,
4977
- gap: 12,
4978
- iconSize: 24,
4979
- closeButtonSize: 24,
4980
- closeIconSize: 20,
4981
- fontSize: 16,
4982
- lineHeight: 20,
4983
- maxWidth: 400,
4984
- containerPadding: 12,
4985
- groupGap: 4
4986
- };
4987
- },
4988
- toggleButtonGroup: (size) => {
4989
- const configs = {
4990
- xl: {
4991
- height: 64,
4992
- paddingHorizontal: 21,
4993
- fontSize: 20,
4994
- lineHeight: 22,
4995
- iconSize: 22,
4996
- gap: 6,
4997
- borderRadius: shape.toggleButtonGroup.xl.borderRadius,
4998
- itemGap: 8,
4999
- tooltipSize: "lg"
5000
- },
5001
- lg: {
5002
- height: 56,
5003
- paddingHorizontal: 18,
5004
- fontSize: 18,
5005
- lineHeight: 20,
5006
- iconSize: 20,
5007
- gap: 4,
5008
- borderRadius: shape.toggleButtonGroup.lg.borderRadius,
5009
- itemGap: 8,
5010
- tooltipSize: "md"
5011
- },
5012
- md: {
5013
- height: 48,
5014
- paddingHorizontal: 15,
5015
- fontSize: 16,
5016
- lineHeight: 18,
5017
- iconSize: 18,
5018
- gap: 4,
5019
- borderRadius: shape.toggleButtonGroup.md.borderRadius,
5020
- itemGap: 6,
5021
- tooltipSize: "md"
5022
- },
5023
- sm: {
5024
- height: 40,
5025
- paddingHorizontal: 12,
5026
- fontSize: 14,
5027
- lineHeight: 16,
5028
- iconSize: 16,
5029
- gap: 4,
5030
- borderRadius: shape.toggleButtonGroup.sm.borderRadius,
5031
- itemGap: 4,
5032
- tooltipSize: "sm"
5033
- },
5034
- xs: {
5035
- height: 32,
5036
- paddingHorizontal: 9,
5037
- fontSize: 12,
5038
- lineHeight: 14,
5039
- iconSize: 14,
5040
- gap: 4,
5041
- borderRadius: shape.toggleButtonGroup.xs.borderRadius,
5042
- itemGap: 4,
5043
- tooltipSize: "sm"
5044
- }
5045
- };
5046
- return configs[size];
5047
- },
5048
- table: {
5049
- containerRadius: 8,
5050
- containerPaddingVertical: 0,
5051
- containerGap: 0,
5052
- captionFontSize: 14,
5053
- captionLineHeight: 20,
5054
- headerRowHeight: 56,
5055
- headerRowPaddingHorizontal: 24,
5056
- headerCellGap: 4,
5057
- headerCellFontSize: 14,
5058
- headerCellLineHeight: 18,
5059
- rowHeight: 56,
5060
- rowPaddingHorizontal: 24,
5061
- cellGap: 16,
5062
- cellFontSize: 14,
5063
- cellLineHeight: 18,
5064
- paginationGap: 16,
5065
- paginationPaddingHorizontal: 24
5066
- }
5067
- }
5068
- };
5069
- };
5070
5694
  var DesignSystemContext = createContext(
5071
5695
  void 0
5072
5696
  );
@@ -5146,6 +5770,9 @@ var useIdFallback = () => {
5146
5770
  var useId = hasReactUseId ? React3.useId : useIdFallback;
5147
5771
  var ModalIdContext = createContext(null);
5148
5772
  var useModalId = () => useContext(ModalIdContext);
5773
+
5774
+ // src/overlay.ts
5775
+ import { createContext as createContext2, useContext as useContext2 } from "react";
5149
5776
  var OVERLAY_LAYER_BASE = 1e3;
5150
5777
  var LAYER_OFFSET = {
5151
5778
  /** Trigger-anchored value lists: dropdown, select, multi-select, autocomplete. */
@@ -5157,12 +5784,12 @@ var LAYER_OFFSET = {
5157
5784
  };
5158
5785
  var MODAL_LAYER_STEP = 1e3;
5159
5786
  var TOAST_LAYER = 9999;
5160
- var OverlayLayerContext = createContext(OVERLAY_LAYER_BASE);
5787
+ var OverlayLayerContext = createContext2(OVERLAY_LAYER_BASE);
5161
5788
  var OverlayLayerProvider = OverlayLayerContext.Provider;
5162
- var useOverlayLayer = () => useContext(OverlayLayerContext);
5163
- var ModalStackContext = createContext(0);
5789
+ var useOverlayLayer = () => useContext2(OverlayLayerContext);
5790
+ var ModalStackContext = createContext2(0);
5164
5791
  var ModalStackProvider = ModalStackContext.Provider;
5165
- var useModalStackDepth = () => useContext(ModalStackContext);
5792
+ var useModalStackDepth = () => useContext2(ModalStackContext);
5166
5793
  export {
5167
5794
  DISPLAY_SCALE_STEPS,
5168
5795
  FontLoader,
@@ -5201,6 +5828,7 @@ export {
5201
5828
  shadow,
5202
5829
  shape,
5203
5830
  spacing,
5831
+ spacingScale,
5204
5832
  stroke,
5205
5833
  themeConfig,
5206
5834
  typography,