@carbonplan/components 11.0.5-develop.0 → 11.0.5-develop.4

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.
@@ -1573,7 +1573,8 @@ const GitSha = () => {
1573
1573
  const href = 'https://github.com/' + owner + '/' + slug + '/tree/' + sha;
1574
1574
  return /*#__PURE__*/React.createElement(Box, {
1575
1575
  sx: {
1576
- display: 'inline-block'
1576
+ display: 'inline-block',
1577
+ width: '87px'
1577
1578
  }
1578
1579
  }, /*#__PURE__*/React.createElement(Separator, {
1579
1580
  color: color
@@ -1595,7 +1596,8 @@ const GitSha = () => {
1595
1596
  // fallback
1596
1597
  return /*#__PURE__*/React.createElement(Box, {
1597
1598
  sx: {
1598
- display: 'inline-block'
1599
+ display: 'inline-block',
1600
+ width: '87px'
1599
1601
  }
1600
1602
  }, /*#__PURE__*/React.createElement(Separator, {
1601
1603
  color: color
@@ -1681,8 +1683,8 @@ const Metadata = ({
1681
1683
  sx: {
1682
1684
  userSelect: 'none',
1683
1685
  position: 'fixed',
1684
- bottom: 42,
1685
- right: 24,
1686
+ bottom: '42px',
1687
+ right: '24px',
1686
1688
  transformOrigin: 'right',
1687
1689
  transform: 'rotate(90deg)',
1688
1690
  display: ['none', 'none', 'initial']
@@ -2012,18 +2014,18 @@ const Layout = ({
2012
2014
  useEffect(() => {
2013
2015
  if (!theme) return;
2014
2016
 
2015
- const handler = () => {
2016
- if (settings != null && settings.value && settings != null && settings.onClick) {
2017
+ const handler = e => {
2018
+ if (e.matches && settings != null && settings.value && settings != null && settings.onClick) {
2017
2019
  settings == null ? void 0 : settings.onClick();
2018
2020
  }
2019
2021
  };
2020
2022
 
2021
- const query = window.matchMedia(`(max-width: ${theme.breakpoints[1]})`);
2022
- query.addListener(handler);
2023
+ const query = window.matchMedia(`(min-width: ${theme.breakpoints[1]})`);
2024
+ query.onchange = handler;
2023
2025
  return () => {
2024
- query.removeListener(handler);
2026
+ query.onchange = null;
2025
2027
  };
2026
- }, [theme, settings == null ? void 0 : settings.value, settings == null ? void 0 : settings.onClick]);
2028
+ }, [theme == null ? void 0 : theme.breakpoints, settings == null ? void 0 : settings.value, settings == null ? void 0 : settings.onClick]);
2027
2029
  const menuItems = [/*#__PURE__*/React.createElement(Dimmer, {
2028
2030
  key: "dimmer",
2029
2031
  sx: {