@carbonplan/components 10.3.0 → 10.4.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/dst/index.esm.js +78 -27
- package/dst/index.esm.js.map +1 -1
- package/dst/index.js +78 -27
- package/dst/index.js.map +1 -1
- package/dst/index.modern.js +77 -26
- package/dst/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dst/index.esm.js
CHANGED
|
@@ -73,6 +73,12 @@ var event = function event(_ref) {
|
|
|
73
73
|
category = _ref.category,
|
|
74
74
|
label = _ref.label,
|
|
75
75
|
value = _ref.value;
|
|
76
|
+
|
|
77
|
+
if (typeof window.gtag !== 'function') {
|
|
78
|
+
console.warn("Missing window.gtag, skipping analytics action: '" + action + "'.");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
76
82
|
window.gtag('event', action, {
|
|
77
83
|
event_category: category,
|
|
78
84
|
event_label: label,
|
|
@@ -1376,6 +1382,77 @@ var Footer = function Footer() {
|
|
|
1376
1382
|
}))));
|
|
1377
1383
|
};
|
|
1378
1384
|
|
|
1385
|
+
var GitSha = function GitSha() {
|
|
1386
|
+
var sha = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
|
|
1387
|
+
var owner = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER;
|
|
1388
|
+
var slug = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG;
|
|
1389
|
+
|
|
1390
|
+
var _useThemeUI = useThemeUI(),
|
|
1391
|
+
theme = _useThemeUI.theme;
|
|
1392
|
+
|
|
1393
|
+
var color = theme.rawColors.secondary;
|
|
1394
|
+
|
|
1395
|
+
if (sha && owner && slug) {
|
|
1396
|
+
var shortSha = sha.substring(0, 7);
|
|
1397
|
+
var href = 'https://github.com/' + owner + '/' + slug + '/tree/' + sha;
|
|
1398
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
1399
|
+
sx: {
|
|
1400
|
+
display: 'inline-block'
|
|
1401
|
+
}
|
|
1402
|
+
}, /*#__PURE__*/React.createElement(Separator, {
|
|
1403
|
+
color: color
|
|
1404
|
+
}), /*#__PURE__*/React.createElement(Link$1, {
|
|
1405
|
+
href: href,
|
|
1406
|
+
sx: {
|
|
1407
|
+
whiteSpace: 'nowrap',
|
|
1408
|
+
display: 'inline-block',
|
|
1409
|
+
ml: [2],
|
|
1410
|
+
fontFamily: 'mono',
|
|
1411
|
+
letterSpacing: 'body',
|
|
1412
|
+
color: color,
|
|
1413
|
+
fontSize: [1],
|
|
1414
|
+
textTransform: 'uppercase',
|
|
1415
|
+
textDecoration: 'none'
|
|
1416
|
+
}
|
|
1417
|
+
}, shortSha));
|
|
1418
|
+
} else {
|
|
1419
|
+
// fallback
|
|
1420
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
1421
|
+
sx: {
|
|
1422
|
+
display: 'inline-block'
|
|
1423
|
+
}
|
|
1424
|
+
}, /*#__PURE__*/React.createElement(Separator, {
|
|
1425
|
+
color: color
|
|
1426
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
1427
|
+
sx: {
|
|
1428
|
+
whiteSpace: 'nowrap',
|
|
1429
|
+
display: 'inline-block',
|
|
1430
|
+
ml: [2],
|
|
1431
|
+
fontFamily: 'mono',
|
|
1432
|
+
letterSpacing: 'body',
|
|
1433
|
+
color: color,
|
|
1434
|
+
fontSize: [1],
|
|
1435
|
+
textTransform: 'uppercase'
|
|
1436
|
+
}
|
|
1437
|
+
}, color));
|
|
1438
|
+
}
|
|
1439
|
+
};
|
|
1440
|
+
|
|
1441
|
+
var Separator = function Separator(_ref) {
|
|
1442
|
+
var color = _ref.color;
|
|
1443
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
1444
|
+
fill: color,
|
|
1445
|
+
opacity: "0.8",
|
|
1446
|
+
viewBox: "0 0 24 24",
|
|
1447
|
+
width: "24",
|
|
1448
|
+
height: "24"
|
|
1449
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
1450
|
+
r: 5,
|
|
1451
|
+
cx: 19,
|
|
1452
|
+
cy: 19
|
|
1453
|
+
}));
|
|
1454
|
+
};
|
|
1455
|
+
|
|
1379
1456
|
var Value = function Value(_ref) {
|
|
1380
1457
|
var mode = _ref.mode;
|
|
1381
1458
|
|
|
@@ -1425,11 +1502,6 @@ var Value = function Value(_ref) {
|
|
|
1425
1502
|
|
|
1426
1503
|
var Metadata = function Metadata(_ref2) {
|
|
1427
1504
|
var mode = _ref2.mode;
|
|
1428
|
-
|
|
1429
|
-
var _useThemeUI = useThemeUI(),
|
|
1430
|
-
theme = _useThemeUI.theme;
|
|
1431
|
-
|
|
1432
|
-
var color = theme.rawColors.secondary;
|
|
1433
1505
|
return /*#__PURE__*/React.createElement(Box, {
|
|
1434
1506
|
sx: {
|
|
1435
1507
|
userSelect: 'none',
|
|
@@ -1442,28 +1514,7 @@ var Metadata = function Metadata(_ref2) {
|
|
|
1442
1514
|
}
|
|
1443
1515
|
}, /*#__PURE__*/React.createElement(Value, {
|
|
1444
1516
|
mode: mode
|
|
1445
|
-
}), /*#__PURE__*/React.createElement(
|
|
1446
|
-
fill: color,
|
|
1447
|
-
opacity: "0.8",
|
|
1448
|
-
viewBox: "0 0 24 24",
|
|
1449
|
-
width: "24",
|
|
1450
|
-
height: "24"
|
|
1451
|
-
}, /*#__PURE__*/React.createElement("circle", {
|
|
1452
|
-
r: 5,
|
|
1453
|
-
cx: 19,
|
|
1454
|
-
cy: 19
|
|
1455
|
-
})), /*#__PURE__*/React.createElement(Text, {
|
|
1456
|
-
sx: {
|
|
1457
|
-
whiteSpace: 'nowrap',
|
|
1458
|
-
display: 'inline-block',
|
|
1459
|
-
ml: [2],
|
|
1460
|
-
fontFamily: 'mono',
|
|
1461
|
-
letterSpacing: 'body',
|
|
1462
|
-
color: 'secondary',
|
|
1463
|
-
fontSize: [1],
|
|
1464
|
-
textTransform: 'uppercase'
|
|
1465
|
-
}
|
|
1466
|
-
}, color));
|
|
1517
|
+
}), /*#__PURE__*/React.createElement(GitSha, null));
|
|
1467
1518
|
};
|
|
1468
1519
|
|
|
1469
1520
|
function init(mode) {
|