@superdispatch/ui-lab 0.18.3 → 0.19.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/dist-src/index.js CHANGED
@@ -7,6 +7,8 @@ export * from "./container/Container.js";
7
7
  export * from "./description-item/DescriptionItem.js";
8
8
  export * from "./file-drop-zone/FileDropZone.js";
9
9
  export * from "./file-list-item/FileListItem.js";
10
+ export * from "./linked-text/LinkedText.js";
11
+ export * from "./multiline-text/MultilineText.js";
10
12
  export * from "./navbar/Navbar.js";
11
13
  export * from "./navbar/NavbarAvatar.js";
12
14
  export * from "./navbar/NavbarBottomBar.js";
@@ -0,0 +1,11 @@
1
+ import styled from 'styled-components';
2
+ export var MultilineText = /*#__PURE__*/styled.span.withConfig({
3
+ displayName: "MultilineText",
4
+ componentId: "SD__sc-34heyp-0"
5
+ })(["white-space:pre-wrap;overflow-wrap:", ";"], _ref => {
6
+ var {
7
+ overflowWrap = 'normal'
8
+ } = _ref;
9
+ return overflowWrap;
10
+ });
11
+ MultilineText.displayName = 'MultilineText';
@@ -0,0 +1,97 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import { Accordion, AccordionSummary } from '@material-ui/core';
3
+ import { ExpandMore } from '@material-ui/icons';
4
+ import { Color, useUID } from '@superdispatch/ui';
5
+ import { useEffect, useState } from 'react';
6
+ import styled, { css } from 'styled-components';
7
+ import { useNavbarContext } from "./NavbarContext.js";
8
+ import { NavbarItem } from "./NavbarItem.js";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { createElement as _createElement } from "react";
12
+ export var NavbarAccordionLabel = /*#__PURE__*/styled.span.withConfig({
13
+ displayName: "NavbarAccordion__NavbarAccordionLabel",
14
+ componentId: "SD__sc-1s7g3kw-0"
15
+ })(["flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;&[data-expanded='false']{display:none;}"]);
16
+ var NavbarAccordionRoot = /*#__PURE__*/styled(Accordion).withConfig({
17
+ displayName: "NavbarAccordion__NavbarAccordionRoot",
18
+ componentId: "SD__sc-1s7g3kw-1"
19
+ })(_ref => {
20
+ var {
21
+ gutter
22
+ } = _ref;
23
+ return 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', Color.White, gutter ? '16px' : '0');
24
+ });
25
+ var NavbarAccordionSummary = /*#__PURE__*/styled(AccordionSummary).withConfig({
26
+ displayName: "NavbarAccordion__NavbarAccordionSummary",
27
+ componentId: "SD__sc-1s7g3kw-2"
28
+ })(["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;}}"], Color.Blue300);
29
+ var IconWrapper = /*#__PURE__*/styled.div.withConfig({
30
+ displayName: "NavbarAccordion__IconWrapper",
31
+ componentId: "SD__sc-1s7g3kw-3"
32
+ })(["width:24px;margin-right:8px;& svg{font-size:24px;}"]);
33
+ export function NavbarAccordion(_ref2) {
34
+ var {
35
+ label,
36
+ icon,
37
+ gutter,
38
+ items,
39
+ onClick: _onClick
40
+ } = _ref2;
41
+ var uid = useUID();
42
+ var {
43
+ isExpanded: isMenuExpanded,
44
+ isDrawerOpen,
45
+ setDrawerOpen
46
+ } = useNavbarContext();
47
+ var [isExpanded, setExpanded] = useState(false);
48
+ useEffect(() => {
49
+ if (!isMenuExpanded) {
50
+ setExpanded(false);
51
+ }
52
+ }, [isMenuExpanded]);
53
+ return /*#__PURE__*/_jsxs(NavbarAccordionRoot, {
54
+ "aria-labelledby": uid,
55
+ gutter: !!gutter,
56
+ expanded: isExpanded,
57
+ onClick: event => {
58
+ if (isMenuExpanded || isDrawerOpen) {
59
+ setExpanded(!isExpanded);
60
+ }
61
+
62
+ _onClick(event);
63
+ },
64
+ square: true,
65
+ children: [/*#__PURE__*/_jsxs(NavbarAccordionSummary, {
66
+ "data-active": !isExpanded && items.some(item => item.active),
67
+ "data-expanded": isMenuExpanded || isDrawerOpen,
68
+ expandIcon: /*#__PURE__*/_jsx(ExpandMore, {}),
69
+ children: [/*#__PURE__*/_jsx(IconWrapper, {
70
+ children: icon
71
+ }), /*#__PURE__*/_jsx(NavbarAccordionLabel, {
72
+ id: uid,
73
+ "data-expanded": isMenuExpanded || isDrawerOpen,
74
+ children: label
75
+ })]
76
+ }), items.map(item => {
77
+ var index = items.indexOf(item);
78
+ var prev = items[index - 1];
79
+ return /*#__PURE__*/_createElement(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
80
+ key: item.key,
81
+ ident: 1,
82
+ active: item.active,
83
+ gutter: prev && prev.groupKey !== item.groupKey,
84
+ onClick: event => {
85
+ var _item$onClick;
86
+
87
+ event.stopPropagation();
88
+ (_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
89
+
90
+ if (!event.isDefaultPrevented()) {
91
+ setDrawerOpen(false);
92
+ }
93
+ }
94
+ }));
95
+ })]
96
+ });
97
+ }
@@ -13,7 +13,7 @@ export var NavbarLabel = /*#__PURE__*/styled.span.withConfig({
13
13
  var NavbarItemRoot = /*#__PURE__*/styled.div.withConfig({
14
14
  displayName: "NavbarItem__NavbarItemRoot",
15
15
  componentId: "SD__sc-1pvzq3w-2"
16
- })(["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:", ";}"], Color.White, Color.Blue300);
16
+ })(["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:", ";}"], Color.White, Color.Blue300, Color.Blue300);
17
17
  var IconWrapper = /*#__PURE__*/styled.div.withConfig({
18
18
  displayName: "NavbarItem__IconWrapper",
19
19
  componentId: "SD__sc-1pvzq3w-3"
@@ -27,13 +27,15 @@ export function NavbarItem(_ref) {
27
27
  component,
28
28
  onClick,
29
29
  variant,
30
- ident = 0
30
+ ident = 0,
31
+ active
31
32
  } = _ref;
32
33
  var uid = useUID();
33
34
  return /*#__PURE__*/_jsxs(NavbarItemRoot, {
34
35
  as: component,
35
36
  onClick: onClick,
36
37
  "aria-labelledby": uid,
38
+ "data-active": active,
37
39
  style: {
38
40
  marginTop: gutter ? '16px' : '0',
39
41
  paddingLeft: (ident + 1) * 20
@@ -4,6 +4,7 @@ import { Menu as MenuIcon, MenuOpen } from '@material-ui/icons';
4
4
  import { Color, Inline, useResponsiveValue } from '@superdispatch/ui';
5
5
  import { useMemo } from 'react';
6
6
  import styled from 'styled-components';
7
+ import { NavbarAccordion } from "./NavbarAccordion.js";
7
8
  import { useNavbarContext } from "./NavbarContext.js";
8
9
  import { NavbarBadge, NavbarItem, NavbarLabel } from "./NavbarItem.js";
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -66,7 +67,7 @@ export function NavbarMenuItem(_ref4) {
66
67
  var Content = /*#__PURE__*/styled.div.withConfig({
67
68
  displayName: "NavbarList__Content",
68
69
  componentId: "SD__sc-19zrmxc-5"
69
- })(["height:100%;min-height:50px;overflow:scroll;&[aria-expanded='false']{", ",", "{visibility:hidden;}}"], NavbarBadge, NavbarLabel);
70
+ })(["height:100%;min-height:50px;overflow-y:auto;overflow-x:hidden;&[aria-expanded='false']{", ",", "{display:none;}}"], NavbarBadge, NavbarLabel);
70
71
  export function NavbarList(_ref5) {
71
72
  var {
72
73
  header,
@@ -106,6 +107,15 @@ export function NavbarList(_ref5) {
106
107
  children: filteredItems.map(item => {
107
108
  var index = filteredItems.indexOf(item);
108
109
  var prev = filteredItems[index - 1];
110
+
111
+ if ('items' in item) {
112
+ return /*#__PURE__*/_createElement(NavbarAccordion, _objectSpread(_objectSpread({}, item), {}, {
113
+ key: item.key,
114
+ gutter: prev && prev.groupKey !== item.groupKey,
115
+ onClick: item.onClick
116
+ }));
117
+ }
118
+
109
119
  return /*#__PURE__*/_createElement(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
110
120
  key: item.key,
111
121
  gutter: prev && prev.groupKey !== item.groupKey,
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ReactNode, ForwardRefExoticComponent, RefAttributes, Ref, AriaAttributes, MouseEventHandler, FocusEventHandler, HTMLAttributes, ComponentType, ReactElement, MouseEvent, Key, CSSProperties, ReactChild } from 'react';
2
+ import { ReactNode, ForwardRefExoticComponent, RefAttributes, Ref, AriaAttributes, MouseEventHandler, FocusEventHandler, HTMLAttributes, AnchorHTMLAttributes, FunctionComponent, ReactElement, ComponentType, MouseEvent, Key, CSSProperties, ReactChild } from 'react';
3
3
  import { CSSTransition } from 'react-transition-group';
4
4
  import { CSSTransitionProps } from 'react-transition-group/CSSTransition';
5
5
  import { SpaceProp, NegativeSpaceProp, ResponsiveProp, ColorProp } from '@superdispatch/ui';
@@ -163,6 +163,21 @@ interface FileListItemProps {
163
163
  }
164
164
  declare const FileListItem: ForwardRefExoticComponent<FileListItemProps & RefAttributes<HTMLDivElement>>;
165
165
 
166
+ declare type LinkComponentProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> & {
167
+ href: string;
168
+ truncate?: number;
169
+ };
170
+ interface LinkedTextProps extends Omit<LinkComponentProps, 'ref' | 'href'> {
171
+ children?: null | string;
172
+ linkComponent?: FunctionComponent<LinkComponentProps>;
173
+ }
174
+ declare function LinkedText({ children, linkComponent, ...props }: LinkedTextProps): ReactElement | null;
175
+
176
+ interface MultilineTextProps {
177
+ overflowWrap?: Extract<Property.OverflowWrap, 'anywhere' | 'break-word' | 'normal'>;
178
+ }
179
+ declare const MultilineText: StyledComponent<"span", DefaultTheme, MultilineTextProps, never>;
180
+
166
181
  interface NavbarBottomBarItem {
167
182
  active?: boolean;
168
183
  value: string;
@@ -178,6 +193,14 @@ interface NavbarBottomBarProps {
178
193
  }
179
194
  declare function NavbarBottomBar({ items, hasMenuBadge, }: NavbarBottomBarProps): ReactElement;
180
195
 
196
+ interface NavbarAccordionProps {
197
+ label: ReactNode;
198
+ icon?: ReactNode;
199
+ gutter?: boolean;
200
+ items: NavbarItemOptions[];
201
+ onClick: (event: MouseEvent<HTMLDivElement>) => void;
202
+ }
203
+
181
204
  declare const NavbarBadge: StyledComponent<"span", DefaultTheme, {}, never>;
182
205
  declare const NavbarLabel: StyledComponent<"span", DefaultTheme, {}, never>;
183
206
  interface NavbarItemProps {
@@ -189,8 +212,9 @@ interface NavbarItemProps {
189
212
  ident?: number;
190
213
  gutter?: boolean;
191
214
  variant?: 'danger' | 'primary';
215
+ active?: boolean;
192
216
  }
193
- declare function NavbarItem({ label, gutter, badge, icon, component, onClick, variant, ident, }: NavbarItemProps): ReactElement;
217
+ declare function NavbarItem({ label, gutter, badge, icon, component, onClick, variant, ident, active, }: NavbarItemProps): ReactElement;
194
218
 
195
219
  interface NavbarMenuItemProps {
196
220
  icon?: ReactNode;
@@ -199,6 +223,11 @@ interface NavbarMenuItemProps {
199
223
  component?: ComponentType<HTMLAttributes<HTMLElement>>;
200
224
  }
201
225
  declare function NavbarMenuItem({ label, icon, onClick, component, }: NavbarMenuItemProps): ReactElement;
226
+ interface NavbarAccordionOptions extends NavbarAccordionProps {
227
+ key: Key;
228
+ groupKey?: Key;
229
+ hide?: boolean;
230
+ }
202
231
  interface NavbarItemOptions extends NavbarItemProps {
203
232
  key: Key;
204
233
  groupKey?: Key;
@@ -206,7 +235,7 @@ interface NavbarItemOptions extends NavbarItemProps {
206
235
  }
207
236
  interface NavbarListProps {
208
237
  header: ReactNode;
209
- items: NavbarItemOptions[];
238
+ items: Array<NavbarItemOptions | NavbarAccordionOptions>;
210
239
  footer?: ReactNode;
211
240
  }
212
241
  declare function NavbarList({ header, items, footer, }: NavbarListProps): ReactElement;
@@ -322,4 +351,4 @@ interface TextBoxProps {
322
351
  }
323
352
  declare const TextBox: ForwardRefExoticComponent<TextBoxProps & RefAttributes<HTMLElement>>;
324
353
 
325
- export { Alert, AlertProps, AlertSeverityProp, AnchorButton, AnchorButtonProps, Banner, BorderRadiusProp, BorderWidthProp, Box, BoxProps, Button, ButtonArea, ButtonAreaProps, ButtonProps, ButtonSizeProp, ButtonVariantProp, Container, ContainerProps, DescriptionItem, DescriptionItemProps, FileDropZone, FileDropZoneProps, FileListItem, FileListItemProps, MarginProp, Navbar, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarBottomBarItem, NavbarItem, NavbarItemOptions, NavbarItemProps, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, NavbarMenuItemOption, Sidebar, SidebarContainer, SidebarContainerProps, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemActionProps, SidebarMenuItemAvatar, SidebarMenuItemAvatarProps, SidebarMenuItemProps, SidebarProps, SidebarSubheader, SidebarSubheaderProps, TextAlignProp, TextBox, TextBoxProps, TextColorProp, TextDisplayProp, TextVariantProp, formatBytes, toBytes, useNavbarContext };
354
+ export { Alert, AlertProps, AlertSeverityProp, AnchorButton, AnchorButtonProps, Banner, BorderRadiusProp, BorderWidthProp, Box, BoxProps, Button, ButtonArea, ButtonAreaProps, ButtonProps, ButtonSizeProp, ButtonVariantProp, Container, ContainerProps, DescriptionItem, DescriptionItemProps, FileDropZone, FileDropZoneProps, FileListItem, FileListItemProps, LinkComponentProps, LinkedText, LinkedTextProps, MarginProp, MultilineText, MultilineTextProps, Navbar, NavbarAccordionOptions, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarBottomBarItem, NavbarItem, NavbarItemOptions, NavbarItemProps, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, NavbarMenuItemOption, Sidebar, SidebarContainer, SidebarContainerProps, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemActionProps, SidebarMenuItemAvatar, SidebarMenuItemAvatarProps, SidebarMenuItemProps, SidebarProps, SidebarSubheader, SidebarSubheaderProps, TextAlignProp, TextBox, TextBoxProps, TextColorProp, TextDisplayProp, TextVariantProp, formatBytes, toBytes, useNavbarContext };
package/dist-web/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { CheckCircle, Info, Error, Image, Refresh, Delete, Menu, MenuOpen, OpenInNew } from '@material-ui/icons';
1
+ import { CheckCircle, Info, Error, Image, Refresh, Delete, Menu, ExpandMore, MenuOpen, OpenInNew } from '@material-ui/icons';
2
2
  import { Alert as Alert$1 } from '@material-ui/lab';
3
3
  import { Color, parseResponsiveProp, isColorProp, parseSpaceProp, Stack, mergeRefs, useUID, isEmptyReactNode, Columns, Column, Inline, CardButton, useResponsiveValue } from '@superdispatch/ui';
4
4
  import { forwardRef, useState, useEffect, useRef, useLayoutEffect, Suspense, memo, useContext, createContext, useMemo, createElement } from 'react';
@@ -7,9 +7,10 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
8
8
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
9
9
  import { CSSTransition } from 'react-transition-group';
10
- import { ButtonBase, Typography, CircularProgress, SvgIcon, Link, Tooltip, IconButton, BottomNavigation, BottomNavigationAction, useTheme, useMediaQuery, Drawer, Avatar, MenuItem, Menu as Menu$1, Divider as Divider$1, Checkbox } from '@material-ui/core';
10
+ import { ButtonBase, Typography, CircularProgress, SvgIcon, Link, Tooltip, IconButton, BottomNavigation, BottomNavigationAction, AccordionSummary, Accordion, useTheme, useMediaQuery, Drawer, Avatar, MenuItem, Menu as Menu$1, Divider as Divider$1, Checkbox } from '@material-ui/core';
11
11
  import { mdiUpload, mdiFilePdfBox, mdiTextBox } from '@mdi/js';
12
12
  import Dropzone from 'react-dropzone';
13
+ import { Anchorme } from 'react-anchorme';
13
14
  import { noop } from 'lodash';
14
15
 
15
16
  function colorMixin(textColor, backgroundColor, buttonHoverColor) {
@@ -1005,6 +1006,52 @@ var FileListItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
1005
1006
  });
1006
1007
  if (process.env.NODE_ENV !== "production") FileListItem.displayName = "FileListItem";
1007
1008
 
1009
+ var _excluded$6 = ["color", "target", "rel"],
1010
+ _excluded2$2 = ["children", "linkComponent"];
1011
+ var DefaultLinkComponent = /*#__PURE__*/forwardRef((_ref, ref) => {
1012
+ var {
1013
+ color,
1014
+ target = '_blank',
1015
+ rel = 'noreferrer noopener'
1016
+ } = _ref,
1017
+ props = _objectWithoutProperties(_ref, _excluded$6);
1018
+
1019
+ return /*#__PURE__*/jsx(Link, _objectSpread(_objectSpread({}, props), {}, {
1020
+ ref: ref,
1021
+ rel: rel,
1022
+ target: target
1023
+ }));
1024
+ });
1025
+ if (process.env.NODE_ENV !== "production") DefaultLinkComponent.displayName = "DefaultLinkComponent";
1026
+ DefaultLinkComponent.displayName = 'DefaultLinkComponent';
1027
+ function LinkedText(_ref2) {
1028
+ var {
1029
+ children,
1030
+ linkComponent = DefaultLinkComponent
1031
+ } = _ref2,
1032
+ props = _objectWithoutProperties(_ref2, _excluded2$2);
1033
+
1034
+ if (!children) {
1035
+ return null;
1036
+ }
1037
+
1038
+ return /*#__PURE__*/jsx(Anchorme, _objectSpread(_objectSpread({}, props), {}, {
1039
+ linkComponent: linkComponent,
1040
+ children: children
1041
+ }));
1042
+ }
1043
+
1044
+ var MultilineText = /*#__PURE__*/styled.span.withConfig({
1045
+ displayName: "MultilineText",
1046
+ componentId: "SD__sc-34heyp-0"
1047
+ })(["white-space:pre-wrap;overflow-wrap:", ";"], _ref => {
1048
+ var {
1049
+ overflowWrap = 'normal'
1050
+ } = _ref;
1051
+ return overflowWrap;
1052
+ });
1053
+ MultilineText.displayName = 'MultilineText';
1054
+
1008
1055
  var NavbarContext = /*#__PURE__*/createContext({
1009
1056
  isDrawerOpen: false,
1010
1057
  isExpanded: false,
@@ -1083,7 +1130,7 @@ var NavbarLabel = /*#__PURE__*/styled.span.withConfig({
1083
1130
  var NavbarItemRoot = /*#__PURE__*/styled.div.withConfig({
1084
1131
  displayName: "NavbarItem__NavbarItemRoot",
1085
1132
  componentId: "SD__sc-1pvzq3w-2"
1086
- })(["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:", ";}"], Color.White, Color.Blue300);
1133
+ })(["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:", ";}"], Color.White, Color.Blue300, Color.Blue300);
1087
1134
  var IconWrapper$1 = /*#__PURE__*/styled.div.withConfig({
1088
1135
  displayName: "NavbarItem__IconWrapper",
1089
1136
  componentId: "SD__sc-1pvzq3w-3"
@@ -1097,13 +1144,15 @@ function NavbarItem(_ref) {
1097
1144
  component,
1098
1145
  onClick,
1099
1146
  variant,
1100
- ident = 0
1147
+ ident = 0,
1148
+ active
1101
1149
  } = _ref;
1102
1150
  var uid = useUID();
1103
1151
  return /*#__PURE__*/jsxs(NavbarItemRoot, {
1104
1152
  as: component,
1105
1153
  onClick: onClick,
1106
1154
  "aria-labelledby": uid,
1155
+ "data-active": active,
1107
1156
  style: {
1108
1157
  marginTop: gutter ? '16px' : '0',
1109
1158
  paddingLeft: (ident + 1) * 20
@@ -1120,6 +1169,93 @@ function NavbarItem(_ref) {
1120
1169
  });
1121
1170
  }
1122
1171
 
1172
+ var NavbarAccordionLabel = /*#__PURE__*/styled.span.withConfig({
1173
+ displayName: "NavbarAccordion__NavbarAccordionLabel",
1174
+ componentId: "SD__sc-1s7g3kw-0"
1175
+ })(["flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;&[data-expanded='false']{display:none;}"]);
1176
+ var NavbarAccordionRoot = /*#__PURE__*/styled(Accordion).withConfig({
1177
+ displayName: "NavbarAccordion__NavbarAccordionRoot",
1178
+ componentId: "SD__sc-1s7g3kw-1"
1179
+ })(_ref => {
1180
+ var {
1181
+ gutter
1182
+ } = _ref;
1183
+ return 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', Color.White, gutter ? '16px' : '0');
1184
+ });
1185
+ var NavbarAccordionSummary = /*#__PURE__*/styled(AccordionSummary).withConfig({
1186
+ displayName: "NavbarAccordion__NavbarAccordionSummary",
1187
+ componentId: "SD__sc-1s7g3kw-2"
1188
+ })(["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;}}"], Color.Blue300);
1189
+ var IconWrapper$2 = /*#__PURE__*/styled.div.withConfig({
1190
+ displayName: "NavbarAccordion__IconWrapper",
1191
+ componentId: "SD__sc-1s7g3kw-3"
1192
+ })(["width:24px;margin-right:8px;& svg{font-size:24px;}"]);
1193
+ function NavbarAccordion(_ref2) {
1194
+ var {
1195
+ label,
1196
+ icon,
1197
+ gutter,
1198
+ items,
1199
+ onClick: _onClick
1200
+ } = _ref2;
1201
+ var uid = useUID();
1202
+ var {
1203
+ isExpanded: isMenuExpanded,
1204
+ isDrawerOpen,
1205
+ setDrawerOpen
1206
+ } = useNavbarContext();
1207
+ var [isExpanded, setExpanded] = useState(false);
1208
+ useEffect(() => {
1209
+ if (!isMenuExpanded) {
1210
+ setExpanded(false);
1211
+ }
1212
+ }, [isMenuExpanded]);
1213
+ return /*#__PURE__*/jsxs(NavbarAccordionRoot, {
1214
+ "aria-labelledby": uid,
1215
+ gutter: !!gutter,
1216
+ expanded: isExpanded,
1217
+ onClick: event => {
1218
+ if (isMenuExpanded || isDrawerOpen) {
1219
+ setExpanded(!isExpanded);
1220
+ }
1221
+
1222
+ _onClick(event);
1223
+ },
1224
+ square: true,
1225
+ children: [/*#__PURE__*/jsxs(NavbarAccordionSummary, {
1226
+ "data-active": !isExpanded && items.some(item => item.active),
1227
+ "data-expanded": isMenuExpanded || isDrawerOpen,
1228
+ expandIcon: /*#__PURE__*/jsx(ExpandMore, {}),
1229
+ children: [/*#__PURE__*/jsx(IconWrapper$2, {
1230
+ children: icon
1231
+ }), /*#__PURE__*/jsx(NavbarAccordionLabel, {
1232
+ id: uid,
1233
+ "data-expanded": isMenuExpanded || isDrawerOpen,
1234
+ children: label
1235
+ })]
1236
+ }), items.map(item => {
1237
+ var index = items.indexOf(item);
1238
+ var prev = items[index - 1];
1239
+ return /*#__PURE__*/createElement(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
1240
+ key: item.key,
1241
+ ident: 1,
1242
+ active: item.active,
1243
+ gutter: prev && prev.groupKey !== item.groupKey,
1244
+ onClick: event => {
1245
+ var _item$onClick;
1246
+
1247
+ event.stopPropagation();
1248
+ (_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
1249
+
1250
+ if (!event.isDefaultPrevented()) {
1251
+ setDrawerOpen(false);
1252
+ }
1253
+ }
1254
+ }));
1255
+ })]
1256
+ });
1257
+ }
1258
+
1123
1259
  var Header = /*#__PURE__*/styled.div.withConfig({
1124
1260
  displayName: "NavbarList__Header",
1125
1261
  componentId: "SD__sc-19zrmxc-0"
@@ -1177,7 +1313,7 @@ function NavbarMenuItem(_ref4) {
1177
1313
  var Content = /*#__PURE__*/styled.div.withConfig({
1178
1314
  displayName: "NavbarList__Content",
1179
1315
  componentId: "SD__sc-19zrmxc-5"
1180
- })(["height:100%;min-height:50px;overflow:scroll;&[aria-expanded='false']{", ",", "{visibility:hidden;}}"], NavbarBadge, NavbarLabel);
1316
+ })(["height:100%;min-height:50px;overflow-y:auto;overflow-x:hidden;&[aria-expanded='false']{", ",", "{display:none;}}"], NavbarBadge, NavbarLabel);
1181
1317
  function NavbarList(_ref5) {
1182
1318
  var {
1183
1319
  header,
@@ -1217,6 +1353,15 @@ function NavbarList(_ref5) {
1217
1353
  children: filteredItems.map(item => {
1218
1354
  var index = filteredItems.indexOf(item);
1219
1355
  var prev = filteredItems[index - 1];
1356
+
1357
+ if ('items' in item) {
1358
+ return /*#__PURE__*/createElement(NavbarAccordion, _objectSpread(_objectSpread({}, item), {}, {
1359
+ key: item.key,
1360
+ gutter: prev && prev.groupKey !== item.groupKey,
1361
+ onClick: item.onClick
1362
+ }));
1363
+ }
1364
+
1220
1365
  return /*#__PURE__*/createElement(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
1221
1366
  key: item.key,
1222
1367
  gutter: prev && prev.groupKey !== item.groupKey,
@@ -1311,7 +1456,7 @@ function Navbar(_ref) {
1311
1456
  });
1312
1457
  }
1313
1458
 
1314
- var _excluded$6 = ["title", "subtitle", "children"];
1459
+ var _excluded$7 = ["title", "subtitle", "children"];
1315
1460
  var StyledTypography = /*#__PURE__*/styled(Typography).withConfig({
1316
1461
  displayName: "NavbarAvatar__StyledTypography",
1317
1462
  componentId: "SD__sc-19q2zd0-0"
@@ -1322,7 +1467,7 @@ function NavbarAvatar(_ref) {
1322
1467
  subtitle,
1323
1468
  children
1324
1469
  } = _ref,
1325
- props = _objectWithoutProperties(_ref, _excluded$6);
1470
+ props = _objectWithoutProperties(_ref, _excluded$7);
1326
1471
 
1327
1472
  var {
1328
1473
  isExpanded,
@@ -1753,5 +1898,5 @@ var SidebarSubheader = /*#__PURE__*/forwardRef((_ref, ref) => {
1753
1898
  });
1754
1899
  if (process.env.NODE_ENV !== "production") SidebarSubheader.displayName = "SidebarSubheader";
1755
1900
 
1756
- export { Alert, AnchorButton, Banner, Box, Button, ButtonArea, Container, DescriptionItem, FileDropZone, FileListItem, Navbar, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarItem, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, Sidebar, SidebarContainer, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemAvatar, SidebarSubheader, TextBox, formatBytes, toBytes, useNavbarContext };
1901
+ export { Alert, AnchorButton, Banner, Box, Button, ButtonArea, Container, DescriptionItem, FileDropZone, FileListItem, LinkedText, MultilineText, Navbar, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarItem, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, Sidebar, SidebarContainer, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemAvatar, SidebarSubheader, TextBox, formatBytes, toBytes, useNavbarContext };
1757
1902
  //# sourceMappingURL=index.js.map