@carbonplan/components 11.0.5-develop.1 → 11.0.5

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
@@ -1683,7 +1685,6 @@ const Metadata = ({
1683
1685
  position: 'fixed',
1684
1686
  bottom: '42px',
1685
1687
  right: '24px',
1686
- width: '87px',
1687
1688
  transformOrigin: 'right',
1688
1689
  transform: 'rotate(90deg)',
1689
1690
  display: ['none', 'none', 'initial']
@@ -2013,18 +2014,18 @@ const Layout = ({
2013
2014
  useEffect(() => {
2014
2015
  if (!theme) return;
2015
2016
 
2016
- const handler = () => {
2017
- 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) {
2018
2019
  settings == null ? void 0 : settings.onClick();
2019
2020
  }
2020
2021
  };
2021
2022
 
2022
- const query = window.matchMedia(`(max-width: ${theme.breakpoints[1]})`);
2023
- query.addListener(handler);
2023
+ const query = window.matchMedia(`(min-width: ${theme.breakpoints[1]})`);
2024
+ query.onchange = handler;
2024
2025
  return () => {
2025
- query.removeListener(handler);
2026
+ query.onchange = null;
2026
2027
  };
2027
- }, [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]);
2028
2029
  const menuItems = [/*#__PURE__*/React.createElement(Dimmer, {
2029
2030
  key: "dimmer",
2030
2031
  sx: {