@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/README.md +6 -0
- package/index.d.mts +149 -1
- package/index.d.ts +149 -1
- package/index.js +509 -57
- package/index.js.map +1 -1
- package/index.mjs +489 -48
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.tsx
|
|
2
|
-
import
|
|
2
|
+
import React3, { createContext, useContext, useState, useMemo } from "react";
|
|
3
3
|
|
|
4
4
|
// src/tokens/pentagram-dark.json
|
|
5
5
|
var pentagram_dark_default = {
|
|
@@ -1245,12 +1245,16 @@ var bodyFont = `"Aktiv Grotesk", "Noto Sans", "Montserrat", ${FALLBACK}`;
|
|
|
1245
1245
|
var fonts = {
|
|
1246
1246
|
heading: displayFontByContext.b2b,
|
|
1247
1247
|
body: bodyFont,
|
|
1248
|
+
/** Paragraph/reading font — same families as body */
|
|
1249
|
+
text: bodyFont,
|
|
1248
1250
|
/** @deprecated Use `heading` or `body` instead */
|
|
1249
1251
|
primary: bodyFont
|
|
1250
1252
|
};
|
|
1251
1253
|
var getFonts = (productContext = "b2b") => ({
|
|
1252
1254
|
heading: displayFontByContext[productContext],
|
|
1253
1255
|
body: bodyFont,
|
|
1256
|
+
/** Paragraph/reading font — same families as body */
|
|
1257
|
+
text: bodyFont,
|
|
1254
1258
|
/** @deprecated Use `heading` or `body` instead */
|
|
1255
1259
|
primary: bodyFont
|
|
1256
1260
|
});
|
|
@@ -1265,189 +1269,453 @@ var typography = {
|
|
|
1265
1269
|
var typographyTokens = {
|
|
1266
1270
|
b2c: {
|
|
1267
1271
|
heading: {
|
|
1268
|
-
h1: {
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1272
|
+
h1: {
|
|
1273
|
+
fontSize: 40,
|
|
1274
|
+
lineHeight: "40px",
|
|
1275
|
+
fontWeight: 700,
|
|
1276
|
+
scaleStep: "450",
|
|
1277
|
+
lineHeightCategory: "display"
|
|
1278
|
+
},
|
|
1279
|
+
h2: {
|
|
1280
|
+
fontSize: 32,
|
|
1281
|
+
lineHeight: "32px",
|
|
1282
|
+
fontWeight: 700,
|
|
1283
|
+
scaleStep: "350",
|
|
1284
|
+
lineHeightCategory: "display"
|
|
1285
|
+
},
|
|
1286
|
+
h3: {
|
|
1287
|
+
fontSize: 28,
|
|
1288
|
+
lineHeight: "28px",
|
|
1289
|
+
fontWeight: 700,
|
|
1290
|
+
scaleStep: "300",
|
|
1291
|
+
lineHeightCategory: "display"
|
|
1292
|
+
},
|
|
1293
|
+
h4: {
|
|
1294
|
+
fontSize: 24,
|
|
1295
|
+
lineHeight: "24px",
|
|
1296
|
+
fontWeight: 700,
|
|
1297
|
+
scaleStep: "250",
|
|
1298
|
+
lineHeightCategory: "display"
|
|
1299
|
+
},
|
|
1300
|
+
h5: {
|
|
1301
|
+
fontSize: 20,
|
|
1302
|
+
lineHeight: "20px",
|
|
1303
|
+
fontWeight: 700,
|
|
1304
|
+
scaleStep: "200",
|
|
1305
|
+
lineHeightCategory: "display"
|
|
1306
|
+
}
|
|
1273
1307
|
},
|
|
1274
1308
|
basic: {
|
|
1275
|
-
display: {
|
|
1309
|
+
display: {
|
|
1310
|
+
fontSize: 48,
|
|
1311
|
+
lineHeight: "48px",
|
|
1312
|
+
fontWeight: 800,
|
|
1313
|
+
scaleStep: "550",
|
|
1314
|
+
lineHeightCategory: "display"
|
|
1315
|
+
},
|
|
1276
1316
|
"body-lg": {
|
|
1277
1317
|
fontSize: 18,
|
|
1278
1318
|
lineHeight: "24px",
|
|
1279
1319
|
fontWeight: 400,
|
|
1320
|
+
scaleStep: "175",
|
|
1321
|
+
lineHeightCategory: "compact",
|
|
1280
1322
|
accent: { fontWeight: 500 },
|
|
1281
|
-
paragraph: {
|
|
1323
|
+
paragraph: {
|
|
1324
|
+
lineHeight: "26px",
|
|
1325
|
+
spacing: 20,
|
|
1326
|
+
lineHeightScaleStep: "175"
|
|
1327
|
+
}
|
|
1282
1328
|
},
|
|
1283
1329
|
"body-md": {
|
|
1284
1330
|
fontSize: 16,
|
|
1285
1331
|
lineHeight: "20px",
|
|
1286
1332
|
fontWeight: 400,
|
|
1333
|
+
scaleStep: "150",
|
|
1334
|
+
lineHeightCategory: "compact",
|
|
1287
1335
|
accent: { fontWeight: 500 },
|
|
1288
|
-
paragraph: {
|
|
1336
|
+
paragraph: {
|
|
1337
|
+
lineHeight: "22px",
|
|
1338
|
+
spacing: 16,
|
|
1339
|
+
lineHeightScaleStep: "150"
|
|
1340
|
+
}
|
|
1289
1341
|
},
|
|
1290
1342
|
"body-sm": {
|
|
1291
1343
|
fontSize: 14,
|
|
1292
1344
|
lineHeight: "18px",
|
|
1293
1345
|
fontWeight: 400,
|
|
1346
|
+
scaleStep: "125",
|
|
1347
|
+
lineHeightCategory: "compact",
|
|
1294
1348
|
accent: { fontWeight: 500 },
|
|
1295
|
-
paragraph: {
|
|
1349
|
+
paragraph: {
|
|
1350
|
+
lineHeight: "20px",
|
|
1351
|
+
spacing: 12,
|
|
1352
|
+
lineHeightScaleStep: "125"
|
|
1353
|
+
}
|
|
1296
1354
|
},
|
|
1297
1355
|
"body-xs": {
|
|
1298
1356
|
fontSize: 12,
|
|
1299
1357
|
lineHeight: "16px",
|
|
1300
1358
|
fontWeight: 400,
|
|
1359
|
+
scaleStep: "100",
|
|
1360
|
+
lineHeightCategory: "compact",
|
|
1301
1361
|
accent: { fontWeight: 500 },
|
|
1302
|
-
paragraph: {
|
|
1362
|
+
paragraph: {
|
|
1363
|
+
lineHeight: "18px",
|
|
1364
|
+
spacing: 8,
|
|
1365
|
+
lineHeightScaleStep: "100"
|
|
1366
|
+
}
|
|
1303
1367
|
},
|
|
1304
1368
|
"body-xxs": {
|
|
1305
1369
|
fontSize: 10,
|
|
1306
1370
|
lineHeight: "14px",
|
|
1307
1371
|
fontWeight: 400,
|
|
1372
|
+
scaleStep: "75",
|
|
1373
|
+
lineHeightCategory: "compact",
|
|
1308
1374
|
accent: { fontWeight: 500 },
|
|
1309
|
-
paragraph: {
|
|
1375
|
+
paragraph: {
|
|
1376
|
+
lineHeight: "14px",
|
|
1377
|
+
spacing: 6,
|
|
1378
|
+
lineHeightScaleStep: "75"
|
|
1379
|
+
}
|
|
1310
1380
|
}
|
|
1311
1381
|
}
|
|
1312
1382
|
},
|
|
1313
1383
|
b2b: {
|
|
1314
1384
|
heading: {
|
|
1315
|
-
h1: {
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1385
|
+
h1: {
|
|
1386
|
+
fontSize: 56,
|
|
1387
|
+
lineHeight: "56px",
|
|
1388
|
+
fontWeight: 400,
|
|
1389
|
+
scaleStep: "650",
|
|
1390
|
+
lineHeightCategory: "display"
|
|
1391
|
+
},
|
|
1392
|
+
h2: {
|
|
1393
|
+
fontSize: 48,
|
|
1394
|
+
lineHeight: "48px",
|
|
1395
|
+
fontWeight: 400,
|
|
1396
|
+
scaleStep: "550",
|
|
1397
|
+
lineHeightCategory: "display"
|
|
1398
|
+
},
|
|
1399
|
+
h3: {
|
|
1400
|
+
fontSize: 32,
|
|
1401
|
+
lineHeight: "32px",
|
|
1402
|
+
fontWeight: 400,
|
|
1403
|
+
scaleStep: "350",
|
|
1404
|
+
lineHeightCategory: "display"
|
|
1405
|
+
},
|
|
1406
|
+
h4: {
|
|
1407
|
+
fontSize: 24,
|
|
1408
|
+
lineHeight: "24px",
|
|
1409
|
+
fontWeight: 400,
|
|
1410
|
+
scaleStep: "250",
|
|
1411
|
+
lineHeightCategory: "display"
|
|
1412
|
+
},
|
|
1413
|
+
h5: {
|
|
1414
|
+
fontSize: 20,
|
|
1415
|
+
lineHeight: "20px",
|
|
1416
|
+
fontWeight: 600,
|
|
1417
|
+
scaleStep: "200",
|
|
1418
|
+
lineHeightCategory: "display"
|
|
1419
|
+
}
|
|
1320
1420
|
},
|
|
1321
1421
|
basic: {
|
|
1322
|
-
display: {
|
|
1422
|
+
display: {
|
|
1423
|
+
fontSize: 64,
|
|
1424
|
+
lineHeight: "64px",
|
|
1425
|
+
fontWeight: 400,
|
|
1426
|
+
scaleStep: "750",
|
|
1427
|
+
lineHeightCategory: "display"
|
|
1428
|
+
},
|
|
1323
1429
|
"body-lg": {
|
|
1324
1430
|
fontSize: 18,
|
|
1325
1431
|
lineHeight: "24px",
|
|
1326
1432
|
fontWeight: 400,
|
|
1433
|
+
scaleStep: "175",
|
|
1434
|
+
lineHeightCategory: "compact",
|
|
1327
1435
|
accent: { fontWeight: 500 },
|
|
1328
|
-
paragraph: {
|
|
1436
|
+
paragraph: {
|
|
1437
|
+
lineHeight: "26px",
|
|
1438
|
+
spacing: 20,
|
|
1439
|
+
lineHeightScaleStep: "175"
|
|
1440
|
+
}
|
|
1329
1441
|
},
|
|
1330
1442
|
"body-md": {
|
|
1331
1443
|
fontSize: 16,
|
|
1332
1444
|
lineHeight: "20px",
|
|
1333
1445
|
fontWeight: 400,
|
|
1446
|
+
scaleStep: "150",
|
|
1447
|
+
lineHeightCategory: "compact",
|
|
1334
1448
|
accent: { fontWeight: 500 },
|
|
1335
|
-
paragraph: {
|
|
1449
|
+
paragraph: {
|
|
1450
|
+
lineHeight: "22px",
|
|
1451
|
+
spacing: 16,
|
|
1452
|
+
lineHeightScaleStep: "150"
|
|
1453
|
+
}
|
|
1336
1454
|
},
|
|
1337
1455
|
"body-sm": {
|
|
1338
1456
|
fontSize: 14,
|
|
1339
1457
|
lineHeight: "18px",
|
|
1340
1458
|
fontWeight: 400,
|
|
1459
|
+
scaleStep: "125",
|
|
1460
|
+
lineHeightCategory: "compact",
|
|
1341
1461
|
accent: { fontWeight: 500 },
|
|
1342
|
-
paragraph: {
|
|
1462
|
+
paragraph: {
|
|
1463
|
+
lineHeight: "20px",
|
|
1464
|
+
spacing: 12,
|
|
1465
|
+
lineHeightScaleStep: "125"
|
|
1466
|
+
}
|
|
1343
1467
|
},
|
|
1344
1468
|
"body-xs": {
|
|
1345
1469
|
fontSize: 12,
|
|
1346
1470
|
lineHeight: "16px",
|
|
1347
1471
|
fontWeight: 400,
|
|
1472
|
+
scaleStep: "100",
|
|
1473
|
+
lineHeightCategory: "compact",
|
|
1348
1474
|
accent: { fontWeight: 500 },
|
|
1349
|
-
paragraph: {
|
|
1475
|
+
paragraph: {
|
|
1476
|
+
lineHeight: "18px",
|
|
1477
|
+
spacing: 8,
|
|
1478
|
+
lineHeightScaleStep: "100"
|
|
1479
|
+
}
|
|
1350
1480
|
},
|
|
1351
1481
|
"body-xxs": {
|
|
1352
1482
|
fontSize: 10,
|
|
1353
1483
|
lineHeight: "14px",
|
|
1354
1484
|
fontWeight: 400,
|
|
1485
|
+
scaleStep: "75",
|
|
1486
|
+
lineHeightCategory: "compact",
|
|
1355
1487
|
accent: { fontWeight: 500 },
|
|
1356
|
-
paragraph: {
|
|
1488
|
+
paragraph: {
|
|
1489
|
+
lineHeight: "14px",
|
|
1490
|
+
spacing: 6,
|
|
1491
|
+
lineHeightScaleStep: "75"
|
|
1492
|
+
}
|
|
1357
1493
|
}
|
|
1358
1494
|
}
|
|
1359
1495
|
},
|
|
1360
1496
|
paystation: {
|
|
1361
1497
|
heading: {
|
|
1362
|
-
h1: {
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1498
|
+
h1: {
|
|
1499
|
+
fontSize: 28,
|
|
1500
|
+
lineHeight: "28px",
|
|
1501
|
+
fontWeight: 700,
|
|
1502
|
+
scaleStep: "300",
|
|
1503
|
+
lineHeightCategory: "display"
|
|
1504
|
+
},
|
|
1505
|
+
h2: {
|
|
1506
|
+
fontSize: 24,
|
|
1507
|
+
lineHeight: "24px",
|
|
1508
|
+
fontWeight: 700,
|
|
1509
|
+
scaleStep: "250",
|
|
1510
|
+
lineHeightCategory: "display"
|
|
1511
|
+
},
|
|
1512
|
+
h3: {
|
|
1513
|
+
fontSize: 20,
|
|
1514
|
+
lineHeight: "20px",
|
|
1515
|
+
fontWeight: 700,
|
|
1516
|
+
scaleStep: "200",
|
|
1517
|
+
lineHeightCategory: "display"
|
|
1518
|
+
},
|
|
1519
|
+
h4: {
|
|
1520
|
+
fontSize: 18,
|
|
1521
|
+
lineHeight: "18px",
|
|
1522
|
+
fontWeight: 700,
|
|
1523
|
+
scaleStep: "175",
|
|
1524
|
+
lineHeightCategory: "display"
|
|
1525
|
+
},
|
|
1526
|
+
h5: {
|
|
1527
|
+
fontSize: 16,
|
|
1528
|
+
lineHeight: "16px",
|
|
1529
|
+
fontWeight: 700,
|
|
1530
|
+
scaleStep: "150",
|
|
1531
|
+
lineHeightCategory: "display"
|
|
1532
|
+
}
|
|
1367
1533
|
},
|
|
1368
1534
|
basic: {
|
|
1369
|
-
display: {
|
|
1535
|
+
display: {
|
|
1536
|
+
fontSize: 40,
|
|
1537
|
+
lineHeight: "40px",
|
|
1538
|
+
fontWeight: 800,
|
|
1539
|
+
scaleStep: "450",
|
|
1540
|
+
lineHeightCategory: "display"
|
|
1541
|
+
},
|
|
1370
1542
|
"body-lg": {
|
|
1371
1543
|
fontSize: 16,
|
|
1372
1544
|
lineHeight: "20px",
|
|
1373
1545
|
fontWeight: 400,
|
|
1546
|
+
scaleStep: "150",
|
|
1547
|
+
lineHeightCategory: "compact",
|
|
1374
1548
|
accent: { fontWeight: 500 },
|
|
1375
|
-
paragraph: {
|
|
1549
|
+
paragraph: {
|
|
1550
|
+
lineHeight: "22px",
|
|
1551
|
+
spacing: 16,
|
|
1552
|
+
lineHeightScaleStep: "150"
|
|
1553
|
+
}
|
|
1376
1554
|
},
|
|
1377
1555
|
"body-md": {
|
|
1378
1556
|
fontSize: 14,
|
|
1379
1557
|
lineHeight: "18px",
|
|
1380
1558
|
fontWeight: 400,
|
|
1559
|
+
scaleStep: "125",
|
|
1560
|
+
lineHeightCategory: "compact",
|
|
1381
1561
|
accent: { fontWeight: 500 },
|
|
1382
|
-
paragraph: {
|
|
1562
|
+
paragraph: {
|
|
1563
|
+
lineHeight: "20px",
|
|
1564
|
+
spacing: 12,
|
|
1565
|
+
lineHeightScaleStep: "125"
|
|
1566
|
+
}
|
|
1383
1567
|
},
|
|
1384
1568
|
"body-sm": {
|
|
1385
1569
|
fontSize: 12,
|
|
1386
1570
|
lineHeight: "16px",
|
|
1387
1571
|
fontWeight: 400,
|
|
1572
|
+
scaleStep: "100",
|
|
1573
|
+
lineHeightCategory: "compact",
|
|
1388
1574
|
accent: { fontWeight: 500 },
|
|
1389
|
-
paragraph: {
|
|
1575
|
+
paragraph: {
|
|
1576
|
+
lineHeight: "18px",
|
|
1577
|
+
spacing: 8,
|
|
1578
|
+
lineHeightScaleStep: "100"
|
|
1579
|
+
}
|
|
1390
1580
|
},
|
|
1391
1581
|
"body-xs": {
|
|
1392
1582
|
fontSize: 10,
|
|
1393
1583
|
lineHeight: "14px",
|
|
1394
1584
|
fontWeight: 400,
|
|
1585
|
+
scaleStep: "75",
|
|
1586
|
+
lineHeightCategory: "compact",
|
|
1395
1587
|
accent: { fontWeight: 500 },
|
|
1396
|
-
paragraph: {
|
|
1588
|
+
paragraph: {
|
|
1589
|
+
lineHeight: "14px",
|
|
1590
|
+
spacing: 6,
|
|
1591
|
+
lineHeightScaleStep: "75"
|
|
1592
|
+
}
|
|
1397
1593
|
},
|
|
1398
1594
|
"body-xxs": {
|
|
1399
1595
|
fontSize: 10,
|
|
1400
1596
|
lineHeight: "14px",
|
|
1401
1597
|
fontWeight: 400,
|
|
1598
|
+
scaleStep: "75",
|
|
1599
|
+
lineHeightCategory: "compact",
|
|
1402
1600
|
accent: { fontWeight: 500 },
|
|
1403
|
-
paragraph: {
|
|
1601
|
+
paragraph: {
|
|
1602
|
+
lineHeight: "14px",
|
|
1603
|
+
spacing: 6,
|
|
1604
|
+
lineHeightScaleStep: "75"
|
|
1605
|
+
}
|
|
1404
1606
|
}
|
|
1405
1607
|
}
|
|
1406
1608
|
},
|
|
1407
1609
|
presentation: {
|
|
1408
1610
|
heading: {
|
|
1409
|
-
h1: {
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1611
|
+
h1: {
|
|
1612
|
+
fontSize: 56,
|
|
1613
|
+
lineHeight: "56px",
|
|
1614
|
+
fontWeight: 700,
|
|
1615
|
+
scaleStep: "650",
|
|
1616
|
+
lineHeightCategory: "display"
|
|
1617
|
+
},
|
|
1618
|
+
h2: {
|
|
1619
|
+
fontSize: 48,
|
|
1620
|
+
lineHeight: "48px",
|
|
1621
|
+
fontWeight: 700,
|
|
1622
|
+
scaleStep: "550",
|
|
1623
|
+
lineHeightCategory: "display"
|
|
1624
|
+
},
|
|
1625
|
+
h3: {
|
|
1626
|
+
fontSize: 40,
|
|
1627
|
+
lineHeight: "40px",
|
|
1628
|
+
fontWeight: 700,
|
|
1629
|
+
scaleStep: "450",
|
|
1630
|
+
lineHeightCategory: "display"
|
|
1631
|
+
},
|
|
1632
|
+
h4: {
|
|
1633
|
+
fontSize: 32,
|
|
1634
|
+
lineHeight: "32px",
|
|
1635
|
+
fontWeight: 700,
|
|
1636
|
+
scaleStep: "350",
|
|
1637
|
+
lineHeightCategory: "display"
|
|
1638
|
+
},
|
|
1639
|
+
h5: {
|
|
1640
|
+
fontSize: 28,
|
|
1641
|
+
lineHeight: "28px",
|
|
1642
|
+
fontWeight: 700,
|
|
1643
|
+
scaleStep: "300",
|
|
1644
|
+
lineHeightCategory: "display"
|
|
1645
|
+
}
|
|
1414
1646
|
},
|
|
1415
1647
|
basic: {
|
|
1416
|
-
display: {
|
|
1648
|
+
display: {
|
|
1649
|
+
fontSize: 64,
|
|
1650
|
+
lineHeight: "64px",
|
|
1651
|
+
fontWeight: 800,
|
|
1652
|
+
scaleStep: "750",
|
|
1653
|
+
lineHeightCategory: "display"
|
|
1654
|
+
},
|
|
1417
1655
|
"body-lg": {
|
|
1418
1656
|
fontSize: 24,
|
|
1419
1657
|
lineHeight: "30px",
|
|
1420
1658
|
fontWeight: 400,
|
|
1659
|
+
scaleStep: "250",
|
|
1660
|
+
lineHeightCategory: "compact",
|
|
1421
1661
|
accent: { fontWeight: 500 },
|
|
1422
|
-
paragraph: {
|
|
1662
|
+
paragraph: {
|
|
1663
|
+
lineHeight: "34px",
|
|
1664
|
+
spacing: 24,
|
|
1665
|
+
lineHeightScaleStep: "250"
|
|
1666
|
+
}
|
|
1423
1667
|
},
|
|
1424
1668
|
"body-md": {
|
|
1425
1669
|
fontSize: 20,
|
|
1426
1670
|
lineHeight: "26px",
|
|
1427
1671
|
fontWeight: 400,
|
|
1672
|
+
scaleStep: "200",
|
|
1673
|
+
lineHeightCategory: "compact",
|
|
1428
1674
|
accent: { fontWeight: 500 },
|
|
1429
|
-
paragraph: {
|
|
1675
|
+
paragraph: {
|
|
1676
|
+
lineHeight: "28px",
|
|
1677
|
+
spacing: 20,
|
|
1678
|
+
lineHeightScaleStep: "200"
|
|
1679
|
+
}
|
|
1430
1680
|
},
|
|
1431
1681
|
"body-sm": {
|
|
1432
1682
|
fontSize: 18,
|
|
1433
1683
|
lineHeight: "24px",
|
|
1434
1684
|
fontWeight: 400,
|
|
1685
|
+
scaleStep: "175",
|
|
1686
|
+
lineHeightCategory: "compact",
|
|
1435
1687
|
accent: { fontWeight: 500 },
|
|
1436
|
-
paragraph: {
|
|
1688
|
+
paragraph: {
|
|
1689
|
+
lineHeight: "26px",
|
|
1690
|
+
spacing: 16,
|
|
1691
|
+
lineHeightScaleStep: "175"
|
|
1692
|
+
}
|
|
1437
1693
|
},
|
|
1438
1694
|
"body-xs": {
|
|
1439
1695
|
fontSize: 16,
|
|
1440
1696
|
lineHeight: "20px",
|
|
1441
1697
|
fontWeight: 400,
|
|
1698
|
+
scaleStep: "150",
|
|
1699
|
+
lineHeightCategory: "compact",
|
|
1442
1700
|
accent: { fontWeight: 500 },
|
|
1443
|
-
paragraph: {
|
|
1701
|
+
paragraph: {
|
|
1702
|
+
lineHeight: "22px",
|
|
1703
|
+
spacing: 12,
|
|
1704
|
+
lineHeightScaleStep: "150"
|
|
1705
|
+
}
|
|
1444
1706
|
},
|
|
1445
1707
|
"body-xxs": {
|
|
1446
1708
|
fontSize: 16,
|
|
1447
1709
|
lineHeight: "20px",
|
|
1448
1710
|
fontWeight: 400,
|
|
1711
|
+
scaleStep: "150",
|
|
1712
|
+
lineHeightCategory: "compact",
|
|
1449
1713
|
accent: { fontWeight: 500 },
|
|
1450
|
-
paragraph: {
|
|
1714
|
+
paragraph: {
|
|
1715
|
+
lineHeight: "22px",
|
|
1716
|
+
spacing: 12,
|
|
1717
|
+
lineHeightScaleStep: "150"
|
|
1718
|
+
}
|
|
1451
1719
|
}
|
|
1452
1720
|
}
|
|
1453
1721
|
}
|
|
@@ -1634,6 +1902,167 @@ var FontLoader = () => {
|
|
|
1634
1902
|
};
|
|
1635
1903
|
FontLoader.displayName = "FontLoader";
|
|
1636
1904
|
|
|
1905
|
+
// src/styles/TypographyStyleLoader.tsx
|
|
1906
|
+
import { useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
1907
|
+
|
|
1908
|
+
// src/tokens/responsive-typography.ts
|
|
1909
|
+
var SCALE_STEPS = [
|
|
1910
|
+
"75",
|
|
1911
|
+
"100",
|
|
1912
|
+
"125",
|
|
1913
|
+
"150",
|
|
1914
|
+
"175",
|
|
1915
|
+
"200",
|
|
1916
|
+
"250",
|
|
1917
|
+
"300",
|
|
1918
|
+
"350",
|
|
1919
|
+
"450",
|
|
1920
|
+
"550",
|
|
1921
|
+
"650",
|
|
1922
|
+
"750"
|
|
1923
|
+
];
|
|
1924
|
+
var fontSize = {
|
|
1925
|
+
"75": { common: 10, mobile: 10, desktop: 10 },
|
|
1926
|
+
"100": { common: 12, mobile: 11, desktop: 12 },
|
|
1927
|
+
"125": { common: 14, mobile: 12, desktop: 14 },
|
|
1928
|
+
"150": { common: 16, mobile: 14, desktop: 16 },
|
|
1929
|
+
"175": { common: 18, mobile: 16, desktop: 18 },
|
|
1930
|
+
"200": { common: 20, mobile: 18, desktop: 20 },
|
|
1931
|
+
"250": { common: 24, mobile: 20, desktop: 24 },
|
|
1932
|
+
"300": { common: 28, mobile: 24, desktop: 28 },
|
|
1933
|
+
"350": { common: 32, mobile: 28, desktop: 32 },
|
|
1934
|
+
"450": { common: 40, mobile: 32, desktop: 40 },
|
|
1935
|
+
"550": { common: 48, mobile: 40, desktop: 48 },
|
|
1936
|
+
"650": { common: 56, mobile: 48, desktop: 56 },
|
|
1937
|
+
"750": { common: 64, mobile: 56, desktop: 64 }
|
|
1938
|
+
};
|
|
1939
|
+
var lineHeightDisplay = {
|
|
1940
|
+
"75": { common: 10, mobile: 10, desktop: 10 },
|
|
1941
|
+
"100": { common: 12, mobile: 11, desktop: 12 },
|
|
1942
|
+
"125": { common: 14, mobile: 12, desktop: 14 },
|
|
1943
|
+
"150": { common: 16, mobile: 14, desktop: 16 },
|
|
1944
|
+
"175": { common: 18, mobile: 16, desktop: 18 },
|
|
1945
|
+
"200": { common: 20, mobile: 18, desktop: 20 },
|
|
1946
|
+
"250": { common: 24, mobile: 20, desktop: 24 },
|
|
1947
|
+
"300": { common: 28, mobile: 24, desktop: 28 },
|
|
1948
|
+
"350": { common: 32, mobile: 28, desktop: 32 },
|
|
1949
|
+
"450": { common: 40, mobile: 32, desktop: 40 },
|
|
1950
|
+
"550": { common: 48, mobile: 40, desktop: 48 },
|
|
1951
|
+
"650": { common: 56, mobile: 48, desktop: 56 },
|
|
1952
|
+
"750": { common: 64, mobile: 56, desktop: 64 }
|
|
1953
|
+
};
|
|
1954
|
+
var lineHeightCompact = {
|
|
1955
|
+
"75": { common: 14, mobile: 13, desktop: 14 },
|
|
1956
|
+
"100": { common: 16, mobile: 14, desktop: 16 },
|
|
1957
|
+
"125": { common: 18, mobile: 16, desktop: 18 },
|
|
1958
|
+
"150": { common: 20, mobile: 18, desktop: 20 },
|
|
1959
|
+
"175": { common: 24, mobile: 20, desktop: 24 },
|
|
1960
|
+
"200": { common: 26, mobile: 24, desktop: 26 },
|
|
1961
|
+
"250": { common: 30, mobile: 26, desktop: 30 },
|
|
1962
|
+
"300": { common: 36, mobile: 30, desktop: 36 },
|
|
1963
|
+
"350": { common: 42, mobile: 36, desktop: 42 },
|
|
1964
|
+
"450": { common: 52, mobile: 42, desktop: 52 },
|
|
1965
|
+
"550": { common: 62, mobile: 52, desktop: 62 },
|
|
1966
|
+
"650": { common: 72, mobile: 62, desktop: 72 },
|
|
1967
|
+
"750": { common: 82, mobile: 72, desktop: 82 }
|
|
1968
|
+
};
|
|
1969
|
+
var lineHeightText = {
|
|
1970
|
+
"75": { common: 14, mobile: 13, desktop: 14 },
|
|
1971
|
+
"100": { common: 18, mobile: 14, desktop: 18 },
|
|
1972
|
+
"125": { common: 20, mobile: 16, desktop: 20 },
|
|
1973
|
+
"150": { common: 22, mobile: 18, desktop: 22 },
|
|
1974
|
+
"175": { common: 26, mobile: 20, desktop: 26 },
|
|
1975
|
+
"200": { common: 28, mobile: 24, desktop: 28 },
|
|
1976
|
+
"250": { common: 34, mobile: 26, desktop: 34 },
|
|
1977
|
+
"300": { common: 40, mobile: 30, desktop: 40 },
|
|
1978
|
+
"350": { common: 44, mobile: 36, desktop: 44 },
|
|
1979
|
+
"450": { common: 56, mobile: 42, desktop: 56 },
|
|
1980
|
+
"550": { common: 66, mobile: 52, desktop: 66 },
|
|
1981
|
+
"650": { common: 78, mobile: 62, desktop: 78 },
|
|
1982
|
+
"750": { common: 88, mobile: 72, desktop: 88 }
|
|
1983
|
+
};
|
|
1984
|
+
var responsiveTypographyScale = {
|
|
1985
|
+
fontSize,
|
|
1986
|
+
lineHeightDisplay,
|
|
1987
|
+
lineHeightCompact,
|
|
1988
|
+
lineHeightText
|
|
1989
|
+
};
|
|
1990
|
+
|
|
1991
|
+
// src/tokens/breakpoints.ts
|
|
1992
|
+
var breakpoints = {
|
|
1993
|
+
/** Mobile: 0 – 767px */
|
|
1994
|
+
mobile: 0,
|
|
1995
|
+
/** Desktop: 768px and above */
|
|
1996
|
+
desktop: 768
|
|
1997
|
+
};
|
|
1998
|
+
var MOBILE_MAX_WIDTH = breakpoints.desktop - 1;
|
|
1999
|
+
|
|
2000
|
+
// src/styles/typography-css.ts
|
|
2001
|
+
function buildDeclarations(mode) {
|
|
2002
|
+
const lines = [];
|
|
2003
|
+
for (const step of SCALE_STEPS) {
|
|
2004
|
+
const fs = fontSize[step];
|
|
2005
|
+
lines.push(
|
|
2006
|
+
`--xui-font-size-${step}:${fs[mode === "desktop" ? "common" : "mobile"]}px`
|
|
2007
|
+
);
|
|
2008
|
+
}
|
|
2009
|
+
for (const step of SCALE_STEPS) {
|
|
2010
|
+
const lh = lineHeightDisplay[step];
|
|
2011
|
+
lines.push(
|
|
2012
|
+
`--xui-lh-display-${step}:${lh[mode === "desktop" ? "common" : "mobile"]}px`
|
|
2013
|
+
);
|
|
2014
|
+
}
|
|
2015
|
+
for (const step of SCALE_STEPS) {
|
|
2016
|
+
const lh = lineHeightCompact[step];
|
|
2017
|
+
lines.push(
|
|
2018
|
+
`--xui-lh-compact-${step}:${lh[mode === "desktop" ? "common" : "mobile"]}px`
|
|
2019
|
+
);
|
|
2020
|
+
}
|
|
2021
|
+
for (const step of SCALE_STEPS) {
|
|
2022
|
+
const lh = lineHeightText[step];
|
|
2023
|
+
lines.push(
|
|
2024
|
+
`--xui-lh-text-${step}:${lh[mode === "desktop" ? "common" : "mobile"]}px`
|
|
2025
|
+
);
|
|
2026
|
+
}
|
|
2027
|
+
return lines.join(";");
|
|
2028
|
+
}
|
|
2029
|
+
var _cached = null;
|
|
2030
|
+
function generateTypographyCSS() {
|
|
2031
|
+
if (_cached) return _cached;
|
|
2032
|
+
const desktopVars = buildDeclarations("desktop");
|
|
2033
|
+
const mobileVars = buildDeclarations("mobile");
|
|
2034
|
+
_cached = `:root{${desktopVars}}@media(max-width:${MOBILE_MAX_WIDTH}px){:root{${mobileVars}}}`;
|
|
2035
|
+
return _cached;
|
|
2036
|
+
}
|
|
2037
|
+
var cssVar = {
|
|
2038
|
+
fontSize: (step) => `var(--xui-font-size-${step})`,
|
|
2039
|
+
lhDisplay: (step) => `var(--xui-lh-display-${step})`,
|
|
2040
|
+
lhCompact: (step) => `var(--xui-lh-compact-${step})`,
|
|
2041
|
+
lhText: (step) => `var(--xui-lh-text-${step})`
|
|
2042
|
+
};
|
|
2043
|
+
|
|
2044
|
+
// src/styles/TypographyStyleLoader.tsx
|
|
2045
|
+
var injected2 = false;
|
|
2046
|
+
function injectTypographyStyles() {
|
|
2047
|
+
if (!isWeb || injected2) return;
|
|
2048
|
+
const style = document.createElement("style");
|
|
2049
|
+
style.setAttribute("data-xui-typography", "");
|
|
2050
|
+
style.textContent = generateTypographyCSS();
|
|
2051
|
+
document.head.appendChild(style);
|
|
2052
|
+
injected2 = true;
|
|
2053
|
+
}
|
|
2054
|
+
var TypographyStyleLoader = () => {
|
|
2055
|
+
const mountedRef = useRef2(false);
|
|
2056
|
+
useEffect2(() => {
|
|
2057
|
+
if (!mountedRef.current) {
|
|
2058
|
+
injectTypographyStyles();
|
|
2059
|
+
mountedRef.current = true;
|
|
2060
|
+
}
|
|
2061
|
+
}, []);
|
|
2062
|
+
return null;
|
|
2063
|
+
};
|
|
2064
|
+
TypographyStyleLoader.displayName = "TypographyStyleLoader";
|
|
2065
|
+
|
|
1637
2066
|
// src/index.tsx
|
|
1638
2067
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1639
2068
|
var DEPRECATED_MODES = /* @__PURE__ */ new Set([
|
|
@@ -2596,7 +3025,7 @@ var themeConfig = (mode = "dark", productContext = defaultProductContext) => {
|
|
|
2596
3025
|
},
|
|
2597
3026
|
modal: () => {
|
|
2598
3027
|
return {
|
|
2599
|
-
borderRadius:
|
|
3028
|
+
borderRadius: 8,
|
|
2600
3029
|
headerPadding: 8,
|
|
2601
3030
|
contentPadding: 40,
|
|
2602
3031
|
headerButtonSize: "xl",
|
|
@@ -2708,6 +3137,7 @@ var XUIProvider = ({
|
|
|
2708
3137
|
);
|
|
2709
3138
|
return /* @__PURE__ */ jsxs(DesignSystemContext.Provider, { value, children: [
|
|
2710
3139
|
loadFonts && /* @__PURE__ */ jsx(FontLoader, {}),
|
|
3140
|
+
/* @__PURE__ */ jsx(TypographyStyleLoader, {}),
|
|
2711
3141
|
children
|
|
2712
3142
|
] });
|
|
2713
3143
|
};
|
|
@@ -2750,22 +3180,29 @@ var useResolvedTheme = (overrides) => {
|
|
|
2750
3180
|
};
|
|
2751
3181
|
};
|
|
2752
3182
|
var idCounter = 0;
|
|
2753
|
-
var hasReactUseId = typeof
|
|
3183
|
+
var hasReactUseId = typeof React3.useId === "function";
|
|
2754
3184
|
var useIdFallback = () => {
|
|
2755
3185
|
const [id] = useState(() => `xui-${++idCounter}`);
|
|
2756
3186
|
return id;
|
|
2757
3187
|
};
|
|
2758
|
-
var useId = hasReactUseId ?
|
|
3188
|
+
var useId = hasReactUseId ? React3.useId : useIdFallback;
|
|
2759
3189
|
var ModalIdContext = createContext(null);
|
|
2760
3190
|
var useModalId = () => useContext(ModalIdContext);
|
|
2761
3191
|
export {
|
|
2762
3192
|
FontLoader,
|
|
3193
|
+
MOBILE_MAX_WIDTH,
|
|
2763
3194
|
ModalIdContext,
|
|
3195
|
+
SCALE_STEPS,
|
|
3196
|
+
TypographyStyleLoader,
|
|
2764
3197
|
XUIProvider,
|
|
3198
|
+
breakpoints,
|
|
2765
3199
|
colors,
|
|
3200
|
+
cssVar,
|
|
2766
3201
|
defaultProductContext,
|
|
2767
3202
|
fontFacesCSS,
|
|
3203
|
+
fontSize,
|
|
2768
3204
|
fonts,
|
|
3205
|
+
generateTypographyCSS,
|
|
2769
3206
|
getFonts,
|
|
2770
3207
|
getTypographyTokens,
|
|
2771
3208
|
getTypographyVariant,
|
|
@@ -2773,7 +3210,11 @@ export {
|
|
|
2773
3210
|
isIOS,
|
|
2774
3211
|
isNative,
|
|
2775
3212
|
isWeb,
|
|
3213
|
+
lineHeightCompact,
|
|
3214
|
+
lineHeightDisplay,
|
|
3215
|
+
lineHeightText,
|
|
2776
3216
|
radius,
|
|
3217
|
+
responsiveTypographyScale,
|
|
2777
3218
|
shadow,
|
|
2778
3219
|
spacing,
|
|
2779
3220
|
themeConfig,
|