@xsolla/xui-core 0.134.0 → 0.136.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.js CHANGED
@@ -31,12 +31,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
33
  FontLoader: () => FontLoader,
34
+ MOBILE_MAX_WIDTH: () => MOBILE_MAX_WIDTH,
34
35
  ModalIdContext: () => ModalIdContext,
36
+ SCALE_STEPS: () => SCALE_STEPS,
37
+ TypographyStyleLoader: () => TypographyStyleLoader,
35
38
  XUIProvider: () => XUIProvider,
39
+ breakpoints: () => breakpoints,
36
40
  colors: () => colors,
41
+ cssVar: () => cssVar,
37
42
  defaultProductContext: () => defaultProductContext,
38
43
  fontFacesCSS: () => fontFacesCSS,
44
+ fontSize: () => fontSize,
39
45
  fonts: () => fonts,
46
+ generateTypographyCSS: () => generateTypographyCSS,
40
47
  getFonts: () => getFonts,
41
48
  getTypographyTokens: () => getTypographyTokens,
42
49
  getTypographyVariant: () => getTypographyVariant,
@@ -44,7 +51,11 @@ __export(index_exports, {
44
51
  isIOS: () => isIOS,
45
52
  isNative: () => isNative,
46
53
  isWeb: () => isWeb,
54
+ lineHeightCompact: () => lineHeightCompact,
55
+ lineHeightDisplay: () => lineHeightDisplay,
56
+ lineHeightText: () => lineHeightText,
47
57
  radius: () => radius,
58
+ responsiveTypographyScale: () => responsiveTypographyScale,
48
59
  shadow: () => shadow,
49
60
  spacing: () => spacing,
50
61
  themeConfig: () => themeConfig,
@@ -56,7 +67,7 @@ __export(index_exports, {
56
67
  useResolvedTheme: () => useResolvedTheme
57
68
  });
58
69
  module.exports = __toCommonJS(index_exports);
59
- var import_react2 = __toESM(require("react"));
70
+ var import_react3 = __toESM(require("react"));
60
71
 
61
72
  // src/tokens/pentagram-dark.json
62
73
  var pentagram_dark_default = {
@@ -1302,12 +1313,16 @@ var bodyFont = `"Aktiv Grotesk", "Noto Sans", "Montserrat", ${FALLBACK}`;
1302
1313
  var fonts = {
1303
1314
  heading: displayFontByContext.b2b,
1304
1315
  body: bodyFont,
1316
+ /** Paragraph/reading font — same families as body */
1317
+ text: bodyFont,
1305
1318
  /** @deprecated Use `heading` or `body` instead */
1306
1319
  primary: bodyFont
1307
1320
  };
1308
1321
  var getFonts = (productContext = "b2b") => ({
1309
1322
  heading: displayFontByContext[productContext],
1310
1323
  body: bodyFont,
1324
+ /** Paragraph/reading font — same families as body */
1325
+ text: bodyFont,
1311
1326
  /** @deprecated Use `heading` or `body` instead */
1312
1327
  primary: bodyFont
1313
1328
  });
@@ -1322,189 +1337,453 @@ var typography = {
1322
1337
  var typographyTokens = {
1323
1338
  b2c: {
1324
1339
  heading: {
1325
- h1: { fontSize: 40, lineHeight: "48px", fontWeight: 700 },
1326
- h2: { fontSize: 32, lineHeight: "38px", fontWeight: 700 },
1327
- h3: { fontSize: 28, lineHeight: "34px", fontWeight: 700 },
1328
- h4: { fontSize: 24, lineHeight: "28px", fontWeight: 700 },
1329
- h5: { fontSize: 20, lineHeight: "24px", fontWeight: 700 }
1340
+ h1: {
1341
+ fontSize: 40,
1342
+ lineHeight: "40px",
1343
+ fontWeight: 700,
1344
+ scaleStep: "450",
1345
+ lineHeightCategory: "display"
1346
+ },
1347
+ h2: {
1348
+ fontSize: 32,
1349
+ lineHeight: "32px",
1350
+ fontWeight: 700,
1351
+ scaleStep: "350",
1352
+ lineHeightCategory: "display"
1353
+ },
1354
+ h3: {
1355
+ fontSize: 28,
1356
+ lineHeight: "28px",
1357
+ fontWeight: 700,
1358
+ scaleStep: "300",
1359
+ lineHeightCategory: "display"
1360
+ },
1361
+ h4: {
1362
+ fontSize: 24,
1363
+ lineHeight: "24px",
1364
+ fontWeight: 700,
1365
+ scaleStep: "250",
1366
+ lineHeightCategory: "display"
1367
+ },
1368
+ h5: {
1369
+ fontSize: 20,
1370
+ lineHeight: "20px",
1371
+ fontWeight: 700,
1372
+ scaleStep: "200",
1373
+ lineHeightCategory: "display"
1374
+ }
1330
1375
  },
1331
1376
  basic: {
1332
- display: { fontSize: 48, lineHeight: "58px", fontWeight: 800 },
1377
+ display: {
1378
+ fontSize: 48,
1379
+ lineHeight: "48px",
1380
+ fontWeight: 800,
1381
+ scaleStep: "550",
1382
+ lineHeightCategory: "display"
1383
+ },
1333
1384
  "body-lg": {
1334
1385
  fontSize: 18,
1335
1386
  lineHeight: "24px",
1336
1387
  fontWeight: 400,
1388
+ scaleStep: "175",
1389
+ lineHeightCategory: "compact",
1337
1390
  accent: { fontWeight: 500 },
1338
- paragraph: { lineHeight: "26px", spacing: 20 }
1391
+ paragraph: {
1392
+ lineHeight: "26px",
1393
+ spacing: 20,
1394
+ lineHeightScaleStep: "175"
1395
+ }
1339
1396
  },
1340
1397
  "body-md": {
1341
1398
  fontSize: 16,
1342
1399
  lineHeight: "20px",
1343
1400
  fontWeight: 400,
1401
+ scaleStep: "150",
1402
+ lineHeightCategory: "compact",
1344
1403
  accent: { fontWeight: 500 },
1345
- paragraph: { lineHeight: "22px", spacing: 16 }
1404
+ paragraph: {
1405
+ lineHeight: "22px",
1406
+ spacing: 16,
1407
+ lineHeightScaleStep: "150"
1408
+ }
1346
1409
  },
1347
1410
  "body-sm": {
1348
1411
  fontSize: 14,
1349
1412
  lineHeight: "18px",
1350
1413
  fontWeight: 400,
1414
+ scaleStep: "125",
1415
+ lineHeightCategory: "compact",
1351
1416
  accent: { fontWeight: 500 },
1352
- paragraph: { lineHeight: "20px", spacing: 12 }
1417
+ paragraph: {
1418
+ lineHeight: "20px",
1419
+ spacing: 12,
1420
+ lineHeightScaleStep: "125"
1421
+ }
1353
1422
  },
1354
1423
  "body-xs": {
1355
1424
  fontSize: 12,
1356
1425
  lineHeight: "16px",
1357
1426
  fontWeight: 400,
1427
+ scaleStep: "100",
1428
+ lineHeightCategory: "compact",
1358
1429
  accent: { fontWeight: 500 },
1359
- paragraph: { lineHeight: "18px", spacing: 8 }
1430
+ paragraph: {
1431
+ lineHeight: "18px",
1432
+ spacing: 8,
1433
+ lineHeightScaleStep: "100"
1434
+ }
1360
1435
  },
1361
1436
  "body-xxs": {
1362
1437
  fontSize: 10,
1363
1438
  lineHeight: "14px",
1364
1439
  fontWeight: 400,
1440
+ scaleStep: "75",
1441
+ lineHeightCategory: "compact",
1365
1442
  accent: { fontWeight: 500 },
1366
- paragraph: { lineHeight: "14px", spacing: 6 }
1443
+ paragraph: {
1444
+ lineHeight: "14px",
1445
+ spacing: 6,
1446
+ lineHeightScaleStep: "75"
1447
+ }
1367
1448
  }
1368
1449
  }
1369
1450
  },
1370
1451
  b2b: {
1371
1452
  heading: {
1372
- h1: { fontSize: 56, lineHeight: "68px", fontWeight: 400 },
1373
- h2: { fontSize: 48, lineHeight: "58px", fontWeight: 400 },
1374
- h3: { fontSize: 32, lineHeight: "38px", fontWeight: 400 },
1375
- h4: { fontSize: 24, lineHeight: "28px", fontWeight: 400 },
1376
- h5: { fontSize: 20, lineHeight: "24px", fontWeight: 600 }
1453
+ h1: {
1454
+ fontSize: 56,
1455
+ lineHeight: "56px",
1456
+ fontWeight: 400,
1457
+ scaleStep: "650",
1458
+ lineHeightCategory: "display"
1459
+ },
1460
+ h2: {
1461
+ fontSize: 48,
1462
+ lineHeight: "48px",
1463
+ fontWeight: 400,
1464
+ scaleStep: "550",
1465
+ lineHeightCategory: "display"
1466
+ },
1467
+ h3: {
1468
+ fontSize: 32,
1469
+ lineHeight: "32px",
1470
+ fontWeight: 400,
1471
+ scaleStep: "350",
1472
+ lineHeightCategory: "display"
1473
+ },
1474
+ h4: {
1475
+ fontSize: 24,
1476
+ lineHeight: "24px",
1477
+ fontWeight: 400,
1478
+ scaleStep: "250",
1479
+ lineHeightCategory: "display"
1480
+ },
1481
+ h5: {
1482
+ fontSize: 20,
1483
+ lineHeight: "20px",
1484
+ fontWeight: 600,
1485
+ scaleStep: "200",
1486
+ lineHeightCategory: "display"
1487
+ }
1377
1488
  },
1378
1489
  basic: {
1379
- display: { fontSize: 64, lineHeight: "78px", fontWeight: 400 },
1490
+ display: {
1491
+ fontSize: 64,
1492
+ lineHeight: "64px",
1493
+ fontWeight: 400,
1494
+ scaleStep: "750",
1495
+ lineHeightCategory: "display"
1496
+ },
1380
1497
  "body-lg": {
1381
1498
  fontSize: 18,
1382
1499
  lineHeight: "24px",
1383
1500
  fontWeight: 400,
1501
+ scaleStep: "175",
1502
+ lineHeightCategory: "compact",
1384
1503
  accent: { fontWeight: 500 },
1385
- paragraph: { lineHeight: "26px", spacing: 20 }
1504
+ paragraph: {
1505
+ lineHeight: "26px",
1506
+ spacing: 20,
1507
+ lineHeightScaleStep: "175"
1508
+ }
1386
1509
  },
1387
1510
  "body-md": {
1388
1511
  fontSize: 16,
1389
1512
  lineHeight: "20px",
1390
1513
  fontWeight: 400,
1514
+ scaleStep: "150",
1515
+ lineHeightCategory: "compact",
1391
1516
  accent: { fontWeight: 500 },
1392
- paragraph: { lineHeight: "22px", spacing: 16 }
1517
+ paragraph: {
1518
+ lineHeight: "22px",
1519
+ spacing: 16,
1520
+ lineHeightScaleStep: "150"
1521
+ }
1393
1522
  },
1394
1523
  "body-sm": {
1395
1524
  fontSize: 14,
1396
1525
  lineHeight: "18px",
1397
1526
  fontWeight: 400,
1527
+ scaleStep: "125",
1528
+ lineHeightCategory: "compact",
1398
1529
  accent: { fontWeight: 500 },
1399
- paragraph: { lineHeight: "20px", spacing: 12 }
1530
+ paragraph: {
1531
+ lineHeight: "20px",
1532
+ spacing: 12,
1533
+ lineHeightScaleStep: "125"
1534
+ }
1400
1535
  },
1401
1536
  "body-xs": {
1402
1537
  fontSize: 12,
1403
1538
  lineHeight: "16px",
1404
1539
  fontWeight: 400,
1540
+ scaleStep: "100",
1541
+ lineHeightCategory: "compact",
1405
1542
  accent: { fontWeight: 500 },
1406
- paragraph: { lineHeight: "18px", spacing: 8 }
1543
+ paragraph: {
1544
+ lineHeight: "18px",
1545
+ spacing: 8,
1546
+ lineHeightScaleStep: "100"
1547
+ }
1407
1548
  },
1408
1549
  "body-xxs": {
1409
1550
  fontSize: 10,
1410
1551
  lineHeight: "14px",
1411
1552
  fontWeight: 400,
1553
+ scaleStep: "75",
1554
+ lineHeightCategory: "compact",
1412
1555
  accent: { fontWeight: 500 },
1413
- paragraph: { lineHeight: "14px", spacing: 6 }
1556
+ paragraph: {
1557
+ lineHeight: "14px",
1558
+ spacing: 6,
1559
+ lineHeightScaleStep: "75"
1560
+ }
1414
1561
  }
1415
1562
  }
1416
1563
  },
1417
1564
  paystation: {
1418
1565
  heading: {
1419
- h1: { fontSize: 28, lineHeight: "34px", fontWeight: 700 },
1420
- h2: { fontSize: 24, lineHeight: "28px", fontWeight: 700 },
1421
- h3: { fontSize: 20, lineHeight: "24px", fontWeight: 700 },
1422
- h4: { fontSize: 18, lineHeight: "22px", fontWeight: 700 },
1423
- h5: { fontSize: 16, lineHeight: "20px", fontWeight: 700 }
1566
+ h1: {
1567
+ fontSize: 28,
1568
+ lineHeight: "28px",
1569
+ fontWeight: 700,
1570
+ scaleStep: "300",
1571
+ lineHeightCategory: "display"
1572
+ },
1573
+ h2: {
1574
+ fontSize: 24,
1575
+ lineHeight: "24px",
1576
+ fontWeight: 700,
1577
+ scaleStep: "250",
1578
+ lineHeightCategory: "display"
1579
+ },
1580
+ h3: {
1581
+ fontSize: 20,
1582
+ lineHeight: "20px",
1583
+ fontWeight: 700,
1584
+ scaleStep: "200",
1585
+ lineHeightCategory: "display"
1586
+ },
1587
+ h4: {
1588
+ fontSize: 18,
1589
+ lineHeight: "18px",
1590
+ fontWeight: 700,
1591
+ scaleStep: "175",
1592
+ lineHeightCategory: "display"
1593
+ },
1594
+ h5: {
1595
+ fontSize: 16,
1596
+ lineHeight: "16px",
1597
+ fontWeight: 700,
1598
+ scaleStep: "150",
1599
+ lineHeightCategory: "display"
1600
+ }
1424
1601
  },
1425
1602
  basic: {
1426
- display: { fontSize: 40, lineHeight: "48px", fontWeight: 800 },
1603
+ display: {
1604
+ fontSize: 40,
1605
+ lineHeight: "40px",
1606
+ fontWeight: 800,
1607
+ scaleStep: "450",
1608
+ lineHeightCategory: "display"
1609
+ },
1427
1610
  "body-lg": {
1428
1611
  fontSize: 16,
1429
1612
  lineHeight: "20px",
1430
1613
  fontWeight: 400,
1614
+ scaleStep: "150",
1615
+ lineHeightCategory: "compact",
1431
1616
  accent: { fontWeight: 500 },
1432
- paragraph: { lineHeight: "22px", spacing: 16 }
1617
+ paragraph: {
1618
+ lineHeight: "22px",
1619
+ spacing: 16,
1620
+ lineHeightScaleStep: "150"
1621
+ }
1433
1622
  },
1434
1623
  "body-md": {
1435
1624
  fontSize: 14,
1436
1625
  lineHeight: "18px",
1437
1626
  fontWeight: 400,
1627
+ scaleStep: "125",
1628
+ lineHeightCategory: "compact",
1438
1629
  accent: { fontWeight: 500 },
1439
- paragraph: { lineHeight: "20px", spacing: 12 }
1630
+ paragraph: {
1631
+ lineHeight: "20px",
1632
+ spacing: 12,
1633
+ lineHeightScaleStep: "125"
1634
+ }
1440
1635
  },
1441
1636
  "body-sm": {
1442
1637
  fontSize: 12,
1443
1638
  lineHeight: "16px",
1444
1639
  fontWeight: 400,
1640
+ scaleStep: "100",
1641
+ lineHeightCategory: "compact",
1445
1642
  accent: { fontWeight: 500 },
1446
- paragraph: { lineHeight: "18px", spacing: 8 }
1643
+ paragraph: {
1644
+ lineHeight: "18px",
1645
+ spacing: 8,
1646
+ lineHeightScaleStep: "100"
1647
+ }
1447
1648
  },
1448
1649
  "body-xs": {
1449
1650
  fontSize: 10,
1450
1651
  lineHeight: "14px",
1451
1652
  fontWeight: 400,
1653
+ scaleStep: "75",
1654
+ lineHeightCategory: "compact",
1452
1655
  accent: { fontWeight: 500 },
1453
- paragraph: { lineHeight: "14px", spacing: 6 }
1656
+ paragraph: {
1657
+ lineHeight: "14px",
1658
+ spacing: 6,
1659
+ lineHeightScaleStep: "75"
1660
+ }
1454
1661
  },
1455
1662
  "body-xxs": {
1456
1663
  fontSize: 10,
1457
1664
  lineHeight: "14px",
1458
1665
  fontWeight: 400,
1666
+ scaleStep: "75",
1667
+ lineHeightCategory: "compact",
1459
1668
  accent: { fontWeight: 500 },
1460
- paragraph: { lineHeight: "14px", spacing: 6 }
1669
+ paragraph: {
1670
+ lineHeight: "14px",
1671
+ spacing: 6,
1672
+ lineHeightScaleStep: "75"
1673
+ }
1461
1674
  }
1462
1675
  }
1463
1676
  },
1464
1677
  presentation: {
1465
1678
  heading: {
1466
- h1: { fontSize: 56, lineHeight: "68px", fontWeight: 700 },
1467
- h2: { fontSize: 48, lineHeight: "58px", fontWeight: 700 },
1468
- h3: { fontSize: 40, lineHeight: "48px", fontWeight: 700 },
1469
- h4: { fontSize: 32, lineHeight: "38px", fontWeight: 700 },
1470
- h5: { fontSize: 28, lineHeight: "34px", fontWeight: 700 }
1679
+ h1: {
1680
+ fontSize: 56,
1681
+ lineHeight: "56px",
1682
+ fontWeight: 700,
1683
+ scaleStep: "650",
1684
+ lineHeightCategory: "display"
1685
+ },
1686
+ h2: {
1687
+ fontSize: 48,
1688
+ lineHeight: "48px",
1689
+ fontWeight: 700,
1690
+ scaleStep: "550",
1691
+ lineHeightCategory: "display"
1692
+ },
1693
+ h3: {
1694
+ fontSize: 40,
1695
+ lineHeight: "40px",
1696
+ fontWeight: 700,
1697
+ scaleStep: "450",
1698
+ lineHeightCategory: "display"
1699
+ },
1700
+ h4: {
1701
+ fontSize: 32,
1702
+ lineHeight: "32px",
1703
+ fontWeight: 700,
1704
+ scaleStep: "350",
1705
+ lineHeightCategory: "display"
1706
+ },
1707
+ h5: {
1708
+ fontSize: 28,
1709
+ lineHeight: "28px",
1710
+ fontWeight: 700,
1711
+ scaleStep: "300",
1712
+ lineHeightCategory: "display"
1713
+ }
1471
1714
  },
1472
1715
  basic: {
1473
- display: { fontSize: 64, lineHeight: "78px", fontWeight: 800 },
1716
+ display: {
1717
+ fontSize: 64,
1718
+ lineHeight: "64px",
1719
+ fontWeight: 800,
1720
+ scaleStep: "750",
1721
+ lineHeightCategory: "display"
1722
+ },
1474
1723
  "body-lg": {
1475
1724
  fontSize: 24,
1476
1725
  lineHeight: "30px",
1477
1726
  fontWeight: 400,
1727
+ scaleStep: "250",
1728
+ lineHeightCategory: "compact",
1478
1729
  accent: { fontWeight: 500 },
1479
- paragraph: { lineHeight: "34px", spacing: 24 }
1730
+ paragraph: {
1731
+ lineHeight: "34px",
1732
+ spacing: 24,
1733
+ lineHeightScaleStep: "250"
1734
+ }
1480
1735
  },
1481
1736
  "body-md": {
1482
1737
  fontSize: 20,
1483
1738
  lineHeight: "26px",
1484
1739
  fontWeight: 400,
1740
+ scaleStep: "200",
1741
+ lineHeightCategory: "compact",
1485
1742
  accent: { fontWeight: 500 },
1486
- paragraph: { lineHeight: "28px", spacing: 20 }
1743
+ paragraph: {
1744
+ lineHeight: "28px",
1745
+ spacing: 20,
1746
+ lineHeightScaleStep: "200"
1747
+ }
1487
1748
  },
1488
1749
  "body-sm": {
1489
1750
  fontSize: 18,
1490
1751
  lineHeight: "24px",
1491
1752
  fontWeight: 400,
1753
+ scaleStep: "175",
1754
+ lineHeightCategory: "compact",
1492
1755
  accent: { fontWeight: 500 },
1493
- paragraph: { lineHeight: "26px", spacing: 16 }
1756
+ paragraph: {
1757
+ lineHeight: "26px",
1758
+ spacing: 16,
1759
+ lineHeightScaleStep: "175"
1760
+ }
1494
1761
  },
1495
1762
  "body-xs": {
1496
1763
  fontSize: 16,
1497
1764
  lineHeight: "20px",
1498
1765
  fontWeight: 400,
1766
+ scaleStep: "150",
1767
+ lineHeightCategory: "compact",
1499
1768
  accent: { fontWeight: 500 },
1500
- paragraph: { lineHeight: "22px", spacing: 12 }
1769
+ paragraph: {
1770
+ lineHeight: "22px",
1771
+ spacing: 12,
1772
+ lineHeightScaleStep: "150"
1773
+ }
1501
1774
  },
1502
1775
  "body-xxs": {
1503
1776
  fontSize: 16,
1504
1777
  lineHeight: "20px",
1505
1778
  fontWeight: 400,
1779
+ scaleStep: "150",
1780
+ lineHeightCategory: "compact",
1506
1781
  accent: { fontWeight: 500 },
1507
- paragraph: { lineHeight: "22px", spacing: 12 }
1782
+ paragraph: {
1783
+ lineHeight: "22px",
1784
+ spacing: 12,
1785
+ lineHeightScaleStep: "150"
1786
+ }
1508
1787
  }
1509
1788
  }
1510
1789
  }
@@ -1691,6 +1970,167 @@ var FontLoader = () => {
1691
1970
  };
1692
1971
  FontLoader.displayName = "FontLoader";
1693
1972
 
1973
+ // src/styles/TypographyStyleLoader.tsx
1974
+ var import_react2 = require("react");
1975
+
1976
+ // src/tokens/responsive-typography.ts
1977
+ var SCALE_STEPS = [
1978
+ "75",
1979
+ "100",
1980
+ "125",
1981
+ "150",
1982
+ "175",
1983
+ "200",
1984
+ "250",
1985
+ "300",
1986
+ "350",
1987
+ "450",
1988
+ "550",
1989
+ "650",
1990
+ "750"
1991
+ ];
1992
+ var fontSize = {
1993
+ "75": { common: 10, mobile: 10, desktop: 10 },
1994
+ "100": { common: 12, mobile: 11, desktop: 12 },
1995
+ "125": { common: 14, mobile: 12, desktop: 14 },
1996
+ "150": { common: 16, mobile: 14, desktop: 16 },
1997
+ "175": { common: 18, mobile: 16, desktop: 18 },
1998
+ "200": { common: 20, mobile: 18, desktop: 20 },
1999
+ "250": { common: 24, mobile: 20, desktop: 24 },
2000
+ "300": { common: 28, mobile: 24, desktop: 28 },
2001
+ "350": { common: 32, mobile: 28, desktop: 32 },
2002
+ "450": { common: 40, mobile: 32, desktop: 40 },
2003
+ "550": { common: 48, mobile: 40, desktop: 48 },
2004
+ "650": { common: 56, mobile: 48, desktop: 56 },
2005
+ "750": { common: 64, mobile: 56, desktop: 64 }
2006
+ };
2007
+ var lineHeightDisplay = {
2008
+ "75": { common: 10, mobile: 10, desktop: 10 },
2009
+ "100": { common: 12, mobile: 11, desktop: 12 },
2010
+ "125": { common: 14, mobile: 12, desktop: 14 },
2011
+ "150": { common: 16, mobile: 14, desktop: 16 },
2012
+ "175": { common: 18, mobile: 16, desktop: 18 },
2013
+ "200": { common: 20, mobile: 18, desktop: 20 },
2014
+ "250": { common: 24, mobile: 20, desktop: 24 },
2015
+ "300": { common: 28, mobile: 24, desktop: 28 },
2016
+ "350": { common: 32, mobile: 28, desktop: 32 },
2017
+ "450": { common: 40, mobile: 32, desktop: 40 },
2018
+ "550": { common: 48, mobile: 40, desktop: 48 },
2019
+ "650": { common: 56, mobile: 48, desktop: 56 },
2020
+ "750": { common: 64, mobile: 56, desktop: 64 }
2021
+ };
2022
+ var lineHeightCompact = {
2023
+ "75": { common: 14, mobile: 13, desktop: 14 },
2024
+ "100": { common: 16, mobile: 14, desktop: 16 },
2025
+ "125": { common: 18, mobile: 16, desktop: 18 },
2026
+ "150": { common: 20, mobile: 18, desktop: 20 },
2027
+ "175": { common: 24, mobile: 20, desktop: 24 },
2028
+ "200": { common: 26, mobile: 24, desktop: 26 },
2029
+ "250": { common: 30, mobile: 26, desktop: 30 },
2030
+ "300": { common: 36, mobile: 30, desktop: 36 },
2031
+ "350": { common: 42, mobile: 36, desktop: 42 },
2032
+ "450": { common: 52, mobile: 42, desktop: 52 },
2033
+ "550": { common: 62, mobile: 52, desktop: 62 },
2034
+ "650": { common: 72, mobile: 62, desktop: 72 },
2035
+ "750": { common: 82, mobile: 72, desktop: 82 }
2036
+ };
2037
+ var lineHeightText = {
2038
+ "75": { common: 14, mobile: 13, desktop: 14 },
2039
+ "100": { common: 18, mobile: 14, desktop: 18 },
2040
+ "125": { common: 20, mobile: 16, desktop: 20 },
2041
+ "150": { common: 22, mobile: 18, desktop: 22 },
2042
+ "175": { common: 26, mobile: 20, desktop: 26 },
2043
+ "200": { common: 28, mobile: 24, desktop: 28 },
2044
+ "250": { common: 34, mobile: 26, desktop: 34 },
2045
+ "300": { common: 40, mobile: 30, desktop: 40 },
2046
+ "350": { common: 44, mobile: 36, desktop: 44 },
2047
+ "450": { common: 56, mobile: 42, desktop: 56 },
2048
+ "550": { common: 66, mobile: 52, desktop: 66 },
2049
+ "650": { common: 78, mobile: 62, desktop: 78 },
2050
+ "750": { common: 88, mobile: 72, desktop: 88 }
2051
+ };
2052
+ var responsiveTypographyScale = {
2053
+ fontSize,
2054
+ lineHeightDisplay,
2055
+ lineHeightCompact,
2056
+ lineHeightText
2057
+ };
2058
+
2059
+ // src/tokens/breakpoints.ts
2060
+ var breakpoints = {
2061
+ /** Mobile: 0 – 767px */
2062
+ mobile: 0,
2063
+ /** Desktop: 768px and above */
2064
+ desktop: 768
2065
+ };
2066
+ var MOBILE_MAX_WIDTH = breakpoints.desktop - 1;
2067
+
2068
+ // src/styles/typography-css.ts
2069
+ function buildDeclarations(mode) {
2070
+ const lines = [];
2071
+ for (const step of SCALE_STEPS) {
2072
+ const fs = fontSize[step];
2073
+ lines.push(
2074
+ `--xui-font-size-${step}:${fs[mode === "desktop" ? "common" : "mobile"]}px`
2075
+ );
2076
+ }
2077
+ for (const step of SCALE_STEPS) {
2078
+ const lh = lineHeightDisplay[step];
2079
+ lines.push(
2080
+ `--xui-lh-display-${step}:${lh[mode === "desktop" ? "common" : "mobile"]}px`
2081
+ );
2082
+ }
2083
+ for (const step of SCALE_STEPS) {
2084
+ const lh = lineHeightCompact[step];
2085
+ lines.push(
2086
+ `--xui-lh-compact-${step}:${lh[mode === "desktop" ? "common" : "mobile"]}px`
2087
+ );
2088
+ }
2089
+ for (const step of SCALE_STEPS) {
2090
+ const lh = lineHeightText[step];
2091
+ lines.push(
2092
+ `--xui-lh-text-${step}:${lh[mode === "desktop" ? "common" : "mobile"]}px`
2093
+ );
2094
+ }
2095
+ return lines.join(";");
2096
+ }
2097
+ var _cached = null;
2098
+ function generateTypographyCSS() {
2099
+ if (_cached) return _cached;
2100
+ const desktopVars = buildDeclarations("desktop");
2101
+ const mobileVars = buildDeclarations("mobile");
2102
+ _cached = `:root{${desktopVars}}@media(max-width:${MOBILE_MAX_WIDTH}px){:root{${mobileVars}}}`;
2103
+ return _cached;
2104
+ }
2105
+ var cssVar = {
2106
+ fontSize: (step) => `var(--xui-font-size-${step})`,
2107
+ lhDisplay: (step) => `var(--xui-lh-display-${step})`,
2108
+ lhCompact: (step) => `var(--xui-lh-compact-${step})`,
2109
+ lhText: (step) => `var(--xui-lh-text-${step})`
2110
+ };
2111
+
2112
+ // src/styles/TypographyStyleLoader.tsx
2113
+ var injected2 = false;
2114
+ function injectTypographyStyles() {
2115
+ if (!isWeb || injected2) return;
2116
+ const style = document.createElement("style");
2117
+ style.setAttribute("data-xui-typography", "");
2118
+ style.textContent = generateTypographyCSS();
2119
+ document.head.appendChild(style);
2120
+ injected2 = true;
2121
+ }
2122
+ var TypographyStyleLoader = () => {
2123
+ const mountedRef = (0, import_react2.useRef)(false);
2124
+ (0, import_react2.useEffect)(() => {
2125
+ if (!mountedRef.current) {
2126
+ injectTypographyStyles();
2127
+ mountedRef.current = true;
2128
+ }
2129
+ }, []);
2130
+ return null;
2131
+ };
2132
+ TypographyStyleLoader.displayName = "TypographyStyleLoader";
2133
+
1694
2134
  // src/index.tsx
1695
2135
  var import_jsx_runtime = require("react/jsx-runtime");
1696
2136
  var DEPRECATED_MODES = /* @__PURE__ */ new Set([
@@ -2653,7 +3093,7 @@ var themeConfig = (mode = "dark", productContext = defaultProductContext) => {
2653
3093
  },
2654
3094
  modal: () => {
2655
3095
  return {
2656
- borderRadius: 12,
3096
+ borderRadius: 8,
2657
3097
  headerPadding: 8,
2658
3098
  contentPadding: 40,
2659
3099
  headerButtonSize: "xl",
@@ -2740,7 +3180,7 @@ var themeConfig = (mode = "dark", productContext = defaultProductContext) => {
2740
3180
  }
2741
3181
  };
2742
3182
  };
2743
- var DesignSystemContext = (0, import_react2.createContext)(
3183
+ var DesignSystemContext = (0, import_react3.createContext)(
2744
3184
  void 0
2745
3185
  );
2746
3186
  var XUIProvider = ({
@@ -2749,11 +3189,11 @@ var XUIProvider = ({
2749
3189
  initialProductContext = defaultProductContext,
2750
3190
  loadFonts = true
2751
3191
  }) => {
2752
- const [mode, setMode] = (0, import_react2.useState)(initialMode);
2753
- const [productContext, setProductContext] = (0, import_react2.useState)(
3192
+ const [mode, setMode] = (0, import_react3.useState)(initialMode);
3193
+ const [productContext, setProductContext] = (0, import_react3.useState)(
2754
3194
  initialProductContext
2755
3195
  );
2756
- const value = (0, import_react2.useMemo)(
3196
+ const value = (0, import_react3.useMemo)(
2757
3197
  () => ({
2758
3198
  mode,
2759
3199
  setMode,
@@ -2765,11 +3205,12 @@ var XUIProvider = ({
2765
3205
  );
2766
3206
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DesignSystemContext.Provider, { value, children: [
2767
3207
  loadFonts && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FontLoader, {}),
3208
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TypographyStyleLoader, {}),
2768
3209
  children
2769
3210
  ] });
2770
3211
  };
2771
3212
  var useDesignSystem = () => {
2772
- const context = (0, import_react2.useContext)(DesignSystemContext);
3213
+ const context = (0, import_react3.useContext)(DesignSystemContext);
2773
3214
  if (!context) {
2774
3215
  return {
2775
3216
  mode: "dark",
@@ -2787,7 +3228,7 @@ var useResolvedTheme = (overrides) => {
2787
3228
  const context = useDesignSystem();
2788
3229
  const resolvedMode = overrides?.themeMode ?? context.mode;
2789
3230
  const resolvedProductContext = overrides?.themeProductContext ?? context.productContext;
2790
- const theme = (0, import_react2.useMemo)(() => {
3231
+ const theme = (0, import_react3.useMemo)(() => {
2791
3232
  if (resolvedMode === context.mode && resolvedProductContext === context.productContext) {
2792
3233
  return context.theme;
2793
3234
  }
@@ -2807,23 +3248,30 @@ var useResolvedTheme = (overrides) => {
2807
3248
  };
2808
3249
  };
2809
3250
  var idCounter = 0;
2810
- var hasReactUseId = typeof import_react2.default.useId === "function";
3251
+ var hasReactUseId = typeof import_react3.default.useId === "function";
2811
3252
  var useIdFallback = () => {
2812
- const [id] = (0, import_react2.useState)(() => `xui-${++idCounter}`);
3253
+ const [id] = (0, import_react3.useState)(() => `xui-${++idCounter}`);
2813
3254
  return id;
2814
3255
  };
2815
- var useId = hasReactUseId ? import_react2.default.useId : useIdFallback;
2816
- var ModalIdContext = (0, import_react2.createContext)(null);
2817
- var useModalId = () => (0, import_react2.useContext)(ModalIdContext);
3256
+ var useId = hasReactUseId ? import_react3.default.useId : useIdFallback;
3257
+ var ModalIdContext = (0, import_react3.createContext)(null);
3258
+ var useModalId = () => (0, import_react3.useContext)(ModalIdContext);
2818
3259
  // Annotate the CommonJS export names for ESM import in node:
2819
3260
  0 && (module.exports = {
2820
3261
  FontLoader,
3262
+ MOBILE_MAX_WIDTH,
2821
3263
  ModalIdContext,
3264
+ SCALE_STEPS,
3265
+ TypographyStyleLoader,
2822
3266
  XUIProvider,
3267
+ breakpoints,
2823
3268
  colors,
3269
+ cssVar,
2824
3270
  defaultProductContext,
2825
3271
  fontFacesCSS,
3272
+ fontSize,
2826
3273
  fonts,
3274
+ generateTypographyCSS,
2827
3275
  getFonts,
2828
3276
  getTypographyTokens,
2829
3277
  getTypographyVariant,
@@ -2831,7 +3279,11 @@ var useModalId = () => (0, import_react2.useContext)(ModalIdContext);
2831
3279
  isIOS,
2832
3280
  isNative,
2833
3281
  isWeb,
3282
+ lineHeightCompact,
3283
+ lineHeightDisplay,
3284
+ lineHeightText,
2834
3285
  radius,
3286
+ responsiveTypographyScale,
2835
3287
  shadow,
2836
3288
  spacing,
2837
3289
  themeConfig,