@superdispatch/ui-lab 0.20.0 → 0.20.3

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.
@@ -1137,7 +1137,7 @@ var NavbarLabel = /*#__PURE__*/styled__default.span.withConfig({
1137
1137
  var NavbarItemRoot = /*#__PURE__*/styled__default.div.withConfig({
1138
1138
  displayName: "NavbarItem__NavbarItemRoot",
1139
1139
  componentId: "SD__sc-1pvzq3w-2"
1140
- })(["width:100%;display:flex;align-items:center;color:#c2c4c9;font-size:14px;font-weight:400;line-height:20px;text-decoration:none;outline:none;cursor:pointer;padding:8px 16px;border-left:4px solid transparent;&:hover,&[aria-current]{background-color:#2f394a;color:", ";border-left-color:", ";}&[data-active='true']{border-left-color:", ";}"], ui.Color.White, ui.Color.Blue300, ui.Color.Blue300);
1140
+ })(["width:100%;display:flex;align-items:center;color:#c2c4c9;font-size:14px;font-weight:400;line-height:20px;text-decoration:none;outline:none;cursor:pointer;padding:8px 16px;border-left:4px solid transparent;&:hover,&[aria-current]{background-color:#2f394a;color:", ";border-left-color:", ";}&[data-active='true']{background-color:#2f394a;border-left-color:", ";}"], ui.Color.White, ui.Color.Blue300, ui.Color.Blue300);
1141
1141
  var IconWrapper$1 = /*#__PURE__*/styled__default.div.withConfig({
1142
1142
  displayName: "NavbarItem__IconWrapper",
1143
1143
  componentId: "SD__sc-1pvzq3w-3"
@@ -1187,12 +1187,12 @@ var NavbarAccordionRoot = /*#__PURE__*/styled__default(core.Accordion).withConfi
1187
1187
  var {
1188
1188
  gutter
1189
1189
  } = _ref;
1190
- return styled.css(["width:100%;color:#c2c4c9;font-size:14px;font-weight:400;line-height:20px;text-decoration:none;outline:none;cursor:pointer;background-color:#1b2638;margin-top:", ";&:hover,&[aria-current]{background-color:#2f394a;color:", ";}&.MuiAccordion-root:before{background-color:#1b2638;}&.MuiPaper-elevation0{border:0px;}&&.MuiAccordionSummary-root.Mui-expanded{margin-top:", ";max-height:40px;min-height:40px;}"], gutter ? '16px' : '0', ui.Color.White, gutter ? '16px' : '0');
1190
+ return styled.css(["width:100%;color:#c2c4c9;font-size:14px;font-weight:400;line-height:20px;text-decoration:none;outline:none;cursor:pointer;background-color:#1b2638;margin-top:", ";&[aria-current]{background-color:#2f394a;color:", ";}&.MuiAccordion-root:before{background-color:#1b2638;}&.MuiPaper-elevation0{border:0px;}&.MuiAccordion-root.Mui-expanded{margin-top:", ";}"], gutter ? '16px' : '0', ui.Color.White, gutter ? '16px' : '0');
1191
1191
  });
