@carbonplan/components 10.2.1 → 11.0.0-alpha.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 CHANGED
@@ -1,5 +1,5 @@
1
- import React, { cloneElement, useCallback, useState, useEffect, useRef } from 'react';
2
- import { Box, Link as Link$1, Grid, IconButton, useColorMode, Container, useThemeUI, Text, Flex, Styled, Input as Input$1, Slider as Slider$1 } from 'theme-ui';
1
+ import React, { forwardRef, cloneElement, useCallback, useState, useEffect, useRef } from 'react';
2
+ import { Box, Link as Link$2, Flex, Grid, IconButton, useColorMode, Container, useThemeUI, Text, Styled, Input as Input$1, Slider as Slider$1 } from 'theme-ui';
3
3
  import { transparentize } from '@theme-ui/color';
4
4
  import NextLink from 'next/link';
5
5
  import { Arrow, Sun } from '@carbonplan/icons';
@@ -40,10 +40,12 @@ function _objectWithoutPropertiesLoose(source, excluded) {
40
40
  return target;
41
41
  }
42
42
 
43
+ var _excluded$g = ["sx", "children"];
44
+
43
45
  var Badge = function Badge(_ref) {
44
46
  var sx = _ref.sx,
45
47
  children = _ref.children,
46
- props = _objectWithoutPropertiesLoose(_ref, ["sx", "children"]);
48
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
47
49
 
48
50
  var color = sx && sx.color ? sx.color : 'primary';
49
51
  return /*#__PURE__*/React.createElement(Box, _extends({
@@ -68,11 +70,19 @@ var Badge = function Badge(_ref) {
68
70
  }, children));
69
71
  };
70
72
 
73
+ var _excluded$f = ["href", "children", "internal", "tracking"];
74
+
71
75
  var event = function event(_ref) {
72
76
  var action = _ref.action,
73
77
  category = _ref.category,
74
78
  label = _ref.label,
75
79
  value = _ref.value;
80
+
81
+ if (typeof window.gtag !== 'function') {
82
+ console.warn("Missing window.gtag, skipping analytics action: '" + action + "'.");
83
+ return;
84
+ }
85
+
76
86
  window.gtag('event', action, {
77
87
  event_category: category,
78
88
  event_label: label,
@@ -80,20 +90,22 @@ var event = function event(_ref) {
80
90
  });
81
91
  };
82
92
 
83
- var Link = function Link(_ref2) {
93
+ var Link = function Link(_ref2, ref) {
84
94
  var href = _ref2.href,
85
95
  children = _ref2.children,
86
96
  _ref2$internal = _ref2.internal,
87
97
  internal = _ref2$internal === void 0 ? false : _ref2$internal,
88
98
  _ref2$tracking = _ref2.tracking,
89
99
  tracking = _ref2$tracking === void 0 ? false : _ref2$tracking,
90
- props = _objectWithoutPropertiesLoose(_ref2, ["href", "children", "internal", "tracking"]);
100
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded$f);
91
101
 
92
102
  if (internal || href && href.startsWith('/')) {
93
103
  return /*#__PURE__*/React.createElement(NextLink, {
94
104
  href: href,
95
105
  passHref: true
96
- }, /*#__PURE__*/React.createElement(Link$1, props, children));
106
+ }, /*#__PURE__*/React.createElement(Link$2, _extends({
107
+ ref: ref
108
+ }, props), children));
97
109
  } else if (tracking) {
98
110
  var action;
99
111
  var category;
@@ -114,18 +126,22 @@ var Link = function Link(_ref2) {
114
126
  });
115
127
  };
116
128
 
