@carbonplan/components 10.3.0 → 11.0.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,9 +1,10 @@
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, useRef, useState, useEffect, useCallback } from 'react';
2
+ import { Box, Link as Link$2, Flex, Grid, IconButton, Container, useColorMode, 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';
6
6
  import { PoopSad } from '@carbonplan/emoji';
7
+ import { useBreakpointIndex } from '@theme-ui/match-media';
7
8
  import Head from 'next/head';
8
9
  import { keyframes } from '@emotion/react';
9
10
 
@@ -73,6 +74,12 @@ var event = function event(_ref) {
73
74
  category = _ref.category,
74
75
  label = _ref.label,
75
76
  value = _ref.value;
77
+
78
+ if (typeof window.gtag !== 'function') {
79
+ console.warn("Missing window.gtag, skipping analytics action: '" + action + "'.");
80
+ return;
81
+ }
82
+
76
83
  window.gtag('event', action, {
77
84
  event_category: category,
78
85
  event_label: label,
@@ -80,7 +87,7 @@ var event = function event(_ref) {
80
87
  });
81
88
  };
82
89
 
83
- var Link = function Link(_ref2) {
90
+ var Link = function Link(_ref2, ref) {
84
91
  var href = _ref2.href,
85
92
  children = _ref2.children,
86
93
  _ref2$internal = _ref2.internal,
@@ -93,7 +100,9 @@ var Link = function Link(_ref2) {
93
100
  return /*#__PURE__*/React.createElement(NextLink, {
94
101
  href: href,
95
102
  passHref: true
96
- }, /*#__PURE__*/React.createElement(Link$1, props, children));
103
+ }, /*#__PURE__*/React.createElement(Link$2, _extends({
104
+ ref: ref
105
+ }, props), children));
97
106
  } else if (tracking) {
98
107
  var action;
99
108
  var category;
@@ -114,18 +123,22 @@ var Link = function Link(_ref2) {
114
123
  });
115
124
  };
116
125
 
117
- return /*#__PURE__*/React.createElement(Link$1, _extends({
126
+ return /*#__PURE__*/React.createElement(Link$2, _extends({
127
+ ref: ref,
118
128
  onClick: track,
119
129
  onContextMenu: track,
120
130
  href: href
121
131
  }, props), children);
122
132
  } else {
123
- return /*#__PURE__*/React.createElement(Link$1, _extends({
133
+ return /*#__PURE__*/React.createElement(Link$2, _extends({
134
+ ref: ref,
124
135
  href: href
125
136
  }, props), children);
126
137
  }
127
138
  };
128
139
 
140
+ var Link$1 = forwardRef(Link);
141
+
129
142
  var getSizeStyles = function getSizeStyles(size) {
130
143
  if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(size)) {
131
144
  throw new Error('Size must be xs, sm, md, lg, or xl');
@@ -176,7 +189,7 @@ var getSizeStyles = function getSizeStyles(size) {
176
189
  };
177
190
  };
178
191
 
179
- var Button = function Button(_ref) {
192
+ var Button = function Button(_ref, ref) {
180
193
  var _ref$size = _ref.size,
181
194
  size = _ref$size === void 0 ? 'sm' : _ref$size,
182
195
  prefix = _ref.prefix,
@@ -346,7 +359,8 @@ var Button = function Button(_ref) {
346
359
  }, suffix && suffix));
347
360
 
348
361
  if (href) {
349
- return /*#__PURE__*/React.createElement(Link, _extends({
362
+ return /*#__PURE__*/React.createElement(Link$1, _extends({
363
+ ref: ref,
350
364
  href: href,
351
365
  internal: internal,
352
366
  tracking: tracking,
@@ -356,13 +370,16 @@ var Button = function Button(_ref) {
356
370
  }, props), Inner);
357
371
  } else {
358
372
  return /*#__PURE__*/React.createElement(Box, _extends({
373
+ ref: ref,
359
374
  as: "button",
360
375
  sx: style
361
376
  }, props), Inner);
362
377
  }
363
378
  };
364
379
 
365
- var Callout = function Callout(_ref) {
380
+ var button = forwardRef(Button);
381
+
382
+ var Callout = function Callout(_ref, ref) {
366
383
  var label = _ref.label,
367
384
  children = _ref.children,
368
385
  inverted = _ref.inverted,
@@ -436,7 +453,8 @@ var Callout = function Callout(_ref) {
436
453
  })));
437
454
 
438
455
  if (href) {
439
- return /*#__PURE__*/React.createElement(Link, _extends({
456
+ return /*#__PURE__*/React.createElement(Link$1, _extends({
457
+ ref: ref,
440
458
  href: href,
441
459
  internal: internal,
442
460
  tracking: tracking,
@@ -444,12 +462,342 @@ var Callout = function Callout(_ref) {
444
462
  }, props), Inner);
445
463
  } else {
446
464
  return /*#__PURE__*/React.createElement(Box, _extends({
465
+ ref: ref,
447
466
  as: "button",
448
467
  sx: style
449
468
  }, props), Inner);
450
469
  }
451
470
  };
452
471
 
472
+ var callout = forwardRef(Callout);
473
+
474
+ var styles = {
475
+ clim: function clim(setClim) {
476
+ return {
477
+ fontFamily: 'mono',
478
+ fontSize: ['9px', 0, 0, 1],
479
+ letterSpacing: 'smallcaps',
480
+ textTransform: 'uppercase',
481
+ '@media (hover: hover) and (pointer: fine)': {
482
+ '&:hover': {
483
+ borderBottom: setClim ? function (_ref) {
484
+ var colors = _ref.colors;
485
+ return "solid 1px " + colors.primary + " !important";
486
+ } : 'unset'
487
+ }
488
+ },
489
+ '&:focus': {
490
+ outline: 'none',
491
+ borderBottom: setClim ? function (_ref2) {
492
+ var colors = _ref2.colors;
493
+ return "solid 1px " + colors.primary + " !important";
494
+ } : 'unset'
495
+ },
496
+ transition: 'border 0.15s',
497
+ userSelect: setClim ? 'none !important' : 'unset',
498
+ width: 'fit-content',
499
+ minWidth: 'fit-content'
500
+ };
501
+ }
502
+ };
503
+ var DIMENSIONS = {
504
+ width: ['10px', '16px', '16px', '17px'],
505
+ height: ['80px', '110px', '110px', '130px']
506
+ };
507
+
508
+ var Gradient = function Gradient(_ref3) {
509
+ var colormap = _ref3.colormap,
510
+ discrete = _ref3.discrete,
511
+ horizontal = _ref3.horizontal,
512
+ width = _ref3.width,
513
+ height = _ref3.height;
514
+ var step = 1 / colormap.length * 100;
515
+ var values = colormap.map(function (d, i) {
516
+ return "rgb(" + d + ") " + i * step + "% " + (discrete && i < colormap.length - 1 ? (i + 1) * step + "%" : '');
517
+ });
518
+ var css = "linear-gradient(to " + (horizontal ? 'right' : 'top') + ", " + values.join(',') + ")";
519
+ return /*#__PURE__*/React.createElement(Box, {
520
+ sx: _extends({}, horizontal ? {
521
+ width: width || DIMENSIONS.height,
522
+ height: height || DIMENSIONS.width
523
+ } : {
524
+ width: width || DIMENSIONS.width,
525
+ minHeight: height || DIMENSIONS.height
526
+ }, {
527
+ mt: horizontal ? [0, '1px', '1px', 0] : 0,
528
+ border: function border(_ref4) {
529
+ var colors = _ref4.colors;
530
+ return "solid 1px " + colors.hinted;
531
+ },
532
+ background: css
533
+ })
534
+ });
535
+ };
536
+
537
+ var Label = function Label(_ref5) {
538
+ var label = _ref5.label,
539
+ units = _ref5.units,
540
+ horizontal = _ref5.horizontal;
541
+ return /*#__PURE__*/React.createElement(Box, {
542
+ sx: !horizontal && {
543
+ alignSelf: 'flex-end'
544
+ }
545
+ }, /*#__PURE__*/React.createElement(Box, {
546
+ sx: _extends({
547
+ mb: horizontal ? 0 : ['-4px', '-4px', '-4px', '-3px'],
548
+ fontFamily: 'mono',
549
+ fontSize: ['9px', 0, 0, 1],
550
+ letterSpacing: 'smallcaps',
551
+ textTransform: 'uppercase'
552
+ }, horizontal ? {} : {
553
+ writingMode: 'vertical-rl',
554
+ transform: 'rotate(180deg)',
555
+ whiteSpace: 'nowrap',
556
+ display: 'inline-block',
557
+ overflow: 'visible'
558
+ })
559
+ }, label, ' ', /*#__PURE__*/React.createElement(Box, {
560
+ as: "span",
561
+ sx: {
562
+ textTransform: 'none',
563
+ color: 'secondary',
564
+ display: 'inline-block'
565
+ }
566
+ }, units)));
567
+ };
568
+
569
+ var Colorbar = function Colorbar(_ref6) {
570
+ var colormap = _ref6.colormap,
571
+ label = _ref6.label,
572
+ clim = _ref6.clim,
573
+ setClim = _ref6.setClim,
574
+ _ref6$setClimStep = _ref6.setClimStep,
575
+ setClimStep = _ref6$setClimStep === void 0 ? 1 : _ref6$setClimStep,
576
+ discrete = _ref6.discrete,
577
+ units = _ref6.units,
578
+ width = _ref6.width,
579
+ height = _ref6.height,
580
+ _ref6$format = _ref6.format,
581
+ format = _ref6$format === void 0 ? function (d) {
582
+ return d;
583
+ } : _ref6$format,
584
+ _ref6$horizontal = _ref6.horizontal,
585
+ horizontal = _ref6$horizontal === void 0 ? false : _ref6$horizontal,
586
+ _ref6$bottom = _ref6.bottom,
587
+ bottom = _ref6$bottom === void 0 ? false : _ref6$bottom,
588
+ sx = _ref6.sx,
589
+ sxClim = _ref6.sxClim,
590
+ props = _objectWithoutPropertiesLoose(_ref6, ["colormap", "label", "clim", "setClim", "setClimStep", "discrete", "units", "width", "height", "format", "horizontal", "bottom", "sx", "sxClim"]);
591
+
592
+ if (!Array.isArray(colormap)) {
593
+ throw new Error("expected array for colormap, got '" + colormap + "'.");
594
+ }
595
+
596
+ var climRef = [useRef(), useRef()];
597
+
598
+ var _useState = useState(false),
599
+ climMinDragging = _useState[0],
600
+ setClimMinDragging = _useState[1];
601
+
602
+ var _useState2 = useState(false),
603
+ climMaxDragging = _useState2[0],
604
+ setClimMaxDragging = _useState2[1];
605
+
606
+ var x,
607
+ y,
608
+ dx,
609
+ dy = 0;
610
+ var id = null;
611
+ var init = [0, 0];
612
+ var scale = setClimStep;
613
+
614
+ var draggingFunction = function draggingFunction(e) {
615
+ if (id === 'min' && !climMinDragging) setClimMinDragging(true);
616
+ if (id === 'max' && !climMaxDragging) setClimMaxDragging(true);
617
+ dx = e.pageX - x;
618
+ dy = e.pageY - y;
619
+
620
+ if (horizontal) {
621
+ if (id === 'min') setClim(function (prev) {
622
+ return [Math.min(init[0] + dx * scale, init[1]), prev[1]];
623
+ });
624
+ if (id === 'max') setClim(function (prev) {
625
+ return [prev[0], Math.max(init[1] + dx * scale, init[0])];
626
+ });
627
+ } else {
628
+ if (id === 'min') setClim(function (prev) {
629
+ return [Math.min(init[0] - dy * scale, init[1]), prev[1]];
630
+ });
631
+ if (id === 'max') setClim(function (prev) {
632
+ return [prev[0], Math.max(init[1] - dy * scale, init[0])];
633
+ });
634
+ }
635
+ };
636
+
637
+ var handleMouseDown = function handleMouseDown(e) {
638
+ y = e.pageY;
639
+ x = e.pageX;
640
+ id = e.target.id;
641
+ init = clim;
642
+ document.body.setAttribute('style', horizontal ? 'cursor: ew-resize !important' : 'cursor: ns-resize !important');
643
+ document.addEventListener('mousemove', draggingFunction);
644
+
645
+ var updater = function updater() {
646
+ document.body.setAttribute('style', 'cursor: unset');
647
+ document.removeEventListener('mousemove', draggingFunction);
648
+ window.removeEventListener('mouseup', updater);
649
+ if (id === 'min') setClimMinDragging(false);
650
+ if (id === 'max') setClimMaxDragging(false);
651
+ };
652
+
653
+ window.addEventListener('mouseup', updater);
654
+ };
655
+
656
+ var increment = function increment(e) {
657
+ if (climRef[0].current === document.activeElement) {
658
+ e.preventDefault();
659
+ setClim(function (prev) {
660
+ return [Math.min(prev[0] + scale, prev[1]), prev[1]];
661
+ });
662
+ climRef[0].current.focus();
663
+ }
664
+
665
+ if (climRef[1].current === document.activeElement) {
666
+ e.preventDefault();
667
+ setClim(function (prev) {
668
+ return [prev[0], Math.max(prev[1] + scale, prev[0])];
669
+ });
670
+ climRef[1].current.focus();
671
+ }
672
+ };
673
+
674
+ var decrement = function decrement(e) {
675
+ if (climRef[0].current === document.activeElement) {
676
+ e.preventDefault();
677
+ setClim(function (prev) {
678
+ return [Math.min(prev[0] - scale, prev[1]), prev[1]];
679
+ });
680
+ climRef[0].current.focus();
681
+ }
682
+
683
+ if (climRef[1].current === document.activeElement) {
684
+ e.preventDefault();
685
+ setClim(function (prev) {
686
+ return [prev[0], Math.max(prev[1] - scale, prev[0])];
687
+ });
688
+ climRef[1].current.focus();
689
+ }
690
+ };
691
+
692
+ useEffect(function () {
693
+ var listener = function listener(e) {
694
+ if (['ArrowUp', 'ArrowRight'].includes(e.code) || ['ArrowUp', 'ArrowRight'].includes(e.key)) {
695
+ increment(e);
696
+ }
697
+
698
+ if (['ArrowDown', 'ArrowLeft'].includes(e.code) || ['ArrowDown', 'ArrowLeft'].includes(e.key)) {
699
+ decrement(e);
700
+ }
701
+ };
702
+
703
+ window.addEventListener('keydown', listener);
704
+ return function () {
705
+ window.removeEventListener('keydown', listener);
706
+ };
707
+ }, [clim]);
708
+
709
+ var ClimMin = function ClimMin() {
710
+ return /*#__PURE__*/React.createElement(Box, {
711
+ id: "min",
712
+ ref: climRef[0],
713
+ tabIndex: 0,
714
+ sx: _extends({}, styles.clim(setClim), {
715
+ ml: label ? horizontal ? bottom ? '0px' : '10px' : '2px' : 0,
716
+ mr: horizontal ? ['2px', '1px', '1px', '2px'] : 0,
717
+ mb: horizontal ? 0 : ['-2px', '-2px', '-2px', '-3px'],
718
+ borderBottom: setClim ? climMinDragging ? function (_ref7) {
719
+ var colors = _ref7.colors;
720
+ return "solid 1px " + colors.primary;
721
+ } : function (_ref8) {
722
+ var colors = _ref8.colors;
723
+ return "solid 1px " + colors.secondary;
724
+ } : 'unset',
725
+ cursor: setClim ? horizontal ? 'ew-resize' : 'ns-resize' : 'default'
726
+ }, sxClim),
727
+ onMouseDown: setClim ? handleMouseDown : function () {},
728
+ onClick: function onClick() {
729
+ return climRef[0].current.focus();
730
+ }
731
+ }, format(clim[0]));
732
+ };
733
+
734
+ var ClimMax = function ClimMax() {
735
+ return /*#__PURE__*/React.createElement(Box, {
736
+ id: "max",
737
+ ref: climRef[1],
738
+ tabIndex: 0,
739
+ sx: _extends({}, styles.clim(setClim), {
740
+ ml: horizontal ? ['2px', '1px', '1px', '2px'] : '2px',
741
+ mt: horizontal ? 0 : ['-2px', '-3px', '-3px', '-3px'],
742
+ borderBottom: setClim ? climMaxDragging ? function (_ref9) {
743
+ var colors = _ref9.colors;
744
+ return "solid 1px " + colors.primary;
745
+ } : function (_ref10) {
746
+ var colors = _ref10.colors;
747
+ return "solid 1px " + colors.secondary;
748
+ } : 'unset',
749
+ cursor: setClim ? horizontal ? 'ew-resize' : 'ns-resize' : 'default'
750
+ }, sxClim),
751
+ onMouseDown: setClim ? handleMouseDown : function () {},
752
+ onClick: function onClick() {
753
+ return climRef[1].current.focus();
754
+ }
755
+ }, format(clim[1]));
756
+ };
757
+
758
+ return /*#__PURE__*/React.createElement(Flex, _extends({}, props, {
759
+ sx: _extends({
760
+ flexDirection: 'row',
761
+ alignItems: 'start',
762
+ justifyContent: 'flex-start',
763
+ gap: ['3px', '6px', '6px', '7px'],
764
+ height: !horizontal ? '100%' : 'unset'
765
+ }, sx)
766
+ }), label && /*#__PURE__*/React.createElement(Label, {
767
+ label: label,
768
+ units: units,
769
+ horizontal: horizontal
770
+ }), /*#__PURE__*/React.createElement(Flex, {
771
+ sx: {
772
+ flexGrow: horizontal ? 1 : 'unset',
773
+ flexDirection: 'column',
774
+ ml: bottom && label ? '4px' : '0px',
775
+ height: !horizontal ? '100%' : 'unset'
776
+ }
777
+ }, /*#__PURE__*/React.createElement(Flex, {
778
+ sx: {
779
+ gap: ['3px', '6px', '6px', '7px'],
780
+ height: !horizontal ? '100%' : 'unset'
781
+ }
782
+ }, horizontal && clim && !bottom && /*#__PURE__*/React.createElement(ClimMin, null), /*#__PURE__*/React.createElement(Gradient, {
783
+ colormap: colormap,
784
+ horizontal: horizontal,
785
+ discrete: discrete,
786
+ width: width,
787
+ height: height
788
+ }), horizontal && clim && !bottom && /*#__PURE__*/React.createElement(ClimMax, null)), horizontal && clim && bottom && /*#__PURE__*/React.createElement(Flex, {
789
+ sx: {
790
+ justifyContent: 'space-between'
791
+ }
792
+ }, /*#__PURE__*/React.createElement(ClimMin, null), /*#__PURE__*/React.createElement(ClimMax, null))), !horizontal && /*#__PURE__*/React.createElement(Flex, {
793
+ sx: {
794
+ flexDirection: 'column-reverse',
795
+ justifyContent: 'space-between',
796
+ height: height || DIMENSIONS.height
797
+ }
798
+ }, clim && /*#__PURE__*/React.createElement(ClimMin, null), clim && /*#__PURE__*/React.createElement(ClimMax, null)));
799
+ };
800
+
453
801
  var Column = function Column(_ref) {
454
802
  var start = _ref.start,
455
803
  width = _ref.width,
@@ -812,145 +1160,6 @@ var Menu = function Menu(_ref) {
812
1160
  })));
813
1161
  };
814
1162
 
815
- var Settings = function Settings(_ref) {
816
- var value = _ref.value,
817
- sx = _ref.sx,
818
- props = _objectWithoutPropertiesLoose(_ref, ["value", "sx"]);
819
-
820
- return /*#__PURE__*/React.createElement(IconButton, _extends({
821
- sx: _extends({
822
- cursor: 'pointer',
823
- fill: 'none',
824
- strokeWidth: '2px',
825
- stroke: 'text',
826
- '.paren': {
827
- opacity: '0'
828
- },
829
- '@media (hover: hover) and (pointer: fine)': {
830
- '&:hover .paren': {
831
- opacity: '1'
832
- }
833
- }
834
- }, sx),
835
- "aria-label": "Toggle Menu"
836
- }, props), !value && /*#__PURE__*/React.createElement("svg", {
837
- style: {
838
- width: '50px',
839
- height: '30px',
840
- transform: 'scale(2)',
841
- marginTop: '-3px'
842
- },
843
- xmlns: "http://www.w3.org/2000/svg",
844
- viewBox: "0 0 68 36"
845
- }, /*#__PURE__*/React.createElement("line", {
846
- x1: "24",
847
- y1: "2.1",
848
- x2: "24",
849
- y2: "6.1"
850
- }), /*#__PURE__*/React.createElement("line", {
851
- x1: "24",
852
- y1: "24.1",
853
- x2: "24",
854
- y2: "33.9"
855
- }), /*#__PURE__*/React.createElement("line", {
856
- x1: "44",
857
- y1: "2.1",
858
- x2: "44",
859
- y2: "12.1"
860
- }), /*#__PURE__*/React.createElement("line", {
861
- x1: "44",
862
- y1: "30.1",
863
- x2: "44",
864
- y2: "33.9"
865
- }), /*#__PURE__*/React.createElement("circle", {
866
- cx: "24",
867
- cy: "15.1",
868
- r: "5"
869
- }), /*#__PURE__*/React.createElement("circle", {
870
- cx: "44",
871
- cy: "21.1",
872
- r: "5"
873
- }), /*#__PURE__*/React.createElement("path", {
874
- style: {
875
- transition: 'all 0.2s'
876
- },
877
- className: "paren",
878
- d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
879
- }), /*#__PURE__*/React.createElement("path", {
880
- style: {
881
- transition: 'all 0.2s'
882
- },
883
- className: "paren",
884
- d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
885
- })), value && /*#__PURE__*/React.createElement("svg", {
886
- style: {
887
- width: '50px',
888
- height: '30px',
889
- transform: 'scale(2)',
890
- marginTop: '-3px'
891
- },
892
- xmlns: "http://www.w3.org/2000/svg",
893
- viewBox: "0 0 68 36"
894
- }, /*#__PURE__*/React.createElement("line", {
895
- x1: "50.85",
896
- y1: "29.79",
897
- x2: "17.15",
898
- y2: "6.21"
899
- }), /*#__PURE__*/React.createElement("line", {
900
- x1: "17.15",
901
- y1: "29.79",
902
- x2: "50.85",
903
- y2: "6.21"
904
- }), /*#__PURE__*/React.createElement("path", {
905
- style: {
906
- transition: 'all 0.2s'
907
- },
908
- className: "paren",
909
- d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
910
- }), /*#__PURE__*/React.createElement("path", {
911
- style: {
912
- transition: 'all 0.2s'
913
- },
914
- className: "paren",
915
- d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
916
- })));
917
- };
918
-
919
- var Dimmer = function Dimmer(_ref) {
920
- var sx = _ref.sx,
921
- props = _objectWithoutPropertiesLoose(_ref, ["sx"]);
922
-
923
- var _useColorMode = useColorMode(),
924
- colorMode = _useColorMode[0],
925
- setColorMode = _useColorMode[1];
926
-
927
- var toggle = useCallback(function () {
928
- setColorMode(colorMode === 'light' ? 'dark' : 'light');
929
- }, [colorMode]);
930
- return /*#__PURE__*/React.createElement(IconButton, _extends({
931
- "aria-label": "Toggle dark mode",
932
- onClick: toggle,
933
- role: "checkbox",
934
- sx: _extends({
935
- width: 32,
936
- height: 32,
937
- display: 'inline-block',
938
- cursor: 'pointer',
939
- color: 'secondary'
940
- }, sx)
941
- }, props), /*#__PURE__*/React.createElement(Sun, {
942
- sx: {
943
- strokeWidth: '1.75',
944
- transition: 'stroke 0.15s',
945
- '@media (hover: hover) and (pointer: fine)': {
946
- '&:hover': {
947
- stroke: 'primary'
948
- }
949
- }
950
- }
951
- }));
952
- };
953
-
954
1163
  var sx = {
955
1164
  link: function link(current, label, first) {
956
1165
  if (first === void 0) {
@@ -1030,14 +1239,14 @@ var Nav = function Nav(_ref) {
1030
1239
  return /*#__PURE__*/React.createElement(NextLink, {
1031
1240
  href: href,
1032
1241
  passHref: true
1033
- }, /*#__PURE__*/React.createElement(Link$1, {
1242
+ }, /*#__PURE__*/React.createElement(Link$2, {
1034
1243
  onClick: function onClick() {
1035
1244
  if (nav === url) setExpanded(false);
1036
1245
  },
1037
1246
  sx: sx.link(nav, url, first)
1038
1247
  }, /*#__PURE__*/React.createElement(HoverArrow, null), display));
1039
1248
  } else {
1040
- return /*#__PURE__*/React.createElement(Link$1, {
1249
+ return /*#__PURE__*/React.createElement(Link$2, {
1041
1250
  href: href,
1042
1251
  sx: sx.link(nav, url, first)
1043
1252
  }, /*#__PURE__*/React.createElement(HoverArrow, null), display);
@@ -1065,8 +1274,7 @@ var Header = function Header(_ref3) {
1065
1274
  var status = _ref3.status,
1066
1275
  mode = _ref3.mode,
1067
1276
  nav = _ref3.nav,
1068
- dimmer = _ref3.dimmer,
1069
- settings = _ref3.settings;
1277
+ menuItems = _ref3.menuItems;
1070
1278
 
1071
1279
  var _useState = useState(false),
1072
1280
  expanded = _useState[0],
@@ -1078,7 +1286,6 @@ var Header = function Header(_ref3) {
1078
1286
 
1079
1287
  return /*#__PURE__*/React.createElement(Row, {
1080
1288
  sx: {
1081
- width: '100%',
1082
1289
  pt: ['12px'],
1083
1290
  pb: [3]
1084
1291
  }
@@ -1093,7 +1300,7 @@ var Header = function Header(_ref3) {
1093
1300
  }, (mode == 'homepage' || mode == 'local') && /*#__PURE__*/React.createElement(NextLink, {
1094
1301
  href: "/",
1095
1302
  passHref: true
1096
- }, /*#__PURE__*/React.createElement(Link$1, {
1303
+ }, /*#__PURE__*/React.createElement(Link$2, {
1097
1304
  "aria-label": "CarbonPlan Homepage",
1098
1305
  sx: {
1099
1306
  display: 'block'
@@ -1104,7 +1311,7 @@ var Header = function Header(_ref3) {
1104
1311
  cursor: 'pointer',
1105
1312
  color: 'primary'
1106
1313
  }
1107
- }))), (mode == null || mode == 'remote') && /*#__PURE__*/React.createElement(Link$1, {
1314
+ }))), (mode == null || mode == 'remote') && /*#__PURE__*/React.createElement(Link$2, {
1108
1315
  href: "https://carbonplan.org",
1109
1316
  "aria-label": "CarbonPlan Homepage",
1110
1317
  sx: {
@@ -1130,53 +1337,31 @@ var Header = function Header(_ref3) {
1130
1337
  top: ['-2px', '-3px', '-3px']
1131
1338
  }
1132
1339
  }, status ? "(" + status + ")" : '')), /*#__PURE__*/React.createElement(Column, {
1133
- start: [status ? 6 : 4, 6, 12, 12],
1340
+ start: [status ? 6 : 4, 6, 11, 11],
1134
1341
  width: [status ? 1 : 3, 3, 2, 2],
1135
1342
  sx: {
1136
- display: 'flex',
1137
- alignItems: 'center',
1138
- justifyContent: 'flex-end'
1139
- }
1140
- }, /*#__PURE__*/React.createElement(Box, {
1141
- sx: {
1142
- mr: ['18px'],
1143
- position: 'relative',
1144
- top: ['-1px'],
1145
- pointerEvents: expanded || settings && settings.value ? 'none' : 'all',
1146
- transition: 'opacity 0.15s',
1147
- display: [status ? 'none' : 'block', 'block', dimmer === 'top' ? 'block' : 'none', dimmer === 'top' ? 'block' : 'none']
1148
- }
1149
- }, /*#__PURE__*/React.createElement(Dimmer, {
1150
- sx: {
1151
- opacity: expanded || settings && settings.value ? 0 : 1,
1152
- color: 'primary'
1343
+ zIndex: 5000
1153
1344
  }
1154
- })), settings && /*#__PURE__*/React.createElement(Box, {
1345
+ }, /*#__PURE__*/React.createElement(Flex, {
1155
1346
  sx: {
1156
- mr: ['21px'],
1157
- position: 'relative',
1158
- pointerEvents: expanded ? 'none' : 'all',
1159
- transition: 'opacity 0.15s',
1160
- display: [status ? 'none' : 'block', 'block', 'none', 'none']
1347
+ justifyContent: 'flex-end'
1161
1348
  }
1162
- }, /*#__PURE__*/React.createElement(Settings, {
1163
- value: settings.value,
1164
- onClick: settings.onClick,
1349
+ }, /*#__PURE__*/React.createElement(Flex, {
1165
1350
  sx: {
1351
+ mr: '18px',
1352
+ gap: '18px',
1166
1353
  opacity: expanded ? 0 : 1,
1167
- stroke: 'primary'
1354
+ transition: 'opacity 0.15s',
1355
+ justifyContent: 'space-between',
1356
+ alignItems: 'center'
1168
1357
  }
1169
- })), /*#__PURE__*/React.createElement(Menu, {
1358
+ }, menuItems), /*#__PURE__*/React.createElement(Menu, {
1170
1359
  sx: {
1171
- transition: 'opacity 0.15s',
1172
- pointerEvents: settings && settings.value ? 'none' : 'all',
1173
- opacity: settings && settings.value ? 0 : 1,
1174
- mr: ['-2px'],
1175
- zIndex: 5000
1360
+ mr: ['-2px']
1176
1361
  },
1177
1362
  value: expanded,
1178
1363
  onClick: toggle
1179
- })), /*#__PURE__*/React.createElement(Box, {
1364
+ }))), /*#__PURE__*/React.createElement(Box, {
1180
1365
  sx: {
1181
1366
  opacity: expanded ? 1 : 0,
1182
1367
  pointerEvents: expanded ? 'all' : 'none',
@@ -1248,7 +1433,7 @@ var Footer = function Footer() {
1248
1433
  letterSpacing: 'mono',
1249
1434
  mb: [2]
1250
1435
  }
1251
- }, "EMAIL"), /*#__PURE__*/React.createElement(Link$1, {
1436
+ }, "EMAIL"), /*#__PURE__*/React.createElement(Link$2, {
1252
1437
  href: "mailto:hello@carbonplan.org",
1253
1438
  sx: {
1254
1439
  textDecoration: 'none',
@@ -1282,7 +1467,7 @@ var Footer = function Footer() {
1282
1467
  letterSpacing: 'mono',
1283
1468
  mb: [2]
1284
1469
  }
1285
- }, "FOLLOW"), /*#__PURE__*/React.createElement(Link$1, {
1470
+ }, "FOLLOW"), /*#__PURE__*/React.createElement(Link$2, {
1286
1471
  href: "https://twitter.com/carbonplanorg",
1287
1472
  sx: {
1288
1473
  textDecoration: 'none',
@@ -1376,6 +1561,112 @@ var Footer = function Footer() {
1376
1561
  }))));
1377
1562
  };
1378
1563
 
1564
+ var Dimmer = function Dimmer(_ref) {
1565
+ var sx = _ref.sx,
1566
+ props = _objectWithoutPropertiesLoose(_ref, ["sx"]);
1567
+
1568
+ var _useColorMode = useColorMode(),
1569
+ colorMode = _useColorMode[0],
1570
+ setColorMode = _useColorMode[1];
1571
+
1572
+ var toggle = useCallback(function () {
1573
+ setColorMode(colorMode === 'light' ? 'dark' : 'light');
1574
+ }, [colorMode]);
1575
+ return /*#__PURE__*/React.createElement(IconButton, _extends({
1576
+ "aria-label": "Toggle dark mode",
1577
+ onClick: toggle,
1578
+ role: "checkbox",
1579
+ sx: _extends({
1580
+ width: 32,
1581
+ height: 32,
1582
+ display: 'inline-block',
1583
+ cursor: 'pointer',
1584
+ color: 'secondary'
1585
+ }, sx)
1586
+ }, props), /*#__PURE__*/React.createElement(Sun, {
1587
+ sx: {
1588
+ strokeWidth: '1.75',
1589
+ transition: 'stroke 0.15s',
1590
+ '@media (hover: hover) and (pointer: fine)': {
1591
+ '&:hover': {
1592
+ stroke: 'primary'
1593
+ }
1594
+ }
1595
+ }
1596
+ }));
1597
+ };
1598
+
1599
+ var GitSha = function GitSha() {
1600
+ var sha = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
1601
+ var owner = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER;
1602
+ var slug = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG;
1603
+
1604
+ var _useThemeUI = useThemeUI(),
1605
+ theme = _useThemeUI.theme;
1606
+
1607
+ var color = theme.rawColors.secondary;
1608
+
1609
+ if (sha && owner && slug) {
1610
+ var shortSha = sha.substring(0, 7);
1611
+ var href = 'https://github.com/' + owner + '/' + slug + '/tree/' + sha;
1612
+ return /*#__PURE__*/React.createElement(Box, {
1613
+ sx: {
1614
+ display: 'inline-block'
1615
+ }
1616
+ }, /*#__PURE__*/React.createElement(Separator, {
1617
+ color: color
1618
+ }), /*#__PURE__*/React.createElement(Link$2, {
1619
+ href: href,
1620
+ sx: {
1621
+ whiteSpace: 'nowrap',
1622
+ display: 'inline-block',
1623
+ ml: [2],
1624
+ fontFamily: 'mono',
1625
+ letterSpacing: 'body',
1626
+ color: color,
1627
+ fontSize: [1],
1628
+ textTransform: 'uppercase',
1629
+ textDecoration: 'none'
1630
+ }
1631
+ }, shortSha));
1632
+ } else {
1633
+ // fallback
1634
+ return /*#__PURE__*/React.createElement(Box, {
1635
+ sx: {
1636
+ display: 'inline-block'
1637
+ }
1638
+ }, /*#__PURE__*/React.createElement(Separator, {
1639
+ color: color
1640
+ }), /*#__PURE__*/React.createElement(Text, {
1641
+ sx: {
1642
+ whiteSpace: 'nowrap',
1643
+ display: 'inline-block',
1644
+ ml: [2],
1645
+ fontFamily: 'mono',
1646
+ letterSpacing: 'body',
1647
+ color: color,
1648
+ fontSize: [1],
1649
+ textTransform: 'uppercase'
1650
+ }
1651
+ }, color));
1652
+ }
1653
+ };
1654
+
1655
+ var Separator = function Separator(_ref) {
1656
+ var color = _ref.color;
1657
+ return /*#__PURE__*/React.createElement("svg", {
1658
+ fill: color,
1659
+ opacity: "0.8",
1660
+ viewBox: "0 0 24 24",
1661
+ width: "24",
1662
+ height: "24"
1663
+ }, /*#__PURE__*/React.createElement("circle", {
1664
+ r: 5,
1665
+ cx: 19,
1666
+ cy: 19
1667
+ }));
1668
+ };
1669
+
1379
1670
  var Value = function Value(_ref) {
1380
1671
  var mode = _ref.mode;
1381
1672
 
@@ -1425,11 +1716,6 @@ var Value = function Value(_ref) {
1425
1716
 
1426
1717
  var Metadata = function Metadata(_ref2) {
1427
1718
  var mode = _ref2.mode;
1428
-
1429
- var _useThemeUI = useThemeUI(),
1430
- theme = _useThemeUI.theme;
1431
-
1432
- var color = theme.rawColors.secondary;
1433
1719
  return /*#__PURE__*/React.createElement(Box, {
1434
1720
  sx: {
1435
1721
  userSelect: 'none',
@@ -1442,28 +1728,7 @@ var Metadata = function Metadata(_ref2) {
1442
1728
  }
1443
1729
  }, /*#__PURE__*/React.createElement(Value, {
1444
1730
  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));
1731
+ }), /*#__PURE__*/React.createElement(GitSha, null));
1467
1732
  };
1468
1733
 
1469
1734
  function init(mode) {
@@ -1642,6 +1907,110 @@ function GuideColumns(_ref2) {
1642
1907
  }));
1643
1908
  }
1644
1909
 
1910
+ var Settings = function Settings(_ref) {
1911
+ var value = _ref.value,
1912
+ sx = _ref.sx,
1913
+ props = _objectWithoutPropertiesLoose(_ref, ["value", "sx"]);
1914
+
1915
+ return /*#__PURE__*/React.createElement(IconButton, _extends({
1916
+ sx: _extends({
1917
+ cursor: 'pointer',
1918
+ fill: 'none',
1919
+ strokeWidth: '2px',
1920
+ stroke: 'text',
1921
+ '.paren': {
1922
+ opacity: '0'
1923
+ },
1924
+ '@media (hover: hover) and (pointer: fine)': {
1925
+ '&:hover .paren': {
1926
+ opacity: '1'
1927
+ }
1928
+ }
1929
+ }, sx),
1930
+ "aria-label": "Toggle Menu"
1931
+ }, props), !value && /*#__PURE__*/React.createElement("svg", {
1932
+ style: {
1933
+ width: '50px',
1934
+ height: '30px',
1935
+ transform: 'scale(2)',
1936
+ marginTop: '-3px'
1937
+ },
1938
+ xmlns: "http://www.w3.org/2000/svg",
1939
+ viewBox: "0 0 68 36"
1940
+ }, /*#__PURE__*/React.createElement("line", {
1941
+ x1: "24",
1942
+ y1: "2.1",
1943
+ x2: "24",
1944
+ y2: "6.1"
1945
+ }), /*#__PURE__*/React.createElement("line", {
1946
+ x1: "24",
1947
+ y1: "24.1",
1948
+ x2: "24",
1949
+ y2: "33.9"
1950
+ }), /*#__PURE__*/React.createElement("line", {
1951
+ x1: "44",
1952
+ y1: "2.1",
1953
+ x2: "44",
1954
+ y2: "12.1"
1955
+ }), /*#__PURE__*/React.createElement("line", {
1956
+ x1: "44",
1957
+ y1: "30.1",
1958
+ x2: "44",
1959
+ y2: "33.9"
1960
+ }), /*#__PURE__*/React.createElement("circle", {
1961
+ cx: "24",
1962
+ cy: "15.1",
1963
+ r: "5"
1964
+ }), /*#__PURE__*/React.createElement("circle", {
1965
+ cx: "44",
1966
+ cy: "21.1",
1967
+ r: "5"
1968
+ }), /*#__PURE__*/React.createElement("path", {
1969
+ style: {
1970
+ transition: 'all 0.2s'
1971
+ },
1972
+ className: "paren",
1973
+ d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
1974
+ }), /*#__PURE__*/React.createElement("path", {
1975
+ style: {
1976
+ transition: 'all 0.2s'
1977
+ },
1978
+ className: "paren",
1979
+ d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
1980
+ })), value && /*#__PURE__*/React.createElement("svg", {
1981
+ style: {
1982
+ width: '50px',
1983
+ height: '30px',
1984
+ transform: 'scale(2)',
1985
+ marginTop: '-3px'
1986
+ },
1987
+ xmlns: "http://www.w3.org/2000/svg",
1988
+ viewBox: "0 0 68 36"
1989
+ }, /*#__PURE__*/React.createElement("line", {
1990
+ x1: "50.85",
1991
+ y1: "29.79",
1992
+ x2: "17.15",
1993
+ y2: "6.21"
1994
+ }), /*#__PURE__*/React.createElement("line", {
1995
+ x1: "17.15",
1996
+ y1: "29.79",
1997
+ x2: "50.85",
1998
+ y2: "6.21"
1999
+ }), /*#__PURE__*/React.createElement("path", {
2000
+ style: {
2001
+ transition: 'all 0.2s'
2002
+ },
2003
+ className: "paren",
2004
+ d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
2005
+ }), /*#__PURE__*/React.createElement("path", {
2006
+ style: {
2007
+ transition: 'all 0.2s'
2008
+ },
2009
+ className: "paren",
2010
+ d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
2011
+ })));
2012
+ };
2013
+
1645
2014
  var Layout = function Layout(_ref) {
1646
2015
  var title = _ref.title,
1647
2016
  description = _ref.description,
@@ -1669,6 +2038,7 @@ var Layout = function Layout(_ref) {
1669
2038
  _ref$container = _ref.container,
1670
2039
  container = _ref$container === void 0 ? true : _ref$container;
1671
2040
  var content = children;
2041
+ var index = useBreakpointIndex();
1672
2042
 
1673
2043
  if (fade) {
1674
2044
  content = /*#__PURE__*/React.createElement(FadeIn, {
@@ -1677,7 +2047,34 @@ var Layout = function Layout(_ref) {
1677
2047
  }
1678
2048
 
1679
2049
  if (container) {
1680
- content = /*#__PURE__*/React.createElement(Container, null, content);
2050
+ content = /*#__PURE__*/React.createElement(Box, {
2051
+ sx: {
2052
+ mb: [8, 8, 9, 10]
2053
+ }
2054
+ }, /*#__PURE__*/React.createElement(Container, null, content));
2055
+ }
2056
+
2057
+ useEffect(function () {
2058
+ if (index > 2 && settings != null && settings.value && settings != null && settings.onClick) {
2059
+ settings == null ? void 0 : settings.onClick();
2060
+ }
2061
+ }, [index, settings == null ? void 0 : settings.value, settings == null ? void 0 : settings.onClick]);
2062
+ var menuItems = [/*#__PURE__*/React.createElement(Dimmer, {
2063
+ key: "dimmer",
2064
+ sx: {
2065
+ color: 'primary',
2066
+ mt: '-2px',
2067
+ display: ['block', 'block', dimmer === 'top' ? 'block' : 'none', dimmer === 'top' ? 'block' : 'none']
2068
+ }
2069
+ })];
2070
+
2071
+ if (settings) {
2072
+ menuItems.push( /*#__PURE__*/React.createElement(Settings, _extends({
2073
+ key: "settings",
2074
+ sx: {
2075
+ display: ['inherit', 'inherit', 'none', 'none']
2076
+ }
2077
+ }, settings)));
1681
2078
  }
1682
2079
 
1683
2080
  return /*#__PURE__*/React.createElement(React.Fragment, null, guide && /*#__PURE__*/React.createElement(Guide, {
@@ -1709,8 +2106,7 @@ var Layout = function Layout(_ref) {
1709
2106
  mode: links,
1710
2107
  status: status,
1711
2108
  nav: nav,
1712
- settings: settings,
1713
- dimmer: dimmer
2109
+ menuItems: menuItems
1714
2110
  }))), /*#__PURE__*/React.createElement(Box, {
1715
2111
  sx: {
1716
2112
  width: '100%',
@@ -2035,7 +2431,7 @@ var Group = function Group(_ref) {
2035
2431
  }));
2036
2432
  };
2037
2433
 
2038
- var Input = function Input(_ref) {
2434
+ var Input = function Input(_ref, ref) {
2039
2435
  var _extends2;
2040
2436
 
2041
2437
  var _ref$size = _ref.size,
@@ -2068,10 +2464,13 @@ var Input = function Input(_ref) {
2068
2464
  }, _extends2), getSizeStyles(size), sx);
2069
2465
 
2070
2466
  return /*#__PURE__*/React.createElement(Input$1, _extends({}, props, {
2467
+ ref: ref,
2071
2468
  sx: styles
2072
2469
  }));
2073
2470
  };
2074
2471
 
2472
+ var input = forwardRef(Input);
2473
+
2075
2474
  var getProps = function getProps(test) {
2076
2475
  return function (props) {
2077
2476
  var next = {};
@@ -2091,7 +2490,8 @@ var Select = function Select(_ref) {
2091
2490
  _ref$size = _ref.size,
2092
2491
  size = _ref$size === void 0 ? 'sm' : _ref$size,
2093
2492
  sx = _ref.sx,
2094
- props = _objectWithoutPropertiesLoose(_ref, ["children", "size", "sx"]);
2493
+ sxSelect = _ref.sxSelect,
2494
+ props = _objectWithoutPropertiesLoose(_ref, ["children", "size", "sx", "sxSelect"]);
2095
2495
 
2096
2496
  var color = sx && sx.color ? sx.color : 'primary';
2097
2497
  var sizeStyles = getSizeStyles(size);
@@ -2162,7 +2562,7 @@ var Select = function Select(_ref) {
2162
2562
  outline: 'none !important',
2163
2563
  background: 'transparent !important'
2164
2564
  }
2165
- }, _extends2))
2565
+ }, _extends2), sxSelect)
2166
2566
  }, omitOnChange), children), /*#__PURE__*/React.createElement(Arrow, {
2167
2567
  sx: {
2168
2568
  width: width,
@@ -2177,7 +2577,7 @@ var Select = function Select(_ref) {
2177
2577
  }));
2178
2578
  };
2179
2579
 
2180
- var Slider = function Slider(_ref) {
2580
+ var Slider = function Slider(_ref, ref) {
2181
2581
  var sx = _ref.sx,
2182
2582
  props = _objectWithoutPropertiesLoose(_ref, ["sx"]);
2183
2583
 
@@ -2187,6 +2587,7 @@ var Slider = function Slider(_ref) {
2187
2587
  colors = _useThemeUI.theme.rawColors;
2188
2588
 
2189
2589
  return /*#__PURE__*/React.createElement(Slider$1, _extends({
2590
+ ref: ref,
2190
2591
  sx: _extends({
2191
2592
  '&::-webkit-slider-thumb': {
2192
2593
  height: [22, 18, 16],
@@ -2218,7 +2619,9 @@ var Slider = function Slider(_ref) {
2218
2619
  }, props));
2219
2620
  };
2220
2621
 
2221
- var styles = {
2622
+ var slider = forwardRef(Slider);
2623
+
2624
+ var styles$1 = {
2222
2625
  reset: {
2223
2626
  verticalAlign: 'baseline',
2224
2627
  border: 0,
@@ -2290,7 +2693,7 @@ var Table = function Table(_ref) {
2290
2693
  }
2291
2694
  }, header && /*#__PURE__*/React.createElement(Row, {
2292
2695
  as: "tr",
2293
- sx: _extends({}, styles.reset, styles.header, styles.row, {
2696
+ sx: _extends({}, styles$1.reset, styles$1.header, styles$1.row, {
2294
2697
  color: color,
2295
2698
  borderTopWidth: !borderTop ? '0px' : '1px'
2296
2699
  })
@@ -2298,13 +2701,13 @@ var Table = function Table(_ref) {
2298
2701
  as: "td",
2299
2702
  start: [1],
2300
2703
  width: columns,
2301
- sx: styles.index
2704
+ sx: styles$1.index
2302
2705
  }, header)), data.map(function (row, i) {
2303
2706
  return /*#__PURE__*/React.createElement(Row, {
2304
2707
  as: "tr",
2305
2708
  columns: columns,
2306
2709
  key: i,
2307
- sx: _extends({}, styles.reset, styles.row, {
2710
+ sx: _extends({}, styles$1.reset, styles$1.row, {
2308
2711
  pb: borderBottom && i === data.length - 1 ? ['18px', '18px', '18px', '22px'] : [3, 3, 3, '20px'],
2309
2712
  borderBottomWidth: borderBottom && i === data.length - 1 ? '1px' : '0px',
2310
2713
  borderTopWidth: !borderTop && i === 0 && !header ? '0px' : '1px'
@@ -2315,13 +2718,13 @@ var Table = function Table(_ref) {
2315
2718
  key: j,
2316
2719
  start: start[j],
2317
2720
  width: width[j],
2318
- sx: j == 0 && index ? _extends({}, styles.reset, styles.index) : _extends({}, styles.reset, styles.entry)
2721
+ sx: j == 0 && index ? _extends({}, styles$1.reset, styles$1.index) : _extends({}, styles$1.reset, styles$1.entry)
2319
2722
  }, column);
2320
2723
  }));
2321
2724
  })));
2322
2725
  };
2323
2726
 
2324
- var Toggle = function Toggle(_ref) {
2727
+ var Toggle = function Toggle(_ref, ref) {
2325
2728
  var value = _ref.value,
2326
2729
  onClick = _ref.onClick,
2327
2730
  disabled = _ref.disabled,
@@ -2331,6 +2734,7 @@ var Toggle = function Toggle(_ref) {
2331
2734
  var color = sx && sx.color ? sx.color : 'primary';
2332
2735
  value = disabled ? false : value;
2333
2736
  return /*#__PURE__*/React.createElement(Box, _extends({
2737
+ ref: ref,
2334
2738
  as: "button",
2335
2739
  onClick: onClick,
2336
2740
  role: "checkbox",
@@ -2368,6 +2772,8 @@ var Toggle = function Toggle(_ref) {
2368
2772
  })));
2369
2773
  };
2370
2774
 
2775
+ var toggle = forwardRef(Toggle);
2776
+
2371
2777
  var Tracking = function Tracking(_ref) {
2372
2778
  var id = _ref.id;
2373
2779
 
@@ -2391,7 +2797,6 @@ var Tray = function Tray(_ref) {
2391
2797
  children = _ref.children;
2392
2798
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
2393
2799
  sx: {
2394
- display: ['initial', 'initial', 'none', 'none'],
2395
2800
  position: 'fixed',
2396
2801
  top: '56px',
2397
2802
  bottom: '0px',
@@ -2406,7 +2811,6 @@ var Tray = function Tray(_ref) {
2406
2811
  }
2407
2812
  }), /*#__PURE__*/React.createElement(Box, {
2408
2813
  sx: _extends({
2409
- display: ['initial', 'initial', 'none', 'none'],
2410
2814
  position: 'fixed',
2411
2815
  width: 'calc(100vw)',
2412
2816
  top: '0px',
@@ -2466,5 +2870,5 @@ var formatDate = function formatDate(date, options) {
2466
2870
  return [month, day, year].filter(Boolean).join(' ');
2467
2871
  };
2468
2872
 
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, Settings, Slider, Table, Tag, Toggle, Tracking, Tray, formatDate, getScrollbarWidth };
2873
+ 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
2874
  //# sourceMappingURL=index.esm.js.map