@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.js
CHANGED
|
@@ -79,6 +79,12 @@ var event = function event(_ref) {
|
|
|
79
79
|
category = _ref.category,
|
|
80
80
|
label = _ref.label,
|
|
81
81
|
value = _ref.value;
|
|
82
|
+
|
|
83
|
+
if (typeof window.gtag !== 'function') {
|
|
84
|
+
console.warn("Missing window.gtag, skipping analytics action: '" + action + "'.");
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
82
88
|
window.gtag('event', action, {
|
|
83
89
|
event_category: category,
|
|
84
90
|
event_label: label,
|
|
@@ -1382,6 +1388,77 @@ var Footer = function Footer() {
|
|
|
1382
1388
|
}))));
|
|
1383
1389
|
};
|
|
1384
1390
|
|
|
1391
|
+
var GitSha = function GitSha() {
|
|
1392
|
+
var sha = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
|
|
1393
|
+
var owner = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER;
|
|
1394
|
+
var slug = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG;
|
|
1395
|
+
|
|
1396
|
+
var _useThemeUI = themeUi.useThemeUI(),
|
|
1397
|
+
theme = _useThemeUI.theme;
|
|
1398
|
+
|
|
1399
|
+
var color = theme.rawColors.secondary;
|
|
1400
|
+
|
|
1401
|
+
if (sha && owner && slug) {
|
|
1402
|
+
var shortSha = sha.substring(0, 7);
|
|
1403
|
+
var href = 'https://github.com/' + owner + '/' + slug + '/tree/' + sha;
|
|
1404
|
+
return /*#__PURE__*/React__default['default'].createElement(themeUi.Box, {
|
|
1405
|
+
sx: {
|
|
1406
|
+
display: 'inline-block'
|
|
1407
|
+
}
|
|
1408
|
+
}, /*#__PURE__*/React__default['default'].createElement(Separator, {
|
|
1409
|
+
color: color
|
|
1410
|
+
}), /*#__PURE__*/React__default['default'].createElement(themeUi.Link, {
|
|
1411
|
+
href: href,
|
|
1412
|
+
sx: {
|
|
1413
|
+
whiteSpace: 'nowrap',
|
|
1414
|
+
display: 'inline-block',
|
|
1415
|
+
ml: [2],
|
|
1416
|
+
fontFamily: 'mono',
|
|
1417
|
+
letterSpacing: 'body',
|
|
1418
|
+
color: color,
|
|
1419
|
+
fontSize: [1],
|
|
1420
|
+
textTransform: 'uppercase',
|
|
1421
|
+
textDecoration: 'none'
|
|
1422
|
+
}
|
|
1423
|
+
}, shortSha));
|
|
1424
|
+
} else {
|
|
1425
|
+
// fallback
|
|
1426
|
+
return /*#__PURE__*/React__default['default'].createElement(themeUi.Box, {
|
|
1427
|
+
sx: {
|
|
1428
|
+
display: 'inline-block'
|
|
1429
|
+
}
|
|
1430
|
+
}, /*#__PURE__*/React__default['default'].createElement(Separator, {
|
|
1431
|
+
color: color
|
|
1432
|
+
}), /*#__PURE__*/React__default['default'].createElement(themeUi.Text, {
|
|
1433
|
+
sx: {
|
|
1434
|
+
whiteSpace: 'nowrap',
|
|
1435
|
+
display: 'inline-block',
|
|
1436
|
+
ml: [2],
|
|
1437
|
+
fontFamily: 'mono',
|
|
1438
|
+
letterSpacing: 'body',
|
|
1439
|
+
color: color,
|
|
1440
|
+
fontSize: [1],
|
|
1441
|
+
textTransform: 'uppercase'
|
|
1442
|
+
}
|
|
1443
|
+
}, color));
|
|
1444
|
+
}
|
|
1445
|
+
};
|
|
1446
|
+
|
|
1447
|
+
var Separator = function Separator(_ref) {
|
|
1448
|
+
var color = _ref.color;
|
|
1449
|
+
return /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
1450
|
+
fill: color,
|
|
1451
|
+
opacity: "0.8",
|
|
1452
|
+
viewBox: "0 0 24 24",
|
|
1453
|
+
width: "24",
|
|
1454
|
+
height: "24"
|
|
1455
|
+
}, /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
1456
|
+
r: 5,
|
|
1457
|
+
cx: 19,
|
|
1458
|
+
cy: 19
|
|
1459
|
+
}));
|
|
1460
|
+
};
|
|
1461
|
+
|
|
1385
1462
|
var Value = function Value(_ref) {
|
|
1386
1463
|
var mode = _ref.mode;
|
|
1387
1464
|
|
|
@@ -1431,11 +1508,6 @@ var Value = function Value(_ref) {
|
|
|
1431
1508
|
|
|
1432
1509
|
var Metadata = function Metadata(_ref2) {
|
|
1433
1510
|
var mode = _ref2.mode;
|
|
1434
|
-
|
|
1435
|
-
var _useThemeUI = themeUi.useThemeUI(),
|
|
1436
|
-
theme = _useThemeUI.theme;
|
|
1437
|
-
|
|
1438
|
-
var color = theme.rawColors.secondary;
|
|
1439
1511
|
return /*#__PURE__*/React__default['default'].createElement(themeUi.Box, {
|
|
1440
1512
|
sx: {
|
|
1441
1513
|
userSelect: 'none',
|
|
@@ -1448,28 +1520,7 @@ var Metadata = function Metadata(_ref2) {
|
|
|
1448
1520
|
}
|
|
1449
1521
|
}, /*#__PURE__*/React__default['default'].createElement(Value, {
|
|
1450
1522
|
mode: mode
|
|
1451
|
-
}), /*#__PURE__*/React__default['default'].createElement(
|
|
1452
|
-
fill: color,
|
|
1453
|
-
opacity: "0.8",
|
|
1454
|
-
viewBox: "0 0 24 24",
|
|
1455
|
-
width: "24",
|
|
1456
|
-
height: "24"
|
|
1457
|
-
}, /*#__PURE__*/React__default['default'].createElement("circle", {
|
|
1458
|
-
r: 5,
|
|
1459
|
-
cx: 19,
|
|
1460
|
-
cy: 19
|
|
1461
|
-
})), /*#__PURE__*/React__default['default'].createElement(themeUi.Text, {
|
|
1462
|
-
sx: {
|
|
1463
|
-
whiteSpace: 'nowrap',
|
|
1464
|
-
display: 'inline-block',
|
|
1465
|
-
ml: [2],
|
|
1466
|
-
fontFamily: 'mono',
|
|
1467
|
-
letterSpacing: 'body',
|
|
1468
|
-
color: 'secondary',
|
|
1469
|
-
fontSize: [1],
|
|
1470
|
-
textTransform: 'uppercase'
|
|
1471
|
-
}
|
|
1472
|
-
}, color));
|
|
1523
|
+
}), /*#__PURE__*/React__default['default'].createElement(GitSha, null));
|
|
1473
1524
|
};
|
|
1474
1525
|
|
|
1475
1526
|
function init(mode) {
|