@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 +332 -88
- package/dst/index.esm.js.map +1 -1
- package/dst/index.js +524 -278
- package/dst/index.js.map +1 -1
- package/dst/index.modern.js +330 -90
- package/dst/index.modern.js.map +1 -1
- package/package.json +4 -4
package/dst/index.modern.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { cloneElement, useCallback, useState, useEffect, useRef } from 'react';
|
|
2
|
-
import { Box, Link as Link$
|
|
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,12 +40,14 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
40
40
|
return target;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const
|
|
43
|
+
const _excluded$g = ["sx", "children"];
|
|
44
|
+
|
|
45
|
+
const Badge = _ref => {
|
|
44
46
|
let {
|
|
45
47
|
sx,
|
|
46
48
|
children
|
|
47
49
|
} = _ref,
|
|
48
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
50
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
49
51
|
|
|
50
52
|
const color = sx && sx.color ? sx.color : 'primary';
|
|
51
53
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
@@ -70,12 +72,19 @@ const Badge = (_ref) => {
|
|
|
70
72
|
}, children));
|
|
71
73
|
};
|
|
72
74
|
|
|
75
|
+
const _excluded$f = ["href", "children", "internal", "tracking"];
|
|
76
|
+
|
|
73
77
|
const event = ({
|
|
74
78
|
action,
|
|
75
79
|
category,
|
|
76
80
|
label,
|
|
77
81
|
value
|
|
78
82
|
}) => {
|
|
83
|
+
if (typeof window.gtag !== 'function') {
|
|
84
|
+
console.warn(`Missing window.gtag, skipping analytics action: '${action}'.`);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
79
88
|
window.gtag('event', action, {
|
|
80
89
|
event_category: category,
|
|
81
90
|
event_label: label,
|
|
@@ -83,20 +92,22 @@ const event = ({
|
|
|
83
92
|
});
|
|
84
93
|
};
|
|
85
94
|
|
|
86
|
-
const Link = (_ref) => {
|
|
95
|
+
const Link = (_ref, ref) => {
|
|
87
96
|
let {
|
|
88
97
|
href,
|
|
89
98
|
children,
|
|
90
99
|
internal = false,
|
|
91
100
|
tracking = false
|
|
92
101
|
} = _ref,
|
|
93
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
102
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
94
103
|
|
|
95
104
|
if (internal || href && href.startsWith('/')) {
|
|
96
105
|
return /*#__PURE__*/React.createElement(NextLink, {
|
|
97
106
|
href: href,
|
|
98
107
|
passHref: true
|
|
99
|
-
}, /*#__PURE__*/React.createElement(Link$
|
|
108
|
+
}, /*#__PURE__*/React.createElement(Link$2, _extends({
|
|
109
|
+
ref: ref
|
|
110
|
+
}, props), children));
|
|
100
111
|
} else if (tracking) {
|
|
101
112
|
let action;
|
|
102
113
|
let category;
|
|
@@ -117,18 +128,22 @@ const Link = (_ref) => {
|
|
|
117
128
|
});
|
|
118
129
|
};
|
|
119
130
|
|
|
120
|
-
return /*#__PURE__*/React.createElement(Link$
|
|
131
|
+
return /*#__PURE__*/React.createElement(Link$2, _extends({
|
|
132
|
+
ref: ref,
|
|
121
133
|
onClick: track,
|
|
122
134
|
onContextMenu: track,
|
|
123
135
|
href: href
|
|
124
136
|
}, props), children);
|
|
125
137
|
} else {
|
|
126
|
-
return /*#__PURE__*/React.createElement(Link$
|
|
138
|
+
return /*#__PURE__*/React.createElement(Link$2, _extends({
|
|
139
|
+
ref: ref,
|
|
127
140
|
href: href
|
|
128
141
|
}, props), children);
|
|
129
142
|
}
|
|
130
143
|
};
|
|
131
144
|
|
|
145
|
+
var Link$1 = forwardRef(Link);
|
|
146
|
+
|
|
132
147
|
const getSizeStyles = size => {
|
|
133
148
|
if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(size)) {
|
|
134
149
|
throw new Error('Size must be xs, sm, md, lg, or xl');
|
|
@@ -179,7 +194,9 @@ const getSizeStyles = size => {
|
|
|
179
194
|
};
|
|
180
195
|
};
|
|
181
196
|
|
|
182
|
-
const
|
|
197
|
+
const _excluded$e = ["size", "prefix", "suffix", "inverted", "sx", "children", "align", "href", "internal", "tracking"];
|
|
198
|
+
|
|
199
|
+
const Button = (_ref, ref) => {
|
|
183
200
|
let {
|
|
184
201
|
size = 'sm',
|
|
185
202
|
prefix,
|
|
@@ -192,7 +209,7 @@ const Button = (_ref) => {
|
|
|
192
209
|
internal,
|
|
193
210
|
tracking
|
|
194
211
|
} = _ref,
|
|
195
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
212
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
196
213
|
|
|
197
214
|
if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(size)) {
|
|
198
215
|
throw new Error('Size must be xs, sm, md, lg, or xl');
|
|
@@ -350,7 +367,8 @@ const Button = (_ref) => {
|
|
|
350
367
|
}, suffix && suffix));
|
|
351
368
|
|
|
352
369
|
if (href) {
|
|
353
|
-
return /*#__PURE__*/React.createElement(Link, _extends({
|
|
370
|
+
return /*#__PURE__*/React.createElement(Link$1, _extends({
|
|
371
|
+
ref: ref,
|
|
354
372
|
href: href,
|
|
355
373
|
internal: internal,
|
|
356
374
|
tracking: tracking,
|
|
@@ -360,13 +378,18 @@ const Button = (_ref) => {
|
|
|
360
378
|
}, props), Inner);
|
|
361
379
|
} else {
|
|
362
380
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
381
|
+
ref: ref,
|
|
363
382
|
as: "button",
|
|
364
383
|
sx: style
|
|
365
384
|
}, props), Inner);
|
|
366
385
|
}
|
|
367
386
|
};
|
|
368
387
|
|
|
369
|
-
|
|
388
|
+
var button = forwardRef(Button);
|
|
389
|
+
|
|
390
|
+
const _excluded$d = ["label", "children", "inverted", "color", "href", "internal", "tracking", "sx"];
|
|
391
|
+
|
|
392
|
+
const Callout = (_ref, ref) => {
|
|
370
393
|
let {
|
|
371
394
|
label,
|
|
372
395
|
children,
|
|
@@ -377,7 +400,7 @@ const Callout = (_ref) => {
|
|
|
377
400
|
tracking,
|
|
378
401
|
sx
|
|
379
402
|
} = _ref,
|
|
380
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
403
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
381
404
|
|
|
382
405
|
const baseColor = color || (inverted ? 'secondary' : 'primary');
|
|
383
406
|
const hoverColor = color ? 'primary' : inverted ? 'primary' : 'secondary';
|
|
@@ -442,7 +465,8 @@ const Callout = (_ref) => {
|
|
|
442
465
|
})));
|
|
443
466
|
|
|
444
467
|
if (href) {
|
|
445
|
-
return /*#__PURE__*/React.createElement(Link, _extends({
|
|
468
|
+
return /*#__PURE__*/React.createElement(Link$1, _extends({
|
|
469
|
+
ref: ref,
|
|
446
470
|
href: href,
|
|
447
471
|
internal: internal,
|
|
448
472
|
tracking: tracking,
|
|
@@ -450,13 +474,155 @@ const Callout = (_ref) => {
|
|
|
450
474
|
}, props), Inner);
|
|
451
475
|
} else {
|
|
452
476
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
477
|
+
ref: ref,
|
|
453
478
|
as: "button",
|
|
454
479
|
sx: style
|
|
455
480
|
}, props), Inner);
|
|
456
481
|
}
|
|
457
482
|
};
|
|
458
483
|
|
|
459
|
-
|
|
484
|
+
var callout = forwardRef(Callout);
|
|
485
|
+
|
|
486
|
+
const _excluded$c = ["colormap", "label", "clim", "discrete", "units", "width", "height", "format", "horizontal"];
|
|
487
|
+
const sx$2 = {
|
|
488
|
+
clim: {
|
|
489
|
+
fontFamily: 'mono',
|
|
490
|
+
fontSize: ['9px', 0, 0, 1],
|
|
491
|
+
letterSpacing: 'smallcaps',
|
|
492
|
+
textTransform: 'uppercase'
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
const DIMENSIONS = {
|
|
496
|
+
width: ['10px', '16px', '16px', '17px'],
|
|
497
|
+
height: ['80px', '110px', '110px', '130px']
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
const Gradient = ({
|
|
501
|
+
colormap,
|
|
502
|
+
discrete,
|
|
503
|
+
horizontal,
|
|
504
|
+
width,
|
|
505
|
+
height
|
|
506
|
+
}) => {
|
|
507
|
+
const step = 1 / colormap.length * 100;
|
|
508
|
+
const values = colormap.map((d, i) => {
|
|
509
|
+
return `rgb(${d}) ${i * step}% ${discrete && i < colormap.length - 1 ? `${(i + 1) * step}%` : ''}`;
|
|
510
|
+
});
|
|
511
|
+
const css = `linear-gradient(to ${horizontal ? 'right' : 'top'}, ${values.join(',')})`;
|
|
512
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
513
|
+
sx: _extends({}, horizontal ? {
|
|
514
|
+
width: width || DIMENSIONS.height,
|
|
515
|
+
height: height || DIMENSIONS.width
|
|
516
|
+
} : {
|
|
517
|
+
width: width || DIMENSIONS.width,
|
|
518
|
+
minHeight: height || DIMENSIONS.height
|
|
519
|
+
}, {
|
|
520
|
+
mt: horizontal ? [0, '1px', '1px', 0] : 0,
|
|
521
|
+
border: ({
|
|
522
|
+
colors
|
|
523
|
+
}) => `solid 1px ${colors.hinted}`,
|
|
524
|
+
background: css
|
|
525
|
+
})
|
|
526
|
+
});
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
const Label = ({
|
|
530
|
+
label,
|
|
531
|
+
units,
|
|
532
|
+
horizontal
|
|
533
|
+
}) => /*#__PURE__*/React.createElement(Box, {
|
|
534
|
+
sx: !horizontal && {
|
|
535
|
+
alignSelf: 'flex-end'
|
|
536
|
+
}
|
|
537
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
538
|
+
sx: _extends({
|
|
539
|
+
mb: horizontal ? 0 : ['-4px', '-4px', '-4px', '-3px'],
|
|
540
|
+
fontFamily: 'mono',
|
|
541
|
+
fontSize: ['9px', 0, 0, 1],
|
|
542
|
+
letterSpacing: 'smallcaps',
|
|
543
|
+
textTransform: 'uppercase'
|
|
544
|
+
}, horizontal ? {} : {
|
|
545
|
+
writingMode: 'vertical-rl',
|
|
546
|
+
transform: 'rotate(180deg)',
|
|
547
|
+
whiteSpace: 'nowrap',
|
|
548
|
+
display: 'inline-block',
|
|
549
|
+
overflow: 'visible'
|
|
550
|
+
})
|
|
551
|
+
}, label, ' ', /*#__PURE__*/React.createElement(Box, {
|
|
552
|
+
as: "span",
|
|
553
|
+
sx: {
|
|
554
|
+
textTransform: 'none',
|
|
555
|
+
color: 'secondary',
|
|
556
|
+
display: 'inline-block'
|
|
557
|
+
}
|
|
558
|
+
}, units)));
|
|
559
|
+
|
|
560
|
+
const Colorbar = _ref => {
|
|
561
|
+
let {
|
|
562
|
+
colormap,
|
|
563
|
+
label,
|
|
564
|
+
clim,
|
|
565
|
+
discrete,
|
|
566
|
+
units,
|
|
567
|
+
width,
|
|
568
|
+
height,
|
|
569
|
+
format = d => d,
|
|
570
|
+
horizontal = false
|
|
571
|
+
} = _ref,
|
|
572
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
573
|
+
|
|
574
|
+
if (!Array.isArray(colormap)) {
|
|
575
|
+
throw new Error(`expected array for colormap, got '${colormap}'.`);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
const ClimMin = () => {
|
|
579
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
580
|
+
sx: _extends({}, sx$2.clim, {
|
|
581
|
+
ml: label ? horizontal ? '10px' : '2px' : 0,
|
|
582
|
+
mr: horizontal ? ['2px', '1px', '1px', '2px'] : 0,
|
|
583
|
+
mb: horizontal ? 0 : ['-2px', '-2px', '-2px', '-3px']
|
|
584
|
+
})
|
|
585
|
+
}, format(clim[0]));
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
const ClimMax = () => {
|
|
589
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
590
|
+
sx: _extends({}, sx$2.clim, {
|
|
591
|
+
ml: horizontal ? ['2px', '1px', '1px', '2px'] : '2px',
|
|
592
|
+
mt: horizontal ? 0 : ['-2px', '-3px', '-3px', '-3px']
|
|
593
|
+
})
|
|
594
|
+
}, format(clim[1]));
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
598
|
+
sx: _extends({}, props.sx, {
|
|
599
|
+
flexDirection: 'row',
|
|
600
|
+
alignItems: 'center',
|
|
601
|
+
justifyContent: 'flex-start',
|
|
602
|
+
gap: ['3px', '6px', '6px', '7px']
|
|
603
|
+
})
|
|
604
|
+
}, label && /*#__PURE__*/React.createElement(Label, {
|
|
605
|
+
label: label,
|
|
606
|
+
units: units,
|
|
607
|
+
horizontal: horizontal
|
|
608
|
+
}), horizontal && clim && /*#__PURE__*/React.createElement(ClimMin, null), /*#__PURE__*/React.createElement(Gradient, {
|
|
609
|
+
colormap: colormap,
|
|
610
|
+
horizontal: horizontal,
|
|
611
|
+
discrete: discrete,
|
|
612
|
+
width: width,
|
|
613
|
+
height: height
|
|
614
|
+
}), horizontal && clim && /*#__PURE__*/React.createElement(ClimMax, null), !horizontal && /*#__PURE__*/React.createElement(Flex, {
|
|
615
|
+
sx: {
|
|
616
|
+
flexDirection: 'column-reverse',
|
|
617
|
+
justifyContent: 'space-between',
|
|
618
|
+
height: height || DIMENSIONS.height
|
|
619
|
+
}
|
|
620
|
+
}, clim && /*#__PURE__*/React.createElement(ClimMin, null), clim && /*#__PURE__*/React.createElement(ClimMax, null)));
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
const _excluded$b = ["start", "width", "dl", "dr", "children", "sx"];
|
|
624
|
+
|
|
625
|
+
const Column = _ref => {
|
|
460
626
|
let {
|
|
461
627
|
start,
|
|
462
628
|
width,
|
|
@@ -465,7 +631,7 @@ const Column = (_ref) => {
|
|
|
465
631
|
children,
|
|
466
632
|
sx
|
|
467
633
|
} = _ref,
|
|
468
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
634
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
469
635
|
|
|
470
636
|
start = start || 'auto';
|
|
471
637
|
width = width || 'auto';
|
|
@@ -633,7 +799,7 @@ const Meta = ({
|
|
|
633
799
|
}));
|
|
634
800
|
};
|
|
635
801
|
|
|
636
|
-
const Logo =
|
|
802
|
+
const Logo = _ref => {
|
|
637
803
|
let props = _extends({}, _ref);
|
|
638
804
|
|
|
639
805
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
@@ -669,14 +835,16 @@ const Logo = (_ref) => {
|
|
|
669
835
|
})));
|
|
670
836
|
};
|
|
671
837
|
|
|
672
|
-
const
|
|
838
|
+
const _excluded$a = ["children", "sx", "columns", "gap"];
|
|
839
|
+
|
|
840
|
+
const Row = _ref => {
|
|
673
841
|
let {
|
|
674
842
|
children,
|
|
675
843
|
sx,
|
|
676
844
|
columns,
|
|
677
845
|
gap
|
|
678
846
|
} = _ref,
|
|
679
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
847
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
680
848
|
|
|
681
849
|
const makeArray = input => {
|
|
682
850
|
if (!Array.isArray(input)) {
|
|
@@ -724,12 +892,14 @@ const Row = (_ref) => {
|
|
|
724
892
|
}), children);
|
|
725
893
|
};
|
|
726
894
|
|
|
727
|
-
const
|
|
895
|
+
const _excluded$9 = ["value", "sx"];
|
|
896
|
+
|
|
897
|
+
const Menu = _ref => {
|
|
728
898
|
let {
|
|
729
899
|
value,
|
|
730
900
|
sx
|
|
731
901
|
} = _ref,
|
|
732
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
902
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
733
903
|
|
|
734
904
|
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
735
905
|
sx: _extends({
|
|
@@ -817,12 +987,14 @@ const Menu = (_ref) => {
|
|
|
817
987
|
})));
|
|
818
988
|
};
|
|
819
989
|
|
|
820
|
-
const
|
|
990
|
+
const _excluded$8 = ["value", "sx"];
|
|
991
|
+
|
|
992
|
+
const Settings = _ref => {
|
|
821
993
|
let {
|
|
822
994
|
value,
|
|
823
995
|
sx
|
|
824
996
|
} = _ref,
|
|
825
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
997
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
826
998
|
|
|
827
999
|
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
828
1000
|
sx: _extends({
|
|
@@ -830,7 +1002,6 @@ const Settings = (_ref) => {
|
|
|
830
1002
|
fill: 'none',
|
|
831
1003
|
strokeWidth: '2px',
|
|
832
1004
|
stroke: 'text',
|
|
833
|
-
fill: 'background',
|
|
834
1005
|
'.paren': {
|
|
835
1006
|
opacity: '0'
|
|
836
1007
|
},
|
|
@@ -854,22 +1025,22 @@ const Settings = (_ref) => {
|
|
|
854
1025
|
x1: "24",
|
|
855
1026
|
y1: "2.1",
|
|
856
1027
|
x2: "24",
|
|
1028
|
+
y2: "6.1"
|
|
1029
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
1030
|
+
x1: "24",
|
|
1031
|
+
y1: "24.1",
|
|
1032
|
+
x2: "24",
|
|
857
1033
|
y2: "33.9"
|
|
858
1034
|
}), /*#__PURE__*/React.createElement("line", {
|
|
859
1035
|
x1: "44",
|
|
860
1036
|
y1: "2.1",
|
|
861
1037
|
x2: "44",
|
|
1038
|
+
y2: "12.1"
|
|
1039
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
1040
|
+
x1: "44",
|
|
1041
|
+
y1: "30.1",
|
|
1042
|
+
x2: "44",
|
|
862
1043
|
y2: "33.9"
|
|
863
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
864
|
-
cx: "24",
|
|
865
|
-
cy: "15.1",
|
|
866
|
-
r: "9",
|
|
867
|
-
stroke: "none"
|
|
868
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
869
|
-
cx: "44",
|
|
870
|
-
cy: "21.1",
|
|
871
|
-
r: "9",
|
|
872
|
-
stroke: "none"
|
|
873
1044
|
}), /*#__PURE__*/React.createElement("circle", {
|
|
874
1045
|
cx: "24",
|
|
875
1046
|
cy: "15.1",
|
|
@@ -924,11 +1095,13 @@ const Settings = (_ref) => {
|
|
|
924
1095
|
})));
|
|
925
1096
|
};
|
|
926
1097
|
|
|
927
|
-
const
|
|
1098
|
+
const _excluded$7 = ["sx"];
|
|
1099
|
+
|
|
1100
|
+
const Dimmer = _ref => {
|
|
928
1101
|
let {
|
|
929
1102
|
sx
|
|
930
1103
|
} = _ref,
|
|
931
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
1104
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
932
1105
|
|
|
933
1106
|
const [colorMode, setColorMode] = useColorMode();
|
|
934
1107
|
const toggle = useCallback(() => {
|
|
@@ -958,7 +1131,7 @@ const Dimmer = (_ref) => {
|
|
|
958
1131
|
}));
|
|
959
1132
|
};
|
|
960
1133
|
|
|
961
|
-
const sx = {
|
|
1134
|
+
const sx$1 = {
|
|
962
1135
|
link: (current, label, first = false) => {
|
|
963
1136
|
return {
|
|
964
1137
|
width: 'auto',
|
|
@@ -1037,16 +1210,16 @@ const Nav = ({
|
|
|
1037
1210
|
return /*#__PURE__*/React.createElement(NextLink, {
|
|
1038
1211
|
href: href,
|
|
1039
1212
|
passHref: true
|
|
1040
|
-
}, /*#__PURE__*/React.createElement(Link$
|
|
1213
|
+
}, /*#__PURE__*/React.createElement(Link$2, {
|
|
1041
1214
|
onClick: () => {
|
|
1042
1215
|
if (nav === url) setExpanded(false);
|
|
1043
1216
|
},
|
|
1044
|
-
sx: sx.link(nav, url, first)
|
|
1217
|
+
sx: sx$1.link(nav, url, first)
|
|
1045
1218
|
}, /*#__PURE__*/React.createElement(HoverArrow, null), display));
|
|
1046
1219
|
} else {
|
|
1047
|
-
return /*#__PURE__*/React.createElement(Link$
|
|
1220
|
+
return /*#__PURE__*/React.createElement(Link$2, {
|
|
1048
1221
|
href: href,
|
|
1049
|
-
sx: sx.link(nav, url, first)
|
|
1222
|
+
sx: sx$1.link(nav, url, first)
|
|
1050
1223
|
}, /*#__PURE__*/React.createElement(HoverArrow, null), display);
|
|
1051
1224
|
}
|
|
1052
1225
|
};
|
|
@@ -1099,7 +1272,7 @@ const Header = ({
|
|
|
1099
1272
|
}, (mode == 'homepage' || mode == 'local') && /*#__PURE__*/React.createElement(NextLink, {
|
|
1100
1273
|
href: "/",
|
|
1101
1274
|
passHref: true
|
|
1102
|
-
}, /*#__PURE__*/React.createElement(Link$
|
|
1275
|
+
}, /*#__PURE__*/React.createElement(Link$2, {
|
|
1103
1276
|
"aria-label": "CarbonPlan Homepage",
|
|
1104
1277
|
sx: {
|
|
1105
1278
|
display: 'block'
|
|
@@ -1110,7 +1283,7 @@ const Header = ({
|
|
|
1110
1283
|
cursor: 'pointer',
|
|
1111
1284
|
color: 'primary'
|
|
1112
1285
|
}
|
|
1113
|
-
}))), (mode == null || mode == 'remote') && /*#__PURE__*/React.createElement(Link$
|
|
1286
|
+
}))), (mode == null || mode == 'remote') && /*#__PURE__*/React.createElement(Link$2, {
|
|
1114
1287
|
href: "https://carbonplan.org",
|
|
1115
1288
|
"aria-label": "CarbonPlan Homepage",
|
|
1116
1289
|
sx: {
|
|
@@ -1215,7 +1388,7 @@ const Header = ({
|
|
|
1215
1388
|
})))))));
|
|
1216
1389
|
};
|
|
1217
1390
|
|
|
1218
|
-
const Monogram =
|
|
1391
|
+
const Monogram = _ref => {
|
|
1219
1392
|
let props = _extends({}, _ref);
|
|
1220
1393
|
|
|
1221
1394
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
@@ -1254,7 +1427,7 @@ const Footer = () => {
|
|
|
1254
1427
|
letterSpacing: 'mono',
|
|
1255
1428
|
mb: [2]
|
|
1256
1429
|
}
|
|
1257
|
-
}, "EMAIL"), /*#__PURE__*/React.createElement(Link$
|
|
1430
|
+
}, "EMAIL"), /*#__PURE__*/React.createElement(Link$2, {
|
|
1258
1431
|
href: "mailto:hello@carbonplan.org",
|
|
1259
1432
|
sx: {
|
|
1260
1433
|
textDecoration: 'none',
|
|
@@ -1288,7 +1461,7 @@ const Footer = () => {
|
|
|
1288
1461
|
letterSpacing: 'mono',
|
|
1289
1462
|
mb: [2]
|
|
1290
1463
|
}
|
|
1291
|
-
}, "FOLLOW"), /*#__PURE__*/React.createElement(Link$
|
|
1464
|
+
}, "FOLLOW"), /*#__PURE__*/React.createElement(Link$2, {
|
|
1292
1465
|
href: "https://twitter.com/carbonplanorg",
|
|
1293
1466
|
sx: {
|
|
1294
1467
|
textDecoration: 'none',
|
|
@@ -1382,6 +1555,77 @@ const Footer = () => {
|
|
|
1382
1555
|
}))));
|
|
1383
1556
|
};
|
|
1384
1557
|
|
|
1558
|
+
const GitSha = () => {
|
|
1559
|
+
const sha = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
|
|
1560
|
+
const owner = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER;
|
|
1561
|
+
const slug = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG;
|
|
1562
|
+
const {
|
|
1563
|
+
theme
|
|
1564
|
+
} = useThemeUI();
|
|
1565
|
+
const color = theme.rawColors.secondary;
|
|
1566
|
+
|
|
1567
|
+
if (sha && owner && slug) {
|
|
1568
|
+
const shortSha = sha.substring(0, 7);
|
|
1569
|
+
const 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
|
+
const Separator = ({
|
|
1614
|
+
color
|
|
1615
|
+
}) => {
|
|
1616
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
1617
|
+
fill: color,
|
|
1618
|
+
opacity: "0.8",
|
|
1619
|
+
viewBox: "0 0 24 24",
|
|
1620
|
+
width: "24",
|
|
1621
|
+
height: "24"
|
|
1622
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
1623
|
+
r: 5,
|
|
1624
|
+
cx: 19,
|
|
1625
|
+
cy: 19
|
|
1626
|
+
}));
|
|
1627
|
+
};
|
|
1628
|
+
|
|
1385
1629
|
const Value = ({
|
|
1386
1630
|
mode
|
|
1387
1631
|
}) => {
|
|
@@ -1429,10 +1673,6 @@ const Value = ({
|
|
|
1429
1673
|
const Metadata = ({
|
|
1430
1674
|
mode
|
|
1431
1675
|
}) => {
|
|
1432
|
-
const {
|
|
1433
|
-
theme
|
|
1434
|
-
} = useThemeUI();
|
|
1435
|
-
const color = theme.rawColors.secondary;
|
|
1436
1676
|
return /*#__PURE__*/React.createElement(Box, {
|
|
1437
1677
|
sx: {
|
|
1438
1678
|
userSelect: 'none',
|
|
@@ -1445,28 +1685,7 @@ const Metadata = ({
|
|
|
1445
1685
|
}
|
|
1446
1686
|
}, /*#__PURE__*/React.createElement(Value, {
|
|
1447
1687
|
mode: mode
|
|
1448
|
-
}), /*#__PURE__*/React.createElement(
|
|
1449
|
-
fill: color,
|
|
1450
|
-
opacity: "0.8",
|
|
1451
|
-
viewBox: "0 0 24 24",
|
|
1452
|
-
width: "24",
|
|
1453
|
-
height: "24"
|
|
1454
|
-
}, /*#__PURE__*/React.createElement("circle", {
|
|
1455
|
-
r: 5,
|
|
1456
|
-
cx: 19,
|
|
1457
|
-
cy: 19
|
|
1458
|
-
})), /*#__PURE__*/React.createElement(Text, {
|
|
1459
|
-
sx: {
|
|
1460
|
-
whiteSpace: 'nowrap',
|
|
1461
|
-
display: 'inline-block',
|
|
1462
|
-
ml: [2],
|
|
1463
|
-
fontFamily: 'mono',
|
|
1464
|
-
letterSpacing: 'body',
|
|
1465
|
-
color: 'secondary',
|
|
1466
|
-
fontSize: [1],
|
|
1467
|
-
textTransform: 'uppercase'
|
|
1468
|
-
}
|
|
1469
|
-
}, color));
|
|
1688
|
+
}), /*#__PURE__*/React.createElement(GitSha, null));
|
|
1470
1689
|
};
|
|
1471
1690
|
|
|
1472
1691
|
function init(mode) {
|
|
@@ -1487,6 +1706,7 @@ function scrollFraction(window, documnt) {
|
|
|
1487
1706
|
return Math.min(window.scrollY / (document.body.offsetHeight - 770), 0.99);
|
|
1488
1707
|
}
|
|
1489
1708
|
|
|
1709
|
+
const _excluded$6 = ["duration", "delay", "children"];
|
|
1490
1710
|
const fade = keyframes({
|
|
1491
1711
|
from: {
|
|
1492
1712
|
opacity: 0
|
|
@@ -1496,13 +1716,13 @@ const fade = keyframes({
|
|
|
1496
1716
|
}
|
|
1497
1717
|
});
|
|
1498
1718
|
|
|
1499
|
-
const FadeIn =
|
|
1719
|
+
const FadeIn = _ref => {
|
|
1500
1720
|
let {
|
|
1501
1721
|
duration = 300,
|
|
1502
1722
|
delay = 0,
|
|
1503
1723
|
children
|
|
1504
1724
|
} = _ref,
|
|
1505
|
-
delegated = _objectWithoutPropertiesLoose(_ref,
|
|
1725
|
+
delegated = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
1506
1726
|
|
|
1507
1727
|
return /*#__PURE__*/React.createElement(Box, _extends({}, delegated, {
|
|
1508
1728
|
sx: {
|
|
@@ -1815,14 +2035,16 @@ const Expander = ({
|
|
|
1815
2035
|
})));
|
|
1816
2036
|
};
|
|
1817
2037
|
|
|
1818
|
-
const
|
|
2038
|
+
const _excluded$5 = ["label", "value", "sx", "children"];
|
|
2039
|
+
|
|
2040
|
+
const Tag = _ref => {
|
|
1819
2041
|
let {
|
|
1820
2042
|
label,
|
|
1821
2043
|
value,
|
|
1822
2044
|
sx,
|
|
1823
2045
|
children
|
|
1824
2046
|
} = _ref,
|
|
1825
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
2047
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
1826
2048
|
|
|
1827
2049
|
const color = sx && sx.color ? sx.color : 'primary';
|
|
1828
2050
|
const isClickable = props && (props.onClick || props.onDoubleClick);
|
|
@@ -1856,7 +2078,8 @@ const Tag = (_ref) => {
|
|
|
1856
2078
|
}, props), children);
|
|
1857
2079
|
};
|
|
1858
2080
|
|
|
1859
|
-
const
|
|
2081
|
+
const _excluded$4 = ["values", "setValues", "label", "colors", "showAll", "multiSelect"];
|
|
2082
|
+
const sx = {
|
|
1860
2083
|
label: {
|
|
1861
2084
|
fontFamily: 'mono',
|
|
1862
2085
|
letterSpacing: 'mono',
|
|
@@ -1917,7 +2140,7 @@ const updateValues = ({
|
|
|
1917
2140
|
}
|
|
1918
2141
|
};
|
|
1919
2142
|
|
|
1920
|
-
const Filter =
|
|
2143
|
+
const Filter = _ref => {
|
|
1921
2144
|
let {
|
|
1922
2145
|
values,
|
|
1923
2146
|
setValues,
|
|
@@ -1926,10 +2149,10 @@ const Filter = (_ref) => {
|
|
|
1926
2149
|
showAll = false,
|
|
1927
2150
|
multiSelect = false
|
|
1928
2151
|
} = _ref,
|
|
1929
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
2152
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
1930
2153
|
|
|
1931
2154
|
return /*#__PURE__*/React.createElement(Box, props, label && /*#__PURE__*/React.createElement(Box, {
|
|
1932
|
-
sx: sx
|
|
2155
|
+
sx: sx.label
|
|
1933
2156
|
}, label), /*#__PURE__*/React.createElement(Box, {
|
|
1934
2157
|
sx: {
|
|
1935
2158
|
mt: label ? [3] : 0
|
|
@@ -2013,13 +2236,15 @@ const Group = ({
|
|
|
2013
2236
|
}));
|
|
2014
2237
|
};
|
|
2015
2238
|
|
|
2016
|
-
const
|
|
2239
|
+
const _excluded$3 = ["size", "inverted", "sx"];
|
|
2240
|
+
|
|
2241
|
+
const Input = (_ref, ref) => {
|
|
2017
2242
|
let {
|
|
2018
2243
|
size = 'sm',
|
|
2019
2244
|
inverted,
|
|
2020
2245
|
sx
|
|
2021
2246
|
} = _ref,
|
|
2022
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
2247
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
2023
2248
|
|
|
2024
2249
|
const defaultColor = inverted ? 'secondary' : 'primary';
|
|
2025
2250
|
|
|
@@ -2053,10 +2278,13 @@ const Input = (_ref) => {
|
|
|
2053
2278
|
}, getSizeStyles(size), sx);
|
|
2054
2279
|
|
|
2055
2280
|
return /*#__PURE__*/React.createElement(Input$1, _extends({}, props, {
|
|
2281
|
+
ref: ref,
|
|
2056
2282
|
sx: styles
|
|
2057
2283
|
}));
|
|
2058
2284
|
};
|
|
2059
2285
|
|
|
2286
|
+
var input = forwardRef(Input);
|
|
2287
|
+
|
|
2060
2288
|
const getProps = test => props => {
|
|
2061
2289
|
const next = {};
|
|
2062
2290
|
|
|
@@ -2067,13 +2295,15 @@ const getProps = test => props => {
|
|
|
2067
2295
|
return next;
|
|
2068
2296
|
};
|
|
2069
2297
|
|
|
2070
|
-
const
|
|
2298
|
+
const _excluded$2 = ["children", "size", "sx"];
|
|
2299
|
+
|
|
2300
|
+
const Select = _ref => {
|
|
2071
2301
|
let {
|
|
2072
2302
|
children,
|
|
2073
2303
|
size = 'sm',
|
|
2074
2304
|
sx
|
|
2075
2305
|
} = _ref,
|
|
2076
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
2306
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
2077
2307
|
|
|
2078
2308
|
const color = sx && sx.color ? sx.color : 'primary';
|
|
2079
2309
|
const sizeStyles = getSizeStyles(size);
|
|
@@ -2160,11 +2390,13 @@ const Select = (_ref) => {
|
|
|
2160
2390
|
}));
|
|
2161
2391
|
};
|
|
2162
2392
|
|
|
2163
|
-
const
|
|
2393
|
+
const _excluded$1 = ["sx"];
|
|
2394
|
+
|
|
2395
|
+
const Slider = (_ref, ref) => {
|
|
2164
2396
|
let {
|
|
2165
2397
|
sx
|
|
2166
2398
|
} = _ref,
|
|
2167
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
2399
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
2168
2400
|
|
|
2169
2401
|
const color = sx && sx.color ? sx.color : 'primary';
|
|
2170
2402
|
const {
|
|
@@ -2173,6 +2405,7 @@ const Slider = (_ref) => {
|
|
|
2173
2405
|
}
|
|
2174
2406
|
} = useThemeUI();
|
|
2175
2407
|
return /*#__PURE__*/React.createElement(Slider$1, _extends({
|
|
2408
|
+
ref: ref,
|
|
2176
2409
|
sx: _extends({
|
|
2177
2410
|
'&::-webkit-slider-thumb': {
|
|
2178
2411
|
height: [22, 18, 16],
|
|
@@ -2204,6 +2437,8 @@ const Slider = (_ref) => {
|
|
|
2204
2437
|
}, props));
|
|
2205
2438
|
};
|
|
2206
2439
|
|
|
2440
|
+
var slider = forwardRef(Slider);
|
|
2441
|
+
|
|
2207
2442
|
const styles = {
|
|
2208
2443
|
reset: {
|
|
2209
2444
|
verticalAlign: 'baseline',
|
|
@@ -2304,18 +2539,21 @@ const Table = ({
|
|
|
2304
2539
|
})));
|
|
2305
2540
|
};
|
|
2306
2541
|
|
|
2307
|
-
const
|
|
2542
|
+
const _excluded = ["value", "onClick", "disabled", "sx"];
|
|
2543
|
+
|
|
2544
|
+
const Toggle = (_ref, ref) => {
|
|
2308
2545
|
let {
|
|
2309
2546
|
value,
|
|
2310
2547
|
onClick,
|
|
2311
2548
|
disabled,
|
|
2312
2549
|
sx
|
|
2313
2550
|
} = _ref,
|
|
2314
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
2551
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
2315
2552
|
|
|
2316
2553
|
const color = sx && sx.color ? sx.color : 'primary';
|
|
2317
2554
|
value = disabled ? false : value;
|
|
2318
2555
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
2556
|
+
ref: ref,
|
|
2319
2557
|
as: "button",
|
|
2320
2558
|
onClick: onClick,
|
|
2321
2559
|
role: "checkbox",
|
|
@@ -2353,6 +2591,8 @@ const Toggle = (_ref) => {
|
|
|
2353
2591
|
})));
|
|
2354
2592
|
};
|
|
2355
2593
|
|
|
2594
|
+
var toggle = forwardRef(Toggle);
|
|
2595
|
+
|
|
2356
2596
|
const Tracking = ({
|
|
2357
2597
|
id
|
|
2358
2598
|
}) => {
|
|
@@ -2455,5 +2695,5 @@ const formatDate = (date, options = defaultOptions) => {
|
|
|
2455
2695
|
return [month, day, year].filter(Boolean).join(' ');
|
|
2456
2696
|
};
|
|
2457
2697
|
|
|
2458
|
-
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 };
|
|
2698
|
+
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 };
|
|
2459
2699
|
//# sourceMappingURL=index.modern.js.map
|