@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 +640 -236
- package/dst/index.esm.js.map +1 -1
- package/dst/index.js +636 -231
- package/dst/index.js.map +1 -1
- package/dst/index.modern.js +603 -238
- package/dst/index.modern.js.map +1 -1
- package/package.json +5 -4
package/dst/index.modern.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, { cloneElement,
|
|
2
|
-
import { Box, Link as Link$
|
|
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
|
|
|
@@ -76,6 +77,11 @@ const event = ({
|
|
|
76
77
|
label,
|
|
77
78
|
value
|
|
78
79
|
}) => {
|
|
80
|
+
if (typeof window.gtag !== 'function') {
|
|
81
|
+
console.warn(`Missing window.gtag, skipping analytics action: '${action}'.`);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
79
85
|
window.gtag('event', action, {
|
|
80
86
|
event_category: category,
|
|
81
87
|
event_label: label,
|
|
@@ -83,7 +89,7 @@ const event = ({
|
|
|
83
89
|
});
|
|
84
90
|
};
|
|
85
91
|
|
|
86
|
-
const Link = (_ref) => {
|
|
92
|
+
const Link = (_ref, ref) => {
|
|
87
93
|
let {
|
|
88
94
|
href,
|
|
89
95
|
children,
|
|
@@ -96,7 +102,9 @@ const Link = (_ref) => {
|
|
|
96
102
|
return /*#__PURE__*/React.createElement(NextLink, {
|
|
97
103
|
href: href,
|
|
98
104
|
passHref: true
|
|
99
|
-
}, /*#__PURE__*/React.createElement(Link$
|
|
105
|
+
}, /*#__PURE__*/React.createElement(Link$2, _extends({
|
|
106
|
+
ref: ref
|
|
107
|
+
}, props), children));
|
|
100
108
|
} else if (tracking) {
|
|
101
109
|
let action;
|
|
102
110
|
let category;
|
|
@@ -117,18 +125,22 @@ const Link = (_ref) => {
|
|
|
117
125
|
});
|
|
118
126
|
};
|
|
119
127
|
|
|
120
|
-
return /*#__PURE__*/React.createElement(Link$
|
|
128
|
+
return /*#__PURE__*/React.createElement(Link$2, _extends({
|
|
129
|
+
ref: ref,
|
|
121
130
|
onClick: track,
|
|
122
131
|
onContextMenu: track,
|
|
123
132
|
href: href
|
|
124
133
|
}, props), children);
|
|
125
134
|
} else {
|
|
126
|
-
return /*#__PURE__*/React.createElement(Link$
|
|
135
|
+
return /*#__PURE__*/React.createElement(Link$2, _extends({
|
|
136
|
+
ref: ref,
|
|
127
137
|
href: href
|
|
128
138
|
}, props), children);
|
|
129
139
|
}
|
|
130
140
|
};
|
|
131
141
|
|
|
142
|
+
var Link$1 = forwardRef(Link);
|
|
143
|
+
|
|
132
144
|
const getSizeStyles = size => {
|
|
133
145
|
if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(size)) {
|
|
134
146
|
throw new Error('Size must be xs, sm, md, lg, or xl');
|
|
@@ -179,7 +191,7 @@ const getSizeStyles = size => {
|
|
|
179
191
|
};
|
|
180
192
|
};
|
|
181
193
|
|
|
182
|
-
const Button = (_ref) => {
|
|
194
|
+
const Button = (_ref, ref) => {
|
|
183
195
|
let {
|
|
184
196
|
size = 'sm',
|
|
185
197
|
prefix,
|
|
@@ -350,7 +362,8 @@ const Button = (_ref) => {
|
|
|
350
362
|
}, suffix && suffix));
|
|
351
363
|
|
|
352
364
|
if (href) {
|
|
353
|
-
return /*#__PURE__*/React.createElement(Link, _extends({
|
|
365
|
+
return /*#__PURE__*/React.createElement(Link$1, _extends({
|
|
366
|
+
ref: ref,
|
|
354
367
|
href: href,
|
|
355
368
|
internal: internal,
|
|
356
369
|
tracking: tracking,
|
|
@@ -360,13 +373,16 @@ const Button = (_ref) => {
|
|
|
360
373
|
}, props), Inner);
|
|
361
374
|
} else {
|
|
362
375
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
376
|
+
ref: ref,
|
|
363
377
|
as: "button",
|
|
364
378
|
sx: style
|
|
365
379
|
}, props), Inner);
|
|
366
380
|
}
|
|
367
381
|
};
|
|
368
382
|
|
|
369
|
-
|
|
383
|
+
var button = forwardRef(Button);
|
|
384
|
+
|
|
385
|
+
const Callout = (_ref, ref) => {
|
|
370
386
|
let {
|
|
371
387
|
label,
|
|
372
388
|
children,
|
|
@@ -442,7 +458,8 @@ const Callout = (_ref) => {
|
|
|
442
458
|
})));
|
|
443
459
|
|
|
444
460
|
if (href) {
|
|
445
|
-
return /*#__PURE__*/React.createElement(Link, _extends({
|
|
461
|
+
return /*#__PURE__*/React.createElement(Link$1, _extends({
|
|
462
|
+
ref: ref,
|
|
446
463
|
href: href,
|
|
447
464
|
internal: internal,
|
|
448
465
|
tracking: tracking,
|
|
@@ -450,12 +467,304 @@ const Callout = (_ref) => {
|
|
|
450
467
|
}, props), Inner);
|
|
451
468
|
} else {
|
|
452
469
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
470
|
+
ref: ref,
|
|
453
471
|
as: "button",
|
|
454
472
|
sx: style
|
|
455
473
|
}, props), Inner);
|
|
456
474
|
}
|
|
457
475
|
};
|
|
458
476
|
|
|
477
|
+
var callout = forwardRef(Callout);
|
|
478
|
+
|
|
479
|
+
const styles = {
|
|
480
|
+
clim: setClim => {
|
|
481
|
+
return {
|
|
482
|
+
fontFamily: 'mono',
|
|
483
|
+
fontSize: ['9px', 0, 0, 1],
|
|
484
|
+
letterSpacing: 'smallcaps',
|
|
485
|
+
textTransform: 'uppercase',
|
|
486
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
487
|
+
'&:hover': {
|
|
488
|
+
borderBottom: setClim ? ({
|
|
489
|
+
colors
|
|
490
|
+
}) => `solid 1px ${colors.primary} !important` : 'unset'
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
'&:focus': {
|
|
494
|
+
outline: 'none',
|
|
495
|
+
borderBottom: setClim ? ({
|
|
496
|
+
colors
|
|
497
|
+
}) => `solid 1px ${colors.primary} !important` : 'unset'
|
|
498
|
+
},
|
|
499
|
+
transition: 'border 0.15s',
|
|
500
|
+
userSelect: setClim ? 'none !important' : 'unset',
|
|
501
|
+
width: 'fit-content',
|
|
502
|
+
minWidth: 'fit-content'
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
const DIMENSIONS = {
|
|
507
|
+
width: ['10px', '16px', '16px', '17px'],
|
|
508
|
+
height: ['80px', '110px', '110px', '130px']
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
const Gradient = ({
|
|
512
|
+
colormap,
|
|
513
|
+
discrete,
|
|
514
|
+
horizontal,
|
|
515
|
+
width,
|
|
516
|
+
height
|
|
517
|
+
}) => {
|
|
518
|
+
const step = 1 / colormap.length * 100;
|
|
519
|
+
const values = colormap.map((d, i) => {
|
|
520
|
+
return `rgb(${d}) ${i * step}% ${discrete && i < colormap.length - 1 ? `${(i + 1) * step}%` : ''}`;
|
|
521
|
+
});
|
|
522
|
+
const css = `linear-gradient(to ${horizontal ? 'right' : 'top'}, ${values.join(',')})`;
|
|
523
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
524
|
+
sx: _extends({}, horizontal ? {
|
|
525
|
+
width: width || DIMENSIONS.height,
|
|
526
|
+
height: height || DIMENSIONS.width
|
|
527
|
+
} : {
|
|
528
|
+
width: width || DIMENSIONS.width,
|
|
529
|
+
minHeight: height || DIMENSIONS.height
|
|
530
|
+
}, {
|
|
531
|
+
mt: horizontal ? [0, '1px', '1px', 0] : 0,
|
|
532
|
+
border: ({
|
|
533
|
+
colors
|
|
534
|
+
}) => `solid 1px ${colors.hinted}`,
|
|
535
|
+
background: css
|
|
536
|
+
})
|
|
537
|
+
});
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
const Label = ({
|
|
541
|
+
label,
|
|
542
|
+
units,
|
|
543
|
+
horizontal
|
|
544
|
+
}) => /*#__PURE__*/React.createElement(Box, {
|
|
545
|
+
sx: !horizontal && {
|
|
546
|
+
alignSelf: 'flex-end'
|
|
547
|
+
}
|
|
548
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
549
|
+
sx: _extends({
|
|
550
|
+
mb: horizontal ? 0 : ['-4px', '-4px', '-4px', '-3px'],
|
|
551
|
+
fontFamily: 'mono',
|
|
552
|
+
fontSize: ['9px', 0, 0, 1],
|
|
553
|
+
letterSpacing: 'smallcaps',
|
|
554
|
+
textTransform: 'uppercase'
|
|
555
|
+
}, horizontal ? {} : {
|
|
556
|
+
writingMode: 'vertical-rl',
|
|
557
|
+
transform: 'rotate(180deg)',
|
|
558
|
+
whiteSpace: 'nowrap',
|
|
559
|
+
display: 'inline-block',
|
|
560
|
+
overflow: 'visible'
|
|
561
|
+
})
|
|
562
|
+
}, label, ' ', /*#__PURE__*/React.createElement(Box, {
|
|
563
|
+
as: "span",
|
|
564
|
+
sx: {
|
|
565
|
+
textTransform: 'none',
|
|
566
|
+
color: 'secondary',
|
|
567
|
+
display: 'inline-block'
|
|
568
|
+
}
|
|
569
|
+
}, units)));
|
|
570
|
+
|
|
571
|
+
const Colorbar = (_ref) => {
|
|
572
|
+
let {
|
|
573
|
+
colormap,
|
|
574
|
+
label,
|
|
575
|
+
clim,
|
|
576
|
+
setClim,
|
|
577
|
+
setClimStep = 1,
|
|
578
|
+
discrete,
|
|
579
|
+
units,
|
|
580
|
+
width,
|
|
581
|
+
height,
|
|
582
|
+
format = d => d,
|
|
583
|
+
horizontal = false,
|
|
584
|
+
bottom = false,
|
|
585
|
+
sx,
|
|
586
|
+
sxClim
|
|
587
|
+
} = _ref,
|
|
588
|
+
props = _objectWithoutPropertiesLoose(_ref, ["colormap", "label", "clim", "setClim", "setClimStep", "discrete", "units", "width", "height", "format", "horizontal", "bottom", "sx", "sxClim"]);
|
|
589
|
+
|
|
590
|
+
if (!Array.isArray(colormap)) {
|
|
591
|
+
throw new Error(`expected array for colormap, got '${colormap}'.`);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
const climRef = [useRef(), useRef()];
|
|
595
|
+
const [climMinDragging, setClimMinDragging] = useState(false);
|
|
596
|
+
const [climMaxDragging, setClimMaxDragging] = useState(false);
|
|
597
|
+
let x,
|
|
598
|
+
y,
|
|
599
|
+
dx,
|
|
600
|
+
dy = 0;
|
|
601
|
+
let id = null;
|
|
602
|
+
let init = [0, 0];
|
|
603
|
+
let scale = setClimStep;
|
|
604
|
+
|
|
605
|
+
const draggingFunction = e => {
|
|
606
|
+
if (id === 'min' && !climMinDragging) setClimMinDragging(true);
|
|
607
|
+
if (id === 'max' && !climMaxDragging) setClimMaxDragging(true);
|
|
608
|
+
dx = e.pageX - x;
|
|
609
|
+
dy = e.pageY - y;
|
|
610
|
+
|
|
611
|
+
if (horizontal) {
|
|
612
|
+
if (id === 'min') setClim(prev => [Math.min(init[0] + dx * scale, init[1]), prev[1]]);
|
|
613
|
+
if (id === 'max') setClim(prev => [prev[0], Math.max(init[1] + dx * scale, init[0])]);
|
|
614
|
+
} else {
|
|
615
|
+
if (id === 'min') setClim(prev => [Math.min(init[0] - dy * scale, init[1]), prev[1]]);
|
|
616
|
+
if (id === 'max') setClim(prev => [prev[0], Math.max(init[1] - dy * scale, init[0])]);
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
const handleMouseDown = e => {
|
|
621
|
+
y = e.pageY;
|
|
622
|
+
x = e.pageX;
|
|
623
|
+
id = e.target.id;
|
|
624
|
+
init = clim;
|
|
625
|
+
document.body.setAttribute('style', horizontal ? 'cursor: ew-resize !important' : 'cursor: ns-resize !important');
|
|
626
|
+
document.addEventListener('mousemove', draggingFunction);
|
|
627
|
+
|
|
628
|
+
const updater = () => {
|
|
629
|
+
document.body.setAttribute('style', 'cursor: unset');
|
|
630
|
+
document.removeEventListener('mousemove', draggingFunction);
|
|
631
|
+
window.removeEventListener('mouseup', updater);
|
|
632
|
+
if (id === 'min') setClimMinDragging(false);
|
|
633
|
+
if (id === 'max') setClimMaxDragging(false);
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
window.addEventListener('mouseup', updater);
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
const increment = e => {
|
|
640
|
+
if (climRef[0].current === document.activeElement) {
|
|
641
|
+
e.preventDefault();
|
|
642
|
+
setClim(prev => [Math.min(prev[0] + scale, prev[1]), prev[1]]);
|
|
643
|
+
climRef[0].current.focus();
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
if (climRef[1].current === document.activeElement) {
|
|
647
|
+
e.preventDefault();
|
|
648
|
+
setClim(prev => [prev[0], Math.max(prev[1] + scale, prev[0])]);
|
|
649
|
+
climRef[1].current.focus();
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
|
|
653
|
+
const decrement = e => {
|
|
654
|
+
if (climRef[0].current === document.activeElement) {
|
|
655
|
+
e.preventDefault();
|
|
656
|
+
setClim(prev => [Math.min(prev[0] - scale, prev[1]), prev[1]]);
|
|
657
|
+
climRef[0].current.focus();
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
if (climRef[1].current === document.activeElement) {
|
|
661
|
+
e.preventDefault();
|
|
662
|
+
setClim(prev => [prev[0], Math.max(prev[1] - scale, prev[0])]);
|
|
663
|
+
climRef[1].current.focus();
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
useEffect(() => {
|
|
668
|
+
const listener = e => {
|
|
669
|
+
if (['ArrowUp', 'ArrowRight'].includes(e.code) || ['ArrowUp', 'ArrowRight'].includes(e.key)) {
|
|
670
|
+
increment(e);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
if (['ArrowDown', 'ArrowLeft'].includes(e.code) || ['ArrowDown', 'ArrowLeft'].includes(e.key)) {
|
|
674
|
+
decrement(e);
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
window.addEventListener('keydown', listener);
|
|
679
|
+
return () => {
|
|
680
|
+
window.removeEventListener('keydown', listener);
|
|
681
|
+
};
|
|
682
|
+
}, [clim]);
|
|
683
|
+
|
|
684
|
+
const ClimMin = () => {
|
|
685
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
686
|
+
id: "min",
|
|
687
|
+
ref: climRef[0],
|
|
688
|
+
tabIndex: 0,
|
|
689
|
+
sx: _extends({}, styles.clim(setClim), {
|
|
690
|
+
ml: label ? horizontal ? bottom ? '0px' : '10px' : '2px' : 0,
|
|
691
|
+
mr: horizontal ? ['2px', '1px', '1px', '2px'] : 0,
|
|
692
|
+
mb: horizontal ? 0 : ['-2px', '-2px', '-2px', '-3px'],
|
|
693
|
+
borderBottom: setClim ? climMinDragging ? ({
|
|
694
|
+
colors
|
|
695
|
+
}) => `solid 1px ${colors.primary}` : ({
|
|
696
|
+
colors
|
|
697
|
+
}) => `solid 1px ${colors.secondary}` : 'unset',
|
|
698
|
+
cursor: setClim ? horizontal ? 'ew-resize' : 'ns-resize' : 'default'
|
|
699
|
+
}, sxClim),
|
|
700
|
+
onMouseDown: setClim ? handleMouseDown : () => {},
|
|
701
|
+
onClick: () => climRef[0].current.focus()
|
|
702
|
+
}, format(clim[0]));
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
const ClimMax = () => {
|
|
706
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
707
|
+
id: "max",
|
|
708
|
+
ref: climRef[1],
|
|
709
|
+
tabIndex: 0,
|
|
710
|
+
sx: _extends({}, styles.clim(setClim), {
|
|
711
|
+
ml: horizontal ? ['2px', '1px', '1px', '2px'] : '2px',
|
|
712
|
+
mt: horizontal ? 0 : ['-2px', '-3px', '-3px', '-3px'],
|
|
713
|
+
borderBottom: setClim ? climMaxDragging ? ({
|
|
714
|
+
colors
|
|
715
|
+
}) => `solid 1px ${colors.primary}` : ({
|
|
716
|
+
colors
|
|
717
|
+
}) => `solid 1px ${colors.secondary}` : 'unset',
|
|
718
|
+
cursor: setClim ? horizontal ? 'ew-resize' : 'ns-resize' : 'default'
|
|
719
|
+
}, sxClim),
|
|
720
|
+
onMouseDown: setClim ? handleMouseDown : () => {},
|
|
721
|
+
onClick: () => climRef[1].current.focus()
|
|
722
|
+
}, format(clim[1]));
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
return /*#__PURE__*/React.createElement(Flex, _extends({}, props, {
|
|
726
|
+
sx: _extends({
|
|
727
|
+
flexDirection: 'row',
|
|
728
|
+
alignItems: 'start',
|
|
729
|
+
justifyContent: 'flex-start',
|
|
730
|
+
gap: ['3px', '6px', '6px', '7px'],
|
|
731
|
+
height: !horizontal ? '100%' : 'unset'
|
|
732
|
+
}, sx)
|
|
733
|
+
}), label && /*#__PURE__*/React.createElement(Label, {
|
|
734
|
+
label: label,
|
|
735
|
+
units: units,
|
|
736
|
+
horizontal: horizontal
|
|
737
|
+
}), /*#__PURE__*/React.createElement(Flex, {
|
|
738
|
+
sx: {
|
|
739
|
+
flexGrow: horizontal ? 1 : 'unset',
|
|
740
|
+
flexDirection: 'column',
|
|
741
|
+
ml: bottom && label ? '4px' : '0px',
|
|
742
|
+
height: !horizontal ? '100%' : 'unset'
|
|
743
|
+
}
|
|
744
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
745
|
+
sx: {
|
|
746
|
+
gap: ['3px', '6px', '6px', '7px'],
|
|
747
|
+
height: !horizontal ? '100%' : 'unset'
|
|
748
|
+
}
|
|
749
|
+
}, horizontal && clim && !bottom && /*#__PURE__*/React.createElement(ClimMin, null), /*#__PURE__*/React.createElement(Gradient, {
|
|
750
|
+
colormap: colormap,
|
|
751
|
+
horizontal: horizontal,
|
|
752
|
+
discrete: discrete,
|
|
753
|
+
width: width,
|
|
754
|
+
height: height
|
|
755
|
+
}), horizontal && clim && !bottom && /*#__PURE__*/React.createElement(ClimMax, null)), horizontal && clim && bottom && /*#__PURE__*/React.createElement(Flex, {
|
|
756
|
+
sx: {
|
|
757
|
+
justifyContent: 'space-between'
|
|
758
|
+
}
|
|
759
|
+
}, /*#__PURE__*/React.createElement(ClimMin, null), /*#__PURE__*/React.createElement(ClimMax, null))), !horizontal && /*#__PURE__*/React.createElement(Flex, {
|
|
760
|
+
sx: {
|
|
761
|
+
flexDirection: 'column-reverse',
|
|
762
|
+
justifyContent: 'space-between',
|
|
763
|
+
height: height || DIMENSIONS.height
|
|
764
|
+
}
|
|
765
|
+
}, clim && /*#__PURE__*/React.createElement(ClimMin, null), clim && /*#__PURE__*/React.createElement(ClimMax, null)));
|
|
766
|
+
};
|
|
767
|
+
|
|
459
768
|
const Column = (_ref) => {
|
|
460
769
|
let {
|
|
461
770
|
start,
|
|
@@ -817,146 +1126,6 @@ const Menu = (_ref) => {
|
|
|
817
1126
|
})));
|
|
818
1127
|
};
|
|
819
1128
|
|
|
820
|
-
const Settings = (_ref) => {
|
|
821
|
-
let {
|
|
822
|
-
value,
|
|
823
|
-
sx
|
|
824
|
-
} = _ref,
|
|
825
|
-
props = _objectWithoutPropertiesLoose(_ref, ["value", "sx"]);
|
|
826
|
-
|
|
827
|
-
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
828
|
-
sx: _extends({
|
|
829
|
-
cursor: 'pointer',
|
|
830
|
-
fill: 'none',
|
|
831
|
-
strokeWidth: '2px',
|
|
832
|
-
stroke: 'text',
|
|
833
|
-
'.paren': {
|
|
834
|
-
opacity: '0'
|
|
835
|
-
},
|
|
836
|
-
'@media (hover: hover) and (pointer: fine)': {
|
|
837
|
-
'&:hover .paren': {
|
|
838
|
-
opacity: '1'
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
}, sx),
|
|
842
|
-
"aria-label": "Toggle Menu"
|
|
843
|
-
}, props), !value && /*#__PURE__*/React.createElement("svg", {
|
|
844
|
-
style: {
|
|
845
|
-
width: '50px',
|
|
846
|
-
height: '30px',
|
|
847
|
-
transform: 'scale(2)',
|
|
848
|
-
marginTop: '-3px'
|
|
849
|
-
},
|
|
850
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
851
|
-
viewBox: "0 0 68 36"
|
|
852
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
853
|
-
x1: "24",
|
|
854
|
-
y1: "2.1",
|
|
855
|
-
x2: "24",
|
|
856
|
-
y2: "6.1"
|
|
857
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
858
|
-
x1: "24",
|
|
859
|
-
y1: "24.1",
|
|
860
|
-
x2: "24",
|
|
861
|
-
y2: "33.9"
|
|
862
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
863
|
-
x1: "44",
|
|
864
|
-
y1: "2.1",
|
|
865
|
-
x2: "44",
|
|
866
|
-
y2: "12.1"
|
|
867
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
868
|
-
x1: "44",
|
|
869
|
-
y1: "30.1",
|
|
870
|
-
x2: "44",
|
|
871
|
-
y2: "33.9"
|
|
872
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
873
|
-
cx: "24",
|
|
874
|
-
cy: "15.1",
|
|
875
|
-
r: "5"
|
|
876
|
-
}), /*#__PURE__*/React.createElement("circle", {
|
|
877
|
-
cx: "44",
|
|
878
|
-
cy: "21.1",
|
|
879
|
-
r: "5"
|
|
880
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
881
|
-
style: {
|
|
882
|
-
transition: 'all 0.2s'
|
|
883
|
-
},
|
|
884
|
-
className: "paren",
|
|
885
|
-
d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
|
|
886
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
887
|
-
style: {
|
|
888
|
-
transition: 'all 0.2s'
|
|
889
|
-
},
|
|
890
|
-
className: "paren",
|
|
891
|
-
d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
|
|
892
|
-
})), value && /*#__PURE__*/React.createElement("svg", {
|
|
893
|
-
style: {
|
|
894
|
-
width: '50px',
|
|
895
|
-
height: '30px',
|
|
896
|
-
transform: 'scale(2)',
|
|
897
|
-
marginTop: '-3px'
|
|
898
|
-
},
|
|
899
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
900
|
-
viewBox: "0 0 68 36"
|
|
901
|
-
}, /*#__PURE__*/React.createElement("line", {
|
|
902
|
-
x1: "50.85",
|
|
903
|
-
y1: "29.79",
|
|
904
|
-
x2: "17.15",
|
|
905
|
-
y2: "6.21"
|
|
906
|
-
}), /*#__PURE__*/React.createElement("line", {
|
|
907
|
-
x1: "17.15",
|
|
908
|
-
y1: "29.79",
|
|
909
|
-
x2: "50.85",
|
|
910
|
-
y2: "6.21"
|
|
911
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
912
|
-
style: {
|
|
913
|
-
transition: 'all 0.2s'
|
|
914
|
-
},
|
|
915
|
-
className: "paren",
|
|
916
|
-
d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
|
|
917
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
918
|
-
style: {
|
|
919
|
-
transition: 'all 0.2s'
|
|
920
|
-
},
|
|
921
|
-
className: "paren",
|
|
922
|
-
d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
|
|
923
|
-
})));
|
|
924
|
-
};
|
|
925
|
-
|
|
926
|
-
const Dimmer = (_ref) => {
|
|
927
|
-
let {
|
|
928
|
-
sx
|
|
929
|
-
} = _ref,
|
|
930
|
-
props = _objectWithoutPropertiesLoose(_ref, ["sx"]);
|
|
931
|
-
|
|
932
|
-
const [colorMode, setColorMode] = useColorMode();
|
|
933
|
-
const toggle = useCallback(() => {
|
|
934
|
-
setColorMode(colorMode === 'light' ? 'dark' : 'light');
|
|
935
|
-
}, [colorMode]);
|
|
936
|
-
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
937
|
-
"aria-label": "Toggle dark mode",
|
|
938
|
-
onClick: toggle,
|
|
939
|
-
role: "checkbox",
|
|
940
|
-
sx: _extends({
|
|
941
|
-
width: 32,
|
|
942
|
-
height: 32,
|
|
943
|
-
display: 'inline-block',
|
|
944
|
-
cursor: 'pointer',
|
|
945
|
-
color: 'secondary'
|
|
946
|
-
}, sx)
|
|
947
|
-
}, props), /*#__PURE__*/React.createElement(Sun, {
|
|
948
|
-
sx: {
|
|
949
|
-
strokeWidth: '1.75',
|
|
950
|
-
transition: 'stroke 0.15s',
|
|
951
|
-
'@media (hover: hover) and (pointer: fine)': {
|
|
952
|
-
'&:hover': {
|
|
953
|
-
stroke: 'primary'
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
}));
|
|
958
|
-
};
|
|
959
|
-
|
|
960
1129
|
const sx = {
|
|
961
1130
|
link: (current, label, first = false) => {
|
|
962
1131
|
return {
|
|
@@ -1023,7 +1192,6 @@ const Nav = ({
|
|
|
1023
1192
|
mode,
|
|
1024
1193
|
nav,
|
|
1025
1194
|
first,
|
|
1026
|
-
dimmer,
|
|
1027
1195
|
setExpanded
|
|
1028
1196
|
}) => {
|
|
1029
1197
|
const {
|
|
@@ -1036,14 +1204,14 @@ const Nav = ({
|
|
|
1036
1204
|
return /*#__PURE__*/React.createElement(NextLink, {
|
|
1037
1205
|
href: href,
|
|
1038
1206
|
passHref: true
|
|
1039
|
-
}, /*#__PURE__*/React.createElement(Link$
|
|
1207
|
+
}, /*#__PURE__*/React.createElement(Link$2, {
|
|
1040
1208
|
onClick: () => {
|
|
1041
1209
|
if (nav === url) setExpanded(false);
|
|
1042
1210
|
},
|
|
1043
1211
|
sx: sx.link(nav, url, first)
|
|
1044
1212
|
}, /*#__PURE__*/React.createElement(HoverArrow, null), display));
|
|
1045
1213
|
} else {
|
|
1046
|
-
return /*#__PURE__*/React.createElement(Link$
|
|
1214
|
+
return /*#__PURE__*/React.createElement(Link$2, {
|
|
1047
1215
|
href: href,
|
|
1048
1216
|
sx: sx.link(nav, url, first)
|
|
1049
1217
|
}, /*#__PURE__*/React.createElement(HoverArrow, null), display);
|
|
@@ -1072,8 +1240,7 @@ const Header = ({
|
|
|
1072
1240
|
status,
|
|
1073
1241
|
mode,
|
|
1074
1242
|
nav,
|
|
1075
|
-
|
|
1076
|
-
settings
|
|
1243
|
+
menuItems
|
|
1077
1244
|
}) => {
|
|
1078
1245
|
const [expanded, setExpanded] = useState(false);
|
|
1079
1246
|
|
|
@@ -1083,7 +1250,6 @@ const Header = ({
|
|
|
1083
1250
|
|
|
1084
1251
|
return /*#__PURE__*/React.createElement(Row, {
|
|
1085
1252
|
sx: {
|
|
1086
|
-
width: '100%',
|
|
1087
1253
|
pt: ['12px'],
|
|
1088
1254
|
pb: [3]
|
|
1089
1255
|
}
|
|
@@ -1098,7 +1264,7 @@ const Header = ({
|
|
|
1098
1264
|
}, (mode == 'homepage' || mode == 'local') && /*#__PURE__*/React.createElement(NextLink, {
|
|
1099
1265
|
href: "/",
|
|
1100
1266
|
passHref: true
|
|
1101
|
-
}, /*#__PURE__*/React.createElement(Link$
|
|
1267
|
+
}, /*#__PURE__*/React.createElement(Link$2, {
|
|
1102
1268
|
"aria-label": "CarbonPlan Homepage",
|
|
1103
1269
|
sx: {
|
|
1104
1270
|
display: 'block'
|
|
@@ -1109,7 +1275,7 @@ const Header = ({
|
|
|
1109
1275
|
cursor: 'pointer',
|
|
1110
1276
|
color: 'primary'
|
|
1111
1277
|
}
|
|
1112
|
-
}))), (mode == null || mode == 'remote') && /*#__PURE__*/React.createElement(Link$
|
|
1278
|
+
}))), (mode == null || mode == 'remote') && /*#__PURE__*/React.createElement(Link$2, {
|
|
1113
1279
|
href: "https://carbonplan.org",
|
|
1114
1280
|
"aria-label": "CarbonPlan Homepage",
|
|
1115
1281
|
sx: {
|
|
@@ -1135,53 +1301,31 @@ const Header = ({
|
|
|
1135
1301
|
top: ['-2px', '-3px', '-3px']
|
|
1136
1302
|
}
|
|
1137
1303
|
}, status ? `(${status})` : '')), /*#__PURE__*/React.createElement(Column, {
|
|
1138
|
-
start: [status ? 6 : 4, 6,
|
|
1304
|
+
start: [status ? 6 : 4, 6, 11, 11],
|
|
1139
1305
|
width: [status ? 1 : 3, 3, 2, 2],
|
|
1140
1306
|
sx: {
|
|
1141
|
-
|
|
1142
|
-
alignItems: 'center',
|
|
1143
|
-
justifyContent: 'flex-end'
|
|
1144
|
-
}
|
|
1145
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
1146
|
-
sx: {
|
|
1147
|
-
mr: ['18px'],
|
|
1148
|
-
position: 'relative',
|
|
1149
|
-
top: ['-1px'],
|
|
1150
|
-
pointerEvents: expanded || settings && settings.value ? 'none' : 'all',
|
|
1151
|
-
transition: 'opacity 0.15s',
|
|
1152
|
-
display: [status ? 'none' : 'block', 'block', dimmer === 'top' ? 'block' : 'none', dimmer === 'top' ? 'block' : 'none']
|
|
1153
|
-
}
|
|
1154
|
-
}, /*#__PURE__*/React.createElement(Dimmer, {
|
|
1155
|
-
sx: {
|
|
1156
|
-
opacity: expanded || settings && settings.value ? 0 : 1,
|
|
1157
|
-
color: 'primary'
|
|
1307
|
+
zIndex: 5000
|
|
1158
1308
|
}
|
|
1159
|
-
}
|
|
1309
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
1160
1310
|
sx: {
|
|
1161
|
-
|
|
1162
|
-
position: 'relative',
|
|
1163
|
-
pointerEvents: expanded ? 'none' : 'all',
|
|
1164
|
-
transition: 'opacity 0.15s',
|
|
1165
|
-
display: [status ? 'none' : 'block', 'block', 'none', 'none']
|
|
1311
|
+
justifyContent: 'flex-end'
|
|
1166
1312
|
}
|
|
1167
|
-
}, /*#__PURE__*/React.createElement(
|
|
1168
|
-
value: settings.value,
|
|
1169
|
-
onClick: settings.onClick,
|
|
1313
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
1170
1314
|
sx: {
|
|
1315
|
+
mr: '18px',
|
|
1316
|
+
gap: '18px',
|
|
1171
1317
|
opacity: expanded ? 0 : 1,
|
|
1172
|
-
|
|
1318
|
+
transition: 'opacity 0.15s',
|
|
1319
|
+
justifyContent: 'space-between',
|
|
1320
|
+
alignItems: 'center'
|
|
1173
1321
|
}
|
|
1174
|
-
})
|
|
1322
|
+
}, menuItems), /*#__PURE__*/React.createElement(Menu, {
|
|
1175
1323
|
sx: {
|
|
1176
|
-
|
|
1177
|
-
pointerEvents: settings && settings.value ? 'none' : 'all',
|
|
1178
|
-
opacity: settings && settings.value ? 0 : 1,
|
|
1179
|
-
mr: ['-2px'],
|
|
1180
|
-
zIndex: 5000
|
|
1324
|
+
mr: ['-2px']
|
|
1181
1325
|
},
|
|
1182
1326
|
value: expanded,
|
|
1183
1327
|
onClick: toggle
|
|
1184
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
1328
|
+
}))), /*#__PURE__*/React.createElement(Box, {
|
|
1185
1329
|
sx: {
|
|
1186
1330
|
opacity: expanded ? 1 : 0,
|
|
1187
1331
|
pointerEvents: expanded ? 'all' : 'none',
|
|
@@ -1253,7 +1397,7 @@ const Footer = () => {
|
|
|
1253
1397
|
letterSpacing: 'mono',
|
|
1254
1398
|
mb: [2]
|
|
1255
1399
|
}
|
|
1256
|
-
}, "EMAIL"), /*#__PURE__*/React.createElement(Link$
|
|
1400
|
+
}, "EMAIL"), /*#__PURE__*/React.createElement(Link$2, {
|
|
1257
1401
|
href: "mailto:hello@carbonplan.org",
|
|
1258
1402
|
sx: {
|
|
1259
1403
|
textDecoration: 'none',
|
|
@@ -1287,7 +1431,7 @@ const Footer = () => {
|
|
|
1287
1431
|
letterSpacing: 'mono',
|
|
1288
1432
|
mb: [2]
|
|
1289
1433
|
}
|
|
1290
|
-
}, "FOLLOW"), /*#__PURE__*/React.createElement(Link$
|
|
1434
|
+
}, "FOLLOW"), /*#__PURE__*/React.createElement(Link$2, {
|
|
1291
1435
|
href: "https://twitter.com/carbonplanorg",
|
|
1292
1436
|
sx: {
|
|
1293
1437
|
textDecoration: 'none',
|
|
@@ -1381,6 +1525,111 @@ const Footer = () => {
|
|
|
1381
1525
|
}))));
|
|
1382
1526
|
};
|
|
1383
1527
|
|
|
1528
|
+
const Dimmer = (_ref) => {
|
|
1529
|
+
let {
|
|
1530
|
+
sx
|
|
1531
|
+
} = _ref,
|
|
1532
|
+
props = _objectWithoutPropertiesLoose(_ref, ["sx"]);
|
|
1533
|
+
|
|
1534
|
+
const [colorMode, setColorMode] = useColorMode();
|
|
1535
|
+
const toggle = useCallback(() => {
|
|
1536
|
+
setColorMode(colorMode === 'light' ? 'dark' : 'light');
|
|
1537
|
+
}, [colorMode]);
|
|
1538
|
+
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
1539
|
+
"aria-label": "Toggle dark mode",
|
|
1540
|
+
onClick: toggle,
|
|
1541
|
+
role: "checkbox",
|
|
1542
|
+
sx: _extends({
|
|
1543
|
+
width: 32,
|
|
1544
|
+
height: 32,
|
|
1545
|
+
display: 'inline-block',
|
|
1546
|
+
cursor: 'pointer',
|
|
1547
|
+
color: 'secondary'
|
|
1548
|
+
}, sx)
|
|
1549
|
+
}, props), /*#__PURE__*/React.createElement(Sun, {
|
|
1550
|
+
sx: {
|
|
1551
|
+
strokeWidth: '1.75',
|
|
1552
|
+
transition: 'stroke 0.15s',
|
|
1553
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
1554
|
+
'&:hover': {
|
|
1555
|
+
stroke: 'primary'
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
}));
|
|
1560
|
+
};
|
|
1561
|
+
|
|
1562
|
+
const GitSha = () => {
|
|
1563
|
+
const sha = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
|
|
1564
|
+
const owner = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER;
|
|
1565
|
+
const slug = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG;
|
|
1566
|
+
const {
|
|
1567
|
+
theme
|
|
1568
|
+
} = useThemeUI();
|
|
1569
|
+
const color = theme.rawColors.secondary;
|
|
1570
|
+
|
|
1571
|
+
if (sha && owner && slug) {
|
|
1572
|
+
const shortSha = sha.substring(0, 7);
|
|
1573
|
+
const href = 'https://github.com/' + owner + '/' + slug + '/tree/' + sha;
|
|
1574
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
1575
|
+
sx: {
|
|
1576
|
+
display: 'inline-block'
|
|
1577
|
+
}
|
|
1578
|
+
}, /*#__PURE__*/React.createElement(Separator, {
|
|
1579
|
+
color: color
|
|
1580
|
+
}), /*#__PURE__*/React.createElement(Link$2, {
|
|
1581
|
+
href: href,
|
|
1582
|
+
sx: {
|
|
1583
|
+
whiteSpace: 'nowrap',
|
|
1584
|
+
display: 'inline-block',
|
|
1585
|
+
ml: [2],
|
|
1586
|
+
fontFamily: 'mono',
|
|
1587
|
+
letterSpacing: 'body',
|
|
1588
|
+
color: color,
|
|
1589
|
+
fontSize: [1],
|
|
1590
|
+
textTransform: 'uppercase',
|
|
1591
|
+
textDecoration: 'none'
|
|
1592
|
+
}
|
|
1593
|
+
}, shortSha));
|
|
1594
|
+
} else {
|
|
1595
|
+
// fallback
|
|
1596
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
1597
|
+
sx: {
|
|
1598
|
+
display: 'inline-block'
|
|
1599
|
+
}
|
|
1600
|
+
}, /*#__PURE__*/React.createElement(Separator, {
|
|
1601
|
+
color: color
|
|
1602
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
1603
|
+
sx: {
|
|
1604
|
+
whiteSpace: 'nowrap',
|
|
1605
|
+
display: 'inline-block',
|
|
1606
|
+
ml: [2],
|
|
1607
|
+
fontFamily: 'mono',
|
|
1608
|
+
letterSpacing: 'body',
|
|
1609
|
+
color: color,
|
|
1610
|
+
fontSize: [1],
|
|
1611
|
+
textTransform: 'uppercase'
|
|
1612
|
+
}
|
|
1613
|
+
}, color));
|
|
1614
|
+
}
|
|
1615
|
+
};
|
|
1616
|
+
|
|
1617
|
+
const Separator = ({
|
|
1618
|
+
color
|
|
1619
|
+
}) => {
|
|
1620
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
1621
|
+
fill: color,
|
|
1622
|
+
opacity: "0.8",
|
|
1623
|
+
viewBox: "0 0 24 24",
|
|
1624
|
+
width: "24",
|
|
1625
|
+
height: "24"
|
|
1626
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
1627
|
+
r: 5,
|
|
1628
|
+
cx: 19,
|
|
1629
|
+
cy: 19
|
|
1630
|
+
}));
|
|
1631
|
+
};
|
|
1632
|
+
|
|
1384
1633
|
const Value = ({
|
|
1385
1634
|
mode
|
|
1386
1635
|
}) => {
|
|
@@ -1428,10 +1677,6 @@ const Value = ({
|
|
|
1428
1677
|
const Metadata = ({
|
|
1429
1678
|
mode
|
|
1430
1679
|
}) => {
|
|
1431
|
-
const {
|
|
1432
|
-
theme
|
|
1433
|
-
} = useThemeUI();
|
|
1434
|
-
const color = theme.rawColors.secondary;
|
|
1435
1680
|
return /*#__PURE__*/React.createElement(Box, {
|
|
1436
1681
|
sx: {
|
|
1437
1682
|
userSelect: 'none',
|
|
@@ -1444,28 +1689,7 @@ const Metadata = ({
|
|
|
1444
1689
|
}
|
|
1445
1690
|
}, /*#__PURE__*/React.createElement(Value, {
|
|
1446
1691
|
mode: mode
|
|
1447
|
-
}), /*#__PURE__*/React.createElement(
|
|
1448
|
-
fill: color,
|
|
1449
|
-
opacity: "0.8",
|
|
1450
|
-
viewBox: "0 0 24 24",
|
|
1451
|
-
width: "24",
|
|
1452
|
-
height: "24"
|
|
1453
|
-
}, /*#__PURE__*/React.createElement("circle", {
|
|
1454
|
-
r: 5,
|
|
1455
|
-
cx: 19,
|
|
1456
|
-
cy: 19
|
|
1457
|
-
})), /*#__PURE__*/React.createElement(Text, {
|
|
1458
|
-
sx: {
|
|
1459
|
-
whiteSpace: 'nowrap',
|
|
1460
|
-
display: 'inline-block',
|
|
1461
|
-
ml: [2],
|
|
1462
|
-
fontFamily: 'mono',
|
|
1463
|
-
letterSpacing: 'body',
|
|
1464
|
-
color: 'secondary',
|
|
1465
|
-
fontSize: [1],
|
|
1466
|
-
textTransform: 'uppercase'
|
|
1467
|
-
}
|
|
1468
|
-
}, color));
|
|
1692
|
+
}), /*#__PURE__*/React.createElement(GitSha, null));
|
|
1469
1693
|
};
|
|
1470
1694
|
|
|
1471
1695
|
function init(mode) {
|
|
@@ -1642,6 +1866,112 @@ function GuideColumns({
|
|
|
1642
1866
|
}));
|
|
1643
1867
|
}
|
|
1644
1868
|
|
|
1869
|
+
const Settings = (_ref) => {
|
|
1870
|
+
let {
|
|
1871
|
+
value,
|
|
1872
|
+
sx
|
|
1873
|
+
} = _ref,
|
|
1874
|
+
props = _objectWithoutPropertiesLoose(_ref, ["value", "sx"]);
|
|
1875
|
+
|
|
1876
|
+
return /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
1877
|
+
sx: _extends({
|
|
1878
|
+
cursor: 'pointer',
|
|
1879
|
+
fill: 'none',
|
|
1880
|
+
strokeWidth: '2px',
|
|
1881
|
+
stroke: 'text',
|
|
1882
|
+
'.paren': {
|
|
1883
|
+
opacity: '0'
|
|
1884
|
+
},
|
|
1885
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
1886
|
+
'&:hover .paren': {
|
|
1887
|
+
opacity: '1'
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
}, sx),
|
|
1891
|
+
"aria-label": "Toggle Menu"
|
|
1892
|
+
}, props), !value && /*#__PURE__*/React.createElement("svg", {
|
|
1893
|
+
style: {
|
|
1894
|
+
width: '50px',
|
|
1895
|
+
height: '30px',
|
|
1896
|
+
transform: 'scale(2)',
|
|
1897
|
+
marginTop: '-3px'
|
|
1898
|
+
},
|
|
1899
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1900
|
+
viewBox: "0 0 68 36"
|
|
1901
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
1902
|
+
x1: "24",
|
|
1903
|
+
y1: "2.1",
|
|
1904
|
+
x2: "24",
|
|
1905
|
+
y2: "6.1"
|
|
1906
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
1907
|
+
x1: "24",
|
|
1908
|
+
y1: "24.1",
|
|
1909
|
+
x2: "24",
|
|
1910
|
+
y2: "33.9"
|
|
1911
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
1912
|
+
x1: "44",
|
|
1913
|
+
y1: "2.1",
|
|
1914
|
+
x2: "44",
|
|
1915
|
+
y2: "12.1"
|
|
1916
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
1917
|
+
x1: "44",
|
|
1918
|
+
y1: "30.1",
|
|
1919
|
+
x2: "44",
|
|
1920
|
+
y2: "33.9"
|
|
1921
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
1922
|
+
cx: "24",
|
|
1923
|
+
cy: "15.1",
|
|
1924
|
+
r: "5"
|
|
1925
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
1926
|
+
cx: "44",
|
|
1927
|
+
cy: "21.1",
|
|
1928
|
+
r: "5"
|
|
1929
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1930
|
+
style: {
|
|
1931
|
+
transition: 'all 0.2s'
|
|
1932
|
+
},
|
|
1933
|
+
className: "paren",
|
|
1934
|
+
d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
|
|
1935
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1936
|
+
style: {
|
|
1937
|
+
transition: 'all 0.2s'
|
|
1938
|
+
},
|
|
1939
|
+
className: "paren",
|
|
1940
|
+
d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
|
|
1941
|
+
})), value && /*#__PURE__*/React.createElement("svg", {
|
|
1942
|
+
style: {
|
|
1943
|
+
width: '50px',
|
|
1944
|
+
height: '30px',
|
|
1945
|
+
transform: 'scale(2)',
|
|
1946
|
+
marginTop: '-3px'
|
|
1947
|
+
},
|
|
1948
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1949
|
+
viewBox: "0 0 68 36"
|
|
1950
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
1951
|
+
x1: "50.85",
|
|
1952
|
+
y1: "29.79",
|
|
1953
|
+
x2: "17.15",
|
|
1954
|
+
y2: "6.21"
|
|
1955
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
1956
|
+
x1: "17.15",
|
|
1957
|
+
y1: "29.79",
|
|
1958
|
+
x2: "50.85",
|
|
1959
|
+
y2: "6.21"
|
|
1960
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1961
|
+
style: {
|
|
1962
|
+
transition: 'all 0.2s'
|
|
1963
|
+
},
|
|
1964
|
+
className: "paren",
|
|
1965
|
+
d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
|
|
1966
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
1967
|
+
style: {
|
|
1968
|
+
transition: 'all 0.2s'
|
|
1969
|
+
},
|
|
1970
|
+
className: "paren",
|
|
1971
|
+
d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
|
|
1972
|
+
})));
|
|
1973
|
+
};
|
|
1974
|
+
|
|
1645
1975
|
const Layout = ({
|
|
1646
1976
|
title,
|
|
1647
1977
|
description,
|
|
@@ -1661,6 +1991,7 @@ const Layout = ({
|
|
|
1661
1991
|
container: _container = true
|
|
1662
1992
|
}) => {
|
|
1663
1993
|
let content = children;
|
|
1994
|
+
const index = useBreakpointIndex();
|
|
1664
1995
|
|
|
1665
1996
|
if (_fade) {
|
|
1666
1997
|
content = /*#__PURE__*/React.createElement(FadeIn, {
|
|
@@ -1669,7 +2000,34 @@ const Layout = ({
|
|
|
1669
2000
|
}
|
|
1670
2001
|
|
|
1671
2002
|
if (_container) {
|
|
1672
|
-
content = /*#__PURE__*/React.createElement(
|
|
2003
|
+
content = /*#__PURE__*/React.createElement(Box, {
|
|
2004
|
+
sx: {
|
|
2005
|
+
mb: [8, 8, 9, 10]
|
|
2006
|
+
}
|
|
2007
|
+
}, /*#__PURE__*/React.createElement(Container, null, content));
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
useEffect(() => {
|
|
2011
|
+
if (index > 2 && settings != null && settings.value && settings != null && settings.onClick) {
|
|
2012
|
+
settings == null ? void 0 : settings.onClick();
|
|
2013
|
+
}
|
|
2014
|
+
}, [index, settings == null ? void 0 : settings.value, settings == null ? void 0 : settings.onClick]);
|
|
2015
|
+
const menuItems = [/*#__PURE__*/React.createElement(Dimmer, {
|
|
2016
|
+
key: "dimmer",
|
|
2017
|
+
sx: {
|
|
2018
|
+
color: 'primary',
|
|
2019
|
+
mt: '-2px',
|
|
2020
|
+
display: ['block', 'block', _dimmer === 'top' ? 'block' : 'none', _dimmer === 'top' ? 'block' : 'none']
|
|
2021
|
+
}
|
|
2022
|
+
})];
|
|
2023
|
+
|
|
2024
|
+
if (settings) {
|
|
2025
|
+
menuItems.push( /*#__PURE__*/React.createElement(Settings, _extends({
|
|
2026
|
+
key: "settings",
|
|
2027
|
+
sx: {
|
|
2028
|
+
display: ['inherit', 'inherit', 'none', 'none']
|
|
2029
|
+
}
|
|
2030
|
+
}, settings)));
|
|
1673
2031
|
}
|
|
1674
2032
|
|
|
1675
2033
|
return /*#__PURE__*/React.createElement(React.Fragment, null, _guide && /*#__PURE__*/React.createElement(Guide, {
|
|
@@ -1701,8 +2059,7 @@ const Layout = ({
|
|
|
1701
2059
|
mode: _links,
|
|
1702
2060
|
status: status,
|
|
1703
2061
|
nav: nav,
|
|
1704
|
-
|
|
1705
|
-
dimmer: _dimmer
|
|
2062
|
+
menuItems: menuItems
|
|
1706
2063
|
}))), /*#__PURE__*/React.createElement(Box, {
|
|
1707
2064
|
sx: {
|
|
1708
2065
|
width: '100%',
|
|
@@ -2012,7 +2369,7 @@ const Group = ({
|
|
|
2012
2369
|
}));
|
|
2013
2370
|
};
|
|
2014
2371
|
|
|
2015
|
-
const Input = (_ref) => {
|
|
2372
|
+
const Input = (_ref, ref) => {
|
|
2016
2373
|
let {
|
|
2017
2374
|
size = 'sm',
|
|
2018
2375
|
inverted,
|
|
@@ -2052,10 +2409,13 @@ const Input = (_ref) => {
|
|
|
2052
2409
|
}, getSizeStyles(size), sx);
|
|
2053
2410
|
|
|
2054
2411
|
return /*#__PURE__*/React.createElement(Input$1, _extends({}, props, {
|
|
2412
|
+
ref: ref,
|
|
2055
2413
|
sx: styles
|
|
2056
2414
|
}));
|
|
2057
2415
|
};
|
|
2058
2416
|
|
|
2417
|
+
var input = forwardRef(Input);
|
|
2418
|
+
|
|
2059
2419
|
const getProps = test => props => {
|
|
2060
2420
|
const next = {};
|
|
2061
2421
|
|
|
@@ -2070,9 +2430,10 @@ const Select = (_ref) => {
|
|
|
2070
2430
|
let {
|
|
2071
2431
|
children,
|
|
2072
2432
|
size = 'sm',
|
|
2073
|
-
sx
|
|
2433
|
+
sx,
|
|
2434
|
+
sxSelect
|
|
2074
2435
|
} = _ref,
|
|
2075
|
-
props = _objectWithoutPropertiesLoose(_ref, ["children", "size", "sx"]);
|
|
2436
|
+
props = _objectWithoutPropertiesLoose(_ref, ["children", "size", "sx", "sxSelect"]);
|
|
2076
2437
|
|
|
2077
2438
|
const color = sx && sx.color ? sx.color : 'primary';
|
|
2078
2439
|
const sizeStyles = getSizeStyles(size);
|
|
@@ -2144,7 +2505,7 @@ const Select = (_ref) => {
|
|
|
2144
2505
|
background: 'transparent !important'
|
|
2145
2506
|
}
|
|
2146
2507
|
}
|
|
2147
|
-
})
|
|
2508
|
+
}, sxSelect)
|
|
2148
2509
|
}, omitOnChange), children), /*#__PURE__*/React.createElement(Arrow, {
|
|
2149
2510
|
sx: {
|
|
2150
2511
|
width: width,
|
|
@@ -2159,7 +2520,7 @@ const Select = (_ref) => {
|
|
|
2159
2520
|
}));
|
|
2160
2521
|
};
|
|
2161
2522
|
|
|
2162
|
-
const Slider = (_ref) => {
|
|
2523
|
+
const Slider = (_ref, ref) => {
|
|
2163
2524
|
let {
|
|
2164
2525
|
sx
|
|
2165
2526
|
} = _ref,
|
|
@@ -2172,6 +2533,7 @@ const Slider = (_ref) => {
|
|
|
2172
2533
|
}
|
|
2173
2534
|
} = useThemeUI();
|
|
2174
2535
|
return /*#__PURE__*/React.createElement(Slider$1, _extends({
|
|
2536
|
+
ref: ref,
|
|
2175
2537
|
sx: _extends({
|
|
2176
2538
|
'&::-webkit-slider-thumb': {
|
|
2177
2539
|
height: [22, 18, 16],
|
|
@@ -2203,7 +2565,9 @@ const Slider = (_ref) => {
|
|
|
2203
2565
|
}, props));
|
|
2204
2566
|
};
|
|
2205
2567
|
|
|
2206
|
-
|
|
2568
|
+
var slider = forwardRef(Slider);
|
|
2569
|
+
|
|
2570
|
+
const styles$1 = {
|
|
2207
2571
|
reset: {
|
|
2208
2572
|
verticalAlign: 'baseline',
|
|
2209
2573
|
border: 0,
|
|
@@ -2272,7 +2636,7 @@ const Table = ({
|
|
|
2272
2636
|
}
|
|
2273
2637
|
}, header && /*#__PURE__*/React.createElement(Row, {
|
|
2274
2638
|
as: "tr",
|
|
2275
|
-
sx: _extends({}, styles.reset, styles.header, styles.row, {
|
|
2639
|
+
sx: _extends({}, styles$1.reset, styles$1.header, styles$1.row, {
|
|
2276
2640
|
color: color,
|
|
2277
2641
|
borderTopWidth: !_borderTop ? '0px' : '1px'
|
|
2278
2642
|
})
|
|
@@ -2280,13 +2644,13 @@ const Table = ({
|
|
|
2280
2644
|
as: "td",
|
|
2281
2645
|
start: [1],
|
|
2282
2646
|
width: columns,
|
|
2283
|
-
sx: styles.index
|
|
2647
|
+
sx: styles$1.index
|
|
2284
2648
|
}, header)), data.map((row, i) => {
|
|
2285
2649
|
return /*#__PURE__*/React.createElement(Row, {
|
|
2286
2650
|
as: "tr",
|
|
2287
2651
|
columns: columns,
|
|
2288
2652
|
key: i,
|
|
2289
|
-
sx: _extends({}, styles.reset, styles.row, {
|
|
2653
|
+
sx: _extends({}, styles$1.reset, styles$1.row, {
|
|
2290
2654
|
pb: _borderBottom && i === data.length - 1 ? ['18px', '18px', '18px', '22px'] : [3, 3, 3, '20px'],
|
|
2291
2655
|
borderBottomWidth: _borderBottom && i === data.length - 1 ? '1px' : '0px',
|
|
2292
2656
|
borderTopWidth: !_borderTop && i === 0 && !header ? '0px' : '1px'
|
|
@@ -2297,13 +2661,13 @@ const Table = ({
|
|
|
2297
2661
|
key: j,
|
|
2298
2662
|
start: start[j],
|
|
2299
2663
|
width: width[j],
|
|
2300
|
-
sx: j == 0 && _index ? _extends({}, styles.reset, styles.index) : _extends({}, styles.reset, styles.entry)
|
|
2664
|
+
sx: j == 0 && _index ? _extends({}, styles$1.reset, styles$1.index) : _extends({}, styles$1.reset, styles$1.entry)
|
|
2301
2665
|
}, column);
|
|
2302
2666
|
}));
|
|
2303
2667
|
})));
|
|
2304
2668
|
};
|
|
2305
2669
|
|
|
2306
|
-
const Toggle = (_ref) => {
|
|
2670
|
+
const Toggle = (_ref, ref) => {
|
|
2307
2671
|
let {
|
|
2308
2672
|
value,
|
|
2309
2673
|
onClick,
|
|
@@ -2315,6 +2679,7 @@ const Toggle = (_ref) => {
|
|
|
2315
2679
|
const color = sx && sx.color ? sx.color : 'primary';
|
|
2316
2680
|
value = disabled ? false : value;
|
|
2317
2681
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
2682
|
+
ref: ref,
|
|
2318
2683
|
as: "button",
|
|
2319
2684
|
onClick: onClick,
|
|
2320
2685
|
role: "checkbox",
|
|
@@ -2352,6 +2717,8 @@ const Toggle = (_ref) => {
|
|
|
2352
2717
|
})));
|
|
2353
2718
|
};
|
|
2354
2719
|
|
|
2720
|
+
var toggle = forwardRef(Toggle);
|
|
2721
|
+
|
|
2355
2722
|
const Tracking = ({
|
|
2356
2723
|
id
|
|
2357
2724
|
}) => {
|
|
@@ -2383,7 +2750,6 @@ const Tray = ({
|
|
|
2383
2750
|
}) => {
|
|
2384
2751
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
|
|
2385
2752
|
sx: {
|
|
2386
|
-
display: ['initial', 'initial', 'none', 'none'],
|
|
2387
2753
|
position: 'fixed',
|
|
2388
2754
|
top: '56px',
|
|
2389
2755
|
bottom: '0px',
|
|
@@ -2398,7 +2764,6 @@ const Tray = ({
|
|
|
2398
2764
|
}
|
|
2399
2765
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
2400
2766
|
sx: _extends({
|
|
2401
|
-
display: ['initial', 'initial', 'none', 'none'],
|
|
2402
2767
|
position: 'fixed',
|
|
2403
2768
|
width: 'calc(100vw)',
|
|
2404
2769
|
top: '0px',
|
|
@@ -2454,5 +2819,5 @@ const formatDate = (date, options = defaultOptions) => {
|
|
|
2454
2819
|
return [month, day, year].filter(Boolean).join(' ');
|
|
2455
2820
|
};
|
|
2456
2821
|
|
|
2457
|
-
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 };
|
|
2822
|
+
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 };
|
|
2458
2823
|
//# sourceMappingURL=index.modern.js.map
|