117
- return /*#__PURE__*/React.createElement(Link$1, _extends({
129
+ return /*#__PURE__*/React.createElement(Link$2, _extends({
130
+ ref: ref,
118
131
  onClick: track,
119
132
  onContextMenu: track,
120
133
  href: href
121
134
  }, props), children);
122
135
  } else {
123
- return /*#__PURE__*/React.createElement(Link$1, _extends({
136
+ return /*#__PURE__*/React.createElement(Link$2, _extends({
137
+ ref: ref,
124
138
  href: href
125
139
  }, props), children);
126
140
  }
127
141
  };
128
142
 
143
+ var Link$1 = forwardRef(Link);
144
+
129
145
  var getSizeStyles = function getSizeStyles(size) {
130
146
  if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(size)) {
131
147
  throw new Error('Size must be xs, sm, md, lg, or xl');
@@ -176,7 +192,9 @@ var getSizeStyles = function getSizeStyles(size) {
176
192
  };
177
193
  };
178
194
 
179
- var Button = function Button(_ref) {
195
+ var _excluded$e = ["size", "prefix", "suffix", "inverted", "sx", "children", "align", "href", "internal", "tracking"];
196
+
197
+ var Button = function Button(_ref, ref) {
180
198
  var _ref$size = _ref.size,
181
199
  size = _ref$size === void 0 ? 'sm' : _ref$size,
182
200
  prefix = _ref.prefix,
@@ -188,7 +206,7 @@ var Button = function Button(_ref) {
188
206
  href = _ref.href,
189
207
  internal = _ref.internal,
190
208
  tracking = _ref.tracking,
191
- props = _objectWithoutPropertiesLoose(_ref, ["size", "prefix", "suffix", "inverted", "sx", "children", "align", "href", "internal", "tracking"]);
209
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
192
210
 
193
211
  if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(size)) {
194
212
  throw new Error('Size must be xs, sm, md, lg, or xl');
@@ -346,7 +364,8 @@ var Button = function Button(_ref) {
346
364
  }, suffix && suffix));
347
365
 
348
366
  if (href) {
349
- return /*#__PURE__*/React.createElement(Link, _extends({
367
+ return /*#__PURE__*/React.createElement(Link$1, _extends({
368
+ ref: ref,
350
369
  href: href,
351
370
  internal: internal,
352
371
  tracking: tracking,
@@ -356,13 +375,18 @@ var Button = function Button(_ref) {
356
375
  }, props), Inner);
357
376
  } else {
358
377
  return /*#__PURE__*/React.createElement(Box, _extends({
378
+ ref: ref,
359
379
  as: "button",
360
380
  sx: style
361
381
  }, props), Inner);
362
382
  }
363
383
  };
364
384
 
365
- var Callout = function Callout(_ref) {
385
+ var button = forwardRef(Button);
386
+
387
+ var _excluded$d = ["label", "children", "inverted", "color", "href", "internal", "tracking", "sx"];
388
+
389
+ var Callout = function Callout(_ref, ref) {
366
390
  var label = _ref.label,
367
391
  children = _ref.children,
368
392
  inverted = _ref.inverted,
@@ -371,7 +395,7 @@ var Callout = function Callout(_ref) {
371
395
  internal = _ref.internal,
372
396
  tracking = _ref.tracking,
373
397
  sx = _ref.sx,
374
- props = _objectWithoutPropertiesLoose(_ref, ["label", "children", "inverted", "color", "href", "internal", "tracking", "sx"]);
398
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
375
399
 
376
400
  var baseColor = color || (inverted ? 'secondary' : 'primary');
377
401
  var hoverColor = color ? 'primary' : inverted ? 'primary' : 'secondary';
@@ -436,7 +460,8 @@ var Callout = function Callout(_ref) {
436
460
  })));
437
461
 
438
462
  if (href) {
439
- return /*#__PURE__*/React.createElement(Link, _extends({
463
+ return /*#__PURE__*/React.createElement(Link$1, _extends({
464
+ ref: ref,
440
465
  href: href,
441
466
  internal: internal,
442
467
  tracking: tracking,
@@ -444,12 +469,157 @@ var Callout = function Callout(_ref) {
444
469
  }, props), Inner);
445
470
  } else {
446
471
  return /*#__PURE__*/React.createElement(Box, _extends({
472
+ ref: ref,
447
473
  as: "button",
448
474
  sx: style
449
475
  }, props), Inner);
450
476
  }
451
477
  };
452
478
 
479
+ var callout = forwardRef(Callout);
480
+
481
+ var _excluded$c = ["colormap", "label", "clim", "discrete", "units", "width", "height", "format", "horizontal"];
482
+ var sx$2 = {
483
+ clim: {
484
+ fontFamily: 'mono',
485
+ fontSize: ['9px', 0, 0, 1],
486
+ letterSpacing: 'smallcaps',
487
+ textTransform: 'uppercase'
488
+ }
489
+ };
490
+ var DIMENSIONS = {
491
+ width: ['10px', '16px', '16px', '17px'],
492
+ height: ['80px', '110px', '110px', '130px']
493
+ };
494
+
495
+ var Gradient = function Gradient(_ref) {
496
+ var colormap = _ref.colormap,
497
+ discrete = _ref.discrete,
498
+ horizontal = _ref.horizontal,
499
+ width = _ref.width,
500
+ height = _ref.height;
501
+ var step = 1 / colormap.length * 100;
502
+ var values = colormap.map(function (d, i) {
503
+ return "rgb(" + d + ") " + i * step + "% " + (discrete && i < colormap.length - 1 ? (i + 1) * step + "%" : '');
504
+ });
505
+ var css = "linear-gradient(to " + (horizontal ? 'right' : 'top') + ", " + values.join(',') + ")";
506
+ return /*#__PURE__*/React.createElement(Box, {
507
+ sx: _extends({}, horizontal ? {
508
+ width: width || DIMENSIONS.height,
509
+ height: height || DIMENSIONS.width
510
+ } : {
511
+ width: width || DIMENSIONS.width,
512
+ minHeight: height || DIMENSIONS.height
513
+ }, {
514
+ mt: horizontal ? [0, '1px', '1px', 0] : 0,
515
+ border: function border(_ref2) {
516
+ var colors = _ref2.colors;
517
+ return "solid 1px " + colors.hinted;
518
+ },
519
+ background: css
520
+ })
521
+ });
522
+ };
523
+
524
+ var Label = function Label(_ref3) {
525
+ var label = _ref3.label,
526
+ units = _ref3.units,
527
+ horizontal = _ref3.horizontal;
528
+ return /*#__PURE__*/React.createElement(Box, {
529
+ sx: !horizontal && {
530
+ alignSelf: 'flex-end'
531
+ }
532
+ }, /*#__PURE__*/React.createElement(Box, {
533
+ sx: _extends({
534
+ mb: horizontal ? 0 : ['-4px', '-4px', '-4px', '-3px'],
535
+ fontFamily: 'mono',
536
+ fontSize: ['9px', 0, 0, 1],
537
+ letterSpacing: 'smallcaps',
538
+ textTransform: 'uppercase'
539
+ }, horizontal ? {} : {
540
+ writingMode: 'vertical-rl',
541
+ transform: 'rotate(180deg)',
542
+ whiteSpace: 'nowrap',
543
+ display: 'inline-block',
544
+ overflow: 'visible'
545
+ })
546
+ }, label, ' ', /*#__PURE__*/React.createElement(Box, {
547
+ as: "span",
548
+ sx: {
549
+ textTransform: 'none',
550
+ color: 'secondary',
551
+ display: 'inline-block'
552
+ }
553
+ }, units)));
554
+ };
555
+
556
+ var Colorbar = function Colorbar(_ref4) {
557
+ var colormap = _ref4.colormap,
558
+ label = _ref4.label,
559
+ clim = _ref4.clim,
560
+ discrete = _ref4.discrete,
561
+ units = _ref4.units,
562
+ width = _ref4.width,
563
+ height = _ref4.height,
564
+ _ref4$format = _ref4.format,
565
+ format = _ref4$format === void 0 ? function (d) {
566
+ return d;
567
+ } : _ref4$format,
568
+ _ref4$horizontal = _ref4.horizontal,
569
+ horizontal = _ref4$horizontal === void 0 ? false : _ref4$horizontal,
570
+ props = _objectWithoutPropertiesLoose(_ref4, _excluded$c);
571
+
572
+ if (!Array.isArray(colormap)) {
573
+ throw new Error("expected array for colormap, got '" + colormap + "'.");
574
+ }
575
+
576
+ var ClimMin = function ClimMin() {
577
+ return /*#__PURE__*/React.createElement(Box, {
578
+ sx: _extends({}, sx$2.clim, {
579
+ ml: label ? horizontal ? '10px' : '2px' : 0,
580
+ mr: horizontal ? ['2px', '1px', '1px', '2px'] : 0,
581
+ mb: horizontal ? 0 : ['-2px', '-2px', '-2px', '-3px']
582
+ })
583
+ }, format(clim[0]));
584
+ };
585
+
586
+ var ClimMax = function ClimMax() {
587
+ return /*#__PURE__*/React.createElement(Box, {
588
+ sx: _extends({}, sx$2.clim, {
589
+ ml: horizontal ? ['2px', '1px', '1px', '2px'] : '2px',
590
+ mt: horizontal ? 0 : ['-2px', '-3px', '-3px', '-3px']
591
+ })
592
+ }, format(clim[1]));
593
+ };
594
+
595
+ return /*#__PURE__*/React.createElement(Flex, {
596
+ sx: _extends({}, props.sx, {
597
+ flexDirection: 'row',
598
+ alignItems: 'center',
599
+ justifyContent: 'flex-start',
600
+ gap: ['3px', '6px', '6px', '7px']
601
+ })
602
+ }, label && /*#__PURE__*/React.createElement(Label, {
603
+ label: label,
604
+ units: units,
605
+ horizontal: horizontal
606
+ }), horizontal && clim && /*#__PURE__*/React.createElement(ClimMin, null), /*#__PURE__*/React.createElement(Gradient, {
607
+ colormap: colormap,
608
+ horizontal: horizontal,
609
+ discrete: discrete,
610
+ width: width,
611
+ height: height
612
+ }), horizontal && clim && /*#__PURE__*/React.createElement(ClimMax, null), !horizontal && /*#__PURE__*/React.createElement(Flex, {
613
+ sx: {
614
+ flexDirection: 'column-reverse',
615
+ justifyContent: 'space-between',
616
+ height: height || DIMENSIONS.height
617
+ }
618
+ }, clim && /*#__PURE__*/React.createElement(ClimMin, null), clim && /*#__PURE__*/React.createElement(ClimMax, null)));
619
+ };
620
+
621
+ var _excluded$b = ["start", "width", "dl", "dr", "children", "sx"];
622
+
453
623
  var Column = function Column(_ref) {
454
624
  var start = _ref.start,
455
625
  width = _ref.width,
@@ -457,7 +627,7 @@ var Column = function Column(_ref) {
457
627
  dr = _ref.dr,
458
628
  children = _ref.children,
459
629
  sx = _ref.sx,
460
- props = _objectWithoutPropertiesLoose(_ref, ["start", "width", "dl", "dr", "children", "sx"]);
630
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
461
631
 
462
632
  start = start || 'auto';
463
633
  width = width || 'auto';
@@ -664,12 +834,14 @@ var Logo = function Logo(_ref) {
664
834
  })));
665
835
  };
666
836
 
837
+ var _excluded$a = ["children", "sx", "columns", "gap"];
838
+
667
839
  var Row = function Row(_ref) {
668
840
  var children = _ref.children,
669
841
  sx = _ref.sx,
670
842
  columns = _ref.columns,
671
843
  gap = _ref.gap,
672
- props = _objectWithoutPropertiesLoose(_ref, ["children", "sx", "columns", "gap"]);
844
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
673
845
 
674
846
  var makeArray = function makeArray(input) {
675
847
  if (!Array.isArray(input)) {
@@ -721,10 +893,12 @@ var Row = function Row(_ref) {
721
893
  }), children);
722
894
  };
723
895
 
896
+ var _excluded$9 = ["value", "sx"];
897
+
724
898
  var Menu = function Menu(_ref) {
725
899
  var value = _ref.value,
726
900
  sx = _ref.sx,
727
- props = _objectWithoutPropertiesLoose(_ref, ["value", "sx"]);
901
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
728
902
 
729
903
  return /*#__PURE__*/React.createElement(IconButton, _extends({
730
904
  sx: _extends({
@@ -812,26 +986,28 @@ var Menu = function Menu(_ref) {
812
986
  })));
813
987
  };
814
988
 
815
- var Settings = function Settings(_ref) {
816
- var _extends2;
989
+ var _excluded$8 = ["value", "sx"];
817
990
 
991
+ var Settings = function Settings(_ref) {
818
992
  var value = _ref.value,
819
993
  sx = _ref.sx,
820
- props = _objectWithoutPropertiesLoose(_ref, ["value", "sx"]);
994
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
821
995
 
822
996
  return /*#__PURE__*/React.createElement(IconButton, _extends({
823
- sx: _extends((_extends2 = {
997
+ sx: _extends({
824
998
  cursor: 'pointer',
825
999
  fill: 'none',
826
1000
  strokeWidth: '2px',
827
- stroke: 'text'
828
- }, _extends2["fill"] = 'background', _extends2['.paren'] = {
829
- opacity: '0'
830
- }, _extends2['@media (hover: hover) and (pointer: fine)'] = {
831
- '&:hover .paren': {
832
- opacity: '1'
1001
+ stroke: 'text',
1002
+ '.paren': {
1003
+ opacity: '0'
1004
+ },
1005
+ '@media (hover: hover) and (pointer: fine)': {
1006
+ '&:hover .paren': {
1007
+ opacity: '1'
1008
+ }
833
1009
  }
834
- }, _extends2), sx),
1010
+ }, sx),
835
1011
  "aria-label": "Toggle Menu"
836
1012
  }, props), !value && /*#__PURE__*/React.createElement("svg", {
837
1013
  style: {
@@ -846,22 +1022,22 @@ var Settings = function Settings(_ref) {
846
1022
  x1: "24",
847
1023
  y1: "2.1",
848
1024
  x2: "24",
1025
+ y2: "6.1"
1026
+ }), /*#__PURE__*/React.createElement("line", {
1027
+ x1: "24",
1028
+ y1: "24.1",
1029
+ x2: "24",
849
1030
  y2: "33.9"
850
1031
  }), /*#__PURE__*/React.createElement("line", {
851
1032
  x1: "44",
852
1033
  y1: "2.1",
853
1034
  x2: "44",
1035
+ y2: "12.1"
1036
+ }), /*#__PURE__*/React.createElement("line", {
1037
+ x1: "44",
1038
+ y1: "30.1",
1039
+ x2: "44",
854
1040
  y2: "33.9"
855
- }), /*#__PURE__*/React.createElement("circle", {
856
- cx: "24",
857
- cy: "15.1",
858
- r: "9",
859
- stroke: "none"
860
- }), /*#__PURE__*/React.createElement("circle", {
861
- cx: "44",
862
- cy: "21.1",
863
- r: "9",
864
- stroke: "none"
865
1041
  }), /*#__PURE__*/React.createElement("circle", {
866
1042
  cx: "24",
867
1043
  cy: "15.1",
@@ -916,9 +1092,11 @@ var Settings = function Settings(_ref) {
916
1092
  })));
917
1093
  };
918
1094
 
1095
+ var _excluded$7 = ["sx"];
1096
+
919
1097
  var Dimmer = function Dimmer(_ref) {
920
1098
  var sx = _ref.sx,
921
- props = _objectWithoutPropertiesLoose(_ref, ["sx"]);
1099
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
922
1100
 
923
1101
  var _useColorMode = useColorMode(),
924
1102
  colorMode = _useColorMode[0],
@@ -951,7 +1129,7 @@ var Dimmer = function Dimmer(_ref) {
951
1129
  }));
952
1130
  };
953
1131
 
954
- var sx = {
1132
+ var sx$1 = {
955
1133
  link: function link(current, label, first) {
956
1134
  if (first === void 0) {
957
1135
  first = false;
@@ -1030,16 +1208,16 @@ var Nav = function Nav(_ref) {
1030
1208
  return /*#__PURE__*/React.createElement(NextLink, {
1031
1209
  href: href,
1032
1210
  passHref: true
1033
- }, /*#__PURE__*/React.createElement(Link$1, {
1211
+ }, /*#__PURE__*/React.createElement(Link$2, {
1034
1212
  onClick: function onClick() {
1035
1213
  if (nav === url) setExpanded(false);
1036
1214
  },
1037
- sx: sx.link(nav, url, first)
1215
+ sx: sx$1.link(nav, url, first)
1038
1216
  }, /*#__PURE__*/React.createElement(HoverArrow, null), display));
1039
1217
  } else {
1040
- return /*#__PURE__*/React.createElement(Link$1, {
1218
+ return /*#__PURE__*/React.createElement(Link$2, {
1041
1219
  href: href,
1042
- sx: sx.link(nav, url, first)
1220
+ sx: sx$1.link(nav, url, first)
1043
1221
  }, /*#__PURE__*/React.createElement(HoverArrow, null), display);
1044
1222
  }
1045
1223
  };
@@ -1093,7 +1271,7 @@ var Header = function Header(_ref3) {
1093
1271
  }, (mode == 'homepage' || mode == 'local') && /*#__PURE__*/React.createElement(NextLink, {
1094
1272
  href: "/",
1095
1273
  passHref: true
1096
- }, /*#__PURE__*/React.createElement(Link$1, {
1274
+ }, /*#__PURE__*/React.createElement(Link$2, {
1097
1275
  "aria-label": "CarbonPlan Homepage",
1098
1276
  sx: {
1099
1277
  display: 'block'
@@ -1104,7 +1282,7 @@ var Header = function Header(_ref3) {
1104
1282
  cursor: 'pointer',
1105
1283
  color: 'primary'
1106
1284
  }
1107
- }))), (mode == null || mode == 'remote') && /*#__PURE__*/React.createElement(Link$1, {
1285
+ }))), (mode == null || mode == 'remote') && /*#__PURE__*/React.createElement(Link$2, {
1108
1286
  href: "https://carbonplan.org",
1109
1287
  "aria-label": "CarbonPlan Homepage",
1110
1288
  sx: {
@@ -1248,7 +1426,7 @@ var Footer = function Footer() {
1248
1426
  letterSpacing: 'mono',
1249
1427
  mb: [2]
1250
1428
  }
1251
- }, "EMAIL"), /*#__PURE__*/React.createElement(Link$1, {
1429
+ }, "EMAIL"), /*#__PURE__*/React.createElement(Link$2, {
1252
1430
  href: "mailto:hello@carbonplan.org",
1253
1431
  sx: {
1254
1432
  textDecoration: 'none',
@@ -1282,7 +1460,7 @@ var Footer = function Footer() {
1282
1460
  letterSpacing: 'mono',
1283
1461
  mb: [2]
1284
1462
  }
1285
- }, "FOLLOW"), /*#__PURE__*/React.createElement(Link$1, {
1463
+ }, "FOLLOW"), /*#__PURE__*/React.createElement(Link$2, {
1286
1464
  href: "https://twitter.com/carbonplanorg",
1287
1465
  sx: {
1288
1466
  textDecoration: 'none',
@@ -1376,6 +1554,77 @@ var Footer = function Footer() {
1376
1554
  }))));
1377
1555
  };
1378
1556
 
1557
+ var GitSha = function GitSha() {
1558
+ var sha = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
1559
+ var owner = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER;
1560
+ var slug = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG;
1561
+
1562
+ var _useThemeUI = useThemeUI(),
1563
+ theme = _useThemeUI.theme;
1564
+
1565
+ var color = theme.rawColors.secondary;
1566
+
1567
+ if (sha && owner && slug) {
1568
+ var shortSha = sha.substring(0, 7);
1569
+ var href = 'https://github.com/' + owner + '/' + slug + '/tree/' + sha;
1570
+ return /*#__PURE__*/React.createElement(Box, {
1571
+ sx: {
1572
+ display: 'inline-block'
1573
+ }
1574
+ }, /*#__PURE__*/React.createElement(Separator, {
1575
+ color: color
1576
+ }), /*#__PURE__*/React.createElement(Link$2, {
1577
+ href: href,
1578
+ sx: {
1579
+ whiteSpace: 'nowrap',
1580
+ display: 'inline-block',
1581
+ ml: [2],
1582
+ fontFamily: 'mono',
1583
+ letterSpacing: 'body',
1584
+ color: color,
1585
+ fontSize: [1],
1586
+ textTransform: 'uppercase',
1587
+ textDecoration: 'none'
1588
+ }
1589
+ }, shortSha));
1590
+ } else {
1591
+ // fallback
1592
+ return /*#__PURE__*/React.createElement(Box, {
1593
+ sx: {
1594
+ display: 'inline-block'
1595
+ }
1596
+ }, /*#__PURE__*/React.createElement(Separator, {
1597
+ color: color
1598
+ }), /*#__PURE__*/React.createElement(Text, {
1599
+ sx: {
1600
+ whiteSpace: 'nowrap',
1601
+ display: 'inline-block',
1602
+ ml: [2],
1603
+ fontFamily: 'mono',
1604
+ letterSpacing: 'body',
1605
+ color: color,
1606
+ fontSize: [1],
1607
+ textTransform: 'uppercase'
1608
+ }
1609
+ }, color));
1610
+ }
1611
+ };
1612
+
1613
+ var Separator = function Separator(_ref) {
1614
+ var color = _ref.color;
1615
+ return /*#__PURE__*/React.createElement("svg", {
1616
+ fill: color,
1617
+ opacity: "0.8",
1618
+ viewBox: "0 0 24 24",
1619
+ width: "24",
1620
+ height: "24"
1621
+ }, /*#__PURE__*/React.createElement("circle", {
1622
+ r: 5,
1623
+ cx: 19,
1624
+ cy: 19
1625
+ }));
1626
+ };
1627
+
1379
1628
  var Value = function Value(_ref) {
1380
1629
  var mode = _ref.mode;
1381
1630
 
@@ -1425,11 +1674,6 @@ var Value = function Value(_ref) {
1425
1674
 
1426
1675
  var Metadata = function Metadata(_ref2) {
1427
1676
  var mode = _ref2.mode;
1428
-
1429
- var _useThemeUI = useThemeUI(),
1430
- theme = _useThemeUI.theme;
1431
-
1432
- var color = theme.rawColors.secondary;
1433
1677
  return /*#__PURE__*/React.createElement(Box, {
1434
1678
  sx: {
1435
1679
  userSelect: 'none',
@@ -1442,28 +1686,7 @@ var Metadata = function Metadata(_ref2) {
1442
1686
  }
1443
1687
  }, /*#__PURE__*/React.createElement(Value, {
1444
1688
  mode: mode
1445
- }), /*#__PURE__*/React.createElement("svg", {
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));
1689
+ }), /*#__PURE__*/React.createElement(GitSha, null));
1467
1690
  };
1468
1691
 
1469
1692
  function init(mode) {
@@ -1484,6 +1707,7 @@ function scrollFraction(window, documnt) {
1484
1707
  return Math.min(window.scrollY / (document.body.offsetHeight - 770), 0.99);
1485
1708
  }
1486
1709
 
1710
+ var _excluded$6 = ["duration", "delay", "children"];
1487
1711
  var fade = keyframes({
1488
1712
  from: {
1489
1713
  opacity: 0
@@ -1499,7 +1723,7 @@ var FadeIn = function FadeIn(_ref) {
1499
1723
  _ref$delay = _ref.delay,
1500
1724
  delay = _ref$delay === void 0 ? 0 : _ref$delay,
1501
1725
  children = _ref.children,
1502
- delegated = _objectWithoutPropertiesLoose(_ref, ["duration", "delay", "children"]);
1726
+ delegated = _objectWithoutPropertiesLoose(_ref, _excluded$6);
1503
1727
 
1504
1728
  return /*#__PURE__*/React.createElement(Box, _extends({}, delegated, {
1505
1729
  sx: {
@@ -1821,12 +2045,14 @@ var Expander = function Expander(_ref) {
1821
2045
  })));
1822
2046
  };
1823
2047
 
2048
+ var _excluded$5 = ["label", "value", "sx", "children"];
2049
+
1824
2050
  var Tag = function Tag(_ref) {
1825
2051
  var label = _ref.label,
1826
2052
  value = _ref.value,
1827
2053
  sx = _ref.sx,
1828
2054
  children = _ref.children,
1829
- props = _objectWithoutPropertiesLoose(_ref, ["label", "value", "sx", "children"]);
2055
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
1830
2056
 
1831
2057
  var color = sx && sx.color ? sx.color : 'primary';
1832
2058
  var isClickable = props && (props.onClick || props.onDoubleClick);
@@ -1860,7 +2086,8 @@ var Tag = function Tag(_ref) {
1860
2086
  }, props), children);
1861
2087
  };
1862
2088
 
1863
- var sx$1 = {
2089
+ var _excluded$4 = ["values", "setValues", "label", "colors", "showAll", "multiSelect"];
2090
+ var sx = {
1864
2091
  label: {
1865
2092
  fontFamily: 'mono',
1866
2093
  letterSpacing: 'mono',
@@ -1937,10 +2164,10 @@ var Filter = function Filter(_ref2) {
1937
2164
  showAll = _ref2$showAll === void 0 ? false : _ref2$showAll,
1938
2165
  _ref2$multiSelect = _ref2.multiSelect,
1939
2166
  multiSelect = _ref2$multiSelect === void 0 ? false : _ref2$multiSelect,
1940
- props = _objectWithoutPropertiesLoose(_ref2, ["values", "setValues", "label", "colors", "showAll", "multiSelect"]);
2167
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded$4);
1941
2168
 
1942
2169
  return /*#__PURE__*/React.createElement(Box, props, label && /*#__PURE__*/React.createElement(Box, {
1943
- sx: sx$1.label
2170
+ sx: sx.label
1944
2171
  }, label), /*#__PURE__*/React.createElement(Box, {
1945
2172
  sx: {
1946
2173
  mt: label ? [3] : 0
@@ -2035,14 +2262,16 @@ var Group = function Group(_ref) {
2035
2262
  }));
2036
2263
  };
2037
2264
 
2038
- var Input = function Input(_ref) {
2265
+ var _excluded$3 = ["size", "inverted", "sx"];
2266
+
2267
+ var Input = function Input(_ref, ref) {
2039
2268
  var _extends2;
2040
2269
 
2041
2270
  var _ref$size = _ref.size,
2042
2271
  size = _ref$size === void 0 ? 'sm' : _ref$size,
2043
2272
  inverted = _ref.inverted,
2044
2273
  sx = _ref.sx,
2045
- props = _objectWithoutPropertiesLoose(_ref, ["size", "inverted", "sx"]);
2274
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
2046
2275
 
2047
2276
  var defaultColor = inverted ? 'secondary' : 'primary';
2048
2277
 
@@ -2068,10 +2297,13 @@ var Input = function Input(_ref) {
2068
2297
  }, _extends2), getSizeStyles(size), sx);
2069
2298
 
2070
2299
  return /*#__PURE__*/React.createElement(Input$1, _extends({}, props, {
2300
+ ref: ref,
2071
2301
  sx: styles
2072
2302
  }));
2073
2303
  };
2074
2304
 
2305
+ var input = forwardRef(Input);
2306
+
2075
2307
  var getProps = function getProps(test) {
2076
2308
  return function (props) {
2077
2309
  var next = {};
@@ -2084,6 +2316,8 @@ var getProps = function getProps(test) {
2084
2316
  };
2085
2317
  };
2086
2318
 
2319
+ var _excluded$2 = ["children", "size", "sx"];
2320
+
2087
2321
  var Select = function Select(_ref) {
2088
2322
  var _extends2;
2089
2323
 
@@ -2091,7 +2325,7 @@ var Select = function Select(_ref) {
2091
2325
  _ref$size = _ref.size,
2092
2326
  size = _ref$size === void 0 ? 'sm' : _ref$size,
2093
2327
  sx = _ref.sx,
2094
- props = _objectWithoutPropertiesLoose(_ref, ["children", "size", "sx"]);
2328
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
2095
2329
 
2096
2330
  var color = sx && sx.color ? sx.color : 'primary';
2097
2331
  var sizeStyles = getSizeStyles(size);
@@ -2177,9 +2411,11 @@ var Select = function Select(_ref) {
2177
2411
  }));
2178
2412
  };
2179
2413
 
2180
- var Slider = function Slider(_ref) {
2414
+ var _excluded$1 = ["sx"];
2415
+
2416
+ var Slider = function Slider(_ref, ref) {
2181
2417
  var sx = _ref.sx,
2182
- props = _objectWithoutPropertiesLoose(_ref, ["sx"]);
2418
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
2183
2419
 
2184
2420
  var color = sx && sx.color ? sx.color : 'primary';
2185
2421
 
@@ -2187,6 +2423,7 @@ var Slider = function Slider(_ref) {
2187
2423
  colors = _useThemeUI.theme.rawColors;
2188
2424
 
2189
2425
  return /*#__PURE__*/React.createElement(Slider$1, _extends({
2426
+ ref: ref,
2190
2427
  sx: _extends({
2191
2428
  '&::-webkit-slider-thumb': {
2192
2429
  height: [22, 18, 16],
@@ -2218,6 +2455,8 @@ var Slider = function Slider(_ref) {
2218
2455
  }, props));
2219
2456
  };
2220
2457
 
2458
+ var slider = forwardRef(Slider);
2459
+
2221
2460
  var styles = {
2222
2461
  reset: {
2223
2462
  verticalAlign: 'baseline',
@@ -2321,16 +2560,19 @@ var Table = function Table(_ref) {
2321
2560
  })));
2322
2561
  };
2323
2562
 
2324
- var Toggle = function Toggle(_ref) {
2563
+ var _excluded = ["value", "onClick", "disabled", "sx"];
2564
+
2565
+ var Toggle = function Toggle(_ref, ref) {
2325
2566
  var value = _ref.value,
2326
2567
  onClick = _ref.onClick,
2327
2568
  disabled = _ref.disabled,
2328
2569
  sx = _ref.sx,
2329
- props = _objectWithoutPropertiesLoose(_ref, ["value", "onClick", "disabled", "sx"]);
2570
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
2330
2571
 
2331
2572
  var color = sx && sx.color ? sx.color : 'primary';
2332
2573
  value = disabled ? false : value;
2333
2574
  return /*#__PURE__*/React.createElement(Box, _extends({
2575
+ ref: ref,
2334
2576
  as: "button",
2335
2577
  onClick: onClick,
2336
2578
  role: "checkbox",
@@ -2368,6 +2610,8 @@ var Toggle = function Toggle(_ref) {
2368
2610
  })));
2369
2611
  };
2370
2612
 
2613
+ var toggle = forwardRef(Toggle);
2614
+
2371
2615
  var Tracking = function Tracking(_ref) {
2372
2616
  var id = _ref.id;
2373
2617
 
@@ -2466,5 +2710,5 @@ var formatDate = function formatDate(date, options) {
2466
2710
  return [month, day, year].filter(Boolean).join(' ');
2467
2711
  };
2468
2712
 
2469
- export { Badge, Button, Callout, Column, Custom404, Dimmer, Expander, FadeIn, Filter, Footer, Group, Guide, Header, Input, Layout, Link, Logo, Menu, Meta, Monogram, Row, Scrollbar, Select, Slider, Table, Tag, Toggle, Tracking, Tray, formatDate, getScrollbarWidth };
2713
+ export { Badge, button as Button, callout as Callout, Colorbar, Column, Custom404, Dimmer, Expander, FadeIn, Filter, Footer, Group, Guide, Header, input as Input, Layout, Link$1 as Link, Logo, Menu, Meta, Monogram, Row, Scrollbar, Select, Settings, slider as Slider, Table, Tag, toggle as Toggle, Tracking, Tray, formatDate, getScrollbarWidth };
2470
2714
  //# sourceMappingURL=index.esm.js.map