1192
1192
  var NavbarAccordionSummary = /*#__PURE__*/styled__default(core.AccordionSummary).withConfig({
1193
1193
  displayName: "NavbarAccordion__NavbarAccordionSummary",
1194
1194
  componentId: "SD__sc-1s7g3kw-2"
1195
- })(["border-left:4px solid transparent;padding-left:20px;&.MuiAccordionSummary-root{max-height:40px;min-height:40px;}&:hover,&[data-active='true']{border-left-color:", ";}&[data-expanded='false']{.MuiAccordionSummary-expandIcon{display:none;}}"], ui.Color.Blue300);
1195
+ })(["border-left:4px solid transparent;padding-left:20px;&.MuiAccordionSummary-root{max-height:40px;min-height:40px;}&:hover,&[data-active='true']{background-color:#2f394a;border-left-color:", ";}&[data-expanded='false']{.MuiAccordionSummary-expandIcon{display:none;}}"], ui.Color.Blue300);
1196
1196
  var IconWrapper$2 = /*#__PURE__*/styled__default.div.withConfig({
1197
1197
  displayName: "NavbarAccordion__IconWrapper",
1198
1198
  componentId: "SD__sc-1s7g3kw-3"
@@ -1734,6 +1734,10 @@ var SidebarAppBar = /*#__PURE__*/styled__default(core.AppBar).withConfig({
1734
1734
  } = _ref;
1735
1735
  return styled.css(["", "{&&{border-left:transparent;}}"], theme.breakpoints.up('sm'));
1736
1736
  });
1737
+ var ToolbarContent = /*#__PURE__*/styled__default.div.withConfig({
1738
+ displayName: "SidebarContent__ToolbarContent",
1739
+ componentId: "SD__sc-zpgf61-1"
1740
+ })(["flex:1;padding:16px;"]);
1737
1741
  function SidebarContent(_ref2) {
1738
1742
  var {
1739
1743
  dense,
@@ -1778,27 +1782,38 @@ function SidebarContent(_ref2) {
1778
1782
  space: "none",
1779
1783
  children: [/*#__PURE__*/jsxRuntime.jsx(SidebarAppBar, {
1780
1784
  children: /*#__PURE__*/jsxRuntime.jsx(core.Toolbar, {
1781
- children: /*#__PURE__*/jsxRuntime.jsxs(ui.Columns, {
1782
- align: "center",
1783
- space: "small",
1784
- children: [/*#__PURE__*/jsxRuntime.jsx(ui.Column, {
1785
- width: "content",
1786
- children: /*#__PURE__*/jsxRuntime.jsx(SidebarBackButton, {
1787
- onClick: onBack
1788
- })
1789
- }), /*#__PURE__*/jsxRuntime.jsx(ui.Column, {
1790
- children: /*#__PURE__*/jsxRuntime.jsx(TextBox, {
1791
- variant: "heading-2",
1792
- children: title
1793
- })
1794
- }), /*#__PURE__*/jsxRuntime.jsx(ui.Column, {
1795
- width: "content",
1796
- children: action
1797
- })]
1785
+ disableGutters: true,
1786
+ children: /*#__PURE__*/jsxRuntime.jsx(ToolbarContent, {
1787
+ children: /*#__PURE__*/jsxRuntime.jsxs(ui.Columns, {
1788
+ align: ['top', 'center'],
1789
+ space: "small",
1790
+ children: [/*#__PURE__*/jsxRuntime.jsx(ui.Column, {
1791
+ width: "content",
1792
+ children: /*#__PURE__*/jsxRuntime.jsx(SidebarBackButton, {
1793
+ onClick: onBack
1794
+ })
1795
+ }), /*#__PURE__*/jsxRuntime.jsx(ui.Column, {
1796
+ children: /*#__PURE__*/jsxRuntime.jsxs(ui.Columns, {
1797
+ space: "small",
1798
+ collapseBelow: "tablet",
1799
+ reverse: [true, false],
1800
+ align: ['bottom', 'center'],
1801
+ children: [/*#__PURE__*/jsxRuntime.jsx(ui.Column, {
1802
+ children: /*#__PURE__*/jsxRuntime.jsx(TextBox, {
1803
+ variant: "heading-2",
1804
+ children: title
1805
+ })
1806
+ }), action && /*#__PURE__*/jsxRuntime.jsx(ui.Column, {
1807
+ width: "content",
1808
+ children: action
1809
+ })]
1810
+ })
1811
+ })]
1812
+ })
1798
1813
  })
1799
1814
  })
1800
1815
  }), /*#__PURE__*/jsxRuntime.jsx(Box, {
1801
- padding: dense ? 'none' : 'medium',
1816
+ padding: dense ? 'none' : ['small', 'medium'],
1802
1817
  children: children
1803
1818
  })]
1804
1819
  });
@@ -1868,26 +1883,40 @@ var SidebarMenuItem = /*#__PURE__*/react.forwardRef((_ref2, ref) => {
1868
1883
  openContentOnClick
1869
1884
  } = _ref2;
1870
1885
  var [hovered, setHovered] = react.useState(false);
1886
+ var rootRef = react.useRef(null);
1871
1887
  var actionsRef = react.useRef(null);
1872
1888
  var actionsPlaceholderRef = react.useRef(null);
1873
1889
  var {
1874
1890
  openSidebarContent
1875
1891
  } = useSidebarContext();
1892
+ var {
1893
+ matches: isHoverSupported
1894
+ } = matchMedia('(hover: hover)');
1876
1895
  react.useLayoutEffect(() => {
1877
1896
  if (actionsRef.current && actionsPlaceholderRef.current) {
1878
1897
  actionsPlaceholderRef.current.style.width = "".concat(Math.max(0, actionsRef.current.offsetWidth - 8), "px");
1879
1898
  }
1880
1899
  });
1900
+ react.useLayoutEffect(() => {
1901
+ var rootNode = rootRef.current;
1902
+
1903
+ if (rootNode) {
1904
+ if (isHoverSupported) {
1905
+ rootNode.addEventListener('mouseenter', () => {
1906
+ setHovered(true);
1907
+ });
1908
+ rootNode.addEventListener('mouseleave', () => {
1909
+ setHovered(false);
1910
+ });
1911
+ } else {
1912
+ setHovered(true);
1913
+ }
1914
+ }
1915
+ }, [isHoverSupported]);
1881
1916
  var badge = !badgeProp || !Number.isFinite(badgeProp) ? null : badgeProp > 999 ? '999+' : badgeProp;
1882
1917
  return /*#__PURE__*/jsxRuntime.jsxs(SidebarMenuItemRoot, {
1883
- ref: ref,
1918
+ ref: ui.mergeRefs(ref, rootRef),
1884
1919
  hasAvatar: !!avatar,
1885
- onMouseEnter: () => {
1886
- setHovered(true);
1887
- },
1888
- onMouseLeave: () => {
1889
- setHovered(false);
1890
- },
1891
1920
  children: [/*#__PURE__*/jsxRuntime.jsx(core.ButtonBase, {
1892
1921
  disabled: disabled,
1893
1922
  "aria-current": selected,